From c472b92eaf8d19bb306e49dcf3744175133ca933 Mon Sep 17 00:00:00 2001 From: Jason Date: Sun, 26 May 2024 12:36:29 -0500 Subject: [PATCH 01/50] feat: PBR Preview Plugin (#1) * feat: PBR Preview plugin - Initial plugin commit * upd: Add channel dialog - Created dialog for explicit channel assignment * feat: Add PBR preview controls - Added buttons to control PBR preview scene * upd: Use Preview class for PBR Mode Added PBR mode with a Preview class * feat: Material panel - Updated material definition UI with a custom panel component * fix: Toggle off - Fixed preview update when turn channels off * feat: Added more display settings controls - Added tonemapping select * upd: Render on display changes * fix: Updated localStorage logic - Fixed saving materials with projects * chore: Apply formatting / Remove unused code - Add basic styles for display settings panel * feat: Generate MER map - Created Action to join metal, emissive, and roughness layers into MER map * upd: Hide grid in PBR mode * feat: Plugin icon * feat: Generate texture set JSON * feat: Generate normal map from height map * feat: Add decode MER option - Split existing MER textures into PBR channels * feat: Get emissive color from albedo Infer the emissive color when decoding MERs if the albedo map is defined. * fix: Render nearest neighbor on textures - Made rendering pixelated - Added plugin info - Fixed normal map creation method reference * feat: PBR view in edit and paint modes - Modified plugin to allow PBR preview while in Edit and Paint mode * upd: Redraw canvas on update * upd: Optimized event subscription Added event listeners in a loop and centralized functions * upd: Avoid empty albedo in edit/paint mode * upd: Use layers for material channels * upd: Activate project elements / Update faces * upd: Toggle channels with layer * refactor: OOP material - Storing material channels within extended classes and properties * upd: BB UI / Action-based functions - Refactored to use more native Blockbench UI elements * fix: Corrected deactivation function * fix: Channel unassignment * fix: MER generation * upd: Unassign old channels - Unassign existing channel before assigning it to a new channel. No multi-use channels * upd: Correct texture set export * fix: Hide extended project settings * upd: Features outline in about.md * chore: Add changelog & descriptions * upd: Add project PBR mode - Updated doc blocks - Added safety checks - Added `Project.pbr_active` to replace relying on Settings.get(pbr_active) - Removed unused Actions * upd: Plugin about section - Plus minified latest build --- plugins/pbr_preview/LICENSE.MD | 674 +++++++++++ plugins/pbr_preview/about.md | 84 ++ plugins/pbr_preview/changelog.json | 15 + plugins/pbr_preview/icon.png | Bin 0 -> 34443 bytes plugins/pbr_preview/members.yml | 4 + plugins/pbr_preview/pbr_preview.js | 1 + src/pbr_preview/.prettierignore | 3 + src/pbr_preview/.vscode/settings.json | 4 + src/pbr_preview/package.json | 25 + src/pbr_preview/src/index.ts | 1487 +++++++++++++++++++++++++ src/pbr_preview/tsconfig.json | 111 ++ 11 files changed, 2408 insertions(+) create mode 100644 plugins/pbr_preview/LICENSE.MD create mode 100644 plugins/pbr_preview/about.md create mode 100644 plugins/pbr_preview/changelog.json create mode 100644 plugins/pbr_preview/icon.png create mode 100644 plugins/pbr_preview/members.yml create mode 100644 plugins/pbr_preview/pbr_preview.js create mode 100644 src/pbr_preview/.prettierignore create mode 100644 src/pbr_preview/.vscode/settings.json create mode 100644 src/pbr_preview/package.json create mode 100644 src/pbr_preview/src/index.ts create mode 100644 src/pbr_preview/tsconfig.json diff --git a/plugins/pbr_preview/LICENSE.MD b/plugins/pbr_preview/LICENSE.MD new file mode 100644 index 00000000..f288702d --- /dev/null +++ b/plugins/pbr_preview/LICENSE.MD @@ -0,0 +1,674 @@ + 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 +. diff --git a/plugins/pbr_preview/about.md b/plugins/pbr_preview/about.md new file mode 100644 index 00000000..161dc8bb --- /dev/null +++ b/plugins/pbr_preview/about.md @@ -0,0 +1,84 @@ +__Create textures for Bedrock shaders with PBR support (Deferred Rendering / RTX)__ + +## Features + +### PBR Material Preview +- Preview PBR textures in Edit, Paint, and Animate mode. +- Infers texture channels based on naming conventions when no channel has been explicitly defined. Intended for previewing imported Bedrock PBR textures. + +> _PBR:_ Physically based rendering + +#### Auto-Updated Preview +- PBR materials are updated with every edit to provide a (nearly) live painting preview of the material in Blockbench. + +### MER Maps +> _MER:_ Metallic, emissive, and roughness maps assigned to red, green, and blue channels respectively. It is the format used in Bedrock texture sets. +#### Decode MER +- MERs can be inferred and decoded automatically when PBR mode is enabled. +- Decoding can be _slow_ on large textures (1024x+). +- Assign an albedo map prior to decoding a MER to extract the emissive color. + +#### Export MER +- Compiles metal, emissive and roughness channels into MER texture. +- (Emissive colors will be lost upon export. Use grayscale values in emissive channels for accurate brightness levels.) + +### Generate Normal Map +- Calculate normal map based on the assigned or inferred height map for the currently selected material/texture. + +### Export Texture Set +- Create a `.texture_set.json` file for the project textures. +- Dialog allows defining values which can not be inferred from project. +- Exports MER in the process. + +## Usage + +### PBR Settings + +This plugin adds the _PBR Settings_ panel, which controls enabling and disabling PBR materials in Blockbench previews. + +#### Toggle PBR + +- Use the _PBR Preview_ toggle to toggle or refresh the PBR preview. Also found in the _View_ menu. + +#### Toggle Corrected Lighting + +- Use the _Correct Lights_ toggle to enable or disable physically-corrected lighting in the preview scene. This may improve the appearance of reflective and emissive materials in the preview scene, but will dim the albedo/base color texture. + +#### Tone Mapping + +- The _Tone Mapping_ setting will apply various tone mapping techniques to the preview scene. Use the _Linear_ option to match the tone map used by most Bedrock shaders. + +#### Exposure + +- The scene exposure can be adjusted once a tone map technique is selected. Values range from -2.0 to 2.0. + +### Channel Management + +Control which textures or texture layers are used for PBR channels using the following methods:W + +#### Channel Naming Convention + +The plugin will assume that textures and layers which end in an underscore and a channel name are intended to be used as that channel. For example, `texture_roughness` will be used as the roughness map unless the channel has been manually assigned a texture. + +#### Supported Channels +| Channel | Description | Colorspace | +|-----------|-------------|------------| +| `ao` | Ambient Occlusion | __BW__ | +| `albedo` | Albedo / Base Color | __RGB__ | +| `normal` | DirectX Normal Map | __RGB__ | +| `metalness` | Metallic map | __BW__ | +| `roughness` | Roughness map | __BW__ | +| `emissive` | Emissive map | Displayed in __RGB__; Exported as __BW__ in MER | +| `sss` | Subsurface Scattering | __BW__; Not supported by shader but exported in MER alpha channel | + +#### Explicit Channel Assignment + +Create a Texture Layer in Blockbench to enable channel assignment in PBR previews. Each channel can be selected from a menu and applied to the current material. The menu is visible in the _PBR Settings_ panel when in Paint mode. The menu options are also available in the _Image_ menu. + +#### Removing Channel Assignment + +Channels can be disabled by hiding or deleting the layer, or un-assigning the channel in the menu. Texture layers cannot be assigned to more than one channel. Assigning a layer to a new channel will clear the layer's current channel. + +## Roadmap +- Java project support +- labPBR texture exports \ No newline at end of file diff --git a/plugins/pbr_preview/changelog.json b/plugins/pbr_preview/changelog.json new file mode 100644 index 00000000..edadc3cf --- /dev/null +++ b/plugins/pbr_preview/changelog.json @@ -0,0 +1,15 @@ +{ + "1.0.0": { + "title": "1.0.0", + "date": "2024-05-25", + "author": "Jason J. Gardner", + "categories": [ + { + "title": "PBR plugin", + "list": [ + "Initial release 🚀" + ] + } + ] + } +} \ No newline at end of file diff --git a/plugins/pbr_preview/icon.png b/plugins/pbr_preview/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..273eda51df5a74eb0a27d917d4284a0f0fb17198 GIT binary patch literal 34443 zcmV)yK$5?SP)&Cr{&x7{NjKkHxvHykM5EDYWPpeim;h0- zWm)Ffv}IAYH8kzfcr1^{^y5HV&&aZ=u_cYI(IktML{Zd`A}Ny~L4X8E5V><#cU4!q zIh_2Z9p;byo!d>2AOTSJd2pY??W%k3IcM*^_FC_H-**Y`J%60XM?Ufqe)U&>6)7bE z-g~_FNGXv@0U)HrJCCylr4$H(kTQHBFm;W`qqN3*4_*M_IgBwxag1{oYYajNKp+H| zrr{5I{n_%ynXR*D9$H#kyVBb@e~-v|n@ek(TfMdQjX^gX#A%*(vqbl__ru!Ds;a%M z>%tY2nJmXgsyIH1ild{0R|mPIl7#@`hsDc(7vB*8W{))?X> z#ybyqgb>tqLlj3i>oCR=B{4WpV`_v@;b+nmDJA86hLj2+1Uin9Qc~9y&RPT_e6~tr zjo~l+g}=bx`dfeNkF|dKkMqNy{NyM3)nEP9c2WMfd6=g8J>RdduWhWJIsfqL#j8&* zUw+`Rw_e?N$VGWJI`b5Mu*Ieuk}FR)i&>5unx-KYhSU|jc5IpZ2puQH!m}4` z;O1lQlY1!PaVqBP(;l~X_76{PUw>ie=Jl`a+_?7a?#=68JKEj8HXELd!t1J$Ds1Tg zwI8ZISbzI(|84sHK7aME{?+gJxx{xG0Y3cU5A&%{eJVVO5T~2qe~k#RIPHta#rq$A z{{v4w^F8-H`uKadF5mk^Z*3z>mNzg?aNq1%2GbkN$oXpYD3@1Kp6(90d3P7*ELpG5 z@}N&KFZlAl? zqgyXM_xWpI|MIWC^xMDj^EoaMkMKAD=HL9^ zZUcPslb_`0e(vW^7yr$F{`1)Y61=5p>Nghsz6alP`H?67#6!=#_xtaC;;oOaZfxPb zXErZs$~o40%xp+D-{+C7n9bECKDFCrE3J9&S-5#P;m-CB{r-USt3AGcta)zMC5sh_ zuj$ws2Xcwj%y>(G%u`p^xO+I{tHTcCbd!2EAxmQv9+W~TO`K-r{Q*iUwr}0w#uq>P zsawDEzx?d;&%N;JSFYW7Ve#6fl*DO_GynWH0Dv_H=Ntfk`7i(F? z{d3p=I*Kq&jWrg4Ebpwn<-0!i7aw`Y`~J+;$De$-zq)}Jf@(HJni{Dz-i3c_ou{yn z)9{|PIkU#`+5ME-dfu|;x!g5OikeQA5qZP!97OE74zrU(u67$f_`ov1{_2!hn`Qcm z;!3xnu#($Njy|}?y?I5sd=F!h6XC-96%q$X0d!Wl+!wrab;6zPU4G|xpZ)b;`P66r z(a-+uKm8x;x~?IFZtwZ$x&eUGP4JyW0`=oR{^Q^BKmOz=Kglos(l7nK#s6mCi#9P7 zLVySFT}T$&D?{Fxv8_{Tr|!FT^Fan>E|?CjkfjmAUoL!^^JV4V%`!#R`=Vcj$hLP&%V zNEJ4MwHELFX?`J9n{c-aFGScFU;N@1na}5ZHw~&d;e~O^i{*e!Ib1o#Rt4|9y3ATXLaA^Cy>NYpW{81N*25l?8`<{rEOfsA`99DwkQgC}z)5JXzDZrL! z9fxe*LcclUeBQ7<@s!ECu4eP#KF|? znmEJqpvSdWuFZe#XaD|B{@maBAO6F|`-+p4VmAGbBf#SE?L>kBH(xPr)$^T3fH!~k-)bcI zrV-#K` zmf7(ESu^Gn&s-s;;R~k2!2 z2Rt+|eC*+68WdGoGMdbBJ|u@iYP2`Je%x@=uaoze&}NRpqtXtYwM{0K~}TB4N**M)buHit;#81FsCnvhEX zjSUd7l8V|m?nx$WbQH%k!__kbrlTRZhKAmtk9LN&r7pR$eEHUd=jUDIV1qAu!I)rX&RQ626&ZF=Now2;5>+?U|BbujAt0WDAAaP~cYWYr+kWlZONV!Fz3jasisSDn0=#(* z{-{Xs`!>LbKm6fud-1>N1`q<%7(gulTYu?Ce(C@4zyH_%(rwr0`8y-}{SGGSV(XF* zTD+#S_)`+X*j;O5XUNml4BErTgJ8BclkD_`NQTM1j|&U1TgXdGzai6l&GM;yo0 zC}h3_LQ+))sECY)i+zE0i`NqR07?lYjDySy6Mmze|%WgHlZQx7j#% zA$!j!{>6W(v%L1e*FXEIe`K15I7!+F^zCneH*bQ^eeQGY?d|cs-}}Aad;@$ZC;yvm z0KCUJ$LiLZ@A^Of2mkIr{g;36yPv#!JmV{)l&sq!5gsW7T@C9QVw;S;K5Bk_Vm5no;Z$&Gp-CIkFE-G?GZw=+0z`CJ|v&*m1Bh_a|QRTXiDSo z2&4enzCYt7+8c(oWMUPrF3F|E#63pQ8Yqph4Z_yg`2?)tE${uV$IjmS&_`bU-Oqh? zIyyNHIg~&BjK7@?@a9eM2StL@9N^o%^Z&37u(*5fdE|+|^yB~Gzx|UB-FF#N7VH(0 z&mSn_NVg3Q&j&UNx)Ep`U)#5Q2%NPndOXGUPI!x+AHP^pXJPG(s~v+~;lmArIbjo>5^?5`+&GPt`c;23{zZ7}cKfvDh-R39%{eScOuYc`}zYL+j;GFxGbAWGr{6RT^ z`tcwC@juqd|Hcil_$5!g<6S@T@Bi3e_%H6iu*qmLCsI&5!S-CSXqXw}$tk(mvFy$q z&mVfw2?~#Mo+OUIhm$0w!Wi>=+RgwNJrs+_R*y*7Dqe;l?bYE{m`@ z2#mE9rQy*v#V6l+KSF7CkA~F7vffL{B1P#0PDr#0*hQiw)5>zvXtGF$D#TiR)@OHT zkIlHEx3q*YhPtj%QW9%LVKq1BidYGBk}zx94eKni1g~S7szgbNi!y{Y6vumXH_xkQ zKK{u+cd~u^==QajzTmwhTrJ^Xe5(=Q&1>|HkwAUsGoRs?fBBdHSc|{-*~Q|&@4LVE zr~l%=`LF!QnSMlBmUI$DIh}HArZ}d9t4f4-6je=AH5lvo;!(oLXmY(+aESz53ygRi zT4|(G)O7P7!+oyLGorkM^dV}5EntbY=B*dHB+@dR z*J!Ot(}XzdF)td*VtSg;l~qX|DQcB-cP7xnprk@bftG@q>`_mLoaqXpB%y9B#yWc4 zoZ7;jv7;6djdiCDrM5AEt1FT;!$tw8P(pxG6w?WL67!Dl{}(@AS7qngm%s2U09xzs zXal@?6MXJ-pJQid2le{vum7lrc)(d~3(E-GU=c_i;p&R2nDMrceBYCCl0Nj@=RW;2i=Y2a zAB#<({&_9_m3Myh(|_V)A9(-0X9iqY$+%}F!Xr2|3CFdiF6b;M!Pwc)(9z4QlX;==R)njI6({WNh}u8Gduh z);!Q_i0Ucmh%`-^&8BSMxkH>JbbDRA56Go#ar(Nhu@3UcvzfxN%^5pQ6luJWLSw0P zP8}_CzNg5vV=^3aAePuwn_w!uHDR;i+v+7iLKf8wbtD=hUp%xX_rH{czSaO}-J`z9sPzJ-R{?wyk8IK~Ri z{hbnF4M#3Vc!!h%p%h9-NFO$WKp>xBtWs{n=0cTgL~7 zEU&Ml;}EtYrSJ%}mUJS?r1H#+K&!UCR~j9~c;|4=vc0`atumaB!C4TJ4hCD7G+rPf zw1b5}druN+N-MC|_#}>nkb!q6WytWIbHs53qD2b{0Ydt)RHgA;?RoBBQLL^G7|K3H z+^3QmJCho*a*1^7DsuzV@rdg~hqM)&gOp5r?i`N!`ZxB2e6=?I5lJ}()Kr!2*uiHkUKDY#I_3$1akg*Kg~mMJdngQ*cXlvF4Y?n4>H zp+5E?fy#LrA8K>&y$B^@SYRO~&V~fi5u$@^8z{7=#GqJB1($L|Q&*ht!f4)bSXg9J z5J#Fck{It9i!Mec7!k8O_oQ~t!EnZ_^)j`LiLfA4i&iRh9OIm$scVF(IMYv2{WT6| zhRD^(By5`6dhXuY=3-X!?u!W<%N=eWSL|02F3PElVQ4bE&XC^VoyFOfhGrYAOmOY} z|CSGa{1eZA?$e(>+1tM9y~EppO?<0g;@imq7I%KP+kN`){@uUvg~R=Qe)^|>mUq4D zZG8AcA7s#p_{A57h&bb|O9hD%9JriU>lKV?uyq+0!8&}K4@e!63Bz*i*ew;td6WPv zBykjxNU+Xg?HgngFBKBsk|I4?DWsCrbwfZ&J=XegGYf%tv_A`zqTy|4G*_~k!)c8Y zf)^$Ud!;0i4i$wmEpjzhXuOI@lwfWJvJPyWQp9w0n}b+`ZR>f{)ZhZ;3n>sPYAcVL z#Fj*z9#f;(y>pAlmm8kBcMaz(yLHZ255YT&&@ra2aRhYKAy8T&b%ZsJga)1Fh_r(< zhThpr9BtpOfBa8<*Q%-ODc@#J_iaajG)@=KJfHkif0A=+ zeZIau<4)bBr#%;zQ&##puk4PwJFz5@#9D_JB7|!1Ldc2}gtug7MlB)?Z7*C1T+`s4 zrD+gS4YiS%TC7yGG2%KemRB^LP ziDZZp)|vn*`*7{xEOir3VZYl&YfV|q(Nes@SBPSYs-ZaCqu1-;l*Ss1w-zZJY2HC5 zIeRBlhI`vQx$b!9gPSyjr18$MV$XJv&QR5Liv_@RGNG($re(u;GC{`?X&j%n#M4Mq zO-F28xnG?*ckX?^`>Vh7cY)tiLH$u*-_iznbCmd@ANn)DQO>6i{o{Z93w-S3-^~yG z(4S?a7jtd&i6HC?U`2% zcc)+x#L|NZ5HC`lau&4+8UD1WaZN)K>i{J;Az~C&#o^7@IKQ<)(pzFQn=vgL=4A!m zbL;h6?B9Bg2UitOpNo0y@*0H|?CkC{pU%kgj2j12in0nYu(5QgIg>Oj#jqqQw5`Yn zt28bUYm5)T)KVHV91VH=eILD8&n9PH{_+=o0Tz6TZ(##`EB|ouxOC~_zkc@2+F!hT zXPY1T;eVAs`=`I3>B$kd4kx@?4VYSq^PV9&zMc^^Q+D+xMYh%^G2u?fdxpoy%*u*1 z&A=LbQz5*^G&RnLCXZISWdsG3}7)%n;E z5|=lY=$^U6t^E;AU9*u3?%&M0{nE1xUw@H5@z(P^dCxjYBp6OBMu!J{>Dn$f>hRX9 zn-o>e_VJt=#a8Bd`<7&_8?)X^xU>?nKIpPNv5bp~#uzSkHOrmQR{)rl6%W4s-EaHa zr~j8<93LNUOQn$FTi67uZ7qJYhxg&+Bx(Ba_kG`YKY!ueCLj2&_i_3B7I*efxHi`8 zOdVc^W{1>KxOdALTEIm0@l8n{dAtpGcI6~${}nP}I7v1ctZ!kP3Q-q9d81;OM zy|oS{Btise*h}3~z}k+OfJg^CpfMr2p}lIHF>kbtrKUmg3Sjsx9{%L>7=ZzZm@rFNHrUCefyY`Y00>Mg~Zo9(yyp{XZgZ*i7qF6@V)`5 zFpTGQXo^Y4T%^1-%Mnr#3CDw*15DE8_NbT#Br`jqn-pWn7zpGZ;#X&h14HO+j2@|IdA zBuT>k-5PC64rUfx74#wyNe8DB-g&vp#g60V*wJ`JtR->YMYPGLlz{>v+CQBOz>u>x zWc<$Hy(5Yu@FJjt)`9RX2{j;jUMhUsUnuGjR?jUZG*&R1&6pMyNgQ)&DP}c=K@2OI zTa{3ZM_hU2@zgnc?~A|ln?K`ydrydO{`H6E01LWc-s}JQ@B4x8 z`QgVNy2{d^Pe;Q^C3$HmNh5_$5~}TM^bTL-Y+plfliSBLt|k-SdrzMW%P}YOhNDK4 zr5Os#-HD~}5%0OD$9y#8WY&=PdN`@^2viH&gnXcVu~CfkZ$iv%Ecd&h zGK?{}=^-!NK4xAUu67MiT;Al7%jX#$?QnZ%4+J!g<>+L@$#BSIG~(!F#OGe#VSDcw zTNUiyzQO3^gyW-QuD|#k>f{!2GvzDKzRc^d-{kJyZAQmOyms>rw~l9MKzc{n7_8K% z8jHp{R&`A;k2x65c=(z3Jo>fY_?2HA9UW|kEB>2b1%HS-Sm3=wNwIq0<4^wAD;t|E zbrPfy>=%+wEV*~tbEk}vQgCDy^G36#A_^yohqqbVTxI8EMmLe%yBc%16wI4Ye{ZIa z^D9g2OiLbEi56Q1`YGC?x&iMz<|f7(!wvWO$8r9iU#E4cx(2Oe&YO8FK?d^3(N7OW?t6hspf22 zlQuiZQuFNBcCkoilMz)_V~nAyns7x)&uBDdHkq(?$kNH;GNt)Jnj9%6LK*-Q7ZzA7=MW@Zx3_97l!gBK4hjaNLh7V*wAp2H$WCCl8O zDxN*I?2HQfu?YIWMI*>VT@_gGiIWs(9nKjV>#!!2Vza|tq$yGTweZ@7#M*+gEZV9e zM21<}P$V7pz2j&!qpm83(~`SK6N<(%sXbF8ka3Ec-=Ua}5mF&t!*95n+BCSj;?nwn zL<@G0#(^skYs#uZM=?zkgd(RZC_-5|pU=qRm}RZl9i1@uZIbI9gG`d=9gOp2NkYea z%Az2OHNprExA&1zOuBW6hnEK2*R^bq4jCCoy?={q$t9||%UV{_IeDG${@}arefg6= z_~ZZVXMg6$0hIiM*ZG@90Pj7$EPmwTLy!D`@ANq_5nn#iT%QRpxDf-rO3?`BRYRmB z-n9uA`dy}F%)|(cPC->DAEaB>SuS=3uMZW&$(&rpRL*1SiW<*q;<>*MlZjzAH+1q0 zyvH^*#<`#;5HLDE458k8is_iTEU4;+@_3Kl(lYgU#%wsmI!iU52jHn`C}tC!kYrkt z-i8;NipjKOJ{@!7Q%c=sJ{{vtgT~X;B{39rnMWnnzBFXX&rmpGG z@W`1S4{zn18`o@4XEbX)?%(QBa=>~5%TYrI_>({Mum6>Q_D_D{zqYn45c-Wf{r5(I zZ+`mETsZ%e$zX%ta-XKV%AJv65JPvc$`|jlFj~EN)vQ;(mN)V<6PGhosaqS4M*c3k`hl~{LE)FPIkB1 zyLE$NHpL*YvoRYSj<#sZdH2X@&DXVC+JmB^VD*NP2mK0vr)obBa$OBv?mdZAe_T4x7olP|?T; zAwj!PooL}PCLo)2U16eLwfxlkM?7dbPZFFS(k=# zE;*7KCj_5-|6|c-fB4V+#Q*ny{Ga~ag%bOZi~xdAb9eIWgPT_#{Gbr9-c1loOGp)g zw`|V^H!4k|GaihmWYwIp&JijIGb-y5BE}knwGJU8q;ov5EZIt8&Mqy{Ni?&vLTil{ z5!QR=wPiJNWX+HpM}o6UIp~PlWWvi|{2aGld6Bv-Lvn~@tE)JXj!_{oXvX7FD@f5q zN}tlyJh0Zu$hAW`gV2g@qH)Heg+^#gqy*|TTn9`cd;x7TjR=QBIFE`2k(O;<;*pV} zHX$h$!r`TF^$Q-+iegP;1G_g;7_+EkEOk*L5#*gb@CcSg07d9-3LhxPO1zE4)A(%IwE9cg^ zux|O~>vN9gmhs+Q(-n>G_q%x406q{g=OBz>paT5soJWY(GeGzj3<@8tagL($i1tV? zgci;@j00mW%G%Qi=$t*(BN$V)&)tGjG6eobb}bzk>q2GX3F_n4Lm-NDNLDQ&Arz3N zDb^Ueog5`YBG~D6z(Y|KNTo3*5LhgNxq*#AhxfnbD)(JHgGw@#ZgH2Y#3T`<8Quks zqKYHxsz%2#cenTX_{Tr`r~cZ1^FOSNMx$dX-{4TT5#S9ZaIq^^H@E)VsJr~={SQ9C zh5H{0DJ+6n<2f^kdFouoM&gL6DXlz(Y4a=(yICwm9H4ZBvzDd~poUfoDK*YE2odyi zp`QzJk^nH76-XDZkLx=_yZzPAc{@8%f`+ zR3KA^g?G-AM*7^Pd++}{-HmhNfyW*v=?1O4GYvZFkfkwONyFSq3=s>ujn)x$UD8-b znq~n;6`HKmLrO(4FG!LIDHT;!qjW+PMd(Neh}as02)%@b&M(e#zVhtLy!wUDD3lgK z5*7##P18_THMFNKESwE)T|$K1qrJ~tFahgqAfu{aKDB5l^}8L6bu>*t7PZ!=?PF)% zVt{9fBcVs;U}%NMzyMAAq4u(5x`o@nR91;Y3aKKxNfyGT zid&17Q?-v*N{7tLgF*S@om;k=&!Vh1K+3RL>$=AJun@s($FMZ$;yoN5ogk$Oq7o4p zNNs#WD@B?nIOFg%Xsr+gUY>1cftIZ!taBuBOj*~&i6+uIgnlKd>Xxvg6j_$BvK$VG zwH6sgSnHV13Raf-T)ucATt~oamXl@~Tk9+2c}^Tf2=BRk`674j?y|doz-&H8>4?d6 zN)%~gttgv@PSz!gqHtZ+HL;G+QA|=8#jd}aqpIZLV zcfIF-_lv*$Yk$jocNzus;ywt1Od zpl$*!**l9;5!OMRbZF|D@pwWUMbu4$w}Flw#W5a1S(fzseUeyG8w*k(g+gnIb5;l` z@D`kDK&7spjz#GDwQ>&6sT+t866+1!ZVm|M#XRH}N}krdLIetTRX5~$xS}S-lt?Mk zB($LS4~{u^c9Tde4v&sQ^=|E}Ug;eVx6%1NQdzLsA(j zqB!I1*)1-f-K4B)th21GZINX;t1CVFy)H={<4nWN+jqJ4+6~5&DRtdYPNp=*u)H)l zCA^6CwC8z;m6c_(Ji}WXI0tUQhL)!S8J%Sa?{L;r*FmKu&z;X*IoS|Ti+PQuIEV|loLfNI0O zC(y!#2zR>>E<7)RvR&0RNt_V3)T}pq73673(-@?X4ElX$^Ep|TF`iCXULMfxbSSHm zUboBI>Ix^rF?pU*mUGI=poO57c}^UsJn+B+TspUb z#Iv!nNq=d8jyhOtP{L4@CFAj!TX*g<91lYTc5jrQ^La@WDWsG{T9RieY0`QW4v*<} zdvv=!=JOfz*^Ex7gAjrw*5E8sE3{G=+aSDWGH>|MN51>%t(z#aZIGZdBJpCG9K-7_vnN#e)VhIxOtOeHe)uMCcNs^f1$q`wnPk-qw<$TI~Hl{91ymPEyxR=sLTv*Tft`EHDU-+rN z|8swBQU2>izh6nndxL*T3c>LBgonhOr!Q~N*g&vo6Re6b+9M;!er-6M zH=NBKX=fR!VvZ+cD&y!YgSCb%>!4b-Z!8)*X+&ApZPM3ZjSK3X#xa~44vU22(HNRi z2(1GeCxR)Ix2-*!)@}A3Y+sTnMoWdjv$e5CS=J~eNs_ody=l<-X&rQZ9sS@I>OPZ;WyC4vzrg1gX=@jQ0_V@M~k0%Vr6RZtX`MRaQ1*)5-u{FJ3mn_TC zQA83)q*;nFj-o74QV?rJr_*I+;|zIk1urCZQz3;SixXzVR7X?J4m2P6$cO&bpZfbh z_t(m@3Q73l3h4LyA5FX6GbJ(Fmb`T%bo?fzB~2x>DwsE+6k2*7-ApjfbGBPymIPHZ zXI6NUtV<*v$ED@9q2tLFSj!ZXVuq3$+7EtSRN;>Ep8lYV5(bg2vZ_5=9dkJJ6vHD? zl?9C#s8%iHy~p~H;m1*1lKCLxPLp7@w%`p4B{@1iX3+1`?R45i(=q7xLBL?pV>T;T zSsw7vefKb#SJaK?+}2roy$&bCF-uDW9)0jWj!uRYrD1htiNRpNpx0$(xlbpF(Me98 zMPzx8w9`c@f`UnCgaU^}I04o%osM|u!{g9|)FZ&5Oo zl~Ehg@s6S>79JF#`cRt9vzJM-E=^MsCmCy77lK`F9EZb&=V)B>&iB0g(FY%T;K`R> zeEBQw6%ax}cWLDls2Eo@-1o@i5MGPS`lW;!m$>oJ-#lftD;SgB8-^__E1w% zI?H405si0@tmjR{E!OU_7WVcISYBD?%B4$8XESC+NhizDT2VE1$iiEt@W$F2 zE6Y9Z?piOKHVs+Y;oR0HI*wRf9-t$QjucAD;NMZZDva-Uwn3HvvP*P(|8Qzsp2%)ITiX`cPub7PwSzBA?EssC^{V%=v z@>i_2Ap$4?N#1#XQI?#)bOoRG**hAsH0X0sc-E4Vl}?X&RU;Kh3{@S}E)IpoqoTBx zetBdhiDf|Ro1Zx&tud)B#e9ws7A0K3#Z2>~q0GA7e8)&_6~ArMkfRuy$^&`NRp?lyOK z6lt2Gq+nhYR8>W{)5YVtySq=4#;mR`bK~xq#&~*@EC4B5lcy0*37k_z%;@*KAYeW= zSYMLH5&L_4y!6@)o_+omrjs$p$A{=hv%E4OO=7CnF89sJpmUZq%UE7sMn?}fhPbA^$g|qbXgs;9n=gW=cLVv=!o+i=|sfJWpVhsj|!v&{HXDO?K2+u1+ z!|Nx4LxHj*mG!IwFo^w9=T=V4b7i?*|Q`j*u#prg_$3GMNX8 zRjjCtWjdV`Co$`5YfPszws-e9JUqlBDT_rFF-1oac^c6eL6Rk`&w500LfJU1F_guO zqoZSu~=b4oa%YzhCPB2Y{j=Ri@nkSxk;+Zr}lCrES?Y$@Kbl--GuvLKo zvi^X=3DWV9hnFIrJ#rKxrxcPe-I*hG#AZjK1#G4@YdwW%X51JWUYuwWUvqwSiFaMi zcrUY{G*kjF8NP!#hi-a3wsj@aGa zWnLCU3W~B0@4u`t&eH8<0c?siQmU5d8j+?6iw>Um!C6FEhfu+0HjWdryibzm7}HSA z$0z|lRTw9j&nDFKF=^H%P7;of4>@!8O#aYA4?X>ruYC14wE(ib`?g3c&Rx8~*2PN< z3(HIUbKY|~BW)b-JS!M<43kEXM4Dq4GZ{O)mux4JrMcyNY7tS)wWES3Hgn#6b(1gO z9ddVU=xMlJD%h=g=ei|T2JZ#NIpQ?KThqdpAdnPg;cwpB7EM!;B#S)Nx9#1Q4=7b2 zYsertL4x#_q6o_4UZ;ydP*oLqmXYT<#e9x!9F=I$Qk}xdaS|b>p6RS&dHE7J!*n`D zD@jp}xx2HE5Q3HE0ZE#(vfQVx3`a*p5Q0u8Z*~2irGD>C&6a@DSyOTI_1l4yP?wxc zXG|tjjBQX-pp_2R_@|mZaeC)xY0~yr^o3nGn-( za(GOdb%M`8Yizx_wZ(l8Jn+<4zVg-I)EUEr^rY#7F`Oj7^F3ZnBP5& zI4T9i8afvrQx9Y~mGIeDw)x6_NjC~FEVB*cO5ma{E=qa+ z_96Ez3;G)7#t}s=8dz6M=9S&vJv^mzE-c|aqGc+3z@8#~d7iZ=zMx8mhWN z5Uz}-sY9DqE6S>-ay9d^L?B3#2xBah>6HDweT0Cc;}ecfPU!dg#Bs`aJVD~PbfwR9 zGGTjro61c1T6l0s3@pM9C48xNVRow*O$ka4VXp1`! zwy_XNly2EULXl?)V2C1(k{)kL%ITb{oS)Logit6A)muA-|YaU3Ic zhuVX0D(>&XnT-{CiDxDD6!Q_E85-hriAV;XejWvC_LmO9x`Me)c_@uhVvdqwQN0s1 z7OG+{XQLA#m1@zvAP}cT0+FHrE~N-s`}Y11VZ06&Fl`@RE6rpwMYZz@Ov^M5&l}`j zMNtw*8U)Ls2alu4bdG5ZQV9+Y581xE!)!KZWo3!!bV?FMY;A3Edp_mp zxMppoK`Y5{JfSEmA|0AfWmRFU2{!R9?;^a9Kn}q+fqWt*##!)&rYaD&Vm92RE(@}} zgN|a14Th9D&WY0;+Z4zsxUUq&4CgJ&ORHpgj;SlOl$5g(Qftbx~_;MWpZ+iQi^0{6`^AK{Wa1~k8(N=d|$6mKow2Mj@oAau3P(9|U>gH;BD9!=xO z`YR-QF>@iNDW^nn1Q^Pq49&ba#h501M%GfyXL#>hy`=>ooKxpT&E{&KM<2ZJAsr|2 zR6YgQH1GwfFb+`;X z11UfTfJwA0-`W_Y4X5IUmQUyfZ>V2mO5@f$fnKsZ`2ps-Tjw@9D}nXzr{V!Uuz7rJV+GSS86 za0_|)0&KyzxkE6Y4s@@ua7s#)idtwk@CO$90wDxiDdIRJklxp1SrYh;MTu?mjNl07 zFrjHd66?@P#}P%E+Sb8WK*Yf{g(aCM2pQz8)}VtsAxj8;l*dFRNoaIeLYL`lff zn8_^It9cb6r`xQnV_bKW)jY%7hG}KFac7S#%~ zc*fDuL96xi7-J~r1;#<-N|N=fJon-&a(s9gJ}e*1ltg|ULoO6MKk zx|VY71JAupAj2bEDb9MN^mrCresx;EOG!&BYf(zuRt*4NptNY8-(hUnz}^Q|(`Ygw zZy{xGErn^wvy@24)6L{uNPHJAXQvp4wOHYZqwwAje4mTw9-+5!4yziRb;OA#O+uNw zm~k{%UZ<{W>ZT?(!47XWFBtSXL~%r2RTu;PSdnEhr4bZWMc(PINv-v=*5S_VQA zDC>sN@Pz%n{m{I~@<4wYPq_Wc3ryz~uapCK^TsVhJ!@IGVXBz3wmsD$>@VO@(V9Rx z+fEV+iNPCMKo=NZd>m3q}$eaNQgIvRD|m!w59Fo)e?j# zv!cWpOO_=lDVY~lYg{2Q#s!|CTQHWw`v|$rV#b1Cshe?rYmF;Qnk&haiO<-&c!ey_ zshWnSv1C~q$S>9qMG;9HW33~JHL(&L9v)E^C6NvS7j#5rgIKh#DwYPlWv!I#Sm!ty zO*lRtl4Tib5+mBo7(CWMf6xnAcN8I_lzCC0m1JvkJ?uC~=<-D&AzE8sqbdvLvpGdE zWipx2n1+q5Eym*szwznMP)){o9drJ%XP9h0z;IrR=IE}p-lN+!5rWo-ujSshXrXUE z@F1QDVcvV+Ld5ODJJ-(j6X9nTo5a&TBd1kCFr1d{>2HIDSV+>_3dFs!L1-85)WzR> z%Bl&oen>@n zWMYh=stuD_Nl}(93^_$8&GMkn(x6L{budlC;n4}>d4*OWJd}0A;+me#X2k87lbf#} z(bRQ24NG!&dzZ2-dG^^Cc=5RxSYBNtJ97^gpLh?uaUZjPgqRQ6yLCebO+jeYE<*Am zLzit@Cl>;Zc7Ye$fcDh-6kSz7TTK@%v=rCk?(z}by|_C;i+gb^P^`tB;_mJ)#ogWA zAwY_||M!2(L-LTjyZ6kQGc&6x^kTu6V1-E2%kn*fJG*}`Lo^iO+V-oI5cBJ z&9S!PA{IT&B57`3(NRrx=h{wz2rjNWJ?B=j1WId#T0kCcGRuj)WMHJth}!SAF%5P5 z=wU1bHZLhpJ4nQd;}n<1R0OMlxi$rg;t3v%X0V2w$a(pPE-w*V3%|+J&>!Mdx8L!@ zKTF%5|C^oQXu!_sa28=i7oHG3e!NQV^mh*S?HYQ$|8}9=d9Ck#nEY0XPjWW1oYNDp z2Fw9v$BIQrr0cbVxfiqF==Lr)^T5te?*2TskXMrpT-ELXdpM?@z&0LAwCxUru$|*` z-ERbyso?a>@+PeqgtJ^^O=oq1hNQ1G&3fAXgH9LX?1NYXvR-fqlsLJci4>wBm+Q{P zjZOQH42YE#??x(>@ynUKeX6l|mOa7=Ibc#^oe_AS_VQYf#N~D`>!w6F-V( zDAd;1$+ah}15wFh70n@<>jcg){pUI^cEukNpULpE`_vuY9V#1-P>G{vV+O*MC{BcVQv{2)LAQ&o^5t&c2k9S)dBi306C#S>##gjFdP6-Fu3z zAg@<8qO-`i$7c#$ouuDEV@SbfAYjKmVhjhhScs@_;SBF*}PB zt-@0rrR_9zG^Xk=6Q8ygwT7RcAl-Zo-(&=OKi?O}c19uCskO?GX4aoVutaYL+dnyc zG>nD&weX!R1NCFAGHS*uf=MM!_{S>NG?W$H)7WA*MtL7ilfF$=$s|amlsGHStpZ!N zQeOou4W{bkJYO6q#mKBtEJP3t4ho$^TfVYG1nGXRcSp0UETycpDhodL7`>Y$m6w;t z9>~yZwx1&cQM_hcx{i*Fq~IBN5LhzFkA0-96wmL+m)b*|{5;Gx#nIHn-3xz!*rhSO zxa%)UXR5;>_eCsuyww9z5@mc2&4v_by;Hs(;7n$UOwB&gDsTFQ*?MNuLmki72@W4W zYi(YkIHg^EE#5V;=OsXWTyLc6>S`NG<1;#Uq(_TUT3%V%+ur^&Vm3H)$(Daftx~4z z!cfV{kCbl|&spP5-Kqa=>kykFXIl}XDmY@xo>!ymP4UJV8YH`$<($XOn6)4)e26^$2b@yAO zde5G>9?WKkje|yLGrlsdnf2)8q%a1p33ATb$eOPY=~wvXk~TO5NgYDLrXW+qbuKb? z+odF}(m2;8EvH45iI8>gx6ovwK9{aUV@w2+STnvvC$m=?{xRq`zUCh3Y+n`Iiknni zObD~VejmDUaJYH~^2myv}90zo4E8oNH#7|Qs*FvIl71MXWQYw$y%`; z^%gd@u93K~w4-pa>98kM7r^tlwVcW__wh+I$Rbam9Z|ayJUFZrXur9#p=Z!B)U(DB zZFumunGZzZszTOVYuNNgp4g!jFf=o2lDxL!fWobahmy0Xs{s_H6S0yEwcs+L0E28` zL0TqjhfmaLwYe@Scwy7SwLRJKyHc$`^9Wp#a1YwshnC2xIW&q8^!@?{jS zEPZ&~-X2AWG@UPhCL3{df2E!~FCVEB#POfQIq_~pZAmc|fC~2Vdie0N#AV~?RW{58 zBv!rrPR=@H(3CGxAda1tUWl91f;#reD-?6helU&)6BEj0poM zfymTY#wm()IasqGQ*RHVTn@qTV_P|_AsHrX1;7VXv~&toBItaTY+PhrSrqe_a|VQg zC>=^n{QvQ_$NtW9%7jf5_mU3b%`24W{2{MoACSs|bqMS6&013S?u&X*t1`bISj*>r z$Nxd=(Ol6lHoGYyGaKa zvcDe+yd&5e0;mFWuEMWv%0W!G0h;27KN-_2vO9)XPYBI*RJB~9@7%2jBedAcp?X$` zK%@(ep>FY0^$d^RWic{y*{$UQe%2%#WyQZGQioC%ddN#gPF5MsFE~!RvH*=k|&+s4?ng;y~&&A zqr`cK9KK~cLkk8o|Fxc;k|Za4l@XKFc6ia>-NgXa7#L}#Dg`*Yz_7?OsLEklOA-$t z&{&T$Txz0I2-3m3AKz*5y1cRL5bpS}u3j`1r9|nhw)Z}cp&O-PReqW6;jFU!(Yvra=kIn$~hHedD&vT z#$GvPFwx=l9=Ej{5V^tCc@b1Sed?xjVj2ZKlMiFv zFgcj-5F68ZYPVY}`kP59@G>s1gqNSxg`K#rx%u4v$KAlpW$51C7c}%}z`;eFo$;`@ z7aN*3yWxIN;j!Ptm={miAKRM>%LEV5=;)T?MI7Oekp?`4$zlaG*0V$WJ^d_m<*F}1lpcKEG&&0rTzkIUfxUa zSv&7;J9IDAZ%+=_vtvsGHUNfl_d+)XWeQSFsW;er-Pkc;ldr+)F5T^J5IsD>E;d%` z1Yl5>gk@4qxd6dR9ZE{Yb9^0?b(}VdUH*^WQaVYZl)gVl#qHWzy&N}1c~7dJ9cwEs+c*awKWU% z!zwKBoLt+w!vz)^;Q5N?COn^dO)39yV5JSRl4h}HD)I>uKF?U$M!8i~Rt*=GO8C`$ z@&F!AT}FHX-`gbVESznEeSu!hzFqthNo&~Xk2X%)@4^f@{g~UDFlX->a?_oBd|GOAvT=KjN zvT48AEnjc#=-YgwP?G~lGtZXl9)r1 zSA*=^+v!`RCFNvJRJ9sv#ju9Mqa*s^qCf;KX?0WG?=AN5BAAjgI2lre*Mo<8FFrLb zo>b`$kP6eluMaO@0k2gSw{90dL`aX3JcvRsJkb%!XfXrYTeR zu_x5phYHf#EU*W{r#rFOlGEIPA&!_1*f1QKiVS7p8?OOtt)Oz7BE<3JV_V!!SAC9D zrQ;t03Fc93xO4b-uf{dpd|e~?G3!I<-diEd0=)YROZLx}*woC>)N7wl_F>ZH?sRU0P$@RG8t1}5S+gQiPc%!Pex zOXY@b6>}!i5H(C4QuU>a6B~C-u|F0)@Y_vJIh2$%GV#1Eg;NmxJ&&`;z{}vryNMkOmZjiF<@KpVEE`50*!k zq3}s}bxD9HYq^PO83g-wj)JokiVRssO$h0n+_@Q7*0$)z)bglBS*a9FE077=x&wX# zNN~h4G9etK=y5V4-7m0pNj=cMy#Q@~t!HWf4_M4#zsE$Px5ZOCzEp)i`XrE$`Bvvj zvBl-@HqB=`Jlu<{#WzVcFc{^df18edc&Ov`* zI>qEQN$Ad=av~J!=;>H`yW$1FYBgy&jUVk}oTI2_u#?6BB{|P2YcD_EW>r@pYa$$y zl=O7|VQOXuQBNY+_MXX2@Uk2)n)U4JIFEc)2? z6ab-BOrUZ-O0#(-24o^eMfKo5%&{?f`bupb{T-ikFETfM7swgOq-`d}5h?^*QdAYU zKz8(UhK;T-o|V6I1HU-<4^zwBv1>_snn5!VodO_J)=VXF8zDu8@UMGi(C|8XK7PKP z#wGiB+B)BJugxmqho1W~WXP1-5?B3726fa(9kFQuCOC;UGO-(3G7T~w!RPc(XKOhp zLz$t2LebO_$IVoxj#&axac$1}By?v+SeNmqybZ67$L#{q-kN(;_QD77hPOV$BOns- zIDJx_%oYI@WbE>k>4sU$|>JU+ae9f9(pLJ`~`eyl~R2ZTfU zs>;1RvCJMHP1^f%Z0Z^4g>>2MdtD%(unw*z^jkM@Cj+ejy<-L7q^e5@AAQ}csi zYkGv~Ds14hF7+>S9jpOS7;oreWsPU#!NUUrgZTwq%H*&BA5iWpsw-XY*7+v0`1=03 zKzLmaQT*onwEN5icaDxiZI-Io2xFGF)+~96*@;n86==sTIHdA173Ww}m4JCy1V-M^ z!&BuHbiWII!MEjrvL&dIK6w@ho!<`4A|N$MZ5#p@KLWbIHdRi#KXP}e6SQnjF-kXT z)=N~svKP^i5@W*$IYAE<^LPP0lPNTAXQoqmPQv@vX6p6KLon5v;*+GRH%&BUFrE1P z6_#}xuqfAg-Oc*lkKWOX6si1#(Xw#~g5bzv8f5f$>P3Z3E-?c85s%!i7x71TY74A;U3IrJiSyxz=5WqQIo;3>h>pdt5+D>_!T^8QSRKxNL_+}`&pbs9Ot50 zrjh{rLVZHvxP?n=CR&FQ7PYduqW&bH!mP9Yeq}%g5dy1H29e8~ypg?cTW)MUryAlW zv)GT+>)EXPO~G9r_1$0XpbH*|JoQ+nC?Nao9ikcf-AQKoT@qI7clBM)gsI5Qp6>TM z4U=T}h$DKJA=$&Tu$=7;&}y$gt75~z;OHgz`v0iB9`n}+s@axHVx5#_ z;Wr5<9bHsqtd=kGuyj;TOr=sC6RHo;T}MbY9MX zNt6%V>+jtG^9vau)b12(xw2Jf$mHF5Q-}`00&qOF zstpjIyljr$*+>7I?kqrHCX>M#j+Wb1)Eh!ivL+0uM}^t|^6eAFxA^ye4y@IvvT+ZC z_!OV4n3i=7E!;|{`p`G~`p^x`?d%qi3tuYN1lBt{s0@7%+^V)(`rdlju04NihAYvL z|0w2t_9vP5^;`9{VG9X5-=ehCmWV3paPID6qp28Rsj%_+oY~i8w>9TfU5VMB$MtXH z+=pb+t7s0ku)%XpkF0F#aa`|TAG)Dpm4PssauHm8UQWC@0>Mu#uztK$cs#9?(J{kE zHFeG3aS%O(j z-FNS^$Wy-G!OO_VMU}m5%&mvuYi3l`0(v5N!j|8XKQ-Qx0jvXpbs`T&5Zws0))xEa z7R)Ixvm2WCogU(%01i|yrZlPizaT7HM3}(ohmE2PMQYk8y7ZTV=mBqoXQJl2$E)jV zikEjv&7{`d@xgGw26bWl_AmR9)S^C4!2QQxHwd%)`PudAtw6i;soRfxG`7Jw2!l0Y zh;Y|?hwBB8^ha_HJcm|(+=l>%;%JbJ*kYG)K5cB5dA{4w zQdSCfPgL7My4ZAaW`CN0dKwMcrM5WV{GSbRB4?mQEDUo$M+I^Pu(o>1$2?;|@LPvuzea2eWa@y(p^=&h(o z8Aqb6A4M_zxzO=4z2Mai`Sry2Fv%Q9KZVg0Z$+2LYVo~Na)W2$Ed zfgyKoB8+N-TYFOhiuBeaN8j#|U!ccoW;E0AoejAyMZrX`e5ock@K3Q~)qoO)*ff5K z+NkhNcjC#&(D}V`*C}R4LtVzWrAu`5$H2;hyg{l!WNa`EJzz`+17aD+&*zr(m8C=h zi)nyPqTu6)1ox}2^18EeFTyCs;jMpxuxpWCwTNwKCzmOuf~&fwu7ZuM5n ztzN{0_jfEV;wZnOvXgiAFe-rW<2kpDFJQahbO{r@kCZaK0wGR*Q&S}hxy5MaWD6^f zAHWAFKTG%bP#GlQ>vY523oD?#pSAW_Utix3@jVI&Oo-Dm_&dn*@-lUOto+`J*Ch7W z!uK)jdM33J)uNs+QxF&}t0x76B4T-gz5zBy2wa* z*vQ{jT9txdQIh(i*<@<*VqMuu&)~B*_vdt#8Kal{zuIEef#y848T+!j@58edzBjR6 z>F{T5B~=D|`HPy#STXw#W)ew7693isMsZ2V?V5-3#-fCjRmsm%!G0w%7rlI(-SpBudikMR*>G*=TpaRL`^h`Rxg=bPoswx zEatwS3&|1(Tv*{4R|uG^>)}~Y!#QjvEu4@j&TW5l#B?V;Y0YJZEVt&Zoi+@92_9*u zl-?Kn&1_&t^EKm+aFp2Kzh8|@v%XZGi%i3iga z7+>dtH%44f(u+Q$I}t}bwu>?F{XB=?s>=4>HO}LuRdUHde`}A`ERdBj{jP9;7|tj; zH_p1pfFMc8aMp3pt}J**J}|U3HhD%-{jF^vis<*W^XWo5F>zG47r!Ugh2JJdvj4LW zJx$=&2=j-v%NsRYVX5H4*Jj>f|@ucsa{8WT|^3-)KdKdaR$s}P0QZz|K zDHW`!YU4QBiY8~}k16c{HXJ9civ7Y1nM!&KjO3_)t|Sfp<8^_DX_Wdhm$Ti3{d zOS(sPyaiuV?GZ1ftZCj?#-ft{3a~X4b5v<$!`+fDttiiJ&)s{EvEHzSYlKOV5O!qaQ#OrK%PQzcv2x?ppLF%L zQd(gsQYI|{$jb6EMe!1HOu=t8_Z4BtR=7)uv8=kH@+O-%KV8f}**Y5*>m- z42TVjst777W;Jj&(|&vj%8+Cjsh{d>^?Sa%t7hT+_~9o^W^nnCi-*U}R<=mnqe!9k zh%5izT=|dQWoYR(timJW}dFAx$-8bSzbF_wOxMH{GNyCXfcvH znjj|BmjLu{w*Z=Rb@17xaJuXz=&Ea_&ZpOumZo#&M*lC3GfWkW()<$Pq)6(|uFnUD z277r9mJ-DP>@3bD5N!m~abLfa2ExFpHR+UGa36+0i+*SKtJc)z%)Q9K+hqa~k9&)c zWegGg+84nJ?(| z3)$zg@TZB_dc*LpsFS`=)#S8 z^B3~-iAu8R0Ns^ke=L#-@fu)EvPui?$Rr8GF!LO=WtS|&*9qZ6icovI?s`4QM%3Vt zocr|fGSBRLxx6Ow)Fw@r|K1*dpa(30Uh^5C?CCu@!OEY(ujH~$i<9)PyOfYsC|(m~ zlr$yQMNUdeng{Hn27uTaoZ%w)m=v->g}yblzzBI=;ehV0KXR~7anv^Z$>?xPsDd<; zl4s;7_$)b@N|q$7=!FSnVwW@+zL zew{y0*?L(|hF1H%4jlD7SJ8@G?!8lpJo3EL`FVT)11x+=g@rJo+iO&A;r&6ica+Pk z1W|u|ER(B!PY2$8W7nA%U+?WcKr+@gSDr_tNn6jm=7aJo zPyn=A+rVjLXNMSOUbr@ZZCduZPRVgRYYMp_PJ$n@y&a0~x5V+S(>W`CM`PV(3T|tP zk`0()IO;~k#{=XA;-YS=C%i4WJ@;U2KVnr`$#;2T$(vae%kR4~`EH}G-1*=A1(GkK zC5HM{drMHuuh|<6KlW-ia@zc^{S96x0I4Ucr#VZl9vkNcdV;TBTv*!to~C@ofuU5G zd&eHb=Jh09V6)Ult7m%lbC97^_VbI@zq2!nXZWF&0T;d9xvr~g??aBRf$Epl>Sy3B zLf7(>7O}%1Mw{^yt|`i5U}w;5Pbo3VVlcb16u)*)IQf?^SP9`NlNKpuVjkj)$K)E= z!U3FpxsJ4s)IqZn)|+)HaoxGLD0!*BegV&Pz*PZ9()+-M<$c|Q-DhWFK`H(GWixVV zFD&2VRR7%Ls=LV|BFcJsb#;IA0Qnn#SI?6gsgmJr?izBZN3EvS%4)rt5Oy$Vigi&P zTk0 z>*?J}OMd~R3ehDtjOj&jneBZdPaz@$`RE&C;xV03qxjA3>*jWibX&KR%`T6-I#<+` zr~90=7X-Lpgd!0Y40m8HYuC=dG}5BMD6nHE4x|*_!p=SN_aSXKI-zZ@;%>^VBTACVcf zdfX{54T(qAuD81-PuzlAUumuiVHCk}?tLh^&cf1+VfV1mubean2xw^0j-T9}&U^PO zEcitS2=cgirhoR}Ub(jNZ3^tthtfk^EriqAQzwAjqwu;xijRaA-wVRma#c7oY%s*~ zg5dpq+Ans}fRE-ENdH09KT){X1~Lw=`a`n2a1m2$+8a(P?ONQtwz{rP^jQMcV%6BA zsnLZlSp8nBU%5!V|1rH3l0EV)3kdFKF(wB!7HaG1NV}eX^a~K@N5Y_2_00>i*Wjp-1G$FKc>2ORbAA zWi(9%bq!b_(J5;cmCSXT!B-|^Oq*53IDF^d+HSCLb@s=aHe5mY`4uwl^og1Jr}WU! zzq8ZKBopMNiV?H$q3ow43s1R)6ct!mQ9FP1T=yhu#NFv4>x-sbZsrnuI1fulcGhr3 zby0QlM9O277GG$$(ETiwQqeS)y3~p=YBotUBZ6M7qO$VhMqT-`HpV-paRK~R{{Bzo z0OEI1HuseM6LrZ*j8lD!(cE zC!`c1PFnCIVKl`V*@ot90-PH4SZcD{pM7WoH5zNJ-G60uIb}9z%Cz3MD_U=+2x$X@ zty}e*T@KDA4z;IspmTtuc-_)(bv=_V1c}orNdwNBA!%t&uqaDJsfDQjzWK!<+W|3j zYo76fHS5!t;e*?SrgGfR5=mgd{jQ5R+PeExUagwIWjU4E$2VkaQ1`b{v}?=M{hfaO z^gpxr4g2KQ3^i;n&t_?L9YAWiVQ`+nRG^V!{YSEr7-?nn?oE2oy(Mo zM)Lyf8!!DTgO2gSYsk?LfeZn!B;T$ni0?D<3*P&J;lUuZ8Q6{qSLXUIJ1?K_H{BCK z%6zws&RMPY-OZZ;{DWVr<^|wzBM)>c1?}t=wobNw;6ihxuc`U_%c_Vp8L@kzU8c3!Q5v}9CmdyHeUM0 zv8yyKEdn~IH0Y8;PHlpuC>U2k%GB|*t)xCr&*duTc+r=@aC{IGU`xbQ3z7ZiqyUEZ z+ZOFYZ&A;FiHZV~dOpC+a^|yfZ3x2Y#akfi6iXA+xvoA6yOAhGUf}Mb$jKsdJ0!yDC-oQ*D1*)d$QKv6>koen~@QK7rDt?b$2s+mjn@ zFTE^p?AfoCQve+L%3Anme00^W!p-yDD?90a-3zBO|Id6WYiH$}tP?_odJi8pn(1}B zor)Z5X5zTzT#eO#6tjftO9^1a$xm~ZkXW^5G0h_G9su9{Bc5Eb=PK5V@`0;Q>jtTU+mYVO(S5!F`hXNKX$1OUDc0B7js z{?s%jo{M|CFW;&|*@@#S)+}vI6MdV!Pj5bMY zm5{MIG@je+^y+4LKf&|X=aF!t{v6=T+Q84hyK1xa7&Y~VJJod&M}{WNS=7TvH#i3i z4f4E-jkuNGd=BjNuooYt&tE&8f&Re1`DvzuTjYkp`n!QEKwANuC7l23Y-VI$MXh2$ zQtlE4Q^vp{N4tvzKWA}T5sZVQ0V^PWYVYM89GganQ&XD&#uGt9*EU_30@*%yf0O-8 zj3Y0f(ObWUiI9WZ`PA{F2eWl`PTp10q{iY$5>{NX&U_GghjO;eOlDvzg;Oe3rC3a^*Mk3@J<5 zOZQ(f>pwdBfI}lg;`;u(4(GxRhps@!m!Da&m;fmtmE?<5IT!XE+wx}`!R*JE`jVRJD13L3c=%=OHS(dmEjx75wu;fzf5yzu zI;^#{Z`u|+$_>FXv{CG&#GG#lfoywAhH*6S>kykRZw4}T+H@XT-IKOwoXpF+jli6? z;?z~=`cT>d)zAXjvZk_GZ!7guOz&a%vj1YY z)#sJLA{2>5I-ex4t#X!axwkX%+hZ)RGg9lj*6LaAH_(@^Nr`KW1%DVEFUWAXOlEjy zL;q$!cUHZ>-%GDBOX}3Q-v9LdFsO3KP=z=Bg9IF_s>K%#b-J9zdArZ{+v!l8Q;4BU zWx0N<73xOk`AGS|I_S7_b=TDao#fesc-aFQFVD*XlEFPp{U!Fy$v|04>~x+Dg)|)e z%CJ3{{GFU+?Y@Qbr4|qC^fmjo#D)^pGSg}3+Grl-7{{uTRZ0Yi4#B(E3TLA+QfqKI zI%I}P5j;zez7=z!Z;Y|lfdN~|aOfi1rJLmF7xhVj=b8#6{VUQ{MGFoxX^6vB3(ZlH zYUxQl;ol%qz_B(c6RaMuY|gOty*z8ajL!Cp$C3Q4*E|i|l<#DfO7bn=w&z~(8_&R{ z*lu^?#CLU-Mg5or4kNNEN^Au~4O&?xIwcgVtqA?NEGcCMe{d#$GlY#)P)(+X64@kj9ikfpyVZx=C z&&o`K(^og0n`v}o;k%w5?YaIaD3bRd(qP!s(<+krLYz5+{+j9%s-phxiX3ceVy`Qz z0cUqfVWD0-d~&no=E+j}4-`hQH}$tvH3Qq)73i zndDuvDMQTH_9anUKaSB5qBs$2VLVh~43twQN19avrsU4s8?AG%Z61wt8SZND*IK^@ z%$vO!*p<+6i-;+Qit4v4D8FcNPYy3{2F4Jk!&@qkDIc?dz%#a|k|4hG;rPV74vJ=;nAeyzJlKK+)k2 z!)LVY*LB19*2Sk?`Qr5In7K&&4*6Mp!?#(`P*YGybC=&QJJD7d)ubr3;39iRyA>UGpFfS~0s!Q^ z8mRWx61p9~ZfP3uJ}1nAq*pe#=RaLI_)-JcN8INc`Is)GPH-$(2SDJL<@!P3jp5m~ zCTuWOAM2bN5D_#q3l%6#VEXYsC{jjqSG!zwS~oK2q}Oem{=xiXUz%;D(Q zJMnhg(0-q*YjAa1&dgVa@+E$#UTsbIWiympN<_Rg^wjC;-OKY`X=5-2}(tFur@uPYl?YMvUpZVFj-ljkG46ghz zw$!t;e+_6X-aUC0=&$0+{$nUlYknEm`Rvs1NdESAS}q{y_r~5g6UrMlB6s`(gU@MG zUe2kgh)>r)@^y8fh!zF5*DMsej4e4}+lir*c$UKS>8_! zH!$2wS~b5$K!tX4tl^8=yuK3UsLdO`!G@0m?$<8&-d{JK#=0b1evIlm+*LG3yCiB7 z4k7@H_^({r@U+nz z%-DTZ*{DP}_vqf-#QkPY9I`Jd8`rPh@qHNmlhX7&YBZV45Q#%K{v6q>)(9eS~=euQaQ72AXy*4E%!dq5^i;)G>}E8aRW7YOOtDq3@~)>c^) zc1|sc#$4Z6huLVZA@16=RjH(CRK~rEW7oEcWVDqg%=AQ9j211x^rizcEGxD`8V#Lo zL{(hNUDKrf)fAx`$D5as$5B&X-#2)OOO#F|cyqD$vSR3a*`-8V|6Z%X-<4)#t+%MQ z?fL4Uq5-}Y%Svo3cHn>XEi|f?SrOqi5jLE*o)~=kFF@3vESSD9MXC6xhyvxK?b_k! z9T%;%`liR-k5O;YBuIb2Z}0Qgft=&j;M+!=MXjNura>qDMa?06@(Ff=*H&iW=p?C{ z-p&bOf^p41CI#SyZUTjUZ^XsU)snTf$K~VQcqmd#(Sj|%i@(L-TgAzOMBWyM)Jy|v zJ~eq5b^cVH?MYFQ_4i1cyBcpcNgghwSYKI%hyZ(=)V2GMHARmU!?RBMaWaH@Zgd_$ zr|yr@X+WignYhPV_(3S}h%rKUK5tj`ey_(7$<6N{iR)1wRHKHJzriH^3n20|*Ljm! za?7urh`M*x4Hk)zluN_m%sf146gsR=rFT3&iXUV+8m&8%jQ&$}^-3b2s~8fMTUstWGTx&`s3#jKr@ClmXO)hmHxjbK$>fWX zS3|v#5B^v0?*yC1eh?`z@Lm2;QeHIyNXYzZYZ|?`%{QwtYo|D;p`jR2*#C6e>Ws%@ z&Rj*ZCdwd=A?4#5NqgaQqN#GNsE_!mZfjn4JCW~>`a3oIl&i^ve0@f`a;A}w`M7D! z`>!d#%g$=y%K%GZgr%=I@+}xU*#-is|6M#;tz*-M5I!r4{ zwrT_UaE;u6HhPbj+0!6ry1y^Cf0&uJU-hdh7p2(Bx4jE1=9!D%(ph*7iV+a{!9JKK zJ9QkOlBzC}D1vvrn6p?mpURf{3z21?2x%w=f1L*5|KV+#%q7kc{piNOXW<@hBWmDo z<~f6`O8s5v!lz71J(15-C*o=;wmqxLE;`0vk#S{M3Edgw%x2CT&D5hQHQSSD_r(L~ zC1jtKvSyip06bSU&|ql2XY2vWXT&ViYaV66k>t*oi6K(on=nK6!3Lh6sD|n=?F|Ug zv~w&Ez88m;mA3*kALI~p2D?2tjhs2nW3>Qz@ZZ;_^jh2Gh~y?6B6Mwi0)!=IMeFd4 z0h1mog`Jc zh!r7M=aZKBOfYKj@X!06w6%_+RIg!iwYKJO?(Ku)YP&WEYjzgyo-S;1}yq}2geO}j;g@9dr{&{xk=Vc7?b|dz0 zHL;4tRYworN8-^|a~qdeI}_idjt|y@Z=1pZ&iM`TY{~lYM`GK^ObX4TYN*muiGvi~ z2?Qf*Z8{uLh8MF8)O;*BY9~;}W|IXwknn}o93F>4k^4RAL9|Q}rfmIy%NW4ByeV9uD2Je?H8d zcYV=bzEeKCG@Kg44|s+5yMXt8Ufb&2p;VE(6-80|6hCrvtzZ1APN)1LzJ}#8aJQh} zRDJ5?%1eO&t7Kc@{MKv!(oGizi(>HiUvh+!MRxZOC!=|>9pfDu-EvY8)HASC91HHBmN1;K-P|sANV}7G zFKzW1sY(J){-yRqkW{V!j5z*B>1QvEplxk;_a6*(aD6ivYi>trC(F6tmS9I}^zT!o zRlqb=rx>4^qfd$F+D;UAM1ff?nuVZ>Fz$F3;u$(uDfsf@MwG*gJl)^IE~-u%H72?7SRD5W50hbXi8JZZ7;iEW`p+e z`)u!EC8GZ;2G`=u`BbruS8zj~LmD!vt>(ev;3e3+29U*d(Eiy`bQ4D%rZ^`2Zn&ME zqOJyh<>g1j?(ffHt0E~_ftb4PC~-1Z$RI_?pn?qj7;N0|dw`UT=&@DciN!-^0 zH*=jGUbIfTk_dlt1bkGiSFv26d|Yaar6~?>4L>S%RzLcKG^Z3PHUCLVev3@ z+)KlC-|&TGsfAvu`tS>;Yqa$Uc2Cw=Q|j{0qjL!aSiA~6T0s&d{k-hBu7q8Fe*`xy?>j_c6AK9MAqpP5IAkKhKm0{ zhqQZ`C-;zB*tx;EjyaOA{%R=EE{M|>mV>p3C%Deb*Hu{dyrQsQA$DBKwB$=G`1ZGT z$^(O>*`crd;|2h>Z1MvehmBp_`aSFd=6JFP(J2+c+ikr_Ck=Vu%>qK}Wa|}L5VHc# z`8oBa4Z_RaSwsIiULv83ym8{O81AJ)SUAyzUwFFQfOlCuO`3xzrbEF8gP#yTsNNQT zXXlA@n-tme^3X#+ov_n}B>AZXO?rB=c61W;#6d0O-wKcSNm9DgsSweAU%080eJk zYdhHiKcbW>ccfOZ$+roYNE%<>Ew_SzqX*Zh@uiL)Lc6(|MnX2?DD471>3F_~yxs;T zSzNEQ?a$u(N{e!e4xalT2n0R<#X*V)S?tc8m9yT z4JJV5ervy>y!IRvoZ$1@8L%|qec!EKaC=Qi;l+_Be2(KrV?jM=>5O=a4B;0TzAfcKE3$o^AT3&Bb_20sn!!?-I#6Uz>!cB9hXU#fX2Z(DGMa)%RVM z8i3sW|I$Q5oW~abEEvmR(2UR3`Eet|Ex71g?=Is8P+NFG{^ZgB-TQZ{F?cw8hZaAA zVrS+Ic@~c128DkUg2YhDtRCRjmjqvk6 z3z8>0YqfVM-9Ke9HAJWehB$=+?>NXGJiuQ5*_t0dKZS#_B|YsO-Y?Xnp&5iRpWS6S zB-^j+k25-6#nW2(>}jg2BA1u7zjSsK(qF-D#Si({kq{42AbID}Q!1Gx*s1fFAn>J3 zuB>I}tR+#Sl|K2Grz?3Qn+NS_1C7h?Q`RZDofqvm{6zxsG;@>vd8ss&tOy8S z-Z=j`r6atklwmBbwPLs~p@%$4ea027i8}uLl%%GuZOpcHd&LFM1`JW^Oupn z_s&bu#!^Ddad`&ZM}rzqU+F`;X}o7+0L4@+HG-;`m7mqu?&?bdAHw~y+r(?qa> zcl6>#>)_ZSlh+xir#6DG|Na{IRi`LGJUagogbSLwmzKHMLiVN9j-R^VJt@!2zd*_`L(suF2qe$b2?I%rtD9Z=WFx^4Qi7SY^JNlad zz8|N8uP-N|XBJC(WmO{U05Tr4)A1D!Fn+Of+v0PvYD`hP%Im!)#*K*V*bu4{95{}# zHqZL9)wX}ZD|&yJe27*x0UK%vT6MMZ(Hip_3VAb9-`8Q^!`b^={kz9spH;nxkP7aPQ z6aW+ccjeyKy(Q@R9V(L9dAu(j()atjfH4-XwVcivz8kO1^7`ubjUrtQaY)nzQ>;%e zfds4tMnq{WwbGh}jSrmZiiWvl8jga63&?zVbv*}Ub0r9wFJ%&3%3WX=B}T>aF5i+7-ud_5 zd+$%*!(H#}_?1ovueAVd+dc+7$8mV}^i3x|dg|oXN0c8&XJ+qS_N za2#uE>%`W--a2{m_riE^dRBBaohI=ViECJ-xsc7YW@S9!=F=xIx+P8$qBv$WlJ@O% zI%jKhjbS9y!1eVF2Eze)mI^J*l6}YK#tMn=a5!CX@$ywh!-PA3_DvifP1xPt#dXDx zcr=~UHmwYmsv6gExO#1u7q@pv(~PRBXxom%!zl(s82BTp{`13N<35J*cOiG69fUqh|*?|M19zV=IkA}q7+PLbEeY;tK%VU zFZvvf2F%l(`Fug(dmJ83nN4RjUCZitj8c&21!Y;|`@TrmJ(s}u$cu8mw|Drbv)STH z^TpyTP19B{{oEw^+stUIu`DPdWr9q62XXM0;duP3 z$#D2yH%$J%?S*5@ap*KuZA+juzSYrnS}a#aqtGJj_I*63@8TJQMxi@R)2DMNC5j%) zQiQ%w-8AA?bZlJL5uQOW`mD;Ds&1Yx%i=rJ$?Qv$>HHf_(;NVOT%C*2y4U}i*S!Fi zH^`0L`LDSE;D;-LZ3)%FyacZJdKQ4PdLu*+H+m`BE^w`(@B42GtKyfM;m}+fX&FEaes``lvc1C|6@71=aJM(*X@>NeW_{NOKDb|D~j@b*Hqa{|2^Ro=;N;4^4GuX0_Zx; id*1V&V=c#xzWzU19X#1K-2pEE0000{(()=>{let j,R,L,A,I,D,H,U,w,O,F,Q,C,G,k,S,J,B,z,X,q,$={},l="pbr_preview",te="1.0.0",V="_NONE_",d={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality"},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6"},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight"},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain"},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape"},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks"},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode"}},P=(n=!0)=>{let e=Project?Project.textures??Texture.all:Texture.all;return n?e.filter(t=>t.layers.length>0).flatMap(t=>t.layers):e};class p{constructor(e,t){this._scope=e??P(),this._materialUuid=t}merToCanvas(){let e=this.getTexture(d.emissive),t=this.getTexture(d.roughness),a=this.getTexture(d.metalness);if(!e&&!t&&!a){let{metalness:s,emissive:i,roughness:o}=this.decodeMer();s&&(a=p.makePixelatedCanvas(s)),i&&(e=p.makePixelatedCanvas(i)),o&&(t=p.makePixelatedCanvas(o))}return{emissiveMap:e,roughnessMap:t,metalnessMap:a}}getMaterial(e={}){let{emissiveMap:t,roughnessMap:a,metalnessMap:s}=this.merToCanvas();return new THREE.MeshStandardMaterial({map:this.getTexture(d.albedo)??p.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(i=>i.selected)?.canvas??Texture.all[0].canvas),aoMap:this.getTexture(d.ao),normalMap:this.getTexture(d.normal),bumpMap:this.getTexture(d.height),metalnessMap:s,roughnessMap:a,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:1,alphaTest:.5,...e})}saveTexture(e,{uuid:t,extend:a}){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][e.id]=t,a({channel:e.id}))}findTexture(e,t=!0){if(!Project)return null;let a=this._scope.find(r=>r.channel&&(r.channel===e||r.channel===e.id));if(a)return a;let s=typeof e=="string"?e:e.id;Project.pbr_materials??={};let i=Project.pbr_materials[this._materialUuid];if(!i&&t){let r=new RegExp(`_*${s}(.[^.]+)?$`,"i");return this._scope.find(c=>r.test(c.name))??null}let o=i?.[s];return o?this._scope.find(r=>r.uuid===o)??null:null}static makePixelatedCanvas(e){let t=new THREE.CanvasTexture(e,void 0,void 0,void 0,THREE.NearestFilter,THREE.NearestFilter);return t.needsUpdate=!0,t}getTexture(e){let t=this.findTexture(e);return t?p.makePixelatedCanvas(t.canvas):null}static extractChannel(e,t){let a=e.canvas,s=a.width,i=a.height,o=a.getContext("2d");if(!o||!s||!i)return null;let r=document.createElement("canvas");r.width=s,r.height=i;let c=r.getContext("2d");if(!c)return null;let m={r:0,g:1,b:2,a:3}[t],{data:f}=o.getImageData(0,0,s,i),x=new Uint8ClampedArray(s*i*4);for(let h=0;he){_[g]=v.data[g],_[g+1]=v.data[g+1],_[g+2]=v.data[g+2],_[g+3]=255;continue}_[g]=0,_[g+1]=0,_[g+2]=0,_[g+3]=255}return m.putImageData(new ImageData(_,r.width,r.height),0,0),{metalness:a,emissive:r,emissiveLevel:s,roughness:i,sss:o}}createMer(e=!1){let t=this.findTexture(d.metalness,e),a=this.findTexture(d.emissive,e),s=this.findTexture(d.roughness,e),i=this.findTexture("sss",!1),o=Math.max(t?.img.width??0,a?.img.width??0,s?.img.width??0,Project?Project.texture_width:0,16),r=Math.max(t?.img.height??0,a?.img.height??0,s?.img.height??0,Project?Project.texture_height:0,16),c=document.createElement("canvas");c.width=o,c.height=r;let m=c.getContext("2d");if(!m)return null;let f=t?.img?p.extractChannel(t,"r"):null,x=a?.img?p.extractChannel(a,"g"):null,v=s?.img?p.extractChannel(s,"b"):null,h=i&&i?.img?p.extractChannel(i,"a"):null,_=f?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),g=x?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),u=v?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),b=h?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(new Uint8ClampedArray(o*r*4).fill(255),o,r),M=new Uint8ClampedArray(o*r*4);for(let T=0;T{let M=(u+b*s)*4;return o[M]/255};r.width=s,r.height=i,c.drawImage(e.img,0,0,s,i);let f=c.getImageData(0,0,s,i),x=f.data,v=u=>{let b=Math.sqrt(u[0]*u[0]+u[1]*u[1]+u[2]*u[2]);return[u[0]/b,u[1]/b,u[2]/b]};for(let u=0;ud[n].id),label:"PBR Channel",exposed:!1}),z=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),X=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),q=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"});let K=n=>{let e=Texture.all.find(a=>a.selected);if(!e)return;let t=new p(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!1);t&&t.toBlob(async a=>{if(!a)return;let[s,i]=Project?[`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await a.arrayBuffer(),type:"PNG",name:s,extensions:["png"],resource_id:"mer",savetype:"image",startpath:i},n)})},y=n=>{if(!Project||Texture.all.length===0)return;let e=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(a=>{let i=t.faces[a].getTexture();if(!i)return;let o=Project.materials[i.uuid];o.isShaderMaterial&&!Project.bb_materials[i.uuid]&&(Project.bb_materials[i.uuid]=o);let r=new p(i.layers_enabled?i.layers.filter(c=>c.visible)??null:Project.textures,i.uuid).getMaterial(n);Project.materials[i.uuid]=THREE.ShaderMaterial.prototype.copy.call(r,o),Canvas.updateAllFaces(i),e=!0})}),Project.pbr_active=e},ne=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(n=>{n instanceof Cube&&Object.keys(n.faces).forEach(e=>{let a=n.faces[e].getTexture();if(!a)return;let s=Project.bb_materials[a.uuid];s&&(Project.materials[a.uuid]=s)})}),Project.pbr_active=!1,Canvas.updateAll())},ae=()=>{if(!Project)return;let n=P();Project.textures.forEach(e=>{let t=new p(n,e.uuid),a=t.findTexture(d.normal,!1)?.name,s=t.findTexture(d.height,!1)?.name,i=t.findTexture(d.albedo,!1)?.name,o=t.findTexture(d.metalness,!1)?.name,r=t.findTexture(d.emissive,!1)?.name,c=t.findTexture(d.roughness,!1)?.name,m={};return i||(m.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!r&&!c&&(m.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},m.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},m.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),a&&s&&(m.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),w=new Dialog(`${l}_texture_set`,{id:`${l}_texture_set`,title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:m,onConfirm(f){let x=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),v=o||r||c,h={format_version:"1.16.200","minecraft:texture_set":{color:(i?pathToName(i,!1):f.baseColor?.toHexString())??x,metalness_emissive_roughness:[f.metalness??0,f.emissive??0,f.roughness??255]}};f.depthMap==="normal"&&a?h["minecraft:texture_set"].normal=pathToName(a,!1):(!a||f.depthMap==="heightmap")&&s&&(h["minecraft:texture_set"].heightmap=pathToName(s,!1));let _=()=>Blockbench.export({content:JSON.stringify(h,null,2),type:"JSON",name:`${x}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path},()=>{Blockbench.showQuickMessage("Texture set created",2e3),w.hide()});if(v){K(g=>{h["minecraft:texture_set"].metalness_emissive_roughness=pathToName(g,!1),_()});return}_()},cancelIndex:1}),w.show(),w})},W=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],Y=()=>Project&&Project.pbr_active&&y(),Z=()=>{W.forEach(n=>{Blockbench.addListener(n,Y)})},ee=()=>{W.forEach(n=>{Blockbench.removeListener(n,Y)})},se=()=>{H=new Setting("pbr_active",{category:"preview",name:"Enable PBR Preview",description:"Enables PBR preview in the editor",type:"toggle",default_value:!1,icon:"tonality",launch_setting:!0,onChange(n){if(n){y(),Z();return}ne(),ee()}}),J=new Setting("display_settings_correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview for PBR materials",type:"toggle",default_value:!1,icon:"light_mode",condition:()=>!!Project,onChange(n){Preview.selected.renderer.physicallyCorrectLights=n,y()}}),B=new Setting("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:THREE.NoToneMapping,value:THREE.NoToneMapping,icon:"palette",options:{[THREE.NoToneMapping]:"None",[THREE.LinearToneMapping]:"Linear",[THREE.ReinhardToneMapping]:"Reinhard",[THREE.CineonToneMapping]:"Cineon",[THREE.ACESFilmicToneMapping]:"ACES"},onChange(n){Preview.selected.renderer.toneMapping=Number(n),y()}}),S=new Setting("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",default_value:1,icon:"exposure",step:.1,min:-2,max:2,onChange(n){Preview.selected.renderer.toneMappingExposure=Math.max(-2,Math.min(2,Number(n)))}}),A=new Action(`${l}_generate_normal`,{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(n=>n.selected))!==void 0,click(){let n=TextureLayer.selected??Texture.all.find(s=>s.selected),e=new p(P(),n.uuid),t=TextureLayer.selected??Texture.all.find(s=>s.selected)??e.findTexture(d.height,!0);if(!t){Blockbench.showQuickMessage("No height map found",2e3);return}let a=p.createNormalMap(t);if(a){e.saveTexture(d.normal,a),a.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),L=new Action(`${l}_create_mer`,{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",click(){K()}}),j=new Action(`${l}_decode_mer`,{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",click(){let n=P(),e=TextureLayer.selected?.texture??Texture.all.find(i=>i.selected),t=new p(n,(e??n[0]).uuid),a=t.decodeMer();[d.metalness,d.emissive,d.roughness].forEach((i,o)=>{let r=i.id,c=a[r];if(!c)return;let m=new TextureLayer({name:`${e?.name}_${r}`,data_url:c.toDataURL()},e.layers_enabled?e.texture:e);t.saveTexture(i,m)})}}),R=new Action(`${l}_create_texture_set`,{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){ae()}}),Object.entries(d).forEach(([n,e])=>{$[n]=new Action(`${l}_assign_channel_${n}`,{icon:e.icon??"tv_options_edit_channels",name:`Assign to ${e.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${e.label} channel`,category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(t){let a=TextureLayer.selected;if(!a||!Project)return;Undo.initEdit({layers:[a]}),a.extend({channel:n});let s=a.texture;s.updateChangesAfterEdit(),Project.pbr_materials[s.uuid]||(Project.pbr_materials[s.uuid]={}),Object.entries(Project.pbr_materials[s.uuid]).forEach(([i,o])=>{o===a.uuid&&delete Project.pbr_materials[s.uuid][i]}),Project.pbr_materials[s.uuid][n]=a.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${a.name}" to ${e.label} channel`,2e3),y()}})}),I=new Action(`${l}_unassign_channel`,{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",click(){let n=TextureLayer.selected;if(!n||!Project)return;Undo.initEdit({layers:[n]});let{texture:e,channel:t}=n;e.updateChangesAfterEdit(),Project.pbr_materials[e.uuid]={},n.channel=V,Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${n.name}" from ${t} channel`,2e3),y()}}),D=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",condition:()=>(Project&&Project.textures.length>0)===!0,linked_setting:"pbr_active",default:!1,click(){},onChange(n){Blockbench.showQuickMessage(`PBR Preview is now ${n?"enabled":"disabled"}`,2e3)}}),k=new Toggle(`${l}_correct_lights`,{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",linked_setting:"display_settings_correct_lights",default:!1,onChange(n){Blockbench.showQuickMessage(`Physically corrected lighting is now ${n?"enabled":"disabled"}`,2e3)},click(){}}),C=new BarSlider(`${l}_exposure`,{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",icon:"exposure",min:-2,max:2,step:.1,value:Settings.get("display_settings_exposure")??1,display_condition:{modes:["edit","paint","animate"],project:!0},onChange({value:n}){S.set(n)}}),C.addLabel(!0,C),F=new Menu(`${l}_channel_menu`,[...Object.keys(d).map(n=>`${l}_assign_channel_${n}`),`${l}_unassign_channel`],{onOpen(){y()}}),Q=new Action(`${l}_show_channel_menu`,{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(n){F.open(n)}}),G=new BarSelect(`${l}_tonemapping`,{category:"preview",name:"Tone Mapping",description:"Select the tone mapping function",icon:"palette",value:THREE.NoToneMapping,linked_setting:"display_settings_tone_mapping",options:{[THREE.NoToneMapping]:{name:"No Tone Mapping",icon:"invert_colors_off"},[THREE.LinearToneMapping]:{name:"Linear",icon:"linear_scale"},[THREE.ReinhardToneMapping]:{name:"Reinhard",icon:"brightness_medium"},[THREE.CineonToneMapping]:{name:"Cineon",icon:"brightness_high"},[THREE.ACESFilmicToneMapping]:{name:"ACES",icon:"brightness_auto"}},onChange({value:n}){B.set(n),y()}}),U=new Panel(`${l}_display_settings`,{name:"PBR Settings",id:`${l}_display_settings_panel`,icon:"display_settings",toolbars:[new Toolbar(`${l}_controls_toolbar`,{id:`${l}_controls_toolbar`,children:["toggle_pbr",`${l}_correct_lights`,`${l}_show_channel_menu`],name:"PBR"}),new Toolbar(`${l}_display_settings_toolbar`,{id:`${l}_display_settings_toolbar`,children:[`${l}_tonemapping`,`${l}_exposure`],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"paint"}),MenuBar.addAction(L,"file.export"),MenuBar.addAction(A,"tools"),MenuBar.addAction(j,"tools"),MenuBar.addAction(R,"file.export"),MenuBar.addAction(D,"view"),MenuBar.addAction(k,"preview"),Object.entries($).forEach(([n,e],t)=>{MenuBar.addAction(e,`image.${t}`)}),Z()},re=()=>{Object.entries($).forEach(([n,e])=>{e.delete()}),MenuBar.removeAction(`file.export.${l}_create_mer`),MenuBar.removeAction(`file.export.${l}_create_texture_set`),MenuBar.removeAction(`tools.${l}_generate_normal`),ee(),U?.delete(),w?.delete(),H?.delete(),L?.delete(),A?.delete(),D?.delete(),j?.delete(),R?.delete(),O?.delete(),Q?.delete(),S?.delete(),C?.delete(),G?.delete(),k?.delete(),J?.delete(),B?.delete(),deactivatePbr?.delete(),I?.delete(),X?.delete(),z?.delete(),q?.delete()};BBPlugin.register(l,{version:te,title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.1",onload:se,onunload:re})})();})(); diff --git a/src/pbr_preview/.prettierignore b/src/pbr_preview/.prettierignore new file mode 100644 index 00000000..737bc52b --- /dev/null +++ b/src/pbr_preview/.prettierignore @@ -0,0 +1,3 @@ +node_modules/ +dist/ +package-lock.json \ No newline at end of file diff --git a/src/pbr_preview/.vscode/settings.json b/src/pbr_preview/.vscode/settings.json new file mode 100644 index 00000000..89d1965f --- /dev/null +++ b/src/pbr_preview/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "editor.formatOnSave": true, + "editor.defaultFormatter": "esbenp.prettier-vscode" +} \ No newline at end of file diff --git a/src/pbr_preview/package.json b/src/pbr_preview/package.json new file mode 100644 index 00000000..387f2bc8 --- /dev/null +++ b/src/pbr_preview/package.json @@ -0,0 +1,25 @@ +{ + "name": "blockbench-pbr", + "version": "1.0.0", + "description": "PBR support for Blockbench", + "main": "./src/index.ts", + "scripts": { + "build": "esbuild src/index.ts --bundle --minify --outfile=../../plugins/pbr_preview/pbr_preview.js", + "test": "echo \"Error: no test specified\" && exit 1", + "dev": "esbuild src/index.ts --bundle --sourcemap --outfile=../../plugins/pbr_preview/pbr_preview.js --watch", + "format": "prettier --write src/**/*.ts", + "dist": "npm run format && npm run build" + }, + "keywords": [ + "blockbench" + ], + "author": "Jason Gardner", + "license": "MIT", + "devDependencies": { + "@types/three": "^0.157.0", + "blockbench-types": "4.9.0", + "esbuild": "0.19.4", + "prettier": "^3.2.5", + "typescript": "^5.2.2" + } +} \ No newline at end of file diff --git a/src/pbr_preview/src/index.ts b/src/pbr_preview/src/index.ts new file mode 100644 index 00000000..528556de --- /dev/null +++ b/src/pbr_preview/src/index.ts @@ -0,0 +1,1487 @@ +/** + * @author jasonjgardner + * @discord jason.gardner + * @github https://github.com/jasonjgardner + */ +/// +/// + +interface IPbrMaterials { + [materialUuid: string]: { + [channelId: string]: string; + }; +} + +type Channel = + | "albedo" + | "metalness" + | "emissive" + | "roughness" + | "height" + | "normal" + | "ao"; + +interface IChannel { + label: string; + description: string; + map: string; + id: string; + icon?: string; +} + +(() => { + let decodeMer: Action; + let createTextureSet: Action; + let generateMer: Action; + let generateNormal: Action; + let unassignChannel: Action; + let togglePbr: Toggle; + let pbrDisplaySetting: Setting; + let displaySettingsPanel: Panel; + let textureSetDialog: Dialog; + let channelProp: Property; + let channelMenu: Menu; + let showChannelMenu: Action; + let exposureSlider: BarSlider; + let tonemappingSelect: BarSelect; + let toggleCorrectLights: Toggle; + let exposureSetting: Setting; + let correctLightsSetting: Setting; + let tonemappingSetting: Setting; + let pbrMaterialsProp: Property; + let projectMaterialsProp: Property; + let projectPbrModeProp: Property; + + const channelActions: Record = {}; + + const PLUGIN_ID = "pbr_preview"; + const PLUGIN_VERSION = "1.0.0"; + const NA_CHANNEL = "_NONE_"; + const CHANNELS: Record = { + albedo: { + id: "albedo", + label: "Albedo", + description: "The color of the material", + map: "map", + icon: "tonality", + }, + metalness: { + id: "metalness", + label: "Metalness", + description: "The material's metalness map", + map: "metalnessMap", + icon: "brightness_6", + }, + emissive: { + id: "emissive", + label: "Emissive", + description: "The material's emissive map", + map: "emissiveMap", + icon: "wb_twilight", + }, + roughness: { + id: "roughness", + label: "Roughness", + description: "The material's roughness map", + map: "roughnessMap", + icon: "grain", + }, + height: { + id: "height", + label: "Height", + description: "The material's height map", + map: "bumpMap", + icon: "landscape", + }, + normal: { + id: "normal", + label: "Normal", + description: "The material's normal map", + map: "normalMap", + icon: "looks", + }, + ao: { + id: "ao", + label: "Ambient Occlusion", + description: "The material's ambient occlusion map", + map: "aoMap", + icon: "motion_mode", + }, + }; + + const getProjectTextures = (layers = true) => { + const allTextures = Project ? Project.textures ?? Texture.all : Texture.all; + + if (!layers) { + return allTextures; + } + + return allTextures + .filter((t: Texture) => t.layers.length > 0) + .flatMap((t: Texture) => t.layers); + }; + + // + // Classes + // + + class PbrMaterial { + private _scope: Array; + private _materialUuid: string; + + constructor( + scope: Array | null, + materialUuid: string, + ) { + this._scope = scope ?? getProjectTextures(); + this._materialUuid = materialUuid; + } + + merToCanvas() { + let emissiveMap = this.getTexture(CHANNELS.emissive); + let roughnessMap = this.getTexture(CHANNELS.roughness); + let metalnessMap = this.getTexture(CHANNELS.metalness); + + if (!emissiveMap && !roughnessMap && !metalnessMap) { + const { metalness, emissive, roughness } = this.decodeMer(); + + if (metalness) { + metalnessMap = PbrMaterial.makePixelatedCanvas(metalness); + } + + if (emissive) { + emissiveMap = PbrMaterial.makePixelatedCanvas(emissive); + } + + if (roughness) { + roughnessMap = PbrMaterial.makePixelatedCanvas(roughness); + } + } + + return { + emissiveMap, + roughnessMap, + metalnessMap, + }; + } + + getMaterial(options: THREE.MeshStandardMaterialParameters = {}) { + const { emissiveMap, roughnessMap, metalnessMap } = this.merToCanvas(); + + return new THREE.MeshStandardMaterial({ + map: + this.getTexture(CHANNELS.albedo) ?? + PbrMaterial.makePixelatedCanvas( + TextureLayer.selected?.canvas ?? + Texture.all.find((t) => t.selected)?.canvas ?? + Texture.all[0].canvas, + ), + aoMap: this.getTexture(CHANNELS.ao), + normalMap: this.getTexture(CHANNELS.normal), + bumpMap: this.getTexture(CHANNELS.height), + metalnessMap, + // metalness: metalnessMap ? 1 : 0, + roughnessMap, + // roughness: roughnessMap ? 1 : 0, + emissiveMap, + emissiveIntensity: emissiveMap ? 1 : 0, + emissive: emissiveMap ? 0xffffff : 0, + envMap: PreviewScene.active?.cubemap ?? null, + envMapIntensity: 1, + alphaTest: 0.5, + ...options, + }); + } + + saveTexture(channel: IChannel, { uuid, extend }: Texture | TextureLayer) { + if (!Project) { + return; + } + + if (!Project.pbr_materials) { + Project.pbr_materials = {}; + } + + if (!Project.pbr_materials[this._materialUuid]) { + Project.pbr_materials[this._materialUuid] = {}; + } + + Project.pbr_materials[this._materialUuid][channel.id] = uuid; + extend({ channel: channel.id }); + } + + /** + * ### Find channel texture + * @param name Channel to find + * @param inference Whether or not to infer the texture based on the channel name + * @returns The channel if it exists in the project, otherwise `null` + */ + findTexture( + name: string | IChannel, + inference = true, + ): Texture | TextureLayer | null { + if (!Project) { + return null; + } + + const materialChannel = this._scope.find( + (t) => t.channel && (t.channel === name || t.channel === name.id), + ); + + if (materialChannel) { + return materialChannel; + } + + const channel = typeof name === "string" ? name : name.id; + + Project.pbr_materials ??= {}; + const materialData = Project.pbr_materials[this._materialUuid]; + + if (!materialData && inference) { + const filenameRegex = new RegExp(`_*${channel}(\.[^.]+)?$`, "i"); + return this._scope.find((t) => filenameRegex.test(t.name)) ?? null; + } + + const textureUuid = materialData?.[channel]; + + if (!textureUuid) { + return null; + } + + return this._scope.find((t) => t.uuid === textureUuid) ?? null; + } + + /** + * Helper function to create a canvas texture with pixelated filtering + * @param canvas Texture canvas source + * @returns `THREE.CanvasTexture` with pixelated filtering + */ + static makePixelatedCanvas(canvas: HTMLCanvasElement) { + const texture = new THREE.CanvasTexture( + canvas, + undefined, + undefined, + undefined, + THREE.NearestFilter, + THREE.NearestFilter, + ); + + texture.needsUpdate = true; + + return texture; + } + + /** + * Searches for a texture and creates a canvas element with the texture data if found + * @param name The name of the texture to search for. Use a channel or a texture name or UUID + * @param scope An array of textures to search in. Defaults to all textures in the project + */ + getTexture(name: string | IChannel) { + const texture = this.findTexture(name); + return texture ? PbrMaterial.makePixelatedCanvas(texture.canvas) : null; + } + + static extractChannel( + texture: Texture | TextureLayer, + channel: "r" | "g" | "b" | "a", + ) { + const canvas = texture.canvas; + const width = canvas.width; + const height = canvas.height; + + const ctx = canvas.getContext("2d"); + + if (!ctx || !width || !height) { + return null; + } + + const channelCanvas = document.createElement("canvas"); + channelCanvas.width = width; + channelCanvas.height = height; + + const channelCtx = channelCanvas.getContext("2d"); + + if (!channelCtx) { + return null; + } + + const channelIdx = { r: 0, g: 1, b: 2, a: 3 }[channel]; + + const { data } = ctx.getImageData(0, 0, width, height); + + const channelData = new Uint8ClampedArray(width * height * 4); + + for (let idx = 0; idx < data.length; idx += 4) { + channelData[idx] = data[idx + channelIdx]; + channelData[idx + 1] = data[idx + channelIdx]; + channelData[idx + 2] = data[idx + channelIdx]; + channelData[idx + 3] = 255; + } + + const imageData = new ImageData(channelData, width, height); + + channelCtx.putImageData(imageData, 0, 0); + + return channelCanvas; + } + + decodeMer(emissiveThreshold = 25.5): { + metalness?: HTMLCanvasElement | null; + emissive?: HTMLCanvasElement | null; + emissiveLevel?: HTMLCanvasElement | null; + roughness?: HTMLCanvasElement | null; + sss?: HTMLCanvasElement | null; + } { + const texture = this.findTexture("mer", true); + + if (!texture) { + return { + metalness: null, + emissive: null, + emissiveLevel: null, + roughness: null, + sss: null, + }; + } + + const metalness = PbrMaterial.extractChannel(texture, "r"); + const emissiveLevel = PbrMaterial.extractChannel(texture, "g"); + const roughness = PbrMaterial.extractChannel(texture, "b"); + const sss = PbrMaterial.extractChannel(texture, "a"); + + const emissive = document.createElement("canvas"); + emissive.width = texture.img.width ?? 16; + emissive.height = texture.img.height ?? 16; + + // Use emissiveLevel as mask for getting emissive color from albedo channel + const albedo = this.findTexture(CHANNELS.albedo); + + if (albedo) { + emissive.width = albedo.img.width ?? 16; + emissive.height = albedo.img.height ?? 16; + } + + const emissiveCtx = emissive.getContext("2d"); + const emissiveLevelCtx = emissiveLevel?.getContext("2d"); + const albedoCtx = albedo?.canvas?.getContext("2d"); + + if (!emissiveCtx || !albedoCtx || !emissiveLevelCtx) { + return { + metalness, + emissive: emissiveLevel, + roughness, + sss, + }; + } + + // Write the albedo color to the emissive canvas where the emissive level is greater than a certain threshold + const albedoData = albedoCtx.getImageData( + 0, + 0, + emissive.width, + emissive.height, + ); + const emissiveLevelData = emissiveLevelCtx.getImageData( + 0, + 0, + emissive.width, + emissive.height, + ); + + const emissiveData = new Uint8ClampedArray( + emissive.width * emissive.height * 4, + ); + + for (let idx = 0; idx < albedoData.data.length; idx += 4) { + if (emissiveLevelData.data[idx] > emissiveThreshold) { + emissiveData[idx] = albedoData.data[idx]; + emissiveData[idx + 1] = albedoData.data[idx + 1]; + emissiveData[idx + 2] = albedoData.data[idx + 2]; + emissiveData[idx + 3] = 255; + continue; + } + + emissiveData[idx] = 0; + emissiveData[idx + 1] = 0; + emissiveData[idx + 2] = 0; + emissiveData[idx + 3] = 255; + } + + emissiveCtx.putImageData( + new ImageData(emissiveData, emissive.width, emissive.height), + 0, + 0, + ); + + return { + metalness, + emissive, + emissiveLevel, + roughness, + sss, + }; + } + + createMer(inference = false) { + const metalness = this.findTexture(CHANNELS.metalness, inference); + const emissive = this.findTexture(CHANNELS.emissive, inference); + const roughness = this.findTexture(CHANNELS.roughness, inference); + const sss = this.findTexture("sss", false); + + const width = Math.max( + metalness?.img.width ?? 0, + emissive?.img.width ?? 0, + roughness?.img.width ?? 0, + Project ? Project.texture_width : 0, + 16, + ); + + const height = Math.max( + metalness?.img.height ?? 0, + emissive?.img.height ?? 0, + roughness?.img.height ?? 0, + Project ? Project.texture_height : 0, + 16, + ); + + const canvas = document.createElement("canvas"); + canvas.width = width; + canvas.height = height; + + const ctx = canvas.getContext("2d"); + + if (!ctx) { + return null; + } + + const metalnessCanvas = metalness?.img + ? PbrMaterial.extractChannel(metalness, "r") + : null; + const emissiveCanvas = emissive?.img + ? PbrMaterial.extractChannel(emissive, "g") + : null; + const roughnessCanvas = roughness?.img + ? PbrMaterial.extractChannel(roughness, "b") + : null; + const sssCanvas = + sss && sss?.img ? PbrMaterial.extractChannel(sss, "a") : null; + + const metalnessData = + metalnessCanvas?.getContext("2d")?.getImageData(0, 0, width, height) ?? + new ImageData(width, height); + const emissiveData = + emissiveCanvas?.getContext("2d")?.getImageData(0, 0, width, height) ?? + new ImageData(width, height); + const roughnessData = + roughnessCanvas?.getContext("2d")?.getImageData(0, 0, width, height) ?? + new ImageData(width, height); + const sssData = + sssCanvas?.getContext("2d")?.getImageData(0, 0, width, height) ?? + new ImageData( + new Uint8ClampedArray(width * height * 4).fill(255), + width, + height, + ); + + const data = new Uint8ClampedArray(width * height * 4); + + for (let idx = 0; idx < data.length; idx += 4) { + data[idx] = metalnessData.data[idx]; + data[idx + 1] = emissiveData.data[idx]; + data[idx + 2] = roughnessData.data[idx]; + data[idx + 3] = sssData.data[idx]; + } + + ctx.putImageData(new ImageData(data, width, height), 0, 0); + + return canvas; + } + + /** + * ### Generate Normal Map + * Generates a normal map from a height map texture + * @param texture Height map texture + * @param heightInAlpha Whether or not to store the height map in the alpha channel (Used in labPBR shaders for POM) + * @returns Normal map texture or layer if successful, otherwise `null` + */ + static createNormalMap( + texture: Texture | TextureLayer, + heightInAlpha = false, + ): Texture | TextureLayer | null { + const textureCtx = texture.canvas.getContext("2d"); + + if (!textureCtx) { + return null; + } + + const width = Math.max(texture.img.width ?? texture.canvas.width, 16); + const height = Math.max(texture.img.height ?? texture.canvas.height, 16); + + const { data: textureData } = textureCtx.getImageData( + 0, + 0, + width, + height, + ); + + const canvas = document.createElement("canvas"); + const ctx = canvas.getContext("2d"); + + if (!ctx) { + return null; + } + + const getHeight = (x: number, y: number): number => { + const idx = (x + y * width) * 4; + return textureData[idx] / 255; + }; + + canvas.width = width; + canvas.height = height; + + ctx.drawImage(texture.img, 0, 0, width, height); + + const imageData = ctx.getImageData(0, 0, width, height); + + const data = imageData.data; + + const normalize = (v: number[]): number[] => { + const length = Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); + return [v[0] / length, v[1] / length, v[2] / length]; + }; + + for (let y = 0; y < height; y++) { + for (let x = 0; x < width; x++) { + const left = getHeight(Math.max(x - 1, 0), y); + const right = getHeight(Math.min(x + 1, width - 1), y); + const top = getHeight(x, Math.max(y - 1, 0)); + const bottom = getHeight(x, Math.min(y + 1, height - 1)); + + const dx = right - left; + const dy = bottom - top; + + const normal = normalize([-dx, -dy, 1]); + + const idx = (y * width + x) * 4; + data[idx] = ((normal[0] + 1) / 2) * 255; + data[idx + 1] = ((normal[1] + 1) / 2) * 255; + data[idx + 2] = ((normal[2] + 1) / 2) * 255; + data[idx + 3] = heightInAlpha ? getHeight(x, y) * 255 : 255; + } + } + + ctx.putImageData(imageData, 0, 0); + + const dataUrl = canvas.toDataURL(); + + const name = `${texture.name.replace(/_height(map)?/i, "")}_normal`; + + if (texture instanceof TextureLayer) { + const normalMapLayer = new TextureLayer( + { + name, + data_url: dataUrl, + }, + texture.texture, + ); + texture.texture.layers.push(normalMapLayer); + + return normalMapLayer; + } + + const normalMapTexture = new Texture({ + name, + saved: false, + particle: false, + keep_size: true, + }).fromDataURL(dataUrl); + + if (Project) { + Project.textures.push(normalMapTexture); + } + + return normalMapTexture; + } + } + + channelProp = new Property(TextureLayer, "enum", "channel", { + default: NA_CHANNEL, + values: Object.keys(CHANNELS).map((key) => CHANNELS[key].id), + label: "PBR Channel", + exposed: false, + }); + + pbrMaterialsProp = new Property(ModelProject, "object", "pbr_materials", { + default: {}, + exposed: false, + label: "PBR Materials", + }); + + projectMaterialsProp = new Property(ModelProject, "object", "bb_materials", { + default: {}, + exposed: false, + label: "Project Materials", + }); + + projectPbrModeProp = new Property(ModelProject, "boolean", "pbr_active", { + default: false, + exposed: true, + values: [], + label: "PBR Mode", + }); + + /** + * ### Export MER map + * Generates a MER map from the currently selected texture and exports it as a PNG file + * @param cb Callback function to run after the MER file is exported + * @returns void + */ + const exportMer = (cb?: (filePath: string) => void) => { + const selected = Texture.all.find((t) => t.selected); + + if (!selected) { + return; + } + + const mer = new PbrMaterial( + selected.layers_enabled + ? selected.layers + : Project + ? Project.textures + : null, + selected.uuid, + ).createMer(false); + + if (!mer) { + return; + } + + mer.toBlob(async (blob) => { + if (!blob) { + return; + } + + const [name, startpath] = Project + ? [ + `${selected.name ?? Project.getDisplayName()}_mer`, + Project.export_path, + ] + : ["mer"]; + + Blockbench.export( + { + content: await blob.arrayBuffer(), + type: "PNG", + name, + extensions: ["png"], + resource_id: "mer", + savetype: "image", + startpath, + }, + cb, + ); + }); + }; + + /** + * ### Apply PBR Material + * Iterates over all faces in the project and applies a PBR material to each face + * @param materialParams Parameters to extend the base material with + * @returns `THREE.MeshStandardMaterial` with PBR textures applied + */ + const applyPbrMaterial = ( + materialParams?: THREE.MeshStandardMaterialParameters, + ) => { + // Don't overwrite placeholder material in Edit and Paint mode + (Texture.all.length === 0 && Modes.id !== `${PLUGIN_ID}_mode`) + if (!Project || Texture.all.length === 0) { + return; + } + + let materialsSet = false; + + Project.elements.forEach((item) => { + if (!(item instanceof Cube)) { + return; + } + + Object.keys(item.faces).forEach((key) => { + const face = item.faces[key]; + const texture = face.getTexture(); + + if (!texture) { + return; + } + + const projectMaterial = Project.materials[texture.uuid]; + + if ( + projectMaterial.isShaderMaterial && + !Project.bb_materials[texture.uuid] + ) { + Project.bb_materials[texture.uuid] = projectMaterial; + } + + const material = new PbrMaterial( + texture.layers_enabled + ? texture.layers.filter((layer) => layer.visible) ?? null + : Project.textures, + texture.uuid, + ).getMaterial(materialParams); + + Project.materials[texture.uuid] = + THREE.ShaderMaterial.prototype.copy.call(material, projectMaterial); + + Canvas.updateAllFaces(texture); + materialsSet = true; + }); + }); + + Project.pbr_active = materialsSet; + }; + + /** + * ### Disable PBR + * Reverts all faces in the project to their original materials + * @returns void + */ + const disablePbr = () => { + if (!Project || !Project.bb_materials) { + return; + } + + Project.elements.forEach((item) => { + if (!(item instanceof Cube)) { + return; + } + + Object.keys(item.faces).forEach((key) => { + const face = item.faces[key]; + const texture = face.getTexture(); + + if (!texture) { + return; + } + + const projectMaterial = Project.bb_materials[texture.uuid]; + + if (!projectMaterial) { + return; + } + + Project.materials[texture.uuid] = projectMaterial; + }); + }); + + Project.pbr_active = false; + Canvas.updateAll(); + }; + + // + // UI Components + // + + const createTextureSetDialog = () => { + if (!Project) { + return; + } + const scope = getProjectTextures(); + Project.textures.forEach((t) => { + const mat = new PbrMaterial(scope, t.uuid); + + const projectNormalMap = mat.findTexture(CHANNELS.normal, false)?.name; + const projectHeightMap = mat.findTexture(CHANNELS.height, false)?.name; + const projectColorMap = mat.findTexture(CHANNELS.albedo, false)?.name; + const projectMetalnessMap = mat.findTexture( + CHANNELS.metalness, + false, + )?.name; + const projectEmissiveMap = mat.findTexture( + CHANNELS.emissive, + false, + )?.name; + const projectRoughnessMap = mat.findTexture( + CHANNELS.roughness, + false, + )?.name; + + const form: DialogOptions["form"] = {}; + + if (!projectColorMap) { + form.baseColor = { + type: "color", + label: "Base Color", + value: "#ff00ff", + }; + } + + if (!projectMetalnessMap && !projectEmissiveMap && !projectRoughnessMap) { + form.metalness = { + label: "Metalness", + type: "range", + min: 0, + max: 255, + step: 1, + value: 0, + }; + + form.emissive = { + label: "Emissive", + type: "range", + min: 0, + max: 255, + step: 1, + value: 0, + }; + + form.roughness = { + label: "Roughness", + type: "range", + min: 0, + max: 255, + step: 1, + value: 0, + }; + } + + if (projectNormalMap && projectHeightMap) { + form.depthMap = { + type: "radio", + label: "Depth Map", + options: { + normal: "Normal Map", + heightmap: "Height", + }, + value: "normal", + }; + } + + textureSetDialog = new Dialog(`${PLUGIN_ID}_texture_set`, { + id: `${PLUGIN_ID}_texture_set`, + title: "Create Texture Set JSON", + buttons: ["Create", "Cancel"], + form, + onConfirm(formResult: Record) { + const baseName = + Project.model_identifier.length > 0 + ? Project.model_identifier + : Project.getDisplayName(); + + const hasMer = + projectMetalnessMap || projectEmissiveMap || projectRoughnessMap; + + const textureSet: { + format_version: string; + "minecraft:texture_set": { + color: string; + metalness_emissive_roughness: [number, number, number]; + normal?: string; + heightmap?: string; + }; + } = { + format_version: "1.16.200", + "minecraft:texture_set": { + color: + (projectColorMap + ? pathToName(projectColorMap, false) + : formResult.baseColor?.toHexString()) ?? baseName, + metalness_emissive_roughness: [ + formResult.metalness ?? 0, + formResult.emissive ?? 0, + formResult.roughness ?? 255, + ], + }, + }; + + if (formResult.depthMap === "normal" && projectNormalMap) { + textureSet["minecraft:texture_set"].normal = pathToName( + projectNormalMap, + false, + ); + } else if ( + (!projectNormalMap || formResult.depthMap === "heightmap") && + projectHeightMap + ) { + textureSet["minecraft:texture_set"].heightmap = pathToName( + projectHeightMap, + false, + ); + } + + const exportTextureSet = () => + Blockbench.export( + { + content: JSON.stringify(textureSet, null, 2), + type: "JSON", + name: `${baseName}.texture_set`, + extensions: ["json"], + resource_id: "texture_set", + startpath: Project.export_path, + }, + () => { + Blockbench.showQuickMessage("Texture set created", 2000); + textureSetDialog.hide(); + }, + ); + + if (hasMer) { + exportMer((filePath) => { + textureSet["minecraft:texture_set"].metalness_emissive_roughness = + pathToName(filePath, false); + exportTextureSet(); + }); + return; + } + + exportTextureSet(); + }, + cancelIndex: 1, + }); + + textureSetDialog.show(); + + return textureSetDialog; + }); + }; + + // + // Events + // + + /** + * List of Blockbench events which trigger a PBR material update + */ + const subscribeToEvents: EventName[] = [ + "undo", + "redo", + "add_texture", + "finish_edit", + "finished_edit", + "load_project", + "select_preview_scene", + "change_texture_path", + "select_project", + ]; + + /** + * Conditionally triggers the PBR material update based on the `pbr_active` setting + * @returns void + */ + const renderPbrScene = () => + Project && Project.pbr_active && applyPbrMaterial(); + + const enableListeners = () => { + subscribeToEvents.forEach((event) => { + Blockbench.addListener(event as EventName, renderPbrScene); + }); + }; + + const disableListeners = () => { + subscribeToEvents.forEach((event) => { + Blockbench.removeListener(event as EventName, renderPbrScene); + }); + }; + + // + // Setup + // + + const onload = () => { + // + // Settings + // + pbrDisplaySetting = new Setting("pbr_active", { + category: "preview", + name: "Enable PBR Preview", + description: "Enables PBR preview in the editor", + type: "toggle", + default_value: false, + icon: "tonality", + launch_setting: true, + onChange(value) { + if (value) { + applyPbrMaterial(); + enableListeners(); + return; + } + disablePbr(); + disableListeners(); + }, + }); + + correctLightsSetting = new Setting("display_settings_correct_lights", { + category: "preview", + name: "Correct Lights", + description: "Corrects the lighting in the preview for PBR materials", + type: "toggle", + default_value: false, + icon: "light_mode", + condition: () => !!Project, + onChange(value) { + Preview.selected.renderer.physicallyCorrectLights = value; + + applyPbrMaterial(); + }, + }); + + tonemappingSetting = new Setting("display_settings_tone_mapping", { + category: "preview", + name: "Tone Mapping", + description: "Changes the tone mapping of the preview", + type: "select", + default_value: THREE.NoToneMapping, + value: THREE.NoToneMapping, + icon: "palette", + options: { + [THREE.NoToneMapping]: "None", + [THREE.LinearToneMapping]: "Linear", + [THREE.ReinhardToneMapping]: "Reinhard", + [THREE.CineonToneMapping]: "Cineon", + [THREE.ACESFilmicToneMapping]: "ACES", + }, + onChange(value) { + Preview.selected.renderer.toneMapping = Number( + value, + ) as THREE.ToneMapping; + + applyPbrMaterial(); + }, + }); + + exposureSetting = new Setting("display_settings_exposure", { + category: "preview", + name: "Exposure", + description: "Adjusts the exposure of the scene", + type: "number", + default_value: 1, + icon: "exposure", + step: 0.1, + min: -2, + max: 2, + // condition: () => + // Project && + // Project.pbr_active && + // Preview.selected.renderer.toneMapping !== THREE.NoToneMapping, + onChange(value) { + Preview.selected.renderer.toneMappingExposure = Math.max( + -2, + Math.min(2, Number(value)), + ); + }, + }); + + // + // Actions + // + + generateNormal = new Action(`${PLUGIN_ID}_generate_normal`, { + icon: "altitude", + name: "Generate Normal Map", + description: "Generates a normal map from the height map", + condition: () => + (TextureLayer.selected || Texture.all.find((t) => t.selected)) !== + undefined, + click() { + const selected = + TextureLayer.selected ?? Texture.all.find((t) => t.selected); + const mat = new PbrMaterial(getProjectTextures(), selected.uuid); + + const texture = + TextureLayer.selected ?? + Texture.all.find((t) => t.selected) ?? + mat.findTexture(CHANNELS.height, true); + + if (!texture) { + Blockbench.showQuickMessage("No height map found", 2000); + return; + } + + const normalMap = PbrMaterial.createNormalMap(texture); + + if (normalMap) { + mat.saveTexture(CHANNELS.normal, normalMap); + normalMap.select(); + Blockbench.showQuickMessage("Normal map generated", 2000); + return; + } + + Blockbench.showQuickMessage("Failed to generate normal map", 2000); + }, + }); + + generateMer = new Action(`${PLUGIN_ID}_create_mer`, { + icon: "lightbulb_circle", + name: "Export MER", + description: + "Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)", + condition: () => Format.id == "bedrock", + click() { + exportMer(); + }, + }); + + decodeMer = new Action(`${PLUGIN_ID}_decode_mer`, { + icon: "arrow_split", + name: "Decode MER", + description: + "Decodes a MER texture map into metalness, emissive, and roughness channels", + condition: () => Format.id == "bedrock", + click() { + const projectTextures = getProjectTextures(); + const selected = + TextureLayer.selected?.texture ?? Texture.all.find((t) => t.selected); + + const mat = new PbrMaterial( + projectTextures, + (selected ?? projectTextures[0]).uuid, + ); + + const mer = mat.decodeMer(); + const merChannels = [ + CHANNELS.metalness, + CHANNELS.emissive, + CHANNELS.roughness, + ]; + + merChannels.forEach((channel) => { + const key = channel.id as keyof typeof mer; + const canvas = mer[key]; + + if (!canvas) { + return; + } + + const layer = new TextureLayer( + { + name: `${selected?.name}_${key}`, + data_url: canvas.toDataURL(), + }, + selected.layers_enabled ? selected.texture : selected, + ); + // projectTextures.push(layer); + mat.saveTexture(channel, layer); + }); + }, + }); + + createTextureSet = new Action(`${PLUGIN_ID}_create_texture_set`, { + name: "Create Texture Set", + icon: "layers", + description: + "Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.", + condition: () => Format.id == "bedrock", + click() { + createTextureSetDialog(); + }, + }); + + Object.entries(CHANNELS).forEach(([key, channel]) => { + channelActions[key] = new Action(`${PLUGIN_ID}_assign_channel_${key}`, { + icon: channel.icon ?? "tv_options_edit_channels", + name: `Assign to ${channel.label.toLocaleLowerCase()} channel`, + description: `Assign the selected layer to the ${channel.label} channel`, + category: "textures", + condition: () => Modes.paint && TextureLayer.selected, + click(e) { + const layer = TextureLayer.selected; + + if (!layer || !Project) { + return; + } + + Undo.initEdit({ layers: [layer] }); + + layer.extend({ channel: key }); + + const texture = layer.texture; + + texture.updateChangesAfterEdit(); + + if (!Project.pbr_materials[texture.uuid]) { + Project.pbr_materials[texture.uuid] = {}; + } + + // If the layer uuid is already assigned to another channel, unassign it first + Object.entries(Project.pbr_materials[texture.uuid]).forEach( + ([assignedChannel, assignedLayerUuid]) => { + if (assignedLayerUuid === layer.uuid) { + delete Project.pbr_materials[texture.uuid][assignedChannel]; + } + }, + ); + + Project.pbr_materials[texture.uuid][key] = layer.uuid; + + Undo.finishEdit("Change channel assignment"); + + Blockbench.showQuickMessage( + `Assigned "${layer.name}" to ${channel.label} channel`, + 2000, + ); + + applyPbrMaterial(); + }, + }); + }); + + unassignChannel = new Action(`${PLUGIN_ID}_unassign_channel`, { + icon: "cancel", + name: "Unassign Channel", + description: "Unassign the selected layer from the channel", + category: "textures", + click() { + const layer = TextureLayer.selected; + + if (!layer || !Project) { + return; + } + + Undo.initEdit({ layers: [layer] }); + + const { texture, channel } = layer; + + texture.updateChangesAfterEdit(); + + Project.pbr_materials[texture.uuid] = {}; + + layer.channel = NA_CHANNEL; + Undo.finishEdit("Unassign channel"); + + Blockbench.showQuickMessage( + `Unassigned "${layer.name}" from ${channel} channel`, + 2000, + ); + + applyPbrMaterial(); + }, + }); + + togglePbr = new Toggle("toggle_pbr", { + name: "PBR Preview", + description: "Toggle PBR Preview", + icon: "panorama_photosphere", + category: "view", + condition: () => (Project && Project.textures.length > 0) === true, + linked_setting: "pbr_active", + default: false, + click() {}, + onChange(value) { + Blockbench.showQuickMessage( + `PBR Preview is now ${value ? "enabled" : "disabled"}`, + 2000, + ); + }, + }); + + toggleCorrectLights = new Toggle(`${PLUGIN_ID}_correct_lights`, { + category: "preview", + name: "Correct Lights", + description: "Corrects the lighting in the preview", + icon: "fluorescent", + linked_setting: "display_settings_correct_lights", + default: false, + onChange(value) { + Blockbench.showQuickMessage( + `Physically corrected lighting is now ${value ? "enabled" : "disabled"}`, + 2000, + ); + }, + click() {}, + }); + + exposureSlider = new BarSlider(`${PLUGIN_ID}_exposure`, { + category: "preview", + name: "Exposure", + description: "Adjusts the exposure of the scene", + icon: "exposure", + min: -2, + max: 2, + step: 0.1, + value: Settings.get("display_settings_exposure") ?? 1, + display_condition: { + modes: ["edit", "paint", "animate"], + project: true, + }, + onChange({ value }) { + exposureSetting.set(value); + }, + }); + + exposureSlider.addLabel(true, exposureSlider); + + channelMenu = new Menu( + `${PLUGIN_ID}_channel_menu`, + [ + ...Object.keys(CHANNELS).map( + (key) => `${PLUGIN_ID}_assign_channel_${key}`, + ), + ...[`${PLUGIN_ID}_unassign_channel`], + ], + { + onOpen() { + applyPbrMaterial(); + }, + }, + ); + + showChannelMenu = new Action(`${PLUGIN_ID}_show_channel_menu`, { + icon: "texture", + name: "Assign to PBR Channel", + description: "Assign the selected layer to a channel", + category: "textures", + condition: () => Modes.paint && TextureLayer.selected, + click(event) { + channelMenu.open(event as MouseEvent); + }, + }); + + tonemappingSelect = new BarSelect(`${PLUGIN_ID}_tonemapping`, { + category: "preview", + name: "Tone Mapping", + description: "Select the tone mapping function", + icon: "palette", + value: THREE.NoToneMapping, + linked_setting: "display_settings_tone_mapping", + options: { + [THREE.NoToneMapping]: { + name: "No Tone Mapping", + icon: "invert_colors_off", + }, + [THREE.LinearToneMapping]: { + name: "Linear", + icon: "linear_scale", + }, + [THREE.ReinhardToneMapping]: { + name: "Reinhard", + icon: "brightness_medium", + }, + [THREE.CineonToneMapping]: { + name: "Cineon", + icon: "brightness_high", + }, + [THREE.ACESFilmicToneMapping]: { + name: "ACES", + icon: "brightness_auto", + }, + }, + onChange({ value }) { + tonemappingSetting.set(value); + + applyPbrMaterial(); + }, + }); + + displaySettingsPanel = new Panel(`${PLUGIN_ID}_display_settings`, { + name: "PBR Settings", + id: `${PLUGIN_ID}_display_settings_panel`, + icon: "display_settings", + toolbars: [ + new Toolbar(`${PLUGIN_ID}_controls_toolbar`, { + id: `${PLUGIN_ID}_controls_toolbar`, + children: [ + "toggle_pbr", + `${PLUGIN_ID}_correct_lights`, + `${PLUGIN_ID}_show_channel_menu`, + ], + name: "PBR", + }), + new Toolbar(`${PLUGIN_ID}_display_settings_toolbar`, { + id: `${PLUGIN_ID}_display_settings_toolbar`, + children: [`${PLUGIN_ID}_tonemapping`, `${PLUGIN_ID}_exposure`], + // condition: () => Project && Project.pbr_active, + name: "Display Settings", + }), + ], + display_condition: { + modes: ["edit", "paint", "animate"], + project: true, + }, + component: {}, + expand_button: true, + growable: false, + onFold() {}, + onResize() {}, + default_side: "left", + default_position: { + slot: "left_bar", + float_position: [0, 0], + float_size: [400, 300], + height: 300, + folded: false, + }, + insert_after: "textures", + insert_before: "paint", + }); + + MenuBar.addAction(generateMer, "file.export"); + MenuBar.addAction(generateNormal, "tools"); + MenuBar.addAction(decodeMer, "tools"); + MenuBar.addAction(createTextureSet, "file.export"); + MenuBar.addAction(togglePbr, "view"); + MenuBar.addAction(toggleCorrectLights, "preview"); + + Object.entries(channelActions).forEach(([key, action], idx) => { + MenuBar.addAction(action, `image.${idx}`); + }); + + enableListeners(); + }; + + // + // Teardown + // + const onunload = () => { + Object.entries(channelActions).forEach(([key, action]) => { + action.delete(); + }); + + MenuBar.removeAction(`file.export.${PLUGIN_ID}_create_mer`); + MenuBar.removeAction(`file.export.${PLUGIN_ID}_create_texture_set`); + MenuBar.removeAction(`tools.${PLUGIN_ID}_generate_normal`); + disableListeners(); + + displaySettingsPanel?.delete(); + textureSetDialog?.delete(); + pbrDisplaySetting?.delete(); + generateMer?.delete(); + generateNormal?.delete(); + togglePbr?.delete(); + decodeMer?.delete(); + createTextureSet?.delete(); + channelProp?.delete(); + showChannelMenu?.delete(); + exposureSetting?.delete(); + exposureSlider?.delete(); + tonemappingSelect?.delete(); + toggleCorrectLights?.delete(); + correctLightsSetting?.delete(); + tonemappingSetting?.delete(); + deactivatePbr?.delete(); + unassignChannel?.delete(); + projectMaterialsProp?.delete(); + pbrMaterialsProp?.delete(); + projectPbrModeProp?.delete(); + }; + + // + // Plugin Registration + // + + BBPlugin.register(PLUGIN_ID, { + version: PLUGIN_VERSION, + title: "PBR Features", + author: "Jason J. Gardner", + description: + "Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.", + tags: ["PBR", "RTX", "Deferred Rendering"], + icon: "icon.png", + variant: "both", + await_loading: true, + new_repository_format: true, + repository: "https://github.com/jasonjgardner/blockbench-plugins", + has_changelog: true, + min_version: "4.10.1", + onload, + onunload, + }); +})(); diff --git a/src/pbr_preview/tsconfig.json b/src/pbr_preview/tsconfig.json new file mode 100644 index 00000000..591a2bd3 --- /dev/null +++ b/src/pbr_preview/tsconfig.json @@ -0,0 +1,111 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + /* Projects */ + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + /* Language and Environment */ + "target": "ES2019" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + /* Modules */ + "module": "ES2022" /* Specify what module code is generated. */, + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ + // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ + // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ + // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ + // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ + // "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + /* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + "inlineSourceMap": true /* Include sourcemap files inside the emitted JavaScript. */, + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + // "outDir": "./", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + "sourceRoot": "./src" /* Specify the root path for debuggers to find the reference source code. */, + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + "inlineSources": true /* Include source code in the sourcemaps inside the emitted JavaScript. */, + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, + /* Type Checking */ + "strict": true /* Enable all strict type-checking options. */, + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "lib": [ + "ES2019", + "DOM" + ], + "rootDir": "src" /* Specify the root folder within your source files. */, + "allowJs": true /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */, + "declaration": false /* Generate .d.ts files from TypeScript and JavaScript files in your project. */, + // "sourceMap": true /* Create source map files for emitted JavaScript files. */, + "outDir": "dist" /* Specify an output folder for all emitted files. */, + "noImplicitAny": true /* Enable error reporting for expressions and declarations with an implied 'any' type. */, + "skipLibCheck": true /* Skip type checking all .d.ts files. */, + "removeComments": true + } +} \ No newline at end of file From 6927ebed120eabb2252719362d182cd22fbc363c Mon Sep 17 00:00:00 2001 From: Jason Gardner Date: Sun, 26 May 2024 13:10:05 -0500 Subject: [PATCH 02/50] fix: Toggle button condition - Temporarily disabled condition on PBR toggle - Removed leftover code from merge --- plugins/pbr_preview/pbr_preview.js | 2 +- src/pbr_preview/src/index.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index 33896961..aedd278f 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1 +1 @@ -"use strict";(()=>{(()=>{let j,R,L,A,I,D,H,U,w,O,F,Q,C,G,k,S,J,B,z,X,q,$={},l="pbr_preview",te="1.0.0",V="_NONE_",d={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality"},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6"},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight"},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain"},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape"},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks"},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode"}},P=(n=!0)=>{let e=Project?Project.textures??Texture.all:Texture.all;return n?e.filter(t=>t.layers.length>0).flatMap(t=>t.layers):e};class p{constructor(e,t){this._scope=e??P(),this._materialUuid=t}merToCanvas(){let e=this.getTexture(d.emissive),t=this.getTexture(d.roughness),a=this.getTexture(d.metalness);if(!e&&!t&&!a){let{metalness:s,emissive:i,roughness:o}=this.decodeMer();s&&(a=p.makePixelatedCanvas(s)),i&&(e=p.makePixelatedCanvas(i)),o&&(t=p.makePixelatedCanvas(o))}return{emissiveMap:e,roughnessMap:t,metalnessMap:a}}getMaterial(e={}){let{emissiveMap:t,roughnessMap:a,metalnessMap:s}=this.merToCanvas();return new THREE.MeshStandardMaterial({map:this.getTexture(d.albedo)??p.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(i=>i.selected)?.canvas??Texture.all[0].canvas),aoMap:this.getTexture(d.ao),normalMap:this.getTexture(d.normal),bumpMap:this.getTexture(d.height),metalnessMap:s,roughnessMap:a,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:1,alphaTest:.5,...e})}saveTexture(e,{uuid:t,extend:a}){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][e.id]=t,a({channel:e.id}))}findTexture(e,t=!0){if(!Project)return null;let a=this._scope.find(r=>r.channel&&(r.channel===e||r.channel===e.id));if(a)return a;let s=typeof e=="string"?e:e.id;Project.pbr_materials??={};let i=Project.pbr_materials[this._materialUuid];if(!i&&t){let r=new RegExp(`_*${s}(.[^.]+)?$`,"i");return this._scope.find(c=>r.test(c.name))??null}let o=i?.[s];return o?this._scope.find(r=>r.uuid===o)??null:null}static makePixelatedCanvas(e){let t=new THREE.CanvasTexture(e,void 0,void 0,void 0,THREE.NearestFilter,THREE.NearestFilter);return t.needsUpdate=!0,t}getTexture(e){let t=this.findTexture(e);return t?p.makePixelatedCanvas(t.canvas):null}static extractChannel(e,t){let a=e.canvas,s=a.width,i=a.height,o=a.getContext("2d");if(!o||!s||!i)return null;let r=document.createElement("canvas");r.width=s,r.height=i;let c=r.getContext("2d");if(!c)return null;let m={r:0,g:1,b:2,a:3}[t],{data:f}=o.getImageData(0,0,s,i),x=new Uint8ClampedArray(s*i*4);for(let h=0;he){_[g]=v.data[g],_[g+1]=v.data[g+1],_[g+2]=v.data[g+2],_[g+3]=255;continue}_[g]=0,_[g+1]=0,_[g+2]=0,_[g+3]=255}return m.putImageData(new ImageData(_,r.width,r.height),0,0),{metalness:a,emissive:r,emissiveLevel:s,roughness:i,sss:o}}createMer(e=!1){let t=this.findTexture(d.metalness,e),a=this.findTexture(d.emissive,e),s=this.findTexture(d.roughness,e),i=this.findTexture("sss",!1),o=Math.max(t?.img.width??0,a?.img.width??0,s?.img.width??0,Project?Project.texture_width:0,16),r=Math.max(t?.img.height??0,a?.img.height??0,s?.img.height??0,Project?Project.texture_height:0,16),c=document.createElement("canvas");c.width=o,c.height=r;let m=c.getContext("2d");if(!m)return null;let f=t?.img?p.extractChannel(t,"r"):null,x=a?.img?p.extractChannel(a,"g"):null,v=s?.img?p.extractChannel(s,"b"):null,h=i&&i?.img?p.extractChannel(i,"a"):null,_=f?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),g=x?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),u=v?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),b=h?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(new Uint8ClampedArray(o*r*4).fill(255),o,r),M=new Uint8ClampedArray(o*r*4);for(let T=0;T{let M=(u+b*s)*4;return o[M]/255};r.width=s,r.height=i,c.drawImage(e.img,0,0,s,i);let f=c.getImageData(0,0,s,i),x=f.data,v=u=>{let b=Math.sqrt(u[0]*u[0]+u[1]*u[1]+u[2]*u[2]);return[u[0]/b,u[1]/b,u[2]/b]};for(let u=0;ud[n].id),label:"PBR Channel",exposed:!1}),z=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),X=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),q=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"});let K=n=>{let e=Texture.all.find(a=>a.selected);if(!e)return;let t=new p(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!1);t&&t.toBlob(async a=>{if(!a)return;let[s,i]=Project?[`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await a.arrayBuffer(),type:"PNG",name:s,extensions:["png"],resource_id:"mer",savetype:"image",startpath:i},n)})},y=n=>{if(!Project||Texture.all.length===0)return;let e=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(a=>{let i=t.faces[a].getTexture();if(!i)return;let o=Project.materials[i.uuid];o.isShaderMaterial&&!Project.bb_materials[i.uuid]&&(Project.bb_materials[i.uuid]=o);let r=new p(i.layers_enabled?i.layers.filter(c=>c.visible)??null:Project.textures,i.uuid).getMaterial(n);Project.materials[i.uuid]=THREE.ShaderMaterial.prototype.copy.call(r,o),Canvas.updateAllFaces(i),e=!0})}),Project.pbr_active=e},ne=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(n=>{n instanceof Cube&&Object.keys(n.faces).forEach(e=>{let a=n.faces[e].getTexture();if(!a)return;let s=Project.bb_materials[a.uuid];s&&(Project.materials[a.uuid]=s)})}),Project.pbr_active=!1,Canvas.updateAll())},ae=()=>{if(!Project)return;let n=P();Project.textures.forEach(e=>{let t=new p(n,e.uuid),a=t.findTexture(d.normal,!1)?.name,s=t.findTexture(d.height,!1)?.name,i=t.findTexture(d.albedo,!1)?.name,o=t.findTexture(d.metalness,!1)?.name,r=t.findTexture(d.emissive,!1)?.name,c=t.findTexture(d.roughness,!1)?.name,m={};return i||(m.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!r&&!c&&(m.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},m.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},m.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),a&&s&&(m.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),w=new Dialog(`${l}_texture_set`,{id:`${l}_texture_set`,title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:m,onConfirm(f){let x=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),v=o||r||c,h={format_version:"1.16.200","minecraft:texture_set":{color:(i?pathToName(i,!1):f.baseColor?.toHexString())??x,metalness_emissive_roughness:[f.metalness??0,f.emissive??0,f.roughness??255]}};f.depthMap==="normal"&&a?h["minecraft:texture_set"].normal=pathToName(a,!1):(!a||f.depthMap==="heightmap")&&s&&(h["minecraft:texture_set"].heightmap=pathToName(s,!1));let _=()=>Blockbench.export({content:JSON.stringify(h,null,2),type:"JSON",name:`${x}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path},()=>{Blockbench.showQuickMessage("Texture set created",2e3),w.hide()});if(v){K(g=>{h["minecraft:texture_set"].metalness_emissive_roughness=pathToName(g,!1),_()});return}_()},cancelIndex:1}),w.show(),w})},W=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],Y=()=>Project&&Project.pbr_active&&y(),Z=()=>{W.forEach(n=>{Blockbench.addListener(n,Y)})},ee=()=>{W.forEach(n=>{Blockbench.removeListener(n,Y)})},se=()=>{H=new Setting("pbr_active",{category:"preview",name:"Enable PBR Preview",description:"Enables PBR preview in the editor",type:"toggle",default_value:!1,icon:"tonality",launch_setting:!0,onChange(n){if(n){y(),Z();return}ne(),ee()}}),J=new Setting("display_settings_correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview for PBR materials",type:"toggle",default_value:!1,icon:"light_mode",condition:()=>!!Project,onChange(n){Preview.selected.renderer.physicallyCorrectLights=n,y()}}),B=new Setting("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:THREE.NoToneMapping,value:THREE.NoToneMapping,icon:"palette",options:{[THREE.NoToneMapping]:"None",[THREE.LinearToneMapping]:"Linear",[THREE.ReinhardToneMapping]:"Reinhard",[THREE.CineonToneMapping]:"Cineon",[THREE.ACESFilmicToneMapping]:"ACES"},onChange(n){Preview.selected.renderer.toneMapping=Number(n),y()}}),S=new Setting("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",default_value:1,icon:"exposure",step:.1,min:-2,max:2,onChange(n){Preview.selected.renderer.toneMappingExposure=Math.max(-2,Math.min(2,Number(n)))}}),A=new Action(`${l}_generate_normal`,{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(n=>n.selected))!==void 0,click(){let n=TextureLayer.selected??Texture.all.find(s=>s.selected),e=new p(P(),n.uuid),t=TextureLayer.selected??Texture.all.find(s=>s.selected)??e.findTexture(d.height,!0);if(!t){Blockbench.showQuickMessage("No height map found",2e3);return}let a=p.createNormalMap(t);if(a){e.saveTexture(d.normal,a),a.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),L=new Action(`${l}_create_mer`,{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",click(){K()}}),j=new Action(`${l}_decode_mer`,{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",click(){let n=P(),e=TextureLayer.selected?.texture??Texture.all.find(i=>i.selected),t=new p(n,(e??n[0]).uuid),a=t.decodeMer();[d.metalness,d.emissive,d.roughness].forEach((i,o)=>{let r=i.id,c=a[r];if(!c)return;let m=new TextureLayer({name:`${e?.name}_${r}`,data_url:c.toDataURL()},e.layers_enabled?e.texture:e);t.saveTexture(i,m)})}}),R=new Action(`${l}_create_texture_set`,{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){ae()}}),Object.entries(d).forEach(([n,e])=>{$[n]=new Action(`${l}_assign_channel_${n}`,{icon:e.icon??"tv_options_edit_channels",name:`Assign to ${e.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${e.label} channel`,category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(t){let a=TextureLayer.selected;if(!a||!Project)return;Undo.initEdit({layers:[a]}),a.extend({channel:n});let s=a.texture;s.updateChangesAfterEdit(),Project.pbr_materials[s.uuid]||(Project.pbr_materials[s.uuid]={}),Object.entries(Project.pbr_materials[s.uuid]).forEach(([i,o])=>{o===a.uuid&&delete Project.pbr_materials[s.uuid][i]}),Project.pbr_materials[s.uuid][n]=a.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${a.name}" to ${e.label} channel`,2e3),y()}})}),I=new Action(`${l}_unassign_channel`,{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",click(){let n=TextureLayer.selected;if(!n||!Project)return;Undo.initEdit({layers:[n]});let{texture:e,channel:t}=n;e.updateChangesAfterEdit(),Project.pbr_materials[e.uuid]={},n.channel=V,Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${n.name}" from ${t} channel`,2e3),y()}}),D=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",condition:()=>(Project&&Project.textures.length>0)===!0,linked_setting:"pbr_active",default:!1,click(){},onChange(n){Blockbench.showQuickMessage(`PBR Preview is now ${n?"enabled":"disabled"}`,2e3)}}),k=new Toggle(`${l}_correct_lights`,{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",linked_setting:"display_settings_correct_lights",default:!1,onChange(n){Blockbench.showQuickMessage(`Physically corrected lighting is now ${n?"enabled":"disabled"}`,2e3)},click(){}}),C=new BarSlider(`${l}_exposure`,{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",icon:"exposure",min:-2,max:2,step:.1,value:Settings.get("display_settings_exposure")??1,display_condition:{modes:["edit","paint","animate"],project:!0},onChange({value:n}){S.set(n)}}),C.addLabel(!0,C),F=new Menu(`${l}_channel_menu`,[...Object.keys(d).map(n=>`${l}_assign_channel_${n}`),`${l}_unassign_channel`],{onOpen(){y()}}),Q=new Action(`${l}_show_channel_menu`,{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(n){F.open(n)}}),G=new BarSelect(`${l}_tonemapping`,{category:"preview",name:"Tone Mapping",description:"Select the tone mapping function",icon:"palette",value:THREE.NoToneMapping,linked_setting:"display_settings_tone_mapping",options:{[THREE.NoToneMapping]:{name:"No Tone Mapping",icon:"invert_colors_off"},[THREE.LinearToneMapping]:{name:"Linear",icon:"linear_scale"},[THREE.ReinhardToneMapping]:{name:"Reinhard",icon:"brightness_medium"},[THREE.CineonToneMapping]:{name:"Cineon",icon:"brightness_high"},[THREE.ACESFilmicToneMapping]:{name:"ACES",icon:"brightness_auto"}},onChange({value:n}){B.set(n),y()}}),U=new Panel(`${l}_display_settings`,{name:"PBR Settings",id:`${l}_display_settings_panel`,icon:"display_settings",toolbars:[new Toolbar(`${l}_controls_toolbar`,{id:`${l}_controls_toolbar`,children:["toggle_pbr",`${l}_correct_lights`,`${l}_show_channel_menu`],name:"PBR"}),new Toolbar(`${l}_display_settings_toolbar`,{id:`${l}_display_settings_toolbar`,children:[`${l}_tonemapping`,`${l}_exposure`],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"paint"}),MenuBar.addAction(L,"file.export"),MenuBar.addAction(A,"tools"),MenuBar.addAction(j,"tools"),MenuBar.addAction(R,"file.export"),MenuBar.addAction(D,"view"),MenuBar.addAction(k,"preview"),Object.entries($).forEach(([n,e],t)=>{MenuBar.addAction(e,`image.${t}`)}),Z()},re=()=>{Object.entries($).forEach(([n,e])=>{e.delete()}),MenuBar.removeAction(`file.export.${l}_create_mer`),MenuBar.removeAction(`file.export.${l}_create_texture_set`),MenuBar.removeAction(`tools.${l}_generate_normal`),ee(),U?.delete(),w?.delete(),H?.delete(),L?.delete(),A?.delete(),D?.delete(),j?.delete(),R?.delete(),O?.delete(),Q?.delete(),S?.delete(),C?.delete(),G?.delete(),k?.delete(),J?.delete(),B?.delete(),deactivatePbr?.delete(),I?.delete(),X?.delete(),z?.delete(),q?.delete()};BBPlugin.register(l,{version:te,title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.1",onload:se,onunload:re})})();})(); +"use strict";(()=>{(()=>{let j,R,L,k,I,A,H,U,w,O,F,Q,C,G,D,S,J,B,z,X,q,$={},l="pbr_preview",te="1.0.0",V="_NONE_",c={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality"},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6"},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight"},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain"},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape"},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks"},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode"}},P=(n=!0)=>{let e=Project?Project.textures??Texture.all:Texture.all;return n?e.filter(t=>t.layers.length>0).flatMap(t=>t.layers):e};class p{constructor(e,t){this._scope=e??P(),this._materialUuid=t}merToCanvas(){let e=this.getTexture(c.emissive),t=this.getTexture(c.roughness),a=this.getTexture(c.metalness);if(!e&&!t&&!a){let{metalness:r,emissive:i,roughness:o}=this.decodeMer();r&&(a=p.makePixelatedCanvas(r)),i&&(e=p.makePixelatedCanvas(i)),o&&(t=p.makePixelatedCanvas(o))}return{emissiveMap:e,roughnessMap:t,metalnessMap:a}}getMaterial(e={}){let{emissiveMap:t,roughnessMap:a,metalnessMap:r}=this.merToCanvas();return new THREE.MeshStandardMaterial({map:this.getTexture(c.albedo)??p.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(i=>i.selected)?.canvas??Texture.all[0].canvas),aoMap:this.getTexture(c.ao),normalMap:this.getTexture(c.normal),bumpMap:this.getTexture(c.height),metalnessMap:r,roughnessMap:a,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:1,alphaTest:.5,...e})}saveTexture(e,{uuid:t,extend:a}){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][e.id]=t,a({channel:e.id}))}findTexture(e,t=!0){if(!Project)return null;let a=this._scope.find(s=>s.channel&&(s.channel===e||s.channel===e.id));if(a)return a;let r=typeof e=="string"?e:e.id;Project.pbr_materials??={};let i=Project.pbr_materials[this._materialUuid];if(!i&&t){let s=new RegExp(`_*${r}(.[^.]+)?$`,"i");return this._scope.find(d=>s.test(d.name))??null}let o=i?.[r];return o?this._scope.find(s=>s.uuid===o)??null:null}static makePixelatedCanvas(e){let t=new THREE.CanvasTexture(e,void 0,void 0,void 0,THREE.NearestFilter,THREE.NearestFilter);return t.needsUpdate=!0,t}getTexture(e){let t=this.findTexture(e);return t?p.makePixelatedCanvas(t.canvas):null}static extractChannel(e,t){let a=e.canvas,r=a.width,i=a.height,o=a.getContext("2d");if(!o||!r||!i)return null;let s=document.createElement("canvas");s.width=r,s.height=i;let d=s.getContext("2d");if(!d)return null;let m={r:0,g:1,b:2,a:3}[t],{data:f}=o.getImageData(0,0,r,i),x=new Uint8ClampedArray(r*i*4);for(let h=0;he){_[g]=v.data[g],_[g+1]=v.data[g+1],_[g+2]=v.data[g+2],_[g+3]=255;continue}_[g]=0,_[g+1]=0,_[g+2]=0,_[g+3]=255}return m.putImageData(new ImageData(_,s.width,s.height),0,0),{metalness:a,emissive:s,emissiveLevel:r,roughness:i,sss:o}}createMer(e=!1){let t=this.findTexture(c.metalness,e),a=this.findTexture(c.emissive,e),r=this.findTexture(c.roughness,e),i=this.findTexture("sss",!1),o=Math.max(t?.img.width??0,a?.img.width??0,r?.img.width??0,Project?Project.texture_width:0,16),s=Math.max(t?.img.height??0,a?.img.height??0,r?.img.height??0,Project?Project.texture_height:0,16),d=document.createElement("canvas");d.width=o,d.height=s;let m=d.getContext("2d");if(!m)return null;let f=t?.img?p.extractChannel(t,"r"):null,x=a?.img?p.extractChannel(a,"g"):null,v=r?.img?p.extractChannel(r,"b"):null,h=i&&i?.img?p.extractChannel(i,"a"):null,_=f?.getContext("2d")?.getImageData(0,0,o,s)??new ImageData(o,s),g=x?.getContext("2d")?.getImageData(0,0,o,s)??new ImageData(o,s),u=v?.getContext("2d")?.getImageData(0,0,o,s)??new ImageData(o,s),b=h?.getContext("2d")?.getImageData(0,0,o,s)??new ImageData(new Uint8ClampedArray(o*s*4).fill(255),o,s),M=new Uint8ClampedArray(o*s*4);for(let T=0;T{let M=(u+b*r)*4;return o[M]/255};s.width=r,s.height=i,d.drawImage(e.img,0,0,r,i);let f=d.getImageData(0,0,r,i),x=f.data,v=u=>{let b=Math.sqrt(u[0]*u[0]+u[1]*u[1]+u[2]*u[2]);return[u[0]/b,u[1]/b,u[2]/b]};for(let u=0;uc[n].id),label:"PBR Channel",exposed:!1}),z=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),X=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),q=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"});let K=n=>{let e=Texture.all.find(a=>a.selected);if(!e)return;let t=new p(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!1);t&&t.toBlob(async a=>{if(!a)return;let[r,i]=Project?[`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await a.arrayBuffer(),type:"PNG",name:r,extensions:["png"],resource_id:"mer",savetype:"image",startpath:i},n)})},y=n=>{if(!Project||Texture.all.length===0)return;let e=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(a=>{let i=t.faces[a].getTexture();if(!i)return;let o=Project.materials[i.uuid];o.isShaderMaterial&&!Project.bb_materials[i.uuid]&&(Project.bb_materials[i.uuid]=o);let s=new p(i.layers_enabled?i.layers.filter(d=>d.visible)??null:Project.textures,i.uuid).getMaterial(n);Project.materials[i.uuid]=THREE.ShaderMaterial.prototype.copy.call(s,o),Canvas.updateAllFaces(i),e=!0})}),Project.pbr_active=e},ne=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(n=>{n instanceof Cube&&Object.keys(n.faces).forEach(e=>{let a=n.faces[e].getTexture();if(!a)return;let r=Project.bb_materials[a.uuid];r&&(Project.materials[a.uuid]=r)})}),Project.pbr_active=!1,Canvas.updateAll())},ae=()=>{if(!Project)return;let n=P();Project.textures.forEach(e=>{let t=new p(n,e.uuid),a=t.findTexture(c.normal,!1)?.name,r=t.findTexture(c.height,!1)?.name,i=t.findTexture(c.albedo,!1)?.name,o=t.findTexture(c.metalness,!1)?.name,s=t.findTexture(c.emissive,!1)?.name,d=t.findTexture(c.roughness,!1)?.name,m={};return i||(m.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!s&&!d&&(m.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},m.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},m.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),a&&r&&(m.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),w=new Dialog(`${l}_texture_set`,{id:`${l}_texture_set`,title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:m,onConfirm(f){let x=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),v=o||s||d,h={format_version:"1.16.200","minecraft:texture_set":{color:(i?pathToName(i,!1):f.baseColor?.toHexString())??x,metalness_emissive_roughness:[f.metalness??0,f.emissive??0,f.roughness??255]}};f.depthMap==="normal"&&a?h["minecraft:texture_set"].normal=pathToName(a,!1):(!a||f.depthMap==="heightmap")&&r&&(h["minecraft:texture_set"].heightmap=pathToName(r,!1));let _=()=>Blockbench.export({content:JSON.stringify(h,null,2),type:"JSON",name:`${x}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path},()=>{Blockbench.showQuickMessage("Texture set created",2e3),w.hide()});if(v){K(g=>{h["minecraft:texture_set"].metalness_emissive_roughness=pathToName(g,!1),_()});return}_()},cancelIndex:1}),w.show(),w})},W=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],Y=()=>Project&&Project.pbr_active&&y(),Z=()=>{W.forEach(n=>{Blockbench.addListener(n,Y)})},ee=()=>{W.forEach(n=>{Blockbench.removeListener(n,Y)})},re=()=>{H=new Setting("pbr_active",{category:"preview",name:"Enable PBR Preview",description:"Enables PBR preview in the editor",type:"toggle",default_value:!1,icon:"tonality",launch_setting:!0,onChange(n){if(n){y(),Z();return}ne(),ee()}}),J=new Setting("display_settings_correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview for PBR materials",type:"toggle",default_value:!1,icon:"light_mode",condition:()=>!!Project,onChange(n){Preview.selected.renderer.physicallyCorrectLights=n,y()}}),B=new Setting("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:THREE.NoToneMapping,value:THREE.NoToneMapping,icon:"palette",options:{[THREE.NoToneMapping]:"None",[THREE.LinearToneMapping]:"Linear",[THREE.ReinhardToneMapping]:"Reinhard",[THREE.CineonToneMapping]:"Cineon",[THREE.ACESFilmicToneMapping]:"ACES"},onChange(n){Preview.selected.renderer.toneMapping=Number(n),y()}}),S=new Setting("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",default_value:1,icon:"exposure",step:.1,min:-2,max:2,onChange(n){Preview.selected.renderer.toneMappingExposure=Math.max(-2,Math.min(2,Number(n)))}}),k=new Action(`${l}_generate_normal`,{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(n=>n.selected))!==void 0,click(){let n=TextureLayer.selected??Texture.all.find(r=>r.selected),e=new p(P(),n.uuid),t=TextureLayer.selected??Texture.all.find(r=>r.selected)??e.findTexture(c.height,!0);if(!t){Blockbench.showQuickMessage("No height map found",2e3);return}let a=p.createNormalMap(t);if(a){e.saveTexture(c.normal,a),a.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),L=new Action(`${l}_create_mer`,{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:()=>Format.id=="bedrock",click(){K()}}),j=new Action(`${l}_decode_mer`,{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",condition:()=>Format.id=="bedrock",click(){let n=P(),e=TextureLayer.selected?.texture??Texture.all.find(i=>i.selected),t=new p(n,(e??n[0]).uuid),a=t.decodeMer();[c.metalness,c.emissive,c.roughness].forEach(i=>{let o=i.id,s=a[o];if(!s)return;let d=new TextureLayer({name:`${e?.name}_${o}`,data_url:s.toDataURL()},e.layers_enabled?e.texture:e);t.saveTexture(i,d)})}}),R=new Action(`${l}_create_texture_set`,{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",condition:()=>Format.id=="bedrock",click(){ae()}}),Object.entries(c).forEach(([n,e])=>{$[n]=new Action(`${l}_assign_channel_${n}`,{icon:e.icon??"tv_options_edit_channels",name:`Assign to ${e.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${e.label} channel`,category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(t){let a=TextureLayer.selected;if(!a||!Project)return;Undo.initEdit({layers:[a]}),a.extend({channel:n});let r=a.texture;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([i,o])=>{o===a.uuid&&delete Project.pbr_materials[r.uuid][i]}),Project.pbr_materials[r.uuid][n]=a.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${a.name}" to ${e.label} channel`,2e3),y()}})}),I=new Action(`${l}_unassign_channel`,{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",click(){let n=TextureLayer.selected;if(!n||!Project)return;Undo.initEdit({layers:[n]});let{texture:e,channel:t}=n;e.updateChangesAfterEdit(),Project.pbr_materials[e.uuid]={},n.channel=V,Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${n.name}" from ${t} channel`,2e3),y()}}),A=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",linked_setting:"pbr_active",default:!1,click(){},onChange(n){Blockbench.showQuickMessage(`PBR Preview is now ${n?"enabled":"disabled"}`,2e3)}}),D=new Toggle(`${l}_correct_lights`,{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",linked_setting:"display_settings_correct_lights",default:!1,onChange(n){Blockbench.showQuickMessage(`Physically corrected lighting is now ${n?"enabled":"disabled"}`,2e3)},click(){}}),C=new BarSlider(`${l}_exposure`,{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",icon:"exposure",min:-2,max:2,step:.1,value:Settings.get("display_settings_exposure")??1,display_condition:{modes:["edit","paint","animate"],project:!0},onChange({value:n}){S.set(n)}}),C.addLabel(!0,C),F=new Menu(`${l}_channel_menu`,[...Object.keys(c).map(n=>`${l}_assign_channel_${n}`),`${l}_unassign_channel`],{onOpen(){y()}}),Q=new Action(`${l}_show_channel_menu`,{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(n){F.open(n)}}),G=new BarSelect(`${l}_tonemapping`,{category:"preview",name:"Tone Mapping",description:"Select the tone mapping function",icon:"palette",value:THREE.NoToneMapping,linked_setting:"display_settings_tone_mapping",options:{[THREE.NoToneMapping]:{name:"No Tone Mapping",icon:"invert_colors_off"},[THREE.LinearToneMapping]:{name:"Linear",icon:"linear_scale"},[THREE.ReinhardToneMapping]:{name:"Reinhard",icon:"brightness_medium"},[THREE.CineonToneMapping]:{name:"Cineon",icon:"brightness_high"},[THREE.ACESFilmicToneMapping]:{name:"ACES",icon:"brightness_auto"}},onChange({value:n}){B.set(n),y()}}),U=new Panel(`${l}_display_settings`,{name:"PBR Settings",id:`${l}_display_settings_panel`,icon:"display_settings",toolbars:[new Toolbar(`${l}_controls_toolbar`,{id:`${l}_controls_toolbar`,children:["toggle_pbr",`${l}_correct_lights`,`${l}_show_channel_menu`],name:"PBR"}),new Toolbar(`${l}_display_settings_toolbar`,{id:`${l}_display_settings_toolbar`,children:[`${l}_tonemapping`,`${l}_exposure`],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"paint"}),MenuBar.addAction(L,"file.export"),MenuBar.addAction(k,"tools"),MenuBar.addAction(j,"tools"),MenuBar.addAction(R,"file.export"),MenuBar.addAction(A,"view"),MenuBar.addAction(D,"preview"),Object.entries($).forEach(([n,e],t)=>{MenuBar.addAction(e,`image.${t}`)}),Z()},se=()=>{Object.entries($).forEach(([n,e])=>{e.delete()}),MenuBar.removeAction(`file.export.${l}_create_mer`),MenuBar.removeAction(`file.export.${l}_create_texture_set`),MenuBar.removeAction(`tools.${l}_generate_normal`),ee(),U?.delete(),w?.delete(),H?.delete(),L?.delete(),k?.delete(),A?.delete(),j?.delete(),R?.delete(),O?.delete(),Q?.delete(),S?.delete(),C?.delete(),G?.delete(),D?.delete(),J?.delete(),B?.delete(),deactivatePbr?.delete(),I?.delete(),X?.delete(),z?.delete(),q?.delete()};BBPlugin.register(l,{version:te,title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.1",onload:re,onunload:se})})();})(); diff --git a/src/pbr_preview/src/index.ts b/src/pbr_preview/src/index.ts index 528556de..dea2b480 100644 --- a/src/pbr_preview/src/index.ts +++ b/src/pbr_preview/src/index.ts @@ -693,7 +693,6 @@ interface IChannel { materialParams?: THREE.MeshStandardMaterialParameters, ) => { // Don't overwrite placeholder material in Edit and Paint mode - (Texture.all.length === 0 && Modes.id !== `${PLUGIN_ID}_mode`) if (!Project || Texture.all.length === 0) { return; } @@ -1261,7 +1260,7 @@ interface IChannel { description: "Toggle PBR Preview", icon: "panorama_photosphere", category: "view", - condition: () => (Project && Project.textures.length > 0) === true, + // condition: () => (Project && Project.textures.length > 0) === true, linked_setting: "pbr_active", default: false, click() {}, From 18fc13e2f77fe3aaea173c7013a6f0658a0e7647 Mon Sep 17 00:00:00 2001 From: Jason Gardner Date: Sun, 26 May 2024 14:02:05 -0500 Subject: [PATCH 03/50] fix: Disable conditions for MER export --- plugins/pbr_preview/pbr_preview.js | 2 +- src/pbr_preview/src/index.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index aedd278f..33bec9d9 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1 +1 @@ -"use strict";(()=>{(()=>{let j,R,L,k,I,A,H,U,w,O,F,Q,C,G,D,S,J,B,z,X,q,$={},l="pbr_preview",te="1.0.0",V="_NONE_",c={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality"},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6"},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight"},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain"},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape"},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks"},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode"}},P=(n=!0)=>{let e=Project?Project.textures??Texture.all:Texture.all;return n?e.filter(t=>t.layers.length>0).flatMap(t=>t.layers):e};class p{constructor(e,t){this._scope=e??P(),this._materialUuid=t}merToCanvas(){let e=this.getTexture(c.emissive),t=this.getTexture(c.roughness),a=this.getTexture(c.metalness);if(!e&&!t&&!a){let{metalness:r,emissive:i,roughness:o}=this.decodeMer();r&&(a=p.makePixelatedCanvas(r)),i&&(e=p.makePixelatedCanvas(i)),o&&(t=p.makePixelatedCanvas(o))}return{emissiveMap:e,roughnessMap:t,metalnessMap:a}}getMaterial(e={}){let{emissiveMap:t,roughnessMap:a,metalnessMap:r}=this.merToCanvas();return new THREE.MeshStandardMaterial({map:this.getTexture(c.albedo)??p.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(i=>i.selected)?.canvas??Texture.all[0].canvas),aoMap:this.getTexture(c.ao),normalMap:this.getTexture(c.normal),bumpMap:this.getTexture(c.height),metalnessMap:r,roughnessMap:a,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:1,alphaTest:.5,...e})}saveTexture(e,{uuid:t,extend:a}){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][e.id]=t,a({channel:e.id}))}findTexture(e,t=!0){if(!Project)return null;let a=this._scope.find(s=>s.channel&&(s.channel===e||s.channel===e.id));if(a)return a;let r=typeof e=="string"?e:e.id;Project.pbr_materials??={};let i=Project.pbr_materials[this._materialUuid];if(!i&&t){let s=new RegExp(`_*${r}(.[^.]+)?$`,"i");return this._scope.find(d=>s.test(d.name))??null}let o=i?.[r];return o?this._scope.find(s=>s.uuid===o)??null:null}static makePixelatedCanvas(e){let t=new THREE.CanvasTexture(e,void 0,void 0,void 0,THREE.NearestFilter,THREE.NearestFilter);return t.needsUpdate=!0,t}getTexture(e){let t=this.findTexture(e);return t?p.makePixelatedCanvas(t.canvas):null}static extractChannel(e,t){let a=e.canvas,r=a.width,i=a.height,o=a.getContext("2d");if(!o||!r||!i)return null;let s=document.createElement("canvas");s.width=r,s.height=i;let d=s.getContext("2d");if(!d)return null;let m={r:0,g:1,b:2,a:3}[t],{data:f}=o.getImageData(0,0,r,i),x=new Uint8ClampedArray(r*i*4);for(let h=0;he){_[g]=v.data[g],_[g+1]=v.data[g+1],_[g+2]=v.data[g+2],_[g+3]=255;continue}_[g]=0,_[g+1]=0,_[g+2]=0,_[g+3]=255}return m.putImageData(new ImageData(_,s.width,s.height),0,0),{metalness:a,emissive:s,emissiveLevel:r,roughness:i,sss:o}}createMer(e=!1){let t=this.findTexture(c.metalness,e),a=this.findTexture(c.emissive,e),r=this.findTexture(c.roughness,e),i=this.findTexture("sss",!1),o=Math.max(t?.img.width??0,a?.img.width??0,r?.img.width??0,Project?Project.texture_width:0,16),s=Math.max(t?.img.height??0,a?.img.height??0,r?.img.height??0,Project?Project.texture_height:0,16),d=document.createElement("canvas");d.width=o,d.height=s;let m=d.getContext("2d");if(!m)return null;let f=t?.img?p.extractChannel(t,"r"):null,x=a?.img?p.extractChannel(a,"g"):null,v=r?.img?p.extractChannel(r,"b"):null,h=i&&i?.img?p.extractChannel(i,"a"):null,_=f?.getContext("2d")?.getImageData(0,0,o,s)??new ImageData(o,s),g=x?.getContext("2d")?.getImageData(0,0,o,s)??new ImageData(o,s),u=v?.getContext("2d")?.getImageData(0,0,o,s)??new ImageData(o,s),b=h?.getContext("2d")?.getImageData(0,0,o,s)??new ImageData(new Uint8ClampedArray(o*s*4).fill(255),o,s),M=new Uint8ClampedArray(o*s*4);for(let T=0;T{let M=(u+b*r)*4;return o[M]/255};s.width=r,s.height=i,d.drawImage(e.img,0,0,r,i);let f=d.getImageData(0,0,r,i),x=f.data,v=u=>{let b=Math.sqrt(u[0]*u[0]+u[1]*u[1]+u[2]*u[2]);return[u[0]/b,u[1]/b,u[2]/b]};for(let u=0;uc[n].id),label:"PBR Channel",exposed:!1}),z=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),X=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),q=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"});let K=n=>{let e=Texture.all.find(a=>a.selected);if(!e)return;let t=new p(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!1);t&&t.toBlob(async a=>{if(!a)return;let[r,i]=Project?[`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await a.arrayBuffer(),type:"PNG",name:r,extensions:["png"],resource_id:"mer",savetype:"image",startpath:i},n)})},y=n=>{if(!Project||Texture.all.length===0)return;let e=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(a=>{let i=t.faces[a].getTexture();if(!i)return;let o=Project.materials[i.uuid];o.isShaderMaterial&&!Project.bb_materials[i.uuid]&&(Project.bb_materials[i.uuid]=o);let s=new p(i.layers_enabled?i.layers.filter(d=>d.visible)??null:Project.textures,i.uuid).getMaterial(n);Project.materials[i.uuid]=THREE.ShaderMaterial.prototype.copy.call(s,o),Canvas.updateAllFaces(i),e=!0})}),Project.pbr_active=e},ne=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(n=>{n instanceof Cube&&Object.keys(n.faces).forEach(e=>{let a=n.faces[e].getTexture();if(!a)return;let r=Project.bb_materials[a.uuid];r&&(Project.materials[a.uuid]=r)})}),Project.pbr_active=!1,Canvas.updateAll())},ae=()=>{if(!Project)return;let n=P();Project.textures.forEach(e=>{let t=new p(n,e.uuid),a=t.findTexture(c.normal,!1)?.name,r=t.findTexture(c.height,!1)?.name,i=t.findTexture(c.albedo,!1)?.name,o=t.findTexture(c.metalness,!1)?.name,s=t.findTexture(c.emissive,!1)?.name,d=t.findTexture(c.roughness,!1)?.name,m={};return i||(m.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!s&&!d&&(m.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},m.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},m.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),a&&r&&(m.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),w=new Dialog(`${l}_texture_set`,{id:`${l}_texture_set`,title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:m,onConfirm(f){let x=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),v=o||s||d,h={format_version:"1.16.200","minecraft:texture_set":{color:(i?pathToName(i,!1):f.baseColor?.toHexString())??x,metalness_emissive_roughness:[f.metalness??0,f.emissive??0,f.roughness??255]}};f.depthMap==="normal"&&a?h["minecraft:texture_set"].normal=pathToName(a,!1):(!a||f.depthMap==="heightmap")&&r&&(h["minecraft:texture_set"].heightmap=pathToName(r,!1));let _=()=>Blockbench.export({content:JSON.stringify(h,null,2),type:"JSON",name:`${x}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path},()=>{Blockbench.showQuickMessage("Texture set created",2e3),w.hide()});if(v){K(g=>{h["minecraft:texture_set"].metalness_emissive_roughness=pathToName(g,!1),_()});return}_()},cancelIndex:1}),w.show(),w})},W=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],Y=()=>Project&&Project.pbr_active&&y(),Z=()=>{W.forEach(n=>{Blockbench.addListener(n,Y)})},ee=()=>{W.forEach(n=>{Blockbench.removeListener(n,Y)})},re=()=>{H=new Setting("pbr_active",{category:"preview",name:"Enable PBR Preview",description:"Enables PBR preview in the editor",type:"toggle",default_value:!1,icon:"tonality",launch_setting:!0,onChange(n){if(n){y(),Z();return}ne(),ee()}}),J=new Setting("display_settings_correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview for PBR materials",type:"toggle",default_value:!1,icon:"light_mode",condition:()=>!!Project,onChange(n){Preview.selected.renderer.physicallyCorrectLights=n,y()}}),B=new Setting("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:THREE.NoToneMapping,value:THREE.NoToneMapping,icon:"palette",options:{[THREE.NoToneMapping]:"None",[THREE.LinearToneMapping]:"Linear",[THREE.ReinhardToneMapping]:"Reinhard",[THREE.CineonToneMapping]:"Cineon",[THREE.ACESFilmicToneMapping]:"ACES"},onChange(n){Preview.selected.renderer.toneMapping=Number(n),y()}}),S=new Setting("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",default_value:1,icon:"exposure",step:.1,min:-2,max:2,onChange(n){Preview.selected.renderer.toneMappingExposure=Math.max(-2,Math.min(2,Number(n)))}}),k=new Action(`${l}_generate_normal`,{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(n=>n.selected))!==void 0,click(){let n=TextureLayer.selected??Texture.all.find(r=>r.selected),e=new p(P(),n.uuid),t=TextureLayer.selected??Texture.all.find(r=>r.selected)??e.findTexture(c.height,!0);if(!t){Blockbench.showQuickMessage("No height map found",2e3);return}let a=p.createNormalMap(t);if(a){e.saveTexture(c.normal,a),a.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),L=new Action(`${l}_create_mer`,{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:()=>Format.id=="bedrock",click(){K()}}),j=new Action(`${l}_decode_mer`,{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",condition:()=>Format.id=="bedrock",click(){let n=P(),e=TextureLayer.selected?.texture??Texture.all.find(i=>i.selected),t=new p(n,(e??n[0]).uuid),a=t.decodeMer();[c.metalness,c.emissive,c.roughness].forEach(i=>{let o=i.id,s=a[o];if(!s)return;let d=new TextureLayer({name:`${e?.name}_${o}`,data_url:s.toDataURL()},e.layers_enabled?e.texture:e);t.saveTexture(i,d)})}}),R=new Action(`${l}_create_texture_set`,{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",condition:()=>Format.id=="bedrock",click(){ae()}}),Object.entries(c).forEach(([n,e])=>{$[n]=new Action(`${l}_assign_channel_${n}`,{icon:e.icon??"tv_options_edit_channels",name:`Assign to ${e.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${e.label} channel`,category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(t){let a=TextureLayer.selected;if(!a||!Project)return;Undo.initEdit({layers:[a]}),a.extend({channel:n});let r=a.texture;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([i,o])=>{o===a.uuid&&delete Project.pbr_materials[r.uuid][i]}),Project.pbr_materials[r.uuid][n]=a.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${a.name}" to ${e.label} channel`,2e3),y()}})}),I=new Action(`${l}_unassign_channel`,{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",click(){let n=TextureLayer.selected;if(!n||!Project)return;Undo.initEdit({layers:[n]});let{texture:e,channel:t}=n;e.updateChangesAfterEdit(),Project.pbr_materials[e.uuid]={},n.channel=V,Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${n.name}" from ${t} channel`,2e3),y()}}),A=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",linked_setting:"pbr_active",default:!1,click(){},onChange(n){Blockbench.showQuickMessage(`PBR Preview is now ${n?"enabled":"disabled"}`,2e3)}}),D=new Toggle(`${l}_correct_lights`,{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",linked_setting:"display_settings_correct_lights",default:!1,onChange(n){Blockbench.showQuickMessage(`Physically corrected lighting is now ${n?"enabled":"disabled"}`,2e3)},click(){}}),C=new BarSlider(`${l}_exposure`,{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",icon:"exposure",min:-2,max:2,step:.1,value:Settings.get("display_settings_exposure")??1,display_condition:{modes:["edit","paint","animate"],project:!0},onChange({value:n}){S.set(n)}}),C.addLabel(!0,C),F=new Menu(`${l}_channel_menu`,[...Object.keys(c).map(n=>`${l}_assign_channel_${n}`),`${l}_unassign_channel`],{onOpen(){y()}}),Q=new Action(`${l}_show_channel_menu`,{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(n){F.open(n)}}),G=new BarSelect(`${l}_tonemapping`,{category:"preview",name:"Tone Mapping",description:"Select the tone mapping function",icon:"palette",value:THREE.NoToneMapping,linked_setting:"display_settings_tone_mapping",options:{[THREE.NoToneMapping]:{name:"No Tone Mapping",icon:"invert_colors_off"},[THREE.LinearToneMapping]:{name:"Linear",icon:"linear_scale"},[THREE.ReinhardToneMapping]:{name:"Reinhard",icon:"brightness_medium"},[THREE.CineonToneMapping]:{name:"Cineon",icon:"brightness_high"},[THREE.ACESFilmicToneMapping]:{name:"ACES",icon:"brightness_auto"}},onChange({value:n}){B.set(n),y()}}),U=new Panel(`${l}_display_settings`,{name:"PBR Settings",id:`${l}_display_settings_panel`,icon:"display_settings",toolbars:[new Toolbar(`${l}_controls_toolbar`,{id:`${l}_controls_toolbar`,children:["toggle_pbr",`${l}_correct_lights`,`${l}_show_channel_menu`],name:"PBR"}),new Toolbar(`${l}_display_settings_toolbar`,{id:`${l}_display_settings_toolbar`,children:[`${l}_tonemapping`,`${l}_exposure`],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"paint"}),MenuBar.addAction(L,"file.export"),MenuBar.addAction(k,"tools"),MenuBar.addAction(j,"tools"),MenuBar.addAction(R,"file.export"),MenuBar.addAction(A,"view"),MenuBar.addAction(D,"preview"),Object.entries($).forEach(([n,e],t)=>{MenuBar.addAction(e,`image.${t}`)}),Z()},se=()=>{Object.entries($).forEach(([n,e])=>{e.delete()}),MenuBar.removeAction(`file.export.${l}_create_mer`),MenuBar.removeAction(`file.export.${l}_create_texture_set`),MenuBar.removeAction(`tools.${l}_generate_normal`),ee(),U?.delete(),w?.delete(),H?.delete(),L?.delete(),k?.delete(),A?.delete(),j?.delete(),R?.delete(),O?.delete(),Q?.delete(),S?.delete(),C?.delete(),G?.delete(),D?.delete(),J?.delete(),B?.delete(),deactivatePbr?.delete(),I?.delete(),X?.delete(),z?.delete(),q?.delete()};BBPlugin.register(l,{version:te,title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.1",onload:re,onunload:se})})();})(); +"use strict";(()=>{(()=>{let j,R,L,A,I,D,H,U,w,O,F,Q,C,G,k,S,J,B,z,X,q,$={},l="pbr_preview",te="1.0.0",V="_NONE_",c={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality"},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6"},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight"},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain"},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape"},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks"},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode"}},P=(n=!0)=>{let e=Project?Project.textures??Texture.all:Texture.all;return n?e.filter(t=>t.layers.length>0).flatMap(t=>t.layers):e};class p{constructor(e,t){this._scope=e??P(),this._materialUuid=t}merToCanvas(){let e=this.getTexture(c.emissive),t=this.getTexture(c.roughness),a=this.getTexture(c.metalness);if(!e&&!t&&!a){let{metalness:s,emissive:i,roughness:o}=this.decodeMer();s&&(a=p.makePixelatedCanvas(s)),i&&(e=p.makePixelatedCanvas(i)),o&&(t=p.makePixelatedCanvas(o))}return{emissiveMap:e,roughnessMap:t,metalnessMap:a}}getMaterial(e={}){let{emissiveMap:t,roughnessMap:a,metalnessMap:s}=this.merToCanvas();return new THREE.MeshStandardMaterial({map:this.getTexture(c.albedo)??p.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(i=>i.selected)?.canvas??Texture.all[0].canvas),aoMap:this.getTexture(c.ao),normalMap:this.getTexture(c.normal),bumpMap:this.getTexture(c.height),metalnessMap:s,roughnessMap:a,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:1,alphaTest:.5,...e})}saveTexture(e,{uuid:t,extend:a}){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][e.id]=t,a({channel:e.id}))}findTexture(e,t=!0){if(!Project)return null;let a=this._scope.find(r=>r.channel&&(r.channel===e||r.channel===e.id));if(a)return a;let s=typeof e=="string"?e:e.id;Project.pbr_materials??={};let i=Project.pbr_materials[this._materialUuid];if(!i&&t){let r=new RegExp(`_*${s}(.[^.]+)?$`,"i");return this._scope.find(d=>r.test(d.name))??null}let o=i?.[s];return o?this._scope.find(r=>r.uuid===o)??null:null}static makePixelatedCanvas(e){let t=new THREE.CanvasTexture(e,void 0,void 0,void 0,THREE.NearestFilter,THREE.NearestFilter);return t.needsUpdate=!0,t}getTexture(e){let t=this.findTexture(e);return t?p.makePixelatedCanvas(t.canvas):null}static extractChannel(e,t){let a=e.canvas,s=a.width,i=a.height,o=a.getContext("2d");if(!o||!s||!i)return null;let r=document.createElement("canvas");r.width=s,r.height=i;let d=r.getContext("2d");if(!d)return null;let m={r:0,g:1,b:2,a:3}[t],{data:f}=o.getImageData(0,0,s,i),x=new Uint8ClampedArray(s*i*4);for(let h=0;he){_[g]=v.data[g],_[g+1]=v.data[g+1],_[g+2]=v.data[g+2],_[g+3]=255;continue}_[g]=0,_[g+1]=0,_[g+2]=0,_[g+3]=255}return m.putImageData(new ImageData(_,r.width,r.height),0,0),{metalness:a,emissive:r,emissiveLevel:s,roughness:i,sss:o}}createMer(e=!1){let t=this.findTexture(c.metalness,e),a=this.findTexture(c.emissive,e),s=this.findTexture(c.roughness,e),i=this.findTexture("sss",!1),o=Math.max(t?.img.width??0,a?.img.width??0,s?.img.width??0,Project?Project.texture_width:0,16),r=Math.max(t?.img.height??0,a?.img.height??0,s?.img.height??0,Project?Project.texture_height:0,16),d=document.createElement("canvas");d.width=o,d.height=r;let m=d.getContext("2d");if(!m)return null;let f=t?.img?p.extractChannel(t,"r"):null,x=a?.img?p.extractChannel(a,"g"):null,v=s?.img?p.extractChannel(s,"b"):null,h=i&&i?.img?p.extractChannel(i,"a"):null,_=f?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),g=x?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),u=v?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),b=h?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(new Uint8ClampedArray(o*r*4).fill(255),o,r),M=new Uint8ClampedArray(o*r*4);for(let T=0;T{let M=(u+b*s)*4;return o[M]/255};r.width=s,r.height=i,d.drawImage(e.img,0,0,s,i);let f=d.getImageData(0,0,s,i),x=f.data,v=u=>{let b=Math.sqrt(u[0]*u[0]+u[1]*u[1]+u[2]*u[2]);return[u[0]/b,u[1]/b,u[2]/b]};for(let u=0;uc[n].id),label:"PBR Channel",exposed:!1}),z=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),X=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),q=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"});let K=n=>{let e=Texture.all.find(a=>a.selected);if(!e)return;let t=new p(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!1);t&&t.toBlob(async a=>{if(!a)return;let[s,i]=Project?[`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await a.arrayBuffer(),type:"PNG",name:s,extensions:["png"],resource_id:"mer",savetype:"image",startpath:i},n)})},y=n=>{if(!Project||Texture.all.length===0)return;let e=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(a=>{let i=t.faces[a].getTexture();if(!i)return;let o=Project.materials[i.uuid];o.isShaderMaterial&&!Project.bb_materials[i.uuid]&&(Project.bb_materials[i.uuid]=o);let r=new p(i.layers_enabled?i.layers.filter(d=>d.visible)??null:Project.textures,i.uuid).getMaterial(n);Project.materials[i.uuid]=THREE.ShaderMaterial.prototype.copy.call(r,o),Canvas.updateAllFaces(i),e=!0})}),Project.pbr_active=e},ne=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(n=>{n instanceof Cube&&Object.keys(n.faces).forEach(e=>{let a=n.faces[e].getTexture();if(!a)return;let s=Project.bb_materials[a.uuid];s&&(Project.materials[a.uuid]=s)})}),Project.pbr_active=!1,Canvas.updateAll())},ae=()=>{if(!Project)return;let n=P();Project.textures.forEach(e=>{let t=new p(n,e.uuid),a=t.findTexture(c.normal,!1)?.name,s=t.findTexture(c.height,!1)?.name,i=t.findTexture(c.albedo,!1)?.name,o=t.findTexture(c.metalness,!1)?.name,r=t.findTexture(c.emissive,!1)?.name,d=t.findTexture(c.roughness,!1)?.name,m={};return i||(m.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!r&&!d&&(m.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},m.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},m.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),a&&s&&(m.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),w=new Dialog(`${l}_texture_set`,{id:`${l}_texture_set`,title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:m,onConfirm(f){let x=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),v=o||r||d,h={format_version:"1.16.200","minecraft:texture_set":{color:(i?pathToName(i,!1):f.baseColor?.toHexString())??x,metalness_emissive_roughness:[f.metalness??0,f.emissive??0,f.roughness??255]}};f.depthMap==="normal"&&a?h["minecraft:texture_set"].normal=pathToName(a,!1):(!a||f.depthMap==="heightmap")&&s&&(h["minecraft:texture_set"].heightmap=pathToName(s,!1));let _=()=>Blockbench.export({content:JSON.stringify(h,null,2),type:"JSON",name:`${x}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path},()=>{Blockbench.showQuickMessage("Texture set created",2e3),w.hide()});if(v){K(g=>{h["minecraft:texture_set"].metalness_emissive_roughness=pathToName(g,!1),_()});return}_()},cancelIndex:1}),w.show(),w})},W=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],Y=()=>Project&&Project.pbr_active&&y(),Z=()=>{W.forEach(n=>{Blockbench.addListener(n,Y)})},ee=()=>{W.forEach(n=>{Blockbench.removeListener(n,Y)})},se=()=>{H=new Setting("pbr_active",{category:"preview",name:"Enable PBR Preview",description:"Enables PBR preview in the editor",type:"toggle",default_value:!1,icon:"tonality",launch_setting:!0,onChange(n){if(n){y(),Z();return}ne(),ee()}}),J=new Setting("display_settings_correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview for PBR materials",type:"toggle",default_value:!1,icon:"light_mode",condition:()=>!!Project,onChange(n){Preview.selected.renderer.physicallyCorrectLights=n,y()}}),B=new Setting("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:THREE.NoToneMapping,value:THREE.NoToneMapping,icon:"palette",options:{[THREE.NoToneMapping]:"None",[THREE.LinearToneMapping]:"Linear",[THREE.ReinhardToneMapping]:"Reinhard",[THREE.CineonToneMapping]:"Cineon",[THREE.ACESFilmicToneMapping]:"ACES"},onChange(n){Preview.selected.renderer.toneMapping=Number(n),y()}}),S=new Setting("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",default_value:1,icon:"exposure",step:.1,min:-2,max:2,onChange(n){Preview.selected.renderer.toneMappingExposure=Math.max(-2,Math.min(2,Number(n)))}}),A=new Action(`${l}_generate_normal`,{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(n=>n.selected))!==void 0,click(){let n=TextureLayer.selected??Texture.all.find(s=>s.selected),e=new p(P(),n.uuid),t=TextureLayer.selected??Texture.all.find(s=>s.selected)??e.findTexture(c.height,!0);if(!t){Blockbench.showQuickMessage("No height map found",2e3);return}let a=p.createNormalMap(t);if(a){e.saveTexture(c.normal,a),a.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),L=new Action(`${l}_create_mer`,{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",click(){K()}}),j=new Action(`${l}_decode_mer`,{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",click(){let n=P(),e=TextureLayer.selected?.texture??Texture.all.find(i=>i.selected),t=new p(n,(e??n[0]).uuid),a=t.decodeMer();[c.metalness,c.emissive,c.roughness].forEach(i=>{let o=i.id,r=a[o];if(!r)return;let d=new TextureLayer({name:`${e?.name}_${o}`,data_url:r.toDataURL()},e.layers_enabled?e.texture:e);t.saveTexture(i,d)})}}),R=new Action(`${l}_create_texture_set`,{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){ae()}}),Object.entries(c).forEach(([n,e])=>{$[n]=new Action(`${l}_assign_channel_${n}`,{icon:e.icon??"tv_options_edit_channels",name:`Assign to ${e.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${e.label} channel`,category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(t){let a=TextureLayer.selected;if(!a||!Project)return;Undo.initEdit({layers:[a]}),a.extend({channel:n});let s=a.texture;s.updateChangesAfterEdit(),Project.pbr_materials[s.uuid]||(Project.pbr_materials[s.uuid]={}),Object.entries(Project.pbr_materials[s.uuid]).forEach(([i,o])=>{o===a.uuid&&delete Project.pbr_materials[s.uuid][i]}),Project.pbr_materials[s.uuid][n]=a.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${a.name}" to ${e.label} channel`,2e3),y()}})}),I=new Action(`${l}_unassign_channel`,{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",click(){let n=TextureLayer.selected;if(!n||!Project)return;Undo.initEdit({layers:[n]});let{texture:e,channel:t}=n;e.updateChangesAfterEdit(),Project.pbr_materials[e.uuid]={},n.channel=V,Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${n.name}" from ${t} channel`,2e3),y()}}),D=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",linked_setting:"pbr_active",default:!1,click(){},onChange(n){Blockbench.showQuickMessage(`PBR Preview is now ${n?"enabled":"disabled"}`,2e3)}}),k=new Toggle(`${l}_correct_lights`,{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",linked_setting:"display_settings_correct_lights",default:!1,onChange(n){Blockbench.showQuickMessage(`Physically corrected lighting is now ${n?"enabled":"disabled"}`,2e3)},click(){}}),C=new BarSlider(`${l}_exposure`,{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",icon:"exposure",min:-2,max:2,step:.1,value:Settings.get("display_settings_exposure")??1,display_condition:{modes:["edit","paint","animate"],project:!0},onChange({value:n}){S.set(n)}}),C.addLabel(!0,C),F=new Menu(`${l}_channel_menu`,[...Object.keys(c).map(n=>`${l}_assign_channel_${n}`),`${l}_unassign_channel`],{onOpen(){y()}}),Q=new Action(`${l}_show_channel_menu`,{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(n){F.open(n)}}),G=new BarSelect(`${l}_tonemapping`,{category:"preview",name:"Tone Mapping",description:"Select the tone mapping function",icon:"palette",value:THREE.NoToneMapping,linked_setting:"display_settings_tone_mapping",options:{[THREE.NoToneMapping]:{name:"No Tone Mapping",icon:"invert_colors_off"},[THREE.LinearToneMapping]:{name:"Linear",icon:"linear_scale"},[THREE.ReinhardToneMapping]:{name:"Reinhard",icon:"brightness_medium"},[THREE.CineonToneMapping]:{name:"Cineon",icon:"brightness_high"},[THREE.ACESFilmicToneMapping]:{name:"ACES",icon:"brightness_auto"}},onChange({value:n}){B.set(n),y()}}),U=new Panel(`${l}_display_settings`,{name:"PBR Settings",id:`${l}_display_settings_panel`,icon:"display_settings",toolbars:[new Toolbar(`${l}_controls_toolbar`,{id:`${l}_controls_toolbar`,children:["toggle_pbr",`${l}_correct_lights`,`${l}_show_channel_menu`],name:"PBR"}),new Toolbar(`${l}_display_settings_toolbar`,{id:`${l}_display_settings_toolbar`,children:[`${l}_tonemapping`,`${l}_exposure`],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"paint"}),MenuBar.addAction(L,"file.export"),MenuBar.addAction(A,"tools"),MenuBar.addAction(j,"tools"),MenuBar.addAction(R,"file.export"),MenuBar.addAction(D,"view"),MenuBar.addAction(k,"preview"),Object.entries($).forEach(([n,e],t)=>{MenuBar.addAction(e,`image.${t}`)}),Z()},re=()=>{Object.entries($).forEach(([n,e])=>{e.delete()}),MenuBar.removeAction(`file.export.${l}_create_mer`),MenuBar.removeAction(`file.export.${l}_create_texture_set`),MenuBar.removeAction(`tools.${l}_generate_normal`),ee(),U?.delete(),w?.delete(),H?.delete(),L?.delete(),A?.delete(),D?.delete(),j?.delete(),R?.delete(),O?.delete(),Q?.delete(),S?.delete(),C?.delete(),G?.delete(),k?.delete(),J?.delete(),B?.delete(),deactivatePbr?.delete(),I?.delete(),X?.delete(),z?.delete(),q?.delete()};BBPlugin.register(l,{version:te,title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.1",onload:se,onunload:re})})();})(); diff --git a/src/pbr_preview/src/index.ts b/src/pbr_preview/src/index.ts index dea2b480..517e1f8c 100644 --- a/src/pbr_preview/src/index.ts +++ b/src/pbr_preview/src/index.ts @@ -1113,7 +1113,7 @@ interface IChannel { name: "Export MER", description: "Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)", - condition: () => Format.id == "bedrock", + // condition: () => Format.id == "bedrock", click() { exportMer(); }, @@ -1124,7 +1124,7 @@ interface IChannel { name: "Decode MER", description: "Decodes a MER texture map into metalness, emissive, and roughness channels", - condition: () => Format.id == "bedrock", + // condition: () => Format.id == "bedrock", click() { const projectTextures = getProjectTextures(); const selected = @@ -1168,7 +1168,7 @@ interface IChannel { icon: "layers", description: "Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.", - condition: () => Format.id == "bedrock", + // condition: () => Format.id == "bedrock", click() { createTextureSetDialog(); }, From 390e80bb0633fca144eb59bea5f2d2f6896dc2f0 Mon Sep 17 00:00:00 2001 From: Jason Gardner Date: Sun, 26 May 2024 14:44:07 -0500 Subject: [PATCH 04/50] fix: Change texture set format version --- plugins/pbr_preview/pbr_preview.js | 2 +- src/pbr_preview/src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index 33bec9d9..d9f33697 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1 +1 @@ -"use strict";(()=>{(()=>{let j,R,L,A,I,D,H,U,w,O,F,Q,C,G,k,S,J,B,z,X,q,$={},l="pbr_preview",te="1.0.0",V="_NONE_",c={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality"},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6"},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight"},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain"},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape"},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks"},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode"}},P=(n=!0)=>{let e=Project?Project.textures??Texture.all:Texture.all;return n?e.filter(t=>t.layers.length>0).flatMap(t=>t.layers):e};class p{constructor(e,t){this._scope=e??P(),this._materialUuid=t}merToCanvas(){let e=this.getTexture(c.emissive),t=this.getTexture(c.roughness),a=this.getTexture(c.metalness);if(!e&&!t&&!a){let{metalness:s,emissive:i,roughness:o}=this.decodeMer();s&&(a=p.makePixelatedCanvas(s)),i&&(e=p.makePixelatedCanvas(i)),o&&(t=p.makePixelatedCanvas(o))}return{emissiveMap:e,roughnessMap:t,metalnessMap:a}}getMaterial(e={}){let{emissiveMap:t,roughnessMap:a,metalnessMap:s}=this.merToCanvas();return new THREE.MeshStandardMaterial({map:this.getTexture(c.albedo)??p.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(i=>i.selected)?.canvas??Texture.all[0].canvas),aoMap:this.getTexture(c.ao),normalMap:this.getTexture(c.normal),bumpMap:this.getTexture(c.height),metalnessMap:s,roughnessMap:a,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:1,alphaTest:.5,...e})}saveTexture(e,{uuid:t,extend:a}){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][e.id]=t,a({channel:e.id}))}findTexture(e,t=!0){if(!Project)return null;let a=this._scope.find(r=>r.channel&&(r.channel===e||r.channel===e.id));if(a)return a;let s=typeof e=="string"?e:e.id;Project.pbr_materials??={};let i=Project.pbr_materials[this._materialUuid];if(!i&&t){let r=new RegExp(`_*${s}(.[^.]+)?$`,"i");return this._scope.find(d=>r.test(d.name))??null}let o=i?.[s];return o?this._scope.find(r=>r.uuid===o)??null:null}static makePixelatedCanvas(e){let t=new THREE.CanvasTexture(e,void 0,void 0,void 0,THREE.NearestFilter,THREE.NearestFilter);return t.needsUpdate=!0,t}getTexture(e){let t=this.findTexture(e);return t?p.makePixelatedCanvas(t.canvas):null}static extractChannel(e,t){let a=e.canvas,s=a.width,i=a.height,o=a.getContext("2d");if(!o||!s||!i)return null;let r=document.createElement("canvas");r.width=s,r.height=i;let d=r.getContext("2d");if(!d)return null;let m={r:0,g:1,b:2,a:3}[t],{data:f}=o.getImageData(0,0,s,i),x=new Uint8ClampedArray(s*i*4);for(let h=0;he){_[g]=v.data[g],_[g+1]=v.data[g+1],_[g+2]=v.data[g+2],_[g+3]=255;continue}_[g]=0,_[g+1]=0,_[g+2]=0,_[g+3]=255}return m.putImageData(new ImageData(_,r.width,r.height),0,0),{metalness:a,emissive:r,emissiveLevel:s,roughness:i,sss:o}}createMer(e=!1){let t=this.findTexture(c.metalness,e),a=this.findTexture(c.emissive,e),s=this.findTexture(c.roughness,e),i=this.findTexture("sss",!1),o=Math.max(t?.img.width??0,a?.img.width??0,s?.img.width??0,Project?Project.texture_width:0,16),r=Math.max(t?.img.height??0,a?.img.height??0,s?.img.height??0,Project?Project.texture_height:0,16),d=document.createElement("canvas");d.width=o,d.height=r;let m=d.getContext("2d");if(!m)return null;let f=t?.img?p.extractChannel(t,"r"):null,x=a?.img?p.extractChannel(a,"g"):null,v=s?.img?p.extractChannel(s,"b"):null,h=i&&i?.img?p.extractChannel(i,"a"):null,_=f?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),g=x?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),u=v?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),b=h?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(new Uint8ClampedArray(o*r*4).fill(255),o,r),M=new Uint8ClampedArray(o*r*4);for(let T=0;T{let M=(u+b*s)*4;return o[M]/255};r.width=s,r.height=i,d.drawImage(e.img,0,0,s,i);let f=d.getImageData(0,0,s,i),x=f.data,v=u=>{let b=Math.sqrt(u[0]*u[0]+u[1]*u[1]+u[2]*u[2]);return[u[0]/b,u[1]/b,u[2]/b]};for(let u=0;uc[n].id),label:"PBR Channel",exposed:!1}),z=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),X=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),q=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"});let K=n=>{let e=Texture.all.find(a=>a.selected);if(!e)return;let t=new p(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!1);t&&t.toBlob(async a=>{if(!a)return;let[s,i]=Project?[`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await a.arrayBuffer(),type:"PNG",name:s,extensions:["png"],resource_id:"mer",savetype:"image",startpath:i},n)})},y=n=>{if(!Project||Texture.all.length===0)return;let e=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(a=>{let i=t.faces[a].getTexture();if(!i)return;let o=Project.materials[i.uuid];o.isShaderMaterial&&!Project.bb_materials[i.uuid]&&(Project.bb_materials[i.uuid]=o);let r=new p(i.layers_enabled?i.layers.filter(d=>d.visible)??null:Project.textures,i.uuid).getMaterial(n);Project.materials[i.uuid]=THREE.ShaderMaterial.prototype.copy.call(r,o),Canvas.updateAllFaces(i),e=!0})}),Project.pbr_active=e},ne=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(n=>{n instanceof Cube&&Object.keys(n.faces).forEach(e=>{let a=n.faces[e].getTexture();if(!a)return;let s=Project.bb_materials[a.uuid];s&&(Project.materials[a.uuid]=s)})}),Project.pbr_active=!1,Canvas.updateAll())},ae=()=>{if(!Project)return;let n=P();Project.textures.forEach(e=>{let t=new p(n,e.uuid),a=t.findTexture(c.normal,!1)?.name,s=t.findTexture(c.height,!1)?.name,i=t.findTexture(c.albedo,!1)?.name,o=t.findTexture(c.metalness,!1)?.name,r=t.findTexture(c.emissive,!1)?.name,d=t.findTexture(c.roughness,!1)?.name,m={};return i||(m.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!r&&!d&&(m.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},m.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},m.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),a&&s&&(m.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),w=new Dialog(`${l}_texture_set`,{id:`${l}_texture_set`,title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:m,onConfirm(f){let x=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),v=o||r||d,h={format_version:"1.16.200","minecraft:texture_set":{color:(i?pathToName(i,!1):f.baseColor?.toHexString())??x,metalness_emissive_roughness:[f.metalness??0,f.emissive??0,f.roughness??255]}};f.depthMap==="normal"&&a?h["minecraft:texture_set"].normal=pathToName(a,!1):(!a||f.depthMap==="heightmap")&&s&&(h["minecraft:texture_set"].heightmap=pathToName(s,!1));let _=()=>Blockbench.export({content:JSON.stringify(h,null,2),type:"JSON",name:`${x}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path},()=>{Blockbench.showQuickMessage("Texture set created",2e3),w.hide()});if(v){K(g=>{h["minecraft:texture_set"].metalness_emissive_roughness=pathToName(g,!1),_()});return}_()},cancelIndex:1}),w.show(),w})},W=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],Y=()=>Project&&Project.pbr_active&&y(),Z=()=>{W.forEach(n=>{Blockbench.addListener(n,Y)})},ee=()=>{W.forEach(n=>{Blockbench.removeListener(n,Y)})},se=()=>{H=new Setting("pbr_active",{category:"preview",name:"Enable PBR Preview",description:"Enables PBR preview in the editor",type:"toggle",default_value:!1,icon:"tonality",launch_setting:!0,onChange(n){if(n){y(),Z();return}ne(),ee()}}),J=new Setting("display_settings_correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview for PBR materials",type:"toggle",default_value:!1,icon:"light_mode",condition:()=>!!Project,onChange(n){Preview.selected.renderer.physicallyCorrectLights=n,y()}}),B=new Setting("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:THREE.NoToneMapping,value:THREE.NoToneMapping,icon:"palette",options:{[THREE.NoToneMapping]:"None",[THREE.LinearToneMapping]:"Linear",[THREE.ReinhardToneMapping]:"Reinhard",[THREE.CineonToneMapping]:"Cineon",[THREE.ACESFilmicToneMapping]:"ACES"},onChange(n){Preview.selected.renderer.toneMapping=Number(n),y()}}),S=new Setting("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",default_value:1,icon:"exposure",step:.1,min:-2,max:2,onChange(n){Preview.selected.renderer.toneMappingExposure=Math.max(-2,Math.min(2,Number(n)))}}),A=new Action(`${l}_generate_normal`,{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(n=>n.selected))!==void 0,click(){let n=TextureLayer.selected??Texture.all.find(s=>s.selected),e=new p(P(),n.uuid),t=TextureLayer.selected??Texture.all.find(s=>s.selected)??e.findTexture(c.height,!0);if(!t){Blockbench.showQuickMessage("No height map found",2e3);return}let a=p.createNormalMap(t);if(a){e.saveTexture(c.normal,a),a.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),L=new Action(`${l}_create_mer`,{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",click(){K()}}),j=new Action(`${l}_decode_mer`,{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",click(){let n=P(),e=TextureLayer.selected?.texture??Texture.all.find(i=>i.selected),t=new p(n,(e??n[0]).uuid),a=t.decodeMer();[c.metalness,c.emissive,c.roughness].forEach(i=>{let o=i.id,r=a[o];if(!r)return;let d=new TextureLayer({name:`${e?.name}_${o}`,data_url:r.toDataURL()},e.layers_enabled?e.texture:e);t.saveTexture(i,d)})}}),R=new Action(`${l}_create_texture_set`,{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){ae()}}),Object.entries(c).forEach(([n,e])=>{$[n]=new Action(`${l}_assign_channel_${n}`,{icon:e.icon??"tv_options_edit_channels",name:`Assign to ${e.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${e.label} channel`,category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(t){let a=TextureLayer.selected;if(!a||!Project)return;Undo.initEdit({layers:[a]}),a.extend({channel:n});let s=a.texture;s.updateChangesAfterEdit(),Project.pbr_materials[s.uuid]||(Project.pbr_materials[s.uuid]={}),Object.entries(Project.pbr_materials[s.uuid]).forEach(([i,o])=>{o===a.uuid&&delete Project.pbr_materials[s.uuid][i]}),Project.pbr_materials[s.uuid][n]=a.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${a.name}" to ${e.label} channel`,2e3),y()}})}),I=new Action(`${l}_unassign_channel`,{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",click(){let n=TextureLayer.selected;if(!n||!Project)return;Undo.initEdit({layers:[n]});let{texture:e,channel:t}=n;e.updateChangesAfterEdit(),Project.pbr_materials[e.uuid]={},n.channel=V,Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${n.name}" from ${t} channel`,2e3),y()}}),D=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",linked_setting:"pbr_active",default:!1,click(){},onChange(n){Blockbench.showQuickMessage(`PBR Preview is now ${n?"enabled":"disabled"}`,2e3)}}),k=new Toggle(`${l}_correct_lights`,{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",linked_setting:"display_settings_correct_lights",default:!1,onChange(n){Blockbench.showQuickMessage(`Physically corrected lighting is now ${n?"enabled":"disabled"}`,2e3)},click(){}}),C=new BarSlider(`${l}_exposure`,{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",icon:"exposure",min:-2,max:2,step:.1,value:Settings.get("display_settings_exposure")??1,display_condition:{modes:["edit","paint","animate"],project:!0},onChange({value:n}){S.set(n)}}),C.addLabel(!0,C),F=new Menu(`${l}_channel_menu`,[...Object.keys(c).map(n=>`${l}_assign_channel_${n}`),`${l}_unassign_channel`],{onOpen(){y()}}),Q=new Action(`${l}_show_channel_menu`,{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(n){F.open(n)}}),G=new BarSelect(`${l}_tonemapping`,{category:"preview",name:"Tone Mapping",description:"Select the tone mapping function",icon:"palette",value:THREE.NoToneMapping,linked_setting:"display_settings_tone_mapping",options:{[THREE.NoToneMapping]:{name:"No Tone Mapping",icon:"invert_colors_off"},[THREE.LinearToneMapping]:{name:"Linear",icon:"linear_scale"},[THREE.ReinhardToneMapping]:{name:"Reinhard",icon:"brightness_medium"},[THREE.CineonToneMapping]:{name:"Cineon",icon:"brightness_high"},[THREE.ACESFilmicToneMapping]:{name:"ACES",icon:"brightness_auto"}},onChange({value:n}){B.set(n),y()}}),U=new Panel(`${l}_display_settings`,{name:"PBR Settings",id:`${l}_display_settings_panel`,icon:"display_settings",toolbars:[new Toolbar(`${l}_controls_toolbar`,{id:`${l}_controls_toolbar`,children:["toggle_pbr",`${l}_correct_lights`,`${l}_show_channel_menu`],name:"PBR"}),new Toolbar(`${l}_display_settings_toolbar`,{id:`${l}_display_settings_toolbar`,children:[`${l}_tonemapping`,`${l}_exposure`],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"paint"}),MenuBar.addAction(L,"file.export"),MenuBar.addAction(A,"tools"),MenuBar.addAction(j,"tools"),MenuBar.addAction(R,"file.export"),MenuBar.addAction(D,"view"),MenuBar.addAction(k,"preview"),Object.entries($).forEach(([n,e],t)=>{MenuBar.addAction(e,`image.${t}`)}),Z()},re=()=>{Object.entries($).forEach(([n,e])=>{e.delete()}),MenuBar.removeAction(`file.export.${l}_create_mer`),MenuBar.removeAction(`file.export.${l}_create_texture_set`),MenuBar.removeAction(`tools.${l}_generate_normal`),ee(),U?.delete(),w?.delete(),H?.delete(),L?.delete(),A?.delete(),D?.delete(),j?.delete(),R?.delete(),O?.delete(),Q?.delete(),S?.delete(),C?.delete(),G?.delete(),k?.delete(),J?.delete(),B?.delete(),deactivatePbr?.delete(),I?.delete(),X?.delete(),z?.delete(),q?.delete()};BBPlugin.register(l,{version:te,title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.1",onload:se,onunload:re})})();})(); +"use strict";(()=>{(()=>{let j,R,L,A,I,D,H,U,w,O,F,Q,C,G,k,S,J,B,z,X,q,$={},l="pbr_preview",te="1.0.0",V="_NONE_",d={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality"},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6"},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight"},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain"},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape"},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks"},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode"}},P=(n=!0)=>{let e=Project?Project.textures??Texture.all:Texture.all;return n?e.filter(t=>t.layers.length>0).flatMap(t=>t.layers):e};class p{constructor(e,t){this._scope=e??P(),this._materialUuid=t}merToCanvas(){let e=this.getTexture(d.emissive),t=this.getTexture(d.roughness),a=this.getTexture(d.metalness);if(!e&&!t&&!a){let{metalness:s,emissive:i,roughness:o}=this.decodeMer();s&&(a=p.makePixelatedCanvas(s)),i&&(e=p.makePixelatedCanvas(i)),o&&(t=p.makePixelatedCanvas(o))}return{emissiveMap:e,roughnessMap:t,metalnessMap:a}}getMaterial(e={}){let{emissiveMap:t,roughnessMap:a,metalnessMap:s}=this.merToCanvas();return new THREE.MeshStandardMaterial({map:this.getTexture(d.albedo)??p.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(i=>i.selected)?.canvas??Texture.all[0].canvas),aoMap:this.getTexture(d.ao),normalMap:this.getTexture(d.normal),bumpMap:this.getTexture(d.height),metalnessMap:s,roughnessMap:a,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:1,alphaTest:.5,...e})}saveTexture(e,{uuid:t,extend:a}){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][e.id]=t,a({channel:e.id}))}findTexture(e,t=!0){if(!Project)return null;let a=this._scope.find(r=>r.channel&&(r.channel===e||r.channel===e.id));if(a)return a;let s=typeof e=="string"?e:e.id;Project.pbr_materials??={};let i=Project.pbr_materials[this._materialUuid];if(!i&&t){let r=new RegExp(`_*${s}(.[^.]+)?$`,"i");return this._scope.find(c=>r.test(c.name))??null}let o=i?.[s];return o?this._scope.find(r=>r.uuid===o)??null:null}static makePixelatedCanvas(e){let t=new THREE.CanvasTexture(e,void 0,void 0,void 0,THREE.NearestFilter,THREE.NearestFilter);return t.needsUpdate=!0,t}getTexture(e){let t=this.findTexture(e);return t?p.makePixelatedCanvas(t.canvas):null}static extractChannel(e,t){let a=e.canvas,s=a.width,i=a.height,o=a.getContext("2d");if(!o||!s||!i)return null;let r=document.createElement("canvas");r.width=s,r.height=i;let c=r.getContext("2d");if(!c)return null;let m={r:0,g:1,b:2,a:3}[t],{data:f}=o.getImageData(0,0,s,i),x=new Uint8ClampedArray(s*i*4);for(let h=0;he){_[g]=v.data[g],_[g+1]=v.data[g+1],_[g+2]=v.data[g+2],_[g+3]=255;continue}_[g]=0,_[g+1]=0,_[g+2]=0,_[g+3]=255}return m.putImageData(new ImageData(_,r.width,r.height),0,0),{metalness:a,emissive:r,emissiveLevel:s,roughness:i,sss:o}}createMer(e=!1){let t=this.findTexture(d.metalness,e),a=this.findTexture(d.emissive,e),s=this.findTexture(d.roughness,e),i=this.findTexture("sss",!1),o=Math.max(t?.img.width??0,a?.img.width??0,s?.img.width??0,Project?Project.texture_width:0,16),r=Math.max(t?.img.height??0,a?.img.height??0,s?.img.height??0,Project?Project.texture_height:0,16),c=document.createElement("canvas");c.width=o,c.height=r;let m=c.getContext("2d");if(!m)return null;let f=t?.img?p.extractChannel(t,"r"):null,x=a?.img?p.extractChannel(a,"g"):null,v=s?.img?p.extractChannel(s,"b"):null,h=i&&i?.img?p.extractChannel(i,"a"):null,_=f?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),g=x?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),u=v?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),b=h?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(new Uint8ClampedArray(o*r*4).fill(255),o,r),M=new Uint8ClampedArray(o*r*4);for(let T=0;T{let M=(u+b*s)*4;return o[M]/255};r.width=s,r.height=i,c.drawImage(e.img,0,0,s,i);let f=c.getImageData(0,0,s,i),x=f.data,v=u=>{let b=Math.sqrt(u[0]*u[0]+u[1]*u[1]+u[2]*u[2]);return[u[0]/b,u[1]/b,u[2]/b]};for(let u=0;ud[n].id),label:"PBR Channel",exposed:!1}),z=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),X=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),q=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"});let K=n=>{let e=Texture.all.find(a=>a.selected);if(!e)return;let t=new p(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!1);t&&t.toBlob(async a=>{if(!a)return;let[s,i]=Project?[`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await a.arrayBuffer(),type:"PNG",name:s,extensions:["png"],resource_id:"mer",savetype:"image",startpath:i},n)})},y=n=>{if(!Project||Texture.all.length===0)return;let e=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(a=>{let i=t.faces[a].getTexture();if(!i)return;let o=Project.materials[i.uuid];o.isShaderMaterial&&!Project.bb_materials[i.uuid]&&(Project.bb_materials[i.uuid]=o);let r=new p(i.layers_enabled?i.layers.filter(c=>c.visible)??null:Project.textures,i.uuid).getMaterial(n);Project.materials[i.uuid]=THREE.ShaderMaterial.prototype.copy.call(r,o),Canvas.updateAllFaces(i),e=!0})}),Project.pbr_active=e},ne=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(n=>{n instanceof Cube&&Object.keys(n.faces).forEach(e=>{let a=n.faces[e].getTexture();if(!a)return;let s=Project.bb_materials[a.uuid];s&&(Project.materials[a.uuid]=s)})}),Project.pbr_active=!1,Canvas.updateAll())},ae=()=>{if(!Project)return;let n=P();Project.textures.forEach(e=>{let t=new p(n,e.uuid),a=t.findTexture(d.normal,!1)?.name,s=t.findTexture(d.height,!1)?.name,i=t.findTexture(d.albedo,!1)?.name,o=t.findTexture(d.metalness,!1)?.name,r=t.findTexture(d.emissive,!1)?.name,c=t.findTexture(d.roughness,!1)?.name,m={};return i||(m.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!r&&!c&&(m.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},m.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},m.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),a&&s&&(m.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),w=new Dialog(`${l}_texture_set`,{id:`${l}_texture_set`,title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:m,onConfirm(f){let x=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),v=o||r||c,h={format_version:"1.16.100","minecraft:texture_set":{color:(i?pathToName(i,!1):f.baseColor?.toHexString())??x,metalness_emissive_roughness:[f.metalness??0,f.emissive??0,f.roughness??255]}};f.depthMap==="normal"&&a?h["minecraft:texture_set"].normal=pathToName(a,!1):(!a||f.depthMap==="heightmap")&&s&&(h["minecraft:texture_set"].heightmap=pathToName(s,!1));let _=()=>Blockbench.export({content:JSON.stringify(h,null,2),type:"JSON",name:`${x}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path},()=>{Blockbench.showQuickMessage("Texture set created",2e3),w.hide()});if(v){K(g=>{h["minecraft:texture_set"].metalness_emissive_roughness=pathToName(g,!1),_()});return}_()},cancelIndex:1}),w.show(),w})},W=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],Y=()=>Project&&Project.pbr_active&&y(),Z=()=>{W.forEach(n=>{Blockbench.addListener(n,Y)})},ee=()=>{W.forEach(n=>{Blockbench.removeListener(n,Y)})},se=()=>{H=new Setting("pbr_active",{category:"preview",name:"Enable PBR Preview",description:"Enables PBR preview in the editor",type:"toggle",default_value:!1,icon:"tonality",launch_setting:!0,onChange(n){if(n){y(),Z();return}ne(),ee()}}),J=new Setting("display_settings_correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview for PBR materials",type:"toggle",default_value:!1,icon:"light_mode",condition:()=>!!Project,onChange(n){Preview.selected.renderer.physicallyCorrectLights=n,y()}}),B=new Setting("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:THREE.NoToneMapping,value:THREE.NoToneMapping,icon:"palette",options:{[THREE.NoToneMapping]:"None",[THREE.LinearToneMapping]:"Linear",[THREE.ReinhardToneMapping]:"Reinhard",[THREE.CineonToneMapping]:"Cineon",[THREE.ACESFilmicToneMapping]:"ACES"},onChange(n){Preview.selected.renderer.toneMapping=Number(n),y()}}),S=new Setting("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",default_value:1,icon:"exposure",step:.1,min:-2,max:2,onChange(n){Preview.selected.renderer.toneMappingExposure=Math.max(-2,Math.min(2,Number(n)))}}),A=new Action(`${l}_generate_normal`,{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(n=>n.selected))!==void 0,click(){let n=TextureLayer.selected??Texture.all.find(s=>s.selected),e=new p(P(),n.uuid),t=TextureLayer.selected??Texture.all.find(s=>s.selected)??e.findTexture(d.height,!0);if(!t){Blockbench.showQuickMessage("No height map found",2e3);return}let a=p.createNormalMap(t);if(a){e.saveTexture(d.normal,a),a.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),L=new Action(`${l}_create_mer`,{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",click(){K()}}),j=new Action(`${l}_decode_mer`,{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",click(){let n=P(),e=TextureLayer.selected?.texture??Texture.all.find(i=>i.selected),t=new p(n,(e??n[0]).uuid),a=t.decodeMer();[d.metalness,d.emissive,d.roughness].forEach((i,o)=>{let r=i.id,c=a[r];if(!c)return;let m=new TextureLayer({name:`${e?.name}_${r}`,data_url:c.toDataURL()},e.layers_enabled?e.texture:e);t.saveTexture(i,m)})}}),R=new Action(`${l}_create_texture_set`,{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){ae()}}),Object.entries(d).forEach(([n,e])=>{$[n]=new Action(`${l}_assign_channel_${n}`,{icon:e.icon??"tv_options_edit_channels",name:`Assign to ${e.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${e.label} channel`,category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(t){let a=TextureLayer.selected;if(!a||!Project)return;Undo.initEdit({layers:[a]}),a.extend({channel:n});let s=a.texture;s.updateChangesAfterEdit(),Project.pbr_materials[s.uuid]||(Project.pbr_materials[s.uuid]={}),Object.entries(Project.pbr_materials[s.uuid]).forEach(([i,o])=>{o===a.uuid&&delete Project.pbr_materials[s.uuid][i]}),Project.pbr_materials[s.uuid][n]=a.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${a.name}" to ${e.label} channel`,2e3),y()}})}),I=new Action(`${l}_unassign_channel`,{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",click(){let n=TextureLayer.selected;if(!n||!Project)return;Undo.initEdit({layers:[n]});let{texture:e,channel:t}=n;e.updateChangesAfterEdit(),Project.pbr_materials[e.uuid]={},n.channel=V,Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${n.name}" from ${t} channel`,2e3),y()}}),D=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",linked_setting:"pbr_active",default:!1,click(){},onChange(n){Blockbench.showQuickMessage(`PBR Preview is now ${n?"enabled":"disabled"}`,2e3)}}),k=new Toggle(`${l}_correct_lights`,{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",linked_setting:"display_settings_correct_lights",default:!1,onChange(n){Blockbench.showQuickMessage(`Physically corrected lighting is now ${n?"enabled":"disabled"}`,2e3)},click(){}}),C=new BarSlider(`${l}_exposure`,{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",icon:"exposure",min:-2,max:2,step:.1,value:Settings.get("display_settings_exposure")??1,display_condition:{modes:["edit","paint","animate"],project:!0},onChange({value:n}){S.set(n)}}),C.addLabel(!0,C),F=new Menu(`${l}_channel_menu`,[...Object.keys(d).map(n=>`${l}_assign_channel_${n}`),`${l}_unassign_channel`],{onOpen(){y()}}),Q=new Action(`${l}_show_channel_menu`,{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(n){F.open(n)}}),G=new BarSelect(`${l}_tonemapping`,{category:"preview",name:"Tone Mapping",description:"Select the tone mapping function",icon:"palette",value:THREE.NoToneMapping,linked_setting:"display_settings_tone_mapping",options:{[THREE.NoToneMapping]:{name:"No Tone Mapping",icon:"invert_colors_off"},[THREE.LinearToneMapping]:{name:"Linear",icon:"linear_scale"},[THREE.ReinhardToneMapping]:{name:"Reinhard",icon:"brightness_medium"},[THREE.CineonToneMapping]:{name:"Cineon",icon:"brightness_high"},[THREE.ACESFilmicToneMapping]:{name:"ACES",icon:"brightness_auto"}},onChange({value:n}){B.set(n),y()}}),U=new Panel(`${l}_display_settings`,{name:"PBR Settings",id:`${l}_display_settings_panel`,icon:"display_settings",toolbars:[new Toolbar(`${l}_controls_toolbar`,{id:`${l}_controls_toolbar`,children:["toggle_pbr",`${l}_correct_lights`,`${l}_show_channel_menu`],name:"PBR"}),new Toolbar(`${l}_display_settings_toolbar`,{id:`${l}_display_settings_toolbar`,children:[`${l}_tonemapping`,`${l}_exposure`],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"paint"}),MenuBar.addAction(L,"file.export"),MenuBar.addAction(A,"tools"),MenuBar.addAction(j,"tools"),MenuBar.addAction(R,"file.export"),MenuBar.addAction(D,"view"),MenuBar.addAction(k,"preview"),Object.entries($).forEach(([n,e],t)=>{MenuBar.addAction(e,`image.${t}`)}),Z()},re=()=>{Object.entries($).forEach(([n,e])=>{e.delete()}),MenuBar.removeAction(`file.export.${l}_create_mer`),MenuBar.removeAction(`file.export.${l}_create_texture_set`),MenuBar.removeAction(`tools.${l}_generate_normal`),ee(),U?.delete(),w?.delete(),H?.delete(),L?.delete(),A?.delete(),D?.delete(),j?.delete(),R?.delete(),O?.delete(),Q?.delete(),S?.delete(),C?.delete(),G?.delete(),k?.delete(),J?.delete(),B?.delete(),deactivatePbr?.delete(),I?.delete(),X?.delete(),z?.delete(),q?.delete()};BBPlugin.register(l,{version:te,title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.1",onload:se,onunload:re})})();})(); diff --git a/src/pbr_preview/src/index.ts b/src/pbr_preview/src/index.ts index 517e1f8c..cf4db190 100644 --- a/src/pbr_preview/src/index.ts +++ b/src/pbr_preview/src/index.ts @@ -878,7 +878,7 @@ interface IChannel { heightmap?: string; }; } = { - format_version: "1.16.200", + format_version: "1.16.100", "minecraft:texture_set": { color: (projectColorMap From 0139629e6a508873ef8a4dca79c3482e5c2f43c8 Mon Sep 17 00:00:00 2001 From: Jason Gardner Date: Sun, 26 May 2024 20:01:15 -0500 Subject: [PATCH 05/50] fix: Add metalness/roughness base values --- plugins/pbr_preview/pbr_preview.js | 2 +- src/pbr_preview/src/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index d9f33697..dff6f004 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1 +1 @@ -"use strict";(()=>{(()=>{let j,R,L,A,I,D,H,U,w,O,F,Q,C,G,k,S,J,B,z,X,q,$={},l="pbr_preview",te="1.0.0",V="_NONE_",d={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality"},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6"},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight"},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain"},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape"},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks"},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode"}},P=(n=!0)=>{let e=Project?Project.textures??Texture.all:Texture.all;return n?e.filter(t=>t.layers.length>0).flatMap(t=>t.layers):e};class p{constructor(e,t){this._scope=e??P(),this._materialUuid=t}merToCanvas(){let e=this.getTexture(d.emissive),t=this.getTexture(d.roughness),a=this.getTexture(d.metalness);if(!e&&!t&&!a){let{metalness:s,emissive:i,roughness:o}=this.decodeMer();s&&(a=p.makePixelatedCanvas(s)),i&&(e=p.makePixelatedCanvas(i)),o&&(t=p.makePixelatedCanvas(o))}return{emissiveMap:e,roughnessMap:t,metalnessMap:a}}getMaterial(e={}){let{emissiveMap:t,roughnessMap:a,metalnessMap:s}=this.merToCanvas();return new THREE.MeshStandardMaterial({map:this.getTexture(d.albedo)??p.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(i=>i.selected)?.canvas??Texture.all[0].canvas),aoMap:this.getTexture(d.ao),normalMap:this.getTexture(d.normal),bumpMap:this.getTexture(d.height),metalnessMap:s,roughnessMap:a,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:1,alphaTest:.5,...e})}saveTexture(e,{uuid:t,extend:a}){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][e.id]=t,a({channel:e.id}))}findTexture(e,t=!0){if(!Project)return null;let a=this._scope.find(r=>r.channel&&(r.channel===e||r.channel===e.id));if(a)return a;let s=typeof e=="string"?e:e.id;Project.pbr_materials??={};let i=Project.pbr_materials[this._materialUuid];if(!i&&t){let r=new RegExp(`_*${s}(.[^.]+)?$`,"i");return this._scope.find(c=>r.test(c.name))??null}let o=i?.[s];return o?this._scope.find(r=>r.uuid===o)??null:null}static makePixelatedCanvas(e){let t=new THREE.CanvasTexture(e,void 0,void 0,void 0,THREE.NearestFilter,THREE.NearestFilter);return t.needsUpdate=!0,t}getTexture(e){let t=this.findTexture(e);return t?p.makePixelatedCanvas(t.canvas):null}static extractChannel(e,t){let a=e.canvas,s=a.width,i=a.height,o=a.getContext("2d");if(!o||!s||!i)return null;let r=document.createElement("canvas");r.width=s,r.height=i;let c=r.getContext("2d");if(!c)return null;let m={r:0,g:1,b:2,a:3}[t],{data:f}=o.getImageData(0,0,s,i),x=new Uint8ClampedArray(s*i*4);for(let h=0;he){_[g]=v.data[g],_[g+1]=v.data[g+1],_[g+2]=v.data[g+2],_[g+3]=255;continue}_[g]=0,_[g+1]=0,_[g+2]=0,_[g+3]=255}return m.putImageData(new ImageData(_,r.width,r.height),0,0),{metalness:a,emissive:r,emissiveLevel:s,roughness:i,sss:o}}createMer(e=!1){let t=this.findTexture(d.metalness,e),a=this.findTexture(d.emissive,e),s=this.findTexture(d.roughness,e),i=this.findTexture("sss",!1),o=Math.max(t?.img.width??0,a?.img.width??0,s?.img.width??0,Project?Project.texture_width:0,16),r=Math.max(t?.img.height??0,a?.img.height??0,s?.img.height??0,Project?Project.texture_height:0,16),c=document.createElement("canvas");c.width=o,c.height=r;let m=c.getContext("2d");if(!m)return null;let f=t?.img?p.extractChannel(t,"r"):null,x=a?.img?p.extractChannel(a,"g"):null,v=s?.img?p.extractChannel(s,"b"):null,h=i&&i?.img?p.extractChannel(i,"a"):null,_=f?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),g=x?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),u=v?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),b=h?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(new Uint8ClampedArray(o*r*4).fill(255),o,r),M=new Uint8ClampedArray(o*r*4);for(let T=0;T{let M=(u+b*s)*4;return o[M]/255};r.width=s,r.height=i,c.drawImage(e.img,0,0,s,i);let f=c.getImageData(0,0,s,i),x=f.data,v=u=>{let b=Math.sqrt(u[0]*u[0]+u[1]*u[1]+u[2]*u[2]);return[u[0]/b,u[1]/b,u[2]/b]};for(let u=0;ud[n].id),label:"PBR Channel",exposed:!1}),z=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),X=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),q=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"});let K=n=>{let e=Texture.all.find(a=>a.selected);if(!e)return;let t=new p(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!1);t&&t.toBlob(async a=>{if(!a)return;let[s,i]=Project?[`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await a.arrayBuffer(),type:"PNG",name:s,extensions:["png"],resource_id:"mer",savetype:"image",startpath:i},n)})},y=n=>{if(!Project||Texture.all.length===0)return;let e=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(a=>{let i=t.faces[a].getTexture();if(!i)return;let o=Project.materials[i.uuid];o.isShaderMaterial&&!Project.bb_materials[i.uuid]&&(Project.bb_materials[i.uuid]=o);let r=new p(i.layers_enabled?i.layers.filter(c=>c.visible)??null:Project.textures,i.uuid).getMaterial(n);Project.materials[i.uuid]=THREE.ShaderMaterial.prototype.copy.call(r,o),Canvas.updateAllFaces(i),e=!0})}),Project.pbr_active=e},ne=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(n=>{n instanceof Cube&&Object.keys(n.faces).forEach(e=>{let a=n.faces[e].getTexture();if(!a)return;let s=Project.bb_materials[a.uuid];s&&(Project.materials[a.uuid]=s)})}),Project.pbr_active=!1,Canvas.updateAll())},ae=()=>{if(!Project)return;let n=P();Project.textures.forEach(e=>{let t=new p(n,e.uuid),a=t.findTexture(d.normal,!1)?.name,s=t.findTexture(d.height,!1)?.name,i=t.findTexture(d.albedo,!1)?.name,o=t.findTexture(d.metalness,!1)?.name,r=t.findTexture(d.emissive,!1)?.name,c=t.findTexture(d.roughness,!1)?.name,m={};return i||(m.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!r&&!c&&(m.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},m.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},m.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),a&&s&&(m.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),w=new Dialog(`${l}_texture_set`,{id:`${l}_texture_set`,title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:m,onConfirm(f){let x=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),v=o||r||c,h={format_version:"1.16.100","minecraft:texture_set":{color:(i?pathToName(i,!1):f.baseColor?.toHexString())??x,metalness_emissive_roughness:[f.metalness??0,f.emissive??0,f.roughness??255]}};f.depthMap==="normal"&&a?h["minecraft:texture_set"].normal=pathToName(a,!1):(!a||f.depthMap==="heightmap")&&s&&(h["minecraft:texture_set"].heightmap=pathToName(s,!1));let _=()=>Blockbench.export({content:JSON.stringify(h,null,2),type:"JSON",name:`${x}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path},()=>{Blockbench.showQuickMessage("Texture set created",2e3),w.hide()});if(v){K(g=>{h["minecraft:texture_set"].metalness_emissive_roughness=pathToName(g,!1),_()});return}_()},cancelIndex:1}),w.show(),w})},W=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],Y=()=>Project&&Project.pbr_active&&y(),Z=()=>{W.forEach(n=>{Blockbench.addListener(n,Y)})},ee=()=>{W.forEach(n=>{Blockbench.removeListener(n,Y)})},se=()=>{H=new Setting("pbr_active",{category:"preview",name:"Enable PBR Preview",description:"Enables PBR preview in the editor",type:"toggle",default_value:!1,icon:"tonality",launch_setting:!0,onChange(n){if(n){y(),Z();return}ne(),ee()}}),J=new Setting("display_settings_correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview for PBR materials",type:"toggle",default_value:!1,icon:"light_mode",condition:()=>!!Project,onChange(n){Preview.selected.renderer.physicallyCorrectLights=n,y()}}),B=new Setting("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:THREE.NoToneMapping,value:THREE.NoToneMapping,icon:"palette",options:{[THREE.NoToneMapping]:"None",[THREE.LinearToneMapping]:"Linear",[THREE.ReinhardToneMapping]:"Reinhard",[THREE.CineonToneMapping]:"Cineon",[THREE.ACESFilmicToneMapping]:"ACES"},onChange(n){Preview.selected.renderer.toneMapping=Number(n),y()}}),S=new Setting("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",default_value:1,icon:"exposure",step:.1,min:-2,max:2,onChange(n){Preview.selected.renderer.toneMappingExposure=Math.max(-2,Math.min(2,Number(n)))}}),A=new Action(`${l}_generate_normal`,{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(n=>n.selected))!==void 0,click(){let n=TextureLayer.selected??Texture.all.find(s=>s.selected),e=new p(P(),n.uuid),t=TextureLayer.selected??Texture.all.find(s=>s.selected)??e.findTexture(d.height,!0);if(!t){Blockbench.showQuickMessage("No height map found",2e3);return}let a=p.createNormalMap(t);if(a){e.saveTexture(d.normal,a),a.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),L=new Action(`${l}_create_mer`,{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",click(){K()}}),j=new Action(`${l}_decode_mer`,{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",click(){let n=P(),e=TextureLayer.selected?.texture??Texture.all.find(i=>i.selected),t=new p(n,(e??n[0]).uuid),a=t.decodeMer();[d.metalness,d.emissive,d.roughness].forEach((i,o)=>{let r=i.id,c=a[r];if(!c)return;let m=new TextureLayer({name:`${e?.name}_${r}`,data_url:c.toDataURL()},e.layers_enabled?e.texture:e);t.saveTexture(i,m)})}}),R=new Action(`${l}_create_texture_set`,{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){ae()}}),Object.entries(d).forEach(([n,e])=>{$[n]=new Action(`${l}_assign_channel_${n}`,{icon:e.icon??"tv_options_edit_channels",name:`Assign to ${e.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${e.label} channel`,category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(t){let a=TextureLayer.selected;if(!a||!Project)return;Undo.initEdit({layers:[a]}),a.extend({channel:n});let s=a.texture;s.updateChangesAfterEdit(),Project.pbr_materials[s.uuid]||(Project.pbr_materials[s.uuid]={}),Object.entries(Project.pbr_materials[s.uuid]).forEach(([i,o])=>{o===a.uuid&&delete Project.pbr_materials[s.uuid][i]}),Project.pbr_materials[s.uuid][n]=a.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${a.name}" to ${e.label} channel`,2e3),y()}})}),I=new Action(`${l}_unassign_channel`,{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",click(){let n=TextureLayer.selected;if(!n||!Project)return;Undo.initEdit({layers:[n]});let{texture:e,channel:t}=n;e.updateChangesAfterEdit(),Project.pbr_materials[e.uuid]={},n.channel=V,Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${n.name}" from ${t} channel`,2e3),y()}}),D=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",linked_setting:"pbr_active",default:!1,click(){},onChange(n){Blockbench.showQuickMessage(`PBR Preview is now ${n?"enabled":"disabled"}`,2e3)}}),k=new Toggle(`${l}_correct_lights`,{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",linked_setting:"display_settings_correct_lights",default:!1,onChange(n){Blockbench.showQuickMessage(`Physically corrected lighting is now ${n?"enabled":"disabled"}`,2e3)},click(){}}),C=new BarSlider(`${l}_exposure`,{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",icon:"exposure",min:-2,max:2,step:.1,value:Settings.get("display_settings_exposure")??1,display_condition:{modes:["edit","paint","animate"],project:!0},onChange({value:n}){S.set(n)}}),C.addLabel(!0,C),F=new Menu(`${l}_channel_menu`,[...Object.keys(d).map(n=>`${l}_assign_channel_${n}`),`${l}_unassign_channel`],{onOpen(){y()}}),Q=new Action(`${l}_show_channel_menu`,{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(n){F.open(n)}}),G=new BarSelect(`${l}_tonemapping`,{category:"preview",name:"Tone Mapping",description:"Select the tone mapping function",icon:"palette",value:THREE.NoToneMapping,linked_setting:"display_settings_tone_mapping",options:{[THREE.NoToneMapping]:{name:"No Tone Mapping",icon:"invert_colors_off"},[THREE.LinearToneMapping]:{name:"Linear",icon:"linear_scale"},[THREE.ReinhardToneMapping]:{name:"Reinhard",icon:"brightness_medium"},[THREE.CineonToneMapping]:{name:"Cineon",icon:"brightness_high"},[THREE.ACESFilmicToneMapping]:{name:"ACES",icon:"brightness_auto"}},onChange({value:n}){B.set(n),y()}}),U=new Panel(`${l}_display_settings`,{name:"PBR Settings",id:`${l}_display_settings_panel`,icon:"display_settings",toolbars:[new Toolbar(`${l}_controls_toolbar`,{id:`${l}_controls_toolbar`,children:["toggle_pbr",`${l}_correct_lights`,`${l}_show_channel_menu`],name:"PBR"}),new Toolbar(`${l}_display_settings_toolbar`,{id:`${l}_display_settings_toolbar`,children:[`${l}_tonemapping`,`${l}_exposure`],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"paint"}),MenuBar.addAction(L,"file.export"),MenuBar.addAction(A,"tools"),MenuBar.addAction(j,"tools"),MenuBar.addAction(R,"file.export"),MenuBar.addAction(D,"view"),MenuBar.addAction(k,"preview"),Object.entries($).forEach(([n,e],t)=>{MenuBar.addAction(e,`image.${t}`)}),Z()},re=()=>{Object.entries($).forEach(([n,e])=>{e.delete()}),MenuBar.removeAction(`file.export.${l}_create_mer`),MenuBar.removeAction(`file.export.${l}_create_texture_set`),MenuBar.removeAction(`tools.${l}_generate_normal`),ee(),U?.delete(),w?.delete(),H?.delete(),L?.delete(),A?.delete(),D?.delete(),j?.delete(),R?.delete(),O?.delete(),Q?.delete(),S?.delete(),C?.delete(),G?.delete(),k?.delete(),J?.delete(),B?.delete(),deactivatePbr?.delete(),I?.delete(),X?.delete(),z?.delete(),q?.delete()};BBPlugin.register(l,{version:te,title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.1",onload:se,onunload:re})})();})(); +"use strict";(()=>{(()=>{let j,R,L,A,I,D,H,U,w,O,F,Q,C,G,k,S,J,B,z,X,q,$={},l="pbr_preview",te="1.0.0",V="_NONE_",d={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality"},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6"},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight"},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain"},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape"},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks"},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode"}},P=(n=!0)=>{let e=Project?Project.textures??Texture.all:Texture.all;return n?e.filter(t=>t.layers.length>0).flatMap(t=>t.layers):e};class p{constructor(e,t){this._scope=e??P(),this._materialUuid=t}merToCanvas(){let e=this.getTexture(d.emissive),t=this.getTexture(d.roughness),a=this.getTexture(d.metalness);if(!e&&!t&&!a){let{metalness:s,emissive:i,roughness:o}=this.decodeMer();s&&(a=p.makePixelatedCanvas(s)),i&&(e=p.makePixelatedCanvas(i)),o&&(t=p.makePixelatedCanvas(o))}return{emissiveMap:e,roughnessMap:t,metalnessMap:a}}getMaterial(e={}){let{emissiveMap:t,roughnessMap:a,metalnessMap:s}=this.merToCanvas();return new THREE.MeshStandardMaterial({map:this.getTexture(d.albedo)??p.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(i=>i.selected)?.canvas??Texture.all[0].canvas),aoMap:this.getTexture(d.ao),normalMap:this.getTexture(d.normal),bumpMap:this.getTexture(d.height),metalnessMap:s,metalness:s?1:0,roughnessMap:a,roughness:a?1:0,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:1,alphaTest:.5,...e})}saveTexture(e,{uuid:t,extend:a}){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][e.id]=t,a({channel:e.id}))}findTexture(e,t=!0){if(!Project)return null;let a=this._scope.find(r=>r.channel&&(r.channel===e||r.channel===e.id));if(a)return a;let s=typeof e=="string"?e:e.id;Project.pbr_materials??={};let i=Project.pbr_materials[this._materialUuid];if(!i&&t){let r=new RegExp(`_*${s}(.[^.]+)?$`,"i");return this._scope.find(c=>r.test(c.name))??null}let o=i?.[s];return o?this._scope.find(r=>r.uuid===o)??null:null}static makePixelatedCanvas(e){let t=new THREE.CanvasTexture(e,void 0,void 0,void 0,THREE.NearestFilter,THREE.NearestFilter);return t.needsUpdate=!0,t}getTexture(e){let t=this.findTexture(e);return t?p.makePixelatedCanvas(t.canvas):null}static extractChannel(e,t){let a=e.canvas,s=a.width,i=a.height,o=a.getContext("2d");if(!o||!s||!i)return null;let r=document.createElement("canvas");r.width=s,r.height=i;let c=r.getContext("2d");if(!c)return null;let m={r:0,g:1,b:2,a:3}[t],{data:f}=o.getImageData(0,0,s,i),x=new Uint8ClampedArray(s*i*4);for(let h=0;he){_[g]=v.data[g],_[g+1]=v.data[g+1],_[g+2]=v.data[g+2],_[g+3]=255;continue}_[g]=0,_[g+1]=0,_[g+2]=0,_[g+3]=255}return m.putImageData(new ImageData(_,r.width,r.height),0,0),{metalness:a,emissive:r,emissiveLevel:s,roughness:i,sss:o}}createMer(e=!1){let t=this.findTexture(d.metalness,e),a=this.findTexture(d.emissive,e),s=this.findTexture(d.roughness,e),i=this.findTexture("sss",!1),o=Math.max(t?.img.width??0,a?.img.width??0,s?.img.width??0,Project?Project.texture_width:0,16),r=Math.max(t?.img.height??0,a?.img.height??0,s?.img.height??0,Project?Project.texture_height:0,16),c=document.createElement("canvas");c.width=o,c.height=r;let m=c.getContext("2d");if(!m)return null;let f=t?.img?p.extractChannel(t,"r"):null,x=a?.img?p.extractChannel(a,"g"):null,v=s?.img?p.extractChannel(s,"b"):null,h=i&&i?.img?p.extractChannel(i,"a"):null,_=f?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),g=x?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),u=v?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),b=h?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(new Uint8ClampedArray(o*r*4).fill(255),o,r),M=new Uint8ClampedArray(o*r*4);for(let T=0;T{let M=(u+b*s)*4;return o[M]/255};r.width=s,r.height=i,c.drawImage(e.img,0,0,s,i);let f=c.getImageData(0,0,s,i),x=f.data,v=u=>{let b=Math.sqrt(u[0]*u[0]+u[1]*u[1]+u[2]*u[2]);return[u[0]/b,u[1]/b,u[2]/b]};for(let u=0;ud[n].id),label:"PBR Channel",exposed:!1}),z=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),X=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),q=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"});let K=n=>{let e=Texture.all.find(a=>a.selected);if(!e)return;let t=new p(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!1);t&&t.toBlob(async a=>{if(!a)return;let[s,i]=Project?[`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await a.arrayBuffer(),type:"PNG",name:s,extensions:["png"],resource_id:"mer",savetype:"image",startpath:i},n)})},y=n=>{if(!Project||Texture.all.length===0)return;let e=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(a=>{let i=t.faces[a].getTexture();if(!i)return;let o=Project.materials[i.uuid];o.isShaderMaterial&&!Project.bb_materials[i.uuid]&&(Project.bb_materials[i.uuid]=o);let r=new p(i.layers_enabled?i.layers.filter(c=>c.visible)??null:Project.textures,i.uuid).getMaterial(n);Project.materials[i.uuid]=THREE.ShaderMaterial.prototype.copy.call(r,o),Canvas.updateAllFaces(i),e=!0})}),Project.pbr_active=e},ne=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(n=>{n instanceof Cube&&Object.keys(n.faces).forEach(e=>{let a=n.faces[e].getTexture();if(!a)return;let s=Project.bb_materials[a.uuid];s&&(Project.materials[a.uuid]=s)})}),Project.pbr_active=!1,Canvas.updateAll())},ae=()=>{if(!Project)return;let n=P();Project.textures.forEach(e=>{let t=new p(n,e.uuid),a=t.findTexture(d.normal,!1)?.name,s=t.findTexture(d.height,!1)?.name,i=t.findTexture(d.albedo,!1)?.name,o=t.findTexture(d.metalness,!1)?.name,r=t.findTexture(d.emissive,!1)?.name,c=t.findTexture(d.roughness,!1)?.name,m={};return i||(m.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!r&&!c&&(m.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},m.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},m.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),a&&s&&(m.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),w=new Dialog(`${l}_texture_set`,{id:`${l}_texture_set`,title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:m,onConfirm(f){let x=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),v=o||r||c,h={format_version:"1.16.100","minecraft:texture_set":{color:(i?pathToName(i,!1):f.baseColor?.toHexString())??x,metalness_emissive_roughness:[f.metalness??0,f.emissive??0,f.roughness??255]}};f.depthMap==="normal"&&a?h["minecraft:texture_set"].normal=pathToName(a,!1):(!a||f.depthMap==="heightmap")&&s&&(h["minecraft:texture_set"].heightmap=pathToName(s,!1));let _=()=>Blockbench.export({content:JSON.stringify(h,null,2),type:"JSON",name:`${x}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path},()=>{Blockbench.showQuickMessage("Texture set created",2e3),w.hide()});if(v){K(g=>{h["minecraft:texture_set"].metalness_emissive_roughness=pathToName(g,!1),_()});return}_()},cancelIndex:1}),w.show(),w})},W=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],Y=()=>Project&&Project.pbr_active&&y(),Z=()=>{W.forEach(n=>{Blockbench.addListener(n,Y)})},ee=()=>{W.forEach(n=>{Blockbench.removeListener(n,Y)})},se=()=>{H=new Setting("pbr_active",{category:"preview",name:"Enable PBR Preview",description:"Enables PBR preview in the editor",type:"toggle",default_value:!1,icon:"tonality",launch_setting:!0,onChange(n){if(n){y(),Z();return}ne(),ee()}}),J=new Setting("display_settings_correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview for PBR materials",type:"toggle",default_value:!1,icon:"light_mode",condition:()=>!!Project,onChange(n){Preview.selected.renderer.physicallyCorrectLights=n,y()}}),B=new Setting("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:THREE.NoToneMapping,value:THREE.NoToneMapping,icon:"palette",options:{[THREE.NoToneMapping]:"None",[THREE.LinearToneMapping]:"Linear",[THREE.ReinhardToneMapping]:"Reinhard",[THREE.CineonToneMapping]:"Cineon",[THREE.ACESFilmicToneMapping]:"ACES"},onChange(n){Preview.selected.renderer.toneMapping=Number(n),y()}}),S=new Setting("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",default_value:1,icon:"exposure",step:.1,min:-2,max:2,onChange(n){Preview.selected.renderer.toneMappingExposure=Math.max(-2,Math.min(2,Number(n)))}}),A=new Action(`${l}_generate_normal`,{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(n=>n.selected))!==void 0,click(){let n=TextureLayer.selected??Texture.all.find(s=>s.selected),e=new p(P(),n.uuid),t=TextureLayer.selected??Texture.all.find(s=>s.selected)??e.findTexture(d.height,!0);if(!t){Blockbench.showQuickMessage("No height map found",2e3);return}let a=p.createNormalMap(t);if(a){e.saveTexture(d.normal,a),a.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),L=new Action(`${l}_create_mer`,{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",click(){K()}}),j=new Action(`${l}_decode_mer`,{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",click(){let n=P(),e=TextureLayer.selected?.texture??Texture.all.find(i=>i.selected),t=new p(n,(e??n[0]).uuid),a=t.decodeMer();[d.metalness,d.emissive,d.roughness].forEach((i,o)=>{let r=i.id,c=a[r];if(!c)return;let m=new TextureLayer({name:`${e?.name}_${r}`,data_url:c.toDataURL()},e.layers_enabled?e.texture:e);t.saveTexture(i,m)})}}),R=new Action(`${l}_create_texture_set`,{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){ae()}}),Object.entries(d).forEach(([n,e])=>{$[n]=new Action(`${l}_assign_channel_${n}`,{icon:e.icon??"tv_options_edit_channels",name:`Assign to ${e.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${e.label} channel`,category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(t){let a=TextureLayer.selected;if(!a||!Project)return;Undo.initEdit({layers:[a]}),a.extend({channel:n});let s=a.texture;s.updateChangesAfterEdit(),Project.pbr_materials[s.uuid]||(Project.pbr_materials[s.uuid]={}),Object.entries(Project.pbr_materials[s.uuid]).forEach(([i,o])=>{o===a.uuid&&delete Project.pbr_materials[s.uuid][i]}),Project.pbr_materials[s.uuid][n]=a.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${a.name}" to ${e.label} channel`,2e3),y()}})}),I=new Action(`${l}_unassign_channel`,{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",click(){let n=TextureLayer.selected;if(!n||!Project)return;Undo.initEdit({layers:[n]});let{texture:e,channel:t}=n;e.updateChangesAfterEdit(),Project.pbr_materials[e.uuid]={},n.channel=V,Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${n.name}" from ${t} channel`,2e3),y()}}),D=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",linked_setting:"pbr_active",default:!1,click(){},onChange(n){Blockbench.showQuickMessage(`PBR Preview is now ${n?"enabled":"disabled"}`,2e3)}}),k=new Toggle(`${l}_correct_lights`,{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",linked_setting:"display_settings_correct_lights",default:!1,onChange(n){Blockbench.showQuickMessage(`Physically corrected lighting is now ${n?"enabled":"disabled"}`,2e3)},click(){}}),C=new BarSlider(`${l}_exposure`,{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",icon:"exposure",min:-2,max:2,step:.1,value:Settings.get("display_settings_exposure")??1,display_condition:{modes:["edit","paint","animate"],project:!0},onChange({value:n}){S.set(n)}}),C.addLabel(!0,C),F=new Menu(`${l}_channel_menu`,[...Object.keys(d).map(n=>`${l}_assign_channel_${n}`),`${l}_unassign_channel`],{onOpen(){y()}}),Q=new Action(`${l}_show_channel_menu`,{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(n){F.open(n)}}),G=new BarSelect(`${l}_tonemapping`,{category:"preview",name:"Tone Mapping",description:"Select the tone mapping function",icon:"palette",value:THREE.NoToneMapping,linked_setting:"display_settings_tone_mapping",options:{[THREE.NoToneMapping]:{name:"No Tone Mapping",icon:"invert_colors_off"},[THREE.LinearToneMapping]:{name:"Linear",icon:"linear_scale"},[THREE.ReinhardToneMapping]:{name:"Reinhard",icon:"brightness_medium"},[THREE.CineonToneMapping]:{name:"Cineon",icon:"brightness_high"},[THREE.ACESFilmicToneMapping]:{name:"ACES",icon:"brightness_auto"}},onChange({value:n}){B.set(n),y()}}),U=new Panel(`${l}_display_settings`,{name:"PBR Settings",id:`${l}_display_settings_panel`,icon:"display_settings",toolbars:[new Toolbar(`${l}_controls_toolbar`,{id:`${l}_controls_toolbar`,children:["toggle_pbr",`${l}_correct_lights`,`${l}_show_channel_menu`],name:"PBR"}),new Toolbar(`${l}_display_settings_toolbar`,{id:`${l}_display_settings_toolbar`,children:[`${l}_tonemapping`,`${l}_exposure`],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"paint"}),MenuBar.addAction(L,"file.export"),MenuBar.addAction(A,"tools"),MenuBar.addAction(j,"tools"),MenuBar.addAction(R,"file.export"),MenuBar.addAction(D,"view"),MenuBar.addAction(k,"preview"),Object.entries($).forEach(([n,e],t)=>{MenuBar.addAction(e,`image.${t}`)}),Z()},re=()=>{Object.entries($).forEach(([n,e])=>{e.delete()}),MenuBar.removeAction(`file.export.${l}_create_mer`),MenuBar.removeAction(`file.export.${l}_create_texture_set`),MenuBar.removeAction(`tools.${l}_generate_normal`),ee(),U?.delete(),w?.delete(),H?.delete(),L?.delete(),A?.delete(),D?.delete(),j?.delete(),R?.delete(),O?.delete(),Q?.delete(),S?.delete(),C?.delete(),G?.delete(),k?.delete(),J?.delete(),B?.delete(),deactivatePbr?.delete(),I?.delete(),X?.delete(),z?.delete(),q?.delete()};BBPlugin.register(l,{version:te,title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.1",onload:se,onunload:re})})();})(); diff --git a/src/pbr_preview/src/index.ts b/src/pbr_preview/src/index.ts index cf4db190..f7740356 100644 --- a/src/pbr_preview/src/index.ts +++ b/src/pbr_preview/src/index.ts @@ -180,9 +180,9 @@ interface IChannel { normalMap: this.getTexture(CHANNELS.normal), bumpMap: this.getTexture(CHANNELS.height), metalnessMap, - // metalness: metalnessMap ? 1 : 0, + metalness: metalnessMap ? 1 : 0, roughnessMap, - // roughness: roughnessMap ? 1 : 0, + roughness: roughnessMap ? 1 : 0, emissiveMap, emissiveIntensity: emissiveMap ? 1 : 0, emissive: emissiveMap ? 0xffffff : 0, From 05875deb572864b7c1161fc1da4b34f577cb107b Mon Sep 17 00:00:00 2001 From: Jason Gardner Date: Mon, 27 May 2024 07:27:09 -0500 Subject: [PATCH 06/50] upd: Global metal/roughness setting - Added setting to control global metalness and roughness of a scene --- plugins/pbr_preview/pbr_preview.js | 2 +- src/pbr_preview/src/index.ts | 33 +++++++++++++++++++++++++++--- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index dff6f004..7a84932e 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1 +1 @@ -"use strict";(()=>{(()=>{let j,R,L,A,I,D,H,U,w,O,F,Q,C,G,k,S,J,B,z,X,q,$={},l="pbr_preview",te="1.0.0",V="_NONE_",d={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality"},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6"},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight"},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain"},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape"},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks"},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode"}},P=(n=!0)=>{let e=Project?Project.textures??Texture.all:Texture.all;return n?e.filter(t=>t.layers.length>0).flatMap(t=>t.layers):e};class p{constructor(e,t){this._scope=e??P(),this._materialUuid=t}merToCanvas(){let e=this.getTexture(d.emissive),t=this.getTexture(d.roughness),a=this.getTexture(d.metalness);if(!e&&!t&&!a){let{metalness:s,emissive:i,roughness:o}=this.decodeMer();s&&(a=p.makePixelatedCanvas(s)),i&&(e=p.makePixelatedCanvas(i)),o&&(t=p.makePixelatedCanvas(o))}return{emissiveMap:e,roughnessMap:t,metalnessMap:a}}getMaterial(e={}){let{emissiveMap:t,roughnessMap:a,metalnessMap:s}=this.merToCanvas();return new THREE.MeshStandardMaterial({map:this.getTexture(d.albedo)??p.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(i=>i.selected)?.canvas??Texture.all[0].canvas),aoMap:this.getTexture(d.ao),normalMap:this.getTexture(d.normal),bumpMap:this.getTexture(d.height),metalnessMap:s,metalness:s?1:0,roughnessMap:a,roughness:a?1:0,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:1,alphaTest:.5,...e})}saveTexture(e,{uuid:t,extend:a}){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][e.id]=t,a({channel:e.id}))}findTexture(e,t=!0){if(!Project)return null;let a=this._scope.find(r=>r.channel&&(r.channel===e||r.channel===e.id));if(a)return a;let s=typeof e=="string"?e:e.id;Project.pbr_materials??={};let i=Project.pbr_materials[this._materialUuid];if(!i&&t){let r=new RegExp(`_*${s}(.[^.]+)?$`,"i");return this._scope.find(c=>r.test(c.name))??null}let o=i?.[s];return o?this._scope.find(r=>r.uuid===o)??null:null}static makePixelatedCanvas(e){let t=new THREE.CanvasTexture(e,void 0,void 0,void 0,THREE.NearestFilter,THREE.NearestFilter);return t.needsUpdate=!0,t}getTexture(e){let t=this.findTexture(e);return t?p.makePixelatedCanvas(t.canvas):null}static extractChannel(e,t){let a=e.canvas,s=a.width,i=a.height,o=a.getContext("2d");if(!o||!s||!i)return null;let r=document.createElement("canvas");r.width=s,r.height=i;let c=r.getContext("2d");if(!c)return null;let m={r:0,g:1,b:2,a:3}[t],{data:f}=o.getImageData(0,0,s,i),x=new Uint8ClampedArray(s*i*4);for(let h=0;he){_[g]=v.data[g],_[g+1]=v.data[g+1],_[g+2]=v.data[g+2],_[g+3]=255;continue}_[g]=0,_[g+1]=0,_[g+2]=0,_[g+3]=255}return m.putImageData(new ImageData(_,r.width,r.height),0,0),{metalness:a,emissive:r,emissiveLevel:s,roughness:i,sss:o}}createMer(e=!1){let t=this.findTexture(d.metalness,e),a=this.findTexture(d.emissive,e),s=this.findTexture(d.roughness,e),i=this.findTexture("sss",!1),o=Math.max(t?.img.width??0,a?.img.width??0,s?.img.width??0,Project?Project.texture_width:0,16),r=Math.max(t?.img.height??0,a?.img.height??0,s?.img.height??0,Project?Project.texture_height:0,16),c=document.createElement("canvas");c.width=o,c.height=r;let m=c.getContext("2d");if(!m)return null;let f=t?.img?p.extractChannel(t,"r"):null,x=a?.img?p.extractChannel(a,"g"):null,v=s?.img?p.extractChannel(s,"b"):null,h=i&&i?.img?p.extractChannel(i,"a"):null,_=f?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),g=x?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),u=v?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),b=h?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(new Uint8ClampedArray(o*r*4).fill(255),o,r),M=new Uint8ClampedArray(o*r*4);for(let T=0;T{let M=(u+b*s)*4;return o[M]/255};r.width=s,r.height=i,c.drawImage(e.img,0,0,s,i);let f=c.getImageData(0,0,s,i),x=f.data,v=u=>{let b=Math.sqrt(u[0]*u[0]+u[1]*u[1]+u[2]*u[2]);return[u[0]/b,u[1]/b,u[2]/b]};for(let u=0;ud[n].id),label:"PBR Channel",exposed:!1}),z=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),X=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),q=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"});let K=n=>{let e=Texture.all.find(a=>a.selected);if(!e)return;let t=new p(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!1);t&&t.toBlob(async a=>{if(!a)return;let[s,i]=Project?[`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await a.arrayBuffer(),type:"PNG",name:s,extensions:["png"],resource_id:"mer",savetype:"image",startpath:i},n)})},y=n=>{if(!Project||Texture.all.length===0)return;let e=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(a=>{let i=t.faces[a].getTexture();if(!i)return;let o=Project.materials[i.uuid];o.isShaderMaterial&&!Project.bb_materials[i.uuid]&&(Project.bb_materials[i.uuid]=o);let r=new p(i.layers_enabled?i.layers.filter(c=>c.visible)??null:Project.textures,i.uuid).getMaterial(n);Project.materials[i.uuid]=THREE.ShaderMaterial.prototype.copy.call(r,o),Canvas.updateAllFaces(i),e=!0})}),Project.pbr_active=e},ne=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(n=>{n instanceof Cube&&Object.keys(n.faces).forEach(e=>{let a=n.faces[e].getTexture();if(!a)return;let s=Project.bb_materials[a.uuid];s&&(Project.materials[a.uuid]=s)})}),Project.pbr_active=!1,Canvas.updateAll())},ae=()=>{if(!Project)return;let n=P();Project.textures.forEach(e=>{let t=new p(n,e.uuid),a=t.findTexture(d.normal,!1)?.name,s=t.findTexture(d.height,!1)?.name,i=t.findTexture(d.albedo,!1)?.name,o=t.findTexture(d.metalness,!1)?.name,r=t.findTexture(d.emissive,!1)?.name,c=t.findTexture(d.roughness,!1)?.name,m={};return i||(m.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!r&&!c&&(m.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},m.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},m.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),a&&s&&(m.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),w=new Dialog(`${l}_texture_set`,{id:`${l}_texture_set`,title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:m,onConfirm(f){let x=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),v=o||r||c,h={format_version:"1.16.100","minecraft:texture_set":{color:(i?pathToName(i,!1):f.baseColor?.toHexString())??x,metalness_emissive_roughness:[f.metalness??0,f.emissive??0,f.roughness??255]}};f.depthMap==="normal"&&a?h["minecraft:texture_set"].normal=pathToName(a,!1):(!a||f.depthMap==="heightmap")&&s&&(h["minecraft:texture_set"].heightmap=pathToName(s,!1));let _=()=>Blockbench.export({content:JSON.stringify(h,null,2),type:"JSON",name:`${x}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path},()=>{Blockbench.showQuickMessage("Texture set created",2e3),w.hide()});if(v){K(g=>{h["minecraft:texture_set"].metalness_emissive_roughness=pathToName(g,!1),_()});return}_()},cancelIndex:1}),w.show(),w})},W=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],Y=()=>Project&&Project.pbr_active&&y(),Z=()=>{W.forEach(n=>{Blockbench.addListener(n,Y)})},ee=()=>{W.forEach(n=>{Blockbench.removeListener(n,Y)})},se=()=>{H=new Setting("pbr_active",{category:"preview",name:"Enable PBR Preview",description:"Enables PBR preview in the editor",type:"toggle",default_value:!1,icon:"tonality",launch_setting:!0,onChange(n){if(n){y(),Z();return}ne(),ee()}}),J=new Setting("display_settings_correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview for PBR materials",type:"toggle",default_value:!1,icon:"light_mode",condition:()=>!!Project,onChange(n){Preview.selected.renderer.physicallyCorrectLights=n,y()}}),B=new Setting("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:THREE.NoToneMapping,value:THREE.NoToneMapping,icon:"palette",options:{[THREE.NoToneMapping]:"None",[THREE.LinearToneMapping]:"Linear",[THREE.ReinhardToneMapping]:"Reinhard",[THREE.CineonToneMapping]:"Cineon",[THREE.ACESFilmicToneMapping]:"ACES"},onChange(n){Preview.selected.renderer.toneMapping=Number(n),y()}}),S=new Setting("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",default_value:1,icon:"exposure",step:.1,min:-2,max:2,onChange(n){Preview.selected.renderer.toneMappingExposure=Math.max(-2,Math.min(2,Number(n)))}}),A=new Action(`${l}_generate_normal`,{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(n=>n.selected))!==void 0,click(){let n=TextureLayer.selected??Texture.all.find(s=>s.selected),e=new p(P(),n.uuid),t=TextureLayer.selected??Texture.all.find(s=>s.selected)??e.findTexture(d.height,!0);if(!t){Blockbench.showQuickMessage("No height map found",2e3);return}let a=p.createNormalMap(t);if(a){e.saveTexture(d.normal,a),a.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),L=new Action(`${l}_create_mer`,{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",click(){K()}}),j=new Action(`${l}_decode_mer`,{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",click(){let n=P(),e=TextureLayer.selected?.texture??Texture.all.find(i=>i.selected),t=new p(n,(e??n[0]).uuid),a=t.decodeMer();[d.metalness,d.emissive,d.roughness].forEach((i,o)=>{let r=i.id,c=a[r];if(!c)return;let m=new TextureLayer({name:`${e?.name}_${r}`,data_url:c.toDataURL()},e.layers_enabled?e.texture:e);t.saveTexture(i,m)})}}),R=new Action(`${l}_create_texture_set`,{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){ae()}}),Object.entries(d).forEach(([n,e])=>{$[n]=new Action(`${l}_assign_channel_${n}`,{icon:e.icon??"tv_options_edit_channels",name:`Assign to ${e.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${e.label} channel`,category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(t){let a=TextureLayer.selected;if(!a||!Project)return;Undo.initEdit({layers:[a]}),a.extend({channel:n});let s=a.texture;s.updateChangesAfterEdit(),Project.pbr_materials[s.uuid]||(Project.pbr_materials[s.uuid]={}),Object.entries(Project.pbr_materials[s.uuid]).forEach(([i,o])=>{o===a.uuid&&delete Project.pbr_materials[s.uuid][i]}),Project.pbr_materials[s.uuid][n]=a.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${a.name}" to ${e.label} channel`,2e3),y()}})}),I=new Action(`${l}_unassign_channel`,{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",click(){let n=TextureLayer.selected;if(!n||!Project)return;Undo.initEdit({layers:[n]});let{texture:e,channel:t}=n;e.updateChangesAfterEdit(),Project.pbr_materials[e.uuid]={},n.channel=V,Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${n.name}" from ${t} channel`,2e3),y()}}),D=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",linked_setting:"pbr_active",default:!1,click(){},onChange(n){Blockbench.showQuickMessage(`PBR Preview is now ${n?"enabled":"disabled"}`,2e3)}}),k=new Toggle(`${l}_correct_lights`,{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",linked_setting:"display_settings_correct_lights",default:!1,onChange(n){Blockbench.showQuickMessage(`Physically corrected lighting is now ${n?"enabled":"disabled"}`,2e3)},click(){}}),C=new BarSlider(`${l}_exposure`,{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",icon:"exposure",min:-2,max:2,step:.1,value:Settings.get("display_settings_exposure")??1,display_condition:{modes:["edit","paint","animate"],project:!0},onChange({value:n}){S.set(n)}}),C.addLabel(!0,C),F=new Menu(`${l}_channel_menu`,[...Object.keys(d).map(n=>`${l}_assign_channel_${n}`),`${l}_unassign_channel`],{onOpen(){y()}}),Q=new Action(`${l}_show_channel_menu`,{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(n){F.open(n)}}),G=new BarSelect(`${l}_tonemapping`,{category:"preview",name:"Tone Mapping",description:"Select the tone mapping function",icon:"palette",value:THREE.NoToneMapping,linked_setting:"display_settings_tone_mapping",options:{[THREE.NoToneMapping]:{name:"No Tone Mapping",icon:"invert_colors_off"},[THREE.LinearToneMapping]:{name:"Linear",icon:"linear_scale"},[THREE.ReinhardToneMapping]:{name:"Reinhard",icon:"brightness_medium"},[THREE.CineonToneMapping]:{name:"Cineon",icon:"brightness_high"},[THREE.ACESFilmicToneMapping]:{name:"ACES",icon:"brightness_auto"}},onChange({value:n}){B.set(n),y()}}),U=new Panel(`${l}_display_settings`,{name:"PBR Settings",id:`${l}_display_settings_panel`,icon:"display_settings",toolbars:[new Toolbar(`${l}_controls_toolbar`,{id:`${l}_controls_toolbar`,children:["toggle_pbr",`${l}_correct_lights`,`${l}_show_channel_menu`],name:"PBR"}),new Toolbar(`${l}_display_settings_toolbar`,{id:`${l}_display_settings_toolbar`,children:[`${l}_tonemapping`,`${l}_exposure`],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"paint"}),MenuBar.addAction(L,"file.export"),MenuBar.addAction(A,"tools"),MenuBar.addAction(j,"tools"),MenuBar.addAction(R,"file.export"),MenuBar.addAction(D,"view"),MenuBar.addAction(k,"preview"),Object.entries($).forEach(([n,e],t)=>{MenuBar.addAction(e,`image.${t}`)}),Z()},re=()=>{Object.entries($).forEach(([n,e])=>{e.delete()}),MenuBar.removeAction(`file.export.${l}_create_mer`),MenuBar.removeAction(`file.export.${l}_create_texture_set`),MenuBar.removeAction(`tools.${l}_generate_normal`),ee(),U?.delete(),w?.delete(),H?.delete(),L?.delete(),A?.delete(),D?.delete(),j?.delete(),R?.delete(),O?.delete(),Q?.delete(),S?.delete(),C?.delete(),G?.delete(),k?.delete(),J?.delete(),B?.delete(),deactivatePbr?.delete(),I?.delete(),X?.delete(),z?.delete(),q?.delete()};BBPlugin.register(l,{version:te,title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.1",onload:se,onunload:re})})();})(); +"use strict";(()=>{(()=>{let j,R,S,L,I,A,H,U,w,O,F,G,C,Q,D,k,J,B,z,X,q,V,K,$={},l="pbr_preview",ae="1.0.0",W="_NONE_",d={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality"},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6"},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight"},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain"},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape"},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks"},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode"}},P=(n=!0)=>{let e=Project?Project.textures??Texture.all:Texture.all;return n?e.filter(t=>t.layers.length>0).flatMap(t=>t.layers):e};class p{constructor(e,t){this._scope=e??P(),this._materialUuid=t}merToCanvas(){let e=this.getTexture(d.emissive),t=this.getTexture(d.roughness),a=this.getTexture(d.metalness);if(!e&&!t&&!a){let{metalness:s,emissive:i,roughness:o}=this.decodeMer();s&&(a=p.makePixelatedCanvas(s)),i&&(e=p.makePixelatedCanvas(i)),o&&(t=p.makePixelatedCanvas(o))}return{emissiveMap:e,roughnessMap:t,metalnessMap:a}}getMaterial(e={}){let{emissiveMap:t,roughnessMap:a,metalnessMap:s}=this.merToCanvas();return new THREE.MeshStandardMaterial({map:this.getTexture(d.albedo)??p.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(i=>i.selected)?.canvas??Texture.all[0].canvas),aoMap:this.getTexture(d.ao),normalMap:this.getTexture(d.normal),bumpMap:this.getTexture(d.height),metalnessMap:s,metalness:s?Settings.get("global_metalness"):0,roughnessMap:a,roughness:a?Settings.get("global_roughness"):0,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:1,alphaTest:.5,...e})}saveTexture(e,{uuid:t,extend:a}){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][e.id]=t,a({channel:e.id}))}findTexture(e,t=!0){if(!Project)return null;let a=this._scope.find(r=>r.channel&&(r.channel===e||r.channel===e.id));if(a)return a;let s=typeof e=="string"?e:e.id;Project.pbr_materials??={};let i=Project.pbr_materials[this._materialUuid];if(!i&&t){let r=new RegExp(`_*${s}(.[^.]+)?$`,"i");return this._scope.find(c=>r.test(c.name))??null}let o=i?.[s];return o?this._scope.find(r=>r.uuid===o)??null:null}static makePixelatedCanvas(e){let t=new THREE.CanvasTexture(e,void 0,void 0,void 0,THREE.NearestFilter,THREE.NearestFilter);return t.needsUpdate=!0,t}getTexture(e){let t=this.findTexture(e);return t?p.makePixelatedCanvas(t.canvas):null}static extractChannel(e,t){let a=e.canvas,s=a.width,i=a.height,o=a.getContext("2d");if(!o||!s||!i)return null;let r=document.createElement("canvas");r.width=s,r.height=i;let c=r.getContext("2d");if(!c)return null;let m={r:0,g:1,b:2,a:3}[t],{data:f}=o.getImageData(0,0,s,i),x=new Uint8ClampedArray(s*i*4);for(let g=0;ge){_[h]=v.data[h],_[h+1]=v.data[h+1],_[h+2]=v.data[h+2],_[h+3]=255;continue}_[h]=0,_[h+1]=0,_[h+2]=0,_[h+3]=255}return m.putImageData(new ImageData(_,r.width,r.height),0,0),{metalness:a,emissive:r,emissiveLevel:s,roughness:i,sss:o}}createMer(e=!1){let t=this.findTexture(d.metalness,e),a=this.findTexture(d.emissive,e),s=this.findTexture(d.roughness,e),i=this.findTexture("sss",!1),o=Math.max(t?.img.width??0,a?.img.width??0,s?.img.width??0,Project?Project.texture_width:0,16),r=Math.max(t?.img.height??0,a?.img.height??0,s?.img.height??0,Project?Project.texture_height:0,16),c=document.createElement("canvas");c.width=o,c.height=r;let m=c.getContext("2d");if(!m)return null;let f=t?.img?p.extractChannel(t,"r"):null,x=a?.img?p.extractChannel(a,"g"):null,v=s?.img?p.extractChannel(s,"b"):null,g=i&&i?.img?p.extractChannel(i,"a"):null,_=f?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),h=x?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),u=v?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),b=g?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(new Uint8ClampedArray(o*r*4).fill(255),o,r),M=new Uint8ClampedArray(o*r*4);for(let T=0;T{let M=(u+b*s)*4;return o[M]/255};r.width=s,r.height=i,c.drawImage(e.img,0,0,s,i);let f=c.getImageData(0,0,s,i),x=f.data,v=u=>{let b=Math.sqrt(u[0]*u[0]+u[1]*u[1]+u[2]*u[2]);return[u[0]/b,u[1]/b,u[2]/b]};for(let u=0;ud[n].id),label:"PBR Channel",exposed:!1}),q=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),V=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),K=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"});let Y=n=>{let e=Texture.all.find(a=>a.selected);if(!e)return;let t=new p(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!1);t&&t.toBlob(async a=>{if(!a)return;let[s,i]=Project?[`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await a.arrayBuffer(),type:"PNG",name:s,extensions:["png"],resource_id:"mer",savetype:"image",startpath:i},n)})},y=n=>{if(!Project||Texture.all.length===0)return;let e=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(a=>{let i=t.faces[a].getTexture();if(!i)return;let o=Project.materials[i.uuid];o.isShaderMaterial&&!Project.bb_materials[i.uuid]&&(Project.bb_materials[i.uuid]=o);let r=new p(i.layers_enabled?i.layers.filter(c=>c.visible)??null:Project.textures,i.uuid).getMaterial(n);Project.materials[i.uuid]=THREE.ShaderMaterial.prototype.copy.call(r,o),Canvas.updateAllFaces(i),e=!0})}),Project.pbr_active=e},se=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(n=>{n instanceof Cube&&Object.keys(n.faces).forEach(e=>{let a=n.faces[e].getTexture();if(!a)return;let s=Project.bb_materials[a.uuid];s&&(Project.materials[a.uuid]=s)})}),Project.pbr_active=!1,Canvas.updateAll())},re=()=>{if(!Project)return;let n=P();Project.textures.forEach(e=>{let t=new p(n,e.uuid),a=t.findTexture(d.normal,!1)?.name,s=t.findTexture(d.height,!1)?.name,i=t.findTexture(d.albedo,!1)?.name,o=t.findTexture(d.metalness,!1)?.name,r=t.findTexture(d.emissive,!1)?.name,c=t.findTexture(d.roughness,!1)?.name,m={};return i||(m.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!r&&!c&&(m.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},m.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},m.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),a&&s&&(m.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),w=new Dialog(`${l}_texture_set`,{id:`${l}_texture_set`,title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:m,onConfirm(f){let x=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),v=o||r||c,g={format_version:"1.16.100","minecraft:texture_set":{color:(i?pathToName(i,!1):f.baseColor?.toHexString())??x,metalness_emissive_roughness:[f.metalness??0,f.emissive??0,f.roughness??255]}};f.depthMap==="normal"&&a?g["minecraft:texture_set"].normal=pathToName(a,!1):(!a||f.depthMap==="heightmap")&&s&&(g["minecraft:texture_set"].heightmap=pathToName(s,!1));let _=()=>Blockbench.export({content:JSON.stringify(g,null,2),type:"JSON",name:`${x}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path},()=>{Blockbench.showQuickMessage("Texture set created",2e3),w.hide()});if(v){Y(h=>{g["minecraft:texture_set"].metalness_emissive_roughness=pathToName(h,!1),_()});return}_()},cancelIndex:1}),w.show(),w})},Z=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],ee=()=>Project&&Project.pbr_active&&y(),te=()=>{Z.forEach(n=>{Blockbench.addListener(n,ee)})},ne=()=>{Z.forEach(n=>{Blockbench.removeListener(n,ee)})},ie=()=>{H=new Setting("pbr_active",{category:"preview",name:"Enable PBR Preview",description:"Enables PBR preview in the editor",type:"toggle",default_value:!1,icon:"tonality",launch_setting:!0,onChange(n){if(n){y(),te();return}se(),ne()}}),J=new Setting("display_settings_correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview for PBR materials",type:"toggle",default_value:!1,icon:"light_mode",condition:()=>!!Project,onChange(n){Preview.selected.renderer.physicallyCorrectLights=n,y()}}),B=new Setting("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:THREE.NoToneMapping,value:THREE.NoToneMapping,icon:"palette",options:{[THREE.NoToneMapping]:"None",[THREE.LinearToneMapping]:"Linear",[THREE.ReinhardToneMapping]:"Reinhard",[THREE.CineonToneMapping]:"Cineon",[THREE.ACESFilmicToneMapping]:"ACES"},onChange(n){Preview.selected.renderer.toneMapping=Number(n),y()}}),k=new Setting("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",default_value:1,icon:"exposure",step:.1,min:-2,max:2,onChange(n){Preview.selected.renderer.toneMappingExposure=Math.max(-2,Math.min(2,Number(n)))}}),z=new Setting("global_metalness",{category:"preview",name:"Global Metalness",description:"Adjusts the base metalness of the scene",type:"number",default_value:0,icon:"iron",step:.01,min:0,max:1}),X=new Setting("global_roughness",{category:"preview",name:"Global Roughness",description:"Adjusts the base roughness of the scene",type:"number",default_value:0,icon:"iron",step:.01,min:0,max:1}),L=new Action(`${l}_generate_normal`,{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(n=>n.selected))!==void 0,click(){let n=TextureLayer.selected??Texture.all.find(s=>s.selected),e=new p(P(),n.uuid),t=TextureLayer.selected??Texture.all.find(s=>s.selected)??e.findTexture(d.height,!0);if(!t){Blockbench.showQuickMessage("No height map found",2e3);return}let a=p.createNormalMap(t);if(a){e.saveTexture(d.normal,a),a.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),S=new Action(`${l}_create_mer`,{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",click(){Y()}}),j=new Action(`${l}_decode_mer`,{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",click(){let n=P(),e=TextureLayer.selected?.texture??Texture.all.find(i=>i.selected),t=new p(n,(e??n[0]).uuid),a=t.decodeMer();[d.metalness,d.emissive,d.roughness].forEach((i,o)=>{let r=i.id,c=a[r];if(!c)return;let m=new TextureLayer({name:`${e?.name}_${r}`,data_url:c.toDataURL()},e.layers_enabled?e.texture:e);t.saveTexture(i,m)})}}),R=new Action(`${l}_create_texture_set`,{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){re()}}),Object.entries(d).forEach(([n,e])=>{$[n]=new Action(`${l}_assign_channel_${n}`,{icon:e.icon??"tv_options_edit_channels",name:`Assign to ${e.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${e.label} channel`,category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(t){let a=TextureLayer.selected;if(!a||!Project)return;Undo.initEdit({layers:[a]}),a.extend({channel:n});let s=a.texture;s.updateChangesAfterEdit(),Project.pbr_materials[s.uuid]||(Project.pbr_materials[s.uuid]={}),Object.entries(Project.pbr_materials[s.uuid]).forEach(([i,o])=>{o===a.uuid&&delete Project.pbr_materials[s.uuid][i]}),Project.pbr_materials[s.uuid][n]=a.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${a.name}" to ${e.label} channel`,2e3),y()}})}),I=new Action(`${l}_unassign_channel`,{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",click(){let n=TextureLayer.selected;if(!n||!Project)return;Undo.initEdit({layers:[n]});let{texture:e,channel:t}=n;e.updateChangesAfterEdit(),Project.pbr_materials[e.uuid]={},n.channel=W,Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${n.name}" from ${t} channel`,2e3),y()}}),A=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",linked_setting:"pbr_active",default:!1,click(){},onChange(n){Blockbench.showQuickMessage(`PBR Preview is now ${n?"enabled":"disabled"}`,2e3)}}),D=new Toggle(`${l}_correct_lights`,{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",linked_setting:"display_settings_correct_lights",default:!1,onChange(n){Blockbench.showQuickMessage(`Physically corrected lighting is now ${n?"enabled":"disabled"}`,2e3)},click(){}}),C=new BarSlider(`${l}_exposure`,{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",icon:"exposure",min:-2,max:2,step:.1,value:Settings.get("display_settings_exposure")??1,display_condition:{modes:["edit","paint","animate"],project:!0},onChange({value:n}){k.set(n)}}),C.addLabel(!0,C),F=new Menu(`${l}_channel_menu`,[...Object.keys(d).map(n=>`${l}_assign_channel_${n}`),`${l}_unassign_channel`],{onOpen(){y()}}),G=new Action(`${l}_show_channel_menu`,{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(n){F.open(n)}}),Q=new BarSelect(`${l}_tonemapping`,{category:"preview",name:"Tone Mapping",description:"Select the tone mapping function",icon:"palette",value:THREE.NoToneMapping,linked_setting:"display_settings_tone_mapping",options:{[THREE.NoToneMapping]:{name:"No Tone Mapping",icon:"invert_colors_off"},[THREE.LinearToneMapping]:{name:"Linear",icon:"linear_scale"},[THREE.ReinhardToneMapping]:{name:"Reinhard",icon:"brightness_medium"},[THREE.CineonToneMapping]:{name:"Cineon",icon:"brightness_high"},[THREE.ACESFilmicToneMapping]:{name:"ACES",icon:"brightness_auto"}},onChange({value:n}){B.set(n),y()}}),U=new Panel(`${l}_display_settings`,{name:"PBR Settings",id:`${l}_display_settings_panel`,icon:"display_settings",toolbars:[new Toolbar(`${l}_controls_toolbar`,{id:`${l}_controls_toolbar`,children:["toggle_pbr",`${l}_correct_lights`,`${l}_show_channel_menu`],name:"PBR"}),new Toolbar(`${l}_display_settings_toolbar`,{id:`${l}_display_settings_toolbar`,children:[`${l}_tonemapping`,`${l}_exposure`],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"paint"}),MenuBar.addAction(S,"file.export"),MenuBar.addAction(L,"tools"),MenuBar.addAction(j,"tools"),MenuBar.addAction(R,"file.export"),MenuBar.addAction(A,"view"),MenuBar.addAction(D,"preview"),Object.entries($).forEach(([n,e],t)=>{MenuBar.addAction(e,`image.${t}`)}),te()},oe=()=>{Object.entries($).forEach(([n,e])=>{e.delete()}),MenuBar.removeAction(`file.export.${l}_create_mer`),MenuBar.removeAction(`file.export.${l}_create_texture_set`),MenuBar.removeAction(`tools.${l}_generate_normal`),ne(),U?.delete(),w?.delete(),H?.delete(),S?.delete(),L?.delete(),A?.delete(),j?.delete(),R?.delete(),O?.delete(),G?.delete(),k?.delete(),C?.delete(),Q?.delete(),D?.delete(),J?.delete(),B?.delete(),I?.delete(),V?.delete(),q?.delete(),K?.delete(),z?.delete(),X?.delete()};BBPlugin.register(l,{version:ae,title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.1",onload:ie,onunload:oe})})();})(); diff --git a/src/pbr_preview/src/index.ts b/src/pbr_preview/src/index.ts index f7740356..6ae6c882 100644 --- a/src/pbr_preview/src/index.ts +++ b/src/pbr_preview/src/index.ts @@ -48,6 +48,8 @@ interface IChannel { let exposureSetting: Setting; let correctLightsSetting: Setting; let tonemappingSetting: Setting; + let globalMetalnessSetting: Setting; + let globalRoughnessSetting: Setting; let pbrMaterialsProp: Property; let projectMaterialsProp: Property; let projectPbrModeProp: Property; @@ -180,9 +182,9 @@ interface IChannel { normalMap: this.getTexture(CHANNELS.normal), bumpMap: this.getTexture(CHANNELS.height), metalnessMap, - metalness: metalnessMap ? 1 : 0, + metalness: metalnessMap ? Settings.get("global_metalness") : 0, roughnessMap, - roughness: roughnessMap ? 1 : 0, + roughness: roughnessMap ? Settings.get("global_roughness") : 0, emissiveMap, emissiveIntensity: emissiveMap ? 1 : 0, emissive: emissiveMap ? 0xffffff : 0, @@ -1069,6 +1071,30 @@ interface IChannel { }, }); + globalMetalnessSetting = new Setting("global_metalness", { + category: "preview", + name: "Global Metalness", + description: "Adjusts the base metalness of the scene", + type: "number", + default_value: 0, + icon: "iron", + step: 0.01, + min: 0, + max: 1, + }); + + globalRoughnessSetting = new Setting("global_roughness", { + category: "preview", + name: "Global Roughness", + description: "Adjusts the base roughness of the scene", + type: "number", + default_value: 0, + icon: "iron", + step: 0.01, + min: 0, + max: 1, + }); + // // Actions // @@ -1455,11 +1481,12 @@ interface IChannel { toggleCorrectLights?.delete(); correctLightsSetting?.delete(); tonemappingSetting?.delete(); - deactivatePbr?.delete(); unassignChannel?.delete(); projectMaterialsProp?.delete(); pbrMaterialsProp?.delete(); projectPbrModeProp?.delete(); + globalMetalnessSetting?.delete(); + globalRoughnessSetting?.delete(); }; // From d93d643d896f9e3331a8d05a133e31c7b6f37764 Mon Sep 17 00:00:00 2001 From: Jason Gardner Date: Tue, 28 May 2024 11:03:58 -0500 Subject: [PATCH 07/50] feat: New material Action - Created Action which bootstraps a texture into a PBR material with layers pre-assigned to channels - Updated about.md with info on new features --- plugins/pbr_preview/about.md | 21 +++++- plugins/pbr_preview/pbr_preview.js | 2 +- src/pbr_preview/src/index.ts | 106 +++++++++++++++++++++++++++-- 3 files changed, 120 insertions(+), 9 deletions(-) diff --git a/plugins/pbr_preview/about.md b/plugins/pbr_preview/about.md index 161dc8bb..b5b6affa 100644 --- a/plugins/pbr_preview/about.md +++ b/plugins/pbr_preview/about.md @@ -54,13 +54,17 @@ This plugin adds the _PBR Settings_ panel, which controls enabling and disabling ### Channel Management -Control which textures or texture layers are used for PBR channels using the following methods:W +Control which textures or texture layers are used for PBR channels using the following methods: + +#### Create Material Texture + +- Use the _Create Material Texture_ action to create a blank texture with PBR material layers initialized. #### Channel Naming Convention The plugin will assume that textures and layers which end in an underscore and a channel name are intended to be used as that channel. For example, `texture_roughness` will be used as the roughness map unless the channel has been manually assigned a texture. -#### Supported Channels +##### Supported Channels | Channel | Description | Colorspace | |-----------|-------------|------------| | `ao` | Ambient Occlusion | __BW__ | @@ -79,6 +83,17 @@ Create a Texture Layer in Blockbench to enable channel assignment in PBR preview Channels can be disabled by hiding or deleting the layer, or un-assigning the channel in the menu. Texture layers cannot be assigned to more than one channel. Assigning a layer to a new channel will clear the layer's current channel. +### Global Settings + +The following Blockbench settings are added by this plugin: + +#### Global Metalness / Roughness + +- Adjusts the metalness or roughness multiplier used in the PBR Preview scene. + +--- + ## Roadmap - Java project support -- labPBR texture exports \ No newline at end of file +- labPBR texture exports +- Preview scene PostFX \ No newline at end of file diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index 7a84932e..35b37b08 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1 +1 @@ -"use strict";(()=>{(()=>{let j,R,S,L,I,A,H,U,w,O,F,G,C,Q,D,k,J,B,z,X,q,V,K,$={},l="pbr_preview",ae="1.0.0",W="_NONE_",d={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality"},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6"},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight"},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain"},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape"},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks"},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode"}},P=(n=!0)=>{let e=Project?Project.textures??Texture.all:Texture.all;return n?e.filter(t=>t.layers.length>0).flatMap(t=>t.layers):e};class p{constructor(e,t){this._scope=e??P(),this._materialUuid=t}merToCanvas(){let e=this.getTexture(d.emissive),t=this.getTexture(d.roughness),a=this.getTexture(d.metalness);if(!e&&!t&&!a){let{metalness:s,emissive:i,roughness:o}=this.decodeMer();s&&(a=p.makePixelatedCanvas(s)),i&&(e=p.makePixelatedCanvas(i)),o&&(t=p.makePixelatedCanvas(o))}return{emissiveMap:e,roughnessMap:t,metalnessMap:a}}getMaterial(e={}){let{emissiveMap:t,roughnessMap:a,metalnessMap:s}=this.merToCanvas();return new THREE.MeshStandardMaterial({map:this.getTexture(d.albedo)??p.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(i=>i.selected)?.canvas??Texture.all[0].canvas),aoMap:this.getTexture(d.ao),normalMap:this.getTexture(d.normal),bumpMap:this.getTexture(d.height),metalnessMap:s,metalness:s?Settings.get("global_metalness"):0,roughnessMap:a,roughness:a?Settings.get("global_roughness"):0,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:1,alphaTest:.5,...e})}saveTexture(e,{uuid:t,extend:a}){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][e.id]=t,a({channel:e.id}))}findTexture(e,t=!0){if(!Project)return null;let a=this._scope.find(r=>r.channel&&(r.channel===e||r.channel===e.id));if(a)return a;let s=typeof e=="string"?e:e.id;Project.pbr_materials??={};let i=Project.pbr_materials[this._materialUuid];if(!i&&t){let r=new RegExp(`_*${s}(.[^.]+)?$`,"i");return this._scope.find(c=>r.test(c.name))??null}let o=i?.[s];return o?this._scope.find(r=>r.uuid===o)??null:null}static makePixelatedCanvas(e){let t=new THREE.CanvasTexture(e,void 0,void 0,void 0,THREE.NearestFilter,THREE.NearestFilter);return t.needsUpdate=!0,t}getTexture(e){let t=this.findTexture(e);return t?p.makePixelatedCanvas(t.canvas):null}static extractChannel(e,t){let a=e.canvas,s=a.width,i=a.height,o=a.getContext("2d");if(!o||!s||!i)return null;let r=document.createElement("canvas");r.width=s,r.height=i;let c=r.getContext("2d");if(!c)return null;let m={r:0,g:1,b:2,a:3}[t],{data:f}=o.getImageData(0,0,s,i),x=new Uint8ClampedArray(s*i*4);for(let g=0;ge){_[h]=v.data[h],_[h+1]=v.data[h+1],_[h+2]=v.data[h+2],_[h+3]=255;continue}_[h]=0,_[h+1]=0,_[h+2]=0,_[h+3]=255}return m.putImageData(new ImageData(_,r.width,r.height),0,0),{metalness:a,emissive:r,emissiveLevel:s,roughness:i,sss:o}}createMer(e=!1){let t=this.findTexture(d.metalness,e),a=this.findTexture(d.emissive,e),s=this.findTexture(d.roughness,e),i=this.findTexture("sss",!1),o=Math.max(t?.img.width??0,a?.img.width??0,s?.img.width??0,Project?Project.texture_width:0,16),r=Math.max(t?.img.height??0,a?.img.height??0,s?.img.height??0,Project?Project.texture_height:0,16),c=document.createElement("canvas");c.width=o,c.height=r;let m=c.getContext("2d");if(!m)return null;let f=t?.img?p.extractChannel(t,"r"):null,x=a?.img?p.extractChannel(a,"g"):null,v=s?.img?p.extractChannel(s,"b"):null,g=i&&i?.img?p.extractChannel(i,"a"):null,_=f?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),h=x?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),u=v?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(o,r),b=g?.getContext("2d")?.getImageData(0,0,o,r)??new ImageData(new Uint8ClampedArray(o*r*4).fill(255),o,r),M=new Uint8ClampedArray(o*r*4);for(let T=0;T{let M=(u+b*s)*4;return o[M]/255};r.width=s,r.height=i,c.drawImage(e.img,0,0,s,i);let f=c.getImageData(0,0,s,i),x=f.data,v=u=>{let b=Math.sqrt(u[0]*u[0]+u[1]*u[1]+u[2]*u[2]);return[u[0]/b,u[1]/b,u[2]/b]};for(let u=0;ud[n].id),label:"PBR Channel",exposed:!1}),q=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),V=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),K=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"});let Y=n=>{let e=Texture.all.find(a=>a.selected);if(!e)return;let t=new p(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!1);t&&t.toBlob(async a=>{if(!a)return;let[s,i]=Project?[`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await a.arrayBuffer(),type:"PNG",name:s,extensions:["png"],resource_id:"mer",savetype:"image",startpath:i},n)})},y=n=>{if(!Project||Texture.all.length===0)return;let e=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(a=>{let i=t.faces[a].getTexture();if(!i)return;let o=Project.materials[i.uuid];o.isShaderMaterial&&!Project.bb_materials[i.uuid]&&(Project.bb_materials[i.uuid]=o);let r=new p(i.layers_enabled?i.layers.filter(c=>c.visible)??null:Project.textures,i.uuid).getMaterial(n);Project.materials[i.uuid]=THREE.ShaderMaterial.prototype.copy.call(r,o),Canvas.updateAllFaces(i),e=!0})}),Project.pbr_active=e},se=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(n=>{n instanceof Cube&&Object.keys(n.faces).forEach(e=>{let a=n.faces[e].getTexture();if(!a)return;let s=Project.bb_materials[a.uuid];s&&(Project.materials[a.uuid]=s)})}),Project.pbr_active=!1,Canvas.updateAll())},re=()=>{if(!Project)return;let n=P();Project.textures.forEach(e=>{let t=new p(n,e.uuid),a=t.findTexture(d.normal,!1)?.name,s=t.findTexture(d.height,!1)?.name,i=t.findTexture(d.albedo,!1)?.name,o=t.findTexture(d.metalness,!1)?.name,r=t.findTexture(d.emissive,!1)?.name,c=t.findTexture(d.roughness,!1)?.name,m={};return i||(m.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!r&&!c&&(m.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},m.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},m.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),a&&s&&(m.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),w=new Dialog(`${l}_texture_set`,{id:`${l}_texture_set`,title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:m,onConfirm(f){let x=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),v=o||r||c,g={format_version:"1.16.100","minecraft:texture_set":{color:(i?pathToName(i,!1):f.baseColor?.toHexString())??x,metalness_emissive_roughness:[f.metalness??0,f.emissive??0,f.roughness??255]}};f.depthMap==="normal"&&a?g["minecraft:texture_set"].normal=pathToName(a,!1):(!a||f.depthMap==="heightmap")&&s&&(g["minecraft:texture_set"].heightmap=pathToName(s,!1));let _=()=>Blockbench.export({content:JSON.stringify(g,null,2),type:"JSON",name:`${x}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path},()=>{Blockbench.showQuickMessage("Texture set created",2e3),w.hide()});if(v){Y(h=>{g["minecraft:texture_set"].metalness_emissive_roughness=pathToName(h,!1),_()});return}_()},cancelIndex:1}),w.show(),w})},Z=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],ee=()=>Project&&Project.pbr_active&&y(),te=()=>{Z.forEach(n=>{Blockbench.addListener(n,ee)})},ne=()=>{Z.forEach(n=>{Blockbench.removeListener(n,ee)})},ie=()=>{H=new Setting("pbr_active",{category:"preview",name:"Enable PBR Preview",description:"Enables PBR preview in the editor",type:"toggle",default_value:!1,icon:"tonality",launch_setting:!0,onChange(n){if(n){y(),te();return}se(),ne()}}),J=new Setting("display_settings_correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview for PBR materials",type:"toggle",default_value:!1,icon:"light_mode",condition:()=>!!Project,onChange(n){Preview.selected.renderer.physicallyCorrectLights=n,y()}}),B=new Setting("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:THREE.NoToneMapping,value:THREE.NoToneMapping,icon:"palette",options:{[THREE.NoToneMapping]:"None",[THREE.LinearToneMapping]:"Linear",[THREE.ReinhardToneMapping]:"Reinhard",[THREE.CineonToneMapping]:"Cineon",[THREE.ACESFilmicToneMapping]:"ACES"},onChange(n){Preview.selected.renderer.toneMapping=Number(n),y()}}),k=new Setting("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",default_value:1,icon:"exposure",step:.1,min:-2,max:2,onChange(n){Preview.selected.renderer.toneMappingExposure=Math.max(-2,Math.min(2,Number(n)))}}),z=new Setting("global_metalness",{category:"preview",name:"Global Metalness",description:"Adjusts the base metalness of the scene",type:"number",default_value:0,icon:"iron",step:.01,min:0,max:1}),X=new Setting("global_roughness",{category:"preview",name:"Global Roughness",description:"Adjusts the base roughness of the scene",type:"number",default_value:0,icon:"iron",step:.01,min:0,max:1}),L=new Action(`${l}_generate_normal`,{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(n=>n.selected))!==void 0,click(){let n=TextureLayer.selected??Texture.all.find(s=>s.selected),e=new p(P(),n.uuid),t=TextureLayer.selected??Texture.all.find(s=>s.selected)??e.findTexture(d.height,!0);if(!t){Blockbench.showQuickMessage("No height map found",2e3);return}let a=p.createNormalMap(t);if(a){e.saveTexture(d.normal,a),a.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),S=new Action(`${l}_create_mer`,{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",click(){Y()}}),j=new Action(`${l}_decode_mer`,{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",click(){let n=P(),e=TextureLayer.selected?.texture??Texture.all.find(i=>i.selected),t=new p(n,(e??n[0]).uuid),a=t.decodeMer();[d.metalness,d.emissive,d.roughness].forEach((i,o)=>{let r=i.id,c=a[r];if(!c)return;let m=new TextureLayer({name:`${e?.name}_${r}`,data_url:c.toDataURL()},e.layers_enabled?e.texture:e);t.saveTexture(i,m)})}}),R=new Action(`${l}_create_texture_set`,{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){re()}}),Object.entries(d).forEach(([n,e])=>{$[n]=new Action(`${l}_assign_channel_${n}`,{icon:e.icon??"tv_options_edit_channels",name:`Assign to ${e.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${e.label} channel`,category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(t){let a=TextureLayer.selected;if(!a||!Project)return;Undo.initEdit({layers:[a]}),a.extend({channel:n});let s=a.texture;s.updateChangesAfterEdit(),Project.pbr_materials[s.uuid]||(Project.pbr_materials[s.uuid]={}),Object.entries(Project.pbr_materials[s.uuid]).forEach(([i,o])=>{o===a.uuid&&delete Project.pbr_materials[s.uuid][i]}),Project.pbr_materials[s.uuid][n]=a.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${a.name}" to ${e.label} channel`,2e3),y()}})}),I=new Action(`${l}_unassign_channel`,{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",click(){let n=TextureLayer.selected;if(!n||!Project)return;Undo.initEdit({layers:[n]});let{texture:e,channel:t}=n;e.updateChangesAfterEdit(),Project.pbr_materials[e.uuid]={},n.channel=W,Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${n.name}" from ${t} channel`,2e3),y()}}),A=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",linked_setting:"pbr_active",default:!1,click(){},onChange(n){Blockbench.showQuickMessage(`PBR Preview is now ${n?"enabled":"disabled"}`,2e3)}}),D=new Toggle(`${l}_correct_lights`,{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",linked_setting:"display_settings_correct_lights",default:!1,onChange(n){Blockbench.showQuickMessage(`Physically corrected lighting is now ${n?"enabled":"disabled"}`,2e3)},click(){}}),C=new BarSlider(`${l}_exposure`,{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",icon:"exposure",min:-2,max:2,step:.1,value:Settings.get("display_settings_exposure")??1,display_condition:{modes:["edit","paint","animate"],project:!0},onChange({value:n}){k.set(n)}}),C.addLabel(!0,C),F=new Menu(`${l}_channel_menu`,[...Object.keys(d).map(n=>`${l}_assign_channel_${n}`),`${l}_unassign_channel`],{onOpen(){y()}}),G=new Action(`${l}_show_channel_menu`,{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(n){F.open(n)}}),Q=new BarSelect(`${l}_tonemapping`,{category:"preview",name:"Tone Mapping",description:"Select the tone mapping function",icon:"palette",value:THREE.NoToneMapping,linked_setting:"display_settings_tone_mapping",options:{[THREE.NoToneMapping]:{name:"No Tone Mapping",icon:"invert_colors_off"},[THREE.LinearToneMapping]:{name:"Linear",icon:"linear_scale"},[THREE.ReinhardToneMapping]:{name:"Reinhard",icon:"brightness_medium"},[THREE.CineonToneMapping]:{name:"Cineon",icon:"brightness_high"},[THREE.ACESFilmicToneMapping]:{name:"ACES",icon:"brightness_auto"}},onChange({value:n}){B.set(n),y()}}),U=new Panel(`${l}_display_settings`,{name:"PBR Settings",id:`${l}_display_settings_panel`,icon:"display_settings",toolbars:[new Toolbar(`${l}_controls_toolbar`,{id:`${l}_controls_toolbar`,children:["toggle_pbr",`${l}_correct_lights`,`${l}_show_channel_menu`],name:"PBR"}),new Toolbar(`${l}_display_settings_toolbar`,{id:`${l}_display_settings_toolbar`,children:[`${l}_tonemapping`,`${l}_exposure`],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"paint"}),MenuBar.addAction(S,"file.export"),MenuBar.addAction(L,"tools"),MenuBar.addAction(j,"tools"),MenuBar.addAction(R,"file.export"),MenuBar.addAction(A,"view"),MenuBar.addAction(D,"preview"),Object.entries($).forEach(([n,e],t)=>{MenuBar.addAction(e,`image.${t}`)}),te()},oe=()=>{Object.entries($).forEach(([n,e])=>{e.delete()}),MenuBar.removeAction(`file.export.${l}_create_mer`),MenuBar.removeAction(`file.export.${l}_create_texture_set`),MenuBar.removeAction(`tools.${l}_generate_normal`),ne(),U?.delete(),w?.delete(),H?.delete(),S?.delete(),L?.delete(),A?.delete(),j?.delete(),R?.delete(),O?.delete(),G?.delete(),k?.delete(),C?.delete(),Q?.delete(),D?.delete(),J?.delete(),B?.delete(),I?.delete(),V?.delete(),q?.delete(),K?.delete(),z?.delete(),X?.delete()};BBPlugin.register(l,{version:ae,title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.1",onload:ie,onunload:oe})})();})(); +"use strict";(()=>{(()=>{let j,R,L,S,N,I,A,U,O,y,F,G,Q,C,z,D,k,J,$,X,q,V,K,W,B={},l="pbr_preview",se="1.0.0",Y="_NONE_",c={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new THREE.Color(16777215)},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new THREE.Color(0)},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new THREE.Color(0)},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new THREE.Color(16777215)},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new THREE.Color(16777215)},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new THREE.Color("rgb(128, 128, 255)")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new THREE.Color(16777215)}},E=(a=!0)=>{let e=Project?Project.textures??Texture.all:Texture.all;return a?e.filter(t=>t.layers.length>0).flatMap(t=>t.layers):e};class p{constructor(e,t){this._scope=e??E(),this._materialUuid=t}merToCanvas(){let e=this.getTexture(c.emissive),t=this.getTexture(c.roughness),n=this.getTexture(c.metalness);if(!e&&!t&&!n){let{metalness:r,emissive:s,roughness:o}=this.decodeMer();r&&(n=p.makePixelatedCanvas(r)),s&&(e=p.makePixelatedCanvas(s)),o&&(t=p.makePixelatedCanvas(o))}return{emissiveMap:e,roughnessMap:t,metalnessMap:n}}getMaterial(e={}){let{emissiveMap:t,roughnessMap:n,metalnessMap:r}=this.merToCanvas();return new THREE.MeshStandardMaterial({map:this.getTexture(c.albedo)??p.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(s=>s.selected)?.canvas??Texture.all[0].canvas),aoMap:this.getTexture(c.ao),normalMap:this.getTexture(c.normal),bumpMap:this.getTexture(c.height),metalnessMap:r,metalness:r?Settings.get("global_metalness"):0,roughnessMap:n,roughness:n?Settings.get("global_roughness"):0,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:1,alphaTest:.5,...e})}saveTexture(e,{uuid:t,extend:n}){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][e.id]=t,n({channel:e.id}))}findTexture(e,t=!0){if(!Project)return null;let n=this._scope.find(i=>i.channel&&(i.channel===e||i.channel===e.id));if(n)return n;let r=typeof e=="string"?e:e.id;Project.pbr_materials??={};let s=Project.pbr_materials[this._materialUuid];if(!s&&t){let i=new RegExp(`_*${r}(.[^.]+)?$`,"i");return this._scope.find(d=>i.test(d.name))??null}let o=s?.[r];return o?this._scope.find(i=>i.uuid===o)??null:null}static makePixelatedCanvas(e){let t=new THREE.CanvasTexture(e,void 0,void 0,void 0,THREE.NearestFilter,THREE.NearestFilter);return t.needsUpdate=!0,t}getTexture(e){let t=this.findTexture(e);return t?p.makePixelatedCanvas(t.canvas):null}static extractChannel(e,t){let n=e.canvas,r=n.width,s=n.height,o=n.getContext("2d");if(!o||!r||!s)return null;let i=document.createElement("canvas");i.width=r,i.height=s;let d=i.getContext("2d");if(!d)return null;let m={r:0,g:1,b:2,a:3}[t],{data:f}=o.getImageData(0,0,r,s),x=new Uint8ClampedArray(r*s*4);for(let h=0;he){_[g]=T.data[g],_[g+1]=T.data[g+1],_[g+2]=T.data[g+2],_[g+3]=255;continue}_[g]=0,_[g+1]=0,_[g+2]=0,_[g+3]=255}return m.putImageData(new ImageData(_,i.width,i.height),0,0),{metalness:n,emissive:i,emissiveLevel:r,roughness:s,sss:o}}createMer(e=!1){let t=this.findTexture(c.metalness,e),n=this.findTexture(c.emissive,e),r=this.findTexture(c.roughness,e),s=this.findTexture("sss",!1),o=Math.max(t?.img.width??0,n?.img.width??0,r?.img.width??0,Project?Project.texture_width:0,16),i=Math.max(t?.img.height??0,n?.img.height??0,r?.img.height??0,Project?Project.texture_height:0,16),d=document.createElement("canvas");d.width=o,d.height=i;let m=d.getContext("2d");if(!m)return null;let f=t?.img?p.extractChannel(t,"r"):null,x=n?.img?p.extractChannel(n,"g"):null,T=r?.img?p.extractChannel(r,"b"):null,h=s&&s?.img?p.extractChannel(s,"a"):null,_=f?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),g=x?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),u=T?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),b=h?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(new Uint8ClampedArray(o*i*4).fill(255),o,i),w=new Uint8ClampedArray(o*i*4);for(let v=0;v{let w=(u+b*r)*4;return o[w]/255};i.width=r,i.height=s,d.drawImage(e.img,0,0,r,s);let f=d.getImageData(0,0,r,s),x=f.data,T=u=>{let b=Math.sqrt(u[0]*u[0]+u[1]*u[1]+u[2]*u[2]);return[u[0]/b,u[1]/b,u[2]/b]};for(let u=0;uc[a].id),label:"PBR Channel",exposed:!1}),V=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),K=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),W=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"});let Z=a=>{let e=Texture.all.find(n=>n.selected);if(!e)return;let t=new p(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!1);t&&t.toBlob(async n=>{if(!n)return;let[r,s]=Project?[`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:r,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},a)})},M=a=>{if(!Project||Texture.all.length===0)return;let e=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(n=>{let s=t.faces[n].getTexture();if(!s)return;let o=Project.materials[s.uuid];o.isShaderMaterial&&!Project.bb_materials[s.uuid]&&(Project.bb_materials[s.uuid]=o);let i=new p(s.layers_enabled?s.layers.filter(d=>d.visible)??null:Project.textures,s.uuid).getMaterial(a);Project.materials[s.uuid]=THREE.ShaderMaterial.prototype.copy.call(i,o),Canvas.updateAllFaces(s),e=!0})}),Project.pbr_active=e},ie=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(a=>{a instanceof Cube&&Object.keys(a.faces).forEach(e=>{let n=a.faces[e].getTexture();if(!n)return;let r=Project.bb_materials[n.uuid];r&&(Project.materials[n.uuid]=r)})}),Project.pbr_active=!1,Canvas.updateAll())},ee=(a,e)=>{let t=e??document.createElement("canvas"),n=t.getContext("2d");if(!n)return null;let r=Math.max(Project?Project.texture_width:16,16),s=Math.max(Project?Project.texture_height:16,16);return t.width=r,t.height=s,n.fillStyle=`rgb(${a.r*255}, ${a.g*255}, ${a.b*255})`,n.fillRect(0,0,r,s),t.toDataURL()},oe=()=>{if(!Project)return;let a=E();Project.textures.forEach(e=>{let t=new p(a,e.uuid),n=t.findTexture(c.normal,!1)?.name,r=t.findTexture(c.height,!1)?.name,s=t.findTexture(c.albedo,!1)?.name,o=t.findTexture(c.metalness,!1)?.name,i=t.findTexture(c.emissive,!1)?.name,d=t.findTexture(c.roughness,!1)?.name,m={};return s||(m.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!i&&!d&&(m.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},m.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},m.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),n&&r&&(m.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),y=new Dialog(`${l}_texture_set`,{id:`${l}_texture_set`,title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:m,onConfirm(f){let x=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),T=o||i||d,h={format_version:"1.16.100","minecraft:texture_set":{color:(s?pathToName(s,!1):f.baseColor?.toHexString())??x,metalness_emissive_roughness:[f.metalness??0,f.emissive??0,f.roughness??255]}};f.depthMap==="normal"&&n?h["minecraft:texture_set"].normal=pathToName(n,!1):(!n||f.depthMap==="heightmap")&&r&&(h["minecraft:texture_set"].heightmap=pathToName(r,!1));let _=()=>Blockbench.export({content:JSON.stringify(h,null,2),type:"JSON",name:`${x}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path},()=>{Blockbench.showQuickMessage("Texture set created",2e3),y.hide()});if(T){Z(g=>{h["minecraft:texture_set"].metalness_emissive_roughness=pathToName(g,!1),_()});return}_()},cancelIndex:1}),y.show(),y})},te=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],ae=()=>Project&&Project.pbr_active&&M(),ne=()=>{te.forEach(a=>{Blockbench.addListener(a,ae)})},re=()=>{te.forEach(a=>{Blockbench.removeListener(a,ae)})},le=()=>{U=new Setting("pbr_active",{category:"preview",name:"Enable PBR Preview",description:"Enables PBR preview in the editor",type:"toggle",default_value:!1,icon:"tonality",launch_setting:!0,onChange(a){if(a){M(),ne();return}ie(),re()}}),J=new Setting("display_settings_correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview for PBR materials",type:"toggle",default_value:!1,icon:"light_mode",condition:()=>!!Project,onChange(a){Preview.selected.renderer.physicallyCorrectLights=a,M()}}),$=new Setting("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:THREE.NoToneMapping,value:THREE.NoToneMapping,icon:"palette",options:{[THREE.NoToneMapping]:"None",[THREE.LinearToneMapping]:"Linear",[THREE.ReinhardToneMapping]:"Reinhard",[THREE.CineonToneMapping]:"Cineon",[THREE.ACESFilmicToneMapping]:"ACES"},onChange(a){Preview.selected.renderer.toneMapping=Number(a),M()}}),k=new Setting("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",default_value:1,icon:"exposure",step:.1,min:-2,max:2,onChange(a){Preview.selected.renderer.toneMappingExposure=Math.max(-2,Math.min(2,Number(a)))}}),X=new Setting("global_metalness",{category:"preview",name:"Global Metalness",description:"Adjusts the base metalness of the scene",type:"number",default_value:0,icon:"iron",step:.01,min:0,max:1}),q=new Setting("global_roughness",{category:"preview",name:"Global Roughness",description:"Adjusts the base roughness of the scene",type:"number",default_value:0,icon:"iron",step:.01,min:0,max:1}),S=new Action(`${l}_generate_normal`,{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(a=>a.selected))!==void 0,click(){let a=TextureLayer.selected??Texture.all.find(r=>r.selected),e=new p(E(),a.uuid),t=TextureLayer.selected??Texture.all.find(r=>r.selected)??e.findTexture(c.height,!0);if(!t){Blockbench.showQuickMessage("No height map found",2e3);return}let n=p.createNormalMap(t);if(n){e.saveTexture(c.normal,n),n.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),L=new Action(`${l}_create_mer`,{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",click(){Z()}}),j=new Action(`${l}_decode_mer`,{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",click(){let a=E(),e=TextureLayer.selected?.texture??Texture.all.find(s=>s.selected),t=new p(a,(e??a[0]).uuid),n=t.decodeMer();[c.metalness,c.emissive,c.roughness].forEach(s=>{let o=s.id,i=n[o];if(!i)return;let d=new TextureLayer({name:`${e?.name}_${o}`,data_url:i.toDataURL()},e.layers_enabled?e.texture:e);t.saveTexture(s,d)})}}),R=new Action(`${l}_create_texture_set`,{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){oe()}}),I=new Action(`${l}_create_material_texture`,{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",click(){if(!Project)return;let a=new Texture({name:"New Material",saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}),e=ee(new THREE.Color(8421504));e&&(a.fromDataURL(e).add().select(),Object.keys(c).forEach(t=>{let n=c[t],r=new TextureLayer({name:n.label,visible:!0},a);r.setSize(a.width,a.height);let s=ee(n.default??new THREE.Color(0),r.canvas);s&&r.texture.fromDataURL(s),r.extend({channel:t}),a.layers.push(r)}))}}),Object.entries(c).forEach(([a,e])=>{B[a]=new Action(`${l}_assign_channel_${a}`,{icon:e.icon??"tv_options_edit_channels",name:`Assign to ${e.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${e.label} channel`,category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(t){let n=TextureLayer.selected;if(!n||!Project)return;Undo.initEdit({layers:[n]}),n.extend({channel:a});let r=n.texture;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([s,o])=>{o===n.uuid&&delete Project.pbr_materials[r.uuid][s]}),Project.pbr_materials[r.uuid][a]=n.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${n.name}" to ${e.label} channel`,2e3),M()}})}),N=new Action(`${l}_unassign_channel`,{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",click(){let a=TextureLayer.selected;if(!a||!Project)return;Undo.initEdit({layers:[a]});let{texture:e,channel:t}=a;e.updateChangesAfterEdit(),Project.pbr_materials[e.uuid]={},a.channel=Y,Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${a.name}" from ${t} channel`,2e3),M()}}),A=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",linked_setting:"pbr_active",default:!1,click(){},onChange(a){Blockbench.showQuickMessage(`PBR Preview is now ${a?"enabled":"disabled"}`,2e3)}}),D=new Toggle(`${l}_correct_lights`,{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",linked_setting:"display_settings_correct_lights",default:!1,onChange(a){Blockbench.showQuickMessage(`Physically corrected lighting is now ${a?"enabled":"disabled"}`,2e3)},click(){}}),C=new BarSlider(`${l}_exposure`,{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",icon:"exposure",min:-2,max:2,step:.1,value:Settings.get("display_settings_exposure")??1,display_condition:{modes:["edit","paint","animate"],project:!0},onChange({value:a}){k.set(a)}}),C.addLabel(!0,C),G=new Menu(`${l}_channel_menu`,[...Object.keys(c).map(a=>`${l}_assign_channel_${a}`),`${l}_unassign_channel`],{onOpen(){M()}}),Q=new Action(`${l}_show_channel_menu`,{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(a){G.open(a)}}),z=new BarSelect(`${l}_tonemapping`,{category:"preview",name:"Tone Mapping",description:"Select the tone mapping function",icon:"palette",value:THREE.NoToneMapping,linked_setting:"display_settings_tone_mapping",options:{[THREE.NoToneMapping]:{name:"No Tone Mapping",icon:"invert_colors_off"},[THREE.LinearToneMapping]:{name:"Linear",icon:"linear_scale"},[THREE.ReinhardToneMapping]:{name:"Reinhard",icon:"brightness_medium"},[THREE.CineonToneMapping]:{name:"Cineon",icon:"brightness_high"},[THREE.ACESFilmicToneMapping]:{name:"ACES",icon:"brightness_auto"}},onChange({value:a}){$.set(a),M()}}),O=new Panel(`${l}_display_settings`,{name:"PBR Settings",id:`${l}_display_settings_panel`,icon:"display_settings",toolbars:[new Toolbar(`${l}_controls_toolbar`,{id:`${l}_controls_toolbar`,children:["toggle_pbr",`${l}_correct_lights`,`${l}_show_channel_menu`,`${l}_create_material_texture`],name:"PBR"}),new Toolbar(`${l}_display_settings_toolbar`,{id:`${l}_display_settings_toolbar`,children:[`${l}_tonemapping`,`${l}_exposure`],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"paint"}),MenuBar.addAction(L,"file.export"),MenuBar.addAction(S,"tools"),MenuBar.addAction(j,"tools"),MenuBar.addAction(R,"file.export"),MenuBar.addAction(A,"view"),MenuBar.addAction(D,"preview"),Object.entries(B).forEach(([a,e],t)=>{MenuBar.addAction(e,`image.${t}`)}),ne()},ce=()=>{Object.entries(B).forEach(([a,e])=>{e.delete()}),MenuBar.removeAction(`file.export.${l}_create_mer`),MenuBar.removeAction(`file.export.${l}_create_texture_set`),MenuBar.removeAction(`tools.${l}_generate_normal`),re(),O?.delete(),y?.delete(),U?.delete(),I?.delete(),L?.delete(),S?.delete(),A?.delete(),j?.delete(),R?.delete(),F?.delete(),Q?.delete(),k?.delete(),C?.delete(),z?.delete(),D?.delete(),J?.delete(),$?.delete(),N?.delete(),K?.delete(),V?.delete(),W?.delete(),X?.delete(),q?.delete()};BBPlugin.register(l,{version:se,title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.1",onload:le,onunload:ce})})();})(); diff --git a/src/pbr_preview/src/index.ts b/src/pbr_preview/src/index.ts index 6ae6c882..cad407f0 100644 --- a/src/pbr_preview/src/index.ts +++ b/src/pbr_preview/src/index.ts @@ -27,6 +27,7 @@ interface IChannel { map: string; id: string; icon?: string; + default?: THREE.Color; } (() => { @@ -35,6 +36,7 @@ interface IChannel { let generateMer: Action; let generateNormal: Action; let unassignChannel: Action; + let createMaterialTexture: Action; let togglePbr: Toggle; let pbrDisplaySetting: Setting; let displaySettingsPanel: Panel; @@ -66,6 +68,7 @@ interface IChannel { description: "The color of the material", map: "map", icon: "tonality", + default: new THREE.Color(0xffffff), }, metalness: { id: "metalness", @@ -73,6 +76,7 @@ interface IChannel { description: "The material's metalness map", map: "metalnessMap", icon: "brightness_6", + default: new THREE.Color(0), }, emissive: { id: "emissive", @@ -80,6 +84,7 @@ interface IChannel { description: "The material's emissive map", map: "emissiveMap", icon: "wb_twilight", + default: new THREE.Color(0), }, roughness: { id: "roughness", @@ -87,6 +92,7 @@ interface IChannel { description: "The material's roughness map", map: "roughnessMap", icon: "grain", + default: new THREE.Color(0xffffff), }, height: { id: "height", @@ -94,6 +100,7 @@ interface IChannel { description: "The material's height map", map: "bumpMap", icon: "landscape", + default: new THREE.Color(0xffffff), }, normal: { id: "normal", @@ -101,6 +108,7 @@ interface IChannel { description: "The material's normal map", map: "normalMap", icon: "looks", + default: new THREE.Color("rgb(128, 128, 255)"), }, ao: { id: "ao", @@ -108,6 +116,7 @@ interface IChannel { description: "The material's ambient occlusion map", map: "aoMap", icon: "motion_mode", + default: new THREE.Color(0xffffff), }, }; @@ -516,8 +525,16 @@ interface IChannel { return null; } - const width = Math.max(texture.img.width ?? texture.canvas.width, 16); - const height = Math.max(texture.img.height ?? texture.canvas.height, 16); + const width = Math.max( + texture.img.width ?? texture.canvas.width, + Project ? Project.texture_width : 0, + 16, + ); + const height = Math.max( + texture.img.height ?? texture.canvas.height, + Project ? Project.texture_height : 0, + 16, + ); const { data: textureData } = textureCtx.getImageData( 0, @@ -586,7 +603,8 @@ interface IChannel { }, texture.texture, ); - texture.texture.layers.push(normalMapLayer); + + normalMapLayer.addForEditing(); return normalMapLayer; } @@ -595,11 +613,11 @@ interface IChannel { name, saved: false, particle: false, - keep_size: true, + keep_size: false, }).fromDataURL(dataUrl); if (Project) { - Project.textures.push(normalMapTexture); + normalMapTexture.add(); } return normalMapTexture; @@ -778,6 +796,26 @@ interface IChannel { Canvas.updateAll(); }; + const colorDataUrl = (color: THREE.Color, src?: HTMLCanvasElement) => { + const canvas = src ?? document.createElement("canvas"); + const ctx = canvas.getContext("2d"); + + if (!ctx) { + return null; + } + + const width = Math.max(Project ? Project.texture_width : 16, 16); + const height = Math.max(Project ? Project.texture_height : 16, 16); + + canvas.width = width; + canvas.height = height; + + ctx.fillStyle = `rgb(${color.r * 255}, ${color.g * 255}, ${color.b * 255})`; + ctx.fillRect(0, 0, width, height); + + return canvas.toDataURL(); + }; + // // UI Components // @@ -1200,6 +1238,62 @@ interface IChannel { }, }); + createMaterialTexture = new Action(`${PLUGIN_ID}_create_material_texture`, { + icon: "stacks", + name: "Create Material Texture", + description: "Creates a new texture for a PBR material", + click() { + if (!Project) { + return; + } + + const texture = new Texture({ + name: "New Material", + saved: false, + particle: false, + keep_size: false, + layers_enabled: true, + }); + + const filler = colorDataUrl(new THREE.Color(0x808080)); + + if (!filler) { + return; + } + + texture.fromDataURL(filler).add().select(); + // texture.activateLayers(false); + + // Create PBR channels as texture layers for the new texture + Object.keys(CHANNELS).forEach((key) => { + const channel = CHANNELS[key]; + + const layer = new TextureLayer( + { + name: channel.label, + visible: true, + }, + texture, + ); + + layer.setSize(texture.width, texture.height); + + const data = colorDataUrl( + channel.default ?? new THREE.Color(0), + layer.canvas, + ); + + if (data) { + layer.texture.fromDataURL(data); + } + + layer.extend({ channel: key }); + texture.layers.push(layer); + // layer.addForEditing(); + }); + }, + }); + Object.entries(CHANNELS).forEach(([key, channel]) => { channelActions[key] = new Action(`${PLUGIN_ID}_assign_channel_${key}`, { icon: channel.icon ?? "tv_options_edit_channels", @@ -1407,6 +1501,7 @@ interface IChannel { "toggle_pbr", `${PLUGIN_ID}_correct_lights`, `${PLUGIN_ID}_show_channel_menu`, + `${PLUGIN_ID}_create_material_texture`, ], name: "PBR", }), @@ -1468,6 +1563,7 @@ interface IChannel { displaySettingsPanel?.delete(); textureSetDialog?.delete(); pbrDisplaySetting?.delete(); + createMaterialTexture?.delete(); generateMer?.delete(); generateNormal?.delete(); togglePbr?.delete(); From c54e0519367fdb610fcde8687400d0fba836d8da Mon Sep 17 00:00:00 2001 From: Jason Gardner Date: Tue, 28 May 2024 11:51:04 -0500 Subject: [PATCH 08/50] upd: Add normal scale - Set global metalness/roughness to undefined when their maps are not present - Added normal map scale - Changed roughness settings icon --- src/pbr_preview/src/index.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/pbr_preview/src/index.ts b/src/pbr_preview/src/index.ts index cad407f0..b8402b38 100644 --- a/src/pbr_preview/src/index.ts +++ b/src/pbr_preview/src/index.ts @@ -128,7 +128,7 @@ interface IChannel { } return allTextures - .filter((t: Texture) => t.layers.length > 0) + .filter((t: Texture) => t.layers_enabled && t.layers.length > 0) .flatMap((t: Texture) => t.layers); }; @@ -189,11 +189,12 @@ interface IChannel { ), aoMap: this.getTexture(CHANNELS.ao), normalMap: this.getTexture(CHANNELS.normal), + normalScale: new THREE.Vector2(1, 1), bumpMap: this.getTexture(CHANNELS.height), metalnessMap, - metalness: metalnessMap ? Settings.get("global_metalness") : 0, + metalness: metalnessMap ? Settings.get("global_metalness") : undefined, roughnessMap, - roughness: roughnessMap ? Settings.get("global_roughness") : 0, + roughness: roughnessMap ? Settings.get("global_roughness") : undefined, emissiveMap, emissiveIntensity: emissiveMap ? 1 : 0, emissive: emissiveMap ? 0xffffff : 0, @@ -657,7 +658,9 @@ interface IChannel { * @returns void */ const exportMer = (cb?: (filePath: string) => void) => { - const selected = Texture.all.find((t) => t.selected); + const selected = Project + ? Project.selected_texture + : Texture.all.find((t) => t.selected); if (!selected) { return; @@ -1127,7 +1130,7 @@ interface IChannel { description: "Adjusts the base roughness of the scene", type: "number", default_value: 0, - icon: "iron", + icon: "grain", step: 0.01, min: 0, max: 1, From b6bf6dbf42160d00ff3da0d01b9b7bac38bf11da Mon Sep 17 00:00:00 2001 From: Jason Gardner Date: Wed, 29 May 2024 10:49:10 -0500 Subject: [PATCH 09/50] feat: Material brush - Created tool which paints values across multiple layers/channels --- plugins/pbr_preview/pbr_preview.js | 2 +- src/pbr_preview/src/index.ts | 229 ++++++++++++++++++++++++++++- 2 files changed, 229 insertions(+), 2 deletions(-) diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index 35b37b08..228fd3d8 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1 +1 @@ -"use strict";(()=>{(()=>{let j,R,L,S,N,I,A,U,O,y,F,G,Q,C,z,D,k,J,$,X,q,V,K,W,B={},l="pbr_preview",se="1.0.0",Y="_NONE_",c={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new THREE.Color(16777215)},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new THREE.Color(0)},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new THREE.Color(0)},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new THREE.Color(16777215)},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new THREE.Color(16777215)},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new THREE.Color("rgb(128, 128, 255)")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new THREE.Color(16777215)}},E=(a=!0)=>{let e=Project?Project.textures??Texture.all:Texture.all;return a?e.filter(t=>t.layers.length>0).flatMap(t=>t.layers):e};class p{constructor(e,t){this._scope=e??E(),this._materialUuid=t}merToCanvas(){let e=this.getTexture(c.emissive),t=this.getTexture(c.roughness),n=this.getTexture(c.metalness);if(!e&&!t&&!n){let{metalness:r,emissive:s,roughness:o}=this.decodeMer();r&&(n=p.makePixelatedCanvas(r)),s&&(e=p.makePixelatedCanvas(s)),o&&(t=p.makePixelatedCanvas(o))}return{emissiveMap:e,roughnessMap:t,metalnessMap:n}}getMaterial(e={}){let{emissiveMap:t,roughnessMap:n,metalnessMap:r}=this.merToCanvas();return new THREE.MeshStandardMaterial({map:this.getTexture(c.albedo)??p.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(s=>s.selected)?.canvas??Texture.all[0].canvas),aoMap:this.getTexture(c.ao),normalMap:this.getTexture(c.normal),bumpMap:this.getTexture(c.height),metalnessMap:r,metalness:r?Settings.get("global_metalness"):0,roughnessMap:n,roughness:n?Settings.get("global_roughness"):0,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:1,alphaTest:.5,...e})}saveTexture(e,{uuid:t,extend:n}){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][e.id]=t,n({channel:e.id}))}findTexture(e,t=!0){if(!Project)return null;let n=this._scope.find(i=>i.channel&&(i.channel===e||i.channel===e.id));if(n)return n;let r=typeof e=="string"?e:e.id;Project.pbr_materials??={};let s=Project.pbr_materials[this._materialUuid];if(!s&&t){let i=new RegExp(`_*${r}(.[^.]+)?$`,"i");return this._scope.find(d=>i.test(d.name))??null}let o=s?.[r];return o?this._scope.find(i=>i.uuid===o)??null:null}static makePixelatedCanvas(e){let t=new THREE.CanvasTexture(e,void 0,void 0,void 0,THREE.NearestFilter,THREE.NearestFilter);return t.needsUpdate=!0,t}getTexture(e){let t=this.findTexture(e);return t?p.makePixelatedCanvas(t.canvas):null}static extractChannel(e,t){let n=e.canvas,r=n.width,s=n.height,o=n.getContext("2d");if(!o||!r||!s)return null;let i=document.createElement("canvas");i.width=r,i.height=s;let d=i.getContext("2d");if(!d)return null;let m={r:0,g:1,b:2,a:3}[t],{data:f}=o.getImageData(0,0,r,s),x=new Uint8ClampedArray(r*s*4);for(let h=0;he){_[g]=T.data[g],_[g+1]=T.data[g+1],_[g+2]=T.data[g+2],_[g+3]=255;continue}_[g]=0,_[g+1]=0,_[g+2]=0,_[g+3]=255}return m.putImageData(new ImageData(_,i.width,i.height),0,0),{metalness:n,emissive:i,emissiveLevel:r,roughness:s,sss:o}}createMer(e=!1){let t=this.findTexture(c.metalness,e),n=this.findTexture(c.emissive,e),r=this.findTexture(c.roughness,e),s=this.findTexture("sss",!1),o=Math.max(t?.img.width??0,n?.img.width??0,r?.img.width??0,Project?Project.texture_width:0,16),i=Math.max(t?.img.height??0,n?.img.height??0,r?.img.height??0,Project?Project.texture_height:0,16),d=document.createElement("canvas");d.width=o,d.height=i;let m=d.getContext("2d");if(!m)return null;let f=t?.img?p.extractChannel(t,"r"):null,x=n?.img?p.extractChannel(n,"g"):null,T=r?.img?p.extractChannel(r,"b"):null,h=s&&s?.img?p.extractChannel(s,"a"):null,_=f?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),g=x?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),u=T?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),b=h?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(new Uint8ClampedArray(o*i*4).fill(255),o,i),w=new Uint8ClampedArray(o*i*4);for(let v=0;v{let w=(u+b*r)*4;return o[w]/255};i.width=r,i.height=s,d.drawImage(e.img,0,0,r,s);let f=d.getImageData(0,0,r,s),x=f.data,T=u=>{let b=Math.sqrt(u[0]*u[0]+u[1]*u[1]+u[2]*u[2]);return[u[0]/b,u[1]/b,u[2]/b]};for(let u=0;uc[a].id),label:"PBR Channel",exposed:!1}),V=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),K=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),W=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"});let Z=a=>{let e=Texture.all.find(n=>n.selected);if(!e)return;let t=new p(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!1);t&&t.toBlob(async n=>{if(!n)return;let[r,s]=Project?[`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:r,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},a)})},M=a=>{if(!Project||Texture.all.length===0)return;let e=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(n=>{let s=t.faces[n].getTexture();if(!s)return;let o=Project.materials[s.uuid];o.isShaderMaterial&&!Project.bb_materials[s.uuid]&&(Project.bb_materials[s.uuid]=o);let i=new p(s.layers_enabled?s.layers.filter(d=>d.visible)??null:Project.textures,s.uuid).getMaterial(a);Project.materials[s.uuid]=THREE.ShaderMaterial.prototype.copy.call(i,o),Canvas.updateAllFaces(s),e=!0})}),Project.pbr_active=e},ie=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(a=>{a instanceof Cube&&Object.keys(a.faces).forEach(e=>{let n=a.faces[e].getTexture();if(!n)return;let r=Project.bb_materials[n.uuid];r&&(Project.materials[n.uuid]=r)})}),Project.pbr_active=!1,Canvas.updateAll())},ee=(a,e)=>{let t=e??document.createElement("canvas"),n=t.getContext("2d");if(!n)return null;let r=Math.max(Project?Project.texture_width:16,16),s=Math.max(Project?Project.texture_height:16,16);return t.width=r,t.height=s,n.fillStyle=`rgb(${a.r*255}, ${a.g*255}, ${a.b*255})`,n.fillRect(0,0,r,s),t.toDataURL()},oe=()=>{if(!Project)return;let a=E();Project.textures.forEach(e=>{let t=new p(a,e.uuid),n=t.findTexture(c.normal,!1)?.name,r=t.findTexture(c.height,!1)?.name,s=t.findTexture(c.albedo,!1)?.name,o=t.findTexture(c.metalness,!1)?.name,i=t.findTexture(c.emissive,!1)?.name,d=t.findTexture(c.roughness,!1)?.name,m={};return s||(m.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!i&&!d&&(m.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},m.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},m.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),n&&r&&(m.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),y=new Dialog(`${l}_texture_set`,{id:`${l}_texture_set`,title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:m,onConfirm(f){let x=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),T=o||i||d,h={format_version:"1.16.100","minecraft:texture_set":{color:(s?pathToName(s,!1):f.baseColor?.toHexString())??x,metalness_emissive_roughness:[f.metalness??0,f.emissive??0,f.roughness??255]}};f.depthMap==="normal"&&n?h["minecraft:texture_set"].normal=pathToName(n,!1):(!n||f.depthMap==="heightmap")&&r&&(h["minecraft:texture_set"].heightmap=pathToName(r,!1));let _=()=>Blockbench.export({content:JSON.stringify(h,null,2),type:"JSON",name:`${x}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path},()=>{Blockbench.showQuickMessage("Texture set created",2e3),y.hide()});if(T){Z(g=>{h["minecraft:texture_set"].metalness_emissive_roughness=pathToName(g,!1),_()});return}_()},cancelIndex:1}),y.show(),y})},te=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],ae=()=>Project&&Project.pbr_active&&M(),ne=()=>{te.forEach(a=>{Blockbench.addListener(a,ae)})},re=()=>{te.forEach(a=>{Blockbench.removeListener(a,ae)})},le=()=>{U=new Setting("pbr_active",{category:"preview",name:"Enable PBR Preview",description:"Enables PBR preview in the editor",type:"toggle",default_value:!1,icon:"tonality",launch_setting:!0,onChange(a){if(a){M(),ne();return}ie(),re()}}),J=new Setting("display_settings_correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview for PBR materials",type:"toggle",default_value:!1,icon:"light_mode",condition:()=>!!Project,onChange(a){Preview.selected.renderer.physicallyCorrectLights=a,M()}}),$=new Setting("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:THREE.NoToneMapping,value:THREE.NoToneMapping,icon:"palette",options:{[THREE.NoToneMapping]:"None",[THREE.LinearToneMapping]:"Linear",[THREE.ReinhardToneMapping]:"Reinhard",[THREE.CineonToneMapping]:"Cineon",[THREE.ACESFilmicToneMapping]:"ACES"},onChange(a){Preview.selected.renderer.toneMapping=Number(a),M()}}),k=new Setting("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",default_value:1,icon:"exposure",step:.1,min:-2,max:2,onChange(a){Preview.selected.renderer.toneMappingExposure=Math.max(-2,Math.min(2,Number(a)))}}),X=new Setting("global_metalness",{category:"preview",name:"Global Metalness",description:"Adjusts the base metalness of the scene",type:"number",default_value:0,icon:"iron",step:.01,min:0,max:1}),q=new Setting("global_roughness",{category:"preview",name:"Global Roughness",description:"Adjusts the base roughness of the scene",type:"number",default_value:0,icon:"iron",step:.01,min:0,max:1}),S=new Action(`${l}_generate_normal`,{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(a=>a.selected))!==void 0,click(){let a=TextureLayer.selected??Texture.all.find(r=>r.selected),e=new p(E(),a.uuid),t=TextureLayer.selected??Texture.all.find(r=>r.selected)??e.findTexture(c.height,!0);if(!t){Blockbench.showQuickMessage("No height map found",2e3);return}let n=p.createNormalMap(t);if(n){e.saveTexture(c.normal,n),n.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),L=new Action(`${l}_create_mer`,{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",click(){Z()}}),j=new Action(`${l}_decode_mer`,{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",click(){let a=E(),e=TextureLayer.selected?.texture??Texture.all.find(s=>s.selected),t=new p(a,(e??a[0]).uuid),n=t.decodeMer();[c.metalness,c.emissive,c.roughness].forEach(s=>{let o=s.id,i=n[o];if(!i)return;let d=new TextureLayer({name:`${e?.name}_${o}`,data_url:i.toDataURL()},e.layers_enabled?e.texture:e);t.saveTexture(s,d)})}}),R=new Action(`${l}_create_texture_set`,{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){oe()}}),I=new Action(`${l}_create_material_texture`,{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",click(){if(!Project)return;let a=new Texture({name:"New Material",saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}),e=ee(new THREE.Color(8421504));e&&(a.fromDataURL(e).add().select(),Object.keys(c).forEach(t=>{let n=c[t],r=new TextureLayer({name:n.label,visible:!0},a);r.setSize(a.width,a.height);let s=ee(n.default??new THREE.Color(0),r.canvas);s&&r.texture.fromDataURL(s),r.extend({channel:t}),a.layers.push(r)}))}}),Object.entries(c).forEach(([a,e])=>{B[a]=new Action(`${l}_assign_channel_${a}`,{icon:e.icon??"tv_options_edit_channels",name:`Assign to ${e.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${e.label} channel`,category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(t){let n=TextureLayer.selected;if(!n||!Project)return;Undo.initEdit({layers:[n]}),n.extend({channel:a});let r=n.texture;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([s,o])=>{o===n.uuid&&delete Project.pbr_materials[r.uuid][s]}),Project.pbr_materials[r.uuid][a]=n.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${n.name}" to ${e.label} channel`,2e3),M()}})}),N=new Action(`${l}_unassign_channel`,{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",click(){let a=TextureLayer.selected;if(!a||!Project)return;Undo.initEdit({layers:[a]});let{texture:e,channel:t}=a;e.updateChangesAfterEdit(),Project.pbr_materials[e.uuid]={},a.channel=Y,Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${a.name}" from ${t} channel`,2e3),M()}}),A=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",linked_setting:"pbr_active",default:!1,click(){},onChange(a){Blockbench.showQuickMessage(`PBR Preview is now ${a?"enabled":"disabled"}`,2e3)}}),D=new Toggle(`${l}_correct_lights`,{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",linked_setting:"display_settings_correct_lights",default:!1,onChange(a){Blockbench.showQuickMessage(`Physically corrected lighting is now ${a?"enabled":"disabled"}`,2e3)},click(){}}),C=new BarSlider(`${l}_exposure`,{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",icon:"exposure",min:-2,max:2,step:.1,value:Settings.get("display_settings_exposure")??1,display_condition:{modes:["edit","paint","animate"],project:!0},onChange({value:a}){k.set(a)}}),C.addLabel(!0,C),G=new Menu(`${l}_channel_menu`,[...Object.keys(c).map(a=>`${l}_assign_channel_${a}`),`${l}_unassign_channel`],{onOpen(){M()}}),Q=new Action(`${l}_show_channel_menu`,{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(a){G.open(a)}}),z=new BarSelect(`${l}_tonemapping`,{category:"preview",name:"Tone Mapping",description:"Select the tone mapping function",icon:"palette",value:THREE.NoToneMapping,linked_setting:"display_settings_tone_mapping",options:{[THREE.NoToneMapping]:{name:"No Tone Mapping",icon:"invert_colors_off"},[THREE.LinearToneMapping]:{name:"Linear",icon:"linear_scale"},[THREE.ReinhardToneMapping]:{name:"Reinhard",icon:"brightness_medium"},[THREE.CineonToneMapping]:{name:"Cineon",icon:"brightness_high"},[THREE.ACESFilmicToneMapping]:{name:"ACES",icon:"brightness_auto"}},onChange({value:a}){$.set(a),M()}}),O=new Panel(`${l}_display_settings`,{name:"PBR Settings",id:`${l}_display_settings_panel`,icon:"display_settings",toolbars:[new Toolbar(`${l}_controls_toolbar`,{id:`${l}_controls_toolbar`,children:["toggle_pbr",`${l}_correct_lights`,`${l}_show_channel_menu`,`${l}_create_material_texture`],name:"PBR"}),new Toolbar(`${l}_display_settings_toolbar`,{id:`${l}_display_settings_toolbar`,children:[`${l}_tonemapping`,`${l}_exposure`],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"paint"}),MenuBar.addAction(L,"file.export"),MenuBar.addAction(S,"tools"),MenuBar.addAction(j,"tools"),MenuBar.addAction(R,"file.export"),MenuBar.addAction(A,"view"),MenuBar.addAction(D,"preview"),Object.entries(B).forEach(([a,e],t)=>{MenuBar.addAction(e,`image.${t}`)}),ne()},ce=()=>{Object.entries(B).forEach(([a,e])=>{e.delete()}),MenuBar.removeAction(`file.export.${l}_create_mer`),MenuBar.removeAction(`file.export.${l}_create_texture_set`),MenuBar.removeAction(`tools.${l}_generate_normal`),re(),O?.delete(),y?.delete(),U?.delete(),I?.delete(),L?.delete(),S?.delete(),A?.delete(),j?.delete(),R?.delete(),F?.delete(),Q?.delete(),k?.delete(),C?.delete(),z?.delete(),D?.delete(),J?.delete(),$?.delete(),N?.delete(),K?.delete(),V?.delete(),W?.delete(),X?.delete(),q?.delete()};BBPlugin.register(l,{version:se,title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.1",onload:le,onunload:ce})})();})(); +"use strict";(()=>{(()=>{let R,S,A,L,J,k,H,V,X,M,q,K,W,y,Y,B,N,Z,$,ee,te,ne,ae,re,se,D,he,I,U,O,F,G={},c="pbr_preview",me="1.0.0",Q="_NONE_",l={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new THREE.Color(16777215)},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new THREE.Color(0)},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new THREE.Color(0)},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new THREE.Color(16777215)},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new THREE.Color(16777215)},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new THREE.Color("rgb(128, 128, 255)")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new THREE.Color(16777215)}},P=(n=!0)=>{let e=Project?Project.textures??Texture.all:Texture.all;return n?e.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):e};class p{constructor(e,t){this._scope=e??P(),this._materialUuid=t}merToCanvas(){let e=this.getTexture(l.emissive),t=this.getTexture(l.roughness),r=this.getTexture(l.metalness);if(!e&&!t&&!r){let{metalness:a,emissive:s,roughness:o}=this.decodeMer();a&&(r=p.makePixelatedCanvas(a)),s&&(e=p.makePixelatedCanvas(s)),o&&(t=p.makePixelatedCanvas(o))}return{emissiveMap:e,roughnessMap:t,metalnessMap:r}}getMaterial(e={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:a}=this.merToCanvas();return new THREE.MeshStandardMaterial({map:this.getTexture(l.albedo)??p.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(s=>s.selected)?.canvas??Texture.all[0].canvas),aoMap:this.getTexture(l.ao),normalMap:this.getTexture(l.normal),normalScale:new THREE.Vector2(1,1),bumpMap:this.getTexture(l.height),metalnessMap:a,metalness:a?Settings.get("global_metalness"):void 0,roughnessMap:r,roughness:r?Settings.get("global_roughness"):void 0,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:1,alphaTest:.5,...e})}saveTexture(e,{uuid:t,extend:r}){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][e.id]=t,r({channel:e.id}))}findTexture(e,t=!0){if(!Project)return null;let r=this._scope.find(i=>i.channel&&(i.channel===e||i.channel===e.id));if(r)return r;let a=typeof e=="string"?e:e.id;Project.pbr_materials??={};let s=Project.pbr_materials[this._materialUuid];if(!s&&t){let i=new RegExp(`_*${a}(.[^.]+)?$`,"i");return this._scope.find(u=>i.test(u.name))??null}let o=s?.[a];return o?this._scope.find(i=>i.uuid===o)??null:null}static makePixelatedCanvas(e){let t=new THREE.CanvasTexture(e,void 0,void 0,void 0,THREE.NearestFilter,THREE.NearestFilter);return t.needsUpdate=!0,t}getTexture(e){let t=this.findTexture(e);return t?p.makePixelatedCanvas(t.canvas):null}static extractChannel(e,t){let r=e.canvas,a=r.width,s=r.height,o=r.getContext("2d");if(!o||!a||!s)return null;let i=document.createElement("canvas");i.width=a,i.height=s;let u=i.getContext("2d");if(!u)return null;let d={r:0,g:1,b:2,a:3}[t],{data:f}=o.getImageData(0,0,a,s),_=new Uint8ClampedArray(a*s*4);for(let m=0;me){x[g]=T.data[g],x[g+1]=T.data[g+1],x[g+2]=T.data[g+2],x[g+3]=255;continue}x[g]=0,x[g+1]=0,x[g+2]=0,x[g+3]=255}return d.putImageData(new ImageData(x,i.width,i.height),0,0),{metalness:r,emissive:i,emissiveLevel:a,roughness:s,sss:o}}createMer(e=!1){let t=this.findTexture(l.metalness,e),r=this.findTexture(l.emissive,e),a=this.findTexture(l.roughness,e),s=this.findTexture("sss",!1),o=Math.max(t?.img.width??0,r?.img.width??0,a?.img.width??0,Project?Project.texture_width:0,16),i=Math.max(t?.img.height??0,r?.img.height??0,a?.img.height??0,Project?Project.texture_height:0,16),u=document.createElement("canvas");u.width=o,u.height=i;let d=u.getContext("2d");if(!d)return null;let f=t?.img?p.extractChannel(t,"r"):null,_=r?.img?p.extractChannel(r,"g"):null,T=a?.img?p.extractChannel(a,"b"):null,m=s&&s?.img?p.extractChannel(s,"a"):null,x=f?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),g=_?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),h=T?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),b=m?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(new Uint8ClampedArray(o*i*4).fill(255),o,i),C=new Uint8ClampedArray(o*i*4);for(let v=0;v{let C=(h+b*a)*4;return o[C]/255};i.width=a,i.height=s,u.drawImage(e.img,0,0,a,s);let f=u.getImageData(0,0,a,s),_=f.data,T=h=>{let b=Math.sqrt(h[0]*h[0]+h[1]*h[1]+h[2]*h[2]);return[h[0]/b,h[1]/b,h[2]/b]};for(let h=0;h[t,l[t].default??new THREE.Color(4294967040)])),...e}}get colors(){return this._colors}set colors(e){this._colors={...this._colors,...e}}getChannel(e){return this._colors[e]}static makeLinearColor(e){let t=Math.min(1,Math.max(0,e));return new THREE.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let e=Number(I.get()),t=Number(U.get()),r=O.get().toString(),a=Number(F.get()),s=ColorPanel.get(),o={[l.albedo.id]:new THREE.Color(s),[l.metalness.id]:E.makeLinearColor(e),[l.roughness.id]:E.makeLinearColor(t),[l.emissive.id]:new THREE.Color(r??"#000000"),[l.height.id]:E.makeLinearColor(a),[l.normal.id]:l.normal.default??new THREE.Color("#8080ff")};return new E({colors:o})}}q=new Property(TextureLayer,"enum","channel",{default:Q,values:Object.keys(l).map(n=>l[n].id),label:"PBR Channel",exposed:!1}),ne=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),ae=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),re=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"});let ie=n=>{let e=Project?Project.selected_texture:Texture.all.find(r=>r.selected);if(!e)return;let t=new p(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!1);t&&t.toBlob(async r=>{if(!r)return;let[a,s]=Project?[`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await r.arrayBuffer(),type:"PNG",name:a,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},n)})},w=n=>{if(!Project||Texture.all.length===0)return;let e=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(r=>{let s=t.faces[r].getTexture();if(!s)return;let o=Project.materials[s.uuid];o.isShaderMaterial&&!Project.bb_materials[s.uuid]&&(Project.bb_materials[s.uuid]=o);let i=new p(s.layers_enabled?s.layers.filter(u=>u.visible)??null:Project.textures,s.uuid).getMaterial(n);Project.materials[s.uuid]=THREE.ShaderMaterial.prototype.copy.call(i,o),Canvas.updateAllFaces(s),e=!0})}),Project.pbr_active=e},ge=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(n=>{n instanceof Cube&&Object.keys(n.faces).forEach(e=>{let r=n.faces[e].getTexture();if(!r)return;let a=Project.bb_materials[r.uuid];a&&(Project.materials[r.uuid]=a)})}),Project.pbr_active=!1,Canvas.updateAll())},oe=(n,e)=>{let t=e??document.createElement("canvas"),r=t.getContext("2d");if(!r)return null;let a=Math.max(Project?Project.texture_width:16,16),s=Math.max(Project?Project.texture_height:16,16);return t.width=a,t.height=s,r.fillStyle=`rgb(${n.r*255}, ${n.g*255}, ${n.b*255})`,r.fillRect(0,0,a,s),t.toDataURL()},pe=()=>{if(!Project)return;let n=P();Project.textures.forEach(e=>{let t=new p(n,e.uuid),r=t.findTexture(l.normal,!1)?.name,a=t.findTexture(l.height,!1)?.name,s=t.findTexture(l.albedo,!1)?.name,o=t.findTexture(l.metalness,!1)?.name,i=t.findTexture(l.emissive,!1)?.name,u=t.findTexture(l.roughness,!1)?.name,d={};return s||(d.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!i&&!u&&(d.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},d.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},d.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),r&&a&&(d.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),M=new Dialog(`${c}_texture_set`,{id:`${c}_texture_set`,title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:d,onConfirm(f){let _=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),T=o||i||u,m={format_version:"1.16.100","minecraft:texture_set":{color:(s?pathToName(s,!1):f.baseColor?.toHexString())??_,metalness_emissive_roughness:[f.metalness??0,f.emissive??0,f.roughness??255]}};f.depthMap==="normal"&&r?m["minecraft:texture_set"].normal=pathToName(r,!1):(!r||f.depthMap==="heightmap")&&a&&(m["minecraft:texture_set"].heightmap=pathToName(a,!1));let x=()=>Blockbench.export({content:JSON.stringify(m,null,2),type:"JSON",name:`${_}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path},()=>{Blockbench.showQuickMessage("Texture set created",2e3),M.hide()});if(T){ie(g=>{m["minecraft:texture_set"].metalness_emissive_roughness=pathToName(g,!1),x()});return}x()},cancelIndex:1}),M.show(),M})},le=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],ce=()=>Project&&Project.pbr_active&&w(),ue=()=>{le.forEach(n=>{Blockbench.addListener(n,ce)})},de=()=>{le.forEach(n=>{Blockbench.removeListener(n,ce)})},fe=()=>{V=new Setting("pbr_active",{category:"preview",name:"Enable PBR Preview",description:"Enables PBR preview in the editor",type:"toggle",default_value:!1,icon:"tonality",onChange(n){if(n){w(),ue();return}ge(),de()}}),Z=new Setting("display_settings_correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview for PBR materials",type:"toggle",default_value:!1,icon:"light_mode",condition:()=>!!Project,onChange(n){Preview.selected.renderer.physicallyCorrectLights=n,w()}}),$=new Setting("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:THREE.NoToneMapping,value:THREE.NoToneMapping,icon:"palette",options:{[THREE.NoToneMapping]:"None",[THREE.LinearToneMapping]:"Linear",[THREE.ReinhardToneMapping]:"Reinhard",[THREE.CineonToneMapping]:"Cineon",[THREE.ACESFilmicToneMapping]:"ACES"},onChange(n){Preview.selected.renderer.toneMapping=Number(n),w()}}),N=new Setting("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",default_value:1,icon:"exposure",step:.1,min:-2,max:2,onChange(n){Preview.selected.renderer.toneMappingExposure=Math.max(-2,Math.min(2,Number(n)))}}),ee=new Setting("global_metalness",{category:"preview",name:"Global Metalness",description:"Adjusts the base metalness of the scene",type:"number",default_value:0,icon:"iron",step:.01,min:0,max:1}),te=new Setting("global_roughness",{category:"preview",name:"Global Roughness",description:"Adjusts the base roughness of the scene",type:"number",default_value:0,icon:"grain",step:.01,min:0,max:1}),L=new Action(`${c}_generate_normal`,{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(n=>n.selected))!==void 0,click(){let n=TextureLayer.selected??Texture.all.find(a=>a.selected),e=new p(P(),n.uuid),t=TextureLayer.selected??Texture.all.find(a=>a.selected)??e.findTexture(l.height,!0);if(!t){Blockbench.showQuickMessage("No height map found",2e3);return}let r=p.createNormalMap(t);if(r){e.saveTexture(l.normal,r),r.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),A=new Action(`${c}_create_mer`,{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",click(){ie()}}),R=new Action(`${c}_decode_mer`,{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",click(){let n=P(),e=TextureLayer.selected?.texture??Texture.all.find(s=>s.selected),t=new p(n,(e??n[0]).uuid),r=t.decodeMer();[l.metalness,l.emissive,l.roughness].forEach(s=>{let o=s.id,i=r[o];if(!i)return;let u=new TextureLayer({name:`${e?.name}_${o}`,data_url:i.toDataURL()},e.layers_enabled?e.texture:e);t.saveTexture(s,u)})}}),S=new Action(`${c}_create_texture_set`,{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){pe()}}),k=new Action(`${c}_create_material_texture`,{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",click(){if(!Project)return;let n=new Texture({name:"New Material",saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}),e=oe(new THREE.Color(8421504));e&&(n.fromDataURL(e).add().select(),Object.keys(l).forEach(t=>{let r=l[t],a=new TextureLayer({name:r.label,visible:!0},n);a.setSize(n.width,n.height);let s=oe(r.default??new THREE.Color(0),a.canvas);s&&a.texture.fromDataURL(s),a.extend({channel:t}),n.layers.push(a)}))}}),Object.entries(l).forEach(([n,e])=>{G[n]=new Action(`${c}_assign_channel_${n}`,{icon:e.icon??"tv_options_edit_channels",name:`Assign to ${e.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${e.label} channel`,category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(t){let r=TextureLayer.selected;if(!r||!Project)return;Undo.initEdit({layers:[r]}),r.extend({channel:n});let a=r.texture;a.updateChangesAfterEdit(),Project.pbr_materials[a.uuid]||(Project.pbr_materials[a.uuid]={}),Object.entries(Project.pbr_materials[a.uuid]).forEach(([s,o])=>{o===r.uuid&&delete Project.pbr_materials[a.uuid][s]}),Project.pbr_materials[a.uuid][n]=r.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${r.name}" to ${e.label} channel`,2e3),w()}})}),J=new Action(`${c}_unassign_channel`,{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",click(){let n=TextureLayer.selected;if(!n||!Project)return;Undo.initEdit({layers:[n]});let{texture:e,channel:t}=n;e.updateChangesAfterEdit(),Project.pbr_materials[e.uuid]={},n.channel=Q,Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${n.name}" from ${t} channel`,2e3),w()}}),H=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",linked_setting:"pbr_active",default:!1,click(){},onChange(n){Blockbench.showQuickMessage(`PBR Preview is now ${n?"enabled":"disabled"}`,2e3)}}),B=new Toggle(`${c}_correct_lights`,{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",linked_setting:"display_settings_correct_lights",default:!1,onChange(n){Blockbench.showQuickMessage(`Physically corrected lighting is now ${n?"enabled":"disabled"}`,2e3)},click(){}}),y=new BarSlider(`${c}_exposure`,{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",icon:"exposure",min:-2,max:2,step:.1,value:Settings.get("display_settings_exposure")??1,display_condition:{modes:["edit","paint","animate"],project:!0},onChange({value:n}){N.set(n)}}),y.addLabel(!0,y),K=new Menu(`${c}_channel_menu`,[...Object.keys(l).map(n=>`${c}_assign_channel_${n}`),`${c}_unassign_channel`],{onOpen(){w()}}),W=new Action(`${c}_show_channel_menu`,{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(n){K.open(n)}}),Y=new BarSelect(`${c}_tonemapping`,{category:"preview",name:"Tone Mapping",description:"Select the tone mapping function",icon:"palette",value:THREE.NoToneMapping,linked_setting:"display_settings_tone_mapping",options:{[THREE.NoToneMapping]:{name:"No Tone Mapping",icon:"invert_colors_off"},[THREE.LinearToneMapping]:{name:"Linear",icon:"linear_scale"},[THREE.ReinhardToneMapping]:{name:"Reinhard",icon:"brightness_medium"},[THREE.CineonToneMapping]:{name:"Cineon",icon:"brightness_high"},[THREE.ACESFilmicToneMapping]:{name:"ACES",icon:"brightness_auto"}},onChange({value:n}){$.set(n),w()}}),I=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",settings:{min:0,max:1,step:.01},value:0}),U=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",settings:{min:0,max:1,step:.01},value:1}),O=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000"}),F=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",settings:{min:0,max:1,step:.01},value:.5}),D=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",condition:{project:!0,modes:["paint"]},brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(n,e,t,r,{size:a,softness:s,texture:o}){let i=E.fromSettings();return o.layers.filter(({visible:u,channel:d})=>u&&d&&d!==Q).forEach(u=>{let d=i.getChannel(u.channel);d&&(u.ctx.fillStyle=d.getStyle(),u.ctx.fillRect(a*n,a*e,a,a))}),o.updateChangesAfterEdit(),Canvas.updateAllFaces(o),t}},onCanvasClick(n){Painter.startPaintToolCanvas(n,n.event)},onSelect(){w()},click(){w()}}),MenuBar.addAction(D,"tools.0"),X=new Panel(`${c}_display_settings`,{name:"PBR Settings",id:`${c}_display_settings_panel`,icon:"display_settings",toolbars:[new Toolbar(`${c}_controls_toolbar`,{id:`${c}_controls_toolbar`,children:["toggle_pbr",`${c}_correct_lights`,`${c}_show_channel_menu`,`${c}_create_material_texture`],name:"PBR"}),new Toolbar(`${c}_display_settings_toolbar`,{id:`${c}_display_settings_toolbar`,children:[`${c}_tonemapping`,`${c}_exposure`],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"paint",condition:()=>!!Project&&Project.textures.length>0}),se=new Panel(`${c}_material_brush_panel`,{name:"Material Brush",id:`${c}_material_brush_panel`,icon:"view_in_ar",toolbars:[new Toolbar(`${c}_material_brush_toolbar`,{id:`${c}_material_brush_toolbar`,children:["slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Brush"})],display_condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner",condition:()=>!!Project&&Project.textures.length>0}),MenuBar.addAction(A,"file.export"),MenuBar.addAction(L,"tools"),MenuBar.addAction(R,"tools"),MenuBar.addAction(S,"file.export"),MenuBar.addAction(H,"view"),MenuBar.addAction(B,"preview"),MenuBar.addAction(k,"tools"),Object.entries(G).forEach(([n,e],t)=>{MenuBar.addAction(e,`image.${t}`)}),ue()},_e=()=>{Object.entries(G).forEach(([n,e])=>{e.delete()}),MenuBar.removeAction(`file.export.${c}_create_mer`),MenuBar.removeAction(`file.export.${c}_create_texture_set`),MenuBar.removeAction(`tools.${c}_generate_normal`),de(),X?.delete(),M?.delete(),V?.delete(),k?.delete(),A?.delete(),L?.delete(),H?.delete(),R?.delete(),S?.delete(),q?.delete(),W?.delete(),N?.delete(),y?.delete(),Y?.delete(),B?.delete(),Z?.delete(),$?.delete(),J?.delete(),ae?.delete(),ne?.delete(),re?.delete(),ee?.delete(),te?.delete(),D?.delete(),se?.delete(),he?.delete(),I?.delete(),U?.delete(),O?.delete(),F?.delete()};BBPlugin.register(c,{version:me,title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.1",onload:fe,onunload:_e})})();})(); diff --git a/src/pbr_preview/src/index.ts b/src/pbr_preview/src/index.ts index b8402b38..cc7c1100 100644 --- a/src/pbr_preview/src/index.ts +++ b/src/pbr_preview/src/index.ts @@ -55,6 +55,13 @@ interface IChannel { let pbrMaterialsProp: Property; let projectMaterialsProp: Property; let projectPbrModeProp: Property; + let materialBrushPanel: Panel; + let materialBrushTool: Tool; + let setBrushMaterial: Action; + let brushMetalnessSlider: NumSlider; + let brushRoughnessSlider: NumSlider; + let brushEmissiveColor: ColorPicker; + let brushHeightSlider: NumSlider; const channelActions: Record = {}; @@ -136,6 +143,13 @@ interface IChannel { // Classes // + /** + * ### PBR Material + * Class for handling PBR materials in Blockbench + * + * Uses a texture's layers to generate a PBR material, + * or a project's textures if no layers are available. + */ class PbrMaterial { private _scope: Array; private _materialUuid: string; @@ -625,6 +639,65 @@ interface IChannel { } } + /** + * ### Material Brush + * Class for painting across multiple TextureLayers in a Texture + * Used to iterate over PBR channels and apply a brush value to each layer + * at the same UV coordinates + */ + class MaterialBrush { + private _colors: Record; + + constructor({ colors }: { colors?: Record }) { + this._colors = { + ...Object.fromEntries( + Object.keys(CHANNELS).map((key) => [ + key, + CHANNELS[key].default ?? new THREE.Color(0xffffff00), + ]), + ), + ...colors, + }; + } + + get colors() { + return this._colors; + } + + set colors(colors: Record) { + this._colors = { ...this._colors, ...colors }; + } + + getChannel(channel: IChannel["id"]) { + return this._colors[channel]; + } + + static makeLinearColor(value: number) { + const clamped = Math.min(1, Math.max(0, value)); + return new THREE.Color(clamped, clamped, clamped).convertSRGBToLinear(); + } + + static fromSettings() { + const metalnessValue = Number(brushMetalnessSlider.get()); + const roughnessValue = Number(brushRoughnessSlider.get()); + const emissiveValue = brushEmissiveColor.get().toString(); + const heightValue = Number(brushHeightSlider.get()); + const currentColor = ColorPanel.get(); + + const colors = { + [CHANNELS.albedo.id]: new THREE.Color(currentColor), + [CHANNELS.metalness.id]: MaterialBrush.makeLinearColor(metalnessValue), + [CHANNELS.roughness.id]: MaterialBrush.makeLinearColor(roughnessValue), + [CHANNELS.emissive.id]: new THREE.Color(emissiveValue ?? "#000000"), + [CHANNELS.height.id]: MaterialBrush.makeLinearColor(heightValue), + [CHANNELS.normal.id]: + CHANNELS.normal.default ?? new THREE.Color("#8080ff"), + }; + + return new MaterialBrush({ colors }); + } + } + channelProp = new Property(TextureLayer, "enum", "channel", { default: NA_CHANNEL, values: Object.keys(CHANNELS).map((key) => CHANNELS[key].id), @@ -1039,7 +1112,6 @@ interface IChannel { type: "toggle", default_value: false, icon: "tonality", - launch_setting: true, onChange(value) { if (value) { applyPbrMaterial(); @@ -1493,6 +1565,114 @@ interface IChannel { }, }); + // + // Tools + // + + brushMetalnessSlider = new NumSlider("slider_brush_metalness", { + category: "paint", + name: "Metalness", + description: "Adjust the metalness of the brush", + settings: { + min: 0, + max: 1, + step: 0.01, + }, + value: 0, + }); + + brushRoughnessSlider = new NumSlider("slider_brush_roughness", { + category: "paint", + name: "Roughness", + description: "Adjust the roughness of the brush", + settings: { + min: 0, + max: 1, + step: 0.01, + }, + value: 1, + }); + + brushEmissiveColor = new ColorPicker("brush_emissive_color", { + category: "paint", + name: "Emissive", + description: "Adjust the emissive color of the brush", + value: "#000000", + }); + + brushHeightSlider = new NumSlider("slider_brush_height", { + category: "paint", + name: "Height", + description: "Adjust the height of the brush", + settings: { + min: 0, + max: 1, + step: 0.01, + }, + value: 0.5, + }); + + materialBrushTool = new Tool("material_brush", { + name: "Material Brush", + description: "Paints across multiple texture layers", + icon: "view_in_ar", + paintTool: true, + cursor: "cell", + condition: { + project: true, + modes: ["paint"], + }, + brush: { + blend_modes: false, + shapes: true, + size: true, + softness: true, + opacity: true, + offset_even_radius: true, + floor_coordinates: true, + changePixel(x, y, px, alpha, { size, softness, texture }) { + const mat = MaterialBrush.fromSettings(); + + texture.layers + .filter( + ({ visible, channel }) => + visible && channel && channel !== NA_CHANNEL, + ) + .forEach((layer) => { + const fill = mat.getChannel(layer.channel); + + if (!fill) { + return; + } + + layer.ctx.fillStyle = fill.getStyle(); + layer.ctx.fillRect(size * x, size * y, size, size); + }); + + texture.updateChangesAfterEdit(); + + Canvas.updateAllFaces(texture); + + return px; + }, + }, + onCanvasClick(data) { + Painter.startPaintToolCanvas(data, data.event); + }, + onSelect() { + applyPbrMaterial(); + }, + click() { + applyPbrMaterial(); + }, + }); + + MenuBar.addAction(materialBrushTool, "tools.0"); + + // + // UI + // + displaySettingsPanel = new Panel(`${PLUGIN_ID}_display_settings`, { name: "PBR Settings", id: `${PLUGIN_ID}_display_settings_panel`, @@ -1534,6 +1714,45 @@ interface IChannel { }, insert_after: "textures", insert_before: "paint", + condition: () => !!Project && Project.textures.length > 0, + }); + + materialBrushPanel = new Panel(`${PLUGIN_ID}_material_brush_panel`, { + name: "Material Brush", + id: `${PLUGIN_ID}_material_brush_panel`, + icon: "view_in_ar", + toolbars: [ + new Toolbar(`${PLUGIN_ID}_material_brush_toolbar`, { + id: `${PLUGIN_ID}_material_brush_toolbar`, + children: [ + "slider_brush_metalness", + "slider_brush_roughness", + "brush_emissive_color", + "slider_brush_height", + ], + name: "Material Brush", + }), + ], + display_condition: { + modes: ["paint"], + project: true, + }, + component: {}, + expand_button: true, + growable: false, + onFold() {}, + onResize() {}, + default_side: "right", + default_position: { + slot: "right_bar", + float_position: [0, 0], + float_size: [400, 300], + height: 300, + folded: false, + }, + insert_after: "color", + insert_before: "outliner", + condition: () => !!Project && Project.textures.length > 0, }); MenuBar.addAction(generateMer, "file.export"); @@ -1542,6 +1761,7 @@ interface IChannel { MenuBar.addAction(createTextureSet, "file.export"); MenuBar.addAction(togglePbr, "view"); MenuBar.addAction(toggleCorrectLights, "preview"); + MenuBar.addAction(createMaterialTexture, "tools"); Object.entries(channelActions).forEach(([key, action], idx) => { MenuBar.addAction(action, `image.${idx}`); @@ -1586,6 +1806,13 @@ interface IChannel { projectPbrModeProp?.delete(); globalMetalnessSetting?.delete(); globalRoughnessSetting?.delete(); + materialBrushTool?.delete(); + materialBrushPanel?.delete(); + setBrushMaterial?.delete(); + brushMetalnessSlider?.delete(); + brushRoughnessSlider?.delete(); + brushEmissiveColor?.delete(); + brushHeightSlider?.delete(); }; // From 41f7cad1d39546121e421230700f2bdf66d6425a Mon Sep 17 00:00:00 2001 From: Jason Gardner Date: Wed, 29 May 2024 11:25:52 -0500 Subject: [PATCH 10/50] upd: Change display conditions - Remove extra UI elements - Fixed create material texture layer assignment --- plugins/pbr_preview/pbr_preview.js | 2 +- src/pbr_preview/src/index.ts | 98 +++++------------------------- 2 files changed, 16 insertions(+), 84 deletions(-) diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index 228fd3d8..a234f842 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1 +1 @@ -"use strict";(()=>{(()=>{let R,S,A,L,J,k,H,V,X,M,q,K,W,y,Y,B,N,Z,$,ee,te,ne,ae,re,se,D,he,I,U,O,F,G={},c="pbr_preview",me="1.0.0",Q="_NONE_",l={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new THREE.Color(16777215)},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new THREE.Color(0)},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new THREE.Color(0)},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new THREE.Color(16777215)},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new THREE.Color(16777215)},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new THREE.Color("rgb(128, 128, 255)")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new THREE.Color(16777215)}},P=(n=!0)=>{let e=Project?Project.textures??Texture.all:Texture.all;return n?e.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):e};class p{constructor(e,t){this._scope=e??P(),this._materialUuid=t}merToCanvas(){let e=this.getTexture(l.emissive),t=this.getTexture(l.roughness),r=this.getTexture(l.metalness);if(!e&&!t&&!r){let{metalness:a,emissive:s,roughness:o}=this.decodeMer();a&&(r=p.makePixelatedCanvas(a)),s&&(e=p.makePixelatedCanvas(s)),o&&(t=p.makePixelatedCanvas(o))}return{emissiveMap:e,roughnessMap:t,metalnessMap:r}}getMaterial(e={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:a}=this.merToCanvas();return new THREE.MeshStandardMaterial({map:this.getTexture(l.albedo)??p.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(s=>s.selected)?.canvas??Texture.all[0].canvas),aoMap:this.getTexture(l.ao),normalMap:this.getTexture(l.normal),normalScale:new THREE.Vector2(1,1),bumpMap:this.getTexture(l.height),metalnessMap:a,metalness:a?Settings.get("global_metalness"):void 0,roughnessMap:r,roughness:r?Settings.get("global_roughness"):void 0,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:1,alphaTest:.5,...e})}saveTexture(e,{uuid:t,extend:r}){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][e.id]=t,r({channel:e.id}))}findTexture(e,t=!0){if(!Project)return null;let r=this._scope.find(i=>i.channel&&(i.channel===e||i.channel===e.id));if(r)return r;let a=typeof e=="string"?e:e.id;Project.pbr_materials??={};let s=Project.pbr_materials[this._materialUuid];if(!s&&t){let i=new RegExp(`_*${a}(.[^.]+)?$`,"i");return this._scope.find(u=>i.test(u.name))??null}let o=s?.[a];return o?this._scope.find(i=>i.uuid===o)??null:null}static makePixelatedCanvas(e){let t=new THREE.CanvasTexture(e,void 0,void 0,void 0,THREE.NearestFilter,THREE.NearestFilter);return t.needsUpdate=!0,t}getTexture(e){let t=this.findTexture(e);return t?p.makePixelatedCanvas(t.canvas):null}static extractChannel(e,t){let r=e.canvas,a=r.width,s=r.height,o=r.getContext("2d");if(!o||!a||!s)return null;let i=document.createElement("canvas");i.width=a,i.height=s;let u=i.getContext("2d");if(!u)return null;let d={r:0,g:1,b:2,a:3}[t],{data:f}=o.getImageData(0,0,a,s),_=new Uint8ClampedArray(a*s*4);for(let m=0;me){x[g]=T.data[g],x[g+1]=T.data[g+1],x[g+2]=T.data[g+2],x[g+3]=255;continue}x[g]=0,x[g+1]=0,x[g+2]=0,x[g+3]=255}return d.putImageData(new ImageData(x,i.width,i.height),0,0),{metalness:r,emissive:i,emissiveLevel:a,roughness:s,sss:o}}createMer(e=!1){let t=this.findTexture(l.metalness,e),r=this.findTexture(l.emissive,e),a=this.findTexture(l.roughness,e),s=this.findTexture("sss",!1),o=Math.max(t?.img.width??0,r?.img.width??0,a?.img.width??0,Project?Project.texture_width:0,16),i=Math.max(t?.img.height??0,r?.img.height??0,a?.img.height??0,Project?Project.texture_height:0,16),u=document.createElement("canvas");u.width=o,u.height=i;let d=u.getContext("2d");if(!d)return null;let f=t?.img?p.extractChannel(t,"r"):null,_=r?.img?p.extractChannel(r,"g"):null,T=a?.img?p.extractChannel(a,"b"):null,m=s&&s?.img?p.extractChannel(s,"a"):null,x=f?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),g=_?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),h=T?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),b=m?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(new Uint8ClampedArray(o*i*4).fill(255),o,i),C=new Uint8ClampedArray(o*i*4);for(let v=0;v{let C=(h+b*a)*4;return o[C]/255};i.width=a,i.height=s,u.drawImage(e.img,0,0,a,s);let f=u.getImageData(0,0,a,s),_=f.data,T=h=>{let b=Math.sqrt(h[0]*h[0]+h[1]*h[1]+h[2]*h[2]);return[h[0]/b,h[1]/b,h[2]/b]};for(let h=0;h[t,l[t].default??new THREE.Color(4294967040)])),...e}}get colors(){return this._colors}set colors(e){this._colors={...this._colors,...e}}getChannel(e){return this._colors[e]}static makeLinearColor(e){let t=Math.min(1,Math.max(0,e));return new THREE.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let e=Number(I.get()),t=Number(U.get()),r=O.get().toString(),a=Number(F.get()),s=ColorPanel.get(),o={[l.albedo.id]:new THREE.Color(s),[l.metalness.id]:E.makeLinearColor(e),[l.roughness.id]:E.makeLinearColor(t),[l.emissive.id]:new THREE.Color(r??"#000000"),[l.height.id]:E.makeLinearColor(a),[l.normal.id]:l.normal.default??new THREE.Color("#8080ff")};return new E({colors:o})}}q=new Property(TextureLayer,"enum","channel",{default:Q,values:Object.keys(l).map(n=>l[n].id),label:"PBR Channel",exposed:!1}),ne=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),ae=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),re=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"});let ie=n=>{let e=Project?Project.selected_texture:Texture.all.find(r=>r.selected);if(!e)return;let t=new p(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!1);t&&t.toBlob(async r=>{if(!r)return;let[a,s]=Project?[`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await r.arrayBuffer(),type:"PNG",name:a,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},n)})},w=n=>{if(!Project||Texture.all.length===0)return;let e=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(r=>{let s=t.faces[r].getTexture();if(!s)return;let o=Project.materials[s.uuid];o.isShaderMaterial&&!Project.bb_materials[s.uuid]&&(Project.bb_materials[s.uuid]=o);let i=new p(s.layers_enabled?s.layers.filter(u=>u.visible)??null:Project.textures,s.uuid).getMaterial(n);Project.materials[s.uuid]=THREE.ShaderMaterial.prototype.copy.call(i,o),Canvas.updateAllFaces(s),e=!0})}),Project.pbr_active=e},ge=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(n=>{n instanceof Cube&&Object.keys(n.faces).forEach(e=>{let r=n.faces[e].getTexture();if(!r)return;let a=Project.bb_materials[r.uuid];a&&(Project.materials[r.uuid]=a)})}),Project.pbr_active=!1,Canvas.updateAll())},oe=(n,e)=>{let t=e??document.createElement("canvas"),r=t.getContext("2d");if(!r)return null;let a=Math.max(Project?Project.texture_width:16,16),s=Math.max(Project?Project.texture_height:16,16);return t.width=a,t.height=s,r.fillStyle=`rgb(${n.r*255}, ${n.g*255}, ${n.b*255})`,r.fillRect(0,0,a,s),t.toDataURL()},pe=()=>{if(!Project)return;let n=P();Project.textures.forEach(e=>{let t=new p(n,e.uuid),r=t.findTexture(l.normal,!1)?.name,a=t.findTexture(l.height,!1)?.name,s=t.findTexture(l.albedo,!1)?.name,o=t.findTexture(l.metalness,!1)?.name,i=t.findTexture(l.emissive,!1)?.name,u=t.findTexture(l.roughness,!1)?.name,d={};return s||(d.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!i&&!u&&(d.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},d.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},d.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),r&&a&&(d.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),M=new Dialog(`${c}_texture_set`,{id:`${c}_texture_set`,title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:d,onConfirm(f){let _=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),T=o||i||u,m={format_version:"1.16.100","minecraft:texture_set":{color:(s?pathToName(s,!1):f.baseColor?.toHexString())??_,metalness_emissive_roughness:[f.metalness??0,f.emissive??0,f.roughness??255]}};f.depthMap==="normal"&&r?m["minecraft:texture_set"].normal=pathToName(r,!1):(!r||f.depthMap==="heightmap")&&a&&(m["minecraft:texture_set"].heightmap=pathToName(a,!1));let x=()=>Blockbench.export({content:JSON.stringify(m,null,2),type:"JSON",name:`${_}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path},()=>{Blockbench.showQuickMessage("Texture set created",2e3),M.hide()});if(T){ie(g=>{m["minecraft:texture_set"].metalness_emissive_roughness=pathToName(g,!1),x()});return}x()},cancelIndex:1}),M.show(),M})},le=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],ce=()=>Project&&Project.pbr_active&&w(),ue=()=>{le.forEach(n=>{Blockbench.addListener(n,ce)})},de=()=>{le.forEach(n=>{Blockbench.removeListener(n,ce)})},fe=()=>{V=new Setting("pbr_active",{category:"preview",name:"Enable PBR Preview",description:"Enables PBR preview in the editor",type:"toggle",default_value:!1,icon:"tonality",onChange(n){if(n){w(),ue();return}ge(),de()}}),Z=new Setting("display_settings_correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview for PBR materials",type:"toggle",default_value:!1,icon:"light_mode",condition:()=>!!Project,onChange(n){Preview.selected.renderer.physicallyCorrectLights=n,w()}}),$=new Setting("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:THREE.NoToneMapping,value:THREE.NoToneMapping,icon:"palette",options:{[THREE.NoToneMapping]:"None",[THREE.LinearToneMapping]:"Linear",[THREE.ReinhardToneMapping]:"Reinhard",[THREE.CineonToneMapping]:"Cineon",[THREE.ACESFilmicToneMapping]:"ACES"},onChange(n){Preview.selected.renderer.toneMapping=Number(n),w()}}),N=new Setting("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",default_value:1,icon:"exposure",step:.1,min:-2,max:2,onChange(n){Preview.selected.renderer.toneMappingExposure=Math.max(-2,Math.min(2,Number(n)))}}),ee=new Setting("global_metalness",{category:"preview",name:"Global Metalness",description:"Adjusts the base metalness of the scene",type:"number",default_value:0,icon:"iron",step:.01,min:0,max:1}),te=new Setting("global_roughness",{category:"preview",name:"Global Roughness",description:"Adjusts the base roughness of the scene",type:"number",default_value:0,icon:"grain",step:.01,min:0,max:1}),L=new Action(`${c}_generate_normal`,{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(n=>n.selected))!==void 0,click(){let n=TextureLayer.selected??Texture.all.find(a=>a.selected),e=new p(P(),n.uuid),t=TextureLayer.selected??Texture.all.find(a=>a.selected)??e.findTexture(l.height,!0);if(!t){Blockbench.showQuickMessage("No height map found",2e3);return}let r=p.createNormalMap(t);if(r){e.saveTexture(l.normal,r),r.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),A=new Action(`${c}_create_mer`,{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",click(){ie()}}),R=new Action(`${c}_decode_mer`,{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",click(){let n=P(),e=TextureLayer.selected?.texture??Texture.all.find(s=>s.selected),t=new p(n,(e??n[0]).uuid),r=t.decodeMer();[l.metalness,l.emissive,l.roughness].forEach(s=>{let o=s.id,i=r[o];if(!i)return;let u=new TextureLayer({name:`${e?.name}_${o}`,data_url:i.toDataURL()},e.layers_enabled?e.texture:e);t.saveTexture(s,u)})}}),S=new Action(`${c}_create_texture_set`,{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){pe()}}),k=new Action(`${c}_create_material_texture`,{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",click(){if(!Project)return;let n=new Texture({name:"New Material",saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}),e=oe(new THREE.Color(8421504));e&&(n.fromDataURL(e).add().select(),Object.keys(l).forEach(t=>{let r=l[t],a=new TextureLayer({name:r.label,visible:!0},n);a.setSize(n.width,n.height);let s=oe(r.default??new THREE.Color(0),a.canvas);s&&a.texture.fromDataURL(s),a.extend({channel:t}),n.layers.push(a)}))}}),Object.entries(l).forEach(([n,e])=>{G[n]=new Action(`${c}_assign_channel_${n}`,{icon:e.icon??"tv_options_edit_channels",name:`Assign to ${e.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${e.label} channel`,category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(t){let r=TextureLayer.selected;if(!r||!Project)return;Undo.initEdit({layers:[r]}),r.extend({channel:n});let a=r.texture;a.updateChangesAfterEdit(),Project.pbr_materials[a.uuid]||(Project.pbr_materials[a.uuid]={}),Object.entries(Project.pbr_materials[a.uuid]).forEach(([s,o])=>{o===r.uuid&&delete Project.pbr_materials[a.uuid][s]}),Project.pbr_materials[a.uuid][n]=r.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${r.name}" to ${e.label} channel`,2e3),w()}})}),J=new Action(`${c}_unassign_channel`,{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",click(){let n=TextureLayer.selected;if(!n||!Project)return;Undo.initEdit({layers:[n]});let{texture:e,channel:t}=n;e.updateChangesAfterEdit(),Project.pbr_materials[e.uuid]={},n.channel=Q,Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${n.name}" from ${t} channel`,2e3),w()}}),H=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",linked_setting:"pbr_active",default:!1,click(){},onChange(n){Blockbench.showQuickMessage(`PBR Preview is now ${n?"enabled":"disabled"}`,2e3)}}),B=new Toggle(`${c}_correct_lights`,{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",linked_setting:"display_settings_correct_lights",default:!1,onChange(n){Blockbench.showQuickMessage(`Physically corrected lighting is now ${n?"enabled":"disabled"}`,2e3)},click(){}}),y=new BarSlider(`${c}_exposure`,{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",icon:"exposure",min:-2,max:2,step:.1,value:Settings.get("display_settings_exposure")??1,display_condition:{modes:["edit","paint","animate"],project:!0},onChange({value:n}){N.set(n)}}),y.addLabel(!0,y),K=new Menu(`${c}_channel_menu`,[...Object.keys(l).map(n=>`${c}_assign_channel_${n}`),`${c}_unassign_channel`],{onOpen(){w()}}),W=new Action(`${c}_show_channel_menu`,{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(n){K.open(n)}}),Y=new BarSelect(`${c}_tonemapping`,{category:"preview",name:"Tone Mapping",description:"Select the tone mapping function",icon:"palette",value:THREE.NoToneMapping,linked_setting:"display_settings_tone_mapping",options:{[THREE.NoToneMapping]:{name:"No Tone Mapping",icon:"invert_colors_off"},[THREE.LinearToneMapping]:{name:"Linear",icon:"linear_scale"},[THREE.ReinhardToneMapping]:{name:"Reinhard",icon:"brightness_medium"},[THREE.CineonToneMapping]:{name:"Cineon",icon:"brightness_high"},[THREE.ACESFilmicToneMapping]:{name:"ACES",icon:"brightness_auto"}},onChange({value:n}){$.set(n),w()}}),I=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",settings:{min:0,max:1,step:.01},value:0}),U=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",settings:{min:0,max:1,step:.01},value:1}),O=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000"}),F=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",settings:{min:0,max:1,step:.01},value:.5}),D=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",condition:{project:!0,modes:["paint"]},brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(n,e,t,r,{size:a,softness:s,texture:o}){let i=E.fromSettings();return o.layers.filter(({visible:u,channel:d})=>u&&d&&d!==Q).forEach(u=>{let d=i.getChannel(u.channel);d&&(u.ctx.fillStyle=d.getStyle(),u.ctx.fillRect(a*n,a*e,a,a))}),o.updateChangesAfterEdit(),Canvas.updateAllFaces(o),t}},onCanvasClick(n){Painter.startPaintToolCanvas(n,n.event)},onSelect(){w()},click(){w()}}),MenuBar.addAction(D,"tools.0"),X=new Panel(`${c}_display_settings`,{name:"PBR Settings",id:`${c}_display_settings_panel`,icon:"display_settings",toolbars:[new Toolbar(`${c}_controls_toolbar`,{id:`${c}_controls_toolbar`,children:["toggle_pbr",`${c}_correct_lights`,`${c}_show_channel_menu`,`${c}_create_material_texture`],name:"PBR"}),new Toolbar(`${c}_display_settings_toolbar`,{id:`${c}_display_settings_toolbar`,children:[`${c}_tonemapping`,`${c}_exposure`],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"paint",condition:()=>!!Project&&Project.textures.length>0}),se=new Panel(`${c}_material_brush_panel`,{name:"Material Brush",id:`${c}_material_brush_panel`,icon:"view_in_ar",toolbars:[new Toolbar(`${c}_material_brush_toolbar`,{id:`${c}_material_brush_toolbar`,children:["slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Brush"})],display_condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner",condition:()=>!!Project&&Project.textures.length>0}),MenuBar.addAction(A,"file.export"),MenuBar.addAction(L,"tools"),MenuBar.addAction(R,"tools"),MenuBar.addAction(S,"file.export"),MenuBar.addAction(H,"view"),MenuBar.addAction(B,"preview"),MenuBar.addAction(k,"tools"),Object.entries(G).forEach(([n,e],t)=>{MenuBar.addAction(e,`image.${t}`)}),ue()},_e=()=>{Object.entries(G).forEach(([n,e])=>{e.delete()}),MenuBar.removeAction(`file.export.${c}_create_mer`),MenuBar.removeAction(`file.export.${c}_create_texture_set`),MenuBar.removeAction(`tools.${c}_generate_normal`),de(),X?.delete(),M?.delete(),V?.delete(),k?.delete(),A?.delete(),L?.delete(),H?.delete(),R?.delete(),S?.delete(),q?.delete(),W?.delete(),N?.delete(),y?.delete(),Y?.delete(),B?.delete(),Z?.delete(),$?.delete(),J?.delete(),ae?.delete(),ne?.delete(),re?.delete(),ee?.delete(),te?.delete(),D?.delete(),se?.delete(),he?.delete(),I?.delete(),U?.delete(),O?.delete(),F?.delete()};BBPlugin.register(c,{version:me,title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.1",onload:fe,onunload:_e})})();})(); +"use strict";(()=>{(()=>{let j,R,S,A,G,L,k,Q,z,M,J,V,X,ue,de,D,q,K,W,Y,Z,ee,te,ae,ne,B,he,N,H,$,I,U={},u="pbr_preview",me="1.0.0",O="_NONE_",l={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new THREE.Color(16777215)},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new THREE.Color(0)},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new THREE.Color(0)},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new THREE.Color(16777215)},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new THREE.Color(16777215)},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new THREE.Color("rgb(128, 128, 255)")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new THREE.Color(16777215)}},y=(n=!0)=>{let e=Project?Project.textures??Texture.all:Texture.all;return n?e.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):e};class p{constructor(e,t){this._scope=e??y(),this._materialUuid=t}merToCanvas(){let e=this.getTexture(l.emissive),t=this.getTexture(l.roughness),r=this.getTexture(l.metalness);if(!e&&!t&&!r){let{metalness:a,emissive:s,roughness:o}=this.decodeMer();a&&(r=p.makePixelatedCanvas(a)),s&&(e=p.makePixelatedCanvas(s)),o&&(t=p.makePixelatedCanvas(o))}return{emissiveMap:e,roughnessMap:t,metalnessMap:r}}getMaterial(e={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:a}=this.merToCanvas();return new THREE.MeshStandardMaterial({map:this.getTexture(l.albedo)??p.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(s=>s.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(l.ao),normalMap:this.getTexture(l.normal),normalScale:new THREE.Vector2(1,1),bumpMap:this.getTexture(l.height),metalnessMap:a,metalness:a?Settings.get("global_metalness"):void 0,roughnessMap:r,roughness:r?Settings.get("global_roughness"):void 0,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:1,alphaTest:.5,...e})}saveTexture(e,{uuid:t,extend:r}){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][e.id]=t,r({channel:e.id}))}findTexture(e,t=!0){if(!Project)return null;let r=this._scope.find(i=>i.channel&&(i.channel===e||i.channel===e.id));if(r)return r;let a=typeof e=="string"?e:e.id;Project.pbr_materials??={};let s=Project.pbr_materials[this._materialUuid];if(!s&&t){let i=new RegExp(`_*${a}(.[^.]+)?$`,"i");return this._scope.find(c=>i.test(c.name))??null}let o=s?.[a];return o?this._scope.find(i=>i.uuid===o)??null:null}static makePixelatedCanvas(e){let t=new THREE.CanvasTexture(e,void 0,void 0,void 0,THREE.NearestFilter,THREE.NearestFilter);return t.needsUpdate=!0,t}getTexture(e){let t=this.findTexture(e);return t?p.makePixelatedCanvas(t.canvas):null}static extractChannel(e,t){let r=e.canvas,a=r.width,s=r.height,o=r.getContext("2d");if(!o||!a||!s)return null;let i=document.createElement("canvas");i.width=a,i.height=s;let c=i.getContext("2d");if(!c)return null;let d={r:0,g:1,b:2,a:3}[t],{data:f}=o.getImageData(0,0,a,s),x=new Uint8ClampedArray(a*s*4);for(let m=0;me){_[g]=v.data[g],_[g+1]=v.data[g+1],_[g+2]=v.data[g+2],_[g+3]=255;continue}_[g]=0,_[g+1]=0,_[g+2]=0,_[g+3]=255}return d.putImageData(new ImageData(_,i.width,i.height),0,0),{metalness:r,emissive:i,emissiveLevel:a,roughness:s,sss:o}}createMer(e=!1){let t=this.findTexture(l.metalness,e),r=this.findTexture(l.emissive,e),a=this.findTexture(l.roughness,e),s=this.findTexture("sss",!1),o=Math.max(t?.img.width??0,r?.img.width??0,a?.img.width??0,Project?Project.texture_width:0,16),i=Math.max(t?.img.height??0,r?.img.height??0,a?.img.height??0,Project?Project.texture_height:0,16),c=document.createElement("canvas");c.width=o,c.height=i;let d=c.getContext("2d");if(!d)return null;let f=t?.img?p.extractChannel(t,"r"):null,x=r?.img?p.extractChannel(r,"g"):null,v=a?.img?p.extractChannel(a,"b"):null,m=s&&s?.img?p.extractChannel(s,"a"):null,_=f?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),g=x?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),h=v?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),b=m?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(new Uint8ClampedArray(o*i*4).fill(255),o,i),C=new Uint8ClampedArray(o*i*4);for(let T=0;T{let C=(h+b*a)*4;return o[C]/255};i.width=a,i.height=s,c.drawImage(e.img,0,0,a,s);let f=c.getImageData(0,0,a,s),x=f.data,v=h=>{let b=Math.sqrt(h[0]*h[0]+h[1]*h[1]+h[2]*h[2]);return[h[0]/b,h[1]/b,h[2]/b]};for(let h=0;h[t,l[t].default??new THREE.Color(4294967040)])),...e}}get colors(){return this._colors}set colors(e){this._colors={...this._colors,...e}}getChannel(e){return this._colors[e]}static makeLinearColor(e){let t=Math.min(1,Math.max(0,e));return new THREE.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let e=Number(N.get()),t=Number(H.get()),r=$.get().toString(),a=Number(I.get()),s=ColorPanel.get(),o={[l.albedo.id]:new THREE.Color(s),[l.metalness.id]:E.makeLinearColor(e),[l.roughness.id]:E.makeLinearColor(t),[l.emissive.id]:new THREE.Color(r??"#000000"),[l.height.id]:E.makeLinearColor(a),[l.normal.id]:l.normal.default??new THREE.Color("#8080ff")};return new E({colors:o})}}J=new Property(TextureLayer,"enum","channel",{default:O,values:Object.keys(l).map(n=>l[n].id),label:"PBR Channel",exposed:!1}),ee=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),te=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),ae=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"});let re=n=>{let e=Project?Project.selected_texture:Texture.all.find(r=>r.selected);if(!e)return;let t=new p(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!1);t&&t.toBlob(async r=>{if(!r)return;let[a,s]=Project?[`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await r.arrayBuffer(),type:"PNG",name:a,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},n)})},w=n=>{if(!Project||Texture.all.length===0)return;let e=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(r=>{let s=t.faces[r].getTexture();if(!s)return;let o=Project.materials[s.uuid];o.isShaderMaterial&&!Project.bb_materials[s.uuid]&&(Project.bb_materials[s.uuid]=o);let i=new p(s.layers_enabled?s.layers.filter(c=>c.visible)??null:Project.textures,s.uuid).getMaterial(n);Project.materials[s.uuid]=THREE.ShaderMaterial.prototype.copy.call(i,o),Canvas.updateAllFaces(s),e=!0})}),Project.pbr_active=e},ge=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(n=>{n instanceof Cube&&Object.keys(n.faces).forEach(e=>{let r=n.faces[e].getTexture();if(!r)return;let a=Project.bb_materials[r.uuid];a&&(Project.materials[r.uuid]=a)})}),Project.pbr_active=!1,Canvas.updateAll())},se=(n,e)=>{let t=e??document.createElement("canvas"),r=t.getContext("2d");if(!r)return null;let a=Math.max(Project?Project.texture_width:16,16),s=Math.max(Project?Project.texture_height:16,16);return t.width=a,t.height=s,r.fillStyle=`rgb(${n.r*255}, ${n.g*255}, ${n.b*255})`,r.fillRect(0,0,a,s),t.toDataURL()},pe=()=>{if(!Project)return;let n=y();Project.textures.forEach(e=>{let t=new p(n,e.uuid),r=t.findTexture(l.normal,!1)?.name,a=t.findTexture(l.height,!1)?.name,s=t.findTexture(l.albedo,!1)?.name,o=t.findTexture(l.metalness,!1)?.name,i=t.findTexture(l.emissive,!1)?.name,c=t.findTexture(l.roughness,!1)?.name,d={};return s||(d.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!i&&!c&&(d.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},d.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},d.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),r&&a&&(d.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),M=new Dialog(`${u}_texture_set`,{id:`${u}_texture_set`,title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:d,onConfirm(f){let x=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),v=o||i||c,m={format_version:"1.16.100","minecraft:texture_set":{color:(s?pathToName(s,!1):f.baseColor?.toHexString())??x,metalness_emissive_roughness:[f.metalness??0,f.emissive??0,f.roughness??255]}};f.depthMap==="normal"&&r?m["minecraft:texture_set"].normal=pathToName(r,!1):(!r||f.depthMap==="heightmap")&&a&&(m["minecraft:texture_set"].heightmap=pathToName(a,!1));let _=()=>Blockbench.export({content:JSON.stringify(m,null,2),type:"JSON",name:`${x}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path},()=>{Blockbench.showQuickMessage("Texture set created",2e3),M.hide()});if(v){re(g=>{m["minecraft:texture_set"].metalness_emissive_roughness=pathToName(g,!1),_()});return}_()},cancelIndex:1}),M.show(),M})},ie=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],oe=()=>Project&&Project.pbr_active&&w(),le=()=>{ie.forEach(n=>{Blockbench.addListener(n,oe)})},ce=()=>{ie.forEach(n=>{Blockbench.removeListener(n,oe)})},fe=()=>{Q=new Setting("pbr_active",{category:"preview",name:"Enable PBR Preview",description:"Enables PBR preview in the editor",type:"toggle",default_value:!1,icon:"tonality",onChange(n){if(n){w(),le();return}ge(),ce()}}),K=new Setting("display_settings_correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview for PBR materials",type:"toggle",default_value:!1,icon:"light_mode",onChange(n){Preview.selected.renderer.physicallyCorrectLights=n,w()}}),W=new Setting("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:THREE.NoToneMapping,value:THREE.NoToneMapping,icon:"palette",options:{[THREE.NoToneMapping]:"None",[THREE.LinearToneMapping]:"Linear",[THREE.ReinhardToneMapping]:"Reinhard",[THREE.CineonToneMapping]:"Cineon",[THREE.ACESFilmicToneMapping]:"ACES"},onChange(n){Preview.selected.renderer.toneMapping=Number(n),w()}}),q=new Setting("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",default_value:1,icon:"exposure",step:.1,min:-2,max:2,onChange(n){Preview.selected.renderer.toneMappingExposure=Math.max(-2,Math.min(2,Number(n))),w()}}),Y=new Setting("global_metalness",{category:"preview",name:"Global Metalness",description:"Adjusts the base metalness of the scene",type:"number",default_value:0,icon:"iron",step:.01,min:0,max:1}),Z=new Setting("global_roughness",{category:"preview",name:"Global Roughness",description:"Adjusts the base roughness of the scene",type:"number",default_value:0,icon:"grain",step:.01,min:0,max:1}),A=new Action(`${u}_generate_normal`,{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(n=>n.selected))!==void 0,click(){let n=TextureLayer.selected??Texture.all.find(a=>a.selected),e=new p(y(),n.uuid),t=TextureLayer.selected??Texture.all.find(a=>a.selected)??e.findTexture(l.height,!0);if(!t){Blockbench.showQuickMessage("No height map found",2e3);return}let r=p.createNormalMap(t);if(r){e.saveTexture(l.normal,r),r.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),S=new Action(`${u}_create_mer`,{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",click(){re()}}),j=new Action(`${u}_decode_mer`,{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",click(){let n=y(),e=TextureLayer.selected?.texture??Texture.all.find(s=>s.selected),t=new p(n,(e??n[0]).uuid),r=t.decodeMer();[l.metalness,l.emissive,l.roughness].forEach(s=>{let o=s.id,i=r[o];if(!i)return;let c=new TextureLayer({name:`${e?.name}_${o}`,data_url:i.toDataURL()},e.layers_enabled?e.texture:e);t.saveTexture(s,c)})}}),R=new Action(`${u}_create_texture_set`,{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){pe()},condition:{formats:["bedrock"],project:!0}}),L=new Action(`${u}_create_material_texture`,{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",click(){if(!Project)return;let n=new Texture({name:"New Material",saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}),e=se(new THREE.Color(8421504));e&&(n.fromDataURL(e).add().select(),Object.keys(l).forEach(t=>{let r=l[t],a=new TextureLayer({name:r.label,visible:!0},n);a.setSize(n.width,n.height);let s=se(r.default??new THREE.Color(0),a.canvas);s&&a.texture.fromDataURL(s),a.extend({channel:r.id}),a.addForEditing()}))}}),Object.entries(l).forEach(([n,e])=>{U[n]=new Action(`${u}_assign_channel_${n}`,{icon:e.icon??"tv_options_edit_channels",name:`Assign to ${e.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${e.label} channel`,category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(t){let r=TextureLayer.selected;if(!r||!Project)return;Undo.initEdit({layers:[r]}),r.extend({channel:n});let a=r.texture;a.updateChangesAfterEdit(),Project.pbr_materials[a.uuid]||(Project.pbr_materials[a.uuid]={}),Object.entries(Project.pbr_materials[a.uuid]).forEach(([s,o])=>{o===r.uuid&&delete Project.pbr_materials[a.uuid][s]}),Project.pbr_materials[a.uuid][n]=r.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${r.name}" to ${e.label} channel`,2e3),w()}})}),G=new Action(`${u}_unassign_channel`,{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",click(){let n=TextureLayer.selected;if(!n||!Project)return;Undo.initEdit({layers:[n]});let{texture:e,channel:t}=n;e.updateChangesAfterEdit(),Project.pbr_materials[e.uuid]={},n.channel=O,Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${n.name}" from ${t} channel`,2e3),w()}}),k=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",linked_setting:"pbr_active",default:!1,click(){},onChange(n){Blockbench.showQuickMessage(`PBR Preview is now ${n?"enabled":"disabled"}`,2e3)}}),D=new Toggle(`${u}_correct_lights`,{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",linked_setting:"display_settings_correct_lights",default:!1,onChange(n){Blockbench.showQuickMessage(`Physically corrected lighting is now ${n?"enabled":"disabled"}`,2e3)},click(){}}),V=new Menu(`${u}_channel_menu`,[...Object.keys(l).map(n=>`${u}_assign_channel_${n}`),`${u}_unassign_channel`],{onOpen(){w()}}),X=new Action(`${u}_show_channel_menu`,{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(n){V.open(n)}}),N=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",settings:{min:0,max:1,step:.01,default:0}}),H=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",settings:{min:0,max:1,step:.01,default:1}}),$=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000"}),I=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",settings:{min:0,max:1,step:.01,default:.5}}),B=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",condition:{project:!0,modes:["paint"]},brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(n,e,t,r,{size:a,softness:s,texture:o}){let i=E.fromSettings();return o.layers.filter(({visible:c,channel:d})=>c&&d&&d!==O).forEach(c=>{let d=i.getChannel(c.channel);d&&(c.ctx.fillStyle=d.getStyle(),c.ctx.fillRect(a*n,a*e,a,a))}),o.updateChangesAfterEdit(),Canvas.updateAllFaces(o),t}},onCanvasClick(n){Painter.startPaintToolCanvas(n,n.event)},onSelect(){w()},click(){w()}}),MenuBar.addAction(B,"tools.0"),z=new Panel(`${u}_display_settings`,{name:"PBR Settings",id:`${u}_display_settings_panel`,icon:"display_settings",toolbars:[new Toolbar(`${u}_controls_toolbar`,{id:`${u}_controls_toolbar`,children:["toggle_pbr",`${u}_correct_lights`,`${u}_show_channel_menu`,`${u}_create_material_texture`],name:"PBR"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"}),ne=new Panel(`${u}_material_brush_panel`,{name:"Material Brush",id:`${u}_material_brush_panel`,icon:"view_in_ar",toolbars:[new Toolbar(`${u}_material_brush_toolbar`,{id:`${u}_material_brush_toolbar`,children:["slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Brush"})],condition:()=>Modes.paint,component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"}),MenuBar.addAction(S,"file.export"),MenuBar.addAction(A,"tools"),MenuBar.addAction(j,"tools"),MenuBar.addAction(R,"file.export"),MenuBar.addAction(k,"view"),MenuBar.addAction(D,"preview"),MenuBar.addAction(L,"tools"),Object.entries(U).forEach(([n,e],t)=>{MenuBar.addAction(e,`image.${t}`)}),le()},xe=()=>{Object.entries(U).forEach(([n,e])=>{e.delete()}),MenuBar.removeAction(`file.export.${u}_create_mer`),MenuBar.removeAction(`file.export.${u}_create_texture_set`),MenuBar.removeAction(`tools.${u}_generate_normal`),ce(),z?.delete(),M?.delete(),Q?.delete(),L?.delete(),S?.delete(),A?.delete(),k?.delete(),j?.delete(),R?.delete(),J?.delete(),X?.delete(),q?.delete(),ue?.delete(),de?.delete(),D?.delete(),K?.delete(),W?.delete(),G?.delete(),te?.delete(),ee?.delete(),ae?.delete(),Y?.delete(),Z?.delete(),B?.delete(),ne?.delete(),he?.delete(),N?.delete(),H?.delete(),$?.delete(),I?.delete()};BBPlugin.register(u,{version:me,title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.1",onload:fe,onunload:xe})})();})(); diff --git a/src/pbr_preview/src/index.ts b/src/pbr_preview/src/index.ts index cc7c1100..f7d9d70b 100644 --- a/src/pbr_preview/src/index.ts +++ b/src/pbr_preview/src/index.ts @@ -199,7 +199,7 @@ interface IChannel { PbrMaterial.makePixelatedCanvas( TextureLayer.selected?.canvas ?? Texture.all.find((t) => t.selected)?.canvas ?? - Texture.all[0].canvas, + Texture.getDefault().canvas, ), aoMap: this.getTexture(CHANNELS.ao), normalMap: this.getTexture(CHANNELS.normal), @@ -1130,7 +1130,6 @@ interface IChannel { type: "toggle", default_value: false, icon: "light_mode", - condition: () => !!Project, onChange(value) { Preview.selected.renderer.physicallyCorrectLights = value; @@ -1172,15 +1171,13 @@ interface IChannel { step: 0.1, min: -2, max: 2, - // condition: () => - // Project && - // Project.pbr_active && - // Preview.selected.renderer.toneMapping !== THREE.NoToneMapping, onChange(value) { Preview.selected.renderer.toneMappingExposure = Math.max( -2, Math.min(2, Number(value)), ); + + applyPbrMaterial(); }, }); @@ -1307,10 +1304,13 @@ interface IChannel { icon: "layers", description: "Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.", - // condition: () => Format.id == "bedrock", click() { createTextureSetDialog(); }, + condition: { + formats: ["bedrock"], + project: true, + }, }); createMaterialTexture = new Action(`${PLUGIN_ID}_create_material_texture`, { @@ -1362,9 +1362,9 @@ interface IChannel { layer.texture.fromDataURL(data); } - layer.extend({ channel: key }); - texture.layers.push(layer); - // layer.addForEditing(); + layer.extend({ channel: channel.id }); + + layer.addForEditing(); }); }, }); @@ -1455,7 +1455,6 @@ interface IChannel { description: "Toggle PBR Preview", icon: "panorama_photosphere", category: "view", - // condition: () => (Project && Project.textures.length > 0) === true, linked_setting: "pbr_active", default: false, click() {}, @@ -1483,26 +1482,6 @@ interface IChannel { click() {}, }); - exposureSlider = new BarSlider(`${PLUGIN_ID}_exposure`, { - category: "preview", - name: "Exposure", - description: "Adjusts the exposure of the scene", - icon: "exposure", - min: -2, - max: 2, - step: 0.1, - value: Settings.get("display_settings_exposure") ?? 1, - display_condition: { - modes: ["edit", "paint", "animate"], - project: true, - }, - onChange({ value }) { - exposureSetting.set(value); - }, - }); - - exposureSlider.addLabel(true, exposureSlider); - channelMenu = new Menu( `${PLUGIN_ID}_channel_menu`, [ @@ -1529,42 +1508,6 @@ interface IChannel { }, }); - tonemappingSelect = new BarSelect(`${PLUGIN_ID}_tonemapping`, { - category: "preview", - name: "Tone Mapping", - description: "Select the tone mapping function", - icon: "palette", - value: THREE.NoToneMapping, - linked_setting: "display_settings_tone_mapping", - options: { - [THREE.NoToneMapping]: { - name: "No Tone Mapping", - icon: "invert_colors_off", - }, - [THREE.LinearToneMapping]: { - name: "Linear", - icon: "linear_scale", - }, - [THREE.ReinhardToneMapping]: { - name: "Reinhard", - icon: "brightness_medium", - }, - [THREE.CineonToneMapping]: { - name: "Cineon", - icon: "brightness_high", - }, - [THREE.ACESFilmicToneMapping]: { - name: "ACES", - icon: "brightness_auto", - }, - }, - onChange({ value }) { - tonemappingSetting.set(value); - - applyPbrMaterial(); - }, - }); - // // Tools // @@ -1577,8 +1520,8 @@ interface IChannel { min: 0, max: 1, step: 0.01, + default: 0, }, - value: 0, }); brushRoughnessSlider = new NumSlider("slider_brush_roughness", { @@ -1589,8 +1532,8 @@ interface IChannel { min: 0, max: 1, step: 0.01, + default: 1, }, - value: 1, }); brushEmissiveColor = new ColorPicker("brush_emissive_color", { @@ -1608,8 +1551,8 @@ interface IChannel { min: 0, max: 1, step: 0.01, + default: 0.5, }, - value: 0.5, }); materialBrushTool = new Tool("material_brush", { @@ -1688,12 +1631,6 @@ interface IChannel { ], name: "PBR", }), - new Toolbar(`${PLUGIN_ID}_display_settings_toolbar`, { - id: `${PLUGIN_ID}_display_settings_toolbar`, - children: [`${PLUGIN_ID}_tonemapping`, `${PLUGIN_ID}_exposure`], - // condition: () => Project && Project.pbr_active, - name: "Display Settings", - }), ], display_condition: { modes: ["edit", "paint", "animate"], @@ -1713,8 +1650,7 @@ interface IChannel { folded: false, }, insert_after: "textures", - insert_before: "paint", - condition: () => !!Project && Project.textures.length > 0, + insert_before: "color", }); materialBrushPanel = new Panel(`${PLUGIN_ID}_material_brush_panel`, { @@ -1733,10 +1669,7 @@ interface IChannel { name: "Material Brush", }), ], - display_condition: { - modes: ["paint"], - project: true, - }, + condition: () => Modes.paint, component: {}, expand_button: true, growable: false, @@ -1752,7 +1685,6 @@ interface IChannel { }, insert_after: "color", insert_before: "outliner", - condition: () => !!Project && Project.textures.length > 0, }); MenuBar.addAction(generateMer, "file.export"); From 08d484c844970d6ebc9cf829b7691d70baa2a482 Mon Sep 17 00:00:00 2001 From: Jason Gardner Date: Wed, 29 May 2024 14:43:05 -0500 Subject: [PATCH 11/50] fix: Material brush paint on selected layer - Fixed logic to return color value for currently selected channel/layer --- plugins/pbr_preview/about.md | 31 +++++-- plugins/pbr_preview/pbr_preview.js | 2 +- src/pbr_preview/src/index.ts | 137 +++++++++++++++++++++++------ 3 files changed, 133 insertions(+), 37 deletions(-) diff --git a/plugins/pbr_preview/about.md b/plugins/pbr_preview/about.md index b5b6affa..5c529887 100644 --- a/plugins/pbr_preview/about.md +++ b/plugins/pbr_preview/about.md @@ -40,18 +40,15 @@ This plugin adds the _PBR Settings_ panel, which controls enabling and disabling - Use the _PBR Preview_ toggle to toggle or refresh the PBR preview. Also found in the _View_ menu. +>
+> Usage Tip +> Toggling the PBR preview off and on may solve any texture discrepancies. Allowing the scene to render again will ensure all textures are up-to-date in the preview. +>
+ #### Toggle Corrected Lighting - Use the _Correct Lights_ toggle to enable or disable physically-corrected lighting in the preview scene. This may improve the appearance of reflective and emissive materials in the preview scene, but will dim the albedo/base color texture. -#### Tone Mapping - -- The _Tone Mapping_ setting will apply various tone mapping techniques to the preview scene. Use the _Linear_ option to match the tone map used by most Bedrock shaders. - -#### Exposure - -- The scene exposure can be adjusted once a tone map technique is selected. Values range from -2.0 to 2.0. - ### Channel Management Control which textures or texture layers are used for PBR channels using the following methods: @@ -83,7 +80,14 @@ Create a Texture Layer in Blockbench to enable channel assignment in PBR preview Channels can be disabled by hiding or deleting the layer, or un-assigning the channel in the menu. Texture layers cannot be assigned to more than one channel. Assigning a layer to a new channel will clear the layer's current channel. -### Global Settings +### Material Brush Tool + +Use the _Material Brush Tool_ to paint across multiple PBR channels simultaneously.The controls found in the _Material Brush Panel_ + +- The current color selected in the main color picker is used as the albedo color. +- Only visible layers with channels assigned will be updated by the brush. + +### Plugin Settings The following Blockbench settings are added by this plugin: @@ -91,6 +95,15 @@ The following Blockbench settings are added by this plugin: - Adjusts the metalness or roughness multiplier used in the PBR Preview scene. +#### Tone Mapping + +- The _Tone Mapping_ setting will apply various tone mapping techniques to the preview scene. Use the _Linear_ option to match the tone map used by most Bedrock shaders. + +#### Exposure + +- The scene exposure can be adjusted once a tone map technique is selected. Values range from -2.0 to 2.0. (Exposure settings only work when tone mapping is applied.) + + --- ## Roadmap diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index a234f842..3134f211 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1 +1 @@ -"use strict";(()=>{(()=>{let j,R,S,A,G,L,k,Q,z,M,J,V,X,ue,de,D,q,K,W,Y,Z,ee,te,ae,ne,B,he,N,H,$,I,U={},u="pbr_preview",me="1.0.0",O="_NONE_",l={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new THREE.Color(16777215)},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new THREE.Color(0)},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new THREE.Color(0)},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new THREE.Color(16777215)},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new THREE.Color(16777215)},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new THREE.Color("rgb(128, 128, 255)")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new THREE.Color(16777215)}},y=(n=!0)=>{let e=Project?Project.textures??Texture.all:Texture.all;return n?e.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):e};class p{constructor(e,t){this._scope=e??y(),this._materialUuid=t}merToCanvas(){let e=this.getTexture(l.emissive),t=this.getTexture(l.roughness),r=this.getTexture(l.metalness);if(!e&&!t&&!r){let{metalness:a,emissive:s,roughness:o}=this.decodeMer();a&&(r=p.makePixelatedCanvas(a)),s&&(e=p.makePixelatedCanvas(s)),o&&(t=p.makePixelatedCanvas(o))}return{emissiveMap:e,roughnessMap:t,metalnessMap:r}}getMaterial(e={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:a}=this.merToCanvas();return new THREE.MeshStandardMaterial({map:this.getTexture(l.albedo)??p.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(s=>s.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(l.ao),normalMap:this.getTexture(l.normal),normalScale:new THREE.Vector2(1,1),bumpMap:this.getTexture(l.height),metalnessMap:a,metalness:a?Settings.get("global_metalness"):void 0,roughnessMap:r,roughness:r?Settings.get("global_roughness"):void 0,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:1,alphaTest:.5,...e})}saveTexture(e,{uuid:t,extend:r}){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][e.id]=t,r({channel:e.id}))}findTexture(e,t=!0){if(!Project)return null;let r=this._scope.find(i=>i.channel&&(i.channel===e||i.channel===e.id));if(r)return r;let a=typeof e=="string"?e:e.id;Project.pbr_materials??={};let s=Project.pbr_materials[this._materialUuid];if(!s&&t){let i=new RegExp(`_*${a}(.[^.]+)?$`,"i");return this._scope.find(c=>i.test(c.name))??null}let o=s?.[a];return o?this._scope.find(i=>i.uuid===o)??null:null}static makePixelatedCanvas(e){let t=new THREE.CanvasTexture(e,void 0,void 0,void 0,THREE.NearestFilter,THREE.NearestFilter);return t.needsUpdate=!0,t}getTexture(e){let t=this.findTexture(e);return t?p.makePixelatedCanvas(t.canvas):null}static extractChannel(e,t){let r=e.canvas,a=r.width,s=r.height,o=r.getContext("2d");if(!o||!a||!s)return null;let i=document.createElement("canvas");i.width=a,i.height=s;let c=i.getContext("2d");if(!c)return null;let d={r:0,g:1,b:2,a:3}[t],{data:f}=o.getImageData(0,0,a,s),x=new Uint8ClampedArray(a*s*4);for(let m=0;me){_[g]=v.data[g],_[g+1]=v.data[g+1],_[g+2]=v.data[g+2],_[g+3]=255;continue}_[g]=0,_[g+1]=0,_[g+2]=0,_[g+3]=255}return d.putImageData(new ImageData(_,i.width,i.height),0,0),{metalness:r,emissive:i,emissiveLevel:a,roughness:s,sss:o}}createMer(e=!1){let t=this.findTexture(l.metalness,e),r=this.findTexture(l.emissive,e),a=this.findTexture(l.roughness,e),s=this.findTexture("sss",!1),o=Math.max(t?.img.width??0,r?.img.width??0,a?.img.width??0,Project?Project.texture_width:0,16),i=Math.max(t?.img.height??0,r?.img.height??0,a?.img.height??0,Project?Project.texture_height:0,16),c=document.createElement("canvas");c.width=o,c.height=i;let d=c.getContext("2d");if(!d)return null;let f=t?.img?p.extractChannel(t,"r"):null,x=r?.img?p.extractChannel(r,"g"):null,v=a?.img?p.extractChannel(a,"b"):null,m=s&&s?.img?p.extractChannel(s,"a"):null,_=f?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),g=x?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),h=v?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),b=m?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(new Uint8ClampedArray(o*i*4).fill(255),o,i),C=new Uint8ClampedArray(o*i*4);for(let T=0;T{let C=(h+b*a)*4;return o[C]/255};i.width=a,i.height=s,c.drawImage(e.img,0,0,a,s);let f=c.getImageData(0,0,a,s),x=f.data,v=h=>{let b=Math.sqrt(h[0]*h[0]+h[1]*h[1]+h[2]*h[2]);return[h[0]/b,h[1]/b,h[2]/b]};for(let h=0;h[t,l[t].default??new THREE.Color(4294967040)])),...e}}get colors(){return this._colors}set colors(e){this._colors={...this._colors,...e}}getChannel(e){return this._colors[e]}static makeLinearColor(e){let t=Math.min(1,Math.max(0,e));return new THREE.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let e=Number(N.get()),t=Number(H.get()),r=$.get().toString(),a=Number(I.get()),s=ColorPanel.get(),o={[l.albedo.id]:new THREE.Color(s),[l.metalness.id]:E.makeLinearColor(e),[l.roughness.id]:E.makeLinearColor(t),[l.emissive.id]:new THREE.Color(r??"#000000"),[l.height.id]:E.makeLinearColor(a),[l.normal.id]:l.normal.default??new THREE.Color("#8080ff")};return new E({colors:o})}}J=new Property(TextureLayer,"enum","channel",{default:O,values:Object.keys(l).map(n=>l[n].id),label:"PBR Channel",exposed:!1}),ee=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),te=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),ae=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"});let re=n=>{let e=Project?Project.selected_texture:Texture.all.find(r=>r.selected);if(!e)return;let t=new p(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!1);t&&t.toBlob(async r=>{if(!r)return;let[a,s]=Project?[`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await r.arrayBuffer(),type:"PNG",name:a,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},n)})},w=n=>{if(!Project||Texture.all.length===0)return;let e=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(r=>{let s=t.faces[r].getTexture();if(!s)return;let o=Project.materials[s.uuid];o.isShaderMaterial&&!Project.bb_materials[s.uuid]&&(Project.bb_materials[s.uuid]=o);let i=new p(s.layers_enabled?s.layers.filter(c=>c.visible)??null:Project.textures,s.uuid).getMaterial(n);Project.materials[s.uuid]=THREE.ShaderMaterial.prototype.copy.call(i,o),Canvas.updateAllFaces(s),e=!0})}),Project.pbr_active=e},ge=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(n=>{n instanceof Cube&&Object.keys(n.faces).forEach(e=>{let r=n.faces[e].getTexture();if(!r)return;let a=Project.bb_materials[r.uuid];a&&(Project.materials[r.uuid]=a)})}),Project.pbr_active=!1,Canvas.updateAll())},se=(n,e)=>{let t=e??document.createElement("canvas"),r=t.getContext("2d");if(!r)return null;let a=Math.max(Project?Project.texture_width:16,16),s=Math.max(Project?Project.texture_height:16,16);return t.width=a,t.height=s,r.fillStyle=`rgb(${n.r*255}, ${n.g*255}, ${n.b*255})`,r.fillRect(0,0,a,s),t.toDataURL()},pe=()=>{if(!Project)return;let n=y();Project.textures.forEach(e=>{let t=new p(n,e.uuid),r=t.findTexture(l.normal,!1)?.name,a=t.findTexture(l.height,!1)?.name,s=t.findTexture(l.albedo,!1)?.name,o=t.findTexture(l.metalness,!1)?.name,i=t.findTexture(l.emissive,!1)?.name,c=t.findTexture(l.roughness,!1)?.name,d={};return s||(d.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!i&&!c&&(d.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},d.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},d.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),r&&a&&(d.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),M=new Dialog(`${u}_texture_set`,{id:`${u}_texture_set`,title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:d,onConfirm(f){let x=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),v=o||i||c,m={format_version:"1.16.100","minecraft:texture_set":{color:(s?pathToName(s,!1):f.baseColor?.toHexString())??x,metalness_emissive_roughness:[f.metalness??0,f.emissive??0,f.roughness??255]}};f.depthMap==="normal"&&r?m["minecraft:texture_set"].normal=pathToName(r,!1):(!r||f.depthMap==="heightmap")&&a&&(m["minecraft:texture_set"].heightmap=pathToName(a,!1));let _=()=>Blockbench.export({content:JSON.stringify(m,null,2),type:"JSON",name:`${x}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path},()=>{Blockbench.showQuickMessage("Texture set created",2e3),M.hide()});if(v){re(g=>{m["minecraft:texture_set"].metalness_emissive_roughness=pathToName(g,!1),_()});return}_()},cancelIndex:1}),M.show(),M})},ie=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],oe=()=>Project&&Project.pbr_active&&w(),le=()=>{ie.forEach(n=>{Blockbench.addListener(n,oe)})},ce=()=>{ie.forEach(n=>{Blockbench.removeListener(n,oe)})},fe=()=>{Q=new Setting("pbr_active",{category:"preview",name:"Enable PBR Preview",description:"Enables PBR preview in the editor",type:"toggle",default_value:!1,icon:"tonality",onChange(n){if(n){w(),le();return}ge(),ce()}}),K=new Setting("display_settings_correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview for PBR materials",type:"toggle",default_value:!1,icon:"light_mode",onChange(n){Preview.selected.renderer.physicallyCorrectLights=n,w()}}),W=new Setting("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:THREE.NoToneMapping,value:THREE.NoToneMapping,icon:"palette",options:{[THREE.NoToneMapping]:"None",[THREE.LinearToneMapping]:"Linear",[THREE.ReinhardToneMapping]:"Reinhard",[THREE.CineonToneMapping]:"Cineon",[THREE.ACESFilmicToneMapping]:"ACES"},onChange(n){Preview.selected.renderer.toneMapping=Number(n),w()}}),q=new Setting("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",default_value:1,icon:"exposure",step:.1,min:-2,max:2,onChange(n){Preview.selected.renderer.toneMappingExposure=Math.max(-2,Math.min(2,Number(n))),w()}}),Y=new Setting("global_metalness",{category:"preview",name:"Global Metalness",description:"Adjusts the base metalness of the scene",type:"number",default_value:0,icon:"iron",step:.01,min:0,max:1}),Z=new Setting("global_roughness",{category:"preview",name:"Global Roughness",description:"Adjusts the base roughness of the scene",type:"number",default_value:0,icon:"grain",step:.01,min:0,max:1}),A=new Action(`${u}_generate_normal`,{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(n=>n.selected))!==void 0,click(){let n=TextureLayer.selected??Texture.all.find(a=>a.selected),e=new p(y(),n.uuid),t=TextureLayer.selected??Texture.all.find(a=>a.selected)??e.findTexture(l.height,!0);if(!t){Blockbench.showQuickMessage("No height map found",2e3);return}let r=p.createNormalMap(t);if(r){e.saveTexture(l.normal,r),r.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),S=new Action(`${u}_create_mer`,{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",click(){re()}}),j=new Action(`${u}_decode_mer`,{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",click(){let n=y(),e=TextureLayer.selected?.texture??Texture.all.find(s=>s.selected),t=new p(n,(e??n[0]).uuid),r=t.decodeMer();[l.metalness,l.emissive,l.roughness].forEach(s=>{let o=s.id,i=r[o];if(!i)return;let c=new TextureLayer({name:`${e?.name}_${o}`,data_url:i.toDataURL()},e.layers_enabled?e.texture:e);t.saveTexture(s,c)})}}),R=new Action(`${u}_create_texture_set`,{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){pe()},condition:{formats:["bedrock"],project:!0}}),L=new Action(`${u}_create_material_texture`,{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",click(){if(!Project)return;let n=new Texture({name:"New Material",saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}),e=se(new THREE.Color(8421504));e&&(n.fromDataURL(e).add().select(),Object.keys(l).forEach(t=>{let r=l[t],a=new TextureLayer({name:r.label,visible:!0},n);a.setSize(n.width,n.height);let s=se(r.default??new THREE.Color(0),a.canvas);s&&a.texture.fromDataURL(s),a.extend({channel:r.id}),a.addForEditing()}))}}),Object.entries(l).forEach(([n,e])=>{U[n]=new Action(`${u}_assign_channel_${n}`,{icon:e.icon??"tv_options_edit_channels",name:`Assign to ${e.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${e.label} channel`,category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(t){let r=TextureLayer.selected;if(!r||!Project)return;Undo.initEdit({layers:[r]}),r.extend({channel:n});let a=r.texture;a.updateChangesAfterEdit(),Project.pbr_materials[a.uuid]||(Project.pbr_materials[a.uuid]={}),Object.entries(Project.pbr_materials[a.uuid]).forEach(([s,o])=>{o===r.uuid&&delete Project.pbr_materials[a.uuid][s]}),Project.pbr_materials[a.uuid][n]=r.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${r.name}" to ${e.label} channel`,2e3),w()}})}),G=new Action(`${u}_unassign_channel`,{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",click(){let n=TextureLayer.selected;if(!n||!Project)return;Undo.initEdit({layers:[n]});let{texture:e,channel:t}=n;e.updateChangesAfterEdit(),Project.pbr_materials[e.uuid]={},n.channel=O,Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${n.name}" from ${t} channel`,2e3),w()}}),k=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",linked_setting:"pbr_active",default:!1,click(){},onChange(n){Blockbench.showQuickMessage(`PBR Preview is now ${n?"enabled":"disabled"}`,2e3)}}),D=new Toggle(`${u}_correct_lights`,{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",linked_setting:"display_settings_correct_lights",default:!1,onChange(n){Blockbench.showQuickMessage(`Physically corrected lighting is now ${n?"enabled":"disabled"}`,2e3)},click(){}}),V=new Menu(`${u}_channel_menu`,[...Object.keys(l).map(n=>`${u}_assign_channel_${n}`),`${u}_unassign_channel`],{onOpen(){w()}}),X=new Action(`${u}_show_channel_menu`,{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(n){V.open(n)}}),N=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",settings:{min:0,max:1,step:.01,default:0}}),H=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",settings:{min:0,max:1,step:.01,default:1}}),$=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000"}),I=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",settings:{min:0,max:1,step:.01,default:.5}}),B=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",condition:{project:!0,modes:["paint"]},brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(n,e,t,r,{size:a,softness:s,texture:o}){let i=E.fromSettings();return o.layers.filter(({visible:c,channel:d})=>c&&d&&d!==O).forEach(c=>{let d=i.getChannel(c.channel);d&&(c.ctx.fillStyle=d.getStyle(),c.ctx.fillRect(a*n,a*e,a,a))}),o.updateChangesAfterEdit(),Canvas.updateAllFaces(o),t}},onCanvasClick(n){Painter.startPaintToolCanvas(n,n.event)},onSelect(){w()},click(){w()}}),MenuBar.addAction(B,"tools.0"),z=new Panel(`${u}_display_settings`,{name:"PBR Settings",id:`${u}_display_settings_panel`,icon:"display_settings",toolbars:[new Toolbar(`${u}_controls_toolbar`,{id:`${u}_controls_toolbar`,children:["toggle_pbr",`${u}_correct_lights`,`${u}_show_channel_menu`,`${u}_create_material_texture`],name:"PBR"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"}),ne=new Panel(`${u}_material_brush_panel`,{name:"Material Brush",id:`${u}_material_brush_panel`,icon:"view_in_ar",toolbars:[new Toolbar(`${u}_material_brush_toolbar`,{id:`${u}_material_brush_toolbar`,children:["slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Brush"})],condition:()=>Modes.paint,component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"}),MenuBar.addAction(S,"file.export"),MenuBar.addAction(A,"tools"),MenuBar.addAction(j,"tools"),MenuBar.addAction(R,"file.export"),MenuBar.addAction(k,"view"),MenuBar.addAction(D,"preview"),MenuBar.addAction(L,"tools"),Object.entries(U).forEach(([n,e],t)=>{MenuBar.addAction(e,`image.${t}`)}),le()},xe=()=>{Object.entries(U).forEach(([n,e])=>{e.delete()}),MenuBar.removeAction(`file.export.${u}_create_mer`),MenuBar.removeAction(`file.export.${u}_create_texture_set`),MenuBar.removeAction(`tools.${u}_generate_normal`),ce(),z?.delete(),M?.delete(),Q?.delete(),L?.delete(),S?.delete(),A?.delete(),k?.delete(),j?.delete(),R?.delete(),J?.delete(),X?.delete(),q?.delete(),ue?.delete(),de?.delete(),D?.delete(),K?.delete(),W?.delete(),G?.delete(),te?.delete(),ee?.delete(),ae?.delete(),Y?.delete(),Z?.delete(),B?.delete(),ne?.delete(),he?.delete(),N?.delete(),H?.delete(),$?.delete(),I?.delete()};BBPlugin.register(u,{version:me,title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.1",onload:fe,onunload:xe})})();})(); +"use strict";(()=>{(()=>{let j,R,S,k,F,L,A,G,Q,M,z,J,V,ue,de,D,X,q,K,W,Y,Z,ee,te,ne,B,he,N,H,$,I,U={},c="pbr_preview",me="1.0.0",ae="_NONE_",l={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new THREE.Color(16777215)},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new THREE.Color(0)},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new THREE.Color(0)},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new THREE.Color(16777215)},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new THREE.Color(16777215)},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new THREE.Color("rgb(128, 128, 255)")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new THREE.Color(16777215)}},E=(n=!0)=>{let e=Project?Project.textures??Texture.all:Texture.all;return n?e.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):e};class x{constructor(e,t){this._scope=e??E(),this._materialUuid=t}merToCanvas(){let e=this.getTexture(l.emissive),t=this.getTexture(l.roughness),r=this.getTexture(l.metalness);if(!e&&!t&&!r){let{metalness:a,emissive:s,roughness:o}=this.decodeMer();a&&(r=x.makePixelatedCanvas(a)),s&&(e=x.makePixelatedCanvas(s)),o&&(t=x.makePixelatedCanvas(o))}return{emissiveMap:e,roughnessMap:t,metalnessMap:r}}getMaterial(e={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:a}=this.merToCanvas(),s=new THREE.MeshStandardMaterial({map:this.getTexture(l.albedo)??x.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(i=>i.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(l.ao),bumpMap:this.getTexture(l.height),metalnessMap:a,metalness:a?Settings.get("global_metalness"):0,roughnessMap:r,roughness:r?Settings.get("global_roughness"):1,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:1,alphaTest:.5,...e}),o=this.getTexture(l.normal);return o&&(s.normalMap=o,s.normalScale=new THREE.Vector2(1,1)),s}saveTexture(e,t){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][e.id]=t.uuid,t.extend({channel:e.id}))}findTexture(e,t=!0){if(!Project)return null;let r=this._scope.find(i=>i.channel&&(i.channel===e||i.channel===e.id));if(r)return r;let a=typeof e=="string"?e:e.id;Project.pbr_materials??={};let s=Project.pbr_materials[this._materialUuid];if(!s&&t){let i=new RegExp(`_*${a}(.[^.]+)?$`,"i");return this._scope.find(u=>i.test(u.name))??null}let o=s?.[a];return o?this._scope.find(i=>i.uuid===o)??null:null}static makePixelatedCanvas(e){let t=new THREE.CanvasTexture(e,void 0,void 0,void 0,THREE.NearestFilter,THREE.NearestFilter);return t.needsUpdate=!0,t}getTexture(e){let t=this.findTexture(e);return t?x.makePixelatedCanvas(t.canvas):null}static extractChannel(e,t){let r=e.canvas,a=r.width,s=r.height,o=r.getContext("2d");if(!o||!a||!s)return null;let i=document.createElement("canvas");i.width=a,i.height=s;let u=i.getContext("2d");if(!u)return null;let h={r:0,g:1,b:2,a:3}[t],{data:d}=o.getImageData(0,0,a,s),g=new Uint8ClampedArray(a*s*4);for(let p=0;pe){_[f]=v.data[f],_[f+1]=v.data[f+1],_[f+2]=v.data[f+2],_[f+3]=255;continue}_[f]=0,_[f+1]=0,_[f+2]=0,_[f+3]=255}return h.putImageData(new ImageData(_,i.width,i.height),0,0),{metalness:r,emissive:i,emissiveLevel:a,roughness:s,sss:o}}createMer(e=!1){let t=this.findTexture(l.metalness,e),r=this.findTexture(l.emissive,e),a=this.findTexture(l.roughness,e),s=this.findTexture("sss",!1),o=Math.max(t?.img.width??0,r?.img.width??0,a?.img.width??0,Project?Project.texture_width:0,16),i=Math.max(t?.img.height??0,r?.img.height??0,a?.img.height??0,Project?Project.texture_height:0,16),u=document.createElement("canvas");u.width=o,u.height=i;let h=u.getContext("2d");if(!h)return null;let d=t?.img?x.extractChannel(t,"r"):null,g=r?.img?x.extractChannel(r,"g"):null,v=a?.img?x.extractChannel(a,"b"):null,p=s&&s?.img?x.extractChannel(s,"a"):null,_=d?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),f=g?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),m=v?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),b=p?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(new Uint8ClampedArray(o*i*4).fill(255),o,i),C=new Uint8ClampedArray(o*i*4);for(let T=0;T{let C=(m+b*a)*4;return o[C]/255};i.width=a,i.height=s,u.drawImage(e.img,0,0,a,s);let d=u.getImageData(0,0,a,s),g=d.data,v=m=>{let b=Math.sqrt(m[0]*m[0]+m[1]*m[1]+m[2]*m[2]);return[m[0]/b,m[1]/b,m[2]/b]};for(let m=0;m[t,l[t].default??new THREE.Color(4294967040)])),...e}}get colors(){return this._colors}set colors(e){this._colors={...this._colors,...e}}getChannel(e){return this._colors[e]}static makeLinearColor(e){let t=Math.min(1,Math.max(0,e));return new THREE.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let e=Number(N.get()),t=Number(H.get()),r=$.get().toString(),a=Number(I.get()),s=ColorPanel.get(),o={[l.albedo.id]:new THREE.Color(s),[l.metalness.id]:y.makeLinearColor(e),[l.roughness.id]:y.makeLinearColor(t),[l.emissive.id]:new THREE.Color(r??"#000000"),[l.height.id]:y.makeLinearColor(a),[l.normal.id]:l.normal.default??new THREE.Color("#8080ff")};return new y({colors:o})}}z=new Property(TextureLayer,"enum","channel",{default:ae,values:Object.keys(l).map(n=>l[n].id),label:"PBR Channel",exposed:!1}),Z=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),ee=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),te=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"});let re=n=>{let e=Project?Project.selected_texture:Texture.all.find(r=>r.selected);if(!e)return;let t=new x(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!1);t&&t.toBlob(async r=>{if(!r)return;let[a,s]=Project?[`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await r.arrayBuffer(),type:"PNG",name:a,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},n)})},w=n=>{if(!Project||Texture.all.length===0)return;let e=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(r=>{let s=t.faces[r].getTexture();if(!s)return;let o=Project.materials[s.uuid];o.isShaderMaterial&&!Project.bb_materials[s.uuid]&&(Project.bb_materials[s.uuid]=o);let i=new x(s.layers_enabled?s.layers.filter(u=>u.visible)??null:Project.textures,s.uuid).getMaterial(n);Project.materials[s.uuid]=THREE.ShaderMaterial.prototype.copy.call(i,o),Canvas.updateAllFaces(s),e=!0})}),Project.pbr_active=e},ge=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(n=>{n instanceof Cube&&Object.keys(n.faces).forEach(e=>{let r=n.faces[e].getTexture();if(!r)return;let a=Project.bb_materials[r.uuid];a&&(Project.materials[r.uuid]=a)})}),Project.pbr_active=!1,Canvas.updateAll())},se=(n,e)=>{let t=e??document.createElement("canvas"),r=t.getContext("2d");if(!r)return null;let a=Math.max(Project?Project.texture_width:16,16),s=Math.max(Project?Project.texture_height:16,16);return t.width=a,t.height=s,r.fillStyle=`rgb(${n.r*255}, ${n.g*255}, ${n.b*255})`,r.fillRect(0,0,a,s),t.toDataURL()},pe=()=>{if(!Project)return;let n=E();Project.textures.forEach(e=>{let t=new x(n,e.uuid),r=t.findTexture(l.normal,!1)?.name,a=t.findTexture(l.height,!1)?.name,s=t.findTexture(l.albedo,!1)?.name,o=t.findTexture(l.metalness,!1)?.name,i=t.findTexture(l.emissive,!1)?.name,u=t.findTexture(l.roughness,!1)?.name,h={};return s||(h.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!i&&!u&&(h.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},h.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},h.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),r&&a&&(h.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),M=new Dialog(`${c}_texture_set`,{id:`${c}_texture_set`,title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:h,onConfirm(d){let g=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),v=o||i||u,p={format_version:"1.16.100","minecraft:texture_set":{color:(s?pathToName(s,!1):d.baseColor?.toHexString())??g,metalness_emissive_roughness:[d.metalness??0,d.emissive??0,d.roughness??255]}};d.depthMap==="normal"&&r?p["minecraft:texture_set"].normal=pathToName(r,!1):(!r||d.depthMap==="heightmap")&&a&&(p["minecraft:texture_set"].heightmap=pathToName(a,!1));let _=()=>Blockbench.export({content:JSON.stringify(p,null,2),type:"JSON",name:`${g}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path},()=>{Blockbench.showQuickMessage("Texture set created",2e3),M.hide()});if(v){re(f=>{p["minecraft:texture_set"].metalness_emissive_roughness=pathToName(f,!1),_()});return}_()},cancelIndex:1}),M.show(),M})},ie=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],oe=()=>Project&&Project.pbr_active&&w(),le=()=>{ie.forEach(n=>{Blockbench.addListener(n,oe)})},ce=()=>{ie.forEach(n=>{Blockbench.removeListener(n,oe)})},fe=()=>{G=new Setting("pbr_active",{category:"preview",name:"Enable PBR Preview",description:"Enables PBR preview in the editor",type:"toggle",default_value:!1,icon:"tonality",onChange(n){if(n){w(),le();return}ge(),ce()}}),q=new Setting("display_settings_correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview for PBR materials",type:"toggle",default_value:!1,icon:"light_mode",onChange(n){Preview.selected.renderer.physicallyCorrectLights=n,w()}}),K=new Setting("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:THREE.NoToneMapping,value:THREE.NoToneMapping,icon:"palette",options:{[THREE.NoToneMapping]:"None",[THREE.LinearToneMapping]:"Linear",[THREE.ReinhardToneMapping]:"Reinhard",[THREE.CineonToneMapping]:"Cineon",[THREE.ACESFilmicToneMapping]:"ACES"},onChange(n){Preview.selected.renderer.toneMapping=Number(n),w()}}),X=new Setting("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",default_value:1,icon:"exposure",step:.1,min:-2,max:2,onChange(n){Preview.selected.renderer.toneMappingExposure=Math.max(-2,Math.min(2,Number(n))),w()}}),W=new Setting("global_metalness",{category:"preview",name:"Global Metalness",description:"Adjusts the base metalness of the scene",type:"number",default_value:0,icon:"iron",step:.01,min:0,max:1}),Y=new Setting("global_roughness",{category:"preview",name:"Global Roughness",description:"Adjusts the base roughness of the scene",type:"number",default_value:0,icon:"grain",step:.01,min:0,max:1}),k=new Action(`${c}_generate_normal`,{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(n=>n.selected))!==void 0,click(){let n=TextureLayer.selected??Texture.all.find(a=>a.selected),e=new x(E(),n.uuid),t=TextureLayer.selected??Texture.all.find(a=>a.selected)??e.findTexture(l.height,!0);if(!t){Blockbench.showQuickMessage("No height map found",2e3);return}let r=x.createNormalMap(t);if(r){e.saveTexture(l.normal,r),r.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),S=new Action(`${c}_create_mer`,{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",click(){re()}}),j=new Action(`${c}_decode_mer`,{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",click(){let n=E(),e=TextureLayer.selected?.texture??Texture.all.find(s=>s.selected),t=new x(n,(e??n[0]).uuid),r=t.decodeMer();[l.metalness,l.emissive,l.roughness].forEach(s=>{let o=s.id,i=r[o];if(!i)return;let u=new TextureLayer({name:`${e?.name}_${o}`,data_url:i.toDataURL()},e.layers_enabled?e.texture:e);t.saveTexture(s,u)})}}),R=new Action(`${c}_create_texture_set`,{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){pe()},condition:{formats:["bedrock"],project:!0}}),L=new Action(`${c}_create_material_texture`,{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",click(){if(!Project)return;let n=new Texture({name:"New Material",saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}),e=se(new THREE.Color(8421504));e&&(n.fromDataURL(e).add().select(),Object.keys(l).forEach(t=>{let r=l[t],a=new TextureLayer({name:r.label,visible:!0},n);a.setSize(n.width,n.height);let s=se(r.default??new THREE.Color(0),a.canvas);s&&a.texture.fromDataURL(s),a.extend({channel:r.id}),a.addForEditing()}))}}),Object.entries(l).forEach(([n,e])=>{U[n]=new Action(`${c}_assign_channel_${n}`,{icon:e.icon??"tv_options_edit_channels",name:`Assign to ${e.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${e.label} channel`,category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(t){let r=TextureLayer.selected;if(!r||!Project)return;Undo.initEdit({layers:[r]}),r.extend({channel:e.id});let a=r.texture;a.updateChangesAfterEdit(),Project.pbr_materials[a.uuid]||(Project.pbr_materials[a.uuid]={}),Object.entries(Project.pbr_materials[a.uuid]).forEach(([s,o])=>{o===r.uuid&&delete Project.pbr_materials[a.uuid][s]}),Project.pbr_materials[a.uuid][n]=r.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${r.name}" to ${e.label} channel`,2e3),w()}})}),F=new Action(`${c}_unassign_channel`,{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",click(){let n=TextureLayer.selected;if(!n||!Project)return;Undo.initEdit({layers:[n]});let{texture:e,channel:t}=n;e.updateChangesAfterEdit(),Project.pbr_materials[e.uuid]={},n.channel=ae,Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${n.name}" from ${t} channel`,2e3),w()}}),A=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",linked_setting:"pbr_active",default:!1,click(){},onChange(n){Blockbench.showQuickMessage(`PBR Preview is now ${n?"enabled":"disabled"}`,2e3)}}),D=new Toggle(`${c}_correct_lights`,{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",linked_setting:"display_settings_correct_lights",default:!1,onChange(n){Blockbench.showQuickMessage(`Physically corrected lighting is now ${n?"enabled":"disabled"}`,2e3)},click(){}}),J=new Menu(`${c}_channel_menu`,[...Object.keys(l).map(n=>`${c}_assign_channel_${n}`),`${c}_unassign_channel`],{onOpen(){w()}}),V=new Action(`${c}_show_channel_menu`,{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(n){J.open(n)}}),N=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",settings:{min:0,max:1,step:.01,default:0},condition:()=>{if(!Project)return!1;let n=Project.selected_texture;return n?.layers_enabled?n.layers.find(({channel:e})=>e===l.metalness.id)!==void 0:!1}}),H=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",settings:{min:0,max:1,step:.01,default:1},condition:()=>{if(!Project)return!1;let n=Project.selected_texture;return n?.layers_enabled?n.layers.find(({channel:e})=>e===l.roughness.id)!==void 0:!1}}),$=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",condition:()=>{if(!Project)return!1;let n=Project.selected_texture;return n?.layers_enabled?n.layers.find(({channel:e})=>e===l.emissive.id)!==void 0:!1}}),I=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",settings:{min:0,max:1,step:.01,default:.5},condition:()=>{if(!Project)return!1;let n=Project.selected_texture;return n?.layers_enabled?n.layers.find(({channel:e})=>e===l.height.id)!==void 0:!1}}),B=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",condition:{project:!0,modes:["paint"]},brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(n,e,t,r,{size:a,softness:s,texture:o}){let i=y.fromSettings(),u=Object.keys(i.colors),h=t;return o.layers.forEach(d=>{if(!d.visible||!u.includes(d.channel))return;let g=i.getChannel(d.channel);g&&(d.ctx.fillStyle=g.getStyle(),d.ctx.fillRect(a*n,a*e,a,a),d.selected&&(h={r:g.r*255,g:g.g*255,b:g.b*255,a:r*255}))}),h}},onCanvasClick(n){Painter.startPaintToolCanvas(n,n.event)},onSelect(){w()},click(){w()}}),Q=new Panel(`${c}_display_settings`,{name:"PBR Settings",id:`${c}_display_settings_panel`,icon:"display_settings",toolbars:[new Toolbar(`${c}_controls_toolbar`,{id:`${c}_controls_toolbar`,children:["toggle_pbr",`${c}_correct_lights`,`${c}_show_channel_menu`,`${c}_create_material_texture`],name:"PBR"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"}),ne=new Panel(`${c}_material_brush_panel`,{name:"Material Brush",id:`${c}_material_brush_panel`,icon:"view_in_ar",toolbars:[new Toolbar(`${c}_material_brush_toolbar`,{id:`${c}_material_brush_toolbar`,children:["material_brush","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Brush"})],condition:()=>Modes.paint,component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"}),MenuBar.addAction(S,"file.export"),MenuBar.addAction(k,"tools"),MenuBar.addAction(j,"tools"),MenuBar.addAction(R,"file.export"),MenuBar.addAction(A,"view"),MenuBar.addAction(D,"preview"),MenuBar.addAction(L,"tools"),MenuBar.addAction(B,"tools.0"),Object.entries(U).forEach(([n,e],t)=>{MenuBar.addAction(e,`image.${t}`)}),le()},xe=()=>{Object.entries(U).forEach(([n,e])=>{e.delete()}),MenuBar.removeAction(`file.export.${c}_create_mer`),MenuBar.removeAction(`file.export.${c}_create_texture_set`),MenuBar.removeAction(`tools.${c}_generate_normal`),ce(),Q?.delete(),M?.delete(),G?.delete(),L?.delete(),S?.delete(),k?.delete(),A?.delete(),j?.delete(),R?.delete(),z?.delete(),V?.delete(),X?.delete(),ue?.delete(),de?.delete(),D?.delete(),q?.delete(),K?.delete(),F?.delete(),ee?.delete(),Z?.delete(),te?.delete(),W?.delete(),Y?.delete(),B?.delete(),ne?.delete(),he?.delete(),N?.delete(),H?.delete(),$?.delete(),I?.delete()};BBPlugin.register(c,{version:me,title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.1",onload:fe,onunload:xe})})();})(); diff --git a/src/pbr_preview/src/index.ts b/src/pbr_preview/src/index.ts index f7d9d70b..3049c388 100644 --- a/src/pbr_preview/src/index.ts +++ b/src/pbr_preview/src/index.ts @@ -193,7 +193,7 @@ interface IChannel { getMaterial(options: THREE.MeshStandardMaterialParameters = {}) { const { emissiveMap, roughnessMap, metalnessMap } = this.merToCanvas(); - return new THREE.MeshStandardMaterial({ + const mat = new THREE.MeshStandardMaterial({ map: this.getTexture(CHANNELS.albedo) ?? PbrMaterial.makePixelatedCanvas( @@ -202,13 +202,11 @@ interface IChannel { Texture.getDefault().canvas, ), aoMap: this.getTexture(CHANNELS.ao), - normalMap: this.getTexture(CHANNELS.normal), - normalScale: new THREE.Vector2(1, 1), bumpMap: this.getTexture(CHANNELS.height), metalnessMap, - metalness: metalnessMap ? Settings.get("global_metalness") : undefined, + metalness: metalnessMap ? Settings.get("global_metalness") : 0, roughnessMap, - roughness: roughnessMap ? Settings.get("global_roughness") : undefined, + roughness: roughnessMap ? Settings.get("global_roughness") : 1, emissiveMap, emissiveIntensity: emissiveMap ? 1 : 0, emissive: emissiveMap ? 0xffffff : 0, @@ -217,9 +215,18 @@ interface IChannel { alphaTest: 0.5, ...options, }); + + const normalMap = this.getTexture(CHANNELS.normal); + + if (normalMap) { + mat.normalMap = normalMap; + mat.normalScale = new THREE.Vector2(1, 1); + } + + return mat; } - saveTexture(channel: IChannel, { uuid, extend }: Texture | TextureLayer) { + saveTexture(channel: IChannel, texture: Texture | TextureLayer) { if (!Project) { return; } @@ -232,8 +239,8 @@ interface IChannel { Project.pbr_materials[this._materialUuid] = {}; } - Project.pbr_materials[this._materialUuid][channel.id] = uuid; - extend({ channel: channel.id }); + Project.pbr_materials[this._materialUuid][channel.id] = texture.uuid; + texture.extend({ channel: channel.id }); } /** @@ -1385,7 +1392,7 @@ interface IChannel { Undo.initEdit({ layers: [layer] }); - layer.extend({ channel: key }); + layer.extend({ channel: channel.id }); const texture = layer.texture; @@ -1522,6 +1529,23 @@ interface IChannel { step: 0.01, default: 0, }, + condition: () => { + if (!Project) { + return false; + } + + const texture = Project.selected_texture; + + if (!texture?.layers_enabled) { + return false; + } + + return ( + texture.layers.find( + ({ channel }) => channel === CHANNELS.metalness.id, + ) !== undefined + ); + }, }); brushRoughnessSlider = new NumSlider("slider_brush_roughness", { @@ -1534,6 +1558,23 @@ interface IChannel { step: 0.01, default: 1, }, + condition: () => { + if (!Project) { + return false; + } + + const texture = Project.selected_texture; + + if (!texture?.layers_enabled) { + return false; + } + + return ( + texture.layers.find( + ({ channel }) => channel === CHANNELS.roughness.id, + ) !== undefined + ); + }, }); brushEmissiveColor = new ColorPicker("brush_emissive_color", { @@ -1541,6 +1582,23 @@ interface IChannel { name: "Emissive", description: "Adjust the emissive color of the brush", value: "#000000", + condition: () => { + if (!Project) { + return false; + } + + const texture = Project.selected_texture; + + if (!texture?.layers_enabled) { + return false; + } + + return ( + texture.layers.find( + ({ channel }) => channel === CHANNELS.emissive.id, + ) !== undefined + ); + }, }); brushHeightSlider = new NumSlider("slider_brush_height", { @@ -1553,6 +1611,23 @@ interface IChannel { step: 0.01, default: 0.5, }, + condition: () => { + if (!Project) { + return false; + } + + const texture = Project.selected_texture; + + if (!texture?.layers_enabled) { + return false; + } + + return ( + texture.layers.find( + ({ channel }) => channel === CHANNELS.height.id, + ) !== undefined + ); + }, }); materialBrushTool = new Tool("material_brush", { @@ -1576,27 +1651,35 @@ interface IChannel { changePixel(x, y, px, alpha, { size, softness, texture }) { const mat = MaterialBrush.fromSettings(); - texture.layers - .filter( - ({ visible, channel }) => - visible && channel && channel !== NA_CHANNEL, - ) - .forEach((layer) => { - const fill = mat.getChannel(layer.channel); + const matChannels = Object.keys(mat.colors); - if (!fill) { - return; - } + let rgba = px; - layer.ctx.fillStyle = fill.getStyle(); - layer.ctx.fillRect(size * x, size * y, size, size); - }); + texture.layers.forEach((layer) => { + if (!layer.visible || !matChannels.includes(layer.channel)) { + return; + } - texture.updateChangesAfterEdit(); + const fill = mat.getChannel(layer.channel); - Canvas.updateAllFaces(texture); + if (!fill) { + return; + } - return px; + layer.ctx.fillStyle = fill.getStyle(); + layer.ctx.fillRect(size * x, size * y, size, size); + + if (layer.selected) { + rgba = { + r: fill.r * 255, + g: fill.g * 255, + b: fill.b * 255, + a: alpha * 255, + }; + } + }); + + return rgba; }, }, onCanvasClick(data) { @@ -1610,8 +1693,6 @@ interface IChannel { }, }); - MenuBar.addAction(materialBrushTool, "tools.0"); - // // UI // @@ -1661,6 +1742,7 @@ interface IChannel { new Toolbar(`${PLUGIN_ID}_material_brush_toolbar`, { id: `${PLUGIN_ID}_material_brush_toolbar`, children: [ + "material_brush", "slider_brush_metalness", "slider_brush_roughness", "brush_emissive_color", @@ -1694,6 +1776,7 @@ interface IChannel { MenuBar.addAction(togglePbr, "view"); MenuBar.addAction(toggleCorrectLights, "preview"); MenuBar.addAction(createMaterialTexture, "tools"); + MenuBar.addAction(materialBrushTool, "tools.0"); Object.entries(channelActions).forEach(([key, action], idx) => { MenuBar.addAction(action, `image.${idx}`); From a40e640fa69b015850660cb6eaca640f834da6a5 Mon Sep 17 00:00:00 2001 From: Jason Gardner Date: Thu, 30 May 2024 16:34:51 -0500 Subject: [PATCH 12/50] upd: Improved controls and channel assignment - Removed controls from settings panel to reduce jank between panel controls and settings values - Added display conditions for removing channel - Added channel assignment menu to menu group - Added channel assignment for textures that are not layered or with usage inferred - Updated tone mapping/exposure controls to affect all previews - Updated decode MER to split channels into layers - Updated texture set export to include depth map in output --- plugins/pbr_preview/about.md | 32 +-- plugins/pbr_preview/pbr_preview.js | 2 +- src/pbr_preview/src/index.ts | 404 +++++++++++++++++------------ 3 files changed, 259 insertions(+), 179 deletions(-) diff --git a/plugins/pbr_preview/about.md b/plugins/pbr_preview/about.md index 5c529887..ec827473 100644 --- a/plugins/pbr_preview/about.md +++ b/plugins/pbr_preview/about.md @@ -9,7 +9,7 @@ __Create textures for Bedrock shaders with PBR support (Deferred Rendering / RTX > _PBR:_ Physically based rendering #### Auto-Updated Preview -- PBR materials are updated with every edit to provide a (nearly) live painting preview of the material in Blockbench. +- PBR materials are updated with every edit to provide a live painting preview of the material in Blockbench. ### MER Maps > _MER:_ Metallic, emissive, and roughness maps assigned to red, green, and blue channels respectively. It is the format used in Bedrock texture sets. @@ -28,7 +28,7 @@ __Create textures for Bedrock shaders with PBR support (Deferred Rendering / RTX ### Export Texture Set - Create a `.texture_set.json` file for the project textures. - Dialog allows defining values which can not be inferred from project. -- Exports MER in the process. +- Exports MER and normal maps in the process. ## Usage @@ -49,6 +49,14 @@ This plugin adds the _PBR Settings_ panel, which controls enabling and disabling - Use the _Correct Lights_ toggle to enable or disable physically-corrected lighting in the preview scene. This may improve the appearance of reflective and emissive materials in the preview scene, but will dim the albedo/base color texture. +#### Tone Mapping + +- The _Tone Mapping_ select will apply various tone mapping techniques to the preview scene. Use the _Linear_ option to match the tone map used by most Bedrock shaders. + +#### Exposure + +- The scene exposure can be adjusted once a tone map technique is selected. Values range from -2.0 to 2.0. + ### Channel Management Control which textures or texture layers are used for PBR channels using the following methods: @@ -84,25 +92,11 @@ Channels can be disabled by hiding or deleting the layer, or un-assigning the ch Use the _Material Brush Tool_ to paint across multiple PBR channels simultaneously.The controls found in the _Material Brush Panel_ +- Set the metallic, roughness and height values on a scale of 0% - 100% +- Use the color picker in the _Material Brush Panel_ to set the emissive color. - The current color selected in the main color picker is used as the albedo color. - Only visible layers with channels assigned will be updated by the brush. - -### Plugin Settings - -The following Blockbench settings are added by this plugin: - -#### Global Metalness / Roughness - -- Adjusts the metalness or roughness multiplier used in the PBR Preview scene. - -#### Tone Mapping - -- The _Tone Mapping_ setting will apply various tone mapping techniques to the preview scene. Use the _Linear_ option to match the tone map used by most Bedrock shaders. - -#### Exposure - -- The scene exposure can be adjusted once a tone map technique is selected. Values range from -2.0 to 2.0. (Exposure settings only work when tone mapping is applied.) - +- Blockbench's paint brush size and smoothness settings control the material brush's settings as well. --- diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index 3134f211..d992ec18 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1 +1 @@ -"use strict";(()=>{(()=>{let j,R,S,k,F,L,A,G,Q,M,z,J,V,ue,de,D,X,q,K,W,Y,Z,ee,te,ne,B,he,N,H,$,I,U={},c="pbr_preview",me="1.0.0",ae="_NONE_",l={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new THREE.Color(16777215)},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new THREE.Color(0)},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new THREE.Color(0)},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new THREE.Color(16777215)},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new THREE.Color(16777215)},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new THREE.Color("rgb(128, 128, 255)")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new THREE.Color(16777215)}},E=(n=!0)=>{let e=Project?Project.textures??Texture.all:Texture.all;return n?e.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):e};class x{constructor(e,t){this._scope=e??E(),this._materialUuid=t}merToCanvas(){let e=this.getTexture(l.emissive),t=this.getTexture(l.roughness),r=this.getTexture(l.metalness);if(!e&&!t&&!r){let{metalness:a,emissive:s,roughness:o}=this.decodeMer();a&&(r=x.makePixelatedCanvas(a)),s&&(e=x.makePixelatedCanvas(s)),o&&(t=x.makePixelatedCanvas(o))}return{emissiveMap:e,roughnessMap:t,metalnessMap:r}}getMaterial(e={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:a}=this.merToCanvas(),s=new THREE.MeshStandardMaterial({map:this.getTexture(l.albedo)??x.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(i=>i.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(l.ao),bumpMap:this.getTexture(l.height),metalnessMap:a,metalness:a?Settings.get("global_metalness"):0,roughnessMap:r,roughness:r?Settings.get("global_roughness"):1,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:1,alphaTest:.5,...e}),o=this.getTexture(l.normal);return o&&(s.normalMap=o,s.normalScale=new THREE.Vector2(1,1)),s}saveTexture(e,t){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][e.id]=t.uuid,t.extend({channel:e.id}))}findTexture(e,t=!0){if(!Project)return null;let r=this._scope.find(i=>i.channel&&(i.channel===e||i.channel===e.id));if(r)return r;let a=typeof e=="string"?e:e.id;Project.pbr_materials??={};let s=Project.pbr_materials[this._materialUuid];if(!s&&t){let i=new RegExp(`_*${a}(.[^.]+)?$`,"i");return this._scope.find(u=>i.test(u.name))??null}let o=s?.[a];return o?this._scope.find(i=>i.uuid===o)??null:null}static makePixelatedCanvas(e){let t=new THREE.CanvasTexture(e,void 0,void 0,void 0,THREE.NearestFilter,THREE.NearestFilter);return t.needsUpdate=!0,t}getTexture(e){let t=this.findTexture(e);return t?x.makePixelatedCanvas(t.canvas):null}static extractChannel(e,t){let r=e.canvas,a=r.width,s=r.height,o=r.getContext("2d");if(!o||!a||!s)return null;let i=document.createElement("canvas");i.width=a,i.height=s;let u=i.getContext("2d");if(!u)return null;let h={r:0,g:1,b:2,a:3}[t],{data:d}=o.getImageData(0,0,a,s),g=new Uint8ClampedArray(a*s*4);for(let p=0;pe){_[f]=v.data[f],_[f+1]=v.data[f+1],_[f+2]=v.data[f+2],_[f+3]=255;continue}_[f]=0,_[f+1]=0,_[f+2]=0,_[f+3]=255}return h.putImageData(new ImageData(_,i.width,i.height),0,0),{metalness:r,emissive:i,emissiveLevel:a,roughness:s,sss:o}}createMer(e=!1){let t=this.findTexture(l.metalness,e),r=this.findTexture(l.emissive,e),a=this.findTexture(l.roughness,e),s=this.findTexture("sss",!1),o=Math.max(t?.img.width??0,r?.img.width??0,a?.img.width??0,Project?Project.texture_width:0,16),i=Math.max(t?.img.height??0,r?.img.height??0,a?.img.height??0,Project?Project.texture_height:0,16),u=document.createElement("canvas");u.width=o,u.height=i;let h=u.getContext("2d");if(!h)return null;let d=t?.img?x.extractChannel(t,"r"):null,g=r?.img?x.extractChannel(r,"g"):null,v=a?.img?x.extractChannel(a,"b"):null,p=s&&s?.img?x.extractChannel(s,"a"):null,_=d?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),f=g?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),m=v?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),b=p?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(new Uint8ClampedArray(o*i*4).fill(255),o,i),C=new Uint8ClampedArray(o*i*4);for(let T=0;T{let C=(m+b*a)*4;return o[C]/255};i.width=a,i.height=s,u.drawImage(e.img,0,0,a,s);let d=u.getImageData(0,0,a,s),g=d.data,v=m=>{let b=Math.sqrt(m[0]*m[0]+m[1]*m[1]+m[2]*m[2]);return[m[0]/b,m[1]/b,m[2]/b]};for(let m=0;m[t,l[t].default??new THREE.Color(4294967040)])),...e}}get colors(){return this._colors}set colors(e){this._colors={...this._colors,...e}}getChannel(e){return this._colors[e]}static makeLinearColor(e){let t=Math.min(1,Math.max(0,e));return new THREE.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let e=Number(N.get()),t=Number(H.get()),r=$.get().toString(),a=Number(I.get()),s=ColorPanel.get(),o={[l.albedo.id]:new THREE.Color(s),[l.metalness.id]:y.makeLinearColor(e),[l.roughness.id]:y.makeLinearColor(t),[l.emissive.id]:new THREE.Color(r??"#000000"),[l.height.id]:y.makeLinearColor(a),[l.normal.id]:l.normal.default??new THREE.Color("#8080ff")};return new y({colors:o})}}z=new Property(TextureLayer,"enum","channel",{default:ae,values:Object.keys(l).map(n=>l[n].id),label:"PBR Channel",exposed:!1}),Z=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),ee=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),te=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"});let re=n=>{let e=Project?Project.selected_texture:Texture.all.find(r=>r.selected);if(!e)return;let t=new x(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!1);t&&t.toBlob(async r=>{if(!r)return;let[a,s]=Project?[`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await r.arrayBuffer(),type:"PNG",name:a,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},n)})},w=n=>{if(!Project||Texture.all.length===0)return;let e=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(r=>{let s=t.faces[r].getTexture();if(!s)return;let o=Project.materials[s.uuid];o.isShaderMaterial&&!Project.bb_materials[s.uuid]&&(Project.bb_materials[s.uuid]=o);let i=new x(s.layers_enabled?s.layers.filter(u=>u.visible)??null:Project.textures,s.uuid).getMaterial(n);Project.materials[s.uuid]=THREE.ShaderMaterial.prototype.copy.call(i,o),Canvas.updateAllFaces(s),e=!0})}),Project.pbr_active=e},ge=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(n=>{n instanceof Cube&&Object.keys(n.faces).forEach(e=>{let r=n.faces[e].getTexture();if(!r)return;let a=Project.bb_materials[r.uuid];a&&(Project.materials[r.uuid]=a)})}),Project.pbr_active=!1,Canvas.updateAll())},se=(n,e)=>{let t=e??document.createElement("canvas"),r=t.getContext("2d");if(!r)return null;let a=Math.max(Project?Project.texture_width:16,16),s=Math.max(Project?Project.texture_height:16,16);return t.width=a,t.height=s,r.fillStyle=`rgb(${n.r*255}, ${n.g*255}, ${n.b*255})`,r.fillRect(0,0,a,s),t.toDataURL()},pe=()=>{if(!Project)return;let n=E();Project.textures.forEach(e=>{let t=new x(n,e.uuid),r=t.findTexture(l.normal,!1)?.name,a=t.findTexture(l.height,!1)?.name,s=t.findTexture(l.albedo,!1)?.name,o=t.findTexture(l.metalness,!1)?.name,i=t.findTexture(l.emissive,!1)?.name,u=t.findTexture(l.roughness,!1)?.name,h={};return s||(h.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!i&&!u&&(h.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},h.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},h.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),r&&a&&(h.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),M=new Dialog(`${c}_texture_set`,{id:`${c}_texture_set`,title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:h,onConfirm(d){let g=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),v=o||i||u,p={format_version:"1.16.100","minecraft:texture_set":{color:(s?pathToName(s,!1):d.baseColor?.toHexString())??g,metalness_emissive_roughness:[d.metalness??0,d.emissive??0,d.roughness??255]}};d.depthMap==="normal"&&r?p["minecraft:texture_set"].normal=pathToName(r,!1):(!r||d.depthMap==="heightmap")&&a&&(p["minecraft:texture_set"].heightmap=pathToName(a,!1));let _=()=>Blockbench.export({content:JSON.stringify(p,null,2),type:"JSON",name:`${g}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path},()=>{Blockbench.showQuickMessage("Texture set created",2e3),M.hide()});if(v){re(f=>{p["minecraft:texture_set"].metalness_emissive_roughness=pathToName(f,!1),_()});return}_()},cancelIndex:1}),M.show(),M})},ie=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],oe=()=>Project&&Project.pbr_active&&w(),le=()=>{ie.forEach(n=>{Blockbench.addListener(n,oe)})},ce=()=>{ie.forEach(n=>{Blockbench.removeListener(n,oe)})},fe=()=>{G=new Setting("pbr_active",{category:"preview",name:"Enable PBR Preview",description:"Enables PBR preview in the editor",type:"toggle",default_value:!1,icon:"tonality",onChange(n){if(n){w(),le();return}ge(),ce()}}),q=new Setting("display_settings_correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview for PBR materials",type:"toggle",default_value:!1,icon:"light_mode",onChange(n){Preview.selected.renderer.physicallyCorrectLights=n,w()}}),K=new Setting("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:THREE.NoToneMapping,value:THREE.NoToneMapping,icon:"palette",options:{[THREE.NoToneMapping]:"None",[THREE.LinearToneMapping]:"Linear",[THREE.ReinhardToneMapping]:"Reinhard",[THREE.CineonToneMapping]:"Cineon",[THREE.ACESFilmicToneMapping]:"ACES"},onChange(n){Preview.selected.renderer.toneMapping=Number(n),w()}}),X=new Setting("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",default_value:1,icon:"exposure",step:.1,min:-2,max:2,onChange(n){Preview.selected.renderer.toneMappingExposure=Math.max(-2,Math.min(2,Number(n))),w()}}),W=new Setting("global_metalness",{category:"preview",name:"Global Metalness",description:"Adjusts the base metalness of the scene",type:"number",default_value:0,icon:"iron",step:.01,min:0,max:1}),Y=new Setting("global_roughness",{category:"preview",name:"Global Roughness",description:"Adjusts the base roughness of the scene",type:"number",default_value:0,icon:"grain",step:.01,min:0,max:1}),k=new Action(`${c}_generate_normal`,{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(n=>n.selected))!==void 0,click(){let n=TextureLayer.selected??Texture.all.find(a=>a.selected),e=new x(E(),n.uuid),t=TextureLayer.selected??Texture.all.find(a=>a.selected)??e.findTexture(l.height,!0);if(!t){Blockbench.showQuickMessage("No height map found",2e3);return}let r=x.createNormalMap(t);if(r){e.saveTexture(l.normal,r),r.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),S=new Action(`${c}_create_mer`,{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",click(){re()}}),j=new Action(`${c}_decode_mer`,{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",click(){let n=E(),e=TextureLayer.selected?.texture??Texture.all.find(s=>s.selected),t=new x(n,(e??n[0]).uuid),r=t.decodeMer();[l.metalness,l.emissive,l.roughness].forEach(s=>{let o=s.id,i=r[o];if(!i)return;let u=new TextureLayer({name:`${e?.name}_${o}`,data_url:i.toDataURL()},e.layers_enabled?e.texture:e);t.saveTexture(s,u)})}}),R=new Action(`${c}_create_texture_set`,{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){pe()},condition:{formats:["bedrock"],project:!0}}),L=new Action(`${c}_create_material_texture`,{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",click(){if(!Project)return;let n=new Texture({name:"New Material",saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}),e=se(new THREE.Color(8421504));e&&(n.fromDataURL(e).add().select(),Object.keys(l).forEach(t=>{let r=l[t],a=new TextureLayer({name:r.label,visible:!0},n);a.setSize(n.width,n.height);let s=se(r.default??new THREE.Color(0),a.canvas);s&&a.texture.fromDataURL(s),a.extend({channel:r.id}),a.addForEditing()}))}}),Object.entries(l).forEach(([n,e])=>{U[n]=new Action(`${c}_assign_channel_${n}`,{icon:e.icon??"tv_options_edit_channels",name:`Assign to ${e.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${e.label} channel`,category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(t){let r=TextureLayer.selected;if(!r||!Project)return;Undo.initEdit({layers:[r]}),r.extend({channel:e.id});let a=r.texture;a.updateChangesAfterEdit(),Project.pbr_materials[a.uuid]||(Project.pbr_materials[a.uuid]={}),Object.entries(Project.pbr_materials[a.uuid]).forEach(([s,o])=>{o===r.uuid&&delete Project.pbr_materials[a.uuid][s]}),Project.pbr_materials[a.uuid][n]=r.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${r.name}" to ${e.label} channel`,2e3),w()}})}),F=new Action(`${c}_unassign_channel`,{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",click(){let n=TextureLayer.selected;if(!n||!Project)return;Undo.initEdit({layers:[n]});let{texture:e,channel:t}=n;e.updateChangesAfterEdit(),Project.pbr_materials[e.uuid]={},n.channel=ae,Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${n.name}" from ${t} channel`,2e3),w()}}),A=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",linked_setting:"pbr_active",default:!1,click(){},onChange(n){Blockbench.showQuickMessage(`PBR Preview is now ${n?"enabled":"disabled"}`,2e3)}}),D=new Toggle(`${c}_correct_lights`,{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",linked_setting:"display_settings_correct_lights",default:!1,onChange(n){Blockbench.showQuickMessage(`Physically corrected lighting is now ${n?"enabled":"disabled"}`,2e3)},click(){}}),J=new Menu(`${c}_channel_menu`,[...Object.keys(l).map(n=>`${c}_assign_channel_${n}`),`${c}_unassign_channel`],{onOpen(){w()}}),V=new Action(`${c}_show_channel_menu`,{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:()=>Modes.paint&&TextureLayer.selected,click(n){J.open(n)}}),N=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",settings:{min:0,max:1,step:.01,default:0},condition:()=>{if(!Project)return!1;let n=Project.selected_texture;return n?.layers_enabled?n.layers.find(({channel:e})=>e===l.metalness.id)!==void 0:!1}}),H=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",settings:{min:0,max:1,step:.01,default:1},condition:()=>{if(!Project)return!1;let n=Project.selected_texture;return n?.layers_enabled?n.layers.find(({channel:e})=>e===l.roughness.id)!==void 0:!1}}),$=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",condition:()=>{if(!Project)return!1;let n=Project.selected_texture;return n?.layers_enabled?n.layers.find(({channel:e})=>e===l.emissive.id)!==void 0:!1}}),I=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",settings:{min:0,max:1,step:.01,default:.5},condition:()=>{if(!Project)return!1;let n=Project.selected_texture;return n?.layers_enabled?n.layers.find(({channel:e})=>e===l.height.id)!==void 0:!1}}),B=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",condition:{project:!0,modes:["paint"]},brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(n,e,t,r,{size:a,softness:s,texture:o}){let i=y.fromSettings(),u=Object.keys(i.colors),h=t;return o.layers.forEach(d=>{if(!d.visible||!u.includes(d.channel))return;let g=i.getChannel(d.channel);g&&(d.ctx.fillStyle=g.getStyle(),d.ctx.fillRect(a*n,a*e,a,a),d.selected&&(h={r:g.r*255,g:g.g*255,b:g.b*255,a:r*255}))}),h}},onCanvasClick(n){Painter.startPaintToolCanvas(n,n.event)},onSelect(){w()},click(){w()}}),Q=new Panel(`${c}_display_settings`,{name:"PBR Settings",id:`${c}_display_settings_panel`,icon:"display_settings",toolbars:[new Toolbar(`${c}_controls_toolbar`,{id:`${c}_controls_toolbar`,children:["toggle_pbr",`${c}_correct_lights`,`${c}_show_channel_menu`,`${c}_create_material_texture`],name:"PBR"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"}),ne=new Panel(`${c}_material_brush_panel`,{name:"Material Brush",id:`${c}_material_brush_panel`,icon:"view_in_ar",toolbars:[new Toolbar(`${c}_material_brush_toolbar`,{id:`${c}_material_brush_toolbar`,children:["material_brush","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Brush"})],condition:()=>Modes.paint,component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"}),MenuBar.addAction(S,"file.export"),MenuBar.addAction(k,"tools"),MenuBar.addAction(j,"tools"),MenuBar.addAction(R,"file.export"),MenuBar.addAction(A,"view"),MenuBar.addAction(D,"preview"),MenuBar.addAction(L,"tools"),MenuBar.addAction(B,"tools.0"),Object.entries(U).forEach(([n,e],t)=>{MenuBar.addAction(e,`image.${t}`)}),le()},xe=()=>{Object.entries(U).forEach(([n,e])=>{e.delete()}),MenuBar.removeAction(`file.export.${c}_create_mer`),MenuBar.removeAction(`file.export.${c}_create_texture_set`),MenuBar.removeAction(`tools.${c}_generate_normal`),ce(),Q?.delete(),M?.delete(),G?.delete(),L?.delete(),S?.delete(),k?.delete(),A?.delete(),j?.delete(),R?.delete(),z?.delete(),V?.delete(),X?.delete(),ue?.delete(),de?.delete(),D?.delete(),q?.delete(),K?.delete(),F?.delete(),ee?.delete(),Z?.delete(),te?.delete(),W?.delete(),Y?.delete(),B?.delete(),ne?.delete(),he?.delete(),N?.delete(),H?.delete(),$?.delete(),I?.delete()};BBPlugin.register(c,{version:me,title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.1",onload:fe,onunload:xe})})();})(); +"use strict";(()=>{(()=>{let L,k,A,B,D,N,M,X,y,q,K,H,W,S,j,$,Y,Z,ee,te,I,ie,U,O,F,G,Q,V={},c="pbr_preview",le="1.0.0",C="_NONE_",l={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new THREE.Color(16777215)},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new THREE.Color(0)},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new THREE.Color(0)},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new THREE.Color(16777215)},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new THREE.Color(16777215)},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new THREE.Color("rgb(128, 128, 255)")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new THREE.Color(16777215)}},z=(t=!0)=>{let e=Project?Project.textures??Texture.all:Texture.all;return t?e.filter(n=>n.layers_enabled&&n.layers.length>0).flatMap(n=>n.layers):e};class x{constructor(e,n){this._scope=e??z(),this._materialUuid=n}merToCanvas(){let e=this.getTexture(l.emissive),n=this.getTexture(l.roughness),r=this.getTexture(l.metalness);if(!e&&!n&&!r){let{metalness:a,emissive:s,roughness:i}=this.decodeMer();a&&(r=x.makePixelatedCanvas(a)),s&&(e=x.makePixelatedCanvas(s)),i&&(n=x.makePixelatedCanvas(i))}return{emissiveMap:e,roughnessMap:n,metalnessMap:r}}getMaterial(e={}){let{emissiveMap:n,roughnessMap:r,metalnessMap:a}=this.merToCanvas(),s=new THREE.MeshStandardMaterial({map:this.getTexture(l.albedo)??x.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(o=>o.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(l.ao),bumpMap:this.getTexture(l.height),metalnessMap:a,metalness:a?1:0,roughnessMap:r,roughness:1,emissiveMap:n,emissiveIntensity:n?1:0,emissive:n?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:1,alphaTest:.5,...e}),i=this.getTexture(l.normal);return i&&(s.normalMap=i,s.normalScale=new THREE.Vector2(1,1)),s}saveTexture(e,n){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][e.id]=n.uuid,n.extend({channel:e.id}))}findTexture(e,n=!0){if(!Project)return null;let r=this._scope.find(o=>o.channel&&(o.channel===e||o.channel===e.id));if(r)return r;let a=typeof e=="string"?e:e.id;Project.pbr_materials??={};let s=Project.pbr_materials[this._materialUuid];if(!s&&n&&a!==C){let o=new RegExp(`_*${a}(.[^.]+)?$`,"i");return this._scope.find(h=>o.test(h.name))??null}let i=s?.[a];return i?this._scope.find(o=>o.uuid===i)??null:null}static makePixelatedCanvas(e){let n=new THREE.CanvasTexture(e,void 0,void 0,void 0,THREE.NearestFilter,THREE.NearestFilter);return n.needsUpdate=!0,n}getTexture(e){let n=this.findTexture(e);return n?x.makePixelatedCanvas(n.canvas):null}static extractChannel(e,n){let r=e.canvas,a=r.width,s=r.height,i=r.getContext("2d");if(!i||!a||!s)return null;let o=document.createElement("canvas");o.width=a,o.height=s;let h=o.getContext("2d");if(!h)return null;let m={r:0,g:1,b:2,a:3}[n],{data:d}=i.getImageData(0,0,a,s),p=new Uint8ClampedArray(a*s*4);for(let f=0;fe){b[g]=T.data[g],b[g+1]=T.data[g+1],b[g+2]=T.data[g+2],b[g+3]=255;continue}b[g]=0,b[g+1]=0,b[g+2]=0,b[g+3]=255}return m.putImageData(new ImageData(b,o.width,o.height),0,0),{metalness:r,emissive:o,emissiveLevel:a,roughness:s,sss:i}}createMer(e=!1){let n=this.findTexture(l.metalness,e),r=this.findTexture(l.emissive,e),a=this.findTexture(l.roughness,e),s=this.findTexture("sss",!1),i=Math.max(n?.img.width??0,r?.img.width??0,a?.img.width??0,Project?Project.texture_width:0,16),o=Math.max(n?.img.height??0,r?.img.height??0,a?.img.height??0,Project?Project.texture_height:0,16),h=document.createElement("canvas");h.width=i,h.height=o;let m=h.getContext("2d");if(!m)return null;let d=n?.img?x.extractChannel(n,"r"):null,p=r?.img?x.extractChannel(r,"g"):null,T=a?.img?x.extractChannel(a,"b"):null,f=s&&s?.img?x.extractChannel(s,"a"):null,b=d?.getContext("2d")?.getImageData(0,0,i,o)??new ImageData(i,o),g=p?.getContext("2d")?.getImageData(0,0,i,o)??new ImageData(i,o),u=T?.getContext("2d")?.getImageData(0,0,i,o)??new ImageData(i,o),_=f?.getContext("2d")?.getImageData(0,0,i,o)??new ImageData(new Uint8ClampedArray(i*o*4).fill(255),i,o),w=new Uint8ClampedArray(i*o*4);for(let v=0;v{let w=(u+_*a)*4;return i[w]/255};o.width=a,o.height=s,h.drawImage(e.img,0,0,a,s);let d=h.getImageData(0,0,a,s),p=d.data,T=u=>{let _=Math.sqrt(u[0]*u[0]+u[1]*u[1]+u[2]*u[2]);return[u[0]/_,u[1]/_,u[2]/_]};for(let u=0;u[n,l[n].default??new THREE.Color(4294967040)])),...e}}get colors(){return this._colors}set colors(e){this._colors={...this._colors,...e}}getChannel(e){return this._colors[e]}static makeLinearColor(e){let n=Math.min(1,Math.max(0,e));return new THREE.Color(n,n,n).convertSRGBToLinear()}static fromSettings(){let e=Number(U.get()),n=Number(O.get()),r=F.get().toString(),a=Number(G.get()),s=ColorPanel.get(),i={[l.albedo.id]:new THREE.Color(s),[l.metalness.id]:E.makeLinearColor(e),[l.roughness.id]:E.makeLinearColor(n),[l.emissive.id]:new THREE.Color(r??"#000000"),[l.height.id]:E.makeLinearColor(a),[l.normal.id]:l.normal.default??new THREE.Color("#8080ff")};return new E({colors:i})}}K=new Property(TextureLayer,"enum","channel",{default:C,values:Object.keys(l).map(t=>l[t].id),label:"PBR Channel",exposed:!1}),q=new Property(Texture,"enum","channel",{default:C,values:Object.keys(l).map(t=>l[t].id),label:"PBR Channel",exposed:!1}),Y=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),Z=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),ee=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"});let ne=t=>{let e=Project?Project.selected_texture:Texture.all.find(r=>r.selected);if(!e)return;let n=new x(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!1);n&&n.toBlob(async r=>{if(!r)return;let[a,s]=Project?[`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await r.arrayBuffer(),type:"PNG",name:a,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},t)})},P=t=>{if(!Project||Texture.all.length===0)return;let e=!1;Project.elements.forEach(n=>{n instanceof Cube&&Object.keys(n.faces).forEach(r=>{let s=n.faces[r].getTexture();if(!s)return;let i=Project.materials[s.uuid];i.isShaderMaterial&&!Project.bb_materials[s.uuid]&&(Project.bb_materials[s.uuid]=i);let o=new x(s.layers_enabled?s.layers.filter(h=>h.visible)??null:Project.textures,s.uuid).getMaterial(t);Project.materials[s.uuid]=THREE.ShaderMaterial.prototype.copy.call(o,i),Canvas.updateAllFaces(s),e=!0})}),Project.pbr_active=e},ce=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(e=>{let r=t.faces[e].getTexture();if(!r)return;let a=Project.bb_materials[r.uuid];a&&(Project.materials[r.uuid]=a)})}),Project.pbr_active=!1,Canvas.updateAll())},ae=(t,e)=>{let n=e??document.createElement("canvas"),r=n.getContext("2d");if(!r)return null;let a=Math.max(Project?Project.texture_width:16,16),s=Math.max(Project?Project.texture_height:16,16);return n.width=a,n.height=s,r.fillStyle=`rgb(${t.r*255}, ${t.g*255}, ${t.b*255})`,r.fillRect(0,0,a,s),n.toDataURL()},ue=()=>{if(!Project)return;let t=z();Project.textures.forEach(e=>{let n=new x(t,e.uuid),r=n.findTexture(l.normal,!1)?.name,a=n.findTexture(l.height,!1)?.name,s=n.findTexture(l.albedo,!1)?.name,i=n.findTexture(l.metalness,!1)?.name,o=n.findTexture(l.emissive,!1)?.name,h=n.findTexture(l.roughness,!1)?.name,m={};return s||(m.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!i&&!o&&!h&&(m.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},m.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},m.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),r&&a&&(m.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),y=new Dialog(`${c}_texture_set`,{id:`${c}_texture_set`,title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:m,onConfirm(d){let p=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),T=i||o||h,f={format_version:"1.16.100","minecraft:texture_set":{color:(s?pathToName(s,!1):d.baseColor?.toHexString())??p,metalness_emissive_roughness:[d.metalness??0,d.emissive??0,d.roughness??255]}};d.depthMap==="normal"&&r?f["minecraft:texture_set"].normal=pathToName(r,!1):(!r||d.depthMap==="heightmap")&&a&&(f["minecraft:texture_set"].heightmap=pathToName(a,!1));let b=u=>{let _=d.depthMap==="normal"?r:a;if(!_)return u();Blockbench.export({content:_,type:"PNG",name:`${p}_${d.depthMap}`,extensions:["png"],resource_id:d.depthMap,startpath:Project.export_path},u)},g=()=>b(()=>{Blockbench.export({content:JSON.stringify(f,null,2),type:"JSON",name:`${p}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path},()=>{Blockbench.showQuickMessage("Texture set created",2e3),y.hide()})});if(T){ne(u=>{f["minecraft:texture_set"].metalness_emissive_roughness=pathToName(u,!1),g()});return}g()},cancelIndex:1}),y.show(),y})},re=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],se=()=>Project&&Project.pbr_active&&P(),de=()=>{re.forEach(t=>{Blockbench.addListener(t,se)})},oe=()=>{re.forEach(t=>{Blockbench.removeListener(t,se)})},he=()=>{j=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:THREE.NoToneMapping,value:Preview.selected.renderer.toneMapping??THREE.NoToneMapping,icon:"monochrome_photos",options:{[THREE.NoToneMapping]:"None",[THREE.LinearToneMapping]:"Linear",[THREE.ReinhardToneMapping]:"Reinhard",[THREE.CineonToneMapping]:"Cineon",[THREE.ACESFilmicToneMapping]:"ACES"},onChange({value:t}){let e=Number(S.get());Preview.all.forEach(n=>{n.renderer.toneMapping=Number(t),n.renderer.toneMappingExposure=e}),Preview.selected.renderer.toneMapping=Number(t),Preview.selected.renderer.toneMappingExposure=e,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(t)}`,2e3),M.value||M.set(!0),P()}}),S=new BarSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",step:.1,min:-2,max:2,onBefore(){Number(j.get())===THREE.NoToneMapping&&j.change(THREE.LinearToneMapping.toString()),M.set(!0)},onChange({value:t}){let e=Math.max(-2,Math.min(2,Number(t)));Preview.all.forEach(n=>{n.renderer.toneMappingExposure=e}),Preview.selected.renderer.toneMappingExposure=e},onAfter(){P()}}),B=new Action(`${c}_generate_normal`,{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(t=>t.selected))!==void 0,click(){let t=TextureLayer.selected??Project?Project.selected_texture.selected_layer??Project.selected_texture:Texture.getDefault();if(!t)return;let e=new x(t.layers_enabled?t.layers:z(),t.uuid),n=x.createNormalMap(t);if(n){e.saveTexture(l.normal,n),n.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),A=new Action(`${c}_create_mer`,{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",click(){ne()}}),L=new Action(`${c}_decode_mer`,{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",condition:()=>!!Project&&Project.selected_texture!==null&&!Project.selected_texture.layers_enabled,click(){let t=TextureLayer.selected?.texture??Texture.all.find(a=>a.selected)??Texture.getDefault(),e=new x(t.layers_enabled?t.layers:[t],t.uuid),n=e.decodeMer(),r=[l.metalness,l.emissive,l.roughness];Undo.initEdit({textures:[t]}),t.activateLayers(!0),r.forEach(a=>{let s=a.id,i=n[s];if(!i){Blockbench.showStatusMessage(`Failed to decode ${a.label} channel`,3e3);return}let o=new TextureLayer({name:`${t?.name}_${s}`,data_url:i.toDataURL()},t);e.saveTexture(a,o),o.addForEditing()}),Undo.finishEdit("Decode MER")}}),k=new Action(`${c}_create_texture_set`,{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){ue()},condition:{formats:["bedrock"],project:!0}}),N=new Action(`${c}_create_material_texture`,{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",click(){if(!Project)return;let t=new Texture({name:"New Material",saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}),e=ae(new THREE.Color(8421504));e&&(t.fromDataURL(e).add().select(),Object.keys(l).forEach(n=>{let r=l[n],a=new TextureLayer({name:r.label,visible:!0},t);a.setSize(Project.texture_width??t.width,Project.texture_height??t.height);let s=ae(r.default??new THREE.Color(0),a.canvas);s&&a.texture.fromDataURL(s),a.extend({channel:r.id}),a.addForEditing()}))}}),Object.entries(l).forEach(([t,e])=>{V[t]=new Action(`${c}_assign_channel_${t}`,{icon:e.icon??"tv_options_edit_channels",name:`Assign to ${e.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${e.label} channel`,category:"textures",condition:()=>Modes.paint&&(TextureLayer.selected||Project&&Project.selected_texture!==null),click(n){let r=TextureLayer.selected??(Project?Project.selected_texture:null);if(!r||!Project)return;Undo.initEdit({layers:[r]}),r.extend({channel:e.id});let a=r instanceof TextureLayer?r.texture:r;a.updateChangesAfterEdit(),Project.pbr_materials[a.uuid]||(Project.pbr_materials[a.uuid]={}),Object.entries(Project.pbr_materials[a.uuid]).forEach(([s,i])=>{i===r.uuid&&(delete Project.pbr_materials[a.uuid][s],r.channel=C)}),Project.pbr_materials[a.uuid][t]=r.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${r.name}" to ${e.label} channel`,2e3),P()}})}),D=new Action(`${c}_unassign_channel`,{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:()=>{if(!Modes.paint)return!1;if(TextureLayer.selected)return TextureLayer.selected.channel!==C||!TextureLayer.selected.channel;if(!Project)return!1;let t=Project.selected_texture;return t!==null&&(t.channel!==C||!t.channel)},click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t||!Project)return;Undo.initEdit({layers:[t]});let e=t instanceof TextureLayer?t.texture:t,n=t.channel;Project.pbr_materials[e.uuid]={},t.channel=C,e.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${t.name}" from ${n} channel`,2e3),P()}}),M=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(t){if(t){P(),de(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}ce(),oe(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),$=new Toggle(`${c}_correct_lights`,{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(t){Preview.all.forEach(e=>{e.renderer.physicallyCorrectLights=t}),Preview.selected.renderer.physicallyCorrectLights=t,Blockbench.showQuickMessage(`Physically corrected lighting is now ${t?"enabled":"disabled"}`,2e3),t&&M.set(!0),P()},click(){}}),U=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",settings:{min:0,max:1,step:.01,default:0},condition:()=>{if(!Project)return!1;let t=Project.selected_texture;return t?.layers_enabled?t.layers.find(({channel:e})=>e===l.metalness.id)!==void 0:!1}}),O=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",settings:{min:0,max:1,step:.01,default:1},condition:()=>{if(!Project)return!1;let t=Project.selected_texture;return t?.layers_enabled?t.layers.find(({channel:e})=>e===l.roughness.id)!==void 0:!1}}),F=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",condition:()=>{if(!Project)return!1;let t=Project.selected_texture;return t?.layers_enabled?t.layers.find(({channel:e})=>e===l.emissive.id)!==void 0:!1}}),G=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",settings:{min:0,max:1,step:.01,default:.5},condition:()=>{if(!Project)return!1;let t=Project.selected_texture;return t?.layers_enabled?t.layers.find(({channel:e})=>e===l.height.id)!==void 0:!1}}),I=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",condition:()=>Modes.paint&&!!Project&&Project.selected_texture&&Project.selected_texture.layers_enabled,brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(t,e,n,r,{size:a,softness:s,texture:i}){let o=E.fromSettings(),h=Object.keys(o.colors),m=n;return i.layers.forEach(d=>{if(!d.visible||!h.includes(d.channel))return;let p=o.getChannel(d.channel);p&&(d.ctx.fillStyle=p.getStyle(),d.ctx.fillRect(a*t,a*e,a,a),d.selected&&(m={r:p.r*255,g:p.g*255,b:p.b*255,a:r*255}))}),m}},onCanvasClick(t){Painter.startPaintToolCanvas(t,t.event)},onSelect(){P()},click(){P()}}),H=new Menu(`${c}_channel_menu`,[...Object.keys(l).map(t=>`${c}_assign_channel_${t}`),`${c}_unassign_channel`],{onOpen(){P()}}),Q=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",click(t){H.open(t)},children:[...Object.values(V),D]}),W=new Action(`${c}_show_channel_menu`,{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:()=>Modes.paint&&(TextureLayer.selected||Project&&Project.selected_texture!==null),click(t){H.open(t)}}),X=new Panel(`${c}_display_settings`,{name:"PBR Settings",id:`${c}_display_settings_panel`,icon:"display_settings",toolbars:[new Toolbar(`${c}_controls_toolbar`,{id:`${c}_controls_toolbar`,children:["toggle_pbr",`${c}_correct_lights`,`${c}_show_channel_menu`,`${c}_create_material_texture`],name:"PBR"}),new Toolbar(`${c}_display_settings_toolbar`,{id:`${c}_display_settings_toolbar`,children:["display_settings_tone_mapping","display_settings_exposure"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"}),te=new Panel(`${c}_material_brush_panel`,{name:"Material Brush",id:`${c}_material_brush_panel`,icon:"view_in_ar",toolbars:[new Toolbar(`${c}_material_brush_toolbar`,{id:`${c}_material_brush_toolbar`,children:["material_brush","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Brush"})],display_condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"}),MenuBar.addAction(A,"file.export"),MenuBar.addAction(B,"tools"),MenuBar.addAction(L,"tools"),MenuBar.addAction(k,"file.export"),MenuBar.addAction(M,"view"),MenuBar.addAction($,"preview"),MenuBar.addAction(N,"tools"),MenuBar.addAction(I,"tools.0"),MenuBar.addAction(Q,"image.0")},me=()=>{Object.entries(V).forEach(([t,e])=>{e.delete()}),MenuBar.removeAction(`file.export.${c}_create_mer`),MenuBar.removeAction(`file.export.${c}_create_texture_set`),MenuBar.removeAction(`tools.${c}_generate_normal`),oe(),X?.delete(),y?.delete(),N?.delete(),A?.delete(),B?.delete(),M?.delete(),L?.delete(),k?.delete(),q?.delete(),K?.delete(),W?.delete(),S?.delete(),j?.delete(),$?.delete(),D?.delete(),Z?.delete(),Y?.delete(),ee?.delete(),I?.delete(),te?.delete(),ie?.delete(),U?.delete(),O?.delete(),F?.delete(),G?.delete(),Q?.delete()};BBPlugin.register(c,{version:le,title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.1",onload:he,onunload:me})})();})(); diff --git a/src/pbr_preview/src/index.ts b/src/pbr_preview/src/index.ts index 3049c388..46d13eae 100644 --- a/src/pbr_preview/src/index.ts +++ b/src/pbr_preview/src/index.ts @@ -38,20 +38,15 @@ interface IChannel { let unassignChannel: Action; let createMaterialTexture: Action; let togglePbr: Toggle; - let pbrDisplaySetting: Setting; let displaySettingsPanel: Panel; let textureSetDialog: Dialog; + let textureChannelProp: Property; let channelProp: Property; let channelMenu: Menu; let showChannelMenu: Action; let exposureSlider: BarSlider; let tonemappingSelect: BarSelect; let toggleCorrectLights: Toggle; - let exposureSetting: Setting; - let correctLightsSetting: Setting; - let tonemappingSetting: Setting; - let globalMetalnessSetting: Setting; - let globalRoughnessSetting: Setting; let pbrMaterialsProp: Property; let projectMaterialsProp: Property; let projectPbrModeProp: Property; @@ -62,6 +57,7 @@ interface IChannel { let brushRoughnessSlider: NumSlider; let brushEmissiveColor: ColorPicker; let brushHeightSlider: NumSlider; + let openChannelMenu: Action; const channelActions: Record = {}; @@ -204,9 +200,9 @@ interface IChannel { aoMap: this.getTexture(CHANNELS.ao), bumpMap: this.getTexture(CHANNELS.height), metalnessMap, - metalness: metalnessMap ? Settings.get("global_metalness") : 0, + metalness: metalnessMap ? 1 : 0, roughnessMap, - roughness: roughnessMap ? Settings.get("global_roughness") : 1, + roughness: 1, emissiveMap, emissiveIntensity: emissiveMap ? 1 : 0, emissive: emissiveMap ? 0xffffff : 0, @@ -270,7 +266,8 @@ interface IChannel { Project.pbr_materials ??= {}; const materialData = Project.pbr_materials[this._materialUuid]; - if (!materialData && inference) { + // Don't infer the channel if it has already been assigned to NA_CHANNEL + if (!materialData && inference && channel !== NA_CHANNEL) { const filenameRegex = new RegExp(`_*${channel}(\.[^.]+)?$`, "i"); return this._scope.find((t) => filenameRegex.test(t.name)) ?? null; } @@ -358,7 +355,7 @@ interface IChannel { return channelCanvas; } - decodeMer(emissiveThreshold = 25.5): { + decodeMer(emissiveThreshold = 1): { metalness?: HTMLCanvasElement | null; emissive?: HTMLCanvasElement | null; emissiveLevel?: HTMLCanvasElement | null; @@ -622,6 +619,7 @@ interface IChannel { { name, data_url: dataUrl, + visible: true, }, texture.texture, ); @@ -712,6 +710,13 @@ interface IChannel { exposed: false, }); + textureChannelProp = new Property(Texture, "enum", "channel", { + default: NA_CHANNEL, + values: Object.keys(CHANNELS).map((key) => CHANNELS[key].id), + label: "PBR Channel", + exposed: false, + }); + pbrMaterialsProp = new Property(ModelProject, "object", "pbr_materials", { default: {}, exposed: false, @@ -1030,21 +1035,46 @@ interface IChannel { ); } - const exportTextureSet = () => + const exportDepthMap = (cb: () => void) => { + const depthMap = + formResult.depthMap === "normal" + ? projectNormalMap + : projectHeightMap; + + if (!depthMap) { + return cb(); + } + Blockbench.export( { - content: JSON.stringify(textureSet, null, 2), - type: "JSON", - name: `${baseName}.texture_set`, - extensions: ["json"], - resource_id: "texture_set", + content: depthMap, + type: "PNG", + name: `${baseName}_${formResult.depthMap}`, + extensions: ["png"], + resource_id: formResult.depthMap, startpath: Project.export_path, }, - () => { - Blockbench.showQuickMessage("Texture set created", 2000); - textureSetDialog.hide(); - }, + cb, ); + }; + + const exportTextureSet = () => + exportDepthMap(() => { + Blockbench.export( + { + content: JSON.stringify(textureSet, null, 2), + type: "JSON", + name: `${baseName}.texture_set`, + extensions: ["json"], + resource_id: "texture_set", + startpath: Project.export_path, + }, + () => { + Blockbench.showQuickMessage("Texture set created", 2000); + textureSetDialog.hide(); + }, + ); + }); if (hasMer) { exportMer((filePath) => { @@ -1110,48 +1140,17 @@ interface IChannel { const onload = () => { // - // Settings + // Controls // - pbrDisplaySetting = new Setting("pbr_active", { - category: "preview", - name: "Enable PBR Preview", - description: "Enables PBR preview in the editor", - type: "toggle", - default_value: false, - icon: "tonality", - onChange(value) { - if (value) { - applyPbrMaterial(); - enableListeners(); - return; - } - disablePbr(); - disableListeners(); - }, - }); - - correctLightsSetting = new Setting("display_settings_correct_lights", { - category: "preview", - name: "Correct Lights", - description: "Corrects the lighting in the preview for PBR materials", - type: "toggle", - default_value: false, - icon: "light_mode", - onChange(value) { - Preview.selected.renderer.physicallyCorrectLights = value; - - applyPbrMaterial(); - }, - }); - tonemappingSetting = new Setting("display_settings_tone_mapping", { + tonemappingSelect = new BarSelect("display_settings_tone_mapping", { category: "preview", name: "Tone Mapping", description: "Changes the tone mapping of the preview", type: "select", default_value: THREE.NoToneMapping, - value: THREE.NoToneMapping, - icon: "palette", + value: Preview.selected.renderer.toneMapping ?? THREE.NoToneMapping, + icon: "monochrome_photos", options: { [THREE.NoToneMapping]: "None", [THREE.LinearToneMapping]: "Linear", @@ -1159,59 +1158,61 @@ interface IChannel { [THREE.CineonToneMapping]: "Cineon", [THREE.ACESFilmicToneMapping]: "ACES", }, - onChange(value) { + onChange({ value }) { + const currentExposure = Number(exposureSlider.get()); + Preview.all.forEach((preview) => { + preview.renderer.toneMapping = Number(value) as THREE.ToneMapping; + preview.renderer.toneMappingExposure = currentExposure; + }); + Preview.selected.renderer.toneMapping = Number( value, ) as THREE.ToneMapping; + Preview.selected.renderer.toneMappingExposure = currentExposure; + + Blockbench.showQuickMessage( + `Tone mapping set to ${this.getNameFor(value)}`, + 2000, + ); + + if (!togglePbr.value) { + togglePbr.set(true); + } applyPbrMaterial(); }, }); - exposureSetting = new Setting("display_settings_exposure", { + exposureSlider = new BarSlider("display_settings_exposure", { category: "preview", name: "Exposure", description: "Adjusts the exposure of the scene", type: "number", - default_value: 1, + value: 1, icon: "exposure", step: 0.1, min: -2, max: 2, - onChange(value) { - Preview.selected.renderer.toneMappingExposure = Math.max( - -2, - Math.min(2, Number(value)), - ); + // condition: () => Number(tonemappingSelect.get()) !== THREE.NoToneMapping, + onBefore() { + if (Number(tonemappingSelect.get()) === THREE.NoToneMapping) { + tonemappingSelect.change(THREE.LinearToneMapping.toString()); + } + togglePbr.set(true); + }, + onChange({ value }) { + const exposureValue = Math.max(-2, Math.min(2, Number(value))); + Preview.all.forEach((preview) => { + preview.renderer.toneMappingExposure = exposureValue; + }); + Preview.selected.renderer.toneMappingExposure = exposureValue; + }, + onAfter() { applyPbrMaterial(); }, }); - globalMetalnessSetting = new Setting("global_metalness", { - category: "preview", - name: "Global Metalness", - description: "Adjusts the base metalness of the scene", - type: "number", - default_value: 0, - icon: "iron", - step: 0.01, - min: 0, - max: 1, - }); - - globalRoughnessSetting = new Setting("global_roughness", { - category: "preview", - name: "Global Roughness", - description: "Adjusts the base roughness of the scene", - type: "number", - default_value: 0, - icon: "grain", - step: 0.01, - min: 0, - max: 1, - }); - // // Actions // @@ -1224,20 +1225,21 @@ interface IChannel { (TextureLayer.selected || Texture.all.find((t) => t.selected)) !== undefined, click() { - const selected = - TextureLayer.selected ?? Texture.all.find((t) => t.selected); - const mat = new PbrMaterial(getProjectTextures(), selected.uuid); - const texture = - TextureLayer.selected ?? - Texture.all.find((t) => t.selected) ?? - mat.findTexture(CHANNELS.height, true); + TextureLayer.selected ?? Project + ? Project.selected_texture.selected_layer ?? + Project.selected_texture + : Texture.getDefault(); if (!texture) { - Blockbench.showQuickMessage("No height map found", 2000); return; } + const mat = new PbrMaterial( + texture.layers_enabled ? texture.layers : getProjectTextures(), + texture.uuid, + ); + const normalMap = PbrMaterial.createNormalMap(texture); if (normalMap) { @@ -1267,15 +1269,19 @@ interface IChannel { name: "Decode MER", description: "Decodes a MER texture map into metalness, emissive, and roughness channels", - // condition: () => Format.id == "bedrock", + condition: () => + !!Project && + Project.selected_texture !== null && + !Project.selected_texture.layers_enabled, click() { - const projectTextures = getProjectTextures(); const selected = - TextureLayer.selected?.texture ?? Texture.all.find((t) => t.selected); + TextureLayer.selected?.texture ?? + Texture.all.find((t) => t.selected) ?? + Texture.getDefault(); const mat = new PbrMaterial( - projectTextures, - (selected ?? projectTextures[0]).uuid, + selected.layers_enabled ? selected.layers : [selected], + selected.uuid, ); const mer = mat.decodeMer(); @@ -1285,11 +1291,18 @@ interface IChannel { CHANNELS.roughness, ]; + Undo.initEdit({ textures: [selected] }); + selected.activateLayers(true); + merChannels.forEach((channel) => { const key = channel.id as keyof typeof mer; const canvas = mer[key]; if (!canvas) { + Blockbench.showStatusMessage( + `Failed to decode ${channel.label} channel`, + 3000, + ); return; } @@ -1298,11 +1311,15 @@ interface IChannel { name: `${selected?.name}_${key}`, data_url: canvas.toDataURL(), }, - selected.layers_enabled ? selected.texture : selected, + selected, ); - // projectTextures.push(layer); + mat.saveTexture(channel, layer); + + layer.addForEditing(); }); + + Undo.finishEdit("Decode MER"); }, }); @@ -1344,7 +1361,6 @@ interface IChannel { } texture.fromDataURL(filler).add().select(); - // texture.activateLayers(false); // Create PBR channels as texture layers for the new texture Object.keys(CHANNELS).forEach((key) => { @@ -1358,7 +1374,10 @@ interface IChannel { texture, ); - layer.setSize(texture.width, texture.height); + layer.setSize( + Project.texture_width ?? texture.width, + Project.texture_height ?? texture.height, + ); const data = colorDataUrl( channel.default ?? new THREE.Color(0), @@ -1382,9 +1401,14 @@ interface IChannel { name: `Assign to ${channel.label.toLocaleLowerCase()} channel`, description: `Assign the selected layer to the ${channel.label} channel`, category: "textures", - condition: () => Modes.paint && TextureLayer.selected, + condition: () => + Modes.paint && + (TextureLayer.selected || + (Project && Project.selected_texture !== null)), click(e) { - const layer = TextureLayer.selected; + const layer = + TextureLayer.selected ?? + (Project ? Project.selected_texture : null); if (!layer || !Project) { return; @@ -1394,7 +1418,7 @@ interface IChannel { layer.extend({ channel: channel.id }); - const texture = layer.texture; + const texture = layer instanceof TextureLayer ? layer.texture : layer; texture.updateChangesAfterEdit(); @@ -1407,6 +1431,7 @@ interface IChannel { ([assignedChannel, assignedLayerUuid]) => { if (assignedLayerUuid === layer.uuid) { delete Project.pbr_materials[texture.uuid][assignedChannel]; + layer.channel = NA_CHANNEL; } }, ); @@ -1430,8 +1455,32 @@ interface IChannel { name: "Unassign Channel", description: "Unassign the selected layer from the channel", category: "textures", + condition: () => { + if (!Modes.paint) { + return false; + } + + if (TextureLayer.selected) { + return ( + TextureLayer.selected.channel !== NA_CHANNEL || + !TextureLayer.selected.channel + ); + } + + if (!Project) { + return false; + } + + const texture = Project.selected_texture; + + return ( + texture !== null && + (texture.channel !== NA_CHANNEL || !texture.channel) + ); + }, click() { - const layer = TextureLayer.selected; + const layer = + TextureLayer.selected ?? (Project ? Project.selected_texture : null); if (!layer || !Project) { return; @@ -1439,17 +1488,18 @@ interface IChannel { Undo.initEdit({ layers: [layer] }); - const { texture, channel } = layer; - - texture.updateChangesAfterEdit(); + const texture = layer instanceof TextureLayer ? layer.texture : layer; + const prevChannel = layer.channel; Project.pbr_materials[texture.uuid] = {}; layer.channel = NA_CHANNEL; + + texture.updateChangesAfterEdit(); Undo.finishEdit("Unassign channel"); Blockbench.showQuickMessage( - `Unassigned "${layer.name}" from ${channel} channel`, + `Unassigned "${layer.name}" from ${prevChannel} channel`, 2000, ); @@ -1462,14 +1512,21 @@ interface IChannel { description: "Toggle PBR Preview", icon: "panorama_photosphere", category: "view", - linked_setting: "pbr_active", default: false, click() {}, onChange(value) { - Blockbench.showQuickMessage( - `PBR Preview is now ${value ? "enabled" : "disabled"}`, - 2000, - ); + if (value) { + applyPbrMaterial(); + enableListeners(); + + Blockbench.showQuickMessage("PBR Preview is now enabled"); + + return; + } + disablePbr(); + disableListeners(); + + Blockbench.showQuickMessage("PBR Preview is now disabled"); }, }); @@ -1478,41 +1535,26 @@ interface IChannel { name: "Correct Lights", description: "Corrects the lighting in the preview", icon: "fluorescent", - linked_setting: "display_settings_correct_lights", default: false, onChange(value) { + Preview.all.forEach((preview) => { + preview.renderer.physicallyCorrectLights = value; + }); + + Preview.selected.renderer.physicallyCorrectLights = value; + Blockbench.showQuickMessage( `Physically corrected lighting is now ${value ? "enabled" : "disabled"}`, 2000, ); - }, - click() {}, - }); - channelMenu = new Menu( - `${PLUGIN_ID}_channel_menu`, - [ - ...Object.keys(CHANNELS).map( - (key) => `${PLUGIN_ID}_assign_channel_${key}`, - ), - ...[`${PLUGIN_ID}_unassign_channel`], - ], - { - onOpen() { - applyPbrMaterial(); - }, - }, - ); + if (value) { + togglePbr.set(true); + } - showChannelMenu = new Action(`${PLUGIN_ID}_show_channel_menu`, { - icon: "texture", - name: "Assign to PBR Channel", - description: "Assign the selected layer to a channel", - category: "textures", - condition: () => Modes.paint && TextureLayer.selected, - click(event) { - channelMenu.open(event as MouseEvent); + applyPbrMaterial(); }, + click() {}, }); // @@ -1636,10 +1678,11 @@ interface IChannel { icon: "view_in_ar", paintTool: true, cursor: "cell", - condition: { - project: true, - modes: ["paint"], - }, + condition: () => + Modes.paint && + !!Project && + Project.selected_texture && + Project.selected_texture.layers_enabled, brush: { blend_modes: false, shapes: true, @@ -1666,6 +1709,8 @@ interface IChannel { return; } + // TODO: Let softness affect the brush + layer.ctx.fillStyle = fill.getStyle(); layer.ctx.fillRect(size * x, size * y, size, size); @@ -1697,6 +1742,44 @@ interface IChannel { // UI // + channelMenu = new Menu( + `${PLUGIN_ID}_channel_menu`, + [ + ...Object.keys(CHANNELS).map( + (key) => `${PLUGIN_ID}_assign_channel_${key}`, + ), + ...[`${PLUGIN_ID}_unassign_channel`], + ], + { + onOpen() { + applyPbrMaterial(); + }, + }, + ); + + openChannelMenu = new Action("pbr_channel_menu", { + name: "Assign to PBR Channel", + icon: "texture", + click(event) { + channelMenu.open(event as MouseEvent); + }, + children: [...Object.values(channelActions), unassignChannel], + }); + + showChannelMenu = new Action(`${PLUGIN_ID}_show_channel_menu`, { + icon: "texture", + name: "Assign to PBR Channel", + description: "Assign the selected layer to a channel", + category: "textures", + condition: () => + Modes.paint && + (TextureLayer.selected || + (Project && Project.selected_texture !== null)), + click(event) { + channelMenu.open(event as MouseEvent); + }, + }); + displaySettingsPanel = new Panel(`${PLUGIN_ID}_display_settings`, { name: "PBR Settings", id: `${PLUGIN_ID}_display_settings_panel`, @@ -1712,6 +1795,14 @@ interface IChannel { ], name: "PBR", }), + new Toolbar(`${PLUGIN_ID}_display_settings_toolbar`, { + id: `${PLUGIN_ID}_display_settings_toolbar`, + children: [ + "display_settings_tone_mapping", + "display_settings_exposure", + ], + name: "Display Settings", + }), ], display_condition: { modes: ["edit", "paint", "animate"], @@ -1751,7 +1842,10 @@ interface IChannel { name: "Material Brush", }), ], - condition: () => Modes.paint, + display_condition: { + modes: ["paint"], + project: true, + }, component: {}, expand_button: true, growable: false, @@ -1778,11 +1872,7 @@ interface IChannel { MenuBar.addAction(createMaterialTexture, "tools"); MenuBar.addAction(materialBrushTool, "tools.0"); - Object.entries(channelActions).forEach(([key, action], idx) => { - MenuBar.addAction(action, `image.${idx}`); - }); - - enableListeners(); + MenuBar.addAction(openChannelMenu, "image.0"); }; // @@ -1800,27 +1890,22 @@ interface IChannel { displaySettingsPanel?.delete(); textureSetDialog?.delete(); - pbrDisplaySetting?.delete(); createMaterialTexture?.delete(); generateMer?.delete(); generateNormal?.delete(); togglePbr?.delete(); decodeMer?.delete(); createTextureSet?.delete(); + textureChannelProp?.delete(); channelProp?.delete(); showChannelMenu?.delete(); - exposureSetting?.delete(); exposureSlider?.delete(); tonemappingSelect?.delete(); toggleCorrectLights?.delete(); - correctLightsSetting?.delete(); - tonemappingSetting?.delete(); unassignChannel?.delete(); projectMaterialsProp?.delete(); pbrMaterialsProp?.delete(); projectPbrModeProp?.delete(); - globalMetalnessSetting?.delete(); - globalRoughnessSetting?.delete(); materialBrushTool?.delete(); materialBrushPanel?.delete(); setBrushMaterial?.delete(); @@ -1828,6 +1913,7 @@ interface IChannel { brushRoughnessSlider?.delete(); brushEmissiveColor?.delete(); brushHeightSlider?.delete(); + openChannelMenu?.delete(); }; // From 994287911fb946c5dfec722e1a870788f825e0c1 Mon Sep 17 00:00:00 2001 From: Jason Date: Sat, 1 Jun 2024 09:10:16 -0500 Subject: [PATCH 13/50] feat: Texture baking (#2) * [Geckolib] Initial port to TypeScript and disable code that was removing hold on last frame loop mode when loading an animation * [Geckolib] Move animation_utils plugin to new blockbench 4.8.0 plugin structure * [Geckolib] Update about.md and fix updateManifest script to patch animation_utils section instead of overwriting format of entire file * [Geckolib] Add README to plugin src folder for developers * [Geckolib] WIP - working on support for "reverse keyframes" action * [Geckolib] Add easing reverse function with jest tests * [Geckolib] Finish implementing first pass of reverse keyframes function * [Geckolib] Integrate typescript-eslint and make some code updates to fix lint errors, update build scripts and docs on build tooling * [Geckolib] Move README.md to plugin root folder * [Geckolib] Add CHANGELOG linked from about.md and bump to version 3.1.0 * [Geckolib] Update CHANGELOG link in about.md to use production URL * [Geckolib] Build plugin for testing * [Geckolib] bump to blockbench-types 4.9.0 which contains my fixes and rebuild plugin * feat: Add texture baking Action - Added texture baking action and dialog * upd: Bake emissive lighting option * fix: Texture set export - Export all required textures in process - Fixed display condition * upd: Change export MER condition * fix: implement easings through compileBedrockKeyframe instead of monkeypatching getArray and breaking blockbench * fix: geckolib keyframes not saving properly in animation json * fix: use ES2017 to avoid weird typescript bug https://stackoverflow.com/questions/51860043/javascript-es6-typeerror-class-constructor-client-cannot-be-invoked-without-ne * Fixes issue with easing and keyframes * disable logging as not needed * Now include a license with plugin info, sourced MIT * Update Changelog for changes/fixes * whoops * Fixes about.md to use the same variables for the gradle info * Remove dead code * v1.0.8 * chore: Commit build output --- .gitignore | 2 + plugins.json | 12 +- plugins/animation_utils/CHANGELOG.md | 17 + plugins/animation_utils/README.md | 111 + plugins/animation_utils/about.md | 5 + .../{ => animation_utils}/animation_utils.js | 6676 ++++---- plugins/animation_utils/icon.png | Bin 0 -> 6674 bytes plugins/animation_utils/members.yml | 4 + .../animation_utils/src}/.eslintignore | 1 + plugins/animation_utils/src/.eslintrc.cjs | 16 + .../animation_utils/src}/.gitignore | 0 .../animation_utils/src}/.nvmrc | 0 .../animation_utils/src/animationUi.ts | 64 +- .../animation_utils/src}/armorTemplate.json | 0 .../animation_utils/src/codec.ts | 159 +- .../animation_utils/src/easing.ts | 89 +- .../animation_utils/src/index.ts | 22 +- plugins/animation_utils/src/jest.config.js | 5 + plugins/animation_utils/src/keyframe.ts | 182 + plugins/animation_utils/src/package-lock.json | 13137 ++++++++++++++++ plugins/animation_utils/src/package.json | 54 + .../src/scripts/updateManifest.mjs | 41 + .../animation_utils/src/settings.ts | 12 +- .../animation_utils/src/tests/easing.test.ts | 20 + plugins/animation_utils/src/tsconfig.json | 14 + .../src/types/blockbench-types.d.ts | 1 + .../animation_utils/src/utils.ts | 0 plugins/animation_utils/src/webpack.config.js | 24 + plugins/azurelib_utils/LICENSE.MD | 19 + plugins/azurelib_utils/about.md | 9 +- plugins/azurelib_utils/azurelib_utils.js | 2 +- plugins/azurelib_utils/changelog.json | 20 + plugins/pbr_preview/pbr_preview.js | 2 +- src/animation_utils/.eslintrc.json | 43 - src/animation_utils/keyframe.js | 104 - src/animation_utils/package-lock.json | 9319 ----------- src/animation_utils/package.json | 41 - src/animation_utils/scripts/updateManifest.js | 37 - src/animation_utils/webpack.config.js | 12 - src/azurelib_utils/animationUi.js | 10 - src/azurelib_utils/codec.js | 7 - src/azurelib_utils/index.js | 5 - src/azurelib_utils/keyframe.js | 66 +- src/azurelib_utils/package.json | 2 +- src/pbr_preview/src/index.ts | 484 +- 45 files changed, 18308 insertions(+), 12542 deletions(-) create mode 100644 plugins/animation_utils/CHANGELOG.md create mode 100644 plugins/animation_utils/README.md create mode 100644 plugins/animation_utils/about.md rename plugins/{ => animation_utils}/animation_utils.js (65%) create mode 100644 plugins/animation_utils/icon.png create mode 100644 plugins/animation_utils/members.yml rename {src/animation_utils => plugins/animation_utils/src}/.eslintignore (56%) create mode 100644 plugins/animation_utils/src/.eslintrc.cjs rename {src/animation_utils => plugins/animation_utils/src}/.gitignore (100%) rename {src/animation_utils => plugins/animation_utils/src}/.nvmrc (100%) rename src/animation_utils/animationUi.js => plugins/animation_utils/src/animationUi.ts (86%) rename {src/animation_utils => plugins/animation_utils/src}/armorTemplate.json (100%) rename src/animation_utils/codec.js => plugins/animation_utils/src/codec.ts (69%) rename src/animation_utils/easing.js => plugins/animation_utils/src/easing.ts (78%) rename src/animation_utils/index.js => plugins/animation_utils/src/index.ts (88%) create mode 100644 plugins/animation_utils/src/jest.config.js create mode 100644 plugins/animation_utils/src/keyframe.ts create mode 100644 plugins/animation_utils/src/package-lock.json create mode 100644 plugins/animation_utils/src/package.json create mode 100644 plugins/animation_utils/src/scripts/updateManifest.mjs rename src/animation_utils/settings.js => plugins/animation_utils/src/settings.ts (80%) create mode 100644 plugins/animation_utils/src/tests/easing.test.ts create mode 100644 plugins/animation_utils/src/tsconfig.json create mode 100644 plugins/animation_utils/src/types/blockbench-types.d.ts rename src/animation_utils/utils.js => plugins/animation_utils/src/utils.ts (100%) create mode 100644 plugins/animation_utils/src/webpack.config.js create mode 100644 plugins/azurelib_utils/LICENSE.MD delete mode 100644 src/animation_utils/.eslintrc.json delete mode 100644 src/animation_utils/keyframe.js delete mode 100644 src/animation_utils/package-lock.json delete mode 100644 src/animation_utils/package.json delete mode 100644 src/animation_utils/scripts/updateManifest.js delete mode 100644 src/animation_utils/webpack.config.js diff --git a/.gitignore b/.gitignore index ae1dd1fc..34e16bc3 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ node_modules/ .DS_Store desktop.ini + +/.idea \ No newline at end of file diff --git a/plugins.json b/plugins.json index 85332435..a684e967 100644 --- a/plugins.json +++ b/plugins.json @@ -369,13 +369,13 @@ "animation_utils": { "title": "GeckoLib Animation Utils", "author": "Eliot Lash, Gecko, McHorse, AzureDoom, Tslat", - "icon": "movie_filter", - "description": "Create animated blocks, items, entity, and armor using the GeckoLib library and plugin. https://github.com/bernie-g/geckolib/wiki", + "icon": "icon.png", + "description": "Create animated blocks, items, entities, and armor using the GeckoLib library and plugin.", "tags": [ "Minecraft: Java Edition" ], - "version": "3.0.8", - "min_version": "4.0.0", + "version": "3.1.0", + "min_version": "4.8.0", "await_loading": true, "variant": "both", "max_version": "5.0.0" @@ -595,7 +595,7 @@ "variant": "both", "creation_date": "2022-04-09", "has_changelog": true, - "tags": ["Format: Generic Model", "Mesh", "Tool"] + "tags": ["Format: Generic Model", "Mesh", "Tool"] }, "wasd_controls": { "title": "WASD Controls", @@ -860,7 +860,7 @@ "icon": "azureicon.png", "description": "Create animated blocks, items, entity, and armor using the AzureLib library and plugin. This is a fork of Geckolib and cross compatibility will not be promised in the future.", "tags": ["Minecraft: Java Edition"], - "version": "1.0.7", + "version": "1.0.8", "min_version": "4.8.0", "new_repository_format": true, "await_loading": true, diff --git a/plugins/animation_utils/CHANGELOG.md b/plugins/animation_utils/CHANGELOG.md new file mode 100644 index 00000000..9d819287 --- /dev/null +++ b/plugins/animation_utils/CHANGELOG.md @@ -0,0 +1,17 @@ +# GeckoLib Animation Utils Changelog + +## Legend +💥 = Breaking Change
+🚀 = New Feature
+🐞 = Bug Fix
+🦎 = Non-user-facing Change + +## 3.1.0 +- 💥 Update to new plugin format, bump minimum Blockbench version to 4.8.0 +- 🚀 Added support for "Reverse Keyframes" action +- 🦎 Ported plugin to TypeScript, added developer [README](./README.md) and a few unit tests + +## 3.0.7 +- 🐞 Don't save `geckolib_format_version` in animation json for bedrock models +- 🐞 Remove hold menu hiding code that was causing issues for other plugins (regression of an old bug occurred in version 3.0.6) +- 🦎 Disable minification of JS bundle, fix some build errors on case sensitive filesystems, and upgrade to NodeJS v16.16 \ No newline at end of file diff --git a/plugins/animation_utils/README.md b/plugins/animation_utils/README.md new file mode 100644 index 00000000..ae7a4729 --- /dev/null +++ b/plugins/animation_utils/README.md @@ -0,0 +1,111 @@ +# GeckoLib Animation Utils Developer Readme + +This readme is intended for developers wishing to work on the GeckoLib plugin. + +# Environment setup +## Windows +Inspect the contents of [.nvmrc](./src/.nvmrc) - this specifies the recommended version of Node.JS to use for plugin development. You can [download the corresponding version of Node.JS here](https://nodejs.org/en/download/releases). + + +## macOS and Unix +It's recommended, though not required, to install the correct version of Node.JS using the Node Version Manager script (nvm). [Follow the install guide here](https://github.com/nvm-sh/nvm/blob/master/README.md). + +A brief summary of how to use `nvm` once it's installed is to `cd` into the [src](./src) folder of the plugin and then run: +``` +nvm install `cat .nvmrc` +``` +followed by: +``` +nvm use +``` +If you have multiple versions of node installed on your system, it may be convenient to [change the default version to the version of node you just installed](https://github.com/nvm-sh/nvm/blob/master/README.md#set-default-node-version). Otherwise you may need to run `nvm use` every time you start a new terminal session. If you are using `nvm` for other projects with other versions of node, you can also use a [shell hook script to automatically run nvm use when changing directories](https://stackoverflow.com/questions/23556330/run-nvm-use-automatically-every-time-theres-a-nvmrc-file-on-the-directory). + +You can confirm the active node version by running +``` +node --version +``` + +## All Platforms +After Node.JS has been installed, run: +``` +npm install +``` + +Inside the `src` folder. + +You should run this command any time there has been a change to `package.json`. You might see a diff on `package-lock.json`. This is usually OK and indicates an update to transient dependenices, and should be OK to commit. If you see a LOT of changes to this file it might be an indication you are using the wrong version of node/npm. + +# Developing the plugin + +## Working on the plugin +First, start the development webpack bundler: +``` +npm start +``` +The development bundler will watch the filesystem for changes and automatically re-build the plugin to [animation_utils.js](./animation_utils.js). + +Then, you can load the plugin in Blockbench from `File` -> `Plugins` and selecting the `Load Plugin from File` button. Every time you make a change to the plugin source code, the bundler will automatically rebuild the plugin, but you still need to reload it in Blockbench in order for the changes to take effect. You can do this by selecting `Help` -> `Developer` -> `Reload Plugins`. In some cases if the global state has been messed up, you may need to reload the entire application using `Help` -> `Developer` -> `Reload Blockbench`. It's also recommended to select `Open Dev Tools` from this menu as it can be very helpful to explore the Blockbench API using the console and inspect error logs and debug breakpoints. + +As every time you load the plugin, it's considered by the JS interpreter to be a different source file, any breakpoints set on the previously loaded file will be lost. You can work around this by adding a `debugger;` statement inside the source code where you want to set a breakpoint, which will force the JS interpreter to break on that line. + +If a TypeScript compiler error is encountered, it will be logged to the terminal window, but the JS bundle will still be generated. + +To check for errors, you can run: +``` +npm run test +``` +This will run all pretest scripts (eslint and TypeScript type check) as well as unit tests. It's also possible to run pretest separately, or the individual checks by themselves. To see all available npm scripts, run: +``` +npm run +``` + +## Building a release of the plugin +First, inspect [package.json](./src/package.json) to make sure all the properties are correct. If you are making a release of the plugin, you should bump the `version` property to be one minor version up for a bugfix, minor version for new features, or major version for backwards-incompatible breaking changes. +Then, check the `blockbenchConfig`. `min_version` should be the lowest version of Blockbench the plugin is known to work with and `max_version` should be the first version the plugin is expected to not work with that's higher than the versions it was tested on. When the metadata is ready, run: +``` +npm run build +``` +This will first run prebuild/pretest/test scripts, then build the plugin and automatically update the [plugins.json](../../plugins.json) manifest with your settings. + +Then, update the [CHANGELOG](./CHANGELOG.md) to add patch notes for the new version. + +Double-check everything looks right, then commit and make a PR to [JannisX11/blockbench-plugins](https://github.com/JannisX11/blockbench-plugins) to release the plugin. + +Note that it is possible to skip pre-build scripts by running: +``` +npm run build:only +``` +This is dangerous and shouldn't be done to make a full release, it's better to fix any errors from tests, lint, and compiler before publishing changes. + +## Using TypeScript +The plugin is now written using a loose version of [TypeScript](https://www.typescriptlang.org/docs/handbook/intro.html). Blockbench types are supplied by the [blockbench-types](https://github.com/JannisX11/blockbench-types) package. Note that these types are hand-written and may contain errors or be missing certain APIs. So just because you see an error message in your IDE or the bundler output doesn't neccessarily mean your code is wrong, it's possible it could be an issue with the type definitions. TypeScript errors won't prevent the plugin from being built so you can always test your code manually and/or inspect the [Blockbench source code](https://github.com/JannisX11/blockbench) to confirm the code is correct. If there's an error in the types, there are a few ways of fixing it: +1. Make a PR to `blockbench-types`. This is the best, although possibly the slowest method of fixing type errors, and will help all other plugin authors. + * These changes can be tested locally first using `npm link`. To do so, clone the repo and ensure the same node version is being used as the one for the plugin. Then run `npm link` inside `blockbench-types`. Finally, run `npm link blockbench-types` inside the plugin `src` folder. This will create a symbolic link inside `node_modules` so that the types are resolved from your local copy of `blockbench-types`. You need to run `npm link blockbench-types` after every time you run `npm install` because an install overwrites the symlink. +1. Massage the types inside the plugin. There are a number of ways you can do this, such as: + * Use [type assertions (aka casting)](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#type-assertions). Performing an `as` cast directly into the target type is the safest method. If neccessary, casting via `as unknown as ` will cause the compiler to ignore insufficient overlap between types. It's also possible to attempt to change the type of a function parameter or inferred variable type by adding a type annotation, such as: + ```typescript + (kf: GeckolibKeyframe) => { } // Otherwise kf would be a Keyframe + ``` + or + ```typescript + let easingBar: HTMLElement = document.createElement('div'); // Otherwise this would be an HTMLDivElement + ``` + * Subclassing a blockbench type (for an example of this see usage of the `GeckolibBoneAnimator` in [codec.ts](./src/codec.ts)). + * Performing [type narrowing](https://www.typescriptlang.org/docs/handbook/2/narrowing.html). + * There are other options, such as [declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#handbook-content). +1. The nuclear option when all else fails: slap a `// @ts-ignore` comment above the problematic line(s). This is a bit dangerous as it shuts off ALL type checking on on that line, but sometimes this is necessary if you need to just force the compiler to ignore a problematic area of the code. + +Some places that are good to look for help with TypeScript are the [TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/intro.html), [TypeScript Discord](https://discord.com/invite/typescript), or you can ping Eliot on the GeckoLib Discord. + +# Working with ESLint +[ESLint](https://eslint.org) is a tool for checking the code for common errors or problematic coding styles. It can be integrated into IDEs via plugins, and can be run from the terminal like so: +``` +npm run lint +``` + +Some lint errors can be fixed automatically by running: +``` +npm run lint:fix +``` + +It's best to fix errors by changing the source code when possible. There are some cases in which certain lint rules might get in the way of particular things we might need to do in the plugin. In this case, [the rules can be disabled for different scopes](https://eslint.org/docs/latest/use/configure/rules). It's best to keep the scope as small as possible, so disabling individual rules per-line is the best way to start, or if it's needed in a larger area, disabling individual rules for a block of code, then lastly a whole file. You can search the code for `eslint-disable` to find examples. In some cases it may be necessary to disable a rule for the entire codebase, this can be done in the `rules` block of the [.eslintrc.cjs](./src/.eslintrc.cjs) file. diff --git a/plugins/animation_utils/about.md b/plugins/animation_utils/about.md new file mode 100644 index 00000000..859beeb4 --- /dev/null +++ b/plugins/animation_utils/about.md @@ -0,0 +1,5 @@ +GeckoLib is a powerful animation library for Minecraft Java Edition available for Forge and Fabric. Out of the box support for easings, math-based animations, resource pack overloading, and animation stacking. This plugin allows you to create animated assets for use in your GeckoLib mods. + +See the [GeckoLib wiki](https://github.com/bernie-g/geckolib/wiki) for help using the plugin and library. + +[Changelog (patch notes)](https://github.com/JannisX11/blockbench-plugins/blob/master/plugins/animation_utils/CHANGELOG.md) diff --git a/plugins/animation_utils.js b/plugins/animation_utils/animation_utils.js similarity index 65% rename from plugins/animation_utils.js rename to plugins/animation_utils/animation_utils.js index 9224786f..db7ab47c 100644 --- a/plugins/animation_utils.js +++ b/plugins/animation_utils/animation_utils.js @@ -1,2728 +1,1754 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "./index.js"); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ "./animationUi.js": -/*!************************!*\ - !*** ./animationUi.js ***! - \************************/ -/*! exports provided: loadAnimationUI, unloadAnimationUI, displayAnimationFrameCallback, updateKeyframeEasing, updateKeyframeEasingArg, updateKeyframeSelectionCallback */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "loadAnimationUI", function() { return loadAnimationUI; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unloadAnimationUI", function() { return unloadAnimationUI; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "displayAnimationFrameCallback", function() { return displayAnimationFrameCallback; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateKeyframeEasing", function() { return updateKeyframeEasing; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateKeyframeEasingArg", function() { return updateKeyframeEasingArg; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateKeyframeSelectionCallback", function() { return updateKeyframeSelectionCallback; }); -/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/uniq */ "./node_modules/lodash/uniq.js"); -/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./utils.js"); -/* harmony import */ var _easing__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./easing */ "./easing.js"); - +/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ +/***/ "./node_modules/lodash/_DataView.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_DataView.js ***! + \******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); -const easingRegExp = /^ease(InOut|In|Out)?([\w]+)$/; +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'); -const loadAnimationUI = () => { - Blockbench.on('display_animation_frame', displayAnimationFrameCallback); - Blockbench.on('update_keyframe_selection', updateKeyframeSelectionCallback); +module.exports = DataView; - Object(_utils__WEBPACK_IMPORTED_MODULE_1__["addMonkeypatch"])(window, null, "updateKeyframeEasing", updateKeyframeEasing); - Object(_utils__WEBPACK_IMPORTED_MODULE_1__["addMonkeypatch"])(window, null, "updateKeyframeEasingArg", updateKeyframeEasingArg); - Object(_utils__WEBPACK_IMPORTED_MODULE_1__["addMonkeypatch"])(BarItems.keyframe_interpolation, null, 'condition', () => - Format.id !== "animated_entity_model" && _utils__WEBPACK_IMPORTED_MODULE_1__["Original"].get(BarItems.keyframe_interpolation).condition() - ); -}; +/***/ }), -const unloadAnimationUI = () => { - Blockbench.removeListener('display_animation_frame', displayAnimationFrameCallback); - Blockbench.removeListener('update_keyframe_selection', updateKeyframeSelectionCallback); -}; +/***/ "./node_modules/lodash/_Hash.js": +/*!**************************************!*\ + !*** ./node_modules/lodash/_Hash.js ***! + \**************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -//#region Global Animation UI Handlers -const displayAnimationFrameCallback = (/*...args*/) => { - // const keyframe = $('#keyframe'); - // console.log('displayAnimationFrameCallback:', args, 'keyframe:', keyframe); // keyframe is null here -}; +var hashClear = __webpack_require__(/*! ./_hashClear */ "./node_modules/lodash/_hashClear.js"), + hashDelete = __webpack_require__(/*! ./_hashDelete */ "./node_modules/lodash/_hashDelete.js"), + hashGet = __webpack_require__(/*! ./_hashGet */ "./node_modules/lodash/_hashGet.js"), + hashHas = __webpack_require__(/*! ./_hashHas */ "./node_modules/lodash/_hashHas.js"), + hashSet = __webpack_require__(/*! ./_hashSet */ "./node_modules/lodash/_hashSet.js"); -function updateKeyframeEasing(value) { - Undo.initEdit({keyframes: Timeline.selected}) - // var axis = $(obj).attr('axis'); - // const value = $(obj).val(); - // console.log('updateKeyframeEasing value:', value, 'obj:', obj); - if (value === "-") return; - Timeline.selected.forEach((kf) => { - kf.easing = value; - }) - window.updateKeyframeSelection(); // Ensure easingArg display is updated - // Animator.preview(); - Undo.finishEdit('edit keyframe easing') -} +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; -function updateKeyframeEasingArg(obj) { - Undo.initEdit({keyframes: Timeline.selected}) - if ($(obj).val() === "-") return; - // console.log('updateKeyframeEasingArg value:', $(obj).val(), 'obj:', obj); - Timeline.selected.forEach((kf) => { - const value = Object(_easing__WEBPACK_IMPORTED_MODULE_2__["parseEasingArg"])(kf, $(obj).val().trim()); - kf.easingArgs = [value]; - // obj.value = value; - }) - Undo.finishEdit('edit keyframe easing argument') + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } } -const updateKeyframeSelectionCallback = (/*...args*/) => { - $('#keyframe_bar_easing').remove() - $('#keyframe_bar_easing_type').remove() - $('#keyframe_bar_easing_arg1').remove() +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; - const addPrePostButton = document.querySelector('#keyframe_type_label > div'); - if (addPrePostButton) addPrePostButton.hidden = Format.id === "animated_entity_model"; +module.exports = Hash; - var multi_channel = false; - var channel = false; - Timeline.selected.forEach((kf) => { - if (channel === false) { - channel = kf.channel - } else if (channel !== kf.channel) { - multi_channel = true //eslint-disable-line no-unused-vars - } - }) - const getMultiSelectValue = (selector, defaultValue, conflictValue) => { - const selectorFunction = typeof selector === 'function' - ? selector - : x => (x[selector] === undefined ? defaultValue : x[selector]); - - if (Timeline.selected.length > 1) { - const uniqSelected = lodash_uniq__WEBPACK_IMPORTED_MODULE_0___default()(Timeline.selected.map(selectorFunction)); - if (uniqSelected.length === 1) { - return uniqSelected[0]; - } else { - return conflictValue; - } - } else { - return selectorFunction(Timeline.selected[0]) || defaultValue; - } - }; +/***/ }), - const keyframesByChannel = Timeline.keyframes.reduce((acc, kf) => { - // Dear god I miss lodash - if (!acc.has(kf.animator)) acc.set(kf.animator, {}); - const animatorChannels = acc.get(kf.animator); - if (!animatorChannels[kf.channel]) animatorChannels[kf.channel] = []; - animatorChannels[kf.channel].push(kf); - animatorChannels[kf.channel].sort((a, b) => { - if (a.time < b.time) return -1; - if (a.time > b.time) return 1; - return 0; - }); - return acc; - }, new Map()); +/***/ "./node_modules/lodash/_ListCache.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_ListCache.js ***! + \*******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - const isFirstInChannel = kf => keyframesByChannel.get(kf.animator)[kf.channel].indexOf(kf) < 1; +var listCacheClear = __webpack_require__(/*! ./_listCacheClear */ "./node_modules/lodash/_listCacheClear.js"), + listCacheDelete = __webpack_require__(/*! ./_listCacheDelete */ "./node_modules/lodash/_listCacheDelete.js"), + listCacheGet = __webpack_require__(/*! ./_listCacheGet */ "./node_modules/lodash/_listCacheGet.js"), + listCacheHas = __webpack_require__(/*! ./_listCacheHas */ "./node_modules/lodash/_listCacheHas.js"), + listCacheSet = __webpack_require__(/*! ./_listCacheSet */ "./node_modules/lodash/_listCacheSet.js"); - if (Timeline.selected.length && Format.id === "animated_entity_model") { - if (Timeline.selected.every(kf => kf.animator instanceof BoneAnimator && !isFirstInChannel(kf))) { - const displayedEasing = getMultiSelectValue('easing', _easing__WEBPACK_IMPORTED_MODULE_2__["EASING_DEFAULT"], 'null'); +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; - const convertEasingTypeToId = (easing, easingType, inputEasingOrType) => { - const easingTypeToTypeId = type => { - let finalEasingType = "In"; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} - if (type === "out") { - finalEasingType = "Out"; - } else if (type === "inout") { - finalEasingType = "InOut"; - } +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; - return finalEasingType; - }; +module.exports = ListCache; - let finalEasing = 'ease'; - if (inputEasingOrType === "in" || inputEasingOrType === "out" || inputEasingOrType === "inout") { - let finalEasingType = easingTypeToTypeId(inputEasingOrType) +/***/ }), - finalEasing += finalEasingType + easing.substring(0, 1).toUpperCase() + easing.substring(1); - } else if (inputEasingOrType === "linear" || inputEasingOrType == "step") { - finalEasing = inputEasingOrType; - } else { - let finalEasingType = easingTypeToTypeId(easingType); +/***/ "./node_modules/lodash/_Map.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/_Map.js ***! + \*************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - finalEasing += finalEasingType + inputEasingOrType.substring(0, 1).toUpperCase() + inputEasingOrType.substring(1); - } +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); - return finalEasing; - }; +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'); - const addEasingTypeIcons = (bar, easingType, title) => { - var div = document.createElement("div"); - div.innerHTML = getIcon(easingType); - div.id = "kf_easing_type_" + easingType; - div.setAttribute("style", "stroke:var(--color-text);margin:0px;padding:3px;width:30px;height:30px"); - div.setAttribute("title", title); - div.onclick = () => { - let selectedEasing = $(".selected_kf_easing"); - let selectedEasingType = $(".selected_kf_easing_type"); - - let keySelectedEasing = selectedEasing.attr("id").substring(15); - let keySelectedEasingType = selectedEasingType.length <= 0 ? "in" : selectedEasingType.attr("id").substring(15); - - let currentEasing = convertEasingTypeToId(keySelectedEasing, keySelectedEasingType, keySelectedEasing); - let finalEasing = convertEasingTypeToId(keySelectedEasing, keySelectedEasingType, easingType); - - if (finalEasing != currentEasing) { - // console.log("Changed from " + currentEasing + " to " + finalEasing); - updateKeyframeEasing(finalEasing); - } - }; - bar.appendChild(div); - }; +module.exports = Map; - const keyframe = document.getElementById('panel_keyframe'); - let easingBar = document.createElement('div'); - keyframe.appendChild(easingBar); - easingBar.outerHTML = `
- -
`; - easingBar = document.getElementById('keyframe_bar_easing'); - - addEasingTypeIcons(easingBar, "linear", "Switch to Linear easing"); - addEasingTypeIcons(easingBar, "step", "Switch to Step easing"); - addEasingTypeIcons(easingBar, "sine", "Switch to Sine easing"); - addEasingTypeIcons(easingBar, "quad", "Switch to Quadratic easing"); - addEasingTypeIcons(easingBar, "cubic", "Switch to Cubic easing"); - addEasingTypeIcons(easingBar, "quart", "Switch to Quartic easing"); - addEasingTypeIcons(easingBar, "quint", "Switch to Quntic easing"); - addEasingTypeIcons(easingBar, "expo", "Switch to Exponential easing"); - addEasingTypeIcons(easingBar, "circ", "Switch to Cicle easing"); - addEasingTypeIcons(easingBar, "back", "Switch to Back easing"); - addEasingTypeIcons(easingBar, "elastic", "Switch to Elastic easing"); - addEasingTypeIcons(easingBar, "bounce", "Switch to Bounce easing"); - - let keyEasing = getEasingInterpolation(displayedEasing); - let keyEasingElement = document.getElementById("kf_easing_type_" + keyEasing); - - keyEasingElement.style.stroke = "var(--color-accent)"; - keyEasingElement.classList.add('selected_kf_easing'); - - if (!(keyEasing === "linear" || keyEasing == "step")) { - let easingTypeBar = document.createElement('div'); - keyframe.appendChild(easingTypeBar); - easingTypeBar.outerHTML = `
- -
`; - easingTypeBar = document.getElementById('keyframe_bar_easing_type'); - addEasingTypeIcons(easingTypeBar, "in", "Switch to In easing type"); - addEasingTypeIcons(easingTypeBar, "out", "Switch to Out easing type"); - addEasingTypeIcons(easingTypeBar, "inout", "Switch to In/Out easing type"); +/***/ }), - let keyEasingType = getEasingType(displayedEasing); - let keyEasingTypeElement = document.getElementById("kf_easing_type_" + keyEasingType); +/***/ "./node_modules/lodash/_MapCache.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_MapCache.js ***! + \******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - keyEasingTypeElement.style.stroke = "var(--color-accent)"; - keyEasingTypeElement.classList.add('selected_kf_easing_type'); - } +var mapCacheClear = __webpack_require__(/*! ./_mapCacheClear */ "./node_modules/lodash/_mapCacheClear.js"), + mapCacheDelete = __webpack_require__(/*! ./_mapCacheDelete */ "./node_modules/lodash/_mapCacheDelete.js"), + mapCacheGet = __webpack_require__(/*! ./_mapCacheGet */ "./node_modules/lodash/_mapCacheGet.js"), + mapCacheHas = __webpack_require__(/*! ./_mapCacheHas */ "./node_modules/lodash/_mapCacheHas.js"), + mapCacheSet = __webpack_require__(/*! ./_mapCacheSet */ "./node_modules/lodash/_mapCacheSet.js"); - const getEasingArgLabel = (kf) => { - switch(kf.easing) { - case _easing__WEBPACK_IMPORTED_MODULE_2__["EASING_OPTIONS"].easeInBack: - case _easing__WEBPACK_IMPORTED_MODULE_2__["EASING_OPTIONS"].easeOutBack: - case _easing__WEBPACK_IMPORTED_MODULE_2__["EASING_OPTIONS"].easeInOutBack: - return 'Overshoot'; - case _easing__WEBPACK_IMPORTED_MODULE_2__["EASING_OPTIONS"].easeInElastic: - case _easing__WEBPACK_IMPORTED_MODULE_2__["EASING_OPTIONS"].easeOutElastic: - case _easing__WEBPACK_IMPORTED_MODULE_2__["EASING_OPTIONS"].easeInOutElastic: - case _easing__WEBPACK_IMPORTED_MODULE_2__["EASING_OPTIONS"].easeInBounce: - case _easing__WEBPACK_IMPORTED_MODULE_2__["EASING_OPTIONS"].easeOutBounce: - case _easing__WEBPACK_IMPORTED_MODULE_2__["EASING_OPTIONS"].easeInOutBounce: - return 'Bounciness'; - case _easing__WEBPACK_IMPORTED_MODULE_2__["EASING_OPTIONS"].step: - return 'Steps'; - default: - return 'N/A'; - } - }; - const easingArgLabel = getMultiSelectValue(getEasingArgLabel, null, null); - if (Timeline.selected.every(kf => Object(_utils__WEBPACK_IMPORTED_MODULE_1__["hasArgs"])(kf.easing)) && easingArgLabel !== null) { - const argDefault = getMultiSelectValue(_easing__WEBPACK_IMPORTED_MODULE_2__["getEasingArgDefault"], null, null); - const [displayedValue] = getMultiSelectValue('easingArgs', [argDefault], [argDefault]); - let scaleBar = document.createElement('div'); - keyframe.appendChild(scaleBar); - scaleBar.outerHTML = `
- - -
`; - scaleBar = document.getElementById('keyframe_bar_easing_arg1'); - } +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; - // console.log('easingBar:', easingBar, 'keyframe:', keyframe); - } + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); } -}; +} -const getEasingInterpolation = (name) => { - var matches = name.match(easingRegExp); +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; - if (matches) { - return matches[2].toLowerCase(); - } +module.exports = MapCache; - return name; -}; -const getEasingType = (name) => { - var matches = name.match(easingRegExp); +/***/ }), - if (matches) { - return matches[1].toLowerCase(); - } +/***/ "./node_modules/lodash/_Promise.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_Promise.js ***! + \*****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - return "in"; -}; +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); -const getIcon = (name) => { - switch(name) { - case "back": - return ''; - case "bounce": - return ''; - case "circ": - return ''; - case "cubic": - return ''; - case "elastic": - return ''; - case "expo": - case "in": - return ''; - case "inout": - return ''; - case "out": - return ''; - case "quad": - return ''; - case "quart": - return ''; - case "quint": - return ''; - case "sine": - return ''; - case "step": - return ''; - default: // linear - return ''; - } -}; +/* Built-in method references that are verified to be native. */ +var Promise = getNative(root, 'Promise'); + +module.exports = Promise; -//#endregion Global Animation UI Handlers /***/ }), -/***/ "./armorTemplate.json": -/*!****************************!*\ - !*** ./armorTemplate.json ***! - \****************************/ -/*! exports provided: meta, name, geo_name, resolution, elements, outliner, textures, default */ -/***/ (function(module) { +/***/ "./node_modules/lodash/_Set.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/_Set.js ***! + \*************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -module.exports = JSON.parse("{\"meta\":{\"format_version\":\"3.2\",\"model_format\":\"animated_entity_model\",\"box_uv\":true},\"name\":\"CustomArmor\",\"geo_name\":\"CustomArmor\",\"resolution\":{\"width\":64,\"height\":64},\"elements\":[{\"name\":\"dontTouch\",\"from\":[-4,24,-4],\"to\":[4,32,4],\"autouv\":1,\"color\":0,\"export\":false,\"locked\":true,\"origin\":[0,0,0],\"uuid\":\"9675593e-b27d-b70e-e1ea-1fc29f46a294\"},{\"name\":\"dontTouch\",\"from\":[-4,12,-2],\"to\":[4,24,2],\"autouv\":1,\"color\":0,\"export\":false,\"locked\":true,\"origin\":[0,24,0],\"uuid\":\"fa43156a-2a62-948c-082f-483d525f6d1f\"},{\"name\":\"dontTouch\",\"from\":[4,12,-2],\"to\":[8,24,2],\"autouv\":1,\"color\":0,\"export\":false,\"locked\":true,\"origin\":[4,22,0],\"uuid\":\"aa51170c-8b32-fb62-71f1-58ac0b7785a8\"},{\"name\":\"dontTouch\",\"from\":[-8,12,-2],\"to\":[-4,24,2],\"autouv\":1,\"color\":0,\"export\":false,\"locked\":true,\"origin\":[4,22,0],\"uuid\":\"bf2c2539-20e3-cfcc-94c0-491734019889\"},{\"name\":\"dontTouch\",\"from\":[-4,0,-2],\"to\":[0,12,2],\"autouv\":1,\"color\":0,\"export\":false,\"locked\":true,\"origin\":[4,22,0],\"uuid\":\"17b9bae0-356a-9bba-fad9-4672e2671191\"},{\"name\":\"dontTouch\",\"from\":[0,0,-2],\"to\":[4,12,2],\"autouv\":1,\"color\":0,\"export\":false,\"locked\":true,\"origin\":[4,22,0],\"uuid\":\"7b31bac4-dc40-2b93-1204-7bbdcfe7d924\"}],\"outliner\":[{\"name\":\"bipedHead\",\"uuid\":\"d340b6fa-56aa-9c0f-3560-7a067643b77d\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[0,24,0],\"children\":[\"9675593e-b27d-b70e-e1ea-1fc29f46a294\",{\"name\":\"armorHead\",\"uuid\":\"6ab88dea-c816-d2bb-6be9-05ed7838da97\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[0,24,0],\"children\":[]}]},{\"name\":\"bipedBody\",\"uuid\":\"ce5b366c-fd87-41ae-9a73-e0a4d4b05f8d\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[0,24,0],\"children\":[\"fa43156a-2a62-948c-082f-483d525f6d1f\",{\"name\":\"armorBody\",\"uuid\":\"282fcdbb-8ea9-4a13-4154-f2ed20d696c8\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[0,24,0],\"children\":[]}]},{\"name\":\"bipedRightArm\",\"uuid\":\"d8113cc7-7e10-0930-259e-b8e4211ce9da\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[4,22,0],\"children\":[\"aa51170c-8b32-fb62-71f1-58ac0b7785a8\",{\"name\":\"armorRightArm\",\"uuid\":\"c5300e23-fd2f-b56c-3552-45d6650e11c6\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[4,22,0],\"children\":[]}]},{\"name\":\"bipedLeftArm\",\"uuid\":\"3b8901e8-3420-0834-51eb-76d64ff2ae8f\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[-4,22,0],\"children\":[\"bf2c2539-20e3-cfcc-94c0-491734019889\",{\"name\":\"armorLeftArm\",\"uuid\":\"b0d41a53-f4ce-53c1-f899-5a2048c90ac2\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[-4,22,0],\"children\":[]}]},{\"name\":\"bipedLeftLeg\",\"uuid\":\"37231be7-a8ef-22ca-7fea-40aed58003bb\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[2,12,0],\"children\":[\"17b9bae0-356a-9bba-fad9-4672e2671191\",{\"name\":\"armorLeftLeg\",\"uuid\":\"e4b19746-2d17-1f56-befe-00718165ae50\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[2,12,0],\"children\":[]},{\"name\":\"armorLeftBoot\",\"uuid\":\"9fe26b9a-ad66-9e6b-2fa2-4168e333b4be\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[2,12,0],\"children\":[]}]},{\"name\":\"bipedRightLeg\",\"uuid\":\"45c031a5-b6be-e0a7-5454-b45d07f28429\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[-2,12,0],\"children\":[\"7b31bac4-dc40-2b93-1204-7bbdcfe7d924\",{\"name\":\"armorRightLeg\",\"uuid\":\"60238f18-e74b-c863-cb45-2e2f162221bd\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[-2,12,0],\"children\":[]},{\"name\":\"armorRightBoot\",\"uuid\":\"eb3db34b-ccfe-dae9-ac4d-4e22c3222f70\",\"export\":true,\"isOpen\":true,\"visibility\":true,\"autouv\":0,\"origin\":[-2,12,0],\"children\":[]}]}],\"textures\":[]}"); +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); -/***/ }), +/* Built-in method references that are verified to be native. */ +var Set = getNative(root, 'Set'); -/***/ "./codec.js": -/*!******************!*\ - !*** ./codec.js ***! - \******************/ -/*! exports provided: loadCodec, unloadCodec, maybeExportItemJson, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +module.exports = Set; -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "loadCodec", function() { return loadCodec; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unloadCodec", function() { return unloadCodec; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "maybeExportItemJson", function() { return maybeExportItemJson; }); -/* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/omit */ "./node_modules/lodash/omit.js"); -/* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_omit__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./settings */ "./settings.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./utils.js"); +/***/ }), +/***/ "./node_modules/lodash/_SetCache.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_SetCache.js ***! + \******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +var MapCache = __webpack_require__(/*! ./_MapCache */ "./node_modules/lodash/_MapCache.js"), + setCacheAdd = __webpack_require__(/*! ./_setCacheAdd */ "./node_modules/lodash/_setCacheAdd.js"), + setCacheHas = __webpack_require__(/*! ./_setCacheHas */ "./node_modules/lodash/_setCacheHas.js"); -/* eslint-disable no-useless-escape */ +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; -//#region Codec Helpers / Export Settings + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} -function loadCodec() { - // The actual Codec is automatically registered by superclass constructor - Codecs.project.on('compile', onProjectCompile); - Codecs.project.on('parse', onProjectParse); - Codecs.bedrock.on('compile', onBedrockCompile); - Object(_utils__WEBPACK_IMPORTED_MODULE_2__["addMonkeypatch"])(Animator, null, "buildFile", animatorBuildFile); - Object(_utils__WEBPACK_IMPORTED_MODULE_2__["addMonkeypatch"])(Animator, null, "loadFile", animatorLoadFile); -} +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; -function unloadCodec() { - Codecs.project.events.compile.remove(onProjectCompile) - Codecs.project.events.parse.remove(onProjectParse) - Codecs.bedrock.events.compile.remove(onBedrockCompile) - format.delete(); -} +module.exports = SetCache; -function onProjectCompile(e) { - if (Format.id !== "animated_entity_model") return; - e.model.geckoSettings = _settings__WEBPACK_IMPORTED_MODULE_1__["default"]; - // console.log(`compileCallback model:`, e.model); -} -function onProjectParse(e) { - // console.log(`onProjectParse:`, e); - if (e.model && typeof e.model.geckoSettings === 'object') { - Object.assign(_settings__WEBPACK_IMPORTED_MODULE_1__["default"], lodash_omit__WEBPACK_IMPORTED_MODULE_0___default()(e.model.geckoSettings, ['formatVersion'])); - } else { - Object.assign(_settings__WEBPACK_IMPORTED_MODULE_1__["default"], _settings__WEBPACK_IMPORTED_MODULE_1__["GECKO_SETTINGS_DEFAULT"]); - } - Object(_settings__WEBPACK_IMPORTED_MODULE_1__["onSettingsChanged"])(); -} +/***/ }), -function onBedrockCompile(e) { - // console.log('onBedrockCompile e:', e); - // maybeExportItemJson(e.options); -} +/***/ "./node_modules/lodash/_Stack.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/_Stack.js ***! + \***************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -function animatorBuildFile() { - const res = _utils__WEBPACK_IMPORTED_MODULE_2__["Original"].get(Animator).buildFile.apply(this, arguments); - if (Format.id === "animated_entity_model") { - Object.assign( - res, - { - 'geckolib_format_version': _settings__WEBPACK_IMPORTED_MODULE_1__["default"].formatVersion, - } - ); - } - // console.log('animatorBuildFile res:', res); - return res; +var ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/lodash/_ListCache.js"), + stackClear = __webpack_require__(/*! ./_stackClear */ "./node_modules/lodash/_stackClear.js"), + stackDelete = __webpack_require__(/*! ./_stackDelete */ "./node_modules/lodash/_stackDelete.js"), + stackGet = __webpack_require__(/*! ./_stackGet */ "./node_modules/lodash/_stackGet.js"), + stackHas = __webpack_require__(/*! ./_stackHas */ "./node_modules/lodash/_stackHas.js"), + stackSet = __webpack_require__(/*! ./_stackSet */ "./node_modules/lodash/_stackSet.js"); + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; } -function animatorLoadFile(file, animation_filter) { - // Currently no modifications are needed - // eslint-disable-next-line no-undef - var json = file.json || autoParseJSON(file.content); - let path = file.path; - let new_animations = []; - if (json && typeof json.animations === 'object') { - for (var ani_name in json.animations) { - if (animation_filter && !animation_filter.includes(ani_name)) continue; - //Animation - var a = json.animations[ani_name] - var animation = new Animation({ - name: ani_name, - path, - loop: a.loop && (a.loop == 'hold_on_last_frame' ? 'hold' : 'loop'), - override: a.override_previous_animation, - anim_time_update: (typeof a.anim_time_update == 'string' - ? a.anim_time_update.replace(/;(?!$)/, ';\n') - : a.anim_time_update), - blend_weight: (typeof a.blend_weight == 'string' - ? a.blend_weight.replace(/;(?!$)/, ';\n') - : a.blend_weight), - length: a.animation_length - }).add() - //Bones - if (a.bones) { - // eslint-disable-next-line no-inner-declarations - function getKeyframeDataPoints(source) { - if (source instanceof Array) { - return [{ - x: source[0], - y: source[1], - z: source[2], - }] - } else if (['number', 'string'].includes(typeof source)) { - return [{ - x: source, y: source, z: source - }] - } else if (typeof source == 'object') { - if(source.vector) - { - return getKeyframeDataPoints(source.vector); - } - let points = []; - if (source.pre) { - points.push(getKeyframeDataPoints(source.pre)[0]) - } - if (source.post) { - points.push(getKeyframeDataPoints(source.post)[0]) - } - return points; - } - } - for (var bone_name in a.bones) { - var b = a.bones[bone_name] - let lowercase_bone_name = bone_name.toLowerCase(); - var group = Group.all.find(group => group.name.toLowerCase() == lowercase_bone_name) - let uuid = group ? group.uuid : guid(); +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; - var ba = new BoneAnimator(uuid, animation, bone_name); - animation.animators[uuid] = ba; - //Channels - for (var channel in b) { - if (Animator.possible_channels[channel]) { - if (typeof b[channel] === 'string' || typeof b[channel] === 'number' || b[channel] instanceof Array) { - ba.addKeyframe({ - time: 0, - channel, - easing: b[channel].easing, - easingArgs: b[channel].easingArgs, - data_points: getKeyframeDataPoints(b[channel]), - }) - } else if (typeof b[channel] === 'object' && b[channel].post) { - ba.addKeyframe({ - time: 0, - channel, - easing: b[channel].easing, - easingArgs: b[channel].easingArgs, - interpolation: b[channel].lerp_mode, - data_points: getKeyframeDataPoints(b[channel]), - }); - } else if (typeof b[channel] === 'object') { - for (var timestamp in b[channel]) { - ba.addKeyframe({ - time: parseFloat(timestamp), - channel, - easing: b[channel][timestamp].easing, - easingArgs: b[channel][timestamp].easingArgs, - interpolation: b[channel][timestamp].lerp_mode, - data_points: getKeyframeDataPoints(b[channel][timestamp]), - }); - } - } - } - } - } - } - if (a.sound_effects) { - if (!animation.animators.effects) { - animation.animators.effects = new EffectAnimator(animation); - } - for (var timestamp0 in a.sound_effects) { - var sounds = a.sound_effects[timestamp0]; - if (sounds instanceof Array === false) sounds = [sounds]; - animation.animators.effects.addKeyframe({ - channel: 'sound', - time: parseFloat(timestamp0), - data_points: sounds - }) - } - } - if (a.particle_effects) { - if (!animation.animators.effects) { - animation.animators.effects = new EffectAnimator(animation); - } - for (var timestamp1 in a.particle_effects) { - var particles = a.particle_effects[timestamp1]; - if (particles instanceof Array === false) particles = [particles]; - particles.forEach(particle => { - if (particle) particle.script = particle.pre_effect_script; - }) - animation.animators.effects.addKeyframe({ - channel: 'particle', - time: parseFloat(timestamp1), - data_points: particles - }) - } - } - if (a.timeline) { - if (!animation.animators.effects) { - animation.animators.effects = new EffectAnimator(animation); - } - for (var timestamp2 in a.timeline) { - var entry = a.timeline[timestamp2]; - var script = entry instanceof Array ? entry.join('\n') : entry; - animation.animators.effects.addKeyframe({ - channel: 'timeline', - time: parseFloat(timestamp2), - data_points: [{script}] - }) - } - } - animation.calculateSnappingFromKeyframes(); - if (!Animation.selected && Animator.open) { - animation.select() - } - new_animations.push(animation) - } - } - return new_animations -} +module.exports = Stack; -//#endregion Codec Helpers / Export Settings -//#region Codec / ModelFormat -function maybeExportItemJson(options = {}, as) { - function checkExport(key, condition) { - key = options[key] - if (key === undefined) { - return condition; - } else { - return key - } - } +/***/ }), - const blockmodel = {} - if (checkExport('comment', settings.credit.value)) { - blockmodel.credit = settings.credit.value - } - if (checkExport('parent', Project.parent != '')) { - blockmodel.parent = Project.parent - } - if (checkExport('ambientocclusion', Project.ambientocclusion === false)) { - blockmodel.ambientocclusion = false - } - if (Project.texture_width !== 16 || Project.texture_height !== 16) { - blockmodel.texture_size = [Project.texture_width, Project.texture_height] - } - if (checkExport('front_gui_light', Project.front_gui_light)) { - blockmodel.gui_light = 'front'; - } - if (checkExport('overrides', Project.overrides)) { - blockmodel.overrides = Project.overrides; - } - if (checkExport('display', Object.keys(Project.display_settings).length >= 1)) { - var new_display = {} - var entries = 0; - for (var i in DisplayMode.slots) { - var key = DisplayMode.slots[i] - if (DisplayMode.slots.hasOwnProperty(i) && Project.display_settings[key] && Project.display_settings[key].export) { - new_display[key] = Project.display_settings[key].export() - entries++; - } - } - if (entries) { - blockmodel.display = new_display - } - } +/***/ "./node_modules/lodash/_Symbol.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/_Symbol.js ***! + \****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - const blockmodelString = JSON.stringify(blockmodel, null, 2); +var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); - var scope = codec; +/** Built-in value references. */ +var Symbol = root.Symbol; - let path = _settings__WEBPACK_IMPORTED_MODULE_1__["default"].itemModelPath; +module.exports = Symbol; - Blockbench.export({ - resource_id: 'model', - type: Codecs.java_block.name, - extensions: ['json'], - name: scope.fileName().replace(".geo", ".item"), - startpath: path, - content: blockmodelString, - }, (real_path) => { - _settings__WEBPACK_IMPORTED_MODULE_1__["default"].itemModelPath = real_path; - }); - return this; -} +/***/ }), -var codec = Codecs.bedrock; +/***/ "./node_modules/lodash/_Uint8Array.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_Uint8Array.js ***! + \********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var format = new ModelFormat({ - id: "animated_entity_model", - name: "GeckoLib Animated Model", - category: "minecraft", - description: "Animated Model for Java mods using GeckoLib", - icon: "view_in_ar", - rotate_cubes: true, - box_uv: true, - optional_box_uv: true, - single_texture: true, - bone_rig: true, - centered_grid: true, - animated_textures: true, - animation_mode: true, - animation_files: true, - locators: true, - codec: Codecs.project, // This sets what codec is used for File -> Save. We want to use bbmodel. - display_mode: false, // This may be dynamically turned on by settings - onActivation: function () { - } -}) +var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); -//Object.defineProperty(format, 'integer_size', {get: _ => Templates.get('integer_size')}) -// codec.format = format; // This sets the default format for the codec +/** Built-in value references. */ +var Uint8Array = root.Uint8Array; -/* harmony default export */ __webpack_exports__["default"] = (codec); // This is used for plugin "Export Animated Model" menu item +module.exports = Uint8Array; -//#endregion Codec / ModelFormat /***/ }), -/***/ "./easing.js": -/*!*******************!*\ - !*** ./easing.js ***! - \*******************/ -/*! exports provided: easingFunctions, EASING_OPTIONS, EASING_DEFAULT, getEasingArgDefault, parseEasingArg */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/lodash/_WeakMap.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_WeakMap.js ***! + \*****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easingFunctions", function() { return easingFunctions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EASING_OPTIONS", function() { return EASING_OPTIONS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EASING_DEFAULT", function() { return EASING_DEFAULT; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEasingArgDefault", function() { return getEasingArgDefault; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseEasingArg", function() { return parseEasingArg; }); -// The MIT license notice below applies to the function findIntervalBorderIndex -/* The MIT License (MIT) +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); -Copyright (c) 2015 Boris Chumichev +/* Built-in method references that are verified to be native. */ +var WeakMap = getNative(root, 'WeakMap'); -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: +module.exports = WeakMap; -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. +/***/ }), -/** - * - * Utilizes bisection method to search an interval to which - * point belongs to, then returns an index of left or right - * border of the interval - * - * @param {Number} point - * @param {Array} intervals - * @param {Boolean} useRightBorder - * @returns {Number} - */ -function findIntervalBorderIndex(point, intervals, useRightBorder) { - //If point is beyond given intervals - if (point < intervals[0]) - return 0 - if (point > intervals[intervals.length - 1]) - return intervals.length - 1 - //If point is inside interval - //Start searching on a full range of intervals - var indexOfNumberToCompare = 0; - var leftBorderIndex = 0; - var rightBorderIndex = intervals.length - 1 - //Reduce searching range till it find an interval point belongs to using binary search - while (rightBorderIndex - leftBorderIndex !== 1) { - indexOfNumberToCompare = leftBorderIndex + Math.floor((rightBorderIndex - leftBorderIndex) / 2) - point >= intervals[indexOfNumberToCompare] ? - leftBorderIndex = indexOfNumberToCompare : - rightBorderIndex = indexOfNumberToCompare - } - return useRightBorder ? rightBorderIndex : leftBorderIndex -} - -function stepRange(steps, stop = 1) { - if (steps < 2) throw new Error("steps must be > 2, got:" + steps); - const stepLength = stop / steps; - return Array.from({ - length: steps - }, (_, i) => i * stepLength); -} +/***/ "./node_modules/lodash/_apply.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/_apply.js ***! + \***************************************/ +/***/ ((module) => { -// The MIT license notice below applies to the Easing class /** - * Copyright (c) Facebook, Inc. and its affiliates. + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. */ -class Easing { - /** - * A stepping function, returns 1 for any positive value of `n`. - */ - static step0(n) { - return n > 0 ? 1 : 0; - } - /** - * A stepping function, returns 1 if `n` is greater than or equal to 1. - */ - static step1(n) { - return n >= 1 ? 1 : 0; - } - /** - * A linear function, `f(t) = t`. Position correlates to elapsed time one to - * one. - * - * http://cubic-bezier.com/#0,0,1,1 - */ - static linear(t) { - return t; - } - /** - * A simple inertial interaction, similar to an object slowly accelerating to - * speed. - * - * http://cubic-bezier.com/#.42,0,1,1 - */ - // static ease(t) { - // if (!ease) { - // ease = Easing.bezier(0.42, 0, 1, 1); - // } - // return ease(t); - // } - /** - * A quadratic function, `f(t) = t * t`. Position equals the square of elapsed - * time. - * - * http://easings.net/#easeInQuad - */ - static quad(t) { - return t * t; - } - /** - * A cubic function, `f(t) = t * t * t`. Position equals the cube of elapsed - * time. - * - * http://easings.net/#easeInCubic - */ - static cubic(t) { - return t * t * t; - } - /** - * A power function. Position is equal to the Nth power of elapsed time. - * - * n = 4: http://easings.net/#easeInQuart - * n = 5: http://easings.net/#easeInQuint - */ - static poly(n) { - return (t) => Math.pow(t, n); - } - /** - * A sinusoidal function. - * - * http://easings.net/#easeInSine - */ - static sin(t) { - return 1 - Math.cos((t * Math.PI) / 2); - } - /** - * A circular function. - * - * http://easings.net/#easeInCirc - */ - static circle(t) { - return 1 - Math.sqrt(1 - t * t); - } - /** - * An exponential function. - * - * http://easings.net/#easeInExpo - */ - static exp(t) { - return Math.pow(2, 10 * (t - 1)); - } - /** - * A simple elastic interaction, similar to a spring oscillating back and - * forth. - * - * Default bounciness is 1, which overshoots a little bit once. 0 bounciness - * doesn't overshoot at all, and bounciness of N > 1 will overshoot about N - * times. - * - * http://easings.net/#easeInElastic - */ - static elastic(bounciness = 1) { - const p = bounciness * Math.PI; - return t => 1 - Math.pow(Math.cos((t * Math.PI) / 2), 3) * Math.cos(t * p); - } - /** - * Use with `Animated.parallel()` to create a simple effect where the object - * animates back slightly as the animation starts. - * - * Wolfram Plot: - * - * - http://tiny.cc/back_default (s = 1.70158, default) - */ - static back(s = 1.70158) { - return t => t * t * ((s + 1) * t - s); - } - /** - * Provides a simple bouncing effect. - * - * Props to Waterded#6455 for making the bounce adjustable and GiantLuigi4#6616 for helping clean it up - * using min instead of ternaries - * http://easings.net/#easeInBounce - */ - static bounce(k = 0.5) { - const q = x => (121 / 16) * x * x; - const w = x => ((121 / 4) * k) * Math.pow(x - (6 / 11), 2) + 1 - k; - const r = x => 121 * k * k * Math.pow(x - (9 / 11), 2) + 1 - k * k; - const t = x => 484 * k * k * k * Math.pow(x - (10.5 / 11), 2) + 1 - k * k * k; - return x => Math.min(q(x), w(x), r(x), t(x)); - } - - /** - * Provides a cubic bezier curve, equivalent to CSS Transitions' - * `transition-timing-function`. - * - * A useful tool to visualize cubic bezier curves can be found at - * http://cubic-bezier.com/ - */ - // static bezier(x1, y1, x2, y2) { - // const _bezier = require('./bezier'); - // return _bezier(x1, y1, x2, y2); - // } - /** - * Runs an easing function forwards. - */ - static in(easing) { - return easing; - } - /** - * Runs an easing function backwards. - */ - static out(easing) { - return t => 1 - easing(1 - t); - } - /** - * Makes any easing function symmetrical. The easing function will run - * forwards for half of the duration, then backwards for the rest of the - * duration. - */ - static inOut(easing) { - return t => { - if (t < 0.5) { - return easing(t * 2) / 2; - } - return 1 - easing((1 - t) * 2) / 2; - }; - } +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); } -const quart = Easing.poly(4); -const quint = Easing.poly(5); -const back = (direction, scalar, t) => - direction(Easing.back(1.70158 * scalar))(t); -const elastic = (direction, bounciness, t) => - direction(Easing.elastic(bounciness))(t); -const bounce = (direction, bounciness, t) => - direction(Easing.bounce(bounciness))(t); - -const easingFunctions = { - linear: Easing.linear, - step(steps, x) { - const intervals = stepRange(steps); - return intervals[findIntervalBorderIndex(x, intervals, false)]; - }, - easeInQuad: Easing.in(Easing.quad), - easeOutQuad: Easing.out(Easing.quad), - easeInOutQuad: Easing.inOut(Easing.quad), - easeInCubic: Easing.in(Easing.cubic), - easeOutCubic: Easing.out(Easing.cubic), - easeInOutCubic: Easing.inOut(Easing.cubic), - easeInQuart: Easing.in(quart), - easeOutQuart: Easing.out(quart), - easeInOutQuart: Easing.inOut(quart), - easeInQuint: Easing.in(quint), - easeOutQuint: Easing.out(quint), - easeInOutQuint: Easing.inOut(quint), - easeInSine: Easing.in(Easing.sin), - easeOutSine: Easing.out(Easing.sin), - easeInOutSine: Easing.inOut(Easing.sin), - easeInExpo: Easing.in(Easing.exp), - easeOutExpo: Easing.out(Easing.exp), - easeInOutExpo: Easing.inOut(Easing.exp), - easeInCirc: Easing.in(Easing.circle), - easeOutCirc: Easing.out(Easing.circle), - easeInOutCirc: Easing.inOut(Easing.circle), - easeInBack: back.bind(null, Easing.in), - easeOutBack: back.bind(null, Easing.out), - easeInOutBack: back.bind(null, Easing.inOut), - easeInElastic: elastic.bind(null, Easing.in), - easeOutElastic: elastic.bind(null, Easing.out), - easeInOutElastic: elastic.bind(null, Easing.inOut), - easeInBounce: bounce.bind(null, Easing.in), - easeOutBounce: bounce.bind(null, Easing.out), - easeInOutBounce: bounce.bind(null, Easing.inOut), -}; +module.exports = apply; -// Object with the same keys as easingFunctions and values of the stringified key names -const EASING_OPTIONS = Object.fromEntries( - Object.entries(easingFunctions).map(entry => ([entry[0], entry[0]])) -); -Object.freeze(EASING_OPTIONS); -const EASING_DEFAULT = 'linear'; -const getEasingArgDefault = kf => { - switch (kf.easing) { - case EASING_OPTIONS.easeInBack: - case EASING_OPTIONS.easeOutBack: - case EASING_OPTIONS.easeInOutBack: - case EASING_OPTIONS.easeInElastic: - case EASING_OPTIONS.easeOutElastic: - case EASING_OPTIONS.easeInOutElastic: - return 1; - case EASING_OPTIONS.easeInBounce: - case EASING_OPTIONS.easeOutBounce: - case EASING_OPTIONS.easeInOutBounce: - return 0.5; - case EASING_OPTIONS.step: - return 5; - default: - return null; - } -}; +/***/ }), -const parseEasingArg = (kf, value) => { - switch(kf.easing) { - case EASING_OPTIONS.easeInBack: - case EASING_OPTIONS.easeOutBack: - case EASING_OPTIONS.easeInOutBack: - case EASING_OPTIONS.easeInElastic: - case EASING_OPTIONS.easeOutElastic: - case EASING_OPTIONS.easeInOutElastic: - case EASING_OPTIONS.easeInBounce: - case EASING_OPTIONS.easeOutBounce: - case EASING_OPTIONS.easeInOutBounce: - return parseFloat(value); - case EASING_OPTIONS.step: - return Math.max(parseInt(value, 10), 2); - default: - return parseInt(value, 10); - } -}; +/***/ "./node_modules/lodash/_arrayAggregator.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_arrayAggregator.js ***! + \*************************************************/ +/***/ ((module) => { +/** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ +function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array == null ? 0 : array.length; -/***/ }), + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; +} -/***/ "./index.js": -/*!******************!*\ - !*** ./index.js ***! - \******************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +module.exports = arrayAggregator; -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var semver_functions_coerce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! semver/functions/coerce */ "./node_modules/semver/functions/coerce.js"); -/* harmony import */ var semver_functions_coerce__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(semver_functions_coerce__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var semver_functions_satisfies__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! semver/functions/satisfies */ "./node_modules/semver/functions/satisfies.js"); -/* harmony import */ var semver_functions_satisfies__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(semver_functions_satisfies__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./package.json */ "./package.json"); -var _package_json__WEBPACK_IMPORTED_MODULE_2___namespace = /*#__PURE__*/__webpack_require__.t(/*! ./package.json */ "./package.json", 1); -/* harmony import */ var _animationUi__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./animationUi */ "./animationUi.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./utils.js"); -/* harmony import */ var _keyframe__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./keyframe */ "./keyframe.js"); -/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./settings */ "./settings.js"); -/* harmony import */ var _codec__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./codec */ "./codec.js"); +/***/ }), +/***/ "./node_modules/lodash/_arrayEach.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_arrayEach.js ***! + \*******************************************/ +/***/ ((module) => { +/** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; +} +module.exports = arrayEach; +/***/ }), +/***/ "./node_modules/lodash/_arrayFilter.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_arrayFilter.js ***! + \*********************************************/ +/***/ ((module) => { -const SUPPORTED_BB_VERSION_RANGE = `${_package_json__WEBPACK_IMPORTED_MODULE_2__["blockbenchConfig"].min_version} - ${_package_json__WEBPACK_IMPORTED_MODULE_2__["blockbenchConfig"].max_version}`; -if (!semver_functions_satisfies__WEBPACK_IMPORTED_MODULE_1___default()(semver_functions_coerce__WEBPACK_IMPORTED_MODULE_0___default()(Blockbench.version), SUPPORTED_BB_VERSION_RANGE)) { - alert(`GeckoLib Animation Utils currently only supports Blockbench ${SUPPORTED_BB_VERSION_RANGE}. Please ensure you are using this version of Blockbench to avoid bugs and undefined behavior.`); +/** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; } -(function () { - let exportAction; - let exportDisplayAction; - let button; - - Plugin.register("animation_utils", Object.assign( - {}, - _package_json__WEBPACK_IMPORTED_MODULE_2__["blockbenchConfig"], - { - name: _package_json__WEBPACK_IMPORTED_MODULE_2__["blockbenchConfig"].title, - version: _package_json__WEBPACK_IMPORTED_MODULE_2__["version"], - await_loading: true, - onload() { - Object(_codec__WEBPACK_IMPORTED_MODULE_7__["loadCodec"])(); - Object(_animationUi__WEBPACK_IMPORTED_MODULE_3__["loadAnimationUI"])(); - Object(_keyframe__WEBPACK_IMPORTED_MODULE_5__["loadKeyframeOverrides"])(); - console.log("Loaded GeckoLib plugin") - exportAction = new Action({ - id: "export_geckolib_model", - name: "Export GeckoLib Model", - icon: "archive", - description: - "Export your java animated model as a model for GeckoLib.", - category: "file", - condition: () => Format.id === "animated_entity_model", - click: function () { - _codec__WEBPACK_IMPORTED_MODULE_7__["default"].export(); - }, - }); - MenuBar.addAction(exportAction, "file.export"); - - exportDisplayAction = new Action({ - id: "export_geckolib_display", - name: "Export GeckoLib Display Settings", - icon: "icon-bb_interface", - description: - "Export your java animated model display settings for GeckoLib.", - category: "file", - condition: () => Format.id === "animated_entity_model" && _settings__WEBPACK_IMPORTED_MODULE_6__["default"].objectType === _settings__WEBPACK_IMPORTED_MODULE_6__["OBJ_TYPE_BLOCK_ITEM"], - click: _codec__WEBPACK_IMPORTED_MODULE_7__["maybeExportItemJson"], - }); - MenuBar.addAction(exportDisplayAction, "file.export"); - - button = new Action('gecko_settings', { - name: 'GeckoLib Model Settings...', - description: 'Configure animated model.', - icon: 'info', - condition: () => Format.id === "animated_entity_model", - click: function () { - var dialog = new Dialog({ - id: 'project', - title: 'GeckoLib Model Settings', - width: 540, - lines: [`GeckoLib Animation Utils v${_package_json__WEBPACK_IMPORTED_MODULE_2__["version"]}`], - form: { - objectType: {label: 'Object Type', type: 'select', default: _settings__WEBPACK_IMPORTED_MODULE_6__["default"].objectType, options: _settings__WEBPACK_IMPORTED_MODULE_6__["OBJ_TYPE_OPTIONS"]}, - // modSDK: {label: 'Modding SDK', type: 'select', default: geckoSettings.modSDK, options: MOD_SDK_OPTIONS}, - // entityType: {label: 'Entity Type', value: geckoSettings.entityType}, - // javaPackage: {label: 'Java Package', value: geckoSettings.javaPackage}, - // animFileNamespace: {label: 'Animation File Namespace', value: geckoSettings.animFileNamespace}, - // animFilePath: {label: 'Animation File Path', value: geckoSettings.animFilePath}, - }, - onConfirm: function(formResult) { - Object.assign(_settings__WEBPACK_IMPORTED_MODULE_6__["default"], formResult); - Object(_settings__WEBPACK_IMPORTED_MODULE_6__["onSettingsChanged"])(); - dialog.hide() - } - }) - dialog.show() - } - }); - MenuBar.addAction(button, 'file.1'); - }, - onunload() { - exportAction.delete(); - exportDisplayAction.delete(); - button.delete(); - Object(_keyframe__WEBPACK_IMPORTED_MODULE_5__["unloadKeyframeOverrides"])(); - Object(_animationUi__WEBPACK_IMPORTED_MODULE_3__["unloadAnimationUI"])(); - Object(_codec__WEBPACK_IMPORTED_MODULE_7__["unloadCodec"])(); - Object(_utils__WEBPACK_IMPORTED_MODULE_4__["removeMonkeypatches"])(); - console.clear(); // eslint-disable-line no-console - }, - } - )); -})(); +module.exports = arrayFilter; /***/ }), -/***/ "./keyframe.js": -/*!*********************!*\ - !*** ./keyframe.js ***! - \*********************/ -/*! exports provided: loadKeyframeOverrides, unloadKeyframeOverrides */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/lodash/_arrayIncludes.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_arrayIncludes.js ***! + \***********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "loadKeyframeOverrides", function() { return loadKeyframeOverrides; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unloadKeyframeOverrides", function() { return unloadKeyframeOverrides; }); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./utils.js"); -/* harmony import */ var _easing__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./easing */ "./easing.js"); +var baseIndexOf = __webpack_require__(/*! ./_baseIndexOf */ "./node_modules/lodash/_baseIndexOf.js"); +/** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; +} +module.exports = arrayIncludes; -//#region Keyframe Mixins -function loadKeyframeOverrides() { - Object(_utils__WEBPACK_IMPORTED_MODULE_0__["addMonkeypatch"])(Keyframe, "prototype", "getLerp", keyframeGetLerp); - Object(_utils__WEBPACK_IMPORTED_MODULE_0__["addMonkeypatch"])(Keyframe, "prototype", "getArray", keyframeGetArray); - Object(_utils__WEBPACK_IMPORTED_MODULE_0__["addMonkeypatch"])(Keyframe, "prototype", "getUndoCopy", keyframeGetUndoCopy); - Object(_utils__WEBPACK_IMPORTED_MODULE_0__["addMonkeypatch"])(Keyframe, "prototype", "extend", keyframeExtend); - Object(_utils__WEBPACK_IMPORTED_MODULE_0__["addMonkeypatch"])(BarItems.reverse_keyframes, null, "condition", reverseKeyframesCondition); -} +/***/ }), -function unloadKeyframeOverrides() { - //No-op for now since monkeypatches are unloaded automatically -} +/***/ "./node_modules/lodash/_arrayIncludesWith.js": +/*!***************************************************!*\ + !*** ./node_modules/lodash/_arrayIncludesWith.js ***! + \***************************************************/ +/***/ ((module) => { -function lerp(start, stop, amt) { - return amt * (stop - start) + start; -} +/** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; -// eslint-disable-next-line no-unused-vars -function keyframeGetLerp(other, axis, amount, allow_expression) { - const easing = other.easing || _easing__WEBPACK_IMPORTED_MODULE_1__["EASING_DEFAULT"]; - if (Format.id !== "animated_entity_model") { - return _utils__WEBPACK_IMPORTED_MODULE_0__["Original"].get(Keyframe).getLerp.apply(this, arguments); - } - let easingFunc = _easing__WEBPACK_IMPORTED_MODULE_1__["easingFunctions"][easing]; - if (Object(_utils__WEBPACK_IMPORTED_MODULE_0__["hasArgs"])(easing)) { - const arg1 = Array.isArray(other.easingArgs) && other.easingArgs.length > 0 - ? other.easingArgs[0] - : Object(_easing__WEBPACK_IMPORTED_MODULE_1__["getEasingArgDefault"])(other); - // console.log(`keyframeGetLerp arg1: ${arg1}`); - easingFunc = easingFunc.bind(null, arg1); - } - const easedAmount = easingFunc(amount); - const start = this.calc(axis); - const stop = other.calc(axis); - const result = lerp(start, stop, easedAmount); - // console.log('keyframeGetLerp easing:', easing, 'arguments:', arguments, 'start:', start, 'stop:', stop, 'amount:', amount, 'easedAmount:', easedAmount, 'result:', result); - if (Number.isNaN(result)) { - throw new Error('batman'); + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } } - return result; + return false; } -function keyframeGetArray() { - const { easing, easingArgs } = this; - let result = _utils__WEBPACK_IMPORTED_MODULE_0__["Original"].get(Keyframe).getArray.apply(this, arguments); - if (Format.id === "animated_entity_model") { - result = { vector: result, easing }; - if (Object(_utils__WEBPACK_IMPORTED_MODULE_0__["hasArgs"])(easing)) result.easingArgs = easingArgs; - } -// console.log('keyframeGetArray arguments:', arguments, 'this:', this, 'result:', result); - return result; -} +module.exports = arrayIncludesWith; -function keyframeGetUndoCopy() { - const { easing, easingArgs } = this; - const result = _utils__WEBPACK_IMPORTED_MODULE_0__["Original"].get(Keyframe).getUndoCopy.apply(this, arguments); - if (Format.id === "animated_entity_model") { - Object.assign(result, { easing }); - if (Object(_utils__WEBPACK_IMPORTED_MODULE_0__["hasArgs"])(easing)) result.easingArgs = easingArgs; - } -// console.log('keyframeGetUndoCopy arguments:', arguments, 'this:', this, 'result:', result); - return result; -} -function keyframeExtend(dataIn) { - const data = Object.assign({}, dataIn); -// console.log('keyframeExtend 1 arguments:', arguments); - if (Format.id === "animated_entity_model") { - if (typeof data.values === 'object') { - if (data.values.easing !== undefined) { - Merge.string(this, data.values, 'easing'); - } - if (Array.isArray(data.values.easingArgs)) { - this.easingArgs = data.values.easingArgs; - } - if (!Array.isArray(data.values) && Array.isArray(data.values.vector)) { - // Convert data to format expected by KeyframeExtendOriginal - data.values = data.values.vector; - } - } else { - if (data.easing !== undefined) { - Merge.string(this, data, 'easing'); - } - if (Array.isArray(data.easingArgs)) { - this.easingArgs = data.easingArgs; - } +/***/ }), + +/***/ "./node_modules/lodash/_arrayLikeKeys.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_arrayLikeKeys.js ***! + \***********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseTimes = __webpack_require__(/*! ./_baseTimes */ "./node_modules/lodash/_baseTimes.js"), + isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/lodash/isBuffer.js"), + isIndex = __webpack_require__(/*! ./_isIndex */ "./node_modules/lodash/_isIndex.js"), + isTypedArray = __webpack_require__(/*! ./isTypedArray */ "./node_modules/lodash/isTypedArray.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); } } - const result = _utils__WEBPACK_IMPORTED_MODULE_0__["Original"].get(Keyframe).extend.apply(this, arguments); -// console.log('keyframeExtend 2 arguments:', arguments, 'this:', this, 'result:', result); return result; } -function reverseKeyframesCondition() { - const res = _utils__WEBPACK_IMPORTED_MODULE_0__["Original"].get(BarItems.reverse_keyframes).condition() && Format.id !== "animated_entity_model"; - // console.log('reverseKeyframesCondition original:',Original.get(BarItems.reverse_keyframes).condition(), 'res:', res); - return res; -} +module.exports = arrayLikeKeys; -//#endregion Keyframe Mixins /***/ }), -/***/ "./node_modules/lodash/_DataView.js": +/***/ "./node_modules/lodash/_arrayMap.js": /*!******************************************!*\ - !*** ./node_modules/lodash/_DataView.js ***! + !*** ./node_modules/lodash/_arrayMap.js ***! \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module) => { -var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), - root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); -/* Built-in method references that are verified to be native. */ -var DataView = getNative(root, 'DataView'); + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} -module.exports = DataView; +module.exports = arrayMap; /***/ }), -/***/ "./node_modules/lodash/_Hash.js": -/*!**************************************!*\ - !*** ./node_modules/lodash/_Hash.js ***! - \**************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var hashClear = __webpack_require__(/*! ./_hashClear */ "./node_modules/lodash/_hashClear.js"), - hashDelete = __webpack_require__(/*! ./_hashDelete */ "./node_modules/lodash/_hashDelete.js"), - hashGet = __webpack_require__(/*! ./_hashGet */ "./node_modules/lodash/_hashGet.js"), - hashHas = __webpack_require__(/*! ./_hashHas */ "./node_modules/lodash/_hashHas.js"), - hashSet = __webpack_require__(/*! ./_hashSet */ "./node_modules/lodash/_hashSet.js"); +/***/ "./node_modules/lodash/_arrayPush.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_arrayPush.js ***! + \*******************************************/ +/***/ ((module) => { /** - * Creates a hash object. + * Appends the elements of `values` to `array`. * * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. */ -function Hash(entries) { +function arrayPush(array, values) { var index = -1, - length = entries == null ? 0 : entries.length; + length = values.length, + offset = array.length; - this.clear(); while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); + array[offset + index] = values[index]; } + return array; } -// Add methods to `Hash`. -Hash.prototype.clear = hashClear; -Hash.prototype['delete'] = hashDelete; -Hash.prototype.get = hashGet; -Hash.prototype.has = hashHas; -Hash.prototype.set = hashSet; - -module.exports = Hash; +module.exports = arrayPush; /***/ }), -/***/ "./node_modules/lodash/_ListCache.js": +/***/ "./node_modules/lodash/_arraySome.js": /*!*******************************************!*\ - !*** ./node_modules/lodash/_ListCache.js ***! + !*** ./node_modules/lodash/_arraySome.js ***! \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var listCacheClear = __webpack_require__(/*! ./_listCacheClear */ "./node_modules/lodash/_listCacheClear.js"), - listCacheDelete = __webpack_require__(/*! ./_listCacheDelete */ "./node_modules/lodash/_listCacheDelete.js"), - listCacheGet = __webpack_require__(/*! ./_listCacheGet */ "./node_modules/lodash/_listCacheGet.js"), - listCacheHas = __webpack_require__(/*! ./_listCacheHas */ "./node_modules/lodash/_listCacheHas.js"), - listCacheSet = __webpack_require__(/*! ./_listCacheSet */ "./node_modules/lodash/_listCacheSet.js"); +/***/ ((module) => { /** - * Creates an list cache object. + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. * * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. */ -function ListCache(entries) { +function arraySome(array, predicate) { var index = -1, - length = entries == null ? 0 : entries.length; + length = array == null ? 0 : array.length; - this.clear(); while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); + if (predicate(array[index], index, array)) { + return true; + } } + return false; } -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; - -module.exports = ListCache; +module.exports = arraySome; /***/ }), -/***/ "./node_modules/lodash/_Map.js": -/*!*************************************!*\ - !*** ./node_modules/lodash/_Map.js ***! - \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), - root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); - -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'); - -module.exports = Map; - +/***/ "./node_modules/lodash/_assignValue.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_assignValue.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -/***/ }), +var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "./node_modules/lodash/_baseAssignValue.js"), + eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js"); -/***/ "./node_modules/lodash/_MapCache.js": -/*!******************************************!*\ - !*** ./node_modules/lodash/_MapCache.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/** Used for built-in method references. */ +var objectProto = Object.prototype; -var mapCacheClear = __webpack_require__(/*! ./_mapCacheClear */ "./node_modules/lodash/_mapCacheClear.js"), - mapCacheDelete = __webpack_require__(/*! ./_mapCacheDelete */ "./node_modules/lodash/_mapCacheDelete.js"), - mapCacheGet = __webpack_require__(/*! ./_mapCacheGet */ "./node_modules/lodash/_mapCacheGet.js"), - mapCacheHas = __webpack_require__(/*! ./_mapCacheHas */ "./node_modules/lodash/_mapCacheHas.js"), - mapCacheSet = __webpack_require__(/*! ./_mapCacheSet */ "./node_modules/lodash/_mapCacheSet.js"); +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** - * Creates a map cache object to store key-value pairs. + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. * * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. */ -function MapCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); } } -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; - -module.exports = MapCache; +module.exports = assignValue; /***/ }), -/***/ "./node_modules/lodash/_Promise.js": -/*!*****************************************!*\ - !*** ./node_modules/lodash/_Promise.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/lodash/_assocIndexOf.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_assocIndexOf.js ***! + \**********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), - root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); +var eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js"); -/* Built-in method references that are verified to be native. */ -var Promise = getNative(root, 'Promise'); +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} -module.exports = Promise; +module.exports = assocIndexOf; /***/ }), -/***/ "./node_modules/lodash/_Set.js": -/*!*************************************!*\ - !*** ./node_modules/lodash/_Set.js ***! - \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/lodash/_baseAggregator.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_baseAggregator.js ***! + \************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), - root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); +var baseEach = __webpack_require__(/*! ./_baseEach */ "./node_modules/lodash/_baseEach.js"); -/* Built-in method references that are verified to be native. */ -var Set = getNative(root, 'Set'); +/** + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ +function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; +} -module.exports = Set; +module.exports = baseAggregator; /***/ }), -/***/ "./node_modules/lodash/_SetCache.js": -/*!******************************************!*\ - !*** ./node_modules/lodash/_SetCache.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/lodash/_baseAssign.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseAssign.js ***! + \********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var MapCache = __webpack_require__(/*! ./_MapCache */ "./node_modules/lodash/_MapCache.js"), - setCacheAdd = __webpack_require__(/*! ./_setCacheAdd */ "./node_modules/lodash/_setCacheAdd.js"), - setCacheHas = __webpack_require__(/*! ./_setCacheHas */ "./node_modules/lodash/_setCacheHas.js"); +var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); /** - * - * Creates an array cache object to store unique values. + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. * * @private - * @constructor - * @param {Array} [values] The values to cache. + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. */ -function SetCache(values) { - var index = -1, - length = values == null ? 0 : values.length; - - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); - } +function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); } -// Add methods to `SetCache`. -SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; -SetCache.prototype.has = setCacheHas; - -module.exports = SetCache; +module.exports = baseAssign; /***/ }), -/***/ "./node_modules/lodash/_Stack.js": -/*!***************************************!*\ - !*** ./node_modules/lodash/_Stack.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/lodash/_baseAssignIn.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_baseAssignIn.js ***! + \**********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/lodash/_ListCache.js"), - stackClear = __webpack_require__(/*! ./_stackClear */ "./node_modules/lodash/_stackClear.js"), - stackDelete = __webpack_require__(/*! ./_stackDelete */ "./node_modules/lodash/_stackDelete.js"), - stackGet = __webpack_require__(/*! ./_stackGet */ "./node_modules/lodash/_stackGet.js"), - stackHas = __webpack_require__(/*! ./_stackHas */ "./node_modules/lodash/_stackHas.js"), - stackSet = __webpack_require__(/*! ./_stackSet */ "./node_modules/lodash/_stackSet.js"); +var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"), + keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/lodash/keysIn.js"); /** - * Creates a stack cache object to store key-value pairs. + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. * * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. */ -function Stack(entries) { - var data = this.__data__ = new ListCache(entries); - this.size = data.size; +function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); } -// Add methods to `Stack`. -Stack.prototype.clear = stackClear; -Stack.prototype['delete'] = stackDelete; -Stack.prototype.get = stackGet; -Stack.prototype.has = stackHas; -Stack.prototype.set = stackSet; - -module.exports = Stack; +module.exports = baseAssignIn; /***/ }), -/***/ "./node_modules/lodash/_Symbol.js": -/*!****************************************!*\ - !*** ./node_modules/lodash/_Symbol.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/lodash/_baseAssignValue.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_baseAssignValue.js ***! + \*************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); +var defineProperty = __webpack_require__(/*! ./_defineProperty */ "./node_modules/lodash/_defineProperty.js"); -/** Built-in value references. */ -var Symbol = root.Symbol; +/** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } +} -module.exports = Symbol; +module.exports = baseAssignValue; /***/ }), -/***/ "./node_modules/lodash/_Uint8Array.js": -/*!********************************************!*\ - !*** ./node_modules/lodash/_Uint8Array.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/lodash/_baseClone.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseClone.js ***! + \*******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); +var Stack = __webpack_require__(/*! ./_Stack */ "./node_modules/lodash/_Stack.js"), + arrayEach = __webpack_require__(/*! ./_arrayEach */ "./node_modules/lodash/_arrayEach.js"), + assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/lodash/_assignValue.js"), + baseAssign = __webpack_require__(/*! ./_baseAssign */ "./node_modules/lodash/_baseAssign.js"), + baseAssignIn = __webpack_require__(/*! ./_baseAssignIn */ "./node_modules/lodash/_baseAssignIn.js"), + cloneBuffer = __webpack_require__(/*! ./_cloneBuffer */ "./node_modules/lodash/_cloneBuffer.js"), + copyArray = __webpack_require__(/*! ./_copyArray */ "./node_modules/lodash/_copyArray.js"), + copySymbols = __webpack_require__(/*! ./_copySymbols */ "./node_modules/lodash/_copySymbols.js"), + copySymbolsIn = __webpack_require__(/*! ./_copySymbolsIn */ "./node_modules/lodash/_copySymbolsIn.js"), + getAllKeys = __webpack_require__(/*! ./_getAllKeys */ "./node_modules/lodash/_getAllKeys.js"), + getAllKeysIn = __webpack_require__(/*! ./_getAllKeysIn */ "./node_modules/lodash/_getAllKeysIn.js"), + getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"), + initCloneArray = __webpack_require__(/*! ./_initCloneArray */ "./node_modules/lodash/_initCloneArray.js"), + initCloneByTag = __webpack_require__(/*! ./_initCloneByTag */ "./node_modules/lodash/_initCloneByTag.js"), + initCloneObject = __webpack_require__(/*! ./_initCloneObject */ "./node_modules/lodash/_initCloneObject.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/lodash/isBuffer.js"), + isMap = __webpack_require__(/*! ./isMap */ "./node_modules/lodash/isMap.js"), + isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), + isSet = __webpack_require__(/*! ./isSet */ "./node_modules/lodash/isSet.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"), + keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/lodash/keysIn.js"); -/** Built-in value references. */ -var Uint8Array = root.Uint8Array; +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; -module.exports = Uint8Array; +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; -/***/ }), +/** Used to identify `toStringTag` values supported by `_.clone`. */ +var cloneableTags = {}; +cloneableTags[argsTag] = cloneableTags[arrayTag] = +cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = +cloneableTags[boolTag] = cloneableTags[dateTag] = +cloneableTags[float32Tag] = cloneableTags[float64Tag] = +cloneableTags[int8Tag] = cloneableTags[int16Tag] = +cloneableTags[int32Tag] = cloneableTags[mapTag] = +cloneableTags[numberTag] = cloneableTags[objectTag] = +cloneableTags[regexpTag] = cloneableTags[setTag] = +cloneableTags[stringTag] = cloneableTags[symbolTag] = +cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = +cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; +cloneableTags[errorTag] = cloneableTags[funcTag] = +cloneableTags[weakMapTag] = false; -/***/ "./node_modules/lodash/_WeakMap.js": -/*!*****************************************!*\ - !*** ./node_modules/lodash/_WeakMap.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ +function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; -var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), - root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; -/* Built-in method references that are verified to be native. */ -var WeakMap = getNative(root, 'WeakMap'); + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); -module.exports = WeakMap; + if (isSet(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + } else if (isMap(value)) { + value.forEach(function(subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + } + + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); + + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; +} + +module.exports = baseClone; /***/ }), -/***/ "./node_modules/lodash/_apply.js": -/*!***************************************!*\ - !*** ./node_modules/lodash/_apply.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/lodash/_baseCreate.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseCreate.js ***! + \********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"); + +/** Built-in value references. */ +var objectCreate = Object.create; /** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. + * The base implementation of `_.create` without support for assigning + * properties to the created object. * * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. */ -function apply(func, thisArg, args) { - switch (args.length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); -} +var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; +}()); -module.exports = apply; +module.exports = baseCreate; /***/ }), -/***/ "./node_modules/lodash/_arrayEach.js": -/*!*******************************************!*\ - !*** ./node_modules/lodash/_arrayEach.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/lodash/_baseEach.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_baseEach.js ***! + \******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseForOwn = __webpack_require__(/*! ./_baseForOwn */ "./node_modules/lodash/_baseForOwn.js"), + createBaseEach = __webpack_require__(/*! ./_createBaseEach */ "./node_modules/lodash/_createBaseEach.js"); /** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. + * The base implementation of `_.forEach` without support for iteratee shorthands. * * @private - * @param {Array} [array] The array to iterate over. + * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. + * @returns {Array|Object} Returns `collection`. */ -function arrayEach(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; -} +var baseEach = createBaseEach(baseForOwn); -module.exports = arrayEach; +module.exports = baseEach; /***/ }), -/***/ "./node_modules/lodash/_arrayFilter.js": -/*!*********************************************!*\ - !*** ./node_modules/lodash/_arrayFilter.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/lodash/_baseFindIndex.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_baseFindIndex.js ***! + \***********************************************/ +/***/ ((module) => { /** - * A specialized version of `_.filter` for arrays without support for - * iteratee shorthands. + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. * * @private - * @param {Array} [array] The array to iterate over. + * @param {Array} array The array to inspect. * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. */ -function arrayFilter(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[resIndex++] = value; + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; } } - return result; + return -1; } -module.exports = arrayFilter; +module.exports = baseFindIndex; /***/ }), -/***/ "./node_modules/lodash/_arrayIncludes.js": -/*!***********************************************!*\ - !*** ./node_modules/lodash/_arrayIncludes.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/lodash/_baseFlatten.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseFlatten.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var baseIndexOf = __webpack_require__(/*! ./_baseIndexOf */ "./node_modules/lodash/_baseIndexOf.js"); +var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/lodash/_arrayPush.js"), + isFlattenable = __webpack_require__(/*! ./_isFlattenable */ "./node_modules/lodash/_isFlattenable.js"); /** - * A specialized version of `_.includes` for arrays without support for - * specifying an index to search from. + * The base implementation of `_.flatten` with support for restricting flattening. * * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @returns {boolean} Returns `true` if `target` is found, else `false`. + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. */ -function arrayIncludes(array, value) { - var length = array == null ? 0 : array.length; - return !!length && baseIndexOf(array, value, 0) > -1; +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; } -module.exports = arrayIncludes; +module.exports = baseFlatten; /***/ }), -/***/ "./node_modules/lodash/_arrayIncludesWith.js": -/*!***************************************************!*\ - !*** ./node_modules/lodash/_arrayIncludesWith.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/lodash/_baseFor.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_baseFor.js ***! + \*****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var createBaseFor = __webpack_require__(/*! ./_createBaseFor */ "./node_modules/lodash/_createBaseFor.js"); /** - * This function is like `arrayIncludes` except that it accepts a comparator. + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. * * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @param {Function} comparator The comparator invoked per element. - * @returns {boolean} Returns `true` if `target` is found, else `false`. + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. */ -function arrayIncludesWith(array, value, comparator) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (comparator(value, array[index])) { - return true; - } - } - return false; -} +var baseFor = createBaseFor(); -module.exports = arrayIncludesWith; +module.exports = baseFor; /***/ }), -/***/ "./node_modules/lodash/_arrayLikeKeys.js": -/*!***********************************************!*\ - !*** ./node_modules/lodash/_arrayLikeKeys.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var baseTimes = __webpack_require__(/*! ./_baseTimes */ "./node_modules/lodash/_baseTimes.js"), - isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"), - isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), - isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/lodash/isBuffer.js"), - isIndex = __webpack_require__(/*! ./_isIndex */ "./node_modules/lodash/_isIndex.js"), - isTypedArray = __webpack_require__(/*! ./isTypedArray */ "./node_modules/lodash/isTypedArray.js"); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; +/***/ "./node_modules/lodash/_baseForOwn.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseForOwn.js ***! + \********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +var baseFor = __webpack_require__(/*! ./_baseFor */ "./node_modules/lodash/_baseFor.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); /** - * Creates an array of the enumerable property names of the array-like `value`. + * The base implementation of `_.forOwn` without support for iteratee shorthands. * * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. */ -function arrayLikeKeys(value, inherited) { - var isArr = isArray(value), - isArg = !isArr && isArguments(value), - isBuff = !isArr && !isArg && isBuffer(value), - isType = !isArr && !isArg && !isBuff && isTypedArray(value), - skipIndexes = isArr || isArg || isBuff || isType, - result = skipIndexes ? baseTimes(value.length, String) : [], - length = result.length; - - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && ( - // Safari 9 has enumerable `arguments.length` in strict mode. - key == 'length' || - // Node.js 0.10 has enumerable non-index properties on buffers. - (isBuff && (key == 'offset' || key == 'parent')) || - // PhantomJS 2 has enumerable non-index properties on typed arrays. - (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || - // Skip index properties. - isIndex(key, length) - ))) { - result.push(key); - } - } - return result; +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); } -module.exports = arrayLikeKeys; +module.exports = baseForOwn; /***/ }), -/***/ "./node_modules/lodash/_arrayMap.js": -/*!******************************************!*\ - !*** ./node_modules/lodash/_arrayMap.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/lodash/_baseGet.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_baseGet.js ***! + \*****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/lodash/_castPath.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"); /** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. + * The base implementation of `_.get` without support for default values. * * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. */ -function arrayMap(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length, - result = Array(length); +function baseGet(object, path) { + path = castPath(path, object); - while (++index < length) { - result[index] = iteratee(array[index], index, array); + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; } - return result; + return (index && index == length) ? object : undefined; } -module.exports = arrayMap; +module.exports = baseGet; /***/ }), -/***/ "./node_modules/lodash/_arrayPush.js": -/*!*******************************************!*\ - !*** ./node_modules/lodash/_arrayPush.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/lodash/_baseGetAllKeys.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_baseGetAllKeys.js ***! + \************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/lodash/_arrayPush.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"); /** - * Appends the elements of `values` to `array`. + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. * * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. */ -function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); } -module.exports = arrayPush; +module.exports = baseGetAllKeys; /***/ }), -/***/ "./node_modules/lodash/_assignValue.js": -/*!*********************************************!*\ - !*** ./node_modules/lodash/_assignValue.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/lodash/_baseGetTag.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseGetTag.js ***! + \********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "./node_modules/lodash/_baseAssignValue.js"), - eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js"); +var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"), + getRawTag = __webpack_require__(/*! ./_getRawTag */ "./node_modules/lodash/_getRawTag.js"), + objectToString = __webpack_require__(/*! ./_objectToString */ "./node_modules/lodash/_objectToString.js"); -/** Used for built-in method references. */ -var objectProto = Object.prototype; +/** `Object#toString` result references. */ +var nullTag = '[object Null]', + undefinedTag = '[object Undefined]'; -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; /** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. + * The base implementation of `getTag` without fallbacks for buggy environments. * * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. */ -function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); } -module.exports = assignValue; +module.exports = baseGetTag; /***/ }), -/***/ "./node_modules/lodash/_assocIndexOf.js": -/*!**********************************************!*\ - !*** ./node_modules/lodash/_assocIndexOf.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js"); +/***/ "./node_modules/lodash/_baseHasIn.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseHasIn.js ***! + \*******************************************/ +/***/ ((module) => { /** - * Gets the index at which the `key` is found in `array` of key-value pairs. + * The base implementation of `_.hasIn` without support for deep paths. * * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; +function baseHasIn(object, key) { + return object != null && key in Object(object); } -module.exports = assocIndexOf; +module.exports = baseHasIn; /***/ }), -/***/ "./node_modules/lodash/_baseAssign.js": -/*!********************************************!*\ - !*** ./node_modules/lodash/_baseAssign.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/lodash/_baseIndexOf.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseIndexOf.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"), - keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); +var baseFindIndex = __webpack_require__(/*! ./_baseFindIndex */ "./node_modules/lodash/_baseFindIndex.js"), + baseIsNaN = __webpack_require__(/*! ./_baseIsNaN */ "./node_modules/lodash/_baseIsNaN.js"), + strictIndexOf = __webpack_require__(/*! ./_strictIndexOf */ "./node_modules/lodash/_strictIndexOf.js"); /** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. * * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. */ -function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); +function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); } -module.exports = baseAssign; +module.exports = baseIndexOf; /***/ }), -/***/ "./node_modules/lodash/_baseAssignIn.js": -/*!**********************************************!*\ - !*** ./node_modules/lodash/_baseAssignIn.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/lodash/_baseIsArguments.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_baseIsArguments.js ***! + \*************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"), - keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/lodash/keysIn.js"); +var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]'; /** - * The base implementation of `_.assignIn` without support for multiple sources - * or `customizer` functions. + * The base implementation of `_.isArguments`. * * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ -function baseAssignIn(object, source) { - return object && copyObject(source, keysIn(source), object); +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; } -module.exports = baseAssignIn; +module.exports = baseIsArguments; /***/ }), -/***/ "./node_modules/lodash/_baseAssignValue.js": -/*!*************************************************!*\ - !*** ./node_modules/lodash/_baseAssignValue.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/lodash/_baseIsEqual.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseIsEqual.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var defineProperty = __webpack_require__(/*! ./_defineProperty */ "./node_modules/lodash/_defineProperty.js"); +var baseIsEqualDeep = __webpack_require__(/*! ./_baseIsEqualDeep */ "./node_modules/lodash/_baseIsEqualDeep.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); /** - * The base implementation of `assignValue` and `assignMergeValue` without - * value checks. + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. * * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. */ -function baseAssignValue(object, key, value) { - if (key == '__proto__' && defineProperty) { - defineProperty(object, key, { - 'configurable': true, - 'enumerable': true, - 'value': value, - 'writable': true - }); - } else { - object[key] = value; +function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); } -module.exports = baseAssignValue; +module.exports = baseIsEqual; /***/ }), -/***/ "./node_modules/lodash/_baseClone.js": -/*!*******************************************!*\ - !*** ./node_modules/lodash/_baseClone.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/lodash/_baseIsEqualDeep.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_baseIsEqualDeep.js ***! + \*************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Stack = __webpack_require__(/*! ./_Stack */ "./node_modules/lodash/_Stack.js"), - arrayEach = __webpack_require__(/*! ./_arrayEach */ "./node_modules/lodash/_arrayEach.js"), - assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/lodash/_assignValue.js"), - baseAssign = __webpack_require__(/*! ./_baseAssign */ "./node_modules/lodash/_baseAssign.js"), - baseAssignIn = __webpack_require__(/*! ./_baseAssignIn */ "./node_modules/lodash/_baseAssignIn.js"), - cloneBuffer = __webpack_require__(/*! ./_cloneBuffer */ "./node_modules/lodash/_cloneBuffer.js"), - copyArray = __webpack_require__(/*! ./_copyArray */ "./node_modules/lodash/_copyArray.js"), - copySymbols = __webpack_require__(/*! ./_copySymbols */ "./node_modules/lodash/_copySymbols.js"), - copySymbolsIn = __webpack_require__(/*! ./_copySymbolsIn */ "./node_modules/lodash/_copySymbolsIn.js"), - getAllKeys = __webpack_require__(/*! ./_getAllKeys */ "./node_modules/lodash/_getAllKeys.js"), - getAllKeysIn = __webpack_require__(/*! ./_getAllKeysIn */ "./node_modules/lodash/_getAllKeysIn.js"), + equalArrays = __webpack_require__(/*! ./_equalArrays */ "./node_modules/lodash/_equalArrays.js"), + equalByTag = __webpack_require__(/*! ./_equalByTag */ "./node_modules/lodash/_equalByTag.js"), + equalObjects = __webpack_require__(/*! ./_equalObjects */ "./node_modules/lodash/_equalObjects.js"), getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"), - initCloneArray = __webpack_require__(/*! ./_initCloneArray */ "./node_modules/lodash/_initCloneArray.js"), - initCloneByTag = __webpack_require__(/*! ./_initCloneByTag */ "./node_modules/lodash/_initCloneByTag.js"), - initCloneObject = __webpack_require__(/*! ./_initCloneObject */ "./node_modules/lodash/_initCloneObject.js"), isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/lodash/isBuffer.js"), - isMap = __webpack_require__(/*! ./isMap */ "./node_modules/lodash/isMap.js"), - isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), - isSet = __webpack_require__(/*! ./isSet */ "./node_modules/lodash/isSet.js"), - keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"), - keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/lodash/keysIn.js"); + isTypedArray = __webpack_require__(/*! ./isTypedArray */ "./node_modules/lodash/isTypedArray.js"); -/** Used to compose bitmasks for cloning. */ -var CLONE_DEEP_FLAG = 1, - CLONE_FLAT_FLAG = 2, - CLONE_SYMBOLS_FLAG = 4; +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - weakMapTag = '[object WeakMap]'; + objectTag = '[object Object]'; -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; +/** Used for built-in method references. */ +var objectProto = Object.prototype; -/** Used to identify `toStringTag` values supported by `_.clone`. */ -var cloneableTags = {}; -cloneableTags[argsTag] = cloneableTags[arrayTag] = -cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = -cloneableTags[boolTag] = cloneableTags[dateTag] = -cloneableTags[float32Tag] = cloneableTags[float64Tag] = -cloneableTags[int8Tag] = cloneableTags[int16Tag] = -cloneableTags[int32Tag] = cloneableTags[mapTag] = -cloneableTags[numberTag] = cloneableTags[objectTag] = -cloneableTags[regexpTag] = cloneableTags[setTag] = -cloneableTags[stringTag] = cloneableTags[symbolTag] = -cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = -cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; -cloneableTags[errorTag] = cloneableTags[funcTag] = -cloneableTags[weakMapTag] = false; +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. * * @private - * @param {*} value The value to clone. - * @param {boolean} bitmask The bitmask flags. - * 1 - Deep clone - * 2 - Flatten inherited properties - * 4 - Clone symbols - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ -function baseClone(value, bitmask, customizer, key, object, stack) { - var result, - isDeep = bitmask & CLONE_DEEP_FLAG, - isFlat = bitmask & CLONE_FLAT_FLAG, - isFull = bitmask & CLONE_SYMBOLS_FLAG; - - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; } - if (!isObject(value)) { - return value; + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - result = (isFlat || isFunc) ? {} : initCloneObject(value); - if (!isDeep) { - return isFlat - ? copySymbolsIn(value, baseAssignIn(result, value)) - : copySymbols(value, baseAssign(result, value)); - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, isDeep); + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); } } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; + if (!isSameTag) { + return false; } - stack.set(value, result); + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); +} - if (isSet(value)) { - value.forEach(function(subValue) { - result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); - }); - } else if (isMap(value)) { - value.forEach(function(subValue, key) { - result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - } - - var keysFunc = isFull - ? (isFlat ? getAllKeysIn : getAllKeys) - : (isFlat ? keysIn : keys); - - var props = isArr ? undefined : keysFunc(value); - arrayEach(props || value, function(subValue, key) { - if (props) { - key = subValue; - subValue = value[key]; - } - // Recursively populate clone (susceptible to call stack limits). - assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - return result; -} - -module.exports = baseClone; +module.exports = baseIsEqualDeep; /***/ }), -/***/ "./node_modules/lodash/_baseCreate.js": -/*!********************************************!*\ - !*** ./node_modules/lodash/_baseCreate.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/lodash/_baseIsMap.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseIsMap.js ***! + \*******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"); +var getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); -/** Built-in value references. */ -var objectCreate = Object.create; +/** `Object#toString` result references. */ +var mapTag = '[object Map]'; /** - * The base implementation of `_.create` without support for assigning - * properties to the created object. + * The base implementation of `_.isMap` without Node.js optimizations. * * @private - * @param {Object} proto The object to inherit from. - * @returns {Object} Returns the new object. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. */ -var baseCreate = (function() { - function object() {} - return function(proto) { - if (!isObject(proto)) { - return {}; - } - if (objectCreate) { - return objectCreate(proto); - } - object.prototype = proto; - var result = new object; - object.prototype = undefined; - return result; - }; -}()); +function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; +} -module.exports = baseCreate; +module.exports = baseIsMap; /***/ }), -/***/ "./node_modules/lodash/_baseFindIndex.js": -/*!***********************************************!*\ - !*** ./node_modules/lodash/_baseFindIndex.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/lodash/_baseIsMatch.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseIsMatch.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var Stack = __webpack_require__(/*! ./_Stack */ "./node_modules/lodash/_Stack.js"), + baseIsEqual = __webpack_require__(/*! ./_baseIsEqual */ "./node_modules/lodash/_baseIsEqual.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; /** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. + * The base implementation of `_.isMatch` without support for iteratee shorthands. * * @private - * @param {Array} array The array to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. */ -function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); +function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; } } - return -1; + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } + } + return true; } -module.exports = baseFindIndex; +module.exports = baseIsMatch; /***/ }), -/***/ "./node_modules/lodash/_baseFlatten.js": -/*!*********************************************!*\ - !*** ./node_modules/lodash/_baseFlatten.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/lodash/_arrayPush.js"), - isFlattenable = __webpack_require__(/*! ./_isFlattenable */ "./node_modules/lodash/_isFlattenable.js"); +/***/ "./node_modules/lodash/_baseIsNaN.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseIsNaN.js ***! + \*******************************************/ +/***/ ((module) => { /** - * The base implementation of `_.flatten` with support for restricting flattening. + * The base implementation of `_.isNaN` without support for number objects. * * @private - * @param {Array} array The array to flatten. - * @param {number} depth The maximum recursion depth. - * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. - * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. */ -function baseFlatten(array, depth, predicate, isStrict, result) { - var index = -1, - length = array.length; - - predicate || (predicate = isFlattenable); - result || (result = []); - - while (++index < length) { - var value = array[index]; - if (depth > 0 && predicate(value)) { - if (depth > 1) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, depth - 1, predicate, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; +function baseIsNaN(value) { + return value !== value; } -module.exports = baseFlatten; +module.exports = baseIsNaN; /***/ }), -/***/ "./node_modules/lodash/_baseGet.js": -/*!*****************************************!*\ - !*** ./node_modules/lodash/_baseGet.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/lodash/_baseIsNative.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_baseIsNative.js ***! + \**********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/lodash/_castPath.js"), - toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"); +var isFunction = __webpack_require__(/*! ./isFunction */ "./node_modules/lodash/isFunction.js"), + isMasked = __webpack_require__(/*! ./_isMasked */ "./node_modules/lodash/_isMasked.js"), + isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), + toSource = __webpack_require__(/*! ./_toSource */ "./node_modules/lodash/_toSource.js"); /** - * The base implementation of `_.get` without support for default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ -function baseGet(object, path) { - path = castPath(path, object); - - var index = 0, - length = path.length; - - while (object != null && index < length) { - object = object[toKey(path[index++])]; - } - return (index && index == length) ? object : undefined; -} +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; -module.exports = baseGet; +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; -/***/ }), +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; -/***/ "./node_modules/lodash/_baseGetAllKeys.js": -/*!************************************************!*\ - !*** ./node_modules/lodash/_baseGetAllKeys.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; -var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/lodash/_arrayPush.js"), - isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"); +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); /** - * The base implementation of `getAllKeys` and `getAllKeysIn` which uses - * `keysFunc` and `symbolsFunc` to get the enumerable property names and - * symbols of `object`. + * The base implementation of `_.isNative` without bad shim checks. * * @private - * @param {Object} object The object to query. - * @param {Function} keysFunc The function to get the keys of `object`. - * @param {Function} symbolsFunc The function to get the symbols of `object`. - * @returns {Array} Returns the array of property names and symbols. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. */ -function baseGetAllKeys(object, keysFunc, symbolsFunc) { - var result = keysFunc(object); - return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); } -module.exports = baseGetAllKeys; +module.exports = baseIsNative; /***/ }), -/***/ "./node_modules/lodash/_baseGetTag.js": -/*!********************************************!*\ - !*** ./node_modules/lodash/_baseGetTag.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/lodash/_baseIsSet.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseIsSet.js ***! + \*******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"), - getRawTag = __webpack_require__(/*! ./_getRawTag */ "./node_modules/lodash/_getRawTag.js"), - objectToString = __webpack_require__(/*! ./_objectToString */ "./node_modules/lodash/_objectToString.js"); +var getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); /** `Object#toString` result references. */ -var nullTag = '[object Null]', - undefinedTag = '[object Undefined]'; - -/** Built-in value references. */ -var symToStringTag = Symbol ? Symbol.toStringTag : undefined; +var setTag = '[object Set]'; /** - * The base implementation of `getTag` without fallbacks for buggy environments. + * The base implementation of `_.isSet` without Node.js optimizations. * * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. */ -function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); +function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; } -module.exports = baseGetTag; +module.exports = baseIsSet; /***/ }), -/***/ "./node_modules/lodash/_baseIndexOf.js": -/*!*********************************************!*\ - !*** ./node_modules/lodash/_baseIndexOf.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var baseFindIndex = __webpack_require__(/*! ./_baseFindIndex */ "./node_modules/lodash/_baseFindIndex.js"), - baseIsNaN = __webpack_require__(/*! ./_baseIsNaN */ "./node_modules/lodash/_baseIsNaN.js"), - strictIndexOf = __webpack_require__(/*! ./_strictIndexOf */ "./node_modules/lodash/_strictIndexOf.js"); - -/** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseIndexOf(array, value, fromIndex) { - return value === value - ? strictIndexOf(array, value, fromIndex) - : baseFindIndex(array, baseIsNaN, fromIndex); -} - -module.exports = baseIndexOf; - - -/***/ }), - -/***/ "./node_modules/lodash/_baseIsArguments.js": -/*!*************************************************!*\ - !*** ./node_modules/lodash/_baseIsArguments.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), - isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]'; - -/** - * The base implementation of `_.isArguments`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - */ -function baseIsArguments(value) { - return isObjectLike(value) && baseGetTag(value) == argsTag; -} - -module.exports = baseIsArguments; - - -/***/ }), - -/***/ "./node_modules/lodash/_baseIsMap.js": -/*!*******************************************!*\ - !*** ./node_modules/lodash/_baseIsMap.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"), - isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); - -/** `Object#toString` result references. */ -var mapTag = '[object Map]'; - -/** - * The base implementation of `_.isMap` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a map, else `false`. - */ -function baseIsMap(value) { - return isObjectLike(value) && getTag(value) == mapTag; -} - -module.exports = baseIsMap; - - -/***/ }), - -/***/ "./node_modules/lodash/_baseIsNaN.js": -/*!*******************************************!*\ - !*** ./node_modules/lodash/_baseIsNaN.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * The base implementation of `_.isNaN` without support for number objects. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - */ -function baseIsNaN(value) { - return value !== value; -} - -module.exports = baseIsNaN; - - -/***/ }), - -/***/ "./node_modules/lodash/_baseIsNative.js": -/*!**********************************************!*\ - !*** ./node_modules/lodash/_baseIsNative.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var isFunction = __webpack_require__(/*! ./isFunction */ "./node_modules/lodash/isFunction.js"), - isMasked = __webpack_require__(/*! ./_isMasked */ "./node_modules/lodash/_isMasked.js"), - isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), - toSource = __webpack_require__(/*! ./_toSource */ "./node_modules/lodash/_toSource.js"); - -/** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** Used for built-in method references. */ -var funcProto = Function.prototype, - objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ -function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = isFunction(value) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); -} - -module.exports = baseIsNative; - - -/***/ }), - -/***/ "./node_modules/lodash/_baseIsSet.js": -/*!*******************************************!*\ - !*** ./node_modules/lodash/_baseIsSet.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"), - isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); - -/** `Object#toString` result references. */ -var setTag = '[object Set]'; - -/** - * The base implementation of `_.isSet` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a set, else `false`. - */ -function baseIsSet(value) { - return isObjectLike(value) && getTag(value) == setTag; -} - -module.exports = baseIsSet; - - -/***/ }), - -/***/ "./node_modules/lodash/_baseIsTypedArray.js": -/*!**************************************************!*\ - !*** ./node_modules/lodash/_baseIsTypedArray.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/lodash/_baseIsTypedArray.js": +/*!**************************************************!*\ + !*** ./node_modules/lodash/_baseIsTypedArray.js ***! + \**************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), isLength = __webpack_require__(/*! ./isLength */ "./node_modules/lodash/isLength.js"), @@ -2786,14 +1812,54 @@ function baseIsTypedArray(value) { module.exports = baseIsTypedArray; +/***/ }), + +/***/ "./node_modules/lodash/_baseIteratee.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_baseIteratee.js ***! + \**********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseMatches = __webpack_require__(/*! ./_baseMatches */ "./node_modules/lodash/_baseMatches.js"), + baseMatchesProperty = __webpack_require__(/*! ./_baseMatchesProperty */ "./node_modules/lodash/_baseMatchesProperty.js"), + identity = __webpack_require__(/*! ./identity */ "./node_modules/lodash/identity.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + property = __webpack_require__(/*! ./property */ "./node_modules/lodash/property.js"); + +/** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ +function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); +} + +module.exports = baseIteratee; + + /***/ }), /***/ "./node_modules/lodash/_baseKeys.js": /*!******************************************!*\ !*** ./node_modules/lodash/_baseKeys.js ***! \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/lodash/_isPrototype.js"), nativeKeys = __webpack_require__(/*! ./_nativeKeys */ "./node_modules/lodash/_nativeKeys.js"); @@ -2833,8 +1899,7 @@ module.exports = baseKeys; /*!********************************************!*\ !*** ./node_modules/lodash/_baseKeysIn.js ***! \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/lodash/_isPrototype.js"), @@ -2873,69 +1938,192 @@ module.exports = baseKeysIn; /***/ }), -/***/ "./node_modules/lodash/_baseSetToString.js": -/*!*************************************************!*\ - !*** ./node_modules/lodash/_baseSetToString.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/lodash/_baseMatches.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseMatches.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var constant = __webpack_require__(/*! ./constant */ "./node_modules/lodash/constant.js"), - defineProperty = __webpack_require__(/*! ./_defineProperty */ "./node_modules/lodash/_defineProperty.js"), - identity = __webpack_require__(/*! ./identity */ "./node_modules/lodash/identity.js"); +var baseIsMatch = __webpack_require__(/*! ./_baseIsMatch */ "./node_modules/lodash/_baseIsMatch.js"), + getMatchData = __webpack_require__(/*! ./_getMatchData */ "./node_modules/lodash/_getMatchData.js"), + matchesStrictComparable = __webpack_require__(/*! ./_matchesStrictComparable */ "./node_modules/lodash/_matchesStrictComparable.js"); /** - * The base implementation of `setToString` without support for hot loop shorting. + * The base implementation of `_.matches` which doesn't clone `source`. * * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. */ -var baseSetToString = !defineProperty ? identity : function(func, string) { - return defineProperty(func, 'toString', { - 'configurable': true, - 'enumerable': false, - 'value': constant(string), - 'writable': true - }); -}; +function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; +} -module.exports = baseSetToString; +module.exports = baseMatches; /***/ }), -/***/ "./node_modules/lodash/_baseSlice.js": -/*!*******************************************!*\ - !*** ./node_modules/lodash/_baseSlice.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/lodash/_baseMatchesProperty.js": +/*!*****************************************************!*\ + !*** ./node_modules/lodash/_baseMatchesProperty.js ***! + \*****************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseIsEqual = __webpack_require__(/*! ./_baseIsEqual */ "./node_modules/lodash/_baseIsEqual.js"), + get = __webpack_require__(/*! ./get */ "./node_modules/lodash/get.js"), + hasIn = __webpack_require__(/*! ./hasIn */ "./node_modules/lodash/hasIn.js"), + isKey = __webpack_require__(/*! ./_isKey */ "./node_modules/lodash/_isKey.js"), + isStrictComparable = __webpack_require__(/*! ./_isStrictComparable */ "./node_modules/lodash/_isStrictComparable.js"), + matchesStrictComparable = __webpack_require__(/*! ./_matchesStrictComparable */ "./node_modules/lodash/_matchesStrictComparable.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; /** - * The base implementation of `_.slice` without an iteratee call guard. + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. * * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. */ -function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; +function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; +} + +module.exports = baseMatchesProperty; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseProperty.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_baseProperty.js ***! + \**********************************************/ +/***/ ((module) => { + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +module.exports = baseProperty; + + +/***/ }), + +/***/ "./node_modules/lodash/_basePropertyDeep.js": +/*!**************************************************!*\ + !*** ./node_modules/lodash/_basePropertyDeep.js ***! + \**************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseGet = __webpack_require__(/*! ./_baseGet */ "./node_modules/lodash/_baseGet.js"); + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; +} + +module.exports = basePropertyDeep; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseSetToString.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_baseSetToString.js ***! + \*************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var constant = __webpack_require__(/*! ./constant */ "./node_modules/lodash/constant.js"), + defineProperty = __webpack_require__(/*! ./_defineProperty */ "./node_modules/lodash/_defineProperty.js"), + identity = __webpack_require__(/*! ./identity */ "./node_modules/lodash/identity.js"); + +/** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); +}; + +module.exports = baseSetToString; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseSlice.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseSlice.js ***! + \*******************************************/ +/***/ ((module) => { + +/** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ +function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + var result = Array(length); while (++index < length) { result[index] = array[index + start]; @@ -2952,8 +2140,7 @@ module.exports = baseSlice; /*!*******************************************!*\ !*** ./node_modules/lodash/_baseTimes.js ***! \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** * The base implementation of `_.times` without support for iteratee shorthands @@ -2983,8 +2170,7 @@ module.exports = baseTimes; /*!**********************************************!*\ !*** ./node_modules/lodash/_baseToString.js ***! \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"), arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), @@ -3031,8 +2217,7 @@ module.exports = baseToString; /*!*******************************************!*\ !*** ./node_modules/lodash/_baseUnary.js ***! \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** * The base implementation of `_.unary` without support for storing metadata. @@ -3056,8 +2241,7 @@ module.exports = baseUnary; /*!******************************************!*\ !*** ./node_modules/lodash/_baseUniq.js ***! \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var SetCache = __webpack_require__(/*! ./_SetCache */ "./node_modules/lodash/_SetCache.js"), arrayIncludes = __webpack_require__(/*! ./_arrayIncludes */ "./node_modules/lodash/_arrayIncludes.js"), @@ -3139,8 +2323,7 @@ module.exports = baseUniq; /*!*******************************************!*\ !*** ./node_modules/lodash/_baseUnset.js ***! \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/lodash/_castPath.js"), last = __webpack_require__(/*! ./last */ "./node_modules/lodash/last.js"), @@ -3170,8 +2353,7 @@ module.exports = baseUnset; /*!******************************************!*\ !*** ./node_modules/lodash/_cacheHas.js ***! \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** * Checks if a `cache` value for `key` exists. @@ -3194,8 +2376,7 @@ module.exports = cacheHas; /*!******************************************!*\ !*** ./node_modules/lodash/_castPath.js ***! \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), isKey = __webpack_require__(/*! ./_isKey */ "./node_modules/lodash/_isKey.js"), @@ -3226,8 +2407,7 @@ module.exports = castPath; /*!**************************************************!*\ !*** ./node_modules/lodash/_cloneArrayBuffer.js ***! \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Uint8Array = __webpack_require__(/*! ./_Uint8Array */ "./node_modules/lodash/_Uint8Array.js"); @@ -3253,16 +2433,16 @@ module.exports = cloneArrayBuffer; /*!*********************************************!*\ !*** ./node_modules/lodash/_cloneBuffer.js ***! \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, exports, __webpack_require__) => { -/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); +/* module decorator */ module = __webpack_require__.nmd(module); +var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); /** Detect free variable `exports`. */ var freeExports = true && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; @@ -3292,7 +2472,6 @@ function cloneBuffer(buffer, isDeep) { module.exports = cloneBuffer; -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) /***/ }), @@ -3300,8 +2479,7 @@ module.exports = cloneBuffer; /*!***********************************************!*\ !*** ./node_modules/lodash/_cloneDataView.js ***! \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ "./node_modules/lodash/_cloneArrayBuffer.js"); @@ -3327,8 +2505,7 @@ module.exports = cloneDataView; /*!*********************************************!*\ !*** ./node_modules/lodash/_cloneRegExp.js ***! \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** Used to match `RegExp` flags from their coerced string values. */ var reFlags = /\w*$/; @@ -3355,8 +2532,7 @@ module.exports = cloneRegExp; /*!*********************************************!*\ !*** ./node_modules/lodash/_cloneSymbol.js ***! \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"); @@ -3384,8 +2560,7 @@ module.exports = cloneSymbol; /*!*************************************************!*\ !*** ./node_modules/lodash/_cloneTypedArray.js ***! \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ "./node_modules/lodash/_cloneArrayBuffer.js"); @@ -3411,8 +2586,7 @@ module.exports = cloneTypedArray; /*!*******************************************!*\ !*** ./node_modules/lodash/_copyArray.js ***! \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** * Copies the values of `source` to `array`. @@ -3442,8 +2616,7 @@ module.exports = copyArray; /*!********************************************!*\ !*** ./node_modules/lodash/_copyObject.js ***! \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/lodash/_assignValue.js"), baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "./node_modules/lodash/_baseAssignValue.js"); @@ -3493,8 +2666,7 @@ module.exports = copyObject; /*!*********************************************!*\ !*** ./node_modules/lodash/_copySymbols.js ***! \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"), getSymbols = __webpack_require__(/*! ./_getSymbols */ "./node_modules/lodash/_getSymbols.js"); @@ -3520,8 +2692,7 @@ module.exports = copySymbols; /*!***********************************************!*\ !*** ./node_modules/lodash/_copySymbolsIn.js ***! \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"), getSymbolsIn = __webpack_require__(/*! ./_getSymbolsIn */ "./node_modules/lodash/_getSymbolsIn.js"); @@ -3547,8 +2718,7 @@ module.exports = copySymbolsIn; /*!********************************************!*\ !*** ./node_modules/lodash/_coreJsData.js ***! \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); @@ -3558,14 +2728,123 @@ var coreJsData = root['__core-js_shared__']; module.exports = coreJsData; +/***/ }), + +/***/ "./node_modules/lodash/_createAggregator.js": +/*!**************************************************!*\ + !*** ./node_modules/lodash/_createAggregator.js ***! + \**************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var arrayAggregator = __webpack_require__(/*! ./_arrayAggregator */ "./node_modules/lodash/_arrayAggregator.js"), + baseAggregator = __webpack_require__(/*! ./_baseAggregator */ "./node_modules/lodash/_baseAggregator.js"), + baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/lodash/_baseIteratee.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"); + +/** + * Creates a function like `_.groupBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. + * @returns {Function} Returns the new aggregator function. + */ +function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; + + return func(collection, setter, baseIteratee(iteratee, 2), accumulator); + }; +} + +module.exports = createAggregator; + + +/***/ }), + +/***/ "./node_modules/lodash/_createBaseEach.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_createBaseEach.js ***! + \************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"); + +/** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; +} + +module.exports = createBaseEach; + + +/***/ }), + +/***/ "./node_modules/lodash/_createBaseFor.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_createBaseFor.js ***! + \***********************************************/ +/***/ ((module) => { + +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +module.exports = createBaseFor; + + /***/ }), /***/ "./node_modules/lodash/_createSet.js": /*!*******************************************!*\ !*** ./node_modules/lodash/_createSet.js ***! \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Set = __webpack_require__(/*! ./_Set */ "./node_modules/lodash/_Set.js"), noop = __webpack_require__(/*! ./noop */ "./node_modules/lodash/noop.js"), @@ -3594,8 +2873,7 @@ module.exports = createSet; /*!*************************************************!*\ !*** ./node_modules/lodash/_customOmitClone.js ***! \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isPlainObject = __webpack_require__(/*! ./isPlainObject */ "./node_modules/lodash/isPlainObject.js"); @@ -3621,8 +2899,7 @@ module.exports = customOmitClone; /*!************************************************!*\ !*** ./node_modules/lodash/_defineProperty.js ***! \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"); @@ -3639,83 +2916,395 @@ module.exports = defineProperty; /***/ }), -/***/ "./node_modules/lodash/_flatRest.js": -/*!******************************************!*\ - !*** ./node_modules/lodash/_flatRest.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/lodash/_equalArrays.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_equalArrays.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var flatten = __webpack_require__(/*! ./flatten */ "./node_modules/lodash/flatten.js"), - overRest = __webpack_require__(/*! ./_overRest */ "./node_modules/lodash/_overRest.js"), - setToString = __webpack_require__(/*! ./_setToString */ "./node_modules/lodash/_setToString.js"); +var SetCache = __webpack_require__(/*! ./_SetCache */ "./node_modules/lodash/_SetCache.js"), + arraySome = __webpack_require__(/*! ./_arraySome */ "./node_modules/lodash/_arraySome.js"), + cacheHas = __webpack_require__(/*! ./_cacheHas */ "./node_modules/lodash/_cacheHas.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; /** - * A specialized version of `baseRest` which flattens the rest array. + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. * * @private - * @param {Function} func The function to apply a rest parameter to. - * @returns {Function} Returns the new function. - */ -function flatRest(func) { - return setToString(overRest(func, undefined, flatten), func + ''); + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Check that cyclic values are equal. + var arrStacked = stack.get(array); + var othStacked = stack.get(other); + if (arrStacked && othStacked) { + return arrStacked == other && othStacked == array; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; } -module.exports = flatRest; +module.exports = equalArrays; /***/ }), -/***/ "./node_modules/lodash/_freeGlobal.js": +/***/ "./node_modules/lodash/_equalByTag.js": /*!********************************************!*\ - !*** ./node_modules/lodash/_freeGlobal.js ***! + !*** ./node_modules/lodash/_equalByTag.js ***! \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -module.exports = freeGlobal; +var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"), + Uint8Array = __webpack_require__(/*! ./_Uint8Array */ "./node_modules/lodash/_Uint8Array.js"), + eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js"), + equalArrays = __webpack_require__(/*! ./_equalArrays */ "./node_modules/lodash/_equalArrays.js"), + mapToArray = __webpack_require__(/*! ./_mapToArray */ "./node_modules/lodash/_mapToArray.js"), + setToArray = __webpack_require__(/*! ./_setToArray */ "./node_modules/lodash/_setToArray.js"); +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; -/***/ }), +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; -/***/ "./node_modules/lodash/_getAllKeys.js": -/*!********************************************!*\ - !*** ./node_modules/lodash/_getAllKeys.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]'; -var baseGetAllKeys = __webpack_require__(/*! ./_baseGetAllKeys */ "./node_modules/lodash/_baseGetAllKeys.js"), - getSymbols = __webpack_require__(/*! ./_getSymbols */ "./node_modules/lodash/_getSymbols.js"), - keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; /** - * Creates an array of own enumerable property names and symbols of `object`. + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. * * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ -function getAllKeys(object) { - return baseGetAllKeys(object, keys, getSymbols); + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; } -module.exports = getAllKeys; +module.exports = equalByTag; /***/ }), -/***/ "./node_modules/lodash/_getAllKeysIn.js": +/***/ "./node_modules/lodash/_equalObjects.js": /*!**********************************************!*\ - !*** ./node_modules/lodash/_getAllKeysIn.js ***! + !*** ./node_modules/lodash/_equalObjects.js ***! \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var baseGetAllKeys = __webpack_require__(/*! ./_baseGetAllKeys */ "./node_modules/lodash/_baseGetAllKeys.js"), +var getAllKeys = __webpack_require__(/*! ./_getAllKeys */ "./node_modules/lodash/_getAllKeys.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Check that cyclic values are equal. + var objStacked = stack.get(object); + var othStacked = stack.get(other); + if (objStacked && othStacked) { + return objStacked == other && othStacked == object; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +module.exports = equalObjects; + + +/***/ }), + +/***/ "./node_modules/lodash/_flatRest.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_flatRest.js ***! + \******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var flatten = __webpack_require__(/*! ./flatten */ "./node_modules/lodash/flatten.js"), + overRest = __webpack_require__(/*! ./_overRest */ "./node_modules/lodash/_overRest.js"), + setToString = __webpack_require__(/*! ./_setToString */ "./node_modules/lodash/_setToString.js"); + +/** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ +function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); +} + +module.exports = flatRest; + + +/***/ }), + +/***/ "./node_modules/lodash/_freeGlobal.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_freeGlobal.js ***! + \********************************************/ +/***/ ((module) => { + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +module.exports = freeGlobal; + + +/***/ }), + +/***/ "./node_modules/lodash/_getAllKeys.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_getAllKeys.js ***! + \********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseGetAllKeys = __webpack_require__(/*! ./_baseGetAllKeys */ "./node_modules/lodash/_baseGetAllKeys.js"), + getSymbols = __webpack_require__(/*! ./_getSymbols */ "./node_modules/lodash/_getSymbols.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +module.exports = getAllKeys; + + +/***/ }), + +/***/ "./node_modules/lodash/_getAllKeysIn.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_getAllKeysIn.js ***! + \**********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseGetAllKeys = __webpack_require__(/*! ./_baseGetAllKeys */ "./node_modules/lodash/_baseGetAllKeys.js"), getSymbolsIn = __webpack_require__(/*! ./_getSymbolsIn */ "./node_modules/lodash/_getSymbolsIn.js"), keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/lodash/keysIn.js"); @@ -3740,8 +3329,7 @@ module.exports = getAllKeysIn; /*!********************************************!*\ !*** ./node_modules/lodash/_getMapData.js ***! \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isKeyable = __webpack_require__(/*! ./_isKeyable */ "./node_modules/lodash/_isKeyable.js"); @@ -3763,14 +3351,47 @@ function getMapData(map, key) { module.exports = getMapData; +/***/ }), + +/***/ "./node_modules/lodash/_getMatchData.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_getMatchData.js ***! + \**********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isStrictComparable = __webpack_require__(/*! ./_isStrictComparable */ "./node_modules/lodash/_isStrictComparable.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ +function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; +} + +module.exports = getMatchData; + + /***/ }), /***/ "./node_modules/lodash/_getNative.js": /*!*******************************************!*\ !*** ./node_modules/lodash/_getNative.js ***! \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseIsNative = __webpack_require__(/*! ./_baseIsNative */ "./node_modules/lodash/_baseIsNative.js"), getValue = __webpack_require__(/*! ./_getValue */ "./node_modules/lodash/_getValue.js"); @@ -3797,8 +3418,7 @@ module.exports = getNative; /*!**********************************************!*\ !*** ./node_modules/lodash/_getPrototype.js ***! \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var overArg = __webpack_require__(/*! ./_overArg */ "./node_modules/lodash/_overArg.js"); @@ -3814,8 +3434,7 @@ module.exports = getPrototype; /*!*******************************************!*\ !*** ./node_modules/lodash/_getRawTag.js ***! \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"); @@ -3871,8 +3490,7 @@ module.exports = getRawTag; /*!********************************************!*\ !*** ./node_modules/lodash/_getSymbols.js ***! \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var arrayFilter = __webpack_require__(/*! ./_arrayFilter */ "./node_modules/lodash/_arrayFilter.js"), stubArray = __webpack_require__(/*! ./stubArray */ "./node_modules/lodash/stubArray.js"); @@ -3912,8 +3530,7 @@ module.exports = getSymbols; /*!**********************************************!*\ !*** ./node_modules/lodash/_getSymbolsIn.js ***! \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/lodash/_arrayPush.js"), getPrototype = __webpack_require__(/*! ./_getPrototype */ "./node_modules/lodash/_getPrototype.js"), @@ -3948,8 +3565,7 @@ module.exports = getSymbolsIn; /*!****************************************!*\ !*** ./node_modules/lodash/_getTag.js ***! \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var DataView = __webpack_require__(/*! ./_DataView */ "./node_modules/lodash/_DataView.js"), Map = __webpack_require__(/*! ./_Map */ "./node_modules/lodash/_Map.js"), @@ -4017,8 +3633,7 @@ module.exports = getTag; /*!******************************************!*\ !*** ./node_modules/lodash/_getValue.js ***! \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** * Gets the value at `key` of `object`. @@ -4035,14 +3650,62 @@ function getValue(object, key) { module.exports = getValue; +/***/ }), + +/***/ "./node_modules/lodash/_hasPath.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_hasPath.js ***! + \*****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/lodash/_castPath.js"), + isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isIndex = __webpack_require__(/*! ./_isIndex */ "./node_modules/lodash/_isIndex.js"), + isLength = __webpack_require__(/*! ./isLength */ "./node_modules/lodash/isLength.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"); + +/** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ +function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); +} + +module.exports = hasPath; + + /***/ }), /***/ "./node_modules/lodash/_hashClear.js": /*!*******************************************!*\ !*** ./node_modules/lodash/_hashClear.js ***! \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "./node_modules/lodash/_nativeCreate.js"); @@ -4067,8 +3730,7 @@ module.exports = hashClear; /*!********************************************!*\ !*** ./node_modules/lodash/_hashDelete.js ***! \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** * Removes `key` and its value from the hash. @@ -4095,8 +3757,7 @@ module.exports = hashDelete; /*!*****************************************!*\ !*** ./node_modules/lodash/_hashGet.js ***! \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "./node_modules/lodash/_nativeCreate.js"); @@ -4136,8 +3797,7 @@ module.exports = hashGet; /*!*****************************************!*\ !*** ./node_modules/lodash/_hashHas.js ***! \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "./node_modules/lodash/_nativeCreate.js"); @@ -4170,8 +3830,7 @@ module.exports = hashHas; /*!*****************************************!*\ !*** ./node_modules/lodash/_hashSet.js ***! \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "./node_modules/lodash/_nativeCreate.js"); @@ -4204,8 +3863,7 @@ module.exports = hashSet; /*!************************************************!*\ !*** ./node_modules/lodash/_initCloneArray.js ***! \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -4241,8 +3899,7 @@ module.exports = initCloneArray; /*!************************************************!*\ !*** ./node_modules/lodash/_initCloneByTag.js ***! \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ "./node_modules/lodash/_cloneArrayBuffer.js"), cloneDataView = __webpack_require__(/*! ./_cloneDataView */ "./node_modules/lodash/_cloneDataView.js"), @@ -4329,8 +3986,7 @@ module.exports = initCloneByTag; /*!*************************************************!*\ !*** ./node_modules/lodash/_initCloneObject.js ***! \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseCreate = __webpack_require__(/*! ./_baseCreate */ "./node_modules/lodash/_baseCreate.js"), getPrototype = __webpack_require__(/*! ./_getPrototype */ "./node_modules/lodash/_getPrototype.js"), @@ -4358,8 +4014,7 @@ module.exports = initCloneObject; /*!***********************************************!*\ !*** ./node_modules/lodash/_isFlattenable.js ***! \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"), isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"), @@ -4389,8 +4044,7 @@ module.exports = isFlattenable; /*!*****************************************!*\ !*** ./node_modules/lodash/_isIndex.js ***! \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; @@ -4425,8 +4079,7 @@ module.exports = isIndex; /*!***************************************!*\ !*** ./node_modules/lodash/_isKey.js ***! \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js"); @@ -4465,8 +4118,7 @@ module.exports = isKey; /*!*******************************************!*\ !*** ./node_modules/lodash/_isKeyable.js ***! \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** * Checks if `value` is suitable for use as unique object key. @@ -4491,8 +4143,7 @@ module.exports = isKeyable; /*!******************************************!*\ !*** ./node_modules/lodash/_isMasked.js ***! \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var coreJsData = __webpack_require__(/*! ./_coreJsData */ "./node_modules/lodash/_coreJsData.js"); @@ -4522,8 +4173,7 @@ module.exports = isMasked; /*!*********************************************!*\ !*** ./node_modules/lodash/_isPrototype.js ***! \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -4545,14 +4195,38 @@ function isPrototype(value) { module.exports = isPrototype; +/***/ }), + +/***/ "./node_modules/lodash/_isStrictComparable.js": +/*!****************************************************!*\ + !*** ./node_modules/lodash/_isStrictComparable.js ***! + \****************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"); + +/** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ +function isStrictComparable(value) { + return value === value && !isObject(value); +} + +module.exports = isStrictComparable; + + /***/ }), /***/ "./node_modules/lodash/_listCacheClear.js": /*!************************************************!*\ !*** ./node_modules/lodash/_listCacheClear.js ***! \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** * Removes all key-value entries from the list cache. @@ -4575,8 +4249,7 @@ module.exports = listCacheClear; /*!*************************************************!*\ !*** ./node_modules/lodash/_listCacheDelete.js ***! \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "./node_modules/lodash/_assocIndexOf.js"); @@ -4621,8 +4294,7 @@ module.exports = listCacheDelete; /*!**********************************************!*\ !*** ./node_modules/lodash/_listCacheGet.js ***! \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "./node_modules/lodash/_assocIndexOf.js"); @@ -4651,8 +4323,7 @@ module.exports = listCacheGet; /*!**********************************************!*\ !*** ./node_modules/lodash/_listCacheHas.js ***! \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "./node_modules/lodash/_assocIndexOf.js"); @@ -4678,8 +4349,7 @@ module.exports = listCacheHas; /*!**********************************************!*\ !*** ./node_modules/lodash/_listCacheSet.js ***! \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "./node_modules/lodash/_assocIndexOf.js"); @@ -4715,8 +4385,7 @@ module.exports = listCacheSet; /*!***********************************************!*\ !*** ./node_modules/lodash/_mapCacheClear.js ***! \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Hash = __webpack_require__(/*! ./_Hash */ "./node_modules/lodash/_Hash.js"), ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/lodash/_ListCache.js"), @@ -4747,8 +4416,7 @@ module.exports = mapCacheClear; /*!************************************************!*\ !*** ./node_modules/lodash/_mapCacheDelete.js ***! \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var getMapData = __webpack_require__(/*! ./_getMapData */ "./node_modules/lodash/_getMapData.js"); @@ -4776,8 +4444,7 @@ module.exports = mapCacheDelete; /*!*********************************************!*\ !*** ./node_modules/lodash/_mapCacheGet.js ***! \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var getMapData = __webpack_require__(/*! ./_getMapData */ "./node_modules/lodash/_getMapData.js"); @@ -4803,8 +4470,7 @@ module.exports = mapCacheGet; /*!*********************************************!*\ !*** ./node_modules/lodash/_mapCacheHas.js ***! \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var getMapData = __webpack_require__(/*! ./_getMapData */ "./node_modules/lodash/_getMapData.js"); @@ -4830,8 +4496,7 @@ module.exports = mapCacheHas; /*!*********************************************!*\ !*** ./node_modules/lodash/_mapCacheSet.js ***! \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var getMapData = __webpack_require__(/*! ./_getMapData */ "./node_modules/lodash/_getMapData.js"); @@ -4857,14 +4522,71 @@ function mapCacheSet(key, value) { module.exports = mapCacheSet; +/***/ }), + +/***/ "./node_modules/lodash/_mapToArray.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_mapToArray.js ***! + \********************************************/ +/***/ ((module) => { + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +module.exports = mapToArray; + + +/***/ }), + +/***/ "./node_modules/lodash/_matchesStrictComparable.js": +/*!*********************************************************!*\ + !*** ./node_modules/lodash/_matchesStrictComparable.js ***! + \*********************************************************/ +/***/ ((module) => { + +/** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; +} + +module.exports = matchesStrictComparable; + + /***/ }), /***/ "./node_modules/lodash/_memoizeCapped.js": /*!***********************************************!*\ !*** ./node_modules/lodash/_memoizeCapped.js ***! \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var memoize = __webpack_require__(/*! ./memoize */ "./node_modules/lodash/memoize.js"); @@ -4900,8 +4622,7 @@ module.exports = memoizeCapped; /*!**********************************************!*\ !*** ./node_modules/lodash/_nativeCreate.js ***! \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"); @@ -4917,8 +4638,7 @@ module.exports = nativeCreate; /*!********************************************!*\ !*** ./node_modules/lodash/_nativeKeys.js ***! \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var overArg = __webpack_require__(/*! ./_overArg */ "./node_modules/lodash/_overArg.js"); @@ -4934,8 +4654,7 @@ module.exports = nativeKeys; /*!**********************************************!*\ !*** ./node_modules/lodash/_nativeKeysIn.js ***! \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** * This function is like @@ -4965,16 +4684,16 @@ module.exports = nativeKeysIn; /*!******************************************!*\ !*** ./node_modules/lodash/_nodeUtil.js ***! \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, exports, __webpack_require__) => { -/* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/lodash/_freeGlobal.js"); +/* module decorator */ module = __webpack_require__.nmd(module); +var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/lodash/_freeGlobal.js"); /** Detect free variable `exports`. */ var freeExports = true && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; @@ -4999,7 +4718,6 @@ var nodeUtil = (function() { module.exports = nodeUtil; -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) /***/ }), @@ -5007,8 +4725,7 @@ module.exports = nodeUtil; /*!************************************************!*\ !*** ./node_modules/lodash/_objectToString.js ***! \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -5040,8 +4757,7 @@ module.exports = objectToString; /*!*****************************************!*\ !*** ./node_modules/lodash/_overArg.js ***! \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** * Creates a unary function that invokes `func` with its argument transformed. @@ -5066,8 +4782,7 @@ module.exports = overArg; /*!******************************************!*\ !*** ./node_modules/lodash/_overRest.js ***! \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var apply = __webpack_require__(/*! ./_apply */ "./node_modules/lodash/_apply.js"); @@ -5113,8 +4828,7 @@ module.exports = overRest; /*!****************************************!*\ !*** ./node_modules/lodash/_parent.js ***! \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseGet = __webpack_require__(/*! ./_baseGet */ "./node_modules/lodash/_baseGet.js"), baseSlice = __webpack_require__(/*! ./_baseSlice */ "./node_modules/lodash/_baseSlice.js"); @@ -5140,8 +4854,7 @@ module.exports = parent; /*!**************************************!*\ !*** ./node_modules/lodash/_root.js ***! \**************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/lodash/_freeGlobal.js"); @@ -5160,8 +4873,7 @@ module.exports = root; /*!*********************************************!*\ !*** ./node_modules/lodash/_setCacheAdd.js ***! \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; @@ -5190,8 +4902,7 @@ module.exports = setCacheAdd; /*!*********************************************!*\ !*** ./node_modules/lodash/_setCacheHas.js ***! \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** * Checks if `value` is in the array cache. @@ -5215,8 +4926,7 @@ module.exports = setCacheHas; /*!********************************************!*\ !*** ./node_modules/lodash/_setToArray.js ***! \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** * Converts `set` to an array of its values. @@ -5244,8 +4954,7 @@ module.exports = setToArray; /*!*********************************************!*\ !*** ./node_modules/lodash/_setToString.js ***! \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseSetToString = __webpack_require__(/*! ./_baseSetToString */ "./node_modules/lodash/_baseSetToString.js"), shortOut = __webpack_require__(/*! ./_shortOut */ "./node_modules/lodash/_shortOut.js"); @@ -5269,8 +4978,7 @@ module.exports = setToString; /*!******************************************!*\ !*** ./node_modules/lodash/_shortOut.js ***! \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** Used to detect hot functions by number of calls within a span of milliseconds. */ var HOT_COUNT = 800, @@ -5317,8 +5025,7 @@ module.exports = shortOut; /*!********************************************!*\ !*** ./node_modules/lodash/_stackClear.js ***! \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/lodash/_ListCache.js"); @@ -5343,8 +5050,7 @@ module.exports = stackClear; /*!*********************************************!*\ !*** ./node_modules/lodash/_stackDelete.js ***! \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** * Removes `key` and its value from the stack. @@ -5372,8 +5078,7 @@ module.exports = stackDelete; /*!******************************************!*\ !*** ./node_modules/lodash/_stackGet.js ***! \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** * Gets the stack value for `key`. @@ -5397,8 +5102,7 @@ module.exports = stackGet; /*!******************************************!*\ !*** ./node_modules/lodash/_stackHas.js ***! \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** * Checks if a stack value for `key` exists. @@ -5422,8 +5126,7 @@ module.exports = stackHas; /*!******************************************!*\ !*** ./node_modules/lodash/_stackSet.js ***! \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/lodash/_ListCache.js"), Map = __webpack_require__(/*! ./_Map */ "./node_modules/lodash/_Map.js"), @@ -5467,8 +5170,7 @@ module.exports = stackSet; /*!***********************************************!*\ !*** ./node_modules/lodash/_strictIndexOf.js ***! \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** * A specialized version of `_.indexOf` which performs strict equality @@ -5501,8 +5203,7 @@ module.exports = strictIndexOf; /*!**********************************************!*\ !*** ./node_modules/lodash/_stringToPath.js ***! \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var memoizeCapped = __webpack_require__(/*! ./_memoizeCapped */ "./node_modules/lodash/_memoizeCapped.js"); @@ -5539,8 +5240,7 @@ module.exports = stringToPath; /*!***************************************!*\ !*** ./node_modules/lodash/_toKey.js ***! \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js"); @@ -5571,8 +5271,7 @@ module.exports = toKey; /*!******************************************!*\ !*** ./node_modules/lodash/_toSource.js ***! \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** Used for built-in method references. */ var funcProto = Function.prototype; @@ -5608,8 +5307,7 @@ module.exports = toSource; /*!*****************************************!*\ !*** ./node_modules/lodash/constant.js ***! \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** * Creates a function that returns `value`. @@ -5645,8 +5343,7 @@ module.exports = constant; /*!***********************************!*\ !*** ./node_modules/lodash/eq.js ***! \***********************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** * Performs a @@ -5693,8 +5390,7 @@ module.exports = eq; /*!****************************************!*\ !*** ./node_modules/lodash/flatten.js ***! \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/lodash/_baseFlatten.js"); @@ -5722,47 +5418,57 @@ module.exports = flatten; /***/ }), -/***/ "./node_modules/lodash/identity.js": -/*!*****************************************!*\ - !*** ./node_modules/lodash/identity.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/lodash/get.js": +/*!************************************!*\ + !*** ./node_modules/lodash/get.js ***! + \************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseGet = __webpack_require__(/*! ./_baseGet */ "./node_modules/lodash/_baseGet.js"); /** - * This method returns the first argument it receives. + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. * * @static - * @since 0.1.0 * @memberOf _ - * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. * @example * - * var object = { 'a': 1 }; + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * - * console.log(_.identity(object) === object); - * // => true + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' */ -function identity(value) { - return value; +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; } -module.exports = identity; +module.exports = get; /***/ }), -/***/ "./node_modules/lodash/isArguments.js": -/*!********************************************!*\ - !*** ./node_modules/lodash/isArguments.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/lodash/groupBy.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/groupBy.js ***! + \****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var baseIsArguments = __webpack_require__(/*! ./_baseIsArguments */ "./node_modules/lodash/_baseIsArguments.js"), - isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); +var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "./node_modules/lodash/_baseAssignValue.js"), + createAggregator = __webpack_require__(/*! ./_createAggregator */ "./node_modules/lodash/_createAggregator.js"); /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -5770,43 +5476,168 @@ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; -/** Built-in value references. */ -var propertyIsEnumerable = objectProto.propertyIsEnumerable; - /** - * Checks if `value` is likely an `arguments` object. + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. * @example * - * _.isArguments(function() { return arguments; }()); - * // => true + * _.groupBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': [4.2], '6': [6.1, 6.3] } * - * _.isArguments([1, 2, 3]); - * // => false + * // The `_.property` iteratee shorthand. + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } */ -var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { - return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && - !propertyIsEnumerable.call(value, 'callee'); -}; +var groupBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + baseAssignValue(result, key, [value]); + } +}); -module.exports = isArguments; +module.exports = groupBy; /***/ }), -/***/ "./node_modules/lodash/isArray.js": -/*!****************************************!*\ - !*** ./node_modules/lodash/isArray.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/lodash/hasIn.js": +/*!**************************************!*\ + !*** ./node_modules/lodash/hasIn.js ***! + \**************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseHasIn = __webpack_require__(/*! ./_baseHasIn */ "./node_modules/lodash/_baseHasIn.js"), + hasPath = __webpack_require__(/*! ./_hasPath */ "./node_modules/lodash/_hasPath.js"); + +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); +} + +module.exports = hasIn; + + +/***/ }), + +/***/ "./node_modules/lodash/identity.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/identity.js ***! + \*****************************************/ +/***/ ((module) => { + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +module.exports = identity; + + +/***/ }), + +/***/ "./node_modules/lodash/isArguments.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/isArguments.js ***! + \********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseIsArguments = __webpack_require__(/*! ./_baseIsArguments */ "./node_modules/lodash/_baseIsArguments.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +module.exports = isArguments; + + +/***/ }), + +/***/ "./node_modules/lodash/isArray.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/isArray.js ***! + \****************************************/ +/***/ ((module) => { /** * Checks if `value` is classified as an `Array` object. @@ -5842,8 +5673,7 @@ module.exports = isArray; /*!********************************************!*\ !*** ./node_modules/lodash/isArrayLike.js ***! \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isFunction = __webpack_require__(/*! ./isFunction */ "./node_modules/lodash/isFunction.js"), isLength = __webpack_require__(/*! ./isLength */ "./node_modules/lodash/isLength.js"); @@ -5886,17 +5716,17 @@ module.exports = isArrayLike; /*!*****************************************!*\ !*** ./node_modules/lodash/isBuffer.js ***! \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, exports, __webpack_require__) => { -/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"), +/* module decorator */ module = __webpack_require__.nmd(module); +var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"), stubFalse = __webpack_require__(/*! ./stubFalse */ "./node_modules/lodash/stubFalse.js"); /** Detect free variable `exports`. */ var freeExports = true && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; @@ -5928,7 +5758,6 @@ var isBuffer = nativeIsBuffer || stubFalse; module.exports = isBuffer; -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) /***/ }), @@ -5936,8 +5765,7 @@ module.exports = isBuffer; /*!*******************************************!*\ !*** ./node_modules/lodash/isFunction.js ***! \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"); @@ -5984,8 +5812,7 @@ module.exports = isFunction; /*!*****************************************!*\ !*** ./node_modules/lodash/isLength.js ***! \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; @@ -6030,8 +5857,7 @@ module.exports = isLength; /*!**************************************!*\ !*** ./node_modules/lodash/isMap.js ***! \**************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseIsMap = __webpack_require__(/*! ./_baseIsMap */ "./node_modules/lodash/_baseIsMap.js"), baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"), @@ -6068,8 +5894,7 @@ module.exports = isMap; /*!*****************************************!*\ !*** ./node_modules/lodash/isObject.js ***! \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** * Checks if `value` is the @@ -6110,8 +5935,7 @@ module.exports = isObject; /*!*********************************************!*\ !*** ./node_modules/lodash/isObjectLike.js ***! \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** * Checks if `value` is object-like. A value is object-like if it's not `null` @@ -6150,8 +5974,7 @@ module.exports = isObjectLike; /*!**********************************************!*\ !*** ./node_modules/lodash/isPlainObject.js ***! \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), getPrototype = __webpack_require__(/*! ./_getPrototype */ "./node_modules/lodash/_getPrototype.js"), @@ -6223,8 +6046,7 @@ module.exports = isPlainObject; /*!**************************************!*\ !*** ./node_modules/lodash/isSet.js ***! \**************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseIsSet = __webpack_require__(/*! ./_baseIsSet */ "./node_modules/lodash/_baseIsSet.js"), baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"), @@ -6261,8 +6083,7 @@ module.exports = isSet; /*!*****************************************!*\ !*** ./node_modules/lodash/isSymbol.js ***! \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); @@ -6301,8 +6122,7 @@ module.exports = isSymbol; /*!*********************************************!*\ !*** ./node_modules/lodash/isTypedArray.js ***! \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseIsTypedArray = __webpack_require__(/*! ./_baseIsTypedArray */ "./node_modules/lodash/_baseIsTypedArray.js"), baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"), @@ -6339,8 +6159,7 @@ module.exports = isTypedArray; /*!*************************************!*\ !*** ./node_modules/lodash/keys.js ***! \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ "./node_modules/lodash/_arrayLikeKeys.js"), baseKeys = __webpack_require__(/*! ./_baseKeys */ "./node_modules/lodash/_baseKeys.js"), @@ -6387,8 +6206,7 @@ module.exports = keys; /*!***************************************!*\ !*** ./node_modules/lodash/keysIn.js ***! \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ "./node_modules/lodash/_arrayLikeKeys.js"), baseKeysIn = __webpack_require__(/*! ./_baseKeysIn */ "./node_modules/lodash/_baseKeysIn.js"), @@ -6430,8 +6248,7 @@ module.exports = keysIn; /*!*************************************!*\ !*** ./node_modules/lodash/last.js ***! \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** * Gets the last element of `array`. @@ -6455,14 +6272,66 @@ function last(array) { module.exports = last; +/***/ }), + +/***/ "./node_modules/lodash/mapValues.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/mapValues.js ***! + \******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "./node_modules/lodash/_baseAssignValue.js"), + baseForOwn = __webpack_require__(/*! ./_baseForOwn */ "./node_modules/lodash/_baseForOwn.js"), + baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/lodash/_baseIteratee.js"); + +/** + * Creates an object with the same keys as `object` and values generated + * by running each own enumerable string keyed property of `object` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, key, object). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapKeys + * @example + * + * var users = { + * 'fred': { 'user': 'fred', 'age': 40 }, + * 'pebbles': { 'user': 'pebbles', 'age': 1 } + * }; + * + * _.mapValues(users, function(o) { return o.age; }); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + * + * // The `_.property` iteratee shorthand. + * _.mapValues(users, 'age'); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + */ +function mapValues(object, iteratee) { + var result = {}; + iteratee = baseIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, key, iteratee(value, key, object)); + }); + return result; +} + +module.exports = mapValues; + + /***/ }), /***/ "./node_modules/lodash/memoize.js": /*!****************************************!*\ !*** ./node_modules/lodash/memoize.js ***! \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var MapCache = __webpack_require__(/*! ./_MapCache */ "./node_modules/lodash/_MapCache.js"); @@ -6545,8 +6414,7 @@ module.exports = memoize; /*!*************************************!*\ !*** ./node_modules/lodash/noop.js ***! \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** * This method returns `undefined`. @@ -6573,8 +6441,7 @@ module.exports = noop; /*!*************************************!*\ !*** ./node_modules/lodash/omit.js ***! \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), baseClone = __webpack_require__(/*! ./_baseClone */ "./node_modules/lodash/_baseClone.js"), @@ -6635,14 +6502,55 @@ var omit = flatRest(function(object, paths) { module.exports = omit; +/***/ }), + +/***/ "./node_modules/lodash/property.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/property.js ***! + \*****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseProperty = __webpack_require__(/*! ./_baseProperty */ "./node_modules/lodash/_baseProperty.js"), + basePropertyDeep = __webpack_require__(/*! ./_basePropertyDeep */ "./node_modules/lodash/_basePropertyDeep.js"), + isKey = __webpack_require__(/*! ./_isKey */ "./node_modules/lodash/_isKey.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"); + +/** + * Creates a function that returns the value at `path` of a given object. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + * @example + * + * var objects = [ + * { 'a': { 'b': 2 } }, + * { 'a': { 'b': 1 } } + * ]; + * + * _.map(objects, _.property('a.b')); + * // => [2, 1] + * + * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); + * // => [1, 2] + */ +function property(path) { + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); +} + +module.exports = property; + + /***/ }), /***/ "./node_modules/lodash/stubArray.js": /*!******************************************!*\ !*** ./node_modules/lodash/stubArray.js ***! \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** * This method returns a new empty array. @@ -6675,8 +6583,7 @@ module.exports = stubArray; /*!******************************************!*\ !*** ./node_modules/lodash/stubFalse.js ***! \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { /** * This method returns `false`. @@ -6704,8 +6611,7 @@ module.exports = stubFalse; /*!*****************************************!*\ !*** ./node_modules/lodash/toString.js ***! \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseToString = __webpack_require__(/*! ./_baseToString */ "./node_modules/lodash/_baseToString.js"); @@ -6743,8 +6649,7 @@ module.exports = toString; /*!*************************************!*\ !*** ./node_modules/lodash/uniq.js ***! \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseUniq = __webpack_require__(/*! ./_baseUniq */ "./node_modules/lodash/_baseUniq.js"); @@ -6779,8 +6684,7 @@ module.exports = uniq; /*!***************************************************!*\ !*** ./node_modules/semver/classes/comparator.js ***! \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { const ANY = Symbol('SemVer ANY') // hoisted class for cyclic dependency @@ -6929,8 +6833,7 @@ const Range = __webpack_require__(/*! ./range */ "./node_modules/semver/classes/ /*!**********************************************!*\ !*** ./node_modules/semver/classes/range.js ***! \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { // hoisted class for cyclic dependency class Range { @@ -7403,8 +7306,7 @@ const testSet = (set, version, options) => { /*!***********************************************!*\ !*** ./node_modules/semver/classes/semver.js ***! \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { const debug = __webpack_require__(/*! ../internal/debug */ "./node_modules/semver/internal/debug.js") const { MAX_LENGTH, MAX_SAFE_INTEGER } = __webpack_require__(/*! ../internal/constants */ "./node_modules/semver/internal/constants.js") @@ -7704,8 +7606,7 @@ module.exports = SemVer /*!**********************************************!*\ !*** ./node_modules/semver/functions/cmp.js ***! \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { const eq = __webpack_require__(/*! ./eq */ "./node_modules/semver/functions/eq.js") const neq = __webpack_require__(/*! ./neq */ "./node_modules/semver/functions/neq.js") @@ -7763,8 +7664,7 @@ module.exports = cmp /*!*************************************************!*\ !*** ./node_modules/semver/functions/coerce.js ***! \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(/*! ../classes/semver */ "./node_modules/semver/classes/semver.js") const parse = __webpack_require__(/*! ./parse */ "./node_modules/semver/functions/parse.js") @@ -7825,8 +7725,7 @@ module.exports = coerce /*!**************************************************!*\ !*** ./node_modules/semver/functions/compare.js ***! \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(/*! ../classes/semver */ "./node_modules/semver/classes/semver.js") const compare = (a, b, loose) => @@ -7841,8 +7740,7 @@ module.exports = compare /*!*********************************************!*\ !*** ./node_modules/semver/functions/eq.js ***! \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(/*! ./compare */ "./node_modules/semver/functions/compare.js") const eq = (a, b, loose) => compare(a, b, loose) === 0 @@ -7855,8 +7753,7 @@ module.exports = eq /*!*********************************************!*\ !*** ./node_modules/semver/functions/gt.js ***! \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(/*! ./compare */ "./node_modules/semver/functions/compare.js") const gt = (a, b, loose) => compare(a, b, loose) > 0 @@ -7869,8 +7766,7 @@ module.exports = gt /*!**********************************************!*\ !*** ./node_modules/semver/functions/gte.js ***! \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(/*! ./compare */ "./node_modules/semver/functions/compare.js") const gte = (a, b, loose) => compare(a, b, loose) >= 0 @@ -7883,8 +7779,7 @@ module.exports = gte /*!*********************************************!*\ !*** ./node_modules/semver/functions/lt.js ***! \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(/*! ./compare */ "./node_modules/semver/functions/compare.js") const lt = (a, b, loose) => compare(a, b, loose) < 0 @@ -7897,8 +7792,7 @@ module.exports = lt /*!**********************************************!*\ !*** ./node_modules/semver/functions/lte.js ***! \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(/*! ./compare */ "./node_modules/semver/functions/compare.js") const lte = (a, b, loose) => compare(a, b, loose) <= 0 @@ -7911,8 +7805,7 @@ module.exports = lte /*!**********************************************!*\ !*** ./node_modules/semver/functions/neq.js ***! \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(/*! ./compare */ "./node_modules/semver/functions/compare.js") const neq = (a, b, loose) => compare(a, b, loose) !== 0 @@ -7925,8 +7818,7 @@ module.exports = neq /*!************************************************!*\ !*** ./node_modules/semver/functions/parse.js ***! \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { const {MAX_LENGTH} = __webpack_require__(/*! ../internal/constants */ "./node_modules/semver/internal/constants.js") const { re, t } = __webpack_require__(/*! ../internal/re */ "./node_modules/semver/internal/re.js") @@ -7973,8 +7865,7 @@ module.exports = parse /*!****************************************************!*\ !*** ./node_modules/semver/functions/satisfies.js ***! \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Range = __webpack_require__(/*! ../classes/range */ "./node_modules/semver/classes/range.js") const satisfies = (version, range, options) => { @@ -7994,8 +7885,7 @@ module.exports = satisfies /*!***************************************************!*\ !*** ./node_modules/semver/internal/constants.js ***! \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { // Note: this is the semver.org version of the spec that it implements // Not necessarily the package version of this code. @@ -8022,8 +7912,7 @@ module.exports = { /*!***********************************************!*\ !*** ./node_modules/semver/internal/debug.js ***! \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { const debug = ( typeof process === 'object' && @@ -8042,8 +7931,7 @@ module.exports = debug /*!*****************************************************!*\ !*** ./node_modules/semver/internal/identifiers.js ***! \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ ((module) => { const numeric = /^[0-9]+$/ const compareIdentifiers = (a, b) => { @@ -8076,8 +7964,7 @@ module.exports = { /*!********************************************!*\ !*** ./node_modules/semver/internal/re.js ***! \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ ((module, exports, __webpack_require__) => { const { MAX_SAFE_COMPONENT_LENGTH } = __webpack_require__(/*! ./constants */ "./node_modules/semver/internal/constants.js") const debug = __webpack_require__(/*! ./debug */ "./node_modules/semver/internal/debug.js") @@ -8251,180 +8138,1491 @@ createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + `(${src[t.XRANGEPLAIN]})` + `\\s*$`) -createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + - `\\s+-\\s+` + - `(${src[t.XRANGEPLAINLOOSE]})` + - `\\s*$`) +createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAINLOOSE]})` + + `\\s*$`) + +// Star ranges basically just allow anything at all. +createToken('STAR', '(<|>)?=?\\s*\\*') +// >=0.0.0 is like a star +createToken('GTE0', '^\\s*>=\\s*0\.0\.0\\s*$') +createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$') + + +/***/ }), + +/***/ "./animationUi.ts": +/*!************************!*\ + !*** ./animationUi.ts ***! + \************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ displayAnimationFrameCallback: () => (/* binding */ displayAnimationFrameCallback), +/* harmony export */ loadAnimationUI: () => (/* binding */ loadAnimationUI), +/* harmony export */ unloadAnimationUI: () => (/* binding */ unloadAnimationUI), +/* harmony export */ updateKeyframeEasing: () => (/* binding */ updateKeyframeEasing), +/* harmony export */ updateKeyframeEasingArg: () => (/* binding */ updateKeyframeEasingArg), +/* harmony export */ updateKeyframeSelectionCallback: () => (/* binding */ updateKeyframeSelectionCallback) +/* harmony export */ }); +/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/uniq */ "./node_modules/lodash/uniq.js"); +/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./utils.ts"); +/* harmony import */ var _easing__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./easing */ "./easing.ts"); + + + +const easingRegExp = /^ease(InOut|In|Out)?([\w]+)$/; +const loadAnimationUI = () => { + Blockbench.on('display_animation_frame', displayAnimationFrameCallback); + Blockbench.on('update_keyframe_selection', updateKeyframeSelectionCallback); + (0,_utils__WEBPACK_IMPORTED_MODULE_1__.addMonkeypatch)(window, null, "updateKeyframeEasing", updateKeyframeEasing); + (0,_utils__WEBPACK_IMPORTED_MODULE_1__.addMonkeypatch)(window, null, "updateKeyframeEasingArg", updateKeyframeEasingArg); + (0,_utils__WEBPACK_IMPORTED_MODULE_1__.addMonkeypatch)(BarItems.keyframe_interpolation, null, 'condition', () => Format.id !== "animated_entity_model" && _utils__WEBPACK_IMPORTED_MODULE_1__.Original.get(BarItems.keyframe_interpolation).condition()); +}; +const unloadAnimationUI = () => { + Blockbench.removeListener('display_animation_frame', displayAnimationFrameCallback); + Blockbench.removeListener('update_keyframe_selection', updateKeyframeSelectionCallback); +}; +//#region Global Animation UI Handlers +const displayAnimationFrameCallback = ( /*...args*/) => { + // const keyframe = $('#keyframe'); + // console.log('displayAnimationFrameCallback:', args, 'keyframe:', keyframe); // keyframe is null here +}; +function updateKeyframeEasing(value) { + Undo.initEdit({ keyframes: Timeline.selected }); + // var axis = $(obj).attr('axis'); + // const value = $(obj).val(); + // console.log('updateKeyframeEasing value:', value, 'obj:', obj); + if (value === "-") + return; + Timeline.selected.forEach((kf) => { + kf.easing = value; + }); + window.updateKeyframeSelection(); // Ensure easingArg display is updated + // Animator.preview(); + Undo.finishEdit('edit keyframe easing'); +} +function updateKeyframeEasingArg(obj) { + Undo.initEdit({ keyframes: Timeline.selected }); + if ($(obj).val() === "-") + return; + // console.log('updateKeyframeEasingArg value:', $(obj).val(), 'obj:', obj); + Timeline.selected.forEach((kf) => { + const value = (0,_easing__WEBPACK_IMPORTED_MODULE_2__.parseEasingArg)(kf, $(obj).val().trim()); + kf.easingArgs = [value]; + // obj.value = value; + }); + Undo.finishEdit('edit keyframe easing argument'); +} +const updateKeyframeSelectionCallback = ( /*...args*/) => { + $('#keyframe_bar_easing').remove(); + $('#keyframe_bar_easing_type').remove(); + $('#keyframe_bar_easing_arg1').remove(); + const addPrePostButton = document.querySelector('#keyframe_type_label > div'); + if (addPrePostButton) + addPrePostButton.hidden = Format.id === "animated_entity_model"; + let multi_channel = false; //eslint-disable-line @typescript-eslint/no-unused-vars + let channel = false; + Timeline.selected.forEach((kf) => { + if (channel === false) { + channel = kf.channel; + } + else if (channel !== kf.channel) { + multi_channel = true; + } + }); + const getMultiSelectValue = (selector, defaultValue, conflictValue) => { + const selectorFunction = typeof selector === 'function' + ? selector + : x => (x[selector] === undefined ? defaultValue : x[selector]); + if (Timeline.selected.length > 1) { + const uniqSelected = lodash_uniq__WEBPACK_IMPORTED_MODULE_0___default()(Timeline.selected.map(selectorFunction)); + if (uniqSelected.length === 1) { + return uniqSelected[0]; + } + else { + return conflictValue; + } + } + else { + return selectorFunction(Timeline.selected[0]) || defaultValue; + } + }; + const keyframesByChannel = Timeline.keyframes.reduce((acc, kf) => { + // Dear god I miss lodash + if (!acc.has(kf.animator)) + acc.set(kf.animator, {}); + const animatorChannels = acc.get(kf.animator); + if (!animatorChannels[kf.channel]) + animatorChannels[kf.channel] = []; + animatorChannels[kf.channel].push(kf); + animatorChannels[kf.channel].sort((a, b) => { + if (a.time < b.time) + return -1; + if (a.time > b.time) + return 1; + return 0; + }); + return acc; + }, new Map()); + const isFirstInChannel = (kf) => keyframesByChannel.get(kf.animator)[kf.channel].indexOf(kf) < 1; + if (Timeline.selected.length && Format.id === "animated_entity_model") { + if (Timeline.selected.every(kf => kf.animator instanceof BoneAnimator && !isFirstInChannel(kf))) { + const displayedEasing = getMultiSelectValue('easing', _easing__WEBPACK_IMPORTED_MODULE_2__.EASING_DEFAULT, 'null'); + const convertEasingTypeToId = (easing, easingType, inputEasingOrType) => { + const easingTypeToTypeId = type => { + let finalEasingType = "In"; + if (type === "out") { + finalEasingType = "Out"; + } + else if (type === "inout") { + finalEasingType = "InOut"; + } + return finalEasingType; + }; + let finalEasing = 'ease'; + if (inputEasingOrType === "in" || inputEasingOrType === "out" || inputEasingOrType === "inout") { + const finalEasingType = easingTypeToTypeId(inputEasingOrType); + finalEasing += finalEasingType + easing.substring(0, 1).toUpperCase() + easing.substring(1); + } + else if (inputEasingOrType === "linear" || inputEasingOrType == "step") { + finalEasing = inputEasingOrType; + } + else { + const finalEasingType = easingTypeToTypeId(easingType); + finalEasing += finalEasingType + inputEasingOrType.substring(0, 1).toUpperCase() + inputEasingOrType.substring(1); + } + return finalEasing; + }; + const addEasingTypeIcons = (bar, easingType, title) => { + const div = document.createElement("div"); + div.innerHTML = getIcon(easingType); + div.id = "kf_easing_type_" + easingType; + div.setAttribute("style", "stroke:var(--color-text);margin:0px;padding:3px;width:30px;height:30px"); + div.setAttribute("title", title); + div.onclick = () => { + const selectedEasing = $(".selected_kf_easing"); + const selectedEasingType = $(".selected_kf_easing_type"); + const keySelectedEasing = selectedEasing.attr("id").substring(15); + const keySelectedEasingType = selectedEasingType.length <= 0 ? "in" : selectedEasingType.attr("id").substring(15); + const currentEasing = convertEasingTypeToId(keySelectedEasing, keySelectedEasingType, keySelectedEasing); + const finalEasing = convertEasingTypeToId(keySelectedEasing, keySelectedEasingType, easingType); + if (finalEasing != currentEasing) { + // console.log("Changed from " + currentEasing + " to " + finalEasing); + updateKeyframeEasing(finalEasing); + } + }; + bar.appendChild(div); + }; + const keyframe = document.getElementById('panel_keyframe'); + let easingBar = document.createElement('div'); + keyframe.appendChild(easingBar); + easingBar.outerHTML = `
+ +
`; + easingBar = document.getElementById('keyframe_bar_easing'); + addEasingTypeIcons(easingBar, "linear", "Switch to Linear easing"); + addEasingTypeIcons(easingBar, "step", "Switch to Step easing"); + addEasingTypeIcons(easingBar, "sine", "Switch to Sine easing"); + addEasingTypeIcons(easingBar, "quad", "Switch to Quadratic easing"); + addEasingTypeIcons(easingBar, "cubic", "Switch to Cubic easing"); + addEasingTypeIcons(easingBar, "quart", "Switch to Quartic easing"); + addEasingTypeIcons(easingBar, "quint", "Switch to Quntic easing"); + addEasingTypeIcons(easingBar, "expo", "Switch to Exponential easing"); + addEasingTypeIcons(easingBar, "circ", "Switch to Cicle easing"); + addEasingTypeIcons(easingBar, "back", "Switch to Back easing"); + addEasingTypeIcons(easingBar, "elastic", "Switch to Elastic easing"); + addEasingTypeIcons(easingBar, "bounce", "Switch to Bounce easing"); + const keyEasing = getEasingInterpolation(displayedEasing); + const keyEasingElement = document.getElementById("kf_easing_type_" + keyEasing); + keyEasingElement.style.stroke = "var(--color-accent)"; + keyEasingElement.classList.add('selected_kf_easing'); + if (!(keyEasing === "linear" || keyEasing == "step")) { + let easingTypeBar = document.createElement('div'); + keyframe.appendChild(easingTypeBar); + easingTypeBar.outerHTML = `
+ +
`; + easingTypeBar = document.getElementById('keyframe_bar_easing_type'); + addEasingTypeIcons(easingTypeBar, "in", "Switch to In easing type"); + addEasingTypeIcons(easingTypeBar, "out", "Switch to Out easing type"); + addEasingTypeIcons(easingTypeBar, "inout", "Switch to In/Out easing type"); + const keyEasingType = getEasingType(displayedEasing); + const keyEasingTypeElement = document.getElementById("kf_easing_type_" + keyEasingType); + keyEasingTypeElement.style.stroke = "var(--color-accent)"; + keyEasingTypeElement.classList.add('selected_kf_easing_type'); + } + const getEasingArgLabel = (kf) => { + switch (kf.easing) { + case _easing__WEBPACK_IMPORTED_MODULE_2__.EASING_OPTIONS.easeInBack: + case _easing__WEBPACK_IMPORTED_MODULE_2__.EASING_OPTIONS.easeOutBack: + case _easing__WEBPACK_IMPORTED_MODULE_2__.EASING_OPTIONS.easeInOutBack: + return 'Overshoot'; + case _easing__WEBPACK_IMPORTED_MODULE_2__.EASING_OPTIONS.easeInElastic: + case _easing__WEBPACK_IMPORTED_MODULE_2__.EASING_OPTIONS.easeOutElastic: + case _easing__WEBPACK_IMPORTED_MODULE_2__.EASING_OPTIONS.easeInOutElastic: + case _easing__WEBPACK_IMPORTED_MODULE_2__.EASING_OPTIONS.easeInBounce: + case _easing__WEBPACK_IMPORTED_MODULE_2__.EASING_OPTIONS.easeOutBounce: + case _easing__WEBPACK_IMPORTED_MODULE_2__.EASING_OPTIONS.easeInOutBounce: + return 'Bounciness'; + case _easing__WEBPACK_IMPORTED_MODULE_2__.EASING_OPTIONS.step: + return 'Steps'; + default: + return 'N/A'; + } + }; + const easingArgLabel = getMultiSelectValue(getEasingArgLabel, null, null); + if (Timeline.selected.every((kf) => (0,_utils__WEBPACK_IMPORTED_MODULE_1__.hasArgs)(kf.easing)) && easingArgLabel !== null) { + const argDefault = getMultiSelectValue(_easing__WEBPACK_IMPORTED_MODULE_2__.getEasingArgDefault, null, null); + const [displayedValue] = getMultiSelectValue('easingArgs', [argDefault], [argDefault]); + let scaleBar = document.createElement('div'); + keyframe.appendChild(scaleBar); + scaleBar.outerHTML = `
+ + +
`; + scaleBar = document.getElementById('keyframe_bar_easing_arg1'); + } + // console.log('easingBar:', easingBar, 'keyframe:', keyframe); + } + } +}; +const getEasingInterpolation = (name) => { + const matches = name.match(easingRegExp); + if (matches) { + return matches[2].toLowerCase(); + } + return name; +}; +const getEasingType = (name) => { + const matches = name.match(easingRegExp); + if (matches) { + return matches[1].toLowerCase(); + } + return "in"; +}; +const getIcon = (name) => { + switch (name) { + case "back": + return ''; + case "bounce": + return ''; + case "circ": + return ''; + case "cubic": + return ''; + case "elastic": + return ''; + case "expo": + case "in": + return ''; + case "inout": + return ''; + case "out": + return ''; + case "quad": + return ''; + case "quart": + return ''; + case "quint": + return ''; + case "sine": + return ''; + case "step": + return ''; + default: // linear + return ''; + } +}; +//#endregion Global Animation UI Handlers + + +/***/ }), + +/***/ "./codec.ts": +/*!******************!*\ + !*** ./codec.ts ***! + \******************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ loadCodec: () => (/* binding */ loadCodec), +/* harmony export */ maybeExportItemJson: () => (/* binding */ maybeExportItemJson), +/* harmony export */ unloadCodec: () => (/* binding */ unloadCodec) +/* harmony export */ }); +/* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/omit */ "./node_modules/lodash/omit.js"); +/* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_omit__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./settings */ "./settings.ts"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./utils.ts"); + + + +// This subclass isn't strictly needed at runtime but was required to appease the compiler due to our monkeypatch +class GeckolibBoneAnimator extends BoneAnimator { + addKeyframe(data, uuid) { + return super.addKeyframe(data, uuid); + } +} +/* eslint-disable no-useless-escape */ +//#region Codec Helpers / Export Settings +function loadCodec() { + // The actual Codec is automatically registered by superclass constructor + Codecs.project.on('compile', onProjectCompile); + Codecs.project.on('parse', onProjectParse); + Codecs.bedrock.on('compile', onBedrockCompile); + (0,_utils__WEBPACK_IMPORTED_MODULE_1__.addMonkeypatch)(Animator, null, "buildFile", animatorBuildFile); + (0,_utils__WEBPACK_IMPORTED_MODULE_1__.addMonkeypatch)(Animator, null, "loadFile", animatorLoadFile); +} +function unloadCodec() { + Codecs.project.removeListener('compile', onProjectCompile); + Codecs.project.removeListener('parse', onProjectParse); + Codecs.bedrock.removeListener('compile', onBedrockCompile); + format.delete(); +} +function onProjectCompile(e) { + if (Format.id !== "animated_entity_model") + return; + e.model.geckoSettings = _settings__WEBPACK_IMPORTED_MODULE_2__["default"]; + // console.log(`compileCallback model:`, e.model); +} +function onProjectParse(e) { + // console.log(`onProjectParse:`, e); + if (e.model && typeof e.model.geckoSettings === 'object') { + Object.assign(_settings__WEBPACK_IMPORTED_MODULE_2__["default"], lodash_omit__WEBPACK_IMPORTED_MODULE_0___default()(e.model.geckoSettings, ['formatVersion'])); + } + else { + Object.assign(_settings__WEBPACK_IMPORTED_MODULE_2__["default"], _settings__WEBPACK_IMPORTED_MODULE_2__.GECKO_SETTINGS_DEFAULT); + } + (0,_settings__WEBPACK_IMPORTED_MODULE_2__.onSettingsChanged)(); +} +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function onBedrockCompile(e) { + // console.log('onBedrockCompile e:', e); + // maybeExportItemJson(e.options); +} +function animatorBuildFile() { + const res = _utils__WEBPACK_IMPORTED_MODULE_1__.Original.get(Animator).buildFile.apply(this, arguments); + if (Format.id === "animated_entity_model") { + Object.assign(res, { + 'geckolib_format_version': _settings__WEBPACK_IMPORTED_MODULE_2__["default"].formatVersion, + }); + } + // console.log('animatorBuildFile res:', res); + return res; +} +function getKeyframeDataPoints(source) { + if (source instanceof Array) { + return [{ + x: source[0], + y: source[1], + z: source[2], + }]; + } + else if (['number', 'string'].includes(typeof source)) { + return [{ + x: source, y: source, z: source + }]; + } + else if (typeof source == 'object') { + if (source.vector) { + return getKeyframeDataPoints(source.vector); + } + const points = []; + if (source.pre) { + points.push(getKeyframeDataPoints(source.pre)[0]); + } + if (source.post) { + points.push(getKeyframeDataPoints(source.post)[0]); + } + return points; + } +} +function animatorLoadFile(file, animation_filter) { + // Currently no modifications are needed + // eslint-disable-next-line no-undef + const json = file.json || autoParseJSON(file.content); + const path = file.path; + const new_animations = []; + if (json && typeof json.animations === 'object') { + for (const ani_name in json.animations) { + if (animation_filter && !animation_filter.includes(ani_name)) + continue; + //Animation + const a = json.animations[ani_name]; + const animation = new Blockbench.Animation({ + name: ani_name, + path, + // TODO: Make sure it's OK to disable this line + // loop: a.loop && (a.loop == 'hold_on_last_frame' ? 'hold' : 'loop'), + loop: a.loop, + override: a.override_previous_animation, + anim_time_update: (typeof a.anim_time_update == 'string' + ? a.anim_time_update.replace(/;(?!$)/, ';\n') + : a.anim_time_update), + blend_weight: (typeof a.blend_weight == 'string' + ? a.blend_weight.replace(/;(?!$)/, ';\n') + : a.blend_weight), + length: a.animation_length + }).add(); + //Bones + if (a.bones) { + for (const bone_name in a.bones) { + const b = a.bones[bone_name]; + const lowercase_bone_name = bone_name.toLowerCase(); + const group = Group.all.find(group => group.name.toLowerCase() == lowercase_bone_name); + const uuid = group ? group.uuid : guid(); + let ga; // eslint-disable-line @typescript-eslint/no-unused-vars + const ba = new GeckolibBoneAnimator(uuid, animation, bone_name); + animation.animators[uuid] = ba; + //Channels + for (const channel in b) { + if (Animator.possible_channels[channel]) { + if (typeof b[channel] === 'string' || typeof b[channel] === 'number' || b[channel] instanceof Array) { + ba.addKeyframe({ + time: 0, + channel, + easing: b[channel].easing, + easingArgs: b[channel].easingArgs, + data_points: getKeyframeDataPoints(b[channel]), + }); + } + else if (typeof b[channel] === 'object' && b[channel].post) { + ba.addKeyframe({ + time: 0, + channel, + easing: b[channel].easing, + easingArgs: b[channel].easingArgs, + interpolation: b[channel].lerp_mode, + data_points: getKeyframeDataPoints(b[channel]), + }); + } + else if (typeof b[channel] === 'object') { + for (const timestamp in b[channel]) { + ba.addKeyframe({ + time: parseFloat(timestamp), + channel, + easing: b[channel][timestamp].easing, + easingArgs: b[channel][timestamp].easingArgs, + interpolation: b[channel][timestamp].lerp_mode, + data_points: getKeyframeDataPoints(b[channel][timestamp]), + }); + } + } + } + } + } + } + if (a.sound_effects) { + if (!animation.animators.effects) { + animation.animators.effects = new EffectAnimator(animation); + } + for (const timestamp0 in a.sound_effects) { + let sounds = a.sound_effects[timestamp0]; + if (sounds instanceof Array === false) + sounds = [sounds]; + animation.animators.effects.addKeyframe({ + channel: 'sound', + time: parseFloat(timestamp0), + data_points: sounds + }); + } + } + if (a.particle_effects) { + if (!animation.animators.effects) { + animation.animators.effects = new EffectAnimator(animation); + } + for (const timestamp1 in a.particle_effects) { + let particles = a.particle_effects[timestamp1]; + if (particles instanceof Array === false) + particles = [particles]; + particles.forEach(particle => { + if (particle) + particle.script = particle.pre_effect_script; + }); + animation.animators.effects.addKeyframe({ + channel: 'particle', + time: parseFloat(timestamp1), + data_points: particles + }); + } + } + if (a.timeline) { + if (!animation.animators.effects) { + animation.animators.effects = new EffectAnimator(animation); + } + for (const timestamp2 in a.timeline) { + const entry = a.timeline[timestamp2]; + const script = entry instanceof Array ? entry.join('\n') : entry; + animation.animators.effects.addKeyframe({ + channel: 'timeline', + time: parseFloat(timestamp2), + data_points: [{ script }] + }); + } + } + animation.calculateSnappingFromKeyframes(); + if (!Blockbench.Animation.selected && Animator.open) { + animation.select(); + } + new_animations.push(animation); + } + } + return new_animations; +} +//#endregion Codec Helpers / Export Settings +//#region Codec / ModelFormat +function maybeExportItemJson(options = {}) { + function checkExport(key, condition) { + key = options[key]; + if (key === undefined) { + return condition; + } + else { + return key; + } + } + if (!Project) + return; + const blockmodel = {}; + if (checkExport('comment', settings.credit.value)) { + blockmodel.credit = settings.credit.value; + } + if (checkExport('parent', Project.parent != '')) { + blockmodel.parent = Project.parent; + } + if (checkExport('ambientocclusion', Project.ambientocclusion === false)) { + blockmodel.ambientocclusion = false; + } + if (Project.texture_width !== 16 || Project.texture_height !== 16) { + blockmodel.texture_size = [Project.texture_width, Project.texture_height]; + } + if (checkExport('front_gui_light', Project.front_gui_light)) { + blockmodel.gui_light = 'front'; + } + if (checkExport('overrides', Project.overrides)) { + blockmodel.overrides = Project.overrides; + } + if (checkExport('display', Object.keys(Project.display_settings).length >= 1)) { + const new_display = {}; + let entries = 0; + for (const i in DisplayMode.slots) { + const key = DisplayMode.slots[i]; + // eslint-disable-next-line no-prototype-builtins + if (DisplayMode.slots.hasOwnProperty(i) && Project.display_settings[key] && Project.display_settings[key].export) { + new_display[key] = Project.display_settings[key].export(); + entries++; + } + } + if (entries) { + blockmodel.display = new_display; + } + } + const blockmodelString = JSON.stringify(blockmodel, null, 2); + const scope = codec; + const path = _settings__WEBPACK_IMPORTED_MODULE_2__["default"].itemModelPath; + Blockbench.export({ + resource_id: 'model', + type: Codecs.java_block.name, + extensions: ['json'], + name: scope.fileName().replace(".geo", ".item"), + startpath: path, + content: blockmodelString, + }, (real_path) => { + _settings__WEBPACK_IMPORTED_MODULE_2__["default"].itemModelPath = real_path; + }); + return this; +} +const codec = Codecs.bedrock; +const format = new ModelFormat({ + id: "animated_entity_model", + name: "GeckoLib Animated Model", + category: "minecraft", + description: "Animated Model for Java mods using GeckoLib", + icon: "view_in_ar", + rotate_cubes: true, + box_uv: true, + optional_box_uv: true, + single_texture: true, + bone_rig: true, + centered_grid: true, + animated_textures: true, + animation_mode: true, + animation_files: true, + locators: true, + codec: Codecs.project, + display_mode: false, + onActivation: function () { + } +}); +//Object.defineProperty(format, 'integer_size', {get: _ => Templates.get('integer_size')}) +// codec.format = format; // This sets the default format for the codec +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (codec); // This is used for plugin "Export Animated Model" menu item +//#endregion Codec / ModelFormat + + +/***/ }), + +/***/ "./easing.ts": +/*!*******************!*\ + !*** ./easing.ts ***! + \*******************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ EASING_DEFAULT: () => (/* binding */ EASING_DEFAULT), +/* harmony export */ EASING_OPTIONS: () => (/* binding */ EASING_OPTIONS), +/* harmony export */ easingFunctions: () => (/* binding */ easingFunctions), +/* harmony export */ getEasingArgDefault: () => (/* binding */ getEasingArgDefault), +/* harmony export */ parseEasingArg: () => (/* binding */ parseEasingArg), +/* harmony export */ reverseEasing: () => (/* binding */ reverseEasing) +/* harmony export */ }); +// The MIT license notice below applies to the function findIntervalBorderIndex +/* The MIT License (MIT) + +Copyright (c) 2015 Boris Chumichev + +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. + +/** + * + * Utilizes bisection method to search an interval to which + * point belongs to, then returns an index of left or right + * border of the interval + * + * @param {Number} point + * @param {Array} intervals + * @param {Boolean} useRightBorder + * @returns {Number} + */ +function findIntervalBorderIndex(point, intervals, useRightBorder) { + //If point is beyond given intervals + if (point < intervals[0]) + return 0; + if (point > intervals[intervals.length - 1]) + return intervals.length - 1; + //If point is inside interval + //Start searching on a full range of intervals + let indexOfNumberToCompare = 0; + let leftBorderIndex = 0; + let rightBorderIndex = intervals.length - 1; + //Reduce searching range till it find an interval point belongs to using binary search + while (rightBorderIndex - leftBorderIndex !== 1) { + indexOfNumberToCompare = leftBorderIndex + Math.floor((rightBorderIndex - leftBorderIndex) / 2); + point >= intervals[indexOfNumberToCompare] ? + leftBorderIndex = indexOfNumberToCompare : + rightBorderIndex = indexOfNumberToCompare; + } + return useRightBorder ? rightBorderIndex : leftBorderIndex; +} +function stepRange(steps, stop = 1) { + if (steps < 2) + throw new Error("steps must be > 2, got:" + steps); + const stepLength = stop / steps; + return Array.from({ + length: steps + }, (_, i) => i * stepLength); +} +// The MIT license notice below applies to the Easing class +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +class Easing { + /** + * A stepping function, returns 1 for any positive value of `n`. + */ + static step0(n) { + return n > 0 ? 1 : 0; + } + /** + * A stepping function, returns 1 if `n` is greater than or equal to 1. + */ + static step1(n) { + return n >= 1 ? 1 : 0; + } + /** + * A linear function, `f(t) = t`. Position correlates to elapsed time one to + * one. + * + * http://cubic-bezier.com/#0,0,1,1 + */ + static linear(t) { + return t; + } + /** + * A simple inertial interaction, similar to an object slowly accelerating to + * speed. + * + * http://cubic-bezier.com/#.42,0,1,1 + */ + // static ease(t) { + // if (!ease) { + // ease = Easing.bezier(0.42, 0, 1, 1); + // } + // return ease(t); + // } + /** + * A quadratic function, `f(t) = t * t`. Position equals the square of elapsed + * time. + * + * http://easings.net/#easeInQuad + */ + static quad(t) { + return t * t; + } + /** + * A cubic function, `f(t) = t * t * t`. Position equals the cube of elapsed + * time. + * + * http://easings.net/#easeInCubic + */ + static cubic(t) { + return t * t * t; + } + /** + * A power function. Position is equal to the Nth power of elapsed time. + * + * n = 4: http://easings.net/#easeInQuart + * n = 5: http://easings.net/#easeInQuint + */ + static poly(n) { + return (t) => Math.pow(t, n); + } + /** + * A sinusoidal function. + * + * http://easings.net/#easeInSine + */ + static sin(t) { + return 1 - Math.cos((t * Math.PI) / 2); + } + /** + * A circular function. + * + * http://easings.net/#easeInCirc + */ + static circle(t) { + return 1 - Math.sqrt(1 - t * t); + } + /** + * An exponential function. + * + * http://easings.net/#easeInExpo + */ + static exp(t) { + return Math.pow(2, 10 * (t - 1)); + } + /** + * A simple elastic interaction, similar to a spring oscillating back and + * forth. + * + * Default bounciness is 1, which overshoots a little bit once. 0 bounciness + * doesn't overshoot at all, and bounciness of N > 1 will overshoot about N + * times. + * + * http://easings.net/#easeInElastic + */ + static elastic(bounciness = 1) { + const p = bounciness * Math.PI; + return (t) => 1 - Math.pow(Math.cos((t * Math.PI) / 2), 3) * Math.cos(t * p); + } + /** + * Use with `Animated.parallel()` to create a simple effect where the object + * animates back slightly as the animation starts. + * + * Wolfram Plot: + * + * - http://tiny.cc/back_default (s = 1.70158, default) + */ + static back(s = 1.70158) { + return (t) => t * t * ((s + 1) * t - s); + } + /** + * Provides a simple bouncing effect. + * + * Props to Waterded#6455 for making the bounce adjustable and GiantLuigi4#6616 for helping clean it up + * using min instead of ternaries + * http://easings.net/#easeInBounce + */ + static bounce(k = 0.5) { + const q = (x) => (121 / 16) * x * x; + const w = (x) => ((121 / 4) * k) * Math.pow(x - (6 / 11), 2) + 1 - k; + const r = (x) => 121 * k * k * Math.pow(x - (9 / 11), 2) + 1 - k * k; + const t = (x) => 484 * k * k * k * Math.pow(x - (10.5 / 11), 2) + 1 - k * k * k; + return (x) => Math.min(q(x), w(x), r(x), t(x)); + } + /** + * Provides a cubic bezier curve, equivalent to CSS Transitions' + * `transition-timing-function`. + * + * A useful tool to visualize cubic bezier curves can be found at + * http://cubic-bezier.com/ + */ + // static bezier(x1, y1, x2, y2) { + // const _bezier = require('./bezier'); + // return _bezier(x1, y1, x2, y2); + // } + /** + * Runs an easing function forwards. + */ + static in(easing) { + return easing; + } + /** + * Runs an easing function backwards. + */ + static out(easing) { + return (t) => 1 - easing(1 - t); + } + /** + * Makes any easing function symmetrical. The easing function will run + * forwards for half of the duration, then backwards for the rest of the + * duration. + */ + static inOut(easing) { + return (t) => { + if (t < 0.5) { + return easing(t * 2) / 2; + } + return 1 - easing((1 - t) * 2) / 2; + }; + } +} +const quart = Easing.poly(4); +const quint = Easing.poly(5); +const back = (direction, scalar, t) => direction(Easing.back(1.70158 * scalar))(t); +const elastic = (direction, bounciness, t) => direction(Easing.elastic(bounciness))(t); +const bounce = (direction, bounciness, t) => direction(Easing.bounce(bounciness))(t); +const easingFunctions = { + linear: Easing.linear, + step(steps, x) { + const intervals = stepRange(steps); + return intervals[findIntervalBorderIndex(x, intervals, false)]; + }, + easeInQuad: Easing.in(Easing.quad), + easeOutQuad: Easing.out(Easing.quad), + easeInOutQuad: Easing.inOut(Easing.quad), + easeInCubic: Easing.in(Easing.cubic), + easeOutCubic: Easing.out(Easing.cubic), + easeInOutCubic: Easing.inOut(Easing.cubic), + easeInQuart: Easing.in(quart), + easeOutQuart: Easing.out(quart), + easeInOutQuart: Easing.inOut(quart), + easeInQuint: Easing.in(quint), + easeOutQuint: Easing.out(quint), + easeInOutQuint: Easing.inOut(quint), + easeInSine: Easing.in(Easing.sin), + easeOutSine: Easing.out(Easing.sin), + easeInOutSine: Easing.inOut(Easing.sin), + easeInExpo: Easing.in(Easing.exp), + easeOutExpo: Easing.out(Easing.exp), + easeInOutExpo: Easing.inOut(Easing.exp), + easeInCirc: Easing.in(Easing.circle), + easeOutCirc: Easing.out(Easing.circle), + easeInOutCirc: Easing.inOut(Easing.circle), + easeInBack: back.bind(null, Easing.in), + easeOutBack: back.bind(null, Easing.out), + easeInOutBack: back.bind(null, Easing.inOut), + easeInElastic: elastic.bind(null, Easing.in), + easeOutElastic: elastic.bind(null, Easing.out), + easeInOutElastic: elastic.bind(null, Easing.inOut), + easeInBounce: bounce.bind(null, Easing.in), + easeOutBounce: bounce.bind(null, Easing.out), + easeInOutBounce: bounce.bind(null, Easing.inOut), +}; +// Object with the same keys as easingFunctions and values of the stringified key names +const EASING_OPTIONS = Object.freeze(Object.fromEntries(Object.entries(easingFunctions).map(entry => ([entry[0], entry[0]])))); +const EASING_DEFAULT = 'linear'; +const getEasingArgDefault = (kf) => { + switch (kf.easing) { + case EASING_OPTIONS.easeInBack: + case EASING_OPTIONS.easeOutBack: + case EASING_OPTIONS.easeInOutBack: + case EASING_OPTIONS.easeInElastic: + case EASING_OPTIONS.easeOutElastic: + case EASING_OPTIONS.easeInOutElastic: + return 1; + case EASING_OPTIONS.easeInBounce: + case EASING_OPTIONS.easeOutBounce: + case EASING_OPTIONS.easeInOutBounce: + return 0.5; + case EASING_OPTIONS.step: + return 5; + default: + return null; + } +}; +const parseEasingArg = (kf, value) => { + switch (kf.easing) { + case EASING_OPTIONS.easeInBack: + case EASING_OPTIONS.easeOutBack: + case EASING_OPTIONS.easeInOutBack: + case EASING_OPTIONS.easeInElastic: + case EASING_OPTIONS.easeOutElastic: + case EASING_OPTIONS.easeInOutElastic: + case EASING_OPTIONS.easeInBounce: + case EASING_OPTIONS.easeOutBounce: + case EASING_OPTIONS.easeInOutBounce: + return parseFloat(value); + case EASING_OPTIONS.step: + return Math.max(parseInt(value, 10), 2); + default: + return parseInt(value, 10); + } +}; +function reverseEasing(easing) { + if (!easing) + return easing; + if (easing.startsWith("easeInOut")) + return easing; + if (easing.startsWith("easeIn")) + return easing.replace("easeIn", "easeOut"); + if (easing.startsWith("easeOut")) + return easing.replace("easeOut", "easeIn"); + return easing; +} + -// Star ranges basically just allow anything at all. -createToken('STAR', '(<|>)?=?\\s*\\*') -// >=0.0.0 is like a star -createToken('GTE0', '^\\s*>=\\s*0\.0\.0\\s*$') -createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$') +/***/ }), +/***/ "./keyframe.ts": +/*!*********************!*\ + !*** ./keyframe.ts ***! + \*********************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -/***/ }), +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ loadKeyframeOverrides: () => (/* binding */ loadKeyframeOverrides), +/* harmony export */ unloadKeyframeOverrides: () => (/* binding */ unloadKeyframeOverrides) +/* harmony export */ }); +/* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/groupBy */ "./node_modules/lodash/groupBy.js"); +/* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_groupBy__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var lodash_mapValues__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/mapValues */ "./node_modules/lodash/mapValues.js"); +/* harmony import */ var lodash_mapValues__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_mapValues__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./utils.ts"); +/* harmony import */ var _easing__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./easing */ "./easing.ts"); -/***/ "./node_modules/webpack/buildin/module.js": -/*!***********************************!*\ - !*** (webpack)/buildin/module.js ***! - \***********************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = function(module) { - if (!module.webpackPolyfill) { - module.deprecate = function() {}; - module.paths = []; - // module.parent = undefined by default - if (!module.children) module.children = []; - Object.defineProperty(module, "loaded", { - enumerable: true, - get: function() { - return module.l; - } - }); - Object.defineProperty(module, "id", { - enumerable: true, - get: function() { - return module.i; - } - }); - module.webpackPolyfill = 1; - } - return module; -}; -/***/ }), -/***/ "./package.json": -/*!**********************!*\ - !*** ./package.json ***! - \**********************/ -/*! exports provided: name, version, private, description, main, scripts, author, license, blockbenchConfig, sideEffects, devDependencies, dependencies, default */ -/***/ (function(module) { +var Keyframe = Blockbench.Keyframe; +//#region Keyframe Mixins +function loadKeyframeOverrides() { + (0,_utils__WEBPACK_IMPORTED_MODULE_2__.addMonkeypatch)(Keyframe, "prototype", "getLerp", keyframeGetLerp); + (0,_utils__WEBPACK_IMPORTED_MODULE_2__.addMonkeypatch)(Keyframe, "prototype", "compileBedrockKeyframe", keyframeCompileBedrock); + (0,_utils__WEBPACK_IMPORTED_MODULE_2__.addMonkeypatch)(Keyframe, "prototype", "getUndoCopy", keyframeGetUndoCopy); + (0,_utils__WEBPACK_IMPORTED_MODULE_2__.addMonkeypatch)(Keyframe, "prototype", "extend", keyframeExtend); + (0,_utils__WEBPACK_IMPORTED_MODULE_2__.addMonkeypatch)(BarItems.reverse_keyframes, null, "click", onReverseKeyframes); +} +function unloadKeyframeOverrides() { + //No-op for now since monkeypatches are unloaded automatically +} +function lerp(start, stop, amt) { + return amt * (stop - start) + start; +} +// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars +function keyframeGetLerp(other, axis, amount, allow_expression) { + const easing = other.easing || _easing__WEBPACK_IMPORTED_MODULE_3__.EASING_DEFAULT; + if (Format.id !== "animated_entity_model") { + return _utils__WEBPACK_IMPORTED_MODULE_2__.Original.get(Keyframe).getLerp.apply(this, arguments); + } + let easingFunc = _easing__WEBPACK_IMPORTED_MODULE_3__.easingFunctions[easing]; + if ((0,_utils__WEBPACK_IMPORTED_MODULE_2__.hasArgs)(easing)) { + const arg1 = Array.isArray(other.easingArgs) && other.easingArgs.length > 0 + ? other.easingArgs[0] + : (0,_easing__WEBPACK_IMPORTED_MODULE_3__.getEasingArgDefault)(other); + // console.log(`keyframeGetLerp arg1: ${arg1}`); + easingFunc = easingFunc.bind(null, arg1); + } + const easedAmount = easingFunc(amount); + const start = this.calc(axis); + const stop = other.calc(axis); + const result = lerp(start, stop, easedAmount); + // console.log('keyframeGetLerp easing:', easing, 'arguments:', arguments, 'start:', start, 'stop:', stop, 'amount:', amount, 'easedAmount:', easedAmount, 'result:', result); + if (Number.isNaN(result)) { + throw new Error('batman'); + } + return result; +} +function geckolibGetArray(data_point = 0) { + const { easing, easingArgs, getArray } = this; + let result = getArray.apply(this, [data_point]); + if (Format.id === "animated_entity_model") { + result = { vector: result, easing }; + if ((0,_utils__WEBPACK_IMPORTED_MODULE_2__.hasArgs)(easing)) + result.easingArgs = easingArgs; + } + return result; +} +function keyframeCompileBedrock() { + if (Format.id !== "animated_entity_model" || !this.transform) { + return _utils__WEBPACK_IMPORTED_MODULE_2__.Original.get(Keyframe).compileBedrockKeyframe.apply(this, arguments); + } + if (this.interpolation == 'catmullrom') { + const previous = this.getPreviousKeyframe.apply(this); + const include_pre = (!previous && this.time > 0) || (previous && previous.interpolation != 'catmullrom'); + return { + pre: include_pre ? geckolibGetArray.call(this, [0]) : undefined, + post: geckolibGetArray.call(this, [include_pre ? 1 : 0]), + lerp_mode: this.interpolation, + }; + } + else if (this.data_points.length == 1) { + const previous = this.getPreviousKeyframe.apply(this); + if (previous && previous.interpolation == 'step') { + return new oneLiner({ + pre: geckolibGetArray.call(previous, [1]), + post: geckolibGetArray.call(this), + }); + } + else { + return geckolibGetArray.call(this); + } + } + else { + return new oneLiner({ + pre: geckolibGetArray.call(this, [0]), + post: geckolibGetArray.call(this, [1]), + }); + } +} +function keyframeGetUndoCopy() { + const { easing, easingArgs } = this; + const result = _utils__WEBPACK_IMPORTED_MODULE_2__.Original.get(Keyframe).getUndoCopy.apply(this, arguments); + if (Format.id === "animated_entity_model") { + Object.assign(result, { easing }); + if ((0,_utils__WEBPACK_IMPORTED_MODULE_2__.hasArgs)(easing)) + result.easingArgs = easingArgs; + } + // console.log('keyframeGetUndoCopy arguments:', arguments, 'this:', this, 'result:', result); + return result; +} +function keyframeExtend(dataIn) { + const data = Object.assign({}, dataIn); + // console.log('keyframeExtend 1 arguments:', arguments); + if (Format.id === "animated_entity_model") { + if (typeof data.values === 'object') { + if (data.values.easing !== undefined) { + Merge.string(this, data.values, 'easing'); + } + if (Array.isArray(data.values.easingArgs)) { + this.easingArgs = data.values.easingArgs; + } + if (!Array.isArray(data.values) && Array.isArray(data.values.vector)) { + // Convert data to format expected by KeyframeExtendOriginal + data.values = data.values.vector; + } + } + else { + if (data.easing !== undefined) { + Merge.string(this, data, 'easing'); + } + if (Array.isArray(data.easingArgs)) { + this.easingArgs = data.easingArgs; + } + } + } + const result = _utils__WEBPACK_IMPORTED_MODULE_2__.Original.get(Keyframe).extend.apply(this, arguments); + // console.log('keyframeExtend 2 arguments:', arguments, 'this:', this, 'result:', result); + return result; +} +function onReverseKeyframes() { + _utils__WEBPACK_IMPORTED_MODULE_2__.Original.get(BarItems.reverse_keyframes).click.apply(this, arguments); + // console.log('@@@ onReverseKeyframes selected:', Timeline.selected); + // There's not really an easy way to merge our undo operation with the original one so we'll make a new one instead + Undo.initEdit({ keyframes: Timeline.selected }); + const kfByAnimator = lodash_groupBy__WEBPACK_IMPORTED_MODULE_0___default()(Timeline.selected, kf => kf.animator.uuid); + const kfByAnimatorAndChannel = lodash_mapValues__WEBPACK_IMPORTED_MODULE_1___default()(kfByAnimator, keyframesForAnimator => lodash_groupBy__WEBPACK_IMPORTED_MODULE_0___default()(keyframesForAnimator, kf => kf.channel)); + Object.keys(kfByAnimatorAndChannel).forEach(animatorUuid => { + const animatorChannelGroups = kfByAnimatorAndChannel[animatorUuid]; + Object.keys(animatorChannelGroups).forEach(channel => { + const channelKeyframes = animatorChannelGroups[channel]; + // Ensure keyframes are in temporal order. Not sure if this is already the case, but it couldn't hurt + channelKeyframes.sort((kfA, kfB) => kfA.time - kfB.time); + // Reverse easing direction + const easingData = channelKeyframes.map((kf) => ({ + easing: (0,_easing__WEBPACK_IMPORTED_MODULE_3__.reverseEasing)(kf.easing), + easingArgs: kf.easingArgs + })); + // console.log('@@@ onReverseKeyframes PRE animator:', animatorUuid, 'channel:', channel, 'channelKeyframes:', channelKeyframes, 'easingData:', easingData); + // Shift easing data to the right by one keyframe + channelKeyframes.forEach((kf, i) => { + if (i == 0) { + kf.easing = undefined; + kf.easingArgs = undefined; + return; + } + const newEasingData = easingData[i - 1]; + kf.easing = newEasingData.easing; + kf.easingArgs = newEasingData.easingArgs; + }); + // console.log('@@@ onReverseKeyframes POST animator:', animatorUuid, 'channel:', channel, 'channelKeyframes:', channelKeyframes); + }); + }); + // console.log('@@@ kfByAnimator:', kfByAnimator, "\nkfByAnimatorAndChannel:", kfByAnimatorAndChannel); + Undo.finishEdit('Reverse keyframe easing'); + updateKeyframeSelection(); + Animator.preview(); +} +//#endregion Keyframe Mixins -module.exports = JSON.parse("{\"name\":\"animation_utils\",\"version\":\"3.0.8\",\"private\":true,\"description\":\"GeckoLib Animation Utils\",\"main\":\"index.js\",\"scripts\":{\"build\":\"webpack && npm run update_manifest\",\"update_manifest\":\"node scripts/updateManifest.js\",\"start\":\"webpack --watch --mode=development\",\"lint\":\"eslint .\",\"lint:fix\":\"eslint --fix .\",\"pretest\":\"npm run lint\",\"test\":\"echo \\\"Error: no test specified\\\" && exit 1\"},\"author\":\"Eliot Lash, Gecko, McHorse, AzureDoom, Tslat\",\"license\":\"MIT\",\"blockbenchConfig\":{\"title\":\"GeckoLib Animation Utils\",\"author\":\"Eliot Lash, Gecko, McHorse, AzureDoom, Tslat\",\"icon\":\"movie_filter\",\"description\":\"Create animated blocks, items, entity, and armor using the GeckoLib library and plugin. https://github.com/bernie-g/geckolib/wiki\",\"min_version\":\"4.0.0\",\"max_version\":\"5.0.0\",\"variant\":\"both\"},\"sideEffects\":[\"./index.js\"],\"devDependencies\":{\"eol\":\"0.9.1\",\"eslint\":\"7.7.0\",\"webpack\":\"4.43.0\",\"webpack-cli\":\"3.3.12\",\"indent-string\":\"^5.0.0\"},\"dependencies\":{\"lodash\":\"^4.17.21\",\"semver\":\"7.3.2\"}}"); /***/ }), -/***/ "./settings.js": +/***/ "./settings.ts": /*!*********************!*\ - !*** ./settings.js ***! + !*** ./settings.ts ***! \*********************/ -/*! exports provided: MOD_SDK_1_15_FORGE, MOD_SDK_1_15_FABRIC, MOD_SDKS, MOD_SDK_OPTIONS, OBJ_TYPE_ENTITY, OBJ_TYPE_ARMOR, OBJ_TYPE_BLOCK_ITEM, OBJ_TYPE_OPTIONS, GECKO_SETTINGS_DEFAULT, onSettingsChanged, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MOD_SDK_1_15_FORGE", function() { return MOD_SDK_1_15_FORGE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MOD_SDK_1_15_FABRIC", function() { return MOD_SDK_1_15_FABRIC; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MOD_SDKS", function() { return MOD_SDKS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MOD_SDK_OPTIONS", function() { return MOD_SDK_OPTIONS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OBJ_TYPE_ENTITY", function() { return OBJ_TYPE_ENTITY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OBJ_TYPE_ARMOR", function() { return OBJ_TYPE_ARMOR; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OBJ_TYPE_BLOCK_ITEM", function() { return OBJ_TYPE_BLOCK_ITEM; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OBJ_TYPE_OPTIONS", function() { return OBJ_TYPE_OPTIONS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GECKO_SETTINGS_DEFAULT", function() { return GECKO_SETTINGS_DEFAULT; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onSettingsChanged", function() { return onSettingsChanged; }); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ GECKO_SETTINGS_DEFAULT: () => (/* binding */ GECKO_SETTINGS_DEFAULT), +/* harmony export */ MOD_SDKS: () => (/* binding */ MOD_SDKS), +/* harmony export */ MOD_SDK_1_15_FABRIC: () => (/* binding */ MOD_SDK_1_15_FABRIC), +/* harmony export */ MOD_SDK_1_15_FORGE: () => (/* binding */ MOD_SDK_1_15_FORGE), +/* harmony export */ MOD_SDK_OPTIONS: () => (/* binding */ MOD_SDK_OPTIONS), +/* harmony export */ OBJ_TYPE_ARMOR: () => (/* binding */ OBJ_TYPE_ARMOR), +/* harmony export */ OBJ_TYPE_BLOCK_ITEM: () => (/* binding */ OBJ_TYPE_BLOCK_ITEM), +/* harmony export */ OBJ_TYPE_ENTITY: () => (/* binding */ OBJ_TYPE_ENTITY), +/* harmony export */ OBJ_TYPE_OPTIONS: () => (/* binding */ OBJ_TYPE_OPTIONS), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ onSettingsChanged: () => (/* binding */ onSettingsChanged) +/* harmony export */ }); /* harmony import */ var _armorTemplate_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./armorTemplate.json */ "./armorTemplate.json"); -var _armorTemplate_json__WEBPACK_IMPORTED_MODULE_0___namespace = /*#__PURE__*/__webpack_require__.t(/*! ./armorTemplate.json */ "./armorTemplate.json", 1); - - -const makeOptions = arr => Object.fromEntries(arr.map(x => [x, x])); +const makeOptions = (arr) => Object.fromEntries(arr.map(x => [x, x])); const MOD_SDK_1_15_FORGE = 'Forge 1.12 - 1.16'; const MOD_SDK_1_15_FABRIC = 'Fabric 1.15 - 1.16'; const MOD_SDKS = [MOD_SDK_1_15_FORGE, MOD_SDK_1_15_FABRIC]; const MOD_SDK_OPTIONS = makeOptions(MOD_SDKS); - const OBJ_TYPE_ENTITY = 'OBJ_TYPE_ENTITY'; const OBJ_TYPE_ARMOR = 'OBJ_TYPE_ARMOR'; const OBJ_TYPE_BLOCK_ITEM = 'OBJ_TYPE_ITEM_BLOCK'; const OBJ_TYPE_OPTIONS = { - [OBJ_TYPE_ENTITY]: 'Entity', - [OBJ_TYPE_ARMOR]: 'Armor', - [OBJ_TYPE_BLOCK_ITEM]: 'Block/Item', + [OBJ_TYPE_ENTITY]: 'Entity', + [OBJ_TYPE_ARMOR]: 'Armor', + [OBJ_TYPE_BLOCK_ITEM]: 'Block/Item', }; - const GECKO_SETTINGS_DEFAULT = { - formatVersion: 2, - modSDK: MOD_SDK_1_15_FORGE, - objectType: OBJ_TYPE_ENTITY, - entityType: 'Entity', - javaPackage: 'com.example.mod', - animFileNamespace: 'MODID', - animFilePath: 'animations/ANIMATIONFILE.json', + formatVersion: 2, + modSDK: MOD_SDK_1_15_FORGE, + objectType: OBJ_TYPE_ENTITY, + entityType: 'Entity', + javaPackage: 'com.example.mod', + animFileNamespace: 'MODID', + animFilePath: 'animations/ANIMATIONFILE.json', }; Object.freeze(GECKO_SETTINGS_DEFAULT); - -let geckoSettings = Object.assign({}, GECKO_SETTINGS_DEFAULT); - +const geckoSettings = Object.assign({}, GECKO_SETTINGS_DEFAULT); function onSettingsChanged() { - if(Format.id === "animated_entity_model") { - Format.display_mode = geckoSettings.objectType === OBJ_TYPE_BLOCK_ITEM; - } - Modes.selected.select(); - switch(geckoSettings.objectType) { - case OBJ_TYPE_ARMOR: { - if(Outliner.root.length === 0) { - Codecs.project.parse(_armorTemplate_json__WEBPACK_IMPORTED_MODULE_0__); - } else { - alert('Unable to load Armor Template as this would overwrite the current model. Please select Armor type on an empty project if you want to use the Armor Template.'); - } - break; - } case OBJ_TYPE_BLOCK_ITEM: { - Project.parent = 'builtin/entity'; - break; + if (Format.id === "animated_entity_model") { + Format.display_mode = geckoSettings.objectType === OBJ_TYPE_BLOCK_ITEM; + } + Modes.selected.select(); + switch (geckoSettings.objectType) { + case OBJ_TYPE_ARMOR: { + if (Outliner.root.length === 0) { + Codecs.project.parse(_armorTemplate_json__WEBPACK_IMPORTED_MODULE_0__, null); + } + else { + alert('Unable to load Armor Template as this would overwrite the current model. Please select Armor type on an empty project if you want to use the Armor Template.'); + } + break; + } + case OBJ_TYPE_BLOCK_ITEM: { + if (Project) + Project.parent = 'builtin/entity'; + break; + } } - } } +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (geckoSettings); -/* harmony default export */ __webpack_exports__["default"] = (geckoSettings); /***/ }), -/***/ "./utils.js": +/***/ "./utils.ts": /*!******************!*\ - !*** ./utils.js ***! + !*** ./utils.ts ***! \******************/ -/*! exports provided: hasArgs, Original, addMonkeypatch, removeMonkeypatches */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasArgs", function() { return hasArgs; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Original", function() { return Original; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addMonkeypatch", function() { return addMonkeypatch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeMonkeypatches", function() { return removeMonkeypatches; }); -/* harmony import */ var _easing__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./easing */ "./easing.js"); - - -const hasArgs = (easing = "") => - easing.includes("Back") || - easing.includes("Elastic") || - easing.includes("Bounce") || - easing === _easing__WEBPACK_IMPORTED_MODULE_0__["EASING_OPTIONS"].step; - +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Original: () => (/* binding */ Original), +/* harmony export */ addMonkeypatch: () => (/* binding */ addMonkeypatch), +/* harmony export */ hasArgs: () => (/* binding */ hasArgs), +/* harmony export */ removeMonkeypatches: () => (/* binding */ removeMonkeypatches) +/* harmony export */ }); +/* harmony import */ var _easing__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./easing */ "./easing.ts"); + +const hasArgs = (easing = "") => easing.includes("Back") || + easing.includes("Elastic") || + easing.includes("Bounce") || + easing === _easing__WEBPACK_IMPORTED_MODULE_0__.EASING_OPTIONS.step; const Original = new Map(); const addMonkeypatch = (symbol, path, functionKey, newFunction) => { - const pathAccessor = path ? symbol[path] : symbol; - if(!Original.get(symbol)) Original.set(symbol, { _pathAccessor: pathAccessor }); - Original.get(symbol)[functionKey] = pathAccessor[functionKey]; - pathAccessor[functionKey] = newFunction; + const pathAccessor = path ? symbol[path] : symbol; + if (!Original.get(symbol)) + Original.set(symbol, { _pathAccessor: pathAccessor }); + Original.get(symbol)[functionKey] = pathAccessor[functionKey]; + pathAccessor[functionKey] = newFunction; }; - const removeMonkeypatches = () => { - Original.forEach(symbol => { - Object.keys(symbol).forEach(functionKey => { - if(functionKey.startsWith('_')) return; - symbol._pathAccessor[functionKey] = symbol[functionKey]; + Original.forEach(symbol => { + Object.keys(symbol).forEach(functionKey => { + if (functionKey.startsWith('_')) + return; + symbol._pathAccessor[functionKey] = symbol[functionKey]; + }); }); - }); - Original.clear(); -} + Original.clear(); +}; + + +/***/ }), + +/***/ "./armorTemplate.json": +/*!****************************!*\ + !*** ./armorTemplate.json ***! + \****************************/ +/***/ ((module) => { + +"use strict"; +module.exports = JSON.parse('{"meta":{"format_version":"3.2","model_format":"animated_entity_model","box_uv":true},"name":"CustomArmor","geo_name":"CustomArmor","resolution":{"width":64,"height":64},"elements":[{"name":"dontTouch","from":[-4,24,-4],"to":[4,32,4],"autouv":1,"color":0,"export":false,"locked":true,"origin":[0,0,0],"uuid":"9675593e-b27d-b70e-e1ea-1fc29f46a294"},{"name":"dontTouch","from":[-4,12,-2],"to":[4,24,2],"autouv":1,"color":0,"export":false,"locked":true,"origin":[0,24,0],"uuid":"fa43156a-2a62-948c-082f-483d525f6d1f"},{"name":"dontTouch","from":[4,12,-2],"to":[8,24,2],"autouv":1,"color":0,"export":false,"locked":true,"origin":[4,22,0],"uuid":"aa51170c-8b32-fb62-71f1-58ac0b7785a8"},{"name":"dontTouch","from":[-8,12,-2],"to":[-4,24,2],"autouv":1,"color":0,"export":false,"locked":true,"origin":[4,22,0],"uuid":"bf2c2539-20e3-cfcc-94c0-491734019889"},{"name":"dontTouch","from":[-4,0,-2],"to":[0,12,2],"autouv":1,"color":0,"export":false,"locked":true,"origin":[4,22,0],"uuid":"17b9bae0-356a-9bba-fad9-4672e2671191"},{"name":"dontTouch","from":[0,0,-2],"to":[4,12,2],"autouv":1,"color":0,"export":false,"locked":true,"origin":[4,22,0],"uuid":"7b31bac4-dc40-2b93-1204-7bbdcfe7d924"}],"outliner":[{"name":"bipedHead","uuid":"d340b6fa-56aa-9c0f-3560-7a067643b77d","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[0,24,0],"children":["9675593e-b27d-b70e-e1ea-1fc29f46a294",{"name":"armorHead","uuid":"6ab88dea-c816-d2bb-6be9-05ed7838da97","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[0,24,0],"children":[]}]},{"name":"bipedBody","uuid":"ce5b366c-fd87-41ae-9a73-e0a4d4b05f8d","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[0,24,0],"children":["fa43156a-2a62-948c-082f-483d525f6d1f",{"name":"armorBody","uuid":"282fcdbb-8ea9-4a13-4154-f2ed20d696c8","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[0,24,0],"children":[]}]},{"name":"bipedRightArm","uuid":"d8113cc7-7e10-0930-259e-b8e4211ce9da","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[4,22,0],"children":["aa51170c-8b32-fb62-71f1-58ac0b7785a8",{"name":"armorRightArm","uuid":"c5300e23-fd2f-b56c-3552-45d6650e11c6","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[4,22,0],"children":[]}]},{"name":"bipedLeftArm","uuid":"3b8901e8-3420-0834-51eb-76d64ff2ae8f","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[-4,22,0],"children":["bf2c2539-20e3-cfcc-94c0-491734019889",{"name":"armorLeftArm","uuid":"b0d41a53-f4ce-53c1-f899-5a2048c90ac2","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[-4,22,0],"children":[]}]},{"name":"bipedLeftLeg","uuid":"37231be7-a8ef-22ca-7fea-40aed58003bb","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[2,12,0],"children":["17b9bae0-356a-9bba-fad9-4672e2671191",{"name":"armorLeftLeg","uuid":"e4b19746-2d17-1f56-befe-00718165ae50","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[2,12,0],"children":[]},{"name":"armorLeftBoot","uuid":"9fe26b9a-ad66-9e6b-2fa2-4168e333b4be","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[2,12,0],"children":[]}]},{"name":"bipedRightLeg","uuid":"45c031a5-b6be-e0a7-5454-b45d07f28429","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[-2,12,0],"children":["7b31bac4-dc40-2b93-1204-7bbdcfe7d924",{"name":"armorRightLeg","uuid":"60238f18-e74b-c863-cb45-2e2f162221bd","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[-2,12,0],"children":[]},{"name":"armorRightBoot","uuid":"eb3db34b-ccfe-dae9-ac4d-4e22c3222f70","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[-2,12,0],"children":[]}]}],"textures":[]}'); + +/***/ }), + +/***/ "./package.json": +/*!**********************!*\ + !*** ./package.json ***! + \**********************/ +/***/ ((module) => { + +"use strict"; +module.exports = JSON.parse('{"name":"animation_utils","version":"3.1.0","private":true,"description":"GeckoLib","main":"index.js","scripts":{"prebuild":"npm run test","build":"npm run build:only","build:only":"webpack && npm run update_manifest","update_manifest":"node scripts/updateManifest.mjs","start":"webpack --watch --mode=development","lint":"eslint .","lint:fix":"eslint --fix .","tsc":"tsc --noEmit","pretest":"npm run lint && npm run tsc","test":"npm run test:only","test:only":"jest"},"author":"Eliot Lash, Gecko, McHorse, AzureDoom","license":"MIT","blockbenchConfig":{"title":"GeckoLib Animation Utils","author":"Eliot Lash, Gecko, McHorse, AzureDoom, Tslat","icon":"icon.png","description":"Create animated blocks, items, entities, and armor using the GeckoLib library and plugin.","min_version":"4.8.0","max_version":"5.0.0","variant":"both"},"sideEffects":["./index.js"],"devDependencies":{"@types/jest":"^29.5.4","@types/lodash":"^4.14.197","@typescript-eslint/eslint-plugin":"^6.5.0","@typescript-eslint/parser":"^6.5.0","blockbench-types":"^4.9.0","eol":"0.9.1","eslint":"^7.7.0","indent-string":"^5.0.0","jest":"^29.6.4","ts-jest":"^29.1.1","ts-loader":"^9.4.4","typescript":"^4.9.5","webpack":"^5.88.2","webpack-cli":"^5.1.4"},"dependencies":{"lodash":"^4.17.21","semver":"7.3.2"}}'); /***/ }) -/******/ }); \ No newline at end of file +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ id: moduleId, +/******/ loaded: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.loaded = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => (module['default']) : +/******/ () => (module); +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/node module decorator */ +/******/ (() => { +/******/ __webpack_require__.nmd = (module) => { +/******/ module.paths = []; +/******/ if (!module.children) module.children = []; +/******/ return module; +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be in strict mode. +(() => { +"use strict"; +/*!******************!*\ + !*** ./index.ts ***! + \******************/ +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var semver_functions_coerce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! semver/functions/coerce */ "./node_modules/semver/functions/coerce.js"); +/* harmony import */ var semver_functions_coerce__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(semver_functions_coerce__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var semver_functions_satisfies__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! semver/functions/satisfies */ "./node_modules/semver/functions/satisfies.js"); +/* harmony import */ var semver_functions_satisfies__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(semver_functions_satisfies__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./package.json */ "./package.json"); +/* harmony import */ var _animationUi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./animationUi */ "./animationUi.ts"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils */ "./utils.ts"); +/* harmony import */ var _keyframe__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./keyframe */ "./keyframe.ts"); +/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./settings */ "./settings.ts"); +/* harmony import */ var _codec__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./codec */ "./codec.ts"); + + + + + + + + +const { version, blockbenchConfig } = _package_json__WEBPACK_IMPORTED_MODULE_2__; +const SUPPORTED_BB_VERSION_RANGE = `${blockbenchConfig.min_version} - ${blockbenchConfig.max_version}`; +if (!semver_functions_satisfies__WEBPACK_IMPORTED_MODULE_1___default()(semver_functions_coerce__WEBPACK_IMPORTED_MODULE_0___default()(Blockbench.version), SUPPORTED_BB_VERSION_RANGE)) { + alert(`GeckoLib Animation Utils currently only supports Blockbench ${SUPPORTED_BB_VERSION_RANGE}. Please ensure you are using this version of Blockbench to avoid bugs and undefined behavior.`); +} +(function () { + let exportAction; + let exportDisplayAction; + let button; + BBPlugin.register("animation_utils", Object.assign({}, blockbenchConfig, { + name: blockbenchConfig.title, + version, + await_loading: true, + onload() { + (0,_codec__WEBPACK_IMPORTED_MODULE_3__.loadCodec)(); + (0,_animationUi__WEBPACK_IMPORTED_MODULE_4__.loadAnimationUI)(); + (0,_keyframe__WEBPACK_IMPORTED_MODULE_5__.loadKeyframeOverrides)(); + console.log("Loaded GeckoLib plugin"); + exportAction = new Action("export_geckolib_model", { + name: "Export GeckoLib Model", + icon: "archive", + description: "Export your java animated model as a model for GeckoLib.", + category: "file", + condition: () => Format.id === "animated_entity_model", + click: function () { + _codec__WEBPACK_IMPORTED_MODULE_3__["default"].export(); + }, + }); + MenuBar.addAction(exportAction, "file.export"); + exportDisplayAction = new Action("export_geckolib_display", { + name: "Export GeckoLib Display Settings", + icon: "icon-bb_interface", + description: "Export your java animated model display settings for GeckoLib.", + category: "file", + condition: () => Format.id === "animated_entity_model" && _settings__WEBPACK_IMPORTED_MODULE_6__["default"].objectType === _settings__WEBPACK_IMPORTED_MODULE_6__.OBJ_TYPE_BLOCK_ITEM, + click: _codec__WEBPACK_IMPORTED_MODULE_3__.maybeExportItemJson, + }); + MenuBar.addAction(exportDisplayAction, "file.export"); + button = new Action('gecko_settings', { + name: 'GeckoLib Model Settings...', + description: 'Configure animated model.', + icon: 'info', + condition: () => Format.id === "animated_entity_model", + click: function () { + const dialog = new Dialog({ + id: 'project', + title: 'GeckoLib Model Settings', + width: 540, + lines: [`GeckoLib Animation Utils v${version}`], + form: { + objectType: { label: 'Object Type', type: 'select', default: _settings__WEBPACK_IMPORTED_MODULE_6__["default"].objectType, options: _settings__WEBPACK_IMPORTED_MODULE_6__.OBJ_TYPE_OPTIONS }, + // modSDK: {label: 'Modding SDK', type: 'select', default: geckoSettings.modSDK, options: MOD_SDK_OPTIONS}, + // entityType: {label: 'Entity Type', value: geckoSettings.entityType}, + // javaPackage: {label: 'Java Package', value: geckoSettings.javaPackage}, + // animFileNamespace: {label: 'Animation File Namespace', value: geckoSettings.animFileNamespace}, + // animFilePath: {label: 'Animation File Path', value: geckoSettings.animFilePath}, + }, + onConfirm: function (formResult) { + Object.assign(_settings__WEBPACK_IMPORTED_MODULE_6__["default"], formResult); + (0,_settings__WEBPACK_IMPORTED_MODULE_6__.onSettingsChanged)(); + dialog.hide(); + } + }); + dialog.show(); + } + }); + MenuBar.addAction(button, 'file.1'); + }, + onunload() { + exportAction.delete(); + exportDisplayAction.delete(); + button.delete(); + (0,_keyframe__WEBPACK_IMPORTED_MODULE_5__.unloadKeyframeOverrides)(); + (0,_animationUi__WEBPACK_IMPORTED_MODULE_4__.unloadAnimationUI)(); + (0,_codec__WEBPACK_IMPORTED_MODULE_3__.unloadCodec)(); + (0,_utils__WEBPACK_IMPORTED_MODULE_7__.removeMonkeypatches)(); + console.clear(); // eslint-disable-line no-console + }, + })); +})(); + +})(); + +/******/ })() +; \ No newline at end of file diff --git a/plugins/animation_utils/icon.png b/plugins/animation_utils/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..4b8652bcf3c7bf824f732f78bd1ab689e68881cb GIT binary patch literal 6674 zcmeHLXH-+m+75_{D2j-J6bVr{poD}J2m$0MMdC@Q5s)S+I}j-eBuMDJqbR+KGyx3) zN|7Sc+W{00S1GA8cWvRS^4KxPyN21VpBo2?#gbMCxye1Ar3!V9UMgpePJNe++grb;+ zh86@vLnzya#b9~>5C|_X_>{hB=kM~}N32VYcPk`8AD=92a@$AlvOI4QC01zTHr5{W zetiyRmzu_j2>15(@N&qNM68*mdxyycLxbp@z>&eiA~VCog+Z~!h-w_L=&K3ajWNBTIK3&v&wZ=PZ!IOJ!p}pz^O7mh+Vz-MC*B25@zYEbAb zDxkshWD7P7qG!NkQ)uo07fJo#xxD^0jvYe$g}`= znhqUiuvbivhX)Bf0WJl~^YrlI;CcG6C0;ye3z`uy=n{nMt`D;ViN(acq=256$-IP70Of%hiX$z<%hr`FXNQr0?`zoD~&7JrFz! z8=uG^F6fefJPZ;L7x5FL{At|Agc+8GnoQ)7%6-OUwCjBB1+s-k;Fl z*1iM=Q6v)Hh(+@iOpjos4-<@!r?Y5GI)2I2p<;BX07D0^jnveJW9R@CPQ{|oa80Z> zT2l)NVCg8-4^#v%4wvFZ0|Zncxds#D!DvzGR0dibu7kq@a10iQfm2WzG#rDbqp4Ul zl7_<~f1oh;VS-Uf@%V980xCL4Mc2aO&@>DZj%A>+a1202!*Mu_4xCO$YN4n|6hKEU zQ_*R76PAxB1>8=iC&d*&u)SQD#t;aO-)BM4hoLlJ2?||06nF}4c?lfKF@U}_PmpW5i{?i0 zas|Nbu@bJ|+L`|$6ev_08o;1wa2+}Z1IJLbwBS@N91V`s!P4mroF-k1!uXk;!(wp# zC_cbGS5QY#D=<8lzM-J1OB<#3GuqD$5bOdd7#xX%qcm3pLus!FhFDoJLXb1QtymB7 zzckTX0{oCZSFnNKw5b-@3u4pDmJO9ONWiS4VBY@Pu2Kh(&{*vpLT>nUce+2#& zUBBe|M+*ES@UQ6lf0Ik>@7F273;Y%22fi%HuiAVb0uf%YAd-zK={@w!zM~nvtc)H` zMh`EuCnT#oGOH^tr|WorS87pje)+(e;?DGf&bq7DZ;#!acyMRx*~H-BKvQ#T<+-YJ zW&DEErBwG=l4G=~ZG`oaXg6;9>5|$@HG|D{!yS#+`>))rsOSky@8qO(c%1A2k~^GF zwA&u#Im@cp}E4R!UUCFR*!g)g2z?dj>x$gfOE z$xBGg^zl0$n_R?XC$fUFpFSQBiOw}7M+7F6MMkCQTKJXmFLNV{0)kK4IJ2v3TT%+@ zZRv@}Gx@lK0g2hQ#dV{!qrAf>JHv~IW74X_lKFdW1Drfg>6?c+rF6qhS&Zy{bt4y# z{6S{!Kz!MaRQ^r&nPG0xwFCBv`E{o+Ubz@hdSmkKWY^fBLu?H>sEFi!${2_a2o9tG z6tWE&+%Gv zcaJK-w_4It;ASYDGCOq>6?}}T-$Z=tbXVB9(Y(p>n2O}Ms#{Z6+jMOY$CniZO)(%YOKXCGATYUpH;P<_OjtMi9D#y(ijC!548unH@)VQ`MK3Rok)?D-&8wh~rypn#f7YZqg#k|3QbDyX~^_P`2@c8`$nJ zbx|^Ogz8$#Z-q*z;HA}n-|pzAW^?>Emq0aYsJeeT)++(&8i_j0{mnN;hY_LfnSf2X zU>sej?|lO0dkP(tr5%`Ka5PpU^P;H@TZLJme*E12hyvZPe)Z5io!AnCgtG?4EmryU zLjoKA(dJ1tn}^`v4eQvZhdB_)`YnPY1j)&h0UOtH2_)mS zQ=(fpNy|xPxz<1+Ynlm0`^cuf$5TUza<>)Q6eqG2ogm&DOT2}(dXR=N`Ql48LwQPT zoe~E+YDEjX!bGPQz5Dva`lc=gi#}PCQo-C}Bz|ZV4_kjP)Vc1MRmM>geh6(XtRiDr zwHQ4!RImO=-#x|8oLP^Ml5ETePQd(?z}e6K^TD&PA*#C{r5#GMP0K9cTfTiIXD2eX zTKvP*K-Unpro7^>veoutLQ?y}JD+9Puo2LgBmA~4d9k7*QwQa8b2dh0WK1%=Q!h7` zt`_T7wy0=}ayy_PWu|nIGxg3S^35*WQB}!?>Nw--sMMl8d<(LpW5+&w2Zz96M@g+w z>cN@6A}kT=TjIO?A013B=R2yZvm`GGlP|~do9kcCG$3s2j^(}HDk|bZ`q1&#WG;PG zPVPbT#S*@y$QmW%$n=)s9nQH{LsNzMWz8b~vcv7$bF1WU*xB0$6hV{7MXtK`?$@{< zNBb?Gm5%&Xd9+-*wOauRp|rfPF!$RF%98PKi4FF5&Q9Md zpHqB$X}(>_xLbaB-A1VeJg=o5{nE=fx9F_>!ItpaCZ99VwjqR?+M3QUDfX+YD$T|# zr}<4vsieV^60vs%*ZB0nQuANR_04{9@%El`*(`HmR8>mPF4Vki&1`iRgRm#6h^Z^r zzdg0oW+CLp#AX-KNA4Oh`*g>V;x=9R+OdTum%0%Z)u+}~Q$mLnWdBklkCcv;pX+7e z-7*Z7LTOC|a;CGv#9gdKBoiyy_||D?%=!M~Gx8hP8sD4dyENQje7vQ3;_6!TyQJrk z1SLtetJcLgOxcO~D48C`yKVy}mxeyF@4HlI7oNPfW5LBOhB zp!i+w5Yc{yeWN8|v8G1phiC zUvN0TClVw!beCAwDm2L4nTPnjl#u(pBk2hbuHHn|*whwKr}&_`!6J4PD!P9#<$cQz zW6K9+1jJcI7J+Eqwr%g%L;3q3gd`xXiUaHhs|-H#W!HQu zzhm0BtIl4e6Ito?dN^Nq;>qev_w8>R|E#Mnxos}fe}ndD%S|`_{zLY}^{dHmZ{-*6 zo#5h~hNGWF1DTxu54mbVsH-RZ<-bCYd?f|Fl(t2j$Jk%i7F8Mj5UxB`?p$>h;vnuZ zbD5s-MX41UhoDpw3vu$zZ5v;e23(n(lAPdd$iaQJn`@6T2jQc>>R8$}~?zA>S8U-;=7oqw$t z{`%a{>&^2yvU65Vwkqz)SFtU8mt#+($Ep?~I}BiA%Gspo6c^<+_ogWXt@^g@2{Tc` zbKSG;PkIxli;`O#`uFGRHQ{A(60QG!_js;;F;p~YF8N6KZx8tsVvi3Lw%Ha0uR5*o z{lp+=tg0Z~K;OT0zr>!`>09StzTB->DS>Q~9`8CA*gfN%A0hNn!rEhgr0iOI!^5*2 z2Smr`3gYez(aDa@lZVtL*Of`OTEOy%D#8x!(|2FB z&HE5cQ~xd)Q7iRCw^ck>MJ_3}p}zR@-iM1tgRHqgJ>t{o-sbf2FAm7JR6ozV z(({%6Ev-CcSJ#)3#p^vew^PU8LsV83G$=aFzZS{*VB7yGX1;yflkAVLgQo7qOpRZm z_s!nBJGbz4u3)WhxF_NbYazAqOla`bGrvVQ)Fp*~`8U3r-wWQi*o96wIV6|uY!07k zyVW!Q@N+ORPH2v&lDA>T3)#-Y( Tk { + Timeline.selected.forEach((kf: GeckolibKeyframe) => { kf.easing = value; }) window.updateKeyframeSelection(); // Ensure easingArg display is updated @@ -45,8 +45,8 @@ export function updateKeyframeEasingArg(obj) { Undo.initEdit({keyframes: Timeline.selected}) if ($(obj).val() === "-") return; // console.log('updateKeyframeEasingArg value:', $(obj).val(), 'obj:', obj); - Timeline.selected.forEach((kf) => { - const value = parseEasingArg(kf, $(obj).val().trim()); + Timeline.selected.forEach((kf: GeckolibKeyframe) => { + const value = parseEasingArg(kf, ($(obj).val() as string).trim()); kf.easingArgs = [value]; // obj.value = value; }) @@ -58,16 +58,16 @@ export const updateKeyframeSelectionCallback = (/*...args*/) => { $('#keyframe_bar_easing_type').remove() $('#keyframe_bar_easing_arg1').remove() - const addPrePostButton = document.querySelector('#keyframe_type_label > div'); + const addPrePostButton = document.querySelector('#keyframe_type_label > div'); if (addPrePostButton) addPrePostButton.hidden = Format.id === "animated_entity_model"; - var multi_channel = false; - var channel = false; + let multi_channel = false; //eslint-disable-line @typescript-eslint/no-unused-vars + let channel: boolean | string | number = false; Timeline.selected.forEach((kf) => { if (channel === false) { channel = kf.channel } else if (channel !== kf.channel) { - multi_channel = true //eslint-disable-line no-unused-vars + multi_channel = true } }) @@ -102,7 +102,7 @@ export const updateKeyframeSelectionCallback = (/*...args*/) => { return acc; }, new Map()); - const isFirstInChannel = kf => keyframesByChannel.get(kf.animator)[kf.channel].indexOf(kf) < 1; + const isFirstInChannel = (kf: _Keyframe) => keyframesByChannel.get(kf.animator)[kf.channel].indexOf(kf) < 1; if (Timeline.selected.length && Format.id === "animated_entity_model") { if (Timeline.selected.every(kf => kf.animator instanceof BoneAnimator && !isFirstInChannel(kf))) { @@ -124,13 +124,13 @@ export const updateKeyframeSelectionCallback = (/*...args*/) => { let finalEasing = 'ease'; if (inputEasingOrType === "in" || inputEasingOrType === "out" || inputEasingOrType === "inout") { - let finalEasingType = easingTypeToTypeId(inputEasingOrType) + const finalEasingType = easingTypeToTypeId(inputEasingOrType) finalEasing += finalEasingType + easing.substring(0, 1).toUpperCase() + easing.substring(1); } else if (inputEasingOrType === "linear" || inputEasingOrType == "step") { finalEasing = inputEasingOrType; } else { - let finalEasingType = easingTypeToTypeId(easingType); + const finalEasingType = easingTypeToTypeId(easingType); finalEasing += finalEasingType + inputEasingOrType.substring(0, 1).toUpperCase() + inputEasingOrType.substring(1); } @@ -139,20 +139,20 @@ export const updateKeyframeSelectionCallback = (/*...args*/) => { }; const addEasingTypeIcons = (bar, easingType, title) => { - var div = document.createElement("div"); + const div = document.createElement("div"); div.innerHTML = getIcon(easingType); div.id = "kf_easing_type_" + easingType; div.setAttribute("style", "stroke:var(--color-text);margin:0px;padding:3px;width:30px;height:30px"); div.setAttribute("title", title); div.onclick = () => { - let selectedEasing = $(".selected_kf_easing"); - let selectedEasingType = $(".selected_kf_easing_type"); + const selectedEasing = $(".selected_kf_easing"); + const selectedEasingType = $(".selected_kf_easing_type"); - let keySelectedEasing = selectedEasing.attr("id").substring(15); - let keySelectedEasingType = selectedEasingType.length <= 0 ? "in" : selectedEasingType.attr("id").substring(15); + const keySelectedEasing = selectedEasing.attr("id").substring(15); + const keySelectedEasingType = selectedEasingType.length <= 0 ? "in" : selectedEasingType.attr("id").substring(15); - let currentEasing = convertEasingTypeToId(keySelectedEasing, keySelectedEasingType, keySelectedEasing); - let finalEasing = convertEasingTypeToId(keySelectedEasing, keySelectedEasingType, easingType); + const currentEasing = convertEasingTypeToId(keySelectedEasing, keySelectedEasingType, keySelectedEasing); + const finalEasing = convertEasingTypeToId(keySelectedEasing, keySelectedEasingType, easingType); if (finalEasing != currentEasing) { // console.log("Changed from " + currentEasing + " to " + finalEasing); @@ -163,7 +163,7 @@ export const updateKeyframeSelectionCallback = (/*...args*/) => { }; const keyframe = document.getElementById('panel_keyframe'); - let easingBar = document.createElement('div'); + let easingBar: HTMLElement = document.createElement('div'); keyframe.appendChild(easingBar); easingBar.outerHTML = `
@@ -183,14 +183,14 @@ export const updateKeyframeSelectionCallback = (/*...args*/) => { addEasingTypeIcons(easingBar, "elastic", "Switch to Elastic easing"); addEasingTypeIcons(easingBar, "bounce", "Switch to Bounce easing"); - let keyEasing = getEasingInterpolation(displayedEasing); - let keyEasingElement = document.getElementById("kf_easing_type_" + keyEasing); + const keyEasing = getEasingInterpolation(displayedEasing); + const keyEasingElement = document.getElementById("kf_easing_type_" + keyEasing); keyEasingElement.style.stroke = "var(--color-accent)"; keyEasingElement.classList.add('selected_kf_easing'); if (!(keyEasing === "linear" || keyEasing == "step")) { - let easingTypeBar = document.createElement('div'); + let easingTypeBar: HTMLElement = document.createElement('div'); keyframe.appendChild(easingTypeBar); easingTypeBar.outerHTML = `
@@ -201,14 +201,14 @@ export const updateKeyframeSelectionCallback = (/*...args*/) => { addEasingTypeIcons(easingTypeBar, "out", "Switch to Out easing type"); addEasingTypeIcons(easingTypeBar, "inout", "Switch to In/Out easing type"); - let keyEasingType = getEasingType(displayedEasing); - let keyEasingTypeElement = document.getElementById("kf_easing_type_" + keyEasingType); + const keyEasingType = getEasingType(displayedEasing); + const keyEasingTypeElement = document.getElementById("kf_easing_type_" + keyEasingType); keyEasingTypeElement.style.stroke = "var(--color-accent)"; keyEasingTypeElement.classList.add('selected_kf_easing_type'); } - const getEasingArgLabel = (kf) => { + const getEasingArgLabel = (kf: GeckolibKeyframe) => { switch(kf.easing) { case EASING_OPTIONS.easeInBack: case EASING_OPTIONS.easeOutBack: @@ -228,10 +228,10 @@ export const updateKeyframeSelectionCallback = (/*...args*/) => { } }; const easingArgLabel = getMultiSelectValue(getEasingArgLabel, null, null); - if (Timeline.selected.every(kf => hasArgs(kf.easing)) && easingArgLabel !== null) { + if (Timeline.selected.every((kf: GeckolibKeyframe) => hasArgs(kf.easing)) && easingArgLabel !== null) { const argDefault = getMultiSelectValue(getEasingArgDefault, null, null); const [displayedValue] = getMultiSelectValue('easingArgs', [argDefault], [argDefault]); - let scaleBar = document.createElement('div'); + let scaleBar: HTMLElement = document.createElement('div'); keyframe.appendChild(scaleBar); scaleBar.outerHTML = `
@@ -245,8 +245,8 @@ export const updateKeyframeSelectionCallback = (/*...args*/) => { } }; -const getEasingInterpolation = (name) => { - var matches = name.match(easingRegExp); +const getEasingInterpolation = (name: string) => { + const matches = name.match(easingRegExp); if (matches) { return matches[2].toLowerCase(); @@ -255,8 +255,8 @@ const getEasingInterpolation = (name) => { return name; }; -const getEasingType = (name) => { - var matches = name.match(easingRegExp); +const getEasingType = (name: string) => { + const matches = name.match(easingRegExp); if (matches) { return matches[1].toLowerCase(); @@ -265,7 +265,7 @@ const getEasingType = (name) => { return "in"; }; -const getIcon = (name) => { +const getIcon = (name: string) => { switch(name) { case "back": return ''; diff --git a/src/animation_utils/armorTemplate.json b/plugins/animation_utils/src/armorTemplate.json similarity index 100% rename from src/animation_utils/armorTemplate.json rename to plugins/animation_utils/src/armorTemplate.json diff --git a/src/animation_utils/codec.js b/plugins/animation_utils/src/codec.ts similarity index 69% rename from src/animation_utils/codec.js rename to plugins/animation_utils/src/codec.ts index 2d0d5f04..60ade97c 100644 --- a/src/animation_utils/codec.js +++ b/plugins/animation_utils/src/codec.ts @@ -1,6 +1,19 @@ import omit from 'lodash/omit'; import geckoSettings, {GECKO_SETTINGS_DEFAULT, onSettingsChanged} from './settings'; import {addMonkeypatch, Original} from './utils'; +import type { EasingKey } from './easing'; + +interface GeckolibKeyframeOptions extends KeyframeOptions { + easing: EasingKey + easingArgs: number[] | null | undefined +} + +// This subclass isn't strictly needed at runtime but was required to appease the compiler due to our monkeypatch +class GeckolibBoneAnimator extends BoneAnimator { + public addKeyframe(data: GeckolibKeyframeOptions, uuid?: string): _Keyframe { + return super.addKeyframe(data, uuid); + } +} /* eslint-disable no-useless-escape */ @@ -16,19 +29,19 @@ export function loadCodec() { } export function unloadCodec() { - Codecs.project.events.compile.remove(onProjectCompile) - Codecs.project.events.parse.remove(onProjectParse) - Codecs.bedrock.events.compile.remove(onBedrockCompile) + Codecs.project.removeListener('compile', onProjectCompile); + Codecs.project.removeListener('parse', onProjectParse); + Codecs.bedrock.removeListener('compile', onBedrockCompile); format.delete(); } -function onProjectCompile(e) { +function onProjectCompile(e: any) { if (Format.id !== "animated_entity_model") return; e.model.geckoSettings = geckoSettings; // console.log(`compileCallback model:`, e.model); } -function onProjectParse(e) { +function onProjectParse(e: any) { // console.log(`onProjectParse:`, e); if (e.model && typeof e.model.geckoSettings === 'object') { Object.assign(geckoSettings, omit(e.model.geckoSettings, ['formatVersion'])); @@ -37,8 +50,8 @@ function onProjectParse(e) { } onSettingsChanged(); } - -function onBedrockCompile(e) { +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function onBedrockCompile(e: any) { // console.log('onBedrockCompile e:', e); // maybeExportItemJson(e.options); } @@ -57,21 +70,50 @@ function animatorBuildFile() { return res; } +function getKeyframeDataPoints(source: any) { + if (source instanceof Array) { + return [{ + x: source[0], + y: source[1], + z: source[2], + }] + } else if (['number', 'string'].includes(typeof source)) { + return [{ + x: source, y: source, z: source + }] + } else if (typeof source == 'object') { + if(source.vector) + { + return getKeyframeDataPoints(source.vector); + } + const points = []; + if (source.pre) { + points.push(getKeyframeDataPoints(source.pre)[0]) + } + if (source.post) { + points.push(getKeyframeDataPoints(source.post)[0]) + } + return points; + } +} + function animatorLoadFile(file, animation_filter) { // Currently no modifications are needed // eslint-disable-next-line no-undef - var json = file.json || autoParseJSON(file.content); - let path = file.path; - let new_animations = []; + const json = file.json || autoParseJSON(file.content); + const path = file.path; + const new_animations = []; if (json && typeof json.animations === 'object') { - for (var ani_name in json.animations) { + for (const ani_name in json.animations) { if (animation_filter && !animation_filter.includes(ani_name)) continue; //Animation - var a = json.animations[ani_name] - var animation = new Animation({ + const a = json.animations[ani_name] + const animation = new Blockbench.Animation({ name: ani_name, path, - loop: a.loop && (a.loop == 'hold_on_last_frame' ? 'hold' : 'loop'), + // TODO: Make sure it's OK to disable this line + // loop: a.loop && (a.loop == 'hold_on_last_frame' ? 'hold' : 'loop'), + loop: a.loop, override: a.override_previous_animation, anim_time_update: (typeof a.anim_time_update == 'string' ? a.anim_time_update.replace(/;(?!$)/, ';\n') @@ -83,43 +125,17 @@ function animatorLoadFile(file, animation_filter) { }).add() //Bones if (a.bones) { - // eslint-disable-next-line no-inner-declarations - function getKeyframeDataPoints(source) { - if (source instanceof Array) { - return [{ - x: source[0], - y: source[1], - z: source[2], - }] - } else if (['number', 'string'].includes(typeof source)) { - return [{ - x: source, y: source, z: source - }] - } else if (typeof source == 'object') { - if(source.vector) - { - return getKeyframeDataPoints(source.vector); - } - let points = []; - if (source.pre) { - points.push(getKeyframeDataPoints(source.pre)[0]) - } - if (source.post) { - points.push(getKeyframeDataPoints(source.post)[0]) - } - return points; - } - } - for (var bone_name in a.bones) { - var b = a.bones[bone_name] - let lowercase_bone_name = bone_name.toLowerCase(); - var group = Group.all.find(group => group.name.toLowerCase() == lowercase_bone_name) - let uuid = group ? group.uuid : guid(); + for (const bone_name in a.bones) { + const b = a.bones[bone_name] + const lowercase_bone_name = bone_name.toLowerCase(); + const group = Group.all.find(group => group.name.toLowerCase() == lowercase_bone_name) + const uuid = group ? group.uuid : guid(); + let ga : GeneralAnimator; // eslint-disable-line @typescript-eslint/no-unused-vars - var ba = new BoneAnimator(uuid, animation, bone_name); + const ba = new GeckolibBoneAnimator(uuid, animation, bone_name); animation.animators[uuid] = ba; //Channels - for (var channel in b) { + for (const channel in b) { if (Animator.possible_channels[channel]) { if (typeof b[channel] === 'string' || typeof b[channel] === 'number' || b[channel] instanceof Array) { ba.addKeyframe({ @@ -139,7 +155,7 @@ function animatorLoadFile(file, animation_filter) { data_points: getKeyframeDataPoints(b[channel]), }); } else if (typeof b[channel] === 'object') { - for (var timestamp in b[channel]) { + for (const timestamp in b[channel]) { ba.addKeyframe({ time: parseFloat(timestamp), channel, @@ -158,8 +174,8 @@ function animatorLoadFile(file, animation_filter) { if (!animation.animators.effects) { animation.animators.effects = new EffectAnimator(animation); } - for (var timestamp0 in a.sound_effects) { - var sounds = a.sound_effects[timestamp0]; + for (const timestamp0 in a.sound_effects) { + let sounds = a.sound_effects[timestamp0]; if (sounds instanceof Array === false) sounds = [sounds]; animation.animators.effects.addKeyframe({ channel: 'sound', @@ -172,8 +188,8 @@ function animatorLoadFile(file, animation_filter) { if (!animation.animators.effects) { animation.animators.effects = new EffectAnimator(animation); } - for (var timestamp1 in a.particle_effects) { - var particles = a.particle_effects[timestamp1]; + for (const timestamp1 in a.particle_effects) { + let particles = a.particle_effects[timestamp1]; if (particles instanceof Array === false) particles = [particles]; particles.forEach(particle => { if (particle) particle.script = particle.pre_effect_script; @@ -189,9 +205,9 @@ function animatorLoadFile(file, animation_filter) { if (!animation.animators.effects) { animation.animators.effects = new EffectAnimator(animation); } - for (var timestamp2 in a.timeline) { - var entry = a.timeline[timestamp2]; - var script = entry instanceof Array ? entry.join('\n') : entry; + for (const timestamp2 in a.timeline) { + const entry = a.timeline[timestamp2]; + const script = entry instanceof Array ? entry.join('\n') : entry; animation.animators.effects.addKeyframe({ channel: 'timeline', time: parseFloat(timestamp2), @@ -200,7 +216,7 @@ function animatorLoadFile(file, animation_filter) { } } animation.calculateSnappingFromKeyframes(); - if (!Animation.selected && Animator.open) { + if (!Blockbench.Animation.selected && Animator.open) { animation.select() } new_animations.push(animation) @@ -212,7 +228,7 @@ function animatorLoadFile(file, animation_filter) { //#endregion Codec Helpers / Export Settings //#region Codec / ModelFormat -export function maybeExportItemJson(options = {}, as) { +export function maybeExportItemJson(options = {}) { function checkExport(key, condition) { key = options[key] if (key === undefined) { @@ -222,7 +238,9 @@ export function maybeExportItemJson(options = {}, as) { } } - const blockmodel = {} + if (!Project) return; + + const blockmodel: any = {} if (checkExport('comment', settings.credit.value)) { blockmodel.credit = settings.credit.value } @@ -242,13 +260,14 @@ export function maybeExportItemJson(options = {}, as) { blockmodel.overrides = Project.overrides; } if (checkExport('display', Object.keys(Project.display_settings).length >= 1)) { - var new_display = {} - var entries = 0; - for (var i in DisplayMode.slots) { - var key = DisplayMode.slots[i] - if (DisplayMode.slots.hasOwnProperty(i) && Project.display_settings[key] && Project.display_settings[key].export) { - new_display[key] = Project.display_settings[key].export() - entries++; + const new_display = {} + let entries = 0; + for (const i in DisplayMode.slots) { + const key = DisplayMode.slots[i] + // eslint-disable-next-line no-prototype-builtins + if (DisplayMode.slots.hasOwnProperty(i) && Project.display_settings[key] && Project.display_settings[key].export) { + new_display[key] = Project.display_settings[key].export() + entries++; } } if (entries) { @@ -258,9 +277,9 @@ export function maybeExportItemJson(options = {}, as) { const blockmodelString = JSON.stringify(blockmodel, null, 2); - var scope = codec; + const scope = codec; - let path = geckoSettings.itemModelPath; + const path = geckoSettings.itemModelPath; Blockbench.export({ resource_id: 'model', @@ -276,9 +295,9 @@ export function maybeExportItemJson(options = {}, as) { return this; } -var codec = Codecs.bedrock; +const codec = Codecs.bedrock; -var format = new ModelFormat({ +const format = new ModelFormat({ id: "animated_entity_model", name: "GeckoLib Animated Model", category: "minecraft", diff --git a/src/animation_utils/easing.js b/plugins/animation_utils/src/easing.ts similarity index 78% rename from src/animation_utils/easing.js rename to plugins/animation_utils/src/easing.ts index 6f56401f..7979de69 100644 --- a/src/animation_utils/easing.js +++ b/plugins/animation_utils/src/easing.ts @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * @param {Boolean} useRightBorder * @returns {Number} */ -function findIntervalBorderIndex(point, intervals, useRightBorder) { +function findIntervalBorderIndex(point: number, intervals: number[], useRightBorder: boolean) { //If point is beyond given intervals if (point < intervals[0]) return 0 @@ -39,9 +39,9 @@ function findIntervalBorderIndex(point, intervals, useRightBorder) { return intervals.length - 1 //If point is inside interval //Start searching on a full range of intervals - var indexOfNumberToCompare = 0; - var leftBorderIndex = 0; - var rightBorderIndex = intervals.length - 1 + let indexOfNumberToCompare = 0; + let leftBorderIndex = 0; + let rightBorderIndex = intervals.length - 1 //Reduce searching range till it find an interval point belongs to using binary search while (rightBorderIndex - leftBorderIndex !== 1) { indexOfNumberToCompare = leftBorderIndex + Math.floor((rightBorderIndex - leftBorderIndex) / 2) @@ -52,7 +52,7 @@ function findIntervalBorderIndex(point, intervals, useRightBorder) { return useRightBorder ? rightBorderIndex : leftBorderIndex } -function stepRange(steps, stop = 1) { +function stepRange(steps: number, stop = 1) { if (steps < 2) throw new Error("steps must be > 2, got:" + steps); const stepLength = stop / steps; return Array.from({ @@ -60,6 +60,9 @@ function stepRange(steps, stop = 1) { }, (_, i) => i * stepLength); } +type EasingFunction = (t: number) => number; +type EasingDirection = (easing: EasingFunction) => EasingFunction; + // The MIT license notice below applies to the Easing class /** * Copyright (c) Facebook, Inc. and its affiliates. @@ -71,13 +74,13 @@ class Easing { /** * A stepping function, returns 1 for any positive value of `n`. */ - static step0(n) { + static step0(n: number) { return n > 0 ? 1 : 0; } /** * A stepping function, returns 1 if `n` is greater than or equal to 1. */ - static step1(n) { + static step1(n: number) { return n >= 1 ? 1 : 0; } /** @@ -86,7 +89,7 @@ class Easing { * * http://cubic-bezier.com/#0,0,1,1 */ - static linear(t) { + static linear(t: number) { return t; } /** @@ -107,7 +110,7 @@ class Easing { * * http://easings.net/#easeInQuad */ - static quad(t) { + static quad(t: number) { return t * t; } /** @@ -116,7 +119,7 @@ class Easing { * * http://easings.net/#easeInCubic */ - static cubic(t) { + static cubic(t: number) { return t * t * t; } /** @@ -125,15 +128,15 @@ class Easing { * n = 4: http://easings.net/#easeInQuart * n = 5: http://easings.net/#easeInQuint */ - static poly(n) { - return (t) => Math.pow(t, n); + static poly(n: number) { + return (t: number) => Math.pow(t, n); } /** * A sinusoidal function. * * http://easings.net/#easeInSine */ - static sin(t) { + static sin(t: number) { return 1 - Math.cos((t * Math.PI) / 2); } /** @@ -141,7 +144,7 @@ class Easing { * * http://easings.net/#easeInCirc */ - static circle(t) { + static circle(t: number) { return 1 - Math.sqrt(1 - t * t); } /** @@ -149,7 +152,7 @@ class Easing { * * http://easings.net/#easeInExpo */ - static exp(t) { + static exp(t: number) { return Math.pow(2, 10 * (t - 1)); } /** @@ -164,7 +167,7 @@ class Easing { */ static elastic(bounciness = 1) { const p = bounciness * Math.PI; - return t => 1 - Math.pow(Math.cos((t * Math.PI) / 2), 3) * Math.cos(t * p); + return (t: number) => 1 - Math.pow(Math.cos((t * Math.PI) / 2), 3) * Math.cos(t * p); } /** * Use with `Animated.parallel()` to create a simple effect where the object @@ -175,7 +178,7 @@ class Easing { * - http://tiny.cc/back_default (s = 1.70158, default) */ static back(s = 1.70158) { - return t => t * t * ((s + 1) * t - s); + return (t: number) => t * t * ((s + 1) * t - s); } /** * Provides a simple bouncing effect. @@ -185,11 +188,11 @@ class Easing { * http://easings.net/#easeInBounce */ static bounce(k = 0.5) { - const q = x => (121 / 16) * x * x; - const w = x => ((121 / 4) * k) * Math.pow(x - (6 / 11), 2) + 1 - k; - const r = x => 121 * k * k * Math.pow(x - (9 / 11), 2) + 1 - k * k; - const t = x => 484 * k * k * k * Math.pow(x - (10.5 / 11), 2) + 1 - k * k * k; - return x => Math.min(q(x), w(x), r(x), t(x)); + const q = (x: number) => (121 / 16) * x * x; + const w = (x: number) => ((121 / 4) * k) * Math.pow(x - (6 / 11), 2) + 1 - k; + const r = (x: number) => 121 * k * k * Math.pow(x - (9 / 11), 2) + 1 - k * k; + const t = (x: number) => 484 * k * k * k * Math.pow(x - (10.5 / 11), 2) + 1 - k * k * k; + return (x: number) => Math.min(q(x), w(x), r(x), t(x)); } /** @@ -206,22 +209,22 @@ class Easing { /** * Runs an easing function forwards. */ - static in(easing) { + static in(easing: EasingFunction) { return easing; } /** * Runs an easing function backwards. */ - static out(easing) { - return t => 1 - easing(1 - t); + static out(easing: EasingFunction) { + return (t: number) => 1 - easing(1 - t); } /** * Makes any easing function symmetrical. The easing function will run * forwards for half of the duration, then backwards for the rest of the * duration. */ - static inOut(easing) { - return t => { + static inOut(easing: EasingFunction) { + return (t: number) => { if (t < 0.5) { return easing(t * 2) / 2; } @@ -232,11 +235,11 @@ class Easing { const quart = Easing.poly(4); const quint = Easing.poly(5); -const back = (direction, scalar, t) => +const back = (direction: EasingDirection, scalar: number, t: number) => direction(Easing.back(1.70158 * scalar))(t); -const elastic = (direction, bounciness, t) => +const elastic = (direction: EasingDirection, bounciness: number, t: number) => direction(Easing.elastic(bounciness))(t); -const bounce = (direction, bounciness, t) => +const bounce = (direction: EasingDirection, bounciness: number, t: number) => direction(Easing.bounce(bounciness))(t); export const easingFunctions = { @@ -277,14 +280,22 @@ export const easingFunctions = { easeInOutBounce: bounce.bind(null, Easing.inOut), }; +export type EasingKey = keyof typeof easingFunctions; + // Object with the same keys as easingFunctions and values of the stringified key names -export const EASING_OPTIONS = Object.fromEntries( +export const EASING_OPTIONS = Object.freeze(Object.fromEntries( Object.entries(easingFunctions).map(entry => ([entry[0], entry[0]])) -); -Object.freeze(EASING_OPTIONS); +) as { [Property in EasingKey]: string }); export const EASING_DEFAULT = 'linear'; -export const getEasingArgDefault = kf => { +export interface EasingProperties { + easing?: EasingKey | null; + easingArgs?: number[]; +} + +export type GeckolibKeyframe = _Keyframe & EasingProperties; + +export const getEasingArgDefault = (kf: GeckolibKeyframe): number => { switch (kf.easing) { case EASING_OPTIONS.easeInBack: case EASING_OPTIONS.easeOutBack: @@ -304,7 +315,7 @@ export const getEasingArgDefault = kf => { } }; -export const parseEasingArg = (kf, value) => { +export const parseEasingArg = (kf: GeckolibKeyframe, value: string) => { switch(kf.easing) { case EASING_OPTIONS.easeInBack: case EASING_OPTIONS.easeOutBack: @@ -322,3 +333,11 @@ export const parseEasingArg = (kf, value) => { return parseInt(value, 10); } }; + +export function reverseEasing(easing?: EasingKey): EasingKey { + if (!easing) return easing; + if (easing.startsWith("easeInOut")) return easing; + if (easing.startsWith("easeIn")) return easing.replace("easeIn", "easeOut") as EasingKey; + if (easing.startsWith("easeOut")) return easing.replace("easeOut", "easeIn") as EasingKey; + return easing; +} diff --git a/src/animation_utils/index.js b/plugins/animation_utils/src/index.ts similarity index 88% rename from src/animation_utils/index.js rename to plugins/animation_utils/src/index.ts index 3311d16f..613dead0 100644 --- a/src/animation_utils/index.js +++ b/plugins/animation_utils/src/index.ts @@ -1,25 +1,27 @@ import semverCoerce from 'semver/functions/coerce'; import semverSatisfies from 'semver/functions/satisfies'; -import { version, blockbenchConfig } from './package.json'; +import packageJson from './package.json'; import { loadAnimationUI, unloadAnimationUI } from './animationUi'; import { removeMonkeypatches } from './utils'; import { loadKeyframeOverrides, unloadKeyframeOverrides } from './keyframe'; import geckoSettings, { OBJ_TYPE_OPTIONS, onSettingsChanged, OBJ_TYPE_BLOCK_ITEM } from './settings'; import codec, { loadCodec, unloadCodec, maybeExportItemJson } from './codec'; +const { version, blockbenchConfig } = packageJson; + const SUPPORTED_BB_VERSION_RANGE = `${blockbenchConfig.min_version} - ${blockbenchConfig.max_version}`; if (!semverSatisfies(semverCoerce(Blockbench.version), SUPPORTED_BB_VERSION_RANGE)) { alert(`GeckoLib Animation Utils currently only supports Blockbench ${SUPPORTED_BB_VERSION_RANGE}. Please ensure you are using this version of Blockbench to avoid bugs and undefined behavior.`); } (function () { - let exportAction; - let exportDisplayAction; - let button; + let exportAction: Action; + let exportDisplayAction: Action; + let button: Action; - Plugin.register("animation_utils", Object.assign( + BBPlugin.register("animation_utils", Object.assign( {}, - blockbenchConfig, + blockbenchConfig as typeof blockbenchConfig & { variant: 'both' }, { name: blockbenchConfig.title, version, @@ -29,8 +31,7 @@ if (!semverSatisfies(semverCoerce(Blockbench.version), SUPPORTED_BB_VERSION_RANG loadAnimationUI(); loadKeyframeOverrides(); console.log("Loaded GeckoLib plugin") - exportAction = new Action({ - id: "export_geckolib_model", + exportAction = new Action("export_geckolib_model", { name: "Export GeckoLib Model", icon: "archive", description: @@ -43,8 +44,7 @@ if (!semverSatisfies(semverCoerce(Blockbench.version), SUPPORTED_BB_VERSION_RANG }); MenuBar.addAction(exportAction, "file.export"); - exportDisplayAction = new Action({ - id: "export_geckolib_display", + exportDisplayAction = new Action("export_geckolib_display", { name: "Export GeckoLib Display Settings", icon: "icon-bb_interface", description: @@ -61,7 +61,7 @@ if (!semverSatisfies(semverCoerce(Blockbench.version), SUPPORTED_BB_VERSION_RANG icon: 'info', condition: () => Format.id === "animated_entity_model", click: function () { - var dialog = new Dialog({ + const dialog = new Dialog({ id: 'project', title: 'GeckoLib Model Settings', width: 540, diff --git a/plugins/animation_utils/src/jest.config.js b/plugins/animation_utils/src/jest.config.js new file mode 100644 index 00000000..b413e106 --- /dev/null +++ b/plugins/animation_utils/src/jest.config.js @@ -0,0 +1,5 @@ +/** @type {import('ts-jest').JestConfigWithTsJest} */ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', +}; \ No newline at end of file diff --git a/plugins/animation_utils/src/keyframe.ts b/plugins/animation_utils/src/keyframe.ts new file mode 100644 index 00000000..161dd89a --- /dev/null +++ b/plugins/animation_utils/src/keyframe.ts @@ -0,0 +1,182 @@ +import groupBy from 'lodash/groupBy'; +import mapValues from 'lodash/mapValues'; +import {addMonkeypatch, hasArgs, Original} from './utils'; +import { + EASING_DEFAULT, + easingFunctions, + EasingProperties, + GeckolibKeyframe, + getEasingArgDefault, + reverseEasing +} from './easing'; +import Keyframe = Blockbench.Keyframe; + +//#region Keyframe Mixins +export function loadKeyframeOverrides() { + addMonkeypatch(Keyframe, "prototype", "getLerp", keyframeGetLerp); + addMonkeypatch(Keyframe, "prototype", "compileBedrockKeyframe", keyframeCompileBedrock); + addMonkeypatch(Keyframe, "prototype", "getUndoCopy", keyframeGetUndoCopy); + addMonkeypatch(Keyframe, "prototype", "extend", keyframeExtend); + + addMonkeypatch(BarItems.reverse_keyframes, null, "click", onReverseKeyframes); +} + +export function unloadKeyframeOverrides() { + //No-op for now since monkeypatches are unloaded automatically +} + +function lerp(start: number, stop: number, amt: number) { + return amt * (stop - start) + start; +} + +// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars +function keyframeGetLerp(other, axis, amount, allow_expression) { + const easing = other.easing || EASING_DEFAULT; + if (Format.id !== "animated_entity_model") { + return Original.get(Keyframe).getLerp.apply(this, arguments); + } + let easingFunc = easingFunctions[easing]; + if (hasArgs(easing)) { + const arg1 = Array.isArray(other.easingArgs) && other.easingArgs.length > 0 + ? other.easingArgs[0] + : getEasingArgDefault(other); + // console.log(`keyframeGetLerp arg1: ${arg1}`); + easingFunc = easingFunc.bind(null, arg1); + } + const easedAmount = easingFunc(amount); + const start = this.calc(axis); + const stop = other.calc(axis); + const result = lerp(start, stop, easedAmount); + // console.log('keyframeGetLerp easing:', easing, 'arguments:', arguments, 'start:', start, 'stop:', stop, 'amount:', amount, 'easedAmount:', easedAmount, 'result:', result); + if (Number.isNaN(result)) { + throw new Error('batman'); + } + return result; +} + +function geckolibGetArray(data_point: number = 0) { + const {easing, easingArgs, getArray} = this; + let result = getArray.apply(this, [data_point]); + if (Format.id === "animated_entity_model") { + + result = {vector: result, easing}; + if (hasArgs(easing)) result.easingArgs = easingArgs; + } + return result; +} + + +function keyframeCompileBedrock() { + if (Format.id !== "animated_entity_model" || !this.transform) { + return Original.get(Keyframe).compileBedrockKeyframe.apply(this, arguments); + } + + if (this.interpolation == 'catmullrom') { + const previous = this.getPreviousKeyframe.apply(this) + const include_pre = (!previous && this.time > 0) || (previous && previous.interpolation != 'catmullrom') + return { + pre: include_pre ? geckolibGetArray.call(this,[0]) : undefined, + post: geckolibGetArray.call(this,[include_pre ? 1 : 0]), + lerp_mode: this.interpolation, + } + } else if (this.data_points.length == 1) { + const previous = this.getPreviousKeyframe.apply(this); + if (previous && previous.interpolation == 'step') { + return new oneLiner({ + pre: geckolibGetArray.call(previous, [1]), + post: geckolibGetArray.call(this), + }) + } else { + return geckolibGetArray.call(this); + } + } else { + return new oneLiner({ + pre: geckolibGetArray.call(this,[0]), + post: geckolibGetArray.call(this, [1]), + }) + } +} + +function keyframeGetUndoCopy() { + const {easing, easingArgs} = this; + const result = Original.get(Keyframe).getUndoCopy.apply(this, arguments); + if (Format.id === "animated_entity_model") { + Object.assign(result, {easing}); + if (hasArgs(easing)) result.easingArgs = easingArgs; + } +// console.log('keyframeGetUndoCopy arguments:', arguments, 'this:', this, 'result:', result); + return result; +} + +function keyframeExtend(dataIn) { + const data = Object.assign({}, dataIn); +// console.log('keyframeExtend 1 arguments:', arguments); + if (Format.id === "animated_entity_model") { + if (typeof data.values === 'object') { + if (data.values.easing !== undefined) { + Merge.string(this, data.values, 'easing'); + } + if (Array.isArray(data.values.easingArgs)) { + this.easingArgs = data.values.easingArgs; + } + if (!Array.isArray(data.values) && Array.isArray(data.values.vector)) { + // Convert data to format expected by KeyframeExtendOriginal + data.values = data.values.vector; + } + } else { + if (data.easing !== undefined) { + Merge.string(this, data, 'easing'); + } + if (Array.isArray(data.easingArgs)) { + this.easingArgs = data.easingArgs; + } + } + } + const result = Original.get(Keyframe).extend.apply(this, arguments); +// console.log('keyframeExtend 2 arguments:', arguments, 'this:', this, 'result:', result); + return result; +} + +function onReverseKeyframes() { + Original.get(BarItems.reverse_keyframes).click.apply(this, arguments); + // console.log('@@@ onReverseKeyframes selected:', Timeline.selected); + // There's not really an easy way to merge our undo operation with the original one so we'll make a new one instead + Undo.initEdit({keyframes: Timeline.selected}) + const kfByAnimator = groupBy(Timeline.selected, kf => kf.animator.uuid); + const kfByAnimatorAndChannel = mapValues( + kfByAnimator, + keyframesForAnimator => groupBy(keyframesForAnimator, kf => kf.channel) + ); + Object.keys(kfByAnimatorAndChannel).forEach(animatorUuid => { + const animatorChannelGroups = kfByAnimatorAndChannel[animatorUuid]; + Object.keys(animatorChannelGroups).forEach(channel => { + const channelKeyframes = animatorChannelGroups[channel]; + // Ensure keyframes are in temporal order. Not sure if this is already the case, but it couldn't hurt + channelKeyframes.sort((kfA, kfB) => kfA.time - kfB.time); + // Reverse easing direction + const easingData: EasingProperties[] = channelKeyframes.map((kf: GeckolibKeyframe) => ({ + easing: reverseEasing(kf.easing), + easingArgs: kf.easingArgs + })); + // console.log('@@@ onReverseKeyframes PRE animator:', animatorUuid, 'channel:', channel, 'channelKeyframes:', channelKeyframes, 'easingData:', easingData); + // Shift easing data to the right by one keyframe + channelKeyframes.forEach((kf: GeckolibKeyframe, i: number) => { + if (i == 0) { + kf.easing = undefined; + kf.easingArgs = undefined; + return; + } + const newEasingData = easingData[i - 1]; + kf.easing = newEasingData.easing; + kf.easingArgs = newEasingData.easingArgs; + }); + // console.log('@@@ onReverseKeyframes POST animator:', animatorUuid, 'channel:', channel, 'channelKeyframes:', channelKeyframes); + }); + }); + // console.log('@@@ kfByAnimator:', kfByAnimator, "\nkfByAnimatorAndChannel:", kfByAnimatorAndChannel); + Undo.finishEdit('Reverse keyframe easing') + updateKeyframeSelection(); + Animator.preview(); +} + +//#endregion Keyframe Mixins \ No newline at end of file diff --git a/plugins/animation_utils/src/package-lock.json b/plugins/animation_utils/src/package-lock.json new file mode 100644 index 00000000..23f4efdd --- /dev/null +++ b/plugins/animation_utils/src/package-lock.json @@ -0,0 +1,13137 @@ +{ + "name": "animation_utils", + "version": "3.1.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "animation_utils", + "version": "3.1.0", + "license": "MIT", + "dependencies": { + "lodash": "^4.17.21", + "semver": "7.3.2" + }, + "devDependencies": { + "@types/jest": "^29.5.4", + "@types/lodash": "^4.14.197", + "@typescript-eslint/eslint-plugin": "^6.5.0", + "@typescript-eslint/parser": "^6.5.0", + "blockbench-types": "^4.9.0", + "eol": "0.9.1", + "eslint": "^7.7.0", + "indent-string": "^5.0.0", + "jest": "^29.6.4", + "ts-jest": "^29.1.1", + "ts-loader": "^9.4.4", + "typescript": "^4.9.5", + "webpack": "^5.88.2", + "webpack-cli": "^5.1.4" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", + "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.9.tgz", + "integrity": "sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.11.tgz", + "integrity": "sha512-lh7RJrtPdhibbxndr6/xx0w8+CVlY5FJZiaSz908Fpy+G0xkBFTvwLcKJFF4PJxVfGhVWNebikpWGnOoC71juQ==", + "dev": true, + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.22.10", + "@babel/generator": "^7.22.10", + "@babel/helper-compilation-targets": "^7.22.10", + "@babel/helper-module-transforms": "^7.22.9", + "@babel/helpers": "^7.22.11", + "@babel/parser": "^7.22.11", + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.11", + "@babel/types": "^7.22.11", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.10.tgz", + "integrity": "sha512-79KIf7YiWjjdZ81JnLujDRApWtl7BxTqWD88+FFdQEIOG8LJ0etDOM7CXuIgGJa55sGOwZVwuEsaLEm0PJ5/+A==", + "dev": true, + "dependencies": { + "@babel/types": "^7.22.10", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.10.tgz", + "integrity": "sha512-JMSwHD4J7SLod0idLq5PKgI+6g/hLD/iuWBq08ZX49xE14VpVEojJ5rHWptpirV2j020MvypRLAXAO50igCJ5Q==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.22.9", + "@babel/helper-validator-option": "^7.22.5", + "browserslist": "^4.21.9", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-environment-visitor": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz", + "integrity": "sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", + "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", + "dev": true, + "dependencies": { + "@babel/template": "^7.22.5", + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz", + "integrity": "sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.9.tgz", + "integrity": "sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ==", + "dev": true, + "dependencies": { + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-module-imports": "^7.22.5", + "@babel/helper-simple-access": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/helper-validator-identifier": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", + "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", + "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", + "dev": true, + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", + "dev": true, + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", + "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz", + "integrity": "sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.11.tgz", + "integrity": "sha512-vyOXC8PBWaGc5h7GMsNx68OH33cypkEDJCHvYVVgVbbxJDROYVtexSk0gK5iCF1xNjRIN2s8ai7hwkWDq5szWg==", + "dev": true, + "dependencies": { + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.11", + "@babel/types": "^7.22.11" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.13.tgz", + "integrity": "sha512-C/BaXcnnvBCmHTpz/VGZ8jgtE2aYlW4hxDhseJAWZb7gqGM/qtCK6iZUb0TyKFf7BOUsBH7Q7fkRsDRhg1XklQ==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.22.5", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.13.tgz", + "integrity": "sha512-3l6+4YOvc9wx7VlCSw4yQfcBo01ECA8TicQfbnCPuCEpRQrf+gTUyGdxNw+pyTUyywp6JRD1w0YQs9TpBXYlkw==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz", + "integrity": "sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz", + "integrity": "sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz", + "integrity": "sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.22.5", + "@babel/parser": "^7.22.5", + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.11.tgz", + "integrity": "sha512-mzAenteTfomcB7mfPtyi+4oe5BZ6MXxWcn4CX+h4IRJ+OOGXBrWU6jDQavkQI9Vuc5P+donFabBfFCcmWka9lQ==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.22.10", + "@babel/generator": "^7.22.10", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.22.11", + "@babel/types": "^7.22.11", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/types": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.11.tgz", + "integrity": "sha512-siazHiGuZRz9aB9NpHy9GOs9xiQPKnMzgdr493iI1M67vRXpnEq8ZOOKzezC5q7zwuQ6sDhdSp4SD9ixKSqKZg==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.5", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "node_modules/@discoveryjs/json-ext": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", + "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.8.0.tgz", + "integrity": "sha512-JylOEEzDiOryeUnFbQz+oViCXS0KsvR1mvHkoMiu5+UiBvy+RYX7tzlIIIEstF/gVa2tj9AQXk3dgnxv6KxhFg==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/console": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.6.4.tgz", + "integrity": "sha512-wNK6gC0Ha9QeEPSkeJedQuTQqxZYnDPuDcDhVuVatRvMkL4D0VTvFVZj+Yuh6caG2aOfzkUZ36KtCmLNtR02hw==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^29.6.3", + "jest-util": "^29.6.3", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/console/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/console/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/console/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/console/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/@jest/console/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/core": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.6.4.tgz", + "integrity": "sha512-U/vq5ccNTSVgYH7mHnodHmCffGWHJnz/E1BEWlLuK5pM4FZmGfBn/nrJGLjUsSmyx3otCeqc1T31F4y08AMDLg==", + "dev": true, + "dependencies": { + "@jest/console": "^29.6.4", + "@jest/reporters": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.6.3", + "jest-config": "^29.6.4", + "jest-haste-map": "^29.6.4", + "jest-message-util": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.6.4", + "jest-resolve-dependencies": "^29.6.4", + "jest-runner": "^29.6.4", + "jest-runtime": "^29.6.4", + "jest-snapshot": "^29.6.4", + "jest-util": "^29.6.3", + "jest-validate": "^29.6.3", + "jest-watcher": "^29.6.4", + "micromatch": "^4.0.4", + "pretty-format": "^29.6.3", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/core/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/core/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/core/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/core/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/core/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/@jest/core/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/core/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/environment": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.6.4.tgz", + "integrity": "sha512-sQ0SULEjA1XUTHmkBRl7A1dyITM9yb1yb3ZNKPX3KlTd6IG7mWUe3e2yfExtC2Zz1Q+mMckOLHmL/qLiuQJrBQ==", + "dev": true, + "dependencies": { + "@jest/fake-timers": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.6.4.tgz", + "integrity": "sha512-Warhsa7d23+3X5bLbrbYvaehcgX5TLYhI03JKoedTiI8uJU4IhqYBWF7OSSgUyz4IgLpUYPkK0AehA5/fRclAA==", + "dev": true, + "dependencies": { + "expect": "^29.6.4", + "jest-snapshot": "^29.6.4" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect-utils": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.6.4.tgz", + "integrity": "sha512-FEhkJhqtvBwgSpiTrocquJCdXPsyvNKcl/n7A3u7X4pVoF4bswm11c9d4AV+kfq2Gpv/mM8x7E7DsRvH+djkrg==", + "dev": true, + "dependencies": { + "jest-get-type": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/fake-timers": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.6.4.tgz", + "integrity": "sha512-6UkCwzoBK60edXIIWb0/KWkuj7R7Qq91vVInOe3De6DSpaEiqjKcJw4F7XUet24Wupahj9J6PlR09JqJ5ySDHw==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.6.3", + "jest-mock": "^29.6.3", + "jest-util": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/globals": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.6.4.tgz", + "integrity": "sha512-wVIn5bdtjlChhXAzVXavcY/3PEjf4VqM174BM3eGL5kMxLiZD5CLnbmkEyA1Dwh9q8XjP6E8RwjBsY/iCWrWsA==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.6.4", + "@jest/expect": "^29.6.4", + "@jest/types": "^29.6.3", + "jest-mock": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/reporters": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.6.4.tgz", + "integrity": "sha512-sxUjWxm7QdchdrD3NfWKrL8FBsortZeibSJv4XLjESOOjSUOkjQcb0ZHJwfhEGIvBvTluTzfG2yZWZhkrXJu8g==", + "dev": true, + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.6.3", + "jest-util": "^29.6.3", + "jest-worker": "^29.6.4", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/reporters/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/reporters/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/reporters/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/reporters/node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/reporters/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/reporters/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/@jest/reporters/node_modules/jest-worker": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.6.4.tgz", + "integrity": "sha512-6dpvFV4WjcWbDVGgHTWo/aupl8/LbBx2NSKfiwqf79xC/yeJjKHT1+StcKy/2KTmW16hE68ccKVOtXf+WZGz7Q==", + "dev": true, + "dependencies": { + "@types/node": "*", + "jest-util": "^29.6.3", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/reporters/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/source-map": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-result": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.6.4.tgz", + "integrity": "sha512-uQ1C0AUEN90/dsyEirgMLlouROgSY+Wc/JanVVk0OiUKa5UFh7sJpMEM3aoUBAz2BRNvUJ8j3d294WFuRxSyOQ==", + "dev": true, + "dependencies": { + "@jest/console": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-sequencer": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.6.4.tgz", + "integrity": "sha512-E84M6LbpcRq3fT4ckfKs9ryVanwkaIB0Ws9bw3/yP4seRLg/VaCZ/LgW0MCq5wwk4/iP/qnilD41aj2fsw2RMg==", + "dev": true, + "dependencies": { + "@jest/test-result": "^29.6.4", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.6.4", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/transform": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.6.4.tgz", + "integrity": "sha512-8thgRSiXUqtr/pPGY/OsyHuMjGyhVnWrFAwoxmIemlBuiMyU1WFs0tXoNxzcr4A4uErs/ABre76SGmrr5ab/AA==", + "dev": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.6.4", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.6.3", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/transform/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/transform/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/transform/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/transform/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/@jest/transform/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/types/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/types/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/types/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/types/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/@jest/types/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", + "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", + "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, + "node_modules/@sinonjs/commons": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", + "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", + "dev": true, + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "node_modules/@tweenjs/tween.js": { + "version": "18.6.4", + "resolved": "https://registry.npmjs.org/@tweenjs/tween.js/-/tween.js-18.6.4.tgz", + "integrity": "sha512-lB9lMjuqjtuJrx7/kOkqQBtllspPIN+96OvTCeJ2j5FEzinoAXTdAMFnDAQT1KVPRlnYfBrqxtqP66vDM40xxQ==", + "dev": true + }, + "node_modules/@types/babel__core": { + "version": "7.20.1", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.1.tgz", + "integrity": "sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", + "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", + "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.20.1", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.1.tgz", + "integrity": "sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.20.7" + } + }, + "node_modules/@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, + "node_modules/@types/eslint": { + "version": "8.44.2", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.2.tgz", + "integrity": "sha512-sdPRb9K6iL5XZOmBubg8yiFp5yS/JdUDQsq5e6h95km91MCYMuvp7mh1fjPEYUhvHepKpZOjnEaMBR4PxjWDzg==", + "dev": true, + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/eslint-scope": { + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz", + "integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==", + "dev": true, + "dependencies": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", + "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", + "dev": true + }, + "node_modules/@types/graceful-fs": { + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.6.tgz", + "integrity": "sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "dev": true + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/jest": { + "version": "29.5.4", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.4.tgz", + "integrity": "sha512-PhglGmhWeD46FYOVLt3X7TiWjzwuVGW9wG/4qocPevXMjCmrIc5b6db9WjeGE4QYVpUAWMDv3v0IiBwObY289A==", + "dev": true, + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, + "node_modules/@types/jquery": { + "version": "3.5.16", + "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.16.tgz", + "integrity": "sha512-bsI7y4ZgeMkmpG9OM710RRzDFp+w4P1RGiIt30C1mSBT+ExCleeh4HObwgArnDFELmRrOpXgSYN9VF1hj+f1lw==", + "dev": true, + "dependencies": { + "@types/sizzle": "*" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.12", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", + "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", + "dev": true + }, + "node_modules/@types/lodash": { + "version": "4.14.197", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.197.tgz", + "integrity": "sha512-BMVOiWs0uNxHVlHBgzTIqJYmj+PgCo4euloGF+5m4okL3rEYzM2EEv78mw8zWSMM57dM7kVIgJ2QDvwHSoCI5g==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.5.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.1.tgz", + "integrity": "sha512-4tT2UrL5LBqDwoed9wZ6N3umC4Yhz3W3FloMmiiG4JwmUJWpie0c7lcnUNd4gtMKuDEO4wRVS8B6Xa0uMRsMKg==", + "dev": true + }, + "node_modules/@types/semver": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-cJRQXpObxfNKkFAZbJl2yjWtJCqELQIdShsogr1d2MilP8dKD9TE/nEKHkJgUNHdGKCQaf9HbIynuV2csLGVLg==", + "dev": true + }, + "node_modules/@types/sizzle": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.3.tgz", + "integrity": "sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ==", + "dev": true + }, + "node_modules/@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "dev": true + }, + "node_modules/@types/stats.js": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@types/stats.js/-/stats.js-0.17.0.tgz", + "integrity": "sha512-9w+a7bR8PeB0dCT/HBULU2fMqf6BAzvKbxFboYhmDtDkKPiyXYbjoe2auwsXlEFI7CFNMF1dCv3dFH5Poy9R1w==", + "dev": true + }, + "node_modules/@types/three": { + "version": "0.155.0", + "resolved": "https://registry.npmjs.org/@types/three/-/three-0.155.0.tgz", + "integrity": "sha512-IzdbqXsGsbG0flvq9D5L9pZRwySQQps2bGcizLYEsfvK3dM+B0sqKR6S+xAOXbouXemfDmHttrcQjVOM46YnAw==", + "dev": true, + "dependencies": { + "@tweenjs/tween.js": "~18.6.4", + "@types/stats.js": "*", + "@types/webxr": "*", + "fflate": "~0.6.9", + "lil-gui": "~0.17.0", + "meshoptimizer": "~0.18.1" + } + }, + "node_modules/@types/tinycolor2": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/@types/tinycolor2/-/tinycolor2-1.4.3.tgz", + "integrity": "sha512-Kf1w9NE5HEgGxCRyIcRXR/ZYtDv0V8FVPtYHwLxl0O+maGX0erE77pQlD0gpP+/KByMZ87mOA79SjifhSB3PjQ==", + "dev": true + }, + "node_modules/@types/webxr": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@types/webxr/-/webxr-0.5.3.tgz", + "integrity": "sha512-orrXqFCuuRE5hMuwLZhPaQrukAZxpkMzNJHmKCNJ16XT5yiR5iNBLNdn+xONbfzU2XAXTZR0GA2R99ciUd/2hg==", + "dev": true + }, + "node_modules/@types/yargs": { + "version": "17.0.24", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", + "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", + "dev": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", + "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", + "dev": true + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.5.0.tgz", + "integrity": "sha512-2pktILyjvMaScU6iK3925uvGU87E+N9rh372uGZgiMYwafaw9SXq86U04XPq3UH6tzRvNgBsub6x2DacHc33lw==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.5.0", + "@typescript-eslint/type-utils": "6.5.0", + "@typescript-eslint/utils": "6.5.0", + "@typescript-eslint/visitor-keys": "6.5.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/@typescript-eslint/parser": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.5.0.tgz", + "integrity": "sha512-LMAVtR5GN8nY0G0BadkG0XIe4AcNMeyEy3DyhKGAh9k4pLSMBO7rF29JvDBpZGCmp5Pgz5RLHP6eCpSYZJQDuQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "6.5.0", + "@typescript-eslint/types": "6.5.0", + "@typescript-eslint/typescript-estree": "6.5.0", + "@typescript-eslint/visitor-keys": "6.5.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.5.0.tgz", + "integrity": "sha512-A8hZ7OlxURricpycp5kdPTH3XnjG85UpJS6Fn4VzeoH4T388gQJ/PGP4ole5NfKt4WDVhmLaQ/dBLNDC4Xl/Kw==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.5.0", + "@typescript-eslint/visitor-keys": "6.5.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.5.0.tgz", + "integrity": "sha512-f7OcZOkRivtujIBQ4yrJNIuwyCQO1OjocVqntl9dgSIZAdKqicj3xFDqDOzHDlGCZX990LqhLQXWRnQvsapq8A==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "6.5.0", + "@typescript-eslint/utils": "6.5.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.5.0.tgz", + "integrity": "sha512-eqLLOEF5/lU8jW3Bw+8auf4lZSbbljHR2saKnYqON12G/WsJrGeeDHWuQePoEf9ro22+JkbPfWQwKEC5WwLQ3w==", + "dev": true, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.5.0.tgz", + "integrity": "sha512-q0rGwSe9e5Kk/XzliB9h2LBc9tmXX25G0833r7kffbl5437FPWb2tbpIV9wAATebC/018pGa9fwPDuvGN+LxWQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.5.0", + "@typescript-eslint/visitor-keys": "6.5.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/@typescript-eslint/utils": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.5.0.tgz", + "integrity": "sha512-9nqtjkNykFzeVtt9Pj6lyR9WEdd8npPhhIPM992FWVkZuS6tmxHfGVnlUcjpUP2hv8r4w35nT33mlxd+Be1ACQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.5.0", + "@typescript-eslint/types": "6.5.0", + "@typescript-eslint/typescript-estree": "6.5.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.5.0.tgz", + "integrity": "sha512-yCB/2wkbv3hPsh02ZS8dFQnij9VVQXJMN/gbQsaaY+zxALkZnxa/wagvLEFsAWMPv7d7lxQmNsIzGU1w/T/WyA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.5.0", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "2.7.14", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-2.7.14.tgz", + "integrity": "sha512-aNmNHyLPsw+sVvlQFQ2/8sjNuLtK54TC6cuKnVzAY93ks4ZBrvwQSnkkIh7bsbNhum5hJBS00wSDipQ937f5DA==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.18.4", + "postcss": "^8.4.14", + "source-map": "^0.6.1" + } + }, + "node_modules/@webassemblyjs/ast": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", + "integrity": "sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==", + "dev": true, + "dependencies": { + "@webassemblyjs/helper-numbers": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6" + } + }, + "node_modules/@webassemblyjs/floating-point-hex-parser": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", + "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-api-error": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", + "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-buffer": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz", + "integrity": "sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-numbers": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", + "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", + "dev": true, + "dependencies": { + "@webassemblyjs/floating-point-hex-parser": "1.11.6", + "@webassemblyjs/helper-api-error": "1.11.6", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/helper-wasm-bytecode": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", + "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-wasm-section": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz", + "integrity": "sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/wasm-gen": "1.11.6" + } + }, + "node_modules/@webassemblyjs/ieee754": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", + "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", + "dev": true, + "dependencies": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "node_modules/@webassemblyjs/leb128": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", + "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", + "dev": true, + "dependencies": { + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/utf8": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", + "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", + "dev": true + }, + "node_modules/@webassemblyjs/wasm-edit": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz", + "integrity": "sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/helper-wasm-section": "1.11.6", + "@webassemblyjs/wasm-gen": "1.11.6", + "@webassemblyjs/wasm-opt": "1.11.6", + "@webassemblyjs/wasm-parser": "1.11.6", + "@webassemblyjs/wast-printer": "1.11.6" + } + }, + "node_modules/@webassemblyjs/wasm-gen": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz", + "integrity": "sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" + } + }, + "node_modules/@webassemblyjs/wasm-opt": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz", + "integrity": "sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/wasm-gen": "1.11.6", + "@webassemblyjs/wasm-parser": "1.11.6" + } + }, + "node_modules/@webassemblyjs/wasm-parser": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz", + "integrity": "sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-api-error": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" + } + }, + "node_modules/@webassemblyjs/wast-printer": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz", + "integrity": "sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.6", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webpack-cli/configtest": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.1.1.tgz", + "integrity": "sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw==", + "dev": true, + "engines": { + "node": ">=14.15.0" + }, + "peerDependencies": { + "webpack": "5.x.x", + "webpack-cli": "5.x.x" + } + }, + "node_modules/@webpack-cli/info": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-2.0.2.tgz", + "integrity": "sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A==", + "dev": true, + "engines": { + "node": ">=14.15.0" + }, + "peerDependencies": { + "webpack": "5.x.x", + "webpack-cli": "5.x.x" + } + }, + "node_modules/@webpack-cli/serve": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.5.tgz", + "integrity": "sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ==", + "dev": true, + "engines": { + "node": ">=14.15.0" + }, + "peerDependencies": { + "webpack": "5.x.x", + "webpack-cli": "5.x.x" + }, + "peerDependenciesMeta": { + "webpack-dev-server": { + "optional": true + } + } + }, + "node_modules/@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true + }, + "node_modules/@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true + }, + "node_modules/acorn": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", + "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", + "dev": true, + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/babel-jest": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.6.4.tgz", + "integrity": "sha512-meLj23UlSLddj6PC+YTOFRgDAtjnZom8w/ACsrx0gtPtv5cJZk0A5Unk5bV4wixD7XaPCN1fQvpww8czkZURmw==", + "dev": true, + "dependencies": { + "@jest/transform": "^29.6.4", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, + "node_modules/babel-jest/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/babel-jest/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/babel-jest/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/babel-jest/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/babel-jest/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "dev": true, + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", + "dev": true, + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/babel-preset-current-node-syntax": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", + "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", + "dev": true, + "dependencies": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.8.3", + "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/babel-preset-jest": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "dev": true, + "dependencies": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "node_modules/blockbench-types": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/blockbench-types/-/blockbench-types-4.9.0.tgz", + "integrity": "sha512-Vc7qMuYnQSYhwxiuyAf5hYUUBc7CuIqAyWWTO5XsE97eTY2IJ/nSYMvNsPCmwb9sdGXB1OP4G7vBq4mY9XbNAQ==", + "dev": true, + "dependencies": { + "@types/jquery": "^3.5.4", + "@types/three": "^0.155.0", + "@types/tinycolor2": "^1.4.3", + "three": "^0.129.0", + "typescript": "^4.9.5", + "vue": "^2.6.14", + "wintersky": "^1.2.1" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.21.10", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz", + "integrity": "sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001517", + "electron-to-chromium": "^1.4.477", + "node-releases": "^2.0.13", + "update-browserslist-db": "^1.0.11" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/bs-logger": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", + "dev": true, + "dependencies": { + "fast-json-stable-stringify": "2.x" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001522", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001522.tgz", + "integrity": "sha512-TKiyTVZxJGhsTszLuzb+6vUZSjVOAhClszBr2Ta2k9IwtNBT/4dzmL6aywt0HCgEZlmwJzXJd8yNiob6HgwTRg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/chrome-trace-event": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz", + "integrity": "sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ==", + "dev": true, + "dependencies": { + "tslib": "^1.9.0" + }, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/ci-info": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", + "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } + }, + "node_modules/cjs-module-lexer": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", + "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", + "dev": true + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/cliui/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "dependencies": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", + "dev": true + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/csstype": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", + "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==", + "dev": true + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/dedent": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", + "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", + "dev": true, + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.4.496", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.496.tgz", + "integrity": "sha512-qeXC3Zbykq44RCrBa4kr8v/dWzYJA8rAwpyh9Qd+NKWoJfjG5vvJqy9XOJ9H4P/lqulZBCgUWAYi+FeK5AuJ8g==", + "dev": true + }, + "node_modules/emittery": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, + "node_modules/emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "node_modules/enhanced-resolve": { + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", + "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "dependencies": { + "ansi-colors": "^4.1.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/envinfo": { + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.10.0.tgz", + "integrity": "sha512-ZtUjZO6l5mwTHvc1L9+1q5p/R3wTopcfqMW8r5t8SJSKqeVI/LtajORwRFEKpEFuekjD0VBjwu1HMxL4UalIRw==", + "dev": true, + "bin": { + "envinfo": "dist/cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eol": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/eol/-/eol-0.9.1.tgz", + "integrity": "sha512-Ds/TEoZjwggRoz/Q2O7SE3i4Jm66mqTDfmdHdq/7DKVk3bro9Q8h6WdXKdPqFLMoqxrDK5SVRzHVPOS6uuGtrg==", + "dev": true + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-module-lexer": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.3.0.tgz", + "integrity": "sha512-vZK7T0N2CBmBOixhmjdqx2gWVbFZ4DXZ/NyRMZVlJXPa7CyFS+/a4QQsDGDQy9ZfEzxFuNEsMLeQJnKP2p5/JA==", + "dev": true + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eslint": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.7.0.tgz", + "integrity": "sha512-1KUxLzos0ZVsyL81PnRN335nDtQ8/vZUD6uMtWbF+5zDtjKcsklIi78XoE0MVL93QvWTu+E5y44VyyCsOMBrIg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.0", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^1.3.0", + "espree": "^7.2.0", + "esquery": "^1.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint/node_modules/ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "dependencies": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/eslint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/eslint/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/eslint/node_modules/strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/espree": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.2.0.tgz", + "integrity": "sha512-H+cQ3+3JYRMEIOl87e7QdHX70ocly5iW4+dttuR8iYSPr/hXKFb+7dBsZ7+u1adC4VrnPlTkv0+OwuPnDop19g==", + "dev": true, + "dependencies": { + "acorn": "^7.3.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.3.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/espree/node_modules/acorn": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.0.tgz", + "integrity": "sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esquery/node_modules/estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/expect": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.6.4.tgz", + "integrity": "sha512-F2W2UyQ8XYyftHT57dtfg8Ue3X5qLgm2sSug0ivvLRH/VKNRL/pDxg/TH7zVzbQB0tu80clNFy6LU7OS/VSEKA==", + "dev": true, + "dependencies": { + "@jest/expect-utils": "^29.6.4", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.6.4", + "jest-message-util": "^29.6.3", + "jest-util": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", + "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "node_modules/fastest-levenshtein": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", + "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", + "dev": true, + "engines": { + "node": ">= 4.9.1" + } + }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fb-watchman": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", + "dev": true, + "dependencies": { + "bser": "2.1.1" + } + }, + "node_modules/fflate": { + "version": "0.6.10", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.6.10.tgz", + "integrity": "sha512-IQrh3lEPM93wVCEczc9SaAOvkmcoQn/G8Bo1e8ZPlY3X3bnAxWaBdvTdvM1hP62iZp0BXWDy4vTAy4fF0+Dlpg==", + "dev": true + }, + "node_modules/file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "dependencies": { + "flat-cache": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "dependencies": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/flat-cache/node_modules/rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true + }, + "node_modules/globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "dependencies": { + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby/node_modules/ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/import-local": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", + "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", + "dev": true, + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/interpret": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz", + "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", + "dev": true, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-core-module": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.0.tgz", + "integrity": "sha512-x58orMzEVfzPUKqlbLd1hXCnySCxKdDKa6Rjg97CwuLLRI4g3FHTdnExu1OqffVFay6zeMW+T6/DowFLndWnIw==", + "dev": true, + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-instrument/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-instrument/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-instrument/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", + "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", + "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.6.4.tgz", + "integrity": "sha512-tEFhVQFF/bzoYV1YuGyzLPZ6vlPrdfvDmmAxudA1dLEuiztqg2Rkx20vkKY32xiDROcD2KXlgZ7Cu8RPeEHRKw==", + "dev": true, + "dependencies": { + "@jest/core": "^29.6.4", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.6.4" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-changed-files": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.6.3.tgz", + "integrity": "sha512-G5wDnElqLa4/c66ma5PG9eRjE342lIbF6SUnTJi26C3J28Fv2TVY2rOyKB9YGbSA5ogwevgmxc4j4aVjrEK6Yg==", + "dev": true, + "dependencies": { + "execa": "^5.0.0", + "jest-util": "^29.6.3", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-changed-files/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-circus": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.6.4.tgz", + "integrity": "sha512-YXNrRyntVUgDfZbjXWBMPslX1mQ8MrSG0oM/Y06j9EYubODIyHWP8hMUbjbZ19M3M+zamqEur7O80HODwACoJw==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.6.4", + "@jest/expect": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.6.3", + "jest-matcher-utils": "^29.6.4", + "jest-message-util": "^29.6.3", + "jest-runtime": "^29.6.4", + "jest-snapshot": "^29.6.4", + "jest-util": "^29.6.3", + "p-limit": "^3.1.0", + "pretty-format": "^29.6.3", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-circus/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-circus/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-circus/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-circus/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-circus/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-circus/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-cli": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.6.4.tgz", + "integrity": "sha512-+uMCQ7oizMmh8ZwRfZzKIEszFY9ksjjEQnTEMTaL7fYiL3Kw4XhqT9bYh+A4DQKUb67hZn2KbtEnDuHvcgK4pQ==", + "dev": true, + "dependencies": { + "@jest/core": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "import-local": "^3.0.2", + "jest-config": "^29.6.4", + "jest-util": "^29.6.3", + "jest-validate": "^29.6.3", + "prompts": "^2.0.1", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-cli/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-cli/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-cli/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-cli/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-cli/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-config": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.6.4.tgz", + "integrity": "sha512-JWohr3i9m2cVpBumQFv2akMEnFEPVOh+9L2xIBJhJ0zOaci2ZXuKJj0tgMKQCBZAKA09H049IR4HVS/43Qb19A==", + "dev": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.6.4", + "@jest/types": "^29.6.3", + "babel-jest": "^29.6.4", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.6.4", + "jest-environment-node": "^29.6.4", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.6.4", + "jest-runner": "^29.6.4", + "jest-util": "^29.6.3", + "jest-validate": "^29.6.3", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.6.3", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/jest-config/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-config/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-config/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-config/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-config/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-diff": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.6.4.tgz", + "integrity": "sha512-9F48UxR9e4XOEZvoUXEHSWY4qC4zERJaOfrbBg9JpbJOO43R1vN76REt/aMGZoY6GD5g84nnJiBIVlscegefpw==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-diff/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-diff/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-diff/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-diff/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-diff/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-docblock": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.6.3.tgz", + "integrity": "sha512-2+H+GOTQBEm2+qFSQ7Ma+BvyV+waiIFxmZF5LdpBsAEjWX8QYjSCa4FrkIYtbfXUJJJnFCYrOtt6TZ+IAiTjBQ==", + "dev": true, + "dependencies": { + "detect-newline": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.6.3.tgz", + "integrity": "sha512-KoXfJ42k8cqbkfshW7sSHcdfnv5agDdHCPA87ZBdmHP+zJstTJc0ttQaJ/x7zK6noAL76hOuTIJ6ZkQRS5dcyg==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.6.3", + "pretty-format": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-each/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-each/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-each/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-each/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-environment-node": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.6.4.tgz", + "integrity": "sha512-i7SbpH2dEIFGNmxGCpSc2w9cA4qVD+wfvg2ZnfQ7XVrKL0NA5uDVBIiGH8SR4F0dKEv/0qI5r+aDomDf04DpEQ==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.6.4", + "@jest/fake-timers": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.6.3", + "jest-util": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-haste-map": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.6.4.tgz", + "integrity": "sha512-12Ad+VNTDHxKf7k+M65sviyynRoZYuL1/GTuhEVb8RYsNSNln71nANRb/faSyWvx0j+gHcivChXHIoMJrGYjog==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.6.3", + "jest-worker": "^29.6.4", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "node_modules/jest-haste-map/node_modules/jest-worker": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.6.4.tgz", + "integrity": "sha512-6dpvFV4WjcWbDVGgHTWo/aupl8/LbBx2NSKfiwqf79xC/yeJjKHT1+StcKy/2KTmW16hE68ccKVOtXf+WZGz7Q==", + "dev": true, + "dependencies": { + "@types/node": "*", + "jest-util": "^29.6.3", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-leak-detector": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.6.3.tgz", + "integrity": "sha512-0kfbESIHXYdhAdpLsW7xdwmYhLf1BRu4AA118/OxFm0Ho1b2RcTmO4oF6aAMaxpxdxnJ3zve2rgwzNBD4Zbm7Q==", + "dev": true, + "dependencies": { + "jest-get-type": "^29.6.3", + "pretty-format": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.6.4.tgz", + "integrity": "sha512-KSzwyzGvK4HcfnserYqJHYi7sZVqdREJ9DMPAKVbS98JsIAvumihaNUbjrWw0St7p9IY7A9UskCW5MYlGmBQFQ==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^29.6.4", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-matcher-utils/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-matcher-utils/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-matcher-utils/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-matcher-utils/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-message-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.6.3.tgz", + "integrity": "sha512-FtzaEEHzjDpQp51HX4UMkPZjy46ati4T5pEMyM6Ik48ztu4T9LQplZ6OsimHx7EuM9dfEh5HJa6D3trEftu3dA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.6.3", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-message-util/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-message-util/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-message-util/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-message-util/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-message-util/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-mock": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.6.3.tgz", + "integrity": "sha512-Z7Gs/mOyTSR4yPsaZ72a/MtuK6RnC3JYqWONe48oLaoEcYwEDxqvbXz85G4SJrm2Z5Ar9zp6MiHF4AlFlRM4Pg==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-pnp-resolver": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", + "dev": true, + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } + } + }, + "node_modules/jest-regex-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.6.4.tgz", + "integrity": "sha512-fPRq+0vcxsuGlG0O3gyoqGTAxasagOxEuyoxHeyxaZbc9QNek0AmJWSkhjlMG+mTsj+8knc/mWb3fXlRNVih7Q==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.6.4", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.6.3", + "jest-validate": "^29.6.3", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve-dependencies": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.4.tgz", + "integrity": "sha512-7+6eAmr1ZBF3vOAJVsfLj1QdqeXG+WYhidfLHBRZqGN24MFRIiKG20ItpLw2qRAsW/D2ZUUmCNf6irUr/v6KHA==", + "dev": true, + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.6.4" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-resolve/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-resolve/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-resolve/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-resolve/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-runner": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.6.4.tgz", + "integrity": "sha512-SDaLrMmtVlQYDuG0iSPYLycG8P9jLI+fRm8AF/xPKhYDB2g6xDWjXBrR5M8gEWsK6KVFlebpZ4QsrxdyIX1Jaw==", + "dev": true, + "dependencies": { + "@jest/console": "^29.6.4", + "@jest/environment": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.6.3", + "jest-environment-node": "^29.6.4", + "jest-haste-map": "^29.6.4", + "jest-leak-detector": "^29.6.3", + "jest-message-util": "^29.6.3", + "jest-resolve": "^29.6.4", + "jest-runtime": "^29.6.4", + "jest-util": "^29.6.3", + "jest-watcher": "^29.6.4", + "jest-worker": "^29.6.4", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runner/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-runner/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-runner/node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-runner/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-runner/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-runner/node_modules/jest-worker": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.6.4.tgz", + "integrity": "sha512-6dpvFV4WjcWbDVGgHTWo/aupl8/LbBx2NSKfiwqf79xC/yeJjKHT1+StcKy/2KTmW16hE68ccKVOtXf+WZGz7Q==", + "dev": true, + "dependencies": { + "@types/node": "*", + "jest-util": "^29.6.3", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runner/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-runner/node_modules/source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/jest-runtime": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.6.4.tgz", + "integrity": "sha512-s/QxMBLvmwLdchKEjcLfwzP7h+jsHvNEtxGP5P+Fl1FMaJX2jMiIqe4rJw4tFprzCwuSvVUo9bn0uj4gNRXsbA==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.6.4", + "@jest/fake-timers": "^29.6.4", + "@jest/globals": "^29.6.4", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.6.4", + "jest-message-util": "^29.6.3", + "jest-mock": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.6.4", + "jest-snapshot": "^29.6.4", + "jest-util": "^29.6.3", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runtime/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-runtime/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-runtime/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-runtime/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-runtime/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-snapshot": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.6.4.tgz", + "integrity": "sha512-VC1N8ED7+4uboUKGIDsbvNAZb6LakgIPgAF4RSpF13dN6YaMokfRqO+BaqK4zIh6X3JffgwbzuGqDEjHm/MrvA==", + "dev": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.6.4", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.6.4", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.6.4", + "jest-message-util": "^29.6.3", + "jest-util": "^29.6.3", + "natural-compare": "^1.4.0", + "pretty-format": "^29.6.3", + "semver": "^7.5.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-snapshot/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-snapshot/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-snapshot/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-snapshot/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-snapshot/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jest-snapshot/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jest-snapshot/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-snapshot/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/jest-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.6.3.tgz", + "integrity": "sha512-QUjna/xSy4B32fzcKTSz1w7YYzgiHrjjJjevdRf61HYk998R5vVMMNmrHESYZVDS5DSWs+1srPLPKxXPkeSDOA==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-util/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-util/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-util/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-util/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-util/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-validate": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.6.3.tgz", + "integrity": "sha512-e7KWZcAIX+2W1o3cHfnqpGajdCs1jSM3DkXjGeLSNmCazv1EeI1ggTeK5wdZhF+7N+g44JI2Od3veojoaumlfg==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-validate/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-validate/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-validate/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-validate/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-watcher": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.6.4.tgz", + "integrity": "sha512-oqUWvx6+On04ShsT00Ir9T4/FvBeEh2M9PTubgITPxDa739p4hoQweWPRGyYeaojgT0xTpZKF0Y/rSY1UgMxvQ==", + "dev": true, + "dependencies": { + "@jest/test-result": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.6.3", + "string-length": "^4.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-watcher/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-watcher/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-watcher/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-watcher/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-watcher/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-worker": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", + "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", + "dev": true, + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lil-gui": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/lil-gui/-/lil-gui-0.17.0.tgz", + "integrity": "sha512-MVBHmgY+uEbmJNApAaPbtvNh1RCAeMnKym82SBjtp5rODTYKWtM+MXHCifLe2H2Ti1HuBGBtK/5SyG4ShQ3pUQ==", + "dev": true + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, + "node_modules/loader-runner": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", + "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", + "dev": true, + "engines": { + "node": ">=6.11.5" + } + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", + "dev": true + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-dir/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "node_modules/makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "dependencies": { + "tmpl": "1.0.5" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/meshoptimizer": { + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/meshoptimizer/-/meshoptimizer-0.18.1.tgz", + "integrity": "sha512-ZhoIoL7TNV4s5B6+rx5mC//fw8/POGyNxS/DZyCJeiZ12ScLfVwRE/GfsxwiTkMYYD5DmK2/JXnEVXqL4rF+Sw==", + "dev": true + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "node_modules/mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/molangjs": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/molangjs/-/molangjs-1.6.2.tgz", + "integrity": "sha512-x4qOvd+kFl9Om99RIjbAFMRHem3D2ZaGqA+7dm9qQWirX4lKp6m7E+vCQy+IcW1IOoHqers88sUqr1CTNHOhAA==", + "dev": true + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/nanoid": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "dev": true + }, + "node_modules/node-releases": { + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", + "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", + "dev": true + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pirates": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/postcss": { + "version": "8.4.28", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.28.tgz", + "integrity": "sha512-Z7V5j0cq8oEKyejIKfpD8b4eBy9cwW2JWPk0+fB1HOAMsfHbnAXLLS+PfVWlzMSLQaWttKDt607I0XHmpE67Vw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/pretty-format": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.3.tgz", + "integrity": "sha512-ZsBgjVhFAj5KeK+nHfF1305/By3lechHQSMWCTl8iHSbfOm2TN5nHEtFc/+W7fAyUeCs2n5iow72gld4gW0xDw==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/pure-rand": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.2.tgz", + "integrity": "sha512-6Yg0ekpKICSjPswYOuC5sku/TSWaRYlA0qsXqJgM/d/4pLPHPuTxK7Nbf7jFKzAeedUhR8C7K9Uv63FBsSo8xQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ] + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, + "node_modules/rechoir": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", + "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==", + "dev": true, + "dependencies": { + "resolve": "^1.20.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.4", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.4.tgz", + "integrity": "sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve.exports": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", + "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/serialize-javascript": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", + "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "node_modules/stack-utils": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/stack-utils/node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "dependencies": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/string-length/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-length/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "dependencies": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/terser": { + "version": "5.19.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.2.tgz", + "integrity": "sha512-qC5+dmecKJA4cpYxRa5aVkKehYsQKc+AHeKl0Oe62aYjBL8ZA33tTljktDHJSaxxMnbI5ZYw+o/S2DxxLu8OfA==", + "dev": true, + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/terser-webpack-plugin": { + "version": "5.3.9", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz", + "integrity": "sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.17", + "jest-worker": "^27.4.5", + "schema-utils": "^3.1.1", + "serialize-javascript": "^6.0.1", + "terser": "^5.16.8" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "uglify-js": { + "optional": true + } + } + }, + "node_modules/terser/node_modules/acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "node_modules/three": { + "version": "0.129.0", + "resolved": "https://registry.npmjs.org/three/-/three-0.129.0.tgz", + "integrity": "sha512-wiWio1yVRg2Oj6WEWsTHQo5eSzYpEwSBtPSi3OofNpvFbf26HFfb9kw4FZJNjII4qxzp0b1xLB11+tKkBGB1ZA==", + "dev": true + }, + "node_modules/tinycolor2": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.6.0.tgz", + "integrity": "sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==", + "dev": true + }, + "node_modules/tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-api-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.2.tgz", + "integrity": "sha512-Cbu4nIqnEdd+THNEsBdkolnOXhg0I8XteoHaEKgvsxpsbWda4IsUut2c187HxywQCvveojow0Dgw/amxtSKVkQ==", + "dev": true, + "engines": { + "node": ">=16.13.0" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, + "node_modules/ts-jest": { + "version": "29.1.1", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.1.tgz", + "integrity": "sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==", + "dev": true, + "dependencies": { + "bs-logger": "0.x", + "fast-json-stable-stringify": "2.x", + "jest-util": "^29.0.0", + "json5": "^2.2.3", + "lodash.memoize": "4.x", + "make-error": "1.x", + "semver": "^7.5.3", + "yargs-parser": "^21.0.1" + }, + "bin": { + "ts-jest": "cli.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": ">=7.0.0-beta.0 <8", + "@jest/types": "^29.0.0", + "babel-jest": "^29.0.0", + "jest": "^29.0.0", + "typescript": ">=4.3 <6" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "@jest/types": { + "optional": true + }, + "babel-jest": { + "optional": true + }, + "esbuild": { + "optional": true + } + } + }, + "node_modules/ts-jest/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ts-jest/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ts-jest/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/ts-loader": { + "version": "9.4.4", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.4.tgz", + "integrity": "sha512-MLukxDHBl8OJ5Dk3y69IsKVFRA/6MwzEqBgh+OXMPB/OD01KQuWPFd1WAQP8a5PeSCAxfnkhiuWqfmFJzJQt9w==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "enhanced-resolve": "^5.0.0", + "micromatch": "^4.0.0", + "semver": "^7.3.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "typescript": "*", + "webpack": "^5.0.0" + } + }, + "node_modules/ts-loader/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/ts-loader/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ts-loader/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/ts-loader/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/ts-loader/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ts-loader/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ts-loader/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ts-loader/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/tslib": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", + "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", + "dev": true + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", + "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/v8-compile-cache": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", + "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", + "dev": true + }, + "node_modules/v8-to-istanbul": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", + "integrity": "sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/v8-to-istanbul/node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + }, + "node_modules/vue": { + "version": "2.7.14", + "resolved": "https://registry.npmjs.org/vue/-/vue-2.7.14.tgz", + "integrity": "sha512-b2qkFyOM0kwqWFuQmgd4o+uHGU7T+2z3T+WQp8UBjADfEv2n4FEMffzBmCKNP0IGzOEEfYjvtcC62xaSKeQDrQ==", + "dev": true, + "dependencies": { + "@vue/compiler-sfc": "2.7.14", + "csstype": "^3.1.0" + } + }, + "node_modules/walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "dev": true, + "dependencies": { + "makeerror": "1.0.12" + } + }, + "node_modules/watchpack": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", + "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", + "dev": true, + "dependencies": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/webpack": { + "version": "5.88.2", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.88.2.tgz", + "integrity": "sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ==", + "dev": true, + "dependencies": { + "@types/eslint-scope": "^3.7.3", + "@types/estree": "^1.0.0", + "@webassemblyjs/ast": "^1.11.5", + "@webassemblyjs/wasm-edit": "^1.11.5", + "@webassemblyjs/wasm-parser": "^1.11.5", + "acorn": "^8.7.1", + "acorn-import-assertions": "^1.9.0", + "browserslist": "^4.14.5", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.15.0", + "es-module-lexer": "^1.2.1", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.9", + "json-parse-even-better-errors": "^2.3.1", + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^3.2.0", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.3.7", + "watchpack": "^2.4.0", + "webpack-sources": "^3.2.3" + }, + "bin": { + "webpack": "bin/webpack.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + } + } + }, + "node_modules/webpack-cli": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.4.tgz", + "integrity": "sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg==", + "dev": true, + "dependencies": { + "@discoveryjs/json-ext": "^0.5.0", + "@webpack-cli/configtest": "^2.1.1", + "@webpack-cli/info": "^2.0.2", + "@webpack-cli/serve": "^2.0.5", + "colorette": "^2.0.14", + "commander": "^10.0.1", + "cross-spawn": "^7.0.3", + "envinfo": "^7.7.3", + "fastest-levenshtein": "^1.0.12", + "import-local": "^3.0.2", + "interpret": "^3.1.1", + "rechoir": "^0.8.0", + "webpack-merge": "^5.7.3" + }, + "bin": { + "webpack-cli": "bin/cli.js" + }, + "engines": { + "node": ">=14.15.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "5.x.x" + }, + "peerDependenciesMeta": { + "@webpack-cli/generators": { + "optional": true + }, + "webpack-bundle-analyzer": { + "optional": true + }, + "webpack-dev-server": { + "optional": true + } + } + }, + "node_modules/webpack-cli/node_modules/commander": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/webpack-merge": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.9.0.tgz", + "integrity": "sha512-6NbRQw4+Sy50vYNTw7EyOn41OZItPiXB8GNv3INSoe3PSFaHJEz3SHTrYVaRm2LilNGnFUzh0FAwqPEmU/CwDg==", + "dev": true, + "dependencies": { + "clone-deep": "^4.0.1", + "wildcard": "^2.0.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/webpack-sources": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", + "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", + "dev": true, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/webpack/node_modules/acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/webpack/node_modules/acorn-import-assertions": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", + "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", + "dev": true, + "peerDependencies": { + "acorn": "^8" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wildcard": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz", + "integrity": "sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==", + "dev": true + }, + "node_modules/wintersky": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/wintersky/-/wintersky-1.2.1.tgz", + "integrity": "sha512-fI3XPnDBdKD0uPcb9HPWQzeLXfZOLyJnBiT/A83sdNz4d8jz4I5xTIh3AUnrhZrES9l/q7kG32FJlAXL6e7clw==", + "dev": true, + "dependencies": { + "molangjs": "^1.6.1", + "three": "^0.147.0", + "tinycolor2": "^1.4.2" + } + }, + "node_modules/wintersky/node_modules/three": { + "version": "0.147.0", + "resolved": "https://registry.npmjs.org/three/-/three-0.147.0.tgz", + "integrity": "sha512-LPTOslYQXFkmvceQjFTNnVVli2LaVF6C99Pv34fJypp8NbQLbTlu3KinZ0zURghS5zEehK+VQyvWuPZ/Sm8fzw==", + "dev": true + }, + "node_modules/word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/wrap-ansi/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "node_modules/write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "dependencies": { + "mkdirp": "^0.5.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/write-file-atomic": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/yargs/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + }, + "dependencies": { + "@ampproject/remapping": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", + "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@babel/code-frame": { + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "dev": true, + "requires": { + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" + } + }, + "@babel/compat-data": { + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.9.tgz", + "integrity": "sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ==", + "dev": true + }, + "@babel/core": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.11.tgz", + "integrity": "sha512-lh7RJrtPdhibbxndr6/xx0w8+CVlY5FJZiaSz908Fpy+G0xkBFTvwLcKJFF4PJxVfGhVWNebikpWGnOoC71juQ==", + "dev": true, + "requires": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.22.10", + "@babel/generator": "^7.22.10", + "@babel/helper-compilation-targets": "^7.22.10", + "@babel/helper-module-transforms": "^7.22.9", + "@babel/helpers": "^7.22.11", + "@babel/parser": "^7.22.11", + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.11", + "@babel/types": "^7.22.11", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "dependencies": { + "convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + }, + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } + } + }, + "@babel/generator": { + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.10.tgz", + "integrity": "sha512-79KIf7YiWjjdZ81JnLujDRApWtl7BxTqWD88+FFdQEIOG8LJ0etDOM7CXuIgGJa55sGOwZVwuEsaLEm0PJ5/+A==", + "dev": true, + "requires": { + "@babel/types": "^7.22.10", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" + } + }, + "@babel/helper-compilation-targets": { + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.10.tgz", + "integrity": "sha512-JMSwHD4J7SLod0idLq5PKgI+6g/hLD/iuWBq08ZX49xE14VpVEojJ5rHWptpirV2j020MvypRLAXAO50igCJ5Q==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.22.9", + "@babel/helper-validator-option": "^7.22.5", + "browserslist": "^4.21.9", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "dependencies": { + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } + } + }, + "@babel/helper-environment-visitor": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz", + "integrity": "sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==", + "dev": true + }, + "@babel/helper-function-name": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", + "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", + "dev": true, + "requires": { + "@babel/template": "^7.22.5", + "@babel/types": "^7.22.5" + } + }, + "@babel/helper-hoist-variables": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", + "dev": true, + "requires": { + "@babel/types": "^7.22.5" + } + }, + "@babel/helper-module-imports": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz", + "integrity": "sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==", + "dev": true, + "requires": { + "@babel/types": "^7.22.5" + } + }, + "@babel/helper-module-transforms": { + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.9.tgz", + "integrity": "sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ==", + "dev": true, + "requires": { + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-module-imports": "^7.22.5", + "@babel/helper-simple-access": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/helper-validator-identifier": "^7.22.5" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", + "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", + "dev": true + }, + "@babel/helper-simple-access": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", + "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", + "dev": true, + "requires": { + "@babel/types": "^7.22.5" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", + "dev": true, + "requires": { + "@babel/types": "^7.22.5" + } + }, + "@babel/helper-string-parser": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "dev": true + }, + "@babel/helper-validator-identifier": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", + "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", + "dev": true + }, + "@babel/helper-validator-option": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz", + "integrity": "sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==", + "dev": true + }, + "@babel/helpers": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.11.tgz", + "integrity": "sha512-vyOXC8PBWaGc5h7GMsNx68OH33cypkEDJCHvYVVgVbbxJDROYVtexSk0gK5iCF1xNjRIN2s8ai7hwkWDq5szWg==", + "dev": true, + "requires": { + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.11", + "@babel/types": "^7.22.11" + } + }, + "@babel/highlight": { + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.13.tgz", + "integrity": "sha512-C/BaXcnnvBCmHTpz/VGZ8jgtE2aYlW4hxDhseJAWZb7gqGM/qtCK6iZUb0TyKFf7BOUsBH7Q7fkRsDRhg1XklQ==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.22.5", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.13.tgz", + "integrity": "sha512-3l6+4YOvc9wx7VlCSw4yQfcBo01ECA8TicQfbnCPuCEpRQrf+gTUyGdxNw+pyTUyywp6JRD1w0YQs9TpBXYlkw==", + "dev": true + }, + "@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.12.13" + } + }, + "@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-jsx": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz", + "integrity": "sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.22.5" + } + }, + "@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-syntax-typescript": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz", + "integrity": "sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.22.5" + } + }, + "@babel/template": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz", + "integrity": "sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.22.5", + "@babel/parser": "^7.22.5", + "@babel/types": "^7.22.5" + } + }, + "@babel/traverse": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.11.tgz", + "integrity": "sha512-mzAenteTfomcB7mfPtyi+4oe5BZ6MXxWcn4CX+h4IRJ+OOGXBrWU6jDQavkQI9Vuc5P+donFabBfFCcmWka9lQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.22.10", + "@babel/generator": "^7.22.10", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.22.11", + "@babel/types": "^7.22.11", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "dependencies": { + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.11.tgz", + "integrity": "sha512-siazHiGuZRz9aB9NpHy9GOs9xiQPKnMzgdr493iI1M67vRXpnEq8ZOOKzezC5q7zwuQ6sDhdSp4SD9ixKSqKZg==", + "dev": true, + "requires": { + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.5", + "to-fast-properties": "^2.0.0" + } + }, + "@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "@discoveryjs/json-ext": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", + "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", + "dev": true + }, + "@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^3.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true + } + } + }, + "@eslint-community/regexpp": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.8.0.tgz", + "integrity": "sha512-JylOEEzDiOryeUnFbQz+oViCXS0KsvR1mvHkoMiu5+UiBvy+RYX7tzlIIIEstF/gVa2tj9AQXk3dgnxv6KxhFg==", + "dev": true + }, + "@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + } + }, + "@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true + }, + "@jest/console": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.6.4.tgz", + "integrity": "sha512-wNK6gC0Ha9QeEPSkeJedQuTQqxZYnDPuDcDhVuVatRvMkL4D0VTvFVZj+Yuh6caG2aOfzkUZ36KtCmLNtR02hw==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^29.6.3", + "jest-util": "^29.6.3", + "slash": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "@jest/core": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.6.4.tgz", + "integrity": "sha512-U/vq5ccNTSVgYH7mHnodHmCffGWHJnz/E1BEWlLuK5pM4FZmGfBn/nrJGLjUsSmyx3otCeqc1T31F4y08AMDLg==", + "dev": true, + "requires": { + "@jest/console": "^29.6.4", + "@jest/reporters": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.6.3", + "jest-config": "^29.6.4", + "jest-haste-map": "^29.6.4", + "jest-message-util": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.6.4", + "jest-resolve-dependencies": "^29.6.4", + "jest-runner": "^29.6.4", + "jest-runtime": "^29.6.4", + "jest-snapshot": "^29.6.4", + "jest-util": "^29.6.3", + "jest-validate": "^29.6.3", + "jest-watcher": "^29.6.4", + "micromatch": "^4.0.4", + "pretty-format": "^29.6.3", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "@jest/environment": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.6.4.tgz", + "integrity": "sha512-sQ0SULEjA1XUTHmkBRl7A1dyITM9yb1yb3ZNKPX3KlTd6IG7mWUe3e2yfExtC2Zz1Q+mMckOLHmL/qLiuQJrBQ==", + "dev": true, + "requires": { + "@jest/fake-timers": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.6.3" + } + }, + "@jest/expect": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.6.4.tgz", + "integrity": "sha512-Warhsa7d23+3X5bLbrbYvaehcgX5TLYhI03JKoedTiI8uJU4IhqYBWF7OSSgUyz4IgLpUYPkK0AehA5/fRclAA==", + "dev": true, + "requires": { + "expect": "^29.6.4", + "jest-snapshot": "^29.6.4" + } + }, + "@jest/expect-utils": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.6.4.tgz", + "integrity": "sha512-FEhkJhqtvBwgSpiTrocquJCdXPsyvNKcl/n7A3u7X4pVoF4bswm11c9d4AV+kfq2Gpv/mM8x7E7DsRvH+djkrg==", + "dev": true, + "requires": { + "jest-get-type": "^29.6.3" + } + }, + "@jest/fake-timers": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.6.4.tgz", + "integrity": "sha512-6UkCwzoBK60edXIIWb0/KWkuj7R7Qq91vVInOe3De6DSpaEiqjKcJw4F7XUet24Wupahj9J6PlR09JqJ5ySDHw==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.6.3", + "jest-mock": "^29.6.3", + "jest-util": "^29.6.3" + } + }, + "@jest/globals": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.6.4.tgz", + "integrity": "sha512-wVIn5bdtjlChhXAzVXavcY/3PEjf4VqM174BM3eGL5kMxLiZD5CLnbmkEyA1Dwh9q8XjP6E8RwjBsY/iCWrWsA==", + "dev": true, + "requires": { + "@jest/environment": "^29.6.4", + "@jest/expect": "^29.6.4", + "@jest/types": "^29.6.3", + "jest-mock": "^29.6.3" + } + }, + "@jest/reporters": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.6.4.tgz", + "integrity": "sha512-sxUjWxm7QdchdrD3NfWKrL8FBsortZeibSJv4XLjESOOjSUOkjQcb0ZHJwfhEGIvBvTluTzfG2yZWZhkrXJu8g==", + "dev": true, + "requires": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.6.3", + "jest-util": "^29.6.3", + "jest-worker": "^29.6.4", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "jest-worker": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.6.4.tgz", + "integrity": "sha512-6dpvFV4WjcWbDVGgHTWo/aupl8/LbBx2NSKfiwqf79xC/yeJjKHT1+StcKy/2KTmW16hE68ccKVOtXf+WZGz7Q==", + "dev": true, + "requires": { + "@types/node": "*", + "jest-util": "^29.6.3", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, + "@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "requires": { + "@sinclair/typebox": "^0.27.8" + } + }, + "@jest/source-map": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "dev": true, + "requires": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + } + }, + "@jest/test-result": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.6.4.tgz", + "integrity": "sha512-uQ1C0AUEN90/dsyEirgMLlouROgSY+Wc/JanVVk0OiUKa5UFh7sJpMEM3aoUBAz2BRNvUJ8j3d294WFuRxSyOQ==", + "dev": true, + "requires": { + "@jest/console": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + } + }, + "@jest/test-sequencer": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.6.4.tgz", + "integrity": "sha512-E84M6LbpcRq3fT4ckfKs9ryVanwkaIB0Ws9bw3/yP4seRLg/VaCZ/LgW0MCq5wwk4/iP/qnilD41aj2fsw2RMg==", + "dev": true, + "requires": { + "@jest/test-result": "^29.6.4", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.6.4", + "slash": "^3.0.0" + } + }, + "@jest/transform": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.6.4.tgz", + "integrity": "sha512-8thgRSiXUqtr/pPGY/OsyHuMjGyhVnWrFAwoxmIemlBuiMyU1WFs0tXoNxzcr4A4uErs/ABre76SGmrr5ab/AA==", + "dev": true, + "requires": { + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.6.4", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.6.3", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "dev": true, + "requires": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true + }, + "@jridgewell/source-map": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", + "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", + "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, + "@sinonjs/commons": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", + "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", + "dev": true, + "requires": { + "type-detect": "4.0.8" + } + }, + "@sinonjs/fake-timers": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "dev": true, + "requires": { + "@sinonjs/commons": "^3.0.0" + } + }, + "@tweenjs/tween.js": { + "version": "18.6.4", + "resolved": "https://registry.npmjs.org/@tweenjs/tween.js/-/tween.js-18.6.4.tgz", + "integrity": "sha512-lB9lMjuqjtuJrx7/kOkqQBtllspPIN+96OvTCeJ2j5FEzinoAXTdAMFnDAQT1KVPRlnYfBrqxtqP66vDM40xxQ==", + "dev": true + }, + "@types/babel__core": { + "version": "7.20.1", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.1.tgz", + "integrity": "sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw==", + "dev": true, + "requires": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "@types/babel__generator": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", + "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@types/babel__template": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", + "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "dev": true, + "requires": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@types/babel__traverse": { + "version": "7.20.1", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.1.tgz", + "integrity": "sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg==", + "dev": true, + "requires": { + "@babel/types": "^7.20.7" + } + }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, + "@types/eslint": { + "version": "8.44.2", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.2.tgz", + "integrity": "sha512-sdPRb9K6iL5XZOmBubg8yiFp5yS/JdUDQsq5e6h95km91MCYMuvp7mh1fjPEYUhvHepKpZOjnEaMBR4PxjWDzg==", + "dev": true, + "requires": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "@types/eslint-scope": { + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz", + "integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==", + "dev": true, + "requires": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, + "@types/estree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", + "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", + "dev": true + }, + "@types/graceful-fs": { + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.6.tgz", + "integrity": "sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/istanbul-lib-coverage": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "dev": true + }, + "@types/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "*" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/jest": { + "version": "29.5.4", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.4.tgz", + "integrity": "sha512-PhglGmhWeD46FYOVLt3X7TiWjzwuVGW9wG/4qocPevXMjCmrIc5b6db9WjeGE4QYVpUAWMDv3v0IiBwObY289A==", + "dev": true, + "requires": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, + "@types/jquery": { + "version": "3.5.16", + "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.16.tgz", + "integrity": "sha512-bsI7y4ZgeMkmpG9OM710RRzDFp+w4P1RGiIt30C1mSBT+ExCleeh4HObwgArnDFELmRrOpXgSYN9VF1hj+f1lw==", + "dev": true, + "requires": { + "@types/sizzle": "*" + } + }, + "@types/json-schema": { + "version": "7.0.12", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", + "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", + "dev": true + }, + "@types/lodash": { + "version": "4.14.197", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.197.tgz", + "integrity": "sha512-BMVOiWs0uNxHVlHBgzTIqJYmj+PgCo4euloGF+5m4okL3rEYzM2EEv78mw8zWSMM57dM7kVIgJ2QDvwHSoCI5g==", + "dev": true + }, + "@types/node": { + "version": "20.5.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.1.tgz", + "integrity": "sha512-4tT2UrL5LBqDwoed9wZ6N3umC4Yhz3W3FloMmiiG4JwmUJWpie0c7lcnUNd4gtMKuDEO4wRVS8B6Xa0uMRsMKg==", + "dev": true + }, + "@types/semver": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-cJRQXpObxfNKkFAZbJl2yjWtJCqELQIdShsogr1d2MilP8dKD9TE/nEKHkJgUNHdGKCQaf9HbIynuV2csLGVLg==", + "dev": true + }, + "@types/sizzle": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.3.tgz", + "integrity": "sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ==", + "dev": true + }, + "@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "dev": true + }, + "@types/stats.js": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@types/stats.js/-/stats.js-0.17.0.tgz", + "integrity": "sha512-9w+a7bR8PeB0dCT/HBULU2fMqf6BAzvKbxFboYhmDtDkKPiyXYbjoe2auwsXlEFI7CFNMF1dCv3dFH5Poy9R1w==", + "dev": true + }, + "@types/three": { + "version": "0.155.0", + "resolved": "https://registry.npmjs.org/@types/three/-/three-0.155.0.tgz", + "integrity": "sha512-IzdbqXsGsbG0flvq9D5L9pZRwySQQps2bGcizLYEsfvK3dM+B0sqKR6S+xAOXbouXemfDmHttrcQjVOM46YnAw==", + "dev": true, + "requires": { + "@tweenjs/tween.js": "~18.6.4", + "@types/stats.js": "*", + "@types/webxr": "*", + "fflate": "~0.6.9", + "lil-gui": "~0.17.0", + "meshoptimizer": "~0.18.1" + } + }, + "@types/tinycolor2": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/@types/tinycolor2/-/tinycolor2-1.4.3.tgz", + "integrity": "sha512-Kf1w9NE5HEgGxCRyIcRXR/ZYtDv0V8FVPtYHwLxl0O+maGX0erE77pQlD0gpP+/KByMZ87mOA79SjifhSB3PjQ==", + "dev": true + }, + "@types/webxr": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@types/webxr/-/webxr-0.5.3.tgz", + "integrity": "sha512-orrXqFCuuRE5hMuwLZhPaQrukAZxpkMzNJHmKCNJ16XT5yiR5iNBLNdn+xONbfzU2XAXTZR0GA2R99ciUd/2hg==", + "dev": true + }, + "@types/yargs": { + "version": "17.0.24", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", + "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "@types/yargs-parser": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", + "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", + "dev": true + }, + "@typescript-eslint/eslint-plugin": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.5.0.tgz", + "integrity": "sha512-2pktILyjvMaScU6iK3925uvGU87E+N9rh372uGZgiMYwafaw9SXq86U04XPq3UH6tzRvNgBsub6x2DacHc33lw==", + "dev": true, + "requires": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.5.0", + "@typescript-eslint/type-utils": "6.5.0", + "@typescript-eslint/utils": "6.5.0", + "@typescript-eslint/visitor-keys": "6.5.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "dependencies": { + "ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "@typescript-eslint/parser": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.5.0.tgz", + "integrity": "sha512-LMAVtR5GN8nY0G0BadkG0XIe4AcNMeyEy3DyhKGAh9k4pLSMBO7rF29JvDBpZGCmp5Pgz5RLHP6eCpSYZJQDuQ==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "6.5.0", + "@typescript-eslint/types": "6.5.0", + "@typescript-eslint/typescript-estree": "6.5.0", + "@typescript-eslint/visitor-keys": "6.5.0", + "debug": "^4.3.4" + } + }, + "@typescript-eslint/scope-manager": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.5.0.tgz", + "integrity": "sha512-A8hZ7OlxURricpycp5kdPTH3XnjG85UpJS6Fn4VzeoH4T388gQJ/PGP4ole5NfKt4WDVhmLaQ/dBLNDC4Xl/Kw==", + "dev": true, + "requires": { + "@typescript-eslint/types": "6.5.0", + "@typescript-eslint/visitor-keys": "6.5.0" + } + }, + "@typescript-eslint/type-utils": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.5.0.tgz", + "integrity": "sha512-f7OcZOkRivtujIBQ4yrJNIuwyCQO1OjocVqntl9dgSIZAdKqicj3xFDqDOzHDlGCZX990LqhLQXWRnQvsapq8A==", + "dev": true, + "requires": { + "@typescript-eslint/typescript-estree": "6.5.0", + "@typescript-eslint/utils": "6.5.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + } + }, + "@typescript-eslint/types": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.5.0.tgz", + "integrity": "sha512-eqLLOEF5/lU8jW3Bw+8auf4lZSbbljHR2saKnYqON12G/WsJrGeeDHWuQePoEf9ro22+JkbPfWQwKEC5WwLQ3w==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.5.0.tgz", + "integrity": "sha512-q0rGwSe9e5Kk/XzliB9h2LBc9tmXX25G0833r7kffbl5437FPWb2tbpIV9wAATebC/018pGa9fwPDuvGN+LxWQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "6.5.0", + "@typescript-eslint/visitor-keys": "6.5.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "@typescript-eslint/utils": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.5.0.tgz", + "integrity": "sha512-9nqtjkNykFzeVtt9Pj6lyR9WEdd8npPhhIPM992FWVkZuS6tmxHfGVnlUcjpUP2hv8r4w35nT33mlxd+Be1ACQ==", + "dev": true, + "requires": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.5.0", + "@typescript-eslint/types": "6.5.0", + "@typescript-eslint/typescript-estree": "6.5.0", + "semver": "^7.5.4" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "@typescript-eslint/visitor-keys": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.5.0.tgz", + "integrity": "sha512-yCB/2wkbv3hPsh02ZS8dFQnij9VVQXJMN/gbQsaaY+zxALkZnxa/wagvLEFsAWMPv7d7lxQmNsIzGU1w/T/WyA==", + "dev": true, + "requires": { + "@typescript-eslint/types": "6.5.0", + "eslint-visitor-keys": "^3.4.1" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true + } + } + }, + "@vue/compiler-sfc": { + "version": "2.7.14", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-2.7.14.tgz", + "integrity": "sha512-aNmNHyLPsw+sVvlQFQ2/8sjNuLtK54TC6cuKnVzAY93ks4ZBrvwQSnkkIh7bsbNhum5hJBS00wSDipQ937f5DA==", + "dev": true, + "requires": { + "@babel/parser": "^7.18.4", + "postcss": "^8.4.14", + "source-map": "^0.6.1" + } + }, + "@webassemblyjs/ast": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", + "integrity": "sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==", + "dev": true, + "requires": { + "@webassemblyjs/helper-numbers": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6" + } + }, + "@webassemblyjs/floating-point-hex-parser": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", + "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", + "dev": true + }, + "@webassemblyjs/helper-api-error": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", + "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", + "dev": true + }, + "@webassemblyjs/helper-buffer": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz", + "integrity": "sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==", + "dev": true + }, + "@webassemblyjs/helper-numbers": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", + "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", + "dev": true, + "requires": { + "@webassemblyjs/floating-point-hex-parser": "1.11.6", + "@webassemblyjs/helper-api-error": "1.11.6", + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/helper-wasm-bytecode": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", + "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", + "dev": true + }, + "@webassemblyjs/helper-wasm-section": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz", + "integrity": "sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/wasm-gen": "1.11.6" + } + }, + "@webassemblyjs/ieee754": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", + "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", + "dev": true, + "requires": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "@webassemblyjs/leb128": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", + "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", + "dev": true, + "requires": { + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/utf8": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", + "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", + "dev": true + }, + "@webassemblyjs/wasm-edit": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz", + "integrity": "sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/helper-wasm-section": "1.11.6", + "@webassemblyjs/wasm-gen": "1.11.6", + "@webassemblyjs/wasm-opt": "1.11.6", + "@webassemblyjs/wasm-parser": "1.11.6", + "@webassemblyjs/wast-printer": "1.11.6" + } + }, + "@webassemblyjs/wasm-gen": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz", + "integrity": "sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" + } + }, + "@webassemblyjs/wasm-opt": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz", + "integrity": "sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/wasm-gen": "1.11.6", + "@webassemblyjs/wasm-parser": "1.11.6" + } + }, + "@webassemblyjs/wasm-parser": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz", + "integrity": "sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-api-error": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" + } + }, + "@webassemblyjs/wast-printer": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz", + "integrity": "sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.6", + "@xtuc/long": "4.2.2" + } + }, + "@webpack-cli/configtest": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.1.1.tgz", + "integrity": "sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw==", + "dev": true, + "requires": {} + }, + "@webpack-cli/info": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-2.0.2.tgz", + "integrity": "sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A==", + "dev": true, + "requires": {} + }, + "@webpack-cli/serve": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.5.tgz", + "integrity": "sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ==", + "dev": true, + "requires": {} + }, + "@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true + }, + "@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true + }, + "acorn": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", + "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", + "dev": true, + "peer": true + }, + "acorn-jsx": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", + "dev": true, + "requires": {} + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "requires": {} + }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "requires": { + "type-fest": "^0.21.3" + }, + "dependencies": { + "type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true + } + } + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, + "babel-jest": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.6.4.tgz", + "integrity": "sha512-meLj23UlSLddj6PC+YTOFRgDAtjnZom8w/ACsrx0gtPtv5cJZk0A5Unk5bV4wixD7XaPCN1fQvpww8czkZURmw==", + "dev": true, + "requires": { + "@jest/transform": "^29.6.4", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "dependencies": { + "istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "dev": true, + "requires": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + } + }, + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } + } + }, + "babel-plugin-jest-hoist": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", + "dev": true, + "requires": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + } + }, + "babel-preset-current-node-syntax": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", + "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", + "dev": true, + "requires": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.8.3", + "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.8.3" + } + }, + "babel-preset-jest": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "dev": true, + "requires": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "blockbench-types": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/blockbench-types/-/blockbench-types-4.9.0.tgz", + "integrity": "sha512-Vc7qMuYnQSYhwxiuyAf5hYUUBc7CuIqAyWWTO5XsE97eTY2IJ/nSYMvNsPCmwb9sdGXB1OP4G7vBq4mY9XbNAQ==", + "dev": true, + "requires": { + "@types/jquery": "^3.5.4", + "@types/three": "^0.155.0", + "@types/tinycolor2": "^1.4.3", + "three": "^0.129.0", + "typescript": "^4.9.5", + "vue": "^2.6.14", + "wintersky": "^1.2.1" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "browserslist": { + "version": "4.21.10", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz", + "integrity": "sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001517", + "electron-to-chromium": "^1.4.477", + "node-releases": "^2.0.13", + "update-browserslist-db": "^1.0.11" + } + }, + "bs-logger": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", + "dev": true, + "requires": { + "fast-json-stable-stringify": "2.x" + } + }, + "bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "requires": { + "node-int64": "^0.4.0" + } + }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "caniuse-lite": { + "version": "1.0.30001522", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001522.tgz", + "integrity": "sha512-TKiyTVZxJGhsTszLuzb+6vUZSjVOAhClszBr2Ta2k9IwtNBT/4dzmL6aywt0HCgEZlmwJzXJd8yNiob6HgwTRg==", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true + }, + "chrome-trace-event": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz", + "integrity": "sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "ci-info": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", + "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", + "dev": true + }, + "cjs-module-lexer": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", + "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", + "dev": true + }, + "cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, + "clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true + }, + "collect-v8-coverage": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", + "dev": true + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "csstype": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", + "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==", + "dev": true + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "dedent": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", + "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", + "dev": true, + "requires": {} + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true + }, + "detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true + }, + "diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "electron-to-chromium": { + "version": "1.4.496", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.496.tgz", + "integrity": "sha512-qeXC3Zbykq44RCrBa4kr8v/dWzYJA8rAwpyh9Qd+NKWoJfjG5vvJqy9XOJ9H4P/lqulZBCgUWAYi+FeK5AuJ8g==", + "dev": true + }, + "emittery": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", + "dev": true + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "enhanced-resolve": { + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", + "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + } + }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, + "envinfo": { + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.10.0.tgz", + "integrity": "sha512-ZtUjZO6l5mwTHvc1L9+1q5p/R3wTopcfqMW8r5t8SJSKqeVI/LtajORwRFEKpEFuekjD0VBjwu1HMxL4UalIRw==", + "dev": true + }, + "eol": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/eol/-/eol-0.9.1.tgz", + "integrity": "sha512-Ds/TEoZjwggRoz/Q2O7SE3i4Jm66mqTDfmdHdq/7DKVk3bro9Q8h6WdXKdPqFLMoqxrDK5SVRzHVPOS6uuGtrg==", + "dev": true + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-module-lexer": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.3.0.tgz", + "integrity": "sha512-vZK7T0N2CBmBOixhmjdqx2gWVbFZ4DXZ/NyRMZVlJXPa7CyFS+/a4QQsDGDQy9ZfEzxFuNEsMLeQJnKP2p5/JA==", + "dev": true + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + }, + "eslint": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.7.0.tgz", + "integrity": "sha512-1KUxLzos0ZVsyL81PnRN335nDtQ8/vZUD6uMtWbF+5zDtjKcsklIi78XoE0MVL93QvWTu+E5y44VyyCsOMBrIg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.0", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^1.3.0", + "espree": "^7.2.0", + "esquery": "^1.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + }, + "espree": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.2.0.tgz", + "integrity": "sha512-H+cQ3+3JYRMEIOl87e7QdHX70ocly5iW4+dttuR8iYSPr/hXKFb+7dBsZ7+u1adC4VrnPlTkv0+OwuPnDop19g==", + "dev": true, + "requires": { + "acorn": "^7.3.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "acorn": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.0.tgz", + "integrity": "sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==", + "dev": true + } + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true + }, + "execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + } + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "dev": true + }, + "expect": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.6.4.tgz", + "integrity": "sha512-F2W2UyQ8XYyftHT57dtfg8Ue3X5qLgm2sSug0ivvLRH/VKNRL/pDxg/TH7zVzbQB0tu80clNFy6LU7OS/VSEKA==", + "dev": true, + "requires": { + "@jest/expect-utils": "^29.6.4", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.6.4", + "jest-message-util": "^29.6.3", + "jest-util": "^29.6.3" + } + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-glob": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", + "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + } + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fastest-levenshtein": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", + "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", + "dev": true + }, + "fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "fb-watchman": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", + "dev": true, + "requires": { + "bser": "2.1.1" + } + }, + "fflate": { + "version": "0.6.10", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.6.10.tgz", + "integrity": "sha512-IQrh3lEPM93wVCEczc9SaAOvkmcoQn/G8Bo1e8ZPlY3X3bnAxWaBdvTdvM1hP62iZp0BXWDy4vTAy4fF0+Dlpg==", + "dev": true + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + }, + "dependencies": { + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true + }, + "get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true + }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "dependencies": { + "ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true + } + } + }, + "graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + } + } + }, + "import-local": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", + "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", + "dev": true, + "requires": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "interpret": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz", + "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "is-core-module": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "dev": true + }, + "istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true + }, + "istanbul-lib-instrument": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.0.tgz", + "integrity": "sha512-x58orMzEVfzPUKqlbLd1hXCnySCxKdDKa6Rjg97CwuLLRI4g3FHTdnExu1OqffVFay6zeMW+T6/DowFLndWnIw==", + "dev": true, + "requires": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + } + }, + "istanbul-reports": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", + "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, + "jest": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.6.4.tgz", + "integrity": "sha512-tEFhVQFF/bzoYV1YuGyzLPZ6vlPrdfvDmmAxudA1dLEuiztqg2Rkx20vkKY32xiDROcD2KXlgZ7Cu8RPeEHRKw==", + "dev": true, + "requires": { + "@jest/core": "^29.6.4", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.6.4" + } + }, + "jest-changed-files": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.6.3.tgz", + "integrity": "sha512-G5wDnElqLa4/c66ma5PG9eRjE342lIbF6SUnTJi26C3J28Fv2TVY2rOyKB9YGbSA5ogwevgmxc4j4aVjrEK6Yg==", + "dev": true, + "requires": { + "execa": "^5.0.0", + "jest-util": "^29.6.3", + "p-limit": "^3.1.0" + }, + "dependencies": { + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + } + } + }, + "jest-circus": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.6.4.tgz", + "integrity": "sha512-YXNrRyntVUgDfZbjXWBMPslX1mQ8MrSG0oM/Y06j9EYubODIyHWP8hMUbjbZ19M3M+zamqEur7O80HODwACoJw==", + "dev": true, + "requires": { + "@jest/environment": "^29.6.4", + "@jest/expect": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.6.3", + "jest-matcher-utils": "^29.6.4", + "jest-message-util": "^29.6.3", + "jest-runtime": "^29.6.4", + "jest-snapshot": "^29.6.4", + "jest-util": "^29.6.3", + "p-limit": "^3.1.0", + "pretty-format": "^29.6.3", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-cli": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.6.4.tgz", + "integrity": "sha512-+uMCQ7oizMmh8ZwRfZzKIEszFY9ksjjEQnTEMTaL7fYiL3Kw4XhqT9bYh+A4DQKUb67hZn2KbtEnDuHvcgK4pQ==", + "dev": true, + "requires": { + "@jest/core": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "import-local": "^3.0.2", + "jest-config": "^29.6.4", + "jest-util": "^29.6.3", + "jest-validate": "^29.6.3", + "prompts": "^2.0.1", + "yargs": "^17.3.1" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-config": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.6.4.tgz", + "integrity": "sha512-JWohr3i9m2cVpBumQFv2akMEnFEPVOh+9L2xIBJhJ0zOaci2ZXuKJj0tgMKQCBZAKA09H049IR4HVS/43Qb19A==", + "dev": true, + "requires": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.6.4", + "@jest/types": "^29.6.3", + "babel-jest": "^29.6.4", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.6.4", + "jest-environment-node": "^29.6.4", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.6.4", + "jest-runner": "^29.6.4", + "jest-util": "^29.6.3", + "jest-validate": "^29.6.3", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.6.3", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-diff": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.6.4.tgz", + "integrity": "sha512-9F48UxR9e4XOEZvoUXEHSWY4qC4zERJaOfrbBg9JpbJOO43R1vN76REt/aMGZoY6GD5g84nnJiBIVlscegefpw==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.6.3" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-docblock": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.6.3.tgz", + "integrity": "sha512-2+H+GOTQBEm2+qFSQ7Ma+BvyV+waiIFxmZF5LdpBsAEjWX8QYjSCa4FrkIYtbfXUJJJnFCYrOtt6TZ+IAiTjBQ==", + "dev": true, + "requires": { + "detect-newline": "^3.0.0" + } + }, + "jest-each": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.6.3.tgz", + "integrity": "sha512-KoXfJ42k8cqbkfshW7sSHcdfnv5agDdHCPA87ZBdmHP+zJstTJc0ttQaJ/x7zK6noAL76hOuTIJ6ZkQRS5dcyg==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.6.3", + "pretty-format": "^29.6.3" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-environment-node": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.6.4.tgz", + "integrity": "sha512-i7SbpH2dEIFGNmxGCpSc2w9cA4qVD+wfvg2ZnfQ7XVrKL0NA5uDVBIiGH8SR4F0dKEv/0qI5r+aDomDf04DpEQ==", + "dev": true, + "requires": { + "@jest/environment": "^29.6.4", + "@jest/fake-timers": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.6.3", + "jest-util": "^29.6.3" + } + }, + "jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "dev": true + }, + "jest-haste-map": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.6.4.tgz", + "integrity": "sha512-12Ad+VNTDHxKf7k+M65sviyynRoZYuL1/GTuhEVb8RYsNSNln71nANRb/faSyWvx0j+gHcivChXHIoMJrGYjog==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "fsevents": "^2.3.2", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.6.3", + "jest-worker": "^29.6.4", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, + "dependencies": { + "jest-worker": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.6.4.tgz", + "integrity": "sha512-6dpvFV4WjcWbDVGgHTWo/aupl8/LbBx2NSKfiwqf79xC/yeJjKHT1+StcKy/2KTmW16hE68ccKVOtXf+WZGz7Q==", + "dev": true, + "requires": { + "@types/node": "*", + "jest-util": "^29.6.3", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + } + } + } + }, + "jest-leak-detector": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.6.3.tgz", + "integrity": "sha512-0kfbESIHXYdhAdpLsW7xdwmYhLf1BRu4AA118/OxFm0Ho1b2RcTmO4oF6aAMaxpxdxnJ3zve2rgwzNBD4Zbm7Q==", + "dev": true, + "requires": { + "jest-get-type": "^29.6.3", + "pretty-format": "^29.6.3" + } + }, + "jest-matcher-utils": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.6.4.tgz", + "integrity": "sha512-KSzwyzGvK4HcfnserYqJHYi7sZVqdREJ9DMPAKVbS98JsIAvumihaNUbjrWw0St7p9IY7A9UskCW5MYlGmBQFQ==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "jest-diff": "^29.6.4", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.6.3" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-message-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.6.3.tgz", + "integrity": "sha512-FtzaEEHzjDpQp51HX4UMkPZjy46ati4T5pEMyM6Ik48ztu4T9LQplZ6OsimHx7EuM9dfEh5HJa6D3trEftu3dA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.6.3", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-mock": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.6.3.tgz", + "integrity": "sha512-Z7Gs/mOyTSR4yPsaZ72a/MtuK6RnC3JYqWONe48oLaoEcYwEDxqvbXz85G4SJrm2Z5Ar9zp6MiHF4AlFlRM4Pg==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.6.3" + } + }, + "jest-pnp-resolver": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", + "dev": true, + "requires": {} + }, + "jest-regex-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "dev": true + }, + "jest-resolve": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.6.4.tgz", + "integrity": "sha512-fPRq+0vcxsuGlG0O3gyoqGTAxasagOxEuyoxHeyxaZbc9QNek0AmJWSkhjlMG+mTsj+8knc/mWb3fXlRNVih7Q==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.6.4", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.6.3", + "jest-validate": "^29.6.3", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-resolve-dependencies": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.4.tgz", + "integrity": "sha512-7+6eAmr1ZBF3vOAJVsfLj1QdqeXG+WYhidfLHBRZqGN24MFRIiKG20ItpLw2qRAsW/D2ZUUmCNf6irUr/v6KHA==", + "dev": true, + "requires": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.6.4" + } + }, + "jest-runner": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.6.4.tgz", + "integrity": "sha512-SDaLrMmtVlQYDuG0iSPYLycG8P9jLI+fRm8AF/xPKhYDB2g6xDWjXBrR5M8gEWsK6KVFlebpZ4QsrxdyIX1Jaw==", + "dev": true, + "requires": { + "@jest/console": "^29.6.4", + "@jest/environment": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.6.3", + "jest-environment-node": "^29.6.4", + "jest-haste-map": "^29.6.4", + "jest-leak-detector": "^29.6.3", + "jest-message-util": "^29.6.3", + "jest-resolve": "^29.6.4", + "jest-runtime": "^29.6.4", + "jest-util": "^29.6.3", + "jest-watcher": "^29.6.4", + "jest-worker": "^29.6.4", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "jest-worker": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.6.4.tgz", + "integrity": "sha512-6dpvFV4WjcWbDVGgHTWo/aupl8/LbBx2NSKfiwqf79xC/yeJjKHT1+StcKy/2KTmW16hE68ccKVOtXf+WZGz7Q==", + "dev": true, + "requires": { + "@types/node": "*", + "jest-util": "^29.6.3", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + } + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + } + } + }, + "jest-runtime": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.6.4.tgz", + "integrity": "sha512-s/QxMBLvmwLdchKEjcLfwzP7h+jsHvNEtxGP5P+Fl1FMaJX2jMiIqe4rJw4tFprzCwuSvVUo9bn0uj4gNRXsbA==", + "dev": true, + "requires": { + "@jest/environment": "^29.6.4", + "@jest/fake-timers": "^29.6.4", + "@jest/globals": "^29.6.4", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.6.4", + "jest-message-util": "^29.6.3", + "jest-mock": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.6.4", + "jest-snapshot": "^29.6.4", + "jest-util": "^29.6.3", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-snapshot": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.6.4.tgz", + "integrity": "sha512-VC1N8ED7+4uboUKGIDsbvNAZb6LakgIPgAF4RSpF13dN6YaMokfRqO+BaqK4zIh6X3JffgwbzuGqDEjHm/MrvA==", + "dev": true, + "requires": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.6.4", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.6.4", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.6.4", + "jest-message-util": "^29.6.3", + "jest-util": "^29.6.3", + "natural-compare": "^1.4.0", + "pretty-format": "^29.6.3", + "semver": "^7.5.3" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "jest-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.6.3.tgz", + "integrity": "sha512-QUjna/xSy4B32fzcKTSz1w7YYzgiHrjjJjevdRf61HYk998R5vVMMNmrHESYZVDS5DSWs+1srPLPKxXPkeSDOA==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-validate": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.6.3.tgz", + "integrity": "sha512-e7KWZcAIX+2W1o3cHfnqpGajdCs1jSM3DkXjGeLSNmCazv1EeI1ggTeK5wdZhF+7N+g44JI2Od3veojoaumlfg==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.6.3" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-watcher": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.6.4.tgz", + "integrity": "sha512-oqUWvx6+On04ShsT00Ir9T4/FvBeEh2M9PTubgITPxDa739p4hoQweWPRGyYeaojgT0xTpZKF0Y/rSY1UgMxvQ==", + "dev": true, + "requires": { + "@jest/test-result": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.6.3", + "string-length": "^4.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-worker": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", + "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", + "dev": true, + "requires": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true + }, + "leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "lil-gui": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/lil-gui/-/lil-gui-0.17.0.tgz", + "integrity": "sha512-MVBHmgY+uEbmJNApAaPbtvNh1RCAeMnKym82SBjtp5rODTYKWtM+MXHCifLe2H2Ti1HuBGBtK/5SyG4ShQ3pUQ==", + "dev": true + }, + "lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, + "loader-runner": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", + "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", + "dev": true + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "requires": { + "semver": "^7.5.3" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "requires": { + "tmpl": "1.0.5" + } + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "meshoptimizer": { + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/meshoptimizer/-/meshoptimizer-0.18.1.tgz", + "integrity": "sha512-ZhoIoL7TNV4s5B6+rx5mC//fw8/POGyNxS/DZyCJeiZ12ScLfVwRE/GfsxwiTkMYYD5DmK2/JXnEVXqL4rF+Sw==", + "dev": true + }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "requires": { + "mime-db": "1.52.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "molangjs": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/molangjs/-/molangjs-1.6.2.tgz", + "integrity": "sha512-x4qOvd+kFl9Om99RIjbAFMRHem3D2ZaGqA+7dm9qQWirX4lKp6m7E+vCQy+IcW1IOoHqers88sUqr1CTNHOhAA==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "nanoid": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "dev": true + }, + "node-releases": { + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", + "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", + "dev": true + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true + }, + "pirates": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", + "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "postcss": { + "version": "8.4.28", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.28.tgz", + "integrity": "sha512-Z7V5j0cq8oEKyejIKfpD8b4eBy9cwW2JWPk0+fB1HOAMsfHbnAXLLS+PfVWlzMSLQaWttKDt607I0XHmpE67Vw==", + "dev": true, + "requires": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + } + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "pretty-format": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.3.tgz", + "integrity": "sha512-ZsBgjVhFAj5KeK+nHfF1305/By3lechHQSMWCTl8iHSbfOm2TN5nHEtFc/+W7fAyUeCs2n5iow72gld4gW0xDw==", + "dev": true, + "requires": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true + } + } + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "requires": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "pure-rand": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.2.tgz", + "integrity": "sha512-6Yg0ekpKICSjPswYOuC5sku/TSWaRYlA0qsXqJgM/d/4pLPHPuTxK7Nbf7jFKzAeedUhR8C7K9Uv63FBsSo8xQ==", + "dev": true + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, + "rechoir": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", + "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==", + "dev": true, + "requires": { + "resolve": "^1.20.0" + } + }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true + }, + "resolve": { + "version": "1.22.4", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.4.tgz", + "integrity": "sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==", + "dev": true, + "requires": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "requires": { + "resolve-from": "^5.0.0" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "resolve.exports": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", + "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", + "dev": true + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, + "schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + } + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==" + }, + "serialize-javascript": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", + "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "requires": { + "kind-of": "^6.0.2" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true + }, + "source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "stack-utils": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", + "dev": true, + "requires": { + "escape-string-regexp": "^2.0.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + } + } + }, + "string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "requires": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true + }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + } + }, + "tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true + }, + "terser": { + "version": "5.19.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.2.tgz", + "integrity": "sha512-qC5+dmecKJA4cpYxRa5aVkKehYsQKc+AHeKl0Oe62aYjBL8ZA33tTljktDHJSaxxMnbI5ZYw+o/S2DxxLu8OfA==", + "dev": true, + "requires": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "dependencies": { + "acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "dev": true + } + } + }, + "terser-webpack-plugin": { + "version": "5.3.9", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz", + "integrity": "sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==", + "dev": true, + "requires": { + "@jridgewell/trace-mapping": "^0.3.17", + "jest-worker": "^27.4.5", + "schema-utils": "^3.1.1", + "serialize-javascript": "^6.0.1", + "terser": "^5.16.8" + } + }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "three": { + "version": "0.129.0", + "resolved": "https://registry.npmjs.org/three/-/three-0.129.0.tgz", + "integrity": "sha512-wiWio1yVRg2Oj6WEWsTHQo5eSzYpEwSBtPSi3OofNpvFbf26HFfb9kw4FZJNjII4qxzp0b1xLB11+tKkBGB1ZA==", + "dev": true + }, + "tinycolor2": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.6.0.tgz", + "integrity": "sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==", + "dev": true + }, + "tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "ts-api-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.2.tgz", + "integrity": "sha512-Cbu4nIqnEdd+THNEsBdkolnOXhg0I8XteoHaEKgvsxpsbWda4IsUut2c187HxywQCvveojow0Dgw/amxtSKVkQ==", + "dev": true, + "requires": {} + }, + "ts-jest": { + "version": "29.1.1", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.1.tgz", + "integrity": "sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==", + "dev": true, + "requires": { + "bs-logger": "0.x", + "fast-json-stable-stringify": "2.x", + "jest-util": "^29.0.0", + "json5": "^2.2.3", + "lodash.memoize": "4.x", + "make-error": "1.x", + "semver": "^7.5.3", + "yargs-parser": "^21.0.1" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "ts-loader": { + "version": "9.4.4", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.4.tgz", + "integrity": "sha512-MLukxDHBl8OJ5Dk3y69IsKVFRA/6MwzEqBgh+OXMPB/OD01KQuWPFd1WAQP8a5PeSCAxfnkhiuWqfmFJzJQt9w==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "enhanced-resolve": "^5.0.0", + "micromatch": "^4.0.0", + "semver": "^7.3.4" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "tslib": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", + "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", + "dev": true + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, + "typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true + }, + "update-browserslist-db": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", + "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", + "dev": true, + "requires": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + } + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "v8-compile-cache": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", + "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", + "dev": true + }, + "v8-to-istanbul": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", + "integrity": "sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==", + "dev": true, + "requires": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0" + }, + "dependencies": { + "convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + } + } + }, + "vue": { + "version": "2.7.14", + "resolved": "https://registry.npmjs.org/vue/-/vue-2.7.14.tgz", + "integrity": "sha512-b2qkFyOM0kwqWFuQmgd4o+uHGU7T+2z3T+WQp8UBjADfEv2n4FEMffzBmCKNP0IGzOEEfYjvtcC62xaSKeQDrQ==", + "dev": true, + "requires": { + "@vue/compiler-sfc": "2.7.14", + "csstype": "^3.1.0" + } + }, + "walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "dev": true, + "requires": { + "makeerror": "1.0.12" + } + }, + "watchpack": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", + "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", + "dev": true, + "requires": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + } + }, + "webpack": { + "version": "5.88.2", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.88.2.tgz", + "integrity": "sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ==", + "dev": true, + "requires": { + "@types/eslint-scope": "^3.7.3", + "@types/estree": "^1.0.0", + "@webassemblyjs/ast": "^1.11.5", + "@webassemblyjs/wasm-edit": "^1.11.5", + "@webassemblyjs/wasm-parser": "^1.11.5", + "acorn": "^8.7.1", + "acorn-import-assertions": "^1.9.0", + "browserslist": "^4.14.5", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.15.0", + "es-module-lexer": "^1.2.1", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.9", + "json-parse-even-better-errors": "^2.3.1", + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^3.2.0", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.3.7", + "watchpack": "^2.4.0", + "webpack-sources": "^3.2.3" + }, + "dependencies": { + "acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "dev": true + }, + "acorn-import-assertions": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", + "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", + "dev": true, + "requires": {} + } + } + }, + "webpack-cli": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.4.tgz", + "integrity": "sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg==", + "dev": true, + "requires": { + "@discoveryjs/json-ext": "^0.5.0", + "@webpack-cli/configtest": "^2.1.1", + "@webpack-cli/info": "^2.0.2", + "@webpack-cli/serve": "^2.0.5", + "colorette": "^2.0.14", + "commander": "^10.0.1", + "cross-spawn": "^7.0.3", + "envinfo": "^7.7.3", + "fastest-levenshtein": "^1.0.12", + "import-local": "^3.0.2", + "interpret": "^3.1.1", + "rechoir": "^0.8.0", + "webpack-merge": "^5.7.3" + }, + "dependencies": { + "commander": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "dev": true + } + } + }, + "webpack-merge": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.9.0.tgz", + "integrity": "sha512-6NbRQw4+Sy50vYNTw7EyOn41OZItPiXB8GNv3INSoe3PSFaHJEz3SHTrYVaRm2LilNGnFUzh0FAwqPEmU/CwDg==", + "dev": true, + "requires": { + "clone-deep": "^4.0.1", + "wildcard": "^2.0.0" + } + }, + "webpack-sources": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", + "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "wildcard": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz", + "integrity": "sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==", + "dev": true + }, + "wintersky": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/wintersky/-/wintersky-1.2.1.tgz", + "integrity": "sha512-fI3XPnDBdKD0uPcb9HPWQzeLXfZOLyJnBiT/A83sdNz4d8jz4I5xTIh3AUnrhZrES9l/q7kG32FJlAXL6e7clw==", + "dev": true, + "requires": { + "molangjs": "^1.6.1", + "three": "^0.147.0", + "tinycolor2": "^1.4.2" + }, + "dependencies": { + "three": { + "version": "0.147.0", + "resolved": "https://registry.npmjs.org/three/-/three-0.147.0.tgz", + "integrity": "sha512-LPTOslYQXFkmvceQjFTNnVVli2LaVF6C99Pv34fJypp8NbQLbTlu3KinZ0zURghS5zEehK+VQyvWuPZ/Sm8fzw==", + "dev": true + } + } + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, + "write-file-atomic": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + } + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + }, + "yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "requires": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, + "yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true + } + } +} diff --git a/plugins/animation_utils/src/package.json b/plugins/animation_utils/src/package.json new file mode 100644 index 00000000..03df0a16 --- /dev/null +++ b/plugins/animation_utils/src/package.json @@ -0,0 +1,54 @@ +{ + "name": "animation_utils", + "version": "3.1.0", + "private": true, + "description": "GeckoLib", + "main": "index.js", + "scripts": { + "prebuild": "npm run test", + "build": "npm run build:only", + "build:only": "webpack && npm run update_manifest", + "update_manifest": "node scripts/updateManifest.mjs", + "start": "webpack --watch --mode=development", + "lint": "eslint .", + "lint:fix": "eslint --fix .", + "tsc": "tsc --noEmit", + "pretest": "npm run lint && npm run tsc", + "test": "npm run test:only", + "test:only": "jest" + }, + "author": "Eliot Lash, Gecko, McHorse, AzureDoom", + "license": "MIT", + "blockbenchConfig": { + "title": "GeckoLib Animation Utils", + "author": "Eliot Lash, Gecko, McHorse, AzureDoom, Tslat", + "icon": "icon.png", + "description": "Create animated blocks, items, entities, and armor using the GeckoLib library and plugin.", + "min_version": "4.8.0", + "max_version": "5.0.0", + "variant": "both" + }, + "sideEffects": [ + "./index.js" + ], + "devDependencies": { + "@types/jest": "^29.5.4", + "@types/lodash": "^4.14.197", + "@typescript-eslint/eslint-plugin": "^6.5.0", + "@typescript-eslint/parser": "^6.5.0", + "blockbench-types": "^4.9.0", + "eol": "0.9.1", + "eslint": "^7.7.0", + "indent-string": "^5.0.0", + "jest": "^29.6.4", + "ts-jest": "^29.1.1", + "ts-loader": "^9.4.4", + "typescript": "^4.9.5", + "webpack": "^5.88.2", + "webpack-cli": "^5.1.4" + }, + "dependencies": { + "lodash": "^4.17.21", + "semver": "7.3.2" + } +} diff --git a/plugins/animation_utils/src/scripts/updateManifest.mjs b/plugins/animation_utils/src/scripts/updateManifest.mjs new file mode 100644 index 00000000..0650620b --- /dev/null +++ b/plugins/animation_utils/src/scripts/updateManifest.mjs @@ -0,0 +1,41 @@ +// @ts-check +import indentString from 'indent-string'; +import path from 'path'; +import fs from 'fs'; +import eol from 'eol'; +import * as url from 'url'; +// @ts-ignore +const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); + +const PACKAGE_JSON_PATH = path.join(__dirname, '../package.json'); +const PLUGINS_MANIFEST_PATH = path.join(__dirname, '..', '..', '..', '..', 'plugins.json'); + +const pluginsString = fs.readFileSync(PLUGINS_MANIFEST_PATH, { encoding: 'utf8' }); +const pluginsObj = JSON.parse(pluginsString); + +const packageJsonString = fs.readFileSync(PACKAGE_JSON_PATH, { encoding: 'utf8' }); +const { version, blockbenchConfig } = JSON.parse(packageJsonString); + +// console.log({ version, blockbenchConfig }); + +const newAnimationUtilsManifest = Object.assign( + {}, + pluginsObj.animation_utils, + { version }, + blockbenchConfig, +); +const newAnimationUtilsManifestString = + indentString( + JSON.stringify(newAnimationUtilsManifest, null, '\t'), + 1, + { indent: '\t' } + ) + .trimStart(); + +const newPluginsString = pluginsString.replace(/("animation_utils":\s*)({[\s\S.]*?})/, `$1${newAnimationUtilsManifestString}`); + +fs.writeFileSync(PLUGINS_MANIFEST_PATH, eol.lf(newPluginsString)); + +// console.log('manifest', manifest); + +// console.log(`Wrote manifest to ${PACKAGE_MANIFEST_PATH}.`); \ No newline at end of file diff --git a/src/animation_utils/settings.js b/plugins/animation_utils/src/settings.ts similarity index 80% rename from src/animation_utils/settings.js rename to plugins/animation_utils/src/settings.ts index 1407bb4c..61fccb85 100644 --- a/src/animation_utils/settings.js +++ b/plugins/animation_utils/src/settings.ts @@ -1,6 +1,6 @@ import armorTemplate from './armorTemplate.json'; -const makeOptions = arr => Object.fromEntries(arr.map(x => [x, x])); +const makeOptions = (arr: T[]) => Object.fromEntries(arr.map(x => [x, x])); export const MOD_SDK_1_15_FORGE = 'Forge 1.12 - 1.16'; export const MOD_SDK_1_15_FABRIC = 'Fabric 1.15 - 1.16'; @@ -27,7 +27,11 @@ export const GECKO_SETTINGS_DEFAULT = { }; Object.freeze(GECKO_SETTINGS_DEFAULT); -let geckoSettings = Object.assign({}, GECKO_SETTINGS_DEFAULT); +export type GeckoSettings = typeof GECKO_SETTINGS_DEFAULT & { + itemModelPath?: string; +} + +const geckoSettings: GeckoSettings = Object.assign({}, GECKO_SETTINGS_DEFAULT); export function onSettingsChanged() { if(Format.id === "animated_entity_model") { @@ -37,13 +41,13 @@ export function onSettingsChanged() { switch(geckoSettings.objectType) { case OBJ_TYPE_ARMOR: { if(Outliner.root.length === 0) { - Codecs.project.parse(armorTemplate); + Codecs.project.parse(armorTemplate, null); } else { alert('Unable to load Armor Template as this would overwrite the current model. Please select Armor type on an empty project if you want to use the Armor Template.'); } break; } case OBJ_TYPE_BLOCK_ITEM: { - Project.parent = 'builtin/entity'; + if (Project) Project.parent = 'builtin/entity'; break; } } diff --git a/plugins/animation_utils/src/tests/easing.test.ts b/plugins/animation_utils/src/tests/easing.test.ts new file mode 100644 index 00000000..93acdc8a --- /dev/null +++ b/plugins/animation_utils/src/tests/easing.test.ts @@ -0,0 +1,20 @@ +import { reverseEasing } from '../easing'; + +describe('easing', () => { + describe('reverseEasing', () => { + it('should return the easing parameter if it is falsy', () => { + expect(reverseEasing(undefined)).toEqual(undefined); + expect(reverseEasing(null)).toEqual(null); + }); + + it('should not change direction of non-directional easings', () => { + expect(reverseEasing("linear")).toEqual("linear"); + expect(reverseEasing("easeInOutBack")).toEqual("easeInOutBack"); + }); + + it('should change easeIn to easeOut and vice versa', () => { + expect(reverseEasing("easeInBack")).toEqual("easeOutBack"); + expect(reverseEasing("easeOutBack")).toEqual("easeInBack"); + }); + }); +}); \ No newline at end of file diff --git a/plugins/animation_utils/src/tsconfig.json b/plugins/animation_utils/src/tsconfig.json new file mode 100644 index 00000000..b92ea0dd --- /dev/null +++ b/plugins/animation_utils/src/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "outDir": "'../../plugins", + // "noImplicitAny": true, + "module": "es6", + "target": "ES2017", + "allowJs": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "moduleResolution": "node", + // "typeRoots": ["./node_modules/@types", "./node_modules/blockbench-types"] + } +} \ No newline at end of file diff --git a/plugins/animation_utils/src/types/blockbench-types.d.ts b/plugins/animation_utils/src/types/blockbench-types.d.ts new file mode 100644 index 00000000..05bfa5c2 --- /dev/null +++ b/plugins/animation_utils/src/types/blockbench-types.d.ts @@ -0,0 +1 @@ +/// \ No newline at end of file diff --git a/src/animation_utils/utils.js b/plugins/animation_utils/src/utils.ts similarity index 100% rename from src/animation_utils/utils.js rename to plugins/animation_utils/src/utils.ts diff --git a/plugins/animation_utils/src/webpack.config.js b/plugins/animation_utils/src/webpack.config.js new file mode 100644 index 00000000..071d9496 --- /dev/null +++ b/plugins/animation_utils/src/webpack.config.js @@ -0,0 +1,24 @@ +const PathModule = require('path') + +module.exports = { + mode: 'development', + devtool: false, + target: 'node', + entry: './index.ts', + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + ], + }, + resolve: { + extensions: ['.tsx', '.ts', '.js'], + }, + output: { + filename: 'animation_utils.js', + path: PathModule.resolve(__dirname, '..') + } +} diff --git a/plugins/azurelib_utils/LICENSE.MD b/plugins/azurelib_utils/LICENSE.MD new file mode 100644 index 00000000..9cf10627 --- /dev/null +++ b/plugins/azurelib_utils/LICENSE.MD @@ -0,0 +1,19 @@ +MIT License + +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/plugins/azurelib_utils/about.md b/plugins/azurelib_utils/about.md index 7bf40c92..d13d0b7b 100644 --- a/plugins/azurelib_utils/about.md +++ b/plugins/azurelib_utils/about.md @@ -22,14 +22,15 @@ repositories { dependencies { //Common 1.20.1+ Latest Only - compileOnly "mod.azure.azurelib:azurelib-common-MCVERSION:MODVERSION" + compileOnly "mod.azure.azurelib:azurelib-common-MCVER:MODVER" //Fabric or Quilt and older - modImplementation "mod.azure.azurelib:azurelib-fabric-MCVERSION:MODVERSION" - modApi "com.terraformersmc:modmenu:VERSION" // Fabric bug is requiring this + modImplementation "mod.azure.azurelib:azurelib-fabric-MCVER:MODVER" + //Fabric bug is requiring this + modApi "com.terraformersmc:modmenu:VERSION" //Forge 1.20.1 and older (Forge is no longer supported) - implementation fg.deobf("mod.azure.azurelib:azurelib-forge-MCVERSION:MODVERSION") + implementation fg.deobf("mod.azure.azurelib:azurelib-forge-MCVER:MODVER") //NeoForge 1.20.1 implementation fg.deobf("mod.azure.azurelib:azurelib-neo-MCVER:MODVER") diff --git a/plugins/azurelib_utils/azurelib_utils.js b/plugins/azurelib_utils/azurelib_utils.js index cce099ae..92fdf02e 100644 --- a/plugins/azurelib_utils/azurelib_utils.js +++ b/plugins/azurelib_utils/azurelib_utils.js @@ -1 +1 @@ -(()=>{var e={8552:(e,t,r)=>{var n=r(852)(r(5639),"DataView");e.exports=n},1989:(e,t,r)=>{var n=r(1789),i=r(401),o=r(7667),s=r(1327),a=r(1866);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t{var n=r(7040),i=r(4125),o=r(2117),s=r(7518),a=r(4705);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t{var n=r(852)(r(5639),"Map");e.exports=n},3369:(e,t,r)=>{var n=r(4785),i=r(1285),o=r(6e3),s=r(9916),a=r(5265);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t{var n=r(852)(r(5639),"Promise");e.exports=n},8525:(e,t,r)=>{var n=r(852)(r(5639),"Set");e.exports=n},8668:(e,t,r)=>{var n=r(3369),i=r(619),o=r(2385);function s(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t{var n=r(8407),i=r(7465),o=r(3779),s=r(7599),a=r(4758),l=r(4309);function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=s,c.prototype.has=a,c.prototype.set=l,e.exports=c},2705:(e,t,r)=>{var n=r(5639).Symbol;e.exports=n},1149:(e,t,r)=>{var n=r(5639).Uint8Array;e.exports=n},577:(e,t,r)=>{var n=r(852)(r(5639),"WeakMap");e.exports=n},6874:e=>{e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},7412:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r{var n=r(2118);e.exports=function(e,t){return!(null==e||!e.length)&&n(e,t,0)>-1}},1196:e=>{e.exports=function(e,t,r){for(var n=-1,i=null==e?0:e.length;++n{var n=r(2545),i=r(5694),o=r(1469),s=r(4144),a=r(5776),l=r(6719),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=o(e),u=!r&&i(e),p=!r&&!u&&s(e),h=!r&&!u&&!p&&l(e),f=r||u||p||h,d=f?n(e.length,String):[],v=d.length;for(var m in e)!t&&!c.call(e,m)||f&&("length"==m||p&&("offset"==m||"parent"==m)||h&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||a(m,v))||d.push(m);return d}},9932:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r{e.exports=function(e,t){for(var r=-1,n=t.length,i=e.length;++r{var n=r(9465),i=r(7813),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var s=e[t];o.call(e,t)&&i(s,r)&&(void 0!==r||t in e)||n(e,t,r)}},8470:(e,t,r)=>{var n=r(7813);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},4037:(e,t,r)=>{var n=r(8363),i=r(3674);e.exports=function(e,t){return e&&n(t,i(t),e)}},3886:(e,t,r)=>{var n=r(8363),i=r(1704);e.exports=function(e,t){return e&&n(t,i(t),e)}},9465:(e,t,r)=>{var n=r(8777);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},5990:(e,t,r)=>{var n=r(6384),i=r(7412),o=r(4865),s=r(4037),a=r(3886),l=r(4626),c=r(278),u=r(8805),p=r(1911),h=r(8234),f=r(6904),d=r(4160),v=r(3824),m=r(9148),g=r(8517),y=r(1469),b=r(4144),E=r(6688),x=r(3218),_=r(2928),A=r(3674),O=r(1704),w="[object Arguments]",I="[object Function]",j="[object Object]",$={};$[w]=$["[object Array]"]=$["[object ArrayBuffer]"]=$["[object DataView]"]=$["[object Boolean]"]=$["[object Date]"]=$["[object Float32Array]"]=$["[object Float64Array]"]=$["[object Int8Array]"]=$["[object Int16Array]"]=$["[object Int32Array]"]=$["[object Map]"]=$["[object Number]"]=$[j]=$["[object RegExp]"]=$["[object Set]"]=$["[object String]"]=$["[object Symbol]"]=$["[object Uint8Array]"]=$["[object Uint8ClampedArray]"]=$["[object Uint16Array]"]=$["[object Uint32Array]"]=!0,$["[object Error]"]=$[I]=$["[object WeakMap]"]=!1,e.exports=function e(t,r,k,R,L,N){var T,S=1&r,P=2&r,M=4&r;if(k&&(T=L?k(t,R,L,N):k(t)),void 0!==T)return T;if(!x(t))return t;var C=y(t);if(C){if(T=v(t),!S)return c(t,T)}else{var B=d(t),F=B==I||"[object GeneratorFunction]"==B;if(b(t))return l(t,S);if(B==j||B==w||F&&!L){if(T=P||F?{}:g(t),!S)return P?p(t,a(T,t)):u(t,s(T,t))}else{if(!$[B])return L?t:{};T=m(t,B,S)}}N||(N=new n);var D=N.get(t);if(D)return D;N.set(t,T),_(t)?t.forEach((function(n){T.add(e(n,r,k,n,t,N))})):E(t)&&t.forEach((function(n,i){T.set(i,e(n,r,k,i,t,N))}));var z=C?void 0:(M?P?f:h:P?O:A)(t);return i(z||t,(function(n,i){z&&(n=t[i=n]),o(T,i,e(n,r,k,i,t,N))})),T}},3118:(e,t,r)=>{var n=r(3218),i=Object.create,o=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=o},1848:e=>{e.exports=function(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o{var n=r(2488),i=r(7285);e.exports=function e(t,r,o,s,a){var l=-1,c=t.length;for(o||(o=i),a||(a=[]);++l0&&o(u)?r>1?e(u,r-1,o,s,a):n(a,u):s||(a[a.length]=u)}return a}},7786:(e,t,r)=>{var n=r(1811),i=r(327);e.exports=function(e,t){for(var r=0,o=(t=n(t,e)).length;null!=e&&r{var n=r(2488),i=r(1469);e.exports=function(e,t,r){var o=t(e);return i(e)?o:n(o,r(e))}},4239:(e,t,r)=>{var n=r(2705),i=r(9607),o=r(2333),s=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?i(e):o(e)}},2118:(e,t,r)=>{var n=r(1848),i=r(2722),o=r(2351);e.exports=function(e,t,r){return t==t?o(e,t,r):n(e,i,r)}},9454:(e,t,r)=>{var n=r(4239),i=r(7005);e.exports=function(e){return i(e)&&"[object Arguments]"==n(e)}},5588:(e,t,r)=>{var n=r(4160),i=r(7005);e.exports=function(e){return i(e)&&"[object Map]"==n(e)}},2722:e=>{e.exports=function(e){return e!=e}},8458:(e,t,r)=>{var n=r(3560),i=r(5346),o=r(3218),s=r(346),a=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,u=l.toString,p=c.hasOwnProperty,h=RegExp("^"+u.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(n(e)?h:a).test(s(e))}},9221:(e,t,r)=>{var n=r(4160),i=r(7005);e.exports=function(e){return i(e)&&"[object Set]"==n(e)}},8749:(e,t,r)=>{var n=r(4239),i=r(1780),o=r(7005),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!s[n(e)]}},280:(e,t,r)=>{var n=r(5726),i=r(6916),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=[];for(var r in Object(e))o.call(e,r)&&"constructor"!=r&&t.push(r);return t}},313:(e,t,r)=>{var n=r(3218),i=r(5726),o=r(3498),s=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return o(e);var t=i(e),r=[];for(var a in e)("constructor"!=a||!t&&s.call(e,a))&&r.push(a);return r}},6560:(e,t,r)=>{var n=r(5703),i=r(8777),o=r(6557),s=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:o;e.exports=s},4259:e=>{e.exports=function(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n{e.exports=function(e,t){for(var r=-1,n=Array(e);++r{var n=r(2705),i=r(9932),o=r(1469),s=r(3448),a=n?n.prototype:void 0,l=a?a.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(s(t))return l?l.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}},1717:e=>{e.exports=function(e){return function(t){return e(t)}}},5652:(e,t,r)=>{var n=r(8668),i=r(7443),o=r(1196),s=r(4757),a=r(3593),l=r(1814);e.exports=function(e,t,r){var c=-1,u=i,p=e.length,h=!0,f=[],d=f;if(r)h=!1,u=o;else if(p>=200){var v=t?null:a(e);if(v)return l(v);h=!1,u=s,d=new n}else d=t?[]:f;e:for(;++c{var n=r(1811),i=r(928),o=r(292),s=r(327);e.exports=function(e,t){return t=n(t,e),null==(e=o(e,t))||delete e[s(i(t))]}},4757:e=>{e.exports=function(e,t){return e.has(t)}},1811:(e,t,r)=>{var n=r(1469),i=r(5403),o=r(5514),s=r(9833);e.exports=function(e,t){return n(e)?e:i(e,t)?[e]:o(s(e))}},4318:(e,t,r)=>{var n=r(1149);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},4626:(e,t,r)=>{e=r.nmd(e);var n=r(5639),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,s=o&&o.exports===i?n.Buffer:void 0,a=s?s.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=a?a(r):new e.constructor(r);return e.copy(n),n}},7157:(e,t,r)=>{var n=r(4318);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}},3147:e=>{var t=/\w*$/;e.exports=function(e){var r=new e.constructor(e.source,t.exec(e));return r.lastIndex=e.lastIndex,r}},419:(e,t,r)=>{var n=r(2705),i=n?n.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},7133:(e,t,r)=>{var n=r(4318);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},278:e=>{e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r{var n=r(4865),i=r(9465);e.exports=function(e,t,r,o){var s=!r;r||(r={});for(var a=-1,l=t.length;++a{var n=r(8363),i=r(9551);e.exports=function(e,t){return n(e,i(e),t)}},1911:(e,t,r)=>{var n=r(8363),i=r(1442);e.exports=function(e,t){return n(e,i(e),t)}},4429:(e,t,r)=>{var n=r(5639)["__core-js_shared__"];e.exports=n},3593:(e,t,r)=>{var n=r(8525),i=r(308),o=r(1814),s=n&&1/o(new n([,-0]))[1]==1/0?function(e){return new n(e)}:i;e.exports=s},696:(e,t,r)=>{var n=r(8630);e.exports=function(e){return n(e)?void 0:e}},8777:(e,t,r)=>{var n=r(852),i=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},9021:(e,t,r)=>{var n=r(5564),i=r(5357),o=r(61);e.exports=function(e){return o(i(e,void 0,n),e+"")}},1957:e=>{var t="object"==typeof global&&global&&global.Object===Object&&global;e.exports=t},8234:(e,t,r)=>{var n=r(8866),i=r(9551),o=r(3674);e.exports=function(e){return n(e,o,i)}},6904:(e,t,r)=>{var n=r(8866),i=r(1442),o=r(1704);e.exports=function(e){return n(e,o,i)}},5050:(e,t,r)=>{var n=r(7019);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},852:(e,t,r)=>{var n=r(8458),i=r(7801);e.exports=function(e,t){var r=i(e,t);return n(r)?r:void 0}},5924:(e,t,r)=>{var n=r(5569)(Object.getPrototypeOf,Object);e.exports=n},9607:(e,t,r)=>{var n=r(2705),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,a),r=e[a];try{e[a]=void 0;var n=!0}catch(e){}var i=s.call(e);return n&&(t?e[a]=r:delete e[a]),i}},9551:(e,t,r)=>{var n=r(4963),i=r(479),o=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,a=s?function(e){return null==e?[]:(e=Object(e),n(s(e),(function(t){return o.call(e,t)})))}:i;e.exports=a},1442:(e,t,r)=>{var n=r(2488),i=r(5924),o=r(9551),s=r(479),a=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,o(e)),e=i(e);return t}:s;e.exports=a},4160:(e,t,r)=>{var n=r(8552),i=r(7071),o=r(3818),s=r(8525),a=r(577),l=r(4239),c=r(346),u="[object Map]",p="[object Promise]",h="[object Set]",f="[object WeakMap]",d="[object DataView]",v=c(n),m=c(i),g=c(o),y=c(s),b=c(a),E=l;(n&&E(new n(new ArrayBuffer(1)))!=d||i&&E(new i)!=u||o&&E(o.resolve())!=p||s&&E(new s)!=h||a&&E(new a)!=f)&&(E=function(e){var t=l(e),r="[object Object]"==t?e.constructor:void 0,n=r?c(r):"";if(n)switch(n){case v:return d;case m:return u;case g:return p;case y:return h;case b:return f}return t}),e.exports=E},7801:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},1789:(e,t,r)=>{var n=r(4536);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},401:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},7667:(e,t,r)=>{var n=r(4536),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return i.call(t,e)?t[e]:void 0}},1327:(e,t,r)=>{var n=r(4536),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:i.call(t,e)}},1866:(e,t,r)=>{var n=r(4536);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},3824:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var r=e.length,n=new e.constructor(r);return r&&"string"==typeof e[0]&&t.call(e,"index")&&(n.index=e.index,n.input=e.input),n}},9148:(e,t,r)=>{var n=r(4318),i=r(7157),o=r(3147),s=r(419),a=r(7133);e.exports=function(e,t,r){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return n(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return i(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return a(e,r);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return o(e);case"[object Symbol]":return s(e)}}},8517:(e,t,r)=>{var n=r(3118),i=r(5924),o=r(5726);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:n(i(e))}},7285:(e,t,r)=>{var n=r(2705),i=r(5694),o=r(1469),s=n?n.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(s&&e&&e[s])}},5776:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e{var n=r(1469),i=r(3448),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;e.exports=function(e,t){if(n(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!i(e))||s.test(e)||!o.test(e)||null!=t&&e in Object(t)}},7019:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},5346:(e,t,r)=>{var n,i=r(4429),o=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!o&&o in e}},5726:e=>{var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},7040:e=>{e.exports=function(){this.__data__=[],this.size=0}},4125:(e,t,r)=>{var n=r(8470),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0||(r==t.length-1?t.pop():i.call(t,r,1),--this.size,0))}},2117:(e,t,r)=>{var n=r(8470);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},7518:(e,t,r)=>{var n=r(8470);e.exports=function(e){return n(this.__data__,e)>-1}},4705:(e,t,r)=>{var n=r(8470);e.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},4785:(e,t,r)=>{var n=r(1989),i=r(8407),o=r(7071);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||i),string:new n}}},1285:(e,t,r)=>{var n=r(5050);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},6e3:(e,t,r)=>{var n=r(5050);e.exports=function(e){return n(this,e).get(e)}},9916:(e,t,r)=>{var n=r(5050);e.exports=function(e){return n(this,e).has(e)}},5265:(e,t,r)=>{var n=r(5050);e.exports=function(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}},4523:(e,t,r)=>{var n=r(8306);e.exports=function(e){var t=n(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}},4536:(e,t,r)=>{var n=r(852)(Object,"create");e.exports=n},6916:(e,t,r)=>{var n=r(5569)(Object.keys,Object);e.exports=n},3498:e=>{e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},1167:(e,t,r)=>{e=r.nmd(e);var n=r(1957),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,s=o&&o.exports===i&&n.process,a=function(){try{return o&&o.require&&o.require("util").types||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=a},2333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},5357:(e,t,r)=>{var n=r(6874),i=Math.max;e.exports=function(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,s=-1,a=i(o.length-t,0),l=Array(a);++s{var n=r(7786),i=r(4259);e.exports=function(e,t){return t.length<2?e:n(e,i(t,0,-1))}},5639:(e,t,r)=>{var n=r(1957),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();e.exports=o},619:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},2385:e=>{e.exports=function(e){return this.__data__.has(e)}},1814:e=>{e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}},61:(e,t,r)=>{var n=r(6560),i=r(1275)(n);e.exports=i},1275:e=>{var t=Date.now;e.exports=function(e){var r=0,n=0;return function(){var i=t(),o=16-(i-n);if(n=i,o>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},7465:(e,t,r)=>{var n=r(8407);e.exports=function(){this.__data__=new n,this.size=0}},3779:e=>{e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},7599:e=>{e.exports=function(e){return this.__data__.get(e)}},4758:e=>{e.exports=function(e){return this.__data__.has(e)}},4309:(e,t,r)=>{var n=r(8407),i=r(7071),o=r(3369);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var s=r.__data__;if(!i||s.length<199)return s.push([e,t]),this.size=++r.size,this;r=this.__data__=new o(s)}return r.set(e,t),this.size=r.size,this}},2351:e=>{e.exports=function(e,t,r){for(var n=r-1,i=e.length;++n{var n=r(4523),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,s=n((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,r,n,i){t.push(n?i.replace(o,"$1"):r||e)})),t}));e.exports=s},327:(e,t,r)=>{var n=r(3448);e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},346:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},5703:e=>{e.exports=function(e){return function(){return e}}},7813:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},5564:(e,t,r)=>{var n=r(1078);e.exports=function(e){return null!=e&&e.length?n(e,1):[]}},6557:e=>{e.exports=function(e){return e}},5694:(e,t,r)=>{var n=r(9454),i=r(7005),o=Object.prototype,s=o.hasOwnProperty,a=o.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(e){return i(e)&&s.call(e,"callee")&&!a.call(e,"callee")};e.exports=l},1469:e=>{var t=Array.isArray;e.exports=t},8612:(e,t,r)=>{var n=r(3560),i=r(1780);e.exports=function(e){return null!=e&&i(e.length)&&!n(e)}},4144:(e,t,r)=>{e=r.nmd(e);var n=r(5639),i=r(5062),o=t&&!t.nodeType&&t,s=o&&e&&!e.nodeType&&e,a=s&&s.exports===o?n.Buffer:void 0,l=(a?a.isBuffer:void 0)||i;e.exports=l},3560:(e,t,r)=>{var n=r(4239),i=r(3218);e.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},6688:(e,t,r)=>{var n=r(5588),i=r(1717),o=r(1167),s=o&&o.isMap,a=s?i(s):n;e.exports=a},3218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},8630:(e,t,r)=>{var n=r(4239),i=r(5924),o=r(7005),s=Function.prototype,a=Object.prototype,l=s.toString,c=a.hasOwnProperty,u=l.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=n(e))return!1;var t=i(e);if(null===t)return!0;var r=c.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&l.call(r)==u}},2928:(e,t,r)=>{var n=r(9221),i=r(1717),o=r(1167),s=o&&o.isSet,a=s?i(s):n;e.exports=a},3448:(e,t,r)=>{var n=r(4239),i=r(7005);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==n(e)}},6719:(e,t,r)=>{var n=r(8749),i=r(1717),o=r(1167),s=o&&o.isTypedArray,a=s?i(s):n;e.exports=a},3674:(e,t,r)=>{var n=r(4636),i=r(280),o=r(8612);e.exports=function(e){return o(e)?n(e):i(e)}},1704:(e,t,r)=>{var n=r(4636),i=r(313),o=r(8612);e.exports=function(e){return o(e)?n(e,!0):i(e)}},928:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},8306:(e,t,r)=>{var n=r(3369);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(i.Cache||n),r}i.Cache=n,e.exports=i},308:e=>{e.exports=function(){}},7557:(e,t,r)=>{var n=r(9932),i=r(5990),o=r(7406),s=r(1811),a=r(8363),l=r(696),c=r(9021),u=r(6904),p=c((function(e,t){var r={};if(null==e)return r;var c=!1;t=n(t,(function(t){return t=s(t,e),c||(c=t.length>1),t})),a(e,u(e),r),c&&(r=i(r,7,l));for(var p=t.length;p--;)o(r,t[p]);return r}));e.exports=p},479:e=>{e.exports=function(){return[]}},5062:e=>{e.exports=function(){return!1}},9833:(e,t,r)=>{var n=r(531);e.exports=function(e){return null==e?"":n(e)}},4908:(e,t,r)=>{var n=r(5652);e.exports=function(e){return e&&e.length?n(e):[]}},2257:(e,t,r)=>{const n=Symbol("SemVer ANY");class i{static get ANY(){return n}constructor(e,t){if(t=o(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),c("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(e){const t=this.options.loose?s[a.COMPARATORLOOSE]:s[a.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new u(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(c("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new p(e.value,t).test(this.value):""===e.operator?""===e.value||new p(this.value,t).test(e.semver):!((t=o(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=i;const o=r(2893),{safeRe:s,t:a}=r(5765),l=r(7539),c=r(4225),u=r(6376),p=r(6902)},6902:(e,t,r)=>{class n{constructor(e,t){if(t=o(t),e instanceof n)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new n(e.raw,t);if(e instanceof s)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!m(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&g(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&d)|(this.options.loose&&v))+":"+e,r=i.get(t);if(r)return r;const n=this.options.loose,o=n?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(o,k(this.options.includePrerelease)),a("hyphen replace",e),e=e.replace(c[u.COMPARATORTRIM],p),a("comparator trim",e),e=e.replace(c[u.TILDETRIM],h),a("tilde trim",e),e=e.replace(c[u.CARETTRIM],f),a("caret trim",e);let l=e.split(" ").map((e=>b(e,this.options))).join(" ").split(/\s+/).map((e=>$(e,this.options)));n&&(l=l.filter((e=>(a("loose invalid filter",e,this.options),!!e.match(c[u.COMPARATORLOOSE]))))),a("range list",l);const g=new Map,y=l.map((e=>new s(e,this.options)));for(const e of y){if(m(e))return[e];g.set(e.value,e)}g.size>1&&g.has("")&&g.delete("");const E=[...g.values()];return i.set(t,E),E}intersects(e,t){if(!(e instanceof n))throw new TypeError("a Range is required");return this.set.some((r=>y(r,t)&&e.set.some((e=>y(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(let t=0;t"<0.0.0-0"===e.value,g=e=>""===e.value,y=(e,t)=>{let r=!0;const n=e.slice();let i=n.pop();for(;r&&n.length;)r=n.every((e=>i.intersects(e,t))),i=n.pop();return r},b=(e,t)=>(a("comp",e,t),e=A(e,t),a("caret",e),e=x(e,t),a("tildes",e),e=w(e,t),a("xrange",e),e=j(e,t),a("stars",e),e),E=e=>!e||"x"===e.toLowerCase()||"*"===e,x=(e,t)=>e.trim().split(/\s+/).map((e=>_(e,t))).join(" "),_=(e,t)=>{const r=t.loose?c[u.TILDELOOSE]:c[u.TILDE];return e.replace(r,((t,r,n,i,o)=>{let s;return a("tilde",e,t,r,n,i,o),E(r)?s="":E(n)?s=`>=${r}.0.0 <${+r+1}.0.0-0`:E(i)?s=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:o?(a("replaceTilde pr",o),s=`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`):s=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,a("tilde return",s),s}))},A=(e,t)=>e.trim().split(/\s+/).map((e=>O(e,t))).join(" "),O=(e,t)=>{a("caret",e,t);const r=t.loose?c[u.CARETLOOSE]:c[u.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,i,o,s)=>{let l;return a("caret",e,t,r,i,o,s),E(r)?l="":E(i)?l=`>=${r}.0.0${n} <${+r+1}.0.0-0`:E(o)?l="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:s?(a("replaceCaret pr",s),l="0"===r?"0"===i?`>=${r}.${i}.${o}-${s} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}-${s} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o}-${s} <${+r+1}.0.0-0`):(a("no pr"),l="0"===r?"0"===i?`>=${r}.${i}.${o}${n} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o} <${+r+1}.0.0-0`),a("caret return",l),l}))},w=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map((e=>I(e,t))).join(" ")),I=(e,t)=>{e=e.trim();const r=t.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(r,((r,n,i,o,s,l)=>{a("xRange",e,r,n,i,o,s,l);const c=E(i),u=c||E(o),p=u||E(s),h=p;return"="===n&&h&&(n=""),l=t.includePrerelease?"-0":"",c?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&h?(u&&(o=0),s=0,">"===n?(n=">=",u?(i=+i+1,o=0,s=0):(o=+o+1,s=0)):"<="===n&&(n="<",u?i=+i+1:o=+o+1),"<"===n&&(l="-0"),r=`${n+i}.${o}.${s}${l}`):u?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:p&&(r=`>=${i}.${o}.0${l} <${i}.${+o+1}.0-0`),a("xRange return",r),r}))},j=(e,t)=>(a("replaceStars",e,t),e.trim().replace(c[u.STAR],"")),$=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?u.GTE0PRE:u.GTE0],"")),k=e=>(t,r,n,i,o,s,a,l,c,u,p,h,f)=>`${r=E(n)?"":E(i)?`>=${n}.0.0${e?"-0":""}`:E(o)?`>=${n}.${i}.0${e?"-0":""}`:s?`>=${r}`:`>=${r}${e?"-0":""}`} ${l=E(c)?"":E(u)?`<${+c+1}.0.0-0`:E(p)?`<${c}.${+u+1}.0-0`:h?`<=${c}.${u}.${p}-${h}`:e?`<${c}.${u}.${+p+1}-0`:`<=${l}`}`.trim(),R=(e,t,r)=>{for(let r=0;r0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},6376:(e,t,r)=>{const n=r(4225),{MAX_LENGTH:i,MAX_SAFE_INTEGER:o}=r(3295),{safeRe:s,t:a}=r(5765),l=r(2893),{compareIdentifiers:c}=r(6742);class u{constructor(e,t){if(t=l(t),e instanceof u){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>i)throw new TypeError(`version is longer than ${i} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?s[a.LOOSE]:s[a.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=u},7539:(e,t,r)=>{const n=r(8718),i=r(1194),o=r(1312),s=r(5903),a=r(1544),l=r(2056);e.exports=(e,t,r,c)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,c);case"!=":return i(e,r,c);case">":return o(e,r,c);case">=":return s(e,r,c);case"<":return a(e,r,c);case"<=":return l(e,r,c);default:throw new TypeError(`Invalid operator: ${t}`)}}},9038:(e,t,r)=>{const n=r(6376),i=r(3959),{safeRe:o,t:s}=r(5765);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=o[s.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),o[s.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;o[s.COERCERTL].lastIndex=-1}else r=e.match(o[s.COERCE]);return null===r?null:i(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)}},6269:(e,t,r)=>{const n=r(6376);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},8718:(e,t,r)=>{const n=r(6269);e.exports=(e,t,r)=>0===n(e,t,r)},1312:(e,t,r)=>{const n=r(6269);e.exports=(e,t,r)=>n(e,t,r)>0},5903:(e,t,r)=>{const n=r(6269);e.exports=(e,t,r)=>n(e,t,r)>=0},1544:(e,t,r)=>{const n=r(6269);e.exports=(e,t,r)=>n(e,t,r)<0},2056:(e,t,r)=>{const n=r(6269);e.exports=(e,t,r)=>n(e,t,r)<=0},1194:(e,t,r)=>{const n=r(6269);e.exports=(e,t,r)=>0!==n(e,t,r)},3959:(e,t,r)=>{const n=r(6376);e.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}},5712:(e,t,r)=>{const n=r(6902);e.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}},3295:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},4225:e=>{const t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},6742:e=>{const t=/^[0-9]+$/,r=(e,r)=>{const n=t.test(e),i=t.test(r);return n&&i&&(e=+e,r=+r),e===r?0:n&&!i?-1:i&&!n?1:er(t,e)}},2893:e=>{const t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},5765:(e,t,r)=>{const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:o}=r(3295),s=r(4225),a=(t=e.exports={}).re=[],l=t.safeRe=[],c=t.src=[],u=t.t={};let p=0;const h="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",o],[h,i]],d=(e,t,r)=>{const n=(e=>{for(const[t,r]of f)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),i=p++;s(e,i,t),u[e]=i,c[i]=t,a[i]=new RegExp(t,r?"g":void 0),l[i]=new RegExp(n,r?"g":void 0)};d("NUMERICIDENTIFIER","0|[1-9]\\d*"),d("NUMERICIDENTIFIERLOOSE","\\d+"),d("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),d("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),d("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),d("PRERELEASEIDENTIFIER",`(?:${c[u.NUMERICIDENTIFIER]}|${c[u.NONNUMERICIDENTIFIER]})`),d("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NUMERICIDENTIFIERLOOSE]}|${c[u.NONNUMERICIDENTIFIER]})`),d("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),d("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),d("BUILDIDENTIFIER",`${h}+`),d("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),d("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),d("FULL",`^${c[u.FULLPLAIN]}$`),d("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),d("LOOSE",`^${c[u.LOOSEPLAIN]}$`),d("GTLT","((?:<|>)?=?)"),d("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),d("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),d("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),d("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),d("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),d("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),d("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),d("COERCERTL",c[u.COERCE],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",d("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),d("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),d("LONECARET","(?:\\^)"),d("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",d("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),d("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),d("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),d("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),d("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),d("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},6062:(e,t,r)=>{"use strict";const n=r(2221),i=Symbol("max"),o=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),u=Symbol("noDisposeOnSet"),p=Symbol("lruList"),h=Symbol("cache"),f=Symbol("updateAgeOnGet"),d=()=>1,v=(e,t,r)=>{const n=e[h].get(t);if(n){const t=n.value;if(m(e,t)){if(y(e,n),!e[a])return}else r&&(e[f]&&(n.value.now=Date.now()),e[p].unshiftNode(n));return t.value}},m=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[l]&&r>e[l]},g=e=>{if(e[o]>e[i])for(let t=e[p].tail;e[o]>e[i]&&null!==t;){const r=t.prev;y(e,t),t=r}},y=(e,t)=>{if(t){const r=t.value;e[c]&&e[c](r.key,r.value),e[o]-=r.length,e[h].delete(r.key),e[p].removeNode(t)}};class b{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}const E=(e,t,r,n)=>{let i=r.value;m(e,i)&&(y(e,r),e[a]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||1/0;const t=e.length||d;if(this[s]="function"!=typeof t?d:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[u]=e.noDisposeOnSet||!1,this[f]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,g(this)}get max(){return this[i]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,g(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=d),e!==this[s]&&(this[s]=e,this[o]=0,this[p].forEach((e=>{e.length=this[s](e.value,e.key),this[o]+=e.length}))),g(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[p].length}rforEach(e,t){t=t||this;for(let r=this[p].tail;null!==r;){const n=r.prev;E(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[p].head;null!==r;){const n=r.next;E(this,e,r,t),r=n}}keys(){return this[p].toArray().map((e=>e.key))}values(){return this[p].toArray().map((e=>e.value))}reset(){this[c]&&this[p]&&this[p].length&&this[p].forEach((e=>this[c](e.key,e.value))),this[h]=new Map,this[p]=new n,this[o]=0}dump(){return this[p].map((e=>!m(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[p]}set(e,t,r){if((r=r||this[l])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,a=this[s](t,e);if(this[h].has(e)){if(a>this[i])return y(this,this[h].get(e)),!1;const s=this[h].get(e).value;return this[c]&&(this[u]||this[c](e,s.value)),s.now=n,s.maxAge=r,s.value=t,this[o]+=a-s.length,s.length=a,this.get(e),g(this),!0}const f=new b(e,t,a,n,r);return f.length>this[i]?(this[c]&&this[c](e,t),!1):(this[o]+=f.length,this[p].unshift(f),this[h].set(e,this[p].head),g(this),!0)}has(e){if(!this[h].has(e))return!1;const t=this[h].get(e).value;return!m(this,t)}get(e){return v(this,e,!0)}peek(e){return v(this,e,!1)}pop(){const e=this[p].tail;return e?(y(this,e),e.value):null}del(e){y(this,this[h].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[h].forEach(((e,t)=>v(this,t,!1)))}}},9307:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},2221:(e,t,r)=>{"use strict";function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,i=arguments.length;r1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(tthis.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&ithis.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)r.push(o.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,o=this.head;null!==o&&n{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{"use strict";var e=r(9038),t=r.n(e),n=r(5712),i=r.n(n);const o=JSON.parse('{"i8":"1.0.7","Kd":{"title":"AzureLib Animator","author":"AzureDoom, Eliot Lash, Gecko, McHorse","icon":"azureicon.png","description":"Create animated blocks, items, entity, and armor using the AzureLib library and plugin. This is a fork of Geckolib and cross compatibility will not be promised in the future.","min_version":"4.8.0","max_version":"5.0.0","new_repository_format":"true","variant":"both","creation_date":"2023-04-04","contributes":{"formats":["azure_model"]},"has_changelog":true,"website":"https://wiki.azuredoom.com/readme-1"}}');var s=r(4908),a=r.n(s);class l{static step0(e){return e>0?1:0}static step1(e){return e>=1?1:0}static linear(e){return e}static quad(e){return e*e}static cubic(e){return e*e*e}static poly(e){return t=>Math.pow(t,e)}static sin(e){return 1-Math.cos(e*Math.PI/2)}static circle(e){return 1-Math.sqrt(1-e*e)}static exp(e){return Math.pow(2,10*(e-1))}static elastic(e=1){const t=e*Math.PI;return e=>1-Math.pow(Math.cos(e*Math.PI/2),3)*Math.cos(e*t)}static back(e=1.70158){return t=>t*t*((e+1)*t-e)}static bounce(e=.5){return t=>Math.min((e=>7.5625*e*e)(t),(t=>30.25*e*Math.pow(t-6/11,2)+1-e)(t),(t=>121*e*e*Math.pow(t-9/11,2)+1-e*e)(t),(t=>484*e*e*e*Math.pow(t-10.5/11,2)+1-e*e*e)(t))}static in(e){return e}static out(e){return t=>1-e(1-t)}static inOut(e){return t=>t<.5?e(2*t)/2:1-e(2*(1-t))/2}}const c=l.poly(4),u=l.poly(5),p=(e,t,r)=>e(l.back(1.70158*t))(r),h=(e,t,r)=>e(l.elastic(t))(r),f=(e,t,r)=>e(l.bounce(t))(r),d={linear:l.linear,step(e,t){const r=function(e,t=1){if(e<2)throw new Error("steps must be > 2, got:"+e);const r=t/e;return Array.from({length:e},((e,t)=>t*r))}(e);return r[function(e,t,r){if(et[t.length-1])return t.length-1;for(var n=0,i=0,o=t.length-1;o-i!=1;)e>=t[n=i+Math.floor((o-i)/2)]?i=n:o=n;return i}(t,r)]},easeInQuad:l.in(l.quad),easeOutQuad:l.out(l.quad),easeInOutQuad:l.inOut(l.quad),easeInCubic:l.in(l.cubic),easeOutCubic:l.out(l.cubic),easeInOutCubic:l.inOut(l.cubic),easeInQuart:l.in(c),easeOutQuart:l.out(c),easeInOutQuart:l.inOut(c),easeInQuint:l.in(u),easeOutQuint:l.out(u),easeInOutQuint:l.inOut(u),easeInSine:l.in(l.sin),easeOutSine:l.out(l.sin),easeInOutSine:l.inOut(l.sin),easeInExpo:l.in(l.exp),easeOutExpo:l.out(l.exp),easeInOutExpo:l.inOut(l.exp),easeInCirc:l.in(l.circle),easeOutCirc:l.out(l.circle),easeInOutCirc:l.inOut(l.circle),easeInBack:p.bind(null,l.in),easeOutBack:p.bind(null,l.out),easeInOutBack:p.bind(null,l.inOut),easeInElastic:h.bind(null,l.in),easeOutElastic:h.bind(null,l.out),easeInOutElastic:h.bind(null,l.inOut),easeInBounce:f.bind(null,l.in),easeOutBounce:f.bind(null,l.out),easeInOutBounce:f.bind(null,l.inOut)},v=Object.fromEntries(Object.entries(d).map((e=>[e[0],e[0]])));Object.freeze(v);const m="linear",g=e=>{switch(e.easing){case v.easeInBack:case v.easeOutBack:case v.easeInOutBack:case v.easeInElastic:case v.easeOutElastic:case v.easeInOutElastic:return 1;case v.easeInBounce:case v.easeOutBounce:case v.easeInOutBounce:return.5;case v.step:return 5;default:return null}},y=(e="")=>e.includes("Back")||e.includes("Elastic")||e.includes("Bounce")||e===v.step,b=new Map,E=(e,t,r,n)=>{const i=t?e[t]:e;b.get(e)||b.set(e,{_pathAccessor:i}),b.get(e)[r]=i[r],i[r]=n},x=/^ease(InOut|In|Out)?([\w]+)$/,_=()=>{};function A(e){Undo.initEdit({keyframes:Timeline.selected}),"-"!==e&&(Timeline.selected.forEach((t=>{t.easing=e})),window.updateKeyframeSelection(),Undo.finishEdit("edit keyframe easing"))}function O(e){Undo.initEdit({keyframes:Timeline.selected}),"-"!==$(e).val()&&(Timeline.selected.forEach((t=>{const r=((e,t)=>{switch(e.easing){case v.easeInBack:case v.easeOutBack:case v.easeInOutBack:case v.easeInElastic:case v.easeOutElastic:case v.easeInOutElastic:case v.easeInBounce:case v.easeOutBounce:case v.easeInOutBounce:return parseFloat(t);case v.step:return Math.max(parseInt(t,10),2);default:return parseInt(t,10)}})(t,$(e).val().trim());t.easingArgs=[r]})),Undo.finishEdit("edit keyframe easing argument"))}const w=()=>{$("#keyframe_bar_easing").remove(),$("#keyframe_bar_easing_type").remove(),$("#keyframe_bar_easing_arg1").remove();const e=document.querySelector("#keyframe_type_label > div");e&&(e.hidden="azure_model"===Format.id);var t=!1;Timeline.selected.forEach((e=>{!1===t?t=e.channel:e.channel}));const r=(e,t,r)=>{const n="function"==typeof e?e:r=>void 0===r[e]?t:r[e];if(Timeline.selected.length>1){const e=a()(Timeline.selected.map(n));return 1===e.length?e[0]:r}return n(Timeline.selected[0])||t},n=Timeline.keyframes.reduce(((e,t)=>{e.has(t.animator)||e.set(t.animator,{});const r=e.get(t.animator);return r[t.channel]||(r[t.channel]=[]),r[t.channel].push(t),r[t.channel].sort(((e,t)=>e.timet.time?1:0)),e}),new Map);if(Timeline.selected.length&&"azure_model"===Format.id&&Timeline.selected.every((e=>e.animator instanceof BoneAnimator&&!(e=>n.get(e.animator)[e.channel].indexOf(e)<1)(e)))){const e=r("easing",m,"null"),t=(e,t,r)=>{const n=e=>{let t="In";return"out"===e?t="Out":"inout"===e&&(t="InOut"),t};let i="ease";return"in"===r||"out"===r||"inout"===r?i+=n(r)+e.substring(0,1).toUpperCase()+e.substring(1):"linear"===r||"step"==r?i=r:i+=n(t)+r.substring(0,1).toUpperCase()+r.substring(1),i},n=(e,r,n)=>{var i=document.createElement("div");i.innerHTML=k(r),i.id="kf_easing_type_"+r,i.setAttribute("style","stroke:var(--color-text);margin:0px;padding:3px;width:30px;height:30px"),i.setAttribute("title",n),i.onclick=()=>{let e=$(".selected_kf_easing"),n=$(".selected_kf_easing_type"),i=e.attr("id").substring(15),o=n.length<=0?"in":n.attr("id").substring(15),s=t(i,o,i),a=t(i,o,r);a!=s&&(console.log("Changed from "+s+" to "+a),A(a))},e.appendChild(i)},i=document.getElementById("panel_keyframe");let o=document.createElement("div");i.appendChild(o),o.outerHTML='
\n \n
',o=document.getElementById("keyframe_bar_easing"),n(o,"linear","Switch to Linear easing"),n(o,"step","Switch to Step easing"),n(o,"sine","Switch to Sine easing"),n(o,"quad","Switch to Quadratic easing"),n(o,"cubic","Switch to Cubic easing"),n(o,"quart","Switch to Quartic easing"),n(o,"quint","Switch to Quntic easing"),n(o,"expo","Switch to Exponential easing"),n(o,"circ","Switch to Cicle easing"),n(o,"back","Switch to Back easing"),n(o,"elastic","Switch to Elastic easing"),n(o,"bounce","Switch to Bounce easing");let s=I(e),a=document.getElementById("kf_easing_type_"+s);if(a.style.stroke="var(--color-accent)",a.classList.add("selected_kf_easing"),"linear"!==s&&"step"!=s){let t=document.createElement("div");i.appendChild(t),t.outerHTML='
\n \n
',t=document.getElementById("keyframe_bar_easing_type"),n(t,"in","Switch to In easing type"),n(t,"out","Switch to Out easing type"),n(t,"inout","Switch to In/Out easing type");let r=j(e),o=document.getElementById("kf_easing_type_"+r);o.style.stroke="var(--color-accent)",o.classList.add("selected_kf_easing_type")}const l=r((e=>{switch(e.easing){case v.easeInBack:case v.easeOutBack:case v.easeInOutBack:return"Overshoot";case v.easeInElastic:case v.easeOutElastic:case v.easeInOutElastic:case v.easeInBounce:case v.easeOutBounce:case v.easeInOutBounce:return"Bounciness";case v.step:return"Steps";default:return"N/A"}}),null,null);if(Timeline.selected.every((e=>y(e.easing)))&&null!==l){const e=r(g,null,null),[t]=r("easingArgs",[e],[e]);let n=document.createElement("div");i.appendChild(n),n.outerHTML=`
\n \n \n
`,n=document.getElementById("keyframe_bar_easing_arg1")}}},I=e=>{var t=e.match(x);return t?t[2].toLowerCase():e},j=e=>{var t=e.match(x);return t?t[1].toLowerCase():"in"},k=e=>{switch(e){case"back":return'';case"bounce":return'';case"circ":return'';case"cubic":return'';case"elastic":return'';case"expo":case"in":return'';case"inout":return'';case"out":return'';case"quad":return'';case"quart":return'';case"quint":return'';case"sine":return'';case"step":return'';default:return''}};function R(e,t,r,n){const i=e.easing||m;if("azure_model"!==Format.id)return b.get(Keyframe).getLerp.apply(this,arguments);let o=d[i];if(y(i)){const t=Array.isArray(e.easingArgs)&&e.easingArgs.length>0?e.easingArgs[0]:g(e);o=o.bind(null,t)}const s=o(r),a=(l=this.calc(t),c=e.calc(t),s*(c-l)+l);var l,c;if(Number.isNaN(a))throw new Error("batman");return a}function L(){const{easing:e,easingArgs:t}=this;let r=b.get(Keyframe).getArray.apply(this,arguments);return"azure_model"===Format.id&&(r={vector:r,easing:e},y(e)&&(r.easingArgs=t)),console.log("keyframeGetArray arguments:",arguments,"this:",this,"result:",r),r}function N(){const{easing:e,easingArgs:t}=this,r=b.get(Keyframe).getUndoCopy.apply(this,arguments);return"azure_model"===Format.id&&(Object.assign(r,{easing:e}),y(e)&&(r.easingArgs=t)),console.log("keyframeGetUndoCopy arguments:",arguments,"this:",this,"result:",r),r}function T(e){const t=Object.assign({},e);console.log("keyframeExtend 1 arguments:",arguments),"azure_model"===Format.id&&("object"==typeof t.values?(void 0!==t.values.easing&&Merge.string(this,t.values,"easing"),Array.isArray(t.values.easingArgs)&&(this.easingArgs=t.values.easingArgs),!Array.isArray(t.values)&&Array.isArray(t.values.vector)&&(t.values=t.values.vector)):(void 0!==t.easing&&Merge.string(this,t,"easing"),Array.isArray(t.easingArgs)&&(this.easingArgs=t.easingArgs)));const r=b.get(Keyframe).extend.apply(this,arguments);return console.log("keyframeExtend 2 arguments:",arguments,"this:",this,"result:",r),r}function S(){return b.get(BarItems.reverse_keyframes).condition()&&"azure_model"!==Format.id}const P=JSON.parse('{"meta":{"format_version":"3.2","model_format":"azure_model","box_uv":true},"name":"CustomArmor","geo_name":"CustomArmor","resolution":{"width":64,"height":64},"elements":[{"name":"dontTouch","from":[-4,24,-4],"to":[4,32,4],"autouv":1,"color":0,"export":false,"locked":true,"origin":[0,0,0],"uuid":"9675593e-b27d-b70e-e1ea-1fc29f46a294"},{"name":"dontTouch","from":[-4,12,-2],"to":[4,24,2],"autouv":1,"color":0,"export":false,"locked":true,"origin":[0,24,0],"uuid":"fa43156a-2a62-948c-082f-483d525f6d1f"},{"name":"dontTouch","from":[4,12,-2],"to":[8,24,2],"autouv":1,"color":0,"export":false,"locked":true,"origin":[4,22,0],"uuid":"aa51170c-8b32-fb62-71f1-58ac0b7785a8"},{"name":"dontTouch","from":[-8,12,-2],"to":[-4,24,2],"autouv":1,"color":0,"export":false,"locked":true,"origin":[4,22,0],"uuid":"bf2c2539-20e3-cfcc-94c0-491734019889"},{"name":"dontTouch","from":[-4,0,-2],"to":[0,12,2],"autouv":1,"color":0,"export":false,"locked":true,"origin":[4,22,0],"uuid":"17b9bae0-356a-9bba-fad9-4672e2671191"},{"name":"dontTouch","from":[0,0,-2],"to":[4,12,2],"autouv":1,"color":0,"export":false,"locked":true,"origin":[4,22,0],"uuid":"7b31bac4-dc40-2b93-1204-7bbdcfe7d924"}],"outliner":[{"name":"bipedHead","uuid":"d340b6fa-56aa-9c0f-3560-7a067643b77d","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[0,24,0],"children":["9675593e-b27d-b70e-e1ea-1fc29f46a294",{"name":"armorHead","uuid":"6ab88dea-c816-d2bb-6be9-05ed7838da97","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[0,24,0],"children":[]}]},{"name":"bipedBody","uuid":"ce5b366c-fd87-41ae-9a73-e0a4d4b05f8d","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[0,24,0],"children":["fa43156a-2a62-948c-082f-483d525f6d1f",{"name":"armorBody","uuid":"282fcdbb-8ea9-4a13-4154-f2ed20d696c8","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[0,24,0],"children":[]}]},{"name":"bipedRightArm","uuid":"d8113cc7-7e10-0930-259e-b8e4211ce9da","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[4,22,0],"children":["aa51170c-8b32-fb62-71f1-58ac0b7785a8",{"name":"armorRightArm","uuid":"c5300e23-fd2f-b56c-3552-45d6650e11c6","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[4,22,0],"children":[]}]},{"name":"bipedLeftArm","uuid":"3b8901e8-3420-0834-51eb-76d64ff2ae8f","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[-4,22,0],"children":["bf2c2539-20e3-cfcc-94c0-491734019889",{"name":"armorLeftArm","uuid":"b0d41a53-f4ce-53c1-f899-5a2048c90ac2","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[-4,22,0],"children":[]}]},{"name":"bipedRightLeg","uuid":"37231be7-a8ef-22ca-7fea-40aed58003bb","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[2,12,0],"children":["17b9bae0-356a-9bba-fad9-4672e2671191",{"name":"armorRightLeg","uuid":"e4b19746-2d17-1f56-befe-00718165ae50","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[2,12,0],"children":[]},{"name":"armorRightBoot","uuid":"9fe26b9a-ad66-9e6b-2fa2-4168e333b4be","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[2,12,0],"children":[]}]},{"name":"bipedLeftLeg","uuid":"45c031a5-b6be-e0a7-5454-b45d07f28429","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[-2,12,0],"children":["7b31bac4-dc40-2b93-1204-7bbdcfe7d924",{"name":"armorLeftLeg","uuid":"60238f18-e74b-c863-cb45-2e2f162221bd","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[-2,12,0],"children":[]},{"name":"armorLeftBoot","uuid":"eb3db34b-ccfe-dae9-ac4d-4e22c3222f70","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[-2,12,0],"children":[]}]}],"textures":[]}'),M="Forge 1.12 - 1.16";var C;C=[M,"Fabric 1.15 - 1.16"],Object.fromEntries(C.map((e=>[e,e])));const B="AZURE_ENTITY",F="AZURE_ARMOR",D="AZURE_ITEM_BLOCK",z={[B]:"Entity/Block/Item",[F]:"Armor",[D]:"Block/Item"},G={formatVersion:2,modSDK:M,objectType:B,entityType:"Entity/Block/Item",javaPackage:"com.example.mod",animFileNamespace:"MODID",animFilePath:"animations/ANIMATIONFILE.json"};Object.freeze(G);let U=Object.assign({},G);function X(){switch(Modes.selected.select(),U.objectType){case F:0===Outliner.root.length?Codecs.project.parse(P):alert("Unable to load Armor Template as this would overwrite the current model. Please select Armor type on an empty project if you want to use the Armor Template.");break;case D:case B:Project.parent="builtin/entity"}}const K=U;var H=r(7557),V=r.n(H);function q(e){"azure_model"===Format.id&&(e.model.azurelibSettings=K)}function W(e){e.model&&"object"==typeof e.model.azurelibSettings?Object.assign(K,V()(e.model.azurelibSettings,["formatVersion"])):Object.assign(K,G),X()}function Q(e){console.log("onBedrockCompile e:",e)}function Y(){const e=b.get(Animator).buildFile.apply(this,arguments);return"azure_model"===Format.id&&Object.assign(e,{azurelib_format_version:K.formatVersion}),e}function J(e,t){var r=e.json||autoParseJSON(e.content);let n=e.path,i=[];if(r&&"object"==typeof r.animations)for(var o in r.animations)if(!t||t.includes(o)){var s=r.animations[o],a=new Animation({name:o,path:n,loop:s.loop&&("hold_on_last_frame"==s.loop?"hold":"loop"),override:s.override_previous_animation,anim_time_update:"string"==typeof s.anim_time_update?s.anim_time_update.replace(/;(?!$)/,";\n"):s.anim_time_update,blend_weight:"string"==typeof s.blend_weight?s.blend_weight.replace(/;(?!$)/,";\n"):s.blend_weight,length:s.animation_length}).add();if(s.bones){function x(e){if(e instanceof Array)return[{x:e[0],y:e[1],z:e[2]}];if(["number","string"].includes(typeof e))return[{x:e,y:e,z:e}];if("object"==typeof e){if(e.vector)return x(e.vector);let t=[];return e.pre&&t.push(x(e.pre)[0]),e.post&&t.push(x(e.post)[0]),t}}for(var l in s.bones){var c=s.bones[l];let _=l.toLowerCase();var u=Group.all.find((e=>e.name.toLowerCase()==_));let A=u?u.uuid:guid();var p=new BoneAnimator(A,a,l);for(var h in a.animators[A]=p,c)if(Animator.possible_channels[h])if("string"==typeof c[h]||"number"==typeof c[h]||c[h]instanceof Array)p.addKeyframe({time:0,channel:h,easing:c[h].easing,easingArgs:c[h].easingArgs,data_points:x(c[h])});else if("object"==typeof c[h]&&c[h].post)p.addKeyframe({time:0,channel:h,easing:c[h].easing,easingArgs:c[h].easingArgs,interpolation:c[h].lerp_mode,data_points:x(c[h])});else if("object"==typeof c[h])for(var f in c[h])p.addKeyframe({time:parseFloat(f),channel:h,easing:c[h][f].easing,easingArgs:c[h][f].easingArgs,interpolation:c[h][f].lerp_mode,data_points:x(c[h][f])})}}if(s.sound_effects)for(var d in a.animators.effects||(a.animators.effects=new EffectAnimator(a)),s.sound_effects){var v=s.sound_effects[d];v instanceof Array==0&&(v=[v]),a.animators.effects.addKeyframe({channel:"sound",time:parseFloat(d),data_points:v})}if(s.particle_effects)for(var m in a.animators.effects||(a.animators.effects=new EffectAnimator(a)),s.particle_effects){var g=s.particle_effects[m];g instanceof Array==0&&(g=[g]),g.forEach((e=>{e&&(e.script=e.pre_effect_script)})),a.animators.effects.addKeyframe({channel:"particle",time:parseFloat(m),data_points:g})}if(s.timeline)for(var y in a.animators.effects||(a.animators.effects=new EffectAnimator(a)),s.timeline){var b=s.timeline[y],E=b instanceof Array?b.join("\n"):b;a.animators.effects.addKeyframe({channel:"timeline",time:parseFloat(y),data_points:[{script:E}]})}a.calculateSnappingFromKeyframes(),!Animation.selected&&Animator.open&&a.select(),i.push(a)}return i}function Z(e={},t){function r(t,r){return void 0===(t=e[t])?r:t}const n={};if(r("comment",settings.credit.value)&&(n.credit=settings.credit.value),n.parent="builtin/entity",r("ambientocclusion",!1===Project.ambientocclusion)&&(n.ambientocclusion=!1),16===Project.texture_width&&16===Project.texture_height||(n.texture_size=[Project.texture_width,Project.texture_height]),r("front_gui_light",Project.front_gui_light)&&(n.gui_light="front"),r("overrides",Project.overrides)&&(n.overrides=Project.overrides),r("display",Object.keys(Project.display_settings).length>=1)){var i={},o=0;for(var s in DisplayMode.slots){var a=DisplayMode.slots[s];DisplayMode.slots.hasOwnProperty(s)&&Project.display_settings[a]&&Project.display_settings[a].export&&(i[a]=Project.display_settings[a].export(),o++)}o&&(n.display=i)}const l=JSON.stringify(n,null,2);var c=ee;let u=K.itemModelPath;return Blockbench.export({resource_id:"model",type:Codecs.java_block.name,extensions:["json"],name:c.fileName().replace(".geo",".item"),startpath:u,content:l},(e=>{K.itemModelPath=e})),this}var ee=Codecs.bedrock,te=new ModelFormat({id:"azure_model",name:"AzureLib Animated Model",category:"minecraft",description:"Animated Model for Java mods using AzureLib",icon:"view_in_ar",rotate_cubes:!0,box_uv:!0,optional_box_uv:!0,single_texture:!0,bone_rig:!0,centered_grid:!0,animated_textures:!0,animation_mode:!0,animation_files:!0,locators:!0,codec:Codecs.project,display_mode:!0,onActivation:function(){}});const re=ee,ne=`${o.Kd.min_version} - ${o.Kd.max_version}`;i()(t()(Blockbench.version),ne)||alert(`AzureLib Animation currently only supports Blockbench ${ne}. Please ensure you are using this version of Blockbench to avoid bugs and undefined behavior.`),function(){let e,t,r;Plugin.register("azurelib_utils",Object.assign({},o.Kd,{name:o.Kd.title,version:o.i8,await_loading:!0,onload(){Codecs.project.on("compile",q),Codecs.project.on("parse",W),Codecs.bedrock.on("compile",Q),E(Animator,null,"buildFile",Y),E(Animator,null,"loadFile",J),Blockbench.on("display_animation_frame",_),Blockbench.on("update_keyframe_selection",w),E(window,null,"updateKeyframeEasing",A),E(window,null,"updateKeyframeEasingArg",O),E(BarItems.keyframe_interpolation,null,"condition",(()=>"azure_model"!==Format.id&&b.get(BarItems.keyframe_interpolation).condition())),E(Keyframe,"prototype","getLerp",R),E(Keyframe,"prototype","getArray",L),E(Keyframe,"prototype","getUndoCopy",N),E(Keyframe,"prototype","extend",T),E(BarItems.reverse_keyframes,null,"condition",S),console.log("Loaded AzureLib plugin"),e=new Action({id:"export_AzureLib_model",name:"Export AzureLib .geo Model",icon:"archive",description:"Export your .geo model for AzureLib.",category:"file",condition:()=>"azure_model"===Format.id,click:function(){re.export()}}),MenuBar.addAction(e,"file.export"),t=new Action({id:"export_AzureLib_display",name:"Export AzureLib Display Settings",icon:"icon-bb_interface",description:"Export your display settings file for AzureLib Item/Blocks.",category:"file",condition:()=>"azure_model"===Format.id,click:Z}),MenuBar.addAction(t,"file.export"),r=new Action("azurelib_settings",{name:"AzureLib Model Settings",description:"Change model type.",icon:"info",condition:()=>"azure_model"===Format.id,click:function(){var e=new Dialog({id:"project",title:"AzureLib Model Settings",width:540,lines:[`AzureLib Animation Utils v${o.i8}`],form:{objectType:{label:"Object Type",type:"select",default:K.objectType,options:z}},onConfirm:function(t){Object.assign(K,t),X(),e.hide()}});e.show()}}),MenuBar.addAction(r,"file.1")},onunload(){e.delete(),t.delete(),r.delete(),Blockbench.removeListener("display_animation_frame",_),Blockbench.removeListener("update_keyframe_selection",w),Codecs.project.events.compile.remove(q),Codecs.project.events.parse.remove(W),Codecs.bedrock.events.compile.remove(Q),te.delete(),b.forEach((e=>{Object.keys(e).forEach((t=>{t.startsWith("_")||(e._pathAccessor[t]=e[t])}))})),b.clear(),console.clear()}}))}()})()})(); \ No newline at end of file +(()=>{var e={8552:(e,t,r)=>{var n=r(852)(r(5639),"DataView");e.exports=n},1989:(e,t,r)=>{var n=r(1789),i=r(401),o=r(7667),s=r(1327),a=r(1866);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t{var n=r(7040),i=r(4125),o=r(2117),s=r(7518),a=r(4705);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t{var n=r(852)(r(5639),"Map");e.exports=n},3369:(e,t,r)=>{var n=r(4785),i=r(1285),o=r(6e3),s=r(9916),a=r(5265);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t{var n=r(852)(r(5639),"Promise");e.exports=n},8525:(e,t,r)=>{var n=r(852)(r(5639),"Set");e.exports=n},8668:(e,t,r)=>{var n=r(3369),i=r(619),o=r(2385);function s(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t{var n=r(8407),i=r(7465),o=r(3779),s=r(7599),a=r(4758),l=r(4309);function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=s,c.prototype.has=a,c.prototype.set=l,e.exports=c},2705:(e,t,r)=>{var n=r(5639).Symbol;e.exports=n},1149:(e,t,r)=>{var n=r(5639).Uint8Array;e.exports=n},577:(e,t,r)=>{var n=r(852)(r(5639),"WeakMap");e.exports=n},6874:e=>{e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},7412:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r{var n=r(2118);e.exports=function(e,t){return!(null==e||!e.length)&&n(e,t,0)>-1}},1196:e=>{e.exports=function(e,t,r){for(var n=-1,i=null==e?0:e.length;++n{var n=r(2545),i=r(5694),o=r(1469),s=r(4144),a=r(5776),l=r(6719),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=o(e),u=!r&&i(e),p=!r&&!u&&s(e),h=!r&&!u&&!p&&l(e),f=r||u||p||h,d=f?n(e.length,String):[],v=d.length;for(var m in e)!t&&!c.call(e,m)||f&&("length"==m||p&&("offset"==m||"parent"==m)||h&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||a(m,v))||d.push(m);return d}},9932:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r{e.exports=function(e,t){for(var r=-1,n=t.length,i=e.length;++r{var n=r(9465),i=r(7813),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var s=e[t];o.call(e,t)&&i(s,r)&&(void 0!==r||t in e)||n(e,t,r)}},8470:(e,t,r)=>{var n=r(7813);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},4037:(e,t,r)=>{var n=r(8363),i=r(3674);e.exports=function(e,t){return e&&n(t,i(t),e)}},3886:(e,t,r)=>{var n=r(8363),i=r(1704);e.exports=function(e,t){return e&&n(t,i(t),e)}},9465:(e,t,r)=>{var n=r(8777);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},5990:(e,t,r)=>{var n=r(6384),i=r(7412),o=r(4865),s=r(4037),a=r(3886),l=r(4626),c=r(278),u=r(8805),p=r(1911),h=r(8234),f=r(6904),d=r(4160),v=r(3824),m=r(9148),g=r(8517),y=r(1469),b=r(4144),E=r(6688),x=r(3218),_=r(2928),A=r(3674),O=r(1704),w="[object Arguments]",I="[object Function]",j="[object Object]",$={};$[w]=$["[object Array]"]=$["[object ArrayBuffer]"]=$["[object DataView]"]=$["[object Boolean]"]=$["[object Date]"]=$["[object Float32Array]"]=$["[object Float64Array]"]=$["[object Int8Array]"]=$["[object Int16Array]"]=$["[object Int32Array]"]=$["[object Map]"]=$["[object Number]"]=$[j]=$["[object RegExp]"]=$["[object Set]"]=$["[object String]"]=$["[object Symbol]"]=$["[object Uint8Array]"]=$["[object Uint8ClampedArray]"]=$["[object Uint16Array]"]=$["[object Uint32Array]"]=!0,$["[object Error]"]=$[I]=$["[object WeakMap]"]=!1,e.exports=function e(t,r,k,R,L,N){var T,S=1&r,P=2&r,M=4&r;if(k&&(T=L?k(t,R,L,N):k(t)),void 0!==T)return T;if(!x(t))return t;var C=y(t);if(C){if(T=v(t),!S)return c(t,T)}else{var B=d(t),F=B==I||"[object GeneratorFunction]"==B;if(b(t))return l(t,S);if(B==j||B==w||F&&!L){if(T=P||F?{}:g(t),!S)return P?p(t,a(T,t)):u(t,s(T,t))}else{if(!$[B])return L?t:{};T=m(t,B,S)}}N||(N=new n);var D=N.get(t);if(D)return D;N.set(t,T),_(t)?t.forEach((function(n){T.add(e(n,r,k,n,t,N))})):E(t)&&t.forEach((function(n,i){T.set(i,e(n,r,k,i,t,N))}));var z=C?void 0:(M?P?f:h:P?O:A)(t);return i(z||t,(function(n,i){z&&(n=t[i=n]),o(T,i,e(n,r,k,i,t,N))})),T}},3118:(e,t,r)=>{var n=r(3218),i=Object.create,o=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=o},1848:e=>{e.exports=function(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o{var n=r(2488),i=r(7285);e.exports=function e(t,r,o,s,a){var l=-1,c=t.length;for(o||(o=i),a||(a=[]);++l0&&o(u)?r>1?e(u,r-1,o,s,a):n(a,u):s||(a[a.length]=u)}return a}},7786:(e,t,r)=>{var n=r(1811),i=r(327);e.exports=function(e,t){for(var r=0,o=(t=n(t,e)).length;null!=e&&r{var n=r(2488),i=r(1469);e.exports=function(e,t,r){var o=t(e);return i(e)?o:n(o,r(e))}},4239:(e,t,r)=>{var n=r(2705),i=r(9607),o=r(2333),s=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?i(e):o(e)}},2118:(e,t,r)=>{var n=r(1848),i=r(2722),o=r(2351);e.exports=function(e,t,r){return t==t?o(e,t,r):n(e,i,r)}},9454:(e,t,r)=>{var n=r(4239),i=r(7005);e.exports=function(e){return i(e)&&"[object Arguments]"==n(e)}},5588:(e,t,r)=>{var n=r(4160),i=r(7005);e.exports=function(e){return i(e)&&"[object Map]"==n(e)}},2722:e=>{e.exports=function(e){return e!=e}},8458:(e,t,r)=>{var n=r(3560),i=r(5346),o=r(3218),s=r(346),a=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,u=l.toString,p=c.hasOwnProperty,h=RegExp("^"+u.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(n(e)?h:a).test(s(e))}},9221:(e,t,r)=>{var n=r(4160),i=r(7005);e.exports=function(e){return i(e)&&"[object Set]"==n(e)}},8749:(e,t,r)=>{var n=r(4239),i=r(1780),o=r(7005),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!s[n(e)]}},280:(e,t,r)=>{var n=r(5726),i=r(6916),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=[];for(var r in Object(e))o.call(e,r)&&"constructor"!=r&&t.push(r);return t}},313:(e,t,r)=>{var n=r(3218),i=r(5726),o=r(3498),s=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return o(e);var t=i(e),r=[];for(var a in e)("constructor"!=a||!t&&s.call(e,a))&&r.push(a);return r}},6560:(e,t,r)=>{var n=r(5703),i=r(8777),o=r(6557),s=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:o;e.exports=s},4259:e=>{e.exports=function(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n{e.exports=function(e,t){for(var r=-1,n=Array(e);++r{var n=r(2705),i=r(9932),o=r(1469),s=r(3448),a=n?n.prototype:void 0,l=a?a.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(s(t))return l?l.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}},1717:e=>{e.exports=function(e){return function(t){return e(t)}}},5652:(e,t,r)=>{var n=r(8668),i=r(7443),o=r(1196),s=r(4757),a=r(3593),l=r(1814);e.exports=function(e,t,r){var c=-1,u=i,p=e.length,h=!0,f=[],d=f;if(r)h=!1,u=o;else if(p>=200){var v=t?null:a(e);if(v)return l(v);h=!1,u=s,d=new n}else d=t?[]:f;e:for(;++c{var n=r(1811),i=r(928),o=r(292),s=r(327);e.exports=function(e,t){return t=n(t,e),null==(e=o(e,t))||delete e[s(i(t))]}},4757:e=>{e.exports=function(e,t){return e.has(t)}},1811:(e,t,r)=>{var n=r(1469),i=r(5403),o=r(5514),s=r(9833);e.exports=function(e,t){return n(e)?e:i(e,t)?[e]:o(s(e))}},4318:(e,t,r)=>{var n=r(1149);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},4626:(e,t,r)=>{e=r.nmd(e);var n=r(5639),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,s=o&&o.exports===i?n.Buffer:void 0,a=s?s.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=a?a(r):new e.constructor(r);return e.copy(n),n}},7157:(e,t,r)=>{var n=r(4318);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}},3147:e=>{var t=/\w*$/;e.exports=function(e){var r=new e.constructor(e.source,t.exec(e));return r.lastIndex=e.lastIndex,r}},419:(e,t,r)=>{var n=r(2705),i=n?n.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},7133:(e,t,r)=>{var n=r(4318);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},278:e=>{e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r{var n=r(4865),i=r(9465);e.exports=function(e,t,r,o){var s=!r;r||(r={});for(var a=-1,l=t.length;++a{var n=r(8363),i=r(9551);e.exports=function(e,t){return n(e,i(e),t)}},1911:(e,t,r)=>{var n=r(8363),i=r(1442);e.exports=function(e,t){return n(e,i(e),t)}},4429:(e,t,r)=>{var n=r(5639)["__core-js_shared__"];e.exports=n},3593:(e,t,r)=>{var n=r(8525),i=r(308),o=r(1814),s=n&&1/o(new n([,-0]))[1]==1/0?function(e){return new n(e)}:i;e.exports=s},696:(e,t,r)=>{var n=r(8630);e.exports=function(e){return n(e)?void 0:e}},8777:(e,t,r)=>{var n=r(852),i=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},9021:(e,t,r)=>{var n=r(5564),i=r(5357),o=r(61);e.exports=function(e){return o(i(e,void 0,n),e+"")}},1957:e=>{var t="object"==typeof global&&global&&global.Object===Object&&global;e.exports=t},8234:(e,t,r)=>{var n=r(8866),i=r(9551),o=r(3674);e.exports=function(e){return n(e,o,i)}},6904:(e,t,r)=>{var n=r(8866),i=r(1442),o=r(1704);e.exports=function(e){return n(e,o,i)}},5050:(e,t,r)=>{var n=r(7019);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},852:(e,t,r)=>{var n=r(8458),i=r(7801);e.exports=function(e,t){var r=i(e,t);return n(r)?r:void 0}},5924:(e,t,r)=>{var n=r(5569)(Object.getPrototypeOf,Object);e.exports=n},9607:(e,t,r)=>{var n=r(2705),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,a),r=e[a];try{e[a]=void 0;var n=!0}catch(e){}var i=s.call(e);return n&&(t?e[a]=r:delete e[a]),i}},9551:(e,t,r)=>{var n=r(4963),i=r(479),o=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,a=s?function(e){return null==e?[]:(e=Object(e),n(s(e),(function(t){return o.call(e,t)})))}:i;e.exports=a},1442:(e,t,r)=>{var n=r(2488),i=r(5924),o=r(9551),s=r(479),a=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,o(e)),e=i(e);return t}:s;e.exports=a},4160:(e,t,r)=>{var n=r(8552),i=r(7071),o=r(3818),s=r(8525),a=r(577),l=r(4239),c=r(346),u="[object Map]",p="[object Promise]",h="[object Set]",f="[object WeakMap]",d="[object DataView]",v=c(n),m=c(i),g=c(o),y=c(s),b=c(a),E=l;(n&&E(new n(new ArrayBuffer(1)))!=d||i&&E(new i)!=u||o&&E(o.resolve())!=p||s&&E(new s)!=h||a&&E(new a)!=f)&&(E=function(e){var t=l(e),r="[object Object]"==t?e.constructor:void 0,n=r?c(r):"";if(n)switch(n){case v:return d;case m:return u;case g:return p;case y:return h;case b:return f}return t}),e.exports=E},7801:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},1789:(e,t,r)=>{var n=r(4536);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},401:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},7667:(e,t,r)=>{var n=r(4536),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return i.call(t,e)?t[e]:void 0}},1327:(e,t,r)=>{var n=r(4536),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:i.call(t,e)}},1866:(e,t,r)=>{var n=r(4536);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},3824:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var r=e.length,n=new e.constructor(r);return r&&"string"==typeof e[0]&&t.call(e,"index")&&(n.index=e.index,n.input=e.input),n}},9148:(e,t,r)=>{var n=r(4318),i=r(7157),o=r(3147),s=r(419),a=r(7133);e.exports=function(e,t,r){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return n(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return i(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return a(e,r);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return o(e);case"[object Symbol]":return s(e)}}},8517:(e,t,r)=>{var n=r(3118),i=r(5924),o=r(5726);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:n(i(e))}},7285:(e,t,r)=>{var n=r(2705),i=r(5694),o=r(1469),s=n?n.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(s&&e&&e[s])}},5776:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e{var n=r(1469),i=r(3448),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;e.exports=function(e,t){if(n(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!i(e))||s.test(e)||!o.test(e)||null!=t&&e in Object(t)}},7019:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},5346:(e,t,r)=>{var n,i=r(4429),o=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!o&&o in e}},5726:e=>{var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},7040:e=>{e.exports=function(){this.__data__=[],this.size=0}},4125:(e,t,r)=>{var n=r(8470),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0||(r==t.length-1?t.pop():i.call(t,r,1),--this.size,0))}},2117:(e,t,r)=>{var n=r(8470);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},7518:(e,t,r)=>{var n=r(8470);e.exports=function(e){return n(this.__data__,e)>-1}},4705:(e,t,r)=>{var n=r(8470);e.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},4785:(e,t,r)=>{var n=r(1989),i=r(8407),o=r(7071);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||i),string:new n}}},1285:(e,t,r)=>{var n=r(5050);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},6e3:(e,t,r)=>{var n=r(5050);e.exports=function(e){return n(this,e).get(e)}},9916:(e,t,r)=>{var n=r(5050);e.exports=function(e){return n(this,e).has(e)}},5265:(e,t,r)=>{var n=r(5050);e.exports=function(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}},4523:(e,t,r)=>{var n=r(8306);e.exports=function(e){var t=n(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}},4536:(e,t,r)=>{var n=r(852)(Object,"create");e.exports=n},6916:(e,t,r)=>{var n=r(5569)(Object.keys,Object);e.exports=n},3498:e=>{e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},1167:(e,t,r)=>{e=r.nmd(e);var n=r(1957),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,s=o&&o.exports===i&&n.process,a=function(){try{return o&&o.require&&o.require("util").types||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=a},2333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},5357:(e,t,r)=>{var n=r(6874),i=Math.max;e.exports=function(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,s=-1,a=i(o.length-t,0),l=Array(a);++s{var n=r(7786),i=r(4259);e.exports=function(e,t){return t.length<2?e:n(e,i(t,0,-1))}},5639:(e,t,r)=>{var n=r(1957),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();e.exports=o},619:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},2385:e=>{e.exports=function(e){return this.__data__.has(e)}},1814:e=>{e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}},61:(e,t,r)=>{var n=r(6560),i=r(1275)(n);e.exports=i},1275:e=>{var t=Date.now;e.exports=function(e){var r=0,n=0;return function(){var i=t(),o=16-(i-n);if(n=i,o>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},7465:(e,t,r)=>{var n=r(8407);e.exports=function(){this.__data__=new n,this.size=0}},3779:e=>{e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},7599:e=>{e.exports=function(e){return this.__data__.get(e)}},4758:e=>{e.exports=function(e){return this.__data__.has(e)}},4309:(e,t,r)=>{var n=r(8407),i=r(7071),o=r(3369);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var s=r.__data__;if(!i||s.length<199)return s.push([e,t]),this.size=++r.size,this;r=this.__data__=new o(s)}return r.set(e,t),this.size=r.size,this}},2351:e=>{e.exports=function(e,t,r){for(var n=r-1,i=e.length;++n{var n=r(4523),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,s=n((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,r,n,i){t.push(n?i.replace(o,"$1"):r||e)})),t}));e.exports=s},327:(e,t,r)=>{var n=r(3448);e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},346:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},5703:e=>{e.exports=function(e){return function(){return e}}},7813:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},5564:(e,t,r)=>{var n=r(1078);e.exports=function(e){return null!=e&&e.length?n(e,1):[]}},6557:e=>{e.exports=function(e){return e}},5694:(e,t,r)=>{var n=r(9454),i=r(7005),o=Object.prototype,s=o.hasOwnProperty,a=o.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(e){return i(e)&&s.call(e,"callee")&&!a.call(e,"callee")};e.exports=l},1469:e=>{var t=Array.isArray;e.exports=t},8612:(e,t,r)=>{var n=r(3560),i=r(1780);e.exports=function(e){return null!=e&&i(e.length)&&!n(e)}},4144:(e,t,r)=>{e=r.nmd(e);var n=r(5639),i=r(5062),o=t&&!t.nodeType&&t,s=o&&e&&!e.nodeType&&e,a=s&&s.exports===o?n.Buffer:void 0,l=(a?a.isBuffer:void 0)||i;e.exports=l},3560:(e,t,r)=>{var n=r(4239),i=r(3218);e.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},6688:(e,t,r)=>{var n=r(5588),i=r(1717),o=r(1167),s=o&&o.isMap,a=s?i(s):n;e.exports=a},3218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},8630:(e,t,r)=>{var n=r(4239),i=r(5924),o=r(7005),s=Function.prototype,a=Object.prototype,l=s.toString,c=a.hasOwnProperty,u=l.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=n(e))return!1;var t=i(e);if(null===t)return!0;var r=c.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&l.call(r)==u}},2928:(e,t,r)=>{var n=r(9221),i=r(1717),o=r(1167),s=o&&o.isSet,a=s?i(s):n;e.exports=a},3448:(e,t,r)=>{var n=r(4239),i=r(7005);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==n(e)}},6719:(e,t,r)=>{var n=r(8749),i=r(1717),o=r(1167),s=o&&o.isTypedArray,a=s?i(s):n;e.exports=a},3674:(e,t,r)=>{var n=r(4636),i=r(280),o=r(8612);e.exports=function(e){return o(e)?n(e):i(e)}},1704:(e,t,r)=>{var n=r(4636),i=r(313),o=r(8612);e.exports=function(e){return o(e)?n(e,!0):i(e)}},928:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},8306:(e,t,r)=>{var n=r(3369);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(i.Cache||n),r}i.Cache=n,e.exports=i},308:e=>{e.exports=function(){}},7557:(e,t,r)=>{var n=r(9932),i=r(5990),o=r(7406),s=r(1811),a=r(8363),l=r(696),c=r(9021),u=r(6904),p=c((function(e,t){var r={};if(null==e)return r;var c=!1;t=n(t,(function(t){return t=s(t,e),c||(c=t.length>1),t})),a(e,u(e),r),c&&(r=i(r,7,l));for(var p=t.length;p--;)o(r,t[p]);return r}));e.exports=p},479:e=>{e.exports=function(){return[]}},5062:e=>{e.exports=function(){return!1}},9833:(e,t,r)=>{var n=r(531);e.exports=function(e){return null==e?"":n(e)}},4908:(e,t,r)=>{var n=r(5652);e.exports=function(e){return e&&e.length?n(e):[]}},2257:(e,t,r)=>{const n=Symbol("SemVer ANY");class i{static get ANY(){return n}constructor(e,t){if(t=o(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),c("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(e){const t=this.options.loose?s[a.COMPARATORLOOSE]:s[a.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new u(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(c("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new p(e.value,t).test(this.value):""===e.operator?""===e.value||new p(this.value,t).test(e.semver):!((t=o(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=i;const o=r(2893),{safeRe:s,t:a}=r(5765),l=r(7539),c=r(4225),u=r(6376),p=r(6902)},6902:(e,t,r)=>{class n{constructor(e,t){if(t=o(t),e instanceof n)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new n(e.raw,t);if(e instanceof s)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!m(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&g(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&d)|(this.options.loose&&v))+":"+e,r=i.get(t);if(r)return r;const n=this.options.loose,o=n?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(o,k(this.options.includePrerelease)),a("hyphen replace",e),e=e.replace(c[u.COMPARATORTRIM],p),a("comparator trim",e),e=e.replace(c[u.TILDETRIM],h),a("tilde trim",e),e=e.replace(c[u.CARETTRIM],f),a("caret trim",e);let l=e.split(" ").map((e=>b(e,this.options))).join(" ").split(/\s+/).map((e=>$(e,this.options)));n&&(l=l.filter((e=>(a("loose invalid filter",e,this.options),!!e.match(c[u.COMPARATORLOOSE]))))),a("range list",l);const g=new Map,y=l.map((e=>new s(e,this.options)));for(const e of y){if(m(e))return[e];g.set(e.value,e)}g.size>1&&g.has("")&&g.delete("");const E=[...g.values()];return i.set(t,E),E}intersects(e,t){if(!(e instanceof n))throw new TypeError("a Range is required");return this.set.some((r=>y(r,t)&&e.set.some((e=>y(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(let t=0;t"<0.0.0-0"===e.value,g=e=>""===e.value,y=(e,t)=>{let r=!0;const n=e.slice();let i=n.pop();for(;r&&n.length;)r=n.every((e=>i.intersects(e,t))),i=n.pop();return r},b=(e,t)=>(a("comp",e,t),e=A(e,t),a("caret",e),e=x(e,t),a("tildes",e),e=w(e,t),a("xrange",e),e=j(e,t),a("stars",e),e),E=e=>!e||"x"===e.toLowerCase()||"*"===e,x=(e,t)=>e.trim().split(/\s+/).map((e=>_(e,t))).join(" "),_=(e,t)=>{const r=t.loose?c[u.TILDELOOSE]:c[u.TILDE];return e.replace(r,((t,r,n,i,o)=>{let s;return a("tilde",e,t,r,n,i,o),E(r)?s="":E(n)?s=`>=${r}.0.0 <${+r+1}.0.0-0`:E(i)?s=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:o?(a("replaceTilde pr",o),s=`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`):s=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,a("tilde return",s),s}))},A=(e,t)=>e.trim().split(/\s+/).map((e=>O(e,t))).join(" "),O=(e,t)=>{a("caret",e,t);const r=t.loose?c[u.CARETLOOSE]:c[u.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,i,o,s)=>{let l;return a("caret",e,t,r,i,o,s),E(r)?l="":E(i)?l=`>=${r}.0.0${n} <${+r+1}.0.0-0`:E(o)?l="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:s?(a("replaceCaret pr",s),l="0"===r?"0"===i?`>=${r}.${i}.${o}-${s} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}-${s} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o}-${s} <${+r+1}.0.0-0`):(a("no pr"),l="0"===r?"0"===i?`>=${r}.${i}.${o}${n} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o} <${+r+1}.0.0-0`),a("caret return",l),l}))},w=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map((e=>I(e,t))).join(" ")),I=(e,t)=>{e=e.trim();const r=t.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(r,((r,n,i,o,s,l)=>{a("xRange",e,r,n,i,o,s,l);const c=E(i),u=c||E(o),p=u||E(s),h=p;return"="===n&&h&&(n=""),l=t.includePrerelease?"-0":"",c?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&h?(u&&(o=0),s=0,">"===n?(n=">=",u?(i=+i+1,o=0,s=0):(o=+o+1,s=0)):"<="===n&&(n="<",u?i=+i+1:o=+o+1),"<"===n&&(l="-0"),r=`${n+i}.${o}.${s}${l}`):u?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:p&&(r=`>=${i}.${o}.0${l} <${i}.${+o+1}.0-0`),a("xRange return",r),r}))},j=(e,t)=>(a("replaceStars",e,t),e.trim().replace(c[u.STAR],"")),$=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?u.GTE0PRE:u.GTE0],"")),k=e=>(t,r,n,i,o,s,a,l,c,u,p,h,f)=>`${r=E(n)?"":E(i)?`>=${n}.0.0${e?"-0":""}`:E(o)?`>=${n}.${i}.0${e?"-0":""}`:s?`>=${r}`:`>=${r}${e?"-0":""}`} ${l=E(c)?"":E(u)?`<${+c+1}.0.0-0`:E(p)?`<${c}.${+u+1}.0-0`:h?`<=${c}.${u}.${p}-${h}`:e?`<${c}.${u}.${+p+1}-0`:`<=${l}`}`.trim(),R=(e,t,r)=>{for(let r=0;r0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},6376:(e,t,r)=>{const n=r(4225),{MAX_LENGTH:i,MAX_SAFE_INTEGER:o}=r(3295),{safeRe:s,t:a}=r(5765),l=r(2893),{compareIdentifiers:c}=r(6742);class u{constructor(e,t){if(t=l(t),e instanceof u){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>i)throw new TypeError(`version is longer than ${i} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?s[a.LOOSE]:s[a.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=u},7539:(e,t,r)=>{const n=r(8718),i=r(1194),o=r(1312),s=r(5903),a=r(1544),l=r(2056);e.exports=(e,t,r,c)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,c);case"!=":return i(e,r,c);case">":return o(e,r,c);case">=":return s(e,r,c);case"<":return a(e,r,c);case"<=":return l(e,r,c);default:throw new TypeError(`Invalid operator: ${t}`)}}},9038:(e,t,r)=>{const n=r(6376),i=r(3959),{safeRe:o,t:s}=r(5765);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=o[s.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),o[s.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;o[s.COERCERTL].lastIndex=-1}else r=e.match(o[s.COERCE]);return null===r?null:i(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)}},6269:(e,t,r)=>{const n=r(6376);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},8718:(e,t,r)=>{const n=r(6269);e.exports=(e,t,r)=>0===n(e,t,r)},1312:(e,t,r)=>{const n=r(6269);e.exports=(e,t,r)=>n(e,t,r)>0},5903:(e,t,r)=>{const n=r(6269);e.exports=(e,t,r)=>n(e,t,r)>=0},1544:(e,t,r)=>{const n=r(6269);e.exports=(e,t,r)=>n(e,t,r)<0},2056:(e,t,r)=>{const n=r(6269);e.exports=(e,t,r)=>n(e,t,r)<=0},1194:(e,t,r)=>{const n=r(6269);e.exports=(e,t,r)=>0!==n(e,t,r)},3959:(e,t,r)=>{const n=r(6376);e.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}},5712:(e,t,r)=>{const n=r(6902);e.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}},3295:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},4225:e=>{const t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},6742:e=>{const t=/^[0-9]+$/,r=(e,r)=>{const n=t.test(e),i=t.test(r);return n&&i&&(e=+e,r=+r),e===r?0:n&&!i?-1:i&&!n?1:er(t,e)}},2893:e=>{const t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},5765:(e,t,r)=>{const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:o}=r(3295),s=r(4225),a=(t=e.exports={}).re=[],l=t.safeRe=[],c=t.src=[],u=t.t={};let p=0;const h="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",o],[h,i]],d=(e,t,r)=>{const n=(e=>{for(const[t,r]of f)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),i=p++;s(e,i,t),u[e]=i,c[i]=t,a[i]=new RegExp(t,r?"g":void 0),l[i]=new RegExp(n,r?"g":void 0)};d("NUMERICIDENTIFIER","0|[1-9]\\d*"),d("NUMERICIDENTIFIERLOOSE","\\d+"),d("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),d("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),d("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),d("PRERELEASEIDENTIFIER",`(?:${c[u.NUMERICIDENTIFIER]}|${c[u.NONNUMERICIDENTIFIER]})`),d("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NUMERICIDENTIFIERLOOSE]}|${c[u.NONNUMERICIDENTIFIER]})`),d("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),d("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),d("BUILDIDENTIFIER",`${h}+`),d("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),d("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),d("FULL",`^${c[u.FULLPLAIN]}$`),d("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),d("LOOSE",`^${c[u.LOOSEPLAIN]}$`),d("GTLT","((?:<|>)?=?)"),d("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),d("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),d("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),d("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),d("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),d("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),d("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),d("COERCERTL",c[u.COERCE],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",d("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),d("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),d("LONECARET","(?:\\^)"),d("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",d("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),d("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),d("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),d("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),d("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),d("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},6062:(e,t,r)=>{"use strict";const n=r(2221),i=Symbol("max"),o=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),u=Symbol("noDisposeOnSet"),p=Symbol("lruList"),h=Symbol("cache"),f=Symbol("updateAgeOnGet"),d=()=>1,v=(e,t,r)=>{const n=e[h].get(t);if(n){const t=n.value;if(m(e,t)){if(y(e,n),!e[a])return}else r&&(e[f]&&(n.value.now=Date.now()),e[p].unshiftNode(n));return t.value}},m=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[l]&&r>e[l]},g=e=>{if(e[o]>e[i])for(let t=e[p].tail;e[o]>e[i]&&null!==t;){const r=t.prev;y(e,t),t=r}},y=(e,t)=>{if(t){const r=t.value;e[c]&&e[c](r.key,r.value),e[o]-=r.length,e[h].delete(r.key),e[p].removeNode(t)}};class b{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}const E=(e,t,r,n)=>{let i=r.value;m(e,i)&&(y(e,r),e[a]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||1/0;const t=e.length||d;if(this[s]="function"!=typeof t?d:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[u]=e.noDisposeOnSet||!1,this[f]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,g(this)}get max(){return this[i]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,g(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=d),e!==this[s]&&(this[s]=e,this[o]=0,this[p].forEach((e=>{e.length=this[s](e.value,e.key),this[o]+=e.length}))),g(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[p].length}rforEach(e,t){t=t||this;for(let r=this[p].tail;null!==r;){const n=r.prev;E(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[p].head;null!==r;){const n=r.next;E(this,e,r,t),r=n}}keys(){return this[p].toArray().map((e=>e.key))}values(){return this[p].toArray().map((e=>e.value))}reset(){this[c]&&this[p]&&this[p].length&&this[p].forEach((e=>this[c](e.key,e.value))),this[h]=new Map,this[p]=new n,this[o]=0}dump(){return this[p].map((e=>!m(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[p]}set(e,t,r){if((r=r||this[l])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,a=this[s](t,e);if(this[h].has(e)){if(a>this[i])return y(this,this[h].get(e)),!1;const s=this[h].get(e).value;return this[c]&&(this[u]||this[c](e,s.value)),s.now=n,s.maxAge=r,s.value=t,this[o]+=a-s.length,s.length=a,this.get(e),g(this),!0}const f=new b(e,t,a,n,r);return f.length>this[i]?(this[c]&&this[c](e,t),!1):(this[o]+=f.length,this[p].unshift(f),this[h].set(e,this[p].head),g(this),!0)}has(e){if(!this[h].has(e))return!1;const t=this[h].get(e).value;return!m(this,t)}get(e){return v(this,e,!0)}peek(e){return v(this,e,!1)}pop(){const e=this[p].tail;return e?(y(this,e),e.value):null}del(e){y(this,this[h].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[h].forEach(((e,t)=>v(this,t,!1)))}}},9307:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},2221:(e,t,r)=>{"use strict";function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,i=arguments.length;r1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(tthis.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&ithis.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)r.push(o.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,o=this.head;null!==o&&n{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{"use strict";var e=r(9038),t=r.n(e),n=r(5712),i=r.n(n);const o=JSON.parse('{"i8":"1.0.8","Kd":{"title":"AzureLib Animator","author":"AzureDoom, Eliot Lash, Gecko, McHorse","icon":"azureicon.png","description":"Create animated blocks, items, entity, and armor using the AzureLib library and plugin. This is a fork of Geckolib and cross compatibility will not be promised in the future.","min_version":"4.8.0","max_version":"5.0.0","new_repository_format":"true","variant":"both","creation_date":"2023-04-04","contributes":{"formats":["azure_model"]},"has_changelog":true,"website":"https://wiki.azuredoom.com/readme-1"}}');var s=r(4908),a=r.n(s);class l{static step0(e){return e>0?1:0}static step1(e){return e>=1?1:0}static linear(e){return e}static quad(e){return e*e}static cubic(e){return e*e*e}static poly(e){return t=>Math.pow(t,e)}static sin(e){return 1-Math.cos(e*Math.PI/2)}static circle(e){return 1-Math.sqrt(1-e*e)}static exp(e){return Math.pow(2,10*(e-1))}static elastic(e=1){const t=e*Math.PI;return e=>1-Math.pow(Math.cos(e*Math.PI/2),3)*Math.cos(e*t)}static back(e=1.70158){return t=>t*t*((e+1)*t-e)}static bounce(e=.5){return t=>Math.min((e=>7.5625*e*e)(t),(t=>30.25*e*Math.pow(t-6/11,2)+1-e)(t),(t=>121*e*e*Math.pow(t-9/11,2)+1-e*e)(t),(t=>484*e*e*e*Math.pow(t-10.5/11,2)+1-e*e*e)(t))}static in(e){return e}static out(e){return t=>1-e(1-t)}static inOut(e){return t=>t<.5?e(2*t)/2:1-e(2*(1-t))/2}}const c=l.poly(4),u=l.poly(5),p=(e,t,r)=>e(l.back(1.70158*t))(r),h=(e,t,r)=>e(l.elastic(t))(r),f=(e,t,r)=>e(l.bounce(t))(r),d={linear:l.linear,step(e,t){const r=function(e,t=1){if(e<2)throw new Error("steps must be > 2, got:"+e);const r=t/e;return Array.from({length:e},((e,t)=>t*r))}(e);return r[function(e,t,r){if(et[t.length-1])return t.length-1;for(var n=0,i=0,o=t.length-1;o-i!=1;)e>=t[n=i+Math.floor((o-i)/2)]?i=n:o=n;return i}(t,r)]},easeInQuad:l.in(l.quad),easeOutQuad:l.out(l.quad),easeInOutQuad:l.inOut(l.quad),easeInCubic:l.in(l.cubic),easeOutCubic:l.out(l.cubic),easeInOutCubic:l.inOut(l.cubic),easeInQuart:l.in(c),easeOutQuart:l.out(c),easeInOutQuart:l.inOut(c),easeInQuint:l.in(u),easeOutQuint:l.out(u),easeInOutQuint:l.inOut(u),easeInSine:l.in(l.sin),easeOutSine:l.out(l.sin),easeInOutSine:l.inOut(l.sin),easeInExpo:l.in(l.exp),easeOutExpo:l.out(l.exp),easeInOutExpo:l.inOut(l.exp),easeInCirc:l.in(l.circle),easeOutCirc:l.out(l.circle),easeInOutCirc:l.inOut(l.circle),easeInBack:p.bind(null,l.in),easeOutBack:p.bind(null,l.out),easeInOutBack:p.bind(null,l.inOut),easeInElastic:h.bind(null,l.in),easeOutElastic:h.bind(null,l.out),easeInOutElastic:h.bind(null,l.inOut),easeInBounce:f.bind(null,l.in),easeOutBounce:f.bind(null,l.out),easeInOutBounce:f.bind(null,l.inOut)},v=Object.fromEntries(Object.entries(d).map((e=>[e[0],e[0]])));Object.freeze(v);const m="linear",g=e=>{switch(e.easing){case v.easeInBack:case v.easeOutBack:case v.easeInOutBack:case v.easeInElastic:case v.easeOutElastic:case v.easeInOutElastic:return 1;case v.easeInBounce:case v.easeOutBounce:case v.easeInOutBounce:return.5;case v.step:return 5;default:return null}},y=(e="")=>e.includes("Back")||e.includes("Elastic")||e.includes("Bounce")||e===v.step,b=new Map,E=(e,t,r,n)=>{const i=t?e[t]:e;b.get(e)||b.set(e,{_pathAccessor:i}),b.get(e)[r]=i[r],i[r]=n},x=/^ease(InOut|In|Out)?([\w]+)$/,_=()=>{};function A(e){Undo.initEdit({keyframes:Timeline.selected}),"-"!==e&&(Timeline.selected.forEach((t=>{t.easing=e})),window.updateKeyframeSelection(),Undo.finishEdit("edit keyframe easing"))}function O(e){Undo.initEdit({keyframes:Timeline.selected}),"-"!==$(e).val()&&(Timeline.selected.forEach((t=>{const r=((e,t)=>{switch(e.easing){case v.easeInBack:case v.easeOutBack:case v.easeInOutBack:case v.easeInElastic:case v.easeOutElastic:case v.easeInOutElastic:case v.easeInBounce:case v.easeOutBounce:case v.easeInOutBounce:return parseFloat(t);case v.step:return Math.max(parseInt(t,10),2);default:return parseInt(t,10)}})(t,$(e).val().trim());t.easingArgs=[r]})),Undo.finishEdit("edit keyframe easing argument"))}const w=()=>{$("#keyframe_bar_easing").remove(),$("#keyframe_bar_easing_type").remove(),$("#keyframe_bar_easing_arg1").remove();const e=document.querySelector("#keyframe_type_label > div");e&&(e.hidden="azure_model"===Format.id);var t=!1;Timeline.selected.forEach((e=>{!1===t?t=e.channel:e.channel}));const r=(e,t,r)=>{const n="function"==typeof e?e:r=>void 0===r[e]?t:r[e];if(Timeline.selected.length>1){const e=a()(Timeline.selected.map(n));return 1===e.length?e[0]:r}return n(Timeline.selected[0])||t},n=Timeline.keyframes.reduce(((e,t)=>{e.has(t.animator)||e.set(t.animator,{});const r=e.get(t.animator);return r[t.channel]||(r[t.channel]=[]),r[t.channel].push(t),r[t.channel].sort(((e,t)=>e.timet.time?1:0)),e}),new Map);if(Timeline.selected.length&&"azure_model"===Format.id&&Timeline.selected.every((e=>e.animator instanceof BoneAnimator&&!(e=>n.get(e.animator)[e.channel].indexOf(e)<1)(e)))){const e=r("easing",m,"null"),t=(e,t,r)=>{const n=e=>{let t="In";return"out"===e?t="Out":"inout"===e&&(t="InOut"),t};let i="ease";return"in"===r||"out"===r||"inout"===r?i+=n(r)+e.substring(0,1).toUpperCase()+e.substring(1):"linear"===r||"step"==r?i=r:i+=n(t)+r.substring(0,1).toUpperCase()+r.substring(1),i},n=(e,r,n)=>{var i=document.createElement("div");i.innerHTML=k(r),i.id="kf_easing_type_"+r,i.setAttribute("style","stroke:var(--color-text);margin:0px;padding:3px;width:30px;height:30px"),i.setAttribute("title",n),i.onclick=()=>{let e=$(".selected_kf_easing"),n=$(".selected_kf_easing_type"),i=e.attr("id").substring(15),o=n.length<=0?"in":n.attr("id").substring(15),s=t(i,o,i),a=t(i,o,r);a!=s&&(console.log("Changed from "+s+" to "+a),A(a))},e.appendChild(i)},i=document.getElementById("panel_keyframe");let o=document.createElement("div");i.appendChild(o),o.outerHTML='
\n \n
',o=document.getElementById("keyframe_bar_easing"),n(o,"linear","Switch to Linear easing"),n(o,"step","Switch to Step easing"),n(o,"sine","Switch to Sine easing"),n(o,"quad","Switch to Quadratic easing"),n(o,"cubic","Switch to Cubic easing"),n(o,"quart","Switch to Quartic easing"),n(o,"quint","Switch to Quntic easing"),n(o,"expo","Switch to Exponential easing"),n(o,"circ","Switch to Cicle easing"),n(o,"back","Switch to Back easing"),n(o,"elastic","Switch to Elastic easing"),n(o,"bounce","Switch to Bounce easing");let s=I(e),a=document.getElementById("kf_easing_type_"+s);if(a.style.stroke="var(--color-accent)",a.classList.add("selected_kf_easing"),"linear"!==s&&"step"!=s){let t=document.createElement("div");i.appendChild(t),t.outerHTML='
\n \n
',t=document.getElementById("keyframe_bar_easing_type"),n(t,"in","Switch to In easing type"),n(t,"out","Switch to Out easing type"),n(t,"inout","Switch to In/Out easing type");let r=j(e),o=document.getElementById("kf_easing_type_"+r);o.style.stroke="var(--color-accent)",o.classList.add("selected_kf_easing_type")}const l=r((e=>{switch(e.easing){case v.easeInBack:case v.easeOutBack:case v.easeInOutBack:return"Overshoot";case v.easeInElastic:case v.easeOutElastic:case v.easeInOutElastic:case v.easeInBounce:case v.easeOutBounce:case v.easeInOutBounce:return"Bounciness";case v.step:return"Steps";default:return"N/A"}}),null,null);if(Timeline.selected.every((e=>y(e.easing)))&&null!==l){const e=r(g,null,null),[t]=r("easingArgs",[e],[e]);let n=document.createElement("div");i.appendChild(n),n.outerHTML=`
\n \n \n
`,n=document.getElementById("keyframe_bar_easing_arg1")}}},I=e=>{var t=e.match(x);return t?t[2].toLowerCase():e},j=e=>{var t=e.match(x);return t?t[1].toLowerCase():"in"},k=e=>{switch(e){case"back":return'';case"bounce":return'';case"circ":return'';case"cubic":return'';case"elastic":return'';case"expo":case"in":return'';case"inout":return'';case"out":return'';case"quad":return'';case"quart":return'';case"quint":return'';case"sine":return'';case"step":return'';default:return''}};function R(e,t,r,n){const i=e.easing||m;if("azure_model"!==Format.id)return b.get(Keyframe).getLerp.apply(this,arguments);let o=d[i];if(y(i)){const t=Array.isArray(e.easingArgs)&&e.easingArgs.length>0?e.easingArgs[0]:g(e);o=o.bind(null,t)}const s=o(r),a=(l=this.calc(t),c=e.calc(t),s*(c-l)+l);var l,c;if(Number.isNaN(a))throw new Error("batman");return a}function L(e=0){const{easing:t,easingArgs:r,getArray:n}=this;let i=n.call(this,e);return"azure_model"===Format.id&&(i={vector:i,easing:t},y(t)&&(i.easingArgs=r)),i}function N(){if("azure_model"!==Format.id||!this.transform)return b.get(Keyframe).compileBedrockKeyframe.apply(this,arguments);const e=this.getPreviousKeyframe.bind(this);if("catmullrom"===this.interpolation){const t=e(),r=!t&&this.time>0||t&&"catmullrom"!==t.interpolation;return{pre:r?L.call(this,0):void 0,post:L.call(this,r?1:0),lerp_mode:this.interpolation}}if(1===this.data_points.length){const t=e();return t&&"step"===t.interpolation?new oneLiner({pre:L.call(t,1),post:L.call(this)}):L.call(this)}return new oneLiner({pre:L.call(this,0),post:L.call(this,1)})}function T(){const{easing:e,easingArgs:t}=this,r=b.get(Keyframe).getUndoCopy.apply(this,arguments);return"azure_model"===Format.id&&(Object.assign(r,{easing:e}),y(e)&&(r.easingArgs=t)),r}function S(e){const t=Object.assign({},e);return"azure_model"===Format.id&&("object"==typeof t.values?(void 0!==t.values.easing&&Merge.string(this,t.values,"easing"),Array.isArray(t.values.easingArgs)&&(this.easingArgs=t.values.easingArgs),!Array.isArray(t.values)&&Array.isArray(t.values.vector)&&(t.values=t.values.vector)):(void 0!==t.easing&&Merge.string(this,t,"easing"),Array.isArray(t.easingArgs)&&(this.easingArgs=t.easingArgs))),b.get(Keyframe).extend.apply(this,arguments)}function P(){return b.get(BarItems.reverse_keyframes).condition()&&"azure_model"!==Format.id}const M=JSON.parse('{"meta":{"format_version":"3.2","model_format":"azure_model","box_uv":true},"name":"CustomArmor","geo_name":"CustomArmor","resolution":{"width":64,"height":64},"elements":[{"name":"dontTouch","from":[-4,24,-4],"to":[4,32,4],"autouv":1,"color":0,"export":false,"locked":true,"origin":[0,0,0],"uuid":"9675593e-b27d-b70e-e1ea-1fc29f46a294"},{"name":"dontTouch","from":[-4,12,-2],"to":[4,24,2],"autouv":1,"color":0,"export":false,"locked":true,"origin":[0,24,0],"uuid":"fa43156a-2a62-948c-082f-483d525f6d1f"},{"name":"dontTouch","from":[4,12,-2],"to":[8,24,2],"autouv":1,"color":0,"export":false,"locked":true,"origin":[4,22,0],"uuid":"aa51170c-8b32-fb62-71f1-58ac0b7785a8"},{"name":"dontTouch","from":[-8,12,-2],"to":[-4,24,2],"autouv":1,"color":0,"export":false,"locked":true,"origin":[4,22,0],"uuid":"bf2c2539-20e3-cfcc-94c0-491734019889"},{"name":"dontTouch","from":[-4,0,-2],"to":[0,12,2],"autouv":1,"color":0,"export":false,"locked":true,"origin":[4,22,0],"uuid":"17b9bae0-356a-9bba-fad9-4672e2671191"},{"name":"dontTouch","from":[0,0,-2],"to":[4,12,2],"autouv":1,"color":0,"export":false,"locked":true,"origin":[4,22,0],"uuid":"7b31bac4-dc40-2b93-1204-7bbdcfe7d924"}],"outliner":[{"name":"bipedHead","uuid":"d340b6fa-56aa-9c0f-3560-7a067643b77d","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[0,24,0],"children":["9675593e-b27d-b70e-e1ea-1fc29f46a294",{"name":"armorHead","uuid":"6ab88dea-c816-d2bb-6be9-05ed7838da97","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[0,24,0],"children":[]}]},{"name":"bipedBody","uuid":"ce5b366c-fd87-41ae-9a73-e0a4d4b05f8d","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[0,24,0],"children":["fa43156a-2a62-948c-082f-483d525f6d1f",{"name":"armorBody","uuid":"282fcdbb-8ea9-4a13-4154-f2ed20d696c8","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[0,24,0],"children":[]}]},{"name":"bipedRightArm","uuid":"d8113cc7-7e10-0930-259e-b8e4211ce9da","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[4,22,0],"children":["aa51170c-8b32-fb62-71f1-58ac0b7785a8",{"name":"armorRightArm","uuid":"c5300e23-fd2f-b56c-3552-45d6650e11c6","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[4,22,0],"children":[]}]},{"name":"bipedLeftArm","uuid":"3b8901e8-3420-0834-51eb-76d64ff2ae8f","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[-4,22,0],"children":["bf2c2539-20e3-cfcc-94c0-491734019889",{"name":"armorLeftArm","uuid":"b0d41a53-f4ce-53c1-f899-5a2048c90ac2","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[-4,22,0],"children":[]}]},{"name":"bipedRightLeg","uuid":"37231be7-a8ef-22ca-7fea-40aed58003bb","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[2,12,0],"children":["17b9bae0-356a-9bba-fad9-4672e2671191",{"name":"armorRightLeg","uuid":"e4b19746-2d17-1f56-befe-00718165ae50","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[2,12,0],"children":[]},{"name":"armorRightBoot","uuid":"9fe26b9a-ad66-9e6b-2fa2-4168e333b4be","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[2,12,0],"children":[]}]},{"name":"bipedLeftLeg","uuid":"45c031a5-b6be-e0a7-5454-b45d07f28429","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[-2,12,0],"children":["7b31bac4-dc40-2b93-1204-7bbdcfe7d924",{"name":"armorLeftLeg","uuid":"60238f18-e74b-c863-cb45-2e2f162221bd","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[-2,12,0],"children":[]},{"name":"armorLeftBoot","uuid":"eb3db34b-ccfe-dae9-ac4d-4e22c3222f70","export":true,"isOpen":true,"visibility":true,"autouv":0,"origin":[-2,12,0],"children":[]}]}],"textures":[]}'),C="Forge 1.12 - 1.16";var B;B=[C,"Fabric 1.15 - 1.16"],Object.fromEntries(B.map((e=>[e,e])));const F="AZURE_ENTITY",D="AZURE_ARMOR",z="AZURE_ITEM_BLOCK",G={[F]:"Entity/Block/Item",[D]:"Armor",[z]:"Block/Item"},U={formatVersion:2,modSDK:C,objectType:F,entityType:"Entity/Block/Item",javaPackage:"com.example.mod",animFileNamespace:"MODID",animFilePath:"animations/ANIMATIONFILE.json"};Object.freeze(U);let X=Object.assign({},U);function K(){switch(Modes.selected.select(),X.objectType){case D:0===Outliner.root.length?Codecs.project.parse(M):alert("Unable to load Armor Template as this would overwrite the current model. Please select Armor type on an empty project if you want to use the Armor Template.");break;case z:case F:Project.parent="builtin/entity"}}const H=X;var V=r(7557),q=r.n(V);function W(e){"azure_model"===Format.id&&(e.model.azurelibSettings=H)}function Q(e){e.model&&"object"==typeof e.model.azurelibSettings?Object.assign(H,q()(e.model.azurelibSettings,["formatVersion"])):Object.assign(H,U),K()}function Y(e){console.log("onBedrockCompile e:",e)}function J(){const e=b.get(Animator).buildFile.apply(this,arguments);return"azure_model"===Format.id&&Object.assign(e,{azurelib_format_version:H.formatVersion}),e}function Z(e,t){var r=e.json||autoParseJSON(e.content);let n=e.path,i=[];if(r&&"object"==typeof r.animations)for(var o in r.animations)if(!t||t.includes(o)){var s=r.animations[o],a=new Animation({name:o,path:n,loop:s.loop&&("hold_on_last_frame"==s.loop?"hold":"loop"),override:s.override_previous_animation,anim_time_update:"string"==typeof s.anim_time_update?s.anim_time_update.replace(/;(?!$)/,";\n"):s.anim_time_update,blend_weight:"string"==typeof s.blend_weight?s.blend_weight.replace(/;(?!$)/,";\n"):s.blend_weight,length:s.animation_length}).add();if(s.bones){function x(e){if(e instanceof Array)return[{x:e[0],y:e[1],z:e[2]}];if(["number","string"].includes(typeof e))return[{x:e,y:e,z:e}];if("object"==typeof e){if(e.vector)return x(e.vector);let t=[];return e.pre&&t.push(x(e.pre)[0]),e.post&&t.push(x(e.post)[0]),t}}for(var l in s.bones){var c=s.bones[l];let _=l.toLowerCase();var u=Group.all.find((e=>e.name.toLowerCase()==_));let A=u?u.uuid:guid();var p=new BoneAnimator(A,a,l);for(var h in a.animators[A]=p,c)if(Animator.possible_channels[h])if("string"==typeof c[h]||"number"==typeof c[h]||c[h]instanceof Array)p.addKeyframe({time:0,channel:h,easing:c[h].easing,easingArgs:c[h].easingArgs,data_points:x(c[h])});else if("object"==typeof c[h]&&c[h].post)p.addKeyframe({time:0,channel:h,easing:c[h].easing,easingArgs:c[h].easingArgs,interpolation:c[h].lerp_mode,data_points:x(c[h])});else if("object"==typeof c[h])for(var f in c[h])p.addKeyframe({time:parseFloat(f),channel:h,easing:c[h][f].easing,easingArgs:c[h][f].easingArgs,interpolation:c[h][f].lerp_mode,data_points:x(c[h][f])})}}if(s.sound_effects)for(var d in a.animators.effects||(a.animators.effects=new EffectAnimator(a)),s.sound_effects){var v=s.sound_effects[d];v instanceof Array==0&&(v=[v]),a.animators.effects.addKeyframe({channel:"sound",time:parseFloat(d),data_points:v})}if(s.particle_effects)for(var m in a.animators.effects||(a.animators.effects=new EffectAnimator(a)),s.particle_effects){var g=s.particle_effects[m];g instanceof Array==0&&(g=[g]),g.forEach((e=>{e&&(e.script=e.pre_effect_script)})),a.animators.effects.addKeyframe({channel:"particle",time:parseFloat(m),data_points:g})}if(s.timeline)for(var y in a.animators.effects||(a.animators.effects=new EffectAnimator(a)),s.timeline){var b=s.timeline[y],E=b instanceof Array?b.join("\n"):b;a.animators.effects.addKeyframe({channel:"timeline",time:parseFloat(y),data_points:[{script:E}]})}a.calculateSnappingFromKeyframes(),!Animation.selected&&Animator.open&&a.select(),i.push(a)}return i}function ee(e={},t){function r(t,r){return void 0===(t=e[t])?r:t}const n={};if(r("comment",settings.credit.value)&&(n.credit=settings.credit.value),n.parent="builtin/entity",r("ambientocclusion",!1===Project.ambientocclusion)&&(n.ambientocclusion=!1),16===Project.texture_width&&16===Project.texture_height||(n.texture_size=[Project.texture_width,Project.texture_height]),r("front_gui_light",Project.front_gui_light)&&(n.gui_light="front"),r("overrides",Project.overrides)&&(n.overrides=Project.overrides),r("display",Object.keys(Project.display_settings).length>=1)){var i={},o=0;for(var s in DisplayMode.slots){var a=DisplayMode.slots[s];DisplayMode.slots.hasOwnProperty(s)&&Project.display_settings[a]&&Project.display_settings[a].export&&(i[a]=Project.display_settings[a].export(),o++)}o&&(n.display=i)}const l=JSON.stringify(n,null,2);var c=te;let u=H.itemModelPath;return Blockbench.export({resource_id:"model",type:Codecs.java_block.name,extensions:["json"],name:c.fileName().replace(".geo",".item"),startpath:u,content:l},(e=>{H.itemModelPath=e})),this}var te=Codecs.bedrock,re=new ModelFormat({id:"azure_model",name:"AzureLib Animated Model",category:"minecraft",description:"Animated Model for Java mods using AzureLib",icon:"view_in_ar",rotate_cubes:!0,box_uv:!0,optional_box_uv:!0,single_texture:!0,bone_rig:!0,centered_grid:!0,animated_textures:!0,animation_mode:!0,animation_files:!0,locators:!0,codec:Codecs.project,display_mode:!0,onActivation:function(){}});const ne=te,ie=`${o.Kd.min_version} - ${o.Kd.max_version}`;i()(t()(Blockbench.version),ie)||alert(`AzureLib Animation currently only supports Blockbench ${ie}. Please ensure you are using this version of Blockbench to avoid bugs and undefined behavior.`),function(){let e,t,r;Plugin.register("azurelib_utils",Object.assign({},o.Kd,{name:o.Kd.title,version:o.i8,await_loading:!0,onload(){Codecs.project.on("compile",W),Codecs.project.on("parse",Q),Codecs.bedrock.on("compile",Y),E(Animator,null,"buildFile",J),E(Animator,null,"loadFile",Z),Blockbench.on("display_animation_frame",_),Blockbench.on("update_keyframe_selection",w),E(window,null,"updateKeyframeEasing",A),E(window,null,"updateKeyframeEasingArg",O),E(BarItems.keyframe_interpolation,null,"condition",(()=>"azure_model"!==Format.id&&b.get(BarItems.keyframe_interpolation).condition())),E(Keyframe,"prototype","getLerp",R),E(Keyframe,"prototype","compileBedrockKeyframe",N),E(Keyframe,"prototype","getUndoCopy",T),E(Keyframe,"prototype","extend",S),E(BarItems.reverse_keyframes,null,"condition",P),console.log("Loaded AzureLib plugin"),e=new Action({id:"export_AzureLib_model",name:"Export AzureLib .geo Model",icon:"archive",description:"Export your .geo model for AzureLib.",category:"file",condition:()=>"azure_model"===Format.id,click:function(){ne.export()}}),MenuBar.addAction(e,"file.export"),t=new Action({id:"export_AzureLib_display",name:"Export AzureLib Display Settings",icon:"icon-bb_interface",description:"Export your display settings file for AzureLib Item/Blocks.",category:"file",condition:()=>"azure_model"===Format.id,click:ee}),MenuBar.addAction(t,"file.export"),r=new Action("azurelib_settings",{name:"AzureLib Model Settings",description:"Change model type.",icon:"info",condition:()=>"azure_model"===Format.id,click:function(){var e=new Dialog({id:"project",title:"AzureLib Model Settings",width:540,lines:[`AzureLib Animation Utils v${o.i8}`],form:{objectType:{label:"Object Type",type:"select",default:H.objectType,options:G}},onConfirm:function(t){Object.assign(H,t),K(),e.hide()}});e.show()}}),MenuBar.addAction(r,"file.1")},onunload(){e.delete(),t.delete(),r.delete(),Blockbench.removeListener("display_animation_frame",_),Blockbench.removeListener("update_keyframe_selection",w),Codecs.project.events.compile.remove(W),Codecs.project.events.parse.remove(Q),Codecs.bedrock.events.compile.remove(Y),re.delete(),b.forEach((e=>{Object.keys(e).forEach((t=>{t.startsWith("_")||(e._pathAccessor[t]=e[t])}))})),b.clear(),console.clear()}}))}()})()})(); \ No newline at end of file diff --git a/plugins/azurelib_utils/changelog.json b/plugins/azurelib_utils/changelog.json index 8330b4f0..45322965 100644 --- a/plugins/azurelib_utils/changelog.json +++ b/plugins/azurelib_utils/changelog.json @@ -34,5 +34,25 @@ ] } ] + }, + "1.0.8": { + "title": "1.0.8", + "date": "2024-06-01", + "author": "AzureDoom", + "categories": [ + { + "title": "Changes", + "list": [ + "Disables some logging that isn't needed.", + "Now include a license with plugin info, sourced MIT" + ] + }, + { + "title": "Fixes", + "list": [ + "Fixes issue with easing and keyframes." + ] + } + ] } } \ No newline at end of file diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index d992ec18..cad54df9 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1 +1 @@ -"use strict";(()=>{(()=>{let L,k,A,B,D,N,M,X,y,q,K,H,W,S,j,$,Y,Z,ee,te,I,ie,U,O,F,G,Q,V={},c="pbr_preview",le="1.0.0",C="_NONE_",l={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new THREE.Color(16777215)},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new THREE.Color(0)},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new THREE.Color(0)},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new THREE.Color(16777215)},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new THREE.Color(16777215)},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new THREE.Color("rgb(128, 128, 255)")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new THREE.Color(16777215)}},z=(t=!0)=>{let e=Project?Project.textures??Texture.all:Texture.all;return t?e.filter(n=>n.layers_enabled&&n.layers.length>0).flatMap(n=>n.layers):e};class x{constructor(e,n){this._scope=e??z(),this._materialUuid=n}merToCanvas(){let e=this.getTexture(l.emissive),n=this.getTexture(l.roughness),r=this.getTexture(l.metalness);if(!e&&!n&&!r){let{metalness:a,emissive:s,roughness:i}=this.decodeMer();a&&(r=x.makePixelatedCanvas(a)),s&&(e=x.makePixelatedCanvas(s)),i&&(n=x.makePixelatedCanvas(i))}return{emissiveMap:e,roughnessMap:n,metalnessMap:r}}getMaterial(e={}){let{emissiveMap:n,roughnessMap:r,metalnessMap:a}=this.merToCanvas(),s=new THREE.MeshStandardMaterial({map:this.getTexture(l.albedo)??x.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(o=>o.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(l.ao),bumpMap:this.getTexture(l.height),metalnessMap:a,metalness:a?1:0,roughnessMap:r,roughness:1,emissiveMap:n,emissiveIntensity:n?1:0,emissive:n?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:1,alphaTest:.5,...e}),i=this.getTexture(l.normal);return i&&(s.normalMap=i,s.normalScale=new THREE.Vector2(1,1)),s}saveTexture(e,n){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][e.id]=n.uuid,n.extend({channel:e.id}))}findTexture(e,n=!0){if(!Project)return null;let r=this._scope.find(o=>o.channel&&(o.channel===e||o.channel===e.id));if(r)return r;let a=typeof e=="string"?e:e.id;Project.pbr_materials??={};let s=Project.pbr_materials[this._materialUuid];if(!s&&n&&a!==C){let o=new RegExp(`_*${a}(.[^.]+)?$`,"i");return this._scope.find(h=>o.test(h.name))??null}let i=s?.[a];return i?this._scope.find(o=>o.uuid===i)??null:null}static makePixelatedCanvas(e){let n=new THREE.CanvasTexture(e,void 0,void 0,void 0,THREE.NearestFilter,THREE.NearestFilter);return n.needsUpdate=!0,n}getTexture(e){let n=this.findTexture(e);return n?x.makePixelatedCanvas(n.canvas):null}static extractChannel(e,n){let r=e.canvas,a=r.width,s=r.height,i=r.getContext("2d");if(!i||!a||!s)return null;let o=document.createElement("canvas");o.width=a,o.height=s;let h=o.getContext("2d");if(!h)return null;let m={r:0,g:1,b:2,a:3}[n],{data:d}=i.getImageData(0,0,a,s),p=new Uint8ClampedArray(a*s*4);for(let f=0;fe){b[g]=T.data[g],b[g+1]=T.data[g+1],b[g+2]=T.data[g+2],b[g+3]=255;continue}b[g]=0,b[g+1]=0,b[g+2]=0,b[g+3]=255}return m.putImageData(new ImageData(b,o.width,o.height),0,0),{metalness:r,emissive:o,emissiveLevel:a,roughness:s,sss:i}}createMer(e=!1){let n=this.findTexture(l.metalness,e),r=this.findTexture(l.emissive,e),a=this.findTexture(l.roughness,e),s=this.findTexture("sss",!1),i=Math.max(n?.img.width??0,r?.img.width??0,a?.img.width??0,Project?Project.texture_width:0,16),o=Math.max(n?.img.height??0,r?.img.height??0,a?.img.height??0,Project?Project.texture_height:0,16),h=document.createElement("canvas");h.width=i,h.height=o;let m=h.getContext("2d");if(!m)return null;let d=n?.img?x.extractChannel(n,"r"):null,p=r?.img?x.extractChannel(r,"g"):null,T=a?.img?x.extractChannel(a,"b"):null,f=s&&s?.img?x.extractChannel(s,"a"):null,b=d?.getContext("2d")?.getImageData(0,0,i,o)??new ImageData(i,o),g=p?.getContext("2d")?.getImageData(0,0,i,o)??new ImageData(i,o),u=T?.getContext("2d")?.getImageData(0,0,i,o)??new ImageData(i,o),_=f?.getContext("2d")?.getImageData(0,0,i,o)??new ImageData(new Uint8ClampedArray(i*o*4).fill(255),i,o),w=new Uint8ClampedArray(i*o*4);for(let v=0;v{let w=(u+_*a)*4;return i[w]/255};o.width=a,o.height=s,h.drawImage(e.img,0,0,a,s);let d=h.getImageData(0,0,a,s),p=d.data,T=u=>{let _=Math.sqrt(u[0]*u[0]+u[1]*u[1]+u[2]*u[2]);return[u[0]/_,u[1]/_,u[2]/_]};for(let u=0;u[n,l[n].default??new THREE.Color(4294967040)])),...e}}get colors(){return this._colors}set colors(e){this._colors={...this._colors,...e}}getChannel(e){return this._colors[e]}static makeLinearColor(e){let n=Math.min(1,Math.max(0,e));return new THREE.Color(n,n,n).convertSRGBToLinear()}static fromSettings(){let e=Number(U.get()),n=Number(O.get()),r=F.get().toString(),a=Number(G.get()),s=ColorPanel.get(),i={[l.albedo.id]:new THREE.Color(s),[l.metalness.id]:E.makeLinearColor(e),[l.roughness.id]:E.makeLinearColor(n),[l.emissive.id]:new THREE.Color(r??"#000000"),[l.height.id]:E.makeLinearColor(a),[l.normal.id]:l.normal.default??new THREE.Color("#8080ff")};return new E({colors:i})}}K=new Property(TextureLayer,"enum","channel",{default:C,values:Object.keys(l).map(t=>l[t].id),label:"PBR Channel",exposed:!1}),q=new Property(Texture,"enum","channel",{default:C,values:Object.keys(l).map(t=>l[t].id),label:"PBR Channel",exposed:!1}),Y=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),Z=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),ee=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"});let ne=t=>{let e=Project?Project.selected_texture:Texture.all.find(r=>r.selected);if(!e)return;let n=new x(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!1);n&&n.toBlob(async r=>{if(!r)return;let[a,s]=Project?[`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await r.arrayBuffer(),type:"PNG",name:a,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},t)})},P=t=>{if(!Project||Texture.all.length===0)return;let e=!1;Project.elements.forEach(n=>{n instanceof Cube&&Object.keys(n.faces).forEach(r=>{let s=n.faces[r].getTexture();if(!s)return;let i=Project.materials[s.uuid];i.isShaderMaterial&&!Project.bb_materials[s.uuid]&&(Project.bb_materials[s.uuid]=i);let o=new x(s.layers_enabled?s.layers.filter(h=>h.visible)??null:Project.textures,s.uuid).getMaterial(t);Project.materials[s.uuid]=THREE.ShaderMaterial.prototype.copy.call(o,i),Canvas.updateAllFaces(s),e=!0})}),Project.pbr_active=e},ce=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(e=>{let r=t.faces[e].getTexture();if(!r)return;let a=Project.bb_materials[r.uuid];a&&(Project.materials[r.uuid]=a)})}),Project.pbr_active=!1,Canvas.updateAll())},ae=(t,e)=>{let n=e??document.createElement("canvas"),r=n.getContext("2d");if(!r)return null;let a=Math.max(Project?Project.texture_width:16,16),s=Math.max(Project?Project.texture_height:16,16);return n.width=a,n.height=s,r.fillStyle=`rgb(${t.r*255}, ${t.g*255}, ${t.b*255})`,r.fillRect(0,0,a,s),n.toDataURL()},ue=()=>{if(!Project)return;let t=z();Project.textures.forEach(e=>{let n=new x(t,e.uuid),r=n.findTexture(l.normal,!1)?.name,a=n.findTexture(l.height,!1)?.name,s=n.findTexture(l.albedo,!1)?.name,i=n.findTexture(l.metalness,!1)?.name,o=n.findTexture(l.emissive,!1)?.name,h=n.findTexture(l.roughness,!1)?.name,m={};return s||(m.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!i&&!o&&!h&&(m.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},m.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},m.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),r&&a&&(m.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),y=new Dialog(`${c}_texture_set`,{id:`${c}_texture_set`,title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:m,onConfirm(d){let p=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),T=i||o||h,f={format_version:"1.16.100","minecraft:texture_set":{color:(s?pathToName(s,!1):d.baseColor?.toHexString())??p,metalness_emissive_roughness:[d.metalness??0,d.emissive??0,d.roughness??255]}};d.depthMap==="normal"&&r?f["minecraft:texture_set"].normal=pathToName(r,!1):(!r||d.depthMap==="heightmap")&&a&&(f["minecraft:texture_set"].heightmap=pathToName(a,!1));let b=u=>{let _=d.depthMap==="normal"?r:a;if(!_)return u();Blockbench.export({content:_,type:"PNG",name:`${p}_${d.depthMap}`,extensions:["png"],resource_id:d.depthMap,startpath:Project.export_path},u)},g=()=>b(()=>{Blockbench.export({content:JSON.stringify(f,null,2),type:"JSON",name:`${p}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path},()=>{Blockbench.showQuickMessage("Texture set created",2e3),y.hide()})});if(T){ne(u=>{f["minecraft:texture_set"].metalness_emissive_roughness=pathToName(u,!1),g()});return}g()},cancelIndex:1}),y.show(),y})},re=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],se=()=>Project&&Project.pbr_active&&P(),de=()=>{re.forEach(t=>{Blockbench.addListener(t,se)})},oe=()=>{re.forEach(t=>{Blockbench.removeListener(t,se)})},he=()=>{j=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:THREE.NoToneMapping,value:Preview.selected.renderer.toneMapping??THREE.NoToneMapping,icon:"monochrome_photos",options:{[THREE.NoToneMapping]:"None",[THREE.LinearToneMapping]:"Linear",[THREE.ReinhardToneMapping]:"Reinhard",[THREE.CineonToneMapping]:"Cineon",[THREE.ACESFilmicToneMapping]:"ACES"},onChange({value:t}){let e=Number(S.get());Preview.all.forEach(n=>{n.renderer.toneMapping=Number(t),n.renderer.toneMappingExposure=e}),Preview.selected.renderer.toneMapping=Number(t),Preview.selected.renderer.toneMappingExposure=e,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(t)}`,2e3),M.value||M.set(!0),P()}}),S=new BarSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",step:.1,min:-2,max:2,onBefore(){Number(j.get())===THREE.NoToneMapping&&j.change(THREE.LinearToneMapping.toString()),M.set(!0)},onChange({value:t}){let e=Math.max(-2,Math.min(2,Number(t)));Preview.all.forEach(n=>{n.renderer.toneMappingExposure=e}),Preview.selected.renderer.toneMappingExposure=e},onAfter(){P()}}),B=new Action(`${c}_generate_normal`,{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(t=>t.selected))!==void 0,click(){let t=TextureLayer.selected??Project?Project.selected_texture.selected_layer??Project.selected_texture:Texture.getDefault();if(!t)return;let e=new x(t.layers_enabled?t.layers:z(),t.uuid),n=x.createNormalMap(t);if(n){e.saveTexture(l.normal,n),n.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),A=new Action(`${c}_create_mer`,{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",click(){ne()}}),L=new Action(`${c}_decode_mer`,{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",condition:()=>!!Project&&Project.selected_texture!==null&&!Project.selected_texture.layers_enabled,click(){let t=TextureLayer.selected?.texture??Texture.all.find(a=>a.selected)??Texture.getDefault(),e=new x(t.layers_enabled?t.layers:[t],t.uuid),n=e.decodeMer(),r=[l.metalness,l.emissive,l.roughness];Undo.initEdit({textures:[t]}),t.activateLayers(!0),r.forEach(a=>{let s=a.id,i=n[s];if(!i){Blockbench.showStatusMessage(`Failed to decode ${a.label} channel`,3e3);return}let o=new TextureLayer({name:`${t?.name}_${s}`,data_url:i.toDataURL()},t);e.saveTexture(a,o),o.addForEditing()}),Undo.finishEdit("Decode MER")}}),k=new Action(`${c}_create_texture_set`,{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){ue()},condition:{formats:["bedrock"],project:!0}}),N=new Action(`${c}_create_material_texture`,{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",click(){if(!Project)return;let t=new Texture({name:"New Material",saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}),e=ae(new THREE.Color(8421504));e&&(t.fromDataURL(e).add().select(),Object.keys(l).forEach(n=>{let r=l[n],a=new TextureLayer({name:r.label,visible:!0},t);a.setSize(Project.texture_width??t.width,Project.texture_height??t.height);let s=ae(r.default??new THREE.Color(0),a.canvas);s&&a.texture.fromDataURL(s),a.extend({channel:r.id}),a.addForEditing()}))}}),Object.entries(l).forEach(([t,e])=>{V[t]=new Action(`${c}_assign_channel_${t}`,{icon:e.icon??"tv_options_edit_channels",name:`Assign to ${e.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${e.label} channel`,category:"textures",condition:()=>Modes.paint&&(TextureLayer.selected||Project&&Project.selected_texture!==null),click(n){let r=TextureLayer.selected??(Project?Project.selected_texture:null);if(!r||!Project)return;Undo.initEdit({layers:[r]}),r.extend({channel:e.id});let a=r instanceof TextureLayer?r.texture:r;a.updateChangesAfterEdit(),Project.pbr_materials[a.uuid]||(Project.pbr_materials[a.uuid]={}),Object.entries(Project.pbr_materials[a.uuid]).forEach(([s,i])=>{i===r.uuid&&(delete Project.pbr_materials[a.uuid][s],r.channel=C)}),Project.pbr_materials[a.uuid][t]=r.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${r.name}" to ${e.label} channel`,2e3),P()}})}),D=new Action(`${c}_unassign_channel`,{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:()=>{if(!Modes.paint)return!1;if(TextureLayer.selected)return TextureLayer.selected.channel!==C||!TextureLayer.selected.channel;if(!Project)return!1;let t=Project.selected_texture;return t!==null&&(t.channel!==C||!t.channel)},click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t||!Project)return;Undo.initEdit({layers:[t]});let e=t instanceof TextureLayer?t.texture:t,n=t.channel;Project.pbr_materials[e.uuid]={},t.channel=C,e.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${t.name}" from ${n} channel`,2e3),P()}}),M=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(t){if(t){P(),de(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}ce(),oe(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),$=new Toggle(`${c}_correct_lights`,{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(t){Preview.all.forEach(e=>{e.renderer.physicallyCorrectLights=t}),Preview.selected.renderer.physicallyCorrectLights=t,Blockbench.showQuickMessage(`Physically corrected lighting is now ${t?"enabled":"disabled"}`,2e3),t&&M.set(!0),P()},click(){}}),U=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",settings:{min:0,max:1,step:.01,default:0},condition:()=>{if(!Project)return!1;let t=Project.selected_texture;return t?.layers_enabled?t.layers.find(({channel:e})=>e===l.metalness.id)!==void 0:!1}}),O=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",settings:{min:0,max:1,step:.01,default:1},condition:()=>{if(!Project)return!1;let t=Project.selected_texture;return t?.layers_enabled?t.layers.find(({channel:e})=>e===l.roughness.id)!==void 0:!1}}),F=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",condition:()=>{if(!Project)return!1;let t=Project.selected_texture;return t?.layers_enabled?t.layers.find(({channel:e})=>e===l.emissive.id)!==void 0:!1}}),G=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",settings:{min:0,max:1,step:.01,default:.5},condition:()=>{if(!Project)return!1;let t=Project.selected_texture;return t?.layers_enabled?t.layers.find(({channel:e})=>e===l.height.id)!==void 0:!1}}),I=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",condition:()=>Modes.paint&&!!Project&&Project.selected_texture&&Project.selected_texture.layers_enabled,brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(t,e,n,r,{size:a,softness:s,texture:i}){let o=E.fromSettings(),h=Object.keys(o.colors),m=n;return i.layers.forEach(d=>{if(!d.visible||!h.includes(d.channel))return;let p=o.getChannel(d.channel);p&&(d.ctx.fillStyle=p.getStyle(),d.ctx.fillRect(a*t,a*e,a,a),d.selected&&(m={r:p.r*255,g:p.g*255,b:p.b*255,a:r*255}))}),m}},onCanvasClick(t){Painter.startPaintToolCanvas(t,t.event)},onSelect(){P()},click(){P()}}),H=new Menu(`${c}_channel_menu`,[...Object.keys(l).map(t=>`${c}_assign_channel_${t}`),`${c}_unassign_channel`],{onOpen(){P()}}),Q=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",click(t){H.open(t)},children:[...Object.values(V),D]}),W=new Action(`${c}_show_channel_menu`,{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:()=>Modes.paint&&(TextureLayer.selected||Project&&Project.selected_texture!==null),click(t){H.open(t)}}),X=new Panel(`${c}_display_settings`,{name:"PBR Settings",id:`${c}_display_settings_panel`,icon:"display_settings",toolbars:[new Toolbar(`${c}_controls_toolbar`,{id:`${c}_controls_toolbar`,children:["toggle_pbr",`${c}_correct_lights`,`${c}_show_channel_menu`,`${c}_create_material_texture`],name:"PBR"}),new Toolbar(`${c}_display_settings_toolbar`,{id:`${c}_display_settings_toolbar`,children:["display_settings_tone_mapping","display_settings_exposure"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"}),te=new Panel(`${c}_material_brush_panel`,{name:"Material Brush",id:`${c}_material_brush_panel`,icon:"view_in_ar",toolbars:[new Toolbar(`${c}_material_brush_toolbar`,{id:`${c}_material_brush_toolbar`,children:["material_brush","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Brush"})],display_condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"}),MenuBar.addAction(A,"file.export"),MenuBar.addAction(B,"tools"),MenuBar.addAction(L,"tools"),MenuBar.addAction(k,"file.export"),MenuBar.addAction(M,"view"),MenuBar.addAction($,"preview"),MenuBar.addAction(N,"tools"),MenuBar.addAction(I,"tools.0"),MenuBar.addAction(Q,"image.0")},me=()=>{Object.entries(V).forEach(([t,e])=>{e.delete()}),MenuBar.removeAction(`file.export.${c}_create_mer`),MenuBar.removeAction(`file.export.${c}_create_texture_set`),MenuBar.removeAction(`tools.${c}_generate_normal`),oe(),X?.delete(),y?.delete(),N?.delete(),A?.delete(),B?.delete(),M?.delete(),L?.delete(),k?.delete(),q?.delete(),K?.delete(),W?.delete(),S?.delete(),j?.delete(),$?.delete(),D?.delete(),Z?.delete(),Y?.delete(),ee?.delete(),I?.delete(),te?.delete(),ie?.delete(),U?.delete(),O?.delete(),F?.delete(),G?.delete(),Q?.delete()};BBPlugin.register(c,{version:le,title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.1",onload:he,onunload:me})})();})(); +"use strict";(()=>{(()=>{let A,I,N,$,S,U,O,F,E,ee,R,te,ne,G,ae,Q,H,z,re,se,ie,oe,V,me,J,q,X,K,W,Y={},p="pbr_preview",ge="1.0.0",M="_NONE_",l={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new THREE.Color(16777215)},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new THREE.Color(0)},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new THREE.Color(0)},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new THREE.Color(16777215)},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new THREE.Color(16777215)},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new THREE.Color("rgb(128, 128, 255)")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new THREE.Color(16777215)}},Z=(n=!0)=>{let e=Project?Project.textures??Texture.all:Texture.all;return n?e.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):e};class v{constructor(e,t){this._scope=e??Z(),this._materialUuid=t}merToCanvas(){let e=this.getTexture(l.emissive),t=this.getTexture(l.roughness),r=this.getTexture(l.metalness);if(!e&&!t&&!r){let{metalness:a,emissive:s,roughness:o}=this.decodeMer();a&&(r=v.makePixelatedCanvas(a)),s&&(e=v.makePixelatedCanvas(s)),o&&(t=v.makePixelatedCanvas(o))}return{emissiveMap:e,roughnessMap:t,metalnessMap:r}}getMaterial(e={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:a}=this.merToCanvas(),s=new THREE.MeshStandardMaterial({map:this.getTexture(l.albedo)??v.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(i=>i.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(l.ao),bumpMap:this.getTexture(l.height),metalnessMap:a,metalness:a?1:0,roughnessMap:r,roughness:1,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:1,alphaTest:.5,...e}),o=this.getTexture(l.normal);return o&&(s.normalMap=o,s.normalScale=new THREE.Vector2(1,1)),s}saveTexture(e,t){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][e.id]=t.uuid,t.extend({channel:e.id}))}findTexture(e,t=!0){if(!Project)return null;let r=this._scope.find(i=>i.channel&&(i.channel===e||i.channel===e.id));if(r)return r;let a=typeof e=="string"?e:e.id;Project.pbr_materials??={};let s=Project.pbr_materials[this._materialUuid];if(!s&&t&&a!==M){let i=new RegExp(`_*${a}(.[^.]+)?$`,"i");return this._scope.find(f=>i.test(f.name))??null}let o=s?.[a];return o?this._scope.find(i=>i.uuid===o)??null:null}static makePixelatedCanvas(e){let t=new THREE.CanvasTexture(e,void 0,void 0,void 0,THREE.NearestFilter,THREE.NearestFilter);return t.needsUpdate=!0,t}getTexture(e){let t=this.findTexture(e);return t?v.makePixelatedCanvas(t.canvas):null}static extractChannel(e,t){let r=e.canvas,a=r.width,s=r.height,o=r.getContext("2d");if(!o||!a||!s)return null;let i=document.createElement("canvas");i.width=a,i.height=s;let f=i.getContext("2d");if(!f)return null;let h={r:0,g:1,b:2,a:3}[t],{data:g}=o.getImageData(0,0,a,s),c=new Uint8ClampedArray(a*s*4);for(let d=0;de){b[x]=w.data[x],b[x+1]=w.data[x+1],b[x+2]=w.data[x+2],b[x+3]=255;continue}b[x]=0,b[x+1]=0,b[x+2]=0,b[x+3]=255}return h.putImageData(new ImageData(b,i.width,i.height),0,0),{metalness:r,emissive:i,emissiveLevel:a,roughness:s,sss:o}}createMer(e=!1){let t=this.findTexture(l.metalness,e),r=this.findTexture(l.emissive,e),a=this.findTexture(l.roughness,e),s=this.findTexture("sss",!1),o=Math.max(t?.img.width??0,r?.img.width??0,a?.img.width??0,Project?Project.texture_width:0,16),i=Math.max(t?.img.height??0,r?.img.height??0,a?.img.height??0,Project?Project.texture_height:0,16),f=document.createElement("canvas");f.width=o,f.height=i;let h=f.getContext("2d");if(!h)return null;let g=t?.img?v.extractChannel(t,"r"):null,c=r?.img?v.extractChannel(r,"g"):null,w=a?.img?v.extractChannel(a,"b"):null,d=s&&s?.img?v.extractChannel(s,"a"):null,b=g?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),x=c?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),u=w?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),m=d?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(new Uint8ClampedArray(o*i*4).fill(255),o,i),_=new Uint8ClampedArray(o*i*4);for(let T=0;T<_.length;T+=4)_[T]=b.data[T],_[T+1]=x.data[T],_[T+2]=u.data[T],_[T+3]=m.data[T];return h.putImageData(new ImageData(_,o,i),0,0),f}static createNormalMap(e,t=!1){let r=e.canvas.getContext("2d");if(!r)return null;let a=Math.max(e.img.width??e.canvas.width,Project?Project.texture_width:0,16),s=Math.max(e.img.height??e.canvas.height,Project?Project.texture_height:0,16),{data:o}=r.getImageData(0,0,a,s),i=document.createElement("canvas"),f=i.getContext("2d");if(!f)return null;let h=(u,m)=>{let _=(u+m*a)*4;return o[_]/255};i.width=a,i.height=s,f.drawImage(e.img,0,0,a,s);let g=f.getImageData(0,0,a,s),c=g.data,w=u=>{let m=Math.sqrt(u[0]*u[0]+u[1]*u[1]+u[2]*u[2]);return[u[0]/m,u[1]/m,u[2]/m]};for(let u=0;u[t,l[t].default??new THREE.Color(4294967040)])),...e}}get colors(){return this._colors}set colors(e){this._colors={...this._colors,...e}}getChannel(e){return this._colors[e]}static makeLinearColor(e){let t=Math.min(1,Math.max(0,e));return new THREE.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let e=Number(J.get()),t=Number(q.get()),r=X.get().toString(),a=Number(K.get()),s=ColorPanel.get(),o={[l.albedo.id]:new THREE.Color(s),[l.metalness.id]:k.makeLinearColor(e),[l.roughness.id]:k.makeLinearColor(t),[l.emissive.id]:new THREE.Color(r??"#000000"),[l.height.id]:k.makeLinearColor(a),[l.normal.id]:l.normal.default??new THREE.Color("#8080ff")};return new k({colors:o})}}class pe{constructor({lightHeight:e=.66,ambientLight:t=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:a=[1,1,1]}={}){this.lightHeight=e,this.ambientLight=t,this.minLightIntensity=r,this.lightDiffuse=a}bake(e,t,r){let a=t instanceof HTMLCanvasElement?t:this.createCanvas(t.width,t.height),s=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),o=a.getContext("2d"),i=s.getContext("2d");o.drawImage(t,0,0),i.drawImage(r,0,0);let f=o.getImageData(0,0,t.width,t.height),h=i.getImageData(0,0,r.width,r.height),g=[],c=[];for(let d=0;d{let b=this.createCanvas(t.width,t.height),x=b.getContext("2d"),u=x.getImageData(0,0,b.width,b.height),m=[Math.cos(d),Math.sin(d),this.lightHeight];for(let _=0;_l[n].id),label:"PBR Channel",exposed:!1}),te=new Property(Texture,"enum","channel",{default:M,values:Object.keys(l).map(n=>l[n].id),label:"PBR Channel",exposed:!1}),re=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),se=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),ie=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"});let le=(n,e)=>{let t=Project?Project.selected_texture:Texture.all.find(a=>a.selected);if(!t)return;let r=new v(t.layers_enabled?t.layers:Project?Project.textures:null,t.uuid).createMer(!1);r&&r.toBlob(async a=>{if(!a)return;let[s,o]=Project?[n?`${n}_mer`:`${t.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await a.arrayBuffer(),type:"PNG",name:s,extensions:["png"],resource_id:"mer",savetype:"image",startpath:o},e)})},y=n=>{if(!Project||Texture.all.length===0)return;let e=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(r=>{let s=t.faces[r].getTexture();if(!s)return;let o=Project.materials[s.uuid];o.isShaderMaterial&&!Project.bb_materials[s.uuid]&&(Project.bb_materials[s.uuid]=o);let i=new v(s.layers_enabled?s.layers.filter(f=>f.visible)??null:Project.textures,s.uuid).getMaterial(n);Project.materials[s.uuid]=THREE.ShaderMaterial.prototype.copy.call(i,o),Canvas.updateAllFaces(s),e=!0})}),Project.pbr_active=e},fe=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(n=>{n instanceof Cube&&Object.keys(n.faces).forEach(e=>{let r=n.faces[e].getTexture();if(!r)return;let a=Project.bb_materials[r.uuid];a&&(Project.materials[r.uuid]=a)})}),Project.pbr_active=!1,Canvas.updateAll())},ce=(n,e)=>{let t=e??document.createElement("canvas"),r=t.getContext("2d");if(!r)return null;let a=Math.max(Project?Project.texture_width:16,16),s=Math.max(Project?Project.texture_height:16,16);return t.width=a,t.height=s,r.fillStyle=`rgb(${n.r*255}, ${n.g*255}, ${n.b*255})`,r.fillRect(0,0,a,s),t.toDataURL()},xe=(n,e=8,t=!1)=>{if(!Project)return;let r=Project.selected_texture;if(!r)return;let a=new v(r.layers_enabled?r.layers:Project.textures,r.uuid),s=a.findTexture(l.albedo),o=a.findTexture(l.normal);if(!s||!o)return;let f=new pe(n).bake(e,s.canvas,o.canvas),h=new Texture({name:`${s.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(f[0].toDataURL()),g=t?c=>{let w=a.findTexture(l.emissive);if(!w)return c;let d=w.canvas;if(!d.getContext("2d"))return c;let x=Math.max(c.width,d.width,Project?Project.texture_width:16),u=Math.max(c.height,d.height,Project?Project.texture_height:16),m=document.createElement("canvas");m.width=x,m.height=u;let _=m.getContext("2d");return _?(_.drawImage(c,0,0),_.globalCompositeOperation="screen",_.drawImage(d,0,0),m):c}:c=>c;f.forEach((c,w)=>{new TextureLayer({name:`baked_${w+1}`,data_url:g(c).toDataURL()},h).addForEditing()}),h.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)},be=()=>{if(!Project)return;let n=Z();Project.textures.forEach(e=>{let t=new v(n,e.uuid),r=t.findTexture(l.normal,!1),a=t.findTexture(l.height,!1),s=t.findTexture(l.albedo,!1),o=t.findTexture(l.metalness,!1)?.name,i=t.findTexture(l.emissive,!1)?.name,f=t.findTexture(l.roughness,!1)?.name,h={};return s||(h.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!i&&!f&&(h.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},h.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},h.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),r&&(h.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),a&&(h.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),r&&a&&(h.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),R=new Dialog(`${p}_texture_set`,{id:`${p}_texture_set`,title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:h,onConfirm(g){let c=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),w=o||i||f,d={format_version:"1.16.100","minecraft:texture_set":{color:(s?c:g.baseColor?.toHexString())??c,metalness_emissive_roughness:[g.metalness??0,g.emissive??0,g.roughness??255]}};g.depthMap==="normal"&&r||!a&&r?d["minecraft:texture_set"].normal=`${c}_normal`:(!r||g.depthMap==="heightmap")&&a&&(d["minecraft:texture_set"].heightmap=`${c}_heightmap`);let b=m=>{if(!g.depthMap)return m();let _=g.depthMap==="normal"||g.depthMap&&!a,T=_?r:a;if(!T)return m();Blockbench.export({content:T.canvas.toDataURL()??"",type:"PNG",name:`${c}_${_?"normal":"heightmap"}`,extensions:["png"],resource_id:g.depthMap,startpath:Project.export_path,savetype:"image"},j=>{d["minecraft:texture_set"][_?"normal":"heightmap"]=pathToName(j,!1),m()})},x=m=>{if(!s)return m();Blockbench.export({content:s.canvas.toDataURL(),extensions:["png"],type:"PNG",name:c,startpath:Project.export_path,savetype:"image"},_=>{d["minecraft:texture_set"].color=pathToName(_,!1),m()})},u=()=>b(()=>{x(()=>{Blockbench.export({content:JSON.stringify(d,null,2),type:"JSON",name:`${c}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),R.hide()})})});if(w){le(c,m=>{d["minecraft:texture_set"].metalness_emissive_roughness=pathToName(m,!1),u()});return}u()},cancelIndex:1}),R.show(),R})},ue=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],de=()=>Project&&Project.pbr_active&&y(),_e=()=>{ue.forEach(n=>{Blockbench.addListener(n,de)})},he=()=>{ue.forEach(n=>{Blockbench.removeListener(n,de)})},ve=()=>{H=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:THREE.NoToneMapping,value:Preview.selected.renderer.toneMapping??THREE.NoToneMapping,icon:"monochrome_photos",options:{[THREE.NoToneMapping]:"None",[THREE.LinearToneMapping]:"Linear",[THREE.ReinhardToneMapping]:"Reinhard",[THREE.CineonToneMapping]:"Cineon",[THREE.ACESFilmicToneMapping]:"ACES"},onChange({value:n}){let e=Number(Q.get());Preview.all.forEach(t=>{t.renderer.toneMapping=Number(n),t.renderer.toneMappingExposure=e}),Preview.selected.renderer.toneMapping=Number(n),Preview.selected.renderer.toneMappingExposure=e,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(n)}`,2e3),E.value||E.set(!0),y()}}),Q=new BarSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",step:.1,min:-2,max:2,onBefore(){Number(H.get())===THREE.NoToneMapping&&H.change(THREE.LinearToneMapping.toString()),E.set(!0)},onChange({value:n}){let e=Math.max(-2,Math.min(2,Number(n)));Preview.all.forEach(t=>{t.renderer.toneMappingExposure=e}),Preview.selected.renderer.toneMappingExposure=e},onAfter(){y()}}),F=new Dialog(`${p}_bake_textures`,{id:`${p}_bake_textures`,title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(n){let e=new THREE.Color(n.ambientLight.toString()),t=new THREE.Color(n.lightDiffuse.toString());xe({ambientLight:[e.r,e.g,e.b],lightDiffuse:[t.r,t.g,t.b],lightHeight:Number(n.lightHeight),minLightIntensity:Number(n.minLightIntensity)},n.directions??8,n.blendEmissive??!1)}}),O=new Action(`${p}_bake_textures`,{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){F.show()}}),$=new Action(`${p}_generate_normal`,{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(n=>n.selected))!==void 0,click(){let n=TextureLayer.selected??(Project&&Project.selected_texture?Project.selected_texture.selected_layer??Project.selected_texture:Texture.getDefault());if(!n)return;let e=new v(n instanceof Texture&&n.layers_enabled?n.layers:Z(),n.uuid),t=v.createNormalMap(n);if(t){e.saveTexture(l.normal,t),t.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),N=new Action(`${p}_create_mer`,{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock_block","bedrock_entity"],project:!0},click(){le()}}),A=new Action(`${p}_decode_mer`,{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",condition:()=>!!Project&&Project.selected_texture!==null&&!Project.selected_texture.layers_enabled,click(){let n=TextureLayer.selected?.texture??Texture.all.find(a=>a.selected)??Texture.getDefault(),e=new v(n.layers_enabled?n.layers:[n],n.uuid),t=e.decodeMer(),r=[l.metalness,l.emissive,l.roughness];Undo.initEdit({textures:[n]}),n.activateLayers(!0),r.forEach(a=>{let s=a.id,o=t[s];if(!o){Blockbench.showStatusMessage(`Failed to decode ${a.label} channel`,3e3);return}let i=new TextureLayer({name:`${n?.name}_${s}`,data_url:o.toDataURL()},n);e.saveTexture(a,i),i.addForEditing()}),Undo.finishEdit("Decode MER")}}),I=new Action(`${p}_create_texture_set`,{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){be()},condition:{formats:["bedrock_block","bedrock_entity"],project:!0}}),U=new Action(`${p}_create_material_texture`,{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",click(){if(!Project)return;let n=new Texture({name:"New Material",saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}),e=ce(new THREE.Color(8421504));e&&(n.fromDataURL(e).add().select(),Object.keys(l).forEach(t=>{let r=l[t],a=new TextureLayer({name:r.label,visible:!0},n);a.setSize(Project.texture_width??n.width,Project.texture_height??n.height);let s=ce(r.default??new THREE.Color(0),a.canvas);s&&a.texture.fromDataURL(s),a.extend({channel:r.id}),a.addForEditing()}))}}),Object.entries(l).forEach(([n,e])=>{Y[n]=new Action(`${p}_assign_channel_${n}`,{icon:e.icon??"tv_options_edit_channels",name:`Assign to ${e.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${e.label} channel`,category:"textures",condition:()=>Modes.paint&&(TextureLayer.selected||Project&&Project.selected_texture!==null),click(t){let r=TextureLayer.selected??(Project?Project.selected_texture:null);if(!r||!Project)return;Undo.initEdit({layers:[r]}),r.extend({channel:e.id});let a=r instanceof TextureLayer?r.texture:r;a.updateChangesAfterEdit(),Project.pbr_materials[a.uuid]||(Project.pbr_materials[a.uuid]={}),Object.entries(Project.pbr_materials[a.uuid]).forEach(([s,o])=>{o===r.uuid&&(delete Project.pbr_materials[a.uuid][s],r.channel=M)}),Project.pbr_materials[a.uuid][n]=r.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${r.name}" to ${e.label} channel`,2e3),y()}})}),S=new Action(`${p}_unassign_channel`,{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:()=>{if(!Modes.paint)return!1;if(TextureLayer.selected)return TextureLayer.selected.channel!==M||!TextureLayer.selected.channel;if(!Project)return!1;let n=Project.selected_texture;return n!==null&&(n.channel!==M||!n.channel)},click(){let n=TextureLayer.selected??(Project?Project.selected_texture:null);if(!n||!Project)return;Undo.initEdit({layers:[n]});let e=n instanceof TextureLayer?n.texture:n,t=n.channel;Project.pbr_materials[e.uuid]={},n.channel=M,e.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${n.name}" from ${t} channel`,2e3),y()}}),E=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(n){if(n){y(),_e(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}fe(),he(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),z=new Toggle(`${p}_correct_lights`,{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(n){Preview.all.forEach(e=>{e.renderer.physicallyCorrectLights=n}),Preview.selected.renderer.physicallyCorrectLights=n,Blockbench.showQuickMessage(`Physically corrected lighting is now ${n?"enabled":"disabled"}`,2e3),n&&E.set(!0),y()},click(){}}),J=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",settings:{min:0,max:1,step:.01,default:0},condition:()=>{if(!Project)return!1;let n=Project.selected_texture;return n?.layers_enabled?n.layers.find(({channel:e})=>e===l.metalness.id)!==void 0:!1}}),q=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",settings:{min:0,max:1,step:.01,default:1},condition:()=>{if(!Project)return!1;let n=Project.selected_texture;return n?.layers_enabled?n.layers.find(({channel:e})=>e===l.roughness.id)!==void 0:!1}}),X=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",condition:()=>{if(!Project)return!1;let n=Project.selected_texture;return n?.layers_enabled?n.layers.find(({channel:e})=>e===l.emissive.id)!==void 0:!1}}),K=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",settings:{min:0,max:1,step:.01,default:.5},condition:()=>{if(!Project)return!1;let n=Project.selected_texture;return n?.layers_enabled?n.layers.find(({channel:e})=>e===l.height.id)!==void 0:!1}}),V=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",condition:()=>Modes.paint&&!!Project&&Project.selected_texture&&Project.selected_texture.layers_enabled,brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(n,e,t,r,{size:a,softness:s,texture:o}){let i=k.fromSettings(),f=Object.keys(i.colors),h=t;return o.layers.forEach(g=>{if(!g.visible||!f.includes(g.channel))return;let c=i.getChannel(g.channel);c&&(g.ctx.fillStyle=c.getStyle(),g.ctx.fillRect(a*n,a*e,a,a),g.selected&&(h={r:c.r*255,g:c.g*255,b:c.b*255,a:r*255}))}),h}},onCanvasClick(n){Painter.startPaintToolCanvas(n,n.event)},onSelect(){y()},click(){y()}}),G=new Menu(`${p}_channel_menu`,[...Object.keys(l).map(n=>`${p}_assign_channel_${n}`),`${p}_unassign_channel`],{onOpen(){y()}}),W=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",click(n){G.open(n)},children:[...Object.values(Y),S]}),ae=new Action(`${p}_show_channel_menu`,{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:()=>Modes.paint&&(TextureLayer.selected||Project&&Project.selected_texture!==null),click(n){G.open(n)}}),ee=new Panel(`${p}_display_settings`,{name:"PBR Settings",id:`${p}_display_settings_panel`,icon:"display_settings",toolbars:[new Toolbar(`${p}_controls_toolbar`,{id:`${p}_controls_toolbar`,children:["toggle_pbr",`${p}_correct_lights`,`${p}_create_material_texture`,`${p}_show_channel_menu`],name:"PBR"}),new Toolbar(`${p}_display_settings_toolbar`,{id:`${p}_display_settings_toolbar`,children:["display_settings_tone_mapping","display_settings_exposure"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"}),oe=new Panel(`${p}_material_brush_panel`,{name:"Material Brush",id:`${p}_material_brush_panel`,icon:"view_in_ar",toolbars:[new Toolbar(`${p}_material_brush_toolbar`,{id:`${p}_material_brush_toolbar`,children:["material_brush","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Brush"})],display_condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"}),MenuBar.addAction(N,"file.export"),MenuBar.addAction($,"tools"),MenuBar.addAction(A,"tools"),MenuBar.addAction(I,"file.export"),MenuBar.addAction(E,"view"),MenuBar.addAction(z,"preview"),MenuBar.addAction(U,"tools"),MenuBar.addAction(O,"tools"),MenuBar.addAction(V,"tools.0"),MenuBar.addAction(W,"image.0")},Te=()=>{Object.entries(Y).forEach(([n,e])=>{e.delete()}),MenuBar.removeAction(`file.export.${p}_create_mer`),MenuBar.removeAction(`file.export.${p}_create_texture_set`),MenuBar.removeAction(`tools.${p}_generate_normal`),he(),ee?.delete(),R?.delete(),U?.delete(),N?.delete(),$?.delete(),E?.delete(),A?.delete(),O?.delete(),F?.delete(),I?.delete(),te?.delete(),ne?.delete(),ae?.delete(),Q?.delete(),H?.delete(),z?.delete(),S?.delete(),se?.delete(),re?.delete(),ie?.delete(),V?.delete(),oe?.delete(),me?.delete(),J?.delete(),q?.delete(),X?.delete(),K?.delete(),W?.delete()};BBPlugin.register(p,{version:ge,title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.1",onload:ve,onunload:Te})})();})(); diff --git a/src/animation_utils/.eslintrc.json b/src/animation_utils/.eslintrc.json deleted file mode 100644 index c5aa8587..00000000 --- a/src/animation_utils/.eslintrc.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "env": { - "browser": true, - "es2015": true, - "jquery": true - }, - "extends": "eslint:recommended", - "parserOptions": { - "ecmaVersion": 11, - "sourceType": "module" - }, - "globals": { - "isApp": "readonly", - "display": "readonly", - "settings": "readonly", - "Animator": "readonly", - "Blockbench": "readonly", - "Keyframe": "readonly", - "BarItems": "readonly", - "Format": "readonly", - "Action": "readonly", - "MenuBar": "readonly", - "Project": "readonly", - "Cube": "readonly", - "Canvas": "readonly", - "Undo": "readonly", - "ModelFormat": "readonly", - "Timeline": "readonly", - "BoneAnimator": "readonly", - "Codecs": "readonly", - "Codec": "readonly", - "Merge": "readonly", - "Modes": "readonly", - "ModelMeta": "readonly", - "Group": "readonly", - "Outliner": "readonly", - "Dialog": "readonly", - "DisplayMode": "readonly" - }, - "rules": { - "no-console": "error" - } -} \ No newline at end of file diff --git a/src/animation_utils/keyframe.js b/src/animation_utils/keyframe.js deleted file mode 100644 index 86752ce8..00000000 --- a/src/animation_utils/keyframe.js +++ /dev/null @@ -1,104 +0,0 @@ -import { Original, addMonkeypatch, hasArgs } from './utils'; -import { easingFunctions, EASING_DEFAULT, getEasingArgDefault } from './easing'; - -//#region Keyframe Mixins -export function loadKeyframeOverrides() { - addMonkeypatch(Keyframe, "prototype", "getLerp", keyframeGetLerp); - addMonkeypatch(Keyframe, "prototype", "getArray", keyframeGetArray); - addMonkeypatch(Keyframe, "prototype", "getUndoCopy", keyframeGetUndoCopy); - addMonkeypatch(Keyframe, "prototype", "extend", keyframeExtend); - - addMonkeypatch(BarItems.reverse_keyframes, null, "condition", reverseKeyframesCondition); -} - -export function unloadKeyframeOverrides() { - //No-op for now since monkeypatches are unloaded automatically -} - -function lerp(start, stop, amt) { - return amt * (stop - start) + start; -} - -// eslint-disable-next-line no-unused-vars -function keyframeGetLerp(other, axis, amount, allow_expression) { - const easing = other.easing || EASING_DEFAULT; - if (Format.id !== "animated_entity_model") { - return Original.get(Keyframe).getLerp.apply(this, arguments); - } - let easingFunc = easingFunctions[easing]; - if (hasArgs(easing)) { - const arg1 = Array.isArray(other.easingArgs) && other.easingArgs.length > 0 - ? other.easingArgs[0] - : getEasingArgDefault(other); - // console.log(`keyframeGetLerp arg1: ${arg1}`); - easingFunc = easingFunc.bind(null, arg1); - } - const easedAmount = easingFunc(amount); - const start = this.calc(axis); - const stop = other.calc(axis); - const result = lerp(start, stop, easedAmount); - // console.log('keyframeGetLerp easing:', easing, 'arguments:', arguments, 'start:', start, 'stop:', stop, 'amount:', amount, 'easedAmount:', easedAmount, 'result:', result); - if (Number.isNaN(result)) { - throw new Error('batman'); - } - return result; -} - -function keyframeGetArray() { - const { easing, easingArgs } = this; - let result = Original.get(Keyframe).getArray.apply(this, arguments); - if (Format.id === "animated_entity_model") { - result = { vector: result, easing }; - if (hasArgs(easing)) result.easingArgs = easingArgs; - } -// console.log('keyframeGetArray arguments:', arguments, 'this:', this, 'result:', result); - return result; -} - -function keyframeGetUndoCopy() { - const { easing, easingArgs } = this; - const result = Original.get(Keyframe).getUndoCopy.apply(this, arguments); - if (Format.id === "animated_entity_model") { - Object.assign(result, { easing }); - if (hasArgs(easing)) result.easingArgs = easingArgs; - } -// console.log('keyframeGetUndoCopy arguments:', arguments, 'this:', this, 'result:', result); - return result; -} - -function keyframeExtend(dataIn) { - const data = Object.assign({}, dataIn); -// console.log('keyframeExtend 1 arguments:', arguments); - if (Format.id === "animated_entity_model") { - if (typeof data.values === 'object') { - if (data.values.easing !== undefined) { - Merge.string(this, data.values, 'easing'); - } - if (Array.isArray(data.values.easingArgs)) { - this.easingArgs = data.values.easingArgs; - } - if (!Array.isArray(data.values) && Array.isArray(data.values.vector)) { - // Convert data to format expected by KeyframeExtendOriginal - data.values = data.values.vector; - } - } else { - if (data.easing !== undefined) { - Merge.string(this, data, 'easing'); - } - if (Array.isArray(data.easingArgs)) { - this.easingArgs = data.easingArgs; - } - } - } - const result = Original.get(Keyframe).extend.apply(this, arguments); -// console.log('keyframeExtend 2 arguments:', arguments, 'this:', this, 'result:', result); - return result; -} - -function reverseKeyframesCondition() { - const res = Original.get(BarItems.reverse_keyframes).condition() && Format.id !== "animated_entity_model"; - // console.log('reverseKeyframesCondition original:',Original.get(BarItems.reverse_keyframes).condition(), 'res:', res); - return res; -} - -//#endregion Keyframe Mixins \ No newline at end of file diff --git a/src/animation_utils/package-lock.json b/src/animation_utils/package-lock.json deleted file mode 100644 index 2be0e9da..00000000 --- a/src/animation_utils/package-lock.json +++ /dev/null @@ -1,9319 +0,0 @@ -{ - "name": "animation_utils", - "version": "3.0.7", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "animation_utils", - "version": "3.0.7", - "license": "MIT", - "dependencies": { - "indent-string": "^5.0.0", - "lodash": "^4.17.21", - "semver": "7.3.2" - }, - "devDependencies": { - "eol": "0.9.1", - "eslint": "7.7.0", - "webpack": "4.43.0", - "webpack-cli": "3.3.12" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", - "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.10.4" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", - "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", - "dev": true - }, - "node_modules/@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.10.4", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "node_modules/@types/color-name": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", - "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", - "dev": true - }, - "node_modules/@webassemblyjs/ast": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz", - "integrity": "sha512-C6wW5L+b7ogSDVqymbkkvuW9kruN//YisMED04xzeBBqjHa2FYnmvOlS6Xj68xWQRgWvI9cIglsjFowH/RJyEA==", - "dev": true, - "dependencies": { - "@webassemblyjs/helper-module-context": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/wast-parser": "1.9.0" - } - }, - "node_modules/@webassemblyjs/floating-point-hex-parser": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.9.0.tgz", - "integrity": "sha512-TG5qcFsS8QB4g4MhrxK5TqfdNe7Ey/7YL/xN+36rRjl/BlGE/NcBvJcqsRgCP6Z92mRE+7N50pRIi8SmKUbcQA==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-api-error": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.9.0.tgz", - "integrity": "sha512-NcMLjoFMXpsASZFxJ5h2HZRcEhDkvnNFOAKneP5RbKRzaWJN36NC4jqQHKwStIhGXu5mUWlUUk7ygdtrO8lbmw==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.9.0.tgz", - "integrity": "sha512-qZol43oqhq6yBPx7YM3m9Bv7WMV9Eevj6kMi6InKOuZxhw+q9hOkvq5e/PpKSiLfyetpaBnogSbNCfBwyB00CA==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-code-frame": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.9.0.tgz", - "integrity": "sha512-ERCYdJBkD9Vu4vtjUYe8LZruWuNIToYq/ME22igL+2vj2dQ2OOujIZr3MEFvfEaqKoVqpsFKAGsRdBSBjrIvZA==", - "dev": true, - "dependencies": { - "@webassemblyjs/wast-printer": "1.9.0" - } - }, - "node_modules/@webassemblyjs/helper-fsm": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.9.0.tgz", - "integrity": "sha512-OPRowhGbshCb5PxJ8LocpdX9Kl0uB4XsAjl6jH/dWKlk/mzsANvhwbiULsaiqT5GZGT9qinTICdj6PLuM5gslw==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-module-context": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.9.0.tgz", - "integrity": "sha512-MJCW8iGC08tMk2enck1aPW+BE5Cw8/7ph/VGZxwyvGbJwjktKkDK7vy7gAmMDx88D7mhDTCNKAW5tED+gZ0W8g==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.9.0" - } - }, - "node_modules/@webassemblyjs/helper-wasm-bytecode": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.9.0.tgz", - "integrity": "sha512-R7FStIzyNcd7xKxCZH5lE0Bqy+hGTwS3LJjuv1ZVxd9O7eHCedSdrId/hMOd20I+v8wDXEn+bjfKDLzTepoaUw==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.9.0.tgz", - "integrity": "sha512-XnMB8l3ek4tvrKUUku+IVaXNHz2YsJyOOmz+MMkZvh8h1uSJpSen6vYnw3IoQ7WwEuAhL8Efjms1ZWjqh2agvw==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-buffer": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/wasm-gen": "1.9.0" - } - }, - "node_modules/@webassemblyjs/ieee754": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.9.0.tgz", - "integrity": "sha512-dcX8JuYU/gvymzIHc9DgxTzUUTLexWwt8uCTWP3otys596io0L5aW02Gb1RjYpx2+0Jus1h4ZFqjla7umFniTg==", - "dev": true, - "dependencies": { - "@xtuc/ieee754": "^1.2.0" - } - }, - "node_modules/@webassemblyjs/leb128": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.9.0.tgz", - "integrity": "sha512-ENVzM5VwV1ojs9jam6vPys97B/S65YQtv/aanqnU7D8aSoHFX8GyhGg0CMfyKNIHBuAVjy3tlzd5QMMINa7wpw==", - "dev": true, - "dependencies": { - "@xtuc/long": "4.2.2" - } - }, - "node_modules/@webassemblyjs/utf8": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.9.0.tgz", - "integrity": "sha512-GZbQlWtopBTP0u7cHrEx+73yZKrQoBMpwkGEIqlacljhXCkVM1kMQge/Mf+csMJAjEdSwhOyLAS0AoR3AG5P8w==", - "dev": true - }, - "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.9.0.tgz", - "integrity": "sha512-FgHzBm80uwz5M8WKnMTn6j/sVbqilPdQXTWraSjBwFXSYGirpkSWE2R9Qvz9tNiTKQvoKILpCuTjBKzOIm0nxw==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-buffer": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/helper-wasm-section": "1.9.0", - "@webassemblyjs/wasm-gen": "1.9.0", - "@webassemblyjs/wasm-opt": "1.9.0", - "@webassemblyjs/wasm-parser": "1.9.0", - "@webassemblyjs/wast-printer": "1.9.0" - } - }, - "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.9.0.tgz", - "integrity": "sha512-cPE3o44YzOOHvlsb4+E9qSqjc9Qf9Na1OO/BHFy4OI91XDE14MjFN4lTMezzaIWdPqHnsTodGGNP+iRSYfGkjA==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/ieee754": "1.9.0", - "@webassemblyjs/leb128": "1.9.0", - "@webassemblyjs/utf8": "1.9.0" - } - }, - "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.9.0.tgz", - "integrity": "sha512-Qkjgm6Anhm+OMbIL0iokO7meajkzQD71ioelnfPEj6r4eOFuqm4YC3VBPqXjFyyNwowzbMD+hizmprP/Fwkl2A==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-buffer": "1.9.0", - "@webassemblyjs/wasm-gen": "1.9.0", - "@webassemblyjs/wasm-parser": "1.9.0" - } - }, - "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.9.0.tgz", - "integrity": "sha512-9+wkMowR2AmdSWQzsPEjFU7njh8HTO5MqO8vjwEHuM+AMHioNqSBONRdr0NQQ3dVQrzp0s8lTcYqzUdb7YgELA==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-api-error": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/ieee754": "1.9.0", - "@webassemblyjs/leb128": "1.9.0", - "@webassemblyjs/utf8": "1.9.0" - } - }, - "node_modules/@webassemblyjs/wast-parser": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.9.0.tgz", - "integrity": "sha512-qsqSAP3QQ3LyZjNC/0jBJ/ToSxfYJ8kYyuiGvtn/8MK89VrNEfwj7BPQzJVHi0jGTRK2dGdJ5PRqhtjzoww+bw==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/floating-point-hex-parser": "1.9.0", - "@webassemblyjs/helper-api-error": "1.9.0", - "@webassemblyjs/helper-code-frame": "1.9.0", - "@webassemblyjs/helper-fsm": "1.9.0", - "@xtuc/long": "4.2.2" - } - }, - "node_modules/@webassemblyjs/wast-printer": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.9.0.tgz", - "integrity": "sha512-2J0nE95rHXHyQ24cWjMKJ1tqB/ds8z/cyeOZxJhcb+rW+SQASVjuznUSmdz5GpVJTzU8JkhYut0D3siFDD6wsA==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/wast-parser": "1.9.0", - "@xtuc/long": "4.2.2" - } - }, - "node_modules/@xtuc/ieee754": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", - "dev": true - }, - "node_modules/@xtuc/long": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", - "dev": true - }, - "node_modules/acorn": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", - "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", - "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", - "dev": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0" - } - }, - "node_modules/ajv": { - "version": "6.12.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.3.tgz", - "integrity": "sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ajv-errors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", - "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", - "dev": true, - "peerDependencies": { - "ajv": ">=5.0.0" - } - }, - "node_modules/ajv-keywords": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.1.tgz", - "integrity": "sha512-KWcq3xN8fDjSB+IMoh2VaXVhRI0BBGxoYp3rx7Pkb6z0cFjYR9Q9l4yZqqals0/zsioCmocC5H6UvsGD4MoIBA==", - "dev": true, - "peerDependencies": { - "ajv": "^6.9.1" - } - }, - "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", - "dev": true, - "optional": true, - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true - }, - "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/asn1.js": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", - "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", - "dev": true, - "dependencies": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "node_modules/asn1.js/node_modules/bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - }, - "node_modules/assert": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", - "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", - "dev": true, - "dependencies": { - "object-assign": "^4.1.1", - "util": "0.10.3" - } - }, - "node_modules/assert/node_modules/inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", - "dev": true - }, - "node_modules/assert/node_modules/util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", - "dev": true, - "dependencies": { - "inherits": "2.0.1" - } - }, - "node_modules/assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/astral-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/async-each": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", - "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", - "dev": true, - "optional": true - }, - "node_modules/atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true, - "bin": { - "atob": "bin/atob.js" - }, - "engines": { - "node": ">= 4.5.0" - } - }, - "node_modules/balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "node_modules/base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "dependencies": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/base/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/base/node_modules/is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/base/node_modules/is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/base/node_modules/is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/base64-js": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", - "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", - "dev": true - }, - "node_modules/big.js": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/binary-extensions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", - "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", - "dev": true, - "optional": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "dev": true, - "optional": true, - "dependencies": { - "file-uri-to-path": "1.0.0" - } - }, - "node_modules/bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true - }, - "node_modules/bn.js": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.2.tgz", - "integrity": "sha512-40rZaf3bUNKTVYu9sIeeEGOg7g14Yvnj9kH7b50EiwX0Q7A6umbvfI5tvHaOERH0XigqKkfLkFQxzb4e6CIXnA==", - "dev": true - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "dependencies": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/braces/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true - }, - "node_modules/browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dev": true, - "dependencies": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dev": true, - "dependencies": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "node_modules/browserify-des": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dev": true, - "dependencies": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/browserify-rsa": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", - "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", - "dev": true, - "dependencies": { - "bn.js": "^4.1.0", - "randombytes": "^2.0.1" - } - }, - "node_modules/browserify-rsa/node_modules/bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - }, - "node_modules/browserify-sign": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.0.tgz", - "integrity": "sha512-hEZC1KEeYuoHRqhGhTy6gWrpJA3ZDjFWv0DE61643ZnOXAKJb3u7yWcrU0mMc9SwAqK1n7myPGndkp0dFG7NFA==", - "dev": true, - "dependencies": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "elliptic": "^6.5.2", - "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - } - }, - "node_modules/browserify-sign/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/browserify-sign/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", - "dev": true, - "dependencies": { - "pako": "~1.0.5" - } - }, - "node_modules/buffer": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", - "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", - "dev": true, - "dependencies": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4", - "isarray": "^1.0.0" - } - }, - "node_modules/buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "node_modules/buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true - }, - "node_modules/builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", - "dev": true - }, - "node_modules/cacache": { - "version": "12.0.4", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", - "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", - "dev": true, - "dependencies": { - "bluebird": "^3.5.5", - "chownr": "^1.1.1", - "figgy-pudding": "^3.5.1", - "glob": "^7.1.4", - "graceful-fs": "^4.1.15", - "infer-owner": "^1.0.3", - "lru-cache": "^5.1.1", - "mississippi": "^3.0.0", - "mkdirp": "^0.5.1", - "move-concurrently": "^1.0.1", - "promise-inflight": "^1.0.1", - "rimraf": "^2.6.3", - "ssri": "^6.0.1", - "unique-filename": "^1.1.1", - "y18n": "^4.0.0" - } - }, - "node_modules/cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "dependencies": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/chalk/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/chokidar": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.1.tgz", - "integrity": "sha512-TQTJyr2stihpC4Sya9hs2Xh+O2wf+igjL36Y75xx2WdHuiICcn/XJza46Jwt0eT5hVpQOzo3FpY3cj3RVYLX0g==", - "dev": true, - "optional": true, - "dependencies": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.4.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "optionalDependencies": { - "fsevents": "~2.1.2" - } - }, - "node_modules/chokidar/node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "optional": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/chokidar/node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "optional": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/chokidar/node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/chokidar/node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "optional": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "dev": true - }, - "node_modules/chrome-trace-event": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz", - "integrity": "sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ==", - "dev": true, - "dependencies": { - "tslib": "^1.9.0" - }, - "engines": { - "node": ">=6.0" - } - }, - "node_modules/cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "dependencies": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/class-utils/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "dependencies": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "node_modules/collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "dependencies": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "node_modules/commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "node_modules/component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "node_modules/concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "engines": [ - "node >= 0.8" - ], - "dependencies": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, - "node_modules/console-browserify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", - "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", - "dev": true - }, - "node_modules/constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", - "dev": true - }, - "node_modules/copy-concurrently": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", - "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", - "dev": true, - "dependencies": { - "aproba": "^1.1.1", - "fs-write-stream-atomic": "^1.0.8", - "iferr": "^0.1.5", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.0" - } - }, - "node_modules/copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, - "node_modules/create-ecdh": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", - "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", - "dev": true, - "dependencies": { - "bn.js": "^4.1.0", - "elliptic": "^6.0.0" - } - }, - "node_modules/create-ecdh/node_modules/bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - }, - "node_modules/create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dev": true, - "dependencies": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "node_modules/create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, - "dependencies": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "node_modules/cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "dependencies": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, - "engines": { - "node": ">=4.8" - } - }, - "node_modules/cross-spawn/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, - "dependencies": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - }, - "engines": { - "node": "*" - } - }, - "node_modules/cyclist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", - "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", - "dev": true - }, - "node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true - }, - "node_modules/define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "dependencies": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/define-property/node_modules/is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/define-property/node_modules/is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/define-property/node_modules/is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/des.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", - "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "node_modules/detect-file": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/diffie-hellman": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "dev": true, - "dependencies": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - } - }, - "node_modules/diffie-hellman/node_modules/bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/domain-browser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", - "dev": true, - "engines": { - "node": ">=0.4", - "npm": ">=1.2" - } - }, - "node_modules/duplexify": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - } - }, - "node_modules/elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "dev": true, - "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/elliptic/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, - "node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "node_modules/emojis-list": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", - "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/enhanced-resolve": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.3.0.tgz", - "integrity": "sha512-3e87LvavsdxyoCfGusJnrZ5G8SLPOFeHSNpZI/ATL9a5leXo2k0w6MKnbqhdBad9qTobSfB20Ld7UmgoNbAZkQ==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "memory-fs": "^0.5.0", - "tapable": "^1.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/enhanced-resolve/node_modules/memory-fs": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", - "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", - "dev": true, - "dependencies": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" - }, - "engines": { - "node": ">=4.3.0 <5.0.0 || >=5.10" - } - }, - "node_modules/enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "dependencies": { - "ansi-colors": "^4.1.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/eol": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/eol/-/eol-0.9.1.tgz", - "integrity": "sha512-Ds/TEoZjwggRoz/Q2O7SE3i4Jm66mqTDfmdHdq/7DKVk3bro9Q8h6WdXKdPqFLMoqxrDK5SVRzHVPOS6uuGtrg==", - "dev": true - }, - "node_modules/errno": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", - "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", - "dev": true, - "dependencies": { - "prr": "~1.0.1" - }, - "bin": { - "errno": "cli.js" - } - }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/eslint": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.7.0.tgz", - "integrity": "sha512-1KUxLzos0ZVsyL81PnRN335nDtQ8/vZUD6uMtWbF+5zDtjKcsklIi78XoE0MVL93QvWTu+E5y44VyyCsOMBrIg==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "eslint-scope": "^5.1.0", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^1.3.0", - "espree": "^7.2.0", - "esquery": "^1.2.0", - "esutils": "^2.0.2", - "file-entry-cache": "^5.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash": "^4.17.19", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^5.2.3", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", - "dev": true, - "dependencies": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint/node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/eslint/node_modules/ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", - "dev": true, - "dependencies": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/eslint/node_modules/chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/eslint/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/eslint/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/eslint/node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/eslint/node_modules/debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", - "dev": true, - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/eslint/node_modules/eslint-scope": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz", - "integrity": "sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==", - "dev": true, - "dependencies": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/eslint/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/eslint/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/eslint/node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/eslint/node_modules/semver": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint/node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/eslint/node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/eslint/node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/eslint/node_modules/supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/eslint/node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/espree": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.2.0.tgz", - "integrity": "sha512-H+cQ3+3JYRMEIOl87e7QdHX70ocly5iW4+dttuR8iYSPr/hXKFb+7dBsZ7+u1adC4VrnPlTkv0+OwuPnDop19g==", - "dev": true, - "dependencies": { - "acorn": "^7.3.1", - "acorn-jsx": "^5.2.0", - "eslint-visitor-keys": "^1.3.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/espree/node_modules/acorn": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.0.tgz", - "integrity": "sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/esquery": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", - "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", - "dev": true, - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", - "dev": true, - "dependencies": { - "estraverse": "^4.1.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/events": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.1.0.tgz", - "integrity": "sha512-Rv+u8MLHNOdMjTAFeT3nCjHn2aGlx435FP/sDHNaRhDEMwyI/aB22Kj2qIN8R0cw3z28psEQLYwxVKLsKrMgWg==", - "dev": true, - "engines": { - "node": ">=0.8.x" - } - }, - "node_modules/evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "dependencies": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "dependencies": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/expand-brackets/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/expand-brackets/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", - "dev": true, - "dependencies": { - "homedir-polyfill": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "dependencies": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/extend-shallow/node_modules/is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "dependencies": { - "is-plain-object": "^2.0.4" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "dependencies": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/extglob/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/extglob/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/extglob/node_modules/is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/extglob/node_modules/is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/extglob/node_modules/is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "node_modules/figgy-pudding": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", - "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", - "dev": true - }, - "node_modules/file-entry-cache": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", - "dev": true, - "dependencies": { - "flat-cache": "^2.0.1" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "dev": true, - "optional": true - }, - "node_modules/fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "dependencies": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fill-range/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/find-cache-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", - "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", - "dev": true, - "dependencies": { - "commondir": "^1.0.1", - "make-dir": "^2.0.0", - "pkg-dir": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "dependencies": { - "locate-path": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/findup-sync": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", - "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", - "dev": true, - "dependencies": { - "detect-file": "^1.0.0", - "is-glob": "^4.0.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/flat-cache": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", - "dev": true, - "dependencies": { - "flatted": "^2.0.0", - "rimraf": "2.6.3", - "write": "1.0.3" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/flat-cache/node_modules/rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, - "node_modules/flatted": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", - "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", - "dev": true - }, - "node_modules/flush-write-stream": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", - "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "readable-stream": "^2.3.6" - } - }, - "node_modules/for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "dependencies": { - "map-cache": "^0.2.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - } - }, - "node_modules/fs-write-stream-atomic": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", - "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "iferr": "^0.1.5", - "imurmurhash": "^0.1.4", - "readable-stream": "1 || 2" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "node_modules/fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "deprecated": "\"Please update to latest v2.3 or v2.2\"", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/global-modules": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", - "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", - "dev": true, - "dependencies": { - "global-prefix": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/global-modules/node_modules/global-prefix": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", - "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", - "dev": true, - "dependencies": { - "ini": "^1.3.5", - "kind-of": "^6.0.2", - "which": "^1.3.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/global-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", - "dev": true, - "dependencies": { - "expand-tilde": "^2.0.2", - "homedir-polyfill": "^1.0.1", - "ini": "^1.3.4", - "is-windows": "^1.0.1", - "which": "^1.2.14" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", - "dev": true, - "dependencies": { - "type-fest": "^0.8.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true - }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "dependencies": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "dev": true, - "dependencies": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/has-values/node_modules/kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/hash-base/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/hash-base/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "node_modules/hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dev": true, - "dependencies": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/homedir-polyfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", - "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", - "dev": true, - "dependencies": { - "parse-passwd": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", - "dev": true - }, - "node_modules/ieee754": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", - "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", - "dev": true - }, - "node_modules/iferr": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", - "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", - "dev": true - }, - "node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", - "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", - "dev": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/import-fresh/node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/import-local": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", - "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", - "dev": true, - "dependencies": { - "pkg-dir": "^3.0.0", - "resolve-cwd": "^2.0.0" - }, - "bin": { - "import-local-fixture": "fixtures/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/indent-string": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", - "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/infer-owner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", - "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", - "dev": true - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true - }, - "node_modules/interpret": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "optional": true, - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-descriptor/node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-wsl": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", - "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "node_modules/isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "node_modules/js-yaml": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", - "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", - "dev": true, - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true - }, - "node_modules/json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dev": true, - "dependencies": { - "minimist": "^1.2.0" - }, - "bin": { - "json5": "lib/cli.js" - } - }, - "node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/loader-runner": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", - "integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==", - "dev": true, - "engines": { - "node": ">=4.3.0 <5.0.0 || >=5.10" - } - }, - "node_modules/loader-utils": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz", - "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", - "dev": true, - "dependencies": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^1.0.1" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "node_modules/lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "dependencies": { - "yallist": "^3.0.2" - } - }, - "node_modules/make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", - "dev": true, - "dependencies": { - "pify": "^4.0.1", - "semver": "^5.6.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/make-dir/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "dependencies": { - "object-visit": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dev": true, - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/memory-fs": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", - "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", - "dev": true, - "dependencies": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" - } - }, - "node_modules/micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, - "dependencies": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - }, - "bin": { - "miller-rabin": "bin/miller-rabin" - } - }, - "node_modules/miller-rabin/node_modules/bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - }, - "node_modules/minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "dev": true - }, - "node_modules/minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", - "dev": true - }, - "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - }, - "node_modules/mississippi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", - "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", - "dev": true, - "dependencies": { - "concat-stream": "^1.5.0", - "duplexify": "^3.4.2", - "end-of-stream": "^1.1.0", - "flush-write-stream": "^1.0.0", - "from2": "^2.1.0", - "parallel-transform": "^1.1.0", - "pump": "^3.0.0", - "pumpify": "^1.3.3", - "stream-each": "^1.1.0", - "through2": "^2.0.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "dev": true, - "dependencies": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/mixin-deep/node_modules/is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "dependencies": { - "is-plain-object": "^2.0.4" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/move-concurrently": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", - "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", - "dev": true, - "dependencies": { - "aproba": "^1.1.1", - "copy-concurrently": "^1.0.0", - "fs-write-stream-atomic": "^1.0.8", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.3" - } - }, - "node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "node_modules/nan": { - "version": "2.14.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", - "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==", - "dev": true, - "optional": true - }, - "node_modules/nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "node_modules/neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true - }, - "node_modules/nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, - "node_modules/node-libs-browser": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", - "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", - "dev": true, - "dependencies": { - "assert": "^1.1.1", - "browserify-zlib": "^0.2.0", - "buffer": "^4.3.0", - "console-browserify": "^1.1.0", - "constants-browserify": "^1.0.0", - "crypto-browserify": "^3.11.0", - "domain-browser": "^1.1.1", - "events": "^3.0.0", - "https-browserify": "^1.0.0", - "os-browserify": "^0.3.0", - "path-browserify": "0.0.1", - "process": "^0.11.10", - "punycode": "^1.2.4", - "querystring-es3": "^0.2.0", - "readable-stream": "^2.3.3", - "stream-browserify": "^2.0.1", - "stream-http": "^2.7.2", - "string_decoder": "^1.0.0", - "timers-browserify": "^2.0.4", - "tty-browserify": "0.0.0", - "url": "^0.11.0", - "util": "^0.11.0", - "vm-browserify": "^1.0.1" - } - }, - "node_modules/node-libs-browser/node_modules/punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "dependencies": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "dependencies": { - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", - "dev": true - }, - "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "dependencies": { - "p-limit": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true - }, - "node_modules/parallel-transform": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", - "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", - "dev": true, - "dependencies": { - "cyclist": "^1.0.1", - "inherits": "^2.0.3", - "readable-stream": "^2.1.5" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/parse-asn1": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.5.tgz", - "integrity": "sha512-jkMYn1dcJqF6d5CpU689bq7w/b5ALS9ROVSpQDPrZsqqesUJii9qutvoT5ltGedNXMO2e16YUWIghG9KxaViTQ==", - "dev": true, - "dependencies": { - "asn1.js": "^4.0.0", - "browserify-aes": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", - "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", - "dev": true - }, - "node_modules/path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "dev": true, - "optional": true - }, - "node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/pbkdf2": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", - "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", - "dev": true, - "dependencies": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", - "dev": true, - "optional": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", - "dev": true, - "dependencies": { - "find-up": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "dev": true, - "engines": { - "node": ">= 0.6.0" - } - }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true - }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", - "dev": true - }, - "node_modules/prr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", - "dev": true - }, - "node_modules/public-encrypt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "dev": true, - "dependencies": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/public-encrypt/node_modules/bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - }, - "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/pumpify": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", - "dev": true, - "dependencies": { - "duplexify": "^3.6.0", - "inherits": "^2.0.3", - "pump": "^2.0.0" - } - }, - "node_modules/pumpify/node_modules/pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", - "dev": true, - "engines": { - "node": ">=0.4.x" - } - }, - "node_modules/querystring-es3": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", - "dev": true, - "engines": { - "node": ">=0.4.x" - } - }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, - "node_modules/randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, - "dependencies": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, - "node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/readdirp": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz", - "integrity": "sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==", - "dev": true, - "optional": true, - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, - "node_modules/regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "dependencies": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true, - "optional": true - }, - "node_modules/repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, - "node_modules/resolve-cwd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", - "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", - "dev": true, - "dependencies": { - "resolve-from": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/resolve-dir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", - "dev": true, - "dependencies": { - "expand-tilde": "^2.0.0", - "global-modules": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/resolve-dir/node_modules/global-modules": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", - "dev": true, - "dependencies": { - "global-prefix": "^1.0.1", - "is-windows": "^1.0.1", - "resolve-dir": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "deprecated": "https://github.com/lydell/resolve-url#deprecated", - "dev": true - }, - "node_modules/ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, - "node_modules/ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dev": true, - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "node_modules/run-queue": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", - "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", - "dev": true, - "dependencies": { - "aproba": "^1.1.1" - } - }, - "node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "dependencies": { - "ret": "~0.1.10" - } - }, - "node_modules/schema-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", - "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", - "dev": true, - "dependencies": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" - }, - "engines": { - "node": ">= 4" - } - }, - "node_modules/semver": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/serialize-javascript": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.1.0.tgz", - "integrity": "sha512-JIJT1DGiWmIKhzRsG91aS6Ze4sFUrYbltlkg2onR5OrnNM02Kl/hnY/T4FN2omvyeBbQmMJv+K4cPOpGzOTFBg==", - "dev": true, - "dependencies": { - "randombytes": "^2.1.0" - } - }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "node_modules/set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "dev": true, - "dependencies": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/set-value/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", - "dev": true - }, - "node_modules/sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - }, - "bin": { - "sha.js": "bin.js" - } - }, - "node_modules/shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "dependencies": { - "shebang-regex": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/slice-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.0", - "astral-regex": "^1.0.0", - "is-fullwidth-code-point": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "dependencies": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "dependencies": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-node/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-node/node_modules/is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-node/node_modules/is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-node/node_modules/is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "dependencies": { - "kind-of": "^3.2.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-util/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-list-map": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", - "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", - "dev": true - }, - "node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-resolve": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", - "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", - "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated", - "dev": true, - "dependencies": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "node_modules/source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/source-map-support/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", - "deprecated": "See https://github.com/lydell/source-map-url#deprecated", - "dev": true - }, - "node_modules/split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "dependencies": { - "extend-shallow": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "node_modules/ssri": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.2.tgz", - "integrity": "sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q==", - "dev": true, - "dependencies": { - "figgy-pudding": "^3.5.1" - } - }, - "node_modules/static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "dependencies": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/stream-browserify": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", - "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", - "dev": true, - "dependencies": { - "inherits": "~2.0.1", - "readable-stream": "^2.0.2" - } - }, - "node_modules/stream-each": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", - "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "stream-shift": "^1.0.0" - } - }, - "node_modules/stream-http": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", - "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", - "dev": true, - "dependencies": { - "builtin-status-codes": "^3.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.3.6", - "to-arraybuffer": "^1.0.0", - "xtend": "^4.0.0" - } - }, - "node_modules/stream-shift": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", - "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", - "dev": true - }, - "node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "dependencies": { - "ansi-regex": "^4.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/table": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", - "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", - "dev": true, - "dependencies": { - "ajv": "^6.10.2", - "lodash": "^4.17.14", - "slice-ansi": "^2.1.0", - "string-width": "^3.0.0" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/tapable": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", - "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/terser": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", - "integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==", - "dev": true, - "dependencies": { - "commander": "^2.20.0", - "source-map": "~0.6.1", - "source-map-support": "~0.5.12" - }, - "bin": { - "terser": "bin/terser" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/terser-webpack-plugin": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.4.tgz", - "integrity": "sha512-U4mACBHIegmfoEe5fdongHESNJWqsGU+W0S/9+BmYGVQDw1+c2Ow05TpMhxjPK1sRb7cuYq1BPl1e5YHJMTCqA==", - "dev": true, - "dependencies": { - "cacache": "^12.0.2", - "find-cache-dir": "^2.1.0", - "is-wsl": "^1.1.0", - "schema-utils": "^1.0.0", - "serialize-javascript": "^3.1.0", - "source-map": "^0.6.1", - "terser": "^4.1.2", - "webpack-sources": "^1.4.0", - "worker-farm": "^1.7.0" - }, - "engines": { - "node": ">= 6.9.0" - }, - "peerDependencies": { - "webpack": "^4.0.0" - } - }, - "node_modules/terser-webpack-plugin/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/terser/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, - "node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/timers-browserify": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.11.tgz", - "integrity": "sha512-60aV6sgJ5YEbzUdn9c8kYGIqOubPoUdqQCul3SBAsRCZ40s6Y5cMcrW4dt3/k/EsbLVJNl9n6Vz3fTc+k2GeKQ==", - "dev": true, - "dependencies": { - "setimmediate": "^1.0.4" - }, - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/to-arraybuffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", - "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", - "dev": true - }, - "node_modules/to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/to-object-path/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "dependencies": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "dependencies": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/tslib": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", - "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", - "dev": true - }, - "node_modules/tty-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", - "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", - "dev": true - }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true - }, - "node_modules/union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "dev": true, - "dependencies": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "dev": true, - "dependencies": { - "unique-slug": "^2.0.0" - } - }, - "node_modules/unique-slug": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", - "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4" - } - }, - "node_modules/unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "dependencies": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unset-value/node_modules/has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "dependencies": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unset-value/node_modules/has-value/node_modules/isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "dependencies": { - "isarray": "1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unset-value/node_modules/has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/upath": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", - "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", - "dev": true, - "optional": true, - "engines": { - "node": ">=4", - "yarn": "*" - } - }, - "node_modules/uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "deprecated": "Please see https://github.com/lydell/urix#deprecated", - "dev": true - }, - "node_modules/url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "dev": true, - "dependencies": { - "punycode": "1.3.2", - "querystring": "0.2.0" - } - }, - "node_modules/url/node_modules/punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - }, - "node_modules/use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/util": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", - "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", - "dev": true, - "dependencies": { - "inherits": "2.0.3" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "node_modules/util/node_modules/inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "node_modules/v8-compile-cache": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", - "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", - "dev": true - }, - "node_modules/vm-browserify": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", - "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", - "dev": true - }, - "node_modules/watchpack": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.2.tgz", - "integrity": "sha512-ymVbbQP40MFTp+cNMvpyBpBtygHnPzPkHqoIwRRj/0B8KhqQwV8LaKjtbaxF2lK4vl8zN9wCxS46IFCU5K4W0g==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "neo-async": "^2.5.0" - }, - "optionalDependencies": { - "chokidar": "^3.4.0", - "watchpack-chokidar2": "^2.0.0" - } - }, - "node_modules/watchpack-chokidar2": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/watchpack-chokidar2/-/watchpack-chokidar2-2.0.0.tgz", - "integrity": "sha512-9TyfOyN/zLUbA288wZ8IsMZ+6cbzvsNyEzSBp6e/zkifi6xxbl8SmQ/CxQq32k8NNqrdVEVUVSEf56L4rQ/ZxA==", - "dev": true, - "optional": true, - "dependencies": { - "chokidar": "^2.1.8" - }, - "engines": { - "node": "<8.10.0" - } - }, - "node_modules/watchpack-chokidar2/node_modules/anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "optional": true, - "dependencies": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - } - }, - "node_modules/watchpack-chokidar2/node_modules/anymatch/node_modules/normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "optional": true, - "dependencies": { - "remove-trailing-separator": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/watchpack-chokidar2/node_modules/binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/watchpack-chokidar2/node_modules/chokidar": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", - "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", - "deprecated": "Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies", - "dev": true, - "optional": true, - "dependencies": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - }, - "optionalDependencies": { - "fsevents": "^1.2.7" - } - }, - "node_modules/watchpack-chokidar2/node_modules/fsevents": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", - "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "deprecated": "The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "dependencies": { - "bindings": "^1.5.0", - "nan": "^2.12.1" - }, - "engines": { - "node": ">= 4.0" - } - }, - "node_modules/watchpack-chokidar2/node_modules/glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "optional": true, - "dependencies": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - } - }, - "node_modules/watchpack-chokidar2/node_modules/glob-parent/node_modules/is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "optional": true, - "dependencies": { - "is-extglob": "^2.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/watchpack-chokidar2/node_modules/is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "optional": true, - "dependencies": { - "binary-extensions": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/watchpack-chokidar2/node_modules/readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "dev": true, - "optional": true, - "dependencies": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/webpack": { - "version": "4.43.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.43.0.tgz", - "integrity": "sha512-GW1LjnPipFW2Y78OOab8NJlCflB7EFskMih2AHdvjbpKMeDJqEgSx24cXXXiPS65+WSwVyxtDsJH6jGX2czy+g==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-module-context": "1.9.0", - "@webassemblyjs/wasm-edit": "1.9.0", - "@webassemblyjs/wasm-parser": "1.9.0", - "acorn": "^6.4.1", - "ajv": "^6.10.2", - "ajv-keywords": "^3.4.1", - "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^4.1.0", - "eslint-scope": "^4.0.3", - "json-parse-better-errors": "^1.0.2", - "loader-runner": "^2.4.0", - "loader-utils": "^1.2.3", - "memory-fs": "^0.4.1", - "micromatch": "^3.1.10", - "mkdirp": "^0.5.3", - "neo-async": "^2.6.1", - "node-libs-browser": "^2.2.1", - "schema-utils": "^1.0.0", - "tapable": "^1.1.3", - "terser-webpack-plugin": "^1.4.3", - "watchpack": "^1.6.1", - "webpack-sources": "^1.4.1" - }, - "bin": { - "webpack": "bin/webpack.js" - }, - "engines": { - "node": ">=6.11.5" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/webpack-cli": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.12.tgz", - "integrity": "sha512-NVWBaz9k839ZH/sinurM+HcDvJOTXwSjYp1ku+5XKeOC03z8v5QitnK/x+lAxGXFyhdayoIf/GOpv85z3/xPag==", - "dev": true, - "dependencies": { - "chalk": "^2.4.2", - "cross-spawn": "^6.0.5", - "enhanced-resolve": "^4.1.1", - "findup-sync": "^3.0.0", - "global-modules": "^2.0.0", - "import-local": "^2.0.0", - "interpret": "^1.4.0", - "loader-utils": "^1.4.0", - "supports-color": "^6.1.0", - "v8-compile-cache": "^2.1.1", - "yargs": "^13.3.2" - }, - "bin": { - "webpack-cli": "bin/cli.js" - }, - "engines": { - "node": ">=6.11.5" - }, - "peerDependencies": { - "webpack": "4.x.x" - } - }, - "node_modules/webpack-sources": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", - "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", - "dev": true, - "dependencies": { - "source-list-map": "^2.0.0", - "source-map": "~0.6.1" - } - }, - "node_modules/webpack-sources/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, - "node_modules/which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/worker-farm": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz", - "integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==", - "dev": true, - "dependencies": { - "errno": "~0.1.7" - } - }, - "node_modules/wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "node_modules/write": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", - "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", - "dev": true, - "dependencies": { - "mkdirp": "^0.5.1" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true, - "engines": { - "node": ">=0.4" - } - }, - "node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true - }, - "node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - }, - "node_modules/yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", - "dev": true, - "dependencies": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - } - }, - "node_modules/yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", - "dev": true, - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", - "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", - "dev": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", - "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", - "dev": true - }, - "@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.10.4", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "@types/color-name": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", - "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", - "dev": true - }, - "@webassemblyjs/ast": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz", - "integrity": "sha512-C6wW5L+b7ogSDVqymbkkvuW9kruN//YisMED04xzeBBqjHa2FYnmvOlS6Xj68xWQRgWvI9cIglsjFowH/RJyEA==", - "dev": true, - "requires": { - "@webassemblyjs/helper-module-context": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/wast-parser": "1.9.0" - } - }, - "@webassemblyjs/floating-point-hex-parser": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.9.0.tgz", - "integrity": "sha512-TG5qcFsS8QB4g4MhrxK5TqfdNe7Ey/7YL/xN+36rRjl/BlGE/NcBvJcqsRgCP6Z92mRE+7N50pRIi8SmKUbcQA==", - "dev": true - }, - "@webassemblyjs/helper-api-error": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.9.0.tgz", - "integrity": "sha512-NcMLjoFMXpsASZFxJ5h2HZRcEhDkvnNFOAKneP5RbKRzaWJN36NC4jqQHKwStIhGXu5mUWlUUk7ygdtrO8lbmw==", - "dev": true - }, - "@webassemblyjs/helper-buffer": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.9.0.tgz", - "integrity": "sha512-qZol43oqhq6yBPx7YM3m9Bv7WMV9Eevj6kMi6InKOuZxhw+q9hOkvq5e/PpKSiLfyetpaBnogSbNCfBwyB00CA==", - "dev": true - }, - "@webassemblyjs/helper-code-frame": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.9.0.tgz", - "integrity": "sha512-ERCYdJBkD9Vu4vtjUYe8LZruWuNIToYq/ME22igL+2vj2dQ2OOujIZr3MEFvfEaqKoVqpsFKAGsRdBSBjrIvZA==", - "dev": true, - "requires": { - "@webassemblyjs/wast-printer": "1.9.0" - } - }, - "@webassemblyjs/helper-fsm": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.9.0.tgz", - "integrity": "sha512-OPRowhGbshCb5PxJ8LocpdX9Kl0uB4XsAjl6jH/dWKlk/mzsANvhwbiULsaiqT5GZGT9qinTICdj6PLuM5gslw==", - "dev": true - }, - "@webassemblyjs/helper-module-context": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.9.0.tgz", - "integrity": "sha512-MJCW8iGC08tMk2enck1aPW+BE5Cw8/7ph/VGZxwyvGbJwjktKkDK7vy7gAmMDx88D7mhDTCNKAW5tED+gZ0W8g==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0" - } - }, - "@webassemblyjs/helper-wasm-bytecode": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.9.0.tgz", - "integrity": "sha512-R7FStIzyNcd7xKxCZH5lE0Bqy+hGTwS3LJjuv1ZVxd9O7eHCedSdrId/hMOd20I+v8wDXEn+bjfKDLzTepoaUw==", - "dev": true - }, - "@webassemblyjs/helper-wasm-section": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.9.0.tgz", - "integrity": "sha512-XnMB8l3ek4tvrKUUku+IVaXNHz2YsJyOOmz+MMkZvh8h1uSJpSen6vYnw3IoQ7WwEuAhL8Efjms1ZWjqh2agvw==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-buffer": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/wasm-gen": "1.9.0" - } - }, - "@webassemblyjs/ieee754": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.9.0.tgz", - "integrity": "sha512-dcX8JuYU/gvymzIHc9DgxTzUUTLexWwt8uCTWP3otys596io0L5aW02Gb1RjYpx2+0Jus1h4ZFqjla7umFniTg==", - "dev": true, - "requires": { - "@xtuc/ieee754": "^1.2.0" - } - }, - "@webassemblyjs/leb128": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.9.0.tgz", - "integrity": "sha512-ENVzM5VwV1ojs9jam6vPys97B/S65YQtv/aanqnU7D8aSoHFX8GyhGg0CMfyKNIHBuAVjy3tlzd5QMMINa7wpw==", - "dev": true, - "requires": { - "@xtuc/long": "4.2.2" - } - }, - "@webassemblyjs/utf8": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.9.0.tgz", - "integrity": "sha512-GZbQlWtopBTP0u7cHrEx+73yZKrQoBMpwkGEIqlacljhXCkVM1kMQge/Mf+csMJAjEdSwhOyLAS0AoR3AG5P8w==", - "dev": true - }, - "@webassemblyjs/wasm-edit": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.9.0.tgz", - "integrity": "sha512-FgHzBm80uwz5M8WKnMTn6j/sVbqilPdQXTWraSjBwFXSYGirpkSWE2R9Qvz9tNiTKQvoKILpCuTjBKzOIm0nxw==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-buffer": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/helper-wasm-section": "1.9.0", - "@webassemblyjs/wasm-gen": "1.9.0", - "@webassemblyjs/wasm-opt": "1.9.0", - "@webassemblyjs/wasm-parser": "1.9.0", - "@webassemblyjs/wast-printer": "1.9.0" - } - }, - "@webassemblyjs/wasm-gen": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.9.0.tgz", - "integrity": "sha512-cPE3o44YzOOHvlsb4+E9qSqjc9Qf9Na1OO/BHFy4OI91XDE14MjFN4lTMezzaIWdPqHnsTodGGNP+iRSYfGkjA==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/ieee754": "1.9.0", - "@webassemblyjs/leb128": "1.9.0", - "@webassemblyjs/utf8": "1.9.0" - } - }, - "@webassemblyjs/wasm-opt": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.9.0.tgz", - "integrity": "sha512-Qkjgm6Anhm+OMbIL0iokO7meajkzQD71ioelnfPEj6r4eOFuqm4YC3VBPqXjFyyNwowzbMD+hizmprP/Fwkl2A==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-buffer": "1.9.0", - "@webassemblyjs/wasm-gen": "1.9.0", - "@webassemblyjs/wasm-parser": "1.9.0" - } - }, - "@webassemblyjs/wasm-parser": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.9.0.tgz", - "integrity": "sha512-9+wkMowR2AmdSWQzsPEjFU7njh8HTO5MqO8vjwEHuM+AMHioNqSBONRdr0NQQ3dVQrzp0s8lTcYqzUdb7YgELA==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-api-error": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/ieee754": "1.9.0", - "@webassemblyjs/leb128": "1.9.0", - "@webassemblyjs/utf8": "1.9.0" - } - }, - "@webassemblyjs/wast-parser": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.9.0.tgz", - "integrity": "sha512-qsqSAP3QQ3LyZjNC/0jBJ/ToSxfYJ8kYyuiGvtn/8MK89VrNEfwj7BPQzJVHi0jGTRK2dGdJ5PRqhtjzoww+bw==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/floating-point-hex-parser": "1.9.0", - "@webassemblyjs/helper-api-error": "1.9.0", - "@webassemblyjs/helper-code-frame": "1.9.0", - "@webassemblyjs/helper-fsm": "1.9.0", - "@xtuc/long": "4.2.2" - } - }, - "@webassemblyjs/wast-printer": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.9.0.tgz", - "integrity": "sha512-2J0nE95rHXHyQ24cWjMKJ1tqB/ds8z/cyeOZxJhcb+rW+SQASVjuznUSmdz5GpVJTzU8JkhYut0D3siFDD6wsA==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/wast-parser": "1.9.0", - "@xtuc/long": "4.2.2" - } - }, - "@xtuc/ieee754": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", - "dev": true - }, - "@xtuc/long": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", - "dev": true - }, - "acorn": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", - "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", - "dev": true - }, - "acorn-jsx": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", - "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", - "dev": true, - "requires": {} - }, - "ajv": { - "version": "6.12.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.3.tgz", - "integrity": "sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ajv-errors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", - "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", - "dev": true, - "requires": {} - }, - "ajv-keywords": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.1.tgz", - "integrity": "sha512-KWcq3xN8fDjSB+IMoh2VaXVhRI0BBGxoYp3rx7Pkb6z0cFjYR9Q9l4yZqqals0/zsioCmocC5H6UvsGD4MoIBA==", - "dev": true, - "requires": {} - }, - "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true - }, - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", - "dev": true, - "optional": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "asn1.js": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", - "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - }, - "dependencies": { - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - } - } - }, - "assert": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", - "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", - "dev": true, - "requires": { - "object-assign": "^4.1.1", - "util": "0.10.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", - "dev": true - }, - "util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", - "dev": true, - "requires": { - "inherits": "2.0.1" - } - } - } - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true - }, - "astral-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", - "dev": true - }, - "async-each": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", - "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", - "dev": true, - "optional": true - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "base64-js": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", - "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", - "dev": true - }, - "big.js": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", - "dev": true - }, - "binary-extensions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", - "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", - "dev": true, - "optional": true - }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "dev": true, - "optional": true, - "requires": { - "file-uri-to-path": "1.0.0" - } - }, - "bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true - }, - "bn.js": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.2.tgz", - "integrity": "sha512-40rZaf3bUNKTVYu9sIeeEGOg7g14Yvnj9kH7b50EiwX0Q7A6umbvfI5tvHaOERH0XigqKkfLkFQxzb4e6CIXnA==", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true - }, - "browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dev": true, - "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dev": true, - "requires": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "browserify-des": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "browserify-rsa": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", - "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "randombytes": "^2.0.1" - }, - "dependencies": { - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - } - } - }, - "browserify-sign": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.0.tgz", - "integrity": "sha512-hEZC1KEeYuoHRqhGhTy6gWrpJA3ZDjFWv0DE61643ZnOXAKJb3u7yWcrU0mMc9SwAqK1n7myPGndkp0dFG7NFA==", - "dev": true, - "requires": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "elliptic": "^6.5.2", - "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - } - } - }, - "browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", - "dev": true, - "requires": { - "pako": "~1.0.5" - } - }, - "buffer": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", - "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", - "dev": true, - "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4", - "isarray": "^1.0.0" - } - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true - }, - "builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", - "dev": true - }, - "cacache": { - "version": "12.0.4", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", - "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", - "dev": true, - "requires": { - "bluebird": "^3.5.5", - "chownr": "^1.1.1", - "figgy-pudding": "^3.5.1", - "glob": "^7.1.4", - "graceful-fs": "^4.1.15", - "infer-owner": "^1.0.3", - "lru-cache": "^5.1.1", - "mississippi": "^3.0.0", - "mkdirp": "^0.5.1", - "move-concurrently": "^1.0.1", - "promise-inflight": "^1.0.1", - "rimraf": "^2.6.3", - "ssri": "^6.0.1", - "unique-filename": "^1.1.1", - "y18n": "^4.0.0" - } - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - } - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "dependencies": { - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "chokidar": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.1.tgz", - "integrity": "sha512-TQTJyr2stihpC4Sya9hs2Xh+O2wf+igjL36Y75xx2WdHuiICcn/XJza46Jwt0eT5hVpQOzo3FpY3cj3RVYLX0g==", - "dev": true, - "optional": true, - "requires": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "fsevents": "~2.1.2", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.4.0" - }, - "dependencies": { - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "optional": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "optional": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "optional": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "optional": true, - "requires": { - "is-number": "^7.0.0" - } - } - } - }, - "chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "dev": true - }, - "chrome-trace-event": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz", - "integrity": "sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ==", - "dev": true, - "requires": { - "tslib": "^1.9.0" - } - }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, - "console-browserify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", - "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", - "dev": true - }, - "constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", - "dev": true - }, - "copy-concurrently": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", - "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", - "dev": true, - "requires": { - "aproba": "^1.1.1", - "fs-write-stream-atomic": "^1.0.8", - "iferr": "^0.1.5", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.0" - } - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, - "create-ecdh": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", - "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "elliptic": "^6.0.0" - }, - "dependencies": { - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - } - } - }, - "create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, - "requires": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - } - }, - "cyclist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", - "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", - "dev": true - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true - }, - "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "des.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", - "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "detect-file": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", - "dev": true - }, - "diffie-hellman": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - }, - "dependencies": { - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - } - } - }, - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "domain-browser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", - "dev": true - }, - "duplexify": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", - "dev": true, - "requires": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - } - }, - "elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "dev": true, - "requires": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - } - } - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "emojis-list": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", - "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", - "dev": true - }, - "end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, - "requires": { - "once": "^1.4.0" - } - }, - "enhanced-resolve": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.3.0.tgz", - "integrity": "sha512-3e87LvavsdxyoCfGusJnrZ5G8SLPOFeHSNpZI/ATL9a5leXo2k0w6MKnbqhdBad9qTobSfB20Ld7UmgoNbAZkQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "memory-fs": "^0.5.0", - "tapable": "^1.0.0" - }, - "dependencies": { - "memory-fs": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", - "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", - "dev": true, - "requires": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" - } - } - } - }, - "enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "requires": { - "ansi-colors": "^4.1.1" - } - }, - "eol": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/eol/-/eol-0.9.1.tgz", - "integrity": "sha512-Ds/TEoZjwggRoz/Q2O7SE3i4Jm66mqTDfmdHdq/7DKVk3bro9Q8h6WdXKdPqFLMoqxrDK5SVRzHVPOS6uuGtrg==", - "dev": true - }, - "errno": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", - "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", - "dev": true, - "requires": { - "prr": "~1.0.1" - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "eslint": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.7.0.tgz", - "integrity": "sha512-1KUxLzos0ZVsyL81PnRN335nDtQ8/vZUD6uMtWbF+5zDtjKcsklIi78XoE0MVL93QvWTu+E5y44VyyCsOMBrIg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "eslint-scope": "^5.1.0", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^1.3.0", - "espree": "^7.2.0", - "esquery": "^1.2.0", - "esutils": "^2.0.2", - "file-entry-cache": "^5.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash": "^4.17.19", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^5.2.3", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", - "dev": true, - "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "eslint-scope": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz", - "integrity": "sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==", - "dev": true, - "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "semver": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", - "dev": true - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", - "dev": true, - "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - }, - "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^1.1.0" - } - }, - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - }, - "espree": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.2.0.tgz", - "integrity": "sha512-H+cQ3+3JYRMEIOl87e7QdHX70ocly5iW4+dttuR8iYSPr/hXKFb+7dBsZ7+u1adC4VrnPlTkv0+OwuPnDop19g==", - "dev": true, - "requires": { - "acorn": "^7.3.1", - "acorn-jsx": "^5.2.0", - "eslint-visitor-keys": "^1.3.0" - }, - "dependencies": { - "acorn": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.0.tgz", - "integrity": "sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==", - "dev": true - } - } - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "esquery": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", - "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", - "dev": true, - "requires": { - "estraverse": "^5.1.0" - }, - "dependencies": { - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true - } - } - }, - "esrecurse": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", - "dev": true, - "requires": { - "estraverse": "^4.1.0" - } - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true - }, - "events": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.1.0.tgz", - "integrity": "sha512-Rv+u8MLHNOdMjTAFeT3nCjHn2aGlx435FP/sDHNaRhDEMwyI/aB22Kj2qIN8R0cw3z28psEQLYwxVKLsKrMgWg==", - "dev": true - }, - "evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", - "dev": true, - "requires": { - "homedir-polyfill": "^1.0.1" - } - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "figgy-pudding": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", - "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", - "dev": true - }, - "file-entry-cache": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", - "dev": true, - "requires": { - "flat-cache": "^2.0.1" - } - }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "dev": true, - "optional": true - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "find-cache-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", - "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^2.0.0", - "pkg-dir": "^3.0.0" - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "findup-sync": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", - "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", - "dev": true, - "requires": { - "detect-file": "^1.0.0", - "is-glob": "^4.0.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - } - }, - "flat-cache": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", - "dev": true, - "requires": { - "flatted": "^2.0.0", - "rimraf": "2.6.3", - "write": "1.0.3" - }, - "dependencies": { - "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } - } - }, - "flatted": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", - "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", - "dev": true - }, - "flush-write-stream": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", - "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "readable-stream": "^2.3.6" - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, - "from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - } - }, - "fs-write-stream-atomic": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", - "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "iferr": "^0.1.5", - "imurmurhash": "^0.1.4", - "readable-stream": "1 || 2" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "dev": true, - "optional": true - }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "global-modules": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", - "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", - "dev": true, - "requires": { - "global-prefix": "^3.0.0" - }, - "dependencies": { - "global-prefix": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", - "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", - "dev": true, - "requires": { - "ini": "^1.3.5", - "kind-of": "^6.0.2", - "which": "^1.3.1" - } - } - } - }, - "global-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.2", - "homedir-polyfill": "^1.0.1", - "ini": "^1.3.4", - "is-windows": "^1.0.1", - "which": "^1.2.14" - } - }, - "globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", - "dev": true, - "requires": { - "type-fest": "^0.8.1" - } - }, - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "dev": true, - "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - } - } - }, - "hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dev": true, - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "homedir-polyfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", - "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", - "dev": true, - "requires": { - "parse-passwd": "^1.0.0" - } - }, - "https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", - "dev": true - }, - "ieee754": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", - "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", - "dev": true - }, - "iferr": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", - "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", - "dev": true - }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true - }, - "import-fresh": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", - "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", - "dev": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "dependencies": { - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - } - } - }, - "import-local": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", - "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", - "dev": true, - "requires": { - "pkg-dir": "^3.0.0", - "resolve-cwd": "^2.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true - }, - "indent-string": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", - "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==" - }, - "infer-owner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", - "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true - }, - "interpret": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", - "dev": true - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "optional": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "is-wsl": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", - "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "js-yaml": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", - "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true - }, - "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - } - }, - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true - }, - "levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "requires": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - } - }, - "loader-runner": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", - "integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==", - "dev": true - }, - "loader-utils": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz", - "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", - "dev": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^1.0.1" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, - "make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", - "dev": true, - "requires": { - "pify": "^4.0.1", - "semver": "^5.6.0" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "requires": { - "object-visit": "^1.0.0" - } - }, - "md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "memory-fs": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", - "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", - "dev": true, - "requires": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" - } - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - }, - "dependencies": { - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - } - } - }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "dev": true - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - }, - "mississippi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", - "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", - "dev": true, - "requires": { - "concat-stream": "^1.5.0", - "duplexify": "^3.4.2", - "end-of-stream": "^1.1.0", - "flush-write-stream": "^1.0.0", - "from2": "^2.1.0", - "parallel-transform": "^1.1.0", - "pump": "^3.0.0", - "pumpify": "^1.3.3", - "stream-each": "^1.1.0", - "through2": "^2.0.0" - } - }, - "mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "dev": true, - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "move-concurrently": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", - "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", - "dev": true, - "requires": { - "aproba": "^1.1.1", - "copy-concurrently": "^1.0.0", - "fs-write-stream-atomic": "^1.0.8", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.3" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "nan": { - "version": "2.14.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", - "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==", - "dev": true, - "optional": true - }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - } - }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true - }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, - "node-libs-browser": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", - "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", - "dev": true, - "requires": { - "assert": "^1.1.1", - "browserify-zlib": "^0.2.0", - "buffer": "^4.3.0", - "console-browserify": "^1.1.0", - "constants-browserify": "^1.0.0", - "crypto-browserify": "^3.11.0", - "domain-browser": "^1.1.1", - "events": "^3.0.0", - "https-browserify": "^1.0.0", - "os-browserify": "^0.3.0", - "path-browserify": "0.0.1", - "process": "^0.11.10", - "punycode": "^1.2.4", - "querystring-es3": "^0.2.0", - "readable-stream": "^2.3.3", - "stream-browserify": "^2.0.1", - "stream-http": "^2.7.2", - "string_decoder": "^1.0.0", - "timers-browserify": "^2.0.4", - "tty-browserify": "0.0.0", - "url": "^0.11.0", - "util": "^0.11.0", - "vm-browserify": "^1.0.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - } - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "requires": { - "isobject": "^3.0.0" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "requires": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - } - }, - "os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", - "dev": true - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true - }, - "parallel-transform": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", - "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", - "dev": true, - "requires": { - "cyclist": "^1.0.1", - "inherits": "^2.0.3", - "readable-stream": "^2.1.5" - } - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "requires": { - "callsites": "^3.0.0" - } - }, - "parse-asn1": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.5.tgz", - "integrity": "sha512-jkMYn1dcJqF6d5CpU689bq7w/b5ALS9ROVSpQDPrZsqqesUJii9qutvoT5ltGedNXMO2e16YUWIghG9KxaViTQ==", - "dev": true, - "requires": { - "asn1.js": "^4.0.0", - "browserify-aes": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" - } - }, - "parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true - }, - "path-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", - "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", - "dev": true - }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "dev": true, - "optional": true - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "pbkdf2": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", - "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", - "dev": true, - "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", - "dev": true, - "optional": true - }, - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true - }, - "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", - "dev": true, - "requires": { - "find-up": "^3.0.0" - } - }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true - }, - "prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true - }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true - }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true - }, - "promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", - "dev": true - }, - "prr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", - "dev": true - }, - "public-encrypt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - }, - "dependencies": { - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - } - } - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "pumpify": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", - "dev": true, - "requires": { - "duplexify": "^3.6.0", - "inherits": "^2.0.3", - "pump": "^2.0.0" - }, - "dependencies": { - "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - } - } - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - }, - "querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "dev": true - }, - "querystring-es3": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", - "dev": true - }, - "randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, - "requires": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "readdirp": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz", - "integrity": "sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==", - "dev": true, - "optional": true, - "requires": { - "picomatch": "^2.2.1" - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", - "dev": true - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true, - "optional": true - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, - "resolve-cwd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", - "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", - "dev": true, - "requires": { - "resolve-from": "^3.0.0" - } - }, - "resolve-dir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.0", - "global-modules": "^1.0.0" - }, - "dependencies": { - "global-modules": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", - "dev": true, - "requires": { - "global-prefix": "^1.0.1", - "is-windows": "^1.0.1", - "resolve-dir": "^1.0.0" - } - } - } - }, - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true - }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "run-queue": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", - "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", - "dev": true, - "requires": { - "aproba": "^1.1.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "requires": { - "ret": "~0.1.10" - } - }, - "schema-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", - "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", - "dev": true, - "requires": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" - } - }, - "semver": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==" - }, - "serialize-javascript": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.1.0.tgz", - "integrity": "sha512-JIJT1DGiWmIKhzRsG91aS6Ze4sFUrYbltlkg2onR5OrnNM02Kl/hnY/T4FN2omvyeBbQmMJv+K4cPOpGzOTFBg==", - "dev": true, - "requires": { - "randombytes": "^2.1.0" - } - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", - "dev": true - }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "slice-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "astral-regex": "^1.0.0", - "is-fullwidth-code-point": "^2.0.0" - } - }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "requires": { - "kind-of": "^3.2.0" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "source-list-map": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", - "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", - "dev": true - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, - "source-map-resolve": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", - "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", - "dev": true, - "requires": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", - "dev": true - }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.0" - } - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "ssri": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.2.tgz", - "integrity": "sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q==", - "dev": true, - "requires": { - "figgy-pudding": "^3.5.1" - } - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "stream-browserify": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", - "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", - "dev": true, - "requires": { - "inherits": "~2.0.1", - "readable-stream": "^2.0.2" - } - }, - "stream-each": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", - "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "stream-shift": "^1.0.0" - } - }, - "stream-http": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", - "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", - "dev": true, - "requires": { - "builtin-status-codes": "^3.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.3.6", - "to-arraybuffer": "^1.0.0", - "xtend": "^4.0.0" - } - }, - "stream-shift": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", - "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true - }, - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "table": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", - "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", - "dev": true, - "requires": { - "ajv": "^6.10.2", - "lodash": "^4.17.14", - "slice-ansi": "^2.1.0", - "string-width": "^3.0.0" - } - }, - "tapable": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", - "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", - "dev": true - }, - "terser": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", - "integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==", - "dev": true, - "requires": { - "commander": "^2.20.0", - "source-map": "~0.6.1", - "source-map-support": "~0.5.12" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "terser-webpack-plugin": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.4.tgz", - "integrity": "sha512-U4mACBHIegmfoEe5fdongHESNJWqsGU+W0S/9+BmYGVQDw1+c2Ow05TpMhxjPK1sRb7cuYq1BPl1e5YHJMTCqA==", - "dev": true, - "requires": { - "cacache": "^12.0.2", - "find-cache-dir": "^2.1.0", - "is-wsl": "^1.1.0", - "schema-utils": "^1.0.0", - "serialize-javascript": "^3.1.0", - "source-map": "^0.6.1", - "terser": "^4.1.2", - "webpack-sources": "^1.4.0", - "worker-farm": "^1.7.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "timers-browserify": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.11.tgz", - "integrity": "sha512-60aV6sgJ5YEbzUdn9c8kYGIqOubPoUdqQCul3SBAsRCZ40s6Y5cMcrW4dt3/k/EsbLVJNl9n6Vz3fTc+k2GeKQ==", - "dev": true, - "requires": { - "setimmediate": "^1.0.4" - } - }, - "to-arraybuffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", - "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", - "dev": true - }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - }, - "tslib": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", - "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", - "dev": true - }, - "tty-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", - "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", - "dev": true - }, - "type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "requires": { - "prelude-ls": "^1.2.1" - } - }, - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true - }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true - }, - "union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - } - }, - "unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "dev": true, - "requires": { - "unique-slug": "^2.0.0" - } - }, - "unique-slug": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", - "dev": true, - "requires": { - "imurmurhash": "^0.1.4" - } - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true - } - } - }, - "upath": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", - "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", - "dev": true, - "optional": true - }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "dev": true, - "requires": { - "punycode": "1.3.2", - "querystring": "0.2.0" - }, - "dependencies": { - "punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - } - } - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true - }, - "util": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", - "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", - "dev": true, - "requires": { - "inherits": "2.0.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - } - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "v8-compile-cache": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", - "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", - "dev": true - }, - "vm-browserify": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", - "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", - "dev": true - }, - "watchpack": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.2.tgz", - "integrity": "sha512-ymVbbQP40MFTp+cNMvpyBpBtygHnPzPkHqoIwRRj/0B8KhqQwV8LaKjtbaxF2lK4vl8zN9wCxS46IFCU5K4W0g==", - "dev": true, - "requires": { - "chokidar": "^3.4.0", - "graceful-fs": "^4.1.2", - "neo-async": "^2.5.0", - "watchpack-chokidar2": "^2.0.0" - } - }, - "watchpack-chokidar2": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/watchpack-chokidar2/-/watchpack-chokidar2-2.0.0.tgz", - "integrity": "sha512-9TyfOyN/zLUbA288wZ8IsMZ+6cbzvsNyEzSBp6e/zkifi6xxbl8SmQ/CxQq32k8NNqrdVEVUVSEf56L4rQ/ZxA==", - "dev": true, - "optional": true, - "requires": { - "chokidar": "^2.1.8" - }, - "dependencies": { - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "optional": true, - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - }, - "dependencies": { - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "optional": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } - } - }, - "binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", - "dev": true, - "optional": true - }, - "chokidar": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", - "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", - "dev": true, - "optional": true, - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "fsevents": "^1.2.7", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - } - }, - "fsevents": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", - "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "dev": true, - "optional": true, - "requires": { - "bindings": "^1.5.0", - "nan": "^2.12.1" - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "optional": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "optional": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "optional": true, - "requires": { - "binary-extensions": "^1.0.0" - } - }, - "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "dev": true, - "optional": true, - "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - } - } - } - }, - "webpack": { - "version": "4.43.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.43.0.tgz", - "integrity": "sha512-GW1LjnPipFW2Y78OOab8NJlCflB7EFskMih2AHdvjbpKMeDJqEgSx24cXXXiPS65+WSwVyxtDsJH6jGX2czy+g==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-module-context": "1.9.0", - "@webassemblyjs/wasm-edit": "1.9.0", - "@webassemblyjs/wasm-parser": "1.9.0", - "acorn": "^6.4.1", - "ajv": "^6.10.2", - "ajv-keywords": "^3.4.1", - "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^4.1.0", - "eslint-scope": "^4.0.3", - "json-parse-better-errors": "^1.0.2", - "loader-runner": "^2.4.0", - "loader-utils": "^1.2.3", - "memory-fs": "^0.4.1", - "micromatch": "^3.1.10", - "mkdirp": "^0.5.3", - "neo-async": "^2.6.1", - "node-libs-browser": "^2.2.1", - "schema-utils": "^1.0.0", - "tapable": "^1.1.3", - "terser-webpack-plugin": "^1.4.3", - "watchpack": "^1.6.1", - "webpack-sources": "^1.4.1" - } - }, - "webpack-cli": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.12.tgz", - "integrity": "sha512-NVWBaz9k839ZH/sinurM+HcDvJOTXwSjYp1ku+5XKeOC03z8v5QitnK/x+lAxGXFyhdayoIf/GOpv85z3/xPag==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "cross-spawn": "^6.0.5", - "enhanced-resolve": "^4.1.1", - "findup-sync": "^3.0.0", - "global-modules": "^2.0.0", - "import-local": "^2.0.0", - "interpret": "^1.4.0", - "loader-utils": "^1.4.0", - "supports-color": "^6.1.0", - "v8-compile-cache": "^2.1.1", - "yargs": "^13.3.2" - } - }, - "webpack-sources": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", - "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", - "dev": true, - "requires": { - "source-list-map": "^2.0.0", - "source-map": "~0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true - }, - "worker-farm": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz", - "integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==", - "dev": true, - "requires": { - "errno": "~0.1.7" - } - }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "write": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", - "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", - "dev": true, - "requires": { - "mkdirp": "^0.5.1" - } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true - }, - "y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true - }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - }, - "yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", - "dev": true, - "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - } - }, - "yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } -} diff --git a/src/animation_utils/package.json b/src/animation_utils/package.json deleted file mode 100644 index 045b905b..00000000 --- a/src/animation_utils/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "animation_utils", - "version": "3.0.8", - "private": true, - "description": "GeckoLib Animation Utils", - "main": "index.js", - "scripts": { - "build": "webpack && npm run update_manifest", - "update_manifest": "node scripts/updateManifest.js", - "start": "webpack --watch --mode=development", - "lint": "eslint .", - "lint:fix": "eslint --fix .", - "pretest": "npm run lint", - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "Eliot Lash, Gecko, McHorse, AzureDoom, Tslat", - "license": "MIT", - "blockbenchConfig": { - "title": "GeckoLib Animation Utils", - "author": "Eliot Lash, Gecko, McHorse, AzureDoom, Tslat", - "icon": "movie_filter", - "description": "Create animated blocks, items, entity, and armor using the GeckoLib library and plugin. https://github.com/bernie-g/geckolib/wiki", - "min_version": "4.0.0", - "max_version": "5.0.0", - "variant": "both" - }, - "sideEffects": [ - "./index.js" - ], - "devDependencies": { - "eol": "0.9.1", - "eslint": "7.7.0", - "webpack": "4.43.0", - "webpack-cli": "3.3.12", - "indent-string": "^5.0.0" - }, - "dependencies": { - "lodash": "^4.17.21", - "semver": "7.3.2" - } -} diff --git a/src/animation_utils/scripts/updateManifest.js b/src/animation_utils/scripts/updateManifest.js deleted file mode 100644 index e9d8a5e1..00000000 --- a/src/animation_utils/scripts/updateManifest.js +++ /dev/null @@ -1,37 +0,0 @@ -(async () => { - const indentString = (await import('indent-string')).default; - const path = require('path'); - const fs = require('fs'); - const eol = require('eol'); - const url = require('url'); - // @ts-ignore - - const PACKAGE_JSON_PATH = './package.json' - const PLUGINS_MANIFEST_PATH = '../../plugins.json' - - const pluginsString = fs.readFileSync(PLUGINS_MANIFEST_PATH, { encoding: 'utf8' }); - const pluginsObj = JSON.parse(pluginsString); - - const packageJsonString = fs.readFileSync(PACKAGE_JSON_PATH, { encoding: 'utf8' }); - const { version, blockbenchConfig } = JSON.parse(packageJsonString); - - // console.log({ version, blockbenchConfig }); - - const newAnimationUtilsManifest = Object.assign( - {}, - pluginsObj.animation_utils, - { version }, - blockbenchConfig, - ); - const newAnimationUtilsManifestString = - indentString( - JSON.stringify(newAnimationUtilsManifest, null, '\t'), - 1, - { indent: '\t' } - ) - .trimStart(); - - const newPluginsString = pluginsString.replace(/("animation_utils":\s*)({[\s\S.]*?})/, `$1${newAnimationUtilsManifestString}`); - - fs.writeFileSync(PLUGINS_MANIFEST_PATH, eol.lf(newPluginsString)); -})(); \ No newline at end of file diff --git a/src/animation_utils/webpack.config.js b/src/animation_utils/webpack.config.js deleted file mode 100644 index 8ca485f3..00000000 --- a/src/animation_utils/webpack.config.js +++ /dev/null @@ -1,12 +0,0 @@ -const PathModule = require('path') - -module.exports = { - mode: 'development', - devtool: 'none', - target: 'node', - entry: './index.js', - output: { - filename: 'animation_utils.js', - path: PathModule.resolve(__dirname, '../../plugins') - } -} diff --git a/src/azurelib_utils/animationUi.js b/src/azurelib_utils/animationUi.js index fc2d06dd..fc6c05f2 100644 --- a/src/azurelib_utils/animationUi.js +++ b/src/azurelib_utils/animationUi.js @@ -22,15 +22,10 @@ export const unloadAnimationUI = () => { //#region Global Animation UI Handlers export const displayAnimationFrameCallback = (/*...args*/) => { - // const keyframe = $('#keyframe'); - // console.log('displayAnimationFrameCallback:', args, 'keyframe:', keyframe); // keyframe is null here }; export function updateKeyframeEasing(value) { Undo.initEdit({keyframes: Timeline.selected}) - // var axis = $(obj).attr('axis'); - // const value = $(obj).val(); - // console.log('updateKeyframeEasing value:', value, 'obj:', obj); if (value === "-") return; Timeline.selected.forEach((kf) => { kf.easing = value; @@ -43,11 +38,9 @@ export function updateKeyframeEasing(value) { export function updateKeyframeEasingArg(obj) { Undo.initEdit({keyframes: Timeline.selected}) if ($(obj).val() === "-") return; - // console.log('updateKeyframeEasingArg value:', $(obj).val(), 'obj:', obj); Timeline.selected.forEach((kf) => { const value = parseEasingArg(kf, $(obj).val().trim()); kf.easingArgs = [value]; - // obj.value = value; }) Undo.finishEdit('edit keyframe easing argument') } @@ -88,7 +81,6 @@ export const updateKeyframeSelectionCallback = (/*...args*/) => { }; const keyframesByChannel = Timeline.keyframes.reduce((acc, kf) => { - // Dear god I miss lodash if (!acc.has(kf.animator)) acc.set(kf.animator, {}); const animatorChannels = acc.get(kf.animator); if (!animatorChannels[kf.channel]) animatorChannels[kf.channel] = []; @@ -238,8 +230,6 @@ export const updateKeyframeSelectionCallback = (/*...args*/) => {
`; scaleBar = document.getElementById('keyframe_bar_easing_arg1'); } - - // console.log('easingBar:', easingBar, 'keyframe:', keyframe); } } }; diff --git a/src/azurelib_utils/codec.js b/src/azurelib_utils/codec.js index 08aea981..316d4102 100644 --- a/src/azurelib_utils/codec.js +++ b/src/azurelib_utils/codec.js @@ -25,11 +25,9 @@ export function unloadCodec() { function onProjectCompile(e) { if (Format.id !== "azure_model") return; e.model.azurelibSettings = azurelibSettings; - // console.log(`compileCallback model:`, e.model); } function onProjectParse(e) { - // console.log(`onProjectParse:`, e); if (e.model && typeof e.model.azurelibSettings === 'object') { Object.assign(azurelibSettings, omit(e.model.azurelibSettings, ['formatVersion'])); } else { @@ -40,7 +38,6 @@ function onProjectParse(e) { function onBedrockCompile(e) { console.log('onBedrockCompile e:', e); - // maybeExportItemJson(e.options); } function animatorBuildFile() { @@ -53,7 +50,6 @@ function animatorBuildFile() { } ); } - // console.log('animatorBuildFile res:', res); return res; } @@ -298,9 +294,6 @@ var format = new ModelFormat({ } }) -//Object.defineProperty(format, 'integer_size', {get: _ => Templates.get('integer_size')}) -// codec.format = format; // This sets the default format for the codec - export default codec; // This is used for plugin "Export Animated Model" menu item //#endregion Codec / ModelFormat \ No newline at end of file diff --git a/src/azurelib_utils/index.js b/src/azurelib_utils/index.js index 5e0e33ba..5e9168da 100644 --- a/src/azurelib_utils/index.js +++ b/src/azurelib_utils/index.js @@ -68,11 +68,6 @@ if (!semverSatisfies(semverCoerce(Blockbench.version), SUPPORTED_BB_VERSION_RANG lines: [`AzureLib Animation Utils v${version}`], form: { objectType: {label: 'Object Type', type: 'select', default: azurelibSettings.objectType, options: OBJ_TYPE_OPTIONS}, - // modSDK: {label: 'Modding SDK', type: 'select', default: azurelibSettings.modSDK, options: MOD_SDK_OPTIONS}, - // entityType: {label: 'Entity Type', value: azurelibSettings.entityType}, - // javaPackage: {label: 'Java Package', value: azurelibSettings.javaPackage}, - // animFileNamespace: {label: 'Animation File Namespace', value: azurelibSettings.animFileNamespace}, - // animFilePath: {label: 'Animation File Path', value: azurelibSettings.animFilePath}, }, onConfirm: function(formResult) { Object.assign(azurelibSettings, formResult); diff --git a/src/azurelib_utils/keyframe.js b/src/azurelib_utils/keyframe.js index 0c24fb0f..bc505f81 100644 --- a/src/azurelib_utils/keyframe.js +++ b/src/azurelib_utils/keyframe.js @@ -4,7 +4,7 @@ import { easingFunctions, EASING_DEFAULT, getEasingArgDefault } from './easing'; //#region Keyframe Mixins export function loadKeyframeOverrides() { addMonkeypatch(Keyframe, "prototype", "getLerp", keyframeGetLerp); - addMonkeypatch(Keyframe, "prototype", "getArray", keyframeGetArray); + addMonkeypatch(Keyframe, "prototype", "compileBedrockKeyframe", keyframeCompileBedrock); addMonkeypatch(Keyframe, "prototype", "getUndoCopy", keyframeGetUndoCopy); addMonkeypatch(Keyframe, "prototype", "extend", keyframeExtend); @@ -30,29 +30,67 @@ function keyframeGetLerp(other, axis, amount, allow_expression) { const arg1 = Array.isArray(other.easingArgs) && other.easingArgs.length > 0 ? other.easingArgs[0] : getEasingArgDefault(other); - // console.log(`keyframeGetLerp arg1: ${arg1}`); easingFunc = easingFunc.bind(null, arg1); } const easedAmount = easingFunc(amount); const start = this.calc(axis); const stop = other.calc(axis); const result = lerp(start, stop, easedAmount); - // console.log('keyframeGetLerp easing:', easing, 'arguments:', arguments, 'start:', start, 'stop:', stop, 'amount:', amount, 'easedAmount:', easedAmount, 'result:', result); if (Number.isNaN(result)) { throw new Error('batman'); } return result; } -function keyframeGetArray() { - const { easing, easingArgs } = this; - let result = Original.get(Keyframe).getArray.apply(this, arguments); - if (Format.id === "azure_model") { - result = { vector: result, easing }; - if (hasArgs(easing)) result.easingArgs = easingArgs; - } - console.log('keyframeGetArray arguments:', arguments, 'this:', this, 'result:', result); - return result; +function azurelibGetArray(data_point = 0) { + const { easing, easingArgs, getArray } = this; + let result = getArray.call(this, data_point); + + if (Format.id === "azure_model") { + result = { vector: result, easing }; + if (hasArgs(easing)) { + result.easingArgs = easingArgs; + } + } + + return result; +} + +function keyframeCompileBedrock() { + if (Format.id !== "azure_model" || !this.transform) { + return Original.get(Keyframe).compileBedrockKeyframe.apply(this, arguments); + } + + const previousKeyframe = this.getPreviousKeyframe.bind(this); + + if (this.interpolation === 'catmullrom') { + const previous = previousKeyframe(); + const includePre = (!previous && this.time > 0) || (previous && previous.interpolation !== 'catmullrom'); + + return { + pre: includePre ? azurelibGetArray.call(this, 0) : undefined, + post: azurelibGetArray.call(this, includePre ? 1 : 0), + lerp_mode: this.interpolation, + }; + } + + if (this.data_points.length === 1) { + const previous = previousKeyframe(); + + if (previous && previous.interpolation === 'step') { + return new oneLiner({ + pre: azurelibGetArray.call(previous, 1), + post: azurelibGetArray.call(this), + }); + } else { + return azurelibGetArray.call(this); + } + } + + return new oneLiner({ + pre: azurelibGetArray.call(this, 0), + post: azurelibGetArray.call(this, 1), + }); } function keyframeGetUndoCopy() { @@ -62,13 +100,11 @@ function keyframeGetUndoCopy() { Object.assign(result, { easing }); if (hasArgs(easing)) result.easingArgs = easingArgs; } - console.log('keyframeGetUndoCopy arguments:', arguments, 'this:', this, 'result:', result); return result; } function keyframeExtend(dataIn) { const data = Object.assign({}, dataIn); - console.log('keyframeExtend 1 arguments:', arguments); if (Format.id === "azure_model") { if (typeof data.values === 'object') { if (data.values.easing !== undefined) { @@ -91,13 +127,11 @@ function keyframeExtend(dataIn) { } } const result = Original.get(Keyframe).extend.apply(this, arguments); - console.log('keyframeExtend 2 arguments:', arguments, 'this:', this, 'result:', result); return result; } function reverseKeyframesCondition() { const res = Original.get(BarItems.reverse_keyframes).condition() && Format.id !== "azure_model"; - // console.log('reverseKeyframesCondition original:',Original.get(BarItems.reverse_keyframes).condition(), 'res:', res); return res; } diff --git a/src/azurelib_utils/package.json b/src/azurelib_utils/package.json index 91785d27..64786e07 100644 --- a/src/azurelib_utils/package.json +++ b/src/azurelib_utils/package.json @@ -1,6 +1,6 @@ { "name": "azurelib_utils", - "version": "1.0.7", + "version": "1.0.8", "private": true, "description": "AzureLib Animator", "main": "index.js", diff --git a/src/pbr_preview/src/index.ts b/src/pbr_preview/src/index.ts index 46d13eae..5cd968b6 100644 --- a/src/pbr_preview/src/index.ts +++ b/src/pbr_preview/src/index.ts @@ -30,6 +30,13 @@ interface IChannel { default?: THREE.Color; } +interface ILightrParams { + lightHeight?: number; + ambientLight?: [number, number, number]; + minLightIntensity?: number; + lightDiffuse?: [number, number, number]; +} + (() => { let decodeMer: Action; let createTextureSet: Action; @@ -37,6 +44,8 @@ interface IChannel { let generateNormal: Action; let unassignChannel: Action; let createMaterialTexture: Action; + let bakeTexturesAction: Action; + let bakeTexturesDialog: Dialog; let togglePbr: Toggle; let displaySettingsPanel: Panel; let textureSetDialog: Dialog; @@ -703,6 +712,146 @@ interface IChannel { } } + /** + * Adapted from Lightr by phosphoer + * @see https://github.com/phosphoer/lightr + */ + class Lightr { + lightHeight: number; + ambientLight: [number, number, number]; + minLightIntensity: number; + lightDiffuse: [number, number, number]; + + constructor({ + lightHeight = 0.66, + ambientLight = [0.1, 0.1, 0.1], + minLightIntensity = 0.0, + lightDiffuse = [1, 1, 1], + }: ILightrParams = {}) { + this.lightHeight = lightHeight; + this.ambientLight = ambientLight; + this.minLightIntensity = minLightIntensity; + this.lightDiffuse = lightDiffuse; + } + + bake( + numDirs: number, + diffuseMap: HTMLImageElement | HTMLCanvasElement, + normalMap: HTMLImageElement | HTMLCanvasElement, + ): HTMLCanvasElement[] { + const canvasDiffuse = + diffuseMap instanceof HTMLCanvasElement + ? diffuseMap + : this.createCanvas(diffuseMap.width, diffuseMap.height); + const canvasNormals = + normalMap instanceof HTMLCanvasElement + ? normalMap + : this.createCanvas(normalMap.width, normalMap.height); + + const contextDiffuse = canvasDiffuse.getContext("2d")!; + const contextNormals = canvasNormals.getContext("2d")!; + + contextDiffuse.drawImage(diffuseMap, 0, 0); + contextNormals.drawImage(normalMap, 0, 0); + + const bufferDiffuse = contextDiffuse.getImageData( + 0, + 0, + diffuseMap.width, + diffuseMap.height, + ); + const bufferNormals = contextNormals.getImageData( + 0, + 0, + normalMap.width, + normalMap.height, + ); + + const bakedImages: HTMLCanvasElement[] = []; + const normals: [number, number, number][][] = []; + + for (let x = 0; x < bufferNormals.width; ++x) { + normals[x] = []; + for (let y = 0; y < bufferNormals.height; ++y) { + const idx = (x + y * bufferNormals.width) * 4; + + const normal = [ + (bufferNormals.data[idx + 0] / 255 - 0.5) * 2, + (bufferNormals.data[idx + 1] / 255 - 0.5) * 2, + (bufferNormals.data[idx + 2] / 255 - 0.5) * 2, + ]; + + const len = Math.sqrt( + normal[0] ** 2 + normal[1] ** 2 + normal[2] ** 2, + ); + normals[x][y] = [normal[0] / len, normal[1] / len, normal[2] / len]; + } + } + + const bakeDirection = (dir: number): HTMLCanvasElement => { + const canvas = this.createCanvas(diffuseMap.width, diffuseMap.height); + const context = canvas.getContext("2d")!; + const buffer = context.getImageData(0, 0, canvas.width, canvas.height); + + const lightDir = [Math.cos(dir), Math.sin(dir), this.lightHeight]; + + for (let x = 0; x < bufferNormals.width; ++x) { + for (let y = 0; y < bufferNormals.height; ++y) { + const normal = normals[x][y]; + const index = (x + y * bufferNormals.width) * 4; + const diffuse = [ + bufferDiffuse.data[index + 0] / 255, + bufferDiffuse.data[index + 1] / 255, + bufferDiffuse.data[index + 2] / 255, + bufferDiffuse.data[index + 3], + ]; + + let intensity = + normal[0] * lightDir[0] + + normal[1] * lightDir[1] + + normal[2] * lightDir[2]; + intensity = Math.min( + 1, + Math.max(this.minLightIntensity, intensity), + ); + + const out = [ + intensity * diffuse[0] * this.lightDiffuse[0] + + this.ambientLight[0], + intensity * diffuse[1] * this.lightDiffuse[1] + + this.ambientLight[1], + intensity * diffuse[2] * this.lightDiffuse[2] + + this.ambientLight[2], + diffuse[3], + ]; + + buffer.data[index + 0] = Math.floor(out[0] * 255); + buffer.data[index + 1] = Math.floor(out[1] * 255); + buffer.data[index + 2] = Math.floor(out[2] * 255); + buffer.data[index + 3] = out[3]; + } + } + + context.putImageData(buffer, 0, 0); + return canvas; + }; + + for (let i = 0; i < numDirs; ++i) { + const lightDir = ((Math.PI * 2) / numDirs) * i; + bakedImages.push(bakeDirection(lightDir)); + } + + return bakedImages; + } + + private createCanvas(width: number, height: number): HTMLCanvasElement { + const canvas = document.createElement("canvas"); + canvas.width = width; + canvas.height = height; + return canvas; + } + } + channelProp = new Property(TextureLayer, "enum", "channel", { default: NA_CHANNEL, values: Object.keys(CHANNELS).map((key) => CHANNELS[key].id), @@ -717,12 +866,14 @@ interface IChannel { exposed: false, }); + // @ts-expect-error "object" is a valid type for a property pbrMaterialsProp = new Property(ModelProject, "object", "pbr_materials", { default: {}, exposed: false, label: "PBR Materials", }); + // @ts-expect-error "object" is a valid type for a property projectMaterialsProp = new Property(ModelProject, "object", "bb_materials", { default: {}, exposed: false, @@ -736,13 +887,17 @@ interface IChannel { label: "PBR Mode", }); + // + // Functions + // + /** * ### Export MER map * Generates a MER map from the currently selected texture and exports it as a PNG file * @param cb Callback function to run after the MER file is exported * @returns void */ - const exportMer = (cb?: (filePath: string) => void) => { + const exportMer = (baseName?: string, cb?: (filePath: string) => void) => { const selected = Project ? Project.selected_texture : Texture.all.find((t) => t.selected); @@ -771,7 +926,9 @@ interface IChannel { const [name, startpath] = Project ? [ - `${selected.name ?? Project.getDisplayName()}_mer`, + baseName + ? `${baseName}_mer` + : `${selected.name ?? Project.getDisplayName()}_mer`, Project.export_path, ] : ["mer"]; @@ -904,6 +1061,109 @@ interface IChannel { return canvas.toDataURL(); }; + const bakeTextures = ( + params: ILightrParams, + directions = 8, + blendEmissive = false, + ) => { + if (!Project) { + return; + } + + const selected = Project.selected_texture; + + if (!selected) { + return; + } + + const mat = new PbrMaterial( + selected.layers_enabled ? selected.layers : Project.textures, + selected.uuid, + ); + + const texture = mat.findTexture(CHANNELS.albedo); + const normalMap = mat.findTexture(CHANNELS.normal); + + if (!texture || !normalMap) { + return; + } + + const lightr = new Lightr(params); + const bakedImages = lightr.bake( + directions, + texture.canvas, + normalMap.canvas, + ); + + const bakedTexture = new Texture({ + name: `${texture.name}_baked`, + saved: false, + particle: false, + keep_size: false, + layers_enabled: true, + }).fromDataURL(bakedImages[0].toDataURL()); + + const addEmissive = blendEmissive + ? (canvas: HTMLCanvasElement) => { + const emissive = mat.findTexture(CHANNELS.emissive); + + if (!emissive) { + return canvas; + } + + const emissiveCanvas = emissive.canvas; + const emissiveCtx = emissiveCanvas.getContext("2d"); + + if (!emissiveCtx) { + return canvas; + } + + const width = Math.max( + canvas.width, + emissiveCanvas.width, + Project ? Project.texture_width : 16, + ); + const height = Math.max( + canvas.height, + emissiveCanvas.height, + Project ? Project.texture_height : 16, + ); + + const mergedCanvas = document.createElement("canvas"); + mergedCanvas.width = width; + mergedCanvas.height = height; + + const mergedCtx = mergedCanvas.getContext("2d"); + + if (!mergedCtx) { + return canvas; + } + + mergedCtx.drawImage(canvas, 0, 0); + mergedCtx.globalCompositeOperation = "screen"; + mergedCtx.drawImage(emissiveCanvas, 0, 0); + + return mergedCanvas; + } + : (canvas: HTMLCanvasElement) => canvas; + + bakedImages.forEach((image, idx) => { + const layer = new TextureLayer( + { + name: `baked_${idx + 1}`, + data_url: addEmissive(image).toDataURL(), + }, + bakedTexture, + ); + + layer.addForEditing(); + }); + + bakedTexture.add().select(); + + Blockbench.showQuickMessage("Textures baked 🥐", 2000); + }; + // // UI Components // @@ -916,9 +1176,9 @@ interface IChannel { Project.textures.forEach((t) => { const mat = new PbrMaterial(scope, t.uuid); - const projectNormalMap = mat.findTexture(CHANNELS.normal, false)?.name; - const projectHeightMap = mat.findTexture(CHANNELS.height, false)?.name; - const projectColorMap = mat.findTexture(CHANNELS.albedo, false)?.name; + const projectNormalMap = mat.findTexture(CHANNELS.normal, false); + const projectHeightMap = mat.findTexture(CHANNELS.height, false); + const projectColorMap = mat.findTexture(CHANNELS.albedo, false); const projectMetalnessMap = mat.findTexture( CHANNELS.metalness, false, @@ -971,6 +1231,22 @@ interface IChannel { }; } + if (projectNormalMap) { + form.depthMap = { + type: "checkbox", + label: "Normal Map", + value: "normal", + }; + } + + if (projectHeightMap) { + form.depthMap = { + type: "checkbox", + label: "Height Map", + value: "heightmap", + }; + } + if (projectNormalMap && projectHeightMap) { form.depthMap = { type: "radio", @@ -1010,7 +1286,7 @@ interface IChannel { "minecraft:texture_set": { color: (projectColorMap - ? pathToName(projectColorMap, false) + ? baseName // pathToName(projectColorMap.name, false) : formResult.baseColor?.toHexString()) ?? baseName, metalness_emissive_roughness: [ formResult.metalness ?? 0, @@ -1020,26 +1296,29 @@ interface IChannel { }, }; - if (formResult.depthMap === "normal" && projectNormalMap) { - textureSet["minecraft:texture_set"].normal = pathToName( - projectNormalMap, - false, - ); + if ( + (formResult.depthMap === "normal" && projectNormalMap) || + (!projectHeightMap && projectNormalMap) + ) { + textureSet["minecraft:texture_set"].normal = `${baseName}_normal`; } else if ( (!projectNormalMap || formResult.depthMap === "heightmap") && projectHeightMap ) { - textureSet["minecraft:texture_set"].heightmap = pathToName( - projectHeightMap, - false, - ); + textureSet["minecraft:texture_set"].heightmap = + `${baseName}_heightmap`; } const exportDepthMap = (cb: () => void) => { - const depthMap = - formResult.depthMap === "normal" - ? projectNormalMap - : projectHeightMap; + if (!formResult.depthMap) { + return cb(); + } + + const useNormalMap = + formResult.depthMap === "normal" || + (formResult.depthMap && !projectHeightMap); + + const depthMap = useNormalMap ? projectNormalMap : projectHeightMap; if (!depthMap) { return cb(); @@ -1047,37 +1326,70 @@ interface IChannel { Blockbench.export( { - content: depthMap, + content: depthMap.canvas.toDataURL() ?? "", type: "PNG", - name: `${baseName}_${formResult.depthMap}`, + name: `${baseName}_${useNormalMap ? "normal" : "heightmap"}`, extensions: ["png"], resource_id: formResult.depthMap, startpath: Project.export_path, + savetype: "image", + }, + (filePath) => { + textureSet["minecraft:texture_set"][ + useNormalMap ? "normal" : "heightmap" + ] = pathToName(filePath, false); + cb(); + }, + ); + }; + + const exportBaseColor = (cb: () => void) => { + if (!projectColorMap) { + return cb(); + } + + Blockbench.export( + { + content: projectColorMap.canvas.toDataURL(), + extensions: ["png"], + type: "PNG", + name: baseName, + startpath: Project.export_path, + savetype: "image", + }, + (filePath) => { + textureSet["minecraft:texture_set"].color = pathToName( + filePath, + false, + ); + cb(); }, - cb, ); }; const exportTextureSet = () => exportDepthMap(() => { - Blockbench.export( - { - content: JSON.stringify(textureSet, null, 2), - type: "JSON", - name: `${baseName}.texture_set`, - extensions: ["json"], - resource_id: "texture_set", - startpath: Project.export_path, - }, - () => { - Blockbench.showQuickMessage("Texture set created", 2000); - textureSetDialog.hide(); - }, - ); + exportBaseColor(() => { + Blockbench.export( + { + content: JSON.stringify(textureSet, null, 2), + type: "JSON", + name: `${baseName}.texture_set`, + extensions: ["json"], + resource_id: "texture_set", + startpath: Project.export_path, + savetype: "text", + }, + () => { + Blockbench.showQuickMessage("Texture set created", 2000); + textureSetDialog.hide(); + }, + ); + }); }); if (hasMer) { - exportMer((filePath) => { + exportMer(baseName, (filePath) => { textureSet["minecraft:texture_set"].metalness_emissive_roughness = pathToName(filePath, false); exportTextureSet(); @@ -1196,6 +1508,7 @@ interface IChannel { // condition: () => Number(tonemappingSelect.get()) !== THREE.NoToneMapping, onBefore() { if (Number(tonemappingSelect.get()) === THREE.NoToneMapping) { + // @ts-expect-error `.change()` does not require an Event for its value tonemappingSelect.change(THREE.LinearToneMapping.toString()); } togglePbr.set(true); @@ -1213,10 +1526,84 @@ interface IChannel { }, }); + bakeTexturesDialog = new Dialog(`${PLUGIN_ID}_bake_textures`, { + id: `${PLUGIN_ID}_bake_textures`, + title: "Bake Textures", + buttons: ["Bake", "Cancel"], + form: { + ambientLight: { + type: "color", + label: "Ambient Light", + value: "#1f1f1f", + }, + lightDiffuse: { + type: "color", + label: "Light Diffuse", + value: "#ffffff", + }, + lightHeight: { + type: "range", + label: "Light Height", + min: 0, + max: 1, + step: 0.01, + value: 0.66, + }, + minLightIntensity: { + type: "range", + label: "Minimum Light Intensity", + min: 0, + max: 1, + step: 0.01, + value: 0, + }, + directions: { + type: "number", + label: "Directions", + value: 8, + min: 1, + max: 360, + step: 1, + }, + blendEmissive: { + type: "checkbox", + label: "Blend Emissive", + value: false, + }, + }, + onConfirm(formResult: Record) { + const ambientLight = new THREE.Color( + formResult.ambientLight.toString(), + ); + const lightDiffuse = new THREE.Color( + formResult.lightDiffuse.toString(), + ); + bakeTextures( + { + ambientLight: [ambientLight.r, ambientLight.g, ambientLight.b], + lightDiffuse: [lightDiffuse.r, lightDiffuse.g, lightDiffuse.b], + lightHeight: Number(formResult.lightHeight), + minLightIntensity: Number(formResult.minLightIntensity), + }, + formResult.directions ?? 8, + formResult.blendEmissive ?? false, + ); + }, + }); + // // Actions // + bakeTexturesAction = new Action(`${PLUGIN_ID}_bake_textures`, { + icon: "cake", + name: "Bake Textures", + description: "Bakes textures for the selected PBR material", + click() { + bakeTexturesDialog.show(); + }, + }); + generateNormal = new Action(`${PLUGIN_ID}_generate_normal`, { icon: "altitude", name: "Generate Normal Map", @@ -1225,18 +1612,21 @@ interface IChannel { (TextureLayer.selected || Texture.all.find((t) => t.selected)) !== undefined, click() { - const texture = - TextureLayer.selected ?? Project + const texture: Texture | TextureLayer = + TextureLayer.selected ?? + (!!Project && Project.selected_texture ? Project.selected_texture.selected_layer ?? Project.selected_texture - : Texture.getDefault(); + : Texture.getDefault()); if (!texture) { return; } const mat = new PbrMaterial( - texture.layers_enabled ? texture.layers : getProjectTextures(), + texture instanceof Texture && texture.layers_enabled + ? texture.layers + : getProjectTextures(), texture.uuid, ); @@ -1258,7 +1648,10 @@ interface IChannel { name: "Export MER", description: "Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)", - // condition: () => Format.id == "bedrock", + condition: { + formats: ["bedrock_block", "bedrock_entity"], + project: true, + }, click() { exportMer(); }, @@ -1332,7 +1725,7 @@ interface IChannel { createTextureSetDialog(); }, condition: { - formats: ["bedrock"], + formats: ["bedrock_block", "bedrock_entity"], project: true, }, }); @@ -1790,8 +2183,8 @@ interface IChannel { children: [ "toggle_pbr", `${PLUGIN_ID}_correct_lights`, - `${PLUGIN_ID}_show_channel_menu`, `${PLUGIN_ID}_create_material_texture`, + `${PLUGIN_ID}_show_channel_menu`, ], name: "PBR", }), @@ -1870,6 +2263,7 @@ interface IChannel { MenuBar.addAction(togglePbr, "view"); MenuBar.addAction(toggleCorrectLights, "preview"); MenuBar.addAction(createMaterialTexture, "tools"); + MenuBar.addAction(bakeTexturesAction, "tools"); MenuBar.addAction(materialBrushTool, "tools.0"); MenuBar.addAction(openChannelMenu, "image.0"); @@ -1895,6 +2289,8 @@ interface IChannel { generateNormal?.delete(); togglePbr?.delete(); decodeMer?.delete(); + bakeTexturesAction?.delete(); + bakeTexturesDialog?.delete(); createTextureSet?.delete(); textureChannelProp?.delete(); channelProp?.delete(); From 0aba465188358e7acfe38edbf549798004dd4002 Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 5 Jun 2024 07:24:49 -0500 Subject: [PATCH 14/50] upd: labPBR support / Material presets (#3) * refactor: Split into multiple files - Added registry, setups, and teardowns to control plugin actions * feat: Reset exposure Action - Added messages to baking failures - Added reset exposure button - Added changelog build script * feat: labPBR output Action * feat: Decode labPBR channels * chore: Remove unused code - Revert normal map usage in PbrMaterial.getMaterial() * fix: labPBR specular map logic - Fixed bug in alpha channel - Added better specular and normal export names * feat: Material brush presets * feat: Channel assignment panel - Created panel to list current channel assignments * upd: Channel component cleanup * upd: Style channel list * feat: Material brush presets library - Created Dialog for editing, saving and loading material brush presets * upd: Change Action icon - Changed material brush Action icon * upd: Channel assignment condition --- plugins/pbr_preview/pbr_preview.js | 200 +- src/pbr_preview/changelog.mjs | 108 + src/pbr_preview/package.json | 2 +- src/pbr_preview/src/constants.ts | 71 + src/pbr_preview/src/deps.ts | 7 + src/pbr_preview/src/index.ts | 2322 +---------------- src/pbr_preview/src/lib/Lightr.ts | 135 + src/pbr_preview/src/lib/MaterialBrush.ts | 74 + src/pbr_preview/src/lib/PbrMaterials.ts | 898 +++++++ .../src/lib/actions/bakeTextures.ts | 81 + .../src/lib/actions/channelAssignment.ts | 183 ++ .../src/lib/actions/generateNormal.ts | 50 + src/pbr_preview/src/lib/actions/index.ts | 10 + src/pbr_preview/src/lib/actions/labPbr.ts | 118 + .../src/lib/actions/materialTexture.ts | 88 + src/pbr_preview/src/lib/actions/mer.ts | 89 + src/pbr_preview/src/lib/actions/textureSet.ts | 259 ++ .../src/lib/actions/toggleLights.ts | 38 + src/pbr_preview/src/lib/actions/togglePbr.ts | 69 + .../src/lib/actions/tonemapping.ts | 97 + src/pbr_preview/src/lib/applyPbrMaterial.ts | 58 + src/pbr_preview/src/lib/bakery.ts | 119 + src/pbr_preview/src/lib/disablePbr.ts | 36 + src/pbr_preview/src/lib/mer.ts | 61 + src/pbr_preview/src/lib/panels/channels.ts | 165 ++ src/pbr_preview/src/lib/panels/index.ts | 3 + .../src/lib/panels/materialBrush.ts | 47 + src/pbr_preview/src/lib/panels/pbrSettings.ts | 43 + src/pbr_preview/src/lib/properties.ts | 53 + src/pbr_preview/src/lib/tools/index.ts | 1 + .../src/lib/tools/materialBrush.ts | 623 +++++ src/pbr_preview/src/types.d.ts | 76 + 32 files changed, 3878 insertions(+), 2306 deletions(-) create mode 100644 src/pbr_preview/changelog.mjs create mode 100644 src/pbr_preview/src/constants.ts create mode 100644 src/pbr_preview/src/deps.ts create mode 100644 src/pbr_preview/src/lib/Lightr.ts create mode 100644 src/pbr_preview/src/lib/MaterialBrush.ts create mode 100644 src/pbr_preview/src/lib/PbrMaterials.ts create mode 100644 src/pbr_preview/src/lib/actions/bakeTextures.ts create mode 100644 src/pbr_preview/src/lib/actions/channelAssignment.ts create mode 100644 src/pbr_preview/src/lib/actions/generateNormal.ts create mode 100644 src/pbr_preview/src/lib/actions/index.ts create mode 100644 src/pbr_preview/src/lib/actions/labPbr.ts create mode 100644 src/pbr_preview/src/lib/actions/materialTexture.ts create mode 100644 src/pbr_preview/src/lib/actions/mer.ts create mode 100644 src/pbr_preview/src/lib/actions/textureSet.ts create mode 100644 src/pbr_preview/src/lib/actions/toggleLights.ts create mode 100644 src/pbr_preview/src/lib/actions/togglePbr.ts create mode 100644 src/pbr_preview/src/lib/actions/tonemapping.ts create mode 100644 src/pbr_preview/src/lib/applyPbrMaterial.ts create mode 100644 src/pbr_preview/src/lib/bakery.ts create mode 100644 src/pbr_preview/src/lib/disablePbr.ts create mode 100644 src/pbr_preview/src/lib/mer.ts create mode 100644 src/pbr_preview/src/lib/panels/channels.ts create mode 100644 src/pbr_preview/src/lib/panels/index.ts create mode 100644 src/pbr_preview/src/lib/panels/materialBrush.ts create mode 100644 src/pbr_preview/src/lib/panels/pbrSettings.ts create mode 100644 src/pbr_preview/src/lib/properties.ts create mode 100644 src/pbr_preview/src/lib/tools/index.ts create mode 100644 src/pbr_preview/src/lib/tools/materialBrush.ts create mode 100644 src/pbr_preview/src/types.d.ts diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index cad54df9..9d438e49 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1 +1,199 @@ -"use strict";(()=>{(()=>{let A,I,N,$,S,U,O,F,E,ee,R,te,ne,G,ae,Q,H,z,re,se,ie,oe,V,me,J,q,X,K,W,Y={},p="pbr_preview",ge="1.0.0",M="_NONE_",l={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new THREE.Color(16777215)},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new THREE.Color(0)},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new THREE.Color(0)},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new THREE.Color(16777215)},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new THREE.Color(16777215)},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new THREE.Color("rgb(128, 128, 255)")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new THREE.Color(16777215)}},Z=(n=!0)=>{let e=Project?Project.textures??Texture.all:Texture.all;return n?e.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):e};class v{constructor(e,t){this._scope=e??Z(),this._materialUuid=t}merToCanvas(){let e=this.getTexture(l.emissive),t=this.getTexture(l.roughness),r=this.getTexture(l.metalness);if(!e&&!t&&!r){let{metalness:a,emissive:s,roughness:o}=this.decodeMer();a&&(r=v.makePixelatedCanvas(a)),s&&(e=v.makePixelatedCanvas(s)),o&&(t=v.makePixelatedCanvas(o))}return{emissiveMap:e,roughnessMap:t,metalnessMap:r}}getMaterial(e={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:a}=this.merToCanvas(),s=new THREE.MeshStandardMaterial({map:this.getTexture(l.albedo)??v.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(i=>i.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(l.ao),bumpMap:this.getTexture(l.height),metalnessMap:a,metalness:a?1:0,roughnessMap:r,roughness:1,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:1,alphaTest:.5,...e}),o=this.getTexture(l.normal);return o&&(s.normalMap=o,s.normalScale=new THREE.Vector2(1,1)),s}saveTexture(e,t){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][e.id]=t.uuid,t.extend({channel:e.id}))}findTexture(e,t=!0){if(!Project)return null;let r=this._scope.find(i=>i.channel&&(i.channel===e||i.channel===e.id));if(r)return r;let a=typeof e=="string"?e:e.id;Project.pbr_materials??={};let s=Project.pbr_materials[this._materialUuid];if(!s&&t&&a!==M){let i=new RegExp(`_*${a}(.[^.]+)?$`,"i");return this._scope.find(f=>i.test(f.name))??null}let o=s?.[a];return o?this._scope.find(i=>i.uuid===o)??null:null}static makePixelatedCanvas(e){let t=new THREE.CanvasTexture(e,void 0,void 0,void 0,THREE.NearestFilter,THREE.NearestFilter);return t.needsUpdate=!0,t}getTexture(e){let t=this.findTexture(e);return t?v.makePixelatedCanvas(t.canvas):null}static extractChannel(e,t){let r=e.canvas,a=r.width,s=r.height,o=r.getContext("2d");if(!o||!a||!s)return null;let i=document.createElement("canvas");i.width=a,i.height=s;let f=i.getContext("2d");if(!f)return null;let h={r:0,g:1,b:2,a:3}[t],{data:g}=o.getImageData(0,0,a,s),c=new Uint8ClampedArray(a*s*4);for(let d=0;de){b[x]=w.data[x],b[x+1]=w.data[x+1],b[x+2]=w.data[x+2],b[x+3]=255;continue}b[x]=0,b[x+1]=0,b[x+2]=0,b[x+3]=255}return h.putImageData(new ImageData(b,i.width,i.height),0,0),{metalness:r,emissive:i,emissiveLevel:a,roughness:s,sss:o}}createMer(e=!1){let t=this.findTexture(l.metalness,e),r=this.findTexture(l.emissive,e),a=this.findTexture(l.roughness,e),s=this.findTexture("sss",!1),o=Math.max(t?.img.width??0,r?.img.width??0,a?.img.width??0,Project?Project.texture_width:0,16),i=Math.max(t?.img.height??0,r?.img.height??0,a?.img.height??0,Project?Project.texture_height:0,16),f=document.createElement("canvas");f.width=o,f.height=i;let h=f.getContext("2d");if(!h)return null;let g=t?.img?v.extractChannel(t,"r"):null,c=r?.img?v.extractChannel(r,"g"):null,w=a?.img?v.extractChannel(a,"b"):null,d=s&&s?.img?v.extractChannel(s,"a"):null,b=g?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),x=c?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),u=w?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(o,i),m=d?.getContext("2d")?.getImageData(0,0,o,i)??new ImageData(new Uint8ClampedArray(o*i*4).fill(255),o,i),_=new Uint8ClampedArray(o*i*4);for(let T=0;T<_.length;T+=4)_[T]=b.data[T],_[T+1]=x.data[T],_[T+2]=u.data[T],_[T+3]=m.data[T];return h.putImageData(new ImageData(_,o,i),0,0),f}static createNormalMap(e,t=!1){let r=e.canvas.getContext("2d");if(!r)return null;let a=Math.max(e.img.width??e.canvas.width,Project?Project.texture_width:0,16),s=Math.max(e.img.height??e.canvas.height,Project?Project.texture_height:0,16),{data:o}=r.getImageData(0,0,a,s),i=document.createElement("canvas"),f=i.getContext("2d");if(!f)return null;let h=(u,m)=>{let _=(u+m*a)*4;return o[_]/255};i.width=a,i.height=s,f.drawImage(e.img,0,0,a,s);let g=f.getImageData(0,0,a,s),c=g.data,w=u=>{let m=Math.sqrt(u[0]*u[0]+u[1]*u[1]+u[2]*u[2]);return[u[0]/m,u[1]/m,u[2]/m]};for(let u=0;u[t,l[t].default??new THREE.Color(4294967040)])),...e}}get colors(){return this._colors}set colors(e){this._colors={...this._colors,...e}}getChannel(e){return this._colors[e]}static makeLinearColor(e){let t=Math.min(1,Math.max(0,e));return new THREE.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let e=Number(J.get()),t=Number(q.get()),r=X.get().toString(),a=Number(K.get()),s=ColorPanel.get(),o={[l.albedo.id]:new THREE.Color(s),[l.metalness.id]:k.makeLinearColor(e),[l.roughness.id]:k.makeLinearColor(t),[l.emissive.id]:new THREE.Color(r??"#000000"),[l.height.id]:k.makeLinearColor(a),[l.normal.id]:l.normal.default??new THREE.Color("#8080ff")};return new k({colors:o})}}class pe{constructor({lightHeight:e=.66,ambientLight:t=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:a=[1,1,1]}={}){this.lightHeight=e,this.ambientLight=t,this.minLightIntensity=r,this.lightDiffuse=a}bake(e,t,r){let a=t instanceof HTMLCanvasElement?t:this.createCanvas(t.width,t.height),s=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),o=a.getContext("2d"),i=s.getContext("2d");o.drawImage(t,0,0),i.drawImage(r,0,0);let f=o.getImageData(0,0,t.width,t.height),h=i.getImageData(0,0,r.width,r.height),g=[],c=[];for(let d=0;d{let b=this.createCanvas(t.width,t.height),x=b.getContext("2d"),u=x.getImageData(0,0,b.width,b.height),m=[Math.cos(d),Math.sin(d),this.lightHeight];for(let _=0;_l[n].id),label:"PBR Channel",exposed:!1}),te=new Property(Texture,"enum","channel",{default:M,values:Object.keys(l).map(n=>l[n].id),label:"PBR Channel",exposed:!1}),re=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),se=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),ie=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"});let le=(n,e)=>{let t=Project?Project.selected_texture:Texture.all.find(a=>a.selected);if(!t)return;let r=new v(t.layers_enabled?t.layers:Project?Project.textures:null,t.uuid).createMer(!1);r&&r.toBlob(async a=>{if(!a)return;let[s,o]=Project?[n?`${n}_mer`:`${t.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await a.arrayBuffer(),type:"PNG",name:s,extensions:["png"],resource_id:"mer",savetype:"image",startpath:o},e)})},y=n=>{if(!Project||Texture.all.length===0)return;let e=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(r=>{let s=t.faces[r].getTexture();if(!s)return;let o=Project.materials[s.uuid];o.isShaderMaterial&&!Project.bb_materials[s.uuid]&&(Project.bb_materials[s.uuid]=o);let i=new v(s.layers_enabled?s.layers.filter(f=>f.visible)??null:Project.textures,s.uuid).getMaterial(n);Project.materials[s.uuid]=THREE.ShaderMaterial.prototype.copy.call(i,o),Canvas.updateAllFaces(s),e=!0})}),Project.pbr_active=e},fe=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(n=>{n instanceof Cube&&Object.keys(n.faces).forEach(e=>{let r=n.faces[e].getTexture();if(!r)return;let a=Project.bb_materials[r.uuid];a&&(Project.materials[r.uuid]=a)})}),Project.pbr_active=!1,Canvas.updateAll())},ce=(n,e)=>{let t=e??document.createElement("canvas"),r=t.getContext("2d");if(!r)return null;let a=Math.max(Project?Project.texture_width:16,16),s=Math.max(Project?Project.texture_height:16,16);return t.width=a,t.height=s,r.fillStyle=`rgb(${n.r*255}, ${n.g*255}, ${n.b*255})`,r.fillRect(0,0,a,s),t.toDataURL()},xe=(n,e=8,t=!1)=>{if(!Project)return;let r=Project.selected_texture;if(!r)return;let a=new v(r.layers_enabled?r.layers:Project.textures,r.uuid),s=a.findTexture(l.albedo),o=a.findTexture(l.normal);if(!s||!o)return;let f=new pe(n).bake(e,s.canvas,o.canvas),h=new Texture({name:`${s.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(f[0].toDataURL()),g=t?c=>{let w=a.findTexture(l.emissive);if(!w)return c;let d=w.canvas;if(!d.getContext("2d"))return c;let x=Math.max(c.width,d.width,Project?Project.texture_width:16),u=Math.max(c.height,d.height,Project?Project.texture_height:16),m=document.createElement("canvas");m.width=x,m.height=u;let _=m.getContext("2d");return _?(_.drawImage(c,0,0),_.globalCompositeOperation="screen",_.drawImage(d,0,0),m):c}:c=>c;f.forEach((c,w)=>{new TextureLayer({name:`baked_${w+1}`,data_url:g(c).toDataURL()},h).addForEditing()}),h.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)},be=()=>{if(!Project)return;let n=Z();Project.textures.forEach(e=>{let t=new v(n,e.uuid),r=t.findTexture(l.normal,!1),a=t.findTexture(l.height,!1),s=t.findTexture(l.albedo,!1),o=t.findTexture(l.metalness,!1)?.name,i=t.findTexture(l.emissive,!1)?.name,f=t.findTexture(l.roughness,!1)?.name,h={};return s||(h.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!i&&!f&&(h.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},h.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},h.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),r&&(h.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),a&&(h.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),r&&a&&(h.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),R=new Dialog(`${p}_texture_set`,{id:`${p}_texture_set`,title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:h,onConfirm(g){let c=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),w=o||i||f,d={format_version:"1.16.100","minecraft:texture_set":{color:(s?c:g.baseColor?.toHexString())??c,metalness_emissive_roughness:[g.metalness??0,g.emissive??0,g.roughness??255]}};g.depthMap==="normal"&&r||!a&&r?d["minecraft:texture_set"].normal=`${c}_normal`:(!r||g.depthMap==="heightmap")&&a&&(d["minecraft:texture_set"].heightmap=`${c}_heightmap`);let b=m=>{if(!g.depthMap)return m();let _=g.depthMap==="normal"||g.depthMap&&!a,T=_?r:a;if(!T)return m();Blockbench.export({content:T.canvas.toDataURL()??"",type:"PNG",name:`${c}_${_?"normal":"heightmap"}`,extensions:["png"],resource_id:g.depthMap,startpath:Project.export_path,savetype:"image"},j=>{d["minecraft:texture_set"][_?"normal":"heightmap"]=pathToName(j,!1),m()})},x=m=>{if(!s)return m();Blockbench.export({content:s.canvas.toDataURL(),extensions:["png"],type:"PNG",name:c,startpath:Project.export_path,savetype:"image"},_=>{d["minecraft:texture_set"].color=pathToName(_,!1),m()})},u=()=>b(()=>{x(()=>{Blockbench.export({content:JSON.stringify(d,null,2),type:"JSON",name:`${c}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),R.hide()})})});if(w){le(c,m=>{d["minecraft:texture_set"].metalness_emissive_roughness=pathToName(m,!1),u()});return}u()},cancelIndex:1}),R.show(),R})},ue=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],de=()=>Project&&Project.pbr_active&&y(),_e=()=>{ue.forEach(n=>{Blockbench.addListener(n,de)})},he=()=>{ue.forEach(n=>{Blockbench.removeListener(n,de)})},ve=()=>{H=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:THREE.NoToneMapping,value:Preview.selected.renderer.toneMapping??THREE.NoToneMapping,icon:"monochrome_photos",options:{[THREE.NoToneMapping]:"None",[THREE.LinearToneMapping]:"Linear",[THREE.ReinhardToneMapping]:"Reinhard",[THREE.CineonToneMapping]:"Cineon",[THREE.ACESFilmicToneMapping]:"ACES"},onChange({value:n}){let e=Number(Q.get());Preview.all.forEach(t=>{t.renderer.toneMapping=Number(n),t.renderer.toneMappingExposure=e}),Preview.selected.renderer.toneMapping=Number(n),Preview.selected.renderer.toneMappingExposure=e,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(n)}`,2e3),E.value||E.set(!0),y()}}),Q=new BarSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",step:.1,min:-2,max:2,onBefore(){Number(H.get())===THREE.NoToneMapping&&H.change(THREE.LinearToneMapping.toString()),E.set(!0)},onChange({value:n}){let e=Math.max(-2,Math.min(2,Number(n)));Preview.all.forEach(t=>{t.renderer.toneMappingExposure=e}),Preview.selected.renderer.toneMappingExposure=e},onAfter(){y()}}),F=new Dialog(`${p}_bake_textures`,{id:`${p}_bake_textures`,title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(n){let e=new THREE.Color(n.ambientLight.toString()),t=new THREE.Color(n.lightDiffuse.toString());xe({ambientLight:[e.r,e.g,e.b],lightDiffuse:[t.r,t.g,t.b],lightHeight:Number(n.lightHeight),minLightIntensity:Number(n.minLightIntensity)},n.directions??8,n.blendEmissive??!1)}}),O=new Action(`${p}_bake_textures`,{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){F.show()}}),$=new Action(`${p}_generate_normal`,{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(n=>n.selected))!==void 0,click(){let n=TextureLayer.selected??(Project&&Project.selected_texture?Project.selected_texture.selected_layer??Project.selected_texture:Texture.getDefault());if(!n)return;let e=new v(n instanceof Texture&&n.layers_enabled?n.layers:Z(),n.uuid),t=v.createNormalMap(n);if(t){e.saveTexture(l.normal,t),t.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),N=new Action(`${p}_create_mer`,{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock_block","bedrock_entity"],project:!0},click(){le()}}),A=new Action(`${p}_decode_mer`,{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",condition:()=>!!Project&&Project.selected_texture!==null&&!Project.selected_texture.layers_enabled,click(){let n=TextureLayer.selected?.texture??Texture.all.find(a=>a.selected)??Texture.getDefault(),e=new v(n.layers_enabled?n.layers:[n],n.uuid),t=e.decodeMer(),r=[l.metalness,l.emissive,l.roughness];Undo.initEdit({textures:[n]}),n.activateLayers(!0),r.forEach(a=>{let s=a.id,o=t[s];if(!o){Blockbench.showStatusMessage(`Failed to decode ${a.label} channel`,3e3);return}let i=new TextureLayer({name:`${n?.name}_${s}`,data_url:o.toDataURL()},n);e.saveTexture(a,i),i.addForEditing()}),Undo.finishEdit("Decode MER")}}),I=new Action(`${p}_create_texture_set`,{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){be()},condition:{formats:["bedrock_block","bedrock_entity"],project:!0}}),U=new Action(`${p}_create_material_texture`,{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",click(){if(!Project)return;let n=new Texture({name:"New Material",saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}),e=ce(new THREE.Color(8421504));e&&(n.fromDataURL(e).add().select(),Object.keys(l).forEach(t=>{let r=l[t],a=new TextureLayer({name:r.label,visible:!0},n);a.setSize(Project.texture_width??n.width,Project.texture_height??n.height);let s=ce(r.default??new THREE.Color(0),a.canvas);s&&a.texture.fromDataURL(s),a.extend({channel:r.id}),a.addForEditing()}))}}),Object.entries(l).forEach(([n,e])=>{Y[n]=new Action(`${p}_assign_channel_${n}`,{icon:e.icon??"tv_options_edit_channels",name:`Assign to ${e.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${e.label} channel`,category:"textures",condition:()=>Modes.paint&&(TextureLayer.selected||Project&&Project.selected_texture!==null),click(t){let r=TextureLayer.selected??(Project?Project.selected_texture:null);if(!r||!Project)return;Undo.initEdit({layers:[r]}),r.extend({channel:e.id});let a=r instanceof TextureLayer?r.texture:r;a.updateChangesAfterEdit(),Project.pbr_materials[a.uuid]||(Project.pbr_materials[a.uuid]={}),Object.entries(Project.pbr_materials[a.uuid]).forEach(([s,o])=>{o===r.uuid&&(delete Project.pbr_materials[a.uuid][s],r.channel=M)}),Project.pbr_materials[a.uuid][n]=r.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${r.name}" to ${e.label} channel`,2e3),y()}})}),S=new Action(`${p}_unassign_channel`,{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:()=>{if(!Modes.paint)return!1;if(TextureLayer.selected)return TextureLayer.selected.channel!==M||!TextureLayer.selected.channel;if(!Project)return!1;let n=Project.selected_texture;return n!==null&&(n.channel!==M||!n.channel)},click(){let n=TextureLayer.selected??(Project?Project.selected_texture:null);if(!n||!Project)return;Undo.initEdit({layers:[n]});let e=n instanceof TextureLayer?n.texture:n,t=n.channel;Project.pbr_materials[e.uuid]={},n.channel=M,e.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${n.name}" from ${t} channel`,2e3),y()}}),E=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(n){if(n){y(),_e(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}fe(),he(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),z=new Toggle(`${p}_correct_lights`,{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(n){Preview.all.forEach(e=>{e.renderer.physicallyCorrectLights=n}),Preview.selected.renderer.physicallyCorrectLights=n,Blockbench.showQuickMessage(`Physically corrected lighting is now ${n?"enabled":"disabled"}`,2e3),n&&E.set(!0),y()},click(){}}),J=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",settings:{min:0,max:1,step:.01,default:0},condition:()=>{if(!Project)return!1;let n=Project.selected_texture;return n?.layers_enabled?n.layers.find(({channel:e})=>e===l.metalness.id)!==void 0:!1}}),q=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",settings:{min:0,max:1,step:.01,default:1},condition:()=>{if(!Project)return!1;let n=Project.selected_texture;return n?.layers_enabled?n.layers.find(({channel:e})=>e===l.roughness.id)!==void 0:!1}}),X=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",condition:()=>{if(!Project)return!1;let n=Project.selected_texture;return n?.layers_enabled?n.layers.find(({channel:e})=>e===l.emissive.id)!==void 0:!1}}),K=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",settings:{min:0,max:1,step:.01,default:.5},condition:()=>{if(!Project)return!1;let n=Project.selected_texture;return n?.layers_enabled?n.layers.find(({channel:e})=>e===l.height.id)!==void 0:!1}}),V=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",condition:()=>Modes.paint&&!!Project&&Project.selected_texture&&Project.selected_texture.layers_enabled,brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(n,e,t,r,{size:a,softness:s,texture:o}){let i=k.fromSettings(),f=Object.keys(i.colors),h=t;return o.layers.forEach(g=>{if(!g.visible||!f.includes(g.channel))return;let c=i.getChannel(g.channel);c&&(g.ctx.fillStyle=c.getStyle(),g.ctx.fillRect(a*n,a*e,a,a),g.selected&&(h={r:c.r*255,g:c.g*255,b:c.b*255,a:r*255}))}),h}},onCanvasClick(n){Painter.startPaintToolCanvas(n,n.event)},onSelect(){y()},click(){y()}}),G=new Menu(`${p}_channel_menu`,[...Object.keys(l).map(n=>`${p}_assign_channel_${n}`),`${p}_unassign_channel`],{onOpen(){y()}}),W=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",click(n){G.open(n)},children:[...Object.values(Y),S]}),ae=new Action(`${p}_show_channel_menu`,{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:()=>Modes.paint&&(TextureLayer.selected||Project&&Project.selected_texture!==null),click(n){G.open(n)}}),ee=new Panel(`${p}_display_settings`,{name:"PBR Settings",id:`${p}_display_settings_panel`,icon:"display_settings",toolbars:[new Toolbar(`${p}_controls_toolbar`,{id:`${p}_controls_toolbar`,children:["toggle_pbr",`${p}_correct_lights`,`${p}_create_material_texture`,`${p}_show_channel_menu`],name:"PBR"}),new Toolbar(`${p}_display_settings_toolbar`,{id:`${p}_display_settings_toolbar`,children:["display_settings_tone_mapping","display_settings_exposure"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"}),oe=new Panel(`${p}_material_brush_panel`,{name:"Material Brush",id:`${p}_material_brush_panel`,icon:"view_in_ar",toolbars:[new Toolbar(`${p}_material_brush_toolbar`,{id:`${p}_material_brush_toolbar`,children:["material_brush","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Brush"})],display_condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"}),MenuBar.addAction(N,"file.export"),MenuBar.addAction($,"tools"),MenuBar.addAction(A,"tools"),MenuBar.addAction(I,"file.export"),MenuBar.addAction(E,"view"),MenuBar.addAction(z,"preview"),MenuBar.addAction(U,"tools"),MenuBar.addAction(O,"tools"),MenuBar.addAction(V,"tools.0"),MenuBar.addAction(W,"image.0")},Te=()=>{Object.entries(Y).forEach(([n,e])=>{e.delete()}),MenuBar.removeAction(`file.export.${p}_create_mer`),MenuBar.removeAction(`file.export.${p}_create_texture_set`),MenuBar.removeAction(`tools.${p}_generate_normal`),he(),ee?.delete(),R?.delete(),U?.delete(),N?.delete(),$?.delete(),E?.delete(),A?.delete(),O?.delete(),F?.delete(),I?.delete(),te?.delete(),ne?.delete(),ae?.delete(),Q?.delete(),H?.delete(),z?.delete(),S?.delete(),se?.delete(),re?.delete(),ie?.delete(),V?.delete(),oe?.delete(),me?.delete(),J?.delete(),q?.delete(),X?.delete(),K?.delete(),W?.delete()};BBPlugin.register(p,{version:ge,title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.1",onload:ve,onunload:Te})})();})(); +"use strict";(()=>{var b=THREE,I=Vue,ke=Blockbench;var B="_NONE_",m={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new b.Color(16777215)},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new b.Color(0)},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new b.Color(0)},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new b.Color(16777215)},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new b.Color(16777215)},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new b.Color("rgb(128, 128, 255)")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new b.Color(16777215)}},s={},y=[],E=[];y.push(()=>{s.channelProp=new Property(TextureLayer,"enum","channel",{default:B,values:Object.keys(m).map(t=>m[t].id),label:"PBR Channel",exposed:!1}),s.textureChannelProp=new Property(Texture,"enum","channel",{default:B,values:Object.keys(m).map(t=>m[t].id),label:"PBR Channel",exposed:!1}),s.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),s.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),s.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"})});var be=(t=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return t?a.filter(e=>e.layers_enabled&&e.layers.length>0).flatMap(e=>e.layers):a},k=class t{constructor(a,e){this._scope=a??be(),this._materialUuid=e}merToCanvas(){let a=this.getTexture(m.emissive),e=this.getTexture(m.roughness),r=this.getTexture(m.metalness);if(!a&&!e&&!r){let{metalness:n,emissive:o,roughness:l}=this.decodeMer();n&&(r=t.makePixelatedCanvas(n)),o&&(a=t.makePixelatedCanvas(o)),l&&(e=t.makePixelatedCanvas(l))}return{emissiveMap:a,roughnessMap:e,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:e,roughnessMap:r,metalnessMap:n}=this.merToCanvas(),o=this.getTexture(m.normal);return new b.MeshStandardMaterial({map:this.getTexture(m.albedo)??t.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(l=>l.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(m.ao),bumpMap:this.getTexture(m.height),normalMap:o,normalScale:new b.Vector2(1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:e,emissiveIntensity:e?1:0,emissive:e?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.5,...a})}saveTexture(a,e){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=e.uuid,e.extend({channel:a.id}))}findTexture(a,e=!0){if(!Project)return null;let r=this._scope.find(i=>i.channel&&(i.channel===a||i.channel===a.id));if(r)return r;let n=typeof a=="string"?a:a.id;Project.pbr_materials??={};let o=Project.pbr_materials[this._materialUuid];if(!o&&e&&n!==B){let i=new RegExp(`_*${n}(.[^.]+)?$`,"i");return this._scope.find(g=>i.test(g.name))??null}let l=o?.[n];return l?this._scope.find(i=>i.uuid===l)??null:null}static makePixelatedCanvas(a){let e=new b.CanvasTexture(a,void 0,void 0,void 0,b.NearestFilter,b.NearestFilter);return e.needsUpdate=!0,e}getTexture(a){let e=this.findTexture(a);return e?t.makePixelatedCanvas(e.canvas):null}static extractChannel(a,e){let r=a.canvas,n=r.width,o=r.height,l=r.getContext("2d");if(!l||!n||!o)return null;let i=document.createElement("canvas");i.width=n,i.height=o;let g=i.getContext("2d");if(!g)return null;let f={r:0,g:1,b:2,a:3}[e],{data:p}=l.getImageData(0,0,n,o),u=new Uint8ClampedArray(n*o*4);for(let x=0;xa){_[d]=v.data[d],_[d+1]=v.data[d+1],_[d+2]=v.data[d+2],_[d+3]=255;continue}_[d]=0,_[d+1]=0,_[d+2]=0,_[d+3]=255}return f.putImageData(new ImageData(_,i.width,i.height),0,0),{metalness:r,emissive:i,emissiveLevel:n,roughness:o,sss:l}}createMer(a=!1){let e=this.findTexture(m.metalness,a),r=this.findTexture(m.emissive,a),n=this.findTexture(m.roughness,a),o=this.findTexture("sss",!1),l=Math.max(e?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),i=Math.max(e?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),g=document.createElement("canvas");g.width=l,g.height=i;let f=g.getContext("2d");if(!f)return null;let p=e?.img?t.extractChannel(e,"r"):null,u=r?.img?t.extractChannel(r,"g"):null,v=n?.img?t.extractChannel(n,"b"):null,x=o&&o?.img?t.extractChannel(o,"a"):null,_=p?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(l,i),d=u?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(l,i),c=v?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(l,i),h=x?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(new Uint8ClampedArray(l*i*4).fill(255),l,i),w=new Uint8ClampedArray(l*i*4);for(let C=0;C{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),e}createTexturesFromNormal(a){let e=this.decodeLabPbrNormal(a);return Object.entries(e).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),e}createNormalMap(a,e=!1){let r=a.canvas.getContext("2d");if(!r)return null;let n=Math.max(a.img.width??a.canvas.width,Project?Project.texture_width:0,16),o=Math.max(a.img.height??a.canvas.height,Project?Project.texture_height:0,16),{data:l}=r.getImageData(0,0,n,o),i=document.createElement("canvas"),g=i.getContext("2d");if(!g)return null;let f=(c,h)=>{let w=(c+h*n)*4;return l[w]/255};i.width=n,i.height=o,g.drawImage(a.img,0,0,n,o);let p=g.getImageData(0,0,n,o),u=p.data,v=c=>{let h=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);return[c[0]/h,c[1]/h,c[2]/h]};for(let c=0;c{let _=this.createCanvas(e.width,e.height),d=_.getContext("2d"),c=d.getImageData(0,0,_.width,_.height),h=[Math.cos(x),Math.sin(x),this.lightHeight];for(let w=0;w{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new k(r.layers_enabled?r.layers:Project.textures,r.uuid),o=n.findTexture(m.albedo);if(!o){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let l=n.findTexture(m.normal);if(!l){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let g=new H(t).bake(a,o.canvas,l.canvas),f=new Texture({name:`${o.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(g[0].toDataURL()),p=e?u=>{let v=n.findTexture(m.emissive);if(!v)return u;let x=v.canvas;if(!x.getContext("2d"))return u;let d=Math.max(u.width,x.width,Project?Project.texture_width:16),c=Math.max(u.height,x.height,Project?Project.texture_height:16),h=document.createElement("canvas");h.width=d,h.height=c;let w=h.getContext("2d");return w?(w.drawImage(u,0,0),w.globalCompositeOperation="screen",w.drawImage(x,0,0),h):u}:u=>u;g.forEach((u,v)=>{new TextureLayer({name:`baked_${v+1}`,data_url:p(u).toDataURL()},f).addForEditing()}),f.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};y.push(()=>{s.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(t){let a=new b.Color(t.ambientLight.toString()),e=new b.Color(t.lightDiffuse.toString());V({ambientLight:[a.r,a.g,a.b],lightDiffuse:[e.r,e.g,e.b],lightHeight:Number(t.lightHeight),minLightIntensity:Number(t.minLightIntensity)},t.directions??8,t.blendEmissive??!1)}}),s.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){s.bakeTexturesDialog?.show()}}),MenuBar.addAction(s.bakeTexturesAction,"tools")});E.push(()=>{MenuBar.removeAction("tools.bake_textures")});var S=t=>{if(!Project||Texture.all.length===0)return;let a=!1;Project.elements.forEach(e=>{e instanceof Cube&&Object.keys(e.faces).forEach(r=>{let o=e.faces[r].getTexture();if(!o)return;let l=Project.materials[o.uuid];l.isShaderMaterial&&!Project.bb_materials[o.uuid]&&(Project.bb_materials[o.uuid]=l);let i=new k(o.layers_enabled?o.layers.filter(g=>g.visible)??null:Project.textures,o.uuid).getMaterial(t);Project.materials[o.uuid]=b.ShaderMaterial.prototype.copy.call(i,l),Canvas.updateAllFaces(o),a=!0})}),Project.pbr_active=a};var $={},J=Condition(()=>Modes.paint&&(TextureLayer.selected||Project&&Project.selected_texture!==null));function _e(){Object.entries(m).forEach(([t,a])=>{$[t]=new Action(`assign_channel_${t}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:J,click(e){let r=TextureLayer.selected??(Project?Project.selected_texture:null);if(!r||!Project)return;Undo.initEdit({layers:[r]}),r.extend({channel:a.id});let n=r instanceof TextureLayer?r.texture:r;n.updateChangesAfterEdit(),Project.pbr_materials[n.uuid]||(Project.pbr_materials[n.uuid]={}),Object.entries(Project.pbr_materials[n.uuid]).forEach(([o,l])=>{l===r.uuid&&(delete Project.pbr_materials[n.uuid][o],r.channel=B)}),Project.pbr_materials[n.uuid][t]=r.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${r.name}" to ${a.label} channel`,2e3),S()}})})}function ve(){Object.entries($).forEach(([t,a])=>{a.delete()})}y.push(_e);E.push(ve);y.push(()=>{s.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:()=>{if(!Modes.paint)return!1;if(TextureLayer.selected)return TextureLayer.selected.channel!==B||!TextureLayer.selected.channel;if(!Project)return!1;let t=Project.selected_texture;return t!==null&&t.channel!==B&&t.channel},click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t||!Project)return;Undo.initEdit({layers:[t]});let a=t instanceof TextureLayer?t.texture:t,e=t.channel;Project.pbr_materials[a.uuid]={},t.channel=B,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${t.name}" from ${e} channel`,2e3),S()}}),s.channelMenu=new Menu("channel_menu",[...Object.keys(m).map(t=>`assign_channel_${t}`),"unassign_channel"],{onOpen(){S()}}),s.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",click(t){s.channelMenu?.open(t)},children:[...Object.values($),s.unassignChannel]}),s.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:J,click(t){s.channelMenu?.open(t)}})});y.push(()=>{s.openChannelMenu&&MenuBar.addAction(s.openChannelMenu,"image.0")});E.push(()=>{MenuBar.removeAction("image.pbr_channel_menu")});y.push(()=>{s.generateNormal=new Action("generate_normal",{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(t=>t.selected))!==void 0,click(){let t=TextureLayer.selected??(Project&&Project.selected_texture?Project.selected_texture.selected_layer??Project.selected_texture:Texture.getDefault());if(!t)return;let a=new k(t instanceof Texture&&t.layers_enabled?t.layers:null,t.uuid),e=a.createNormalMap(t);if(e){a.saveTexture(m.normal,e),e.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),MenuBar.addAction(s.generateNormal,"tools")});E.push(()=>{MenuBar.removeAction("tools.generate_normal")});var W=(t,a)=>{let e=a??document.createElement("canvas"),r=e.getContext("2d");if(!r)return null;let n=Math.max(Project?Project.texture_width:16,16),o=Math.max(Project?Project.texture_height:16,16);return e.width=n,e.height=o,r.fillStyle=`rgb(${t.r*255}, ${t.g*255}, ${t.b*255})`,r.fillRect(0,0,n,o),e.toDataURL()};y.push(()=>{s.createMaterialTexture=new Action("create_material_texture",{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",click(){if(!Project)return;let t=new Texture({name:"New Material",saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}),a=W(new b.Color(8421504));a&&(t.fromDataURL(a).add().select(),Object.keys(m).forEach(e=>{let r=m[e],n=new TextureLayer({name:r.label,visible:!0},t);n.setSize(Project.texture_width??t.width,Project.texture_height??t.height);let o=W(r.default??new b.Color(0),n.canvas);o&&n.texture.fromDataURL(o),n.extend({channel:r.id}),n.addForEditing()}))}}),MenuBar.addAction(s.createMaterialTexture,"tools")});E.push(()=>{MenuBar.removeAction("tools.create_material_texture")});var R=(t,a)=>{let e=Project?Project.selected_texture:Texture.all.find(n=>n.selected);if(!e)return;let r=new k(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!1);r&&r.toBlob(async n=>{if(!n)return;let[o,l]=Project?[t?`${t}_mer`:`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:o,extensions:["png"],resource_id:"mer",savetype:"image",startpath:l},a)})};function we(){s.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock_block","bedrock_entity"],project:!0},click(){R()}}),s.decodeMer=new Action("decode_mer",{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",condition:()=>!!Project&&Project.selected_texture!==null&&!Project.selected_texture.layers_enabled,click(){let t=TextureLayer.selected?.texture??Texture.all.find(n=>n.selected)??Texture.getDefault(),a=new k(t.layers_enabled?t.layers:[t],t.uuid),e=a.decodeMer(),r=[m.metalness,m.emissive,m.roughness];Undo.initEdit({textures:[t]}),t.activateLayers(!0),r.forEach(n=>{let o=n.id,l=e[o];if(!l){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let i=new TextureLayer({name:`${t?.name}_${o}`,data_url:l.toDataURL()},t);a.saveTexture(n,i),i.addForEditing()}),Undo.finishEdit("Decode MER")}}),MenuBar.addAction(s.decodeMer,"tools"),MenuBar.addAction(s.generateMer,"file.export")}function ye(){MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")}y.push(we);E.push(ye);var Ce=()=>{Project&&Project.textures.forEach(t=>{let a=new k(null,t.uuid),e=a.findTexture(m.normal,!1),r=a.findTexture(m.height,!1),n=a.findTexture(m.albedo,!1),o=a.findTexture(m.metalness,!1)?.name,l=a.findTexture(m.emissive,!1)?.name,i=a.findTexture(m.roughness,!1)?.name,g={};return n||(g.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!l&&!i&&(g.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},g.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},g.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),e&&(g.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(g.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),e&&r&&(g.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),s.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:g,onConfirm(f){let p=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),u=o||l||i,v={format_version:"1.16.100","minecraft:texture_set":{color:(n?p:f.baseColor?.toHexString())??p,metalness_emissive_roughness:[f.metalness??0,f.emissive??0,f.roughness??255]}};f.depthMap==="normal"&&e||!r&&e?v["minecraft:texture_set"].normal=`${p}_normal`:(!e||f.depthMap==="heightmap")&&r&&(v["minecraft:texture_set"].heightmap=`${p}_heightmap`);let x=c=>{if(!f.depthMap)return c();let h=f.depthMap==="normal"||f.depthMap&&!r,w=h?e:r;if(!w)return c();Blockbench.export({content:w.canvas.toDataURL()??"",type:"PNG",name:`${p}_${h?"normal":"heightmap"}`,extensions:["png"],resource_id:f.depthMap,startpath:Project.export_path,savetype:"image"},C=>{v["minecraft:texture_set"][h?"normal":"heightmap"]=pathToName(C,!1),c()})},_=c=>{if(!n)return c();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:p,startpath:Project.export_path,savetype:"image"},h=>{v["minecraft:texture_set"].color=pathToName(h,!1),c()})},d=()=>x(()=>{_(()=>{Blockbench.export({content:JSON.stringify(v,null,2),type:"JSON",name:`${p}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),s.textureSetDialog?.hide()})})});if(u){R(p,c=>{v["minecraft:texture_set"].metalness_emissive_roughness=pathToName(c,!1),d()});return}d()},cancelIndex:1}),s.textureSetDialog.show()})};y.push(()=>{s.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){Ce()},condition:{formats:["bedrock_block","bedrock_entity"],project:!0}}),MenuBar.addAction(s.createTextureSet,"file.export")});E.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});y.push(()=>{s.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(t){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=t}),Preview.selected.renderer.physicallyCorrectLights=t,Blockbench.showQuickMessage(`Physically corrected lighting is now ${t?"enabled":"disabled"}`,2e3),t&&s.togglePbr?.set(!0),S()},click(){}}),MenuBar.addAction(s.toggleCorrectLights,"preview")});E.push(()=>{MenuBar.removeAction("preview.correct_lights")});var q=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(a=>{let r=t.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var X=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],K=()=>Project&&Project.pbr_active&&S(),Pe=()=>{X.forEach(t=>{Blockbench.addListener(t,K)})},Y=()=>{X.forEach(t=>{Blockbench.removeListener(t,K)})};y.push(()=>{s.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(t){if(t){S(),Pe(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}q(),Y(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(s.togglePbr,"view")});E.push(()=>{Y(),MenuBar.removeAction("view.toggle_pbr")});var Z=t=>{let a=Math.max(-2,Math.min(2,Number(t)));Preview.all.forEach(e=>{e.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};y.push(()=>{s.exposureSlider=new BarSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",step:.1,min:-2,max:2,onBefore(){Number(s.tonemappingSelect?.get())===b.NoToneMapping&&s.tonemappingSelect.change(b.LinearToneMapping.toString()),s.togglePbr?.set(!0)},onChange({value:t}){Z(t)},onAfter(){S()}}),s.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>s.exposureSlider!==void 0&&Number(s.exposureSlider?.get())!==1,click(){Z(1),s.exposureSlider?.set(1),S()}}),s.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:b.NoToneMapping,value:Preview.selected.renderer.toneMapping??b.NoToneMapping,icon:"monochrome_photos",options:{[b.NoToneMapping]:"No Tone Mapping",[b.LinearToneMapping]:"Linear",[b.ReinhardToneMapping]:"Reinhard",[b.CineonToneMapping]:"Cineon",[b.ACESFilmicToneMapping]:"ACES"},onChange({value:t}){let a=Number(s.exposureSlider?.get()??1);Preview.all.forEach(e=>{e.renderer.toneMapping=Number(t),e.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMapping=Number(t),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(t)}`,2e3),s.togglePbr&&!s.togglePbr.value&&s.togglePbr.set(!0),S()}})});var Me=(t,a="texture")=>{t.toBlob(async e=>{e&&Blockbench.export({content:await e.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},Te=(t,a="texture")=>{t.toBlob(async e=>{e&&Blockbench.export({content:await e.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};y.push(()=>{s.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let t=Project.selected_texture;if(!t)return;let e=new k(t.layers_enabled?t.layers:[t],t.uuid).createLabPbrOutput();if(e===null)return;let r=t.name??(Project?Project.getDisplayName():"texture");await Promise.all([Me(e.normalMap,pathToName(r)),Te(e.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),s.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:()=>!!Project&&Project.selected_texture!==null,click(){let t=TextureLayer.selected?.texture??Texture.all.find(e=>e.selected)??Texture.getDefault(),a=new k(t.layers_enabled?t.layers:[t],t.uuid);if(t.name.endsWith("_n")||t.name.endsWith("_n.png")){a.createTexturesFromNormal(t);return}if(t.name.endsWith("_s")||t.name.endsWith("_s.png")){a.createTexturesFromSpecular(t);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(s.generateLabPbr,"file.export"),MenuBar.addAction(s.decodeLabPbr,"tools")});E.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});var U=class t{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(m).map(e=>[e,m[e].default??new b.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([e,r])=>[e,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let e=Math.min(1,Math.max(0,a));return new b.Color(e,e,e).convertSRGBToLinear()}static fromSettings(){let a="#000000",e=Number(s.brushMetalnessSlider?.get()),r=Number(s.brushRoughnessSlider?.get()??1),n=(s.brushEmissiveColor?.get()??a).toString(),o=Number(s.brushHeightSlider?.get()),l=ColorPanel.get(),i={[m.albedo.id]:new b.Color(l),[m.metalness.id]:t.makeLinearColor(e),[m.roughness.id]:t.makeLinearColor(r),[m.emissive.id]:new b.Color(n??a),[m.height.id]:t.makeLinearColor(o),[m.normal.id]:m.normal.default??new b.Color("#8080ff")};return new t({colors:i})}};var Ee=t=>{let a=new b.WebGLRenderer({alpha:!0,antialias:!0}),e=new b.Scene,r=new b.PerspectiveCamera(75,96/96,.1,1e3),n=new b.AmbientLight(16777215,.75);e.add(n);let o=new b.PointLight(16777215,1,100);o.position.set(5,5,5),e.add(o);let l=new b.SphereGeometry(1,32,32),i=new b.MeshStandardMaterial({color:t.albedo,metalness:t.metalness??0,roughness:t.roughness??1,emissive:t.emissive,bumpScale:t.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),g=new b.Mesh(l,i);return e.add(g),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(e,r),a.domElement.toDataURL()},ee="materialBrushPresets",O=()=>JSON.parse(localStorage.getItem(ee)||"{}"),je=(t,a)=>{let e=O(),r=a??guid(),n=s.userMaterialBrushPresets?.getFormResult()??{},o={};return n.albedo&&(o.albedo=n.albedo.toString()),n.metalness&&(o.metalness=Number(n.metalness)),n.roughness&&(o.roughness=Number(n.roughness)),n.emissive&&(o.emissive=n.emissive.toString()),n.height&&(o.height=Number(n.height)),e[r]=[o,t??"New Preset",Ee(o)],localStorage.setItem(ee,JSON.stringify(e)),r},F=({metalness:t,roughness:a,emissive:e,height:r,albedo:n})=>{t!==void 0&&s.brushMetalnessSlider?.setValue(t||0,!0),a!==void 0&&s.brushRoughnessSlider?.setValue(a??1,!0),e!==void 0&&s.brushEmissiveColor?.set(e??"#000000"),r!==void 0&&s.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},Le=I.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:m}},methods:{applyPreset(t){try{let[a,e]=this.userPresets[t],{metalness:r,roughness:n,emissive:o,height:l,albedo:i}=a;F({metalness:Number(r),roughness:Number(n),emissive:o.toString(),height:Number(l),albedo:i.toString()}),s.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${e}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(t){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let e=O(),r=this.userPresets[t][1]??t;delete e[t],localStorage.setItem("materialBrushPresets",JSON.stringify(e)),this.userPresets=e,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(t){s.userMaterialBrushPresets?.setFormValues({name:this.userPresets[t][1]??t,...this.userPresets[t][0]})},getSummary(t){return Object.entries(t).filter(([a])=>a in this.channels).map(([a,e])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${e}`:`${this.channels[a]?.label??a}: ${Number(e).toFixed(1)}`).join(` +`)}},computed:{presets(){return Object.entries(this.userPresets)}},mounted(){this.userPresets=O()},template:` +
+
    +
  • +
    + +
    {{ name }}
    +
    +
    +
    {{ name }}
    +
    +
    + +
    +
  • +
+
`});y.push(()=>{s.materialBrushStyles=Blockbench.addCSS(` + .preset_list { + display: grid; + grid-template-columns: repeat(auto-fill, 96px); + grid-gap: 8px; + justify-content: start; + align-items: start; + margin: 0 auto; + padding: 8px; + } + + .user_preset { + display: flex; + justify-content: start; + align-items: center; + width: 100%; + padding: 8px; + position: relative; + } + + .preset_title { + font-size: 1em; + color: var(--color-text); + } + + .user_preset:hover .preset_title { + color: var(--color-accent); + } + + .preset_preview { + display: flex; + flex-direction: column; + flex-wrap: nowrap; + justify-content: center; + align-items: center; + text-align: center; + } + + .preset_buttons { + display: flex; + flex-direction: row; + align-items: center; + font-size: 0.8em; + padding: 0 4px; + } + + .preset_channel { + display: flex; + flex-direction: row; + align-items: center; + margin: 0 8px; + font-size: 0.8em; + } + + .delete_preset { + margin-left: 8px; + padding: 4px; + height: 24px; + width: 24px; + min-width: 24px; + background-color: transparent; + color: var(--color-text); + border: none; + border-radius: 100%; + position: absolute; + right: -8px; + top: 0; + filter: drop-shadow(0 0 2px var(--color-shadow)); + } + + .delete_preset .material-icons { + font-size: 0.825em; + } + + .delete_preset:hover { + background: transparent; + color: var(--color-accent); + } + + .delete_preset:hover .material-icons { + color: var(--color-accent); + } + `),s.brushMetalnessSlider=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",settings:{min:0,max:1,step:.01,default:0},condition:()=>{if(!Project)return!1;let t=Project.selected_texture;return t?.layers_enabled?t.layers.find(({channel:a})=>a===m.metalness.id)!==void 0:!1}}),s.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",settings:{min:0,max:1,step:.01,default:1},condition:()=>{if(!Project)return!1;let t=Project.selected_texture;return t?.layers_enabled?t.layers.find(({channel:a})=>a===m.roughness.id)!==void 0:!1}}),s.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",condition:()=>{if(!Project)return!1;let t=Project.selected_texture;return t?.layers_enabled?t.layers.find(({channel:a})=>a===m.emissive.id)!==void 0:!1}}),s.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",settings:{min:0,max:1,step:.01,default:.5},condition:()=>{if(!Project)return!1;let t=Project.selected_texture;return t?.layers_enabled?t.layers.find(({channel:a})=>a===m.height.id)!==void 0:!1}}),s.materialBrushPresets=new BarSelect("brush_presets",{category:"paint",name:"Material Brush Presets",description:"Select a preset for the material brush",options:{matte:"Matte",gloss:"Gloss",metal:"Dull Metal",polished:"Polished Metal",glowing:"Glowing"},onChange({value:t}){F(t),s.materialBrushTool?.select(),S()}}),s.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",condition:()=>Modes.paint&&!!Project&&Project.selected_texture&&Project.selected_texture.layers_enabled,brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(t,a,e,r,{size:n,softness:o,texture:l}){let i=U.fromSettings(),g=Object.keys(i.colors),f=e;return l.layers.forEach(p=>{if(!p.visible||!g.includes(p.channel))return;let u=i.getChannel(p.channel);u&&(p.ctx.fillStyle=u.getStyle(),p.ctx.fillRect(n*t,n*a,n,n),p.selected&&(f={r:u.r*255,g:u.g*255,b:u.b*255,a:r*255}))}),f}},onCanvasClick(t){Painter.startPaintToolCanvas(t,t.event)},onSelect(){S()},click(){S()}}),s.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:()=>!!Project,click(){s.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:Le,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(t){F({metalness:Number(t.metalness??s.brushMetalnessSlider?.get()),roughness:Number(t.roughness??s.brushRoughnessSlider?.get()),emissive:(t.emissive??s.brushEmissiveColor?.get()).toString(),height:Number(t.height??s.brushHeightSlider?.get()),albedo:(t.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(t,a){t===1&&Blockbench.textPrompt("Save Preset","New Preset",e=>{e&&(je(e),Blockbench.showQuickMessage(`Preset "${e}" saved`,2e3))})}}).show()}}),MenuBar.addAction(s.materialBrushTool,"tools.0")});E.push(()=>{MenuBar.removeAction("tools.material_brush")});y.push(()=>{s.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Brush"}),new Toolbar("material_brush_presets_toolbar",{id:"material_brush_presets_toolbar",children:["load_brush_preset","brush_presets"],name:"Brush Presets",label:!0})],display_condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});y.push(()=>{s.displaySettingsPanel=new Panel("display_settings",{name:"PBR Display Settings",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});y.push(()=>{let t=I.extend({name:"ChannelsPanel",data(){return{channels:m}},methods:{openMenu(a){s.channelMenu?.open(a)},canShowChannel(a){return a.channel&&a.channel!==B},selectedTexture(){return(Texture.selected??TextureLayer.selected.texture)!==void 0}},computed:{textures:()=>Texture.selected&&Texture.selected.layers_enabled?Texture.selected.layers:Texture.all.map(a=>a.layers_enabled?a.layers:[a]).flat()},template:` +
+
    +
  • + +
    +
    +
    {{ texture.name }}
    +
    + {{ texture.texture.name }} +
    +
    +
    +
    {{ channels[texture.channel].label }}
    + {{ channels[texture.channel].icon }} +
    +
    +
  • +
+
`});s.channelsPanelStyle=Blockbench.addCSS(` + .texture_channel { + color: var(--color-text); + flex: 1; + font-size: 1em; + margin: 0 0 0 auto; + padding: 0 8px; + text-align: right; + } + + .texture_channel + .texture_particle_icon { + padding-right: 8px; + } + + .texture_channel_description { + background-color: var(--color-back); + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: space-between; + } + + .texture_channel_wrapper { + align-items: center; + background-color: var(--color-ui); + border-left: 1px solid var(--color-border); + display: flex; + flex: 1; + flex-direction: row; + align-items: center; + flex-wrap: nowrap; + padding: 0 8px; + } + + .texture_channel_wrapper:hover { + background-color: var(--color-button); + } + + .texture_channel_description .texture_name { + flex-direction: column; + flex-wrap: nowrap; + color: var(--color-subtle_text); + display: flex; + flex: 1; + justify-content: center; + align-items: start; + } + + .texture_parent { + color: var(--color-subtle_text); + font-size: 0.8em; + } + + .texture_channel_description:hover .texture_channel { + color: var(--color-accent); + } + + #pbr_channel_list { + display: flex; + flex-direction: column; + } + + #pbr_channel_list .texture { + border-top: 1px solid var(--color-border); + padding-right: 0; + } + `),s.channelsPanel=new Panel("channels_panel",{name:"PBR Channels",id:"channels_panel",icon:"tv",display_condition:{modes:["paint","edit","animate"],project:!0},toolbars:[new Toolbar("channel_assignment_toolbar",{id:"channel_assignment_toolbar",children:["create_material_texture","show_channel_menu"],name:"PBR Channel Controls"})],component:t,expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:336,folded:!0},insert_after:"layers",insert_before:"color"})});(()=>{let t=()=>{y.forEach(e=>e())},a=()=>{E.forEach(e=>e()),Object.entries(s).forEach(([e,r])=>{try{r?.delete()}catch(n){console.error(`Failed to delete ${e} action:`,n)}})};BBPlugin.register("pbr_preview",{version:"1.1.0",title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.2",onload:t,onunload:a})})();})(); diff --git a/src/pbr_preview/changelog.mjs b/src/pbr_preview/changelog.mjs new file mode 100644 index 00000000..a2bacf35 --- /dev/null +++ b/src/pbr_preview/changelog.mjs @@ -0,0 +1,108 @@ +import readline from "node:readline/promises"; +import { writeFile, readFile } from "node:fs/promises"; + +const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout, +}); + +const changelog = "./plugins/pbr_preview/changelog.json"; + +function createChangelog(version, changes, author, title = null, date = null) { + const changelog = { + [version.toString()]: { + title: title ?? `Version ${version}`, + date: date || new Date().toISOString().split("T")[0], + author, + categories: [], + }, + }; + + for (const change of changes) { + changelog[version].categories.push({ + title: "", + list: [], + ...change, + }); + } + + return changelog; +} + +async function amendChangelog( + version, + changes, + author, + title = null, + date = null, +) { + const data = JSON.parse(await readFile(changelog, "utf-8")); + const newChangelog = createChangelog(version, changes, author, title, date); + const mergedChangelog = { ...data, ...newChangelog }; + + await writeFile(changelog, JSON.stringify(mergedChangelog, null, 4)); +} + +async function main() { + const version = await rl.question("Enter the version number: "); + const author = await rl.question("Enter the author: "); + const title = await rl.question( + "Enter the title (leave blank for default): ", + ); + + const changes = []; + let makingChanges = true; + let writingDescriptions = false; + + while (makingChanges) { + const change = await rl.question( + "Enter a change title (leave blank to exit): ", + ); + + makingChanges = change.length > 0; + + if (!makingChanges) { + break; + } + + const descriptions = []; + writingDescriptions = true; + + while (writingDescriptions) { + const description = await rl.question( + "Enter a description (leave blank to finish): ", + ); + + writingDescriptions = description.length > 0; + + if (!writingDescriptions) { + break; + } + + descriptions.push(description); + } + + changes.push({ + title: change, + list: descriptions, + }); + } + + await amendChangelog( + version, + changes, + author, + title ?? `Version ${version}`, + new Date().toISOString().split("T")[0], + ); +} + +main() + .then(() => { + console.log("Changelog updated!"); + process.exit(0); + }) + .catch((err) => { + console.error(err); + process.exit(1); + }); diff --git a/src/pbr_preview/package.json b/src/pbr_preview/package.json index 387f2bc8..c2fb703e 100644 --- a/src/pbr_preview/package.json +++ b/src/pbr_preview/package.json @@ -7,7 +7,7 @@ "build": "esbuild src/index.ts --bundle --minify --outfile=../../plugins/pbr_preview/pbr_preview.js", "test": "echo \"Error: no test specified\" && exit 1", "dev": "esbuild src/index.ts --bundle --sourcemap --outfile=../../plugins/pbr_preview/pbr_preview.js --watch", - "format": "prettier --write src/**/*.ts", + "format": "prettier --write src/**/*.ts ./*.mjs", "dist": "npm run format && npm run build" }, "keywords": [ diff --git a/src/pbr_preview/src/constants.ts b/src/pbr_preview/src/constants.ts new file mode 100644 index 00000000..5f208a10 --- /dev/null +++ b/src/pbr_preview/src/constants.ts @@ -0,0 +1,71 @@ +import type { IChannel, IRegistry } from "./types"; +import { three as THREE } from "./deps"; + +export const NA_CHANNEL = "_NONE_"; +export const CHANNELS: Record = { + albedo: { + id: "albedo", + label: "Albedo", + description: "The color of the material", + map: "map", + icon: "tonality", + default: new THREE.Color(0xffffff), + }, + metalness: { + id: "metalness", + label: "Metalness", + description: "The material's metalness map", + map: "metalnessMap", + icon: "brightness_6", + default: new THREE.Color(0), + }, + emissive: { + id: "emissive", + label: "Emissive", + description: "The material's emissive map", + map: "emissiveMap", + icon: "wb_twilight", + default: new THREE.Color(0), + }, + roughness: { + id: "roughness", + label: "Roughness", + description: "The material's roughness map", + map: "roughnessMap", + icon: "grain", + default: new THREE.Color(0xffffff), + }, + height: { + id: "height", + label: "Height", + description: "The material's height map", + map: "bumpMap", + icon: "landscape", + default: new THREE.Color(0xffffff), + }, + normal: { + id: "normal", + label: "Normal", + description: "The material's normal map", + map: "normalMap", + icon: "looks", + default: new THREE.Color("rgb(128, 128, 255)"), + }, + ao: { + id: "ao", + label: "Ambient Occlusion", + description: "The material's ambient occlusion map", + map: "aoMap", + icon: "motion_mode", + default: new THREE.Color(0xffffff), + }, +}; + +/** + * Collection of registered Blockbench UI elements + * Used for component communication as well as to simplify cleanup + */ +export const registry: Partial = {}; + +export const setups: Array<() => void> = []; +export const teardowns: Array<() => void> = []; diff --git a/src/pbr_preview/src/deps.ts b/src/pbr_preview/src/deps.ts new file mode 100644 index 00000000..a854a62b --- /dev/null +++ b/src/pbr_preview/src/deps.ts @@ -0,0 +1,7 @@ +// @ts-expect-error THREE UMD is OK +const three = THREE; +// @ts-expect-error Vue UMD is OK +const vue = Vue; +const bb = Blockbench; + +export { three, bb, vue }; diff --git a/src/pbr_preview/src/index.ts b/src/pbr_preview/src/index.ts index 5cd968b6..e676925f 100644 --- a/src/pbr_preview/src/index.ts +++ b/src/pbr_preview/src/index.ts @@ -5,2319 +5,33 @@ */ /// /// +/// -interface IPbrMaterials { - [materialUuid: string]: { - [channelId: string]: string; - }; -} - -type Channel = - | "albedo" - | "metalness" - | "emissive" - | "roughness" - | "height" - | "normal" - | "ao"; - -interface IChannel { - label: string; - description: string; - map: string; - id: string; - icon?: string; - default?: THREE.Color; -} - -interface ILightrParams { - lightHeight?: number; - ambientLight?: [number, number, number]; - minLightIntensity?: number; - lightDiffuse?: [number, number, number]; -} +import { registry, setups, teardowns } from "./constants"; +import "./lib/properties"; +import "./lib/actions"; +import "./lib/tools"; +import "./lib/panels"; (() => { - let decodeMer: Action; - let createTextureSet: Action; - let generateMer: Action; - let generateNormal: Action; - let unassignChannel: Action; - let createMaterialTexture: Action; - let bakeTexturesAction: Action; - let bakeTexturesDialog: Dialog; - let togglePbr: Toggle; - let displaySettingsPanel: Panel; - let textureSetDialog: Dialog; - let textureChannelProp: Property; - let channelProp: Property; - let channelMenu: Menu; - let showChannelMenu: Action; - let exposureSlider: BarSlider; - let tonemappingSelect: BarSelect; - let toggleCorrectLights: Toggle; - let pbrMaterialsProp: Property; - let projectMaterialsProp: Property; - let projectPbrModeProp: Property; - let materialBrushPanel: Panel; - let materialBrushTool: Tool; - let setBrushMaterial: Action; - let brushMetalnessSlider: NumSlider; - let brushRoughnessSlider: NumSlider; - let brushEmissiveColor: ColorPicker; - let brushHeightSlider: NumSlider; - let openChannelMenu: Action; - - const channelActions: Record = {}; - - const PLUGIN_ID = "pbr_preview"; - const PLUGIN_VERSION = "1.0.0"; - const NA_CHANNEL = "_NONE_"; - const CHANNELS: Record = { - albedo: { - id: "albedo", - label: "Albedo", - description: "The color of the material", - map: "map", - icon: "tonality", - default: new THREE.Color(0xffffff), - }, - metalness: { - id: "metalness", - label: "Metalness", - description: "The material's metalness map", - map: "metalnessMap", - icon: "brightness_6", - default: new THREE.Color(0), - }, - emissive: { - id: "emissive", - label: "Emissive", - description: "The material's emissive map", - map: "emissiveMap", - icon: "wb_twilight", - default: new THREE.Color(0), - }, - roughness: { - id: "roughness", - label: "Roughness", - description: "The material's roughness map", - map: "roughnessMap", - icon: "grain", - default: new THREE.Color(0xffffff), - }, - height: { - id: "height", - label: "Height", - description: "The material's height map", - map: "bumpMap", - icon: "landscape", - default: new THREE.Color(0xffffff), - }, - normal: { - id: "normal", - label: "Normal", - description: "The material's normal map", - map: "normalMap", - icon: "looks", - default: new THREE.Color("rgb(128, 128, 255)"), - }, - ao: { - id: "ao", - label: "Ambient Occlusion", - description: "The material's ambient occlusion map", - map: "aoMap", - icon: "motion_mode", - default: new THREE.Color(0xffffff), - }, - }; - - const getProjectTextures = (layers = true) => { - const allTextures = Project ? Project.textures ?? Texture.all : Texture.all; - - if (!layers) { - return allTextures; - } - - return allTextures - .filter((t: Texture) => t.layers_enabled && t.layers.length > 0) - .flatMap((t: Texture) => t.layers); - }; - - // - // Classes - // - - /** - * ### PBR Material - * Class for handling PBR materials in Blockbench - * - * Uses a texture's layers to generate a PBR material, - * or a project's textures if no layers are available. - */ - class PbrMaterial { - private _scope: Array; - private _materialUuid: string; - - constructor( - scope: Array | null, - materialUuid: string, - ) { - this._scope = scope ?? getProjectTextures(); - this._materialUuid = materialUuid; - } - - merToCanvas() { - let emissiveMap = this.getTexture(CHANNELS.emissive); - let roughnessMap = this.getTexture(CHANNELS.roughness); - let metalnessMap = this.getTexture(CHANNELS.metalness); - - if (!emissiveMap && !roughnessMap && !metalnessMap) { - const { metalness, emissive, roughness } = this.decodeMer(); - - if (metalness) { - metalnessMap = PbrMaterial.makePixelatedCanvas(metalness); - } - - if (emissive) { - emissiveMap = PbrMaterial.makePixelatedCanvas(emissive); - } - - if (roughness) { - roughnessMap = PbrMaterial.makePixelatedCanvas(roughness); - } - } - - return { - emissiveMap, - roughnessMap, - metalnessMap, - }; - } - - getMaterial(options: THREE.MeshStandardMaterialParameters = {}) { - const { emissiveMap, roughnessMap, metalnessMap } = this.merToCanvas(); - - const mat = new THREE.MeshStandardMaterial({ - map: - this.getTexture(CHANNELS.albedo) ?? - PbrMaterial.makePixelatedCanvas( - TextureLayer.selected?.canvas ?? - Texture.all.find((t) => t.selected)?.canvas ?? - Texture.getDefault().canvas, - ), - aoMap: this.getTexture(CHANNELS.ao), - bumpMap: this.getTexture(CHANNELS.height), - metalnessMap, - metalness: metalnessMap ? 1 : 0, - roughnessMap, - roughness: 1, - emissiveMap, - emissiveIntensity: emissiveMap ? 1 : 0, - emissive: emissiveMap ? 0xffffff : 0, - envMap: PreviewScene.active?.cubemap ?? null, - envMapIntensity: 1, - alphaTest: 0.5, - ...options, - }); - - const normalMap = this.getTexture(CHANNELS.normal); - - if (normalMap) { - mat.normalMap = normalMap; - mat.normalScale = new THREE.Vector2(1, 1); - } - - return mat; - } - - saveTexture(channel: IChannel, texture: Texture | TextureLayer) { - if (!Project) { - return; - } - - if (!Project.pbr_materials) { - Project.pbr_materials = {}; - } - - if (!Project.pbr_materials[this._materialUuid]) { - Project.pbr_materials[this._materialUuid] = {}; - } - - Project.pbr_materials[this._materialUuid][channel.id] = texture.uuid; - texture.extend({ channel: channel.id }); - } - - /** - * ### Find channel texture - * @param name Channel to find - * @param inference Whether or not to infer the texture based on the channel name - * @returns The channel if it exists in the project, otherwise `null` - */ - findTexture( - name: string | IChannel, - inference = true, - ): Texture | TextureLayer | null { - if (!Project) { - return null; - } - - const materialChannel = this._scope.find( - (t) => t.channel && (t.channel === name || t.channel === name.id), - ); - - if (materialChannel) { - return materialChannel; - } - - const channel = typeof name === "string" ? name : name.id; - - Project.pbr_materials ??= {}; - const materialData = Project.pbr_materials[this._materialUuid]; - - // Don't infer the channel if it has already been assigned to NA_CHANNEL - if (!materialData && inference && channel !== NA_CHANNEL) { - const filenameRegex = new RegExp(`_*${channel}(\.[^.]+)?$`, "i"); - return this._scope.find((t) => filenameRegex.test(t.name)) ?? null; - } - - const textureUuid = materialData?.[channel]; - - if (!textureUuid) { - return null; - } - - return this._scope.find((t) => t.uuid === textureUuid) ?? null; - } - - /** - * Helper function to create a canvas texture with pixelated filtering - * @param canvas Texture canvas source - * @returns `THREE.CanvasTexture` with pixelated filtering - */ - static makePixelatedCanvas(canvas: HTMLCanvasElement) { - const texture = new THREE.CanvasTexture( - canvas, - undefined, - undefined, - undefined, - THREE.NearestFilter, - THREE.NearestFilter, - ); - - texture.needsUpdate = true; - - return texture; - } - - /** - * Searches for a texture and creates a canvas element with the texture data if found - * @param name The name of the texture to search for. Use a channel or a texture name or UUID - * @param scope An array of textures to search in. Defaults to all textures in the project - */ - getTexture(name: string | IChannel) { - const texture = this.findTexture(name); - return texture ? PbrMaterial.makePixelatedCanvas(texture.canvas) : null; - } - - static extractChannel( - texture: Texture | TextureLayer, - channel: "r" | "g" | "b" | "a", - ) { - const canvas = texture.canvas; - const width = canvas.width; - const height = canvas.height; - - const ctx = canvas.getContext("2d"); - - if (!ctx || !width || !height) { - return null; - } - - const channelCanvas = document.createElement("canvas"); - channelCanvas.width = width; - channelCanvas.height = height; - - const channelCtx = channelCanvas.getContext("2d"); - - if (!channelCtx) { - return null; - } - - const channelIdx = { r: 0, g: 1, b: 2, a: 3 }[channel]; - - const { data } = ctx.getImageData(0, 0, width, height); - - const channelData = new Uint8ClampedArray(width * height * 4); - - for (let idx = 0; idx < data.length; idx += 4) { - channelData[idx] = data[idx + channelIdx]; - channelData[idx + 1] = data[idx + channelIdx]; - channelData[idx + 2] = data[idx + channelIdx]; - channelData[idx + 3] = 255; - } - - const imageData = new ImageData(channelData, width, height); - - channelCtx.putImageData(imageData, 0, 0); - - return channelCanvas; - } - - decodeMer(emissiveThreshold = 1): { - metalness?: HTMLCanvasElement | null; - emissive?: HTMLCanvasElement | null; - emissiveLevel?: HTMLCanvasElement | null; - roughness?: HTMLCanvasElement | null; - sss?: HTMLCanvasElement | null; - } { - const texture = this.findTexture("mer", true); - - if (!texture) { - return { - metalness: null, - emissive: null, - emissiveLevel: null, - roughness: null, - sss: null, - }; - } - - const metalness = PbrMaterial.extractChannel(texture, "r"); - const emissiveLevel = PbrMaterial.extractChannel(texture, "g"); - const roughness = PbrMaterial.extractChannel(texture, "b"); - const sss = PbrMaterial.extractChannel(texture, "a"); - - const emissive = document.createElement("canvas"); - emissive.width = texture.img.width ?? 16; - emissive.height = texture.img.height ?? 16; - - // Use emissiveLevel as mask for getting emissive color from albedo channel - const albedo = this.findTexture(CHANNELS.albedo); - - if (albedo) { - emissive.width = albedo.img.width ?? 16; - emissive.height = albedo.img.height ?? 16; - } - - const emissiveCtx = emissive.getContext("2d"); - const emissiveLevelCtx = emissiveLevel?.getContext("2d"); - const albedoCtx = albedo?.canvas?.getContext("2d"); - - if (!emissiveCtx || !albedoCtx || !emissiveLevelCtx) { - return { - metalness, - emissive: emissiveLevel, - roughness, - sss, - }; - } - - // Write the albedo color to the emissive canvas where the emissive level is greater than a certain threshold - const albedoData = albedoCtx.getImageData( - 0, - 0, - emissive.width, - emissive.height, - ); - const emissiveLevelData = emissiveLevelCtx.getImageData( - 0, - 0, - emissive.width, - emissive.height, - ); - - const emissiveData = new Uint8ClampedArray( - emissive.width * emissive.height * 4, - ); - - for (let idx = 0; idx < albedoData.data.length; idx += 4) { - if (emissiveLevelData.data[idx] > emissiveThreshold) { - emissiveData[idx] = albedoData.data[idx]; - emissiveData[idx + 1] = albedoData.data[idx + 1]; - emissiveData[idx + 2] = albedoData.data[idx + 2]; - emissiveData[idx + 3] = 255; - continue; - } - - emissiveData[idx] = 0; - emissiveData[idx + 1] = 0; - emissiveData[idx + 2] = 0; - emissiveData[idx + 3] = 255; - } - - emissiveCtx.putImageData( - new ImageData(emissiveData, emissive.width, emissive.height), - 0, - 0, - ); - - return { - metalness, - emissive, - emissiveLevel, - roughness, - sss, - }; - } - - createMer(inference = false) { - const metalness = this.findTexture(CHANNELS.metalness, inference); - const emissive = this.findTexture(CHANNELS.emissive, inference); - const roughness = this.findTexture(CHANNELS.roughness, inference); - const sss = this.findTexture("sss", false); - - const width = Math.max( - metalness?.img.width ?? 0, - emissive?.img.width ?? 0, - roughness?.img.width ?? 0, - Project ? Project.texture_width : 0, - 16, - ); - - const height = Math.max( - metalness?.img.height ?? 0, - emissive?.img.height ?? 0, - roughness?.img.height ?? 0, - Project ? Project.texture_height : 0, - 16, - ); - - const canvas = document.createElement("canvas"); - canvas.width = width; - canvas.height = height; - - const ctx = canvas.getContext("2d"); - - if (!ctx) { - return null; - } - - const metalnessCanvas = metalness?.img - ? PbrMaterial.extractChannel(metalness, "r") - : null; - const emissiveCanvas = emissive?.img - ? PbrMaterial.extractChannel(emissive, "g") - : null; - const roughnessCanvas = roughness?.img - ? PbrMaterial.extractChannel(roughness, "b") - : null; - const sssCanvas = - sss && sss?.img ? PbrMaterial.extractChannel(sss, "a") : null; - - const metalnessData = - metalnessCanvas?.getContext("2d")?.getImageData(0, 0, width, height) ?? - new ImageData(width, height); - const emissiveData = - emissiveCanvas?.getContext("2d")?.getImageData(0, 0, width, height) ?? - new ImageData(width, height); - const roughnessData = - roughnessCanvas?.getContext("2d")?.getImageData(0, 0, width, height) ?? - new ImageData(width, height); - const sssData = - sssCanvas?.getContext("2d")?.getImageData(0, 0, width, height) ?? - new ImageData( - new Uint8ClampedArray(width * height * 4).fill(255), - width, - height, - ); - - const data = new Uint8ClampedArray(width * height * 4); - - for (let idx = 0; idx < data.length; idx += 4) { - data[idx] = metalnessData.data[idx]; - data[idx + 1] = emissiveData.data[idx]; - data[idx + 2] = roughnessData.data[idx]; - data[idx + 3] = sssData.data[idx]; - } - - ctx.putImageData(new ImageData(data, width, height), 0, 0); - - return canvas; - } - - /** - * ### Generate Normal Map - * Generates a normal map from a height map texture - * @param texture Height map texture - * @param heightInAlpha Whether or not to store the height map in the alpha channel (Used in labPBR shaders for POM) - * @returns Normal map texture or layer if successful, otherwise `null` - */ - static createNormalMap( - texture: Texture | TextureLayer, - heightInAlpha = false, - ): Texture | TextureLayer | null { - const textureCtx = texture.canvas.getContext("2d"); - - if (!textureCtx) { - return null; - } - - const width = Math.max( - texture.img.width ?? texture.canvas.width, - Project ? Project.texture_width : 0, - 16, - ); - const height = Math.max( - texture.img.height ?? texture.canvas.height, - Project ? Project.texture_height : 0, - 16, - ); - - const { data: textureData } = textureCtx.getImageData( - 0, - 0, - width, - height, - ); - - const canvas = document.createElement("canvas"); - const ctx = canvas.getContext("2d"); - - if (!ctx) { - return null; - } - - const getHeight = (x: number, y: number): number => { - const idx = (x + y * width) * 4; - return textureData[idx] / 255; - }; - - canvas.width = width; - canvas.height = height; - - ctx.drawImage(texture.img, 0, 0, width, height); - - const imageData = ctx.getImageData(0, 0, width, height); - - const data = imageData.data; - - const normalize = (v: number[]): number[] => { - const length = Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); - return [v[0] / length, v[1] / length, v[2] / length]; - }; - - for (let y = 0; y < height; y++) { - for (let x = 0; x < width; x++) { - const left = getHeight(Math.max(x - 1, 0), y); - const right = getHeight(Math.min(x + 1, width - 1), y); - const top = getHeight(x, Math.max(y - 1, 0)); - const bottom = getHeight(x, Math.min(y + 1, height - 1)); - - const dx = right - left; - const dy = bottom - top; - - const normal = normalize([-dx, -dy, 1]); - - const idx = (y * width + x) * 4; - data[idx] = ((normal[0] + 1) / 2) * 255; - data[idx + 1] = ((normal[1] + 1) / 2) * 255; - data[idx + 2] = ((normal[2] + 1) / 2) * 255; - data[idx + 3] = heightInAlpha ? getHeight(x, y) * 255 : 255; - } - } - - ctx.putImageData(imageData, 0, 0); - - const dataUrl = canvas.toDataURL(); - - const name = `${texture.name.replace(/_height(map)?/i, "")}_normal`; - - if (texture instanceof TextureLayer) { - const normalMapLayer = new TextureLayer( - { - name, - data_url: dataUrl, - visible: true, - }, - texture.texture, - ); - - normalMapLayer.addForEditing(); - - return normalMapLayer; - } - - const normalMapTexture = new Texture({ - name, - saved: false, - particle: false, - keep_size: false, - }).fromDataURL(dataUrl); - - if (Project) { - normalMapTexture.add(); - } - - return normalMapTexture; - } - } - - /** - * ### Material Brush - * Class for painting across multiple TextureLayers in a Texture - * Used to iterate over PBR channels and apply a brush value to each layer - * at the same UV coordinates - */ - class MaterialBrush { - private _colors: Record; - - constructor({ colors }: { colors?: Record }) { - this._colors = { - ...Object.fromEntries( - Object.keys(CHANNELS).map((key) => [ - key, - CHANNELS[key].default ?? new THREE.Color(0xffffff00), - ]), - ), - ...colors, - }; - } - - get colors() { - return this._colors; - } - - set colors(colors: Record) { - this._colors = { ...this._colors, ...colors }; - } - - getChannel(channel: IChannel["id"]) { - return this._colors[channel]; - } - - static makeLinearColor(value: number) { - const clamped = Math.min(1, Math.max(0, value)); - return new THREE.Color(clamped, clamped, clamped).convertSRGBToLinear(); - } - - static fromSettings() { - const metalnessValue = Number(brushMetalnessSlider.get()); - const roughnessValue = Number(brushRoughnessSlider.get()); - const emissiveValue = brushEmissiveColor.get().toString(); - const heightValue = Number(brushHeightSlider.get()); - const currentColor = ColorPanel.get(); - - const colors = { - [CHANNELS.albedo.id]: new THREE.Color(currentColor), - [CHANNELS.metalness.id]: MaterialBrush.makeLinearColor(metalnessValue), - [CHANNELS.roughness.id]: MaterialBrush.makeLinearColor(roughnessValue), - [CHANNELS.emissive.id]: new THREE.Color(emissiveValue ?? "#000000"), - [CHANNELS.height.id]: MaterialBrush.makeLinearColor(heightValue), - [CHANNELS.normal.id]: - CHANNELS.normal.default ?? new THREE.Color("#8080ff"), - }; - - return new MaterialBrush({ colors }); - } - } - - /** - * Adapted from Lightr by phosphoer - * @see https://github.com/phosphoer/lightr - */ - class Lightr { - lightHeight: number; - ambientLight: [number, number, number]; - minLightIntensity: number; - lightDiffuse: [number, number, number]; - - constructor({ - lightHeight = 0.66, - ambientLight = [0.1, 0.1, 0.1], - minLightIntensity = 0.0, - lightDiffuse = [1, 1, 1], - }: ILightrParams = {}) { - this.lightHeight = lightHeight; - this.ambientLight = ambientLight; - this.minLightIntensity = minLightIntensity; - this.lightDiffuse = lightDiffuse; - } - - bake( - numDirs: number, - diffuseMap: HTMLImageElement | HTMLCanvasElement, - normalMap: HTMLImageElement | HTMLCanvasElement, - ): HTMLCanvasElement[] { - const canvasDiffuse = - diffuseMap instanceof HTMLCanvasElement - ? diffuseMap - : this.createCanvas(diffuseMap.width, diffuseMap.height); - const canvasNormals = - normalMap instanceof HTMLCanvasElement - ? normalMap - : this.createCanvas(normalMap.width, normalMap.height); - - const contextDiffuse = canvasDiffuse.getContext("2d")!; - const contextNormals = canvasNormals.getContext("2d")!; - - contextDiffuse.drawImage(diffuseMap, 0, 0); - contextNormals.drawImage(normalMap, 0, 0); - - const bufferDiffuse = contextDiffuse.getImageData( - 0, - 0, - diffuseMap.width, - diffuseMap.height, - ); - const bufferNormals = contextNormals.getImageData( - 0, - 0, - normalMap.width, - normalMap.height, - ); - - const bakedImages: HTMLCanvasElement[] = []; - const normals: [number, number, number][][] = []; - - for (let x = 0; x < bufferNormals.width; ++x) { - normals[x] = []; - for (let y = 0; y < bufferNormals.height; ++y) { - const idx = (x + y * bufferNormals.width) * 4; - - const normal = [ - (bufferNormals.data[idx + 0] / 255 - 0.5) * 2, - (bufferNormals.data[idx + 1] / 255 - 0.5) * 2, - (bufferNormals.data[idx + 2] / 255 - 0.5) * 2, - ]; - - const len = Math.sqrt( - normal[0] ** 2 + normal[1] ** 2 + normal[2] ** 2, - ); - normals[x][y] = [normal[0] / len, normal[1] / len, normal[2] / len]; - } - } - - const bakeDirection = (dir: number): HTMLCanvasElement => { - const canvas = this.createCanvas(diffuseMap.width, diffuseMap.height); - const context = canvas.getContext("2d")!; - const buffer = context.getImageData(0, 0, canvas.width, canvas.height); - - const lightDir = [Math.cos(dir), Math.sin(dir), this.lightHeight]; - - for (let x = 0; x < bufferNormals.width; ++x) { - for (let y = 0; y < bufferNormals.height; ++y) { - const normal = normals[x][y]; - const index = (x + y * bufferNormals.width) * 4; - const diffuse = [ - bufferDiffuse.data[index + 0] / 255, - bufferDiffuse.data[index + 1] / 255, - bufferDiffuse.data[index + 2] / 255, - bufferDiffuse.data[index + 3], - ]; - - let intensity = - normal[0] * lightDir[0] + - normal[1] * lightDir[1] + - normal[2] * lightDir[2]; - intensity = Math.min( - 1, - Math.max(this.minLightIntensity, intensity), - ); - - const out = [ - intensity * diffuse[0] * this.lightDiffuse[0] + - this.ambientLight[0], - intensity * diffuse[1] * this.lightDiffuse[1] + - this.ambientLight[1], - intensity * diffuse[2] * this.lightDiffuse[2] + - this.ambientLight[2], - diffuse[3], - ]; - - buffer.data[index + 0] = Math.floor(out[0] * 255); - buffer.data[index + 1] = Math.floor(out[1] * 255); - buffer.data[index + 2] = Math.floor(out[2] * 255); - buffer.data[index + 3] = out[3]; - } - } - - context.putImageData(buffer, 0, 0); - return canvas; - }; - - for (let i = 0; i < numDirs; ++i) { - const lightDir = ((Math.PI * 2) / numDirs) * i; - bakedImages.push(bakeDirection(lightDir)); - } - - return bakedImages; - } - - private createCanvas(width: number, height: number): HTMLCanvasElement { - const canvas = document.createElement("canvas"); - canvas.width = width; - canvas.height = height; - return canvas; - } - } - - channelProp = new Property(TextureLayer, "enum", "channel", { - default: NA_CHANNEL, - values: Object.keys(CHANNELS).map((key) => CHANNELS[key].id), - label: "PBR Channel", - exposed: false, - }); - - textureChannelProp = new Property(Texture, "enum", "channel", { - default: NA_CHANNEL, - values: Object.keys(CHANNELS).map((key) => CHANNELS[key].id), - label: "PBR Channel", - exposed: false, - }); - - // @ts-expect-error "object" is a valid type for a property - pbrMaterialsProp = new Property(ModelProject, "object", "pbr_materials", { - default: {}, - exposed: false, - label: "PBR Materials", - }); - - // @ts-expect-error "object" is a valid type for a property - projectMaterialsProp = new Property(ModelProject, "object", "bb_materials", { - default: {}, - exposed: false, - label: "Project Materials", - }); - - projectPbrModeProp = new Property(ModelProject, "boolean", "pbr_active", { - default: false, - exposed: true, - values: [], - label: "PBR Mode", - }); - - // - // Functions - // - - /** - * ### Export MER map - * Generates a MER map from the currently selected texture and exports it as a PNG file - * @param cb Callback function to run after the MER file is exported - * @returns void - */ - const exportMer = (baseName?: string, cb?: (filePath: string) => void) => { - const selected = Project - ? Project.selected_texture - : Texture.all.find((t) => t.selected); - - if (!selected) { - return; - } - - const mer = new PbrMaterial( - selected.layers_enabled - ? selected.layers - : Project - ? Project.textures - : null, - selected.uuid, - ).createMer(false); - - if (!mer) { - return; - } - - mer.toBlob(async (blob) => { - if (!blob) { - return; - } - - const [name, startpath] = Project - ? [ - baseName - ? `${baseName}_mer` - : `${selected.name ?? Project.getDisplayName()}_mer`, - Project.export_path, - ] - : ["mer"]; - - Blockbench.export( - { - content: await blob.arrayBuffer(), - type: "PNG", - name, - extensions: ["png"], - resource_id: "mer", - savetype: "image", - startpath, - }, - cb, - ); - }); - }; - - /** - * ### Apply PBR Material - * Iterates over all faces in the project and applies a PBR material to each face - * @param materialParams Parameters to extend the base material with - * @returns `THREE.MeshStandardMaterial` with PBR textures applied - */ - const applyPbrMaterial = ( - materialParams?: THREE.MeshStandardMaterialParameters, - ) => { - // Don't overwrite placeholder material in Edit and Paint mode - if (!Project || Texture.all.length === 0) { - return; - } - - let materialsSet = false; - - Project.elements.forEach((item) => { - if (!(item instanceof Cube)) { - return; - } - - Object.keys(item.faces).forEach((key) => { - const face = item.faces[key]; - const texture = face.getTexture(); - - if (!texture) { - return; - } - - const projectMaterial = Project.materials[texture.uuid]; - - if ( - projectMaterial.isShaderMaterial && - !Project.bb_materials[texture.uuid] - ) { - Project.bb_materials[texture.uuid] = projectMaterial; - } - - const material = new PbrMaterial( - texture.layers_enabled - ? texture.layers.filter((layer) => layer.visible) ?? null - : Project.textures, - texture.uuid, - ).getMaterial(materialParams); - - Project.materials[texture.uuid] = - THREE.ShaderMaterial.prototype.copy.call(material, projectMaterial); - - Canvas.updateAllFaces(texture); - materialsSet = true; - }); - }); - - Project.pbr_active = materialsSet; - }; - - /** - * ### Disable PBR - * Reverts all faces in the project to their original materials - * @returns void - */ - const disablePbr = () => { - if (!Project || !Project.bb_materials) { - return; - } - - Project.elements.forEach((item) => { - if (!(item instanceof Cube)) { - return; - } - - Object.keys(item.faces).forEach((key) => { - const face = item.faces[key]; - const texture = face.getTexture(); - - if (!texture) { - return; - } - - const projectMaterial = Project.bb_materials[texture.uuid]; - - if (!projectMaterial) { - return; - } - - Project.materials[texture.uuid] = projectMaterial; - }); - }); - - Project.pbr_active = false; - Canvas.updateAll(); - }; - - const colorDataUrl = (color: THREE.Color, src?: HTMLCanvasElement) => { - const canvas = src ?? document.createElement("canvas"); - const ctx = canvas.getContext("2d"); - - if (!ctx) { - return null; - } - - const width = Math.max(Project ? Project.texture_width : 16, 16); - const height = Math.max(Project ? Project.texture_height : 16, 16); - - canvas.width = width; - canvas.height = height; - - ctx.fillStyle = `rgb(${color.r * 255}, ${color.g * 255}, ${color.b * 255})`; - ctx.fillRect(0, 0, width, height); - - return canvas.toDataURL(); - }; - - const bakeTextures = ( - params: ILightrParams, - directions = 8, - blendEmissive = false, - ) => { - if (!Project) { - return; - } - - const selected = Project.selected_texture; - - if (!selected) { - return; - } - - const mat = new PbrMaterial( - selected.layers_enabled ? selected.layers : Project.textures, - selected.uuid, - ); - - const texture = mat.findTexture(CHANNELS.albedo); - const normalMap = mat.findTexture(CHANNELS.normal); - - if (!texture || !normalMap) { - return; - } - - const lightr = new Lightr(params); - const bakedImages = lightr.bake( - directions, - texture.canvas, - normalMap.canvas, - ); - - const bakedTexture = new Texture({ - name: `${texture.name}_baked`, - saved: false, - particle: false, - keep_size: false, - layers_enabled: true, - }).fromDataURL(bakedImages[0].toDataURL()); - - const addEmissive = blendEmissive - ? (canvas: HTMLCanvasElement) => { - const emissive = mat.findTexture(CHANNELS.emissive); - - if (!emissive) { - return canvas; - } - - const emissiveCanvas = emissive.canvas; - const emissiveCtx = emissiveCanvas.getContext("2d"); - - if (!emissiveCtx) { - return canvas; - } - - const width = Math.max( - canvas.width, - emissiveCanvas.width, - Project ? Project.texture_width : 16, - ); - const height = Math.max( - canvas.height, - emissiveCanvas.height, - Project ? Project.texture_height : 16, - ); - - const mergedCanvas = document.createElement("canvas"); - mergedCanvas.width = width; - mergedCanvas.height = height; - - const mergedCtx = mergedCanvas.getContext("2d"); - - if (!mergedCtx) { - return canvas; - } - - mergedCtx.drawImage(canvas, 0, 0); - mergedCtx.globalCompositeOperation = "screen"; - mergedCtx.drawImage(emissiveCanvas, 0, 0); - - return mergedCanvas; - } - : (canvas: HTMLCanvasElement) => canvas; - - bakedImages.forEach((image, idx) => { - const layer = new TextureLayer( - { - name: `baked_${idx + 1}`, - data_url: addEmissive(image).toDataURL(), - }, - bakedTexture, - ); - - layer.addForEditing(); - }); - - bakedTexture.add().select(); - - Blockbench.showQuickMessage("Textures baked 🥐", 2000); - }; - - // - // UI Components - // - - const createTextureSetDialog = () => { - if (!Project) { - return; - } - const scope = getProjectTextures(); - Project.textures.forEach((t) => { - const mat = new PbrMaterial(scope, t.uuid); - - const projectNormalMap = mat.findTexture(CHANNELS.normal, false); - const projectHeightMap = mat.findTexture(CHANNELS.height, false); - const projectColorMap = mat.findTexture(CHANNELS.albedo, false); - const projectMetalnessMap = mat.findTexture( - CHANNELS.metalness, - false, - )?.name; - const projectEmissiveMap = mat.findTexture( - CHANNELS.emissive, - false, - )?.name; - const projectRoughnessMap = mat.findTexture( - CHANNELS.roughness, - false, - )?.name; - - const form: DialogOptions["form"] = {}; - - if (!projectColorMap) { - form.baseColor = { - type: "color", - label: "Base Color", - value: "#ff00ff", - }; - } - - if (!projectMetalnessMap && !projectEmissiveMap && !projectRoughnessMap) { - form.metalness = { - label: "Metalness", - type: "range", - min: 0, - max: 255, - step: 1, - value: 0, - }; - - form.emissive = { - label: "Emissive", - type: "range", - min: 0, - max: 255, - step: 1, - value: 0, - }; - - form.roughness = { - label: "Roughness", - type: "range", - min: 0, - max: 255, - step: 1, - value: 0, - }; - } - - if (projectNormalMap) { - form.depthMap = { - type: "checkbox", - label: "Normal Map", - value: "normal", - }; - } - - if (projectHeightMap) { - form.depthMap = { - type: "checkbox", - label: "Height Map", - value: "heightmap", - }; - } - - if (projectNormalMap && projectHeightMap) { - form.depthMap = { - type: "radio", - label: "Depth Map", - options: { - normal: "Normal Map", - heightmap: "Height", - }, - value: "normal", - }; - } - - textureSetDialog = new Dialog(`${PLUGIN_ID}_texture_set`, { - id: `${PLUGIN_ID}_texture_set`, - title: "Create Texture Set JSON", - buttons: ["Create", "Cancel"], - form, - onConfirm(formResult: Record) { - const baseName = - Project.model_identifier.length > 0 - ? Project.model_identifier - : Project.getDisplayName(); - - const hasMer = - projectMetalnessMap || projectEmissiveMap || projectRoughnessMap; - - const textureSet: { - format_version: string; - "minecraft:texture_set": { - color: string; - metalness_emissive_roughness: [number, number, number]; - normal?: string; - heightmap?: string; - }; - } = { - format_version: "1.16.100", - "minecraft:texture_set": { - color: - (projectColorMap - ? baseName // pathToName(projectColorMap.name, false) - : formResult.baseColor?.toHexString()) ?? baseName, - metalness_emissive_roughness: [ - formResult.metalness ?? 0, - formResult.emissive ?? 0, - formResult.roughness ?? 255, - ], - }, - }; - - if ( - (formResult.depthMap === "normal" && projectNormalMap) || - (!projectHeightMap && projectNormalMap) - ) { - textureSet["minecraft:texture_set"].normal = `${baseName}_normal`; - } else if ( - (!projectNormalMap || formResult.depthMap === "heightmap") && - projectHeightMap - ) { - textureSet["minecraft:texture_set"].heightmap = - `${baseName}_heightmap`; - } - - const exportDepthMap = (cb: () => void) => { - if (!formResult.depthMap) { - return cb(); - } - - const useNormalMap = - formResult.depthMap === "normal" || - (formResult.depthMap && !projectHeightMap); - - const depthMap = useNormalMap ? projectNormalMap : projectHeightMap; - - if (!depthMap) { - return cb(); - } - - Blockbench.export( - { - content: depthMap.canvas.toDataURL() ?? "", - type: "PNG", - name: `${baseName}_${useNormalMap ? "normal" : "heightmap"}`, - extensions: ["png"], - resource_id: formResult.depthMap, - startpath: Project.export_path, - savetype: "image", - }, - (filePath) => { - textureSet["minecraft:texture_set"][ - useNormalMap ? "normal" : "heightmap" - ] = pathToName(filePath, false); - cb(); - }, - ); - }; - - const exportBaseColor = (cb: () => void) => { - if (!projectColorMap) { - return cb(); - } - - Blockbench.export( - { - content: projectColorMap.canvas.toDataURL(), - extensions: ["png"], - type: "PNG", - name: baseName, - startpath: Project.export_path, - savetype: "image", - }, - (filePath) => { - textureSet["minecraft:texture_set"].color = pathToName( - filePath, - false, - ); - cb(); - }, - ); - }; - - const exportTextureSet = () => - exportDepthMap(() => { - exportBaseColor(() => { - Blockbench.export( - { - content: JSON.stringify(textureSet, null, 2), - type: "JSON", - name: `${baseName}.texture_set`, - extensions: ["json"], - resource_id: "texture_set", - startpath: Project.export_path, - savetype: "text", - }, - () => { - Blockbench.showQuickMessage("Texture set created", 2000); - textureSetDialog.hide(); - }, - ); - }); - }); - - if (hasMer) { - exportMer(baseName, (filePath) => { - textureSet["minecraft:texture_set"].metalness_emissive_roughness = - pathToName(filePath, false); - exportTextureSet(); - }); - return; - } - - exportTextureSet(); - }, - cancelIndex: 1, - }); - - textureSetDialog.show(); - - return textureSetDialog; - }); - }; - - // - // Events - // - - /** - * List of Blockbench events which trigger a PBR material update - */ - const subscribeToEvents: EventName[] = [ - "undo", - "redo", - "add_texture", - "finish_edit", - "finished_edit", - "load_project", - "select_preview_scene", - "change_texture_path", - "select_project", - ]; - - /** - * Conditionally triggers the PBR material update based on the `pbr_active` setting - * @returns void - */ - const renderPbrScene = () => - Project && Project.pbr_active && applyPbrMaterial(); - - const enableListeners = () => { - subscribeToEvents.forEach((event) => { - Blockbench.addListener(event as EventName, renderPbrScene); - }); - }; - - const disableListeners = () => { - subscribeToEvents.forEach((event) => { - Blockbench.removeListener(event as EventName, renderPbrScene); - }); - }; - - // - // Setup - // - const onload = () => { - // - // Controls - // - - tonemappingSelect = new BarSelect("display_settings_tone_mapping", { - category: "preview", - name: "Tone Mapping", - description: "Changes the tone mapping of the preview", - type: "select", - default_value: THREE.NoToneMapping, - value: Preview.selected.renderer.toneMapping ?? THREE.NoToneMapping, - icon: "monochrome_photos", - options: { - [THREE.NoToneMapping]: "None", - [THREE.LinearToneMapping]: "Linear", - [THREE.ReinhardToneMapping]: "Reinhard", - [THREE.CineonToneMapping]: "Cineon", - [THREE.ACESFilmicToneMapping]: "ACES", - }, - onChange({ value }) { - const currentExposure = Number(exposureSlider.get()); - Preview.all.forEach((preview) => { - preview.renderer.toneMapping = Number(value) as THREE.ToneMapping; - preview.renderer.toneMappingExposure = currentExposure; - }); - - Preview.selected.renderer.toneMapping = Number( - value, - ) as THREE.ToneMapping; - Preview.selected.renderer.toneMappingExposure = currentExposure; - - Blockbench.showQuickMessage( - `Tone mapping set to ${this.getNameFor(value)}`, - 2000, - ); - - if (!togglePbr.value) { - togglePbr.set(true); - } - - applyPbrMaterial(); - }, - }); - - exposureSlider = new BarSlider("display_settings_exposure", { - category: "preview", - name: "Exposure", - description: "Adjusts the exposure of the scene", - type: "number", - value: 1, - icon: "exposure", - step: 0.1, - min: -2, - max: 2, - // condition: () => Number(tonemappingSelect.get()) !== THREE.NoToneMapping, - onBefore() { - if (Number(tonemappingSelect.get()) === THREE.NoToneMapping) { - // @ts-expect-error `.change()` does not require an Event for its value - tonemappingSelect.change(THREE.LinearToneMapping.toString()); - } - togglePbr.set(true); - }, - onChange({ value }) { - const exposureValue = Math.max(-2, Math.min(2, Number(value))); - Preview.all.forEach((preview) => { - preview.renderer.toneMappingExposure = exposureValue; - }); - - Preview.selected.renderer.toneMappingExposure = exposureValue; - }, - onAfter() { - applyPbrMaterial(); - }, - }); - - bakeTexturesDialog = new Dialog(`${PLUGIN_ID}_bake_textures`, { - id: `${PLUGIN_ID}_bake_textures`, - title: "Bake Textures", - buttons: ["Bake", "Cancel"], - form: { - ambientLight: { - type: "color", - label: "Ambient Light", - value: "#1f1f1f", - }, - lightDiffuse: { - type: "color", - label: "Light Diffuse", - value: "#ffffff", - }, - lightHeight: { - type: "range", - label: "Light Height", - min: 0, - max: 1, - step: 0.01, - value: 0.66, - }, - minLightIntensity: { - type: "range", - label: "Minimum Light Intensity", - min: 0, - max: 1, - step: 0.01, - value: 0, - }, - directions: { - type: "number", - label: "Directions", - value: 8, - min: 1, - max: 360, - step: 1, - }, - blendEmissive: { - type: "checkbox", - label: "Blend Emissive", - value: false, - }, - }, - onConfirm(formResult: Record) { - const ambientLight = new THREE.Color( - formResult.ambientLight.toString(), - ); - const lightDiffuse = new THREE.Color( - formResult.lightDiffuse.toString(), - ); - bakeTextures( - { - ambientLight: [ambientLight.r, ambientLight.g, ambientLight.b], - lightDiffuse: [lightDiffuse.r, lightDiffuse.g, lightDiffuse.b], - lightHeight: Number(formResult.lightHeight), - minLightIntensity: Number(formResult.minLightIntensity), - }, - formResult.directions ?? 8, - formResult.blendEmissive ?? false, - ); - }, - }); - - // - // Actions - // - - bakeTexturesAction = new Action(`${PLUGIN_ID}_bake_textures`, { - icon: "cake", - name: "Bake Textures", - description: "Bakes textures for the selected PBR material", - click() { - bakeTexturesDialog.show(); - }, - }); - - generateNormal = new Action(`${PLUGIN_ID}_generate_normal`, { - icon: "altitude", - name: "Generate Normal Map", - description: "Generates a normal map from the height map", - condition: () => - (TextureLayer.selected || Texture.all.find((t) => t.selected)) !== - undefined, - click() { - const texture: Texture | TextureLayer = - TextureLayer.selected ?? - (!!Project && Project.selected_texture - ? Project.selected_texture.selected_layer ?? - Project.selected_texture - : Texture.getDefault()); - - if (!texture) { - return; - } - - const mat = new PbrMaterial( - texture instanceof Texture && texture.layers_enabled - ? texture.layers - : getProjectTextures(), - texture.uuid, - ); - - const normalMap = PbrMaterial.createNormalMap(texture); - - if (normalMap) { - mat.saveTexture(CHANNELS.normal, normalMap); - normalMap.select(); - Blockbench.showQuickMessage("Normal map generated", 2000); - return; - } - - Blockbench.showQuickMessage("Failed to generate normal map", 2000); - }, - }); - - generateMer = new Action(`${PLUGIN_ID}_create_mer`, { - icon: "lightbulb_circle", - name: "Export MER", - description: - "Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)", - condition: { - formats: ["bedrock_block", "bedrock_entity"], - project: true, - }, - click() { - exportMer(); - }, - }); - - decodeMer = new Action(`${PLUGIN_ID}_decode_mer`, { - icon: "arrow_split", - name: "Decode MER", - description: - "Decodes a MER texture map into metalness, emissive, and roughness channels", - condition: () => - !!Project && - Project.selected_texture !== null && - !Project.selected_texture.layers_enabled, - click() { - const selected = - TextureLayer.selected?.texture ?? - Texture.all.find((t) => t.selected) ?? - Texture.getDefault(); - - const mat = new PbrMaterial( - selected.layers_enabled ? selected.layers : [selected], - selected.uuid, - ); - - const mer = mat.decodeMer(); - const merChannels = [ - CHANNELS.metalness, - CHANNELS.emissive, - CHANNELS.roughness, - ]; - - Undo.initEdit({ textures: [selected] }); - selected.activateLayers(true); - - merChannels.forEach((channel) => { - const key = channel.id as keyof typeof mer; - const canvas = mer[key]; - - if (!canvas) { - Blockbench.showStatusMessage( - `Failed to decode ${channel.label} channel`, - 3000, - ); - return; - } - - const layer = new TextureLayer( - { - name: `${selected?.name}_${key}`, - data_url: canvas.toDataURL(), - }, - selected, - ); - - mat.saveTexture(channel, layer); - - layer.addForEditing(); - }); - - Undo.finishEdit("Decode MER"); - }, - }); - - createTextureSet = new Action(`${PLUGIN_ID}_create_texture_set`, { - name: "Create Texture Set", - icon: "layers", - description: - "Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.", - click() { - createTextureSetDialog(); - }, - condition: { - formats: ["bedrock_block", "bedrock_entity"], - project: true, - }, - }); - - createMaterialTexture = new Action(`${PLUGIN_ID}_create_material_texture`, { - icon: "stacks", - name: "Create Material Texture", - description: "Creates a new texture for a PBR material", - click() { - if (!Project) { - return; - } - - const texture = new Texture({ - name: "New Material", - saved: false, - particle: false, - keep_size: false, - layers_enabled: true, - }); - - const filler = colorDataUrl(new THREE.Color(0x808080)); - - if (!filler) { - return; - } - - texture.fromDataURL(filler).add().select(); - - // Create PBR channels as texture layers for the new texture - Object.keys(CHANNELS).forEach((key) => { - const channel = CHANNELS[key]; - - const layer = new TextureLayer( - { - name: channel.label, - visible: true, - }, - texture, - ); - - layer.setSize( - Project.texture_width ?? texture.width, - Project.texture_height ?? texture.height, - ); - - const data = colorDataUrl( - channel.default ?? new THREE.Color(0), - layer.canvas, - ); - - if (data) { - layer.texture.fromDataURL(data); - } - - layer.extend({ channel: channel.id }); - - layer.addForEditing(); - }); - }, - }); - - Object.entries(CHANNELS).forEach(([key, channel]) => { - channelActions[key] = new Action(`${PLUGIN_ID}_assign_channel_${key}`, { - icon: channel.icon ?? "tv_options_edit_channels", - name: `Assign to ${channel.label.toLocaleLowerCase()} channel`, - description: `Assign the selected layer to the ${channel.label} channel`, - category: "textures", - condition: () => - Modes.paint && - (TextureLayer.selected || - (Project && Project.selected_texture !== null)), - click(e) { - const layer = - TextureLayer.selected ?? - (Project ? Project.selected_texture : null); - - if (!layer || !Project) { - return; - } - - Undo.initEdit({ layers: [layer] }); - - layer.extend({ channel: channel.id }); - - const texture = layer instanceof TextureLayer ? layer.texture : layer; - - texture.updateChangesAfterEdit(); - - if (!Project.pbr_materials[texture.uuid]) { - Project.pbr_materials[texture.uuid] = {}; - } - - // If the layer uuid is already assigned to another channel, unassign it first - Object.entries(Project.pbr_materials[texture.uuid]).forEach( - ([assignedChannel, assignedLayerUuid]) => { - if (assignedLayerUuid === layer.uuid) { - delete Project.pbr_materials[texture.uuid][assignedChannel]; - layer.channel = NA_CHANNEL; - } - }, - ); - - Project.pbr_materials[texture.uuid][key] = layer.uuid; - - Undo.finishEdit("Change channel assignment"); - - Blockbench.showQuickMessage( - `Assigned "${layer.name}" to ${channel.label} channel`, - 2000, - ); - - applyPbrMaterial(); - }, - }); - }); - - unassignChannel = new Action(`${PLUGIN_ID}_unassign_channel`, { - icon: "cancel", - name: "Unassign Channel", - description: "Unassign the selected layer from the channel", - category: "textures", - condition: () => { - if (!Modes.paint) { - return false; - } - - if (TextureLayer.selected) { - return ( - TextureLayer.selected.channel !== NA_CHANNEL || - !TextureLayer.selected.channel - ); - } - - if (!Project) { - return false; - } - - const texture = Project.selected_texture; - - return ( - texture !== null && - (texture.channel !== NA_CHANNEL || !texture.channel) - ); - }, - click() { - const layer = - TextureLayer.selected ?? (Project ? Project.selected_texture : null); - - if (!layer || !Project) { - return; - } - - Undo.initEdit({ layers: [layer] }); - - const texture = layer instanceof TextureLayer ? layer.texture : layer; - const prevChannel = layer.channel; - - Project.pbr_materials[texture.uuid] = {}; - - layer.channel = NA_CHANNEL; - - texture.updateChangesAfterEdit(); - Undo.finishEdit("Unassign channel"); - - Blockbench.showQuickMessage( - `Unassigned "${layer.name}" from ${prevChannel} channel`, - 2000, - ); - - applyPbrMaterial(); - }, - }); - - togglePbr = new Toggle("toggle_pbr", { - name: "PBR Preview", - description: "Toggle PBR Preview", - icon: "panorama_photosphere", - category: "view", - default: false, - click() {}, - onChange(value) { - if (value) { - applyPbrMaterial(); - enableListeners(); - - Blockbench.showQuickMessage("PBR Preview is now enabled"); - - return; - } - disablePbr(); - disableListeners(); - - Blockbench.showQuickMessage("PBR Preview is now disabled"); - }, - }); - - toggleCorrectLights = new Toggle(`${PLUGIN_ID}_correct_lights`, { - category: "preview", - name: "Correct Lights", - description: "Corrects the lighting in the preview", - icon: "fluorescent", - default: false, - onChange(value) { - Preview.all.forEach((preview) => { - preview.renderer.physicallyCorrectLights = value; - }); - - Preview.selected.renderer.physicallyCorrectLights = value; - - Blockbench.showQuickMessage( - `Physically corrected lighting is now ${value ? "enabled" : "disabled"}`, - 2000, - ); - - if (value) { - togglePbr.set(true); - } - - applyPbrMaterial(); - }, - click() {}, - }); - - // - // Tools - // - - brushMetalnessSlider = new NumSlider("slider_brush_metalness", { - category: "paint", - name: "Metalness", - description: "Adjust the metalness of the brush", - settings: { - min: 0, - max: 1, - step: 0.01, - default: 0, - }, - condition: () => { - if (!Project) { - return false; - } - - const texture = Project.selected_texture; - - if (!texture?.layers_enabled) { - return false; - } - - return ( - texture.layers.find( - ({ channel }) => channel === CHANNELS.metalness.id, - ) !== undefined - ); - }, - }); - - brushRoughnessSlider = new NumSlider("slider_brush_roughness", { - category: "paint", - name: "Roughness", - description: "Adjust the roughness of the brush", - settings: { - min: 0, - max: 1, - step: 0.01, - default: 1, - }, - condition: () => { - if (!Project) { - return false; - } - - const texture = Project.selected_texture; - - if (!texture?.layers_enabled) { - return false; - } - - return ( - texture.layers.find( - ({ channel }) => channel === CHANNELS.roughness.id, - ) !== undefined - ); - }, - }); - - brushEmissiveColor = new ColorPicker("brush_emissive_color", { - category: "paint", - name: "Emissive", - description: "Adjust the emissive color of the brush", - value: "#000000", - condition: () => { - if (!Project) { - return false; - } - - const texture = Project.selected_texture; - - if (!texture?.layers_enabled) { - return false; - } - - return ( - texture.layers.find( - ({ channel }) => channel === CHANNELS.emissive.id, - ) !== undefined - ); - }, - }); - - brushHeightSlider = new NumSlider("slider_brush_height", { - category: "paint", - name: "Height", - description: "Adjust the height of the brush", - settings: { - min: 0, - max: 1, - step: 0.01, - default: 0.5, - }, - condition: () => { - if (!Project) { - return false; - } - - const texture = Project.selected_texture; - - if (!texture?.layers_enabled) { - return false; - } - - return ( - texture.layers.find( - ({ channel }) => channel === CHANNELS.height.id, - ) !== undefined - ); - }, - }); - - materialBrushTool = new Tool("material_brush", { - name: "Material Brush", - description: "Paints across multiple texture layers", - icon: "view_in_ar", - paintTool: true, - cursor: "cell", - condition: () => - Modes.paint && - !!Project && - Project.selected_texture && - Project.selected_texture.layers_enabled, - brush: { - blend_modes: false, - shapes: true, - size: true, - softness: true, - opacity: true, - offset_even_radius: true, - floor_coordinates: true, - changePixel(x, y, px, alpha, { size, softness, texture }) { - const mat = MaterialBrush.fromSettings(); - - const matChannels = Object.keys(mat.colors); - - let rgba = px; - - texture.layers.forEach((layer) => { - if (!layer.visible || !matChannels.includes(layer.channel)) { - return; - } - - const fill = mat.getChannel(layer.channel); - - if (!fill) { - return; - } - - // TODO: Let softness affect the brush - - layer.ctx.fillStyle = fill.getStyle(); - layer.ctx.fillRect(size * x, size * y, size, size); - - if (layer.selected) { - rgba = { - r: fill.r * 255, - g: fill.g * 255, - b: fill.b * 255, - a: alpha * 255, - }; - } - }); - - return rgba; - }, - }, - onCanvasClick(data) { - Painter.startPaintToolCanvas(data, data.event); - }, - onSelect() { - applyPbrMaterial(); - }, - click() { - applyPbrMaterial(); - }, - }); - - // - // UI - // - - channelMenu = new Menu( - `${PLUGIN_ID}_channel_menu`, - [ - ...Object.keys(CHANNELS).map( - (key) => `${PLUGIN_ID}_assign_channel_${key}`, - ), - ...[`${PLUGIN_ID}_unassign_channel`], - ], - { - onOpen() { - applyPbrMaterial(); - }, - }, - ); - - openChannelMenu = new Action("pbr_channel_menu", { - name: "Assign to PBR Channel", - icon: "texture", - click(event) { - channelMenu.open(event as MouseEvent); - }, - children: [...Object.values(channelActions), unassignChannel], - }); - - showChannelMenu = new Action(`${PLUGIN_ID}_show_channel_menu`, { - icon: "texture", - name: "Assign to PBR Channel", - description: "Assign the selected layer to a channel", - category: "textures", - condition: () => - Modes.paint && - (TextureLayer.selected || - (Project && Project.selected_texture !== null)), - click(event) { - channelMenu.open(event as MouseEvent); - }, - }); - - displaySettingsPanel = new Panel(`${PLUGIN_ID}_display_settings`, { - name: "PBR Settings", - id: `${PLUGIN_ID}_display_settings_panel`, - icon: "display_settings", - toolbars: [ - new Toolbar(`${PLUGIN_ID}_controls_toolbar`, { - id: `${PLUGIN_ID}_controls_toolbar`, - children: [ - "toggle_pbr", - `${PLUGIN_ID}_correct_lights`, - `${PLUGIN_ID}_create_material_texture`, - `${PLUGIN_ID}_show_channel_menu`, - ], - name: "PBR", - }), - new Toolbar(`${PLUGIN_ID}_display_settings_toolbar`, { - id: `${PLUGIN_ID}_display_settings_toolbar`, - children: [ - "display_settings_tone_mapping", - "display_settings_exposure", - ], - name: "Display Settings", - }), - ], - display_condition: { - modes: ["edit", "paint", "animate"], - project: true, - }, - component: {}, - expand_button: true, - growable: false, - onFold() {}, - onResize() {}, - default_side: "left", - default_position: { - slot: "left_bar", - float_position: [0, 0], - float_size: [400, 300], - height: 300, - folded: false, - }, - insert_after: "textures", - insert_before: "color", - }); - - materialBrushPanel = new Panel(`${PLUGIN_ID}_material_brush_panel`, { - name: "Material Brush", - id: `${PLUGIN_ID}_material_brush_panel`, - icon: "view_in_ar", - toolbars: [ - new Toolbar(`${PLUGIN_ID}_material_brush_toolbar`, { - id: `${PLUGIN_ID}_material_brush_toolbar`, - children: [ - "material_brush", - "slider_brush_metalness", - "slider_brush_roughness", - "brush_emissive_color", - "slider_brush_height", - ], - name: "Material Brush", - }), - ], - display_condition: { - modes: ["paint"], - project: true, - }, - component: {}, - expand_button: true, - growable: false, - onFold() {}, - onResize() {}, - default_side: "right", - default_position: { - slot: "right_bar", - float_position: [0, 0], - float_size: [400, 300], - height: 300, - folded: false, - }, - insert_after: "color", - insert_before: "outliner", - }); - - MenuBar.addAction(generateMer, "file.export"); - MenuBar.addAction(generateNormal, "tools"); - MenuBar.addAction(decodeMer, "tools"); - MenuBar.addAction(createTextureSet, "file.export"); - MenuBar.addAction(togglePbr, "view"); - MenuBar.addAction(toggleCorrectLights, "preview"); - MenuBar.addAction(createMaterialTexture, "tools"); - MenuBar.addAction(bakeTexturesAction, "tools"); - MenuBar.addAction(materialBrushTool, "tools.0"); - - MenuBar.addAction(openChannelMenu, "image.0"); + setups.forEach((setup) => setup()); }; - // - // Teardown - // const onunload = () => { - Object.entries(channelActions).forEach(([key, action]) => { - action.delete(); + teardowns.forEach((teardown) => teardown()); + Object.entries(registry).forEach(([key, value]) => { + try { + value?.delete(); + } catch (err) { + console.error(`Failed to delete ${key} action:`, err); + } }); - - MenuBar.removeAction(`file.export.${PLUGIN_ID}_create_mer`); - MenuBar.removeAction(`file.export.${PLUGIN_ID}_create_texture_set`); - MenuBar.removeAction(`tools.${PLUGIN_ID}_generate_normal`); - disableListeners(); - - displaySettingsPanel?.delete(); - textureSetDialog?.delete(); - createMaterialTexture?.delete(); - generateMer?.delete(); - generateNormal?.delete(); - togglePbr?.delete(); - decodeMer?.delete(); - bakeTexturesAction?.delete(); - bakeTexturesDialog?.delete(); - createTextureSet?.delete(); - textureChannelProp?.delete(); - channelProp?.delete(); - showChannelMenu?.delete(); - exposureSlider?.delete(); - tonemappingSelect?.delete(); - toggleCorrectLights?.delete(); - unassignChannel?.delete(); - projectMaterialsProp?.delete(); - pbrMaterialsProp?.delete(); - projectPbrModeProp?.delete(); - materialBrushTool?.delete(); - materialBrushPanel?.delete(); - setBrushMaterial?.delete(); - brushMetalnessSlider?.delete(); - brushRoughnessSlider?.delete(); - brushEmissiveColor?.delete(); - brushHeightSlider?.delete(); - openChannelMenu?.delete(); }; - // - // Plugin Registration - // - - BBPlugin.register(PLUGIN_ID, { - version: PLUGIN_VERSION, + BBPlugin.register("pbr_preview", { + // @ts-expect-error Version does exist in PluginOptions + version: "1.1.0", title: "PBR Features", author: "Jason J. Gardner", description: @@ -2329,7 +43,7 @@ interface ILightrParams { new_repository_format: true, repository: "https://github.com/jasonjgardner/blockbench-plugins", has_changelog: true, - min_version: "4.10.1", + min_version: "4.10.2", onload, onunload, }); diff --git a/src/pbr_preview/src/lib/Lightr.ts b/src/pbr_preview/src/lib/Lightr.ts new file mode 100644 index 00000000..f68da3f0 --- /dev/null +++ b/src/pbr_preview/src/lib/Lightr.ts @@ -0,0 +1,135 @@ +import type { ILightrParams } from "../types"; +/** + * Adapted from Lightr by phosphoer + * @see https://github.com/phosphoer/lightr + */ +export class Lightr { + lightHeight: number; + ambientLight: [number, number, number]; + minLightIntensity: number; + lightDiffuse: [number, number, number]; + + constructor({ + lightHeight = 0.66, + ambientLight = [0.1, 0.1, 0.1], + minLightIntensity = 0.0, + lightDiffuse = [1, 1, 1], + }: ILightrParams = {}) { + this.lightHeight = lightHeight; + this.ambientLight = ambientLight; + this.minLightIntensity = minLightIntensity; + this.lightDiffuse = lightDiffuse; + } + + bake( + numDirs: number, + diffuseMap: HTMLImageElement | HTMLCanvasElement, + normalMap: HTMLImageElement | HTMLCanvasElement, + ): HTMLCanvasElement[] { + const canvasDiffuse = + diffuseMap instanceof HTMLCanvasElement + ? diffuseMap + : this.createCanvas(diffuseMap.width, diffuseMap.height); + const canvasNormals = + normalMap instanceof HTMLCanvasElement + ? normalMap + : this.createCanvas(normalMap.width, normalMap.height); + + const contextDiffuse = canvasDiffuse.getContext("2d")!; + const contextNormals = canvasNormals.getContext("2d")!; + + contextDiffuse.drawImage(diffuseMap, 0, 0); + contextNormals.drawImage(normalMap, 0, 0); + + const bufferDiffuse = contextDiffuse.getImageData( + 0, + 0, + diffuseMap.width, + diffuseMap.height, + ); + const bufferNormals = contextNormals.getImageData( + 0, + 0, + normalMap.width, + normalMap.height, + ); + + const bakedImages: HTMLCanvasElement[] = []; + const normals: [number, number, number][][] = []; + + for (let x = 0; x < bufferNormals.width; ++x) { + normals[x] = []; + for (let y = 0; y < bufferNormals.height; ++y) { + const idx = (x + y * bufferNormals.width) * 4; + + const normal = [ + (bufferNormals.data[idx + 0] / 255 - 0.5) * 2, + (bufferNormals.data[idx + 1] / 255 - 0.5) * 2, + (bufferNormals.data[idx + 2] / 255 - 0.5) * 2, + ]; + + const len = Math.sqrt(normal[0] ** 2 + normal[1] ** 2 + normal[2] ** 2); + normals[x][y] = [normal[0] / len, normal[1] / len, normal[2] / len]; + } + } + + const bakeDirection = (dir: number): HTMLCanvasElement => { + const canvas = this.createCanvas(diffuseMap.width, diffuseMap.height); + const context = canvas.getContext("2d")!; + const buffer = context.getImageData(0, 0, canvas.width, canvas.height); + + const lightDir = [Math.cos(dir), Math.sin(dir), this.lightHeight]; + + for (let x = 0; x < bufferNormals.width; ++x) { + for (let y = 0; y < bufferNormals.height; ++y) { + const normal = normals[x][y]; + const index = (x + y * bufferNormals.width) * 4; + const diffuse = [ + bufferDiffuse.data[index + 0] / 255, + bufferDiffuse.data[index + 1] / 255, + bufferDiffuse.data[index + 2] / 255, + bufferDiffuse.data[index + 3], + ]; + + let intensity = + normal[0] * lightDir[0] + + normal[1] * lightDir[1] + + normal[2] * lightDir[2]; + intensity = Math.min(1, Math.max(this.minLightIntensity, intensity)); + + const out = [ + intensity * diffuse[0] * this.lightDiffuse[0] + + this.ambientLight[0], + intensity * diffuse[1] * this.lightDiffuse[1] + + this.ambientLight[1], + intensity * diffuse[2] * this.lightDiffuse[2] + + this.ambientLight[2], + diffuse[3], + ]; + + buffer.data[index + 0] = Math.floor(out[0] * 255); + buffer.data[index + 1] = Math.floor(out[1] * 255); + buffer.data[index + 2] = Math.floor(out[2] * 255); + buffer.data[index + 3] = out[3]; + } + } + + context.putImageData(buffer, 0, 0); + return canvas; + }; + + for (let i = 0; i < numDirs; ++i) { + const lightDir = ((Math.PI * 2) / numDirs) * i; + bakedImages.push(bakeDirection(lightDir)); + } + + return bakedImages; + } + + private createCanvas(width: number, height: number): HTMLCanvasElement { + const canvas = document.createElement("canvas"); + canvas.width = width; + canvas.height = height; + return canvas; + } +} diff --git a/src/pbr_preview/src/lib/MaterialBrush.ts b/src/pbr_preview/src/lib/MaterialBrush.ts new file mode 100644 index 00000000..f3649b97 --- /dev/null +++ b/src/pbr_preview/src/lib/MaterialBrush.ts @@ -0,0 +1,74 @@ +import type { IChannel } from "../types"; +import { CHANNELS, registry } from "../constants"; +import { three as THREE } from "../deps"; + +/** + * ### Material Brush + * Class for painting across multiple TextureLayers in a Texture + * Used to iterate over PBR channels and apply a brush value to each layer + * at the same UV coordinates + */ +export class MaterialBrush { + private _colors: Record; + + constructor({ colors }: { colors?: Record }) { + this._colors = { + ...Object.fromEntries( + Object.keys(CHANNELS).map((key) => [ + key, + CHANNELS[key].default ?? new THREE.Color(0xffffff00), + ]), + ), + ...colors, + }; + } + + get colors() { + return this._colors; + } + + set colors(colors: Record) { + this._colors = { ...this._colors, ...colors }; + } + + toString() { + const colors = Object.entries(this._colors).map(([key, color]) => [ + key, + color.getHexString(), + ]); + return JSON.stringify(colors); + } + + getChannel(channel: IChannel["id"]) { + return this._colors[channel]; + } + + static makeLinearColor(value: number) { + const clamped = Math.min(1, Math.max(0, value)); + return new THREE.Color(clamped, clamped, clamped).convertSRGBToLinear(); + } + + static fromSettings() { + const defaultEmissive = "#000000"; + const metalnessValue = Number(registry.brushMetalnessSlider?.get()); + const roughnessValue = Number(registry.brushRoughnessSlider?.get() ?? 1); + const emissiveValue = ( + registry.brushEmissiveColor?.get() ?? defaultEmissive + ).toString(); + const heightValue = Number(registry.brushHeightSlider?.get()); + // @ts-expect-error ColorPanel global is not typed + const currentColor = ColorPanel.get(); + + const colors = { + [CHANNELS.albedo.id]: new THREE.Color(currentColor), + [CHANNELS.metalness.id]: MaterialBrush.makeLinearColor(metalnessValue), + [CHANNELS.roughness.id]: MaterialBrush.makeLinearColor(roughnessValue), + [CHANNELS.emissive.id]: new THREE.Color(emissiveValue ?? defaultEmissive), + [CHANNELS.height.id]: MaterialBrush.makeLinearColor(heightValue), + [CHANNELS.normal.id]: + CHANNELS.normal.default ?? new THREE.Color("#8080ff"), + }; + + return new MaterialBrush({ colors }); + } +} diff --git a/src/pbr_preview/src/lib/PbrMaterials.ts b/src/pbr_preview/src/lib/PbrMaterials.ts new file mode 100644 index 00000000..7fefaf6e --- /dev/null +++ b/src/pbr_preview/src/lib/PbrMaterials.ts @@ -0,0 +1,898 @@ +import type { IChannel } from "../types"; +import { CHANNELS, NA_CHANNEL } from "../constants"; +import { three as THREE } from "../deps"; + +const getProjectTextures = (layers = true) => { + const allTextures = Project ? Project.textures ?? Texture.all : Texture.all; + + if (!layers) { + return allTextures; + } + + return allTextures + .filter((t: Texture) => t.layers_enabled && t.layers.length > 0) + .flatMap((t: Texture) => t.layers); +}; + +/** + * ### PBR Material + * Class for handling PBR materials in Blockbench + * + * Uses a texture's layers to generate a PBR material, + * or a project's textures if no layers are available. + */ +export default class PbrMaterial { + private _scope: Array; + private _materialUuid: string; + + constructor( + scope: Array | null, + materialUuid: string, + ) { + this._scope = scope ?? getProjectTextures(); + this._materialUuid = materialUuid; + } + + merToCanvas() { + let emissiveMap = this.getTexture(CHANNELS.emissive); + let roughnessMap = this.getTexture(CHANNELS.roughness); + let metalnessMap = this.getTexture(CHANNELS.metalness); + + if (!emissiveMap && !roughnessMap && !metalnessMap) { + const { metalness, emissive, roughness } = this.decodeMer(); + + if (metalness) { + metalnessMap = PbrMaterial.makePixelatedCanvas(metalness); + } + + if (emissive) { + emissiveMap = PbrMaterial.makePixelatedCanvas(emissive); + } + + if (roughness) { + roughnessMap = PbrMaterial.makePixelatedCanvas(roughness); + } + } + + return { + emissiveMap, + roughnessMap, + metalnessMap, + }; + } + + getMaterial(options: THREE.MeshStandardMaterialParameters = {}) { + const { emissiveMap, roughnessMap, metalnessMap } = this.merToCanvas(); + + const normalMap = this.getTexture(CHANNELS.normal); + + return new THREE.MeshStandardMaterial({ + map: + this.getTexture(CHANNELS.albedo) ?? + PbrMaterial.makePixelatedCanvas( + TextureLayer.selected?.canvas ?? + Texture.all.find((t) => t.selected)?.canvas ?? + Texture.getDefault().canvas, + ), + aoMap: this.getTexture(CHANNELS.ao), + bumpMap: this.getTexture(CHANNELS.height), + normalMap, + normalScale: new THREE.Vector2(1, 1), + metalnessMap, + metalness: metalnessMap ? 1 : 0, + roughnessMap, + roughness: 1, + emissiveMap, + emissiveIntensity: emissiveMap ? 1 : 0, + emissive: emissiveMap ? 0xffffff : 0, + envMap: PreviewScene.active?.cubemap ?? null, + envMapIntensity: 0.95, + alphaTest: 0.5, + ...options, + }); + } + + saveTexture(channel: IChannel, texture: Texture | TextureLayer) { + if (!Project) { + return; + } + + if (!Project.pbr_materials) { + Project.pbr_materials = {}; + } + + if (!Project.pbr_materials[this._materialUuid]) { + Project.pbr_materials[this._materialUuid] = {}; + } + + Project.pbr_materials[this._materialUuid][channel.id] = texture.uuid; + texture.extend({ channel: channel.id }); + } + + /** + * ### Find channel texture + * @param name Channel to find + * @param inference Whether or not to infer the texture based on the channel name + * @returns The channel if it exists in the project, otherwise `null` + */ + findTexture( + name: string | IChannel, + inference = true, + ): Texture | TextureLayer | null { + if (!Project) { + return null; + } + + const materialChannel = this._scope.find( + (t) => t.channel && (t.channel === name || t.channel === name.id), + ); + + if (materialChannel) { + return materialChannel; + } + + const channel = typeof name === "string" ? name : name.id; + + Project.pbr_materials ??= {}; + const materialData = Project.pbr_materials[this._materialUuid]; + + // Don't infer the channel if it has already been assigned to NA_CHANNEL + if (!materialData && inference && channel !== NA_CHANNEL) { + const filenameRegex = new RegExp(`_*${channel}(\.[^.]+)?$`, "i"); + return this._scope.find((t) => filenameRegex.test(t.name)) ?? null; + } + + const textureUuid = materialData?.[channel]; + + if (!textureUuid) { + return null; + } + + return this._scope.find((t) => t.uuid === textureUuid) ?? null; + } + + /** + * Helper function to create a canvas texture with pixelated filtering + * @param canvas Texture canvas source + * @returns `THREE.CanvasTexture` with pixelated filtering + */ + static makePixelatedCanvas(canvas: HTMLCanvasElement) { + const texture = new THREE.CanvasTexture( + canvas, + undefined, + undefined, + undefined, + THREE.NearestFilter, + THREE.NearestFilter, + ); + + texture.needsUpdate = true; + + return texture; + } + + /** + * Searches for a texture and creates a canvas element with the texture data if found + * @param name The name of the texture to search for. Use a channel or a texture name or UUID + * @param scope An array of textures to search in. Defaults to all textures in the project + */ + getTexture(name: string | IChannel) { + const texture = this.findTexture(name); + return texture ? PbrMaterial.makePixelatedCanvas(texture.canvas) : null; + } + + static extractChannel( + texture: Texture | TextureLayer, + channel: "r" | "g" | "b" | "a", + ) { + const canvas = texture.canvas; + const width = canvas.width; + const height = canvas.height; + + const ctx = canvas.getContext("2d"); + + if (!ctx || !width || !height) { + return null; + } + + const channelCanvas = document.createElement("canvas"); + channelCanvas.width = width; + channelCanvas.height = height; + + const channelCtx = channelCanvas.getContext("2d"); + + if (!channelCtx) { + return null; + } + + const channelIdx = { r: 0, g: 1, b: 2, a: 3 }[channel]; + + const { data } = ctx.getImageData(0, 0, width, height); + + const channelData = new Uint8ClampedArray(width * height * 4); + + for (let idx = 0; idx < data.length; idx += 4) { + channelData[idx] = data[idx + channelIdx]; + channelData[idx + 1] = data[idx + channelIdx]; + channelData[idx + 2] = data[idx + channelIdx]; + channelData[idx + 3] = 255; + } + + const imageData = new ImageData(channelData, width, height); + + channelCtx.putImageData(imageData, 0, 0); + + return channelCanvas; + } + + decodeMer(emissiveThreshold = 1): { + metalness?: HTMLCanvasElement | null; + emissive?: HTMLCanvasElement | null; + emissiveLevel?: HTMLCanvasElement | null; + roughness?: HTMLCanvasElement | null; + sss?: HTMLCanvasElement | null; + } { + const texture = this.findTexture("mer", true); + + if (!texture) { + return { + metalness: null, + emissive: null, + emissiveLevel: null, + roughness: null, + sss: null, + }; + } + + const metalness = PbrMaterial.extractChannel(texture, "r"); + const emissiveLevel = PbrMaterial.extractChannel(texture, "g"); + const roughness = PbrMaterial.extractChannel(texture, "b"); + const sss = PbrMaterial.extractChannel(texture, "a"); + + const emissive = document.createElement("canvas"); + emissive.width = texture.img.width ?? 16; + emissive.height = texture.img.height ?? 16; + + // Use emissiveLevel as mask for getting emissive color from albedo channel + const albedo = this.findTexture(CHANNELS.albedo); + + if (albedo) { + emissive.width = albedo.img.width ?? 16; + emissive.height = albedo.img.height ?? 16; + } + + const emissiveCtx = emissive.getContext("2d"); + const emissiveLevelCtx = emissiveLevel?.getContext("2d"); + const albedoCtx = albedo?.canvas?.getContext("2d"); + + if (!emissiveCtx || !albedoCtx || !emissiveLevelCtx) { + return { + metalness, + emissive: emissiveLevel, + roughness, + sss, + }; + } + + // Write the albedo color to the emissive canvas where the emissive level is greater than a certain threshold + const albedoData = albedoCtx.getImageData( + 0, + 0, + emissive.width, + emissive.height, + ); + const emissiveLevelData = emissiveLevelCtx.getImageData( + 0, + 0, + emissive.width, + emissive.height, + ); + + const emissiveData = new Uint8ClampedArray( + emissive.width * emissive.height * 4, + ); + + for (let idx = 0; idx < albedoData.data.length; idx += 4) { + if (emissiveLevelData.data[idx] > emissiveThreshold) { + emissiveData[idx] = albedoData.data[idx]; + emissiveData[idx + 1] = albedoData.data[idx + 1]; + emissiveData[idx + 2] = albedoData.data[idx + 2]; + emissiveData[idx + 3] = 255; + continue; + } + + emissiveData[idx] = 0; + emissiveData[idx + 1] = 0; + emissiveData[idx + 2] = 0; + emissiveData[idx + 3] = 255; + } + + emissiveCtx.putImageData( + new ImageData(emissiveData, emissive.width, emissive.height), + 0, + 0, + ); + + return { + metalness, + emissive, + emissiveLevel, + roughness, + sss, + }; + } + + createMer(inference = false) { + const metalness = this.findTexture(CHANNELS.metalness, inference); + const emissive = this.findTexture(CHANNELS.emissive, inference); + const roughness = this.findTexture(CHANNELS.roughness, inference); + const sss = this.findTexture("sss", false); + + const width = Math.max( + metalness?.img.width ?? 0, + emissive?.img.width ?? 0, + roughness?.img.width ?? 0, + Project ? Project.texture_width : 0, + 16, + ); + + const height = Math.max( + metalness?.img.height ?? 0, + emissive?.img.height ?? 0, + roughness?.img.height ?? 0, + Project ? Project.texture_height : 0, + 16, + ); + + const canvas = document.createElement("canvas"); + canvas.width = width; + canvas.height = height; + + const ctx = canvas.getContext("2d"); + + if (!ctx) { + return null; + } + + const metalnessCanvas = metalness?.img + ? PbrMaterial.extractChannel(metalness, "r") + : null; + const emissiveCanvas = emissive?.img + ? PbrMaterial.extractChannel(emissive, "g") + : null; + const roughnessCanvas = roughness?.img + ? PbrMaterial.extractChannel(roughness, "b") + : null; + const sssCanvas = + sss && sss?.img ? PbrMaterial.extractChannel(sss, "a") : null; + + const metalnessData = + metalnessCanvas?.getContext("2d")?.getImageData(0, 0, width, height) ?? + new ImageData(width, height); + const emissiveData = + emissiveCanvas?.getContext("2d")?.getImageData(0, 0, width, height) ?? + new ImageData(width, height); + const roughnessData = + roughnessCanvas?.getContext("2d")?.getImageData(0, 0, width, height) ?? + new ImageData(width, height); + const sssData = + sssCanvas?.getContext("2d")?.getImageData(0, 0, width, height) ?? + new ImageData( + new Uint8ClampedArray(width * height * 4).fill(255), + width, + height, + ); + + const data = new Uint8ClampedArray(width * height * 4); + + for (let idx = 0; idx < data.length; idx += 4) { + data[idx] = metalnessData.data[idx]; + data[idx + 1] = emissiveData.data[idx]; + data[idx + 2] = roughnessData.data[idx]; + data[idx + 3] = sssData.data[idx]; + } + + ctx.putImageData(new ImageData(data, width, height), 0, 0); + + return canvas; + } + + createLabPbrOutput(inference = true) { + const metalness = this.findTexture(CHANNELS.metalness, inference); + const emissive = this.findTexture(CHANNELS.emissive, inference); + const roughness = this.findTexture(CHANNELS.roughness, inference); + const normal = this.findTexture(CHANNELS.normal, inference); + const heightmap = this.findTexture(CHANNELS.height, inference); + const ao = this.findTexture(CHANNELS.ao, false); + const sss = this.findTexture("sss", true); + const porosity = this.findTexture("porosity", true); + + const width = Math.max( + metalness?.img.width ?? 0, + emissive?.img.width ?? 0, + roughness?.img.width ?? 0, + Project ? Project.texture_width : 0, + 16, + ); + + const height = Math.max( + metalness?.img.height ?? 0, + emissive?.img.height ?? 0, + roughness?.img.height ?? 0, + Project ? Project.texture_height : 0, + 16, + ); + + const specularCanvas = document.createElement("canvas"); + specularCanvas.width = width; + specularCanvas.height = height; + + const specularCtx = specularCanvas.getContext("2d"); + + const normalMapCanvas = document.createElement("canvas"); + normalMapCanvas.width = width; + normalMapCanvas.height = height; + + const normalMapCtx = normalMapCanvas.getContext("2d"); + + if (!specularCtx || !normalMapCtx) { + return null; + } + + const specularData = new Uint8ClampedArray(width * height * 4); + const normalData = new Uint8ClampedArray(width * height * 4); + + // Specular texture output "_s" + // Red channel: Convert linear roughness to perceptual smoothness with: perceptualSmoothness = 1.0 - sqrt(roughness). + // Green channel: Values from 0 to 229 represent F0. Stored linearly. Values from 230 to 255 represent various different metals. + // Blue channel: Values from 0 to 64 represent porosity. Values from 65 to 255 represent subsurface scattering. Both porosity and subsurface scattering are stored linearly. + // Alpha channel: It can have values ranging from 0 to 254; 0 being 0% emissiveness and 254 being 100%. Stored linearly. + const metalnessCanvas = metalness?.canvas; + const emissiveCanvas = emissive?.canvas; + const roughnessCanvas = roughness?.canvas; + const sssCanvas = sss?.canvas; + const porosityCanvas = porosity?.canvas; + + const metalnessCtx = metalnessCanvas?.getContext("2d"); + const emissiveCtx = emissiveCanvas?.getContext("2d"); + const roughnessCtx = roughnessCanvas?.getContext("2d"); + const sssCtx = sssCanvas?.getContext("2d"); + const porosityCtx = porosityCanvas?.getContext("2d"); + + const metalnessData = metalnessCtx?.getImageData(0, 0, width, height); + const emissiveData = emissiveCtx?.getImageData(0, 0, width, height); + const roughnessData = roughnessCtx?.getImageData(0, 0, width, height); + const sssData = sssCtx?.getImageData(0, 0, width, height); + const porosityData = porosityCtx?.getImageData(0, 0, width, height); + + for (let idx = 0; idx < specularData.length; idx += 4) { + const smoothness = roughnessData + ? 1.0 - Math.sqrt(roughnessData.data[idx] / 255) + : 0; + // const f0 = Math.min(229, Math.max(0, Math.round(smoothness * 229))); + + // Convert metalness to F0 + const f0 = Math.min( + 229, + Math.max(0, Math.round((metalnessData?.data[idx] ?? smoothness) * 229)), + ); + + const porosity = porosityData?.data[idx]; + const sss = sssData?.data[idx]; + + specularData[idx] = smoothness * 255; + specularData[idx + 1] = f0; + + // Merge porosity and sss in blue channel because they are mutually exclusive + specularData[idx + 2] = sss ?? porosity ?? 0; + + // Add emissive to alpha + // But first convert emissive channel from color to grayscale + + if (!emissiveData) { + specularData[idx + 3] = 255; + continue; + } + + const emissiveLevel = Math.round( + (emissiveData?.data[idx] + + emissiveData?.data[idx + 1] + + emissiveData?.data[idx + 2]) / + 3, + ); + + specularData[idx + 3] = emissiveLevel || 255; + } + + specularCtx.putImageData(new ImageData(specularData, width, height), 0, 0); + + // Normal map output "_n" + // AO is stored in blue channel + // Height map is stored in alpha channel + const normalCanvas = normal?.canvas; + const aoCanvas = ao?.canvas; + const heightmapCanvas = heightmap?.canvas; + + const normalCtx = normalCanvas?.getContext("2d"); + const aoCtx = aoCanvas?.getContext("2d"); + const heightmapCtx = heightmapCanvas?.getContext("2d"); + + const normalMapData = normalCtx?.getImageData(0, 0, width, height); + const aoData = aoCtx?.getImageData(0, 0, width, height); + const heightmapData = heightmapCtx?.getImageData(0, 0, width, height); + + for (let idx = 0; idx < normalData.length; idx += 4) { + normalData[idx] = normalMapData?.data[idx] ?? 0; + normalData[idx + 1] = normalMapData?.data[idx + 1] ?? 0; + normalData[idx + 2] = aoData?.data[idx + 2] ?? 255; + normalData[idx + 3] = heightmapData?.data[idx + 3] || 255; + } + + normalMapCtx.putImageData(new ImageData(normalData, width, height), 0, 0); + + return { + specular: specularCanvas, + normalMap: normalMapCanvas, + }; + } + + decodeLabPbrNormal(texture: Texture | TextureLayer): { + ao?: HTMLCanvasElement | null; + normal?: HTMLCanvasElement | null; + heightmap?: HTMLCanvasElement | null; + } { + const width = texture.img.width ?? 16; + const height = texture.img.height ?? 16; + + const ctx = texture.canvas.getContext("2d"); + + if (!ctx) { + return {}; + } + + const aoCanvas = document.createElement("canvas"); + aoCanvas.width = width; + aoCanvas.height = height; + + const normalCanvas = document.createElement("canvas"); + normalCanvas.width = width; + normalCanvas.height = height; + + const heightmapCanvas = document.createElement("canvas"); + heightmapCanvas.width = width; + heightmapCanvas.height = height; + + const aoCtx = aoCanvas.getContext("2d"); + const normalCtx = normalCanvas.getContext("2d"); + const heightmapCtx = heightmapCanvas.getContext("2d"); + + const { data } = ctx.getImageData(0, 0, width, height); + + if (!data || !aoCtx || !normalCtx || !heightmapCtx) { + return {}; + } + + const aoData = new Uint8ClampedArray(width * height * 4); + const normalData = new Uint8ClampedArray(width * height * 4); + const heightmapData = new Uint8ClampedArray(width * height * 4); + + for (let r = 0; r < data.length; r += 4) { + const g = r + 1; + const b = r + 2; + const a = r + 3; + + aoData[r] = data[b]; + aoData[g] = data[b]; + aoData[b] = data[b]; + aoData[a] = 255; + + normalData[r] = data[r]; + normalData[g] = data[g]; + normalData[b] = 255; + normalData[a] = 255; + + heightmapData[r] = data[a]; + heightmapData[g] = data[a]; + heightmapData[b] = data[a]; + heightmapData[a] = 255; + } + + aoCtx.putImageData(new ImageData(aoData, width, height), 0, 0); + normalCtx.putImageData(new ImageData(normalData, width, height), 0, 0); + heightmapCtx.putImageData( + new ImageData(heightmapData, width, height), + 0, + 0, + ); + + return { + ao: aoCanvas, + normal: normalCanvas, + heightmap: heightmapCanvas, + }; + } + + decodeLabPbrSpecular(texture: Texture | TextureLayer): { + metalness?: HTMLCanvasElement | null; + emissive?: HTMLCanvasElement | null; + roughness?: HTMLCanvasElement | null; + sss?: HTMLCanvasElement | null; + porosity?: HTMLCanvasElement | null; + } { + const width = texture.img.width ?? 16; + const height = texture.img.height ?? 16; + + const ctx = texture.canvas.getContext("2d"); + + if (!ctx) { + return {}; + } + const metalnessCanvas = document.createElement("canvas"); + metalnessCanvas.width = width; + metalnessCanvas.height = height; + + const emissiveCanvas = document.createElement("canvas"); + emissiveCanvas.width = width; + emissiveCanvas.height = height; + + const roughnessCanvas = document.createElement("canvas"); + roughnessCanvas.width = width; + roughnessCanvas.height = height; + + const sssCanvas = document.createElement("canvas"); + sssCanvas.width = width; + sssCanvas.height = height; + + const porosityCanvas = document.createElement("canvas"); + porosityCanvas.width = width; + porosityCanvas.height = height; + + const metalnessCtx = metalnessCanvas.getContext("2d"); + const emissiveCtx = emissiveCanvas.getContext("2d"); + const roughnessCtx = roughnessCanvas.getContext("2d"); + const sssCtx = sssCanvas.getContext("2d"); + const porosityCtx = porosityCanvas.getContext("2d"); + + const { data } = ctx.getImageData(0, 0, width, height); + + if ( + !data || + !metalnessCtx || + !emissiveCtx || + !roughnessCtx || + !sssCtx || + !porosityCtx + ) { + return {}; + } + + const metalnessData = new Uint8ClampedArray(width * height * 4); + const emissiveData = new Uint8ClampedArray(width * height * 4); + const roughnessData = new Uint8ClampedArray(width * height * 4); + const sssData = new Uint8ClampedArray(width * height * 4); + const porosityData = new Uint8ClampedArray(width * height * 4); + + for (let r = 0; r < data.length; r += 4) { + // Roughness is inverted smoothness in red channel + // Metalness is F0 in green channel + // SSS and porosity are stored in blue channel linearly + // Emissive is stored in alpha channel linearly + + const g = r + 1; + const b = r + 2; + const a = r + 3; + + roughnessData[r] = 255 - data[r]; + roughnessData[g] = 255 - data[r]; + roughnessData[b] = 255 - data[r]; + roughnessData[a] = 255; + + metalnessData[r] = data[g]; + metalnessData[g] = data[g]; + metalnessData[b] = data[g]; + metalnessData[a] = 255; + + emissiveData[r] = data[a]; + emissiveData[g] = data[a]; + emissiveData[b] = data[a]; + emissiveData[a] = 255; + + sssData[r] = 0; + sssData[g] = 0; + sssData[b] = 0; + sssData[a] = 255; + + porosityData[r] = data[b]; + porosityData[g] = data[b]; + porosityData[b] = data[b]; + porosityData[a] = 255; + + if (data[b] < 65) { + sssData[r] = data[b]; + sssData[g] = data[b]; + sssData[b] = data[b]; + sssData[a] = 255; + + porosityData[r] = 0; + porosityData[g] = 0; + porosityData[b] = 0; + porosityData[a] = 255; + } + } + + metalnessCtx.putImageData( + new ImageData(metalnessData, width, height), + 0, + 0, + ); + + emissiveCtx.putImageData(new ImageData(emissiveData, width, height), 0, 0); + + roughnessCtx.putImageData( + new ImageData(roughnessData, width, height), + 0, + 0, + ); + + sssCtx.putImageData(new ImageData(sssData, width, height), 0, 0); + + porosityCtx.putImageData(new ImageData(porosityData, width, height), 0, 0); + + return { + metalness: metalnessCanvas, + emissive: emissiveCanvas, + roughness: roughnessCanvas, + sss: sssCanvas, + porosity: porosityCanvas, + }; + } + + createTexturesFromSpecular(texture: Texture | TextureLayer) { + const maps = this.decodeLabPbrSpecular(texture); + + Object.entries(maps).forEach(([name, map]) => { + if (map) { + const textureMap = new Texture({ + name: `${texture.name}_${name}`, + saved: false, + particle: false, + keep_size: false, + }).fromDataURL(map.toDataURL()); + + textureMap.add(); + } + }); + + return maps; + } + + createTexturesFromNormal(texture: Texture | TextureLayer) { + const maps = this.decodeLabPbrNormal(texture); + + Object.entries(maps).forEach(([name, map]) => { + if (map) { + const textureMap = new Texture({ + name: `${texture.name}_${name}`, + saved: false, + particle: false, + keep_size: false, + }).fromDataURL(map.toDataURL()); + + textureMap.add(); + } + }); + + return maps; + } + + /** + * ### Generate Normal Map + * Generates a normal map from a height map texture + * @param texture Height map texture + * @param heightInAlpha Whether or not to store the height map in the alpha channel (Used in labPBR shaders for POM) + * @returns Normal map texture or layer if successful, otherwise `null` + */ + createNormalMap( + texture: Texture | TextureLayer, + heightInAlpha = false, + ): Texture | TextureLayer | null { + const textureCtx = texture.canvas.getContext("2d"); + + if (!textureCtx) { + return null; + } + + const width = Math.max( + texture.img.width ?? texture.canvas.width, + Project ? Project.texture_width : 0, + 16, + ); + const height = Math.max( + texture.img.height ?? texture.canvas.height, + Project ? Project.texture_height : 0, + 16, + ); + + const { data: textureData } = textureCtx.getImageData(0, 0, width, height); + + const canvas = document.createElement("canvas"); + const ctx = canvas.getContext("2d"); + + if (!ctx) { + return null; + } + + const getHeight = (x: number, y: number): number => { + const idx = (x + y * width) * 4; + return textureData[idx] / 255; + }; + + canvas.width = width; + canvas.height = height; + + ctx.drawImage(texture.img, 0, 0, width, height); + + const imageData = ctx.getImageData(0, 0, width, height); + + const data = imageData.data; + + const normalize = (v: number[]): number[] => { + const length = Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); + return [v[0] / length, v[1] / length, v[2] / length]; + }; + + for (let y = 0; y < height; y++) { + for (let x = 0; x < width; x++) { + const left = getHeight(Math.max(x - 1, 0), y); + const right = getHeight(Math.min(x + 1, width - 1), y); + const top = getHeight(x, Math.max(y - 1, 0)); + const bottom = getHeight(x, Math.min(y + 1, height - 1)); + + const dx = right - left; + const dy = bottom - top; + + const normal = normalize([-dx, -dy, 1]); + + const idx = (y * width + x) * 4; + data[idx] = ((normal[0] + 1) / 2) * 255; + data[idx + 1] = ((normal[1] + 1) / 2) * 255; + data[idx + 2] = ((normal[2] + 1) / 2) * 255; + data[idx + 3] = heightInAlpha ? getHeight(x, y) * 255 : 255; + } + } + + ctx.putImageData(imageData, 0, 0); + + const dataUrl = canvas.toDataURL(); + + const name = `${texture.name.replace(/_height(map)?/i, "")}_normal`; + + if (texture instanceof TextureLayer) { + const normalMapLayer = new TextureLayer( + { + name, + data_url: dataUrl, + visible: true, + }, + texture.texture, + ); + + normalMapLayer.addForEditing(); + + return normalMapLayer; + } + + const normalMapTexture = new Texture({ + name, + saved: false, + particle: false, + keep_size: false, + }).fromDataURL(dataUrl); + + if (Project) { + normalMapTexture.add(); + } + + return normalMapTexture; + } +} diff --git a/src/pbr_preview/src/lib/actions/bakeTextures.ts b/src/pbr_preview/src/lib/actions/bakeTextures.ts new file mode 100644 index 00000000..5af7cae1 --- /dev/null +++ b/src/pbr_preview/src/lib/actions/bakeTextures.ts @@ -0,0 +1,81 @@ +import { three as THREE } from "../../deps"; +import { registry, setups, teardowns } from "../../constants"; +import { bakeTextures } from "../bakery"; + +setups.push(() => { + registry.bakeTexturesDialog = new Dialog("bake_textures", { + id: "bake_textures", + title: "Bake Textures", + buttons: ["Bake", "Cancel"], + form: { + ambientLight: { + type: "color", + label: "Ambient Light", + value: "#1f1f1f", + }, + lightDiffuse: { + type: "color", + label: "Light Diffuse", + value: "#ffffff", + }, + lightHeight: { + type: "range", + label: "Light Height", + min: 0, + max: 1, + step: 0.01, + value: 0.66, + }, + minLightIntensity: { + type: "range", + label: "Minimum Light Intensity", + min: 0, + max: 1, + step: 0.01, + value: 0, + }, + directions: { + type: "number", + label: "Directions", + value: 8, + min: 1, + max: 360, + step: 1, + }, + blendEmissive: { + type: "checkbox", + label: "Blend Emissive", + value: false, + }, + }, + onConfirm(formResult: Record) { + const ambientLight = new THREE.Color(formResult.ambientLight.toString()); + const lightDiffuse = new THREE.Color(formResult.lightDiffuse.toString()); + bakeTextures( + { + ambientLight: [ambientLight.r, ambientLight.g, ambientLight.b], + lightDiffuse: [lightDiffuse.r, lightDiffuse.g, lightDiffuse.b], + lightHeight: Number(formResult.lightHeight), + minLightIntensity: Number(formResult.minLightIntensity), + }, + formResult.directions ?? 8, + formResult.blendEmissive ?? false, + ); + }, + }); + + registry.bakeTexturesAction = new Action("bake_textures", { + icon: "cake", + name: "Bake Textures", + description: "Bakes textures for the selected PBR material", + click() { + registry.bakeTexturesDialog?.show(); + }, + }); + + MenuBar.addAction(registry.bakeTexturesAction, "tools"); +}); + +teardowns.push(() => { + MenuBar.removeAction("tools.bake_textures"); +}); diff --git a/src/pbr_preview/src/lib/actions/channelAssignment.ts b/src/pbr_preview/src/lib/actions/channelAssignment.ts new file mode 100644 index 00000000..acb89f54 --- /dev/null +++ b/src/pbr_preview/src/lib/actions/channelAssignment.ts @@ -0,0 +1,183 @@ +import type { IChannel } from "../../types"; +import { + CHANNELS, + NA_CHANNEL, + registry, + setups, + teardowns, +} from "../../constants"; +import { applyPbrMaterial } from "../applyPbrMaterial"; + +const channelActions: Record = {}; + +const isPaintableTexture = Condition(() => { + return ( + // @ts-expect-error Paint mode exists + Modes.paint && + (TextureLayer.selected || (Project && Project.selected_texture !== null)) + ); +}); + +export function setup() { + Object.entries(CHANNELS).forEach(([key, channel]) => { + channelActions[key] = new Action(`assign_channel_${key}`, { + icon: channel.icon ?? "tv_options_edit_channels", + name: `Assign to ${channel.label.toLocaleLowerCase()} channel`, + description: `Assign the selected layer to the ${channel.label} channel`, + category: "textures", + condition: isPaintableTexture, + click(e) { + const layer = + TextureLayer.selected ?? (Project ? Project.selected_texture : null); + + if (!layer || !Project) { + return; + } + + Undo.initEdit({ layers: [layer] }); + + layer.extend({ channel: channel.id }); + + const texture = layer instanceof TextureLayer ? layer.texture : layer; + + texture.updateChangesAfterEdit(); + + if (!Project.pbr_materials[texture.uuid]) { + Project.pbr_materials[texture.uuid] = {}; + } + + // If the layer uuid is already assigned to another channel, unassign it first + Object.entries(Project.pbr_materials[texture.uuid]).forEach( + ([assignedChannel, assignedLayerUuid]) => { + if (assignedLayerUuid === layer.uuid) { + delete Project.pbr_materials[texture.uuid][assignedChannel]; + layer.channel = NA_CHANNEL; + } + }, + ); + + Project.pbr_materials[texture.uuid][key] = layer.uuid; + + Undo.finishEdit("Change channel assignment"); + + Blockbench.showQuickMessage( + `Assigned "${layer.name}" to ${channel.label} channel`, + 2000, + ); + + applyPbrMaterial(); + }, + }); + }); +} + +export function teardown() { + Object.entries(channelActions).forEach(([key, action]) => { + action.delete(); + }); +} + +setups.push(setup); +teardowns.push(teardown); + +setups.push(() => { + registry.unassignChannel = new Action("unassign_channel", { + icon: "cancel", + name: "Unassign Channel", + description: "Unassign the selected layer from the channel", + category: "textures", + condition: () => { + // @ts-expect-error Paint mode exists + if (!Modes.paint) { + return false; + } + + if (TextureLayer.selected) { + return ( + TextureLayer.selected.channel !== NA_CHANNEL || + !TextureLayer.selected.channel + ); + } + + if (!Project) { + return false; + } + + const texture = Project.selected_texture; + + return ( + texture !== null && texture.channel !== NA_CHANNEL && texture.channel + ); + }, + click() { + const layer = + TextureLayer.selected ?? (Project ? Project.selected_texture : null); + + if (!layer || !Project) { + return; + } + + Undo.initEdit({ layers: [layer] }); + + const texture = layer instanceof TextureLayer ? layer.texture : layer; + const prevChannel = layer.channel; + + Project.pbr_materials[texture.uuid] = {}; + + layer.channel = NA_CHANNEL; + + texture.updateChangesAfterEdit(); + Undo.finishEdit("Unassign channel"); + + Blockbench.showQuickMessage( + `Unassigned "${layer.name}" from ${prevChannel} channel`, + 2000, + ); + + applyPbrMaterial(); + }, + }); + + registry.channelMenu = new Menu( + "channel_menu", + [ + ...Object.keys(CHANNELS).map((key) => `assign_channel_${key}`), + ...["unassign_channel"], + ], + { + onOpen() { + applyPbrMaterial(); + }, + }, + ); + + registry.openChannelMenu = new Action("pbr_channel_menu", { + name: "Assign to PBR Channel", + icon: "texture", + click(event) { + registry.channelMenu?.open(event as MouseEvent); + }, + children: [...Object.values(channelActions), registry.unassignChannel], + }); + + registry.showChannelMenu = new Action("show_channel_menu", { + icon: "texture", + name: "Assign to PBR Channel", + description: "Assign the selected layer to a channel", + category: "textures", + condition: isPaintableTexture, + click(event) { + registry.channelMenu?.open(event as MouseEvent); + }, + }); +}); + +setups.push(() => { + if (registry.openChannelMenu) { + MenuBar.addAction(registry.openChannelMenu, "image.0"); + } +}); + +teardowns.push(() => { + MenuBar.removeAction("image.pbr_channel_menu"); +}); diff --git a/src/pbr_preview/src/lib/actions/generateNormal.ts b/src/pbr_preview/src/lib/actions/generateNormal.ts new file mode 100644 index 00000000..7043cd1d --- /dev/null +++ b/src/pbr_preview/src/lib/actions/generateNormal.ts @@ -0,0 +1,50 @@ +import { registry, setups, teardowns } from "../../constants"; +import { CHANNELS } from "../../constants"; +import PbrMaterial from "../PbrMaterials"; + +setups.push(() => { + registry.generateNormal = new Action("generate_normal", { + icon: "altitude", + name: "Generate Normal Map", + description: "Generates a normal map from the height map", + condition: () => + (TextureLayer.selected || Texture.all.find((t) => t.selected)) !== + undefined, + click() { + const texture: Texture | TextureLayer = + TextureLayer.selected ?? + (!!Project && Project.selected_texture + ? // @ts-ignore Selected layer does exist on selected_texture property + Project.selected_texture.selected_layer ?? Project.selected_texture + : Texture.getDefault()); + + if (!texture) { + return; + } + + const mat = new PbrMaterial( + texture instanceof Texture && texture.layers_enabled + ? texture.layers + : null, + texture.uuid, + ); + + const normalMap = mat.createNormalMap(texture); + + if (normalMap) { + mat.saveTexture(CHANNELS.normal, normalMap); + normalMap.select(); + Blockbench.showQuickMessage("Normal map generated", 2000); + return; + } + + Blockbench.showQuickMessage("Failed to generate normal map", 2000); + }, + }); + + MenuBar.addAction(registry.generateNormal, "tools"); +}); + +teardowns.push(() => { + MenuBar.removeAction(`tools.generate_normal`); +}); diff --git a/src/pbr_preview/src/lib/actions/index.ts b/src/pbr_preview/src/lib/actions/index.ts new file mode 100644 index 00000000..fd73c264 --- /dev/null +++ b/src/pbr_preview/src/lib/actions/index.ts @@ -0,0 +1,10 @@ +import "./bakeTextures"; +import "./channelAssignment"; +import "./generateNormal"; +import "./materialTexture"; +import "./mer"; +import "./textureSet"; +import "./toggleLights"; +import "./togglePbr"; +import "./tonemapping"; +import "./labPbr"; diff --git a/src/pbr_preview/src/lib/actions/labPbr.ts b/src/pbr_preview/src/lib/actions/labPbr.ts new file mode 100644 index 00000000..eca94ec2 --- /dev/null +++ b/src/pbr_preview/src/lib/actions/labPbr.ts @@ -0,0 +1,118 @@ +import { registry, setups, teardowns } from "../../constants"; +import PbrMaterial from "../PbrMaterials"; + +const exportNormalMap = ( + normalMap: HTMLCanvasElement, + baseName = "texture", +) => { + normalMap.toBlob(async (blob) => { + if (!blob) { + return; + } + + Blockbench.export({ + content: await blob.arrayBuffer(), + type: "PNG", + name: `${baseName}_n`, + extensions: ["png"], + resource_id: "normal_map", + savetype: "image", + }); + }); +}; + +const exportSpecularMap = ( + specularMap: HTMLCanvasElement, + baseName = "texture", +) => { + specularMap.toBlob(async (blob) => { + if (!blob) { + return; + } + + Blockbench.export({ + content: await blob.arrayBuffer(), + type: "PNG", + name: `${baseName}_s`, + extensions: ["png"], + resource_id: "specular_map", + savetype: "image", + }); + }); +}; + +setups.push(() => { + registry.generateLabPbr = new Action("generate_lab_pbr", { + icon: "experiment", + name: "Generate labPBR textures", + description: + "Generate a specular and normal map in labPBR format for Java shaders", + condition: { + formats: ["java_block"], + project: true, + }, + async click() { + const selected = Project.selected_texture; + if (!selected) { + return; + } + const mat = new PbrMaterial( + selected.layers_enabled ? selected.layers : [selected], + selected.uuid, + ); + const outputs = mat.createLabPbrOutput(); + + if (outputs === null) { + return; + } + + const baseName = + selected.name ?? (!!Project ? Project.getDisplayName() : "texture"); + + await Promise.all([ + exportNormalMap(outputs.normalMap, pathToName(baseName)), + exportSpecularMap(outputs.specular, pathToName(baseName)), + ]); + + Blockbench.showQuickMessage("Exported labPBR textures"); + }, + }); + + registry.decodeLabPbr = new Action("decode_lab_pbr", { + icon: "frame_source", + name: "Decode labPBR textures", + description: + "Decodes the selected texture into a specular or normal map in labPBR format", + condition: () => !!Project && Project.selected_texture !== null, + click() { + const selected = + TextureLayer.selected?.texture ?? + Texture.all.find((t) => t.selected) ?? + Texture.getDefault(); + + const mat = new PbrMaterial( + selected.layers_enabled ? selected.layers : [selected], + selected.uuid, + ); + + if (selected.name.endsWith("_n") || selected.name.endsWith("_n.png")) { + mat.createTexturesFromNormal(selected); + return; + } + + if (selected.name.endsWith("_s") || selected.name.endsWith("_s.png")) { + mat.createTexturesFromSpecular(selected); + return; + } + + Blockbench.showQuickMessage("Failed to decode labPBR texture"); + }, + }); + + MenuBar.addAction(registry.generateLabPbr, "file.export"); + MenuBar.addAction(registry.decodeLabPbr, "tools"); +}); + +teardowns.push(() => { + MenuBar.removeAction("file.export.generate_lab_pbr"); +}); diff --git a/src/pbr_preview/src/lib/actions/materialTexture.ts b/src/pbr_preview/src/lib/actions/materialTexture.ts new file mode 100644 index 00000000..6a1b20be --- /dev/null +++ b/src/pbr_preview/src/lib/actions/materialTexture.ts @@ -0,0 +1,88 @@ +import { registry, CHANNELS, setups, teardowns } from "../../constants"; +import { three as THREE } from "../../deps"; + +const colorDataUrl = (color: THREE.Color, src?: HTMLCanvasElement) => { + const canvas = src ?? document.createElement("canvas"); + const ctx = canvas.getContext("2d"); + + if (!ctx) { + return null; + } + + const width = Math.max(Project ? Project.texture_width : 16, 16); + const height = Math.max(Project ? Project.texture_height : 16, 16); + + canvas.width = width; + canvas.height = height; + + ctx.fillStyle = `rgb(${color.r * 255}, ${color.g * 255}, ${color.b * 255})`; + ctx.fillRect(0, 0, width, height); + + return canvas.toDataURL(); +}; + +setups.push(() => { + registry.createMaterialTexture = new Action("create_material_texture", { + icon: "stacks", + name: "Create Material Texture", + description: "Creates a new texture for a PBR material", + click() { + if (!Project) { + return; + } + + const texture = new Texture({ + name: "New Material", + saved: false, + particle: false, + keep_size: false, + layers_enabled: true, + }); + + const filler = colorDataUrl(new THREE.Color(0x808080)); + + if (!filler) { + return; + } + + texture.fromDataURL(filler).add().select(); + + // Create PBR channels as texture layers for the new texture + Object.keys(CHANNELS).forEach((key) => { + const channel = CHANNELS[key]; + + const layer = new TextureLayer( + { + name: channel.label, + visible: true, + }, + texture, + ); + + layer.setSize( + Project.texture_width ?? texture.width, + Project.texture_height ?? texture.height, + ); + + const data = colorDataUrl( + channel.default ?? new THREE.Color(0), + layer.canvas, + ); + + if (data) { + layer.texture.fromDataURL(data); + } + + layer.extend({ channel: channel.id }); + + layer.addForEditing(); + }); + }, + }); + + MenuBar.addAction(registry.createMaterialTexture, "tools"); +}); + +teardowns.push(() => { + MenuBar.removeAction("tools.create_material_texture"); +}); diff --git a/src/pbr_preview/src/lib/actions/mer.ts b/src/pbr_preview/src/lib/actions/mer.ts new file mode 100644 index 00000000..68268377 --- /dev/null +++ b/src/pbr_preview/src/lib/actions/mer.ts @@ -0,0 +1,89 @@ +import { CHANNELS, registry, setups, teardowns } from "../../constants"; +import PbrMaterial from "../PbrMaterials"; +import { exportMer } from "../mer"; + +export function setup() { + registry.generateMer = new Action("create_mer", { + icon: "lightbulb_circle", + name: "Export MER", + description: + "Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)", + condition: { + formats: ["bedrock_block", "bedrock_entity"], + project: true, + }, + click() { + exportMer(); + }, + }); + + registry.decodeMer = new Action("decode_mer", { + icon: "arrow_split", + name: "Decode MER", + description: + "Decodes a MER texture map into metalness, emissive, and roughness channels", + condition: () => + !!Project && + Project.selected_texture !== null && + !Project.selected_texture.layers_enabled, + click() { + const selected = + TextureLayer.selected?.texture ?? + Texture.all.find((t) => t.selected) ?? + Texture.getDefault(); + + const mat = new PbrMaterial( + selected.layers_enabled ? selected.layers : [selected], + selected.uuid, + ); + + const mer = mat.decodeMer(); + const merChannels = [ + CHANNELS.metalness, + CHANNELS.emissive, + CHANNELS.roughness, + ]; + + Undo.initEdit({ textures: [selected] }); + selected.activateLayers(true); + + merChannels.forEach((channel) => { + const key = channel.id as keyof typeof mer; + const canvas = mer[key]; + + if (!canvas) { + Blockbench.showStatusMessage( + `Failed to decode ${channel.label} channel`, + 3000, + ); + return; + } + + const layer = new TextureLayer( + { + name: `${selected?.name}_${key}`, + data_url: canvas.toDataURL(), + }, + selected, + ); + + mat.saveTexture(channel, layer); + + layer.addForEditing(); + }); + + Undo.finishEdit("Decode MER"); + }, + }); + + MenuBar.addAction(registry.decodeMer, "tools"); + MenuBar.addAction(registry.generateMer, "file.export"); +} + +export function teardown() { + MenuBar.removeAction(`file.export.create_mer`); + MenuBar.removeAction(`tools.decode_mer`); +} + +setups.push(setup); +teardowns.push(teardown); diff --git a/src/pbr_preview/src/lib/actions/textureSet.ts b/src/pbr_preview/src/lib/actions/textureSet.ts new file mode 100644 index 00000000..886b78ba --- /dev/null +++ b/src/pbr_preview/src/lib/actions/textureSet.ts @@ -0,0 +1,259 @@ +import { CHANNELS, registry, setups, teardowns } from "../../constants"; +import { exportMer } from "../mer"; +import PbrMaterial from "../PbrMaterials"; + +const createTextureSetDialog = () => { + if (!Project) { + return; + } + Project.textures.forEach((t) => { + const mat = new PbrMaterial(null, t.uuid); + + const projectNormalMap = mat.findTexture(CHANNELS.normal, false); + const projectHeightMap = mat.findTexture(CHANNELS.height, false); + const projectColorMap = mat.findTexture(CHANNELS.albedo, false); + const projectMetalnessMap = mat.findTexture( + CHANNELS.metalness, + false, + )?.name; + const projectEmissiveMap = mat.findTexture(CHANNELS.emissive, false)?.name; + const projectRoughnessMap = mat.findTexture( + CHANNELS.roughness, + false, + )?.name; + + const form: DialogOptions["form"] = {}; + + if (!projectColorMap) { + form.baseColor = { + type: "color", + label: "Base Color", + value: "#ff00ff", + }; + } + + if (!projectMetalnessMap && !projectEmissiveMap && !projectRoughnessMap) { + form.metalness = { + label: "Metalness", + type: "range", + min: 0, + max: 255, + step: 1, + value: 0, + }; + + form.emissive = { + label: "Emissive", + type: "range", + min: 0, + max: 255, + step: 1, + value: 0, + }; + + form.roughness = { + label: "Roughness", + type: "range", + min: 0, + max: 255, + step: 1, + value: 0, + }; + } + + if (projectNormalMap) { + form.depthMap = { + type: "checkbox", + label: "Normal Map", + value: "normal", + }; + } + + if (projectHeightMap) { + form.depthMap = { + type: "checkbox", + label: "Height Map", + value: "heightmap", + }; + } + + if (projectNormalMap && projectHeightMap) { + form.depthMap = { + type: "radio", + label: "Depth Map", + options: { + normal: "Normal Map", + heightmap: "Height", + }, + value: "normal", + }; + } + + registry.textureSetDialog = new Dialog("texture_set", { + id: "texture_set", + title: "Create Texture Set JSON", + buttons: ["Create", "Cancel"], + form, + onConfirm(formResult: Record) { + const baseName = + Project.model_identifier.length > 0 + ? Project.model_identifier + : Project.getDisplayName(); + + const hasMer = + projectMetalnessMap || projectEmissiveMap || projectRoughnessMap; + + const textureSet: { + format_version: string; + "minecraft:texture_set": { + color: string; + metalness_emissive_roughness: [number, number, number]; + normal?: string; + heightmap?: string; + }; + } = { + format_version: "1.16.100", + "minecraft:texture_set": { + color: + (projectColorMap + ? baseName // pathToName(projectColorMap.name, false) + : formResult.baseColor?.toHexString()) ?? baseName, + metalness_emissive_roughness: [ + formResult.metalness ?? 0, + formResult.emissive ?? 0, + formResult.roughness ?? 255, + ], + }, + }; + + if ( + (formResult.depthMap === "normal" && projectNormalMap) || + (!projectHeightMap && projectNormalMap) + ) { + textureSet["minecraft:texture_set"].normal = `${baseName}_normal`; + } else if ( + (!projectNormalMap || formResult.depthMap === "heightmap") && + projectHeightMap + ) { + textureSet["minecraft:texture_set"].heightmap = + `${baseName}_heightmap`; + } + + const exportDepthMap = (cb: () => void) => { + if (!formResult.depthMap) { + return cb(); + } + + const useNormalMap = + formResult.depthMap === "normal" || + (formResult.depthMap && !projectHeightMap); + + const depthMap = useNormalMap ? projectNormalMap : projectHeightMap; + + if (!depthMap) { + return cb(); + } + + Blockbench.export( + { + content: depthMap.canvas.toDataURL() ?? "", + type: "PNG", + name: `${baseName}_${useNormalMap ? "normal" : "heightmap"}`, + extensions: ["png"], + resource_id: formResult.depthMap, + startpath: Project.export_path, + savetype: "image", + }, + (filePath) => { + textureSet["minecraft:texture_set"][ + useNormalMap ? "normal" : "heightmap" + ] = pathToName(filePath, false); + cb(); + }, + ); + }; + + const exportBaseColor = (cb: () => void) => { + if (!projectColorMap) { + return cb(); + } + + Blockbench.export( + { + content: projectColorMap.canvas.toDataURL(), + extensions: ["png"], + type: "PNG", + name: baseName, + startpath: Project.export_path, + savetype: "image", + }, + (filePath) => { + textureSet["minecraft:texture_set"].color = pathToName( + filePath, + false, + ); + cb(); + }, + ); + }; + + const exportTextureSet = () => + exportDepthMap(() => { + exportBaseColor(() => { + Blockbench.export( + { + content: JSON.stringify(textureSet, null, 2), + type: "JSON", + name: `${baseName}.texture_set`, + extensions: ["json"], + resource_id: "texture_set", + startpath: Project.export_path, + savetype: "text", + }, + () => { + Blockbench.showQuickMessage("Texture set created", 2000); + registry.textureSetDialog?.hide(); + }, + ); + }); + }); + + if (hasMer) { + exportMer(baseName, (filePath) => { + textureSet["minecraft:texture_set"].metalness_emissive_roughness = + pathToName(filePath, false); + exportTextureSet(); + }); + return; + } + + exportTextureSet(); + }, + cancelIndex: 1, + }); + + return registry.textureSetDialog.show(); + }); +}; + +setups.push(() => { + registry.createTextureSet = new Action("create_texture_set", { + name: "Create Texture Set", + icon: "layers", + description: + "Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.", + click() { + createTextureSetDialog(); + }, + condition: { + formats: ["bedrock_block", "bedrock_entity"], + project: true, + }, + }); + + MenuBar.addAction(registry.createTextureSet, "file.export"); +}); + +teardowns.push(() => { + MenuBar.removeAction(`file.export.create_texture_set`); +}); diff --git a/src/pbr_preview/src/lib/actions/toggleLights.ts b/src/pbr_preview/src/lib/actions/toggleLights.ts new file mode 100644 index 00000000..73034658 --- /dev/null +++ b/src/pbr_preview/src/lib/actions/toggleLights.ts @@ -0,0 +1,38 @@ +import { registry, setups, teardowns } from "../../constants"; +import { applyPbrMaterial } from "../applyPbrMaterial"; + +setups.push(() => { + registry.toggleCorrectLights = new Toggle("correct_lights", { + category: "preview", + name: "Correct Lights", + description: "Corrects the lighting in the preview", + icon: "fluorescent", + default: false, + onChange(value) { + Preview.all.forEach((preview) => { + preview.renderer.physicallyCorrectLights = value; + }); + + Preview.selected.renderer.physicallyCorrectLights = value; + + Blockbench.showQuickMessage( + `Physically corrected lighting is now ${value ? "enabled" : "disabled"}`, + 2000, + ); + + if (value) { + // @ts-expect-error Set method exists on the toggle + registry.togglePbr?.set(true); + } + + applyPbrMaterial(); + }, + click() {}, + }); + + MenuBar.addAction(registry.toggleCorrectLights, "preview"); +}); + +teardowns.push(() => { + MenuBar.removeAction("preview.correct_lights"); +}); diff --git a/src/pbr_preview/src/lib/actions/togglePbr.ts b/src/pbr_preview/src/lib/actions/togglePbr.ts new file mode 100644 index 00000000..18dbb147 --- /dev/null +++ b/src/pbr_preview/src/lib/actions/togglePbr.ts @@ -0,0 +1,69 @@ +import { registry, setups, teardowns } from "../../constants"; +import { applyPbrMaterial } from "../applyPbrMaterial"; +import { disablePbr } from "../disablePbr"; + +/** + * List of Blockbench events which trigger a PBR material update + */ +const subscribeToEvents: EventName[] = [ + "undo", + "redo", + "add_texture", + "finish_edit", + "finished_edit", + "load_project", + "select_preview_scene", + "change_texture_path", + "select_project", +]; + +/** + * Conditionally triggers the PBR material update based on the `pbr_active` setting + * @returns void + */ +const renderPbrScene = () => + Project && Project.pbr_active && applyPbrMaterial(); + +const enableListeners = () => { + subscribeToEvents.forEach((event) => { + Blockbench.addListener(event as EventName, renderPbrScene); + }); +}; + +const disableListeners = () => { + subscribeToEvents.forEach((event) => { + Blockbench.removeListener(event as EventName, renderPbrScene); + }); +}; + +setups.push(() => { + registry.togglePbr = new Toggle("toggle_pbr", { + name: "PBR Preview", + description: "Toggle PBR Preview", + icon: "panorama_photosphere", + category: "view", + default: false, + click() {}, + onChange(value) { + if (value) { + applyPbrMaterial(); + enableListeners(); + + Blockbench.showQuickMessage("PBR Preview is now enabled"); + + return; + } + disablePbr(); + disableListeners(); + + Blockbench.showQuickMessage("PBR Preview is now disabled"); + }, + }); + + MenuBar.addAction(registry.togglePbr, "view"); +}); + +teardowns.push(() => { + disableListeners(); + MenuBar.removeAction("view.toggle_pbr"); +}); diff --git a/src/pbr_preview/src/lib/actions/tonemapping.ts b/src/pbr_preview/src/lib/actions/tonemapping.ts new file mode 100644 index 00000000..b57bb4f7 --- /dev/null +++ b/src/pbr_preview/src/lib/actions/tonemapping.ts @@ -0,0 +1,97 @@ +import { registry, setups } from "../../constants"; +import { three as THREE } from "../../deps"; +import { applyPbrMaterial } from "../applyPbrMaterial"; + +const setPreviewExposure = (value: number) => { + const exposureValue = Math.max(-2, Math.min(2, Number(value))); + Preview.all.forEach((preview) => { + preview.renderer.toneMappingExposure = exposureValue; + }); + + Preview.selected.renderer.toneMappingExposure = exposureValue; +}; + +setups.push(() => { + registry.exposureSlider = new BarSlider("display_settings_exposure", { + category: "preview", + name: "Exposure", + description: "Adjusts the exposure of the scene", + type: "number", + value: 1, + icon: "exposure", + step: 0.1, + min: -2, + max: 2, + // condition: () => Number(tonemappingSelect.get()) !== THREE.NoToneMapping, + onBefore() { + if (Number(registry.tonemappingSelect?.get()) === THREE.NoToneMapping) { + // @ts-expect-error `.change()` does not require an Event for its value + registry.tonemappingSelect.change(THREE.LinearToneMapping.toString()); + } + // @ts-expect-error Set method exists on the toggle + registry.togglePbr?.set(true); + }, + onChange({ value }) { + setPreviewExposure(value); + }, + onAfter() { + applyPbrMaterial(); + }, + }); + + registry.resetExposureButton = new Action("display_settings_reset_exposure", { + category: "preview", + name: "Reset Exposure", + description: "Resets the exposure of the scene", + icon: "exposure_plus_1", + condition: () => + registry.exposureSlider !== undefined && + Number(registry.exposureSlider?.get()) !== 1, + click() { + setPreviewExposure(1); + registry.exposureSlider?.set(1); + + applyPbrMaterial(); + }, + }); + + registry.tonemappingSelect = new BarSelect("display_settings_tone_mapping", { + category: "preview", + name: "Tone Mapping", + description: "Changes the tone mapping of the preview", + type: "select", + default_value: THREE.NoToneMapping, + value: Preview.selected.renderer.toneMapping ?? THREE.NoToneMapping, + icon: "monochrome_photos", + options: { + [THREE.NoToneMapping]: "No Tone Mapping", + [THREE.LinearToneMapping]: "Linear", + [THREE.ReinhardToneMapping]: "Reinhard", + [THREE.CineonToneMapping]: "Cineon", + [THREE.ACESFilmicToneMapping]: "ACES", + }, + onChange({ value }) { + const currentExposure = Number(registry.exposureSlider?.get() ?? 1); + Preview.all.forEach((preview) => { + preview.renderer.toneMapping = Number(value) as THREE.ToneMapping; + preview.renderer.toneMappingExposure = currentExposure; + }); + + Preview.selected.renderer.toneMapping = Number( + value, + ) as THREE.ToneMapping; + Preview.selected.renderer.toneMappingExposure = currentExposure; + + Blockbench.showQuickMessage( + `Tone mapping set to ${this.getNameFor(value)}`, + 2000, + ); + + if (registry.togglePbr && !registry.togglePbr.value) { + registry.togglePbr.set(true); + } + + applyPbrMaterial(); + }, + }); +}); diff --git a/src/pbr_preview/src/lib/applyPbrMaterial.ts b/src/pbr_preview/src/lib/applyPbrMaterial.ts new file mode 100644 index 00000000..760f224a --- /dev/null +++ b/src/pbr_preview/src/lib/applyPbrMaterial.ts @@ -0,0 +1,58 @@ +import { three as THREE } from "../deps"; +import PbrMaterial from "./PbrMaterials"; + +/** + * ### Apply PBR Material + * Iterates over all faces in the project and applies a PBR material to each face + * @param materialParams Parameters to extend the base material with + * @returns `THREE.MeshStandardMaterial` with PBR textures applied + */ +export const applyPbrMaterial = ( + materialParams?: THREE.MeshStandardMaterialParameters, +) => { + // Don't overwrite placeholder material in Edit and Paint mode + if (!Project || Texture.all.length === 0) { + return; + } + + let materialsSet = false; + + Project.elements.forEach((item) => { + if (!(item instanceof Cube)) { + return; + } + + Object.keys(item.faces).forEach((key) => { + const face = item.faces[key]; + const texture = face.getTexture(); + + if (!texture) { + return; + } + + const projectMaterial = Project.materials[texture.uuid]; + + if ( + projectMaterial.isShaderMaterial && + !Project.bb_materials[texture.uuid] + ) { + Project.bb_materials[texture.uuid] = projectMaterial; + } + + const material = new PbrMaterial( + texture.layers_enabled + ? texture.layers.filter((layer) => layer.visible) ?? null + : Project.textures, + texture.uuid, + ).getMaterial(materialParams); + + Project.materials[texture.uuid] = + THREE.ShaderMaterial.prototype.copy.call(material, projectMaterial); + + Canvas.updateAllFaces(texture); + materialsSet = true; + }); + }); + + Project.pbr_active = materialsSet; +}; diff --git a/src/pbr_preview/src/lib/bakery.ts b/src/pbr_preview/src/lib/bakery.ts new file mode 100644 index 00000000..2c26e4b7 --- /dev/null +++ b/src/pbr_preview/src/lib/bakery.ts @@ -0,0 +1,119 @@ +import type { ILightrParams } from "../types"; +import { CHANNELS } from "../constants"; +import PbrMaterial from "./PbrMaterials"; +import { Lightr } from "./Lightr"; + +export const bakeTextures = ( + params: ILightrParams, + directions = 8, + blendEmissive = false, +) => { + if (!Project) { + return; + } + + const selected = Project.selected_texture ?? Texture.getDefault(); + + const mat = new PbrMaterial( + selected.layers_enabled ? selected.layers : Project.textures, + selected.uuid, + ); + + const texture = mat.findTexture(CHANNELS.albedo); + + if (!texture) { + Blockbench.showStatusMessage( + "Can not bake without a base color assigned.", + 3000, + ); + return; + } + + let normalMap = mat.findTexture(CHANNELS.normal); + + // TODO: Generate normal map automatically when needed and possible + // const heightmap = mat.findTexture(CHANNELS.height); + // if (!normalMap && heightmap) { + // normalMap = PbrMaterial.createNormalMap(heightmap, false); + // } + + if (!normalMap) { + Blockbench.showStatusMessage( + "Can not bake without a normal map assigned.", + 3000, + ); + return; + } + + const lightr = new Lightr(params); + const bakedImages = lightr.bake(directions, texture.canvas, normalMap.canvas); + + const bakedTexture = new Texture({ + name: `${texture.name}_baked`, + saved: false, + particle: false, + keep_size: false, + // @ts-expect-error Layers enabled can be set here + layers_enabled: true, + }).fromDataURL(bakedImages[0].toDataURL()); + + const addEmissive = blendEmissive + ? (canvas: HTMLCanvasElement) => { + const emissive = mat.findTexture(CHANNELS.emissive); + + if (!emissive) { + return canvas; + } + + const emissiveCanvas = emissive.canvas; + const emissiveCtx = emissiveCanvas.getContext("2d"); + + if (!emissiveCtx) { + return canvas; + } + + const width = Math.max( + canvas.width, + emissiveCanvas.width, + Project ? Project.texture_width : 16, + ); + const height = Math.max( + canvas.height, + emissiveCanvas.height, + Project ? Project.texture_height : 16, + ); + + const mergedCanvas = document.createElement("canvas"); + mergedCanvas.width = width; + mergedCanvas.height = height; + + const mergedCtx = mergedCanvas.getContext("2d"); + + if (!mergedCtx) { + return canvas; + } + + mergedCtx.drawImage(canvas, 0, 0); + mergedCtx.globalCompositeOperation = "screen"; + mergedCtx.drawImage(emissiveCanvas, 0, 0); + + return mergedCanvas; + } + : (canvas: HTMLCanvasElement) => canvas; + + bakedImages.forEach((image, idx) => { + const layer = new TextureLayer( + { + name: `baked_${idx + 1}`, + data_url: addEmissive(image).toDataURL(), + }, + bakedTexture, + ); + + layer.addForEditing(); + }); + + bakedTexture.add().select(); + + Blockbench.showQuickMessage("Textures baked 🥐", 2000); +}; diff --git a/src/pbr_preview/src/lib/disablePbr.ts b/src/pbr_preview/src/lib/disablePbr.ts new file mode 100644 index 00000000..453bb28e --- /dev/null +++ b/src/pbr_preview/src/lib/disablePbr.ts @@ -0,0 +1,36 @@ +/** + * ### Disable PBR + * Reverts all faces in the project to their original materials + * @returns void + */ +export const disablePbr = () => { + if (!Project || !Project.bb_materials) { + return; + } + + Project.elements.forEach((item) => { + if (!(item instanceof Cube)) { + return; + } + + Object.keys(item.faces).forEach((key) => { + const face = item.faces[key]; + const texture = face.getTexture(); + + if (!texture) { + return; + } + + const projectMaterial = Project.bb_materials[texture.uuid]; + + if (!projectMaterial) { + return; + } + + Project.materials[texture.uuid] = projectMaterial; + }); + }); + + Project.pbr_active = false; + Canvas.updateAll(); +}; diff --git a/src/pbr_preview/src/lib/mer.ts b/src/pbr_preview/src/lib/mer.ts new file mode 100644 index 00000000..b554c87d --- /dev/null +++ b/src/pbr_preview/src/lib/mer.ts @@ -0,0 +1,61 @@ +import PbrMaterial from "./PbrMaterials"; + +/** + * ### Export MER map + * Generates a MER map from the currently selected texture and exports it as a PNG file + * @param cb Callback function to run after the MER file is exported + * @returns void + */ +export const exportMer = ( + baseName?: string, + cb?: (filePath: string) => void, +) => { + const selected = Project + ? Project.selected_texture + : Texture.all.find((t) => t.selected); + + if (!selected) { + return; + } + + const mer = new PbrMaterial( + selected.layers_enabled + ? selected.layers + : Project + ? Project.textures + : null, + selected.uuid, + ).createMer(false); + + if (!mer) { + return; + } + + mer.toBlob(async (blob) => { + if (!blob) { + return; + } + + const [name, startpath] = Project + ? [ + baseName + ? `${baseName}_mer` + : `${selected.name ?? Project.getDisplayName()}_mer`, + Project.export_path, + ] + : ["mer"]; + + Blockbench.export( + { + content: await blob.arrayBuffer(), + type: "PNG", + name, + extensions: ["png"], + resource_id: "mer", + savetype: "image", + startpath, + }, + cb, + ); + }); +}; diff --git a/src/pbr_preview/src/lib/panels/channels.ts b/src/pbr_preview/src/lib/panels/channels.ts new file mode 100644 index 00000000..0a3e9c6d --- /dev/null +++ b/src/pbr_preview/src/lib/panels/channels.ts @@ -0,0 +1,165 @@ +import { registry, setups, CHANNELS, NA_CHANNEL } from "../../constants"; +import { vue as Vue } from "../../deps"; + +setups.push(() => { + const component = Vue.extend({ + name: "ChannelsPanel", + data() { + return { + channels: CHANNELS, + }; + }, + methods: { + openMenu(event: MouseEvent) { + registry.channelMenu?.open(event); + }, + canShowChannel(texture: Texture | TextureLayer) { + return texture.channel && texture.channel !== NA_CHANNEL; + }, + selectedTexture() { + return ( + (Texture.selected ?? TextureLayer.selected.texture) !== undefined + ); + }, + }, + computed: { + textures: () => { + if (Texture.selected && Texture.selected.layers_enabled) { + return Texture.selected.layers; + } + + return Texture.all + .map((t) => (t.layers_enabled ? t.layers : [t])) + .flat(); + }, + }, + template: /* html */ ` +
+
    +
  • + +
    +
    +
    {{ texture.name }}
    +
    + {{ texture.texture.name }} +
    +
    +
    +
    {{ channels[texture.channel].label }}
    + {{ channels[texture.channel].icon }} +
    +
    +
  • +
+
`, + }); + + registry.channelsPanelStyle = Blockbench.addCSS(/* css */ ` + .texture_channel { + color: var(--color-text); + flex: 1; + font-size: 1em; + margin: 0 0 0 auto; + padding: 0 8px; + text-align: right; + } + + .texture_channel + .texture_particle_icon { + padding-right: 8px; + } + + .texture_channel_description { + background-color: var(--color-back); + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: space-between; + } + + .texture_channel_wrapper { + align-items: center; + background-color: var(--color-ui); + border-left: 1px solid var(--color-border); + display: flex; + flex: 1; + flex-direction: row; + align-items: center; + flex-wrap: nowrap; + padding: 0 8px; + } + + .texture_channel_wrapper:hover { + background-color: var(--color-button); + } + + .texture_channel_description .texture_name { + flex-direction: column; + flex-wrap: nowrap; + color: var(--color-subtle_text); + display: flex; + flex: 1; + justify-content: center; + align-items: start; + } + + .texture_parent { + color: var(--color-subtle_text); + font-size: 0.8em; + } + + .texture_channel_description:hover .texture_channel { + color: var(--color-accent); + } + + #pbr_channel_list { + display: flex; + flex-direction: column; + } + + #pbr_channel_list .texture { + border-top: 1px solid var(--color-border); + padding-right: 0; + } + `); + + registry.channelsPanel = new Panel("channels_panel", { + name: "PBR Channels", + id: "channels_panel", + icon: "tv", + display_condition: { + modes: ["paint", "edit", "animate"], + project: true, + }, + toolbars: [ + new Toolbar("channel_assignment_toolbar", { + id: "channel_assignment_toolbar", + children: ["create_material_texture", "show_channel_menu"], + name: "PBR Channel Controls", + }), + ], + component, + expand_button: true, + growable: false, + onFold() {}, + onResize() {}, + default_side: "left", + default_position: { + slot: "left_bar", + float_position: [0, 0], + float_size: [400, 300], + height: 336, + folded: true, + }, + insert_after: "layers", + insert_before: "color", + }); +}); diff --git a/src/pbr_preview/src/lib/panels/index.ts b/src/pbr_preview/src/lib/panels/index.ts new file mode 100644 index 00000000..d490932a --- /dev/null +++ b/src/pbr_preview/src/lib/panels/index.ts @@ -0,0 +1,3 @@ +import "./materialBrush"; +import "./pbrSettings"; +import "./channels"; diff --git a/src/pbr_preview/src/lib/panels/materialBrush.ts b/src/pbr_preview/src/lib/panels/materialBrush.ts new file mode 100644 index 00000000..9b02ea30 --- /dev/null +++ b/src/pbr_preview/src/lib/panels/materialBrush.ts @@ -0,0 +1,47 @@ +import { registry, setups } from "../../constants"; + +setups.push(() => { + registry.materialBrushPanel = new Panel("material_brush_panel", { + name: "Material Brush", + id: "material_brush_panel", + icon: "view_in_ar", + toolbars: [ + new Toolbar("material_brush_toolbar", { + id: "material_brush_toolbar", + children: [ + "material_brush", + "slider_brush_metalness", + "slider_brush_roughness", + "brush_emissive_color", + "slider_brush_height", + ], + name: "Material Brush", + }), + new Toolbar("material_brush_presets_toolbar", { + id: "material_brush_presets_toolbar", + children: ["load_brush_preset", "brush_presets"], + name: "Brush Presets", + label: true, + }), + ], + display_condition: { + modes: ["paint"], + project: true, + }, + component: {}, + expand_button: true, + growable: false, + onFold() {}, + onResize() {}, + default_side: "right", + default_position: { + slot: "right_bar", + float_position: [0, 0], + float_size: [400, 300], + height: 300, + folded: false, + }, + insert_after: "color", + insert_before: "outliner", + }); +}); diff --git a/src/pbr_preview/src/lib/panels/pbrSettings.ts b/src/pbr_preview/src/lib/panels/pbrSettings.ts new file mode 100644 index 00000000..8ed6a660 --- /dev/null +++ b/src/pbr_preview/src/lib/panels/pbrSettings.ts @@ -0,0 +1,43 @@ +import { registry, setups } from "../../constants"; + +// TODO: Teardown toolbars + +setups.push(() => { + registry.displaySettingsPanel = new Panel("display_settings", { + name: "PBR Display Settings", + id: "display_settings_panel", + icon: "display_settings", + toolbars: [ + new Toolbar("controls_toolbar", { + id: "controls_toolbar", + children: [ + "toggle_pbr", + "correct_lights", + "display_settings_tone_mapping", + "display_settings_exposure", + "display_settings_reset_exposure", + ], + name: "Display Settings", + }), + ], + display_condition: { + modes: ["edit", "paint", "animate"], + project: true, + }, + component: {}, + expand_button: true, + growable: false, + onFold() {}, + onResize() {}, + default_side: "left", + default_position: { + slot: "left_bar", + float_position: [0, 0], + float_size: [400, 300], + height: 300, + folded: false, + }, + insert_after: "textures", + insert_before: "color", + }); +}); diff --git a/src/pbr_preview/src/lib/properties.ts b/src/pbr_preview/src/lib/properties.ts new file mode 100644 index 00000000..9a151f2d --- /dev/null +++ b/src/pbr_preview/src/lib/properties.ts @@ -0,0 +1,53 @@ +import { registry, CHANNELS, NA_CHANNEL, setups } from "../constants"; + +setups.push(() => { + registry.channelProp = new Property(TextureLayer, "enum", "channel", { + default: NA_CHANNEL, + values: Object.keys(CHANNELS).map((key) => CHANNELS[key].id), + label: "PBR Channel", + exposed: false, + }); + + registry.textureChannelProp = new Property(Texture, "enum", "channel", { + default: NA_CHANNEL, + values: Object.keys(CHANNELS).map((key) => CHANNELS[key].id), + label: "PBR Channel", + exposed: false, + }); + + registry.pbrMaterialsProp = new Property( + ModelProject, + // @ts-expect-error "object" is a valid type for a property + "object", + "pbr_materials", + { + default: {}, + exposed: false, + label: "PBR Materials", + }, + ); + + registry.projectMaterialsProp = new Property( + ModelProject, + // @ts-expect-error "object" is a valid type for a property + "object", + "bb_materials", + { + default: {}, + exposed: false, + label: "Project Materials", + }, + ); + + registry.projectPbrModeProp = new Property( + ModelProject, + "boolean", + "pbr_active", + { + default: false, + exposed: true, + values: [], + label: "PBR Mode", + }, + ); +}); diff --git a/src/pbr_preview/src/lib/tools/index.ts b/src/pbr_preview/src/lib/tools/index.ts new file mode 100644 index 00000000..e4c04bf9 --- /dev/null +++ b/src/pbr_preview/src/lib/tools/index.ts @@ -0,0 +1 @@ +import "./materialBrush"; diff --git a/src/pbr_preview/src/lib/tools/materialBrush.ts b/src/pbr_preview/src/lib/tools/materialBrush.ts new file mode 100644 index 00000000..0a08971a --- /dev/null +++ b/src/pbr_preview/src/lib/tools/materialBrush.ts @@ -0,0 +1,623 @@ +import { registry, CHANNELS, setups, teardowns } from "../../constants"; +import { applyPbrMaterial } from "../applyPbrMaterial"; +import { MaterialBrush } from "../MaterialBrush"; +import { vue as Vue, three as THREE } from "../../deps"; + +const generatePreviewImage = (settings: object) => { + const renderer = new THREE.WebGLRenderer({ + alpha: true, + antialias: true, + }); + const scene = new THREE.Scene(); + const camera = new THREE.PerspectiveCamera(75, 96 / 96, 0.1, 1000); + + const ambientLight = new THREE.AmbientLight(0xffffff, 0.75); + scene.add(ambientLight); + + const pointLight = new THREE.PointLight(0xffffff, 1, 100); + pointLight.position.set(5, 5, 5); + scene.add(pointLight); + const geometry = new THREE.SphereGeometry(1, 32, 32); + + const material = new THREE.MeshStandardMaterial({ + color: settings.albedo, + metalness: settings.metalness ?? 0, + roughness: settings.roughness ?? 1, + emissive: settings.emissive, + bumpScale: settings.height ?? 0, + envMap: PreviewScene.active?.cubemap ?? null, + envMapIntensity: 0.5, + }); + + const sphere = new THREE.Mesh(geometry, material); + scene.add(sphere); + + camera.position.x = 0; + camera.position.y = 0; + camera.position.z = 2; + + renderer.setSize(96, 96); + + renderer.render(scene, camera); + + return renderer.domElement.toDataURL(); +}; + +const STORAGE_NAMESPACE = "materialBrushPresets"; + +const getPresets = () => { + return JSON.parse(localStorage.getItem(STORAGE_NAMESPACE) || "{}"); +}; + +const savePreset = (name?: string, id?: string) => { + const presets = getPresets(); + const uuid = id ?? guid(); + const results = registry.userMaterialBrushPresets?.getFormResult() ?? {}; + const settings = {}; + + if (results.albedo) { + settings.albedo = results.albedo.toString(); + } + + if (results.metalness) { + settings.metalness = Number(results.metalness); + } + + if (results.roughness) { + settings.roughness = Number(results.roughness); + } + + if (results.emissive) { + settings.emissive = results.emissive.toString(); + } + + if (results.height) { + settings.height = Number(results.height); + } + + presets[uuid] = [ + settings, + name ?? "New Preset", + generatePreviewImage(settings), + ]; + + localStorage.setItem(STORAGE_NAMESPACE, JSON.stringify(presets)); + + return uuid; +}; + +const applyPreset = ({ + metalness, + roughness, + emissive, + height, + albedo, +}: { + metalness?: number; + roughness?: number; + emissive?: string; + height?: number; + albedo?: string; +}) => { + if (metalness !== undefined) { + registry.brushMetalnessSlider?.setValue(metalness || 0, true); + } + + if (roughness !== undefined) { + registry.brushRoughnessSlider?.setValue(roughness ?? 1, true); + } + + if (emissive !== undefined) { + registry.brushEmissiveColor?.set(emissive ?? "#000000"); + } + + if (height !== undefined) { + registry.brushHeightSlider?.setValue( + Math.max(0, Math.min(1, height ?? 0.5)), + true, + ); + } + + if (albedo !== undefined) { + // @ts-expect-error ColorPanel global is not typed + ColorPanel.set(albedo); + } +}; + +const userPresetsDialogComponent = Vue.extend({ + name: "UserPresetsDialog", + data(): { + userPresets: Record, string]>; + channels: typeof CHANNELS; + isEditing: boolean; + } { + return { + userPresets: {}, + channels: CHANNELS, + }; + }, + methods: { + applyPreset(preset: string) { + try { + const [settings, name] = this.userPresets[preset]; + + const { metalness, roughness, emissive, height, albedo } = settings; + + applyPreset({ + metalness: Number(metalness), + roughness: Number(roughness), + emissive: emissive.toString(), + height: Number(height), + albedo: albedo.toString(), + }); + + registry.userMaterialBrushPresets?.hide(); + Blockbench.showQuickMessage(`Preset "${name}" applied`, 2000); + } catch { + Blockbench.showQuickMessage("Failed to apply preset", 2000); + } + }, + deletePreset(preset: string) { + Blockbench.showMessageBox( + { + title: "Delete Preset", + message: "Are you sure you want to delete this preset?", + confirm: 1, + cancel: 0, + buttons: ["Cancel", "Delete"], + checkboxes: {}, + width: 400, + }, + (btn) => { + if (btn) { + const presets = getPresets(); + const friendlyName = this.userPresets[preset][1] ?? preset; + + delete presets[preset]; + + localStorage.setItem( + "materialBrushPresets", + JSON.stringify(presets), + ); + + this.userPresets = presets; + + Blockbench.showQuickMessage( + `Preset "${friendlyName}" deleted`, + 2000, + ); + } + }, + ); + }, + editPreset(preset: string) { + registry.userMaterialBrushPresets?.setFormValues({ + name: this.userPresets[preset][1] ?? preset, + ...this.userPresets[preset][0], + }); + }, + getSummary(settings: Record) { + return Object.entries(settings) + .filter(([channel]) => channel in this.channels) + .map(([channel, value]) => { + if (channel === "albedo" || channel === "emissive") { + return `${this.channels[channel]?.label ?? channel}: ${value}`; + } + + return `${this.channels[channel]?.label ?? channel}: ${Number(value).toFixed(1)}`; + }) + .join("\n"); + }, + }, + computed: { + presets() { + return Object.entries(this.userPresets); + }, + }, + mounted() { + this.userPresets = getPresets(); + }, + template: /* html */ ` +
+
    +
  • +
    + +
    {{ name }}
    +
    +
    +
    {{ name }}
    +
    +
    + +
    +
  • +
+
`, +}); + +setups.push(() => { + registry.materialBrushStyles = Blockbench.addCSS(/* css */ ` + .preset_list { + display: grid; + grid-template-columns: repeat(auto-fill, 96px); + grid-gap: 8px; + justify-content: start; + align-items: start; + margin: 0 auto; + padding: 8px; + } + + .user_preset { + display: flex; + justify-content: start; + align-items: center; + width: 100%; + padding: 8px; + position: relative; + } + + .preset_title { + font-size: 1em; + color: var(--color-text); + } + + .user_preset:hover .preset_title { + color: var(--color-accent); + } + + .preset_preview { + display: flex; + flex-direction: column; + flex-wrap: nowrap; + justify-content: center; + align-items: center; + text-align: center; + } + + .preset_buttons { + display: flex; + flex-direction: row; + align-items: center; + font-size: 0.8em; + padding: 0 4px; + } + + .preset_channel { + display: flex; + flex-direction: row; + align-items: center; + margin: 0 8px; + font-size: 0.8em; + } + + .delete_preset { + margin-left: 8px; + padding: 4px; + height: 24px; + width: 24px; + min-width: 24px; + background-color: transparent; + color: var(--color-text); + border: none; + border-radius: 100%; + position: absolute; + right: -8px; + top: 0; + filter: drop-shadow(0 0 2px var(--color-shadow)); + } + + .delete_preset .material-icons { + font-size: 0.825em; + } + + .delete_preset:hover { + background: transparent; + color: var(--color-accent); + } + + .delete_preset:hover .material-icons { + color: var(--color-accent); + } + `); + + registry.brushMetalnessSlider = new NumSlider("slider_brush_metalness", { + category: "paint", + name: "Metalness", + description: "Adjust the metalness of the brush", + settings: { + min: 0, + max: 1, + step: 0.01, + default: 0, + }, + condition: () => { + if (!Project) { + return false; + } + + const texture = Project.selected_texture; + + if (!texture?.layers_enabled) { + return false; + } + + return ( + texture.layers.find( + // @ts-expect-error Channel property is an extension of TextureLayer + ({ channel }) => channel === CHANNELS.metalness.id, + ) !== undefined + ); + }, + }); + + registry.brushRoughnessSlider = new NumSlider("slider_brush_roughness", { + category: "paint", + name: "Roughness", + description: "Adjust the roughness of the brush", + settings: { + min: 0, + max: 1, + step: 0.01, + default: 1, + }, + condition: () => { + if (!Project) { + return false; + } + + const texture = Project.selected_texture; + + if (!texture?.layers_enabled) { + return false; + } + + return ( + texture.layers.find( + // @ts-expect-error Channel property is an extension of TextureLayer + ({ channel }) => channel === CHANNELS.roughness.id, + ) !== undefined + ); + }, + }); + + registry.brushEmissiveColor = new ColorPicker("brush_emissive_color", { + category: "paint", + name: "Emissive", + description: "Adjust the emissive color of the brush", + value: "#000000", + condition: () => { + if (!Project) { + return false; + } + + const texture = Project.selected_texture; + + if (!texture?.layers_enabled) { + return false; + } + + return ( + texture.layers.find( + // @ts-expect-error Channel property is an extension of TextureLayer + ({ channel }) => channel === CHANNELS.emissive.id, + ) !== undefined + ); + }, + }); + + registry.brushHeightSlider = new NumSlider("slider_brush_height", { + category: "paint", + name: "Height", + description: "Adjust the height of the brush", + settings: { + min: 0, + max: 1, + step: 0.01, + default: 0.5, + }, + condition: () => { + if (!Project) { + return false; + } + + const texture = Project.selected_texture; + + if (!texture?.layers_enabled) { + return false; + } + + return ( + // @ts-expect-error Channel property is an extension of TextureLayer + texture.layers.find(({ channel }) => channel === CHANNELS.height.id) !== + undefined + ); + }, + }); + + registry.materialBrushPresets = new BarSelect("brush_presets", { + category: "paint", + name: "Material Brush Presets", + description: "Select a preset for the material brush", + options: { + matte: "Matte", + gloss: "Gloss", + metal: "Dull Metal", + polished: "Polished Metal", + glowing: "Glowing", + }, + onChange({ value }) { + applyPreset(value); + registry.materialBrushTool?.select(); + applyPbrMaterial(); + }, + }); + + registry.materialBrushTool = new Tool("material_brush", { + name: "Material Brush", + description: "Paints across multiple texture layers", + icon: "view_in_ar", + paintTool: true, + cursor: "cell", + condition: () => + Modes.paint && + !!Project && + Project.selected_texture && + Project.selected_texture.layers_enabled, + brush: { + blend_modes: false, + shapes: true, + size: true, + softness: true, + opacity: true, + offset_even_radius: true, + floor_coordinates: true, + changePixel(x, y, px, alpha, { size, softness, texture }) { + const mat = MaterialBrush.fromSettings(); + + const matChannels = Object.keys(mat.colors); + + let rgba = px; + + texture.layers.forEach((layer) => { + // @ts-expect-error Channel property is an extension of TextureLayer + if (!layer.visible || !matChannels.includes(layer.channel)) { + return; + } + + // @ts-expect-error Channel property is an extension of TextureLayer + const fill = mat.getChannel(layer.channel); + + if (!fill) { + return; + } + + // TODO: Let softness affect the brush + + layer.ctx.fillStyle = fill.getStyle(); + layer.ctx.fillRect(size * x, size * y, size, size); + + if (layer.selected) { + rgba = { + r: fill.r * 255, + g: fill.g * 255, + b: fill.b * 255, + a: alpha * 255, + }; + } + }); + + return rgba; + }, + }, + onCanvasClick(data: any) { + Painter.startPaintToolCanvas(data, data.event); + }, + onSelect() { + applyPbrMaterial(); + }, + click() { + applyPbrMaterial(); + }, + }); + + registry.loadBrushPreset = new Action("load_brush_preset", { + icon: "stroke_full", + name: "Material Brush Presets", + description: "Load or save a brush preset", + category: "paint", + condition: () => !!Project, + click() { + registry.userMaterialBrushPresets = new Dialog("user_brush_presets", { + id: "user_brush_presets", + title: "Edit Material Brush", + component: userPresetsDialogComponent, + part_order: ["lines", "component", "form"], + form: { + albedo: { + type: "color", + label: "Albedo", + value: ColorPanel.get(), + toggle_enabled: true, + }, + metalness: { + type: "number", + label: "Metalness", + min: 0, + max: 1, + step: 0.01, + full_width: false, + toggle_enabled: true, + }, + roughness: { + type: "number", + label: "Roughness", + min: 0, + max: 1, + step: 0.01, + toggle_enabled: true, + full_width: false, + }, + emissive: { + type: "color", + label: "Emissive", + value: "#000000", + toggle_enabled: true, + }, + height: { + type: "number", + label: "Height", + min: 0, + max: 1, + step: 0.01, + toggle_enabled: true, + }, + }, + onConfirm(formResult) { + applyPreset({ + metalness: Number( + formResult.metalness ?? registry.brushMetalnessSlider?.get(), + ), + roughness: Number( + formResult.roughness ?? registry.brushRoughnessSlider?.get(), + ), + emissive: ( + formResult.emissive ?? registry.brushEmissiveColor?.get() + ).toString(), + height: Number( + formResult.height ?? registry.brushHeightSlider?.get(), + ), + albedo: (formResult.albedo ?? ColorPanel.get()).toString(), + }); + }, + buttons: ["Close", "Save", "Apply"], + cancelIndex: 0, + confirmIndex: 2, + onButton(idx, event) { + if (idx !== 1) { + return; + } + + Blockbench.textPrompt("Save Preset", "New Preset", (name) => { + if (name) { + savePreset(name); + Blockbench.showQuickMessage(`Preset "${name}" saved`, 2000); + } + }); + }, + }).show(); + }, + }); + + MenuBar.addAction(registry.materialBrushTool, "tools.0"); +}); + +teardowns.push(() => { + MenuBar.removeAction("tools.material_brush"); +}); diff --git a/src/pbr_preview/src/types.d.ts b/src/pbr_preview/src/types.d.ts new file mode 100644 index 00000000..14b2f2cc --- /dev/null +++ b/src/pbr_preview/src/types.d.ts @@ -0,0 +1,76 @@ +export type Channel = + | "albedo" + | "metalness" + | "emissive" + | "roughness" + | "height" + | "normal" + | "ao"; + +export interface IChannel { + label: string; + description: string; + map: string; + id: string; + icon?: string; + default?: THREE.Color; +} + +export interface ILightrParams { + lightHeight?: number; + ambientLight?: [number, number, number]; + minLightIntensity?: number; + lightDiffuse?: [number, number, number]; +} + +export interface IPbrMaterials { + [materialUuid: string]: { + [channelId: string]: string; + }; +} + +// Extend Blockbench Project namespace +declare module "blockbench-types" { + interface Project { + pbr_materials: IPbrMaterials; + bb_materials: Record; + } +} + +export interface IRegistry { + bakeTexturesAction: Action; + bakeTexturesDialog: Dialog; + brushEmissiveColor: ColorPicker; + brushHeightSlider: NumSlider; + brushMetalnessSlider: NumSlider; + brushRoughnessSlider: NumSlider; + channelMenu: Menu; + channelProp: Property; + createMaterialTexture: Action; + createTextureSet: Action; + decodeMer: Action; + displaySettingsPanel: Panel; + exposureSlider: BarSlider; + resetExposure: Action; + generateMer: Action; + generateNormal: Action; + generateLabPbr: Action; + decodeLabPbr: Action; + materialBrushPanel: Panel; + materialBrushTool: Tool; + materialBrushPresets: BarSelect; + openChannelMenu: Action; + pbrMaterialsProp: Property; + projectMaterialsProp: Property; + projectPbrModeProp: Property; + setBrushMaterial: Action; + showChannelMenu: Action; + textureChannelProp: Property; + textureSetDialog: Dialog; + toggleCorrectLights: Toggle; + togglePbr: Toggle; + tonemappingSelect: BarSelect; + unassignChannel: Action; + userMaterialBrushPresets: Dialog; + [key: string]: Deletable; +} From 040eccc41d33b14e7c9ae0927389a14fdee643ec Mon Sep 17 00:00:00 2001 From: Jason Gardner Date: Thu, 6 Jun 2024 08:42:16 -0500 Subject: [PATCH 15/50] fix: Create MER output - Change create MER inference option --- src/pbr_preview/src/lib/mer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pbr_preview/src/lib/mer.ts b/src/pbr_preview/src/lib/mer.ts index b554c87d..1a31867f 100644 --- a/src/pbr_preview/src/lib/mer.ts +++ b/src/pbr_preview/src/lib/mer.ts @@ -25,7 +25,7 @@ export const exportMer = ( ? Project.textures : null, selected.uuid, - ).createMer(false); + ).createMer(true); if (!mer) { return; From edc6af32b9f27d918ff3ad511defc769c5eb9bd3 Mon Sep 17 00:00:00 2001 From: Jason Date: Fri, 7 Jun 2024 11:12:49 -0500 Subject: [PATCH 16/50] upd: Convert textures to material Action (#4) * fix: Channel assignment Action condition * upd: UI conditions / Mode select - PBR channel panel activates paint mode on texture selection * upd: Disable preview on unload - Set material render side - Disable PBR preview on plugin unload * fix: Assignment typo * upd: Channel assignment logic Plus chores * upd: Export MER try/catch * chore: Apply formatting * feat: Textures to material Action - Modified Create Material Action to use any selected textures as the channel sources * upd: Change material alpha test - Fix material texture channel object copying * upd: Channel panel methods - Updated process of finding selected textures in panel component - Added Vue methods to control template - Chore: Removed format npm script in favor of VS Code formatter * upd: Add material creation Undo - Disable buggy channels panel * fix: Include material layers in Undo --- plugins/pbr_preview/pbr_preview.js | 101 +---------- src/pbr_preview/.prettierrc | 12 ++ src/pbr_preview/package.json | 5 +- src/pbr_preview/src/index.ts | 4 +- src/pbr_preview/src/lib/PbrMaterials.ts | 51 +++--- .../src/lib/actions/channelAssignment.ts | 86 ++++----- .../src/lib/actions/materialTexture.ts | 93 +++++++--- src/pbr_preview/src/lib/actions/mer.ts | 7 +- src/pbr_preview/src/lib/actions/textureSet.ts | 35 ++-- src/pbr_preview/src/lib/applyPbrMaterial.ts | 2 + src/pbr_preview/src/lib/mer.ts | 13 +- src/pbr_preview/src/lib/panels/channels.ts | 166 +++++++++++------- src/pbr_preview/src/lib/panels/index.ts | 4 +- .../src/lib/tools/materialBrush.ts | 21 ++- src/pbr_preview/src/lib/util.ts | 77 ++++++++ 15 files changed, 380 insertions(+), 297 deletions(-) create mode 100644 src/pbr_preview/.prettierrc create mode 100644 src/pbr_preview/src/lib/util.ts diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index 9d438e49..fe9269c3 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1,5 +1,5 @@ -"use strict";(()=>{var b=THREE,I=Vue,ke=Blockbench;var B="_NONE_",m={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new b.Color(16777215)},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new b.Color(0)},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new b.Color(0)},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new b.Color(16777215)},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new b.Color(16777215)},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new b.Color("rgb(128, 128, 255)")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new b.Color(16777215)}},s={},y=[],E=[];y.push(()=>{s.channelProp=new Property(TextureLayer,"enum","channel",{default:B,values:Object.keys(m).map(t=>m[t].id),label:"PBR Channel",exposed:!1}),s.textureChannelProp=new Property(Texture,"enum","channel",{default:B,values:Object.keys(m).map(t=>m[t].id),label:"PBR Channel",exposed:!1}),s.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),s.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),s.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"})});var be=(t=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return t?a.filter(e=>e.layers_enabled&&e.layers.length>0).flatMap(e=>e.layers):a},k=class t{constructor(a,e){this._scope=a??be(),this._materialUuid=e}merToCanvas(){let a=this.getTexture(m.emissive),e=this.getTexture(m.roughness),r=this.getTexture(m.metalness);if(!a&&!e&&!r){let{metalness:n,emissive:o,roughness:l}=this.decodeMer();n&&(r=t.makePixelatedCanvas(n)),o&&(a=t.makePixelatedCanvas(o)),l&&(e=t.makePixelatedCanvas(l))}return{emissiveMap:a,roughnessMap:e,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:e,roughnessMap:r,metalnessMap:n}=this.merToCanvas(),o=this.getTexture(m.normal);return new b.MeshStandardMaterial({map:this.getTexture(m.albedo)??t.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(l=>l.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(m.ao),bumpMap:this.getTexture(m.height),normalMap:o,normalScale:new b.Vector2(1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:e,emissiveIntensity:e?1:0,emissive:e?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.5,...a})}saveTexture(a,e){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=e.uuid,e.extend({channel:a.id}))}findTexture(a,e=!0){if(!Project)return null;let r=this._scope.find(i=>i.channel&&(i.channel===a||i.channel===a.id));if(r)return r;let n=typeof a=="string"?a:a.id;Project.pbr_materials??={};let o=Project.pbr_materials[this._materialUuid];if(!o&&e&&n!==B){let i=new RegExp(`_*${n}(.[^.]+)?$`,"i");return this._scope.find(g=>i.test(g.name))??null}let l=o?.[n];return l?this._scope.find(i=>i.uuid===l)??null:null}static makePixelatedCanvas(a){let e=new b.CanvasTexture(a,void 0,void 0,void 0,b.NearestFilter,b.NearestFilter);return e.needsUpdate=!0,e}getTexture(a){let e=this.findTexture(a);return e?t.makePixelatedCanvas(e.canvas):null}static extractChannel(a,e){let r=a.canvas,n=r.width,o=r.height,l=r.getContext("2d");if(!l||!n||!o)return null;let i=document.createElement("canvas");i.width=n,i.height=o;let g=i.getContext("2d");if(!g)return null;let f={r:0,g:1,b:2,a:3}[e],{data:p}=l.getImageData(0,0,n,o),u=new Uint8ClampedArray(n*o*4);for(let x=0;xa){_[d]=v.data[d],_[d+1]=v.data[d+1],_[d+2]=v.data[d+2],_[d+3]=255;continue}_[d]=0,_[d+1]=0,_[d+2]=0,_[d+3]=255}return f.putImageData(new ImageData(_,i.width,i.height),0,0),{metalness:r,emissive:i,emissiveLevel:n,roughness:o,sss:l}}createMer(a=!1){let e=this.findTexture(m.metalness,a),r=this.findTexture(m.emissive,a),n=this.findTexture(m.roughness,a),o=this.findTexture("sss",!1),l=Math.max(e?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),i=Math.max(e?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),g=document.createElement("canvas");g.width=l,g.height=i;let f=g.getContext("2d");if(!f)return null;let p=e?.img?t.extractChannel(e,"r"):null,u=r?.img?t.extractChannel(r,"g"):null,v=n?.img?t.extractChannel(n,"b"):null,x=o&&o?.img?t.extractChannel(o,"a"):null,_=p?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(l,i),d=u?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(l,i),c=v?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(l,i),h=x?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(new Uint8ClampedArray(l*i*4).fill(255),l,i),w=new Uint8ClampedArray(l*i*4);for(let C=0;C{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),e}createTexturesFromNormal(a){let e=this.decodeLabPbrNormal(a);return Object.entries(e).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),e}createNormalMap(a,e=!1){let r=a.canvas.getContext("2d");if(!r)return null;let n=Math.max(a.img.width??a.canvas.width,Project?Project.texture_width:0,16),o=Math.max(a.img.height??a.canvas.height,Project?Project.texture_height:0,16),{data:l}=r.getImageData(0,0,n,o),i=document.createElement("canvas"),g=i.getContext("2d");if(!g)return null;let f=(c,h)=>{let w=(c+h*n)*4;return l[w]/255};i.width=n,i.height=o,g.drawImage(a.img,0,0,n,o);let p=g.getImageData(0,0,n,o),u=p.data,v=c=>{let h=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);return[c[0]/h,c[1]/h,c[2]/h]};for(let c=0;c{let _=this.createCanvas(e.width,e.height),d=_.getContext("2d"),c=d.getImageData(0,0,_.width,_.height),h=[Math.cos(x),Math.sin(x),this.lightHeight];for(let w=0;w{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new k(r.layers_enabled?r.layers:Project.textures,r.uuid),o=n.findTexture(m.albedo);if(!o){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let l=n.findTexture(m.normal);if(!l){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let g=new H(t).bake(a,o.canvas,l.canvas),f=new Texture({name:`${o.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(g[0].toDataURL()),p=e?u=>{let v=n.findTexture(m.emissive);if(!v)return u;let x=v.canvas;if(!x.getContext("2d"))return u;let d=Math.max(u.width,x.width,Project?Project.texture_width:16),c=Math.max(u.height,x.height,Project?Project.texture_height:16),h=document.createElement("canvas");h.width=d,h.height=c;let w=h.getContext("2d");return w?(w.drawImage(u,0,0),w.globalCompositeOperation="screen",w.drawImage(x,0,0),h):u}:u=>u;g.forEach((u,v)=>{new TextureLayer({name:`baked_${v+1}`,data_url:p(u).toDataURL()},f).addForEditing()}),f.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};y.push(()=>{s.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(t){let a=new b.Color(t.ambientLight.toString()),e=new b.Color(t.lightDiffuse.toString());V({ambientLight:[a.r,a.g,a.b],lightDiffuse:[e.r,e.g,e.b],lightHeight:Number(t.lightHeight),minLightIntensity:Number(t.minLightIntensity)},t.directions??8,t.blendEmissive??!1)}}),s.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){s.bakeTexturesDialog?.show()}}),MenuBar.addAction(s.bakeTexturesAction,"tools")});E.push(()=>{MenuBar.removeAction("tools.bake_textures")});var S=t=>{if(!Project||Texture.all.length===0)return;let a=!1;Project.elements.forEach(e=>{e instanceof Cube&&Object.keys(e.faces).forEach(r=>{let o=e.faces[r].getTexture();if(!o)return;let l=Project.materials[o.uuid];l.isShaderMaterial&&!Project.bb_materials[o.uuid]&&(Project.bb_materials[o.uuid]=l);let i=new k(o.layers_enabled?o.layers.filter(g=>g.visible)??null:Project.textures,o.uuid).getMaterial(t);Project.materials[o.uuid]=b.ShaderMaterial.prototype.copy.call(i,l),Canvas.updateAllFaces(o),a=!0})}),Project.pbr_active=a};var $={},J=Condition(()=>Modes.paint&&(TextureLayer.selected||Project&&Project.selected_texture!==null));function _e(){Object.entries(m).forEach(([t,a])=>{$[t]=new Action(`assign_channel_${t}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:J,click(e){let r=TextureLayer.selected??(Project?Project.selected_texture:null);if(!r||!Project)return;Undo.initEdit({layers:[r]}),r.extend({channel:a.id});let n=r instanceof TextureLayer?r.texture:r;n.updateChangesAfterEdit(),Project.pbr_materials[n.uuid]||(Project.pbr_materials[n.uuid]={}),Object.entries(Project.pbr_materials[n.uuid]).forEach(([o,l])=>{l===r.uuid&&(delete Project.pbr_materials[n.uuid][o],r.channel=B)}),Project.pbr_materials[n.uuid][t]=r.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${r.name}" to ${a.label} channel`,2e3),S()}})})}function ve(){Object.entries($).forEach(([t,a])=>{a.delete()})}y.push(_e);E.push(ve);y.push(()=>{s.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:()=>{if(!Modes.paint)return!1;if(TextureLayer.selected)return TextureLayer.selected.channel!==B||!TextureLayer.selected.channel;if(!Project)return!1;let t=Project.selected_texture;return t!==null&&t.channel!==B&&t.channel},click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t||!Project)return;Undo.initEdit({layers:[t]});let a=t instanceof TextureLayer?t.texture:t,e=t.channel;Project.pbr_materials[a.uuid]={},t.channel=B,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${t.name}" from ${e} channel`,2e3),S()}}),s.channelMenu=new Menu("channel_menu",[...Object.keys(m).map(t=>`assign_channel_${t}`),"unassign_channel"],{onOpen(){S()}}),s.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",click(t){s.channelMenu?.open(t)},children:[...Object.values($),s.unassignChannel]}),s.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:J,click(t){s.channelMenu?.open(t)}})});y.push(()=>{s.openChannelMenu&&MenuBar.addAction(s.openChannelMenu,"image.0")});E.push(()=>{MenuBar.removeAction("image.pbr_channel_menu")});y.push(()=>{s.generateNormal=new Action("generate_normal",{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(t=>t.selected))!==void 0,click(){let t=TextureLayer.selected??(Project&&Project.selected_texture?Project.selected_texture.selected_layer??Project.selected_texture:Texture.getDefault());if(!t)return;let a=new k(t instanceof Texture&&t.layers_enabled?t.layers:null,t.uuid),e=a.createNormalMap(t);if(e){a.saveTexture(m.normal,e),e.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),MenuBar.addAction(s.generateNormal,"tools")});E.push(()=>{MenuBar.removeAction("tools.generate_normal")});var W=(t,a)=>{let e=a??document.createElement("canvas"),r=e.getContext("2d");if(!r)return null;let n=Math.max(Project?Project.texture_width:16,16),o=Math.max(Project?Project.texture_height:16,16);return e.width=n,e.height=o,r.fillStyle=`rgb(${t.r*255}, ${t.g*255}, ${t.b*255})`,r.fillRect(0,0,n,o),e.toDataURL()};y.push(()=>{s.createMaterialTexture=new Action("create_material_texture",{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",click(){if(!Project)return;let t=new Texture({name:"New Material",saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}),a=W(new b.Color(8421504));a&&(t.fromDataURL(a).add().select(),Object.keys(m).forEach(e=>{let r=m[e],n=new TextureLayer({name:r.label,visible:!0},t);n.setSize(Project.texture_width??t.width,Project.texture_height??t.height);let o=W(r.default??new b.Color(0),n.canvas);o&&n.texture.fromDataURL(o),n.extend({channel:r.id}),n.addForEditing()}))}}),MenuBar.addAction(s.createMaterialTexture,"tools")});E.push(()=>{MenuBar.removeAction("tools.create_material_texture")});var R=(t,a)=>{let e=Project?Project.selected_texture:Texture.all.find(n=>n.selected);if(!e)return;let r=new k(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!1);r&&r.toBlob(async n=>{if(!n)return;let[o,l]=Project?[t?`${t}_mer`:`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:o,extensions:["png"],resource_id:"mer",savetype:"image",startpath:l},a)})};function we(){s.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock_block","bedrock_entity"],project:!0},click(){R()}}),s.decodeMer=new Action("decode_mer",{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",condition:()=>!!Project&&Project.selected_texture!==null&&!Project.selected_texture.layers_enabled,click(){let t=TextureLayer.selected?.texture??Texture.all.find(n=>n.selected)??Texture.getDefault(),a=new k(t.layers_enabled?t.layers:[t],t.uuid),e=a.decodeMer(),r=[m.metalness,m.emissive,m.roughness];Undo.initEdit({textures:[t]}),t.activateLayers(!0),r.forEach(n=>{let o=n.id,l=e[o];if(!l){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let i=new TextureLayer({name:`${t?.name}_${o}`,data_url:l.toDataURL()},t);a.saveTexture(n,i),i.addForEditing()}),Undo.finishEdit("Decode MER")}}),MenuBar.addAction(s.decodeMer,"tools"),MenuBar.addAction(s.generateMer,"file.export")}function ye(){MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")}y.push(we);E.push(ye);var Ce=()=>{Project&&Project.textures.forEach(t=>{let a=new k(null,t.uuid),e=a.findTexture(m.normal,!1),r=a.findTexture(m.height,!1),n=a.findTexture(m.albedo,!1),o=a.findTexture(m.metalness,!1)?.name,l=a.findTexture(m.emissive,!1)?.name,i=a.findTexture(m.roughness,!1)?.name,g={};return n||(g.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!l&&!i&&(g.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},g.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},g.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),e&&(g.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(g.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),e&&r&&(g.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),s.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:g,onConfirm(f){let p=Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName(),u=o||l||i,v={format_version:"1.16.100","minecraft:texture_set":{color:(n?p:f.baseColor?.toHexString())??p,metalness_emissive_roughness:[f.metalness??0,f.emissive??0,f.roughness??255]}};f.depthMap==="normal"&&e||!r&&e?v["minecraft:texture_set"].normal=`${p}_normal`:(!e||f.depthMap==="heightmap")&&r&&(v["minecraft:texture_set"].heightmap=`${p}_heightmap`);let x=c=>{if(!f.depthMap)return c();let h=f.depthMap==="normal"||f.depthMap&&!r,w=h?e:r;if(!w)return c();Blockbench.export({content:w.canvas.toDataURL()??"",type:"PNG",name:`${p}_${h?"normal":"heightmap"}`,extensions:["png"],resource_id:f.depthMap,startpath:Project.export_path,savetype:"image"},C=>{v["minecraft:texture_set"][h?"normal":"heightmap"]=pathToName(C,!1),c()})},_=c=>{if(!n)return c();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:p,startpath:Project.export_path,savetype:"image"},h=>{v["minecraft:texture_set"].color=pathToName(h,!1),c()})},d=()=>x(()=>{_(()=>{Blockbench.export({content:JSON.stringify(v,null,2),type:"JSON",name:`${p}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),s.textureSetDialog?.hide()})})});if(u){R(p,c=>{v["minecraft:texture_set"].metalness_emissive_roughness=pathToName(c,!1),d()});return}d()},cancelIndex:1}),s.textureSetDialog.show()})};y.push(()=>{s.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){Ce()},condition:{formats:["bedrock_block","bedrock_entity"],project:!0}}),MenuBar.addAction(s.createTextureSet,"file.export")});E.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});y.push(()=>{s.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(t){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=t}),Preview.selected.renderer.physicallyCorrectLights=t,Blockbench.showQuickMessage(`Physically corrected lighting is now ${t?"enabled":"disabled"}`,2e3),t&&s.togglePbr?.set(!0),S()},click(){}}),MenuBar.addAction(s.toggleCorrectLights,"preview")});E.push(()=>{MenuBar.removeAction("preview.correct_lights")});var q=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(a=>{let r=t.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var X=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],K=()=>Project&&Project.pbr_active&&S(),Pe=()=>{X.forEach(t=>{Blockbench.addListener(t,K)})},Y=()=>{X.forEach(t=>{Blockbench.removeListener(t,K)})};y.push(()=>{s.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(t){if(t){S(),Pe(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}q(),Y(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(s.togglePbr,"view")});E.push(()=>{Y(),MenuBar.removeAction("view.toggle_pbr")});var Z=t=>{let a=Math.max(-2,Math.min(2,Number(t)));Preview.all.forEach(e=>{e.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};y.push(()=>{s.exposureSlider=new BarSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",step:.1,min:-2,max:2,onBefore(){Number(s.tonemappingSelect?.get())===b.NoToneMapping&&s.tonemappingSelect.change(b.LinearToneMapping.toString()),s.togglePbr?.set(!0)},onChange({value:t}){Z(t)},onAfter(){S()}}),s.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>s.exposureSlider!==void 0&&Number(s.exposureSlider?.get())!==1,click(){Z(1),s.exposureSlider?.set(1),S()}}),s.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:b.NoToneMapping,value:Preview.selected.renderer.toneMapping??b.NoToneMapping,icon:"monochrome_photos",options:{[b.NoToneMapping]:"No Tone Mapping",[b.LinearToneMapping]:"Linear",[b.ReinhardToneMapping]:"Reinhard",[b.CineonToneMapping]:"Cineon",[b.ACESFilmicToneMapping]:"ACES"},onChange({value:t}){let a=Number(s.exposureSlider?.get()??1);Preview.all.forEach(e=>{e.renderer.toneMapping=Number(t),e.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMapping=Number(t),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(t)}`,2e3),s.togglePbr&&!s.togglePbr.value&&s.togglePbr.set(!0),S()}})});var Me=(t,a="texture")=>{t.toBlob(async e=>{e&&Blockbench.export({content:await e.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},Te=(t,a="texture")=>{t.toBlob(async e=>{e&&Blockbench.export({content:await e.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};y.push(()=>{s.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let t=Project.selected_texture;if(!t)return;let e=new k(t.layers_enabled?t.layers:[t],t.uuid).createLabPbrOutput();if(e===null)return;let r=t.name??(Project?Project.getDisplayName():"texture");await Promise.all([Me(e.normalMap,pathToName(r)),Te(e.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),s.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:()=>!!Project&&Project.selected_texture!==null,click(){let t=TextureLayer.selected?.texture??Texture.all.find(e=>e.selected)??Texture.getDefault(),a=new k(t.layers_enabled?t.layers:[t],t.uuid);if(t.name.endsWith("_n")||t.name.endsWith("_n.png")){a.createTexturesFromNormal(t);return}if(t.name.endsWith("_s")||t.name.endsWith("_s.png")){a.createTexturesFromSpecular(t);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(s.generateLabPbr,"file.export"),MenuBar.addAction(s.decodeLabPbr,"tools")});E.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});var U=class t{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(m).map(e=>[e,m[e].default??new b.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([e,r])=>[e,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let e=Math.min(1,Math.max(0,a));return new b.Color(e,e,e).convertSRGBToLinear()}static fromSettings(){let a="#000000",e=Number(s.brushMetalnessSlider?.get()),r=Number(s.brushRoughnessSlider?.get()??1),n=(s.brushEmissiveColor?.get()??a).toString(),o=Number(s.brushHeightSlider?.get()),l=ColorPanel.get(),i={[m.albedo.id]:new b.Color(l),[m.metalness.id]:t.makeLinearColor(e),[m.roughness.id]:t.makeLinearColor(r),[m.emissive.id]:new b.Color(n??a),[m.height.id]:t.makeLinearColor(o),[m.normal.id]:m.normal.default??new b.Color("#8080ff")};return new t({colors:i})}};var Ee=t=>{let a=new b.WebGLRenderer({alpha:!0,antialias:!0}),e=new b.Scene,r=new b.PerspectiveCamera(75,96/96,.1,1e3),n=new b.AmbientLight(16777215,.75);e.add(n);let o=new b.PointLight(16777215,1,100);o.position.set(5,5,5),e.add(o);let l=new b.SphereGeometry(1,32,32),i=new b.MeshStandardMaterial({color:t.albedo,metalness:t.metalness??0,roughness:t.roughness??1,emissive:t.emissive,bumpScale:t.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),g=new b.Mesh(l,i);return e.add(g),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(e,r),a.domElement.toDataURL()},ee="materialBrushPresets",O=()=>JSON.parse(localStorage.getItem(ee)||"{}"),je=(t,a)=>{let e=O(),r=a??guid(),n=s.userMaterialBrushPresets?.getFormResult()??{},o={};return n.albedo&&(o.albedo=n.albedo.toString()),n.metalness&&(o.metalness=Number(n.metalness)),n.roughness&&(o.roughness=Number(n.roughness)),n.emissive&&(o.emissive=n.emissive.toString()),n.height&&(o.height=Number(n.height)),e[r]=[o,t??"New Preset",Ee(o)],localStorage.setItem(ee,JSON.stringify(e)),r},F=({metalness:t,roughness:a,emissive:e,height:r,albedo:n})=>{t!==void 0&&s.brushMetalnessSlider?.setValue(t||0,!0),a!==void 0&&s.brushRoughnessSlider?.setValue(a??1,!0),e!==void 0&&s.brushEmissiveColor?.set(e??"#000000"),r!==void 0&&s.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},Le=I.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:m}},methods:{applyPreset(t){try{let[a,e]=this.userPresets[t],{metalness:r,roughness:n,emissive:o,height:l,albedo:i}=a;F({metalness:Number(r),roughness:Number(n),emissive:o.toString(),height:Number(l),albedo:i.toString()}),s.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${e}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(t){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let e=O(),r=this.userPresets[t][1]??t;delete e[t],localStorage.setItem("materialBrushPresets",JSON.stringify(e)),this.userPresets=e,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(t){s.userMaterialBrushPresets?.setFormValues({name:this.userPresets[t][1]??t,...this.userPresets[t][0]})},getSummary(t){return Object.entries(t).filter(([a])=>a in this.channels).map(([a,e])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${e}`:`${this.channels[a]?.label??a}: ${Number(e).toFixed(1)}`).join(` -`)}},computed:{presets(){return Object.entries(this.userPresets)}},mounted(){this.userPresets=O()},template:` +"use strict";(()=>{var b=THREE,J=Vue,Le=Blockbench;var B="_NONE_",d={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new b.Color(16777215)},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new b.Color(0)},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new b.Color(0)},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new b.Color(16777215)},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new b.Color(16777215)},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new b.Color("rgb(128, 128, 255)")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new b.Color(16777215)}},s={},w=[],E=[];w.push(()=>{s.channelProp=new Property(TextureLayer,"enum","channel",{default:B,values:Object.keys(d).map(e=>d[e].id),label:"PBR Channel",exposed:!1}),s.textureChannelProp=new Property(Texture,"enum","channel",{default:B,values:Object.keys(d).map(e=>d[e].id),label:"PBR Channel",exposed:!1}),s.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),s.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),s.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"})});var ve=(e=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return e?a.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):a},L=class e{constructor(a,t){this._scope=a??ve(),this._materialUuid=t}merToCanvas(){let a=this.getTexture(d.emissive),t=this.getTexture(d.roughness),r=this.getTexture(d.metalness);if(!a&&!t&&!r){let{metalness:n,emissive:o,roughness:l}=this.decodeMer();n&&(r=e.makePixelatedCanvas(n)),o&&(a=e.makePixelatedCanvas(o)),l&&(t=e.makePixelatedCanvas(l))}return{emissiveMap:a,roughnessMap:t,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:n}=this.merToCanvas(),o=this.getTexture(d.normal);return new b.MeshStandardMaterial({map:this.getTexture(d.albedo)??e.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(l=>l.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(d.ao),bumpMap:this.getTexture(d.height),normalMap:o,normalScale:new b.Vector2(1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}saveTexture(a,t){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=t.uuid,t.extend({channel:a.id}))}findTexture(a,t=!0){if(!Project)return null;let r=this._scope.find(i=>i.channel&&(i.channel===a||i.channel===a.id));if(r)return r;let n=typeof a=="string"?a:a.id;Project.pbr_materials??={};let o=Project.pbr_materials[this._materialUuid];if(!o&&t&&n!==B){let i=new RegExp(`_*${n}(.[^.]+)?$`,"i");return this._scope.find(h=>i.test(h.name))??null}let l=o?.[n];return l?this._scope.find(i=>i.uuid===l)??null:null}static makePixelatedCanvas(a){let t=new b.CanvasTexture(a,void 0,void 0,void 0,b.NearestFilter,b.NearestFilter);return t.needsUpdate=!0,t}getTexture(a){let t=this.findTexture(a);return t?e.makePixelatedCanvas(t.canvas):null}static extractChannel(a,t){let r=a.canvas,n=r.width,o=r.height,l=r.getContext("2d");if(!l||!n||!o)return null;let i=document.createElement("canvas");i.width=n,i.height=o;let h=i.getContext("2d");if(!h)return null;let p={r:0,g:1,b:2,a:3}[t],{data:f}=l.getImageData(0,0,n,o),u=new Uint8ClampedArray(n*o*4);for(let x=0;xa){v[m]=_.data[m],v[m+1]=_.data[m+1],v[m+2]=_.data[m+2],v[m+3]=255;continue}v[m]=0,v[m+1]=0,v[m+2]=0,v[m+3]=255}return p.putImageData(new ImageData(v,i.width,i.height),0,0),{metalness:r,emissive:i,emissiveLevel:n,roughness:o,sss:l}}createMer(a=!1){let t=this.findTexture(d.metalness,a),r=this.findTexture(d.emissive,a),n=this.findTexture(d.roughness,a),o=this.findTexture("sss",!1),l=Math.max(t?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),i=Math.max(t?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),h=document.createElement("canvas");h.width=l,h.height=i;let p=h.getContext("2d");if(!p)return null;let f=t?.img?e.extractChannel(t,"r"):null,u=r?.img?e.extractChannel(r,"g"):null,_=n?.img?e.extractChannel(n,"b"):null,x=o&&o?.img?e.extractChannel(o,"a"):null,v=f?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(l,i),m=u?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(l,i),c=_?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(l,i),g=x?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(new Uint8ClampedArray(l*i*4).fill(255),l,i),y=new Uint8ClampedArray(l*i*4);for(let C=0;C{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createTexturesFromNormal(a){let t=this.decodeLabPbrNormal(a);return Object.entries(t).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createNormalMap(a,t=!1){let r=a.canvas.getContext("2d");if(!r)return null;let n=Math.max(a.img.width??a.canvas.width,Project?Project.texture_width:0,16),o=Math.max(a.img.height??a.canvas.height,Project?Project.texture_height:0,16),{data:l}=r.getImageData(0,0,n,o),i=document.createElement("canvas"),h=i.getContext("2d");if(!h)return null;let p=(c,g)=>{let y=(c+g*n)*4;return l[y]/255};i.width=n,i.height=o,h.drawImage(a.img,0,0,n,o);let f=h.getImageData(0,0,n,o),u=f.data,_=c=>{let g=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);return[c[0]/g,c[1]/g,c[2]/g]};for(let c=0;c{let v=this.createCanvas(t.width,t.height),m=v.getContext("2d"),c=m.getImageData(0,0,v.width,v.height),g=[Math.cos(x),Math.sin(x),this.lightHeight];for(let y=0;y{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new L(r.layers_enabled?r.layers:Project.textures,r.uuid),o=n.findTexture(d.albedo);if(!o){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let l=n.findTexture(d.normal);if(!l){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let h=new I(e).bake(a,o.canvas,l.canvas),p=new Texture({name:`${o.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(h[0].toDataURL()),f=t?u=>{let _=n.findTexture(d.emissive);if(!_)return u;let x=_.canvas;if(!x.getContext("2d"))return u;let m=Math.max(u.width,x.width,Project?Project.texture_width:16),c=Math.max(u.height,x.height,Project?Project.texture_height:16),g=document.createElement("canvas");g.width=m,g.height=c;let y=g.getContext("2d");return y?(y.drawImage(u,0,0),y.globalCompositeOperation="screen",y.drawImage(x,0,0),g):u}:u=>u;h.forEach((u,_)=>{new TextureLayer({name:`baked_${_+1}`,data_url:f(u).toDataURL()},p).addForEditing()}),p.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};w.push(()=>{s.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(e){let a=new b.Color(e.ambientLight.toString()),t=new b.Color(e.lightDiffuse.toString());W({ambientLight:[a.r,a.g,a.b],lightDiffuse:[t.r,t.g,t.b],lightHeight:Number(e.lightHeight),minLightIntensity:Number(e.minLightIntensity)},e.directions??8,e.blendEmissive??!1)}}),s.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){s.bakeTexturesDialog?.show()}}),MenuBar.addAction(s.bakeTexturesAction,"tools")});E.push(()=>{MenuBar.removeAction("tools.bake_textures")});var S=e=>{if(!Project||Texture.all.length===0)return;let a=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(r=>{let o=t.faces[r].getTexture();if(!o)return;let l=Project.materials[o.uuid];l.isShaderMaterial&&!Project.bb_materials[o.uuid]&&(Project.bb_materials[o.uuid]=l);let i=new L(o.layers_enabled?o.layers.filter(h=>h.visible)??null:Project.textures,o.uuid).getMaterial(e);i.side=Canvas.getRenderSide(o),Project.materials[o.uuid]=b.ShaderMaterial.prototype.copy.call(i,l),Canvas.updateAllFaces(o),a=!0})}),Project.pbr_active=a};var $={};w.push(()=>{Object.entries(d).forEach(([e,a])=>{$[e]=new Action(`assign_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:{selected:{texture:!0}},click(t){let r=TextureLayer.selected??(Project?Project.selected_texture:null);if(!r||!Project)return;Undo.initEdit({layers:[r]}),r.extend({channel:a.id});let n=r instanceof TextureLayer?r.texture:r;n.updateChangesAfterEdit(),Project.pbr_materials[n.uuid]||(Project.pbr_materials[n.uuid]={}),Object.entries(Project.pbr_materials[n.uuid]).forEach(([o,l])=>{l===r.uuid&&(delete Project.pbr_materials[n.uuid][o],r.channel=B)}),n.uuid===r.uuid&&(Project.pbr_materials[n.uuid]={}),Project.pbr_materials[n.uuid][e]=r.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${r.name}" to ${a.label} channel`,2e3),S()}})})});E.push(()=>{Object.entries($).forEach(([e,a])=>{a?.delete()})});w.push(()=>{s.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:{selected:{texture:!0},method(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);return!e||!Project?!1:e.channel&&e.channel!==B}},click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e||!Project)return;Undo.initEdit({layers:[e]});let a=e instanceof TextureLayer?e.texture:e,t=e.channel;Project.pbr_materials[a.uuid]={},e.channel=B,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${e.name}" from ${t} channel`,2e3),S()}}),s.channelMenu=new Menu("channel_menu",[...Object.keys(d).map(e=>`assign_channel_${e}`),"unassign_channel"],{onOpen(){S()}}),s.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",click(e){s.channelMenu?.open(e)},children:[...Object.values($),s.unassignChannel]}),s.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(e){s.channelMenu?.open(e)}})});w.push(()=>{s.openChannelMenu&&(MenuBar.addAction(s.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(s.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(s.openChannelMenu,"0")),Toolbars.layers.add(s.showChannelMenu,1)});E.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(s.showChannelMenu)});w.push(()=>{s.generateNormal=new Action("generate_normal",{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(e=>e.selected))!==void 0,click(){let e=TextureLayer.selected??(Project&&Project.selected_texture?Project.selected_texture.selected_layer??Project.selected_texture:Texture.getDefault());if(!e)return;let a=new L(e instanceof Texture&&e.layers_enabled?e.layers:null,e.uuid),t=a.createNormalMap(e);if(t){a.saveTexture(d.normal,t),t.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),MenuBar.addAction(s.generateNormal,"tools")});E.push(()=>{MenuBar.removeAction("tools.generate_normal")});var q=(e,a)=>{let t=a??document.createElement("canvas"),r=t.getContext("2d");if(!r)return null;let n=Math.max(Project?Project.texture_width:16,16),o=Math.max(Project?Project.texture_height:16,16);return t.width=n,t.height=o,r.fillStyle=`rgb(${e.r*255}, ${e.g*255}, ${e.b*255})`,r.fillRect(0,0,n,o),t.toDataURL()};w.push(()=>{s.createMaterialTexture=new Action("create_material_texture",{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",click(){if(!Project)return;let e={...d},a=new Texture({name:"New Material",saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}),t=Texture.all.filter(o=>o.selected||o.multi_selected)??Texture.all,r=Texture.selected?new L(t,Texture.selected.uuid):null;try{let o=r?.findTexture(d.albedo,!0)?.canvas.toDataURL()??Texture.selected?.canvas.toDataURL()??q(new b.Color(8421504),a.canvas);if(!o)return;a.fromDataURL(o);let l=new TextureLayer({name:e.albedo.label,visible:!0,data_url:o},a);l.extend({channel:e.albedo.id}),l.addForEditing(),l.texture.updateChangesAfterEdit(),delete e.albedo}catch(o){console.warn("Failed to create base color texture",o),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let n=Object.keys(e).map(o=>{let l=d[o],i=r?.findTexture(l,!0),h=i?i.canvas.toDataURL():q(l.default??new b.Color(0));if(!h)return;let p=new TextureLayer({name:l.label,visible:!0,data_url:h},a);return p.extend({channel:l.id}),p}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:n}),a.add().select(),n.map(o=>o.addForEditing()),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(s.createMaterialTexture,"tools"),Toolbars.texturelist.add(s.createMaterialTexture,3)});E.push(()=>{MenuBar.removeAction("tools.create_material_texture")});function O(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(e=>e.selected)??null:Texture.all.find(e=>e.selected)??Texture.getDefault()}function X(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(O()?.name??"texture")}var R=(e,a)=>{let t=O(),r=new L(t.layers_enabled?t.layers:Project?Project.textures:null,t.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[o,l]=Project?[e?`${e}_mer`:`${t.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:o,extensions:["png"],resource_id:"mer",savetype:"image",startpath:l},a)})};function _e(){s.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock_block","bedrock_entity"],project:!0},click(){try{R()}catch(e){console.error("Failed to export MER map:",e),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),s.decodeMer=new Action("decode_mer",{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",condition:()=>!!Project&&Project.selected_texture!==null&&!Project.selected_texture.layers_enabled,click(){let e=TextureLayer.selected?.texture??Texture.all.find(n=>n.selected)??Texture.getDefault(),a=new L(e.layers_enabled?e.layers:[e],e.uuid),t=a.decodeMer(),r=[d.metalness,d.emissive,d.roughness];Undo.initEdit({textures:[e]}),e.activateLayers(!0),r.forEach(n=>{let o=n.id,l=t[o];if(!l){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let i=new TextureLayer({name:`${e?.name}_${o}`,data_url:l.toDataURL()},e);a.saveTexture(n,i),i.addForEditing()}),Undo.finishEdit("Decode MER")}}),MenuBar.addAction(s.decodeMer,"tools"),MenuBar.addAction(s.generateMer,"file.export")}function ye(){MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")}w.push(_e);E.push(ye);var we=()=>{Project&&Project.textures.forEach(e=>{let a=new L(null,e.uuid),t=a.findTexture(d.normal,!1),r=a.findTexture(d.height,!1),n=a.findTexture(d.albedo,!1),o=a.findTexture(d.metalness,!1)?.name,l=a.findTexture(d.emissive,!1)?.name,i=a.findTexture(d.roughness,!1)?.name,h={};return n||(h.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!l&&!i&&(h.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},h.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},h.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),t&&(h.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(h.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),t&&r&&(h.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),s.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:h,cancelIndex:1,onConfirm(p){let f=X(),u=o||l||i,_={format_version:"1.16.100","minecraft:texture_set":{color:(n?f:p.baseColor?.toHexString())??f,metalness_emissive_roughness:[p.metalness??0,p.emissive??0,p.roughness??255]}};p.depthMap==="normal"&&t||!r&&t?_["minecraft:texture_set"].normal=`${f}_normal`:(!t||p.depthMap==="heightmap")&&r&&(_["minecraft:texture_set"].heightmap=`${f}_heightmap`);let x=c=>{if(!p.depthMap)return c();let g=p.depthMap==="normal"||p.depthMap&&!r,y=g?t:r;if(!y)return c();Blockbench.export({content:y.canvas.toDataURL()??"",type:"PNG",name:`${f}_${g?"normal":"heightmap"}`,extensions:["png"],resource_id:p.depthMap,startpath:Project.export_path,savetype:"image"},C=>{_["minecraft:texture_set"][g?"normal":"heightmap"]=pathToName(C,!1),c()})},v=c=>{if(!n)return c();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:f,startpath:Project.export_path,savetype:"image"},g=>{_["minecraft:texture_set"].color=pathToName(g,!1),c()})},m=()=>x(()=>{v(()=>{Blockbench.export({content:JSON.stringify(_,null,2),type:"JSON",name:`${f}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),s.textureSetDialog?.hide()})})});if(u){try{R(f,c=>{_["minecraft:texture_set"].metalness_emissive_roughness=pathToName(c,!1),m()})}catch(c){console.warn("Failed to export MER map:",c),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}m()}}),s.textureSetDialog.show()})};w.push(()=>{s.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){we()},condition:{formats:["bedrock_block","bedrock_entity"],project:!0}}),MenuBar.addAction(s.createTextureSet,"file.export")});E.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});w.push(()=>{s.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(e){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=e}),Preview.selected.renderer.physicallyCorrectLights=e,Blockbench.showQuickMessage(`Physically corrected lighting is now ${e?"enabled":"disabled"}`,2e3),e&&s.togglePbr?.set(!0),S()},click(){}}),MenuBar.addAction(s.toggleCorrectLights,"preview")});E.push(()=>{MenuBar.removeAction("preview.correct_lights")});var H=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(e=>{e instanceof Cube&&Object.keys(e.faces).forEach(a=>{let r=e.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var K=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],Y=()=>Project&&Project.pbr_active&&S(),Ce=()=>{K.forEach(e=>{Blockbench.addListener(e,Y)})},Z=()=>{K.forEach(e=>{Blockbench.removeListener(e,Y)})};w.push(()=>{s.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(e){if(e){S(),Ce(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}H(),Z(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(s.togglePbr,"view")});E.push(()=>{Z(),MenuBar.removeAction("view.toggle_pbr")});var ee=e=>{let a=Math.max(-2,Math.min(2,Number(e)));Preview.all.forEach(t=>{t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};w.push(()=>{s.exposureSlider=new BarSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",step:.1,min:-2,max:2,onBefore(){Number(s.tonemappingSelect?.get())===b.NoToneMapping&&s.tonemappingSelect.change(b.LinearToneMapping.toString()),s.togglePbr?.set(!0)},onChange({value:e}){ee(e)},onAfter(){S()}}),s.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>s.exposureSlider!==void 0&&Number(s.exposureSlider?.get())!==1,click(){ee(1),s.exposureSlider?.set(1),S()}}),s.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:b.NoToneMapping,value:Preview.selected.renderer.toneMapping??b.NoToneMapping,icon:"monochrome_photos",options:{[b.NoToneMapping]:"No Tone Mapping",[b.LinearToneMapping]:"Linear",[b.ReinhardToneMapping]:"Reinhard",[b.CineonToneMapping]:"Cineon",[b.ACESFilmicToneMapping]:"ACES"},onChange({value:e}){let a=Number(s.exposureSlider?.get()??1);Preview.all.forEach(t=>{t.renderer.toneMapping=Number(e),t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMapping=Number(e),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(e)}`,2e3),s.togglePbr&&!s.togglePbr.value&&s.togglePbr.set(!0),S()}})});var Me=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},Pe=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};w.push(()=>{s.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let e=Project.selected_texture;if(!e)return;let t=new L(e.layers_enabled?e.layers:[e],e.uuid).createLabPbrOutput();if(t===null)return;let r=e.name??(Project?Project.getDisplayName():"texture");await Promise.all([Me(t.normalMap,pathToName(r)),Pe(t.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),s.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:()=>!!Project&&Project.selected_texture!==null,click(){let e=TextureLayer.selected?.texture??Texture.all.find(t=>t.selected)??Texture.getDefault(),a=new L(e.layers_enabled?e.layers:[e],e.uuid);if(e.name.endsWith("_n")||e.name.endsWith("_n.png")){a.createTexturesFromNormal(e);return}if(e.name.endsWith("_s")||e.name.endsWith("_s.png")){a.createTexturesFromSpecular(e);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(s.generateLabPbr,"file.export"),MenuBar.addAction(s.decodeLabPbr,"tools")});E.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});var U=class e{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(d).map(t=>[t,d[t].default??new b.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([t,r])=>[t,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let t=Math.min(1,Math.max(0,a));return new b.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let a="#000000",t=Number(s.brushMetalnessSlider?.get()),r=Number(s.brushRoughnessSlider?.get()??1),n=(s.brushEmissiveColor?.get()??a).toString(),o=Number(s.brushHeightSlider?.get()),l=ColorPanel.get(),i={[d.albedo.id]:new b.Color(l),[d.metalness.id]:e.makeLinearColor(t),[d.roughness.id]:e.makeLinearColor(r),[d.emissive.id]:new b.Color(n??a),[d.height.id]:e.makeLinearColor(o),[d.normal.id]:d.normal.default??new b.Color("#8080ff")};return new e({colors:i})}};var Te=e=>{let a=new b.WebGLRenderer({alpha:!0,antialias:!0}),t=new b.Scene,r=new b.PerspectiveCamera(75,96/96,.1,1e3),n=new b.AmbientLight(16777215,.75);t.add(n);let o=new b.PointLight(16777215,1,100);o.position.set(5,5,5),t.add(o);let l=new b.SphereGeometry(1,32,32),i=new b.MeshStandardMaterial({color:e.albedo,metalness:e.metalness??0,roughness:e.roughness??1,emissive:e.emissive,bumpScale:e.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),h=new b.Mesh(l,i);return t.add(h),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(t,r),a.domElement.toDataURL()},te="materialBrushPresets",F=()=>JSON.parse(localStorage.getItem(te)||"{}"),Ee=(e,a)=>{let t=F(),r=a??guid(),n=s.userMaterialBrushPresets?.getFormResult()??{},o={};return n.albedo&&(o.albedo=n.albedo.toString()),n.metalness&&(o.metalness=Number(n.metalness)),n.roughness&&(o.roughness=Number(n.roughness)),n.emissive&&(o.emissive=n.emissive.toString()),n.height&&(o.height=Number(n.height)),t[r]=[o,e??"New Preset",Te(o)],localStorage.setItem(te,JSON.stringify(t)),r},G=({metalness:e,roughness:a,emissive:t,height:r,albedo:n})=>{e!==void 0&&s.brushMetalnessSlider?.setValue(e||0,!0),a!==void 0&&s.brushRoughnessSlider?.setValue(a??1,!0),t!==void 0&&s.brushEmissiveColor?.set(t??"#000000"),r!==void 0&&s.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},je=J.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:d}},methods:{applyPreset(e){try{let[a,t]=this.userPresets[e],{metalness:r,roughness:n,emissive:o,height:l,albedo:i}=a;G({metalness:Number(r),roughness:Number(n),emissive:o.toString(),height:Number(l),albedo:i.toString()}),s.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${t}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(e){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let t=F(),r=this.userPresets[e][1]??e;delete t[e],localStorage.setItem("materialBrushPresets",JSON.stringify(t)),this.userPresets=t,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(e){s.userMaterialBrushPresets?.setFormValues({name:this.userPresets[e][1]??e,...this.userPresets[e][0]})},getSummary(e){return Object.entries(e).filter(([a])=>a in this.channels).map(([a,t])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${t}`:`${this.channels[a]?.label??a}: ${Number(t).toFixed(1)}`).join(` +`)}},computed:{presets(){return Object.entries(this.userPresets)}},mounted(){this.userPresets=F()},template:`
-
`});y.push(()=>{s.materialBrushStyles=Blockbench.addCSS(` +
`});w.push(()=>{s.materialBrushStyles=Blockbench.addCSS(` .preset_list { display: grid; grid-template-columns: repeat(auto-fill, 96px); @@ -103,97 +103,4 @@ .delete_preset:hover .material-icons { color: var(--color-accent); } - `),s.brushMetalnessSlider=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",settings:{min:0,max:1,step:.01,default:0},condition:()=>{if(!Project)return!1;let t=Project.selected_texture;return t?.layers_enabled?t.layers.find(({channel:a})=>a===m.metalness.id)!==void 0:!1}}),s.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",settings:{min:0,max:1,step:.01,default:1},condition:()=>{if(!Project)return!1;let t=Project.selected_texture;return t?.layers_enabled?t.layers.find(({channel:a})=>a===m.roughness.id)!==void 0:!1}}),s.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",condition:()=>{if(!Project)return!1;let t=Project.selected_texture;return t?.layers_enabled?t.layers.find(({channel:a})=>a===m.emissive.id)!==void 0:!1}}),s.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",settings:{min:0,max:1,step:.01,default:.5},condition:()=>{if(!Project)return!1;let t=Project.selected_texture;return t?.layers_enabled?t.layers.find(({channel:a})=>a===m.height.id)!==void 0:!1}}),s.materialBrushPresets=new BarSelect("brush_presets",{category:"paint",name:"Material Brush Presets",description:"Select a preset for the material brush",options:{matte:"Matte",gloss:"Gloss",metal:"Dull Metal",polished:"Polished Metal",glowing:"Glowing"},onChange({value:t}){F(t),s.materialBrushTool?.select(),S()}}),s.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",condition:()=>Modes.paint&&!!Project&&Project.selected_texture&&Project.selected_texture.layers_enabled,brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(t,a,e,r,{size:n,softness:o,texture:l}){let i=U.fromSettings(),g=Object.keys(i.colors),f=e;return l.layers.forEach(p=>{if(!p.visible||!g.includes(p.channel))return;let u=i.getChannel(p.channel);u&&(p.ctx.fillStyle=u.getStyle(),p.ctx.fillRect(n*t,n*a,n,n),p.selected&&(f={r:u.r*255,g:u.g*255,b:u.b*255,a:r*255}))}),f}},onCanvasClick(t){Painter.startPaintToolCanvas(t,t.event)},onSelect(){S()},click(){S()}}),s.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:()=>!!Project,click(){s.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:Le,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(t){F({metalness:Number(t.metalness??s.brushMetalnessSlider?.get()),roughness:Number(t.roughness??s.brushRoughnessSlider?.get()),emissive:(t.emissive??s.brushEmissiveColor?.get()).toString(),height:Number(t.height??s.brushHeightSlider?.get()),albedo:(t.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(t,a){t===1&&Blockbench.textPrompt("Save Preset","New Preset",e=>{e&&(je(e),Blockbench.showQuickMessage(`Preset "${e}" saved`,2e3))})}}).show()}}),MenuBar.addAction(s.materialBrushTool,"tools.0")});E.push(()=>{MenuBar.removeAction("tools.material_brush")});y.push(()=>{s.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Brush"}),new Toolbar("material_brush_presets_toolbar",{id:"material_brush_presets_toolbar",children:["load_brush_preset","brush_presets"],name:"Brush Presets",label:!0})],display_condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});y.push(()=>{s.displaySettingsPanel=new Panel("display_settings",{name:"PBR Display Settings",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});y.push(()=>{let t=I.extend({name:"ChannelsPanel",data(){return{channels:m}},methods:{openMenu(a){s.channelMenu?.open(a)},canShowChannel(a){return a.channel&&a.channel!==B},selectedTexture(){return(Texture.selected??TextureLayer.selected.texture)!==void 0}},computed:{textures:()=>Texture.selected&&Texture.selected.layers_enabled?Texture.selected.layers:Texture.all.map(a=>a.layers_enabled?a.layers:[a]).flat()},template:` -
-
    -
  • - -
    -
    -
    {{ texture.name }}
    -
    - {{ texture.texture.name }} -
    -
    -
    -
    {{ channels[texture.channel].label }}
    - {{ channels[texture.channel].icon }} -
    -
    -
  • -
-
`});s.channelsPanelStyle=Blockbench.addCSS(` - .texture_channel { - color: var(--color-text); - flex: 1; - font-size: 1em; - margin: 0 0 0 auto; - padding: 0 8px; - text-align: right; - } - - .texture_channel + .texture_particle_icon { - padding-right: 8px; - } - - .texture_channel_description { - background-color: var(--color-back); - display: flex; - flex-direction: row; - flex-wrap: nowrap; - justify-content: space-between; - } - - .texture_channel_wrapper { - align-items: center; - background-color: var(--color-ui); - border-left: 1px solid var(--color-border); - display: flex; - flex: 1; - flex-direction: row; - align-items: center; - flex-wrap: nowrap; - padding: 0 8px; - } - - .texture_channel_wrapper:hover { - background-color: var(--color-button); - } - - .texture_channel_description .texture_name { - flex-direction: column; - flex-wrap: nowrap; - color: var(--color-subtle_text); - display: flex; - flex: 1; - justify-content: center; - align-items: start; - } - - .texture_parent { - color: var(--color-subtle_text); - font-size: 0.8em; - } - - .texture_channel_description:hover .texture_channel { - color: var(--color-accent); - } - - #pbr_channel_list { - display: flex; - flex-direction: column; - } - - #pbr_channel_list .texture { - border-top: 1px solid var(--color-border); - padding-right: 0; - } - `),s.channelsPanel=new Panel("channels_panel",{name:"PBR Channels",id:"channels_panel",icon:"tv",display_condition:{modes:["paint","edit","animate"],project:!0},toolbars:[new Toolbar("channel_assignment_toolbar",{id:"channel_assignment_toolbar",children:["create_material_texture","show_channel_menu"],name:"PBR Channel Controls"})],component:t,expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:336,folded:!0},insert_after:"layers",insert_before:"color"})});(()=>{let t=()=>{y.forEach(e=>e())},a=()=>{E.forEach(e=>e()),Object.entries(s).forEach(([e,r])=>{try{r?.delete()}catch(n){console.error(`Failed to delete ${e} action:`,n)}})};BBPlugin.register("pbr_preview",{version:"1.1.0",title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.2",onload:t,onunload:a})})();})(); + `),s.brushMetalnessSlider=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",settings:{min:0,max:1,step:.01,default:0},condition:()=>{if(!Project)return!1;let e=Project.selected_texture;return e?.layers_enabled?e.layers.find(({channel:a})=>a===d.metalness.id)!==void 0:!1}}),s.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",settings:{min:0,max:1,step:.01,default:1},condition:()=>{if(!Project)return!1;let e=Project.selected_texture;return e?.layers_enabled?e.layers.find(({channel:a})=>a===d.roughness.id)!==void 0:!1}}),s.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",condition:()=>{if(!Project)return!1;let e=Project.selected_texture;return e?.layers_enabled?e.layers.find(({channel:a})=>a===d.emissive.id)!==void 0:!1}}),s.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",settings:{min:0,max:1,step:.01,default:.5},condition:()=>{if(!Project)return!1;let e=Project.selected_texture;return e?.layers_enabled?e.layers.find(({channel:a})=>a===d.height.id)!==void 0:!1}}),s.materialBrushPresets=new BarSelect("brush_presets",{category:"paint",name:"Material Brush Presets",description:"Select a preset for the material brush",options:{matte:"Matte",gloss:"Gloss",metal:"Dull Metal",polished:"Polished Metal",glowing:"Glowing"},onChange({value:e}){G(e),s.materialBrushTool?.select(),S()}}),s.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",condition:()=>Modes.paint&&!!Project&&Project.selected_texture&&Project.selected_texture.layers_enabled,brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(e,a,t,r,{size:n,softness:o,texture:l}){let i=U.fromSettings(),h=Object.keys(i.colors),p=t;return l.layers.forEach(f=>{if(!f.visible||!h.includes(f.channel))return;let u=i.getChannel(f.channel);u&&(f.ctx.fillStyle=u.getStyle(),f.ctx.fillRect(n*e,n*a,n,n),f.selected&&(p={r:u.r*255,g:u.g*255,b:u.b*255,a:r*255}))}),p}},onCanvasClick(e){Painter.startPaintToolCanvas(e,e.event)},onSelect(){S()},click(){S()}}),s.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:()=>!!Project,click(){s.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:je,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(e){G({metalness:Number(e.metalness??s.brushMetalnessSlider?.get()),roughness:Number(e.roughness??s.brushRoughnessSlider?.get()),emissive:(e.emissive??s.brushEmissiveColor?.get()).toString(),height:Number(e.height??s.brushHeightSlider?.get()),albedo:(e.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(e,a){e===1&&Blockbench.textPrompt("Save Preset","New Preset",t=>{t&&(Ee(t),Blockbench.showQuickMessage(`Preset "${t}" saved`,2e3))})}}).show()}}),MenuBar.addAction(s.materialBrushTool,"tools.0")});E.push(()=>{MenuBar.removeAction("tools.material_brush")});w.push(()=>{s.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Brush"}),new Toolbar("material_brush_presets_toolbar",{id:"material_brush_presets_toolbar",children:["load_brush_preset","brush_presets"],name:"Brush Presets",label:!0})],display_condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});w.push(()=>{s.displaySettingsPanel=new Panel("display_settings",{name:"PBR Display Settings",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});(()=>{let e=()=>{w.forEach(t=>t())},a=()=>{H(),E.forEach(t=>t()),Object.entries(s).forEach(([t,r])=>{try{r?.delete()}catch(n){console.warn(`Failed to delete ${t} action:`,n)}})};BBPlugin.register("pbr_preview",{version:"1.1.0",title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.2",onload:e,onunload:a})})();})(); diff --git a/src/pbr_preview/.prettierrc b/src/pbr_preview/.prettierrc new file mode 100644 index 00000000..e66b3328 --- /dev/null +++ b/src/pbr_preview/.prettierrc @@ -0,0 +1,12 @@ +{ + "semi": true, + "trailingComma": "es5", + "singleQuote": false, + "printWidth": 80, + "tabWidth": 2, + "vueIndentScriptAndStyle": true, + "bracketSameLine": false, + "arrowParens": "always", + "endOfLine": "lf", + "quoteProps": "as-needed" +} \ No newline at end of file diff --git a/src/pbr_preview/package.json b/src/pbr_preview/package.json index c2fb703e..ce68a85c 100644 --- a/src/pbr_preview/package.json +++ b/src/pbr_preview/package.json @@ -5,10 +5,7 @@ "main": "./src/index.ts", "scripts": { "build": "esbuild src/index.ts --bundle --minify --outfile=../../plugins/pbr_preview/pbr_preview.js", - "test": "echo \"Error: no test specified\" && exit 1", - "dev": "esbuild src/index.ts --bundle --sourcemap --outfile=../../plugins/pbr_preview/pbr_preview.js --watch", - "format": "prettier --write src/**/*.ts ./*.mjs", - "dist": "npm run format && npm run build" + "dev": "esbuild src/index.ts --bundle --sourcemap --outfile=../../plugins/pbr_preview/pbr_preview.js --watch" }, "keywords": [ "blockbench" diff --git a/src/pbr_preview/src/index.ts b/src/pbr_preview/src/index.ts index e676925f..c2f011af 100644 --- a/src/pbr_preview/src/index.ts +++ b/src/pbr_preview/src/index.ts @@ -12,6 +12,7 @@ import "./lib/properties"; import "./lib/actions"; import "./lib/tools"; import "./lib/panels"; +import { disablePbr } from "./lib/disablePbr"; (() => { const onload = () => { @@ -19,12 +20,13 @@ import "./lib/panels"; }; const onunload = () => { + disablePbr(); teardowns.forEach((teardown) => teardown()); Object.entries(registry).forEach(([key, value]) => { try { value?.delete(); } catch (err) { - console.error(`Failed to delete ${key} action:`, err); + console.warn(`Failed to delete ${key} action:`, err); } }); }; diff --git a/src/pbr_preview/src/lib/PbrMaterials.ts b/src/pbr_preview/src/lib/PbrMaterials.ts index 7fefaf6e..3f46d015 100644 --- a/src/pbr_preview/src/lib/PbrMaterials.ts +++ b/src/pbr_preview/src/lib/PbrMaterials.ts @@ -27,7 +27,7 @@ export default class PbrMaterial { constructor( scope: Array | null, - materialUuid: string, + materialUuid: string ) { this._scope = scope ?? getProjectTextures(); this._materialUuid = materialUuid; @@ -72,7 +72,7 @@ export default class PbrMaterial { PbrMaterial.makePixelatedCanvas( TextureLayer.selected?.canvas ?? Texture.all.find((t) => t.selected)?.canvas ?? - Texture.getDefault().canvas, + Texture.getDefault().canvas ), aoMap: this.getTexture(CHANNELS.ao), bumpMap: this.getTexture(CHANNELS.height), @@ -87,7 +87,8 @@ export default class PbrMaterial { emissive: emissiveMap ? 0xffffff : 0, envMap: PreviewScene.active?.cubemap ?? null, envMapIntensity: 0.95, - alphaTest: 0.5, + alphaTest: 0.1, + transparent: true, ...options, }); } @@ -117,14 +118,14 @@ export default class PbrMaterial { */ findTexture( name: string | IChannel, - inference = true, + inference = true ): Texture | TextureLayer | null { if (!Project) { return null; } const materialChannel = this._scope.find( - (t) => t.channel && (t.channel === name || t.channel === name.id), + (t) => t.channel && (t.channel === name || t.channel === name.id) ); if (materialChannel) { @@ -163,7 +164,7 @@ export default class PbrMaterial { undefined, undefined, THREE.NearestFilter, - THREE.NearestFilter, + THREE.NearestFilter ); texture.needsUpdate = true; @@ -183,7 +184,7 @@ export default class PbrMaterial { static extractChannel( texture: Texture | TextureLayer, - channel: "r" | "g" | "b" | "a", + channel: "r" | "g" | "b" | "a" ) { const canvas = texture.canvas; const width = canvas.width; @@ -279,17 +280,17 @@ export default class PbrMaterial { 0, 0, emissive.width, - emissive.height, + emissive.height ); const emissiveLevelData = emissiveLevelCtx.getImageData( 0, 0, emissive.width, - emissive.height, + emissive.height ); const emissiveData = new Uint8ClampedArray( - emissive.width * emissive.height * 4, + emissive.width * emissive.height * 4 ); for (let idx = 0; idx < albedoData.data.length; idx += 4) { @@ -310,7 +311,7 @@ export default class PbrMaterial { emissiveCtx.putImageData( new ImageData(emissiveData, emissive.width, emissive.height), 0, - 0, + 0 ); return { @@ -333,7 +334,7 @@ export default class PbrMaterial { emissive?.img.width ?? 0, roughness?.img.width ?? 0, Project ? Project.texture_width : 0, - 16, + 16 ); const height = Math.max( @@ -341,7 +342,7 @@ export default class PbrMaterial { emissive?.img.height ?? 0, roughness?.img.height ?? 0, Project ? Project.texture_height : 0, - 16, + 16 ); const canvas = document.createElement("canvas"); @@ -380,7 +381,7 @@ export default class PbrMaterial { new ImageData( new Uint8ClampedArray(width * height * 4).fill(255), width, - height, + height ); const data = new Uint8ClampedArray(width * height * 4); @@ -412,7 +413,7 @@ export default class PbrMaterial { emissive?.img.width ?? 0, roughness?.img.width ?? 0, Project ? Project.texture_width : 0, - 16, + 16 ); const height = Math.max( @@ -420,7 +421,7 @@ export default class PbrMaterial { emissive?.img.height ?? 0, roughness?.img.height ?? 0, Project ? Project.texture_height : 0, - 16, + 16 ); const specularCanvas = document.createElement("canvas"); @@ -474,7 +475,7 @@ export default class PbrMaterial { // Convert metalness to F0 const f0 = Math.min( 229, - Math.max(0, Math.round((metalnessData?.data[idx] ?? smoothness) * 229)), + Math.max(0, Math.round((metalnessData?.data[idx] ?? smoothness) * 229)) ); const porosity = porosityData?.data[idx]; @@ -498,7 +499,7 @@ export default class PbrMaterial { (emissiveData?.data[idx] + emissiveData?.data[idx + 1] + emissiveData?.data[idx + 2]) / - 3, + 3 ); specularData[idx + 3] = emissiveLevel || 255; @@ -602,7 +603,7 @@ export default class PbrMaterial { heightmapCtx.putImageData( new ImageData(heightmapData, width, height), 0, - 0, + 0 ); return { @@ -723,7 +724,7 @@ export default class PbrMaterial { metalnessCtx.putImageData( new ImageData(metalnessData, width, height), 0, - 0, + 0 ); emissiveCtx.putImageData(new ImageData(emissiveData, width, height), 0, 0); @@ -731,7 +732,7 @@ export default class PbrMaterial { roughnessCtx.putImageData( new ImageData(roughnessData, width, height), 0, - 0, + 0 ); sssCtx.putImageData(new ImageData(sssData, width, height), 0, 0); @@ -794,7 +795,7 @@ export default class PbrMaterial { */ createNormalMap( texture: Texture | TextureLayer, - heightInAlpha = false, + heightInAlpha = false ): Texture | TextureLayer | null { const textureCtx = texture.canvas.getContext("2d"); @@ -805,12 +806,12 @@ export default class PbrMaterial { const width = Math.max( texture.img.width ?? texture.canvas.width, Project ? Project.texture_width : 0, - 16, + 16 ); const height = Math.max( texture.img.height ?? texture.canvas.height, Project ? Project.texture_height : 0, - 16, + 16 ); const { data: textureData } = textureCtx.getImageData(0, 0, width, height); @@ -874,7 +875,7 @@ export default class PbrMaterial { data_url: dataUrl, visible: true, }, - texture.texture, + texture.texture ); normalMapLayer.addForEditing(); diff --git a/src/pbr_preview/src/lib/actions/channelAssignment.ts b/src/pbr_preview/src/lib/actions/channelAssignment.ts index acb89f54..7e53b713 100644 --- a/src/pbr_preview/src/lib/actions/channelAssignment.ts +++ b/src/pbr_preview/src/lib/actions/channelAssignment.ts @@ -10,22 +10,18 @@ import { applyPbrMaterial } from "../applyPbrMaterial"; const channelActions: Record = {}; -const isPaintableTexture = Condition(() => { - return ( - // @ts-expect-error Paint mode exists - Modes.paint && - (TextureLayer.selected || (Project && Project.selected_texture !== null)) - ); -}); - -export function setup() { +setups.push(() => { Object.entries(CHANNELS).forEach(([key, channel]) => { channelActions[key] = new Action(`assign_channel_${key}`, { icon: channel.icon ?? "tv_options_edit_channels", name: `Assign to ${channel.label.toLocaleLowerCase()} channel`, description: `Assign the selected layer to the ${channel.label} channel`, category: "textures", - condition: isPaintableTexture, + condition: { + selected: { + texture: true, + }, + }, click(e) { const layer = TextureLayer.selected ?? (Project ? Project.selected_texture : null); @@ -53,32 +49,34 @@ export function setup() { delete Project.pbr_materials[texture.uuid][assignedChannel]; layer.channel = NA_CHANNEL; } - }, + } ); + // If the layer uuid is equal to the texture uuid, the texture can not be assigned to any other channels + if (texture.uuid === layer.uuid) { + Project.pbr_materials[texture.uuid] = {}; + } + Project.pbr_materials[texture.uuid][key] = layer.uuid; Undo.finishEdit("Change channel assignment"); Blockbench.showQuickMessage( `Assigned "${layer.name}" to ${channel.label} channel`, - 2000, + 2000 ); applyPbrMaterial(); }, }); }); -} +}); -export function teardown() { +teardowns.push(() => { Object.entries(channelActions).forEach(([key, action]) => { - action.delete(); + action?.delete(); }); -} - -setups.push(setup); -teardowns.push(teardown); +}); setups.push(() => { registry.unassignChannel = new Action("unassign_channel", { @@ -86,28 +84,20 @@ setups.push(() => { name: "Unassign Channel", description: "Unassign the selected layer from the channel", category: "textures", - condition: () => { - // @ts-expect-error Paint mode exists - if (!Modes.paint) { - return false; - } - - if (TextureLayer.selected) { - return ( - TextureLayer.selected.channel !== NA_CHANNEL || - !TextureLayer.selected.channel - ); - } - - if (!Project) { - return false; - } + condition: { + selected: { + texture: true, + }, + method() { + const layer = + TextureLayer.selected ?? (Project ? Project.selected_texture : null); - const texture = Project.selected_texture; + if (!layer || !Project) { + return false; + } - return ( - texture !== null && texture.channel !== NA_CHANNEL && texture.channel - ); + return layer.channel && layer.channel !== NA_CHANNEL; + }, }, click() { const layer = @@ -131,7 +121,7 @@ setups.push(() => { Blockbench.showQuickMessage( `Unassigned "${layer.name}" from ${prevChannel} channel`, - 2000, + 2000 ); applyPbrMaterial(); @@ -148,7 +138,7 @@ setups.push(() => { onOpen() { applyPbrMaterial(); }, - }, + } ); registry.openChannelMenu = new Action("pbr_channel_menu", { @@ -165,7 +155,12 @@ setups.push(() => { name: "Assign to PBR Channel", description: "Assign the selected layer to a channel", category: "textures", - condition: isPaintableTexture, + condition: { + modes: ["paint"], + selected: { + texture: true, + }, + }, click(event) { registry.channelMenu?.open(event as MouseEvent); }, @@ -175,9 +170,16 @@ setups.push(() => { setups.push(() => { if (registry.openChannelMenu) { MenuBar.addAction(registry.openChannelMenu, "image.0"); + Texture.prototype.menu.addAction(registry.openChannelMenu, "0"); + TextureLayer.prototype.menu.addAction(registry.openChannelMenu, "0"); } + + Toolbars.layers.add(registry.showChannelMenu, 1); }); teardowns.push(() => { MenuBar.removeAction("image.pbr_channel_menu"); + Texture.prototype.menu.removeAction("pbr_channel_menu"); + TextureLayer.prototype.menu.removeAction("pbr_channel_menu"); + Toolbars.layers.remove(registry.showChannelMenu); }); diff --git a/src/pbr_preview/src/lib/actions/materialTexture.ts b/src/pbr_preview/src/lib/actions/materialTexture.ts index 6a1b20be..a7922b62 100644 --- a/src/pbr_preview/src/lib/actions/materialTexture.ts +++ b/src/pbr_preview/src/lib/actions/materialTexture.ts @@ -1,5 +1,6 @@ import { registry, CHANNELS, setups, teardowns } from "../../constants"; import { three as THREE } from "../../deps"; +import PbrMaterial from "../PbrMaterials"; const colorDataUrl = (color: THREE.Color, src?: HTMLCanvasElement) => { const canvas = src ?? document.createElement("canvas"); @@ -31,6 +32,10 @@ setups.push(() => { return; } + const channels = { + ...CHANNELS, + }; + const texture = new Texture({ name: "New Material", saved: false, @@ -39,48 +44,90 @@ setups.push(() => { layers_enabled: true, }); - const filler = colorDataUrl(new THREE.Color(0x808080)); + const scope = + Texture.all.filter((t) => t.selected || t.multi_selected) ?? + Texture.all; - if (!filler) { - return; - } + const mat = Texture.selected + ? new PbrMaterial(scope, Texture.selected.uuid) + : null; - texture.fromDataURL(filler).add().select(); + try { + const baseColor = + mat?.findTexture(CHANNELS.albedo, true)?.canvas.toDataURL() ?? + Texture.selected?.canvas.toDataURL() ?? + colorDataUrl(new THREE.Color(0x808080), texture.canvas); - // Create PBR channels as texture layers for the new texture - Object.keys(CHANNELS).forEach((key) => { - const channel = CHANNELS[key]; + if (!baseColor) { + return; + } + + texture.fromDataURL(baseColor); const layer = new TextureLayer( { - name: channel.label, + name: channels.albedo.label, visible: true, + data_url: baseColor, }, - texture, + texture ); - layer.setSize( - Project.texture_width ?? texture.width, - Project.texture_height ?? texture.height, - ); + layer.extend({ channel: channels.albedo.id }); - const data = colorDataUrl( - channel.default ?? new THREE.Color(0), - layer.canvas, + layer.addForEditing(); + layer.texture.updateChangesAfterEdit(); + + delete channels.albedo; + } catch (e) { + console.warn("Failed to create base color texture", e); + Blockbench.showStatusMessage( + "Failed to create base color texture in new material", + 3000 ); + } - if (data) { - layer.texture.fromDataURL(data); - } + // Create PBR channels as texture layers for the new texture + const layers = Object.keys(channels) + .map((key) => { + const channel = CHANNELS[key]; + const channelTexture = mat?.findTexture(channel, true); - layer.extend({ channel: channel.id }); + const data = channelTexture + ? channelTexture.canvas.toDataURL() + : colorDataUrl(channel.default ?? new THREE.Color(0)); - layer.addForEditing(); - }); + if (!data) { + return; + } + + const layer = new TextureLayer( + { + name: channel.label, + visible: true, + data_url: data, + }, + texture + ); + + layer.extend({ channel: channel.id }); + + return layer; + }) + .filter(Boolean) as TextureLayer[]; + + Undo.initEdit({ textures: Texture.all, layers }); + + texture.add().select(); + layers.map((layer) => layer.addForEditing()); + texture.updateChangesAfterEdit(); + + Undo.finishEdit("Create Material Texture"); }, }); MenuBar.addAction(registry.createMaterialTexture, "tools"); + Toolbars.texturelist.add(registry.createMaterialTexture, 3); }); teardowns.push(() => { diff --git a/src/pbr_preview/src/lib/actions/mer.ts b/src/pbr_preview/src/lib/actions/mer.ts index 68268377..9e9c13e0 100644 --- a/src/pbr_preview/src/lib/actions/mer.ts +++ b/src/pbr_preview/src/lib/actions/mer.ts @@ -13,7 +13,12 @@ export function setup() { project: true, }, click() { - exportMer(); + try { + exportMer(); + } catch (err) { + console.error("Failed to export MER map:", err); + Blockbench.showStatusMessage("Failed to export MER map", 3000); + } }, }); diff --git a/src/pbr_preview/src/lib/actions/textureSet.ts b/src/pbr_preview/src/lib/actions/textureSet.ts index 886b78ba..3d407bd0 100644 --- a/src/pbr_preview/src/lib/actions/textureSet.ts +++ b/src/pbr_preview/src/lib/actions/textureSet.ts @@ -1,6 +1,7 @@ import { CHANNELS, registry, setups, teardowns } from "../../constants"; import { exportMer } from "../mer"; import PbrMaterial from "../PbrMaterials"; +import { getOutputBaseName } from "../util"; const createTextureSetDialog = () => { if (!Project) { @@ -14,12 +15,12 @@ const createTextureSetDialog = () => { const projectColorMap = mat.findTexture(CHANNELS.albedo, false); const projectMetalnessMap = mat.findTexture( CHANNELS.metalness, - false, + false )?.name; const projectEmissiveMap = mat.findTexture(CHANNELS.emissive, false)?.name; const projectRoughnessMap = mat.findTexture( CHANNELS.roughness, - false, + false )?.name; const form: DialogOptions["form"] = {}; @@ -94,11 +95,9 @@ const createTextureSetDialog = () => { title: "Create Texture Set JSON", buttons: ["Create", "Cancel"], form, + cancelIndex: 1, onConfirm(formResult: Record) { - const baseName = - Project.model_identifier.length > 0 - ? Project.model_identifier - : Project.getDisplayName(); + const baseName = getOutputBaseName(); const hasMer = projectMetalnessMap || projectEmissiveMap || projectRoughnessMap; @@ -169,7 +168,7 @@ const createTextureSetDialog = () => { useNormalMap ? "normal" : "heightmap" ] = pathToName(filePath, false); cb(); - }, + } ); }; @@ -190,10 +189,10 @@ const createTextureSetDialog = () => { (filePath) => { textureSet["minecraft:texture_set"].color = pathToName( filePath, - false, + false ); cb(); - }, + } ); }; @@ -213,23 +212,27 @@ const createTextureSetDialog = () => { () => { Blockbench.showQuickMessage("Texture set created", 2000); registry.textureSetDialog?.hide(); - }, + } ); }); }); if (hasMer) { - exportMer(baseName, (filePath) => { - textureSet["minecraft:texture_set"].metalness_emissive_roughness = - pathToName(filePath, false); - exportTextureSet(); - }); + try { + exportMer(baseName, (filePath) => { + textureSet["minecraft:texture_set"].metalness_emissive_roughness = + pathToName(filePath, false); + exportTextureSet(); + }); + } catch (err) { + console.warn("Failed to export MER map:", err); + Blockbench.showStatusMessage("Failed to export MER map", 3000); + } return; } exportTextureSet(); }, - cancelIndex: 1, }); return registry.textureSetDialog.show(); diff --git a/src/pbr_preview/src/lib/applyPbrMaterial.ts b/src/pbr_preview/src/lib/applyPbrMaterial.ts index 760f224a..486edad9 100644 --- a/src/pbr_preview/src/lib/applyPbrMaterial.ts +++ b/src/pbr_preview/src/lib/applyPbrMaterial.ts @@ -46,6 +46,8 @@ export const applyPbrMaterial = ( texture.uuid, ).getMaterial(materialParams); + material.side = Canvas.getRenderSide(texture) as THREE.Side; + Project.materials[texture.uuid] = THREE.ShaderMaterial.prototype.copy.call(material, projectMaterial); diff --git a/src/pbr_preview/src/lib/mer.ts b/src/pbr_preview/src/lib/mer.ts index 1a31867f..a1d225e6 100644 --- a/src/pbr_preview/src/lib/mer.ts +++ b/src/pbr_preview/src/lib/mer.ts @@ -1,4 +1,5 @@ import PbrMaterial from "./PbrMaterials"; +import { getSelectedTexture } from "./util"; /** * ### Export MER map @@ -10,13 +11,7 @@ export const exportMer = ( baseName?: string, cb?: (filePath: string) => void, ) => { - const selected = Project - ? Project.selected_texture - : Texture.all.find((t) => t.selected); - - if (!selected) { - return; - } + const selected = getSelectedTexture(); const mer = new PbrMaterial( selected.layers_enabled @@ -28,12 +23,12 @@ export const exportMer = ( ).createMer(true); if (!mer) { - return; + throw new Error("Failed to generate MER map from selected texture."); } mer.toBlob(async (blob) => { if (!blob) { - return; + throw new Error("Failed to save MER map."); } const [name, startpath] = Project diff --git a/src/pbr_preview/src/lib/panels/channels.ts b/src/pbr_preview/src/lib/panels/channels.ts index 0a3e9c6d..26ffae22 100644 --- a/src/pbr_preview/src/lib/panels/channels.ts +++ b/src/pbr_preview/src/lib/panels/channels.ts @@ -1,68 +1,8 @@ +import type { IChannel } from "../../types"; import { registry, setups, CHANNELS, NA_CHANNEL } from "../../constants"; -import { vue as Vue } from "../../deps"; +import { getSelectedLayer, getSelectedTexture } from "../util"; setups.push(() => { - const component = Vue.extend({ - name: "ChannelsPanel", - data() { - return { - channels: CHANNELS, - }; - }, - methods: { - openMenu(event: MouseEvent) { - registry.channelMenu?.open(event); - }, - canShowChannel(texture: Texture | TextureLayer) { - return texture.channel && texture.channel !== NA_CHANNEL; - }, - selectedTexture() { - return ( - (Texture.selected ?? TextureLayer.selected.texture) !== undefined - ); - }, - }, - computed: { - textures: () => { - if (Texture.selected && Texture.selected.layers_enabled) { - return Texture.selected.layers; - } - - return Texture.all - .map((t) => (t.layers_enabled ? t.layers : [t])) - .flat(); - }, - }, - template: /* html */ ` -
-
    -
  • - -
    -
    -
    {{ texture.name }}
    -
    - {{ texture.texture.name }} -
    -
    -
    -
    {{ channels[texture.channel].label }}
    - {{ channels[texture.channel].icon }} -
    -
    -
  • -
-
`, - }); - registry.channelsPanelStyle = Blockbench.addCSS(/* css */ ` .texture_channel { color: var(--color-text); @@ -134,10 +74,15 @@ setups.push(() => { registry.channelsPanel = new Panel("channels_panel", { name: "PBR Channels", id: "channels_panel", - icon: "tv", + icon: "gallery_thumbnail", display_condition: { - modes: ["paint", "edit", "animate"], + modes: ["paint", "edit"], + }, + condition: { project: true, + selected: { + texture: true, + }, }, toolbars: [ new Toolbar("channel_assignment_toolbar", { @@ -146,9 +91,96 @@ setups.push(() => { name: "PBR Channel Controls", }), ], - component, + component: { + name: "ChannelsPanel", + data(): { + channels: Record; + } { + return { + channels: CHANNELS, + }; + }, + methods: { + openMenu(event: MouseEvent) { + registry.channelMenu?.open(event); + }, + selectTexture(texture: Texture | TextureLayer) { + Modes.options.paint.select(); + texture.select(); + texture.scrollTo(); + }, + channelEnabled(texture: Texture) { + return ( + texture.channel && + texture.channel !== NA_CHANNEL && + texture.channel in this.channels + ); + }, + getImgSrc(texture: Texture | TextureLayer) { + return ( + texture.img?.src ?? + `data:image/png;base64,${texture.canvas.toDataURL()}` + ); + }, + }, + computed: { + textures() { + const filterLayers = (layer: Texture | TextureLayer) => + layer.visible && layer.channel && layer.channel !== NA_CHANNEL; + + const selectedLayer = getSelectedLayer(); + + if (selectedLayer) { + return selectedLayer.texture.layers.filter(filterLayers); + } + + const selectedTexture = getSelectedTexture(); + + if (!selectedTexture) { + return []; + } + + return selectedTexture.layers_enabled + ? selectedTexture.layers.filter(filterLayers) + : Texture.all + .map((t) => + t.layers_enabled + ? [...t.layers.filter(filterLayers)] + : [filterLayers(t) ? t : null] + ) + .flat() + .filter(Boolean); + }, + }, + template: /* html */ ` +
+
    +
  • + +
    +
    +
    {{ texture.name }}
    +
    + {{ texture.texture.name }} +
    +
    +
    +
    {{ channels[texture.channel].label }}
    + {{ channels[texture.channel].icon }} +
    +
    +
  • +
+
`, + }, expand_button: true, - growable: false, + growable: true, onFold() {}, onResize() {}, default_side: "left", @@ -156,7 +188,7 @@ setups.push(() => { slot: "left_bar", float_position: [0, 0], float_size: [400, 300], - height: 336, + height: 350, folded: true, }, insert_after: "layers", diff --git a/src/pbr_preview/src/lib/panels/index.ts b/src/pbr_preview/src/lib/panels/index.ts index d490932a..205f666b 100644 --- a/src/pbr_preview/src/lib/panels/index.ts +++ b/src/pbr_preview/src/lib/panels/index.ts @@ -1,3 +1,5 @@ import "./materialBrush"; import "./pbrSettings"; -import "./channels"; +// FIXME: Channels panel is not behaving as expected +// @see https://discord.com/channels/314078526104141834/1247941848979214406 +// import "./channels"; diff --git a/src/pbr_preview/src/lib/tools/materialBrush.ts b/src/pbr_preview/src/lib/tools/materialBrush.ts index 0a08971a..91198ff1 100644 --- a/src/pbr_preview/src/lib/tools/materialBrush.ts +++ b/src/pbr_preview/src/lib/tools/materialBrush.ts @@ -114,7 +114,7 @@ const applyPreset = ({ if (height !== undefined) { registry.brushHeightSlider?.setValue( Math.max(0, Math.min(1, height ?? 0.5)), - true, + true ); } @@ -129,7 +129,6 @@ const userPresetsDialogComponent = Vue.extend({ data(): { userPresets: Record, string]>; channels: typeof CHANNELS; - isEditing: boolean; } { return { userPresets: {}, @@ -177,17 +176,17 @@ const userPresetsDialogComponent = Vue.extend({ localStorage.setItem( "materialBrushPresets", - JSON.stringify(presets), + JSON.stringify(presets) ); this.userPresets = presets; Blockbench.showQuickMessage( `Preset "${friendlyName}" deleted`, - 2000, + 2000 ); } - }, + } ); }, editPreset(preset: string) { @@ -351,7 +350,7 @@ setups.push(() => { return ( texture.layers.find( // @ts-expect-error Channel property is an extension of TextureLayer - ({ channel }) => channel === CHANNELS.metalness.id, + ({ channel }) => channel === CHANNELS.metalness.id ) !== undefined ); }, @@ -381,7 +380,7 @@ setups.push(() => { return ( texture.layers.find( // @ts-expect-error Channel property is an extension of TextureLayer - ({ channel }) => channel === CHANNELS.roughness.id, + ({ channel }) => channel === CHANNELS.roughness.id ) !== undefined ); }, @@ -406,7 +405,7 @@ setups.push(() => { return ( texture.layers.find( // @ts-expect-error Channel property is an extension of TextureLayer - ({ channel }) => channel === CHANNELS.emissive.id, + ({ channel }) => channel === CHANNELS.emissive.id ) !== undefined ); }, @@ -582,16 +581,16 @@ setups.push(() => { onConfirm(formResult) { applyPreset({ metalness: Number( - formResult.metalness ?? registry.brushMetalnessSlider?.get(), + formResult.metalness ?? registry.brushMetalnessSlider?.get() ), roughness: Number( - formResult.roughness ?? registry.brushRoughnessSlider?.get(), + formResult.roughness ?? registry.brushRoughnessSlider?.get() ), emissive: ( formResult.emissive ?? registry.brushEmissiveColor?.get() ).toString(), height: Number( - formResult.height ?? registry.brushHeightSlider?.get(), + formResult.height ?? registry.brushHeightSlider?.get() ), albedo: (formResult.albedo ?? ColorPanel.get()).toString(), }); diff --git a/src/pbr_preview/src/lib/util.ts b/src/pbr_preview/src/lib/util.ts new file mode 100644 index 00000000..21ce4dd8 --- /dev/null +++ b/src/pbr_preview/src/lib/util.ts @@ -0,0 +1,77 @@ +export function getSelectedTexture(): Texture | null { + if (Texture.selected) { + return Texture.selected; + } + + if (TextureLayer.selected) { + return TextureLayer.selected.texture; + } + + if (!Project) { + return Texture.all.find((t) => t.selected) ?? Texture.getDefault(); + } + + if (Project.selected_texture) { + return Project.selected_texture; + } + + return Project.textures.find((t) => t.selected) ?? null; // Texture.getDefault(); +} + +export function getSelectedLayer(): TextureLayer | null { + if (TextureLayer.selected) { + return TextureLayer.selected; + } + + if (Texture.selected?.selected_layer) { + return Texture.selected.selected_layer; + } + + if ( + Project.selected_texture !== null && + Project.selected_texture?.layers_enabled === true + ) { + return ( + Project.selected_texture.layers.find((l: TextureLayer) => l.selected) ?? + Project.selected_texture.layers[0] + ); + } + + return getSelectedTexture()?.getActiveLayer() ?? null; +} + +export function getOutputBaseName() { + if (!Project) { + return pathToName(getSelectedTexture()?.name ?? "texture"); + } + + return Project.model_identifier.length > 0 + ? Project.model_identifier + : Project.getDisplayName(); +} + +export function getMaterialsFromProject() { + const materials: Record = {}; + Project.elements.forEach((item) => { + if (!(item instanceof Cube)) { + return; + } + + Object.keys(item.faces).forEach((key) => { + const face = item.faces[key]; + const texture = face.getTexture(); + + if (!texture) { + return; + } + + const projectMaterial = Project.materials[texture.uuid]; + + if (projectMaterial.isMeshStandardMaterial) { + materials[texture.uuid] = projectMaterial; + } + }); + }); + + return materials; +} From d0babc8237d72449e60521b64774eb34b71b13a3 Mon Sep 17 00:00:00 2001 From: Jason Date: Mon, 10 Jun 2024 12:30:15 -0500 Subject: [PATCH 17/50] upd: Docs / Interface clean-up / AO generation (#5) * feat: Channel select menu - Added Action menu to select the assigned channels in place of buggy channels panel component * feat: Generate AO * upd: Add debounce function * upd: Change exposure slider - Changed exposure settings to number input * chore: Update types * fix: Add brush controls * upd: labPBR Action condition * fix: Texture set condition - Fix formats value * upd: MER Action conditions * chore: Add build:watch script * chore: Rearrange material brush panel * upd: Remove material brush primitives * upd: Optimize listener function * upd: Skip disabled faces - Only apply PBR when face is enabled * chore: Commit build output * upd: AO generation height source * upd: Docs and plugin registration --- plugins.json | 18 ++ plugins/pbr_preview/about.md | 164 +++++++++++++---- plugins/pbr_preview/changelog.json | 21 +++ plugins/pbr_preview/pbr_preview.js | 8 +- src/pbr_preview/package.json | 1 + src/pbr_preview/src/deps.ts | 4 +- src/pbr_preview/src/index.ts | 9 +- src/pbr_preview/src/lib/PbrMaterials.ts | 97 ++++++++++ .../src/lib/actions/channelAssignment.ts | 96 +++++++++- .../src/lib/actions/generateNormal.ts | 63 ++++++- src/pbr_preview/src/lib/actions/labPbr.ts | 20 ++- .../src/lib/actions/materialTexture.ts | 4 + src/pbr_preview/src/lib/actions/mer.ts | 170 ++++++++++++------ src/pbr_preview/src/lib/actions/textureSet.ts | 2 +- .../src/lib/actions/toggleLights.ts | 4 +- src/pbr_preview/src/lib/actions/togglePbr.ts | 6 +- .../src/lib/actions/tonemapping.ts | 44 +++-- src/pbr_preview/src/lib/applyPbrMaterial.ts | 6 +- .../src/lib/panels/materialBrush.ts | 16 +- src/pbr_preview/src/lib/panels/pbrSettings.ts | 3 +- .../src/lib/tools/materialBrush.ts | 18 -- src/pbr_preview/src/lib/util.ts | 12 ++ src/pbr_preview/src/types.d.ts | 3 +- 23 files changed, 615 insertions(+), 174 deletions(-) diff --git a/plugins.json b/plugins.json index 59cc4015..193e8401 100644 --- a/plugins.json +++ b/plugins.json @@ -918,5 +918,23 @@ "creation_date": "2024-04-19", "new_repository_format": true, "has_changelog": true + }, + "pbr_preview": { + "title": "PBR Tools", + "author": "Jason J. Gardner", + "await_loading": true, + "creation_date": "2024-06-10", + "icon": "icon.png", + "description": "Create and view PBR materials in Blockbench. Export textures for Java and RenderDragon shaders.", + "has_changelog": true, + "website": "https://github.com/jasonjgardner/blockbench-plugins/", + "variant": "both", + "version": "1.1.0", + "tags": [ + "Minecraft: Java Edition", + "Minecraft: Bedrock Edition", + "PBR" + ], + "min_version": "4.10.3" } } diff --git a/plugins/pbr_preview/about.md b/plugins/pbr_preview/about.md index ec827473..278cd2e1 100644 --- a/plugins/pbr_preview/about.md +++ b/plugins/pbr_preview/about.md @@ -1,44 +1,90 @@ -__Create textures for Bedrock shaders with PBR support (Deferred Rendering / RTX)__ +**Create and view PBR textures in Blockbench. Exports in formats for labPBR +(Java) and RenderDragon (Bedrock) shaders.** -## Features +> **_PBR:_ Physically based rendering**\ +> Read the +> _[Intoduction to Physically Based Rendering](https://learn.microsoft.com/en-us/minecraft/creator/documents/rtxpbrintro?view=minecraft-bedrock-stable "View Minecraft Creator documentation article.")_ +> article in the Minecraft Creator documentation if you are not already familiar +> with creating PBR content for Bedrock Edition. Visit the +> [shaderLABS wiki](https://shaderlabs.org/wiki/Main_Page) for more information +> on the labPBR material standard. + +## Blockbench PBR Plugin Features ### PBR Material Preview + - Preview PBR textures in Edit, Paint, and Animate mode. -- Infers texture channels based on naming conventions when no channel has been explicitly defined. Intended for previewing imported Bedrock PBR textures. +- Infers texture channels based on naming conventions when no channel has been + explicitly defined. Intended for previewing imported existing Bedrock and Java + PBR textures. +- Uses Blockbench's preview scenes as model environment map. +- PBR materials are updated with every edit to provide a live painting preview + of the material in Blockbench. -> _PBR:_ Physically based rendering +### MER Maps -#### Auto-Updated Preview -- PBR materials are updated with every edit to provide a live painting preview of the material in Blockbench. +> _MER:_ Metallic, emissive, and roughness maps assigned to red, green, and blue +> channels respectively. It is the format used in Bedrock texture sets. -### MER Maps -> _MER:_ Metallic, emissive, and roughness maps assigned to red, green, and blue channels respectively. It is the format used in Bedrock texture sets. #### Decode MER + - MERs can be inferred and decoded automatically when PBR mode is enabled. - Decoding can be _slow_ on large textures (1024x+). - Assign an albedo map prior to decoding a MER to extract the emissive color. +- Channels extracted from a MER can be saved as either separate textures or into + separate layers in a single texture. #### Export MER + - Compiles metal, emissive and roughness channels into MER texture. -- (Emissive colors will be lost upon export. Use grayscale values in emissive channels for accurate brightness levels.) +- (Emissive colors will be lost upon export. Use grayscale values in emissive + channels for accurate brightness levels.) ### Generate Normal Map -- Calculate normal map based on the assigned or inferred height map for the currently selected material/texture. + +- Calculate normal map based on the assigned or inferred height map for the + currently selected material/texture. + +### Generate Ambient Occlusion Map + +- Generate an AO map from the material's normal map. (AO available in some + labPBR shaders.) + +### Texture Baking + +- Bake a normal and emissive maps onto the base color channel. +- Output multiple light positions. +- Choose ambient light settings before baking. ### Export Texture Set + - Create a `.texture_set.json` file for the project textures. - Dialog allows defining values which can not be inferred from project. - Exports MER and normal maps in the process. +### labPBR Specular/Normal Maps + +- Export `_s` and `_n` files for PBR textures created in Blockbench. +- Decode existing, imported labPBR textures into PBR material channels. + +### Material Brush + +- Paint across multiple PBR channels simultaneously for a consistent material + output. +- Save material brush presets to a collection. +- Automatic PBR preview updates after every brush stroke. + ## Usage -### PBR Settings +### PBR Controls -This plugin adds the _PBR Settings_ panel, which controls enabling and disabling PBR materials in Blockbench previews. +This plugin adds the _PBR Controls_ panel, which controls enabling and disabling +PBR materials in Blockbench previews. #### Toggle PBR -- Use the _PBR Preview_ toggle to toggle or refresh the PBR preview. Also found in the _View_ menu. +- Use the _PBR Preview_ toggle to toggle or refresh the PBR preview. Also found + in the _View_ menu. >
> Usage Tip @@ -47,60 +93,102 @@ This plugin adds the _PBR Settings_ panel, which controls enabling and disabling #### Toggle Corrected Lighting -- Use the _Correct Lights_ toggle to enable or disable physically-corrected lighting in the preview scene. This may improve the appearance of reflective and emissive materials in the preview scene, but will dim the albedo/base color texture. +- Use the _Correct Lights_ toggle to enable or disable physically-corrected + lighting in the preview scene. This may improve the appearance of reflective + and emissive materials in the preview scene, but will dim the albedo/base + color texture. #### Tone Mapping -- The _Tone Mapping_ select will apply various tone mapping techniques to the preview scene. Use the _Linear_ option to match the tone map used by most Bedrock shaders. +- The _Tone Mapping_ select will apply various tone mapping techniques to the + preview scene. Use the _Linear_ option to match the tone map used by most + Bedrock shaders. #### Exposure -- The scene exposure can be adjusted once a tone map technique is selected. Values range from -2.0 to 2.0. +- The scene exposure can be adjusted once a tone map technique is selected. + Values range from -2.0 to 2.0. ### Channel Management -Control which textures or texture layers are used for PBR channels using the following methods: +Control which textures or texture layers are used for PBR channels using the +following methods: #### Create Material Texture -- Use the _Create Material Texture_ action to create a blank texture with PBR material layers initialized. +- Use the _Create Material Texture_ action to create a blank texture with PBR + material layers initialized.\ + If an existing texture is selected, it will be used as the albedo channel in + the PBR material. If the project has other textures, include those textures in + the selection to have them automatically assigned to the new material's PBR + channels. + +Follow these naming conventions to ensure the textures are assigned to the +appropriate channels when creating a new material: #### Channel Naming Convention -The plugin will assume that textures and layers which end in an underscore and a channel name are intended to be used as that channel. For example, `texture_roughness` will be used as the roughness map unless the channel has been manually assigned a texture. +The plugin will assume that textures and layers which end in an underscore and a +channel name are intended to be used as that channel. For example, +`texture_roughness` will be used as the roughness map unless the channel has +been manually assigned a texture. ##### Supported Channels -| Channel | Description | Colorspace | -|-----------|-------------|------------| -| `ao` | Ambient Occlusion | __BW__ | -| `albedo` | Albedo / Base Color | __RGB__ | -| `normal` | DirectX Normal Map | __RGB__ | -| `metalness` | Metallic map | __BW__ | -| `roughness` | Roughness map | __BW__ | -| `emissive` | Emissive map | Displayed in __RGB__; Exported as __BW__ in MER | -| `sss` | Subsurface Scattering | __BW__; Not supported by shader but exported in MER alpha channel | + +| Channel | Description | Colorspace | +| ----------- | --------------------- | ----------------------------------------------------------------- | +| `ao` | Ambient Occlusion | **BW** | +| `albedo` | Albedo / Base Color | **RGB** | +| `normal` | DirectX Normal Map | **RGB** | +| `metalness` | Metallic map | **BW** | +| `roughness` | Roughness map | **BW** | +| `emissive` | Emissive map | Displayed in **RGB**; Exported as **BW** in MER | +| `sss` | Subsurface Scattering | **BW**; Not supported by shader but exported in MER alpha channel | + +###### Supported Minecraft Shader Channels + +RenderDragon and labPBR textures are automatically decoded and displayed when +the channels can be inferred based on the existence of MER, specular, or normal +maps. Some features are not supported by the Blockbench preview's shader, such +as AO and POM, but can still be decoded/encoded during texture import/export #### Explicit Channel Assignment -Create a Texture Layer in Blockbench to enable channel assignment in PBR previews. Each channel can be selected from a menu and applied to the current material. The menu is visible in the _PBR Settings_ panel when in Paint mode. The menu options are also available in the _Image_ menu. +Create a Texture Layer in Blockbench to enable channel assignment in PBR +previews. Each channel can be selected from a menu and applied to the current +material. The menu is visible in the _PBR Controls_ panel when in Paint mode. +The menu options are available in the _Image_ menu, as well as in the context +menu of a texture or layer, and in the Layers panel. #### Removing Channel Assignment -Channels can be disabled by hiding or deleting the layer, or un-assigning the channel in the menu. Texture layers cannot be assigned to more than one channel. Assigning a layer to a new channel will clear the layer's current channel. +Channels can be disabled by hiding or deleting the layer, or un-assigning the +channel in the menu. Texture layers cannot be assigned to more than one channel. +Assigning a layer to a new channel will clear the layer's current channel. + +#### Finding Assigned Channels + +When in Paint mode, select a texture with material layers assigned to reveal the +_Select PBR Channel_ menu button in the _PBR Controls_ panel. This menu lists +the channels currently assigned by the selected texture. Click a channel in the +menu to have it selected in the Layers panel. ### Material Brush Tool -Use the _Material Brush Tool_ to paint across multiple PBR channels simultaneously.The controls found in the _Material Brush Panel_ +Use the _Material Brush Tool_ to paint across multiple PBR channels. The +controls found in the _Material Brush Panel_. - Set the metallic, roughness and height values on a scale of 0% - 100% - Use the color picker in the _Material Brush Panel_ to set the emissive color. -- The current color selected in the main color picker is used as the albedo color. +- The current color selected in the main color picker is used as the albedo + color. - Only visible layers with channels assigned will be updated by the brush. -- Blockbench's paint brush size and smoothness settings control the material brush's settings as well. +- Blockbench's paint brush size and smoothness settings control the material + brush's settings as well. ---- +#### Material Brush Presets -## Roadmap -- Java project support -- labPBR texture exports -- Preview scene PostFX \ No newline at end of file +Open the _Material Brush Presets_ dialog to define and save new brush settings, +or to select and apply existing presets. A material preview is generated upon +saving a preset. Select a preset to populate its values in the Material Brush +input controls. diff --git a/plugins/pbr_preview/changelog.json b/plugins/pbr_preview/changelog.json index edadc3cf..3fe0dbab 100644 --- a/plugins/pbr_preview/changelog.json +++ b/plugins/pbr_preview/changelog.json @@ -11,5 +11,26 @@ ] } ] + }, + "1.1.0": { + "title": "1.1.0", + "date": "2024-06-10", + "author": "Jason J. Gardner", + "categories": [ + { + "title": "Java Support", + "list": [ + "Added labPBR export option", + "Added labPBR texture decoding" + ] + }, + { + "title": "Material Brush", + "list": [ + "Added material brush tool", + "Added material brush preset dialog" + ] + } + ] } } \ No newline at end of file diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index fe9269c3..3b1d5a8c 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1,5 +1,5 @@ -"use strict";(()=>{var b=THREE,J=Vue,Le=Blockbench;var B="_NONE_",d={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new b.Color(16777215)},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new b.Color(0)},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new b.Color(0)},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new b.Color(16777215)},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new b.Color(16777215)},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new b.Color("rgb(128, 128, 255)")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new b.Color(16777215)}},s={},w=[],E=[];w.push(()=>{s.channelProp=new Property(TextureLayer,"enum","channel",{default:B,values:Object.keys(d).map(e=>d[e].id),label:"PBR Channel",exposed:!1}),s.textureChannelProp=new Property(Texture,"enum","channel",{default:B,values:Object.keys(d).map(e=>d[e].id),label:"PBR Channel",exposed:!1}),s.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),s.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),s.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"})});var ve=(e=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return e?a.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):a},L=class e{constructor(a,t){this._scope=a??ve(),this._materialUuid=t}merToCanvas(){let a=this.getTexture(d.emissive),t=this.getTexture(d.roughness),r=this.getTexture(d.metalness);if(!a&&!t&&!r){let{metalness:n,emissive:o,roughness:l}=this.decodeMer();n&&(r=e.makePixelatedCanvas(n)),o&&(a=e.makePixelatedCanvas(o)),l&&(t=e.makePixelatedCanvas(l))}return{emissiveMap:a,roughnessMap:t,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:n}=this.merToCanvas(),o=this.getTexture(d.normal);return new b.MeshStandardMaterial({map:this.getTexture(d.albedo)??e.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(l=>l.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(d.ao),bumpMap:this.getTexture(d.height),normalMap:o,normalScale:new b.Vector2(1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}saveTexture(a,t){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=t.uuid,t.extend({channel:a.id}))}findTexture(a,t=!0){if(!Project)return null;let r=this._scope.find(i=>i.channel&&(i.channel===a||i.channel===a.id));if(r)return r;let n=typeof a=="string"?a:a.id;Project.pbr_materials??={};let o=Project.pbr_materials[this._materialUuid];if(!o&&t&&n!==B){let i=new RegExp(`_*${n}(.[^.]+)?$`,"i");return this._scope.find(h=>i.test(h.name))??null}let l=o?.[n];return l?this._scope.find(i=>i.uuid===l)??null:null}static makePixelatedCanvas(a){let t=new b.CanvasTexture(a,void 0,void 0,void 0,b.NearestFilter,b.NearestFilter);return t.needsUpdate=!0,t}getTexture(a){let t=this.findTexture(a);return t?e.makePixelatedCanvas(t.canvas):null}static extractChannel(a,t){let r=a.canvas,n=r.width,o=r.height,l=r.getContext("2d");if(!l||!n||!o)return null;let i=document.createElement("canvas");i.width=n,i.height=o;let h=i.getContext("2d");if(!h)return null;let p={r:0,g:1,b:2,a:3}[t],{data:f}=l.getImageData(0,0,n,o),u=new Uint8ClampedArray(n*o*4);for(let x=0;xa){v[m]=_.data[m],v[m+1]=_.data[m+1],v[m+2]=_.data[m+2],v[m+3]=255;continue}v[m]=0,v[m+1]=0,v[m+2]=0,v[m+3]=255}return p.putImageData(new ImageData(v,i.width,i.height),0,0),{metalness:r,emissive:i,emissiveLevel:n,roughness:o,sss:l}}createMer(a=!1){let t=this.findTexture(d.metalness,a),r=this.findTexture(d.emissive,a),n=this.findTexture(d.roughness,a),o=this.findTexture("sss",!1),l=Math.max(t?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),i=Math.max(t?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),h=document.createElement("canvas");h.width=l,h.height=i;let p=h.getContext("2d");if(!p)return null;let f=t?.img?e.extractChannel(t,"r"):null,u=r?.img?e.extractChannel(r,"g"):null,_=n?.img?e.extractChannel(n,"b"):null,x=o&&o?.img?e.extractChannel(o,"a"):null,v=f?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(l,i),m=u?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(l,i),c=_?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(l,i),g=x?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(new Uint8ClampedArray(l*i*4).fill(255),l,i),y=new Uint8ClampedArray(l*i*4);for(let C=0;C{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createTexturesFromNormal(a){let t=this.decodeLabPbrNormal(a);return Object.entries(t).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createNormalMap(a,t=!1){let r=a.canvas.getContext("2d");if(!r)return null;let n=Math.max(a.img.width??a.canvas.width,Project?Project.texture_width:0,16),o=Math.max(a.img.height??a.canvas.height,Project?Project.texture_height:0,16),{data:l}=r.getImageData(0,0,n,o),i=document.createElement("canvas"),h=i.getContext("2d");if(!h)return null;let p=(c,g)=>{let y=(c+g*n)*4;return l[y]/255};i.width=n,i.height=o,h.drawImage(a.img,0,0,n,o);let f=h.getImageData(0,0,n,o),u=f.data,_=c=>{let g=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);return[c[0]/g,c[1]/g,c[2]/g]};for(let c=0;c{let v=this.createCanvas(t.width,t.height),m=v.getContext("2d"),c=m.getImageData(0,0,v.width,v.height),g=[Math.cos(x),Math.sin(x),this.lightHeight];for(let y=0;y{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new L(r.layers_enabled?r.layers:Project.textures,r.uuid),o=n.findTexture(d.albedo);if(!o){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let l=n.findTexture(d.normal);if(!l){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let h=new I(e).bake(a,o.canvas,l.canvas),p=new Texture({name:`${o.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(h[0].toDataURL()),f=t?u=>{let _=n.findTexture(d.emissive);if(!_)return u;let x=_.canvas;if(!x.getContext("2d"))return u;let m=Math.max(u.width,x.width,Project?Project.texture_width:16),c=Math.max(u.height,x.height,Project?Project.texture_height:16),g=document.createElement("canvas");g.width=m,g.height=c;let y=g.getContext("2d");return y?(y.drawImage(u,0,0),y.globalCompositeOperation="screen",y.drawImage(x,0,0),g):u}:u=>u;h.forEach((u,_)=>{new TextureLayer({name:`baked_${_+1}`,data_url:f(u).toDataURL()},p).addForEditing()}),p.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};w.push(()=>{s.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(e){let a=new b.Color(e.ambientLight.toString()),t=new b.Color(e.lightDiffuse.toString());W({ambientLight:[a.r,a.g,a.b],lightDiffuse:[t.r,t.g,t.b],lightHeight:Number(e.lightHeight),minLightIntensity:Number(e.minLightIntensity)},e.directions??8,e.blendEmissive??!1)}}),s.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){s.bakeTexturesDialog?.show()}}),MenuBar.addAction(s.bakeTexturesAction,"tools")});E.push(()=>{MenuBar.removeAction("tools.bake_textures")});var S=e=>{if(!Project||Texture.all.length===0)return;let a=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(r=>{let o=t.faces[r].getTexture();if(!o)return;let l=Project.materials[o.uuid];l.isShaderMaterial&&!Project.bb_materials[o.uuid]&&(Project.bb_materials[o.uuid]=l);let i=new L(o.layers_enabled?o.layers.filter(h=>h.visible)??null:Project.textures,o.uuid).getMaterial(e);i.side=Canvas.getRenderSide(o),Project.materials[o.uuid]=b.ShaderMaterial.prototype.copy.call(i,l),Canvas.updateAllFaces(o),a=!0})}),Project.pbr_active=a};var $={};w.push(()=>{Object.entries(d).forEach(([e,a])=>{$[e]=new Action(`assign_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:{selected:{texture:!0}},click(t){let r=TextureLayer.selected??(Project?Project.selected_texture:null);if(!r||!Project)return;Undo.initEdit({layers:[r]}),r.extend({channel:a.id});let n=r instanceof TextureLayer?r.texture:r;n.updateChangesAfterEdit(),Project.pbr_materials[n.uuid]||(Project.pbr_materials[n.uuid]={}),Object.entries(Project.pbr_materials[n.uuid]).forEach(([o,l])=>{l===r.uuid&&(delete Project.pbr_materials[n.uuid][o],r.channel=B)}),n.uuid===r.uuid&&(Project.pbr_materials[n.uuid]={}),Project.pbr_materials[n.uuid][e]=r.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${r.name}" to ${a.label} channel`,2e3),S()}})})});E.push(()=>{Object.entries($).forEach(([e,a])=>{a?.delete()})});w.push(()=>{s.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:{selected:{texture:!0},method(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);return!e||!Project?!1:e.channel&&e.channel!==B}},click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e||!Project)return;Undo.initEdit({layers:[e]});let a=e instanceof TextureLayer?e.texture:e,t=e.channel;Project.pbr_materials[a.uuid]={},e.channel=B,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${e.name}" from ${t} channel`,2e3),S()}}),s.channelMenu=new Menu("channel_menu",[...Object.keys(d).map(e=>`assign_channel_${e}`),"unassign_channel"],{onOpen(){S()}}),s.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",click(e){s.channelMenu?.open(e)},children:[...Object.values($),s.unassignChannel]}),s.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(e){s.channelMenu?.open(e)}})});w.push(()=>{s.openChannelMenu&&(MenuBar.addAction(s.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(s.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(s.openChannelMenu,"0")),Toolbars.layers.add(s.showChannelMenu,1)});E.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(s.showChannelMenu)});w.push(()=>{s.generateNormal=new Action("generate_normal",{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(e=>e.selected))!==void 0,click(){let e=TextureLayer.selected??(Project&&Project.selected_texture?Project.selected_texture.selected_layer??Project.selected_texture:Texture.getDefault());if(!e)return;let a=new L(e instanceof Texture&&e.layers_enabled?e.layers:null,e.uuid),t=a.createNormalMap(e);if(t){a.saveTexture(d.normal,t),t.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),MenuBar.addAction(s.generateNormal,"tools")});E.push(()=>{MenuBar.removeAction("tools.generate_normal")});var q=(e,a)=>{let t=a??document.createElement("canvas"),r=t.getContext("2d");if(!r)return null;let n=Math.max(Project?Project.texture_width:16,16),o=Math.max(Project?Project.texture_height:16,16);return t.width=n,t.height=o,r.fillStyle=`rgb(${e.r*255}, ${e.g*255}, ${e.b*255})`,r.fillRect(0,0,n,o),t.toDataURL()};w.push(()=>{s.createMaterialTexture=new Action("create_material_texture",{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",click(){if(!Project)return;let e={...d},a=new Texture({name:"New Material",saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}),t=Texture.all.filter(o=>o.selected||o.multi_selected)??Texture.all,r=Texture.selected?new L(t,Texture.selected.uuid):null;try{let o=r?.findTexture(d.albedo,!0)?.canvas.toDataURL()??Texture.selected?.canvas.toDataURL()??q(new b.Color(8421504),a.canvas);if(!o)return;a.fromDataURL(o);let l=new TextureLayer({name:e.albedo.label,visible:!0,data_url:o},a);l.extend({channel:e.albedo.id}),l.addForEditing(),l.texture.updateChangesAfterEdit(),delete e.albedo}catch(o){console.warn("Failed to create base color texture",o),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let n=Object.keys(e).map(o=>{let l=d[o],i=r?.findTexture(l,!0),h=i?i.canvas.toDataURL():q(l.default??new b.Color(0));if(!h)return;let p=new TextureLayer({name:l.label,visible:!0,data_url:h},a);return p.extend({channel:l.id}),p}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:n}),a.add().select(),n.map(o=>o.addForEditing()),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(s.createMaterialTexture,"tools"),Toolbars.texturelist.add(s.createMaterialTexture,3)});E.push(()=>{MenuBar.removeAction("tools.create_material_texture")});function O(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(e=>e.selected)??null:Texture.all.find(e=>e.selected)??Texture.getDefault()}function X(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(O()?.name??"texture")}var R=(e,a)=>{let t=O(),r=new L(t.layers_enabled?t.layers:Project?Project.textures:null,t.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[o,l]=Project?[e?`${e}_mer`:`${t.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:o,extensions:["png"],resource_id:"mer",savetype:"image",startpath:l},a)})};function _e(){s.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock_block","bedrock_entity"],project:!0},click(){try{R()}catch(e){console.error("Failed to export MER map:",e),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),s.decodeMer=new Action("decode_mer",{icon:"arrow_split",name:"Decode MER",description:"Decodes a MER texture map into metalness, emissive, and roughness channels",condition:()=>!!Project&&Project.selected_texture!==null&&!Project.selected_texture.layers_enabled,click(){let e=TextureLayer.selected?.texture??Texture.all.find(n=>n.selected)??Texture.getDefault(),a=new L(e.layers_enabled?e.layers:[e],e.uuid),t=a.decodeMer(),r=[d.metalness,d.emissive,d.roughness];Undo.initEdit({textures:[e]}),e.activateLayers(!0),r.forEach(n=>{let o=n.id,l=t[o];if(!l){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let i=new TextureLayer({name:`${e?.name}_${o}`,data_url:l.toDataURL()},e);a.saveTexture(n,i),i.addForEditing()}),Undo.finishEdit("Decode MER")}}),MenuBar.addAction(s.decodeMer,"tools"),MenuBar.addAction(s.generateMer,"file.export")}function ye(){MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")}w.push(_e);E.push(ye);var we=()=>{Project&&Project.textures.forEach(e=>{let a=new L(null,e.uuid),t=a.findTexture(d.normal,!1),r=a.findTexture(d.height,!1),n=a.findTexture(d.albedo,!1),o=a.findTexture(d.metalness,!1)?.name,l=a.findTexture(d.emissive,!1)?.name,i=a.findTexture(d.roughness,!1)?.name,h={};return n||(h.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!l&&!i&&(h.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},h.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},h.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),t&&(h.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(h.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),t&&r&&(h.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),s.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:h,cancelIndex:1,onConfirm(p){let f=X(),u=o||l||i,_={format_version:"1.16.100","minecraft:texture_set":{color:(n?f:p.baseColor?.toHexString())??f,metalness_emissive_roughness:[p.metalness??0,p.emissive??0,p.roughness??255]}};p.depthMap==="normal"&&t||!r&&t?_["minecraft:texture_set"].normal=`${f}_normal`:(!t||p.depthMap==="heightmap")&&r&&(_["minecraft:texture_set"].heightmap=`${f}_heightmap`);let x=c=>{if(!p.depthMap)return c();let g=p.depthMap==="normal"||p.depthMap&&!r,y=g?t:r;if(!y)return c();Blockbench.export({content:y.canvas.toDataURL()??"",type:"PNG",name:`${f}_${g?"normal":"heightmap"}`,extensions:["png"],resource_id:p.depthMap,startpath:Project.export_path,savetype:"image"},C=>{_["minecraft:texture_set"][g?"normal":"heightmap"]=pathToName(C,!1),c()})},v=c=>{if(!n)return c();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:f,startpath:Project.export_path,savetype:"image"},g=>{_["minecraft:texture_set"].color=pathToName(g,!1),c()})},m=()=>x(()=>{v(()=>{Blockbench.export({content:JSON.stringify(_,null,2),type:"JSON",name:`${f}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),s.textureSetDialog?.hide()})})});if(u){try{R(f,c=>{_["minecraft:texture_set"].metalness_emissive_roughness=pathToName(c,!1),m()})}catch(c){console.warn("Failed to export MER map:",c),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}m()}}),s.textureSetDialog.show()})};w.push(()=>{s.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){we()},condition:{formats:["bedrock_block","bedrock_entity"],project:!0}}),MenuBar.addAction(s.createTextureSet,"file.export")});E.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});w.push(()=>{s.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(e){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=e}),Preview.selected.renderer.physicallyCorrectLights=e,Blockbench.showQuickMessage(`Physically corrected lighting is now ${e?"enabled":"disabled"}`,2e3),e&&s.togglePbr?.set(!0),S()},click(){}}),MenuBar.addAction(s.toggleCorrectLights,"preview")});E.push(()=>{MenuBar.removeAction("preview.correct_lights")});var H=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(e=>{e instanceof Cube&&Object.keys(e.faces).forEach(a=>{let r=e.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var K=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project"],Y=()=>Project&&Project.pbr_active&&S(),Ce=()=>{K.forEach(e=>{Blockbench.addListener(e,Y)})},Z=()=>{K.forEach(e=>{Blockbench.removeListener(e,Y)})};w.push(()=>{s.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(e){if(e){S(),Ce(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}H(),Z(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(s.togglePbr,"view")});E.push(()=>{Z(),MenuBar.removeAction("view.toggle_pbr")});var ee=e=>{let a=Math.max(-2,Math.min(2,Number(e)));Preview.all.forEach(t=>{t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};w.push(()=>{s.exposureSlider=new BarSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",step:.1,min:-2,max:2,onBefore(){Number(s.tonemappingSelect?.get())===b.NoToneMapping&&s.tonemappingSelect.change(b.LinearToneMapping.toString()),s.togglePbr?.set(!0)},onChange({value:e}){ee(e)},onAfter(){S()}}),s.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>s.exposureSlider!==void 0&&Number(s.exposureSlider?.get())!==1,click(){ee(1),s.exposureSlider?.set(1),S()}}),s.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:b.NoToneMapping,value:Preview.selected.renderer.toneMapping??b.NoToneMapping,icon:"monochrome_photos",options:{[b.NoToneMapping]:"No Tone Mapping",[b.LinearToneMapping]:"Linear",[b.ReinhardToneMapping]:"Reinhard",[b.CineonToneMapping]:"Cineon",[b.ACESFilmicToneMapping]:"ACES"},onChange({value:e}){let a=Number(s.exposureSlider?.get()??1);Preview.all.forEach(t=>{t.renderer.toneMapping=Number(e),t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMapping=Number(e),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(e)}`,2e3),s.togglePbr&&!s.togglePbr.value&&s.togglePbr.set(!0),S()}})});var Me=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},Pe=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};w.push(()=>{s.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let e=Project.selected_texture;if(!e)return;let t=new L(e.layers_enabled?e.layers:[e],e.uuid).createLabPbrOutput();if(t===null)return;let r=e.name??(Project?Project.getDisplayName():"texture");await Promise.all([Me(t.normalMap,pathToName(r)),Pe(t.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),s.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:()=>!!Project&&Project.selected_texture!==null,click(){let e=TextureLayer.selected?.texture??Texture.all.find(t=>t.selected)??Texture.getDefault(),a=new L(e.layers_enabled?e.layers:[e],e.uuid);if(e.name.endsWith("_n")||e.name.endsWith("_n.png")){a.createTexturesFromNormal(e);return}if(e.name.endsWith("_s")||e.name.endsWith("_s.png")){a.createTexturesFromSpecular(e);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(s.generateLabPbr,"file.export"),MenuBar.addAction(s.decodeLabPbr,"tools")});E.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});var U=class e{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(d).map(t=>[t,d[t].default??new b.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([t,r])=>[t,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let t=Math.min(1,Math.max(0,a));return new b.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let a="#000000",t=Number(s.brushMetalnessSlider?.get()),r=Number(s.brushRoughnessSlider?.get()??1),n=(s.brushEmissiveColor?.get()??a).toString(),o=Number(s.brushHeightSlider?.get()),l=ColorPanel.get(),i={[d.albedo.id]:new b.Color(l),[d.metalness.id]:e.makeLinearColor(t),[d.roughness.id]:e.makeLinearColor(r),[d.emissive.id]:new b.Color(n??a),[d.height.id]:e.makeLinearColor(o),[d.normal.id]:d.normal.default??new b.Color("#8080ff")};return new e({colors:i})}};var Te=e=>{let a=new b.WebGLRenderer({alpha:!0,antialias:!0}),t=new b.Scene,r=new b.PerspectiveCamera(75,96/96,.1,1e3),n=new b.AmbientLight(16777215,.75);t.add(n);let o=new b.PointLight(16777215,1,100);o.position.set(5,5,5),t.add(o);let l=new b.SphereGeometry(1,32,32),i=new b.MeshStandardMaterial({color:e.albedo,metalness:e.metalness??0,roughness:e.roughness??1,emissive:e.emissive,bumpScale:e.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),h=new b.Mesh(l,i);return t.add(h),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(t,r),a.domElement.toDataURL()},te="materialBrushPresets",F=()=>JSON.parse(localStorage.getItem(te)||"{}"),Ee=(e,a)=>{let t=F(),r=a??guid(),n=s.userMaterialBrushPresets?.getFormResult()??{},o={};return n.albedo&&(o.albedo=n.albedo.toString()),n.metalness&&(o.metalness=Number(n.metalness)),n.roughness&&(o.roughness=Number(n.roughness)),n.emissive&&(o.emissive=n.emissive.toString()),n.height&&(o.height=Number(n.height)),t[r]=[o,e??"New Preset",Te(o)],localStorage.setItem(te,JSON.stringify(t)),r},G=({metalness:e,roughness:a,emissive:t,height:r,albedo:n})=>{e!==void 0&&s.brushMetalnessSlider?.setValue(e||0,!0),a!==void 0&&s.brushRoughnessSlider?.setValue(a??1,!0),t!==void 0&&s.brushEmissiveColor?.set(t??"#000000"),r!==void 0&&s.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},je=J.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:d}},methods:{applyPreset(e){try{let[a,t]=this.userPresets[e],{metalness:r,roughness:n,emissive:o,height:l,albedo:i}=a;G({metalness:Number(r),roughness:Number(n),emissive:o.toString(),height:Number(l),albedo:i.toString()}),s.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${t}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(e){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let t=F(),r=this.userPresets[e][1]??e;delete t[e],localStorage.setItem("materialBrushPresets",JSON.stringify(t)),this.userPresets=t,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(e){s.userMaterialBrushPresets?.setFormValues({name:this.userPresets[e][1]??e,...this.userPresets[e][0]})},getSummary(e){return Object.entries(e).filter(([a])=>a in this.channels).map(([a,t])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${t}`:`${this.channels[a]?.label??a}: ${Number(t).toFixed(1)}`).join(` -`)}},computed:{presets(){return Object.entries(this.userPresets)}},mounted(){this.userPresets=F()},template:` +"use strict";(()=>{var v=THREE,W=Vue;var N="_NONE_",d={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new v.Color(16777215)},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new v.Color(0)},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new v.Color(0)},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new v.Color(16777215)},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new v.Color(16777215)},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new v.Color("rgb(128, 128, 255)")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new v.Color(16777215)}},o={},C=[],L=[];C.push(()=>{o.channelProp=new Property(TextureLayer,"enum","channel",{default:N,values:Object.keys(d).map(e=>d[e].id),label:"PBR Channel",exposed:!1}),o.textureChannelProp=new Property(Texture,"enum","channel",{default:N,values:Object.keys(d).map(e=>d[e].id),label:"PBR Channel",exposed:!1}),o.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),o.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),o.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"})});var Me=(e=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return e?a.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):a},j=class e{constructor(a,t){this._scope=a??Me(),this._materialUuid=t}merToCanvas(){let a=this.getTexture(d.emissive),t=this.getTexture(d.roughness),r=this.getTexture(d.metalness);if(!a&&!t&&!r){let{metalness:n,emissive:s,roughness:l}=this.decodeMer();n&&(r=e.makePixelatedCanvas(n)),s&&(a=e.makePixelatedCanvas(s)),l&&(t=e.makePixelatedCanvas(l))}return{emissiveMap:a,roughnessMap:t,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:n}=this.merToCanvas(),s=this.getTexture(d.normal);return new v.MeshStandardMaterial({map:this.getTexture(d.albedo)??e.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(l=>l.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(d.ao),bumpMap:this.getTexture(d.height),normalMap:s,normalScale:new v.Vector2(1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}saveTexture(a,t){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=t.uuid,t.extend({channel:a.id}))}findTexture(a,t=!0){if(!Project)return null;let r=this._scope.find(i=>i.channel&&(i.channel===a||i.channel===a.id));if(r)return r;let n=typeof a=="string"?a:a.id;Project.pbr_materials??={};let s=Project.pbr_materials[this._materialUuid];if(!s&&t&&n!==N){let i=new RegExp(`_*${n}(.[^.]+)?$`,"i");return this._scope.find(h=>i.test(h.name))??null}let l=s?.[n];return l?this._scope.find(i=>i.uuid===l)??null:null}static makePixelatedCanvas(a){let t=new v.CanvasTexture(a,void 0,void 0,void 0,v.NearestFilter,v.NearestFilter);return t.needsUpdate=!0,t}getTexture(a){let t=this.findTexture(a);return t?e.makePixelatedCanvas(t.canvas):null}static extractChannel(a,t){let r=a.canvas,n=r.width,s=r.height,l=r.getContext("2d");if(!l||!n||!s)return null;let i=document.createElement("canvas");i.width=n,i.height=s;let h=i.getContext("2d");if(!h)return null;let g={r:0,g:1,b:2,a:3}[t],{data:p}=l.getImageData(0,0,n,s),m=new Uint8ClampedArray(n*s*4);for(let b=0;ba){x[u]=_.data[u],x[u+1]=_.data[u+1],x[u+2]=_.data[u+2],x[u+3]=255;continue}x[u]=0,x[u+1]=0,x[u+2]=0,x[u+3]=255}return g.putImageData(new ImageData(x,i.width,i.height),0,0),{metalness:r,emissive:i,emissiveLevel:n,roughness:s,sss:l}}createMer(a=!1){let t=this.findTexture(d.metalness,a),r=this.findTexture(d.emissive,a),n=this.findTexture(d.roughness,a),s=this.findTexture("sss",!1),l=Math.max(t?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),i=Math.max(t?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),h=document.createElement("canvas");h.width=l,h.height=i;let g=h.getContext("2d");if(!g)return null;let p=t?.img?e.extractChannel(t,"r"):null,m=r?.img?e.extractChannel(r,"g"):null,_=n?.img?e.extractChannel(n,"b"):null,b=s&&s?.img?e.extractChannel(s,"a"):null,x=p?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(l,i),u=m?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(l,i),c=_?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(l,i),f=b?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(new Uint8ClampedArray(l*i*4).fill(255),l,i),y=new Uint8ClampedArray(l*i*4);for(let w=0;w{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createTexturesFromNormal(a){let t=this.decodeLabPbrNormal(a);return Object.entries(t).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createNormalMap(a,t=!1){let r=a.canvas.getContext("2d");if(!r)return null;let n=Math.max(a.img.width??a.canvas.width,Project?Project.texture_width:0,16),s=Math.max(a.img.height??a.canvas.height,Project?Project.texture_height:0,16),{data:l}=r.getImageData(0,0,n,s),i=document.createElement("canvas"),h=i.getContext("2d");if(!h)return null;let g=(c,f)=>{let y=(c+f*n)*4;return l[y]/255};i.width=n,i.height=s,h.drawImage(a.img,0,0,n,s);let p=h.getImageData(0,0,n,s),m=p.data,_=c=>{let f=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);return[c[0]/f,c[1]/f,c[2]/f]};for(let c=0;c{let c=(x+u*r)*4;return s[c]/255};l.width=r,l.height=n,i.drawImage(a.img,0,0,r,n);let g=i.getImageData(0,0,r,n),p=g.data;for(let x=0;x{let x=this.createCanvas(t.width,t.height),u=x.getContext("2d"),c=u.getImageData(0,0,x.width,x.height),f=[Math.cos(b),Math.sin(b),this.lightHeight];for(let y=0;y{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new j(r.layers_enabled?r.layers:Project.textures,r.uuid),s=n.findTexture(d.albedo);if(!s){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let l=n.findTexture(d.normal);if(!l){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let h=new H(e).bake(a,s.canvas,l.canvas),g=new Texture({name:`${s.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(h[0].toDataURL()),p=t?m=>{let _=n.findTexture(d.emissive);if(!_)return m;let b=_.canvas;if(!b.getContext("2d"))return m;let u=Math.max(m.width,b.width,Project?Project.texture_width:16),c=Math.max(m.height,b.height,Project?Project.texture_height:16),f=document.createElement("canvas");f.width=u,f.height=c;let y=f.getContext("2d");return y?(y.drawImage(m,0,0),y.globalCompositeOperation="screen",y.drawImage(b,0,0),f):m}:m=>m;h.forEach((m,_)=>{new TextureLayer({name:`baked_${_+1}`,data_url:p(m).toDataURL()},g).addForEditing()}),g.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};C.push(()=>{o.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(e){let a=new v.Color(e.ambientLight.toString()),t=new v.Color(e.lightDiffuse.toString());K({ambientLight:[a.r,a.g,a.b],lightDiffuse:[t.r,t.g,t.b],lightHeight:Number(e.lightHeight),minLightIntensity:Number(e.minLightIntensity)},e.directions??8,e.blendEmissive??!1)}}),o.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){o.bakeTexturesDialog?.show()}}),MenuBar.addAction(o.bakeTexturesAction,"tools")});L.push(()=>{MenuBar.removeAction("tools.bake_textures")});function S(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(e=>e.selected)??null:Texture.all.find(e=>e.selected)??Texture.getDefault()}function F(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(e=>e.selected)??Project.selected_texture.layers[0]:S()?.getActiveLayer()??null}function X(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(S()?.name??"texture")}function Y(e,a){let t;return function(...r){let n=()=>{t=void 0,e.apply(this,r)};clearTimeout(t),t=setTimeout(n,a)}}var A=e=>{if(!Project||Texture.all.length===0)return;let a=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(r=>{let n=t.faces[r],s=n.getTexture();if(!s||!n.enabled)return;let l=Project.materials[s.uuid];l.isShaderMaterial&&!Project.bb_materials[s.uuid]&&(Project.bb_materials[s.uuid]=l);let i=new j(s.layers_enabled?s.layers.filter(h=>h.visible)??null:Project.textures,s.uuid).getMaterial(e);i.side=Canvas.getRenderSide(s),Project.materials[s.uuid]=v.ShaderMaterial.prototype.copy.call(i,l),Canvas.updateAllFaces(s),a=!0})}),Project.pbr_active=a},I=(e=100)=>Y(A,e);var z={},Q={};Object.entries(d).forEach(([e,a],t)=>{C.push(()=>{z[e]=new Action(`assign_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:{selected:{texture:!0}},click(r){let n=TextureLayer.selected??(Project?Project.selected_texture:null);if(!n||!Project)return;Undo.initEdit({layers:[n]}),n.extend({channel:a.id});let s=n instanceof TextureLayer?n.texture:n;s.updateChangesAfterEdit(),Project.pbr_materials[s.uuid]||(Project.pbr_materials[s.uuid]={}),Object.entries(Project.pbr_materials[s.uuid]).forEach(([l,i])=>{i===n.uuid&&(delete Project.pbr_materials[s.uuid][l],n.channel=N)}),s.uuid===n.uuid&&(Project.pbr_materials[s.uuid]={}),Project.pbr_materials[s.uuid][e]=n.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${n.name}" to ${a.label} channel`,2e3),A()}}),Q[e]=new Action(`select_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:a.label??e,description:`Select the ${a.label} channel`,condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){let r=S();return(r?.layers_enabled?r.layers:Texture.all).some(s=>s.channel===e)}},click(){let r=Texture.selected?.layers_enabled?Texture.selected.layers:Texture.all;if(!r||!r.length)return;let n=r.find(s=>s.channel===e);n&&(n.select(),n.scrollTo())}}),Q[e].addLabel(!0,()=>a.label??e)})});L.push(()=>{Object.values(z).forEach(e=>{e.delete()}),Object.values(Q).forEach(e=>{e.delete()})});C.push(()=>{o.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:{selected:{texture:!0},method(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);return!e||!Project?!1:e.channel&&e.channel!==N}},click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e||!Project)return;Undo.initEdit({layers:[e]});let a=e instanceof TextureLayer?e.texture:e,t=e.channel;Project.pbr_materials[a.uuid]={},e.channel=N,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${e.name}" from ${t} channel`,2e3),A()}}),o.channelMenu=new Menu("channel_menu",[...Object.keys(d).map(e=>`assign_channel_${e}`),"unassign_channel"],{onOpen(){A()}}),o.channelSelectionMenu=new Menu("channel_selection_menu",Object.keys(d).map(e=>`select_channel_${e}`)),o.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",click(e){o.channelMenu?.open(e)},children:[...Object.values(z),o.unassignChannel]}),o.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(e){o.channelMenu?.open(e)}}),o.showChannelSelectionMenu=new Action("show_channel_select_menu",{icon:"tv_options_edit_channels",name:"Select PBR Channel",description:"Select a channel to view",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(e){o.channelSelectionMenu?.open(e)}}),o.openChannelMenu&&(MenuBar.addAction(o.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(o.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(o.openChannelMenu,"0")),Toolbars.layers.add(o.showChannelMenu,1)});L.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(o.showChannelMenu)});C.push(()=>{o.generateNormal=new Action("generate_normal",{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(e=>e.selected))!==void 0,click(){let e=F()??S()??Texture.getDefault();if(!e)return;let a=new j(e instanceof Texture&&e.layers_enabled?e.layers:null,e.uuid),t=a.createNormalMap(e);if(t){a.saveTexture(d.normal,t),t.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),o.generateAo=new Action("generate_ao",{icon:d.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let e=F()??S()??Texture.getDefault();if(!e)return;let a=new j(e instanceof Texture&&e.layers_enabled?e.layers:null,e.uuid),t=a.findTexture(d.normal)??a.createNormalMap(e);if(!t){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=a.createAoMap(t);if(r){a.saveTexture(d.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),MenuBar.addAction(o.generateNormal,"tools"),MenuBar.addAction(o.generateAo,"tools")});L.push(()=>{MenuBar.removeAction("tools.generate_normal")});var Z=(e,a)=>{let t=a??document.createElement("canvas"),r=t.getContext("2d");if(!r)return null;let n=Math.max(Project?Project.texture_width:16,16),s=Math.max(Project?Project.texture_height:16,16);return t.width=n,t.height=s,r.fillStyle=`rgb(${e.r*255}, ${e.g*255}, ${e.b*255})`,r.fillRect(0,0,n,s),t.toDataURL()};C.push(()=>{o.createMaterialTexture=new Action("create_material_texture",{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let e={...d},a=new Texture({name:"New Material",saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}),t=Texture.all.filter(s=>s.selected||s.multi_selected)??Texture.all,r=Texture.selected?new j(t,Texture.selected.uuid):null;try{let s=r?.findTexture(d.albedo,!0)?.canvas.toDataURL()??Texture.selected?.canvas.toDataURL()??Z(new v.Color(8421504),a.canvas);if(!s)return;a.fromDataURL(s);let l=new TextureLayer({name:e.albedo.label,visible:!0,data_url:s},a);l.extend({channel:e.albedo.id}),l.addForEditing(),l.texture.updateChangesAfterEdit(),delete e.albedo}catch(s){console.warn("Failed to create base color texture",s),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let n=Object.keys(e).map(s=>{let l=d[s],i=r?.findTexture(l,!0),h=i?i.canvas.toDataURL():Z(l.default??new v.Color(0));if(!h)return;let g=new TextureLayer({name:l.label,visible:!0,data_url:h},a);return g.extend({channel:l.id}),g}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:n}),a.add().select(),n.map(s=>s.addForEditing()),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(o.createMaterialTexture,"tools"),Toolbars.texturelist.add(o.createMaterialTexture,3)});L.push(()=>{MenuBar.removeAction("tools.create_material_texture")});var U=(e,a)=>{let t=S(),r=new j(t.layers_enabled?t.layers:Project?Project.textures:null,t.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[s,l]=Project?[e?`${e}_mer`:`${t.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:s,extensions:["png"],resource_id:"mer",savetype:"image",startpath:l},a)})};C.push(()=>{o.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{U()}catch(e){console.error("Failed to export MER map:",e),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),o.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let e=S()??Texture.getDefault(),a=new j([e],e.uuid),t=a.decodeMer(),r=[d.metalness,d.emissive,d.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let s=n.id,l=t[s];if(!l){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let i=new Texture({name:`${e?.name}_${s}`,keep_size:!1}).fromDataURL(l.toDataURL());i.add(!0),a.saveTexture(n,i)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>S()?.layers_enabled===!0,click(){let e=TextureLayer.selected?.texture??Texture.all.find(s=>s.selected)??Texture.getDefault(),a=new j(e.layers_enabled?e.layers:[e],e.uuid),t=a.decodeMer(),r=[d.metalness,d.emissive,d.roughness];Undo.initEdit({textures:[e]});let n=e.selected.activateLayers(!0);r.forEach(s=>{let l=s.id,i=t[l];if(!i){Blockbench.showStatusMessage(`Failed to decode ${s.label} channel`,3e3);return}let h=new TextureLayer({name:`${e?.name}_${l}`,data_url:i.toDataURL()},e);a.saveTexture(s,h),h.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(o.decodeMer,"tools"),MenuBar.addAction(o.generateMer,"file.export")});L.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var Ce=()=>{Project&&Project.textures.forEach(e=>{let a=new j(null,e.uuid),t=a.findTexture(d.normal,!1),r=a.findTexture(d.height,!1),n=a.findTexture(d.albedo,!1),s=a.findTexture(d.metalness,!1)?.name,l=a.findTexture(d.emissive,!1)?.name,i=a.findTexture(d.roughness,!1)?.name,h={};return n||(h.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!s&&!l&&!i&&(h.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},h.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},h.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),t&&(h.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(h.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),t&&r&&(h.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),o.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:h,cancelIndex:1,onConfirm(g){let p=X(),m=s||l||i,_={format_version:"1.16.100","minecraft:texture_set":{color:(n?p:g.baseColor?.toHexString())??p,metalness_emissive_roughness:[g.metalness??0,g.emissive??0,g.roughness??255]}};g.depthMap==="normal"&&t||!r&&t?_["minecraft:texture_set"].normal=`${p}_normal`:(!t||g.depthMap==="heightmap")&&r&&(_["minecraft:texture_set"].heightmap=`${p}_heightmap`);let b=c=>{if(!g.depthMap)return c();let f=g.depthMap==="normal"||g.depthMap&&!r,y=f?t:r;if(!y)return c();Blockbench.export({content:y.canvas.toDataURL()??"",type:"PNG",name:`${p}_${f?"normal":"heightmap"}`,extensions:["png"],resource_id:g.depthMap,startpath:Project.export_path,savetype:"image"},w=>{_["minecraft:texture_set"][f?"normal":"heightmap"]=pathToName(w,!1),c()})},x=c=>{if(!n)return c();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:p,startpath:Project.export_path,savetype:"image"},f=>{_["minecraft:texture_set"].color=pathToName(f,!1),c()})},u=()=>b(()=>{x(()=>{Blockbench.export({content:JSON.stringify(_,null,2),type:"JSON",name:`${p}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),o.textureSetDialog?.hide()})})});if(m){try{U(p,c=>{_["minecraft:texture_set"].metalness_emissive_roughness=pathToName(c,!1),u()})}catch(c){console.warn("Failed to export MER map:",c),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}u()}}),o.textureSetDialog.show()})};C.push(()=>{o.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){Ce()},condition:{formats:["bedrock"],project:!0}}),MenuBar.addAction(o.createTextureSet,"file.export")});L.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});C.push(()=>{o.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(e){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=e}),Preview.selected.renderer.physicallyCorrectLights=e,Blockbench.showQuickMessage(`Physically corrected lighting is now ${e?"enabled":"disabled"}`,2e3),e&&o.togglePbr?.set(!0),I()},click(){}}),MenuBar.addAction(o.toggleCorrectLights,"preview")});L.push(()=>{MenuBar.removeAction("preview.correct_lights")});var $=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(e=>{e instanceof Cube&&Object.keys(e.faces).forEach(a=>{let r=e.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var ee=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],te=()=>Project&&Project.pbr_active&&A(),Te=()=>{Blockbench.on(ee.join(" "),te)},ae=()=>{ee.forEach(e=>{Blockbench.removeListener(e,te)})};C.push(()=>{o.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(e){if(e){A(),Te(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}$(),ae(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(o.togglePbr,"view")});L.push(()=>{ae(),MenuBar.removeAction("view.toggle_pbr")});var re=e=>{let a=Math.max(-2,Math.min(2,e));Preview.all.forEach(t=>{t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};C.push(()=>{o.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(o.tonemappingSelect?.get())===v.NoToneMapping&&o.tonemappingSelect.change(v.LinearToneMapping.toString()),o.togglePbr?.set(!0)},onChange(e){re(Number(e))},onAfter(){I()}}),o.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>o.exposureSlider!==void 0&&Number(o.exposureSlider?.get())!==1,click(){re(1),o.exposureSlider?.setValue(1,!0),I()}}),o.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:v.NoToneMapping,value:Preview.selected.renderer.toneMapping??v.NoToneMapping,icon:"monochrome_photos",options:{[v.NoToneMapping]:"No Tone Mapping",[v.LinearToneMapping]:"Linear",[v.ReinhardToneMapping]:"Reinhard",[v.CineonToneMapping]:"Cineon",[v.NeutralToneMapping]:"Neutral",[v.ACESFilmicToneMapping]:"ACES"},onChange({value:e}){Preview.selected.renderer.toneMapping=Number(e);let a=1;Preview.selected.renderer.toneMapping===v.NoToneMapping?o.exposureSlider?.setValue(a,!0):a=Number(o.exposureSlider?.get()??1),Preview.all.forEach(t=>{t.renderer.toneMapping=Number(e),t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(e)}`,2e3),o.togglePbr&&!o.togglePbr.value&&o.togglePbr.set(!0),A()}})});var Pe=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},Ee=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};C.push(()=>{o.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let e=S();if(!e)return;let t=new j(e.layers_enabled?e.layers:[e],e.uuid).createLabPbrOutput();if(t===null)return;let r=e.name??(Project?Project.getDisplayName():"texture");await Promise.all([Pe(t.normalMap,pathToName(r)),Ee(t.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),o.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let e=TextureLayer.selected?.texture??Texture.all.find(t=>t.selected)??Texture.getDefault(),a=new j(e.layers_enabled?e.layers:[e],e.uuid);if(pathToName(e.name).endsWith("_n")){a.createTexturesFromNormal(e);return}if(pathToName(e.name).endsWith("_s")){a.createTexturesFromSpecular(e);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(o.generateLabPbr,"file.export"),MenuBar.addAction(o.decodeLabPbr,"tools")});L.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});var O=class e{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(d).map(t=>[t,d[t].default??new v.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([t,r])=>[t,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let t=Math.min(1,Math.max(0,a));return new v.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let a="#000000",t=Number(o.brushMetalnessSlider?.get()),r=Number(o.brushRoughnessSlider?.get()??1),n=(o.brushEmissiveColor?.get()??a).toString(),s=Number(o.brushHeightSlider?.get()),l=ColorPanel.get(),i={[d.albedo.id]:new v.Color(l),[d.metalness.id]:e.makeLinearColor(t),[d.roughness.id]:e.makeLinearColor(r),[d.emissive.id]:new v.Color(n??a),[d.height.id]:e.makeLinearColor(s),[d.normal.id]:d.normal.default??new v.Color("#8080ff")};return new e({colors:i})}};var Le=e=>{let a=new v.WebGLRenderer({alpha:!0,antialias:!0}),t=new v.Scene,r=new v.PerspectiveCamera(75,96/96,.1,1e3),n=new v.AmbientLight(16777215,.75);t.add(n);let s=new v.PointLight(16777215,1,100);s.position.set(5,5,5),t.add(s);let l=new v.SphereGeometry(1,32,32),i=new v.MeshStandardMaterial({color:e.albedo,metalness:e.metalness??0,roughness:e.roughness??1,emissive:e.emissive,bumpScale:e.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),h=new v.Mesh(l,i);return t.add(h),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(t,r),a.domElement.toDataURL()},ne="materialBrushPresets",G=()=>JSON.parse(localStorage.getItem(ne)||"{}"),je=(e,a)=>{let t=G(),r=a??guid(),n=o.userMaterialBrushPresets?.getFormResult()??{},s={};return n.albedo&&(s.albedo=n.albedo.toString()),n.metalness&&(s.metalness=Number(n.metalness)),n.roughness&&(s.roughness=Number(n.roughness)),n.emissive&&(s.emissive=n.emissive.toString()),n.height&&(s.height=Number(n.height)),t[r]=[s,e??"New Preset",Le(s)],localStorage.setItem(ne,JSON.stringify(t)),r},se=({metalness:e,roughness:a,emissive:t,height:r,albedo:n})=>{e!==void 0&&o.brushMetalnessSlider?.setValue(e||0,!0),a!==void 0&&o.brushRoughnessSlider?.setValue(a??1,!0),t!==void 0&&o.brushEmissiveColor?.set(t??"#000000"),r!==void 0&&o.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},De=W.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:d}},methods:{applyPreset(e){try{let[a,t]=this.userPresets[e],{metalness:r,roughness:n,emissive:s,height:l,albedo:i}=a;se({metalness:Number(r),roughness:Number(n),emissive:s.toString(),height:Number(l),albedo:i.toString()}),o.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${t}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(e){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let t=G(),r=this.userPresets[e][1]??e;delete t[e],localStorage.setItem("materialBrushPresets",JSON.stringify(t)),this.userPresets=t,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(e){o.userMaterialBrushPresets?.setFormValues({name:this.userPresets[e][1]??e,...this.userPresets[e][0]})},getSummary(e){return Object.entries(e).filter(([a])=>a in this.channels).map(([a,t])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${t}`:`${this.channels[a]?.label??a}: ${Number(t).toFixed(1)}`).join(` +`)}},computed:{presets(){return Object.entries(this.userPresets)}},mounted(){this.userPresets=G()},template:`
-
`});w.push(()=>{s.materialBrushStyles=Blockbench.addCSS(` +
`});C.push(()=>{o.materialBrushStyles=Blockbench.addCSS(` .preset_list { display: grid; grid-template-columns: repeat(auto-fill, 96px); @@ -103,4 +103,4 @@ .delete_preset:hover .material-icons { color: var(--color-accent); } - `),s.brushMetalnessSlider=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",settings:{min:0,max:1,step:.01,default:0},condition:()=>{if(!Project)return!1;let e=Project.selected_texture;return e?.layers_enabled?e.layers.find(({channel:a})=>a===d.metalness.id)!==void 0:!1}}),s.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",settings:{min:0,max:1,step:.01,default:1},condition:()=>{if(!Project)return!1;let e=Project.selected_texture;return e?.layers_enabled?e.layers.find(({channel:a})=>a===d.roughness.id)!==void 0:!1}}),s.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",condition:()=>{if(!Project)return!1;let e=Project.selected_texture;return e?.layers_enabled?e.layers.find(({channel:a})=>a===d.emissive.id)!==void 0:!1}}),s.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",settings:{min:0,max:1,step:.01,default:.5},condition:()=>{if(!Project)return!1;let e=Project.selected_texture;return e?.layers_enabled?e.layers.find(({channel:a})=>a===d.height.id)!==void 0:!1}}),s.materialBrushPresets=new BarSelect("brush_presets",{category:"paint",name:"Material Brush Presets",description:"Select a preset for the material brush",options:{matte:"Matte",gloss:"Gloss",metal:"Dull Metal",polished:"Polished Metal",glowing:"Glowing"},onChange({value:e}){G(e),s.materialBrushTool?.select(),S()}}),s.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",condition:()=>Modes.paint&&!!Project&&Project.selected_texture&&Project.selected_texture.layers_enabled,brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(e,a,t,r,{size:n,softness:o,texture:l}){let i=U.fromSettings(),h=Object.keys(i.colors),p=t;return l.layers.forEach(f=>{if(!f.visible||!h.includes(f.channel))return;let u=i.getChannel(f.channel);u&&(f.ctx.fillStyle=u.getStyle(),f.ctx.fillRect(n*e,n*a,n,n),f.selected&&(p={r:u.r*255,g:u.g*255,b:u.b*255,a:r*255}))}),p}},onCanvasClick(e){Painter.startPaintToolCanvas(e,e.event)},onSelect(){S()},click(){S()}}),s.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:()=>!!Project,click(){s.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:je,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(e){G({metalness:Number(e.metalness??s.brushMetalnessSlider?.get()),roughness:Number(e.roughness??s.brushRoughnessSlider?.get()),emissive:(e.emissive??s.brushEmissiveColor?.get()).toString(),height:Number(e.height??s.brushHeightSlider?.get()),albedo:(e.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(e,a){e===1&&Blockbench.textPrompt("Save Preset","New Preset",t=>{t&&(Ee(t),Blockbench.showQuickMessage(`Preset "${t}" saved`,2e3))})}}).show()}}),MenuBar.addAction(s.materialBrushTool,"tools.0")});E.push(()=>{MenuBar.removeAction("tools.material_brush")});w.push(()=>{s.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Brush"}),new Toolbar("material_brush_presets_toolbar",{id:"material_brush_presets_toolbar",children:["load_brush_preset","brush_presets"],name:"Brush Presets",label:!0})],display_condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});w.push(()=>{s.displaySettingsPanel=new Panel("display_settings",{name:"PBR Display Settings",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});(()=>{let e=()=>{w.forEach(t=>t())},a=()=>{H(),E.forEach(t=>t()),Object.entries(s).forEach(([t,r])=>{try{r?.delete()}catch(n){console.warn(`Failed to delete ${t} action:`,n)}})};BBPlugin.register("pbr_preview",{version:"1.1.0",title:"PBR Features",author:"Jason J. Gardner",description:"Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.",tags:["PBR","RTX","Deferred Rendering"],icon:"icon.png",variant:"both",await_loading:!0,new_repository_format:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.2",onload:e,onunload:a})})();})(); + `),o.brushMetalnessSlider=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",settings:{min:0,max:1,step:.01,default:0},condition:()=>{if(!Project)return!1;let e=Project.selected_texture;return e?.layers_enabled?e.layers.find(({channel:a})=>a===d.metalness.id)!==void 0:!1}}),o.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",settings:{min:0,max:1,step:.01,default:1},condition:()=>{if(!Project)return!1;let e=Project.selected_texture;return e?.layers_enabled?e.layers.find(({channel:a})=>a===d.roughness.id)!==void 0:!1}}),o.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",condition:()=>{if(!Project)return!1;let e=Project.selected_texture;return e?.layers_enabled?e.layers.find(({channel:a})=>a===d.emissive.id)!==void 0:!1}}),o.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",settings:{min:0,max:1,step:.01,default:.5},condition:()=>{if(!Project)return!1;let e=Project.selected_texture;return e?.layers_enabled?e.layers.find(({channel:a})=>a===d.height.id)!==void 0:!1}}),o.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",condition:()=>Modes.paint&&!!Project&&Project.selected_texture&&Project.selected_texture.layers_enabled,brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(e,a,t,r,{size:n,softness:s,texture:l}){let i=O.fromSettings(),h=Object.keys(i.colors),g=t;return l.layers.forEach(p=>{if(!p.visible||!h.includes(p.channel))return;let m=i.getChannel(p.channel);m&&(p.ctx.fillStyle=m.getStyle(),p.ctx.fillRect(n*e,n*a,n,n),p.selected&&(g={r:m.r*255,g:m.g*255,b:m.b*255,a:r*255}))}),g}},onCanvasClick(e){Painter.startPaintToolCanvas(e,e.event)},onSelect(){A()},click(){A()}}),o.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:()=>!!Project,click(){o.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:De,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(e){se({metalness:Number(e.metalness??o.brushMetalnessSlider?.get()),roughness:Number(e.roughness??o.brushRoughnessSlider?.get()),emissive:(e.emissive??o.brushEmissiveColor?.get()).toString(),height:Number(e.height??o.brushHeightSlider?.get()),albedo:(e.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(e,a){e===1&&Blockbench.textPrompt("Save Preset","New Preset",t=>{t&&(je(t),Blockbench.showQuickMessage(`Preset "${t}" saved`,2e3))})}}).show()}}),MenuBar.addAction(o.materialBrushTool,"tools.0")});L.push(()=>{MenuBar.removeAction("tools.material_brush")});C.push(()=>{o.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["load_brush_preset","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Settings",label:!0}),new Toolbar("material_brush_presets_toolbar",{id:"material_brush_presets_toolbar",children:["material_brush","slider_brush_size","slider_brush_opacity","slider_brush_softness"],name:"Brush Settings",label:!0})],condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});C.push(()=>{o.displaySettingsPanel=new Panel("display_settings",{name:"PBR Controls",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure","show_channel_select_menu"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});(()=>{let e=()=>{C.forEach(t=>t())},a=()=>{$(),L.forEach(t=>t()),Object.entries(o).forEach(([t,r])=>{try{r?.delete()}catch(n){console.warn(`Failed to delete ${t} action:`,n)}})};BBPlugin.register("pbr_preview",{version:"1.1.0",title:"PBR Tools",author:"Jason J. Gardner",description:"Create and view PBR materials in Blockbench. Export textures for Java and RenderDragon shaders.",tags:["Minecraft: Java Edition","Minecraft: Bedrock Edition","PBR"],icon:"icon.png",variant:"both",await_loading:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.3",onload:e,onunload:a})})();})(); diff --git a/src/pbr_preview/package.json b/src/pbr_preview/package.json index ce68a85c..ffcc0b20 100644 --- a/src/pbr_preview/package.json +++ b/src/pbr_preview/package.json @@ -5,6 +5,7 @@ "main": "./src/index.ts", "scripts": { "build": "esbuild src/index.ts --bundle --minify --outfile=../../plugins/pbr_preview/pbr_preview.js", + "build:watch": "esbuild src/index.ts --bundle --minify --outfile=../../plugins/pbr_preview/pbr_preview.js --watch", "dev": "esbuild src/index.ts --bundle --sourcemap --outfile=../../plugins/pbr_preview/pbr_preview.js --watch" }, "keywords": [ diff --git a/src/pbr_preview/src/deps.ts b/src/pbr_preview/src/deps.ts index a854a62b..3b00327a 100644 --- a/src/pbr_preview/src/deps.ts +++ b/src/pbr_preview/src/deps.ts @@ -2,6 +2,6 @@ const three = THREE; // @ts-expect-error Vue UMD is OK const vue = Vue; -const bb = Blockbench; +// const bb = Blockbench; -export { three, bb, vue }; +export { three, vue }; diff --git a/src/pbr_preview/src/index.ts b/src/pbr_preview/src/index.ts index c2f011af..949f8211 100644 --- a/src/pbr_preview/src/index.ts +++ b/src/pbr_preview/src/index.ts @@ -34,18 +34,17 @@ import { disablePbr } from "./lib/disablePbr"; BBPlugin.register("pbr_preview", { // @ts-expect-error Version does exist in PluginOptions version: "1.1.0", - title: "PBR Features", + title: "PBR Tools", author: "Jason J. Gardner", description: - "Create RTX/Deferred Rendering textures in Blockbench. Adds support for previewing PBR materials and exporting them in Minecraft-compatible formats.", - tags: ["PBR", "RTX", "Deferred Rendering"], + "Create and view PBR materials in Blockbench. Export textures for Java and RenderDragon shaders.", + tags: ["Minecraft: Java Edition", "Minecraft: Bedrock Edition", "PBR"], icon: "icon.png", variant: "both", await_loading: true, - new_repository_format: true, repository: "https://github.com/jasonjgardner/blockbench-plugins", has_changelog: true, - min_version: "4.10.2", + min_version: "4.10.3", onload, onunload, }); diff --git a/src/pbr_preview/src/lib/PbrMaterials.ts b/src/pbr_preview/src/lib/PbrMaterials.ts index 3f46d015..15a2004c 100644 --- a/src/pbr_preview/src/lib/PbrMaterials.ts +++ b/src/pbr_preview/src/lib/PbrMaterials.ts @@ -62,6 +62,7 @@ export default class PbrMaterial { } getMaterial(options: THREE.MeshStandardMaterialParameters = {}) { + // TODO: Don't lookup MER in Java projects const { emissiveMap, roughnessMap, metalnessMap } = this.merToCanvas(); const normalMap = this.getTexture(CHANNELS.normal); @@ -896,4 +897,100 @@ export default class PbrMaterial { return normalMapTexture; } + + createAoMap(texture: Texture | TextureLayer): Texture | TextureLayer | null { + const textureCtx = texture.canvas.getContext("2d"); + + if (!textureCtx) { + return null; + } + + const width = Math.max( + texture.img.width ?? texture.canvas.width, + Project ? Project.texture_width : 0, + 16 + ); + const height = Math.max( + texture.img.height ?? texture.canvas.height, + Project ? Project.texture_height : 0, + 16 + ); + + const { data: textureData } = textureCtx.getImageData(0, 0, width, height); + + const canvas = document.createElement("canvas"); + const ctx = canvas.getContext("2d"); + + if (!ctx) { + return null; + } + + const getHeight = (x: number, y: number): number => { + const idx = (x + y * width) * 4; + return textureData[idx] / 255; + }; + + canvas.width = width; + canvas.height = height; + + ctx.drawImage(texture.img, 0, 0, width, height); + + const imageData = ctx.getImageData(0, 0, width, height); + + const data = imageData.data; + + for (let y = 0; y < height; y++) { + for (let x = 0; x < width; x++) { + const left = getHeight(Math.max(x - 1, 0), y); + const right = getHeight(Math.min(x + 1, width - 1), y); + const top = getHeight(x, Math.max(y - 1, 0)); + const bottom = getHeight(x, Math.min(y + 1, height - 1)); + + const dx = right - left; + const dy = bottom - top; + + const ao = Math.sqrt(dx * dx + dy * dy) * 255; + + const idx = (y * width + x) * 4; + data[idx] = ao; + data[idx + 1] = ao; + data[idx + 2] = ao; + data[idx + 3] = 255; + } + } + + ctx.putImageData(imageData, 0, 0); + + const dataUrl = canvas.toDataURL(); + + const name = `${texture.name.replace(/_height(map)?/i, "")}_ao`; + + if (texture instanceof TextureLayer) { + const aoMapLayer = new TextureLayer( + { + name, + data_url: dataUrl, + visible: true, + }, + texture.texture + ); + + aoMapLayer.addForEditing(); + + return aoMapLayer; + } + + const aoMapTexture = new Texture({ + name, + saved: false, + particle: false, + keep_size: false, + }).fromDataURL(dataUrl); + + if (Project) { + aoMapTexture.add(); + } + + return aoMapTexture; + } } diff --git a/src/pbr_preview/src/lib/actions/channelAssignment.ts b/src/pbr_preview/src/lib/actions/channelAssignment.ts index 7e53b713..b7b201eb 100644 --- a/src/pbr_preview/src/lib/actions/channelAssignment.ts +++ b/src/pbr_preview/src/lib/actions/channelAssignment.ts @@ -7,12 +7,19 @@ import { teardowns, } from "../../constants"; import { applyPbrMaterial } from "../applyPbrMaterial"; +import { getSelectedTexture } from "../util"; -const channelActions: Record = {}; +/** + * Registry of channel actions\ + * (Not in the same registry as the other actions. Needs its own teardown.) + */ +const channelAssignmentActions: Record = {}; -setups.push(() => { - Object.entries(CHANNELS).forEach(([key, channel]) => { - channelActions[key] = new Action(`assign_channel_${key}`, { +const channelSelectActions: Record = {}; + +Object.entries(CHANNELS).forEach(([key, channel], idx) => { + setups.push(() => { + channelAssignmentActions[key] = new Action(`assign_channel_${key}`, { icon: channel.icon ?? "tv_options_edit_channels", name: `Assign to ${channel.label.toLocaleLowerCase()} channel`, description: `Assign the selected layer to the ${channel.label} channel`, @@ -69,12 +76,61 @@ setups.push(() => { applyPbrMaterial(); }, }); + + channelSelectActions[key] = new Action(`select_channel_${key}`, { + icon: channel.icon ?? "tv_options_edit_channels", + name: channel.label ?? key, + description: `Select the ${channel.label} channel`, + condition: { + project: true, + selected: { + texture: true, + }, + modes: ["paint"], + method() { + const selected = getSelectedTexture(); + const layers = selected?.layers_enabled + ? selected.layers + : Texture.all; + + return layers.some( + (layer: Texture | TextureLayer) => layer.channel === key + ); + }, + }, + click() { + const layers = Texture.selected?.layers_enabled + ? Texture.selected.layers + : Texture.all; + + if (!layers || !layers.length) { + return; + } + + const layer = layers.find( + (layer: TextureLayer) => layer.channel === key + ); + + if (!layer) { + return; + } + + layer.select(); + layer.scrollTo(); + }, + }); + + channelSelectActions[key].addLabel(true, () => channel.label ?? key); }); }); teardowns.push(() => { - Object.entries(channelActions).forEach(([key, action]) => { - action?.delete(); + Object.values(channelAssignmentActions).forEach((action) => { + action.delete(); + }); + + Object.values(channelSelectActions).forEach((action) => { + action.delete(); }); }); @@ -141,13 +197,21 @@ setups.push(() => { } ); + registry.channelSelectionMenu = new Menu( + "channel_selection_menu", + Object.keys(CHANNELS).map((key) => `select_channel_${key}`) + ); + registry.openChannelMenu = new Action("pbr_channel_menu", { name: "Assign to PBR Channel", icon: "texture", click(event) { registry.channelMenu?.open(event as MouseEvent); }, - children: [...Object.values(channelActions), registry.unassignChannel], + children: [ + ...Object.values(channelAssignmentActions), + registry.unassignChannel, + ], }); registry.showChannelMenu = new Action("show_channel_menu", { @@ -165,9 +229,23 @@ setups.push(() => { registry.channelMenu?.open(event as MouseEvent); }, }); -}); -setups.push(() => { + registry.showChannelSelectionMenu = new Action("show_channel_select_menu", { + icon: "tv_options_edit_channels", + name: "Select PBR Channel", + description: "Select a channel to view", + category: "textures", + condition: { + modes: ["paint"], + selected: { + texture: true, + }, + }, + click(event) { + registry.channelSelectionMenu?.open(event as MouseEvent); + }, + }); + if (registry.openChannelMenu) { MenuBar.addAction(registry.openChannelMenu, "image.0"); Texture.prototype.menu.addAction(registry.openChannelMenu, "0"); diff --git a/src/pbr_preview/src/lib/actions/generateNormal.ts b/src/pbr_preview/src/lib/actions/generateNormal.ts index 7043cd1d..a893c1f6 100644 --- a/src/pbr_preview/src/lib/actions/generateNormal.ts +++ b/src/pbr_preview/src/lib/actions/generateNormal.ts @@ -1,6 +1,7 @@ import { registry, setups, teardowns } from "../../constants"; import { CHANNELS } from "../../constants"; import PbrMaterial from "../PbrMaterials"; +import { getSelectedLayer, getSelectedTexture } from "../util"; setups.push(() => { registry.generateNormal = new Action("generate_normal", { @@ -12,11 +13,7 @@ setups.push(() => { undefined, click() { const texture: Texture | TextureLayer = - TextureLayer.selected ?? - (!!Project && Project.selected_texture - ? // @ts-ignore Selected layer does exist on selected_texture property - Project.selected_texture.selected_layer ?? Project.selected_texture - : Texture.getDefault()); + getSelectedLayer() ?? getSelectedTexture() ?? Texture.getDefault(); if (!texture) { return; @@ -26,7 +23,7 @@ setups.push(() => { texture instanceof Texture && texture.layers_enabled ? texture.layers : null, - texture.uuid, + texture.uuid ); const normalMap = mat.createNormalMap(texture); @@ -42,7 +39,61 @@ setups.push(() => { }, }); + registry.generateAo = new Action("generate_ao", { + icon: CHANNELS.ao.icon ?? "motion_mode", + name: "Generate Ambient Occlusion Map", + description: "Generates an ambient occlusion map from the height map", + condition: { + selected: { + texture: true, + }, + project: true, + }, + click() { + const texture: Texture | TextureLayer = + getSelectedLayer() ?? getSelectedTexture() ?? Texture.getDefault(); + + if (!texture) { + return; + } + + const mat = new PbrMaterial( + texture instanceof Texture && texture.layers_enabled + ? texture.layers + : null, + texture.uuid + ); + + const normalMap = + mat.findTexture(CHANNELS.normal) ?? mat.createNormalMap(texture); + + if (!normalMap) { + // TODO: Use Validator + Blockbench.showQuickMessage( + "Unable to generate ambient occlusion map without a normal map", + 2000 + ); + return; + } + + const aoMap = mat.createAoMap(normalMap); + + if (aoMap) { + mat.saveTexture(CHANNELS.ao, aoMap); + aoMap.select(); + Blockbench.showQuickMessage("Ambient occlusion map generated", 2000); + return; + } + + Blockbench.showQuickMessage( + "Failed to generate ambient occlusion map", + 2000 + ); + }, + }); + MenuBar.addAction(registry.generateNormal, "tools"); + MenuBar.addAction(registry.generateAo, "tools"); }); teardowns.push(() => { diff --git a/src/pbr_preview/src/lib/actions/labPbr.ts b/src/pbr_preview/src/lib/actions/labPbr.ts index eca94ec2..2b4ea9c8 100644 --- a/src/pbr_preview/src/lib/actions/labPbr.ts +++ b/src/pbr_preview/src/lib/actions/labPbr.ts @@ -1,5 +1,6 @@ import { registry, setups, teardowns } from "../../constants"; import PbrMaterial from "../PbrMaterials"; +import { getSelectedTexture } from "../util"; const exportNormalMap = ( normalMap: HTMLCanvasElement, @@ -52,14 +53,17 @@ setups.push(() => { project: true, }, async click() { - const selected = Project.selected_texture; + const selected = getSelectedTexture(); + if (!selected) { return; } + const mat = new PbrMaterial( selected.layers_enabled ? selected.layers : [selected], - selected.uuid, + selected.uuid ); + const outputs = mat.createLabPbrOutput(); if (outputs === null) { @@ -83,7 +87,13 @@ setups.push(() => { name: "Decode labPBR textures", description: "Decodes the selected texture into a specular or normal map in labPBR format", - condition: () => !!Project && Project.selected_texture !== null, + condition: { + formats: ["java"], + project: true, + selected: { + texture: true, + }, + }, click() { const selected = TextureLayer.selected?.texture ?? @@ -95,12 +105,12 @@ setups.push(() => { selected.uuid, ); - if (selected.name.endsWith("_n") || selected.name.endsWith("_n.png")) { + if (pathToName(selected.name).endsWith("_n")) { mat.createTexturesFromNormal(selected); return; } - if (selected.name.endsWith("_s") || selected.name.endsWith("_s.png")) { + if (pathToName(selected.name).endsWith("_s")) { mat.createTexturesFromSpecular(selected); return; } diff --git a/src/pbr_preview/src/lib/actions/materialTexture.ts b/src/pbr_preview/src/lib/actions/materialTexture.ts index a7922b62..9fc307e0 100644 --- a/src/pbr_preview/src/lib/actions/materialTexture.ts +++ b/src/pbr_preview/src/lib/actions/materialTexture.ts @@ -27,6 +27,10 @@ setups.push(() => { icon: "stacks", name: "Create Material Texture", description: "Creates a new texture for a PBR material", + condition: { + modes: ["edit", "paint"], + project: true, + }, click() { if (!Project) { return; diff --git a/src/pbr_preview/src/lib/actions/mer.ts b/src/pbr_preview/src/lib/actions/mer.ts index 9e9c13e0..f589fd0e 100644 --- a/src/pbr_preview/src/lib/actions/mer.ts +++ b/src/pbr_preview/src/lib/actions/mer.ts @@ -1,15 +1,16 @@ import { CHANNELS, registry, setups, teardowns } from "../../constants"; import PbrMaterial from "../PbrMaterials"; import { exportMer } from "../mer"; +import { getSelectedTexture } from "../util"; -export function setup() { +setups.push(() => { registry.generateMer = new Action("create_mer", { icon: "lightbulb_circle", name: "Export MER", description: "Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)", condition: { - formats: ["bedrock_block", "bedrock_entity"], + formats: ["bedrock", "bedrock_block"], project: true, }, click() { @@ -23,72 +24,125 @@ export function setup() { }); registry.decodeMer = new Action("decode_mer", { - icon: "arrow_split", name: "Decode MER", - description: - "Decodes a MER texture map into metalness, emissive, and roughness channels", - condition: () => - !!Project && - Project.selected_texture !== null && - !Project.selected_texture.layers_enabled, - click() { - const selected = - TextureLayer.selected?.texture ?? - Texture.all.find((t) => t.selected) ?? - Texture.getDefault(); - - const mat = new PbrMaterial( - selected.layers_enabled ? selected.layers : [selected], - selected.uuid, - ); - - const mer = mat.decodeMer(); - const merChannels = [ - CHANNELS.metalness, - CHANNELS.emissive, - CHANNELS.roughness, - ]; - - Undo.initEdit({ textures: [selected] }); - selected.activateLayers(true); - - merChannels.forEach((channel) => { - const key = channel.id as keyof typeof mer; - const canvas = mer[key]; - - if (!canvas) { - Blockbench.showStatusMessage( - `Failed to decode ${channel.label} channel`, - 3000, + icon: "arrow_split", + condition: { + formats: ["bedrock", "bedrock_block"], + project: true, + selected: { + texture: true, + }, + }, + children: [ + { + icon: "move_item", + name: "Decode MER to Textures", + description: + "Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures", + click() { + const selected = getSelectedTexture() ?? Texture.getDefault(); + + const mat = new PbrMaterial([selected], selected.uuid); + + const mer = mat.decodeMer(); + const merChannels = [ + CHANNELS.metalness, + CHANNELS.emissive, + CHANNELS.roughness, + ]; + + Undo.initEdit({ textures: [selected] }); + + merChannels.forEach((channel) => { + const key = channel.id as keyof typeof mer; + const canvas = mer[key]; + + if (!canvas) { + Blockbench.showStatusMessage( + `Failed to decode ${channel.label} channel`, + 3000 + ); + return; + } + + const texture = new Texture({ + name: `${selected?.name}_${key}`, + keep_size: false, + }).fromDataURL(canvas.toDataURL()); + + texture.add(true); + + mat.saveTexture(channel, texture); + }); + + Undo.finishEdit("Decode MER to textures"); + }, + }, + { + icon: "move_group", + name: "Decode MER to Layers", + description: + "Decodes a MER texture map into metalness, emissive, and roughness channels into material layers", + condition: () => getSelectedTexture()?.layers_enabled === true, + click() { + const selected = + TextureLayer.selected?.texture ?? + Texture.all.find((t) => t.selected) ?? + Texture.getDefault(); + + const mat = new PbrMaterial( + selected.layers_enabled ? selected.layers : [selected], + selected.uuid ); - return; - } - const layer = new TextureLayer( - { - name: `${selected?.name}_${key}`, - data_url: canvas.toDataURL(), - }, - selected, - ); + const mer = mat.decodeMer(); + const merChannels = [ + CHANNELS.metalness, + CHANNELS.emissive, + CHANNELS.roughness, + ]; - mat.saveTexture(channel, layer); + Undo.initEdit({ textures: [selected] }); - layer.addForEditing(); - }); + const copy = selected.selected.activateLayers(true); - Undo.finishEdit("Decode MER"); - }, + merChannels.forEach((channel) => { + const key = channel.id as keyof typeof mer; + const canvas = mer[key]; + + if (!canvas) { + Blockbench.showStatusMessage( + `Failed to decode ${channel.label} channel`, + 3000 + ); + return; + } + + const layer = new TextureLayer( + { + name: `${selected?.name}_${key}`, + data_url: canvas.toDataURL(), + }, + selected + ); + + mat.saveTexture(channel, layer); + + layer.addForEditing(); + }); + + Undo.finishEdit("Decode MER to layers"); + }, + }, + ], + click() {}, }); MenuBar.addAction(registry.decodeMer, "tools"); MenuBar.addAction(registry.generateMer, "file.export"); -} +}); -export function teardown() { +teardowns.push(() => { MenuBar.removeAction(`file.export.create_mer`); MenuBar.removeAction(`tools.decode_mer`); -} - -setups.push(setup); -teardowns.push(teardown); +}); diff --git a/src/pbr_preview/src/lib/actions/textureSet.ts b/src/pbr_preview/src/lib/actions/textureSet.ts index 3d407bd0..9e095f75 100644 --- a/src/pbr_preview/src/lib/actions/textureSet.ts +++ b/src/pbr_preview/src/lib/actions/textureSet.ts @@ -249,7 +249,7 @@ setups.push(() => { createTextureSetDialog(); }, condition: { - formats: ["bedrock_block", "bedrock_entity"], + formats: ["bedrock"], project: true, }, }); diff --git a/src/pbr_preview/src/lib/actions/toggleLights.ts b/src/pbr_preview/src/lib/actions/toggleLights.ts index 73034658..fc0153f4 100644 --- a/src/pbr_preview/src/lib/actions/toggleLights.ts +++ b/src/pbr_preview/src/lib/actions/toggleLights.ts @@ -1,5 +1,5 @@ import { registry, setups, teardowns } from "../../constants"; -import { applyPbrMaterial } from "../applyPbrMaterial"; +import { debounceApplyPbrMaterial } from "../applyPbrMaterial"; setups.push(() => { registry.toggleCorrectLights = new Toggle("correct_lights", { @@ -25,7 +25,7 @@ setups.push(() => { registry.togglePbr?.set(true); } - applyPbrMaterial(); + debounceApplyPbrMaterial(); }, click() {}, }); diff --git a/src/pbr_preview/src/lib/actions/togglePbr.ts b/src/pbr_preview/src/lib/actions/togglePbr.ts index 18dbb147..9401fdc8 100644 --- a/src/pbr_preview/src/lib/actions/togglePbr.ts +++ b/src/pbr_preview/src/lib/actions/togglePbr.ts @@ -15,6 +15,8 @@ const subscribeToEvents: EventName[] = [ "select_preview_scene", "change_texture_path", "select_project", + "load_undo_save", + "add_cube", ]; /** @@ -25,9 +27,7 @@ const renderPbrScene = () => Project && Project.pbr_active && applyPbrMaterial(); const enableListeners = () => { - subscribeToEvents.forEach((event) => { - Blockbench.addListener(event as EventName, renderPbrScene); - }); + Blockbench.on(subscribeToEvents.join(" ") as EventName, renderPbrScene); }; const disableListeners = () => { diff --git a/src/pbr_preview/src/lib/actions/tonemapping.ts b/src/pbr_preview/src/lib/actions/tonemapping.ts index b57bb4f7..1c0f5e12 100644 --- a/src/pbr_preview/src/lib/actions/tonemapping.ts +++ b/src/pbr_preview/src/lib/actions/tonemapping.ts @@ -1,9 +1,12 @@ import { registry, setups } from "../../constants"; import { three as THREE } from "../../deps"; -import { applyPbrMaterial } from "../applyPbrMaterial"; +import { + applyPbrMaterial, + debounceApplyPbrMaterial, +} from "../applyPbrMaterial"; const setPreviewExposure = (value: number) => { - const exposureValue = Math.max(-2, Math.min(2, Number(value))); + const exposureValue = Math.max(-2, Math.min(2, value)); Preview.all.forEach((preview) => { preview.renderer.toneMappingExposure = exposureValue; }); @@ -12,16 +15,19 @@ const setPreviewExposure = (value: number) => { }; setups.push(() => { - registry.exposureSlider = new BarSlider("display_settings_exposure", { + registry.exposureSlider = new NumSlider("display_settings_exposure", { category: "preview", name: "Exposure", description: "Adjusts the exposure of the scene", type: "number", value: 1, icon: "exposure", - step: 0.1, - min: -2, - max: 2, + settings: { + min: -2, + max: 2, + step: 0.01, + default: 1, + }, // condition: () => Number(tonemappingSelect.get()) !== THREE.NoToneMapping, onBefore() { if (Number(registry.tonemappingSelect?.get()) === THREE.NoToneMapping) { @@ -31,11 +37,11 @@ setups.push(() => { // @ts-expect-error Set method exists on the toggle registry.togglePbr?.set(true); }, - onChange({ value }) { - setPreviewExposure(value); + onChange(value) { + setPreviewExposure(Number(value)); }, onAfter() { - applyPbrMaterial(); + debounceApplyPbrMaterial(); }, }); @@ -49,9 +55,9 @@ setups.push(() => { Number(registry.exposureSlider?.get()) !== 1, click() { setPreviewExposure(1); - registry.exposureSlider?.set(1); + registry.exposureSlider?.setValue(1, true); - applyPbrMaterial(); + debounceApplyPbrMaterial(); }, }); @@ -68,18 +74,26 @@ setups.push(() => { [THREE.LinearToneMapping]: "Linear", [THREE.ReinhardToneMapping]: "Reinhard", [THREE.CineonToneMapping]: "Cineon", + [THREE.NeutralToneMapping]: "Neutral", [THREE.ACESFilmicToneMapping]: "ACES", }, onChange({ value }) { - const currentExposure = Number(registry.exposureSlider?.get() ?? 1); + Preview.selected.renderer.toneMapping = Number( + value + ) as THREE.ToneMapping; + + let currentExposure = 1; + if (Preview.selected.renderer.toneMapping === THREE.NoToneMapping) { + registry.exposureSlider?.setValue(currentExposure, true); + } else { + currentExposure = Number(registry.exposureSlider?.get() ?? 1); + } + Preview.all.forEach((preview) => { preview.renderer.toneMapping = Number(value) as THREE.ToneMapping; preview.renderer.toneMappingExposure = currentExposure; }); - Preview.selected.renderer.toneMapping = Number( - value, - ) as THREE.ToneMapping; Preview.selected.renderer.toneMappingExposure = currentExposure; Blockbench.showQuickMessage( diff --git a/src/pbr_preview/src/lib/applyPbrMaterial.ts b/src/pbr_preview/src/lib/applyPbrMaterial.ts index 486edad9..dc15dff2 100644 --- a/src/pbr_preview/src/lib/applyPbrMaterial.ts +++ b/src/pbr_preview/src/lib/applyPbrMaterial.ts @@ -1,5 +1,6 @@ import { three as THREE } from "../deps"; import PbrMaterial from "./PbrMaterials"; +import { debounce } from "./util"; /** * ### Apply PBR Material @@ -26,7 +27,7 @@ export const applyPbrMaterial = ( const face = item.faces[key]; const texture = face.getTexture(); - if (!texture) { + if (!texture || !face.enabled) { return; } @@ -58,3 +59,6 @@ export const applyPbrMaterial = ( Project.pbr_active = materialsSet; }; + +export const debounceApplyPbrMaterial = (wait = 100) => + debounce(applyPbrMaterial, wait); diff --git a/src/pbr_preview/src/lib/panels/materialBrush.ts b/src/pbr_preview/src/lib/panels/materialBrush.ts index 9b02ea30..2644946b 100644 --- a/src/pbr_preview/src/lib/panels/materialBrush.ts +++ b/src/pbr_preview/src/lib/panels/materialBrush.ts @@ -9,22 +9,28 @@ setups.push(() => { new Toolbar("material_brush_toolbar", { id: "material_brush_toolbar", children: [ - "material_brush", + "load_brush_preset", "slider_brush_metalness", "slider_brush_roughness", "brush_emissive_color", "slider_brush_height", ], - name: "Material Brush", + name: "Material Settings", + label: true, }), new Toolbar("material_brush_presets_toolbar", { id: "material_brush_presets_toolbar", - children: ["load_brush_preset", "brush_presets"], - name: "Brush Presets", + children: [ + "material_brush", + "slider_brush_size", + "slider_brush_opacity", + "slider_brush_softness", + ], + name: "Brush Settings", label: true, }), ], - display_condition: { + condition: { modes: ["paint"], project: true, }, diff --git a/src/pbr_preview/src/lib/panels/pbrSettings.ts b/src/pbr_preview/src/lib/panels/pbrSettings.ts index 8ed6a660..f5c34d24 100644 --- a/src/pbr_preview/src/lib/panels/pbrSettings.ts +++ b/src/pbr_preview/src/lib/panels/pbrSettings.ts @@ -4,7 +4,7 @@ import { registry, setups } from "../../constants"; setups.push(() => { registry.displaySettingsPanel = new Panel("display_settings", { - name: "PBR Display Settings", + name: "PBR Controls", id: "display_settings_panel", icon: "display_settings", toolbars: [ @@ -16,6 +16,7 @@ setups.push(() => { "display_settings_tone_mapping", "display_settings_exposure", "display_settings_reset_exposure", + "show_channel_select_menu", ], name: "Display Settings", }), diff --git a/src/pbr_preview/src/lib/tools/materialBrush.ts b/src/pbr_preview/src/lib/tools/materialBrush.ts index 91198ff1..ca11f74a 100644 --- a/src/pbr_preview/src/lib/tools/materialBrush.ts +++ b/src/pbr_preview/src/lib/tools/materialBrush.ts @@ -440,24 +440,6 @@ setups.push(() => { }, }); - registry.materialBrushPresets = new BarSelect("brush_presets", { - category: "paint", - name: "Material Brush Presets", - description: "Select a preset for the material brush", - options: { - matte: "Matte", - gloss: "Gloss", - metal: "Dull Metal", - polished: "Polished Metal", - glowing: "Glowing", - }, - onChange({ value }) { - applyPreset(value); - registry.materialBrushTool?.select(); - applyPbrMaterial(); - }, - }); - registry.materialBrushTool = new Tool("material_brush", { name: "Material Brush", description: "Paints across multiple texture layers", diff --git a/src/pbr_preview/src/lib/util.ts b/src/pbr_preview/src/lib/util.ts index 21ce4dd8..0c66f013 100644 --- a/src/pbr_preview/src/lib/util.ts +++ b/src/pbr_preview/src/lib/util.ts @@ -75,3 +75,15 @@ export function getMaterialsFromProject() { return materials; } + +export function debounce(func: Function, wait: number) { + let timeout: number | undefined; + return function (this: any, ...args: any[]) { + const later = () => { + timeout = undefined; + func.apply(this, args); + }; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + }; +} diff --git a/src/pbr_preview/src/types.d.ts b/src/pbr_preview/src/types.d.ts index 14b2f2cc..e3ff2823 100644 --- a/src/pbr_preview/src/types.d.ts +++ b/src/pbr_preview/src/types.d.ts @@ -50,10 +50,11 @@ export interface IRegistry { createTextureSet: Action; decodeMer: Action; displaySettingsPanel: Panel; - exposureSlider: BarSlider; + exposureSlider: NumSlider; resetExposure: Action; generateMer: Action; generateNormal: Action; + generateAo: Action; generateLabPbr: Action; decodeLabPbr: Action; materialBrushPanel: Panel; From bc191a5a7b3d530f7f56be03f2651c81005ca070 Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 12 Jun 2024 08:41:05 -0500 Subject: [PATCH 18/50] upd: Optimize apply PBR material (#6) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * upd: Material Brush classification - No longer hijacking location of brush sliders - Refactored applyPbrMaterial to include generic meshes - Only auto-decoding MERs in Bedrock projects * upd: Material brush conditions * upd: Optimize face painting 🤡 * fix: Add Bedrock block format to texture set export --- plugins/pbr_preview/pbr_preview.js | 6 +- src/pbr_preview/src/lib/PbrMaterials.ts | 11 +- src/pbr_preview/src/lib/actions/textureSet.ts | 2 +- src/pbr_preview/src/lib/applyPbrMaterial.ts | 118 +++++++++++++----- src/pbr_preview/src/lib/panels/channels.ts | 4 +- .../src/lib/panels/materialBrush.ts | 13 +- .../src/lib/tools/materialBrush.ts | 32 +++-- 7 files changed, 123 insertions(+), 63 deletions(-) diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index 3b1d5a8c..6ce32879 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1,5 +1,5 @@ -"use strict";(()=>{var v=THREE,W=Vue;var N="_NONE_",d={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new v.Color(16777215)},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new v.Color(0)},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new v.Color(0)},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new v.Color(16777215)},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new v.Color(16777215)},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new v.Color("rgb(128, 128, 255)")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new v.Color(16777215)}},o={},C=[],L=[];C.push(()=>{o.channelProp=new Property(TextureLayer,"enum","channel",{default:N,values:Object.keys(d).map(e=>d[e].id),label:"PBR Channel",exposed:!1}),o.textureChannelProp=new Property(Texture,"enum","channel",{default:N,values:Object.keys(d).map(e=>d[e].id),label:"PBR Channel",exposed:!1}),o.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),o.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),o.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"})});var Me=(e=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return e?a.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):a},j=class e{constructor(a,t){this._scope=a??Me(),this._materialUuid=t}merToCanvas(){let a=this.getTexture(d.emissive),t=this.getTexture(d.roughness),r=this.getTexture(d.metalness);if(!a&&!t&&!r){let{metalness:n,emissive:s,roughness:l}=this.decodeMer();n&&(r=e.makePixelatedCanvas(n)),s&&(a=e.makePixelatedCanvas(s)),l&&(t=e.makePixelatedCanvas(l))}return{emissiveMap:a,roughnessMap:t,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:n}=this.merToCanvas(),s=this.getTexture(d.normal);return new v.MeshStandardMaterial({map:this.getTexture(d.albedo)??e.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(l=>l.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(d.ao),bumpMap:this.getTexture(d.height),normalMap:s,normalScale:new v.Vector2(1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}saveTexture(a,t){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=t.uuid,t.extend({channel:a.id}))}findTexture(a,t=!0){if(!Project)return null;let r=this._scope.find(i=>i.channel&&(i.channel===a||i.channel===a.id));if(r)return r;let n=typeof a=="string"?a:a.id;Project.pbr_materials??={};let s=Project.pbr_materials[this._materialUuid];if(!s&&t&&n!==N){let i=new RegExp(`_*${n}(.[^.]+)?$`,"i");return this._scope.find(h=>i.test(h.name))??null}let l=s?.[n];return l?this._scope.find(i=>i.uuid===l)??null:null}static makePixelatedCanvas(a){let t=new v.CanvasTexture(a,void 0,void 0,void 0,v.NearestFilter,v.NearestFilter);return t.needsUpdate=!0,t}getTexture(a){let t=this.findTexture(a);return t?e.makePixelatedCanvas(t.canvas):null}static extractChannel(a,t){let r=a.canvas,n=r.width,s=r.height,l=r.getContext("2d");if(!l||!n||!s)return null;let i=document.createElement("canvas");i.width=n,i.height=s;let h=i.getContext("2d");if(!h)return null;let g={r:0,g:1,b:2,a:3}[t],{data:p}=l.getImageData(0,0,n,s),m=new Uint8ClampedArray(n*s*4);for(let b=0;ba){x[u]=_.data[u],x[u+1]=_.data[u+1],x[u+2]=_.data[u+2],x[u+3]=255;continue}x[u]=0,x[u+1]=0,x[u+2]=0,x[u+3]=255}return g.putImageData(new ImageData(x,i.width,i.height),0,0),{metalness:r,emissive:i,emissiveLevel:n,roughness:s,sss:l}}createMer(a=!1){let t=this.findTexture(d.metalness,a),r=this.findTexture(d.emissive,a),n=this.findTexture(d.roughness,a),s=this.findTexture("sss",!1),l=Math.max(t?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),i=Math.max(t?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),h=document.createElement("canvas");h.width=l,h.height=i;let g=h.getContext("2d");if(!g)return null;let p=t?.img?e.extractChannel(t,"r"):null,m=r?.img?e.extractChannel(r,"g"):null,_=n?.img?e.extractChannel(n,"b"):null,b=s&&s?.img?e.extractChannel(s,"a"):null,x=p?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(l,i),u=m?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(l,i),c=_?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(l,i),f=b?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(new Uint8ClampedArray(l*i*4).fill(255),l,i),y=new Uint8ClampedArray(l*i*4);for(let w=0;w{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createTexturesFromNormal(a){let t=this.decodeLabPbrNormal(a);return Object.entries(t).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createNormalMap(a,t=!1){let r=a.canvas.getContext("2d");if(!r)return null;let n=Math.max(a.img.width??a.canvas.width,Project?Project.texture_width:0,16),s=Math.max(a.img.height??a.canvas.height,Project?Project.texture_height:0,16),{data:l}=r.getImageData(0,0,n,s),i=document.createElement("canvas"),h=i.getContext("2d");if(!h)return null;let g=(c,f)=>{let y=(c+f*n)*4;return l[y]/255};i.width=n,i.height=s,h.drawImage(a.img,0,0,n,s);let p=h.getImageData(0,0,n,s),m=p.data,_=c=>{let f=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);return[c[0]/f,c[1]/f,c[2]/f]};for(let c=0;c{let c=(x+u*r)*4;return s[c]/255};l.width=r,l.height=n,i.drawImage(a.img,0,0,r,n);let g=i.getImageData(0,0,r,n),p=g.data;for(let x=0;x{let x=this.createCanvas(t.width,t.height),u=x.getContext("2d"),c=u.getImageData(0,0,x.width,x.height),f=[Math.cos(b),Math.sin(b),this.lightHeight];for(let y=0;y{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new j(r.layers_enabled?r.layers:Project.textures,r.uuid),s=n.findTexture(d.albedo);if(!s){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let l=n.findTexture(d.normal);if(!l){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let h=new H(e).bake(a,s.canvas,l.canvas),g=new Texture({name:`${s.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(h[0].toDataURL()),p=t?m=>{let _=n.findTexture(d.emissive);if(!_)return m;let b=_.canvas;if(!b.getContext("2d"))return m;let u=Math.max(m.width,b.width,Project?Project.texture_width:16),c=Math.max(m.height,b.height,Project?Project.texture_height:16),f=document.createElement("canvas");f.width=u,f.height=c;let y=f.getContext("2d");return y?(y.drawImage(m,0,0),y.globalCompositeOperation="screen",y.drawImage(b,0,0),f):m}:m=>m;h.forEach((m,_)=>{new TextureLayer({name:`baked_${_+1}`,data_url:p(m).toDataURL()},g).addForEditing()}),g.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};C.push(()=>{o.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(e){let a=new v.Color(e.ambientLight.toString()),t=new v.Color(e.lightDiffuse.toString());K({ambientLight:[a.r,a.g,a.b],lightDiffuse:[t.r,t.g,t.b],lightHeight:Number(e.lightHeight),minLightIntensity:Number(e.minLightIntensity)},e.directions??8,e.blendEmissive??!1)}}),o.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){o.bakeTexturesDialog?.show()}}),MenuBar.addAction(o.bakeTexturesAction,"tools")});L.push(()=>{MenuBar.removeAction("tools.bake_textures")});function S(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(e=>e.selected)??null:Texture.all.find(e=>e.selected)??Texture.getDefault()}function F(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(e=>e.selected)??Project.selected_texture.layers[0]:S()?.getActiveLayer()??null}function X(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(S()?.name??"texture")}function Y(e,a){let t;return function(...r){let n=()=>{t=void 0,e.apply(this,r)};clearTimeout(t),t=setTimeout(n,a)}}var A=e=>{if(!Project||Texture.all.length===0)return;let a=!1;Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(r=>{let n=t.faces[r],s=n.getTexture();if(!s||!n.enabled)return;let l=Project.materials[s.uuid];l.isShaderMaterial&&!Project.bb_materials[s.uuid]&&(Project.bb_materials[s.uuid]=l);let i=new j(s.layers_enabled?s.layers.filter(h=>h.visible)??null:Project.textures,s.uuid).getMaterial(e);i.side=Canvas.getRenderSide(s),Project.materials[s.uuid]=v.ShaderMaterial.prototype.copy.call(i,l),Canvas.updateAllFaces(s),a=!0})}),Project.pbr_active=a},I=(e=100)=>Y(A,e);var z={},Q={};Object.entries(d).forEach(([e,a],t)=>{C.push(()=>{z[e]=new Action(`assign_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:{selected:{texture:!0}},click(r){let n=TextureLayer.selected??(Project?Project.selected_texture:null);if(!n||!Project)return;Undo.initEdit({layers:[n]}),n.extend({channel:a.id});let s=n instanceof TextureLayer?n.texture:n;s.updateChangesAfterEdit(),Project.pbr_materials[s.uuid]||(Project.pbr_materials[s.uuid]={}),Object.entries(Project.pbr_materials[s.uuid]).forEach(([l,i])=>{i===n.uuid&&(delete Project.pbr_materials[s.uuid][l],n.channel=N)}),s.uuid===n.uuid&&(Project.pbr_materials[s.uuid]={}),Project.pbr_materials[s.uuid][e]=n.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${n.name}" to ${a.label} channel`,2e3),A()}}),Q[e]=new Action(`select_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:a.label??e,description:`Select the ${a.label} channel`,condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){let r=S();return(r?.layers_enabled?r.layers:Texture.all).some(s=>s.channel===e)}},click(){let r=Texture.selected?.layers_enabled?Texture.selected.layers:Texture.all;if(!r||!r.length)return;let n=r.find(s=>s.channel===e);n&&(n.select(),n.scrollTo())}}),Q[e].addLabel(!0,()=>a.label??e)})});L.push(()=>{Object.values(z).forEach(e=>{e.delete()}),Object.values(Q).forEach(e=>{e.delete()})});C.push(()=>{o.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:{selected:{texture:!0},method(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);return!e||!Project?!1:e.channel&&e.channel!==N}},click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e||!Project)return;Undo.initEdit({layers:[e]});let a=e instanceof TextureLayer?e.texture:e,t=e.channel;Project.pbr_materials[a.uuid]={},e.channel=N,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${e.name}" from ${t} channel`,2e3),A()}}),o.channelMenu=new Menu("channel_menu",[...Object.keys(d).map(e=>`assign_channel_${e}`),"unassign_channel"],{onOpen(){A()}}),o.channelSelectionMenu=new Menu("channel_selection_menu",Object.keys(d).map(e=>`select_channel_${e}`)),o.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",click(e){o.channelMenu?.open(e)},children:[...Object.values(z),o.unassignChannel]}),o.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(e){o.channelMenu?.open(e)}}),o.showChannelSelectionMenu=new Action("show_channel_select_menu",{icon:"tv_options_edit_channels",name:"Select PBR Channel",description:"Select a channel to view",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(e){o.channelSelectionMenu?.open(e)}}),o.openChannelMenu&&(MenuBar.addAction(o.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(o.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(o.openChannelMenu,"0")),Toolbars.layers.add(o.showChannelMenu,1)});L.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(o.showChannelMenu)});C.push(()=>{o.generateNormal=new Action("generate_normal",{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(e=>e.selected))!==void 0,click(){let e=F()??S()??Texture.getDefault();if(!e)return;let a=new j(e instanceof Texture&&e.layers_enabled?e.layers:null,e.uuid),t=a.createNormalMap(e);if(t){a.saveTexture(d.normal,t),t.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),o.generateAo=new Action("generate_ao",{icon:d.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let e=F()??S()??Texture.getDefault();if(!e)return;let a=new j(e instanceof Texture&&e.layers_enabled?e.layers:null,e.uuid),t=a.findTexture(d.normal)??a.createNormalMap(e);if(!t){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=a.createAoMap(t);if(r){a.saveTexture(d.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),MenuBar.addAction(o.generateNormal,"tools"),MenuBar.addAction(o.generateAo,"tools")});L.push(()=>{MenuBar.removeAction("tools.generate_normal")});var Z=(e,a)=>{let t=a??document.createElement("canvas"),r=t.getContext("2d");if(!r)return null;let n=Math.max(Project?Project.texture_width:16,16),s=Math.max(Project?Project.texture_height:16,16);return t.width=n,t.height=s,r.fillStyle=`rgb(${e.r*255}, ${e.g*255}, ${e.b*255})`,r.fillRect(0,0,n,s),t.toDataURL()};C.push(()=>{o.createMaterialTexture=new Action("create_material_texture",{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let e={...d},a=new Texture({name:"New Material",saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}),t=Texture.all.filter(s=>s.selected||s.multi_selected)??Texture.all,r=Texture.selected?new j(t,Texture.selected.uuid):null;try{let s=r?.findTexture(d.albedo,!0)?.canvas.toDataURL()??Texture.selected?.canvas.toDataURL()??Z(new v.Color(8421504),a.canvas);if(!s)return;a.fromDataURL(s);let l=new TextureLayer({name:e.albedo.label,visible:!0,data_url:s},a);l.extend({channel:e.albedo.id}),l.addForEditing(),l.texture.updateChangesAfterEdit(),delete e.albedo}catch(s){console.warn("Failed to create base color texture",s),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let n=Object.keys(e).map(s=>{let l=d[s],i=r?.findTexture(l,!0),h=i?i.canvas.toDataURL():Z(l.default??new v.Color(0));if(!h)return;let g=new TextureLayer({name:l.label,visible:!0,data_url:h},a);return g.extend({channel:l.id}),g}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:n}),a.add().select(),n.map(s=>s.addForEditing()),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(o.createMaterialTexture,"tools"),Toolbars.texturelist.add(o.createMaterialTexture,3)});L.push(()=>{MenuBar.removeAction("tools.create_material_texture")});var U=(e,a)=>{let t=S(),r=new j(t.layers_enabled?t.layers:Project?Project.textures:null,t.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[s,l]=Project?[e?`${e}_mer`:`${t.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:s,extensions:["png"],resource_id:"mer",savetype:"image",startpath:l},a)})};C.push(()=>{o.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{U()}catch(e){console.error("Failed to export MER map:",e),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),o.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let e=S()??Texture.getDefault(),a=new j([e],e.uuid),t=a.decodeMer(),r=[d.metalness,d.emissive,d.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let s=n.id,l=t[s];if(!l){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let i=new Texture({name:`${e?.name}_${s}`,keep_size:!1}).fromDataURL(l.toDataURL());i.add(!0),a.saveTexture(n,i)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>S()?.layers_enabled===!0,click(){let e=TextureLayer.selected?.texture??Texture.all.find(s=>s.selected)??Texture.getDefault(),a=new j(e.layers_enabled?e.layers:[e],e.uuid),t=a.decodeMer(),r=[d.metalness,d.emissive,d.roughness];Undo.initEdit({textures:[e]});let n=e.selected.activateLayers(!0);r.forEach(s=>{let l=s.id,i=t[l];if(!i){Blockbench.showStatusMessage(`Failed to decode ${s.label} channel`,3e3);return}let h=new TextureLayer({name:`${e?.name}_${l}`,data_url:i.toDataURL()},e);a.saveTexture(s,h),h.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(o.decodeMer,"tools"),MenuBar.addAction(o.generateMer,"file.export")});L.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var Ce=()=>{Project&&Project.textures.forEach(e=>{let a=new j(null,e.uuid),t=a.findTexture(d.normal,!1),r=a.findTexture(d.height,!1),n=a.findTexture(d.albedo,!1),s=a.findTexture(d.metalness,!1)?.name,l=a.findTexture(d.emissive,!1)?.name,i=a.findTexture(d.roughness,!1)?.name,h={};return n||(h.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!s&&!l&&!i&&(h.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},h.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},h.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),t&&(h.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(h.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),t&&r&&(h.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),o.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:h,cancelIndex:1,onConfirm(g){let p=X(),m=s||l||i,_={format_version:"1.16.100","minecraft:texture_set":{color:(n?p:g.baseColor?.toHexString())??p,metalness_emissive_roughness:[g.metalness??0,g.emissive??0,g.roughness??255]}};g.depthMap==="normal"&&t||!r&&t?_["minecraft:texture_set"].normal=`${p}_normal`:(!t||g.depthMap==="heightmap")&&r&&(_["minecraft:texture_set"].heightmap=`${p}_heightmap`);let b=c=>{if(!g.depthMap)return c();let f=g.depthMap==="normal"||g.depthMap&&!r,y=f?t:r;if(!y)return c();Blockbench.export({content:y.canvas.toDataURL()??"",type:"PNG",name:`${p}_${f?"normal":"heightmap"}`,extensions:["png"],resource_id:g.depthMap,startpath:Project.export_path,savetype:"image"},w=>{_["minecraft:texture_set"][f?"normal":"heightmap"]=pathToName(w,!1),c()})},x=c=>{if(!n)return c();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:p,startpath:Project.export_path,savetype:"image"},f=>{_["minecraft:texture_set"].color=pathToName(f,!1),c()})},u=()=>b(()=>{x(()=>{Blockbench.export({content:JSON.stringify(_,null,2),type:"JSON",name:`${p}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),o.textureSetDialog?.hide()})})});if(m){try{U(p,c=>{_["minecraft:texture_set"].metalness_emissive_roughness=pathToName(c,!1),u()})}catch(c){console.warn("Failed to export MER map:",c),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}u()}}),o.textureSetDialog.show()})};C.push(()=>{o.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){Ce()},condition:{formats:["bedrock"],project:!0}}),MenuBar.addAction(o.createTextureSet,"file.export")});L.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});C.push(()=>{o.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(e){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=e}),Preview.selected.renderer.physicallyCorrectLights=e,Blockbench.showQuickMessage(`Physically corrected lighting is now ${e?"enabled":"disabled"}`,2e3),e&&o.togglePbr?.set(!0),I()},click(){}}),MenuBar.addAction(o.toggleCorrectLights,"preview")});L.push(()=>{MenuBar.removeAction("preview.correct_lights")});var $=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(e=>{e instanceof Cube&&Object.keys(e.faces).forEach(a=>{let r=e.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var ee=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],te=()=>Project&&Project.pbr_active&&A(),Te=()=>{Blockbench.on(ee.join(" "),te)},ae=()=>{ee.forEach(e=>{Blockbench.removeListener(e,te)})};C.push(()=>{o.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(e){if(e){A(),Te(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}$(),ae(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(o.togglePbr,"view")});L.push(()=>{ae(),MenuBar.removeAction("view.toggle_pbr")});var re=e=>{let a=Math.max(-2,Math.min(2,e));Preview.all.forEach(t=>{t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};C.push(()=>{o.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(o.tonemappingSelect?.get())===v.NoToneMapping&&o.tonemappingSelect.change(v.LinearToneMapping.toString()),o.togglePbr?.set(!0)},onChange(e){re(Number(e))},onAfter(){I()}}),o.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>o.exposureSlider!==void 0&&Number(o.exposureSlider?.get())!==1,click(){re(1),o.exposureSlider?.setValue(1,!0),I()}}),o.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:v.NoToneMapping,value:Preview.selected.renderer.toneMapping??v.NoToneMapping,icon:"monochrome_photos",options:{[v.NoToneMapping]:"No Tone Mapping",[v.LinearToneMapping]:"Linear",[v.ReinhardToneMapping]:"Reinhard",[v.CineonToneMapping]:"Cineon",[v.NeutralToneMapping]:"Neutral",[v.ACESFilmicToneMapping]:"ACES"},onChange({value:e}){Preview.selected.renderer.toneMapping=Number(e);let a=1;Preview.selected.renderer.toneMapping===v.NoToneMapping?o.exposureSlider?.setValue(a,!0):a=Number(o.exposureSlider?.get()??1),Preview.all.forEach(t=>{t.renderer.toneMapping=Number(e),t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(e)}`,2e3),o.togglePbr&&!o.togglePbr.value&&o.togglePbr.set(!0),A()}})});var Pe=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},Ee=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};C.push(()=>{o.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let e=S();if(!e)return;let t=new j(e.layers_enabled?e.layers:[e],e.uuid).createLabPbrOutput();if(t===null)return;let r=e.name??(Project?Project.getDisplayName():"texture");await Promise.all([Pe(t.normalMap,pathToName(r)),Ee(t.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),o.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let e=TextureLayer.selected?.texture??Texture.all.find(t=>t.selected)??Texture.getDefault(),a=new j(e.layers_enabled?e.layers:[e],e.uuid);if(pathToName(e.name).endsWith("_n")){a.createTexturesFromNormal(e);return}if(pathToName(e.name).endsWith("_s")){a.createTexturesFromSpecular(e);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(o.generateLabPbr,"file.export"),MenuBar.addAction(o.decodeLabPbr,"tools")});L.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});var O=class e{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(d).map(t=>[t,d[t].default??new v.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([t,r])=>[t,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let t=Math.min(1,Math.max(0,a));return new v.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let a="#000000",t=Number(o.brushMetalnessSlider?.get()),r=Number(o.brushRoughnessSlider?.get()??1),n=(o.brushEmissiveColor?.get()??a).toString(),s=Number(o.brushHeightSlider?.get()),l=ColorPanel.get(),i={[d.albedo.id]:new v.Color(l),[d.metalness.id]:e.makeLinearColor(t),[d.roughness.id]:e.makeLinearColor(r),[d.emissive.id]:new v.Color(n??a),[d.height.id]:e.makeLinearColor(s),[d.normal.id]:d.normal.default??new v.Color("#8080ff")};return new e({colors:i})}};var Le=e=>{let a=new v.WebGLRenderer({alpha:!0,antialias:!0}),t=new v.Scene,r=new v.PerspectiveCamera(75,96/96,.1,1e3),n=new v.AmbientLight(16777215,.75);t.add(n);let s=new v.PointLight(16777215,1,100);s.position.set(5,5,5),t.add(s);let l=new v.SphereGeometry(1,32,32),i=new v.MeshStandardMaterial({color:e.albedo,metalness:e.metalness??0,roughness:e.roughness??1,emissive:e.emissive,bumpScale:e.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),h=new v.Mesh(l,i);return t.add(h),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(t,r),a.domElement.toDataURL()},ne="materialBrushPresets",G=()=>JSON.parse(localStorage.getItem(ne)||"{}"),je=(e,a)=>{let t=G(),r=a??guid(),n=o.userMaterialBrushPresets?.getFormResult()??{},s={};return n.albedo&&(s.albedo=n.albedo.toString()),n.metalness&&(s.metalness=Number(n.metalness)),n.roughness&&(s.roughness=Number(n.roughness)),n.emissive&&(s.emissive=n.emissive.toString()),n.height&&(s.height=Number(n.height)),t[r]=[s,e??"New Preset",Le(s)],localStorage.setItem(ne,JSON.stringify(t)),r},se=({metalness:e,roughness:a,emissive:t,height:r,albedo:n})=>{e!==void 0&&o.brushMetalnessSlider?.setValue(e||0,!0),a!==void 0&&o.brushRoughnessSlider?.setValue(a??1,!0),t!==void 0&&o.brushEmissiveColor?.set(t??"#000000"),r!==void 0&&o.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},De=W.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:d}},methods:{applyPreset(e){try{let[a,t]=this.userPresets[e],{metalness:r,roughness:n,emissive:s,height:l,albedo:i}=a;se({metalness:Number(r),roughness:Number(n),emissive:s.toString(),height:Number(l),albedo:i.toString()}),o.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${t}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(e){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let t=G(),r=this.userPresets[e][1]??e;delete t[e],localStorage.setItem("materialBrushPresets",JSON.stringify(t)),this.userPresets=t,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(e){o.userMaterialBrushPresets?.setFormValues({name:this.userPresets[e][1]??e,...this.userPresets[e][0]})},getSummary(e){return Object.entries(e).filter(([a])=>a in this.channels).map(([a,t])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${t}`:`${this.channels[a]?.label??a}: ${Number(t).toFixed(1)}`).join(` -`)}},computed:{presets(){return Object.entries(this.userPresets)}},mounted(){this.userPresets=G()},template:` +"use strict";(()=>{var v=THREE,W=Vue;var N="_NONE_",d={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new v.Color(16777215)},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new v.Color(0)},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new v.Color(0)},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new v.Color(16777215)},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new v.Color(16777215)},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new v.Color("rgb(128, 128, 255)")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new v.Color(16777215)}},o={},C=[],L=[];C.push(()=>{o.channelProp=new Property(TextureLayer,"enum","channel",{default:N,values:Object.keys(d).map(e=>d[e].id),label:"PBR Channel",exposed:!1}),o.textureChannelProp=new Property(Texture,"enum","channel",{default:N,values:Object.keys(d).map(e=>d[e].id),label:"PBR Channel",exposed:!1}),o.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),o.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),o.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"})});var Te=(e=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return e?a.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):a},j=class e{constructor(a,t){this._scope=a??Te(),this._materialUuid=t}merToCanvas(){let a=this.getTexture(d.emissive),t=this.getTexture(d.roughness),r=this.getTexture(d.metalness);if(!a&&!t&&!r){let{metalness:n,emissive:s,roughness:l}=this.decodeMer();n&&(r=e.makePixelatedCanvas(n)),s&&(a=e.makePixelatedCanvas(s)),l&&(t=e.makePixelatedCanvas(l))}return{emissiveMap:a,roughnessMap:t,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(d.emissive),roughnessMap:this.getTexture(d.roughness),metalnessMap:this.getTexture(d.metalness)},s=this.getTexture(d.normal);return new v.MeshStandardMaterial({map:this.getTexture(d.albedo)??e.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(l=>l.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(d.ao),bumpMap:this.getTexture(d.height),normalMap:s,normalScale:new v.Vector2(1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}saveTexture(a,t){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=t.uuid,t.extend({channel:a.id}))}findTexture(a,t=!0){if(!Project)return null;let r=this._scope.find(i=>i.channel&&(i.channel===a||i.channel===a.id));if(r)return r;let n=typeof a=="string"?a:a.id;Project.pbr_materials??={};let s=Project.pbr_materials[this._materialUuid];if(!s&&t&&n!==N){let i=new RegExp(`_*${n}(.[^.]+)?$`,"i");return this._scope.find(h=>i.test(h.name))??null}let l=s?.[n];return l?this._scope.find(i=>i.uuid===l)??null:null}static makePixelatedCanvas(a){let t=new v.CanvasTexture(a,void 0,void 0,void 0,v.NearestFilter,v.NearestFilter);return t.needsUpdate=!0,t}getTexture(a){let t=this.findTexture(a);return t?e.makePixelatedCanvas(t.canvas):null}static extractChannel(a,t){let r=a.canvas,n=r.width,s=r.height,l=r.getContext("2d");if(!l||!n||!s)return null;let i=document.createElement("canvas");i.width=n,i.height=s;let h=i.getContext("2d");if(!h)return null;let g={r:0,g:1,b:2,a:3}[t],{data:p}=l.getImageData(0,0,n,s),m=new Uint8ClampedArray(n*s*4);for(let b=0;ba){x[u]=_.data[u],x[u+1]=_.data[u+1],x[u+2]=_.data[u+2],x[u+3]=255;continue}x[u]=0,x[u+1]=0,x[u+2]=0,x[u+3]=255}return g.putImageData(new ImageData(x,i.width,i.height),0,0),{metalness:r,emissive:i,emissiveLevel:n,roughness:s,sss:l}}createMer(a=!1){let t=this.findTexture(d.metalness,a),r=this.findTexture(d.emissive,a),n=this.findTexture(d.roughness,a),s=this.findTexture("sss",!1),l=Math.max(t?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),i=Math.max(t?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),h=document.createElement("canvas");h.width=l,h.height=i;let g=h.getContext("2d");if(!g)return null;let p=t?.img?e.extractChannel(t,"r"):null,m=r?.img?e.extractChannel(r,"g"):null,_=n?.img?e.extractChannel(n,"b"):null,b=s&&s?.img?e.extractChannel(s,"a"):null,x=p?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(l,i),u=m?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(l,i),c=_?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(l,i),f=b?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(new Uint8ClampedArray(l*i*4).fill(255),l,i),y=new Uint8ClampedArray(l*i*4);for(let M=0;M{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createTexturesFromNormal(a){let t=this.decodeLabPbrNormal(a);return Object.entries(t).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createNormalMap(a,t=!1){let r=a.canvas.getContext("2d");if(!r)return null;let n=Math.max(a.img.width??a.canvas.width,Project?Project.texture_width:0,16),s=Math.max(a.img.height??a.canvas.height,Project?Project.texture_height:0,16),{data:l}=r.getImageData(0,0,n,s),i=document.createElement("canvas"),h=i.getContext("2d");if(!h)return null;let g=(c,f)=>{let y=(c+f*n)*4;return l[y]/255};i.width=n,i.height=s,h.drawImage(a.img,0,0,n,s);let p=h.getImageData(0,0,n,s),m=p.data,_=c=>{let f=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);return[c[0]/f,c[1]/f,c[2]/f]};for(let c=0;c{let c=(x+u*r)*4;return s[c]/255};l.width=r,l.height=n,i.drawImage(a.img,0,0,r,n);let g=i.getImageData(0,0,r,n),p=g.data;for(let x=0;x{let x=this.createCanvas(t.width,t.height),u=x.getContext("2d"),c=u.getImageData(0,0,x.width,x.height),f=[Math.cos(b),Math.sin(b),this.lightHeight];for(let y=0;y{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new j(r.layers_enabled?r.layers:Project.textures,r.uuid),s=n.findTexture(d.albedo);if(!s){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let l=n.findTexture(d.normal);if(!l){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let h=new H(e).bake(a,s.canvas,l.canvas),g=new Texture({name:`${s.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(h[0].toDataURL()),p=t?m=>{let _=n.findTexture(d.emissive);if(!_)return m;let b=_.canvas;if(!b.getContext("2d"))return m;let u=Math.max(m.width,b.width,Project?Project.texture_width:16),c=Math.max(m.height,b.height,Project?Project.texture_height:16),f=document.createElement("canvas");f.width=u,f.height=c;let y=f.getContext("2d");return y?(y.drawImage(m,0,0),y.globalCompositeOperation="screen",y.drawImage(b,0,0),f):m}:m=>m;h.forEach((m,_)=>{new TextureLayer({name:`baked_${_+1}`,data_url:p(m).toDataURL()},g).addForEditing()}),g.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};C.push(()=>{o.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(e){let a=new v.Color(e.ambientLight.toString()),t=new v.Color(e.lightDiffuse.toString());K({ambientLight:[a.r,a.g,a.b],lightDiffuse:[t.r,t.g,t.b],lightHeight:Number(e.lightHeight),minLightIntensity:Number(e.minLightIntensity)},e.directions??8,e.blendEmissive??!1)}}),o.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){o.bakeTexturesDialog?.show()}}),MenuBar.addAction(o.bakeTexturesAction,"tools")});L.push(()=>{MenuBar.removeAction("tools.bake_textures")});function S(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(e=>e.selected)??null:Texture.all.find(e=>e.selected)??Texture.getDefault()}function O(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(e=>e.selected)??Project.selected_texture.layers[0]:S()?.getActiveLayer()??null}function X(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(S()?.name??"texture")}function Y(e,a){let t;return function(...r){let n=()=>{t=void 0,e.apply(this,r)};clearTimeout(t),t=setTimeout(n,a)}}function Z(e,a){let t=e.getTexture();if(!t||!Project)return null;let r=Project.materials[t.uuid];r.isShaderMaterial&&!Project.bb_materials[t.uuid]&&(Project.bb_materials[t.uuid]=r);let n=new j(t.layers_enabled?t.layers.filter(s=>s.visible)??null:Project.textures,t.uuid).getMaterial(a);return n.side=Canvas.getRenderSide(t),Project.materials[t.uuid]=v.ShaderMaterial.prototype.copy.call(n,r),t}function ee(e){return Object.values(e).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function Pe(e,a){let t={};return e.forAllFaces(r=>{let n=Z(r,a);n&&(t[n.uuid]=n)}),ee(t)}function Ee(e,a){let t={};return Object.keys(e.faces).forEach(r=>{let n=e.faces[r],s=Z(n,a);s&&(t[s.uuid]=s)}),ee(t)}var A=(e={})=>{if(!Project||Texture.all.length===0)return;let a=!1;Project.elements.forEach(t=>{if(t instanceof Mesh&&Pe(t,e)){a=!0;return}t instanceof Cube&&Ee(t,e)&&(a=!0)}),Project.pbr_active=a},B=(e=100)=>Y(A,e);var G={},Q={};Object.entries(d).forEach(([e,a],t)=>{C.push(()=>{G[e]=new Action(`assign_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:{selected:{texture:!0}},click(r){let n=TextureLayer.selected??(Project?Project.selected_texture:null);if(!n||!Project)return;Undo.initEdit({layers:[n]}),n.extend({channel:a.id});let s=n instanceof TextureLayer?n.texture:n;s.updateChangesAfterEdit(),Project.pbr_materials[s.uuid]||(Project.pbr_materials[s.uuid]={}),Object.entries(Project.pbr_materials[s.uuid]).forEach(([l,i])=>{i===n.uuid&&(delete Project.pbr_materials[s.uuid][l],n.channel=N)}),s.uuid===n.uuid&&(Project.pbr_materials[s.uuid]={}),Project.pbr_materials[s.uuid][e]=n.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${n.name}" to ${a.label} channel`,2e3),A()}}),Q[e]=new Action(`select_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:a.label??e,description:`Select the ${a.label} channel`,condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){let r=S();return(r?.layers_enabled?r.layers:Texture.all).some(s=>s.channel===e)}},click(){let r=Texture.selected?.layers_enabled?Texture.selected.layers:Texture.all;if(!r||!r.length)return;let n=r.find(s=>s.channel===e);n&&(n.select(),n.scrollTo())}}),Q[e].addLabel(!0,()=>a.label??e)})});L.push(()=>{Object.values(G).forEach(e=>{e.delete()}),Object.values(Q).forEach(e=>{e.delete()})});C.push(()=>{o.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:{selected:{texture:!0},method(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);return!e||!Project?!1:e.channel&&e.channel!==N}},click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e||!Project)return;Undo.initEdit({layers:[e]});let a=e instanceof TextureLayer?e.texture:e,t=e.channel;Project.pbr_materials[a.uuid]={},e.channel=N,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${e.name}" from ${t} channel`,2e3),A()}}),o.channelMenu=new Menu("channel_menu",[...Object.keys(d).map(e=>`assign_channel_${e}`),"unassign_channel"],{onOpen(){A()}}),o.channelSelectionMenu=new Menu("channel_selection_menu",Object.keys(d).map(e=>`select_channel_${e}`)),o.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",click(e){o.channelMenu?.open(e)},children:[...Object.values(G),o.unassignChannel]}),o.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(e){o.channelMenu?.open(e)}}),o.showChannelSelectionMenu=new Action("show_channel_select_menu",{icon:"tv_options_edit_channels",name:"Select PBR Channel",description:"Select a channel to view",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(e){o.channelSelectionMenu?.open(e)}}),o.openChannelMenu&&(MenuBar.addAction(o.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(o.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(o.openChannelMenu,"0")),Toolbars.layers.add(o.showChannelMenu,1)});L.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(o.showChannelMenu)});C.push(()=>{o.generateNormal=new Action("generate_normal",{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(e=>e.selected))!==void 0,click(){let e=O()??S()??Texture.getDefault();if(!e)return;let a=new j(e instanceof Texture&&e.layers_enabled?e.layers:null,e.uuid),t=a.createNormalMap(e);if(t){a.saveTexture(d.normal,t),t.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),o.generateAo=new Action("generate_ao",{icon:d.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let e=O()??S()??Texture.getDefault();if(!e)return;let a=new j(e instanceof Texture&&e.layers_enabled?e.layers:null,e.uuid),t=a.findTexture(d.normal)??a.createNormalMap(e);if(!t){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=a.createAoMap(t);if(r){a.saveTexture(d.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),MenuBar.addAction(o.generateNormal,"tools"),MenuBar.addAction(o.generateAo,"tools")});L.push(()=>{MenuBar.removeAction("tools.generate_normal")});var te=(e,a)=>{let t=a??document.createElement("canvas"),r=t.getContext("2d");if(!r)return null;let n=Math.max(Project?Project.texture_width:16,16),s=Math.max(Project?Project.texture_height:16,16);return t.width=n,t.height=s,r.fillStyle=`rgb(${e.r*255}, ${e.g*255}, ${e.b*255})`,r.fillRect(0,0,n,s),t.toDataURL()};C.push(()=>{o.createMaterialTexture=new Action("create_material_texture",{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let e={...d},a=new Texture({name:"New Material",saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}),t=Texture.all.filter(s=>s.selected||s.multi_selected)??Texture.all,r=Texture.selected?new j(t,Texture.selected.uuid):null;try{let s=r?.findTexture(d.albedo,!0)?.canvas.toDataURL()??Texture.selected?.canvas.toDataURL()??te(new v.Color(8421504),a.canvas);if(!s)return;a.fromDataURL(s);let l=new TextureLayer({name:e.albedo.label,visible:!0,data_url:s},a);l.extend({channel:e.albedo.id}),l.addForEditing(),l.texture.updateChangesAfterEdit(),delete e.albedo}catch(s){console.warn("Failed to create base color texture",s),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let n=Object.keys(e).map(s=>{let l=d[s],i=r?.findTexture(l,!0),h=i?i.canvas.toDataURL():te(l.default??new v.Color(0));if(!h)return;let g=new TextureLayer({name:l.label,visible:!0,data_url:h},a);return g.extend({channel:l.id}),g}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:n}),a.add().select(),n.map(s=>s.addForEditing()),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(o.createMaterialTexture,"tools"),Toolbars.texturelist.add(o.createMaterialTexture,3)});L.push(()=>{MenuBar.removeAction("tools.create_material_texture")});var U=(e,a)=>{let t=S(),r=new j(t.layers_enabled?t.layers:Project?Project.textures:null,t.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[s,l]=Project?[e?`${e}_mer`:`${t.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:s,extensions:["png"],resource_id:"mer",savetype:"image",startpath:l},a)})};C.push(()=>{o.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{U()}catch(e){console.error("Failed to export MER map:",e),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),o.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let e=S()??Texture.getDefault(),a=new j([e],e.uuid),t=a.decodeMer(),r=[d.metalness,d.emissive,d.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let s=n.id,l=t[s];if(!l){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let i=new Texture({name:`${e?.name}_${s}`,keep_size:!1}).fromDataURL(l.toDataURL());i.add(!0),a.saveTexture(n,i)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>S()?.layers_enabled===!0,click(){let e=TextureLayer.selected?.texture??Texture.all.find(s=>s.selected)??Texture.getDefault(),a=new j(e.layers_enabled?e.layers:[e],e.uuid),t=a.decodeMer(),r=[d.metalness,d.emissive,d.roughness];Undo.initEdit({textures:[e]});let n=e.selected.activateLayers(!0);r.forEach(s=>{let l=s.id,i=t[l];if(!i){Blockbench.showStatusMessage(`Failed to decode ${s.label} channel`,3e3);return}let h=new TextureLayer({name:`${e?.name}_${l}`,data_url:i.toDataURL()},e);a.saveTexture(s,h),h.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(o.decodeMer,"tools"),MenuBar.addAction(o.generateMer,"file.export")});L.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var Le=()=>{Project&&Project.textures.forEach(e=>{let a=new j(null,e.uuid),t=a.findTexture(d.normal,!1),r=a.findTexture(d.height,!1),n=a.findTexture(d.albedo,!1),s=a.findTexture(d.metalness,!1)?.name,l=a.findTexture(d.emissive,!1)?.name,i=a.findTexture(d.roughness,!1)?.name,h={};return n||(h.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!s&&!l&&!i&&(h.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},h.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},h.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),t&&(h.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(h.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),t&&r&&(h.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),o.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:h,cancelIndex:1,onConfirm(g){let p=X(),m=s||l||i,_={format_version:"1.16.100","minecraft:texture_set":{color:(n?p:g.baseColor?.toHexString())??p,metalness_emissive_roughness:[g.metalness??0,g.emissive??0,g.roughness??255]}};g.depthMap==="normal"&&t||!r&&t?_["minecraft:texture_set"].normal=`${p}_normal`:(!t||g.depthMap==="heightmap")&&r&&(_["minecraft:texture_set"].heightmap=`${p}_heightmap`);let b=c=>{if(!g.depthMap)return c();let f=g.depthMap==="normal"||g.depthMap&&!r,y=f?t:r;if(!y)return c();Blockbench.export({content:y.canvas.toDataURL()??"",type:"PNG",name:`${p}_${f?"normal":"heightmap"}`,extensions:["png"],resource_id:g.depthMap,startpath:Project.export_path,savetype:"image"},M=>{_["minecraft:texture_set"][f?"normal":"heightmap"]=pathToName(M,!1),c()})},x=c=>{if(!n)return c();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:p,startpath:Project.export_path,savetype:"image"},f=>{_["minecraft:texture_set"].color=pathToName(f,!1),c()})},u=()=>b(()=>{x(()=>{Blockbench.export({content:JSON.stringify(_,null,2),type:"JSON",name:`${p}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),o.textureSetDialog?.hide()})})});if(m){try{U(p,c=>{_["minecraft:texture_set"].metalness_emissive_roughness=pathToName(c,!1),u()})}catch(c){console.warn("Failed to export MER map:",c),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}u()}}),o.textureSetDialog.show()})};C.push(()=>{o.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){Le()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(o.createTextureSet,"file.export")});L.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});C.push(()=>{o.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(e){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=e}),Preview.selected.renderer.physicallyCorrectLights=e,Blockbench.showQuickMessage(`Physically corrected lighting is now ${e?"enabled":"disabled"}`,2e3),e&&o.togglePbr?.set(!0),B()},click(){}}),MenuBar.addAction(o.toggleCorrectLights,"preview")});L.push(()=>{MenuBar.removeAction("preview.correct_lights")});var $=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(e=>{e instanceof Cube&&Object.keys(e.faces).forEach(a=>{let r=e.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var ae=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],re=()=>Project&&Project.pbr_active&&A(),je=()=>{Blockbench.on(ae.join(" "),re)},ne=()=>{ae.forEach(e=>{Blockbench.removeListener(e,re)})};C.push(()=>{o.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(e){if(e){A(),je(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}$(),ne(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(o.togglePbr,"view")});L.push(()=>{ne(),MenuBar.removeAction("view.toggle_pbr")});var se=e=>{let a=Math.max(-2,Math.min(2,e));Preview.all.forEach(t=>{t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};C.push(()=>{o.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(o.tonemappingSelect?.get())===v.NoToneMapping&&o.tonemappingSelect.change(v.LinearToneMapping.toString()),o.togglePbr?.set(!0)},onChange(e){se(Number(e))},onAfter(){B()}}),o.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>o.exposureSlider!==void 0&&Number(o.exposureSlider?.get())!==1,click(){se(1),o.exposureSlider?.setValue(1,!0),B()}}),o.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:v.NoToneMapping,value:Preview.selected.renderer.toneMapping??v.NoToneMapping,icon:"monochrome_photos",options:{[v.NoToneMapping]:"No Tone Mapping",[v.LinearToneMapping]:"Linear",[v.ReinhardToneMapping]:"Reinhard",[v.CineonToneMapping]:"Cineon",[v.NeutralToneMapping]:"Neutral",[v.ACESFilmicToneMapping]:"ACES"},onChange({value:e}){Preview.selected.renderer.toneMapping=Number(e);let a=1;Preview.selected.renderer.toneMapping===v.NoToneMapping?o.exposureSlider?.setValue(a,!0):a=Number(o.exposureSlider?.get()??1),Preview.all.forEach(t=>{t.renderer.toneMapping=Number(e),t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(e)}`,2e3),o.togglePbr&&!o.togglePbr.value&&o.togglePbr.set(!0),A()}})});var De=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},ke=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};C.push(()=>{o.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let e=S();if(!e)return;let t=new j(e.layers_enabled?e.layers:[e],e.uuid).createLabPbrOutput();if(t===null)return;let r=e.name??(Project?Project.getDisplayName():"texture");await Promise.all([De(t.normalMap,pathToName(r)),ke(t.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),o.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let e=TextureLayer.selected?.texture??Texture.all.find(t=>t.selected)??Texture.getDefault(),a=new j(e.layers_enabled?e.layers:[e],e.uuid);if(pathToName(e.name).endsWith("_n")){a.createTexturesFromNormal(e);return}if(pathToName(e.name).endsWith("_s")){a.createTexturesFromSpecular(e);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(o.generateLabPbr,"file.export"),MenuBar.addAction(o.decodeLabPbr,"tools")});L.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});var F=class e{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(d).map(t=>[t,d[t].default??new v.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([t,r])=>[t,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let t=Math.min(1,Math.max(0,a));return new v.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let a="#000000",t=Number(o.brushMetalnessSlider?.get()),r=Number(o.brushRoughnessSlider?.get()??1),n=(o.brushEmissiveColor?.get()??a).toString(),s=Number(o.brushHeightSlider?.get()),l=ColorPanel.get(),i={[d.albedo.id]:new v.Color(l),[d.metalness.id]:e.makeLinearColor(t),[d.roughness.id]:e.makeLinearColor(r),[d.emissive.id]:new v.Color(n??a),[d.height.id]:e.makeLinearColor(s),[d.normal.id]:d.normal.default??new v.Color("#8080ff")};return new e({colors:i})}};var Se=e=>{let a=new v.WebGLRenderer({alpha:!0,antialias:!0}),t=new v.Scene,r=new v.PerspectiveCamera(75,96/96,.1,1e3),n=new v.AmbientLight(16777215,.75);t.add(n);let s=new v.PointLight(16777215,1,100);s.position.set(5,5,5),t.add(s);let l=new v.SphereGeometry(1,32,32),i=new v.MeshStandardMaterial({color:e.albedo,metalness:e.metalness??0,roughness:e.roughness??1,emissive:e.emissive,bumpScale:e.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),h=new v.Mesh(l,i);return t.add(h),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(t,r),a.domElement.toDataURL()},oe="materialBrushPresets",z=()=>JSON.parse(localStorage.getItem(oe)||"{}"),Ae=(e,a)=>{let t=z(),r=a??guid(),n=o.userMaterialBrushPresets?.getFormResult()??{},s={};return n.albedo&&(s.albedo=n.albedo.toString()),n.metalness&&(s.metalness=Number(n.metalness)),n.roughness&&(s.roughness=Number(n.roughness)),n.emissive&&(s.emissive=n.emissive.toString()),n.height&&(s.height=Number(n.height)),t[r]=[s,e??"New Preset",Se(s)],localStorage.setItem(oe,JSON.stringify(t)),r},ie=({metalness:e,roughness:a,emissive:t,height:r,albedo:n})=>{e!==void 0&&o.brushMetalnessSlider?.setValue(e||0,!0),a!==void 0&&o.brushRoughnessSlider?.setValue(a??1,!0),t!==void 0&&o.brushEmissiveColor?.set(t??"#000000"),r!==void 0&&o.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},Ne=W.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:d}},methods:{applyPreset(e){try{let[a,t]=this.userPresets[e],{metalness:r,roughness:n,emissive:s,height:l,albedo:i}=a;ie({metalness:Number(r),roughness:Number(n),emissive:s.toString(),height:Number(l),albedo:i.toString()}),o.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${t}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(e){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let t=z(),r=this.userPresets[e][1]??e;delete t[e],localStorage.setItem("materialBrushPresets",JSON.stringify(t)),this.userPresets=t,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(e){o.userMaterialBrushPresets?.setFormValues({name:this.userPresets[e][1]??e,...this.userPresets[e][0]})},getSummary(e){return Object.entries(e).filter(([a])=>a in this.channels).map(([a,t])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${t}`:`${this.channels[a]?.label??a}: ${Number(t).toFixed(1)}`).join(` +`)}},computed:{presets(){return Object.entries(this.userPresets)}},mounted(){this.userPresets=z()},template:`
  • {if(!Project)return!1;let e=Project.selected_texture;return e?.layers_enabled?e.layers.find(({channel:a})=>a===d.metalness.id)!==void 0:!1}}),o.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",settings:{min:0,max:1,step:.01,default:1},condition:()=>{if(!Project)return!1;let e=Project.selected_texture;return e?.layers_enabled?e.layers.find(({channel:a})=>a===d.roughness.id)!==void 0:!1}}),o.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",condition:()=>{if(!Project)return!1;let e=Project.selected_texture;return e?.layers_enabled?e.layers.find(({channel:a})=>a===d.emissive.id)!==void 0:!1}}),o.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",settings:{min:0,max:1,step:.01,default:.5},condition:()=>{if(!Project)return!1;let e=Project.selected_texture;return e?.layers_enabled?e.layers.find(({channel:a})=>a===d.height.id)!==void 0:!1}}),o.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",condition:()=>Modes.paint&&!!Project&&Project.selected_texture&&Project.selected_texture.layers_enabled,brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(e,a,t,r,{size:n,softness:s,texture:l}){let i=O.fromSettings(),h=Object.keys(i.colors),g=t;return l.layers.forEach(p=>{if(!p.visible||!h.includes(p.channel))return;let m=i.getChannel(p.channel);m&&(p.ctx.fillStyle=m.getStyle(),p.ctx.fillRect(n*e,n*a,n,n),p.selected&&(g={r:m.r*255,g:m.g*255,b:m.b*255,a:r*255}))}),g}},onCanvasClick(e){Painter.startPaintToolCanvas(e,e.event)},onSelect(){A()},click(){A()}}),o.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:()=>!!Project,click(){o.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:De,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(e){se({metalness:Number(e.metalness??o.brushMetalnessSlider?.get()),roughness:Number(e.roughness??o.brushRoughnessSlider?.get()),emissive:(e.emissive??o.brushEmissiveColor?.get()).toString(),height:Number(e.height??o.brushHeightSlider?.get()),albedo:(e.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(e,a){e===1&&Blockbench.textPrompt("Save Preset","New Preset",t=>{t&&(je(t),Blockbench.showQuickMessage(`Preset "${t}" saved`,2e3))})}}).show()}}),MenuBar.addAction(o.materialBrushTool,"tools.0")});L.push(()=>{MenuBar.removeAction("tools.material_brush")});C.push(()=>{o.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["load_brush_preset","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Settings",label:!0}),new Toolbar("material_brush_presets_toolbar",{id:"material_brush_presets_toolbar",children:["material_brush","slider_brush_size","slider_brush_opacity","slider_brush_softness"],name:"Brush Settings",label:!0})],condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});C.push(()=>{o.displaySettingsPanel=new Panel("display_settings",{name:"PBR Controls",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure","show_channel_select_menu"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});(()=>{let e=()=>{C.forEach(t=>t())},a=()=>{$(),L.forEach(t=>t()),Object.entries(o).forEach(([t,r])=>{try{r?.delete()}catch(n){console.warn(`Failed to delete ${t} action:`,n)}})};BBPlugin.register("pbr_preview",{version:"1.1.0",title:"PBR Tools",author:"Jason J. Gardner",description:"Create and view PBR materials in Blockbench. Export textures for Java and RenderDragon shaders.",tags:["Minecraft: Java Edition","Minecraft: Bedrock Edition","PBR"],icon:"icon.png",variant:"both",await_loading:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.3",onload:e,onunload:a})})();})(); + `),o.brushMetalnessSlider=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",settings:{min:0,max:1,step:.01,default:0},condition:()=>{if(!Project)return!1;let e=Project.selected_texture;return e?.layers_enabled?e.layers.find(({channel:a})=>a===d.metalness.id)!==void 0:!1}}),o.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",settings:{min:0,max:1,step:.01,default:1},condition:()=>{if(!Project)return!1;let e=Project.selected_texture;return e?.layers_enabled?e.layers.find(({channel:a})=>a===d.roughness.id)!==void 0:!1}}),o.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",condition:()=>{if(!Project)return!1;let e=Project.selected_texture;return e?.layers_enabled?e.layers.find(({channel:a})=>a===d.emissive.id)!==void 0:!1}}),o.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",settings:{min:0,max:1,step:.01,default:.5},condition:()=>{if(!Project)return!1;let e=Project.selected_texture;return e?.layers_enabled?e.layers.find(({channel:a})=>a===d.height.id)!==void 0:!1}}),o.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",category:"tools",toolbar:"brush",condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){return S()?.layers_enabled??!1}},allowed_view_modes:"textured",brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(e,a,t,r,{size:n,softness:s,texture:l}){let i=F.fromSettings(),h=Object.keys(i.colors),g=t;return l.layers.forEach(p=>{if(!p.visible||!h.includes(p.channel))return;let m=i.getChannel(p.channel);m&&(p.ctx.fillStyle=m.getStyle(),p.ctx.fillRect(n*e,n*a,n,n),p.selected&&(g={r:m.r*255,g:m.g*255,b:m.b*255,a:r*255}))}),g}},onCanvasClick(e){Painter.startPaintToolCanvas(e,e.event)},onSelect(){Painter.updateNslideValues(),A()},click(){B()}}),o.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:{project:!0},click(){o.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:Ne,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(e){ie({metalness:Number(e.metalness??o.brushMetalnessSlider?.get()),roughness:Number(e.roughness??o.brushRoughnessSlider?.get()),emissive:(e.emissive??o.brushEmissiveColor?.get()).toString(),height:Number(e.height??o.brushHeightSlider?.get()),albedo:(e.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(e,a){e===1&&Blockbench.textPrompt("Save Preset","New Preset",t=>{t&&(Ae(t),Blockbench.showQuickMessage(`Preset "${t}" saved`,2e3))})}}).show()}}),MenuBar.addAction(o.materialBrushTool,"tools.0")});L.push(()=>{MenuBar.removeAction("tools.material_brush")});C.push(()=>{o.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","load_brush_preset","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Settings"})],condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});C.push(()=>{o.displaySettingsPanel=new Panel("display_settings",{name:"PBR Controls",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure","show_channel_select_menu"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});(()=>{let e=()=>{C.forEach(t=>t())},a=()=>{$(),L.forEach(t=>t()),Object.entries(o).forEach(([t,r])=>{try{r?.delete()}catch(n){console.warn(`Failed to delete ${t} action:`,n)}})};BBPlugin.register("pbr_preview",{version:"1.1.0",title:"PBR Tools",author:"Jason J. Gardner",description:"Create and view PBR materials in Blockbench. Export textures for Java and RenderDragon shaders.",tags:["Minecraft: Java Edition","Minecraft: Bedrock Edition","PBR"],icon:"icon.png",variant:"both",await_loading:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.3",onload:e,onunload:a})})();})(); diff --git a/src/pbr_preview/src/lib/PbrMaterials.ts b/src/pbr_preview/src/lib/PbrMaterials.ts index 15a2004c..8d8aac1f 100644 --- a/src/pbr_preview/src/lib/PbrMaterials.ts +++ b/src/pbr_preview/src/lib/PbrMaterials.ts @@ -62,8 +62,15 @@ export default class PbrMaterial { } getMaterial(options: THREE.MeshStandardMaterialParameters = {}) { - // TODO: Don't lookup MER in Java projects - const { emissiveMap, roughnessMap, metalnessMap } = this.merToCanvas(); + const { emissiveMap, roughnessMap, metalnessMap } = Format.id.startsWith( + "bedrock" + ) + ? this.merToCanvas() + : { + emissiveMap: this.getTexture(CHANNELS.emissive), + roughnessMap: this.getTexture(CHANNELS.roughness), + metalnessMap: this.getTexture(CHANNELS.metalness), + }; const normalMap = this.getTexture(CHANNELS.normal); diff --git a/src/pbr_preview/src/lib/actions/textureSet.ts b/src/pbr_preview/src/lib/actions/textureSet.ts index 9e095f75..af3fd2bf 100644 --- a/src/pbr_preview/src/lib/actions/textureSet.ts +++ b/src/pbr_preview/src/lib/actions/textureSet.ts @@ -249,7 +249,7 @@ setups.push(() => { createTextureSetDialog(); }, condition: { - formats: ["bedrock"], + formats: ["bedrock", "bedrock_block"], project: true, }, }); diff --git a/src/pbr_preview/src/lib/applyPbrMaterial.ts b/src/pbr_preview/src/lib/applyPbrMaterial.ts index dc15dff2..6f94129f 100644 --- a/src/pbr_preview/src/lib/applyPbrMaterial.ts +++ b/src/pbr_preview/src/lib/applyPbrMaterial.ts @@ -2,6 +2,86 @@ import { three as THREE } from "../deps"; import PbrMaterial from "./PbrMaterials"; import { debounce } from "./util"; +function applyToFace( + face: CubeFace | MeshFace, + materialParams: THREE.MeshStandardMaterialParameters +) { + const texture = face.getTexture(); + + if (!texture || !Project) { + return null; + } + + const projectMaterial = Project.materials[texture.uuid]; + + if (projectMaterial.isShaderMaterial && !Project.bb_materials[texture.uuid]) { + Project.bb_materials[texture.uuid] = projectMaterial; + } + + const material = new PbrMaterial( + texture.layers_enabled + ? texture.layers.filter((layer) => layer.visible) ?? null + : Project.textures, + texture.uuid + ).getMaterial(materialParams); + + material.side = Canvas.getRenderSide(texture) as THREE.Side; + + Project.materials[texture.uuid] = THREE.ShaderMaterial.prototype.copy.call( + material, + projectMaterial + ); + + return texture; +} + +function updateFaces(applied: Record) { + return ( + Object.values(applied).filter((texture) => { + if (texture) { + Canvas.updateAllFaces(texture); + return true; + } + + return false; + }).length > 0 + ); +} + +function applyToMesh( + mesh: Mesh, + materialParams: THREE.MeshStandardMaterialParameters +) { + const applied: Record = {}; + mesh.forAllFaces((face) => { + const texture = applyToFace(face, materialParams); + + if (texture) { + applied[texture.uuid] = texture; + } + }); + + return updateFaces(applied); +} + +function applyToCube( + cube: Cube, + materialParams: THREE.MeshStandardMaterialParameters +) { + const applied: Record = {}; + + Object.keys(cube.faces).forEach((key) => { + const face = cube.faces[key]; + const texture = applyToFace(face, materialParams); + + if (texture) { + applied[texture.uuid] = texture; + } + }); + + return updateFaces(applied); +} + /** * ### Apply PBR Material * Iterates over all faces in the project and applies a PBR material to each face @@ -9,7 +89,7 @@ import { debounce } from "./util"; * @returns `THREE.MeshStandardMaterial` with PBR textures applied */ export const applyPbrMaterial = ( - materialParams?: THREE.MeshStandardMaterialParameters, + materialParams: THREE.MeshStandardMaterialParameters = {} ) => { // Don't overwrite placeholder material in Edit and Paint mode if (!Project || Texture.all.length === 0) { @@ -19,42 +99,14 @@ export const applyPbrMaterial = ( let materialsSet = false; Project.elements.forEach((item) => { - if (!(item instanceof Cube)) { + if (item instanceof Mesh && applyToMesh(item, materialParams)) { + materialsSet = true; return; } - Object.keys(item.faces).forEach((key) => { - const face = item.faces[key]; - const texture = face.getTexture(); - - if (!texture || !face.enabled) { - return; - } - - const projectMaterial = Project.materials[texture.uuid]; - - if ( - projectMaterial.isShaderMaterial && - !Project.bb_materials[texture.uuid] - ) { - Project.bb_materials[texture.uuid] = projectMaterial; - } - - const material = new PbrMaterial( - texture.layers_enabled - ? texture.layers.filter((layer) => layer.visible) ?? null - : Project.textures, - texture.uuid, - ).getMaterial(materialParams); - - material.side = Canvas.getRenderSide(texture) as THREE.Side; - - Project.materials[texture.uuid] = - THREE.ShaderMaterial.prototype.copy.call(material, projectMaterial); - - Canvas.updateAllFaces(texture); + if (item instanceof Cube && applyToCube(item, materialParams)) { materialsSet = true; - }); + } }); Project.pbr_active = materialsSet; diff --git a/src/pbr_preview/src/lib/panels/channels.ts b/src/pbr_preview/src/lib/panels/channels.ts index 26ffae22..81836d11 100644 --- a/src/pbr_preview/src/lib/panels/channels.ts +++ b/src/pbr_preview/src/lib/panels/channels.ts @@ -75,14 +75,12 @@ setups.push(() => { name: "PBR Channels", id: "channels_panel", icon: "gallery_thumbnail", - display_condition: { - modes: ["paint", "edit"], - }, condition: { project: true, selected: { texture: true, }, + modes: ["paint", "edit"], }, toolbars: [ new Toolbar("channel_assignment_toolbar", { diff --git a/src/pbr_preview/src/lib/panels/materialBrush.ts b/src/pbr_preview/src/lib/panels/materialBrush.ts index 2644946b..11ec525a 100644 --- a/src/pbr_preview/src/lib/panels/materialBrush.ts +++ b/src/pbr_preview/src/lib/panels/materialBrush.ts @@ -9,6 +9,7 @@ setups.push(() => { new Toolbar("material_brush_toolbar", { id: "material_brush_toolbar", children: [ + "material_brush", "load_brush_preset", "slider_brush_metalness", "slider_brush_roughness", @@ -16,18 +17,6 @@ setups.push(() => { "slider_brush_height", ], name: "Material Settings", - label: true, - }), - new Toolbar("material_brush_presets_toolbar", { - id: "material_brush_presets_toolbar", - children: [ - "material_brush", - "slider_brush_size", - "slider_brush_opacity", - "slider_brush_softness", - ], - name: "Brush Settings", - label: true, }), ], condition: { diff --git a/src/pbr_preview/src/lib/tools/materialBrush.ts b/src/pbr_preview/src/lib/tools/materialBrush.ts index ca11f74a..7765cbe3 100644 --- a/src/pbr_preview/src/lib/tools/materialBrush.ts +++ b/src/pbr_preview/src/lib/tools/materialBrush.ts @@ -1,7 +1,11 @@ import { registry, CHANNELS, setups, teardowns } from "../../constants"; -import { applyPbrMaterial } from "../applyPbrMaterial"; +import { + applyPbrMaterial, + debounceApplyPbrMaterial, +} from "../applyPbrMaterial"; import { MaterialBrush } from "../MaterialBrush"; import { vue as Vue, three as THREE } from "../../deps"; +import { getSelectedTexture } from "../util"; const generatePreviewImage = (settings: object) => { const renderer = new THREE.WebGLRenderer({ @@ -446,11 +450,19 @@ setups.push(() => { icon: "view_in_ar", paintTool: true, cursor: "cell", - condition: () => - Modes.paint && - !!Project && - Project.selected_texture && - Project.selected_texture.layers_enabled, + category: "tools", + toolbar: "brush", + condition: { + project: true, + selected: { + texture: true, + }, + modes: ["paint"], + method() { + return getSelectedTexture()?.layers_enabled ?? false; + }, + }, + allowed_view_modes: "textured", brush: { blend_modes: false, shapes: true, @@ -501,10 +513,11 @@ setups.push(() => { Painter.startPaintToolCanvas(data, data.event); }, onSelect() { + Painter.updateNslideValues(); applyPbrMaterial(); }, click() { - applyPbrMaterial(); + debounceApplyPbrMaterial(); }, }); @@ -513,7 +526,9 @@ setups.push(() => { name: "Material Brush Presets", description: "Load or save a brush preset", category: "paint", - condition: () => !!Project, + condition: { + project: true, + }, click() { registry.userMaterialBrushPresets = new Dialog("user_brush_presets", { id: "user_brush_presets", @@ -598,7 +613,6 @@ setups.push(() => { MenuBar.addAction(registry.materialBrushTool, "tools.0"); }); - teardowns.push(() => { MenuBar.removeAction("tools.material_brush"); }); From ebdb32587d4cf8c4d6ca8ef23d18c3c4fec27621 Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 13 Jun 2024 06:37:37 -0500 Subject: [PATCH 19/50] fix: Physically correct lighting toggle (#7) * refactor: Move normal map methods - Normal map and AO functions moved to own file - Further optimized applyPbrMaterial function - Optimized channel assignment setup/teardown * fix: Correct lighting button - Fixed physically correct lighting toggle - DRY code --- src/pbr_preview/src/lib/PbrMaterials.ts | 219 +----------------- .../src/lib/actions/channelAssignment.ts | 35 ++- .../src/lib/actions/generateNormal.ts | 37 ++- .../src/lib/actions/toggleLights.ts | 6 +- src/pbr_preview/src/lib/applyPbrMaterial.ts | 27 +-- src/pbr_preview/src/lib/mer.ts | 8 +- src/pbr_preview/src/lib/normalMap.ts | 207 +++++++++++++++++ src/pbr_preview/src/lib/properties.ts | 17 +- 8 files changed, 277 insertions(+), 279 deletions(-) create mode 100644 src/pbr_preview/src/lib/normalMap.ts diff --git a/src/pbr_preview/src/lib/PbrMaterials.ts b/src/pbr_preview/src/lib/PbrMaterials.ts index 8d8aac1f..4b45446f 100644 --- a/src/pbr_preview/src/lib/PbrMaterials.ts +++ b/src/pbr_preview/src/lib/PbrMaterials.ts @@ -142,7 +142,7 @@ export default class PbrMaterial { const channel = typeof name === "string" ? name : name.id; - Project.pbr_materials ??= {}; + Project.pbr_materials = Project.pbr_materials ?? {}; const materialData = Project.pbr_materials[this._materialUuid]; // Don't infer the channel if it has already been assigned to NA_CHANNEL @@ -195,8 +195,7 @@ export default class PbrMaterial { channel: "r" | "g" | "b" | "a" ) { const canvas = texture.canvas; - const width = canvas.width; - const height = canvas.height; + const { width, height } = canvas; const ctx = canvas.getContext("2d"); @@ -221,9 +220,10 @@ export default class PbrMaterial { const channelData = new Uint8ClampedArray(width * height * 4); for (let idx = 0; idx < data.length; idx += 4) { - channelData[idx] = data[idx + channelIdx]; - channelData[idx + 1] = data[idx + channelIdx]; - channelData[idx + 2] = data[idx + channelIdx]; + const value = data[idx + channelIdx]; + channelData[idx] = value; + channelData[idx + 1] = value; + channelData[idx + 2] = value; channelData[idx + 3] = 255; } @@ -793,211 +793,4 @@ export default class PbrMaterial { return maps; } - - /** - * ### Generate Normal Map - * Generates a normal map from a height map texture - * @param texture Height map texture - * @param heightInAlpha Whether or not to store the height map in the alpha channel (Used in labPBR shaders for POM) - * @returns Normal map texture or layer if successful, otherwise `null` - */ - createNormalMap( - texture: Texture | TextureLayer, - heightInAlpha = false - ): Texture | TextureLayer | null { - const textureCtx = texture.canvas.getContext("2d"); - - if (!textureCtx) { - return null; - } - - const width = Math.max( - texture.img.width ?? texture.canvas.width, - Project ? Project.texture_width : 0, - 16 - ); - const height = Math.max( - texture.img.height ?? texture.canvas.height, - Project ? Project.texture_height : 0, - 16 - ); - - const { data: textureData } = textureCtx.getImageData(0, 0, width, height); - - const canvas = document.createElement("canvas"); - const ctx = canvas.getContext("2d"); - - if (!ctx) { - return null; - } - - const getHeight = (x: number, y: number): number => { - const idx = (x + y * width) * 4; - return textureData[idx] / 255; - }; - - canvas.width = width; - canvas.height = height; - - ctx.drawImage(texture.img, 0, 0, width, height); - - const imageData = ctx.getImageData(0, 0, width, height); - - const data = imageData.data; - - const normalize = (v: number[]): number[] => { - const length = Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); - return [v[0] / length, v[1] / length, v[2] / length]; - }; - - for (let y = 0; y < height; y++) { - for (let x = 0; x < width; x++) { - const left = getHeight(Math.max(x - 1, 0), y); - const right = getHeight(Math.min(x + 1, width - 1), y); - const top = getHeight(x, Math.max(y - 1, 0)); - const bottom = getHeight(x, Math.min(y + 1, height - 1)); - - const dx = right - left; - const dy = bottom - top; - - const normal = normalize([-dx, -dy, 1]); - - const idx = (y * width + x) * 4; - data[idx] = ((normal[0] + 1) / 2) * 255; - data[idx + 1] = ((normal[1] + 1) / 2) * 255; - data[idx + 2] = ((normal[2] + 1) / 2) * 255; - data[idx + 3] = heightInAlpha ? getHeight(x, y) * 255 : 255; - } - } - - ctx.putImageData(imageData, 0, 0); - - const dataUrl = canvas.toDataURL(); - - const name = `${texture.name.replace(/_height(map)?/i, "")}_normal`; - - if (texture instanceof TextureLayer) { - const normalMapLayer = new TextureLayer( - { - name, - data_url: dataUrl, - visible: true, - }, - texture.texture - ); - - normalMapLayer.addForEditing(); - - return normalMapLayer; - } - - const normalMapTexture = new Texture({ - name, - saved: false, - particle: false, - keep_size: false, - }).fromDataURL(dataUrl); - - if (Project) { - normalMapTexture.add(); - } - - return normalMapTexture; - } - - createAoMap(texture: Texture | TextureLayer): Texture | TextureLayer | null { - const textureCtx = texture.canvas.getContext("2d"); - - if (!textureCtx) { - return null; - } - - const width = Math.max( - texture.img.width ?? texture.canvas.width, - Project ? Project.texture_width : 0, - 16 - ); - const height = Math.max( - texture.img.height ?? texture.canvas.height, - Project ? Project.texture_height : 0, - 16 - ); - - const { data: textureData } = textureCtx.getImageData(0, 0, width, height); - - const canvas = document.createElement("canvas"); - const ctx = canvas.getContext("2d"); - - if (!ctx) { - return null; - } - - const getHeight = (x: number, y: number): number => { - const idx = (x + y * width) * 4; - return textureData[idx] / 255; - }; - - canvas.width = width; - canvas.height = height; - - ctx.drawImage(texture.img, 0, 0, width, height); - - const imageData = ctx.getImageData(0, 0, width, height); - - const data = imageData.data; - - for (let y = 0; y < height; y++) { - for (let x = 0; x < width; x++) { - const left = getHeight(Math.max(x - 1, 0), y); - const right = getHeight(Math.min(x + 1, width - 1), y); - const top = getHeight(x, Math.max(y - 1, 0)); - const bottom = getHeight(x, Math.min(y + 1, height - 1)); - - const dx = right - left; - const dy = bottom - top; - - const ao = Math.sqrt(dx * dx + dy * dy) * 255; - - const idx = (y * width + x) * 4; - data[idx] = ao; - data[idx + 1] = ao; - data[idx + 2] = ao; - data[idx + 3] = 255; - } - } - - ctx.putImageData(imageData, 0, 0); - - const dataUrl = canvas.toDataURL(); - - const name = `${texture.name.replace(/_height(map)?/i, "")}_ao`; - - if (texture instanceof TextureLayer) { - const aoMapLayer = new TextureLayer( - { - name, - data_url: dataUrl, - visible: true, - }, - texture.texture - ); - - aoMapLayer.addForEditing(); - - return aoMapLayer; - } - - const aoMapTexture = new Texture({ - name, - saved: false, - particle: false, - keep_size: false, - }).fromDataURL(dataUrl); - - if (Project) { - aoMapTexture.add(); - } - - return aoMapTexture; - } } diff --git a/src/pbr_preview/src/lib/actions/channelAssignment.ts b/src/pbr_preview/src/lib/actions/channelAssignment.ts index b7b201eb..f7b04126 100644 --- a/src/pbr_preview/src/lib/actions/channelAssignment.ts +++ b/src/pbr_preview/src/lib/actions/channelAssignment.ts @@ -6,7 +6,10 @@ import { setups, teardowns, } from "../../constants"; -import { applyPbrMaterial } from "../applyPbrMaterial"; +import { + applyPbrMaterial, + debounceApplyPbrMaterial, +} from "../applyPbrMaterial"; import { getSelectedTexture } from "../util"; /** @@ -17,8 +20,8 @@ const channelAssignmentActions: Record = {}; const channelSelectActions: Record = {}; -Object.entries(CHANNELS).forEach(([key, channel], idx) => { - setups.push(() => { +setups.push(() => { + Object.entries(CHANNELS).forEach(([key, channel]) => { channelAssignmentActions[key] = new Action(`assign_channel_${key}`, { icon: channel.icon ?? "tv_options_edit_channels", name: `Assign to ${channel.label.toLocaleLowerCase()} channel`, @@ -29,11 +32,11 @@ Object.entries(CHANNELS).forEach(([key, channel], idx) => { texture: true, }, }, - click(e) { + click() { const layer = TextureLayer.selected ?? (Project ? Project.selected_texture : null); - if (!layer || !Project) { + if (!layer) { return; } @@ -125,11 +128,11 @@ Object.entries(CHANNELS).forEach(([key, channel], idx) => { }); teardowns.push(() => { - Object.values(channelAssignmentActions).forEach((action) => { - action.delete(); - }); - - Object.values(channelSelectActions).forEach((action) => { + const actions = [ + ...Object.values(channelAssignmentActions), + ...Object.values(channelSelectActions), + ]; + actions.forEach((action) => { action.delete(); }); }); @@ -148,18 +151,14 @@ setups.push(() => { const layer = TextureLayer.selected ?? (Project ? Project.selected_texture : null); - if (!layer || !Project) { - return false; - } - - return layer.channel && layer.channel !== NA_CHANNEL; + return layer?.channel && layer.channel !== NA_CHANNEL; }, }, click() { const layer = TextureLayer.selected ?? (Project ? Project.selected_texture : null); - if (!layer || !Project) { + if (!layer) { return; } @@ -180,7 +179,7 @@ setups.push(() => { 2000 ); - applyPbrMaterial(); + debounceApplyPbrMaterial(); }, }); @@ -192,7 +191,7 @@ setups.push(() => { ], { onOpen() { - applyPbrMaterial(); + debounceApplyPbrMaterial(); }, } ); diff --git a/src/pbr_preview/src/lib/actions/generateNormal.ts b/src/pbr_preview/src/lib/actions/generateNormal.ts index a893c1f6..3df17d9e 100644 --- a/src/pbr_preview/src/lib/actions/generateNormal.ts +++ b/src/pbr_preview/src/lib/actions/generateNormal.ts @@ -2,16 +2,15 @@ import { registry, setups, teardowns } from "../../constants"; import { CHANNELS } from "../../constants"; import PbrMaterial from "../PbrMaterials"; import { getSelectedLayer, getSelectedTexture } from "../util"; +import { createNormalMap, createAoMap } from "../normalMap"; setups.push(() => { registry.generateNormal = new Action("generate_normal", { - icon: "altitude", + icon: CHANNELS.normal.icon ?? "altitude", name: "Generate Normal Map", description: "Generates a normal map from the height map", - condition: () => - (TextureLayer.selected || Texture.all.find((t) => t.selected)) !== - undefined, - click() { + condition: () => (getSelectedLayer() ?? getSelectedTexture()) !== null, + click(e) { const texture: Texture | TextureLayer = getSelectedLayer() ?? getSelectedTexture() ?? Texture.getDefault(); @@ -19,23 +18,23 @@ setups.push(() => { return; } - const mat = new PbrMaterial( + const normalMap = createNormalMap(texture); + + if (!normalMap) { + Blockbench.showQuickMessage("Failed to generate normal map", 2000); + return; + } + + normalMap.select(e); + + new PbrMaterial( texture instanceof Texture && texture.layers_enabled ? texture.layers : null, texture.uuid - ); - - const normalMap = mat.createNormalMap(texture); - - if (normalMap) { - mat.saveTexture(CHANNELS.normal, normalMap); - normalMap.select(); - Blockbench.showQuickMessage("Normal map generated", 2000); - return; - } + ).saveTexture(CHANNELS.normal, normalMap); - Blockbench.showQuickMessage("Failed to generate normal map", 2000); + Blockbench.showQuickMessage("Normal map generated", 2000); }, }); @@ -65,7 +64,7 @@ setups.push(() => { ); const normalMap = - mat.findTexture(CHANNELS.normal) ?? mat.createNormalMap(texture); + mat.findTexture(CHANNELS.normal) ?? createNormalMap(texture); if (!normalMap) { // TODO: Use Validator @@ -76,7 +75,7 @@ setups.push(() => { return; } - const aoMap = mat.createAoMap(normalMap); + const aoMap = createAoMap(normalMap); if (aoMap) { mat.saveTexture(CHANNELS.ao, aoMap); diff --git a/src/pbr_preview/src/lib/actions/toggleLights.ts b/src/pbr_preview/src/lib/actions/toggleLights.ts index fc0153f4..995d07b7 100644 --- a/src/pbr_preview/src/lib/actions/toggleLights.ts +++ b/src/pbr_preview/src/lib/actions/toggleLights.ts @@ -1,5 +1,5 @@ import { registry, setups, teardowns } from "../../constants"; -import { debounceApplyPbrMaterial } from "../applyPbrMaterial"; +import { applyPbrMaterial } from "../applyPbrMaterial"; setups.push(() => { registry.toggleCorrectLights = new Toggle("correct_lights", { @@ -17,7 +17,7 @@ setups.push(() => { Blockbench.showQuickMessage( `Physically corrected lighting is now ${value ? "enabled" : "disabled"}`, - 2000, + 2000 ); if (value) { @@ -25,7 +25,7 @@ setups.push(() => { registry.togglePbr?.set(true); } - debounceApplyPbrMaterial(); + applyPbrMaterial(); }, click() {}, }); diff --git a/src/pbr_preview/src/lib/applyPbrMaterial.ts b/src/pbr_preview/src/lib/applyPbrMaterial.ts index 6f94129f..ff05528a 100644 --- a/src/pbr_preview/src/lib/applyPbrMaterial.ts +++ b/src/pbr_preview/src/lib/applyPbrMaterial.ts @@ -91,25 +91,20 @@ function applyToCube( export const applyPbrMaterial = ( materialParams: THREE.MeshStandardMaterialParameters = {} ) => { - // Don't overwrite placeholder material in Edit and Paint mode - if (!Project || Texture.all.length === 0) { + if (!Project) { return; } - let materialsSet = false; - - Project.elements.forEach((item) => { - if (item instanceof Mesh && applyToMesh(item, materialParams)) { - materialsSet = true; - return; - } - - if (item instanceof Cube && applyToCube(item, materialParams)) { - materialsSet = true; - } - }); - - Project.pbr_active = materialsSet; + // @ts-expect-error - Property 'pbr_active' does not exist on type 'Project' + Project.pbr_active = + Texture.all.length > 0 && + Project.elements + .map( + (item) => + (item instanceof Mesh && applyToMesh(item, materialParams)) || + (item instanceof Cube && applyToCube(item, materialParams)) + ) + .filter(Boolean).length > 0; }; export const debounceApplyPbrMaterial = (wait = 100) => diff --git a/src/pbr_preview/src/lib/mer.ts b/src/pbr_preview/src/lib/mer.ts index a1d225e6..235edccb 100644 --- a/src/pbr_preview/src/lib/mer.ts +++ b/src/pbr_preview/src/lib/mer.ts @@ -9,9 +9,9 @@ import { getSelectedTexture } from "./util"; */ export const exportMer = ( baseName?: string, - cb?: (filePath: string) => void, + cb?: (filePath: string) => void ) => { - const selected = getSelectedTexture(); + const selected = getSelectedTexture() ?? Texture.getDefault(); const mer = new PbrMaterial( selected.layers_enabled @@ -19,7 +19,7 @@ export const exportMer = ( : Project ? Project.textures : null, - selected.uuid, + selected.uuid ).createMer(true); if (!mer) { @@ -50,7 +50,7 @@ export const exportMer = ( savetype: "image", startpath, }, - cb, + cb ); }); }; diff --git a/src/pbr_preview/src/lib/normalMap.ts b/src/pbr_preview/src/lib/normalMap.ts new file mode 100644 index 00000000..43e28f59 --- /dev/null +++ b/src/pbr_preview/src/lib/normalMap.ts @@ -0,0 +1,207 @@ +/** + * ### Generate Normal Map + * Generates a normal map from a height map texture + * @param texture Height map texture + * @param heightInAlpha Whether or not to store the height map in the alpha channel (Used in labPBR shaders for POM) + * @returns Normal map texture or layer if successful, otherwise `null` + */ +export function createNormalMap( + texture: Texture | TextureLayer, + heightInAlpha = false +): Texture | TextureLayer | null { + const textureCtx = texture.canvas.getContext("2d"); + + if (!textureCtx) { + return null; + } + + const width = Math.max( + texture.img.width ?? texture.canvas.width, + Project ? Project.texture_width : 0, + 16 + ); + const height = Math.max( + texture.img.height ?? texture.canvas.height, + Project ? Project.texture_height : 0, + 16 + ); + + const { data: textureData } = textureCtx.getImageData(0, 0, width, height); + + const canvas = document.createElement("canvas"); + const ctx = canvas.getContext("2d"); + + if (!ctx) { + return null; + } + + const getHeight = (x: number, y: number): number => { + const idx = (x + y * width) * 4; + return textureData[idx] / 255; + }; + + canvas.width = width; + canvas.height = height; + + ctx.drawImage(texture.img, 0, 0, width, height); + + const imageData = ctx.getImageData(0, 0, width, height); + + const data = imageData.data; + + const normalize = (v: number[]): number[] => { + const length = Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); + return [v[0] / length, v[1] / length, v[2] / length]; + }; + + for (let y = 0; y < height; y++) { + for (let x = 0; x < width; x++) { + const left = getHeight(Math.max(x - 1, 0), y); + const right = getHeight(Math.min(x + 1, width - 1), y); + const top = getHeight(x, Math.max(y - 1, 0)); + const bottom = getHeight(x, Math.min(y + 1, height - 1)); + + const dx = right - left; + const dy = bottom - top; + + const normal = normalize([-dx, -dy, 1]); + + const idx = (y * width + x) * 4; + data[idx] = ((normal[0] + 1) / 2) * 255; + data[idx + 1] = ((normal[1] + 1) / 2) * 255; + data[idx + 2] = ((normal[2] + 1) / 2) * 255; + data[idx + 3] = heightInAlpha ? getHeight(x, y) * 255 : 255; + } + } + + ctx.putImageData(imageData, 0, 0); + + const dataUrl = canvas.toDataURL(); + + const name = `${texture.name.replace(/_height(map)?/i, "")}_normal`; + + if (texture instanceof TextureLayer) { + const normalMapLayer = new TextureLayer( + { + name, + data_url: dataUrl, + visible: true, + }, + texture.texture + ); + + normalMapLayer.addForEditing(); + + return normalMapLayer; + } + + const normalMapTexture = new Texture({ + name, + saved: false, + particle: false, + }).fromDataURL(dataUrl); + + if (Project) { + normalMapTexture.add(); + } + + return normalMapTexture; +} + +export function createAoMap( + texture: Texture | TextureLayer +): Texture | TextureLayer | null { + const textureCtx = texture.canvas.getContext("2d"); + + if (!textureCtx) { + return null; + } + + const width = Math.max( + texture.img.width ?? texture.canvas.width, + Project ? Project.texture_width : 0, + 16 + ); + const height = Math.max( + texture.img.height ?? texture.canvas.height, + Project ? Project.texture_height : 0, + 16 + ); + + const { data: textureData } = textureCtx.getImageData(0, 0, width, height); + + const canvas = document.createElement("canvas"); + const ctx = canvas.getContext("2d"); + + if (!ctx) { + return null; + } + + const getHeight = (x: number, y: number): number => { + const idx = (x + y * width) * 4; + return textureData[idx] / 255; + }; + + canvas.width = width; + canvas.height = height; + + ctx.drawImage(texture.img, 0, 0, width, height); + + const imageData = ctx.getImageData(0, 0, width, height); + + const data = imageData.data; + + for (let y = 0; y < height; y++) { + for (let x = 0; x < width; x++) { + const left = getHeight(Math.max(x - 1, 0), y); + const right = getHeight(Math.min(x + 1, width - 1), y); + const top = getHeight(x, Math.max(y - 1, 0)); + const bottom = getHeight(x, Math.min(y + 1, height - 1)); + + const dx = right - left; + const dy = bottom - top; + + const ao = Math.sqrt(dx * dx + dy * dy) * 255; + + const idx = (y * width + x) * 4; + data[idx] = ao; + data[idx + 1] = ao; + data[idx + 2] = ao; + data[idx + 3] = 255; + } + } + + ctx.putImageData(imageData, 0, 0); + + const dataUrl = canvas.toDataURL(); + + const name = `${texture.name.replace(/_height(map)?/i, "")}_ao`; + + if (texture instanceof TextureLayer) { + const aoMapLayer = new TextureLayer( + { + name, + data_url: dataUrl, + visible: true, + }, + texture.texture + ); + + aoMapLayer.addForEditing(); + + return aoMapLayer; + } + + const aoMapTexture = new Texture({ + name, + saved: false, + particle: false, + keep_size: false, + }).fromDataURL(dataUrl); + + if (Project) { + aoMapTexture.add(); + } + + return aoMapTexture; +} diff --git a/src/pbr_preview/src/lib/properties.ts b/src/pbr_preview/src/lib/properties.ts index 9a151f2d..645cf0f6 100644 --- a/src/pbr_preview/src/lib/properties.ts +++ b/src/pbr_preview/src/lib/properties.ts @@ -1,16 +1,21 @@ import { registry, CHANNELS, NA_CHANNEL, setups } from "../constants"; +const channelsEnum = [ + ...Object.keys(CHANNELS).map((key) => CHANNELS[key].id), + NA_CHANNEL, +]; + setups.push(() => { registry.channelProp = new Property(TextureLayer, "enum", "channel", { default: NA_CHANNEL, - values: Object.keys(CHANNELS).map((key) => CHANNELS[key].id), + values: channelsEnum, label: "PBR Channel", exposed: false, }); registry.textureChannelProp = new Property(Texture, "enum", "channel", { default: NA_CHANNEL, - values: Object.keys(CHANNELS).map((key) => CHANNELS[key].id), + values: channelsEnum, label: "PBR Channel", exposed: false, }); @@ -24,7 +29,7 @@ setups.push(() => { default: {}, exposed: false, label: "PBR Materials", - }, + } ); registry.projectMaterialsProp = new Property( @@ -36,7 +41,7 @@ setups.push(() => { default: {}, exposed: false, label: "Project Materials", - }, + } ); registry.projectPbrModeProp = new Property( @@ -45,9 +50,9 @@ setups.push(() => { "pbr_active", { default: false, - exposed: true, + exposed: false, values: [], label: "PBR Mode", - }, + } ); }); From ccc9e34445fc179c5573aba053750d2832b3d6bd Mon Sep 17 00:00:00 2001 From: Jason Gardner Date: Thu, 13 Jun 2024 06:43:10 -0500 Subject: [PATCH 20/50] chore: Commit build output --- plugins/pbr_preview/pbr_preview.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index 6ce32879..771e3540 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1,4 +1,4 @@ -"use strict";(()=>{var v=THREE,W=Vue;var N="_NONE_",d={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new v.Color(16777215)},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new v.Color(0)},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new v.Color(0)},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new v.Color(16777215)},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new v.Color(16777215)},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new v.Color("rgb(128, 128, 255)")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new v.Color(16777215)}},o={},C=[],L=[];C.push(()=>{o.channelProp=new Property(TextureLayer,"enum","channel",{default:N,values:Object.keys(d).map(e=>d[e].id),label:"PBR Channel",exposed:!1}),o.textureChannelProp=new Property(Texture,"enum","channel",{default:N,values:Object.keys(d).map(e=>d[e].id),label:"PBR Channel",exposed:!1}),o.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),o.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),o.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!0,values:[],label:"PBR Mode"})});var Te=(e=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return e?a.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):a},j=class e{constructor(a,t){this._scope=a??Te(),this._materialUuid=t}merToCanvas(){let a=this.getTexture(d.emissive),t=this.getTexture(d.roughness),r=this.getTexture(d.metalness);if(!a&&!t&&!r){let{metalness:n,emissive:s,roughness:l}=this.decodeMer();n&&(r=e.makePixelatedCanvas(n)),s&&(a=e.makePixelatedCanvas(s)),l&&(t=e.makePixelatedCanvas(l))}return{emissiveMap:a,roughnessMap:t,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(d.emissive),roughnessMap:this.getTexture(d.roughness),metalnessMap:this.getTexture(d.metalness)},s=this.getTexture(d.normal);return new v.MeshStandardMaterial({map:this.getTexture(d.albedo)??e.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(l=>l.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(d.ao),bumpMap:this.getTexture(d.height),normalMap:s,normalScale:new v.Vector2(1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}saveTexture(a,t){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=t.uuid,t.extend({channel:a.id}))}findTexture(a,t=!0){if(!Project)return null;let r=this._scope.find(i=>i.channel&&(i.channel===a||i.channel===a.id));if(r)return r;let n=typeof a=="string"?a:a.id;Project.pbr_materials??={};let s=Project.pbr_materials[this._materialUuid];if(!s&&t&&n!==N){let i=new RegExp(`_*${n}(.[^.]+)?$`,"i");return this._scope.find(h=>i.test(h.name))??null}let l=s?.[n];return l?this._scope.find(i=>i.uuid===l)??null:null}static makePixelatedCanvas(a){let t=new v.CanvasTexture(a,void 0,void 0,void 0,v.NearestFilter,v.NearestFilter);return t.needsUpdate=!0,t}getTexture(a){let t=this.findTexture(a);return t?e.makePixelatedCanvas(t.canvas):null}static extractChannel(a,t){let r=a.canvas,n=r.width,s=r.height,l=r.getContext("2d");if(!l||!n||!s)return null;let i=document.createElement("canvas");i.width=n,i.height=s;let h=i.getContext("2d");if(!h)return null;let g={r:0,g:1,b:2,a:3}[t],{data:p}=l.getImageData(0,0,n,s),m=new Uint8ClampedArray(n*s*4);for(let b=0;ba){x[u]=_.data[u],x[u+1]=_.data[u+1],x[u+2]=_.data[u+2],x[u+3]=255;continue}x[u]=0,x[u+1]=0,x[u+2]=0,x[u+3]=255}return g.putImageData(new ImageData(x,i.width,i.height),0,0),{metalness:r,emissive:i,emissiveLevel:n,roughness:s,sss:l}}createMer(a=!1){let t=this.findTexture(d.metalness,a),r=this.findTexture(d.emissive,a),n=this.findTexture(d.roughness,a),s=this.findTexture("sss",!1),l=Math.max(t?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),i=Math.max(t?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),h=document.createElement("canvas");h.width=l,h.height=i;let g=h.getContext("2d");if(!g)return null;let p=t?.img?e.extractChannel(t,"r"):null,m=r?.img?e.extractChannel(r,"g"):null,_=n?.img?e.extractChannel(n,"b"):null,b=s&&s?.img?e.extractChannel(s,"a"):null,x=p?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(l,i),u=m?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(l,i),c=_?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(l,i),f=b?.getContext("2d")?.getImageData(0,0,l,i)??new ImageData(new Uint8ClampedArray(l*i*4).fill(255),l,i),y=new Uint8ClampedArray(l*i*4);for(let M=0;M{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createTexturesFromNormal(a){let t=this.decodeLabPbrNormal(a);return Object.entries(t).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createNormalMap(a,t=!1){let r=a.canvas.getContext("2d");if(!r)return null;let n=Math.max(a.img.width??a.canvas.width,Project?Project.texture_width:0,16),s=Math.max(a.img.height??a.canvas.height,Project?Project.texture_height:0,16),{data:l}=r.getImageData(0,0,n,s),i=document.createElement("canvas"),h=i.getContext("2d");if(!h)return null;let g=(c,f)=>{let y=(c+f*n)*4;return l[y]/255};i.width=n,i.height=s,h.drawImage(a.img,0,0,n,s);let p=h.getImageData(0,0,n,s),m=p.data,_=c=>{let f=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);return[c[0]/f,c[1]/f,c[2]/f]};for(let c=0;c{let c=(x+u*r)*4;return s[c]/255};l.width=r,l.height=n,i.drawImage(a.img,0,0,r,n);let g=i.getImageData(0,0,r,n),p=g.data;for(let x=0;x{let x=this.createCanvas(t.width,t.height),u=x.getContext("2d"),c=u.getImageData(0,0,x.width,x.height),f=[Math.cos(b),Math.sin(b),this.lightHeight];for(let y=0;y{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new j(r.layers_enabled?r.layers:Project.textures,r.uuid),s=n.findTexture(d.albedo);if(!s){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let l=n.findTexture(d.normal);if(!l){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let h=new H(e).bake(a,s.canvas,l.canvas),g=new Texture({name:`${s.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(h[0].toDataURL()),p=t?m=>{let _=n.findTexture(d.emissive);if(!_)return m;let b=_.canvas;if(!b.getContext("2d"))return m;let u=Math.max(m.width,b.width,Project?Project.texture_width:16),c=Math.max(m.height,b.height,Project?Project.texture_height:16),f=document.createElement("canvas");f.width=u,f.height=c;let y=f.getContext("2d");return y?(y.drawImage(m,0,0),y.globalCompositeOperation="screen",y.drawImage(b,0,0),f):m}:m=>m;h.forEach((m,_)=>{new TextureLayer({name:`baked_${_+1}`,data_url:p(m).toDataURL()},g).addForEditing()}),g.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};C.push(()=>{o.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(e){let a=new v.Color(e.ambientLight.toString()),t=new v.Color(e.lightDiffuse.toString());K({ambientLight:[a.r,a.g,a.b],lightDiffuse:[t.r,t.g,t.b],lightHeight:Number(e.lightHeight),minLightIntensity:Number(e.minLightIntensity)},e.directions??8,e.blendEmissive??!1)}}),o.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){o.bakeTexturesDialog?.show()}}),MenuBar.addAction(o.bakeTexturesAction,"tools")});L.push(()=>{MenuBar.removeAction("tools.bake_textures")});function S(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(e=>e.selected)??null:Texture.all.find(e=>e.selected)??Texture.getDefault()}function O(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(e=>e.selected)??Project.selected_texture.layers[0]:S()?.getActiveLayer()??null}function X(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(S()?.name??"texture")}function Y(e,a){let t;return function(...r){let n=()=>{t=void 0,e.apply(this,r)};clearTimeout(t),t=setTimeout(n,a)}}function Z(e,a){let t=e.getTexture();if(!t||!Project)return null;let r=Project.materials[t.uuid];r.isShaderMaterial&&!Project.bb_materials[t.uuid]&&(Project.bb_materials[t.uuid]=r);let n=new j(t.layers_enabled?t.layers.filter(s=>s.visible)??null:Project.textures,t.uuid).getMaterial(a);return n.side=Canvas.getRenderSide(t),Project.materials[t.uuid]=v.ShaderMaterial.prototype.copy.call(n,r),t}function ee(e){return Object.values(e).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function Pe(e,a){let t={};return e.forAllFaces(r=>{let n=Z(r,a);n&&(t[n.uuid]=n)}),ee(t)}function Ee(e,a){let t={};return Object.keys(e.faces).forEach(r=>{let n=e.faces[r],s=Z(n,a);s&&(t[s.uuid]=s)}),ee(t)}var A=(e={})=>{if(!Project||Texture.all.length===0)return;let a=!1;Project.elements.forEach(t=>{if(t instanceof Mesh&&Pe(t,e)){a=!0;return}t instanceof Cube&&Ee(t,e)&&(a=!0)}),Project.pbr_active=a},B=(e=100)=>Y(A,e);var G={},Q={};Object.entries(d).forEach(([e,a],t)=>{C.push(()=>{G[e]=new Action(`assign_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:{selected:{texture:!0}},click(r){let n=TextureLayer.selected??(Project?Project.selected_texture:null);if(!n||!Project)return;Undo.initEdit({layers:[n]}),n.extend({channel:a.id});let s=n instanceof TextureLayer?n.texture:n;s.updateChangesAfterEdit(),Project.pbr_materials[s.uuid]||(Project.pbr_materials[s.uuid]={}),Object.entries(Project.pbr_materials[s.uuid]).forEach(([l,i])=>{i===n.uuid&&(delete Project.pbr_materials[s.uuid][l],n.channel=N)}),s.uuid===n.uuid&&(Project.pbr_materials[s.uuid]={}),Project.pbr_materials[s.uuid][e]=n.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${n.name}" to ${a.label} channel`,2e3),A()}}),Q[e]=new Action(`select_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:a.label??e,description:`Select the ${a.label} channel`,condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){let r=S();return(r?.layers_enabled?r.layers:Texture.all).some(s=>s.channel===e)}},click(){let r=Texture.selected?.layers_enabled?Texture.selected.layers:Texture.all;if(!r||!r.length)return;let n=r.find(s=>s.channel===e);n&&(n.select(),n.scrollTo())}}),Q[e].addLabel(!0,()=>a.label??e)})});L.push(()=>{Object.values(G).forEach(e=>{e.delete()}),Object.values(Q).forEach(e=>{e.delete()})});C.push(()=>{o.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:{selected:{texture:!0},method(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);return!e||!Project?!1:e.channel&&e.channel!==N}},click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e||!Project)return;Undo.initEdit({layers:[e]});let a=e instanceof TextureLayer?e.texture:e,t=e.channel;Project.pbr_materials[a.uuid]={},e.channel=N,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${e.name}" from ${t} channel`,2e3),A()}}),o.channelMenu=new Menu("channel_menu",[...Object.keys(d).map(e=>`assign_channel_${e}`),"unassign_channel"],{onOpen(){A()}}),o.channelSelectionMenu=new Menu("channel_selection_menu",Object.keys(d).map(e=>`select_channel_${e}`)),o.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",click(e){o.channelMenu?.open(e)},children:[...Object.values(G),o.unassignChannel]}),o.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(e){o.channelMenu?.open(e)}}),o.showChannelSelectionMenu=new Action("show_channel_select_menu",{icon:"tv_options_edit_channels",name:"Select PBR Channel",description:"Select a channel to view",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(e){o.channelSelectionMenu?.open(e)}}),o.openChannelMenu&&(MenuBar.addAction(o.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(o.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(o.openChannelMenu,"0")),Toolbars.layers.add(o.showChannelMenu,1)});L.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(o.showChannelMenu)});C.push(()=>{o.generateNormal=new Action("generate_normal",{icon:"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(TextureLayer.selected||Texture.all.find(e=>e.selected))!==void 0,click(){let e=O()??S()??Texture.getDefault();if(!e)return;let a=new j(e instanceof Texture&&e.layers_enabled?e.layers:null,e.uuid),t=a.createNormalMap(e);if(t){a.saveTexture(d.normal,t),t.select(),Blockbench.showQuickMessage("Normal map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate normal map",2e3)}}),o.generateAo=new Action("generate_ao",{icon:d.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let e=O()??S()??Texture.getDefault();if(!e)return;let a=new j(e instanceof Texture&&e.layers_enabled?e.layers:null,e.uuid),t=a.findTexture(d.normal)??a.createNormalMap(e);if(!t){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=a.createAoMap(t);if(r){a.saveTexture(d.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),MenuBar.addAction(o.generateNormal,"tools"),MenuBar.addAction(o.generateAo,"tools")});L.push(()=>{MenuBar.removeAction("tools.generate_normal")});var te=(e,a)=>{let t=a??document.createElement("canvas"),r=t.getContext("2d");if(!r)return null;let n=Math.max(Project?Project.texture_width:16,16),s=Math.max(Project?Project.texture_height:16,16);return t.width=n,t.height=s,r.fillStyle=`rgb(${e.r*255}, ${e.g*255}, ${e.b*255})`,r.fillRect(0,0,n,s),t.toDataURL()};C.push(()=>{o.createMaterialTexture=new Action("create_material_texture",{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let e={...d},a=new Texture({name:"New Material",saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}),t=Texture.all.filter(s=>s.selected||s.multi_selected)??Texture.all,r=Texture.selected?new j(t,Texture.selected.uuid):null;try{let s=r?.findTexture(d.albedo,!0)?.canvas.toDataURL()??Texture.selected?.canvas.toDataURL()??te(new v.Color(8421504),a.canvas);if(!s)return;a.fromDataURL(s);let l=new TextureLayer({name:e.albedo.label,visible:!0,data_url:s},a);l.extend({channel:e.albedo.id}),l.addForEditing(),l.texture.updateChangesAfterEdit(),delete e.albedo}catch(s){console.warn("Failed to create base color texture",s),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let n=Object.keys(e).map(s=>{let l=d[s],i=r?.findTexture(l,!0),h=i?i.canvas.toDataURL():te(l.default??new v.Color(0));if(!h)return;let g=new TextureLayer({name:l.label,visible:!0,data_url:h},a);return g.extend({channel:l.id}),g}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:n}),a.add().select(),n.map(s=>s.addForEditing()),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(o.createMaterialTexture,"tools"),Toolbars.texturelist.add(o.createMaterialTexture,3)});L.push(()=>{MenuBar.removeAction("tools.create_material_texture")});var U=(e,a)=>{let t=S(),r=new j(t.layers_enabled?t.layers:Project?Project.textures:null,t.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[s,l]=Project?[e?`${e}_mer`:`${t.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:s,extensions:["png"],resource_id:"mer",savetype:"image",startpath:l},a)})};C.push(()=>{o.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{U()}catch(e){console.error("Failed to export MER map:",e),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),o.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let e=S()??Texture.getDefault(),a=new j([e],e.uuid),t=a.decodeMer(),r=[d.metalness,d.emissive,d.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let s=n.id,l=t[s];if(!l){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let i=new Texture({name:`${e?.name}_${s}`,keep_size:!1}).fromDataURL(l.toDataURL());i.add(!0),a.saveTexture(n,i)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>S()?.layers_enabled===!0,click(){let e=TextureLayer.selected?.texture??Texture.all.find(s=>s.selected)??Texture.getDefault(),a=new j(e.layers_enabled?e.layers:[e],e.uuid),t=a.decodeMer(),r=[d.metalness,d.emissive,d.roughness];Undo.initEdit({textures:[e]});let n=e.selected.activateLayers(!0);r.forEach(s=>{let l=s.id,i=t[l];if(!i){Blockbench.showStatusMessage(`Failed to decode ${s.label} channel`,3e3);return}let h=new TextureLayer({name:`${e?.name}_${l}`,data_url:i.toDataURL()},e);a.saveTexture(s,h),h.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(o.decodeMer,"tools"),MenuBar.addAction(o.generateMer,"file.export")});L.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var Le=()=>{Project&&Project.textures.forEach(e=>{let a=new j(null,e.uuid),t=a.findTexture(d.normal,!1),r=a.findTexture(d.height,!1),n=a.findTexture(d.albedo,!1),s=a.findTexture(d.metalness,!1)?.name,l=a.findTexture(d.emissive,!1)?.name,i=a.findTexture(d.roughness,!1)?.name,h={};return n||(h.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!s&&!l&&!i&&(h.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},h.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},h.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),t&&(h.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(h.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),t&&r&&(h.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),o.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:h,cancelIndex:1,onConfirm(g){let p=X(),m=s||l||i,_={format_version:"1.16.100","minecraft:texture_set":{color:(n?p:g.baseColor?.toHexString())??p,metalness_emissive_roughness:[g.metalness??0,g.emissive??0,g.roughness??255]}};g.depthMap==="normal"&&t||!r&&t?_["minecraft:texture_set"].normal=`${p}_normal`:(!t||g.depthMap==="heightmap")&&r&&(_["minecraft:texture_set"].heightmap=`${p}_heightmap`);let b=c=>{if(!g.depthMap)return c();let f=g.depthMap==="normal"||g.depthMap&&!r,y=f?t:r;if(!y)return c();Blockbench.export({content:y.canvas.toDataURL()??"",type:"PNG",name:`${p}_${f?"normal":"heightmap"}`,extensions:["png"],resource_id:g.depthMap,startpath:Project.export_path,savetype:"image"},M=>{_["minecraft:texture_set"][f?"normal":"heightmap"]=pathToName(M,!1),c()})},x=c=>{if(!n)return c();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:p,startpath:Project.export_path,savetype:"image"},f=>{_["minecraft:texture_set"].color=pathToName(f,!1),c()})},u=()=>b(()=>{x(()=>{Blockbench.export({content:JSON.stringify(_,null,2),type:"JSON",name:`${p}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),o.textureSetDialog?.hide()})})});if(m){try{U(p,c=>{_["minecraft:texture_set"].metalness_emissive_roughness=pathToName(c,!1),u()})}catch(c){console.warn("Failed to export MER map:",c),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}u()}}),o.textureSetDialog.show()})};C.push(()=>{o.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){Le()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(o.createTextureSet,"file.export")});L.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});C.push(()=>{o.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(e){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=e}),Preview.selected.renderer.physicallyCorrectLights=e,Blockbench.showQuickMessage(`Physically corrected lighting is now ${e?"enabled":"disabled"}`,2e3),e&&o.togglePbr?.set(!0),B()},click(){}}),MenuBar.addAction(o.toggleCorrectLights,"preview")});L.push(()=>{MenuBar.removeAction("preview.correct_lights")});var $=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(e=>{e instanceof Cube&&Object.keys(e.faces).forEach(a=>{let r=e.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var ae=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],re=()=>Project&&Project.pbr_active&&A(),je=()=>{Blockbench.on(ae.join(" "),re)},ne=()=>{ae.forEach(e=>{Blockbench.removeListener(e,re)})};C.push(()=>{o.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(e){if(e){A(),je(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}$(),ne(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(o.togglePbr,"view")});L.push(()=>{ne(),MenuBar.removeAction("view.toggle_pbr")});var se=e=>{let a=Math.max(-2,Math.min(2,e));Preview.all.forEach(t=>{t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};C.push(()=>{o.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(o.tonemappingSelect?.get())===v.NoToneMapping&&o.tonemappingSelect.change(v.LinearToneMapping.toString()),o.togglePbr?.set(!0)},onChange(e){se(Number(e))},onAfter(){B()}}),o.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>o.exposureSlider!==void 0&&Number(o.exposureSlider?.get())!==1,click(){se(1),o.exposureSlider?.setValue(1,!0),B()}}),o.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:v.NoToneMapping,value:Preview.selected.renderer.toneMapping??v.NoToneMapping,icon:"monochrome_photos",options:{[v.NoToneMapping]:"No Tone Mapping",[v.LinearToneMapping]:"Linear",[v.ReinhardToneMapping]:"Reinhard",[v.CineonToneMapping]:"Cineon",[v.NeutralToneMapping]:"Neutral",[v.ACESFilmicToneMapping]:"ACES"},onChange({value:e}){Preview.selected.renderer.toneMapping=Number(e);let a=1;Preview.selected.renderer.toneMapping===v.NoToneMapping?o.exposureSlider?.setValue(a,!0):a=Number(o.exposureSlider?.get()??1),Preview.all.forEach(t=>{t.renderer.toneMapping=Number(e),t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(e)}`,2e3),o.togglePbr&&!o.togglePbr.value&&o.togglePbr.set(!0),A()}})});var De=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},ke=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};C.push(()=>{o.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let e=S();if(!e)return;let t=new j(e.layers_enabled?e.layers:[e],e.uuid).createLabPbrOutput();if(t===null)return;let r=e.name??(Project?Project.getDisplayName():"texture");await Promise.all([De(t.normalMap,pathToName(r)),ke(t.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),o.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let e=TextureLayer.selected?.texture??Texture.all.find(t=>t.selected)??Texture.getDefault(),a=new j(e.layers_enabled?e.layers:[e],e.uuid);if(pathToName(e.name).endsWith("_n")){a.createTexturesFromNormal(e);return}if(pathToName(e.name).endsWith("_s")){a.createTexturesFromSpecular(e);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(o.generateLabPbr,"file.export"),MenuBar.addAction(o.decodeLabPbr,"tools")});L.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});var F=class e{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(d).map(t=>[t,d[t].default??new v.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([t,r])=>[t,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let t=Math.min(1,Math.max(0,a));return new v.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let a="#000000",t=Number(o.brushMetalnessSlider?.get()),r=Number(o.brushRoughnessSlider?.get()??1),n=(o.brushEmissiveColor?.get()??a).toString(),s=Number(o.brushHeightSlider?.get()),l=ColorPanel.get(),i={[d.albedo.id]:new v.Color(l),[d.metalness.id]:e.makeLinearColor(t),[d.roughness.id]:e.makeLinearColor(r),[d.emissive.id]:new v.Color(n??a),[d.height.id]:e.makeLinearColor(s),[d.normal.id]:d.normal.default??new v.Color("#8080ff")};return new e({colors:i})}};var Se=e=>{let a=new v.WebGLRenderer({alpha:!0,antialias:!0}),t=new v.Scene,r=new v.PerspectiveCamera(75,96/96,.1,1e3),n=new v.AmbientLight(16777215,.75);t.add(n);let s=new v.PointLight(16777215,1,100);s.position.set(5,5,5),t.add(s);let l=new v.SphereGeometry(1,32,32),i=new v.MeshStandardMaterial({color:e.albedo,metalness:e.metalness??0,roughness:e.roughness??1,emissive:e.emissive,bumpScale:e.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),h=new v.Mesh(l,i);return t.add(h),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(t,r),a.domElement.toDataURL()},oe="materialBrushPresets",z=()=>JSON.parse(localStorage.getItem(oe)||"{}"),Ae=(e,a)=>{let t=z(),r=a??guid(),n=o.userMaterialBrushPresets?.getFormResult()??{},s={};return n.albedo&&(s.albedo=n.albedo.toString()),n.metalness&&(s.metalness=Number(n.metalness)),n.roughness&&(s.roughness=Number(n.roughness)),n.emissive&&(s.emissive=n.emissive.toString()),n.height&&(s.height=Number(n.height)),t[r]=[s,e??"New Preset",Se(s)],localStorage.setItem(oe,JSON.stringify(t)),r},ie=({metalness:e,roughness:a,emissive:t,height:r,albedo:n})=>{e!==void 0&&o.brushMetalnessSlider?.setValue(e||0,!0),a!==void 0&&o.brushRoughnessSlider?.setValue(a??1,!0),t!==void 0&&o.brushEmissiveColor?.set(t??"#000000"),r!==void 0&&o.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},Ne=W.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:d}},methods:{applyPreset(e){try{let[a,t]=this.userPresets[e],{metalness:r,roughness:n,emissive:s,height:l,albedo:i}=a;ie({metalness:Number(r),roughness:Number(n),emissive:s.toString(),height:Number(l),albedo:i.toString()}),o.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${t}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(e){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let t=z(),r=this.userPresets[e][1]??e;delete t[e],localStorage.setItem("materialBrushPresets",JSON.stringify(t)),this.userPresets=t,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(e){o.userMaterialBrushPresets?.setFormValues({name:this.userPresets[e][1]??e,...this.userPresets[e][0]})},getSummary(e){return Object.entries(e).filter(([a])=>a in this.channels).map(([a,t])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${t}`:`${this.channels[a]?.label??a}: ${Number(t).toFixed(1)}`).join(` +"use strict";(()=>{var b=THREE,W=Vue;var N="_NONE_",u={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new b.Color(16777215)},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new b.Color(0)},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new b.Color(0)},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new b.Color(16777215)},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new b.Color(16777215)},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new b.Color("rgb(128, 128, 255)")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new b.Color(16777215)}},s={},C=[],L=[];var K=[...Object.keys(u).map(t=>u[t].id),N];C.push(()=>{s.channelProp=new Property(TextureLayer,"enum","channel",{default:N,values:K,label:"PBR Channel",exposed:!1}),s.textureChannelProp=new Property(Texture,"enum","channel",{default:N,values:K,label:"PBR Channel",exposed:!1}),s.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),s.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),s.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!1,values:[],label:"PBR Mode"})});var Le=(t=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return t?a.filter(e=>e.layers_enabled&&e.layers.length>0).flatMap(e=>e.layers):a},D=class t{constructor(a,e){this._scope=a??Le(),this._materialUuid=e}merToCanvas(){let a=this.getTexture(u.emissive),e=this.getTexture(u.roughness),r=this.getTexture(u.metalness);if(!a&&!e&&!r){let{metalness:n,emissive:o,roughness:c}=this.decodeMer();n&&(r=t.makePixelatedCanvas(n)),o&&(a=t.makePixelatedCanvas(o)),c&&(e=t.makePixelatedCanvas(c))}return{emissiveMap:a,roughnessMap:e,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:e,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(u.emissive),roughnessMap:this.getTexture(u.roughness),metalnessMap:this.getTexture(u.metalness)},o=this.getTexture(u.normal);return new b.MeshStandardMaterial({map:this.getTexture(u.albedo)??t.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(c=>c.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(u.ao),bumpMap:this.getTexture(u.height),normalMap:o,normalScale:new b.Vector2(1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:e,emissiveIntensity:e?1:0,emissive:e?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}saveTexture(a,e){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=e.uuid,e.extend({channel:a.id}))}findTexture(a,e=!0){if(!Project)return null;let r=this._scope.find(l=>l.channel&&(l.channel===a||l.channel===a.id));if(r)return r;let n=typeof a=="string"?a:a.id;Project.pbr_materials=Project.pbr_materials??{};let o=Project.pbr_materials[this._materialUuid];if(!o&&e&&n!==N){let l=new RegExp(`_*${n}(.[^.]+)?$`,"i");return this._scope.find(h=>l.test(h.name))??null}let c=o?.[n];return c?this._scope.find(l=>l.uuid===c)??null:null}static makePixelatedCanvas(a){let e=new b.CanvasTexture(a,void 0,void 0,void 0,b.NearestFilter,b.NearestFilter);return e.needsUpdate=!0,e}getTexture(a){let e=this.findTexture(a);return e?t.makePixelatedCanvas(e.canvas):null}static extractChannel(a,e){let r=a.canvas,{width:n,height:o}=r,c=r.getContext("2d");if(!c||!n||!o)return null;let l=document.createElement("canvas");l.width=n,l.height=o;let h=l.getContext("2d");if(!h)return null;let x={r:0,g:1,b:2,a:3}[e],{data:g}=c.getImageData(0,0,n,o),m=new Uint8ClampedArray(n*o*4);for(let p=0;pa){f[i]=_.data[i],f[i+1]=_.data[i+1],f[i+2]=_.data[i+2],f[i+3]=255;continue}f[i]=0,f[i+1]=0,f[i+2]=0,f[i+3]=255}return x.putImageData(new ImageData(f,l.width,l.height),0,0),{metalness:r,emissive:l,emissiveLevel:n,roughness:o,sss:c}}createMer(a=!1){let e=this.findTexture(u.metalness,a),r=this.findTexture(u.emissive,a),n=this.findTexture(u.roughness,a),o=this.findTexture("sss",!1),c=Math.max(e?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),l=Math.max(e?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),h=document.createElement("canvas");h.width=c,h.height=l;let x=h.getContext("2d");if(!x)return null;let g=e?.img?t.extractChannel(e,"r"):null,m=r?.img?t.extractChannel(r,"g"):null,_=n?.img?t.extractChannel(n,"b"):null,p=o&&o?.img?t.extractChannel(o,"a"):null,f=g?.getContext("2d")?.getImageData(0,0,c,l)??new ImageData(c,l),i=m?.getContext("2d")?.getImageData(0,0,c,l)??new ImageData(c,l),d=_?.getContext("2d")?.getImageData(0,0,c,l)??new ImageData(c,l),v=p?.getContext("2d")?.getImageData(0,0,c,l)??new ImageData(new Uint8ClampedArray(c*l*4).fill(255),c,l),y=new Uint8ClampedArray(c*l*4);for(let M=0;M{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),e}createTexturesFromNormal(a){let e=this.decodeLabPbrNormal(a);return Object.entries(e).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),e}};var R=class{constructor({lightHeight:a=.66,ambientLight:e=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:n=[1,1,1]}={}){this.lightHeight=a,this.ambientLight=e,this.minLightIntensity=r,this.lightDiffuse=n}bake(a,e,r){let n=e instanceof HTMLCanvasElement?e:this.createCanvas(e.width,e.height),o=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),c=n.getContext("2d"),l=o.getContext("2d");c.drawImage(e,0,0),l.drawImage(r,0,0);let h=c.getImageData(0,0,e.width,e.height),x=l.getImageData(0,0,r.width,r.height),g=[],m=[];for(let p=0;p{let f=this.createCanvas(e.width,e.height),i=f.getContext("2d"),d=i.getImageData(0,0,f.width,f.height),v=[Math.cos(p),Math.sin(p),this.lightHeight];for(let y=0;y{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new D(r.layers_enabled?r.layers:Project.textures,r.uuid),o=n.findTexture(u.albedo);if(!o){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let c=n.findTexture(u.normal);if(!c){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let h=new R(t).bake(a,o.canvas,c.canvas),x=new Texture({name:`${o.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(h[0].toDataURL()),g=e?m=>{let _=n.findTexture(u.emissive);if(!_)return m;let p=_.canvas;if(!p.getContext("2d"))return m;let i=Math.max(m.width,p.width,Project?Project.texture_width:16),d=Math.max(m.height,p.height,Project?Project.texture_height:16),v=document.createElement("canvas");v.width=i,v.height=d;let y=v.getContext("2d");return y?(y.drawImage(m,0,0),y.globalCompositeOperation="screen",y.drawImage(p,0,0),v):m}:m=>m;h.forEach((m,_)=>{new TextureLayer({name:`baked_${_+1}`,data_url:g(m).toDataURL()},x).addForEditing()}),x.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};C.push(()=>{s.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(t){let a=new b.Color(t.ambientLight.toString()),e=new b.Color(t.lightDiffuse.toString());X({ambientLight:[a.r,a.g,a.b],lightDiffuse:[e.r,e.g,e.b],lightHeight:Number(t.lightHeight),minLightIntensity:Number(t.minLightIntensity)},t.directions??8,t.blendEmissive??!1)}}),s.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){s.bakeTexturesDialog?.show()}}),MenuBar.addAction(s.bakeTexturesAction,"tools")});L.push(()=>{MenuBar.removeAction("tools.bake_textures")});function S(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(t=>t.selected)??null:Texture.all.find(t=>t.selected)??Texture.getDefault()}function H(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(t=>t.selected)??Project.selected_texture.layers[0]:S()?.getActiveLayer()??null}function Y(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(S()?.name??"texture")}function Z(t,a){let e;return function(...r){let n=()=>{e=void 0,t.apply(this,r)};clearTimeout(e),e=setTimeout(n,a)}}function ee(t,a){let e=t.getTexture();if(!e||!Project)return null;let r=Project.materials[e.uuid];r.isShaderMaterial&&!Project.bb_materials[e.uuid]&&(Project.bb_materials[e.uuid]=r);let n=new D(e.layers_enabled?e.layers.filter(o=>o.visible)??null:Project.textures,e.uuid).getMaterial(a);return n.side=Canvas.getRenderSide(e),Project.materials[e.uuid]=b.ShaderMaterial.prototype.copy.call(n,r),e}function te(t){return Object.values(t).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function je(t,a){let e={};return t.forAllFaces(r=>{let n=ee(r,a);n&&(e[n.uuid]=n)}),te(e)}function De(t,a){let e={};return Object.keys(t.faces).forEach(r=>{let n=t.faces[r],o=ee(n,a);o&&(e[o.uuid]=o)}),te(e)}var A=(t={})=>{Project&&(Project.pbr_active=Texture.all.length>0&&Project.elements.map(a=>a instanceof Mesh&&je(a,t)||a instanceof Cube&&De(a,t)).filter(Boolean).length>0)},B=(t=100)=>Z(A,t);var Q={},O={};C.push(()=>{Object.entries(u).forEach(([t,a])=>{Q[t]=new Action(`assign_channel_${t}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:{selected:{texture:!0}},click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e)return;Undo.initEdit({layers:[e]}),e.extend({channel:a.id});let r=e instanceof TextureLayer?e.texture:e;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([n,o])=>{o===e.uuid&&(delete Project.pbr_materials[r.uuid][n],e.channel=N)}),r.uuid===e.uuid&&(Project.pbr_materials[r.uuid]={}),Project.pbr_materials[r.uuid][t]=e.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${e.name}" to ${a.label} channel`,2e3),A()}}),O[t]=new Action(`select_channel_${t}`,{icon:a.icon??"tv_options_edit_channels",name:a.label??t,description:`Select the ${a.label} channel`,condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){let e=S();return(e?.layers_enabled?e.layers:Texture.all).some(n=>n.channel===t)}},click(){let e=Texture.selected?.layers_enabled?Texture.selected.layers:Texture.all;if(!e||!e.length)return;let r=e.find(n=>n.channel===t);r&&(r.select(),r.scrollTo())}}),O[t].addLabel(!0,()=>a.label??t)})});L.push(()=>{[...Object.values(Q),...Object.values(O)].forEach(a=>{a.delete()})});C.push(()=>{s.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:{selected:{texture:!0},method(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);return t?.channel&&t.channel!==N}},click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t)return;Undo.initEdit({layers:[t]});let a=t instanceof TextureLayer?t.texture:t,e=t.channel;Project.pbr_materials[a.uuid]={},t.channel=N,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${t.name}" from ${e} channel`,2e3),B()}}),s.channelMenu=new Menu("channel_menu",[...Object.keys(u).map(t=>`assign_channel_${t}`),"unassign_channel"],{onOpen(){B()}}),s.channelSelectionMenu=new Menu("channel_selection_menu",Object.keys(u).map(t=>`select_channel_${t}`)),s.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",click(t){s.channelMenu?.open(t)},children:[...Object.values(Q),s.unassignChannel]}),s.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(t){s.channelMenu?.open(t)}}),s.showChannelSelectionMenu=new Action("show_channel_select_menu",{icon:"tv_options_edit_channels",name:"Select PBR Channel",description:"Select a channel to view",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(t){s.channelSelectionMenu?.open(t)}}),s.openChannelMenu&&(MenuBar.addAction(s.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(s.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(s.openChannelMenu,"0")),Toolbars.layers.add(s.showChannelMenu,1)});L.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(s.showChannelMenu)});function G(t,a=!1){let e=t.canvas.getContext("2d");if(!e)return null;let r=Math.max(t.img.width??t.canvas.width,Project?Project.texture_width:0,16),n=Math.max(t.img.height??t.canvas.height,Project?Project.texture_height:0,16),{data:o}=e.getImageData(0,0,r,n),c=document.createElement("canvas"),l=c.getContext("2d");if(!l)return null;let h=(i,d)=>{let v=(i+d*r)*4;return o[v]/255};c.width=r,c.height=n,l.drawImage(t.img,0,0,r,n);let x=l.getImageData(0,0,r,n),g=x.data,m=i=>{let d=Math.sqrt(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]);return[i[0]/d,i[1]/d,i[2]/d]};for(let i=0;i{let i=(p+f*e)*4;return n[i]/255};o.width=e,o.height=r,c.drawImage(t.img,0,0,e,r);let h=c.getImageData(0,0,e,r),x=h.data;for(let p=0;p{s.generateNormal=new Action("generate_normal",{icon:u.normal.icon??"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(H()??S())!==null,click(t){let a=H()??S()??Texture.getDefault();if(!a)return;let e=G(a);if(!e){Blockbench.showQuickMessage("Failed to generate normal map",2e3);return}e.select(t),new D(a instanceof Texture&&a.layers_enabled?a.layers:null,a.uuid).saveTexture(u.normal,e),Blockbench.showQuickMessage("Normal map generated",2e3)}}),s.generateAo=new Action("generate_ao",{icon:u.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let t=H()??S()??Texture.getDefault();if(!t)return;let a=new D(t instanceof Texture&&t.layers_enabled?t.layers:null,t.uuid),e=a.findTexture(u.normal)??G(t);if(!e){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=ae(e);if(r){a.saveTexture(u.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),MenuBar.addAction(s.generateNormal,"tools"),MenuBar.addAction(s.generateAo,"tools")});L.push(()=>{MenuBar.removeAction("tools.generate_normal")});var re=(t,a)=>{let e=a??document.createElement("canvas"),r=e.getContext("2d");if(!r)return null;let n=Math.max(Project?Project.texture_width:16,16),o=Math.max(Project?Project.texture_height:16,16);return e.width=n,e.height=o,r.fillStyle=`rgb(${t.r*255}, ${t.g*255}, ${t.b*255})`,r.fillRect(0,0,n,o),e.toDataURL()};C.push(()=>{s.createMaterialTexture=new Action("create_material_texture",{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let t={...u},a=new Texture({name:"New Material",saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}),e=Texture.all.filter(o=>o.selected||o.multi_selected)??Texture.all,r=Texture.selected?new D(e,Texture.selected.uuid):null;try{let o=r?.findTexture(u.albedo,!0)?.canvas.toDataURL()??Texture.selected?.canvas.toDataURL()??re(new b.Color(8421504),a.canvas);if(!o)return;a.fromDataURL(o);let c=new TextureLayer({name:t.albedo.label,visible:!0,data_url:o},a);c.extend({channel:t.albedo.id}),c.addForEditing(),c.texture.updateChangesAfterEdit(),delete t.albedo}catch(o){console.warn("Failed to create base color texture",o),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let n=Object.keys(t).map(o=>{let c=u[o],l=r?.findTexture(c,!0),h=l?l.canvas.toDataURL():re(c.default??new b.Color(0));if(!h)return;let x=new TextureLayer({name:c.label,visible:!0,data_url:h},a);return x.extend({channel:c.id}),x}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:n}),a.add().select(),n.map(o=>o.addForEditing()),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(s.createMaterialTexture,"tools"),Toolbars.texturelist.add(s.createMaterialTexture,3)});L.push(()=>{MenuBar.removeAction("tools.create_material_texture")});var U=(t,a)=>{let e=S()??Texture.getDefault(),r=new D(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[o,c]=Project?[t?`${t}_mer`:`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:o,extensions:["png"],resource_id:"mer",savetype:"image",startpath:c},a)})};C.push(()=>{s.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{U()}catch(t){console.error("Failed to export MER map:",t),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),s.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let t=S()??Texture.getDefault(),a=new D([t],t.uuid),e=a.decodeMer(),r=[u.metalness,u.emissive,u.roughness];Undo.initEdit({textures:[t]}),r.forEach(n=>{let o=n.id,c=e[o];if(!c){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new Texture({name:`${t?.name}_${o}`,keep_size:!1}).fromDataURL(c.toDataURL());l.add(!0),a.saveTexture(n,l)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>S()?.layers_enabled===!0,click(){let t=TextureLayer.selected?.texture??Texture.all.find(o=>o.selected)??Texture.getDefault(),a=new D(t.layers_enabled?t.layers:[t],t.uuid),e=a.decodeMer(),r=[u.metalness,u.emissive,u.roughness];Undo.initEdit({textures:[t]});let n=t.selected.activateLayers(!0);r.forEach(o=>{let c=o.id,l=e[c];if(!l){Blockbench.showStatusMessage(`Failed to decode ${o.label} channel`,3e3);return}let h=new TextureLayer({name:`${t?.name}_${c}`,data_url:l.toDataURL()},t);a.saveTexture(o,h),h.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(s.decodeMer,"tools"),MenuBar.addAction(s.generateMer,"file.export")});L.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var ke=()=>{Project&&Project.textures.forEach(t=>{let a=new D(null,t.uuid),e=a.findTexture(u.normal,!1),r=a.findTexture(u.height,!1),n=a.findTexture(u.albedo,!1),o=a.findTexture(u.metalness,!1)?.name,c=a.findTexture(u.emissive,!1)?.name,l=a.findTexture(u.roughness,!1)?.name,h={};return n||(h.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!c&&!l&&(h.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},h.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},h.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),e&&(h.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(h.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),e&&r&&(h.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),s.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:h,cancelIndex:1,onConfirm(x){let g=Y(),m=o||c||l,_={format_version:"1.16.100","minecraft:texture_set":{color:(n?g:x.baseColor?.toHexString())??g,metalness_emissive_roughness:[x.metalness??0,x.emissive??0,x.roughness??255]}};x.depthMap==="normal"&&e||!r&&e?_["minecraft:texture_set"].normal=`${g}_normal`:(!e||x.depthMap==="heightmap")&&r&&(_["minecraft:texture_set"].heightmap=`${g}_heightmap`);let p=d=>{if(!x.depthMap)return d();let v=x.depthMap==="normal"||x.depthMap&&!r,y=v?e:r;if(!y)return d();Blockbench.export({content:y.canvas.toDataURL()??"",type:"PNG",name:`${g}_${v?"normal":"heightmap"}`,extensions:["png"],resource_id:x.depthMap,startpath:Project.export_path,savetype:"image"},M=>{_["minecraft:texture_set"][v?"normal":"heightmap"]=pathToName(M,!1),d()})},f=d=>{if(!n)return d();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:g,startpath:Project.export_path,savetype:"image"},v=>{_["minecraft:texture_set"].color=pathToName(v,!1),d()})},i=()=>p(()=>{f(()=>{Blockbench.export({content:JSON.stringify(_,null,2),type:"JSON",name:`${g}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),s.textureSetDialog?.hide()})})});if(m){try{U(g,d=>{_["minecraft:texture_set"].metalness_emissive_roughness=pathToName(d,!1),i()})}catch(d){console.warn("Failed to export MER map:",d),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}i()}}),s.textureSetDialog.show()})};C.push(()=>{s.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){ke()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(s.createTextureSet,"file.export")});L.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});C.push(()=>{s.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(t){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=t}),Preview.selected.renderer.physicallyCorrectLights=t,Blockbench.showQuickMessage(`Physically corrected lighting is now ${t?"enabled":"disabled"}`,2e3),t&&s.togglePbr?.set(!0),A()},click(){}}),MenuBar.addAction(s.toggleCorrectLights,"preview")});L.push(()=>{MenuBar.removeAction("preview.correct_lights")});var $=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(a=>{let r=t.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var ne=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],se=()=>Project&&Project.pbr_active&&A(),Se=()=>{Blockbench.on(ne.join(" "),se)},oe=()=>{ne.forEach(t=>{Blockbench.removeListener(t,se)})};C.push(()=>{s.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(t){if(t){A(),Se(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}$(),oe(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(s.togglePbr,"view")});L.push(()=>{oe(),MenuBar.removeAction("view.toggle_pbr")});var ie=t=>{let a=Math.max(-2,Math.min(2,t));Preview.all.forEach(e=>{e.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};C.push(()=>{s.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(s.tonemappingSelect?.get())===b.NoToneMapping&&s.tonemappingSelect.change(b.LinearToneMapping.toString()),s.togglePbr?.set(!0)},onChange(t){ie(Number(t))},onAfter(){B()}}),s.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>s.exposureSlider!==void 0&&Number(s.exposureSlider?.get())!==1,click(){ie(1),s.exposureSlider?.setValue(1,!0),B()}}),s.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:b.NoToneMapping,value:Preview.selected.renderer.toneMapping??b.NoToneMapping,icon:"monochrome_photos",options:{[b.NoToneMapping]:"No Tone Mapping",[b.LinearToneMapping]:"Linear",[b.ReinhardToneMapping]:"Reinhard",[b.CineonToneMapping]:"Cineon",[b.NeutralToneMapping]:"Neutral",[b.ACESFilmicToneMapping]:"ACES"},onChange({value:t}){Preview.selected.renderer.toneMapping=Number(t);let a=1;Preview.selected.renderer.toneMapping===b.NoToneMapping?s.exposureSlider?.setValue(a,!0):a=Number(s.exposureSlider?.get()??1),Preview.all.forEach(e=>{e.renderer.toneMapping=Number(t),e.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(t)}`,2e3),s.togglePbr&&!s.togglePbr.value&&s.togglePbr.set(!0),A()}})});var Ae=(t,a="texture")=>{t.toBlob(async e=>{e&&Blockbench.export({content:await e.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},Ne=(t,a="texture")=>{t.toBlob(async e=>{e&&Blockbench.export({content:await e.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};C.push(()=>{s.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let t=S();if(!t)return;let e=new D(t.layers_enabled?t.layers:[t],t.uuid).createLabPbrOutput();if(e===null)return;let r=t.name??(Project?Project.getDisplayName():"texture");await Promise.all([Ae(e.normalMap,pathToName(r)),Ne(e.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),s.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let t=TextureLayer.selected?.texture??Texture.all.find(e=>e.selected)??Texture.getDefault(),a=new D(t.layers_enabled?t.layers:[t],t.uuid);if(pathToName(t.name).endsWith("_n")){a.createTexturesFromNormal(t);return}if(pathToName(t.name).endsWith("_s")){a.createTexturesFromSpecular(t);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(s.generateLabPbr,"file.export"),MenuBar.addAction(s.decodeLabPbr,"tools")});L.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});var F=class t{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(u).map(e=>[e,u[e].default??new b.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([e,r])=>[e,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let e=Math.min(1,Math.max(0,a));return new b.Color(e,e,e).convertSRGBToLinear()}static fromSettings(){let a="#000000",e=Number(s.brushMetalnessSlider?.get()),r=Number(s.brushRoughnessSlider?.get()??1),n=(s.brushEmissiveColor?.get()??a).toString(),o=Number(s.brushHeightSlider?.get()),c=ColorPanel.get(),l={[u.albedo.id]:new b.Color(c),[u.metalness.id]:t.makeLinearColor(e),[u.roughness.id]:t.makeLinearColor(r),[u.emissive.id]:new b.Color(n??a),[u.height.id]:t.makeLinearColor(o),[u.normal.id]:u.normal.default??new b.Color("#8080ff")};return new t({colors:l})}};var Be=t=>{let a=new b.WebGLRenderer({alpha:!0,antialias:!0}),e=new b.Scene,r=new b.PerspectiveCamera(75,96/96,.1,1e3),n=new b.AmbientLight(16777215,.75);e.add(n);let o=new b.PointLight(16777215,1,100);o.position.set(5,5,5),e.add(o);let c=new b.SphereGeometry(1,32,32),l=new b.MeshStandardMaterial({color:t.albedo,metalness:t.metalness??0,roughness:t.roughness??1,emissive:t.emissive,bumpScale:t.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),h=new b.Mesh(c,l);return e.add(h),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(e,r),a.domElement.toDataURL()},le="materialBrushPresets",z=()=>JSON.parse(localStorage.getItem(le)||"{}"),Ie=(t,a)=>{let e=z(),r=a??guid(),n=s.userMaterialBrushPresets?.getFormResult()??{},o={};return n.albedo&&(o.albedo=n.albedo.toString()),n.metalness&&(o.metalness=Number(n.metalness)),n.roughness&&(o.roughness=Number(n.roughness)),n.emissive&&(o.emissive=n.emissive.toString()),n.height&&(o.height=Number(n.height)),e[r]=[o,t??"New Preset",Be(o)],localStorage.setItem(le,JSON.stringify(e)),r},ce=({metalness:t,roughness:a,emissive:e,height:r,albedo:n})=>{t!==void 0&&s.brushMetalnessSlider?.setValue(t||0,!0),a!==void 0&&s.brushRoughnessSlider?.setValue(a??1,!0),e!==void 0&&s.brushEmissiveColor?.set(e??"#000000"),r!==void 0&&s.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},Re=W.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:u}},methods:{applyPreset(t){try{let[a,e]=this.userPresets[t],{metalness:r,roughness:n,emissive:o,height:c,albedo:l}=a;ce({metalness:Number(r),roughness:Number(n),emissive:o.toString(),height:Number(c),albedo:l.toString()}),s.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${e}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(t){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let e=z(),r=this.userPresets[t][1]??t;delete e[t],localStorage.setItem("materialBrushPresets",JSON.stringify(e)),this.userPresets=e,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(t){s.userMaterialBrushPresets?.setFormValues({name:this.userPresets[t][1]??t,...this.userPresets[t][0]})},getSummary(t){return Object.entries(t).filter(([a])=>a in this.channels).map(([a,e])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${e}`:`${this.channels[a]?.label??a}: ${Number(e).toFixed(1)}`).join(` `)}},computed:{presets(){return Object.entries(this.userPresets)}},mounted(){this.userPresets=z()},template:`
      @@ -21,7 +21,7 @@
-
`});C.push(()=>{o.materialBrushStyles=Blockbench.addCSS(` + `});C.push(()=>{s.materialBrushStyles=Blockbench.addCSS(` .preset_list { display: grid; grid-template-columns: repeat(auto-fill, 96px); @@ -103,4 +103,4 @@ .delete_preset:hover .material-icons { color: var(--color-accent); } - `),o.brushMetalnessSlider=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",settings:{min:0,max:1,step:.01,default:0},condition:()=>{if(!Project)return!1;let e=Project.selected_texture;return e?.layers_enabled?e.layers.find(({channel:a})=>a===d.metalness.id)!==void 0:!1}}),o.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",settings:{min:0,max:1,step:.01,default:1},condition:()=>{if(!Project)return!1;let e=Project.selected_texture;return e?.layers_enabled?e.layers.find(({channel:a})=>a===d.roughness.id)!==void 0:!1}}),o.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",condition:()=>{if(!Project)return!1;let e=Project.selected_texture;return e?.layers_enabled?e.layers.find(({channel:a})=>a===d.emissive.id)!==void 0:!1}}),o.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",settings:{min:0,max:1,step:.01,default:.5},condition:()=>{if(!Project)return!1;let e=Project.selected_texture;return e?.layers_enabled?e.layers.find(({channel:a})=>a===d.height.id)!==void 0:!1}}),o.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",category:"tools",toolbar:"brush",condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){return S()?.layers_enabled??!1}},allowed_view_modes:"textured",brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(e,a,t,r,{size:n,softness:s,texture:l}){let i=F.fromSettings(),h=Object.keys(i.colors),g=t;return l.layers.forEach(p=>{if(!p.visible||!h.includes(p.channel))return;let m=i.getChannel(p.channel);m&&(p.ctx.fillStyle=m.getStyle(),p.ctx.fillRect(n*e,n*a,n,n),p.selected&&(g={r:m.r*255,g:m.g*255,b:m.b*255,a:r*255}))}),g}},onCanvasClick(e){Painter.startPaintToolCanvas(e,e.event)},onSelect(){Painter.updateNslideValues(),A()},click(){B()}}),o.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:{project:!0},click(){o.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:Ne,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(e){ie({metalness:Number(e.metalness??o.brushMetalnessSlider?.get()),roughness:Number(e.roughness??o.brushRoughnessSlider?.get()),emissive:(e.emissive??o.brushEmissiveColor?.get()).toString(),height:Number(e.height??o.brushHeightSlider?.get()),albedo:(e.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(e,a){e===1&&Blockbench.textPrompt("Save Preset","New Preset",t=>{t&&(Ae(t),Blockbench.showQuickMessage(`Preset "${t}" saved`,2e3))})}}).show()}}),MenuBar.addAction(o.materialBrushTool,"tools.0")});L.push(()=>{MenuBar.removeAction("tools.material_brush")});C.push(()=>{o.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","load_brush_preset","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Settings"})],condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});C.push(()=>{o.displaySettingsPanel=new Panel("display_settings",{name:"PBR Controls",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure","show_channel_select_menu"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});(()=>{let e=()=>{C.forEach(t=>t())},a=()=>{$(),L.forEach(t=>t()),Object.entries(o).forEach(([t,r])=>{try{r?.delete()}catch(n){console.warn(`Failed to delete ${t} action:`,n)}})};BBPlugin.register("pbr_preview",{version:"1.1.0",title:"PBR Tools",author:"Jason J. Gardner",description:"Create and view PBR materials in Blockbench. Export textures for Java and RenderDragon shaders.",tags:["Minecraft: Java Edition","Minecraft: Bedrock Edition","PBR"],icon:"icon.png",variant:"both",await_loading:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.3",onload:e,onunload:a})})();})(); + `),s.brushMetalnessSlider=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",settings:{min:0,max:1,step:.01,default:0},condition:()=>{if(!Project)return!1;let t=Project.selected_texture;return t?.layers_enabled?t.layers.find(({channel:a})=>a===u.metalness.id)!==void 0:!1}}),s.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",settings:{min:0,max:1,step:.01,default:1},condition:()=>{if(!Project)return!1;let t=Project.selected_texture;return t?.layers_enabled?t.layers.find(({channel:a})=>a===u.roughness.id)!==void 0:!1}}),s.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",condition:()=>{if(!Project)return!1;let t=Project.selected_texture;return t?.layers_enabled?t.layers.find(({channel:a})=>a===u.emissive.id)!==void 0:!1}}),s.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",settings:{min:0,max:1,step:.01,default:.5},condition:()=>{if(!Project)return!1;let t=Project.selected_texture;return t?.layers_enabled?t.layers.find(({channel:a})=>a===u.height.id)!==void 0:!1}}),s.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",category:"tools",toolbar:"brush",condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){return S()?.layers_enabled??!1}},allowed_view_modes:"textured",brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(t,a,e,r,{size:n,softness:o,texture:c}){let l=F.fromSettings(),h=Object.keys(l.colors),x=e;return c.layers.forEach(g=>{if(!g.visible||!h.includes(g.channel))return;let m=l.getChannel(g.channel);m&&(g.ctx.fillStyle=m.getStyle(),g.ctx.fillRect(n*t,n*a,n,n),g.selected&&(x={r:m.r*255,g:m.g*255,b:m.b*255,a:r*255}))}),x}},onCanvasClick(t){Painter.startPaintToolCanvas(t,t.event)},onSelect(){Painter.updateNslideValues(),A()},click(){B()}}),s.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:{project:!0},click(){s.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:Re,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(t){ce({metalness:Number(t.metalness??s.brushMetalnessSlider?.get()),roughness:Number(t.roughness??s.brushRoughnessSlider?.get()),emissive:(t.emissive??s.brushEmissiveColor?.get()).toString(),height:Number(t.height??s.brushHeightSlider?.get()),albedo:(t.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(t,a){t===1&&Blockbench.textPrompt("Save Preset","New Preset",e=>{e&&(Ie(e),Blockbench.showQuickMessage(`Preset "${e}" saved`,2e3))})}}).show()}}),MenuBar.addAction(s.materialBrushTool,"tools.0")});L.push(()=>{MenuBar.removeAction("tools.material_brush")});C.push(()=>{s.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","load_brush_preset","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Settings"})],condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});C.push(()=>{s.displaySettingsPanel=new Panel("display_settings",{name:"PBR Controls",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure","show_channel_select_menu"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});(()=>{let t=()=>{C.forEach(e=>e())},a=()=>{$(),L.forEach(e=>e()),Object.entries(s).forEach(([e,r])=>{try{r?.delete()}catch(n){console.warn(`Failed to delete ${e} action:`,n)}})};BBPlugin.register("pbr_preview",{version:"1.1.0",title:"PBR Tools",author:"Jason J. Gardner",description:"Create and view PBR materials in Blockbench. Export textures for Java and RenderDragon shaders.",tags:["Minecraft: Java Edition","Minecraft: Bedrock Edition","PBR"],icon:"icon.png",variant:"both",await_loading:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.3",onload:t,onunload:a})})();})(); From 6950adac766b097b007f9ba8b92e3b1b6d3b295b Mon Sep 17 00:00:00 2001 From: Jason Date: Mon, 17 Jun 2024 09:02:49 -0500 Subject: [PATCH 21/50] upd: Material brush size/softness (#8) * upd: Dispose material preview renderer - Moved material preview image generator to utils * upd: Add material texture property * upd: Dispose old materials * upd: Activate material brush with presets - Select material brush tool after using the presets dialog * upd: Add cleanup to util functions * upd: Use left-hand normals * upd: Material brush tool settings - Added tool_settings property - Updated display conditions of inputs * upd: Channel assignment menu conditions * feat: Material texture thumbnail preview - Texture thumbnail source using PBR material preview render * fix: Material texture size * fix: Material brush size * fix: Remove material texture button in teardown * upd: Brush softness / Better inference - Allow channels to provide individual inference regex - Reduce material brush effect at edges with softness slider --- plugins/pbr_preview/pbr_preview.js | 15 +- src/pbr_preview/src/constants.ts | 7 + src/pbr_preview/src/lib/PbrMaterials.ts | 13 +- .../src/lib/actions/channelAssignment.ts | 15 +- .../src/lib/actions/materialTexture.ts | 61 +++--- src/pbr_preview/src/lib/applyPbrMaterial.ts | 9 +- src/pbr_preview/src/lib/properties.ts | 6 + .../src/lib/tools/materialBrush.ts | 182 ++++++------------ src/pbr_preview/src/lib/util.ts | 105 ++++++++++ src/pbr_preview/src/types.d.ts | 10 +- 10 files changed, 248 insertions(+), 175 deletions(-) diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index 771e3540..1c4c6a95 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1,5 +1,5 @@ -"use strict";(()=>{var b=THREE,W=Vue;var N="_NONE_",u={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new b.Color(16777215)},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new b.Color(0)},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new b.Color(0)},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new b.Color(16777215)},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new b.Color(16777215)},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new b.Color("rgb(128, 128, 255)")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new b.Color(16777215)}},s={},C=[],L=[];var K=[...Object.keys(u).map(t=>u[t].id),N];C.push(()=>{s.channelProp=new Property(TextureLayer,"enum","channel",{default:N,values:K,label:"PBR Channel",exposed:!1}),s.textureChannelProp=new Property(Texture,"enum","channel",{default:N,values:K,label:"PBR Channel",exposed:!1}),s.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),s.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),s.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!1,values:[],label:"PBR Mode"})});var Le=(t=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return t?a.filter(e=>e.layers_enabled&&e.layers.length>0).flatMap(e=>e.layers):a},D=class t{constructor(a,e){this._scope=a??Le(),this._materialUuid=e}merToCanvas(){let a=this.getTexture(u.emissive),e=this.getTexture(u.roughness),r=this.getTexture(u.metalness);if(!a&&!e&&!r){let{metalness:n,emissive:o,roughness:c}=this.decodeMer();n&&(r=t.makePixelatedCanvas(n)),o&&(a=t.makePixelatedCanvas(o)),c&&(e=t.makePixelatedCanvas(c))}return{emissiveMap:a,roughnessMap:e,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:e,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(u.emissive),roughnessMap:this.getTexture(u.roughness),metalnessMap:this.getTexture(u.metalness)},o=this.getTexture(u.normal);return new b.MeshStandardMaterial({map:this.getTexture(u.albedo)??t.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(c=>c.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(u.ao),bumpMap:this.getTexture(u.height),normalMap:o,normalScale:new b.Vector2(1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:e,emissiveIntensity:e?1:0,emissive:e?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}saveTexture(a,e){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=e.uuid,e.extend({channel:a.id}))}findTexture(a,e=!0){if(!Project)return null;let r=this._scope.find(l=>l.channel&&(l.channel===a||l.channel===a.id));if(r)return r;let n=typeof a=="string"?a:a.id;Project.pbr_materials=Project.pbr_materials??{};let o=Project.pbr_materials[this._materialUuid];if(!o&&e&&n!==N){let l=new RegExp(`_*${n}(.[^.]+)?$`,"i");return this._scope.find(h=>l.test(h.name))??null}let c=o?.[n];return c?this._scope.find(l=>l.uuid===c)??null:null}static makePixelatedCanvas(a){let e=new b.CanvasTexture(a,void 0,void 0,void 0,b.NearestFilter,b.NearestFilter);return e.needsUpdate=!0,e}getTexture(a){let e=this.findTexture(a);return e?t.makePixelatedCanvas(e.canvas):null}static extractChannel(a,e){let r=a.canvas,{width:n,height:o}=r,c=r.getContext("2d");if(!c||!n||!o)return null;let l=document.createElement("canvas");l.width=n,l.height=o;let h=l.getContext("2d");if(!h)return null;let x={r:0,g:1,b:2,a:3}[e],{data:g}=c.getImageData(0,0,n,o),m=new Uint8ClampedArray(n*o*4);for(let p=0;pa){f[i]=_.data[i],f[i+1]=_.data[i+1],f[i+2]=_.data[i+2],f[i+3]=255;continue}f[i]=0,f[i+1]=0,f[i+2]=0,f[i+3]=255}return x.putImageData(new ImageData(f,l.width,l.height),0,0),{metalness:r,emissive:l,emissiveLevel:n,roughness:o,sss:c}}createMer(a=!1){let e=this.findTexture(u.metalness,a),r=this.findTexture(u.emissive,a),n=this.findTexture(u.roughness,a),o=this.findTexture("sss",!1),c=Math.max(e?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),l=Math.max(e?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),h=document.createElement("canvas");h.width=c,h.height=l;let x=h.getContext("2d");if(!x)return null;let g=e?.img?t.extractChannel(e,"r"):null,m=r?.img?t.extractChannel(r,"g"):null,_=n?.img?t.extractChannel(n,"b"):null,p=o&&o?.img?t.extractChannel(o,"a"):null,f=g?.getContext("2d")?.getImageData(0,0,c,l)??new ImageData(c,l),i=m?.getContext("2d")?.getImageData(0,0,c,l)??new ImageData(c,l),d=_?.getContext("2d")?.getImageData(0,0,c,l)??new ImageData(c,l),v=p?.getContext("2d")?.getImageData(0,0,c,l)??new ImageData(new Uint8ClampedArray(c*l*4).fill(255),c,l),y=new Uint8ClampedArray(c*l*4);for(let M=0;M{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),e}createTexturesFromNormal(a){let e=this.decodeLabPbrNormal(a);return Object.entries(e).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),e}};var R=class{constructor({lightHeight:a=.66,ambientLight:e=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:n=[1,1,1]}={}){this.lightHeight=a,this.ambientLight=e,this.minLightIntensity=r,this.lightDiffuse=n}bake(a,e,r){let n=e instanceof HTMLCanvasElement?e:this.createCanvas(e.width,e.height),o=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),c=n.getContext("2d"),l=o.getContext("2d");c.drawImage(e,0,0),l.drawImage(r,0,0);let h=c.getImageData(0,0,e.width,e.height),x=l.getImageData(0,0,r.width,r.height),g=[],m=[];for(let p=0;p{let f=this.createCanvas(e.width,e.height),i=f.getContext("2d"),d=i.getImageData(0,0,f.width,f.height),v=[Math.cos(p),Math.sin(p),this.lightHeight];for(let y=0;y{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new D(r.layers_enabled?r.layers:Project.textures,r.uuid),o=n.findTexture(u.albedo);if(!o){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let c=n.findTexture(u.normal);if(!c){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let h=new R(t).bake(a,o.canvas,c.canvas),x=new Texture({name:`${o.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(h[0].toDataURL()),g=e?m=>{let _=n.findTexture(u.emissive);if(!_)return m;let p=_.canvas;if(!p.getContext("2d"))return m;let i=Math.max(m.width,p.width,Project?Project.texture_width:16),d=Math.max(m.height,p.height,Project?Project.texture_height:16),v=document.createElement("canvas");v.width=i,v.height=d;let y=v.getContext("2d");return y?(y.drawImage(m,0,0),y.globalCompositeOperation="screen",y.drawImage(p,0,0),v):m}:m=>m;h.forEach((m,_)=>{new TextureLayer({name:`baked_${_+1}`,data_url:g(m).toDataURL()},x).addForEditing()}),x.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};C.push(()=>{s.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(t){let a=new b.Color(t.ambientLight.toString()),e=new b.Color(t.lightDiffuse.toString());X({ambientLight:[a.r,a.g,a.b],lightDiffuse:[e.r,e.g,e.b],lightHeight:Number(t.lightHeight),minLightIntensity:Number(t.minLightIntensity)},t.directions??8,t.blendEmissive??!1)}}),s.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){s.bakeTexturesDialog?.show()}}),MenuBar.addAction(s.bakeTexturesAction,"tools")});L.push(()=>{MenuBar.removeAction("tools.bake_textures")});function S(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(t=>t.selected)??null:Texture.all.find(t=>t.selected)??Texture.getDefault()}function H(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(t=>t.selected)??Project.selected_texture.layers[0]:S()?.getActiveLayer()??null}function Y(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(S()?.name??"texture")}function Z(t,a){let e;return function(...r){let n=()=>{e=void 0,t.apply(this,r)};clearTimeout(e),e=setTimeout(n,a)}}function ee(t,a){let e=t.getTexture();if(!e||!Project)return null;let r=Project.materials[e.uuid];r.isShaderMaterial&&!Project.bb_materials[e.uuid]&&(Project.bb_materials[e.uuid]=r);let n=new D(e.layers_enabled?e.layers.filter(o=>o.visible)??null:Project.textures,e.uuid).getMaterial(a);return n.side=Canvas.getRenderSide(e),Project.materials[e.uuid]=b.ShaderMaterial.prototype.copy.call(n,r),e}function te(t){return Object.values(t).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function je(t,a){let e={};return t.forAllFaces(r=>{let n=ee(r,a);n&&(e[n.uuid]=n)}),te(e)}function De(t,a){let e={};return Object.keys(t.faces).forEach(r=>{let n=t.faces[r],o=ee(n,a);o&&(e[o.uuid]=o)}),te(e)}var A=(t={})=>{Project&&(Project.pbr_active=Texture.all.length>0&&Project.elements.map(a=>a instanceof Mesh&&je(a,t)||a instanceof Cube&&De(a,t)).filter(Boolean).length>0)},B=(t=100)=>Z(A,t);var Q={},O={};C.push(()=>{Object.entries(u).forEach(([t,a])=>{Q[t]=new Action(`assign_channel_${t}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:{selected:{texture:!0}},click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e)return;Undo.initEdit({layers:[e]}),e.extend({channel:a.id});let r=e instanceof TextureLayer?e.texture:e;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([n,o])=>{o===e.uuid&&(delete Project.pbr_materials[r.uuid][n],e.channel=N)}),r.uuid===e.uuid&&(Project.pbr_materials[r.uuid]={}),Project.pbr_materials[r.uuid][t]=e.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${e.name}" to ${a.label} channel`,2e3),A()}}),O[t]=new Action(`select_channel_${t}`,{icon:a.icon??"tv_options_edit_channels",name:a.label??t,description:`Select the ${a.label} channel`,condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){let e=S();return(e?.layers_enabled?e.layers:Texture.all).some(n=>n.channel===t)}},click(){let e=Texture.selected?.layers_enabled?Texture.selected.layers:Texture.all;if(!e||!e.length)return;let r=e.find(n=>n.channel===t);r&&(r.select(),r.scrollTo())}}),O[t].addLabel(!0,()=>a.label??t)})});L.push(()=>{[...Object.values(Q),...Object.values(O)].forEach(a=>{a.delete()})});C.push(()=>{s.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:{selected:{texture:!0},method(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);return t?.channel&&t.channel!==N}},click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t)return;Undo.initEdit({layers:[t]});let a=t instanceof TextureLayer?t.texture:t,e=t.channel;Project.pbr_materials[a.uuid]={},t.channel=N,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${t.name}" from ${e} channel`,2e3),B()}}),s.channelMenu=new Menu("channel_menu",[...Object.keys(u).map(t=>`assign_channel_${t}`),"unassign_channel"],{onOpen(){B()}}),s.channelSelectionMenu=new Menu("channel_selection_menu",Object.keys(u).map(t=>`select_channel_${t}`)),s.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",click(t){s.channelMenu?.open(t)},children:[...Object.values(Q),s.unassignChannel]}),s.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(t){s.channelMenu?.open(t)}}),s.showChannelSelectionMenu=new Action("show_channel_select_menu",{icon:"tv_options_edit_channels",name:"Select PBR Channel",description:"Select a channel to view",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(t){s.channelSelectionMenu?.open(t)}}),s.openChannelMenu&&(MenuBar.addAction(s.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(s.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(s.openChannelMenu,"0")),Toolbars.layers.add(s.showChannelMenu,1)});L.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(s.showChannelMenu)});function G(t,a=!1){let e=t.canvas.getContext("2d");if(!e)return null;let r=Math.max(t.img.width??t.canvas.width,Project?Project.texture_width:0,16),n=Math.max(t.img.height??t.canvas.height,Project?Project.texture_height:0,16),{data:o}=e.getImageData(0,0,r,n),c=document.createElement("canvas"),l=c.getContext("2d");if(!l)return null;let h=(i,d)=>{let v=(i+d*r)*4;return o[v]/255};c.width=r,c.height=n,l.drawImage(t.img,0,0,r,n);let x=l.getImageData(0,0,r,n),g=x.data,m=i=>{let d=Math.sqrt(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]);return[i[0]/d,i[1]/d,i[2]/d]};for(let i=0;i{let i=(p+f*e)*4;return n[i]/255};o.width=e,o.height=r,c.drawImage(t.img,0,0,e,r);let h=c.getImageData(0,0,e,r),x=h.data;for(let p=0;p{s.generateNormal=new Action("generate_normal",{icon:u.normal.icon??"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(H()??S())!==null,click(t){let a=H()??S()??Texture.getDefault();if(!a)return;let e=G(a);if(!e){Blockbench.showQuickMessage("Failed to generate normal map",2e3);return}e.select(t),new D(a instanceof Texture&&a.layers_enabled?a.layers:null,a.uuid).saveTexture(u.normal,e),Blockbench.showQuickMessage("Normal map generated",2e3)}}),s.generateAo=new Action("generate_ao",{icon:u.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let t=H()??S()??Texture.getDefault();if(!t)return;let a=new D(t instanceof Texture&&t.layers_enabled?t.layers:null,t.uuid),e=a.findTexture(u.normal)??G(t);if(!e){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=ae(e);if(r){a.saveTexture(u.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),MenuBar.addAction(s.generateNormal,"tools"),MenuBar.addAction(s.generateAo,"tools")});L.push(()=>{MenuBar.removeAction("tools.generate_normal")});var re=(t,a)=>{let e=a??document.createElement("canvas"),r=e.getContext("2d");if(!r)return null;let n=Math.max(Project?Project.texture_width:16,16),o=Math.max(Project?Project.texture_height:16,16);return e.width=n,e.height=o,r.fillStyle=`rgb(${t.r*255}, ${t.g*255}, ${t.b*255})`,r.fillRect(0,0,n,o),e.toDataURL()};C.push(()=>{s.createMaterialTexture=new Action("create_material_texture",{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let t={...u},a=new Texture({name:"New Material",saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}),e=Texture.all.filter(o=>o.selected||o.multi_selected)??Texture.all,r=Texture.selected?new D(e,Texture.selected.uuid):null;try{let o=r?.findTexture(u.albedo,!0)?.canvas.toDataURL()??Texture.selected?.canvas.toDataURL()??re(new b.Color(8421504),a.canvas);if(!o)return;a.fromDataURL(o);let c=new TextureLayer({name:t.albedo.label,visible:!0,data_url:o},a);c.extend({channel:t.albedo.id}),c.addForEditing(),c.texture.updateChangesAfterEdit(),delete t.albedo}catch(o){console.warn("Failed to create base color texture",o),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let n=Object.keys(t).map(o=>{let c=u[o],l=r?.findTexture(c,!0),h=l?l.canvas.toDataURL():re(c.default??new b.Color(0));if(!h)return;let x=new TextureLayer({name:c.label,visible:!0,data_url:h},a);return x.extend({channel:c.id}),x}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:n}),a.add().select(),n.map(o=>o.addForEditing()),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(s.createMaterialTexture,"tools"),Toolbars.texturelist.add(s.createMaterialTexture,3)});L.push(()=>{MenuBar.removeAction("tools.create_material_texture")});var U=(t,a)=>{let e=S()??Texture.getDefault(),r=new D(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[o,c]=Project?[t?`${t}_mer`:`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:o,extensions:["png"],resource_id:"mer",savetype:"image",startpath:c},a)})};C.push(()=>{s.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{U()}catch(t){console.error("Failed to export MER map:",t),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),s.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let t=S()??Texture.getDefault(),a=new D([t],t.uuid),e=a.decodeMer(),r=[u.metalness,u.emissive,u.roughness];Undo.initEdit({textures:[t]}),r.forEach(n=>{let o=n.id,c=e[o];if(!c){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new Texture({name:`${t?.name}_${o}`,keep_size:!1}).fromDataURL(c.toDataURL());l.add(!0),a.saveTexture(n,l)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>S()?.layers_enabled===!0,click(){let t=TextureLayer.selected?.texture??Texture.all.find(o=>o.selected)??Texture.getDefault(),a=new D(t.layers_enabled?t.layers:[t],t.uuid),e=a.decodeMer(),r=[u.metalness,u.emissive,u.roughness];Undo.initEdit({textures:[t]});let n=t.selected.activateLayers(!0);r.forEach(o=>{let c=o.id,l=e[c];if(!l){Blockbench.showStatusMessage(`Failed to decode ${o.label} channel`,3e3);return}let h=new TextureLayer({name:`${t?.name}_${c}`,data_url:l.toDataURL()},t);a.saveTexture(o,h),h.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(s.decodeMer,"tools"),MenuBar.addAction(s.generateMer,"file.export")});L.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var ke=()=>{Project&&Project.textures.forEach(t=>{let a=new D(null,t.uuid),e=a.findTexture(u.normal,!1),r=a.findTexture(u.height,!1),n=a.findTexture(u.albedo,!1),o=a.findTexture(u.metalness,!1)?.name,c=a.findTexture(u.emissive,!1)?.name,l=a.findTexture(u.roughness,!1)?.name,h={};return n||(h.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!o&&!c&&!l&&(h.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},h.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},h.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),e&&(h.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(h.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),e&&r&&(h.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),s.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:h,cancelIndex:1,onConfirm(x){let g=Y(),m=o||c||l,_={format_version:"1.16.100","minecraft:texture_set":{color:(n?g:x.baseColor?.toHexString())??g,metalness_emissive_roughness:[x.metalness??0,x.emissive??0,x.roughness??255]}};x.depthMap==="normal"&&e||!r&&e?_["minecraft:texture_set"].normal=`${g}_normal`:(!e||x.depthMap==="heightmap")&&r&&(_["minecraft:texture_set"].heightmap=`${g}_heightmap`);let p=d=>{if(!x.depthMap)return d();let v=x.depthMap==="normal"||x.depthMap&&!r,y=v?e:r;if(!y)return d();Blockbench.export({content:y.canvas.toDataURL()??"",type:"PNG",name:`${g}_${v?"normal":"heightmap"}`,extensions:["png"],resource_id:x.depthMap,startpath:Project.export_path,savetype:"image"},M=>{_["minecraft:texture_set"][v?"normal":"heightmap"]=pathToName(M,!1),d()})},f=d=>{if(!n)return d();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:g,startpath:Project.export_path,savetype:"image"},v=>{_["minecraft:texture_set"].color=pathToName(v,!1),d()})},i=()=>p(()=>{f(()=>{Blockbench.export({content:JSON.stringify(_,null,2),type:"JSON",name:`${g}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),s.textureSetDialog?.hide()})})});if(m){try{U(g,d=>{_["minecraft:texture_set"].metalness_emissive_roughness=pathToName(d,!1),i()})}catch(d){console.warn("Failed to export MER map:",d),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}i()}}),s.textureSetDialog.show()})};C.push(()=>{s.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){ke()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(s.createTextureSet,"file.export")});L.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});C.push(()=>{s.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(t){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=t}),Preview.selected.renderer.physicallyCorrectLights=t,Blockbench.showQuickMessage(`Physically corrected lighting is now ${t?"enabled":"disabled"}`,2e3),t&&s.togglePbr?.set(!0),A()},click(){}}),MenuBar.addAction(s.toggleCorrectLights,"preview")});L.push(()=>{MenuBar.removeAction("preview.correct_lights")});var $=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(a=>{let r=t.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var ne=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],se=()=>Project&&Project.pbr_active&&A(),Se=()=>{Blockbench.on(ne.join(" "),se)},oe=()=>{ne.forEach(t=>{Blockbench.removeListener(t,se)})};C.push(()=>{s.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(t){if(t){A(),Se(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}$(),oe(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(s.togglePbr,"view")});L.push(()=>{oe(),MenuBar.removeAction("view.toggle_pbr")});var ie=t=>{let a=Math.max(-2,Math.min(2,t));Preview.all.forEach(e=>{e.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};C.push(()=>{s.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(s.tonemappingSelect?.get())===b.NoToneMapping&&s.tonemappingSelect.change(b.LinearToneMapping.toString()),s.togglePbr?.set(!0)},onChange(t){ie(Number(t))},onAfter(){B()}}),s.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>s.exposureSlider!==void 0&&Number(s.exposureSlider?.get())!==1,click(){ie(1),s.exposureSlider?.setValue(1,!0),B()}}),s.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:b.NoToneMapping,value:Preview.selected.renderer.toneMapping??b.NoToneMapping,icon:"monochrome_photos",options:{[b.NoToneMapping]:"No Tone Mapping",[b.LinearToneMapping]:"Linear",[b.ReinhardToneMapping]:"Reinhard",[b.CineonToneMapping]:"Cineon",[b.NeutralToneMapping]:"Neutral",[b.ACESFilmicToneMapping]:"ACES"},onChange({value:t}){Preview.selected.renderer.toneMapping=Number(t);let a=1;Preview.selected.renderer.toneMapping===b.NoToneMapping?s.exposureSlider?.setValue(a,!0):a=Number(s.exposureSlider?.get()??1),Preview.all.forEach(e=>{e.renderer.toneMapping=Number(t),e.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(t)}`,2e3),s.togglePbr&&!s.togglePbr.value&&s.togglePbr.set(!0),A()}})});var Ae=(t,a="texture")=>{t.toBlob(async e=>{e&&Blockbench.export({content:await e.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},Ne=(t,a="texture")=>{t.toBlob(async e=>{e&&Blockbench.export({content:await e.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};C.push(()=>{s.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let t=S();if(!t)return;let e=new D(t.layers_enabled?t.layers:[t],t.uuid).createLabPbrOutput();if(e===null)return;let r=t.name??(Project?Project.getDisplayName():"texture");await Promise.all([Ae(e.normalMap,pathToName(r)),Ne(e.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),s.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let t=TextureLayer.selected?.texture??Texture.all.find(e=>e.selected)??Texture.getDefault(),a=new D(t.layers_enabled?t.layers:[t],t.uuid);if(pathToName(t.name).endsWith("_n")){a.createTexturesFromNormal(t);return}if(pathToName(t.name).endsWith("_s")){a.createTexturesFromSpecular(t);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(s.generateLabPbr,"file.export"),MenuBar.addAction(s.decodeLabPbr,"tools")});L.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});var F=class t{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(u).map(e=>[e,u[e].default??new b.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([e,r])=>[e,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let e=Math.min(1,Math.max(0,a));return new b.Color(e,e,e).convertSRGBToLinear()}static fromSettings(){let a="#000000",e=Number(s.brushMetalnessSlider?.get()),r=Number(s.brushRoughnessSlider?.get()??1),n=(s.brushEmissiveColor?.get()??a).toString(),o=Number(s.brushHeightSlider?.get()),c=ColorPanel.get(),l={[u.albedo.id]:new b.Color(c),[u.metalness.id]:t.makeLinearColor(e),[u.roughness.id]:t.makeLinearColor(r),[u.emissive.id]:new b.Color(n??a),[u.height.id]:t.makeLinearColor(o),[u.normal.id]:u.normal.default??new b.Color("#8080ff")};return new t({colors:l})}};var Be=t=>{let a=new b.WebGLRenderer({alpha:!0,antialias:!0}),e=new b.Scene,r=new b.PerspectiveCamera(75,96/96,.1,1e3),n=new b.AmbientLight(16777215,.75);e.add(n);let o=new b.PointLight(16777215,1,100);o.position.set(5,5,5),e.add(o);let c=new b.SphereGeometry(1,32,32),l=new b.MeshStandardMaterial({color:t.albedo,metalness:t.metalness??0,roughness:t.roughness??1,emissive:t.emissive,bumpScale:t.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),h=new b.Mesh(c,l);return e.add(h),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(e,r),a.domElement.toDataURL()},le="materialBrushPresets",z=()=>JSON.parse(localStorage.getItem(le)||"{}"),Ie=(t,a)=>{let e=z(),r=a??guid(),n=s.userMaterialBrushPresets?.getFormResult()??{},o={};return n.albedo&&(o.albedo=n.albedo.toString()),n.metalness&&(o.metalness=Number(n.metalness)),n.roughness&&(o.roughness=Number(n.roughness)),n.emissive&&(o.emissive=n.emissive.toString()),n.height&&(o.height=Number(n.height)),e[r]=[o,t??"New Preset",Be(o)],localStorage.setItem(le,JSON.stringify(e)),r},ce=({metalness:t,roughness:a,emissive:e,height:r,albedo:n})=>{t!==void 0&&s.brushMetalnessSlider?.setValue(t||0,!0),a!==void 0&&s.brushRoughnessSlider?.setValue(a??1,!0),e!==void 0&&s.brushEmissiveColor?.set(e??"#000000"),r!==void 0&&s.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},Re=W.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:u}},methods:{applyPreset(t){try{let[a,e]=this.userPresets[t],{metalness:r,roughness:n,emissive:o,height:c,albedo:l}=a;ce({metalness:Number(r),roughness:Number(n),emissive:o.toString(),height:Number(c),albedo:l.toString()}),s.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${e}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(t){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let e=z(),r=this.userPresets[t][1]??t;delete e[t],localStorage.setItem("materialBrushPresets",JSON.stringify(e)),this.userPresets=e,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(t){s.userMaterialBrushPresets?.setFormValues({name:this.userPresets[t][1]??t,...this.userPresets[t][0]})},getSummary(t){return Object.entries(t).filter(([a])=>a in this.channels).map(([a,e])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${e}`:`${this.channels[a]?.label??a}: ${Number(e).toFixed(1)}`).join(` -`)}},computed:{presets(){return Object.entries(this.userPresets)}},mounted(){this.userPresets=z()},template:` +"use strict";(()=>{var b=THREE,X=Vue;var N="_NONE_",u={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new b.Color(16777215),regex:new RegExp("(s|_)*(basecolor|color|albedo)","i")},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new b.Color(0),regex:new RegExp("[ _]*metal(lic|ness)?","i")},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new b.Color(0),regex:new RegExp("[ _]*emissive","i")},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new b.Color(16777215),regex:new RegExp("[ _]*rough(ness)?","i")},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new b.Color(16777215),regex:new RegExp("[ _]*(height|bump)","i")},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new b.Color("rgb(128, 128, 255)"),regex:new RegExp("[ _]*normal","i")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new b.Color(16777215),regex:new RegExp("[ _]*(ao|ambientocclusion|ambient occlusion)","i")}},s={},C=[],L=[];var Y=[...Object.keys(u).map(t=>u[t].id),N];C.push(()=>{s.channelProp=new Property(TextureLayer,"enum","channel",{default:N,values:Y,label:"PBR Channel",exposed:!1}),s.textureChannelProp=new Property(Texture,"enum","channel",{default:N,values:Y,label:"PBR Channel",exposed:!1}),s.materialTextureProp=new Property(Texture,"boolean","material",{default:!1,label:"Material Texture"}),s.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),s.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),s.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!1,values:[],label:"PBR Mode"})});function k(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(t=>t.selected)??null:Texture.all.find(t=>t.selected)??Texture.getDefault()}function R(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(t=>t.selected)??Project.selected_texture.layers[0]:k()?.getActiveLayer()??null}function ee(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(k()?.name??"texture")}function te(t,a){let e;return function(...r){let n=()=>{e=void 0,t.apply(this,r)};clearTimeout(e),e=setTimeout(n,a)}}function H(t){let a=MediaPreview.renderer??new b.WebGLRenderer({alpha:!0,antialias:!0}),e=new b.Scene,r=new b.PerspectiveCamera(75,96/96,.1,1e3),n=new b.AmbientLight(16777215,.75);e.add(n);let i=new b.PointLight(16777215,1,100);i.position.set(5,5,5),e.add(i);let l=new b.SphereGeometry(1,32,32),o=t instanceof b.MeshStandardMaterial&&t.isMeshStandardMaterial?t:new b.MeshStandardMaterial({color:t.albedo,metalness:t.metalness??0,roughness:t.roughness??1,emissive:t.emissive,bumpScale:t.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),g=new b.Mesh(l,o);e.add(g),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(e,r);let f=a.domElement.toDataURL();return o.dispose(),MediaPreview.renderer||(a.clear(),a.dispose()),f}function Q(t,a){let e=a??document.createElement("canvas"),r=e.getContext("2d");if(!r)return e.remove(),null;let n=Math.max(Project?Project.texture_width:16,16),i=Math.max(Project?Project.texture_height:16,16);e.width=n,e.height=i,r.fillStyle=`rgb(${t.r*255}, ${t.g*255}, ${t.b*255})`,r.fillRect(0,0,n,i);let l=e.toDataURL();return a||e.remove(),l}var De=(t=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return t?a.filter(e=>e.layers_enabled&&e.layers.length>0).flatMap(e=>e.layers):a},D=class t{constructor(a,e){this._scope=a??De(),this._materialUuid=e}merToCanvas(){let a=this.getTexture(u.emissive),e=this.getTexture(u.roughness),r=this.getTexture(u.metalness);if(!a&&!e&&!r){let{metalness:n,emissive:i,roughness:l}=this.decodeMer();n&&(r=t.makePixelatedCanvas(n)),i&&(a=t.makePixelatedCanvas(i)),l&&(e=t.makePixelatedCanvas(l))}return{emissiveMap:a,roughnessMap:e,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:e,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(u.emissive),roughnessMap:this.getTexture(u.roughness),metalnessMap:this.getTexture(u.metalness)},i=this.getTexture(u.normal);return new b.MeshStandardMaterial({map:this.getTexture(u.albedo)??t.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(l=>l.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(u.ao),bumpMap:this.getTexture(u.height),normalMap:i,normalScale:new b.Vector2(-1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:e,emissiveIntensity:e?1:0,emissive:e?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}renderMaterialPreview(){return H(this.getMaterial())}saveTexture(a,e){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=e.uuid,e.extend({channel:a.id}))}findTexture(a,e=!0){if(!Project)return null;let r=this._scope.find(o=>o.channel&&(o.channel===a||o.channel===a.id));if(r)return r;let n=typeof a=="string"?a:a.id;Project.pbr_materials=Project.pbr_materials??{};let i=Project.pbr_materials[this._materialUuid];if(e&&!i&&n!==N){let o=u[n].regex??new RegExp(`_*${n}(.[^.]+)?$`,"i");return this._scope.find(g=>o.test(g.name))??null}let l=i?.[n];return l?this._scope.find(o=>o.uuid===l)??null:null}static makePixelatedCanvas(a){let e=new b.CanvasTexture(a,void 0,void 0,void 0,b.NearestFilter,b.NearestFilter);return e.needsUpdate=!0,e}getTexture(a){let e=this.findTexture(a);return e?t.makePixelatedCanvas(e.canvas):null}static extractChannel(a,e){let r=a.canvas,{width:n,height:i}=r,l=r.getContext("2d");if(!l||!n||!i)return null;let o=document.createElement("canvas");o.width=n,o.height=i;let g=o.getContext("2d");if(!g)return null;let f={r:0,g:1,b:2,a:3}[e],{data:x}=l.getImageData(0,0,n,i),h=new Uint8ClampedArray(n*i*4);for(let m=0;ma){p[c]=_.data[c],p[c+1]=_.data[c+1],p[c+2]=_.data[c+2],p[c+3]=255;continue}p[c]=0,p[c+1]=0,p[c+2]=0,p[c+3]=255}return f.putImageData(new ImageData(p,o.width,o.height),0,0),{metalness:r,emissive:o,emissiveLevel:n,roughness:i,sss:l}}createMer(a=!1){let e=this.findTexture(u.metalness,a),r=this.findTexture(u.emissive,a),n=this.findTexture(u.roughness,a),i=this.findTexture("sss",!1),l=Math.max(e?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),o=Math.max(e?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),g=document.createElement("canvas");g.width=l,g.height=o;let f=g.getContext("2d");if(!f)return null;let x=e?.img?t.extractChannel(e,"r"):null,h=r?.img?t.extractChannel(r,"g"):null,_=n?.img?t.extractChannel(n,"b"):null,m=i&&i?.img?t.extractChannel(i,"a"):null,p=x?.getContext("2d")?.getImageData(0,0,l,o)??new ImageData(l,o),c=h?.getContext("2d")?.getImageData(0,0,l,o)??new ImageData(l,o),d=_?.getContext("2d")?.getImageData(0,0,l,o)??new ImageData(l,o),v=m?.getContext("2d")?.getImageData(0,0,l,o)??new ImageData(new Uint8ClampedArray(l*o*4).fill(255),l,o),M=new Uint8ClampedArray(l*o*4);for(let w=0;w{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),e}createTexturesFromNormal(a){let e=this.decodeLabPbrNormal(a);return Object.entries(e).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),e}};var U=class{constructor({lightHeight:a=.66,ambientLight:e=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:n=[1,1,1]}={}){this.lightHeight=a,this.ambientLight=e,this.minLightIntensity=r,this.lightDiffuse=n}bake(a,e,r){let n=e instanceof HTMLCanvasElement?e:this.createCanvas(e.width,e.height),i=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),l=n.getContext("2d"),o=i.getContext("2d");l.drawImage(e,0,0),o.drawImage(r,0,0);let g=l.getImageData(0,0,e.width,e.height),f=o.getImageData(0,0,r.width,r.height),x=[],h=[];for(let m=0;m{let p=this.createCanvas(e.width,e.height),c=p.getContext("2d"),d=c.getImageData(0,0,p.width,p.height),v=[Math.cos(m),Math.sin(m),this.lightHeight];for(let M=0;M{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new D(r.layers_enabled?r.layers:Project.textures,r.uuid),i=n.findTexture(u.albedo);if(!i){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let l=n.findTexture(u.normal);if(!l){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let g=new U(t).bake(a,i.canvas,l.canvas),f=new Texture({name:`${i.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(g[0].toDataURL()),x=e?h=>{let _=n.findTexture(u.emissive);if(!_)return h;let m=_.canvas;if(!m.getContext("2d"))return h;let c=Math.max(h.width,m.width,Project?Project.texture_width:16),d=Math.max(h.height,m.height,Project?Project.texture_height:16),v=document.createElement("canvas");v.width=c,v.height=d;let M=v.getContext("2d");return M?(M.drawImage(h,0,0),M.globalCompositeOperation="screen",M.drawImage(m,0,0),v):h}:h=>h;g.forEach((h,_)=>{new TextureLayer({name:`baked_${_+1}`,data_url:x(h).toDataURL()},f).addForEditing()}),f.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};C.push(()=>{s.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(t){let a=new b.Color(t.ambientLight.toString()),e=new b.Color(t.lightDiffuse.toString());ae({ambientLight:[a.r,a.g,a.b],lightDiffuse:[e.r,e.g,e.b],lightHeight:Number(t.lightHeight),minLightIntensity:Number(t.minLightIntensity)},t.directions??8,t.blendEmissive??!1)}}),s.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){s.bakeTexturesDialog?.show()}}),MenuBar.addAction(s.bakeTexturesAction,"tools")});L.push(()=>{MenuBar.removeAction("tools.bake_textures")});function re(t,a){let e=t.getTexture();if(!e||!Project)return null;let r=Project.materials[e.uuid];r.isShaderMaterial&&!Project.bb_materials[e.uuid]?Project.bb_materials[e.uuid]=r:r.isMeshStandardMaterial&&r.dispose();let n=new D(e.layers_enabled?e.layers.filter(i=>i.visible)??null:Project.textures,e.uuid).getMaterial({side:Canvas.getRenderSide(e),...a});return Project.materials[e.uuid]=b.ShaderMaterial.prototype.copy.call(n,r),e}function ne(t){return Object.values(t).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function ke(t,a){let e={};return t.forAllFaces(r=>{let n=re(r,a);n&&(e[n.uuid]=n)}),ne(e)}function Se(t,a){let e={};return Object.keys(t.faces).forEach(r=>{let n=t.faces[r],i=re(n,a);i&&(e[i.uuid]=i)}),ne(e)}var A=(t={})=>{Project&&(Project.pbr_active=Texture.all.length>0&&Project.elements.map(a=>a instanceof Mesh&&ke(a,t)||a instanceof Cube&&Se(a,t)).filter(Boolean).length>0)},B=(t=100)=>te(A,t);var V={},G={};C.push(()=>{Object.entries(u).forEach(([t,a])=>{V[t]=new Action(`assign_channel_${t}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:{selected:{texture:!0},project:!0,method(){return k()?.material===!0&&R()!==null}},click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e)return;Undo.initEdit({layers:[e]}),e.extend({channel:a.id});let r=e instanceof TextureLayer?e.texture:e;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([n,i])=>{i===e.uuid&&(delete Project.pbr_materials[r.uuid][n],e.channel=N)}),r.uuid===e.uuid&&(Project.pbr_materials[r.uuid]={}),Project.pbr_materials[r.uuid][t]=e.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${e.name}" to ${a.label} channel`,2e3),A()}}),G[t]=new Action(`select_channel_${t}`,{icon:a.icon??"tv_options_edit_channels",name:a.label??t,description:`Select the ${a.label} channel`,condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){let e=k();return(e?.layers_enabled?e.layers:Texture.all).some(n=>n.channel===t)}},click(){let e=Texture.selected?.layers_enabled?Texture.selected.layers:Texture.all;if(!e||!e.length)return;let r=e.find(n=>n.channel===t);r&&(r.select(),r.scrollTo())}}),G[t].addLabel(!0,()=>a.label??t)})});L.push(()=>{[...Object.values(V),...Object.values(G)].forEach(a=>{a.delete()})});C.push(()=>{s.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:{selected:{texture:!0},method(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);return t?.channel&&t.channel!==N}},click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t)return;Undo.initEdit({layers:[t]});let a=t instanceof TextureLayer?t.texture:t,e=t.channel;Project.pbr_materials[a.uuid]={},t.channel=N,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${t.name}" from ${e} channel`,2e3),B()}}),s.channelMenu=new Menu("channel_menu",[...Object.keys(u).map(t=>`assign_channel_${t}`),"unassign_channel"],{onOpen(){B()}}),s.channelSelectionMenu=new Menu("channel_selection_menu",Object.keys(u).map(t=>`select_channel_${t}`)),s.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",condition:{modes:["edit","paint"],selected:{texture:!0}},click(t){s.channelMenu?.open(t)},children:[...Object.values(V),s.unassignChannel]}),s.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(t){s.channelMenu?.open(t)}}),s.showChannelSelectionMenu=new Action("show_channel_select_menu",{icon:"tv_options_edit_channels",name:"Select PBR Channel",description:"Select a channel to view",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(t){s.channelSelectionMenu?.open(t)}}),s.openChannelMenu&&(MenuBar.addAction(s.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(s.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(s.openChannelMenu,"0")),Toolbars.layers.add(s.showChannelMenu,1)});L.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(s.showChannelMenu)});function J(t,a=!1){let e=t.canvas.getContext("2d");if(!e)return null;let r=Math.max(t.img.width??t.canvas.width,Project?Project.texture_width:0,16),n=Math.max(t.img.height??t.canvas.height,Project?Project.texture_height:0,16),{data:i}=e.getImageData(0,0,r,n),l=document.createElement("canvas"),o=l.getContext("2d");if(!o)return null;let g=(c,d)=>{let v=(c+d*r)*4;return i[v]/255};l.width=r,l.height=n,o.drawImage(t.img,0,0,r,n);let f=o.getImageData(0,0,r,n),x=f.data,h=c=>{let d=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);return[c[0]/d,c[1]/d,c[2]/d]};for(let c=0;c{let c=(m+p*e)*4;return n[c]/255};i.width=e,i.height=r,l.drawImage(t.img,0,0,e,r);let g=l.getImageData(0,0,e,r),f=g.data;for(let m=0;m{s.generateNormal=new Action("generate_normal",{icon:u.normal.icon??"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(R()??k())!==null,click(t){let a=R()??k()??Texture.getDefault();if(!a)return;let e=J(a);if(!e){Blockbench.showQuickMessage("Failed to generate normal map",2e3);return}e.select(t),new D(a instanceof Texture&&a.layers_enabled?a.layers:null,a.uuid).saveTexture(u.normal,e),Blockbench.showQuickMessage("Normal map generated",2e3)}}),s.generateAo=new Action("generate_ao",{icon:u.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let t=R()??k()??Texture.getDefault();if(!t)return;let a=new D(t instanceof Texture&&t.layers_enabled?t.layers:null,t.uuid),e=a.findTexture(u.normal)??J(t);if(!e){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=se(e);if(r){a.saveTexture(u.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),MenuBar.addAction(s.generateNormal,"tools"),MenuBar.addAction(s.generateAo,"tools")});L.push(()=>{MenuBar.removeAction("tools.generate_normal")});C.push(()=>{s.createMaterialTexture=new Action("create_material_texture",{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let t={...u},a=new Texture({name:"New Material",saved:!1,particle:!1});a.extend({material:!0});let e=Texture.all.filter(l=>l.selected||l.multi_selected)??Texture.all,r=k(),n=r?new D(e,r.uuid):null;try{let l=n?.findTexture(u.albedo,!0)?.canvas.toDataURL()??r?.canvas.toDataURL()??Q(new b.Color(8421504),a.canvas);if(!l)return;a.fromDataURL(l);let o=new TextureLayer({name:t.albedo.label,visible:!0,data_url:l,keep_size:!0},a);o.extend({channel:t.albedo.id}),o.addForEditing(),o.texture.updateChangesAfterEdit(),n?.saveTexture(t.albedo,o),delete t.albedo}catch(l){console.warn("Failed to create base color texture",l),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let i=Object.keys(t).map(l=>{let o=u[l],g=n?.findTexture(o,!0),f=g?g.canvas.toDataURL():Q(o.default??new b.Color(0));if(!f)return;let x=new TextureLayer({name:o.label,visible:!0,data_url:f,keep_size:!0},a);return x.extend({channel:o.id}),n?.saveTexture(o,x),x}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:i}),a.add().select(),a.activateLayers(),i.map(l=>{l.addForEditing(),a.width=Math.max(a.width,l.img.width),a.height=Math.max(a.height,l.img.height)}),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(s.createMaterialTexture,"tools"),Toolbars.texturelist.add(s.createMaterialTexture,3)});L.push(()=>{MenuBar.removeAction("tools.create_material_texture"),Toolbars.texturelist.remove("tools.create_material_texture")});var $=(t,a)=>{let e=k()??Texture.getDefault(),r=new D(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[i,l]=Project?[t?`${t}_mer`:`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:i,extensions:["png"],resource_id:"mer",savetype:"image",startpath:l},a)})};C.push(()=>{s.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{$()}catch(t){console.error("Failed to export MER map:",t),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),s.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let t=k()??Texture.getDefault(),a=new D([t],t.uuid),e=a.decodeMer(),r=[u.metalness,u.emissive,u.roughness];Undo.initEdit({textures:[t]}),r.forEach(n=>{let i=n.id,l=e[i];if(!l){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let o=new Texture({name:`${t?.name}_${i}`,keep_size:!1}).fromDataURL(l.toDataURL());o.add(!0),a.saveTexture(n,o)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>k()?.layers_enabled===!0,click(){let t=TextureLayer.selected?.texture??Texture.all.find(i=>i.selected)??Texture.getDefault(),a=new D(t.layers_enabled?t.layers:[t],t.uuid),e=a.decodeMer(),r=[u.metalness,u.emissive,u.roughness];Undo.initEdit({textures:[t]});let n=t.selected.activateLayers(!0);r.forEach(i=>{let l=i.id,o=e[l];if(!o){Blockbench.showStatusMessage(`Failed to decode ${i.label} channel`,3e3);return}let g=new TextureLayer({name:`${t?.name}_${l}`,data_url:o.toDataURL()},t);a.saveTexture(i,g),g.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(s.decodeMer,"tools"),MenuBar.addAction(s.generateMer,"file.export")});L.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var Ae=()=>{Project&&Project.textures.forEach(t=>{let a=new D(null,t.uuid),e=a.findTexture(u.normal,!1),r=a.findTexture(u.height,!1),n=a.findTexture(u.albedo,!1),i=a.findTexture(u.metalness,!1)?.name,l=a.findTexture(u.emissive,!1)?.name,o=a.findTexture(u.roughness,!1)?.name,g={};return n||(g.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!i&&!l&&!o&&(g.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},g.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},g.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),e&&(g.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(g.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),e&&r&&(g.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),s.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:g,cancelIndex:1,onConfirm(f){let x=ee(),h=i||l||o,_={format_version:"1.16.100","minecraft:texture_set":{color:(n?x:f.baseColor?.toHexString())??x,metalness_emissive_roughness:[f.metalness??0,f.emissive??0,f.roughness??255]}};f.depthMap==="normal"&&e||!r&&e?_["minecraft:texture_set"].normal=`${x}_normal`:(!e||f.depthMap==="heightmap")&&r&&(_["minecraft:texture_set"].heightmap=`${x}_heightmap`);let m=d=>{if(!f.depthMap)return d();let v=f.depthMap==="normal"||f.depthMap&&!r,M=v?e:r;if(!M)return d();Blockbench.export({content:M.canvas.toDataURL()??"",type:"PNG",name:`${x}_${v?"normal":"heightmap"}`,extensions:["png"],resource_id:f.depthMap,startpath:Project.export_path,savetype:"image"},w=>{_["minecraft:texture_set"][v?"normal":"heightmap"]=pathToName(w,!1),d()})},p=d=>{if(!n)return d();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:x,startpath:Project.export_path,savetype:"image"},v=>{_["minecraft:texture_set"].color=pathToName(v,!1),d()})},c=()=>m(()=>{p(()=>{Blockbench.export({content:JSON.stringify(_,null,2),type:"JSON",name:`${x}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),s.textureSetDialog?.hide()})})});if(h){try{$(x,d=>{_["minecraft:texture_set"].metalness_emissive_roughness=pathToName(d,!1),c()})}catch(d){console.warn("Failed to export MER map:",d),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}c()}}),s.textureSetDialog.show()})};C.push(()=>{s.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){Ae()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(s.createTextureSet,"file.export")});L.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});C.push(()=>{s.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(t){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=t}),Preview.selected.renderer.physicallyCorrectLights=t,Blockbench.showQuickMessage(`Physically corrected lighting is now ${t?"enabled":"disabled"}`,2e3),t&&s.togglePbr?.set(!0),A()},click(){}}),MenuBar.addAction(s.toggleCorrectLights,"preview")});L.push(()=>{MenuBar.removeAction("preview.correct_lights")});var F=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(a=>{let r=t.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var oe=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],ie=()=>Project&&Project.pbr_active&&A(),Ne=()=>{Blockbench.on(oe.join(" "),ie)},le=()=>{oe.forEach(t=>{Blockbench.removeListener(t,ie)})};C.push(()=>{s.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(t){if(t){A(),Ne(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}F(),le(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(s.togglePbr,"view")});L.push(()=>{le(),MenuBar.removeAction("view.toggle_pbr")});var ce=t=>{let a=Math.max(-2,Math.min(2,t));Preview.all.forEach(e=>{e.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};C.push(()=>{s.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(s.tonemappingSelect?.get())===b.NoToneMapping&&s.tonemappingSelect.change(b.LinearToneMapping.toString()),s.togglePbr?.set(!0)},onChange(t){ce(Number(t))},onAfter(){B()}}),s.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>s.exposureSlider!==void 0&&Number(s.exposureSlider?.get())!==1,click(){ce(1),s.exposureSlider?.setValue(1,!0),B()}}),s.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:b.NoToneMapping,value:Preview.selected.renderer.toneMapping??b.NoToneMapping,icon:"monochrome_photos",options:{[b.NoToneMapping]:"No Tone Mapping",[b.LinearToneMapping]:"Linear",[b.ReinhardToneMapping]:"Reinhard",[b.CineonToneMapping]:"Cineon",[b.NeutralToneMapping]:"Neutral",[b.ACESFilmicToneMapping]:"ACES"},onChange({value:t}){Preview.selected.renderer.toneMapping=Number(t);let a=1;Preview.selected.renderer.toneMapping===b.NoToneMapping?s.exposureSlider?.setValue(a,!0):a=Number(s.exposureSlider?.get()??1),Preview.all.forEach(e=>{e.renderer.toneMapping=Number(t),e.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(t)}`,2e3),s.togglePbr&&!s.togglePbr.value&&s.togglePbr.set(!0),A()}})});var Be=(t,a="texture")=>{t.toBlob(async e=>{e&&Blockbench.export({content:await e.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},Re=(t,a="texture")=>{t.toBlob(async e=>{e&&Blockbench.export({content:await e.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};C.push(()=>{s.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let t=k();if(!t)return;let e=new D(t.layers_enabled?t.layers:[t],t.uuid).createLabPbrOutput();if(e===null)return;let r=t.name??(Project?Project.getDisplayName():"texture");await Promise.all([Be(e.normalMap,pathToName(r)),Re(e.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),s.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let t=TextureLayer.selected?.texture??Texture.all.find(e=>e.selected)??Texture.getDefault(),a=new D(t.layers_enabled?t.layers:[t],t.uuid);if(pathToName(t.name).endsWith("_n")){a.createTexturesFromNormal(t);return}if(pathToName(t.name).endsWith("_s")){a.createTexturesFromSpecular(t);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(s.generateLabPbr,"file.export"),MenuBar.addAction(s.decodeLabPbr,"tools")});L.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});var O=class t{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(u).map(e=>[e,u[e].default??new b.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([e,r])=>[e,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let e=Math.min(1,Math.max(0,a));return new b.Color(e,e,e).convertSRGBToLinear()}static fromSettings(){let a="#000000",e=Number(s.brushMetalnessSlider?.get()),r=Number(s.brushRoughnessSlider?.get()??1),n=(s.brushEmissiveColor?.get()??a).toString(),i=Number(s.brushHeightSlider?.get()),l=ColorPanel.get(),o={[u.albedo.id]:new b.Color(l),[u.metalness.id]:t.makeLinearColor(e),[u.roughness.id]:t.makeLinearColor(r),[u.emissive.id]:new b.Color(n??a),[u.height.id]:t.makeLinearColor(i),[u.normal.id]:u.normal.default??new b.Color("#8080ff")};return new t({colors:o})}};var ue="materialBrushPresets",q=()=>JSON.parse(localStorage.getItem(ue)||"{}"),Ie=(t,a)=>{let e=q(),r=a??guid(),n=s.userMaterialBrushPresets?.getFormResult()??{},i={};return n.albedo&&(i.albedo=n.albedo.toString()),n.metalness&&(i.metalness=Number(n.metalness)),n.roughness&&(i.roughness=Number(n.roughness)),n.emissive&&(i.emissive=n.emissive.toString()),n.height&&(i.height=Number(n.height)),e[r]=[i,t??"New Preset",H(i)],localStorage.setItem(ue,JSON.stringify(e)),r},me=({metalness:t,roughness:a,emissive:e,height:r,albedo:n})=>{t!==void 0&&s.brushMetalnessSlider?.setValue(t||0,!0),a!==void 0&&s.brushRoughnessSlider?.setValue(a??1,!0),e!==void 0&&s.brushEmissiveColor?.set(e??"#000000"),r!==void 0&&s.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},z=({id:t})=>Condition({project:!0,tools:["material_brush"],method(){let a=k();return(a?.layers_enabled&&a.layers.find(({channel:e})=>e&&e===t)!==void 0)===!0}}),He=X.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:u}},methods:{applyPreset(t){try{let[a,e]=this.userPresets[t],{metalness:r,roughness:n,emissive:i,height:l,albedo:o}=a;me({metalness:Number(r),roughness:Number(n),emissive:i.toString(),height:Number(l),albedo:o.toString()}),s.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${e}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(t){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let e=q(),r=this.userPresets[t][1]??t;delete e[t],localStorage.setItem("materialBrushPresets",JSON.stringify(e)),this.userPresets=e,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(t){s.userMaterialBrushPresets?.setFormValues({name:this.userPresets[t][1]??t,...this.userPresets[t][0]})},getSummary(t){return Object.entries(t).filter(([a])=>a in this.channels).map(([a,e])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${e}`:`${this.channels[a]?.label??a}: ${Number(e).toFixed(1)}`).join(` +`)}},computed:{presets(){return Object.entries(this.userPresets)}},mounted(){this.userPresets=q()},template:`
  • {if(!Project)return!1;let t=Project.selected_texture;return t?.layers_enabled?t.layers.find(({channel:a})=>a===u.metalness.id)!==void 0:!1}}),s.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",settings:{min:0,max:1,step:.01,default:1},condition:()=>{if(!Project)return!1;let t=Project.selected_texture;return t?.layers_enabled?t.layers.find(({channel:a})=>a===u.roughness.id)!==void 0:!1}}),s.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",condition:()=>{if(!Project)return!1;let t=Project.selected_texture;return t?.layers_enabled?t.layers.find(({channel:a})=>a===u.emissive.id)!==void 0:!1}}),s.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",settings:{min:0,max:1,step:.01,default:.5},condition:()=>{if(!Project)return!1;let t=Project.selected_texture;return t?.layers_enabled?t.layers.find(({channel:a})=>a===u.height.id)!==void 0:!1}}),s.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",category:"tools",toolbar:"brush",condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){return S()?.layers_enabled??!1}},allowed_view_modes:"textured",brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(t,a,e,r,{size:n,softness:o,texture:c}){let l=F.fromSettings(),h=Object.keys(l.colors),x=e;return c.layers.forEach(g=>{if(!g.visible||!h.includes(g.channel))return;let m=l.getChannel(g.channel);m&&(g.ctx.fillStyle=m.getStyle(),g.ctx.fillRect(n*t,n*a,n,n),g.selected&&(x={r:m.r*255,g:m.g*255,b:m.b*255,a:r*255}))}),x}},onCanvasClick(t){Painter.startPaintToolCanvas(t,t.event)},onSelect(){Painter.updateNslideValues(),A()},click(){B()}}),s.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:{project:!0},click(){s.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:Re,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(t){ce({metalness:Number(t.metalness??s.brushMetalnessSlider?.get()),roughness:Number(t.roughness??s.brushRoughnessSlider?.get()),emissive:(t.emissive??s.brushEmissiveColor?.get()).toString(),height:Number(t.height??s.brushHeightSlider?.get()),albedo:(t.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(t,a){t===1&&Blockbench.textPrompt("Save Preset","New Preset",e=>{e&&(Ie(e),Blockbench.showQuickMessage(`Preset "${e}" saved`,2e3))})}}).show()}}),MenuBar.addAction(s.materialBrushTool,"tools.0")});L.push(()=>{MenuBar.removeAction("tools.material_brush")});C.push(()=>{s.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","load_brush_preset","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Settings"})],condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});C.push(()=>{s.displaySettingsPanel=new Panel("display_settings",{name:"PBR Controls",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure","show_channel_select_menu"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});(()=>{let t=()=>{C.forEach(e=>e())},a=()=>{$(),L.forEach(e=>e()),Object.entries(s).forEach(([e,r])=>{try{r?.delete()}catch(n){console.warn(`Failed to delete ${e} action:`,n)}})};BBPlugin.register("pbr_preview",{version:"1.1.0",title:"PBR Tools",author:"Jason J. Gardner",description:"Create and view PBR materials in Blockbench. Export textures for Java and RenderDragon shaders.",tags:["Minecraft: Java Edition","Minecraft: Bedrock Edition","PBR"],icon:"icon.png",variant:"both",await_loading:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.3",onload:t,onunload:a})})();})(); + }`),s.brushMetalnessSlider=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",tool_setting:"brush_metalness",settings:{min:0,max:1,step:.01,default:0},condition:()=>z(u.metalness)}),s.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",tool_setting:"brush_roughness",settings:{min:0,max:1,step:.01,default:1},condition:()=>z(u.roughness)}),s.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",tool_setting:"brush_emissive",condition:()=>z(u.emissive)}),s.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",tool_setting:"brush_height",settings:{min:0,max:1,step:.01,default:.5},condition:()=>z(u.height)}),s.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",category:"tools",toolbar:"brush",condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){return k()?.layers_enabled??!1}},allowed_view_modes:"textured",tool_settings:{brush_metalness:0,brush_roughness:1,brush_emissive:"#000000",brush_height:.5},brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(t,a,e,r,{size:n,softness:i,texture:l,x:o,y:g}){let f=O.fromSettings(),x=Object.keys(f.colors),h=Math.floor(n-i*n/100),_=e;return l.layers.forEach(m=>{if(!m.visible||!x.includes(m.channel))return;let p=f.getChannel(m.channel);if(!p)return;let c=Math.sqrt((o-t)**2+(g-a)**2),d=Math.min(1,c/h);if(o%h<=d&&g%h<=d){let v=m.ctx.getImageData(t,a,1,1).data,M=new b.Color(`rgb(${v[0]}, ${v[1]}, ${v[2]})`);p.lerp(M,1)}m.ctx.fillStyle=p.getStyle(),m.ctx.fillRect(t,a,1,1),m.selected&&(_={r:p.r*255,g:p.g*255,b:p.b*255,a:r*255})}),_}},onCanvasClick(t){Painter.startPaintToolCanvas(t,t.event)},onSelect(){Painter.updateNslideValues(),A()},click(){B()}}),s.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:{project:!0},click(){s.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:He,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(t){me({metalness:Number(t.metalness??s.brushMetalnessSlider?.get()),roughness:Number(t.roughness??s.brushRoughnessSlider?.get()),emissive:(t.emissive??s.brushEmissiveColor?.get()).toString(),height:Number(t.height??s.brushHeightSlider?.get()),albedo:(t.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(t,a){s.materialBrushTool?.select(),t===1&&Blockbench.textPrompt("Save Preset","New Preset",e=>{e&&(Ie(e),Blockbench.showQuickMessage(`Preset "${e}" saved`,2e3))})}}).show()}}),MenuBar.addAction(s.materialBrushTool,"tools.0")});L.push(()=>{MenuBar.removeAction("tools.material_brush")});C.push(()=>{s.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","load_brush_preset","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Settings"})],condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});C.push(()=>{s.displaySettingsPanel=new Panel("display_settings",{name:"PBR Controls",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure","show_channel_select_menu"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});(()=>{let t=()=>{C.forEach(e=>e())},a=()=>{F(),L.forEach(e=>e()),Object.entries(s).forEach(([e,r])=>{try{r?.delete()}catch(n){console.warn(`Failed to delete ${e} action:`,n)}})};BBPlugin.register("pbr_preview",{version:"1.1.0",title:"PBR Tools",author:"Jason J. Gardner",description:"Create and view PBR materials in Blockbench. Export textures for Java and RenderDragon shaders.",tags:["Minecraft: Java Edition","Minecraft: Bedrock Edition","PBR"],icon:"icon.png",variant:"both",await_loading:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.3",onload:t,onunload:a})})();})(); diff --git a/src/pbr_preview/src/constants.ts b/src/pbr_preview/src/constants.ts index 5f208a10..a236cdac 100644 --- a/src/pbr_preview/src/constants.ts +++ b/src/pbr_preview/src/constants.ts @@ -10,6 +10,7 @@ export const CHANNELS: Record = { map: "map", icon: "tonality", default: new THREE.Color(0xffffff), + regex: new RegExp("(s|_)*(basecolor|color|albedo)", "i"), }, metalness: { id: "metalness", @@ -18,6 +19,7 @@ export const CHANNELS: Record = { map: "metalnessMap", icon: "brightness_6", default: new THREE.Color(0), + regex: new RegExp("[ _]*metal(lic|ness)?", "i"), }, emissive: { id: "emissive", @@ -26,6 +28,7 @@ export const CHANNELS: Record = { map: "emissiveMap", icon: "wb_twilight", default: new THREE.Color(0), + regex: new RegExp("[ _]*emissive", "i"), }, roughness: { id: "roughness", @@ -34,6 +37,7 @@ export const CHANNELS: Record = { map: "roughnessMap", icon: "grain", default: new THREE.Color(0xffffff), + regex: new RegExp("[ _]*rough(ness)?", "i"), }, height: { id: "height", @@ -42,6 +46,7 @@ export const CHANNELS: Record = { map: "bumpMap", icon: "landscape", default: new THREE.Color(0xffffff), + regex: new RegExp("[ _]*(height|bump)", "i"), }, normal: { id: "normal", @@ -50,6 +55,7 @@ export const CHANNELS: Record = { map: "normalMap", icon: "looks", default: new THREE.Color("rgb(128, 128, 255)"), + regex: new RegExp("[ _]*normal", "i"), }, ao: { id: "ao", @@ -58,6 +64,7 @@ export const CHANNELS: Record = { map: "aoMap", icon: "motion_mode", default: new THREE.Color(0xffffff), + regex: new RegExp("[ _]*(ao|ambientocclusion|ambient occlusion)", "i"), }, }; diff --git a/src/pbr_preview/src/lib/PbrMaterials.ts b/src/pbr_preview/src/lib/PbrMaterials.ts index 4b45446f..fe7310bb 100644 --- a/src/pbr_preview/src/lib/PbrMaterials.ts +++ b/src/pbr_preview/src/lib/PbrMaterials.ts @@ -1,6 +1,7 @@ import type { IChannel } from "../types"; import { CHANNELS, NA_CHANNEL } from "../constants"; import { three as THREE } from "../deps"; +import { generatePreviewImage } from "./util"; const getProjectTextures = (layers = true) => { const allTextures = Project ? Project.textures ?? Texture.all : Texture.all; @@ -85,7 +86,7 @@ export default class PbrMaterial { aoMap: this.getTexture(CHANNELS.ao), bumpMap: this.getTexture(CHANNELS.height), normalMap, - normalScale: new THREE.Vector2(1, 1), + normalScale: new THREE.Vector2(-1, 1), metalnessMap, metalness: metalnessMap ? 1 : 0, roughnessMap, @@ -101,6 +102,11 @@ export default class PbrMaterial { }); } + renderMaterialPreview() { + const previewImage = generatePreviewImage(this.getMaterial()); + return previewImage; + } + saveTexture(channel: IChannel, texture: Texture | TextureLayer) { if (!Project) { return; @@ -146,8 +152,9 @@ export default class PbrMaterial { const materialData = Project.pbr_materials[this._materialUuid]; // Don't infer the channel if it has already been assigned to NA_CHANNEL - if (!materialData && inference && channel !== NA_CHANNEL) { - const filenameRegex = new RegExp(`_*${channel}(\.[^.]+)?$`, "i"); + if (inference && !materialData && channel !== NA_CHANNEL) { + const filenameRegex = + CHANNELS[channel].regex ?? new RegExp(`_*${channel}(\.[^.]+)?$`, "i"); return this._scope.find((t) => filenameRegex.test(t.name)) ?? null; } diff --git a/src/pbr_preview/src/lib/actions/channelAssignment.ts b/src/pbr_preview/src/lib/actions/channelAssignment.ts index f7b04126..a56777a7 100644 --- a/src/pbr_preview/src/lib/actions/channelAssignment.ts +++ b/src/pbr_preview/src/lib/actions/channelAssignment.ts @@ -10,7 +10,7 @@ import { applyPbrMaterial, debounceApplyPbrMaterial, } from "../applyPbrMaterial"; -import { getSelectedTexture } from "../util"; +import { getSelectedLayer, getSelectedTexture } from "../util"; /** * Registry of channel actions\ @@ -31,6 +31,13 @@ setups.push(() => { selected: { texture: true, }, + project: true, + method() { + return ( + getSelectedTexture()?.material === true && + getSelectedLayer() !== null + ); + }, }, click() { const layer = @@ -204,6 +211,12 @@ setups.push(() => { registry.openChannelMenu = new Action("pbr_channel_menu", { name: "Assign to PBR Channel", icon: "texture", + condition: { + modes: ["edit", "paint"], + selected: { + texture: true, + }, + }, click(event) { registry.channelMenu?.open(event as MouseEvent); }, diff --git a/src/pbr_preview/src/lib/actions/materialTexture.ts b/src/pbr_preview/src/lib/actions/materialTexture.ts index 9fc307e0..35ebe921 100644 --- a/src/pbr_preview/src/lib/actions/materialTexture.ts +++ b/src/pbr_preview/src/lib/actions/materialTexture.ts @@ -1,26 +1,17 @@ -import { registry, CHANNELS, setups, teardowns } from "../../constants"; +import { + registry, + CHANNELS, + setups, + teardowns, + NA_CHANNEL, +} from "../../constants"; import { three as THREE } from "../../deps"; import PbrMaterial from "../PbrMaterials"; - -const colorDataUrl = (color: THREE.Color, src?: HTMLCanvasElement) => { - const canvas = src ?? document.createElement("canvas"); - const ctx = canvas.getContext("2d"); - - if (!ctx) { - return null; - } - - const width = Math.max(Project ? Project.texture_width : 16, 16); - const height = Math.max(Project ? Project.texture_height : 16, 16); - - canvas.width = width; - canvas.height = height; - - ctx.fillStyle = `rgb(${color.r * 255}, ${color.g * 255}, ${color.b * 255})`; - ctx.fillRect(0, 0, width, height); - - return canvas.toDataURL(); -}; +import { + colorDataUrl, + generatePreviewImage, + getSelectedTexture, +} from "../util"; setups.push(() => { registry.createMaterialTexture = new Action("create_material_texture", { @@ -44,22 +35,22 @@ setups.push(() => { name: "New Material", saved: false, particle: false, - keep_size: false, - layers_enabled: true, }); + texture.extend({ material: true }); + const scope = Texture.all.filter((t) => t.selected || t.multi_selected) ?? Texture.all; - const mat = Texture.selected - ? new PbrMaterial(scope, Texture.selected.uuid) - : null; + const selected = getSelectedTexture(); + + const mat = selected ? new PbrMaterial(scope, selected.uuid) : null; try { const baseColor = mat?.findTexture(CHANNELS.albedo, true)?.canvas.toDataURL() ?? - Texture.selected?.canvas.toDataURL() ?? + selected?.canvas.toDataURL() ?? colorDataUrl(new THREE.Color(0x808080), texture.canvas); if (!baseColor) { @@ -73,15 +64,15 @@ setups.push(() => { name: channels.albedo.label, visible: true, data_url: baseColor, + keep_size: true, }, texture ); layer.extend({ channel: channels.albedo.id }); - layer.addForEditing(); layer.texture.updateChangesAfterEdit(); - + mat?.saveTexture(channels.albedo, layer); delete channels.albedo; } catch (e) { console.warn("Failed to create base color texture", e); @@ -110,12 +101,15 @@ setups.push(() => { name: channel.label, visible: true, data_url: data, + keep_size: true, }, texture ); layer.extend({ channel: channel.id }); + mat?.saveTexture(channel, layer); + return layer; }) .filter(Boolean) as TextureLayer[]; @@ -123,7 +117,13 @@ setups.push(() => { Undo.initEdit({ textures: Texture.all, layers }); texture.add().select(); - layers.map((layer) => layer.addForEditing()); + texture.activateLayers(); + layers.map((layer) => { + layer.addForEditing(); + + texture.width = Math.max(texture.width, layer.img.width); + texture.height = Math.max(texture.height, layer.img.height); + }); texture.updateChangesAfterEdit(); Undo.finishEdit("Create Material Texture"); @@ -136,4 +136,5 @@ setups.push(() => { teardowns.push(() => { MenuBar.removeAction("tools.create_material_texture"); + Toolbars.texturelist.remove("tools.create_material_texture"); }); diff --git a/src/pbr_preview/src/lib/applyPbrMaterial.ts b/src/pbr_preview/src/lib/applyPbrMaterial.ts index ff05528a..6e6a6802 100644 --- a/src/pbr_preview/src/lib/applyPbrMaterial.ts +++ b/src/pbr_preview/src/lib/applyPbrMaterial.ts @@ -16,6 +16,8 @@ function applyToFace( if (projectMaterial.isShaderMaterial && !Project.bb_materials[texture.uuid]) { Project.bb_materials[texture.uuid] = projectMaterial; + } else if (projectMaterial.isMeshStandardMaterial) { + projectMaterial.dispose(); } const material = new PbrMaterial( @@ -23,9 +25,10 @@ function applyToFace( ? texture.layers.filter((layer) => layer.visible) ?? null : Project.textures, texture.uuid - ).getMaterial(materialParams); - - material.side = Canvas.getRenderSide(texture) as THREE.Side; + ).getMaterial({ + side: Canvas.getRenderSide(texture) as THREE.Side, + ...materialParams, + }); Project.materials[texture.uuid] = THREE.ShaderMaterial.prototype.copy.call( material, diff --git a/src/pbr_preview/src/lib/properties.ts b/src/pbr_preview/src/lib/properties.ts index 645cf0f6..f2008bf4 100644 --- a/src/pbr_preview/src/lib/properties.ts +++ b/src/pbr_preview/src/lib/properties.ts @@ -20,6 +20,12 @@ setups.push(() => { exposed: false, }); + // @ts-expect-error Boolean values not required + registry.materialTextureProp = new Property(Texture, "boolean", "material", { + default: false, + label: "Material Texture", + }); + registry.pbrMaterialsProp = new Property( ModelProject, // @ts-expect-error "object" is a valid type for a property diff --git a/src/pbr_preview/src/lib/tools/materialBrush.ts b/src/pbr_preview/src/lib/tools/materialBrush.ts index 7765cbe3..839a068a 100644 --- a/src/pbr_preview/src/lib/tools/materialBrush.ts +++ b/src/pbr_preview/src/lib/tools/materialBrush.ts @@ -1,3 +1,4 @@ +import type { IChannel } from "../../types"; import { registry, CHANNELS, setups, teardowns } from "../../constants"; import { applyPbrMaterial, @@ -5,47 +6,7 @@ import { } from "../applyPbrMaterial"; import { MaterialBrush } from "../MaterialBrush"; import { vue as Vue, three as THREE } from "../../deps"; -import { getSelectedTexture } from "../util"; - -const generatePreviewImage = (settings: object) => { - const renderer = new THREE.WebGLRenderer({ - alpha: true, - antialias: true, - }); - const scene = new THREE.Scene(); - const camera = new THREE.PerspectiveCamera(75, 96 / 96, 0.1, 1000); - - const ambientLight = new THREE.AmbientLight(0xffffff, 0.75); - scene.add(ambientLight); - - const pointLight = new THREE.PointLight(0xffffff, 1, 100); - pointLight.position.set(5, 5, 5); - scene.add(pointLight); - const geometry = new THREE.SphereGeometry(1, 32, 32); - - const material = new THREE.MeshStandardMaterial({ - color: settings.albedo, - metalness: settings.metalness ?? 0, - roughness: settings.roughness ?? 1, - emissive: settings.emissive, - bumpScale: settings.height ?? 0, - envMap: PreviewScene.active?.cubemap ?? null, - envMapIntensity: 0.5, - }); - - const sphere = new THREE.Mesh(geometry, material); - scene.add(sphere); - - camera.position.x = 0; - camera.position.y = 0; - camera.position.z = 2; - - renderer.setSize(96, 96); - - renderer.render(scene, camera); - - return renderer.domElement.toDataURL(); -}; +import { getSelectedTexture, generatePreviewImage } from "../util"; const STORAGE_NAMESPACE = "materialBrushPresets"; @@ -128,6 +89,21 @@ const applyPreset = ({ } }; +const materialBrushSliderCondition = ({ id }: IChannel) => + Condition({ + project: true, + tools: ["material_brush"], + method() { + const texture = getSelectedTexture(); + + return ( + (texture?.layers_enabled && + texture.layers.find(({ channel }) => channel && channel === id) !== + undefined) === true + ); + }, + }); + const userPresetsDialogComponent = Vue.extend({ name: "UserPresetsDialog", data(): { @@ -316,78 +292,45 @@ setups.push(() => { filter: drop-shadow(0 0 2px var(--color-shadow)); } - .delete_preset .material-icons { - font-size: 0.825em; - } - .delete_preset:hover { background: transparent; color: var(--color-accent); } + .delete_preset .material-icons { + font-size: 0.825em; + } + .delete_preset:hover .material-icons { color: var(--color-accent); - } - `); + }`); registry.brushMetalnessSlider = new NumSlider("slider_brush_metalness", { category: "paint", name: "Metalness", description: "Adjust the metalness of the brush", + tool_setting: "brush_metalness", settings: { min: 0, max: 1, step: 0.01, default: 0, }, - condition: () => { - if (!Project) { - return false; - } - - const texture = Project.selected_texture; - - if (!texture?.layers_enabled) { - return false; - } - - return ( - texture.layers.find( - // @ts-expect-error Channel property is an extension of TextureLayer - ({ channel }) => channel === CHANNELS.metalness.id - ) !== undefined - ); - }, + condition: () => materialBrushSliderCondition(CHANNELS.metalness), }); registry.brushRoughnessSlider = new NumSlider("slider_brush_roughness", { category: "paint", name: "Roughness", description: "Adjust the roughness of the brush", + tool_setting: "brush_roughness", settings: { min: 0, max: 1, step: 0.01, default: 1, }, - condition: () => { - if (!Project) { - return false; - } - - const texture = Project.selected_texture; - - if (!texture?.layers_enabled) { - return false; - } - - return ( - texture.layers.find( - // @ts-expect-error Channel property is an extension of TextureLayer - ({ channel }) => channel === CHANNELS.roughness.id - ) !== undefined - ); - }, + condition: () => materialBrushSliderCondition(CHANNELS.roughness), }); registry.brushEmissiveColor = new ColorPicker("brush_emissive_color", { @@ -395,53 +338,22 @@ setups.push(() => { name: "Emissive", description: "Adjust the emissive color of the brush", value: "#000000", - condition: () => { - if (!Project) { - return false; - } - - const texture = Project.selected_texture; - - if (!texture?.layers_enabled) { - return false; - } - - return ( - texture.layers.find( - // @ts-expect-error Channel property is an extension of TextureLayer - ({ channel }) => channel === CHANNELS.emissive.id - ) !== undefined - ); - }, + tool_setting: "brush_emissive", + condition: () => materialBrushSliderCondition(CHANNELS.emissive), }); registry.brushHeightSlider = new NumSlider("slider_brush_height", { category: "paint", name: "Height", description: "Adjust the height of the brush", + tool_setting: "brush_height", settings: { min: 0, max: 1, step: 0.01, default: 0.5, }, - condition: () => { - if (!Project) { - return false; - } - - const texture = Project.selected_texture; - - if (!texture?.layers_enabled) { - return false; - } - - return ( - // @ts-expect-error Channel property is an extension of TextureLayer - texture.layers.find(({ channel }) => channel === CHANNELS.height.id) !== - undefined - ); - }, + condition: () => materialBrushSliderCondition(CHANNELS.height), }); registry.materialBrushTool = new Tool("material_brush", { @@ -463,6 +375,12 @@ setups.push(() => { }, }, allowed_view_modes: "textured", + tool_settings: { + brush_metalness: 0, + brush_roughness: 1, + brush_emissive: "#000000", + brush_height: 0.5, + }, brush: { blend_modes: false, shapes: true, @@ -471,11 +389,19 @@ setups.push(() => { opacity: true, offset_even_radius: true, floor_coordinates: true, - changePixel(x, y, px, alpha, { size, softness, texture }) { + changePixel( + pxX, // Pixel that is changing + pxY, + px, + alpha, + { size, softness, texture, x, y } + ) { const mat = MaterialBrush.fromSettings(); const matChannels = Object.keys(mat.colors); + const brushSize = Math.floor(size - (softness * size) / 100); + let rgba = px; texture.layers.forEach((layer) => { @@ -491,10 +417,22 @@ setups.push(() => { return; } - // TODO: Let softness affect the brush + const distance = Math.sqrt((x - pxX) ** 2 + (y - pxY) ** 2); + const fallOff = Math.min(1, distance / brushSize); + + // Transition colors at soft edges + if (x % brushSize <= fallOff && y % brushSize <= fallOff) { + const currentPixel = layer.ctx.getImageData(pxX, pxY, 1, 1).data; + const currentFill = new THREE.Color( + `rgb(${currentPixel[0]}, ${currentPixel[1]}, ${currentPixel[2]})` + ); + + // Set the fill color to the lerp between the current pixel and the new color + fill.lerp(currentFill, 1); + } layer.ctx.fillStyle = fill.getStyle(); - layer.ctx.fillRect(size * x, size * y, size, size); + layer.ctx.fillRect(pxX, pxY, 1, 1); if (layer.selected) { rgba = { @@ -596,6 +534,8 @@ setups.push(() => { cancelIndex: 0, confirmIndex: 2, onButton(idx, event) { + registry.materialBrushTool?.select(); + if (idx !== 1) { return; } diff --git a/src/pbr_preview/src/lib/util.ts b/src/pbr_preview/src/lib/util.ts index 0c66f013..f2dc9794 100644 --- a/src/pbr_preview/src/lib/util.ts +++ b/src/pbr_preview/src/lib/util.ts @@ -1,3 +1,9 @@ +import { three as THREE } from "../deps"; + +/** + * Attempts to find the selected texture/layer using various methods + * @returns Texture | null + */ export function getSelectedTexture(): Texture | null { if (Texture.selected) { return Texture.selected; @@ -18,6 +24,10 @@ export function getSelectedTexture(): Texture | null { return Project.textures.find((t) => t.selected) ?? null; // Texture.getDefault(); } +/** + * Attempts to find the currently selected layer + * @returns TextureLayer | null + */ export function getSelectedLayer(): TextureLayer | null { if (TextureLayer.selected) { return TextureLayer.selected; @@ -52,6 +62,11 @@ export function getOutputBaseName() { export function getMaterialsFromProject() { const materials: Record = {}; + + if (!Project) { + return materials; + } + Project.elements.forEach((item) => { if (!(item instanceof Cube)) { return; @@ -87,3 +102,93 @@ export function debounce(func: Function, wait: number) { timeout = setTimeout(later, wait); }; } + +export function generatePreviewImage( + settings: + | THREE.MeshStandardMaterial + | (THREE.MeshStandardMaterialParameters & { + albedo: THREE.ColorRepresentation; + emissive: THREE.ColorRepresentation; + height?: number; + }) +): string { + const renderer = + MediaPreview.renderer ?? + new THREE.WebGLRenderer({ + alpha: true, + antialias: true, + }); + const scene = new THREE.Scene(); + const camera = new THREE.PerspectiveCamera(75, 96 / 96, 0.1, 1000); + + const ambientLight = new THREE.AmbientLight(0xffffff, 0.75); + scene.add(ambientLight); + + const pointLight = new THREE.PointLight(0xffffff, 1, 100); + pointLight.position.set(5, 5, 5); + scene.add(pointLight); + const geometry = new THREE.SphereGeometry(1, 32, 32); + + const material = + settings instanceof THREE.MeshStandardMaterial && + settings.isMeshStandardMaterial + ? settings + : new THREE.MeshStandardMaterial({ + color: settings.albedo, + metalness: settings.metalness ?? 0, + roughness: settings.roughness ?? 1, + emissive: settings.emissive, + bumpScale: settings.height ?? 0, + envMap: PreviewScene.active?.cubemap ?? null, + envMapIntensity: 0.5, + }); + + const sphere = new THREE.Mesh(geometry, material); + scene.add(sphere); + + camera.position.x = 0; + camera.position.y = 0; + camera.position.z = 2; + + renderer.setSize(96, 96); + + renderer.render(scene, camera); + + const data = renderer.domElement.toDataURL(); + + material.dispose(); + + if (!MediaPreview.renderer) { + renderer.clear(); + renderer.dispose(); + } + + return data; +} + +export function colorDataUrl(color: THREE.Color, src?: HTMLCanvasElement) { + const canvas = src ?? document.createElement("canvas"); + const ctx = canvas.getContext("2d"); + + if (!ctx) { + canvas.remove(); + return null; + } + + const width = Math.max(Project ? Project.texture_width : 16, 16); + const height = Math.max(Project ? Project.texture_height : 16, 16); + + canvas.width = width; + canvas.height = height; + + ctx.fillStyle = `rgb(${color.r * 255}, ${color.g * 255}, ${color.b * 255})`; + ctx.fillRect(0, 0, width, height); + + const data = canvas.toDataURL(); + + if (!src) { + canvas.remove(); + } + + return data; +} diff --git a/src/pbr_preview/src/types.d.ts b/src/pbr_preview/src/types.d.ts index e3ff2823..9bdc29fe 100644 --- a/src/pbr_preview/src/types.d.ts +++ b/src/pbr_preview/src/types.d.ts @@ -14,6 +14,7 @@ export interface IChannel { id: string; icon?: string; default?: THREE.Color; + regex?: RegExp; } export interface ILightrParams { @@ -29,14 +30,6 @@ export interface IPbrMaterials { }; } -// Extend Blockbench Project namespace -declare module "blockbench-types" { - interface Project { - pbr_materials: IPbrMaterials; - bb_materials: Record; - } -} - export interface IRegistry { bakeTexturesAction: Action; bakeTexturesDialog: Dialog; @@ -59,7 +52,6 @@ export interface IRegistry { decodeLabPbr: Action; materialBrushPanel: Panel; materialBrushTool: Tool; - materialBrushPresets: BarSelect; openChannelMenu: Action; pbrMaterialsProp: Property; projectMaterialsProp: Property; From 06106c86945d96b7e2c7c4d7d1a45375b88737ca Mon Sep 17 00:00:00 2001 From: Jason Gardner Date: Mon, 17 Jun 2024 09:49:57 -0500 Subject: [PATCH 22/50] fix: MER decoding --- plugins/pbr_preview/pbr_preview.js | 4 ++-- src/pbr_preview/src/constants.ts | 2 +- src/pbr_preview/src/lib/PbrMaterials.ts | 9 +++++---- src/pbr_preview/src/lib/actions/mer.ts | 7 +------ 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index 1c4c6a95..0467c01e 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1,4 +1,4 @@ -"use strict";(()=>{var b=THREE,X=Vue;var N="_NONE_",u={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new b.Color(16777215),regex:new RegExp("(s|_)*(basecolor|color|albedo)","i")},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new b.Color(0),regex:new RegExp("[ _]*metal(lic|ness)?","i")},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new b.Color(0),regex:new RegExp("[ _]*emissive","i")},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new b.Color(16777215),regex:new RegExp("[ _]*rough(ness)?","i")},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new b.Color(16777215),regex:new RegExp("[ _]*(height|bump)","i")},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new b.Color("rgb(128, 128, 255)"),regex:new RegExp("[ _]*normal","i")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new b.Color(16777215),regex:new RegExp("[ _]*(ao|ambientocclusion|ambient occlusion)","i")}},s={},C=[],L=[];var Y=[...Object.keys(u).map(t=>u[t].id),N];C.push(()=>{s.channelProp=new Property(TextureLayer,"enum","channel",{default:N,values:Y,label:"PBR Channel",exposed:!1}),s.textureChannelProp=new Property(Texture,"enum","channel",{default:N,values:Y,label:"PBR Channel",exposed:!1}),s.materialTextureProp=new Property(Texture,"boolean","material",{default:!1,label:"Material Texture"}),s.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),s.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),s.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!1,values:[],label:"PBR Mode"})});function k(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(t=>t.selected)??null:Texture.all.find(t=>t.selected)??Texture.getDefault()}function R(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(t=>t.selected)??Project.selected_texture.layers[0]:k()?.getActiveLayer()??null}function ee(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(k()?.name??"texture")}function te(t,a){let e;return function(...r){let n=()=>{e=void 0,t.apply(this,r)};clearTimeout(e),e=setTimeout(n,a)}}function H(t){let a=MediaPreview.renderer??new b.WebGLRenderer({alpha:!0,antialias:!0}),e=new b.Scene,r=new b.PerspectiveCamera(75,96/96,.1,1e3),n=new b.AmbientLight(16777215,.75);e.add(n);let i=new b.PointLight(16777215,1,100);i.position.set(5,5,5),e.add(i);let l=new b.SphereGeometry(1,32,32),o=t instanceof b.MeshStandardMaterial&&t.isMeshStandardMaterial?t:new b.MeshStandardMaterial({color:t.albedo,metalness:t.metalness??0,roughness:t.roughness??1,emissive:t.emissive,bumpScale:t.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),g=new b.Mesh(l,o);e.add(g),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(e,r);let f=a.domElement.toDataURL();return o.dispose(),MediaPreview.renderer||(a.clear(),a.dispose()),f}function Q(t,a){let e=a??document.createElement("canvas"),r=e.getContext("2d");if(!r)return e.remove(),null;let n=Math.max(Project?Project.texture_width:16,16),i=Math.max(Project?Project.texture_height:16,16);e.width=n,e.height=i,r.fillStyle=`rgb(${t.r*255}, ${t.g*255}, ${t.b*255})`,r.fillRect(0,0,n,i);let l=e.toDataURL();return a||e.remove(),l}var De=(t=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return t?a.filter(e=>e.layers_enabled&&e.layers.length>0).flatMap(e=>e.layers):a},D=class t{constructor(a,e){this._scope=a??De(),this._materialUuid=e}merToCanvas(){let a=this.getTexture(u.emissive),e=this.getTexture(u.roughness),r=this.getTexture(u.metalness);if(!a&&!e&&!r){let{metalness:n,emissive:i,roughness:l}=this.decodeMer();n&&(r=t.makePixelatedCanvas(n)),i&&(a=t.makePixelatedCanvas(i)),l&&(e=t.makePixelatedCanvas(l))}return{emissiveMap:a,roughnessMap:e,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:e,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(u.emissive),roughnessMap:this.getTexture(u.roughness),metalnessMap:this.getTexture(u.metalness)},i=this.getTexture(u.normal);return new b.MeshStandardMaterial({map:this.getTexture(u.albedo)??t.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(l=>l.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(u.ao),bumpMap:this.getTexture(u.height),normalMap:i,normalScale:new b.Vector2(-1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:e,emissiveIntensity:e?1:0,emissive:e?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}renderMaterialPreview(){return H(this.getMaterial())}saveTexture(a,e){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=e.uuid,e.extend({channel:a.id}))}findTexture(a,e=!0){if(!Project)return null;let r=this._scope.find(o=>o.channel&&(o.channel===a||o.channel===a.id));if(r)return r;let n=typeof a=="string"?a:a.id;Project.pbr_materials=Project.pbr_materials??{};let i=Project.pbr_materials[this._materialUuid];if(e&&!i&&n!==N){let o=u[n].regex??new RegExp(`_*${n}(.[^.]+)?$`,"i");return this._scope.find(g=>o.test(g.name))??null}let l=i?.[n];return l?this._scope.find(o=>o.uuid===l)??null:null}static makePixelatedCanvas(a){let e=new b.CanvasTexture(a,void 0,void 0,void 0,b.NearestFilter,b.NearestFilter);return e.needsUpdate=!0,e}getTexture(a){let e=this.findTexture(a);return e?t.makePixelatedCanvas(e.canvas):null}static extractChannel(a,e){let r=a.canvas,{width:n,height:i}=r,l=r.getContext("2d");if(!l||!n||!i)return null;let o=document.createElement("canvas");o.width=n,o.height=i;let g=o.getContext("2d");if(!g)return null;let f={r:0,g:1,b:2,a:3}[e],{data:x}=l.getImageData(0,0,n,i),h=new Uint8ClampedArray(n*i*4);for(let m=0;ma){p[c]=_.data[c],p[c+1]=_.data[c+1],p[c+2]=_.data[c+2],p[c+3]=255;continue}p[c]=0,p[c+1]=0,p[c+2]=0,p[c+3]=255}return f.putImageData(new ImageData(p,o.width,o.height),0,0),{metalness:r,emissive:o,emissiveLevel:n,roughness:i,sss:l}}createMer(a=!1){let e=this.findTexture(u.metalness,a),r=this.findTexture(u.emissive,a),n=this.findTexture(u.roughness,a),i=this.findTexture("sss",!1),l=Math.max(e?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),o=Math.max(e?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),g=document.createElement("canvas");g.width=l,g.height=o;let f=g.getContext("2d");if(!f)return null;let x=e?.img?t.extractChannel(e,"r"):null,h=r?.img?t.extractChannel(r,"g"):null,_=n?.img?t.extractChannel(n,"b"):null,m=i&&i?.img?t.extractChannel(i,"a"):null,p=x?.getContext("2d")?.getImageData(0,0,l,o)??new ImageData(l,o),c=h?.getContext("2d")?.getImageData(0,0,l,o)??new ImageData(l,o),d=_?.getContext("2d")?.getImageData(0,0,l,o)??new ImageData(l,o),v=m?.getContext("2d")?.getImageData(0,0,l,o)??new ImageData(new Uint8ClampedArray(l*o*4).fill(255),l,o),M=new Uint8ClampedArray(l*o*4);for(let w=0;w{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),e}createTexturesFromNormal(a){let e=this.decodeLabPbrNormal(a);return Object.entries(e).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),e}};var U=class{constructor({lightHeight:a=.66,ambientLight:e=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:n=[1,1,1]}={}){this.lightHeight=a,this.ambientLight=e,this.minLightIntensity=r,this.lightDiffuse=n}bake(a,e,r){let n=e instanceof HTMLCanvasElement?e:this.createCanvas(e.width,e.height),i=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),l=n.getContext("2d"),o=i.getContext("2d");l.drawImage(e,0,0),o.drawImage(r,0,0);let g=l.getImageData(0,0,e.width,e.height),f=o.getImageData(0,0,r.width,r.height),x=[],h=[];for(let m=0;m{let p=this.createCanvas(e.width,e.height),c=p.getContext("2d"),d=c.getImageData(0,0,p.width,p.height),v=[Math.cos(m),Math.sin(m),this.lightHeight];for(let M=0;M{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new D(r.layers_enabled?r.layers:Project.textures,r.uuid),i=n.findTexture(u.albedo);if(!i){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let l=n.findTexture(u.normal);if(!l){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let g=new U(t).bake(a,i.canvas,l.canvas),f=new Texture({name:`${i.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(g[0].toDataURL()),x=e?h=>{let _=n.findTexture(u.emissive);if(!_)return h;let m=_.canvas;if(!m.getContext("2d"))return h;let c=Math.max(h.width,m.width,Project?Project.texture_width:16),d=Math.max(h.height,m.height,Project?Project.texture_height:16),v=document.createElement("canvas");v.width=c,v.height=d;let M=v.getContext("2d");return M?(M.drawImage(h,0,0),M.globalCompositeOperation="screen",M.drawImage(m,0,0),v):h}:h=>h;g.forEach((h,_)=>{new TextureLayer({name:`baked_${_+1}`,data_url:x(h).toDataURL()},f).addForEditing()}),f.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};C.push(()=>{s.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(t){let a=new b.Color(t.ambientLight.toString()),e=new b.Color(t.lightDiffuse.toString());ae({ambientLight:[a.r,a.g,a.b],lightDiffuse:[e.r,e.g,e.b],lightHeight:Number(t.lightHeight),minLightIntensity:Number(t.minLightIntensity)},t.directions??8,t.blendEmissive??!1)}}),s.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){s.bakeTexturesDialog?.show()}}),MenuBar.addAction(s.bakeTexturesAction,"tools")});L.push(()=>{MenuBar.removeAction("tools.bake_textures")});function re(t,a){let e=t.getTexture();if(!e||!Project)return null;let r=Project.materials[e.uuid];r.isShaderMaterial&&!Project.bb_materials[e.uuid]?Project.bb_materials[e.uuid]=r:r.isMeshStandardMaterial&&r.dispose();let n=new D(e.layers_enabled?e.layers.filter(i=>i.visible)??null:Project.textures,e.uuid).getMaterial({side:Canvas.getRenderSide(e),...a});return Project.materials[e.uuid]=b.ShaderMaterial.prototype.copy.call(n,r),e}function ne(t){return Object.values(t).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function ke(t,a){let e={};return t.forAllFaces(r=>{let n=re(r,a);n&&(e[n.uuid]=n)}),ne(e)}function Se(t,a){let e={};return Object.keys(t.faces).forEach(r=>{let n=t.faces[r],i=re(n,a);i&&(e[i.uuid]=i)}),ne(e)}var A=(t={})=>{Project&&(Project.pbr_active=Texture.all.length>0&&Project.elements.map(a=>a instanceof Mesh&&ke(a,t)||a instanceof Cube&&Se(a,t)).filter(Boolean).length>0)},B=(t=100)=>te(A,t);var V={},G={};C.push(()=>{Object.entries(u).forEach(([t,a])=>{V[t]=new Action(`assign_channel_${t}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:{selected:{texture:!0},project:!0,method(){return k()?.material===!0&&R()!==null}},click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e)return;Undo.initEdit({layers:[e]}),e.extend({channel:a.id});let r=e instanceof TextureLayer?e.texture:e;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([n,i])=>{i===e.uuid&&(delete Project.pbr_materials[r.uuid][n],e.channel=N)}),r.uuid===e.uuid&&(Project.pbr_materials[r.uuid]={}),Project.pbr_materials[r.uuid][t]=e.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${e.name}" to ${a.label} channel`,2e3),A()}}),G[t]=new Action(`select_channel_${t}`,{icon:a.icon??"tv_options_edit_channels",name:a.label??t,description:`Select the ${a.label} channel`,condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){let e=k();return(e?.layers_enabled?e.layers:Texture.all).some(n=>n.channel===t)}},click(){let e=Texture.selected?.layers_enabled?Texture.selected.layers:Texture.all;if(!e||!e.length)return;let r=e.find(n=>n.channel===t);r&&(r.select(),r.scrollTo())}}),G[t].addLabel(!0,()=>a.label??t)})});L.push(()=>{[...Object.values(V),...Object.values(G)].forEach(a=>{a.delete()})});C.push(()=>{s.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:{selected:{texture:!0},method(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);return t?.channel&&t.channel!==N}},click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t)return;Undo.initEdit({layers:[t]});let a=t instanceof TextureLayer?t.texture:t,e=t.channel;Project.pbr_materials[a.uuid]={},t.channel=N,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${t.name}" from ${e} channel`,2e3),B()}}),s.channelMenu=new Menu("channel_menu",[...Object.keys(u).map(t=>`assign_channel_${t}`),"unassign_channel"],{onOpen(){B()}}),s.channelSelectionMenu=new Menu("channel_selection_menu",Object.keys(u).map(t=>`select_channel_${t}`)),s.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",condition:{modes:["edit","paint"],selected:{texture:!0}},click(t){s.channelMenu?.open(t)},children:[...Object.values(V),s.unassignChannel]}),s.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(t){s.channelMenu?.open(t)}}),s.showChannelSelectionMenu=new Action("show_channel_select_menu",{icon:"tv_options_edit_channels",name:"Select PBR Channel",description:"Select a channel to view",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(t){s.channelSelectionMenu?.open(t)}}),s.openChannelMenu&&(MenuBar.addAction(s.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(s.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(s.openChannelMenu,"0")),Toolbars.layers.add(s.showChannelMenu,1)});L.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(s.showChannelMenu)});function J(t,a=!1){let e=t.canvas.getContext("2d");if(!e)return null;let r=Math.max(t.img.width??t.canvas.width,Project?Project.texture_width:0,16),n=Math.max(t.img.height??t.canvas.height,Project?Project.texture_height:0,16),{data:i}=e.getImageData(0,0,r,n),l=document.createElement("canvas"),o=l.getContext("2d");if(!o)return null;let g=(c,d)=>{let v=(c+d*r)*4;return i[v]/255};l.width=r,l.height=n,o.drawImage(t.img,0,0,r,n);let f=o.getImageData(0,0,r,n),x=f.data,h=c=>{let d=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);return[c[0]/d,c[1]/d,c[2]/d]};for(let c=0;c{let c=(m+p*e)*4;return n[c]/255};i.width=e,i.height=r,l.drawImage(t.img,0,0,e,r);let g=l.getImageData(0,0,e,r),f=g.data;for(let m=0;m{s.generateNormal=new Action("generate_normal",{icon:u.normal.icon??"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(R()??k())!==null,click(t){let a=R()??k()??Texture.getDefault();if(!a)return;let e=J(a);if(!e){Blockbench.showQuickMessage("Failed to generate normal map",2e3);return}e.select(t),new D(a instanceof Texture&&a.layers_enabled?a.layers:null,a.uuid).saveTexture(u.normal,e),Blockbench.showQuickMessage("Normal map generated",2e3)}}),s.generateAo=new Action("generate_ao",{icon:u.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let t=R()??k()??Texture.getDefault();if(!t)return;let a=new D(t instanceof Texture&&t.layers_enabled?t.layers:null,t.uuid),e=a.findTexture(u.normal)??J(t);if(!e){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=se(e);if(r){a.saveTexture(u.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),MenuBar.addAction(s.generateNormal,"tools"),MenuBar.addAction(s.generateAo,"tools")});L.push(()=>{MenuBar.removeAction("tools.generate_normal")});C.push(()=>{s.createMaterialTexture=new Action("create_material_texture",{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let t={...u},a=new Texture({name:"New Material",saved:!1,particle:!1});a.extend({material:!0});let e=Texture.all.filter(l=>l.selected||l.multi_selected)??Texture.all,r=k(),n=r?new D(e,r.uuid):null;try{let l=n?.findTexture(u.albedo,!0)?.canvas.toDataURL()??r?.canvas.toDataURL()??Q(new b.Color(8421504),a.canvas);if(!l)return;a.fromDataURL(l);let o=new TextureLayer({name:t.albedo.label,visible:!0,data_url:l,keep_size:!0},a);o.extend({channel:t.albedo.id}),o.addForEditing(),o.texture.updateChangesAfterEdit(),n?.saveTexture(t.albedo,o),delete t.albedo}catch(l){console.warn("Failed to create base color texture",l),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let i=Object.keys(t).map(l=>{let o=u[l],g=n?.findTexture(o,!0),f=g?g.canvas.toDataURL():Q(o.default??new b.Color(0));if(!f)return;let x=new TextureLayer({name:o.label,visible:!0,data_url:f,keep_size:!0},a);return x.extend({channel:o.id}),n?.saveTexture(o,x),x}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:i}),a.add().select(),a.activateLayers(),i.map(l=>{l.addForEditing(),a.width=Math.max(a.width,l.img.width),a.height=Math.max(a.height,l.img.height)}),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(s.createMaterialTexture,"tools"),Toolbars.texturelist.add(s.createMaterialTexture,3)});L.push(()=>{MenuBar.removeAction("tools.create_material_texture"),Toolbars.texturelist.remove("tools.create_material_texture")});var $=(t,a)=>{let e=k()??Texture.getDefault(),r=new D(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[i,l]=Project?[t?`${t}_mer`:`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:i,extensions:["png"],resource_id:"mer",savetype:"image",startpath:l},a)})};C.push(()=>{s.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{$()}catch(t){console.error("Failed to export MER map:",t),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),s.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let t=k()??Texture.getDefault(),a=new D([t],t.uuid),e=a.decodeMer(),r=[u.metalness,u.emissive,u.roughness];Undo.initEdit({textures:[t]}),r.forEach(n=>{let i=n.id,l=e[i];if(!l){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let o=new Texture({name:`${t?.name}_${i}`,keep_size:!1}).fromDataURL(l.toDataURL());o.add(!0),a.saveTexture(n,o)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>k()?.layers_enabled===!0,click(){let t=TextureLayer.selected?.texture??Texture.all.find(i=>i.selected)??Texture.getDefault(),a=new D(t.layers_enabled?t.layers:[t],t.uuid),e=a.decodeMer(),r=[u.metalness,u.emissive,u.roughness];Undo.initEdit({textures:[t]});let n=t.selected.activateLayers(!0);r.forEach(i=>{let l=i.id,o=e[l];if(!o){Blockbench.showStatusMessage(`Failed to decode ${i.label} channel`,3e3);return}let g=new TextureLayer({name:`${t?.name}_${l}`,data_url:o.toDataURL()},t);a.saveTexture(i,g),g.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(s.decodeMer,"tools"),MenuBar.addAction(s.generateMer,"file.export")});L.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var Ae=()=>{Project&&Project.textures.forEach(t=>{let a=new D(null,t.uuid),e=a.findTexture(u.normal,!1),r=a.findTexture(u.height,!1),n=a.findTexture(u.albedo,!1),i=a.findTexture(u.metalness,!1)?.name,l=a.findTexture(u.emissive,!1)?.name,o=a.findTexture(u.roughness,!1)?.name,g={};return n||(g.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!i&&!l&&!o&&(g.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},g.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},g.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),e&&(g.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(g.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),e&&r&&(g.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),s.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:g,cancelIndex:1,onConfirm(f){let x=ee(),h=i||l||o,_={format_version:"1.16.100","minecraft:texture_set":{color:(n?x:f.baseColor?.toHexString())??x,metalness_emissive_roughness:[f.metalness??0,f.emissive??0,f.roughness??255]}};f.depthMap==="normal"&&e||!r&&e?_["minecraft:texture_set"].normal=`${x}_normal`:(!e||f.depthMap==="heightmap")&&r&&(_["minecraft:texture_set"].heightmap=`${x}_heightmap`);let m=d=>{if(!f.depthMap)return d();let v=f.depthMap==="normal"||f.depthMap&&!r,M=v?e:r;if(!M)return d();Blockbench.export({content:M.canvas.toDataURL()??"",type:"PNG",name:`${x}_${v?"normal":"heightmap"}`,extensions:["png"],resource_id:f.depthMap,startpath:Project.export_path,savetype:"image"},w=>{_["minecraft:texture_set"][v?"normal":"heightmap"]=pathToName(w,!1),d()})},p=d=>{if(!n)return d();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:x,startpath:Project.export_path,savetype:"image"},v=>{_["minecraft:texture_set"].color=pathToName(v,!1),d()})},c=()=>m(()=>{p(()=>{Blockbench.export({content:JSON.stringify(_,null,2),type:"JSON",name:`${x}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),s.textureSetDialog?.hide()})})});if(h){try{$(x,d=>{_["minecraft:texture_set"].metalness_emissive_roughness=pathToName(d,!1),c()})}catch(d){console.warn("Failed to export MER map:",d),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}c()}}),s.textureSetDialog.show()})};C.push(()=>{s.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){Ae()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(s.createTextureSet,"file.export")});L.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});C.push(()=>{s.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(t){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=t}),Preview.selected.renderer.physicallyCorrectLights=t,Blockbench.showQuickMessage(`Physically corrected lighting is now ${t?"enabled":"disabled"}`,2e3),t&&s.togglePbr?.set(!0),A()},click(){}}),MenuBar.addAction(s.toggleCorrectLights,"preview")});L.push(()=>{MenuBar.removeAction("preview.correct_lights")});var F=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(a=>{let r=t.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var oe=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],ie=()=>Project&&Project.pbr_active&&A(),Ne=()=>{Blockbench.on(oe.join(" "),ie)},le=()=>{oe.forEach(t=>{Blockbench.removeListener(t,ie)})};C.push(()=>{s.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(t){if(t){A(),Ne(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}F(),le(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(s.togglePbr,"view")});L.push(()=>{le(),MenuBar.removeAction("view.toggle_pbr")});var ce=t=>{let a=Math.max(-2,Math.min(2,t));Preview.all.forEach(e=>{e.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};C.push(()=>{s.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(s.tonemappingSelect?.get())===b.NoToneMapping&&s.tonemappingSelect.change(b.LinearToneMapping.toString()),s.togglePbr?.set(!0)},onChange(t){ce(Number(t))},onAfter(){B()}}),s.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>s.exposureSlider!==void 0&&Number(s.exposureSlider?.get())!==1,click(){ce(1),s.exposureSlider?.setValue(1,!0),B()}}),s.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:b.NoToneMapping,value:Preview.selected.renderer.toneMapping??b.NoToneMapping,icon:"monochrome_photos",options:{[b.NoToneMapping]:"No Tone Mapping",[b.LinearToneMapping]:"Linear",[b.ReinhardToneMapping]:"Reinhard",[b.CineonToneMapping]:"Cineon",[b.NeutralToneMapping]:"Neutral",[b.ACESFilmicToneMapping]:"ACES"},onChange({value:t}){Preview.selected.renderer.toneMapping=Number(t);let a=1;Preview.selected.renderer.toneMapping===b.NoToneMapping?s.exposureSlider?.setValue(a,!0):a=Number(s.exposureSlider?.get()??1),Preview.all.forEach(e=>{e.renderer.toneMapping=Number(t),e.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(t)}`,2e3),s.togglePbr&&!s.togglePbr.value&&s.togglePbr.set(!0),A()}})});var Be=(t,a="texture")=>{t.toBlob(async e=>{e&&Blockbench.export({content:await e.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},Re=(t,a="texture")=>{t.toBlob(async e=>{e&&Blockbench.export({content:await e.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};C.push(()=>{s.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let t=k();if(!t)return;let e=new D(t.layers_enabled?t.layers:[t],t.uuid).createLabPbrOutput();if(e===null)return;let r=t.name??(Project?Project.getDisplayName():"texture");await Promise.all([Be(e.normalMap,pathToName(r)),Re(e.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),s.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let t=TextureLayer.selected?.texture??Texture.all.find(e=>e.selected)??Texture.getDefault(),a=new D(t.layers_enabled?t.layers:[t],t.uuid);if(pathToName(t.name).endsWith("_n")){a.createTexturesFromNormal(t);return}if(pathToName(t.name).endsWith("_s")){a.createTexturesFromSpecular(t);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(s.generateLabPbr,"file.export"),MenuBar.addAction(s.decodeLabPbr,"tools")});L.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});var O=class t{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(u).map(e=>[e,u[e].default??new b.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([e,r])=>[e,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let e=Math.min(1,Math.max(0,a));return new b.Color(e,e,e).convertSRGBToLinear()}static fromSettings(){let a="#000000",e=Number(s.brushMetalnessSlider?.get()),r=Number(s.brushRoughnessSlider?.get()??1),n=(s.brushEmissiveColor?.get()??a).toString(),i=Number(s.brushHeightSlider?.get()),l=ColorPanel.get(),o={[u.albedo.id]:new b.Color(l),[u.metalness.id]:t.makeLinearColor(e),[u.roughness.id]:t.makeLinearColor(r),[u.emissive.id]:new b.Color(n??a),[u.height.id]:t.makeLinearColor(i),[u.normal.id]:u.normal.default??new b.Color("#8080ff")};return new t({colors:o})}};var ue="materialBrushPresets",q=()=>JSON.parse(localStorage.getItem(ue)||"{}"),Ie=(t,a)=>{let e=q(),r=a??guid(),n=s.userMaterialBrushPresets?.getFormResult()??{},i={};return n.albedo&&(i.albedo=n.albedo.toString()),n.metalness&&(i.metalness=Number(n.metalness)),n.roughness&&(i.roughness=Number(n.roughness)),n.emissive&&(i.emissive=n.emissive.toString()),n.height&&(i.height=Number(n.height)),e[r]=[i,t??"New Preset",H(i)],localStorage.setItem(ue,JSON.stringify(e)),r},me=({metalness:t,roughness:a,emissive:e,height:r,albedo:n})=>{t!==void 0&&s.brushMetalnessSlider?.setValue(t||0,!0),a!==void 0&&s.brushRoughnessSlider?.setValue(a??1,!0),e!==void 0&&s.brushEmissiveColor?.set(e??"#000000"),r!==void 0&&s.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},z=({id:t})=>Condition({project:!0,tools:["material_brush"],method(){let a=k();return(a?.layers_enabled&&a.layers.find(({channel:e})=>e&&e===t)!==void 0)===!0}}),He=X.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:u}},methods:{applyPreset(t){try{let[a,e]=this.userPresets[t],{metalness:r,roughness:n,emissive:i,height:l,albedo:o}=a;me({metalness:Number(r),roughness:Number(n),emissive:i.toString(),height:Number(l),albedo:o.toString()}),s.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${e}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(t){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let e=q(),r=this.userPresets[t][1]??t;delete e[t],localStorage.setItem("materialBrushPresets",JSON.stringify(e)),this.userPresets=e,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(t){s.userMaterialBrushPresets?.setFormValues({name:this.userPresets[t][1]??t,...this.userPresets[t][0]})},getSummary(t){return Object.entries(t).filter(([a])=>a in this.channels).map(([a,e])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${e}`:`${this.channels[a]?.label??a}: ${Number(e).toFixed(1)}`).join(` +"use strict";(()=>{var b=THREE,X=Vue;var N="_NONE_",u={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new b.Color(16777215),regex:new RegExp("(s|_)*(basecolor|color|albedo)","i")},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new b.Color(0),regex:new RegExp("[ _]*metal(lic|ness)?","i")},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new b.Color(0),regex:new RegExp("[ _]*(emissive|emission)","i")},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new b.Color(16777215),regex:new RegExp("[ _]*rough(ness)?","i")},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new b.Color(16777215),regex:new RegExp("[ _]*(height|bump)","i")},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new b.Color("rgb(128, 128, 255)"),regex:new RegExp("[ _]*normal","i")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new b.Color(16777215),regex:new RegExp("[ _]*(ao|ambientocclusion|ambient occlusion)","i")}},s={},C=[],L=[];var Y=[...Object.keys(u).map(t=>u[t].id),N];C.push(()=>{s.channelProp=new Property(TextureLayer,"enum","channel",{default:N,values:Y,label:"PBR Channel",exposed:!1}),s.textureChannelProp=new Property(Texture,"enum","channel",{default:N,values:Y,label:"PBR Channel",exposed:!1}),s.materialTextureProp=new Property(Texture,"boolean","material",{default:!1,label:"Material Texture"}),s.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),s.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),s.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!1,values:[],label:"PBR Mode"})});function D(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(t=>t.selected)??null:Texture.all.find(t=>t.selected)??Texture.getDefault()}function R(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(t=>t.selected)??Project.selected_texture.layers[0]:D()?.getActiveLayer()??null}function ee(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(D()?.name??"texture")}function te(t,a){let e;return function(...r){let n=()=>{e=void 0,t.apply(this,r)};clearTimeout(e),e=setTimeout(n,a)}}function H(t){let a=MediaPreview.renderer??new b.WebGLRenderer({alpha:!0,antialias:!0}),e=new b.Scene,r=new b.PerspectiveCamera(75,96/96,.1,1e3),n=new b.AmbientLight(16777215,.75);e.add(n);let c=new b.PointLight(16777215,1,100);c.position.set(5,5,5),e.add(c);let i=new b.SphereGeometry(1,32,32),o=t instanceof b.MeshStandardMaterial&&t.isMeshStandardMaterial?t:new b.MeshStandardMaterial({color:t.albedo,metalness:t.metalness??0,roughness:t.roughness??1,emissive:t.emissive,bumpScale:t.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),p=new b.Mesh(i,o);e.add(p),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(e,r);let f=a.domElement.toDataURL();return o.dispose(),MediaPreview.renderer||(a.clear(),a.dispose()),f}function Q(t,a){let e=a??document.createElement("canvas"),r=e.getContext("2d");if(!r)return e.remove(),null;let n=Math.max(Project?Project.texture_width:16,16),c=Math.max(Project?Project.texture_height:16,16);e.width=n,e.height=c,r.fillStyle=`rgb(${t.r*255}, ${t.g*255}, ${t.b*255})`,r.fillRect(0,0,n,c);let i=e.toDataURL();return a||e.remove(),i}var De=(t=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return t?a.filter(e=>e.layers_enabled&&e.layers.length>0).flatMap(e=>e.layers):a},k=class t{constructor(a,e){this._scope=a??De(),this._materialUuid=e}merToCanvas(){let a=this.getTexture(u.emissive),e=this.getTexture(u.roughness),r=this.getTexture(u.metalness);if(!a&&!e&&!r){let{metalness:n,emissive:c,roughness:i}=this.decodeMer();n&&(r=t.makePixelatedCanvas(n)),c&&(a=t.makePixelatedCanvas(c)),i&&(e=t.makePixelatedCanvas(i))}return{emissiveMap:a,roughnessMap:e,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:e,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(u.emissive),roughnessMap:this.getTexture(u.roughness),metalnessMap:this.getTexture(u.metalness)},c=this.getTexture(u.normal);return new b.MeshStandardMaterial({map:this.getTexture(u.albedo)??t.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(i=>i.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(u.ao),bumpMap:this.getTexture(u.height),normalMap:c,normalScale:new b.Vector2(-1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:e,emissiveIntensity:e?1:0,emissive:e?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}renderMaterialPreview(){return H(this.getMaterial())}saveTexture(a,e){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=e.uuid,e.extend({channel:a.id}))}findTexture(a,e=!0){if(!Project)return null;let r=this._scope.find(p=>p.channel&&(p.channel===a||p.channel===a.id));if(r)return r;let[n,c]=typeof a=="string"?[a,new RegExp(`_*${a}(.[^.]+)?$`,"i")]:[a.id,a.regex??new RegExp(`_*${a.id}(.[^.]+)?$`,"i")];Project.pbr_materials=Project.pbr_materials??{};let i=Project.pbr_materials[this._materialUuid];if(e&&!i&&n!==N)return this._scope.find(p=>c?.test(p.name))??null;let o=i?.[n];return o?this._scope.find(p=>p.uuid===o)??null:null}static makePixelatedCanvas(a){let e=new b.CanvasTexture(a,void 0,void 0,void 0,b.NearestFilter,b.NearestFilter);return e.needsUpdate=!0,e}getTexture(a){let e=this.findTexture(a);return e?t.makePixelatedCanvas(e.canvas):null}static extractChannel(a,e){let r=a.canvas,{width:n,height:c}=r,i=r.getContext("2d");if(!i||!n||!c)return null;let o=document.createElement("canvas");o.width=n,o.height=c;let p=o.getContext("2d");if(!p)return null;let f={r:0,g:1,b:2,a:3}[e],{data:x}=i.getImageData(0,0,n,c),h=new Uint8ClampedArray(n*c*4);for(let m=0;ma){g[l]=_.data[l],g[l+1]=_.data[l+1],g[l+2]=_.data[l+2],g[l+3]=255;continue}g[l]=0,g[l+1]=0,g[l+2]=0,g[l+3]=255}return f.putImageData(new ImageData(g,o.width,o.height),0,0),{metalness:r,emissive:o,emissiveLevel:n,roughness:c,sss:i}}createMer(a=!1){let e=this.findTexture(u.metalness,a),r=this.findTexture(u.emissive,a),n=this.findTexture(u.roughness,a),c=this.findTexture("sss",!1),i=Math.max(e?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),o=Math.max(e?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),p=document.createElement("canvas");p.width=i,p.height=o;let f=p.getContext("2d");if(!f)return null;let x=e?.img?t.extractChannel(e,"r"):null,h=r?.img?t.extractChannel(r,"g"):null,_=n?.img?t.extractChannel(n,"b"):null,m=c&&c?.img?t.extractChannel(c,"a"):null,g=x?.getContext("2d")?.getImageData(0,0,i,o)??new ImageData(i,o),l=h?.getContext("2d")?.getImageData(0,0,i,o)??new ImageData(i,o),d=_?.getContext("2d")?.getImageData(0,0,i,o)??new ImageData(i,o),v=m?.getContext("2d")?.getImageData(0,0,i,o)??new ImageData(new Uint8ClampedArray(i*o*4).fill(255),i,o),M=new Uint8ClampedArray(i*o*4);for(let w=0;w{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),e}createTexturesFromNormal(a){let e=this.decodeLabPbrNormal(a);return Object.entries(e).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),e}};var U=class{constructor({lightHeight:a=.66,ambientLight:e=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:n=[1,1,1]}={}){this.lightHeight=a,this.ambientLight=e,this.minLightIntensity=r,this.lightDiffuse=n}bake(a,e,r){let n=e instanceof HTMLCanvasElement?e:this.createCanvas(e.width,e.height),c=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),i=n.getContext("2d"),o=c.getContext("2d");i.drawImage(e,0,0),o.drawImage(r,0,0);let p=i.getImageData(0,0,e.width,e.height),f=o.getImageData(0,0,r.width,r.height),x=[],h=[];for(let m=0;m{let g=this.createCanvas(e.width,e.height),l=g.getContext("2d"),d=l.getImageData(0,0,g.width,g.height),v=[Math.cos(m),Math.sin(m),this.lightHeight];for(let M=0;M{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new k(r.layers_enabled?r.layers:Project.textures,r.uuid),c=n.findTexture(u.albedo);if(!c){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let i=n.findTexture(u.normal);if(!i){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let p=new U(t).bake(a,c.canvas,i.canvas),f=new Texture({name:`${c.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(p[0].toDataURL()),x=e?h=>{let _=n.findTexture(u.emissive);if(!_)return h;let m=_.canvas;if(!m.getContext("2d"))return h;let l=Math.max(h.width,m.width,Project?Project.texture_width:16),d=Math.max(h.height,m.height,Project?Project.texture_height:16),v=document.createElement("canvas");v.width=l,v.height=d;let M=v.getContext("2d");return M?(M.drawImage(h,0,0),M.globalCompositeOperation="screen",M.drawImage(m,0,0),v):h}:h=>h;p.forEach((h,_)=>{new TextureLayer({name:`baked_${_+1}`,data_url:x(h).toDataURL()},f).addForEditing()}),f.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};C.push(()=>{s.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(t){let a=new b.Color(t.ambientLight.toString()),e=new b.Color(t.lightDiffuse.toString());ae({ambientLight:[a.r,a.g,a.b],lightDiffuse:[e.r,e.g,e.b],lightHeight:Number(t.lightHeight),minLightIntensity:Number(t.minLightIntensity)},t.directions??8,t.blendEmissive??!1)}}),s.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){s.bakeTexturesDialog?.show()}}),MenuBar.addAction(s.bakeTexturesAction,"tools")});L.push(()=>{MenuBar.removeAction("tools.bake_textures")});function re(t,a){let e=t.getTexture();if(!e||!Project)return null;let r=Project.materials[e.uuid];r.isShaderMaterial&&!Project.bb_materials[e.uuid]?Project.bb_materials[e.uuid]=r:r.isMeshStandardMaterial&&r.dispose();let n=new k(e.layers_enabled?e.layers.filter(c=>c.visible)??null:Project.textures,e.uuid).getMaterial({side:Canvas.getRenderSide(e),...a});return Project.materials[e.uuid]=b.ShaderMaterial.prototype.copy.call(n,r),e}function ne(t){return Object.values(t).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function ke(t,a){let e={};return t.forAllFaces(r=>{let n=re(r,a);n&&(e[n.uuid]=n)}),ne(e)}function Se(t,a){let e={};return Object.keys(t.faces).forEach(r=>{let n=t.faces[r],c=re(n,a);c&&(e[c.uuid]=c)}),ne(e)}var A=(t={})=>{Project&&(Project.pbr_active=Texture.all.length>0&&Project.elements.map(a=>a instanceof Mesh&&ke(a,t)||a instanceof Cube&&Se(a,t)).filter(Boolean).length>0)},B=(t=100)=>te(A,t);var V={},G={};C.push(()=>{Object.entries(u).forEach(([t,a])=>{V[t]=new Action(`assign_channel_${t}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:{selected:{texture:!0},project:!0,method(){return D()?.material===!0&&R()!==null}},click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e)return;Undo.initEdit({layers:[e]}),e.extend({channel:a.id});let r=e instanceof TextureLayer?e.texture:e;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([n,c])=>{c===e.uuid&&(delete Project.pbr_materials[r.uuid][n],e.channel=N)}),r.uuid===e.uuid&&(Project.pbr_materials[r.uuid]={}),Project.pbr_materials[r.uuid][t]=e.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${e.name}" to ${a.label} channel`,2e3),A()}}),G[t]=new Action(`select_channel_${t}`,{icon:a.icon??"tv_options_edit_channels",name:a.label??t,description:`Select the ${a.label} channel`,condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){let e=D();return(e?.layers_enabled?e.layers:Texture.all).some(n=>n.channel===t)}},click(){let e=Texture.selected?.layers_enabled?Texture.selected.layers:Texture.all;if(!e||!e.length)return;let r=e.find(n=>n.channel===t);r&&(r.select(),r.scrollTo())}}),G[t].addLabel(!0,()=>a.label??t)})});L.push(()=>{[...Object.values(V),...Object.values(G)].forEach(a=>{a.delete()})});C.push(()=>{s.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:{selected:{texture:!0},method(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);return t?.channel&&t.channel!==N}},click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t)return;Undo.initEdit({layers:[t]});let a=t instanceof TextureLayer?t.texture:t,e=t.channel;Project.pbr_materials[a.uuid]={},t.channel=N,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${t.name}" from ${e} channel`,2e3),B()}}),s.channelMenu=new Menu("channel_menu",[...Object.keys(u).map(t=>`assign_channel_${t}`),"unassign_channel"],{onOpen(){B()}}),s.channelSelectionMenu=new Menu("channel_selection_menu",Object.keys(u).map(t=>`select_channel_${t}`)),s.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",condition:{modes:["edit","paint"],selected:{texture:!0}},click(t){s.channelMenu?.open(t)},children:[...Object.values(V),s.unassignChannel]}),s.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(t){s.channelMenu?.open(t)}}),s.showChannelSelectionMenu=new Action("show_channel_select_menu",{icon:"tv_options_edit_channels",name:"Select PBR Channel",description:"Select a channel to view",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(t){s.channelSelectionMenu?.open(t)}}),s.openChannelMenu&&(MenuBar.addAction(s.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(s.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(s.openChannelMenu,"0")),Toolbars.layers.add(s.showChannelMenu,1)});L.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(s.showChannelMenu)});function J(t,a=!1){let e=t.canvas.getContext("2d");if(!e)return null;let r=Math.max(t.img.width??t.canvas.width,Project?Project.texture_width:0,16),n=Math.max(t.img.height??t.canvas.height,Project?Project.texture_height:0,16),{data:c}=e.getImageData(0,0,r,n),i=document.createElement("canvas"),o=i.getContext("2d");if(!o)return null;let p=(l,d)=>{let v=(l+d*r)*4;return c[v]/255};i.width=r,i.height=n,o.drawImage(t.img,0,0,r,n);let f=o.getImageData(0,0,r,n),x=f.data,h=l=>{let d=Math.sqrt(l[0]*l[0]+l[1]*l[1]+l[2]*l[2]);return[l[0]/d,l[1]/d,l[2]/d]};for(let l=0;l{let l=(m+g*e)*4;return n[l]/255};c.width=e,c.height=r,i.drawImage(t.img,0,0,e,r);let p=i.getImageData(0,0,e,r),f=p.data;for(let m=0;m{s.generateNormal=new Action("generate_normal",{icon:u.normal.icon??"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(R()??D())!==null,click(t){let a=R()??D()??Texture.getDefault();if(!a)return;let e=J(a);if(!e){Blockbench.showQuickMessage("Failed to generate normal map",2e3);return}e.select(t),new k(a instanceof Texture&&a.layers_enabled?a.layers:null,a.uuid).saveTexture(u.normal,e),Blockbench.showQuickMessage("Normal map generated",2e3)}}),s.generateAo=new Action("generate_ao",{icon:u.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let t=R()??D()??Texture.getDefault();if(!t)return;let a=new k(t instanceof Texture&&t.layers_enabled?t.layers:null,t.uuid),e=a.findTexture(u.normal)??J(t);if(!e){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=se(e);if(r){a.saveTexture(u.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),MenuBar.addAction(s.generateNormal,"tools"),MenuBar.addAction(s.generateAo,"tools")});L.push(()=>{MenuBar.removeAction("tools.generate_normal")});C.push(()=>{s.createMaterialTexture=new Action("create_material_texture",{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let t={...u},a=new Texture({name:"New Material",saved:!1,particle:!1});a.extend({material:!0});let e=Texture.all.filter(i=>i.selected||i.multi_selected)??Texture.all,r=D(),n=r?new k(e,r.uuid):null;try{let i=n?.findTexture(u.albedo,!0)?.canvas.toDataURL()??r?.canvas.toDataURL()??Q(new b.Color(8421504),a.canvas);if(!i)return;a.fromDataURL(i);let o=new TextureLayer({name:t.albedo.label,visible:!0,data_url:i,keep_size:!0},a);o.extend({channel:t.albedo.id}),o.addForEditing(),o.texture.updateChangesAfterEdit(),n?.saveTexture(t.albedo,o),delete t.albedo}catch(i){console.warn("Failed to create base color texture",i),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let c=Object.keys(t).map(i=>{let o=u[i],p=n?.findTexture(o,!0),f=p?p.canvas.toDataURL():Q(o.default??new b.Color(0));if(!f)return;let x=new TextureLayer({name:o.label,visible:!0,data_url:f,keep_size:!0},a);return x.extend({channel:o.id}),n?.saveTexture(o,x),x}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:c}),a.add().select(),a.activateLayers(),c.map(i=>{i.addForEditing(),a.width=Math.max(a.width,i.img.width),a.height=Math.max(a.height,i.img.height)}),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(s.createMaterialTexture,"tools"),Toolbars.texturelist.add(s.createMaterialTexture,3)});L.push(()=>{MenuBar.removeAction("tools.create_material_texture"),Toolbars.texturelist.remove("tools.create_material_texture")});var $=(t,a)=>{let e=D()??Texture.getDefault(),r=new k(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[c,i]=Project?[t?`${t}_mer`:`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:c,extensions:["png"],resource_id:"mer",savetype:"image",startpath:i},a)})};C.push(()=>{s.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{$()}catch(t){console.error("Failed to export MER map:",t),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),s.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let t=D()??Texture.getDefault(),a=new k([t],t.uuid),e=a.decodeMer(),r=[u.metalness,u.emissive,u.roughness];Undo.initEdit({textures:[t]}),r.forEach(n=>{let c=n.id,i=e[c];if(!i){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let o=new Texture({name:`${t?.name}_${c}`,keep_size:!1}).fromDataURL(i.toDataURL());o.add(!0),a.saveTexture(n,o)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>D()?.layers_enabled===!0,click(){let t=D()??Texture.getDefault(),a=new k(t.layers_enabled?t.layers:[t],t.uuid),e=a.decodeMer(),r=[u.metalness,u.emissive,u.roughness];Undo.initEdit({textures:[t]}),r.forEach(n=>{let c=n.id,i=e[c];if(!i){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let o=new TextureLayer({name:`${t?.name}_${c}`,data_url:i.toDataURL()},t);a.saveTexture(n,o),o.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(s.decodeMer,"tools"),MenuBar.addAction(s.generateMer,"file.export")});L.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var Ae=()=>{Project&&Project.textures.forEach(t=>{let a=new k(null,t.uuid),e=a.findTexture(u.normal,!1),r=a.findTexture(u.height,!1),n=a.findTexture(u.albedo,!1),c=a.findTexture(u.metalness,!1)?.name,i=a.findTexture(u.emissive,!1)?.name,o=a.findTexture(u.roughness,!1)?.name,p={};return n||(p.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!c&&!i&&!o&&(p.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},p.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},p.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),e&&(p.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(p.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),e&&r&&(p.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),s.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:p,cancelIndex:1,onConfirm(f){let x=ee(),h=c||i||o,_={format_version:"1.16.100","minecraft:texture_set":{color:(n?x:f.baseColor?.toHexString())??x,metalness_emissive_roughness:[f.metalness??0,f.emissive??0,f.roughness??255]}};f.depthMap==="normal"&&e||!r&&e?_["minecraft:texture_set"].normal=`${x}_normal`:(!e||f.depthMap==="heightmap")&&r&&(_["minecraft:texture_set"].heightmap=`${x}_heightmap`);let m=d=>{if(!f.depthMap)return d();let v=f.depthMap==="normal"||f.depthMap&&!r,M=v?e:r;if(!M)return d();Blockbench.export({content:M.canvas.toDataURL()??"",type:"PNG",name:`${x}_${v?"normal":"heightmap"}`,extensions:["png"],resource_id:f.depthMap,startpath:Project.export_path,savetype:"image"},w=>{_["minecraft:texture_set"][v?"normal":"heightmap"]=pathToName(w,!1),d()})},g=d=>{if(!n)return d();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:x,startpath:Project.export_path,savetype:"image"},v=>{_["minecraft:texture_set"].color=pathToName(v,!1),d()})},l=()=>m(()=>{g(()=>{Blockbench.export({content:JSON.stringify(_,null,2),type:"JSON",name:`${x}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),s.textureSetDialog?.hide()})})});if(h){try{$(x,d=>{_["minecraft:texture_set"].metalness_emissive_roughness=pathToName(d,!1),l()})}catch(d){console.warn("Failed to export MER map:",d),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}l()}}),s.textureSetDialog.show()})};C.push(()=>{s.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){Ae()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(s.createTextureSet,"file.export")});L.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});C.push(()=>{s.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(t){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=t}),Preview.selected.renderer.physicallyCorrectLights=t,Blockbench.showQuickMessage(`Physically corrected lighting is now ${t?"enabled":"disabled"}`,2e3),t&&s.togglePbr?.set(!0),A()},click(){}}),MenuBar.addAction(s.toggleCorrectLights,"preview")});L.push(()=>{MenuBar.removeAction("preview.correct_lights")});var F=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(a=>{let r=t.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var oe=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],ie=()=>Project&&Project.pbr_active&&A(),Ne=()=>{Blockbench.on(oe.join(" "),ie)},le=()=>{oe.forEach(t=>{Blockbench.removeListener(t,ie)})};C.push(()=>{s.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(t){if(t){A(),Ne(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}F(),le(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(s.togglePbr,"view")});L.push(()=>{le(),MenuBar.removeAction("view.toggle_pbr")});var ce=t=>{let a=Math.max(-2,Math.min(2,t));Preview.all.forEach(e=>{e.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};C.push(()=>{s.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(s.tonemappingSelect?.get())===b.NoToneMapping&&s.tonemappingSelect.change(b.LinearToneMapping.toString()),s.togglePbr?.set(!0)},onChange(t){ce(Number(t))},onAfter(){B()}}),s.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>s.exposureSlider!==void 0&&Number(s.exposureSlider?.get())!==1,click(){ce(1),s.exposureSlider?.setValue(1,!0),B()}}),s.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:b.NoToneMapping,value:Preview.selected.renderer.toneMapping??b.NoToneMapping,icon:"monochrome_photos",options:{[b.NoToneMapping]:"No Tone Mapping",[b.LinearToneMapping]:"Linear",[b.ReinhardToneMapping]:"Reinhard",[b.CineonToneMapping]:"Cineon",[b.NeutralToneMapping]:"Neutral",[b.ACESFilmicToneMapping]:"ACES"},onChange({value:t}){Preview.selected.renderer.toneMapping=Number(t);let a=1;Preview.selected.renderer.toneMapping===b.NoToneMapping?s.exposureSlider?.setValue(a,!0):a=Number(s.exposureSlider?.get()??1),Preview.all.forEach(e=>{e.renderer.toneMapping=Number(t),e.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(t)}`,2e3),s.togglePbr&&!s.togglePbr.value&&s.togglePbr.set(!0),A()}})});var Be=(t,a="texture")=>{t.toBlob(async e=>{e&&Blockbench.export({content:await e.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},Re=(t,a="texture")=>{t.toBlob(async e=>{e&&Blockbench.export({content:await e.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};C.push(()=>{s.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let t=D();if(!t)return;let e=new k(t.layers_enabled?t.layers:[t],t.uuid).createLabPbrOutput();if(e===null)return;let r=t.name??(Project?Project.getDisplayName():"texture");await Promise.all([Be(e.normalMap,pathToName(r)),Re(e.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),s.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let t=TextureLayer.selected?.texture??Texture.all.find(e=>e.selected)??Texture.getDefault(),a=new k(t.layers_enabled?t.layers:[t],t.uuid);if(pathToName(t.name).endsWith("_n")){a.createTexturesFromNormal(t);return}if(pathToName(t.name).endsWith("_s")){a.createTexturesFromSpecular(t);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(s.generateLabPbr,"file.export"),MenuBar.addAction(s.decodeLabPbr,"tools")});L.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});var O=class t{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(u).map(e=>[e,u[e].default??new b.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([e,r])=>[e,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let e=Math.min(1,Math.max(0,a));return new b.Color(e,e,e).convertSRGBToLinear()}static fromSettings(){let a="#000000",e=Number(s.brushMetalnessSlider?.get()),r=Number(s.brushRoughnessSlider?.get()??1),n=(s.brushEmissiveColor?.get()??a).toString(),c=Number(s.brushHeightSlider?.get()),i=ColorPanel.get(),o={[u.albedo.id]:new b.Color(i),[u.metalness.id]:t.makeLinearColor(e),[u.roughness.id]:t.makeLinearColor(r),[u.emissive.id]:new b.Color(n??a),[u.height.id]:t.makeLinearColor(c),[u.normal.id]:u.normal.default??new b.Color("#8080ff")};return new t({colors:o})}};var ue="materialBrushPresets",q=()=>JSON.parse(localStorage.getItem(ue)||"{}"),Ie=(t,a)=>{let e=q(),r=a??guid(),n=s.userMaterialBrushPresets?.getFormResult()??{},c={};return n.albedo&&(c.albedo=n.albedo.toString()),n.metalness&&(c.metalness=Number(n.metalness)),n.roughness&&(c.roughness=Number(n.roughness)),n.emissive&&(c.emissive=n.emissive.toString()),n.height&&(c.height=Number(n.height)),e[r]=[c,t??"New Preset",H(c)],localStorage.setItem(ue,JSON.stringify(e)),r},me=({metalness:t,roughness:a,emissive:e,height:r,albedo:n})=>{t!==void 0&&s.brushMetalnessSlider?.setValue(t||0,!0),a!==void 0&&s.brushRoughnessSlider?.setValue(a??1,!0),e!==void 0&&s.brushEmissiveColor?.set(e??"#000000"),r!==void 0&&s.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},z=({id:t})=>Condition({project:!0,tools:["material_brush"],method(){let a=D();return(a?.layers_enabled&&a.layers.find(({channel:e})=>e&&e===t)!==void 0)===!0}}),He=X.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:u}},methods:{applyPreset(t){try{let[a,e]=this.userPresets[t],{metalness:r,roughness:n,emissive:c,height:i,albedo:o}=a;me({metalness:Number(r),roughness:Number(n),emissive:c.toString(),height:Number(i),albedo:o.toString()}),s.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${e}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(t){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let e=q(),r=this.userPresets[t][1]??t;delete e[t],localStorage.setItem("materialBrushPresets",JSON.stringify(e)),this.userPresets=e,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(t){s.userMaterialBrushPresets?.setFormValues({name:this.userPresets[t][1]??t,...this.userPresets[t][0]})},getSummary(t){return Object.entries(t).filter(([a])=>a in this.channels).map(([a,e])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${e}`:`${this.channels[a]?.label??a}: ${Number(e).toFixed(1)}`).join(` `)}},computed:{presets(){return Object.entries(this.userPresets)}},mounted(){this.userPresets=q()},template:`
      @@ -102,4 +102,4 @@ .delete_preset:hover .material-icons { color: var(--color-accent); - }`),s.brushMetalnessSlider=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",tool_setting:"brush_metalness",settings:{min:0,max:1,step:.01,default:0},condition:()=>z(u.metalness)}),s.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",tool_setting:"brush_roughness",settings:{min:0,max:1,step:.01,default:1},condition:()=>z(u.roughness)}),s.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",tool_setting:"brush_emissive",condition:()=>z(u.emissive)}),s.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",tool_setting:"brush_height",settings:{min:0,max:1,step:.01,default:.5},condition:()=>z(u.height)}),s.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",category:"tools",toolbar:"brush",condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){return k()?.layers_enabled??!1}},allowed_view_modes:"textured",tool_settings:{brush_metalness:0,brush_roughness:1,brush_emissive:"#000000",brush_height:.5},brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(t,a,e,r,{size:n,softness:i,texture:l,x:o,y:g}){let f=O.fromSettings(),x=Object.keys(f.colors),h=Math.floor(n-i*n/100),_=e;return l.layers.forEach(m=>{if(!m.visible||!x.includes(m.channel))return;let p=f.getChannel(m.channel);if(!p)return;let c=Math.sqrt((o-t)**2+(g-a)**2),d=Math.min(1,c/h);if(o%h<=d&&g%h<=d){let v=m.ctx.getImageData(t,a,1,1).data,M=new b.Color(`rgb(${v[0]}, ${v[1]}, ${v[2]})`);p.lerp(M,1)}m.ctx.fillStyle=p.getStyle(),m.ctx.fillRect(t,a,1,1),m.selected&&(_={r:p.r*255,g:p.g*255,b:p.b*255,a:r*255})}),_}},onCanvasClick(t){Painter.startPaintToolCanvas(t,t.event)},onSelect(){Painter.updateNslideValues(),A()},click(){B()}}),s.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:{project:!0},click(){s.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:He,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(t){me({metalness:Number(t.metalness??s.brushMetalnessSlider?.get()),roughness:Number(t.roughness??s.brushRoughnessSlider?.get()),emissive:(t.emissive??s.brushEmissiveColor?.get()).toString(),height:Number(t.height??s.brushHeightSlider?.get()),albedo:(t.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(t,a){s.materialBrushTool?.select(),t===1&&Blockbench.textPrompt("Save Preset","New Preset",e=>{e&&(Ie(e),Blockbench.showQuickMessage(`Preset "${e}" saved`,2e3))})}}).show()}}),MenuBar.addAction(s.materialBrushTool,"tools.0")});L.push(()=>{MenuBar.removeAction("tools.material_brush")});C.push(()=>{s.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","load_brush_preset","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Settings"})],condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});C.push(()=>{s.displaySettingsPanel=new Panel("display_settings",{name:"PBR Controls",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure","show_channel_select_menu"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});(()=>{let t=()=>{C.forEach(e=>e())},a=()=>{F(),L.forEach(e=>e()),Object.entries(s).forEach(([e,r])=>{try{r?.delete()}catch(n){console.warn(`Failed to delete ${e} action:`,n)}})};BBPlugin.register("pbr_preview",{version:"1.1.0",title:"PBR Tools",author:"Jason J. Gardner",description:"Create and view PBR materials in Blockbench. Export textures for Java and RenderDragon shaders.",tags:["Minecraft: Java Edition","Minecraft: Bedrock Edition","PBR"],icon:"icon.png",variant:"both",await_loading:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.3",onload:t,onunload:a})})();})(); + }`),s.brushMetalnessSlider=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",tool_setting:"brush_metalness",settings:{min:0,max:1,step:.01,default:0},condition:()=>z(u.metalness)}),s.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",tool_setting:"brush_roughness",settings:{min:0,max:1,step:.01,default:1},condition:()=>z(u.roughness)}),s.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",tool_setting:"brush_emissive",condition:()=>z(u.emissive)}),s.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",tool_setting:"brush_height",settings:{min:0,max:1,step:.01,default:.5},condition:()=>z(u.height)}),s.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",category:"tools",toolbar:"brush",condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){return D()?.layers_enabled??!1}},allowed_view_modes:"textured",tool_settings:{brush_metalness:0,brush_roughness:1,brush_emissive:"#000000",brush_height:.5},brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(t,a,e,r,{size:n,softness:c,texture:i,x:o,y:p}){let f=O.fromSettings(),x=Object.keys(f.colors),h=Math.floor(n-c*n/100),_=e;return i.layers.forEach(m=>{if(!m.visible||!x.includes(m.channel))return;let g=f.getChannel(m.channel);if(!g)return;let l=Math.sqrt((o-t)**2+(p-a)**2),d=Math.min(1,l/h);if(o%h<=d&&p%h<=d){let v=m.ctx.getImageData(t,a,1,1).data,M=new b.Color(`rgb(${v[0]}, ${v[1]}, ${v[2]})`);g.lerp(M,1)}m.ctx.fillStyle=g.getStyle(),m.ctx.fillRect(t,a,1,1),m.selected&&(_={r:g.r*255,g:g.g*255,b:g.b*255,a:r*255})}),_}},onCanvasClick(t){Painter.startPaintToolCanvas(t,t.event)},onSelect(){Painter.updateNslideValues(),A()},click(){B()}}),s.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:{project:!0},click(){s.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:He,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(t){me({metalness:Number(t.metalness??s.brushMetalnessSlider?.get()),roughness:Number(t.roughness??s.brushRoughnessSlider?.get()),emissive:(t.emissive??s.brushEmissiveColor?.get()).toString(),height:Number(t.height??s.brushHeightSlider?.get()),albedo:(t.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(t,a){s.materialBrushTool?.select(),t===1&&Blockbench.textPrompt("Save Preset","New Preset",e=>{e&&(Ie(e),Blockbench.showQuickMessage(`Preset "${e}" saved`,2e3))})}}).show()}}),MenuBar.addAction(s.materialBrushTool,"tools.0")});L.push(()=>{MenuBar.removeAction("tools.material_brush")});C.push(()=>{s.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","load_brush_preset","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Settings"})],condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});C.push(()=>{s.displaySettingsPanel=new Panel("display_settings",{name:"PBR Controls",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure","show_channel_select_menu"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});(()=>{let t=()=>{C.forEach(e=>e())},a=()=>{F(),L.forEach(e=>e()),Object.entries(s).forEach(([e,r])=>{try{r?.delete()}catch(n){console.warn(`Failed to delete ${e} action:`,n)}})};BBPlugin.register("pbr_preview",{version:"1.1.0",title:"PBR Tools",author:"Jason J. Gardner",description:"Create and view PBR materials in Blockbench. Export textures for Java and RenderDragon shaders.",tags:["Minecraft: Java Edition","Minecraft: Bedrock Edition","PBR"],icon:"icon.png",variant:"both",await_loading:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.3",onload:t,onunload:a})})();})(); diff --git a/src/pbr_preview/src/constants.ts b/src/pbr_preview/src/constants.ts index a236cdac..736d4b5c 100644 --- a/src/pbr_preview/src/constants.ts +++ b/src/pbr_preview/src/constants.ts @@ -28,7 +28,7 @@ export const CHANNELS: Record = { map: "emissiveMap", icon: "wb_twilight", default: new THREE.Color(0), - regex: new RegExp("[ _]*emissive", "i"), + regex: new RegExp("[ _]*(emissive|emission)", "i"), }, roughness: { id: "roughness", diff --git a/src/pbr_preview/src/lib/PbrMaterials.ts b/src/pbr_preview/src/lib/PbrMaterials.ts index fe7310bb..1ea26233 100644 --- a/src/pbr_preview/src/lib/PbrMaterials.ts +++ b/src/pbr_preview/src/lib/PbrMaterials.ts @@ -146,16 +146,17 @@ export default class PbrMaterial { return materialChannel; } - const channel = typeof name === "string" ? name : name.id; + const [channel, regex] = + typeof name === "string" + ? [name, new RegExp(`_*${name}(\.[^.]+)?$`, "i")] + : [name.id, name.regex ?? new RegExp(`_*${name.id}(\.[^.]+)?$`, "i")]; Project.pbr_materials = Project.pbr_materials ?? {}; const materialData = Project.pbr_materials[this._materialUuid]; // Don't infer the channel if it has already been assigned to NA_CHANNEL if (inference && !materialData && channel !== NA_CHANNEL) { - const filenameRegex = - CHANNELS[channel].regex ?? new RegExp(`_*${channel}(\.[^.]+)?$`, "i"); - return this._scope.find((t) => filenameRegex.test(t.name)) ?? null; + return this._scope.find((t) => regex?.test(t.name)) ?? null; } const textureUuid = materialData?.[channel]; diff --git a/src/pbr_preview/src/lib/actions/mer.ts b/src/pbr_preview/src/lib/actions/mer.ts index f589fd0e..af1984af 100644 --- a/src/pbr_preview/src/lib/actions/mer.ts +++ b/src/pbr_preview/src/lib/actions/mer.ts @@ -85,10 +85,7 @@ setups.push(() => { "Decodes a MER texture map into metalness, emissive, and roughness channels into material layers", condition: () => getSelectedTexture()?.layers_enabled === true, click() { - const selected = - TextureLayer.selected?.texture ?? - Texture.all.find((t) => t.selected) ?? - Texture.getDefault(); + const selected = getSelectedTexture() ?? Texture.getDefault(); const mat = new PbrMaterial( selected.layers_enabled ? selected.layers : [selected], @@ -104,8 +101,6 @@ setups.push(() => { Undo.initEdit({ textures: [selected] }); - const copy = selected.selected.activateLayers(true); - merChannels.forEach((channel) => { const key = channel.id as keyof typeof mer; const canvas = mer[key]; From 3cfb1e91d2b179faefb664c7681cc91505ca3d88 Mon Sep 17 00:00:00 2001 From: Jason Gardner Date: Mon, 17 Jun 2024 18:46:26 -0500 Subject: [PATCH 23/50] Squashed commit of the following: commit 6e44a32d5056912d7158fbe9395f98c4363eddc2 Author: Jason Gardner Date: Mon Jun 17 18:40:01 2024 -0500 fix: USD output right-side-up commit 442471b707236a655ec3b629403e6f169a945585 Merge: 2c5ba42 06106c8 Author: Jason Gardner Date: Mon Jun 17 14:30:57 2024 -0500 Merge branch 'master' into feat/usdz commit 2c5ba42a9e29aa8b2a100857adea6c14c0d57922 Author: Jason Gardner Date: Sat Jun 15 09:40:42 2024 -0500 feat: USDZ codec commit 19d657bb25d6b542ded7024327ba68513ac239d9 Author: Jason Gardner Date: Sat Jun 15 07:21:49 2024 -0500 feat: Material texture thumbnail preview - Texture thumbnail source using PBR material preview render commit 65a18244d510c14089727c9176d08ad91fab6c59 Author: Jason Gardner Date: Fri Jun 14 14:52:52 2024 -0500 upd: Channel assignment menu conditions commit ebf7b9ed3c22b9e25a231d3dd5786dc75012b70d Author: Jason Gardner Date: Fri Jun 14 14:51:13 2024 -0500 upd: Material brush tool settings - Added tool_settings property - Updated display conditions of inputs commit 17cce80d68c4c72ae4ca5074564cdd08cd93ff14 Author: Jason Gardner Date: Fri Jun 14 14:46:13 2024 -0500 upd: Use left-hand normals commit 02a587464626eeefc1bb5f2e70c49dd20a8c830f Author: Jason Gardner Date: Thu Jun 13 11:02:09 2024 -0500 upd: Add cleanup to util functions commit 5a175dc53276fc81886a1719894978dc0f0072b7 Author: Jason Gardner Date: Thu Jun 13 10:19:33 2024 -0500 upd: Activate material brush with presets - Select material brush tool after using the presets dialog commit 02d81f38b32ab4e84270c53aa617663bfccc9d6d Author: Jason Gardner Date: Thu Jun 13 10:03:50 2024 -0500 upd: Dispose old materials commit 3a9bce08662df559519dc97be3d4eb31c695abf7 Author: Jason Gardner Date: Thu Jun 13 09:59:09 2024 -0500 upd: Add material texture property commit cea64f5aa51da5f6846b6ceb2117a39912b31b17 Author: Jason Gardner Date: Thu Jun 13 09:58:09 2024 -0500 upd: Dispose material preview renderer - Moved material preview image generator to utils --- src/pbr_preview/src/deps.ts | 5 +- src/pbr_preview/src/lib/actions/index.ts | 3 +- .../src/lib/actions/materialTexture.ts | 16 + src/pbr_preview/src/lib/actions/usdz.ts | 71 +++ src/pbr_preview/src/lib/io/UsdzExporter.ts | 477 ++++++++++++++++++ src/pbr_preview/src/types.d.ts | 2 + 6 files changed, 572 insertions(+), 2 deletions(-) create mode 100644 src/pbr_preview/src/lib/actions/usdz.ts create mode 100644 src/pbr_preview/src/lib/io/UsdzExporter.ts diff --git a/src/pbr_preview/src/deps.ts b/src/pbr_preview/src/deps.ts index 3b00327a..854430ee 100644 --- a/src/pbr_preview/src/deps.ts +++ b/src/pbr_preview/src/deps.ts @@ -4,4 +4,7 @@ const three = THREE; const vue = Vue; // const bb = Blockbench; -export { three, vue }; +// @ts-expect-error JSZip is on window +const jszip = window.JSZip; + +export { three, vue, jszip }; diff --git a/src/pbr_preview/src/lib/actions/index.ts b/src/pbr_preview/src/lib/actions/index.ts index fd73c264..bad3e774 100644 --- a/src/pbr_preview/src/lib/actions/index.ts +++ b/src/pbr_preview/src/lib/actions/index.ts @@ -1,10 +1,11 @@ import "./bakeTextures"; import "./channelAssignment"; import "./generateNormal"; +import "./labPbr"; import "./materialTexture"; import "./mer"; import "./textureSet"; import "./toggleLights"; import "./togglePbr"; import "./tonemapping"; -import "./labPbr"; +import "./usdz"; diff --git a/src/pbr_preview/src/lib/actions/materialTexture.ts b/src/pbr_preview/src/lib/actions/materialTexture.ts index 35ebe921..7fbbfa20 100644 --- a/src/pbr_preview/src/lib/actions/materialTexture.ts +++ b/src/pbr_preview/src/lib/actions/materialTexture.ts @@ -127,9 +127,25 @@ setups.push(() => { texture.updateChangesAfterEdit(); Undo.finishEdit("Create Material Texture"); + + if (mat) { + texture.updateSource(generatePreviewImage(mat.getMaterial())); + } }, }); + Blockbench.on("save_project", function generateMaterialThumbnail() { + Texture.all.map((texture) => { + if (!texture.material) { + return; + } + + const mat = new PbrMaterial(texture.layers, texture.uuid); + + texture.updateSource(generatePreviewImage(mat.getMaterial())); + }); + }); + MenuBar.addAction(registry.createMaterialTexture, "tools"); Toolbars.texturelist.add(registry.createMaterialTexture, 3); }); diff --git a/src/pbr_preview/src/lib/actions/usdz.ts b/src/pbr_preview/src/lib/actions/usdz.ts new file mode 100644 index 00000000..250fed95 --- /dev/null +++ b/src/pbr_preview/src/lib/actions/usdz.ts @@ -0,0 +1,71 @@ +import { registry, setups, teardowns } from "../../constants"; +import { three as THREE } from "../../deps"; +import { getOutputBaseName } from "../util"; +import USDZExporter from "../io/UsdzExporter"; + +setups.push(() => { + const usdz = new Codec("usdz", { + extension: "usdz", + name: "USDZ", + remember: true, + export_options: {}, + fileName() { + return getOutputBaseName() + ".usdz"; + }, + async compile(compileOptions = {}) { + if (!Project) { + throw new Error("No project loaded"); + } + + const options = Object.assign(this.getExportOptions(), compileOptions); + + const exporter = new USDZExporter(); + const scene = new THREE.Scene(); + scene.name = "blockbench_export"; + scene.add(Project.model_3d); + const result = await exporter.parse(scene); + + this.dispatchEvent("compile", { model: result, options }); + + Canvas.scene.add(Project.model_3d); + + return result; + }, + async export() { + const content = await this.compile(); + Blockbench.export( + { + content, + name: this.fileName(), + startpath: this.startPath(), + resource_id: "usdz", + type: this.name, + extensions: ["usdz"], + savetype: "buffer", + }, + (path) => this.afterDownload(path) + ); + }, + }); + + registry.exportUsdz = new Action("export_usdz", { + category: "file", + name: "Export USDZ", + description: "Exports the current model as a USDZ file", + icon: "file_download", + async click() { + if (!usdz) { + return; + } + await usdz.export(); + }, + }); + + registry.usdz = usdz; + + MenuBar.addAction(registry.exportUsdz, "file.export"); +}); + +teardowns.push(() => { + MenuBar.removeAction("file.export_usdz"); +}); diff --git a/src/pbr_preview/src/lib/io/UsdzExporter.ts b/src/pbr_preview/src/lib/io/UsdzExporter.ts new file mode 100644 index 00000000..e55a7c12 --- /dev/null +++ b/src/pbr_preview/src/lib/io/UsdzExporter.ts @@ -0,0 +1,477 @@ +import { three as THREE, jszip as JSZip } from "../../deps"; + +/** + * USDZ Exporter + * Based on DragonFly's USDZExporter + * @see https://github.com/GitHubDragonFly/GitHubDragonFly.github.io/blob/5dcb6d313aa73373d54997e616d5ade8168c408d/viewers/static/js/exporters/USDZExporter.js + */ +class USDZExporter { + async parse(scene: THREE.Scene): Promise { + const zip = new JSZip(); + const modelFileName = "model.usda"; // model file should be first in USDZ archive so we init it here + + zip.file(modelFileName, ""); + let output: string | null = buildHeader(); + const materials: Record = {}; + const textures: Record = {}; + scene.traverseVisible((object) => { + if (!(object as THREE.Mesh).isMesh) { + return; + } + const mesh = object as THREE.Mesh; + if ( + !(mesh.material as THREE.MeshStandardMaterial).isMeshStandardMaterial + ) { + console.warn( + "THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)", + object + ); + return; + } + const geometry = mesh.geometry; + const material = mesh.material as THREE.MeshStandardMaterial; + const geometryFileName = "geometries/Geometry_" + geometry.id + ".usd"; + + if (!zip.file(geometryFileName)) { + const meshObject = buildMeshObject(geometry); + zip.file(geometryFileName, buildUSDFileAsString(meshObject)); + } + + if (!(material.uuid in materials)) { + materials[material.uuid] = material; + } + + output += buildXform(mesh, geometry, material); + }); + output += buildMaterials(materials, textures); + zip.file(modelFileName, output); + output = null; + + for (const id in textures) { + const texture = textures[id]; + const color = id.split("_")[1]; + const isRGBA = texture.format === THREE.RGBAFormat; + const canvas = imageToCanvas(texture.image, color); + const blob = await new Promise((resolve) => + canvas.toBlob( + (v) => v && resolve(v), + isRGBA ? "image/png" : "image/jpeg", + 1 + ) + ); + const arrayBuffer = await blob.arrayBuffer(); + zip.file(`textures/Texture_${id}.${isRGBA ? "png" : "jpg"}`, arrayBuffer); + } + + // 64 byte alignment + let offset = 0; + + zip.forEach(async (relativePath: string) => { + const headerSize = 34 + relativePath.length; + offset += headerSize; + const offsetMod64 = offset & 63; + const content = await zip.file(relativePath)!.async("uint8array"); + + if (offsetMod64 !== 4) { + const padLength = 64 - offsetMod64; + const padding = new Uint8Array(padLength); + const newContent = new Uint8Array(content.length + padLength); + newContent.set(content, 0); + newContent.set(padding, content.length); + zip.file(relativePath, newContent); + } + + offset += content.length; + }); + + const zipBlob = await zip.generateAsync({ + type: "blob", + compression: "STORE", + }); + return new Uint8Array(await zipBlob.arrayBuffer()); + } +} + +function imageToCanvas( + image: HTMLImageElement | HTMLCanvasElement | OffscreenCanvas | ImageBitmap, + color?: string +): HTMLCanvasElement { + if ( + (typeof HTMLImageElement !== "undefined" && + image instanceof HTMLImageElement) || + (typeof HTMLCanvasElement !== "undefined" && + image instanceof HTMLCanvasElement) || + (typeof OffscreenCanvas !== "undefined" && + image instanceof OffscreenCanvas) || + (typeof ImageBitmap !== "undefined" && image instanceof ImageBitmap) + ) { + const scale = 1024 / Math.max(image.width, image.height); + const canvas = document.createElement("canvas"); + canvas.width = image.width * Math.min(1, scale); + canvas.height = image.height * Math.min(1, scale); + const context = canvas.getContext("2d")!; + + // Use nearest neighbor for scaling + context.imageSmoothingEnabled = false; + + context.drawImage(image, 0, 0, canvas.width, canvas.height); + + if (color !== undefined) { + const hex = parseInt(color, 16); + const r = ((hex >> 16) & 255) / 255; + const g = ((hex >> 8) & 255) / 255; + const b = (hex & 255) / 255; + const imagedata = context.getImageData(0, 0, canvas.width, canvas.height); + const data = imagedata.data; + + for (let i = 0; i < data.length; i += 4) { + data[i + 0] = data[i + 0] * r; + data[i + 1] = data[i + 1] * g; + data[i + 2] = data[i + 2] * b; + } + + context.putImageData(imagedata, 0, 0); + } + + return canvas; + } + + throw new Error("Unsupported image type"); +} + +const PRECISION = 7; + +function buildHeader(): string { + return `#usda 1.0 +( + customLayerData = { + string creator = "Blockbench USDZExporter" + } + metersPerUnit = 1 + upAxis = "Y" +) + +`; +} + +function buildUSDFileAsString(dataToInsert: string): string { + let output = buildHeader(); + output += dataToInsert; + return output; +} + +function buildXform( + object: THREE.Object3D, + geometry: THREE.BufferGeometry, + material: THREE.Material +): string { + const name = "Object_" + object.id; + const transform = buildMatrix(object.matrixWorld); + + if (object.matrixWorld.determinant() < 0) { + console.warn( + "THREE.USDZExporter: USDZ does not support negative scales", + object + ); + } + + return `def Xform "${name}" ( + prepend references = @./geometries/Geometry_${geometry.id}.usd@ +) +{ + matrix4d xformOp:transform = ${transform} + uniform token[] xformOpOrder = ["xformOp:transform"] + + rel material:binding = +} + +`; +} + +function buildMatrix(matrix: THREE.Matrix4): string { + const array = matrix.elements; + return `( ${buildMatrixRow(array, 0)}, ${buildMatrixRow(array, 4)}, ${buildMatrixRow(array, 8)}, ${buildMatrixRow(array, 12)} )`; +} + +function buildMatrixRow(array: number[], offset: number): string { + return `(${array[offset + 0]}, ${array[offset + 1]}, ${array[offset + 2]}, ${array[offset + 3]})`; +} + +function buildMeshObject(geometry: THREE.BufferGeometry): string { + const mesh = buildMesh(geometry); + return ` +def "Geometry" +{ + ${mesh} +} +`; +} + +function buildMesh(geometry: THREE.BufferGeometry): string { + const name = "Geometry"; + const attributes = geometry.attributes; + const count = attributes.position.count; + return ` + def Mesh "${name}" + { + int[] faceVertexCounts = [${buildMeshVertexCount(geometry)}] + int[] faceVertexIndices = [${buildMeshVertexIndices(geometry)}] + normal3f[] normals = [${buildVector3Array(attributes.normal as THREE.BufferAttribute, count)}] ( + interpolation = "vertex" + ) + point3f[] points = [${buildVector3Array(attributes.position as THREE.BufferAttribute, count)}] + float2[] primvars:st = [${buildVector2Array(attributes.uv as THREE.BufferAttribute, count)}] ( + interpolation = "vertex" + ) + uniform token subdivisionScheme = "none" + } +`; +} + +function buildMeshVertexCount(geometry: THREE.BufferGeometry): string { + const count = + geometry.index !== null + ? geometry.index.count + : geometry.attributes.position.count; + return Array(count / 3) + .fill(3) + .join(", "); +} + +function buildMeshVertexIndices(geometry: THREE.BufferGeometry): string { + const index = geometry.index; + const array: number[] = []; + + if (index !== null) { + for (let i = 0; i < index.count; i++) { + array.push(index.getX(i)); + } + } else { + const length = geometry.attributes.position.count; + + for (let i = 0; i < length; i++) { + array.push(i); + } + } + + return array.join(", "); +} + +function buildVector3Array( + attribute: THREE.BufferAttribute, + count: number +): string { + if (attribute === undefined) { + console.warn("USDZExporter: Normals missing."); + return Array(count).fill("(0, 0, 0)").join(", "); + } + + const array: string[] = []; + + for (let i = 0; i < attribute.count; i++) { + const x = attribute.getX(i); + const y = attribute.getY(i); + const z = attribute.getZ(i); + array.push( + `(${x.toPrecision(PRECISION)}, ${y.toPrecision(PRECISION)}, ${z.toPrecision(PRECISION)})` + ); + } + + return array.join(", "); +} + +function buildVector2Array( + attribute: THREE.BufferAttribute, + count: number +): string { + if (attribute === undefined) { + console.warn("USDZExporter: UVs missing."); + return Array(count).fill("(0, 0)").join(", "); + } + + const array: string[] = []; + + for (let i = 0; i < attribute.count; i++) { + const x = attribute.getX(i); + const y = attribute.getY(i); + array.push( + `(${x.toPrecision(PRECISION)}, ${Number(y.toPrecision(PRECISION))})` + ); + } + return array.join(", "); +} + +function buildMaterials( + materials: { [key: string]: THREE.Material }, + textures: { [key: string]: THREE.Texture } +): string { + const array: string[] = []; + + for (const uuid in materials) { + const material = materials[uuid]; + array.push(buildMaterial(material, textures)); + } + + return `def "Materials" +{ +${array.join("")} +} + +`; +} + +function buildMaterial( + material: THREE.Material, + textures: { [key: string]: THREE.Texture } +): string { + // https://graphics.pixar.com/usd/docs/UsdPreviewSurface-Proposal.html + const pad = " "; + const inputs: string[] = []; + const samplers: string[] = []; + + function buildTexture( + texture: THREE.Texture, + mapType: string, + color?: THREE.Color + ): string { + const id = texture.id + (color ? "_" + color.getHexString() : ""); + const isRGBA = texture.format === THREE.RGBAFormat; + textures[id] = texture; + return ` + def Shader "Transform2d_${mapType}" ( + sdrMetadata = { + string role = "math" + } + ) + { + uniform token info:id = "UsdTransform2d" + float2 inputs:in.connect = + float2 inputs:scale = ${buildVector2(texture.repeat)} + float2 inputs:translation = ${buildVector2(texture.offset)} + float2 outputs:result + } + + def Shader "Texture_${texture.id}_${mapType}" + { + uniform token info:id = "UsdUVTexture" + asset inputs:file = @textures/Texture_${id}.${isRGBA ? "png" : "jpg"}@ + float2 inputs:st.connect = + token inputs:wrapS = "repeat" + token inputs:wrapT = "repeat" + float outputs:r + float outputs:g + float outputs:b + float3 outputs:rgb + }`; + } + + const mat = material as THREE.MeshStandardMaterial; + + if (mat.map !== null) { + inputs.push( + `${pad}color3f inputs:diffuseColor.connect = ` + ); + samplers.push(buildTexture(mat.map, "diffuse", mat.color)); + } else { + inputs.push(`${pad}color3f inputs:diffuseColor = ${buildColor(mat.color)}`); + } + + if (mat.emissiveMap !== null) { + inputs.push( + `${pad}color3f inputs:emissiveColor.connect = ` + ); + samplers.push(buildTexture(mat.emissiveMap, "emissive")); + } else if (mat.emissive.getHex() > 0) { + inputs.push( + `${pad}color3f inputs:emissiveColor = ${buildColor(mat.emissive)}` + ); + } + + if (mat.normalMap !== null) { + inputs.push( + `${pad}normal3f inputs:normal.connect = ` + ); + samplers.push(buildTexture(mat.normalMap, "normal")); + } + + if (mat.aoMap !== null) { + inputs.push( + `${pad}float inputs:occlusion.connect = ` + ); + samplers.push(buildTexture(mat.aoMap, "occlusion")); + } + + if (mat.roughnessMap !== null && mat.roughness === 1) { + inputs.push( + `${pad}float inputs:roughness.connect = ` + ); + samplers.push(buildTexture(mat.roughnessMap, "roughness")); + } else { + inputs.push(`${pad}float inputs:roughness = ${mat.roughness}`); + } + + if (mat.metalnessMap !== null && mat.metalness === 1) { + inputs.push( + `${pad}float inputs:metallic.connect = ` + ); + samplers.push(buildTexture(mat.metalnessMap, "metallic")); + } else { + inputs.push(`${pad}float inputs:metallic = ${mat.metalness}`); + } + + if (mat.alphaMap !== null) { + inputs.push( + `${pad}float inputs:opacity.connect = ` + ); + inputs.push(`${pad}float inputs:opacityThreshold = 0.0001`); + samplers.push(buildTexture(mat.alphaMap, "opacity")); + } else { + inputs.push(`${pad}float inputs:opacity = ${mat.opacity}`); + } + + if ((mat as any).isMeshPhysicalMaterial) { + const physicalMat = mat as any; + inputs.push(`${pad}float inputs:clearcoat = ${physicalMat.clearcoat}`); + inputs.push( + `${pad}float inputs:clearcoatRoughness = ${physicalMat.clearcoatRoughness}` + ); + inputs.push(`${pad}float inputs:ior = ${physicalMat.ior}`); + } + + return ` + def Material "Material_${mat.id}" + { + def Shader "PreviewSurface" + { + uniform token info:id = "UsdPreviewSurface" +${inputs.join("\n")} + int inputs:useSpecularWorkflow = 0 + token outputs:surface + } + + token outputs:surface.connect = + token inputs:frame:stPrimvarName = "st" + + def Shader "uvReader_st" + { + uniform token info:id = "UsdPrimvarReader_float2" + token inputs:varname.connect = + float2 inputs:fallback = (0.0, 0.0) + float2 outputs:result + } + +${samplers.join("\n")} + + } +`; +} + +function buildColor(color: THREE.Color): string { + return `(${color.r}, ${color.g}, ${color.b})`; +} + +function buildVector2(vector: THREE.Vector2): string { + return `(${vector.x}, ${vector.y})`; +} + +export default USDZExporter; diff --git a/src/pbr_preview/src/types.d.ts b/src/pbr_preview/src/types.d.ts index 9bdc29fe..849f4d9c 100644 --- a/src/pbr_preview/src/types.d.ts +++ b/src/pbr_preview/src/types.d.ts @@ -65,5 +65,7 @@ export interface IRegistry { tonemappingSelect: BarSelect; unassignChannel: Action; userMaterialBrushPresets: Dialog; + exportUsdz: Action; + usdz: Codec; [key: string]: Deletable; } From a9e5d66ebef79f18c7b4cea61517d01ab19e02c9 Mon Sep 17 00:00:00 2001 From: Jason Gardner Date: Mon, 17 Jun 2024 18:51:20 -0500 Subject: [PATCH 24/50] revert: Remove material preview --- plugins/pbr_preview/pbr_preview.js | 103 +++++++++++++++++- .../src/lib/actions/materialTexture.ts | 18 +-- src/pbr_preview/src/lib/io/UsdzExporter.ts | 5 - 3 files changed, 100 insertions(+), 26 deletions(-) diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index 0467c01e..dcb47e71 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1,5 +1,100 @@ -"use strict";(()=>{var b=THREE,X=Vue;var N="_NONE_",u={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new b.Color(16777215),regex:new RegExp("(s|_)*(basecolor|color|albedo)","i")},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new b.Color(0),regex:new RegExp("[ _]*metal(lic|ness)?","i")},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new b.Color(0),regex:new RegExp("[ _]*(emissive|emission)","i")},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new b.Color(16777215),regex:new RegExp("[ _]*rough(ness)?","i")},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new b.Color(16777215),regex:new RegExp("[ _]*(height|bump)","i")},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new b.Color("rgb(128, 128, 255)"),regex:new RegExp("[ _]*normal","i")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new b.Color(16777215),regex:new RegExp("[ _]*(ao|ambientocclusion|ambient occlusion)","i")}},s={},C=[],L=[];var Y=[...Object.keys(u).map(t=>u[t].id),N];C.push(()=>{s.channelProp=new Property(TextureLayer,"enum","channel",{default:N,values:Y,label:"PBR Channel",exposed:!1}),s.textureChannelProp=new Property(Texture,"enum","channel",{default:N,values:Y,label:"PBR Channel",exposed:!1}),s.materialTextureProp=new Property(Texture,"boolean","material",{default:!1,label:"Material Texture"}),s.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),s.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),s.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!1,values:[],label:"PBR Mode"})});function D(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(t=>t.selected)??null:Texture.all.find(t=>t.selected)??Texture.getDefault()}function R(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(t=>t.selected)??Project.selected_texture.layers[0]:D()?.getActiveLayer()??null}function ee(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(D()?.name??"texture")}function te(t,a){let e;return function(...r){let n=()=>{e=void 0,t.apply(this,r)};clearTimeout(e),e=setTimeout(n,a)}}function H(t){let a=MediaPreview.renderer??new b.WebGLRenderer({alpha:!0,antialias:!0}),e=new b.Scene,r=new b.PerspectiveCamera(75,96/96,.1,1e3),n=new b.AmbientLight(16777215,.75);e.add(n);let c=new b.PointLight(16777215,1,100);c.position.set(5,5,5),e.add(c);let i=new b.SphereGeometry(1,32,32),o=t instanceof b.MeshStandardMaterial&&t.isMeshStandardMaterial?t:new b.MeshStandardMaterial({color:t.albedo,metalness:t.metalness??0,roughness:t.roughness??1,emissive:t.emissive,bumpScale:t.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),p=new b.Mesh(i,o);e.add(p),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(e,r);let f=a.domElement.toDataURL();return o.dispose(),MediaPreview.renderer||(a.clear(),a.dispose()),f}function Q(t,a){let e=a??document.createElement("canvas"),r=e.getContext("2d");if(!r)return e.remove(),null;let n=Math.max(Project?Project.texture_width:16,16),c=Math.max(Project?Project.texture_height:16,16);e.width=n,e.height=c,r.fillStyle=`rgb(${t.r*255}, ${t.g*255}, ${t.b*255})`,r.fillRect(0,0,n,c);let i=e.toDataURL();return a||e.remove(),i}var De=(t=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return t?a.filter(e=>e.layers_enabled&&e.layers.length>0).flatMap(e=>e.layers):a},k=class t{constructor(a,e){this._scope=a??De(),this._materialUuid=e}merToCanvas(){let a=this.getTexture(u.emissive),e=this.getTexture(u.roughness),r=this.getTexture(u.metalness);if(!a&&!e&&!r){let{metalness:n,emissive:c,roughness:i}=this.decodeMer();n&&(r=t.makePixelatedCanvas(n)),c&&(a=t.makePixelatedCanvas(c)),i&&(e=t.makePixelatedCanvas(i))}return{emissiveMap:a,roughnessMap:e,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:e,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(u.emissive),roughnessMap:this.getTexture(u.roughness),metalnessMap:this.getTexture(u.metalness)},c=this.getTexture(u.normal);return new b.MeshStandardMaterial({map:this.getTexture(u.albedo)??t.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(i=>i.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(u.ao),bumpMap:this.getTexture(u.height),normalMap:c,normalScale:new b.Vector2(-1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:e,emissiveIntensity:e?1:0,emissive:e?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}renderMaterialPreview(){return H(this.getMaterial())}saveTexture(a,e){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=e.uuid,e.extend({channel:a.id}))}findTexture(a,e=!0){if(!Project)return null;let r=this._scope.find(p=>p.channel&&(p.channel===a||p.channel===a.id));if(r)return r;let[n,c]=typeof a=="string"?[a,new RegExp(`_*${a}(.[^.]+)?$`,"i")]:[a.id,a.regex??new RegExp(`_*${a.id}(.[^.]+)?$`,"i")];Project.pbr_materials=Project.pbr_materials??{};let i=Project.pbr_materials[this._materialUuid];if(e&&!i&&n!==N)return this._scope.find(p=>c?.test(p.name))??null;let o=i?.[n];return o?this._scope.find(p=>p.uuid===o)??null:null}static makePixelatedCanvas(a){let e=new b.CanvasTexture(a,void 0,void 0,void 0,b.NearestFilter,b.NearestFilter);return e.needsUpdate=!0,e}getTexture(a){let e=this.findTexture(a);return e?t.makePixelatedCanvas(e.canvas):null}static extractChannel(a,e){let r=a.canvas,{width:n,height:c}=r,i=r.getContext("2d");if(!i||!n||!c)return null;let o=document.createElement("canvas");o.width=n,o.height=c;let p=o.getContext("2d");if(!p)return null;let f={r:0,g:1,b:2,a:3}[e],{data:x}=i.getImageData(0,0,n,c),h=new Uint8ClampedArray(n*c*4);for(let m=0;ma){g[l]=_.data[l],g[l+1]=_.data[l+1],g[l+2]=_.data[l+2],g[l+3]=255;continue}g[l]=0,g[l+1]=0,g[l+2]=0,g[l+3]=255}return f.putImageData(new ImageData(g,o.width,o.height),0,0),{metalness:r,emissive:o,emissiveLevel:n,roughness:c,sss:i}}createMer(a=!1){let e=this.findTexture(u.metalness,a),r=this.findTexture(u.emissive,a),n=this.findTexture(u.roughness,a),c=this.findTexture("sss",!1),i=Math.max(e?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),o=Math.max(e?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),p=document.createElement("canvas");p.width=i,p.height=o;let f=p.getContext("2d");if(!f)return null;let x=e?.img?t.extractChannel(e,"r"):null,h=r?.img?t.extractChannel(r,"g"):null,_=n?.img?t.extractChannel(n,"b"):null,m=c&&c?.img?t.extractChannel(c,"a"):null,g=x?.getContext("2d")?.getImageData(0,0,i,o)??new ImageData(i,o),l=h?.getContext("2d")?.getImageData(0,0,i,o)??new ImageData(i,o),d=_?.getContext("2d")?.getImageData(0,0,i,o)??new ImageData(i,o),v=m?.getContext("2d")?.getImageData(0,0,i,o)??new ImageData(new Uint8ClampedArray(i*o*4).fill(255),i,o),M=new Uint8ClampedArray(i*o*4);for(let w=0;w{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),e}createTexturesFromNormal(a){let e=this.decodeLabPbrNormal(a);return Object.entries(e).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),e}};var U=class{constructor({lightHeight:a=.66,ambientLight:e=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:n=[1,1,1]}={}){this.lightHeight=a,this.ambientLight=e,this.minLightIntensity=r,this.lightDiffuse=n}bake(a,e,r){let n=e instanceof HTMLCanvasElement?e:this.createCanvas(e.width,e.height),c=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),i=n.getContext("2d"),o=c.getContext("2d");i.drawImage(e,0,0),o.drawImage(r,0,0);let p=i.getImageData(0,0,e.width,e.height),f=o.getImageData(0,0,r.width,r.height),x=[],h=[];for(let m=0;m{let g=this.createCanvas(e.width,e.height),l=g.getContext("2d"),d=l.getImageData(0,0,g.width,g.height),v=[Math.cos(m),Math.sin(m),this.lightHeight];for(let M=0;M{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new k(r.layers_enabled?r.layers:Project.textures,r.uuid),c=n.findTexture(u.albedo);if(!c){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let i=n.findTexture(u.normal);if(!i){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let p=new U(t).bake(a,c.canvas,i.canvas),f=new Texture({name:`${c.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(p[0].toDataURL()),x=e?h=>{let _=n.findTexture(u.emissive);if(!_)return h;let m=_.canvas;if(!m.getContext("2d"))return h;let l=Math.max(h.width,m.width,Project?Project.texture_width:16),d=Math.max(h.height,m.height,Project?Project.texture_height:16),v=document.createElement("canvas");v.width=l,v.height=d;let M=v.getContext("2d");return M?(M.drawImage(h,0,0),M.globalCompositeOperation="screen",M.drawImage(m,0,0),v):h}:h=>h;p.forEach((h,_)=>{new TextureLayer({name:`baked_${_+1}`,data_url:x(h).toDataURL()},f).addForEditing()}),f.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};C.push(()=>{s.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(t){let a=new b.Color(t.ambientLight.toString()),e=new b.Color(t.lightDiffuse.toString());ae({ambientLight:[a.r,a.g,a.b],lightDiffuse:[e.r,e.g,e.b],lightHeight:Number(t.lightHeight),minLightIntensity:Number(t.minLightIntensity)},t.directions??8,t.blendEmissive??!1)}}),s.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){s.bakeTexturesDialog?.show()}}),MenuBar.addAction(s.bakeTexturesAction,"tools")});L.push(()=>{MenuBar.removeAction("tools.bake_textures")});function re(t,a){let e=t.getTexture();if(!e||!Project)return null;let r=Project.materials[e.uuid];r.isShaderMaterial&&!Project.bb_materials[e.uuid]?Project.bb_materials[e.uuid]=r:r.isMeshStandardMaterial&&r.dispose();let n=new k(e.layers_enabled?e.layers.filter(c=>c.visible)??null:Project.textures,e.uuid).getMaterial({side:Canvas.getRenderSide(e),...a});return Project.materials[e.uuid]=b.ShaderMaterial.prototype.copy.call(n,r),e}function ne(t){return Object.values(t).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function ke(t,a){let e={};return t.forAllFaces(r=>{let n=re(r,a);n&&(e[n.uuid]=n)}),ne(e)}function Se(t,a){let e={};return Object.keys(t.faces).forEach(r=>{let n=t.faces[r],c=re(n,a);c&&(e[c.uuid]=c)}),ne(e)}var A=(t={})=>{Project&&(Project.pbr_active=Texture.all.length>0&&Project.elements.map(a=>a instanceof Mesh&&ke(a,t)||a instanceof Cube&&Se(a,t)).filter(Boolean).length>0)},B=(t=100)=>te(A,t);var V={},G={};C.push(()=>{Object.entries(u).forEach(([t,a])=>{V[t]=new Action(`assign_channel_${t}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:{selected:{texture:!0},project:!0,method(){return D()?.material===!0&&R()!==null}},click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e)return;Undo.initEdit({layers:[e]}),e.extend({channel:a.id});let r=e instanceof TextureLayer?e.texture:e;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([n,c])=>{c===e.uuid&&(delete Project.pbr_materials[r.uuid][n],e.channel=N)}),r.uuid===e.uuid&&(Project.pbr_materials[r.uuid]={}),Project.pbr_materials[r.uuid][t]=e.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${e.name}" to ${a.label} channel`,2e3),A()}}),G[t]=new Action(`select_channel_${t}`,{icon:a.icon??"tv_options_edit_channels",name:a.label??t,description:`Select the ${a.label} channel`,condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){let e=D();return(e?.layers_enabled?e.layers:Texture.all).some(n=>n.channel===t)}},click(){let e=Texture.selected?.layers_enabled?Texture.selected.layers:Texture.all;if(!e||!e.length)return;let r=e.find(n=>n.channel===t);r&&(r.select(),r.scrollTo())}}),G[t].addLabel(!0,()=>a.label??t)})});L.push(()=>{[...Object.values(V),...Object.values(G)].forEach(a=>{a.delete()})});C.push(()=>{s.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:{selected:{texture:!0},method(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);return t?.channel&&t.channel!==N}},click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t)return;Undo.initEdit({layers:[t]});let a=t instanceof TextureLayer?t.texture:t,e=t.channel;Project.pbr_materials[a.uuid]={},t.channel=N,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${t.name}" from ${e} channel`,2e3),B()}}),s.channelMenu=new Menu("channel_menu",[...Object.keys(u).map(t=>`assign_channel_${t}`),"unassign_channel"],{onOpen(){B()}}),s.channelSelectionMenu=new Menu("channel_selection_menu",Object.keys(u).map(t=>`select_channel_${t}`)),s.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",condition:{modes:["edit","paint"],selected:{texture:!0}},click(t){s.channelMenu?.open(t)},children:[...Object.values(V),s.unassignChannel]}),s.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(t){s.channelMenu?.open(t)}}),s.showChannelSelectionMenu=new Action("show_channel_select_menu",{icon:"tv_options_edit_channels",name:"Select PBR Channel",description:"Select a channel to view",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(t){s.channelSelectionMenu?.open(t)}}),s.openChannelMenu&&(MenuBar.addAction(s.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(s.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(s.openChannelMenu,"0")),Toolbars.layers.add(s.showChannelMenu,1)});L.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(s.showChannelMenu)});function J(t,a=!1){let e=t.canvas.getContext("2d");if(!e)return null;let r=Math.max(t.img.width??t.canvas.width,Project?Project.texture_width:0,16),n=Math.max(t.img.height??t.canvas.height,Project?Project.texture_height:0,16),{data:c}=e.getImageData(0,0,r,n),i=document.createElement("canvas"),o=i.getContext("2d");if(!o)return null;let p=(l,d)=>{let v=(l+d*r)*4;return c[v]/255};i.width=r,i.height=n,o.drawImage(t.img,0,0,r,n);let f=o.getImageData(0,0,r,n),x=f.data,h=l=>{let d=Math.sqrt(l[0]*l[0]+l[1]*l[1]+l[2]*l[2]);return[l[0]/d,l[1]/d,l[2]/d]};for(let l=0;l{let l=(m+g*e)*4;return n[l]/255};c.width=e,c.height=r,i.drawImage(t.img,0,0,e,r);let p=i.getImageData(0,0,e,r),f=p.data;for(let m=0;m{s.generateNormal=new Action("generate_normal",{icon:u.normal.icon??"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(R()??D())!==null,click(t){let a=R()??D()??Texture.getDefault();if(!a)return;let e=J(a);if(!e){Blockbench.showQuickMessage("Failed to generate normal map",2e3);return}e.select(t),new k(a instanceof Texture&&a.layers_enabled?a.layers:null,a.uuid).saveTexture(u.normal,e),Blockbench.showQuickMessage("Normal map generated",2e3)}}),s.generateAo=new Action("generate_ao",{icon:u.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let t=R()??D()??Texture.getDefault();if(!t)return;let a=new k(t instanceof Texture&&t.layers_enabled?t.layers:null,t.uuid),e=a.findTexture(u.normal)??J(t);if(!e){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=se(e);if(r){a.saveTexture(u.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),MenuBar.addAction(s.generateNormal,"tools"),MenuBar.addAction(s.generateAo,"tools")});L.push(()=>{MenuBar.removeAction("tools.generate_normal")});C.push(()=>{s.createMaterialTexture=new Action("create_material_texture",{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let t={...u},a=new Texture({name:"New Material",saved:!1,particle:!1});a.extend({material:!0});let e=Texture.all.filter(i=>i.selected||i.multi_selected)??Texture.all,r=D(),n=r?new k(e,r.uuid):null;try{let i=n?.findTexture(u.albedo,!0)?.canvas.toDataURL()??r?.canvas.toDataURL()??Q(new b.Color(8421504),a.canvas);if(!i)return;a.fromDataURL(i);let o=new TextureLayer({name:t.albedo.label,visible:!0,data_url:i,keep_size:!0},a);o.extend({channel:t.albedo.id}),o.addForEditing(),o.texture.updateChangesAfterEdit(),n?.saveTexture(t.albedo,o),delete t.albedo}catch(i){console.warn("Failed to create base color texture",i),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let c=Object.keys(t).map(i=>{let o=u[i],p=n?.findTexture(o,!0),f=p?p.canvas.toDataURL():Q(o.default??new b.Color(0));if(!f)return;let x=new TextureLayer({name:o.label,visible:!0,data_url:f,keep_size:!0},a);return x.extend({channel:o.id}),n?.saveTexture(o,x),x}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:c}),a.add().select(),a.activateLayers(),c.map(i=>{i.addForEditing(),a.width=Math.max(a.width,i.img.width),a.height=Math.max(a.height,i.img.height)}),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(s.createMaterialTexture,"tools"),Toolbars.texturelist.add(s.createMaterialTexture,3)});L.push(()=>{MenuBar.removeAction("tools.create_material_texture"),Toolbars.texturelist.remove("tools.create_material_texture")});var $=(t,a)=>{let e=D()??Texture.getDefault(),r=new k(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[c,i]=Project?[t?`${t}_mer`:`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:c,extensions:["png"],resource_id:"mer",savetype:"image",startpath:i},a)})};C.push(()=>{s.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{$()}catch(t){console.error("Failed to export MER map:",t),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),s.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let t=D()??Texture.getDefault(),a=new k([t],t.uuid),e=a.decodeMer(),r=[u.metalness,u.emissive,u.roughness];Undo.initEdit({textures:[t]}),r.forEach(n=>{let c=n.id,i=e[c];if(!i){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let o=new Texture({name:`${t?.name}_${c}`,keep_size:!1}).fromDataURL(i.toDataURL());o.add(!0),a.saveTexture(n,o)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>D()?.layers_enabled===!0,click(){let t=D()??Texture.getDefault(),a=new k(t.layers_enabled?t.layers:[t],t.uuid),e=a.decodeMer(),r=[u.metalness,u.emissive,u.roughness];Undo.initEdit({textures:[t]}),r.forEach(n=>{let c=n.id,i=e[c];if(!i){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let o=new TextureLayer({name:`${t?.name}_${c}`,data_url:i.toDataURL()},t);a.saveTexture(n,o),o.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(s.decodeMer,"tools"),MenuBar.addAction(s.generateMer,"file.export")});L.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var Ae=()=>{Project&&Project.textures.forEach(t=>{let a=new k(null,t.uuid),e=a.findTexture(u.normal,!1),r=a.findTexture(u.height,!1),n=a.findTexture(u.albedo,!1),c=a.findTexture(u.metalness,!1)?.name,i=a.findTexture(u.emissive,!1)?.name,o=a.findTexture(u.roughness,!1)?.name,p={};return n||(p.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!c&&!i&&!o&&(p.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},p.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},p.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),e&&(p.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(p.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),e&&r&&(p.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),s.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:p,cancelIndex:1,onConfirm(f){let x=ee(),h=c||i||o,_={format_version:"1.16.100","minecraft:texture_set":{color:(n?x:f.baseColor?.toHexString())??x,metalness_emissive_roughness:[f.metalness??0,f.emissive??0,f.roughness??255]}};f.depthMap==="normal"&&e||!r&&e?_["minecraft:texture_set"].normal=`${x}_normal`:(!e||f.depthMap==="heightmap")&&r&&(_["minecraft:texture_set"].heightmap=`${x}_heightmap`);let m=d=>{if(!f.depthMap)return d();let v=f.depthMap==="normal"||f.depthMap&&!r,M=v?e:r;if(!M)return d();Blockbench.export({content:M.canvas.toDataURL()??"",type:"PNG",name:`${x}_${v?"normal":"heightmap"}`,extensions:["png"],resource_id:f.depthMap,startpath:Project.export_path,savetype:"image"},w=>{_["minecraft:texture_set"][v?"normal":"heightmap"]=pathToName(w,!1),d()})},g=d=>{if(!n)return d();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:x,startpath:Project.export_path,savetype:"image"},v=>{_["minecraft:texture_set"].color=pathToName(v,!1),d()})},l=()=>m(()=>{g(()=>{Blockbench.export({content:JSON.stringify(_,null,2),type:"JSON",name:`${x}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),s.textureSetDialog?.hide()})})});if(h){try{$(x,d=>{_["minecraft:texture_set"].metalness_emissive_roughness=pathToName(d,!1),l()})}catch(d){console.warn("Failed to export MER map:",d),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}l()}}),s.textureSetDialog.show()})};C.push(()=>{s.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){Ae()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(s.createTextureSet,"file.export")});L.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});C.push(()=>{s.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(t){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=t}),Preview.selected.renderer.physicallyCorrectLights=t,Blockbench.showQuickMessage(`Physically corrected lighting is now ${t?"enabled":"disabled"}`,2e3),t&&s.togglePbr?.set(!0),A()},click(){}}),MenuBar.addAction(s.toggleCorrectLights,"preview")});L.push(()=>{MenuBar.removeAction("preview.correct_lights")});var F=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(a=>{let r=t.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var oe=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],ie=()=>Project&&Project.pbr_active&&A(),Ne=()=>{Blockbench.on(oe.join(" "),ie)},le=()=>{oe.forEach(t=>{Blockbench.removeListener(t,ie)})};C.push(()=>{s.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(t){if(t){A(),Ne(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}F(),le(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(s.togglePbr,"view")});L.push(()=>{le(),MenuBar.removeAction("view.toggle_pbr")});var ce=t=>{let a=Math.max(-2,Math.min(2,t));Preview.all.forEach(e=>{e.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};C.push(()=>{s.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(s.tonemappingSelect?.get())===b.NoToneMapping&&s.tonemappingSelect.change(b.LinearToneMapping.toString()),s.togglePbr?.set(!0)},onChange(t){ce(Number(t))},onAfter(){B()}}),s.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>s.exposureSlider!==void 0&&Number(s.exposureSlider?.get())!==1,click(){ce(1),s.exposureSlider?.setValue(1,!0),B()}}),s.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:b.NoToneMapping,value:Preview.selected.renderer.toneMapping??b.NoToneMapping,icon:"monochrome_photos",options:{[b.NoToneMapping]:"No Tone Mapping",[b.LinearToneMapping]:"Linear",[b.ReinhardToneMapping]:"Reinhard",[b.CineonToneMapping]:"Cineon",[b.NeutralToneMapping]:"Neutral",[b.ACESFilmicToneMapping]:"ACES"},onChange({value:t}){Preview.selected.renderer.toneMapping=Number(t);let a=1;Preview.selected.renderer.toneMapping===b.NoToneMapping?s.exposureSlider?.setValue(a,!0):a=Number(s.exposureSlider?.get()??1),Preview.all.forEach(e=>{e.renderer.toneMapping=Number(t),e.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(t)}`,2e3),s.togglePbr&&!s.togglePbr.value&&s.togglePbr.set(!0),A()}})});var Be=(t,a="texture")=>{t.toBlob(async e=>{e&&Blockbench.export({content:await e.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},Re=(t,a="texture")=>{t.toBlob(async e=>{e&&Blockbench.export({content:await e.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};C.push(()=>{s.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let t=D();if(!t)return;let e=new k(t.layers_enabled?t.layers:[t],t.uuid).createLabPbrOutput();if(e===null)return;let r=t.name??(Project?Project.getDisplayName():"texture");await Promise.all([Be(e.normalMap,pathToName(r)),Re(e.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),s.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let t=TextureLayer.selected?.texture??Texture.all.find(e=>e.selected)??Texture.getDefault(),a=new k(t.layers_enabled?t.layers:[t],t.uuid);if(pathToName(t.name).endsWith("_n")){a.createTexturesFromNormal(t);return}if(pathToName(t.name).endsWith("_s")){a.createTexturesFromSpecular(t);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(s.generateLabPbr,"file.export"),MenuBar.addAction(s.decodeLabPbr,"tools")});L.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});var O=class t{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(u).map(e=>[e,u[e].default??new b.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([e,r])=>[e,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let e=Math.min(1,Math.max(0,a));return new b.Color(e,e,e).convertSRGBToLinear()}static fromSettings(){let a="#000000",e=Number(s.brushMetalnessSlider?.get()),r=Number(s.brushRoughnessSlider?.get()??1),n=(s.brushEmissiveColor?.get()??a).toString(),c=Number(s.brushHeightSlider?.get()),i=ColorPanel.get(),o={[u.albedo.id]:new b.Color(i),[u.metalness.id]:t.makeLinearColor(e),[u.roughness.id]:t.makeLinearColor(r),[u.emissive.id]:new b.Color(n??a),[u.height.id]:t.makeLinearColor(c),[u.normal.id]:u.normal.default??new b.Color("#8080ff")};return new t({colors:o})}};var ue="materialBrushPresets",q=()=>JSON.parse(localStorage.getItem(ue)||"{}"),Ie=(t,a)=>{let e=q(),r=a??guid(),n=s.userMaterialBrushPresets?.getFormResult()??{},c={};return n.albedo&&(c.albedo=n.albedo.toString()),n.metalness&&(c.metalness=Number(n.metalness)),n.roughness&&(c.roughness=Number(n.roughness)),n.emissive&&(c.emissive=n.emissive.toString()),n.height&&(c.height=Number(n.height)),e[r]=[c,t??"New Preset",H(c)],localStorage.setItem(ue,JSON.stringify(e)),r},me=({metalness:t,roughness:a,emissive:e,height:r,albedo:n})=>{t!==void 0&&s.brushMetalnessSlider?.setValue(t||0,!0),a!==void 0&&s.brushRoughnessSlider?.setValue(a??1,!0),e!==void 0&&s.brushEmissiveColor?.set(e??"#000000"),r!==void 0&&s.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},z=({id:t})=>Condition({project:!0,tools:["material_brush"],method(){let a=D();return(a?.layers_enabled&&a.layers.find(({channel:e})=>e&&e===t)!==void 0)===!0}}),He=X.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:u}},methods:{applyPreset(t){try{let[a,e]=this.userPresets[t],{metalness:r,roughness:n,emissive:c,height:i,albedo:o}=a;me({metalness:Number(r),roughness:Number(n),emissive:c.toString(),height:Number(i),albedo:o.toString()}),s.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${e}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(t){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let e=q(),r=this.userPresets[t][1]??t;delete e[t],localStorage.setItem("materialBrushPresets",JSON.stringify(e)),this.userPresets=e,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(t){s.userMaterialBrushPresets?.setFormValues({name:this.userPresets[t][1]??t,...this.userPresets[t][0]})},getSummary(t){return Object.entries(t).filter(([a])=>a in this.channels).map(([a,e])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${e}`:`${this.channels[a]?.label??a}: ${Number(e).toFixed(1)}`).join(` -`)}},computed:{presets(){return Object.entries(this.userPresets)}},mounted(){this.userPresets=q()},template:` +"use strict";(()=>{var M=THREE,ae=Vue,re=window.JSZip;var A="_NONE_",g={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new M.Color(16777215),regex:new RegExp("(s|_)*(basecolor|color|albedo)","i")},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new M.Color(0),regex:new RegExp("[ _]*metal(lic|ness)?","i")},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new M.Color(0),regex:new RegExp("[ _]*(emissive|emission)","i")},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new M.Color(16777215),regex:new RegExp("[ _]*rough(ness)?","i")},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new M.Color(16777215),regex:new RegExp("[ _]*(height|bump)","i")},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new M.Color("rgb(128, 128, 255)"),regex:new RegExp("[ _]*normal","i")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new M.Color(16777215),regex:new RegExp("[ _]*(ao|ambientocclusion|ambient occlusion)","i")}},o={},w=[],P=[];var ne=[...Object.keys(g).map(t=>g[t].id),A];w.push(()=>{o.channelProp=new Property(TextureLayer,"enum","channel",{default:A,values:ne,label:"PBR Channel",exposed:!1}),o.textureChannelProp=new Property(Texture,"enum","channel",{default:A,values:ne,label:"PBR Channel",exposed:!1}),o.materialTextureProp=new Property(Texture,"boolean","material",{default:!1,label:"Material Texture"}),o.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),o.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),o.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!1,values:[],label:"PBR Mode"})});function S(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(t=>t.selected)??null:Texture.all.find(t=>t.selected)??Texture.getDefault()}function N(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(t=>t.selected)??Project.selected_texture.layers[0]:S()?.getActiveLayer()??null}function I(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(S()?.name??"texture")}function se(t,a){let e;return function(...r){let n=()=>{e=void 0,t.apply(this,r)};clearTimeout(e),e=setTimeout(n,a)}}function U(t){let a=MediaPreview.renderer??new M.WebGLRenderer({alpha:!0,antialias:!0}),e=new M.Scene,r=new M.PerspectiveCamera(75,96/96,.1,1e3),n=new M.AmbientLight(16777215,.75);e.add(n);let i=new M.PointLight(16777215,1,100);i.position.set(5,5,5),e.add(i);let s=new M.SphereGeometry(1,32,32),l=t instanceof M.MeshStandardMaterial&&t.isMeshStandardMaterial?t:new M.MeshStandardMaterial({color:t.albedo,metalness:t.metalness??0,roughness:t.roughness??1,emissive:t.emissive,bumpScale:t.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),p=new M.Mesh(s,l);e.add(p),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(e,r);let h=a.domElement.toDataURL();return l.dispose(),MediaPreview.renderer||(a.clear(),a.dispose()),h}function J(t,a){let e=a??document.createElement("canvas"),r=e.getContext("2d");if(!r)return e.remove(),null;let n=Math.max(Project?Project.texture_width:16,16),i=Math.max(Project?Project.texture_height:16,16);e.width=n,e.height=i,r.fillStyle=`rgb(${t.r*255}, ${t.g*255}, ${t.b*255})`,r.fillRect(0,0,n,i);let s=e.toDataURL();return a||e.remove(),s}var Ie=(t=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return t?a.filter(e=>e.layers_enabled&&e.layers.length>0).flatMap(e=>e.layers):a},D=class t{constructor(a,e){this._scope=a??Ie(),this._materialUuid=e}merToCanvas(){let a=this.getTexture(g.emissive),e=this.getTexture(g.roughness),r=this.getTexture(g.metalness);if(!a&&!e&&!r){let{metalness:n,emissive:i,roughness:s}=this.decodeMer();n&&(r=t.makePixelatedCanvas(n)),i&&(a=t.makePixelatedCanvas(i)),s&&(e=t.makePixelatedCanvas(s))}return{emissiveMap:a,roughnessMap:e,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:e,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(g.emissive),roughnessMap:this.getTexture(g.roughness),metalnessMap:this.getTexture(g.metalness)},i=this.getTexture(g.normal);return new M.MeshStandardMaterial({map:this.getTexture(g.albedo)??t.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(s=>s.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(g.ao),bumpMap:this.getTexture(g.height),normalMap:i,normalScale:new M.Vector2(-1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:e,emissiveIntensity:e?1:0,emissive:e?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}renderMaterialPreview(){return U(this.getMaterial())}saveTexture(a,e){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=e.uuid,e.extend({channel:a.id}))}findTexture(a,e=!0){if(!Project)return null;let r=this._scope.find(p=>p.channel&&(p.channel===a||p.channel===a.id));if(r)return r;let[n,i]=typeof a=="string"?[a,new RegExp(`_*${a}(.[^.]+)?$`,"i")]:[a.id,a.regex??new RegExp(`_*${a.id}(.[^.]+)?$`,"i")];Project.pbr_materials=Project.pbr_materials??{};let s=Project.pbr_materials[this._materialUuid];if(e&&!s&&n!==A)return this._scope.find(p=>i?.test(p.name))??null;let l=s?.[n];return l?this._scope.find(p=>p.uuid===l)??null:null}static makePixelatedCanvas(a){let e=new M.CanvasTexture(a,void 0,void 0,void 0,M.NearestFilter,M.NearestFilter);return e.needsUpdate=!0,e}getTexture(a){let e=this.findTexture(a);return e?t.makePixelatedCanvas(e.canvas):null}static extractChannel(a,e){let r=a.canvas,{width:n,height:i}=r,s=r.getContext("2d");if(!s||!n||!i)return null;let l=document.createElement("canvas");l.width=n,l.height=i;let p=l.getContext("2d");if(!p)return null;let h={r:0,g:1,b:2,a:3}[e],{data:m}=s.getImageData(0,0,n,i),u=new Uint8ClampedArray(n*i*4);for(let d=0;da){f[c]=b.data[c],f[c+1]=b.data[c+1],f[c+2]=b.data[c+2],f[c+3]=255;continue}f[c]=0,f[c+1]=0,f[c+2]=0,f[c+3]=255}return h.putImageData(new ImageData(f,l.width,l.height),0,0),{metalness:r,emissive:l,emissiveLevel:n,roughness:i,sss:s}}createMer(a=!1){let e=this.findTexture(g.metalness,a),r=this.findTexture(g.emissive,a),n=this.findTexture(g.roughness,a),i=this.findTexture("sss",!1),s=Math.max(e?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),l=Math.max(e?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),p=document.createElement("canvas");p.width=s,p.height=l;let h=p.getContext("2d");if(!h)return null;let m=e?.img?t.extractChannel(e,"r"):null,u=r?.img?t.extractChannel(r,"g"):null,b=n?.img?t.extractChannel(n,"b"):null,d=i&&i?.img?t.extractChannel(i,"a"):null,f=m?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),c=u?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),x=b?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),v=d?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(new Uint8ClampedArray(s*l*4).fill(255),s,l),_=new Uint8ClampedArray(s*l*4);for(let y=0;y<_.length;y+=4)_[y]=f.data[y],_[y+1]=c.data[y],_[y+2]=x.data[y],_[y+3]=v.data[y];return h.putImageData(new ImageData(_,s,l),0,0),p}createLabPbrOutput(a=!0){let e=this.findTexture(g.metalness,a),r=this.findTexture(g.emissive,a),n=this.findTexture(g.roughness,a),i=this.findTexture(g.normal,a),s=this.findTexture(g.height,a),l=this.findTexture(g.ao,!1),p=this.findTexture("sss",!0),h=this.findTexture("porosity",!0),m=Math.max(e?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),u=Math.max(e?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),b=document.createElement("canvas");b.width=m,b.height=u;let d=b.getContext("2d"),f=document.createElement("canvas");f.width=m,f.height=u;let c=f.getContext("2d");if(!d||!c)return null;let x=new Uint8ClampedArray(m*u*4),v=new Uint8ClampedArray(m*u*4),_=e?.canvas,y=r?.canvas,k=n?.canvas,T=p?.canvas,L=h?.canvas,C=_?.getContext("2d"),j=y?.getContext("2d"),_e=k?.getContext("2d"),ye=T?.getContext("2d"),we=L?.getContext("2d"),Te=C?.getImageData(0,0,m,u),H=j?.getImageData(0,0,m,u),K=_e?.getImageData(0,0,m,u),Ce=ye?.getImageData(0,0,m,u),Ee=we?.getImageData(0,0,m,u);for(let E=0;E{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),e}createTexturesFromNormal(a){let e=this.decodeLabPbrNormal(a);return Object.entries(e).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),e}};var O=class{constructor({lightHeight:a=.66,ambientLight:e=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:n=[1,1,1]}={}){this.lightHeight=a,this.ambientLight=e,this.minLightIntensity=r,this.lightDiffuse=n}bake(a,e,r){let n=e instanceof HTMLCanvasElement?e:this.createCanvas(e.width,e.height),i=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),s=n.getContext("2d"),l=i.getContext("2d");s.drawImage(e,0,0),l.drawImage(r,0,0);let p=s.getImageData(0,0,e.width,e.height),h=l.getImageData(0,0,r.width,r.height),m=[],u=[];for(let d=0;d{let f=this.createCanvas(e.width,e.height),c=f.getContext("2d"),x=c.getImageData(0,0,f.width,f.height),v=[Math.cos(d),Math.sin(d),this.lightHeight];for(let _=0;_{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new D(r.layers_enabled?r.layers:Project.textures,r.uuid),i=n.findTexture(g.albedo);if(!i){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let s=n.findTexture(g.normal);if(!s){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let p=new O(t).bake(a,i.canvas,s.canvas),h=new Texture({name:`${i.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(p[0].toDataURL()),m=e?u=>{let b=n.findTexture(g.emissive);if(!b)return u;let d=b.canvas;if(!d.getContext("2d"))return u;let c=Math.max(u.width,d.width,Project?Project.texture_width:16),x=Math.max(u.height,d.height,Project?Project.texture_height:16),v=document.createElement("canvas");v.width=c,v.height=x;let _=v.getContext("2d");return _?(_.drawImage(u,0,0),_.globalCompositeOperation="screen",_.drawImage(d,0,0),v):u}:u=>u;p.forEach((u,b)=>{new TextureLayer({name:`baked_${b+1}`,data_url:m(u).toDataURL()},h).addForEditing()}),h.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};w.push(()=>{o.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(t){let a=new M.Color(t.ambientLight.toString()),e=new M.Color(t.lightDiffuse.toString());oe({ambientLight:[a.r,a.g,a.b],lightDiffuse:[e.r,e.g,e.b],lightHeight:Number(t.lightHeight),minLightIntensity:Number(t.minLightIntensity)},t.directions??8,t.blendEmissive??!1)}}),o.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){o.bakeTexturesDialog?.show()}}),MenuBar.addAction(o.bakeTexturesAction,"tools")});P.push(()=>{MenuBar.removeAction("tools.bake_textures")});function ie(t,a){let e=t.getTexture();if(!e||!Project)return null;let r=Project.materials[e.uuid];r.isShaderMaterial&&!Project.bb_materials[e.uuid]?Project.bb_materials[e.uuid]=r:r.isMeshStandardMaterial&&r.dispose();let n=new D(e.layers_enabled?e.layers.filter(i=>i.visible)??null:Project.textures,e.uuid).getMaterial({side:Canvas.getRenderSide(e),...a});return Project.materials[e.uuid]=M.ShaderMaterial.prototype.copy.call(n,r),e}function le(t){return Object.values(t).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function Ue(t,a){let e={};return t.forAllFaces(r=>{let n=ie(r,a);n&&(e[n.uuid]=n)}),le(e)}function Oe(t,a){let e={};return Object.keys(t.faces).forEach(r=>{let n=t.faces[r],i=ie(n,a);i&&(e[i.uuid]=i)}),le(e)}var R=(t={})=>{Project&&(Project.pbr_active=Texture.all.length>0&&Project.elements.map(a=>a instanceof Mesh&&Ue(a,t)||a instanceof Cube&&Oe(a,t)).filter(Boolean).length>0)},B=(t=100)=>se(R,t);var W={},Z={};w.push(()=>{Object.entries(g).forEach(([t,a])=>{W[t]=new Action(`assign_channel_${t}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:{selected:{texture:!0},project:!0,method(){return S()?.material===!0&&N()!==null}},click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e)return;Undo.initEdit({layers:[e]}),e.extend({channel:a.id});let r=e instanceof TextureLayer?e.texture:e;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([n,i])=>{i===e.uuid&&(delete Project.pbr_materials[r.uuid][n],e.channel=A)}),r.uuid===e.uuid&&(Project.pbr_materials[r.uuid]={}),Project.pbr_materials[r.uuid][t]=e.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${e.name}" to ${a.label} channel`,2e3),R()}}),Z[t]=new Action(`select_channel_${t}`,{icon:a.icon??"tv_options_edit_channels",name:a.label??t,description:`Select the ${a.label} channel`,condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){let e=S();return(e?.layers_enabled?e.layers:Texture.all).some(n=>n.channel===t)}},click(){let e=Texture.selected?.layers_enabled?Texture.selected.layers:Texture.all;if(!e||!e.length)return;let r=e.find(n=>n.channel===t);r&&(r.select(),r.scrollTo())}}),Z[t].addLabel(!0,()=>a.label??t)})});P.push(()=>{[...Object.values(W),...Object.values(Z)].forEach(a=>{a.delete()})});w.push(()=>{o.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:{selected:{texture:!0},method(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);return t?.channel&&t.channel!==A}},click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t)return;Undo.initEdit({layers:[t]});let a=t instanceof TextureLayer?t.texture:t,e=t.channel;Project.pbr_materials[a.uuid]={},t.channel=A,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${t.name}" from ${e} channel`,2e3),B()}}),o.channelMenu=new Menu("channel_menu",[...Object.keys(g).map(t=>`assign_channel_${t}`),"unassign_channel"],{onOpen(){B()}}),o.channelSelectionMenu=new Menu("channel_selection_menu",Object.keys(g).map(t=>`select_channel_${t}`)),o.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",condition:{modes:["edit","paint"],selected:{texture:!0}},click(t){o.channelMenu?.open(t)},children:[...Object.values(W),o.unassignChannel]}),o.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(t){o.channelMenu?.open(t)}}),o.showChannelSelectionMenu=new Action("show_channel_select_menu",{icon:"tv_options_edit_channels",name:"Select PBR Channel",description:"Select a channel to view",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(t){o.channelSelectionMenu?.open(t)}}),o.openChannelMenu&&(MenuBar.addAction(o.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(o.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(o.openChannelMenu,"0")),Toolbars.layers.add(o.showChannelMenu,1)});P.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(o.showChannelMenu)});function q(t,a=!1){let e=t.canvas.getContext("2d");if(!e)return null;let r=Math.max(t.img.width??t.canvas.width,Project?Project.texture_width:0,16),n=Math.max(t.img.height??t.canvas.height,Project?Project.texture_height:0,16),{data:i}=e.getImageData(0,0,r,n),s=document.createElement("canvas"),l=s.getContext("2d");if(!l)return null;let p=(c,x)=>{let v=(c+x*r)*4;return i[v]/255};s.width=r,s.height=n,l.drawImage(t.img,0,0,r,n);let h=l.getImageData(0,0,r,n),m=h.data,u=c=>{let x=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);return[c[0]/x,c[1]/x,c[2]/x]};for(let c=0;c{let c=(d+f*e)*4;return n[c]/255};i.width=e,i.height=r,s.drawImage(t.img,0,0,e,r);let p=s.getImageData(0,0,e,r),h=p.data;for(let d=0;d{o.generateNormal=new Action("generate_normal",{icon:g.normal.icon??"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(N()??S())!==null,click(t){let a=N()??S()??Texture.getDefault();if(!a)return;let e=q(a);if(!e){Blockbench.showQuickMessage("Failed to generate normal map",2e3);return}e.select(t),new D(a instanceof Texture&&a.layers_enabled?a.layers:null,a.uuid).saveTexture(g.normal,e),Blockbench.showQuickMessage("Normal map generated",2e3)}}),o.generateAo=new Action("generate_ao",{icon:g.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let t=N()??S()??Texture.getDefault();if(!t)return;let a=new D(t instanceof Texture&&t.layers_enabled?t.layers:null,t.uuid),e=a.findTexture(g.normal)??q(t);if(!e){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=ce(e);if(r){a.saveTexture(g.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),MenuBar.addAction(o.generateNormal,"tools"),MenuBar.addAction(o.generateAo,"tools")});P.push(()=>{MenuBar.removeAction("tools.generate_normal")});var Fe=(t,a="texture")=>{t.toBlob(async e=>{e&&Blockbench.export({content:await e.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},ze=(t,a="texture")=>{t.toBlob(async e=>{e&&Blockbench.export({content:await e.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};w.push(()=>{o.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let t=S();if(!t)return;let e=new D(t.layers_enabled?t.layers:[t],t.uuid).createLabPbrOutput();if(e===null)return;let r=t.name??(Project?Project.getDisplayName():"texture");await Promise.all([Fe(e.normalMap,pathToName(r)),ze(e.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),o.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let t=TextureLayer.selected?.texture??Texture.all.find(e=>e.selected)??Texture.getDefault(),a=new D(t.layers_enabled?t.layers:[t],t.uuid);if(pathToName(t.name).endsWith("_n")){a.createTexturesFromNormal(t);return}if(pathToName(t.name).endsWith("_s")){a.createTexturesFromSpecular(t);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(o.generateLabPbr,"file.export"),MenuBar.addAction(o.decodeLabPbr,"tools")});P.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});w.push(()=>{o.createMaterialTexture=new Action("create_material_texture",{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let t={...g},a=new Texture({name:"New Material",saved:!1,particle:!1});a.extend({material:!0});let e=Texture.all.filter(s=>s.selected||s.multi_selected)??Texture.all,r=S(),n=r?new D(e,r.uuid):null;try{let s=n?.findTexture(g.albedo,!0)?.canvas.toDataURL()??r?.canvas.toDataURL()??J(new M.Color(8421504),a.canvas);if(!s)return;a.fromDataURL(s);let l=new TextureLayer({name:t.albedo.label,visible:!0,data_url:s,keep_size:!0},a);l.extend({channel:t.albedo.id}),l.addForEditing(),l.texture.updateChangesAfterEdit(),n?.saveTexture(t.albedo,l),delete t.albedo}catch(s){console.warn("Failed to create base color texture",s),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let i=Object.keys(t).map(s=>{let l=g[s],p=n?.findTexture(l,!0),h=p?p.canvas.toDataURL():J(l.default??new M.Color(0));if(!h)return;let m=new TextureLayer({name:l.label,visible:!0,data_url:h,keep_size:!0},a);return m.extend({channel:l.id}),n?.saveTexture(l,m),m}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:i}),a.add().select(),a.activateLayers(),i.map(s=>{s.addForEditing(),a.width=Math.max(a.width,s.img.width),a.height=Math.max(a.height,s.img.height)}),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(o.createMaterialTexture,"tools"),Toolbars.texturelist.add(o.createMaterialTexture,3)});P.push(()=>{MenuBar.removeAction("tools.create_material_texture"),Toolbars.texturelist.remove("create_material_texture")});var F=(t,a)=>{let e=S()??Texture.getDefault(),r=new D(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[i,s]=Project?[t?`${t}_mer`:`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:i,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},a)})};w.push(()=>{o.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{F()}catch(t){console.error("Failed to export MER map:",t),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),o.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let t=S()??Texture.getDefault(),a=new D([t],t.uuid),e=a.decodeMer(),r=[g.metalness,g.emissive,g.roughness];Undo.initEdit({textures:[t]}),r.forEach(n=>{let i=n.id,s=e[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new Texture({name:`${t?.name}_${i}`,keep_size:!1}).fromDataURL(s.toDataURL());l.add(!0),a.saveTexture(n,l)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>S()?.layers_enabled===!0,click(){let t=S()??Texture.getDefault(),a=new D(t.layers_enabled?t.layers:[t],t.uuid),e=a.decodeMer(),r=[g.metalness,g.emissive,g.roughness];Undo.initEdit({textures:[t]}),r.forEach(n=>{let i=n.id,s=e[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new TextureLayer({name:`${t?.name}_${i}`,data_url:s.toDataURL()},t);a.saveTexture(n,l),l.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(o.decodeMer,"tools"),MenuBar.addAction(o.generateMer,"file.export")});P.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var Ge=()=>{Project&&Project.textures.forEach(t=>{let a=new D(null,t.uuid),e=a.findTexture(g.normal,!1),r=a.findTexture(g.height,!1),n=a.findTexture(g.albedo,!1),i=a.findTexture(g.metalness,!1)?.name,s=a.findTexture(g.emissive,!1)?.name,l=a.findTexture(g.roughness,!1)?.name,p={};return n||(p.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!i&&!s&&!l&&(p.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},p.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},p.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),e&&(p.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(p.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),e&&r&&(p.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),o.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:p,cancelIndex:1,onConfirm(h){let m=I(),u=i||s||l,b={format_version:"1.16.100","minecraft:texture_set":{color:(n?m:h.baseColor?.toHexString())??m,metalness_emissive_roughness:[h.metalness??0,h.emissive??0,h.roughness??255]}};h.depthMap==="normal"&&e||!r&&e?b["minecraft:texture_set"].normal=`${m}_normal`:(!e||h.depthMap==="heightmap")&&r&&(b["minecraft:texture_set"].heightmap=`${m}_heightmap`);let d=x=>{if(!h.depthMap)return x();let v=h.depthMap==="normal"||h.depthMap&&!r,_=v?e:r;if(!_)return x();Blockbench.export({content:_.canvas.toDataURL()??"",type:"PNG",name:`${m}_${v?"normal":"heightmap"}`,extensions:["png"],resource_id:h.depthMap,startpath:Project.export_path,savetype:"image"},y=>{b["minecraft:texture_set"][v?"normal":"heightmap"]=pathToName(y,!1),x()})},f=x=>{if(!n)return x();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:m,startpath:Project.export_path,savetype:"image"},v=>{b["minecraft:texture_set"].color=pathToName(v,!1),x()})},c=()=>d(()=>{f(()=>{Blockbench.export({content:JSON.stringify(b,null,2),type:"JSON",name:`${m}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),o.textureSetDialog?.hide()})})});if(u){try{F(m,x=>{b["minecraft:texture_set"].metalness_emissive_roughness=pathToName(x,!1),c()})}catch(x){console.warn("Failed to export MER map:",x),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}c()}}),o.textureSetDialog.show()})};w.push(()=>{o.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){Ge()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(o.createTextureSet,"file.export")});P.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});w.push(()=>{o.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(t){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=t}),Preview.selected.renderer.physicallyCorrectLights=t,Blockbench.showQuickMessage(`Physically corrected lighting is now ${t?"enabled":"disabled"}`,2e3),t&&o.togglePbr?.set(!0),R()},click(){}}),MenuBar.addAction(o.toggleCorrectLights,"preview")});P.push(()=>{MenuBar.removeAction("preview.correct_lights")});var z=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(a=>{let r=t.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var ue=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],me=()=>Project&&Project.pbr_active&&R(),Ve=()=>{Blockbench.on(ue.join(" "),me)},de=()=>{ue.forEach(t=>{Blockbench.removeListener(t,me)})};w.push(()=>{o.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(t){if(t){R(),Ve(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}z(),de(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(o.togglePbr,"view")});P.push(()=>{de(),MenuBar.removeAction("view.toggle_pbr")});var he=t=>{let a=Math.max(-2,Math.min(2,t));Preview.all.forEach(e=>{e.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};w.push(()=>{o.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(o.tonemappingSelect?.get())===M.NoToneMapping&&o.tonemappingSelect.change(M.LinearToneMapping.toString()),o.togglePbr?.set(!0)},onChange(t){he(Number(t))},onAfter(){B()}}),o.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>o.exposureSlider!==void 0&&Number(o.exposureSlider?.get())!==1,click(){he(1),o.exposureSlider?.setValue(1,!0),B()}}),o.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:M.NoToneMapping,value:Preview.selected.renderer.toneMapping??M.NoToneMapping,icon:"monochrome_photos",options:{[M.NoToneMapping]:"No Tone Mapping",[M.LinearToneMapping]:"Linear",[M.ReinhardToneMapping]:"Reinhard",[M.CineonToneMapping]:"Cineon",[M.NeutralToneMapping]:"Neutral",[M.ACESFilmicToneMapping]:"ACES"},onChange({value:t}){Preview.selected.renderer.toneMapping=Number(t);let a=1;Preview.selected.renderer.toneMapping===M.NoToneMapping?o.exposureSlider?.setValue(a,!0):a=Number(o.exposureSlider?.get()??1),Preview.all.forEach(e=>{e.renderer.toneMapping=Number(t),e.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(t)}`,2e3),o.togglePbr&&!o.togglePbr.value&&o.togglePbr.set(!0),R()}})});var X=class{async parse(a){let e=new re,r="model.usda";e.file(r,"");let n=xe(),i={},s={};a.traverseVisible(h=>{if(!h.isMesh)return;let m=h;if(!m.material.isMeshStandardMaterial){console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",h);return}let u=m.geometry,b=m.material,d="geometries/Geometry_"+u.id+".usd";if(!e.file(d)){let f=qe(u);e.file(d,Je(f))}b.uuid in i||(i[b.uuid]=b),n+=Ze(m,u,b)}),n+=tt(i,s),e.file(r,n),n=null;for(let h in s){let m=s[h],u=h.split("_")[1],b=m.format===M.RGBAFormat,d=Qe(m.image,u),c=await(await new Promise(x=>d.toBlob(v=>v&&x(v),b?"image/png":"image/jpeg",1))).arrayBuffer();e.file(`textures/Texture_${h}.${b?"png":"jpg"}`,c)}let l=0;e.forEach(async h=>{let m=34+h.length;l+=m;let u=l&63,b=await e.file(h).async("uint8array");if(u!==4){let d=64-u,f=new Uint8Array(d),c=new Uint8Array(b.length+d);c.set(b,0),c.set(f,b.length),e.file(h,c)}l+=b.length});let p=await e.generateAsync({type:"blob",compression:"STORE"});return new Uint8Array(await p.arrayBuffer())}};function Qe(t,a){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){let e=1024/Math.max(t.width,t.height),r=document.createElement("canvas");r.width=t.width*Math.min(1,e),r.height=t.height*Math.min(1,e);let n=r.getContext("2d");if(n.imageSmoothingEnabled=!1,n.drawImage(t,0,0,r.width,r.height),a!==void 0){let i=parseInt(a,16),s=(i>>16&255)/255,l=(i>>8&255)/255,p=(i&255)/255,h=n.getImageData(0,0,r.width,r.height),m=h.data;for(let u=0;u +) +{ + matrix4d xformOp:transform = ${n} + uniform token[] xformOpOrder = ["xformOp:transform"] + + rel material:binding = +} + +`}function We(t){let a=t.elements;return`( ${G(a,0)}, ${G(a,4)}, ${G(a,8)}, ${G(a,12)} )`}function G(t,a){return`(${t[a+0]}, ${t[a+1]}, ${t[a+2]}, ${t[a+3]})`}function qe(t){return` +def "Geometry" +{ + ${Xe(t)} +} +`}function Xe(t){let a="Geometry",e=t.attributes,r=e.position.count;return` + def Mesh "${a}" + { + int[] faceVertexCounts = [${Ye(t)}] + int[] faceVertexIndices = [${Ke(t)}] + normal3f[] normals = [${pe(e.normal,r)}] ( + interpolation = "vertex" + ) + point3f[] points = [${pe(e.position,r)}] + float2[] primvars:st = [${et(e.uv,r)}] ( + interpolation = "vertex" + ) + uniform token subdivisionScheme = "none" + } +`}function Ye(t){let a=t.index!==null?t.index.count:t.attributes.position.count;return Array(a/3).fill(3).join(", ")}function Ke(t){let a=t.index,e=[];if(a!==null)for(let r=0;r + float2 inputs:scale = ${fe(l.repeat)} + float2 inputs:translation = ${fe(l.offset)} + float2 outputs:result + } + + def Shader "Texture_${l.id}_${p}" + { + uniform token info:id = "UsdUVTexture" + asset inputs:file = @textures/Texture_${m}.${u?"png":"jpg"}@ + float2 inputs:st.connect = + token inputs:wrapS = "repeat" + token inputs:wrapT = "repeat" + float outputs:r + float outputs:g + float outputs:b + float3 outputs:rgb + }`}let s=t;if(s.map!==null?(r.push(`${e}color3f inputs:diffuseColor.connect = `),n.push(i(s.map,"diffuse",s.color))):r.push(`${e}color3f inputs:diffuseColor = ${ge(s.color)}`),s.emissiveMap!==null?(r.push(`${e}color3f inputs:emissiveColor.connect = `),n.push(i(s.emissiveMap,"emissive"))):s.emissive.getHex()>0&&r.push(`${e}color3f inputs:emissiveColor = ${ge(s.emissive)}`),s.normalMap!==null&&(r.push(`${e}normal3f inputs:normal.connect = `),n.push(i(s.normalMap,"normal"))),s.aoMap!==null&&(r.push(`${e}float inputs:occlusion.connect = `),n.push(i(s.aoMap,"occlusion"))),s.roughnessMap!==null&&s.roughness===1?(r.push(`${e}float inputs:roughness.connect = `),n.push(i(s.roughnessMap,"roughness"))):r.push(`${e}float inputs:roughness = ${s.roughness}`),s.metalnessMap!==null&&s.metalness===1?(r.push(`${e}float inputs:metallic.connect = `),n.push(i(s.metalnessMap,"metallic"))):r.push(`${e}float inputs:metallic = ${s.metalness}`),s.alphaMap!==null?(r.push(`${e}float inputs:opacity.connect = `),r.push(`${e}float inputs:opacityThreshold = 0.0001`),n.push(i(s.alphaMap,"opacity"))):r.push(`${e}float inputs:opacity = ${s.opacity}`),s.isMeshPhysicalMaterial){let l=s;r.push(`${e}float inputs:clearcoat = ${l.clearcoat}`),r.push(`${e}float inputs:clearcoatRoughness = ${l.clearcoatRoughness}`),r.push(`${e}float inputs:ior = ${l.ior}`)}return` + def Material "Material_${s.id}" + { + def Shader "PreviewSurface" + { + uniform token info:id = "UsdPreviewSurface" +${r.join(` +`)} + int inputs:useSpecularWorkflow = 0 + token outputs:surface + } + + token outputs:surface.connect = + token inputs:frame:stPrimvarName = "st" + + def Shader "uvReader_st" + { + uniform token info:id = "UsdPrimvarReader_float2" + token inputs:varname.connect = + float2 inputs:fallback = (0.0, 0.0) + float2 outputs:result + } + +${n.join(` +`)} + + } +`}function ge(t){return`(${t.r}, ${t.g}, ${t.b})`}function fe(t){return`(${t.x}, ${t.y})`}var be=X;w.push(()=>{let t=new Codec("usdz",{extension:"usdz",name:"USDZ",remember:!0,export_options:{},fileName(){return I()+".usdz"},async compile(a={}){if(!Project)throw new Error("No project loaded");let e=Object.assign(this.getExportOptions(),a),r=new be,n=new M.Scene;n.name="blockbench_export",n.add(Project.model_3d);let i=await r.parse(n);return this.dispatchEvent("compile",{model:i,options:e}),Canvas.scene.add(Project.model_3d),i},async export(){let a=await this.compile();Blockbench.export({content:a,name:this.fileName(),startpath:this.startPath(),resource_id:"usdz",type:this.name,extensions:["usdz"],savetype:"buffer"},e=>this.afterDownload(e))}});o.exportUsdz=new Action("export_usdz",{category:"file",name:"Export USDZ",description:"Exports the current model as a USDZ file",icon:"file_download",async click(){t&&await t.export()}}),o.usdz=t,MenuBar.addAction(o.exportUsdz,"file.export")});P.push(()=>{MenuBar.removeAction("file.export_usdz")});var V=class t{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(g).map(e=>[e,g[e].default??new M.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([e,r])=>[e,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let e=Math.min(1,Math.max(0,a));return new M.Color(e,e,e).convertSRGBToLinear()}static fromSettings(){let a="#000000",e=Number(o.brushMetalnessSlider?.get()),r=Number(o.brushRoughnessSlider?.get()??1),n=(o.brushEmissiveColor?.get()??a).toString(),i=Number(o.brushHeightSlider?.get()),s=ColorPanel.get(),l={[g.albedo.id]:new M.Color(s),[g.metalness.id]:t.makeLinearColor(e),[g.roughness.id]:t.makeLinearColor(r),[g.emissive.id]:new M.Color(n??a),[g.height.id]:t.makeLinearColor(i),[g.normal.id]:g.normal.default??new M.Color("#8080ff")};return new t({colors:l})}};var Me="materialBrushPresets",Y=()=>JSON.parse(localStorage.getItem(Me)||"{}"),rt=(t,a)=>{let e=Y(),r=a??guid(),n=o.userMaterialBrushPresets?.getFormResult()??{},i={};return n.albedo&&(i.albedo=n.albedo.toString()),n.metalness&&(i.metalness=Number(n.metalness)),n.roughness&&(i.roughness=Number(n.roughness)),n.emissive&&(i.emissive=n.emissive.toString()),n.height&&(i.height=Number(n.height)),e[r]=[i,t??"New Preset",U(i)],localStorage.setItem(Me,JSON.stringify(e)),r},ve=({metalness:t,roughness:a,emissive:e,height:r,albedo:n})=>{t!==void 0&&o.brushMetalnessSlider?.setValue(t||0,!0),a!==void 0&&o.brushRoughnessSlider?.setValue(a??1,!0),e!==void 0&&o.brushEmissiveColor?.set(e??"#000000"),r!==void 0&&o.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},Q=({id:t})=>Condition({project:!0,tools:["material_brush"],method(){let a=S();return(a?.layers_enabled&&a.layers.find(({channel:e})=>e&&e===t)!==void 0)===!0}}),nt=ae.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:g}},methods:{applyPreset(t){try{let[a,e]=this.userPresets[t],{metalness:r,roughness:n,emissive:i,height:s,albedo:l}=a;ve({metalness:Number(r),roughness:Number(n),emissive:i.toString(),height:Number(s),albedo:l.toString()}),o.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${e}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(t){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let e=Y(),r=this.userPresets[t][1]??t;delete e[t],localStorage.setItem("materialBrushPresets",JSON.stringify(e)),this.userPresets=e,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(t){o.userMaterialBrushPresets?.setFormValues({name:this.userPresets[t][1]??t,...this.userPresets[t][0]})},getSummary(t){return Object.entries(t).filter(([a])=>a in this.channels).map(([a,e])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${e}`:`${this.channels[a]?.label??a}: ${Number(e).toFixed(1)}`).join(` +`)}},computed:{presets(){return Object.entries(this.userPresets)}},mounted(){this.userPresets=Y()},template:`
      -
      `});C.push(()=>{s.materialBrushStyles=Blockbench.addCSS(` +
    `});w.push(()=>{o.materialBrushStyles=Blockbench.addCSS(` .preset_list { display: grid; grid-template-columns: repeat(auto-fill, 96px); @@ -102,4 +197,4 @@ .delete_preset:hover .material-icons { color: var(--color-accent); - }`),s.brushMetalnessSlider=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",tool_setting:"brush_metalness",settings:{min:0,max:1,step:.01,default:0},condition:()=>z(u.metalness)}),s.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",tool_setting:"brush_roughness",settings:{min:0,max:1,step:.01,default:1},condition:()=>z(u.roughness)}),s.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",tool_setting:"brush_emissive",condition:()=>z(u.emissive)}),s.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",tool_setting:"brush_height",settings:{min:0,max:1,step:.01,default:.5},condition:()=>z(u.height)}),s.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",category:"tools",toolbar:"brush",condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){return D()?.layers_enabled??!1}},allowed_view_modes:"textured",tool_settings:{brush_metalness:0,brush_roughness:1,brush_emissive:"#000000",brush_height:.5},brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(t,a,e,r,{size:n,softness:c,texture:i,x:o,y:p}){let f=O.fromSettings(),x=Object.keys(f.colors),h=Math.floor(n-c*n/100),_=e;return i.layers.forEach(m=>{if(!m.visible||!x.includes(m.channel))return;let g=f.getChannel(m.channel);if(!g)return;let l=Math.sqrt((o-t)**2+(p-a)**2),d=Math.min(1,l/h);if(o%h<=d&&p%h<=d){let v=m.ctx.getImageData(t,a,1,1).data,M=new b.Color(`rgb(${v[0]}, ${v[1]}, ${v[2]})`);g.lerp(M,1)}m.ctx.fillStyle=g.getStyle(),m.ctx.fillRect(t,a,1,1),m.selected&&(_={r:g.r*255,g:g.g*255,b:g.b*255,a:r*255})}),_}},onCanvasClick(t){Painter.startPaintToolCanvas(t,t.event)},onSelect(){Painter.updateNslideValues(),A()},click(){B()}}),s.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:{project:!0},click(){s.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:He,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(t){me({metalness:Number(t.metalness??s.brushMetalnessSlider?.get()),roughness:Number(t.roughness??s.brushRoughnessSlider?.get()),emissive:(t.emissive??s.brushEmissiveColor?.get()).toString(),height:Number(t.height??s.brushHeightSlider?.get()),albedo:(t.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(t,a){s.materialBrushTool?.select(),t===1&&Blockbench.textPrompt("Save Preset","New Preset",e=>{e&&(Ie(e),Blockbench.showQuickMessage(`Preset "${e}" saved`,2e3))})}}).show()}}),MenuBar.addAction(s.materialBrushTool,"tools.0")});L.push(()=>{MenuBar.removeAction("tools.material_brush")});C.push(()=>{s.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","load_brush_preset","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Settings"})],condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});C.push(()=>{s.displaySettingsPanel=new Panel("display_settings",{name:"PBR Controls",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure","show_channel_select_menu"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});(()=>{let t=()=>{C.forEach(e=>e())},a=()=>{F(),L.forEach(e=>e()),Object.entries(s).forEach(([e,r])=>{try{r?.delete()}catch(n){console.warn(`Failed to delete ${e} action:`,n)}})};BBPlugin.register("pbr_preview",{version:"1.1.0",title:"PBR Tools",author:"Jason J. Gardner",description:"Create and view PBR materials in Blockbench. Export textures for Java and RenderDragon shaders.",tags:["Minecraft: Java Edition","Minecraft: Bedrock Edition","PBR"],icon:"icon.png",variant:"both",await_loading:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.3",onload:t,onunload:a})})();})(); + }`),o.brushMetalnessSlider=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",tool_setting:"brush_metalness",settings:{min:0,max:1,step:.01,default:0},condition:()=>Q(g.metalness)}),o.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",tool_setting:"brush_roughness",settings:{min:0,max:1,step:.01,default:1},condition:()=>Q(g.roughness)}),o.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",tool_setting:"brush_emissive",condition:()=>Q(g.emissive)}),o.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",tool_setting:"brush_height",settings:{min:0,max:1,step:.01,default:.5},condition:()=>Q(g.height)}),o.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",category:"tools",toolbar:"brush",condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){return S()?.layers_enabled??!1}},allowed_view_modes:"textured",tool_settings:{brush_metalness:0,brush_roughness:1,brush_emissive:"#000000",brush_height:.5},brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(t,a,e,r,{size:n,softness:i,texture:s,x:l,y:p}){let h=V.fromSettings(),m=Object.keys(h.colors),u=Math.floor(n-i*n/100),b=e;return s.layers.forEach(d=>{if(!d.visible||!m.includes(d.channel))return;let f=h.getChannel(d.channel);if(!f)return;let c=Math.sqrt((l-t)**2+(p-a)**2),x=Math.min(1,c/u);if(l%u<=x&&p%u<=x){let v=d.ctx.getImageData(t,a,1,1).data,_=new M.Color(`rgb(${v[0]}, ${v[1]}, ${v[2]})`);f.lerp(_,1)}d.ctx.fillStyle=f.getStyle(),d.ctx.fillRect(t,a,1,1),d.selected&&(b={r:f.r*255,g:f.g*255,b:f.b*255,a:r*255})}),b}},onCanvasClick(t){Painter.startPaintToolCanvas(t,t.event)},onSelect(){Painter.updateNslideValues(),R()},click(){B()}}),o.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:{project:!0},click(){o.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:nt,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(t){ve({metalness:Number(t.metalness??o.brushMetalnessSlider?.get()),roughness:Number(t.roughness??o.brushRoughnessSlider?.get()),emissive:(t.emissive??o.brushEmissiveColor?.get()).toString(),height:Number(t.height??o.brushHeightSlider?.get()),albedo:(t.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(t,a){o.materialBrushTool?.select(),t===1&&Blockbench.textPrompt("Save Preset","New Preset",e=>{e&&(rt(e),Blockbench.showQuickMessage(`Preset "${e}" saved`,2e3))})}}).show()}}),MenuBar.addAction(o.materialBrushTool,"tools.0")});P.push(()=>{MenuBar.removeAction("tools.material_brush")});w.push(()=>{o.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","load_brush_preset","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Settings"})],condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});w.push(()=>{o.displaySettingsPanel=new Panel("display_settings",{name:"PBR Controls",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure","show_channel_select_menu"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});(()=>{let t=()=>{w.forEach(e=>e())},a=()=>{z(),P.forEach(e=>e()),Object.entries(o).forEach(([e,r])=>{try{r?.delete()}catch(n){console.warn(`Failed to delete ${e} action:`,n)}})};BBPlugin.register("pbr_preview",{version:"1.1.0",title:"PBR Tools",author:"Jason J. Gardner",description:"Create and view PBR materials in Blockbench. Export textures for Java and RenderDragon shaders.",tags:["Minecraft: Java Edition","Minecraft: Bedrock Edition","PBR"],icon:"icon.png",variant:"both",await_loading:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.3",onload:t,onunload:a})})();})(); diff --git a/src/pbr_preview/src/lib/actions/materialTexture.ts b/src/pbr_preview/src/lib/actions/materialTexture.ts index 7fbbfa20..90da9377 100644 --- a/src/pbr_preview/src/lib/actions/materialTexture.ts +++ b/src/pbr_preview/src/lib/actions/materialTexture.ts @@ -127,30 +127,14 @@ setups.push(() => { texture.updateChangesAfterEdit(); Undo.finishEdit("Create Material Texture"); - - if (mat) { - texture.updateSource(generatePreviewImage(mat.getMaterial())); - } }, }); - Blockbench.on("save_project", function generateMaterialThumbnail() { - Texture.all.map((texture) => { - if (!texture.material) { - return; - } - - const mat = new PbrMaterial(texture.layers, texture.uuid); - - texture.updateSource(generatePreviewImage(mat.getMaterial())); - }); - }); - MenuBar.addAction(registry.createMaterialTexture, "tools"); Toolbars.texturelist.add(registry.createMaterialTexture, 3); }); teardowns.push(() => { MenuBar.removeAction("tools.create_material_texture"); - Toolbars.texturelist.remove("tools.create_material_texture"); + Toolbars.texturelist.remove("create_material_texture"); }); diff --git a/src/pbr_preview/src/lib/io/UsdzExporter.ts b/src/pbr_preview/src/lib/io/UsdzExporter.ts index e55a7c12..d7fd6b68 100644 --- a/src/pbr_preview/src/lib/io/UsdzExporter.ts +++ b/src/pbr_preview/src/lib/io/UsdzExporter.ts @@ -1,10 +1,5 @@ import { three as THREE, jszip as JSZip } from "../../deps"; -/** - * USDZ Exporter - * Based on DragonFly's USDZExporter - * @see https://github.com/GitHubDragonFly/GitHubDragonFly.github.io/blob/5dcb6d313aa73373d54997e616d5ade8168c408d/viewers/static/js/exporters/USDZExporter.js - */ class USDZExporter { async parse(scene: THREE.Scene): Promise { const zip = new JSZip(); From e792e53ad0947451afbf2a91f8bfb87d1b76ed3a Mon Sep 17 00:00:00 2001 From: Jason Gardner Date: Mon, 17 Jun 2024 18:53:09 -0500 Subject: [PATCH 25/50] upd: Apply PBR on USDZ export --- plugins/pbr_preview/pbr_preview.js | 2 +- src/pbr_preview/src/lib/actions/usdz.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index dcb47e71..8f6b48aa 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -93,7 +93,7 @@ ${n.join(` `)} } -`}function ge(t){return`(${t.r}, ${t.g}, ${t.b})`}function fe(t){return`(${t.x}, ${t.y})`}var be=X;w.push(()=>{let t=new Codec("usdz",{extension:"usdz",name:"USDZ",remember:!0,export_options:{},fileName(){return I()+".usdz"},async compile(a={}){if(!Project)throw new Error("No project loaded");let e=Object.assign(this.getExportOptions(),a),r=new be,n=new M.Scene;n.name="blockbench_export",n.add(Project.model_3d);let i=await r.parse(n);return this.dispatchEvent("compile",{model:i,options:e}),Canvas.scene.add(Project.model_3d),i},async export(){let a=await this.compile();Blockbench.export({content:a,name:this.fileName(),startpath:this.startPath(),resource_id:"usdz",type:this.name,extensions:["usdz"],savetype:"buffer"},e=>this.afterDownload(e))}});o.exportUsdz=new Action("export_usdz",{category:"file",name:"Export USDZ",description:"Exports the current model as a USDZ file",icon:"file_download",async click(){t&&await t.export()}}),o.usdz=t,MenuBar.addAction(o.exportUsdz,"file.export")});P.push(()=>{MenuBar.removeAction("file.export_usdz")});var V=class t{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(g).map(e=>[e,g[e].default??new M.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([e,r])=>[e,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let e=Math.min(1,Math.max(0,a));return new M.Color(e,e,e).convertSRGBToLinear()}static fromSettings(){let a="#000000",e=Number(o.brushMetalnessSlider?.get()),r=Number(o.brushRoughnessSlider?.get()??1),n=(o.brushEmissiveColor?.get()??a).toString(),i=Number(o.brushHeightSlider?.get()),s=ColorPanel.get(),l={[g.albedo.id]:new M.Color(s),[g.metalness.id]:t.makeLinearColor(e),[g.roughness.id]:t.makeLinearColor(r),[g.emissive.id]:new M.Color(n??a),[g.height.id]:t.makeLinearColor(i),[g.normal.id]:g.normal.default??new M.Color("#8080ff")};return new t({colors:l})}};var Me="materialBrushPresets",Y=()=>JSON.parse(localStorage.getItem(Me)||"{}"),rt=(t,a)=>{let e=Y(),r=a??guid(),n=o.userMaterialBrushPresets?.getFormResult()??{},i={};return n.albedo&&(i.albedo=n.albedo.toString()),n.metalness&&(i.metalness=Number(n.metalness)),n.roughness&&(i.roughness=Number(n.roughness)),n.emissive&&(i.emissive=n.emissive.toString()),n.height&&(i.height=Number(n.height)),e[r]=[i,t??"New Preset",U(i)],localStorage.setItem(Me,JSON.stringify(e)),r},ve=({metalness:t,roughness:a,emissive:e,height:r,albedo:n})=>{t!==void 0&&o.brushMetalnessSlider?.setValue(t||0,!0),a!==void 0&&o.brushRoughnessSlider?.setValue(a??1,!0),e!==void 0&&o.brushEmissiveColor?.set(e??"#000000"),r!==void 0&&o.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},Q=({id:t})=>Condition({project:!0,tools:["material_brush"],method(){let a=S();return(a?.layers_enabled&&a.layers.find(({channel:e})=>e&&e===t)!==void 0)===!0}}),nt=ae.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:g}},methods:{applyPreset(t){try{let[a,e]=this.userPresets[t],{metalness:r,roughness:n,emissive:i,height:s,albedo:l}=a;ve({metalness:Number(r),roughness:Number(n),emissive:i.toString(),height:Number(s),albedo:l.toString()}),o.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${e}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(t){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let e=Y(),r=this.userPresets[t][1]??t;delete e[t],localStorage.setItem("materialBrushPresets",JSON.stringify(e)),this.userPresets=e,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(t){o.userMaterialBrushPresets?.setFormValues({name:this.userPresets[t][1]??t,...this.userPresets[t][0]})},getSummary(t){return Object.entries(t).filter(([a])=>a in this.channels).map(([a,e])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${e}`:`${this.channels[a]?.label??a}: ${Number(e).toFixed(1)}`).join(` +`}function ge(t){return`(${t.r}, ${t.g}, ${t.b})`}function fe(t){return`(${t.x}, ${t.y})`}var be=X;w.push(()=>{let t=new Codec("usdz",{extension:"usdz",name:"USDZ",remember:!0,export_options:{},fileName(){return I()+".usdz"},async compile(a={}){if(!Project)throw new Error("No project loaded");R();let e=Object.assign(this.getExportOptions(),a),r=new be,n=new M.Scene;n.name="blockbench_export",n.add(Project.model_3d);let i=await r.parse(n);return this.dispatchEvent("compile",{model:i,options:e}),Canvas.scene.add(Project.model_3d),i},async export(){let a=await this.compile();Blockbench.export({content:a,name:this.fileName(),startpath:this.startPath(),resource_id:"usdz",type:this.name,extensions:["usdz"],savetype:"buffer"},e=>this.afterDownload(e))}});o.exportUsdz=new Action("export_usdz",{category:"file",name:"Export USDZ",description:"Exports the current model as a USDZ file",icon:"file_download",async click(){t&&await t.export()}}),o.usdz=t,MenuBar.addAction(o.exportUsdz,"file.export")});P.push(()=>{MenuBar.removeAction("file.export_usdz")});var V=class t{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(g).map(e=>[e,g[e].default??new M.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([e,r])=>[e,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let e=Math.min(1,Math.max(0,a));return new M.Color(e,e,e).convertSRGBToLinear()}static fromSettings(){let a="#000000",e=Number(o.brushMetalnessSlider?.get()),r=Number(o.brushRoughnessSlider?.get()??1),n=(o.brushEmissiveColor?.get()??a).toString(),i=Number(o.brushHeightSlider?.get()),s=ColorPanel.get(),l={[g.albedo.id]:new M.Color(s),[g.metalness.id]:t.makeLinearColor(e),[g.roughness.id]:t.makeLinearColor(r),[g.emissive.id]:new M.Color(n??a),[g.height.id]:t.makeLinearColor(i),[g.normal.id]:g.normal.default??new M.Color("#8080ff")};return new t({colors:l})}};var Me="materialBrushPresets",Y=()=>JSON.parse(localStorage.getItem(Me)||"{}"),rt=(t,a)=>{let e=Y(),r=a??guid(),n=o.userMaterialBrushPresets?.getFormResult()??{},i={};return n.albedo&&(i.albedo=n.albedo.toString()),n.metalness&&(i.metalness=Number(n.metalness)),n.roughness&&(i.roughness=Number(n.roughness)),n.emissive&&(i.emissive=n.emissive.toString()),n.height&&(i.height=Number(n.height)),e[r]=[i,t??"New Preset",U(i)],localStorage.setItem(Me,JSON.stringify(e)),r},ve=({metalness:t,roughness:a,emissive:e,height:r,albedo:n})=>{t!==void 0&&o.brushMetalnessSlider?.setValue(t||0,!0),a!==void 0&&o.brushRoughnessSlider?.setValue(a??1,!0),e!==void 0&&o.brushEmissiveColor?.set(e??"#000000"),r!==void 0&&o.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},Q=({id:t})=>Condition({project:!0,tools:["material_brush"],method(){let a=S();return(a?.layers_enabled&&a.layers.find(({channel:e})=>e&&e===t)!==void 0)===!0}}),nt=ae.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:g}},methods:{applyPreset(t){try{let[a,e]=this.userPresets[t],{metalness:r,roughness:n,emissive:i,height:s,albedo:l}=a;ve({metalness:Number(r),roughness:Number(n),emissive:i.toString(),height:Number(s),albedo:l.toString()}),o.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${e}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(t){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let e=Y(),r=this.userPresets[t][1]??t;delete e[t],localStorage.setItem("materialBrushPresets",JSON.stringify(e)),this.userPresets=e,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(t){o.userMaterialBrushPresets?.setFormValues({name:this.userPresets[t][1]??t,...this.userPresets[t][0]})},getSummary(t){return Object.entries(t).filter(([a])=>a in this.channels).map(([a,e])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${e}`:`${this.channels[a]?.label??a}: ${Number(e).toFixed(1)}`).join(` `)}},computed:{presets(){return Object.entries(this.userPresets)}},mounted(){this.userPresets=Y()},template:`
      diff --git a/src/pbr_preview/src/lib/actions/usdz.ts b/src/pbr_preview/src/lib/actions/usdz.ts index 250fed95..83d84584 100644 --- a/src/pbr_preview/src/lib/actions/usdz.ts +++ b/src/pbr_preview/src/lib/actions/usdz.ts @@ -2,6 +2,7 @@ import { registry, setups, teardowns } from "../../constants"; import { three as THREE } from "../../deps"; import { getOutputBaseName } from "../util"; import USDZExporter from "../io/UsdzExporter"; +import { applyPbrMaterial } from "../applyPbrMaterial"; setups.push(() => { const usdz = new Codec("usdz", { @@ -17,12 +18,16 @@ setups.push(() => { throw new Error("No project loaded"); } + applyPbrMaterial(); + const options = Object.assign(this.getExportOptions(), compileOptions); const exporter = new USDZExporter(); const scene = new THREE.Scene(); + scene.name = "blockbench_export"; scene.add(Project.model_3d); + const result = await exporter.parse(scene); this.dispatchEvent("compile", { model: result, options }); From fd66faa62202ae061fcf0b60d8649fbf4304b992 Mon Sep 17 00:00:00 2001 From: Jason Gardner Date: Mon, 17 Jun 2024 18:54:59 -0500 Subject: [PATCH 26/50] upd: Change material texture icon --- plugins/pbr_preview/pbr_preview.js | 2 +- src/pbr_preview/src/lib/actions/materialTexture.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index 8f6b48aa..5e8978e0 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1,4 +1,4 @@ -"use strict";(()=>{var M=THREE,ae=Vue,re=window.JSZip;var A="_NONE_",g={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new M.Color(16777215),regex:new RegExp("(s|_)*(basecolor|color|albedo)","i")},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new M.Color(0),regex:new RegExp("[ _]*metal(lic|ness)?","i")},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new M.Color(0),regex:new RegExp("[ _]*(emissive|emission)","i")},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new M.Color(16777215),regex:new RegExp("[ _]*rough(ness)?","i")},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new M.Color(16777215),regex:new RegExp("[ _]*(height|bump)","i")},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new M.Color("rgb(128, 128, 255)"),regex:new RegExp("[ _]*normal","i")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new M.Color(16777215),regex:new RegExp("[ _]*(ao|ambientocclusion|ambient occlusion)","i")}},o={},w=[],P=[];var ne=[...Object.keys(g).map(t=>g[t].id),A];w.push(()=>{o.channelProp=new Property(TextureLayer,"enum","channel",{default:A,values:ne,label:"PBR Channel",exposed:!1}),o.textureChannelProp=new Property(Texture,"enum","channel",{default:A,values:ne,label:"PBR Channel",exposed:!1}),o.materialTextureProp=new Property(Texture,"boolean","material",{default:!1,label:"Material Texture"}),o.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),o.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),o.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!1,values:[],label:"PBR Mode"})});function S(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(t=>t.selected)??null:Texture.all.find(t=>t.selected)??Texture.getDefault()}function N(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(t=>t.selected)??Project.selected_texture.layers[0]:S()?.getActiveLayer()??null}function I(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(S()?.name??"texture")}function se(t,a){let e;return function(...r){let n=()=>{e=void 0,t.apply(this,r)};clearTimeout(e),e=setTimeout(n,a)}}function U(t){let a=MediaPreview.renderer??new M.WebGLRenderer({alpha:!0,antialias:!0}),e=new M.Scene,r=new M.PerspectiveCamera(75,96/96,.1,1e3),n=new M.AmbientLight(16777215,.75);e.add(n);let i=new M.PointLight(16777215,1,100);i.position.set(5,5,5),e.add(i);let s=new M.SphereGeometry(1,32,32),l=t instanceof M.MeshStandardMaterial&&t.isMeshStandardMaterial?t:new M.MeshStandardMaterial({color:t.albedo,metalness:t.metalness??0,roughness:t.roughness??1,emissive:t.emissive,bumpScale:t.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),p=new M.Mesh(s,l);e.add(p),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(e,r);let h=a.domElement.toDataURL();return l.dispose(),MediaPreview.renderer||(a.clear(),a.dispose()),h}function J(t,a){let e=a??document.createElement("canvas"),r=e.getContext("2d");if(!r)return e.remove(),null;let n=Math.max(Project?Project.texture_width:16,16),i=Math.max(Project?Project.texture_height:16,16);e.width=n,e.height=i,r.fillStyle=`rgb(${t.r*255}, ${t.g*255}, ${t.b*255})`,r.fillRect(0,0,n,i);let s=e.toDataURL();return a||e.remove(),s}var Ie=(t=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return t?a.filter(e=>e.layers_enabled&&e.layers.length>0).flatMap(e=>e.layers):a},D=class t{constructor(a,e){this._scope=a??Ie(),this._materialUuid=e}merToCanvas(){let a=this.getTexture(g.emissive),e=this.getTexture(g.roughness),r=this.getTexture(g.metalness);if(!a&&!e&&!r){let{metalness:n,emissive:i,roughness:s}=this.decodeMer();n&&(r=t.makePixelatedCanvas(n)),i&&(a=t.makePixelatedCanvas(i)),s&&(e=t.makePixelatedCanvas(s))}return{emissiveMap:a,roughnessMap:e,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:e,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(g.emissive),roughnessMap:this.getTexture(g.roughness),metalnessMap:this.getTexture(g.metalness)},i=this.getTexture(g.normal);return new M.MeshStandardMaterial({map:this.getTexture(g.albedo)??t.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(s=>s.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(g.ao),bumpMap:this.getTexture(g.height),normalMap:i,normalScale:new M.Vector2(-1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:e,emissiveIntensity:e?1:0,emissive:e?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}renderMaterialPreview(){return U(this.getMaterial())}saveTexture(a,e){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=e.uuid,e.extend({channel:a.id}))}findTexture(a,e=!0){if(!Project)return null;let r=this._scope.find(p=>p.channel&&(p.channel===a||p.channel===a.id));if(r)return r;let[n,i]=typeof a=="string"?[a,new RegExp(`_*${a}(.[^.]+)?$`,"i")]:[a.id,a.regex??new RegExp(`_*${a.id}(.[^.]+)?$`,"i")];Project.pbr_materials=Project.pbr_materials??{};let s=Project.pbr_materials[this._materialUuid];if(e&&!s&&n!==A)return this._scope.find(p=>i?.test(p.name))??null;let l=s?.[n];return l?this._scope.find(p=>p.uuid===l)??null:null}static makePixelatedCanvas(a){let e=new M.CanvasTexture(a,void 0,void 0,void 0,M.NearestFilter,M.NearestFilter);return e.needsUpdate=!0,e}getTexture(a){let e=this.findTexture(a);return e?t.makePixelatedCanvas(e.canvas):null}static extractChannel(a,e){let r=a.canvas,{width:n,height:i}=r,s=r.getContext("2d");if(!s||!n||!i)return null;let l=document.createElement("canvas");l.width=n,l.height=i;let p=l.getContext("2d");if(!p)return null;let h={r:0,g:1,b:2,a:3}[e],{data:m}=s.getImageData(0,0,n,i),u=new Uint8ClampedArray(n*i*4);for(let d=0;da){f[c]=b.data[c],f[c+1]=b.data[c+1],f[c+2]=b.data[c+2],f[c+3]=255;continue}f[c]=0,f[c+1]=0,f[c+2]=0,f[c+3]=255}return h.putImageData(new ImageData(f,l.width,l.height),0,0),{metalness:r,emissive:l,emissiveLevel:n,roughness:i,sss:s}}createMer(a=!1){let e=this.findTexture(g.metalness,a),r=this.findTexture(g.emissive,a),n=this.findTexture(g.roughness,a),i=this.findTexture("sss",!1),s=Math.max(e?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),l=Math.max(e?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),p=document.createElement("canvas");p.width=s,p.height=l;let h=p.getContext("2d");if(!h)return null;let m=e?.img?t.extractChannel(e,"r"):null,u=r?.img?t.extractChannel(r,"g"):null,b=n?.img?t.extractChannel(n,"b"):null,d=i&&i?.img?t.extractChannel(i,"a"):null,f=m?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),c=u?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),x=b?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),v=d?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(new Uint8ClampedArray(s*l*4).fill(255),s,l),_=new Uint8ClampedArray(s*l*4);for(let y=0;y<_.length;y+=4)_[y]=f.data[y],_[y+1]=c.data[y],_[y+2]=x.data[y],_[y+3]=v.data[y];return h.putImageData(new ImageData(_,s,l),0,0),p}createLabPbrOutput(a=!0){let e=this.findTexture(g.metalness,a),r=this.findTexture(g.emissive,a),n=this.findTexture(g.roughness,a),i=this.findTexture(g.normal,a),s=this.findTexture(g.height,a),l=this.findTexture(g.ao,!1),p=this.findTexture("sss",!0),h=this.findTexture("porosity",!0),m=Math.max(e?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),u=Math.max(e?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),b=document.createElement("canvas");b.width=m,b.height=u;let d=b.getContext("2d"),f=document.createElement("canvas");f.width=m,f.height=u;let c=f.getContext("2d");if(!d||!c)return null;let x=new Uint8ClampedArray(m*u*4),v=new Uint8ClampedArray(m*u*4),_=e?.canvas,y=r?.canvas,k=n?.canvas,T=p?.canvas,L=h?.canvas,C=_?.getContext("2d"),j=y?.getContext("2d"),_e=k?.getContext("2d"),ye=T?.getContext("2d"),we=L?.getContext("2d"),Te=C?.getImageData(0,0,m,u),H=j?.getImageData(0,0,m,u),K=_e?.getImageData(0,0,m,u),Ce=ye?.getImageData(0,0,m,u),Ee=we?.getImageData(0,0,m,u);for(let E=0;E{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),e}createTexturesFromNormal(a){let e=this.decodeLabPbrNormal(a);return Object.entries(e).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),e}};var O=class{constructor({lightHeight:a=.66,ambientLight:e=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:n=[1,1,1]}={}){this.lightHeight=a,this.ambientLight=e,this.minLightIntensity=r,this.lightDiffuse=n}bake(a,e,r){let n=e instanceof HTMLCanvasElement?e:this.createCanvas(e.width,e.height),i=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),s=n.getContext("2d"),l=i.getContext("2d");s.drawImage(e,0,0),l.drawImage(r,0,0);let p=s.getImageData(0,0,e.width,e.height),h=l.getImageData(0,0,r.width,r.height),m=[],u=[];for(let d=0;d{let f=this.createCanvas(e.width,e.height),c=f.getContext("2d"),x=c.getImageData(0,0,f.width,f.height),v=[Math.cos(d),Math.sin(d),this.lightHeight];for(let _=0;_{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new D(r.layers_enabled?r.layers:Project.textures,r.uuid),i=n.findTexture(g.albedo);if(!i){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let s=n.findTexture(g.normal);if(!s){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let p=new O(t).bake(a,i.canvas,s.canvas),h=new Texture({name:`${i.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(p[0].toDataURL()),m=e?u=>{let b=n.findTexture(g.emissive);if(!b)return u;let d=b.canvas;if(!d.getContext("2d"))return u;let c=Math.max(u.width,d.width,Project?Project.texture_width:16),x=Math.max(u.height,d.height,Project?Project.texture_height:16),v=document.createElement("canvas");v.width=c,v.height=x;let _=v.getContext("2d");return _?(_.drawImage(u,0,0),_.globalCompositeOperation="screen",_.drawImage(d,0,0),v):u}:u=>u;p.forEach((u,b)=>{new TextureLayer({name:`baked_${b+1}`,data_url:m(u).toDataURL()},h).addForEditing()}),h.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};w.push(()=>{o.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(t){let a=new M.Color(t.ambientLight.toString()),e=new M.Color(t.lightDiffuse.toString());oe({ambientLight:[a.r,a.g,a.b],lightDiffuse:[e.r,e.g,e.b],lightHeight:Number(t.lightHeight),minLightIntensity:Number(t.minLightIntensity)},t.directions??8,t.blendEmissive??!1)}}),o.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){o.bakeTexturesDialog?.show()}}),MenuBar.addAction(o.bakeTexturesAction,"tools")});P.push(()=>{MenuBar.removeAction("tools.bake_textures")});function ie(t,a){let e=t.getTexture();if(!e||!Project)return null;let r=Project.materials[e.uuid];r.isShaderMaterial&&!Project.bb_materials[e.uuid]?Project.bb_materials[e.uuid]=r:r.isMeshStandardMaterial&&r.dispose();let n=new D(e.layers_enabled?e.layers.filter(i=>i.visible)??null:Project.textures,e.uuid).getMaterial({side:Canvas.getRenderSide(e),...a});return Project.materials[e.uuid]=M.ShaderMaterial.prototype.copy.call(n,r),e}function le(t){return Object.values(t).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function Ue(t,a){let e={};return t.forAllFaces(r=>{let n=ie(r,a);n&&(e[n.uuid]=n)}),le(e)}function Oe(t,a){let e={};return Object.keys(t.faces).forEach(r=>{let n=t.faces[r],i=ie(n,a);i&&(e[i.uuid]=i)}),le(e)}var R=(t={})=>{Project&&(Project.pbr_active=Texture.all.length>0&&Project.elements.map(a=>a instanceof Mesh&&Ue(a,t)||a instanceof Cube&&Oe(a,t)).filter(Boolean).length>0)},B=(t=100)=>se(R,t);var W={},Z={};w.push(()=>{Object.entries(g).forEach(([t,a])=>{W[t]=new Action(`assign_channel_${t}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:{selected:{texture:!0},project:!0,method(){return S()?.material===!0&&N()!==null}},click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e)return;Undo.initEdit({layers:[e]}),e.extend({channel:a.id});let r=e instanceof TextureLayer?e.texture:e;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([n,i])=>{i===e.uuid&&(delete Project.pbr_materials[r.uuid][n],e.channel=A)}),r.uuid===e.uuid&&(Project.pbr_materials[r.uuid]={}),Project.pbr_materials[r.uuid][t]=e.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${e.name}" to ${a.label} channel`,2e3),R()}}),Z[t]=new Action(`select_channel_${t}`,{icon:a.icon??"tv_options_edit_channels",name:a.label??t,description:`Select the ${a.label} channel`,condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){let e=S();return(e?.layers_enabled?e.layers:Texture.all).some(n=>n.channel===t)}},click(){let e=Texture.selected?.layers_enabled?Texture.selected.layers:Texture.all;if(!e||!e.length)return;let r=e.find(n=>n.channel===t);r&&(r.select(),r.scrollTo())}}),Z[t].addLabel(!0,()=>a.label??t)})});P.push(()=>{[...Object.values(W),...Object.values(Z)].forEach(a=>{a.delete()})});w.push(()=>{o.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:{selected:{texture:!0},method(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);return t?.channel&&t.channel!==A}},click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t)return;Undo.initEdit({layers:[t]});let a=t instanceof TextureLayer?t.texture:t,e=t.channel;Project.pbr_materials[a.uuid]={},t.channel=A,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${t.name}" from ${e} channel`,2e3),B()}}),o.channelMenu=new Menu("channel_menu",[...Object.keys(g).map(t=>`assign_channel_${t}`),"unassign_channel"],{onOpen(){B()}}),o.channelSelectionMenu=new Menu("channel_selection_menu",Object.keys(g).map(t=>`select_channel_${t}`)),o.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",condition:{modes:["edit","paint"],selected:{texture:!0}},click(t){o.channelMenu?.open(t)},children:[...Object.values(W),o.unassignChannel]}),o.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(t){o.channelMenu?.open(t)}}),o.showChannelSelectionMenu=new Action("show_channel_select_menu",{icon:"tv_options_edit_channels",name:"Select PBR Channel",description:"Select a channel to view",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(t){o.channelSelectionMenu?.open(t)}}),o.openChannelMenu&&(MenuBar.addAction(o.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(o.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(o.openChannelMenu,"0")),Toolbars.layers.add(o.showChannelMenu,1)});P.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(o.showChannelMenu)});function q(t,a=!1){let e=t.canvas.getContext("2d");if(!e)return null;let r=Math.max(t.img.width??t.canvas.width,Project?Project.texture_width:0,16),n=Math.max(t.img.height??t.canvas.height,Project?Project.texture_height:0,16),{data:i}=e.getImageData(0,0,r,n),s=document.createElement("canvas"),l=s.getContext("2d");if(!l)return null;let p=(c,x)=>{let v=(c+x*r)*4;return i[v]/255};s.width=r,s.height=n,l.drawImage(t.img,0,0,r,n);let h=l.getImageData(0,0,r,n),m=h.data,u=c=>{let x=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);return[c[0]/x,c[1]/x,c[2]/x]};for(let c=0;c{let c=(d+f*e)*4;return n[c]/255};i.width=e,i.height=r,s.drawImage(t.img,0,0,e,r);let p=s.getImageData(0,0,e,r),h=p.data;for(let d=0;d{o.generateNormal=new Action("generate_normal",{icon:g.normal.icon??"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(N()??S())!==null,click(t){let a=N()??S()??Texture.getDefault();if(!a)return;let e=q(a);if(!e){Blockbench.showQuickMessage("Failed to generate normal map",2e3);return}e.select(t),new D(a instanceof Texture&&a.layers_enabled?a.layers:null,a.uuid).saveTexture(g.normal,e),Blockbench.showQuickMessage("Normal map generated",2e3)}}),o.generateAo=new Action("generate_ao",{icon:g.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let t=N()??S()??Texture.getDefault();if(!t)return;let a=new D(t instanceof Texture&&t.layers_enabled?t.layers:null,t.uuid),e=a.findTexture(g.normal)??q(t);if(!e){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=ce(e);if(r){a.saveTexture(g.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),MenuBar.addAction(o.generateNormal,"tools"),MenuBar.addAction(o.generateAo,"tools")});P.push(()=>{MenuBar.removeAction("tools.generate_normal")});var Fe=(t,a="texture")=>{t.toBlob(async e=>{e&&Blockbench.export({content:await e.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},ze=(t,a="texture")=>{t.toBlob(async e=>{e&&Blockbench.export({content:await e.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};w.push(()=>{o.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let t=S();if(!t)return;let e=new D(t.layers_enabled?t.layers:[t],t.uuid).createLabPbrOutput();if(e===null)return;let r=t.name??(Project?Project.getDisplayName():"texture");await Promise.all([Fe(e.normalMap,pathToName(r)),ze(e.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),o.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let t=TextureLayer.selected?.texture??Texture.all.find(e=>e.selected)??Texture.getDefault(),a=new D(t.layers_enabled?t.layers:[t],t.uuid);if(pathToName(t.name).endsWith("_n")){a.createTexturesFromNormal(t);return}if(pathToName(t.name).endsWith("_s")){a.createTexturesFromSpecular(t);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(o.generateLabPbr,"file.export"),MenuBar.addAction(o.decodeLabPbr,"tools")});P.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});w.push(()=>{o.createMaterialTexture=new Action("create_material_texture",{icon:"stacks",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let t={...g},a=new Texture({name:"New Material",saved:!1,particle:!1});a.extend({material:!0});let e=Texture.all.filter(s=>s.selected||s.multi_selected)??Texture.all,r=S(),n=r?new D(e,r.uuid):null;try{let s=n?.findTexture(g.albedo,!0)?.canvas.toDataURL()??r?.canvas.toDataURL()??J(new M.Color(8421504),a.canvas);if(!s)return;a.fromDataURL(s);let l=new TextureLayer({name:t.albedo.label,visible:!0,data_url:s,keep_size:!0},a);l.extend({channel:t.albedo.id}),l.addForEditing(),l.texture.updateChangesAfterEdit(),n?.saveTexture(t.albedo,l),delete t.albedo}catch(s){console.warn("Failed to create base color texture",s),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let i=Object.keys(t).map(s=>{let l=g[s],p=n?.findTexture(l,!0),h=p?p.canvas.toDataURL():J(l.default??new M.Color(0));if(!h)return;let m=new TextureLayer({name:l.label,visible:!0,data_url:h,keep_size:!0},a);return m.extend({channel:l.id}),n?.saveTexture(l,m),m}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:i}),a.add().select(),a.activateLayers(),i.map(s=>{s.addForEditing(),a.width=Math.max(a.width,s.img.width),a.height=Math.max(a.height,s.img.height)}),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(o.createMaterialTexture,"tools"),Toolbars.texturelist.add(o.createMaterialTexture,3)});P.push(()=>{MenuBar.removeAction("tools.create_material_texture"),Toolbars.texturelist.remove("create_material_texture")});var F=(t,a)=>{let e=S()??Texture.getDefault(),r=new D(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[i,s]=Project?[t?`${t}_mer`:`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:i,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},a)})};w.push(()=>{o.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{F()}catch(t){console.error("Failed to export MER map:",t),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),o.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let t=S()??Texture.getDefault(),a=new D([t],t.uuid),e=a.decodeMer(),r=[g.metalness,g.emissive,g.roughness];Undo.initEdit({textures:[t]}),r.forEach(n=>{let i=n.id,s=e[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new Texture({name:`${t?.name}_${i}`,keep_size:!1}).fromDataURL(s.toDataURL());l.add(!0),a.saveTexture(n,l)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>S()?.layers_enabled===!0,click(){let t=S()??Texture.getDefault(),a=new D(t.layers_enabled?t.layers:[t],t.uuid),e=a.decodeMer(),r=[g.metalness,g.emissive,g.roughness];Undo.initEdit({textures:[t]}),r.forEach(n=>{let i=n.id,s=e[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new TextureLayer({name:`${t?.name}_${i}`,data_url:s.toDataURL()},t);a.saveTexture(n,l),l.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(o.decodeMer,"tools"),MenuBar.addAction(o.generateMer,"file.export")});P.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var Ge=()=>{Project&&Project.textures.forEach(t=>{let a=new D(null,t.uuid),e=a.findTexture(g.normal,!1),r=a.findTexture(g.height,!1),n=a.findTexture(g.albedo,!1),i=a.findTexture(g.metalness,!1)?.name,s=a.findTexture(g.emissive,!1)?.name,l=a.findTexture(g.roughness,!1)?.name,p={};return n||(p.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!i&&!s&&!l&&(p.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},p.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},p.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),e&&(p.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(p.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),e&&r&&(p.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),o.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:p,cancelIndex:1,onConfirm(h){let m=I(),u=i||s||l,b={format_version:"1.16.100","minecraft:texture_set":{color:(n?m:h.baseColor?.toHexString())??m,metalness_emissive_roughness:[h.metalness??0,h.emissive??0,h.roughness??255]}};h.depthMap==="normal"&&e||!r&&e?b["minecraft:texture_set"].normal=`${m}_normal`:(!e||h.depthMap==="heightmap")&&r&&(b["minecraft:texture_set"].heightmap=`${m}_heightmap`);let d=x=>{if(!h.depthMap)return x();let v=h.depthMap==="normal"||h.depthMap&&!r,_=v?e:r;if(!_)return x();Blockbench.export({content:_.canvas.toDataURL()??"",type:"PNG",name:`${m}_${v?"normal":"heightmap"}`,extensions:["png"],resource_id:h.depthMap,startpath:Project.export_path,savetype:"image"},y=>{b["minecraft:texture_set"][v?"normal":"heightmap"]=pathToName(y,!1),x()})},f=x=>{if(!n)return x();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:m,startpath:Project.export_path,savetype:"image"},v=>{b["minecraft:texture_set"].color=pathToName(v,!1),x()})},c=()=>d(()=>{f(()=>{Blockbench.export({content:JSON.stringify(b,null,2),type:"JSON",name:`${m}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),o.textureSetDialog?.hide()})})});if(u){try{F(m,x=>{b["minecraft:texture_set"].metalness_emissive_roughness=pathToName(x,!1),c()})}catch(x){console.warn("Failed to export MER map:",x),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}c()}}),o.textureSetDialog.show()})};w.push(()=>{o.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){Ge()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(o.createTextureSet,"file.export")});P.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});w.push(()=>{o.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(t){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=t}),Preview.selected.renderer.physicallyCorrectLights=t,Blockbench.showQuickMessage(`Physically corrected lighting is now ${t?"enabled":"disabled"}`,2e3),t&&o.togglePbr?.set(!0),R()},click(){}}),MenuBar.addAction(o.toggleCorrectLights,"preview")});P.push(()=>{MenuBar.removeAction("preview.correct_lights")});var z=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(a=>{let r=t.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var ue=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],me=()=>Project&&Project.pbr_active&&R(),Ve=()=>{Blockbench.on(ue.join(" "),me)},de=()=>{ue.forEach(t=>{Blockbench.removeListener(t,me)})};w.push(()=>{o.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(t){if(t){R(),Ve(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}z(),de(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(o.togglePbr,"view")});P.push(()=>{de(),MenuBar.removeAction("view.toggle_pbr")});var he=t=>{let a=Math.max(-2,Math.min(2,t));Preview.all.forEach(e=>{e.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};w.push(()=>{o.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(o.tonemappingSelect?.get())===M.NoToneMapping&&o.tonemappingSelect.change(M.LinearToneMapping.toString()),o.togglePbr?.set(!0)},onChange(t){he(Number(t))},onAfter(){B()}}),o.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>o.exposureSlider!==void 0&&Number(o.exposureSlider?.get())!==1,click(){he(1),o.exposureSlider?.setValue(1,!0),B()}}),o.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:M.NoToneMapping,value:Preview.selected.renderer.toneMapping??M.NoToneMapping,icon:"monochrome_photos",options:{[M.NoToneMapping]:"No Tone Mapping",[M.LinearToneMapping]:"Linear",[M.ReinhardToneMapping]:"Reinhard",[M.CineonToneMapping]:"Cineon",[M.NeutralToneMapping]:"Neutral",[M.ACESFilmicToneMapping]:"ACES"},onChange({value:t}){Preview.selected.renderer.toneMapping=Number(t);let a=1;Preview.selected.renderer.toneMapping===M.NoToneMapping?o.exposureSlider?.setValue(a,!0):a=Number(o.exposureSlider?.get()??1),Preview.all.forEach(e=>{e.renderer.toneMapping=Number(t),e.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(t)}`,2e3),o.togglePbr&&!o.togglePbr.value&&o.togglePbr.set(!0),R()}})});var X=class{async parse(a){let e=new re,r="model.usda";e.file(r,"");let n=xe(),i={},s={};a.traverseVisible(h=>{if(!h.isMesh)return;let m=h;if(!m.material.isMeshStandardMaterial){console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",h);return}let u=m.geometry,b=m.material,d="geometries/Geometry_"+u.id+".usd";if(!e.file(d)){let f=qe(u);e.file(d,Je(f))}b.uuid in i||(i[b.uuid]=b),n+=Ze(m,u,b)}),n+=tt(i,s),e.file(r,n),n=null;for(let h in s){let m=s[h],u=h.split("_")[1],b=m.format===M.RGBAFormat,d=Qe(m.image,u),c=await(await new Promise(x=>d.toBlob(v=>v&&x(v),b?"image/png":"image/jpeg",1))).arrayBuffer();e.file(`textures/Texture_${h}.${b?"png":"jpg"}`,c)}let l=0;e.forEach(async h=>{let m=34+h.length;l+=m;let u=l&63,b=await e.file(h).async("uint8array");if(u!==4){let d=64-u,f=new Uint8Array(d),c=new Uint8Array(b.length+d);c.set(b,0),c.set(f,b.length),e.file(h,c)}l+=b.length});let p=await e.generateAsync({type:"blob",compression:"STORE"});return new Uint8Array(await p.arrayBuffer())}};function Qe(t,a){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){let e=1024/Math.max(t.width,t.height),r=document.createElement("canvas");r.width=t.width*Math.min(1,e),r.height=t.height*Math.min(1,e);let n=r.getContext("2d");if(n.imageSmoothingEnabled=!1,n.drawImage(t,0,0,r.width,r.height),a!==void 0){let i=parseInt(a,16),s=(i>>16&255)/255,l=(i>>8&255)/255,p=(i&255)/255,h=n.getImageData(0,0,r.width,r.height),m=h.data;for(let u=0;u{var M=THREE,ae=Vue,re=window.JSZip;var A="_NONE_",g={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new M.Color(16777215),regex:new RegExp("(s|_)*(basecolor|color|albedo)","i")},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new M.Color(0),regex:new RegExp("[ _]*metal(lic|ness)?","i")},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new M.Color(0),regex:new RegExp("[ _]*(emissive|emission)","i")},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new M.Color(16777215),regex:new RegExp("[ _]*rough(ness)?","i")},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new M.Color(16777215),regex:new RegExp("[ _]*(height|bump)","i")},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new M.Color("rgb(128, 128, 255)"),regex:new RegExp("[ _]*normal","i")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new M.Color(16777215),regex:new RegExp("[ _]*(ao|ambientocclusion|ambient occlusion)","i")}},o={},w=[],P=[];var ne=[...Object.keys(g).map(t=>g[t].id),A];w.push(()=>{o.channelProp=new Property(TextureLayer,"enum","channel",{default:A,values:ne,label:"PBR Channel",exposed:!1}),o.textureChannelProp=new Property(Texture,"enum","channel",{default:A,values:ne,label:"PBR Channel",exposed:!1}),o.materialTextureProp=new Property(Texture,"boolean","material",{default:!1,label:"Material Texture"}),o.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),o.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),o.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!1,values:[],label:"PBR Mode"})});function S(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(t=>t.selected)??null:Texture.all.find(t=>t.selected)??Texture.getDefault()}function N(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(t=>t.selected)??Project.selected_texture.layers[0]:S()?.getActiveLayer()??null}function I(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(S()?.name??"texture")}function se(t,a){let e;return function(...r){let n=()=>{e=void 0,t.apply(this,r)};clearTimeout(e),e=setTimeout(n,a)}}function U(t){let a=MediaPreview.renderer??new M.WebGLRenderer({alpha:!0,antialias:!0}),e=new M.Scene,r=new M.PerspectiveCamera(75,96/96,.1,1e3),n=new M.AmbientLight(16777215,.75);e.add(n);let i=new M.PointLight(16777215,1,100);i.position.set(5,5,5),e.add(i);let s=new M.SphereGeometry(1,32,32),l=t instanceof M.MeshStandardMaterial&&t.isMeshStandardMaterial?t:new M.MeshStandardMaterial({color:t.albedo,metalness:t.metalness??0,roughness:t.roughness??1,emissive:t.emissive,bumpScale:t.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),p=new M.Mesh(s,l);e.add(p),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(e,r);let h=a.domElement.toDataURL();return l.dispose(),MediaPreview.renderer||(a.clear(),a.dispose()),h}function J(t,a){let e=a??document.createElement("canvas"),r=e.getContext("2d");if(!r)return e.remove(),null;let n=Math.max(Project?Project.texture_width:16,16),i=Math.max(Project?Project.texture_height:16,16);e.width=n,e.height=i,r.fillStyle=`rgb(${t.r*255}, ${t.g*255}, ${t.b*255})`,r.fillRect(0,0,n,i);let s=e.toDataURL();return a||e.remove(),s}var Ie=(t=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return t?a.filter(e=>e.layers_enabled&&e.layers.length>0).flatMap(e=>e.layers):a},D=class t{constructor(a,e){this._scope=a??Ie(),this._materialUuid=e}merToCanvas(){let a=this.getTexture(g.emissive),e=this.getTexture(g.roughness),r=this.getTexture(g.metalness);if(!a&&!e&&!r){let{metalness:n,emissive:i,roughness:s}=this.decodeMer();n&&(r=t.makePixelatedCanvas(n)),i&&(a=t.makePixelatedCanvas(i)),s&&(e=t.makePixelatedCanvas(s))}return{emissiveMap:a,roughnessMap:e,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:e,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(g.emissive),roughnessMap:this.getTexture(g.roughness),metalnessMap:this.getTexture(g.metalness)},i=this.getTexture(g.normal);return new M.MeshStandardMaterial({map:this.getTexture(g.albedo)??t.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(s=>s.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(g.ao),bumpMap:this.getTexture(g.height),normalMap:i,normalScale:new M.Vector2(-1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:e,emissiveIntensity:e?1:0,emissive:e?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}renderMaterialPreview(){return U(this.getMaterial())}saveTexture(a,e){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=e.uuid,e.extend({channel:a.id}))}findTexture(a,e=!0){if(!Project)return null;let r=this._scope.find(p=>p.channel&&(p.channel===a||p.channel===a.id));if(r)return r;let[n,i]=typeof a=="string"?[a,new RegExp(`_*${a}(.[^.]+)?$`,"i")]:[a.id,a.regex??new RegExp(`_*${a.id}(.[^.]+)?$`,"i")];Project.pbr_materials=Project.pbr_materials??{};let s=Project.pbr_materials[this._materialUuid];if(e&&!s&&n!==A)return this._scope.find(p=>i?.test(p.name))??null;let l=s?.[n];return l?this._scope.find(p=>p.uuid===l)??null:null}static makePixelatedCanvas(a){let e=new M.CanvasTexture(a,void 0,void 0,void 0,M.NearestFilter,M.NearestFilter);return e.needsUpdate=!0,e}getTexture(a){let e=this.findTexture(a);return e?t.makePixelatedCanvas(e.canvas):null}static extractChannel(a,e){let r=a.canvas,{width:n,height:i}=r,s=r.getContext("2d");if(!s||!n||!i)return null;let l=document.createElement("canvas");l.width=n,l.height=i;let p=l.getContext("2d");if(!p)return null;let h={r:0,g:1,b:2,a:3}[e],{data:m}=s.getImageData(0,0,n,i),u=new Uint8ClampedArray(n*i*4);for(let d=0;da){f[c]=b.data[c],f[c+1]=b.data[c+1],f[c+2]=b.data[c+2],f[c+3]=255;continue}f[c]=0,f[c+1]=0,f[c+2]=0,f[c+3]=255}return h.putImageData(new ImageData(f,l.width,l.height),0,0),{metalness:r,emissive:l,emissiveLevel:n,roughness:i,sss:s}}createMer(a=!1){let e=this.findTexture(g.metalness,a),r=this.findTexture(g.emissive,a),n=this.findTexture(g.roughness,a),i=this.findTexture("sss",!1),s=Math.max(e?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),l=Math.max(e?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),p=document.createElement("canvas");p.width=s,p.height=l;let h=p.getContext("2d");if(!h)return null;let m=e?.img?t.extractChannel(e,"r"):null,u=r?.img?t.extractChannel(r,"g"):null,b=n?.img?t.extractChannel(n,"b"):null,d=i&&i?.img?t.extractChannel(i,"a"):null,f=m?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),c=u?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),x=b?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),v=d?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(new Uint8ClampedArray(s*l*4).fill(255),s,l),_=new Uint8ClampedArray(s*l*4);for(let y=0;y<_.length;y+=4)_[y]=f.data[y],_[y+1]=c.data[y],_[y+2]=x.data[y],_[y+3]=v.data[y];return h.putImageData(new ImageData(_,s,l),0,0),p}createLabPbrOutput(a=!0){let e=this.findTexture(g.metalness,a),r=this.findTexture(g.emissive,a),n=this.findTexture(g.roughness,a),i=this.findTexture(g.normal,a),s=this.findTexture(g.height,a),l=this.findTexture(g.ao,!1),p=this.findTexture("sss",!0),h=this.findTexture("porosity",!0),m=Math.max(e?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),u=Math.max(e?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),b=document.createElement("canvas");b.width=m,b.height=u;let d=b.getContext("2d"),f=document.createElement("canvas");f.width=m,f.height=u;let c=f.getContext("2d");if(!d||!c)return null;let x=new Uint8ClampedArray(m*u*4),v=new Uint8ClampedArray(m*u*4),_=e?.canvas,y=r?.canvas,k=n?.canvas,T=p?.canvas,L=h?.canvas,C=_?.getContext("2d"),j=y?.getContext("2d"),_e=k?.getContext("2d"),ye=T?.getContext("2d"),we=L?.getContext("2d"),Te=C?.getImageData(0,0,m,u),H=j?.getImageData(0,0,m,u),K=_e?.getImageData(0,0,m,u),Ce=ye?.getImageData(0,0,m,u),Ee=we?.getImageData(0,0,m,u);for(let E=0;E{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),e}createTexturesFromNormal(a){let e=this.decodeLabPbrNormal(a);return Object.entries(e).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),e}};var O=class{constructor({lightHeight:a=.66,ambientLight:e=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:n=[1,1,1]}={}){this.lightHeight=a,this.ambientLight=e,this.minLightIntensity=r,this.lightDiffuse=n}bake(a,e,r){let n=e instanceof HTMLCanvasElement?e:this.createCanvas(e.width,e.height),i=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),s=n.getContext("2d"),l=i.getContext("2d");s.drawImage(e,0,0),l.drawImage(r,0,0);let p=s.getImageData(0,0,e.width,e.height),h=l.getImageData(0,0,r.width,r.height),m=[],u=[];for(let d=0;d{let f=this.createCanvas(e.width,e.height),c=f.getContext("2d"),x=c.getImageData(0,0,f.width,f.height),v=[Math.cos(d),Math.sin(d),this.lightHeight];for(let _=0;_{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new D(r.layers_enabled?r.layers:Project.textures,r.uuid),i=n.findTexture(g.albedo);if(!i){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let s=n.findTexture(g.normal);if(!s){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let p=new O(t).bake(a,i.canvas,s.canvas),h=new Texture({name:`${i.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(p[0].toDataURL()),m=e?u=>{let b=n.findTexture(g.emissive);if(!b)return u;let d=b.canvas;if(!d.getContext("2d"))return u;let c=Math.max(u.width,d.width,Project?Project.texture_width:16),x=Math.max(u.height,d.height,Project?Project.texture_height:16),v=document.createElement("canvas");v.width=c,v.height=x;let _=v.getContext("2d");return _?(_.drawImage(u,0,0),_.globalCompositeOperation="screen",_.drawImage(d,0,0),v):u}:u=>u;p.forEach((u,b)=>{new TextureLayer({name:`baked_${b+1}`,data_url:m(u).toDataURL()},h).addForEditing()}),h.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};w.push(()=>{o.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(t){let a=new M.Color(t.ambientLight.toString()),e=new M.Color(t.lightDiffuse.toString());oe({ambientLight:[a.r,a.g,a.b],lightDiffuse:[e.r,e.g,e.b],lightHeight:Number(t.lightHeight),minLightIntensity:Number(t.minLightIntensity)},t.directions??8,t.blendEmissive??!1)}}),o.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){o.bakeTexturesDialog?.show()}}),MenuBar.addAction(o.bakeTexturesAction,"tools")});P.push(()=>{MenuBar.removeAction("tools.bake_textures")});function ie(t,a){let e=t.getTexture();if(!e||!Project)return null;let r=Project.materials[e.uuid];r.isShaderMaterial&&!Project.bb_materials[e.uuid]?Project.bb_materials[e.uuid]=r:r.isMeshStandardMaterial&&r.dispose();let n=new D(e.layers_enabled?e.layers.filter(i=>i.visible)??null:Project.textures,e.uuid).getMaterial({side:Canvas.getRenderSide(e),...a});return Project.materials[e.uuid]=M.ShaderMaterial.prototype.copy.call(n,r),e}function le(t){return Object.values(t).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function Ue(t,a){let e={};return t.forAllFaces(r=>{let n=ie(r,a);n&&(e[n.uuid]=n)}),le(e)}function Oe(t,a){let e={};return Object.keys(t.faces).forEach(r=>{let n=t.faces[r],i=ie(n,a);i&&(e[i.uuid]=i)}),le(e)}var R=(t={})=>{Project&&(Project.pbr_active=Texture.all.length>0&&Project.elements.map(a=>a instanceof Mesh&&Ue(a,t)||a instanceof Cube&&Oe(a,t)).filter(Boolean).length>0)},B=(t=100)=>se(R,t);var W={},Z={};w.push(()=>{Object.entries(g).forEach(([t,a])=>{W[t]=new Action(`assign_channel_${t}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:{selected:{texture:!0},project:!0,method(){return S()?.material===!0&&N()!==null}},click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e)return;Undo.initEdit({layers:[e]}),e.extend({channel:a.id});let r=e instanceof TextureLayer?e.texture:e;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([n,i])=>{i===e.uuid&&(delete Project.pbr_materials[r.uuid][n],e.channel=A)}),r.uuid===e.uuid&&(Project.pbr_materials[r.uuid]={}),Project.pbr_materials[r.uuid][t]=e.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${e.name}" to ${a.label} channel`,2e3),R()}}),Z[t]=new Action(`select_channel_${t}`,{icon:a.icon??"tv_options_edit_channels",name:a.label??t,description:`Select the ${a.label} channel`,condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){let e=S();return(e?.layers_enabled?e.layers:Texture.all).some(n=>n.channel===t)}},click(){let e=Texture.selected?.layers_enabled?Texture.selected.layers:Texture.all;if(!e||!e.length)return;let r=e.find(n=>n.channel===t);r&&(r.select(),r.scrollTo())}}),Z[t].addLabel(!0,()=>a.label??t)})});P.push(()=>{[...Object.values(W),...Object.values(Z)].forEach(a=>{a.delete()})});w.push(()=>{o.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:{selected:{texture:!0},method(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);return t?.channel&&t.channel!==A}},click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t)return;Undo.initEdit({layers:[t]});let a=t instanceof TextureLayer?t.texture:t,e=t.channel;Project.pbr_materials[a.uuid]={},t.channel=A,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${t.name}" from ${e} channel`,2e3),B()}}),o.channelMenu=new Menu("channel_menu",[...Object.keys(g).map(t=>`assign_channel_${t}`),"unassign_channel"],{onOpen(){B()}}),o.channelSelectionMenu=new Menu("channel_selection_menu",Object.keys(g).map(t=>`select_channel_${t}`)),o.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",condition:{modes:["edit","paint"],selected:{texture:!0}},click(t){o.channelMenu?.open(t)},children:[...Object.values(W),o.unassignChannel]}),o.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(t){o.channelMenu?.open(t)}}),o.showChannelSelectionMenu=new Action("show_channel_select_menu",{icon:"tv_options_edit_channels",name:"Select PBR Channel",description:"Select a channel to view",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(t){o.channelSelectionMenu?.open(t)}}),o.openChannelMenu&&(MenuBar.addAction(o.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(o.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(o.openChannelMenu,"0")),Toolbars.layers.add(o.showChannelMenu,1)});P.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(o.showChannelMenu)});function q(t,a=!1){let e=t.canvas.getContext("2d");if(!e)return null;let r=Math.max(t.img.width??t.canvas.width,Project?Project.texture_width:0,16),n=Math.max(t.img.height??t.canvas.height,Project?Project.texture_height:0,16),{data:i}=e.getImageData(0,0,r,n),s=document.createElement("canvas"),l=s.getContext("2d");if(!l)return null;let p=(c,x)=>{let v=(c+x*r)*4;return i[v]/255};s.width=r,s.height=n,l.drawImage(t.img,0,0,r,n);let h=l.getImageData(0,0,r,n),m=h.data,u=c=>{let x=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);return[c[0]/x,c[1]/x,c[2]/x]};for(let c=0;c{let c=(d+f*e)*4;return n[c]/255};i.width=e,i.height=r,s.drawImage(t.img,0,0,e,r);let p=s.getImageData(0,0,e,r),h=p.data;for(let d=0;d{o.generateNormal=new Action("generate_normal",{icon:g.normal.icon??"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(N()??S())!==null,click(t){let a=N()??S()??Texture.getDefault();if(!a)return;let e=q(a);if(!e){Blockbench.showQuickMessage("Failed to generate normal map",2e3);return}e.select(t),new D(a instanceof Texture&&a.layers_enabled?a.layers:null,a.uuid).saveTexture(g.normal,e),Blockbench.showQuickMessage("Normal map generated",2e3)}}),o.generateAo=new Action("generate_ao",{icon:g.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let t=N()??S()??Texture.getDefault();if(!t)return;let a=new D(t instanceof Texture&&t.layers_enabled?t.layers:null,t.uuid),e=a.findTexture(g.normal)??q(t);if(!e){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=ce(e);if(r){a.saveTexture(g.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),MenuBar.addAction(o.generateNormal,"tools"),MenuBar.addAction(o.generateAo,"tools")});P.push(()=>{MenuBar.removeAction("tools.generate_normal")});var Fe=(t,a="texture")=>{t.toBlob(async e=>{e&&Blockbench.export({content:await e.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},ze=(t,a="texture")=>{t.toBlob(async e=>{e&&Blockbench.export({content:await e.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};w.push(()=>{o.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let t=S();if(!t)return;let e=new D(t.layers_enabled?t.layers:[t],t.uuid).createLabPbrOutput();if(e===null)return;let r=t.name??(Project?Project.getDisplayName():"texture");await Promise.all([Fe(e.normalMap,pathToName(r)),ze(e.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),o.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let t=TextureLayer.selected?.texture??Texture.all.find(e=>e.selected)??Texture.getDefault(),a=new D(t.layers_enabled?t.layers:[t],t.uuid);if(pathToName(t.name).endsWith("_n")){a.createTexturesFromNormal(t);return}if(pathToName(t.name).endsWith("_s")){a.createTexturesFromSpecular(t);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(o.generateLabPbr,"file.export"),MenuBar.addAction(o.decodeLabPbr,"tools")});P.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});w.push(()=>{o.createMaterialTexture=new Action("create_material_texture",{icon:"deployed_code",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let t={...g},a=new Texture({name:"New Material",saved:!1,particle:!1});a.extend({material:!0});let e=Texture.all.filter(s=>s.selected||s.multi_selected)??Texture.all,r=S(),n=r?new D(e,r.uuid):null;try{let s=n?.findTexture(g.albedo,!0)?.canvas.toDataURL()??r?.canvas.toDataURL()??J(new M.Color(8421504),a.canvas);if(!s)return;a.fromDataURL(s);let l=new TextureLayer({name:t.albedo.label,visible:!0,data_url:s,keep_size:!0},a);l.extend({channel:t.albedo.id}),l.addForEditing(),l.texture.updateChangesAfterEdit(),n?.saveTexture(t.albedo,l),delete t.albedo}catch(s){console.warn("Failed to create base color texture",s),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let i=Object.keys(t).map(s=>{let l=g[s],p=n?.findTexture(l,!0),h=p?p.canvas.toDataURL():J(l.default??new M.Color(0));if(!h)return;let m=new TextureLayer({name:l.label,visible:!0,data_url:h,keep_size:!0},a);return m.extend({channel:l.id}),n?.saveTexture(l,m),m}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:i}),a.add().select(),a.activateLayers(),i.map(s=>{s.addForEditing(),a.width=Math.max(a.width,s.img.width),a.height=Math.max(a.height,s.img.height)}),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(o.createMaterialTexture,"tools"),Toolbars.texturelist.add(o.createMaterialTexture,3)});P.push(()=>{MenuBar.removeAction("tools.create_material_texture"),Toolbars.texturelist.remove("create_material_texture")});var F=(t,a)=>{let e=S()??Texture.getDefault(),r=new D(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[i,s]=Project?[t?`${t}_mer`:`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:i,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},a)})};w.push(()=>{o.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{F()}catch(t){console.error("Failed to export MER map:",t),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),o.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let t=S()??Texture.getDefault(),a=new D([t],t.uuid),e=a.decodeMer(),r=[g.metalness,g.emissive,g.roughness];Undo.initEdit({textures:[t]}),r.forEach(n=>{let i=n.id,s=e[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new Texture({name:`${t?.name}_${i}`,keep_size:!1}).fromDataURL(s.toDataURL());l.add(!0),a.saveTexture(n,l)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>S()?.layers_enabled===!0,click(){let t=S()??Texture.getDefault(),a=new D(t.layers_enabled?t.layers:[t],t.uuid),e=a.decodeMer(),r=[g.metalness,g.emissive,g.roughness];Undo.initEdit({textures:[t]}),r.forEach(n=>{let i=n.id,s=e[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new TextureLayer({name:`${t?.name}_${i}`,data_url:s.toDataURL()},t);a.saveTexture(n,l),l.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(o.decodeMer,"tools"),MenuBar.addAction(o.generateMer,"file.export")});P.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var Ge=()=>{Project&&Project.textures.forEach(t=>{let a=new D(null,t.uuid),e=a.findTexture(g.normal,!1),r=a.findTexture(g.height,!1),n=a.findTexture(g.albedo,!1),i=a.findTexture(g.metalness,!1)?.name,s=a.findTexture(g.emissive,!1)?.name,l=a.findTexture(g.roughness,!1)?.name,p={};return n||(p.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!i&&!s&&!l&&(p.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},p.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},p.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),e&&(p.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(p.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),e&&r&&(p.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),o.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:p,cancelIndex:1,onConfirm(h){let m=I(),u=i||s||l,b={format_version:"1.16.100","minecraft:texture_set":{color:(n?m:h.baseColor?.toHexString())??m,metalness_emissive_roughness:[h.metalness??0,h.emissive??0,h.roughness??255]}};h.depthMap==="normal"&&e||!r&&e?b["minecraft:texture_set"].normal=`${m}_normal`:(!e||h.depthMap==="heightmap")&&r&&(b["minecraft:texture_set"].heightmap=`${m}_heightmap`);let d=x=>{if(!h.depthMap)return x();let v=h.depthMap==="normal"||h.depthMap&&!r,_=v?e:r;if(!_)return x();Blockbench.export({content:_.canvas.toDataURL()??"",type:"PNG",name:`${m}_${v?"normal":"heightmap"}`,extensions:["png"],resource_id:h.depthMap,startpath:Project.export_path,savetype:"image"},y=>{b["minecraft:texture_set"][v?"normal":"heightmap"]=pathToName(y,!1),x()})},f=x=>{if(!n)return x();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:m,startpath:Project.export_path,savetype:"image"},v=>{b["minecraft:texture_set"].color=pathToName(v,!1),x()})},c=()=>d(()=>{f(()=>{Blockbench.export({content:JSON.stringify(b,null,2),type:"JSON",name:`${m}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),o.textureSetDialog?.hide()})})});if(u){try{F(m,x=>{b["minecraft:texture_set"].metalness_emissive_roughness=pathToName(x,!1),c()})}catch(x){console.warn("Failed to export MER map:",x),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}c()}}),o.textureSetDialog.show()})};w.push(()=>{o.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){Ge()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(o.createTextureSet,"file.export")});P.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});w.push(()=>{o.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(t){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=t}),Preview.selected.renderer.physicallyCorrectLights=t,Blockbench.showQuickMessage(`Physically corrected lighting is now ${t?"enabled":"disabled"}`,2e3),t&&o.togglePbr?.set(!0),R()},click(){}}),MenuBar.addAction(o.toggleCorrectLights,"preview")});P.push(()=>{MenuBar.removeAction("preview.correct_lights")});var z=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(a=>{let r=t.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var ue=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],me=()=>Project&&Project.pbr_active&&R(),Ve=()=>{Blockbench.on(ue.join(" "),me)},de=()=>{ue.forEach(t=>{Blockbench.removeListener(t,me)})};w.push(()=>{o.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(t){if(t){R(),Ve(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}z(),de(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(o.togglePbr,"view")});P.push(()=>{de(),MenuBar.removeAction("view.toggle_pbr")});var he=t=>{let a=Math.max(-2,Math.min(2,t));Preview.all.forEach(e=>{e.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};w.push(()=>{o.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(o.tonemappingSelect?.get())===M.NoToneMapping&&o.tonemappingSelect.change(M.LinearToneMapping.toString()),o.togglePbr?.set(!0)},onChange(t){he(Number(t))},onAfter(){B()}}),o.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>o.exposureSlider!==void 0&&Number(o.exposureSlider?.get())!==1,click(){he(1),o.exposureSlider?.setValue(1,!0),B()}}),o.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:M.NoToneMapping,value:Preview.selected.renderer.toneMapping??M.NoToneMapping,icon:"monochrome_photos",options:{[M.NoToneMapping]:"No Tone Mapping",[M.LinearToneMapping]:"Linear",[M.ReinhardToneMapping]:"Reinhard",[M.CineonToneMapping]:"Cineon",[M.NeutralToneMapping]:"Neutral",[M.ACESFilmicToneMapping]:"ACES"},onChange({value:t}){Preview.selected.renderer.toneMapping=Number(t);let a=1;Preview.selected.renderer.toneMapping===M.NoToneMapping?o.exposureSlider?.setValue(a,!0):a=Number(o.exposureSlider?.get()??1),Preview.all.forEach(e=>{e.renderer.toneMapping=Number(t),e.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(t)}`,2e3),o.togglePbr&&!o.togglePbr.value&&o.togglePbr.set(!0),R()}})});var X=class{async parse(a){let e=new re,r="model.usda";e.file(r,"");let n=xe(),i={},s={};a.traverseVisible(h=>{if(!h.isMesh)return;let m=h;if(!m.material.isMeshStandardMaterial){console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",h);return}let u=m.geometry,b=m.material,d="geometries/Geometry_"+u.id+".usd";if(!e.file(d)){let f=qe(u);e.file(d,Je(f))}b.uuid in i||(i[b.uuid]=b),n+=Ze(m,u,b)}),n+=tt(i,s),e.file(r,n),n=null;for(let h in s){let m=s[h],u=h.split("_")[1],b=m.format===M.RGBAFormat,d=Qe(m.image,u),c=await(await new Promise(x=>d.toBlob(v=>v&&x(v),b?"image/png":"image/jpeg",1))).arrayBuffer();e.file(`textures/Texture_${h}.${b?"png":"jpg"}`,c)}let l=0;e.forEach(async h=>{let m=34+h.length;l+=m;let u=l&63,b=await e.file(h).async("uint8array");if(u!==4){let d=64-u,f=new Uint8Array(d),c=new Uint8Array(b.length+d);c.set(b,0),c.set(f,b.length),e.file(h,c)}l+=b.length});let p=await e.generateAsync({type:"blob",compression:"STORE"});return new Uint8Array(await p.arrayBuffer())}};function Qe(t,a){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){let e=1024/Math.max(t.width,t.height),r=document.createElement("canvas");r.width=t.width*Math.min(1,e),r.height=t.height*Math.min(1,e);let n=r.getContext("2d");if(n.imageSmoothingEnabled=!1,n.drawImage(t,0,0,r.width,r.height),a!==void 0){let i=parseInt(a,16),s=(i>>16&255)/255,l=(i>>8&255)/255,p=(i&255)/255,h=n.getImageData(0,0,r.width,r.height),m=h.data;for(let u=0;u { registry.createMaterialTexture = new Action("create_material_texture", { - icon: "stacks", + icon: "deployed_code", name: "Create Material Texture", description: "Creates a new texture for a PBR material", condition: { From f63b625b9850748ecdfebfc8989b9f6612db99c0 Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 18 Jun 2024 09:23:37 -0500 Subject: [PATCH 27/50] fix: New material texture normal map (#9) * upd: Dispose material preview renderer - Moved material preview image generator to utils * upd: Add material texture property * upd: Dispose old materials * upd: Activate material brush with presets - Select material brush tool after using the presets dialog * upd: Add cleanup to util functions * upd: Use left-hand normals * upd: Material brush tool settings - Added tool_settings property - Updated display conditions of inputs * upd: Channel assignment menu conditions * feat: Material texture thumbnail preview - Texture thumbnail source using PBR material preview render * fix: Material texture size * fix: Material brush size * fix: Remove material texture button in teardown * upd: Brush softness / Better inference - Allow channels to provide individual inference regex - Reduce material brush effect at edges with softness slider * upd: Select paint mode on channel assignment - Fixed normal map creation in new material textures - Avoid creating material textures from existing ones - Optimized channel assignment display conditions * chore: Commit build output --- plugins/pbr_preview/pbr_preview.js | 48 ++++----- src/pbr_preview/src/lib/PbrMaterials.ts | 4 +- .../src/lib/actions/channelAssignment.ts | 97 +++++++++++-------- .../src/lib/actions/materialTexture.ts | 5 +- 4 files changed, 88 insertions(+), 66 deletions(-) diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index 5e8978e0..81949a8c 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1,4 +1,4 @@ -"use strict";(()=>{var M=THREE,ae=Vue,re=window.JSZip;var A="_NONE_",g={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new M.Color(16777215),regex:new RegExp("(s|_)*(basecolor|color|albedo)","i")},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new M.Color(0),regex:new RegExp("[ _]*metal(lic|ness)?","i")},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new M.Color(0),regex:new RegExp("[ _]*(emissive|emission)","i")},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new M.Color(16777215),regex:new RegExp("[ _]*rough(ness)?","i")},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new M.Color(16777215),regex:new RegExp("[ _]*(height|bump)","i")},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new M.Color("rgb(128, 128, 255)"),regex:new RegExp("[ _]*normal","i")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new M.Color(16777215),regex:new RegExp("[ _]*(ao|ambientocclusion|ambient occlusion)","i")}},o={},w=[],P=[];var ne=[...Object.keys(g).map(t=>g[t].id),A];w.push(()=>{o.channelProp=new Property(TextureLayer,"enum","channel",{default:A,values:ne,label:"PBR Channel",exposed:!1}),o.textureChannelProp=new Property(Texture,"enum","channel",{default:A,values:ne,label:"PBR Channel",exposed:!1}),o.materialTextureProp=new Property(Texture,"boolean","material",{default:!1,label:"Material Texture"}),o.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),o.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),o.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!1,values:[],label:"PBR Mode"})});function S(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(t=>t.selected)??null:Texture.all.find(t=>t.selected)??Texture.getDefault()}function N(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(t=>t.selected)??Project.selected_texture.layers[0]:S()?.getActiveLayer()??null}function I(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(S()?.name??"texture")}function se(t,a){let e;return function(...r){let n=()=>{e=void 0,t.apply(this,r)};clearTimeout(e),e=setTimeout(n,a)}}function U(t){let a=MediaPreview.renderer??new M.WebGLRenderer({alpha:!0,antialias:!0}),e=new M.Scene,r=new M.PerspectiveCamera(75,96/96,.1,1e3),n=new M.AmbientLight(16777215,.75);e.add(n);let i=new M.PointLight(16777215,1,100);i.position.set(5,5,5),e.add(i);let s=new M.SphereGeometry(1,32,32),l=t instanceof M.MeshStandardMaterial&&t.isMeshStandardMaterial?t:new M.MeshStandardMaterial({color:t.albedo,metalness:t.metalness??0,roughness:t.roughness??1,emissive:t.emissive,bumpScale:t.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),p=new M.Mesh(s,l);e.add(p),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(e,r);let h=a.domElement.toDataURL();return l.dispose(),MediaPreview.renderer||(a.clear(),a.dispose()),h}function J(t,a){let e=a??document.createElement("canvas"),r=e.getContext("2d");if(!r)return e.remove(),null;let n=Math.max(Project?Project.texture_width:16,16),i=Math.max(Project?Project.texture_height:16,16);e.width=n,e.height=i,r.fillStyle=`rgb(${t.r*255}, ${t.g*255}, ${t.b*255})`,r.fillRect(0,0,n,i);let s=e.toDataURL();return a||e.remove(),s}var Ie=(t=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return t?a.filter(e=>e.layers_enabled&&e.layers.length>0).flatMap(e=>e.layers):a},D=class t{constructor(a,e){this._scope=a??Ie(),this._materialUuid=e}merToCanvas(){let a=this.getTexture(g.emissive),e=this.getTexture(g.roughness),r=this.getTexture(g.metalness);if(!a&&!e&&!r){let{metalness:n,emissive:i,roughness:s}=this.decodeMer();n&&(r=t.makePixelatedCanvas(n)),i&&(a=t.makePixelatedCanvas(i)),s&&(e=t.makePixelatedCanvas(s))}return{emissiveMap:a,roughnessMap:e,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:e,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(g.emissive),roughnessMap:this.getTexture(g.roughness),metalnessMap:this.getTexture(g.metalness)},i=this.getTexture(g.normal);return new M.MeshStandardMaterial({map:this.getTexture(g.albedo)??t.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(s=>s.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(g.ao),bumpMap:this.getTexture(g.height),normalMap:i,normalScale:new M.Vector2(-1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:e,emissiveIntensity:e?1:0,emissive:e?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}renderMaterialPreview(){return U(this.getMaterial())}saveTexture(a,e){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=e.uuid,e.extend({channel:a.id}))}findTexture(a,e=!0){if(!Project)return null;let r=this._scope.find(p=>p.channel&&(p.channel===a||p.channel===a.id));if(r)return r;let[n,i]=typeof a=="string"?[a,new RegExp(`_*${a}(.[^.]+)?$`,"i")]:[a.id,a.regex??new RegExp(`_*${a.id}(.[^.]+)?$`,"i")];Project.pbr_materials=Project.pbr_materials??{};let s=Project.pbr_materials[this._materialUuid];if(e&&!s&&n!==A)return this._scope.find(p=>i?.test(p.name))??null;let l=s?.[n];return l?this._scope.find(p=>p.uuid===l)??null:null}static makePixelatedCanvas(a){let e=new M.CanvasTexture(a,void 0,void 0,void 0,M.NearestFilter,M.NearestFilter);return e.needsUpdate=!0,e}getTexture(a){let e=this.findTexture(a);return e?t.makePixelatedCanvas(e.canvas):null}static extractChannel(a,e){let r=a.canvas,{width:n,height:i}=r,s=r.getContext("2d");if(!s||!n||!i)return null;let l=document.createElement("canvas");l.width=n,l.height=i;let p=l.getContext("2d");if(!p)return null;let h={r:0,g:1,b:2,a:3}[e],{data:m}=s.getImageData(0,0,n,i),u=new Uint8ClampedArray(n*i*4);for(let d=0;da){f[c]=b.data[c],f[c+1]=b.data[c+1],f[c+2]=b.data[c+2],f[c+3]=255;continue}f[c]=0,f[c+1]=0,f[c+2]=0,f[c+3]=255}return h.putImageData(new ImageData(f,l.width,l.height),0,0),{metalness:r,emissive:l,emissiveLevel:n,roughness:i,sss:s}}createMer(a=!1){let e=this.findTexture(g.metalness,a),r=this.findTexture(g.emissive,a),n=this.findTexture(g.roughness,a),i=this.findTexture("sss",!1),s=Math.max(e?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),l=Math.max(e?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),p=document.createElement("canvas");p.width=s,p.height=l;let h=p.getContext("2d");if(!h)return null;let m=e?.img?t.extractChannel(e,"r"):null,u=r?.img?t.extractChannel(r,"g"):null,b=n?.img?t.extractChannel(n,"b"):null,d=i&&i?.img?t.extractChannel(i,"a"):null,f=m?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),c=u?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),x=b?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),v=d?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(new Uint8ClampedArray(s*l*4).fill(255),s,l),_=new Uint8ClampedArray(s*l*4);for(let y=0;y<_.length;y+=4)_[y]=f.data[y],_[y+1]=c.data[y],_[y+2]=x.data[y],_[y+3]=v.data[y];return h.putImageData(new ImageData(_,s,l),0,0),p}createLabPbrOutput(a=!0){let e=this.findTexture(g.metalness,a),r=this.findTexture(g.emissive,a),n=this.findTexture(g.roughness,a),i=this.findTexture(g.normal,a),s=this.findTexture(g.height,a),l=this.findTexture(g.ao,!1),p=this.findTexture("sss",!0),h=this.findTexture("porosity",!0),m=Math.max(e?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),u=Math.max(e?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),b=document.createElement("canvas");b.width=m,b.height=u;let d=b.getContext("2d"),f=document.createElement("canvas");f.width=m,f.height=u;let c=f.getContext("2d");if(!d||!c)return null;let x=new Uint8ClampedArray(m*u*4),v=new Uint8ClampedArray(m*u*4),_=e?.canvas,y=r?.canvas,k=n?.canvas,T=p?.canvas,L=h?.canvas,C=_?.getContext("2d"),j=y?.getContext("2d"),_e=k?.getContext("2d"),ye=T?.getContext("2d"),we=L?.getContext("2d"),Te=C?.getImageData(0,0,m,u),H=j?.getImageData(0,0,m,u),K=_e?.getImageData(0,0,m,u),Ce=ye?.getImageData(0,0,m,u),Ee=we?.getImageData(0,0,m,u);for(let E=0;E{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),e}createTexturesFromNormal(a){let e=this.decodeLabPbrNormal(a);return Object.entries(e).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),e}};var O=class{constructor({lightHeight:a=.66,ambientLight:e=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:n=[1,1,1]}={}){this.lightHeight=a,this.ambientLight=e,this.minLightIntensity=r,this.lightDiffuse=n}bake(a,e,r){let n=e instanceof HTMLCanvasElement?e:this.createCanvas(e.width,e.height),i=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),s=n.getContext("2d"),l=i.getContext("2d");s.drawImage(e,0,0),l.drawImage(r,0,0);let p=s.getImageData(0,0,e.width,e.height),h=l.getImageData(0,0,r.width,r.height),m=[],u=[];for(let d=0;d{let f=this.createCanvas(e.width,e.height),c=f.getContext("2d"),x=c.getImageData(0,0,f.width,f.height),v=[Math.cos(d),Math.sin(d),this.lightHeight];for(let _=0;_{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new D(r.layers_enabled?r.layers:Project.textures,r.uuid),i=n.findTexture(g.albedo);if(!i){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let s=n.findTexture(g.normal);if(!s){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let p=new O(t).bake(a,i.canvas,s.canvas),h=new Texture({name:`${i.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(p[0].toDataURL()),m=e?u=>{let b=n.findTexture(g.emissive);if(!b)return u;let d=b.canvas;if(!d.getContext("2d"))return u;let c=Math.max(u.width,d.width,Project?Project.texture_width:16),x=Math.max(u.height,d.height,Project?Project.texture_height:16),v=document.createElement("canvas");v.width=c,v.height=x;let _=v.getContext("2d");return _?(_.drawImage(u,0,0),_.globalCompositeOperation="screen",_.drawImage(d,0,0),v):u}:u=>u;p.forEach((u,b)=>{new TextureLayer({name:`baked_${b+1}`,data_url:m(u).toDataURL()},h).addForEditing()}),h.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};w.push(()=>{o.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(t){let a=new M.Color(t.ambientLight.toString()),e=new M.Color(t.lightDiffuse.toString());oe({ambientLight:[a.r,a.g,a.b],lightDiffuse:[e.r,e.g,e.b],lightHeight:Number(t.lightHeight),minLightIntensity:Number(t.minLightIntensity)},t.directions??8,t.blendEmissive??!1)}}),o.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){o.bakeTexturesDialog?.show()}}),MenuBar.addAction(o.bakeTexturesAction,"tools")});P.push(()=>{MenuBar.removeAction("tools.bake_textures")});function ie(t,a){let e=t.getTexture();if(!e||!Project)return null;let r=Project.materials[e.uuid];r.isShaderMaterial&&!Project.bb_materials[e.uuid]?Project.bb_materials[e.uuid]=r:r.isMeshStandardMaterial&&r.dispose();let n=new D(e.layers_enabled?e.layers.filter(i=>i.visible)??null:Project.textures,e.uuid).getMaterial({side:Canvas.getRenderSide(e),...a});return Project.materials[e.uuid]=M.ShaderMaterial.prototype.copy.call(n,r),e}function le(t){return Object.values(t).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function Ue(t,a){let e={};return t.forAllFaces(r=>{let n=ie(r,a);n&&(e[n.uuid]=n)}),le(e)}function Oe(t,a){let e={};return Object.keys(t.faces).forEach(r=>{let n=t.faces[r],i=ie(n,a);i&&(e[i.uuid]=i)}),le(e)}var R=(t={})=>{Project&&(Project.pbr_active=Texture.all.length>0&&Project.elements.map(a=>a instanceof Mesh&&Ue(a,t)||a instanceof Cube&&Oe(a,t)).filter(Boolean).length>0)},B=(t=100)=>se(R,t);var W={},Z={};w.push(()=>{Object.entries(g).forEach(([t,a])=>{W[t]=new Action(`assign_channel_${t}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:{selected:{texture:!0},project:!0,method(){return S()?.material===!0&&N()!==null}},click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e)return;Undo.initEdit({layers:[e]}),e.extend({channel:a.id});let r=e instanceof TextureLayer?e.texture:e;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([n,i])=>{i===e.uuid&&(delete Project.pbr_materials[r.uuid][n],e.channel=A)}),r.uuid===e.uuid&&(Project.pbr_materials[r.uuid]={}),Project.pbr_materials[r.uuid][t]=e.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${e.name}" to ${a.label} channel`,2e3),R()}}),Z[t]=new Action(`select_channel_${t}`,{icon:a.icon??"tv_options_edit_channels",name:a.label??t,description:`Select the ${a.label} channel`,condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){let e=S();return(e?.layers_enabled?e.layers:Texture.all).some(n=>n.channel===t)}},click(){let e=Texture.selected?.layers_enabled?Texture.selected.layers:Texture.all;if(!e||!e.length)return;let r=e.find(n=>n.channel===t);r&&(r.select(),r.scrollTo())}}),Z[t].addLabel(!0,()=>a.label??t)})});P.push(()=>{[...Object.values(W),...Object.values(Z)].forEach(a=>{a.delete()})});w.push(()=>{o.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:{selected:{texture:!0},method(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);return t?.channel&&t.channel!==A}},click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t)return;Undo.initEdit({layers:[t]});let a=t instanceof TextureLayer?t.texture:t,e=t.channel;Project.pbr_materials[a.uuid]={},t.channel=A,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${t.name}" from ${e} channel`,2e3),B()}}),o.channelMenu=new Menu("channel_menu",[...Object.keys(g).map(t=>`assign_channel_${t}`),"unassign_channel"],{onOpen(){B()}}),o.channelSelectionMenu=new Menu("channel_selection_menu",Object.keys(g).map(t=>`select_channel_${t}`)),o.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",condition:{modes:["edit","paint"],selected:{texture:!0}},click(t){o.channelMenu?.open(t)},children:[...Object.values(W),o.unassignChannel]}),o.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(t){o.channelMenu?.open(t)}}),o.showChannelSelectionMenu=new Action("show_channel_select_menu",{icon:"tv_options_edit_channels",name:"Select PBR Channel",description:"Select a channel to view",category:"textures",condition:{modes:["paint"],selected:{texture:!0}},click(t){o.channelSelectionMenu?.open(t)}}),o.openChannelMenu&&(MenuBar.addAction(o.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(o.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(o.openChannelMenu,"0")),Toolbars.layers.add(o.showChannelMenu,1)});P.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(o.showChannelMenu)});function q(t,a=!1){let e=t.canvas.getContext("2d");if(!e)return null;let r=Math.max(t.img.width??t.canvas.width,Project?Project.texture_width:0,16),n=Math.max(t.img.height??t.canvas.height,Project?Project.texture_height:0,16),{data:i}=e.getImageData(0,0,r,n),s=document.createElement("canvas"),l=s.getContext("2d");if(!l)return null;let p=(c,x)=>{let v=(c+x*r)*4;return i[v]/255};s.width=r,s.height=n,l.drawImage(t.img,0,0,r,n);let h=l.getImageData(0,0,r,n),m=h.data,u=c=>{let x=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);return[c[0]/x,c[1]/x,c[2]/x]};for(let c=0;c{let c=(d+f*e)*4;return n[c]/255};i.width=e,i.height=r,s.drawImage(t.img,0,0,e,r);let p=s.getImageData(0,0,e,r),h=p.data;for(let d=0;d{o.generateNormal=new Action("generate_normal",{icon:g.normal.icon??"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(N()??S())!==null,click(t){let a=N()??S()??Texture.getDefault();if(!a)return;let e=q(a);if(!e){Blockbench.showQuickMessage("Failed to generate normal map",2e3);return}e.select(t),new D(a instanceof Texture&&a.layers_enabled?a.layers:null,a.uuid).saveTexture(g.normal,e),Blockbench.showQuickMessage("Normal map generated",2e3)}}),o.generateAo=new Action("generate_ao",{icon:g.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let t=N()??S()??Texture.getDefault();if(!t)return;let a=new D(t instanceof Texture&&t.layers_enabled?t.layers:null,t.uuid),e=a.findTexture(g.normal)??q(t);if(!e){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=ce(e);if(r){a.saveTexture(g.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),MenuBar.addAction(o.generateNormal,"tools"),MenuBar.addAction(o.generateAo,"tools")});P.push(()=>{MenuBar.removeAction("tools.generate_normal")});var Fe=(t,a="texture")=>{t.toBlob(async e=>{e&&Blockbench.export({content:await e.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},ze=(t,a="texture")=>{t.toBlob(async e=>{e&&Blockbench.export({content:await e.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};w.push(()=>{o.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let t=S();if(!t)return;let e=new D(t.layers_enabled?t.layers:[t],t.uuid).createLabPbrOutput();if(e===null)return;let r=t.name??(Project?Project.getDisplayName():"texture");await Promise.all([Fe(e.normalMap,pathToName(r)),ze(e.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),o.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let t=TextureLayer.selected?.texture??Texture.all.find(e=>e.selected)??Texture.getDefault(),a=new D(t.layers_enabled?t.layers:[t],t.uuid);if(pathToName(t.name).endsWith("_n")){a.createTexturesFromNormal(t);return}if(pathToName(t.name).endsWith("_s")){a.createTexturesFromSpecular(t);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(o.generateLabPbr,"file.export"),MenuBar.addAction(o.decodeLabPbr,"tools")});P.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});w.push(()=>{o.createMaterialTexture=new Action("create_material_texture",{icon:"deployed_code",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let t={...g},a=new Texture({name:"New Material",saved:!1,particle:!1});a.extend({material:!0});let e=Texture.all.filter(s=>s.selected||s.multi_selected)??Texture.all,r=S(),n=r?new D(e,r.uuid):null;try{let s=n?.findTexture(g.albedo,!0)?.canvas.toDataURL()??r?.canvas.toDataURL()??J(new M.Color(8421504),a.canvas);if(!s)return;a.fromDataURL(s);let l=new TextureLayer({name:t.albedo.label,visible:!0,data_url:s,keep_size:!0},a);l.extend({channel:t.albedo.id}),l.addForEditing(),l.texture.updateChangesAfterEdit(),n?.saveTexture(t.albedo,l),delete t.albedo}catch(s){console.warn("Failed to create base color texture",s),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let i=Object.keys(t).map(s=>{let l=g[s],p=n?.findTexture(l,!0),h=p?p.canvas.toDataURL():J(l.default??new M.Color(0));if(!h)return;let m=new TextureLayer({name:l.label,visible:!0,data_url:h,keep_size:!0},a);return m.extend({channel:l.id}),n?.saveTexture(l,m),m}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:i}),a.add().select(),a.activateLayers(),i.map(s=>{s.addForEditing(),a.width=Math.max(a.width,s.img.width),a.height=Math.max(a.height,s.img.height)}),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(o.createMaterialTexture,"tools"),Toolbars.texturelist.add(o.createMaterialTexture,3)});P.push(()=>{MenuBar.removeAction("tools.create_material_texture"),Toolbars.texturelist.remove("create_material_texture")});var F=(t,a)=>{let e=S()??Texture.getDefault(),r=new D(e.layers_enabled?e.layers:Project?Project.textures:null,e.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[i,s]=Project?[t?`${t}_mer`:`${e.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:i,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},a)})};w.push(()=>{o.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{F()}catch(t){console.error("Failed to export MER map:",t),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),o.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let t=S()??Texture.getDefault(),a=new D([t],t.uuid),e=a.decodeMer(),r=[g.metalness,g.emissive,g.roughness];Undo.initEdit({textures:[t]}),r.forEach(n=>{let i=n.id,s=e[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new Texture({name:`${t?.name}_${i}`,keep_size:!1}).fromDataURL(s.toDataURL());l.add(!0),a.saveTexture(n,l)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>S()?.layers_enabled===!0,click(){let t=S()??Texture.getDefault(),a=new D(t.layers_enabled?t.layers:[t],t.uuid),e=a.decodeMer(),r=[g.metalness,g.emissive,g.roughness];Undo.initEdit({textures:[t]}),r.forEach(n=>{let i=n.id,s=e[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new TextureLayer({name:`${t?.name}_${i}`,data_url:s.toDataURL()},t);a.saveTexture(n,l),l.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(o.decodeMer,"tools"),MenuBar.addAction(o.generateMer,"file.export")});P.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var Ge=()=>{Project&&Project.textures.forEach(t=>{let a=new D(null,t.uuid),e=a.findTexture(g.normal,!1),r=a.findTexture(g.height,!1),n=a.findTexture(g.albedo,!1),i=a.findTexture(g.metalness,!1)?.name,s=a.findTexture(g.emissive,!1)?.name,l=a.findTexture(g.roughness,!1)?.name,p={};return n||(p.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!i&&!s&&!l&&(p.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},p.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},p.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),e&&(p.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(p.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),e&&r&&(p.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),o.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:p,cancelIndex:1,onConfirm(h){let m=I(),u=i||s||l,b={format_version:"1.16.100","minecraft:texture_set":{color:(n?m:h.baseColor?.toHexString())??m,metalness_emissive_roughness:[h.metalness??0,h.emissive??0,h.roughness??255]}};h.depthMap==="normal"&&e||!r&&e?b["minecraft:texture_set"].normal=`${m}_normal`:(!e||h.depthMap==="heightmap")&&r&&(b["minecraft:texture_set"].heightmap=`${m}_heightmap`);let d=x=>{if(!h.depthMap)return x();let v=h.depthMap==="normal"||h.depthMap&&!r,_=v?e:r;if(!_)return x();Blockbench.export({content:_.canvas.toDataURL()??"",type:"PNG",name:`${m}_${v?"normal":"heightmap"}`,extensions:["png"],resource_id:h.depthMap,startpath:Project.export_path,savetype:"image"},y=>{b["minecraft:texture_set"][v?"normal":"heightmap"]=pathToName(y,!1),x()})},f=x=>{if(!n)return x();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:m,startpath:Project.export_path,savetype:"image"},v=>{b["minecraft:texture_set"].color=pathToName(v,!1),x()})},c=()=>d(()=>{f(()=>{Blockbench.export({content:JSON.stringify(b,null,2),type:"JSON",name:`${m}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),o.textureSetDialog?.hide()})})});if(u){try{F(m,x=>{b["minecraft:texture_set"].metalness_emissive_roughness=pathToName(x,!1),c()})}catch(x){console.warn("Failed to export MER map:",x),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}c()}}),o.textureSetDialog.show()})};w.push(()=>{o.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){Ge()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(o.createTextureSet,"file.export")});P.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});w.push(()=>{o.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(t){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=t}),Preview.selected.renderer.physicallyCorrectLights=t,Blockbench.showQuickMessage(`Physically corrected lighting is now ${t?"enabled":"disabled"}`,2e3),t&&o.togglePbr?.set(!0),R()},click(){}}),MenuBar.addAction(o.toggleCorrectLights,"preview")});P.push(()=>{MenuBar.removeAction("preview.correct_lights")});var z=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(t=>{t instanceof Cube&&Object.keys(t.faces).forEach(a=>{let r=t.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var ue=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],me=()=>Project&&Project.pbr_active&&R(),Ve=()=>{Blockbench.on(ue.join(" "),me)},de=()=>{ue.forEach(t=>{Blockbench.removeListener(t,me)})};w.push(()=>{o.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(t){if(t){R(),Ve(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}z(),de(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(o.togglePbr,"view")});P.push(()=>{de(),MenuBar.removeAction("view.toggle_pbr")});var he=t=>{let a=Math.max(-2,Math.min(2,t));Preview.all.forEach(e=>{e.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};w.push(()=>{o.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(o.tonemappingSelect?.get())===M.NoToneMapping&&o.tonemappingSelect.change(M.LinearToneMapping.toString()),o.togglePbr?.set(!0)},onChange(t){he(Number(t))},onAfter(){B()}}),o.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>o.exposureSlider!==void 0&&Number(o.exposureSlider?.get())!==1,click(){he(1),o.exposureSlider?.setValue(1,!0),B()}}),o.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:M.NoToneMapping,value:Preview.selected.renderer.toneMapping??M.NoToneMapping,icon:"monochrome_photos",options:{[M.NoToneMapping]:"No Tone Mapping",[M.LinearToneMapping]:"Linear",[M.ReinhardToneMapping]:"Reinhard",[M.CineonToneMapping]:"Cineon",[M.NeutralToneMapping]:"Neutral",[M.ACESFilmicToneMapping]:"ACES"},onChange({value:t}){Preview.selected.renderer.toneMapping=Number(t);let a=1;Preview.selected.renderer.toneMapping===M.NoToneMapping?o.exposureSlider?.setValue(a,!0):a=Number(o.exposureSlider?.get()??1),Preview.all.forEach(e=>{e.renderer.toneMapping=Number(t),e.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(t)}`,2e3),o.togglePbr&&!o.togglePbr.value&&o.togglePbr.set(!0),R()}})});var X=class{async parse(a){let e=new re,r="model.usda";e.file(r,"");let n=xe(),i={},s={};a.traverseVisible(h=>{if(!h.isMesh)return;let m=h;if(!m.material.isMeshStandardMaterial){console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",h);return}let u=m.geometry,b=m.material,d="geometries/Geometry_"+u.id+".usd";if(!e.file(d)){let f=qe(u);e.file(d,Je(f))}b.uuid in i||(i[b.uuid]=b),n+=Ze(m,u,b)}),n+=tt(i,s),e.file(r,n),n=null;for(let h in s){let m=s[h],u=h.split("_")[1],b=m.format===M.RGBAFormat,d=Qe(m.image,u),c=await(await new Promise(x=>d.toBlob(v=>v&&x(v),b?"image/png":"image/jpeg",1))).arrayBuffer();e.file(`textures/Texture_${h}.${b?"png":"jpg"}`,c)}let l=0;e.forEach(async h=>{let m=34+h.length;l+=m;let u=l&63,b=await e.file(h).async("uint8array");if(u!==4){let d=64-u,f=new Uint8Array(d),c=new Uint8Array(b.length+d);c.set(b,0),c.set(f,b.length),e.file(h,c)}l+=b.length});let p=await e.generateAsync({type:"blob",compression:"STORE"});return new Uint8Array(await p.arrayBuffer())}};function Qe(t,a){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){let e=1024/Math.max(t.width,t.height),r=document.createElement("canvas");r.width=t.width*Math.min(1,e),r.height=t.height*Math.min(1,e);let n=r.getContext("2d");if(n.imageSmoothingEnabled=!1,n.drawImage(t,0,0,r.width,r.height),a!==void 0){let i=parseInt(a,16),s=(i>>16&255)/255,l=(i>>8&255)/255,p=(i&255)/255,h=n.getImageData(0,0,r.width,r.height),m=h.data;for(let u=0;u{var M=THREE,re=Vue,ne=window.JSZip;var A="_NONE_",p={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new M.Color(16777215),regex:new RegExp("(s|_)*(basecolor|color|albedo)","i")},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new M.Color(0),regex:new RegExp("[ _]*metal(lic|ness)?","i")},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new M.Color(0),regex:new RegExp("[ _]*(emissive|emission)","i")},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new M.Color(16777215),regex:new RegExp("[ _]*rough(ness)?","i")},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new M.Color(16777215),regex:new RegExp("[ _]*(height|bump)","i")},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new M.Color("rgb(128, 128, 255)"),regex:new RegExp("[ _]*normal","i")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new M.Color(16777215),regex:new RegExp("[ _]*(ao|ambientocclusion|ambient occlusion)","i")}},o={},w=[],P=[];var se=[...Object.keys(p).map(e=>p[e].id),A];w.push(()=>{o.channelProp=new Property(TextureLayer,"enum","channel",{default:A,values:se,label:"PBR Channel",exposed:!1}),o.textureChannelProp=new Property(Texture,"enum","channel",{default:A,values:se,label:"PBR Channel",exposed:!1}),o.materialTextureProp=new Property(Texture,"boolean","material",{default:!1,label:"Material Texture"}),o.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),o.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),o.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!1,values:[],label:"PBR Mode"})});function S(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(e=>e.selected)??null:Texture.all.find(e=>e.selected)??Texture.getDefault()}function N(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(e=>e.selected)??Project.selected_texture.layers[0]:S()?.getActiveLayer()??null}function I(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(S()?.name??"texture")}function oe(e,a){let t;return function(...r){let n=()=>{t=void 0,e.apply(this,r)};clearTimeout(t),t=setTimeout(n,a)}}function U(e){let a=MediaPreview.renderer??new M.WebGLRenderer({alpha:!0,antialias:!0}),t=new M.Scene,r=new M.PerspectiveCamera(75,96/96,.1,1e3),n=new M.AmbientLight(16777215,.75);t.add(n);let i=new M.PointLight(16777215,1,100);i.position.set(5,5,5),t.add(i);let s=new M.SphereGeometry(1,32,32),l=e instanceof M.MeshStandardMaterial&&e.isMeshStandardMaterial?e:new M.MeshStandardMaterial({color:e.albedo,metalness:e.metalness??0,roughness:e.roughness??1,emissive:e.emissive,bumpScale:e.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),g=new M.Mesh(s,l);t.add(g),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(t,r);let h=a.domElement.toDataURL();return l.dispose(),MediaPreview.renderer||(a.clear(),a.dispose()),h}function J(e,a){let t=a??document.createElement("canvas"),r=t.getContext("2d");if(!r)return t.remove(),null;let n=Math.max(Project?Project.texture_width:16,16),i=Math.max(Project?Project.texture_height:16,16);t.width=n,t.height=i,r.fillStyle=`rgb(${e.r*255}, ${e.g*255}, ${e.b*255})`,r.fillRect(0,0,n,i);let s=t.toDataURL();return a||t.remove(),s}var Oe=(e=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return e?a.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):a},D=class e{constructor(a,t){this._scope=a??Oe(),this._materialUuid=t}merToCanvas(){let a=this.getTexture(p.emissive),t=this.getTexture(p.roughness),r=this.getTexture(p.metalness);if(!a&&!t&&!r){let{metalness:n,emissive:i,roughness:s}=this.decodeMer();n&&(r=e.makePixelatedCanvas(n)),i&&(a=e.makePixelatedCanvas(i)),s&&(t=e.makePixelatedCanvas(s))}return{emissiveMap:a,roughnessMap:t,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(p.emissive),roughnessMap:this.getTexture(p.roughness),metalnessMap:this.getTexture(p.metalness)},i=this.getTexture(p.normal);return new M.MeshStandardMaterial({map:this.getTexture(p.albedo)??e.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(s=>s.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(p.ao),bumpMap:this.getTexture(p.height),normalMap:i,normalScale:new M.Vector2(-1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}renderMaterialPreview(){return U(this.getMaterial())}saveTexture(a,t){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=t.uuid,t.extend({channel:a.id}))}findTexture(a,t=!0){if(!Project)return null;let r=this._scope.find(g=>g.channel&&(g.channel===a||g.channel===a.id));if(r)return r;let[n,i]=typeof a=="string"?[a,new RegExp(`_*${a}(.[^.]+)?$`,"i")]:[a.id,a.regex??new RegExp(`_*${a.id}(.[^.]+)?$`,"i")];Project.pbr_materials=Project.pbr_materials??{};let s=Project.pbr_materials[this._materialUuid];if(t&&!s?.length&&n!==A)return this._scope.find(g=>i.test(g.name))??null;let l=s?.[n];return l?this._scope.find(g=>g.uuid===l)??null:null}static makePixelatedCanvas(a){let t=new M.CanvasTexture(a,void 0,void 0,void 0,M.NearestFilter,M.NearestFilter);return t.needsUpdate=!0,t}getTexture(a){let t=this.findTexture(a);return t?e.makePixelatedCanvas(t.canvas):null}static extractChannel(a,t){let r=a.canvas,{width:n,height:i}=r,s=r.getContext("2d");if(!s||!n||!i)return null;let l=document.createElement("canvas");l.width=n,l.height=i;let g=l.getContext("2d");if(!g)return null;let h={r:0,g:1,b:2,a:3}[t],{data:m}=s.getImageData(0,0,n,i),u=new Uint8ClampedArray(n*i*4);for(let d=0;da){f[c]=b.data[c],f[c+1]=b.data[c+1],f[c+2]=b.data[c+2],f[c+3]=255;continue}f[c]=0,f[c+1]=0,f[c+2]=0,f[c+3]=255}return h.putImageData(new ImageData(f,l.width,l.height),0,0),{metalness:r,emissive:l,emissiveLevel:n,roughness:i,sss:s}}createMer(a=!1){let t=this.findTexture(p.metalness,a),r=this.findTexture(p.emissive,a),n=this.findTexture(p.roughness,a),i=this.findTexture("sss",!1),s=Math.max(t?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),l=Math.max(t?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),g=document.createElement("canvas");g.width=s,g.height=l;let h=g.getContext("2d");if(!h)return null;let m=t?.img?e.extractChannel(t,"r"):null,u=r?.img?e.extractChannel(r,"g"):null,b=n?.img?e.extractChannel(n,"b"):null,d=i&&i?.img?e.extractChannel(i,"a"):null,f=m?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),c=u?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),x=b?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),v=d?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(new Uint8ClampedArray(s*l*4).fill(255),s,l),_=new Uint8ClampedArray(s*l*4);for(let y=0;y<_.length;y+=4)_[y]=f.data[y],_[y+1]=c.data[y],_[y+2]=x.data[y],_[y+3]=v.data[y];return h.putImageData(new ImageData(_,s,l),0,0),g}createLabPbrOutput(a=!0){let t=this.findTexture(p.metalness,a),r=this.findTexture(p.emissive,a),n=this.findTexture(p.roughness,a),i=this.findTexture(p.normal,a),s=this.findTexture(p.height,a),l=this.findTexture(p.ao,!1),g=this.findTexture("sss",!0),h=this.findTexture("porosity",!0),m=Math.max(t?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),u=Math.max(t?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),b=document.createElement("canvas");b.width=m,b.height=u;let d=b.getContext("2d"),f=document.createElement("canvas");f.width=m,f.height=u;let c=f.getContext("2d");if(!d||!c)return null;let x=new Uint8ClampedArray(m*u*4),v=new Uint8ClampedArray(m*u*4),_=t?.canvas,y=r?.canvas,k=n?.canvas,T=g?.canvas,L=h?.canvas,C=_?.getContext("2d"),j=y?.getContext("2d"),we=k?.getContext("2d"),Te=T?.getContext("2d"),Ce=L?.getContext("2d"),Ee=C?.getImageData(0,0,m,u),H=j?.getImageData(0,0,m,u),ee=we?.getImageData(0,0,m,u),Pe=Te?.getImageData(0,0,m,u),Le=Ce?.getImageData(0,0,m,u);for(let E=0;E{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createTexturesFromNormal(a){let t=this.decodeLabPbrNormal(a);return Object.entries(t).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}};var O=class{constructor({lightHeight:a=.66,ambientLight:t=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:n=[1,1,1]}={}){this.lightHeight=a,this.ambientLight=t,this.minLightIntensity=r,this.lightDiffuse=n}bake(a,t,r){let n=t instanceof HTMLCanvasElement?t:this.createCanvas(t.width,t.height),i=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),s=n.getContext("2d"),l=i.getContext("2d");s.drawImage(t,0,0),l.drawImage(r,0,0);let g=s.getImageData(0,0,t.width,t.height),h=l.getImageData(0,0,r.width,r.height),m=[],u=[];for(let d=0;d{let f=this.createCanvas(t.width,t.height),c=f.getContext("2d"),x=c.getImageData(0,0,f.width,f.height),v=[Math.cos(d),Math.sin(d),this.lightHeight];for(let _=0;_{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new D(r.layers_enabled?r.layers:Project.textures,r.uuid),i=n.findTexture(p.albedo);if(!i){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let s=n.findTexture(p.normal);if(!s){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let g=new O(e).bake(a,i.canvas,s.canvas),h=new Texture({name:`${i.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(g[0].toDataURL()),m=t?u=>{let b=n.findTexture(p.emissive);if(!b)return u;let d=b.canvas;if(!d.getContext("2d"))return u;let c=Math.max(u.width,d.width,Project?Project.texture_width:16),x=Math.max(u.height,d.height,Project?Project.texture_height:16),v=document.createElement("canvas");v.width=c,v.height=x;let _=v.getContext("2d");return _?(_.drawImage(u,0,0),_.globalCompositeOperation="screen",_.drawImage(d,0,0),v):u}:u=>u;g.forEach((u,b)=>{new TextureLayer({name:`baked_${b+1}`,data_url:m(u).toDataURL()},h).addForEditing()}),h.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};w.push(()=>{o.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(e){let a=new M.Color(e.ambientLight.toString()),t=new M.Color(e.lightDiffuse.toString());ie({ambientLight:[a.r,a.g,a.b],lightDiffuse:[t.r,t.g,t.b],lightHeight:Number(e.lightHeight),minLightIntensity:Number(e.minLightIntensity)},e.directions??8,e.blendEmissive??!1)}}),o.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){o.bakeTexturesDialog?.show()}}),MenuBar.addAction(o.bakeTexturesAction,"tools")});P.push(()=>{MenuBar.removeAction("tools.bake_textures")});function le(e,a){let t=e.getTexture();if(!t||!Project)return null;let r=Project.materials[t.uuid];r.isShaderMaterial&&!Project.bb_materials[t.uuid]?Project.bb_materials[t.uuid]=r:r.isMeshStandardMaterial&&r.dispose();let n=new D(t.layers_enabled?t.layers.filter(i=>i.visible)??null:Project.textures,t.uuid).getMaterial({side:Canvas.getRenderSide(t),...a});return Project.materials[t.uuid]=M.ShaderMaterial.prototype.copy.call(n,r),t}function ce(e){return Object.values(e).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function Fe(e,a){let t={};return e.forAllFaces(r=>{let n=le(r,a);n&&(t[n.uuid]=n)}),ce(t)}function ze(e,a){let t={};return Object.keys(e.faces).forEach(r=>{let n=e.faces[r],i=le(n,a);i&&(t[i.uuid]=i)}),ce(t)}var R=(e={})=>{Project&&(Project.pbr_active=Texture.all.length>0&&Project.elements.map(a=>a instanceof Mesh&&Fe(a,e)||a instanceof Cube&&ze(a,e)).filter(Boolean).length>0)},B=(e=100)=>oe(R,e);var q={},Z={},W=()=>Condition({modes:["edit","paint"],selected:{texture:!0},project:!0,method(){let e=S();return e&&!e.material?!0:e?.material===!0&&N()!==null&&Modes.paint}}),ue=()=>Condition({modes:["paint","edit"],selected:{texture:!0},method(){let e=S();if(e?.material&&Modes.edit)return!1;let a=N()??e;return a?.channel&&a.channel!==A}});w.push(()=>{Object.entries(p).forEach(([e,a])=>{q[e]=new Action(`assign_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:W,click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t)return;Undo.initEdit({layers:[t]}),t.extend({channel:a.id});let r=t instanceof TextureLayer?t.texture:t;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([n,i])=>{i===t.uuid&&(delete Project.pbr_materials[r.uuid][n],t.channel=A)}),r.uuid===t.uuid&&(Project.pbr_materials[r.uuid]={}),Project.pbr_materials[r.uuid][e]=t.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${t.name}" to ${a.label} channel`,2e3),R()}}),Z[e]=new Action(`select_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:a.label??e,description:`Select the ${a.label} channel`,condition:{project:!0,selected:{texture:!0},modes:["paint","edit"],method(){let t=S();return(t?.layers_enabled?t.layers:Texture.all).some(n=>n.channel===e)}},click(){let t=Texture.selected?.layers_enabled?Texture.selected.layers:Texture.all;if(!t||!t.length)return;let r=t.find(n=>n.channel===e);r&&(Modes.options.paint.select(),r.select(),r.scrollTo())}}),Z[e].addLabel(!0,()=>a.label??e)})});P.push(()=>{[...Object.values(q),...Object.values(Z)].forEach(a=>{a.delete()})});w.push(()=>{o.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:ue,click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e)return;Undo.initEdit({layers:[e]});let a=e instanceof TextureLayer?e.texture:e,t=e.channel;Project.pbr_materials[a.uuid]={},e.channel=A,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${e.name}" from ${t} channel`,2e3),B()}}),o.channelMenu=new Menu("channel_menu",[...Object.keys(p).map(e=>`assign_channel_${e}`),"unassign_channel"],{onOpen(){B()}}),o.channelSelectionMenu=new Menu("channel_selection_menu",Object.keys(p).map(e=>`select_channel_${e}`)),o.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",condition:()=>W()||ue(),click(e){o.channelMenu?.open(e)},children:[...Object.values(q),o.unassignChannel]}),o.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:W,click(e){o.channelMenu?.open(e)}}),o.showChannelSelectionMenu=new Action("show_channel_select_menu",{icon:"tv_options_edit_channels",name:"Select PBR Channel",description:"Select a channel to view",category:"textures",condition:{modes:["edit","paint"],selected:{texture:!0},method(){let e=S();return(e?.layers_enabled?e.layers:Texture.all).some(t=>Object.keys(p).some(r=>t.channel===r))}},click(e){o.channelSelectionMenu?.open(e)}}),o.openChannelMenu&&(MenuBar.addAction(o.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(o.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(o.openChannelMenu,"0")),Toolbars.layers.add(o.showChannelMenu,1)});P.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(o.showChannelMenu)});function X(e,a=!1){let t=e.canvas.getContext("2d");if(!t)return null;let r=Math.max(e.img.width??e.canvas.width,Project?Project.texture_width:0,16),n=Math.max(e.img.height??e.canvas.height,Project?Project.texture_height:0,16),{data:i}=t.getImageData(0,0,r,n),s=document.createElement("canvas"),l=s.getContext("2d");if(!l)return null;let g=(c,x)=>{let v=(c+x*r)*4;return i[v]/255};s.width=r,s.height=n,l.drawImage(e.img,0,0,r,n);let h=l.getImageData(0,0,r,n),m=h.data,u=c=>{let x=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);return[c[0]/x,c[1]/x,c[2]/x]};for(let c=0;c{let c=(d+f*t)*4;return n[c]/255};i.width=t,i.height=r,s.drawImage(e.img,0,0,t,r);let g=s.getImageData(0,0,t,r),h=g.data;for(let d=0;d{o.generateNormal=new Action("generate_normal",{icon:p.normal.icon??"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(N()??S())!==null,click(e){let a=N()??S()??Texture.getDefault();if(!a)return;let t=X(a);if(!t){Blockbench.showQuickMessage("Failed to generate normal map",2e3);return}t.select(e),new D(a instanceof Texture&&a.layers_enabled?a.layers:null,a.uuid).saveTexture(p.normal,t),Blockbench.showQuickMessage("Normal map generated",2e3)}}),o.generateAo=new Action("generate_ao",{icon:p.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let e=N()??S()??Texture.getDefault();if(!e)return;let a=new D(e instanceof Texture&&e.layers_enabled?e.layers:null,e.uuid),t=a.findTexture(p.normal)??X(e);if(!t){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=me(t);if(r){a.saveTexture(p.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),MenuBar.addAction(o.generateNormal,"tools"),MenuBar.addAction(o.generateAo,"tools")});P.push(()=>{MenuBar.removeAction("tools.generate_normal")});var Ge=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},Ve=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};w.push(()=>{o.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let e=S();if(!e)return;let t=new D(e.layers_enabled?e.layers:[e],e.uuid).createLabPbrOutput();if(t===null)return;let r=e.name??(Project?Project.getDisplayName():"texture");await Promise.all([Ge(t.normalMap,pathToName(r)),Ve(t.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),o.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let e=TextureLayer.selected?.texture??Texture.all.find(t=>t.selected)??Texture.getDefault(),a=new D(e.layers_enabled?e.layers:[e],e.uuid);if(pathToName(e.name).endsWith("_n")){a.createTexturesFromNormal(e);return}if(pathToName(e.name).endsWith("_s")){a.createTexturesFromSpecular(e);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(o.generateLabPbr,"file.export"),MenuBar.addAction(o.decodeLabPbr,"tools")});P.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});w.push(()=>{o.createMaterialTexture=new Action("create_material_texture",{icon:"deployed_code",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let e={...p},a=new Texture({name:"New Material",saved:!1,particle:!1});a.extend({material:!0});let t=Texture.all.filter(s=>(s.selected||s.multi_selected)&&!s.material)??Texture.all,r=S(),n=r?new D(t,r.uuid):null;try{let s=n?.findTexture(p.albedo,!0)?.canvas.toDataURL()??r?.canvas.toDataURL()??J(new M.Color(8421504),a.canvas);if(!s)return;a.fromDataURL(s);let l=new TextureLayer({name:e.albedo.label,visible:!0,data_url:s,keep_size:!0},a);l.extend({channel:e.albedo.id}),l.addForEditing(),l.texture.updateChangesAfterEdit(),n?.saveTexture(e.albedo,l),delete e.albedo}catch(s){console.warn("Failed to create base color texture",s),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let i=Object.keys(e).map(s=>{let l=p[s],g=n?.findTexture(l,!0),h=g?g.canvas.toDataURL():J(l.default??new M.Color(0));if(!h)return;let m=new TextureLayer({name:l.label,visible:!0,data_url:h,keep_size:!0},a);return m.extend({channel:l.id}),n?.saveTexture(l,m),m}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:i}),a.add().select(),a.activateLayers(),i.map(s=>{s.addForEditing(),a.width=Math.max(a.width,s.img.width),a.height=Math.max(a.height,s.img.height)}),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(o.createMaterialTexture,"tools"),Toolbars.texturelist.add(o.createMaterialTexture,3)});P.push(()=>{MenuBar.removeAction("tools.create_material_texture"),Toolbars.texturelist.remove("create_material_texture")});var F=(e,a)=>{let t=S()??Texture.getDefault(),r=new D(t.layers_enabled?t.layers:Project?Project.textures:null,t.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[i,s]=Project?[e?`${e}_mer`:`${t.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:i,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},a)})};w.push(()=>{o.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{F()}catch(e){console.error("Failed to export MER map:",e),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),o.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let e=S()??Texture.getDefault(),a=new D([e],e.uuid),t=a.decodeMer(),r=[p.metalness,p.emissive,p.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new Texture({name:`${e?.name}_${i}`,keep_size:!1}).fromDataURL(s.toDataURL());l.add(!0),a.saveTexture(n,l)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>S()?.layers_enabled===!0,click(){let e=S()??Texture.getDefault(),a=new D(e.layers_enabled?e.layers:[e],e.uuid),t=a.decodeMer(),r=[p.metalness,p.emissive,p.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new TextureLayer({name:`${e?.name}_${i}`,data_url:s.toDataURL()},e);a.saveTexture(n,l),l.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(o.decodeMer,"tools"),MenuBar.addAction(o.generateMer,"file.export")});P.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var Qe=()=>{Project&&Project.textures.forEach(e=>{let a=new D(null,e.uuid),t=a.findTexture(p.normal,!1),r=a.findTexture(p.height,!1),n=a.findTexture(p.albedo,!1),i=a.findTexture(p.metalness,!1)?.name,s=a.findTexture(p.emissive,!1)?.name,l=a.findTexture(p.roughness,!1)?.name,g={};return n||(g.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!i&&!s&&!l&&(g.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},g.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},g.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),t&&(g.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(g.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),t&&r&&(g.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),o.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:g,cancelIndex:1,onConfirm(h){let m=I(),u=i||s||l,b={format_version:"1.16.100","minecraft:texture_set":{color:(n?m:h.baseColor?.toHexString())??m,metalness_emissive_roughness:[h.metalness??0,h.emissive??0,h.roughness??255]}};h.depthMap==="normal"&&t||!r&&t?b["minecraft:texture_set"].normal=`${m}_normal`:(!t||h.depthMap==="heightmap")&&r&&(b["minecraft:texture_set"].heightmap=`${m}_heightmap`);let d=x=>{if(!h.depthMap)return x();let v=h.depthMap==="normal"||h.depthMap&&!r,_=v?t:r;if(!_)return x();Blockbench.export({content:_.canvas.toDataURL()??"",type:"PNG",name:`${m}_${v?"normal":"heightmap"}`,extensions:["png"],resource_id:h.depthMap,startpath:Project.export_path,savetype:"image"},y=>{b["minecraft:texture_set"][v?"normal":"heightmap"]=pathToName(y,!1),x()})},f=x=>{if(!n)return x();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:m,startpath:Project.export_path,savetype:"image"},v=>{b["minecraft:texture_set"].color=pathToName(v,!1),x()})},c=()=>d(()=>{f(()=>{Blockbench.export({content:JSON.stringify(b,null,2),type:"JSON",name:`${m}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),o.textureSetDialog?.hide()})})});if(u){try{F(m,x=>{b["minecraft:texture_set"].metalness_emissive_roughness=pathToName(x,!1),c()})}catch(x){console.warn("Failed to export MER map:",x),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}c()}}),o.textureSetDialog.show()})};w.push(()=>{o.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){Qe()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(o.createTextureSet,"file.export")});P.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});w.push(()=>{o.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(e){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=e}),Preview.selected.renderer.physicallyCorrectLights=e,Blockbench.showQuickMessage(`Physically corrected lighting is now ${e?"enabled":"disabled"}`,2e3),e&&o.togglePbr?.set(!0),R()},click(){}}),MenuBar.addAction(o.toggleCorrectLights,"preview")});P.push(()=>{MenuBar.removeAction("preview.correct_lights")});var z=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(e=>{e instanceof Cube&&Object.keys(e.faces).forEach(a=>{let r=e.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var de=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],he=()=>Project&&Project.pbr_active&&R(),Je=()=>{Blockbench.on(de.join(" "),he)},pe=()=>{de.forEach(e=>{Blockbench.removeListener(e,he)})};w.push(()=>{o.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(e){if(e){R(),Je(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}z(),pe(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(o.togglePbr,"view")});P.push(()=>{pe(),MenuBar.removeAction("view.toggle_pbr")});var ge=e=>{let a=Math.max(-2,Math.min(2,e));Preview.all.forEach(t=>{t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};w.push(()=>{o.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(o.tonemappingSelect?.get())===M.NoToneMapping&&o.tonemappingSelect.change(M.LinearToneMapping.toString()),o.togglePbr?.set(!0)},onChange(e){ge(Number(e))},onAfter(){B()}}),o.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>o.exposureSlider!==void 0&&Number(o.exposureSlider?.get())!==1,click(){ge(1),o.exposureSlider?.setValue(1,!0),B()}}),o.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:M.NoToneMapping,value:Preview.selected.renderer.toneMapping??M.NoToneMapping,icon:"monochrome_photos",options:{[M.NoToneMapping]:"No Tone Mapping",[M.LinearToneMapping]:"Linear",[M.ReinhardToneMapping]:"Reinhard",[M.CineonToneMapping]:"Cineon",[M.NeutralToneMapping]:"Neutral",[M.ACESFilmicToneMapping]:"ACES"},onChange({value:e}){Preview.selected.renderer.toneMapping=Number(e);let a=1;Preview.selected.renderer.toneMapping===M.NoToneMapping?o.exposureSlider?.setValue(a,!0):a=Number(o.exposureSlider?.get()??1),Preview.all.forEach(t=>{t.renderer.toneMapping=Number(e),t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(e)}`,2e3),o.togglePbr&&!o.togglePbr.value&&o.togglePbr.set(!0),R()}})});var Y=class{async parse(a){let t=new ne,r="model.usda";t.file(r,"");let n=Me(),i={},s={};a.traverseVisible(h=>{if(!h.isMesh)return;let m=h;if(!m.material.isMeshStandardMaterial){console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",h);return}let u=m.geometry,b=m.material,d="geometries/Geometry_"+u.id+".usd";if(!t.file(d)){let f=Ye(u);t.file(d,We(f))}b.uuid in i||(i[b.uuid]=b),n+=qe(m,u,b)}),n+=rt(i,s),t.file(r,n),n=null;for(let h in s){let m=s[h],u=h.split("_")[1],b=m.format===M.RGBAFormat,d=Ze(m.image,u),c=await(await new Promise(x=>d.toBlob(v=>v&&x(v),b?"image/png":"image/jpeg",1))).arrayBuffer();t.file(`textures/Texture_${h}.${b?"png":"jpg"}`,c)}let l=0;t.forEach(async h=>{let m=34+h.length;l+=m;let u=l&63,b=await t.file(h).async("uint8array");if(u!==4){let d=64-u,f=new Uint8Array(d),c=new Uint8Array(b.length+d);c.set(b,0),c.set(f,b.length),t.file(h,c)}l+=b.length});let g=await t.generateAsync({type:"blob",compression:"STORE"});return new Uint8Array(await g.arrayBuffer())}};function Ze(e,a){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=1024/Math.max(e.width,e.height),r=document.createElement("canvas");r.width=e.width*Math.min(1,t),r.height=e.height*Math.min(1,t);let n=r.getContext("2d");if(n.imageSmoothingEnabled=!1,n.drawImage(e,0,0,r.width,r.height),a!==void 0){let i=parseInt(a,16),s=(i>>16&255)/255,l=(i>>8&255)/255,g=(i&255)/255,h=n.getImageData(0,0,r.width,r.height),m=h.data;for(let u=0;u ) { matrix4d xformOp:transform = ${n} uniform token[] xformOpOrder = ["xformOp:transform"] - rel material:binding = + rel material:binding = } -`}function We(t){let a=t.elements;return`( ${G(a,0)}, ${G(a,4)}, ${G(a,8)}, ${G(a,12)} )`}function G(t,a){return`(${t[a+0]}, ${t[a+1]}, ${t[a+2]}, ${t[a+3]})`}function qe(t){return` +`}function Xe(e){let a=e.elements;return`( ${G(a,0)}, ${G(a,4)}, ${G(a,8)}, ${G(a,12)} )`}function G(e,a){return`(${e[a+0]}, ${e[a+1]}, ${e[a+2]}, ${e[a+3]})`}function Ye(e){return` def "Geometry" { - ${Xe(t)} + ${Ke(e)} } -`}function Xe(t){let a="Geometry",e=t.attributes,r=e.position.count;return` +`}function Ke(e){let a="Geometry",t=e.attributes,r=t.position.count;return` def Mesh "${a}" { - int[] faceVertexCounts = [${Ye(t)}] - int[] faceVertexIndices = [${Ke(t)}] - normal3f[] normals = [${pe(e.normal,r)}] ( + int[] faceVertexCounts = [${et(e)}] + int[] faceVertexIndices = [${tt(e)}] + normal3f[] normals = [${fe(t.normal,r)}] ( interpolation = "vertex" ) - point3f[] points = [${pe(e.position,r)}] - float2[] primvars:st = [${et(e.uv,r)}] ( + point3f[] points = [${fe(t.position,r)}] + float2[] primvars:st = [${at(t.uv,r)}] ( interpolation = "vertex" ) uniform token subdivisionScheme = "none" } -`}function Ye(t){let a=t.index!==null?t.index.count:t.attributes.position.count;return Array(a/3).fill(3).join(", ")}function Ke(t){let a=t.index,e=[];if(a!==null)for(let r=0;r - float2 inputs:scale = ${fe(l.repeat)} - float2 inputs:translation = ${fe(l.offset)} + float2 inputs:in.connect = + float2 inputs:scale = ${be(l.repeat)} + float2 inputs:translation = ${be(l.offset)} float2 outputs:result } - def Shader "Texture_${l.id}_${p}" + def Shader "Texture_${l.id}_${g}" { uniform token info:id = "UsdUVTexture" asset inputs:file = @textures/Texture_${m}.${u?"png":"jpg"}@ - float2 inputs:st.connect = + float2 inputs:st.connect = token inputs:wrapS = "repeat" token inputs:wrapT = "repeat" float outputs:r float outputs:g float outputs:b float3 outputs:rgb - }`}let s=t;if(s.map!==null?(r.push(`${e}color3f inputs:diffuseColor.connect = `),n.push(i(s.map,"diffuse",s.color))):r.push(`${e}color3f inputs:diffuseColor = ${ge(s.color)}`),s.emissiveMap!==null?(r.push(`${e}color3f inputs:emissiveColor.connect = `),n.push(i(s.emissiveMap,"emissive"))):s.emissive.getHex()>0&&r.push(`${e}color3f inputs:emissiveColor = ${ge(s.emissive)}`),s.normalMap!==null&&(r.push(`${e}normal3f inputs:normal.connect = `),n.push(i(s.normalMap,"normal"))),s.aoMap!==null&&(r.push(`${e}float inputs:occlusion.connect = `),n.push(i(s.aoMap,"occlusion"))),s.roughnessMap!==null&&s.roughness===1?(r.push(`${e}float inputs:roughness.connect = `),n.push(i(s.roughnessMap,"roughness"))):r.push(`${e}float inputs:roughness = ${s.roughness}`),s.metalnessMap!==null&&s.metalness===1?(r.push(`${e}float inputs:metallic.connect = `),n.push(i(s.metalnessMap,"metallic"))):r.push(`${e}float inputs:metallic = ${s.metalness}`),s.alphaMap!==null?(r.push(`${e}float inputs:opacity.connect = `),r.push(`${e}float inputs:opacityThreshold = 0.0001`),n.push(i(s.alphaMap,"opacity"))):r.push(`${e}float inputs:opacity = ${s.opacity}`),s.isMeshPhysicalMaterial){let l=s;r.push(`${e}float inputs:clearcoat = ${l.clearcoat}`),r.push(`${e}float inputs:clearcoatRoughness = ${l.clearcoatRoughness}`),r.push(`${e}float inputs:ior = ${l.ior}`)}return` + }`}let s=e;if(s.map!==null?(r.push(`${t}color3f inputs:diffuseColor.connect = `),n.push(i(s.map,"diffuse",s.color))):r.push(`${t}color3f inputs:diffuseColor = ${xe(s.color)}`),s.emissiveMap!==null?(r.push(`${t}color3f inputs:emissiveColor.connect = `),n.push(i(s.emissiveMap,"emissive"))):s.emissive.getHex()>0&&r.push(`${t}color3f inputs:emissiveColor = ${xe(s.emissive)}`),s.normalMap!==null&&(r.push(`${t}normal3f inputs:normal.connect = `),n.push(i(s.normalMap,"normal"))),s.aoMap!==null&&(r.push(`${t}float inputs:occlusion.connect = `),n.push(i(s.aoMap,"occlusion"))),s.roughnessMap!==null&&s.roughness===1?(r.push(`${t}float inputs:roughness.connect = `),n.push(i(s.roughnessMap,"roughness"))):r.push(`${t}float inputs:roughness = ${s.roughness}`),s.metalnessMap!==null&&s.metalness===1?(r.push(`${t}float inputs:metallic.connect = `),n.push(i(s.metalnessMap,"metallic"))):r.push(`${t}float inputs:metallic = ${s.metalness}`),s.alphaMap!==null?(r.push(`${t}float inputs:opacity.connect = `),r.push(`${t}float inputs:opacityThreshold = 0.0001`),n.push(i(s.alphaMap,"opacity"))):r.push(`${t}float inputs:opacity = ${s.opacity}`),s.isMeshPhysicalMaterial){let l=s;r.push(`${t}float inputs:clearcoat = ${l.clearcoat}`),r.push(`${t}float inputs:clearcoatRoughness = ${l.clearcoatRoughness}`),r.push(`${t}float inputs:ior = ${l.ior}`)}return` def Material "Material_${s.id}" { def Shader "PreviewSurface" @@ -93,8 +93,8 @@ ${n.join(` `)} } -`}function ge(t){return`(${t.r}, ${t.g}, ${t.b})`}function fe(t){return`(${t.x}, ${t.y})`}var be=X;w.push(()=>{let t=new Codec("usdz",{extension:"usdz",name:"USDZ",remember:!0,export_options:{},fileName(){return I()+".usdz"},async compile(a={}){if(!Project)throw new Error("No project loaded");R();let e=Object.assign(this.getExportOptions(),a),r=new be,n=new M.Scene;n.name="blockbench_export",n.add(Project.model_3d);let i=await r.parse(n);return this.dispatchEvent("compile",{model:i,options:e}),Canvas.scene.add(Project.model_3d),i},async export(){let a=await this.compile();Blockbench.export({content:a,name:this.fileName(),startpath:this.startPath(),resource_id:"usdz",type:this.name,extensions:["usdz"],savetype:"buffer"},e=>this.afterDownload(e))}});o.exportUsdz=new Action("export_usdz",{category:"file",name:"Export USDZ",description:"Exports the current model as a USDZ file",icon:"file_download",async click(){t&&await t.export()}}),o.usdz=t,MenuBar.addAction(o.exportUsdz,"file.export")});P.push(()=>{MenuBar.removeAction("file.export_usdz")});var V=class t{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(g).map(e=>[e,g[e].default??new M.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([e,r])=>[e,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let e=Math.min(1,Math.max(0,a));return new M.Color(e,e,e).convertSRGBToLinear()}static fromSettings(){let a="#000000",e=Number(o.brushMetalnessSlider?.get()),r=Number(o.brushRoughnessSlider?.get()??1),n=(o.brushEmissiveColor?.get()??a).toString(),i=Number(o.brushHeightSlider?.get()),s=ColorPanel.get(),l={[g.albedo.id]:new M.Color(s),[g.metalness.id]:t.makeLinearColor(e),[g.roughness.id]:t.makeLinearColor(r),[g.emissive.id]:new M.Color(n??a),[g.height.id]:t.makeLinearColor(i),[g.normal.id]:g.normal.default??new M.Color("#8080ff")};return new t({colors:l})}};var Me="materialBrushPresets",Y=()=>JSON.parse(localStorage.getItem(Me)||"{}"),rt=(t,a)=>{let e=Y(),r=a??guid(),n=o.userMaterialBrushPresets?.getFormResult()??{},i={};return n.albedo&&(i.albedo=n.albedo.toString()),n.metalness&&(i.metalness=Number(n.metalness)),n.roughness&&(i.roughness=Number(n.roughness)),n.emissive&&(i.emissive=n.emissive.toString()),n.height&&(i.height=Number(n.height)),e[r]=[i,t??"New Preset",U(i)],localStorage.setItem(Me,JSON.stringify(e)),r},ve=({metalness:t,roughness:a,emissive:e,height:r,albedo:n})=>{t!==void 0&&o.brushMetalnessSlider?.setValue(t||0,!0),a!==void 0&&o.brushRoughnessSlider?.setValue(a??1,!0),e!==void 0&&o.brushEmissiveColor?.set(e??"#000000"),r!==void 0&&o.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},Q=({id:t})=>Condition({project:!0,tools:["material_brush"],method(){let a=S();return(a?.layers_enabled&&a.layers.find(({channel:e})=>e&&e===t)!==void 0)===!0}}),nt=ae.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:g}},methods:{applyPreset(t){try{let[a,e]=this.userPresets[t],{metalness:r,roughness:n,emissive:i,height:s,albedo:l}=a;ve({metalness:Number(r),roughness:Number(n),emissive:i.toString(),height:Number(s),albedo:l.toString()}),o.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${e}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(t){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let e=Y(),r=this.userPresets[t][1]??t;delete e[t],localStorage.setItem("materialBrushPresets",JSON.stringify(e)),this.userPresets=e,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(t){o.userMaterialBrushPresets?.setFormValues({name:this.userPresets[t][1]??t,...this.userPresets[t][0]})},getSummary(t){return Object.entries(t).filter(([a])=>a in this.channels).map(([a,e])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${e}`:`${this.channels[a]?.label??a}: ${Number(e).toFixed(1)}`).join(` -`)}},computed:{presets(){return Object.entries(this.userPresets)}},mounted(){this.userPresets=Y()},template:` +`}function xe(e){return`(${e.r}, ${e.g}, ${e.b})`}function be(e){return`(${e.x}, ${e.y})`}var ve=Y;w.push(()=>{let e=new Codec("usdz",{extension:"usdz",name:"USDZ",remember:!0,export_options:{},fileName(){return I()+".usdz"},async compile(a={}){if(!Project)throw new Error("No project loaded");R();let t=Object.assign(this.getExportOptions(),a),r=new ve,n=new M.Scene;n.name="blockbench_export",n.add(Project.model_3d);let i=await r.parse(n);return this.dispatchEvent("compile",{model:i,options:t}),Canvas.scene.add(Project.model_3d),i},async export(){let a=await this.compile();Blockbench.export({content:a,name:this.fileName(),startpath:this.startPath(),resource_id:"usdz",type:this.name,extensions:["usdz"],savetype:"buffer"},t=>this.afterDownload(t))}});o.exportUsdz=new Action("export_usdz",{category:"file",name:"Export USDZ",description:"Exports the current model as a USDZ file",icon:"file_download",async click(){e&&await e.export()}}),o.usdz=e,MenuBar.addAction(o.exportUsdz,"file.export")});P.push(()=>{MenuBar.removeAction("file.export_usdz")});var V=class e{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(p).map(t=>[t,p[t].default??new M.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([t,r])=>[t,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let t=Math.min(1,Math.max(0,a));return new M.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let a="#000000",t=Number(o.brushMetalnessSlider?.get()),r=Number(o.brushRoughnessSlider?.get()??1),n=(o.brushEmissiveColor?.get()??a).toString(),i=Number(o.brushHeightSlider?.get()),s=ColorPanel.get(),l={[p.albedo.id]:new M.Color(s),[p.metalness.id]:e.makeLinearColor(t),[p.roughness.id]:e.makeLinearColor(r),[p.emissive.id]:new M.Color(n??a),[p.height.id]:e.makeLinearColor(i),[p.normal.id]:p.normal.default??new M.Color("#8080ff")};return new e({colors:l})}};var _e="materialBrushPresets",K=()=>JSON.parse(localStorage.getItem(_e)||"{}"),st=(e,a)=>{let t=K(),r=a??guid(),n=o.userMaterialBrushPresets?.getFormResult()??{},i={};return n.albedo&&(i.albedo=n.albedo.toString()),n.metalness&&(i.metalness=Number(n.metalness)),n.roughness&&(i.roughness=Number(n.roughness)),n.emissive&&(i.emissive=n.emissive.toString()),n.height&&(i.height=Number(n.height)),t[r]=[i,e??"New Preset",U(i)],localStorage.setItem(_e,JSON.stringify(t)),r},ye=({metalness:e,roughness:a,emissive:t,height:r,albedo:n})=>{e!==void 0&&o.brushMetalnessSlider?.setValue(e||0,!0),a!==void 0&&o.brushRoughnessSlider?.setValue(a??1,!0),t!==void 0&&o.brushEmissiveColor?.set(t??"#000000"),r!==void 0&&o.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},Q=({id:e})=>Condition({project:!0,tools:["material_brush"],method(){let a=S();return(a?.layers_enabled&&a.layers.find(({channel:t})=>t&&t===e)!==void 0)===!0}}),ot=re.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:p}},methods:{applyPreset(e){try{let[a,t]=this.userPresets[e],{metalness:r,roughness:n,emissive:i,height:s,albedo:l}=a;ye({metalness:Number(r),roughness:Number(n),emissive:i.toString(),height:Number(s),albedo:l.toString()}),o.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${t}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(e){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let t=K(),r=this.userPresets[e][1]??e;delete t[e],localStorage.setItem("materialBrushPresets",JSON.stringify(t)),this.userPresets=t,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(e){o.userMaterialBrushPresets?.setFormValues({name:this.userPresets[e][1]??e,...this.userPresets[e][0]})},getSummary(e){return Object.entries(e).filter(([a])=>a in this.channels).map(([a,t])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${t}`:`${this.channels[a]?.label??a}: ${Number(t).toFixed(1)}`).join(` +`)}},computed:{presets(){return Object.entries(this.userPresets)}},mounted(){this.userPresets=K()},template:`
      • Q(g.metalness)}),o.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",tool_setting:"brush_roughness",settings:{min:0,max:1,step:.01,default:1},condition:()=>Q(g.roughness)}),o.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",tool_setting:"brush_emissive",condition:()=>Q(g.emissive)}),o.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",tool_setting:"brush_height",settings:{min:0,max:1,step:.01,default:.5},condition:()=>Q(g.height)}),o.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",category:"tools",toolbar:"brush",condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){return S()?.layers_enabled??!1}},allowed_view_modes:"textured",tool_settings:{brush_metalness:0,brush_roughness:1,brush_emissive:"#000000",brush_height:.5},brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(t,a,e,r,{size:n,softness:i,texture:s,x:l,y:p}){let h=V.fromSettings(),m=Object.keys(h.colors),u=Math.floor(n-i*n/100),b=e;return s.layers.forEach(d=>{if(!d.visible||!m.includes(d.channel))return;let f=h.getChannel(d.channel);if(!f)return;let c=Math.sqrt((l-t)**2+(p-a)**2),x=Math.min(1,c/u);if(l%u<=x&&p%u<=x){let v=d.ctx.getImageData(t,a,1,1).data,_=new M.Color(`rgb(${v[0]}, ${v[1]}, ${v[2]})`);f.lerp(_,1)}d.ctx.fillStyle=f.getStyle(),d.ctx.fillRect(t,a,1,1),d.selected&&(b={r:f.r*255,g:f.g*255,b:f.b*255,a:r*255})}),b}},onCanvasClick(t){Painter.startPaintToolCanvas(t,t.event)},onSelect(){Painter.updateNslideValues(),R()},click(){B()}}),o.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:{project:!0},click(){o.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:nt,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(t){ve({metalness:Number(t.metalness??o.brushMetalnessSlider?.get()),roughness:Number(t.roughness??o.brushRoughnessSlider?.get()),emissive:(t.emissive??o.brushEmissiveColor?.get()).toString(),height:Number(t.height??o.brushHeightSlider?.get()),albedo:(t.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(t,a){o.materialBrushTool?.select(),t===1&&Blockbench.textPrompt("Save Preset","New Preset",e=>{e&&(rt(e),Blockbench.showQuickMessage(`Preset "${e}" saved`,2e3))})}}).show()}}),MenuBar.addAction(o.materialBrushTool,"tools.0")});P.push(()=>{MenuBar.removeAction("tools.material_brush")});w.push(()=>{o.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","load_brush_preset","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Settings"})],condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});w.push(()=>{o.displaySettingsPanel=new Panel("display_settings",{name:"PBR Controls",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure","show_channel_select_menu"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});(()=>{let t=()=>{w.forEach(e=>e())},a=()=>{z(),P.forEach(e=>e()),Object.entries(o).forEach(([e,r])=>{try{r?.delete()}catch(n){console.warn(`Failed to delete ${e} action:`,n)}})};BBPlugin.register("pbr_preview",{version:"1.1.0",title:"PBR Tools",author:"Jason J. Gardner",description:"Create and view PBR materials in Blockbench. Export textures for Java and RenderDragon shaders.",tags:["Minecraft: Java Edition","Minecraft: Bedrock Edition","PBR"],icon:"icon.png",variant:"both",await_loading:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.3",onload:t,onunload:a})})();})(); + }`),o.brushMetalnessSlider=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",tool_setting:"brush_metalness",settings:{min:0,max:1,step:.01,default:0},condition:()=>Q(p.metalness)}),o.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",tool_setting:"brush_roughness",settings:{min:0,max:1,step:.01,default:1},condition:()=>Q(p.roughness)}),o.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",tool_setting:"brush_emissive",condition:()=>Q(p.emissive)}),o.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",tool_setting:"brush_height",settings:{min:0,max:1,step:.01,default:.5},condition:()=>Q(p.height)}),o.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",category:"tools",toolbar:"brush",condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){return S()?.layers_enabled??!1}},allowed_view_modes:"textured",tool_settings:{brush_metalness:0,brush_roughness:1,brush_emissive:"#000000",brush_height:.5},brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(e,a,t,r,{size:n,softness:i,texture:s,x:l,y:g}){let h=V.fromSettings(),m=Object.keys(h.colors),u=Math.floor(n-i*n/100),b=t;return s.layers.forEach(d=>{if(!d.visible||!m.includes(d.channel))return;let f=h.getChannel(d.channel);if(!f)return;let c=Math.sqrt((l-e)**2+(g-a)**2),x=Math.min(1,c/u);if(l%u<=x&&g%u<=x){let v=d.ctx.getImageData(e,a,1,1).data,_=new M.Color(`rgb(${v[0]}, ${v[1]}, ${v[2]})`);f.lerp(_,1)}d.ctx.fillStyle=f.getStyle(),d.ctx.fillRect(e,a,1,1),d.selected&&(b={r:f.r*255,g:f.g*255,b:f.b*255,a:r*255})}),b}},onCanvasClick(e){Painter.startPaintToolCanvas(e,e.event)},onSelect(){Painter.updateNslideValues(),R()},click(){B()}}),o.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:{project:!0},click(){o.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:ot,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(e){ye({metalness:Number(e.metalness??o.brushMetalnessSlider?.get()),roughness:Number(e.roughness??o.brushRoughnessSlider?.get()),emissive:(e.emissive??o.brushEmissiveColor?.get()).toString(),height:Number(e.height??o.brushHeightSlider?.get()),albedo:(e.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(e,a){o.materialBrushTool?.select(),e===1&&Blockbench.textPrompt("Save Preset","New Preset",t=>{t&&(st(t),Blockbench.showQuickMessage(`Preset "${t}" saved`,2e3))})}}).show()}}),MenuBar.addAction(o.materialBrushTool,"tools.0")});P.push(()=>{MenuBar.removeAction("tools.material_brush")});w.push(()=>{o.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","load_brush_preset","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Settings"})],condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});w.push(()=>{o.displaySettingsPanel=new Panel("display_settings",{name:"PBR Controls",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure","show_channel_select_menu"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});(()=>{let e=()=>{w.forEach(t=>t())},a=()=>{z(),P.forEach(t=>t()),Object.entries(o).forEach(([t,r])=>{try{r?.delete()}catch(n){console.warn(`Failed to delete ${t} action:`,n)}})};BBPlugin.register("pbr_preview",{version:"1.1.0",title:"PBR Tools",author:"Jason J. Gardner",description:"Create and view PBR materials in Blockbench. Export textures for Java and RenderDragon shaders.",tags:["Minecraft: Java Edition","Minecraft: Bedrock Edition","PBR"],icon:"icon.png",variant:"both",await_loading:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.3",onload:e,onunload:a})})();})(); diff --git a/src/pbr_preview/src/lib/PbrMaterials.ts b/src/pbr_preview/src/lib/PbrMaterials.ts index 1ea26233..93631f4d 100644 --- a/src/pbr_preview/src/lib/PbrMaterials.ts +++ b/src/pbr_preview/src/lib/PbrMaterials.ts @@ -155,8 +155,8 @@ export default class PbrMaterial { const materialData = Project.pbr_materials[this._materialUuid]; // Don't infer the channel if it has already been assigned to NA_CHANNEL - if (inference && !materialData && channel !== NA_CHANNEL) { - return this._scope.find((t) => regex?.test(t.name)) ?? null; + if (inference && !materialData?.length && channel !== NA_CHANNEL) { + return this._scope.find((t) => regex.test(t.name)) ?? null; } const textureUuid = materialData?.[channel]; diff --git a/src/pbr_preview/src/lib/actions/channelAssignment.ts b/src/pbr_preview/src/lib/actions/channelAssignment.ts index a56777a7..5fbc184c 100644 --- a/src/pbr_preview/src/lib/actions/channelAssignment.ts +++ b/src/pbr_preview/src/lib/actions/channelAssignment.ts @@ -20,6 +20,48 @@ const channelAssignmentActions: Record = {}; const channelSelectActions: Record = {}; +const canShowChannelAssignment = () => + Condition({ + modes: ["edit", "paint"], + selected: { + texture: true, + }, + project: true, + method() { + const selected = getSelectedTexture(); + + if (selected && !selected.material) { + return true; + } + + return ( + selected?.material === true && + getSelectedLayer() !== null && + Modes.paint + ); + }, + }); + +const canUnassignChannel = () => + Condition({ + modes: ["paint", "edit"], + selected: { + texture: true, + }, + method() { + const texture = getSelectedTexture(); + + if (texture?.material && Modes.edit) { + // Don't show Action on material textures in edit mode + return false; + } + + const layer = getSelectedLayer() ?? texture; + + return layer?.channel && layer.channel !== NA_CHANNEL; + }, + }); + setups.push(() => { Object.entries(CHANNELS).forEach(([key, channel]) => { channelAssignmentActions[key] = new Action(`assign_channel_${key}`, { @@ -27,18 +69,7 @@ setups.push(() => { name: `Assign to ${channel.label.toLocaleLowerCase()} channel`, description: `Assign the selected layer to the ${channel.label} channel`, category: "textures", - condition: { - selected: { - texture: true, - }, - project: true, - method() { - return ( - getSelectedTexture()?.material === true && - getSelectedLayer() !== null - ); - }, - }, + condition: canShowChannelAssignment, click() { const layer = TextureLayer.selected ?? (Project ? Project.selected_texture : null); @@ -96,7 +127,7 @@ setups.push(() => { selected: { texture: true, }, - modes: ["paint"], + modes: ["paint", "edit"], method() { const selected = getSelectedTexture(); const layers = selected?.layers_enabled @@ -118,13 +149,15 @@ setups.push(() => { } const layer = layers.find( - (layer: TextureLayer) => layer.channel === key + (layer: Texture | TextureLayer) => layer.channel === key ); if (!layer) { return; } + Modes.options.paint.select(); + layer.select(); layer.scrollTo(); }, @@ -150,17 +183,7 @@ setups.push(() => { name: "Unassign Channel", description: "Unassign the selected layer from the channel", category: "textures", - condition: { - selected: { - texture: true, - }, - method() { - const layer = - TextureLayer.selected ?? (Project ? Project.selected_texture : null); - - return layer?.channel && layer.channel !== NA_CHANNEL; - }, - }, + condition: canUnassignChannel, click() { const layer = TextureLayer.selected ?? (Project ? Project.selected_texture : null); @@ -211,12 +234,7 @@ setups.push(() => { registry.openChannelMenu = new Action("pbr_channel_menu", { name: "Assign to PBR Channel", icon: "texture", - condition: { - modes: ["edit", "paint"], - selected: { - texture: true, - }, - }, + condition: () => canShowChannelAssignment() || canUnassignChannel(), click(event) { registry.channelMenu?.open(event as MouseEvent); }, @@ -231,12 +249,7 @@ setups.push(() => { name: "Assign to PBR Channel", description: "Assign the selected layer to a channel", category: "textures", - condition: { - modes: ["paint"], - selected: { - texture: true, - }, - }, + condition: canShowChannelAssignment, click(event) { registry.channelMenu?.open(event as MouseEvent); }, @@ -248,10 +261,18 @@ setups.push(() => { description: "Select a channel to view", category: "textures", condition: { - modes: ["paint"], + modes: ["edit", "paint"], selected: { texture: true, }, + method() { + const selected = getSelectedTexture(); + const layers = selected?.layers_enabled ? selected.layers : Texture.all; + + return layers.some((layer: Texture | TextureLayer) => + Object.keys(CHANNELS).some((key) => layer.channel === key) + ); + }, }, click(event) { registry.channelSelectionMenu?.open(event as MouseEvent); diff --git a/src/pbr_preview/src/lib/actions/materialTexture.ts b/src/pbr_preview/src/lib/actions/materialTexture.ts index 8326287f..085f9103 100644 --- a/src/pbr_preview/src/lib/actions/materialTexture.ts +++ b/src/pbr_preview/src/lib/actions/materialTexture.ts @@ -40,8 +40,9 @@ setups.push(() => { texture.extend({ material: true }); const scope = - Texture.all.filter((t) => t.selected || t.multi_selected) ?? - Texture.all; + Texture.all.filter( + (t) => (t.selected || t.multi_selected) && !t.material + ) ?? Texture.all; const selected = getSelectedTexture(); From 3d66662e121b3304db614ac50e06c94737855d26 Mon Sep 17 00:00:00 2001 From: Jason Gardner Date: Tue, 18 Jun 2024 11:54:19 -0500 Subject: [PATCH 28/50] fix: Channels panel lifecycle - Updated Export USDZ icon - Fixed channels panel Vue component by updating it externally - Removed channel select menu - Updated docs --- plugins/pbr_preview/about.md | 7 +- plugins/pbr_preview/pbr_preview.js | 119 +++++++++++++++--- .../src/lib/actions/channelAssignment.ts | 84 +------------ src/pbr_preview/src/lib/actions/usdz.ts | 2 +- src/pbr_preview/src/lib/panels/channels.ts | 96 ++++++++------ src/pbr_preview/src/lib/panels/index.ts | 4 +- 6 files changed, 172 insertions(+), 140 deletions(-) diff --git a/plugins/pbr_preview/about.md b/plugins/pbr_preview/about.md index 278cd2e1..12e9b33e 100644 --- a/plugins/pbr_preview/about.md +++ b/plugins/pbr_preview/about.md @@ -168,10 +168,9 @@ Assigning a layer to a new channel will clear the layer's current channel. #### Finding Assigned Channels -When in Paint mode, select a texture with material layers assigned to reveal the -_Select PBR Channel_ menu button in the _PBR Controls_ panel. This menu lists -the channels currently assigned by the selected texture. Click a channel in the -menu to have it selected in the Layers panel. +Select a texture with material layers assigned to reveal the _PBR Channels_ +panel. This panel displays the channels currently assigned in the selected +texture. Click a channel in the menu to have it selected in the Layers panel. ### Material Brush Tool diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index 81949a8c..a471c81d 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1,4 +1,4 @@ -"use strict";(()=>{var M=THREE,re=Vue,ne=window.JSZip;var A="_NONE_",p={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new M.Color(16777215),regex:new RegExp("(s|_)*(basecolor|color|albedo)","i")},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new M.Color(0),regex:new RegExp("[ _]*metal(lic|ness)?","i")},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new M.Color(0),regex:new RegExp("[ _]*(emissive|emission)","i")},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new M.Color(16777215),regex:new RegExp("[ _]*rough(ness)?","i")},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new M.Color(16777215),regex:new RegExp("[ _]*(height|bump)","i")},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new M.Color("rgb(128, 128, 255)"),regex:new RegExp("[ _]*normal","i")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new M.Color(16777215),regex:new RegExp("[ _]*(ao|ambientocclusion|ambient occlusion)","i")}},o={},w=[],P=[];var se=[...Object.keys(p).map(e=>p[e].id),A];w.push(()=>{o.channelProp=new Property(TextureLayer,"enum","channel",{default:A,values:se,label:"PBR Channel",exposed:!1}),o.textureChannelProp=new Property(Texture,"enum","channel",{default:A,values:se,label:"PBR Channel",exposed:!1}),o.materialTextureProp=new Property(Texture,"boolean","material",{default:!1,label:"Material Texture"}),o.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),o.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),o.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!1,values:[],label:"PBR Mode"})});function S(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(e=>e.selected)??null:Texture.all.find(e=>e.selected)??Texture.getDefault()}function N(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(e=>e.selected)??Project.selected_texture.layers[0]:S()?.getActiveLayer()??null}function I(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(S()?.name??"texture")}function oe(e,a){let t;return function(...r){let n=()=>{t=void 0,e.apply(this,r)};clearTimeout(t),t=setTimeout(n,a)}}function U(e){let a=MediaPreview.renderer??new M.WebGLRenderer({alpha:!0,antialias:!0}),t=new M.Scene,r=new M.PerspectiveCamera(75,96/96,.1,1e3),n=new M.AmbientLight(16777215,.75);t.add(n);let i=new M.PointLight(16777215,1,100);i.position.set(5,5,5),t.add(i);let s=new M.SphereGeometry(1,32,32),l=e instanceof M.MeshStandardMaterial&&e.isMeshStandardMaterial?e:new M.MeshStandardMaterial({color:e.albedo,metalness:e.metalness??0,roughness:e.roughness??1,emissive:e.emissive,bumpScale:e.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),g=new M.Mesh(s,l);t.add(g),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(t,r);let h=a.domElement.toDataURL();return l.dispose(),MediaPreview.renderer||(a.clear(),a.dispose()),h}function J(e,a){let t=a??document.createElement("canvas"),r=t.getContext("2d");if(!r)return t.remove(),null;let n=Math.max(Project?Project.texture_width:16,16),i=Math.max(Project?Project.texture_height:16,16);t.width=n,t.height=i,r.fillStyle=`rgb(${e.r*255}, ${e.g*255}, ${e.b*255})`,r.fillRect(0,0,n,i);let s=t.toDataURL();return a||t.remove(),s}var Oe=(e=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return e?a.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):a},D=class e{constructor(a,t){this._scope=a??Oe(),this._materialUuid=t}merToCanvas(){let a=this.getTexture(p.emissive),t=this.getTexture(p.roughness),r=this.getTexture(p.metalness);if(!a&&!t&&!r){let{metalness:n,emissive:i,roughness:s}=this.decodeMer();n&&(r=e.makePixelatedCanvas(n)),i&&(a=e.makePixelatedCanvas(i)),s&&(t=e.makePixelatedCanvas(s))}return{emissiveMap:a,roughnessMap:t,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(p.emissive),roughnessMap:this.getTexture(p.roughness),metalnessMap:this.getTexture(p.metalness)},i=this.getTexture(p.normal);return new M.MeshStandardMaterial({map:this.getTexture(p.albedo)??e.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(s=>s.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(p.ao),bumpMap:this.getTexture(p.height),normalMap:i,normalScale:new M.Vector2(-1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}renderMaterialPreview(){return U(this.getMaterial())}saveTexture(a,t){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=t.uuid,t.extend({channel:a.id}))}findTexture(a,t=!0){if(!Project)return null;let r=this._scope.find(g=>g.channel&&(g.channel===a||g.channel===a.id));if(r)return r;let[n,i]=typeof a=="string"?[a,new RegExp(`_*${a}(.[^.]+)?$`,"i")]:[a.id,a.regex??new RegExp(`_*${a.id}(.[^.]+)?$`,"i")];Project.pbr_materials=Project.pbr_materials??{};let s=Project.pbr_materials[this._materialUuid];if(t&&!s?.length&&n!==A)return this._scope.find(g=>i.test(g.name))??null;let l=s?.[n];return l?this._scope.find(g=>g.uuid===l)??null:null}static makePixelatedCanvas(a){let t=new M.CanvasTexture(a,void 0,void 0,void 0,M.NearestFilter,M.NearestFilter);return t.needsUpdate=!0,t}getTexture(a){let t=this.findTexture(a);return t?e.makePixelatedCanvas(t.canvas):null}static extractChannel(a,t){let r=a.canvas,{width:n,height:i}=r,s=r.getContext("2d");if(!s||!n||!i)return null;let l=document.createElement("canvas");l.width=n,l.height=i;let g=l.getContext("2d");if(!g)return null;let h={r:0,g:1,b:2,a:3}[t],{data:m}=s.getImageData(0,0,n,i),u=new Uint8ClampedArray(n*i*4);for(let d=0;da){f[c]=b.data[c],f[c+1]=b.data[c+1],f[c+2]=b.data[c+2],f[c+3]=255;continue}f[c]=0,f[c+1]=0,f[c+2]=0,f[c+3]=255}return h.putImageData(new ImageData(f,l.width,l.height),0,0),{metalness:r,emissive:l,emissiveLevel:n,roughness:i,sss:s}}createMer(a=!1){let t=this.findTexture(p.metalness,a),r=this.findTexture(p.emissive,a),n=this.findTexture(p.roughness,a),i=this.findTexture("sss",!1),s=Math.max(t?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),l=Math.max(t?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),g=document.createElement("canvas");g.width=s,g.height=l;let h=g.getContext("2d");if(!h)return null;let m=t?.img?e.extractChannel(t,"r"):null,u=r?.img?e.extractChannel(r,"g"):null,b=n?.img?e.extractChannel(n,"b"):null,d=i&&i?.img?e.extractChannel(i,"a"):null,f=m?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),c=u?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),x=b?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),v=d?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(new Uint8ClampedArray(s*l*4).fill(255),s,l),_=new Uint8ClampedArray(s*l*4);for(let y=0;y<_.length;y+=4)_[y]=f.data[y],_[y+1]=c.data[y],_[y+2]=x.data[y],_[y+3]=v.data[y];return h.putImageData(new ImageData(_,s,l),0,0),g}createLabPbrOutput(a=!0){let t=this.findTexture(p.metalness,a),r=this.findTexture(p.emissive,a),n=this.findTexture(p.roughness,a),i=this.findTexture(p.normal,a),s=this.findTexture(p.height,a),l=this.findTexture(p.ao,!1),g=this.findTexture("sss",!0),h=this.findTexture("porosity",!0),m=Math.max(t?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),u=Math.max(t?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),b=document.createElement("canvas");b.width=m,b.height=u;let d=b.getContext("2d"),f=document.createElement("canvas");f.width=m,f.height=u;let c=f.getContext("2d");if(!d||!c)return null;let x=new Uint8ClampedArray(m*u*4),v=new Uint8ClampedArray(m*u*4),_=t?.canvas,y=r?.canvas,k=n?.canvas,T=g?.canvas,L=h?.canvas,C=_?.getContext("2d"),j=y?.getContext("2d"),we=k?.getContext("2d"),Te=T?.getContext("2d"),Ce=L?.getContext("2d"),Ee=C?.getImageData(0,0,m,u),H=j?.getImageData(0,0,m,u),ee=we?.getImageData(0,0,m,u),Pe=Te?.getImageData(0,0,m,u),Le=Ce?.getImageData(0,0,m,u);for(let E=0;E{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createTexturesFromNormal(a){let t=this.decodeLabPbrNormal(a);return Object.entries(t).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}};var O=class{constructor({lightHeight:a=.66,ambientLight:t=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:n=[1,1,1]}={}){this.lightHeight=a,this.ambientLight=t,this.minLightIntensity=r,this.lightDiffuse=n}bake(a,t,r){let n=t instanceof HTMLCanvasElement?t:this.createCanvas(t.width,t.height),i=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),s=n.getContext("2d"),l=i.getContext("2d");s.drawImage(t,0,0),l.drawImage(r,0,0);let g=s.getImageData(0,0,t.width,t.height),h=l.getImageData(0,0,r.width,r.height),m=[],u=[];for(let d=0;d{let f=this.createCanvas(t.width,t.height),c=f.getContext("2d"),x=c.getImageData(0,0,f.width,f.height),v=[Math.cos(d),Math.sin(d),this.lightHeight];for(let _=0;_{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new D(r.layers_enabled?r.layers:Project.textures,r.uuid),i=n.findTexture(p.albedo);if(!i){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let s=n.findTexture(p.normal);if(!s){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let g=new O(e).bake(a,i.canvas,s.canvas),h=new Texture({name:`${i.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(g[0].toDataURL()),m=t?u=>{let b=n.findTexture(p.emissive);if(!b)return u;let d=b.canvas;if(!d.getContext("2d"))return u;let c=Math.max(u.width,d.width,Project?Project.texture_width:16),x=Math.max(u.height,d.height,Project?Project.texture_height:16),v=document.createElement("canvas");v.width=c,v.height=x;let _=v.getContext("2d");return _?(_.drawImage(u,0,0),_.globalCompositeOperation="screen",_.drawImage(d,0,0),v):u}:u=>u;g.forEach((u,b)=>{new TextureLayer({name:`baked_${b+1}`,data_url:m(u).toDataURL()},h).addForEditing()}),h.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};w.push(()=>{o.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(e){let a=new M.Color(e.ambientLight.toString()),t=new M.Color(e.lightDiffuse.toString());ie({ambientLight:[a.r,a.g,a.b],lightDiffuse:[t.r,t.g,t.b],lightHeight:Number(e.lightHeight),minLightIntensity:Number(e.minLightIntensity)},e.directions??8,e.blendEmissive??!1)}}),o.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){o.bakeTexturesDialog?.show()}}),MenuBar.addAction(o.bakeTexturesAction,"tools")});P.push(()=>{MenuBar.removeAction("tools.bake_textures")});function le(e,a){let t=e.getTexture();if(!t||!Project)return null;let r=Project.materials[t.uuid];r.isShaderMaterial&&!Project.bb_materials[t.uuid]?Project.bb_materials[t.uuid]=r:r.isMeshStandardMaterial&&r.dispose();let n=new D(t.layers_enabled?t.layers.filter(i=>i.visible)??null:Project.textures,t.uuid).getMaterial({side:Canvas.getRenderSide(t),...a});return Project.materials[t.uuid]=M.ShaderMaterial.prototype.copy.call(n,r),t}function ce(e){return Object.values(e).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function Fe(e,a){let t={};return e.forAllFaces(r=>{let n=le(r,a);n&&(t[n.uuid]=n)}),ce(t)}function ze(e,a){let t={};return Object.keys(e.faces).forEach(r=>{let n=e.faces[r],i=le(n,a);i&&(t[i.uuid]=i)}),ce(t)}var R=(e={})=>{Project&&(Project.pbr_active=Texture.all.length>0&&Project.elements.map(a=>a instanceof Mesh&&Fe(a,e)||a instanceof Cube&&ze(a,e)).filter(Boolean).length>0)},B=(e=100)=>oe(R,e);var q={},Z={},W=()=>Condition({modes:["edit","paint"],selected:{texture:!0},project:!0,method(){let e=S();return e&&!e.material?!0:e?.material===!0&&N()!==null&&Modes.paint}}),ue=()=>Condition({modes:["paint","edit"],selected:{texture:!0},method(){let e=S();if(e?.material&&Modes.edit)return!1;let a=N()??e;return a?.channel&&a.channel!==A}});w.push(()=>{Object.entries(p).forEach(([e,a])=>{q[e]=new Action(`assign_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:W,click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t)return;Undo.initEdit({layers:[t]}),t.extend({channel:a.id});let r=t instanceof TextureLayer?t.texture:t;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([n,i])=>{i===t.uuid&&(delete Project.pbr_materials[r.uuid][n],t.channel=A)}),r.uuid===t.uuid&&(Project.pbr_materials[r.uuid]={}),Project.pbr_materials[r.uuid][e]=t.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${t.name}" to ${a.label} channel`,2e3),R()}}),Z[e]=new Action(`select_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:a.label??e,description:`Select the ${a.label} channel`,condition:{project:!0,selected:{texture:!0},modes:["paint","edit"],method(){let t=S();return(t?.layers_enabled?t.layers:Texture.all).some(n=>n.channel===e)}},click(){let t=Texture.selected?.layers_enabled?Texture.selected.layers:Texture.all;if(!t||!t.length)return;let r=t.find(n=>n.channel===e);r&&(Modes.options.paint.select(),r.select(),r.scrollTo())}}),Z[e].addLabel(!0,()=>a.label??e)})});P.push(()=>{[...Object.values(q),...Object.values(Z)].forEach(a=>{a.delete()})});w.push(()=>{o.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:ue,click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e)return;Undo.initEdit({layers:[e]});let a=e instanceof TextureLayer?e.texture:e,t=e.channel;Project.pbr_materials[a.uuid]={},e.channel=A,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${e.name}" from ${t} channel`,2e3),B()}}),o.channelMenu=new Menu("channel_menu",[...Object.keys(p).map(e=>`assign_channel_${e}`),"unassign_channel"],{onOpen(){B()}}),o.channelSelectionMenu=new Menu("channel_selection_menu",Object.keys(p).map(e=>`select_channel_${e}`)),o.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",condition:()=>W()||ue(),click(e){o.channelMenu?.open(e)},children:[...Object.values(q),o.unassignChannel]}),o.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:W,click(e){o.channelMenu?.open(e)}}),o.showChannelSelectionMenu=new Action("show_channel_select_menu",{icon:"tv_options_edit_channels",name:"Select PBR Channel",description:"Select a channel to view",category:"textures",condition:{modes:["edit","paint"],selected:{texture:!0},method(){let e=S();return(e?.layers_enabled?e.layers:Texture.all).some(t=>Object.keys(p).some(r=>t.channel===r))}},click(e){o.channelSelectionMenu?.open(e)}}),o.openChannelMenu&&(MenuBar.addAction(o.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(o.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(o.openChannelMenu,"0")),Toolbars.layers.add(o.showChannelMenu,1)});P.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(o.showChannelMenu)});function X(e,a=!1){let t=e.canvas.getContext("2d");if(!t)return null;let r=Math.max(e.img.width??e.canvas.width,Project?Project.texture_width:0,16),n=Math.max(e.img.height??e.canvas.height,Project?Project.texture_height:0,16),{data:i}=t.getImageData(0,0,r,n),s=document.createElement("canvas"),l=s.getContext("2d");if(!l)return null;let g=(c,x)=>{let v=(c+x*r)*4;return i[v]/255};s.width=r,s.height=n,l.drawImage(e.img,0,0,r,n);let h=l.getImageData(0,0,r,n),m=h.data,u=c=>{let x=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);return[c[0]/x,c[1]/x,c[2]/x]};for(let c=0;c{let c=(d+f*t)*4;return n[c]/255};i.width=t,i.height=r,s.drawImage(e.img,0,0,t,r);let g=s.getImageData(0,0,t,r),h=g.data;for(let d=0;d{o.generateNormal=new Action("generate_normal",{icon:p.normal.icon??"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(N()??S())!==null,click(e){let a=N()??S()??Texture.getDefault();if(!a)return;let t=X(a);if(!t){Blockbench.showQuickMessage("Failed to generate normal map",2e3);return}t.select(e),new D(a instanceof Texture&&a.layers_enabled?a.layers:null,a.uuid).saveTexture(p.normal,t),Blockbench.showQuickMessage("Normal map generated",2e3)}}),o.generateAo=new Action("generate_ao",{icon:p.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let e=N()??S()??Texture.getDefault();if(!e)return;let a=new D(e instanceof Texture&&e.layers_enabled?e.layers:null,e.uuid),t=a.findTexture(p.normal)??X(e);if(!t){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=me(t);if(r){a.saveTexture(p.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),MenuBar.addAction(o.generateNormal,"tools"),MenuBar.addAction(o.generateAo,"tools")});P.push(()=>{MenuBar.removeAction("tools.generate_normal")});var Ge=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},Ve=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};w.push(()=>{o.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let e=S();if(!e)return;let t=new D(e.layers_enabled?e.layers:[e],e.uuid).createLabPbrOutput();if(t===null)return;let r=e.name??(Project?Project.getDisplayName():"texture");await Promise.all([Ge(t.normalMap,pathToName(r)),Ve(t.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),o.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let e=TextureLayer.selected?.texture??Texture.all.find(t=>t.selected)??Texture.getDefault(),a=new D(e.layers_enabled?e.layers:[e],e.uuid);if(pathToName(e.name).endsWith("_n")){a.createTexturesFromNormal(e);return}if(pathToName(e.name).endsWith("_s")){a.createTexturesFromSpecular(e);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(o.generateLabPbr,"file.export"),MenuBar.addAction(o.decodeLabPbr,"tools")});P.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});w.push(()=>{o.createMaterialTexture=new Action("create_material_texture",{icon:"deployed_code",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let e={...p},a=new Texture({name:"New Material",saved:!1,particle:!1});a.extend({material:!0});let t=Texture.all.filter(s=>(s.selected||s.multi_selected)&&!s.material)??Texture.all,r=S(),n=r?new D(t,r.uuid):null;try{let s=n?.findTexture(p.albedo,!0)?.canvas.toDataURL()??r?.canvas.toDataURL()??J(new M.Color(8421504),a.canvas);if(!s)return;a.fromDataURL(s);let l=new TextureLayer({name:e.albedo.label,visible:!0,data_url:s,keep_size:!0},a);l.extend({channel:e.albedo.id}),l.addForEditing(),l.texture.updateChangesAfterEdit(),n?.saveTexture(e.albedo,l),delete e.albedo}catch(s){console.warn("Failed to create base color texture",s),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let i=Object.keys(e).map(s=>{let l=p[s],g=n?.findTexture(l,!0),h=g?g.canvas.toDataURL():J(l.default??new M.Color(0));if(!h)return;let m=new TextureLayer({name:l.label,visible:!0,data_url:h,keep_size:!0},a);return m.extend({channel:l.id}),n?.saveTexture(l,m),m}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:i}),a.add().select(),a.activateLayers(),i.map(s=>{s.addForEditing(),a.width=Math.max(a.width,s.img.width),a.height=Math.max(a.height,s.img.height)}),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(o.createMaterialTexture,"tools"),Toolbars.texturelist.add(o.createMaterialTexture,3)});P.push(()=>{MenuBar.removeAction("tools.create_material_texture"),Toolbars.texturelist.remove("create_material_texture")});var F=(e,a)=>{let t=S()??Texture.getDefault(),r=new D(t.layers_enabled?t.layers:Project?Project.textures:null,t.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[i,s]=Project?[e?`${e}_mer`:`${t.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:i,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},a)})};w.push(()=>{o.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{F()}catch(e){console.error("Failed to export MER map:",e),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),o.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let e=S()??Texture.getDefault(),a=new D([e],e.uuid),t=a.decodeMer(),r=[p.metalness,p.emissive,p.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new Texture({name:`${e?.name}_${i}`,keep_size:!1}).fromDataURL(s.toDataURL());l.add(!0),a.saveTexture(n,l)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>S()?.layers_enabled===!0,click(){let e=S()??Texture.getDefault(),a=new D(e.layers_enabled?e.layers:[e],e.uuid),t=a.decodeMer(),r=[p.metalness,p.emissive,p.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new TextureLayer({name:`${e?.name}_${i}`,data_url:s.toDataURL()},e);a.saveTexture(n,l),l.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(o.decodeMer,"tools"),MenuBar.addAction(o.generateMer,"file.export")});P.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var Qe=()=>{Project&&Project.textures.forEach(e=>{let a=new D(null,e.uuid),t=a.findTexture(p.normal,!1),r=a.findTexture(p.height,!1),n=a.findTexture(p.albedo,!1),i=a.findTexture(p.metalness,!1)?.name,s=a.findTexture(p.emissive,!1)?.name,l=a.findTexture(p.roughness,!1)?.name,g={};return n||(g.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!i&&!s&&!l&&(g.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},g.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},g.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),t&&(g.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(g.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),t&&r&&(g.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),o.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:g,cancelIndex:1,onConfirm(h){let m=I(),u=i||s||l,b={format_version:"1.16.100","minecraft:texture_set":{color:(n?m:h.baseColor?.toHexString())??m,metalness_emissive_roughness:[h.metalness??0,h.emissive??0,h.roughness??255]}};h.depthMap==="normal"&&t||!r&&t?b["minecraft:texture_set"].normal=`${m}_normal`:(!t||h.depthMap==="heightmap")&&r&&(b["minecraft:texture_set"].heightmap=`${m}_heightmap`);let d=x=>{if(!h.depthMap)return x();let v=h.depthMap==="normal"||h.depthMap&&!r,_=v?t:r;if(!_)return x();Blockbench.export({content:_.canvas.toDataURL()??"",type:"PNG",name:`${m}_${v?"normal":"heightmap"}`,extensions:["png"],resource_id:h.depthMap,startpath:Project.export_path,savetype:"image"},y=>{b["minecraft:texture_set"][v?"normal":"heightmap"]=pathToName(y,!1),x()})},f=x=>{if(!n)return x();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:m,startpath:Project.export_path,savetype:"image"},v=>{b["minecraft:texture_set"].color=pathToName(v,!1),x()})},c=()=>d(()=>{f(()=>{Blockbench.export({content:JSON.stringify(b,null,2),type:"JSON",name:`${m}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),o.textureSetDialog?.hide()})})});if(u){try{F(m,x=>{b["minecraft:texture_set"].metalness_emissive_roughness=pathToName(x,!1),c()})}catch(x){console.warn("Failed to export MER map:",x),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}c()}}),o.textureSetDialog.show()})};w.push(()=>{o.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){Qe()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(o.createTextureSet,"file.export")});P.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});w.push(()=>{o.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(e){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=e}),Preview.selected.renderer.physicallyCorrectLights=e,Blockbench.showQuickMessage(`Physically corrected lighting is now ${e?"enabled":"disabled"}`,2e3),e&&o.togglePbr?.set(!0),R()},click(){}}),MenuBar.addAction(o.toggleCorrectLights,"preview")});P.push(()=>{MenuBar.removeAction("preview.correct_lights")});var z=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(e=>{e instanceof Cube&&Object.keys(e.faces).forEach(a=>{let r=e.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var de=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],he=()=>Project&&Project.pbr_active&&R(),Je=()=>{Blockbench.on(de.join(" "),he)},pe=()=>{de.forEach(e=>{Blockbench.removeListener(e,he)})};w.push(()=>{o.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(e){if(e){R(),Je(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}z(),pe(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(o.togglePbr,"view")});P.push(()=>{pe(),MenuBar.removeAction("view.toggle_pbr")});var ge=e=>{let a=Math.max(-2,Math.min(2,e));Preview.all.forEach(t=>{t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};w.push(()=>{o.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(o.tonemappingSelect?.get())===M.NoToneMapping&&o.tonemappingSelect.change(M.LinearToneMapping.toString()),o.togglePbr?.set(!0)},onChange(e){ge(Number(e))},onAfter(){B()}}),o.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>o.exposureSlider!==void 0&&Number(o.exposureSlider?.get())!==1,click(){ge(1),o.exposureSlider?.setValue(1,!0),B()}}),o.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:M.NoToneMapping,value:Preview.selected.renderer.toneMapping??M.NoToneMapping,icon:"monochrome_photos",options:{[M.NoToneMapping]:"No Tone Mapping",[M.LinearToneMapping]:"Linear",[M.ReinhardToneMapping]:"Reinhard",[M.CineonToneMapping]:"Cineon",[M.NeutralToneMapping]:"Neutral",[M.ACESFilmicToneMapping]:"ACES"},onChange({value:e}){Preview.selected.renderer.toneMapping=Number(e);let a=1;Preview.selected.renderer.toneMapping===M.NoToneMapping?o.exposureSlider?.setValue(a,!0):a=Number(o.exposureSlider?.get()??1),Preview.all.forEach(t=>{t.renderer.toneMapping=Number(e),t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(e)}`,2e3),o.togglePbr&&!o.togglePbr.value&&o.togglePbr.set(!0),R()}})});var Y=class{async parse(a){let t=new ne,r="model.usda";t.file(r,"");let n=Me(),i={},s={};a.traverseVisible(h=>{if(!h.isMesh)return;let m=h;if(!m.material.isMeshStandardMaterial){console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",h);return}let u=m.geometry,b=m.material,d="geometries/Geometry_"+u.id+".usd";if(!t.file(d)){let f=Ye(u);t.file(d,We(f))}b.uuid in i||(i[b.uuid]=b),n+=qe(m,u,b)}),n+=rt(i,s),t.file(r,n),n=null;for(let h in s){let m=s[h],u=h.split("_")[1],b=m.format===M.RGBAFormat,d=Ze(m.image,u),c=await(await new Promise(x=>d.toBlob(v=>v&&x(v),b?"image/png":"image/jpeg",1))).arrayBuffer();t.file(`textures/Texture_${h}.${b?"png":"jpg"}`,c)}let l=0;t.forEach(async h=>{let m=34+h.length;l+=m;let u=l&63,b=await t.file(h).async("uint8array");if(u!==4){let d=64-u,f=new Uint8Array(d),c=new Uint8Array(b.length+d);c.set(b,0),c.set(f,b.length),t.file(h,c)}l+=b.length});let g=await t.generateAsync({type:"blob",compression:"STORE"});return new Uint8Array(await g.arrayBuffer())}};function Ze(e,a){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=1024/Math.max(e.width,e.height),r=document.createElement("canvas");r.width=e.width*Math.min(1,t),r.height=e.height*Math.min(1,t);let n=r.getContext("2d");if(n.imageSmoothingEnabled=!1,n.drawImage(e,0,0,r.width,r.height),a!==void 0){let i=parseInt(a,16),s=(i>>16&255)/255,l=(i>>8&255)/255,g=(i&255)/255,h=n.getImageData(0,0,r.width,r.height),m=h.data;for(let u=0;u{var v=THREE,re=Vue,ne=window.JSZip;var B="_NONE_",p={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new v.Color(16777215),regex:new RegExp("(s|_)*(basecolor|color|albedo)","i")},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new v.Color(0),regex:new RegExp("[ _]*metal(lic|ness)?","i")},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new v.Color(0),regex:new RegExp("[ _]*(emissive|emission)","i")},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new v.Color(16777215),regex:new RegExp("[ _]*rough(ness)?","i")},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new v.Color(16777215),regex:new RegExp("[ _]*(height|bump)","i")},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new v.Color("rgb(128, 128, 255)"),regex:new RegExp("[ _]*normal","i")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new v.Color(16777215),regex:new RegExp("[ _]*(ao|ambientocclusion|ambient occlusion)","i")}},o={},y=[],C=[];var se=[...Object.keys(p).map(e=>p[e].id),B];y.push(()=>{o.channelProp=new Property(TextureLayer,"enum","channel",{default:B,values:se,label:"PBR Channel",exposed:!1}),o.textureChannelProp=new Property(Texture,"enum","channel",{default:B,values:se,label:"PBR Channel",exposed:!1}),o.materialTextureProp=new Property(Texture,"boolean","material",{default:!1,label:"Material Texture"}),o.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),o.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),o.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!1,values:[],label:"PBR Mode"})});function k(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(e=>e.selected)??null:Texture.all.find(e=>e.selected)??Texture.getDefault()}function A(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(e=>e.selected)??Project.selected_texture.layers[0]:k()?.getActiveLayer()??null}function I(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(k()?.name??"texture")}function oe(e,a){let t;return function(...r){let n=()=>{t=void 0,e.apply(this,r)};clearTimeout(t),t=setTimeout(n,a)}}function U(e){let a=MediaPreview.renderer??new v.WebGLRenderer({alpha:!0,antialias:!0}),t=new v.Scene,r=new v.PerspectiveCamera(75,96/96,.1,1e3),n=new v.AmbientLight(16777215,.75);t.add(n);let i=new v.PointLight(16777215,1,100);i.position.set(5,5,5),t.add(i);let s=new v.SphereGeometry(1,32,32),l=e instanceof v.MeshStandardMaterial&&e.isMeshStandardMaterial?e:new v.MeshStandardMaterial({color:e.albedo,metalness:e.metalness??0,roughness:e.roughness??1,emissive:e.emissive,bumpScale:e.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),g=new v.Mesh(s,l);t.add(g),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(t,r);let h=a.domElement.toDataURL();return l.dispose(),MediaPreview.renderer||(a.clear(),a.dispose()),h}function Z(e,a){let t=a??document.createElement("canvas"),r=t.getContext("2d");if(!r)return t.remove(),null;let n=Math.max(Project?Project.texture_width:16,16),i=Math.max(Project?Project.texture_height:16,16);t.width=n,t.height=i,r.fillStyle=`rgb(${e.r*255}, ${e.g*255}, ${e.b*255})`,r.fillRect(0,0,n,i);let s=t.toDataURL();return a||t.remove(),s}var ze=(e=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return e?a.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):a},j=class e{constructor(a,t){this._scope=a??ze(),this._materialUuid=t}merToCanvas(){let a=this.getTexture(p.emissive),t=this.getTexture(p.roughness),r=this.getTexture(p.metalness);if(!a&&!t&&!r){let{metalness:n,emissive:i,roughness:s}=this.decodeMer();n&&(r=e.makePixelatedCanvas(n)),i&&(a=e.makePixelatedCanvas(i)),s&&(t=e.makePixelatedCanvas(s))}return{emissiveMap:a,roughnessMap:t,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(p.emissive),roughnessMap:this.getTexture(p.roughness),metalnessMap:this.getTexture(p.metalness)},i=this.getTexture(p.normal);return new v.MeshStandardMaterial({map:this.getTexture(p.albedo)??e.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(s=>s.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(p.ao),bumpMap:this.getTexture(p.height),normalMap:i,normalScale:new v.Vector2(-1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}renderMaterialPreview(){return U(this.getMaterial())}saveTexture(a,t){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=t.uuid,t.extend({channel:a.id}))}findTexture(a,t=!0){if(!Project)return null;let r=this._scope.find(g=>g.channel&&(g.channel===a||g.channel===a.id));if(r)return r;let[n,i]=typeof a=="string"?[a,new RegExp(`_*${a}(.[^.]+)?$`,"i")]:[a.id,a.regex??new RegExp(`_*${a.id}(.[^.]+)?$`,"i")];Project.pbr_materials=Project.pbr_materials??{};let s=Project.pbr_materials[this._materialUuid];if(t&&!s?.length&&n!==B)return this._scope.find(g=>i.test(g.name))??null;let l=s?.[n];return l?this._scope.find(g=>g.uuid===l)??null:null}static makePixelatedCanvas(a){let t=new v.CanvasTexture(a,void 0,void 0,void 0,v.NearestFilter,v.NearestFilter);return t.needsUpdate=!0,t}getTexture(a){let t=this.findTexture(a);return t?e.makePixelatedCanvas(t.canvas):null}static extractChannel(a,t){let r=a.canvas,{width:n,height:i}=r,s=r.getContext("2d");if(!s||!n||!i)return null;let l=document.createElement("canvas");l.width=n,l.height=i;let g=l.getContext("2d");if(!g)return null;let h={r:0,g:1,b:2,a:3}[t],{data:d}=s.getImageData(0,0,n,i),u=new Uint8ClampedArray(n*i*4);for(let m=0;ma){f[c]=b.data[c],f[c+1]=b.data[c+1],f[c+2]=b.data[c+2],f[c+3]=255;continue}f[c]=0,f[c+1]=0,f[c+2]=0,f[c+3]=255}return h.putImageData(new ImageData(f,l.width,l.height),0,0),{metalness:r,emissive:l,emissiveLevel:n,roughness:i,sss:s}}createMer(a=!1){let t=this.findTexture(p.metalness,a),r=this.findTexture(p.emissive,a),n=this.findTexture(p.roughness,a),i=this.findTexture("sss",!1),s=Math.max(t?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),l=Math.max(t?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),g=document.createElement("canvas");g.width=s,g.height=l;let h=g.getContext("2d");if(!h)return null;let d=t?.img?e.extractChannel(t,"r"):null,u=r?.img?e.extractChannel(r,"g"):null,b=n?.img?e.extractChannel(n,"b"):null,m=i&&i?.img?e.extractChannel(i,"a"):null,f=d?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),c=u?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),x=b?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),_=m?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(new Uint8ClampedArray(s*l*4).fill(255),s,l),M=new Uint8ClampedArray(s*l*4);for(let w=0;w{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createTexturesFromNormal(a){let t=this.decodeLabPbrNormal(a);return Object.entries(t).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}};var O=class{constructor({lightHeight:a=.66,ambientLight:t=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:n=[1,1,1]}={}){this.lightHeight=a,this.ambientLight=t,this.minLightIntensity=r,this.lightDiffuse=n}bake(a,t,r){let n=t instanceof HTMLCanvasElement?t:this.createCanvas(t.width,t.height),i=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),s=n.getContext("2d"),l=i.getContext("2d");s.drawImage(t,0,0),l.drawImage(r,0,0);let g=s.getImageData(0,0,t.width,t.height),h=l.getImageData(0,0,r.width,r.height),d=[],u=[];for(let m=0;m{let f=this.createCanvas(t.width,t.height),c=f.getContext("2d"),x=c.getImageData(0,0,f.width,f.height),_=[Math.cos(m),Math.sin(m),this.lightHeight];for(let M=0;M{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new j(r.layers_enabled?r.layers:Project.textures,r.uuid),i=n.findTexture(p.albedo);if(!i){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let s=n.findTexture(p.normal);if(!s){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let g=new O(e).bake(a,i.canvas,s.canvas),h=new Texture({name:`${i.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(g[0].toDataURL()),d=t?u=>{let b=n.findTexture(p.emissive);if(!b)return u;let m=b.canvas;if(!m.getContext("2d"))return u;let c=Math.max(u.width,m.width,Project?Project.texture_width:16),x=Math.max(u.height,m.height,Project?Project.texture_height:16),_=document.createElement("canvas");_.width=c,_.height=x;let M=_.getContext("2d");return M?(M.drawImage(u,0,0),M.globalCompositeOperation="screen",M.drawImage(m,0,0),_):u}:u=>u;g.forEach((u,b)=>{new TextureLayer({name:`baked_${b+1}`,data_url:d(u).toDataURL()},h).addForEditing()}),h.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};y.push(()=>{o.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(e){let a=new v.Color(e.ambientLight.toString()),t=new v.Color(e.lightDiffuse.toString());ie({ambientLight:[a.r,a.g,a.b],lightDiffuse:[t.r,t.g,t.b],lightHeight:Number(e.lightHeight),minLightIntensity:Number(e.minLightIntensity)},e.directions??8,e.blendEmissive??!1)}}),o.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){o.bakeTexturesDialog?.show()}}),MenuBar.addAction(o.bakeTexturesAction,"tools")});C.push(()=>{MenuBar.removeAction("tools.bake_textures")});function le(e,a){let t=e.getTexture();if(!t||!Project)return null;let r=Project.materials[t.uuid];r.isShaderMaterial&&!Project.bb_materials[t.uuid]?Project.bb_materials[t.uuid]=r:r.isMeshStandardMaterial&&r.dispose();let n=new j(t.layers_enabled?t.layers.filter(i=>i.visible)??null:Project.textures,t.uuid).getMaterial({side:Canvas.getRenderSide(t),...a});return Project.materials[t.uuid]=v.ShaderMaterial.prototype.copy.call(n,r),t}function ce(e){return Object.values(e).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function Ge(e,a){let t={};return e.forAllFaces(r=>{let n=le(r,a);n&&(t[n.uuid]=n)}),ce(t)}function Ve(e,a){let t={};return Object.keys(e.faces).forEach(r=>{let n=e.faces[r],i=le(n,a);i&&(t[i.uuid]=i)}),ce(t)}var R=(e={})=>{Project&&(Project.pbr_active=Texture.all.length>0&&Project.elements.map(a=>a instanceof Mesh&&Ge(a,e)||a instanceof Cube&&Ve(a,e)).filter(Boolean).length>0)},N=(e=100)=>oe(R,e);var q={},W=()=>Condition({modes:["edit","paint"],selected:{texture:!0},project:!0,method(){let e=k();return e&&!e.material?!0:e?.material===!0&&A()!==null&&Modes.paint}}),ue=()=>Condition({modes:["paint","edit"],selected:{texture:!0},method(){let e=k();if(e?.material&&Modes.edit)return!1;let a=A()??e;return a?.channel&&a.channel!==B}});y.push(()=>{Object.entries(p).forEach(([e,a])=>{q[e]=new Action(`assign_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:W,click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t)return;Undo.initEdit({layers:[t]}),t.extend({channel:a.id});let r=t instanceof TextureLayer?t.texture:t;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([n,i])=>{i===t.uuid&&(delete Project.pbr_materials[r.uuid][n],t.channel=B)}),r.uuid===t.uuid&&(Project.pbr_materials[r.uuid]={}),Project.pbr_materials[r.uuid][e]=t.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${t.name}" to ${a.label} channel`,2e3),R()}})})});C.push(()=>{Object.values(q).forEach(e=>{e.delete()})});y.push(()=>{o.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:ue,click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e)return;Undo.initEdit({layers:[e]});let a=e instanceof TextureLayer?e.texture:e,t=e.channel;Project.pbr_materials[a.uuid]={},e.channel=B,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${e.name}" from ${t} channel`,2e3),N()}}),o.channelMenu=new Menu("channel_menu",[...Object.keys(p).map(e=>`assign_channel_${e}`),"unassign_channel"],{onOpen(){N()}}),o.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",condition:()=>W()||ue(),click(e){o.channelMenu?.open(e)},children:[...Object.values(q),o.unassignChannel]}),o.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:W,click(e){o.channelMenu?.open(e)}}),o.openChannelMenu&&(MenuBar.addAction(o.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(o.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(o.openChannelMenu,"0")),Toolbars.layers.add(o.showChannelMenu,1)});C.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(o.showChannelMenu)});function X(e,a=!1){let t=e.canvas.getContext("2d");if(!t)return null;let r=Math.max(e.img.width??e.canvas.width,Project?Project.texture_width:0,16),n=Math.max(e.img.height??e.canvas.height,Project?Project.texture_height:0,16),{data:i}=t.getImageData(0,0,r,n),s=document.createElement("canvas"),l=s.getContext("2d");if(!l)return null;let g=(c,x)=>{let _=(c+x*r)*4;return i[_]/255};s.width=r,s.height=n,l.drawImage(e.img,0,0,r,n);let h=l.getImageData(0,0,r,n),d=h.data,u=c=>{let x=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);return[c[0]/x,c[1]/x,c[2]/x]};for(let c=0;c{let c=(m+f*t)*4;return n[c]/255};i.width=t,i.height=r,s.drawImage(e.img,0,0,t,r);let g=s.getImageData(0,0,t,r),h=g.data;for(let m=0;m{o.generateNormal=new Action("generate_normal",{icon:p.normal.icon??"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(A()??k())!==null,click(e){let a=A()??k()??Texture.getDefault();if(!a)return;let t=X(a);if(!t){Blockbench.showQuickMessage("Failed to generate normal map",2e3);return}t.select(e),new j(a instanceof Texture&&a.layers_enabled?a.layers:null,a.uuid).saveTexture(p.normal,t),Blockbench.showQuickMessage("Normal map generated",2e3)}}),o.generateAo=new Action("generate_ao",{icon:p.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let e=A()??k()??Texture.getDefault();if(!e)return;let a=new j(e instanceof Texture&&e.layers_enabled?e.layers:null,e.uuid),t=a.findTexture(p.normal)??X(e);if(!t){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=de(t);if(r){a.saveTexture(p.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),MenuBar.addAction(o.generateNormal,"tools"),MenuBar.addAction(o.generateAo,"tools")});C.push(()=>{MenuBar.removeAction("tools.generate_normal")});var Qe=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},Je=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};y.push(()=>{o.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let e=k();if(!e)return;let t=new j(e.layers_enabled?e.layers:[e],e.uuid).createLabPbrOutput();if(t===null)return;let r=e.name??(Project?Project.getDisplayName():"texture");await Promise.all([Qe(t.normalMap,pathToName(r)),Je(t.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),o.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let e=TextureLayer.selected?.texture??Texture.all.find(t=>t.selected)??Texture.getDefault(),a=new j(e.layers_enabled?e.layers:[e],e.uuid);if(pathToName(e.name).endsWith("_n")){a.createTexturesFromNormal(e);return}if(pathToName(e.name).endsWith("_s")){a.createTexturesFromSpecular(e);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(o.generateLabPbr,"file.export"),MenuBar.addAction(o.decodeLabPbr,"tools")});C.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});y.push(()=>{o.createMaterialTexture=new Action("create_material_texture",{icon:"deployed_code",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let e={...p},a=new Texture({name:"New Material",saved:!1,particle:!1});a.extend({material:!0});let t=Texture.all.filter(s=>(s.selected||s.multi_selected)&&!s.material)??Texture.all,r=k(),n=r?new j(t,r.uuid):null;try{let s=n?.findTexture(p.albedo,!0)?.canvas.toDataURL()??r?.canvas.toDataURL()??Z(new v.Color(8421504),a.canvas);if(!s)return;a.fromDataURL(s);let l=new TextureLayer({name:e.albedo.label,visible:!0,data_url:s,keep_size:!0},a);l.extend({channel:e.albedo.id}),l.addForEditing(),l.texture.updateChangesAfterEdit(),n?.saveTexture(e.albedo,l),delete e.albedo}catch(s){console.warn("Failed to create base color texture",s),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let i=Object.keys(e).map(s=>{let l=p[s],g=n?.findTexture(l,!0),h=g?g.canvas.toDataURL():Z(l.default??new v.Color(0));if(!h)return;let d=new TextureLayer({name:l.label,visible:!0,data_url:h,keep_size:!0},a);return d.extend({channel:l.id}),n?.saveTexture(l,d),d}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:i}),a.add().select(),a.activateLayers(),i.map(s=>{s.addForEditing(),a.width=Math.max(a.width,s.img.width),a.height=Math.max(a.height,s.img.height)}),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(o.createMaterialTexture,"tools"),Toolbars.texturelist.add(o.createMaterialTexture,3)});C.push(()=>{MenuBar.removeAction("tools.create_material_texture"),Toolbars.texturelist.remove("create_material_texture")});var F=(e,a)=>{let t=k()??Texture.getDefault(),r=new j(t.layers_enabled?t.layers:Project?Project.textures:null,t.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[i,s]=Project?[e?`${e}_mer`:`${t.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:i,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},a)})};y.push(()=>{o.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{F()}catch(e){console.error("Failed to export MER map:",e),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),o.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let e=k()??Texture.getDefault(),a=new j([e],e.uuid),t=a.decodeMer(),r=[p.metalness,p.emissive,p.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new Texture({name:`${e?.name}_${i}`,keep_size:!1}).fromDataURL(s.toDataURL());l.add(!0),a.saveTexture(n,l)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>k()?.layers_enabled===!0,click(){let e=k()??Texture.getDefault(),a=new j(e.layers_enabled?e.layers:[e],e.uuid),t=a.decodeMer(),r=[p.metalness,p.emissive,p.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new TextureLayer({name:`${e?.name}_${i}`,data_url:s.toDataURL()},e);a.saveTexture(n,l),l.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(o.decodeMer,"tools"),MenuBar.addAction(o.generateMer,"file.export")});C.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var Ze=()=>{Project&&Project.textures.forEach(e=>{let a=new j(null,e.uuid),t=a.findTexture(p.normal,!1),r=a.findTexture(p.height,!1),n=a.findTexture(p.albedo,!1),i=a.findTexture(p.metalness,!1)?.name,s=a.findTexture(p.emissive,!1)?.name,l=a.findTexture(p.roughness,!1)?.name,g={};return n||(g.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!i&&!s&&!l&&(g.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},g.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},g.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),t&&(g.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(g.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),t&&r&&(g.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),o.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:g,cancelIndex:1,onConfirm(h){let d=I(),u=i||s||l,b={format_version:"1.16.100","minecraft:texture_set":{color:(n?d:h.baseColor?.toHexString())??d,metalness_emissive_roughness:[h.metalness??0,h.emissive??0,h.roughness??255]}};h.depthMap==="normal"&&t||!r&&t?b["minecraft:texture_set"].normal=`${d}_normal`:(!t||h.depthMap==="heightmap")&&r&&(b["minecraft:texture_set"].heightmap=`${d}_heightmap`);let m=x=>{if(!h.depthMap)return x();let _=h.depthMap==="normal"||h.depthMap&&!r,M=_?t:r;if(!M)return x();Blockbench.export({content:M.canvas.toDataURL()??"",type:"PNG",name:`${d}_${_?"normal":"heightmap"}`,extensions:["png"],resource_id:h.depthMap,startpath:Project.export_path,savetype:"image"},w=>{b["minecraft:texture_set"][_?"normal":"heightmap"]=pathToName(w,!1),x()})},f=x=>{if(!n)return x();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:d,startpath:Project.export_path,savetype:"image"},_=>{b["minecraft:texture_set"].color=pathToName(_,!1),x()})},c=()=>m(()=>{f(()=>{Blockbench.export({content:JSON.stringify(b,null,2),type:"JSON",name:`${d}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),o.textureSetDialog?.hide()})})});if(u){try{F(d,x=>{b["minecraft:texture_set"].metalness_emissive_roughness=pathToName(x,!1),c()})}catch(x){console.warn("Failed to export MER map:",x),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}c()}}),o.textureSetDialog.show()})};y.push(()=>{o.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){Ze()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(o.createTextureSet,"file.export")});C.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});y.push(()=>{o.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(e){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=e}),Preview.selected.renderer.physicallyCorrectLights=e,Blockbench.showQuickMessage(`Physically corrected lighting is now ${e?"enabled":"disabled"}`,2e3),e&&o.togglePbr?.set(!0),R()},click(){}}),MenuBar.addAction(o.toggleCorrectLights,"preview")});C.push(()=>{MenuBar.removeAction("preview.correct_lights")});var z=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(e=>{e instanceof Cube&&Object.keys(e.faces).forEach(a=>{let r=e.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var me=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],he=()=>Project&&Project.pbr_active&&R(),We=()=>{Blockbench.on(me.join(" "),he)},pe=()=>{me.forEach(e=>{Blockbench.removeListener(e,he)})};y.push(()=>{o.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(e){if(e){R(),We(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}z(),pe(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(o.togglePbr,"view")});C.push(()=>{pe(),MenuBar.removeAction("view.toggle_pbr")});var ge=e=>{let a=Math.max(-2,Math.min(2,e));Preview.all.forEach(t=>{t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};y.push(()=>{o.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(o.tonemappingSelect?.get())===v.NoToneMapping&&o.tonemappingSelect.change(v.LinearToneMapping.toString()),o.togglePbr?.set(!0)},onChange(e){ge(Number(e))},onAfter(){N()}}),o.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>o.exposureSlider!==void 0&&Number(o.exposureSlider?.get())!==1,click(){ge(1),o.exposureSlider?.setValue(1,!0),N()}}),o.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:v.NoToneMapping,value:Preview.selected.renderer.toneMapping??v.NoToneMapping,icon:"monochrome_photos",options:{[v.NoToneMapping]:"No Tone Mapping",[v.LinearToneMapping]:"Linear",[v.ReinhardToneMapping]:"Reinhard",[v.CineonToneMapping]:"Cineon",[v.NeutralToneMapping]:"Neutral",[v.ACESFilmicToneMapping]:"ACES"},onChange({value:e}){Preview.selected.renderer.toneMapping=Number(e);let a=1;Preview.selected.renderer.toneMapping===v.NoToneMapping?o.exposureSlider?.setValue(a,!0):a=Number(o.exposureSlider?.get()??1),Preview.all.forEach(t=>{t.renderer.toneMapping=Number(e),t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(e)}`,2e3),o.togglePbr&&!o.togglePbr.value&&o.togglePbr.set(!0),R()}})});var Y=class{async parse(a){let t=new ne,r="model.usda";t.file(r,"");let n=ve(),i={},s={};a.traverseVisible(h=>{if(!h.isMesh)return;let d=h;if(!d.material.isMeshStandardMaterial){console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",h);return}let u=d.geometry,b=d.material,m="geometries/Geometry_"+u.id+".usd";if(!t.file(m)){let f=et(u);t.file(m,Xe(f))}b.uuid in i||(i[b.uuid]=b),n+=Ye(d,u,b)}),n+=st(i,s),t.file(r,n),n=null;for(let h in s){let d=s[h],u=h.split("_")[1],b=d.format===v.RGBAFormat,m=qe(d.image,u),c=await(await new Promise(x=>m.toBlob(_=>_&&x(_),b?"image/png":"image/jpeg",1))).arrayBuffer();t.file(`textures/Texture_${h}.${b?"png":"jpg"}`,c)}let l=0;t.forEach(async h=>{let d=34+h.length;l+=d;let u=l&63,b=await t.file(h).async("uint8array");if(u!==4){let m=64-u,f=new Uint8Array(m),c=new Uint8Array(b.length+m);c.set(b,0),c.set(f,b.length),t.file(h,c)}l+=b.length});let g=await t.generateAsync({type:"blob",compression:"STORE"});return new Uint8Array(await g.arrayBuffer())}};function qe(e,a){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=1024/Math.max(e.width,e.height),r=document.createElement("canvas");r.width=e.width*Math.min(1,t),r.height=e.height*Math.min(1,t);let n=r.getContext("2d");if(n.imageSmoothingEnabled=!1,n.drawImage(e,0,0,r.width,r.height),a!==void 0){let i=parseInt(a,16),s=(i>>16&255)/255,l=(i>>8&255)/255,g=(i&255)/255,h=n.getImageData(0,0,r.width,r.height),d=h.data;for(let u=0;u ) { @@ -17,31 +17,31 @@ rel material:binding = } -`}function Xe(e){let a=e.elements;return`( ${G(a,0)}, ${G(a,4)}, ${G(a,8)}, ${G(a,12)} )`}function G(e,a){return`(${e[a+0]}, ${e[a+1]}, ${e[a+2]}, ${e[a+3]})`}function Ye(e){return` +`}function Ke(e){let a=e.elements;return`( ${G(a,0)}, ${G(a,4)}, ${G(a,8)}, ${G(a,12)} )`}function G(e,a){return`(${e[a+0]}, ${e[a+1]}, ${e[a+2]}, ${e[a+3]})`}function et(e){return` def "Geometry" { - ${Ke(e)} + ${tt(e)} } -`}function Ke(e){let a="Geometry",t=e.attributes,r=t.position.count;return` +`}function tt(e){let a="Geometry",t=e.attributes,r=t.position.count;return` def Mesh "${a}" { - int[] faceVertexCounts = [${et(e)}] - int[] faceVertexIndices = [${tt(e)}] + int[] faceVertexCounts = [${at(e)}] + int[] faceVertexIndices = [${rt(e)}] normal3f[] normals = [${fe(t.normal,r)}] ( interpolation = "vertex" ) point3f[] points = [${fe(t.position,r)}] - float2[] primvars:st = [${at(t.uv,r)}] ( + float2[] primvars:st = [${nt(t.uv,r)}] ( interpolation = "vertex" ) uniform token subdivisionScheme = "none" } -`}function et(e){let a=e.index!==null?e.index.count:e.attributes.position.count;return Array(a/3).fill(3).join(", ")}function tt(e){let a=e.index,t=[];if(a!==null)for(let r=0;r token inputs:wrapS = "repeat" token inputs:wrapT = "repeat" @@ -93,7 +93,7 @@ ${n.join(` `)} } -`}function xe(e){return`(${e.r}, ${e.g}, ${e.b})`}function be(e){return`(${e.x}, ${e.y})`}var ve=Y;w.push(()=>{let e=new Codec("usdz",{extension:"usdz",name:"USDZ",remember:!0,export_options:{},fileName(){return I()+".usdz"},async compile(a={}){if(!Project)throw new Error("No project loaded");R();let t=Object.assign(this.getExportOptions(),a),r=new ve,n=new M.Scene;n.name="blockbench_export",n.add(Project.model_3d);let i=await r.parse(n);return this.dispatchEvent("compile",{model:i,options:t}),Canvas.scene.add(Project.model_3d),i},async export(){let a=await this.compile();Blockbench.export({content:a,name:this.fileName(),startpath:this.startPath(),resource_id:"usdz",type:this.name,extensions:["usdz"],savetype:"buffer"},t=>this.afterDownload(t))}});o.exportUsdz=new Action("export_usdz",{category:"file",name:"Export USDZ",description:"Exports the current model as a USDZ file",icon:"file_download",async click(){e&&await e.export()}}),o.usdz=e,MenuBar.addAction(o.exportUsdz,"file.export")});P.push(()=>{MenuBar.removeAction("file.export_usdz")});var V=class e{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(p).map(t=>[t,p[t].default??new M.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([t,r])=>[t,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let t=Math.min(1,Math.max(0,a));return new M.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let a="#000000",t=Number(o.brushMetalnessSlider?.get()),r=Number(o.brushRoughnessSlider?.get()??1),n=(o.brushEmissiveColor?.get()??a).toString(),i=Number(o.brushHeightSlider?.get()),s=ColorPanel.get(),l={[p.albedo.id]:new M.Color(s),[p.metalness.id]:e.makeLinearColor(t),[p.roughness.id]:e.makeLinearColor(r),[p.emissive.id]:new M.Color(n??a),[p.height.id]:e.makeLinearColor(i),[p.normal.id]:p.normal.default??new M.Color("#8080ff")};return new e({colors:l})}};var _e="materialBrushPresets",K=()=>JSON.parse(localStorage.getItem(_e)||"{}"),st=(e,a)=>{let t=K(),r=a??guid(),n=o.userMaterialBrushPresets?.getFormResult()??{},i={};return n.albedo&&(i.albedo=n.albedo.toString()),n.metalness&&(i.metalness=Number(n.metalness)),n.roughness&&(i.roughness=Number(n.roughness)),n.emissive&&(i.emissive=n.emissive.toString()),n.height&&(i.height=Number(n.height)),t[r]=[i,e??"New Preset",U(i)],localStorage.setItem(_e,JSON.stringify(t)),r},ye=({metalness:e,roughness:a,emissive:t,height:r,albedo:n})=>{e!==void 0&&o.brushMetalnessSlider?.setValue(e||0,!0),a!==void 0&&o.brushRoughnessSlider?.setValue(a??1,!0),t!==void 0&&o.brushEmissiveColor?.set(t??"#000000"),r!==void 0&&o.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},Q=({id:e})=>Condition({project:!0,tools:["material_brush"],method(){let a=S();return(a?.layers_enabled&&a.layers.find(({channel:t})=>t&&t===e)!==void 0)===!0}}),ot=re.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:p}},methods:{applyPreset(e){try{let[a,t]=this.userPresets[e],{metalness:r,roughness:n,emissive:i,height:s,albedo:l}=a;ye({metalness:Number(r),roughness:Number(n),emissive:i.toString(),height:Number(s),albedo:l.toString()}),o.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${t}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(e){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let t=K(),r=this.userPresets[e][1]??e;delete t[e],localStorage.setItem("materialBrushPresets",JSON.stringify(t)),this.userPresets=t,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(e){o.userMaterialBrushPresets?.setFormValues({name:this.userPresets[e][1]??e,...this.userPresets[e][0]})},getSummary(e){return Object.entries(e).filter(([a])=>a in this.channels).map(([a,t])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${t}`:`${this.channels[a]?.label??a}: ${Number(t).toFixed(1)}`).join(` +`}function xe(e){return`(${e.r}, ${e.g}, ${e.b})`}function be(e){return`(${e.x}, ${e.y})`}var _e=Y;y.push(()=>{let e=new Codec("usdz",{extension:"usdz",name:"USDZ",remember:!0,export_options:{},fileName(){return I()+".usdz"},async compile(a={}){if(!Project)throw new Error("No project loaded");R();let t=Object.assign(this.getExportOptions(),a),r=new _e,n=new v.Scene;n.name="blockbench_export",n.add(Project.model_3d);let i=await r.parse(n);return this.dispatchEvent("compile",{model:i,options:t}),Canvas.scene.add(Project.model_3d),i},async export(){let a=await this.compile();Blockbench.export({content:a,name:this.fileName(),startpath:this.startPath(),resource_id:"usdz",type:this.name,extensions:["usdz"],savetype:"buffer"},t=>this.afterDownload(t))}});o.exportUsdz=new Action("export_usdz",{category:"file",name:"Export USDZ",description:"Exports the current model as a USDZ file",icon:"stacks",async click(){e&&await e.export()}}),o.usdz=e,MenuBar.addAction(o.exportUsdz,"file.export")});C.push(()=>{MenuBar.removeAction("file.export_usdz")});var V=class e{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(p).map(t=>[t,p[t].default??new v.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([t,r])=>[t,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let t=Math.min(1,Math.max(0,a));return new v.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let a="#000000",t=Number(o.brushMetalnessSlider?.get()),r=Number(o.brushRoughnessSlider?.get()??1),n=(o.brushEmissiveColor?.get()??a).toString(),i=Number(o.brushHeightSlider?.get()),s=ColorPanel.get(),l={[p.albedo.id]:new v.Color(s),[p.metalness.id]:e.makeLinearColor(t),[p.roughness.id]:e.makeLinearColor(r),[p.emissive.id]:new v.Color(n??a),[p.height.id]:e.makeLinearColor(i),[p.normal.id]:p.normal.default??new v.Color("#8080ff")};return new e({colors:l})}};var Me="materialBrushPresets",K=()=>JSON.parse(localStorage.getItem(Me)||"{}"),it=(e,a)=>{let t=K(),r=a??guid(),n=o.userMaterialBrushPresets?.getFormResult()??{},i={};return n.albedo&&(i.albedo=n.albedo.toString()),n.metalness&&(i.metalness=Number(n.metalness)),n.roughness&&(i.roughness=Number(n.roughness)),n.emissive&&(i.emissive=n.emissive.toString()),n.height&&(i.height=Number(n.height)),t[r]=[i,e??"New Preset",U(i)],localStorage.setItem(Me,JSON.stringify(t)),r},ye=({metalness:e,roughness:a,emissive:t,height:r,albedo:n})=>{e!==void 0&&o.brushMetalnessSlider?.setValue(e||0,!0),a!==void 0&&o.brushRoughnessSlider?.setValue(a??1,!0),t!==void 0&&o.brushEmissiveColor?.set(t??"#000000"),r!==void 0&&o.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},Q=({id:e})=>Condition({project:!0,tools:["material_brush"],method(){let a=k();return(a?.layers_enabled&&a.layers.find(({channel:t})=>t&&t===e)!==void 0)===!0}}),lt=re.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:p}},methods:{applyPreset(e){try{let[a,t]=this.userPresets[e],{metalness:r,roughness:n,emissive:i,height:s,albedo:l}=a;ye({metalness:Number(r),roughness:Number(n),emissive:i.toString(),height:Number(s),albedo:l.toString()}),o.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${t}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(e){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let t=K(),r=this.userPresets[e][1]??e;delete t[e],localStorage.setItem("materialBrushPresets",JSON.stringify(t)),this.userPresets=t,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(e){o.userMaterialBrushPresets?.setFormValues({name:this.userPresets[e][1]??e,...this.userPresets[e][0]})},getSummary(e){return Object.entries(e).filter(([a])=>a in this.channels).map(([a,t])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${t}`:`${this.channels[a]?.label??a}: ${Number(t).toFixed(1)}`).join(` `)}},computed:{presets(){return Object.entries(this.userPresets)}},mounted(){this.userPresets=K()},template:`
          @@ -116,7 +116,7 @@ ${n.join(`
      -
      `});w.push(()=>{o.materialBrushStyles=Blockbench.addCSS(` +
    `});y.push(()=>{o.materialBrushStyles=Blockbench.addCSS(` .preset_list { display: grid; grid-template-columns: repeat(auto-fill, 96px); @@ -197,4 +197,95 @@ ${n.join(` .delete_preset:hover .material-icons { color: var(--color-accent); - }`),o.brushMetalnessSlider=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",tool_setting:"brush_metalness",settings:{min:0,max:1,step:.01,default:0},condition:()=>Q(p.metalness)}),o.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",tool_setting:"brush_roughness",settings:{min:0,max:1,step:.01,default:1},condition:()=>Q(p.roughness)}),o.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",tool_setting:"brush_emissive",condition:()=>Q(p.emissive)}),o.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",tool_setting:"brush_height",settings:{min:0,max:1,step:.01,default:.5},condition:()=>Q(p.height)}),o.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",category:"tools",toolbar:"brush",condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){return S()?.layers_enabled??!1}},allowed_view_modes:"textured",tool_settings:{brush_metalness:0,brush_roughness:1,brush_emissive:"#000000",brush_height:.5},brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(e,a,t,r,{size:n,softness:i,texture:s,x:l,y:g}){let h=V.fromSettings(),m=Object.keys(h.colors),u=Math.floor(n-i*n/100),b=t;return s.layers.forEach(d=>{if(!d.visible||!m.includes(d.channel))return;let f=h.getChannel(d.channel);if(!f)return;let c=Math.sqrt((l-e)**2+(g-a)**2),x=Math.min(1,c/u);if(l%u<=x&&g%u<=x){let v=d.ctx.getImageData(e,a,1,1).data,_=new M.Color(`rgb(${v[0]}, ${v[1]}, ${v[2]})`);f.lerp(_,1)}d.ctx.fillStyle=f.getStyle(),d.ctx.fillRect(e,a,1,1),d.selected&&(b={r:f.r*255,g:f.g*255,b:f.b*255,a:r*255})}),b}},onCanvasClick(e){Painter.startPaintToolCanvas(e,e.event)},onSelect(){Painter.updateNslideValues(),R()},click(){B()}}),o.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:{project:!0},click(){o.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:ot,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(e){ye({metalness:Number(e.metalness??o.brushMetalnessSlider?.get()),roughness:Number(e.roughness??o.brushRoughnessSlider?.get()),emissive:(e.emissive??o.brushEmissiveColor?.get()).toString(),height:Number(e.height??o.brushHeightSlider?.get()),albedo:(e.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(e,a){o.materialBrushTool?.select(),e===1&&Blockbench.textPrompt("Save Preset","New Preset",t=>{t&&(st(t),Blockbench.showQuickMessage(`Preset "${t}" saved`,2e3))})}}).show()}}),MenuBar.addAction(o.materialBrushTool,"tools.0")});P.push(()=>{MenuBar.removeAction("tools.material_brush")});w.push(()=>{o.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","load_brush_preset","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Settings"})],condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});w.push(()=>{o.displaySettingsPanel=new Panel("display_settings",{name:"PBR Controls",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure","show_channel_select_menu"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});(()=>{let e=()=>{w.forEach(t=>t())},a=()=>{z(),P.forEach(t=>t()),Object.entries(o).forEach(([t,r])=>{try{r?.delete()}catch(n){console.warn(`Failed to delete ${t} action:`,n)}})};BBPlugin.register("pbr_preview",{version:"1.1.0",title:"PBR Tools",author:"Jason J. Gardner",description:"Create and view PBR materials in Blockbench. Export textures for Java and RenderDragon shaders.",tags:["Minecraft: Java Edition","Minecraft: Bedrock Edition","PBR"],icon:"icon.png",variant:"both",await_loading:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.3",onload:e,onunload:a})})();})(); + }`),o.brushMetalnessSlider=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",tool_setting:"brush_metalness",settings:{min:0,max:1,step:.01,default:0},condition:()=>Q(p.metalness)}),o.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",tool_setting:"brush_roughness",settings:{min:0,max:1,step:.01,default:1},condition:()=>Q(p.roughness)}),o.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",tool_setting:"brush_emissive",condition:()=>Q(p.emissive)}),o.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",tool_setting:"brush_height",settings:{min:0,max:1,step:.01,default:.5},condition:()=>Q(p.height)}),o.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",category:"tools",toolbar:"brush",condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){return k()?.layers_enabled??!1}},allowed_view_modes:"textured",tool_settings:{brush_metalness:0,brush_roughness:1,brush_emissive:"#000000",brush_height:.5},brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(e,a,t,r,{size:n,softness:i,texture:s,x:l,y:g}){let h=V.fromSettings(),d=Object.keys(h.colors),u=Math.floor(n-i*n/100),b=t;return s.layers.forEach(m=>{if(!m.visible||!d.includes(m.channel))return;let f=h.getChannel(m.channel);if(!f)return;let c=Math.sqrt((l-e)**2+(g-a)**2),x=Math.min(1,c/u);if(l%u<=x&&g%u<=x){let _=m.ctx.getImageData(e,a,1,1).data,M=new v.Color(`rgb(${_[0]}, ${_[1]}, ${_[2]})`);f.lerp(M,1)}m.ctx.fillStyle=f.getStyle(),m.ctx.fillRect(e,a,1,1),m.selected&&(b={r:f.r*255,g:f.g*255,b:f.b*255,a:r*255})}),b}},onCanvasClick(e){Painter.startPaintToolCanvas(e,e.event)},onSelect(){Painter.updateNslideValues(),R()},click(){N()}}),o.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:{project:!0},click(){o.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:lt,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(e){ye({metalness:Number(e.metalness??o.brushMetalnessSlider?.get()),roughness:Number(e.roughness??o.brushRoughnessSlider?.get()),emissive:(e.emissive??o.brushEmissiveColor?.get()).toString(),height:Number(e.height??o.brushHeightSlider?.get()),albedo:(e.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(e,a){o.materialBrushTool?.select(),e===1&&Blockbench.textPrompt("Save Preset","New Preset",t=>{t&&(it(t),Blockbench.showQuickMessage(`Preset "${t}" saved`,2e3))})}}).show()}}),MenuBar.addAction(o.materialBrushTool,"tools.0")});C.push(()=>{MenuBar.removeAction("tools.material_brush")});y.push(()=>{o.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","load_brush_preset","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Settings"})],condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});y.push(()=>{o.displaySettingsPanel=new Panel("display_settings",{name:"PBR Controls",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure","show_channel_select_menu"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});var J=e=>e.visible&&e.channel&&e.channel!==B,ct=()=>{let e=A();if(e)return e.texture.layers.filter(J);let a=k();return a?a.layers_enabled?a.layers.filter(J):Texture.all.map(t=>t.layers_enabled?[...t.layers.filter(J)]:[J(t)?t:null]).flat().filter(Boolean):[]},we=["select_texture","update_texture_selection","finish_edit","add_texture"],Te=()=>{Panels.channels_panel.inside_vue.textures=ct()};y.push(()=>{o.channelsPanelStyle=Blockbench.addCSS(` + .texture_channel { + color: var(--color-text); + flex: 1; + font-size: 1em; + margin: 0 0 0 auto; + padding: 0 8px; + text-align: right; + } + + .texture_channel + .texture_particle_icon { + padding-right: 8px; + } + + .texture_channel_description { + background-color: var(--color-back); + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: space-between; + } + + .texture_channel_wrapper { + align-items: center; + background-color: var(--color-ui); + border-left: 1px solid var(--color-border); + display: flex; + flex: 1; + flex-direction: row; + align-items: center; + flex-wrap: nowrap; + padding: 0 8px; + } + + .texture_channel_wrapper:hover { + background-color: var(--color-button); + } + + .texture_channel_description .texture_name { + flex-direction: column; + flex-wrap: nowrap; + color: var(--color-subtle_text); + display: flex; + flex: 1; + justify-content: center; + align-items: start; + } + + .texture_parent { + color: var(--color-subtle_text); + font-size: 0.8em; + } + + .texture_channel_description:hover .texture_channel { + color: var(--color-accent); + } + + #pbr_channel_list { + display: flex; + flex-direction: column; + } + + #pbr_channel_list .texture { + border-top: 1px solid var(--color-border); + padding-right: 0; + } + `),o.channelsPanel=new Panel("channels_panel",{name:"PBR Channels",id:"channels_panel",icon:"gallery_thumbnail",condition:{project:!0,selected:{texture:!0},modes:["paint","edit"]},toolbars:[],component:{name:"ChannelsPanel",data(){return{channels:p,textures:[]}},methods:{openMenu(e){o.channelMenu?.open(e)},selectTexture(e){Modes.options.paint.select(),e.select(),e.scrollTo()},channelEnabled(e){return e.channel&&e.channel!==B&&e.channel in this.channels},getImgSrc(e){return e.img?.src??`data:image/png;base64,${e.canvas.toDataURL()}`}},template:` +
    +
      +
    • + +
      +
      +
      {{ texture.name }}
      +
      + {{ texture.texture.name }} +
      +
      +
      +
      {{ channels[texture.channel].label }}
      + {{ channels[texture.channel].icon }} +
      +
      +
    • +
    +
    `},expand_button:!0,growable:!0,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:350,folded:!0},insert_after:"layers",insert_before:"color"}),Blockbench.on(we.join(" "),Te)});C.push(()=>{we.forEach(e=>{Blockbench.removeListener(e,Te)})});(()=>{let e=()=>{y.forEach(t=>t())},a=()=>{z(),C.forEach(t=>t()),Object.entries(o).forEach(([t,r])=>{try{r?.delete()}catch(n){console.warn(`Failed to delete ${t} action:`,n)}})};BBPlugin.register("pbr_preview",{version:"1.1.0",title:"PBR Tools",author:"Jason J. Gardner",description:"Create and view PBR materials in Blockbench. Export textures for Java and RenderDragon shaders.",tags:["Minecraft: Java Edition","Minecraft: Bedrock Edition","PBR"],icon:"icon.png",variant:"both",await_loading:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.3",onload:e,onunload:a})})();})(); diff --git a/src/pbr_preview/src/lib/actions/channelAssignment.ts b/src/pbr_preview/src/lib/actions/channelAssignment.ts index 5fbc184c..72b4cb73 100644 --- a/src/pbr_preview/src/lib/actions/channelAssignment.ts +++ b/src/pbr_preview/src/lib/actions/channelAssignment.ts @@ -18,8 +18,6 @@ import { getSelectedLayer, getSelectedTexture } from "../util"; */ const channelAssignmentActions: Record = {}; -const channelSelectActions: Record = {}; - const canShowChannelAssignment = () => Condition({ modes: ["edit", "paint"], @@ -117,62 +115,11 @@ setups.push(() => { applyPbrMaterial(); }, }); - - channelSelectActions[key] = new Action(`select_channel_${key}`, { - icon: channel.icon ?? "tv_options_edit_channels", - name: channel.label ?? key, - description: `Select the ${channel.label} channel`, - condition: { - project: true, - selected: { - texture: true, - }, - modes: ["paint", "edit"], - method() { - const selected = getSelectedTexture(); - const layers = selected?.layers_enabled - ? selected.layers - : Texture.all; - - return layers.some( - (layer: Texture | TextureLayer) => layer.channel === key - ); - }, - }, - click() { - const layers = Texture.selected?.layers_enabled - ? Texture.selected.layers - : Texture.all; - - if (!layers || !layers.length) { - return; - } - - const layer = layers.find( - (layer: Texture | TextureLayer) => layer.channel === key - ); - - if (!layer) { - return; - } - - Modes.options.paint.select(); - - layer.select(); - layer.scrollTo(); - }, - }); - - channelSelectActions[key].addLabel(true, () => channel.label ?? key); }); }); teardowns.push(() => { - const actions = [ - ...Object.values(channelAssignmentActions), - ...Object.values(channelSelectActions), - ]; - actions.forEach((action) => { + Object.values(channelAssignmentActions).forEach((action) => { action.delete(); }); }); @@ -226,11 +173,6 @@ setups.push(() => { } ); - registry.channelSelectionMenu = new Menu( - "channel_selection_menu", - Object.keys(CHANNELS).map((key) => `select_channel_${key}`) - ); - registry.openChannelMenu = new Action("pbr_channel_menu", { name: "Assign to PBR Channel", icon: "texture", @@ -255,30 +197,6 @@ setups.push(() => { }, }); - registry.showChannelSelectionMenu = new Action("show_channel_select_menu", { - icon: "tv_options_edit_channels", - name: "Select PBR Channel", - description: "Select a channel to view", - category: "textures", - condition: { - modes: ["edit", "paint"], - selected: { - texture: true, - }, - method() { - const selected = getSelectedTexture(); - const layers = selected?.layers_enabled ? selected.layers : Texture.all; - - return layers.some((layer: Texture | TextureLayer) => - Object.keys(CHANNELS).some((key) => layer.channel === key) - ); - }, - }, - click(event) { - registry.channelSelectionMenu?.open(event as MouseEvent); - }, - }); - if (registry.openChannelMenu) { MenuBar.addAction(registry.openChannelMenu, "image.0"); Texture.prototype.menu.addAction(registry.openChannelMenu, "0"); diff --git a/src/pbr_preview/src/lib/actions/usdz.ts b/src/pbr_preview/src/lib/actions/usdz.ts index 83d84584..94fe5cfb 100644 --- a/src/pbr_preview/src/lib/actions/usdz.ts +++ b/src/pbr_preview/src/lib/actions/usdz.ts @@ -57,7 +57,7 @@ setups.push(() => { category: "file", name: "Export USDZ", description: "Exports the current model as a USDZ file", - icon: "file_download", + icon: "stacks", async click() { if (!usdz) { return; diff --git a/src/pbr_preview/src/lib/panels/channels.ts b/src/pbr_preview/src/lib/panels/channels.ts index 81836d11..479bb6de 100644 --- a/src/pbr_preview/src/lib/panels/channels.ts +++ b/src/pbr_preview/src/lib/panels/channels.ts @@ -1,7 +1,52 @@ import type { IChannel } from "../../types"; -import { registry, setups, CHANNELS, NA_CHANNEL } from "../../constants"; +import { + registry, + setups, + CHANNELS, + NA_CHANNEL, + teardowns, +} from "../../constants"; import { getSelectedLayer, getSelectedTexture } from "../util"; +const filterLayers = (layer: Texture | TextureLayer) => + layer.visible && layer.channel && layer.channel !== NA_CHANNEL; + +const getChannels = () => { + const selectedLayer = getSelectedLayer(); + + if (selectedLayer) { + return selectedLayer.texture.layers.filter(filterLayers); + } + + const selectedTexture = getSelectedTexture(); + + if (!selectedTexture) { + return []; + } + + return selectedTexture.layers_enabled + ? selectedTexture.layers.filter(filterLayers) + : Texture.all + .map((t) => + t.layers_enabled + ? [...t.layers.filter(filterLayers)] + : [filterLayers(t) ? t : null] + ) + .flat() + .filter(Boolean); +}; + +const events: EventName[] = [ + "select_texture" as EventName, + "update_texture_selection" as EventName, + "finish_edit", + "add_texture", +]; + +const refresh = () => { + Panels.channels_panel.inside_vue.textures = getChannels(); +}; + setups.push(() => { registry.channelsPanelStyle = Blockbench.addCSS(/* css */ ` .texture_channel { @@ -83,19 +128,21 @@ setups.push(() => { modes: ["paint", "edit"], }, toolbars: [ - new Toolbar("channel_assignment_toolbar", { - id: "channel_assignment_toolbar", - children: ["create_material_texture", "show_channel_menu"], - name: "PBR Channel Controls", - }), + // new Toolbar("channel_assignment_toolbar", { + // id: "channel_assignment_toolbar", + // children: ["create_material_texture", "show_channel_menu"], + // name: "PBR Channel Controls", + // }), ], component: { name: "ChannelsPanel", data(): { channels: Record; + textures: Array; } { return { channels: CHANNELS, + textures: [], }; }, methods: { @@ -121,35 +168,6 @@ setups.push(() => { ); }, }, - computed: { - textures() { - const filterLayers = (layer: Texture | TextureLayer) => - layer.visible && layer.channel && layer.channel !== NA_CHANNEL; - - const selectedLayer = getSelectedLayer(); - - if (selectedLayer) { - return selectedLayer.texture.layers.filter(filterLayers); - } - - const selectedTexture = getSelectedTexture(); - - if (!selectedTexture) { - return []; - } - - return selectedTexture.layers_enabled - ? selectedTexture.layers.filter(filterLayers) - : Texture.all - .map((t) => - t.layers_enabled - ? [...t.layers.filter(filterLayers)] - : [filterLayers(t) ? t : null] - ) - .flat() - .filter(Boolean); - }, - }, template: /* html */ `
      @@ -192,4 +210,12 @@ setups.push(() => { insert_after: "layers", insert_before: "color", }); + + Blockbench.on(events.join(" ") as EventName, refresh); +}); + +teardowns.push(() => { + events.forEach((event) => { + Blockbench.removeListener(event, refresh); + }); }); diff --git a/src/pbr_preview/src/lib/panels/index.ts b/src/pbr_preview/src/lib/panels/index.ts index 205f666b..d490932a 100644 --- a/src/pbr_preview/src/lib/panels/index.ts +++ b/src/pbr_preview/src/lib/panels/index.ts @@ -1,5 +1,3 @@ import "./materialBrush"; import "./pbrSettings"; -// FIXME: Channels panel is not behaving as expected -// @see https://discord.com/channels/314078526104141834/1247941848979214406 -// import "./channels"; +import "./channels"; From 60a655e46af611396404bd3c6f0c4b1cc95c5df4 Mon Sep 17 00:00:00 2001 From: Jason Gardner Date: Tue, 18 Jun 2024 12:13:46 -0500 Subject: [PATCH 29/50] docs: Add USDZ section --- plugins/pbr_preview/about.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/pbr_preview/about.md b/plugins/pbr_preview/about.md index 12e9b33e..53350616 100644 --- a/plugins/pbr_preview/about.md +++ b/plugins/pbr_preview/about.md @@ -1,5 +1,5 @@ -**Create and view PBR textures in Blockbench. Exports in formats for labPBR -(Java) and RenderDragon (Bedrock) shaders.** +**Create and view PBR textures in Blockbench. Exports [USDZ](https://openusd.org/release/index.html) and in formats for labPBR +(Java) or RenderDragon (Bedrock) shaders** > **_PBR:_ Physically based rendering**\ > Read the @@ -74,6 +74,10 @@ - Save material brush presets to a collection. - Automatic PBR preview updates after every brush stroke. +### Export USDZ Scenes + +- Adds new codec for exporting in USDZ format. + ## Usage ### PBR Controls From 27230507482ce7488b6f40f97e3e24ea6d924244 Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 19 Jun 2024 20:54:05 -0500 Subject: [PATCH 30/50] feat: .bbmat format (#10) - Added custom format for importing/exporting material texture layers --- plugins/pbr_preview/pbr_preview.js | 36 +-- src/pbr_preview/src/lib/actions/index.ts | 1 + .../src/lib/actions/materialTexture.ts | 1 + src/pbr_preview/src/lib/io/bbmat.ts | 208 ++++++++++++++++++ src/pbr_preview/src/types.d.ts | 8 + 5 files changed, 236 insertions(+), 18 deletions(-) create mode 100644 src/pbr_preview/src/lib/io/bbmat.ts diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index a471c81d..ef9a378a 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1,4 +1,4 @@ -"use strict";(()=>{var v=THREE,re=Vue,ne=window.JSZip;var B="_NONE_",p={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new v.Color(16777215),regex:new RegExp("(s|_)*(basecolor|color|albedo)","i")},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new v.Color(0),regex:new RegExp("[ _]*metal(lic|ness)?","i")},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new v.Color(0),regex:new RegExp("[ _]*(emissive|emission)","i")},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new v.Color(16777215),regex:new RegExp("[ _]*rough(ness)?","i")},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new v.Color(16777215),regex:new RegExp("[ _]*(height|bump)","i")},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new v.Color("rgb(128, 128, 255)"),regex:new RegExp("[ _]*normal","i")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new v.Color(16777215),regex:new RegExp("[ _]*(ao|ambientocclusion|ambient occlusion)","i")}},o={},y=[],C=[];var se=[...Object.keys(p).map(e=>p[e].id),B];y.push(()=>{o.channelProp=new Property(TextureLayer,"enum","channel",{default:B,values:se,label:"PBR Channel",exposed:!1}),o.textureChannelProp=new Property(Texture,"enum","channel",{default:B,values:se,label:"PBR Channel",exposed:!1}),o.materialTextureProp=new Property(Texture,"boolean","material",{default:!1,label:"Material Texture"}),o.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),o.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),o.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!1,values:[],label:"PBR Mode"})});function k(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(e=>e.selected)??null:Texture.all.find(e=>e.selected)??Texture.getDefault()}function A(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(e=>e.selected)??Project.selected_texture.layers[0]:k()?.getActiveLayer()??null}function I(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(k()?.name??"texture")}function oe(e,a){let t;return function(...r){let n=()=>{t=void 0,e.apply(this,r)};clearTimeout(t),t=setTimeout(n,a)}}function U(e){let a=MediaPreview.renderer??new v.WebGLRenderer({alpha:!0,antialias:!0}),t=new v.Scene,r=new v.PerspectiveCamera(75,96/96,.1,1e3),n=new v.AmbientLight(16777215,.75);t.add(n);let i=new v.PointLight(16777215,1,100);i.position.set(5,5,5),t.add(i);let s=new v.SphereGeometry(1,32,32),l=e instanceof v.MeshStandardMaterial&&e.isMeshStandardMaterial?e:new v.MeshStandardMaterial({color:e.albedo,metalness:e.metalness??0,roughness:e.roughness??1,emissive:e.emissive,bumpScale:e.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),g=new v.Mesh(s,l);t.add(g),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(t,r);let h=a.domElement.toDataURL();return l.dispose(),MediaPreview.renderer||(a.clear(),a.dispose()),h}function Z(e,a){let t=a??document.createElement("canvas"),r=t.getContext("2d");if(!r)return t.remove(),null;let n=Math.max(Project?Project.texture_width:16,16),i=Math.max(Project?Project.texture_height:16,16);t.width=n,t.height=i,r.fillStyle=`rgb(${e.r*255}, ${e.g*255}, ${e.b*255})`,r.fillRect(0,0,n,i);let s=t.toDataURL();return a||t.remove(),s}var ze=(e=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return e?a.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):a},j=class e{constructor(a,t){this._scope=a??ze(),this._materialUuid=t}merToCanvas(){let a=this.getTexture(p.emissive),t=this.getTexture(p.roughness),r=this.getTexture(p.metalness);if(!a&&!t&&!r){let{metalness:n,emissive:i,roughness:s}=this.decodeMer();n&&(r=e.makePixelatedCanvas(n)),i&&(a=e.makePixelatedCanvas(i)),s&&(t=e.makePixelatedCanvas(s))}return{emissiveMap:a,roughnessMap:t,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(p.emissive),roughnessMap:this.getTexture(p.roughness),metalnessMap:this.getTexture(p.metalness)},i=this.getTexture(p.normal);return new v.MeshStandardMaterial({map:this.getTexture(p.albedo)??e.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(s=>s.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(p.ao),bumpMap:this.getTexture(p.height),normalMap:i,normalScale:new v.Vector2(-1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}renderMaterialPreview(){return U(this.getMaterial())}saveTexture(a,t){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=t.uuid,t.extend({channel:a.id}))}findTexture(a,t=!0){if(!Project)return null;let r=this._scope.find(g=>g.channel&&(g.channel===a||g.channel===a.id));if(r)return r;let[n,i]=typeof a=="string"?[a,new RegExp(`_*${a}(.[^.]+)?$`,"i")]:[a.id,a.regex??new RegExp(`_*${a.id}(.[^.]+)?$`,"i")];Project.pbr_materials=Project.pbr_materials??{};let s=Project.pbr_materials[this._materialUuid];if(t&&!s?.length&&n!==B)return this._scope.find(g=>i.test(g.name))??null;let l=s?.[n];return l?this._scope.find(g=>g.uuid===l)??null:null}static makePixelatedCanvas(a){let t=new v.CanvasTexture(a,void 0,void 0,void 0,v.NearestFilter,v.NearestFilter);return t.needsUpdate=!0,t}getTexture(a){let t=this.findTexture(a);return t?e.makePixelatedCanvas(t.canvas):null}static extractChannel(a,t){let r=a.canvas,{width:n,height:i}=r,s=r.getContext("2d");if(!s||!n||!i)return null;let l=document.createElement("canvas");l.width=n,l.height=i;let g=l.getContext("2d");if(!g)return null;let h={r:0,g:1,b:2,a:3}[t],{data:d}=s.getImageData(0,0,n,i),u=new Uint8ClampedArray(n*i*4);for(let m=0;ma){f[c]=b.data[c],f[c+1]=b.data[c+1],f[c+2]=b.data[c+2],f[c+3]=255;continue}f[c]=0,f[c+1]=0,f[c+2]=0,f[c+3]=255}return h.putImageData(new ImageData(f,l.width,l.height),0,0),{metalness:r,emissive:l,emissiveLevel:n,roughness:i,sss:s}}createMer(a=!1){let t=this.findTexture(p.metalness,a),r=this.findTexture(p.emissive,a),n=this.findTexture(p.roughness,a),i=this.findTexture("sss",!1),s=Math.max(t?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),l=Math.max(t?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),g=document.createElement("canvas");g.width=s,g.height=l;let h=g.getContext("2d");if(!h)return null;let d=t?.img?e.extractChannel(t,"r"):null,u=r?.img?e.extractChannel(r,"g"):null,b=n?.img?e.extractChannel(n,"b"):null,m=i&&i?.img?e.extractChannel(i,"a"):null,f=d?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),c=u?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),x=b?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),_=m?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(new Uint8ClampedArray(s*l*4).fill(255),s,l),M=new Uint8ClampedArray(s*l*4);for(let w=0;w{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createTexturesFromNormal(a){let t=this.decodeLabPbrNormal(a);return Object.entries(t).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}};var O=class{constructor({lightHeight:a=.66,ambientLight:t=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:n=[1,1,1]}={}){this.lightHeight=a,this.ambientLight=t,this.minLightIntensity=r,this.lightDiffuse=n}bake(a,t,r){let n=t instanceof HTMLCanvasElement?t:this.createCanvas(t.width,t.height),i=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),s=n.getContext("2d"),l=i.getContext("2d");s.drawImage(t,0,0),l.drawImage(r,0,0);let g=s.getImageData(0,0,t.width,t.height),h=l.getImageData(0,0,r.width,r.height),d=[],u=[];for(let m=0;m{let f=this.createCanvas(t.width,t.height),c=f.getContext("2d"),x=c.getImageData(0,0,f.width,f.height),_=[Math.cos(m),Math.sin(m),this.lightHeight];for(let M=0;M{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new j(r.layers_enabled?r.layers:Project.textures,r.uuid),i=n.findTexture(p.albedo);if(!i){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let s=n.findTexture(p.normal);if(!s){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let g=new O(e).bake(a,i.canvas,s.canvas),h=new Texture({name:`${i.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(g[0].toDataURL()),d=t?u=>{let b=n.findTexture(p.emissive);if(!b)return u;let m=b.canvas;if(!m.getContext("2d"))return u;let c=Math.max(u.width,m.width,Project?Project.texture_width:16),x=Math.max(u.height,m.height,Project?Project.texture_height:16),_=document.createElement("canvas");_.width=c,_.height=x;let M=_.getContext("2d");return M?(M.drawImage(u,0,0),M.globalCompositeOperation="screen",M.drawImage(m,0,0),_):u}:u=>u;g.forEach((u,b)=>{new TextureLayer({name:`baked_${b+1}`,data_url:d(u).toDataURL()},h).addForEditing()}),h.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};y.push(()=>{o.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(e){let a=new v.Color(e.ambientLight.toString()),t=new v.Color(e.lightDiffuse.toString());ie({ambientLight:[a.r,a.g,a.b],lightDiffuse:[t.r,t.g,t.b],lightHeight:Number(e.lightHeight),minLightIntensity:Number(e.minLightIntensity)},e.directions??8,e.blendEmissive??!1)}}),o.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){o.bakeTexturesDialog?.show()}}),MenuBar.addAction(o.bakeTexturesAction,"tools")});C.push(()=>{MenuBar.removeAction("tools.bake_textures")});function le(e,a){let t=e.getTexture();if(!t||!Project)return null;let r=Project.materials[t.uuid];r.isShaderMaterial&&!Project.bb_materials[t.uuid]?Project.bb_materials[t.uuid]=r:r.isMeshStandardMaterial&&r.dispose();let n=new j(t.layers_enabled?t.layers.filter(i=>i.visible)??null:Project.textures,t.uuid).getMaterial({side:Canvas.getRenderSide(t),...a});return Project.materials[t.uuid]=v.ShaderMaterial.prototype.copy.call(n,r),t}function ce(e){return Object.values(e).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function Ge(e,a){let t={};return e.forAllFaces(r=>{let n=le(r,a);n&&(t[n.uuid]=n)}),ce(t)}function Ve(e,a){let t={};return Object.keys(e.faces).forEach(r=>{let n=e.faces[r],i=le(n,a);i&&(t[i.uuid]=i)}),ce(t)}var R=(e={})=>{Project&&(Project.pbr_active=Texture.all.length>0&&Project.elements.map(a=>a instanceof Mesh&&Ge(a,e)||a instanceof Cube&&Ve(a,e)).filter(Boolean).length>0)},N=(e=100)=>oe(R,e);var q={},W=()=>Condition({modes:["edit","paint"],selected:{texture:!0},project:!0,method(){let e=k();return e&&!e.material?!0:e?.material===!0&&A()!==null&&Modes.paint}}),ue=()=>Condition({modes:["paint","edit"],selected:{texture:!0},method(){let e=k();if(e?.material&&Modes.edit)return!1;let a=A()??e;return a?.channel&&a.channel!==B}});y.push(()=>{Object.entries(p).forEach(([e,a])=>{q[e]=new Action(`assign_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:W,click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t)return;Undo.initEdit({layers:[t]}),t.extend({channel:a.id});let r=t instanceof TextureLayer?t.texture:t;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([n,i])=>{i===t.uuid&&(delete Project.pbr_materials[r.uuid][n],t.channel=B)}),r.uuid===t.uuid&&(Project.pbr_materials[r.uuid]={}),Project.pbr_materials[r.uuid][e]=t.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${t.name}" to ${a.label} channel`,2e3),R()}})})});C.push(()=>{Object.values(q).forEach(e=>{e.delete()})});y.push(()=>{o.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:ue,click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e)return;Undo.initEdit({layers:[e]});let a=e instanceof TextureLayer?e.texture:e,t=e.channel;Project.pbr_materials[a.uuid]={},e.channel=B,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${e.name}" from ${t} channel`,2e3),N()}}),o.channelMenu=new Menu("channel_menu",[...Object.keys(p).map(e=>`assign_channel_${e}`),"unassign_channel"],{onOpen(){N()}}),o.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",condition:()=>W()||ue(),click(e){o.channelMenu?.open(e)},children:[...Object.values(q),o.unassignChannel]}),o.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:W,click(e){o.channelMenu?.open(e)}}),o.openChannelMenu&&(MenuBar.addAction(o.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(o.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(o.openChannelMenu,"0")),Toolbars.layers.add(o.showChannelMenu,1)});C.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(o.showChannelMenu)});function X(e,a=!1){let t=e.canvas.getContext("2d");if(!t)return null;let r=Math.max(e.img.width??e.canvas.width,Project?Project.texture_width:0,16),n=Math.max(e.img.height??e.canvas.height,Project?Project.texture_height:0,16),{data:i}=t.getImageData(0,0,r,n),s=document.createElement("canvas"),l=s.getContext("2d");if(!l)return null;let g=(c,x)=>{let _=(c+x*r)*4;return i[_]/255};s.width=r,s.height=n,l.drawImage(e.img,0,0,r,n);let h=l.getImageData(0,0,r,n),d=h.data,u=c=>{let x=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);return[c[0]/x,c[1]/x,c[2]/x]};for(let c=0;c{let c=(m+f*t)*4;return n[c]/255};i.width=t,i.height=r,s.drawImage(e.img,0,0,t,r);let g=s.getImageData(0,0,t,r),h=g.data;for(let m=0;m{o.generateNormal=new Action("generate_normal",{icon:p.normal.icon??"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(A()??k())!==null,click(e){let a=A()??k()??Texture.getDefault();if(!a)return;let t=X(a);if(!t){Blockbench.showQuickMessage("Failed to generate normal map",2e3);return}t.select(e),new j(a instanceof Texture&&a.layers_enabled?a.layers:null,a.uuid).saveTexture(p.normal,t),Blockbench.showQuickMessage("Normal map generated",2e3)}}),o.generateAo=new Action("generate_ao",{icon:p.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let e=A()??k()??Texture.getDefault();if(!e)return;let a=new j(e instanceof Texture&&e.layers_enabled?e.layers:null,e.uuid),t=a.findTexture(p.normal)??X(e);if(!t){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=de(t);if(r){a.saveTexture(p.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),MenuBar.addAction(o.generateNormal,"tools"),MenuBar.addAction(o.generateAo,"tools")});C.push(()=>{MenuBar.removeAction("tools.generate_normal")});var Qe=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},Je=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};y.push(()=>{o.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let e=k();if(!e)return;let t=new j(e.layers_enabled?e.layers:[e],e.uuid).createLabPbrOutput();if(t===null)return;let r=e.name??(Project?Project.getDisplayName():"texture");await Promise.all([Qe(t.normalMap,pathToName(r)),Je(t.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),o.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let e=TextureLayer.selected?.texture??Texture.all.find(t=>t.selected)??Texture.getDefault(),a=new j(e.layers_enabled?e.layers:[e],e.uuid);if(pathToName(e.name).endsWith("_n")){a.createTexturesFromNormal(e);return}if(pathToName(e.name).endsWith("_s")){a.createTexturesFromSpecular(e);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(o.generateLabPbr,"file.export"),MenuBar.addAction(o.decodeLabPbr,"tools")});C.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});y.push(()=>{o.createMaterialTexture=new Action("create_material_texture",{icon:"deployed_code",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let e={...p},a=new Texture({name:"New Material",saved:!1,particle:!1});a.extend({material:!0});let t=Texture.all.filter(s=>(s.selected||s.multi_selected)&&!s.material)??Texture.all,r=k(),n=r?new j(t,r.uuid):null;try{let s=n?.findTexture(p.albedo,!0)?.canvas.toDataURL()??r?.canvas.toDataURL()??Z(new v.Color(8421504),a.canvas);if(!s)return;a.fromDataURL(s);let l=new TextureLayer({name:e.albedo.label,visible:!0,data_url:s,keep_size:!0},a);l.extend({channel:e.albedo.id}),l.addForEditing(),l.texture.updateChangesAfterEdit(),n?.saveTexture(e.albedo,l),delete e.albedo}catch(s){console.warn("Failed to create base color texture",s),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let i=Object.keys(e).map(s=>{let l=p[s],g=n?.findTexture(l,!0),h=g?g.canvas.toDataURL():Z(l.default??new v.Color(0));if(!h)return;let d=new TextureLayer({name:l.label,visible:!0,data_url:h,keep_size:!0},a);return d.extend({channel:l.id}),n?.saveTexture(l,d),d}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:i}),a.add().select(),a.activateLayers(),i.map(s=>{s.addForEditing(),a.width=Math.max(a.width,s.img.width),a.height=Math.max(a.height,s.img.height)}),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(o.createMaterialTexture,"tools"),Toolbars.texturelist.add(o.createMaterialTexture,3)});C.push(()=>{MenuBar.removeAction("tools.create_material_texture"),Toolbars.texturelist.remove("create_material_texture")});var F=(e,a)=>{let t=k()??Texture.getDefault(),r=new j(t.layers_enabled?t.layers:Project?Project.textures:null,t.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[i,s]=Project?[e?`${e}_mer`:`${t.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:i,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},a)})};y.push(()=>{o.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{F()}catch(e){console.error("Failed to export MER map:",e),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),o.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let e=k()??Texture.getDefault(),a=new j([e],e.uuid),t=a.decodeMer(),r=[p.metalness,p.emissive,p.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new Texture({name:`${e?.name}_${i}`,keep_size:!1}).fromDataURL(s.toDataURL());l.add(!0),a.saveTexture(n,l)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>k()?.layers_enabled===!0,click(){let e=k()??Texture.getDefault(),a=new j(e.layers_enabled?e.layers:[e],e.uuid),t=a.decodeMer(),r=[p.metalness,p.emissive,p.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new TextureLayer({name:`${e?.name}_${i}`,data_url:s.toDataURL()},e);a.saveTexture(n,l),l.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(o.decodeMer,"tools"),MenuBar.addAction(o.generateMer,"file.export")});C.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var Ze=()=>{Project&&Project.textures.forEach(e=>{let a=new j(null,e.uuid),t=a.findTexture(p.normal,!1),r=a.findTexture(p.height,!1),n=a.findTexture(p.albedo,!1),i=a.findTexture(p.metalness,!1)?.name,s=a.findTexture(p.emissive,!1)?.name,l=a.findTexture(p.roughness,!1)?.name,g={};return n||(g.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!i&&!s&&!l&&(g.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},g.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},g.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),t&&(g.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(g.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),t&&r&&(g.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),o.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:g,cancelIndex:1,onConfirm(h){let d=I(),u=i||s||l,b={format_version:"1.16.100","minecraft:texture_set":{color:(n?d:h.baseColor?.toHexString())??d,metalness_emissive_roughness:[h.metalness??0,h.emissive??0,h.roughness??255]}};h.depthMap==="normal"&&t||!r&&t?b["minecraft:texture_set"].normal=`${d}_normal`:(!t||h.depthMap==="heightmap")&&r&&(b["minecraft:texture_set"].heightmap=`${d}_heightmap`);let m=x=>{if(!h.depthMap)return x();let _=h.depthMap==="normal"||h.depthMap&&!r,M=_?t:r;if(!M)return x();Blockbench.export({content:M.canvas.toDataURL()??"",type:"PNG",name:`${d}_${_?"normal":"heightmap"}`,extensions:["png"],resource_id:h.depthMap,startpath:Project.export_path,savetype:"image"},w=>{b["minecraft:texture_set"][_?"normal":"heightmap"]=pathToName(w,!1),x()})},f=x=>{if(!n)return x();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:d,startpath:Project.export_path,savetype:"image"},_=>{b["minecraft:texture_set"].color=pathToName(_,!1),x()})},c=()=>m(()=>{f(()=>{Blockbench.export({content:JSON.stringify(b,null,2),type:"JSON",name:`${d}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),o.textureSetDialog?.hide()})})});if(u){try{F(d,x=>{b["minecraft:texture_set"].metalness_emissive_roughness=pathToName(x,!1),c()})}catch(x){console.warn("Failed to export MER map:",x),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}c()}}),o.textureSetDialog.show()})};y.push(()=>{o.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){Ze()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(o.createTextureSet,"file.export")});C.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});y.push(()=>{o.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(e){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=e}),Preview.selected.renderer.physicallyCorrectLights=e,Blockbench.showQuickMessage(`Physically corrected lighting is now ${e?"enabled":"disabled"}`,2e3),e&&o.togglePbr?.set(!0),R()},click(){}}),MenuBar.addAction(o.toggleCorrectLights,"preview")});C.push(()=>{MenuBar.removeAction("preview.correct_lights")});var z=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(e=>{e instanceof Cube&&Object.keys(e.faces).forEach(a=>{let r=e.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var me=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],he=()=>Project&&Project.pbr_active&&R(),We=()=>{Blockbench.on(me.join(" "),he)},pe=()=>{me.forEach(e=>{Blockbench.removeListener(e,he)})};y.push(()=>{o.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(e){if(e){R(),We(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}z(),pe(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(o.togglePbr,"view")});C.push(()=>{pe(),MenuBar.removeAction("view.toggle_pbr")});var ge=e=>{let a=Math.max(-2,Math.min(2,e));Preview.all.forEach(t=>{t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};y.push(()=>{o.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(o.tonemappingSelect?.get())===v.NoToneMapping&&o.tonemappingSelect.change(v.LinearToneMapping.toString()),o.togglePbr?.set(!0)},onChange(e){ge(Number(e))},onAfter(){N()}}),o.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>o.exposureSlider!==void 0&&Number(o.exposureSlider?.get())!==1,click(){ge(1),o.exposureSlider?.setValue(1,!0),N()}}),o.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:v.NoToneMapping,value:Preview.selected.renderer.toneMapping??v.NoToneMapping,icon:"monochrome_photos",options:{[v.NoToneMapping]:"No Tone Mapping",[v.LinearToneMapping]:"Linear",[v.ReinhardToneMapping]:"Reinhard",[v.CineonToneMapping]:"Cineon",[v.NeutralToneMapping]:"Neutral",[v.ACESFilmicToneMapping]:"ACES"},onChange({value:e}){Preview.selected.renderer.toneMapping=Number(e);let a=1;Preview.selected.renderer.toneMapping===v.NoToneMapping?o.exposureSlider?.setValue(a,!0):a=Number(o.exposureSlider?.get()??1),Preview.all.forEach(t=>{t.renderer.toneMapping=Number(e),t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(e)}`,2e3),o.togglePbr&&!o.togglePbr.value&&o.togglePbr.set(!0),R()}})});var Y=class{async parse(a){let t=new ne,r="model.usda";t.file(r,"");let n=ve(),i={},s={};a.traverseVisible(h=>{if(!h.isMesh)return;let d=h;if(!d.material.isMeshStandardMaterial){console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",h);return}let u=d.geometry,b=d.material,m="geometries/Geometry_"+u.id+".usd";if(!t.file(m)){let f=et(u);t.file(m,Xe(f))}b.uuid in i||(i[b.uuid]=b),n+=Ye(d,u,b)}),n+=st(i,s),t.file(r,n),n=null;for(let h in s){let d=s[h],u=h.split("_")[1],b=d.format===v.RGBAFormat,m=qe(d.image,u),c=await(await new Promise(x=>m.toBlob(_=>_&&x(_),b?"image/png":"image/jpeg",1))).arrayBuffer();t.file(`textures/Texture_${h}.${b?"png":"jpg"}`,c)}let l=0;t.forEach(async h=>{let d=34+h.length;l+=d;let u=l&63,b=await t.file(h).async("uint8array");if(u!==4){let m=64-u,f=new Uint8Array(m),c=new Uint8Array(b.length+m);c.set(b,0),c.set(f,b.length),t.file(h,c)}l+=b.length});let g=await t.generateAsync({type:"blob",compression:"STORE"});return new Uint8Array(await g.arrayBuffer())}};function qe(e,a){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=1024/Math.max(e.width,e.height),r=document.createElement("canvas");r.width=e.width*Math.min(1,t),r.height=e.height*Math.min(1,t);let n=r.getContext("2d");if(n.imageSmoothingEnabled=!1,n.drawImage(e,0,0,r.width,r.height),a!==void 0){let i=parseInt(a,16),s=(i>>16&255)/255,l=(i>>8&255)/255,g=(i&255)/255,h=n.getImageData(0,0,r.width,r.height),d=h.data;for(let u=0;u{var v=THREE,re=Vue,ne=window.JSZip;var B="_NONE_",g={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new v.Color(16777215),regex:new RegExp("(s|_)*(basecolor|color|albedo)","i")},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new v.Color(0),regex:new RegExp("[ _]*metal(lic|ness)?","i")},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new v.Color(0),regex:new RegExp("[ _]*(emissive|emission)","i")},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new v.Color(16777215),regex:new RegExp("[ _]*rough(ness)?","i")},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new v.Color(16777215),regex:new RegExp("[ _]*(height|bump)","i")},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new v.Color("rgb(128, 128, 255)"),regex:new RegExp("[ _]*normal","i")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new v.Color(16777215),regex:new RegExp("[ _]*(ao|ambientocclusion|ambient occlusion)","i")}},o={},y=[],C=[];var se=[...Object.keys(g).map(e=>g[e].id),B];y.push(()=>{o.channelProp=new Property(TextureLayer,"enum","channel",{default:B,values:se,label:"PBR Channel",exposed:!1}),o.textureChannelProp=new Property(Texture,"enum","channel",{default:B,values:se,label:"PBR Channel",exposed:!1}),o.materialTextureProp=new Property(Texture,"boolean","material",{default:!1,label:"Material Texture"}),o.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),o.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),o.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!1,values:[],label:"PBR Mode"})});function k(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(e=>e.selected)??null:Texture.all.find(e=>e.selected)??Texture.getDefault()}function A(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(e=>e.selected)??Project.selected_texture.layers[0]:k()?.getActiveLayer()??null}function $(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(k()?.name??"texture")}function oe(e,a){let t;return function(...r){let n=()=>{t=void 0,e.apply(this,r)};clearTimeout(t),t=setTimeout(n,a)}}function U(e){let a=MediaPreview.renderer??new v.WebGLRenderer({alpha:!0,antialias:!0}),t=new v.Scene,r=new v.PerspectiveCamera(75,96/96,.1,1e3),n=new v.AmbientLight(16777215,.75);t.add(n);let i=new v.PointLight(16777215,1,100);i.position.set(5,5,5),t.add(i);let s=new v.SphereGeometry(1,32,32),l=e instanceof v.MeshStandardMaterial&&e.isMeshStandardMaterial?e:new v.MeshStandardMaterial({color:e.albedo,metalness:e.metalness??0,roughness:e.roughness??1,emissive:e.emissive,bumpScale:e.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),m=new v.Mesh(s,l);t.add(m),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(t,r);let h=a.domElement.toDataURL();return l.dispose(),MediaPreview.renderer||(a.clear(),a.dispose()),h}function Z(e,a){let t=a??document.createElement("canvas"),r=t.getContext("2d");if(!r)return t.remove(),null;let n=Math.max(Project?Project.texture_width:16,16),i=Math.max(Project?Project.texture_height:16,16);t.width=n,t.height=i,r.fillStyle=`rgb(${e.r*255}, ${e.g*255}, ${e.b*255})`,r.fillRect(0,0,n,i);let s=t.toDataURL();return a||t.remove(),s}var Ge=(e=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return e?a.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):a},j=class e{constructor(a,t){this._scope=a??Ge(),this._materialUuid=t}merToCanvas(){let a=this.getTexture(g.emissive),t=this.getTexture(g.roughness),r=this.getTexture(g.metalness);if(!a&&!t&&!r){let{metalness:n,emissive:i,roughness:s}=this.decodeMer();n&&(r=e.makePixelatedCanvas(n)),i&&(a=e.makePixelatedCanvas(i)),s&&(t=e.makePixelatedCanvas(s))}return{emissiveMap:a,roughnessMap:t,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(g.emissive),roughnessMap:this.getTexture(g.roughness),metalnessMap:this.getTexture(g.metalness)},i=this.getTexture(g.normal);return new v.MeshStandardMaterial({map:this.getTexture(g.albedo)??e.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(s=>s.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(g.ao),bumpMap:this.getTexture(g.height),normalMap:i,normalScale:new v.Vector2(-1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}renderMaterialPreview(){return U(this.getMaterial())}saveTexture(a,t){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=t.uuid,t.extend({channel:a.id}))}findTexture(a,t=!0){if(!Project)return null;let r=this._scope.find(m=>m.channel&&(m.channel===a||m.channel===a.id));if(r)return r;let[n,i]=typeof a=="string"?[a,new RegExp(`_*${a}(.[^.]+)?$`,"i")]:[a.id,a.regex??new RegExp(`_*${a.id}(.[^.]+)?$`,"i")];Project.pbr_materials=Project.pbr_materials??{};let s=Project.pbr_materials[this._materialUuid];if(t&&!s?.length&&n!==B)return this._scope.find(m=>i.test(m.name))??null;let l=s?.[n];return l?this._scope.find(m=>m.uuid===l)??null:null}static makePixelatedCanvas(a){let t=new v.CanvasTexture(a,void 0,void 0,void 0,v.NearestFilter,v.NearestFilter);return t.needsUpdate=!0,t}getTexture(a){let t=this.findTexture(a);return t?e.makePixelatedCanvas(t.canvas):null}static extractChannel(a,t){let r=a.canvas,{width:n,height:i}=r,s=r.getContext("2d");if(!s||!n||!i)return null;let l=document.createElement("canvas");l.width=n,l.height=i;let m=l.getContext("2d");if(!m)return null;let h={r:0,g:1,b:2,a:3}[t],{data:d}=s.getImageData(0,0,n,i),u=new Uint8ClampedArray(n*i*4);for(let p=0;pa){f[c]=b.data[c],f[c+1]=b.data[c+1],f[c+2]=b.data[c+2],f[c+3]=255;continue}f[c]=0,f[c+1]=0,f[c+2]=0,f[c+3]=255}return h.putImageData(new ImageData(f,l.width,l.height),0,0),{metalness:r,emissive:l,emissiveLevel:n,roughness:i,sss:s}}createMer(a=!1){let t=this.findTexture(g.metalness,a),r=this.findTexture(g.emissive,a),n=this.findTexture(g.roughness,a),i=this.findTexture("sss",!1),s=Math.max(t?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),l=Math.max(t?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),m=document.createElement("canvas");m.width=s,m.height=l;let h=m.getContext("2d");if(!h)return null;let d=t?.img?e.extractChannel(t,"r"):null,u=r?.img?e.extractChannel(r,"g"):null,b=n?.img?e.extractChannel(n,"b"):null,p=i&&i?.img?e.extractChannel(i,"a"):null,f=d?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),c=u?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),x=b?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),_=p?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(new Uint8ClampedArray(s*l*4).fill(255),s,l),M=new Uint8ClampedArray(s*l*4);for(let w=0;w{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createTexturesFromNormal(a){let t=this.decodeLabPbrNormal(a);return Object.entries(t).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}};var O=class{constructor({lightHeight:a=.66,ambientLight:t=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:n=[1,1,1]}={}){this.lightHeight=a,this.ambientLight=t,this.minLightIntensity=r,this.lightDiffuse=n}bake(a,t,r){let n=t instanceof HTMLCanvasElement?t:this.createCanvas(t.width,t.height),i=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),s=n.getContext("2d"),l=i.getContext("2d");s.drawImage(t,0,0),l.drawImage(r,0,0);let m=s.getImageData(0,0,t.width,t.height),h=l.getImageData(0,0,r.width,r.height),d=[],u=[];for(let p=0;p{let f=this.createCanvas(t.width,t.height),c=f.getContext("2d"),x=c.getImageData(0,0,f.width,f.height),_=[Math.cos(p),Math.sin(p),this.lightHeight];for(let M=0;M{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new j(r.layers_enabled?r.layers:Project.textures,r.uuid),i=n.findTexture(g.albedo);if(!i){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let s=n.findTexture(g.normal);if(!s){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let m=new O(e).bake(a,i.canvas,s.canvas),h=new Texture({name:`${i.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(m[0].toDataURL()),d=t?u=>{let b=n.findTexture(g.emissive);if(!b)return u;let p=b.canvas;if(!p.getContext("2d"))return u;let c=Math.max(u.width,p.width,Project?Project.texture_width:16),x=Math.max(u.height,p.height,Project?Project.texture_height:16),_=document.createElement("canvas");_.width=c,_.height=x;let M=_.getContext("2d");return M?(M.drawImage(u,0,0),M.globalCompositeOperation="screen",M.drawImage(p,0,0),_):u}:u=>u;m.forEach((u,b)=>{new TextureLayer({name:`baked_${b+1}`,data_url:d(u).toDataURL()},h).addForEditing()}),h.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};y.push(()=>{o.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(e){let a=new v.Color(e.ambientLight.toString()),t=new v.Color(e.lightDiffuse.toString());ie({ambientLight:[a.r,a.g,a.b],lightDiffuse:[t.r,t.g,t.b],lightHeight:Number(e.lightHeight),minLightIntensity:Number(e.minLightIntensity)},e.directions??8,e.blendEmissive??!1)}}),o.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){o.bakeTexturesDialog?.show()}}),MenuBar.addAction(o.bakeTexturesAction,"tools")});C.push(()=>{MenuBar.removeAction("tools.bake_textures")});function le(e,a){let t=e.getTexture();if(!t||!Project)return null;let r=Project.materials[t.uuid];r.isShaderMaterial&&!Project.bb_materials[t.uuid]?Project.bb_materials[t.uuid]=r:r.isMeshStandardMaterial&&r.dispose();let n=new j(t.layers_enabled?t.layers.filter(i=>i.visible)??null:Project.textures,t.uuid).getMaterial({side:Canvas.getRenderSide(t),...a});return Project.materials[t.uuid]=v.ShaderMaterial.prototype.copy.call(n,r),t}function ce(e){return Object.values(e).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function Ve(e,a){let t={};return e.forAllFaces(r=>{let n=le(r,a);n&&(t[n.uuid]=n)}),ce(t)}function Qe(e,a){let t={};return Object.keys(e.faces).forEach(r=>{let n=e.faces[r],i=le(n,a);i&&(t[i.uuid]=i)}),ce(t)}var R=(e={})=>{Project&&(Project.pbr_active=Texture.all.length>0&&Project.elements.map(a=>a instanceof Mesh&&Ve(a,e)||a instanceof Cube&&Qe(a,e)).filter(Boolean).length>0)},N=(e=100)=>oe(R,e);var q={},W=()=>Condition({modes:["edit","paint"],selected:{texture:!0},project:!0,method(){let e=k();return e&&!e.material?!0:e?.material===!0&&A()!==null&&Modes.paint}}),ue=()=>Condition({modes:["paint","edit"],selected:{texture:!0},method(){let e=k();if(e?.material&&Modes.edit)return!1;let a=A()??e;return a?.channel&&a.channel!==B}});y.push(()=>{Object.entries(g).forEach(([e,a])=>{q[e]=new Action(`assign_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:W,click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t)return;Undo.initEdit({layers:[t]}),t.extend({channel:a.id});let r=t instanceof TextureLayer?t.texture:t;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([n,i])=>{i===t.uuid&&(delete Project.pbr_materials[r.uuid][n],t.channel=B)}),r.uuid===t.uuid&&(Project.pbr_materials[r.uuid]={}),Project.pbr_materials[r.uuid][e]=t.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${t.name}" to ${a.label} channel`,2e3),R()}})})});C.push(()=>{Object.values(q).forEach(e=>{e.delete()})});y.push(()=>{o.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:ue,click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e)return;Undo.initEdit({layers:[e]});let a=e instanceof TextureLayer?e.texture:e,t=e.channel;Project.pbr_materials[a.uuid]={},e.channel=B,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${e.name}" from ${t} channel`,2e3),N()}}),o.channelMenu=new Menu("channel_menu",[...Object.keys(g).map(e=>`assign_channel_${e}`),"unassign_channel"],{onOpen(){N()}}),o.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",condition:()=>W()||ue(),click(e){o.channelMenu?.open(e)},children:[...Object.values(q),o.unassignChannel]}),o.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:W,click(e){o.channelMenu?.open(e)}}),o.openChannelMenu&&(MenuBar.addAction(o.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(o.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(o.openChannelMenu,"0")),Toolbars.layers.add(o.showChannelMenu,1)});C.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(o.showChannelMenu)});function X(e,a=!1){let t=e.canvas.getContext("2d");if(!t)return null;let r=Math.max(e.img.width??e.canvas.width,Project?Project.texture_width:0,16),n=Math.max(e.img.height??e.canvas.height,Project?Project.texture_height:0,16),{data:i}=t.getImageData(0,0,r,n),s=document.createElement("canvas"),l=s.getContext("2d");if(!l)return null;let m=(c,x)=>{let _=(c+x*r)*4;return i[_]/255};s.width=r,s.height=n,l.drawImage(e.img,0,0,r,n);let h=l.getImageData(0,0,r,n),d=h.data,u=c=>{let x=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);return[c[0]/x,c[1]/x,c[2]/x]};for(let c=0;c{let c=(p+f*t)*4;return n[c]/255};i.width=t,i.height=r,s.drawImage(e.img,0,0,t,r);let m=s.getImageData(0,0,t,r),h=m.data;for(let p=0;p{o.generateNormal=new Action("generate_normal",{icon:g.normal.icon??"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(A()??k())!==null,click(e){let a=A()??k()??Texture.getDefault();if(!a)return;let t=X(a);if(!t){Blockbench.showQuickMessage("Failed to generate normal map",2e3);return}t.select(e),new j(a instanceof Texture&&a.layers_enabled?a.layers:null,a.uuid).saveTexture(g.normal,t),Blockbench.showQuickMessage("Normal map generated",2e3)}}),o.generateAo=new Action("generate_ao",{icon:g.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let e=A()??k()??Texture.getDefault();if(!e)return;let a=new j(e instanceof Texture&&e.layers_enabled?e.layers:null,e.uuid),t=a.findTexture(g.normal)??X(e);if(!t){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=me(t);if(r){a.saveTexture(g.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),MenuBar.addAction(o.generateNormal,"tools"),MenuBar.addAction(o.generateAo,"tools")});C.push(()=>{MenuBar.removeAction("tools.generate_normal")});var Je=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},Ze=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};y.push(()=>{o.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let e=k();if(!e)return;let t=new j(e.layers_enabled?e.layers:[e],e.uuid).createLabPbrOutput();if(t===null)return;let r=e.name??(Project?Project.getDisplayName():"texture");await Promise.all([Je(t.normalMap,pathToName(r)),Ze(t.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),o.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let e=TextureLayer.selected?.texture??Texture.all.find(t=>t.selected)??Texture.getDefault(),a=new j(e.layers_enabled?e.layers:[e],e.uuid);if(pathToName(e.name).endsWith("_n")){a.createTexturesFromNormal(e);return}if(pathToName(e.name).endsWith("_s")){a.createTexturesFromSpecular(e);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(o.generateLabPbr,"file.export"),MenuBar.addAction(o.decodeLabPbr,"tools")});C.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});y.push(()=>{o.createMaterialTexture=new Action("create_material_texture",{icon:"deployed_code",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let e={...g},a=new Texture({name:"New Material",saved:!1,particle:!1});a.extend({material:!0});let t=Texture.all.filter(s=>(s.selected||s.multi_selected)&&!s.material)??Texture.all,r=k(),n=r?new j(t,r.uuid):null;try{let s=n?.findTexture(g.albedo,!0)?.canvas.toDataURL()??r?.canvas.toDataURL()??Z(new v.Color(8421504),a.canvas);if(!s)return;a.fromDataURL(s);let l=new TextureLayer({name:e.albedo.label,visible:!0,data_url:s,keep_size:!0},a);l.extend({channel:e.albedo.id}),l.addForEditing(),l.texture.updateChangesAfterEdit(),n?.saveTexture(e.albedo,l),delete e.albedo}catch(s){console.warn("Failed to create base color texture",s),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let i=Object.keys(e).reverse().map(s=>{let l=g[s],m=n?.findTexture(l,!0),h=m?m.canvas.toDataURL():Z(l.default??new v.Color(0));if(!h)return;let d=new TextureLayer({name:l.label,visible:!0,data_url:h,keep_size:!0},a);return d.extend({channel:l.id}),n?.saveTexture(l,d),d}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:i}),a.add().select(),a.activateLayers(),i.map(s=>{s.addForEditing(),a.width=Math.max(a.width,s.img.width),a.height=Math.max(a.height,s.img.height)}),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(o.createMaterialTexture,"tools"),Toolbars.texturelist.add(o.createMaterialTexture,3)});C.push(()=>{MenuBar.removeAction("tools.create_material_texture"),Toolbars.texturelist.remove("create_material_texture")});var F=(e,a)=>{let t=k()??Texture.getDefault(),r=new j(t.layers_enabled?t.layers:Project?Project.textures:null,t.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[i,s]=Project?[e?`${e}_mer`:`${t.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:i,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},a)})};y.push(()=>{o.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{F()}catch(e){console.error("Failed to export MER map:",e),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),o.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let e=k()??Texture.getDefault(),a=new j([e],e.uuid),t=a.decodeMer(),r=[g.metalness,g.emissive,g.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new Texture({name:`${e?.name}_${i}`,keep_size:!1}).fromDataURL(s.toDataURL());l.add(!0),a.saveTexture(n,l)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>k()?.layers_enabled===!0,click(){let e=k()??Texture.getDefault(),a=new j(e.layers_enabled?e.layers:[e],e.uuid),t=a.decodeMer(),r=[g.metalness,g.emissive,g.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new TextureLayer({name:`${e?.name}_${i}`,data_url:s.toDataURL()},e);a.saveTexture(n,l),l.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(o.decodeMer,"tools"),MenuBar.addAction(o.generateMer,"file.export")});C.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var We=()=>{Project&&Project.textures.forEach(e=>{let a=new j(null,e.uuid),t=a.findTexture(g.normal,!1),r=a.findTexture(g.height,!1),n=a.findTexture(g.albedo,!1),i=a.findTexture(g.metalness,!1)?.name,s=a.findTexture(g.emissive,!1)?.name,l=a.findTexture(g.roughness,!1)?.name,m={};return n||(m.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!i&&!s&&!l&&(m.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},m.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},m.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),t&&(m.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(m.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),t&&r&&(m.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),o.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:m,cancelIndex:1,onConfirm(h){let d=$(),u=i||s||l,b={format_version:"1.16.100","minecraft:texture_set":{color:(n?d:h.baseColor?.toHexString())??d,metalness_emissive_roughness:[h.metalness??0,h.emissive??0,h.roughness??255]}};h.depthMap==="normal"&&t||!r&&t?b["minecraft:texture_set"].normal=`${d}_normal`:(!t||h.depthMap==="heightmap")&&r&&(b["minecraft:texture_set"].heightmap=`${d}_heightmap`);let p=x=>{if(!h.depthMap)return x();let _=h.depthMap==="normal"||h.depthMap&&!r,M=_?t:r;if(!M)return x();Blockbench.export({content:M.canvas.toDataURL()??"",type:"PNG",name:`${d}_${_?"normal":"heightmap"}`,extensions:["png"],resource_id:h.depthMap,startpath:Project.export_path,savetype:"image"},w=>{b["minecraft:texture_set"][_?"normal":"heightmap"]=pathToName(w,!1),x()})},f=x=>{if(!n)return x();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:d,startpath:Project.export_path,savetype:"image"},_=>{b["minecraft:texture_set"].color=pathToName(_,!1),x()})},c=()=>p(()=>{f(()=>{Blockbench.export({content:JSON.stringify(b,null,2),type:"JSON",name:`${d}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),o.textureSetDialog?.hide()})})});if(u){try{F(d,x=>{b["minecraft:texture_set"].metalness_emissive_roughness=pathToName(x,!1),c()})}catch(x){console.warn("Failed to export MER map:",x),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}c()}}),o.textureSetDialog.show()})};y.push(()=>{o.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){We()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(o.createTextureSet,"file.export")});C.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});y.push(()=>{o.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(e){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=e}),Preview.selected.renderer.physicallyCorrectLights=e,Blockbench.showQuickMessage(`Physically corrected lighting is now ${e?"enabled":"disabled"}`,2e3),e&&o.togglePbr?.set(!0),R()},click(){}}),MenuBar.addAction(o.toggleCorrectLights,"preview")});C.push(()=>{MenuBar.removeAction("preview.correct_lights")});var z=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(e=>{e instanceof Cube&&Object.keys(e.faces).forEach(a=>{let r=e.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var de=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],he=()=>Project&&Project.pbr_active&&R(),qe=()=>{Blockbench.on(de.join(" "),he)},pe=()=>{de.forEach(e=>{Blockbench.removeListener(e,he)})};y.push(()=>{o.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(e){if(e){R(),qe(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}z(),pe(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(o.togglePbr,"view")});C.push(()=>{pe(),MenuBar.removeAction("view.toggle_pbr")});var ge=e=>{let a=Math.max(-2,Math.min(2,e));Preview.all.forEach(t=>{t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};y.push(()=>{o.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(o.tonemappingSelect?.get())===v.NoToneMapping&&o.tonemappingSelect.change(v.LinearToneMapping.toString()),o.togglePbr?.set(!0)},onChange(e){ge(Number(e))},onAfter(){N()}}),o.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>o.exposureSlider!==void 0&&Number(o.exposureSlider?.get())!==1,click(){ge(1),o.exposureSlider?.setValue(1,!0),N()}}),o.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:v.NoToneMapping,value:Preview.selected.renderer.toneMapping??v.NoToneMapping,icon:"monochrome_photos",options:{[v.NoToneMapping]:"No Tone Mapping",[v.LinearToneMapping]:"Linear",[v.ReinhardToneMapping]:"Reinhard",[v.CineonToneMapping]:"Cineon",[v.NeutralToneMapping]:"Neutral",[v.ACESFilmicToneMapping]:"ACES"},onChange({value:e}){Preview.selected.renderer.toneMapping=Number(e);let a=1;Preview.selected.renderer.toneMapping===v.NoToneMapping?o.exposureSlider?.setValue(a,!0):a=Number(o.exposureSlider?.get()??1),Preview.all.forEach(t=>{t.renderer.toneMapping=Number(e),t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(e)}`,2e3),o.togglePbr&&!o.togglePbr.value&&o.togglePbr.set(!0),R()}})});var K=class{async parse(a){let t=new ne,r="model.usda";t.file(r,"");let n=ve(),i={},s={};a.traverseVisible(h=>{if(!h.isMesh)return;let d=h;if(!d.material.isMeshStandardMaterial){console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",h);return}let u=d.geometry,b=d.material,p="geometries/Geometry_"+u.id+".usd";if(!t.file(p)){let f=tt(u);t.file(p,Ke(f))}b.uuid in i||(i[b.uuid]=b),n+=Ye(d,u,b)}),n+=ot(i,s),t.file(r,n),n=null;for(let h in s){let d=s[h],u=h.split("_")[1],b=d.format===v.RGBAFormat,p=Xe(d.image,u),c=await(await new Promise(x=>p.toBlob(_=>_&&x(_),b?"image/png":"image/jpeg",1))).arrayBuffer();t.file(`textures/Texture_${h}.${b?"png":"jpg"}`,c)}let l=0;t.forEach(async h=>{let d=34+h.length;l+=d;let u=l&63,b=await t.file(h).async("uint8array");if(u!==4){let p=64-u,f=new Uint8Array(p),c=new Uint8Array(b.length+p);c.set(b,0),c.set(f,b.length),t.file(h,c)}l+=b.length});let m=await t.generateAsync({type:"blob",compression:"STORE"});return new Uint8Array(await m.arrayBuffer())}};function Xe(e,a){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=1024/Math.max(e.width,e.height),r=document.createElement("canvas");r.width=e.width*Math.min(1,t),r.height=e.height*Math.min(1,t);let n=r.getContext("2d");if(n.imageSmoothingEnabled=!1,n.drawImage(e,0,0,r.width,r.height),a!==void 0){let i=parseInt(a,16),s=(i>>16&255)/255,l=(i>>8&255)/255,m=(i&255)/255,h=n.getImageData(0,0,r.width,r.height),d=h.data;for(let u=0;u ) { @@ -17,32 +17,32 @@ rel material:binding = } -`}function Ke(e){let a=e.elements;return`( ${G(a,0)}, ${G(a,4)}, ${G(a,8)}, ${G(a,12)} )`}function G(e,a){return`(${e[a+0]}, ${e[a+1]}, ${e[a+2]}, ${e[a+3]})`}function et(e){return` +`}function et(e){let a=e.elements;return`( ${G(a,0)}, ${G(a,4)}, ${G(a,8)}, ${G(a,12)} )`}function G(e,a){return`(${e[a+0]}, ${e[a+1]}, ${e[a+2]}, ${e[a+3]})`}function tt(e){return` def "Geometry" { - ${tt(e)} + ${at(e)} } -`}function tt(e){let a="Geometry",t=e.attributes,r=t.position.count;return` +`}function at(e){let a="Geometry",t=e.attributes,r=t.position.count;return` def Mesh "${a}" { - int[] faceVertexCounts = [${at(e)}] - int[] faceVertexIndices = [${rt(e)}] + int[] faceVertexCounts = [${rt(e)}] + int[] faceVertexIndices = [${nt(e)}] normal3f[] normals = [${fe(t.normal,r)}] ( interpolation = "vertex" ) point3f[] points = [${fe(t.position,r)}] - float2[] primvars:st = [${nt(t.uv,r)}] ( + float2[] primvars:st = [${st(t.uv,r)}] ( interpolation = "vertex" ) uniform token subdivisionScheme = "none" } -`}function at(e){let a=e.index!==null?e.index.count:e.attributes.position.count;return Array(a/3).fill(3).join(", ")}function rt(e){let a=e.index,t=[];if(a!==null)for(let r=0;r + float2 inputs:st.connect = token inputs:wrapS = "repeat" token inputs:wrapT = "repeat" float outputs:r @@ -93,8 +93,8 @@ ${n.join(` `)} } -`}function xe(e){return`(${e.r}, ${e.g}, ${e.b})`}function be(e){return`(${e.x}, ${e.y})`}var _e=Y;y.push(()=>{let e=new Codec("usdz",{extension:"usdz",name:"USDZ",remember:!0,export_options:{},fileName(){return I()+".usdz"},async compile(a={}){if(!Project)throw new Error("No project loaded");R();let t=Object.assign(this.getExportOptions(),a),r=new _e,n=new v.Scene;n.name="blockbench_export",n.add(Project.model_3d);let i=await r.parse(n);return this.dispatchEvent("compile",{model:i,options:t}),Canvas.scene.add(Project.model_3d),i},async export(){let a=await this.compile();Blockbench.export({content:a,name:this.fileName(),startpath:this.startPath(),resource_id:"usdz",type:this.name,extensions:["usdz"],savetype:"buffer"},t=>this.afterDownload(t))}});o.exportUsdz=new Action("export_usdz",{category:"file",name:"Export USDZ",description:"Exports the current model as a USDZ file",icon:"stacks",async click(){e&&await e.export()}}),o.usdz=e,MenuBar.addAction(o.exportUsdz,"file.export")});C.push(()=>{MenuBar.removeAction("file.export_usdz")});var V=class e{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(p).map(t=>[t,p[t].default??new v.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([t,r])=>[t,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let t=Math.min(1,Math.max(0,a));return new v.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let a="#000000",t=Number(o.brushMetalnessSlider?.get()),r=Number(o.brushRoughnessSlider?.get()??1),n=(o.brushEmissiveColor?.get()??a).toString(),i=Number(o.brushHeightSlider?.get()),s=ColorPanel.get(),l={[p.albedo.id]:new v.Color(s),[p.metalness.id]:e.makeLinearColor(t),[p.roughness.id]:e.makeLinearColor(r),[p.emissive.id]:new v.Color(n??a),[p.height.id]:e.makeLinearColor(i),[p.normal.id]:p.normal.default??new v.Color("#8080ff")};return new e({colors:l})}};var Me="materialBrushPresets",K=()=>JSON.parse(localStorage.getItem(Me)||"{}"),it=(e,a)=>{let t=K(),r=a??guid(),n=o.userMaterialBrushPresets?.getFormResult()??{},i={};return n.albedo&&(i.albedo=n.albedo.toString()),n.metalness&&(i.metalness=Number(n.metalness)),n.roughness&&(i.roughness=Number(n.roughness)),n.emissive&&(i.emissive=n.emissive.toString()),n.height&&(i.height=Number(n.height)),t[r]=[i,e??"New Preset",U(i)],localStorage.setItem(Me,JSON.stringify(t)),r},ye=({metalness:e,roughness:a,emissive:t,height:r,albedo:n})=>{e!==void 0&&o.brushMetalnessSlider?.setValue(e||0,!0),a!==void 0&&o.brushRoughnessSlider?.setValue(a??1,!0),t!==void 0&&o.brushEmissiveColor?.set(t??"#000000"),r!==void 0&&o.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},Q=({id:e})=>Condition({project:!0,tools:["material_brush"],method(){let a=k();return(a?.layers_enabled&&a.layers.find(({channel:t})=>t&&t===e)!==void 0)===!0}}),lt=re.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:p}},methods:{applyPreset(e){try{let[a,t]=this.userPresets[e],{metalness:r,roughness:n,emissive:i,height:s,albedo:l}=a;ye({metalness:Number(r),roughness:Number(n),emissive:i.toString(),height:Number(s),albedo:l.toString()}),o.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${t}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(e){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let t=K(),r=this.userPresets[e][1]??e;delete t[e],localStorage.setItem("materialBrushPresets",JSON.stringify(t)),this.userPresets=t,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(e){o.userMaterialBrushPresets?.setFormValues({name:this.userPresets[e][1]??e,...this.userPresets[e][0]})},getSummary(e){return Object.entries(e).filter(([a])=>a in this.channels).map(([a,t])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${t}`:`${this.channels[a]?.label??a}: ${Number(t).toFixed(1)}`).join(` -`)}},computed:{presets(){return Object.entries(this.userPresets)}},mounted(){this.userPresets=K()},template:` +`}function xe(e){return`(${e.r}, ${e.g}, ${e.b})`}function be(e){return`(${e.x}, ${e.y})`}var _e=K;y.push(()=>{let e=new Codec("usdz",{extension:"usdz",name:"USDZ",remember:!0,export_options:{},fileName(){return $()+".usdz"},async compile(a={}){if(!Project)throw new Error("No project loaded");R();let t=Object.assign(this.getExportOptions(),a),r=new _e,n=new v.Scene;n.name="blockbench_export",n.add(Project.model_3d);let i=await r.parse(n);return this.dispatchEvent("compile",{model:i,options:t}),Canvas.scene.add(Project.model_3d),i},async export(){let a=await this.compile();Blockbench.export({content:a,name:this.fileName(),startpath:this.startPath(),resource_id:"usdz",type:this.name,extensions:["usdz"],savetype:"buffer"},t=>this.afterDownload(t))}});o.exportUsdz=new Action("export_usdz",{category:"file",name:"Export USDZ",description:"Exports the current model as a USDZ file",icon:"stacks",async click(){e&&await e.export()}}),o.usdz=e,MenuBar.addAction(o.exportUsdz,"file.export")});C.push(()=>{MenuBar.removeAction("file.export_usdz")});var Me="1.0.0";y.push(()=>{o.bbmat=new Codec("material",{name:"Blockbench Material",extension:"bbmat",remember:!1,load_filter:{extensions:["bbmat"],type:"json"},compile(e){if(!Texture.selected?.material||!Texture.selected?.layers_enabled)return;let a=Texture.selected.layers.map(r=>{let n=r.channel,i=r.canvas.toDataURL();return[n,i]}),t=new j(Texture.selected.layers,Texture.selected.uuid);return a.push(["preview",t.renderMaterialPreview()]),JSON.stringify({version:Me,channels:Object.fromEntries(a)})},parse(e,a){return e=typeof e=="string"?JSON.parse(e):e,e.version!==Me?{}:e.channels},load(e,a,t){if(!Project)return;let r=this.parse(e,a.path),n=Object.keys(r);if(!n.length)throw new Error("No valid channels found in the material");let i=r[g.albedo.id]??r[n[0]];n.includes("preview")&&(i=r.preview);let s=new Texture({name:pathToName(a.name),saved:!0,particle:!1,source:i,layers_enabled:!0});s.extend({material:!0});let l=n.map(m=>{if(!(m in g))return null;let h=r[m],d=new TextureLayer({name:m,data_url:h,visible:!0},s);return d.extend({channel:m}),d}).filter(Boolean);if(!l.length)throw new Error("No valid channel layers found in the material");i||s.fromDataURL(l[0].canvas.toDataURL()),s.add().select(),l.forEach(m=>{m.addForEditing(),s.width=Math.max(s.width,m.img.width),s.height=Math.max(s.height,m.img.height)}),s.updateChangesAfterEdit()},export(){Blockbench.export({resource_id:"material",type:this.name,extensions:[this.extension],name:`${Texture.selected?.name??this.fileName??"material"}.bbmat`,startpath:this.startPath(),content:this.compile()},e=>this.afterDownload(e))}}),o.bbMatExport=new Action("export_bbmat",{icon:"stacks",name:"Save as .bbmat",category:"file",condition:{project:!0,selected:{texture:!0},method(){return Texture.selected?.material}},click(){!o.bbmat?.write||!o.bbmat?.compile||o.bbmat.export&&o.bbmat.export()}}),o.bbMatImport=new Action("import_bbmat",{icon:"stacks",name:"Import .bbmat",category:"file",condition:{project:!0},click(){Blockbench.import({extensions:["bbmat"],type:"json",title:"Import .bbmat",multiple:!0},e=>{o.bbmat?.load&&e.forEach(a=>{o.bbmat.load(a.content,a,!0)})})}}),o.bbmat.export_action=o.bbMatExport,Texture.prototype.menu.addAction(o.bbMatExport),MenuBar.addAction(o.bbMatImport,"file.import")});C.push(()=>{Texture.prototype.menu.removeAction("export_bbmat"),MenuBar.removeAction("file.import.import_bbmat")});var V=class e{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(g).map(t=>[t,g[t].default??new v.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([t,r])=>[t,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let t=Math.min(1,Math.max(0,a));return new v.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let a="#000000",t=Number(o.brushMetalnessSlider?.get()),r=Number(o.brushRoughnessSlider?.get()??1),n=(o.brushEmissiveColor?.get()??a).toString(),i=Number(o.brushHeightSlider?.get()),s=ColorPanel.get(),l={[g.albedo.id]:new v.Color(s),[g.metalness.id]:e.makeLinearColor(t),[g.roughness.id]:e.makeLinearColor(r),[g.emissive.id]:new v.Color(n??a),[g.height.id]:e.makeLinearColor(i),[g.normal.id]:g.normal.default??new v.Color("#8080ff")};return new e({colors:l})}};var ye="materialBrushPresets",Y=()=>JSON.parse(localStorage.getItem(ye)||"{}"),lt=(e,a)=>{let t=Y(),r=a??guid(),n=o.userMaterialBrushPresets?.getFormResult()??{},i={};return n.albedo&&(i.albedo=n.albedo.toString()),n.metalness&&(i.metalness=Number(n.metalness)),n.roughness&&(i.roughness=Number(n.roughness)),n.emissive&&(i.emissive=n.emissive.toString()),n.height&&(i.height=Number(n.height)),t[r]=[i,e??"New Preset",U(i)],localStorage.setItem(ye,JSON.stringify(t)),r},we=({metalness:e,roughness:a,emissive:t,height:r,albedo:n})=>{e!==void 0&&o.brushMetalnessSlider?.setValue(e||0,!0),a!==void 0&&o.brushRoughnessSlider?.setValue(a??1,!0),t!==void 0&&o.brushEmissiveColor?.set(t??"#000000"),r!==void 0&&o.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},Q=({id:e})=>Condition({project:!0,tools:["material_brush"],method(){let a=k();return(a?.layers_enabled&&a.layers.find(({channel:t})=>t&&t===e)!==void 0)===!0}}),ct=re.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:g}},methods:{applyPreset(e){try{let[a,t]=this.userPresets[e],{metalness:r,roughness:n,emissive:i,height:s,albedo:l}=a;we({metalness:Number(r),roughness:Number(n),emissive:i.toString(),height:Number(s),albedo:l.toString()}),o.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${t}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(e){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let t=Y(),r=this.userPresets[e][1]??e;delete t[e],localStorage.setItem("materialBrushPresets",JSON.stringify(t)),this.userPresets=t,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(e){o.userMaterialBrushPresets?.setFormValues({name:this.userPresets[e][1]??e,...this.userPresets[e][0]})},getSummary(e){return Object.entries(e).filter(([a])=>a in this.channels).map(([a,t])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${t}`:`${this.channels[a]?.label??a}: ${Number(t).toFixed(1)}`).join(` +`)}},computed:{presets(){return Object.entries(this.userPresets)}},mounted(){this.userPresets=Y()},template:`
      • Q(p.metalness)}),o.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",tool_setting:"brush_roughness",settings:{min:0,max:1,step:.01,default:1},condition:()=>Q(p.roughness)}),o.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",tool_setting:"brush_emissive",condition:()=>Q(p.emissive)}),o.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",tool_setting:"brush_height",settings:{min:0,max:1,step:.01,default:.5},condition:()=>Q(p.height)}),o.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",category:"tools",toolbar:"brush",condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){return k()?.layers_enabled??!1}},allowed_view_modes:"textured",tool_settings:{brush_metalness:0,brush_roughness:1,brush_emissive:"#000000",brush_height:.5},brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(e,a,t,r,{size:n,softness:i,texture:s,x:l,y:g}){let h=V.fromSettings(),d=Object.keys(h.colors),u=Math.floor(n-i*n/100),b=t;return s.layers.forEach(m=>{if(!m.visible||!d.includes(m.channel))return;let f=h.getChannel(m.channel);if(!f)return;let c=Math.sqrt((l-e)**2+(g-a)**2),x=Math.min(1,c/u);if(l%u<=x&&g%u<=x){let _=m.ctx.getImageData(e,a,1,1).data,M=new v.Color(`rgb(${_[0]}, ${_[1]}, ${_[2]})`);f.lerp(M,1)}m.ctx.fillStyle=f.getStyle(),m.ctx.fillRect(e,a,1,1),m.selected&&(b={r:f.r*255,g:f.g*255,b:f.b*255,a:r*255})}),b}},onCanvasClick(e){Painter.startPaintToolCanvas(e,e.event)},onSelect(){Painter.updateNslideValues(),R()},click(){N()}}),o.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:{project:!0},click(){o.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:lt,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(e){ye({metalness:Number(e.metalness??o.brushMetalnessSlider?.get()),roughness:Number(e.roughness??o.brushRoughnessSlider?.get()),emissive:(e.emissive??o.brushEmissiveColor?.get()).toString(),height:Number(e.height??o.brushHeightSlider?.get()),albedo:(e.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(e,a){o.materialBrushTool?.select(),e===1&&Blockbench.textPrompt("Save Preset","New Preset",t=>{t&&(it(t),Blockbench.showQuickMessage(`Preset "${t}" saved`,2e3))})}}).show()}}),MenuBar.addAction(o.materialBrushTool,"tools.0")});C.push(()=>{MenuBar.removeAction("tools.material_brush")});y.push(()=>{o.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","load_brush_preset","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Settings"})],condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});y.push(()=>{o.displaySettingsPanel=new Panel("display_settings",{name:"PBR Controls",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure","show_channel_select_menu"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});var J=e=>e.visible&&e.channel&&e.channel!==B,ct=()=>{let e=A();if(e)return e.texture.layers.filter(J);let a=k();return a?a.layers_enabled?a.layers.filter(J):Texture.all.map(t=>t.layers_enabled?[...t.layers.filter(J)]:[J(t)?t:null]).flat().filter(Boolean):[]},we=["select_texture","update_texture_selection","finish_edit","add_texture"],Te=()=>{Panels.channels_panel.inside_vue.textures=ct()};y.push(()=>{o.channelsPanelStyle=Blockbench.addCSS(` + }`),o.brushMetalnessSlider=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",tool_setting:"brush_metalness",settings:{min:0,max:1,step:.01,default:0},condition:()=>Q(g.metalness)}),o.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",tool_setting:"brush_roughness",settings:{min:0,max:1,step:.01,default:1},condition:()=>Q(g.roughness)}),o.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",tool_setting:"brush_emissive",condition:()=>Q(g.emissive)}),o.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",tool_setting:"brush_height",settings:{min:0,max:1,step:.01,default:.5},condition:()=>Q(g.height)}),o.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",category:"tools",toolbar:"brush",condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){return k()?.layers_enabled??!1}},allowed_view_modes:"textured",tool_settings:{brush_metalness:0,brush_roughness:1,brush_emissive:"#000000",brush_height:.5},brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(e,a,t,r,{size:n,softness:i,texture:s,x:l,y:m}){let h=V.fromSettings(),d=Object.keys(h.colors),u=Math.floor(n-i*n/100),b=t;return s.layers.forEach(p=>{if(!p.visible||!d.includes(p.channel))return;let f=h.getChannel(p.channel);if(!f)return;let c=Math.sqrt((l-e)**2+(m-a)**2),x=Math.min(1,c/u);if(l%u<=x&&m%u<=x){let _=p.ctx.getImageData(e,a,1,1).data,M=new v.Color(`rgb(${_[0]}, ${_[1]}, ${_[2]})`);f.lerp(M,1)}p.ctx.fillStyle=f.getStyle(),p.ctx.fillRect(e,a,1,1),p.selected&&(b={r:f.r*255,g:f.g*255,b:f.b*255,a:r*255})}),b}},onCanvasClick(e){Painter.startPaintToolCanvas(e,e.event)},onSelect(){Painter.updateNslideValues(),R()},click(){N()}}),o.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:{project:!0},click(){o.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:ct,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(e){we({metalness:Number(e.metalness??o.brushMetalnessSlider?.get()),roughness:Number(e.roughness??o.brushRoughnessSlider?.get()),emissive:(e.emissive??o.brushEmissiveColor?.get()).toString(),height:Number(e.height??o.brushHeightSlider?.get()),albedo:(e.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(e,a){o.materialBrushTool?.select(),e===1&&Blockbench.textPrompt("Save Preset","New Preset",t=>{t&&(lt(t),Blockbench.showQuickMessage(`Preset "${t}" saved`,2e3))})}}).show()}}),MenuBar.addAction(o.materialBrushTool,"tools.0")});C.push(()=>{MenuBar.removeAction("tools.material_brush")});y.push(()=>{o.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","load_brush_preset","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Settings"})],condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});y.push(()=>{o.displaySettingsPanel=new Panel("display_settings",{name:"PBR Controls",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure","show_channel_select_menu"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});var J=e=>e.visible&&e.channel&&e.channel!==B,ut=()=>{let e=A();if(e)return e.texture.layers.filter(J);let a=k();return a?a.layers_enabled?a.layers.filter(J):Texture.all.map(t=>t.layers_enabled?[...t.layers.filter(J)]:[J(t)?t:null]).flat().filter(Boolean):[]},Te=["select_texture","update_texture_selection","finish_edit","add_texture"],Ce=()=>{Panels.channels_panel.inside_vue.textures=ut()};y.push(()=>{o.channelsPanelStyle=Blockbench.addCSS(` .texture_channel { color: var(--color-text); flex: 1; @@ -263,7 +263,7 @@ ${n.join(` border-top: 1px solid var(--color-border); padding-right: 0; } - `),o.channelsPanel=new Panel("channels_panel",{name:"PBR Channels",id:"channels_panel",icon:"gallery_thumbnail",condition:{project:!0,selected:{texture:!0},modes:["paint","edit"]},toolbars:[],component:{name:"ChannelsPanel",data(){return{channels:p,textures:[]}},methods:{openMenu(e){o.channelMenu?.open(e)},selectTexture(e){Modes.options.paint.select(),e.select(),e.scrollTo()},channelEnabled(e){return e.channel&&e.channel!==B&&e.channel in this.channels},getImgSrc(e){return e.img?.src??`data:image/png;base64,${e.canvas.toDataURL()}`}},template:` + `),o.channelsPanel=new Panel("channels_panel",{name:"PBR Channels",id:"channels_panel",icon:"gallery_thumbnail",condition:{project:!0,selected:{texture:!0},modes:["paint","edit"]},toolbars:[],component:{name:"ChannelsPanel",data(){return{channels:g,textures:[]}},methods:{openMenu(e){o.channelMenu?.open(e)},selectTexture(e){Modes.options.paint.select(),e.select(),e.scrollTo()},channelEnabled(e){return e.channel&&e.channel!==B&&e.channel in this.channels},getImgSrc(e){return e.img?.src??`data:image/png;base64,${e.canvas.toDataURL()}`}},template:`
        -
        `},expand_button:!0,growable:!0,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:350,folded:!0},insert_after:"layers",insert_before:"color"}),Blockbench.on(we.join(" "),Te)});C.push(()=>{we.forEach(e=>{Blockbench.removeListener(e,Te)})});(()=>{let e=()=>{y.forEach(t=>t())},a=()=>{z(),C.forEach(t=>t()),Object.entries(o).forEach(([t,r])=>{try{r?.delete()}catch(n){console.warn(`Failed to delete ${t} action:`,n)}})};BBPlugin.register("pbr_preview",{version:"1.1.0",title:"PBR Tools",author:"Jason J. Gardner",description:"Create and view PBR materials in Blockbench. Export textures for Java and RenderDragon shaders.",tags:["Minecraft: Java Edition","Minecraft: Bedrock Edition","PBR"],icon:"icon.png",variant:"both",await_loading:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.3",onload:e,onunload:a})})();})(); +
      `},expand_button:!0,growable:!0,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:350,folded:!0},insert_after:"layers",insert_before:"color"}),Blockbench.on(Te.join(" "),Ce)});C.push(()=>{Te.forEach(e=>{Blockbench.removeListener(e,Ce)})});(()=>{let e=()=>{y.forEach(t=>t())},a=()=>{z(),C.forEach(t=>t()),Object.entries(o).forEach(([t,r])=>{try{r?.delete()}catch(n){console.warn(`Failed to delete ${t} action:`,n)}})};BBPlugin.register("pbr_preview",{version:"1.1.0",title:"PBR Tools",author:"Jason J. Gardner",description:"Create and view PBR materials in Blockbench. Export textures for Java and RenderDragon shaders.",tags:["Minecraft: Java Edition","Minecraft: Bedrock Edition","PBR"],icon:"icon.png",variant:"both",await_loading:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.3",onload:e,onunload:a})})();})(); diff --git a/src/pbr_preview/src/lib/actions/index.ts b/src/pbr_preview/src/lib/actions/index.ts index bad3e774..61a720a4 100644 --- a/src/pbr_preview/src/lib/actions/index.ts +++ b/src/pbr_preview/src/lib/actions/index.ts @@ -9,3 +9,4 @@ import "./toggleLights"; import "./togglePbr"; import "./tonemapping"; import "./usdz"; +import "../io/bbmat"; diff --git a/src/pbr_preview/src/lib/actions/materialTexture.ts b/src/pbr_preview/src/lib/actions/materialTexture.ts index 085f9103..792ce31a 100644 --- a/src/pbr_preview/src/lib/actions/materialTexture.ts +++ b/src/pbr_preview/src/lib/actions/materialTexture.ts @@ -85,6 +85,7 @@ setups.push(() => { // Create PBR channels as texture layers for the new texture const layers = Object.keys(channels) + .reverse() .map((key) => { const channel = CHANNELS[key]; const channelTexture = mat?.findTexture(channel, true); diff --git a/src/pbr_preview/src/lib/io/bbmat.ts b/src/pbr_preview/src/lib/io/bbmat.ts new file mode 100644 index 00000000..088fd255 --- /dev/null +++ b/src/pbr_preview/src/lib/io/bbmat.ts @@ -0,0 +1,208 @@ +import { registry, setups, teardowns, CHANNELS } from "../../constants"; +import type { Channel, IBbMat } from "../../types"; +import PbrMaterial from "../PbrMaterials"; + +const FORMAT_VERSION = "1.0.0"; + +setups.push(() => { + registry.bbmat = new Codec("material", { + name: "Blockbench Material", + extension: "bbmat", + remember: false, + load_filter: { + extensions: ["bbmat"], + type: "json", + }, + compile(options) { + if (!Texture.selected?.material || !Texture.selected?.layers_enabled) { + return; + } + + const channels = Texture.selected.layers.map((layer: TextureLayer) => { + const channel = layer.channel; + const map = layer.canvas.toDataURL(); + return [channel, map]; + }); + + const pbrMaterial = new PbrMaterial( + Texture.selected.layers, + Texture.selected.uuid + ); + + channels.push(["preview", pbrMaterial.renderMaterialPreview()]); + + return JSON.stringify({ + version: FORMAT_VERSION, + channels: Object.fromEntries(channels), + }); + }, + parse(content, path) { + content = typeof content === "string" ? JSON.parse(content) : content; + const version = content.version; + + if (version !== FORMAT_VERSION) { + return {}; + } + + return content.channels as IBbMat["channels"]; + }, + load(content, file, add) { + if (!Project) { + return; + } + + const data = this.parse( + content, + file.path + ) as unknown as IBbMat["channels"]; + + const channelKeys = Object.keys(data); + + if (!channelKeys.length) { + throw new Error("No valid channels found in the material"); + } + + let baseColor = + data[CHANNELS.albedo.id as Channel] ?? data[channelKeys[0] as Channel]; + + if (channelKeys.includes("preview")) { + baseColor = data["preview"]; + } + + const material = new Texture({ + name: pathToName(file.name), + saved: true, + particle: false, + source: baseColor, + layers_enabled: true, + }); + material.extend({ material: true }); + + const layers = channelKeys + .map((channel) => { + if (!(channel in CHANNELS)) { + return null; + } + + const map = data[channel as Channel]; + const layer = new TextureLayer( + { + name: channel, + data_url: map, + visible: true, + }, + material + ); + + layer.extend({ channel }); + + return layer; + }) + .filter(Boolean) as TextureLayer[]; + + if (!layers.length) { + throw new Error("No valid channel layers found in the material"); + } + + if (!baseColor) { + material.fromDataURL(layers[0].canvas.toDataURL()); + } + + material.add().select(); + + layers.forEach((layer) => { + layer.addForEditing(); + material.width = Math.max(material.width, layer.img.width); + material.height = Math.max(material.height, layer.img.height); + }); + material.updateChangesAfterEdit(); + }, + export() { + Blockbench.export( + { + resource_id: "material", + type: this.name, + extensions: [this.extension], + name: `${Texture.selected?.name ?? this.fileName ?? "material"}.bbmat`, + startpath: this.startPath(), + content: this.compile(), + }, + (path) => this.afterDownload(path) + ); + }, + }); + + registry.bbMatExport = new Action("export_bbmat", { + icon: "stacks", + name: "Save as .bbmat", + category: "file", + condition: { + project: true, + selected: { + texture: true, + }, + method() { + return Texture.selected?.material; + }, + }, + click() { + if (!registry.bbmat?.write || !registry.bbmat?.compile) { + return; + } + + // const content = registry.bbmat.compile(); + + // if (isApp && Project) { + // registry.bbmat.write( + // content, + // Project.save_path.replace( + // /\/[^\\\/]\.bbmodel$/i, + // `/${Texture.selected.name ?? "material"}.bbmat` + // ) + // ); + // return; + // } + + if (registry.bbmat.export) { + registry.bbmat.export(); + } + }, + }); + + registry.bbMatImport = new Action("import_bbmat", { + icon: "stacks", + name: "Import .bbmat", + category: "file", + condition: { + project: true, + }, + click() { + Blockbench.import( + { + extensions: ["bbmat"], + type: "json", + title: "Import .bbmat", + multiple: true, + }, + (files) => { + if (!registry.bbmat?.load) { + return; + } + + files.forEach((file) => { + registry.bbmat!.load!(file.content, file, true); + }); + } + ); + }, + }); + + registry.bbmat.export_action = registry.bbMatExport; + Texture.prototype.menu.addAction(registry.bbMatExport); + MenuBar.addAction(registry.bbMatImport, "file.import"); +}); + +teardowns.push(() => { + Texture.prototype.menu.removeAction("export_bbmat"); + MenuBar.removeAction("file.import.import_bbmat"); +}); diff --git a/src/pbr_preview/src/types.d.ts b/src/pbr_preview/src/types.d.ts index 849f4d9c..c5708024 100644 --- a/src/pbr_preview/src/types.d.ts +++ b/src/pbr_preview/src/types.d.ts @@ -30,6 +30,11 @@ export interface IPbrMaterials { }; } +export interface IBbMat { + version: number; + channels: Record; +} + export interface IRegistry { bakeTexturesAction: Action; bakeTexturesDialog: Dialog; @@ -67,5 +72,8 @@ export interface IRegistry { userMaterialBrushPresets: Dialog; exportUsdz: Action; usdz: Codec; + bbmat: Codec; + bbMatExport: Action; + bbMatImport: Action; [key: string]: Deletable; } From fc25a5b1b34d196e20c1b7f3e687687f7b42670d Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 20 Jun 2024 11:48:44 -0500 Subject: [PATCH 31/50] upd: Normal map orientation (#11) * upd: Support normal map orientation - Added option to create normal map in either DirectX or OpenGL format * upd: USDZ normal map conversion - Added option to specify USDZ normal map type * upd: Disable .bbmat preview export - Disable empty normal map painting with material brush - Added changelog and about.md info on new features --- plugins/pbr_preview/about.md | 9 +++ plugins/pbr_preview/changelog.json | 15 ++++ plugins/pbr_preview/pbr_preview.js | 48 ++++++------ src/pbr_preview/src/constants.ts | 2 + src/pbr_preview/src/index.ts | 11 ++- src/pbr_preview/src/lib/MaterialBrush.ts | 4 +- .../src/lib/actions/generateNormal.ts | 75 +++++++++++------- src/pbr_preview/src/lib/actions/usdz.ts | 45 +++++++++-- src/pbr_preview/src/lib/io/bbmat.ts | 58 ++++++-------- src/pbr_preview/src/lib/normalMap.ts | 76 ++++++++++++++++++- 10 files changed, 244 insertions(+), 99 deletions(-) diff --git a/plugins/pbr_preview/about.md b/plugins/pbr_preview/about.md index 53350616..31b01c5b 100644 --- a/plugins/pbr_preview/about.md +++ b/plugins/pbr_preview/about.md @@ -78,6 +78,10 @@ - Adds new codec for exporting in USDZ format. +### `.bbmat` Codec + +Reuse and share PBR materials in Blockbench with this custom file format. + ## Usage ### PBR Controls @@ -195,3 +199,8 @@ Open the _Material Brush Presets_ dialog to define and save new brush settings, or to select and apply existing presets. A material preview is generated upon saving a preset. Select a preset to populate its values in the Material Brush input controls. + +### `.bbmat` Files +- Import Blockbench PBR materials by dropping a `.bbmat` file into a Blockbench project. + - The import option is also available in the _File_ menu. +- Export existing materials from texture content menu to save its assigned channels together in one file. \ No newline at end of file diff --git a/plugins/pbr_preview/changelog.json b/plugins/pbr_preview/changelog.json index 3fe0dbab..d8f93e67 100644 --- a/plugins/pbr_preview/changelog.json +++ b/plugins/pbr_preview/changelog.json @@ -32,5 +32,20 @@ ] } ] + }, + "1.2.0": { + "title": "1.2.0", + "date": "2024-06-20", + "author": "Jason J. Gardner", + "categories": [ + { + "title": "USDZ Export", + "list": [ + "Added USDZ export option", + "Added normal map orientation options", + "Created `.bbmat` codec" + ] + } + ] } } \ No newline at end of file diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index ef9a378a..1a081d60 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1,4 +1,4 @@ -"use strict";(()=>{var v=THREE,re=Vue,ne=window.JSZip;var B="_NONE_",g={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new v.Color(16777215),regex:new RegExp("(s|_)*(basecolor|color|albedo)","i")},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new v.Color(0),regex:new RegExp("[ _]*metal(lic|ness)?","i")},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new v.Color(0),regex:new RegExp("[ _]*(emissive|emission)","i")},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new v.Color(16777215),regex:new RegExp("[ _]*rough(ness)?","i")},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new v.Color(16777215),regex:new RegExp("[ _]*(height|bump)","i")},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new v.Color("rgb(128, 128, 255)"),regex:new RegExp("[ _]*normal","i")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new v.Color(16777215),regex:new RegExp("[ _]*(ao|ambientocclusion|ambient occlusion)","i")}},o={},y=[],C=[];var se=[...Object.keys(g).map(e=>g[e].id),B];y.push(()=>{o.channelProp=new Property(TextureLayer,"enum","channel",{default:B,values:se,label:"PBR Channel",exposed:!1}),o.textureChannelProp=new Property(Texture,"enum","channel",{default:B,values:se,label:"PBR Channel",exposed:!1}),o.materialTextureProp=new Property(Texture,"boolean","material",{default:!1,label:"Material Texture"}),o.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),o.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),o.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!1,values:[],label:"PBR Mode"})});function k(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(e=>e.selected)??null:Texture.all.find(e=>e.selected)??Texture.getDefault()}function A(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(e=>e.selected)??Project.selected_texture.layers[0]:k()?.getActiveLayer()??null}function $(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(k()?.name??"texture")}function oe(e,a){let t;return function(...r){let n=()=>{t=void 0,e.apply(this,r)};clearTimeout(t),t=setTimeout(n,a)}}function U(e){let a=MediaPreview.renderer??new v.WebGLRenderer({alpha:!0,antialias:!0}),t=new v.Scene,r=new v.PerspectiveCamera(75,96/96,.1,1e3),n=new v.AmbientLight(16777215,.75);t.add(n);let i=new v.PointLight(16777215,1,100);i.position.set(5,5,5),t.add(i);let s=new v.SphereGeometry(1,32,32),l=e instanceof v.MeshStandardMaterial&&e.isMeshStandardMaterial?e:new v.MeshStandardMaterial({color:e.albedo,metalness:e.metalness??0,roughness:e.roughness??1,emissive:e.emissive,bumpScale:e.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),m=new v.Mesh(s,l);t.add(m),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(t,r);let h=a.domElement.toDataURL();return l.dispose(),MediaPreview.renderer||(a.clear(),a.dispose()),h}function Z(e,a){let t=a??document.createElement("canvas"),r=t.getContext("2d");if(!r)return t.remove(),null;let n=Math.max(Project?Project.texture_width:16,16),i=Math.max(Project?Project.texture_height:16,16);t.width=n,t.height=i,r.fillStyle=`rgb(${e.r*255}, ${e.g*255}, ${e.b*255})`,r.fillRect(0,0,n,i);let s=t.toDataURL();return a||t.remove(),s}var Ge=(e=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return e?a.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):a},j=class e{constructor(a,t){this._scope=a??Ge(),this._materialUuid=t}merToCanvas(){let a=this.getTexture(g.emissive),t=this.getTexture(g.roughness),r=this.getTexture(g.metalness);if(!a&&!t&&!r){let{metalness:n,emissive:i,roughness:s}=this.decodeMer();n&&(r=e.makePixelatedCanvas(n)),i&&(a=e.makePixelatedCanvas(i)),s&&(t=e.makePixelatedCanvas(s))}return{emissiveMap:a,roughnessMap:t,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(g.emissive),roughnessMap:this.getTexture(g.roughness),metalnessMap:this.getTexture(g.metalness)},i=this.getTexture(g.normal);return new v.MeshStandardMaterial({map:this.getTexture(g.albedo)??e.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(s=>s.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(g.ao),bumpMap:this.getTexture(g.height),normalMap:i,normalScale:new v.Vector2(-1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}renderMaterialPreview(){return U(this.getMaterial())}saveTexture(a,t){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=t.uuid,t.extend({channel:a.id}))}findTexture(a,t=!0){if(!Project)return null;let r=this._scope.find(m=>m.channel&&(m.channel===a||m.channel===a.id));if(r)return r;let[n,i]=typeof a=="string"?[a,new RegExp(`_*${a}(.[^.]+)?$`,"i")]:[a.id,a.regex??new RegExp(`_*${a.id}(.[^.]+)?$`,"i")];Project.pbr_materials=Project.pbr_materials??{};let s=Project.pbr_materials[this._materialUuid];if(t&&!s?.length&&n!==B)return this._scope.find(m=>i.test(m.name))??null;let l=s?.[n];return l?this._scope.find(m=>m.uuid===l)??null:null}static makePixelatedCanvas(a){let t=new v.CanvasTexture(a,void 0,void 0,void 0,v.NearestFilter,v.NearestFilter);return t.needsUpdate=!0,t}getTexture(a){let t=this.findTexture(a);return t?e.makePixelatedCanvas(t.canvas):null}static extractChannel(a,t){let r=a.canvas,{width:n,height:i}=r,s=r.getContext("2d");if(!s||!n||!i)return null;let l=document.createElement("canvas");l.width=n,l.height=i;let m=l.getContext("2d");if(!m)return null;let h={r:0,g:1,b:2,a:3}[t],{data:d}=s.getImageData(0,0,n,i),u=new Uint8ClampedArray(n*i*4);for(let p=0;pa){f[c]=b.data[c],f[c+1]=b.data[c+1],f[c+2]=b.data[c+2],f[c+3]=255;continue}f[c]=0,f[c+1]=0,f[c+2]=0,f[c+3]=255}return h.putImageData(new ImageData(f,l.width,l.height),0,0),{metalness:r,emissive:l,emissiveLevel:n,roughness:i,sss:s}}createMer(a=!1){let t=this.findTexture(g.metalness,a),r=this.findTexture(g.emissive,a),n=this.findTexture(g.roughness,a),i=this.findTexture("sss",!1),s=Math.max(t?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),l=Math.max(t?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),m=document.createElement("canvas");m.width=s,m.height=l;let h=m.getContext("2d");if(!h)return null;let d=t?.img?e.extractChannel(t,"r"):null,u=r?.img?e.extractChannel(r,"g"):null,b=n?.img?e.extractChannel(n,"b"):null,p=i&&i?.img?e.extractChannel(i,"a"):null,f=d?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),c=u?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),x=b?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),_=p?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(new Uint8ClampedArray(s*l*4).fill(255),s,l),M=new Uint8ClampedArray(s*l*4);for(let w=0;w{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createTexturesFromNormal(a){let t=this.decodeLabPbrNormal(a);return Object.entries(t).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}};var O=class{constructor({lightHeight:a=.66,ambientLight:t=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:n=[1,1,1]}={}){this.lightHeight=a,this.ambientLight=t,this.minLightIntensity=r,this.lightDiffuse=n}bake(a,t,r){let n=t instanceof HTMLCanvasElement?t:this.createCanvas(t.width,t.height),i=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),s=n.getContext("2d"),l=i.getContext("2d");s.drawImage(t,0,0),l.drawImage(r,0,0);let m=s.getImageData(0,0,t.width,t.height),h=l.getImageData(0,0,r.width,r.height),d=[],u=[];for(let p=0;p{let f=this.createCanvas(t.width,t.height),c=f.getContext("2d"),x=c.getImageData(0,0,f.width,f.height),_=[Math.cos(p),Math.sin(p),this.lightHeight];for(let M=0;M{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new j(r.layers_enabled?r.layers:Project.textures,r.uuid),i=n.findTexture(g.albedo);if(!i){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let s=n.findTexture(g.normal);if(!s){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let m=new O(e).bake(a,i.canvas,s.canvas),h=new Texture({name:`${i.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(m[0].toDataURL()),d=t?u=>{let b=n.findTexture(g.emissive);if(!b)return u;let p=b.canvas;if(!p.getContext("2d"))return u;let c=Math.max(u.width,p.width,Project?Project.texture_width:16),x=Math.max(u.height,p.height,Project?Project.texture_height:16),_=document.createElement("canvas");_.width=c,_.height=x;let M=_.getContext("2d");return M?(M.drawImage(u,0,0),M.globalCompositeOperation="screen",M.drawImage(p,0,0),_):u}:u=>u;m.forEach((u,b)=>{new TextureLayer({name:`baked_${b+1}`,data_url:d(u).toDataURL()},h).addForEditing()}),h.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};y.push(()=>{o.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(e){let a=new v.Color(e.ambientLight.toString()),t=new v.Color(e.lightDiffuse.toString());ie({ambientLight:[a.r,a.g,a.b],lightDiffuse:[t.r,t.g,t.b],lightHeight:Number(e.lightHeight),minLightIntensity:Number(e.minLightIntensity)},e.directions??8,e.blendEmissive??!1)}}),o.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){o.bakeTexturesDialog?.show()}}),MenuBar.addAction(o.bakeTexturesAction,"tools")});C.push(()=>{MenuBar.removeAction("tools.bake_textures")});function le(e,a){let t=e.getTexture();if(!t||!Project)return null;let r=Project.materials[t.uuid];r.isShaderMaterial&&!Project.bb_materials[t.uuid]?Project.bb_materials[t.uuid]=r:r.isMeshStandardMaterial&&r.dispose();let n=new j(t.layers_enabled?t.layers.filter(i=>i.visible)??null:Project.textures,t.uuid).getMaterial({side:Canvas.getRenderSide(t),...a});return Project.materials[t.uuid]=v.ShaderMaterial.prototype.copy.call(n,r),t}function ce(e){return Object.values(e).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function Ve(e,a){let t={};return e.forAllFaces(r=>{let n=le(r,a);n&&(t[n.uuid]=n)}),ce(t)}function Qe(e,a){let t={};return Object.keys(e.faces).forEach(r=>{let n=e.faces[r],i=le(n,a);i&&(t[i.uuid]=i)}),ce(t)}var R=(e={})=>{Project&&(Project.pbr_active=Texture.all.length>0&&Project.elements.map(a=>a instanceof Mesh&&Ve(a,e)||a instanceof Cube&&Qe(a,e)).filter(Boolean).length>0)},N=(e=100)=>oe(R,e);var q={},W=()=>Condition({modes:["edit","paint"],selected:{texture:!0},project:!0,method(){let e=k();return e&&!e.material?!0:e?.material===!0&&A()!==null&&Modes.paint}}),ue=()=>Condition({modes:["paint","edit"],selected:{texture:!0},method(){let e=k();if(e?.material&&Modes.edit)return!1;let a=A()??e;return a?.channel&&a.channel!==B}});y.push(()=>{Object.entries(g).forEach(([e,a])=>{q[e]=new Action(`assign_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:W,click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t)return;Undo.initEdit({layers:[t]}),t.extend({channel:a.id});let r=t instanceof TextureLayer?t.texture:t;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([n,i])=>{i===t.uuid&&(delete Project.pbr_materials[r.uuid][n],t.channel=B)}),r.uuid===t.uuid&&(Project.pbr_materials[r.uuid]={}),Project.pbr_materials[r.uuid][e]=t.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${t.name}" to ${a.label} channel`,2e3),R()}})})});C.push(()=>{Object.values(q).forEach(e=>{e.delete()})});y.push(()=>{o.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:ue,click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e)return;Undo.initEdit({layers:[e]});let a=e instanceof TextureLayer?e.texture:e,t=e.channel;Project.pbr_materials[a.uuid]={},e.channel=B,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${e.name}" from ${t} channel`,2e3),N()}}),o.channelMenu=new Menu("channel_menu",[...Object.keys(g).map(e=>`assign_channel_${e}`),"unassign_channel"],{onOpen(){N()}}),o.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",condition:()=>W()||ue(),click(e){o.channelMenu?.open(e)},children:[...Object.values(q),o.unassignChannel]}),o.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:W,click(e){o.channelMenu?.open(e)}}),o.openChannelMenu&&(MenuBar.addAction(o.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(o.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(o.openChannelMenu,"0")),Toolbars.layers.add(o.showChannelMenu,1)});C.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(o.showChannelMenu)});function X(e,a=!1){let t=e.canvas.getContext("2d");if(!t)return null;let r=Math.max(e.img.width??e.canvas.width,Project?Project.texture_width:0,16),n=Math.max(e.img.height??e.canvas.height,Project?Project.texture_height:0,16),{data:i}=t.getImageData(0,0,r,n),s=document.createElement("canvas"),l=s.getContext("2d");if(!l)return null;let m=(c,x)=>{let _=(c+x*r)*4;return i[_]/255};s.width=r,s.height=n,l.drawImage(e.img,0,0,r,n);let h=l.getImageData(0,0,r,n),d=h.data,u=c=>{let x=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);return[c[0]/x,c[1]/x,c[2]/x]};for(let c=0;c{let c=(p+f*t)*4;return n[c]/255};i.width=t,i.height=r,s.drawImage(e.img,0,0,t,r);let m=s.getImageData(0,0,t,r),h=m.data;for(let p=0;p{o.generateNormal=new Action("generate_normal",{icon:g.normal.icon??"altitude",name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(A()??k())!==null,click(e){let a=A()??k()??Texture.getDefault();if(!a)return;let t=X(a);if(!t){Blockbench.showQuickMessage("Failed to generate normal map",2e3);return}t.select(e),new j(a instanceof Texture&&a.layers_enabled?a.layers:null,a.uuid).saveTexture(g.normal,t),Blockbench.showQuickMessage("Normal map generated",2e3)}}),o.generateAo=new Action("generate_ao",{icon:g.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let e=A()??k()??Texture.getDefault();if(!e)return;let a=new j(e instanceof Texture&&e.layers_enabled?e.layers:null,e.uuid),t=a.findTexture(g.normal)??X(e);if(!t){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=me(t);if(r){a.saveTexture(g.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),MenuBar.addAction(o.generateNormal,"tools"),MenuBar.addAction(o.generateAo,"tools")});C.push(()=>{MenuBar.removeAction("tools.generate_normal")});var Je=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},Ze=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};y.push(()=>{o.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let e=k();if(!e)return;let t=new j(e.layers_enabled?e.layers:[e],e.uuid).createLabPbrOutput();if(t===null)return;let r=e.name??(Project?Project.getDisplayName():"texture");await Promise.all([Je(t.normalMap,pathToName(r)),Ze(t.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),o.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let e=TextureLayer.selected?.texture??Texture.all.find(t=>t.selected)??Texture.getDefault(),a=new j(e.layers_enabled?e.layers:[e],e.uuid);if(pathToName(e.name).endsWith("_n")){a.createTexturesFromNormal(e);return}if(pathToName(e.name).endsWith("_s")){a.createTexturesFromSpecular(e);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(o.generateLabPbr,"file.export"),MenuBar.addAction(o.decodeLabPbr,"tools")});C.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});y.push(()=>{o.createMaterialTexture=new Action("create_material_texture",{icon:"deployed_code",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let e={...g},a=new Texture({name:"New Material",saved:!1,particle:!1});a.extend({material:!0});let t=Texture.all.filter(s=>(s.selected||s.multi_selected)&&!s.material)??Texture.all,r=k(),n=r?new j(t,r.uuid):null;try{let s=n?.findTexture(g.albedo,!0)?.canvas.toDataURL()??r?.canvas.toDataURL()??Z(new v.Color(8421504),a.canvas);if(!s)return;a.fromDataURL(s);let l=new TextureLayer({name:e.albedo.label,visible:!0,data_url:s,keep_size:!0},a);l.extend({channel:e.albedo.id}),l.addForEditing(),l.texture.updateChangesAfterEdit(),n?.saveTexture(e.albedo,l),delete e.albedo}catch(s){console.warn("Failed to create base color texture",s),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let i=Object.keys(e).reverse().map(s=>{let l=g[s],m=n?.findTexture(l,!0),h=m?m.canvas.toDataURL():Z(l.default??new v.Color(0));if(!h)return;let d=new TextureLayer({name:l.label,visible:!0,data_url:h,keep_size:!0},a);return d.extend({channel:l.id}),n?.saveTexture(l,d),d}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:i}),a.add().select(),a.activateLayers(),i.map(s=>{s.addForEditing(),a.width=Math.max(a.width,s.img.width),a.height=Math.max(a.height,s.img.height)}),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(o.createMaterialTexture,"tools"),Toolbars.texturelist.add(o.createMaterialTexture,3)});C.push(()=>{MenuBar.removeAction("tools.create_material_texture"),Toolbars.texturelist.remove("create_material_texture")});var F=(e,a)=>{let t=k()??Texture.getDefault(),r=new j(t.layers_enabled?t.layers:Project?Project.textures:null,t.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[i,s]=Project?[e?`${e}_mer`:`${t.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:i,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},a)})};y.push(()=>{o.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{F()}catch(e){console.error("Failed to export MER map:",e),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),o.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let e=k()??Texture.getDefault(),a=new j([e],e.uuid),t=a.decodeMer(),r=[g.metalness,g.emissive,g.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new Texture({name:`${e?.name}_${i}`,keep_size:!1}).fromDataURL(s.toDataURL());l.add(!0),a.saveTexture(n,l)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>k()?.layers_enabled===!0,click(){let e=k()??Texture.getDefault(),a=new j(e.layers_enabled?e.layers:[e],e.uuid),t=a.decodeMer(),r=[g.metalness,g.emissive,g.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new TextureLayer({name:`${e?.name}_${i}`,data_url:s.toDataURL()},e);a.saveTexture(n,l),l.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(o.decodeMer,"tools"),MenuBar.addAction(o.generateMer,"file.export")});C.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var We=()=>{Project&&Project.textures.forEach(e=>{let a=new j(null,e.uuid),t=a.findTexture(g.normal,!1),r=a.findTexture(g.height,!1),n=a.findTexture(g.albedo,!1),i=a.findTexture(g.metalness,!1)?.name,s=a.findTexture(g.emissive,!1)?.name,l=a.findTexture(g.roughness,!1)?.name,m={};return n||(m.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!i&&!s&&!l&&(m.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},m.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},m.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),t&&(m.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(m.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),t&&r&&(m.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),o.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:m,cancelIndex:1,onConfirm(h){let d=$(),u=i||s||l,b={format_version:"1.16.100","minecraft:texture_set":{color:(n?d:h.baseColor?.toHexString())??d,metalness_emissive_roughness:[h.metalness??0,h.emissive??0,h.roughness??255]}};h.depthMap==="normal"&&t||!r&&t?b["minecraft:texture_set"].normal=`${d}_normal`:(!t||h.depthMap==="heightmap")&&r&&(b["minecraft:texture_set"].heightmap=`${d}_heightmap`);let p=x=>{if(!h.depthMap)return x();let _=h.depthMap==="normal"||h.depthMap&&!r,M=_?t:r;if(!M)return x();Blockbench.export({content:M.canvas.toDataURL()??"",type:"PNG",name:`${d}_${_?"normal":"heightmap"}`,extensions:["png"],resource_id:h.depthMap,startpath:Project.export_path,savetype:"image"},w=>{b["minecraft:texture_set"][_?"normal":"heightmap"]=pathToName(w,!1),x()})},f=x=>{if(!n)return x();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:d,startpath:Project.export_path,savetype:"image"},_=>{b["minecraft:texture_set"].color=pathToName(_,!1),x()})},c=()=>p(()=>{f(()=>{Blockbench.export({content:JSON.stringify(b,null,2),type:"JSON",name:`${d}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),o.textureSetDialog?.hide()})})});if(u){try{F(d,x=>{b["minecraft:texture_set"].metalness_emissive_roughness=pathToName(x,!1),c()})}catch(x){console.warn("Failed to export MER map:",x),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}c()}}),o.textureSetDialog.show()})};y.push(()=>{o.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){We()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(o.createTextureSet,"file.export")});C.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});y.push(()=>{o.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(e){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=e}),Preview.selected.renderer.physicallyCorrectLights=e,Blockbench.showQuickMessage(`Physically corrected lighting is now ${e?"enabled":"disabled"}`,2e3),e&&o.togglePbr?.set(!0),R()},click(){}}),MenuBar.addAction(o.toggleCorrectLights,"preview")});C.push(()=>{MenuBar.removeAction("preview.correct_lights")});var z=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(e=>{e instanceof Cube&&Object.keys(e.faces).forEach(a=>{let r=e.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var de=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],he=()=>Project&&Project.pbr_active&&R(),qe=()=>{Blockbench.on(de.join(" "),he)},pe=()=>{de.forEach(e=>{Blockbench.removeListener(e,he)})};y.push(()=>{o.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(e){if(e){R(),qe(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}z(),pe(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(o.togglePbr,"view")});C.push(()=>{pe(),MenuBar.removeAction("view.toggle_pbr")});var ge=e=>{let a=Math.max(-2,Math.min(2,e));Preview.all.forEach(t=>{t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};y.push(()=>{o.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(o.tonemappingSelect?.get())===v.NoToneMapping&&o.tonemappingSelect.change(v.LinearToneMapping.toString()),o.togglePbr?.set(!0)},onChange(e){ge(Number(e))},onAfter(){N()}}),o.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>o.exposureSlider!==void 0&&Number(o.exposureSlider?.get())!==1,click(){ge(1),o.exposureSlider?.setValue(1,!0),N()}}),o.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:v.NoToneMapping,value:Preview.selected.renderer.toneMapping??v.NoToneMapping,icon:"monochrome_photos",options:{[v.NoToneMapping]:"No Tone Mapping",[v.LinearToneMapping]:"Linear",[v.ReinhardToneMapping]:"Reinhard",[v.CineonToneMapping]:"Cineon",[v.NeutralToneMapping]:"Neutral",[v.ACESFilmicToneMapping]:"ACES"},onChange({value:e}){Preview.selected.renderer.toneMapping=Number(e);let a=1;Preview.selected.renderer.toneMapping===v.NoToneMapping?o.exposureSlider?.setValue(a,!0):a=Number(o.exposureSlider?.get()??1),Preview.all.forEach(t=>{t.renderer.toneMapping=Number(e),t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(e)}`,2e3),o.togglePbr&&!o.togglePbr.value&&o.togglePbr.set(!0),R()}})});var K=class{async parse(a){let t=new ne,r="model.usda";t.file(r,"");let n=ve(),i={},s={};a.traverseVisible(h=>{if(!h.isMesh)return;let d=h;if(!d.material.isMeshStandardMaterial){console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",h);return}let u=d.geometry,b=d.material,p="geometries/Geometry_"+u.id+".usd";if(!t.file(p)){let f=tt(u);t.file(p,Ke(f))}b.uuid in i||(i[b.uuid]=b),n+=Ye(d,u,b)}),n+=ot(i,s),t.file(r,n),n=null;for(let h in s){let d=s[h],u=h.split("_")[1],b=d.format===v.RGBAFormat,p=Xe(d.image,u),c=await(await new Promise(x=>p.toBlob(_=>_&&x(_),b?"image/png":"image/jpeg",1))).arrayBuffer();t.file(`textures/Texture_${h}.${b?"png":"jpg"}`,c)}let l=0;t.forEach(async h=>{let d=34+h.length;l+=d;let u=l&63,b=await t.file(h).async("uint8array");if(u!==4){let p=64-u,f=new Uint8Array(p),c=new Uint8Array(b.length+p);c.set(b,0),c.set(f,b.length),t.file(h,c)}l+=b.length});let m=await t.generateAsync({type:"blob",compression:"STORE"});return new Uint8Array(await m.arrayBuffer())}};function Xe(e,a){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=1024/Math.max(e.width,e.height),r=document.createElement("canvas");r.width=e.width*Math.min(1,t),r.height=e.height*Math.min(1,t);let n=r.getContext("2d");if(n.imageSmoothingEnabled=!1,n.drawImage(e,0,0,r.width,r.height),a!==void 0){let i=parseInt(a,16),s=(i>>16&255)/255,l=(i>>8&255)/255,m=(i&255)/255,h=n.getImageData(0,0,r.width,r.height),d=h.data;for(let u=0;u{var _=THREE,ie=Vue,le=window.JSZip;var F="1.2.0",K="1.0.0",B="_NONE_",h={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new _.Color(16777215),regex:new RegExp("(s|_)*(basecolor|color|albedo)","i")},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new _.Color(0),regex:new RegExp("[ _]*metal(lic|ness)?","i")},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new _.Color(0),regex:new RegExp("[ _]*(emissive|emission)","i")},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new _.Color(16777215),regex:new RegExp("[ _]*rough(ness)?","i")},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new _.Color(16777215),regex:new RegExp("[ _]*(height|bump)","i")},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new _.Color("rgb(128, 128, 255)"),regex:new RegExp("[ _]*normal","i")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new _.Color(16777215),regex:new RegExp("[ _]*(ao|ambientocclusion|ambient occlusion)","i")}},o={},y=[],C=[];var ce=[...Object.keys(h).map(e=>h[e].id),B];y.push(()=>{o.channelProp=new Property(TextureLayer,"enum","channel",{default:B,values:ce,label:"PBR Channel",exposed:!1}),o.textureChannelProp=new Property(Texture,"enum","channel",{default:B,values:ce,label:"PBR Channel",exposed:!1}),o.materialTextureProp=new Property(Texture,"boolean","material",{default:!1,label:"Material Texture"}),o.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),o.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),o.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!1,values:[],label:"PBR Mode"})});function E(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(e=>e.selected)??null:Texture.all.find(e=>e.selected)??Texture.getDefault()}function R(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(e=>e.selected)??Project.selected_texture.layers[0]:E()?.getActiveLayer()??null}function G(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(E()?.name??"texture")}function ue(e,a){let t;return function(...r){let n=()=>{t=void 0,e.apply(this,r)};clearTimeout(t),t=setTimeout(n,a)}}function z(e){let a=MediaPreview.renderer??new _.WebGLRenderer({alpha:!0,antialias:!0}),t=new _.Scene,r=new _.PerspectiveCamera(75,96/96,.1,1e3),n=new _.AmbientLight(16777215,.75);t.add(n);let i=new _.PointLight(16777215,1,100);i.position.set(5,5,5),t.add(i);let s=new _.SphereGeometry(1,32,32),l=e instanceof _.MeshStandardMaterial&&e.isMeshStandardMaterial?e:new _.MeshStandardMaterial({color:e.albedo,metalness:e.metalness??0,roughness:e.roughness??1,emissive:e.emissive,bumpScale:e.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),u=new _.Mesh(s,l);t.add(u),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(t,r);let m=a.domElement.toDataURL();return l.dispose(),MediaPreview.renderer||(a.clear(),a.dispose()),m}function Y(e,a){let t=a??document.createElement("canvas"),r=t.getContext("2d");if(!r)return t.remove(),null;let n=Math.max(Project?Project.texture_width:16,16),i=Math.max(Project?Project.texture_height:16,16);t.width=n,t.height=i,r.fillStyle=`rgb(${e.r*255}, ${e.g*255}, ${e.b*255})`,r.fillRect(0,0,n,i);let s=t.toDataURL();return a||t.remove(),s}var Qe=(e=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return e?a.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):a},k=class e{constructor(a,t){this._scope=a??Qe(),this._materialUuid=t}merToCanvas(){let a=this.getTexture(h.emissive),t=this.getTexture(h.roughness),r=this.getTexture(h.metalness);if(!a&&!t&&!r){let{metalness:n,emissive:i,roughness:s}=this.decodeMer();n&&(r=e.makePixelatedCanvas(n)),i&&(a=e.makePixelatedCanvas(i)),s&&(t=e.makePixelatedCanvas(s))}return{emissiveMap:a,roughnessMap:t,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(h.emissive),roughnessMap:this.getTexture(h.roughness),metalnessMap:this.getTexture(h.metalness)},i=this.getTexture(h.normal);return new _.MeshStandardMaterial({map:this.getTexture(h.albedo)??e.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(s=>s.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(h.ao),bumpMap:this.getTexture(h.height),normalMap:i,normalScale:new _.Vector2(-1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}renderMaterialPreview(){return z(this.getMaterial())}saveTexture(a,t){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=t.uuid,t.extend({channel:a.id}))}findTexture(a,t=!0){if(!Project)return null;let r=this._scope.find(u=>u.channel&&(u.channel===a||u.channel===a.id));if(r)return r;let[n,i]=typeof a=="string"?[a,new RegExp(`_*${a}(.[^.]+)?$`,"i")]:[a.id,a.regex??new RegExp(`_*${a.id}(.[^.]+)?$`,"i")];Project.pbr_materials=Project.pbr_materials??{};let s=Project.pbr_materials[this._materialUuid];if(t&&!s?.length&&n!==B)return this._scope.find(u=>i.test(u.name))??null;let l=s?.[n];return l?this._scope.find(u=>u.uuid===l)??null:null}static makePixelatedCanvas(a){let t=new _.CanvasTexture(a,void 0,void 0,void 0,_.NearestFilter,_.NearestFilter);return t.needsUpdate=!0,t}getTexture(a){let t=this.findTexture(a);return t?e.makePixelatedCanvas(t.canvas):null}static extractChannel(a,t){let r=a.canvas,{width:n,height:i}=r,s=r.getContext("2d");if(!s||!n||!i)return null;let l=document.createElement("canvas");l.width=n,l.height=i;let u=l.getContext("2d");if(!u)return null;let m={r:0,g:1,b:2,a:3}[t],{data:d}=s.getImageData(0,0,n,i),c=new Uint8ClampedArray(n*i*4);for(let g=0;ga){x[f]=v.data[f],x[f+1]=v.data[f+1],x[f+2]=v.data[f+2],x[f+3]=255;continue}x[f]=0,x[f+1]=0,x[f+2]=0,x[f+3]=255}return m.putImageData(new ImageData(x,l.width,l.height),0,0),{metalness:r,emissive:l,emissiveLevel:n,roughness:i,sss:s}}createMer(a=!1){let t=this.findTexture(h.metalness,a),r=this.findTexture(h.emissive,a),n=this.findTexture(h.roughness,a),i=this.findTexture("sss",!1),s=Math.max(t?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),l=Math.max(t?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),u=document.createElement("canvas");u.width=s,u.height=l;let m=u.getContext("2d");if(!m)return null;let d=t?.img?e.extractChannel(t,"r"):null,c=r?.img?e.extractChannel(r,"g"):null,v=n?.img?e.extractChannel(n,"b"):null,g=i&&i?.img?e.extractChannel(i,"a"):null,x=d?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),f=c?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),p=v?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),b=g?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(new Uint8ClampedArray(s*l*4).fill(255),s,l),M=new Uint8ClampedArray(s*l*4);for(let w=0;w{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createTexturesFromNormal(a){let t=this.decodeLabPbrNormal(a);return Object.entries(t).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}};var V=class{constructor({lightHeight:a=.66,ambientLight:t=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:n=[1,1,1]}={}){this.lightHeight=a,this.ambientLight=t,this.minLightIntensity=r,this.lightDiffuse=n}bake(a,t,r){let n=t instanceof HTMLCanvasElement?t:this.createCanvas(t.width,t.height),i=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),s=n.getContext("2d"),l=i.getContext("2d");s.drawImage(t,0,0),l.drawImage(r,0,0);let u=s.getImageData(0,0,t.width,t.height),m=l.getImageData(0,0,r.width,r.height),d=[],c=[];for(let g=0;g{let x=this.createCanvas(t.width,t.height),f=x.getContext("2d"),p=f.getImageData(0,0,x.width,x.height),b=[Math.cos(g),Math.sin(g),this.lightHeight];for(let M=0;M{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new k(r.layers_enabled?r.layers:Project.textures,r.uuid),i=n.findTexture(h.albedo);if(!i){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let s=n.findTexture(h.normal);if(!s){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let u=new V(e).bake(a,i.canvas,s.canvas),m=new Texture({name:`${i.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(u[0].toDataURL()),d=t?c=>{let v=n.findTexture(h.emissive);if(!v)return c;let g=v.canvas;if(!g.getContext("2d"))return c;let f=Math.max(c.width,g.width,Project?Project.texture_width:16),p=Math.max(c.height,g.height,Project?Project.texture_height:16),b=document.createElement("canvas");b.width=f,b.height=p;let M=b.getContext("2d");return M?(M.drawImage(c,0,0),M.globalCompositeOperation="screen",M.drawImage(g,0,0),b):c}:c=>c;u.forEach((c,v)=>{new TextureLayer({name:`baked_${v+1}`,data_url:d(c).toDataURL()},m).addForEditing()}),m.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};y.push(()=>{o.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(e){let a=new _.Color(e.ambientLight.toString()),t=new _.Color(e.lightDiffuse.toString());me({ambientLight:[a.r,a.g,a.b],lightDiffuse:[t.r,t.g,t.b],lightHeight:Number(e.lightHeight),minLightIntensity:Number(e.minLightIntensity)},e.directions??8,e.blendEmissive??!1)}}),o.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){o.bakeTexturesDialog?.show()}}),MenuBar.addAction(o.bakeTexturesAction,"tools")});C.push(()=>{MenuBar.removeAction("tools.bake_textures")});function de(e,a){let t=e.getTexture();if(!t||!Project)return null;let r=Project.materials[t.uuid];r.isShaderMaterial&&!Project.bb_materials[t.uuid]?Project.bb_materials[t.uuid]=r:r.isMeshStandardMaterial&&r.dispose();let n=new k(t.layers_enabled?t.layers.filter(i=>i.visible)??null:Project.textures,t.uuid).getMaterial({side:Canvas.getRenderSide(t),...a});return Project.materials[t.uuid]=_.ShaderMaterial.prototype.copy.call(n,r),t}function he(e){return Object.values(e).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function Je(e,a){let t={};return e.forAllFaces(r=>{let n=de(r,a);n&&(t[n.uuid]=n)}),he(t)}function Xe(e,a){let t={};return Object.keys(e.faces).forEach(r=>{let n=e.faces[r],i=de(n,a);i&&(t[i.uuid]=i)}),he(t)}var N=(e={})=>{Project&&(Project.pbr_active=Texture.all.length>0&&Project.elements.map(a=>a instanceof Mesh&&Je(a,e)||a instanceof Cube&&Xe(a,e)).filter(Boolean).length>0)},A=(e=100)=>ue(N,e);var te={},ee=()=>Condition({modes:["edit","paint"],selected:{texture:!0},project:!0,method(){let e=E();return e&&!e.material?!0:e?.material===!0&&R()!==null&&Modes.paint}}),pe=()=>Condition({modes:["paint","edit"],selected:{texture:!0},method(){let e=E();if(e?.material&&Modes.edit)return!1;let a=R()??e;return a?.channel&&a.channel!==B}});y.push(()=>{Object.entries(h).forEach(([e,a])=>{te[e]=new Action(`assign_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:ee,click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t)return;Undo.initEdit({layers:[t]}),t.extend({channel:a.id});let r=t instanceof TextureLayer?t.texture:t;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([n,i])=>{i===t.uuid&&(delete Project.pbr_materials[r.uuid][n],t.channel=B)}),r.uuid===t.uuid&&(Project.pbr_materials[r.uuid]={}),Project.pbr_materials[r.uuid][e]=t.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${t.name}" to ${a.label} channel`,2e3),N()}})})});C.push(()=>{Object.values(te).forEach(e=>{e.delete()})});y.push(()=>{o.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:pe,click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e)return;Undo.initEdit({layers:[e]});let a=e instanceof TextureLayer?e.texture:e,t=e.channel;Project.pbr_materials[a.uuid]={},e.channel=B,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${e.name}" from ${t} channel`,2e3),A()}}),o.channelMenu=new Menu("channel_menu",[...Object.keys(h).map(e=>`assign_channel_${e}`),"unassign_channel"],{onOpen(){A()}}),o.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",condition:()=>ee()||pe(),click(e){o.channelMenu?.open(e)},children:[...Object.values(te),o.unassignChannel]}),o.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:ee,click(e){o.channelMenu?.open(e)}}),o.openChannelMenu&&(MenuBar.addAction(o.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(o.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(o.openChannelMenu,"0")),Toolbars.layers.add(o.showChannelMenu,1)});C.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(o.showChannelMenu)});function $(e,a="DirectX",t=!1){let r=e.canvas.getContext("2d");if(!r)return null;let n=Math.max(e.img.width??e.canvas.width,Project?Project.texture_width:0,16),i=Math.max(e.img.height??e.canvas.height,Project?Project.texture_height:0,16),{data:s}=r.getImageData(0,0,n,i),l=document.createElement("canvas"),u=l.getContext("2d");if(!u)return null;let m=(p,b)=>{let M=(p+b*n)*4;return s[M]/255};l.width=n,l.height=i,u.drawImage(e.img,0,0,n,i);let d=u.getImageData(0,0,n,i),c=d.data,v=p=>{let b=Math.sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);return[p[0]/b,p[1]/b,p[2]/b]};for(let p=0;p{let f=(g+x*t)*4;return n[f]/255};i.width=t,i.height=r,s.drawImage(e.img,0,0,t,r);let u=s.getImageData(0,0,t,r),m=u.data;for(let g=0;g{let t=R()??E()??Texture.getDefault();if(!t)return;let r=$(t,a,!1);if(!r){Blockbench.showQuickMessage("Failed to generate normal map",2e3);return}r.select(e),new k(t instanceof Texture&&t.layers_enabled?t.layers:null,t.uuid).saveTexture(h.normal,r),Blockbench.showQuickMessage("Normal map generated",2e3)};y.push(()=>{o.generateDirectXNormal=new Action("generate_dx_normal",{icon:h.normal.icon??"altitude",name:"Generate DirectX Normal Map",description:"Generates a DirectX normal map from the height map",condition:()=>(R()??E())!==null,click:e=>fe(e)}),o.generateOpenGlNormal=new Action("generate_opengl_normal",{icon:h.normal.icon??"altitude",name:"Generate OpenGL Normal Map",description:"Generates an OpenGL normal map from the height map",condition:()=>(R()??E())!==null,click:e=>fe(e,"OpenGL")}),o.generateAo=new Action("generate_ao",{icon:h.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let e=R()??E()??Texture.getDefault();if(!e)return;let a=new k(e instanceof Texture&&e.layers_enabled?e.layers:null,e.uuid),t=a.findTexture(h.normal)??$(e);if(!t){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=ge(t);if(r){a.saveTexture(h.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),o.generateNormal=new Action("generate_normal",{children:[o.generateDirectXNormal,o.generateOpenGlNormal],name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(R()??E())!==null,click(){},icon:h.normal.icon??"altitude"}),MenuBar.addAction(o.generateNormal,"tools"),MenuBar.addAction(o.generateAo,"tools")});C.push(()=>{MenuBar.removeAction("tools.generate_normal"),MenuBar.removeAction("tools.generate_ao")});var Ze=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},We=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};y.push(()=>{o.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let e=E();if(!e)return;let t=new k(e.layers_enabled?e.layers:[e],e.uuid).createLabPbrOutput();if(t===null)return;let r=e.name??(Project?Project.getDisplayName():"texture");await Promise.all([Ze(t.normalMap,pathToName(r)),We(t.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),o.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let e=TextureLayer.selected?.texture??Texture.all.find(t=>t.selected)??Texture.getDefault(),a=new k(e.layers_enabled?e.layers:[e],e.uuid);if(pathToName(e.name).endsWith("_n")){a.createTexturesFromNormal(e);return}if(pathToName(e.name).endsWith("_s")){a.createTexturesFromSpecular(e);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(o.generateLabPbr,"file.export"),MenuBar.addAction(o.decodeLabPbr,"tools")});C.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});y.push(()=>{o.createMaterialTexture=new Action("create_material_texture",{icon:"deployed_code",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let e={...h},a=new Texture({name:"New Material",saved:!1,particle:!1});a.extend({material:!0});let t=Texture.all.filter(s=>(s.selected||s.multi_selected)&&!s.material)??Texture.all,r=E(),n=r?new k(t,r.uuid):null;try{let s=n?.findTexture(h.albedo,!0)?.canvas.toDataURL()??r?.canvas.toDataURL()??Y(new _.Color(8421504),a.canvas);if(!s)return;a.fromDataURL(s);let l=new TextureLayer({name:e.albedo.label,visible:!0,data_url:s,keep_size:!0},a);l.extend({channel:e.albedo.id}),l.addForEditing(),l.texture.updateChangesAfterEdit(),n?.saveTexture(e.albedo,l),delete e.albedo}catch(s){console.warn("Failed to create base color texture",s),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let i=Object.keys(e).reverse().map(s=>{let l=h[s],u=n?.findTexture(l,!0),m=u?u.canvas.toDataURL():Y(l.default??new _.Color(0));if(!m)return;let d=new TextureLayer({name:l.label,visible:!0,data_url:m,keep_size:!0},a);return d.extend({channel:l.id}),n?.saveTexture(l,d),d}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:i}),a.add().select(),a.activateLayers(),i.map(s=>{s.addForEditing(),a.width=Math.max(a.width,s.img.width),a.height=Math.max(a.height,s.img.height)}),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(o.createMaterialTexture,"tools"),Toolbars.texturelist.add(o.createMaterialTexture,3)});C.push(()=>{MenuBar.removeAction("tools.create_material_texture"),Toolbars.texturelist.remove("create_material_texture")});var Q=(e,a)=>{let t=E()??Texture.getDefault(),r=new k(t.layers_enabled?t.layers:Project?Project.textures:null,t.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[i,s]=Project?[e?`${e}_mer`:`${t.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:i,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},a)})};y.push(()=>{o.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{Q()}catch(e){console.error("Failed to export MER map:",e),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),o.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let e=E()??Texture.getDefault(),a=new k([e],e.uuid),t=a.decodeMer(),r=[h.metalness,h.emissive,h.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new Texture({name:`${e?.name}_${i}`,keep_size:!1}).fromDataURL(s.toDataURL());l.add(!0),a.saveTexture(n,l)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>E()?.layers_enabled===!0,click(){let e=E()??Texture.getDefault(),a=new k(e.layers_enabled?e.layers:[e],e.uuid),t=a.decodeMer(),r=[h.metalness,h.emissive,h.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new TextureLayer({name:`${e?.name}_${i}`,data_url:s.toDataURL()},e);a.saveTexture(n,l),l.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(o.decodeMer,"tools"),MenuBar.addAction(o.generateMer,"file.export")});C.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var qe=()=>{Project&&Project.textures.forEach(e=>{let a=new k(null,e.uuid),t=a.findTexture(h.normal,!1),r=a.findTexture(h.height,!1),n=a.findTexture(h.albedo,!1),i=a.findTexture(h.metalness,!1)?.name,s=a.findTexture(h.emissive,!1)?.name,l=a.findTexture(h.roughness,!1)?.name,u={};return n||(u.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!i&&!s&&!l&&(u.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},u.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},u.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),t&&(u.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(u.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),t&&r&&(u.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),o.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:u,cancelIndex:1,onConfirm(m){let d=G(),c=i||s||l,v={format_version:"1.16.100","minecraft:texture_set":{color:(n?d:m.baseColor?.toHexString())??d,metalness_emissive_roughness:[m.metalness??0,m.emissive??0,m.roughness??255]}};m.depthMap==="normal"&&t||!r&&t?v["minecraft:texture_set"].normal=`${d}_normal`:(!t||m.depthMap==="heightmap")&&r&&(v["minecraft:texture_set"].heightmap=`${d}_heightmap`);let g=p=>{if(!m.depthMap)return p();let b=m.depthMap==="normal"||m.depthMap&&!r,M=b?t:r;if(!M)return p();Blockbench.export({content:M.canvas.toDataURL()??"",type:"PNG",name:`${d}_${b?"normal":"heightmap"}`,extensions:["png"],resource_id:m.depthMap,startpath:Project.export_path,savetype:"image"},w=>{v["minecraft:texture_set"][b?"normal":"heightmap"]=pathToName(w,!1),p()})},x=p=>{if(!n)return p();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:d,startpath:Project.export_path,savetype:"image"},b=>{v["minecraft:texture_set"].color=pathToName(b,!1),p()})},f=()=>g(()=>{x(()=>{Blockbench.export({content:JSON.stringify(v,null,2),type:"JSON",name:`${d}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),o.textureSetDialog?.hide()})})});if(c){try{Q(d,p=>{v["minecraft:texture_set"].metalness_emissive_roughness=pathToName(p,!1),f()})}catch(p){console.warn("Failed to export MER map:",p),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}f()}}),o.textureSetDialog.show()})};y.push(()=>{o.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){qe()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(o.createTextureSet,"file.export")});C.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});y.push(()=>{o.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(e){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=e}),Preview.selected.renderer.physicallyCorrectLights=e,Blockbench.showQuickMessage(`Physically corrected lighting is now ${e?"enabled":"disabled"}`,2e3),e&&o.togglePbr?.set(!0),N()},click(){}}),MenuBar.addAction(o.toggleCorrectLights,"preview")});C.push(()=>{MenuBar.removeAction("preview.correct_lights")});var J=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(e=>{e instanceof Cube&&Object.keys(e.faces).forEach(a=>{let r=e.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var xe=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],be=()=>Project&&Project.pbr_active&&N(),Ke=()=>{Blockbench.on(xe.join(" "),be)},ve=()=>{xe.forEach(e=>{Blockbench.removeListener(e,be)})};y.push(()=>{o.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(e){if(e){N(),Ke(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}J(),ve(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(o.togglePbr,"view")});C.push(()=>{ve(),MenuBar.removeAction("view.toggle_pbr")});var _e=e=>{let a=Math.max(-2,Math.min(2,e));Preview.all.forEach(t=>{t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};y.push(()=>{o.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(o.tonemappingSelect?.get())===_.NoToneMapping&&o.tonemappingSelect.change(_.LinearToneMapping.toString()),o.togglePbr?.set(!0)},onChange(e){_e(Number(e))},onAfter(){A()}}),o.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>o.exposureSlider!==void 0&&Number(o.exposureSlider?.get())!==1,click(){_e(1),o.exposureSlider?.setValue(1,!0),A()}}),o.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:_.NoToneMapping,value:Preview.selected.renderer.toneMapping??_.NoToneMapping,icon:"monochrome_photos",options:{[_.NoToneMapping]:"No Tone Mapping",[_.LinearToneMapping]:"Linear",[_.ReinhardToneMapping]:"Reinhard",[_.CineonToneMapping]:"Cineon",[_.NeutralToneMapping]:"Neutral",[_.ACESFilmicToneMapping]:"ACES"},onChange({value:e}){Preview.selected.renderer.toneMapping=Number(e);let a=1;Preview.selected.renderer.toneMapping===_.NoToneMapping?o.exposureSlider?.setValue(a,!0):a=Number(o.exposureSlider?.get()??1),Preview.all.forEach(t=>{t.renderer.toneMapping=Number(e),t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(e)}`,2e3),o.togglePbr&&!o.togglePbr.value&&o.togglePbr.set(!0),N()}})});var ae=class{async parse(a){let t=new le,r="model.usda";t.file(r,"");let n=Te(),i={},s={};a.traverseVisible(m=>{if(!m.isMesh)return;let d=m;if(!d.material.isMeshStandardMaterial){console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",m);return}let c=d.geometry,v=d.material,g="geometries/Geometry_"+c.id+".usd";if(!t.file(g)){let x=rt(c);t.file(g,et(x))}v.uuid in i||(i[v.uuid]=v),n+=tt(d,c,v)}),n+=lt(i,s),t.file(r,n),n=null;for(let m in s){let d=s[m],c=m.split("_")[1],v=d.format===_.RGBAFormat,g=Ye(d.image,c),f=await(await new Promise(p=>g.toBlob(b=>b&&p(b),v?"image/png":"image/jpeg",1))).arrayBuffer();t.file(`textures/Texture_${m}.${v?"png":"jpg"}`,f)}let l=0;t.forEach(async m=>{let d=34+m.length;l+=d;let c=l&63,v=await t.file(m).async("uint8array");if(c!==4){let g=64-c,x=new Uint8Array(g),f=new Uint8Array(v.length+g);f.set(v,0),f.set(x,v.length),t.file(m,f)}l+=v.length});let u=await t.generateAsync({type:"blob",compression:"STORE"});return new Uint8Array(await u.arrayBuffer())}};function Ye(e,a){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=1024/Math.max(e.width,e.height),r=document.createElement("canvas");r.width=e.width*Math.min(1,t),r.height=e.height*Math.min(1,t);let n=r.getContext("2d");if(n.imageSmoothingEnabled=!1,n.drawImage(e,0,0,r.width,r.height),a!==void 0){let i=parseInt(a,16),s=(i>>16&255)/255,l=(i>>8&255)/255,u=(i&255)/255,m=n.getImageData(0,0,r.width,r.height),d=m.data;for(let c=0;c ) { @@ -17,32 +17,32 @@ rel material:binding = } -`}function et(e){let a=e.elements;return`( ${G(a,0)}, ${G(a,4)}, ${G(a,8)}, ${G(a,12)} )`}function G(e,a){return`(${e[a+0]}, ${e[a+1]}, ${e[a+2]}, ${e[a+3]})`}function tt(e){return` +`}function at(e){let a=e.elements;return`( ${X(a,0)}, ${X(a,4)}, ${X(a,8)}, ${X(a,12)} )`}function X(e,a){return`(${e[a+0]}, ${e[a+1]}, ${e[a+2]}, ${e[a+3]})`}function rt(e){return` def "Geometry" { - ${at(e)} + ${nt(e)} } -`}function at(e){let a="Geometry",t=e.attributes,r=t.position.count;return` +`}function nt(e){let a="Geometry",t=e.attributes,r=t.position.count;return` def Mesh "${a}" { - int[] faceVertexCounts = [${rt(e)}] - int[] faceVertexIndices = [${nt(e)}] - normal3f[] normals = [${fe(t.normal,r)}] ( + int[] faceVertexCounts = [${st(e)}] + int[] faceVertexIndices = [${ot(e)}] + normal3f[] normals = [${Me(t.normal,r)}] ( interpolation = "vertex" ) - point3f[] points = [${fe(t.position,r)}] - float2[] primvars:st = [${st(t.uv,r)}] ( + point3f[] points = [${Me(t.position,r)}] + float2[] primvars:st = [${it(t.uv,r)}] ( interpolation = "vertex" ) uniform token subdivisionScheme = "none" } -`}function rt(e){let a=e.index!==null?e.index.count:e.attributes.position.count;return Array(a/3).fill(3).join(", ")}function nt(e){let a=e.index,t=[];if(a!==null)for(let r=0;r - float2 inputs:scale = ${be(l.repeat)} - float2 inputs:translation = ${be(l.offset)} + float2 inputs:scale = ${we(l.repeat)} + float2 inputs:translation = ${we(l.offset)} float2 outputs:result } - def Shader "Texture_${l.id}_${m}" + def Shader "Texture_${l.id}_${u}" { uniform token info:id = "UsdUVTexture" - asset inputs:file = @textures/Texture_${d}.${u?"png":"jpg"}@ - float2 inputs:st.connect = + asset inputs:file = @textures/Texture_${d}.${c?"png":"jpg"}@ + float2 inputs:st.connect = token inputs:wrapS = "repeat" token inputs:wrapT = "repeat" float outputs:r float outputs:g float outputs:b float3 outputs:rgb - }`}let s=e;if(s.map!==null?(r.push(`${t}color3f inputs:diffuseColor.connect = `),n.push(i(s.map,"diffuse",s.color))):r.push(`${t}color3f inputs:diffuseColor = ${xe(s.color)}`),s.emissiveMap!==null?(r.push(`${t}color3f inputs:emissiveColor.connect = `),n.push(i(s.emissiveMap,"emissive"))):s.emissive.getHex()>0&&r.push(`${t}color3f inputs:emissiveColor = ${xe(s.emissive)}`),s.normalMap!==null&&(r.push(`${t}normal3f inputs:normal.connect = `),n.push(i(s.normalMap,"normal"))),s.aoMap!==null&&(r.push(`${t}float inputs:occlusion.connect = `),n.push(i(s.aoMap,"occlusion"))),s.roughnessMap!==null&&s.roughness===1?(r.push(`${t}float inputs:roughness.connect = `),n.push(i(s.roughnessMap,"roughness"))):r.push(`${t}float inputs:roughness = ${s.roughness}`),s.metalnessMap!==null&&s.metalness===1?(r.push(`${t}float inputs:metallic.connect = `),n.push(i(s.metalnessMap,"metallic"))):r.push(`${t}float inputs:metallic = ${s.metalness}`),s.alphaMap!==null?(r.push(`${t}float inputs:opacity.connect = `),r.push(`${t}float inputs:opacityThreshold = 0.0001`),n.push(i(s.alphaMap,"opacity"))):r.push(`${t}float inputs:opacity = ${s.opacity}`),s.isMeshPhysicalMaterial){let l=s;r.push(`${t}float inputs:clearcoat = ${l.clearcoat}`),r.push(`${t}float inputs:clearcoatRoughness = ${l.clearcoatRoughness}`),r.push(`${t}float inputs:ior = ${l.ior}`)}return` + }`}let s=e;if(s.map!==null?(r.push(`${t}color3f inputs:diffuseColor.connect = `),n.push(i(s.map,"diffuse",s.color))):r.push(`${t}color3f inputs:diffuseColor = ${ye(s.color)}`),s.emissiveMap!==null?(r.push(`${t}color3f inputs:emissiveColor.connect = `),n.push(i(s.emissiveMap,"emissive"))):s.emissive.getHex()>0&&r.push(`${t}color3f inputs:emissiveColor = ${ye(s.emissive)}`),s.normalMap!==null&&(r.push(`${t}normal3f inputs:normal.connect = `),n.push(i(s.normalMap,"normal"))),s.aoMap!==null&&(r.push(`${t}float inputs:occlusion.connect = `),n.push(i(s.aoMap,"occlusion"))),s.roughnessMap!==null&&s.roughness===1?(r.push(`${t}float inputs:roughness.connect = `),n.push(i(s.roughnessMap,"roughness"))):r.push(`${t}float inputs:roughness = ${s.roughness}`),s.metalnessMap!==null&&s.metalness===1?(r.push(`${t}float inputs:metallic.connect = `),n.push(i(s.metalnessMap,"metallic"))):r.push(`${t}float inputs:metallic = ${s.metalness}`),s.alphaMap!==null?(r.push(`${t}float inputs:opacity.connect = `),r.push(`${t}float inputs:opacityThreshold = 0.0001`),n.push(i(s.alphaMap,"opacity"))):r.push(`${t}float inputs:opacity = ${s.opacity}`),s.isMeshPhysicalMaterial){let l=s;r.push(`${t}float inputs:clearcoat = ${l.clearcoat}`),r.push(`${t}float inputs:clearcoatRoughness = ${l.clearcoatRoughness}`),r.push(`${t}float inputs:ior = ${l.ior}`)}return` def Material "Material_${s.id}" { def Shader "PreviewSurface" @@ -93,8 +93,8 @@ ${n.join(` `)} } -`}function xe(e){return`(${e.r}, ${e.g}, ${e.b})`}function be(e){return`(${e.x}, ${e.y})`}var _e=K;y.push(()=>{let e=new Codec("usdz",{extension:"usdz",name:"USDZ",remember:!0,export_options:{},fileName(){return $()+".usdz"},async compile(a={}){if(!Project)throw new Error("No project loaded");R();let t=Object.assign(this.getExportOptions(),a),r=new _e,n=new v.Scene;n.name="blockbench_export",n.add(Project.model_3d);let i=await r.parse(n);return this.dispatchEvent("compile",{model:i,options:t}),Canvas.scene.add(Project.model_3d),i},async export(){let a=await this.compile();Blockbench.export({content:a,name:this.fileName(),startpath:this.startPath(),resource_id:"usdz",type:this.name,extensions:["usdz"],savetype:"buffer"},t=>this.afterDownload(t))}});o.exportUsdz=new Action("export_usdz",{category:"file",name:"Export USDZ",description:"Exports the current model as a USDZ file",icon:"stacks",async click(){e&&await e.export()}}),o.usdz=e,MenuBar.addAction(o.exportUsdz,"file.export")});C.push(()=>{MenuBar.removeAction("file.export_usdz")});var Me="1.0.0";y.push(()=>{o.bbmat=new Codec("material",{name:"Blockbench Material",extension:"bbmat",remember:!1,load_filter:{extensions:["bbmat"],type:"json"},compile(e){if(!Texture.selected?.material||!Texture.selected?.layers_enabled)return;let a=Texture.selected.layers.map(r=>{let n=r.channel,i=r.canvas.toDataURL();return[n,i]}),t=new j(Texture.selected.layers,Texture.selected.uuid);return a.push(["preview",t.renderMaterialPreview()]),JSON.stringify({version:Me,channels:Object.fromEntries(a)})},parse(e,a){return e=typeof e=="string"?JSON.parse(e):e,e.version!==Me?{}:e.channels},load(e,a,t){if(!Project)return;let r=this.parse(e,a.path),n=Object.keys(r);if(!n.length)throw new Error("No valid channels found in the material");let i=r[g.albedo.id]??r[n[0]];n.includes("preview")&&(i=r.preview);let s=new Texture({name:pathToName(a.name),saved:!0,particle:!1,source:i,layers_enabled:!0});s.extend({material:!0});let l=n.map(m=>{if(!(m in g))return null;let h=r[m],d=new TextureLayer({name:m,data_url:h,visible:!0},s);return d.extend({channel:m}),d}).filter(Boolean);if(!l.length)throw new Error("No valid channel layers found in the material");i||s.fromDataURL(l[0].canvas.toDataURL()),s.add().select(),l.forEach(m=>{m.addForEditing(),s.width=Math.max(s.width,m.img.width),s.height=Math.max(s.height,m.img.height)}),s.updateChangesAfterEdit()},export(){Blockbench.export({resource_id:"material",type:this.name,extensions:[this.extension],name:`${Texture.selected?.name??this.fileName??"material"}.bbmat`,startpath:this.startPath(),content:this.compile()},e=>this.afterDownload(e))}}),o.bbMatExport=new Action("export_bbmat",{icon:"stacks",name:"Save as .bbmat",category:"file",condition:{project:!0,selected:{texture:!0},method(){return Texture.selected?.material}},click(){!o.bbmat?.write||!o.bbmat?.compile||o.bbmat.export&&o.bbmat.export()}}),o.bbMatImport=new Action("import_bbmat",{icon:"stacks",name:"Import .bbmat",category:"file",condition:{project:!0},click(){Blockbench.import({extensions:["bbmat"],type:"json",title:"Import .bbmat",multiple:!0},e=>{o.bbmat?.load&&e.forEach(a=>{o.bbmat.load(a.content,a,!0)})})}}),o.bbmat.export_action=o.bbMatExport,Texture.prototype.menu.addAction(o.bbMatExport),MenuBar.addAction(o.bbMatImport,"file.import")});C.push(()=>{Texture.prototype.menu.removeAction("export_bbmat"),MenuBar.removeAction("file.import.import_bbmat")});var V=class e{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(g).map(t=>[t,g[t].default??new v.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([t,r])=>[t,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let t=Math.min(1,Math.max(0,a));return new v.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let a="#000000",t=Number(o.brushMetalnessSlider?.get()),r=Number(o.brushRoughnessSlider?.get()??1),n=(o.brushEmissiveColor?.get()??a).toString(),i=Number(o.brushHeightSlider?.get()),s=ColorPanel.get(),l={[g.albedo.id]:new v.Color(s),[g.metalness.id]:e.makeLinearColor(t),[g.roughness.id]:e.makeLinearColor(r),[g.emissive.id]:new v.Color(n??a),[g.height.id]:e.makeLinearColor(i),[g.normal.id]:g.normal.default??new v.Color("#8080ff")};return new e({colors:l})}};var ye="materialBrushPresets",Y=()=>JSON.parse(localStorage.getItem(ye)||"{}"),lt=(e,a)=>{let t=Y(),r=a??guid(),n=o.userMaterialBrushPresets?.getFormResult()??{},i={};return n.albedo&&(i.albedo=n.albedo.toString()),n.metalness&&(i.metalness=Number(n.metalness)),n.roughness&&(i.roughness=Number(n.roughness)),n.emissive&&(i.emissive=n.emissive.toString()),n.height&&(i.height=Number(n.height)),t[r]=[i,e??"New Preset",U(i)],localStorage.setItem(ye,JSON.stringify(t)),r},we=({metalness:e,roughness:a,emissive:t,height:r,albedo:n})=>{e!==void 0&&o.brushMetalnessSlider?.setValue(e||0,!0),a!==void 0&&o.brushRoughnessSlider?.setValue(a??1,!0),t!==void 0&&o.brushEmissiveColor?.set(t??"#000000"),r!==void 0&&o.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},Q=({id:e})=>Condition({project:!0,tools:["material_brush"],method(){let a=k();return(a?.layers_enabled&&a.layers.find(({channel:t})=>t&&t===e)!==void 0)===!0}}),ct=re.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:g}},methods:{applyPreset(e){try{let[a,t]=this.userPresets[e],{metalness:r,roughness:n,emissive:i,height:s,albedo:l}=a;we({metalness:Number(r),roughness:Number(n),emissive:i.toString(),height:Number(s),albedo:l.toString()}),o.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${t}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(e){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let t=Y(),r=this.userPresets[e][1]??e;delete t[e],localStorage.setItem("materialBrushPresets",JSON.stringify(t)),this.userPresets=t,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(e){o.userMaterialBrushPresets?.setFormValues({name:this.userPresets[e][1]??e,...this.userPresets[e][0]})},getSummary(e){return Object.entries(e).filter(([a])=>a in this.channels).map(([a,t])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${t}`:`${this.channels[a]?.label??a}: ${Number(t).toFixed(1)}`).join(` -`)}},computed:{presets(){return Object.entries(this.userPresets)}},mounted(){this.userPresets=Y()},template:` +`}function ye(e){return`(${e.r}, ${e.g}, ${e.b})`}function we(e){return`(${e.x}, ${e.y})`}var Ce=ae;y.push(()=>{let e=new Codec("usdz",{extension:"usdz",name:"USDZ",remember:!0,export_options:{normal_type:{type:"select",label:"Normal Map Type",default:"opengl",options:{opengl:"OpenGL",directx:"DirectX"}}},fileName(){return G()+".usdz"},async compile(a={}){if(!Project)throw new Error("No project loaded");let t=Object.assign(this.getExportOptions(),a);Project.textures.forEach(s=>{if(!s.material)return;let l=new k(s.layers,s.uuid),u=l.findTexture("normal",!0);if(!u)return;let m=$(u,t.normal_type);m&&l.saveTexture(h.normal,m)}),N();let r=new Ce,n=new _.Scene;n.name="blockbench_export",n.add(Project.model_3d);let i=await r.parse(n);return this.dispatchEvent("compile",{model:i,options:t}),Canvas.scene.add(Project.model_3d),i},async export(a={}){let t=await this.compile(a);Blockbench.export({content:t,name:this.fileName(),startpath:this.startPath(),resource_id:"usdz",type:this.name,extensions:["usdz"],savetype:"buffer"},r=>this.afterDownload(r))}});o.exportUsdz=new Action("export_usdz",{category:"file",name:"Export USDZ",description:"Exports the current model as a USDZ file",icon:"stacks",async click(){if(!e)return;let a=await e.promptExportOptions();await e.export(a)}}),o.usdz=e,MenuBar.addAction(o.exportUsdz,"file.export")});C.push(()=>{MenuBar.removeAction("file.export_usdz")});y.push(()=>{o.bbmat=new Codec("material",{name:"Blockbench Material",extension:"bbmat",remember:!1,load_filter:{extensions:["bbmat"],type:"json"},compile(){if(!Texture.selected?.material||!Texture.selected?.layers_enabled)return;let e=Texture.selected.layers.map(a=>{let t=a.channel,r=a.canvas.toDataURL();return[t,r]});return JSON.stringify({version:K,channels:Object.fromEntries(e)})},parse(e,a){return e=typeof e=="string"?JSON.parse(e):e,e.version!==K?(Blockbench.showMessageBox({title:"Invalid Blockbench Material Version",message:`The material file "${a}" is not compatible with version ${F} of the PBR plugin.`,buttons:["OK"],confirm:0,width:400,cancel:0,checkboxes:{}},()=>null),{}):e.channels},load(e,a,t){if(!Project)return;let r=this.parse(e,a.path),n=Object.keys(r);if(!n.length)throw new Error("No valid channels found in the material");let i=r[h.albedo.id]??r[n[0]];n.includes("preview")&&(i=r.preview);let s=new Texture({name:pathToName(a.name),saved:!0,particle:!1,source:i,layers_enabled:!0});s.extend({material:!0});let l=n.map(u=>{if(!(u in h))return null;let m=r[u],d=new TextureLayer({name:u,data_url:m,visible:!0},s);return d.extend({channel:u}),d}).filter(Boolean);if(!l.length)throw new Error("No valid channel layers found in the material");i||s.fromDataURL(l[0].canvas.toDataURL()),s.add().select(),l.forEach(u=>{u.addForEditing(),s.width=Math.max(s.width,u.img.width),s.height=Math.max(s.height,u.img.height)}),s.updateChangesAfterEdit()},export(){Blockbench.export({resource_id:"material",type:this.name,extensions:[this.extension],name:`${Texture.selected?.name??this.fileName??"material"}.bbmat`,startpath:this.startPath(),content:this.compile()},e=>this.afterDownload(e))}}),o.bbMatExport=new Action("export_bbmat",{icon:"stacks",name:"Save as .bbmat",category:"file",condition:{project:!0,selected:{texture:!0},method(){return Texture.selected?.material}},click(){o.bbmat?.export?.()}}),o.bbMatImport=new Action("import_bbmat",{icon:"stacks",name:"Import .bbmat",category:"file",condition:{project:!0},click(){Blockbench.import({extensions:["bbmat"],type:"json",title:"Import .bbmat",multiple:!0},e=>{o.bbmat?.load&&e.forEach(a=>{o.bbmat.load(a.content,a,!0)})})}}),o.bbmat.export_action=o.bbMatExport,Texture.prototype.menu.addAction(o.bbMatExport),MenuBar.addAction(o.bbMatImport,"file.import")});C.push(()=>{Texture.prototype.menu.removeAction("export_bbmat"),MenuBar.removeAction("file.import.import_bbmat")});var Z=class e{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(h).map(t=>[t,h[t].default??new _.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([t,r])=>[t,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let t=Math.min(1,Math.max(0,a));return new _.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let a="#000000",t=Number(o.brushMetalnessSlider?.get()),r=Number(o.brushRoughnessSlider?.get()??1),n=(o.brushEmissiveColor?.get()??a).toString(),i=Number(o.brushHeightSlider?.get()),s=ColorPanel.get(),l={[h.albedo.id]:new _.Color(s),[h.metalness.id]:e.makeLinearColor(t),[h.roughness.id]:e.makeLinearColor(r),[h.emissive.id]:new _.Color(n??a),[h.height.id]:e.makeLinearColor(i)};return new e({colors:l})}};var Ee="materialBrushPresets",re=()=>JSON.parse(localStorage.getItem(Ee)||"{}"),ut=(e,a)=>{let t=re(),r=a??guid(),n=o.userMaterialBrushPresets?.getFormResult()??{},i={};return n.albedo&&(i.albedo=n.albedo.toString()),n.metalness&&(i.metalness=Number(n.metalness)),n.roughness&&(i.roughness=Number(n.roughness)),n.emissive&&(i.emissive=n.emissive.toString()),n.height&&(i.height=Number(n.height)),t[r]=[i,e??"New Preset",z(i)],localStorage.setItem(Ee,JSON.stringify(t)),r},Pe=({metalness:e,roughness:a,emissive:t,height:r,albedo:n})=>{e!==void 0&&o.brushMetalnessSlider?.setValue(e||0,!0),a!==void 0&&o.brushRoughnessSlider?.setValue(a??1,!0),t!==void 0&&o.brushEmissiveColor?.set(t??"#000000"),r!==void 0&&o.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},W=({id:e})=>Condition({project:!0,tools:["material_brush"],method(){let a=E();return(a?.layers_enabled&&a.layers.find(({channel:t})=>t&&t===e)!==void 0)===!0}}),mt=ie.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:h}},methods:{applyPreset(e){try{let[a,t]=this.userPresets[e],{metalness:r,roughness:n,emissive:i,height:s,albedo:l}=a;Pe({metalness:Number(r),roughness:Number(n),emissive:i.toString(),height:Number(s),albedo:l.toString()}),o.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${t}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(e){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let t=re(),r=this.userPresets[e][1]??e;delete t[e],localStorage.setItem("materialBrushPresets",JSON.stringify(t)),this.userPresets=t,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(e){o.userMaterialBrushPresets?.setFormValues({name:this.userPresets[e][1]??e,...this.userPresets[e][0]})},getSummary(e){return Object.entries(e).filter(([a])=>a in this.channels).map(([a,t])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${t}`:`${this.channels[a]?.label??a}: ${Number(t).toFixed(1)}`).join(` +`)}},computed:{presets(){return Object.entries(this.userPresets)}},mounted(){this.userPresets=re()},template:`
      • Q(g.metalness)}),o.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",tool_setting:"brush_roughness",settings:{min:0,max:1,step:.01,default:1},condition:()=>Q(g.roughness)}),o.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",tool_setting:"brush_emissive",condition:()=>Q(g.emissive)}),o.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",tool_setting:"brush_height",settings:{min:0,max:1,step:.01,default:.5},condition:()=>Q(g.height)}),o.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",category:"tools",toolbar:"brush",condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){return k()?.layers_enabled??!1}},allowed_view_modes:"textured",tool_settings:{brush_metalness:0,brush_roughness:1,brush_emissive:"#000000",brush_height:.5},brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(e,a,t,r,{size:n,softness:i,texture:s,x:l,y:m}){let h=V.fromSettings(),d=Object.keys(h.colors),u=Math.floor(n-i*n/100),b=t;return s.layers.forEach(p=>{if(!p.visible||!d.includes(p.channel))return;let f=h.getChannel(p.channel);if(!f)return;let c=Math.sqrt((l-e)**2+(m-a)**2),x=Math.min(1,c/u);if(l%u<=x&&m%u<=x){let _=p.ctx.getImageData(e,a,1,1).data,M=new v.Color(`rgb(${_[0]}, ${_[1]}, ${_[2]})`);f.lerp(M,1)}p.ctx.fillStyle=f.getStyle(),p.ctx.fillRect(e,a,1,1),p.selected&&(b={r:f.r*255,g:f.g*255,b:f.b*255,a:r*255})}),b}},onCanvasClick(e){Painter.startPaintToolCanvas(e,e.event)},onSelect(){Painter.updateNslideValues(),R()},click(){N()}}),o.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:{project:!0},click(){o.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:ct,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(e){we({metalness:Number(e.metalness??o.brushMetalnessSlider?.get()),roughness:Number(e.roughness??o.brushRoughnessSlider?.get()),emissive:(e.emissive??o.brushEmissiveColor?.get()).toString(),height:Number(e.height??o.brushHeightSlider?.get()),albedo:(e.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(e,a){o.materialBrushTool?.select(),e===1&&Blockbench.textPrompt("Save Preset","New Preset",t=>{t&&(lt(t),Blockbench.showQuickMessage(`Preset "${t}" saved`,2e3))})}}).show()}}),MenuBar.addAction(o.materialBrushTool,"tools.0")});C.push(()=>{MenuBar.removeAction("tools.material_brush")});y.push(()=>{o.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","load_brush_preset","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Settings"})],condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});y.push(()=>{o.displaySettingsPanel=new Panel("display_settings",{name:"PBR Controls",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure","show_channel_select_menu"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});var J=e=>e.visible&&e.channel&&e.channel!==B,ut=()=>{let e=A();if(e)return e.texture.layers.filter(J);let a=k();return a?a.layers_enabled?a.layers.filter(J):Texture.all.map(t=>t.layers_enabled?[...t.layers.filter(J)]:[J(t)?t:null]).flat().filter(Boolean):[]},Te=["select_texture","update_texture_selection","finish_edit","add_texture"],Ce=()=>{Panels.channels_panel.inside_vue.textures=ut()};y.push(()=>{o.channelsPanelStyle=Blockbench.addCSS(` + }`),o.brushMetalnessSlider=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",tool_setting:"brush_metalness",settings:{min:0,max:1,step:.01,default:0},condition:()=>W(h.metalness)}),o.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",tool_setting:"brush_roughness",settings:{min:0,max:1,step:.01,default:1},condition:()=>W(h.roughness)}),o.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",tool_setting:"brush_emissive",condition:()=>W(h.emissive)}),o.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",tool_setting:"brush_height",settings:{min:0,max:1,step:.01,default:.5},condition:()=>W(h.height)}),o.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",category:"tools",toolbar:"brush",condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){return E()?.layers_enabled??!1}},allowed_view_modes:"textured",tool_settings:{brush_metalness:0,brush_roughness:1,brush_emissive:"#000000",brush_height:.5},brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(e,a,t,r,{size:n,softness:i,texture:s,x:l,y:u}){let m=Z.fromSettings(),d=Object.keys(m.colors),c=Math.floor(n-i*n/100),v=t;return s.layers.forEach(g=>{if(!g.visible||!d.includes(g.channel))return;let x=m.getChannel(g.channel);if(!x)return;let f=Math.sqrt((l-e)**2+(u-a)**2),p=Math.min(1,f/c);if(l%c<=p&&u%c<=p){let b=g.ctx.getImageData(e,a,1,1).data,M=new _.Color(`rgb(${b[0]}, ${b[1]}, ${b[2]})`);x.lerp(M,1)}g.ctx.fillStyle=x.getStyle(),g.ctx.fillRect(e,a,1,1),g.selected&&(v={r:x.r*255,g:x.g*255,b:x.b*255,a:r*255})}),v}},onCanvasClick(e){Painter.startPaintToolCanvas(e,e.event)},onSelect(){Painter.updateNslideValues(),N()},click(){A()}}),o.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:{project:!0},click(){o.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:mt,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(e){Pe({metalness:Number(e.metalness??o.brushMetalnessSlider?.get()),roughness:Number(e.roughness??o.brushRoughnessSlider?.get()),emissive:(e.emissive??o.brushEmissiveColor?.get()).toString(),height:Number(e.height??o.brushHeightSlider?.get()),albedo:(e.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(e,a){o.materialBrushTool?.select(),e===1&&Blockbench.textPrompt("Save Preset","New Preset",t=>{t&&(ut(t),Blockbench.showQuickMessage(`Preset "${t}" saved`,2e3))})}}).show()}}),MenuBar.addAction(o.materialBrushTool,"tools.0")});C.push(()=>{MenuBar.removeAction("tools.material_brush")});y.push(()=>{o.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","load_brush_preset","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Settings"})],condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});y.push(()=>{o.displaySettingsPanel=new Panel("display_settings",{name:"PBR Controls",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure","show_channel_select_menu"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});var q=e=>e.visible&&e.channel&&e.channel!==B,dt=()=>{let e=R();if(e)return e.texture.layers.filter(q);let a=E();return a?a.layers_enabled?a.layers.filter(q):Texture.all.map(t=>t.layers_enabled?[...t.layers.filter(q)]:[q(t)?t:null]).flat().filter(Boolean):[]},Le=["select_texture","update_texture_selection","finish_edit","add_texture"],De=()=>{Panels.channels_panel.inside_vue.textures=dt()};y.push(()=>{o.channelsPanelStyle=Blockbench.addCSS(` .texture_channel { color: var(--color-text); flex: 1; @@ -263,7 +263,7 @@ ${n.join(` border-top: 1px solid var(--color-border); padding-right: 0; } - `),o.channelsPanel=new Panel("channels_panel",{name:"PBR Channels",id:"channels_panel",icon:"gallery_thumbnail",condition:{project:!0,selected:{texture:!0},modes:["paint","edit"]},toolbars:[],component:{name:"ChannelsPanel",data(){return{channels:g,textures:[]}},methods:{openMenu(e){o.channelMenu?.open(e)},selectTexture(e){Modes.options.paint.select(),e.select(),e.scrollTo()},channelEnabled(e){return e.channel&&e.channel!==B&&e.channel in this.channels},getImgSrc(e){return e.img?.src??`data:image/png;base64,${e.canvas.toDataURL()}`}},template:` + `),o.channelsPanel=new Panel("channels_panel",{name:"PBR Channels",id:"channels_panel",icon:"gallery_thumbnail",condition:{project:!0,selected:{texture:!0},modes:["paint","edit"]},toolbars:[],component:{name:"ChannelsPanel",data(){return{channels:h,textures:[]}},methods:{openMenu(e){o.channelMenu?.open(e)},selectTexture(e){Modes.options.paint.select(),e.select(),e.scrollTo()},channelEnabled(e){return e.channel&&e.channel!==B&&e.channel in this.channels},getImgSrc(e){return e.img?.src??`data:image/png;base64,${e.canvas.toDataURL()}`}},template:`
        -
        `},expand_button:!0,growable:!0,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:350,folded:!0},insert_after:"layers",insert_before:"color"}),Blockbench.on(Te.join(" "),Ce)});C.push(()=>{Te.forEach(e=>{Blockbench.removeListener(e,Ce)})});(()=>{let e=()=>{y.forEach(t=>t())},a=()=>{z(),C.forEach(t=>t()),Object.entries(o).forEach(([t,r])=>{try{r?.delete()}catch(n){console.warn(`Failed to delete ${t} action:`,n)}})};BBPlugin.register("pbr_preview",{version:"1.1.0",title:"PBR Tools",author:"Jason J. Gardner",description:"Create and view PBR materials in Blockbench. Export textures for Java and RenderDragon shaders.",tags:["Minecraft: Java Edition","Minecraft: Bedrock Edition","PBR"],icon:"icon.png",variant:"both",await_loading:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.3",onload:e,onunload:a})})();})(); +
      `},expand_button:!0,growable:!0,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:350,folded:!0},insert_after:"layers",insert_before:"color"}),Blockbench.on(Le.join(" "),De)});C.push(()=>{Le.forEach(e=>{Blockbench.removeListener(e,De)})});(()=>{let e=()=>{y.forEach(t=>t())},a=()=>{J(),C.forEach(t=>t()),Object.entries(o).forEach(([t,r])=>{try{r?.delete()}catch(n){console.warn(`Failed to delete ${t} action:`,n)}})};BBPlugin.register("pbr_preview",{version:F,title:"PBR Tools",author:"Jason J. Gardner",description:"Create and view PBR materials in Blockbench. Export USDZ scenes and textures for Java or RenderDragon shaders.",tags:["Minecraft: Java Edition","Minecraft: Bedrock Edition","PBR"],icon:"icon.png",variant:"both",await_loading:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.3",onload:e,onunload:a})})();})(); diff --git a/src/pbr_preview/src/constants.ts b/src/pbr_preview/src/constants.ts index 736d4b5c..07a00a55 100644 --- a/src/pbr_preview/src/constants.ts +++ b/src/pbr_preview/src/constants.ts @@ -1,6 +1,8 @@ import type { IChannel, IRegistry } from "./types"; import { three as THREE } from "./deps"; +export const PLUGIN_VERSION = "1.2.0"; +export const BBMAT_VERSION = "1.0.0"; export const NA_CHANNEL = "_NONE_"; export const CHANNELS: Record = { albedo: { diff --git a/src/pbr_preview/src/index.ts b/src/pbr_preview/src/index.ts index 949f8211..b66fc9cc 100644 --- a/src/pbr_preview/src/index.ts +++ b/src/pbr_preview/src/index.ts @@ -7,7 +7,12 @@ /// /// -import { registry, setups, teardowns } from "./constants"; +import { + registry, + setups, + teardowns, + PLUGIN_VERSION as version, +} from "./constants"; import "./lib/properties"; import "./lib/actions"; import "./lib/tools"; @@ -33,11 +38,11 @@ import { disablePbr } from "./lib/disablePbr"; BBPlugin.register("pbr_preview", { // @ts-expect-error Version does exist in PluginOptions - version: "1.1.0", + version, title: "PBR Tools", author: "Jason J. Gardner", description: - "Create and view PBR materials in Blockbench. Export textures for Java and RenderDragon shaders.", + "Create and view PBR materials in Blockbench. Export USDZ scenes and textures for Java or RenderDragon shaders.", tags: ["Minecraft: Java Edition", "Minecraft: Bedrock Edition", "PBR"], icon: "icon.png", variant: "both", diff --git a/src/pbr_preview/src/lib/MaterialBrush.ts b/src/pbr_preview/src/lib/MaterialBrush.ts index f3649b97..28e59c1a 100644 --- a/src/pbr_preview/src/lib/MaterialBrush.ts +++ b/src/pbr_preview/src/lib/MaterialBrush.ts @@ -17,7 +17,7 @@ export class MaterialBrush { Object.keys(CHANNELS).map((key) => [ key, CHANNELS[key].default ?? new THREE.Color(0xffffff00), - ]), + ]) ), ...colors, }; @@ -65,8 +65,6 @@ export class MaterialBrush { [CHANNELS.roughness.id]: MaterialBrush.makeLinearColor(roughnessValue), [CHANNELS.emissive.id]: new THREE.Color(emissiveValue ?? defaultEmissive), [CHANNELS.height.id]: MaterialBrush.makeLinearColor(heightValue), - [CHANNELS.normal.id]: - CHANNELS.normal.default ?? new THREE.Color("#8080ff"), }; return new MaterialBrush({ colors }); diff --git a/src/pbr_preview/src/lib/actions/generateNormal.ts b/src/pbr_preview/src/lib/actions/generateNormal.ts index 3df17d9e..dcc0d36e 100644 --- a/src/pbr_preview/src/lib/actions/generateNormal.ts +++ b/src/pbr_preview/src/lib/actions/generateNormal.ts @@ -4,38 +4,51 @@ import PbrMaterial from "../PbrMaterials"; import { getSelectedLayer, getSelectedTexture } from "../util"; import { createNormalMap, createAoMap } from "../normalMap"; -setups.push(() => { - registry.generateNormal = new Action("generate_normal", { - icon: CHANNELS.normal.icon ?? "altitude", - name: "Generate Normal Map", - description: "Generates a normal map from the height map", - condition: () => (getSelectedLayer() ?? getSelectedTexture()) !== null, - click(e) { - const texture: Texture | TextureLayer = - getSelectedLayer() ?? getSelectedTexture() ?? Texture.getDefault(); +const generateNormal = ( + e: Event, + orientation: "OpenGL" | "DirectX" = "DirectX" +) => { + const texture: Texture | TextureLayer = + getSelectedLayer() ?? getSelectedTexture() ?? Texture.getDefault(); - if (!texture) { - return; - } + if (!texture) { + return; + } - const normalMap = createNormalMap(texture); + const normalMap = createNormalMap(texture, orientation, false); - if (!normalMap) { - Blockbench.showQuickMessage("Failed to generate normal map", 2000); - return; - } + if (!normalMap) { + Blockbench.showQuickMessage("Failed to generate normal map", 2000); + return; + } - normalMap.select(e); + normalMap.select(e); - new PbrMaterial( - texture instanceof Texture && texture.layers_enabled - ? texture.layers - : null, - texture.uuid - ).saveTexture(CHANNELS.normal, normalMap); + new PbrMaterial( + texture instanceof Texture && texture.layers_enabled + ? texture.layers + : null, + texture.uuid + ).saveTexture(CHANNELS.normal, normalMap); - Blockbench.showQuickMessage("Normal map generated", 2000); - }, + Blockbench.showQuickMessage("Normal map generated", 2000); +}; + +setups.push(() => { + registry.generateDirectXNormal = new Action("generate_dx_normal", { + icon: CHANNELS.normal.icon ?? "altitude", + name: "Generate DirectX Normal Map", + description: "Generates a DirectX normal map from the height map", + condition: () => (getSelectedLayer() ?? getSelectedTexture()) !== null, + click: (e) => generateNormal(e), + }); + + registry.generateOpenGlNormal = new Action("generate_opengl_normal", { + icon: CHANNELS.normal.icon ?? "altitude", + name: "Generate OpenGL Normal Map", + description: "Generates an OpenGL normal map from the height map", + condition: () => (getSelectedLayer() ?? getSelectedTexture()) !== null, + click: (e) => generateNormal(e, "OpenGL"), }); registry.generateAo = new Action("generate_ao", { @@ -91,10 +104,20 @@ setups.push(() => { }, }); + registry.generateNormal = new Action("generate_normal", { + children: [registry.generateDirectXNormal, registry.generateOpenGlNormal], + name: "Generate Normal Map", + description: "Generates a normal map from the height map", + condition: () => (getSelectedLayer() ?? getSelectedTexture()) !== null, + click() {}, + icon: CHANNELS.normal.icon ?? "altitude", + }); + MenuBar.addAction(registry.generateNormal, "tools"); MenuBar.addAction(registry.generateAo, "tools"); }); teardowns.push(() => { MenuBar.removeAction(`tools.generate_normal`); + MenuBar.removeAction(`tools.generate_ao`); }); diff --git a/src/pbr_preview/src/lib/actions/usdz.ts b/src/pbr_preview/src/lib/actions/usdz.ts index 94fe5cfb..27f6a7ca 100644 --- a/src/pbr_preview/src/lib/actions/usdz.ts +++ b/src/pbr_preview/src/lib/actions/usdz.ts @@ -1,15 +1,27 @@ -import { registry, setups, teardowns } from "../../constants"; +import { CHANNELS, registry, setups, teardowns } from "../../constants"; import { three as THREE } from "../../deps"; import { getOutputBaseName } from "../util"; import USDZExporter from "../io/UsdzExporter"; import { applyPbrMaterial } from "../applyPbrMaterial"; +import PbrMaterial from "../PbrMaterials"; +import { createNormalMap } from "../normalMap"; setups.push(() => { const usdz = new Codec("usdz", { extension: "usdz", name: "USDZ", remember: true, - export_options: {}, + export_options: { + normal_type: { + type: "select", + label: "Normal Map Type", + default: "opengl", + options: { + opengl: "OpenGL", + directx: "DirectX", + }, + }, + }, fileName() { return getOutputBaseName() + ".usdz"; }, @@ -17,10 +29,28 @@ setups.push(() => { if (!Project) { throw new Error("No project loaded"); } + const options = Object.assign(this.getExportOptions(), compileOptions); - applyPbrMaterial(); + Project.textures.forEach((texture) => { + if (!texture.material) { + return; + } - const options = Object.assign(this.getExportOptions(), compileOptions); + const mat = new PbrMaterial(texture.layers, texture.uuid); + const normal = mat.findTexture("normal", true); + + if (!normal) { + return; + } + + const normalMap = createNormalMap(normal, options.normal_type); + + if (normalMap) { + mat.saveTexture(CHANNELS.normal, normalMap); + } + }); + + applyPbrMaterial(); const exporter = new USDZExporter(); const scene = new THREE.Scene(); @@ -36,8 +66,8 @@ setups.push(() => { return result; }, - async export() { - const content = await this.compile(); + async export(options = {}) { + const content = await this.compile(options); Blockbench.export( { content, @@ -62,7 +92,8 @@ setups.push(() => { if (!usdz) { return; } - await usdz.export(); + const options = await usdz.promptExportOptions(); + await usdz.export(options); }, }); diff --git a/src/pbr_preview/src/lib/io/bbmat.ts b/src/pbr_preview/src/lib/io/bbmat.ts index 088fd255..f30909bb 100644 --- a/src/pbr_preview/src/lib/io/bbmat.ts +++ b/src/pbr_preview/src/lib/io/bbmat.ts @@ -1,8 +1,12 @@ -import { registry, setups, teardowns, CHANNELS } from "../../constants"; +import { + registry, + setups, + teardowns, + CHANNELS, + BBMAT_VERSION, + PLUGIN_VERSION, +} from "../../constants"; import type { Channel, IBbMat } from "../../types"; -import PbrMaterial from "../PbrMaterials"; - -const FORMAT_VERSION = "1.0.0"; setups.push(() => { registry.bbmat = new Codec("material", { @@ -13,7 +17,7 @@ setups.push(() => { extensions: ["bbmat"], type: "json", }, - compile(options) { + compile() { if (!Texture.selected?.material || !Texture.selected?.layers_enabled) { return; } @@ -24,15 +28,8 @@ setups.push(() => { return [channel, map]; }); - const pbrMaterial = new PbrMaterial( - Texture.selected.layers, - Texture.selected.uuid - ); - - channels.push(["preview", pbrMaterial.renderMaterialPreview()]); - return JSON.stringify({ - version: FORMAT_VERSION, + version: BBMAT_VERSION, channels: Object.fromEntries(channels), }); }, @@ -40,7 +37,19 @@ setups.push(() => { content = typeof content === "string" ? JSON.parse(content) : content; const version = content.version; - if (version !== FORMAT_VERSION) { + if (version !== BBMAT_VERSION) { + Blockbench.showMessageBox( + { + title: "Invalid Blockbench Material Version", + message: `The material file "${path}" is not compatible with version ${PLUGIN_VERSION} of the PBR plugin.`, + buttons: ["OK"], + confirm: 0, + width: 400, + cancel: 0, + checkboxes: {}, + }, + () => null + ); return {}; } @@ -146,26 +155,7 @@ setups.push(() => { }, }, click() { - if (!registry.bbmat?.write || !registry.bbmat?.compile) { - return; - } - - // const content = registry.bbmat.compile(); - - // if (isApp && Project) { - // registry.bbmat.write( - // content, - // Project.save_path.replace( - // /\/[^\\\/]\.bbmodel$/i, - // `/${Texture.selected.name ?? "material"}.bbmat` - // ) - // ); - // return; - // } - - if (registry.bbmat.export) { - registry.bbmat.export(); - } + registry.bbmat?.export?.(); }, }); diff --git a/src/pbr_preview/src/lib/normalMap.ts b/src/pbr_preview/src/lib/normalMap.ts index 43e28f59..d93c92d5 100644 --- a/src/pbr_preview/src/lib/normalMap.ts +++ b/src/pbr_preview/src/lib/normalMap.ts @@ -3,10 +3,12 @@ * Generates a normal map from a height map texture * @param texture Height map texture * @param heightInAlpha Whether or not to store the height map in the alpha channel (Used in labPBR shaders for POM) + * @param orientation Whether or not to flip the normal map vertically * @returns Normal map texture or layer if successful, otherwise `null` */ export function createNormalMap( texture: Texture | TextureLayer, + orientation: "DirectX" | "OpenGL" = "DirectX", heightInAlpha = false ): Texture | TextureLayer | null { const textureCtx = texture.canvas.getContext("2d"); @@ -63,8 +65,8 @@ export function createNormalMap( const dx = right - left; const dy = bottom - top; - - const normal = normalize([-dx, -dy, 1]); + const vector = orientation === "DirectX" ? [dx, dy, 1] : [-dx, -dy, 1]; + const normal = normalize(vector); const idx = (y * width + x) * 4; data[idx] = ((normal[0] + 1) / 2) * 255; @@ -205,3 +207,73 @@ export function createAoMap( return aoMapTexture; } + +export function convertNormalMap( + texture: Texture | TextureLayer, + orientation: "DirectX" | "OpenGL" = "DirectX" +): string | null { + const textureCtx = texture.canvas.getContext("2d"); + + if (!textureCtx) { + return null; + } + + const width = Math.max( + texture.img.width ?? texture.canvas.width, + Project ? Project.texture_width : 0, + 16 + ); + const height = Math.max( + texture.img.height ?? texture.canvas.height, + Project ? Project.texture_height : 0, + 16 + ); + + const { data: textureData } = textureCtx.getImageData(0, 0, width, height); + + const canvas = document.createElement("canvas"); + const ctx = canvas.getContext("2d"); + + if (!ctx) { + return null; + } + + const getNormal = (x: number, y: number): number[] => { + const idx = (x + y * width) * 4; + return [ + (textureData[idx] / 255) * 2 - 1, + (textureData[idx + 1] / 255) * 2 - 1, + (textureData[idx + 2] / 255) * 2 - 1, + ]; + }; + + canvas.width = width; + canvas.height = height; + + ctx.drawImage(texture.img, 0, 0, width, height); + + const imageData = ctx.getImageData(0, 0, width, height); + + const data = imageData.data; + + for (let y = 0; y < height; y++) { + for (let x = 0; x < width; x++) { + const normal = getNormal(x, y); + + const [dx, dy] = + orientation === "DirectX" + ? [normal[0], normal[1]] + : [-normal[0], -normal[1]]; + + const idx = (y * width + x) * 4; + data[idx] = ((dx + 1) / 2) * 255; + data[idx + 1] = ((dy + 1) / 2) * 255; + data[idx + 2] = 0; + data[idx + 3] = 255; + } + } + + ctx.putImageData(imageData, 0, 0); + + return canvas.toDataURL(); +} From 3c47eb59f2f28110adc224fde25b66e65a136a8e Mon Sep 17 00:00:00 2001 From: Jason Gardner Date: Sat, 22 Jun 2024 08:02:48 -0500 Subject: [PATCH 32/50] fix: Face update logic - Corrected error in updateFace logic to reduce the number of times updateAllFaces is called - Disabled normal map channel in material brush until a color input is available - Disabled flipping normal map in preview. Normal map type should not be assumed --- plugins/pbr_preview/pbr_preview.js | 24 ++++++++++----------- src/pbr_preview/src/lib/MaterialBrush.ts | 3 +++ src/pbr_preview/src/lib/PbrMaterials.ts | 3 ++- src/pbr_preview/src/lib/applyPbrMaterial.ts | 24 ++++++++++++--------- 4 files changed, 31 insertions(+), 23 deletions(-) diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index 1a081d60..1836ef7b 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1,4 +1,4 @@ -"use strict";(()=>{var _=THREE,ie=Vue,le=window.JSZip;var F="1.2.0",K="1.0.0",B="_NONE_",h={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new _.Color(16777215),regex:new RegExp("(s|_)*(basecolor|color|albedo)","i")},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new _.Color(0),regex:new RegExp("[ _]*metal(lic|ness)?","i")},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new _.Color(0),regex:new RegExp("[ _]*(emissive|emission)","i")},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new _.Color(16777215),regex:new RegExp("[ _]*rough(ness)?","i")},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new _.Color(16777215),regex:new RegExp("[ _]*(height|bump)","i")},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new _.Color("rgb(128, 128, 255)"),regex:new RegExp("[ _]*normal","i")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new _.Color(16777215),regex:new RegExp("[ _]*(ao|ambientocclusion|ambient occlusion)","i")}},o={},y=[],C=[];var ce=[...Object.keys(h).map(e=>h[e].id),B];y.push(()=>{o.channelProp=new Property(TextureLayer,"enum","channel",{default:B,values:ce,label:"PBR Channel",exposed:!1}),o.textureChannelProp=new Property(Texture,"enum","channel",{default:B,values:ce,label:"PBR Channel",exposed:!1}),o.materialTextureProp=new Property(Texture,"boolean","material",{default:!1,label:"Material Texture"}),o.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),o.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),o.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!1,values:[],label:"PBR Mode"})});function E(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(e=>e.selected)??null:Texture.all.find(e=>e.selected)??Texture.getDefault()}function R(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(e=>e.selected)??Project.selected_texture.layers[0]:E()?.getActiveLayer()??null}function G(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(E()?.name??"texture")}function ue(e,a){let t;return function(...r){let n=()=>{t=void 0,e.apply(this,r)};clearTimeout(t),t=setTimeout(n,a)}}function z(e){let a=MediaPreview.renderer??new _.WebGLRenderer({alpha:!0,antialias:!0}),t=new _.Scene,r=new _.PerspectiveCamera(75,96/96,.1,1e3),n=new _.AmbientLight(16777215,.75);t.add(n);let i=new _.PointLight(16777215,1,100);i.position.set(5,5,5),t.add(i);let s=new _.SphereGeometry(1,32,32),l=e instanceof _.MeshStandardMaterial&&e.isMeshStandardMaterial?e:new _.MeshStandardMaterial({color:e.albedo,metalness:e.metalness??0,roughness:e.roughness??1,emissive:e.emissive,bumpScale:e.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),u=new _.Mesh(s,l);t.add(u),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(t,r);let m=a.domElement.toDataURL();return l.dispose(),MediaPreview.renderer||(a.clear(),a.dispose()),m}function Y(e,a){let t=a??document.createElement("canvas"),r=t.getContext("2d");if(!r)return t.remove(),null;let n=Math.max(Project?Project.texture_width:16,16),i=Math.max(Project?Project.texture_height:16,16);t.width=n,t.height=i,r.fillStyle=`rgb(${e.r*255}, ${e.g*255}, ${e.b*255})`,r.fillRect(0,0,n,i);let s=t.toDataURL();return a||t.remove(),s}var Qe=(e=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return e?a.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):a},k=class e{constructor(a,t){this._scope=a??Qe(),this._materialUuid=t}merToCanvas(){let a=this.getTexture(h.emissive),t=this.getTexture(h.roughness),r=this.getTexture(h.metalness);if(!a&&!t&&!r){let{metalness:n,emissive:i,roughness:s}=this.decodeMer();n&&(r=e.makePixelatedCanvas(n)),i&&(a=e.makePixelatedCanvas(i)),s&&(t=e.makePixelatedCanvas(s))}return{emissiveMap:a,roughnessMap:t,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(h.emissive),roughnessMap:this.getTexture(h.roughness),metalnessMap:this.getTexture(h.metalness)},i=this.getTexture(h.normal);return new _.MeshStandardMaterial({map:this.getTexture(h.albedo)??e.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(s=>s.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(h.ao),bumpMap:this.getTexture(h.height),normalMap:i,normalScale:new _.Vector2(-1,1),metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}renderMaterialPreview(){return z(this.getMaterial())}saveTexture(a,t){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=t.uuid,t.extend({channel:a.id}))}findTexture(a,t=!0){if(!Project)return null;let r=this._scope.find(u=>u.channel&&(u.channel===a||u.channel===a.id));if(r)return r;let[n,i]=typeof a=="string"?[a,new RegExp(`_*${a}(.[^.]+)?$`,"i")]:[a.id,a.regex??new RegExp(`_*${a.id}(.[^.]+)?$`,"i")];Project.pbr_materials=Project.pbr_materials??{};let s=Project.pbr_materials[this._materialUuid];if(t&&!s?.length&&n!==B)return this._scope.find(u=>i.test(u.name))??null;let l=s?.[n];return l?this._scope.find(u=>u.uuid===l)??null:null}static makePixelatedCanvas(a){let t=new _.CanvasTexture(a,void 0,void 0,void 0,_.NearestFilter,_.NearestFilter);return t.needsUpdate=!0,t}getTexture(a){let t=this.findTexture(a);return t?e.makePixelatedCanvas(t.canvas):null}static extractChannel(a,t){let r=a.canvas,{width:n,height:i}=r,s=r.getContext("2d");if(!s||!n||!i)return null;let l=document.createElement("canvas");l.width=n,l.height=i;let u=l.getContext("2d");if(!u)return null;let m={r:0,g:1,b:2,a:3}[t],{data:d}=s.getImageData(0,0,n,i),c=new Uint8ClampedArray(n*i*4);for(let g=0;ga){x[f]=v.data[f],x[f+1]=v.data[f+1],x[f+2]=v.data[f+2],x[f+3]=255;continue}x[f]=0,x[f+1]=0,x[f+2]=0,x[f+3]=255}return m.putImageData(new ImageData(x,l.width,l.height),0,0),{metalness:r,emissive:l,emissiveLevel:n,roughness:i,sss:s}}createMer(a=!1){let t=this.findTexture(h.metalness,a),r=this.findTexture(h.emissive,a),n=this.findTexture(h.roughness,a),i=this.findTexture("sss",!1),s=Math.max(t?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),l=Math.max(t?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),u=document.createElement("canvas");u.width=s,u.height=l;let m=u.getContext("2d");if(!m)return null;let d=t?.img?e.extractChannel(t,"r"):null,c=r?.img?e.extractChannel(r,"g"):null,v=n?.img?e.extractChannel(n,"b"):null,g=i&&i?.img?e.extractChannel(i,"a"):null,x=d?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),f=c?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),p=v?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),b=g?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(new Uint8ClampedArray(s*l*4).fill(255),s,l),M=new Uint8ClampedArray(s*l*4);for(let w=0;w{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createTexturesFromNormal(a){let t=this.decodeLabPbrNormal(a);return Object.entries(t).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}};var V=class{constructor({lightHeight:a=.66,ambientLight:t=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:n=[1,1,1]}={}){this.lightHeight=a,this.ambientLight=t,this.minLightIntensity=r,this.lightDiffuse=n}bake(a,t,r){let n=t instanceof HTMLCanvasElement?t:this.createCanvas(t.width,t.height),i=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),s=n.getContext("2d"),l=i.getContext("2d");s.drawImage(t,0,0),l.drawImage(r,0,0);let u=s.getImageData(0,0,t.width,t.height),m=l.getImageData(0,0,r.width,r.height),d=[],c=[];for(let g=0;g{let x=this.createCanvas(t.width,t.height),f=x.getContext("2d"),p=f.getImageData(0,0,x.width,x.height),b=[Math.cos(g),Math.sin(g),this.lightHeight];for(let M=0;M{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new k(r.layers_enabled?r.layers:Project.textures,r.uuid),i=n.findTexture(h.albedo);if(!i){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let s=n.findTexture(h.normal);if(!s){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let u=new V(e).bake(a,i.canvas,s.canvas),m=new Texture({name:`${i.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(u[0].toDataURL()),d=t?c=>{let v=n.findTexture(h.emissive);if(!v)return c;let g=v.canvas;if(!g.getContext("2d"))return c;let f=Math.max(c.width,g.width,Project?Project.texture_width:16),p=Math.max(c.height,g.height,Project?Project.texture_height:16),b=document.createElement("canvas");b.width=f,b.height=p;let M=b.getContext("2d");return M?(M.drawImage(c,0,0),M.globalCompositeOperation="screen",M.drawImage(g,0,0),b):c}:c=>c;u.forEach((c,v)=>{new TextureLayer({name:`baked_${v+1}`,data_url:d(c).toDataURL()},m).addForEditing()}),m.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};y.push(()=>{o.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(e){let a=new _.Color(e.ambientLight.toString()),t=new _.Color(e.lightDiffuse.toString());me({ambientLight:[a.r,a.g,a.b],lightDiffuse:[t.r,t.g,t.b],lightHeight:Number(e.lightHeight),minLightIntensity:Number(e.minLightIntensity)},e.directions??8,e.blendEmissive??!1)}}),o.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){o.bakeTexturesDialog?.show()}}),MenuBar.addAction(o.bakeTexturesAction,"tools")});C.push(()=>{MenuBar.removeAction("tools.bake_textures")});function de(e,a){let t=e.getTexture();if(!t||!Project)return null;let r=Project.materials[t.uuid];r.isShaderMaterial&&!Project.bb_materials[t.uuid]?Project.bb_materials[t.uuid]=r:r.isMeshStandardMaterial&&r.dispose();let n=new k(t.layers_enabled?t.layers.filter(i=>i.visible)??null:Project.textures,t.uuid).getMaterial({side:Canvas.getRenderSide(t),...a});return Project.materials[t.uuid]=_.ShaderMaterial.prototype.copy.call(n,r),t}function he(e){return Object.values(e).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function Je(e,a){let t={};return e.forAllFaces(r=>{let n=de(r,a);n&&(t[n.uuid]=n)}),he(t)}function Xe(e,a){let t={};return Object.keys(e.faces).forEach(r=>{let n=e.faces[r],i=de(n,a);i&&(t[i.uuid]=i)}),he(t)}var N=(e={})=>{Project&&(Project.pbr_active=Texture.all.length>0&&Project.elements.map(a=>a instanceof Mesh&&Je(a,e)||a instanceof Cube&&Xe(a,e)).filter(Boolean).length>0)},A=(e=100)=>ue(N,e);var te={},ee=()=>Condition({modes:["edit","paint"],selected:{texture:!0},project:!0,method(){let e=E();return e&&!e.material?!0:e?.material===!0&&R()!==null&&Modes.paint}}),pe=()=>Condition({modes:["paint","edit"],selected:{texture:!0},method(){let e=E();if(e?.material&&Modes.edit)return!1;let a=R()??e;return a?.channel&&a.channel!==B}});y.push(()=>{Object.entries(h).forEach(([e,a])=>{te[e]=new Action(`assign_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:ee,click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t)return;Undo.initEdit({layers:[t]}),t.extend({channel:a.id});let r=t instanceof TextureLayer?t.texture:t;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([n,i])=>{i===t.uuid&&(delete Project.pbr_materials[r.uuid][n],t.channel=B)}),r.uuid===t.uuid&&(Project.pbr_materials[r.uuid]={}),Project.pbr_materials[r.uuid][e]=t.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${t.name}" to ${a.label} channel`,2e3),N()}})})});C.push(()=>{Object.values(te).forEach(e=>{e.delete()})});y.push(()=>{o.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:pe,click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e)return;Undo.initEdit({layers:[e]});let a=e instanceof TextureLayer?e.texture:e,t=e.channel;Project.pbr_materials[a.uuid]={},e.channel=B,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${e.name}" from ${t} channel`,2e3),A()}}),o.channelMenu=new Menu("channel_menu",[...Object.keys(h).map(e=>`assign_channel_${e}`),"unassign_channel"],{onOpen(){A()}}),o.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",condition:()=>ee()||pe(),click(e){o.channelMenu?.open(e)},children:[...Object.values(te),o.unassignChannel]}),o.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:ee,click(e){o.channelMenu?.open(e)}}),o.openChannelMenu&&(MenuBar.addAction(o.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(o.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(o.openChannelMenu,"0")),Toolbars.layers.add(o.showChannelMenu,1)});C.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(o.showChannelMenu)});function $(e,a="DirectX",t=!1){let r=e.canvas.getContext("2d");if(!r)return null;let n=Math.max(e.img.width??e.canvas.width,Project?Project.texture_width:0,16),i=Math.max(e.img.height??e.canvas.height,Project?Project.texture_height:0,16),{data:s}=r.getImageData(0,0,n,i),l=document.createElement("canvas"),u=l.getContext("2d");if(!u)return null;let m=(p,b)=>{let M=(p+b*n)*4;return s[M]/255};l.width=n,l.height=i,u.drawImage(e.img,0,0,n,i);let d=u.getImageData(0,0,n,i),c=d.data,v=p=>{let b=Math.sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);return[p[0]/b,p[1]/b,p[2]/b]};for(let p=0;p{let f=(g+x*t)*4;return n[f]/255};i.width=t,i.height=r,s.drawImage(e.img,0,0,t,r);let u=s.getImageData(0,0,t,r),m=u.data;for(let g=0;g{let t=R()??E()??Texture.getDefault();if(!t)return;let r=$(t,a,!1);if(!r){Blockbench.showQuickMessage("Failed to generate normal map",2e3);return}r.select(e),new k(t instanceof Texture&&t.layers_enabled?t.layers:null,t.uuid).saveTexture(h.normal,r),Blockbench.showQuickMessage("Normal map generated",2e3)};y.push(()=>{o.generateDirectXNormal=new Action("generate_dx_normal",{icon:h.normal.icon??"altitude",name:"Generate DirectX Normal Map",description:"Generates a DirectX normal map from the height map",condition:()=>(R()??E())!==null,click:e=>fe(e)}),o.generateOpenGlNormal=new Action("generate_opengl_normal",{icon:h.normal.icon??"altitude",name:"Generate OpenGL Normal Map",description:"Generates an OpenGL normal map from the height map",condition:()=>(R()??E())!==null,click:e=>fe(e,"OpenGL")}),o.generateAo=new Action("generate_ao",{icon:h.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let e=R()??E()??Texture.getDefault();if(!e)return;let a=new k(e instanceof Texture&&e.layers_enabled?e.layers:null,e.uuid),t=a.findTexture(h.normal)??$(e);if(!t){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=ge(t);if(r){a.saveTexture(h.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),o.generateNormal=new Action("generate_normal",{children:[o.generateDirectXNormal,o.generateOpenGlNormal],name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(R()??E())!==null,click(){},icon:h.normal.icon??"altitude"}),MenuBar.addAction(o.generateNormal,"tools"),MenuBar.addAction(o.generateAo,"tools")});C.push(()=>{MenuBar.removeAction("tools.generate_normal"),MenuBar.removeAction("tools.generate_ao")});var Ze=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},We=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};y.push(()=>{o.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let e=E();if(!e)return;let t=new k(e.layers_enabled?e.layers:[e],e.uuid).createLabPbrOutput();if(t===null)return;let r=e.name??(Project?Project.getDisplayName():"texture");await Promise.all([Ze(t.normalMap,pathToName(r)),We(t.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),o.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let e=TextureLayer.selected?.texture??Texture.all.find(t=>t.selected)??Texture.getDefault(),a=new k(e.layers_enabled?e.layers:[e],e.uuid);if(pathToName(e.name).endsWith("_n")){a.createTexturesFromNormal(e);return}if(pathToName(e.name).endsWith("_s")){a.createTexturesFromSpecular(e);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(o.generateLabPbr,"file.export"),MenuBar.addAction(o.decodeLabPbr,"tools")});C.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});y.push(()=>{o.createMaterialTexture=new Action("create_material_texture",{icon:"deployed_code",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let e={...h},a=new Texture({name:"New Material",saved:!1,particle:!1});a.extend({material:!0});let t=Texture.all.filter(s=>(s.selected||s.multi_selected)&&!s.material)??Texture.all,r=E(),n=r?new k(t,r.uuid):null;try{let s=n?.findTexture(h.albedo,!0)?.canvas.toDataURL()??r?.canvas.toDataURL()??Y(new _.Color(8421504),a.canvas);if(!s)return;a.fromDataURL(s);let l=new TextureLayer({name:e.albedo.label,visible:!0,data_url:s,keep_size:!0},a);l.extend({channel:e.albedo.id}),l.addForEditing(),l.texture.updateChangesAfterEdit(),n?.saveTexture(e.albedo,l),delete e.albedo}catch(s){console.warn("Failed to create base color texture",s),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let i=Object.keys(e).reverse().map(s=>{let l=h[s],u=n?.findTexture(l,!0),m=u?u.canvas.toDataURL():Y(l.default??new _.Color(0));if(!m)return;let d=new TextureLayer({name:l.label,visible:!0,data_url:m,keep_size:!0},a);return d.extend({channel:l.id}),n?.saveTexture(l,d),d}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:i}),a.add().select(),a.activateLayers(),i.map(s=>{s.addForEditing(),a.width=Math.max(a.width,s.img.width),a.height=Math.max(a.height,s.img.height)}),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(o.createMaterialTexture,"tools"),Toolbars.texturelist.add(o.createMaterialTexture,3)});C.push(()=>{MenuBar.removeAction("tools.create_material_texture"),Toolbars.texturelist.remove("create_material_texture")});var Q=(e,a)=>{let t=E()??Texture.getDefault(),r=new k(t.layers_enabled?t.layers:Project?Project.textures:null,t.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[i,s]=Project?[e?`${e}_mer`:`${t.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:i,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},a)})};y.push(()=>{o.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{Q()}catch(e){console.error("Failed to export MER map:",e),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),o.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let e=E()??Texture.getDefault(),a=new k([e],e.uuid),t=a.decodeMer(),r=[h.metalness,h.emissive,h.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new Texture({name:`${e?.name}_${i}`,keep_size:!1}).fromDataURL(s.toDataURL());l.add(!0),a.saveTexture(n,l)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>E()?.layers_enabled===!0,click(){let e=E()??Texture.getDefault(),a=new k(e.layers_enabled?e.layers:[e],e.uuid),t=a.decodeMer(),r=[h.metalness,h.emissive,h.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new TextureLayer({name:`${e?.name}_${i}`,data_url:s.toDataURL()},e);a.saveTexture(n,l),l.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(o.decodeMer,"tools"),MenuBar.addAction(o.generateMer,"file.export")});C.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var qe=()=>{Project&&Project.textures.forEach(e=>{let a=new k(null,e.uuid),t=a.findTexture(h.normal,!1),r=a.findTexture(h.height,!1),n=a.findTexture(h.albedo,!1),i=a.findTexture(h.metalness,!1)?.name,s=a.findTexture(h.emissive,!1)?.name,l=a.findTexture(h.roughness,!1)?.name,u={};return n||(u.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!i&&!s&&!l&&(u.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},u.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},u.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),t&&(u.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(u.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),t&&r&&(u.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),o.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:u,cancelIndex:1,onConfirm(m){let d=G(),c=i||s||l,v={format_version:"1.16.100","minecraft:texture_set":{color:(n?d:m.baseColor?.toHexString())??d,metalness_emissive_roughness:[m.metalness??0,m.emissive??0,m.roughness??255]}};m.depthMap==="normal"&&t||!r&&t?v["minecraft:texture_set"].normal=`${d}_normal`:(!t||m.depthMap==="heightmap")&&r&&(v["minecraft:texture_set"].heightmap=`${d}_heightmap`);let g=p=>{if(!m.depthMap)return p();let b=m.depthMap==="normal"||m.depthMap&&!r,M=b?t:r;if(!M)return p();Blockbench.export({content:M.canvas.toDataURL()??"",type:"PNG",name:`${d}_${b?"normal":"heightmap"}`,extensions:["png"],resource_id:m.depthMap,startpath:Project.export_path,savetype:"image"},w=>{v["minecraft:texture_set"][b?"normal":"heightmap"]=pathToName(w,!1),p()})},x=p=>{if(!n)return p();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:d,startpath:Project.export_path,savetype:"image"},b=>{v["minecraft:texture_set"].color=pathToName(b,!1),p()})},f=()=>g(()=>{x(()=>{Blockbench.export({content:JSON.stringify(v,null,2),type:"JSON",name:`${d}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),o.textureSetDialog?.hide()})})});if(c){try{Q(d,p=>{v["minecraft:texture_set"].metalness_emissive_roughness=pathToName(p,!1),f()})}catch(p){console.warn("Failed to export MER map:",p),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}f()}}),o.textureSetDialog.show()})};y.push(()=>{o.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){qe()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(o.createTextureSet,"file.export")});C.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});y.push(()=>{o.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(e){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=e}),Preview.selected.renderer.physicallyCorrectLights=e,Blockbench.showQuickMessage(`Physically corrected lighting is now ${e?"enabled":"disabled"}`,2e3),e&&o.togglePbr?.set(!0),N()},click(){}}),MenuBar.addAction(o.toggleCorrectLights,"preview")});C.push(()=>{MenuBar.removeAction("preview.correct_lights")});var J=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(e=>{e instanceof Cube&&Object.keys(e.faces).forEach(a=>{let r=e.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var xe=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],be=()=>Project&&Project.pbr_active&&N(),Ke=()=>{Blockbench.on(xe.join(" "),be)},ve=()=>{xe.forEach(e=>{Blockbench.removeListener(e,be)})};y.push(()=>{o.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(e){if(e){N(),Ke(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}J(),ve(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(o.togglePbr,"view")});C.push(()=>{ve(),MenuBar.removeAction("view.toggle_pbr")});var _e=e=>{let a=Math.max(-2,Math.min(2,e));Preview.all.forEach(t=>{t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};y.push(()=>{o.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(o.tonemappingSelect?.get())===_.NoToneMapping&&o.tonemappingSelect.change(_.LinearToneMapping.toString()),o.togglePbr?.set(!0)},onChange(e){_e(Number(e))},onAfter(){A()}}),o.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>o.exposureSlider!==void 0&&Number(o.exposureSlider?.get())!==1,click(){_e(1),o.exposureSlider?.setValue(1,!0),A()}}),o.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:_.NoToneMapping,value:Preview.selected.renderer.toneMapping??_.NoToneMapping,icon:"monochrome_photos",options:{[_.NoToneMapping]:"No Tone Mapping",[_.LinearToneMapping]:"Linear",[_.ReinhardToneMapping]:"Reinhard",[_.CineonToneMapping]:"Cineon",[_.NeutralToneMapping]:"Neutral",[_.ACESFilmicToneMapping]:"ACES"},onChange({value:e}){Preview.selected.renderer.toneMapping=Number(e);let a=1;Preview.selected.renderer.toneMapping===_.NoToneMapping?o.exposureSlider?.setValue(a,!0):a=Number(o.exposureSlider?.get()??1),Preview.all.forEach(t=>{t.renderer.toneMapping=Number(e),t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(e)}`,2e3),o.togglePbr&&!o.togglePbr.value&&o.togglePbr.set(!0),N()}})});var ae=class{async parse(a){let t=new le,r="model.usda";t.file(r,"");let n=Te(),i={},s={};a.traverseVisible(m=>{if(!m.isMesh)return;let d=m;if(!d.material.isMeshStandardMaterial){console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",m);return}let c=d.geometry,v=d.material,g="geometries/Geometry_"+c.id+".usd";if(!t.file(g)){let x=rt(c);t.file(g,et(x))}v.uuid in i||(i[v.uuid]=v),n+=tt(d,c,v)}),n+=lt(i,s),t.file(r,n),n=null;for(let m in s){let d=s[m],c=m.split("_")[1],v=d.format===_.RGBAFormat,g=Ye(d.image,c),f=await(await new Promise(p=>g.toBlob(b=>b&&p(b),v?"image/png":"image/jpeg",1))).arrayBuffer();t.file(`textures/Texture_${m}.${v?"png":"jpg"}`,f)}let l=0;t.forEach(async m=>{let d=34+m.length;l+=d;let c=l&63,v=await t.file(m).async("uint8array");if(c!==4){let g=64-c,x=new Uint8Array(g),f=new Uint8Array(v.length+g);f.set(v,0),f.set(x,v.length),t.file(m,f)}l+=v.length});let u=await t.generateAsync({type:"blob",compression:"STORE"});return new Uint8Array(await u.arrayBuffer())}};function Ye(e,a){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=1024/Math.max(e.width,e.height),r=document.createElement("canvas");r.width=e.width*Math.min(1,t),r.height=e.height*Math.min(1,t);let n=r.getContext("2d");if(n.imageSmoothingEnabled=!1,n.drawImage(e,0,0,r.width,r.height),a!==void 0){let i=parseInt(a,16),s=(i>>16&255)/255,l=(i>>8&255)/255,u=(i&255)/255,m=n.getImageData(0,0,r.width,r.height),d=m.data;for(let c=0;c{var _=THREE,ie=Vue,le=window.JSZip;var F="1.2.0",K="1.0.0",R="_NONE_",h={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new _.Color(16777215),regex:new RegExp("(s|_)*(basecolor|color|albedo)","i")},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new _.Color(0),regex:new RegExp("[ _]*metal(lic|ness)?","i")},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new _.Color(0),regex:new RegExp("[ _]*(emissive|emission)","i")},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new _.Color(16777215),regex:new RegExp("[ _]*rough(ness)?","i")},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new _.Color(16777215),regex:new RegExp("[ _]*(height|bump)","i")},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new _.Color("rgb(128, 128, 255)"),regex:new RegExp("[ _]*normal","i")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new _.Color(16777215),regex:new RegExp("[ _]*(ao|ambientocclusion|ambient occlusion)","i")}},o={},y=[],C=[];var ce=[...Object.keys(h).map(e=>h[e].id),R];y.push(()=>{o.channelProp=new Property(TextureLayer,"enum","channel",{default:R,values:ce,label:"PBR Channel",exposed:!1}),o.textureChannelProp=new Property(Texture,"enum","channel",{default:R,values:ce,label:"PBR Channel",exposed:!1}),o.materialTextureProp=new Property(Texture,"boolean","material",{default:!1,label:"Material Texture"}),o.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),o.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),o.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!1,values:[],label:"PBR Mode"})});function E(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(e=>e.selected)??null:Texture.all.find(e=>e.selected)??Texture.getDefault()}function B(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(e=>e.selected)??Project.selected_texture.layers[0]:E()?.getActiveLayer()??null}function G(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(E()?.name??"texture")}function ue(e,a){let t;return function(...r){let n=()=>{t=void 0,e.apply(this,r)};clearTimeout(t),t=setTimeout(n,a)}}function z(e){let a=MediaPreview.renderer??new _.WebGLRenderer({alpha:!0,antialias:!0}),t=new _.Scene,r=new _.PerspectiveCamera(75,96/96,.1,1e3),n=new _.AmbientLight(16777215,.75);t.add(n);let i=new _.PointLight(16777215,1,100);i.position.set(5,5,5),t.add(i);let s=new _.SphereGeometry(1,32,32),l=e instanceof _.MeshStandardMaterial&&e.isMeshStandardMaterial?e:new _.MeshStandardMaterial({color:e.albedo,metalness:e.metalness??0,roughness:e.roughness??1,emissive:e.emissive,bumpScale:e.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),u=new _.Mesh(s,l);t.add(u),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(t,r);let m=a.domElement.toDataURL();return l.dispose(),MediaPreview.renderer||(a.clear(),a.dispose()),m}function Y(e,a){let t=a??document.createElement("canvas"),r=t.getContext("2d");if(!r)return t.remove(),null;let n=Math.max(Project?Project.texture_width:16,16),i=Math.max(Project?Project.texture_height:16,16);t.width=n,t.height=i,r.fillStyle=`rgb(${e.r*255}, ${e.g*255}, ${e.b*255})`,r.fillRect(0,0,n,i);let s=t.toDataURL();return a||t.remove(),s}var Ve=(e=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return e?a.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):a},k=class e{constructor(a,t){this._scope=a??Ve(),this._materialUuid=t}merToCanvas(){let a=this.getTexture(h.emissive),t=this.getTexture(h.roughness),r=this.getTexture(h.metalness);if(!a&&!t&&!r){let{metalness:n,emissive:i,roughness:s}=this.decodeMer();n&&(r=e.makePixelatedCanvas(n)),i&&(a=e.makePixelatedCanvas(i)),s&&(t=e.makePixelatedCanvas(s))}return{emissiveMap:a,roughnessMap:t,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(h.emissive),roughnessMap:this.getTexture(h.roughness),metalnessMap:this.getTexture(h.metalness)},i=this.getTexture(h.normal);return new _.MeshStandardMaterial({map:this.getTexture(h.albedo)??e.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(s=>s.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(h.ao),bumpMap:this.getTexture(h.height),normalMap:i,metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}renderMaterialPreview(){return z(this.getMaterial())}saveTexture(a,t){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=t.uuid,t.extend({channel:a.id}))}findTexture(a,t=!0){if(!Project)return null;let r=this._scope.find(u=>u.channel&&(u.channel===a||u.channel===a.id));if(r)return r;let[n,i]=typeof a=="string"?[a,new RegExp(`_*${a}(.[^.]+)?$`,"i")]:[a.id,a.regex??new RegExp(`_*${a.id}(.[^.]+)?$`,"i")];Project.pbr_materials=Project.pbr_materials??{};let s=Project.pbr_materials[this._materialUuid];if(t&&!s?.length&&n!==R)return this._scope.find(u=>i.test(u.name))??null;let l=s?.[n];return l?this._scope.find(u=>u.uuid===l)??null:null}static makePixelatedCanvas(a){let t=new _.CanvasTexture(a,void 0,void 0,void 0,_.NearestFilter,_.NearestFilter);return t.needsUpdate=!0,t}getTexture(a){let t=this.findTexture(a);return t?e.makePixelatedCanvas(t.canvas):null}static extractChannel(a,t){let r=a.canvas,{width:n,height:i}=r,s=r.getContext("2d");if(!s||!n||!i)return null;let l=document.createElement("canvas");l.width=n,l.height=i;let u=l.getContext("2d");if(!u)return null;let m={r:0,g:1,b:2,a:3}[t],{data:d}=s.getImageData(0,0,n,i),c=new Uint8ClampedArray(n*i*4);for(let g=0;ga){x[f]=v.data[f],x[f+1]=v.data[f+1],x[f+2]=v.data[f+2],x[f+3]=255;continue}x[f]=0,x[f+1]=0,x[f+2]=0,x[f+3]=255}return m.putImageData(new ImageData(x,l.width,l.height),0,0),{metalness:r,emissive:l,emissiveLevel:n,roughness:i,sss:s}}createMer(a=!1){let t=this.findTexture(h.metalness,a),r=this.findTexture(h.emissive,a),n=this.findTexture(h.roughness,a),i=this.findTexture("sss",!1),s=Math.max(t?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),l=Math.max(t?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),u=document.createElement("canvas");u.width=s,u.height=l;let m=u.getContext("2d");if(!m)return null;let d=t?.img?e.extractChannel(t,"r"):null,c=r?.img?e.extractChannel(r,"g"):null,v=n?.img?e.extractChannel(n,"b"):null,g=i&&i?.img?e.extractChannel(i,"a"):null,x=d?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),f=c?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),p=v?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),b=g?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(new Uint8ClampedArray(s*l*4).fill(255),s,l),M=new Uint8ClampedArray(s*l*4);for(let w=0;w{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createTexturesFromNormal(a){let t=this.decodeLabPbrNormal(a);return Object.entries(t).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}};var V=class{constructor({lightHeight:a=.66,ambientLight:t=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:n=[1,1,1]}={}){this.lightHeight=a,this.ambientLight=t,this.minLightIntensity=r,this.lightDiffuse=n}bake(a,t,r){let n=t instanceof HTMLCanvasElement?t:this.createCanvas(t.width,t.height),i=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),s=n.getContext("2d"),l=i.getContext("2d");s.drawImage(t,0,0),l.drawImage(r,0,0);let u=s.getImageData(0,0,t.width,t.height),m=l.getImageData(0,0,r.width,r.height),d=[],c=[];for(let g=0;g{let x=this.createCanvas(t.width,t.height),f=x.getContext("2d"),p=f.getImageData(0,0,x.width,x.height),b=[Math.cos(g),Math.sin(g),this.lightHeight];for(let M=0;M{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new k(r.layers_enabled?r.layers:Project.textures,r.uuid),i=n.findTexture(h.albedo);if(!i){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let s=n.findTexture(h.normal);if(!s){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let u=new V(e).bake(a,i.canvas,s.canvas),m=new Texture({name:`${i.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(u[0].toDataURL()),d=t?c=>{let v=n.findTexture(h.emissive);if(!v)return c;let g=v.canvas;if(!g.getContext("2d"))return c;let f=Math.max(c.width,g.width,Project?Project.texture_width:16),p=Math.max(c.height,g.height,Project?Project.texture_height:16),b=document.createElement("canvas");b.width=f,b.height=p;let M=b.getContext("2d");return M?(M.drawImage(c,0,0),M.globalCompositeOperation="screen",M.drawImage(g,0,0),b):c}:c=>c;u.forEach((c,v)=>{new TextureLayer({name:`baked_${v+1}`,data_url:d(c).toDataURL()},m).addForEditing()}),m.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};y.push(()=>{o.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(e){let a=new _.Color(e.ambientLight.toString()),t=new _.Color(e.lightDiffuse.toString());me({ambientLight:[a.r,a.g,a.b],lightDiffuse:[t.r,t.g,t.b],lightHeight:Number(e.lightHeight),minLightIntensity:Number(e.minLightIntensity)},e.directions??8,e.blendEmissive??!1)}}),o.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){o.bakeTexturesDialog?.show()}}),MenuBar.addAction(o.bakeTexturesAction,"tools")});C.push(()=>{MenuBar.removeAction("tools.bake_textures")});function de(e,a){let t=e.getTexture();if(!t||!Project)return null;let r=Project.materials[t.uuid];r.isShaderMaterial&&!Project.bb_materials[t.uuid]?Project.bb_materials[t.uuid]=r:r.isMeshStandardMaterial&&r.dispose();let n=new k(t.layers_enabled?t.layers.filter(i=>i.visible)??null:Project.textures,t.uuid).getMaterial({side:Canvas.getRenderSide(t),...a});return Project.materials[t.uuid]=_.ShaderMaterial.prototype.copy.call(n,r),t}function Qe(e){return Object.values(e).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function Je(e,a){let t={};return e.forAllFaces(r=>{let n=de(r,a);n&&(t[n.uuid]=n)}),t}function Xe(e,a){let t={};return Object.keys(e.faces).forEach(r=>{let n=e.faces[r],i=de(n,a);i&&(t[i.uuid]=i)}),t}var N=(e={})=>{if(!Project)return;let t=Project.elements.map(r=>r instanceof Mesh&&Je(r,e)||r instanceof Cube&&Xe(r,e)).reduce((r,n)=>({...r,...n}),{});Project.pbr_active=Texture.all.length>0&&t&&Qe(t)},A=(e=100)=>ue(N,e);var te={},ee=()=>Condition({modes:["edit","paint"],selected:{texture:!0},project:!0,method(){let e=E();return e&&!e.material?!0:e?.material===!0&&B()!==null&&Modes.paint}}),he=()=>Condition({modes:["paint","edit"],selected:{texture:!0},method(){let e=E();if(e?.material&&Modes.edit)return!1;let a=B()??e;return a?.channel&&a.channel!==R}});y.push(()=>{Object.entries(h).forEach(([e,a])=>{te[e]=new Action(`assign_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:ee,click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t)return;Undo.initEdit({layers:[t]}),t.extend({channel:a.id});let r=t instanceof TextureLayer?t.texture:t;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([n,i])=>{i===t.uuid&&(delete Project.pbr_materials[r.uuid][n],t.channel=R)}),r.uuid===t.uuid&&(Project.pbr_materials[r.uuid]={}),Project.pbr_materials[r.uuid][e]=t.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${t.name}" to ${a.label} channel`,2e3),N()}})})});C.push(()=>{Object.values(te).forEach(e=>{e.delete()})});y.push(()=>{o.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:he,click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e)return;Undo.initEdit({layers:[e]});let a=e instanceof TextureLayer?e.texture:e,t=e.channel;Project.pbr_materials[a.uuid]={},e.channel=R,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${e.name}" from ${t} channel`,2e3),A()}}),o.channelMenu=new Menu("channel_menu",[...Object.keys(h).map(e=>`assign_channel_${e}`),"unassign_channel"],{onOpen(){A()}}),o.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",condition:()=>ee()||he(),click(e){o.channelMenu?.open(e)},children:[...Object.values(te),o.unassignChannel]}),o.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:ee,click(e){o.channelMenu?.open(e)}}),o.openChannelMenu&&(MenuBar.addAction(o.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(o.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(o.openChannelMenu,"0")),Toolbars.layers.add(o.showChannelMenu,1)});C.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(o.showChannelMenu)});function $(e,a="DirectX",t=!1){let r=e.canvas.getContext("2d");if(!r)return null;let n=Math.max(e.img.width??e.canvas.width,Project?Project.texture_width:0,16),i=Math.max(e.img.height??e.canvas.height,Project?Project.texture_height:0,16),{data:s}=r.getImageData(0,0,n,i),l=document.createElement("canvas"),u=l.getContext("2d");if(!u)return null;let m=(p,b)=>{let M=(p+b*n)*4;return s[M]/255};l.width=n,l.height=i,u.drawImage(e.img,0,0,n,i);let d=u.getImageData(0,0,n,i),c=d.data,v=p=>{let b=Math.sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);return[p[0]/b,p[1]/b,p[2]/b]};for(let p=0;p{let f=(g+x*t)*4;return n[f]/255};i.width=t,i.height=r,s.drawImage(e.img,0,0,t,r);let u=s.getImageData(0,0,t,r),m=u.data;for(let g=0;g{let t=B()??E()??Texture.getDefault();if(!t)return;let r=$(t,a,!1);if(!r){Blockbench.showQuickMessage("Failed to generate normal map",2e3);return}r.select(e),new k(t instanceof Texture&&t.layers_enabled?t.layers:null,t.uuid).saveTexture(h.normal,r),Blockbench.showQuickMessage("Normal map generated",2e3)};y.push(()=>{o.generateDirectXNormal=new Action("generate_dx_normal",{icon:h.normal.icon??"altitude",name:"Generate DirectX Normal Map",description:"Generates a DirectX normal map from the height map",condition:()=>(B()??E())!==null,click:e=>ge(e)}),o.generateOpenGlNormal=new Action("generate_opengl_normal",{icon:h.normal.icon??"altitude",name:"Generate OpenGL Normal Map",description:"Generates an OpenGL normal map from the height map",condition:()=>(B()??E())!==null,click:e=>ge(e,"OpenGL")}),o.generateAo=new Action("generate_ao",{icon:h.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let e=B()??E()??Texture.getDefault();if(!e)return;let a=new k(e instanceof Texture&&e.layers_enabled?e.layers:null,e.uuid),t=a.findTexture(h.normal)??$(e);if(!t){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=pe(t);if(r){a.saveTexture(h.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),o.generateNormal=new Action("generate_normal",{children:[o.generateDirectXNormal,o.generateOpenGlNormal],name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(B()??E())!==null,click(){},icon:h.normal.icon??"altitude"}),MenuBar.addAction(o.generateNormal,"tools"),MenuBar.addAction(o.generateAo,"tools")});C.push(()=>{MenuBar.removeAction("tools.generate_normal"),MenuBar.removeAction("tools.generate_ao")});var Ze=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},We=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};y.push(()=>{o.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let e=E();if(!e)return;let t=new k(e.layers_enabled?e.layers:[e],e.uuid).createLabPbrOutput();if(t===null)return;let r=e.name??(Project?Project.getDisplayName():"texture");await Promise.all([Ze(t.normalMap,pathToName(r)),We(t.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),o.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let e=TextureLayer.selected?.texture??Texture.all.find(t=>t.selected)??Texture.getDefault(),a=new k(e.layers_enabled?e.layers:[e],e.uuid);if(pathToName(e.name).endsWith("_n")){a.createTexturesFromNormal(e);return}if(pathToName(e.name).endsWith("_s")){a.createTexturesFromSpecular(e);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(o.generateLabPbr,"file.export"),MenuBar.addAction(o.decodeLabPbr,"tools")});C.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});y.push(()=>{o.createMaterialTexture=new Action("create_material_texture",{icon:"deployed_code",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let e={...h},a=new Texture({name:"New Material",saved:!1,particle:!1});a.extend({material:!0});let t=Texture.all.filter(s=>(s.selected||s.multi_selected)&&!s.material)??Texture.all,r=E(),n=r?new k(t,r.uuid):null;try{let s=n?.findTexture(h.albedo,!0)?.canvas.toDataURL()??r?.canvas.toDataURL()??Y(new _.Color(8421504),a.canvas);if(!s)return;a.fromDataURL(s);let l=new TextureLayer({name:e.albedo.label,visible:!0,data_url:s,keep_size:!0},a);l.extend({channel:e.albedo.id}),l.addForEditing(),l.texture.updateChangesAfterEdit(),n?.saveTexture(e.albedo,l),delete e.albedo}catch(s){console.warn("Failed to create base color texture",s),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let i=Object.keys(e).reverse().map(s=>{let l=h[s],u=n?.findTexture(l,!0),m=u?u.canvas.toDataURL():Y(l.default??new _.Color(0));if(!m)return;let d=new TextureLayer({name:l.label,visible:!0,data_url:m,keep_size:!0},a);return d.extend({channel:l.id}),n?.saveTexture(l,d),d}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:i}),a.add().select(),a.activateLayers(),i.map(s=>{s.addForEditing(),a.width=Math.max(a.width,s.img.width),a.height=Math.max(a.height,s.img.height)}),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(o.createMaterialTexture,"tools"),Toolbars.texturelist.add(o.createMaterialTexture,3)});C.push(()=>{MenuBar.removeAction("tools.create_material_texture"),Toolbars.texturelist.remove("create_material_texture")});var Q=(e,a)=>{let t=E()??Texture.getDefault(),r=new k(t.layers_enabled?t.layers:Project?Project.textures:null,t.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[i,s]=Project?[e?`${e}_mer`:`${t.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:i,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},a)})};y.push(()=>{o.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{Q()}catch(e){console.error("Failed to export MER map:",e),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),o.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let e=E()??Texture.getDefault(),a=new k([e],e.uuid),t=a.decodeMer(),r=[h.metalness,h.emissive,h.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new Texture({name:`${e?.name}_${i}`,keep_size:!1}).fromDataURL(s.toDataURL());l.add(!0),a.saveTexture(n,l)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>E()?.layers_enabled===!0,click(){let e=E()??Texture.getDefault(),a=new k(e.layers_enabled?e.layers:[e],e.uuid),t=a.decodeMer(),r=[h.metalness,h.emissive,h.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new TextureLayer({name:`${e?.name}_${i}`,data_url:s.toDataURL()},e);a.saveTexture(n,l),l.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(o.decodeMer,"tools"),MenuBar.addAction(o.generateMer,"file.export")});C.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var qe=()=>{Project&&Project.textures.forEach(e=>{let a=new k(null,e.uuid),t=a.findTexture(h.normal,!1),r=a.findTexture(h.height,!1),n=a.findTexture(h.albedo,!1),i=a.findTexture(h.metalness,!1)?.name,s=a.findTexture(h.emissive,!1)?.name,l=a.findTexture(h.roughness,!1)?.name,u={};return n||(u.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!i&&!s&&!l&&(u.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},u.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},u.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),t&&(u.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(u.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),t&&r&&(u.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),o.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:u,cancelIndex:1,onConfirm(m){let d=G(),c=i||s||l,v={format_version:"1.16.100","minecraft:texture_set":{color:(n?d:m.baseColor?.toHexString())??d,metalness_emissive_roughness:[m.metalness??0,m.emissive??0,m.roughness??255]}};m.depthMap==="normal"&&t||!r&&t?v["minecraft:texture_set"].normal=`${d}_normal`:(!t||m.depthMap==="heightmap")&&r&&(v["minecraft:texture_set"].heightmap=`${d}_heightmap`);let g=p=>{if(!m.depthMap)return p();let b=m.depthMap==="normal"||m.depthMap&&!r,M=b?t:r;if(!M)return p();Blockbench.export({content:M.canvas.toDataURL()??"",type:"PNG",name:`${d}_${b?"normal":"heightmap"}`,extensions:["png"],resource_id:m.depthMap,startpath:Project.export_path,savetype:"image"},w=>{v["minecraft:texture_set"][b?"normal":"heightmap"]=pathToName(w,!1),p()})},x=p=>{if(!n)return p();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:d,startpath:Project.export_path,savetype:"image"},b=>{v["minecraft:texture_set"].color=pathToName(b,!1),p()})},f=()=>g(()=>{x(()=>{Blockbench.export({content:JSON.stringify(v,null,2),type:"JSON",name:`${d}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),o.textureSetDialog?.hide()})})});if(c){try{Q(d,p=>{v["minecraft:texture_set"].metalness_emissive_roughness=pathToName(p,!1),f()})}catch(p){console.warn("Failed to export MER map:",p),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}f()}}),o.textureSetDialog.show()})};y.push(()=>{o.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){qe()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(o.createTextureSet,"file.export")});C.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});y.push(()=>{o.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(e){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=e}),Preview.selected.renderer.physicallyCorrectLights=e,Blockbench.showQuickMessage(`Physically corrected lighting is now ${e?"enabled":"disabled"}`,2e3),e&&o.togglePbr?.set(!0),N()},click(){}}),MenuBar.addAction(o.toggleCorrectLights,"preview")});C.push(()=>{MenuBar.removeAction("preview.correct_lights")});var J=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(e=>{e instanceof Cube&&Object.keys(e.faces).forEach(a=>{let r=e.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var fe=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],xe=()=>Project&&Project.pbr_active&&N(),Ke=()=>{Blockbench.on(fe.join(" "),xe)},be=()=>{fe.forEach(e=>{Blockbench.removeListener(e,xe)})};y.push(()=>{o.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(e){if(e){N(),Ke(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}J(),be(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(o.togglePbr,"view")});C.push(()=>{be(),MenuBar.removeAction("view.toggle_pbr")});var ve=e=>{let a=Math.max(-2,Math.min(2,e));Preview.all.forEach(t=>{t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};y.push(()=>{o.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(o.tonemappingSelect?.get())===_.NoToneMapping&&o.tonemappingSelect.change(_.LinearToneMapping.toString()),o.togglePbr?.set(!0)},onChange(e){ve(Number(e))},onAfter(){A()}}),o.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>o.exposureSlider!==void 0&&Number(o.exposureSlider?.get())!==1,click(){ve(1),o.exposureSlider?.setValue(1,!0),A()}}),o.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:_.NoToneMapping,value:Preview.selected.renderer.toneMapping??_.NoToneMapping,icon:"monochrome_photos",options:{[_.NoToneMapping]:"No Tone Mapping",[_.LinearToneMapping]:"Linear",[_.ReinhardToneMapping]:"Reinhard",[_.CineonToneMapping]:"Cineon",[_.NeutralToneMapping]:"Neutral",[_.ACESFilmicToneMapping]:"ACES"},onChange({value:e}){Preview.selected.renderer.toneMapping=Number(e);let a=1;Preview.selected.renderer.toneMapping===_.NoToneMapping?o.exposureSlider?.setValue(a,!0):a=Number(o.exposureSlider?.get()??1),Preview.all.forEach(t=>{t.renderer.toneMapping=Number(e),t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(e)}`,2e3),o.togglePbr&&!o.togglePbr.value&&o.togglePbr.set(!0),N()}})});var ae=class{async parse(a){let t=new le,r="model.usda";t.file(r,"");let n=we(),i={},s={};a.traverseVisible(m=>{if(!m.isMesh)return;let d=m;if(!d.material.isMeshStandardMaterial){console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",m);return}let c=d.geometry,v=d.material,g="geometries/Geometry_"+c.id+".usd";if(!t.file(g)){let x=rt(c);t.file(g,et(x))}v.uuid in i||(i[v.uuid]=v),n+=tt(d,c,v)}),n+=lt(i,s),t.file(r,n),n=null;for(let m in s){let d=s[m],c=m.split("_")[1],v=d.format===_.RGBAFormat,g=Ye(d.image,c),f=await(await new Promise(p=>g.toBlob(b=>b&&p(b),v?"image/png":"image/jpeg",1))).arrayBuffer();t.file(`textures/Texture_${m}.${v?"png":"jpg"}`,f)}let l=0;t.forEach(async m=>{let d=34+m.length;l+=d;let c=l&63,v=await t.file(m).async("uint8array");if(c!==4){let g=64-c,x=new Uint8Array(g),f=new Uint8Array(v.length+g);f.set(v,0),f.set(x,v.length),t.file(m,f)}l+=v.length});let u=await t.generateAsync({type:"blob",compression:"STORE"});return new Uint8Array(await u.arrayBuffer())}};function Ye(e,a){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=1024/Math.max(e.width,e.height),r=document.createElement("canvas");r.width=e.width*Math.min(1,t),r.height=e.height*Math.min(1,t);let n=r.getContext("2d");if(n.imageSmoothingEnabled=!1,n.drawImage(e,0,0,r.width,r.height),a!==void 0){let i=parseInt(a,16),s=(i>>16&255)/255,l=(i>>8&255)/255,u=(i&255)/255,m=n.getImageData(0,0,r.width,r.height),d=m.data;for(let c=0;c ) { @@ -27,16 +27,16 @@ def "Geometry" { int[] faceVertexCounts = [${st(e)}] int[] faceVertexIndices = [${ot(e)}] - normal3f[] normals = [${Me(t.normal,r)}] ( + normal3f[] normals = [${_e(t.normal,r)}] ( interpolation = "vertex" ) - point3f[] points = [${Me(t.position,r)}] + point3f[] points = [${_e(t.position,r)}] float2[] primvars:st = [${it(t.uv,r)}] ( interpolation = "vertex" ) uniform token subdivisionScheme = "none" } -`}function st(e){let a=e.index!==null?e.index.count:e.attributes.position.count;return Array(a/3).fill(3).join(", ")}function ot(e){let a=e.index,t=[];if(a!==null)for(let r=0;r - float2 inputs:scale = ${we(l.repeat)} - float2 inputs:translation = ${we(l.offset)} + float2 inputs:scale = ${ye(l.repeat)} + float2 inputs:translation = ${ye(l.offset)} float2 outputs:result } @@ -66,7 +66,7 @@ ${t.join("")} float outputs:g float outputs:b float3 outputs:rgb - }`}let s=e;if(s.map!==null?(r.push(`${t}color3f inputs:diffuseColor.connect = `),n.push(i(s.map,"diffuse",s.color))):r.push(`${t}color3f inputs:diffuseColor = ${ye(s.color)}`),s.emissiveMap!==null?(r.push(`${t}color3f inputs:emissiveColor.connect = `),n.push(i(s.emissiveMap,"emissive"))):s.emissive.getHex()>0&&r.push(`${t}color3f inputs:emissiveColor = ${ye(s.emissive)}`),s.normalMap!==null&&(r.push(`${t}normal3f inputs:normal.connect = `),n.push(i(s.normalMap,"normal"))),s.aoMap!==null&&(r.push(`${t}float inputs:occlusion.connect = `),n.push(i(s.aoMap,"occlusion"))),s.roughnessMap!==null&&s.roughness===1?(r.push(`${t}float inputs:roughness.connect = `),n.push(i(s.roughnessMap,"roughness"))):r.push(`${t}float inputs:roughness = ${s.roughness}`),s.metalnessMap!==null&&s.metalness===1?(r.push(`${t}float inputs:metallic.connect = `),n.push(i(s.metalnessMap,"metallic"))):r.push(`${t}float inputs:metallic = ${s.metalness}`),s.alphaMap!==null?(r.push(`${t}float inputs:opacity.connect = `),r.push(`${t}float inputs:opacityThreshold = 0.0001`),n.push(i(s.alphaMap,"opacity"))):r.push(`${t}float inputs:opacity = ${s.opacity}`),s.isMeshPhysicalMaterial){let l=s;r.push(`${t}float inputs:clearcoat = ${l.clearcoat}`),r.push(`${t}float inputs:clearcoatRoughness = ${l.clearcoatRoughness}`),r.push(`${t}float inputs:ior = ${l.ior}`)}return` + }`}let s=e;if(s.map!==null?(r.push(`${t}color3f inputs:diffuseColor.connect = `),n.push(i(s.map,"diffuse",s.color))):r.push(`${t}color3f inputs:diffuseColor = ${Me(s.color)}`),s.emissiveMap!==null?(r.push(`${t}color3f inputs:emissiveColor.connect = `),n.push(i(s.emissiveMap,"emissive"))):s.emissive.getHex()>0&&r.push(`${t}color3f inputs:emissiveColor = ${Me(s.emissive)}`),s.normalMap!==null&&(r.push(`${t}normal3f inputs:normal.connect = `),n.push(i(s.normalMap,"normal"))),s.aoMap!==null&&(r.push(`${t}float inputs:occlusion.connect = `),n.push(i(s.aoMap,"occlusion"))),s.roughnessMap!==null&&s.roughness===1?(r.push(`${t}float inputs:roughness.connect = `),n.push(i(s.roughnessMap,"roughness"))):r.push(`${t}float inputs:roughness = ${s.roughness}`),s.metalnessMap!==null&&s.metalness===1?(r.push(`${t}float inputs:metallic.connect = `),n.push(i(s.metalnessMap,"metallic"))):r.push(`${t}float inputs:metallic = ${s.metalness}`),s.alphaMap!==null?(r.push(`${t}float inputs:opacity.connect = `),r.push(`${t}float inputs:opacityThreshold = 0.0001`),n.push(i(s.alphaMap,"opacity"))):r.push(`${t}float inputs:opacity = ${s.opacity}`),s.isMeshPhysicalMaterial){let l=s;r.push(`${t}float inputs:clearcoat = ${l.clearcoat}`),r.push(`${t}float inputs:clearcoatRoughness = ${l.clearcoatRoughness}`),r.push(`${t}float inputs:ior = ${l.ior}`)}return` def Material "Material_${s.id}" { def Shader "PreviewSurface" @@ -93,7 +93,7 @@ ${n.join(` `)} } -`}function ye(e){return`(${e.r}, ${e.g}, ${e.b})`}function we(e){return`(${e.x}, ${e.y})`}var Ce=ae;y.push(()=>{let e=new Codec("usdz",{extension:"usdz",name:"USDZ",remember:!0,export_options:{normal_type:{type:"select",label:"Normal Map Type",default:"opengl",options:{opengl:"OpenGL",directx:"DirectX"}}},fileName(){return G()+".usdz"},async compile(a={}){if(!Project)throw new Error("No project loaded");let t=Object.assign(this.getExportOptions(),a);Project.textures.forEach(s=>{if(!s.material)return;let l=new k(s.layers,s.uuid),u=l.findTexture("normal",!0);if(!u)return;let m=$(u,t.normal_type);m&&l.saveTexture(h.normal,m)}),N();let r=new Ce,n=new _.Scene;n.name="blockbench_export",n.add(Project.model_3d);let i=await r.parse(n);return this.dispatchEvent("compile",{model:i,options:t}),Canvas.scene.add(Project.model_3d),i},async export(a={}){let t=await this.compile(a);Blockbench.export({content:t,name:this.fileName(),startpath:this.startPath(),resource_id:"usdz",type:this.name,extensions:["usdz"],savetype:"buffer"},r=>this.afterDownload(r))}});o.exportUsdz=new Action("export_usdz",{category:"file",name:"Export USDZ",description:"Exports the current model as a USDZ file",icon:"stacks",async click(){if(!e)return;let a=await e.promptExportOptions();await e.export(a)}}),o.usdz=e,MenuBar.addAction(o.exportUsdz,"file.export")});C.push(()=>{MenuBar.removeAction("file.export_usdz")});y.push(()=>{o.bbmat=new Codec("material",{name:"Blockbench Material",extension:"bbmat",remember:!1,load_filter:{extensions:["bbmat"],type:"json"},compile(){if(!Texture.selected?.material||!Texture.selected?.layers_enabled)return;let e=Texture.selected.layers.map(a=>{let t=a.channel,r=a.canvas.toDataURL();return[t,r]});return JSON.stringify({version:K,channels:Object.fromEntries(e)})},parse(e,a){return e=typeof e=="string"?JSON.parse(e):e,e.version!==K?(Blockbench.showMessageBox({title:"Invalid Blockbench Material Version",message:`The material file "${a}" is not compatible with version ${F} of the PBR plugin.`,buttons:["OK"],confirm:0,width:400,cancel:0,checkboxes:{}},()=>null),{}):e.channels},load(e,a,t){if(!Project)return;let r=this.parse(e,a.path),n=Object.keys(r);if(!n.length)throw new Error("No valid channels found in the material");let i=r[h.albedo.id]??r[n[0]];n.includes("preview")&&(i=r.preview);let s=new Texture({name:pathToName(a.name),saved:!0,particle:!1,source:i,layers_enabled:!0});s.extend({material:!0});let l=n.map(u=>{if(!(u in h))return null;let m=r[u],d=new TextureLayer({name:u,data_url:m,visible:!0},s);return d.extend({channel:u}),d}).filter(Boolean);if(!l.length)throw new Error("No valid channel layers found in the material");i||s.fromDataURL(l[0].canvas.toDataURL()),s.add().select(),l.forEach(u=>{u.addForEditing(),s.width=Math.max(s.width,u.img.width),s.height=Math.max(s.height,u.img.height)}),s.updateChangesAfterEdit()},export(){Blockbench.export({resource_id:"material",type:this.name,extensions:[this.extension],name:`${Texture.selected?.name??this.fileName??"material"}.bbmat`,startpath:this.startPath(),content:this.compile()},e=>this.afterDownload(e))}}),o.bbMatExport=new Action("export_bbmat",{icon:"stacks",name:"Save as .bbmat",category:"file",condition:{project:!0,selected:{texture:!0},method(){return Texture.selected?.material}},click(){o.bbmat?.export?.()}}),o.bbMatImport=new Action("import_bbmat",{icon:"stacks",name:"Import .bbmat",category:"file",condition:{project:!0},click(){Blockbench.import({extensions:["bbmat"],type:"json",title:"Import .bbmat",multiple:!0},e=>{o.bbmat?.load&&e.forEach(a=>{o.bbmat.load(a.content,a,!0)})})}}),o.bbmat.export_action=o.bbMatExport,Texture.prototype.menu.addAction(o.bbMatExport),MenuBar.addAction(o.bbMatImport,"file.import")});C.push(()=>{Texture.prototype.menu.removeAction("export_bbmat"),MenuBar.removeAction("file.import.import_bbmat")});var Z=class e{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(h).map(t=>[t,h[t].default??new _.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([t,r])=>[t,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let t=Math.min(1,Math.max(0,a));return new _.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let a="#000000",t=Number(o.brushMetalnessSlider?.get()),r=Number(o.brushRoughnessSlider?.get()??1),n=(o.brushEmissiveColor?.get()??a).toString(),i=Number(o.brushHeightSlider?.get()),s=ColorPanel.get(),l={[h.albedo.id]:new _.Color(s),[h.metalness.id]:e.makeLinearColor(t),[h.roughness.id]:e.makeLinearColor(r),[h.emissive.id]:new _.Color(n??a),[h.height.id]:e.makeLinearColor(i)};return new e({colors:l})}};var Ee="materialBrushPresets",re=()=>JSON.parse(localStorage.getItem(Ee)||"{}"),ut=(e,a)=>{let t=re(),r=a??guid(),n=o.userMaterialBrushPresets?.getFormResult()??{},i={};return n.albedo&&(i.albedo=n.albedo.toString()),n.metalness&&(i.metalness=Number(n.metalness)),n.roughness&&(i.roughness=Number(n.roughness)),n.emissive&&(i.emissive=n.emissive.toString()),n.height&&(i.height=Number(n.height)),t[r]=[i,e??"New Preset",z(i)],localStorage.setItem(Ee,JSON.stringify(t)),r},Pe=({metalness:e,roughness:a,emissive:t,height:r,albedo:n})=>{e!==void 0&&o.brushMetalnessSlider?.setValue(e||0,!0),a!==void 0&&o.brushRoughnessSlider?.setValue(a??1,!0),t!==void 0&&o.brushEmissiveColor?.set(t??"#000000"),r!==void 0&&o.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},W=({id:e})=>Condition({project:!0,tools:["material_brush"],method(){let a=E();return(a?.layers_enabled&&a.layers.find(({channel:t})=>t&&t===e)!==void 0)===!0}}),mt=ie.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:h}},methods:{applyPreset(e){try{let[a,t]=this.userPresets[e],{metalness:r,roughness:n,emissive:i,height:s,albedo:l}=a;Pe({metalness:Number(r),roughness:Number(n),emissive:i.toString(),height:Number(s),albedo:l.toString()}),o.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${t}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(e){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let t=re(),r=this.userPresets[e][1]??e;delete t[e],localStorage.setItem("materialBrushPresets",JSON.stringify(t)),this.userPresets=t,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(e){o.userMaterialBrushPresets?.setFormValues({name:this.userPresets[e][1]??e,...this.userPresets[e][0]})},getSummary(e){return Object.entries(e).filter(([a])=>a in this.channels).map(([a,t])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${t}`:`${this.channels[a]?.label??a}: ${Number(t).toFixed(1)}`).join(` +`}function Me(e){return`(${e.r}, ${e.g}, ${e.b})`}function ye(e){return`(${e.x}, ${e.y})`}var Te=ae;y.push(()=>{let e=new Codec("usdz",{extension:"usdz",name:"USDZ",remember:!0,export_options:{normal_type:{type:"select",label:"Normal Map Type",default:"opengl",options:{opengl:"OpenGL",directx:"DirectX"}}},fileName(){return G()+".usdz"},async compile(a={}){if(!Project)throw new Error("No project loaded");let t=Object.assign(this.getExportOptions(),a);Project.textures.forEach(s=>{if(!s.material)return;let l=new k(s.layers,s.uuid),u=l.findTexture("normal",!0);if(!u)return;let m=$(u,t.normal_type);m&&l.saveTexture(h.normal,m)}),N();let r=new Te,n=new _.Scene;n.name="blockbench_export",n.add(Project.model_3d);let i=await r.parse(n);return this.dispatchEvent("compile",{model:i,options:t}),Canvas.scene.add(Project.model_3d),i},async export(a={}){let t=await this.compile(a);Blockbench.export({content:t,name:this.fileName(),startpath:this.startPath(),resource_id:"usdz",type:this.name,extensions:["usdz"],savetype:"buffer"},r=>this.afterDownload(r))}});o.exportUsdz=new Action("export_usdz",{category:"file",name:"Export USDZ",description:"Exports the current model as a USDZ file",icon:"stacks",async click(){if(!e)return;let a=await e.promptExportOptions();await e.export(a)}}),o.usdz=e,MenuBar.addAction(o.exportUsdz,"file.export")});C.push(()=>{MenuBar.removeAction("file.export_usdz")});y.push(()=>{o.bbmat=new Codec("material",{name:"Blockbench Material",extension:"bbmat",remember:!1,load_filter:{extensions:["bbmat"],type:"json"},compile(){if(!Texture.selected?.material||!Texture.selected?.layers_enabled)return;let e=Texture.selected.layers.map(a=>{let t=a.channel,r=a.canvas.toDataURL();return[t,r]});return JSON.stringify({version:K,channels:Object.fromEntries(e)})},parse(e,a){return e=typeof e=="string"?JSON.parse(e):e,e.version!==K?(Blockbench.showMessageBox({title:"Invalid Blockbench Material Version",message:`The material file "${a}" is not compatible with version ${F} of the PBR plugin.`,buttons:["OK"],confirm:0,width:400,cancel:0,checkboxes:{}},()=>null),{}):e.channels},load(e,a,t){if(!Project)return;let r=this.parse(e,a.path),n=Object.keys(r);if(!n.length)throw new Error("No valid channels found in the material");let i=r[h.albedo.id]??r[n[0]];n.includes("preview")&&(i=r.preview);let s=new Texture({name:pathToName(a.name),saved:!0,particle:!1,source:i,layers_enabled:!0});s.extend({material:!0});let l=n.map(u=>{if(!(u in h))return null;let m=r[u],d=new TextureLayer({name:u,data_url:m,visible:!0},s);return d.extend({channel:u}),d}).filter(Boolean);if(!l.length)throw new Error("No valid channel layers found in the material");i||s.fromDataURL(l[0].canvas.toDataURL()),s.add().select(),l.forEach(u=>{u.addForEditing(),s.width=Math.max(s.width,u.img.width),s.height=Math.max(s.height,u.img.height)}),s.updateChangesAfterEdit()},export(){Blockbench.export({resource_id:"material",type:this.name,extensions:[this.extension],name:`${Texture.selected?.name??this.fileName??"material"}.bbmat`,startpath:this.startPath(),content:this.compile()},e=>this.afterDownload(e))}}),o.bbMatExport=new Action("export_bbmat",{icon:"stacks",name:"Save as .bbmat",category:"file",condition:{project:!0,selected:{texture:!0},method(){return Texture.selected?.material}},click(){o.bbmat?.export?.()}}),o.bbMatImport=new Action("import_bbmat",{icon:"stacks",name:"Import .bbmat",category:"file",condition:{project:!0},click(){Blockbench.import({extensions:["bbmat"],type:"json",title:"Import .bbmat",multiple:!0},e=>{o.bbmat?.load&&e.forEach(a=>{o.bbmat.load(a.content,a,!0)})})}}),o.bbmat.export_action=o.bbMatExport,Texture.prototype.menu.addAction(o.bbMatExport),MenuBar.addAction(o.bbMatImport,"file.import")});C.push(()=>{Texture.prototype.menu.removeAction("export_bbmat"),MenuBar.removeAction("file.import.import_bbmat")});var Z=class e{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(h).map(t=>[t,h[t].default??new _.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([t,r])=>[t,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let t=Math.min(1,Math.max(0,a));return new _.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let a="#000000",t=Number(o.brushMetalnessSlider?.get()),r=Number(o.brushRoughnessSlider?.get()??1),n=(o.brushEmissiveColor?.get()??a).toString(),i=Number(o.brushHeightSlider?.get()),s=ColorPanel.get(),l={[h.albedo.id]:new _.Color(s),[h.metalness.id]:e.makeLinearColor(t),[h.roughness.id]:e.makeLinearColor(r),[h.emissive.id]:new _.Color(n??a),[h.height.id]:e.makeLinearColor(i)};return new e({colors:l})}};var Ce="materialBrushPresets",re=()=>JSON.parse(localStorage.getItem(Ce)||"{}"),ut=(e,a)=>{let t=re(),r=a??guid(),n=o.userMaterialBrushPresets?.getFormResult()??{},i={};return n.albedo&&(i.albedo=n.albedo.toString()),n.metalness&&(i.metalness=Number(n.metalness)),n.roughness&&(i.roughness=Number(n.roughness)),n.emissive&&(i.emissive=n.emissive.toString()),n.height&&(i.height=Number(n.height)),t[r]=[i,e??"New Preset",z(i)],localStorage.setItem(Ce,JSON.stringify(t)),r},Ee=({metalness:e,roughness:a,emissive:t,height:r,albedo:n})=>{e!==void 0&&o.brushMetalnessSlider?.setValue(e||0,!0),a!==void 0&&o.brushRoughnessSlider?.setValue(a??1,!0),t!==void 0&&o.brushEmissiveColor?.set(t??"#000000"),r!==void 0&&o.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},W=({id:e})=>Condition({project:!0,tools:["material_brush"],method(){let a=E();return(a?.layers_enabled&&a.layers.find(({channel:t})=>t&&t===e)!==void 0)===!0}}),mt=ie.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:h}},methods:{applyPreset(e){try{let[a,t]=this.userPresets[e],{metalness:r,roughness:n,emissive:i,height:s,albedo:l}=a;Ee({metalness:Number(r),roughness:Number(n),emissive:i.toString(),height:Number(s),albedo:l.toString()}),o.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${t}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(e){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let t=re(),r=this.userPresets[e][1]??e;delete t[e],localStorage.setItem("materialBrushPresets",JSON.stringify(t)),this.userPresets=t,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(e){o.userMaterialBrushPresets?.setFormValues({name:this.userPresets[e][1]??e,...this.userPresets[e][0]})},getSummary(e){return Object.entries(e).filter(([a])=>a in this.channels).map(([a,t])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${t}`:`${this.channels[a]?.label??a}: ${Number(t).toFixed(1)}`).join(` `)}},computed:{presets(){return Object.entries(this.userPresets)}},mounted(){this.userPresets=re()},template:`
        @@ -197,7 +197,7 @@ ${n.join(` .delete_preset:hover .material-icons { color: var(--color-accent); - }`),o.brushMetalnessSlider=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",tool_setting:"brush_metalness",settings:{min:0,max:1,step:.01,default:0},condition:()=>W(h.metalness)}),o.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",tool_setting:"brush_roughness",settings:{min:0,max:1,step:.01,default:1},condition:()=>W(h.roughness)}),o.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",tool_setting:"brush_emissive",condition:()=>W(h.emissive)}),o.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",tool_setting:"brush_height",settings:{min:0,max:1,step:.01,default:.5},condition:()=>W(h.height)}),o.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",category:"tools",toolbar:"brush",condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){return E()?.layers_enabled??!1}},allowed_view_modes:"textured",tool_settings:{brush_metalness:0,brush_roughness:1,brush_emissive:"#000000",brush_height:.5},brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(e,a,t,r,{size:n,softness:i,texture:s,x:l,y:u}){let m=Z.fromSettings(),d=Object.keys(m.colors),c=Math.floor(n-i*n/100),v=t;return s.layers.forEach(g=>{if(!g.visible||!d.includes(g.channel))return;let x=m.getChannel(g.channel);if(!x)return;let f=Math.sqrt((l-e)**2+(u-a)**2),p=Math.min(1,f/c);if(l%c<=p&&u%c<=p){let b=g.ctx.getImageData(e,a,1,1).data,M=new _.Color(`rgb(${b[0]}, ${b[1]}, ${b[2]})`);x.lerp(M,1)}g.ctx.fillStyle=x.getStyle(),g.ctx.fillRect(e,a,1,1),g.selected&&(v={r:x.r*255,g:x.g*255,b:x.b*255,a:r*255})}),v}},onCanvasClick(e){Painter.startPaintToolCanvas(e,e.event)},onSelect(){Painter.updateNslideValues(),N()},click(){A()}}),o.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:{project:!0},click(){o.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:mt,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(e){Pe({metalness:Number(e.metalness??o.brushMetalnessSlider?.get()),roughness:Number(e.roughness??o.brushRoughnessSlider?.get()),emissive:(e.emissive??o.brushEmissiveColor?.get()).toString(),height:Number(e.height??o.brushHeightSlider?.get()),albedo:(e.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(e,a){o.materialBrushTool?.select(),e===1&&Blockbench.textPrompt("Save Preset","New Preset",t=>{t&&(ut(t),Blockbench.showQuickMessage(`Preset "${t}" saved`,2e3))})}}).show()}}),MenuBar.addAction(o.materialBrushTool,"tools.0")});C.push(()=>{MenuBar.removeAction("tools.material_brush")});y.push(()=>{o.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","load_brush_preset","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Settings"})],condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});y.push(()=>{o.displaySettingsPanel=new Panel("display_settings",{name:"PBR Controls",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure","show_channel_select_menu"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});var q=e=>e.visible&&e.channel&&e.channel!==B,dt=()=>{let e=R();if(e)return e.texture.layers.filter(q);let a=E();return a?a.layers_enabled?a.layers.filter(q):Texture.all.map(t=>t.layers_enabled?[...t.layers.filter(q)]:[q(t)?t:null]).flat().filter(Boolean):[]},Le=["select_texture","update_texture_selection","finish_edit","add_texture"],De=()=>{Panels.channels_panel.inside_vue.textures=dt()};y.push(()=>{o.channelsPanelStyle=Blockbench.addCSS(` + }`),o.brushMetalnessSlider=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",tool_setting:"brush_metalness",settings:{min:0,max:1,step:.01,default:0},condition:()=>W(h.metalness)}),o.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",tool_setting:"brush_roughness",settings:{min:0,max:1,step:.01,default:1},condition:()=>W(h.roughness)}),o.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",tool_setting:"brush_emissive",condition:()=>W(h.emissive)}),o.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",tool_setting:"brush_height",settings:{min:0,max:1,step:.01,default:.5},condition:()=>W(h.height)}),o.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",category:"tools",toolbar:"brush",condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){return E()?.layers_enabled??!1}},allowed_view_modes:"textured",tool_settings:{brush_metalness:0,brush_roughness:1,brush_emissive:"#000000",brush_height:.5},brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(e,a,t,r,{size:n,softness:i,texture:s,x:l,y:u}){let m=Z.fromSettings(),d=Object.keys(m.colors),c=Math.floor(n-i*n/100),v=t;return s.layers.forEach(g=>{if(!g.visible||!d.includes(g.channel))return;let x=m.getChannel(g.channel);if(!x)return;let f=Math.sqrt((l-e)**2+(u-a)**2),p=Math.min(1,f/c);if(l%c<=p&&u%c<=p){let b=g.ctx.getImageData(e,a,1,1).data,M=new _.Color(`rgb(${b[0]}, ${b[1]}, ${b[2]})`);x.lerp(M,1)}g.ctx.fillStyle=x.getStyle(),g.ctx.fillRect(e,a,1,1),g.selected&&(v={r:x.r*255,g:x.g*255,b:x.b*255,a:r*255})}),v}},onCanvasClick(e){Painter.startPaintToolCanvas(e,e.event)},onSelect(){Painter.updateNslideValues(),N()},click(){A()}}),o.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:{project:!0},click(){o.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:mt,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(e){Ee({metalness:Number(e.metalness??o.brushMetalnessSlider?.get()),roughness:Number(e.roughness??o.brushRoughnessSlider?.get()),emissive:(e.emissive??o.brushEmissiveColor?.get()).toString(),height:Number(e.height??o.brushHeightSlider?.get()),albedo:(e.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(e,a){o.materialBrushTool?.select(),e===1&&Blockbench.textPrompt("Save Preset","New Preset",t=>{t&&(ut(t),Blockbench.showQuickMessage(`Preset "${t}" saved`,2e3))})}}).show()}}),MenuBar.addAction(o.materialBrushTool,"tools.0")});C.push(()=>{MenuBar.removeAction("tools.material_brush")});y.push(()=>{o.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","load_brush_preset","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Settings"})],condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});y.push(()=>{o.displaySettingsPanel=new Panel("display_settings",{name:"PBR Controls",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure","show_channel_select_menu"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});var q=e=>e.visible&&e.channel&&e.channel!==R,dt=()=>{let e=B();if(e)return e.texture.layers.filter(q);let a=E();return a?a.layers_enabled?a.layers.filter(q):Texture.all.map(t=>t.layers_enabled?[...t.layers.filter(q)]:[q(t)?t:null]).flat().filter(Boolean):[]},Pe=["select_texture","update_texture_selection","finish_edit","add_texture"],Le=()=>{Panels.channels_panel.inside_vue.textures=dt()};y.push(()=>{o.channelsPanelStyle=Blockbench.addCSS(` .texture_channel { color: var(--color-text); flex: 1; @@ -263,7 +263,7 @@ ${n.join(` border-top: 1px solid var(--color-border); padding-right: 0; } - `),o.channelsPanel=new Panel("channels_panel",{name:"PBR Channels",id:"channels_panel",icon:"gallery_thumbnail",condition:{project:!0,selected:{texture:!0},modes:["paint","edit"]},toolbars:[],component:{name:"ChannelsPanel",data(){return{channels:h,textures:[]}},methods:{openMenu(e){o.channelMenu?.open(e)},selectTexture(e){Modes.options.paint.select(),e.select(),e.scrollTo()},channelEnabled(e){return e.channel&&e.channel!==B&&e.channel in this.channels},getImgSrc(e){return e.img?.src??`data:image/png;base64,${e.canvas.toDataURL()}`}},template:` + `),o.channelsPanel=new Panel("channels_panel",{name:"PBR Channels",id:"channels_panel",icon:"gallery_thumbnail",condition:{project:!0,selected:{texture:!0},modes:["paint","edit"]},toolbars:[],component:{name:"ChannelsPanel",data(){return{channels:h,textures:[]}},methods:{openMenu(e){o.channelMenu?.open(e)},selectTexture(e){Modes.options.paint.select(),e.select(),e.scrollTo()},channelEnabled(e){return e.channel&&e.channel!==R&&e.channel in this.channels},getImgSrc(e){return e.img?.src??`data:image/png;base64,${e.canvas.toDataURL()}`}},template:`
        -
        `},expand_button:!0,growable:!0,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:350,folded:!0},insert_after:"layers",insert_before:"color"}),Blockbench.on(Le.join(" "),De)});C.push(()=>{Le.forEach(e=>{Blockbench.removeListener(e,De)})});(()=>{let e=()=>{y.forEach(t=>t())},a=()=>{J(),C.forEach(t=>t()),Object.entries(o).forEach(([t,r])=>{try{r?.delete()}catch(n){console.warn(`Failed to delete ${t} action:`,n)}})};BBPlugin.register("pbr_preview",{version:F,title:"PBR Tools",author:"Jason J. Gardner",description:"Create and view PBR materials in Blockbench. Export USDZ scenes and textures for Java or RenderDragon shaders.",tags:["Minecraft: Java Edition","Minecraft: Bedrock Edition","PBR"],icon:"icon.png",variant:"both",await_loading:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.3",onload:e,onunload:a})})();})(); +
      `},expand_button:!0,growable:!0,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:350,folded:!0},insert_after:"layers",insert_before:"color"}),Blockbench.on(Pe.join(" "),Le)});C.push(()=>{Pe.forEach(e=>{Blockbench.removeListener(e,Le)})});(()=>{let e=()=>{y.forEach(t=>t())},a=()=>{J(),C.forEach(t=>t()),Object.entries(o).forEach(([t,r])=>{try{r?.delete()}catch(n){console.warn(`Failed to delete ${t} action:`,n)}})};BBPlugin.register("pbr_preview",{version:F,title:"PBR Tools",author:"Jason J. Gardner",description:"Create and view PBR materials in Blockbench. Export USDZ scenes and textures for Java or RenderDragon shaders.",tags:["Minecraft: Java Edition","Minecraft: Bedrock Edition","PBR"],icon:"icon.png",variant:"both",await_loading:!0,repository:"https://github.com/jasonjgardner/blockbench-plugins",has_changelog:!0,min_version:"4.10.3",onload:e,onunload:a})})();})(); diff --git a/src/pbr_preview/src/lib/MaterialBrush.ts b/src/pbr_preview/src/lib/MaterialBrush.ts index 28e59c1a..6f2eb2dd 100644 --- a/src/pbr_preview/src/lib/MaterialBrush.ts +++ b/src/pbr_preview/src/lib/MaterialBrush.ts @@ -65,6 +65,9 @@ export class MaterialBrush { [CHANNELS.roughness.id]: MaterialBrush.makeLinearColor(roughnessValue), [CHANNELS.emissive.id]: new THREE.Color(emissiveValue ?? defaultEmissive), [CHANNELS.height.id]: MaterialBrush.makeLinearColor(heightValue), + // TODO: Add normal map color input + // [CHANNELS.normal.id]: + // CHANNELS.normal.default ?? new THREE.Color("#8080ff"), }; return new MaterialBrush({ colors }); diff --git a/src/pbr_preview/src/lib/PbrMaterials.ts b/src/pbr_preview/src/lib/PbrMaterials.ts index 93631f4d..09f3492b 100644 --- a/src/pbr_preview/src/lib/PbrMaterials.ts +++ b/src/pbr_preview/src/lib/PbrMaterials.ts @@ -86,7 +86,8 @@ export default class PbrMaterial { aoMap: this.getTexture(CHANNELS.ao), bumpMap: this.getTexture(CHANNELS.height), normalMap, - normalScale: new THREE.Vector2(-1, 1), + // TODO: Use project settings to determine if normal map should be flipped + //normalScale: new THREE.Vector2(-1, 1), metalnessMap, metalness: metalnessMap ? 1 : 0, roughnessMap, diff --git a/src/pbr_preview/src/lib/applyPbrMaterial.ts b/src/pbr_preview/src/lib/applyPbrMaterial.ts index 6e6a6802..294f0e9e 100644 --- a/src/pbr_preview/src/lib/applyPbrMaterial.ts +++ b/src/pbr_preview/src/lib/applyPbrMaterial.ts @@ -64,7 +64,7 @@ function applyToMesh( } }); - return updateFaces(applied); + return applied; } function applyToCube( @@ -82,7 +82,7 @@ function applyToCube( } }); - return updateFaces(applied); + return applied; } /** @@ -98,16 +98,20 @@ export const applyPbrMaterial = ( return; } + const appliedTextures = Project.elements.map( + (item) => + (item instanceof Mesh && applyToMesh(item, materialParams)) || + (item instanceof Cube && applyToCube(item, materialParams)) + ); + + const allTextures = appliedTextures.reduce( + (acc, val) => ({ ...acc, ...val }), + {} + ); + // @ts-expect-error - Property 'pbr_active' does not exist on type 'Project' Project.pbr_active = - Texture.all.length > 0 && - Project.elements - .map( - (item) => - (item instanceof Mesh && applyToMesh(item, materialParams)) || - (item instanceof Cube && applyToCube(item, materialParams)) - ) - .filter(Boolean).length > 0; + Texture.all.length > 0 && allTextures && updateFaces(allTextures); }; export const debounceApplyPbrMaterial = (wait = 100) => From c56669d8ebe456ab16a9368c6e1291f520c76fc0 Mon Sep 17 00:00:00 2001 From: Jason Gardner Date: Sat, 22 Jun 2024 08:06:54 -0500 Subject: [PATCH 33/50] fix: Remove neutral tone mapping - Remove tone mapping which is not available in Blockbench's THREE.js --- plugins/pbr_preview/pbr_preview.js | 2 +- src/pbr_preview/src/lib/actions/tonemapping.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index 1836ef7b..8e1d02f1 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1,4 +1,4 @@ -"use strict";(()=>{var _=THREE,ie=Vue,le=window.JSZip;var F="1.2.0",K="1.0.0",R="_NONE_",h={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new _.Color(16777215),regex:new RegExp("(s|_)*(basecolor|color|albedo)","i")},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new _.Color(0),regex:new RegExp("[ _]*metal(lic|ness)?","i")},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new _.Color(0),regex:new RegExp("[ _]*(emissive|emission)","i")},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new _.Color(16777215),regex:new RegExp("[ _]*rough(ness)?","i")},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new _.Color(16777215),regex:new RegExp("[ _]*(height|bump)","i")},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new _.Color("rgb(128, 128, 255)"),regex:new RegExp("[ _]*normal","i")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new _.Color(16777215),regex:new RegExp("[ _]*(ao|ambientocclusion|ambient occlusion)","i")}},o={},y=[],C=[];var ce=[...Object.keys(h).map(e=>h[e].id),R];y.push(()=>{o.channelProp=new Property(TextureLayer,"enum","channel",{default:R,values:ce,label:"PBR Channel",exposed:!1}),o.textureChannelProp=new Property(Texture,"enum","channel",{default:R,values:ce,label:"PBR Channel",exposed:!1}),o.materialTextureProp=new Property(Texture,"boolean","material",{default:!1,label:"Material Texture"}),o.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),o.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),o.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!1,values:[],label:"PBR Mode"})});function E(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(e=>e.selected)??null:Texture.all.find(e=>e.selected)??Texture.getDefault()}function B(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(e=>e.selected)??Project.selected_texture.layers[0]:E()?.getActiveLayer()??null}function G(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(E()?.name??"texture")}function ue(e,a){let t;return function(...r){let n=()=>{t=void 0,e.apply(this,r)};clearTimeout(t),t=setTimeout(n,a)}}function z(e){let a=MediaPreview.renderer??new _.WebGLRenderer({alpha:!0,antialias:!0}),t=new _.Scene,r=new _.PerspectiveCamera(75,96/96,.1,1e3),n=new _.AmbientLight(16777215,.75);t.add(n);let i=new _.PointLight(16777215,1,100);i.position.set(5,5,5),t.add(i);let s=new _.SphereGeometry(1,32,32),l=e instanceof _.MeshStandardMaterial&&e.isMeshStandardMaterial?e:new _.MeshStandardMaterial({color:e.albedo,metalness:e.metalness??0,roughness:e.roughness??1,emissive:e.emissive,bumpScale:e.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),u=new _.Mesh(s,l);t.add(u),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(t,r);let m=a.domElement.toDataURL();return l.dispose(),MediaPreview.renderer||(a.clear(),a.dispose()),m}function Y(e,a){let t=a??document.createElement("canvas"),r=t.getContext("2d");if(!r)return t.remove(),null;let n=Math.max(Project?Project.texture_width:16,16),i=Math.max(Project?Project.texture_height:16,16);t.width=n,t.height=i,r.fillStyle=`rgb(${e.r*255}, ${e.g*255}, ${e.b*255})`,r.fillRect(0,0,n,i);let s=t.toDataURL();return a||t.remove(),s}var Ve=(e=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return e?a.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):a},k=class e{constructor(a,t){this._scope=a??Ve(),this._materialUuid=t}merToCanvas(){let a=this.getTexture(h.emissive),t=this.getTexture(h.roughness),r=this.getTexture(h.metalness);if(!a&&!t&&!r){let{metalness:n,emissive:i,roughness:s}=this.decodeMer();n&&(r=e.makePixelatedCanvas(n)),i&&(a=e.makePixelatedCanvas(i)),s&&(t=e.makePixelatedCanvas(s))}return{emissiveMap:a,roughnessMap:t,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(h.emissive),roughnessMap:this.getTexture(h.roughness),metalnessMap:this.getTexture(h.metalness)},i=this.getTexture(h.normal);return new _.MeshStandardMaterial({map:this.getTexture(h.albedo)??e.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(s=>s.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(h.ao),bumpMap:this.getTexture(h.height),normalMap:i,metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}renderMaterialPreview(){return z(this.getMaterial())}saveTexture(a,t){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=t.uuid,t.extend({channel:a.id}))}findTexture(a,t=!0){if(!Project)return null;let r=this._scope.find(u=>u.channel&&(u.channel===a||u.channel===a.id));if(r)return r;let[n,i]=typeof a=="string"?[a,new RegExp(`_*${a}(.[^.]+)?$`,"i")]:[a.id,a.regex??new RegExp(`_*${a.id}(.[^.]+)?$`,"i")];Project.pbr_materials=Project.pbr_materials??{};let s=Project.pbr_materials[this._materialUuid];if(t&&!s?.length&&n!==R)return this._scope.find(u=>i.test(u.name))??null;let l=s?.[n];return l?this._scope.find(u=>u.uuid===l)??null:null}static makePixelatedCanvas(a){let t=new _.CanvasTexture(a,void 0,void 0,void 0,_.NearestFilter,_.NearestFilter);return t.needsUpdate=!0,t}getTexture(a){let t=this.findTexture(a);return t?e.makePixelatedCanvas(t.canvas):null}static extractChannel(a,t){let r=a.canvas,{width:n,height:i}=r,s=r.getContext("2d");if(!s||!n||!i)return null;let l=document.createElement("canvas");l.width=n,l.height=i;let u=l.getContext("2d");if(!u)return null;let m={r:0,g:1,b:2,a:3}[t],{data:d}=s.getImageData(0,0,n,i),c=new Uint8ClampedArray(n*i*4);for(let g=0;ga){x[f]=v.data[f],x[f+1]=v.data[f+1],x[f+2]=v.data[f+2],x[f+3]=255;continue}x[f]=0,x[f+1]=0,x[f+2]=0,x[f+3]=255}return m.putImageData(new ImageData(x,l.width,l.height),0,0),{metalness:r,emissive:l,emissiveLevel:n,roughness:i,sss:s}}createMer(a=!1){let t=this.findTexture(h.metalness,a),r=this.findTexture(h.emissive,a),n=this.findTexture(h.roughness,a),i=this.findTexture("sss",!1),s=Math.max(t?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),l=Math.max(t?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),u=document.createElement("canvas");u.width=s,u.height=l;let m=u.getContext("2d");if(!m)return null;let d=t?.img?e.extractChannel(t,"r"):null,c=r?.img?e.extractChannel(r,"g"):null,v=n?.img?e.extractChannel(n,"b"):null,g=i&&i?.img?e.extractChannel(i,"a"):null,x=d?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),f=c?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),p=v?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),b=g?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(new Uint8ClampedArray(s*l*4).fill(255),s,l),M=new Uint8ClampedArray(s*l*4);for(let w=0;w{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createTexturesFromNormal(a){let t=this.decodeLabPbrNormal(a);return Object.entries(t).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}};var V=class{constructor({lightHeight:a=.66,ambientLight:t=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:n=[1,1,1]}={}){this.lightHeight=a,this.ambientLight=t,this.minLightIntensity=r,this.lightDiffuse=n}bake(a,t,r){let n=t instanceof HTMLCanvasElement?t:this.createCanvas(t.width,t.height),i=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),s=n.getContext("2d"),l=i.getContext("2d");s.drawImage(t,0,0),l.drawImage(r,0,0);let u=s.getImageData(0,0,t.width,t.height),m=l.getImageData(0,0,r.width,r.height),d=[],c=[];for(let g=0;g{let x=this.createCanvas(t.width,t.height),f=x.getContext("2d"),p=f.getImageData(0,0,x.width,x.height),b=[Math.cos(g),Math.sin(g),this.lightHeight];for(let M=0;M{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new k(r.layers_enabled?r.layers:Project.textures,r.uuid),i=n.findTexture(h.albedo);if(!i){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let s=n.findTexture(h.normal);if(!s){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let u=new V(e).bake(a,i.canvas,s.canvas),m=new Texture({name:`${i.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(u[0].toDataURL()),d=t?c=>{let v=n.findTexture(h.emissive);if(!v)return c;let g=v.canvas;if(!g.getContext("2d"))return c;let f=Math.max(c.width,g.width,Project?Project.texture_width:16),p=Math.max(c.height,g.height,Project?Project.texture_height:16),b=document.createElement("canvas");b.width=f,b.height=p;let M=b.getContext("2d");return M?(M.drawImage(c,0,0),M.globalCompositeOperation="screen",M.drawImage(g,0,0),b):c}:c=>c;u.forEach((c,v)=>{new TextureLayer({name:`baked_${v+1}`,data_url:d(c).toDataURL()},m).addForEditing()}),m.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};y.push(()=>{o.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(e){let a=new _.Color(e.ambientLight.toString()),t=new _.Color(e.lightDiffuse.toString());me({ambientLight:[a.r,a.g,a.b],lightDiffuse:[t.r,t.g,t.b],lightHeight:Number(e.lightHeight),minLightIntensity:Number(e.minLightIntensity)},e.directions??8,e.blendEmissive??!1)}}),o.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){o.bakeTexturesDialog?.show()}}),MenuBar.addAction(o.bakeTexturesAction,"tools")});C.push(()=>{MenuBar.removeAction("tools.bake_textures")});function de(e,a){let t=e.getTexture();if(!t||!Project)return null;let r=Project.materials[t.uuid];r.isShaderMaterial&&!Project.bb_materials[t.uuid]?Project.bb_materials[t.uuid]=r:r.isMeshStandardMaterial&&r.dispose();let n=new k(t.layers_enabled?t.layers.filter(i=>i.visible)??null:Project.textures,t.uuid).getMaterial({side:Canvas.getRenderSide(t),...a});return Project.materials[t.uuid]=_.ShaderMaterial.prototype.copy.call(n,r),t}function Qe(e){return Object.values(e).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function Je(e,a){let t={};return e.forAllFaces(r=>{let n=de(r,a);n&&(t[n.uuid]=n)}),t}function Xe(e,a){let t={};return Object.keys(e.faces).forEach(r=>{let n=e.faces[r],i=de(n,a);i&&(t[i.uuid]=i)}),t}var N=(e={})=>{if(!Project)return;let t=Project.elements.map(r=>r instanceof Mesh&&Je(r,e)||r instanceof Cube&&Xe(r,e)).reduce((r,n)=>({...r,...n}),{});Project.pbr_active=Texture.all.length>0&&t&&Qe(t)},A=(e=100)=>ue(N,e);var te={},ee=()=>Condition({modes:["edit","paint"],selected:{texture:!0},project:!0,method(){let e=E();return e&&!e.material?!0:e?.material===!0&&B()!==null&&Modes.paint}}),he=()=>Condition({modes:["paint","edit"],selected:{texture:!0},method(){let e=E();if(e?.material&&Modes.edit)return!1;let a=B()??e;return a?.channel&&a.channel!==R}});y.push(()=>{Object.entries(h).forEach(([e,a])=>{te[e]=new Action(`assign_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:ee,click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t)return;Undo.initEdit({layers:[t]}),t.extend({channel:a.id});let r=t instanceof TextureLayer?t.texture:t;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([n,i])=>{i===t.uuid&&(delete Project.pbr_materials[r.uuid][n],t.channel=R)}),r.uuid===t.uuid&&(Project.pbr_materials[r.uuid]={}),Project.pbr_materials[r.uuid][e]=t.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${t.name}" to ${a.label} channel`,2e3),N()}})})});C.push(()=>{Object.values(te).forEach(e=>{e.delete()})});y.push(()=>{o.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:he,click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e)return;Undo.initEdit({layers:[e]});let a=e instanceof TextureLayer?e.texture:e,t=e.channel;Project.pbr_materials[a.uuid]={},e.channel=R,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${e.name}" from ${t} channel`,2e3),A()}}),o.channelMenu=new Menu("channel_menu",[...Object.keys(h).map(e=>`assign_channel_${e}`),"unassign_channel"],{onOpen(){A()}}),o.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",condition:()=>ee()||he(),click(e){o.channelMenu?.open(e)},children:[...Object.values(te),o.unassignChannel]}),o.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:ee,click(e){o.channelMenu?.open(e)}}),o.openChannelMenu&&(MenuBar.addAction(o.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(o.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(o.openChannelMenu,"0")),Toolbars.layers.add(o.showChannelMenu,1)});C.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(o.showChannelMenu)});function $(e,a="DirectX",t=!1){let r=e.canvas.getContext("2d");if(!r)return null;let n=Math.max(e.img.width??e.canvas.width,Project?Project.texture_width:0,16),i=Math.max(e.img.height??e.canvas.height,Project?Project.texture_height:0,16),{data:s}=r.getImageData(0,0,n,i),l=document.createElement("canvas"),u=l.getContext("2d");if(!u)return null;let m=(p,b)=>{let M=(p+b*n)*4;return s[M]/255};l.width=n,l.height=i,u.drawImage(e.img,0,0,n,i);let d=u.getImageData(0,0,n,i),c=d.data,v=p=>{let b=Math.sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);return[p[0]/b,p[1]/b,p[2]/b]};for(let p=0;p{let f=(g+x*t)*4;return n[f]/255};i.width=t,i.height=r,s.drawImage(e.img,0,0,t,r);let u=s.getImageData(0,0,t,r),m=u.data;for(let g=0;g{let t=B()??E()??Texture.getDefault();if(!t)return;let r=$(t,a,!1);if(!r){Blockbench.showQuickMessage("Failed to generate normal map",2e3);return}r.select(e),new k(t instanceof Texture&&t.layers_enabled?t.layers:null,t.uuid).saveTexture(h.normal,r),Blockbench.showQuickMessage("Normal map generated",2e3)};y.push(()=>{o.generateDirectXNormal=new Action("generate_dx_normal",{icon:h.normal.icon??"altitude",name:"Generate DirectX Normal Map",description:"Generates a DirectX normal map from the height map",condition:()=>(B()??E())!==null,click:e=>ge(e)}),o.generateOpenGlNormal=new Action("generate_opengl_normal",{icon:h.normal.icon??"altitude",name:"Generate OpenGL Normal Map",description:"Generates an OpenGL normal map from the height map",condition:()=>(B()??E())!==null,click:e=>ge(e,"OpenGL")}),o.generateAo=new Action("generate_ao",{icon:h.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let e=B()??E()??Texture.getDefault();if(!e)return;let a=new k(e instanceof Texture&&e.layers_enabled?e.layers:null,e.uuid),t=a.findTexture(h.normal)??$(e);if(!t){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=pe(t);if(r){a.saveTexture(h.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),o.generateNormal=new Action("generate_normal",{children:[o.generateDirectXNormal,o.generateOpenGlNormal],name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(B()??E())!==null,click(){},icon:h.normal.icon??"altitude"}),MenuBar.addAction(o.generateNormal,"tools"),MenuBar.addAction(o.generateAo,"tools")});C.push(()=>{MenuBar.removeAction("tools.generate_normal"),MenuBar.removeAction("tools.generate_ao")});var Ze=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},We=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};y.push(()=>{o.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let e=E();if(!e)return;let t=new k(e.layers_enabled?e.layers:[e],e.uuid).createLabPbrOutput();if(t===null)return;let r=e.name??(Project?Project.getDisplayName():"texture");await Promise.all([Ze(t.normalMap,pathToName(r)),We(t.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),o.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let e=TextureLayer.selected?.texture??Texture.all.find(t=>t.selected)??Texture.getDefault(),a=new k(e.layers_enabled?e.layers:[e],e.uuid);if(pathToName(e.name).endsWith("_n")){a.createTexturesFromNormal(e);return}if(pathToName(e.name).endsWith("_s")){a.createTexturesFromSpecular(e);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(o.generateLabPbr,"file.export"),MenuBar.addAction(o.decodeLabPbr,"tools")});C.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});y.push(()=>{o.createMaterialTexture=new Action("create_material_texture",{icon:"deployed_code",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let e={...h},a=new Texture({name:"New Material",saved:!1,particle:!1});a.extend({material:!0});let t=Texture.all.filter(s=>(s.selected||s.multi_selected)&&!s.material)??Texture.all,r=E(),n=r?new k(t,r.uuid):null;try{let s=n?.findTexture(h.albedo,!0)?.canvas.toDataURL()??r?.canvas.toDataURL()??Y(new _.Color(8421504),a.canvas);if(!s)return;a.fromDataURL(s);let l=new TextureLayer({name:e.albedo.label,visible:!0,data_url:s,keep_size:!0},a);l.extend({channel:e.albedo.id}),l.addForEditing(),l.texture.updateChangesAfterEdit(),n?.saveTexture(e.albedo,l),delete e.albedo}catch(s){console.warn("Failed to create base color texture",s),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let i=Object.keys(e).reverse().map(s=>{let l=h[s],u=n?.findTexture(l,!0),m=u?u.canvas.toDataURL():Y(l.default??new _.Color(0));if(!m)return;let d=new TextureLayer({name:l.label,visible:!0,data_url:m,keep_size:!0},a);return d.extend({channel:l.id}),n?.saveTexture(l,d),d}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:i}),a.add().select(),a.activateLayers(),i.map(s=>{s.addForEditing(),a.width=Math.max(a.width,s.img.width),a.height=Math.max(a.height,s.img.height)}),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(o.createMaterialTexture,"tools"),Toolbars.texturelist.add(o.createMaterialTexture,3)});C.push(()=>{MenuBar.removeAction("tools.create_material_texture"),Toolbars.texturelist.remove("create_material_texture")});var Q=(e,a)=>{let t=E()??Texture.getDefault(),r=new k(t.layers_enabled?t.layers:Project?Project.textures:null,t.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[i,s]=Project?[e?`${e}_mer`:`${t.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:i,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},a)})};y.push(()=>{o.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{Q()}catch(e){console.error("Failed to export MER map:",e),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),o.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let e=E()??Texture.getDefault(),a=new k([e],e.uuid),t=a.decodeMer(),r=[h.metalness,h.emissive,h.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new Texture({name:`${e?.name}_${i}`,keep_size:!1}).fromDataURL(s.toDataURL());l.add(!0),a.saveTexture(n,l)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>E()?.layers_enabled===!0,click(){let e=E()??Texture.getDefault(),a=new k(e.layers_enabled?e.layers:[e],e.uuid),t=a.decodeMer(),r=[h.metalness,h.emissive,h.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new TextureLayer({name:`${e?.name}_${i}`,data_url:s.toDataURL()},e);a.saveTexture(n,l),l.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(o.decodeMer,"tools"),MenuBar.addAction(o.generateMer,"file.export")});C.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var qe=()=>{Project&&Project.textures.forEach(e=>{let a=new k(null,e.uuid),t=a.findTexture(h.normal,!1),r=a.findTexture(h.height,!1),n=a.findTexture(h.albedo,!1),i=a.findTexture(h.metalness,!1)?.name,s=a.findTexture(h.emissive,!1)?.name,l=a.findTexture(h.roughness,!1)?.name,u={};return n||(u.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!i&&!s&&!l&&(u.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},u.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},u.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),t&&(u.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(u.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),t&&r&&(u.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),o.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:u,cancelIndex:1,onConfirm(m){let d=G(),c=i||s||l,v={format_version:"1.16.100","minecraft:texture_set":{color:(n?d:m.baseColor?.toHexString())??d,metalness_emissive_roughness:[m.metalness??0,m.emissive??0,m.roughness??255]}};m.depthMap==="normal"&&t||!r&&t?v["minecraft:texture_set"].normal=`${d}_normal`:(!t||m.depthMap==="heightmap")&&r&&(v["minecraft:texture_set"].heightmap=`${d}_heightmap`);let g=p=>{if(!m.depthMap)return p();let b=m.depthMap==="normal"||m.depthMap&&!r,M=b?t:r;if(!M)return p();Blockbench.export({content:M.canvas.toDataURL()??"",type:"PNG",name:`${d}_${b?"normal":"heightmap"}`,extensions:["png"],resource_id:m.depthMap,startpath:Project.export_path,savetype:"image"},w=>{v["minecraft:texture_set"][b?"normal":"heightmap"]=pathToName(w,!1),p()})},x=p=>{if(!n)return p();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:d,startpath:Project.export_path,savetype:"image"},b=>{v["minecraft:texture_set"].color=pathToName(b,!1),p()})},f=()=>g(()=>{x(()=>{Blockbench.export({content:JSON.stringify(v,null,2),type:"JSON",name:`${d}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),o.textureSetDialog?.hide()})})});if(c){try{Q(d,p=>{v["minecraft:texture_set"].metalness_emissive_roughness=pathToName(p,!1),f()})}catch(p){console.warn("Failed to export MER map:",p),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}f()}}),o.textureSetDialog.show()})};y.push(()=>{o.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){qe()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(o.createTextureSet,"file.export")});C.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});y.push(()=>{o.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(e){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=e}),Preview.selected.renderer.physicallyCorrectLights=e,Blockbench.showQuickMessage(`Physically corrected lighting is now ${e?"enabled":"disabled"}`,2e3),e&&o.togglePbr?.set(!0),N()},click(){}}),MenuBar.addAction(o.toggleCorrectLights,"preview")});C.push(()=>{MenuBar.removeAction("preview.correct_lights")});var J=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(e=>{e instanceof Cube&&Object.keys(e.faces).forEach(a=>{let r=e.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var fe=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],xe=()=>Project&&Project.pbr_active&&N(),Ke=()=>{Blockbench.on(fe.join(" "),xe)},be=()=>{fe.forEach(e=>{Blockbench.removeListener(e,xe)})};y.push(()=>{o.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(e){if(e){N(),Ke(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}J(),be(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(o.togglePbr,"view")});C.push(()=>{be(),MenuBar.removeAction("view.toggle_pbr")});var ve=e=>{let a=Math.max(-2,Math.min(2,e));Preview.all.forEach(t=>{t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};y.push(()=>{o.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(o.tonemappingSelect?.get())===_.NoToneMapping&&o.tonemappingSelect.change(_.LinearToneMapping.toString()),o.togglePbr?.set(!0)},onChange(e){ve(Number(e))},onAfter(){A()}}),o.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>o.exposureSlider!==void 0&&Number(o.exposureSlider?.get())!==1,click(){ve(1),o.exposureSlider?.setValue(1,!0),A()}}),o.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:_.NoToneMapping,value:Preview.selected.renderer.toneMapping??_.NoToneMapping,icon:"monochrome_photos",options:{[_.NoToneMapping]:"No Tone Mapping",[_.LinearToneMapping]:"Linear",[_.ReinhardToneMapping]:"Reinhard",[_.CineonToneMapping]:"Cineon",[_.NeutralToneMapping]:"Neutral",[_.ACESFilmicToneMapping]:"ACES"},onChange({value:e}){Preview.selected.renderer.toneMapping=Number(e);let a=1;Preview.selected.renderer.toneMapping===_.NoToneMapping?o.exposureSlider?.setValue(a,!0):a=Number(o.exposureSlider?.get()??1),Preview.all.forEach(t=>{t.renderer.toneMapping=Number(e),t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(e)}`,2e3),o.togglePbr&&!o.togglePbr.value&&o.togglePbr.set(!0),N()}})});var ae=class{async parse(a){let t=new le,r="model.usda";t.file(r,"");let n=we(),i={},s={};a.traverseVisible(m=>{if(!m.isMesh)return;let d=m;if(!d.material.isMeshStandardMaterial){console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",m);return}let c=d.geometry,v=d.material,g="geometries/Geometry_"+c.id+".usd";if(!t.file(g)){let x=rt(c);t.file(g,et(x))}v.uuid in i||(i[v.uuid]=v),n+=tt(d,c,v)}),n+=lt(i,s),t.file(r,n),n=null;for(let m in s){let d=s[m],c=m.split("_")[1],v=d.format===_.RGBAFormat,g=Ye(d.image,c),f=await(await new Promise(p=>g.toBlob(b=>b&&p(b),v?"image/png":"image/jpeg",1))).arrayBuffer();t.file(`textures/Texture_${m}.${v?"png":"jpg"}`,f)}let l=0;t.forEach(async m=>{let d=34+m.length;l+=d;let c=l&63,v=await t.file(m).async("uint8array");if(c!==4){let g=64-c,x=new Uint8Array(g),f=new Uint8Array(v.length+g);f.set(v,0),f.set(x,v.length),t.file(m,f)}l+=v.length});let u=await t.generateAsync({type:"blob",compression:"STORE"});return new Uint8Array(await u.arrayBuffer())}};function Ye(e,a){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=1024/Math.max(e.width,e.height),r=document.createElement("canvas");r.width=e.width*Math.min(1,t),r.height=e.height*Math.min(1,t);let n=r.getContext("2d");if(n.imageSmoothingEnabled=!1,n.drawImage(e,0,0,r.width,r.height),a!==void 0){let i=parseInt(a,16),s=(i>>16&255)/255,l=(i>>8&255)/255,u=(i&255)/255,m=n.getImageData(0,0,r.width,r.height),d=m.data;for(let c=0;c{var _=THREE,ie=Vue,le=window.JSZip;var F="1.2.0",K="1.0.0",R="_NONE_",h={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new _.Color(16777215),regex:new RegExp("(s|_)*(basecolor|color|albedo)","i")},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new _.Color(0),regex:new RegExp("[ _]*metal(lic|ness)?","i")},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new _.Color(0),regex:new RegExp("[ _]*(emissive|emission)","i")},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new _.Color(16777215),regex:new RegExp("[ _]*rough(ness)?","i")},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new _.Color(16777215),regex:new RegExp("[ _]*(height|bump)","i")},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new _.Color("rgb(128, 128, 255)"),regex:new RegExp("[ _]*normal","i")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new _.Color(16777215),regex:new RegExp("[ _]*(ao|ambientocclusion|ambient occlusion)","i")}},o={},y=[],C=[];var ce=[...Object.keys(h).map(e=>h[e].id),R];y.push(()=>{o.channelProp=new Property(TextureLayer,"enum","channel",{default:R,values:ce,label:"PBR Channel",exposed:!1}),o.textureChannelProp=new Property(Texture,"enum","channel",{default:R,values:ce,label:"PBR Channel",exposed:!1}),o.materialTextureProp=new Property(Texture,"boolean","material",{default:!1,label:"Material Texture"}),o.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),o.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),o.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!1,values:[],label:"PBR Mode"})});function E(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(e=>e.selected)??null:Texture.all.find(e=>e.selected)??Texture.getDefault()}function B(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(e=>e.selected)??Project.selected_texture.layers[0]:E()?.getActiveLayer()??null}function G(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(E()?.name??"texture")}function ue(e,a){let t;return function(...r){let n=()=>{t=void 0,e.apply(this,r)};clearTimeout(t),t=setTimeout(n,a)}}function z(e){let a=MediaPreview.renderer??new _.WebGLRenderer({alpha:!0,antialias:!0}),t=new _.Scene,r=new _.PerspectiveCamera(75,96/96,.1,1e3),n=new _.AmbientLight(16777215,.75);t.add(n);let i=new _.PointLight(16777215,1,100);i.position.set(5,5,5),t.add(i);let s=new _.SphereGeometry(1,32,32),l=e instanceof _.MeshStandardMaterial&&e.isMeshStandardMaterial?e:new _.MeshStandardMaterial({color:e.albedo,metalness:e.metalness??0,roughness:e.roughness??1,emissive:e.emissive,bumpScale:e.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),u=new _.Mesh(s,l);t.add(u),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(t,r);let m=a.domElement.toDataURL();return l.dispose(),MediaPreview.renderer||(a.clear(),a.dispose()),m}function Y(e,a){let t=a??document.createElement("canvas"),r=t.getContext("2d");if(!r)return t.remove(),null;let n=Math.max(Project?Project.texture_width:16,16),i=Math.max(Project?Project.texture_height:16,16);t.width=n,t.height=i,r.fillStyle=`rgb(${e.r*255}, ${e.g*255}, ${e.b*255})`,r.fillRect(0,0,n,i);let s=t.toDataURL();return a||t.remove(),s}var Ve=(e=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return e?a.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):a},k=class e{constructor(a,t){this._scope=a??Ve(),this._materialUuid=t}merToCanvas(){let a=this.getTexture(h.emissive),t=this.getTexture(h.roughness),r=this.getTexture(h.metalness);if(!a&&!t&&!r){let{metalness:n,emissive:i,roughness:s}=this.decodeMer();n&&(r=e.makePixelatedCanvas(n)),i&&(a=e.makePixelatedCanvas(i)),s&&(t=e.makePixelatedCanvas(s))}return{emissiveMap:a,roughnessMap:t,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(h.emissive),roughnessMap:this.getTexture(h.roughness),metalnessMap:this.getTexture(h.metalness)},i=this.getTexture(h.normal);return new _.MeshStandardMaterial({map:this.getTexture(h.albedo)??e.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(s=>s.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(h.ao),bumpMap:this.getTexture(h.height),normalMap:i,metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}renderMaterialPreview(){return z(this.getMaterial())}saveTexture(a,t){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=t.uuid,t.extend({channel:a.id}))}findTexture(a,t=!0){if(!Project)return null;let r=this._scope.find(u=>u.channel&&(u.channel===a||u.channel===a.id));if(r)return r;let[n,i]=typeof a=="string"?[a,new RegExp(`_*${a}(.[^.]+)?$`,"i")]:[a.id,a.regex??new RegExp(`_*${a.id}(.[^.]+)?$`,"i")];Project.pbr_materials=Project.pbr_materials??{};let s=Project.pbr_materials[this._materialUuid];if(t&&!s?.length&&n!==R)return this._scope.find(u=>i.test(u.name))??null;let l=s?.[n];return l?this._scope.find(u=>u.uuid===l)??null:null}static makePixelatedCanvas(a){let t=new _.CanvasTexture(a,void 0,void 0,void 0,_.NearestFilter,_.NearestFilter);return t.needsUpdate=!0,t}getTexture(a){let t=this.findTexture(a);return t?e.makePixelatedCanvas(t.canvas):null}static extractChannel(a,t){let r=a.canvas,{width:n,height:i}=r,s=r.getContext("2d");if(!s||!n||!i)return null;let l=document.createElement("canvas");l.width=n,l.height=i;let u=l.getContext("2d");if(!u)return null;let m={r:0,g:1,b:2,a:3}[t],{data:d}=s.getImageData(0,0,n,i),c=new Uint8ClampedArray(n*i*4);for(let g=0;ga){x[f]=v.data[f],x[f+1]=v.data[f+1],x[f+2]=v.data[f+2],x[f+3]=255;continue}x[f]=0,x[f+1]=0,x[f+2]=0,x[f+3]=255}return m.putImageData(new ImageData(x,l.width,l.height),0,0),{metalness:r,emissive:l,emissiveLevel:n,roughness:i,sss:s}}createMer(a=!1){let t=this.findTexture(h.metalness,a),r=this.findTexture(h.emissive,a),n=this.findTexture(h.roughness,a),i=this.findTexture("sss",!1),s=Math.max(t?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),l=Math.max(t?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),u=document.createElement("canvas");u.width=s,u.height=l;let m=u.getContext("2d");if(!m)return null;let d=t?.img?e.extractChannel(t,"r"):null,c=r?.img?e.extractChannel(r,"g"):null,v=n?.img?e.extractChannel(n,"b"):null,g=i&&i?.img?e.extractChannel(i,"a"):null,x=d?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),f=c?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),p=v?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),b=g?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(new Uint8ClampedArray(s*l*4).fill(255),s,l),M=new Uint8ClampedArray(s*l*4);for(let w=0;w{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createTexturesFromNormal(a){let t=this.decodeLabPbrNormal(a);return Object.entries(t).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}};var V=class{constructor({lightHeight:a=.66,ambientLight:t=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:n=[1,1,1]}={}){this.lightHeight=a,this.ambientLight=t,this.minLightIntensity=r,this.lightDiffuse=n}bake(a,t,r){let n=t instanceof HTMLCanvasElement?t:this.createCanvas(t.width,t.height),i=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),s=n.getContext("2d"),l=i.getContext("2d");s.drawImage(t,0,0),l.drawImage(r,0,0);let u=s.getImageData(0,0,t.width,t.height),m=l.getImageData(0,0,r.width,r.height),d=[],c=[];for(let g=0;g{let x=this.createCanvas(t.width,t.height),f=x.getContext("2d"),p=f.getImageData(0,0,x.width,x.height),b=[Math.cos(g),Math.sin(g),this.lightHeight];for(let M=0;M{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new k(r.layers_enabled?r.layers:Project.textures,r.uuid),i=n.findTexture(h.albedo);if(!i){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let s=n.findTexture(h.normal);if(!s){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let u=new V(e).bake(a,i.canvas,s.canvas),m=new Texture({name:`${i.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(u[0].toDataURL()),d=t?c=>{let v=n.findTexture(h.emissive);if(!v)return c;let g=v.canvas;if(!g.getContext("2d"))return c;let f=Math.max(c.width,g.width,Project?Project.texture_width:16),p=Math.max(c.height,g.height,Project?Project.texture_height:16),b=document.createElement("canvas");b.width=f,b.height=p;let M=b.getContext("2d");return M?(M.drawImage(c,0,0),M.globalCompositeOperation="screen",M.drawImage(g,0,0),b):c}:c=>c;u.forEach((c,v)=>{new TextureLayer({name:`baked_${v+1}`,data_url:d(c).toDataURL()},m).addForEditing()}),m.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};y.push(()=>{o.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(e){let a=new _.Color(e.ambientLight.toString()),t=new _.Color(e.lightDiffuse.toString());me({ambientLight:[a.r,a.g,a.b],lightDiffuse:[t.r,t.g,t.b],lightHeight:Number(e.lightHeight),minLightIntensity:Number(e.minLightIntensity)},e.directions??8,e.blendEmissive??!1)}}),o.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){o.bakeTexturesDialog?.show()}}),MenuBar.addAction(o.bakeTexturesAction,"tools")});C.push(()=>{MenuBar.removeAction("tools.bake_textures")});function de(e,a){let t=e.getTexture();if(!t||!Project)return null;let r=Project.materials[t.uuid];r.isShaderMaterial&&!Project.bb_materials[t.uuid]?Project.bb_materials[t.uuid]=r:r.isMeshStandardMaterial&&r.dispose();let n=new k(t.layers_enabled?t.layers.filter(i=>i.visible)??null:Project.textures,t.uuid).getMaterial({side:Canvas.getRenderSide(t),...a});return Project.materials[t.uuid]=_.ShaderMaterial.prototype.copy.call(n,r),t}function Qe(e){return Object.values(e).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function Je(e,a){let t={};return e.forAllFaces(r=>{let n=de(r,a);n&&(t[n.uuid]=n)}),t}function Xe(e,a){let t={};return Object.keys(e.faces).forEach(r=>{let n=e.faces[r],i=de(n,a);i&&(t[i.uuid]=i)}),t}var N=(e={})=>{if(!Project)return;let t=Project.elements.map(r=>r instanceof Mesh&&Je(r,e)||r instanceof Cube&&Xe(r,e)).reduce((r,n)=>({...r,...n}),{});Project.pbr_active=Texture.all.length>0&&t&&Qe(t)},A=(e=100)=>ue(N,e);var te={},ee=()=>Condition({modes:["edit","paint"],selected:{texture:!0},project:!0,method(){let e=E();return e&&!e.material?!0:e?.material===!0&&B()!==null&&Modes.paint}}),he=()=>Condition({modes:["paint","edit"],selected:{texture:!0},method(){let e=E();if(e?.material&&Modes.edit)return!1;let a=B()??e;return a?.channel&&a.channel!==R}});y.push(()=>{Object.entries(h).forEach(([e,a])=>{te[e]=new Action(`assign_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:ee,click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t)return;Undo.initEdit({layers:[t]}),t.extend({channel:a.id});let r=t instanceof TextureLayer?t.texture:t;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([n,i])=>{i===t.uuid&&(delete Project.pbr_materials[r.uuid][n],t.channel=R)}),r.uuid===t.uuid&&(Project.pbr_materials[r.uuid]={}),Project.pbr_materials[r.uuid][e]=t.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${t.name}" to ${a.label} channel`,2e3),N()}})})});C.push(()=>{Object.values(te).forEach(e=>{e.delete()})});y.push(()=>{o.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:he,click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e)return;Undo.initEdit({layers:[e]});let a=e instanceof TextureLayer?e.texture:e,t=e.channel;Project.pbr_materials[a.uuid]={},e.channel=R,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${e.name}" from ${t} channel`,2e3),A()}}),o.channelMenu=new Menu("channel_menu",[...Object.keys(h).map(e=>`assign_channel_${e}`),"unassign_channel"],{onOpen(){A()}}),o.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",condition:()=>ee()||he(),click(e){o.channelMenu?.open(e)},children:[...Object.values(te),o.unassignChannel]}),o.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:ee,click(e){o.channelMenu?.open(e)}}),o.openChannelMenu&&(MenuBar.addAction(o.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(o.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(o.openChannelMenu,"0")),Toolbars.layers.add(o.showChannelMenu,1)});C.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(o.showChannelMenu)});function $(e,a="DirectX",t=!1){let r=e.canvas.getContext("2d");if(!r)return null;let n=Math.max(e.img.width??e.canvas.width,Project?Project.texture_width:0,16),i=Math.max(e.img.height??e.canvas.height,Project?Project.texture_height:0,16),{data:s}=r.getImageData(0,0,n,i),l=document.createElement("canvas"),u=l.getContext("2d");if(!u)return null;let m=(p,b)=>{let M=(p+b*n)*4;return s[M]/255};l.width=n,l.height=i,u.drawImage(e.img,0,0,n,i);let d=u.getImageData(0,0,n,i),c=d.data,v=p=>{let b=Math.sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);return[p[0]/b,p[1]/b,p[2]/b]};for(let p=0;p{let f=(g+x*t)*4;return n[f]/255};i.width=t,i.height=r,s.drawImage(e.img,0,0,t,r);let u=s.getImageData(0,0,t,r),m=u.data;for(let g=0;g{let t=B()??E()??Texture.getDefault();if(!t)return;let r=$(t,a,!1);if(!r){Blockbench.showQuickMessage("Failed to generate normal map",2e3);return}r.select(e),new k(t instanceof Texture&&t.layers_enabled?t.layers:null,t.uuid).saveTexture(h.normal,r),Blockbench.showQuickMessage("Normal map generated",2e3)};y.push(()=>{o.generateDirectXNormal=new Action("generate_dx_normal",{icon:h.normal.icon??"altitude",name:"Generate DirectX Normal Map",description:"Generates a DirectX normal map from the height map",condition:()=>(B()??E())!==null,click:e=>ge(e)}),o.generateOpenGlNormal=new Action("generate_opengl_normal",{icon:h.normal.icon??"altitude",name:"Generate OpenGL Normal Map",description:"Generates an OpenGL normal map from the height map",condition:()=>(B()??E())!==null,click:e=>ge(e,"OpenGL")}),o.generateAo=new Action("generate_ao",{icon:h.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let e=B()??E()??Texture.getDefault();if(!e)return;let a=new k(e instanceof Texture&&e.layers_enabled?e.layers:null,e.uuid),t=a.findTexture(h.normal)??$(e);if(!t){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=pe(t);if(r){a.saveTexture(h.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),o.generateNormal=new Action("generate_normal",{children:[o.generateDirectXNormal,o.generateOpenGlNormal],name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(B()??E())!==null,click(){},icon:h.normal.icon??"altitude"}),MenuBar.addAction(o.generateNormal,"tools"),MenuBar.addAction(o.generateAo,"tools")});C.push(()=>{MenuBar.removeAction("tools.generate_normal"),MenuBar.removeAction("tools.generate_ao")});var Ze=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},We=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};y.push(()=>{o.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let e=E();if(!e)return;let t=new k(e.layers_enabled?e.layers:[e],e.uuid).createLabPbrOutput();if(t===null)return;let r=e.name??(Project?Project.getDisplayName():"texture");await Promise.all([Ze(t.normalMap,pathToName(r)),We(t.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),o.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let e=TextureLayer.selected?.texture??Texture.all.find(t=>t.selected)??Texture.getDefault(),a=new k(e.layers_enabled?e.layers:[e],e.uuid);if(pathToName(e.name).endsWith("_n")){a.createTexturesFromNormal(e);return}if(pathToName(e.name).endsWith("_s")){a.createTexturesFromSpecular(e);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(o.generateLabPbr,"file.export"),MenuBar.addAction(o.decodeLabPbr,"tools")});C.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});y.push(()=>{o.createMaterialTexture=new Action("create_material_texture",{icon:"deployed_code",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let e={...h},a=new Texture({name:"New Material",saved:!1,particle:!1});a.extend({material:!0});let t=Texture.all.filter(s=>(s.selected||s.multi_selected)&&!s.material)??Texture.all,r=E(),n=r?new k(t,r.uuid):null;try{let s=n?.findTexture(h.albedo,!0)?.canvas.toDataURL()??r?.canvas.toDataURL()??Y(new _.Color(8421504),a.canvas);if(!s)return;a.fromDataURL(s);let l=new TextureLayer({name:e.albedo.label,visible:!0,data_url:s,keep_size:!0},a);l.extend({channel:e.albedo.id}),l.addForEditing(),l.texture.updateChangesAfterEdit(),n?.saveTexture(e.albedo,l),delete e.albedo}catch(s){console.warn("Failed to create base color texture",s),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let i=Object.keys(e).reverse().map(s=>{let l=h[s],u=n?.findTexture(l,!0),m=u?u.canvas.toDataURL():Y(l.default??new _.Color(0));if(!m)return;let d=new TextureLayer({name:l.label,visible:!0,data_url:m,keep_size:!0},a);return d.extend({channel:l.id}),n?.saveTexture(l,d),d}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:i}),a.add().select(),a.activateLayers(),i.map(s=>{s.addForEditing(),a.width=Math.max(a.width,s.img.width),a.height=Math.max(a.height,s.img.height)}),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(o.createMaterialTexture,"tools"),Toolbars.texturelist.add(o.createMaterialTexture,3)});C.push(()=>{MenuBar.removeAction("tools.create_material_texture"),Toolbars.texturelist.remove("create_material_texture")});var Q=(e,a)=>{let t=E()??Texture.getDefault(),r=new k(t.layers_enabled?t.layers:Project?Project.textures:null,t.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[i,s]=Project?[e?`${e}_mer`:`${t.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:i,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},a)})};y.push(()=>{o.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{Q()}catch(e){console.error("Failed to export MER map:",e),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),o.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let e=E()??Texture.getDefault(),a=new k([e],e.uuid),t=a.decodeMer(),r=[h.metalness,h.emissive,h.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new Texture({name:`${e?.name}_${i}`,keep_size:!1}).fromDataURL(s.toDataURL());l.add(!0),a.saveTexture(n,l)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>E()?.layers_enabled===!0,click(){let e=E()??Texture.getDefault(),a=new k(e.layers_enabled?e.layers:[e],e.uuid),t=a.decodeMer(),r=[h.metalness,h.emissive,h.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new TextureLayer({name:`${e?.name}_${i}`,data_url:s.toDataURL()},e);a.saveTexture(n,l),l.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(o.decodeMer,"tools"),MenuBar.addAction(o.generateMer,"file.export")});C.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var qe=()=>{Project&&Project.textures.forEach(e=>{let a=new k(null,e.uuid),t=a.findTexture(h.normal,!1),r=a.findTexture(h.height,!1),n=a.findTexture(h.albedo,!1),i=a.findTexture(h.metalness,!1)?.name,s=a.findTexture(h.emissive,!1)?.name,l=a.findTexture(h.roughness,!1)?.name,u={};return n||(u.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!i&&!s&&!l&&(u.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},u.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},u.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),t&&(u.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(u.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),t&&r&&(u.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),o.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:u,cancelIndex:1,onConfirm(m){let d=G(),c=i||s||l,v={format_version:"1.16.100","minecraft:texture_set":{color:(n?d:m.baseColor?.toHexString())??d,metalness_emissive_roughness:[m.metalness??0,m.emissive??0,m.roughness??255]}};m.depthMap==="normal"&&t||!r&&t?v["minecraft:texture_set"].normal=`${d}_normal`:(!t||m.depthMap==="heightmap")&&r&&(v["minecraft:texture_set"].heightmap=`${d}_heightmap`);let g=p=>{if(!m.depthMap)return p();let b=m.depthMap==="normal"||m.depthMap&&!r,M=b?t:r;if(!M)return p();Blockbench.export({content:M.canvas.toDataURL()??"",type:"PNG",name:`${d}_${b?"normal":"heightmap"}`,extensions:["png"],resource_id:m.depthMap,startpath:Project.export_path,savetype:"image"},w=>{v["minecraft:texture_set"][b?"normal":"heightmap"]=pathToName(w,!1),p()})},x=p=>{if(!n)return p();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:d,startpath:Project.export_path,savetype:"image"},b=>{v["minecraft:texture_set"].color=pathToName(b,!1),p()})},f=()=>g(()=>{x(()=>{Blockbench.export({content:JSON.stringify(v,null,2),type:"JSON",name:`${d}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),o.textureSetDialog?.hide()})})});if(c){try{Q(d,p=>{v["minecraft:texture_set"].metalness_emissive_roughness=pathToName(p,!1),f()})}catch(p){console.warn("Failed to export MER map:",p),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}f()}}),o.textureSetDialog.show()})};y.push(()=>{o.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){qe()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(o.createTextureSet,"file.export")});C.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});y.push(()=>{o.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(e){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=e}),Preview.selected.renderer.physicallyCorrectLights=e,Blockbench.showQuickMessage(`Physically corrected lighting is now ${e?"enabled":"disabled"}`,2e3),e&&o.togglePbr?.set(!0),N()},click(){}}),MenuBar.addAction(o.toggleCorrectLights,"preview")});C.push(()=>{MenuBar.removeAction("preview.correct_lights")});var J=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(e=>{e instanceof Cube&&Object.keys(e.faces).forEach(a=>{let r=e.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var fe=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],xe=()=>Project&&Project.pbr_active&&N(),Ke=()=>{Blockbench.on(fe.join(" "),xe)},be=()=>{fe.forEach(e=>{Blockbench.removeListener(e,xe)})};y.push(()=>{o.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(e){if(e){N(),Ke(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}J(),be(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(o.togglePbr,"view")});C.push(()=>{be(),MenuBar.removeAction("view.toggle_pbr")});var ve=e=>{let a=Math.max(-2,Math.min(2,e));Preview.all.forEach(t=>{t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};y.push(()=>{o.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(o.tonemappingSelect?.get())===_.NoToneMapping&&o.tonemappingSelect.change(_.LinearToneMapping.toString()),o.togglePbr?.set(!0)},onChange(e){ve(Number(e))},onAfter(){A()}}),o.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>o.exposureSlider!==void 0&&Number(o.exposureSlider?.get())!==1,click(){ve(1),o.exposureSlider?.setValue(1,!0),A()}}),o.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:_.NoToneMapping,value:Preview.selected.renderer.toneMapping??_.NoToneMapping,icon:"monochrome_photos",options:{[_.NoToneMapping]:"No Tone Mapping",[_.LinearToneMapping]:"Linear",[_.ReinhardToneMapping]:"Reinhard",[_.CineonToneMapping]:"Cineon",[_.ACESFilmicToneMapping]:"ACES"},onChange({value:e}){Preview.selected.renderer.toneMapping=Number(e);let a=1;Preview.selected.renderer.toneMapping===_.NoToneMapping?o.exposureSlider?.setValue(a,!0):a=Number(o.exposureSlider?.get()??1),Preview.all.forEach(t=>{t.renderer.toneMapping=Number(e),t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(e)}`,2e3),o.togglePbr&&!o.togglePbr.value&&o.togglePbr.set(!0),N()}})});var ae=class{async parse(a){let t=new le,r="model.usda";t.file(r,"");let n=we(),i={},s={};a.traverseVisible(m=>{if(!m.isMesh)return;let d=m;if(!d.material.isMeshStandardMaterial){console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",m);return}let c=d.geometry,v=d.material,g="geometries/Geometry_"+c.id+".usd";if(!t.file(g)){let x=rt(c);t.file(g,et(x))}v.uuid in i||(i[v.uuid]=v),n+=tt(d,c,v)}),n+=lt(i,s),t.file(r,n),n=null;for(let m in s){let d=s[m],c=m.split("_")[1],v=d.format===_.RGBAFormat,g=Ye(d.image,c),f=await(await new Promise(p=>g.toBlob(b=>b&&p(b),v?"image/png":"image/jpeg",1))).arrayBuffer();t.file(`textures/Texture_${m}.${v?"png":"jpg"}`,f)}let l=0;t.forEach(async m=>{let d=34+m.length;l+=d;let c=l&63,v=await t.file(m).async("uint8array");if(c!==4){let g=64-c,x=new Uint8Array(g),f=new Uint8Array(v.length+g);f.set(v,0),f.set(x,v.length),t.file(m,f)}l+=v.length});let u=await t.generateAsync({type:"blob",compression:"STORE"});return new Uint8Array(await u.arrayBuffer())}};function Ye(e,a){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=1024/Math.max(e.width,e.height),r=document.createElement("canvas");r.width=e.width*Math.min(1,t),r.height=e.height*Math.min(1,t);let n=r.getContext("2d");if(n.imageSmoothingEnabled=!1,n.drawImage(e,0,0,r.width,r.height),a!==void 0){let i=parseInt(a,16),s=(i>>16&255)/255,l=(i>>8&255)/255,u=(i&255)/255,m=n.getImageData(0,0,r.width,r.height),d=m.data;for(let c=0;c { [THREE.LinearToneMapping]: "Linear", [THREE.ReinhardToneMapping]: "Reinhard", [THREE.CineonToneMapping]: "Cineon", - [THREE.NeutralToneMapping]: "Neutral", [THREE.ACESFilmicToneMapping]: "ACES", }, onChange({ value }) { From 64f0fe88bf2066cf6c2864af787cc40984377754 Mon Sep 17 00:00:00 2001 From: Jason Gardner Date: Fri, 12 Jul 2024 06:52:17 -0500 Subject: [PATCH 34/50] upd: Add Undo aspect - Sync PR with upstream --- plugins.json | 2 +- plugins/pbr_preview/pbr_preview.js | 8 ++++---- src/pbr_preview/src/lib/tools/materialBrush.ts | 12 ++++++++++++ 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/plugins.json b/plugins.json index 1b97b88c..cd5bf352 100644 --- a/plugins.json +++ b/plugins.json @@ -1156,6 +1156,6 @@ "Minecraft: Bedrock Edition", "PBR" ], - "min_version": "4.10.3" + "min_version": "4.10.4" } } \ No newline at end of file diff --git a/plugins/pbr_preview/pbr_preview.js b/plugins/pbr_preview/pbr_preview.js index 8e1d02f1..96e1f533 100644 --- a/plugins/pbr_preview/pbr_preview.js +++ b/plugins/pbr_preview/pbr_preview.js @@ -1,4 +1,4 @@ -"use strict";(()=>{var _=THREE,ie=Vue,le=window.JSZip;var F="1.2.0",K="1.0.0",R="_NONE_",h={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new _.Color(16777215),regex:new RegExp("(s|_)*(basecolor|color|albedo)","i")},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new _.Color(0),regex:new RegExp("[ _]*metal(lic|ness)?","i")},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new _.Color(0),regex:new RegExp("[ _]*(emissive|emission)","i")},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new _.Color(16777215),regex:new RegExp("[ _]*rough(ness)?","i")},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new _.Color(16777215),regex:new RegExp("[ _]*(height|bump)","i")},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new _.Color("rgb(128, 128, 255)"),regex:new RegExp("[ _]*normal","i")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new _.Color(16777215),regex:new RegExp("[ _]*(ao|ambientocclusion|ambient occlusion)","i")}},o={},y=[],C=[];var ce=[...Object.keys(h).map(e=>h[e].id),R];y.push(()=>{o.channelProp=new Property(TextureLayer,"enum","channel",{default:R,values:ce,label:"PBR Channel",exposed:!1}),o.textureChannelProp=new Property(Texture,"enum","channel",{default:R,values:ce,label:"PBR Channel",exposed:!1}),o.materialTextureProp=new Property(Texture,"boolean","material",{default:!1,label:"Material Texture"}),o.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),o.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),o.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!1,values:[],label:"PBR Mode"})});function E(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(e=>e.selected)??null:Texture.all.find(e=>e.selected)??Texture.getDefault()}function B(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(e=>e.selected)??Project.selected_texture.layers[0]:E()?.getActiveLayer()??null}function G(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(E()?.name??"texture")}function ue(e,a){let t;return function(...r){let n=()=>{t=void 0,e.apply(this,r)};clearTimeout(t),t=setTimeout(n,a)}}function z(e){let a=MediaPreview.renderer??new _.WebGLRenderer({alpha:!0,antialias:!0}),t=new _.Scene,r=new _.PerspectiveCamera(75,96/96,.1,1e3),n=new _.AmbientLight(16777215,.75);t.add(n);let i=new _.PointLight(16777215,1,100);i.position.set(5,5,5),t.add(i);let s=new _.SphereGeometry(1,32,32),l=e instanceof _.MeshStandardMaterial&&e.isMeshStandardMaterial?e:new _.MeshStandardMaterial({color:e.albedo,metalness:e.metalness??0,roughness:e.roughness??1,emissive:e.emissive,bumpScale:e.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),u=new _.Mesh(s,l);t.add(u),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(t,r);let m=a.domElement.toDataURL();return l.dispose(),MediaPreview.renderer||(a.clear(),a.dispose()),m}function Y(e,a){let t=a??document.createElement("canvas"),r=t.getContext("2d");if(!r)return t.remove(),null;let n=Math.max(Project?Project.texture_width:16,16),i=Math.max(Project?Project.texture_height:16,16);t.width=n,t.height=i,r.fillStyle=`rgb(${e.r*255}, ${e.g*255}, ${e.b*255})`,r.fillRect(0,0,n,i);let s=t.toDataURL();return a||t.remove(),s}var Ve=(e=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return e?a.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):a},k=class e{constructor(a,t){this._scope=a??Ve(),this._materialUuid=t}merToCanvas(){let a=this.getTexture(h.emissive),t=this.getTexture(h.roughness),r=this.getTexture(h.metalness);if(!a&&!t&&!r){let{metalness:n,emissive:i,roughness:s}=this.decodeMer();n&&(r=e.makePixelatedCanvas(n)),i&&(a=e.makePixelatedCanvas(i)),s&&(t=e.makePixelatedCanvas(s))}return{emissiveMap:a,roughnessMap:t,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(h.emissive),roughnessMap:this.getTexture(h.roughness),metalnessMap:this.getTexture(h.metalness)},i=this.getTexture(h.normal);return new _.MeshStandardMaterial({map:this.getTexture(h.albedo)??e.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(s=>s.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(h.ao),bumpMap:this.getTexture(h.height),normalMap:i,metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}renderMaterialPreview(){return z(this.getMaterial())}saveTexture(a,t){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=t.uuid,t.extend({channel:a.id}))}findTexture(a,t=!0){if(!Project)return null;let r=this._scope.find(u=>u.channel&&(u.channel===a||u.channel===a.id));if(r)return r;let[n,i]=typeof a=="string"?[a,new RegExp(`_*${a}(.[^.]+)?$`,"i")]:[a.id,a.regex??new RegExp(`_*${a.id}(.[^.]+)?$`,"i")];Project.pbr_materials=Project.pbr_materials??{};let s=Project.pbr_materials[this._materialUuid];if(t&&!s?.length&&n!==R)return this._scope.find(u=>i.test(u.name))??null;let l=s?.[n];return l?this._scope.find(u=>u.uuid===l)??null:null}static makePixelatedCanvas(a){let t=new _.CanvasTexture(a,void 0,void 0,void 0,_.NearestFilter,_.NearestFilter);return t.needsUpdate=!0,t}getTexture(a){let t=this.findTexture(a);return t?e.makePixelatedCanvas(t.canvas):null}static extractChannel(a,t){let r=a.canvas,{width:n,height:i}=r,s=r.getContext("2d");if(!s||!n||!i)return null;let l=document.createElement("canvas");l.width=n,l.height=i;let u=l.getContext("2d");if(!u)return null;let m={r:0,g:1,b:2,a:3}[t],{data:d}=s.getImageData(0,0,n,i),c=new Uint8ClampedArray(n*i*4);for(let g=0;ga){x[f]=v.data[f],x[f+1]=v.data[f+1],x[f+2]=v.data[f+2],x[f+3]=255;continue}x[f]=0,x[f+1]=0,x[f+2]=0,x[f+3]=255}return m.putImageData(new ImageData(x,l.width,l.height),0,0),{metalness:r,emissive:l,emissiveLevel:n,roughness:i,sss:s}}createMer(a=!1){let t=this.findTexture(h.metalness,a),r=this.findTexture(h.emissive,a),n=this.findTexture(h.roughness,a),i=this.findTexture("sss",!1),s=Math.max(t?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),l=Math.max(t?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),u=document.createElement("canvas");u.width=s,u.height=l;let m=u.getContext("2d");if(!m)return null;let d=t?.img?e.extractChannel(t,"r"):null,c=r?.img?e.extractChannel(r,"g"):null,v=n?.img?e.extractChannel(n,"b"):null,g=i&&i?.img?e.extractChannel(i,"a"):null,x=d?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),f=c?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),p=v?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),b=g?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(new Uint8ClampedArray(s*l*4).fill(255),s,l),M=new Uint8ClampedArray(s*l*4);for(let w=0;w{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createTexturesFromNormal(a){let t=this.decodeLabPbrNormal(a);return Object.entries(t).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}};var V=class{constructor({lightHeight:a=.66,ambientLight:t=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:n=[1,1,1]}={}){this.lightHeight=a,this.ambientLight=t,this.minLightIntensity=r,this.lightDiffuse=n}bake(a,t,r){let n=t instanceof HTMLCanvasElement?t:this.createCanvas(t.width,t.height),i=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),s=n.getContext("2d"),l=i.getContext("2d");s.drawImage(t,0,0),l.drawImage(r,0,0);let u=s.getImageData(0,0,t.width,t.height),m=l.getImageData(0,0,r.width,r.height),d=[],c=[];for(let g=0;g{let x=this.createCanvas(t.width,t.height),f=x.getContext("2d"),p=f.getImageData(0,0,x.width,x.height),b=[Math.cos(g),Math.sin(g),this.lightHeight];for(let M=0;M{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new k(r.layers_enabled?r.layers:Project.textures,r.uuid),i=n.findTexture(h.albedo);if(!i){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let s=n.findTexture(h.normal);if(!s){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let u=new V(e).bake(a,i.canvas,s.canvas),m=new Texture({name:`${i.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(u[0].toDataURL()),d=t?c=>{let v=n.findTexture(h.emissive);if(!v)return c;let g=v.canvas;if(!g.getContext("2d"))return c;let f=Math.max(c.width,g.width,Project?Project.texture_width:16),p=Math.max(c.height,g.height,Project?Project.texture_height:16),b=document.createElement("canvas");b.width=f,b.height=p;let M=b.getContext("2d");return M?(M.drawImage(c,0,0),M.globalCompositeOperation="screen",M.drawImage(g,0,0),b):c}:c=>c;u.forEach((c,v)=>{new TextureLayer({name:`baked_${v+1}`,data_url:d(c).toDataURL()},m).addForEditing()}),m.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};y.push(()=>{o.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(e){let a=new _.Color(e.ambientLight.toString()),t=new _.Color(e.lightDiffuse.toString());me({ambientLight:[a.r,a.g,a.b],lightDiffuse:[t.r,t.g,t.b],lightHeight:Number(e.lightHeight),minLightIntensity:Number(e.minLightIntensity)},e.directions??8,e.blendEmissive??!1)}}),o.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){o.bakeTexturesDialog?.show()}}),MenuBar.addAction(o.bakeTexturesAction,"tools")});C.push(()=>{MenuBar.removeAction("tools.bake_textures")});function de(e,a){let t=e.getTexture();if(!t||!Project)return null;let r=Project.materials[t.uuid];r.isShaderMaterial&&!Project.bb_materials[t.uuid]?Project.bb_materials[t.uuid]=r:r.isMeshStandardMaterial&&r.dispose();let n=new k(t.layers_enabled?t.layers.filter(i=>i.visible)??null:Project.textures,t.uuid).getMaterial({side:Canvas.getRenderSide(t),...a});return Project.materials[t.uuid]=_.ShaderMaterial.prototype.copy.call(n,r),t}function Qe(e){return Object.values(e).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function Je(e,a){let t={};return e.forAllFaces(r=>{let n=de(r,a);n&&(t[n.uuid]=n)}),t}function Xe(e,a){let t={};return Object.keys(e.faces).forEach(r=>{let n=e.faces[r],i=de(n,a);i&&(t[i.uuid]=i)}),t}var N=(e={})=>{if(!Project)return;let t=Project.elements.map(r=>r instanceof Mesh&&Je(r,e)||r instanceof Cube&&Xe(r,e)).reduce((r,n)=>({...r,...n}),{});Project.pbr_active=Texture.all.length>0&&t&&Qe(t)},A=(e=100)=>ue(N,e);var te={},ee=()=>Condition({modes:["edit","paint"],selected:{texture:!0},project:!0,method(){let e=E();return e&&!e.material?!0:e?.material===!0&&B()!==null&&Modes.paint}}),he=()=>Condition({modes:["paint","edit"],selected:{texture:!0},method(){let e=E();if(e?.material&&Modes.edit)return!1;let a=B()??e;return a?.channel&&a.channel!==R}});y.push(()=>{Object.entries(h).forEach(([e,a])=>{te[e]=new Action(`assign_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:ee,click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t)return;Undo.initEdit({layers:[t]}),t.extend({channel:a.id});let r=t instanceof TextureLayer?t.texture:t;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([n,i])=>{i===t.uuid&&(delete Project.pbr_materials[r.uuid][n],t.channel=R)}),r.uuid===t.uuid&&(Project.pbr_materials[r.uuid]={}),Project.pbr_materials[r.uuid][e]=t.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${t.name}" to ${a.label} channel`,2e3),N()}})})});C.push(()=>{Object.values(te).forEach(e=>{e.delete()})});y.push(()=>{o.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:he,click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e)return;Undo.initEdit({layers:[e]});let a=e instanceof TextureLayer?e.texture:e,t=e.channel;Project.pbr_materials[a.uuid]={},e.channel=R,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${e.name}" from ${t} channel`,2e3),A()}}),o.channelMenu=new Menu("channel_menu",[...Object.keys(h).map(e=>`assign_channel_${e}`),"unassign_channel"],{onOpen(){A()}}),o.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",condition:()=>ee()||he(),click(e){o.channelMenu?.open(e)},children:[...Object.values(te),o.unassignChannel]}),o.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:ee,click(e){o.channelMenu?.open(e)}}),o.openChannelMenu&&(MenuBar.addAction(o.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(o.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(o.openChannelMenu,"0")),Toolbars.layers.add(o.showChannelMenu,1)});C.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(o.showChannelMenu)});function $(e,a="DirectX",t=!1){let r=e.canvas.getContext("2d");if(!r)return null;let n=Math.max(e.img.width??e.canvas.width,Project?Project.texture_width:0,16),i=Math.max(e.img.height??e.canvas.height,Project?Project.texture_height:0,16),{data:s}=r.getImageData(0,0,n,i),l=document.createElement("canvas"),u=l.getContext("2d");if(!u)return null;let m=(p,b)=>{let M=(p+b*n)*4;return s[M]/255};l.width=n,l.height=i,u.drawImage(e.img,0,0,n,i);let d=u.getImageData(0,0,n,i),c=d.data,v=p=>{let b=Math.sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);return[p[0]/b,p[1]/b,p[2]/b]};for(let p=0;p{let f=(g+x*t)*4;return n[f]/255};i.width=t,i.height=r,s.drawImage(e.img,0,0,t,r);let u=s.getImageData(0,0,t,r),m=u.data;for(let g=0;g{let t=B()??E()??Texture.getDefault();if(!t)return;let r=$(t,a,!1);if(!r){Blockbench.showQuickMessage("Failed to generate normal map",2e3);return}r.select(e),new k(t instanceof Texture&&t.layers_enabled?t.layers:null,t.uuid).saveTexture(h.normal,r),Blockbench.showQuickMessage("Normal map generated",2e3)};y.push(()=>{o.generateDirectXNormal=new Action("generate_dx_normal",{icon:h.normal.icon??"altitude",name:"Generate DirectX Normal Map",description:"Generates a DirectX normal map from the height map",condition:()=>(B()??E())!==null,click:e=>ge(e)}),o.generateOpenGlNormal=new Action("generate_opengl_normal",{icon:h.normal.icon??"altitude",name:"Generate OpenGL Normal Map",description:"Generates an OpenGL normal map from the height map",condition:()=>(B()??E())!==null,click:e=>ge(e,"OpenGL")}),o.generateAo=new Action("generate_ao",{icon:h.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let e=B()??E()??Texture.getDefault();if(!e)return;let a=new k(e instanceof Texture&&e.layers_enabled?e.layers:null,e.uuid),t=a.findTexture(h.normal)??$(e);if(!t){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=pe(t);if(r){a.saveTexture(h.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),o.generateNormal=new Action("generate_normal",{children:[o.generateDirectXNormal,o.generateOpenGlNormal],name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(B()??E())!==null,click(){},icon:h.normal.icon??"altitude"}),MenuBar.addAction(o.generateNormal,"tools"),MenuBar.addAction(o.generateAo,"tools")});C.push(()=>{MenuBar.removeAction("tools.generate_normal"),MenuBar.removeAction("tools.generate_ao")});var Ze=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},We=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};y.push(()=>{o.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let e=E();if(!e)return;let t=new k(e.layers_enabled?e.layers:[e],e.uuid).createLabPbrOutput();if(t===null)return;let r=e.name??(Project?Project.getDisplayName():"texture");await Promise.all([Ze(t.normalMap,pathToName(r)),We(t.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),o.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let e=TextureLayer.selected?.texture??Texture.all.find(t=>t.selected)??Texture.getDefault(),a=new k(e.layers_enabled?e.layers:[e],e.uuid);if(pathToName(e.name).endsWith("_n")){a.createTexturesFromNormal(e);return}if(pathToName(e.name).endsWith("_s")){a.createTexturesFromSpecular(e);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(o.generateLabPbr,"file.export"),MenuBar.addAction(o.decodeLabPbr,"tools")});C.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});y.push(()=>{o.createMaterialTexture=new Action("create_material_texture",{icon:"deployed_code",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let e={...h},a=new Texture({name:"New Material",saved:!1,particle:!1});a.extend({material:!0});let t=Texture.all.filter(s=>(s.selected||s.multi_selected)&&!s.material)??Texture.all,r=E(),n=r?new k(t,r.uuid):null;try{let s=n?.findTexture(h.albedo,!0)?.canvas.toDataURL()??r?.canvas.toDataURL()??Y(new _.Color(8421504),a.canvas);if(!s)return;a.fromDataURL(s);let l=new TextureLayer({name:e.albedo.label,visible:!0,data_url:s,keep_size:!0},a);l.extend({channel:e.albedo.id}),l.addForEditing(),l.texture.updateChangesAfterEdit(),n?.saveTexture(e.albedo,l),delete e.albedo}catch(s){console.warn("Failed to create base color texture",s),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let i=Object.keys(e).reverse().map(s=>{let l=h[s],u=n?.findTexture(l,!0),m=u?u.canvas.toDataURL():Y(l.default??new _.Color(0));if(!m)return;let d=new TextureLayer({name:l.label,visible:!0,data_url:m,keep_size:!0},a);return d.extend({channel:l.id}),n?.saveTexture(l,d),d}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:i}),a.add().select(),a.activateLayers(),i.map(s=>{s.addForEditing(),a.width=Math.max(a.width,s.img.width),a.height=Math.max(a.height,s.img.height)}),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(o.createMaterialTexture,"tools"),Toolbars.texturelist.add(o.createMaterialTexture,3)});C.push(()=>{MenuBar.removeAction("tools.create_material_texture"),Toolbars.texturelist.remove("create_material_texture")});var Q=(e,a)=>{let t=E()??Texture.getDefault(),r=new k(t.layers_enabled?t.layers:Project?Project.textures:null,t.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[i,s]=Project?[e?`${e}_mer`:`${t.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:i,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},a)})};y.push(()=>{o.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{Q()}catch(e){console.error("Failed to export MER map:",e),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),o.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let e=E()??Texture.getDefault(),a=new k([e],e.uuid),t=a.decodeMer(),r=[h.metalness,h.emissive,h.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new Texture({name:`${e?.name}_${i}`,keep_size:!1}).fromDataURL(s.toDataURL());l.add(!0),a.saveTexture(n,l)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>E()?.layers_enabled===!0,click(){let e=E()??Texture.getDefault(),a=new k(e.layers_enabled?e.layers:[e],e.uuid),t=a.decodeMer(),r=[h.metalness,h.emissive,h.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new TextureLayer({name:`${e?.name}_${i}`,data_url:s.toDataURL()},e);a.saveTexture(n,l),l.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(o.decodeMer,"tools"),MenuBar.addAction(o.generateMer,"file.export")});C.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var qe=()=>{Project&&Project.textures.forEach(e=>{let a=new k(null,e.uuid),t=a.findTexture(h.normal,!1),r=a.findTexture(h.height,!1),n=a.findTexture(h.albedo,!1),i=a.findTexture(h.metalness,!1)?.name,s=a.findTexture(h.emissive,!1)?.name,l=a.findTexture(h.roughness,!1)?.name,u={};return n||(u.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!i&&!s&&!l&&(u.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},u.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},u.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),t&&(u.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(u.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),t&&r&&(u.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),o.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:u,cancelIndex:1,onConfirm(m){let d=G(),c=i||s||l,v={format_version:"1.16.100","minecraft:texture_set":{color:(n?d:m.baseColor?.toHexString())??d,metalness_emissive_roughness:[m.metalness??0,m.emissive??0,m.roughness??255]}};m.depthMap==="normal"&&t||!r&&t?v["minecraft:texture_set"].normal=`${d}_normal`:(!t||m.depthMap==="heightmap")&&r&&(v["minecraft:texture_set"].heightmap=`${d}_heightmap`);let g=p=>{if(!m.depthMap)return p();let b=m.depthMap==="normal"||m.depthMap&&!r,M=b?t:r;if(!M)return p();Blockbench.export({content:M.canvas.toDataURL()??"",type:"PNG",name:`${d}_${b?"normal":"heightmap"}`,extensions:["png"],resource_id:m.depthMap,startpath:Project.export_path,savetype:"image"},w=>{v["minecraft:texture_set"][b?"normal":"heightmap"]=pathToName(w,!1),p()})},x=p=>{if(!n)return p();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:d,startpath:Project.export_path,savetype:"image"},b=>{v["minecraft:texture_set"].color=pathToName(b,!1),p()})},f=()=>g(()=>{x(()=>{Blockbench.export({content:JSON.stringify(v,null,2),type:"JSON",name:`${d}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),o.textureSetDialog?.hide()})})});if(c){try{Q(d,p=>{v["minecraft:texture_set"].metalness_emissive_roughness=pathToName(p,!1),f()})}catch(p){console.warn("Failed to export MER map:",p),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}f()}}),o.textureSetDialog.show()})};y.push(()=>{o.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){qe()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(o.createTextureSet,"file.export")});C.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});y.push(()=>{o.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(e){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=e}),Preview.selected.renderer.physicallyCorrectLights=e,Blockbench.showQuickMessage(`Physically corrected lighting is now ${e?"enabled":"disabled"}`,2e3),e&&o.togglePbr?.set(!0),N()},click(){}}),MenuBar.addAction(o.toggleCorrectLights,"preview")});C.push(()=>{MenuBar.removeAction("preview.correct_lights")});var J=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(e=>{e instanceof Cube&&Object.keys(e.faces).forEach(a=>{let r=e.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var fe=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],xe=()=>Project&&Project.pbr_active&&N(),Ke=()=>{Blockbench.on(fe.join(" "),xe)},be=()=>{fe.forEach(e=>{Blockbench.removeListener(e,xe)})};y.push(()=>{o.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(e){if(e){N(),Ke(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}J(),be(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(o.togglePbr,"view")});C.push(()=>{be(),MenuBar.removeAction("view.toggle_pbr")});var ve=e=>{let a=Math.max(-2,Math.min(2,e));Preview.all.forEach(t=>{t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};y.push(()=>{o.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(o.tonemappingSelect?.get())===_.NoToneMapping&&o.tonemappingSelect.change(_.LinearToneMapping.toString()),o.togglePbr?.set(!0)},onChange(e){ve(Number(e))},onAfter(){A()}}),o.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>o.exposureSlider!==void 0&&Number(o.exposureSlider?.get())!==1,click(){ve(1),o.exposureSlider?.setValue(1,!0),A()}}),o.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:_.NoToneMapping,value:Preview.selected.renderer.toneMapping??_.NoToneMapping,icon:"monochrome_photos",options:{[_.NoToneMapping]:"No Tone Mapping",[_.LinearToneMapping]:"Linear",[_.ReinhardToneMapping]:"Reinhard",[_.CineonToneMapping]:"Cineon",[_.ACESFilmicToneMapping]:"ACES"},onChange({value:e}){Preview.selected.renderer.toneMapping=Number(e);let a=1;Preview.selected.renderer.toneMapping===_.NoToneMapping?o.exposureSlider?.setValue(a,!0):a=Number(o.exposureSlider?.get()??1),Preview.all.forEach(t=>{t.renderer.toneMapping=Number(e),t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(e)}`,2e3),o.togglePbr&&!o.togglePbr.value&&o.togglePbr.set(!0),N()}})});var ae=class{async parse(a){let t=new le,r="model.usda";t.file(r,"");let n=we(),i={},s={};a.traverseVisible(m=>{if(!m.isMesh)return;let d=m;if(!d.material.isMeshStandardMaterial){console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",m);return}let c=d.geometry,v=d.material,g="geometries/Geometry_"+c.id+".usd";if(!t.file(g)){let x=rt(c);t.file(g,et(x))}v.uuid in i||(i[v.uuid]=v),n+=tt(d,c,v)}),n+=lt(i,s),t.file(r,n),n=null;for(let m in s){let d=s[m],c=m.split("_")[1],v=d.format===_.RGBAFormat,g=Ye(d.image,c),f=await(await new Promise(p=>g.toBlob(b=>b&&p(b),v?"image/png":"image/jpeg",1))).arrayBuffer();t.file(`textures/Texture_${m}.${v?"png":"jpg"}`,f)}let l=0;t.forEach(async m=>{let d=34+m.length;l+=d;let c=l&63,v=await t.file(m).async("uint8array");if(c!==4){let g=64-c,x=new Uint8Array(g),f=new Uint8Array(v.length+g);f.set(v,0),f.set(x,v.length),t.file(m,f)}l+=v.length});let u=await t.generateAsync({type:"blob",compression:"STORE"});return new Uint8Array(await u.arrayBuffer())}};function Ye(e,a){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=1024/Math.max(e.width,e.height),r=document.createElement("canvas");r.width=e.width*Math.min(1,t),r.height=e.height*Math.min(1,t);let n=r.getContext("2d");if(n.imageSmoothingEnabled=!1,n.drawImage(e,0,0,r.width,r.height),a!==void 0){let i=parseInt(a,16),s=(i>>16&255)/255,l=(i>>8&255)/255,u=(i&255)/255,m=n.getImageData(0,0,r.width,r.height),d=m.data;for(let c=0;c{var _=THREE,ie=Vue,le=window.JSZip;var F="1.2.0",K="1.0.0",N="_NONE_",h={albedo:{id:"albedo",label:"Albedo",description:"The color of the material",map:"map",icon:"tonality",default:new _.Color(16777215),regex:new RegExp("(s|_)*(basecolor|color|albedo)","i")},metalness:{id:"metalness",label:"Metalness",description:"The material's metalness map",map:"metalnessMap",icon:"brightness_6",default:new _.Color(0),regex:new RegExp("[ _]*metal(lic|ness)?","i")},emissive:{id:"emissive",label:"Emissive",description:"The material's emissive map",map:"emissiveMap",icon:"wb_twilight",default:new _.Color(0),regex:new RegExp("[ _]*(emissive|emission)","i")},roughness:{id:"roughness",label:"Roughness",description:"The material's roughness map",map:"roughnessMap",icon:"grain",default:new _.Color(16777215),regex:new RegExp("[ _]*rough(ness)?","i")},height:{id:"height",label:"Height",description:"The material's height map",map:"bumpMap",icon:"landscape",default:new _.Color(16777215),regex:new RegExp("[ _]*(height|bump)","i")},normal:{id:"normal",label:"Normal",description:"The material's normal map",map:"normalMap",icon:"looks",default:new _.Color("rgb(128, 128, 255)"),regex:new RegExp("[ _]*normal","i")},ao:{id:"ao",label:"Ambient Occlusion",description:"The material's ambient occlusion map",map:"aoMap",icon:"motion_mode",default:new _.Color(16777215),regex:new RegExp("[ _]*(ao|ambientocclusion|ambient occlusion)","i")}},o={},y=[],C=[];var ce=[...Object.keys(h).map(e=>h[e].id),N];y.push(()=>{o.channelProp=new Property(TextureLayer,"enum","channel",{default:N,values:ce,label:"PBR Channel",exposed:!1}),o.textureChannelProp=new Property(Texture,"enum","channel",{default:N,values:ce,label:"PBR Channel",exposed:!1}),o.materialTextureProp=new Property(Texture,"boolean","material",{default:!1,label:"Material Texture"}),o.pbrMaterialsProp=new Property(ModelProject,"object","pbr_materials",{default:{},exposed:!1,label:"PBR Materials"}),o.projectMaterialsProp=new Property(ModelProject,"object","bb_materials",{default:{},exposed:!1,label:"Project Materials"}),o.projectPbrModeProp=new Property(ModelProject,"boolean","pbr_active",{default:!1,exposed:!1,values:[],label:"PBR Mode"})});function E(){return Texture.selected?Texture.selected:TextureLayer.selected?TextureLayer.selected.texture:Project?Project.selected_texture?Project.selected_texture:Project.textures.find(e=>e.selected)??null:Texture.all.find(e=>e.selected)??Texture.getDefault()}function R(){return TextureLayer.selected?TextureLayer.selected:Texture.selected?.selected_layer?Texture.selected.selected_layer:Project.selected_texture!==null&&Project.selected_texture?.layers_enabled===!0?Project.selected_texture.layers.find(e=>e.selected)??Project.selected_texture.layers[0]:E()?.getActiveLayer()??null}function G(){return Project?Project.model_identifier.length>0?Project.model_identifier:Project.getDisplayName():pathToName(E()?.name??"texture")}function ue(e,a){let t;return function(...r){let n=()=>{t=void 0,e.apply(this,r)};clearTimeout(t),t=setTimeout(n,a)}}function z(e){let a=MediaPreview.renderer??new _.WebGLRenderer({alpha:!0,antialias:!0}),t=new _.Scene,r=new _.PerspectiveCamera(75,96/96,.1,1e3),n=new _.AmbientLight(16777215,.75);t.add(n);let i=new _.PointLight(16777215,1,100);i.position.set(5,5,5),t.add(i);let s=new _.SphereGeometry(1,32,32),l=e instanceof _.MeshStandardMaterial&&e.isMeshStandardMaterial?e:new _.MeshStandardMaterial({color:e.albedo,metalness:e.metalness??0,roughness:e.roughness??1,emissive:e.emissive,bumpScale:e.height??0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.5}),u=new _.Mesh(s,l);t.add(u),r.position.x=0,r.position.y=0,r.position.z=2,a.setSize(96,96),a.render(t,r);let m=a.domElement.toDataURL();return l.dispose(),MediaPreview.renderer||(a.clear(),a.dispose()),m}function Y(e,a){let t=a??document.createElement("canvas"),r=t.getContext("2d");if(!r)return t.remove(),null;let n=Math.max(Project?Project.texture_width:16,16),i=Math.max(Project?Project.texture_height:16,16);t.width=n,t.height=i,r.fillStyle=`rgb(${e.r*255}, ${e.g*255}, ${e.b*255})`,r.fillRect(0,0,n,i);let s=t.toDataURL();return a||t.remove(),s}var Ve=(e=!0)=>{let a=Project?Project.textures??Texture.all:Texture.all;return e?a.filter(t=>t.layers_enabled&&t.layers.length>0).flatMap(t=>t.layers):a},D=class e{constructor(a,t){this._scope=a??Ve(),this._materialUuid=t}merToCanvas(){let a=this.getTexture(h.emissive),t=this.getTexture(h.roughness),r=this.getTexture(h.metalness);if(!a&&!t&&!r){let{metalness:n,emissive:i,roughness:s}=this.decodeMer();n&&(r=e.makePixelatedCanvas(n)),i&&(a=e.makePixelatedCanvas(i)),s&&(t=e.makePixelatedCanvas(s))}return{emissiveMap:a,roughnessMap:t,metalnessMap:r}}getMaterial(a={}){let{emissiveMap:t,roughnessMap:r,metalnessMap:n}=Format.id.startsWith("bedrock")?this.merToCanvas():{emissiveMap:this.getTexture(h.emissive),roughnessMap:this.getTexture(h.roughness),metalnessMap:this.getTexture(h.metalness)},i=this.getTexture(h.normal);return new _.MeshStandardMaterial({map:this.getTexture(h.albedo)??e.makePixelatedCanvas(TextureLayer.selected?.canvas??Texture.all.find(s=>s.selected)?.canvas??Texture.getDefault().canvas),aoMap:this.getTexture(h.ao),bumpMap:this.getTexture(h.height),normalMap:i,metalnessMap:n,metalness:n?1:0,roughnessMap:r,roughness:1,emissiveMap:t,emissiveIntensity:t?1:0,emissive:t?16777215:0,envMap:PreviewScene.active?.cubemap??null,envMapIntensity:.95,alphaTest:.1,transparent:!0,...a})}renderMaterialPreview(){return z(this.getMaterial())}saveTexture(a,t){Project&&(Project.pbr_materials||(Project.pbr_materials={}),Project.pbr_materials[this._materialUuid]||(Project.pbr_materials[this._materialUuid]={}),Project.pbr_materials[this._materialUuid][a.id]=t.uuid,t.extend({channel:a.id}))}findTexture(a,t=!0){if(!Project)return null;let r=this._scope.find(u=>u.channel&&(u.channel===a||u.channel===a.id));if(r)return r;let[n,i]=typeof a=="string"?[a,new RegExp(`_*${a}(.[^.]+)?$`,"i")]:[a.id,a.regex??new RegExp(`_*${a.id}(.[^.]+)?$`,"i")];Project.pbr_materials=Project.pbr_materials??{};let s=Project.pbr_materials[this._materialUuid];if(t&&!s?.length&&n!==N)return this._scope.find(u=>i.test(u.name))??null;let l=s?.[n];return l?this._scope.find(u=>u.uuid===l)??null:null}static makePixelatedCanvas(a){let t=new _.CanvasTexture(a,void 0,void 0,void 0,_.NearestFilter,_.NearestFilter);return t.needsUpdate=!0,t}getTexture(a){let t=this.findTexture(a);return t?e.makePixelatedCanvas(t.canvas):null}static extractChannel(a,t){let r=a.canvas,{width:n,height:i}=r,s=r.getContext("2d");if(!s||!n||!i)return null;let l=document.createElement("canvas");l.width=n,l.height=i;let u=l.getContext("2d");if(!u)return null;let m={r:0,g:1,b:2,a:3}[t],{data:d}=s.getImageData(0,0,n,i),c=new Uint8ClampedArray(n*i*4);for(let g=0;ga){x[f]=v.data[f],x[f+1]=v.data[f+1],x[f+2]=v.data[f+2],x[f+3]=255;continue}x[f]=0,x[f+1]=0,x[f+2]=0,x[f+3]=255}return m.putImageData(new ImageData(x,l.width,l.height),0,0),{metalness:r,emissive:l,emissiveLevel:n,roughness:i,sss:s}}createMer(a=!1){let t=this.findTexture(h.metalness,a),r=this.findTexture(h.emissive,a),n=this.findTexture(h.roughness,a),i=this.findTexture("sss",!1),s=Math.max(t?.img.width??0,r?.img.width??0,n?.img.width??0,Project?Project.texture_width:0,16),l=Math.max(t?.img.height??0,r?.img.height??0,n?.img.height??0,Project?Project.texture_height:0,16),u=document.createElement("canvas");u.width=s,u.height=l;let m=u.getContext("2d");if(!m)return null;let d=t?.img?e.extractChannel(t,"r"):null,c=r?.img?e.extractChannel(r,"g"):null,v=n?.img?e.extractChannel(n,"b"):null,g=i&&i?.img?e.extractChannel(i,"a"):null,x=d?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),f=c?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),p=v?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(s,l),b=g?.getContext("2d")?.getImageData(0,0,s,l)??new ImageData(new Uint8ClampedArray(s*l*4).fill(255),s,l),M=new Uint8ClampedArray(s*l*4);for(let w=0;w{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}createTexturesFromNormal(a){let t=this.decodeLabPbrNormal(a);return Object.entries(t).forEach(([r,n])=>{n&&new Texture({name:`${a.name}_${r}`,saved:!1,particle:!1,keep_size:!1}).fromDataURL(n.toDataURL()).add()}),t}};var V=class{constructor({lightHeight:a=.66,ambientLight:t=[.1,.1,.1],minLightIntensity:r=0,lightDiffuse:n=[1,1,1]}={}){this.lightHeight=a,this.ambientLight=t,this.minLightIntensity=r,this.lightDiffuse=n}bake(a,t,r){let n=t instanceof HTMLCanvasElement?t:this.createCanvas(t.width,t.height),i=r instanceof HTMLCanvasElement?r:this.createCanvas(r.width,r.height),s=n.getContext("2d"),l=i.getContext("2d");s.drawImage(t,0,0),l.drawImage(r,0,0);let u=s.getImageData(0,0,t.width,t.height),m=l.getImageData(0,0,r.width,r.height),d=[],c=[];for(let g=0;g{let x=this.createCanvas(t.width,t.height),f=x.getContext("2d"),p=f.getImageData(0,0,x.width,x.height),b=[Math.cos(g),Math.sin(g),this.lightHeight];for(let M=0;M{if(!Project)return;let r=Project.selected_texture??Texture.getDefault(),n=new D(r.layers_enabled?r.layers:Project.textures,r.uuid),i=n.findTexture(h.albedo);if(!i){Blockbench.showStatusMessage("Can not bake without a base color assigned.",3e3);return}let s=n.findTexture(h.normal);if(!s){Blockbench.showStatusMessage("Can not bake without a normal map assigned.",3e3);return}let u=new V(e).bake(a,i.canvas,s.canvas),m=new Texture({name:`${i.name}_baked`,saved:!1,particle:!1,keep_size:!1,layers_enabled:!0}).fromDataURL(u[0].toDataURL()),d=t?c=>{let v=n.findTexture(h.emissive);if(!v)return c;let g=v.canvas;if(!g.getContext("2d"))return c;let f=Math.max(c.width,g.width,Project?Project.texture_width:16),p=Math.max(c.height,g.height,Project?Project.texture_height:16),b=document.createElement("canvas");b.width=f,b.height=p;let M=b.getContext("2d");return M?(M.drawImage(c,0,0),M.globalCompositeOperation="screen",M.drawImage(g,0,0),b):c}:c=>c;u.forEach((c,v)=>{new TextureLayer({name:`baked_${v+1}`,data_url:d(c).toDataURL()},m).addForEditing()}),m.add().select(),Blockbench.showQuickMessage("Textures baked \u{1F950}",2e3)};y.push(()=>{o.bakeTexturesDialog=new Dialog("bake_textures",{id:"bake_textures",title:"Bake Textures",buttons:["Bake","Cancel"],form:{ambientLight:{type:"color",label:"Ambient Light",value:"#1f1f1f"},lightDiffuse:{type:"color",label:"Light Diffuse",value:"#ffffff"},lightHeight:{type:"range",label:"Light Height",min:0,max:1,step:.01,value:.66},minLightIntensity:{type:"range",label:"Minimum Light Intensity",min:0,max:1,step:.01,value:0},directions:{type:"number",label:"Directions",value:8,min:1,max:360,step:1},blendEmissive:{type:"checkbox",label:"Blend Emissive",value:!1}},onConfirm(e){let a=new _.Color(e.ambientLight.toString()),t=new _.Color(e.lightDiffuse.toString());me({ambientLight:[a.r,a.g,a.b],lightDiffuse:[t.r,t.g,t.b],lightHeight:Number(e.lightHeight),minLightIntensity:Number(e.minLightIntensity)},e.directions??8,e.blendEmissive??!1)}}),o.bakeTexturesAction=new Action("bake_textures",{icon:"cake",name:"Bake Textures",description:"Bakes textures for the selected PBR material",click(){o.bakeTexturesDialog?.show()}}),MenuBar.addAction(o.bakeTexturesAction,"tools")});C.push(()=>{MenuBar.removeAction("tools.bake_textures")});function de(e,a){let t=e.getTexture();if(!t||!Project)return null;let r=Project.materials[t.uuid];r.isShaderMaterial&&!Project.bb_materials[t.uuid]?Project.bb_materials[t.uuid]=r:r.isMeshStandardMaterial&&r.dispose();let n=new D(t.layers_enabled?t.layers.filter(i=>i.visible)??null:Project.textures,t.uuid).getMaterial({side:Canvas.getRenderSide(t),...a});return Project.materials[t.uuid]=_.ShaderMaterial.prototype.copy.call(n,r),t}function Qe(e){return Object.values(e).filter(a=>a?(Canvas.updateAllFaces(a),!0):!1).length>0}function Je(e,a){let t={};return e.forAllFaces(r=>{let n=de(r,a);n&&(t[n.uuid]=n)}),t}function Xe(e,a){let t={};return Object.keys(e.faces).forEach(r=>{let n=e.faces[r],i=de(n,a);i&&(t[i.uuid]=i)}),t}var B=(e={})=>{if(!Project)return;let t=Project.elements.map(r=>r instanceof Mesh&&Je(r,e)||r instanceof Cube&&Xe(r,e)).reduce((r,n)=>({...r,...n}),{});Project.pbr_active=Texture.all.length>0&&t&&Qe(t)},A=(e=100)=>ue(B,e);var te={},ee=()=>Condition({modes:["edit","paint"],selected:{texture:!0},project:!0,method(){let e=E();return e&&!e.material?!0:e?.material===!0&&R()!==null&&Modes.paint}}),he=()=>Condition({modes:["paint","edit"],selected:{texture:!0},method(){let e=E();if(e?.material&&Modes.edit)return!1;let a=R()??e;return a?.channel&&a.channel!==N}});y.push(()=>{Object.entries(h).forEach(([e,a])=>{te[e]=new Action(`assign_channel_${e}`,{icon:a.icon??"tv_options_edit_channels",name:`Assign to ${a.label.toLocaleLowerCase()} channel`,description:`Assign the selected layer to the ${a.label} channel`,category:"textures",condition:ee,click(){let t=TextureLayer.selected??(Project?Project.selected_texture:null);if(!t)return;Undo.initEdit({layers:[t]}),t.extend({channel:a.id});let r=t instanceof TextureLayer?t.texture:t;r.updateChangesAfterEdit(),Project.pbr_materials[r.uuid]||(Project.pbr_materials[r.uuid]={}),Object.entries(Project.pbr_materials[r.uuid]).forEach(([n,i])=>{i===t.uuid&&(delete Project.pbr_materials[r.uuid][n],t.channel=N)}),r.uuid===t.uuid&&(Project.pbr_materials[r.uuid]={}),Project.pbr_materials[r.uuid][e]=t.uuid,Undo.finishEdit("Change channel assignment"),Blockbench.showQuickMessage(`Assigned "${t.name}" to ${a.label} channel`,2e3),B()}})})});C.push(()=>{Object.values(te).forEach(e=>{e.delete()})});y.push(()=>{o.unassignChannel=new Action("unassign_channel",{icon:"cancel",name:"Unassign Channel",description:"Unassign the selected layer from the channel",category:"textures",condition:he,click(){let e=TextureLayer.selected??(Project?Project.selected_texture:null);if(!e)return;Undo.initEdit({layers:[e]});let a=e instanceof TextureLayer?e.texture:e,t=e.channel;Project.pbr_materials[a.uuid]={},e.channel=N,a.updateChangesAfterEdit(),Undo.finishEdit("Unassign channel"),Blockbench.showQuickMessage(`Unassigned "${e.name}" from ${t} channel`,2e3),A()}}),o.channelMenu=new Menu("channel_menu",[...Object.keys(h).map(e=>`assign_channel_${e}`),"unassign_channel"],{onOpen(){A()}}),o.openChannelMenu=new Action("pbr_channel_menu",{name:"Assign to PBR Channel",icon:"texture",condition:()=>ee()||he(),click(e){o.channelMenu?.open(e)},children:[...Object.values(te),o.unassignChannel]}),o.showChannelMenu=new Action("show_channel_menu",{icon:"texture",name:"Assign to PBR Channel",description:"Assign the selected layer to a channel",category:"textures",condition:ee,click(e){o.channelMenu?.open(e)}}),o.openChannelMenu&&(MenuBar.addAction(o.openChannelMenu,"image.0"),Texture.prototype.menu.addAction(o.openChannelMenu,"0"),TextureLayer.prototype.menu.addAction(o.openChannelMenu,"0")),Toolbars.layers.add(o.showChannelMenu,1)});C.push(()=>{MenuBar.removeAction("image.pbr_channel_menu"),Texture.prototype.menu.removeAction("pbr_channel_menu"),TextureLayer.prototype.menu.removeAction("pbr_channel_menu"),Toolbars.layers.remove(o.showChannelMenu)});function $(e,a="DirectX",t=!1){let r=e.canvas.getContext("2d");if(!r)return null;let n=Math.max(e.img.width??e.canvas.width,Project?Project.texture_width:0,16),i=Math.max(e.img.height??e.canvas.height,Project?Project.texture_height:0,16),{data:s}=r.getImageData(0,0,n,i),l=document.createElement("canvas"),u=l.getContext("2d");if(!u)return null;let m=(p,b)=>{let M=(p+b*n)*4;return s[M]/255};l.width=n,l.height=i,u.drawImage(e.img,0,0,n,i);let d=u.getImageData(0,0,n,i),c=d.data,v=p=>{let b=Math.sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);return[p[0]/b,p[1]/b,p[2]/b]};for(let p=0;p{let f=(g+x*t)*4;return n[f]/255};i.width=t,i.height=r,s.drawImage(e.img,0,0,t,r);let u=s.getImageData(0,0,t,r),m=u.data;for(let g=0;g{let t=R()??E()??Texture.getDefault();if(!t)return;let r=$(t,a,!1);if(!r){Blockbench.showQuickMessage("Failed to generate normal map",2e3);return}r.select(e),new D(t instanceof Texture&&t.layers_enabled?t.layers:null,t.uuid).saveTexture(h.normal,r),Blockbench.showQuickMessage("Normal map generated",2e3)};y.push(()=>{o.generateDirectXNormal=new Action("generate_dx_normal",{icon:h.normal.icon??"altitude",name:"Generate DirectX Normal Map",description:"Generates a DirectX normal map from the height map",condition:()=>(R()??E())!==null,click:e=>ge(e)}),o.generateOpenGlNormal=new Action("generate_opengl_normal",{icon:h.normal.icon??"altitude",name:"Generate OpenGL Normal Map",description:"Generates an OpenGL normal map from the height map",condition:()=>(R()??E())!==null,click:e=>ge(e,"OpenGL")}),o.generateAo=new Action("generate_ao",{icon:h.ao.icon??"motion_mode",name:"Generate Ambient Occlusion Map",description:"Generates an ambient occlusion map from the height map",condition:{selected:{texture:!0},project:!0},click(){let e=R()??E()??Texture.getDefault();if(!e)return;let a=new D(e instanceof Texture&&e.layers_enabled?e.layers:null,e.uuid),t=a.findTexture(h.normal)??$(e);if(!t){Blockbench.showQuickMessage("Unable to generate ambient occlusion map without a normal map",2e3);return}let r=pe(t);if(r){a.saveTexture(h.ao,r),r.select(),Blockbench.showQuickMessage("Ambient occlusion map generated",2e3);return}Blockbench.showQuickMessage("Failed to generate ambient occlusion map",2e3)}}),o.generateNormal=new Action("generate_normal",{children:[o.generateDirectXNormal,o.generateOpenGlNormal],name:"Generate Normal Map",description:"Generates a normal map from the height map",condition:()=>(R()??E())!==null,click(){},icon:h.normal.icon??"altitude"}),MenuBar.addAction(o.generateNormal,"tools"),MenuBar.addAction(o.generateAo,"tools")});C.push(()=>{MenuBar.removeAction("tools.generate_normal"),MenuBar.removeAction("tools.generate_ao")});var Ze=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_n`,extensions:["png"],resource_id:"normal_map",savetype:"image"})})},We=(e,a="texture")=>{e.toBlob(async t=>{t&&Blockbench.export({content:await t.arrayBuffer(),type:"PNG",name:`${a}_s`,extensions:["png"],resource_id:"specular_map",savetype:"image"})})};y.push(()=>{o.generateLabPbr=new Action("generate_lab_pbr",{icon:"experiment",name:"Generate labPBR textures",description:"Generate a specular and normal map in labPBR format for Java shaders",condition:{formats:["java_block"],project:!0},async click(){let e=E();if(!e)return;let t=new D(e.layers_enabled?e.layers:[e],e.uuid).createLabPbrOutput();if(t===null)return;let r=e.name??(Project?Project.getDisplayName():"texture");await Promise.all([Ze(t.normalMap,pathToName(r)),We(t.specular,pathToName(r))]),Blockbench.showQuickMessage("Exported labPBR textures")}}),o.decodeLabPbr=new Action("decode_lab_pbr",{icon:"frame_source",name:"Decode labPBR textures",description:"Decodes the selected texture into a specular or normal map in labPBR format",condition:{formats:["java"],project:!0,selected:{texture:!0}},click(){let e=TextureLayer.selected?.texture??Texture.all.find(t=>t.selected)??Texture.getDefault(),a=new D(e.layers_enabled?e.layers:[e],e.uuid);if(pathToName(e.name).endsWith("_n")){a.createTexturesFromNormal(e);return}if(pathToName(e.name).endsWith("_s")){a.createTexturesFromSpecular(e);return}Blockbench.showQuickMessage("Failed to decode labPBR texture")}}),MenuBar.addAction(o.generateLabPbr,"file.export"),MenuBar.addAction(o.decodeLabPbr,"tools")});C.push(()=>{MenuBar.removeAction("file.export.generate_lab_pbr")});y.push(()=>{o.createMaterialTexture=new Action("create_material_texture",{icon:"deployed_code",name:"Create Material Texture",description:"Creates a new texture for a PBR material",condition:{modes:["edit","paint"],project:!0},click(){if(!Project)return;let e={...h},a=new Texture({name:"New Material",saved:!1,particle:!1});a.extend({material:!0});let t=Texture.all.filter(s=>(s.selected||s.multi_selected)&&!s.material)??Texture.all,r=E(),n=r?new D(t,r.uuid):null;try{let s=n?.findTexture(h.albedo,!0)?.canvas.toDataURL()??r?.canvas.toDataURL()??Y(new _.Color(8421504),a.canvas);if(!s)return;a.fromDataURL(s);let l=new TextureLayer({name:e.albedo.label,visible:!0,data_url:s,keep_size:!0},a);l.extend({channel:e.albedo.id}),l.addForEditing(),l.texture.updateChangesAfterEdit(),n?.saveTexture(e.albedo,l),delete e.albedo}catch(s){console.warn("Failed to create base color texture",s),Blockbench.showStatusMessage("Failed to create base color texture in new material",3e3)}let i=Object.keys(e).reverse().map(s=>{let l=h[s],u=n?.findTexture(l,!0),m=u?u.canvas.toDataURL():Y(l.default??new _.Color(0));if(!m)return;let d=new TextureLayer({name:l.label,visible:!0,data_url:m,keep_size:!0},a);return d.extend({channel:l.id}),n?.saveTexture(l,d),d}).filter(Boolean);Undo.initEdit({textures:Texture.all,layers:i}),a.add().select(),a.activateLayers(),i.map(s=>{s.addForEditing(),a.width=Math.max(a.width,s.img.width),a.height=Math.max(a.height,s.img.height)}),a.updateChangesAfterEdit(),Undo.finishEdit("Create Material Texture")}}),MenuBar.addAction(o.createMaterialTexture,"tools"),Toolbars.texturelist.add(o.createMaterialTexture,3)});C.push(()=>{MenuBar.removeAction("tools.create_material_texture"),Toolbars.texturelist.remove("create_material_texture")});var Q=(e,a)=>{let t=E()??Texture.getDefault(),r=new D(t.layers_enabled?t.layers:Project?Project.textures:null,t.uuid).createMer(!0);if(!r)throw new Error("Failed to generate MER map from selected texture.");r.toBlob(async n=>{if(!n)throw new Error("Failed to save MER map.");let[i,s]=Project?[e?`${e}_mer`:`${t.name??Project.getDisplayName()}_mer`,Project.export_path]:["mer"];Blockbench.export({content:await n.arrayBuffer(),type:"PNG",name:i,extensions:["png"],resource_id:"mer",savetype:"image",startpath:s},a)})};y.push(()=>{o.generateMer=new Action("create_mer",{icon:"lightbulb_circle",name:"Export MER",description:"Exports a texture map from the metalness, emissive, and roughness channels. (For use in Bedrock resource packs.)",condition:{formats:["bedrock","bedrock_block"],project:!0},click(){try{Q()}catch(e){console.error("Failed to export MER map:",e),Blockbench.showStatusMessage("Failed to export MER map",3e3)}}}),o.decodeMer=new Action("decode_mer",{name:"Decode MER",icon:"arrow_split",condition:{formats:["bedrock","bedrock_block"],project:!0,selected:{texture:!0}},children:[{icon:"move_item",name:"Decode MER to Textures",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into separate textures",click(){let e=E()??Texture.getDefault(),a=new D([e],e.uuid),t=a.decodeMer(),r=[h.metalness,h.emissive,h.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new Texture({name:`${e?.name}_${i}`,keep_size:!1}).fromDataURL(s.toDataURL());l.add(!0),a.saveTexture(n,l)}),Undo.finishEdit("Decode MER to textures")}},{icon:"move_group",name:"Decode MER to Layers",description:"Decodes a MER texture map into metalness, emissive, and roughness channels into material layers",condition:()=>E()?.layers_enabled===!0,click(){let e=E()??Texture.getDefault(),a=new D(e.layers_enabled?e.layers:[e],e.uuid),t=a.decodeMer(),r=[h.metalness,h.emissive,h.roughness];Undo.initEdit({textures:[e]}),r.forEach(n=>{let i=n.id,s=t[i];if(!s){Blockbench.showStatusMessage(`Failed to decode ${n.label} channel`,3e3);return}let l=new TextureLayer({name:`${e?.name}_${i}`,data_url:s.toDataURL()},e);a.saveTexture(n,l),l.addForEditing()}),Undo.finishEdit("Decode MER to layers")}}],click(){}}),MenuBar.addAction(o.decodeMer,"tools"),MenuBar.addAction(o.generateMer,"file.export")});C.push(()=>{MenuBar.removeAction("file.export.create_mer"),MenuBar.removeAction("tools.decode_mer")});var qe=()=>{Project&&Project.textures.forEach(e=>{let a=new D(null,e.uuid),t=a.findTexture(h.normal,!1),r=a.findTexture(h.height,!1),n=a.findTexture(h.albedo,!1),i=a.findTexture(h.metalness,!1)?.name,s=a.findTexture(h.emissive,!1)?.name,l=a.findTexture(h.roughness,!1)?.name,u={};return n||(u.baseColor={type:"color",label:"Base Color",value:"#ff00ff"}),!i&&!s&&!l&&(u.metalness={label:"Metalness",type:"range",min:0,max:255,step:1,value:0},u.emissive={label:"Emissive",type:"range",min:0,max:255,step:1,value:0},u.roughness={label:"Roughness",type:"range",min:0,max:255,step:1,value:0}),t&&(u.depthMap={type:"checkbox",label:"Normal Map",value:"normal"}),r&&(u.depthMap={type:"checkbox",label:"Height Map",value:"heightmap"}),t&&r&&(u.depthMap={type:"radio",label:"Depth Map",options:{normal:"Normal Map",heightmap:"Height"},value:"normal"}),o.textureSetDialog=new Dialog("texture_set",{id:"texture_set",title:"Create Texture Set JSON",buttons:["Create","Cancel"],form:u,cancelIndex:1,onConfirm(m){let d=G(),c=i||s||l,v={format_version:"1.16.100","minecraft:texture_set":{color:(n?d:m.baseColor?.toHexString())??d,metalness_emissive_roughness:[m.metalness??0,m.emissive??0,m.roughness??255]}};m.depthMap==="normal"&&t||!r&&t?v["minecraft:texture_set"].normal=`${d}_normal`:(!t||m.depthMap==="heightmap")&&r&&(v["minecraft:texture_set"].heightmap=`${d}_heightmap`);let g=p=>{if(!m.depthMap)return p();let b=m.depthMap==="normal"||m.depthMap&&!r,M=b?t:r;if(!M)return p();Blockbench.export({content:M.canvas.toDataURL()??"",type:"PNG",name:`${d}_${b?"normal":"heightmap"}`,extensions:["png"],resource_id:m.depthMap,startpath:Project.export_path,savetype:"image"},w=>{v["minecraft:texture_set"][b?"normal":"heightmap"]=pathToName(w,!1),p()})},x=p=>{if(!n)return p();Blockbench.export({content:n.canvas.toDataURL(),extensions:["png"],type:"PNG",name:d,startpath:Project.export_path,savetype:"image"},b=>{v["minecraft:texture_set"].color=pathToName(b,!1),p()})},f=()=>g(()=>{x(()=>{Blockbench.export({content:JSON.stringify(v,null,2),type:"JSON",name:`${d}.texture_set`,extensions:["json"],resource_id:"texture_set",startpath:Project.export_path,savetype:"text"},()=>{Blockbench.showQuickMessage("Texture set created",2e3),o.textureSetDialog?.hide()})})});if(c){try{Q(d,p=>{v["minecraft:texture_set"].metalness_emissive_roughness=pathToName(p,!1),f()})}catch(p){console.warn("Failed to export MER map:",p),Blockbench.showStatusMessage("Failed to export MER map",3e3)}return}f()}}),o.textureSetDialog.show()})};y.push(()=>{o.createTextureSet=new Action("create_texture_set",{name:"Create Texture Set",icon:"layers",description:"Creates a texture set JSON file. Generates a MER when metalness, emissive, or roughness channels are set.",click(){qe()},condition:{formats:["bedrock","bedrock_block"],project:!0}}),MenuBar.addAction(o.createTextureSet,"file.export")});C.push(()=>{MenuBar.removeAction("file.export.create_texture_set")});y.push(()=>{o.toggleCorrectLights=new Toggle("correct_lights",{category:"preview",name:"Correct Lights",description:"Corrects the lighting in the preview",icon:"fluorescent",default:!1,onChange(e){Preview.all.forEach(a=>{a.renderer.physicallyCorrectLights=e}),Preview.selected.renderer.physicallyCorrectLights=e,Blockbench.showQuickMessage(`Physically corrected lighting is now ${e?"enabled":"disabled"}`,2e3),e&&o.togglePbr?.set(!0),B()},click(){}}),MenuBar.addAction(o.toggleCorrectLights,"preview")});C.push(()=>{MenuBar.removeAction("preview.correct_lights")});var J=()=>{!Project||!Project.bb_materials||(Project.elements.forEach(e=>{e instanceof Cube&&Object.keys(e.faces).forEach(a=>{let r=e.faces[a].getTexture();if(!r)return;let n=Project.bb_materials[r.uuid];n&&(Project.materials[r.uuid]=n)})}),Project.pbr_active=!1,Canvas.updateAll())};var fe=["undo","redo","add_texture","finish_edit","finished_edit","load_project","select_preview_scene","change_texture_path","select_project","load_undo_save","add_cube"],xe=()=>Project&&Project.pbr_active&&B(),Ke=()=>{Blockbench.on(fe.join(" "),xe)},be=()=>{fe.forEach(e=>{Blockbench.removeListener(e,xe)})};y.push(()=>{o.togglePbr=new Toggle("toggle_pbr",{name:"PBR Preview",description:"Toggle PBR Preview",icon:"panorama_photosphere",category:"view",default:!1,click(){},onChange(e){if(e){B(),Ke(),Blockbench.showQuickMessage("PBR Preview is now enabled");return}J(),be(),Blockbench.showQuickMessage("PBR Preview is now disabled")}}),MenuBar.addAction(o.togglePbr,"view")});C.push(()=>{be(),MenuBar.removeAction("view.toggle_pbr")});var ve=e=>{let a=Math.max(-2,Math.min(2,e));Preview.all.forEach(t=>{t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a};y.push(()=>{o.exposureSlider=new NumSlider("display_settings_exposure",{category:"preview",name:"Exposure",description:"Adjusts the exposure of the scene",type:"number",value:1,icon:"exposure",settings:{min:-2,max:2,step:.01,default:1},onBefore(){Number(o.tonemappingSelect?.get())===_.NoToneMapping&&o.tonemappingSelect.change(_.LinearToneMapping.toString()),o.togglePbr?.set(!0)},onChange(e){ve(Number(e))},onAfter(){A()}}),o.resetExposureButton=new Action("display_settings_reset_exposure",{category:"preview",name:"Reset Exposure",description:"Resets the exposure of the scene",icon:"exposure_plus_1",condition:()=>o.exposureSlider!==void 0&&Number(o.exposureSlider?.get())!==1,click(){ve(1),o.exposureSlider?.setValue(1,!0),A()}}),o.tonemappingSelect=new BarSelect("display_settings_tone_mapping",{category:"preview",name:"Tone Mapping",description:"Changes the tone mapping of the preview",type:"select",default_value:_.NoToneMapping,value:Preview.selected.renderer.toneMapping??_.NoToneMapping,icon:"monochrome_photos",options:{[_.NoToneMapping]:"No Tone Mapping",[_.LinearToneMapping]:"Linear",[_.ReinhardToneMapping]:"Reinhard",[_.CineonToneMapping]:"Cineon",[_.ACESFilmicToneMapping]:"ACES"},onChange({value:e}){Preview.selected.renderer.toneMapping=Number(e);let a=1;Preview.selected.renderer.toneMapping===_.NoToneMapping?o.exposureSlider?.setValue(a,!0):a=Number(o.exposureSlider?.get()??1),Preview.all.forEach(t=>{t.renderer.toneMapping=Number(e),t.renderer.toneMappingExposure=a}),Preview.selected.renderer.toneMappingExposure=a,Blockbench.showQuickMessage(`Tone mapping set to ${this.getNameFor(e)}`,2e3),o.togglePbr&&!o.togglePbr.value&&o.togglePbr.set(!0),B()}})});var ae=class{async parse(a){let t=new le,r="model.usda";t.file(r,"");let n=we(),i={},s={};a.traverseVisible(m=>{if(!m.isMesh)return;let d=m;if(!d.material.isMeshStandardMaterial){console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",m);return}let c=d.geometry,v=d.material,g="geometries/Geometry_"+c.id+".usd";if(!t.file(g)){let x=rt(c);t.file(g,et(x))}v.uuid in i||(i[v.uuid]=v),n+=tt(d,c,v)}),n+=lt(i,s),t.file(r,n),n=null;for(let m in s){let d=s[m],c=m.split("_")[1],v=d.format===_.RGBAFormat,g=Ye(d.image,c),f=await(await new Promise(p=>g.toBlob(b=>b&&p(b),v?"image/png":"image/jpeg",1))).arrayBuffer();t.file(`textures/Texture_${m}.${v?"png":"jpg"}`,f)}let l=0;t.forEach(async m=>{let d=34+m.length;l+=d;let c=l&63,v=await t.file(m).async("uint8array");if(c!==4){let g=64-c,x=new Uint8Array(g),f=new Uint8Array(v.length+g);f.set(v,0),f.set(x,v.length),t.file(m,f)}l+=v.length});let u=await t.generateAsync({type:"blob",compression:"STORE"});return new Uint8Array(await u.arrayBuffer())}};function Ye(e,a){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=1024/Math.max(e.width,e.height),r=document.createElement("canvas");r.width=e.width*Math.min(1,t),r.height=e.height*Math.min(1,t);let n=r.getContext("2d");if(n.imageSmoothingEnabled=!1,n.drawImage(e,0,0,r.width,r.height),a!==void 0){let i=parseInt(a,16),s=(i>>16&255)/255,l=(i>>8&255)/255,u=(i&255)/255,m=n.getImageData(0,0,r.width,r.height),d=m.data;for(let c=0;c{let e=new Codec("usdz",{extension:"usdz",name:"USDZ",remember:!0,export_options:{normal_type:{type:"select",label:"Normal Map Type",default:"opengl",options:{opengl:"OpenGL",directx:"DirectX"}}},fileName(){return G()+".usdz"},async compile(a={}){if(!Project)throw new Error("No project loaded");let t=Object.assign(this.getExportOptions(),a);Project.textures.forEach(s=>{if(!s.material)return;let l=new k(s.layers,s.uuid),u=l.findTexture("normal",!0);if(!u)return;let m=$(u,t.normal_type);m&&l.saveTexture(h.normal,m)}),N();let r=new Te,n=new _.Scene;n.name="blockbench_export",n.add(Project.model_3d);let i=await r.parse(n);return this.dispatchEvent("compile",{model:i,options:t}),Canvas.scene.add(Project.model_3d),i},async export(a={}){let t=await this.compile(a);Blockbench.export({content:t,name:this.fileName(),startpath:this.startPath(),resource_id:"usdz",type:this.name,extensions:["usdz"],savetype:"buffer"},r=>this.afterDownload(r))}});o.exportUsdz=new Action("export_usdz",{category:"file",name:"Export USDZ",description:"Exports the current model as a USDZ file",icon:"stacks",async click(){if(!e)return;let a=await e.promptExportOptions();await e.export(a)}}),o.usdz=e,MenuBar.addAction(o.exportUsdz,"file.export")});C.push(()=>{MenuBar.removeAction("file.export_usdz")});y.push(()=>{o.bbmat=new Codec("material",{name:"Blockbench Material",extension:"bbmat",remember:!1,load_filter:{extensions:["bbmat"],type:"json"},compile(){if(!Texture.selected?.material||!Texture.selected?.layers_enabled)return;let e=Texture.selected.layers.map(a=>{let t=a.channel,r=a.canvas.toDataURL();return[t,r]});return JSON.stringify({version:K,channels:Object.fromEntries(e)})},parse(e,a){return e=typeof e=="string"?JSON.parse(e):e,e.version!==K?(Blockbench.showMessageBox({title:"Invalid Blockbench Material Version",message:`The material file "${a}" is not compatible with version ${F} of the PBR plugin.`,buttons:["OK"],confirm:0,width:400,cancel:0,checkboxes:{}},()=>null),{}):e.channels},load(e,a,t){if(!Project)return;let r=this.parse(e,a.path),n=Object.keys(r);if(!n.length)throw new Error("No valid channels found in the material");let i=r[h.albedo.id]??r[n[0]];n.includes("preview")&&(i=r.preview);let s=new Texture({name:pathToName(a.name),saved:!0,particle:!1,source:i,layers_enabled:!0});s.extend({material:!0});let l=n.map(u=>{if(!(u in h))return null;let m=r[u],d=new TextureLayer({name:u,data_url:m,visible:!0},s);return d.extend({channel:u}),d}).filter(Boolean);if(!l.length)throw new Error("No valid channel layers found in the material");i||s.fromDataURL(l[0].canvas.toDataURL()),s.add().select(),l.forEach(u=>{u.addForEditing(),s.width=Math.max(s.width,u.img.width),s.height=Math.max(s.height,u.img.height)}),s.updateChangesAfterEdit()},export(){Blockbench.export({resource_id:"material",type:this.name,extensions:[this.extension],name:`${Texture.selected?.name??this.fileName??"material"}.bbmat`,startpath:this.startPath(),content:this.compile()},e=>this.afterDownload(e))}}),o.bbMatExport=new Action("export_bbmat",{icon:"stacks",name:"Save as .bbmat",category:"file",condition:{project:!0,selected:{texture:!0},method(){return Texture.selected?.material}},click(){o.bbmat?.export?.()}}),o.bbMatImport=new Action("import_bbmat",{icon:"stacks",name:"Import .bbmat",category:"file",condition:{project:!0},click(){Blockbench.import({extensions:["bbmat"],type:"json",title:"Import .bbmat",multiple:!0},e=>{o.bbmat?.load&&e.forEach(a=>{o.bbmat.load(a.content,a,!0)})})}}),o.bbmat.export_action=o.bbMatExport,Texture.prototype.menu.addAction(o.bbMatExport),MenuBar.addAction(o.bbMatImport,"file.import")});C.push(()=>{Texture.prototype.menu.removeAction("export_bbmat"),MenuBar.removeAction("file.import.import_bbmat")});var Z=class e{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(h).map(t=>[t,h[t].default??new _.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([t,r])=>[t,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let t=Math.min(1,Math.max(0,a));return new _.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let a="#000000",t=Number(o.brushMetalnessSlider?.get()),r=Number(o.brushRoughnessSlider?.get()??1),n=(o.brushEmissiveColor?.get()??a).toString(),i=Number(o.brushHeightSlider?.get()),s=ColorPanel.get(),l={[h.albedo.id]:new _.Color(s),[h.metalness.id]:e.makeLinearColor(t),[h.roughness.id]:e.makeLinearColor(r),[h.emissive.id]:new _.Color(n??a),[h.height.id]:e.makeLinearColor(i)};return new e({colors:l})}};var Ce="materialBrushPresets",re=()=>JSON.parse(localStorage.getItem(Ce)||"{}"),ut=(e,a)=>{let t=re(),r=a??guid(),n=o.userMaterialBrushPresets?.getFormResult()??{},i={};return n.albedo&&(i.albedo=n.albedo.toString()),n.metalness&&(i.metalness=Number(n.metalness)),n.roughness&&(i.roughness=Number(n.roughness)),n.emissive&&(i.emissive=n.emissive.toString()),n.height&&(i.height=Number(n.height)),t[r]=[i,e??"New Preset",z(i)],localStorage.setItem(Ce,JSON.stringify(t)),r},Ee=({metalness:e,roughness:a,emissive:t,height:r,albedo:n})=>{e!==void 0&&o.brushMetalnessSlider?.setValue(e||0,!0),a!==void 0&&o.brushRoughnessSlider?.setValue(a??1,!0),t!==void 0&&o.brushEmissiveColor?.set(t??"#000000"),r!==void 0&&o.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},W=({id:e})=>Condition({project:!0,tools:["material_brush"],method(){let a=E();return(a?.layers_enabled&&a.layers.find(({channel:t})=>t&&t===e)!==void 0)===!0}}),mt=ie.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:h}},methods:{applyPreset(e){try{let[a,t]=this.userPresets[e],{metalness:r,roughness:n,emissive:i,height:s,albedo:l}=a;Ee({metalness:Number(r),roughness:Number(n),emissive:i.toString(),height:Number(s),albedo:l.toString()}),o.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${t}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(e){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let t=re(),r=this.userPresets[e][1]??e;delete t[e],localStorage.setItem("materialBrushPresets",JSON.stringify(t)),this.userPresets=t,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(e){o.userMaterialBrushPresets?.setFormValues({name:this.userPresets[e][1]??e,...this.userPresets[e][0]})},getSummary(e){return Object.entries(e).filter(([a])=>a in this.channels).map(([a,t])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${t}`:`${this.channels[a]?.label??a}: ${Number(t).toFixed(1)}`).join(` +`}function Me(e){return`(${e.r}, ${e.g}, ${e.b})`}function ye(e){return`(${e.x}, ${e.y})`}var Te=ae;y.push(()=>{let e=new Codec("usdz",{extension:"usdz",name:"USDZ",remember:!0,export_options:{normal_type:{type:"select",label:"Normal Map Type",default:"opengl",options:{opengl:"OpenGL",directx:"DirectX"}}},fileName(){return G()+".usdz"},async compile(a={}){if(!Project)throw new Error("No project loaded");let t=Object.assign(this.getExportOptions(),a);Project.textures.forEach(s=>{if(!s.material)return;let l=new D(s.layers,s.uuid),u=l.findTexture("normal",!0);if(!u)return;let m=$(u,t.normal_type);m&&l.saveTexture(h.normal,m)}),B();let r=new Te,n=new _.Scene;n.name="blockbench_export",n.add(Project.model_3d);let i=await r.parse(n);return this.dispatchEvent("compile",{model:i,options:t}),Canvas.scene.add(Project.model_3d),i},async export(a={}){let t=await this.compile(a);Blockbench.export({content:t,name:this.fileName(),startpath:this.startPath(),resource_id:"usdz",type:this.name,extensions:["usdz"],savetype:"buffer"},r=>this.afterDownload(r))}});o.exportUsdz=new Action("export_usdz",{category:"file",name:"Export USDZ",description:"Exports the current model as a USDZ file",icon:"stacks",async click(){if(!e)return;let a=await e.promptExportOptions();await e.export(a)}}),o.usdz=e,MenuBar.addAction(o.exportUsdz,"file.export")});C.push(()=>{MenuBar.removeAction("file.export_usdz")});y.push(()=>{o.bbmat=new Codec("material",{name:"Blockbench Material",extension:"bbmat",remember:!1,load_filter:{extensions:["bbmat"],type:"json"},compile(){if(!Texture.selected?.material||!Texture.selected?.layers_enabled)return;let e=Texture.selected.layers.map(a=>{let t=a.channel,r=a.canvas.toDataURL();return[t,r]});return JSON.stringify({version:K,channels:Object.fromEntries(e)})},parse(e,a){return e=typeof e=="string"?JSON.parse(e):e,e.version!==K?(Blockbench.showMessageBox({title:"Invalid Blockbench Material Version",message:`The material file "${a}" is not compatible with version ${F} of the PBR plugin.`,buttons:["OK"],confirm:0,width:400,cancel:0,checkboxes:{}},()=>null),{}):e.channels},load(e,a,t){if(!Project)return;let r=this.parse(e,a.path),n=Object.keys(r);if(!n.length)throw new Error("No valid channels found in the material");let i=r[h.albedo.id]??r[n[0]];n.includes("preview")&&(i=r.preview);let s=new Texture({name:pathToName(a.name),saved:!0,particle:!1,source:i,layers_enabled:!0});s.extend({material:!0});let l=n.map(u=>{if(!(u in h))return null;let m=r[u],d=new TextureLayer({name:u,data_url:m,visible:!0},s);return d.extend({channel:u}),d}).filter(Boolean);if(!l.length)throw new Error("No valid channel layers found in the material");i||s.fromDataURL(l[0].canvas.toDataURL()),s.add().select(),l.forEach(u=>{u.addForEditing(),s.width=Math.max(s.width,u.img.width),s.height=Math.max(s.height,u.img.height)}),s.updateChangesAfterEdit()},export(){Blockbench.export({resource_id:"material",type:this.name,extensions:[this.extension],name:`${Texture.selected?.name??this.fileName??"material"}.bbmat`,startpath:this.startPath(),content:this.compile()},e=>this.afterDownload(e))}}),o.bbMatExport=new Action("export_bbmat",{icon:"stacks",name:"Save as .bbmat",category:"file",condition:{project:!0,selected:{texture:!0},method(){return Texture.selected?.material}},click(){o.bbmat?.export?.()}}),o.bbMatImport=new Action("import_bbmat",{icon:"stacks",name:"Import .bbmat",category:"file",condition:{project:!0},click(){Blockbench.import({extensions:["bbmat"],type:"json",title:"Import .bbmat",multiple:!0},e=>{o.bbmat?.load&&e.forEach(a=>{o.bbmat.load(a.content,a,!0)})})}}),o.bbmat.export_action=o.bbMatExport,Texture.prototype.menu.addAction(o.bbMatExport),MenuBar.addAction(o.bbMatImport,"file.import")});C.push(()=>{Texture.prototype.menu.removeAction("export_bbmat"),MenuBar.removeAction("file.import.import_bbmat")});var Z=class e{constructor({colors:a}){this._colors={...Object.fromEntries(Object.keys(h).map(t=>[t,h[t].default??new _.Color(4294967040)])),...a}}get colors(){return this._colors}set colors(a){this._colors={...this._colors,...a}}toString(){let a=Object.entries(this._colors).map(([t,r])=>[t,r.getHexString()]);return JSON.stringify(a)}getChannel(a){return this._colors[a]}static makeLinearColor(a){let t=Math.min(1,Math.max(0,a));return new _.Color(t,t,t).convertSRGBToLinear()}static fromSettings(){let a="#000000",t=Number(o.brushMetalnessSlider?.get()),r=Number(o.brushRoughnessSlider?.get()??1),n=(o.brushEmissiveColor?.get()??a).toString(),i=Number(o.brushHeightSlider?.get()),s=ColorPanel.get(),l={[h.albedo.id]:new _.Color(s),[h.metalness.id]:e.makeLinearColor(t),[h.roughness.id]:e.makeLinearColor(r),[h.emissive.id]:new _.Color(n??a),[h.height.id]:e.makeLinearColor(i)};return new e({colors:l})}};var Ce="materialBrushPresets",re=()=>JSON.parse(localStorage.getItem(Ce)||"{}"),ut=(e,a)=>{let t=re(),r=a??guid(),n=o.userMaterialBrushPresets?.getFormResult()??{},i={};return n.albedo&&(i.albedo=n.albedo.toString()),n.metalness&&(i.metalness=Number(n.metalness)),n.roughness&&(i.roughness=Number(n.roughness)),n.emissive&&(i.emissive=n.emissive.toString()),n.height&&(i.height=Number(n.height)),t[r]=[i,e??"New Preset",z(i)],localStorage.setItem(Ce,JSON.stringify(t)),r},Ee=({metalness:e,roughness:a,emissive:t,height:r,albedo:n})=>{e!==void 0&&o.brushMetalnessSlider?.setValue(e||0,!0),a!==void 0&&o.brushRoughnessSlider?.setValue(a??1,!0),t!==void 0&&o.brushEmissiveColor?.set(t??"#000000"),r!==void 0&&o.brushHeightSlider?.setValue(Math.max(0,Math.min(1,r??.5)),!0),n!==void 0&&ColorPanel.set(n)},W=({id:e})=>Condition({project:!0,tools:["material_brush"],method(){let a=E();return(a?.layers_enabled&&a.layers.find(({channel:t})=>t&&t===e)!==void 0)===!0}}),mt=ie.extend({name:"UserPresetsDialog",data(){return{userPresets:{},channels:h}},methods:{applyPreset(e){try{let[a,t]=this.userPresets[e],{metalness:r,roughness:n,emissive:i,height:s,albedo:l}=a;Ee({metalness:Number(r),roughness:Number(n),emissive:i.toString(),height:Number(s),albedo:l.toString()}),o.userMaterialBrushPresets?.hide(),Blockbench.showQuickMessage(`Preset "${t}" applied`,2e3)}catch{Blockbench.showQuickMessage("Failed to apply preset",2e3)}},deletePreset(e){Blockbench.showMessageBox({title:"Delete Preset",message:"Are you sure you want to delete this preset?",confirm:1,cancel:0,buttons:["Cancel","Delete"],checkboxes:{},width:400},a=>{if(a){let t=re(),r=this.userPresets[e][1]??e;delete t[e],localStorage.setItem("materialBrushPresets",JSON.stringify(t)),this.userPresets=t,Blockbench.showQuickMessage(`Preset "${r}" deleted`,2e3)}})},editPreset(e){o.userMaterialBrushPresets?.setFormValues({name:this.userPresets[e][1]??e,...this.userPresets[e][0]})},getSummary(e){return Object.entries(e).filter(([a])=>a in this.channels).map(([a,t])=>a==="albedo"||a==="emissive"?`${this.channels[a]?.label??a}: ${t}`:`${this.channels[a]?.label??a}: ${Number(t).toFixed(1)}`).join(` `)}},computed:{presets(){return Object.entries(this.userPresets)}},mounted(){this.userPresets=re()},template:`
        @@ -197,7 +197,7 @@ ${n.join(` .delete_preset:hover .material-icons { color: var(--color-accent); - }`),o.brushMetalnessSlider=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",tool_setting:"brush_metalness",settings:{min:0,max:1,step:.01,default:0},condition:()=>W(h.metalness)}),o.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",tool_setting:"brush_roughness",settings:{min:0,max:1,step:.01,default:1},condition:()=>W(h.roughness)}),o.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",tool_setting:"brush_emissive",condition:()=>W(h.emissive)}),o.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",tool_setting:"brush_height",settings:{min:0,max:1,step:.01,default:.5},condition:()=>W(h.height)}),o.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",category:"tools",toolbar:"brush",condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){return E()?.layers_enabled??!1}},allowed_view_modes:"textured",tool_settings:{brush_metalness:0,brush_roughness:1,brush_emissive:"#000000",brush_height:.5},brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(e,a,t,r,{size:n,softness:i,texture:s,x:l,y:u}){let m=Z.fromSettings(),d=Object.keys(m.colors),c=Math.floor(n-i*n/100),v=t;return s.layers.forEach(g=>{if(!g.visible||!d.includes(g.channel))return;let x=m.getChannel(g.channel);if(!x)return;let f=Math.sqrt((l-e)**2+(u-a)**2),p=Math.min(1,f/c);if(l%c<=p&&u%c<=p){let b=g.ctx.getImageData(e,a,1,1).data,M=new _.Color(`rgb(${b[0]}, ${b[1]}, ${b[2]})`);x.lerp(M,1)}g.ctx.fillStyle=x.getStyle(),g.ctx.fillRect(e,a,1,1),g.selected&&(v={r:x.r*255,g:x.g*255,b:x.b*255,a:r*255})}),v}},onCanvasClick(e){Painter.startPaintToolCanvas(e,e.event)},onSelect(){Painter.updateNslideValues(),N()},click(){A()}}),o.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:{project:!0},click(){o.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:mt,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(e){Ee({metalness:Number(e.metalness??o.brushMetalnessSlider?.get()),roughness:Number(e.roughness??o.brushRoughnessSlider?.get()),emissive:(e.emissive??o.brushEmissiveColor?.get()).toString(),height:Number(e.height??o.brushHeightSlider?.get()),albedo:(e.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(e,a){o.materialBrushTool?.select(),e===1&&Blockbench.textPrompt("Save Preset","New Preset",t=>{t&&(ut(t),Blockbench.showQuickMessage(`Preset "${t}" saved`,2e3))})}}).show()}}),MenuBar.addAction(o.materialBrushTool,"tools.0")});C.push(()=>{MenuBar.removeAction("tools.material_brush")});y.push(()=>{o.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","load_brush_preset","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Settings"})],condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});y.push(()=>{o.displaySettingsPanel=new Panel("display_settings",{name:"PBR Controls",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure","show_channel_select_menu"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});var q=e=>e.visible&&e.channel&&e.channel!==R,dt=()=>{let e=B();if(e)return e.texture.layers.filter(q);let a=E();return a?a.layers_enabled?a.layers.filter(q):Texture.all.map(t=>t.layers_enabled?[...t.layers.filter(q)]:[q(t)?t:null]).flat().filter(Boolean):[]},Pe=["select_texture","update_texture_selection","finish_edit","add_texture"],Le=()=>{Panels.channels_panel.inside_vue.textures=dt()};y.push(()=>{o.channelsPanelStyle=Blockbench.addCSS(` + }`),o.brushMetalnessSlider=new NumSlider("slider_brush_metalness",{category:"paint",name:"Metalness",description:"Adjust the metalness of the brush",tool_setting:"brush_metalness",settings:{min:0,max:1,step:.01,default:0},condition:()=>W(h.metalness)}),o.brushRoughnessSlider=new NumSlider("slider_brush_roughness",{category:"paint",name:"Roughness",description:"Adjust the roughness of the brush",tool_setting:"brush_roughness",settings:{min:0,max:1,step:.01,default:1},condition:()=>W(h.roughness)}),o.brushEmissiveColor=new ColorPicker("brush_emissive_color",{category:"paint",name:"Emissive",description:"Adjust the emissive color of the brush",value:"#000000",tool_setting:"brush_emissive",condition:()=>W(h.emissive)}),o.brushHeightSlider=new NumSlider("slider_brush_height",{category:"paint",name:"Height",description:"Adjust the height of the brush",tool_setting:"brush_height",settings:{min:0,max:1,step:.01,default:.5},condition:()=>W(h.height)}),o.materialBrushTool=new Tool("material_brush",{name:"Material Brush",description:"Paints across multiple texture layers",icon:"view_in_ar",paintTool:!0,cursor:"cell",category:"tools",toolbar:"brush",condition:{project:!0,selected:{texture:!0},modes:["paint"],method(){return E()?.layers_enabled??!1}},allowed_view_modes:"textured",tool_settings:{brush_metalness:0,brush_roughness:1,brush_emissive:"#000000",brush_height:.5},brush:{blend_modes:!1,shapes:!0,size:!0,softness:!0,opacity:!0,offset_even_radius:!0,floor_coordinates:!0,changePixel(e,a,t,r,{size:n,softness:i,texture:s,x:l,y:u}){let m=Z.fromSettings(),d=Object.keys(m.colors),c=Math.floor(n-i*n/100),v=t;return s.layers.forEach(g=>{if(!g.visible||!d.includes(g.channel))return;let x=m.getChannel(g.channel);if(!x)return;let f=Math.sqrt((l-e)**2+(u-a)**2),p=Math.min(1,f/c);if(l%c<=p&&u%c<=p){let b=g.ctx.getImageData(e,a,1,1).data,M=new _.Color(`rgb(${b[0]}, ${b[1]}, ${b[2]})`);x.lerp(M,1)}g.ctx.fillStyle=x.getStyle(),g.ctx.fillRect(e,a,1,1),g.selected&&(v={r:x.r*255,g:x.g*255,b:x.b*255,a:r*255})}),v},onStrokeStart({texture:e}){return Undo.initEdit({layers:e.layers}),!0},onStrokeEnd({texture:e}){return Undo.finishEdit("Material Brush Stroke"),!0}},onCanvasClick(e){Painter.startPaintToolCanvas(e,e.event)},onSelect(){Painter.updateNslideValues(),B()},click(){A()}}),o.loadBrushPreset=new Action("load_brush_preset",{icon:"stroke_full",name:"Material Brush Presets",description:"Load or save a brush preset",category:"paint",condition:{project:!0},click(){o.userMaterialBrushPresets=new Dialog("user_brush_presets",{id:"user_brush_presets",title:"Edit Material Brush",component:mt,part_order:["lines","component","form"],form:{albedo:{type:"color",label:"Albedo",value:ColorPanel.get(),toggle_enabled:!0},metalness:{type:"number",label:"Metalness",min:0,max:1,step:.01,full_width:!1,toggle_enabled:!0},roughness:{type:"number",label:"Roughness",min:0,max:1,step:.01,toggle_enabled:!0,full_width:!1},emissive:{type:"color",label:"Emissive",value:"#000000",toggle_enabled:!0},height:{type:"number",label:"Height",min:0,max:1,step:.01,toggle_enabled:!0}},onConfirm(e){Ee({metalness:Number(e.metalness??o.brushMetalnessSlider?.get()),roughness:Number(e.roughness??o.brushRoughnessSlider?.get()),emissive:(e.emissive??o.brushEmissiveColor?.get()).toString(),height:Number(e.height??o.brushHeightSlider?.get()),albedo:(e.albedo??ColorPanel.get()).toString()})},buttons:["Close","Save","Apply"],cancelIndex:0,confirmIndex:2,onButton(e,a){o.materialBrushTool?.select(),e===1&&Blockbench.textPrompt("Save Preset","New Preset",t=>{t&&(ut(t),Blockbench.showQuickMessage(`Preset "${t}" saved`,2e3))})}}).show()}}),MenuBar.addAction(o.materialBrushTool,"tools.0")});C.push(()=>{MenuBar.removeAction("tools.material_brush")});y.push(()=>{o.materialBrushPanel=new Panel("material_brush_panel",{name:"Material Brush",id:"material_brush_panel",icon:"view_in_ar",toolbars:[new Toolbar("material_brush_toolbar",{id:"material_brush_toolbar",children:["material_brush","load_brush_preset","slider_brush_metalness","slider_brush_roughness","brush_emissive_color","slider_brush_height"],name:"Material Settings"})],condition:{modes:["paint"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"right",default_position:{slot:"right_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"color",insert_before:"outliner"})});y.push(()=>{o.displaySettingsPanel=new Panel("display_settings",{name:"PBR Controls",id:"display_settings_panel",icon:"display_settings",toolbars:[new Toolbar("controls_toolbar",{id:"controls_toolbar",children:["toggle_pbr","correct_lights","display_settings_tone_mapping","display_settings_exposure","display_settings_reset_exposure","show_channel_select_menu"],name:"Display Settings"})],display_condition:{modes:["edit","paint","animate"],project:!0},component:{},expand_button:!0,growable:!1,onFold(){},onResize(){},default_side:"left",default_position:{slot:"left_bar",float_position:[0,0],float_size:[400,300],height:300,folded:!1},insert_after:"textures",insert_before:"color"})});var q=e=>e.visible&&e.channel&&e.channel!==N,dt=()=>{let e=R();if(e)return e.texture.layers.filter(q);let a=E();return a?a.layers_enabled?a.layers.filter(q):Texture.all.map(t=>t.layers_enabled?[...t.layers.filter(q)]:[q(t)?t:null]).flat().filter(Boolean):[]},Pe=["select_texture","update_texture_selection","finish_edit","add_texture"],Le=()=>{Panels.channels_panel.inside_vue.textures=dt()};y.push(()=>{o.channelsPanelStyle=Blockbench.addCSS(` .texture_channel { color: var(--color-text); flex: 1; @@ -263,7 +263,7 @@ ${n.join(` border-top: 1px solid var(--color-border); padding-right: 0; } - `),o.channelsPanel=new Panel("channels_panel",{name:"PBR Channels",id:"channels_panel",icon:"gallery_thumbnail",condition:{project:!0,selected:{texture:!0},modes:["paint","edit"]},toolbars:[],component:{name:"ChannelsPanel",data(){return{channels:h,textures:[]}},methods:{openMenu(e){o.channelMenu?.open(e)},selectTexture(e){Modes.options.paint.select(),e.select(),e.scrollTo()},channelEnabled(e){return e.channel&&e.channel!==R&&e.channel in this.channels},getImgSrc(e){return e.img?.src??`data:image/png;base64,${e.canvas.toDataURL()}`}},template:` + `),o.channelsPanel=new Panel("channels_panel",{name:"PBR Channels",id:"channels_panel",icon:"gallery_thumbnail",condition:{project:!0,selected:{texture:!0},modes:["paint","edit"]},toolbars:[],component:{name:"ChannelsPanel",data(){return{channels:h,textures:[]}},methods:{openMenu(e){o.channelMenu?.open(e)},selectTexture(e){Modes.options.paint.select(),e.select(),e.scrollTo()},channelEnabled(e){return e.channel&&e.channel!==N&&e.channel in this.channels},getImgSrc(e){return e.img?.src??`data:image/png;base64,${e.canvas.toDataURL()}`}},template:`
        • { return rgba; }, + onStrokeStart({ texture }) { + Undo.initEdit({ + layers: texture.layers, + }); + + return true; + }, + onStrokeEnd({ texture }) { + Undo.finishEdit("Material Brush Stroke"); + + return true; + }, }, onCanvasClick(data: any) { Painter.startPaintToolCanvas(data, data.event); From bf53bf2431161ebdef8f7cfd12660d4f6eea9dd5 Mon Sep 17 00:00:00 2001 From: Jason Gardner Date: Fri, 12 Jul 2024 06:57:07 -0500 Subject: [PATCH 35/50] fix: Plugins conflict - Fixed VS Code stomping on JSON formatting --- plugins.json | 316 ++++++-------------------- src/pbr_preview/.vscode/settings.json | 4 - 2 files changed, 66 insertions(+), 254 deletions(-) delete mode 100644 src/pbr_preview/.vscode/settings.json diff --git a/plugins.json b/plugins.json index cd5bf352..123cfc3a 100644 --- a/plugins.json +++ b/plugins.json @@ -2,11 +2,7 @@ "sam3dj": { "title": "sam3DJ", "author": "1Turtle", - "tags": [ - "Minecraft: Java Edition", - "Format", - "Exporter" - ], + "tags": ["Minecraft: Java Edition", "Format", "Exporter"], "version": "1.1.0", "variant": "both", "description": "Generate 3D prints in MC (Java Edition) via the .3DJ format within the SC-Peripherals mod!", @@ -21,11 +17,7 @@ "version": "0.4.8", "min_version": "4.9.4", "variant": "desktop", - "tags": [ - "Minecraft: Java Edition", - "Animation", - "Display Entities" - ], + "tags": ["Minecraft: Java Edition", "Animation", "Display Entities"], "await_loading": true }, "armor_stand_animator": { @@ -33,9 +25,7 @@ "author": "DoubleFelix", "description": "Provides an interface to animate armor stands which is converted to a data pack", "about": "To start, create the armor stand model by using the \"Create Armor Stand Model\" action in the toolbar. Then, create your animation in the animate tab as normal. Make sure the snapping value for keyframes is set to 20 for best results. When you're finished, use the \"Export Armor Stand Animation\" action in the toolbar. Change the settings as needed, then click \"Confirm\". Animations can be run with \"/execute as @e[tag=entity_tag] run function animation_pack:start\". The armor stand for an animation can be summoned with \"/function animation_pack:create\". Supports looping, time scale, block/blockbench unit scale, pausing and playback, and start delays.", - "tags": [ - "Minecraft: Java Edition" - ], + "tags": ["Minecraft: Java Edition"], "icon": "fa-forward", "version": "1.1.0", "min_version": "4.0.0", @@ -46,9 +36,7 @@ "author": "Command master", "description": "Takes two java item models and outputs a zip with a resourcepack and a datapack to make a clear transaction between them in the players hand (the plugin can also work for other animations but the datapack have to be coded manually).", "about": "The animation is activated using \"/scoreboard players set @s animation 0\".\nTo use click Filter -> Save starting model the save the first model, and then click on File -> Export -> Export animation to download the ZIP file of the animation", - "tags": [ - "Minecraft: Java Edition" - ], + "tags": ["Minecraft: Java Edition"], "icon": "compare", "variant": "both" }, @@ -56,10 +44,7 @@ "title": "Bedrock Entity Model Presets", "author": "Geenium", "description": "Loads Bedrock vanilla entity models up to version 1.13", - "tags": [ - "Deprecated", - "Minecraft: Bedrock Edition" - ], + "tags": ["Deprecated", "Minecraft: Bedrock Edition"], "deprecation_note": "This plugin is no longer updated. To get models for texturing, use File > New > Minecraft Skin. To get Minecraft Bedrock Edition models, use the plugin 'Minecraft Entity Wizard'. To get template models for OptiFine CEM, use the plugin 'CEM Template Loader'.", "icon": "pets", "variant": "both" @@ -77,9 +62,7 @@ "author": "SnaveSutit", "icon": "flip_to_back", "description": "Creates inverted duplicates of the selected cube(s) to allow double-sided rendering in Minecraft: Java Edition.", - "tags": [ - "Minecraft: Java Edition" - ], + "tags": ["Minecraft: Java Edition"], "version": "1.0.1", "variant": "both" }, @@ -137,9 +120,7 @@ "title": "Player Statue Generator", "author": "Wither, dragonmaster95 and 3XH6R", "description": "Generates player shaped models.", - "tags": [ - "Minecraft: Java Edition" - ], + "tags": ["Minecraft: Java Edition"], "icon": "accessibility", "min_version": "3.0.0", "variant": "both" @@ -158,9 +139,7 @@ "author": "JTK222 (Maintainer), Wither (For the original Techne importer), Ocraftyone (VoxelShape improvements)", "icon": "fa-cubes", "description": "Allows importing Tabula files, and exporting VoxelShapes", - "tags": [ - "Minecraft: Java Edition" - ], + "tags": ["Minecraft: Java Edition"], "version": "1.7.1", "variant": "desktop" }, @@ -177,9 +156,7 @@ "icon": "event_seat", "author": "JannisX11", "description": "Preview seat positions, hit/selection boxes, and collision boxes for custom MC Bedrock entities and blocks", - "tags": [ - "Minecraft: Bedrock Edition" - ], + "tags": ["Minecraft: Bedrock Edition"], "version": "1.3.2", "min_version": "3.0.0", "variant": "both" @@ -200,9 +177,7 @@ "author": "JannisX11", "description": "Allows to import and export CraftStudio Models (.csmodel).", "about": "To **import** a model from CraftStudio, go to the CraftStudio project settings and export a cspack file. Open this file in an archive manager (like 7zip) and extract the model file. Import the file into Blockbench using the import menu. \nTo **export** a file, export a .csmodel file from Blockbench and drop it into an existing .cspack file into the Models folder. Make sure it is using the same file name as the old model in the pack. Import the .cspack into CraftStudio and select the models you want to import.", - "tags": [ - "CraftStudio" - ], + "tags": ["CraftStudio"], "variant": "both", "version": "0.1.3", "min_version": "3.2.0" @@ -229,11 +204,7 @@ "icon": "icon.png", "author": "Ewan Howell", "description": "Load template Java Edition entity models for use with OptiFine CEM. Also includes an animation editor, so that you can create custom entity animations.", - "tags": [ - "Minecraft: Java Edition", - "OptiFine", - "Templates" - ], + "tags": ["Minecraft: Java Edition", "OptiFine", "Templates"], "version": "8.1.0", "min_version": "4.10.0", "variant": "both", @@ -249,11 +220,7 @@ "author": "Ewan Howell", "description": "Adds a new format that allows you to create OptiFine player models.", "about": "This plugin adds a new format that allows you to make you own custom OptiFine player models.\n## Setup\n1. Open your launcher and go to the **Installations** tab.\n2. Find your installation, click the triple dot, and slect **Edit**.\n3. Select **More Options**.\n4. Inside the **JVM ARGUMENTS** field, add:\n`-Dplayer.models.local=true -Dplayer.models.reload=true`\nNote:\t**player.models.reload** reloads the model every 5 seconds in game, and can be disabled after you finish making the model.\n5. Make a folder named playermodels inside your **.minecraft** folder.\n6. Inside that folder, make 2 more folders named items and users.\n\n## Usage\n- You need a config file for every player with a player model. This config file must be the players username, and needs to go in the **users** folder.\n**Example**: `.minecraft/playermodels/users/ewanhowell5195.cfg`\n- You can create a user config by going to **File > Export > Create OptiFine Player Model Config**.\n- Exported player models should go in a folder named what the player model is, inside the **items** folder, and be named `model.cfg`.\n**Example**: `.minecraft/playermodels/items/horns/model.cfg`\n- If not using **Use Player Texture**, textures must go inside a folder named `users` located next to the model file, and be named the players username.\n**Example**: `.minecraft/playermodels/items/horns/users/ewanhowell5195.png`\n\n## Limitations\n- They are client side only.\n- They are not part of resource packs.\n- They require OptiFine, and JVM args set in the launcher.\n- Animations are not supported.\n- You can only target specific players, not all players.\n\n## Important\nEnabling the player model JVM arguments **will disable any online player models**, usually being seasonal cosmetics like the Santa and Witch hats.", - "tags": [ - "Minecraft: Java Edition", - "OptiFine", - "Player Models" - ], + "tags": ["Minecraft: Java Edition", "OptiFine", "Player Models"], "version": "1.3.3", "min_version": "4.2.0", "variant": "both", @@ -264,11 +231,7 @@ "icon": "icon.png", "author": "Ewan Howell", "description": "Generate hue shifted gradient palettes from a single colour.", - "tags": [ - "Paint", - "Palette", - "Color" - ], + "tags": ["Paint", "Palette", "Color"], "version": "2.0.0", "min_version": "4.10.0", "variant": "both", @@ -284,10 +247,7 @@ "author": "Ewan Howell", "description": "Add the ability to collapse the start screen categories.", "about": "This plugin adds a small dropdown arrow next to each category on the start screen, allowing you to collapse each category and hide their respective formats.", - "tags": [ - "Menu", - "Start screen" - ], + "tags": ["Menu", "Start screen"], "version": "1.0.0", "min_version": "4.4.1", "variant": "both" @@ -297,10 +257,7 @@ "icon": "icon.png", "author": "Ewan Howell", "description": "Create your very own preview scenes. Download preview scenes from the Preview Scene Store. Edit and manage existing preview scenes.", - "tags": [ - "Preview Scenes", - "Blockbench" - ], + "tags": ["Preview Scenes", "Blockbench"], "version": "1.1.1", "min_version": "4.8.3", "variant": "both", @@ -313,11 +270,7 @@ "author": "Ewan Howell", "description": "Customise the start screen's splash art, by adding your own!", "about": "This plugin allows you to customise the start screen's splash art by adding your own! If you add multiple splash art images, you can set it to pick a random one every time your launch Blockbench.\n\n## How to use\nOn the top left corner of the splash art, you will find a gear icon. From here you can manage your custom splash arts.\n\n## Splash art types\n- URL - A splash art can be loaded from a URL (faster loading)\n- File - A splash art can be loaded from a file (slower loading)\n- Gallery - Pick an image from the [Blockbench Gallery](https://www.blockbench.net/gallery)\n\n## Supported file types\n- PNG\n- JPG/JPEG\n- GIF\n- WebP\n- SVG", - "tags": [ - "Splash art", - "Start screen", - "Blockbench" - ], + "tags": ["Splash art", "Start screen", "Blockbench"], "version": "1.1.0", "min_version": "4.7.0", "variant": "both" @@ -327,10 +280,7 @@ "icon": "icon.png", "author": "Ewan Howell", "description": "Add a new scene recorder where you can record your model in a large variety of formats.", - "tags": [ - "Recording", - "Media" - ], + "tags": ["Recording", "Media"], "version": "1.2.0", "min_version": "4.8.0", "variant": "desktop", @@ -342,10 +292,7 @@ "author": "Ewan Howell", "description": "View the project backups from within Blockbench.", "about": "Add a backup tab to the Blockbench start screen that allows you to view a list of the project backups from within Blockbench.", - "tags": [ - "Backups", - "Blockbench" - ], + "tags": ["Backups", "Blockbench"], "version": "1.0.0", "min_version": "4.5.2", "variant": "desktop" @@ -356,11 +303,7 @@ "author": "Ewan Howell", "description": "Track how long you spend using Blockbench and working on each project.", "about": "This plugin allows you to keep track of how much time you spend using Blockbench and how long you spend working on each project.\n\nTo view your activity stats, go to `Tools > Activity Tracker`. From here you can see all your stats for both Blockbench and the current project.", - "tags": [ - "Tracking", - "Stats", - "Utility" - ], + "tags": ["Tracking", "Stats", "Utility"], "version": "1.0.1", "min_version": "4.6.5", "variant": "both" @@ -370,20 +313,14 @@ "icon": "icon.png", "author": "Ewan Howell", "description": "Create Minecraft-styled title models!", - "tags": [ - "Minecraft", - "Title", - "Logo" - ], + "tags": ["Minecraft", "Title", "Logo"], "version": "1.6.0", "min_version": "4.8.0", "variant": "both", "creation_date": "2023-06-10", "await_loading": true, "contributes": { - "formats": [ - "minectaft_title" - ] + "formats": ["minectaft_title"] }, "has_changelog": true, "website": "https://ewanhowell.com/plugins/minecraft-title-generator/", @@ -395,11 +332,7 @@ "icon": "icon.png", "author": "Ewan Howell", "description": "Organise your recent projects into workspaces that you can switch between.", - "tags": [ - "Files", - "Management", - "Blockbench" - ], + "tags": ["Files", "Management", "Blockbench"], "version": "1.0.0", "min_version": "4.8.0", "variant": "desktop", @@ -410,11 +343,7 @@ "icon": "icon.png", "author": "Ewan Howell", "description": "Edit plugins and themes live in any text editor and have them automatically update in Blockbench.", - "tags": [ - "Plugins", - "Themes", - "Blockbench" - ], + "tags": ["Plugins", "Themes", "Blockbench"], "version": "1.0.1", "min_version": "4.10.0", "variant": "desktop", @@ -429,12 +358,8 @@ "icon": "icon.png", "author": "Ewan Howell", "description": "A collection of utilities to assist with resource pack creation.", - "tags": [ - "Minecraft: Java Edition", - "Resource Packs", - "Utilities" - ], - "version": "1.0.0", + "tags": ["Minecraft: Java Edition", "Resource Packs", "Utilities"], + "version": "1.1.0", "min_version": "4.10.0", "variant": "desktop", "website": "https://ewanhowell.com/plugins/resource-pack-utilities/", @@ -480,9 +405,7 @@ "author": "Eliot Lash", "icon": "icon-format_java", "description": "Plugin for exporting Modded Entities using Fabric/Yarn Sourcemap", - "tags": [ - "Minecraft: Java Edition" - ], + "tags": ["Minecraft: Java Edition"], "version": "0.2.2", "min_version": "3.6.6", "variant": "both" @@ -492,9 +415,7 @@ "icon": "layers", "author": "aidancbrady", "description": "Allows exporting in Forge's multi-layer model format.", - "tags": [ - "Minecraft: Java Edition" - ], + "tags": ["Minecraft: Java Edition"], "version": "1.0", "variant": "both" }, @@ -537,9 +458,7 @@ "description": "Stitch multiple textures into a single texture", "version": "1.0.6", "min_version": "4.8.0", - "tags": [ - "Texture" - ], + "tags": ["Texture"], "variant": "both", "has_changelog": true }, @@ -548,9 +467,7 @@ "icon": "icon-format_block", "author": "Arcaniax", "description": "Helps making new Bedrock blocks (requires experimental mode)", - "tags": [ - "Minecraft: Bedrock Edition" - ], + "tags": ["Minecraft: Bedrock Edition"], "variant": "desktop", "version": "0.1.1" }, @@ -577,9 +494,7 @@ "author": "JannisX11", "description": "Adds multiple sliders to tweak keyframes", "about": "Adds sliders and other tools to modify keyframes:\n\nYou can add the sliders and tools to any of your toolbars by clicking the three dots on the right side and selecting **Customize**. Search for the slider you want to add and click to add it.\n\n- **Tween Keyframes:** Amplify the values of the selected keyframes\n- **Amplify Keyframes:** Amplify the values of the selected keyframes\n- **Ease Keyframes:** Create a curve with the selected keyframes between the adjacent keyframes\n- **Retime Keyframes:** Shift the curve in the graph editor without changing the time of the keyframe. This allows you to change the time of one axis individually\n- **Keyframe Slider Axis:** Select which axis the keyframe sliders affect\n- **Create Keyframe Column:** Key all channels in the timeline at the current timecode, if they already have keyframes\n- **Select Keyframe Column:** Select all keyframes in the timeline along a column below the playhead\n- **Normalize Keyframes:** Subtract the currently displayed value from all selected keyframes, in order to remove the base pose from the model.", - "tags": [ - "Animation" - ], + "tags": ["Animation"], "version": "0.3.1", "min_version": "3.7.0", "new_repository_format": true, @@ -592,9 +507,7 @@ "description": "Generates Voxel Shapes (Supports Mojang Mappings and MCP)", "version": "0.2.0", "variant": "both", - "tags": [ - "Minecraft: Java Edition" - ] + "tags": ["Minecraft: Java Edition"] }, "voxel_shape_fabric_generator": { "title": "VoxelShape Fabric Generator", @@ -603,18 +516,14 @@ "description": "Generates Voxel Shapes for Fabric", "version": "1.0.0", "variant": "both", - "tags": [ - "Minecraft: Java Edition" - ] + "tags": ["Minecraft: Java Edition"] }, "mimodel_format": { "title": "Mine-imator Model Exporter", "icon": "fas.fa-box-open", "author": "JannisX11", "description": "Export .mimodel files for Mine-imator and Modelbench", - "tags": [ - "Exporter" - ], + "tags": ["Exporter"], "version": "1.0.2", "min_version": "3.7.0", "variant": "both" @@ -624,9 +533,7 @@ "author": "JannisX11 & Mojang Studios", "icon": "icon.png", "description": "Create entities for Minecraft: Bedrock Edition! Start with the looks and behavior of a vanilla entity, and turn it into your own creation!", - "tags": [ - "Minecraft: Bedrock Edition" - ], + "tags": ["Minecraft: Bedrock Edition"], "version": "1.5.1", "min_version": "4.8.0", "variant": "both", @@ -638,9 +545,7 @@ "author": "JannisX11 & Mojang Studios", "icon": "icon.png", "description": "Create custom blocks for Minecraft: Bedrock Edition!", - "tags": [ - "Minecraft: Bedrock Edition" - ], + "tags": ["Minecraft: Bedrock Edition"], "version": "1.2.2", "min_version": "4.8.0", "variant": "both", @@ -651,9 +556,7 @@ "author": "JannisX11 & Mojang Studios", "icon": "icon.png", "description": "Create custom items for Minecraft: Bedrock Edition!", - "tags": [ - "Minecraft: Bedrock Edition" - ], + "tags": ["Minecraft: Bedrock Edition"], "version": "1.1.0", "min_version": "4.8.0", "variant": "both", @@ -683,9 +586,7 @@ "icon": "icon-format_java", "description": "Exports Blockbench animations as the JSON format for Endimator animations from the Blueprint Mod Library. https://github.com/team-abnormals/blueprint", "about": "Go to Animation -> Export Endimations...", - "tags": [ - "Minecraft: Java Edition" - ], + "tags": ["Minecraft: Java Edition"], "version": "1.0.0", "min_version": "4.0.0", "variant": "both" @@ -718,11 +619,7 @@ "variant": "both", "creation_date": "2022-04-09", "has_changelog": true, - "tags": [ - "Format: Generic Model", - "Mesh", - "Tool" - ] + "tags": ["Format: Generic Model", "Mesh", "Tool"] }, "wasd_controls": { "title": "WASD Controls", @@ -740,10 +637,7 @@ "icon": "icon-player", "description": "Create Skin Packs for the Minecraft Marketplace", "about": "Generates skin packs for the Minecraft Marketplace.\nAll textures in all open tabs count as skins. You can load individual skins into Blockbench via **File** > **Import Minecraft Skins**.\nYou can also create new skins via **New** > **Minecraft Skin**, in the File menu or on the start screen.\nExport a skin pack via **File** > **Export** > **Export Skin Pack**.", - "tags": [ - "Minecraft: Bedrock Edition", - "Minecraft Marketplace" - ], + "tags": ["Minecraft: Bedrock Edition", "Minecraft Marketplace"], "version": "0.2.0", "min_version": "4.2.3", "variant": "desktop" @@ -756,9 +650,7 @@ "version": "1.1.0", "variant": "both", "min_version": "4.3.0", - "tags": [ - "Minecraft: Java Edition" - ], + "tags": ["Minecraft: Java Edition"], "about": "Tint Preview is a tool to help designers who work with the tint face feature of Java Block/Item models. It features the ability to quickly preview a color on tint enabled faces. Tint Preview adds two new actions to the Tools menu that allows you to toggle tinting and change the tint color.\n**Important:** This plugin is designed for Java Block/Item models only and will not work for other formats." }, "pie_menu": { @@ -769,9 +661,7 @@ "about": "

          Built-in Pies

          Add Pie Keybind:

          ctrl + shift + a

          Import Pie Keybind:

          shift + q

          Export Pie Keybind:

          shift + w

          Mode Pie Keybind:

          shift + tab (web: shift + x)

          View Mode Pie Keybind:

          alt + z

          Toolbox Pie Keybind:

          shift + t

          New Pie Keybind:

          shift + n

          Preferences Pie Keybind:

          shift + o

          Rotate Pie Keybind:

          shift + r

          Flip Pie Keybind:

          shift + f

          Center Pie Keybind:

          shift + c

          Properties Pie Keybind:

          shift + p

          API

          CSS Variables

          NameDefaultDescription
          --pie-dir_idct_size10%sets the angle indicator size
          --pie-major_radius30pxsets the center pie's radius
          --pie-major_thickness22pxsets the center pie's thickness
          ", "version": "1.0.0", "variant": "both", - "tags": [ - "Interface" - ] + "tags": ["Interface"] }, "quick_box_uv_layout": { "title": "Quick Box-UV Layout", @@ -791,10 +681,7 @@ "variant": "both", "about": "This plugin exports your Blockbench animations as Java code to be used for the new 1.19+ keyframe system. Please note that this system does not support Molang or step interpolation.", "deprecation_note": "This feature is now built into Blockbench, the plugin is no longer required.", - "tags": [ - "Deprecated", - "Minecraft: Java Edition" - ] + "tags": ["Deprecated", "Minecraft: Java Edition"] }, "root_motion_extractor": { "title": "Root Motion Extractor", @@ -802,11 +689,7 @@ "author": "Tschipp", "description": "Attempts to extract root motion from an animation", "about": "This plugin extracts the velocity in m/s for an animation, and provides a value to be used in a movement component to achieve that exact speed. This helps reduce/eliminate foot sliding.", - "tags": [ - "Minecraft: Bedrock Edition", - "Animation", - "Root Motion" - ], + "tags": ["Minecraft: Bedrock Edition", "Animation", "Root Motion"], "version": "1.1.0", "variant": "both" }, @@ -816,11 +699,7 @@ "author": "SirJain", "description": "Edits the opacity and color of the ground plane feature in Blockbench.", "about": "This simple plugin allows you to customize the ground plane feature in Blockbench; more specifically, the opacity and color.\n## How to use\nTo use this plugin, simply go to `Tools > Ground Plane Editor`, fill out the appropriate categories, and hit `Done`. You can choose to edit either the color, the opacity, or both!\n\nPlease report any bugs or suggestions you may have.", - "tags": [ - "Ground Plane", - "Animation", - "Customization" - ], + "tags": ["Ground Plane", "Animation", "Customization"], "version": "1.1.1", "min_version": "4.2.0", "variant": "both" @@ -831,11 +710,7 @@ "author": "SirJain and Geode", "description": "Allows users to add their own marker colors.", "about": "To make a new custom marker, go to Tools > Marker Colors > Add Custom Color to get started with making your own custom marker color. Once you are done, click Confirm. You will now see your marker color in the default color list. And finally, if you ever choose to view or edit your marker colors, you can use Tools > Marker Colors > Manage Marker Colors", - "tags": [ - "Marker Color", - "Customize", - "UX" - ], + "tags": ["Marker Color", "Customize", "UX"], "version": "1.1.0", "min_version": "4.2.0", "variant": "both" @@ -845,11 +720,7 @@ "author": "leopoldhub", "description": "Export your java models and texture into a resourcepack", "icon": "fa-file-zipper", - "tags": [ - "Minecraft: Java Edition", - "Resourcepack", - "Exporter" - ], + "tags": ["Minecraft: Java Edition", "Resourcepack", "Exporter"], "version": "1.0.1", "min_version": "4.4.0", "variant": "both" @@ -859,9 +730,7 @@ "author": "JannisX11", "description": "Adds a Grayscale preview mode. The mode can be toggled from the View menu.", "icon": "filter_b_and_w", - "tags": [ - "Viewport" - ], + "tags": ["Viewport"], "version": "1.0.0", "min_version": "4.3.0", "variant": "both" @@ -874,11 +743,7 @@ "version": "1.0.0", "min_version": "4.4.0", "variant": "both", - "tags": [ - "Paint", - "Customization", - "Interface" - ] + "tags": ["Paint", "Customization", "Interface"] }, "pluginstats": { "title": "Plugin Statistics", @@ -887,11 +752,7 @@ "description": "View download statistics of your blockbench plugin", "version": "1.3.0", "variant": "both", - "tags": [ - "Blockbench", - "Plugins", - "Development" - ] + "tags": ["Blockbench", "Plugins", "Development"] }, "repeat_it": { "title": "Repeat It", @@ -916,10 +777,7 @@ "title": "Image Centering", "icon": "center_focus_strong", "author": "SirJain", - "tags": [ - "Format: Image", - "UX" - ], + "tags": ["Format: Image", "UX"], "description": "Adds a button and a keybind that centers the image viewport in an Image format.", "about": "This plugin adds a button that allows you to reset your viewport in the Image format.\n## How to use\nTo use this plugin, go to the brush toolbar (top of the image mode) and click the `Center Image Viewport` button. If it doesn't show up, make sure you are in the Image format. If you are, you can add the tool using the `Customize Toolbar` option. There will be a confirmation message displayed on-screen once you center the viewport.\n\nPlease report any bugs or suggestions you may have.", "version": "1.1.1", @@ -933,10 +791,7 @@ "description": "Adds actions to export/import models in BBS format, which is used by BBS machinima studio.", "version": "1.2.3", "variant": "both", - "tags": [ - "Exporter", - "Importer" - ], + "tags": ["Exporter", "Importer"], "min_version": "4.8.0", "has_changelog": true }, @@ -947,9 +802,7 @@ "description": "Generates Shape JSONs for the Highlight mod. Mod can be found at: https://links.resourcefulbees.com/highlight", "version": "1.0.0", "variant": "both", - "tags": [ - "Minecraft: Java Edition" - ] + "tags": ["Minecraft: Java Edition"] }, "obj_animation_export": { "title": "OBJ Animation Exporter", @@ -960,9 +813,7 @@ "version": "0.1.0", "min_version": "4.0.0", "variant": "both", - "tags": [ - "Exporter" - ] + "tags": ["Exporter"] }, "explorer": { "title": "Explorer", @@ -970,9 +821,7 @@ "author": "JannisX11", "description": "Navigate the files in your project from the sidebar in Blockbench!", "about": "Use the folder icon in the left corner of the tab bar to open the explorer. Click files to peak into them, double click to jump into the file. Right click a file to bring up the context menu.", - "tags": [ - "Files" - ], + "tags": ["Files"], "version": "1.0.2", "min_version": "4.6.0", "variant": "desktop" @@ -993,11 +842,7 @@ "author": "SirJain", "description": "Generates blocky text in cubes.", "about": "This plugin adds a button under the `Tools` menu that allows you to generate Minecraft-like text.\n## How to use\nTo use this plugin, go to `Tools > Generate Text`. Simply enter some text, configure your settings how you like, and press `Generate`!\n\nPlease report any bugs or suggestions you may have.", - "tags": [ - "Deprecated", - "Minecraft", - "Font" - ], + "tags": ["Deprecated", "Minecraft", "Font"], "version": "2.0.1", "min_version": "4.2.0", "variant": "both" @@ -1008,11 +853,7 @@ "author": "SirJain and DerfX", "description": "Flashes elements based on template conditions.", "about": "This plugin allows you to flash elements that meet certain preset conditions on-screen.\\n## How to use\\nTo use this plugin, simply go to `Tools -> Utility Flaggers`. Pick a preset option, fill out your preferred settings, and press `Flag`!", - "tags": [ - "Utility", - "BoxUV", - "Format: Generic Model" - ], + "tags": ["Utility", "BoxUV", "Format: Generic Model"], "version": "1.1.0", "min_version": "4.2.0", "variant": "both" @@ -1023,10 +864,7 @@ "author": "oectway", "description": "Tool that allows you to mirror the arms and legs of existing skins to the other side.", "about": "This plugin adds a button under the `Tools` menu that allows you to mirror the arms and legs of existing skins to the other side. Select the type of the skin: Alek (3 Pixel Arm, customSlim) or Steve (4 Pixel Arm, custom). Next, choose whether you want to mirror from left to right, or the other way around. If everything is correct, click \"Confirm\".", - "tags": [ - "Minecraft", - "Skins" - ], + "tags": ["Minecraft", "Skins"], "version": "1.1.0", "min_version": "4.6.0", "variant": "both" @@ -1036,10 +874,7 @@ "author": "Gaming32", "description": "Converts Blockbench animations to the json format for the Json Entity Animation mod", "icon": "fa-cube", - "tags": [ - "Animation", - "Minecraft: Java Edition" - ], + "tags": ["Animation", "Minecraft: Java Edition"], "variant": "both", "version": "1.0.0" }, @@ -1048,9 +883,7 @@ "author": "AzureDoom, Eliot Lash, Gecko, McHorse", "icon": "azureicon.png", "description": "Create animated blocks, items, entity, and armor using the AzureLib library and plugin. This is a fork of Geckolib and cross compatibility will not be promised in the future.", - "tags": [ - "Minecraft: Java Edition" - ], + "tags": ["Minecraft: Java Edition"], "version": "1.0.9", "min_version": "4.8.0", "new_repository_format": true, @@ -1058,9 +891,7 @@ "variant": "both", "creation_date": "2023-04-04", "contributes": { - "formats": [ - "azure_model" - ] + "formats": ["azure_model"] }, "has_changelog": true, "website": "https://wiki.azuredoom.com/readme-1" @@ -1070,9 +901,7 @@ "author": "SirJain", "icon": "swap_horiz", "description": "Adds a button that inverts selected cube sizes.", - "tags": [ - "Deprecated" - ], + "tags": ["Deprecated"], "about": "This plugin adds a button that inverts the size values of each selected cube.\n## How to use\nTo use this plugin, go to the toolbar at the top of the screen (the one with the move, resize, and rotation tools) and click the `Invert Cubes` button. If you don't see the button, make sure to select some cubes. The button is also keybinded with a default of `Shift + I`.\n\nPlease report any bugs or suggestions you may have.", "version": "1.0.0", "min_version": "4.2.0", @@ -1083,10 +912,7 @@ "author": "Katt (KitCat962)", "icon": "icon.svg", "description": "Create models for the Figura mod in a custom format that optimizes Blockbench to work with Figura models.", - "tags": [ - "Minecraft: Java Edition", - "Figura" - ], + "tags": ["Minecraft: Java Edition", "Figura"], "version": "0.1.3", "min_version": "4.8.0", "variant": "both", @@ -1098,9 +924,7 @@ "author": "JannisX11", "icon": "icon.png", "description": "The rainbow road racing minigame from April fools day 2024! Turn your model into a race car and take it for a spin!", - "tags": [ - "Minigame" - ], + "tags": ["Minigame"], "version": "0.1.1", "min_version": "4.8.0", "variant": "both", @@ -1111,9 +935,7 @@ "author": "Z. Hoeshin", "icon": "icon.png", "description": "Allows creating, editing, importing and exporting Cosmic Reach block models.", - "tags": [ - "Cosmic Reach" - ], + "tags": ["Cosmic Reach"], "version": "1.3.0", "min_version": "4.8.0", "variant": "both", @@ -1126,17 +948,11 @@ "author": "Traben & Ewan Howell", "icon": "icon.png", "description": "Adds extra animation support to CEM Template Loader so that it is compatible with the Entity Model Features mod.", - "tags": [ - "Minecraft: Java Edition", - "Entity Models", - "Animation" - ], + "tags": ["Minecraft: Java Edition", "Entity Models", "Animation"], "version": "1.0.2", "min_version": "4.9.0", "variant": "both", - "dependencies": [ - "cem_template_loader" - ], + "dependencies": ["cem_template_loader"], "creation_date": "2024-06-05", "has_changelog": true }, diff --git a/src/pbr_preview/.vscode/settings.json b/src/pbr_preview/.vscode/settings.json deleted file mode 100644 index 89d1965f..00000000 --- a/src/pbr_preview/.vscode/settings.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode" -} \ No newline at end of file From 01c1f02eee482cbedf0f3480ce56b5e626cb439b Mon Sep 17 00:00:00 2001 From: Caio Raphael Date: Sun, 14 Jul 2024 12:57:44 -0300 Subject: [PATCH 36/50] [AWSD Controls] Option to only work when holding RightMouse --- plugins/wasd_controls.js | 106 ++++++++++++++++++++++++--------------- 1 file changed, 66 insertions(+), 40 deletions(-) diff --git a/plugins/wasd_controls.js b/plugins/wasd_controls.js index 0604ab4c..c96ee046 100644 --- a/plugins/wasd_controls.js +++ b/plugins/wasd_controls.js @@ -3,6 +3,7 @@ let deletables = []; let old_animate; +let rightMouseDown = false; BBPlugin.register('wasd_controls', { title: 'WASD Controls', @@ -15,41 +16,41 @@ BBPlugin.register('wasd_controls', { variant: 'both', onload() { let navigate_forward = new KeybindItem('navigate_forward', { - name: 'Move Forward', - icon: 'arrow_upward', - category: 'navigate', + name: 'Move Forward', + icon: 'arrow_upward', + category: 'navigate', keybind: new Keybind({key: 'w', ctrl: null}) - }) + }); let navigate_backward = new KeybindItem('navigate_backward', { - name: 'Move Backward', - icon: 'arrow_upward', - category: 'navigate', + name: 'Move Backward', + icon: 'arrow_upward', + category: 'navigate', keybind: new Keybind({key: 's', ctrl: null}) - }) + }); let navigate_left = new KeybindItem('navigate_left', { - name: 'Move Left', - icon: 'arrow_upward', - category: 'navigate', + name: 'Move Left', + icon: 'arrow_upward', + category: 'navigate', keybind: new Keybind({key: 'a', ctrl: null}) - }) + }); let navigate_right = new KeybindItem('navigate_right', { - name: 'Move Right', - icon: 'arrow_upward', - category: 'navigate', + name: 'Move Right', + icon: 'arrow_upward', + category: 'navigate', keybind: new Keybind({key: 'd', ctrl: null}) - }) + }); let navigate_down = new KeybindItem('navigate_down', { - name: 'Move Down', - icon: 'arrow_upward', - category: 'navigate', + name: 'Move Down', + icon: 'arrow_upward', + category: 'navigate', keybind: new Keybind({key: 16, ctrl: null}) - }) + }); let navigate_up = new KeybindItem('navigate_up', { - name: 'Move Up', - icon: 'arrow_upward', - category: 'navigate', + name: 'Move Up', + icon: 'arrow_upward', + category: 'navigate', keybind: new Keybind({key: 32, ctrl: null}) - }) + }); let navigation_keybinds = [navigate_forward, navigate_backward, navigate_left, navigate_right, navigate_down, navigate_up]; deletables.push(...navigation_keybinds); @@ -62,20 +63,26 @@ BBPlugin.register('wasd_controls', { } let wasd_toggle = new Toggle('wasd_movement', { - name: 'WASD Movement', - icon: 'sports_esports', - category: 'navigate', + name: 'WASD Movement', + icon: 'sports_esports', + category: 'navigate', value: false, onChange(value) { setupWASDMovement(Preview.selected, value ? 1 : 16); Preview.all.forEach(preview => { preview.controls.enableZoom = !value; - }) + }); } - }) + }); + function isWASDMovementEnabled() { - return Preview.selected && BarItems.wasd_movement && BarItems.wasd_movement.value; + if (settings.requires_hold_right_mouse.value) { + return Preview.selected && BarItems.wasd_movement && BarItems.wasd_movement.value && rightMouseDown; + } else { + return Preview.selected && BarItems.wasd_movement && BarItems.wasd_movement.value + } } + deletables.push(wasd_toggle); MenuBar.menus.view.addAction('_'); MenuBar.menus.view.addAction(wasd_toggle); @@ -86,14 +93,21 @@ BBPlugin.register('wasd_controls', { type: 'number', value: 100, min: 1 - })) + })); deletables.push(new Setting('wasd_y_level', { name: 'WASD Navigation at Y Level', description: 'Navigate using WASD at consistent Y level rather than on camera plane', category: 'preview', value: true - })) + })); + + deletables.push(new Setting('requires_hold_right_mouse', { + name: 'Only works when holding the right mouse button', + description: 'The WASD Controls neeeds to be enabled for this to work.', + category: 'preview', + value: true + })); let pressed_keys = []; Blockbench.on('press_key', data => { @@ -104,13 +118,25 @@ BBPlugin.register('wasd_controls', { data.capture(); } } - }) + }); + document.addEventListener('keyup', event => { pressed_keys.remove(event.which); - }) + }); - function doWASDMovement() { + document.addEventListener('mousedown', event => { + if (event.button === 2) { // Right mouse button + rightMouseDown = true; + } + }); + + document.addEventListener('mouseup', event => { + if (event.button === 2) { // Right mouse button + rightMouseDown = false; + } + }); + function doWASDMovement() { let movement = new THREE.Vector3(0, 0, 0); let uses_wasd_movement = false; function add(x, y, z) { @@ -149,21 +175,21 @@ BBPlugin.register('wasd_controls', { if (isWASDMovementEnabled() && pressed_keys.length) { doWASDMovement(); } - } + }; }, oninstall() { - MenuBar.menus.view.highlight(BarItems.wasd_movement) + MenuBar.menus.view.highlight(BarItems.wasd_movement); }, onunload() { deletables.forEach(action => { action.delete(); - }) + }); setupWASDMovement(Preview.selected, 16); Preview.all.forEach(preview => { preview.controls.enableZoom = true; - }) + }); window.animate = old_animate; } }); -})() +})(); From ff4129179ca03a3863560f0cfe207d861bfb11ec Mon Sep 17 00:00:00 2001 From: Caio Raphael Date: Sun, 14 Jul 2024 12:59:41 -0300 Subject: [PATCH 37/50] [WASD Controls] Update the metadata I forgot, oops. --- plugins/wasd_controls.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/wasd_controls.js b/plugins/wasd_controls.js index c96ee046..f50b7f77 100644 --- a/plugins/wasd_controls.js +++ b/plugins/wasd_controls.js @@ -11,7 +11,7 @@ BBPlugin.register('wasd_controls', { author: 'JannisX11', description: 'Adds a WASD controlled viewport navigation mode', about: 'The WASD mode can be enabled from the View menu.\nThe keys can be remapped in the keybindings menu.\nThe sensitivity can be changed in the settings under Preview, along with the movement plane.\nHold Control to move faster.', - version: '1.1.0', + version: '1.2.0', min_version: '4.3.0', variant: 'both', onload() { From ead8d22fdf8cc23df3d8f60f3c8291108ecd11a5 Mon Sep 17 00:00:00 2001 From: Caio Raphael Date: Sun, 14 Jul 2024 13:07:14 -0300 Subject: [PATCH 38/50] [WASD Controls] typo ;/ --- plugins/wasd_controls.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/wasd_controls.js b/plugins/wasd_controls.js index f50b7f77..162b9bce 100644 --- a/plugins/wasd_controls.js +++ b/plugins/wasd_controls.js @@ -104,7 +104,7 @@ BBPlugin.register('wasd_controls', { deletables.push(new Setting('requires_hold_right_mouse', { name: 'Only works when holding the right mouse button', - description: 'The WASD Controls neeeds to be enabled for this to work.', + description: 'The WASD Controls needs to be enabled for this to work.', category: 'preview', value: true })); From de9d1a54cda8af8450aea7a1a35f70a5cd2f7e0b Mon Sep 17 00:00:00 2001 From: Caio Raphael Date: Mon, 15 Jul 2024 16:16:38 -0300 Subject: [PATCH 39/50] 3 changes requested -> metadata in plugin.json -> improved name for 'requires_hold_right_mouse' setting -> set the 'requires_hold_right_mouse' to be false by default --- plugins.json | 2 +- plugins/wasd_controls.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins.json b/plugins.json index 9b9c554b..a2739c94 100644 --- a/plugins.json +++ b/plugins.json @@ -631,7 +631,7 @@ "author": "JannisX11", "description": "Adds a WASD controlled viewport navigation mode", "about": "The WASD mode can be enabled from the View menu.\nThe keys can be remapped in the keybindings menu.\nThe sensitivity can be changed in the settings under Preview, along with the movement plane.\nHold Control to move faster.", - "version": "1.1.0", + "version": "1.2.0", "min_version": "4.3.0", "variant": "both" }, diff --git a/plugins/wasd_controls.js b/plugins/wasd_controls.js index 162b9bce..944a6e83 100644 --- a/plugins/wasd_controls.js +++ b/plugins/wasd_controls.js @@ -76,7 +76,7 @@ BBPlugin.register('wasd_controls', { }); function isWASDMovementEnabled() { - if (settings.requires_hold_right_mouse.value) { + if (settings.wasd_requires_hold_right_mouse.value) { return Preview.selected && BarItems.wasd_movement && BarItems.wasd_movement.value && rightMouseDown; } else { return Preview.selected && BarItems.wasd_movement && BarItems.wasd_movement.value @@ -102,11 +102,11 @@ BBPlugin.register('wasd_controls', { value: true })); - deletables.push(new Setting('requires_hold_right_mouse', { + deletables.push(new Setting('wasd_requires_hold_right_mouse', { name: 'Only works when holding the right mouse button', description: 'The WASD Controls needs to be enabled for this to work.', category: 'preview', - value: true + value: false })); let pressed_keys = []; From a83c79ec2737a908aa170f2314418966636d033d Mon Sep 17 00:00:00 2001 From: Caio Raphael Date: Tue, 16 Jul 2024 14:58:41 -0300 Subject: [PATCH 40/50] zoom fix; new buttons to move faster and slower; name fix; --- plugins/wasd_controls.js | 80 ++++++++++++++++++++++++++++++---------- 1 file changed, 60 insertions(+), 20 deletions(-) diff --git a/plugins/wasd_controls.js b/plugins/wasd_controls.js index 944a6e83..0ac339f4 100644 --- a/plugins/wasd_controls.js +++ b/plugins/wasd_controls.js @@ -1,7 +1,5 @@ (function() { - let deletables = []; - let old_animate; let rightMouseDown = false; @@ -23,43 +21,56 @@ BBPlugin.register('wasd_controls', { }); let navigate_backward = new KeybindItem('navigate_backward', { name: 'Move Backward', - icon: 'arrow_upward', + icon: 'arrow_downward', category: 'navigate', keybind: new Keybind({key: 's', ctrl: null}) }); let navigate_left = new KeybindItem('navigate_left', { name: 'Move Left', - icon: 'arrow_upward', + icon: 'arrow_back', category: 'navigate', keybind: new Keybind({key: 'a', ctrl: null}) }); let navigate_right = new KeybindItem('navigate_right', { name: 'Move Right', - icon: 'arrow_upward', + icon: 'arrow_forward', category: 'navigate', keybind: new Keybind({key: 'd', ctrl: null}) }); let navigate_down = new KeybindItem('navigate_down', { name: 'Move Down', - icon: 'arrow_upward', + icon: 'expand_more', category: 'navigate', keybind: new Keybind({key: 16, ctrl: null}) }); let navigate_up = new KeybindItem('navigate_up', { name: 'Move Up', - icon: 'arrow_upward', + icon: 'expand_less', category: 'navigate', keybind: new Keybind({key: 32, ctrl: null}) }); - let navigation_keybinds = [navigate_forward, navigate_backward, navigate_left, navigate_right, navigate_down, navigate_up]; + + let navigate_faster = new KeybindItem('navigate_faster', { + name: 'Move Faster', + icon: 'expand_less', + category: 'navigate', + keybind: new Keybind({key: 16, ctrl: null}) + }); + let navigate_slower = new KeybindItem('navigate_slower', { + name: 'Move Slower', + icon: 'expand_less', + category: 'navigate', + keybind: new Keybind({key: 18, ctrl: null}) + }); + + + let navigation_keybinds = [navigate_forward, navigate_backward, navigate_left, navigate_right, navigate_down, navigate_up, navigate_faster, navigate_slower]; deletables.push(...navigation_keybinds); function setupWASDMovement(preview, length = 1) { let pos = new THREE.Vector3().copy(preview.camera.position); pos.add(preview.camera.getWorldDirection(new THREE.Vector3()).normalize().multiplyScalar(length)); preview.controls.target.copy(pos); - - preview.controls.enable_zoom = false; } let wasd_toggle = new Toggle('wasd_movement', { @@ -69,9 +80,6 @@ BBPlugin.register('wasd_controls', { value: false, onChange(value) { setupWASDMovement(Preview.selected, value ? 1 : 16); - Preview.all.forEach(preview => { - preview.controls.enableZoom = !value; - }); } }); @@ -87,23 +95,41 @@ BBPlugin.register('wasd_controls', { MenuBar.menus.view.addAction('_'); MenuBar.menus.view.addAction(wasd_toggle); - deletables.push(new Setting('wasd_sensitivity', { - name: 'WASD Sensitivity', + deletables.push(new Setting('base_speed', { + name: 'WASD Controls: Base Speed', category: 'preview', type: 'number', - value: 100, + value: 50, min: 1 })); + deletables.push(new Setting('move_faster_mult', { + name: 'WASD Controls: Move Faster Multiplier', + category: 'preview', + type: 'number', + value: 2, + max: 10, + min: 1 + })); + + deletables.push(new Setting('move_slower_mult', { + name: 'WASD Controls: Move Slower Multiplier', + category: 'preview', + type: 'number', + value: 0.5, + max: 1, + min: 0.1 + })); + deletables.push(new Setting('wasd_y_level', { - name: 'WASD Navigation at Y Level', + name: 'WASD Controls: Navigate at Y Level', description: 'Navigate using WASD at consistent Y level rather than on camera plane', category: 'preview', value: true })); deletables.push(new Setting('wasd_requires_hold_right_mouse', { - name: 'Only works when holding the right mouse button', + name: 'WASD Controls: Navigation only works when holding the right mouse button', description: 'The WASD Controls needs to be enabled for this to work.', category: 'preview', value: false @@ -138,6 +164,7 @@ BBPlugin.register('wasd_controls', { function doWASDMovement() { let movement = new THREE.Vector3(0, 0, 0); + let uses_wasd_movement = false; function add(x, y, z) { movement.x += x; @@ -145,6 +172,7 @@ BBPlugin.register('wasd_controls', { movement.z += z; uses_wasd_movement = true; } + if (pressed_keys.includes(navigate_forward.keybind.key)) add(0, 0, -1); if (pressed_keys.includes(navigate_backward.keybind.key)) add(0, 0, 1); if (pressed_keys.includes(navigate_left.keybind.key)) add(-1, 0, 0); @@ -152,8 +180,14 @@ BBPlugin.register('wasd_controls', { if (pressed_keys.includes(navigate_down.keybind.key)) add(0, -1, 0); if (pressed_keys.includes(navigate_up.keybind.key)) add(0, 1, 0); + if (uses_wasd_movement) { setupWASDMovement(Preview.selected); + + let speedMultiplier = 1.0; // Default speed + + if (pressed_keys.includes(navigate_faster.keybind.key)) speedMultiplier *= settings.move_faster_mult.value; + else if (pressed_keys.includes(navigate_slower.keybind.key)) speedMultiplier *= settings.move_slower_mult.value; if (settings.wasd_y_level.value) { let vec = Preview.selected.controls.object.getWorldDirection(new THREE.Vector3()).normalize(); @@ -162,7 +196,9 @@ BBPlugin.register('wasd_controls', { } else { movement.applyEuler(Preview.selected.controls.object.rotation); } - movement.multiplyScalar(Settings.get('wasd_sensitivity') * (Pressing.ctrl || Pressing.overrides.ctrl ? 2.4 : 1) / 100); + + console.log(movement, Settings.get('base_speed'), speedMultiplier, Settings.get('base_speed') * speedMultiplier / 100) + movement.multiplyScalar(Settings.get('base_speed') * speedMultiplier / 100); Preview.selected.camera.position.add(movement); Preview.selected.controls.target.add(movement); } @@ -175,6 +211,11 @@ BBPlugin.register('wasd_controls', { if (isWASDMovementEnabled() && pressed_keys.length) { doWASDMovement(); } + + // Ensure zoom is disabled when moving + Preview.all.forEach(preview => { + preview.controls.enableZoom = !isWASDMovementEnabled(); + }); }; }, oninstall() { @@ -191,5 +232,4 @@ BBPlugin.register('wasd_controls', { window.animate = old_animate; } }); - })(); From 57ca628f31d719a7044a737490f8b2dd7fb3d845 Mon Sep 17 00:00:00 2001 From: Caio Raphael Date: Thu, 18 Jul 2024 01:21:51 -0300 Subject: [PATCH 41/50] properly saves the state of the tool 'WASD Toggle' when restarting the app I don't know if the best idea, but I created a setting to save the tool state. --- plugins/wasd_controls.js | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/plugins/wasd_controls.js b/plugins/wasd_controls.js index 0ac339f4..87ce65f7 100644 --- a/plugins/wasd_controls.js +++ b/plugins/wasd_controls.js @@ -73,16 +73,36 @@ BBPlugin.register('wasd_controls', { preview.controls.target.copy(pos); } + deletables.push(new Setting('wasd_enabled', { + name: 'WASD Controls: Enabled', + description: '_', + category: 'preview', + value: false, + onChange(value) { + BarItems.wasd_movement.value = value + BarItems.wasd_movement.updateEnabledState(); + setupWASDMovement(Preview.selected, value ? 1 : 16); + } + })); + let wasd_toggle = new Toggle('wasd_movement', { name: 'WASD Movement', icon: 'sports_esports', category: 'navigate', value: false, onChange(value) { + settings.wasd_enabled.value = value + Settings.saveLocalStorages(); setupWASDMovement(Preview.selected, value ? 1 : 16); } }); + deletables.push(wasd_toggle); + MenuBar.menus.view.addAction('_'); + MenuBar.menus.view.addAction(wasd_toggle); + BarItems.wasd_movement.value = settings.wasd_enabled.value + BarItems.wasd_movement.updateEnabledState(); + function isWASDMovementEnabled() { if (settings.wasd_requires_hold_right_mouse.value) { return Preview.selected && BarItems.wasd_movement && BarItems.wasd_movement.value && rightMouseDown; @@ -91,12 +111,9 @@ BBPlugin.register('wasd_controls', { } } - deletables.push(wasd_toggle); - MenuBar.menus.view.addAction('_'); - MenuBar.menus.view.addAction(wasd_toggle); - deletables.push(new Setting('base_speed', { name: 'WASD Controls: Base Speed', + description: '-', category: 'preview', type: 'number', value: 50, @@ -105,6 +122,7 @@ BBPlugin.register('wasd_controls', { deletables.push(new Setting('move_faster_mult', { name: 'WASD Controls: Move Faster Multiplier', + description: '-', category: 'preview', type: 'number', value: 2, @@ -114,6 +132,7 @@ BBPlugin.register('wasd_controls', { deletables.push(new Setting('move_slower_mult', { name: 'WASD Controls: Move Slower Multiplier', + description: '-', category: 'preview', type: 'number', value: 0.5, @@ -197,7 +216,6 @@ BBPlugin.register('wasd_controls', { movement.applyEuler(Preview.selected.controls.object.rotation); } - console.log(movement, Settings.get('base_speed'), speedMultiplier, Settings.get('base_speed') * speedMultiplier / 100) movement.multiplyScalar(Settings.get('base_speed') * speedMultiplier / 100); Preview.selected.camera.position.add(movement); Preview.selected.controls.target.add(movement); From 0ffb3cea8d0a1fec323fec0d5fdfad91824de9ff Mon Sep 17 00:00:00 2001 From: Ewan Howell <48070995+ewanhowell5195@users.noreply.github.com> Date: Thu, 15 Aug 2024 20:27:58 +0100 Subject: [PATCH 42/50] 1.21.2 light_emission fix --- plugins.json | 2 +- plugins/resource_pack_utilities/changelog.json | 13 +++++++++++++ .../resource_pack_utilities.js | 5 +++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/plugins.json b/plugins.json index 8d29d0ea..c4410eeb 100644 --- a/plugins.json +++ b/plugins.json @@ -365,7 +365,7 @@ "author": "Ewan Howell", "description": "A collection of utilities to assist with resource pack creation.", "tags": ["Minecraft: Java Edition", "Resource Packs", "Utilities"], - "version": "1.4.0", + "version": "1.5.0", "min_version": "4.10.0", "variant": "desktop", "website": "https://ewanhowell.com/plugins/resource-pack-utilities/", diff --git a/plugins/resource_pack_utilities/changelog.json b/plugins/resource_pack_utilities/changelog.json index 58664999..722b1754 100644 --- a/plugins/resource_pack_utilities/changelog.json +++ b/plugins/resource_pack_utilities/changelog.json @@ -98,5 +98,18 @@ ] } ] + }, + "1.5.0": { + "title": "1.5.0", + "date": "2024-08-16", + "author": "Ewan Howell", + "categories": [ + { + "title": "Changes", + "list": [ + "Added support for the 1.21.2 \"light_emission\" property of block models to JSON Optimiser" + ] + } + ] } } \ No newline at end of file diff --git a/plugins/resource_pack_utilities/resource_pack_utilities.js b/plugins/resource_pack_utilities/resource_pack_utilities.js index 16f7942e..deed25ba 100644 --- a/plugins/resource_pack_utilities/resource_pack_utilities.js +++ b/plugins/resource_pack_utilities/resource_pack_utilities.js @@ -29,7 +29,7 @@ author: "Ewan Howell", description, tags: ["Minecraft: Java Edition", "Resource Packs", "Utilities"], - version: "1.4.0", + version: "1.5.0", min_version: "4.10.0", variant: "desktop", website: `https://ewanhowell.com/plugins/${id.replace(/_/g, "-")}/`, @@ -2187,7 +2187,7 @@ const partKeys = [ "id", "texture", "textureSize", "invertAxis", "translate", "rotate", "mirrorTexture", "boxes", "sprites", "submodel", "submodels" ] const boxKeys = [ "textureOffset", "uvDown", "uvUp", "uvNorth", "uvSouth", "uvWest", "uvEast", "coordinates", "sizeAdd" ] const spriteKeys = [ "textureOffset", "coordinates", "sizeAdd" ] - const elementKeys = [ "from", "to", "rotation", "faces", "shade" ] + const elementKeys = [ "from", "to", "rotation", "faces", "shade", "light_emission" ] const faceKeys = [ "uv", "texture", "cullface", "rotation", "tintindex" ] modelKeys.push(...partKeys) @@ -2285,6 +2285,7 @@ } } if (element.shade) delete element.shade + if (element.light_emission === 0) delete element.light_emission } data.elements = data.elements.filter(e => e.faces && Object.keys(e.faces).length) } From ed0180549036ec44329b5de1481641d139f15d32 Mon Sep 17 00:00:00 2001 From: Ewan Howell <48070995+ewanhowell5195@users.noreply.github.com> Date: Thu, 15 Aug 2024 20:44:06 +0100 Subject: [PATCH 43/50] Update resource_pack_utilities.js --- plugins/resource_pack_utilities/resource_pack_utilities.js | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/resource_pack_utilities/resource_pack_utilities.js b/plugins/resource_pack_utilities/resource_pack_utilities.js index deed25ba..acfa78cc 100644 --- a/plugins/resource_pack_utilities/resource_pack_utilities.js +++ b/plugins/resource_pack_utilities/resource_pack_utilities.js @@ -2112,6 +2112,7 @@
      • Removes the shade property when it is set to true
      • +
      • Removes the light_emission property when it is set to 0
      • Removes empty elements arrays
      From c1bb4ff40deb395433788aaef81f63b3ae3c9ad9 Mon Sep 17 00:00:00 2001 From: Ewan Howell <48070995+ewanhowell5195@users.noreply.github.com> Date: Thu, 15 Aug 2024 20:54:40 +0100 Subject: [PATCH 44/50] Update resource_pack_utilities.js --- plugins/resource_pack_utilities/resource_pack_utilities.js | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/resource_pack_utilities/resource_pack_utilities.js b/plugins/resource_pack_utilities/resource_pack_utilities.js index acfa78cc..79282956 100644 --- a/plugins/resource_pack_utilities/resource_pack_utilities.js +++ b/plugins/resource_pack_utilities/resource_pack_utilities.js @@ -2433,7 +2433,6 @@
      • Removes the type=item property
      • Replaces matchItems with items
      • -
      • Removes the type=item property
      • Removes the minecraft: prefix
      • Removes blank lines
      From caa274dc3558b77363c8d3907ecf0ba5c2cd5c74 Mon Sep 17 00:00:00 2001 From: Ewan Howell <48070995+ewanhowell5195@users.noreply.github.com> Date: Fri, 16 Aug 2024 16:11:21 +0100 Subject: [PATCH 45/50] json optimiser minecraft: prefixes --- plugins/resource_pack_utilities/changelog.json | 6 ++++++ .../resource_pack_utilities.js | 12 ++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/plugins/resource_pack_utilities/changelog.json b/plugins/resource_pack_utilities/changelog.json index 722b1754..2eeae7b4 100644 --- a/plugins/resource_pack_utilities/changelog.json +++ b/plugins/resource_pack_utilities/changelog.json @@ -104,6 +104,12 @@ "date": "2024-08-16", "author": "Ewan Howell", "categories": [ + { + "title": "New Features", + "list": [ + "JSON Optimiser now has an option to remove \"minecraft:\" prefixes" + ] + }, { "title": "Changes", "list": [ diff --git a/plugins/resource_pack_utilities/resource_pack_utilities.js b/plugins/resource_pack_utilities/resource_pack_utilities.js index 79282956..2091a80e 100644 --- a/plugins/resource_pack_utilities/resource_pack_utilities.js +++ b/plugins/resource_pack_utilities/resource_pack_utilities.js @@ -2095,6 +2095,7 @@
    • Minifies .json, .mcmeta, .jem, and .jpm files
    • Removes default credits. Custom credits are kept
    • Removes unnecessary keys
    • +
    • Removes minecraft: prefixes
    • For block/item model .json files
      • Removes the groups object
      • @@ -2155,6 +2156,7 @@ jem: true, jpm: true }, + prefixes: true, minify: true, ignoreList: [], outputLog, @@ -2382,11 +2384,16 @@ if (this.types.jpm && file.endsWith(".jpm")) { processPart(data) } + let output if (this.minify) { - await fs.promises.writeFile(file, JSON.stringify(data), "utf-8") + output = JSON.stringify(data) } else { - await fs.promises.writeFile(file, compileJSON(data, { indentation: " " }), "utf-8") + output = compileJSON(data, { indentation: " " }) } + if (this.prefixes) { + output = output.replace(/(?Optimise .mcmeta files Optimise .jem files Optimise .jpm files + Remove minecraft: prefixes Minify output
    • From abd40a902b58e99083fa7f998e9f930c630ec2d3 Mon Sep 17 00:00:00 2001 From: Ewan Howell <48070995+ewanhowell5195@users.noreply.github.com> Date: Fri, 16 Aug 2024 16:14:17 +0100 Subject: [PATCH 46/50] Update resource_pack_utilities.js --- .../resource_pack_utilities/resource_pack_utilities.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/resource_pack_utilities/resource_pack_utilities.js b/plugins/resource_pack_utilities/resource_pack_utilities.js index 2091a80e..19aed0bc 100644 --- a/plugins/resource_pack_utilities/resource_pack_utilities.js +++ b/plugins/resource_pack_utilities/resource_pack_utilities.js @@ -2384,16 +2384,16 @@ if (this.types.jpm && file.endsWith(".jpm")) { processPart(data) } - let output + let out if (this.minify) { - output = JSON.stringify(data) + out = JSON.stringify(data) } else { - output = compileJSON(data, { indentation: " " }) + out = compileJSON(data, { indentation: " " }) } if (this.prefixes) { - output = output.replace(/(? Date: Wed, 21 Aug 2024 17:15:00 -0400 Subject: [PATCH 47/50] Update Animated Java to 1.4.0 --- plugins.json | 2 +- plugins/animated_java/animated_java.js | 441 +++++++++++++------------ 2 files changed, 226 insertions(+), 217 deletions(-) diff --git a/plugins.json b/plugins.json index 8d29d0ea..7f8ed0d0 100644 --- a/plugins.json +++ b/plugins.json @@ -14,7 +14,7 @@ "author": "Titus Evans (SnaveSutit)", "icon": "icon.svg", "description": "A Blockbench plugin that makes complex animation a breeze in Minecraft: Java Edition.", - "version": "1.3.0", + "version": "1.4.0", "min_version": "4.10.0", "variant": "desktop", "tags": ["Minecraft: Java Edition", "Animation", "Display Entities"], diff --git a/plugins/animated_java/animated_java.js b/plugins/animated_java/animated_java.js index f8c6b801..f114a795 100644 --- a/plugins/animated_java/animated_java.js +++ b/plugins/animated_java/animated_java.js @@ -4,7 +4,7 @@ //?? │ |__| |\ | | |\/| |__| | |___ | \ | |__| | | |__| │ //?? │ | | | \| | | | | | | |___ |__/ _| | | \/ | | │ //?? │ │ -//?? │ v1.3.0 │ +//?? │ v1.4.0 │ //?? │ │ //?? │ A Blockbench plugin that makes complex animation a breeze in Minecraft: Java Edition. │ //?? │ │ @@ -713,131 +713,122 @@ //?? │ │ //?? ╰───────────────────────────────────────────────────────────────────────────────────────╯ -"use strict";(()=>{var iw=Object.create;var Es=Object.defineProperty;var rw=Object.getOwnPropertyDescriptor;var aw=Object.getOwnPropertyNames;var ow=Object.getPrototypeOf,sw=Object.prototype.hasOwnProperty;var lw=(n,e,t)=>e in n?Es(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var s=(n,e)=>Es(n,"name",{value:e,configurable:!0}),rn=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+n+'" is not supported')});var gr=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),vn=(n,e)=>{for(var t in e)Es(n,t,{get:e[t],enumerable:!0})},cw=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of aw(e))!sw.call(n,r)&&r!==t&&Es(n,r,{get:()=>e[r],enumerable:!(i=rw(e,r))||i.enumerable});return n};var ui=(n,e,t)=>(t=n!=null?iw(ow(n)):{},cw(e||!n||!n.__esModule?Es(t,"default",{value:n,enumerable:!0}):t,n));var ht=(n,e,t)=>(lw(n,typeof e!="symbol"?e+"":e,t),t);var uw=n=>new Uint8Array(Buffer.from(n,"base64"));var Av=gr((boe,Cv)=>{"use strict";Cv.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Wm=gr((voe,jv)=>{var Ul=Av(),Sv={};for(let n of Object.keys(Ul))Sv[Ul[n]]=n;var He={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};jv.exports=He;for(let n of Object.keys(He)){if(!("channels"in He[n]))throw new Error("missing channels property: "+n);if(!("labels"in He[n]))throw new Error("missing channel labels property: "+n);if(He[n].labels.length!==He[n].channels)throw new Error("channel and label counts mismatch: "+n);let{channels:e,labels:t}=He[n];delete He[n].channels,delete He[n].labels,Object.defineProperty(He[n],"channels",{value:e}),Object.defineProperty(He[n],"labels",{value:t})}He.rgb.hsl=function(n){let e=n[0]/255,t=n[1]/255,i=n[2]/255,r=Math.min(e,t,i),a=Math.max(e,t,i),o=a-r,l,c;a===r?l=0:e===a?l=(t-i)/o:t===a?l=2+(i-e)/o:i===a&&(l=4+(e-t)/o),l=Math.min(l*60,360),l<0&&(l+=360);let u=(r+a)/2;return a===r?c=0:u<=.5?c=o/(a+r):c=o/(2-a-r),[l,c*100,u*100]};He.rgb.hsv=function(n){let e,t,i,r,a,o=n[0]/255,l=n[1]/255,c=n[2]/255,u=Math.max(o,l,c),d=u-Math.min(o,l,c),m=s(function(p){return(u-p)/6/d+1/2},"diffc");return d===0?(r=0,a=0):(a=d/u,e=m(o),t=m(l),i=m(c),o===u?r=i-t:l===u?r=1/3+e-i:c===u&&(r=2/3+t-e),r<0?r+=1:r>1&&(r-=1)),[r*360,a*100,u*100]};He.rgb.hwb=function(n){let e=n[0],t=n[1],i=n[2],r=He.rgb.hsl(n)[0],a=1/255*Math.min(e,Math.min(t,i));return i=1-1/255*Math.max(e,Math.max(t,i)),[r,a*100,i*100]};He.rgb.cmyk=function(n){let e=n[0]/255,t=n[1]/255,i=n[2]/255,r=Math.min(1-e,1-t,1-i),a=(1-e-r)/(1-r)||0,o=(1-t-r)/(1-r)||0,l=(1-i-r)/(1-r)||0;return[a*100,o*100,l*100,r*100]};function u9(n,e){return(n[0]-e[0])**2+(n[1]-e[1])**2+(n[2]-e[2])**2}s(u9,"comparativeDistance");He.rgb.keyword=function(n){let e=Sv[n];if(e)return e;let t=1/0,i;for(let r of Object.keys(Ul)){let a=Ul[r],o=u9(n,a);o.04045?((e+.055)/1.055)**2.4:e/12.92,t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92;let r=e*.4124+t*.3576+i*.1805,a=e*.2126+t*.7152+i*.0722,o=e*.0193+t*.1192+i*.9505;return[r*100,a*100,o*100]};He.rgb.lab=function(n){let e=He.rgb.xyz(n),t=e[0],i=e[1],r=e[2];t/=95.047,i/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;let a=116*i-16,o=500*(t-i),l=200*(i-r);return[a,o,l]};He.hsl.rgb=function(n){let e=n[0]/360,t=n[1]/100,i=n[2]/100,r,a,o;if(t===0)return o=i*255,[o,o,o];i<.5?r=i*(1+t):r=i+t-i*t;let l=2*i-r,c=[0,0,0];for(let u=0;u<3;u++)a=e+1/3*-(u-1),a<0&&a++,a>1&&a--,6*a<1?o=l+(r-l)*6*a:2*a<1?o=r:3*a<2?o=l+(r-l)*(2/3-a)*6:o=l,c[u]=o*255;return c};He.hsl.hsv=function(n){let e=n[0],t=n[1]/100,i=n[2]/100,r=t,a=Math.max(i,.01);i*=2,t*=i<=1?i:2-i,r*=a<=1?a:2-a;let o=(i+t)/2,l=i===0?2*r/(a+r):2*t/(i+t);return[e,l*100,o*100]};He.hsv.rgb=function(n){let e=n[0]/60,t=n[1]/100,i=n[2]/100,r=Math.floor(e)%6,a=e-Math.floor(e),o=255*i*(1-t),l=255*i*(1-t*a),c=255*i*(1-t*(1-a));switch(i*=255,r){case 0:return[i,c,o];case 1:return[l,i,o];case 2:return[o,i,c];case 3:return[o,l,i];case 4:return[c,o,i];case 5:return[i,o,l]}};He.hsv.hsl=function(n){let e=n[0],t=n[1]/100,i=n[2]/100,r=Math.max(i,.01),a,o;o=(2-t)*i;let l=(2-t)*r;return a=t*r,a/=l<=1?l:2-l,a=a||0,o/=2,[e,a*100,o*100]};He.hwb.rgb=function(n){let e=n[0]/360,t=n[1]/100,i=n[2]/100,r=t+i,a;r>1&&(t/=r,i/=r);let o=Math.floor(6*e),l=1-i;a=6*e-o,o&1&&(a=1-a);let c=t+a*(l-t),u,d,m;switch(o){default:case 6:case 0:u=l,d=c,m=t;break;case 1:u=c,d=l,m=t;break;case 2:u=t,d=l,m=c;break;case 3:u=t,d=c,m=l;break;case 4:u=c,d=t,m=l;break;case 5:u=l,d=t,m=c;break}return[u*255,d*255,m*255]};He.cmyk.rgb=function(n){let e=n[0]/100,t=n[1]/100,i=n[2]/100,r=n[3]/100,a=1-Math.min(1,e*(1-r)+r),o=1-Math.min(1,t*(1-r)+r),l=1-Math.min(1,i*(1-r)+r);return[a*255,o*255,l*255]};He.xyz.rgb=function(n){let e=n[0]/100,t=n[1]/100,i=n[2]/100,r,a,o;return r=e*3.2406+t*-1.5372+i*-.4986,a=e*-.9689+t*1.8758+i*.0415,o=e*.0557+t*-.204+i*1.057,r=r>.0031308?1.055*r**(1/2.4)-.055:r*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,r=Math.min(Math.max(0,r),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[r*255,a*255,o*255]};He.xyz.lab=function(n){let e=n[0],t=n[1],i=n[2];e/=95.047,t/=100,i/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,t=t>.008856?t**(1/3):7.787*t+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let r=116*t-16,a=500*(e-t),o=200*(t-i);return[r,a,o]};He.lab.xyz=function(n){let e=n[0],t=n[1],i=n[2],r,a,o;a=(e+16)/116,r=t/500+a,o=a-i/200;let l=a**3,c=r**3,u=o**3;return a=l>.008856?l:(a-16/116)/7.787,r=c>.008856?c:(r-16/116)/7.787,o=u>.008856?u:(o-16/116)/7.787,r*=95.047,a*=100,o*=108.883,[r,a,o]};He.lab.lch=function(n){let e=n[0],t=n[1],i=n[2],r;r=Math.atan2(i,t)*360/2/Math.PI,r<0&&(r+=360);let o=Math.sqrt(t*t+i*i);return[e,o,r]};He.lch.lab=function(n){let e=n[0],t=n[1],r=n[2]/360*2*Math.PI,a=t*Math.cos(r),o=t*Math.sin(r);return[e,a,o]};He.rgb.ansi16=function(n,e=null){let[t,i,r]=n,a=e===null?He.rgb.hsv(n)[2]:e;if(a=Math.round(a/50),a===0)return 30;let o=30+(Math.round(r/255)<<2|Math.round(i/255)<<1|Math.round(t/255));return a===2&&(o+=60),o};He.hsv.ansi16=function(n){return He.rgb.ansi16(He.hsv.rgb(n),n[2])};He.rgb.ansi256=function(n){let e=n[0],t=n[1],i=n[2];return e===t&&t===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(i/255*5)};He.ansi16.rgb=function(n){let e=n%10;if(e===0||e===7)return n>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let t=(~~(n>50)+1)*.5,i=(e&1)*t*255,r=(e>>1&1)*t*255,a=(e>>2&1)*t*255;return[i,r,a]};He.ansi256.rgb=function(n){if(n>=232){let a=(n-232)*10+8;return[a,a,a]}n-=16;let e,t=Math.floor(n/36)/5*255,i=Math.floor((e=n%36)/6)/5*255,r=e%6/5*255;return[t,i,r]};He.rgb.hex=function(n){let t=(((Math.round(n[0])&255)<<16)+((Math.round(n[1])&255)<<8)+(Math.round(n[2])&255)).toString(16).toUpperCase();return"000000".substring(t.length)+t};He.hex.rgb=function(n){let e=n.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let t=e[0];e[0].length===3&&(t=t.split("").map(l=>l+l).join(""));let i=parseInt(t,16),r=i>>16&255,a=i>>8&255,o=i&255;return[r,a,o]};He.rgb.hcg=function(n){let e=n[0]/255,t=n[1]/255,i=n[2]/255,r=Math.max(Math.max(e,t),i),a=Math.min(Math.min(e,t),i),o=r-a,l,c;return o<1?l=a/(1-o):l=0,o<=0?c=0:r===e?c=(t-i)/o%6:r===t?c=2+(i-e)/o:c=4+(e-t)/o,c/=6,c%=1,[c*360,o*100,l*100]};He.hsl.hcg=function(n){let e=n[1]/100,t=n[2]/100,i=t<.5?2*e*t:2*e*(1-t),r=0;return i<1&&(r=(t-.5*i)/(1-i)),[n[0],i*100,r*100]};He.hsv.hcg=function(n){let e=n[1]/100,t=n[2]/100,i=e*t,r=0;return i<1&&(r=(t-i)/(1-i)),[n[0],i*100,r*100]};He.hcg.rgb=function(n){let e=n[0]/360,t=n[1]/100,i=n[2]/100;if(t===0)return[i*255,i*255,i*255];let r=[0,0,0],a=e%1*6,o=a%1,l=1-o,c=0;switch(Math.floor(a)){case 0:r[0]=1,r[1]=o,r[2]=0;break;case 1:r[0]=l,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=o;break;case 3:r[0]=0,r[1]=l,r[2]=1;break;case 4:r[0]=o,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=l}return c=(1-t)*i,[(t*r[0]+c)*255,(t*r[1]+c)*255,(t*r[2]+c)*255]};He.hcg.hsv=function(n){let e=n[1]/100,t=n[2]/100,i=e+t*(1-e),r=0;return i>0&&(r=e/i),[n[0],r*100,i*100]};He.hcg.hsl=function(n){let e=n[1]/100,i=n[2]/100*(1-e)+.5*e,r=0;return i>0&&i<.5?r=e/(2*i):i>=.5&&i<1&&(r=e/(2*(1-i))),[n[0],r*100,i*100]};He.hcg.hwb=function(n){let e=n[1]/100,t=n[2]/100,i=e+t*(1-e);return[n[0],(i-e)*100,(1-i)*100]};He.hwb.hcg=function(n){let e=n[1]/100,i=1-n[2]/100,r=i-e,a=0;return r<1&&(a=(i-r)/(1-r)),[n[0],r*100,a*100]};He.apple.rgb=function(n){return[n[0]/65535*255,n[1]/65535*255,n[2]/65535*255]};He.rgb.apple=function(n){return[n[0]/255*65535,n[1]/255*65535,n[2]/255*65535]};He.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]};He.gray.hsl=function(n){return[0,0,n[0]]};He.gray.hsv=He.gray.hsl;He.gray.hwb=function(n){return[0,100,n[0]]};He.gray.cmyk=function(n){return[0,0,0,n[0]]};He.gray.lab=function(n){return[n[0],0,0]};He.gray.hex=function(n){let e=Math.round(n[0]/100*255)&255,i=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(i.length)+i};He.rgb.gray=function(n){return[(n[0]+n[1]+n[2])/3/255*100]}});var Ov=gr((woe,Iv)=>{var Uu=Wm();function d9(){let n={},e=Object.keys(Uu);for(let t=e.length,i=0;i{var Zm=Wm(),_9=Ov(),ls={},g9=Object.keys(Zm);function h9(n){let e=s(function(...t){let i=t[0];return i==null?i:(i.length>1&&(t=i),n(t))},"wrappedFn");return"conversion"in n&&(e.conversion=n.conversion),e}s(h9,"wrapRaw");function b9(n){let e=s(function(...t){let i=t[0];if(i==null)return i;i.length>1&&(t=i);let r=n(t);if(typeof r=="object")for(let a=r.length,o=0;o{ls[n]={},Object.defineProperty(ls[n],"channels",{value:Zm[n].channels}),Object.defineProperty(ls[n],"labels",{value:Zm[n].labels});let e=_9(n);Object.keys(e).forEach(i=>{let r=e[i];ls[n][i]=b9(r),ls[n][i].raw=h9(r)})});Nv.exports=ls});var Pv=gr((Toe,Lv)=>{"use strict";var Dv=s((n,e)=>(...t)=>`\x1B[${n(...t)+e}m`,"wrapAnsi16"),Rv=s((n,e)=>(...t)=>{let i=n(...t);return`\x1B[${38+e};5;${i}m`},"wrapAnsi256"),Mv=s((n,e)=>(...t)=>{let i=n(...t);return`\x1B[${38+e};2;${i[0]};${i[1]};${i[2]}m`},"wrapAnsi16m"),Gu=s(n=>n,"ansi2ansi"),Fv=s((n,e,t)=>[n,e,t],"rgb2rgb"),cs=s((n,e,t)=>{Object.defineProperty(n,e,{get:()=>{let i=t();return Object.defineProperty(n,e,{value:i,enumerable:!0,configurable:!0}),i},enumerable:!0,configurable:!0})},"setLazyProperty"),Xm,us=s((n,e,t,i)=>{Xm===void 0&&(Xm=Bv());let r=i?10:0,a={};for(let[o,l]of Object.entries(Xm)){let c=o==="ansi16"?"ansi":o;o===e?a[c]=n(t,r):typeof l=="object"&&(a[c]=n(l[e],r))}return a},"makeDynamicStyles");function v9(){let n=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[t,i]of Object.entries(e)){for(let[r,a]of Object.entries(i))e[r]={open:`\x1B[${a[0]}m`,close:`\x1B[${a[1]}m`},i[r]=e[r],n.set(a[0],a[1]);Object.defineProperty(e,t,{value:i,enumerable:!1})}return Object.defineProperty(e,"codes",{value:n,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",cs(e.color,"ansi",()=>us(Dv,"ansi16",Gu,!1)),cs(e.color,"ansi256",()=>us(Rv,"ansi256",Gu,!1)),cs(e.color,"ansi16m",()=>us(Mv,"rgb",Fv,!1)),cs(e.bgColor,"ansi",()=>us(Dv,"ansi16",Gu,!0)),cs(e.bgColor,"ansi256",()=>us(Rv,"ansi256",Gu,!0)),cs(e.bgColor,"ansi16m",()=>us(Mv,"rgb",Fv,!0)),e}s(v9,"assembleStyles");Object.defineProperty(Lv,"exports",{enumerable:!0,get:v9})});var zv=gr((Aoe,Vv)=>{"use strict";Vv.exports=(n,e=process.argv)=>{let t=n.startsWith("-")?"":n.length===1?"-":"--",i=e.indexOf(t+n),r=e.indexOf("--");return i!==-1&&(r===-1||i{"use strict";var y9=rn("os"),Uv=rn("tty"),Hi=zv(),{env:Mn}=process,ga;Hi("no-color")||Hi("no-colors")||Hi("color=false")||Hi("color=never")?ga=0:(Hi("color")||Hi("colors")||Hi("color=true")||Hi("color=always"))&&(ga=1);"FORCE_COLOR"in Mn&&(Mn.FORCE_COLOR==="true"?ga=1:Mn.FORCE_COLOR==="false"?ga=0:ga=Mn.FORCE_COLOR.length===0?1:Math.min(parseInt(Mn.FORCE_COLOR,10),3));function Ym(n){return n===0?!1:{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}s(Ym,"translateLevel");function Qm(n,e){if(ga===0)return 0;if(Hi("color=16m")||Hi("color=full")||Hi("color=truecolor"))return 3;if(Hi("color=256"))return 2;if(n&&!e&&ga===void 0)return 0;let t=ga||0;if(Mn.TERM==="dumb")return t;if(process.platform==="win32"){let i=y9.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in Mn)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(i=>i in Mn)||Mn.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in Mn)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Mn.TEAMCITY_VERSION)?1:0;if(Mn.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Mn){let i=parseInt((Mn.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Mn.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Mn.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Mn.TERM)||"COLORTERM"in Mn?1:t}s(Qm,"supportsColor");function w9(n){let e=Qm(n,n&&n.isTTY);return Ym(e)}s(w9,"getSupportLevel");Gv.exports={supportsColor:w9,stdout:Ym(Qm(!0,Uv.isatty(1))),stderr:Ym(Qm(!0,Uv.isatty(2)))}});var $v=gr((Ioe,Hv)=>{"use strict";var x9=s((n,e,t)=>{let i=n.indexOf(e);if(i===-1)return n;let r=e.length,a=0,o="";do o+=n.substr(a,i-a)+e+t,a=i+r,i=n.indexOf(e,a);while(i!==-1);return o+=n.substr(a),o},"stringReplaceAll"),k9=s((n,e,t,i)=>{let r=0,a="";do{let o=n[i-1]==="\r";a+=n.substr(r,(o?i-1:i)-r)+e+(o?`\r +"use strict";(()=>{var Dw=Object.create;var Os=Object.defineProperty;var Mw=Object.getOwnPropertyDescriptor;var Fw=Object.getOwnPropertyNames;var Lw=Object.getPrototypeOf,Pw=Object.prototype.hasOwnProperty;var Vw=(n,e,t)=>e in n?Os(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var s=(n,e)=>Os(n,"name",{value:e,configurable:!0}),Rt=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+n+'" is not supported')});var gi=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),xn=(n,e)=>{for(var t in e)Os(n,t,{get:e[t],enumerable:!0})},zw=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Fw(e))!Pw.call(n,r)&&r!==t&&Os(n,r,{get:()=>e[r],enumerable:!(i=Mw(e,r))||i.enumerable});return n};var ci=(n,e,t)=>(t=n!=null?Dw(Lw(n)):{},zw(e||!n||!n.__esModule?Os(t,"default",{value:n,enumerable:!0}):t,n));var kt=(n,e,t)=>(Vw(n,typeof e!="symbol"?e+"":e,t),t);var Gw=n=>new Uint8Array(Buffer.from(n,"base64"));var Nb=gi(ma=>{"use strict";var VP=ma&&ma.__awaiter||function(n,e,t,i){function r(a){return a instanceof t?a:new t(function(o){o(a)})}return s(r,"adopt"),new(t||(t=Promise))(function(a,o){function l(d){try{c(i.next(d))}catch(m){o(m)}}s(l,"fulfilled");function u(d){try{c(i.throw(d))}catch(m){o(m)}}s(u,"rejected");function c(d){d.done?a(d.value):r(d.value).then(l,u)}s(c,"step"),c((i=i.apply(n,e||[])).next())})};Object.defineProperty(ma,"__esModule",{value:!0});ma.safeRun=ma.delay=void 0;function zP(n){return VP(this,void 0,void 0,function*(){return yield new Promise(e=>setTimeout(e,n))})}s(zP,"delay");ma.delay=zP;function GP(n){try{n()}catch{}}s(GP,"safeRun");ma.safeRun=GP});var Db=gi(Sn=>{"use strict";var UP=Sn&&Sn.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),JP=Sn&&Sn.__setModuleDefault||(Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e}),Bb=Sn&&Sn.__importStar||function(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)t!=="default"&&Object.prototype.hasOwnProperty.call(n,t)&&UP(e,n,t);return JP(e,n),e},HP=Sn&&Sn.__awaiter||function(n,e,t,i){function r(a){return a instanceof t?a:new t(function(o){o(a)})}return s(r,"adopt"),new(t||(t=Promise))(function(a,o){function l(d){try{c(i.next(d))}catch(m){o(m)}}s(l,"fulfilled");function u(d){try{c(i.throw(d))}catch(m){o(m)}}s(u,"rejected");function c(d){d.done?a(d.value):r(d.value).then(l,u)}s(c,"step"),c((i=i.apply(n,e||[])).next())})};Object.defineProperty(Sn,"__esModule",{value:!0});Sn.validate=Sn.rename=Sn.fileStats=Sn.ls=Sn.rm=void 0;var $P=Bb(Rt("path")),tu=Bb(Rt("fs"));function qP(n){return new Promise((e,t)=>tu.unlink(n,i=>{if(i)return t(i);e()}))}s(qP,"rm");Sn.rm=qP;function KP(n){return new Promise((e,t)=>tu.readdir(n,(i,r)=>{if(i)return t(i);e(r)}))}s(KP,"ls");Sn.ls=KP;function Rb(n){return new Promise((e,t)=>tu.stat(n,(i,r)=>{if(i&&i.code==="ENOENT")return e(null);if(i)return t(i);e(r)}))}s(Rb,"fileStats");Sn.fileStats=Rb;function WP(n,e){return new Promise((t,i)=>tu.rename(n,e,r=>{if(r)return i(r);t()}))}s(WP,"rename");Sn.rename=WP;function ZP(n){return HP(this,void 0,void 0,function*(){let e=$P.parse(n);try{let t=yield Rb(e.dir);return t?t.isDirectory():!1}catch{return!1}})}s(ZP,"validate");Sn.validate=ZP});var Lb=gi(mi=>{"use strict";var XP=mi&&mi.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),YP=mi&&mi.__setModuleDefault||(Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e}),Mb=mi&&mi.__importStar||function(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)t!=="default"&&Object.prototype.hasOwnProperty.call(n,t)&&XP(e,n,t);return YP(e,n),e},fm=mi&&mi.__awaiter||function(n,e,t,i){function r(a){return a instanceof t?a:new t(function(o){o(a)})}return s(r,"adopt"),new(t||(t=Promise))(function(a,o){function l(d){try{c(i.next(d))}catch(m){o(m)}}s(l,"fulfilled");function u(d){try{c(i.throw(d))}catch(m){o(m)}}s(u,"rejected");function c(d){d.done?a(d.value):r(d.value).then(l,u)}s(c,"step"),c((i=i.apply(n,e||[])).next())})};Object.defineProperty(mi,"__esModule",{value:!0});mi.requestHeader=mi.followRedirect=void 0;var QP=Mb(Rt("http")),e7=Mb(Rt("https")),t7=Rt("events"),bl=class extends t7.EventEmitter{constructor(e,t){super(),this.destroyed=!1,this.address=e,this._end=!1,this.options=Object.assign({method:"GET"},t),e.startsWith("https")?this._engine=e7:this._engine=QP}end(){if(this.destroyed)throw new Error("Calling start() with a destroyed Request.");return this._req=this._engine.request(this.address,this.options,e=>{this.emit("ready",{statusCode:e.statusCode||500,headers:e.headers}),e.on("close",()=>this.emit("close")),e.on("end",()=>{this._end=!0,this.emit("end")}),e.on("data",t=>this.emit("data",t)),e.on("error",t=>this.emit("error",t))}),this._req.on("error",e=>this.emit("error",e)),process.nextTick(()=>this._req.end()),this}wait(){return fm(this,void 0,void 0,function*(){return yield new Promise(e=>this.once("close",e)),this._end})}pipe(e){if(this.destroyed)throw new Error("Calling start() with a destroyed Request.");return this._req=this._engine.request(this.address,this.options,t=>{this.emit("ready",{statusCode:t.statusCode||500,headers:t.headers}),t.pipe(e),t.on("close",()=>this.emit("close")),t.on("end",()=>{this._end=!0,this.emit("end")}),t.on("data",i=>this.emit("data",i)),t.on("error",i=>this.emit("error",i))}),this._req.on("error",t=>this.emit("error",t)),process.nextTick(()=>this._req.end()),this}destroy(){this.destroyed=!0,this._req&&this._req.destroy()}};s(bl,"Request");function n7(n,e,t){return fm(this,void 0,void 0,function*(){let i=new Set,r=n;for(;;){if(i.has(r))throw new Error(`Infinite redirect is detected at ${r}`);i.add(r);let{headers:a,statusCode:o}=yield Fb(r,e,t);if(o===200||o===206)return{address:r,headers:a};if(o>300&&o<400){if(!a)throw new Error("No header data");if(!a.location)throw new Error(`HTTP Response code is ${o} but "location" is not in headers`);r=a.location}else{if(r!==n)return{address:r};throw new Error(`Got HTTP Response code ${o}`)}}})}s(n7,"followRedirect");mi.followRedirect=n7;function Fb(n,e,t){return fm(this,void 0,void 0,function*(){let i=new bl(n,Object.assign(Object.assign({},e),{headers:Object.assign(Object.assign({},e?.headers),t&&{Range:"bytes=0-0"}),method:t?"GET":"HEAD"})).end(),r=yield Promise.race([new Promise(o=>i.once("ready",o)),new Promise(o=>i.once("error",o))]);if(r.statusCode)return r;throw r})}s(Fb,"requestHeader");mi.requestHeader=Fb;mi.default=bl});var Vb=gi((qr,Pb)=>{"use strict";var i7=qr&&qr.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),r7=qr&&qr.__setModuleDefault||(Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e}),_m=qr&&qr.__importStar||function(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)t!=="default"&&Object.prototype.hasOwnProperty.call(n,t)&&i7(e,n,t);return r7(e,n),e},pa=qr&&qr.__awaiter||function(n,e,t,i){function r(a){return a instanceof t?a:new t(function(o){o(a)})}return s(r,"adopt"),new(t||(t=Promise))(function(a,o){function l(d){try{c(i.next(d))}catch(m){o(m)}}s(l,"fulfilled");function u(d){try{c(i.throw(d))}catch(m){o(m)}}s(u,"rejected");function c(d){d.done?a(d.value):r(d.value).then(l,u)}s(c,"step"),c((i=i.apply(n,e||[])).next())})},nu=_m(Rt("fs")),vl=_m(Rt("path")),a7=Rt("events"),mm=Nb(),iu=Db(),pm=_m(Lb()),ru=class extends a7.EventEmitter{constructor(e,t,i){super(),this._started=!1,this._destroyed=!1,this._reqs=[],this._attempts=[],this._ranges=[],this._done=!1,this._jobs=[],this._workers=0,this._downloadedChunks=0,this._totalChunks=0,this._partsSpeedRef=[],this._speedRef={time:Date.now(),bytes:0},this.size=0,this.isResume=!1,this.totalProgress={speed:0,bytes:0,percentage:0},this.partsProgress=[],this.parallel=!0,this.resumable=!0,this.headers=null,this._opts=Object.assign({existBehavior:"new_file",followRedirect:!0,connections:5,chunkSize:r=>Math.min(r/10,10*1024*1024),maxRetry:3,retryDelay:2e3,retryBackoff:3e3,reportInterval:2500,methodFallback:!1},i),this._url=e,this._dest=vl.resolve(t),this.savedFilePath=this._dest,this._attempts=Array(this._opts.maxRetry).fill(1).map((r,a)=>r+a),this._start=this._start.bind(this),this.finalAddress=e}_ensureDest(){return pa(this,void 0,void 0,function*(){for(;this.savedFilePath;){let e=yield(0,iu.fileStats)(this.savedFilePath);if(e&&e.isDirectory())this.savedFilePath=vl.join(this.savedFilePath,vl.posix.basename(this._url));else if(e&&this._opts.existBehavior==="new_file"){let t=vl.parse(this.savedFilePath);this.savedFilePath=vl.join(t.dir,`${t.name}(COPY)${t.ext}`)}else if(e&&this._opts.existBehavior==="ignore")this.savedFilePath=null;else{if(e&&this._opts.existBehavior==="error")throw new Error(`Destination ${this.savedFilePath} already exists.`);break}}})}_getHeaders(){return pa(this,void 0,void 0,function*(){if(this._opts.followRedirect){let e=yield(0,pm.followRedirect)(this._url,this._opts.httpOptions,this._opts.methodFallback);this.finalAddress=e.address,this.headers=e.headers||null}else{let e=yield(0,pm.requestHeader)(this._url,this._opts.httpOptions,this._opts.methodFallback);if(e.statusCode!==200&&e.statusCode!==206)throw new Error(`Got HTTP response ${e.statusCode}`);this.headers=e.headers}})}_buildFile(){return pa(this,void 0,void 0,function*(){if(this._destroyed)return;this.emit("build",{percentage:0});let e=nu.createWriteStream(this.savedFilePath);try{for(let t=0;t{r.pipe(e,{end:!1}),r.on("error",o),e.on("error",o),r.on("end",()=>{e.removeListener("error",o),a()})}),r.destroy(),this.emit("build",{percentage:100*((t+1)/this._totalChunks)})}for(let t=0;tnu.unlink(i,r))}e.destroy(),this._done=!0,this.emit("end"),this.destroy()}catch(t){(0,mm.safeRun)(e.destroy),this.emit("error",t),this.destroy()}})}_onChunkCompleted(e){if(this._reqs[e]){if(this._reqs[e].destroy(),delete this._reqs[e],this._report(e,!0),this.partsProgress[e].speed=0,this._workers-=1,this._downloadedChunks+=1,this._downloadedChunks===this._totalChunks)return this._buildFile();this._processChunks()}}_processChunks(){for(;!this._destroyed&&this._jobs.length&&this._workersr)&&(this.partsProgress[e].speed=1e3*(this.partsProgress[e].bytes-this._partsSpeedRef[e].bytes)/(i-this._partsSpeedRef[e].time),this._partsSpeedRef[e].bytes=this.partsProgress[e].bytes,this._partsSpeedRef[e].time=i),(t||i-this._speedRef.time>r)&&(this.totalProgress.speed=1e3*(this.totalProgress.bytes-this._speedRef.bytes)/(i-this._speedRef.time),this._speedRef.bytes=this.totalProgress.bytes,this._speedRef.time=i,this.listenerCount("progress")>0&&this.emit("progress",{total:this.totalProgress,details:this.partsProgress}))}_getSizeFromIncomingHttpHeaders(e){var t;return e["content-length"]||e["content-range"]?this._opts.methodFallback&&e["content-range"]?parseInt((t=e["content-range"].split("/").at(1))!==null&&t!==void 0?t:"0"):e["content-length"]?parseInt(e["content-length"]):0:0}_download(e,t){return pa(this,void 0,void 0,function*(){for(let i of this._attempts){let r=this._opts.httpOptions;if(r&&r.headers&&t){let c=Object.assign({},r.headers,{Range:`bytes=${t[0]}-${t[1]}`});r=Object.assign({},r,{headers:c})}else t&&(r=Object.assign({},r,{headers:{Range:`bytes=${t[0]}-${t[1]}`}}));this._reqs[e]=new pm.default(this.finalAddress,r);let a=t&&t[1]-t[0]+1||0,o=`${this.savedFilePath}.$$${e}$PART`,l=null,u=nu.createWriteStream(o);if(u.on("error",c=>{this._destroyed||this.emit("error",c)}),yield this._reqs[e].once("ready",({statusCode:c,headers:d})=>{if(c!==206&&c!==200){l=new Error(`Got HTTP Status code ${c} when downloading chunk ${e}`),this._reqs[e].destroy();return}let m=d["content-length"]&&parseInt(d["content-length"])||0;if(a&&m&&a!==m){l=new Error(`Expecting content length of ${a} but got ${m} when downloading chunk ${e}`),this._reqs[e].destroy();return}if(t&&c!==206){l=new Error(`Expecting HTTP Status code 206 but got ${c} when downloading chunk ${e}`),this._reqs[e].destroy();return}!a&&d["content-length"]&&(a=this._getSizeFromIncomingHttpHeaders(d)),!this.size&&e===0&&d["content-length"]&&(this.size=this._getSizeFromIncomingHttpHeaders(d))}).on("data",c=>{this.partsProgress[e].bytes+=c.length,this.partsProgress[e].percentage=a?100*this.partsProgress[e].bytes/a:0,this.totalProgress.bytes+=c.length,this.totalProgress.percentage=this.size?100*this.totalProgress.bytes/this.size:0,this._report(e)}).on("error",c=>{u.destroy(),!this._destroyed&&this.emit("error",c)}).pipe(u).wait(),(0,mm.safeRun)(u.destroy),this._destroyed)return;if(!l){yield(0,iu.rename)(`${this.savedFilePath}.$$${e}$PART`,`${this.savedFilePath}.$$${e}`),this._onChunkCompleted(e);return}this.emit("retry",{chunkId:e,attempt:i,error:l}),yield(0,mm.delay)(this._opts.retryDelay+this._opts.retryBackoff*(i-1))}this.emit("error",new Error(`Failed to download chunk #${e} ${t}`)),this.destroy()})}_syncJobs(){return pa(this,void 0,void 0,function*(){this.partsProgress=Array(this._ranges.length);for(let e=0;ei)throw new Error(`Expecting maximum chunk size of ${i} but got: ${t.size}`);t.size===i?(this._downloadedChunks+=1,this.partsProgress[e].percentage=100,this.partsProgress[e].bytes=i,this.totalProgress.bytes+=i,this.totalProgress.percentage=this.size?100*this.totalProgress.bytes/this.size:0,this.isResume=!0):this._jobs.push(e)}})}_calcRanges(){let e=typeof this._opts.chunkSize=="function"?Math.floor(this._opts.chunkSize(this.size)):this._opts.chunkSize,t=0;this.size/e1&&r[i-1]0&&this.emit("metadata",{size:this.size,chunks:this._ranges.map(([e,t])=>t-e+1),isResume:this.isResume,progress:this.partsProgress.map(e=>e.percentage),finalAddress:this.finalAddress,parallel:this.parallel,resumable:this.resumable,headers:this.headers,savedFilePath:this.savedFilePath})}catch(e){this.emit("error",e),this.destroy()}}})}metadata(){return pa(this,void 0,void 0,function*(){if(process.nextTick(this._start),this._destroyed)throw new Error("Calling metadata() on destroyed instance.");return yield new Promise((e,t)=>{this.once("error",t),this.once("metadata",e)})})}wait(){return pa(this,void 0,void 0,function*(){return process.nextTick(this._start),this._destroyed?this._done:(yield new Promise((e,t)=>{this.once("error",t),this.once("close",e)}),this._done)})}start(){return process.nextTick(this._start),this}destroy(){if(!this._destroyed){this._destroyed=!0;for(let e of this._reqs)if(e)try{e.destroy()}catch{}this.emit("close")}}};s(ru,"EasyDl");Pb.exports=ru});var d1=gi((Tle,u1)=>{"use strict";u1.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var fp=gi((Cle,m1)=>{var Zl=d1(),f1={};for(let n of Object.keys(Zl))f1[Zl[n]]=n;var Ke={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};m1.exports=Ke;for(let n of Object.keys(Ke)){if(!("channels"in Ke[n]))throw new Error("missing channels property: "+n);if(!("labels"in Ke[n]))throw new Error("missing channel labels property: "+n);if(Ke[n].labels.length!==Ke[n].channels)throw new Error("channel and label counts mismatch: "+n);let{channels:e,labels:t}=Ke[n];delete Ke[n].channels,delete Ke[n].labels,Object.defineProperty(Ke[n],"channels",{value:e}),Object.defineProperty(Ke[n],"labels",{value:t})}Ke.rgb.hsl=function(n){let e=n[0]/255,t=n[1]/255,i=n[2]/255,r=Math.min(e,t,i),a=Math.max(e,t,i),o=a-r,l,u;a===r?l=0:e===a?l=(t-i)/o:t===a?l=2+(i-e)/o:i===a&&(l=4+(e-t)/o),l=Math.min(l*60,360),l<0&&(l+=360);let c=(r+a)/2;return a===r?u=0:c<=.5?u=o/(a+r):u=o/(2-a-r),[l,u*100,c*100]};Ke.rgb.hsv=function(n){let e,t,i,r,a,o=n[0]/255,l=n[1]/255,u=n[2]/255,c=Math.max(o,l,u),d=c-Math.min(o,l,u),m=s(function(p){return(c-p)/6/d+1/2},"diffc");return d===0?(r=0,a=0):(a=d/c,e=m(o),t=m(l),i=m(u),o===c?r=i-t:l===c?r=1/3+e-i:u===c&&(r=2/3+t-e),r<0?r+=1:r>1&&(r-=1)),[r*360,a*100,c*100]};Ke.rgb.hwb=function(n){let e=n[0],t=n[1],i=n[2],r=Ke.rgb.hsl(n)[0],a=1/255*Math.min(e,Math.min(t,i));return i=1-1/255*Math.max(e,Math.max(t,i)),[r,a*100,i*100]};Ke.rgb.cmyk=function(n){let e=n[0]/255,t=n[1]/255,i=n[2]/255,r=Math.min(1-e,1-t,1-i),a=(1-e-r)/(1-r)||0,o=(1-t-r)/(1-r)||0,l=(1-i-r)/(1-r)||0;return[a*100,o*100,l*100,r*100]};function Zz(n,e){return(n[0]-e[0])**2+(n[1]-e[1])**2+(n[2]-e[2])**2}s(Zz,"comparativeDistance");Ke.rgb.keyword=function(n){let e=f1[n];if(e)return e;let t=1/0,i;for(let r of Object.keys(Zl)){let a=Zl[r],o=Zz(n,a);o.04045?((e+.055)/1.055)**2.4:e/12.92,t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92;let r=e*.4124+t*.3576+i*.1805,a=e*.2126+t*.7152+i*.0722,o=e*.0193+t*.1192+i*.9505;return[r*100,a*100,o*100]};Ke.rgb.lab=function(n){let e=Ke.rgb.xyz(n),t=e[0],i=e[1],r=e[2];t/=95.047,i/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;let a=116*i-16,o=500*(t-i),l=200*(i-r);return[a,o,l]};Ke.hsl.rgb=function(n){let e=n[0]/360,t=n[1]/100,i=n[2]/100,r,a,o;if(t===0)return o=i*255,[o,o,o];i<.5?r=i*(1+t):r=i+t-i*t;let l=2*i-r,u=[0,0,0];for(let c=0;c<3;c++)a=e+1/3*-(c-1),a<0&&a++,a>1&&a--,6*a<1?o=l+(r-l)*6*a:2*a<1?o=r:3*a<2?o=l+(r-l)*(2/3-a)*6:o=l,u[c]=o*255;return u};Ke.hsl.hsv=function(n){let e=n[0],t=n[1]/100,i=n[2]/100,r=t,a=Math.max(i,.01);i*=2,t*=i<=1?i:2-i,r*=a<=1?a:2-a;let o=(i+t)/2,l=i===0?2*r/(a+r):2*t/(i+t);return[e,l*100,o*100]};Ke.hsv.rgb=function(n){let e=n[0]/60,t=n[1]/100,i=n[2]/100,r=Math.floor(e)%6,a=e-Math.floor(e),o=255*i*(1-t),l=255*i*(1-t*a),u=255*i*(1-t*(1-a));switch(i*=255,r){case 0:return[i,u,o];case 1:return[l,i,o];case 2:return[o,i,u];case 3:return[o,l,i];case 4:return[u,o,i];case 5:return[i,o,l]}};Ke.hsv.hsl=function(n){let e=n[0],t=n[1]/100,i=n[2]/100,r=Math.max(i,.01),a,o;o=(2-t)*i;let l=(2-t)*r;return a=t*r,a/=l<=1?l:2-l,a=a||0,o/=2,[e,a*100,o*100]};Ke.hwb.rgb=function(n){let e=n[0]/360,t=n[1]/100,i=n[2]/100,r=t+i,a;r>1&&(t/=r,i/=r);let o=Math.floor(6*e),l=1-i;a=6*e-o,o&1&&(a=1-a);let u=t+a*(l-t),c,d,m;switch(o){default:case 6:case 0:c=l,d=u,m=t;break;case 1:c=u,d=l,m=t;break;case 2:c=t,d=l,m=u;break;case 3:c=t,d=u,m=l;break;case 4:c=u,d=t,m=l;break;case 5:c=l,d=t,m=u;break}return[c*255,d*255,m*255]};Ke.cmyk.rgb=function(n){let e=n[0]/100,t=n[1]/100,i=n[2]/100,r=n[3]/100,a=1-Math.min(1,e*(1-r)+r),o=1-Math.min(1,t*(1-r)+r),l=1-Math.min(1,i*(1-r)+r);return[a*255,o*255,l*255]};Ke.xyz.rgb=function(n){let e=n[0]/100,t=n[1]/100,i=n[2]/100,r,a,o;return r=e*3.2406+t*-1.5372+i*-.4986,a=e*-.9689+t*1.8758+i*.0415,o=e*.0557+t*-.204+i*1.057,r=r>.0031308?1.055*r**(1/2.4)-.055:r*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,r=Math.min(Math.max(0,r),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[r*255,a*255,o*255]};Ke.xyz.lab=function(n){let e=n[0],t=n[1],i=n[2];e/=95.047,t/=100,i/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,t=t>.008856?t**(1/3):7.787*t+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let r=116*t-16,a=500*(e-t),o=200*(t-i);return[r,a,o]};Ke.lab.xyz=function(n){let e=n[0],t=n[1],i=n[2],r,a,o;a=(e+16)/116,r=t/500+a,o=a-i/200;let l=a**3,u=r**3,c=o**3;return a=l>.008856?l:(a-16/116)/7.787,r=u>.008856?u:(r-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,r*=95.047,a*=100,o*=108.883,[r,a,o]};Ke.lab.lch=function(n){let e=n[0],t=n[1],i=n[2],r;r=Math.atan2(i,t)*360/2/Math.PI,r<0&&(r+=360);let o=Math.sqrt(t*t+i*i);return[e,o,r]};Ke.lch.lab=function(n){let e=n[0],t=n[1],r=n[2]/360*2*Math.PI,a=t*Math.cos(r),o=t*Math.sin(r);return[e,a,o]};Ke.rgb.ansi16=function(n,e=null){let[t,i,r]=n,a=e===null?Ke.rgb.hsv(n)[2]:e;if(a=Math.round(a/50),a===0)return 30;let o=30+(Math.round(r/255)<<2|Math.round(i/255)<<1|Math.round(t/255));return a===2&&(o+=60),o};Ke.hsv.ansi16=function(n){return Ke.rgb.ansi16(Ke.hsv.rgb(n),n[2])};Ke.rgb.ansi256=function(n){let e=n[0],t=n[1],i=n[2];return e===t&&t===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(i/255*5)};Ke.ansi16.rgb=function(n){let e=n%10;if(e===0||e===7)return n>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let t=(~~(n>50)+1)*.5,i=(e&1)*t*255,r=(e>>1&1)*t*255,a=(e>>2&1)*t*255;return[i,r,a]};Ke.ansi256.rgb=function(n){if(n>=232){let a=(n-232)*10+8;return[a,a,a]}n-=16;let e,t=Math.floor(n/36)/5*255,i=Math.floor((e=n%36)/6)/5*255,r=e%6/5*255;return[t,i,r]};Ke.rgb.hex=function(n){let t=(((Math.round(n[0])&255)<<16)+((Math.round(n[1])&255)<<8)+(Math.round(n[2])&255)).toString(16).toUpperCase();return"000000".substring(t.length)+t};Ke.hex.rgb=function(n){let e=n.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let t=e[0];e[0].length===3&&(t=t.split("").map(l=>l+l).join(""));let i=parseInt(t,16),r=i>>16&255,a=i>>8&255,o=i&255;return[r,a,o]};Ke.rgb.hcg=function(n){let e=n[0]/255,t=n[1]/255,i=n[2]/255,r=Math.max(Math.max(e,t),i),a=Math.min(Math.min(e,t),i),o=r-a,l,u;return o<1?l=a/(1-o):l=0,o<=0?u=0:r===e?u=(t-i)/o%6:r===t?u=2+(i-e)/o:u=4+(e-t)/o,u/=6,u%=1,[u*360,o*100,l*100]};Ke.hsl.hcg=function(n){let e=n[1]/100,t=n[2]/100,i=t<.5?2*e*t:2*e*(1-t),r=0;return i<1&&(r=(t-.5*i)/(1-i)),[n[0],i*100,r*100]};Ke.hsv.hcg=function(n){let e=n[1]/100,t=n[2]/100,i=e*t,r=0;return i<1&&(r=(t-i)/(1-i)),[n[0],i*100,r*100]};Ke.hcg.rgb=function(n){let e=n[0]/360,t=n[1]/100,i=n[2]/100;if(t===0)return[i*255,i*255,i*255];let r=[0,0,0],a=e%1*6,o=a%1,l=1-o,u=0;switch(Math.floor(a)){case 0:r[0]=1,r[1]=o,r[2]=0;break;case 1:r[0]=l,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=o;break;case 3:r[0]=0,r[1]=l,r[2]=1;break;case 4:r[0]=o,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=l}return u=(1-t)*i,[(t*r[0]+u)*255,(t*r[1]+u)*255,(t*r[2]+u)*255]};Ke.hcg.hsv=function(n){let e=n[1]/100,t=n[2]/100,i=e+t*(1-e),r=0;return i>0&&(r=e/i),[n[0],r*100,i*100]};Ke.hcg.hsl=function(n){let e=n[1]/100,i=n[2]/100*(1-e)+.5*e,r=0;return i>0&&i<.5?r=e/(2*i):i>=.5&&i<1&&(r=e/(2*(1-i))),[n[0],r*100,i*100]};Ke.hcg.hwb=function(n){let e=n[1]/100,t=n[2]/100,i=e+t*(1-e);return[n[0],(i-e)*100,(1-i)*100]};Ke.hwb.hcg=function(n){let e=n[1]/100,i=1-n[2]/100,r=i-e,a=0;return r<1&&(a=(i-r)/(1-r)),[n[0],r*100,a*100]};Ke.apple.rgb=function(n){return[n[0]/65535*255,n[1]/65535*255,n[2]/65535*255]};Ke.rgb.apple=function(n){return[n[0]/255*65535,n[1]/255*65535,n[2]/255*65535]};Ke.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]};Ke.gray.hsl=function(n){return[0,0,n[0]]};Ke.gray.hsv=Ke.gray.hsl;Ke.gray.hwb=function(n){return[0,100,n[0]]};Ke.gray.cmyk=function(n){return[0,0,0,n[0]]};Ke.gray.lab=function(n){return[n[0],0,0]};Ke.gray.hex=function(n){let e=Math.round(n[0]/100*255)&255,i=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(i.length)+i};Ke.rgb.gray=function(n){return[(n[0]+n[1]+n[2])/3/255*100]}});var _1=gi((Sle,p1)=>{var td=fp();function Xz(){let n={},e=Object.keys(td);for(let t=e.length,i=0;i{var mp=fp(),tG=_1(),hs={},nG=Object.keys(mp);function iG(n){let e=s(function(...t){let i=t[0];return i==null?i:(i.length>1&&(t=i),n(t))},"wrappedFn");return"conversion"in n&&(e.conversion=n.conversion),e}s(iG,"wrapRaw");function rG(n){let e=s(function(...t){let i=t[0];if(i==null)return i;i.length>1&&(t=i);let r=n(t);if(typeof r=="object")for(let a=r.length,o=0;o{hs[n]={},Object.defineProperty(hs[n],"channels",{value:mp[n].channels}),Object.defineProperty(hs[n],"labels",{value:mp[n].labels});let e=tG(n);Object.keys(e).forEach(i=>{let r=e[i];hs[n][i]=rG(r),hs[n][i].raw=iG(r)})});g1.exports=hs});var k1=gi((Nle,x1)=>{"use strict";var b1=s((n,e)=>(...t)=>`\x1B[${n(...t)+e}m`,"wrapAnsi16"),v1=s((n,e)=>(...t)=>{let i=n(...t);return`\x1B[${38+e};5;${i}m`},"wrapAnsi256"),y1=s((n,e)=>(...t)=>{let i=n(...t);return`\x1B[${38+e};2;${i[0]};${i[1]};${i[2]}m`},"wrapAnsi16m"),nd=s(n=>n,"ansi2ansi"),w1=s((n,e,t)=>[n,e,t],"rgb2rgb"),bs=s((n,e,t)=>{Object.defineProperty(n,e,{get:()=>{let i=t();return Object.defineProperty(n,e,{value:i,enumerable:!0,configurable:!0}),i},enumerable:!0,configurable:!0})},"setLazyProperty"),pp,vs=s((n,e,t,i)=>{pp===void 0&&(pp=h1());let r=i?10:0,a={};for(let[o,l]of Object.entries(pp)){let u=o==="ansi16"?"ansi":o;o===e?a[u]=n(t,r):typeof l=="object"&&(a[u]=n(l[e],r))}return a},"makeDynamicStyles");function aG(){let n=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[t,i]of Object.entries(e)){for(let[r,a]of Object.entries(i))e[r]={open:`\x1B[${a[0]}m`,close:`\x1B[${a[1]}m`},i[r]=e[r],n.set(a[0],a[1]);Object.defineProperty(e,t,{value:i,enumerable:!1})}return Object.defineProperty(e,"codes",{value:n,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",bs(e.color,"ansi",()=>vs(b1,"ansi16",nd,!1)),bs(e.color,"ansi256",()=>vs(v1,"ansi256",nd,!1)),bs(e.color,"ansi16m",()=>vs(y1,"rgb",w1,!1)),bs(e.bgColor,"ansi",()=>vs(b1,"ansi16",nd,!0)),bs(e.bgColor,"ansi256",()=>vs(v1,"ansi256",nd,!0)),bs(e.bgColor,"ansi16m",()=>vs(y1,"rgb",w1,!0)),e}s(aG,"assembleStyles");Object.defineProperty(x1,"exports",{enumerable:!0,get:aG})});var T1=gi((Rle,E1)=>{"use strict";E1.exports=(n,e=process.argv)=>{let t=n.startsWith("-")?"":n.length===1?"-":"--",i=e.indexOf(t+n),r=e.indexOf("--");return i!==-1&&(r===-1||i{"use strict";var oG=Rt("os"),C1=Rt("tty"),Yi=T1(),{env:zn}=process,ka;Yi("no-color")||Yi("no-colors")||Yi("color=false")||Yi("color=never")?ka=0:(Yi("color")||Yi("colors")||Yi("color=true")||Yi("color=always"))&&(ka=1);"FORCE_COLOR"in zn&&(zn.FORCE_COLOR==="true"?ka=1:zn.FORCE_COLOR==="false"?ka=0:ka=zn.FORCE_COLOR.length===0?1:Math.min(parseInt(zn.FORCE_COLOR,10),3));function _p(n){return n===0?!1:{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}s(_p,"translateLevel");function gp(n,e){if(ka===0)return 0;if(Yi("color=16m")||Yi("color=full")||Yi("color=truecolor"))return 3;if(Yi("color=256"))return 2;if(n&&!e&&ka===void 0)return 0;let t=ka||0;if(zn.TERM==="dumb")return t;if(process.platform==="win32"){let i=oG.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in zn)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(i=>i in zn)||zn.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in zn)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(zn.TEAMCITY_VERSION)?1:0;if(zn.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in zn){let i=parseInt((zn.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(zn.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(zn.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(zn.TERM)||"COLORTERM"in zn?1:t}s(gp,"supportsColor");function sG(n){let e=gp(n,n&&n.isTTY);return _p(e)}s(sG,"getSupportLevel");A1.exports={supportsColor:sG,stdout:_p(gp(!0,C1.isatty(1))),stderr:_p(gp(!0,C1.isatty(2)))}});var I1=gi((Fle,j1)=>{"use strict";var lG=s((n,e,t)=>{let i=n.indexOf(e);if(i===-1)return n;let r=e.length,a=0,o="";do o+=n.substr(a,i-a)+e+t,a=i+r,i=n.indexOf(e,a);while(i!==-1);return o+=n.substr(a),o},"stringReplaceAll"),cG=s((n,e,t,i)=>{let r=0,a="";do{let o=n[i-1]==="\r";a+=n.substr(r,(o?i-1:i)-r)+e+(o?`\r `:` `)+t,r=i+1,i=n.indexOf(` -`,r)}while(i!==-1);return a+=n.substr(r),a},"stringEncaseCRLFWithFirstIndex");Hv.exports={stringReplaceAll:x9,stringEncaseCRLFWithFirstIndex:k9}});var Xv=gr((Noe,Zv)=>{"use strict";var E9=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,Kv=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,T9=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,C9=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,A9=new Map([["n",` -`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function Wv(n){let e=n[0]==="u",t=n[1]==="{";return e&&!t&&n.length===5||n[0]==="x"&&n.length===3?String.fromCharCode(parseInt(n.slice(1),16)):e&&t?String.fromCodePoint(parseInt(n.slice(2,-1),16)):A9.get(n)||n}s(Wv,"unescape");function S9(n,e){let t=[],i=e.trim().split(/\s*,\s*/g),r;for(let a of i){let o=Number(a);if(!Number.isNaN(o))t.push(o);else if(r=a.match(T9))t.push(r[2].replace(C9,(l,c,u)=>c?Wv(c):u));else throw new Error(`Invalid Chalk template style argument: ${a} (in style '${n}')`)}return t}s(S9,"parseArguments");function j9(n){Kv.lastIndex=0;let e=[],t;for(;(t=Kv.exec(n))!==null;){let i=t[1];if(t[2]){let r=S9(i,t[2]);e.push([i].concat(r))}else e.push([i])}return e}s(j9,"parseStyle");function qv(n,e){let t={};for(let r of e)for(let a of r.styles)t[a[0]]=r.inverse?null:a.slice(1);let i=n;for(let[r,a]of Object.entries(t))if(Array.isArray(a)){if(!(r in i))throw new Error(`Unknown Chalk style: ${r}`);i=a.length>0?i[r](...a):i[r]}return i}s(qv,"buildStyle");Zv.exports=(n,e)=>{let t=[],i=[],r=[];if(e.replace(E9,(a,o,l,c,u,d)=>{if(o)r.push(Wv(o));else if(c){let m=r.join("");r=[],i.push(t.length===0?m:qv(n,t)(m)),t.push({inverse:l,styles:j9(c)})}else if(u){if(t.length===0)throw new Error("Found extraneous } in Chalk template literal");i.push(qv(n,t)(r.join(""))),r=[],t.pop()}else r.push(d)}),i.push(r.join("")),t.length>0){let a=`Chalk template literal is missing ${t.length} closing bracket${t.length===1?"":"s"} (\`}\`)`;throw new Error(a)}return i.join("")}});var r1=gr((Doe,i1)=>{"use strict";var Gl=Pv(),{stdout:tp,stderr:np}=Jv(),{stringReplaceAll:I9,stringEncaseCRLFWithFirstIndex:O9}=$v(),{isArray:Hu}=Array,Qv=["ansi","ansi","ansi256","ansi16m"],ds=Object.create(null),N9=s((n,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=tp?tp.level:0;n.level=e.level===void 0?t:e.level},"applyOptions"),Ju=class{constructor(e){return e1(e)}};s(Ju,"ChalkClass");var e1=s(n=>{let e={};return N9(e,n),e.template=(...t)=>n1(e.template,...t),Object.setPrototypeOf(e,$u.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=Ju,e.template},"chalkFactory");function $u(n){return e1(n)}s($u,"Chalk");for(let[n,e]of Object.entries(Gl))ds[n]={get(){let t=Ku(this,ip(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,n,{value:t}),t}};ds.visible={get(){let n=Ku(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:n}),n}};var t1=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let n of t1)ds[n]={get(){let{level:e}=this;return function(...t){let i=ip(Gl.color[Qv[e]][n](...t),Gl.color.close,this._styler);return Ku(this,i,this._isEmpty)}}};for(let n of t1){let e="bg"+n[0].toUpperCase()+n.slice(1);ds[e]={get(){let{level:t}=this;return function(...i){let r=ip(Gl.bgColor[Qv[t]][n](...i),Gl.bgColor.close,this._styler);return Ku(this,r,this._isEmpty)}}}}var B9=Object.defineProperties(()=>{},{...ds,level:{enumerable:!0,get(){return this._generator.level},set(n){this._generator.level=n}}}),ip=s((n,e,t)=>{let i,r;return t===void 0?(i=n,r=e):(i=t.openAll+n,r=e+t.closeAll),{open:n,close:e,openAll:i,closeAll:r,parent:t}},"createStyler"),Ku=s((n,e,t)=>{let i=s((...r)=>Hu(r[0])&&Hu(r[0].raw)?Yv(i,n1(i,...r)):Yv(i,r.length===1?""+r[0]:r.join(" ")),"builder");return Object.setPrototypeOf(i,B9),i._generator=n,i._styler=e,i._isEmpty=t,i},"createBuilder"),Yv=s((n,e)=>{if(n.level<=0||!e)return n._isEmpty?"":e;let t=n._styler;if(t===void 0)return e;let{openAll:i,closeAll:r}=t;if(e.indexOf("\x1B")!==-1)for(;t!==void 0;)e=I9(e,t.close,t.open),t=t.parent;let a=e.indexOf(` -`);return a!==-1&&(e=O9(e,r,i,a)),i+e+r},"applyStyle"),ep,n1=s((n,...e)=>{let[t]=e;if(!Hu(t)||!Hu(t.raw))return e.join(" ");let i=e.slice(1),r=[t.raw[0]];for(let a=1;a{e(r),this.subscribers.delete(i)},"wrappedCallback");this.subscribers.add(i)}else this.subscribers.add(e);return()=>this.subscribers.delete(e)}dispatch(e){this.dispatching||(this.dispatching=!0,this.subscribers.forEach(t=>t(e)),this.dispatching=!1)}};s(Yr,"Subscribable");var $d=class extends Yr{constructor(t){super();this.name=t;$d.events[t]=this}},Ht=$d;s(Ht,"PluginEvent"),ht(Ht,"events",{});var te={LOAD:new Ht("load"),UNLOAD:new Ht("unload"),INSTALL:new Ht("install"),UNINSTALL:new Ht("uninstall"),INJECT_MODS:new Ht("injectMods"),EXTRACT_MODS:new Ht("extractMods"),NETWORK_CONNECTED:new Ht("networkConnected"),MINECRAFT_ASSETS_LOADED:new Ht("minecraftAssetsLoaded"),MINECRAFT_REGISTRY_LOADED:new Ht("minecraftRegistriesLoaded"),MINECRAFT_FONTS_LOADED:new Ht("minecraftFontsLoaded"),BLOCKSTATE_REGISTRY_LOADED:new Ht("blockstateRegistryLoaded"),PRE_SELECT_PROJECT:new Ht("preSelectProject"),SELECT_PROJECT:new Ht("selectProject"),UNSELECT_PROJECT:new Ht("deselectProject"),SELECT_AJ_PROJECT:new Ht("selectAJProject"),UNSELECT_AJ_PROJECT:new Ht("unselectAJProject"),CREATE_VARIANT:new Ht("createVariant"),UPDATE_VARIANT:new Ht("updateVariant"),DELETE_VARIANT:new Ht("deleteVariant"),SELECT_VARIANT:new Ht("selectVariant"),SELECT_KEYFRAME:new Ht("selectKeyframe"),UNSELECT_KEYFRAME:new Ht("unselectKeyframe"),UPDATE_SELECTION:new Ht("updateSelection")};function E_(){console.groupCollapsed(`Injecting BlockbenchMods added by '${Ts}'`),te.INJECT_MODS.dispatch(),console.groupEnd()}s(E_,"injectionHandler");function T_(){console.groupCollapsed(`Extracting BlockbenchMods added by '${Ts}'`),te.EXTRACT_MODS.dispatch(),console.groupEnd()}s(T_,"extractionHandler");te.LOAD.subscribe(E_);te.UNLOAD.subscribe(T_);te.INSTALL.subscribe(E_);te.UNINSTALL.subscribe(T_);Blockbench.on("select_project",({project:n})=>{te.SELECT_PROJECT.dispatch(n)});Blockbench.on("unselect_project",({project:n})=>{te.UNSELECT_PROJECT.dispatch(n)});Blockbench.on("update_selection",()=>te.UPDATE_SELECTION.dispatch());var Kd={};vn(Kd,{"animated_java.action.create_text_display.title":()=>bw,"animated_java.action.create_vanilla_block_display.title":()=>yw,"animated_java.action.create_vanilla_item_display.title":()=>vw,"animated_java.action.export.name":()=>hw,"animated_java.action.open_about.name":()=>mw,"animated_java.action.open_blueprint_settings.name":()=>dw,"animated_java.action.open_bone_config.name":()=>pw,"animated_java.action.open_documentation.name":()=>fw,"animated_java.action.open_locator_config.name":()=>_w,"animated_java.action.open_text_display_config.name":()=>gw,"animated_java.action.open_vanilla_block_display_config.name":()=>xw,"animated_java.action.open_vanilla_item_display_config.name":()=>ww,"animated_java.action.upgrade_old_aj_model_loader.body":()=>_5,"animated_java.action.upgrade_old_aj_model_loader.button":()=>g5,"animated_java.action.upgrade_old_aj_model_loader.name":()=>f5,"animated_java.action.upgrade_old_aj_model_loader.select_file":()=>p5,"animated_java.action.variants.create":()=>H5,"animated_java.action.variants.delete":()=>q5,"animated_java.action.variants.duplicate":()=>$5,"animated_java.action.variants.open_config":()=>K5,"animated_java.animation.excluded_nodes":()=>W5,"animated_java.animation.invert_excluded_nodes":()=>Z5,"animated_java.block_model_manager.facing_warning":()=>uT,"animated_java.block_model_manager.fluid_warning":()=>lT,"animated_java.block_model_manager.mob_head_warning":()=>cT,"animated_java.dialog.about.close_button":()=>Aw,"animated_java.dialog.about.title":()=>Cw,"animated_java.dialog.animation_properties.animation_name.description":()=>v5,"animated_java.dialog.animation_properties.animation_name.error.empty":()=>T5,"animated_java.dialog.animation_properties.animation_name.error.invalid_characters":()=>C5,"animated_java.dialog.animation_properties.animation_name.title":()=>b5,"animated_java.dialog.animation_properties.bone_lists.description":()=>j5,"animated_java.dialog.animation_properties.excluded_nodes.description":()=>O5,"animated_java.dialog.animation_properties.excluded_nodes.title":()=>I5,"animated_java.dialog.animation_properties.included_nodes.description":()=>B5,"animated_java.dialog.animation_properties.included_nodes.title":()=>N5,"animated_java.dialog.animation_properties.loop_delay.description":()=>S5,"animated_java.dialog.animation_properties.loop_delay.title":()=>A5,"animated_java.dialog.animation_properties.loop_mode.description":()=>w5,"animated_java.dialog.animation_properties.loop_mode.options.hold":()=>k5,"animated_java.dialog.animation_properties.loop_mode.options.loop":()=>E5,"animated_java.dialog.animation_properties.loop_mode.options.once":()=>x5,"animated_java.dialog.animation_properties.loop_mode.title":()=>y5,"animated_java.dialog.animation_properties.swap_columns_button.tooltip":()=>D5,"animated_java.dialog.animation_properties.title":()=>h5,"animated_java.dialog.blueprint_loading.title":()=>M5,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.file_does_not_exist":()=>Fx,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.no_file_selected":()=>Mx,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.not_a_file":()=>Lx,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.description":()=>Vx,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.folder_does_not_exist":()=>Ux,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.no_folder_selected":()=>zx,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.not_a_folder":()=>Gx,"animated_java.dialog.blueprint_settings.advanced_settings_warning":()=>Dw,"animated_java.dialog.blueprint_settings.auto_bounding_box.description":()=>cx,"animated_java.dialog.blueprint_settings.auto_bounding_box.title":()=>lx,"animated_java.dialog.blueprint_settings.baked_animations.description":()=>_k,"animated_java.dialog.blueprint_settings.baked_animations.title":()=>pk,"animated_java.dialog.blueprint_settings.blueprint_name.description":()=>Mw,"animated_java.dialog.blueprint_settings.blueprint_name.title":()=>Rw,"animated_java.dialog.blueprint_settings.bounding_box.description":()=>dx,"animated_java.dialog.blueprint_settings.bounding_box.title":()=>ux,"animated_java.dialog.blueprint_settings.custom_model_data_offset.description":()=>xx,"animated_java.dialog.blueprint_settings.custom_model_data_offset.title":()=>wx,"animated_java.dialog.blueprint_settings.data_pack.description":()=>Zx,"animated_java.dialog.blueprint_settings.data_pack.error.folder_does_not_exist":()=>Yx,"animated_java.dialog.blueprint_settings.data_pack.error.missing_data_folder":()=>tk,"animated_java.dialog.blueprint_settings.data_pack.error.missing_pack_mcmeta":()=>ek,"animated_java.dialog.blueprint_settings.data_pack.error.no_folder_selected":()=>Xx,"animated_java.dialog.blueprint_settings.data_pack.error.not_a_folder":()=>Qx,"animated_java.dialog.blueprint_settings.data_pack.title":()=>Wx,"animated_java.dialog.blueprint_settings.data_pack_export_mode.description":()=>nx,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.none":()=>ax,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.raw":()=>ix,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.zip":()=>rx,"animated_java.dialog.blueprint_settings.data_pack_export_mode.title":()=>tx,"animated_java.dialog.blueprint_settings.data_pack_settings.title":()=>$x,"animated_java.dialog.blueprint_settings.data_pack_zip.description":()=>ik,"animated_java.dialog.blueprint_settings.data_pack_zip.error.no_file_selected":()=>rk,"animated_java.dialog.blueprint_settings.data_pack_zip.error.not_a_file":()=>ak,"animated_java.dialog.blueprint_settings.data_pack_zip.title":()=>nk,"animated_java.dialog.blueprint_settings.display_item.description":()=>gx,"animated_java.dialog.blueprint_settings.display_item.error.invalid_item_id.no_namespace":()=>bx,"animated_java.dialog.blueprint_settings.display_item.error.invalid_item_id.whitespace":()=>vx,"animated_java.dialog.blueprint_settings.display_item.error.no_item_selected":()=>hx,"animated_java.dialog.blueprint_settings.display_item.title":()=>_x,"animated_java.dialog.blueprint_settings.display_item.warning.item_does_not_exist":()=>yx,"animated_java.dialog.blueprint_settings.display_item_path.description":()=>Rx,"animated_java.dialog.blueprint_settings.display_item_path.title":()=>Dx,"animated_java.dialog.blueprint_settings.enable_advanced_data_pack_settings.description":()=>qx,"animated_java.dialog.blueprint_settings.enable_advanced_data_pack_settings.title":()=>Kx,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_settings.description":()=>px,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_settings.title":()=>mx,"animated_java.dialog.blueprint_settings.enable_plugin_mode.description":()=>Ww,"animated_java.dialog.blueprint_settings.enable_plugin_mode.title":()=>qw,"animated_java.dialog.blueprint_settings.export_namespace.description":()=>Jw,"animated_java.dialog.blueprint_settings.export_namespace.error.empty":()=>Hw,"animated_java.dialog.blueprint_settings.export_namespace.error.invalid_characters":()=>Kw,"animated_java.dialog.blueprint_settings.export_namespace.error.reserved":()=>$w,"animated_java.dialog.blueprint_settings.export_namespace.title":()=>Gw,"animated_java.dialog.blueprint_settings.export_settings.title":()=>Uw,"animated_java.dialog.blueprint_settings.interpolation_duration.description":()=>ck,"animated_java.dialog.blueprint_settings.interpolation_duration.title":()=>lk,"animated_java.dialog.blueprint_settings.json_file.description":()=>hk,"animated_java.dialog.blueprint_settings.json_file.error.no_file_selected":()=>bk,"animated_java.dialog.blueprint_settings.json_file.error.not_a_file":()=>vk,"animated_java.dialog.blueprint_settings.json_file.title":()=>gk,"animated_java.dialog.blueprint_settings.model_folder.title":()=>Px,"animated_java.dialog.blueprint_settings.resource_pack.description":()=>Ex,"animated_java.dialog.blueprint_settings.resource_pack.error.folder_does_not_exist":()=>Cx,"animated_java.dialog.blueprint_settings.resource_pack.error.missing_assets_folder":()=>jx,"animated_java.dialog.blueprint_settings.resource_pack.error.missing_pack_mcmeta":()=>Sx,"animated_java.dialog.blueprint_settings.resource_pack.error.no_folder_selected":()=>Tx,"animated_java.dialog.blueprint_settings.resource_pack.error.not_a_folder":()=>Ax,"animated_java.dialog.blueprint_settings.resource_pack.title":()=>kx,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.description":()=>Xw,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.none":()=>ex,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.raw":()=>Yw,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.zip":()=>Qw,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.title":()=>Zw,"animated_java.dialog.blueprint_settings.resource_pack_settings.title":()=>fx,"animated_java.dialog.blueprint_settings.resource_pack_zip.description":()=>Ox,"animated_java.dialog.blueprint_settings.resource_pack_zip.error.no_file_selected":()=>Nx,"animated_java.dialog.blueprint_settings.resource_pack_zip.error.not_a_file":()=>Bx,"animated_java.dialog.blueprint_settings.resource_pack_zip.title":()=>Ix,"animated_java.dialog.blueprint_settings.show_bounding_box.description":()=>sx,"animated_java.dialog.blueprint_settings.show_bounding_box.title":()=>ox,"animated_java.dialog.blueprint_settings.summon_commands.description":()=>sk,"animated_java.dialog.blueprint_settings.summon_commands.title":()=>ok,"animated_java.dialog.blueprint_settings.teleportation_duration.description":()=>dk,"animated_java.dialog.blueprint_settings.teleportation_duration.title":()=>uk,"animated_java.dialog.blueprint_settings.texture_folder.description":()=>Hx,"animated_java.dialog.blueprint_settings.texture_folder.title":()=>Jx,"animated_java.dialog.blueprint_settings.texture_size.description":()=>Lw,"animated_java.dialog.blueprint_settings.texture_size.title":()=>Fw,"animated_java.dialog.blueprint_settings.texture_size.warning.does_not_match_largest_texture":()=>zw,"animated_java.dialog.blueprint_settings.texture_size.warning.not_a_power_of_2":()=>Vw,"animated_java.dialog.blueprint_settings.texture_size.warning.not_square":()=>Pw,"animated_java.dialog.blueprint_settings.title":()=>Bw,"animated_java.dialog.blueprint_settings.use_storage_for_animation.description":()=>mk,"animated_java.dialog.blueprint_settings.use_storage_for_animation.title":()=>fk,"animated_java.dialog.bone_config.billboard.description":()=>Yk,"animated_java.dialog.bone_config.billboard.options.center":()=>n2,"animated_java.dialog.bone_config.billboard.options.fixed":()=>Qk,"animated_java.dialog.bone_config.billboard.options.horizontal":()=>t2,"animated_java.dialog.bone_config.billboard.options.vertical":()=>e2,"animated_java.dialog.bone_config.billboard.title":()=>Xk,"animated_java.dialog.bone_config.brightness_override.description":()=>Uk,"animated_java.dialog.bone_config.brightness_override.title":()=>zk,"animated_java.dialog.bone_config.default_variant_subtitle":()=>xk,"animated_java.dialog.bone_config.enchanted.description":()=>Jk,"animated_java.dialog.bone_config.enchanted.title":()=>Gk,"animated_java.dialog.bone_config.glow_color.description":()=>Dk,"animated_java.dialog.bone_config.glow_color.title":()=>Bk,"animated_java.dialog.bone_config.glowing.description":()=>Ik,"animated_java.dialog.bone_config.glowing.title":()=>jk,"animated_java.dialog.bone_config.inherit_settings.description":()=>Sk,"animated_java.dialog.bone_config.inherit_settings.title":()=>Ak,"animated_java.dialog.bone_config.invisible.description":()=>$k,"animated_java.dialog.bone_config.invisible.title":()=>Hk,"animated_java.dialog.bone_config.nbt.description":()=>qk,"animated_java.dialog.bone_config.nbt.invalid_nbt.error":()=>Zk,"animated_java.dialog.bone_config.nbt.invalid_nbt.not_compound":()=>Wk,"animated_java.dialog.bone_config.nbt.title":()=>Kk,"animated_java.dialog.bone_config.override_brightness.description":()=>Vk,"animated_java.dialog.bone_config.override_brightness.title":()=>Pk,"animated_java.dialog.bone_config.override_glow_color.description":()=>Nk,"animated_java.dialog.bone_config.override_glow_color.title":()=>Ok,"animated_java.dialog.bone_config.selected_variant":()=>wk,"animated_java.dialog.bone_config.selected_variant_subtitle":()=>kk,"animated_java.dialog.bone_config.shadow_radius.description":()=>Mk,"animated_java.dialog.bone_config.shadow_radius.title":()=>Rk,"animated_java.dialog.bone_config.shadow_strength.description":()=>Lk,"animated_java.dialog.bone_config.shadow_strength.title":()=>Fk,"animated_java.dialog.bone_config.title":()=>yk,"animated_java.dialog.bone_config.use_nbt.description":()=>Tk,"animated_java.dialog.bone_config.use_nbt.title":()=>Ek,"animated_java.dialog.bone_config.use_nbt.use_nbt_warning":()=>Ck,"animated_java.dialog.bone_config.vanilla_item_model.description":()=>h2,"animated_java.dialog.bone_config.vanilla_item_model.title":()=>g2,"animated_java.dialog.export_progress.title":()=>R5,"animated_java.dialog.locator_config.entity_type.description":()=>l2,"animated_java.dialog.locator_config.entity_type.error.empty":()=>c2,"animated_java.dialog.locator_config.entity_type.title":()=>s2,"animated_java.dialog.locator_config.entity_type.warning.invalid":()=>u2,"animated_java.dialog.locator_config.plugin_mode_warning":()=>r2,"animated_java.dialog.locator_config.summon_commands.description":()=>f2,"animated_java.dialog.locator_config.summon_commands.title":()=>d2,"animated_java.dialog.locator_config.ticking_commands.description":()=>p2,"animated_java.dialog.locator_config.ticking_commands.title":()=>m2,"animated_java.dialog.locator_config.title":()=>i2,"animated_java.dialog.locator_config.use_entity.description":()=>o2,"animated_java.dialog.locator_config.use_entity.title":()=>a2,"animated_java.dialog.text_display_config.billboard.description":()=>U2,"animated_java.dialog.text_display_config.billboard.options.center":()=>$2,"animated_java.dialog.text_display_config.billboard.options.fixed":()=>G2,"animated_java.dialog.text_display_config.billboard.options.horizontal":()=>H2,"animated_java.dialog.text_display_config.billboard.options.vertical":()=>J2,"animated_java.dialog.text_display_config.billboard.title":()=>z2,"animated_java.dialog.text_display_config.brightness_override.description":()=>M2,"animated_java.dialog.text_display_config.brightness_override.title":()=>R2,"animated_java.dialog.text_display_config.glow_color.description":()=>S2,"animated_java.dialog.text_display_config.glow_color.title":()=>A2,"animated_java.dialog.text_display_config.glowing.description":()=>E2,"animated_java.dialog.text_display_config.glowing.title":()=>k2,"animated_java.dialog.text_display_config.inherit_settings.description":()=>x2,"animated_java.dialog.text_display_config.inherit_settings.title":()=>w2,"animated_java.dialog.text_display_config.invisible.description":()=>L2,"animated_java.dialog.text_display_config.invisible.title":()=>F2,"animated_java.dialog.text_display_config.nbt.description":()=>V2,"animated_java.dialog.text_display_config.nbt.title":()=>P2,"animated_java.dialog.text_display_config.override_brightness.description":()=>D2,"animated_java.dialog.text_display_config.override_brightness.title":()=>B2,"animated_java.dialog.text_display_config.override_glow_color.description":()=>C2,"animated_java.dialog.text_display_config.override_glow_color.title":()=>T2,"animated_java.dialog.text_display_config.shadow_radius.description":()=>I2,"animated_java.dialog.text_display_config.shadow_radius.title":()=>j2,"animated_java.dialog.text_display_config.shadow_strength.description":()=>N2,"animated_java.dialog.text_display_config.shadow_strength.title":()=>O2,"animated_java.dialog.text_display_config.title":()=>_2,"animated_java.dialog.text_display_config.use_nbt.description":()=>v2,"animated_java.dialog.text_display_config.use_nbt.title":()=>b2,"animated_java.dialog.text_display_config.use_nbt.use_nbt_warning":()=>y2,"animated_java.dialog.unexpected_error.close_button":()=>jw,"animated_java.dialog.unexpected_error.copy_error_message_button.description":()=>Ow,"animated_java.dialog.unexpected_error.copy_error_message_button.message":()=>Iw,"animated_java.dialog.unexpected_error.paragraph":()=>Nw,"animated_java.dialog.unexpected_error.title":()=>Sw,"animated_java.dialog.upgrade_old_aj_model_loader.title":()=>m5,"animated_java.dialog.vanilla_block_display_config.title":()=>K2,"animated_java.dialog.vanilla_item_display_config.title":()=>q2,"animated_java.dialog.variant_config.bone_lists.description":()=>o5,"animated_java.dialog.variant_config.excluded_nodes.description":()=>l5,"animated_java.dialog.variant_config.excluded_nodes.title":()=>s5,"animated_java.dialog.variant_config.generate_name_from_display_name":()=>Y2,"animated_java.dialog.variant_config.generate_name_from_display_name.description":()=>Q2,"animated_java.dialog.variant_config.included_nodes.description":()=>u5,"animated_java.dialog.variant_config.included_nodes.title":()=>c5,"animated_java.dialog.variant_config.swap_columns_button.tooltip":()=>d5,"animated_java.dialog.variant_config.texture_map.create_new_mapping":()=>r5,"animated_java.dialog.variant_config.texture_map.description":()=>i5,"animated_java.dialog.variant_config.texture_map.no_mappings":()=>a5,"animated_java.dialog.variant_config.texture_map.title":()=>n5,"animated_java.dialog.variant_config.title":()=>W2,"animated_java.dialog.variant_config.variant_display_name":()=>Z2,"animated_java.dialog.variant_config.variant_display_name.description":()=>X2,"animated_java.dialog.variant_config.variant_name":()=>e5,"animated_java.dialog.variant_config.variant_name.description":()=>t5,"animated_java.effect_animator.keyframes.commands":()=>eE,"animated_java.effect_animator.keyframes.execute_condition":()=>tE,"animated_java.effect_animator.keyframes.variant":()=>Q5,"animated_java.effect_animator.timeline.commands":()=>Y5,"animated_java.effect_animator.timeline.variant":()=>X5,"animated_java.error.blueprint_export_path_doesnt_exist.description":()=>fT,"animated_java.error.blueprint_export_path_doesnt_exist.title":()=>dT,"animated_java.format_category.animated_java":()=>sT,"animated_java.misc.failed_to_export.blueprint_settings.error_item":()=>aT,"animated_java.misc.failed_to_export.blueprint_settings.message":()=>rT,"animated_java.misc.failed_to_export.button":()=>oT,"animated_java.misc.failed_to_export.custom_models.message":()=>iT,"animated_java.misc.failed_to_export.title":()=>nT,"animated_java.panel.keyframe.commands.description":()=>oE,"animated_java.panel.keyframe.commands.title":()=>aE,"animated_java.panel.keyframe.easing_args.description":()=>NE,"animated_java.panel.keyframe.easing_args.easing_arg.back.description":()=>ME,"animated_java.panel.keyframe.easing_args.easing_arg.back.title":()=>RE,"animated_java.panel.keyframe.easing_args.easing_arg.bounce.description":()=>LE,"animated_java.panel.keyframe.easing_args.easing_arg.bounce.title":()=>FE,"animated_java.panel.keyframe.easing_args.easing_arg.elastic.description":()=>DE,"animated_java.panel.keyframe.easing_args.easing_arg.elastic.title":()=>BE,"animated_java.panel.keyframe.easing_args.title":()=>OE,"animated_java.panel.keyframe.easing_mode.description":()=>AE,"animated_java.panel.keyframe.easing_mode.options.in":()=>SE,"animated_java.panel.keyframe.easing_mode.options.inout":()=>IE,"animated_java.panel.keyframe.easing_mode.options.out":()=>jE,"animated_java.panel.keyframe.easing_mode.title":()=>CE,"animated_java.panel.keyframe.easing_type.description":()=>pE,"animated_java.panel.keyframe.easing_type.options.back":()=>EE,"animated_java.panel.keyframe.easing_type.options.bounce":()=>TE,"animated_java.panel.keyframe.easing_type.options.circ":()=>xE,"animated_java.panel.keyframe.easing_type.options.cubic":()=>bE,"animated_java.panel.keyframe.easing_type.options.elastic":()=>kE,"animated_java.panel.keyframe.easing_type.options.expo":()=>wE,"animated_java.panel.keyframe.easing_type.options.linear":()=>_E,"animated_java.panel.keyframe.easing_type.options.quad":()=>hE,"animated_java.panel.keyframe.easing_type.options.quart":()=>vE,"animated_java.panel.keyframe.easing_type.options.quint":()=>yE,"animated_java.panel.keyframe.easing_type.options.sine":()=>gE,"animated_java.panel.keyframe.easing_type.title":()=>mE,"animated_java.panel.keyframe.execute_condition.description":()=>lE,"animated_java.panel.keyframe.execute_condition.title":()=>sE,"animated_java.panel.keyframe.keyframe_title":()=>nE,"animated_java.panel.keyframe.repeat.description":()=>uE,"animated_java.panel.keyframe.repeat.title":()=>cE,"animated_java.panel.keyframe.repeat_frequency.description":()=>fE,"animated_java.panel.keyframe.repeat_frequency.title":()=>dE,"animated_java.panel.keyframe.variant.description":()=>rE,"animated_java.panel.keyframe.variant.title":()=>iE,"animated_java.panel.text_display.title":()=>PE,"animated_java.panel.vanilla_block_display.description":()=>eT,"animated_java.panel.vanilla_block_display.title":()=>QE,"animated_java.panel.vanilla_item_display.description":()=>YE,"animated_java.panel.vanilla_item_display.title":()=>XE,"animated_java.panel.variants.title":()=>F5,"animated_java.panel.variants.tool.cannot_delete_default_variant":()=>J5,"animated_java.panel.variants.tool.create_new_variant":()=>L5,"animated_java.panel.variants.tool.delete_selected_variant":()=>z5,"animated_java.panel.variants.tool.duplicate_selected_variant":()=>V5,"animated_java.panel.variants.tool.edit_variant":()=>P5,"animated_java.panel.variants.tool.variant_not_visible":()=>G5,"animated_java.panel.variants.tool.variant_visible":()=>U5,"animated_java.popup.loading.loading":()=>kw,"animated_java.popup.loading.offline":()=>Tw,"animated_java.popup.loading.success":()=>Ew,"animated_java.tool.text_display.background_color.description":()=>GE,"animated_java.tool.text_display.background_color.title":()=>UE,"animated_java.tool.text_display.line_width.description":()=>zE,"animated_java.tool.text_display.line_width.title":()=>VE,"animated_java.tool.text_display.text_alignment.description":()=>KE,"animated_java.tool.text_display.text_alignment.options.center":()=>WE,"animated_java.tool.text_display.text_alignment.options.left":()=>qE,"animated_java.tool.text_display.text_alignment.options.right":()=>ZE,"animated_java.tool.text_display.text_alignment.title":()=>$E,"animated_java.tool.text_display.text_shadow.description":()=>HE,"animated_java.tool.text_display.text_shadow.title":()=>JE,"animated_java.vanilla_item_display.title":()=>tT,default:()=>mT});var dw="Blaupause-Einstellungen",fw="Dokumentation",mw="Plugin Info",pw="Knochen-Konfiguration",_w="Locator-Konfiguration",gw="Textanzeige-Konfiguration",hw="Projekt exportieren",bw="Textanzeige hinzuf\xFCgen",vw="Vanilla Itemanzeige hinzuf\xFCgen",yw="Vanilla Blockanzeige hinzuf\xFCgen",ww="Vanilla Itemanzeige-Konfiguration",xw="Vanilla Blockanzeige-Konfiguration",kw="Animated Java wird geladen...",Ew="Animated Java wurde erfolgreich geladen!",Tw=`Animated Java konnte sich nicht verbinden! -Einige Funktionen sind m\xF6glicherweise nicht verf\xFCgbar.`,Cw="\xDCber Animated Java",Aw="Schlie\xDFen",Sw="Ein unerwarteter Fehler tritt auf!",jw="Schlie\xDFen",Iw="Fehlermeldung wurde in die Zwischenablage kopiert!",Ow="Klicken Sie, um die Fehlermeldung in die Zwischenablage zu kopieren.",Nw="Bitte melden Sie diesen Fehler, indem Sie unserem {0} beitreten und einen Beitrag im #animated-java-support Kanal erstellen, oder indem Sie ein Issue auf unserem {1} erstellen. Danke!",Bw="Blaupause-Einstellungen",Dw="Erweiterte Einstellungen sollten nur verwendet werden, wenn sie unbedingt erforderlich sind!",Rw="Blaupausenname",Mw="Der name der Blaupause. Wird nur verwendet, um das Projekt im Arbeitsbereich zu identifizieren.",Fw="Textur-Gr\xF6\xDFe",Lw="Die Aufl\xF6sung des UV-Editors. Diese sollte die gleiche Gr\xF6\xDFe wie die gr\xF6\xDFte Textur sein. Die besten Ergebnisse erzielen Sie mit einer quadratischen Aufl\xF6sung, wobei die Gr\xF6\xDFe eine Potenz von 2 ist.",Pw="Die Textur-Gr\xF6\xDFe sollte quadratisch sein f\xFCr die besten Ergebnisse.",Vw="Die Textur-Gr\xF6\xDFe sollte eine Potenz von 2 sein f\xFCr die besten Ergebnisse.",zw="Die Textur-Gr\xF6\xDFe sollte mit der Gr\xF6\xDFe der gr\xF6\xDFten Textur \xFCbereinstimmen.",Uw="Export-Einstellungen",Gw="Export-Namespace",Jw="Der Namespace, in den das Projekt exportiert werden soll. Dies ist der Namespace, der im exportierten Ressourcenpaket und Datenpaket verwendet wird.",Hw="Der Export-Namespace darf nicht leer sein!",$w='Der Export-Namespace "{0}" ist f\xFCr interne Funktionen reserviert! Bitte w\xE4hlen Sie einen anderen Namespace.',Kw="Der Export-Namespace enth\xE4lt ung\xFCltige Zeichen! Ein Namespace darf nur Buchstaben, Nummern und Unterstriche enthalten.",qw="Plugin-Modus",Ww="Ob der Plugin-Modus aktiviert werden soll oder nicht. Aktivieren Sie diese Option, falls Sie die .ajblueprint Datei in einem Plugin anstelle eines Ressourcenpaket / Datenpakets verwenden m\xF6chten.",Zw="Ressourcenpaket Export-Modus",Xw=`Bestimmt, wie das Ressourcenpaket exportiert werden soll. +`,r)}while(i!==-1);return a+=n.substr(r),a},"stringEncaseCRLFWithFirstIndex");j1.exports={stringReplaceAll:lG,stringEncaseCRLFWithFirstIndex:cG}});var D1=gi((Ple,R1)=>{"use strict";var uG=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,O1=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,dG=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,fG=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,mG=new Map([["n",` +`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function B1(n){let e=n[0]==="u",t=n[1]==="{";return e&&!t&&n.length===5||n[0]==="x"&&n.length===3?String.fromCharCode(parseInt(n.slice(1),16)):e&&t?String.fromCodePoint(parseInt(n.slice(2,-1),16)):mG.get(n)||n}s(B1,"unescape");function pG(n,e){let t=[],i=e.trim().split(/\s*,\s*/g),r;for(let a of i){let o=Number(a);if(!Number.isNaN(o))t.push(o);else if(r=a.match(dG))t.push(r[2].replace(fG,(l,u,c)=>u?B1(u):c));else throw new Error(`Invalid Chalk template style argument: ${a} (in style '${n}')`)}return t}s(pG,"parseArguments");function _G(n){O1.lastIndex=0;let e=[],t;for(;(t=O1.exec(n))!==null;){let i=t[1];if(t[2]){let r=pG(i,t[2]);e.push([i].concat(r))}else e.push([i])}return e}s(_G,"parseStyle");function N1(n,e){let t={};for(let r of e)for(let a of r.styles)t[a[0]]=r.inverse?null:a.slice(1);let i=n;for(let[r,a]of Object.entries(t))if(Array.isArray(a)){if(!(r in i))throw new Error(`Unknown Chalk style: ${r}`);i=a.length>0?i[r](...a):i[r]}return i}s(N1,"buildStyle");R1.exports=(n,e)=>{let t=[],i=[],r=[];if(e.replace(uG,(a,o,l,u,c,d)=>{if(o)r.push(B1(o));else if(u){let m=r.join("");r=[],i.push(t.length===0?m:N1(n,t)(m)),t.push({inverse:l,styles:_G(u)})}else if(c){if(t.length===0)throw new Error("Found extraneous } in Chalk template literal");i.push(N1(n,t)(r.join(""))),r=[],t.pop()}else r.push(d)}),i.push(r.join("")),t.length>0){let a=`Chalk template literal is missing ${t.length} closing bracket${t.length===1?"":"s"} (\`}\`)`;throw new Error(a)}return i.join("")}});var G1=gi((zle,z1)=>{"use strict";var Xl=k1(),{stdout:bp,stderr:vp}=S1(),{stringReplaceAll:gG,stringEncaseCRLFWithFirstIndex:hG}=I1(),{isArray:rd}=Array,F1=["ansi","ansi","ansi256","ansi16m"],ys=Object.create(null),bG=s((n,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=bp?bp.level:0;n.level=e.level===void 0?t:e.level},"applyOptions"),id=class{constructor(e){return L1(e)}};s(id,"ChalkClass");var L1=s(n=>{let e={};return bG(e,n),e.template=(...t)=>V1(e.template,...t),Object.setPrototypeOf(e,ad.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=id,e.template},"chalkFactory");function ad(n){return L1(n)}s(ad,"Chalk");for(let[n,e]of Object.entries(Xl))ys[n]={get(){let t=od(this,yp(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,n,{value:t}),t}};ys.visible={get(){let n=od(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:n}),n}};var P1=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let n of P1)ys[n]={get(){let{level:e}=this;return function(...t){let i=yp(Xl.color[F1[e]][n](...t),Xl.color.close,this._styler);return od(this,i,this._isEmpty)}}};for(let n of P1){let e="bg"+n[0].toUpperCase()+n.slice(1);ys[e]={get(){let{level:t}=this;return function(...i){let r=yp(Xl.bgColor[F1[t]][n](...i),Xl.bgColor.close,this._styler);return od(this,r,this._isEmpty)}}}}var vG=Object.defineProperties(()=>{},{...ys,level:{enumerable:!0,get(){return this._generator.level},set(n){this._generator.level=n}}}),yp=s((n,e,t)=>{let i,r;return t===void 0?(i=n,r=e):(i=t.openAll+n,r=e+t.closeAll),{open:n,close:e,openAll:i,closeAll:r,parent:t}},"createStyler"),od=s((n,e,t)=>{let i=s((...r)=>rd(r[0])&&rd(r[0].raw)?M1(i,V1(i,...r)):M1(i,r.length===1?""+r[0]:r.join(" ")),"builder");return Object.setPrototypeOf(i,vG),i._generator=n,i._styler=e,i._isEmpty=t,i},"createBuilder"),M1=s((n,e)=>{if(n.level<=0||!e)return n._isEmpty?"":e;let t=n._styler;if(t===void 0)return e;let{openAll:i,closeAll:r}=t;if(e.indexOf("\x1B")!==-1)for(;t!==void 0;)e=gG(e,t.close,t.open),t=t.parent;let a=e.indexOf(` +`);return a!==-1&&(e=hG(e,r,i,a)),i+e+r},"applyStyle"),hp,V1=s((n,...e)=>{let[t]=e;if(!rd(t)||!rd(t.raw))return e.join(" ");let i=e.slice(1),r=[t.raw[0]];for(let a=1;a{e(r),this.subscribers.delete(i)},"wrappedCallback");this.subscribers.add(i)}else this.subscribers.add(e);return()=>this.subscribers.delete(e)}dispatch(e){this.dispatching||(this.dispatching=!0,this.subscribers.forEach(t=>t(e)),this.dispatching=!1)}};s(ia,"Subscribable");var af=class extends ia{constructor(t){super();this.name=t;af.events[t]=this}},Xt=af;s(Xt,"PluginEvent"),kt(Xt,"events",{});var re={LOAD:new Xt("load"),UNLOAD:new Xt("unload"),INSTALL:new Xt("install"),UNINSTALL:new Xt("uninstall"),INJECT_MODS:new Xt("injectMods"),EXTRACT_MODS:new Xt("extractMods"),NETWORK_CONNECTED:new Xt("networkConnected"),MINECRAFT_ASSETS_LOADED:new Xt("minecraftAssetsLoaded"),MINECRAFT_REGISTRY_LOADED:new Xt("minecraftRegistriesLoaded"),MINECRAFT_FONTS_LOADED:new Xt("minecraftFontsLoaded"),BLOCKSTATE_REGISTRY_LOADED:new Xt("blockstateRegistryLoaded"),PRE_SELECT_PROJECT:new Xt("preSelectProject"),SELECT_PROJECT:new Xt("selectProject"),UNSELECT_PROJECT:new Xt("deselectProject"),SELECT_AJ_PROJECT:new Xt("selectAJProject"),UNSELECT_AJ_PROJECT:new Xt("unselectAJProject"),CREATE_VARIANT:new Xt("createVariant"),UPDATE_VARIANT:new Xt("updateVariant"),DELETE_VARIANT:new Xt("deleteVariant"),SELECT_VARIANT:new Xt("selectVariant"),SELECT_KEYFRAME:new Xt("selectKeyframe"),UNSELECT_KEYFRAME:new Xt("unselectKeyframe"),UPDATE_SELECTION:new Xt("updateSelection")};function z_(){console.groupCollapsed(`Injecting BlockbenchMods added by '${Ns}'`),re.INJECT_MODS.dispatch(),console.groupEnd()}s(z_,"injectionHandler");function G_(){console.groupCollapsed(`Extracting BlockbenchMods added by '${Ns}'`),re.EXTRACT_MODS.dispatch(),console.groupEnd()}s(G_,"extractionHandler");re.LOAD.subscribe(z_);re.UNLOAD.subscribe(G_);re.INSTALL.subscribe(z_);re.UNINSTALL.subscribe(G_);Blockbench.on("select_project",({project:n})=>{re.SELECT_PROJECT.dispatch(n)});Blockbench.on("unselect_project",({project:n})=>{re.UNSELECT_PROJECT.dispatch(n)});Blockbench.on("update_selection",()=>re.UPDATE_SELECTION.dispatch());var of={};xn(of,{"animated_java.action.create_text_display.title":()=>Zw,"animated_java.action.create_vanilla_block_display.title":()=>Yw,"animated_java.action.create_vanilla_item_display.title":()=>Xw,"animated_java.action.export.name":()=>Ww,"animated_java.action.open_about.name":()=>Hw,"animated_java.action.open_blueprint_settings.name":()=>Uw,"animated_java.action.open_bone_config.name":()=>$w,"animated_java.action.open_documentation.name":()=>Jw,"animated_java.action.open_locator_config.name":()=>qw,"animated_java.action.open_text_display_config.name":()=>Kw,"animated_java.action.open_vanilla_block_display_config.name":()=>ex,"animated_java.action.open_vanilla_item_display_config.name":()=>Qw,"animated_java.action.upgrade_old_aj_model_loader.body":()=>q5,"animated_java.action.upgrade_old_aj_model_loader.button":()=>K5,"animated_java.action.upgrade_old_aj_model_loader.name":()=>J5,"animated_java.action.upgrade_old_aj_model_loader.select_file":()=>$5,"animated_java.action.variants.create":()=>kE,"animated_java.action.variants.delete":()=>CE,"animated_java.action.variants.duplicate":()=>EE,"animated_java.action.variants.open_config":()=>TE,"animated_java.animation.excluded_nodes":()=>AE,"animated_java.animation.invert_excluded_nodes":()=>SE,"animated_java.block_model_manager.facing_warning":()=>GT,"animated_java.block_model_manager.fluid_warning":()=>VT,"animated_java.block_model_manager.mob_head_warning":()=>zT,"animated_java.dialog.about.close_button":()=>ax,"animated_java.dialog.about.title":()=>rx,"animated_java.dialog.animation_properties.animation_name.description":()=>X5,"animated_java.dialog.animation_properties.animation_name.error.empty":()=>iE,"animated_java.dialog.animation_properties.animation_name.error.invalid_characters":()=>rE,"animated_java.dialog.animation_properties.animation_name.title":()=>Z5,"animated_java.dialog.animation_properties.bone_lists.description":()=>sE,"animated_java.dialog.animation_properties.excluded_nodes.description":()=>cE,"animated_java.dialog.animation_properties.excluded_nodes.title":()=>lE,"animated_java.dialog.animation_properties.included_nodes.description":()=>dE,"animated_java.dialog.animation_properties.included_nodes.title":()=>uE,"animated_java.dialog.animation_properties.loop_delay.description":()=>oE,"animated_java.dialog.animation_properties.loop_delay.title":()=>aE,"animated_java.dialog.animation_properties.loop_mode.description":()=>Q5,"animated_java.dialog.animation_properties.loop_mode.options.hold":()=>tE,"animated_java.dialog.animation_properties.loop_mode.options.loop":()=>nE,"animated_java.dialog.animation_properties.loop_mode.options.once":()=>eE,"animated_java.dialog.animation_properties.loop_mode.title":()=>Y5,"animated_java.dialog.animation_properties.swap_columns_button.tooltip":()=>fE,"animated_java.dialog.animation_properties.title":()=>W5,"animated_java.dialog.blueprint_loading.title":()=>pE,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.file_does_not_exist":()=>_k,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.no_file_selected":()=>pk,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.not_a_file":()=>gk,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.description":()=>bk,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.folder_does_not_exist":()=>yk,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.no_folder_selected":()=>vk,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.not_a_folder":()=>wk,"animated_java.dialog.blueprint_settings.advanced_settings_warning":()=>fx,"animated_java.dialog.blueprint_settings.auto_bounding_box.description":()=>zx,"animated_java.dialog.blueprint_settings.auto_bounding_box.title":()=>Vx,"animated_java.dialog.blueprint_settings.baked_animations.description":()=>qk,"animated_java.dialog.blueprint_settings.baked_animations.title":()=>$k,"animated_java.dialog.blueprint_settings.blueprint_name.description":()=>px,"animated_java.dialog.blueprint_settings.blueprint_name.title":()=>mx,"animated_java.dialog.blueprint_settings.bounding_box.description":()=>Ux,"animated_java.dialog.blueprint_settings.bounding_box.title":()=>Gx,"animated_java.dialog.blueprint_settings.custom_model_data_offset.description":()=>ek,"animated_java.dialog.blueprint_settings.custom_model_data_offset.title":()=>Qx,"animated_java.dialog.blueprint_settings.data_pack.description":()=>Sk,"animated_java.dialog.blueprint_settings.data_pack.error.folder_does_not_exist":()=>Ik,"animated_java.dialog.blueprint_settings.data_pack.error.missing_data_folder":()=>Bk,"animated_java.dialog.blueprint_settings.data_pack.error.missing_pack_mcmeta":()=>Nk,"animated_java.dialog.blueprint_settings.data_pack.error.no_folder_selected":()=>jk,"animated_java.dialog.blueprint_settings.data_pack.error.not_a_folder":()=>Ok,"animated_java.dialog.blueprint_settings.data_pack.title":()=>Ak,"animated_java.dialog.blueprint_settings.data_pack_export_mode.description":()=>Rx,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.none":()=>Fx,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.raw":()=>Dx,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.zip":()=>Mx,"animated_java.dialog.blueprint_settings.data_pack_export_mode.title":()=>Bx,"animated_java.dialog.blueprint_settings.data_pack_settings.title":()=>Ek,"animated_java.dialog.blueprint_settings.data_pack_zip.description":()=>Dk,"animated_java.dialog.blueprint_settings.data_pack_zip.error.no_file_selected":()=>Mk,"animated_java.dialog.blueprint_settings.data_pack_zip.error.not_a_file":()=>Fk,"animated_java.dialog.blueprint_settings.data_pack_zip.title":()=>Rk,"animated_java.dialog.blueprint_settings.display_item.description":()=>Kx,"animated_java.dialog.blueprint_settings.display_item.error.invalid_item_id.no_namespace":()=>Zx,"animated_java.dialog.blueprint_settings.display_item.error.invalid_item_id.whitespace":()=>Xx,"animated_java.dialog.blueprint_settings.display_item.error.no_item_selected":()=>Wx,"animated_java.dialog.blueprint_settings.display_item.title":()=>qx,"animated_java.dialog.blueprint_settings.display_item.warning.item_does_not_exist":()=>Yx,"animated_java.dialog.blueprint_settings.display_item_path.description":()=>mk,"animated_java.dialog.blueprint_settings.display_item_path.title":()=>fk,"animated_java.dialog.blueprint_settings.enable_advanced_data_pack_settings.description":()=>Ck,"animated_java.dialog.blueprint_settings.enable_advanced_data_pack_settings.title":()=>Tk,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_settings.description":()=>$x,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_settings.title":()=>Hx,"animated_java.dialog.blueprint_settings.enable_plugin_mode.description":()=>Ax,"animated_java.dialog.blueprint_settings.enable_plugin_mode.title":()=>Cx,"animated_java.dialog.blueprint_settings.export_namespace.description":()=>xx,"animated_java.dialog.blueprint_settings.export_namespace.error.empty":()=>kx,"animated_java.dialog.blueprint_settings.export_namespace.error.invalid_characters":()=>Tx,"animated_java.dialog.blueprint_settings.export_namespace.error.reserved":()=>Ex,"animated_java.dialog.blueprint_settings.export_namespace.title":()=>wx,"animated_java.dialog.blueprint_settings.export_settings.title":()=>yx,"animated_java.dialog.blueprint_settings.interpolation_duration.description":()=>zk,"animated_java.dialog.blueprint_settings.interpolation_duration.title":()=>Vk,"animated_java.dialog.blueprint_settings.json_file.description":()=>Wk,"animated_java.dialog.blueprint_settings.json_file.error.no_file_selected":()=>Zk,"animated_java.dialog.blueprint_settings.json_file.error.not_a_file":()=>Xk,"animated_java.dialog.blueprint_settings.json_file.title":()=>Kk,"animated_java.dialog.blueprint_settings.model_folder.title":()=>hk,"animated_java.dialog.blueprint_settings.resource_pack.description":()=>nk,"animated_java.dialog.blueprint_settings.resource_pack.error.folder_does_not_exist":()=>rk,"animated_java.dialog.blueprint_settings.resource_pack.error.missing_assets_folder":()=>sk,"animated_java.dialog.blueprint_settings.resource_pack.error.missing_pack_mcmeta":()=>ok,"animated_java.dialog.blueprint_settings.resource_pack.error.no_folder_selected":()=>ik,"animated_java.dialog.blueprint_settings.resource_pack.error.not_a_folder":()=>ak,"animated_java.dialog.blueprint_settings.resource_pack.title":()=>tk,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.description":()=>jx,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.none":()=>Nx,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.raw":()=>Ix,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.zip":()=>Ox,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.title":()=>Sx,"animated_java.dialog.blueprint_settings.resource_pack_settings.title":()=>Jx,"animated_java.dialog.blueprint_settings.resource_pack_zip.description":()=>ck,"animated_java.dialog.blueprint_settings.resource_pack_zip.error.no_file_selected":()=>uk,"animated_java.dialog.blueprint_settings.resource_pack_zip.error.not_a_file":()=>dk,"animated_java.dialog.blueprint_settings.resource_pack_zip.title":()=>lk,"animated_java.dialog.blueprint_settings.show_bounding_box.description":()=>Px,"animated_java.dialog.blueprint_settings.show_bounding_box.title":()=>Lx,"animated_java.dialog.blueprint_settings.summon_commands.description":()=>Pk,"animated_java.dialog.blueprint_settings.summon_commands.title":()=>Lk,"animated_java.dialog.blueprint_settings.teleportation_duration.description":()=>Uk,"animated_java.dialog.blueprint_settings.teleportation_duration.title":()=>Gk,"animated_java.dialog.blueprint_settings.texture_folder.description":()=>kk,"animated_java.dialog.blueprint_settings.texture_folder.title":()=>xk,"animated_java.dialog.blueprint_settings.texture_size.description":()=>gx,"animated_java.dialog.blueprint_settings.texture_size.title":()=>_x,"animated_java.dialog.blueprint_settings.texture_size.warning.does_not_match_largest_texture":()=>vx,"animated_java.dialog.blueprint_settings.texture_size.warning.not_a_power_of_2":()=>bx,"animated_java.dialog.blueprint_settings.texture_size.warning.not_square":()=>hx,"animated_java.dialog.blueprint_settings.title":()=>dx,"animated_java.dialog.blueprint_settings.use_storage_for_animation.description":()=>Hk,"animated_java.dialog.blueprint_settings.use_storage_for_animation.title":()=>Jk,"animated_java.dialog.bone_config.billboard.description":()=>I2,"animated_java.dialog.bone_config.billboard.options.center":()=>R2,"animated_java.dialog.bone_config.billboard.options.fixed":()=>O2,"animated_java.dialog.bone_config.billboard.options.horizontal":()=>B2,"animated_java.dialog.bone_config.billboard.options.vertical":()=>N2,"animated_java.dialog.bone_config.billboard.title":()=>j2,"animated_java.dialog.bone_config.brightness_override.description":()=>y2,"animated_java.dialog.bone_config.brightness_override.title":()=>v2,"animated_java.dialog.bone_config.default_variant_subtitle":()=>e2,"animated_java.dialog.bone_config.enchanted.description":()=>x2,"animated_java.dialog.bone_config.enchanted.title":()=>w2,"animated_java.dialog.bone_config.glow_color.description":()=>f2,"animated_java.dialog.bone_config.glow_color.title":()=>d2,"animated_java.dialog.bone_config.glowing.description":()=>l2,"animated_java.dialog.bone_config.glowing.title":()=>s2,"animated_java.dialog.bone_config.inherit_settings.description":()=>o2,"animated_java.dialog.bone_config.inherit_settings.title":()=>a2,"animated_java.dialog.bone_config.invisible.description":()=>E2,"animated_java.dialog.bone_config.invisible.title":()=>k2,"animated_java.dialog.bone_config.nbt.description":()=>C2,"animated_java.dialog.bone_config.nbt.invalid_nbt.error":()=>S2,"animated_java.dialog.bone_config.nbt.invalid_nbt.not_compound":()=>A2,"animated_java.dialog.bone_config.nbt.title":()=>T2,"animated_java.dialog.bone_config.override_brightness.description":()=>b2,"animated_java.dialog.bone_config.override_brightness.title":()=>h2,"animated_java.dialog.bone_config.override_glow_color.description":()=>u2,"animated_java.dialog.bone_config.override_glow_color.title":()=>c2,"animated_java.dialog.bone_config.selected_variant":()=>Qk,"animated_java.dialog.bone_config.selected_variant_subtitle":()=>t2,"animated_java.dialog.bone_config.shadow_radius.description":()=>p2,"animated_java.dialog.bone_config.shadow_radius.title":()=>m2,"animated_java.dialog.bone_config.shadow_strength.description":()=>g2,"animated_java.dialog.bone_config.shadow_strength.title":()=>_2,"animated_java.dialog.bone_config.title":()=>Yk,"animated_java.dialog.bone_config.use_nbt.description":()=>i2,"animated_java.dialog.bone_config.use_nbt.title":()=>n2,"animated_java.dialog.bone_config.use_nbt.use_nbt_warning":()=>r2,"animated_java.dialog.bone_config.vanilla_item_model.description":()=>W2,"animated_java.dialog.bone_config.vanilla_item_model.title":()=>K2,"animated_java.dialog.export_progress.title":()=>mE,"animated_java.dialog.locator_config.entity_type.description":()=>V2,"animated_java.dialog.locator_config.entity_type.error.empty":()=>z2,"animated_java.dialog.locator_config.entity_type.title":()=>P2,"animated_java.dialog.locator_config.entity_type.warning.invalid":()=>G2,"animated_java.dialog.locator_config.plugin_mode_warning":()=>M2,"animated_java.dialog.locator_config.summon_commands.description":()=>J2,"animated_java.dialog.locator_config.summon_commands.title":()=>U2,"animated_java.dialog.locator_config.ticking_commands.description":()=>$2,"animated_java.dialog.locator_config.ticking_commands.title":()=>H2,"animated_java.dialog.locator_config.title":()=>D2,"animated_java.dialog.locator_config.use_entity.description":()=>L2,"animated_java.dialog.locator_config.use_entity.title":()=>F2,"animated_java.dialog.text_display_config.billboard.description":()=>y5,"animated_java.dialog.text_display_config.billboard.options.center":()=>E5,"animated_java.dialog.text_display_config.billboard.options.fixed":()=>w5,"animated_java.dialog.text_display_config.billboard.options.horizontal":()=>k5,"animated_java.dialog.text_display_config.billboard.options.vertical":()=>x5,"animated_java.dialog.text_display_config.billboard.title":()=>v5,"animated_java.dialog.text_display_config.brightness_override.description":()=>p5,"animated_java.dialog.text_display_config.brightness_override.title":()=>m5,"animated_java.dialog.text_display_config.glow_color.description":()=>o5,"animated_java.dialog.text_display_config.glow_color.title":()=>a5,"animated_java.dialog.text_display_config.glowing.description":()=>n5,"animated_java.dialog.text_display_config.glowing.title":()=>t5,"animated_java.dialog.text_display_config.inherit_settings.description":()=>e5,"animated_java.dialog.text_display_config.inherit_settings.title":()=>Q2,"animated_java.dialog.text_display_config.invisible.description":()=>g5,"animated_java.dialog.text_display_config.invisible.title":()=>_5,"animated_java.dialog.text_display_config.nbt.description":()=>b5,"animated_java.dialog.text_display_config.nbt.title":()=>h5,"animated_java.dialog.text_display_config.override_brightness.description":()=>f5,"animated_java.dialog.text_display_config.override_brightness.title":()=>d5,"animated_java.dialog.text_display_config.override_glow_color.description":()=>r5,"animated_java.dialog.text_display_config.override_glow_color.title":()=>i5,"animated_java.dialog.text_display_config.shadow_radius.description":()=>l5,"animated_java.dialog.text_display_config.shadow_radius.title":()=>s5,"animated_java.dialog.text_display_config.shadow_strength.description":()=>u5,"animated_java.dialog.text_display_config.shadow_strength.title":()=>c5,"animated_java.dialog.text_display_config.title":()=>q2,"animated_java.dialog.text_display_config.use_nbt.description":()=>X2,"animated_java.dialog.text_display_config.use_nbt.title":()=>Z2,"animated_java.dialog.text_display_config.use_nbt.use_nbt_warning":()=>Y2,"animated_java.dialog.unexpected_error.close_button":()=>sx,"animated_java.dialog.unexpected_error.copy_error_message_button.description":()=>cx,"animated_java.dialog.unexpected_error.copy_error_message_button.message":()=>lx,"animated_java.dialog.unexpected_error.paragraph":()=>ux,"animated_java.dialog.unexpected_error.title":()=>ox,"animated_java.dialog.upgrade_old_aj_model_loader.title":()=>H5,"animated_java.dialog.vanilla_block_display_config.title":()=>T5,"animated_java.dialog.vanilla_item_display_config.title":()=>C5,"animated_java.dialog.variant_config.bone_lists.description":()=>L5,"animated_java.dialog.variant_config.excluded_nodes.description":()=>V5,"animated_java.dialog.variant_config.excluded_nodes.title":()=>P5,"animated_java.dialog.variant_config.generate_name_from_display_name":()=>I5,"animated_java.dialog.variant_config.generate_name_from_display_name.description":()=>O5,"animated_java.dialog.variant_config.included_nodes.description":()=>G5,"animated_java.dialog.variant_config.included_nodes.title":()=>z5,"animated_java.dialog.variant_config.swap_columns_button.tooltip":()=>U5,"animated_java.dialog.variant_config.texture_map.create_new_mapping":()=>M5,"animated_java.dialog.variant_config.texture_map.description":()=>D5,"animated_java.dialog.variant_config.texture_map.no_mappings":()=>F5,"animated_java.dialog.variant_config.texture_map.title":()=>R5,"animated_java.dialog.variant_config.title":()=>A5,"animated_java.dialog.variant_config.variant_display_name":()=>S5,"animated_java.dialog.variant_config.variant_display_name.description":()=>j5,"animated_java.dialog.variant_config.variant_name":()=>N5,"animated_java.dialog.variant_config.variant_name.description":()=>B5,"animated_java.effect_animator.keyframes.commands":()=>NE,"animated_java.effect_animator.keyframes.execute_condition":()=>BE,"animated_java.effect_animator.keyframes.variant":()=>OE,"animated_java.effect_animator.timeline.commands":()=>IE,"animated_java.effect_animator.timeline.variant":()=>jE,"animated_java.error.blueprint_export_path_doesnt_exist.description":()=>JT,"animated_java.error.blueprint_export_path_doesnt_exist.title":()=>UT,"animated_java.format_category.animated_java":()=>PT,"animated_java.misc.failed_to_export.blueprint_settings.error_item":()=>FT,"animated_java.misc.failed_to_export.blueprint_settings.message":()=>MT,"animated_java.misc.failed_to_export.button":()=>LT,"animated_java.misc.failed_to_export.custom_models.message":()=>DT,"animated_java.misc.failed_to_export.title":()=>RT,"animated_java.panel.keyframe.commands.description":()=>LE,"animated_java.panel.keyframe.commands.title":()=>FE,"animated_java.panel.keyframe.easing_args.description":()=>uT,"animated_java.panel.keyframe.easing_args.easing_arg.back.description":()=>pT,"animated_java.panel.keyframe.easing_args.easing_arg.back.title":()=>mT,"animated_java.panel.keyframe.easing_args.easing_arg.bounce.description":()=>gT,"animated_java.panel.keyframe.easing_args.easing_arg.bounce.title":()=>_T,"animated_java.panel.keyframe.easing_args.easing_arg.elastic.description":()=>fT,"animated_java.panel.keyframe.easing_args.easing_arg.elastic.title":()=>dT,"animated_java.panel.keyframe.easing_args.title":()=>cT,"animated_java.panel.keyframe.easing_mode.description":()=>aT,"animated_java.panel.keyframe.easing_mode.options.in":()=>oT,"animated_java.panel.keyframe.easing_mode.options.inout":()=>lT,"animated_java.panel.keyframe.easing_mode.options.out":()=>sT,"animated_java.panel.keyframe.easing_mode.title":()=>rT,"animated_java.panel.keyframe.easing_type.description":()=>$E,"animated_java.panel.keyframe.easing_type.options.back":()=>nT,"animated_java.panel.keyframe.easing_type.options.bounce":()=>iT,"animated_java.panel.keyframe.easing_type.options.circ":()=>eT,"animated_java.panel.keyframe.easing_type.options.cubic":()=>ZE,"animated_java.panel.keyframe.easing_type.options.elastic":()=>tT,"animated_java.panel.keyframe.easing_type.options.expo":()=>QE,"animated_java.panel.keyframe.easing_type.options.linear":()=>qE,"animated_java.panel.keyframe.easing_type.options.quad":()=>WE,"animated_java.panel.keyframe.easing_type.options.quart":()=>XE,"animated_java.panel.keyframe.easing_type.options.quint":()=>YE,"animated_java.panel.keyframe.easing_type.options.sine":()=>KE,"animated_java.panel.keyframe.easing_type.title":()=>HE,"animated_java.panel.keyframe.execute_condition.description":()=>VE,"animated_java.panel.keyframe.execute_condition.title":()=>PE,"animated_java.panel.keyframe.keyframe_title":()=>RE,"animated_java.panel.keyframe.repeat.description":()=>GE,"animated_java.panel.keyframe.repeat.title":()=>zE,"animated_java.panel.keyframe.repeat_frequency.description":()=>JE,"animated_java.panel.keyframe.repeat_frequency.title":()=>UE,"animated_java.panel.keyframe.variant.description":()=>ME,"animated_java.panel.keyframe.variant.title":()=>DE,"animated_java.panel.text_display.title":()=>hT,"animated_java.panel.vanilla_block_display.description":()=>NT,"animated_java.panel.vanilla_block_display.title":()=>OT,"animated_java.panel.vanilla_item_display.description":()=>IT,"animated_java.panel.vanilla_item_display.title":()=>jT,"animated_java.panel.variants.title":()=>_E,"animated_java.panel.variants.tool.cannot_delete_default_variant":()=>xE,"animated_java.panel.variants.tool.create_new_variant":()=>gE,"animated_java.panel.variants.tool.delete_selected_variant":()=>vE,"animated_java.panel.variants.tool.duplicate_selected_variant":()=>bE,"animated_java.panel.variants.tool.edit_variant":()=>hE,"animated_java.panel.variants.tool.variant_not_visible":()=>wE,"animated_java.panel.variants.tool.variant_visible":()=>yE,"animated_java.popup.loading.loading":()=>tx,"animated_java.popup.loading.offline":()=>ix,"animated_java.popup.loading.success":()=>nx,"animated_java.tool.text_display.background_color.description":()=>wT,"animated_java.tool.text_display.background_color.title":()=>yT,"animated_java.tool.text_display.line_width.description":()=>vT,"animated_java.tool.text_display.line_width.title":()=>bT,"animated_java.tool.text_display.text_alignment.description":()=>TT,"animated_java.tool.text_display.text_alignment.options.center":()=>AT,"animated_java.tool.text_display.text_alignment.options.left":()=>CT,"animated_java.tool.text_display.text_alignment.options.right":()=>ST,"animated_java.tool.text_display.text_alignment.title":()=>ET,"animated_java.tool.text_display.text_shadow.description":()=>kT,"animated_java.tool.text_display.text_shadow.title":()=>xT,"animated_java.vanilla_item_display.title":()=>BT,default:()=>HT});var Uw="Blaupause-Einstellungen",Jw="Dokumentation",Hw="Plugin Info",$w="Knochen-Konfiguration",qw="Locator-Konfiguration",Kw="Textanzeige-Konfiguration",Ww="Projekt exportieren",Zw="Textanzeige hinzuf\xFCgen",Xw="Vanilla Itemanzeige hinzuf\xFCgen",Yw="Vanilla Blockanzeige hinzuf\xFCgen",Qw="Vanilla Itemanzeige-Konfiguration",ex="Vanilla Blockanzeige-Konfiguration",tx="Animated Java wird geladen...",nx="Animated Java wurde erfolgreich geladen!",ix=`Animated Java konnte sich nicht verbinden! +Einige Funktionen sind m\xF6glicherweise nicht verf\xFCgbar.`,rx="\xDCber Animated Java",ax="Schlie\xDFen",ox="Ein unerwarteter Fehler tritt auf!",sx="Schlie\xDFen",lx="Fehlermeldung wurde in die Zwischenablage kopiert!",cx="Klicken Sie, um die Fehlermeldung in die Zwischenablage zu kopieren.",ux="Bitte melden Sie diesen Fehler, indem Sie unserem {0} beitreten und einen Beitrag im #animated-java-support Kanal erstellen, oder indem Sie ein Issue auf unserem {1} erstellen. Danke!",dx="Blaupause-Einstellungen",fx="Erweiterte Einstellungen sollten nur verwendet werden, wenn sie unbedingt erforderlich sind!",mx="Blaupausenname",px="Der name der Blaupause. Wird nur verwendet, um das Projekt im Arbeitsbereich zu identifizieren.",_x="Textur-Gr\xF6\xDFe",gx="Die Aufl\xF6sung des UV-Editors. Diese sollte die gleiche Gr\xF6\xDFe wie die gr\xF6\xDFte Textur sein. Die besten Ergebnisse erzielen Sie mit einer quadratischen Aufl\xF6sung, wobei die Gr\xF6\xDFe eine Potenz von 2 ist.",hx="Die Textur-Gr\xF6\xDFe sollte quadratisch sein f\xFCr die besten Ergebnisse.",bx="Die Textur-Gr\xF6\xDFe sollte eine Potenz von 2 sein f\xFCr die besten Ergebnisse.",vx="Die Textur-Gr\xF6\xDFe sollte mit der Gr\xF6\xDFe der gr\xF6\xDFten Textur \xFCbereinstimmen.",yx="Export-Einstellungen",wx="Export-Namespace",xx="Der Namespace, in den das Projekt exportiert werden soll. Dies ist der Namespace, der im exportierten Ressourcenpaket und Datenpaket verwendet wird.",kx="Der Export-Namespace darf nicht leer sein!",Ex='Der Export-Namespace "{0}" ist f\xFCr interne Funktionen reserviert! Bitte w\xE4hlen Sie einen anderen Namespace.',Tx="Der Export-Namespace enth\xE4lt ung\xFCltige Zeichen! Ein Namespace darf nur Buchstaben, Nummern und Unterstriche enthalten.",Cx="Plugin-Modus",Ax="Ob der Plugin-Modus aktiviert werden soll oder nicht. Aktivieren Sie diese Option, falls Sie die .ajblueprint Datei in einem Plugin anstelle eines Ressourcenpaket / Datenpakets verwenden m\xF6chten.",Sx="Ressourcenpaket Export-Modus",jx=`Bestimmt, wie das Ressourcenpaket exportiert werden soll. Ordner - Exportiert das Ressourcenpaket als Ordner. Zip - Exportiert das Ressourcenpaket als eine .zip-Datei. -Keine - Deaktiviert den Export des Ressourcenpakets.`,Yw="Ordner",Qw="Zip",ex="Keine",tx="Datenpaket Export-Modus",nx=`Bestimmt, wie das Datenpaket exportiert werden soll. +Keine - Deaktiviert den Export des Ressourcenpakets.`,Ix="Ordner",Ox="Zip",Nx="Keine",Bx="Datenpaket Export-Modus",Rx=`Bestimmt, wie das Datenpaket exportiert werden soll. Ordner - Exportiert das Datenpaket als Ordner. Zip - Exportiert das Datenpaket als eine .zip-Datei. -Keine - Deaktiviert den Export des Datenpakets.`,ix="Ordner",rx="Zip",ax="Keine",ox="Bounding Box anzeigen",sx="Ob die Bounding Box im Editor angezeigt werden soll oder nicht.",lx="Automatische Bounding Box",cx=`Ob die Bounding Box automatisch anhand der Geometrie des Modells berechnet werden soll oder nicht. -HINWEIS: Die automatische Bounding Box ber\xFCcksichtigt NICHT die Knochen-Versetzungen bei Animationen, so dass die Bounding Box manchmals kleiner sein kann als erforderlich.`,ux="Bounding Box",dx="Bestimmt die Culling-Box des Modells. Das Modell wird nicht gerendert sobald diese Box au\xDFerhalb des Bildschirms liegt.",fx="Ressourcenpaket-Einstellungen",mx="Erweiterte Einstellungen benutzen",px="Ob erweiterte Ressourcenpaket-Einstellungen aktiviert sind oder nicht.",_x="Anzeige-Item",gx="Das Item zur Anzeige der Blaupausenmodelle im Spiel. Mehrere Blaupausen k\xF6nnen auf demselben Item platziert werden und werden automatisch zusammengef\xFChrt.",hx="Kein Item ausgew\xE4hlt!",bx="Das angegebene Item ist ung\xFCltig! Item-IDs m\xFCssen als namespace:item_id formattiert sein.",vx="Die angegebene Item-ID ist ung\xFCltig! Item-IDs d\xFCrfen keine Leerzeichen enthalten.",yx="Das angegebene Item existiert nicht in Vanilla!",wx="CMD-Versetzung",xx="Der Versatz, der f\xFCr die benutzerdefinierten Modelldaten des Anzeige-Items verwendet werden soll. Erlaubt mehrere Blaupausen f\xFCr dasselbe Item, aber in separaten, nicht zugeh\xF6rigen Ressourcenpaketen.",kx="Ressourcenpaket",Ex="Der Hauptordner des Ressourcenpakets, in den das Projekt exportiert werden soll.",Tx="Kein Ordner ausgew\xE4hlt!",Cx="Der ausgew\xE4hlte Ordner existiert nicht!",Ax="Der ausgew\xE4hlte Dateipfad ist kein Ordner!",Sx="Im ausgew\xE4hlten Ordner fehlt die pack.mcmeta-Datei!",jx="Im ausgew\xE4hlten Ordner fehlt der assets-Ordner!",Ix="Ressourcenpaket Zip",Ox="Der Dateipfad zu der .zip-Datei, in die das Projekt exportiert werden soll.",Nx="Keine Datei ausgew\xE4hlt!",Bx="Der ausgew\xE4hlte Dateipfad ist keine Datei!",Dx="Anzeige-Item-Pfad",Rx="Wo das Anzeige-Item gespeichert werden soll. Dies sollte ein Dateipfad zu einer .json-Datei in einem Ressourcenpaket sein.",Mx="Keine Datei ausgew\xE4hlt!",Fx="Die ausgew\xE4hlte Datei existiert nicht!",Lx="Der ausgew\xE4hlte Dateipfad ist keine Datei!",Px="Modell-Ordner",Vx="Wo alle exportierten Modelle gespeichert werden sollen. Dies sollte ein Dateipfad zu einem Ordner in einem Ressourcenpaket sein.",zx="Kein Ordner ausgew\xE4hlt!",Ux="Der ausgew\xE4hlte Ordner existiert nicht!",Gx="Der ausgew\xE4hlte Dateipfad ist kein Ordner!",Jx="Texturen-Ordner",Hx="Wo alle exportierten Texturen gespeichert werden sollen. Dies sollte ein Dateipfad zu einem Ordner in einem Ressourcenpaket sein.",$x="Datenpaket-Einstellungen",Kx="Erweiterte Einstellungen benutzen",qx="Ob erweiterte Datenpaket-Einstellungen aktiviert sind oder nicht.",Wx="Datenpaket",Zx="Der Hauptordner des Datenpakets, in den das Projekt exportiert werden soll.",Xx="Kein Ordner ausgew\xE4hlt!",Yx="Der ausgew\xE4hlte Ordner existiert nicht!",Qx="Der ausgew\xE4hlte Dateipfad ist kein Ordner!",ek="Im ausgew\xE4hlten Ordner fehlt die pack.mcmeta-Datei!",tk="Im ausgew\xE4hlten Ordner fehlt der data-Ordner!",nk="Datenpaket Zip",ik="Der Dateipfad zu der .zip-Datei, in die das Projekt exportiert werden soll.",rk="Keine Datei ausgew\xE4hlt!",ak="Der ausgew\xE4hlte Dateipfad ist keine Datei!",ok="On-Summon-Befehle",sk=`Befehle, die beim Erschaffen des Root-Objektes ausgef\xFChrt werden. -Behandeln Sie diese Texteingabe wie eine .mcfunction-Datei. (Unterst\xFCtzt auch MC-Build-Syntax!)`,lk="Interpolation-Dauer",ck="Die Dauer (in Ticks) der Gl\xE4ttung zwischen Keyframes. Dies ist die Zeit, die das Modell ben\xF6tigt, um von einem Keyframe zum n\xE4chsten zu wechseln. H\xF6here Werte f\xFChren dazu, dass die Animationen ungenauer werden. In der Regel sollten Werte von 1 oder 2 gen\xFCgen.",uk="Teleport-Dauer",dk="Die Dauer (in Ticks) der Teleportation zwischen Keyframes. Dies ist die Zeit, in der das Modell visuell zwischen seiner alten und neuer Position interpoliert. H\xF6here Werte f\xFChren dazu, dass die Animationen ungenauer werden.",fk="NBT-Speicher f\xFCr Animationen benutzen",mk=`Ob NBT-Speicher zum Speichern von Animationsdaten anstelle von Funktionen verwendet werden soll oder nicht. -Dadurch wird die Anzahl der Funktionen im generierten Datenpaket erheblich reduziert, ist aber 42% langsamer.`,pk="Animationen verbinden",_k=`Ob die exportierten Animationen verbunden werden oder nicht. +Keine - Deaktiviert den Export des Datenpakets.`,Dx="Ordner",Mx="Zip",Fx="Keine",Lx="Bounding Box anzeigen",Px="Ob die Bounding Box im Editor angezeigt werden soll oder nicht.",Vx="Automatische Bounding Box",zx=`Ob die Bounding Box automatisch anhand der Geometrie des Modells berechnet werden soll oder nicht. +HINWEIS: Die automatische Bounding Box ber\xFCcksichtigt NICHT die Knochen-Versetzungen bei Animationen, so dass die Bounding Box manchmals kleiner sein kann als erforderlich.`,Gx="Bounding Box",Ux="Bestimmt die Culling-Box des Modells. Das Modell wird nicht gerendert sobald diese Box au\xDFerhalb des Bildschirms liegt.",Jx="Ressourcenpaket-Einstellungen",Hx="Erweiterte Einstellungen benutzen",$x="Ob erweiterte Ressourcenpaket-Einstellungen aktiviert sind oder nicht.",qx="Anzeige-Item",Kx="Das Item zur Anzeige der Blaupausenmodelle im Spiel. Mehrere Blaupausen k\xF6nnen auf demselben Item platziert werden und werden automatisch zusammengef\xFChrt.",Wx="Kein Item ausgew\xE4hlt!",Zx="Das angegebene Item ist ung\xFCltig! Item-IDs m\xFCssen als namespace:item_id formattiert sein.",Xx="Die angegebene Item-ID ist ung\xFCltig! Item-IDs d\xFCrfen keine Leerzeichen enthalten.",Yx="Das angegebene Item existiert nicht in Vanilla!",Qx="CMD-Versetzung",ek="Der Versatz, der f\xFCr die benutzerdefinierten Modelldaten des Anzeige-Items verwendet werden soll. Erlaubt mehrere Blaupausen f\xFCr dasselbe Item, aber in separaten, nicht zugeh\xF6rigen Ressourcenpaketen.",tk="Ressourcenpaket",nk="Der Hauptordner des Ressourcenpakets, in den das Projekt exportiert werden soll.",ik="Kein Ordner ausgew\xE4hlt!",rk="Der ausgew\xE4hlte Ordner existiert nicht!",ak="Der ausgew\xE4hlte Dateipfad ist kein Ordner!",ok="Im ausgew\xE4hlten Ordner fehlt die pack.mcmeta-Datei!",sk="Im ausgew\xE4hlten Ordner fehlt der assets-Ordner!",lk="Ressourcenpaket Zip",ck="Der Dateipfad zu der .zip-Datei, in die das Projekt exportiert werden soll.",uk="Keine Datei ausgew\xE4hlt!",dk="Der ausgew\xE4hlte Dateipfad ist keine Datei!",fk="Anzeige-Item-Pfad",mk="Wo das Anzeige-Item gespeichert werden soll. Dies sollte ein Dateipfad zu einer .json-Datei in einem Ressourcenpaket sein.",pk="Keine Datei ausgew\xE4hlt!",_k="Die ausgew\xE4hlte Datei existiert nicht!",gk="Der ausgew\xE4hlte Dateipfad ist keine Datei!",hk="Modell-Ordner",bk="Wo alle exportierten Modelle gespeichert werden sollen. Dies sollte ein Dateipfad zu einem Ordner in einem Ressourcenpaket sein.",vk="Kein Ordner ausgew\xE4hlt!",yk="Der ausgew\xE4hlte Ordner existiert nicht!",wk="Der ausgew\xE4hlte Dateipfad ist kein Ordner!",xk="Texturen-Ordner",kk="Wo alle exportierten Texturen gespeichert werden sollen. Dies sollte ein Dateipfad zu einem Ordner in einem Ressourcenpaket sein.",Ek="Datenpaket-Einstellungen",Tk="Erweiterte Einstellungen benutzen",Ck="Ob erweiterte Datenpaket-Einstellungen aktiviert sind oder nicht.",Ak="Datenpaket",Sk="Der Hauptordner des Datenpakets, in den das Projekt exportiert werden soll.",jk="Kein Ordner ausgew\xE4hlt!",Ik="Der ausgew\xE4hlte Ordner existiert nicht!",Ok="Der ausgew\xE4hlte Dateipfad ist kein Ordner!",Nk="Im ausgew\xE4hlten Ordner fehlt die pack.mcmeta-Datei!",Bk="Im ausgew\xE4hlten Ordner fehlt der data-Ordner!",Rk="Datenpaket Zip",Dk="Der Dateipfad zu der .zip-Datei, in die das Projekt exportiert werden soll.",Mk="Keine Datei ausgew\xE4hlt!",Fk="Der ausgew\xE4hlte Dateipfad ist keine Datei!",Lk="On-Summon-Befehle",Pk=`Befehle, die beim Erschaffen des Root-Objektes ausgef\xFChrt werden. +Behandeln Sie diese Texteingabe wie eine .mcfunction-Datei. (Unterst\xFCtzt auch MC-Build-Syntax!)`,Vk="Interpolation-Dauer",zk="Die Dauer (in Ticks) der Gl\xE4ttung zwischen Keyframes. Dies ist die Zeit, die das Modell ben\xF6tigt, um von einem Keyframe zum n\xE4chsten zu wechseln. H\xF6here Werte f\xFChren dazu, dass die Animationen ungenauer werden. In der Regel sollten Werte von 1 oder 2 gen\xFCgen.",Gk="Teleport-Dauer",Uk="Die Dauer (in Ticks) der Teleportation zwischen Keyframes. Dies ist die Zeit, in der das Modell visuell zwischen seiner alten und neuer Position interpoliert. H\xF6here Werte f\xFChren dazu, dass die Animationen ungenauer werden.",Jk="NBT-Speicher f\xFCr Animationen benutzen",Hk=`Ob NBT-Speicher zum Speichern von Animationsdaten anstelle von Funktionen verwendet werden soll oder nicht. +Dadurch wird die Anzahl der Funktionen im generierten Datenpaket erheblich reduziert, ist aber 42% langsamer.`,$k="Animationen verbinden",qk=`Ob die exportierten Animationen verbunden werden oder nicht. Bei verbundenen Animationen werden die Frames vorberechnet und in der exportierten JSON-Datei gespeichert, wodurch die Komplexit\xE4t des Renderings des Modells im Spiel reduziert wird. -Bei einigen Plugins muss dies aktiviert sein, damit sie korrekt funktionieren.`,gk="JSON-Datei",hk="Der Dateipfad zu der JSON-Datei, in der das Projekt exportiert wird.",bk="Keine Datei ausgew\xE4hlt!",vk="Der ausgew\xE4hlte Dateipfad ist keine Datei!",yk="Knochen-Konfiguration",wk="Ausgew\xE4hlte Variante: {0}",xk="Die folgenden Einstellungen werden standardm\xE4\xDFig auf diesen Knochen angewendet.",kk="Die folgenden Einstellungen werden nur auf diesen Knochen angewendet, wenn diese Variante verwendet wird.",Ek="NBT benutzen",Tk="Ob NBT zur Konfiguration des Knochens anstelle von Einstellungen verwendet werden soll oder nicht.",Ck="Die Verwendung von NBT setzt alle anderen Einstellungen au\xDFer Kraft, und alle \xC4nderungen, die Sie vornehmen, sind im Editor nicht sichtbar. Verwenden Sie dies nur, wenn Sie wissen, was Sie tun!",Ak="Einstellungen erben",Sk="Ob die Einstellungen des \xFCbergeordneten Knochens geerbt werden sollen oder nicht.",jk="Leuchten",Ik="Ob der Knochen im Spiel leuchten soll oder nicht.",Ok="Leuchtfarbe \xFCberschreiben",Nk="Ob die Standard-Leuchtfarbe \xFCberschrieben werden soll oder nicht.",Bk="Leuchtfarbe",Dk="Die Farbe des Leuchtens.",Rk="Schatten-Radius",Mk="Der Radius des Schattens.",Fk="Schatten-Intensit\xE4t",Lk="Die Intensit\xE4t des Schattens.",Pk="Helligkeit \xFCberschreiben",Vk="Ob die Standard-Helligkeit \xFCberschrieben werden soll oder nicht.",zk="Helligkeit",Uk="Die Helligkeit des Knochens. Dies sollte ein Wert zwischen 0 und 15 sein.",Gk="Verzaubert",Jk="Ob dieser Knochen verzaubert sein soll oder nicht.",Hk="Unsichtbar",$k="Ob dieser Knochen unsichtbar sein soll oder nicht.",Kk="NBT",qk="Die NBT, die auf den Knochen angewendet werden soll.",Wk=`Die NBT muss ein compound tag sein! Bsp. {CustomName:'"my name"'}`,Zk=`Ung\xFCltige NBT! -{0}`,Xk="Anzeigetafel",Yk="Ob dieser Knochen beim Rendern im Spiel zum Spieler hin drehen soll oder nicht. Es kann fixiert (sowohl vertikal als auch horizontale Winkel sind fixiert), vertikal (dreht sich um die vertikale Achse), horizontal (dreht sich um die horizontale Achse), oder zentriert (dreht sich um den Mittelpunkt) sein.",Qk="Fixiert",e2="Vertikal",t2="Horizontal",n2="Zentriert",i2="Locator-Konfiguration",r2=`Plugin-Modus ist aktiviert! Locators k\xF6nnen nicht konfiguriert werden im Plugin-Modus. +Bei einigen Plugins muss dies aktiviert sein, damit sie korrekt funktionieren.`,Kk="JSON-Datei",Wk="Der Dateipfad zu der JSON-Datei, in der das Projekt exportiert wird.",Zk="Keine Datei ausgew\xE4hlt!",Xk="Der ausgew\xE4hlte Dateipfad ist keine Datei!",Yk="Knochen-Konfiguration",Qk="Ausgew\xE4hlte Variante: {0}",e2="Die folgenden Einstellungen werden standardm\xE4\xDFig auf diesen Knochen angewendet.",t2="Die folgenden Einstellungen werden nur auf diesen Knochen angewendet, wenn diese Variante verwendet wird.",n2="NBT benutzen",i2="Ob NBT zur Konfiguration des Knochens anstelle von Einstellungen verwendet werden soll oder nicht.",r2="Die Verwendung von NBT setzt alle anderen Einstellungen au\xDFer Kraft, und alle \xC4nderungen, die Sie vornehmen, sind im Editor nicht sichtbar. Verwenden Sie dies nur, wenn Sie wissen, was Sie tun!",a2="Einstellungen erben",o2="Ob die Einstellungen des \xFCbergeordneten Knochens geerbt werden sollen oder nicht.",s2="Leuchten",l2="Ob der Knochen im Spiel leuchten soll oder nicht.",c2="Leuchtfarbe \xFCberschreiben",u2="Ob die Standard-Leuchtfarbe \xFCberschrieben werden soll oder nicht.",d2="Leuchtfarbe",f2="Die Farbe des Leuchtens.",m2="Schatten-Radius",p2="Der Radius des Schattens.",_2="Schatten-Intensit\xE4t",g2="Die Intensit\xE4t des Schattens.",h2="Helligkeit \xFCberschreiben",b2="Ob die Standard-Helligkeit \xFCberschrieben werden soll oder nicht.",v2="Helligkeit",y2="Die Helligkeit des Knochens. Dies sollte ein Wert zwischen 0 und 15 sein.",w2="Verzaubert",x2="Ob dieser Knochen verzaubert sein soll oder nicht.",k2="Unsichtbar",E2="Ob dieser Knochen unsichtbar sein soll oder nicht.",T2="NBT",C2="Die NBT, die auf den Knochen angewendet werden soll.",A2=`Die NBT muss ein compound tag sein! Bsp. {CustomName:'"my name"'}`,S2=`Ung\xFCltige NBT! +{0}`,j2="Anzeigetafel",I2="Ob dieser Knochen beim Rendern im Spiel zum Spieler hin drehen soll oder nicht. Es kann fixiert (sowohl vertikal als auch horizontale Winkel sind fixiert), vertikal (dreht sich um die vertikale Achse), horizontal (dreht sich um die horizontale Achse), oder zentriert (dreht sich um den Mittelpunkt) sein.",O2="Fixiert",N2="Vertikal",B2="Horizontal",R2="Zentriert",D2="Locator-Konfiguration",M2=`Plugin-Modus ist aktiviert! Locators k\xF6nnen nicht konfiguriert werden im Plugin-Modus. Verwenden Sie stattdessen die Plugin-API, um Ihren Locators individuelle Funktionen hinzuzuf\xFCgen. -Weitere Informationen finden Sie in der offiziellen Plugin-API-Dokumentation.`,a2="Objekt benutzen",o2="Ob ein Objekt an den Locator angeh\xE4ngt werden soll oder nicht.",s2="Objekt-Typ",l2="Das Objekt, dass an den Locator angeh\xE4ngt wird.",c2="Objekt-Typ darf nicht leer sein!",u2="Das ausgew\xE4hlte Objekt existiert nicht in Minecraft {0}",d2="On-Summon Befehle",f2=`Befehle, die beim Erschaffen des Locator-Objektes ausgef\xFChrt werden. -Behandeln Sie diese Texteingabe wie eine .mcfunction-Datei. (Unterst\xFCtzt auch MC-Build-Syntax!)`,m2="Ticking Befehle",p2=`Befehle, die bei jedem Tick an der Position des Locators ausgef\xFChrt werden. -Behandeln Sie diese Texteingabe wie eine .mcfunction-Datei. (Unterst\xFCtzt auch MC-Build-Syntax!)`,_2="Textanzeige-Konfiguration",g2="Vanilla Item Model",h2=`If set, the bone will render as a vanilla item model. -This will overwrite the bone's existing cubes.`,b2="NBT benutzen",v2="Ob NBT zur Konfiguration der Textanzeige anstelle von Einstellungen verwendet werden soll oder nicht.",y2="Die Verwendung von NBT setzt alle anderen Einstellungen au\xDFer Kraft, und alle \xC4nderungen, die Sie vornehmen, sind im Editor nicht sichtbar. Verwenden Sie dies nur, wenn Sie wissen, was Sie tun!",w2="Einstellungen erben",x2="Ob die Einstellungen der \xFCbergeordneten Textanzeige geerbt werden sollen oder nicht.",k2="Leuchten",E2="Ob die Textanzeige im Spiel leuchten soll oder nicht.",T2="Leuchtfarbe \xFCberschreiben",C2="Ob die Standard-Leuchtfarbe \xFCberschrieben werden soll oder nicht.",A2="Leuchtfarbe",S2="Die Farbe des Leuchtens.",j2="Schatten-Radius",I2="Der Radius des Schattens.",O2="Schatten-Intensit\xE4t",N2="Die Intensit\xE4t des Schattens.",B2="Helligkeit \xFCberschreiben",D2="Ob die Standard-Helligkeit \xFCberschrieben werden soll oder nicht.",R2="Helligkeit",M2="Die Helligkeit der Textanzeige. Dies sollte ein Wert zwischen 0 und 15 sein.",F2="Unsichtbar",L2="Ob diese Textanzeige unsichtbar sein soll oder nicht.",P2="NBT",V2="Die NBT, die auf die Textanzeige angewendet werden soll.",z2="Anzeigetafel",U2="Ob diese Textanzeige beim Rendern im Spiel zum Spieler hin drehen soll oder nicht. Es kann fixiert (sowohl vertikal als auch horizontale Winkel sind fixiert), vertikal (dreht sich um die vertikale Achse), horizontal (dreht sich um die horizontale Achse), oder zentriert (dreht sich um den Mittelpunkt) sein.",G2="Fixiert",J2="Vertikal",H2="Horizontal",$2="Zentriert",K2="Vanilla Blockanzeige-Konfiguration",q2="Vanilla Itemanzeige-Konfiguration",W2="Variante-Konfiguration",Z2="Anzeigename",X2="Wird verwendet, um die Variante im Editor und in Fehlermeldungen zu identifizieren.",Y2="Name aus Anzeigename generieren",Q2="Ob der Name automatisch aus dem Anzeigenamen generiert werden soll.",e5="Name",t5="Wird verwendet, um die Variante im exportierten Ressourcenpaket und Datenpaket zu identifizieren.",n5="Textur Zuordnung",i5="Eine Zuordnung mit den Texturen, die bei dieser Variante ausgetauscht werden sollen.",r5="Neue Zuordnung erstellen",a5="Variante hat keine ausgetauschten Texturen.",o5="Eine Liste von Nodes, die von der Variante ein- oder ausgeschlossen werden sollen. Nur die Nodes in der eingeschlossenen Liste werden von der Variante ge\xE4ndert, die Nodes in der ausgeschlossenen Liste werden ignoriert.",s5="Ausgeschlossene Nodes",l5="Eine Liste von Nodes, die von der Variante ausgeschlossen werden sollen. Diese Nodes werden von der Variante ignoriert.",c5="Eingeschlossene Nodes",u5="Eine Liste von Nodes, die von der Variante eingeschlossen werden. Nur diese Nodes werden von der Variante ge\xE4ndert.",d5="Listen tauschen",f5=".ajmodel aktualisieren",m5=".ajmodel aktualisieren",p5=".ajmodel-Datei ausw\xE4hlen",_5="Aktualisieren Sie Ihre veraltete .ajmodel-Datei zum neuen .ajblueprint-Format.",g5="W\xE4hlen Sie eine .ajmodel-Datei f\xFCr das Aktualisieren aus",h5="Animationseigenschaften ({0})",b5="Animationsname",v5="Der Name der Animation.",y5="Schleifen-Modus",w5="Bestimmt, wie die Animation in einer Schleife abgespielt werden soll. Einmal - Die Animation wird einmal abgespielt und h\xF6rt auf. Halten - Die Animation wird einmal abgespielt und das letzte Pose wird gehalten. Schleife - Die Animation wird in einer Endlosschleife abgespielt.",x5="Einmal",k5="Halten",E5="Schleife",T5="Der Animationsname darf nicht leer sein!",C5="Der Animationsname enth\xE4lt ung\xFCltige Zeichen! Animationsnamen d\xFCrfen nur Buchstaben, Zahlen und Punkte enthalten.",A5="Schleifenverz\xF6gerung",S5="Die Verz\xF6gerung zwischen Schleifen. Dies ist die Zeit, die die Animation pausiert, bevor sie wieder beginnt. Dies wird nur benutzt, wenn der Schleifenmodus auf Schleife eingestellt ist.",j5="Eine Liste von Nodes, die von der Animation ein- oder ausgeschlossen werden sollen. Nur die Nodes in der eingeschlossenen Liste werden von der Animation ge\xE4ndert, die Nodes in der ausgeschlossenen Liste werden ignoriert.",I5="Ausgeschlossene Nodes",O5="Eine Liste von Nodes, die von der Animation ausgeschlossen werden sollen. Diese Nodes werden von der Animation ignoriert.",N5="Eingeschlossene Nodes",B5="Eine Liste von Nodes, die von der Animation eingeschlossen werden. Nur diese Nodes werden von der Animation ge\xE4ndert.",D5="Listen tauschen",R5="Projekt wird exportiert...",M5="Blaupause wird geladen...",F5="Varianten",L5="Neue Variante erstellen",P5="Variante editieren",V5="Ausgew\xE4hlte Variante duplizieren",z5="Ausgew\xE4hlte Variante l\xF6schen",U5="Ausgew\xE4hlte Variante",G5="Nicht ausgew\xE4hlte Variante",J5="Standard-Variante darf nicht gel\xF6scht werden!",H5="Variante erstellen",$5="Variante duplizieren",K5="Variante-Konfiguration \xF6ffnen",q5="Variante l\xF6schen",W5="Ausgeschlossene Nodes",Z5="Ausgeschlossene Nodes umkehren",X5="Variante",Y5="Befehle",Q5="Variante",eE="Befehle",tE="Ausf\xFChrbedingung",nE="Keyframe ({0})",iE="Variante",rE="Die Variante, die bei diesem Keyframe angewendet wird.",aE="Befehle",oE=`Befehle, die ausgef\xFChrt werden, sobald dieses Keyframe erreicht wird. -Behandeln Sie diese Texteingabe wie eine .mcfunction-Datei. (Unterst\xFCtzt auch MC-Build-Syntax!)`,sE="Ausf\xFChrbedingung",lE="Eine bedingung, die erf\xFCllt sein muss, damit das Keyframe ausgef\xFChrt wird. Behandeln Sie diese Texteingabe wie Unterbefehle eines execute Befehls.",cE="Wiederholen?",uE=`Ob dieser Befehl in diesem Keyframe wiederholt ausgef\xFChrt wird. -Wenn diese Option aktiviert ist, werden die Befehle einmal pro Wiederholungsfrequenz ausgef\xFChrt.`,dE="Wiederholungsfrequenz",fE=`Wieviele Ticks dieses Keyframe warten soll, bevor die Befehle erneut ausgef\xFChrt werden. +Weitere Informationen finden Sie in der offiziellen Plugin-API-Dokumentation.`,F2="Objekt benutzen",L2="Ob ein Objekt an den Locator angeh\xE4ngt werden soll oder nicht.",P2="Objekt-Typ",V2="Das Objekt, dass an den Locator angeh\xE4ngt wird.",z2="Objekt-Typ darf nicht leer sein!",G2="Das ausgew\xE4hlte Objekt existiert nicht in Minecraft {0}",U2="On-Summon Befehle",J2=`Befehle, die beim Erschaffen des Locator-Objektes ausgef\xFChrt werden. +Behandeln Sie diese Texteingabe wie eine .mcfunction-Datei. (Unterst\xFCtzt auch MC-Build-Syntax!)`,H2="Ticking Befehle",$2=`Befehle, die bei jedem Tick an der Position des Locators ausgef\xFChrt werden. +Behandeln Sie diese Texteingabe wie eine .mcfunction-Datei. (Unterst\xFCtzt auch MC-Build-Syntax!)`,q2="Textanzeige-Konfiguration",K2="Vanilla Item Model",W2=`If set, the bone will render as a vanilla item model. +This will overwrite the bone's existing cubes.`,Z2="NBT benutzen",X2="Ob NBT zur Konfiguration der Textanzeige anstelle von Einstellungen verwendet werden soll oder nicht.",Y2="Die Verwendung von NBT setzt alle anderen Einstellungen au\xDFer Kraft, und alle \xC4nderungen, die Sie vornehmen, sind im Editor nicht sichtbar. Verwenden Sie dies nur, wenn Sie wissen, was Sie tun!",Q2="Einstellungen erben",e5="Ob die Einstellungen der \xFCbergeordneten Textanzeige geerbt werden sollen oder nicht.",t5="Leuchten",n5="Ob die Textanzeige im Spiel leuchten soll oder nicht.",i5="Leuchtfarbe \xFCberschreiben",r5="Ob die Standard-Leuchtfarbe \xFCberschrieben werden soll oder nicht.",a5="Leuchtfarbe",o5="Die Farbe des Leuchtens.",s5="Schatten-Radius",l5="Der Radius des Schattens.",c5="Schatten-Intensit\xE4t",u5="Die Intensit\xE4t des Schattens.",d5="Helligkeit \xFCberschreiben",f5="Ob die Standard-Helligkeit \xFCberschrieben werden soll oder nicht.",m5="Helligkeit",p5="Die Helligkeit der Textanzeige. Dies sollte ein Wert zwischen 0 und 15 sein.",_5="Unsichtbar",g5="Ob diese Textanzeige unsichtbar sein soll oder nicht.",h5="NBT",b5="Die NBT, die auf die Textanzeige angewendet werden soll.",v5="Anzeigetafel",y5="Ob diese Textanzeige beim Rendern im Spiel zum Spieler hin drehen soll oder nicht. Es kann fixiert (sowohl vertikal als auch horizontale Winkel sind fixiert), vertikal (dreht sich um die vertikale Achse), horizontal (dreht sich um die horizontale Achse), oder zentriert (dreht sich um den Mittelpunkt) sein.",w5="Fixiert",x5="Vertikal",k5="Horizontal",E5="Zentriert",T5="Vanilla Blockanzeige-Konfiguration",C5="Vanilla Itemanzeige-Konfiguration",A5="Variante-Konfiguration",S5="Anzeigename",j5="Wird verwendet, um die Variante im Editor und in Fehlermeldungen zu identifizieren.",I5="Name aus Anzeigename generieren",O5="Ob der Name automatisch aus dem Anzeigenamen generiert werden soll.",N5="Name",B5="Wird verwendet, um die Variante im exportierten Ressourcenpaket und Datenpaket zu identifizieren.",R5="Textur Zuordnung",D5="Eine Zuordnung mit den Texturen, die bei dieser Variante ausgetauscht werden sollen.",M5="Neue Zuordnung erstellen",F5="Variante hat keine ausgetauschten Texturen.",L5="Eine Liste von Nodes, die von der Variante ein- oder ausgeschlossen werden sollen. Nur die Nodes in der eingeschlossenen Liste werden von der Variante ge\xE4ndert, die Nodes in der ausgeschlossenen Liste werden ignoriert.",P5="Ausgeschlossene Nodes",V5="Eine Liste von Nodes, die von der Variante ausgeschlossen werden sollen. Diese Nodes werden von der Variante ignoriert.",z5="Eingeschlossene Nodes",G5="Eine Liste von Nodes, die von der Variante eingeschlossen werden. Nur diese Nodes werden von der Variante ge\xE4ndert.",U5="Listen tauschen",J5=".ajmodel aktualisieren",H5=".ajmodel aktualisieren",$5=".ajmodel-Datei ausw\xE4hlen",q5="Aktualisieren Sie Ihre veraltete .ajmodel-Datei zum neuen .ajblueprint-Format.",K5="W\xE4hlen Sie eine .ajmodel-Datei f\xFCr das Aktualisieren aus",W5="Animationseigenschaften ({0})",Z5="Animationsname",X5="Der Name der Animation.",Y5="Schleifen-Modus",Q5="Bestimmt, wie die Animation in einer Schleife abgespielt werden soll. Einmal - Die Animation wird einmal abgespielt und h\xF6rt auf. Halten - Die Animation wird einmal abgespielt und das letzte Pose wird gehalten. Schleife - Die Animation wird in einer Endlosschleife abgespielt.",eE="Einmal",tE="Halten",nE="Schleife",iE="Der Animationsname darf nicht leer sein!",rE="Der Animationsname enth\xE4lt ung\xFCltige Zeichen! Animationsnamen d\xFCrfen nur Buchstaben, Zahlen und Punkte enthalten.",aE="Schleifenverz\xF6gerung",oE="Die Verz\xF6gerung zwischen Schleifen. Dies ist die Zeit, die die Animation pausiert, bevor sie wieder beginnt. Dies wird nur benutzt, wenn der Schleifenmodus auf Schleife eingestellt ist.",sE="Eine Liste von Nodes, die von der Animation ein- oder ausgeschlossen werden sollen. Nur die Nodes in der eingeschlossenen Liste werden von der Animation ge\xE4ndert, die Nodes in der ausgeschlossenen Liste werden ignoriert.",lE="Ausgeschlossene Nodes",cE="Eine Liste von Nodes, die von der Animation ausgeschlossen werden sollen. Diese Nodes werden von der Animation ignoriert.",uE="Eingeschlossene Nodes",dE="Eine Liste von Nodes, die von der Animation eingeschlossen werden. Nur diese Nodes werden von der Animation ge\xE4ndert.",fE="Listen tauschen",mE="Projekt wird exportiert...",pE="Blaupause wird geladen...",_E="Varianten",gE="Neue Variante erstellen",hE="Variante editieren",bE="Ausgew\xE4hlte Variante duplizieren",vE="Ausgew\xE4hlte Variante l\xF6schen",yE="Ausgew\xE4hlte Variante",wE="Nicht ausgew\xE4hlte Variante",xE="Standard-Variante darf nicht gel\xF6scht werden!",kE="Variante erstellen",EE="Variante duplizieren",TE="Variante-Konfiguration \xF6ffnen",CE="Variante l\xF6schen",AE="Ausgeschlossene Nodes",SE="Ausgeschlossene Nodes umkehren",jE="Variante",IE="Befehle",OE="Variante",NE="Befehle",BE="Ausf\xFChrbedingung",RE="Keyframe ({0})",DE="Variante",ME="Die Variante, die bei diesem Keyframe angewendet wird.",FE="Befehle",LE=`Befehle, die ausgef\xFChrt werden, sobald dieses Keyframe erreicht wird. +Behandeln Sie diese Texteingabe wie eine .mcfunction-Datei. (Unterst\xFCtzt auch MC-Build-Syntax!)`,PE="Ausf\xFChrbedingung",VE="Eine bedingung, die erf\xFCllt sein muss, damit das Keyframe ausgef\xFChrt wird. Behandeln Sie diese Texteingabe wie Unterbefehle eines execute Befehls.",zE="Wiederholen?",GE=`Ob dieser Befehl in diesem Keyframe wiederholt ausgef\xFChrt wird. +Wenn diese Option aktiviert ist, werden die Befehle einmal pro Wiederholungsfrequenz ausgef\xFChrt.`,UE="Wiederholungsfrequenz",JE=`Wieviele Ticks dieses Keyframe warten soll, bevor die Befehle erneut ausgef\xFChrt werden. Falls dieser Wert 1 ist, werden die Befehle einmal pro Tick ausgef\xFChrt. HINWEIS: Falls die Animation nicht gleichm\xE4\xDFig durch diesen Wert teilbar ist, kann das Intervall beim Schleifen der Animation leicht abweichen. -Falls dieser Wert gr\xF6\xDFer als die L\xE4nge der Animation ist, werden die Befehle nur einmal ausgef\xFChrt (sobald der Keyframe erreicht wird).`,mE="Gl\xE4ttungsart",pE="Die Gl\xE4ttungsart, die bei diesem Keyframe angewendet wird.",_E="Linear",gE="Sinus",hE="Quad",bE="Kubisch",vE="Quart",yE="Quint",wE="Expo",xE="Circ",kE="Elastisch",EE="Zur\xFCck",TE="Abprallen",CE="Gl\xE4ttungs-Modus",AE="Die Gl\xE4ttungs-Modus, die bei diesem Keyframe angewendet wird.",SE="Ein",jE="Aus",IE="Ein-Aus",OE="Gl\xE4ttungs-Argumente",NE="Die Argumente, die auf die Gl\xE4ttungsfunktion angewendet werden soll.",BE="Elastizit\xE4t",DE="Die Elastizit\xE4t der Gl\xE4ttungsfunktion.",RE="\xDCberschwingen",ME="Der Betrag des \xDCberschwingens, der auf die Gl\xE4ttungsfunktion angewendet werden soll.",FE="Sprungkraft",LE="Die Sprungkraft der Gl\xE4ttungsfunktion.",PE="Textanzeige",VE="Zeilenbreite",zE="Die Breite der Textanzeige in Pixeln.",UE="Hintergrundsfarbe",GE="Die Farbe des Hintergrunds der Textanzeige",JE="Textschatten",HE="Ob die Textanzeige einen Schatten hinter dem Text anzeigt oder nicht.",$E="Textausrichtung",KE="Die Ausrichtung des Textes.",qE="Links",WE="Mitte",ZE="Rechts",XE="Angezeigtes Item",YE="Das Item, dass angezeigt werden soll.",QE="Angezeigter Block",eT="Der Block, der angezeigt werden soll. Unterst\xFCtzt Block states!",tT="Vanilla Item Anzeige",nT="Fehler beim Exportieren",iT="Sie haben den Export des Ressourcenpakets deaktiviert, haben aber benutzerdefinierte Modelle im Projekt! Bitte aktivieren Sie den Export des Ressourcenpakets oder entfernen sie benutzerdefinierte Modelle vor dem Export.",rT="Ihre Blaupause-Einstellungen ist fehlerhaft! Bitte beheben Sie diese, bevor Sie exportieren.",aT="Ein Problem ist aufgetreten mit {0}:",oT="Ok",sT="Animated Java",lT="Fl\xFCssigkeiten renderen nicht in Blockanzeigen.",cT="Mob-K\xF6pfe renderen nicht in Blockanzeigen. Benutzen Sie stattdessen Itemanzeigen.",uT='Der Blockzustand "facing" wird in Blockanzeigen nicht unterst\xFCtzt.',dT="Blaupause-Exportpfad Existiert Nicht",fT=`Der Exportpfad '{0}' existiert nicht! -Vergewissern Sie sich, dass der Ordner, in dem Sie speichern wollen, existiert, und versuchen Sie es erneut.`,mT={"animated_java.action.open_blueprint_settings.name":dw,"animated_java.action.open_documentation.name":fw,"animated_java.action.open_about.name":mw,"animated_java.action.open_bone_config.name":pw,"animated_java.action.open_locator_config.name":_w,"animated_java.action.open_text_display_config.name":gw,"animated_java.action.export.name":hw,"animated_java.action.create_text_display.title":bw,"animated_java.action.create_vanilla_item_display.title":vw,"animated_java.action.create_vanilla_block_display.title":yw,"animated_java.action.open_vanilla_item_display_config.name":ww,"animated_java.action.open_vanilla_block_display_config.name":xw,"animated_java.popup.loading.loading":kw,"animated_java.popup.loading.success":Ew,"animated_java.popup.loading.offline":Tw,"animated_java.dialog.about.title":Cw,"animated_java.dialog.about.close_button":Aw,"animated_java.dialog.unexpected_error.title":Sw,"animated_java.dialog.unexpected_error.close_button":jw,"animated_java.dialog.unexpected_error.copy_error_message_button.message":Iw,"animated_java.dialog.unexpected_error.copy_error_message_button.description":Ow,"animated_java.dialog.unexpected_error.paragraph":Nw,"animated_java.dialog.blueprint_settings.title":Bw,"animated_java.dialog.blueprint_settings.advanced_settings_warning":Dw,"animated_java.dialog.blueprint_settings.blueprint_name.title":Rw,"animated_java.dialog.blueprint_settings.blueprint_name.description":Mw,"animated_java.dialog.blueprint_settings.texture_size.title":Fw,"animated_java.dialog.blueprint_settings.texture_size.description":Lw,"animated_java.dialog.blueprint_settings.texture_size.warning.not_square":Pw,"animated_java.dialog.blueprint_settings.texture_size.warning.not_a_power_of_2":Vw,"animated_java.dialog.blueprint_settings.texture_size.warning.does_not_match_largest_texture":zw,"animated_java.dialog.blueprint_settings.export_settings.title":Uw,"animated_java.dialog.blueprint_settings.export_namespace.title":Gw,"animated_java.dialog.blueprint_settings.export_namespace.description":Jw,"animated_java.dialog.blueprint_settings.export_namespace.error.empty":Hw,"animated_java.dialog.blueprint_settings.export_namespace.error.reserved":$w,"animated_java.dialog.blueprint_settings.export_namespace.error.invalid_characters":Kw,"animated_java.dialog.blueprint_settings.enable_plugin_mode.title":qw,"animated_java.dialog.blueprint_settings.enable_plugin_mode.description":Ww,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.title":Zw,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.description":Xw,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.raw":Yw,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.zip":Qw,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.none":ex,"animated_java.dialog.blueprint_settings.data_pack_export_mode.title":tx,"animated_java.dialog.blueprint_settings.data_pack_export_mode.description":nx,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.raw":ix,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.zip":rx,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.none":ax,"animated_java.dialog.blueprint_settings.show_bounding_box.title":ox,"animated_java.dialog.blueprint_settings.show_bounding_box.description":sx,"animated_java.dialog.blueprint_settings.auto_bounding_box.title":lx,"animated_java.dialog.blueprint_settings.auto_bounding_box.description":cx,"animated_java.dialog.blueprint_settings.bounding_box.title":ux,"animated_java.dialog.blueprint_settings.bounding_box.description":dx,"animated_java.dialog.blueprint_settings.resource_pack_settings.title":fx,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_settings.title":mx,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_settings.description":px,"animated_java.dialog.blueprint_settings.display_item.title":_x,"animated_java.dialog.blueprint_settings.display_item.description":gx,"animated_java.dialog.blueprint_settings.display_item.error.no_item_selected":hx,"animated_java.dialog.blueprint_settings.display_item.error.invalid_item_id.no_namespace":bx,"animated_java.dialog.blueprint_settings.display_item.error.invalid_item_id.whitespace":vx,"animated_java.dialog.blueprint_settings.display_item.warning.item_does_not_exist":yx,"animated_java.dialog.blueprint_settings.custom_model_data_offset.title":wx,"animated_java.dialog.blueprint_settings.custom_model_data_offset.description":xx,"animated_java.dialog.blueprint_settings.resource_pack.title":kx,"animated_java.dialog.blueprint_settings.resource_pack.description":Ex,"animated_java.dialog.blueprint_settings.resource_pack.error.no_folder_selected":Tx,"animated_java.dialog.blueprint_settings.resource_pack.error.folder_does_not_exist":Cx,"animated_java.dialog.blueprint_settings.resource_pack.error.not_a_folder":Ax,"animated_java.dialog.blueprint_settings.resource_pack.error.missing_pack_mcmeta":Sx,"animated_java.dialog.blueprint_settings.resource_pack.error.missing_assets_folder":jx,"animated_java.dialog.blueprint_settings.resource_pack_zip.title":Ix,"animated_java.dialog.blueprint_settings.resource_pack_zip.description":Ox,"animated_java.dialog.blueprint_settings.resource_pack_zip.error.no_file_selected":Nx,"animated_java.dialog.blueprint_settings.resource_pack_zip.error.not_a_file":Bx,"animated_java.dialog.blueprint_settings.display_item_path.title":Dx,"animated_java.dialog.blueprint_settings.display_item_path.description":Rx,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.no_file_selected":Mx,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.file_does_not_exist":Fx,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.not_a_file":Lx,"animated_java.dialog.blueprint_settings.model_folder.title":Px,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.description":Vx,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.no_folder_selected":zx,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.folder_does_not_exist":Ux,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.not_a_folder":Gx,"animated_java.dialog.blueprint_settings.texture_folder.title":Jx,"animated_java.dialog.blueprint_settings.texture_folder.description":Hx,"animated_java.dialog.blueprint_settings.data_pack_settings.title":$x,"animated_java.dialog.blueprint_settings.enable_advanced_data_pack_settings.title":Kx,"animated_java.dialog.blueprint_settings.enable_advanced_data_pack_settings.description":qx,"animated_java.dialog.blueprint_settings.data_pack.title":Wx,"animated_java.dialog.blueprint_settings.data_pack.description":Zx,"animated_java.dialog.blueprint_settings.data_pack.error.no_folder_selected":Xx,"animated_java.dialog.blueprint_settings.data_pack.error.folder_does_not_exist":Yx,"animated_java.dialog.blueprint_settings.data_pack.error.not_a_folder":Qx,"animated_java.dialog.blueprint_settings.data_pack.error.missing_pack_mcmeta":ek,"animated_java.dialog.blueprint_settings.data_pack.error.missing_data_folder":tk,"animated_java.dialog.blueprint_settings.data_pack_zip.title":nk,"animated_java.dialog.blueprint_settings.data_pack_zip.description":ik,"animated_java.dialog.blueprint_settings.data_pack_zip.error.no_file_selected":rk,"animated_java.dialog.blueprint_settings.data_pack_zip.error.not_a_file":ak,"animated_java.dialog.blueprint_settings.summon_commands.title":ok,"animated_java.dialog.blueprint_settings.summon_commands.description":sk,"animated_java.dialog.blueprint_settings.interpolation_duration.title":lk,"animated_java.dialog.blueprint_settings.interpolation_duration.description":ck,"animated_java.dialog.blueprint_settings.teleportation_duration.title":uk,"animated_java.dialog.blueprint_settings.teleportation_duration.description":dk,"animated_java.dialog.blueprint_settings.use_storage_for_animation.title":fk,"animated_java.dialog.blueprint_settings.use_storage_for_animation.description":mk,"animated_java.dialog.blueprint_settings.baked_animations.title":pk,"animated_java.dialog.blueprint_settings.baked_animations.description":_k,"animated_java.dialog.blueprint_settings.json_file.title":gk,"animated_java.dialog.blueprint_settings.json_file.description":hk,"animated_java.dialog.blueprint_settings.json_file.error.no_file_selected":bk,"animated_java.dialog.blueprint_settings.json_file.error.not_a_file":vk,"animated_java.dialog.bone_config.title":yk,"animated_java.dialog.bone_config.selected_variant":wk,"animated_java.dialog.bone_config.default_variant_subtitle":xk,"animated_java.dialog.bone_config.selected_variant_subtitle":kk,"animated_java.dialog.bone_config.use_nbt.title":Ek,"animated_java.dialog.bone_config.use_nbt.description":Tk,"animated_java.dialog.bone_config.use_nbt.use_nbt_warning":Ck,"animated_java.dialog.bone_config.inherit_settings.title":Ak,"animated_java.dialog.bone_config.inherit_settings.description":Sk,"animated_java.dialog.bone_config.glowing.title":jk,"animated_java.dialog.bone_config.glowing.description":Ik,"animated_java.dialog.bone_config.override_glow_color.title":Ok,"animated_java.dialog.bone_config.override_glow_color.description":Nk,"animated_java.dialog.bone_config.glow_color.title":Bk,"animated_java.dialog.bone_config.glow_color.description":Dk,"animated_java.dialog.bone_config.shadow_radius.title":Rk,"animated_java.dialog.bone_config.shadow_radius.description":Mk,"animated_java.dialog.bone_config.shadow_strength.title":Fk,"animated_java.dialog.bone_config.shadow_strength.description":Lk,"animated_java.dialog.bone_config.override_brightness.title":Pk,"animated_java.dialog.bone_config.override_brightness.description":Vk,"animated_java.dialog.bone_config.brightness_override.title":zk,"animated_java.dialog.bone_config.brightness_override.description":Uk,"animated_java.dialog.bone_config.enchanted.title":Gk,"animated_java.dialog.bone_config.enchanted.description":Jk,"animated_java.dialog.bone_config.invisible.title":Hk,"animated_java.dialog.bone_config.invisible.description":$k,"animated_java.dialog.bone_config.nbt.title":Kk,"animated_java.dialog.bone_config.nbt.description":qk,"animated_java.dialog.bone_config.nbt.invalid_nbt.not_compound":Wk,"animated_java.dialog.bone_config.nbt.invalid_nbt.error":Zk,"animated_java.dialog.bone_config.billboard.title":Xk,"animated_java.dialog.bone_config.billboard.description":Yk,"animated_java.dialog.bone_config.billboard.options.fixed":Qk,"animated_java.dialog.bone_config.billboard.options.vertical":e2,"animated_java.dialog.bone_config.billboard.options.horizontal":t2,"animated_java.dialog.bone_config.billboard.options.center":n2,"animated_java.dialog.locator_config.title":i2,"animated_java.dialog.locator_config.plugin_mode_warning":r2,"animated_java.dialog.locator_config.use_entity.title":a2,"animated_java.dialog.locator_config.use_entity.description":o2,"animated_java.dialog.locator_config.entity_type.title":s2,"animated_java.dialog.locator_config.entity_type.description":l2,"animated_java.dialog.locator_config.entity_type.error.empty":c2,"animated_java.dialog.locator_config.entity_type.warning.invalid":u2,"animated_java.dialog.locator_config.summon_commands.title":d2,"animated_java.dialog.locator_config.summon_commands.description":f2,"animated_java.dialog.locator_config.ticking_commands.title":m2,"animated_java.dialog.locator_config.ticking_commands.description":p2,"animated_java.dialog.text_display_config.title":_2,"animated_java.dialog.bone_config.vanilla_item_model.title":g2,"animated_java.dialog.bone_config.vanilla_item_model.description":h2,"animated_java.dialog.text_display_config.use_nbt.title":b2,"animated_java.dialog.text_display_config.use_nbt.description":v2,"animated_java.dialog.text_display_config.use_nbt.use_nbt_warning":y2,"animated_java.dialog.text_display_config.inherit_settings.title":w2,"animated_java.dialog.text_display_config.inherit_settings.description":x2,"animated_java.dialog.text_display_config.glowing.title":k2,"animated_java.dialog.text_display_config.glowing.description":E2,"animated_java.dialog.text_display_config.override_glow_color.title":T2,"animated_java.dialog.text_display_config.override_glow_color.description":C2,"animated_java.dialog.text_display_config.glow_color.title":A2,"animated_java.dialog.text_display_config.glow_color.description":S2,"animated_java.dialog.text_display_config.shadow_radius.title":j2,"animated_java.dialog.text_display_config.shadow_radius.description":I2,"animated_java.dialog.text_display_config.shadow_strength.title":O2,"animated_java.dialog.text_display_config.shadow_strength.description":N2,"animated_java.dialog.text_display_config.override_brightness.title":B2,"animated_java.dialog.text_display_config.override_brightness.description":D2,"animated_java.dialog.text_display_config.brightness_override.title":R2,"animated_java.dialog.text_display_config.brightness_override.description":M2,"animated_java.dialog.text_display_config.invisible.title":F2,"animated_java.dialog.text_display_config.invisible.description":L2,"animated_java.dialog.text_display_config.nbt.title":P2,"animated_java.dialog.text_display_config.nbt.description":V2,"animated_java.dialog.text_display_config.billboard.title":z2,"animated_java.dialog.text_display_config.billboard.description":U2,"animated_java.dialog.text_display_config.billboard.options.fixed":G2,"animated_java.dialog.text_display_config.billboard.options.vertical":J2,"animated_java.dialog.text_display_config.billboard.options.horizontal":H2,"animated_java.dialog.text_display_config.billboard.options.center":$2,"animated_java.dialog.vanilla_block_display_config.title":K2,"animated_java.dialog.vanilla_item_display_config.title":q2,"animated_java.dialog.variant_config.title":W2,"animated_java.dialog.variant_config.variant_display_name":Z2,"animated_java.dialog.variant_config.variant_display_name.description":X2,"animated_java.dialog.variant_config.generate_name_from_display_name":Y2,"animated_java.dialog.variant_config.generate_name_from_display_name.description":Q2,"animated_java.dialog.variant_config.variant_name":e5,"animated_java.dialog.variant_config.variant_name.description":t5,"animated_java.dialog.variant_config.texture_map.title":n5,"animated_java.dialog.variant_config.texture_map.description":i5,"animated_java.dialog.variant_config.texture_map.create_new_mapping":r5,"animated_java.dialog.variant_config.texture_map.no_mappings":a5,"animated_java.dialog.variant_config.bone_lists.description":o5,"animated_java.dialog.variant_config.excluded_nodes.title":s5,"animated_java.dialog.variant_config.excluded_nodes.description":l5,"animated_java.dialog.variant_config.included_nodes.title":c5,"animated_java.dialog.variant_config.included_nodes.description":u5,"animated_java.dialog.variant_config.swap_columns_button.tooltip":d5,"animated_java.action.upgrade_old_aj_model_loader.name":f5,"animated_java.dialog.upgrade_old_aj_model_loader.title":m5,"animated_java.action.upgrade_old_aj_model_loader.select_file":p5,"animated_java.action.upgrade_old_aj_model_loader.body":_5,"animated_java.action.upgrade_old_aj_model_loader.button":g5,"animated_java.dialog.animation_properties.title":h5,"animated_java.dialog.animation_properties.animation_name.title":b5,"animated_java.dialog.animation_properties.animation_name.description":v5,"animated_java.dialog.animation_properties.loop_mode.title":y5,"animated_java.dialog.animation_properties.loop_mode.description":w5,"animated_java.dialog.animation_properties.loop_mode.options.once":x5,"animated_java.dialog.animation_properties.loop_mode.options.hold":k5,"animated_java.dialog.animation_properties.loop_mode.options.loop":E5,"animated_java.dialog.animation_properties.animation_name.error.empty":T5,"animated_java.dialog.animation_properties.animation_name.error.invalid_characters":C5,"animated_java.dialog.animation_properties.loop_delay.title":A5,"animated_java.dialog.animation_properties.loop_delay.description":S5,"animated_java.dialog.animation_properties.bone_lists.description":j5,"animated_java.dialog.animation_properties.excluded_nodes.title":I5,"animated_java.dialog.animation_properties.excluded_nodes.description":O5,"animated_java.dialog.animation_properties.included_nodes.title":N5,"animated_java.dialog.animation_properties.included_nodes.description":B5,"animated_java.dialog.animation_properties.swap_columns_button.tooltip":D5,"animated_java.dialog.export_progress.title":R5,"animated_java.dialog.blueprint_loading.title":M5,"animated_java.panel.variants.title":F5,"animated_java.panel.variants.tool.create_new_variant":L5,"animated_java.panel.variants.tool.edit_variant":P5,"animated_java.panel.variants.tool.duplicate_selected_variant":V5,"animated_java.panel.variants.tool.delete_selected_variant":z5,"animated_java.panel.variants.tool.variant_visible":U5,"animated_java.panel.variants.tool.variant_not_visible":G5,"animated_java.panel.variants.tool.cannot_delete_default_variant":J5,"animated_java.action.variants.create":H5,"animated_java.action.variants.duplicate":$5,"animated_java.action.variants.open_config":K5,"animated_java.action.variants.delete":q5,"animated_java.animation.excluded_nodes":W5,"animated_java.animation.invert_excluded_nodes":Z5,"animated_java.effect_animator.timeline.variant":X5,"animated_java.effect_animator.timeline.commands":Y5,"animated_java.effect_animator.keyframes.variant":Q5,"animated_java.effect_animator.keyframes.commands":eE,"animated_java.effect_animator.keyframes.execute_condition":tE,"animated_java.panel.keyframe.keyframe_title":nE,"animated_java.panel.keyframe.variant.title":iE,"animated_java.panel.keyframe.variant.description":rE,"animated_java.panel.keyframe.commands.title":aE,"animated_java.panel.keyframe.commands.description":oE,"animated_java.panel.keyframe.execute_condition.title":sE,"animated_java.panel.keyframe.execute_condition.description":lE,"animated_java.panel.keyframe.repeat.title":cE,"animated_java.panel.keyframe.repeat.description":uE,"animated_java.panel.keyframe.repeat_frequency.title":dE,"animated_java.panel.keyframe.repeat_frequency.description":fE,"animated_java.panel.keyframe.easing_type.title":mE,"animated_java.panel.keyframe.easing_type.description":pE,"animated_java.panel.keyframe.easing_type.options.linear":_E,"animated_java.panel.keyframe.easing_type.options.sine":gE,"animated_java.panel.keyframe.easing_type.options.quad":hE,"animated_java.panel.keyframe.easing_type.options.cubic":bE,"animated_java.panel.keyframe.easing_type.options.quart":vE,"animated_java.panel.keyframe.easing_type.options.quint":yE,"animated_java.panel.keyframe.easing_type.options.expo":wE,"animated_java.panel.keyframe.easing_type.options.circ":xE,"animated_java.panel.keyframe.easing_type.options.elastic":kE,"animated_java.panel.keyframe.easing_type.options.back":EE,"animated_java.panel.keyframe.easing_type.options.bounce":TE,"animated_java.panel.keyframe.easing_mode.title":CE,"animated_java.panel.keyframe.easing_mode.description":AE,"animated_java.panel.keyframe.easing_mode.options.in":SE,"animated_java.panel.keyframe.easing_mode.options.out":jE,"animated_java.panel.keyframe.easing_mode.options.inout":IE,"animated_java.panel.keyframe.easing_args.title":OE,"animated_java.panel.keyframe.easing_args.description":NE,"animated_java.panel.keyframe.easing_args.easing_arg.elastic.title":BE,"animated_java.panel.keyframe.easing_args.easing_arg.elastic.description":DE,"animated_java.panel.keyframe.easing_args.easing_arg.back.title":RE,"animated_java.panel.keyframe.easing_args.easing_arg.back.description":ME,"animated_java.panel.keyframe.easing_args.easing_arg.bounce.title":FE,"animated_java.panel.keyframe.easing_args.easing_arg.bounce.description":LE,"animated_java.panel.text_display.title":PE,"animated_java.tool.text_display.line_width.title":VE,"animated_java.tool.text_display.line_width.description":zE,"animated_java.tool.text_display.background_color.title":UE,"animated_java.tool.text_display.background_color.description":GE,"animated_java.tool.text_display.text_shadow.title":JE,"animated_java.tool.text_display.text_shadow.description":HE,"animated_java.tool.text_display.text_alignment.title":$E,"animated_java.tool.text_display.text_alignment.description":KE,"animated_java.tool.text_display.text_alignment.options.left":qE,"animated_java.tool.text_display.text_alignment.options.center":WE,"animated_java.tool.text_display.text_alignment.options.right":ZE,"animated_java.panel.vanilla_item_display.title":XE,"animated_java.panel.vanilla_item_display.description":YE,"animated_java.panel.vanilla_block_display.title":QE,"animated_java.panel.vanilla_block_display.description":eT,"animated_java.vanilla_item_display.title":tT,"animated_java.misc.failed_to_export.title":nT,"animated_java.misc.failed_to_export.custom_models.message":iT,"animated_java.misc.failed_to_export.blueprint_settings.message":rT,"animated_java.misc.failed_to_export.blueprint_settings.error_item":aT,"animated_java.misc.failed_to_export.button":oT,"animated_java.format_category.animated_java":sT,"animated_java.block_model_manager.fluid_warning":lT,"animated_java.block_model_manager.mob_head_warning":cT,"animated_java.block_model_manager.facing_warning":uT,"animated_java.error.blueprint_export_path_doesnt_exist.title":dT,"animated_java.error.blueprint_export_path_doesnt_exist.description":fT};var qd={};vn(qd,{"animated_java.action.create_text_display.title":()=>wT,"animated_java.action.create_vanilla_block_display.title":()=>kT,"animated_java.action.create_vanilla_item_display.title":()=>xT,"animated_java.action.export.name":()=>yT,"animated_java.action.open_about.name":()=>gT,"animated_java.action.open_blueprint_settings.name":()=>pT,"animated_java.action.open_bone_config.name":()=>hT,"animated_java.action.open_documentation.name":()=>_T,"animated_java.action.open_locator_config.name":()=>bT,"animated_java.action.open_text_display_config.name":()=>vT,"animated_java.action.open_vanilla_block_display_config.name":()=>TT,"animated_java.action.open_vanilla_item_display_config.name":()=>ET,"animated_java.action.upgrade_old_aj_model_loader.body":()=>yj,"animated_java.action.upgrade_old_aj_model_loader.button":()=>wj,"animated_java.action.upgrade_old_aj_model_loader.name":()=>hj,"animated_java.action.upgrade_old_aj_model_loader.select_file":()=>vj,"animated_java.action.variants.create":()=>Zj,"animated_java.action.variants.delete":()=>Qj,"animated_java.action.variants.duplicate":()=>Xj,"animated_java.action.variants.open_config":()=>Yj,"animated_java.animation.excluded_nodes":()=>eI,"animated_java.animation.invert_excluded_nodes":()=>tI,"animated_java.block_model_manager.facing_warning":()=>bO,"animated_java.block_model_manager.fluid_warning":()=>gO,"animated_java.block_model_manager.mob_head_warning":()=>hO,"animated_java.dialog.about.close_button":()=>NT,"animated_java.dialog.about.title":()=>OT,"animated_java.dialog.animation_properties.animation_name.description":()=>Ej,"animated_java.dialog.animation_properties.animation_name.error.empty":()=>Ij,"animated_java.dialog.animation_properties.animation_name.error.invalid_characters":()=>Oj,"animated_java.dialog.animation_properties.animation_name.title":()=>kj,"animated_java.dialog.animation_properties.bone_lists.description":()=>Dj,"animated_java.dialog.animation_properties.excluded_nodes.description":()=>Mj,"animated_java.dialog.animation_properties.excluded_nodes.title":()=>Rj,"animated_java.dialog.animation_properties.included_nodes.description":()=>Lj,"animated_java.dialog.animation_properties.included_nodes.title":()=>Fj,"animated_java.dialog.animation_properties.loop_delay.description":()=>Bj,"animated_java.dialog.animation_properties.loop_delay.title":()=>Nj,"animated_java.dialog.animation_properties.loop_mode.description":()=>Cj,"animated_java.dialog.animation_properties.loop_mode.options.hold":()=>Sj,"animated_java.dialog.animation_properties.loop_mode.options.loop":()=>jj,"animated_java.dialog.animation_properties.loop_mode.options.once":()=>Aj,"animated_java.dialog.animation_properties.loop_mode.title":()=>Tj,"animated_java.dialog.animation_properties.swap_columns_button.tooltip":()=>Pj,"animated_java.dialog.animation_properties.title":()=>xj,"animated_java.dialog.blueprint_loading.title":()=>zj,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.file_does_not_exist":()=>UC,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.no_file_selected":()=>zC,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.not_a_file":()=>GC,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.folder_does_not_exist":()=>KC,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.no_folder_selected":()=>$C,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.not_a_folder":()=>qC,"animated_java.dialog.blueprint_settings.advanced_settings_warning":()=>PT,"animated_java.dialog.blueprint_settings.auto_bounding_box.description":()=>pC,"animated_java.dialog.blueprint_settings.auto_bounding_box.title":()=>mC,"animated_java.dialog.blueprint_settings.baked_animations.description":()=>yA,"animated_java.dialog.blueprint_settings.baked_animations.title":()=>vA,"animated_java.dialog.blueprint_settings.blueprint_name.description":()=>zT,"animated_java.dialog.blueprint_settings.blueprint_name.title":()=>VT,"animated_java.dialog.blueprint_settings.bounding_box.description":()=>gC,"animated_java.dialog.blueprint_settings.bounding_box.title":()=>_C,"animated_java.dialog.blueprint_settings.custom_model_data_offset.description":()=>AC,"animated_java.dialog.blueprint_settings.custom_model_data_offset.title":()=>CC,"animated_java.dialog.blueprint_settings.data_pack.description":()=>tA,"animated_java.dialog.blueprint_settings.data_pack.error.folder_does_not_exist":()=>iA,"animated_java.dialog.blueprint_settings.data_pack.error.missing_data_folder":()=>oA,"animated_java.dialog.blueprint_settings.data_pack.error.missing_pack_mcmeta":()=>aA,"animated_java.dialog.blueprint_settings.data_pack.error.no_folder_selected":()=>nA,"animated_java.dialog.blueprint_settings.data_pack.error.not_a_folder":()=>rA,"animated_java.dialog.blueprint_settings.data_pack.title":()=>eA,"animated_java.dialog.blueprint_settings.data_pack_export_mode.description":()=>sC,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.none":()=>uC,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.raw":()=>lC,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.zip":()=>cC,"animated_java.dialog.blueprint_settings.data_pack_export_mode.title":()=>oC,"animated_java.dialog.blueprint_settings.data_pack_settings.title":()=>XC,"animated_java.dialog.blueprint_settings.data_pack_zip.description":()=>lA,"animated_java.dialog.blueprint_settings.data_pack_zip.error.no_file_selected":()=>cA,"animated_java.dialog.blueprint_settings.data_pack_zip.error.not_a_file":()=>uA,"animated_java.dialog.blueprint_settings.data_pack_zip.title":()=>sA,"animated_java.dialog.blueprint_settings.display_item.description":()=>wC,"animated_java.dialog.blueprint_settings.display_item.error.invalid_item_id.no_namespace":()=>kC,"animated_java.dialog.blueprint_settings.display_item.error.invalid_item_id.whitespace":()=>EC,"animated_java.dialog.blueprint_settings.display_item.error.no_item_selected":()=>xC,"animated_java.dialog.blueprint_settings.display_item.title":()=>yC,"animated_java.dialog.blueprint_settings.display_item.warning.item_does_not_exist":()=>TC,"animated_java.dialog.blueprint_settings.display_item_path.description":()=>VC,"animated_java.dialog.blueprint_settings.display_item_path.title":()=>PC,"animated_java.dialog.blueprint_settings.enable_advanced_data_pack_settings.description":()=>QC,"animated_java.dialog.blueprint_settings.enable_advanced_data_pack_settings.title":()=>YC,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_settings.description":()=>vC,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_settings.title":()=>bC,"animated_java.dialog.blueprint_settings.enable_plugin_mode.description":()=>eC,"animated_java.dialog.blueprint_settings.enable_plugin_mode.title":()=>QT,"animated_java.dialog.blueprint_settings.export_namespace.description":()=>WT,"animated_java.dialog.blueprint_settings.export_namespace.error.empty":()=>ZT,"animated_java.dialog.blueprint_settings.export_namespace.error.invalid_characters":()=>YT,"animated_java.dialog.blueprint_settings.export_namespace.error.reserved":()=>XT,"animated_java.dialog.blueprint_settings.export_namespace.title":()=>qT,"animated_java.dialog.blueprint_settings.export_settings.title":()=>KT,"animated_java.dialog.blueprint_settings.interpolation_duration.description":()=>pA,"animated_java.dialog.blueprint_settings.interpolation_duration.title":()=>mA,"animated_java.dialog.blueprint_settings.json_file.description":()=>xA,"animated_java.dialog.blueprint_settings.json_file.error.no_file_selected":()=>kA,"animated_java.dialog.blueprint_settings.json_file.error.not_a_file":()=>EA,"animated_java.dialog.blueprint_settings.json_file.title":()=>wA,"animated_java.dialog.blueprint_settings.model_folder.description":()=>HC,"animated_java.dialog.blueprint_settings.model_folder.title":()=>JC,"animated_java.dialog.blueprint_settings.resource_pack.description":()=>jC,"animated_java.dialog.blueprint_settings.resource_pack.error.folder_does_not_exist":()=>OC,"animated_java.dialog.blueprint_settings.resource_pack.error.missing_assets_folder":()=>DC,"animated_java.dialog.blueprint_settings.resource_pack.error.missing_pack_mcmeta":()=>BC,"animated_java.dialog.blueprint_settings.resource_pack.error.no_folder_selected":()=>IC,"animated_java.dialog.blueprint_settings.resource_pack.error.not_a_folder":()=>NC,"animated_java.dialog.blueprint_settings.resource_pack.title":()=>SC,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.description":()=>nC,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.none":()=>aC,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.raw":()=>iC,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.zip":()=>rC,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.title":()=>tC,"animated_java.dialog.blueprint_settings.resource_pack_settings.title":()=>hC,"animated_java.dialog.blueprint_settings.resource_pack_zip.description":()=>MC,"animated_java.dialog.blueprint_settings.resource_pack_zip.error.no_file_selected":()=>FC,"animated_java.dialog.blueprint_settings.resource_pack_zip.error.not_a_file":()=>LC,"animated_java.dialog.blueprint_settings.resource_pack_zip.title":()=>RC,"animated_java.dialog.blueprint_settings.show_bounding_box.description":()=>fC,"animated_java.dialog.blueprint_settings.show_bounding_box.title":()=>dC,"animated_java.dialog.blueprint_settings.summon_commands.description":()=>fA,"animated_java.dialog.blueprint_settings.summon_commands.title":()=>dA,"animated_java.dialog.blueprint_settings.teleportation_duration.description":()=>gA,"animated_java.dialog.blueprint_settings.teleportation_duration.title":()=>_A,"animated_java.dialog.blueprint_settings.texture_folder.description":()=>ZC,"animated_java.dialog.blueprint_settings.texture_folder.title":()=>WC,"animated_java.dialog.blueprint_settings.texture_size.description":()=>GT,"animated_java.dialog.blueprint_settings.texture_size.title":()=>UT,"animated_java.dialog.blueprint_settings.texture_size.warning.does_not_match_largest_texture":()=>$T,"animated_java.dialog.blueprint_settings.texture_size.warning.not_a_power_of_2":()=>HT,"animated_java.dialog.blueprint_settings.texture_size.warning.not_square":()=>JT,"animated_java.dialog.blueprint_settings.title":()=>LT,"animated_java.dialog.blueprint_settings.use_storage_for_animation.description":()=>bA,"animated_java.dialog.blueprint_settings.use_storage_for_animation.title":()=>hA,"animated_java.dialog.bone_config.billboard.description":()=>iS,"animated_java.dialog.bone_config.billboard.options.center":()=>sS,"animated_java.dialog.bone_config.billboard.options.fixed":()=>rS,"animated_java.dialog.bone_config.billboard.options.horizontal":()=>oS,"animated_java.dialog.bone_config.billboard.options.vertical":()=>aS,"animated_java.dialog.bone_config.billboard.title":()=>nS,"animated_java.dialog.bone_config.brightness_override.description":()=>KA,"animated_java.dialog.bone_config.brightness_override.title":()=>$A,"animated_java.dialog.bone_config.default_variant_subtitle":()=>AA,"animated_java.dialog.bone_config.enchanted.description":()=>WA,"animated_java.dialog.bone_config.enchanted.title":()=>qA,"animated_java.dialog.bone_config.glow_color.description":()=>PA,"animated_java.dialog.bone_config.glow_color.title":()=>LA,"animated_java.dialog.bone_config.glowing.description":()=>RA,"animated_java.dialog.bone_config.glowing.title":()=>DA,"animated_java.dialog.bone_config.inherit_settings.description":()=>BA,"animated_java.dialog.bone_config.inherit_settings.title":()=>NA,"animated_java.dialog.bone_config.invisible.description":()=>XA,"animated_java.dialog.bone_config.invisible.title":()=>ZA,"animated_java.dialog.bone_config.nbt.description":()=>QA,"animated_java.dialog.bone_config.nbt.invalid_nbt.error":()=>tS,"animated_java.dialog.bone_config.nbt.invalid_nbt.not_compound":()=>eS,"animated_java.dialog.bone_config.nbt.title":()=>YA,"animated_java.dialog.bone_config.override_brightness.description":()=>HA,"animated_java.dialog.bone_config.override_brightness.title":()=>JA,"animated_java.dialog.bone_config.override_glow_color.description":()=>FA,"animated_java.dialog.bone_config.override_glow_color.title":()=>MA,"animated_java.dialog.bone_config.selected_variant":()=>CA,"animated_java.dialog.bone_config.selected_variant_subtitle":()=>SA,"animated_java.dialog.bone_config.shadow_radius.description":()=>zA,"animated_java.dialog.bone_config.shadow_radius.title":()=>VA,"animated_java.dialog.bone_config.shadow_strength.description":()=>GA,"animated_java.dialog.bone_config.shadow_strength.title":()=>UA,"animated_java.dialog.bone_config.title":()=>TA,"animated_java.dialog.bone_config.use_nbt.description":()=>IA,"animated_java.dialog.bone_config.use_nbt.title":()=>jA,"animated_java.dialog.bone_config.use_nbt.use_nbt_warning":()=>OA,"animated_java.dialog.bone_config.vanilla_item_model.description":()=>xS,"animated_java.dialog.bone_config.vanilla_item_model.title":()=>wS,"animated_java.dialog.export_progress.title":()=>Vj,"animated_java.dialog.installed_popup.close_button":()=>IT,"animated_java.dialog.installed_popup.title":()=>jT,"animated_java.dialog.locator_config.entity_type.description":()=>mS,"animated_java.dialog.locator_config.entity_type.error.empty":()=>pS,"animated_java.dialog.locator_config.entity_type.title":()=>fS,"animated_java.dialog.locator_config.entity_type.warning.invalid":()=>_S,"animated_java.dialog.locator_config.plugin_mode_warning":()=>cS,"animated_java.dialog.locator_config.summon_commands.description":()=>hS,"animated_java.dialog.locator_config.summon_commands.title":()=>gS,"animated_java.dialog.locator_config.ticking_commands.description":()=>vS,"animated_java.dialog.locator_config.ticking_commands.title":()=>bS,"animated_java.dialog.locator_config.title":()=>lS,"animated_java.dialog.locator_config.use_entity.description":()=>dS,"animated_java.dialog.locator_config.use_entity.title":()=>uS,"animated_java.dialog.text_display_config.billboard.description":()=>KS,"animated_java.dialog.text_display_config.billboard.options.center":()=>XS,"animated_java.dialog.text_display_config.billboard.options.fixed":()=>qS,"animated_java.dialog.text_display_config.billboard.options.horizontal":()=>ZS,"animated_java.dialog.text_display_config.billboard.options.vertical":()=>WS,"animated_java.dialog.text_display_config.billboard.title":()=>$S,"animated_java.dialog.text_display_config.brightness_override.description":()=>zS,"animated_java.dialog.text_display_config.brightness_override.title":()=>VS,"animated_java.dialog.text_display_config.glow_color.description":()=>BS,"animated_java.dialog.text_display_config.glow_color.title":()=>NS,"animated_java.dialog.text_display_config.glowing.description":()=>jS,"animated_java.dialog.text_display_config.glowing.title":()=>SS,"animated_java.dialog.text_display_config.inherit_settings.description":()=>AS,"animated_java.dialog.text_display_config.inherit_settings.title":()=>CS,"animated_java.dialog.text_display_config.invisible.description":()=>GS,"animated_java.dialog.text_display_config.invisible.title":()=>US,"animated_java.dialog.text_display_config.nbt.description":()=>HS,"animated_java.dialog.text_display_config.nbt.title":()=>JS,"animated_java.dialog.text_display_config.override_brightness.description":()=>PS,"animated_java.dialog.text_display_config.override_brightness.title":()=>LS,"animated_java.dialog.text_display_config.override_glow_color.description":()=>OS,"animated_java.dialog.text_display_config.override_glow_color.title":()=>IS,"animated_java.dialog.text_display_config.shadow_radius.description":()=>RS,"animated_java.dialog.text_display_config.shadow_radius.title":()=>DS,"animated_java.dialog.text_display_config.shadow_strength.description":()=>FS,"animated_java.dialog.text_display_config.shadow_strength.title":()=>MS,"animated_java.dialog.text_display_config.title":()=>yS,"animated_java.dialog.text_display_config.use_nbt.description":()=>ES,"animated_java.dialog.text_display_config.use_nbt.title":()=>kS,"animated_java.dialog.text_display_config.use_nbt.use_nbt_warning":()=>TS,"animated_java.dialog.unexpected_error.close_button":()=>DT,"animated_java.dialog.unexpected_error.copy_error_message_button.description":()=>MT,"animated_java.dialog.unexpected_error.copy_error_message_button.message":()=>RT,"animated_java.dialog.unexpected_error.paragraph":()=>FT,"animated_java.dialog.unexpected_error.title":()=>BT,"animated_java.dialog.upgrade_old_aj_model_loader.title":()=>bj,"animated_java.dialog.vanilla_block_display_config.title":()=>YS,"animated_java.dialog.vanilla_item_display_config.title":()=>QS,"animated_java.dialog.variant_config.bone_lists.description":()=>dj,"animated_java.dialog.variant_config.excluded_nodes.description":()=>mj,"animated_java.dialog.variant_config.excluded_nodes.title":()=>fj,"animated_java.dialog.variant_config.generate_name_from_display_name":()=>ij,"animated_java.dialog.variant_config.generate_name_from_display_name.description":()=>rj,"animated_java.dialog.variant_config.included_nodes.description":()=>_j,"animated_java.dialog.variant_config.included_nodes.title":()=>pj,"animated_java.dialog.variant_config.swap_columns_button.tooltip":()=>gj,"animated_java.dialog.variant_config.texture_map.create_new_mapping":()=>cj,"animated_java.dialog.variant_config.texture_map.description":()=>lj,"animated_java.dialog.variant_config.texture_map.no_mappings":()=>uj,"animated_java.dialog.variant_config.texture_map.title":()=>sj,"animated_java.dialog.variant_config.title":()=>ej,"animated_java.dialog.variant_config.variant_display_name":()=>tj,"animated_java.dialog.variant_config.variant_display_name.description":()=>nj,"animated_java.dialog.variant_config.variant_name":()=>aj,"animated_java.dialog.variant_config.variant_name.description":()=>oj,"animated_java.effect_animator.keyframes.commands":()=>aI,"animated_java.effect_animator.keyframes.execute_condition":()=>oI,"animated_java.effect_animator.keyframes.variant":()=>rI,"animated_java.effect_animator.timeline.commands":()=>iI,"animated_java.effect_animator.timeline.variant":()=>nI,"animated_java.error.blueprint_export_path_doesnt_exist.description":()=>yO,"animated_java.error.blueprint_export_path_doesnt_exist.title":()=>vO,"animated_java.format_category.animated_java":()=>_O,"animated_java.misc.failed_to_export.blueprint_settings.error_item":()=>mO,"animated_java.misc.failed_to_export.blueprint_settings.message":()=>fO,"animated_java.misc.failed_to_export.button":()=>pO,"animated_java.misc.failed_to_export.custom_models.message":()=>dO,"animated_java.misc.failed_to_export.title":()=>uO,"animated_java.panel.keyframe.commands.description":()=>dI,"animated_java.panel.keyframe.commands.title":()=>uI,"animated_java.panel.keyframe.easing_args.description":()=>FI,"animated_java.panel.keyframe.easing_args.easing_arg.back.description":()=>zI,"animated_java.panel.keyframe.easing_args.easing_arg.back.title":()=>VI,"animated_java.panel.keyframe.easing_args.easing_arg.bounce.description":()=>GI,"animated_java.panel.keyframe.easing_args.easing_arg.bounce.title":()=>UI,"animated_java.panel.keyframe.easing_args.easing_arg.elastic.description":()=>PI,"animated_java.panel.keyframe.easing_args.easing_arg.elastic.title":()=>LI,"animated_java.panel.keyframe.easing_args.title":()=>MI,"animated_java.panel.keyframe.easing_mode.description":()=>NI,"animated_java.panel.keyframe.easing_mode.options.in":()=>BI,"animated_java.panel.keyframe.easing_mode.options.inout":()=>RI,"animated_java.panel.keyframe.easing_mode.options.out":()=>DI,"animated_java.panel.keyframe.easing_mode.title":()=>OI,"animated_java.panel.keyframe.easing_type.description":()=>vI,"animated_java.panel.keyframe.easing_type.options.back":()=>jI,"animated_java.panel.keyframe.easing_type.options.bounce":()=>II,"animated_java.panel.keyframe.easing_type.options.circ":()=>AI,"animated_java.panel.keyframe.easing_type.options.cubic":()=>kI,"animated_java.panel.keyframe.easing_type.options.elastic":()=>SI,"animated_java.panel.keyframe.easing_type.options.expo":()=>CI,"animated_java.panel.keyframe.easing_type.options.linear":()=>yI,"animated_java.panel.keyframe.easing_type.options.quad":()=>xI,"animated_java.panel.keyframe.easing_type.options.quart":()=>EI,"animated_java.panel.keyframe.easing_type.options.quint":()=>TI,"animated_java.panel.keyframe.easing_type.options.sine":()=>wI,"animated_java.panel.keyframe.easing_type.title":()=>bI,"animated_java.panel.keyframe.execute_condition.description":()=>mI,"animated_java.panel.keyframe.execute_condition.title":()=>fI,"animated_java.panel.keyframe.keyframe_title":()=>sI,"animated_java.panel.keyframe.nonlinear_interpolation":()=>JI,"animated_java.panel.keyframe.repeat.description":()=>_I,"animated_java.panel.keyframe.repeat.title":()=>pI,"animated_java.panel.keyframe.repeat_frequency.description":()=>hI,"animated_java.panel.keyframe.repeat_frequency.title":()=>gI,"animated_java.panel.keyframe.variant.description":()=>cI,"animated_java.panel.keyframe.variant.title":()=>lI,"animated_java.panel.text_display.title":()=>HI,"animated_java.panel.vanilla_block_display.description":()=>lO,"animated_java.panel.vanilla_block_display.title":()=>sO,"animated_java.panel.vanilla_item_display.description":()=>oO,"animated_java.panel.vanilla_item_display.title":()=>aO,"animated_java.panel.variants.title":()=>Uj,"animated_java.panel.variants.tool.cannot_delete_default_variant":()=>Wj,"animated_java.panel.variants.tool.create_new_variant":()=>Gj,"animated_java.panel.variants.tool.delete_selected_variant":()=>$j,"animated_java.panel.variants.tool.duplicate_selected_variant":()=>Hj,"animated_java.panel.variants.tool.edit_variant":()=>Jj,"animated_java.panel.variants.tool.variant_not_visible":()=>qj,"animated_java.panel.variants.tool.variant_visible":()=>Kj,"animated_java.popup.loading.loading":()=>CT,"animated_java.popup.loading.offline":()=>ST,"animated_java.popup.loading.success":()=>AT,"animated_java.tool.text_display.background_color.description":()=>WI,"animated_java.tool.text_display.background_color.title":()=>qI,"animated_java.tool.text_display.line_width.description":()=>KI,"animated_java.tool.text_display.line_width.title":()=>$I,"animated_java.tool.text_display.see_through.description":()=>rO,"animated_java.tool.text_display.see_through.title":()=>iO,"animated_java.tool.text_display.text_alignment.description":()=>QI,"animated_java.tool.text_display.text_alignment.options.center":()=>tO,"animated_java.tool.text_display.text_alignment.options.left":()=>eO,"animated_java.tool.text_display.text_alignment.options.right":()=>nO,"animated_java.tool.text_display.text_alignment.title":()=>YI,"animated_java.tool.text_display.text_shadow.description":()=>XI,"animated_java.tool.text_display.text_shadow.title":()=>ZI,"animated_java.vanilla_item_display.title":()=>cO,default:()=>wO});var pT="Blueprint Settings",_T="Documentation",gT="About",hT="Bone Config",bT="Locator Config",vT="Text Display Config",yT="Export",wT="Add Text Display",xT="Add Vanilla Item Display",kT="Add Vanilla Block Display",ET="Vanilla Item Display Config",TT="Vanilla Block Display Config",CT="Loading Animated Java...",AT="Animated Java Loaded Successfully!",ST=`Animated Java Failed to Connect! -Some features may be unavailable.`,jT="Thank you for installing!",IT="Let's Get Animating!",OT="About Animated Java",NT="Close",BT="An Unexpected Error Occurred!",DT="Close",RT="Error Message Copied to Clipboard!",MT="Click to copy the error message to the clipboard.",FT="Please report this error by joining our {0} and creating a thread in the #animated-java-support channel, or by creating an issue on our {1}. Thank you!",LT="Blueprint Settings",PT="Advanced settings should only be used if absolutely needed!",VT="Blueprint Name",zT="The name of the Blueprint. Only used to identify the project in the workspace.",UT="Texture Size",GT="The resolution of the UV editor. This should be the same size as the largest texture. For best results use a square texture, and make sure it's size is a power of 2.",JT="The Texture Size should be square for best results.",HT="The Texture Size should be a power of 2 for best results.",$T="The Texture Size should match the largest texture's size.",KT="Export Settings",qT="Export Namespace",WT="The namespace to export the project to. This is the namespace that will be used in the exported Resource Pack and Data Pack.",ZT="The export namespace cannot be empty!",XT='The export namespace "{0}" is reserved for internal functionality! Please choose a different namespace.',YT="The export namespace contains invalid characters! Namespaces can only contain letters, numbers, and underscores.",QT="Plugin Mode",eC="Whether or not to enable Plugin Mode. Enable when you plan to use a Plugin-based solution instead of a Resource Pack and/or Data Pack.",tC="Resource Pack Export Mode",nC=`Determines how the Resource Pack should be exported. +Falls dieser Wert gr\xF6\xDFer als die L\xE4nge der Animation ist, werden die Befehle nur einmal ausgef\xFChrt (sobald der Keyframe erreicht wird).`,HE="Gl\xE4ttungsart",$E="Die Gl\xE4ttungsart, die bei diesem Keyframe angewendet wird.",qE="Linear",KE="Sinus",WE="Quad",ZE="Kubisch",XE="Quart",YE="Quint",QE="Expo",eT="Circ",tT="Elastisch",nT="Zur\xFCck",iT="Abprallen",rT="Gl\xE4ttungs-Modus",aT="Die Gl\xE4ttungs-Modus, die bei diesem Keyframe angewendet wird.",oT="Ein",sT="Aus",lT="Ein-Aus",cT="Gl\xE4ttungs-Argumente",uT="Die Argumente, die auf die Gl\xE4ttungsfunktion angewendet werden soll.",dT="Elastizit\xE4t",fT="Die Elastizit\xE4t der Gl\xE4ttungsfunktion.",mT="\xDCberschwingen",pT="Der Betrag des \xDCberschwingens, der auf die Gl\xE4ttungsfunktion angewendet werden soll.",_T="Sprungkraft",gT="Die Sprungkraft der Gl\xE4ttungsfunktion.",hT="Textanzeige",bT="Zeilenbreite",vT="Die Breite der Textanzeige in Pixeln.",yT="Hintergrundsfarbe",wT="Die Farbe des Hintergrunds der Textanzeige",xT="Textschatten",kT="Ob die Textanzeige einen Schatten hinter dem Text anzeigt oder nicht.",ET="Textausrichtung",TT="Die Ausrichtung des Textes.",CT="Links",AT="Mitte",ST="Rechts",jT="Angezeigtes Item",IT="Das Item, dass angezeigt werden soll.",OT="Angezeigter Block",NT="Der Block, der angezeigt werden soll. Unterst\xFCtzt Block states!",BT="Vanilla Item Anzeige",RT="Fehler beim Exportieren",DT="Sie haben den Export des Ressourcenpakets deaktiviert, haben aber benutzerdefinierte Modelle im Projekt! Bitte aktivieren Sie den Export des Ressourcenpakets oder entfernen sie benutzerdefinierte Modelle vor dem Export.",MT="Ihre Blaupause-Einstellungen ist fehlerhaft! Bitte beheben Sie diese, bevor Sie exportieren.",FT="Ein Problem ist aufgetreten mit {0}:",LT="Ok",PT="Animated Java",VT="Fl\xFCssigkeiten renderen nicht in Blockanzeigen.",zT="Mob-K\xF6pfe renderen nicht in Blockanzeigen. Benutzen Sie stattdessen Itemanzeigen.",GT='Der Blockzustand "facing" wird in Blockanzeigen nicht unterst\xFCtzt.',UT="Blaupause-Exportpfad Existiert Nicht",JT=`Der Exportpfad '{0}' existiert nicht! +Vergewissern Sie sich, dass der Ordner, in dem Sie speichern wollen, existiert, und versuchen Sie es erneut.`,HT={"animated_java.action.open_blueprint_settings.name":Uw,"animated_java.action.open_documentation.name":Jw,"animated_java.action.open_about.name":Hw,"animated_java.action.open_bone_config.name":$w,"animated_java.action.open_locator_config.name":qw,"animated_java.action.open_text_display_config.name":Kw,"animated_java.action.export.name":Ww,"animated_java.action.create_text_display.title":Zw,"animated_java.action.create_vanilla_item_display.title":Xw,"animated_java.action.create_vanilla_block_display.title":Yw,"animated_java.action.open_vanilla_item_display_config.name":Qw,"animated_java.action.open_vanilla_block_display_config.name":ex,"animated_java.popup.loading.loading":tx,"animated_java.popup.loading.success":nx,"animated_java.popup.loading.offline":ix,"animated_java.dialog.about.title":rx,"animated_java.dialog.about.close_button":ax,"animated_java.dialog.unexpected_error.title":ox,"animated_java.dialog.unexpected_error.close_button":sx,"animated_java.dialog.unexpected_error.copy_error_message_button.message":lx,"animated_java.dialog.unexpected_error.copy_error_message_button.description":cx,"animated_java.dialog.unexpected_error.paragraph":ux,"animated_java.dialog.blueprint_settings.title":dx,"animated_java.dialog.blueprint_settings.advanced_settings_warning":fx,"animated_java.dialog.blueprint_settings.blueprint_name.title":mx,"animated_java.dialog.blueprint_settings.blueprint_name.description":px,"animated_java.dialog.blueprint_settings.texture_size.title":_x,"animated_java.dialog.blueprint_settings.texture_size.description":gx,"animated_java.dialog.blueprint_settings.texture_size.warning.not_square":hx,"animated_java.dialog.blueprint_settings.texture_size.warning.not_a_power_of_2":bx,"animated_java.dialog.blueprint_settings.texture_size.warning.does_not_match_largest_texture":vx,"animated_java.dialog.blueprint_settings.export_settings.title":yx,"animated_java.dialog.blueprint_settings.export_namespace.title":wx,"animated_java.dialog.blueprint_settings.export_namespace.description":xx,"animated_java.dialog.blueprint_settings.export_namespace.error.empty":kx,"animated_java.dialog.blueprint_settings.export_namespace.error.reserved":Ex,"animated_java.dialog.blueprint_settings.export_namespace.error.invalid_characters":Tx,"animated_java.dialog.blueprint_settings.enable_plugin_mode.title":Cx,"animated_java.dialog.blueprint_settings.enable_plugin_mode.description":Ax,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.title":Sx,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.description":jx,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.raw":Ix,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.zip":Ox,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.none":Nx,"animated_java.dialog.blueprint_settings.data_pack_export_mode.title":Bx,"animated_java.dialog.blueprint_settings.data_pack_export_mode.description":Rx,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.raw":Dx,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.zip":Mx,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.none":Fx,"animated_java.dialog.blueprint_settings.show_bounding_box.title":Lx,"animated_java.dialog.blueprint_settings.show_bounding_box.description":Px,"animated_java.dialog.blueprint_settings.auto_bounding_box.title":Vx,"animated_java.dialog.blueprint_settings.auto_bounding_box.description":zx,"animated_java.dialog.blueprint_settings.bounding_box.title":Gx,"animated_java.dialog.blueprint_settings.bounding_box.description":Ux,"animated_java.dialog.blueprint_settings.resource_pack_settings.title":Jx,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_settings.title":Hx,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_settings.description":$x,"animated_java.dialog.blueprint_settings.display_item.title":qx,"animated_java.dialog.blueprint_settings.display_item.description":Kx,"animated_java.dialog.blueprint_settings.display_item.error.no_item_selected":Wx,"animated_java.dialog.blueprint_settings.display_item.error.invalid_item_id.no_namespace":Zx,"animated_java.dialog.blueprint_settings.display_item.error.invalid_item_id.whitespace":Xx,"animated_java.dialog.blueprint_settings.display_item.warning.item_does_not_exist":Yx,"animated_java.dialog.blueprint_settings.custom_model_data_offset.title":Qx,"animated_java.dialog.blueprint_settings.custom_model_data_offset.description":ek,"animated_java.dialog.blueprint_settings.resource_pack.title":tk,"animated_java.dialog.blueprint_settings.resource_pack.description":nk,"animated_java.dialog.blueprint_settings.resource_pack.error.no_folder_selected":ik,"animated_java.dialog.blueprint_settings.resource_pack.error.folder_does_not_exist":rk,"animated_java.dialog.blueprint_settings.resource_pack.error.not_a_folder":ak,"animated_java.dialog.blueprint_settings.resource_pack.error.missing_pack_mcmeta":ok,"animated_java.dialog.blueprint_settings.resource_pack.error.missing_assets_folder":sk,"animated_java.dialog.blueprint_settings.resource_pack_zip.title":lk,"animated_java.dialog.blueprint_settings.resource_pack_zip.description":ck,"animated_java.dialog.blueprint_settings.resource_pack_zip.error.no_file_selected":uk,"animated_java.dialog.blueprint_settings.resource_pack_zip.error.not_a_file":dk,"animated_java.dialog.blueprint_settings.display_item_path.title":fk,"animated_java.dialog.blueprint_settings.display_item_path.description":mk,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.no_file_selected":pk,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.file_does_not_exist":_k,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.not_a_file":gk,"animated_java.dialog.blueprint_settings.model_folder.title":hk,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.description":bk,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.no_folder_selected":vk,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.folder_does_not_exist":yk,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.not_a_folder":wk,"animated_java.dialog.blueprint_settings.texture_folder.title":xk,"animated_java.dialog.blueprint_settings.texture_folder.description":kk,"animated_java.dialog.blueprint_settings.data_pack_settings.title":Ek,"animated_java.dialog.blueprint_settings.enable_advanced_data_pack_settings.title":Tk,"animated_java.dialog.blueprint_settings.enable_advanced_data_pack_settings.description":Ck,"animated_java.dialog.blueprint_settings.data_pack.title":Ak,"animated_java.dialog.blueprint_settings.data_pack.description":Sk,"animated_java.dialog.blueprint_settings.data_pack.error.no_folder_selected":jk,"animated_java.dialog.blueprint_settings.data_pack.error.folder_does_not_exist":Ik,"animated_java.dialog.blueprint_settings.data_pack.error.not_a_folder":Ok,"animated_java.dialog.blueprint_settings.data_pack.error.missing_pack_mcmeta":Nk,"animated_java.dialog.blueprint_settings.data_pack.error.missing_data_folder":Bk,"animated_java.dialog.blueprint_settings.data_pack_zip.title":Rk,"animated_java.dialog.blueprint_settings.data_pack_zip.description":Dk,"animated_java.dialog.blueprint_settings.data_pack_zip.error.no_file_selected":Mk,"animated_java.dialog.blueprint_settings.data_pack_zip.error.not_a_file":Fk,"animated_java.dialog.blueprint_settings.summon_commands.title":Lk,"animated_java.dialog.blueprint_settings.summon_commands.description":Pk,"animated_java.dialog.blueprint_settings.interpolation_duration.title":Vk,"animated_java.dialog.blueprint_settings.interpolation_duration.description":zk,"animated_java.dialog.blueprint_settings.teleportation_duration.title":Gk,"animated_java.dialog.blueprint_settings.teleportation_duration.description":Uk,"animated_java.dialog.blueprint_settings.use_storage_for_animation.title":Jk,"animated_java.dialog.blueprint_settings.use_storage_for_animation.description":Hk,"animated_java.dialog.blueprint_settings.baked_animations.title":$k,"animated_java.dialog.blueprint_settings.baked_animations.description":qk,"animated_java.dialog.blueprint_settings.json_file.title":Kk,"animated_java.dialog.blueprint_settings.json_file.description":Wk,"animated_java.dialog.blueprint_settings.json_file.error.no_file_selected":Zk,"animated_java.dialog.blueprint_settings.json_file.error.not_a_file":Xk,"animated_java.dialog.bone_config.title":Yk,"animated_java.dialog.bone_config.selected_variant":Qk,"animated_java.dialog.bone_config.default_variant_subtitle":e2,"animated_java.dialog.bone_config.selected_variant_subtitle":t2,"animated_java.dialog.bone_config.use_nbt.title":n2,"animated_java.dialog.bone_config.use_nbt.description":i2,"animated_java.dialog.bone_config.use_nbt.use_nbt_warning":r2,"animated_java.dialog.bone_config.inherit_settings.title":a2,"animated_java.dialog.bone_config.inherit_settings.description":o2,"animated_java.dialog.bone_config.glowing.title":s2,"animated_java.dialog.bone_config.glowing.description":l2,"animated_java.dialog.bone_config.override_glow_color.title":c2,"animated_java.dialog.bone_config.override_glow_color.description":u2,"animated_java.dialog.bone_config.glow_color.title":d2,"animated_java.dialog.bone_config.glow_color.description":f2,"animated_java.dialog.bone_config.shadow_radius.title":m2,"animated_java.dialog.bone_config.shadow_radius.description":p2,"animated_java.dialog.bone_config.shadow_strength.title":_2,"animated_java.dialog.bone_config.shadow_strength.description":g2,"animated_java.dialog.bone_config.override_brightness.title":h2,"animated_java.dialog.bone_config.override_brightness.description":b2,"animated_java.dialog.bone_config.brightness_override.title":v2,"animated_java.dialog.bone_config.brightness_override.description":y2,"animated_java.dialog.bone_config.enchanted.title":w2,"animated_java.dialog.bone_config.enchanted.description":x2,"animated_java.dialog.bone_config.invisible.title":k2,"animated_java.dialog.bone_config.invisible.description":E2,"animated_java.dialog.bone_config.nbt.title":T2,"animated_java.dialog.bone_config.nbt.description":C2,"animated_java.dialog.bone_config.nbt.invalid_nbt.not_compound":A2,"animated_java.dialog.bone_config.nbt.invalid_nbt.error":S2,"animated_java.dialog.bone_config.billboard.title":j2,"animated_java.dialog.bone_config.billboard.description":I2,"animated_java.dialog.bone_config.billboard.options.fixed":O2,"animated_java.dialog.bone_config.billboard.options.vertical":N2,"animated_java.dialog.bone_config.billboard.options.horizontal":B2,"animated_java.dialog.bone_config.billboard.options.center":R2,"animated_java.dialog.locator_config.title":D2,"animated_java.dialog.locator_config.plugin_mode_warning":M2,"animated_java.dialog.locator_config.use_entity.title":F2,"animated_java.dialog.locator_config.use_entity.description":L2,"animated_java.dialog.locator_config.entity_type.title":P2,"animated_java.dialog.locator_config.entity_type.description":V2,"animated_java.dialog.locator_config.entity_type.error.empty":z2,"animated_java.dialog.locator_config.entity_type.warning.invalid":G2,"animated_java.dialog.locator_config.summon_commands.title":U2,"animated_java.dialog.locator_config.summon_commands.description":J2,"animated_java.dialog.locator_config.ticking_commands.title":H2,"animated_java.dialog.locator_config.ticking_commands.description":$2,"animated_java.dialog.text_display_config.title":q2,"animated_java.dialog.bone_config.vanilla_item_model.title":K2,"animated_java.dialog.bone_config.vanilla_item_model.description":W2,"animated_java.dialog.text_display_config.use_nbt.title":Z2,"animated_java.dialog.text_display_config.use_nbt.description":X2,"animated_java.dialog.text_display_config.use_nbt.use_nbt_warning":Y2,"animated_java.dialog.text_display_config.inherit_settings.title":Q2,"animated_java.dialog.text_display_config.inherit_settings.description":e5,"animated_java.dialog.text_display_config.glowing.title":t5,"animated_java.dialog.text_display_config.glowing.description":n5,"animated_java.dialog.text_display_config.override_glow_color.title":i5,"animated_java.dialog.text_display_config.override_glow_color.description":r5,"animated_java.dialog.text_display_config.glow_color.title":a5,"animated_java.dialog.text_display_config.glow_color.description":o5,"animated_java.dialog.text_display_config.shadow_radius.title":s5,"animated_java.dialog.text_display_config.shadow_radius.description":l5,"animated_java.dialog.text_display_config.shadow_strength.title":c5,"animated_java.dialog.text_display_config.shadow_strength.description":u5,"animated_java.dialog.text_display_config.override_brightness.title":d5,"animated_java.dialog.text_display_config.override_brightness.description":f5,"animated_java.dialog.text_display_config.brightness_override.title":m5,"animated_java.dialog.text_display_config.brightness_override.description":p5,"animated_java.dialog.text_display_config.invisible.title":_5,"animated_java.dialog.text_display_config.invisible.description":g5,"animated_java.dialog.text_display_config.nbt.title":h5,"animated_java.dialog.text_display_config.nbt.description":b5,"animated_java.dialog.text_display_config.billboard.title":v5,"animated_java.dialog.text_display_config.billboard.description":y5,"animated_java.dialog.text_display_config.billboard.options.fixed":w5,"animated_java.dialog.text_display_config.billboard.options.vertical":x5,"animated_java.dialog.text_display_config.billboard.options.horizontal":k5,"animated_java.dialog.text_display_config.billboard.options.center":E5,"animated_java.dialog.vanilla_block_display_config.title":T5,"animated_java.dialog.vanilla_item_display_config.title":C5,"animated_java.dialog.variant_config.title":A5,"animated_java.dialog.variant_config.variant_display_name":S5,"animated_java.dialog.variant_config.variant_display_name.description":j5,"animated_java.dialog.variant_config.generate_name_from_display_name":I5,"animated_java.dialog.variant_config.generate_name_from_display_name.description":O5,"animated_java.dialog.variant_config.variant_name":N5,"animated_java.dialog.variant_config.variant_name.description":B5,"animated_java.dialog.variant_config.texture_map.title":R5,"animated_java.dialog.variant_config.texture_map.description":D5,"animated_java.dialog.variant_config.texture_map.create_new_mapping":M5,"animated_java.dialog.variant_config.texture_map.no_mappings":F5,"animated_java.dialog.variant_config.bone_lists.description":L5,"animated_java.dialog.variant_config.excluded_nodes.title":P5,"animated_java.dialog.variant_config.excluded_nodes.description":V5,"animated_java.dialog.variant_config.included_nodes.title":z5,"animated_java.dialog.variant_config.included_nodes.description":G5,"animated_java.dialog.variant_config.swap_columns_button.tooltip":U5,"animated_java.action.upgrade_old_aj_model_loader.name":J5,"animated_java.dialog.upgrade_old_aj_model_loader.title":H5,"animated_java.action.upgrade_old_aj_model_loader.select_file":$5,"animated_java.action.upgrade_old_aj_model_loader.body":q5,"animated_java.action.upgrade_old_aj_model_loader.button":K5,"animated_java.dialog.animation_properties.title":W5,"animated_java.dialog.animation_properties.animation_name.title":Z5,"animated_java.dialog.animation_properties.animation_name.description":X5,"animated_java.dialog.animation_properties.loop_mode.title":Y5,"animated_java.dialog.animation_properties.loop_mode.description":Q5,"animated_java.dialog.animation_properties.loop_mode.options.once":eE,"animated_java.dialog.animation_properties.loop_mode.options.hold":tE,"animated_java.dialog.animation_properties.loop_mode.options.loop":nE,"animated_java.dialog.animation_properties.animation_name.error.empty":iE,"animated_java.dialog.animation_properties.animation_name.error.invalid_characters":rE,"animated_java.dialog.animation_properties.loop_delay.title":aE,"animated_java.dialog.animation_properties.loop_delay.description":oE,"animated_java.dialog.animation_properties.bone_lists.description":sE,"animated_java.dialog.animation_properties.excluded_nodes.title":lE,"animated_java.dialog.animation_properties.excluded_nodes.description":cE,"animated_java.dialog.animation_properties.included_nodes.title":uE,"animated_java.dialog.animation_properties.included_nodes.description":dE,"animated_java.dialog.animation_properties.swap_columns_button.tooltip":fE,"animated_java.dialog.export_progress.title":mE,"animated_java.dialog.blueprint_loading.title":pE,"animated_java.panel.variants.title":_E,"animated_java.panel.variants.tool.create_new_variant":gE,"animated_java.panel.variants.tool.edit_variant":hE,"animated_java.panel.variants.tool.duplicate_selected_variant":bE,"animated_java.panel.variants.tool.delete_selected_variant":vE,"animated_java.panel.variants.tool.variant_visible":yE,"animated_java.panel.variants.tool.variant_not_visible":wE,"animated_java.panel.variants.tool.cannot_delete_default_variant":xE,"animated_java.action.variants.create":kE,"animated_java.action.variants.duplicate":EE,"animated_java.action.variants.open_config":TE,"animated_java.action.variants.delete":CE,"animated_java.animation.excluded_nodes":AE,"animated_java.animation.invert_excluded_nodes":SE,"animated_java.effect_animator.timeline.variant":jE,"animated_java.effect_animator.timeline.commands":IE,"animated_java.effect_animator.keyframes.variant":OE,"animated_java.effect_animator.keyframes.commands":NE,"animated_java.effect_animator.keyframes.execute_condition":BE,"animated_java.panel.keyframe.keyframe_title":RE,"animated_java.panel.keyframe.variant.title":DE,"animated_java.panel.keyframe.variant.description":ME,"animated_java.panel.keyframe.commands.title":FE,"animated_java.panel.keyframe.commands.description":LE,"animated_java.panel.keyframe.execute_condition.title":PE,"animated_java.panel.keyframe.execute_condition.description":VE,"animated_java.panel.keyframe.repeat.title":zE,"animated_java.panel.keyframe.repeat.description":GE,"animated_java.panel.keyframe.repeat_frequency.title":UE,"animated_java.panel.keyframe.repeat_frequency.description":JE,"animated_java.panel.keyframe.easing_type.title":HE,"animated_java.panel.keyframe.easing_type.description":$E,"animated_java.panel.keyframe.easing_type.options.linear":qE,"animated_java.panel.keyframe.easing_type.options.sine":KE,"animated_java.panel.keyframe.easing_type.options.quad":WE,"animated_java.panel.keyframe.easing_type.options.cubic":ZE,"animated_java.panel.keyframe.easing_type.options.quart":XE,"animated_java.panel.keyframe.easing_type.options.quint":YE,"animated_java.panel.keyframe.easing_type.options.expo":QE,"animated_java.panel.keyframe.easing_type.options.circ":eT,"animated_java.panel.keyframe.easing_type.options.elastic":tT,"animated_java.panel.keyframe.easing_type.options.back":nT,"animated_java.panel.keyframe.easing_type.options.bounce":iT,"animated_java.panel.keyframe.easing_mode.title":rT,"animated_java.panel.keyframe.easing_mode.description":aT,"animated_java.panel.keyframe.easing_mode.options.in":oT,"animated_java.panel.keyframe.easing_mode.options.out":sT,"animated_java.panel.keyframe.easing_mode.options.inout":lT,"animated_java.panel.keyframe.easing_args.title":cT,"animated_java.panel.keyframe.easing_args.description":uT,"animated_java.panel.keyframe.easing_args.easing_arg.elastic.title":dT,"animated_java.panel.keyframe.easing_args.easing_arg.elastic.description":fT,"animated_java.panel.keyframe.easing_args.easing_arg.back.title":mT,"animated_java.panel.keyframe.easing_args.easing_arg.back.description":pT,"animated_java.panel.keyframe.easing_args.easing_arg.bounce.title":_T,"animated_java.panel.keyframe.easing_args.easing_arg.bounce.description":gT,"animated_java.panel.text_display.title":hT,"animated_java.tool.text_display.line_width.title":bT,"animated_java.tool.text_display.line_width.description":vT,"animated_java.tool.text_display.background_color.title":yT,"animated_java.tool.text_display.background_color.description":wT,"animated_java.tool.text_display.text_shadow.title":xT,"animated_java.tool.text_display.text_shadow.description":kT,"animated_java.tool.text_display.text_alignment.title":ET,"animated_java.tool.text_display.text_alignment.description":TT,"animated_java.tool.text_display.text_alignment.options.left":CT,"animated_java.tool.text_display.text_alignment.options.center":AT,"animated_java.tool.text_display.text_alignment.options.right":ST,"animated_java.panel.vanilla_item_display.title":jT,"animated_java.panel.vanilla_item_display.description":IT,"animated_java.panel.vanilla_block_display.title":OT,"animated_java.panel.vanilla_block_display.description":NT,"animated_java.vanilla_item_display.title":BT,"animated_java.misc.failed_to_export.title":RT,"animated_java.misc.failed_to_export.custom_models.message":DT,"animated_java.misc.failed_to_export.blueprint_settings.message":MT,"animated_java.misc.failed_to_export.blueprint_settings.error_item":FT,"animated_java.misc.failed_to_export.button":LT,"animated_java.format_category.animated_java":PT,"animated_java.block_model_manager.fluid_warning":VT,"animated_java.block_model_manager.mob_head_warning":zT,"animated_java.block_model_manager.facing_warning":GT,"animated_java.error.blueprint_export_path_doesnt_exist.title":UT,"animated_java.error.blueprint_export_path_doesnt_exist.description":JT};var sf={};xn(sf,{"animated_java.action.create_text_display.title":()=>QT,"animated_java.action.create_vanilla_block_display.title":()=>tC,"animated_java.action.create_vanilla_item_display.title":()=>eC,"animated_java.action.export.name":()=>YT,"animated_java.action.open_about.name":()=>KT,"animated_java.action.open_blueprint_settings.name":()=>$T,"animated_java.action.open_bone_config.name":()=>WT,"animated_java.action.open_documentation.name":()=>qT,"animated_java.action.open_locator_config.name":()=>ZT,"animated_java.action.open_text_display_config.name":()=>XT,"animated_java.action.open_vanilla_block_display_config.name":()=>iC,"animated_java.action.open_vanilla_item_display_config.name":()=>nC,"animated_java.action.upgrade_old_aj_model_loader.body":()=>yI,"animated_java.action.upgrade_old_aj_model_loader.button":()=>wI,"animated_java.action.upgrade_old_aj_model_loader.name":()=>hI,"animated_java.action.upgrade_old_aj_model_loader.select_file":()=>vI,"animated_java.action.variants.create":()=>ZI,"animated_java.action.variants.delete":()=>QI,"animated_java.action.variants.duplicate":()=>XI,"animated_java.action.variants.open_config":()=>YI,"animated_java.animation.excluded_nodes":()=>eO,"animated_java.animation.invert_excluded_nodes":()=>tO,"animated_java.block_model_manager.facing_warning":()=>jN,"animated_java.block_model_manager.fluid_warning":()=>AN,"animated_java.block_model_manager.mob_head_warning":()=>SN,"animated_java.dialog.about.close_button":()=>dC,"animated_java.dialog.about.title":()=>uC,"animated_java.dialog.animation_properties.animation_name.description":()=>EI,"animated_java.dialog.animation_properties.animation_name.error.empty":()=>II,"animated_java.dialog.animation_properties.animation_name.error.invalid_characters":()=>OI,"animated_java.dialog.animation_properties.animation_name.title":()=>kI,"animated_java.dialog.animation_properties.bone_lists.description":()=>RI,"animated_java.dialog.animation_properties.excluded_nodes.description":()=>MI,"animated_java.dialog.animation_properties.excluded_nodes.title":()=>DI,"animated_java.dialog.animation_properties.included_nodes.description":()=>LI,"animated_java.dialog.animation_properties.included_nodes.title":()=>FI,"animated_java.dialog.animation_properties.loop_delay.description":()=>BI,"animated_java.dialog.animation_properties.loop_delay.title":()=>NI,"animated_java.dialog.animation_properties.loop_mode.description":()=>CI,"animated_java.dialog.animation_properties.loop_mode.options.hold":()=>SI,"animated_java.dialog.animation_properties.loop_mode.options.loop":()=>jI,"animated_java.dialog.animation_properties.loop_mode.options.once":()=>AI,"animated_java.dialog.animation_properties.loop_mode.title":()=>TI,"animated_java.dialog.animation_properties.swap_columns_button.tooltip":()=>PI,"animated_java.dialog.animation_properties.title":()=>xI,"animated_java.dialog.blueprint_loading.title":()=>zI,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.file_does_not_exist":()=>TA,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.no_file_selected":()=>EA,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.not_a_file":()=>CA,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.folder_does_not_exist":()=>IA,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.no_folder_selected":()=>jA,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.not_a_folder":()=>OA,"animated_java.dialog.blueprint_settings.advanced_settings_warning":()=>bC,"animated_java.dialog.blueprint_settings.auto_bounding_box.description":()=>qC,"animated_java.dialog.blueprint_settings.auto_bounding_box.title":()=>$C,"animated_java.dialog.blueprint_settings.baked_animations.description":()=>aS,"animated_java.dialog.blueprint_settings.baked_animations.title":()=>rS,"animated_java.dialog.blueprint_settings.blueprint_name.description":()=>yC,"animated_java.dialog.blueprint_settings.blueprint_name.title":()=>vC,"animated_java.dialog.blueprint_settings.bounding_box.description":()=>WC,"animated_java.dialog.blueprint_settings.bounding_box.title":()=>KC,"animated_java.dialog.blueprint_settings.custom_model_data_offset.description":()=>uA,"animated_java.dialog.blueprint_settings.custom_model_data_offset.title":()=>cA,"animated_java.dialog.blueprint_settings.data_pack.description":()=>LA,"animated_java.dialog.blueprint_settings.data_pack.error.folder_does_not_exist":()=>VA,"animated_java.dialog.blueprint_settings.data_pack.error.missing_data_folder":()=>UA,"animated_java.dialog.blueprint_settings.data_pack.error.missing_pack_mcmeta":()=>GA,"animated_java.dialog.blueprint_settings.data_pack.error.no_folder_selected":()=>PA,"animated_java.dialog.blueprint_settings.data_pack.error.not_a_folder":()=>zA,"animated_java.dialog.blueprint_settings.data_pack.title":()=>FA,"animated_java.dialog.blueprint_settings.data_pack_export_mode.description":()=>VC,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.none":()=>UC,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.raw":()=>zC,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.zip":()=>GC,"animated_java.dialog.blueprint_settings.data_pack_export_mode.title":()=>PC,"animated_java.dialog.blueprint_settings.data_pack_settings.title":()=>RA,"animated_java.dialog.blueprint_settings.data_pack_zip.description":()=>HA,"animated_java.dialog.blueprint_settings.data_pack_zip.error.no_file_selected":()=>$A,"animated_java.dialog.blueprint_settings.data_pack_zip.error.not_a_file":()=>qA,"animated_java.dialog.blueprint_settings.data_pack_zip.title":()=>JA,"animated_java.dialog.blueprint_settings.display_item.description":()=>nA,"animated_java.dialog.blueprint_settings.display_item.error.invalid_item_id.no_namespace":()=>rA,"animated_java.dialog.blueprint_settings.display_item.error.invalid_item_id.whitespace":()=>aA,"animated_java.dialog.blueprint_settings.display_item.error.item_model_not_found":()=>lA,"animated_java.dialog.blueprint_settings.display_item.error.no_item_selected":()=>iA,"animated_java.dialog.blueprint_settings.display_item.title":()=>tA,"animated_java.dialog.blueprint_settings.display_item.warning.item_does_not_exist":()=>oA,"animated_java.dialog.blueprint_settings.display_item.warning.item_model_not_generated":()=>sA,"animated_java.dialog.blueprint_settings.display_item_path.description":()=>kA,"animated_java.dialog.blueprint_settings.display_item_path.title":()=>xA,"animated_java.dialog.blueprint_settings.enable_advanced_data_pack_settings.description":()=>MA,"animated_java.dialog.blueprint_settings.enable_advanced_data_pack_settings.title":()=>DA,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_folders.description":()=>eA,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_folders.title":()=>QC,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_settings.description":()=>YC,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_settings.title":()=>XC,"animated_java.dialog.blueprint_settings.enable_plugin_mode.description":()=>BC,"animated_java.dialog.blueprint_settings.enable_plugin_mode.title":()=>NC,"animated_java.dialog.blueprint_settings.export_namespace.description":()=>SC,"animated_java.dialog.blueprint_settings.export_namespace.error.empty":()=>jC,"animated_java.dialog.blueprint_settings.export_namespace.error.invalid_characters":()=>OC,"animated_java.dialog.blueprint_settings.export_namespace.error.reserved":()=>IC,"animated_java.dialog.blueprint_settings.export_namespace.title":()=>AC,"animated_java.dialog.blueprint_settings.export_settings.title":()=>CC,"animated_java.dialog.blueprint_settings.interpolation_duration.description":()=>QA,"animated_java.dialog.blueprint_settings.interpolation_duration.title":()=>YA,"animated_java.dialog.blueprint_settings.json_file.description":()=>sS,"animated_java.dialog.blueprint_settings.json_file.error.no_file_selected":()=>lS,"animated_java.dialog.blueprint_settings.json_file.error.not_a_file":()=>cS,"animated_java.dialog.blueprint_settings.json_file.title":()=>oS,"animated_java.dialog.blueprint_settings.model_folder.description":()=>SA,"animated_java.dialog.blueprint_settings.model_folder.title":()=>AA,"animated_java.dialog.blueprint_settings.resource_pack.description":()=>fA,"animated_java.dialog.blueprint_settings.resource_pack.error.folder_does_not_exist":()=>pA,"animated_java.dialog.blueprint_settings.resource_pack.error.missing_assets_folder":()=>hA,"animated_java.dialog.blueprint_settings.resource_pack.error.missing_pack_mcmeta":()=>gA,"animated_java.dialog.blueprint_settings.resource_pack.error.no_folder_selected":()=>mA,"animated_java.dialog.blueprint_settings.resource_pack.error.not_a_folder":()=>_A,"animated_java.dialog.blueprint_settings.resource_pack.title":()=>dA,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.description":()=>DC,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.none":()=>LC,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.raw":()=>MC,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.zip":()=>FC,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.title":()=>RC,"animated_java.dialog.blueprint_settings.resource_pack_settings.title":()=>ZC,"animated_java.dialog.blueprint_settings.resource_pack_zip.description":()=>vA,"animated_java.dialog.blueprint_settings.resource_pack_zip.error.no_file_selected":()=>yA,"animated_java.dialog.blueprint_settings.resource_pack_zip.error.not_a_file":()=>wA,"animated_java.dialog.blueprint_settings.resource_pack_zip.title":()=>bA,"animated_java.dialog.blueprint_settings.show_bounding_box.description":()=>HC,"animated_java.dialog.blueprint_settings.show_bounding_box.title":()=>JC,"animated_java.dialog.blueprint_settings.summon_commands.description":()=>WA,"animated_java.dialog.blueprint_settings.summon_commands.title":()=>KA,"animated_java.dialog.blueprint_settings.teleportation_duration.description":()=>tS,"animated_java.dialog.blueprint_settings.teleportation_duration.title":()=>eS,"animated_java.dialog.blueprint_settings.texture_folder.description":()=>BA,"animated_java.dialog.blueprint_settings.texture_folder.title":()=>NA,"animated_java.dialog.blueprint_settings.texture_size.description":()=>xC,"animated_java.dialog.blueprint_settings.texture_size.title":()=>wC,"animated_java.dialog.blueprint_settings.texture_size.warning.does_not_match_largest_texture":()=>TC,"animated_java.dialog.blueprint_settings.texture_size.warning.not_a_power_of_2":()=>EC,"animated_java.dialog.blueprint_settings.texture_size.warning.not_square":()=>kC,"animated_java.dialog.blueprint_settings.ticking_commands.description":()=>XA,"animated_java.dialog.blueprint_settings.ticking_commands.title":()=>ZA,"animated_java.dialog.blueprint_settings.title":()=>hC,"animated_java.dialog.blueprint_settings.use_storage_for_animation.description":()=>iS,"animated_java.dialog.blueprint_settings.use_storage_for_animation.title":()=>nS,"animated_java.dialog.bone_config.billboard.description":()=>qS,"animated_java.dialog.bone_config.billboard.options.center":()=>XS,"animated_java.dialog.bone_config.billboard.options.fixed":()=>KS,"animated_java.dialog.bone_config.billboard.options.horizontal":()=>ZS,"animated_java.dialog.bone_config.billboard.options.vertical":()=>WS,"animated_java.dialog.bone_config.billboard.title":()=>$S,"animated_java.dialog.bone_config.brightness_override.description":()=>FS,"animated_java.dialog.bone_config.brightness_override.title":()=>MS,"animated_java.dialog.bone_config.custom_name.description":()=>yS,"animated_java.dialog.bone_config.custom_name.invalid_json.error":()=>wS,"animated_java.dialog.bone_config.custom_name.title":()=>vS,"animated_java.dialog.bone_config.custom_name_visible.description":()=>kS,"animated_java.dialog.bone_config.custom_name_visible.title":()=>xS,"animated_java.dialog.bone_config.default_variant_subtitle":()=>fS,"animated_java.dialog.bone_config.enchanted.description":()=>PS,"animated_java.dialog.bone_config.enchanted.title":()=>LS,"animated_java.dialog.bone_config.glow_color.description":()=>jS,"animated_java.dialog.bone_config.glow_color.title":()=>SS,"animated_java.dialog.bone_config.glowing.description":()=>TS,"animated_java.dialog.bone_config.glowing.title":()=>ES,"animated_java.dialog.bone_config.inherit_settings.description":()=>bS,"animated_java.dialog.bone_config.inherit_settings.title":()=>hS,"animated_java.dialog.bone_config.invisible.description":()=>zS,"animated_java.dialog.bone_config.invisible.title":()=>VS,"animated_java.dialog.bone_config.nbt.description":()=>US,"animated_java.dialog.bone_config.nbt.invalid_nbt.error":()=>HS,"animated_java.dialog.bone_config.nbt.invalid_nbt.not_compound":()=>JS,"animated_java.dialog.bone_config.nbt.title":()=>GS,"animated_java.dialog.bone_config.override_brightness.description":()=>DS,"animated_java.dialog.bone_config.override_brightness.title":()=>RS,"animated_java.dialog.bone_config.override_glow_color.description":()=>AS,"animated_java.dialog.bone_config.override_glow_color.title":()=>CS,"animated_java.dialog.bone_config.selected_variant":()=>dS,"animated_java.dialog.bone_config.selected_variant_subtitle":()=>mS,"animated_java.dialog.bone_config.shadow_radius.description":()=>OS,"animated_java.dialog.bone_config.shadow_radius.title":()=>IS,"animated_java.dialog.bone_config.shadow_strength.description":()=>BS,"animated_java.dialog.bone_config.shadow_strength.title":()=>NS,"animated_java.dialog.bone_config.title":()=>uS,"animated_java.dialog.bone_config.use_nbt.description":()=>_S,"animated_java.dialog.bone_config.use_nbt.title":()=>pS,"animated_java.dialog.bone_config.use_nbt.use_nbt_warning":()=>gS,"animated_java.dialog.bone_config.vanilla_item_model.description":()=>fj,"animated_java.dialog.bone_config.vanilla_item_model.title":()=>dj,"animated_java.dialog.export_progress.title":()=>VI,"animated_java.dialog.installed_popup.close_button":()=>lC,"animated_java.dialog.installed_popup.title":()=>sC,"animated_java.dialog.locator_config.entity_type.description":()=>ij,"animated_java.dialog.locator_config.entity_type.error.empty":()=>rj,"animated_java.dialog.locator_config.entity_type.title":()=>nj,"animated_java.dialog.locator_config.entity_type.warning.invalid":()=>aj,"animated_java.dialog.locator_config.plugin_mode_warning":()=>QS,"animated_java.dialog.locator_config.summon_commands.description":()=>sj,"animated_java.dialog.locator_config.summon_commands.title":()=>oj,"animated_java.dialog.locator_config.ticking_commands.description":()=>cj,"animated_java.dialog.locator_config.ticking_commands.title":()=>lj,"animated_java.dialog.locator_config.title":()=>YS,"animated_java.dialog.locator_config.use_entity.description":()=>tj,"animated_java.dialog.locator_config.use_entity.title":()=>ej,"animated_java.dialog.reset":()=>cC,"animated_java.dialog.text_display_config.billboard.description":()=>Fj,"animated_java.dialog.text_display_config.billboard.options.center":()=>zj,"animated_java.dialog.text_display_config.billboard.options.fixed":()=>Lj,"animated_java.dialog.text_display_config.billboard.options.horizontal":()=>Vj,"animated_java.dialog.text_display_config.billboard.options.vertical":()=>Pj,"animated_java.dialog.text_display_config.billboard.title":()=>Mj,"animated_java.dialog.text_display_config.brightness_override.description":()=>Oj,"animated_java.dialog.text_display_config.brightness_override.title":()=>Ij,"animated_java.dialog.text_display_config.glow_color.description":()=>kj,"animated_java.dialog.text_display_config.glow_color.title":()=>xj,"animated_java.dialog.text_display_config.glowing.description":()=>vj,"animated_java.dialog.text_display_config.glowing.title":()=>bj,"animated_java.dialog.text_display_config.inherit_settings.description":()=>hj,"animated_java.dialog.text_display_config.inherit_settings.title":()=>gj,"animated_java.dialog.text_display_config.invisible.description":()=>Bj,"animated_java.dialog.text_display_config.invisible.title":()=>Nj,"animated_java.dialog.text_display_config.nbt.description":()=>Dj,"animated_java.dialog.text_display_config.nbt.title":()=>Rj,"animated_java.dialog.text_display_config.override_brightness.description":()=>jj,"animated_java.dialog.text_display_config.override_brightness.title":()=>Sj,"animated_java.dialog.text_display_config.override_glow_color.description":()=>wj,"animated_java.dialog.text_display_config.override_glow_color.title":()=>yj,"animated_java.dialog.text_display_config.shadow_radius.description":()=>Tj,"animated_java.dialog.text_display_config.shadow_radius.title":()=>Ej,"animated_java.dialog.text_display_config.shadow_strength.description":()=>Aj,"animated_java.dialog.text_display_config.shadow_strength.title":()=>Cj,"animated_java.dialog.text_display_config.title":()=>uj,"animated_java.dialog.text_display_config.use_nbt.description":()=>pj,"animated_java.dialog.text_display_config.use_nbt.title":()=>mj,"animated_java.dialog.text_display_config.use_nbt.use_nbt_warning":()=>_j,"animated_java.dialog.unexpected_error.close_button":()=>mC,"animated_java.dialog.unexpected_error.copy_error_message_button.description":()=>_C,"animated_java.dialog.unexpected_error.copy_error_message_button.message":()=>pC,"animated_java.dialog.unexpected_error.paragraph":()=>gC,"animated_java.dialog.unexpected_error.title":()=>fC,"animated_java.dialog.upgrade_old_aj_model_loader.title":()=>bI,"animated_java.dialog.vanilla_block_display.custom_name.description":()=>Jj,"animated_java.dialog.vanilla_block_display.custom_name.invalid_json.error":()=>Hj,"animated_java.dialog.vanilla_block_display.custom_name.title":()=>Uj,"animated_java.dialog.vanilla_block_display.custom_name_visible.description":()=>qj,"animated_java.dialog.vanilla_block_display.custom_name_visible.title":()=>$j,"animated_java.dialog.vanilla_block_display_config.title":()=>Gj,"animated_java.dialog.vanilla_item_display.custom_name.description":()=>Zj,"animated_java.dialog.vanilla_item_display.custom_name.invalid_json.error":()=>Xj,"animated_java.dialog.vanilla_item_display.custom_name.title":()=>Wj,"animated_java.dialog.vanilla_item_display.custom_name_visible.description":()=>Qj,"animated_java.dialog.vanilla_item_display.custom_name_visible.title":()=>Yj,"animated_java.dialog.vanilla_item_display_config.title":()=>Kj,"animated_java.dialog.variant_config.bone_lists.description":()=>dI,"animated_java.dialog.variant_config.excluded_nodes.description":()=>mI,"animated_java.dialog.variant_config.excluded_nodes.title":()=>fI,"animated_java.dialog.variant_config.generate_name_from_display_name":()=>iI,"animated_java.dialog.variant_config.generate_name_from_display_name.description":()=>rI,"animated_java.dialog.variant_config.included_nodes.description":()=>_I,"animated_java.dialog.variant_config.included_nodes.title":()=>pI,"animated_java.dialog.variant_config.swap_columns_button.tooltip":()=>gI,"animated_java.dialog.variant_config.texture_map.create_new_mapping":()=>cI,"animated_java.dialog.variant_config.texture_map.description":()=>lI,"animated_java.dialog.variant_config.texture_map.no_mappings":()=>uI,"animated_java.dialog.variant_config.texture_map.title":()=>sI,"animated_java.dialog.variant_config.title":()=>eI,"animated_java.dialog.variant_config.variant_display_name":()=>tI,"animated_java.dialog.variant_config.variant_display_name.description":()=>nI,"animated_java.dialog.variant_config.variant_name":()=>aI,"animated_java.dialog.variant_config.variant_name.description":()=>oI,"animated_java.effect_animator.keyframes.commands":()=>aO,"animated_java.effect_animator.keyframes.execute_condition":()=>oO,"animated_java.effect_animator.keyframes.variant":()=>rO,"animated_java.effect_animator.timeline.commands":()=>iO,"animated_java.effect_animator.timeline.variant":()=>nO,"animated_java.error.blueprint_export_path_doesnt_exist.description":()=>ON,"animated_java.error.blueprint_export_path_doesnt_exist.title":()=>IN,"animated_java.format_category.animated_java":()=>CN,"animated_java.misc.failed_to_export.blueprint_settings.error_item":()=>EN,"animated_java.misc.failed_to_export.blueprint_settings.message":()=>kN,"animated_java.misc.failed_to_export.button":()=>TN,"animated_java.misc.failed_to_export.custom_models.message":()=>xN,"animated_java.misc.failed_to_export.title":()=>wN,"animated_java.panel.keyframe.commands.description":()=>dO,"animated_java.panel.keyframe.commands.title":()=>uO,"animated_java.panel.keyframe.easing_args.description":()=>FO,"animated_java.panel.keyframe.easing_args.easing_arg.back.description":()=>zO,"animated_java.panel.keyframe.easing_args.easing_arg.back.title":()=>VO,"animated_java.panel.keyframe.easing_args.easing_arg.bounce.description":()=>UO,"animated_java.panel.keyframe.easing_args.easing_arg.bounce.title":()=>GO,"animated_java.panel.keyframe.easing_args.easing_arg.elastic.description":()=>PO,"animated_java.panel.keyframe.easing_args.easing_arg.elastic.title":()=>LO,"animated_java.panel.keyframe.easing_args.title":()=>MO,"animated_java.panel.keyframe.easing_mode.description":()=>NO,"animated_java.panel.keyframe.easing_mode.options.in":()=>BO,"animated_java.panel.keyframe.easing_mode.options.inout":()=>DO,"animated_java.panel.keyframe.easing_mode.options.out":()=>RO,"animated_java.panel.keyframe.easing_mode.title":()=>OO,"animated_java.panel.keyframe.easing_type.description":()=>vO,"animated_java.panel.keyframe.easing_type.options.back":()=>jO,"animated_java.panel.keyframe.easing_type.options.bounce":()=>IO,"animated_java.panel.keyframe.easing_type.options.circ":()=>AO,"animated_java.panel.keyframe.easing_type.options.cubic":()=>kO,"animated_java.panel.keyframe.easing_type.options.elastic":()=>SO,"animated_java.panel.keyframe.easing_type.options.expo":()=>CO,"animated_java.panel.keyframe.easing_type.options.linear":()=>yO,"animated_java.panel.keyframe.easing_type.options.quad":()=>xO,"animated_java.panel.keyframe.easing_type.options.quart":()=>EO,"animated_java.panel.keyframe.easing_type.options.quint":()=>TO,"animated_java.panel.keyframe.easing_type.options.sine":()=>wO,"animated_java.panel.keyframe.easing_type.title":()=>bO,"animated_java.panel.keyframe.execute_condition.description":()=>mO,"animated_java.panel.keyframe.execute_condition.title":()=>fO,"animated_java.panel.keyframe.keyframe_title":()=>sO,"animated_java.panel.keyframe.nonlinear_interpolation":()=>JO,"animated_java.panel.keyframe.repeat.description":()=>_O,"animated_java.panel.keyframe.repeat.title":()=>pO,"animated_java.panel.keyframe.repeat_frequency.description":()=>hO,"animated_java.panel.keyframe.repeat_frequency.title":()=>gO,"animated_java.panel.keyframe.variant.description":()=>cO,"animated_java.panel.keyframe.variant.title":()=>lO,"animated_java.panel.text_display.title":()=>HO,"animated_java.panel.vanilla_block_display.description":()=>vN,"animated_java.panel.vanilla_block_display.title":()=>bN,"animated_java.panel.vanilla_item_display.description":()=>oN,"animated_java.panel.vanilla_item_display.title":()=>aN,"animated_java.panel.variants.title":()=>GI,"animated_java.panel.variants.tool.cannot_delete_default_variant":()=>WI,"animated_java.panel.variants.tool.create_new_variant":()=>UI,"animated_java.panel.variants.tool.delete_selected_variant":()=>$I,"animated_java.panel.variants.tool.duplicate_selected_variant":()=>HI,"animated_java.panel.variants.tool.edit_variant":()=>JI,"animated_java.panel.variants.tool.variant_not_visible":()=>KI,"animated_java.panel.variants.tool.variant_visible":()=>qI,"animated_java.popup.loading.loading":()=>rC,"animated_java.popup.loading.offline":()=>oC,"animated_java.popup.loading.success":()=>aC,"animated_java.tool.item_display.item_display.description":()=>lN,"animated_java.tool.item_display.item_display.options.firstperson_lefthand":()=>fN,"animated_java.tool.item_display.item_display.options.firstperson_righthand":()=>mN,"animated_java.tool.item_display.item_display.options.fixed":()=>hN,"animated_java.tool.item_display.item_display.options.ground":()=>gN,"animated_java.tool.item_display.item_display.options.gui":()=>_N,"animated_java.tool.item_display.item_display.options.head":()=>pN,"animated_java.tool.item_display.item_display.options.none":()=>cN,"animated_java.tool.item_display.item_display.options.thirdperson_lefthand":()=>uN,"animated_java.tool.item_display.item_display.options.thirdperson_righthand":()=>dN,"animated_java.tool.item_display.item_display.title":()=>sN,"animated_java.tool.text_display.background_color.description":()=>WO,"animated_java.tool.text_display.background_color.title":()=>KO,"animated_java.tool.text_display.line_width.description":()=>qO,"animated_java.tool.text_display.line_width.title":()=>$O,"animated_java.tool.text_display.see_through.description":()=>rN,"animated_java.tool.text_display.see_through.title":()=>iN,"animated_java.tool.text_display.text_alignment.description":()=>QO,"animated_java.tool.text_display.text_alignment.options.center":()=>tN,"animated_java.tool.text_display.text_alignment.options.left":()=>eN,"animated_java.tool.text_display.text_alignment.options.right":()=>nN,"animated_java.tool.text_display.text_alignment.title":()=>YO,"animated_java.tool.text_display.text_shadow.description":()=>XO,"animated_java.tool.text_display.text_shadow.title":()=>ZO,"animated_java.vanilla_item_display.title":()=>yN,default:()=>NN});var $T="Blueprint Settings",qT="Documentation",KT="About",WT="Bone Config",ZT="Locator Config",XT="Text Display Config",YT="Export",QT="Add Text Display",eC="Add Item Display",tC="Add Block Display",nC="Item Display Config",iC="Block Display Config",rC="Loading Animated Java...",aC="Animated Java Loaded Successfully!",oC=`Animated Java Failed to Connect! +Some features may be unavailable.`,sC="Thank you for installing!",lC="Let's Get Animating!",cC="Reset to Default",uC="About Animated Java",dC="Close",fC="An Unexpected Error Occurred!",mC="Close",pC="Error Message Copied to Clipboard!",_C="Click to copy the error message to the clipboard.",gC="Please report this error by joining our {0} and creating a thread in the #animated-java-support channel, or by creating an issue on our {1}. Thank you!",hC="Blueprint Settings",bC="Advanced settings should only be used if absolutely needed!",vC="Blueprint Name",yC="The name of the Blueprint. Only used to identify the project in the workspace.",wC="Texture Size",xC="The resolution of the UV editor. This should be the same size as the largest texture. For best results use a square texture, and make sure it's size is a power of 2.",kC="The Texture Size should be square for best results.",EC="The Texture Size should be a power of 2 for best results.",TC="The Texture Size should match the largest texture's size.",CC="Export Settings",AC="Export Namespace",SC="The namespace to export the project to. This is the namespace that will be used in the exported Resource Pack and Data Pack.",jC="The export namespace cannot be empty!",IC='The export namespace "{0}" is reserved for internal functionality! Please choose a different namespace.',OC="The export namespace contains invalid characters! Namespaces can only contain letters, numbers, and underscores.",NC="Plugin Mode",BC="Whether or not to enable Plugin Mode. Enable when you plan to use a Plugin-based solution instead of a Resource Pack and/or Data Pack.",RC="Resource Pack Export Mode",DC=`Determines how the Resource Pack should be exported. Raw - Exports the Resource Pack as a folder. Zip - Exports the Resource Pack as a .zip file. -None - Disables Resource Pack exporting.`,iC="Raw",rC="Zip",aC="None",oC="Data Pack Export Mode",sC=`Determines how the Data Pack should be exported. +None - Disables Resource Pack exporting.`,MC="Raw",FC="Zip",LC="None",PC="Data Pack Export Mode",VC=`Determines how the Data Pack should be exported. Raw - Exports the Data Pack as a folder. Zip - Exports the Data Pack as a .zip file. -None - Disables Data Pack exporting.`,lC="Raw",cC="Zip",uC="None",dC="Show Bounding Box",fC="Whether or not to show the bounding box in the editor.",mC="Auto Bounding Box",pC=`Whether or not to automatically calculate the bounding box based on the model's geometry. -NOTE: The auto bounding box will NOT take bone offsets from animations into account, so the bounding box may be smaller than needed in some cases.`,_C="Bounding Box",gC="Determines the culling box of the model. The model will stop rendering when this box is off-screen.",hC="Resource Pack Settings",bC="Use Advanced Settings",vC="Whether or not to enable the advanced Resource Pack settings.",yC="Display Item",wC="The item to display the Blueprints models in-game. Multiple Blueprints can be placed on the same item and they will be merged automatically.",xC="No item selected!",kC="The provided item ID is invalid! Item IDs should be in the format namespace:item_id.",EC="The provided item ID is invalid! Item IDs should not contain any whitespace.",TC="The selected item does not exist in vanilla!",CC="CMD Offset",AC="The offset to use for the Custom Model Data of the Display Item. Allows multiple Blueprints on the same item, but in separate, unaffiliated Resource Packs.",SC="Resource Pack",jC="The root folder of the Resource Pack to export the project into.",IC="No folder selected!",OC="The selected folder does not exist!",NC="The selected path is not a folder!",BC="The selected folder is missing a pack.mcmeta file!",DC="The selected Resource Pack is missing an assets folder!",RC="Resource Pack Zip",MC="The path to the .zip file to export the project to.",FC="No file selected!",LC="The selected path is not a file!",PC="Display Item Path",VC="Where to place the Display Item. This should be a path to a .json file in a Resource Pack.",zC="No file selected!",UC="The selected file does not exist!",GC="The selected path is not a file!",JC="Model Folder",HC="Where to place all of the exported models. This should be a path to a folder in a Resource Pack.",$C="No folder selected!",KC="The selected folder does not exist!",qC="The selected path is not a folder!",WC="Texture Folder",ZC="Where to place all of the exported textures. This should be a path to a folder in a Resource Pack.",XC="Data Pack Settings",YC="Use Advanced Settings",QC="Whether or not to enable the advanced Data Pack settings.",eA="Data Pack",tA="The root folder of the Data Pack to export the project into.",nA="No folder selected!",iA="The selected folder does not exist!",rA="The selected path is not a folder!",aA="The selected folder is missing a pack.mcmeta file!",oA="The selected Data Pack is missing a data folder!",sA="Data Pack Zip",lA="The path to the .zip file to export the project to.",cA="No file selected!",uA="The selected path is not a file!",dA="On-Summon Commands",fA=`Commands to run as the root entity when summoned. -Treat this text input as a .mcfunction file. (Also supports MC-Build syntax!)`,mA="Interpolation Duration",pA="The duration of the smoothing between keyframes in ticks. This is the time it takes for the model to transition from one keyframe to the next. Higher values will cause animations to lose precision. Generally, you want this to have a value of 1 or 2.",_A="Teleport Duration",gA="The duration of the teleportation between keyframes in ticks. This is the time over which the model will visually interpolate between it's old position to it's new position. Higher values will cause animations to lose precision.",hA="Use Storage for Animation",bA=`Whether or not to use NBT storage to store animation data instead of functions. -This will vastly reduce the number of functions in the generated Data Pack, but is 42% slower than the function method.`,vA="Baked Animations",yA=`Whether or not to bake the exported animations. +None - Disables Data Pack exporting.`,zC="Raw",GC="Zip",UC="None",JC="Show Bounding Box",HC="Whether or not to show the bounding box in the editor.",$C="Auto Bounding Box",qC=`Whether or not to automatically calculate the bounding box based on the model's geometry. +NOTE: The auto bounding box will NOT take bone offsets from animations into account, so the bounding box may be smaller than needed in some cases.`,KC="Bounding Box",WC="Determines the culling box of the model. The model will stop rendering when this box is off-screen.",ZC="Resource Pack Settings",XC="Advanced Settings",YC="Whether or not to enable the advanced Resource Pack settings.",QC="Advanced Folders",eA="Whether or not to enable the advanced Resource Pack folder settings.",tA="Display Item",nA="The item to display the Blueprints models in-game. Multiple Blueprints can be placed on the same item and they will be merged automatically.",iA="No item selected!",rA="The provided item ID is invalid! Item IDs should be in the format namespace:item_id.",aA="The provided item ID is invalid! Item IDs should not contain any whitespace.",oA="The selected item does not exist in vanilla!",sA="The selected item does not use 'minecraft:item/generated' as its parent. This may cause model issues in-game.",lA="The selected item does not have a model file in the vanilla resource pack!",cA="CMD Offset",uA="The offset to use for the Custom Model Data of the Display Item. Allows multiple Blueprints on the same item, but in separate, unaffiliated Resource Packs.",dA="Resource Pack",fA="The root folder of the Resource Pack to export the project into.",mA="No folder selected!",pA="The selected folder does not exist!",_A="The selected path is not a folder!",gA="The selected folder is missing a pack.mcmeta file!",hA="The selected Resource Pack is missing an assets folder!",bA="Resource Pack Zip",vA="The path to the .zip file to export the project to.",yA="No file selected!",wA="The selected path is not a file!",xA="Display Item Path",kA="Where to place the Display Item. This should be a path to a .json file in a Resource Pack.",EA="No file selected!",TA="The selected file does not exist!",CA="The selected path is not a file!",AA="Model Folder",SA="Where to place all of the exported models. This should be a path to a folder in a Resource Pack.",jA="No folder selected!",IA="The selected folder does not exist!",OA="The selected path is not a folder!",NA="Texture Folder",BA="Where to place all of the exported textures. This should be a path to a folder in a Resource Pack.",RA="Data Pack Settings",DA="Use Advanced Settings",MA="Whether or not to enable the advanced Data Pack settings.",FA="Data Pack",LA="The root folder of the Data Pack to export the project into.",PA="No folder selected!",VA="The selected folder does not exist!",zA="The selected path is not a folder!",GA="The selected folder is missing a pack.mcmeta file!",UA="The selected Data Pack is missing a data folder!",JA="Data Pack Zip",HA="The path to the .zip file to export the project to.",$A="No file selected!",qA="The selected path is not a file!",KA="On-Summon Commands",WA=`Commands to run as the root entity when summoned. +Treat this text input as a .mcfunction file. (Also supports MC-Build syntax!)`,ZA="Ticking Commands",XA=`Commands to run every tick at the root entity's position. +Treat this text input as a .mcfunction file. (Also supports MC-Build syntax!) +These commands will run after the animation logic.`,YA="Interpolation Duration",QA="The duration of the smoothing between keyframes in ticks. This is the time it takes for the model to transition from one keyframe to the next. Higher values will cause animations to lose precision. Generally, you want this to have a value of 1 or 2.",eS="Teleport Duration",tS="The duration of the teleportation between keyframes in ticks. This is the time over which the model will visually interpolate between it's old position to it's new position. Higher values will cause animations to lose precision.",nS="Use Storage for Animation",iS=`Whether or not to use NBT storage to store animation data instead of functions. +This will vastly reduce the number of functions in the generated Data Pack, but is 42% slower than the function method.`,rS="Baked Animations",aS=`Whether or not to bake the exported animations. Baked animations have their frames pre-calculated and stored in the exported JSON file, reducing the complexity of rendering the model in-game. -Some Plugins may require this to be enabled to function correctly.`,wA="JSON File",xA="The path to the JSON file to export the project to.",kA="No file selected!",EA="The selected path is not a file!",TA="Bone Config",CA="Selected Variant: {0}",AA="The settings below will be applied to this bone by default.",SA="The settings below will be applied to this bone only when this variant is applied.",jA="Use NBT",IA="Whether or not to use NBT to configure the bone instead of settings.",OA="Using NBT will override all other settings, and any changes you make will not be visible in the editor. Only use this if you know what you're doing!",NA="Inherit Settings",BA="Whether or not to inherit the settings from the parent bone.",DA="Glowing",RA="Whether or not the bone should glow in-game.",MA="Override Glow Color",FA="Whether or not to override the default glow color.",LA="Glow Color",PA="The color of the glow.",VA="Shadow Radius",zA="The radius of the shadow.",UA="Shadow Strength",GA="The strength of the shadow.",JA="Override Brightness",HA="Whether or not to override the default brightness.",$A="Brightness",KA="The brightness of the bone. This should be a value between 0 and 15.",qA="Enchanted",WA="Whether or not the bone should be enchanted.",ZA="Invisible",XA="Whether or not the bone should be invisible.",YA="NBT",QA="The NBT to apply to the bone.",eS=`The NBT must be a compound tag! Eg. {CustomName:'"my name"'}`,tS=`Invalid NBT! -{0}`,nS="Billboard",iS="Controls if this bone should pivot to face player when rendered. It can be fixed (both vertical and horizontal angles are fixed), vertical (faces player around vertical axis), horizontal (pivots around horizontal axis), and center (pivots around center point).",rS="Fixed",aS="Vertical",oS="Horizontal",sS="Center",lS="Locator Config",cS=`Plugin Mode is enabled! Locators have no configuration in Plugin Mode. +Some Plugins may require this to be enabled to function correctly.`,oS="JSON File",sS="The path to the JSON file to export the project to.",lS="No file selected!",cS="The selected path is not a file!",uS="Bone Config",dS="Selected Variant: {0}",fS="The settings below will be applied to this bone by default.",mS="The settings below will be applied to this bone only when this variant is applied.",pS="Use NBT",_S="Whether or not to use NBT to configure the bone instead of settings.",gS="Using NBT will override all other settings, and any changes you make will not be visible in the editor. Only use this if you know what you're doing!",hS="Inherit Settings",bS="Whether or not to inherit the settings from the parent bone.",vS="Custom Name",yS="The custom name of the bone.",wS=`Invalid JSON Text! +{0}`,xS="Custom Name Visible",kS="Whether or not the custom name should always be visible.",ES="Glowing",TS="Whether or not the bone should glow in-game.",CS="Override Glow Color",AS="Whether or not to override the default glow color.",SS="Glow Color",jS="The color of the glow.",IS="Shadow Radius",OS="The radius of the shadow.",NS="Shadow Strength",BS="The strength of the shadow.",RS="Override Brightness",DS="Whether or not to override the default brightness.",MS="Brightness",FS="The brightness of the bone. This should be a value between 0 and 15.",LS="Enchanted",PS="Whether or not the bone should be enchanted.",VS="Invisible",zS="Whether or not the bone should be invisible.",GS="NBT",US="The NBT to apply to the bone.",JS=`The NBT must be a compound tag! Eg. {CustomName:'"my name"'}`,HS=`Invalid NBT! +{0}`,$S="Billboard",qS="Controls if this bone should pivot to face player when rendered. It can be fixed (both vertical and horizontal angles are fixed), vertical (faces player around vertical axis), horizontal (pivots around horizontal axis), and center (pivots around center point).",KS="Fixed",WS="Vertical",ZS="Horizontal",XS="Center",YS="Locator Config",QS=`Plugin Mode is enabled! Locators have no configuration in Plugin Mode. Instead, use the Plugin API to add custom functionality to your Locators. -For more information, see the Official Plugin API documentation for more information.`,uS="Use Entity",dS="Whether or not to attach an entity to the Locator.",fS="Entity Type",mS="The type of entity to attach to the Locator.",pS="Entity Type cannot be empty!",_S="The selected entity type doesn't exist in Minecraft {0}",gS="On-Summon Commands",hS=`Commands to run as the Locator's entity when summoned. -Treat this text input as a .mcfunction file. (Also supports MC-Build syntax!)`,bS="Ticking Commands",vS=`Commands to run every tick at the Locator's position. -Treat this text input as a .mcfunction file. (Also supports MC-Build syntax!)`,yS="Text Display Config",wS="Vanilla Item Model",xS=`If set, the bone will render as a vanilla item model. -This will overwrite the bone's existing cubes.`,kS="Use NBT",ES="Whether or not to use NBT to configure the text display instead of settings.",TS="Using NBT will override all other settings, and any changes you make will not be visible in the editor. Only use this if you know what you're doing!",CS="Inherit Settings",AS="Whether or not to inherit the settings from the parent text display.",SS="Glowing",jS="Whether or not the text display should glow in-game.",IS="Override Glow Color",OS="Whether or not to override the default glow color.",NS="Glow Color",BS="The color of the glow.",DS="Shadow Radius",RS="The radius of the shadow.",MS="Shadow Strength",FS="The strength of the shadow.",LS="Override Brightness",PS="Whether or not to override the default brightness.",VS="Brightness",zS="The brightness of the text display. This should be a value between 0 and 15.",US="Invisible",GS="Whether or not the text display should be invisible.",JS="NBT",HS="The NBT to apply to the text display.",$S="Billboard",KS="Controls if this text display should pivot to face player when rendered. It can be fixed (both vertical and horizontal angles are fixed), vertical (faces player around vertical axis), horizontal (pivots around horizontal axis), and center (pivots around center point).",qS="Fixed",WS="Vertical",ZS="Horizontal",XS="Center",YS="Vanilla Block Display Config",QS="Vanilla Item Display Config",ej="Variant Config",tj="Display Name",nj="Used to identify the Variant in the editor, and in error messages.",ij="Generate Name From Display Name",rj="Whether or not to generate the Name automatically from the Display Name.",aj="Name",oj="Used to identify the Variant in the exported Resource Pack and Data Pack.",sj="Texture Map",lj="A map of which textures to swap out when applying this Variant.",cj="Create New Mapping",uj="Variant has no mapped textures.",dj="A list of nodes to include or exclude from the Variant. Only nodes in the included list will be modified by the Variant, and nodes in the excluded list will be ignored.",fj="Excluded Nodes",mj="A list of nodes to exclude from the Variant. These nodes will not be modified by the Variant.",pj="Included Nodes",_j="A list of nodes to include in the Variant. Only these nodes will be modified by the Variant.",gj="Swap Lists",hj="Update .ajmodel",bj="Update .ajmodel",vj="Select .ajmodel File",yj="Upgrade your outdated .ajmodel files to the new .ajblueprint format.",wj="Select an .ajmodel File to Upgrade",xj="Animation Properties ({0})",kj="Animation Name",Ej="The name of the animation.",Tj="Loop Mode",Cj="Determines how the animation should loop. Once - The animation will play once and stop. Hold - The animation will play once and hold the last frame. Loop - The animation will loop indefinitely.",Aj="Once",Sj="Hold",jj="Loop",Ij="The animation name cannot be empty!",Oj="The animation name contains invalid characters! Animation names should only contain letters, numbers, underscores, and periods.",Nj="Loop Delay",Bj="The delay between loops. This is the time the animation will pause before starting again. This is only used when the Loop Mode is set to Loop.",Dj="A list of nodes to include or exclude from the animation. Only nodes in the included list will be modified by the animation, and nodes in the excluded list will be ignored.",Rj="Excluded Nodes",Mj="A list of nodes to exclude from the animation. These nodes will not be modified by the animation.",Fj="Included Nodes",Lj="A list of nodes to include in the animation. Only these nodes will be modified by the animation.",Pj="Swap Lists",Vj="Exporting...",zj="Loading Blueprint...",Uj="Variants",Gj="Create New Variant",Jj="Edit Variant",Hj="Duplicate Selected Variant",$j="Delete Selected Variant",Kj="Variant Selected",qj="Variant Not Selected",Wj="Cannot delete the default variant!",Zj="Create Variant",Xj="Duplicate Variant",Yj="Open Variant Config",Qj="Delete Variant",eI="Excluded Nodes",tI="Invert Excluded Nodes",nI="Variant",iI="Commands",rI="Variant",aI="Commands",oI="Execute Condition",sI="Keyframe ({0})",lI="Variant",cI="The Variant to apply to the keyframe.",uI="Commands",dI=`Commands to run when the keyframe is reached. -Treat this text input as a .mcfunction file. (Also supports MC-Build syntax!)`,fI="Execute Condition",mI="A condition that must be met for the keyframe to execute. Treat this text input as the sub-commands of an execute command.",pI="Repeat?",_I=`Whether or not to run the commands in this keyframe repeatedly. -If enabled, the commands will run every Repeat Frequency ticks.`,gI="Repeat Frequency",hI=`How many ticks to wait before running the commands in this keyframe again. +For more information, see the Official Plugin API documentation for more information.`,ej="Use Entity",tj="Whether or not to attach an entity to the Locator.",nj="Entity Type",ij="The type of entity to attach to the Locator.",rj="Entity Type cannot be empty!",aj="The selected entity type doesn't exist in Minecraft {0}",oj="On-Summon Commands",sj=`Commands to run as the Locator's entity when summoned. +Treat this text input as a .mcfunction file. (Also supports MC-Build syntax!)`,lj="Ticking Commands",cj=`Commands to run every tick at the Locator's position. +Treat this text input as a .mcfunction file. (Also supports MC-Build syntax!)`,uj="Text Display Config",dj="Vanilla Item Model",fj=`If set, the bone will render as a vanilla item model. +This will overwrite the bone's existing cubes.`,mj="Use NBT",pj="Whether or not to use NBT to configure the text display instead of settings.",_j="Using NBT will override all other settings, and any changes you make will not be visible in the editor. Only use this if you know what you're doing!",gj="Inherit Settings",hj="Whether or not to inherit the settings from the parent text display.",bj="Glowing",vj="Whether or not the text display should glow in-game.",yj="Override Glow Color",wj="Whether or not to override the default glow color.",xj="Glow Color",kj="The color of the glow.",Ej="Shadow Radius",Tj="The radius of the shadow.",Cj="Shadow Strength",Aj="The strength of the shadow.",Sj="Override Brightness",jj="Whether or not to override the default brightness.",Ij="Brightness",Oj="The brightness of the text display. This should be a value between 0 and 15.",Nj="Invisible",Bj="Whether or not the text display should be invisible.",Rj="NBT",Dj="The NBT to apply to the text display.",Mj="Billboard",Fj="Controls if this text display should pivot to face player when rendered. It can be fixed (both vertical and horizontal angles are fixed), vertical (faces player around vertical axis), horizontal (pivots around horizontal axis), and center (pivots around center point).",Lj="Fixed",Pj="Vertical",Vj="Horizontal",zj="Center",Gj="Block Display Config",Uj="Custom Name",Jj="The custom name of the block display.",Hj=`Invalid JSON Text! +{0}`,$j="Custom Name Visible",qj="Whether or not the custom name should always be visible.",Kj="Item Display Config",Wj="Custom Name",Zj="The custom name of the item display.",Xj=`Invalid JSON Text! +{0}`,Yj="Custom Name Visible",Qj="Whether or not the custom name should always be visible.",eI="Variant Config",tI="Display Name",nI="Used to identify the Variant in the editor, and in error messages.",iI="Generate Name From Display Name",rI="Whether or not to generate the Name automatically from the Display Name.",aI="Name",oI="Used to identify the Variant in the exported Resource Pack and Data Pack.",sI="Texture Map",lI="A map of which textures to swap out when applying this Variant.",cI="Create New Mapping",uI="Variant has no mapped textures.",dI="A list of nodes to include or exclude from the Variant. Only nodes in the included list will be modified by the Variant, and nodes in the excluded list will be ignored.",fI="Excluded Nodes",mI="A list of nodes to exclude from the Variant. These nodes will not be modified by the Variant.",pI="Included Nodes",_I="A list of nodes to include in the Variant. Only these nodes will be modified by the Variant.",gI="Swap Lists",hI="Update .ajmodel",bI="Update .ajmodel",vI="Select .ajmodel File",yI="Upgrade your outdated .ajmodel files to the new .ajblueprint format.",wI="Select an .ajmodel File to Upgrade",xI="Animation Properties ({0})",kI="Animation Name",EI="The name of the animation.",TI="Loop Mode",CI="Determines how the animation should loop. Once - The animation will play once and stop. Hold - The animation will play once and hold the last frame. Loop - The animation will loop indefinitely.",AI="Once",SI="Hold",jI="Loop",II="The animation name cannot be empty!",OI="The animation name contains invalid characters! Animation names should only contain letters, numbers, underscores, and periods.",NI="Loop Delay",BI="The delay between loops. This is the time the animation will pause before starting again. This is only used when the Loop Mode is set to Loop.",RI="A list of nodes to include or exclude from the animation. Only nodes in the included list will be modified by the animation, and nodes in the excluded list will be ignored.",DI="Excluded Nodes",MI="A list of nodes to exclude from the animation. These nodes will not be modified by the animation.",FI="Included Nodes",LI="A list of nodes to include in the animation. Only these nodes will be modified by the animation.",PI="Swap Lists",VI="Exporting...",zI="Loading Blueprint...",GI="Variants",UI="Create New Variant",JI="Edit Variant",HI="Duplicate Selected Variant",$I="Delete Selected Variant",qI="Variant Selected",KI="Variant Not Selected",WI="Cannot delete the default variant!",ZI="Create Variant",XI="Duplicate Variant",YI="Open Variant Config",QI="Delete Variant",eO="Excluded Nodes",tO="Invert Excluded Nodes",nO="Variant",iO="Commands",rO="Variant",aO="Commands",oO="Execute Condition",sO="Keyframe ({0})",lO="Variant",cO="The Variant to apply to the keyframe.",uO="Commands",dO=`Commands to run when the keyframe is reached. +Treat this text input as a .mcfunction file. (Also supports MC-Build syntax!)`,fO="Execute Condition",mO="A condition that must be met for the keyframe to execute. Treat this text input as the sub-commands of an execute command.",pO="Repeat?",_O=`Whether or not to run the commands in this keyframe repeatedly. +If enabled, the commands will run every Repeat Frequency ticks.`,gO="Repeat Frequency",hO=`How many ticks to wait before running the commands in this keyframe again. Setting this to 1 will run the commands every tick. NOTE: If the animation is not evenly divisible by this value, the interval may be slightly off when the animation loops. -If this is set to a value larger than the length of the animation, the commands will run as if repeat was disabled (Once when the keyframe is reached).`,bI="Easing Type",vI="The type of easing to apply to the keyframe.",yI="Linear",wI="Sine",xI="Quad",kI="Cubic",EI="Quart",TI="Quint",CI="Expo",AI="Circ",SI="Elastic",jI="Back",II="Bounce",OI="Easing Mode",NI="The easing mode to apply to the keyframe.",BI="In",DI="Out",RI="In-Out",MI="Easing Args",FI="The arguments to apply to the easing function.",LI="Elasticity",PI="The elasticity of the easing function.",VI="Overshoot",zI="The amount of overshoot to apply to the easing function.",UI="Bounciness",GI="The bounciness of the easing function.",JI=`Advanced easing options are disabled. -Change the keyframe's interpolation mode to 'linear' to enable them.`,HI="Text Display",$I="Line Width",KI="The width of the text display in pixels.",qI="Background Color",WI="The color of the background of the text display.",ZI="Text Shadow",XI="Whether or not to display a shadow behind the text.",YI="Text Alignment",QI="The alignment of the text.",eO="Left",tO="Center",nO="Right",iO="See Through",rO="Whether or not the text display should be visible through blocks.",aO="Displayed Item",oO="The item to display.",sO="Displayed Block",lO="The block to display. Supports block states!",cO="Vanilla Item Display",uO="Failed to Export",dO="You have disabled resource pack exporting, but have custom models in your project! Please enable resource pack exporting or remove the custom models before exporting.",fO="There are errors in your blueprint settings! Please fix them before exporting.",mO="Found an issue with {0}:",pO="Ok",_O="Animated Java",gO="Fluids don't render in Block Displays.",hO="Mob Heads don't render in Block Displays. Use an Item Display instead.",bO='The "facing" blockstate key is not supported in Block Displays.',vO="Blueprint Export Path Doesn't Exist",yO=`The export path '{0}' does not exist! -Make sure the folder you're saving to exists and try again.`,wO={"animated_java.action.open_blueprint_settings.name":pT,"animated_java.action.open_documentation.name":_T,"animated_java.action.open_about.name":gT,"animated_java.action.open_bone_config.name":hT,"animated_java.action.open_locator_config.name":bT,"animated_java.action.open_text_display_config.name":vT,"animated_java.action.export.name":yT,"animated_java.action.create_text_display.title":wT,"animated_java.action.create_vanilla_item_display.title":xT,"animated_java.action.create_vanilla_block_display.title":kT,"animated_java.action.open_vanilla_item_display_config.name":ET,"animated_java.action.open_vanilla_block_display_config.name":TT,"animated_java.popup.loading.loading":CT,"animated_java.popup.loading.success":AT,"animated_java.popup.loading.offline":ST,"animated_java.dialog.installed_popup.title":jT,"animated_java.dialog.installed_popup.close_button":IT,"animated_java.dialog.about.title":OT,"animated_java.dialog.about.close_button":NT,"animated_java.dialog.unexpected_error.title":BT,"animated_java.dialog.unexpected_error.close_button":DT,"animated_java.dialog.unexpected_error.copy_error_message_button.message":RT,"animated_java.dialog.unexpected_error.copy_error_message_button.description":MT,"animated_java.dialog.unexpected_error.paragraph":FT,"animated_java.dialog.blueprint_settings.title":LT,"animated_java.dialog.blueprint_settings.advanced_settings_warning":PT,"animated_java.dialog.blueprint_settings.blueprint_name.title":VT,"animated_java.dialog.blueprint_settings.blueprint_name.description":zT,"animated_java.dialog.blueprint_settings.texture_size.title":UT,"animated_java.dialog.blueprint_settings.texture_size.description":GT,"animated_java.dialog.blueprint_settings.texture_size.warning.not_square":JT,"animated_java.dialog.blueprint_settings.texture_size.warning.not_a_power_of_2":HT,"animated_java.dialog.blueprint_settings.texture_size.warning.does_not_match_largest_texture":$T,"animated_java.dialog.blueprint_settings.export_settings.title":KT,"animated_java.dialog.blueprint_settings.export_namespace.title":qT,"animated_java.dialog.blueprint_settings.export_namespace.description":WT,"animated_java.dialog.blueprint_settings.export_namespace.error.empty":ZT,"animated_java.dialog.blueprint_settings.export_namespace.error.reserved":XT,"animated_java.dialog.blueprint_settings.export_namespace.error.invalid_characters":YT,"animated_java.dialog.blueprint_settings.enable_plugin_mode.title":QT,"animated_java.dialog.blueprint_settings.enable_plugin_mode.description":eC,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.title":tC,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.description":nC,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.raw":iC,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.zip":rC,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.none":aC,"animated_java.dialog.blueprint_settings.data_pack_export_mode.title":oC,"animated_java.dialog.blueprint_settings.data_pack_export_mode.description":sC,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.raw":lC,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.zip":cC,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.none":uC,"animated_java.dialog.blueprint_settings.show_bounding_box.title":dC,"animated_java.dialog.blueprint_settings.show_bounding_box.description":fC,"animated_java.dialog.blueprint_settings.auto_bounding_box.title":mC,"animated_java.dialog.blueprint_settings.auto_bounding_box.description":pC,"animated_java.dialog.blueprint_settings.bounding_box.title":_C,"animated_java.dialog.blueprint_settings.bounding_box.description":gC,"animated_java.dialog.blueprint_settings.resource_pack_settings.title":hC,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_settings.title":bC,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_settings.description":vC,"animated_java.dialog.blueprint_settings.display_item.title":yC,"animated_java.dialog.blueprint_settings.display_item.description":wC,"animated_java.dialog.blueprint_settings.display_item.error.no_item_selected":xC,"animated_java.dialog.blueprint_settings.display_item.error.invalid_item_id.no_namespace":kC,"animated_java.dialog.blueprint_settings.display_item.error.invalid_item_id.whitespace":EC,"animated_java.dialog.blueprint_settings.display_item.warning.item_does_not_exist":TC,"animated_java.dialog.blueprint_settings.custom_model_data_offset.title":CC,"animated_java.dialog.blueprint_settings.custom_model_data_offset.description":AC,"animated_java.dialog.blueprint_settings.resource_pack.title":SC,"animated_java.dialog.blueprint_settings.resource_pack.description":jC,"animated_java.dialog.blueprint_settings.resource_pack.error.no_folder_selected":IC,"animated_java.dialog.blueprint_settings.resource_pack.error.folder_does_not_exist":OC,"animated_java.dialog.blueprint_settings.resource_pack.error.not_a_folder":NC,"animated_java.dialog.blueprint_settings.resource_pack.error.missing_pack_mcmeta":BC,"animated_java.dialog.blueprint_settings.resource_pack.error.missing_assets_folder":DC,"animated_java.dialog.blueprint_settings.resource_pack_zip.title":RC,"animated_java.dialog.blueprint_settings.resource_pack_zip.description":MC,"animated_java.dialog.blueprint_settings.resource_pack_zip.error.no_file_selected":FC,"animated_java.dialog.blueprint_settings.resource_pack_zip.error.not_a_file":LC,"animated_java.dialog.blueprint_settings.display_item_path.title":PC,"animated_java.dialog.blueprint_settings.display_item_path.description":VC,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.no_file_selected":zC,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.file_does_not_exist":UC,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.not_a_file":GC,"animated_java.dialog.blueprint_settings.model_folder.title":JC,"animated_java.dialog.blueprint_settings.model_folder.description":HC,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.no_folder_selected":$C,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.folder_does_not_exist":KC,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.not_a_folder":qC,"animated_java.dialog.blueprint_settings.texture_folder.title":WC,"animated_java.dialog.blueprint_settings.texture_folder.description":ZC,"animated_java.dialog.blueprint_settings.data_pack_settings.title":XC,"animated_java.dialog.blueprint_settings.enable_advanced_data_pack_settings.title":YC,"animated_java.dialog.blueprint_settings.enable_advanced_data_pack_settings.description":QC,"animated_java.dialog.blueprint_settings.data_pack.title":eA,"animated_java.dialog.blueprint_settings.data_pack.description":tA,"animated_java.dialog.blueprint_settings.data_pack.error.no_folder_selected":nA,"animated_java.dialog.blueprint_settings.data_pack.error.folder_does_not_exist":iA,"animated_java.dialog.blueprint_settings.data_pack.error.not_a_folder":rA,"animated_java.dialog.blueprint_settings.data_pack.error.missing_pack_mcmeta":aA,"animated_java.dialog.blueprint_settings.data_pack.error.missing_data_folder":oA,"animated_java.dialog.blueprint_settings.data_pack_zip.title":sA,"animated_java.dialog.blueprint_settings.data_pack_zip.description":lA,"animated_java.dialog.blueprint_settings.data_pack_zip.error.no_file_selected":cA,"animated_java.dialog.blueprint_settings.data_pack_zip.error.not_a_file":uA,"animated_java.dialog.blueprint_settings.summon_commands.title":dA,"animated_java.dialog.blueprint_settings.summon_commands.description":fA,"animated_java.dialog.blueprint_settings.interpolation_duration.title":mA,"animated_java.dialog.blueprint_settings.interpolation_duration.description":pA,"animated_java.dialog.blueprint_settings.teleportation_duration.title":_A,"animated_java.dialog.blueprint_settings.teleportation_duration.description":gA,"animated_java.dialog.blueprint_settings.use_storage_for_animation.title":hA,"animated_java.dialog.blueprint_settings.use_storage_for_animation.description":bA,"animated_java.dialog.blueprint_settings.baked_animations.title":vA,"animated_java.dialog.blueprint_settings.baked_animations.description":yA,"animated_java.dialog.blueprint_settings.json_file.title":wA,"animated_java.dialog.blueprint_settings.json_file.description":xA,"animated_java.dialog.blueprint_settings.json_file.error.no_file_selected":kA,"animated_java.dialog.blueprint_settings.json_file.error.not_a_file":EA,"animated_java.dialog.bone_config.title":TA,"animated_java.dialog.bone_config.selected_variant":CA,"animated_java.dialog.bone_config.default_variant_subtitle":AA,"animated_java.dialog.bone_config.selected_variant_subtitle":SA,"animated_java.dialog.bone_config.use_nbt.title":jA,"animated_java.dialog.bone_config.use_nbt.description":IA,"animated_java.dialog.bone_config.use_nbt.use_nbt_warning":OA,"animated_java.dialog.bone_config.inherit_settings.title":NA,"animated_java.dialog.bone_config.inherit_settings.description":BA,"animated_java.dialog.bone_config.glowing.title":DA,"animated_java.dialog.bone_config.glowing.description":RA,"animated_java.dialog.bone_config.override_glow_color.title":MA,"animated_java.dialog.bone_config.override_glow_color.description":FA,"animated_java.dialog.bone_config.glow_color.title":LA,"animated_java.dialog.bone_config.glow_color.description":PA,"animated_java.dialog.bone_config.shadow_radius.title":VA,"animated_java.dialog.bone_config.shadow_radius.description":zA,"animated_java.dialog.bone_config.shadow_strength.title":UA,"animated_java.dialog.bone_config.shadow_strength.description":GA,"animated_java.dialog.bone_config.override_brightness.title":JA,"animated_java.dialog.bone_config.override_brightness.description":HA,"animated_java.dialog.bone_config.brightness_override.title":$A,"animated_java.dialog.bone_config.brightness_override.description":KA,"animated_java.dialog.bone_config.enchanted.title":qA,"animated_java.dialog.bone_config.enchanted.description":WA,"animated_java.dialog.bone_config.invisible.title":ZA,"animated_java.dialog.bone_config.invisible.description":XA,"animated_java.dialog.bone_config.nbt.title":YA,"animated_java.dialog.bone_config.nbt.description":QA,"animated_java.dialog.bone_config.nbt.invalid_nbt.not_compound":eS,"animated_java.dialog.bone_config.nbt.invalid_nbt.error":tS,"animated_java.dialog.bone_config.billboard.title":nS,"animated_java.dialog.bone_config.billboard.description":iS,"animated_java.dialog.bone_config.billboard.options.fixed":rS,"animated_java.dialog.bone_config.billboard.options.vertical":aS,"animated_java.dialog.bone_config.billboard.options.horizontal":oS,"animated_java.dialog.bone_config.billboard.options.center":sS,"animated_java.dialog.locator_config.title":lS,"animated_java.dialog.locator_config.plugin_mode_warning":cS,"animated_java.dialog.locator_config.use_entity.title":uS,"animated_java.dialog.locator_config.use_entity.description":dS,"animated_java.dialog.locator_config.entity_type.title":fS,"animated_java.dialog.locator_config.entity_type.description":mS,"animated_java.dialog.locator_config.entity_type.error.empty":pS,"animated_java.dialog.locator_config.entity_type.warning.invalid":_S,"animated_java.dialog.locator_config.summon_commands.title":gS,"animated_java.dialog.locator_config.summon_commands.description":hS,"animated_java.dialog.locator_config.ticking_commands.title":bS,"animated_java.dialog.locator_config.ticking_commands.description":vS,"animated_java.dialog.text_display_config.title":yS,"animated_java.dialog.bone_config.vanilla_item_model.title":wS,"animated_java.dialog.bone_config.vanilla_item_model.description":xS,"animated_java.dialog.text_display_config.use_nbt.title":kS,"animated_java.dialog.text_display_config.use_nbt.description":ES,"animated_java.dialog.text_display_config.use_nbt.use_nbt_warning":TS,"animated_java.dialog.text_display_config.inherit_settings.title":CS,"animated_java.dialog.text_display_config.inherit_settings.description":AS,"animated_java.dialog.text_display_config.glowing.title":SS,"animated_java.dialog.text_display_config.glowing.description":jS,"animated_java.dialog.text_display_config.override_glow_color.title":IS,"animated_java.dialog.text_display_config.override_glow_color.description":OS,"animated_java.dialog.text_display_config.glow_color.title":NS,"animated_java.dialog.text_display_config.glow_color.description":BS,"animated_java.dialog.text_display_config.shadow_radius.title":DS,"animated_java.dialog.text_display_config.shadow_radius.description":RS,"animated_java.dialog.text_display_config.shadow_strength.title":MS,"animated_java.dialog.text_display_config.shadow_strength.description":FS,"animated_java.dialog.text_display_config.override_brightness.title":LS,"animated_java.dialog.text_display_config.override_brightness.description":PS,"animated_java.dialog.text_display_config.brightness_override.title":VS,"animated_java.dialog.text_display_config.brightness_override.description":zS,"animated_java.dialog.text_display_config.invisible.title":US,"animated_java.dialog.text_display_config.invisible.description":GS,"animated_java.dialog.text_display_config.nbt.title":JS,"animated_java.dialog.text_display_config.nbt.description":HS,"animated_java.dialog.text_display_config.billboard.title":$S,"animated_java.dialog.text_display_config.billboard.description":KS,"animated_java.dialog.text_display_config.billboard.options.fixed":qS,"animated_java.dialog.text_display_config.billboard.options.vertical":WS,"animated_java.dialog.text_display_config.billboard.options.horizontal":ZS,"animated_java.dialog.text_display_config.billboard.options.center":XS,"animated_java.dialog.vanilla_block_display_config.title":YS,"animated_java.dialog.vanilla_item_display_config.title":QS,"animated_java.dialog.variant_config.title":ej,"animated_java.dialog.variant_config.variant_display_name":tj,"animated_java.dialog.variant_config.variant_display_name.description":nj,"animated_java.dialog.variant_config.generate_name_from_display_name":ij,"animated_java.dialog.variant_config.generate_name_from_display_name.description":rj,"animated_java.dialog.variant_config.variant_name":aj,"animated_java.dialog.variant_config.variant_name.description":oj,"animated_java.dialog.variant_config.texture_map.title":sj,"animated_java.dialog.variant_config.texture_map.description":lj,"animated_java.dialog.variant_config.texture_map.create_new_mapping":cj,"animated_java.dialog.variant_config.texture_map.no_mappings":uj,"animated_java.dialog.variant_config.bone_lists.description":dj,"animated_java.dialog.variant_config.excluded_nodes.title":fj,"animated_java.dialog.variant_config.excluded_nodes.description":mj,"animated_java.dialog.variant_config.included_nodes.title":pj,"animated_java.dialog.variant_config.included_nodes.description":_j,"animated_java.dialog.variant_config.swap_columns_button.tooltip":gj,"animated_java.action.upgrade_old_aj_model_loader.name":hj,"animated_java.dialog.upgrade_old_aj_model_loader.title":bj,"animated_java.action.upgrade_old_aj_model_loader.select_file":vj,"animated_java.action.upgrade_old_aj_model_loader.body":yj,"animated_java.action.upgrade_old_aj_model_loader.button":wj,"animated_java.dialog.animation_properties.title":xj,"animated_java.dialog.animation_properties.animation_name.title":kj,"animated_java.dialog.animation_properties.animation_name.description":Ej,"animated_java.dialog.animation_properties.loop_mode.title":Tj,"animated_java.dialog.animation_properties.loop_mode.description":Cj,"animated_java.dialog.animation_properties.loop_mode.options.once":Aj,"animated_java.dialog.animation_properties.loop_mode.options.hold":Sj,"animated_java.dialog.animation_properties.loop_mode.options.loop":jj,"animated_java.dialog.animation_properties.animation_name.error.empty":Ij,"animated_java.dialog.animation_properties.animation_name.error.invalid_characters":Oj,"animated_java.dialog.animation_properties.loop_delay.title":Nj,"animated_java.dialog.animation_properties.loop_delay.description":Bj,"animated_java.dialog.animation_properties.bone_lists.description":Dj,"animated_java.dialog.animation_properties.excluded_nodes.title":Rj,"animated_java.dialog.animation_properties.excluded_nodes.description":Mj,"animated_java.dialog.animation_properties.included_nodes.title":Fj,"animated_java.dialog.animation_properties.included_nodes.description":Lj,"animated_java.dialog.animation_properties.swap_columns_button.tooltip":Pj,"animated_java.dialog.export_progress.title":Vj,"animated_java.dialog.blueprint_loading.title":zj,"animated_java.panel.variants.title":Uj,"animated_java.panel.variants.tool.create_new_variant":Gj,"animated_java.panel.variants.tool.edit_variant":Jj,"animated_java.panel.variants.tool.duplicate_selected_variant":Hj,"animated_java.panel.variants.tool.delete_selected_variant":$j,"animated_java.panel.variants.tool.variant_visible":Kj,"animated_java.panel.variants.tool.variant_not_visible":qj,"animated_java.panel.variants.tool.cannot_delete_default_variant":Wj,"animated_java.action.variants.create":Zj,"animated_java.action.variants.duplicate":Xj,"animated_java.action.variants.open_config":Yj,"animated_java.action.variants.delete":Qj,"animated_java.animation.excluded_nodes":eI,"animated_java.animation.invert_excluded_nodes":tI,"animated_java.effect_animator.timeline.variant":nI,"animated_java.effect_animator.timeline.commands":iI,"animated_java.effect_animator.keyframes.variant":rI,"animated_java.effect_animator.keyframes.commands":aI,"animated_java.effect_animator.keyframes.execute_condition":oI,"animated_java.panel.keyframe.keyframe_title":sI,"animated_java.panel.keyframe.variant.title":lI,"animated_java.panel.keyframe.variant.description":cI,"animated_java.panel.keyframe.commands.title":uI,"animated_java.panel.keyframe.commands.description":dI,"animated_java.panel.keyframe.execute_condition.title":fI,"animated_java.panel.keyframe.execute_condition.description":mI,"animated_java.panel.keyframe.repeat.title":pI,"animated_java.panel.keyframe.repeat.description":_I,"animated_java.panel.keyframe.repeat_frequency.title":gI,"animated_java.panel.keyframe.repeat_frequency.description":hI,"animated_java.panel.keyframe.easing_type.title":bI,"animated_java.panel.keyframe.easing_type.description":vI,"animated_java.panel.keyframe.easing_type.options.linear":yI,"animated_java.panel.keyframe.easing_type.options.sine":wI,"animated_java.panel.keyframe.easing_type.options.quad":xI,"animated_java.panel.keyframe.easing_type.options.cubic":kI,"animated_java.panel.keyframe.easing_type.options.quart":EI,"animated_java.panel.keyframe.easing_type.options.quint":TI,"animated_java.panel.keyframe.easing_type.options.expo":CI,"animated_java.panel.keyframe.easing_type.options.circ":AI,"animated_java.panel.keyframe.easing_type.options.elastic":SI,"animated_java.panel.keyframe.easing_type.options.back":jI,"animated_java.panel.keyframe.easing_type.options.bounce":II,"animated_java.panel.keyframe.easing_mode.title":OI,"animated_java.panel.keyframe.easing_mode.description":NI,"animated_java.panel.keyframe.easing_mode.options.in":BI,"animated_java.panel.keyframe.easing_mode.options.out":DI,"animated_java.panel.keyframe.easing_mode.options.inout":RI,"animated_java.panel.keyframe.easing_args.title":MI,"animated_java.panel.keyframe.easing_args.description":FI,"animated_java.panel.keyframe.easing_args.easing_arg.elastic.title":LI,"animated_java.panel.keyframe.easing_args.easing_arg.elastic.description":PI,"animated_java.panel.keyframe.easing_args.easing_arg.back.title":VI,"animated_java.panel.keyframe.easing_args.easing_arg.back.description":zI,"animated_java.panel.keyframe.easing_args.easing_arg.bounce.title":UI,"animated_java.panel.keyframe.easing_args.easing_arg.bounce.description":GI,"animated_java.panel.keyframe.nonlinear_interpolation":JI,"animated_java.panel.text_display.title":HI,"animated_java.tool.text_display.line_width.title":$I,"animated_java.tool.text_display.line_width.description":KI,"animated_java.tool.text_display.background_color.title":qI,"animated_java.tool.text_display.background_color.description":WI,"animated_java.tool.text_display.text_shadow.title":ZI,"animated_java.tool.text_display.text_shadow.description":XI,"animated_java.tool.text_display.text_alignment.title":YI,"animated_java.tool.text_display.text_alignment.description":QI,"animated_java.tool.text_display.text_alignment.options.left":eO,"animated_java.tool.text_display.text_alignment.options.center":tO,"animated_java.tool.text_display.text_alignment.options.right":nO,"animated_java.tool.text_display.see_through.title":iO,"animated_java.tool.text_display.see_through.description":rO,"animated_java.panel.vanilla_item_display.title":aO,"animated_java.panel.vanilla_item_display.description":oO,"animated_java.panel.vanilla_block_display.title":sO,"animated_java.panel.vanilla_block_display.description":lO,"animated_java.vanilla_item_display.title":cO,"animated_java.misc.failed_to_export.title":uO,"animated_java.misc.failed_to_export.custom_models.message":dO,"animated_java.misc.failed_to_export.blueprint_settings.message":fO,"animated_java.misc.failed_to_export.blueprint_settings.error_item":mO,"animated_java.misc.failed_to_export.button":pO,"animated_java.format_category.animated_java":_O,"animated_java.block_model_manager.fluid_warning":gO,"animated_java.block_model_manager.mob_head_warning":hO,"animated_java.block_model_manager.facing_warning":bO,"animated_java.error.blueprint_export_path_doesnt_exist.title":vO,"animated_java.error.blueprint_export_path_doesnt_exist.description":yO};var Wd={};vn(Wd,{"animated_java.action.create_text_display.title":()=>jO,"animated_java.action.create_vanilla_block_display.title":()=>OO,"animated_java.action.create_vanilla_item_display.title":()=>IO,"animated_java.action.export.name":()=>SO,"animated_java.action.open_about.name":()=>EO,"animated_java.action.open_blueprint_settings.name":()=>xO,"animated_java.action.open_bone_config.name":()=>TO,"animated_java.action.open_documentation.name":()=>kO,"animated_java.action.open_locator_config.name":()=>CO,"animated_java.action.open_text_display_config.name":()=>AO,"animated_java.action.open_vanilla_block_display_config.name":()=>BO,"animated_java.action.open_vanilla_item_display_config.name":()=>NO,"animated_java.action.upgrade_old_aj_model_loader.body":()=>ED,"animated_java.action.upgrade_old_aj_model_loader.button":()=>TD,"animated_java.action.upgrade_old_aj_model_loader.name":()=>wD,"animated_java.action.upgrade_old_aj_model_loader.select_file":()=>kD,"animated_java.action.variants.create":()=>QD,"animated_java.action.variants.delete":()=>n8,"animated_java.action.variants.duplicate":()=>e8,"animated_java.action.variants.open_config":()=>t8,"animated_java.animation.excluded_nodes":()=>i8,"animated_java.animation.invert_excluded_nodes":()=>r8,"animated_java.block_model_manager.mob_head_warning":()=>gR,"animated_java.dialog.about.close_button":()=>LO,"animated_java.dialog.about.title":()=>FO,"animated_java.dialog.animation_properties.animation_name.description":()=>SD,"animated_java.dialog.animation_properties.animation_name.error.empty":()=>DD,"animated_java.dialog.animation_properties.animation_name.error.invalid_characters":()=>RD,"animated_java.dialog.animation_properties.animation_name.title":()=>AD,"animated_java.dialog.animation_properties.bone_lists.description":()=>LD,"animated_java.dialog.animation_properties.excluded_nodes.description":()=>VD,"animated_java.dialog.animation_properties.excluded_nodes.title":()=>PD,"animated_java.dialog.animation_properties.included_nodes.description":()=>UD,"animated_java.dialog.animation_properties.included_nodes.title":()=>zD,"animated_java.dialog.animation_properties.loop_delay.description":()=>FD,"animated_java.dialog.animation_properties.loop_delay.title":()=>MD,"animated_java.dialog.animation_properties.loop_mode.description":()=>ID,"animated_java.dialog.animation_properties.loop_mode.options.hold":()=>ND,"animated_java.dialog.animation_properties.loop_mode.options.loop":()=>BD,"animated_java.dialog.animation_properties.loop_mode.options.once":()=>OD,"animated_java.dialog.animation_properties.loop_mode.title":()=>jD,"animated_java.dialog.animation_properties.swap_columns_button.tooltip":()=>GD,"animated_java.dialog.animation_properties.title":()=>CD,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.file_does_not_exist":()=>q4,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.no_file_selected":()=>K4,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.not_a_file":()=>W4,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.description":()=>X4,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.folder_does_not_exist":()=>Q4,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.no_folder_selected":()=>Y4,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.not_a_folder":()=>eN,"animated_java.dialog.blueprint_settings.advanced_settings_warning":()=>HO,"animated_java.dialog.blueprint_settings.auto_bounding_box.description":()=>y4,"animated_java.dialog.blueprint_settings.auto_bounding_box.title":()=>v4,"animated_java.dialog.blueprint_settings.baked_animations.description":()=>CN,"animated_java.dialog.blueprint_settings.baked_animations.title":()=>TN,"animated_java.dialog.blueprint_settings.blueprint_name.description":()=>KO,"animated_java.dialog.blueprint_settings.blueprint_name.title":()=>$O,"animated_java.dialog.blueprint_settings.bounding_box.description":()=>x4,"animated_java.dialog.blueprint_settings.bounding_box.title":()=>w4,"animated_java.dialog.blueprint_settings.custom_model_data_offset.description":()=>B4,"animated_java.dialog.blueprint_settings.custom_model_data_offset.title":()=>N4,"animated_java.dialog.blueprint_settings.data_pack.description":()=>sN,"animated_java.dialog.blueprint_settings.data_pack.error.folder_does_not_exist":()=>cN,"animated_java.dialog.blueprint_settings.data_pack.error.missing_data_folder":()=>fN,"animated_java.dialog.blueprint_settings.data_pack.error.missing_pack_mcmeta":()=>dN,"animated_java.dialog.blueprint_settings.data_pack.error.no_folder_selected":()=>lN,"animated_java.dialog.blueprint_settings.data_pack.error.not_a_folder":()=>uN,"animated_java.dialog.blueprint_settings.data_pack.title":()=>oN,"animated_java.dialog.blueprint_settings.data_pack_export_mode.description":()=>m4,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.none":()=>g4,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.raw":()=>p4,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.zip":()=>_4,"animated_java.dialog.blueprint_settings.data_pack_export_mode.title":()=>f4,"animated_java.dialog.blueprint_settings.data_pack_settings.title":()=>iN,"animated_java.dialog.blueprint_settings.data_pack_zip.description":()=>pN,"animated_java.dialog.blueprint_settings.data_pack_zip.error.no_file_selected":()=>_N,"animated_java.dialog.blueprint_settings.data_pack_zip.error.not_a_file":()=>gN,"animated_java.dialog.blueprint_settings.data_pack_zip.title":()=>mN,"animated_java.dialog.blueprint_settings.display_item.description":()=>A4,"animated_java.dialog.blueprint_settings.display_item.error.invalid_item_id.no_namespace":()=>j4,"animated_java.dialog.blueprint_settings.display_item.error.invalid_item_id.whitespace":()=>I4,"animated_java.dialog.blueprint_settings.display_item.error.no_item_selected":()=>S4,"animated_java.dialog.blueprint_settings.display_item.title":()=>C4,"animated_java.dialog.blueprint_settings.display_item.warning.item_does_not_exist":()=>O4,"animated_java.dialog.blueprint_settings.display_item_path.description":()=>$4,"animated_java.dialog.blueprint_settings.display_item_path.title":()=>H4,"animated_java.dialog.blueprint_settings.enable_advanced_data_pack_settings.description":()=>aN,"animated_java.dialog.blueprint_settings.enable_advanced_data_pack_settings.title":()=>rN,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_settings.description":()=>T4,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_settings.title":()=>E4,"animated_java.dialog.blueprint_settings.enable_plugin_mode.description":()=>o4,"animated_java.dialog.blueprint_settings.enable_plugin_mode.title":()=>a4,"animated_java.dialog.blueprint_settings.export_namespace.description":()=>t4,"animated_java.dialog.blueprint_settings.export_namespace.error.empty":()=>n4,"animated_java.dialog.blueprint_settings.export_namespace.error.invalid_characters":()=>r4,"animated_java.dialog.blueprint_settings.export_namespace.error.reserved":()=>i4,"animated_java.dialog.blueprint_settings.export_namespace.title":()=>e4,"animated_java.dialog.blueprint_settings.export_settings.title":()=>QO,"animated_java.dialog.blueprint_settings.interpolation_duration.description":()=>yN,"animated_java.dialog.blueprint_settings.interpolation_duration.title":()=>vN,"animated_java.dialog.blueprint_settings.json_file.description":()=>SN,"animated_java.dialog.blueprint_settings.json_file.error.no_file_selected":()=>jN,"animated_java.dialog.blueprint_settings.json_file.error.not_a_file":()=>IN,"animated_java.dialog.blueprint_settings.json_file.title":()=>AN,"animated_java.dialog.blueprint_settings.model_folder.title":()=>Z4,"animated_java.dialog.blueprint_settings.resource_pack.description":()=>R4,"animated_java.dialog.blueprint_settings.resource_pack.error.folder_does_not_exist":()=>F4,"animated_java.dialog.blueprint_settings.resource_pack.error.missing_assets_folder":()=>V4,"animated_java.dialog.blueprint_settings.resource_pack.error.missing_pack_mcmeta":()=>P4,"animated_java.dialog.blueprint_settings.resource_pack.error.no_folder_selected":()=>M4,"animated_java.dialog.blueprint_settings.resource_pack.error.not_a_folder":()=>L4,"animated_java.dialog.blueprint_settings.resource_pack.title":()=>D4,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.description":()=>l4,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.none":()=>d4,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.raw":()=>c4,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.zip":()=>u4,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.title":()=>s4,"animated_java.dialog.blueprint_settings.resource_pack_settings.title":()=>k4,"animated_java.dialog.blueprint_settings.resource_pack_zip.description":()=>U4,"animated_java.dialog.blueprint_settings.resource_pack_zip.error.no_file_selected":()=>G4,"animated_java.dialog.blueprint_settings.resource_pack_zip.error.not_a_file":()=>J4,"animated_java.dialog.blueprint_settings.resource_pack_zip.title":()=>z4,"animated_java.dialog.blueprint_settings.show_bounding_box.description":()=>b4,"animated_java.dialog.blueprint_settings.show_bounding_box.title":()=>h4,"animated_java.dialog.blueprint_settings.summon_commands.description":()=>bN,"animated_java.dialog.blueprint_settings.summon_commands.title":()=>hN,"animated_java.dialog.blueprint_settings.teleportation_duration.description":()=>xN,"animated_java.dialog.blueprint_settings.teleportation_duration.title":()=>wN,"animated_java.dialog.blueprint_settings.texture_folder.description":()=>nN,"animated_java.dialog.blueprint_settings.texture_folder.title":()=>tN,"animated_java.dialog.blueprint_settings.texture_size.description":()=>WO,"animated_java.dialog.blueprint_settings.texture_size.title":()=>qO,"animated_java.dialog.blueprint_settings.texture_size.warning.does_not_match_largest_texture":()=>YO,"animated_java.dialog.blueprint_settings.texture_size.warning.not_a_power_of_2":()=>XO,"animated_java.dialog.blueprint_settings.texture_size.warning.not_square":()=>ZO,"animated_java.dialog.blueprint_settings.title":()=>JO,"animated_java.dialog.blueprint_settings.use_storage_for_animation.description":()=>EN,"animated_java.dialog.blueprint_settings.use_storage_for_animation.title":()=>kN,"animated_java.dialog.bone_config.billboard.description":()=>cB,"animated_java.dialog.bone_config.billboard.options.center":()=>mB,"animated_java.dialog.bone_config.billboard.options.fixed":()=>uB,"animated_java.dialog.bone_config.billboard.options.horizontal":()=>fB,"animated_java.dialog.bone_config.billboard.options.vertical":()=>dB,"animated_java.dialog.bone_config.billboard.title":()=>lB,"animated_java.dialog.bone_config.brightness_override.description":()=>QN,"animated_java.dialog.bone_config.brightness_override.title":()=>YN,"animated_java.dialog.bone_config.default_variant_subtitle":()=>BN,"animated_java.dialog.bone_config.enchanted.description":()=>tB,"animated_java.dialog.bone_config.enchanted.title":()=>eB,"animated_java.dialog.bone_config.glow_color.description":()=>HN,"animated_java.dialog.bone_config.glow_color.title":()=>JN,"animated_java.dialog.bone_config.glowing.description":()=>zN,"animated_java.dialog.bone_config.glowing.title":()=>VN,"animated_java.dialog.bone_config.inherit_settings.description":()=>PN,"animated_java.dialog.bone_config.inherit_settings.title":()=>LN,"animated_java.dialog.bone_config.invisible.description":()=>iB,"animated_java.dialog.bone_config.invisible.title":()=>nB,"animated_java.dialog.bone_config.nbt.description":()=>aB,"animated_java.dialog.bone_config.nbt.invalid_nbt.error":()=>sB,"animated_java.dialog.bone_config.nbt.invalid_nbt.not_compound":()=>oB,"animated_java.dialog.bone_config.nbt.title":()=>rB,"animated_java.dialog.bone_config.override_brightness.description":()=>XN,"animated_java.dialog.bone_config.override_brightness.title":()=>ZN,"animated_java.dialog.bone_config.override_glow_color.description":()=>GN,"animated_java.dialog.bone_config.override_glow_color.title":()=>UN,"animated_java.dialog.bone_config.selected_variant":()=>NN,"animated_java.dialog.bone_config.selected_variant_subtitle":()=>DN,"animated_java.dialog.bone_config.shadow_radius.description":()=>KN,"animated_java.dialog.bone_config.shadow_radius.title":()=>$N,"animated_java.dialog.bone_config.shadow_strength.description":()=>WN,"animated_java.dialog.bone_config.shadow_strength.title":()=>qN,"animated_java.dialog.bone_config.title":()=>ON,"animated_java.dialog.bone_config.use_nbt.description":()=>MN,"animated_java.dialog.bone_config.use_nbt.title":()=>RN,"animated_java.dialog.bone_config.use_nbt.use_nbt_warning":()=>FN,"animated_java.dialog.bone_config.vanilla_item_model.description":()=>SB,"animated_java.dialog.bone_config.vanilla_item_model.title":()=>AB,"animated_java.dialog.export_progress.title":()=>JD,"animated_java.dialog.locator_config.entity_type.description":()=>vB,"animated_java.dialog.locator_config.entity_type.error.empty":()=>yB,"animated_java.dialog.locator_config.entity_type.title":()=>bB,"animated_java.dialog.locator_config.entity_type.warning.invalid":()=>wB,"animated_java.dialog.locator_config.plugin_mode_warning":()=>_B,"animated_java.dialog.locator_config.summon_commands.description":()=>kB,"animated_java.dialog.locator_config.summon_commands.title":()=>xB,"animated_java.dialog.locator_config.ticking_commands.description":()=>TB,"animated_java.dialog.locator_config.ticking_commands.title":()=>EB,"animated_java.dialog.locator_config.title":()=>pB,"animated_java.dialog.locator_config.use_entity.description":()=>hB,"animated_java.dialog.locator_config.use_entity.title":()=>gB,"animated_java.dialog.text_display_config.billboard.description":()=>QB,"animated_java.dialog.text_display_config.billboard.options.center":()=>iD,"animated_java.dialog.text_display_config.billboard.options.fixed":()=>eD,"animated_java.dialog.text_display_config.billboard.options.horizontal":()=>nD,"animated_java.dialog.text_display_config.billboard.options.vertical":()=>tD,"animated_java.dialog.text_display_config.billboard.title":()=>YB,"animated_java.dialog.text_display_config.brightness_override.description":()=>KB,"animated_java.dialog.text_display_config.brightness_override.title":()=>$B,"animated_java.dialog.text_display_config.glow_color.description":()=>PB,"animated_java.dialog.text_display_config.glow_color.title":()=>LB,"animated_java.dialog.text_display_config.glowing.description":()=>RB,"animated_java.dialog.text_display_config.glowing.title":()=>DB,"animated_java.dialog.text_display_config.inherit_settings.description":()=>BB,"animated_java.dialog.text_display_config.inherit_settings.title":()=>NB,"animated_java.dialog.text_display_config.invisible.description":()=>WB,"animated_java.dialog.text_display_config.invisible.title":()=>qB,"animated_java.dialog.text_display_config.nbt.description":()=>XB,"animated_java.dialog.text_display_config.nbt.title":()=>ZB,"animated_java.dialog.text_display_config.override_brightness.description":()=>HB,"animated_java.dialog.text_display_config.override_brightness.title":()=>JB,"animated_java.dialog.text_display_config.override_glow_color.description":()=>FB,"animated_java.dialog.text_display_config.override_glow_color.title":()=>MB,"animated_java.dialog.text_display_config.shadow_radius.description":()=>zB,"animated_java.dialog.text_display_config.shadow_radius.title":()=>VB,"animated_java.dialog.text_display_config.shadow_strength.description":()=>GB,"animated_java.dialog.text_display_config.shadow_strength.title":()=>UB,"animated_java.dialog.text_display_config.title":()=>CB,"animated_java.dialog.text_display_config.use_nbt.description":()=>IB,"animated_java.dialog.text_display_config.use_nbt.title":()=>jB,"animated_java.dialog.text_display_config.use_nbt.use_nbt_warning":()=>OB,"animated_java.dialog.unexpected_error.close_button":()=>VO,"animated_java.dialog.unexpected_error.copy_error_message_button.description":()=>UO,"animated_java.dialog.unexpected_error.copy_error_message_button.message":()=>zO,"animated_java.dialog.unexpected_error.paragraph":()=>GO,"animated_java.dialog.unexpected_error.title":()=>PO,"animated_java.dialog.upgrade_old_aj_model_loader.title":()=>xD,"animated_java.dialog.variant_config.bone_lists.description":()=>_D,"animated_java.dialog.variant_config.excluded_nodes.description":()=>hD,"animated_java.dialog.variant_config.excluded_nodes.title":()=>gD,"animated_java.dialog.variant_config.generate_name_from_display_name":()=>sD,"animated_java.dialog.variant_config.generate_name_from_display_name.description":()=>lD,"animated_java.dialog.variant_config.included_nodes.description":()=>vD,"animated_java.dialog.variant_config.included_nodes.title":()=>bD,"animated_java.dialog.variant_config.swap_columns_button.tooltip":()=>yD,"animated_java.dialog.variant_config.texture_map.create_new_mapping":()=>mD,"animated_java.dialog.variant_config.texture_map.description":()=>fD,"animated_java.dialog.variant_config.texture_map.no_mappings":()=>pD,"animated_java.dialog.variant_config.texture_map.title":()=>dD,"animated_java.dialog.variant_config.title":()=>rD,"animated_java.dialog.variant_config.variant_display_name":()=>aD,"animated_java.dialog.variant_config.variant_display_name.description":()=>oD,"animated_java.dialog.variant_config.variant_name":()=>cD,"animated_java.dialog.variant_config.variant_name.description":()=>uD,"animated_java.effect_animator.keyframes.commands":()=>l8,"animated_java.effect_animator.keyframes.execute_condition":()=>c8,"animated_java.effect_animator.keyframes.variant":()=>s8,"animated_java.effect_animator.timeline.commands":()=>o8,"animated_java.effect_animator.timeline.variant":()=>a8,"animated_java.error.blueprint_export_path_doesnt_exist.description":()=>bR,"animated_java.error.blueprint_export_path_doesnt_exist.title":()=>hR,"animated_java.format_category.animated_java":()=>_R,"animated_java.misc.failed_to_export.blueprint_settings.error_item":()=>mR,"animated_java.misc.failed_to_export.blueprint_settings.message":()=>fR,"animated_java.misc.failed_to_export.button":()=>pR,"animated_java.misc.failed_to_export.custom_models.message":()=>dR,"animated_java.misc.failed_to_export.title":()=>uR,"animated_java.panel.keyframe.commands.description":()=>p8,"animated_java.panel.keyframe.commands.title":()=>m8,"animated_java.panel.keyframe.easing_args.description":()=>V8,"animated_java.panel.keyframe.easing_args.easing_arg.back.description":()=>J8,"animated_java.panel.keyframe.easing_args.easing_arg.back.title":()=>G8,"animated_java.panel.keyframe.easing_args.easing_arg.bounce.description":()=>$8,"animated_java.panel.keyframe.easing_args.easing_arg.bounce.title":()=>H8,"animated_java.panel.keyframe.easing_args.easing_arg.elastic.description":()=>U8,"animated_java.panel.keyframe.easing_args.easing_arg.elastic.title":()=>z8,"animated_java.panel.keyframe.easing_args.title":()=>P8,"animated_java.panel.keyframe.easing_mode.description":()=>R8,"animated_java.panel.keyframe.easing_mode.options.in":()=>M8,"animated_java.panel.keyframe.easing_mode.options.inout":()=>L8,"animated_java.panel.keyframe.easing_mode.options.out":()=>F8,"animated_java.panel.keyframe.easing_mode.title":()=>D8,"animated_java.panel.keyframe.easing_type.description":()=>x8,"animated_java.panel.keyframe.easing_type.options.back":()=>N8,"animated_java.panel.keyframe.easing_type.options.bounce":()=>B8,"animated_java.panel.keyframe.easing_type.options.circ":()=>I8,"animated_java.panel.keyframe.easing_type.options.cubic":()=>C8,"animated_java.panel.keyframe.easing_type.options.elastic":()=>O8,"animated_java.panel.keyframe.easing_type.options.expo":()=>j8,"animated_java.panel.keyframe.easing_type.options.linear":()=>k8,"animated_java.panel.keyframe.easing_type.options.quad":()=>T8,"animated_java.panel.keyframe.easing_type.options.quart":()=>A8,"animated_java.panel.keyframe.easing_type.options.quint":()=>S8,"animated_java.panel.keyframe.easing_type.options.sine":()=>E8,"animated_java.panel.keyframe.easing_type.title":()=>w8,"animated_java.panel.keyframe.execute_condition.description":()=>g8,"animated_java.panel.keyframe.execute_condition.title":()=>_8,"animated_java.panel.keyframe.keyframe_title":()=>u8,"animated_java.panel.keyframe.repeat.description":()=>b8,"animated_java.panel.keyframe.repeat.title":()=>h8,"animated_java.panel.keyframe.repeat_frequency.description":()=>y8,"animated_java.panel.keyframe.repeat_frequency.title":()=>v8,"animated_java.panel.keyframe.variant.description":()=>f8,"animated_java.panel.keyframe.variant.title":()=>d8,"animated_java.panel.text_display.title":()=>K8,"animated_java.panel.vanilla_block_display.description":()=>lR,"animated_java.panel.vanilla_block_display.title":()=>sR,"animated_java.panel.vanilla_item_display.description":()=>oR,"animated_java.panel.vanilla_item_display.title":()=>aR,"animated_java.panel.variants.title":()=>HD,"animated_java.panel.variants.tool.cannot_delete_default_variant":()=>YD,"animated_java.panel.variants.tool.create_new_variant":()=>$D,"animated_java.panel.variants.tool.delete_selected_variant":()=>WD,"animated_java.panel.variants.tool.duplicate_selected_variant":()=>qD,"animated_java.panel.variants.tool.edit_variant":()=>KD,"animated_java.panel.variants.tool.variant_not_visible":()=>XD,"animated_java.panel.variants.tool.variant_visible":()=>ZD,"animated_java.popup.loading.loading":()=>DO,"animated_java.popup.loading.offline":()=>MO,"animated_java.popup.loading.success":()=>RO,"animated_java.tool.text_display.background_color.description":()=>X8,"animated_java.tool.text_display.background_color.title":()=>Z8,"animated_java.tool.text_display.line_width.description":()=>W8,"animated_java.tool.text_display.line_width.title":()=>q8,"animated_java.tool.text_display.text_alignment.description":()=>tR,"animated_java.tool.text_display.text_alignment.options.center":()=>iR,"animated_java.tool.text_display.text_alignment.options.left":()=>nR,"animated_java.tool.text_display.text_alignment.options.right":()=>rR,"animated_java.tool.text_display.text_alignment.title":()=>eR,"animated_java.tool.text_display.text_shadow.description":()=>Q8,"animated_java.tool.text_display.text_shadow.title":()=>Y8,"animated_java.vanilla_item_display.title":()=>cR,default:()=>vR});var xO="Blauwdruk Instellingen",kO="Documentatie",EO="Over",TO="Bot Configuratie",CO="Locator Configuratie",AO="Tekstweergave Configuratie",SO="Exporteren",jO="Voeg Tekstweergave toe",IO="Voeg Vanilla Voorwerpweergave toe",OO="Voeg Vanilla Blokweergave toe",NO="Vanilla Voorwerpweergave Configuratie",BO="Vanilla Blokweergave Configuratie",DO="Animated Java Laden...",RO="Animated Java succesvol geladen!",MO=`Animated Java Kon niet Verbinden! -Sommige functies zijn mogelijk niet beschikbaar.`,FO="Over Animated Java",LO="Sluiten",PO="Er Is Een Onverwachte Fout Opgetreden!",VO="Sluiten",zO="Foutmelding Gekopieerd naar klembord!",UO="Klik op om de foutmelding naar het klembord te kopi\xEBren.",GO="Meld deze fout door lid te worden van onze {0} en een thread te maken in het #animated-java-support kanaal, of door een probleem aan te maken op onze {1}. Bedankt!",JO="Blauwdruk Instellingen",HO="Geavanceerde instellingen moeten alleen worden gebruikt als het echt nodig is!",$O="Blauwdruk Naam",KO="De naam van de Blauwdruk. Wordt alleen gebruikt om het project in de werkruimte te identificeren.",qO="Textuurgrootte",WO="De resolutie van de UV-editor. Deze moet dezelfde grootte hebben als de grootste textuur. Voor het beste resultaat gebruik je een vierkante textuur en zorg je ervoor dat de grootte een macht van 2 is.",ZO="De Textuurgrootte moet vierkant zijn voor de beste resultaten.",XO="De Textuurgrootte moet een macht van 2 zijn voor de beste resultaten.",YO="De Textuurgrootte moet overeenkomen met de grootte van de grootste textuur.",QO="Exportinstellingen",e4="Export Namespace",t4="De Namespace om het project naar te exporteren. Dit is de Namespace die zal worden gebruikt in de ge\xEBxporteerde Resource Pack en Data Pack.",n4="De export namespace Mag niet leeg zijn!",i4='De export namespace "{0}" is gereserveerd voor interne functionaliteit! Kies een andere namespace.',r4="De export namespace bevat ongeldige tekens! Namespaces kunnen alleen letters, cijfers en underscores bevatten.",a4="Plugin-Modus",o4="Plugin-modus wel of niet inschakelen. Inschakelen als je van plan bent om een plugin-gebaseerde oplossing te gebruiken in plaats van een Resource Pack en/of Data Pack.",s4="Resource Pack Export Modus",l4=`Bepaalt hoe de Resource Pack moet worden ge\xEBxporteerd. +If this is set to a value larger than the length of the animation, the commands will run as if repeat was disabled (Once when the keyframe is reached).`,bO="Easing Type",vO="The type of easing to apply to the keyframe.",yO="Linear",wO="Sine",xO="Quad",kO="Cubic",EO="Quart",TO="Quint",CO="Expo",AO="Circ",SO="Elastic",jO="Back",IO="Bounce",OO="Easing Mode",NO="The easing mode to apply to the keyframe.",BO="In",RO="Out",DO="In-Out",MO="Easing Args",FO="The arguments to apply to the easing function.",LO="Elasticity",PO="The elasticity of the easing function.",VO="Overshoot",zO="The amount of overshoot to apply to the easing function.",GO="Bounciness",UO="The bounciness of the easing function.",JO=`Advanced easing options are disabled. +Change the keyframe's interpolation mode to 'linear' to enable them.`,HO="Text Display",$O="Line Width",qO="The width of the text display in pixels.",KO="Background Color",WO="The color of the background of the text display.",ZO="Text Shadow",XO="Whether or not to display a shadow behind the text.",YO="Text Alignment",QO="The alignment of the text.",eN="Left",tN="Center",nN="Right",iN="See Through",rN="Whether or not the text display should be visible through blocks.",aN="Displayed Item",oN="The item to display.",sN="Item Display Mode",lN="Which item model transform to apply to the item (as defined in display field in model JSON).",cN="None",uN="Third Person Left Hand",dN="Third Person Right Hand",fN="First Person Left Hand",mN="First Person Right Hand",pN="Head",_N="GUI",gN="Ground",hN="Fixed",bN="Displayed Block",vN="The block to display. Supports block states!",yN="Item Display",wN="Failed to Export",xN="You have disabled resource pack exporting, but have custom models in your project! Please enable resource pack exporting or remove the custom models before exporting.",kN="There are errors in your blueprint settings! Please fix them before exporting.",EN="Found an issue with {0}:",TN="Ok",CN="Animated Java",AN="Fluids don't render in Block Displays.",SN="Mob Heads don't render in Block Displays. Use an Item Display instead.",jN='The "facing" blockstate key is not supported in Block Displays.',IN="Blueprint Export Path Doesn't Exist",ON=`The export path '{0}' does not exist! +Make sure the folder you're saving to exists and try again.`,NN={"animated_java.action.open_blueprint_settings.name":$T,"animated_java.action.open_documentation.name":qT,"animated_java.action.open_about.name":KT,"animated_java.action.open_bone_config.name":WT,"animated_java.action.open_locator_config.name":ZT,"animated_java.action.open_text_display_config.name":XT,"animated_java.action.export.name":YT,"animated_java.action.create_text_display.title":QT,"animated_java.action.create_vanilla_item_display.title":eC,"animated_java.action.create_vanilla_block_display.title":tC,"animated_java.action.open_vanilla_item_display_config.name":nC,"animated_java.action.open_vanilla_block_display_config.name":iC,"animated_java.popup.loading.loading":rC,"animated_java.popup.loading.success":aC,"animated_java.popup.loading.offline":oC,"animated_java.dialog.installed_popup.title":sC,"animated_java.dialog.installed_popup.close_button":lC,"animated_java.dialog.reset":cC,"animated_java.dialog.about.title":uC,"animated_java.dialog.about.close_button":dC,"animated_java.dialog.unexpected_error.title":fC,"animated_java.dialog.unexpected_error.close_button":mC,"animated_java.dialog.unexpected_error.copy_error_message_button.message":pC,"animated_java.dialog.unexpected_error.copy_error_message_button.description":_C,"animated_java.dialog.unexpected_error.paragraph":gC,"animated_java.dialog.blueprint_settings.title":hC,"animated_java.dialog.blueprint_settings.advanced_settings_warning":bC,"animated_java.dialog.blueprint_settings.blueprint_name.title":vC,"animated_java.dialog.blueprint_settings.blueprint_name.description":yC,"animated_java.dialog.blueprint_settings.texture_size.title":wC,"animated_java.dialog.blueprint_settings.texture_size.description":xC,"animated_java.dialog.blueprint_settings.texture_size.warning.not_square":kC,"animated_java.dialog.blueprint_settings.texture_size.warning.not_a_power_of_2":EC,"animated_java.dialog.blueprint_settings.texture_size.warning.does_not_match_largest_texture":TC,"animated_java.dialog.blueprint_settings.export_settings.title":CC,"animated_java.dialog.blueprint_settings.export_namespace.title":AC,"animated_java.dialog.blueprint_settings.export_namespace.description":SC,"animated_java.dialog.blueprint_settings.export_namespace.error.empty":jC,"animated_java.dialog.blueprint_settings.export_namespace.error.reserved":IC,"animated_java.dialog.blueprint_settings.export_namespace.error.invalid_characters":OC,"animated_java.dialog.blueprint_settings.enable_plugin_mode.title":NC,"animated_java.dialog.blueprint_settings.enable_plugin_mode.description":BC,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.title":RC,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.description":DC,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.raw":MC,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.zip":FC,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.none":LC,"animated_java.dialog.blueprint_settings.data_pack_export_mode.title":PC,"animated_java.dialog.blueprint_settings.data_pack_export_mode.description":VC,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.raw":zC,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.zip":GC,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.none":UC,"animated_java.dialog.blueprint_settings.show_bounding_box.title":JC,"animated_java.dialog.blueprint_settings.show_bounding_box.description":HC,"animated_java.dialog.blueprint_settings.auto_bounding_box.title":$C,"animated_java.dialog.blueprint_settings.auto_bounding_box.description":qC,"animated_java.dialog.blueprint_settings.bounding_box.title":KC,"animated_java.dialog.blueprint_settings.bounding_box.description":WC,"animated_java.dialog.blueprint_settings.resource_pack_settings.title":ZC,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_settings.title":XC,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_settings.description":YC,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_folders.title":QC,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_folders.description":eA,"animated_java.dialog.blueprint_settings.display_item.title":tA,"animated_java.dialog.blueprint_settings.display_item.description":nA,"animated_java.dialog.blueprint_settings.display_item.error.no_item_selected":iA,"animated_java.dialog.blueprint_settings.display_item.error.invalid_item_id.no_namespace":rA,"animated_java.dialog.blueprint_settings.display_item.error.invalid_item_id.whitespace":aA,"animated_java.dialog.blueprint_settings.display_item.warning.item_does_not_exist":oA,"animated_java.dialog.blueprint_settings.display_item.warning.item_model_not_generated":sA,"animated_java.dialog.blueprint_settings.display_item.error.item_model_not_found":lA,"animated_java.dialog.blueprint_settings.custom_model_data_offset.title":cA,"animated_java.dialog.blueprint_settings.custom_model_data_offset.description":uA,"animated_java.dialog.blueprint_settings.resource_pack.title":dA,"animated_java.dialog.blueprint_settings.resource_pack.description":fA,"animated_java.dialog.blueprint_settings.resource_pack.error.no_folder_selected":mA,"animated_java.dialog.blueprint_settings.resource_pack.error.folder_does_not_exist":pA,"animated_java.dialog.blueprint_settings.resource_pack.error.not_a_folder":_A,"animated_java.dialog.blueprint_settings.resource_pack.error.missing_pack_mcmeta":gA,"animated_java.dialog.blueprint_settings.resource_pack.error.missing_assets_folder":hA,"animated_java.dialog.blueprint_settings.resource_pack_zip.title":bA,"animated_java.dialog.blueprint_settings.resource_pack_zip.description":vA,"animated_java.dialog.blueprint_settings.resource_pack_zip.error.no_file_selected":yA,"animated_java.dialog.blueprint_settings.resource_pack_zip.error.not_a_file":wA,"animated_java.dialog.blueprint_settings.display_item_path.title":xA,"animated_java.dialog.blueprint_settings.display_item_path.description":kA,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.no_file_selected":EA,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.file_does_not_exist":TA,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.not_a_file":CA,"animated_java.dialog.blueprint_settings.model_folder.title":AA,"animated_java.dialog.blueprint_settings.model_folder.description":SA,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.no_folder_selected":jA,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.folder_does_not_exist":IA,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.not_a_folder":OA,"animated_java.dialog.blueprint_settings.texture_folder.title":NA,"animated_java.dialog.blueprint_settings.texture_folder.description":BA,"animated_java.dialog.blueprint_settings.data_pack_settings.title":RA,"animated_java.dialog.blueprint_settings.enable_advanced_data_pack_settings.title":DA,"animated_java.dialog.blueprint_settings.enable_advanced_data_pack_settings.description":MA,"animated_java.dialog.blueprint_settings.data_pack.title":FA,"animated_java.dialog.blueprint_settings.data_pack.description":LA,"animated_java.dialog.blueprint_settings.data_pack.error.no_folder_selected":PA,"animated_java.dialog.blueprint_settings.data_pack.error.folder_does_not_exist":VA,"animated_java.dialog.blueprint_settings.data_pack.error.not_a_folder":zA,"animated_java.dialog.blueprint_settings.data_pack.error.missing_pack_mcmeta":GA,"animated_java.dialog.blueprint_settings.data_pack.error.missing_data_folder":UA,"animated_java.dialog.blueprint_settings.data_pack_zip.title":JA,"animated_java.dialog.blueprint_settings.data_pack_zip.description":HA,"animated_java.dialog.blueprint_settings.data_pack_zip.error.no_file_selected":$A,"animated_java.dialog.blueprint_settings.data_pack_zip.error.not_a_file":qA,"animated_java.dialog.blueprint_settings.summon_commands.title":KA,"animated_java.dialog.blueprint_settings.summon_commands.description":WA,"animated_java.dialog.blueprint_settings.ticking_commands.title":ZA,"animated_java.dialog.blueprint_settings.ticking_commands.description":XA,"animated_java.dialog.blueprint_settings.interpolation_duration.title":YA,"animated_java.dialog.blueprint_settings.interpolation_duration.description":QA,"animated_java.dialog.blueprint_settings.teleportation_duration.title":eS,"animated_java.dialog.blueprint_settings.teleportation_duration.description":tS,"animated_java.dialog.blueprint_settings.use_storage_for_animation.title":nS,"animated_java.dialog.blueprint_settings.use_storage_for_animation.description":iS,"animated_java.dialog.blueprint_settings.baked_animations.title":rS,"animated_java.dialog.blueprint_settings.baked_animations.description":aS,"animated_java.dialog.blueprint_settings.json_file.title":oS,"animated_java.dialog.blueprint_settings.json_file.description":sS,"animated_java.dialog.blueprint_settings.json_file.error.no_file_selected":lS,"animated_java.dialog.blueprint_settings.json_file.error.not_a_file":cS,"animated_java.dialog.bone_config.title":uS,"animated_java.dialog.bone_config.selected_variant":dS,"animated_java.dialog.bone_config.default_variant_subtitle":fS,"animated_java.dialog.bone_config.selected_variant_subtitle":mS,"animated_java.dialog.bone_config.use_nbt.title":pS,"animated_java.dialog.bone_config.use_nbt.description":_S,"animated_java.dialog.bone_config.use_nbt.use_nbt_warning":gS,"animated_java.dialog.bone_config.inherit_settings.title":hS,"animated_java.dialog.bone_config.inherit_settings.description":bS,"animated_java.dialog.bone_config.custom_name.title":vS,"animated_java.dialog.bone_config.custom_name.description":yS,"animated_java.dialog.bone_config.custom_name.invalid_json.error":wS,"animated_java.dialog.bone_config.custom_name_visible.title":xS,"animated_java.dialog.bone_config.custom_name_visible.description":kS,"animated_java.dialog.bone_config.glowing.title":ES,"animated_java.dialog.bone_config.glowing.description":TS,"animated_java.dialog.bone_config.override_glow_color.title":CS,"animated_java.dialog.bone_config.override_glow_color.description":AS,"animated_java.dialog.bone_config.glow_color.title":SS,"animated_java.dialog.bone_config.glow_color.description":jS,"animated_java.dialog.bone_config.shadow_radius.title":IS,"animated_java.dialog.bone_config.shadow_radius.description":OS,"animated_java.dialog.bone_config.shadow_strength.title":NS,"animated_java.dialog.bone_config.shadow_strength.description":BS,"animated_java.dialog.bone_config.override_brightness.title":RS,"animated_java.dialog.bone_config.override_brightness.description":DS,"animated_java.dialog.bone_config.brightness_override.title":MS,"animated_java.dialog.bone_config.brightness_override.description":FS,"animated_java.dialog.bone_config.enchanted.title":LS,"animated_java.dialog.bone_config.enchanted.description":PS,"animated_java.dialog.bone_config.invisible.title":VS,"animated_java.dialog.bone_config.invisible.description":zS,"animated_java.dialog.bone_config.nbt.title":GS,"animated_java.dialog.bone_config.nbt.description":US,"animated_java.dialog.bone_config.nbt.invalid_nbt.not_compound":JS,"animated_java.dialog.bone_config.nbt.invalid_nbt.error":HS,"animated_java.dialog.bone_config.billboard.title":$S,"animated_java.dialog.bone_config.billboard.description":qS,"animated_java.dialog.bone_config.billboard.options.fixed":KS,"animated_java.dialog.bone_config.billboard.options.vertical":WS,"animated_java.dialog.bone_config.billboard.options.horizontal":ZS,"animated_java.dialog.bone_config.billboard.options.center":XS,"animated_java.dialog.locator_config.title":YS,"animated_java.dialog.locator_config.plugin_mode_warning":QS,"animated_java.dialog.locator_config.use_entity.title":ej,"animated_java.dialog.locator_config.use_entity.description":tj,"animated_java.dialog.locator_config.entity_type.title":nj,"animated_java.dialog.locator_config.entity_type.description":ij,"animated_java.dialog.locator_config.entity_type.error.empty":rj,"animated_java.dialog.locator_config.entity_type.warning.invalid":aj,"animated_java.dialog.locator_config.summon_commands.title":oj,"animated_java.dialog.locator_config.summon_commands.description":sj,"animated_java.dialog.locator_config.ticking_commands.title":lj,"animated_java.dialog.locator_config.ticking_commands.description":cj,"animated_java.dialog.text_display_config.title":uj,"animated_java.dialog.bone_config.vanilla_item_model.title":dj,"animated_java.dialog.bone_config.vanilla_item_model.description":fj,"animated_java.dialog.text_display_config.use_nbt.title":mj,"animated_java.dialog.text_display_config.use_nbt.description":pj,"animated_java.dialog.text_display_config.use_nbt.use_nbt_warning":_j,"animated_java.dialog.text_display_config.inherit_settings.title":gj,"animated_java.dialog.text_display_config.inherit_settings.description":hj,"animated_java.dialog.text_display_config.glowing.title":bj,"animated_java.dialog.text_display_config.glowing.description":vj,"animated_java.dialog.text_display_config.override_glow_color.title":yj,"animated_java.dialog.text_display_config.override_glow_color.description":wj,"animated_java.dialog.text_display_config.glow_color.title":xj,"animated_java.dialog.text_display_config.glow_color.description":kj,"animated_java.dialog.text_display_config.shadow_radius.title":Ej,"animated_java.dialog.text_display_config.shadow_radius.description":Tj,"animated_java.dialog.text_display_config.shadow_strength.title":Cj,"animated_java.dialog.text_display_config.shadow_strength.description":Aj,"animated_java.dialog.text_display_config.override_brightness.title":Sj,"animated_java.dialog.text_display_config.override_brightness.description":jj,"animated_java.dialog.text_display_config.brightness_override.title":Ij,"animated_java.dialog.text_display_config.brightness_override.description":Oj,"animated_java.dialog.text_display_config.invisible.title":Nj,"animated_java.dialog.text_display_config.invisible.description":Bj,"animated_java.dialog.text_display_config.nbt.title":Rj,"animated_java.dialog.text_display_config.nbt.description":Dj,"animated_java.dialog.text_display_config.billboard.title":Mj,"animated_java.dialog.text_display_config.billboard.description":Fj,"animated_java.dialog.text_display_config.billboard.options.fixed":Lj,"animated_java.dialog.text_display_config.billboard.options.vertical":Pj,"animated_java.dialog.text_display_config.billboard.options.horizontal":Vj,"animated_java.dialog.text_display_config.billboard.options.center":zj,"animated_java.dialog.vanilla_block_display_config.title":Gj,"animated_java.dialog.vanilla_block_display.custom_name.title":Uj,"animated_java.dialog.vanilla_block_display.custom_name.description":Jj,"animated_java.dialog.vanilla_block_display.custom_name.invalid_json.error":Hj,"animated_java.dialog.vanilla_block_display.custom_name_visible.title":$j,"animated_java.dialog.vanilla_block_display.custom_name_visible.description":qj,"animated_java.dialog.vanilla_item_display_config.title":Kj,"animated_java.dialog.vanilla_item_display.custom_name.title":Wj,"animated_java.dialog.vanilla_item_display.custom_name.description":Zj,"animated_java.dialog.vanilla_item_display.custom_name.invalid_json.error":Xj,"animated_java.dialog.vanilla_item_display.custom_name_visible.title":Yj,"animated_java.dialog.vanilla_item_display.custom_name_visible.description":Qj,"animated_java.dialog.variant_config.title":eI,"animated_java.dialog.variant_config.variant_display_name":tI,"animated_java.dialog.variant_config.variant_display_name.description":nI,"animated_java.dialog.variant_config.generate_name_from_display_name":iI,"animated_java.dialog.variant_config.generate_name_from_display_name.description":rI,"animated_java.dialog.variant_config.variant_name":aI,"animated_java.dialog.variant_config.variant_name.description":oI,"animated_java.dialog.variant_config.texture_map.title":sI,"animated_java.dialog.variant_config.texture_map.description":lI,"animated_java.dialog.variant_config.texture_map.create_new_mapping":cI,"animated_java.dialog.variant_config.texture_map.no_mappings":uI,"animated_java.dialog.variant_config.bone_lists.description":dI,"animated_java.dialog.variant_config.excluded_nodes.title":fI,"animated_java.dialog.variant_config.excluded_nodes.description":mI,"animated_java.dialog.variant_config.included_nodes.title":pI,"animated_java.dialog.variant_config.included_nodes.description":_I,"animated_java.dialog.variant_config.swap_columns_button.tooltip":gI,"animated_java.action.upgrade_old_aj_model_loader.name":hI,"animated_java.dialog.upgrade_old_aj_model_loader.title":bI,"animated_java.action.upgrade_old_aj_model_loader.select_file":vI,"animated_java.action.upgrade_old_aj_model_loader.body":yI,"animated_java.action.upgrade_old_aj_model_loader.button":wI,"animated_java.dialog.animation_properties.title":xI,"animated_java.dialog.animation_properties.animation_name.title":kI,"animated_java.dialog.animation_properties.animation_name.description":EI,"animated_java.dialog.animation_properties.loop_mode.title":TI,"animated_java.dialog.animation_properties.loop_mode.description":CI,"animated_java.dialog.animation_properties.loop_mode.options.once":AI,"animated_java.dialog.animation_properties.loop_mode.options.hold":SI,"animated_java.dialog.animation_properties.loop_mode.options.loop":jI,"animated_java.dialog.animation_properties.animation_name.error.empty":II,"animated_java.dialog.animation_properties.animation_name.error.invalid_characters":OI,"animated_java.dialog.animation_properties.loop_delay.title":NI,"animated_java.dialog.animation_properties.loop_delay.description":BI,"animated_java.dialog.animation_properties.bone_lists.description":RI,"animated_java.dialog.animation_properties.excluded_nodes.title":DI,"animated_java.dialog.animation_properties.excluded_nodes.description":MI,"animated_java.dialog.animation_properties.included_nodes.title":FI,"animated_java.dialog.animation_properties.included_nodes.description":LI,"animated_java.dialog.animation_properties.swap_columns_button.tooltip":PI,"animated_java.dialog.export_progress.title":VI,"animated_java.dialog.blueprint_loading.title":zI,"animated_java.panel.variants.title":GI,"animated_java.panel.variants.tool.create_new_variant":UI,"animated_java.panel.variants.tool.edit_variant":JI,"animated_java.panel.variants.tool.duplicate_selected_variant":HI,"animated_java.panel.variants.tool.delete_selected_variant":$I,"animated_java.panel.variants.tool.variant_visible":qI,"animated_java.panel.variants.tool.variant_not_visible":KI,"animated_java.panel.variants.tool.cannot_delete_default_variant":WI,"animated_java.action.variants.create":ZI,"animated_java.action.variants.duplicate":XI,"animated_java.action.variants.open_config":YI,"animated_java.action.variants.delete":QI,"animated_java.animation.excluded_nodes":eO,"animated_java.animation.invert_excluded_nodes":tO,"animated_java.effect_animator.timeline.variant":nO,"animated_java.effect_animator.timeline.commands":iO,"animated_java.effect_animator.keyframes.variant":rO,"animated_java.effect_animator.keyframes.commands":aO,"animated_java.effect_animator.keyframes.execute_condition":oO,"animated_java.panel.keyframe.keyframe_title":sO,"animated_java.panel.keyframe.variant.title":lO,"animated_java.panel.keyframe.variant.description":cO,"animated_java.panel.keyframe.commands.title":uO,"animated_java.panel.keyframe.commands.description":dO,"animated_java.panel.keyframe.execute_condition.title":fO,"animated_java.panel.keyframe.execute_condition.description":mO,"animated_java.panel.keyframe.repeat.title":pO,"animated_java.panel.keyframe.repeat.description":_O,"animated_java.panel.keyframe.repeat_frequency.title":gO,"animated_java.panel.keyframe.repeat_frequency.description":hO,"animated_java.panel.keyframe.easing_type.title":bO,"animated_java.panel.keyframe.easing_type.description":vO,"animated_java.panel.keyframe.easing_type.options.linear":yO,"animated_java.panel.keyframe.easing_type.options.sine":wO,"animated_java.panel.keyframe.easing_type.options.quad":xO,"animated_java.panel.keyframe.easing_type.options.cubic":kO,"animated_java.panel.keyframe.easing_type.options.quart":EO,"animated_java.panel.keyframe.easing_type.options.quint":TO,"animated_java.panel.keyframe.easing_type.options.expo":CO,"animated_java.panel.keyframe.easing_type.options.circ":AO,"animated_java.panel.keyframe.easing_type.options.elastic":SO,"animated_java.panel.keyframe.easing_type.options.back":jO,"animated_java.panel.keyframe.easing_type.options.bounce":IO,"animated_java.panel.keyframe.easing_mode.title":OO,"animated_java.panel.keyframe.easing_mode.description":NO,"animated_java.panel.keyframe.easing_mode.options.in":BO,"animated_java.panel.keyframe.easing_mode.options.out":RO,"animated_java.panel.keyframe.easing_mode.options.inout":DO,"animated_java.panel.keyframe.easing_args.title":MO,"animated_java.panel.keyframe.easing_args.description":FO,"animated_java.panel.keyframe.easing_args.easing_arg.elastic.title":LO,"animated_java.panel.keyframe.easing_args.easing_arg.elastic.description":PO,"animated_java.panel.keyframe.easing_args.easing_arg.back.title":VO,"animated_java.panel.keyframe.easing_args.easing_arg.back.description":zO,"animated_java.panel.keyframe.easing_args.easing_arg.bounce.title":GO,"animated_java.panel.keyframe.easing_args.easing_arg.bounce.description":UO,"animated_java.panel.keyframe.nonlinear_interpolation":JO,"animated_java.panel.text_display.title":HO,"animated_java.tool.text_display.line_width.title":$O,"animated_java.tool.text_display.line_width.description":qO,"animated_java.tool.text_display.background_color.title":KO,"animated_java.tool.text_display.background_color.description":WO,"animated_java.tool.text_display.text_shadow.title":ZO,"animated_java.tool.text_display.text_shadow.description":XO,"animated_java.tool.text_display.text_alignment.title":YO,"animated_java.tool.text_display.text_alignment.description":QO,"animated_java.tool.text_display.text_alignment.options.left":eN,"animated_java.tool.text_display.text_alignment.options.center":tN,"animated_java.tool.text_display.text_alignment.options.right":nN,"animated_java.tool.text_display.see_through.title":iN,"animated_java.tool.text_display.see_through.description":rN,"animated_java.panel.vanilla_item_display.title":aN,"animated_java.panel.vanilla_item_display.description":oN,"animated_java.tool.item_display.item_display.title":sN,"animated_java.tool.item_display.item_display.description":lN,"animated_java.tool.item_display.item_display.options.none":cN,"animated_java.tool.item_display.item_display.options.thirdperson_lefthand":uN,"animated_java.tool.item_display.item_display.options.thirdperson_righthand":dN,"animated_java.tool.item_display.item_display.options.firstperson_lefthand":fN,"animated_java.tool.item_display.item_display.options.firstperson_righthand":mN,"animated_java.tool.item_display.item_display.options.head":pN,"animated_java.tool.item_display.item_display.options.gui":_N,"animated_java.tool.item_display.item_display.options.ground":gN,"animated_java.tool.item_display.item_display.options.fixed":hN,"animated_java.panel.vanilla_block_display.title":bN,"animated_java.panel.vanilla_block_display.description":vN,"animated_java.vanilla_item_display.title":yN,"animated_java.misc.failed_to_export.title":wN,"animated_java.misc.failed_to_export.custom_models.message":xN,"animated_java.misc.failed_to_export.blueprint_settings.message":kN,"animated_java.misc.failed_to_export.blueprint_settings.error_item":EN,"animated_java.misc.failed_to_export.button":TN,"animated_java.format_category.animated_java":CN,"animated_java.block_model_manager.fluid_warning":AN,"animated_java.block_model_manager.mob_head_warning":SN,"animated_java.block_model_manager.facing_warning":jN,"animated_java.error.blueprint_export_path_doesnt_exist.title":IN,"animated_java.error.blueprint_export_path_doesnt_exist.description":ON};var lf={};xn(lf,{"animated_java.action.create_text_display.title":()=>VN,"animated_java.action.create_vanilla_block_display.title":()=>GN,"animated_java.action.create_vanilla_item_display.title":()=>zN,"animated_java.action.export.name":()=>PN,"animated_java.action.open_about.name":()=>DN,"animated_java.action.open_blueprint_settings.name":()=>BN,"animated_java.action.open_bone_config.name":()=>MN,"animated_java.action.open_documentation.name":()=>RN,"animated_java.action.open_locator_config.name":()=>FN,"animated_java.action.open_text_display_config.name":()=>LN,"animated_java.action.open_vanilla_block_display_config.name":()=>JN,"animated_java.action.open_vanilla_item_display_config.name":()=>UN,"animated_java.action.upgrade_old_aj_model_loader.body":()=>DD,"animated_java.action.upgrade_old_aj_model_loader.button":()=>MD,"animated_java.action.upgrade_old_aj_model_loader.name":()=>ND,"animated_java.action.upgrade_old_aj_model_loader.select_file":()=>RD,"animated_java.action.variants.create":()=>u8,"animated_java.action.variants.delete":()=>m8,"animated_java.action.variants.duplicate":()=>d8,"animated_java.action.variants.open_config":()=>f8,"animated_java.animation.excluded_nodes":()=>p8,"animated_java.animation.invert_excluded_nodes":()=>_8,"animated_java.block_model_manager.mob_head_warning":()=>A6,"animated_java.dialog.about.close_button":()=>WN,"animated_java.dialog.about.title":()=>KN,"animated_java.dialog.animation_properties.animation_name.description":()=>PD,"animated_java.dialog.animation_properties.animation_name.error.empty":()=>HD,"animated_java.dialog.animation_properties.animation_name.error.invalid_characters":()=>$D,"animated_java.dialog.animation_properties.animation_name.title":()=>LD,"animated_java.dialog.animation_properties.bone_lists.description":()=>WD,"animated_java.dialog.animation_properties.excluded_nodes.description":()=>XD,"animated_java.dialog.animation_properties.excluded_nodes.title":()=>ZD,"animated_java.dialog.animation_properties.included_nodes.description":()=>QD,"animated_java.dialog.animation_properties.included_nodes.title":()=>YD,"animated_java.dialog.animation_properties.loop_delay.description":()=>KD,"animated_java.dialog.animation_properties.loop_delay.title":()=>qD,"animated_java.dialog.animation_properties.loop_mode.description":()=>zD,"animated_java.dialog.animation_properties.loop_mode.options.hold":()=>UD,"animated_java.dialog.animation_properties.loop_mode.options.loop":()=>JD,"animated_java.dialog.animation_properties.loop_mode.options.once":()=>GD,"animated_java.dialog.animation_properties.loop_mode.title":()=>VD,"animated_java.dialog.animation_properties.swap_columns_button.tooltip":()=>e8,"animated_java.dialog.animation_properties.title":()=>FD,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.file_does_not_exist":()=>aB,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.no_file_selected":()=>rB,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.not_a_file":()=>oB,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.description":()=>lB,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.folder_does_not_exist":()=>uB,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.no_folder_selected":()=>cB,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.not_a_folder":()=>dB,"animated_java.dialog.blueprint_settings.advanced_settings_warning":()=>n4,"animated_java.dialog.blueprint_settings.auto_bounding_box.description":()=>O4,"animated_java.dialog.blueprint_settings.auto_bounding_box.title":()=>I4,"animated_java.dialog.blueprint_settings.baked_animations.description":()=>FB,"animated_java.dialog.blueprint_settings.baked_animations.title":()=>MB,"animated_java.dialog.blueprint_settings.blueprint_name.description":()=>r4,"animated_java.dialog.blueprint_settings.blueprint_name.title":()=>i4,"animated_java.dialog.blueprint_settings.bounding_box.description":()=>B4,"animated_java.dialog.blueprint_settings.bounding_box.title":()=>N4,"animated_java.dialog.blueprint_settings.custom_model_data_offset.description":()=>J4,"animated_java.dialog.blueprint_settings.custom_model_data_offset.title":()=>U4,"animated_java.dialog.blueprint_settings.data_pack.description":()=>bB,"animated_java.dialog.blueprint_settings.data_pack.error.folder_does_not_exist":()=>yB,"animated_java.dialog.blueprint_settings.data_pack.error.missing_data_folder":()=>kB,"animated_java.dialog.blueprint_settings.data_pack.error.missing_pack_mcmeta":()=>xB,"animated_java.dialog.blueprint_settings.data_pack.error.no_folder_selected":()=>vB,"animated_java.dialog.blueprint_settings.data_pack.error.not_a_folder":()=>wB,"animated_java.dialog.blueprint_settings.data_pack.title":()=>hB,"animated_java.dialog.blueprint_settings.data_pack_export_mode.description":()=>E4,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.none":()=>A4,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.raw":()=>T4,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.zip":()=>C4,"animated_java.dialog.blueprint_settings.data_pack_export_mode.title":()=>k4,"animated_java.dialog.blueprint_settings.data_pack_settings.title":()=>pB,"animated_java.dialog.blueprint_settings.data_pack_zip.description":()=>TB,"animated_java.dialog.blueprint_settings.data_pack_zip.error.no_file_selected":()=>CB,"animated_java.dialog.blueprint_settings.data_pack_zip.error.not_a_file":()=>AB,"animated_java.dialog.blueprint_settings.data_pack_zip.title":()=>EB,"animated_java.dialog.blueprint_settings.display_item.description":()=>L4,"animated_java.dialog.blueprint_settings.display_item.error.invalid_item_id.no_namespace":()=>V4,"animated_java.dialog.blueprint_settings.display_item.error.invalid_item_id.whitespace":()=>z4,"animated_java.dialog.blueprint_settings.display_item.error.no_item_selected":()=>P4,"animated_java.dialog.blueprint_settings.display_item.title":()=>F4,"animated_java.dialog.blueprint_settings.display_item.warning.item_does_not_exist":()=>G4,"animated_java.dialog.blueprint_settings.display_item_path.description":()=>iB,"animated_java.dialog.blueprint_settings.display_item_path.title":()=>nB,"animated_java.dialog.blueprint_settings.enable_advanced_data_pack_settings.description":()=>gB,"animated_java.dialog.blueprint_settings.enable_advanced_data_pack_settings.title":()=>_B,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_settings.description":()=>M4,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_settings.title":()=>D4,"animated_java.dialog.blueprint_settings.enable_plugin_mode.description":()=>h4,"animated_java.dialog.blueprint_settings.enable_plugin_mode.title":()=>g4,"animated_java.dialog.blueprint_settings.export_namespace.description":()=>f4,"animated_java.dialog.blueprint_settings.export_namespace.error.empty":()=>m4,"animated_java.dialog.blueprint_settings.export_namespace.error.invalid_characters":()=>_4,"animated_java.dialog.blueprint_settings.export_namespace.error.reserved":()=>p4,"animated_java.dialog.blueprint_settings.export_namespace.title":()=>d4,"animated_java.dialog.blueprint_settings.export_settings.title":()=>u4,"animated_java.dialog.blueprint_settings.interpolation_duration.description":()=>OB,"animated_java.dialog.blueprint_settings.interpolation_duration.title":()=>IB,"animated_java.dialog.blueprint_settings.json_file.description":()=>PB,"animated_java.dialog.blueprint_settings.json_file.error.no_file_selected":()=>VB,"animated_java.dialog.blueprint_settings.json_file.error.not_a_file":()=>zB,"animated_java.dialog.blueprint_settings.json_file.title":()=>LB,"animated_java.dialog.blueprint_settings.model_folder.title":()=>sB,"animated_java.dialog.blueprint_settings.resource_pack.description":()=>$4,"animated_java.dialog.blueprint_settings.resource_pack.error.folder_does_not_exist":()=>K4,"animated_java.dialog.blueprint_settings.resource_pack.error.missing_assets_folder":()=>X4,"animated_java.dialog.blueprint_settings.resource_pack.error.missing_pack_mcmeta":()=>Z4,"animated_java.dialog.blueprint_settings.resource_pack.error.no_folder_selected":()=>q4,"animated_java.dialog.blueprint_settings.resource_pack.error.not_a_folder":()=>W4,"animated_java.dialog.blueprint_settings.resource_pack.title":()=>H4,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.description":()=>v4,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.none":()=>x4,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.raw":()=>y4,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.zip":()=>w4,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.title":()=>b4,"animated_java.dialog.blueprint_settings.resource_pack_settings.title":()=>R4,"animated_java.dialog.blueprint_settings.resource_pack_zip.description":()=>Q4,"animated_java.dialog.blueprint_settings.resource_pack_zip.error.no_file_selected":()=>eB,"animated_java.dialog.blueprint_settings.resource_pack_zip.error.not_a_file":()=>tB,"animated_java.dialog.blueprint_settings.resource_pack_zip.title":()=>Y4,"animated_java.dialog.blueprint_settings.show_bounding_box.description":()=>j4,"animated_java.dialog.blueprint_settings.show_bounding_box.title":()=>S4,"animated_java.dialog.blueprint_settings.summon_commands.description":()=>jB,"animated_java.dialog.blueprint_settings.summon_commands.title":()=>SB,"animated_java.dialog.blueprint_settings.teleportation_duration.description":()=>BB,"animated_java.dialog.blueprint_settings.teleportation_duration.title":()=>NB,"animated_java.dialog.blueprint_settings.texture_folder.description":()=>mB,"animated_java.dialog.blueprint_settings.texture_folder.title":()=>fB,"animated_java.dialog.blueprint_settings.texture_size.description":()=>o4,"animated_java.dialog.blueprint_settings.texture_size.title":()=>a4,"animated_java.dialog.blueprint_settings.texture_size.warning.does_not_match_largest_texture":()=>c4,"animated_java.dialog.blueprint_settings.texture_size.warning.not_a_power_of_2":()=>l4,"animated_java.dialog.blueprint_settings.texture_size.warning.not_square":()=>s4,"animated_java.dialog.blueprint_settings.title":()=>t4,"animated_java.dialog.blueprint_settings.use_storage_for_animation.description":()=>DB,"animated_java.dialog.blueprint_settings.use_storage_for_animation.title":()=>RB,"animated_java.dialog.bone_config.billboard.description":()=>yR,"animated_java.dialog.bone_config.billboard.options.center":()=>ER,"animated_java.dialog.bone_config.billboard.options.fixed":()=>wR,"animated_java.dialog.bone_config.billboard.options.horizontal":()=>kR,"animated_java.dialog.bone_config.billboard.options.vertical":()=>xR,"animated_java.dialog.bone_config.billboard.title":()=>vR,"animated_java.dialog.bone_config.brightness_override.description":()=>uR,"animated_java.dialog.bone_config.brightness_override.title":()=>cR,"animated_java.dialog.bone_config.default_variant_subtitle":()=>JB,"animated_java.dialog.bone_config.enchanted.description":()=>fR,"animated_java.dialog.bone_config.enchanted.title":()=>dR,"animated_java.dialog.bone_config.glow_color.description":()=>nR,"animated_java.dialog.bone_config.glow_color.title":()=>tR,"animated_java.dialog.bone_config.glowing.description":()=>YB,"animated_java.dialog.bone_config.glowing.title":()=>XB,"animated_java.dialog.bone_config.inherit_settings.description":()=>ZB,"animated_java.dialog.bone_config.inherit_settings.title":()=>WB,"animated_java.dialog.bone_config.invisible.description":()=>pR,"animated_java.dialog.bone_config.invisible.title":()=>mR,"animated_java.dialog.bone_config.nbt.description":()=>gR,"animated_java.dialog.bone_config.nbt.invalid_nbt.error":()=>bR,"animated_java.dialog.bone_config.nbt.invalid_nbt.not_compound":()=>hR,"animated_java.dialog.bone_config.nbt.title":()=>_R,"animated_java.dialog.bone_config.override_brightness.description":()=>lR,"animated_java.dialog.bone_config.override_brightness.title":()=>sR,"animated_java.dialog.bone_config.override_glow_color.description":()=>eR,"animated_java.dialog.bone_config.override_glow_color.title":()=>QB,"animated_java.dialog.bone_config.selected_variant":()=>UB,"animated_java.dialog.bone_config.selected_variant_subtitle":()=>HB,"animated_java.dialog.bone_config.shadow_radius.description":()=>rR,"animated_java.dialog.bone_config.shadow_radius.title":()=>iR,"animated_java.dialog.bone_config.shadow_strength.description":()=>oR,"animated_java.dialog.bone_config.shadow_strength.title":()=>aR,"animated_java.dialog.bone_config.title":()=>GB,"animated_java.dialog.bone_config.use_nbt.description":()=>qB,"animated_java.dialog.bone_config.use_nbt.title":()=>$B,"animated_java.dialog.bone_config.use_nbt.use_nbt_warning":()=>KB,"animated_java.dialog.bone_config.vanilla_item_model.description":()=>PR,"animated_java.dialog.bone_config.vanilla_item_model.title":()=>LR,"animated_java.dialog.export_progress.title":()=>t8,"animated_java.dialog.locator_config.entity_type.description":()=>IR,"animated_java.dialog.locator_config.entity_type.error.empty":()=>OR,"animated_java.dialog.locator_config.entity_type.title":()=>jR,"animated_java.dialog.locator_config.entity_type.warning.invalid":()=>NR,"animated_java.dialog.locator_config.plugin_mode_warning":()=>CR,"animated_java.dialog.locator_config.summon_commands.description":()=>RR,"animated_java.dialog.locator_config.summon_commands.title":()=>BR,"animated_java.dialog.locator_config.ticking_commands.description":()=>MR,"animated_java.dialog.locator_config.ticking_commands.title":()=>DR,"animated_java.dialog.locator_config.title":()=>TR,"animated_java.dialog.locator_config.use_entity.description":()=>SR,"animated_java.dialog.locator_config.use_entity.title":()=>AR,"animated_java.dialog.text_display_config.billboard.description":()=>uD,"animated_java.dialog.text_display_config.billboard.options.center":()=>pD,"animated_java.dialog.text_display_config.billboard.options.fixed":()=>dD,"animated_java.dialog.text_display_config.billboard.options.horizontal":()=>mD,"animated_java.dialog.text_display_config.billboard.options.vertical":()=>fD,"animated_java.dialog.text_display_config.billboard.title":()=>cD,"animated_java.dialog.text_display_config.brightness_override.description":()=>rD,"animated_java.dialog.text_display_config.brightness_override.title":()=>iD,"animated_java.dialog.text_display_config.glow_color.description":()=>ZR,"animated_java.dialog.text_display_config.glow_color.title":()=>WR,"animated_java.dialog.text_display_config.glowing.description":()=>$R,"animated_java.dialog.text_display_config.glowing.title":()=>HR,"animated_java.dialog.text_display_config.inherit_settings.description":()=>JR,"animated_java.dialog.text_display_config.inherit_settings.title":()=>UR,"animated_java.dialog.text_display_config.invisible.description":()=>oD,"animated_java.dialog.text_display_config.invisible.title":()=>aD,"animated_java.dialog.text_display_config.nbt.description":()=>lD,"animated_java.dialog.text_display_config.nbt.title":()=>sD,"animated_java.dialog.text_display_config.override_brightness.description":()=>nD,"animated_java.dialog.text_display_config.override_brightness.title":()=>tD,"animated_java.dialog.text_display_config.override_glow_color.description":()=>KR,"animated_java.dialog.text_display_config.override_glow_color.title":()=>qR,"animated_java.dialog.text_display_config.shadow_radius.description":()=>YR,"animated_java.dialog.text_display_config.shadow_radius.title":()=>XR,"animated_java.dialog.text_display_config.shadow_strength.description":()=>eD,"animated_java.dialog.text_display_config.shadow_strength.title":()=>QR,"animated_java.dialog.text_display_config.title":()=>FR,"animated_java.dialog.text_display_config.use_nbt.description":()=>zR,"animated_java.dialog.text_display_config.use_nbt.title":()=>VR,"animated_java.dialog.text_display_config.use_nbt.use_nbt_warning":()=>GR,"animated_java.dialog.unexpected_error.close_button":()=>XN,"animated_java.dialog.unexpected_error.copy_error_message_button.description":()=>QN,"animated_java.dialog.unexpected_error.copy_error_message_button.message":()=>YN,"animated_java.dialog.unexpected_error.paragraph":()=>e4,"animated_java.dialog.unexpected_error.title":()=>ZN,"animated_java.dialog.upgrade_old_aj_model_loader.title":()=>BD,"animated_java.dialog.variant_config.bone_lists.description":()=>CD,"animated_java.dialog.variant_config.excluded_nodes.description":()=>SD,"animated_java.dialog.variant_config.excluded_nodes.title":()=>AD,"animated_java.dialog.variant_config.generate_name_from_display_name":()=>bD,"animated_java.dialog.variant_config.generate_name_from_display_name.description":()=>vD,"animated_java.dialog.variant_config.included_nodes.description":()=>ID,"animated_java.dialog.variant_config.included_nodes.title":()=>jD,"animated_java.dialog.variant_config.swap_columns_button.tooltip":()=>OD,"animated_java.dialog.variant_config.texture_map.create_new_mapping":()=>ED,"animated_java.dialog.variant_config.texture_map.description":()=>kD,"animated_java.dialog.variant_config.texture_map.no_mappings":()=>TD,"animated_java.dialog.variant_config.texture_map.title":()=>xD,"animated_java.dialog.variant_config.title":()=>_D,"animated_java.dialog.variant_config.variant_display_name":()=>gD,"animated_java.dialog.variant_config.variant_display_name.description":()=>hD,"animated_java.dialog.variant_config.variant_name":()=>yD,"animated_java.dialog.variant_config.variant_name.description":()=>wD,"animated_java.effect_animator.keyframes.commands":()=>v8,"animated_java.effect_animator.keyframes.execute_condition":()=>y8,"animated_java.effect_animator.keyframes.variant":()=>b8,"animated_java.effect_animator.timeline.commands":()=>h8,"animated_java.effect_animator.timeline.variant":()=>g8,"animated_java.error.blueprint_export_path_doesnt_exist.description":()=>j6,"animated_java.error.blueprint_export_path_doesnt_exist.title":()=>S6,"animated_java.format_category.animated_java":()=>C6,"animated_java.misc.failed_to_export.blueprint_settings.error_item":()=>E6,"animated_java.misc.failed_to_export.blueprint_settings.message":()=>k6,"animated_java.misc.failed_to_export.button":()=>T6,"animated_java.misc.failed_to_export.custom_models.message":()=>x6,"animated_java.misc.failed_to_export.title":()=>w6,"animated_java.panel.keyframe.commands.description":()=>T8,"animated_java.panel.keyframe.commands.title":()=>E8,"animated_java.panel.keyframe.easing_args.description":()=>X8,"animated_java.panel.keyframe.easing_args.easing_arg.back.description":()=>t6,"animated_java.panel.keyframe.easing_args.easing_arg.back.title":()=>e6,"animated_java.panel.keyframe.easing_args.easing_arg.bounce.description":()=>i6,"animated_java.panel.keyframe.easing_args.easing_arg.bounce.title":()=>n6,"animated_java.panel.keyframe.easing_args.easing_arg.elastic.description":()=>Q8,"animated_java.panel.keyframe.easing_args.easing_arg.elastic.title":()=>Y8,"animated_java.panel.keyframe.easing_args.title":()=>Z8,"animated_java.panel.keyframe.easing_mode.description":()=>$8,"animated_java.panel.keyframe.easing_mode.options.in":()=>q8,"animated_java.panel.keyframe.easing_mode.options.inout":()=>W8,"animated_java.panel.keyframe.easing_mode.options.out":()=>K8,"animated_java.panel.keyframe.easing_mode.title":()=>H8,"animated_java.panel.keyframe.easing_type.description":()=>B8,"animated_java.panel.keyframe.easing_type.options.back":()=>U8,"animated_java.panel.keyframe.easing_type.options.bounce":()=>J8,"animated_java.panel.keyframe.easing_type.options.circ":()=>z8,"animated_java.panel.keyframe.easing_type.options.cubic":()=>F8,"animated_java.panel.keyframe.easing_type.options.elastic":()=>G8,"animated_java.panel.keyframe.easing_type.options.expo":()=>V8,"animated_java.panel.keyframe.easing_type.options.linear":()=>R8,"animated_java.panel.keyframe.easing_type.options.quad":()=>M8,"animated_java.panel.keyframe.easing_type.options.quart":()=>L8,"animated_java.panel.keyframe.easing_type.options.quint":()=>P8,"animated_java.panel.keyframe.easing_type.options.sine":()=>D8,"animated_java.panel.keyframe.easing_type.title":()=>N8,"animated_java.panel.keyframe.execute_condition.description":()=>A8,"animated_java.panel.keyframe.execute_condition.title":()=>C8,"animated_java.panel.keyframe.keyframe_title":()=>w8,"animated_java.panel.keyframe.repeat.description":()=>j8,"animated_java.panel.keyframe.repeat.title":()=>S8,"animated_java.panel.keyframe.repeat_frequency.description":()=>O8,"animated_java.panel.keyframe.repeat_frequency.title":()=>I8,"animated_java.panel.keyframe.variant.description":()=>k8,"animated_java.panel.keyframe.variant.title":()=>x8,"animated_java.panel.text_display.title":()=>r6,"animated_java.panel.vanilla_block_display.description":()=>v6,"animated_java.panel.vanilla_block_display.title":()=>b6,"animated_java.panel.vanilla_item_display.description":()=>h6,"animated_java.panel.vanilla_item_display.title":()=>g6,"animated_java.panel.variants.title":()=>n8,"animated_java.panel.variants.tool.cannot_delete_default_variant":()=>c8,"animated_java.panel.variants.tool.create_new_variant":()=>i8,"animated_java.panel.variants.tool.delete_selected_variant":()=>o8,"animated_java.panel.variants.tool.duplicate_selected_variant":()=>a8,"animated_java.panel.variants.tool.edit_variant":()=>r8,"animated_java.panel.variants.tool.variant_not_visible":()=>l8,"animated_java.panel.variants.tool.variant_visible":()=>s8,"animated_java.popup.loading.loading":()=>HN,"animated_java.popup.loading.offline":()=>qN,"animated_java.popup.loading.success":()=>$N,"animated_java.tool.text_display.background_color.description":()=>l6,"animated_java.tool.text_display.background_color.title":()=>s6,"animated_java.tool.text_display.line_width.description":()=>o6,"animated_java.tool.text_display.line_width.title":()=>a6,"animated_java.tool.text_display.text_alignment.description":()=>f6,"animated_java.tool.text_display.text_alignment.options.center":()=>p6,"animated_java.tool.text_display.text_alignment.options.left":()=>m6,"animated_java.tool.text_display.text_alignment.options.right":()=>_6,"animated_java.tool.text_display.text_alignment.title":()=>d6,"animated_java.tool.text_display.text_shadow.description":()=>u6,"animated_java.tool.text_display.text_shadow.title":()=>c6,"animated_java.vanilla_item_display.title":()=>y6,default:()=>I6});var BN="Blauwdruk Instellingen",RN="Documentatie",DN="Over",MN="Bot Configuratie",FN="Locator Configuratie",LN="Tekstweergave Configuratie",PN="Exporteren",VN="Voeg Tekstweergave toe",zN="Voeg Vanilla Voorwerpweergave toe",GN="Voeg Vanilla Blokweergave toe",UN="Vanilla Voorwerpweergave Configuratie",JN="Vanilla Blokweergave Configuratie",HN="Animated Java Laden...",$N="Animated Java succesvol geladen!",qN=`Animated Java Kon niet Verbinden! +Sommige functies zijn mogelijk niet beschikbaar.`,KN="Over Animated Java",WN="Sluiten",ZN="Er Is Een Onverwachte Fout Opgetreden!",XN="Sluiten",YN="Foutmelding Gekopieerd naar klembord!",QN="Klik op om de foutmelding naar het klembord te kopi\xEBren.",e4="Meld deze fout door lid te worden van onze {0} en een thread te maken in het #animated-java-support kanaal, of door een probleem aan te maken op onze {1}. Bedankt!",t4="Blauwdruk Instellingen",n4="Geavanceerde instellingen moeten alleen worden gebruikt als het echt nodig is!",i4="Blauwdruk Naam",r4="De naam van de Blauwdruk. Wordt alleen gebruikt om het project in de werkruimte te identificeren.",a4="Textuurgrootte",o4="De resolutie van de UV-editor. Deze moet dezelfde grootte hebben als de grootste textuur. Voor het beste resultaat gebruik je een vierkante textuur en zorg je ervoor dat de grootte een macht van 2 is.",s4="De Textuurgrootte moet vierkant zijn voor de beste resultaten.",l4="De Textuurgrootte moet een macht van 2 zijn voor de beste resultaten.",c4="De Textuurgrootte moet overeenkomen met de grootte van de grootste textuur.",u4="Exportinstellingen",d4="Export Namespace",f4="De Namespace om het project naar te exporteren. Dit is de Namespace die zal worden gebruikt in de ge\xEBxporteerde Resource Pack en Data Pack.",m4="De export namespace Mag niet leeg zijn!",p4='De export namespace "{0}" is gereserveerd voor interne functionaliteit! Kies een andere namespace.',_4="De export namespace bevat ongeldige tekens! Namespaces kunnen alleen letters, cijfers en underscores bevatten.",g4="Plugin-Modus",h4="Plugin-modus wel of niet inschakelen. Inschakelen als je van plan bent om een plugin-gebaseerde oplossing te gebruiken in plaats van een Resource Pack en/of Data Pack.",b4="Resource Pack Export Modus",v4=`Bepaalt hoe de Resource Pack moet worden ge\xEBxporteerd. Raw - Exporteert de Resource Pack als een map. Zip - Exporteert de Resource Pack als een .zip bestand. -None - Schakelt het exporteren van Resource Packs uit.`,c4="Raw",u4="Zip",d4="None",f4="Data Pack Export Modus",m4=`Bepaalt hoe de Data Pack moet worden ge\xEBxporteerd. +None - Schakelt het exporteren van Resource Packs uit.`,y4="Raw",w4="Zip",x4="None",k4="Data Pack Export Modus",E4=`Bepaalt hoe de Data Pack moet worden ge\xEBxporteerd. Raw - Exporteert de Data Pack als een map. Zip - Exporteert de Data Pack als een .zip bestand. -None - Schakelt het exporteren van Data Packs uit.`,p4="Raw",_4="Zip",g4="None",h4="Toon Bounding Box",b4="Of de bounding box wel of niet moet worden weergegeven in de editor.",v4="Auto Bounding Box",y4=`Wel of niet automatisch de bounding box berekenen op basis van de geometrie van het model. -OPMERKING: de automatische bounding box houdt GEEN rekening met botoffsets van animaties, dus de bounding box kan in sommige gevallen kleiner zijn dan nodig.`,w4="Bounding Box",x4="Bepaalt de culling box van het model. Het model stopt met renderen wanneer deze box buiten het scherm valt.",k4="Resource Pack Instellingen",E4="Geavanceerde Instellingen Gebruiken",T4="Of de geavanceerde instellingen voor Resource Packs wel of niet moeten worden ingeschakeld.",C4="Weergave Voorwerp",A4="Het voorwerp om de Blauwdruk-modellen in het spel weer te geven. Meerdere Blauwdrukken kunnen op hetzelfde voorwerp worden geplaatst en ze worden automatisch samengevoegd.",S4="Geen voorwerp geselecteerd!",j4="Het opgegeven voorwerp-ID is ongeldig! Voorwerp ID's moeten het formaat namespace:voorwerp_id hebben.",I4="Het opgegeven voorwerp-ID is ongeldig! Voorwerp ID's mogen geen spaties bevatten.",O4="Het geselecteerde voorwerp bestaat niet in vanilla!",N4="CMD Offset",B4="De offset die moet worden gebruikt voor de Custom Model Data van het weergave voorwerp. Staat meerdere blauwdrukken op hetzelfde voorwerp toe, maar in afzonderlijke, niet-aangesloten Resource Packs.",D4="Resource Pack",R4="De hoofdmap van de Resource Pack waarnaar het project moet worden ge\xEBxporteerd.",M4="Geen map geselecteerd!",F4="De geselecteerde map bestaat niet!",L4="Het geselecteerde pad is geen map!",P4="De geselecteerde map mist een pack.mcmeta bestand!",V4="De geselecteerde Resource Pack mist een assets map!",z4="Resource Pack Zip",U4="Het pad naar het .zip-bestand om het project naar te exporteren.",G4="Geen bestand geselecteerd!",J4="Het geselecteerde pad is geen bestand!",H4="Display Item Pad",$4="Waar het Weergave Voorwerp moet worden geplaatst. Dit moet een pad zijn naar een .json bestand in een Resource Pack.",K4="Geen bestand geselecteerd!",q4="Het geselecteerde bestand bestaat niet!",W4="Het geselecteerde pad is geen bestand!",Z4="Model Map",X4="Waar alle ge\xEBxporteerde modellen moeten worden geplaatst. Dit moet een pad zijn naar een map in een Resource Pack.",Y4="Geen map geselecteerd!",Q4="De geselecteerde map bestaat niet!",eN="Het geselecteerde pad is geen map!",tN="Textuur Map",nN="Waar alle ge\xEBxporteerde texturen moeten worden geplaatst. Dit moet een pad zijn naar een map in een Resource Pack.",iN="Data Pack Instellingen",rN="Geavanceerde Instellingen Gebruiken",aN="Of de geavanceerde instellingen voor Data Packs wel of niet moeten worden ingeschakeld.",oN="Data Pack",sN="De hoofdmap van de Data Pack waarnaar het project moet worden ge\xEBxporteerd.",lN="Geen map geselecteerd!",cN="De geselecteerde map bestaat niet!",uN="Het geselecteerde pad is geen map!",dN="De geselecteerde map mist een pack.mcmeta bestand!",fN="De geselecteerde Data Pack mist een data map!",mN="Data Pack Zip",pN="Het pad naar het .zip-bestand om het project naar te exporteren.",_N="Geen bestand geselecteerd!",gN="Het geselecteerde pad is geen bestand!",hN="On-Summon Commando's",bN=`Commando's om uit te voeren als de hoofdentiteit wanneer deze wordt opgeroepen. -Behandel deze tekstinvoer als een .mcfunction-bestand. (Ondersteunt ook MC-Build syntaxis!)`,vN="Interpolatie Duratie",yN="De duur van de interpolatie tussen keyframes in ticks. Dit is de tijd die het model nodig heeft om over te gaan van de ene keyframe naar de volgende. Hogere waarden zorgen ervoor dat animaties precisie verliezen. Over het algemeen wil je dat dit een waarde van 1 of 2 heeft.",wN="Teleportatie Duratie",xN="De duur van de teleportatie tussen keyframes in ticks. Dit is de tijd waarover het model visueel zal interpoleren tussen zijn oude positie en zijn nieuwe positie. Hogere waarden zorgen ervoor dat animaties precisie verliezen.",kN="Opslag gebruiken voor animatie",EN=`Wel of geen NBT-opslag gebruiken om animatiegegevens op te slaan in plaats van functies. -Dit vermindert het aantal functies in het gegenereerde Data Pack enorm, maar is 42% langzamer dan de functiemethode.`,TN="Gebakken Animaties",CN=`De ge\xEBxporteerde animaties al dan niet bakken. +None - Schakelt het exporteren van Data Packs uit.`,T4="Raw",C4="Zip",A4="None",S4="Toon Bounding Box",j4="Of de bounding box wel of niet moet worden weergegeven in de editor.",I4="Auto Bounding Box",O4=`Wel of niet automatisch de bounding box berekenen op basis van de geometrie van het model. +OPMERKING: de automatische bounding box houdt GEEN rekening met botoffsets van animaties, dus de bounding box kan in sommige gevallen kleiner zijn dan nodig.`,N4="Bounding Box",B4="Bepaalt de culling box van het model. Het model stopt met renderen wanneer deze box buiten het scherm valt.",R4="Resource Pack Instellingen",D4="Geavanceerde Instellingen Gebruiken",M4="Of de geavanceerde instellingen voor Resource Packs wel of niet moeten worden ingeschakeld.",F4="Weergave Voorwerp",L4="Het voorwerp om de Blauwdruk-modellen in het spel weer te geven. Meerdere Blauwdrukken kunnen op hetzelfde voorwerp worden geplaatst en ze worden automatisch samengevoegd.",P4="Geen voorwerp geselecteerd!",V4="Het opgegeven voorwerp-ID is ongeldig! Voorwerp ID's moeten het formaat namespace:voorwerp_id hebben.",z4="Het opgegeven voorwerp-ID is ongeldig! Voorwerp ID's mogen geen spaties bevatten.",G4="Het geselecteerde voorwerp bestaat niet in vanilla!",U4="CMD Offset",J4="De offset die moet worden gebruikt voor de Custom Model Data van het weergave voorwerp. Staat meerdere blauwdrukken op hetzelfde voorwerp toe, maar in afzonderlijke, niet-aangesloten Resource Packs.",H4="Resource Pack",$4="De hoofdmap van de Resource Pack waarnaar het project moet worden ge\xEBxporteerd.",q4="Geen map geselecteerd!",K4="De geselecteerde map bestaat niet!",W4="Het geselecteerde pad is geen map!",Z4="De geselecteerde map mist een pack.mcmeta bestand!",X4="De geselecteerde Resource Pack mist een assets map!",Y4="Resource Pack Zip",Q4="Het pad naar het .zip-bestand om het project naar te exporteren.",eB="Geen bestand geselecteerd!",tB="Het geselecteerde pad is geen bestand!",nB="Display Item Pad",iB="Waar het Weergave Voorwerp moet worden geplaatst. Dit moet een pad zijn naar een .json bestand in een Resource Pack.",rB="Geen bestand geselecteerd!",aB="Het geselecteerde bestand bestaat niet!",oB="Het geselecteerde pad is geen bestand!",sB="Model Map",lB="Waar alle ge\xEBxporteerde modellen moeten worden geplaatst. Dit moet een pad zijn naar een map in een Resource Pack.",cB="Geen map geselecteerd!",uB="De geselecteerde map bestaat niet!",dB="Het geselecteerde pad is geen map!",fB="Textuur Map",mB="Waar alle ge\xEBxporteerde texturen moeten worden geplaatst. Dit moet een pad zijn naar een map in een Resource Pack.",pB="Data Pack Instellingen",_B="Geavanceerde Instellingen Gebruiken",gB="Of de geavanceerde instellingen voor Data Packs wel of niet moeten worden ingeschakeld.",hB="Data Pack",bB="De hoofdmap van de Data Pack waarnaar het project moet worden ge\xEBxporteerd.",vB="Geen map geselecteerd!",yB="De geselecteerde map bestaat niet!",wB="Het geselecteerde pad is geen map!",xB="De geselecteerde map mist een pack.mcmeta bestand!",kB="De geselecteerde Data Pack mist een data map!",EB="Data Pack Zip",TB="Het pad naar het .zip-bestand om het project naar te exporteren.",CB="Geen bestand geselecteerd!",AB="Het geselecteerde pad is geen bestand!",SB="On-Summon Commando's",jB=`Commando's om uit te voeren als de hoofdentiteit wanneer deze wordt opgeroepen. +Behandel deze tekstinvoer als een .mcfunction-bestand. (Ondersteunt ook MC-Build syntaxis!)`,IB="Interpolatie Duratie",OB="De duur van de interpolatie tussen keyframes in ticks. Dit is de tijd die het model nodig heeft om over te gaan van de ene keyframe naar de volgende. Hogere waarden zorgen ervoor dat animaties precisie verliezen. Over het algemeen wil je dat dit een waarde van 1 of 2 heeft.",NB="Teleportatie Duratie",BB="De duur van de teleportatie tussen keyframes in ticks. Dit is de tijd waarover het model visueel zal interpoleren tussen zijn oude positie en zijn nieuwe positie. Hogere waarden zorgen ervoor dat animaties precisie verliezen.",RB="Opslag gebruiken voor animatie",DB=`Wel of geen NBT-opslag gebruiken om animatiegegevens op te slaan in plaats van functies. +Dit vermindert het aantal functies in het gegenereerde Data Pack enorm, maar is 42% langzamer dan de functiemethode.`,MB="Gebakken Animaties",FB=`De ge\xEBxporteerde animaties al dan niet bakken. Bij gebakken animaties worden de frames vooraf berekend en opgeslagen in het ge\xEBxporteerde JSON-bestand, waardoor het minder complex wordt om het model in de game te renderen. -Sommige Plugins vereisen dat dit is ingeschakeld om correct te functioneren.`,AN="JSON Bestand",SN="Het pad naar het JSON bestand om het project naar te exporteren.",jN="Geen bestand geselecteerd!",IN="Het geselecteerde pad is geen bestand!",ON="Bot Configuratie",NN="Geselecteerde Variant: {0}",BN="De onderstaande instellingen worden standaard toegepast op dit bot.",DN="De onderstaande instellingen worden alleen op dit bot toegepast wanneer deze variant wordt toegepast.",RN="Gebruik NBT",MN="Of NBT al dan niet moet worden gebruikt om de bot te configureren in plaats van instellingen.",FN="Als je NBT gebruikt, worden alle andere instellingen overschreven en zijn wijzigingen die je maakt niet zichtbaar in de editor. Gebruik dit alleen als je weet wat je doet!",LN="Instellingen Overnemen",PN="Of de instellingen wel of niet moeten worden overgenomen van het parent-bot.",VN="Gloeien",zN="Of het bot wel of niet moet gloeien in het spel.",UN="Overschrijf Gloed Kleur",GN="Of de standaard gloed kleur wel of niet moet worden overschreven.",JN="Gloed Kleur",HN="De kleur van de gloed.",$N="Schaduw Straal",KN="De straal van de schaduw.",qN="Schaduw Sterkte",WN="De sterkte van de schaduw.",ZN="Overschrijf Helderheid",XN="Of de standaard helderheid wel of niet moet worden overschreven.",YN="Helderheid",QN="De helderheid van het bot. Dit moet een waarde tussen 0 en 15 zijn.",eB="Betoverd",tB="Of het bot wel of niet betoverd moet worden.",nB="Onzichtbaar",iB="Of het bot wel of niet onzichtbaar moet worden.",rB="NBT",aB="De NBT die op het bot moet worden toegepast.",oB=`De NBT moet een compound tag zijn! Bijv. {CustomName:'"mijn naam"'}`,sB=`Ongeldige NBT! -{0}`,lB="Billboard",cB="Bepaalt of dit bot naar de speler moet draaien wanneer het wordt weergegeven. Het kan vast zijn (draait niet met de speler mee), verticaal (draait met de speler mee rond verticale as), horizontaal (draait rond horizontale as) en midden (draait rond middelpunt).",uB="Vast",dB="Verticaal",fB="Horizontaal",mB="Midden",pB="Locator Configuratie",_B=`Plugin-Modus is ingeschakeld! Locators hebben geen configuratie in Plugin-Modus. +Sommige Plugins vereisen dat dit is ingeschakeld om correct te functioneren.`,LB="JSON Bestand",PB="Het pad naar het JSON bestand om het project naar te exporteren.",VB="Geen bestand geselecteerd!",zB="Het geselecteerde pad is geen bestand!",GB="Bot Configuratie",UB="Geselecteerde Variant: {0}",JB="De onderstaande instellingen worden standaard toegepast op dit bot.",HB="De onderstaande instellingen worden alleen op dit bot toegepast wanneer deze variant wordt toegepast.",$B="Gebruik NBT",qB="Of NBT al dan niet moet worden gebruikt om de bot te configureren in plaats van instellingen.",KB="Als je NBT gebruikt, worden alle andere instellingen overschreven en zijn wijzigingen die je maakt niet zichtbaar in de editor. Gebruik dit alleen als je weet wat je doet!",WB="Instellingen Overnemen",ZB="Of de instellingen wel of niet moeten worden overgenomen van het parent-bot.",XB="Gloeien",YB="Of het bot wel of niet moet gloeien in het spel.",QB="Overschrijf Gloed Kleur",eR="Of de standaard gloed kleur wel of niet moet worden overschreven.",tR="Gloed Kleur",nR="De kleur van de gloed.",iR="Schaduw Straal",rR="De straal van de schaduw.",aR="Schaduw Sterkte",oR="De sterkte van de schaduw.",sR="Overschrijf Helderheid",lR="Of de standaard helderheid wel of niet moet worden overschreven.",cR="Helderheid",uR="De helderheid van het bot. Dit moet een waarde tussen 0 en 15 zijn.",dR="Betoverd",fR="Of het bot wel of niet betoverd moet worden.",mR="Onzichtbaar",pR="Of het bot wel of niet onzichtbaar moet worden.",_R="NBT",gR="De NBT die op het bot moet worden toegepast.",hR=`De NBT moet een compound tag zijn! Bijv. {CustomName:'"mijn naam"'}`,bR=`Ongeldige NBT! +{0}`,vR="Billboard",yR="Bepaalt of dit bot naar de speler moet draaien wanneer het wordt weergegeven. Het kan vast zijn (draait niet met de speler mee), verticaal (draait met de speler mee rond verticale as), horizontaal (draait rond horizontale as) en midden (draait rond middelpunt).",wR="Vast",xR="Verticaal",kR="Horizontaal",ER="Midden",TR="Locator Configuratie",CR=`Plugin-Modus is ingeschakeld! Locators hebben geen configuratie in Plugin-Modus. Gebruik in plaats daarvan de Plugin API om aangepaste functionaliteit aan je Locators toe te voegen. -Raadpleeg voor meer informatie de offici\xEBle Plugin API documentatie.`,gB="Gebruik Entiteit",hB="Of er al dan niet een entiteit aan de Locator moet worden gekoppeld.",bB="Type Entiteit",vB="Het type entiteit dat aan de Locator moet worden gekoppeld.",yB="Type Entiteit mag niet leeg zijn!",wB="Het geselecteerde entiteit-type bestaat niet in Minecraft {0}",xB="On-Summon Commando's",kB=`Commando's om als entiteit van de Locator uit te voeren wanneer deze wordt opgeroepen. -Behandel deze tekstinvoer als een .mcfunction-bestand. (Ondersteunt ook MC-Build syntaxis!)`,EB="Ticking Commands",TB=`Opdrachten om elke tick uit te voeren op de positie van de Locator. -Behandel deze tekstinvoer als een .mcfunction-bestand. (Ondersteunt ook MC-Build syntaxis!)`,CB="Tekstweergave Configuratie",AB="Vanilla Voorwerp Model",SB=`Als dit is ingesteld, wordt het bot weergegeven als een vanilla voorwerp model. -Hierdoor worden de bestaande kubussen van het bot overschreven.`,jB="Gebruik NBT",IB="Of NBT al dan niet moet worden gebruikt om de tekstweergave te configureren in plaats van instellingen.",OB="Als je NBT gebruikt, worden alle andere instellingen overschreven en zijn wijzigingen die je maakt niet zichtbaar in de editor. Gebruik dit alleen als je weet wat je doet!",NB="Instellingen Overnemen",BB="Of de instellingen wel of niet moeten worden overgenomen van de parent-tekstweergave.",DB="Gloeien",RB="Of het bot wel of niet moet gloeien in het spel.",MB="Overschrijf Gloed Kleur",FB="Of de standaard gloed kleur wel of niet moet worden overschreven.",LB="Gloed Kleur",PB="De kleur van de gloed.",VB="Schaduw Straal",zB="De straal van de schaduw.",UB="Schaduw Sterkte",GB="De sterke van de schaduw.",JB="Overschrijf Helderheid",HB="Of de standaard helderheid wel of niet moet worden overschreven.",$B="Helderheid",KB="De helderheid van het bot. Dit moet een waarde tussen 0 en 15 zijn.",qB="Onzichtbaar",WB="Of de tekstweergave wel of niet onzichtbaar moet worden.",ZB="NBT",XB="De NBT die op de tekstweergave moet worden toegepast.",YB="Billboard",QB="Bepaalt of dit bot naar de speler moet draaien wanneer het wordt weergegeven. Het kan vast zijn (draait niet met de speler mee), verticaal (draait met de speler mee rond verticale as), horizontaal (draait rond horizontale as) en midden (draait rond middelpunt).",eD="Vast",tD="Verticaal",nD="Horizontaal",iD="Midden",rD="Variant Configuratie",aD="Weergavenaam",oD="Wordt gebruikt om de variant te identificeren in de editor en in foutmeldingen.",sD="Genereer Naam uit Weergavenaam",lD="Of de Naam al dan niet automatisch moet worden gegenereerd uit de Weergavenaam.",cD="Naam",uD="Wordt gebruikt om de variant in de ge\xEBxporteerde Resource Pack en Data Pack te identificeren.",dD="Textuur Map",fD="Een map van welke texturen moeten worden verwisseld bij het toepassen van deze variant.",mD="Nieuwe Mapping Maken",pD="Variant heeft geen in kaart gebrachte texturen.",_D="Een lijst met nodes die wel of niet worden meegenomen in de Variant. Alleen nodes in de ge\xEFncludeerde lijst worden gewijzigd door de Variant, en nodes in de uitgesloten lijst worden genegeerd.",gD="Uitgelosten Nodes",hD="Een lijst met nodes die uitgesloten moeten worden van de Variant. Deze nodes worden niet gewijzigd door de Variant.",bD="Inbegrepen Nodes",vD="Een lijst met nodes die in de Variant moeten worden opgenomen. Alleen deze nodes worden gewijzigd door de Variant.",yD="Lijsten Omwisselen",wD="Update .ajmodel",xD="Update .ajmodel",kD="Selecteeer .ajmodel Bestand",ED="Upgrade je verouderde .ajmodel bestanden naar het nieuwe .ajblueprint formaat.",TD="Selecteer een .ajmodel Bestand om te upgraden",CD="Animatie Eigenschappen ({0})",AD="Animatie Naam",SD="De naam van de animatie.",jD="Lus Modus",ID="Bepaalt hoe de animatie moet worden herhaald. Eenmaal - De animatie wordt eenmaal afgespeeld en stopt dan. Houden - De animatie wordt eenmaal afgespeeld en het laatste frame wordt vastgehouden. Lus - De animatie wordt oneindig herhaald.",OD="Eenmaal",ND="Houden",BD="Lus",DD="De naam van de animatie kan niet leeg zijn!",RD="De naam van de animatie bevat ongeldige tekens! Animatie namen mogen alleen letters, cijfers, underscores en punten bevatten.",MD="Lus Vertraging",FD="De vertraging tussen lussen. Dit is de tijd dat de animatie pauzeert voor hij opnieuw begint. Dit wordt alleen gebruikt als de Lus Modus is ingesteld op Lus.",LD="Een lijst van nodes die wel of niet worden meegenomen in de animatie. Alleen nodes in de lijst met inbegrepen nodes worden gewijzigd door de animatie, nodes in de lijst met uitgesloten nodes worden genegeerd.",PD="Uitgesloten Nodes",VD="Een lijst van nodes die uitgesloten moeten worden van de animatie. Deze nodes worden niet gewijzigd door de animatie.",zD="Inbegrepen Nodes",UD="Een lijst van nodes die in de animatie moeten worden opgenomen. Alleen deze nodes worden gewijzigd door de animatie.",GD="Lijsten Omwisselen",JD="Exporteren...",HD="Varianten",$D="Nieuwe Variant Maken",KD="Variant Bewerken",qD="Geselecteerde Variant Dupliceren",WD="Geselecteerde Variant Verwijderen",ZD="Variant Geselecteerd",XD="Variant Niet Geselecteerd",YD="Kan de standaard variant niet verwijderen!",QD="Variant Maken",e8="Variant Dupliceren",t8="Open Variant Configuratie",n8="Variant Verwijderen",i8="Uitgesloten Nodes",r8="Uitgesloten Nodes Inverteren",a8="Variant",o8="Commando's",s8="Variant",l8="Commando's",c8="Uitvoer Voorwaarde",u8="Keyframe ({0})",d8="Variant",f8="De Variant die moet worden toegepast op de keyframe.",m8="Commando's",p8=`Commando's die worden uitgevoerd wanneer de keyframe is bereikt. -Behandel deze tekstinvoer als een .mcfunction-bestand. (Ondersteunt ook MC-Build syntaxis!)`,_8="Uitvoer Voorwaarde",g8="Een voorwaarde waaraan moet worden voldaan om het keyframe uit te voeren. Behandel deze tekstinvoer als een sub-commando van een execute command.",h8="Herhalen?",b8=`Of de commando's in dit keyframe al dan niet herhaaldelijk moeten worden uitgevoerd. -Als deze optie is ingeschakeld, worden de commando's elke Herhaal Frequentie ticks uitgevoerd.`,v8="Herhaal Frequentie",y8=`Hoeveel ticks er moeten worden gewacht voordat de commando's in dit keyframe opnieuw worden uitgevoerd. +Raadpleeg voor meer informatie de offici\xEBle Plugin API documentatie.`,AR="Gebruik Entiteit",SR="Of er al dan niet een entiteit aan de Locator moet worden gekoppeld.",jR="Type Entiteit",IR="Het type entiteit dat aan de Locator moet worden gekoppeld.",OR="Type Entiteit mag niet leeg zijn!",NR="Het geselecteerde entiteit-type bestaat niet in Minecraft {0}",BR="On-Summon Commando's",RR=`Commando's om als entiteit van de Locator uit te voeren wanneer deze wordt opgeroepen. +Behandel deze tekstinvoer als een .mcfunction-bestand. (Ondersteunt ook MC-Build syntaxis!)`,DR="Ticking Commands",MR=`Opdrachten om elke tick uit te voeren op de positie van de Locator. +Behandel deze tekstinvoer als een .mcfunction-bestand. (Ondersteunt ook MC-Build syntaxis!)`,FR="Tekstweergave Configuratie",LR="Vanilla Voorwerp Model",PR=`Als dit is ingesteld, wordt het bot weergegeven als een vanilla voorwerp model. +Hierdoor worden de bestaande kubussen van het bot overschreven.`,VR="Gebruik NBT",zR="Of NBT al dan niet moet worden gebruikt om de tekstweergave te configureren in plaats van instellingen.",GR="Als je NBT gebruikt, worden alle andere instellingen overschreven en zijn wijzigingen die je maakt niet zichtbaar in de editor. Gebruik dit alleen als je weet wat je doet!",UR="Instellingen Overnemen",JR="Of de instellingen wel of niet moeten worden overgenomen van de parent-tekstweergave.",HR="Gloeien",$R="Of het bot wel of niet moet gloeien in het spel.",qR="Overschrijf Gloed Kleur",KR="Of de standaard gloed kleur wel of niet moet worden overschreven.",WR="Gloed Kleur",ZR="De kleur van de gloed.",XR="Schaduw Straal",YR="De straal van de schaduw.",QR="Schaduw Sterkte",eD="De sterke van de schaduw.",tD="Overschrijf Helderheid",nD="Of de standaard helderheid wel of niet moet worden overschreven.",iD="Helderheid",rD="De helderheid van het bot. Dit moet een waarde tussen 0 en 15 zijn.",aD="Onzichtbaar",oD="Of de tekstweergave wel of niet onzichtbaar moet worden.",sD="NBT",lD="De NBT die op de tekstweergave moet worden toegepast.",cD="Billboard",uD="Bepaalt of dit bot naar de speler moet draaien wanneer het wordt weergegeven. Het kan vast zijn (draait niet met de speler mee), verticaal (draait met de speler mee rond verticale as), horizontaal (draait rond horizontale as) en midden (draait rond middelpunt).",dD="Vast",fD="Verticaal",mD="Horizontaal",pD="Midden",_D="Variant Configuratie",gD="Weergavenaam",hD="Wordt gebruikt om de variant te identificeren in de editor en in foutmeldingen.",bD="Genereer Naam uit Weergavenaam",vD="Of de Naam al dan niet automatisch moet worden gegenereerd uit de Weergavenaam.",yD="Naam",wD="Wordt gebruikt om de variant in de ge\xEBxporteerde Resource Pack en Data Pack te identificeren.",xD="Textuur Map",kD="Een map van welke texturen moeten worden verwisseld bij het toepassen van deze variant.",ED="Nieuwe Mapping Maken",TD="Variant heeft geen in kaart gebrachte texturen.",CD="Een lijst met nodes die wel of niet worden meegenomen in de Variant. Alleen nodes in de ge\xEFncludeerde lijst worden gewijzigd door de Variant, en nodes in de uitgesloten lijst worden genegeerd.",AD="Uitgelosten Nodes",SD="Een lijst met nodes die uitgesloten moeten worden van de Variant. Deze nodes worden niet gewijzigd door de Variant.",jD="Inbegrepen Nodes",ID="Een lijst met nodes die in de Variant moeten worden opgenomen. Alleen deze nodes worden gewijzigd door de Variant.",OD="Lijsten Omwisselen",ND="Update .ajmodel",BD="Update .ajmodel",RD="Selecteeer .ajmodel Bestand",DD="Upgrade je verouderde .ajmodel bestanden naar het nieuwe .ajblueprint formaat.",MD="Selecteer een .ajmodel Bestand om te upgraden",FD="Animatie Eigenschappen ({0})",LD="Animatie Naam",PD="De naam van de animatie.",VD="Lus Modus",zD="Bepaalt hoe de animatie moet worden herhaald. Eenmaal - De animatie wordt eenmaal afgespeeld en stopt dan. Houden - De animatie wordt eenmaal afgespeeld en het laatste frame wordt vastgehouden. Lus - De animatie wordt oneindig herhaald.",GD="Eenmaal",UD="Houden",JD="Lus",HD="De naam van de animatie kan niet leeg zijn!",$D="De naam van de animatie bevat ongeldige tekens! Animatie namen mogen alleen letters, cijfers, underscores en punten bevatten.",qD="Lus Vertraging",KD="De vertraging tussen lussen. Dit is de tijd dat de animatie pauzeert voor hij opnieuw begint. Dit wordt alleen gebruikt als de Lus Modus is ingesteld op Lus.",WD="Een lijst van nodes die wel of niet worden meegenomen in de animatie. Alleen nodes in de lijst met inbegrepen nodes worden gewijzigd door de animatie, nodes in de lijst met uitgesloten nodes worden genegeerd.",ZD="Uitgesloten Nodes",XD="Een lijst van nodes die uitgesloten moeten worden van de animatie. Deze nodes worden niet gewijzigd door de animatie.",YD="Inbegrepen Nodes",QD="Een lijst van nodes die in de animatie moeten worden opgenomen. Alleen deze nodes worden gewijzigd door de animatie.",e8="Lijsten Omwisselen",t8="Exporteren...",n8="Varianten",i8="Nieuwe Variant Maken",r8="Variant Bewerken",a8="Geselecteerde Variant Dupliceren",o8="Geselecteerde Variant Verwijderen",s8="Variant Geselecteerd",l8="Variant Niet Geselecteerd",c8="Kan de standaard variant niet verwijderen!",u8="Variant Maken",d8="Variant Dupliceren",f8="Open Variant Configuratie",m8="Variant Verwijderen",p8="Uitgesloten Nodes",_8="Uitgesloten Nodes Inverteren",g8="Variant",h8="Commando's",b8="Variant",v8="Commando's",y8="Uitvoer Voorwaarde",w8="Keyframe ({0})",x8="Variant",k8="De Variant die moet worden toegepast op de keyframe.",E8="Commando's",T8=`Commando's die worden uitgevoerd wanneer de keyframe is bereikt. +Behandel deze tekstinvoer als een .mcfunction-bestand. (Ondersteunt ook MC-Build syntaxis!)`,C8="Uitvoer Voorwaarde",A8="Een voorwaarde waaraan moet worden voldaan om het keyframe uit te voeren. Behandel deze tekstinvoer als een sub-commando van een execute command.",S8="Herhalen?",j8=`Of de commando's in dit keyframe al dan niet herhaaldelijk moeten worden uitgevoerd. +Als deze optie is ingeschakeld, worden de commando's elke Herhaal Frequentie ticks uitgevoerd.`,I8="Herhaal Frequentie",O8=`Hoeveel ticks er moeten worden gewacht voordat de commando's in dit keyframe opnieuw worden uitgevoerd. Als je dit instelt op 1, worden de commando's elke tik uitgevoerd. OPMERKING: Als de animatie niet gelijkmatig deelbaar is door deze waarde, kan het interval enigszins afwijken wanneer de animatie in een lus loopt. -Als dit is ingesteld op een waarde groter dan de lengte van de animatie, zullen de commando's worden uitgevoerd alsof herhalen is uitgeschakeld (Zodra het keyframe is bereikt).`,w8="Versoepeling Type",x8="Het type versoepeling dat moet worden toegepast op het keyframe.",k8="Linear",E8="Sine",T8="Quad",C8="Cubic",A8="Quart",S8="Quint",j8="Expo",I8="Circ",O8="Elastic",N8="Back",B8="Bounce",D8="Versoepling Modus",R8="De versoepelingsmodus die moet worden toegepast op het keyframe.",M8="In",F8="Out",L8="In-Out",P8="Versoepeling Argumenten",V8="De argumenten die moeten worden toegepast op de versoepelings functie.",z8="Elasticiteit",U8="De elasticiteit van de versoepelings functie.",G8="Overschrijding",J8="De hoeveelheid overschrijding die moet worden toegepast op de versoepelings functie.",H8="Stuiterigheid",$8="De stuiterigheid van de versoepelings functie.",K8="Tekstweergave",q8="Lijnbreedte",W8="De breedte van de tekstweergave in pixels.",Z8="Achtergrond Kleur",X8="De kleur van de achtergrond van de tekstweergave.",Y8="Tekst Schaduw",Q8="Wel of geen schaduw achter de tekst weergeven.",eR="Uitlijning Van Tekst",tR="De uitlijning van de tekst.",nR="Links",iR="Midden",rR="Rechts",aR="Weergegeven Voorwerp",oR="Het voorwerp dat moet worden weergegeven.",sR="Weergegeven Blok.",lR="Het blok dat moet worden weergegeven. Ondersteunt block states!",cR="Vanilla Voorwerpweergave",uR="Exporteren Mislukt",dR="Je hebt resource pack exporteren uitgeschakeld, maar je hebt aangepaste modellen in je project! Schakel resource pack exporteren in of verwijder de aangepaste modellen voordat je exporteert.",fR="Er zitten fouten in je blauwdruk instellingen! Herstel deze voordat je exporteert.",mR="Een probleem gevonden met {0}:",pR="Ok",_R="Animated Java",gR="Mob hoofden worden niet weergegeven in Blokweergaves. Gebruik in plaats daarvan een Voorwerpweergave.",hR="Blauwdruk export pad bestaat niet",bR=`Het exportpad '{0}' bestaat niet! -Controleer of de map waarin je opslaat bestaat en probeer het opnieuw.`,vR={"animated_java.action.open_blueprint_settings.name":xO,"animated_java.action.open_documentation.name":kO,"animated_java.action.open_about.name":EO,"animated_java.action.open_bone_config.name":TO,"animated_java.action.open_locator_config.name":CO,"animated_java.action.open_text_display_config.name":AO,"animated_java.action.export.name":SO,"animated_java.action.create_text_display.title":jO,"animated_java.action.create_vanilla_item_display.title":IO,"animated_java.action.create_vanilla_block_display.title":OO,"animated_java.action.open_vanilla_item_display_config.name":NO,"animated_java.action.open_vanilla_block_display_config.name":BO,"animated_java.popup.loading.loading":DO,"animated_java.popup.loading.success":RO,"animated_java.popup.loading.offline":MO,"animated_java.dialog.about.title":FO,"animated_java.dialog.about.close_button":LO,"animated_java.dialog.unexpected_error.title":PO,"animated_java.dialog.unexpected_error.close_button":VO,"animated_java.dialog.unexpected_error.copy_error_message_button.message":zO,"animated_java.dialog.unexpected_error.copy_error_message_button.description":UO,"animated_java.dialog.unexpected_error.paragraph":GO,"animated_java.dialog.blueprint_settings.title":JO,"animated_java.dialog.blueprint_settings.advanced_settings_warning":HO,"animated_java.dialog.blueprint_settings.blueprint_name.title":$O,"animated_java.dialog.blueprint_settings.blueprint_name.description":KO,"animated_java.dialog.blueprint_settings.texture_size.title":qO,"animated_java.dialog.blueprint_settings.texture_size.description":WO,"animated_java.dialog.blueprint_settings.texture_size.warning.not_square":ZO,"animated_java.dialog.blueprint_settings.texture_size.warning.not_a_power_of_2":XO,"animated_java.dialog.blueprint_settings.texture_size.warning.does_not_match_largest_texture":YO,"animated_java.dialog.blueprint_settings.export_settings.title":QO,"animated_java.dialog.blueprint_settings.export_namespace.title":e4,"animated_java.dialog.blueprint_settings.export_namespace.description":t4,"animated_java.dialog.blueprint_settings.export_namespace.error.empty":n4,"animated_java.dialog.blueprint_settings.export_namespace.error.reserved":i4,"animated_java.dialog.blueprint_settings.export_namespace.error.invalid_characters":r4,"animated_java.dialog.blueprint_settings.enable_plugin_mode.title":a4,"animated_java.dialog.blueprint_settings.enable_plugin_mode.description":o4,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.title":s4,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.description":l4,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.raw":c4,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.zip":u4,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.none":d4,"animated_java.dialog.blueprint_settings.data_pack_export_mode.title":f4,"animated_java.dialog.blueprint_settings.data_pack_export_mode.description":m4,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.raw":p4,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.zip":_4,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.none":g4,"animated_java.dialog.blueprint_settings.show_bounding_box.title":h4,"animated_java.dialog.blueprint_settings.show_bounding_box.description":b4,"animated_java.dialog.blueprint_settings.auto_bounding_box.title":v4,"animated_java.dialog.blueprint_settings.auto_bounding_box.description":y4,"animated_java.dialog.blueprint_settings.bounding_box.title":w4,"animated_java.dialog.blueprint_settings.bounding_box.description":x4,"animated_java.dialog.blueprint_settings.resource_pack_settings.title":k4,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_settings.title":E4,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_settings.description":T4,"animated_java.dialog.blueprint_settings.display_item.title":C4,"animated_java.dialog.blueprint_settings.display_item.description":A4,"animated_java.dialog.blueprint_settings.display_item.error.no_item_selected":S4,"animated_java.dialog.blueprint_settings.display_item.error.invalid_item_id.no_namespace":j4,"animated_java.dialog.blueprint_settings.display_item.error.invalid_item_id.whitespace":I4,"animated_java.dialog.blueprint_settings.display_item.warning.item_does_not_exist":O4,"animated_java.dialog.blueprint_settings.custom_model_data_offset.title":N4,"animated_java.dialog.blueprint_settings.custom_model_data_offset.description":B4,"animated_java.dialog.blueprint_settings.resource_pack.title":D4,"animated_java.dialog.blueprint_settings.resource_pack.description":R4,"animated_java.dialog.blueprint_settings.resource_pack.error.no_folder_selected":M4,"animated_java.dialog.blueprint_settings.resource_pack.error.folder_does_not_exist":F4,"animated_java.dialog.blueprint_settings.resource_pack.error.not_a_folder":L4,"animated_java.dialog.blueprint_settings.resource_pack.error.missing_pack_mcmeta":P4,"animated_java.dialog.blueprint_settings.resource_pack.error.missing_assets_folder":V4,"animated_java.dialog.blueprint_settings.resource_pack_zip.title":z4,"animated_java.dialog.blueprint_settings.resource_pack_zip.description":U4,"animated_java.dialog.blueprint_settings.resource_pack_zip.error.no_file_selected":G4,"animated_java.dialog.blueprint_settings.resource_pack_zip.error.not_a_file":J4,"animated_java.dialog.blueprint_settings.display_item_path.title":H4,"animated_java.dialog.blueprint_settings.display_item_path.description":$4,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.no_file_selected":K4,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.file_does_not_exist":q4,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.not_a_file":W4,"animated_java.dialog.blueprint_settings.model_folder.title":Z4,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.description":X4,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.no_folder_selected":Y4,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.folder_does_not_exist":Q4,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.not_a_folder":eN,"animated_java.dialog.blueprint_settings.texture_folder.title":tN,"animated_java.dialog.blueprint_settings.texture_folder.description":nN,"animated_java.dialog.blueprint_settings.data_pack_settings.title":iN,"animated_java.dialog.blueprint_settings.enable_advanced_data_pack_settings.title":rN,"animated_java.dialog.blueprint_settings.enable_advanced_data_pack_settings.description":aN,"animated_java.dialog.blueprint_settings.data_pack.title":oN,"animated_java.dialog.blueprint_settings.data_pack.description":sN,"animated_java.dialog.blueprint_settings.data_pack.error.no_folder_selected":lN,"animated_java.dialog.blueprint_settings.data_pack.error.folder_does_not_exist":cN,"animated_java.dialog.blueprint_settings.data_pack.error.not_a_folder":uN,"animated_java.dialog.blueprint_settings.data_pack.error.missing_pack_mcmeta":dN,"animated_java.dialog.blueprint_settings.data_pack.error.missing_data_folder":fN,"animated_java.dialog.blueprint_settings.data_pack_zip.title":mN,"animated_java.dialog.blueprint_settings.data_pack_zip.description":pN,"animated_java.dialog.blueprint_settings.data_pack_zip.error.no_file_selected":_N,"animated_java.dialog.blueprint_settings.data_pack_zip.error.not_a_file":gN,"animated_java.dialog.blueprint_settings.summon_commands.title":hN,"animated_java.dialog.blueprint_settings.summon_commands.description":bN,"animated_java.dialog.blueprint_settings.interpolation_duration.title":vN,"animated_java.dialog.blueprint_settings.interpolation_duration.description":yN,"animated_java.dialog.blueprint_settings.teleportation_duration.title":wN,"animated_java.dialog.blueprint_settings.teleportation_duration.description":xN,"animated_java.dialog.blueprint_settings.use_storage_for_animation.title":kN,"animated_java.dialog.blueprint_settings.use_storage_for_animation.description":EN,"animated_java.dialog.blueprint_settings.baked_animations.title":TN,"animated_java.dialog.blueprint_settings.baked_animations.description":CN,"animated_java.dialog.blueprint_settings.json_file.title":AN,"animated_java.dialog.blueprint_settings.json_file.description":SN,"animated_java.dialog.blueprint_settings.json_file.error.no_file_selected":jN,"animated_java.dialog.blueprint_settings.json_file.error.not_a_file":IN,"animated_java.dialog.bone_config.title":ON,"animated_java.dialog.bone_config.selected_variant":NN,"animated_java.dialog.bone_config.default_variant_subtitle":BN,"animated_java.dialog.bone_config.selected_variant_subtitle":DN,"animated_java.dialog.bone_config.use_nbt.title":RN,"animated_java.dialog.bone_config.use_nbt.description":MN,"animated_java.dialog.bone_config.use_nbt.use_nbt_warning":FN,"animated_java.dialog.bone_config.inherit_settings.title":LN,"animated_java.dialog.bone_config.inherit_settings.description":PN,"animated_java.dialog.bone_config.glowing.title":VN,"animated_java.dialog.bone_config.glowing.description":zN,"animated_java.dialog.bone_config.override_glow_color.title":UN,"animated_java.dialog.bone_config.override_glow_color.description":GN,"animated_java.dialog.bone_config.glow_color.title":JN,"animated_java.dialog.bone_config.glow_color.description":HN,"animated_java.dialog.bone_config.shadow_radius.title":$N,"animated_java.dialog.bone_config.shadow_radius.description":KN,"animated_java.dialog.bone_config.shadow_strength.title":qN,"animated_java.dialog.bone_config.shadow_strength.description":WN,"animated_java.dialog.bone_config.override_brightness.title":ZN,"animated_java.dialog.bone_config.override_brightness.description":XN,"animated_java.dialog.bone_config.brightness_override.title":YN,"animated_java.dialog.bone_config.brightness_override.description":QN,"animated_java.dialog.bone_config.enchanted.title":eB,"animated_java.dialog.bone_config.enchanted.description":tB,"animated_java.dialog.bone_config.invisible.title":nB,"animated_java.dialog.bone_config.invisible.description":iB,"animated_java.dialog.bone_config.nbt.title":rB,"animated_java.dialog.bone_config.nbt.description":aB,"animated_java.dialog.bone_config.nbt.invalid_nbt.not_compound":oB,"animated_java.dialog.bone_config.nbt.invalid_nbt.error":sB,"animated_java.dialog.bone_config.billboard.title":lB,"animated_java.dialog.bone_config.billboard.description":cB,"animated_java.dialog.bone_config.billboard.options.fixed":uB,"animated_java.dialog.bone_config.billboard.options.vertical":dB,"animated_java.dialog.bone_config.billboard.options.horizontal":fB,"animated_java.dialog.bone_config.billboard.options.center":mB,"animated_java.dialog.locator_config.title":pB,"animated_java.dialog.locator_config.plugin_mode_warning":_B,"animated_java.dialog.locator_config.use_entity.title":gB,"animated_java.dialog.locator_config.use_entity.description":hB,"animated_java.dialog.locator_config.entity_type.title":bB,"animated_java.dialog.locator_config.entity_type.description":vB,"animated_java.dialog.locator_config.entity_type.error.empty":yB,"animated_java.dialog.locator_config.entity_type.warning.invalid":wB,"animated_java.dialog.locator_config.summon_commands.title":xB,"animated_java.dialog.locator_config.summon_commands.description":kB,"animated_java.dialog.locator_config.ticking_commands.title":EB,"animated_java.dialog.locator_config.ticking_commands.description":TB,"animated_java.dialog.text_display_config.title":CB,"animated_java.dialog.bone_config.vanilla_item_model.title":AB,"animated_java.dialog.bone_config.vanilla_item_model.description":SB,"animated_java.dialog.text_display_config.use_nbt.title":jB,"animated_java.dialog.text_display_config.use_nbt.description":IB,"animated_java.dialog.text_display_config.use_nbt.use_nbt_warning":OB,"animated_java.dialog.text_display_config.inherit_settings.title":NB,"animated_java.dialog.text_display_config.inherit_settings.description":BB,"animated_java.dialog.text_display_config.glowing.title":DB,"animated_java.dialog.text_display_config.glowing.description":RB,"animated_java.dialog.text_display_config.override_glow_color.title":MB,"animated_java.dialog.text_display_config.override_glow_color.description":FB,"animated_java.dialog.text_display_config.glow_color.title":LB,"animated_java.dialog.text_display_config.glow_color.description":PB,"animated_java.dialog.text_display_config.shadow_radius.title":VB,"animated_java.dialog.text_display_config.shadow_radius.description":zB,"animated_java.dialog.text_display_config.shadow_strength.title":UB,"animated_java.dialog.text_display_config.shadow_strength.description":GB,"animated_java.dialog.text_display_config.override_brightness.title":JB,"animated_java.dialog.text_display_config.override_brightness.description":HB,"animated_java.dialog.text_display_config.brightness_override.title":$B,"animated_java.dialog.text_display_config.brightness_override.description":KB,"animated_java.dialog.text_display_config.invisible.title":qB,"animated_java.dialog.text_display_config.invisible.description":WB,"animated_java.dialog.text_display_config.nbt.title":ZB,"animated_java.dialog.text_display_config.nbt.description":XB,"animated_java.dialog.text_display_config.billboard.title":YB,"animated_java.dialog.text_display_config.billboard.description":QB,"animated_java.dialog.text_display_config.billboard.options.fixed":eD,"animated_java.dialog.text_display_config.billboard.options.vertical":tD,"animated_java.dialog.text_display_config.billboard.options.horizontal":nD,"animated_java.dialog.text_display_config.billboard.options.center":iD,"animated_java.dialog.variant_config.title":rD,"animated_java.dialog.variant_config.variant_display_name":aD,"animated_java.dialog.variant_config.variant_display_name.description":oD,"animated_java.dialog.variant_config.generate_name_from_display_name":sD,"animated_java.dialog.variant_config.generate_name_from_display_name.description":lD,"animated_java.dialog.variant_config.variant_name":cD,"animated_java.dialog.variant_config.variant_name.description":uD,"animated_java.dialog.variant_config.texture_map.title":dD,"animated_java.dialog.variant_config.texture_map.description":fD,"animated_java.dialog.variant_config.texture_map.create_new_mapping":mD,"animated_java.dialog.variant_config.texture_map.no_mappings":pD,"animated_java.dialog.variant_config.bone_lists.description":_D,"animated_java.dialog.variant_config.excluded_nodes.title":gD,"animated_java.dialog.variant_config.excluded_nodes.description":hD,"animated_java.dialog.variant_config.included_nodes.title":bD,"animated_java.dialog.variant_config.included_nodes.description":vD,"animated_java.dialog.variant_config.swap_columns_button.tooltip":yD,"animated_java.action.upgrade_old_aj_model_loader.name":wD,"animated_java.dialog.upgrade_old_aj_model_loader.title":xD,"animated_java.action.upgrade_old_aj_model_loader.select_file":kD,"animated_java.action.upgrade_old_aj_model_loader.body":ED,"animated_java.action.upgrade_old_aj_model_loader.button":TD,"animated_java.dialog.animation_properties.title":CD,"animated_java.dialog.animation_properties.animation_name.title":AD,"animated_java.dialog.animation_properties.animation_name.description":SD,"animated_java.dialog.animation_properties.loop_mode.title":jD,"animated_java.dialog.animation_properties.loop_mode.description":ID,"animated_java.dialog.animation_properties.loop_mode.options.once":OD,"animated_java.dialog.animation_properties.loop_mode.options.hold":ND,"animated_java.dialog.animation_properties.loop_mode.options.loop":BD,"animated_java.dialog.animation_properties.animation_name.error.empty":DD,"animated_java.dialog.animation_properties.animation_name.error.invalid_characters":RD,"animated_java.dialog.animation_properties.loop_delay.title":MD,"animated_java.dialog.animation_properties.loop_delay.description":FD,"animated_java.dialog.animation_properties.bone_lists.description":LD,"animated_java.dialog.animation_properties.excluded_nodes.title":PD,"animated_java.dialog.animation_properties.excluded_nodes.description":VD,"animated_java.dialog.animation_properties.included_nodes.title":zD,"animated_java.dialog.animation_properties.included_nodes.description":UD,"animated_java.dialog.animation_properties.swap_columns_button.tooltip":GD,"animated_java.dialog.export_progress.title":JD,"animated_java.panel.variants.title":HD,"animated_java.panel.variants.tool.create_new_variant":$D,"animated_java.panel.variants.tool.edit_variant":KD,"animated_java.panel.variants.tool.duplicate_selected_variant":qD,"animated_java.panel.variants.tool.delete_selected_variant":WD,"animated_java.panel.variants.tool.variant_visible":ZD,"animated_java.panel.variants.tool.variant_not_visible":XD,"animated_java.panel.variants.tool.cannot_delete_default_variant":YD,"animated_java.action.variants.create":QD,"animated_java.action.variants.duplicate":e8,"animated_java.action.variants.open_config":t8,"animated_java.action.variants.delete":n8,"animated_java.animation.excluded_nodes":i8,"animated_java.animation.invert_excluded_nodes":r8,"animated_java.effect_animator.timeline.variant":a8,"animated_java.effect_animator.timeline.commands":o8,"animated_java.effect_animator.keyframes.variant":s8,"animated_java.effect_animator.keyframes.commands":l8,"animated_java.effect_animator.keyframes.execute_condition":c8,"animated_java.panel.keyframe.keyframe_title":u8,"animated_java.panel.keyframe.variant.title":d8,"animated_java.panel.keyframe.variant.description":f8,"animated_java.panel.keyframe.commands.title":m8,"animated_java.panel.keyframe.commands.description":p8,"animated_java.panel.keyframe.execute_condition.title":_8,"animated_java.panel.keyframe.execute_condition.description":g8,"animated_java.panel.keyframe.repeat.title":h8,"animated_java.panel.keyframe.repeat.description":b8,"animated_java.panel.keyframe.repeat_frequency.title":v8,"animated_java.panel.keyframe.repeat_frequency.description":y8,"animated_java.panel.keyframe.easing_type.title":w8,"animated_java.panel.keyframe.easing_type.description":x8,"animated_java.panel.keyframe.easing_type.options.linear":k8,"animated_java.panel.keyframe.easing_type.options.sine":E8,"animated_java.panel.keyframe.easing_type.options.quad":T8,"animated_java.panel.keyframe.easing_type.options.cubic":C8,"animated_java.panel.keyframe.easing_type.options.quart":A8,"animated_java.panel.keyframe.easing_type.options.quint":S8,"animated_java.panel.keyframe.easing_type.options.expo":j8,"animated_java.panel.keyframe.easing_type.options.circ":I8,"animated_java.panel.keyframe.easing_type.options.elastic":O8,"animated_java.panel.keyframe.easing_type.options.back":N8,"animated_java.panel.keyframe.easing_type.options.bounce":B8,"animated_java.panel.keyframe.easing_mode.title":D8,"animated_java.panel.keyframe.easing_mode.description":R8,"animated_java.panel.keyframe.easing_mode.options.in":M8,"animated_java.panel.keyframe.easing_mode.options.out":F8,"animated_java.panel.keyframe.easing_mode.options.inout":L8,"animated_java.panel.keyframe.easing_args.title":P8,"animated_java.panel.keyframe.easing_args.description":V8,"animated_java.panel.keyframe.easing_args.easing_arg.elastic.title":z8,"animated_java.panel.keyframe.easing_args.easing_arg.elastic.description":U8,"animated_java.panel.keyframe.easing_args.easing_arg.back.title":G8,"animated_java.panel.keyframe.easing_args.easing_arg.back.description":J8,"animated_java.panel.keyframe.easing_args.easing_arg.bounce.title":H8,"animated_java.panel.keyframe.easing_args.easing_arg.bounce.description":$8,"animated_java.panel.text_display.title":K8,"animated_java.tool.text_display.line_width.title":q8,"animated_java.tool.text_display.line_width.description":W8,"animated_java.tool.text_display.background_color.title":Z8,"animated_java.tool.text_display.background_color.description":X8,"animated_java.tool.text_display.text_shadow.title":Y8,"animated_java.tool.text_display.text_shadow.description":Q8,"animated_java.tool.text_display.text_alignment.title":eR,"animated_java.tool.text_display.text_alignment.description":tR,"animated_java.tool.text_display.text_alignment.options.left":nR,"animated_java.tool.text_display.text_alignment.options.center":iR,"animated_java.tool.text_display.text_alignment.options.right":rR,"animated_java.panel.vanilla_item_display.title":aR,"animated_java.panel.vanilla_item_display.description":oR,"animated_java.panel.vanilla_block_display.title":sR,"animated_java.panel.vanilla_block_display.description":lR,"animated_java.vanilla_item_display.title":cR,"animated_java.misc.failed_to_export.title":uR,"animated_java.misc.failed_to_export.custom_models.message":dR,"animated_java.misc.failed_to_export.blueprint_settings.message":fR,"animated_java.misc.failed_to_export.blueprint_settings.error_item":mR,"animated_java.misc.failed_to_export.button":pR,"animated_java.format_category.animated_java":_R,"animated_java.block_model_manager.mob_head_warning":gR,"animated_java.error.blueprint_export_path_doesnt_exist.title":hR,"animated_java.error.blueprint_export_path_doesnt_exist.description":bR};var yR=[Kd,qd,Wd],C_=yR,A_=["../lang/de.yml","../lang/en.yml","../lang/nl.yml"];var S_=A_.map(n=>PathModule.basename(n,".yml"));function w(n,...e){let t=S_.indexOf(settings.language.value);t===-1&&(console.warn(`Could not find language '${settings.language.value}'`),t=S_.indexOf("en"));let i=C_[t];n.startsWith("animated_java.")||(n=`animated_java.${n}`);let r=i[n];return r?r.replace(/\{(\d+)\}/g,(a,o)=>e[o]||""):(console.warn(`Could not find translation for '${n}'`),n)}s(w,"translate");Language.data["format_category.animated_java"]=w("format_category.animated_java");function re(){}s(re,"noop");var Is=s(n=>n,"identity");function O_(n,e){for(let t in e)n[t]=e[t];return n}s(O_,"assign");function ef(n){return n()}s(ef,"run");function j_(){return Object.create(null)}s(j_,"blank_object");function At(n){n.forEach(ef)}s(At,"run_all");function Vn(n){return typeof n=="function"}s(Vn,"is_function");function Ae(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}s(Ae,"safe_not_equal");var ac;function $t(n,e){return ac||(ac=document.createElement("a")),ac.href=e,n===ac.href}s($t,"src_url_equal");function N_(n){return Object.keys(n).length===0}s(N_,"is_empty");function ze(n,...e){if(n==null)return re;let t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}s(ze,"subscribe");function tf(n){let e;return ze(n,t=>e=t)(),e}s(tf,"get_store_value");function _o(n,e,t){n.$$.on_destroy.push(ze(e,t))}s(_o,"component_subscribe");function B_(n,e,t,i){if(n){let r=D_(n,e,t,i);return n[0](r)}}s(B_,"create_slot");function D_(n,e,t,i){return n[1]&&i?O_(t.ctx.slice(),n[1](i(e))):t.ctx}s(D_,"get_slot_context");function R_(n,e,t,i){if(n[2]&&i){let r=n[2](i(t));if(e.dirty===void 0)return r;if(typeof r=="object"){let a=[],o=Math.max(e.dirty.length,r.length);for(let l=0;l32){let e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),nf=L_?n=>requestAnimationFrame(n):re;var fo=new Set;function V_(n){fo.forEach(e=>{e.c(n)||(fo.delete(e),e.f())}),fo.size!==0&&nf(V_)}s(V_,"run_tasks");function z_(n){let e;return fo.size===0&&nf(V_),{promise:new Promise(t=>{fo.add(e={c:n,f:t})}),abort(){fo.delete(e)}}}s(z_,"loop");var U_=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global,mo=class{constructor(e){this.options=e,this._listeners="WeakMap"in U_?new WeakMap:void 0}observe(e,t){return this._listeners.set(e,t),this._getObserver().observe(e,this.options),()=>{this._listeners.delete(e),this._observer.unobserve(e)}}_getObserver(){var e;return(e=this._observer)!==null&&e!==void 0?e:this._observer=new ResizeObserver(t=>{var i;for(let r of t)mo.entries.set(r.target,r),(i=this._listeners.get(r.target))===null||i===void 0||i(r)})}};s(mo,"ResizeObserverSingleton");mo.entries="WeakMap"in U_?new WeakMap:void 0;var G_=!1;function wR(){G_=!0}s(wR,"start_hydrating");function xR(){G_=!1}s(xR,"end_hydrating");function N(n,e){n.appendChild(e)}s(N,"append");function J_(n){if(!n)return document;let e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}s(J_,"get_root_for_style");function kR(n){let e=V("style");return ER(J_(n),e),e.sheet}s(kR,"append_empty_stylesheet");function ER(n,e){return N(n.head||n,e),e.sheet}s(ER,"append_stylesheet");function G(n,e,t){n.insertBefore(e,t||null)}s(G,"insert");function z(n){n.parentNode&&n.parentNode.removeChild(n)}s(z,"detach");function ai(n,e){for(let t=0;tn.removeEventListener(e,t,i)}s(De,"listen");function H_(n){return function(e){return e.stopPropagation(),n.call(this,e)}}s(H_,"stop_propagation");function T(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}s(T,"attr");function go(n){return n===""?null:+n}s(go,"to_number");function CR(n){return Array.from(n.childNodes)}s(CR,"children");function tt(n,e){e=""+e,n.data!==e&&(n.data=e)}s(tt,"set_data");function mt(n,e){n.value=e??""}s(mt,"set_input_value");function $e(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}s($e,"set_style");function $_(n,e,{bubbles:t=!1,cancelable:i=!1}={}){let r=document.createEvent("CustomEvent");return r.initCustomEvent(n,t,i,e),r}s($_,"custom_event");var As=class{constructor(e=!1){this.is_svg=!1,this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,t,i=null){this.e||(this.is_svg?this.e=TR(t.nodeName):this.e=V(t.nodeType===11?"TEMPLATE":t.nodeName),this.t=t.tagName!=="TEMPLATE"?t:t.content,this.c(e)),this.i(i)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let t=0;t>>0}s(AR,"hash");function SR(n,e){let t={stylesheet:kR(e),rules:{}};return sc.set(n,t),t}s(SR,"create_style_information");function K_(n,e,t,i,r,a,o,l=0){let c=16.666/i,u=`{ -`;for(let g=0;g<=1;g+=c){let h=e+(t-e)*a(g);u+=g*100+`%{${o(h,1-h)}} -`}let d=u+`100% {${o(t,1-t)}} -}`,m=`__svelte_${AR(d)}_${l}`,p=J_(n),{stylesheet:f,rules:_}=sc.get(p)||SR(p,n);_[m]||(_[m]=!0,f.insertRule(`@keyframes ${m} ${d}`,f.cssRules.length));let v=n.style.animation||"";return n.style.animation=`${v?`${v}, `:""}${m} ${i}ms linear ${r}ms 1 both`,lc+=1,m}s(K_,"create_rule");function Xd(n,e){let t=(n.style.animation||"").split(", "),i=t.filter(e?a=>a.indexOf(e)<0:a=>a.indexOf("__svelte")===-1),r=t.length-i.length;r&&(n.style.animation=i.join(", "),lc-=r,lc||jR())}s(Xd,"delete_rule");function jR(){nf(()=>{lc||(sc.forEach(n=>{let{ownerNode:e}=n.stylesheet;e&&z(e)}),sc.clear())})}s(jR,"clear_rules");function Os(n,e,t,i){if(!e)return re;let r=n.getBoundingClientRect();if(e.left===r.left&&e.right===r.right&&e.top===r.top&&e.bottom===r.bottom)return re;let{delay:a=0,duration:o=300,easing:l=Is,start:c=P_()+a,end:u=c+o,tick:d=re,css:m}=t(n,{from:e,to:r},i),p=!0,f=!1,_;function v(){m&&(_=K_(n,0,1,o,a,l,m)),a||(f=!0)}s(v,"start");function g(){m&&Xd(n,_),p=!1}return s(g,"stop"),z_(h=>{if(!f&&h>=c&&(f=!0),f&&h>=u&&(d(1,0),g()),!p)return!1;if(f){let b=h-c,x=0+1*l(b/o);d(x,1-x)}return!0}),v(),d(0,1),g}s(Os,"create_animation");function Ns(n){let e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){let{width:t,height:i}=e,r=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,IR(n,r)}}s(Ns,"fix_position");function IR(n,e){let t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){let i=getComputedStyle(n),r=i.transform==="none"?"":i.transform;n.style.transform=`${r} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}s(IR,"add_transform");var js;function Ss(n){js=n}s(Ss,"set_current_component");function q_(){if(!js)throw new Error("Function called outside component initialization");return js}s(q_,"get_current_component");function rf(n){q_().$$.on_destroy.push(n)}s(rf,"onDestroy");function af(){let n=q_();return(e,t,{cancelable:i=!1}={})=>{let r=n.$$.callbacks[e];if(r){let a=$_(e,t,{cancelable:i});return r.slice().forEach(o=>{o.call(n,a)}),!a.defaultPrevented}return!0}}s(af,"createEventDispatcher");var uo=[];var se=[],po=[],Yd=[],OR=Promise.resolve(),Qd=!1;function NR(){Qd||(Qd=!0,OR.then(W_))}s(NR,"schedule_update");function Br(n){po.push(n)}s(Br,"add_render_callback");function he(n){Yd.push(n)}s(he,"add_flush_callback");var Zd=new Set,co=0;function W_(){if(co!==0)return;let n=js;do{try{for(;con.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),po=e}s(DR,"flush_render_callbacks");var Cs;function RR(){return Cs||(Cs=Promise.resolve(),Cs.then(()=>{Cs=null})),Cs}s(RR,"wait");function I_(n,e,t){n.dispatchEvent($_(`${e?"intro":"outro"}${t}`))}s(I_,"dispatch");var oc=new Set,Sa;function bt(){Sa={r:0,c:[],p:Sa}}s(bt,"group_outros");function vt(){Sa.r||At(Sa.c),Sa=Sa.p}s(vt,"check_outros");function W(n,e){n&&n.i&&(oc.delete(n),n.i(e))}s(W,"transition_in");function Y(n,e,t,i){if(n&&n.o){if(oc.has(n))return;oc.add(n),Sa.c.push(()=>{oc.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}s(Y,"transition_out");var MR={duration:0};function Bs(n,e,t){let i={direction:"in"},r=e(n,t,i),a=!1,o,l,c=0;function u(){o&&Xd(n,o)}s(u,"cleanup");function d(){let{delay:p=0,duration:f=300,easing:_=Is,tick:v=re,css:g}=r||MR;g&&(o=K_(n,0,1,f,p,_,g,c++)),v(0,1);let h=P_()+p,b=h+f;l&&l.abort(),a=!0,Br(()=>I_(n,!0,"start")),l=z_(x=>{if(a){if(x>=b)return v(1,0),I_(n,!0,"end"),u(),a=!1;if(x>=h){let y=_((x-h)/f);v(y,1-y)}}return a})}s(d,"go");let m=!1;return{start(){m||(m=!0,Xd(n),Vn(r)?(r=r(i),RR().then(d)):d())},invalidate(){m=!1},end(){a&&(u(),a=!1)}}}s(Bs,"create_in_transition");function FR(n,e){n.d(1),e.delete(n.key)}s(FR,"destroy_block");function Ds(n,e){n.f(),FR(n,e)}s(Ds,"fix_and_destroy_block");function Rs(n,e,t,i,r,a,o,l,c,u,d,m){let p=n.length,f=a.length,_=p,v={};for(;_--;)v[n[_].key]=_;let g=[],h=new Map,b=new Map,x=[];for(_=f;_--;){let A=m(r,a,_),I=t(A),S=o.get(I);S?i&&x.push(()=>S.p(A,e)):(S=u(I,A),S.c()),h.set(I,g[_]=S),I in v&&b.set(I,Math.abs(_-v[I]))}let y=new Set,k=new Set;function C(A){W(A,1),A.m(l,d),o.set(A.key,A),d=A.first,f--}for(s(C,"insert");p&&f;){let A=g[f-1],I=n[p-1],S=A.key,L=I.key;A===I?(d=A.first,p--,f--):h.has(L)?!o.has(S)||y.has(S)?C(A):k.has(L)?p--:b.get(S)>b.get(L)?(k.add(S),C(A)):(y.add(L),p--):(c(I,o),p--)}for(;p--;){let A=n[p];h.has(A.key)||c(A,o)}for(;f;)C(g[f-1]);return At(x),g}s(Rs,"update_keyed_each");var LR=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],OG=new Set([...LR]);function be(n,e,t){let i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}s(be,"bind");function fe(n){n&&n.c()}s(fe,"create_component");function de(n,e,t,i){let{fragment:r,after_update:a}=n.$$;r&&r.m(e,t),i||Br(()=>{let o=n.$$.on_mount.map(ef).filter(Vn);n.$$.on_destroy?n.$$.on_destroy.push(...o):At(o),n.$$.on_mount=[]}),a.forEach(Br)}s(de,"mount_component");function ue(n,e){let t=n.$$;t.fragment!==null&&(DR(t.after_update),At(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}s(ue,"destroy_component");function PR(n,e){n.$$.dirty[0]===-1&&(uo.push(n),NR(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{let _=f.length?f[0]:p;return u.ctx&&r(u.ctx[m],u.ctx[m]=_)&&(!u.skip_bound&&u.bound[m]&&u.bound[m](_),d&&PR(n,m)),p}):[],u.update(),d=!0,At(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){wR();let m=CR(e.target);u.fragment&&u.fragment.l(m),m.forEach(z)}else u.fragment&&u.fragment.c();e.intro&&W(n.$$.fragment),de(n,e.target,e.anchor,e.customElement),xR(),W_()}Ss(c)}s(Ie,"init");var VR;typeof HTMLElement=="function"&&(VR=s(class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){let{on_mount:n}=this.$$;this.$$.on_disconnect=n.map(ef).filter(Vn);for(let e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(n,e,t){this[n]=t}disconnectedCallback(){At(this.$$.on_disconnect)}$destroy(){ue(this,1),this.$destroy=re}$on(n,e){if(!Vn(e))return re;let t=this.$$.callbacks[n]||(this.$$.callbacks[n]=[]);return t.push(e),()=>{let i=t.indexOf(e);i!==-1&&t.splice(i,1)}}$set(n){this.$$set&&!N_(n)&&(this.$$.skip_bound=!0,this.$$set(n),this.$$.skip_bound=!1)}},"SvelteElement"));var je=class{$destroy(){ue(this,1),this.$destroy=re}$on(e,t){if(!Vn(t))return re;let i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{let r=i.indexOf(t);r!==-1&&i.splice(r,1)}}$set(e){this.$$set&&!N_(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};s(je,"SvelteComponent");var ho=[];function Z_(n,e=re){let t,i=new Set;function r(l){if(Ae(n,l)&&(n=l,t)){let c=!ho.length;for(let u of i)u[1](),ho.push(u,n);if(c){for(let u=0;u{i.delete(u),i.size===0&&t&&(t(),t=null)}}return s(o,"subscribe"),{set:r,update:a,subscribe:o}}s(Z_,"writable");var of=class{store;valueValidator;constructor(e,t){this.store=Z_(e),this.valueValidator=t||(i=>i),of.all.push(this)}get(){return this.valueValidator(tf(this.store))}set(e){return this.store.set(this.valueValidator(e))}update(e){return this.store.update(t=>this.valueValidator(e(t)))}subscribe(e,t){return this.store.subscribe(e,t)}},me=of;s(me,"Valuable"),ht(me,"all",[]);var Ms={export_namespace:"blueprint",show_bounding_box:!1,auto_bounding_box:!0,bounding_box:[48,48],enable_plugin_mode:!1,resource_pack_export_mode:"raw",data_pack_export_mode:"raw",display_item:"minecraft:white_dye",custom_model_data_offset:0,enable_advanced_resource_pack_settings:!1,resource_pack:"",display_item_path:"",model_folder:"",texture_folder:"",enable_advanced_data_pack_settings:!1,data_pack:"",summon_commands:"",interpolation_duration:1,teleportation_duration:1,use_storage_for_animation:!1,baked_animations:!0,json_file:""},Rr=new me({});var X_='data:image/svg+xml,%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A';var Oi='data:image/svg+xml,%0D%0A%09%0D%0A%09%0D%0A%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%0D%0A%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%0D%0A%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%0D%0A%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%0D%0A%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%0D%0A%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%0D%0A%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%0D%0A%09%0D%0A%09%0D%0A%0D%0A%09%0D%0A';function JR(n){let e,t;return{c(){e=V("img"),$t(e.src,t=Oi)||T(e,"src",t),T(e,"alt",""),T(e,"class","svelte-uye5l3")},m(i,r){G(i,e,r)},p:re,d(i){i&&z(e)}}}s(JR,"create_else_block");function HR(n){let e,t;return{c(){e=V("img"),$t(e.src,t=X_)||T(e,"src",t),T(e,"alt",""),T(e,"class","svelte-uye5l3")},m(i,r){G(i,e,r)},p:re,d(i){i&&z(e)}}}s(HR,"create_if_block");function $R(n){let e;function t(a,o){return a[1]?HR:JR}s(t,"select_block_type");let i=t(n,-1),r=i(n);return{c(){r.c(),e=St()},m(a,o){r.m(a,o),G(a,e,o)},p(a,[o]){i===(i=t(a,o))&&r?r.p(a,o):(r.d(1),r=i(a),r&&(r.c(),r.m(e.parentNode,e)))},i:re,o:re,d(a){r.d(a),a&&z(e)}}}s($R,"create_fragment");function KR(n,e,t){let i,r=re,a=s(()=>(r(),r=ze(o,l=>t(1,i=l)),o),"$$subscribe_pluginMode");n.$$.on_destroy.push(()=>r());let{pluginMode:o}=e;return a(),n.$$set=l=>{"pluginMode"in l&&a(t(0,o=l.pluginMode))},[o,i]}s(KR,"instance");var cc=class extends je{constructor(e){super(),Ie(this,e,KR,$R,Ae,{pluginMode:0})}};s(cc,"ProjectTitle");var Y_=cc;(()=>{let n=Blockbench.addCSS("img.svelte-uye5l3{width:20px;height:20px;margin-top:2px;margin-right:2px;border-radius:2px;box-shadow:1px 1px 1px #000000aa}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();function Fs(n,e){return new Promise(t=>{let i=setInterval(()=>{let r=n();r!=null&&(clearInterval(i),t(r))},e)})}s(Fs,"pollPromise");var uc=class extends Error{constructor(e,t){super(`Mod '${e}' failed to install: ${t.message}`+(t.stack?` -`+t.stack:""))}};s(uc,"BlockbenchModInstallError");var dc=class extends Error{constructor(e,t){super(`Mod '${e}' failed to uninstall: ${t.message}`+(t.stack?` -`+t.stack:""))}};s(dc,"BlockbenchModUninstallError");function Ke(n,e,t,i){let r=!1,a;te.INJECT_MODS.subscribe(()=>{console.log(`Injecting BBMod '${n}'`);try{r&&new Error("Mod is already installed!"),a=t(e),r=!0}catch(o){throw new uc(n,o)}console.log("Sucess!")}),te.EXTRACT_MODS.subscribe(()=>{console.log(`Extracting BBMod '${n}'`);try{r||new Error("Mod is not installed!"),i(a),r=!1}catch(o){throw new dc(n,o)}console.log("Sucess!")})}s(Ke,"createBlockbenchMod");function Xt(n,e){let t=new Action(n,e);return te.EXTRACT_MODS.subscribe(()=>{t.delete()},!0),t}s(Xt,"createAction");function eg(n,e){let t=new ModelLoader(n,e);return te.EXTRACT_MODS.subscribe(()=>{t.delete()},!0),t}s(eg,"createModelLoader");function tg(n,e){return new Menu(n,e)}s(tg,"createMenu");function ng(n,e,t){return new BarMenu(n,e,t)}s(ng,"createBarMenu");var Q_=new Map;function fc(n,e){let t=Q_.get(n),i={value:n[e]};if(t===void 0){let r=new Yr,a=new Yr;t=[r,a],Q_.set(n,t),Object.defineProperty(n,e,{get(){return r.dispatch({storage:i,value:i.value}),i.value},set(o){i.value=o,a.dispatch({storage:i,newValue:o})},configurable:!0}),te.EXTRACT_MODS.subscribe(()=>{let o=n[e];delete n[e],Object.defineProperty(n,e,{value:o,configurable:!0})},!0)}return t}s(fc,"createPropertySubscribable");async function Wi(n){return Fs(n.elementSelector).then(e=>{let t;n.prepend?t=e.children[0]:n.injectIndex!==void 0&&(t=e.children[n.injectIndex]);let i=new n.component({target:e,anchor:t,props:n.props});return n.postMount&&n.postMount(i),i})}s(Wi,"injectSvelteCompomponent");function Qr(n){Ke(`animated_java:injected_svelte_component[${n.component.name}](${guid()})`,{},()=>{let e;return Fs(n.elementSelector).then(t=>{let i;n.prepend&&(i=t.children[0]),e=new n.component({target:t,anchor:i,props:n.props}),n.postMount&&n.postMount(e)}),e},e=>{e&&e.$destroy()})}s(Qr,"injectSvelteCompomponentMod");var yo=ui(rn("path"),1);var qR="https://launchermeta.mojang.com/mc/game/version_manifest_v2.json",bo;async function Mr(){if(bo)return bo;if(!window.navigator.onLine){if(console.warn("Not connected to the internet! Using last known latest version."),bo=ja(),!bo)throw new Error("No internet connection, and no previous latest version cached!");return bo}let n;try{n=await fetch(qR)}catch(e){throw new Error(`Failed to fetch latest Minecraft version manifest: ${e.message}`)}if(n&&n.ok){let e=await n.json(),t=e.versions.find(i=>i.id===e.latest.snapshot);if(!t)throw new Error(`Failed to find version data for '${e.latest.snapshot}'`);return bo=t,localStorage.setItem("animated_java:minecraftVersion",JSON.stringify(t)),t}throw new Error("Failed to fetch latest Minecraft version manifest.")}s(Mr,"getLatestVersion");function ja(){let n=localStorage.getItem("animated_java:minecraftVersion");if(n)return JSON.parse(n)}s(ja,"getCurrentVersion");var WR="https://raw.githubusercontent.com/misode/mcmeta/summary/blocks/data.json",mc=class{defaultStates={};stateValues={};constructor(e){for(let[t,i]of Object.entries(e[1]))this.defaultStates[t]=Ia(i,!1);for(let[t,i]of Object.entries(e[0]))this.stateValues[t]=i.map(r=>Ia(r,!1))}};s(mc,"BlockStateRegistryEntry");var vo={};function ZR(){let n=localStorage.getItem("animated_java:blockStateRegistry");if(!n){console.error("BlockState Registry not found in local storage");return}let e=JSON.parse(n);for(let t in e)vo[t]=new mc(e[t])}s(ZR,"updateMemoryRegistry");async function sf(){console.log("Updating BlockState Registry...");let n=3;for(;n-->=0;){let e;try{e=await fetch(WR)}catch(t){console.error("Failed to fetch latest BlockState registry:",t)}if(e&&e.ok){let t=await e.json();localStorage.setItem("animated_java:blockStateRegistry",JSON.stringify(t));let i=await Mr();localStorage.setItem("animated_java:blockStateRegistryVersion",JSON.stringify(i)),console.log("BlockState Registry updated!");return}}throw new Error("Failed to fetch latest BlockState registry after 3 retries.")}s(sf,"updateLocalRegistry");async function XR(){if(console.log("Checking if BlockState Registry update..."),!localStorage.getItem("animated_java:blockStateRegistry")){console.log("No BlockState Registry found. Updating..."),await sf();return}let e=localStorage.getItem("animated_java:blockStateRegistryVersion");if(!e){console.log("No BlockState Registry version found. Updating..."),await sf();return}let t=JSON.parse(e),i=await Mr();if(t.id!==i.id){console.log("BlockState Registry is outdated. Updating..."),await sf();return}console.log("BlockState Registry is up to date!"),ZR(),requestAnimationFrame(()=>te.BLOCKSTATE_REGISTRY_LOADED.dispatch())}s(XR,"checkForRegistryUpdate");async function pc(n){return Object.keys(vo).length===0?new Promise(e=>{te.BLOCKSTATE_REGISTRY_LOADED.subscribe(()=>{e(vo[n])},!0)}):vo[n]}s(pc,"getBlockState");te.LOAD.subscribe(()=>{XR().catch(n=>{console.error(n)})});function Rt(n){return n.toLowerCase().replace(/[^a-z0-9_\\.]/g,"_").replace(/_+/g,"_")}s(Rt,"toSafeFuntionName");function hr(n,e){let[t,...i]=n.split(":");if(!t)throw new Error(`Invalid resource location: '${n}'`);return i.length===0&&(i=[t],t="minecraft"),`assets/${t}/${e}/${i.join("/")}`}s(hr,"getPathFromResourceLocation");function _c(n){let e=br(n);return!!(e&&e.namespace&&e.resourcePath)}s(_c,"isResourcePackPath");function br(n){n=n.replaceAll(/\\/g,"/");let e=n.split("/"),t=e.indexOf("assets");if(t===-1)return;let i=e.slice(0,t).join("/"),r=e[t+1],a=e.slice(t+3,-1).join("/"),o=yo.basename(n).split(".").slice(0,-1).join(".");if(o!==o.toLowerCase())return;let l=(r+":"+PathModule.join(a,o)).replaceAll(/\\/g,"/");return{resourcePackRoot:i,namespace:r,resourcePath:a,resourceLocation:l,fileName:o,fileExtension:yo.extname(n)}}s(br,"parseResourcePackPath");function wo(n){let[e,...t]=n.split(":");t.length===0&&(t=[e],e="minecraft");let i=t.join(""),r=i.split("/")[0],a=PathModule.parse(i);return{namespace:e,path:i,type:r,dir:a.dir,name:a.name}}s(wo,"parseResourceLocation");function ig(n){let e=gc(n);return!!(e&&e.namespace&&e.resourcePath)}s(ig,"isDataPackPath");function gc(n){n=n.replaceAll(/\\/g,"/");let e=n.split("/"),t=e.indexOf("data");if(t===-1)return;let i=e.slice(0,t).join("/"),r=e[t+1],a=e[t+2],o;switch(a){case"tags":o=e.slice(t+4,-1).join("/");break;default:o=e.slice(t+3,-1).join("/");break}let l=yo.basename(n).split(".").slice(0,-1).join(".");if(l!==l.toLowerCase())return;let c=(r+":"+PathModule.join(o,l)).replaceAll(/\\/g,"/");return{resourcePackRoot:i,namespace:r,resourcePath:o,resourceLocation:c,fileName:l,fileExtension:yo.extname(n)}}s(gc,"parseDataPackPath");function rg(n,e){return n.values.forEach(t=>{typeof t=="string"?e.values.some(i=>typeof i=="object"?i.id===t:i===t)||e.values.push(t):e.values.some(i=>typeof i=="object"?i.id===t.id:i===t.id)||e.values.push(t)}),e}s(rg,"mergeTag");function Ia(n,e){return n==="true"?!0:n==="false"?!1:isNaN(Number(n))?e&&n.includes("|")?n.split("|").map(t=>t==="true"?!0:t==="false"?!1:isNaN(Number(t))?t:Number(t)):n:Number(n)}s(Ia,"resolveBlockstateValueType");async function xo(n){let e={};if(n.includes("[")){let i=n.match(/(.+?)\[((?:[^,=[\]]+=[^,=[\]]+,?)+)?]/);if(!i)return;if(i[2]!==void 0){let r=i[2].split(",");for(let a of r){let[o,l]=a.trim().split("=");e[o]=Ia(l,!1)}}n=i[1]}let t=wo(n);return{resource:t,resourceLocation:t.namespace+":"+t.path,states:e,blockStateRegistryEntry:await pc(t.name)}}s(xo,"parseBlock");function ag(n){if(!Project||!n.path)return;let e=pathToName(n.path,!0);if(n.path&&isApp&&!n.no_file){let t=Project;Project.save_path=n.path,Project.name=pathToName(e,!1),addRecentProject({name:e,path:n.path,icon:et.icon}),setTimeout(()=>{Project===t&&updateRecentProjectThumbnail()},200)}}s(ag,"addProjectToRecentProjects");function og(n,e){return Math.round(n*10**e)/10**e}s(og,"roundTo");function ea(n,e){return Math.round(n*e)/e}s(ea,"roundToNth");function ko(n){return Number((255*n).toFixed(0)).toString(16).padStart(2,"0")}s(ko,"floatToHex");function sg(n){let e=n.toRgb();return e.a*255<<24|e.r<<16|e.g<<8|e.b}s(sg,"tinycolorToDecimal");function lg(n){n.x===0&&(n.x=1e-5),n.y===0&&(n.y=1e-5),n.z===0&&(n.z=1e-5)}s(lg,"makeNotZero");function lf(n){for(let e in n)n[e]===void 0?delete n[e]:typeof n[e]=="object"&&lf(n[e]);return n}s(lf,"scrubUndefined");function cg(n){let e=new Map;function t(i,r){if(!(typeof i!="object"||i===null)){if(e.has(i)){let a=e.get(i),o=s(l=>l?`${l.parent?`${o(l.parent)}.`:""}${l.name}`:"","stringifyNode");throw`Circular reference detected: +Als dit is ingesteld op een waarde groter dan de lengte van de animatie, zullen de commando's worden uitgevoerd alsof herhalen is uitgeschakeld (Zodra het keyframe is bereikt).`,N8="Versoepeling Type",B8="Het type versoepeling dat moet worden toegepast op het keyframe.",R8="Linear",D8="Sine",M8="Quad",F8="Cubic",L8="Quart",P8="Quint",V8="Expo",z8="Circ",G8="Elastic",U8="Back",J8="Bounce",H8="Versoepling Modus",$8="De versoepelingsmodus die moet worden toegepast op het keyframe.",q8="In",K8="Out",W8="In-Out",Z8="Versoepeling Argumenten",X8="De argumenten die moeten worden toegepast op de versoepelings functie.",Y8="Elasticiteit",Q8="De elasticiteit van de versoepelings functie.",e6="Overschrijding",t6="De hoeveelheid overschrijding die moet worden toegepast op de versoepelings functie.",n6="Stuiterigheid",i6="De stuiterigheid van de versoepelings functie.",r6="Tekstweergave",a6="Lijnbreedte",o6="De breedte van de tekstweergave in pixels.",s6="Achtergrond Kleur",l6="De kleur van de achtergrond van de tekstweergave.",c6="Tekst Schaduw",u6="Wel of geen schaduw achter de tekst weergeven.",d6="Uitlijning Van Tekst",f6="De uitlijning van de tekst.",m6="Links",p6="Midden",_6="Rechts",g6="Weergegeven Voorwerp",h6="Het voorwerp dat moet worden weergegeven.",b6="Weergegeven Blok.",v6="Het blok dat moet worden weergegeven. Ondersteunt block states!",y6="Vanilla Voorwerpweergave",w6="Exporteren Mislukt",x6="Je hebt resource pack exporteren uitgeschakeld, maar je hebt aangepaste modellen in je project! Schakel resource pack exporteren in of verwijder de aangepaste modellen voordat je exporteert.",k6="Er zitten fouten in je blauwdruk instellingen! Herstel deze voordat je exporteert.",E6="Een probleem gevonden met {0}:",T6="Ok",C6="Animated Java",A6="Mob hoofden worden niet weergegeven in Blokweergaves. Gebruik in plaats daarvan een Voorwerpweergave.",S6="Blauwdruk export pad bestaat niet",j6=`Het exportpad '{0}' bestaat niet! +Controleer of de map waarin je opslaat bestaat en probeer het opnieuw.`,I6={"animated_java.action.open_blueprint_settings.name":BN,"animated_java.action.open_documentation.name":RN,"animated_java.action.open_about.name":DN,"animated_java.action.open_bone_config.name":MN,"animated_java.action.open_locator_config.name":FN,"animated_java.action.open_text_display_config.name":LN,"animated_java.action.export.name":PN,"animated_java.action.create_text_display.title":VN,"animated_java.action.create_vanilla_item_display.title":zN,"animated_java.action.create_vanilla_block_display.title":GN,"animated_java.action.open_vanilla_item_display_config.name":UN,"animated_java.action.open_vanilla_block_display_config.name":JN,"animated_java.popup.loading.loading":HN,"animated_java.popup.loading.success":$N,"animated_java.popup.loading.offline":qN,"animated_java.dialog.about.title":KN,"animated_java.dialog.about.close_button":WN,"animated_java.dialog.unexpected_error.title":ZN,"animated_java.dialog.unexpected_error.close_button":XN,"animated_java.dialog.unexpected_error.copy_error_message_button.message":YN,"animated_java.dialog.unexpected_error.copy_error_message_button.description":QN,"animated_java.dialog.unexpected_error.paragraph":e4,"animated_java.dialog.blueprint_settings.title":t4,"animated_java.dialog.blueprint_settings.advanced_settings_warning":n4,"animated_java.dialog.blueprint_settings.blueprint_name.title":i4,"animated_java.dialog.blueprint_settings.blueprint_name.description":r4,"animated_java.dialog.blueprint_settings.texture_size.title":a4,"animated_java.dialog.blueprint_settings.texture_size.description":o4,"animated_java.dialog.blueprint_settings.texture_size.warning.not_square":s4,"animated_java.dialog.blueprint_settings.texture_size.warning.not_a_power_of_2":l4,"animated_java.dialog.blueprint_settings.texture_size.warning.does_not_match_largest_texture":c4,"animated_java.dialog.blueprint_settings.export_settings.title":u4,"animated_java.dialog.blueprint_settings.export_namespace.title":d4,"animated_java.dialog.blueprint_settings.export_namespace.description":f4,"animated_java.dialog.blueprint_settings.export_namespace.error.empty":m4,"animated_java.dialog.blueprint_settings.export_namespace.error.reserved":p4,"animated_java.dialog.blueprint_settings.export_namespace.error.invalid_characters":_4,"animated_java.dialog.blueprint_settings.enable_plugin_mode.title":g4,"animated_java.dialog.blueprint_settings.enable_plugin_mode.description":h4,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.title":b4,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.description":v4,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.raw":y4,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.zip":w4,"animated_java.dialog.blueprint_settings.resource_pack_export_mode.options.none":x4,"animated_java.dialog.blueprint_settings.data_pack_export_mode.title":k4,"animated_java.dialog.blueprint_settings.data_pack_export_mode.description":E4,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.raw":T4,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.zip":C4,"animated_java.dialog.blueprint_settings.data_pack_export_mode.options.none":A4,"animated_java.dialog.blueprint_settings.show_bounding_box.title":S4,"animated_java.dialog.blueprint_settings.show_bounding_box.description":j4,"animated_java.dialog.blueprint_settings.auto_bounding_box.title":I4,"animated_java.dialog.blueprint_settings.auto_bounding_box.description":O4,"animated_java.dialog.blueprint_settings.bounding_box.title":N4,"animated_java.dialog.blueprint_settings.bounding_box.description":B4,"animated_java.dialog.blueprint_settings.resource_pack_settings.title":R4,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_settings.title":D4,"animated_java.dialog.blueprint_settings.enable_advanced_resource_pack_settings.description":M4,"animated_java.dialog.blueprint_settings.display_item.title":F4,"animated_java.dialog.blueprint_settings.display_item.description":L4,"animated_java.dialog.blueprint_settings.display_item.error.no_item_selected":P4,"animated_java.dialog.blueprint_settings.display_item.error.invalid_item_id.no_namespace":V4,"animated_java.dialog.blueprint_settings.display_item.error.invalid_item_id.whitespace":z4,"animated_java.dialog.blueprint_settings.display_item.warning.item_does_not_exist":G4,"animated_java.dialog.blueprint_settings.custom_model_data_offset.title":U4,"animated_java.dialog.blueprint_settings.custom_model_data_offset.description":J4,"animated_java.dialog.blueprint_settings.resource_pack.title":H4,"animated_java.dialog.blueprint_settings.resource_pack.description":$4,"animated_java.dialog.blueprint_settings.resource_pack.error.no_folder_selected":q4,"animated_java.dialog.blueprint_settings.resource_pack.error.folder_does_not_exist":K4,"animated_java.dialog.blueprint_settings.resource_pack.error.not_a_folder":W4,"animated_java.dialog.blueprint_settings.resource_pack.error.missing_pack_mcmeta":Z4,"animated_java.dialog.blueprint_settings.resource_pack.error.missing_assets_folder":X4,"animated_java.dialog.blueprint_settings.resource_pack_zip.title":Y4,"animated_java.dialog.blueprint_settings.resource_pack_zip.description":Q4,"animated_java.dialog.blueprint_settings.resource_pack_zip.error.no_file_selected":eB,"animated_java.dialog.blueprint_settings.resource_pack_zip.error.not_a_file":tB,"animated_java.dialog.blueprint_settings.display_item_path.title":nB,"animated_java.dialog.blueprint_settings.display_item_path.description":iB,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.no_file_selected":rB,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.file_does_not_exist":aB,"animated_java.dialog.blueprint_settings.advanced_resource_pack_file.error.not_a_file":oB,"animated_java.dialog.blueprint_settings.model_folder.title":sB,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.description":lB,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.no_folder_selected":cB,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.folder_does_not_exist":uB,"animated_java.dialog.blueprint_settings.advanced_resource_pack_folder.error.not_a_folder":dB,"animated_java.dialog.blueprint_settings.texture_folder.title":fB,"animated_java.dialog.blueprint_settings.texture_folder.description":mB,"animated_java.dialog.blueprint_settings.data_pack_settings.title":pB,"animated_java.dialog.blueprint_settings.enable_advanced_data_pack_settings.title":_B,"animated_java.dialog.blueprint_settings.enable_advanced_data_pack_settings.description":gB,"animated_java.dialog.blueprint_settings.data_pack.title":hB,"animated_java.dialog.blueprint_settings.data_pack.description":bB,"animated_java.dialog.blueprint_settings.data_pack.error.no_folder_selected":vB,"animated_java.dialog.blueprint_settings.data_pack.error.folder_does_not_exist":yB,"animated_java.dialog.blueprint_settings.data_pack.error.not_a_folder":wB,"animated_java.dialog.blueprint_settings.data_pack.error.missing_pack_mcmeta":xB,"animated_java.dialog.blueprint_settings.data_pack.error.missing_data_folder":kB,"animated_java.dialog.blueprint_settings.data_pack_zip.title":EB,"animated_java.dialog.blueprint_settings.data_pack_zip.description":TB,"animated_java.dialog.blueprint_settings.data_pack_zip.error.no_file_selected":CB,"animated_java.dialog.blueprint_settings.data_pack_zip.error.not_a_file":AB,"animated_java.dialog.blueprint_settings.summon_commands.title":SB,"animated_java.dialog.blueprint_settings.summon_commands.description":jB,"animated_java.dialog.blueprint_settings.interpolation_duration.title":IB,"animated_java.dialog.blueprint_settings.interpolation_duration.description":OB,"animated_java.dialog.blueprint_settings.teleportation_duration.title":NB,"animated_java.dialog.blueprint_settings.teleportation_duration.description":BB,"animated_java.dialog.blueprint_settings.use_storage_for_animation.title":RB,"animated_java.dialog.blueprint_settings.use_storage_for_animation.description":DB,"animated_java.dialog.blueprint_settings.baked_animations.title":MB,"animated_java.dialog.blueprint_settings.baked_animations.description":FB,"animated_java.dialog.blueprint_settings.json_file.title":LB,"animated_java.dialog.blueprint_settings.json_file.description":PB,"animated_java.dialog.blueprint_settings.json_file.error.no_file_selected":VB,"animated_java.dialog.blueprint_settings.json_file.error.not_a_file":zB,"animated_java.dialog.bone_config.title":GB,"animated_java.dialog.bone_config.selected_variant":UB,"animated_java.dialog.bone_config.default_variant_subtitle":JB,"animated_java.dialog.bone_config.selected_variant_subtitle":HB,"animated_java.dialog.bone_config.use_nbt.title":$B,"animated_java.dialog.bone_config.use_nbt.description":qB,"animated_java.dialog.bone_config.use_nbt.use_nbt_warning":KB,"animated_java.dialog.bone_config.inherit_settings.title":WB,"animated_java.dialog.bone_config.inherit_settings.description":ZB,"animated_java.dialog.bone_config.glowing.title":XB,"animated_java.dialog.bone_config.glowing.description":YB,"animated_java.dialog.bone_config.override_glow_color.title":QB,"animated_java.dialog.bone_config.override_glow_color.description":eR,"animated_java.dialog.bone_config.glow_color.title":tR,"animated_java.dialog.bone_config.glow_color.description":nR,"animated_java.dialog.bone_config.shadow_radius.title":iR,"animated_java.dialog.bone_config.shadow_radius.description":rR,"animated_java.dialog.bone_config.shadow_strength.title":aR,"animated_java.dialog.bone_config.shadow_strength.description":oR,"animated_java.dialog.bone_config.override_brightness.title":sR,"animated_java.dialog.bone_config.override_brightness.description":lR,"animated_java.dialog.bone_config.brightness_override.title":cR,"animated_java.dialog.bone_config.brightness_override.description":uR,"animated_java.dialog.bone_config.enchanted.title":dR,"animated_java.dialog.bone_config.enchanted.description":fR,"animated_java.dialog.bone_config.invisible.title":mR,"animated_java.dialog.bone_config.invisible.description":pR,"animated_java.dialog.bone_config.nbt.title":_R,"animated_java.dialog.bone_config.nbt.description":gR,"animated_java.dialog.bone_config.nbt.invalid_nbt.not_compound":hR,"animated_java.dialog.bone_config.nbt.invalid_nbt.error":bR,"animated_java.dialog.bone_config.billboard.title":vR,"animated_java.dialog.bone_config.billboard.description":yR,"animated_java.dialog.bone_config.billboard.options.fixed":wR,"animated_java.dialog.bone_config.billboard.options.vertical":xR,"animated_java.dialog.bone_config.billboard.options.horizontal":kR,"animated_java.dialog.bone_config.billboard.options.center":ER,"animated_java.dialog.locator_config.title":TR,"animated_java.dialog.locator_config.plugin_mode_warning":CR,"animated_java.dialog.locator_config.use_entity.title":AR,"animated_java.dialog.locator_config.use_entity.description":SR,"animated_java.dialog.locator_config.entity_type.title":jR,"animated_java.dialog.locator_config.entity_type.description":IR,"animated_java.dialog.locator_config.entity_type.error.empty":OR,"animated_java.dialog.locator_config.entity_type.warning.invalid":NR,"animated_java.dialog.locator_config.summon_commands.title":BR,"animated_java.dialog.locator_config.summon_commands.description":RR,"animated_java.dialog.locator_config.ticking_commands.title":DR,"animated_java.dialog.locator_config.ticking_commands.description":MR,"animated_java.dialog.text_display_config.title":FR,"animated_java.dialog.bone_config.vanilla_item_model.title":LR,"animated_java.dialog.bone_config.vanilla_item_model.description":PR,"animated_java.dialog.text_display_config.use_nbt.title":VR,"animated_java.dialog.text_display_config.use_nbt.description":zR,"animated_java.dialog.text_display_config.use_nbt.use_nbt_warning":GR,"animated_java.dialog.text_display_config.inherit_settings.title":UR,"animated_java.dialog.text_display_config.inherit_settings.description":JR,"animated_java.dialog.text_display_config.glowing.title":HR,"animated_java.dialog.text_display_config.glowing.description":$R,"animated_java.dialog.text_display_config.override_glow_color.title":qR,"animated_java.dialog.text_display_config.override_glow_color.description":KR,"animated_java.dialog.text_display_config.glow_color.title":WR,"animated_java.dialog.text_display_config.glow_color.description":ZR,"animated_java.dialog.text_display_config.shadow_radius.title":XR,"animated_java.dialog.text_display_config.shadow_radius.description":YR,"animated_java.dialog.text_display_config.shadow_strength.title":QR,"animated_java.dialog.text_display_config.shadow_strength.description":eD,"animated_java.dialog.text_display_config.override_brightness.title":tD,"animated_java.dialog.text_display_config.override_brightness.description":nD,"animated_java.dialog.text_display_config.brightness_override.title":iD,"animated_java.dialog.text_display_config.brightness_override.description":rD,"animated_java.dialog.text_display_config.invisible.title":aD,"animated_java.dialog.text_display_config.invisible.description":oD,"animated_java.dialog.text_display_config.nbt.title":sD,"animated_java.dialog.text_display_config.nbt.description":lD,"animated_java.dialog.text_display_config.billboard.title":cD,"animated_java.dialog.text_display_config.billboard.description":uD,"animated_java.dialog.text_display_config.billboard.options.fixed":dD,"animated_java.dialog.text_display_config.billboard.options.vertical":fD,"animated_java.dialog.text_display_config.billboard.options.horizontal":mD,"animated_java.dialog.text_display_config.billboard.options.center":pD,"animated_java.dialog.variant_config.title":_D,"animated_java.dialog.variant_config.variant_display_name":gD,"animated_java.dialog.variant_config.variant_display_name.description":hD,"animated_java.dialog.variant_config.generate_name_from_display_name":bD,"animated_java.dialog.variant_config.generate_name_from_display_name.description":vD,"animated_java.dialog.variant_config.variant_name":yD,"animated_java.dialog.variant_config.variant_name.description":wD,"animated_java.dialog.variant_config.texture_map.title":xD,"animated_java.dialog.variant_config.texture_map.description":kD,"animated_java.dialog.variant_config.texture_map.create_new_mapping":ED,"animated_java.dialog.variant_config.texture_map.no_mappings":TD,"animated_java.dialog.variant_config.bone_lists.description":CD,"animated_java.dialog.variant_config.excluded_nodes.title":AD,"animated_java.dialog.variant_config.excluded_nodes.description":SD,"animated_java.dialog.variant_config.included_nodes.title":jD,"animated_java.dialog.variant_config.included_nodes.description":ID,"animated_java.dialog.variant_config.swap_columns_button.tooltip":OD,"animated_java.action.upgrade_old_aj_model_loader.name":ND,"animated_java.dialog.upgrade_old_aj_model_loader.title":BD,"animated_java.action.upgrade_old_aj_model_loader.select_file":RD,"animated_java.action.upgrade_old_aj_model_loader.body":DD,"animated_java.action.upgrade_old_aj_model_loader.button":MD,"animated_java.dialog.animation_properties.title":FD,"animated_java.dialog.animation_properties.animation_name.title":LD,"animated_java.dialog.animation_properties.animation_name.description":PD,"animated_java.dialog.animation_properties.loop_mode.title":VD,"animated_java.dialog.animation_properties.loop_mode.description":zD,"animated_java.dialog.animation_properties.loop_mode.options.once":GD,"animated_java.dialog.animation_properties.loop_mode.options.hold":UD,"animated_java.dialog.animation_properties.loop_mode.options.loop":JD,"animated_java.dialog.animation_properties.animation_name.error.empty":HD,"animated_java.dialog.animation_properties.animation_name.error.invalid_characters":$D,"animated_java.dialog.animation_properties.loop_delay.title":qD,"animated_java.dialog.animation_properties.loop_delay.description":KD,"animated_java.dialog.animation_properties.bone_lists.description":WD,"animated_java.dialog.animation_properties.excluded_nodes.title":ZD,"animated_java.dialog.animation_properties.excluded_nodes.description":XD,"animated_java.dialog.animation_properties.included_nodes.title":YD,"animated_java.dialog.animation_properties.included_nodes.description":QD,"animated_java.dialog.animation_properties.swap_columns_button.tooltip":e8,"animated_java.dialog.export_progress.title":t8,"animated_java.panel.variants.title":n8,"animated_java.panel.variants.tool.create_new_variant":i8,"animated_java.panel.variants.tool.edit_variant":r8,"animated_java.panel.variants.tool.duplicate_selected_variant":a8,"animated_java.panel.variants.tool.delete_selected_variant":o8,"animated_java.panel.variants.tool.variant_visible":s8,"animated_java.panel.variants.tool.variant_not_visible":l8,"animated_java.panel.variants.tool.cannot_delete_default_variant":c8,"animated_java.action.variants.create":u8,"animated_java.action.variants.duplicate":d8,"animated_java.action.variants.open_config":f8,"animated_java.action.variants.delete":m8,"animated_java.animation.excluded_nodes":p8,"animated_java.animation.invert_excluded_nodes":_8,"animated_java.effect_animator.timeline.variant":g8,"animated_java.effect_animator.timeline.commands":h8,"animated_java.effect_animator.keyframes.variant":b8,"animated_java.effect_animator.keyframes.commands":v8,"animated_java.effect_animator.keyframes.execute_condition":y8,"animated_java.panel.keyframe.keyframe_title":w8,"animated_java.panel.keyframe.variant.title":x8,"animated_java.panel.keyframe.variant.description":k8,"animated_java.panel.keyframe.commands.title":E8,"animated_java.panel.keyframe.commands.description":T8,"animated_java.panel.keyframe.execute_condition.title":C8,"animated_java.panel.keyframe.execute_condition.description":A8,"animated_java.panel.keyframe.repeat.title":S8,"animated_java.panel.keyframe.repeat.description":j8,"animated_java.panel.keyframe.repeat_frequency.title":I8,"animated_java.panel.keyframe.repeat_frequency.description":O8,"animated_java.panel.keyframe.easing_type.title":N8,"animated_java.panel.keyframe.easing_type.description":B8,"animated_java.panel.keyframe.easing_type.options.linear":R8,"animated_java.panel.keyframe.easing_type.options.sine":D8,"animated_java.panel.keyframe.easing_type.options.quad":M8,"animated_java.panel.keyframe.easing_type.options.cubic":F8,"animated_java.panel.keyframe.easing_type.options.quart":L8,"animated_java.panel.keyframe.easing_type.options.quint":P8,"animated_java.panel.keyframe.easing_type.options.expo":V8,"animated_java.panel.keyframe.easing_type.options.circ":z8,"animated_java.panel.keyframe.easing_type.options.elastic":G8,"animated_java.panel.keyframe.easing_type.options.back":U8,"animated_java.panel.keyframe.easing_type.options.bounce":J8,"animated_java.panel.keyframe.easing_mode.title":H8,"animated_java.panel.keyframe.easing_mode.description":$8,"animated_java.panel.keyframe.easing_mode.options.in":q8,"animated_java.panel.keyframe.easing_mode.options.out":K8,"animated_java.panel.keyframe.easing_mode.options.inout":W8,"animated_java.panel.keyframe.easing_args.title":Z8,"animated_java.panel.keyframe.easing_args.description":X8,"animated_java.panel.keyframe.easing_args.easing_arg.elastic.title":Y8,"animated_java.panel.keyframe.easing_args.easing_arg.elastic.description":Q8,"animated_java.panel.keyframe.easing_args.easing_arg.back.title":e6,"animated_java.panel.keyframe.easing_args.easing_arg.back.description":t6,"animated_java.panel.keyframe.easing_args.easing_arg.bounce.title":n6,"animated_java.panel.keyframe.easing_args.easing_arg.bounce.description":i6,"animated_java.panel.text_display.title":r6,"animated_java.tool.text_display.line_width.title":a6,"animated_java.tool.text_display.line_width.description":o6,"animated_java.tool.text_display.background_color.title":s6,"animated_java.tool.text_display.background_color.description":l6,"animated_java.tool.text_display.text_shadow.title":c6,"animated_java.tool.text_display.text_shadow.description":u6,"animated_java.tool.text_display.text_alignment.title":d6,"animated_java.tool.text_display.text_alignment.description":f6,"animated_java.tool.text_display.text_alignment.options.left":m6,"animated_java.tool.text_display.text_alignment.options.center":p6,"animated_java.tool.text_display.text_alignment.options.right":_6,"animated_java.panel.vanilla_item_display.title":g6,"animated_java.panel.vanilla_item_display.description":h6,"animated_java.panel.vanilla_block_display.title":b6,"animated_java.panel.vanilla_block_display.description":v6,"animated_java.vanilla_item_display.title":y6,"animated_java.misc.failed_to_export.title":w6,"animated_java.misc.failed_to_export.custom_models.message":x6,"animated_java.misc.failed_to_export.blueprint_settings.message":k6,"animated_java.misc.failed_to_export.blueprint_settings.error_item":E6,"animated_java.misc.failed_to_export.button":T6,"animated_java.format_category.animated_java":C6,"animated_java.block_model_manager.mob_head_warning":A6,"animated_java.error.blueprint_export_path_doesnt_exist.title":S6,"animated_java.error.blueprint_export_path_doesnt_exist.description":j6};var O6=[of,sf,lf],U_=O6,J_=["../lang/de.yml","../lang/en.yml","../lang/nl.yml"];var H_=J_.map(n=>PathModule.basename(n,".yml"));function w(n,...e){let t=H_.indexOf(settings.language.value);t===-1&&(console.warn(`Could not find language '${settings.language.value}'`),t=H_.indexOf("en"));let i=U_[t];n.startsWith("animated_java.")||(n=`animated_java.${n}`);let r=i[n];return r?r.replace(/\{(\d+)\}/g,(a,o)=>e[o]||""):(console.warn(`Could not find translation for '${n}'`),n)}s(w,"translate");Language.data["format_category.animated_java"]=w("format_category.animated_java");function ue(){}s(ue,"noop");var Fs=s(n=>n,"identity");function K_(n,e){for(let t in e)n[t]=e[t];return n}s(K_,"assign");function mf(n){return n()}s(mf,"run");function $_(){return Object.create(null)}s($_,"blank_object");function Lt(n){n.forEach(mf)}s(Lt,"run_all");function Rn(n){return typeof n=="function"}s(Rn,"is_function");function Oe(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}s(Oe,"safe_not_equal");var pc;function Yt(n,e){return pc||(pc=document.createElement("a")),pc.href=e,n===pc.href}s(Yt,"src_url_equal");function W_(n){return Object.keys(n).length===0}s(W_,"is_empty");function ze(n,...e){if(n==null)return ue;let t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}s(ze,"subscribe");function pf(n){let e;return ze(n,t=>e=t)(),e}s(pf,"get_store_value");function xo(n,e,t){n.$$.on_destroy.push(ze(e,t))}s(xo,"component_subscribe");function Z_(n,e,t,i){if(n){let r=X_(n,e,t,i);return n[0](r)}}s(Z_,"create_slot");function X_(n,e,t,i){return n[1]&&i?K_(t.ctx.slice(),n[1](i(e))):t.ctx}s(X_,"get_slot_context");function Y_(n,e,t,i){if(n[2]&&i){let r=n[2](i(t));if(e.dirty===void 0)return r;if(typeof r=="object"){let a=[],o=Math.max(e.dirty.length,r.length);for(let l=0;l32){let e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),_f=tg?n=>requestAnimationFrame(n):ue;var vo=new Set;function ig(n){vo.forEach(e=>{e.c(n)||(vo.delete(e),e.f())}),vo.size!==0&&_f(ig)}s(ig,"run_tasks");function rg(n){let e;return vo.size===0&&_f(ig),{promise:new Promise(t=>{vo.add(e={c:n,f:t})}),abort(){vo.delete(e)}}}s(rg,"loop");var ag=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global,yo=class{constructor(e){this.options=e,this._listeners="WeakMap"in ag?new WeakMap:void 0}observe(e,t){return this._listeners.set(e,t),this._getObserver().observe(e,this.options),()=>{this._listeners.delete(e),this._observer.unobserve(e)}}_getObserver(){var e;return(e=this._observer)!==null&&e!==void 0?e:this._observer=new ResizeObserver(t=>{var i;for(let r of t)yo.entries.set(r.target,r),(i=this._listeners.get(r.target))===null||i===void 0||i(r)})}};s(yo,"ResizeObserverSingleton");yo.entries="WeakMap"in ag?new WeakMap:void 0;var og=!1;function N6(){og=!0}s(N6,"start_hydrating");function B6(){og=!1}s(B6,"end_hydrating");function N(n,e){n.appendChild(e)}s(N,"append");function sg(n){if(!n)return document;let e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}s(sg,"get_root_for_style");function R6(n){let e=P("style");return D6(sg(n),e),e.sheet}s(R6,"append_empty_stylesheet");function D6(n,e){return N(n.head||n,e),e.sheet}s(D6,"append_stylesheet");function L(n,e,t){n.insertBefore(e,t||null)}s(L,"insert");function F(n){n.parentNode&&n.parentNode.removeChild(n)}s(F,"detach");function ui(n,e){for(let t=0;tn.removeEventListener(e,t,i)}s(Le,"listen");function lg(n){return function(e){return e.stopPropagation(),n.call(this,e)}}s(lg,"stop_propagation");function T(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}s(T,"attr");function ko(n){return n===""?null:+n}s(ko,"to_number");function F6(n){return Array.from(n.childNodes)}s(F6,"children");function ot(n,e){e=""+e,n.data!==e&&(n.data=e)}s(ot,"set_data");function bt(n,e){n.value=e??""}s(bt,"set_input_value");function Ge(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}s(Ge,"set_style");function cg(n,e,{bubbles:t=!1,cancelable:i=!1}={}){let r=document.createEvent("CustomEvent");return r.initCustomEvent(n,t,i,e),r}s(cg,"custom_event");var Rs=class{constructor(e=!1){this.is_svg=!1,this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,t,i=null){this.e||(this.is_svg?this.e=M6(t.nodeName):this.e=P(t.nodeType===11?"TEMPLATE":t.nodeName),this.t=t.tagName!=="TEMPLATE"?t:t.content,this.c(e)),this.i(i)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let t=0;t>>0}s(L6,"hash");function P6(n,e){let t={stylesheet:R6(e),rules:{}};return gc.set(n,t),t}s(P6,"create_style_information");function ug(n,e,t,i,r,a,o,l=0){let u=16.666/i,c=`{ +`;for(let h=0;h<=1;h+=u){let v=e+(t-e)*a(h);c+=h*100+`%{${o(v,1-v)}} +`}let d=c+`100% {${o(t,1-t)}} +}`,m=`__svelte_${L6(d)}_${l}`,p=sg(n),{stylesheet:f,rules:_}=gc.get(p)||P6(p,n);_[m]||(_[m]=!0,f.insertRule(`@keyframes ${m} ${d}`,f.cssRules.length));let g=n.style.animation||"";return n.style.animation=`${g?`${g}, `:""}${m} ${i}ms linear ${r}ms 1 both`,hc+=1,m}s(ug,"create_rule");function uf(n,e){let t=(n.style.animation||"").split(", "),i=t.filter(e?a=>a.indexOf(e)<0:a=>a.indexOf("__svelte")===-1),r=t.length-i.length;r&&(n.style.animation=i.join(", "),hc-=r,hc||V6())}s(uf,"delete_rule");function V6(){_f(()=>{hc||(gc.forEach(n=>{let{ownerNode:e}=n.stylesheet;e&&F(e)}),gc.clear())})}s(V6,"clear_rules");function Ls(n,e,t,i){if(!e)return ue;let r=n.getBoundingClientRect();if(e.left===r.left&&e.right===r.right&&e.top===r.top&&e.bottom===r.bottom)return ue;let{delay:a=0,duration:o=300,easing:l=Fs,start:u=ng()+a,end:c=u+o,tick:d=ue,css:m}=t(n,{from:e,to:r},i),p=!0,f=!1,_;function g(){m&&(_=ug(n,0,1,o,a,l,m)),a||(f=!0)}s(g,"start");function h(){m&&uf(n,_),p=!1}return s(h,"stop"),rg(v=>{if(!f&&v>=u&&(f=!0),f&&v>=c&&(d(1,0),h()),!p)return!1;if(f){let y=v-u,k=0+1*l(y/o);d(k,1-k)}return!0}),g(),d(0,1),h}s(Ls,"create_animation");function Ps(n){let e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){let{width:t,height:i}=e,r=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,z6(n,r)}}s(Ps,"fix_position");function z6(n,e){let t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){let i=getComputedStyle(n),r=i.transform==="none"?"":i.transform;n.style.transform=`${r} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}s(z6,"add_transform");var Ms;function Ds(n){Ms=n}s(Ds,"set_current_component");function dg(){if(!Ms)throw new Error("Function called outside component initialization");return Ms}s(dg,"get_current_component");function gf(n){dg().$$.on_destroy.push(n)}s(gf,"onDestroy");function hf(){let n=dg();return(e,t,{cancelable:i=!1}={})=>{let r=n.$$.callbacks[e];if(r){let a=cg(e,t,{cancelable:i});return r.slice().forEach(o=>{o.call(n,a)}),!a.defaultPrevented}return!0}}s(hf,"createEventDispatcher");var bo=[];var le=[],wo=[],df=[],G6=Promise.resolve(),ff=!1;function U6(){ff||(ff=!0,G6.then(fg))}s(U6,"schedule_update");function Fr(n){wo.push(n)}s(Fr,"add_render_callback");function ye(n){df.push(n)}s(ye,"add_flush_callback");var cf=new Set,ho=0;function fg(){if(ho!==0)return;let n=Ms;do{try{for(;hon.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),wo=e}s(H6,"flush_render_callbacks");var Bs;function $6(){return Bs||(Bs=Promise.resolve(),Bs.then(()=>{Bs=null})),Bs}s($6,"wait");function q_(n,e,t){n.dispatchEvent(cg(`${e?"intro":"outro"}${t}`))}s(q_,"dispatch");var _c=new Set,Da;function Et(){Da={r:0,c:[],p:Da}}s(Et,"group_outros");function Tt(){Da.r||Lt(Da.c),Da=Da.p}s(Tt,"check_outros");function q(n,e){n&&n.i&&(_c.delete(n),n.i(e))}s(q,"transition_in");function Z(n,e,t,i){if(n&&n.o){if(_c.has(n))return;_c.add(n),Da.c.push(()=>{_c.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}s(Z,"transition_out");var q6={duration:0};function Vs(n,e,t){let i={direction:"in"},r=e(n,t,i),a=!1,o,l,u=0;function c(){o&&uf(n,o)}s(c,"cleanup");function d(){let{delay:p=0,duration:f=300,easing:_=Fs,tick:g=ue,css:h}=r||q6;h&&(o=ug(n,0,1,f,p,_,h,u++)),g(0,1);let v=ng()+p,y=v+f;l&&l.abort(),a=!0,Fr(()=>q_(n,!0,"start")),l=rg(k=>{if(a){if(k>=y)return g(1,0),q_(n,!0,"end"),c(),a=!1;if(k>=v){let b=_((k-v)/f);g(b,1-b)}}return a})}s(d,"go");let m=!1;return{start(){m||(m=!0,uf(n),Rn(r)?(r=r(i),$6().then(d)):d())},invalidate(){m=!1},end(){a&&(c(),a=!1)}}}s(Vs,"create_in_transition");function K6(n,e){n.d(1),e.delete(n.key)}s(K6,"destroy_block");function zs(n,e){n.f(),K6(n,e)}s(zs,"fix_and_destroy_block");function Gs(n,e,t,i,r,a,o,l,u,c,d,m){let p=n.length,f=a.length,_=p,g={};for(;_--;)g[n[_].key]=_;let h=[],v=new Map,y=new Map,k=[];for(_=f;_--;){let C=m(r,a,_),j=t(C),S=o.get(j);S?i&&k.push(()=>S.p(C,e)):(S=c(j,C),S.c()),v.set(j,h[_]=S),j in g&&y.set(j,Math.abs(_-g[j]))}let b=new Set,x=new Set;function E(C){q(C,1),C.m(l,d),o.set(C.key,C),d=C.first,f--}for(s(E,"insert");p&&f;){let C=h[f-1],j=n[p-1],S=C.key,B=j.key;C===j?(d=C.first,p--,f--):v.has(B)?!o.has(S)||b.has(S)?E(C):x.has(B)?p--:y.get(S)>y.get(B)?(x.add(S),E(C)):(b.add(B),p--):(u(j,o),p--)}for(;p--;){let C=n[p];v.has(C.key)||u(C,o)}for(;f;)E(h[f-1]);return Lt(k),h}s(Gs,"update_keyed_each");var W6=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],dH=new Set([...W6]);function we(n,e,t){let i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}s(we,"bind");function _e(n){n&&n.c()}s(_e,"create_component");function me(n,e,t,i){let{fragment:r,after_update:a}=n.$$;r&&r.m(e,t),i||Fr(()=>{let o=n.$$.on_mount.map(mf).filter(Rn);n.$$.on_destroy?n.$$.on_destroy.push(...o):Lt(o),n.$$.on_mount=[]}),a.forEach(Fr)}s(me,"mount_component");function de(n,e){let t=n.$$;t.fragment!==null&&(H6(t.after_update),Lt(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}s(de,"destroy_component");function Z6(n,e){n.$$.dirty[0]===-1&&(bo.push(n),U6(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{let _=f.length?f[0]:p;return c.ctx&&r(c.ctx[m],c.ctx[m]=_)&&(!c.skip_bound&&c.bound[m]&&c.bound[m](_),d&&Z6(n,m)),p}):[],c.update(),d=!0,Lt(c.before_update),c.fragment=i?i(c.ctx):!1,e.target){if(e.hydrate){N6();let m=F6(e.target);c.fragment&&c.fragment.l(m),m.forEach(F)}else c.fragment&&c.fragment.c();e.intro&&q(n.$$.fragment),me(n,e.target,e.anchor,e.customElement),B6(),fg()}Ds(u)}s(De,"init");var X6;typeof HTMLElement=="function"&&(X6=s(class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){let{on_mount:n}=this.$$;this.$$.on_disconnect=n.map(mf).filter(Rn);for(let e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(n,e,t){this[n]=t}disconnectedCallback(){Lt(this.$$.on_disconnect)}$destroy(){de(this,1),this.$destroy=ue}$on(n,e){if(!Rn(e))return ue;let t=this.$$.callbacks[n]||(this.$$.callbacks[n]=[]);return t.push(e),()=>{let i=t.indexOf(e);i!==-1&&t.splice(i,1)}}$set(n){this.$$set&&!W_(n)&&(this.$$.skip_bound=!0,this.$$set(n),this.$$.skip_bound=!1)}},"SvelteElement"));var Be=class{$destroy(){de(this,1),this.$destroy=ue}$on(e,t){if(!Rn(t))return ue;let i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{let r=i.indexOf(t);r!==-1&&i.splice(r,1)}}$set(e){this.$$set&&!W_(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};s(Be,"SvelteComponent");var Eo=[];function mg(n,e=ue){let t,i=new Set;function r(l){if(Oe(n,l)&&(n=l,t)){let u=!Eo.length;for(let c of i)c[1](),Eo.push(c,n);if(u){for(let c=0;c{i.delete(c),i.size===0&&t&&(t(),t=null)}}return s(o,"subscribe"),{set:r,update:a,subscribe:o}}s(mg,"writable");var bf=class{store;valueValidator;constructor(e,t){this.store=mg(e),this.valueValidator=t||(i=>i),bf.all.push(this)}get(){return this.valueValidator(pf(this.store))}set(e){return this.store.set(this.valueValidator(e))}update(e){return this.store.update(t=>this.valueValidator(e(t)))}subscribe(e,t){return this.store.subscribe(e,t)}},ge=bf;s(ge,"Valuable"),kt(ge,"all",[]);var zt={export_namespace:"blueprint",show_bounding_box:!1,auto_bounding_box:!0,bounding_box:[48,48],enable_plugin_mode:!1,resource_pack_export_mode:"raw",data_pack_export_mode:"raw",display_item:"minecraft:white_dye",custom_model_data_offset:0,enable_advanced_resource_pack_settings:!1,enable_advanced_resource_pack_folders:!1,resource_pack:"",display_item_path:"",model_folder:"",texture_folder:"",enable_advanced_data_pack_settings:!1,data_pack:"",summon_commands:"",ticking_commands:"",interpolation_duration:1,teleportation_duration:1,use_storage_for_animation:!1,baked_animations:!0,json_file:""},Pr=new ge({});var pg='data:image/svg+xml,%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A';var Li='data:image/svg+xml,%0D%0A%09%0D%0A%09%0D%0A%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%0D%0A%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%0D%0A%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%0D%0A%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%0D%0A%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%0D%0A%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%0D%0A%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%09%0D%0A%09%09%0D%0A%09%0D%0A%09%0D%0A%0D%0A%09%0D%0A';function tM(n){let e,t;return{c(){e=P("img"),Yt(e.src,t=Li)||T(e,"src",t),T(e,"alt",""),T(e,"class","svelte-uye5l3")},m(i,r){L(i,e,r)},p:ue,d(i){i&&F(e)}}}s(tM,"create_else_block");function nM(n){let e,t;return{c(){e=P("img"),Yt(e.src,t=pg)||T(e,"src",t),T(e,"alt",""),T(e,"class","svelte-uye5l3")},m(i,r){L(i,e,r)},p:ue,d(i){i&&F(e)}}}s(nM,"create_if_block");function iM(n){let e;function t(a,o){return a[1]?nM:tM}s(t,"select_block_type");let i=t(n,-1),r=i(n);return{c(){r.c(),e=Dt()},m(a,o){r.m(a,o),L(a,e,o)},p(a,[o]){i===(i=t(a,o))&&r?r.p(a,o):(r.d(1),r=i(a),r&&(r.c(),r.m(e.parentNode,e)))},i:ue,o:ue,d(a){r.d(a),a&&F(e)}}}s(iM,"create_fragment");function rM(n,e,t){let i,r=ue,a=s(()=>(r(),r=ze(o,l=>t(1,i=l)),o),"$$subscribe_pluginMode");n.$$.on_destroy.push(()=>r());let{pluginMode:o}=e;return a(),n.$$set=l=>{"pluginMode"in l&&a(t(0,o=l.pluginMode))},[o,i]}s(rM,"instance");var bc=class extends Be{constructor(e){super(),De(this,e,rM,iM,Oe,{pluginMode:0})}};s(bc,"ProjectTitle");var _g=bc;(()=>{let n=Blockbench.addCSS("img.svelte-uye5l3{width:20px;height:20px;margin-top:2px;margin-right:2px;border-radius:2px;box-shadow:1px 1px 1px #000000aa}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();function Us(n,e){return new Promise(t=>{let i=setInterval(()=>{let r=n();r!=null&&(clearInterval(i),t(r))},e)})}s(Us,"pollPromise");var vc=class extends Error{constructor(e,t){super(`Mod '${e}' failed to install: ${t.message}`+(t.stack?` +`+t.stack:""))}};s(vc,"BlockbenchModInstallError");var yc=class extends Error{constructor(e,t){super(`Mod '${e}' failed to uninstall: ${t.message}`+(t.stack?` +`+t.stack:""))}};s(yc,"BlockbenchModUninstallError");function $e(n,e,t,i){let r=!1,a;re.INJECT_MODS.subscribe(()=>{console.log(`Injecting BBMod '${n}'`);try{r&&new Error("Mod is already installed!"),a=t(e),r=!0}catch(o){throw new vc(n,o)}console.log("Sucess!")}),re.EXTRACT_MODS.subscribe(()=>{console.log(`Extracting BBMod '${n}'`);try{r||new Error("Mod is not installed!"),i(a),r=!1}catch(o){throw new yc(n,o)}console.log("Sucess!")})}s($e,"createBlockbenchMod");function on(n,e){let t=new Action(n,e);return re.EXTRACT_MODS.subscribe(()=>{t.delete()},!0),t}s(on,"createAction");function hg(n,e){let t=new ModelLoader(n,e);return re.EXTRACT_MODS.subscribe(()=>{t.delete()},!0),t}s(hg,"createModelLoader");function bg(n,e){return new Menu(n,e)}s(bg,"createMenu");function vg(n,e,t){return new BarMenu(n,e,t)}s(vg,"createBarMenu");var gg=new Map;function wc(n,e){let t=gg.get(n),i={value:n[e]};if(t===void 0){let r=new ia,a=new ia;t=[r,a],gg.set(n,t),Object.defineProperty(n,e,{get(){return r.dispatch({storage:i,value:i.value}),i.value},set(o){i.value=o,a.dispatch({storage:i,newValue:o})},configurable:!0}),re.EXTRACT_MODS.subscribe(()=>{let o=n[e];delete n[e],Object.defineProperty(n,e,{value:o,configurable:!0})},!0)}return t}s(wc,"createPropertySubscribable");async function tr(n){return Us(n.elementSelector).then(e=>{let t;n.prepend?t=e.children[0]:n.injectIndex!==void 0&&(t=e.children[n.injectIndex]);let i=new n.component({target:e,anchor:t,props:n.props});return n.postMount&&n.postMount(i),i})}s(tr,"injectSvelteCompomponent");function ra(n){$e(`animated_java:injected_svelte_component[${n.component.name}](${guid()})`,{},()=>{let e;return Us(n.elementSelector).then(t=>{let i;n.prepend&&(i=t.children[0]),e=new n.component({target:t,anchor:i,props:n.props}),n.postMount&&n.postMount(e)}),e},e=>{e&&e.$destroy()})}s(ra,"injectSvelteCompomponentMod");var Ao=ci(Rt("path"),1);var aM="https://launchermeta.mojang.com/mc/game/version_manifest_v2.json",To;async function Vr(){if(To)return To;if(!window.navigator.onLine){if(console.warn("Not connected to the internet! Using last known latest version."),To=Ma(),!To)throw new Error("No internet connection, and no previous latest version cached!");return To}let n;try{n=await fetch(aM)}catch(e){throw new Error(`Failed to fetch latest Minecraft version manifest: ${e.message}`)}if(n&&n.ok){let e=await n.json(),t=e.versions.find(i=>i.id===e.latest.snapshot);if(!t)throw new Error(`Failed to find version data for '${e.latest.snapshot}'`);return To=t,localStorage.setItem("animated_java:minecraftVersion",JSON.stringify(t)),t}throw new Error("Failed to fetch latest Minecraft version manifest.")}s(Vr,"getLatestVersion");function Ma(){let n=localStorage.getItem("animated_java:minecraftVersion");if(n)return JSON.parse(n)}s(Ma,"getCurrentVersion");var oM="https://raw.githubusercontent.com/misode/mcmeta/summary/blocks/data.json",xc=class{defaultStates={};stateValues={};constructor(e){for(let[t,i]of Object.entries(e[1]))this.defaultStates[t]=Fa(i,!1);for(let[t,i]of Object.entries(e[0]))this.stateValues[t]=i.map(r=>Fa(r,!1))}};s(xc,"BlockStateRegistryEntry");var Co={};function sM(){let n=localStorage.getItem("animated_java:blockStateRegistry");if(!n){console.error("BlockState Registry not found in local storage");return}let e=JSON.parse(n);for(let t in e)Co[t]=new xc(e[t])}s(sM,"updateMemoryRegistry");async function vf(){console.log("Updating BlockState Registry...");let n=3;for(;n-->=0;){let e;try{e=await fetch(oM)}catch(t){console.error("Failed to fetch latest BlockState registry:",t)}if(e&&e.ok){let t=await e.json();localStorage.setItem("animated_java:blockStateRegistry",JSON.stringify(t));let i=await Vr();localStorage.setItem("animated_java:blockStateRegistryVersion",JSON.stringify(i)),console.log("BlockState Registry updated!");return}}throw new Error("Failed to fetch latest BlockState registry after 3 retries.")}s(vf,"updateLocalRegistry");async function lM(){if(console.log("Checking if BlockState Registry update..."),!localStorage.getItem("animated_java:blockStateRegistry")){console.log("No BlockState Registry found. Updating..."),await vf();return}let e=localStorage.getItem("animated_java:blockStateRegistryVersion");if(!e){console.log("No BlockState Registry version found. Updating..."),await vf();return}let t=JSON.parse(e),i=await Vr();if(t.id!==i.id){console.log("BlockState Registry is outdated. Updating..."),await vf();return}console.log("BlockState Registry is up to date!"),sM(),requestAnimationFrame(()=>re.BLOCKSTATE_REGISTRY_LOADED.dispatch())}s(lM,"checkForRegistryUpdate");async function kc(n){return Object.keys(Co).length===0?new Promise(e=>{re.BLOCKSTATE_REGISTRY_LOADED.subscribe(()=>{e(Co[n])},!0)}):Co[n]}s(kc,"getBlockState");re.LOAD.subscribe(()=>{lM().catch(n=>{console.error(n)})});function Ht(n){return n.toLowerCase().replace(/[^a-z0-9_\\.]/g,"_").replace(/_+/g,"_")}s(Ht,"toSafeFuntionName");function wr(n,e){let[t,...i]=n.split(":");if(!t)throw new Error(`Invalid resource location: '${n}'`);return i.length===0&&(i=[t],t="minecraft"),`assets/${t}/${e}/${i.join("/")}`}s(wr,"getPathFromResourceLocation");function So(n){let e=xr(n);return!!(e&&e.namespace&&e.resourcePath)}s(So,"isResourcePackPath");function xr(n){n=n.replaceAll(/\\/g,"/");let e=n.split("/"),t=e.indexOf("assets");if(t===-1)return;let i=e.slice(0,t).join("/"),r=e[t+1],a=e.slice(t+3,-1).join("/"),o=Ao.basename(n).split(".").slice(0,-1).join(".");if(o!==o.toLowerCase())return;let l=(r+":"+PathModule.join(a,o)).replaceAll(/\\/g,"/");return{resourcePackRoot:i,namespace:r,resourcePath:a,resourceLocation:l,fileName:o,fileExtension:Ao.extname(n)}}s(xr,"parseResourcePackPath");function jo(n){let[e,...t]=n.split(":");t.length===0&&(t=[e],e="minecraft");let i=t.join(""),r=i.split("/")[0],a=PathModule.parse(i);return{namespace:e,path:i,type:r,dir:a.dir,name:a.name}}s(jo,"parseResourceLocation");function yg(n){let e=Ec(n);return!!(e&&e.namespace&&e.resourcePath)}s(yg,"isDataPackPath");function Ec(n){n=n.replaceAll(/\\/g,"/");let e=n.split("/"),t=e.indexOf("data");if(t===-1)return;let i=e.slice(0,t).join("/"),r=e[t+1],a=e[t+2],o;switch(a){case"tags":o=e.slice(t+4,-1).join("/");break;default:o=e.slice(t+3,-1).join("/");break}let l=Ao.basename(n).split(".").slice(0,-1).join(".");if(l!==l.toLowerCase())return;let u=(r+":"+PathModule.join(o,l)).replaceAll(/\\/g,"/");return{resourcePackRoot:i,namespace:r,resourcePath:o,resourceLocation:u,fileName:l,fileExtension:Ao.extname(n)}}s(Ec,"parseDataPackPath");function wg(n,e){return n.values.forEach(t=>{typeof t=="string"?e.values.some(i=>typeof i=="object"?i.id===t:i===t)||e.values.push(t):e.values.some(i=>typeof i=="object"?i.id===t.id:i===t.id)||e.values.push(t)}),e}s(wg,"mergeTag");function Fa(n,e){return n==="true"?!0:n==="false"?!1:isNaN(Number(n))?e&&n.includes("|")?n.split("|").map(t=>t==="true"?!0:t==="false"?!1:isNaN(Number(t))?t:Number(t)):n:Number(n)}s(Fa,"resolveBlockstateValueType");async function Io(n){let e={};if(n.includes("[")){let i=n.match(/(.+?)\[((?:[^,=[\]]+=[^,=[\]]+,?)+)?]/);if(!i)return;if(i[2]!==void 0){let r=i[2].split(",");for(let a of r){let[o,l]=a.trim().split("=");e[o]=Fa(l,!1)}}n=i[1]}let t=jo(n);return{resource:t,resourceLocation:t.namespace+":"+t.path,states:e,blockStateRegistryEntry:await kc(t.name)}}s(Io,"parseBlock");function xg(n){if(!Project||!n.path)return;let e=pathToName(n.path,!0);if(n.path&&isApp&&!n.no_file){let t=Project;Project.save_path=n.path,Project.name=pathToName(e,!1),addRecentProject({name:e,path:n.path,icon:rt.icon}),setTimeout(()=>{Project===t&&updateRecentProjectThumbnail()},200)}}s(xg,"addProjectToRecentProjects");function kg(n,e){return Math.round(n*10**e)/10**e}s(kg,"roundTo");function aa(n,e){return Math.round(n*e)/e}s(aa,"roundToNth");function Oo(n){return Number((255*n).toFixed(0)).toString(16).padStart(2,"0")}s(Oo,"floatToHex");function Eg(n){let e=n.toRgb();return e.a*255<<24|e.r<<16|e.g<<8|e.b}s(Eg,"tinycolorToDecimal");function Tg(n){n.x===0&&(n.x=1e-5),n.y===0&&(n.y=1e-5),n.z===0&&(n.z=1e-5)}s(Tg,"makeNotZero");function yf(n){for(let e in n)n[e]===void 0?delete n[e]:typeof n[e]=="object"&&yf(n[e]);return n}s(yf,"scrubUndefined");function Cg(n){let e=new Map;function t(i,r){if(!(typeof i!="object"||i===null)){if(e.has(i)){let a=e.get(i),o=s(l=>l?`${l.parent?`${o(l.parent)}.`:""}${l.name}`:"","stringifyNode");throw`Circular reference detected: Value at '${o(r)}' - is also at '${o(a)}'`}e.set(i,r);for(let a in i)t(i[a],{parent:r,name:a});e.delete(i)}}s(t,"itter");try{return t(n,{name:"root"}),!1}catch(i){if(typeof i!="string")throw i;return console.warn(i),!0}}s(cg,"detectCircularReferences");function hc(n){let e=new THREE.Euler().setFromQuaternion(n,"YXZ"),t=new THREE.Vector3(e.x,e.y,e.z).multiplyScalar(180/Math.PI);return t.x*=-1,t.y=t.y*-1+180,t}s(hc,"eulerFromQuaternion");function Ls(n,e){return Object.fromEntries(Object.entries(n).map(([t,i])=>e(t,i)))}s(Ls,"mapObjEntries");var ug="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABgWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kTtIA0EURY+JokjEwhQiFltEK21UxFKiKIKBkETwV7i7MVHIrmE3YmMp2AYs/DRGLWystbWwFQTBD4i1hZWijcj6ZhNIEOPAMIc7cy9v3oNAKWdabuMoWHbBSUxGtdm5ea35hSaCQIAR3XTzseREirrr844Gdd72q6z67/5cbell14QGTXjUzDsF4SXh4Y1CXvGecNhc0dPCZ8J9jhQo/KB0o8yvirM+B1Rm2EklxoTDwlq2ho0aNlccS3hIOJK2bMkPzJY5rXhTsZVbNyt1qh+Glu2ZpNJldzPJFDHiaBiss0qOAv1y2qK4JOQ+Wsff5fvj4jLEtYopjnHWsNB9P2oGv3vrZgYHykmhKDQ9e957DzTvwHfR876OPO/7GIJPcGlX/WslGPkQvVjVIofQvgXnV1XN2IWLbeh8zOuO7kv+/DMZeDuVMc1Bxw20LpT7Vrnn5B5S0qvpa9g/gN6sZC/W+XdLbd/+fVPp3w9iNHKgdXImZAAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAAd0SU1FB+gFAwAFKkpaLkIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAEklEQVQ4y2NgGAWjYBSMAggAAAQQAAGFP6pyAAAAAElFTkSuQmCC";var QR=Project;Project={materials:{}};var zn=new Texture({id:`${_e.name}:transparent_texture`,name:"Transparent"},"797174ae-5c58-4a83-a630-eefd51007c80").fromDataURL(ug),dg=Project.materials[zn.uuid],fg="animated_java:item/transparent";Project=QR;var Oa=class{map;constructor(){this.map=new Map}add(e,t){this.map.set(e,t)}get(e){return this.map.get(e)}has(e){return this.map.has(e)}delete(e){this.map.delete(e)}getMappedTexture(e){let t=this.map.get(e instanceof Texture?e.uuid:e);return t===zn.uuid?zn:Texture.all.find(i=>i.uuid===t)}setMappedTexture(e,t){this.map.set(e.uuid,t.uuid)}toJSON(){return Object.fromEntries(this.map)}static fromJSON(e){let t=new Oa;for(let[i,r]of Object.entries(e))t.add(i,r);return t}copy(){let e=new Oa;return e.map=new Map(this.map),e}};s(Oa,"TextureMap");var mn=class{id;displayName;name;uuid;textureMap;isDefault=!1;generateNameFromDisplayName=!0;excludedNodes=[];constructor(e,t=!1){this.displayName=mn.makeDisplayNameUnique(this,e),this.name=mn.makeNameUnique(this,this.displayName),this.uuid=guid(),this.isDefault=t,this.textureMap=new Oa,this.id=mn.all.length,mn.all.push(this),this.select(),te.CREATE_VARIANT.dispatch(this)}select(){mn.selected&&mn.selected.unselect(),mn.selected=this,Canvas.updateAllFaces(),te.SELECT_VARIANT.dispatch(this)}unselect(){mn.selected=void 0}delete(){if(this.isDefault)return;let e=mn.all.indexOf(this);e>-1&&mn.all.splice(e,1),mn.selected===this&&(this.unselect(),mn.selectDefault()),te.DELETE_VARIANT.dispatch(this)}toJSON(){let e={name:this.name,display_name:this.displayName,uuid:this.uuid,texture_map:Object.fromEntries(this.textureMap.map),excluded_nodes:this.excludedNodes.map(t=>t.value)};return this.isDefault&&(e.is_default=!0),e}duplicate(){let e=new mn(this.displayName,!1);e.uuid=guid(),e.isDefault=!1,e.generateNameFromDisplayName=this.generateNameFromDisplayName,e.textureMap=this.textureMap.copy(),e.excludedNodes=this.excludedNodes.map(t=>({...t})),e.select()}static fromJSON(e,t=!1){let i=new mn(e.display_name,t);i.uuid=e.uuid;for(let[r,a]of Object.entries(e.texture_map))i.textureMap.add(r,a);return i.excludedNodes=e.excluded_nodes.map(r=>{let a=Group.all.find(o=>o.uuid===r);return a?{name:a.name,value:r}:void 0}).filter(Boolean),i}static makeDisplayNameUnique(e,t){if(!mn.all.some(o=>o!==e&&o.displayName===t))return t;let i=1,r=t.match(/\d+$/);r&&(i=parseInt(r[0]),t=t.slice(0,-r[0].length));let a=1e3;for(;a-- >0;){let o=`${t}${i}`;if(!mn.all.some(l=>l!==e&&l.displayName===o))return o;i++}throw new Error("Could not make Variant display name unique!")}static makeNameUnique(e,t){if(t=Rt(t),!mn.all.some(o=>o!==e&&o.name===t))return t;let i=1,r=t.match(/\d+$/);r&&(i=parseInt(r[0]),t=t.slice(0,-r[0].length));let a=1e3;for(;a-- >0;){let o=`${t}${i}`;if(!mn.all.some(l=>l!==e&&l.name===o))return o;i++}throw new Error("Could not make Variant name unique!")}static selectDefault(){let e=mn.all.find(t=>t.isDefault);e&&e.select()}static getDefault(){return mn.all.find(e=>e.isDefault)??mn.all[0]}},Se=mn;s(Se,"Variant"),ht(Se,"all",[]),ht(Se,"selected");te.SELECT_PROJECT.subscribe(n=>{n.variants??=[],Se.all=n.variants});te.UNSELECT_PROJECT.subscribe(()=>{Se.all=[]});function e6(n){let e,t,i,r,a,o,l,c,u,d,m,p,f,_,v,g;return{c(){e=V("p"),e.textContent="Create advanced animated models for Vanilla Java Edition",t=K(),i=V("p"),i.innerHTML=`Target: - Minecraft: Java Edition`,r=K(),a=V("h3"),a.innerHTML='

      Getting Started

      ',o=K(),l=V("p"),l.innerHTML='Check out the Docs to learn how to use Animated Java.',c=K(),u=V("h3"),u.innerHTML='

      Good to know:

      ',d=K(),m=V("ul"),m.innerHTML=`
    • The rotations of elements are limited to 22.5 degree steps, and only one axis can be rotated + is also at '${o(a)}'`}e.set(i,r);for(let a in i)t(i[a],{parent:r,name:a});e.delete(i)}}s(t,"itter");try{return t(n,{name:"root"}),!1}catch(i){if(typeof i!="string")throw i;return console.warn(i),!0}}s(Cg,"detectCircularReferences");function Tc(n){let e=new THREE.Euler().setFromQuaternion(n,"YXZ"),t=new THREE.Vector3(e.x,e.y,e.z).multiplyScalar(180/Math.PI);return t.x*=-1,t.y=t.y*-1+180,t}s(Tc,"eulerFromQuaternion");function Js(n,e){return Object.fromEntries(Object.entries(n).map(([t,i])=>e(t,i)))}s(Js,"mapObjEntries");var Ag="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABgWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kTtIA0EURY+JokjEwhQiFltEK21UxFKiKIKBkETwV7i7MVHIrmE3YmMp2AYs/DRGLWystbWwFQTBD4i1hZWijcj6ZhNIEOPAMIc7cy9v3oNAKWdabuMoWHbBSUxGtdm5ea35hSaCQIAR3XTzseREirrr844Gdd72q6z67/5cbell14QGTXjUzDsF4SXh4Y1CXvGecNhc0dPCZ8J9jhQo/KB0o8yvirM+B1Rm2EklxoTDwlq2ho0aNlccS3hIOJK2bMkPzJY5rXhTsZVbNyt1qh+Glu2ZpNJldzPJFDHiaBiss0qOAv1y2qK4JOQ+Wsff5fvj4jLEtYopjnHWsNB9P2oGv3vrZgYHykmhKDQ9e957DzTvwHfR876OPO/7GIJPcGlX/WslGPkQvVjVIofQvgXnV1XN2IWLbeh8zOuO7kv+/DMZeDuVMc1Bxw20LpT7Vrnn5B5S0qvpa9g/gN6sZC/W+XdLbd/+fVPp3w9iNHKgdXImZAAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAAd0SU1FB+gFAwAFKkpaLkIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAEklEQVQ4y2NgGAWjYBSMAggAAAQQAAGFP6pyAAAAAElFTkSuQmCC";var uM=Project;Project={materials:{}};var Hn=new Texture({id:`${ke.name}:transparent_texture`,name:"Transparent"},"797174ae-5c58-4a83-a630-eefd51007c80").fromDataURL(Ag),Sg=Project.materials[Hn.uuid],jg="animated_java:item/transparent";Project=uM;var La=class{map;constructor(){this.map=new Map}add(e,t){this.map.set(e,t)}get(e){return this.map.get(e)}has(e){return this.map.has(e)}delete(e){this.map.delete(e)}getMappedTexture(e){let t=this.map.get(e instanceof Texture?e.uuid:e);return t===Hn.uuid?Hn:Texture.all.find(i=>i.uuid===t)}setMappedTexture(e,t){this.map.set(e.uuid,t.uuid)}toJSON(){return Object.fromEntries(this.map)}static fromJSON(e){let t=new La;for(let[i,r]of Object.entries(e))t.add(i,r);return t}copy(){let e=new La;return e.map=new Map(this.map),e}verifyTextures(){for(let[e,t]of this.map)Texture.all.some(i=>i.uuid===t)||this.map.delete(e)}};s(La,"TextureMap");var vn=class{id;displayName;name;uuid;textureMap;isDefault=!1;generateNameFromDisplayName=!0;excludedNodes=[];constructor(e,t=!1){this.displayName=vn.makeDisplayNameUnique(this,e),this.name=vn.makeNameUnique(this,this.displayName),this.uuid=guid(),this.isDefault=t,this.textureMap=new La,this.id=vn.all.length,vn.all.push(this),this.select(),re.CREATE_VARIANT.dispatch(this)}select(){vn.selected&&vn.selected.unselect(),vn.selected=this,Canvas.updateAllFaces(),re.SELECT_VARIANT.dispatch(this)}unselect(){vn.selected=void 0}delete(){if(this.isDefault)return;let e=vn.all.indexOf(this);e>-1&&vn.all.splice(e,1),vn.selected===this&&(this.unselect(),vn.selectDefault()),re.DELETE_VARIANT.dispatch(this)}toJSON(){let e={name:this.name,display_name:this.displayName,uuid:this.uuid,texture_map:Object.fromEntries(this.textureMap.map),excluded_nodes:this.excludedNodes.map(t=>t.value)};return this.isDefault&&(e.is_default=!0),e}duplicate(){let e=new vn(this.displayName,!1);e.uuid=guid(),e.isDefault=!1,e.generateNameFromDisplayName=this.generateNameFromDisplayName,e.textureMap=this.textureMap.copy(),e.excludedNodes=this.excludedNodes.map(t=>({...t})),e.select()}verifyTextureMap(){this.textureMap.verifyTextures()}static fromJSON(e,t=!1){let i=new vn(e.display_name,t);i.uuid=e.uuid;for(let[r,a]of Object.entries(e.texture_map))i.textureMap.add(r,a);return i.excludedNodes=e.excluded_nodes.map(r=>{let a=Group.all.find(o=>o.uuid===r);return a?{name:a.name,value:r}:void 0}).filter(Boolean),i}static makeDisplayNameUnique(e,t){if(!vn.all.some(o=>o!==e&&o.displayName===t))return t;let i=1,r=t.match(/\d+$/);r&&(i=parseInt(r[0]),t=t.slice(0,-r[0].length));let a=1e3;for(;a-- >0;){let o=`${t}${i}`;if(!vn.all.some(l=>l!==e&&l.displayName===o))return o;i++}throw new Error("Could not make Variant display name unique!")}static makeNameUnique(e,t){if(t=Ht(t),!vn.all.some(o=>o!==e&&o.name===t))return t;let i=1,r=t.match(/\d+$/);r&&(i=parseInt(r[0]),t=t.slice(0,-r[0].length));let a=1e3;for(;a-- >0;){let o=`${t}${i}`;if(!vn.all.some(l=>l!==e&&l.name===o))return o;i++}throw new Error("Could not make Variant name unique!")}static selectDefault(){let e=vn.all.find(t=>t.isDefault);e&&e.select()}static getDefault(){return vn.all.find(e=>e.isDefault)??vn.all[0]}},Ne=vn;s(Ne,"Variant"),kt(Ne,"all",[]),kt(Ne,"selected");re.SELECT_PROJECT.subscribe(n=>{n.variants??=[],Ne.all=n.variants});re.UNSELECT_PROJECT.subscribe(()=>{Ne.all=[]});function dM(n){let e,t,i,r,a,o,l,u,c,d,m,p,f,_,g,h;return{c(){e=P("p"),e.textContent="Create advanced animated models for Vanilla Java Edition",t=G(),i=P("p"),i.innerHTML=`Target: + Minecraft: Java Edition`,r=G(),a=P("h3"),a.innerHTML='

      Getting Started

      ',o=G(),l=P("p"),l.innerHTML='Check out the Docs to learn how to use Animated Java.',u=G(),c=P("h3"),c.innerHTML='

      Good to know:

      ',d=G(),m=P("ul"),m.innerHTML=`
    • The rotations of elements are limited to 22.5 degree steps, and only one axis can be rotated at a time. However, the rotation of bones is not restricted.
    • -
    • Documentation for Animated Java can be found at https://animated-java.dev/docs
    • `,p=K(),f=V("div"),_=V("button"),_.innerHTML=`arrow_forward - Create new AJ Blueprint`,T(e,"class","format_description"),T(i,"class","format_target"),T(a,"class","markdown"),T(u,"class","markdown"),T(m,"class","markdown"),T(_,"class","svelte-15sooy0"),T(f,"class","button_bar")},m(h,b){G(h,e,b),G(h,t,b),G(h,i,b),G(h,r,b),G(h,a,b),G(h,o,b),G(h,l,b),G(h,c,b),G(h,u,b),G(h,d,b),G(h,m,b),G(h,p,b),G(h,f,b),N(f,_),v||(g=De(_,"click",n[1]),v=!0)},p:re,i:re,o:re,d(h){h&&z(e),h&&z(t),h&&z(i),h&&z(r),h&&z(a),h&&z(o),h&&z(l),h&&z(c),h&&z(u),h&&z(d),h&&z(m),h&&z(p),h&&z(f),v=!1,g()}}}s(e6,"create_fragment");function t6(n){let e=document.querySelector("#format_page_animated_java_blueprint")?.children[1];if(e){let r=e.parentElement?.id;if(!e.children.namedItem("format_icon")){let a=new Image(48,48);a.id="format_icon",a.src=Oi,a.style.marginRight="16px",a.style.borderRadius="6px",a.style.boxShadow="2px 2px 2px #000000aa",e.prepend(a),r=void 0,setInterval(()=>{e.parentElement?.id!==r&&(e.parentElement?.id==="format_page_animated_java_blueprint"?(a.style.display="block",e.style.display="flex",e.style.alignItems="center",e.style.fontWeight="normal"):(a.style.display="none",e.style.fontWeight="lighter"),r=e.parentElement?.id)},16)}}else throw new Error("Format page title not found!");function t(){newProject(et),requestAnimationFrame(()=>{Project.openSettings()})}return s(t,"createBlueprint"),[t,s(()=>t(),"click_handler")]}s(t6,"instance");var bc=class extends je{constructor(e){super(),Ie(this,e,t6,e6,Ae,{})}};s(bc,"FormatPage");var mg=bc;(()=>{let n=Blockbench.addCSS("button.svelte-15sooy0{width:100%;height:40px}li.svelte-15sooy0{margin-left:24px}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();function pg(n){var e=n.slice(0,2);return e.length===2&&e[0]===31&&e[1]===139}s(pg,"hasGzipHeader");function _g(n){let e=n.slice(0,2);return e.length===2&&e[0]===120&&(e[1]===1||e[1]===94||e[1]===156||e[2]===218)}s(_g,"hasZlibHeader");function gg(n){let e=n.slice(0,8),t=new DataView(e.buffer,e.byteOffset),i=t.getUint32(0,!0),r=t.getUint32(4,!0);if(e.length===8&&i>0&&i<100&&r===n.byteLength-8)return i}s(gg,"getBedrockHeader");function hg(n){var e=[],t,i;for(t=0;t>6),e.push(128|i&63)):i<65536?(e.push(224|i>>12),e.push(128|i>>6&63),e.push(128|i&63)):(e.push(240|i>>18&7),e.push(128|i>>12&63),e.push(128|i>>6&63),e.push(128|i&63));return e}s(hg,"encodeUTF8");function bg(n){var e=[],t;for(t=0;t=t)return;let i=this.buffer.byteLength;for(;ithis.buffer.byteLength&&a.fill(0,this.buffer.byteLength,this.offset),this.buffer=r,this.view=new DataView(r),this.array=a}writeNumber(e,t,i){this.accommodate(t),this.view[e](this.offset,i,this.littleEndian),this.offset+=t}writeByte=this.writeNumber.bind(this,"setInt8",1);writeShort=this.writeNumber.bind(this,"setInt16",2);writeInt=this.writeNumber.bind(this,"setInt32",4);writeFloat=this.writeNumber.bind(this,"setFloat32",4);writeDouble=this.writeNumber.bind(this,"setFloat64",8);writeBytes(e){this.accommodate(e.length),this.array.set(e,this.offset),this.offset+=e.length}writeString(e){let t=hg(e);this.writeShort(t.length),this.writeBytes(t)}getData(){return this.accommodate(0),this.array.slice(0,this.offset)}};s(Vs,"RawDataOutput");var nt;(function(n){function e(m){return typeof m=="number"?m:void 0}s(e,"readNumber"),n.readNumber=e;function t(m){return typeof m=="number"?Math.floor(m):void 0}s(t,"readInt"),n.readInt=t;function i(m){return typeof m=="string"?m:void 0}s(i,"readString"),n.readString=i;function r(m){return typeof m=="boolean"?m:void 0}s(r,"readBoolean"),n.readBoolean=r;function a(m){return typeof m=="object"&&m!==null&&!Array.isArray(m)?m:void 0}s(a,"readObject"),n.readObject=a;function o(m,p){if(Array.isArray(m))return p?m.map(f=>p(f)):m}s(o,"readArray"),n.readArray=o;function l(m,p){if(Array.isArray(m))return[0,1].map(f=>p(m[f]))}s(l,"readPair"),n.readPair=l;function c(m,p){let f=a(m)??{};return Object.fromEntries(Object.entries(f).map(([_,v])=>[_,p(v)]))}s(c,"readMap"),n.readMap=c;function u(m,p,f){let _=p(m);return _?f(_):void 0}s(u,"compose"),n.compose=u;function d(m,p){return typeof m!="string"?p[0]:p.includes(m)?m:p[0]}s(d,"readEnum"),n.readEnum=d})(nt||(nt={}));var Un=class{source;cursor;constructor(e){this.source=e,this.cursor=0}get remainingLength(){return this.source.length-this.cursor}get totalLength(){return this.source.length}getRead(e=0){return this.source.substring(e,this.cursor)}getRemaining(){return this.source.substring(this.cursor)}canRead(e=1){return this.cursor+e<=this.source.length}peek(e=0){return this.source.charAt(this.cursor+e)}read(){return this.source.charAt(this.cursor++)}skip(){this.cursor+=1}skipWhitespace(){for(;this.canRead()&&Un.isWhitespace(this.peek());)this.skip()}expect(e,t=!1){if(t&&this.skipWhitespace(),!this.canRead()||this.peek()!==e)throw this.createError(`Expected '${e}'`);this.skip()}readInt(){let e=this.cursor;for(;this.canRead()&&Un.isAllowedInNumber(this.peek());)this.skip();let t=this.getRead(e);if(t.length===0)throw this.createError("Expected integer");try{let i=Number(t);if(isNaN(i)||!Number.isInteger(i))throw new Error;return i}catch{throw this.cursor=e,this.createError(`Invalid integer '${t}'`)}}readFloat(){let e=this.cursor;for(;this.canRead()&&Un.isAllowedInNumber(this.peek());)this.skip();let t=this.getRead(e);if(t.length===0)throw this.createError("Expected float");try{let i=Number(t);if(isNaN(i))throw new Error;return i}catch{throw this.cursor=e,this.createError(`Invalid float '${t}'`)}}readUnquotedString(){let e=this.cursor;for(;this.canRead()&&Un.isAllowedInUnquotedString(this.peek());)this.skip();return this.getRead(e)}readQuotedString(){if(!this.canRead())return"";let e=this.peek();if(!Un.isQuotedStringStart(e))throw this.createError("Expected quote to start a string");return this.skip(),this.readStringUntil(e)}readString(){if(!this.canRead())return"";let e=this.peek();return Un.isQuotedStringStart(e)?(this.skip(),this.readStringUntil(e)):this.readUnquotedString()}readStringUntil(e){let t=[],i=!1;for(;this.canRead();){let r=this.read();if(i)if(r===e||r==="\\")t.push(r),i=!1;else throw this.cursor-=1,this.createError(`Invalid escape sequence '${r}' in quoted string`);else if(r==="\\")i=!0;else{if(r===e)return t.join("");t.push(r)}}throw this.createError("Unclosed quoted string")}readBoolean(){let e=this.cursor,t=this.readUnquotedString();if(t.length===0)throw this.createError("Expected bool");if(t==="true")return!0;if(t==="false")return!1;throw this.cursor=e,this.createError(`Invalid bool, expected true or false but found '${t}'`)}static isAllowedInNumber(e){return e>="0"&&e<="9"||e==="."||e==="-"}static isAllowedInUnquotedString(e){return e>="0"&&e<="9"||e>="A"&&e<="Z"||e>="a"&&e<="z"||e==="_"||e==="-"||e==="."||e==="+"}static isQuotedStringStart(e){return e==="'"||e==='"'}static isWhitespace(e){return e===" "||e===" "||e===` -`||e==="\r"}createError(e){let t=Math.min(this.source.length,this.cursor),i=(t>10?"...":"")+this.source.substring(Math.max(0,t-10),t);return new Error(`${e} at position ${this.cursor}: ${i}<--[HERE]`)}};s(Un,"StringReader");function jo(n){let e=n.length;for(;--e>=0;)n[e]=0}s(jo,"zero$1");var n6=0,ih=1,i6=2,r6=3,a6=258,Nf=29,tl=256,Ks=tl+1+Nf,Co=30,Bf=19,rh=2*Ks+1,Na=15,cf=16,o6=7,Df=256,ah=16,oh=17,sh=18,kf=new Uint8Array([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]),Ec=new Uint8Array([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]),s6=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),lh=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),l6=512,Lr=new Array((Ks+2)*2);jo(Lr);var Js=new Array(Co*2);jo(Js);var qs=new Array(l6);jo(qs);var Ws=new Array(a6-r6+1);jo(Ws);var Rf=new Array(Nf);jo(Rf);var Tc=new Array(Co);jo(Tc);function uf(n,e,t,i,r){this.static_tree=n,this.extra_bits=e,this.extra_base=t,this.elems=i,this.max_length=r,this.has_stree=n&&n.length}s(uf,"StaticTreeDesc");var ch,uh,dh;function df(n,e){this.dyn_tree=n,this.max_code=0,this.stat_desc=e}s(df,"TreeDesc");var fh=s(n=>n<256?qs[n]:qs[256+(n>>>7)],"d_code"),Zs=s((n,e)=>{n.pending_buf[n.pending++]=e&255,n.pending_buf[n.pending++]=e>>>8&255},"put_short"),di=s((n,e,t)=>{n.bi_valid>cf-t?(n.bi_buf|=e<>cf-n.bi_valid,n.bi_valid+=t-cf):(n.bi_buf|=e<{di(n,t[e*2],t[e*2+1])},"send_code"),mh=s((n,e)=>{let t=0;do t|=n&1,n>>>=1,t<<=1;while(--e>0);return t>>>1},"bi_reverse"),c6=s(n=>{n.bi_valid===16?(Zs(n,n.bi_buf),n.bi_buf=0,n.bi_valid=0):n.bi_valid>=8&&(n.pending_buf[n.pending++]=n.bi_buf&255,n.bi_buf>>=8,n.bi_valid-=8)},"bi_flush"),u6=s((n,e)=>{let t=e.dyn_tree,i=e.max_code,r=e.stat_desc.static_tree,a=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,l=e.stat_desc.extra_base,c=e.stat_desc.max_length,u,d,m,p,f,_,v=0;for(p=0;p<=Na;p++)n.bl_count[p]=0;for(t[n.heap[n.heap_max]*2+1]=0,u=n.heap_max+1;uc&&(p=c,v++),t[d*2+1]=p,!(d>i)&&(n.bl_count[p]++,f=0,d>=l&&(f=o[d-l]),_=t[d*2],n.opt_len+=_*(p+f),a&&(n.static_len+=_*(r[d*2+1]+f)));if(v!==0){do{for(p=c-1;n.bl_count[p]===0;)p--;n.bl_count[p]--,n.bl_count[p+1]+=2,n.bl_count[c]--,v-=2}while(v>0);for(p=c;p!==0;p--)for(d=n.bl_count[p];d!==0;)m=n.heap[--u],!(m>i)&&(t[m*2+1]!==p&&(n.opt_len+=(p-t[m*2+1])*t[m*2],t[m*2+1]=p),d--)}},"gen_bitlen"),ph=s((n,e,t)=>{let i=new Array(Na+1),r=0,a,o;for(a=1;a<=Na;a++)r=r+t[a-1]<<1,i[a]=r;for(o=0;o<=e;o++){let l=n[o*2+1];l!==0&&(n[o*2]=mh(i[l]++,l))}},"gen_codes"),d6=s(()=>{let n,e,t,i,r,a=new Array(Na+1);for(t=0,i=0;i>=7;i{let e;for(e=0;e{n.bi_valid>8?Zs(n,n.bi_buf):n.bi_valid>0&&(n.pending_buf[n.pending++]=n.bi_buf),n.bi_buf=0,n.bi_valid=0},"bi_windup"),vg=s((n,e,t,i)=>{let r=e*2,a=t*2;return n[r]{let i=n.heap[t],r=t<<1;for(;r<=n.heap_len&&(r{let i,r,a=0,o,l;if(n.sym_next!==0)do i=n.pending_buf[n.sym_buf+a++]&255,i+=(n.pending_buf[n.sym_buf+a++]&255)<<8,r=n.pending_buf[n.sym_buf+a++],i===0?yr(n,r,e):(o=Ws[r],yr(n,o+tl+1,e),l=kf[o],l!==0&&(r-=Rf[o],di(n,r,l)),i--,o=fh(i),yr(n,o,t),l=Ec[o],l!==0&&(i-=Tc[o],di(n,i,l)));while(a{let t=e.dyn_tree,i=e.stat_desc.static_tree,r=e.stat_desc.has_stree,a=e.stat_desc.elems,o,l,c=-1,u;for(n.heap_len=0,n.heap_max=rh,o=0;o>1;o>=1;o--)ff(n,t,o);u=a;do o=n.heap[1],n.heap[1]=n.heap[n.heap_len--],ff(n,t,1),l=n.heap[1],n.heap[--n.heap_max]=o,n.heap[--n.heap_max]=l,t[u*2]=t[o*2]+t[l*2],n.depth[u]=(n.depth[o]>=n.depth[l]?n.depth[o]:n.depth[l])+1,t[o*2+1]=t[l*2+1]=u,n.heap[1]=u++,ff(n,t,1);while(n.heap_len>=2);n.heap[--n.heap_max]=n.heap[1],u6(n,e),ph(t,c,n.bl_count)},"build_tree"),wg=s((n,e,t)=>{let i,r=-1,a,o=e[0*2+1],l=0,c=7,u=4;for(o===0&&(c=138,u=3),e[(t+1)*2+1]=65535,i=0;i<=t;i++)a=o,o=e[(i+1)*2+1],!(++l{let i,r=-1,a,o=e[0*2+1],l=0,c=7,u=4;for(o===0&&(c=138,u=3),i=0;i<=t;i++)if(a=o,o=e[(i+1)*2+1],!(++l{let e;for(wg(n,n.dyn_ltree,n.l_desc.max_code),wg(n,n.dyn_dtree,n.d_desc.max_code),Ef(n,n.bl_desc),e=Bf-1;e>=3&&n.bl_tree[lh[e]*2+1]===0;e--);return n.opt_len+=3*(e+1)+5+5+4,e},"build_bl_tree"),m6=s((n,e,t,i)=>{let r;for(di(n,e-257,5),di(n,t-1,5),di(n,i-4,4),r=0;r{let e=4093624447,t;for(t=0;t<=31;t++,e>>>=1)if(e&1&&n.dyn_ltree[t*2]!==0)return 0;if(n.dyn_ltree[9*2]!==0||n.dyn_ltree[10*2]!==0||n.dyn_ltree[13*2]!==0)return 1;for(t=32;t{kg||(d6(),kg=!0),n.l_desc=new df(n.dyn_ltree,ch),n.d_desc=new df(n.dyn_dtree,uh),n.bl_desc=new df(n.bl_tree,dh),n.bi_buf=0,n.bi_valid=0,_h(n)},"_tr_init$1"),hh=s((n,e,t,i)=>{di(n,(n6<<1)+(i?1:0),3),gh(n),Zs(n,t),Zs(n,~t),t&&n.pending_buf.set(n.window.subarray(e,e+t),n.pending),n.pending+=t},"_tr_stored_block$1"),g6=s(n=>{di(n,ih<<1,3),yr(n,Df,Lr),c6(n)},"_tr_align$1"),h6=s((n,e,t,i)=>{let r,a,o=0;n.level>0?(n.strm.data_type===2&&(n.strm.data_type=p6(n)),Ef(n,n.l_desc),Ef(n,n.d_desc),o=f6(n),r=n.opt_len+3+7>>>3,a=n.static_len+3+7>>>3,a<=r&&(r=a)):r=a=t+5,t+4<=r&&e!==-1?hh(n,e,t,i):n.strategy===4||a===r?(di(n,(ih<<1)+(i?1:0),3),yg(n,Lr,Js)):(di(n,(i6<<1)+(i?1:0),3),m6(n,n.l_desc.max_code+1,n.d_desc.max_code+1,o+1),yg(n,n.dyn_ltree,n.dyn_dtree)),_h(n),i&&gh(n)},"_tr_flush_block$1"),b6=s((n,e,t)=>(n.pending_buf[n.sym_buf+n.sym_next++]=e,n.pending_buf[n.sym_buf+n.sym_next++]=e>>8,n.pending_buf[n.sym_buf+n.sym_next++]=t,e===0?n.dyn_ltree[t*2]++:(n.matches++,e--,n.dyn_ltree[(Ws[t]+tl+1)*2]++,n.dyn_dtree[fh(e)*2]++),n.sym_next===n.sym_end),"_tr_tally$1"),v6=_6,y6=hh,w6=h6,x6=b6,k6=g6,E6={_tr_init:v6,_tr_stored_block:y6,_tr_flush_block:w6,_tr_tally:x6,_tr_align:k6},T6=s((n,e,t,i)=>{let r=n&65535|0,a=n>>>16&65535|0,o=0;for(;t!==0;){o=t>2e3?2e3:t,t-=o;do r=r+e[i++]|0,a=a+r|0;while(--o);r%=65521,a%=65521}return r|a<<16|0},"adler32"),Xs=T6,C6=s(()=>{let n,e=[];for(var t=0;t<256;t++){n=t;for(var i=0;i<8;i++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e},"makeTable"),A6=new Uint32Array(C6()),S6=s((n,e,t,i)=>{let r=A6,a=i+t;n^=-1;for(let o=i;o>>8^r[(n^e[o])&255];return n^-1},"crc32"),Nn=S6,Ra={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"},La={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_MEM_ERROR:-4,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},{_tr_init:j6,_tr_stored_block:Tf,_tr_flush_block:I6,_tr_tally:ia,_tr_align:O6}=E6,{Z_NO_FLUSH:ra,Z_PARTIAL_FLUSH:N6,Z_FULL_FLUSH:B6,Z_FINISH:Ni,Z_BLOCK:Eg,Z_OK:Gn,Z_STREAM_END:Tg,Z_STREAM_ERROR:wr,Z_DATA_ERROR:D6,Z_BUF_ERROR:mf,Z_DEFAULT_COMPRESSION:R6,Z_FILTERED:M6,Z_HUFFMAN_ONLY:vc,Z_RLE:F6,Z_FIXED:L6,Z_DEFAULT_STRATEGY:P6,Z_UNKNOWN:V6,Z_DEFLATED:Sc}=La,z6=9,U6=15,G6=8,J6=29,H6=256,Cf=H6+1+J6,$6=30,K6=19,q6=2*Cf+1,W6=15,Tt=3,na=258,xr=na+Tt+1,Z6=32,Ao=42,Mf=57,Af=69,Sf=73,jf=91,If=103,Ba=113,Us=666,oi=1,Io=2,Ma=3,Oo=4,X6=3,Da=s((n,e)=>(n.msg=Ra[e],e),"err"),Cg=s(n=>n*2-(n>4?9:0),"rank"),ta=s(n=>{let e=n.length;for(;--e>=0;)n[e]=0},"zero"),Y6=s(n=>{let e,t,i,r=n.w_size;e=n.hash_size,i=e;do t=n.head[--i],n.head[i]=t>=r?t-r:0;while(--e);e=r,i=e;do t=n.prev[--i],n.prev[i]=t>=r?t-r:0;while(--e)},"slide_hash"),Q6=s((n,e,t)=>(e<{let e=n.state,t=e.pending;t>n.avail_out&&(t=n.avail_out),t!==0&&(n.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+t),n.next_out),n.next_out+=t,e.pending_out+=t,n.total_out+=t,n.avail_out-=t,e.pending-=t,e.pending===0&&(e.pending_out=0))},"flush_pending"),wi=s((n,e)=>{I6(n,n.block_start>=0?n.block_start:-1,n.strstart-n.block_start,e),n.block_start=n.strstart,yi(n.strm)},"flush_block_only"),Nt=s((n,e)=>{n.pending_buf[n.pending++]=e},"put_byte"),zs=s((n,e)=>{n.pending_buf[n.pending++]=e>>>8&255,n.pending_buf[n.pending++]=e&255},"putShortMSB"),Of=s((n,e,t,i)=>{let r=n.avail_in;return r>i&&(r=i),r===0?0:(n.avail_in-=r,e.set(n.input.subarray(n.next_in,n.next_in+r),t),n.state.wrap===1?n.adler=Xs(n.adler,e,r,t):n.state.wrap===2&&(n.adler=Nn(n.adler,e,r,t)),n.next_in+=r,n.total_in+=r,r)},"read_buf"),bh=s((n,e)=>{let t=n.max_chain_length,i=n.strstart,r,a,o=n.prev_length,l=n.nice_match,c=n.strstart>n.w_size-xr?n.strstart-(n.w_size-xr):0,u=n.window,d=n.w_mask,m=n.prev,p=n.strstart+na,f=u[i+o-1],_=u[i+o];n.prev_length>=n.good_match&&(t>>=2),l>n.lookahead&&(l=n.lookahead);do if(r=e,!(u[r+o]!==_||u[r+o-1]!==f||u[r]!==u[i]||u[++r]!==u[i+1])){i+=2,r++;do;while(u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&io){if(n.match_start=e,o=a,a>=l)break;f=u[i+o-1],_=u[i+o]}}while((e=m[e&d])>c&&--t!==0);return o<=n.lookahead?o:n.lookahead},"longest_match"),So=s(n=>{let e=n.w_size,t,i,r;do{if(i=n.window_size-n.lookahead-n.strstart,n.strstart>=e+(e-xr)&&(n.window.set(n.window.subarray(e,e+e-i),0),n.match_start-=e,n.strstart-=e,n.block_start-=e,n.insert>n.strstart&&(n.insert=n.strstart),Y6(n),i+=e),n.strm.avail_in===0)break;if(t=Of(n.strm,n.window,n.strstart+n.lookahead,i),n.lookahead+=t,n.lookahead+n.insert>=Tt)for(r=n.strstart-n.insert,n.ins_h=n.window[r],n.ins_h=aa(n,n.ins_h,n.window[r+1]);n.insert&&(n.ins_h=aa(n,n.ins_h,n.window[r+Tt-1]),n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++,n.insert--,!(n.lookahead+n.insert{let t=n.pending_buf_size-5>n.w_size?n.w_size:n.pending_buf_size-5,i,r,a,o=0,l=n.strm.avail_in;do{if(i=65535,a=n.bi_valid+42>>3,n.strm.avail_outr+n.strm.avail_in&&(i=r+n.strm.avail_in),i>a&&(i=a),i>8,n.pending_buf[n.pending-2]=~i,n.pending_buf[n.pending-1]=~i>>8,yi(n.strm),r&&(r>i&&(r=i),n.strm.output.set(n.window.subarray(n.block_start,n.block_start+r),n.strm.next_out),n.strm.next_out+=r,n.strm.avail_out-=r,n.strm.total_out+=r,n.block_start+=r,i-=r),i&&(Of(n.strm,n.strm.output,n.strm.next_out,i),n.strm.next_out+=i,n.strm.avail_out-=i,n.strm.total_out+=i)}while(o===0);return l-=n.strm.avail_in,l&&(l>=n.w_size?(n.matches=2,n.window.set(n.strm.input.subarray(n.strm.next_in-n.w_size,n.strm.next_in),0),n.strstart=n.w_size,n.insert=n.strstart):(n.window_size-n.strstart<=l&&(n.strstart-=n.w_size,n.window.set(n.window.subarray(n.w_size,n.w_size+n.strstart),0),n.matches<2&&n.matches++,n.insert>n.strstart&&(n.insert=n.strstart)),n.window.set(n.strm.input.subarray(n.strm.next_in-l,n.strm.next_in),n.strstart),n.strstart+=l,n.insert+=l>n.w_size-n.insert?n.w_size-n.insert:l),n.block_start=n.strstart),n.high_watera&&n.block_start>=n.w_size&&(n.block_start-=n.w_size,n.strstart-=n.w_size,n.window.set(n.window.subarray(n.w_size,n.w_size+n.strstart),0),n.matches<2&&n.matches++,a+=n.w_size,n.insert>n.strstart&&(n.insert=n.strstart)),a>n.strm.avail_in&&(a=n.strm.avail_in),a&&(Of(n.strm,n.window,n.strstart,a),n.strstart+=a,n.insert+=a>n.w_size-n.insert?n.w_size-n.insert:a),n.high_water>3,a=n.pending_buf_size-a>65535?65535:n.pending_buf_size-a,t=a>n.w_size?n.w_size:a,r=n.strstart-n.block_start,(r>=t||(r||e===Ni)&&e!==ra&&n.strm.avail_in===0&&r<=a)&&(i=r>a?a:r,o=e===Ni&&n.strm.avail_in===0&&i===r?1:0,Tf(n,n.block_start,i,o),n.block_start+=i,yi(n.strm)),o?Ma:oi)},"deflate_stored"),pf=s((n,e)=>{let t,i;for(;;){if(n.lookahead=Tt&&(n.ins_h=aa(n,n.ins_h,n.window[n.strstart+Tt-1]),t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart),t!==0&&n.strstart-t<=n.w_size-xr&&(n.match_length=bh(n,t)),n.match_length>=Tt)if(i=ia(n,n.strstart-n.match_start,n.match_length-Tt),n.lookahead-=n.match_length,n.match_length<=n.max_lazy_match&&n.lookahead>=Tt){n.match_length--;do n.strstart++,n.ins_h=aa(n,n.ins_h,n.window[n.strstart+Tt-1]),t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart;while(--n.match_length!==0);n.strstart++}else n.strstart+=n.match_length,n.match_length=0,n.ins_h=n.window[n.strstart],n.ins_h=aa(n,n.ins_h,n.window[n.strstart+1]);else i=ia(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++;if(i&&(wi(n,!1),n.strm.avail_out===0))return oi}return n.insert=n.strstart{let t,i,r;for(;;){if(n.lookahead=Tt&&(n.ins_h=aa(n,n.ins_h,n.window[n.strstart+Tt-1]),t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart),n.prev_length=n.match_length,n.prev_match=n.match_start,n.match_length=Tt-1,t!==0&&n.prev_length4096)&&(n.match_length=Tt-1)),n.prev_length>=Tt&&n.match_length<=n.prev_length){r=n.strstart+n.lookahead-Tt,i=ia(n,n.strstart-1-n.prev_match,n.prev_length-Tt),n.lookahead-=n.prev_length-1,n.prev_length-=2;do++n.strstart<=r&&(n.ins_h=aa(n,n.ins_h,n.window[n.strstart+Tt-1]),t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart);while(--n.prev_length!==0);if(n.match_available=0,n.match_length=Tt-1,n.strstart++,i&&(wi(n,!1),n.strm.avail_out===0))return oi}else if(n.match_available){if(i=ia(n,0,n.window[n.strstart-1]),i&&wi(n,!1),n.strstart++,n.lookahead--,n.strm.avail_out===0)return oi}else n.match_available=1,n.strstart++,n.lookahead--}return n.match_available&&(i=ia(n,0,n.window[n.strstart-1]),n.match_available=0),n.insert=n.strstart{let t,i,r,a,o=n.window;for(;;){if(n.lookahead<=na){if(So(n),n.lookahead<=na&&e===ra)return oi;if(n.lookahead===0)break}if(n.match_length=0,n.lookahead>=Tt&&n.strstart>0&&(r=n.strstart-1,i=o[r],i===o[++r]&&i===o[++r]&&i===o[++r])){a=n.strstart+na;do;while(i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&rn.lookahead&&(n.match_length=n.lookahead)}if(n.match_length>=Tt?(t=ia(n,1,n.match_length-Tt),n.lookahead-=n.match_length,n.strstart+=n.match_length,n.match_length=0):(t=ia(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++),t&&(wi(n,!1),n.strm.avail_out===0))return oi}return n.insert=0,e===Ni?(wi(n,!0),n.strm.avail_out===0?Ma:Oo):n.sym_next&&(wi(n,!1),n.strm.avail_out===0)?oi:Io},"deflate_rle"),tM=s((n,e)=>{let t;for(;;){if(n.lookahead===0&&(So(n),n.lookahead===0)){if(e===ra)return oi;break}if(n.match_length=0,t=ia(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++,t&&(wi(n,!1),n.strm.avail_out===0))return oi}return n.insert=0,e===Ni?(wi(n,!0),n.strm.avail_out===0?Ma:Oo):n.sym_next&&(wi(n,!1),n.strm.avail_out===0)?oi:Io},"deflate_huff");function vr(n,e,t,i,r){this.good_length=n,this.max_lazy=e,this.nice_length=t,this.max_chain=i,this.func=r}s(vr,"Config");var Gs=[new vr(0,0,0,0,vh),new vr(4,4,8,4,pf),new vr(4,5,16,8,pf),new vr(4,6,32,32,pf),new vr(4,4,16,16,Eo),new vr(8,16,32,32,Eo),new vr(8,16,128,128,Eo),new vr(8,32,128,256,Eo),new vr(32,128,258,1024,Eo),new vr(32,258,258,4096,Eo)],nM=s(n=>{n.window_size=2*n.w_size,ta(n.head),n.max_lazy_match=Gs[n.level].max_lazy,n.good_match=Gs[n.level].good_length,n.nice_match=Gs[n.level].nice_length,n.max_chain_length=Gs[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=Tt-1,n.match_available=0,n.ins_h=0},"lm_init");function iM(){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=Sc,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 Uint16Array(q6*2),this.dyn_dtree=new Uint16Array((2*$6+1)*2),this.bl_tree=new Uint16Array((2*K6+1)*2),ta(this.dyn_ltree),ta(this.dyn_dtree),ta(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(W6+1),this.heap=new Uint16Array(2*Cf+1),ta(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Cf+1),ta(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}s(iM,"DeflateState");var nl=s(n=>{if(!n)return 1;let e=n.state;return!e||e.strm!==n||e.status!==Ao&&e.status!==Mf&&e.status!==Af&&e.status!==Sf&&e.status!==jf&&e.status!==If&&e.status!==Ba&&e.status!==Us?1:0},"deflateStateCheck"),yh=s(n=>{if(nl(n))return Da(n,wr);n.total_in=n.total_out=0,n.data_type=V6;let e=n.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?Mf:e.wrap?Ao:Ba,n.adler=e.wrap===2?0:1,e.last_flush=-2,j6(e),Gn},"deflateResetKeep"),wh=s(n=>{let e=yh(n);return e===Gn&&nM(n.state),e},"deflateReset"),rM=s((n,e)=>nl(n)||n.state.wrap!==2?wr:(n.state.gzhead=e,Gn),"deflateSetHeader"),xh=s((n,e,t,i,r,a)=>{if(!n)return wr;let o=1;if(e===R6&&(e=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),r<1||r>z6||t!==Sc||i<8||i>15||e<0||e>9||a<0||a>L6||i===8&&o!==1)return Da(n,wr);i===8&&(i=9);let l=new iM;return n.state=l,l.strm=n,l.status=Ao,l.wrap=o,l.gzhead=null,l.w_bits=i,l.w_size=1<xh(n,e,Sc,U6,G6,P6),"deflateInit"),oM=s((n,e)=>{if(nl(n)||e>Eg||e<0)return n?Da(n,wr):wr;let t=n.state;if(!n.output||n.avail_in!==0&&!n.input||t.status===Us&&e!==Ni)return Da(n,n.avail_out===0?mf:wr);let i=t.last_flush;if(t.last_flush=e,t.pending!==0){if(yi(n),n.avail_out===0)return t.last_flush=-1,Gn}else if(n.avail_in===0&&Cg(e)<=Cg(i)&&e!==Ni)return Da(n,mf);if(t.status===Us&&n.avail_in!==0)return Da(n,mf);if(t.status===Ao&&t.wrap===0&&(t.status=Ba),t.status===Ao){let r=Sc+(t.w_bits-8<<4)<<8,a=-1;if(t.strategy>=vc||t.level<2?a=0:t.level<6?a=1:t.level===6?a=2:a=3,r|=a<<6,t.strstart!==0&&(r|=Z6),r+=31-r%31,zs(t,r),t.strstart!==0&&(zs(t,n.adler>>>16),zs(t,n.adler&65535)),n.adler=1,t.status=Ba,yi(n),t.pending!==0)return t.last_flush=-1,Gn}if(t.status===Mf){if(n.adler=0,Nt(t,31),Nt(t,139),Nt(t,8),t.gzhead)Nt(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),Nt(t,t.gzhead.time&255),Nt(t,t.gzhead.time>>8&255),Nt(t,t.gzhead.time>>16&255),Nt(t,t.gzhead.time>>24&255),Nt(t,t.level===9?2:t.strategy>=vc||t.level<2?4:0),Nt(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(Nt(t,t.gzhead.extra.length&255),Nt(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(n.adler=Nn(n.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=Af;else if(Nt(t,0),Nt(t,0),Nt(t,0),Nt(t,0),Nt(t,0),Nt(t,t.level===9?2:t.strategy>=vc||t.level<2?4:0),Nt(t,X6),t.status=Ba,yi(n),t.pending!==0)return t.last_flush=-1,Gn}if(t.status===Af){if(t.gzhead.extra){let r=t.pending,a=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+a>t.pending_buf_size;){let l=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+l),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>r&&(n.adler=Nn(n.adler,t.pending_buf,t.pending-r,r)),t.gzindex+=l,yi(n),t.pending!==0)return t.last_flush=-1,Gn;r=0,a-=l}let o=new Uint8Array(t.gzhead.extra);t.pending_buf.set(o.subarray(t.gzindex,t.gzindex+a),t.pending),t.pending+=a,t.gzhead.hcrc&&t.pending>r&&(n.adler=Nn(n.adler,t.pending_buf,t.pending-r,r)),t.gzindex=0}t.status=Sf}if(t.status===Sf){if(t.gzhead.name){let r=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>r&&(n.adler=Nn(n.adler,t.pending_buf,t.pending-r,r)),yi(n),t.pending!==0)return t.last_flush=-1,Gn;r=0}t.gzindexr&&(n.adler=Nn(n.adler,t.pending_buf,t.pending-r,r)),t.gzindex=0}t.status=jf}if(t.status===jf){if(t.gzhead.comment){let r=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>r&&(n.adler=Nn(n.adler,t.pending_buf,t.pending-r,r)),yi(n),t.pending!==0)return t.last_flush=-1,Gn;r=0}t.gzindexr&&(n.adler=Nn(n.adler,t.pending_buf,t.pending-r,r))}t.status=If}if(t.status===If){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(yi(n),t.pending!==0))return t.last_flush=-1,Gn;Nt(t,n.adler&255),Nt(t,n.adler>>8&255),n.adler=0}if(t.status=Ba,yi(n),t.pending!==0)return t.last_flush=-1,Gn}if(n.avail_in!==0||t.lookahead!==0||e!==ra&&t.status!==Us){let r=t.level===0?vh(t,e):t.strategy===vc?tM(t,e):t.strategy===F6?eM(t,e):Gs[t.level].func(t,e);if((r===Ma||r===Oo)&&(t.status=Us),r===oi||r===Ma)return n.avail_out===0&&(t.last_flush=-1),Gn;if(r===Io&&(e===N6?O6(t):e!==Eg&&(Tf(t,0,0,!1),e===B6&&(ta(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),yi(n),n.avail_out===0))return t.last_flush=-1,Gn}return e!==Ni?Gn:t.wrap<=0?Tg:(t.wrap===2?(Nt(t,n.adler&255),Nt(t,n.adler>>8&255),Nt(t,n.adler>>16&255),Nt(t,n.adler>>24&255),Nt(t,n.total_in&255),Nt(t,n.total_in>>8&255),Nt(t,n.total_in>>16&255),Nt(t,n.total_in>>24&255)):(zs(t,n.adler>>>16),zs(t,n.adler&65535)),yi(n),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?Gn:Tg)},"deflate$2"),sM=s(n=>{if(nl(n))return wr;let e=n.state.status;return n.state=null,e===Ba?Da(n,D6):Gn},"deflateEnd"),lM=s((n,e)=>{let t=e.length;if(nl(n))return wr;let i=n.state,r=i.wrap;if(r===2||r===1&&i.status!==Ao||i.lookahead)return wr;if(r===1&&(n.adler=Xs(n.adler,e,t,0)),i.wrap=0,t>=i.w_size){r===0&&(ta(i.head),i.strstart=0,i.block_start=0,i.insert=0);let c=new Uint8Array(i.w_size);c.set(e.subarray(t-i.w_size,t),0),e=c,t=i.w_size}let a=n.avail_in,o=n.next_in,l=n.input;for(n.avail_in=t,n.next_in=0,n.input=e,So(i);i.lookahead>=Tt;){let c=i.strstart,u=i.lookahead-(Tt-1);do i.ins_h=aa(i,i.ins_h,i.window[c+Tt-1]),i.prev[c&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=c,c++;while(--u);i.strstart=c,i.lookahead=Tt-1,So(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=Tt-1,i.match_available=0,n.next_in=o,n.input=l,n.avail_in=a,i.wrap=r,Gn},"deflateSetDictionary"),cM=aM,uM=xh,dM=wh,fM=yh,mM=rM,pM=oM,_M=sM,gM=lM,hM="pako deflate (from Nodeca project)",Hs={deflateInit:cM,deflateInit2:uM,deflateReset:dM,deflateResetKeep:fM,deflateSetHeader:mM,deflate:pM,deflateEnd:_M,deflateSetDictionary:gM,deflateInfo:hM},bM=s((n,e)=>Object.prototype.hasOwnProperty.call(n,e),"_has"),vM=s(function(n){let e=Array.prototype.slice.call(arguments,1);for(;e.length;){let t=e.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(let i in t)bM(t,i)&&(n[i]=t[i])}}return n},"assign"),yM=s(n=>{let e=0;for(let i=0,r=n.length;i=252?6:n>=248?5:n>=240?4:n>=224?3:n>=192?2:1;Ys[254]=Ys[254]=1;var wM=s(n=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(n);let e,t,i,r,a,o=n.length,l=0;for(r=0;r>>6,e[a++]=128|t&63):t<65536?(e[a++]=224|t>>>12,e[a++]=128|t>>>6&63,e[a++]=128|t&63):(e[a++]=240|t>>>18,e[a++]=128|t>>>12&63,e[a++]=128|t>>>6&63,e[a++]=128|t&63);return e},"string2buf"),xM=s((n,e)=>{if(e<65534&&n.subarray&&kh)return String.fromCharCode.apply(null,n.length===e?n:n.subarray(0,e));let t="";for(let i=0;i{let t=e||n.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(n.subarray(0,e));let i,r,a=new Array(t*2);for(r=0,i=0;i4){a[r++]=65533,i+=l-1;continue}for(o&=l===2?31:l===3?15:7;l>1&&i1){a[r++]=65533;continue}o<65536?a[r++]=o:(o-=65536,a[r++]=55296|o>>10&1023,a[r++]=56320|o&1023)}return xM(a,r)},"buf2string"),EM=s((n,e)=>{e=e||n.length,e>n.length&&(e=n.length);let t=e-1;for(;t>=0&&(n[t]&192)===128;)t--;return t<0||t===0?e:t+Ys[n[t]]>e?t:e},"utf8border"),Qs={string2buf:wM,buf2string:kM,utf8border:EM};function TM(){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}s(TM,"ZStream");var Eh=TM,Th=Object.prototype.toString,{Z_NO_FLUSH:CM,Z_SYNC_FLUSH:AM,Z_FULL_FLUSH:SM,Z_FINISH:jM,Z_OK:Cc,Z_STREAM_END:IM,Z_DEFAULT_COMPRESSION:OM,Z_DEFAULT_STRATEGY:NM,Z_DEFLATED:BM}=La;function il(n){this.options=jc.assign({level:OM,method:BM,chunkSize:16384,windowBits:15,memLevel:8,strategy:NM},n||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Eh,this.strm.avail_out=0;let t=Hs.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(t!==Cc)throw new Error(Ra[t]);if(e.header&&Hs.deflateSetHeader(this.strm,e.header),e.dictionary){let i;if(typeof e.dictionary=="string"?i=Qs.string2buf(e.dictionary):Th.call(e.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(e.dictionary):i=e.dictionary,t=Hs.deflateSetDictionary(this.strm,i),t!==Cc)throw new Error(Ra[t]);this._dict_set=!0}}s(il,"Deflate$1");il.prototype.push=function(n,e){let t=this.strm,i=this.options.chunkSize,r,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?jM:CM,typeof n=="string"?t.input=Qs.string2buf(n):Th.call(n)==="[object ArrayBuffer]"?t.input=new Uint8Array(n):t.input=n,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),(a===AM||a===SM)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(r=Hs.deflate(t,a),r===IM)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),r=Hs.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Cc;if(t.avail_out===0){this.onData(t.output);continue}if(a>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0};il.prototype.onData=function(n){this.chunks.push(n)};il.prototype.onEnd=function(n){n===Cc&&(this.result=jc.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function Ff(n,e){let t=new il(e);if(t.push(n,!0),t.err)throw t.msg||Ra[t.err];return t.result}s(Ff,"deflate$1");function DM(n,e){return e=e||{},e.raw=!0,Ff(n,e)}s(DM,"deflateRaw$1");function RM(n,e){return e=e||{},e.gzip=!0,Ff(n,e)}s(RM,"gzip$1");var MM=il,FM=Ff,LM=DM,PM=RM,VM=La,zM={Deflate:MM,deflate:FM,deflateRaw:LM,gzip:PM,constants:VM},yc=16209,UM=16191,GM=s(function(e,t){let i,r,a,o,l,c,u,d,m,p,f,_,v,g,h,b,x,y,k,C,A,I,S,L,O=e.state;i=e.next_in,S=e.input,r=i+(e.avail_in-5),a=e.next_out,L=e.output,o=a-(t-e.avail_out),l=a+(e.avail_out-257),c=O.dmax,u=O.wsize,d=O.whave,m=O.wnext,p=O.window,f=O.hold,_=O.bits,v=O.lencode,g=O.distcode,h=(1<>>24,f>>>=y,_-=y,y=x>>>16&255,y===0)L[a++]=x&65535;else if(y&16){k=x&65535,y&=15,y&&(_>>=y,_-=y),_<15&&(f+=S[i++]<<_,_+=8,f+=S[i++]<<_,_+=8),x=g[f&b];n:for(;;){if(y=x>>>24,f>>>=y,_-=y,y=x>>>16&255,y&16){if(C=x&65535,y&=15,_c){e.msg="invalid distance too far back",O.mode=yc;break e}if(f>>>=y,_-=y,y=a-o,C>y){if(y=C-y,y>d&&O.sane){e.msg="invalid distance too far back",O.mode=yc;break e}if(A=0,I=p,m===0){if(A+=u-y,y2;)L[a++]=I[A++],L[a++]=I[A++],L[a++]=I[A++],k-=3;k&&(L[a++]=I[A++],k>1&&(L[a++]=I[A++]))}else{A=a-C;do L[a++]=L[A++],L[a++]=L[A++],L[a++]=L[A++],k-=3;while(k>2);k&&(L[a++]=L[A++],k>1&&(L[a++]=L[A++]))}}else if(y&64){e.msg="invalid distance code",O.mode=yc;break e}else{x=g[(x&65535)+(f&(1<>3,i-=k,_-=k<<3,f&=(1<<_)-1,e.next_in=i,e.next_out=a,e.avail_in=i{let c=l.bits,u=0,d=0,m=0,p=0,f=0,_=0,v=0,g=0,h=0,b=0,x,y,k,C,A,I=null,S,L=new Uint16Array(To+1),O=new Uint16Array(To+1),E=null,B,H,ee;for(u=0;u<=To;u++)L[u]=0;for(d=0;d=1&&L[p]===0;p--);if(f>p&&(f=p),p===0)return r[a++]=1<<24|64<<16|0,r[a++]=1<<24|64<<16|0,l.bits=1,0;for(m=1;m0&&(n===jg||p!==1))return-1;for(O[1]=0,u=1;uAg||n===Ig&&h>Sg)return 1;for(;;){B=u-v,o[d]+1=S?(H=E[o[d]-S],ee=I[o[d]-S]):(H=32+64,ee=0),x=1<>v)+y]=B<<24|H<<16|ee|0;while(y!==0);for(x=1<>=1;if(x!==0?(b&=x-1,b+=x):b=0,d++,--L[u]===0){if(u===p)break;u=e[t+o[d]]}if(u>f&&(b&C)!==k){for(v===0&&(v=f),A+=m,_=u-v,g=1<<_;_+vAg||n===Ig&&h>Sg)return 1;k=b&C,r[k]=f<<24|_<<16|A-a|0}}return b!==0&&(r[A+b]=u-v<<24|64<<16|0),l.bits=f,0},"inflate_table"),$s=qM,WM=0,Ch=1,Ah=2,{Z_FINISH:Og,Z_BLOCK:ZM,Z_TREES:wc,Z_OK:Fa,Z_STREAM_END:XM,Z_NEED_DICT:YM,Z_STREAM_ERROR:Bi,Z_DATA_ERROR:Sh,Z_MEM_ERROR:jh,Z_BUF_ERROR:QM,Z_DEFLATED:Ng}=La,Ic=16180,Bg=16181,Dg=16182,Rg=16183,Mg=16184,Fg=16185,Lg=16186,Pg=16187,Vg=16188,zg=16189,Ac=16190,Fr=16191,gf=16192,Ug=16193,hf=16194,Gg=16195,Jg=16196,Hg=16197,$g=16198,xc=16199,kc=16200,Kg=16201,qg=16202,Wg=16203,Zg=16204,Xg=16205,bf=16206,Yg=16207,Qg=16208,sn=16209,Ih=16210,Oh=16211,eF=852,tF=592,nF=15,iF=nF,eh=s(n=>(n>>>24&255)+(n>>>8&65280)+((n&65280)<<8)+((n&255)<<24),"zswap32");function rF(){this.strm=null,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 Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}s(rF,"InflateState");var Pa=s(n=>{if(!n)return 1;let e=n.state;return!e||e.strm!==n||e.modeOh?1:0},"inflateStateCheck"),Nh=s(n=>{if(Pa(n))return Bi;let e=n.state;return n.total_in=n.total_out=e.total=0,n.msg="",e.wrap&&(n.adler=e.wrap&1),e.mode=Ic,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(eF),e.distcode=e.distdyn=new Int32Array(tF),e.sane=1,e.back=-1,Fa},"inflateResetKeep"),Bh=s(n=>{if(Pa(n))return Bi;let e=n.state;return e.wsize=0,e.whave=0,e.wnext=0,Nh(n)},"inflateReset"),Dh=s((n,e)=>{let t;if(Pa(n))return Bi;let i=n.state;return e<0?(t=0,e=-e):(t=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Bi:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=t,i.wbits=e,Bh(n))},"inflateReset2"),Rh=s((n,e)=>{if(!n)return Bi;let t=new rF;n.state=t,t.strm=n,t.window=null,t.mode=Ic;let i=Dh(n,e);return i!==Fa&&(n.state=null),i},"inflateInit2"),aF=s(n=>Rh(n,iF),"inflateInit"),th=!0,vf,yf,oF=s(n=>{if(th){vf=new Int32Array(512),yf=new Int32Array(32);let e=0;for(;e<144;)n.lens[e++]=8;for(;e<256;)n.lens[e++]=9;for(;e<280;)n.lens[e++]=7;for(;e<288;)n.lens[e++]=8;for($s(Ch,n.lens,0,288,vf,0,n.work,{bits:9}),e=0;e<32;)n.lens[e++]=5;$s(Ah,n.lens,0,32,yf,0,n.work,{bits:5}),th=!1}n.lencode=vf,n.lenbits=9,n.distcode=yf,n.distbits=5},"fixedtables"),Mh=s((n,e,t,i)=>{let r,a=n.state;return a.window===null&&(a.wsize=1<=a.wsize?(a.window.set(e.subarray(t-a.wsize,t),0),a.wnext=0,a.whave=a.wsize):(r=a.wsize-a.wnext,r>i&&(r=i),a.window.set(e.subarray(t-i,t-i+r),a.wnext),i-=r,i?(a.window.set(e.subarray(t-i,t),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=r,a.wnext===a.wsize&&(a.wnext=0),a.whave{let t,i,r,a,o,l,c,u,d,m,p,f,_,v,g=0,h,b,x,y,k,C,A,I,S=new Uint8Array(4),L,O,E=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Pa(n)||!n.output||!n.input&&n.avail_in!==0)return Bi;t=n.state,t.mode===Fr&&(t.mode=gf),o=n.next_out,r=n.output,c=n.avail_out,a=n.next_in,i=n.input,l=n.avail_in,u=t.hold,d=t.bits,m=l,p=c,I=Fa;e:for(;;)switch(t.mode){case Ic:if(t.wrap===0){t.mode=gf;break}for(;d<16;){if(l===0)break e;l--,u+=i[a++]<>>8&255,t.check=Nn(t.check,S,2,0),u=0,d=0,t.mode=Bg;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((u&255)<<8)+(u>>8))%31){n.msg="incorrect header check",t.mode=sn;break}if((u&15)!==Ng){n.msg="unknown compression method",t.mode=sn;break}if(u>>>=4,d-=4,A=(u&15)+8,t.wbits===0&&(t.wbits=A),A>15||A>t.wbits){n.msg="invalid window size",t.mode=sn;break}t.dmax=1<>8&1),t.flags&512&&t.wrap&4&&(S[0]=u&255,S[1]=u>>>8&255,t.check=Nn(t.check,S,2,0)),u=0,d=0,t.mode=Dg;case Dg:for(;d<32;){if(l===0)break e;l--,u+=i[a++]<>>8&255,S[2]=u>>>16&255,S[3]=u>>>24&255,t.check=Nn(t.check,S,4,0)),u=0,d=0,t.mode=Rg;case Rg:for(;d<16;){if(l===0)break e;l--,u+=i[a++]<>8),t.flags&512&&t.wrap&4&&(S[0]=u&255,S[1]=u>>>8&255,t.check=Nn(t.check,S,2,0)),u=0,d=0,t.mode=Mg;case Mg:if(t.flags&1024){for(;d<16;){if(l===0)break e;l--,u+=i[a++]<>>8&255,t.check=Nn(t.check,S,2,0)),u=0,d=0}else t.head&&(t.head.extra=null);t.mode=Fg;case Fg:if(t.flags&1024&&(f=t.length,f>l&&(f=l),f&&(t.head&&(A=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(i.subarray(a,a+f),A)),t.flags&512&&t.wrap&4&&(t.check=Nn(t.check,i,f,a)),l-=f,a+=f,t.length-=f),t.length))break e;t.length=0,t.mode=Lg;case Lg:if(t.flags&2048){if(l===0)break e;f=0;do A=i[a+f++],t.head&&A&&t.length<65536&&(t.head.name+=String.fromCharCode(A));while(A&&f>9&1,t.head.done=!0),n.adler=t.check=0,t.mode=Fr;break;case zg:for(;d<32;){if(l===0)break e;l--,u+=i[a++]<>>=d&7,d-=d&7,t.mode=bf;break}for(;d<3;){if(l===0)break e;l--,u+=i[a++]<>>=1,d-=1,u&3){case 0:t.mode=Ug;break;case 1:if(oF(t),t.mode=xc,e===wc){u>>>=2,d-=2;break e}break;case 2:t.mode=Jg;break;case 3:n.msg="invalid block type",t.mode=sn}u>>>=2,d-=2;break;case Ug:for(u>>>=d&7,d-=d&7;d<32;){if(l===0)break e;l--,u+=i[a++]<>>16^65535)){n.msg="invalid stored block lengths",t.mode=sn;break}if(t.length=u&65535,u=0,d=0,t.mode=hf,e===wc)break e;case hf:t.mode=Gg;case Gg:if(f=t.length,f){if(f>l&&(f=l),f>c&&(f=c),f===0)break e;r.set(i.subarray(a,a+f),o),l-=f,a+=f,c-=f,o+=f,t.length-=f;break}t.mode=Fr;break;case Jg:for(;d<14;){if(l===0)break e;l--,u+=i[a++]<>>=5,d-=5,t.ndist=(u&31)+1,u>>>=5,d-=5,t.ncode=(u&15)+4,u>>>=4,d-=4,t.nlen>286||t.ndist>30){n.msg="too many length or distance symbols",t.mode=sn;break}t.have=0,t.mode=Hg;case Hg:for(;t.have>>=3,d-=3}for(;t.have<19;)t.lens[E[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,L={bits:t.lenbits},I=$s(WM,t.lens,0,19,t.lencode,0,t.work,L),t.lenbits=L.bits,I){n.msg="invalid code lengths set",t.mode=sn;break}t.have=0,t.mode=$g;case $g:for(;t.have>>24,b=g>>>16&255,x=g&65535,!(h<=d);){if(l===0)break e;l--,u+=i[a++]<>>=h,d-=h,t.lens[t.have++]=x;else{if(x===16){for(O=h+2;d>>=h,d-=h,t.have===0){n.msg="invalid bit length repeat",t.mode=sn;break}A=t.lens[t.have-1],f=3+(u&3),u>>>=2,d-=2}else if(x===17){for(O=h+3;d>>=h,d-=h,A=0,f=3+(u&7),u>>>=3,d-=3}else{for(O=h+7;d>>=h,d-=h,A=0,f=11+(u&127),u>>>=7,d-=7}if(t.have+f>t.nlen+t.ndist){n.msg="invalid bit length repeat",t.mode=sn;break}for(;f--;)t.lens[t.have++]=A}}if(t.mode===sn)break;if(t.lens[256]===0){n.msg="invalid code -- missing end-of-block",t.mode=sn;break}if(t.lenbits=9,L={bits:t.lenbits},I=$s(Ch,t.lens,0,t.nlen,t.lencode,0,t.work,L),t.lenbits=L.bits,I){n.msg="invalid literal/lengths set",t.mode=sn;break}if(t.distbits=6,t.distcode=t.distdyn,L={bits:t.distbits},I=$s(Ah,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,L),t.distbits=L.bits,I){n.msg="invalid distances set",t.mode=sn;break}if(t.mode=xc,e===wc)break e;case xc:t.mode=kc;case kc:if(l>=6&&c>=258){n.next_out=o,n.avail_out=c,n.next_in=a,n.avail_in=l,t.hold=u,t.bits=d,GM(n,p),o=n.next_out,r=n.output,c=n.avail_out,a=n.next_in,i=n.input,l=n.avail_in,u=t.hold,d=t.bits,t.mode===Fr&&(t.back=-1);break}for(t.back=0;g=t.lencode[u&(1<>>24,b=g>>>16&255,x=g&65535,!(h<=d);){if(l===0)break e;l--,u+=i[a++]<>y)],h=g>>>24,b=g>>>16&255,x=g&65535,!(y+h<=d);){if(l===0)break e;l--,u+=i[a++]<>>=y,d-=y,t.back+=y}if(u>>>=h,d-=h,t.back+=h,t.length=x,b===0){t.mode=Xg;break}if(b&32){t.back=-1,t.mode=Fr;break}if(b&64){n.msg="invalid literal/length code",t.mode=sn;break}t.extra=b&15,t.mode=Kg;case Kg:if(t.extra){for(O=t.extra;d>>=t.extra,d-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=qg;case qg:for(;g=t.distcode[u&(1<>>24,b=g>>>16&255,x=g&65535,!(h<=d);){if(l===0)break e;l--,u+=i[a++]<>y)],h=g>>>24,b=g>>>16&255,x=g&65535,!(y+h<=d);){if(l===0)break e;l--,u+=i[a++]<>>=y,d-=y,t.back+=y}if(u>>>=h,d-=h,t.back+=h,b&64){n.msg="invalid distance code",t.mode=sn;break}t.offset=x,t.extra=b&15,t.mode=Wg;case Wg:if(t.extra){for(O=t.extra;d>>=t.extra,d-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){n.msg="invalid distance too far back",t.mode=sn;break}t.mode=Zg;case Zg:if(c===0)break e;if(f=p-c,t.offset>f){if(f=t.offset-f,f>t.whave&&t.sane){n.msg="invalid distance too far back",t.mode=sn;break}f>t.wnext?(f-=t.wnext,_=t.wsize-f):_=t.wnext-f,f>t.length&&(f=t.length),v=t.window}else v=r,_=o-t.offset,f=t.length;f>c&&(f=c),c-=f,t.length-=f;do r[o++]=v[_++];while(--f);t.length===0&&(t.mode=kc);break;case Xg:if(c===0)break e;r[o++]=t.length,c--,t.mode=kc;break;case bf:if(t.wrap){for(;d<32;){if(l===0)break e;l--,u|=i[a++]<{if(Pa(n))return Bi;let e=n.state;return e.window&&(e.window=null),n.state=null,Fa},"inflateEnd"),cF=s((n,e)=>{if(Pa(n))return Bi;let t=n.state;return t.wrap&2?(t.head=e,e.done=!1,Fa):Bi},"inflateGetHeader"),uF=s((n,e)=>{let t=e.length,i,r,a;return Pa(n)||(i=n.state,i.wrap!==0&&i.mode!==Ac)?Bi:i.mode===Ac&&(r=1,r=Xs(r,e,t,0),r!==i.check)?Sh:(a=Mh(n,e,t,t),a?(i.mode=Ih,jh):(i.havedict=1,Fa))},"inflateSetDictionary"),dF=Bh,fF=Dh,mF=Nh,pF=aF,_F=Rh,gF=sF,hF=lF,bF=cF,vF=uF,yF="pako inflate (from Nodeca project)",Pr={inflateReset:dF,inflateReset2:fF,inflateResetKeep:mF,inflateInit:pF,inflateInit2:_F,inflate:gF,inflateEnd:hF,inflateGetHeader:bF,inflateSetDictionary:vF,inflateInfo:yF};function wF(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}s(wF,"GZheader");var xF=wF,Fh=Object.prototype.toString,{Z_NO_FLUSH:kF,Z_FINISH:EF,Z_OK:el,Z_STREAM_END:wf,Z_NEED_DICT:xf,Z_STREAM_ERROR:TF,Z_DATA_ERROR:nh,Z_MEM_ERROR:CF}=La;function rl(n){this.options=jc.assign({chunkSize:1024*64,windowBits:15,to:""},n||{});let e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(n&&n.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Eh,this.strm.avail_out=0;let t=Pr.inflateInit2(this.strm,e.windowBits);if(t!==el)throw new Error(Ra[t]);if(this.header=new xF,Pr.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Qs.string2buf(e.dictionary):Fh.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=Pr.inflateSetDictionary(this.strm,e.dictionary),t!==el)))throw new Error(Ra[t])}s(rl,"Inflate$1");rl.prototype.push=function(n,e){let t=this.strm,i=this.options.chunkSize,r=this.options.dictionary,a,o,l;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?EF:kF,Fh.call(n)==="[object ArrayBuffer]"?t.input=new Uint8Array(n):t.input=n,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),a=Pr.inflate(t,o),a===xf&&r&&(a=Pr.inflateSetDictionary(t,r),a===el?a=Pr.inflate(t,o):a===nh&&(a=xf));t.avail_in>0&&a===wf&&t.state.wrap>0&&n[t.next_in]!==0;)Pr.inflateReset(t),a=Pr.inflate(t,o);switch(a){case TF:case nh:case xf:case CF:return this.onEnd(a),this.ended=!0,!1}if(l=t.avail_out,t.next_out&&(t.avail_out===0||a===wf))if(this.options.to==="string"){let c=Qs.utf8border(t.output,t.next_out),u=t.next_out-c,d=Qs.buf2string(t.output,c);t.next_out=u,t.avail_out=i-u,u&&t.output.set(t.output.subarray(c,c+u),0),this.onData(d)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(a===el&&l===0)){if(a===wf)return a=Pr.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(t.avail_in===0)break}}return!0};rl.prototype.onData=function(n){this.chunks.push(n)};rl.prototype.onEnd=function(n){n===el&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=jc.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function Lf(n,e){let t=new rl(e);if(t.push(n),t.err)throw t.msg||Ra[t.err];return t.result}s(Lf,"inflate$1");function AF(n,e){return e=e||{},e.raw=!0,Lf(n,e)}s(AF,"inflateRaw$1");var SF=rl,jF=Lf,IF=AF,OF=Lf,NF=La,BF={Inflate:SF,inflate:jF,inflateRaw:IF,ungzip:OF,constants:NF},{Deflate:DF,deflate:RF,deflateRaw:MF,gzip:FF}=zM,{Inflate:LF,inflate:PF,inflateRaw:VF,ungzip:zF}=BF,UF=DF,GF=RF,JF=MF,HF=FF,$F=LF,KF=PF,qF=VF,WF=zF,ZF=La,Oc={Deflate:UF,deflate:GF,deflateRaw:JF,gzip:HF,Inflate:$F,inflate:KF,inflateRaw:qF,ungzip:WF,constants:ZF};var Ce;(function(n){n[n.End=0]="End",n[n.Byte=1]="Byte",n[n.Short=2]="Short",n[n.Int=3]="Int",n[n.Long=4]="Long",n[n.Float=5]="Float",n[n.Double=6]="Double",n[n.ByteArray=7]="ByteArray",n[n.String=8]="String",n[n.List=9]="List",n[n.Compound=10]="Compound",n[n.IntArray=11]="IntArray",n[n.LongArray=12]="LongArray"})(Ce||(Ce={}));var Nc=class{static register(e,t){let i=t.create().getId();if(i!==e)throw new Error(`Registered factory ${Ce[i]} does not match type ${Ce[e]}`);Nc.FACTORIES.set(e,t)}isEnd(){return this.getId()===Ce.End}isByte(){return this.getId()===Ce.Byte}isShort(){return this.getId()===Ce.Short}isInt(){return this.getId()===Ce.Int}isLong(){return this.getId()===Ce.Long}isFloat(){return this.getId()===Ce.Float}isDouble(){return this.getId()===Ce.Double}isByteArray(){return this.getId()===Ce.ByteArray}isString(){return this.getId()===Ce.String}isList(){return this.getId()===Ce.List}isCompound(){return this.getId()===Ce.Compound}isIntArray(){return this.getId()===Ce.IntArray}isLongArray(){return this.getId()===Ce.LongArray}isNumber(){return this.isByte()||this.isShort()||this.isInt()||this.isLong()||this.isFloat()||this.isDouble()}isArray(){return this.isByteArray()||this.isIntArray()||this.isLongArray()}isListOrArray(){return this.isList()||this.isArray()}getAsNumber(){return 0}getAsString(){return""}toJsonWithId(){return{type:this.getId(),value:this.toJson()}}static getFactory(e){let t=this.FACTORIES.get(e);if(!t)throw new Error(`Invalid tag id ${e}`);return t}static create(e){return this.getFactory(e).create()}static fromString(e){let t=typeof e=="string"?new Un(e):e;return this.getFactory(Ce.Compound).fromString(t)}static fromJson(e,t=Ce.Compound){return this.getFactory(t).fromJson(e)}static fromJsonWithId(e){let t=nt.readObject(e)??{},i=nt.readInt(t.type)??0;return Nc.fromJson(t.value??{},i)}static fromBytes(e,t=Ce.Compound){return this.getFactory(t).fromBytes(e)}},qe=Nc;s(qe,"NbtTag"),ht(qe,"FACTORIES",new Map);var Va=class extends qe{value;constructor(e){super(),this.value=typeof e=="number"?e:e?1:0}getId(){return Ce.Byte}getAsNumber(){return this.value}toString(){return this.value.toFixed()+"b"}toPrettyString(){return this.toString()}toSimplifiedJson(){return this.value}toJson(){return this.value}toBytes(e){e.writeByte(this.value)}static create(){return Va.ZERO}static fromJson(e){return new Va(nt.readInt(e)??0)}static fromBytes(e){let t=e.readByte();return new Va(t)}},Bn=Va;s(Bn,"NbtByte"),ht(Bn,"ZERO",new Va(0)),ht(Bn,"ONE",new Va(1));qe.register(Ce.Byte,Bn);var Zi=class extends qe{items;constructor(e){super(),this.items=e}getItems(){return this.items.slice(0)}getAsTuple(e,t){return[...Array(e)].map((i,r)=>t(this.items[r]))}get(e){if(e=Math.floor(e),!(e<0||e>=this.items.length))return this.items[e]}get length(){return this.items.length}map(e){return this.items.map(e)}filter(e){return this.items.filter(e)}forEach(e){this.items.forEach(e)}set(e,t){this.items[e]=t}add(e){this.items.push(e)}insert(e,t){this.items.splice(e,0,t)}delete(e){this.items.splice(e,1)}clear(){this.items=[]}};s(Zi,"NbtAbstractList");var Di=class extends Zi{constructor(e){super(Array.from(e??[],t=>typeof t=="number"?new Bn(t):t))}getId(){return Ce.ByteArray}getType(){return Ce.Byte}toString(){return"[B;"+this.items.map(t=>t.getAsNumber().toFixed()+"B").join(",")+"]"}toPrettyString(){return this.toString()}toSimplifiedJson(){return this.items.map(e=>e.getAsNumber())}toJson(){return this.items.map(e=>e.getAsNumber())}toBytes(e){e.writeInt(this.items.length),e.writeBytes(this.items.map(t=>t.getAsNumber()))}static create(){return new Di([])}static fromJson(e){let t=nt.readArray(e,i=>nt.readNumber(i)??0)??[];return new Di(t)}static fromBytes(e){let t=e.readInt(),i=e.readBytes(t);return new Di(i)}};s(Di,"NbtByteArray");qe.register(Ce.ByteArray,Di);var wt=class extends qe{value;constructor(e){super(),this.value=e}getId(){return Ce.Float}getAsNumber(){return this.value}toString(){return this.value.toString()+"f"}toPrettyString(){return this.toString()}toSimplifiedJson(){return this.value}toJson(){return this.value}toBytes(e){e.writeFloat(this.value)}static create(){return new wt(0)}static fromJson(e){return new wt(nt.readNumber(e)??0)}static fromBytes(e){let t=e.readFloat();return new wt(t)}};s(wt,"NbtFloat");qe.register(Ce.Float,wt);var Kt=class extends qe{value;constructor(e){super(),this.value=e}getId(){return Ce.Int}getAsNumber(){return this.value}toString(){return this.value.toFixed()}toPrettyString(){return this.toString()}toSimplifiedJson(){return this.value}toJson(){return this.value}toBytes(e){e.writeInt(this.value)}static create(){return new Kt(0)}static fromJson(e){return new Kt(nt.readInt(e)??0)}static fromBytes(e){let t=e.readInt();return new Kt(t)}};s(Kt,"NbtInt");qe.register(Ce.Int,Kt);var Ri=class extends Zi{constructor(e){super(Array.from(e??[],t=>typeof t=="number"?new Kt(t):t))}getId(){return Ce.IntArray}getType(){return Ce.Int}get length(){return this.items.length}toString(){return"[I;"+this.items.map(t=>t.getAsNumber().toFixed()).join(",")+"]"}toPrettyString(){return this.toString()}toSimplifiedJson(){return this.items.map(e=>e.getAsNumber())}toJson(){return this.items.map(e=>e.getAsNumber())}toBytes(e){e.writeInt(this.items.length);for(let t of this.items)e.writeInt(t.getAsNumber())}static create(){return new Ri}static fromJson(e){let t=nt.readArray(e,i=>nt.readNumber(i)??0)??[];return new Ri(t)}static fromBytes(e){let t=e.readInt(),i=[];for(let r=0;rnew e(i)))}getId(){return Ce.List}getType(){return this.type}getNumber(e){let t=this.get(e);return t?.isNumber()?t.getAsNumber():0}getString(e){let t=this.get(e);return t?.isString()?t.getAsString():""}getList(e,t){let i=this.get(e);return i?.isList()&&i.getType()===t?i:wn.create()}getCompound(e){let t=this.get(e);return t?.isCompound()?t:Ze.create()}set(e,t){this.updateType(t),super.set(e,t)}add(e){this.updateType(e),super.add(e)}insert(e,t){this.updateType(t),super.insert(e,t)}updateType(e){if(e.getId()!==Ce.End){if(this.type===Ce.End)this.type=e.getId();else if(this.type!==e.getId())throw new Error(`Trying to add tag of type ${Ce[e.getId()]} to list of ${Ce[this.type]}`)}}clear(){super.clear(),this.type=Ce.End}toString(){return"["+this.items.map(e=>e.toString()).join(",")+"]"}toPrettyString(e=" ",t=0){if(this.length===0)return"[]";let i=e.repeat(t),r=e.repeat(t+1);return`[ +
    • Documentation for Animated Java can be found at https://animated-java.dev/docs
    • `,p=G(),f=P("div"),_=P("button"),_.innerHTML=`arrow_forward + Create new AJ Blueprint`,T(e,"class","format_description"),T(i,"class","format_target"),T(a,"class","markdown"),T(c,"class","markdown"),T(m,"class","markdown"),T(_,"class","svelte-15sooy0"),T(f,"class","button_bar")},m(v,y){L(v,e,y),L(v,t,y),L(v,i,y),L(v,r,y),L(v,a,y),L(v,o,y),L(v,l,y),L(v,u,y),L(v,c,y),L(v,d,y),L(v,m,y),L(v,p,y),L(v,f,y),N(f,_),g||(h=Le(_,"click",n[1]),g=!0)},p:ue,i:ue,o:ue,d(v){v&&F(e),v&&F(t),v&&F(i),v&&F(r),v&&F(a),v&&F(o),v&&F(l),v&&F(u),v&&F(c),v&&F(d),v&&F(m),v&&F(p),v&&F(f),g=!1,h()}}}s(dM,"create_fragment");function fM(n){let e=document.querySelector("#format_page_animated_java_blueprint")?.children[1];if(e){let r=e.parentElement?.id;if(!e.children.namedItem("format_icon")){let a=new Image(48,48);a.id="format_icon",a.src=Li,a.style.marginRight="16px",a.style.borderRadius="6px",a.style.boxShadow="2px 2px 2px #000000aa",e.prepend(a),r=void 0,setInterval(()=>{e.parentElement?.id!==r&&(e.parentElement?.id==="format_page_animated_java_blueprint"?(a.style.display="block",e.style.display="flex",e.style.alignItems="center",e.style.fontWeight="normal"):(a.style.display="none",e.style.fontWeight="lighter"),r=e.parentElement?.id)},16)}}else throw new Error("Format page title not found!");function t(){newProject(rt),requestAnimationFrame(()=>{Project.openSettings()})}return s(t,"createBlueprint"),[t,s(()=>t(),"click_handler")]}s(fM,"instance");var Cc=class extends Be{constructor(e){super(),De(this,e,fM,dM,Oe,{})}};s(Cc,"FormatPage");var Ig=Cc;(()=>{let n=Blockbench.addCSS("button.svelte-15sooy0{width:100%;height:40px}li.svelte-15sooy0{margin-left:24px}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();function Og(n){var e=n.slice(0,2);return e.length===2&&e[0]===31&&e[1]===139}s(Og,"hasGzipHeader");function Ng(n){let e=n.slice(0,2);return e.length===2&&e[0]===120&&(e[1]===1||e[1]===94||e[1]===156||e[2]===218)}s(Ng,"hasZlibHeader");function Bg(n){let e=n.slice(0,8),t=new DataView(e.buffer,e.byteOffset),i=t.getUint32(0,!0),r=t.getUint32(4,!0);if(e.length===8&&i>0&&i<100&&r===n.byteLength-8)return i}s(Bg,"getBedrockHeader");function Rg(n){var e=[],t,i;for(t=0;t>6),e.push(128|i&63)):i<65536?(e.push(224|i>>12),e.push(128|i>>6&63),e.push(128|i&63)):(e.push(240|i>>18&7),e.push(128|i>>12&63),e.push(128|i>>6&63),e.push(128|i&63));return e}s(Rg,"encodeUTF8");function Dg(n){var e=[],t;for(t=0;t=t)return;let i=this.buffer.byteLength;for(;ithis.buffer.byteLength&&a.fill(0,this.buffer.byteLength,this.offset),this.buffer=r,this.view=new DataView(r),this.array=a}writeNumber(e,t,i){this.accommodate(t),this.view[e](this.offset,i,this.littleEndian),this.offset+=t}writeByte=this.writeNumber.bind(this,"setInt8",1);writeShort=this.writeNumber.bind(this,"setInt16",2);writeInt=this.writeNumber.bind(this,"setInt32",4);writeFloat=this.writeNumber.bind(this,"setFloat32",4);writeDouble=this.writeNumber.bind(this,"setFloat64",8);writeBytes(e){this.accommodate(e.length),this.array.set(e,this.offset),this.offset+=e.length}writeString(e){let t=Rg(e);this.writeShort(t.length),this.writeBytes(t)}getData(){return this.accommodate(0),this.array.slice(0,this.offset)}};s($s,"RawDataOutput");var lt;(function(n){function e(m){return typeof m=="number"?m:void 0}s(e,"readNumber"),n.readNumber=e;function t(m){return typeof m=="number"?Math.floor(m):void 0}s(t,"readInt"),n.readInt=t;function i(m){return typeof m=="string"?m:void 0}s(i,"readString"),n.readString=i;function r(m){return typeof m=="boolean"?m:void 0}s(r,"readBoolean"),n.readBoolean=r;function a(m){return typeof m=="object"&&m!==null&&!Array.isArray(m)?m:void 0}s(a,"readObject"),n.readObject=a;function o(m,p){if(Array.isArray(m))return p?m.map(f=>p(f)):m}s(o,"readArray"),n.readArray=o;function l(m,p){if(Array.isArray(m))return[0,1].map(f=>p(m[f]))}s(l,"readPair"),n.readPair=l;function u(m,p){let f=a(m)??{};return Object.fromEntries(Object.entries(f).map(([_,g])=>[_,p(g)]))}s(u,"readMap"),n.readMap=u;function c(m,p,f){let _=p(m);return _?f(_):void 0}s(c,"compose"),n.compose=c;function d(m,p){return typeof m!="string"?p[0]:p.includes(m)?m:p[0]}s(d,"readEnum"),n.readEnum=d})(lt||(lt={}));var $n=class{source;cursor;constructor(e){this.source=e,this.cursor=0}get remainingLength(){return this.source.length-this.cursor}get totalLength(){return this.source.length}getRead(e=0){return this.source.substring(e,this.cursor)}getRemaining(){return this.source.substring(this.cursor)}canRead(e=1){return this.cursor+e<=this.source.length}peek(e=0){return this.source.charAt(this.cursor+e)}read(){return this.source.charAt(this.cursor++)}skip(){this.cursor+=1}skipWhitespace(){for(;this.canRead()&&$n.isWhitespace(this.peek());)this.skip()}expect(e,t=!1){if(t&&this.skipWhitespace(),!this.canRead()||this.peek()!==e)throw this.createError(`Expected '${e}'`);this.skip()}readInt(){let e=this.cursor;for(;this.canRead()&&$n.isAllowedInNumber(this.peek());)this.skip();let t=this.getRead(e);if(t.length===0)throw this.createError("Expected integer");try{let i=Number(t);if(isNaN(i)||!Number.isInteger(i))throw new Error;return i}catch{throw this.cursor=e,this.createError(`Invalid integer '${t}'`)}}readFloat(){let e=this.cursor;for(;this.canRead()&&$n.isAllowedInNumber(this.peek());)this.skip();let t=this.getRead(e);if(t.length===0)throw this.createError("Expected float");try{let i=Number(t);if(isNaN(i))throw new Error;return i}catch{throw this.cursor=e,this.createError(`Invalid float '${t}'`)}}readUnquotedString(){let e=this.cursor;for(;this.canRead()&&$n.isAllowedInUnquotedString(this.peek());)this.skip();return this.getRead(e)}readQuotedString(){if(!this.canRead())return"";let e=this.peek();if(!$n.isQuotedStringStart(e))throw this.createError("Expected quote to start a string");return this.skip(),this.readStringUntil(e)}readString(){if(!this.canRead())return"";let e=this.peek();return $n.isQuotedStringStart(e)?(this.skip(),this.readStringUntil(e)):this.readUnquotedString()}readStringUntil(e){let t=[],i=!1;for(;this.canRead();){let r=this.read();if(i)if(r===e||r==="\\")t.push(r),i=!1;else throw this.cursor-=1,this.createError(`Invalid escape sequence '${r}' in quoted string`);else if(r==="\\")i=!0;else{if(r===e)return t.join("");t.push(r)}}throw this.createError("Unclosed quoted string")}readBoolean(){let e=this.cursor,t=this.readUnquotedString();if(t.length===0)throw this.createError("Expected bool");if(t==="true")return!0;if(t==="false")return!1;throw this.cursor=e,this.createError(`Invalid bool, expected true or false but found '${t}'`)}static isAllowedInNumber(e){return e>="0"&&e<="9"||e==="."||e==="-"}static isAllowedInUnquotedString(e){return e>="0"&&e<="9"||e>="A"&&e<="Z"||e>="a"&&e<="z"||e==="_"||e==="-"||e==="."||e==="+"}static isQuotedStringStart(e){return e==="'"||e==='"'}static isWhitespace(e){return e===" "||e===" "||e===` +`||e==="\r"}createError(e){let t=Math.min(this.source.length,this.cursor),i=(t>10?"...":"")+this.source.substring(Math.max(0,t-10),t);return new Error(`${e} at position ${this.cursor}: ${i}<--[HERE]`)}};s($n,"StringReader");function Fo(n){let e=n.length;for(;--e>=0;)n[e]=0}s(Fo,"zero$1");var mM=0,yh=1,pM=2,_M=3,gM=258,Jf=29,sl=256,Qs=sl+1+Jf,Ro=30,Hf=19,wh=2*Qs+1,Pa=15,wf=16,hM=7,$f=256,xh=16,kh=17,Eh=18,Df=new Uint8Array([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]),Nc=new Uint8Array([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]),bM=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Th=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),vM=512,Gr=new Array((Qs+2)*2);Fo(Gr);var Zs=new Array(Ro*2);Fo(Zs);var el=new Array(vM);Fo(el);var tl=new Array(gM-_M+1);Fo(tl);var qf=new Array(Jf);Fo(qf);var Bc=new Array(Ro);Fo(Bc);function xf(n,e,t,i,r){this.static_tree=n,this.extra_bits=e,this.extra_base=t,this.elems=i,this.max_length=r,this.has_stree=n&&n.length}s(xf,"StaticTreeDesc");var Ch,Ah,Sh;function kf(n,e){this.dyn_tree=n,this.max_code=0,this.stat_desc=e}s(kf,"TreeDesc");var jh=s(n=>n<256?el[n]:el[256+(n>>>7)],"d_code"),nl=s((n,e)=>{n.pending_buf[n.pending++]=e&255,n.pending_buf[n.pending++]=e>>>8&255},"put_short"),hi=s((n,e,t)=>{n.bi_valid>wf-t?(n.bi_buf|=e<>wf-n.bi_valid,n.bi_valid+=t-wf):(n.bi_buf|=e<{hi(n,t[e*2],t[e*2+1])},"send_code"),Ih=s((n,e)=>{let t=0;do t|=n&1,n>>>=1,t<<=1;while(--e>0);return t>>>1},"bi_reverse"),yM=s(n=>{n.bi_valid===16?(nl(n,n.bi_buf),n.bi_buf=0,n.bi_valid=0):n.bi_valid>=8&&(n.pending_buf[n.pending++]=n.bi_buf&255,n.bi_buf>>=8,n.bi_valid-=8)},"bi_flush"),wM=s((n,e)=>{let t=e.dyn_tree,i=e.max_code,r=e.stat_desc.static_tree,a=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,l=e.stat_desc.extra_base,u=e.stat_desc.max_length,c,d,m,p,f,_,g=0;for(p=0;p<=Pa;p++)n.bl_count[p]=0;for(t[n.heap[n.heap_max]*2+1]=0,c=n.heap_max+1;cu&&(p=u,g++),t[d*2+1]=p,!(d>i)&&(n.bl_count[p]++,f=0,d>=l&&(f=o[d-l]),_=t[d*2],n.opt_len+=_*(p+f),a&&(n.static_len+=_*(r[d*2+1]+f)));if(g!==0){do{for(p=u-1;n.bl_count[p]===0;)p--;n.bl_count[p]--,n.bl_count[p+1]+=2,n.bl_count[u]--,g-=2}while(g>0);for(p=u;p!==0;p--)for(d=n.bl_count[p];d!==0;)m=n.heap[--c],!(m>i)&&(t[m*2+1]!==p&&(n.opt_len+=(p-t[m*2+1])*t[m*2],t[m*2+1]=p),d--)}},"gen_bitlen"),Oh=s((n,e,t)=>{let i=new Array(Pa+1),r=0,a,o;for(a=1;a<=Pa;a++)r=r+t[a-1]<<1,i[a]=r;for(o=0;o<=e;o++){let l=n[o*2+1];l!==0&&(n[o*2]=Ih(i[l]++,l))}},"gen_codes"),xM=s(()=>{let n,e,t,i,r,a=new Array(Pa+1);for(t=0,i=0;i>=7;i{let e;for(e=0;e{n.bi_valid>8?nl(n,n.bi_buf):n.bi_valid>0&&(n.pending_buf[n.pending++]=n.bi_buf),n.bi_buf=0,n.bi_valid=0},"bi_windup"),Mg=s((n,e,t,i)=>{let r=e*2,a=t*2;return n[r]{let i=n.heap[t],r=t<<1;for(;r<=n.heap_len&&(r{let i,r,a=0,o,l;if(n.sym_next!==0)do i=n.pending_buf[n.sym_buf+a++]&255,i+=(n.pending_buf[n.sym_buf+a++]&255)<<8,r=n.pending_buf[n.sym_buf+a++],i===0?Er(n,r,e):(o=tl[r],Er(n,o+sl+1,e),l=Df[o],l!==0&&(r-=qf[o],hi(n,r,l)),i--,o=jh(i),Er(n,o,t),l=Nc[o],l!==0&&(i-=Bc[o],hi(n,i,l)));while(a{let t=e.dyn_tree,i=e.stat_desc.static_tree,r=e.stat_desc.has_stree,a=e.stat_desc.elems,o,l,u=-1,c;for(n.heap_len=0,n.heap_max=wh,o=0;o>1;o>=1;o--)Ef(n,t,o);c=a;do o=n.heap[1],n.heap[1]=n.heap[n.heap_len--],Ef(n,t,1),l=n.heap[1],n.heap[--n.heap_max]=o,n.heap[--n.heap_max]=l,t[c*2]=t[o*2]+t[l*2],n.depth[c]=(n.depth[o]>=n.depth[l]?n.depth[o]:n.depth[l])+1,t[o*2+1]=t[l*2+1]=c,n.heap[1]=c++,Ef(n,t,1);while(n.heap_len>=2);n.heap[--n.heap_max]=n.heap[1],wM(n,e),Oh(t,u,n.bl_count)},"build_tree"),Lg=s((n,e,t)=>{let i,r=-1,a,o=e[0*2+1],l=0,u=7,c=4;for(o===0&&(u=138,c=3),e[(t+1)*2+1]=65535,i=0;i<=t;i++)a=o,o=e[(i+1)*2+1],!(++l{let i,r=-1,a,o=e[0*2+1],l=0,u=7,c=4;for(o===0&&(u=138,c=3),i=0;i<=t;i++)if(a=o,o=e[(i+1)*2+1],!(++l{let e;for(Lg(n,n.dyn_ltree,n.l_desc.max_code),Lg(n,n.dyn_dtree,n.d_desc.max_code),Mf(n,n.bl_desc),e=Hf-1;e>=3&&n.bl_tree[Th[e]*2+1]===0;e--);return n.opt_len+=3*(e+1)+5+5+4,e},"build_bl_tree"),EM=s((n,e,t,i)=>{let r;for(hi(n,e-257,5),hi(n,t-1,5),hi(n,i-4,4),r=0;r{let e=4093624447,t;for(t=0;t<=31;t++,e>>>=1)if(e&1&&n.dyn_ltree[t*2]!==0)return 0;if(n.dyn_ltree[9*2]!==0||n.dyn_ltree[10*2]!==0||n.dyn_ltree[13*2]!==0)return 1;for(t=32;t{Vg||(xM(),Vg=!0),n.l_desc=new kf(n.dyn_ltree,Ch),n.d_desc=new kf(n.dyn_dtree,Ah),n.bl_desc=new kf(n.bl_tree,Sh),n.bi_buf=0,n.bi_valid=0,Nh(n)},"_tr_init$1"),Rh=s((n,e,t,i)=>{hi(n,(mM<<1)+(i?1:0),3),Bh(n),nl(n,t),nl(n,~t),t&&n.pending_buf.set(n.window.subarray(e,e+t),n.pending),n.pending+=t},"_tr_stored_block$1"),AM=s(n=>{hi(n,yh<<1,3),Er(n,$f,Gr),yM(n)},"_tr_align$1"),SM=s((n,e,t,i)=>{let r,a,o=0;n.level>0?(n.strm.data_type===2&&(n.strm.data_type=TM(n)),Mf(n,n.l_desc),Mf(n,n.d_desc),o=kM(n),r=n.opt_len+3+7>>>3,a=n.static_len+3+7>>>3,a<=r&&(r=a)):r=a=t+5,t+4<=r&&e!==-1?Rh(n,e,t,i):n.strategy===4||a===r?(hi(n,(yh<<1)+(i?1:0),3),Fg(n,Gr,Zs)):(hi(n,(pM<<1)+(i?1:0),3),EM(n,n.l_desc.max_code+1,n.d_desc.max_code+1,o+1),Fg(n,n.dyn_ltree,n.dyn_dtree)),Nh(n),i&&Bh(n)},"_tr_flush_block$1"),jM=s((n,e,t)=>(n.pending_buf[n.sym_buf+n.sym_next++]=e,n.pending_buf[n.sym_buf+n.sym_next++]=e>>8,n.pending_buf[n.sym_buf+n.sym_next++]=t,e===0?n.dyn_ltree[t*2]++:(n.matches++,e--,n.dyn_ltree[(tl[t]+sl+1)*2]++,n.dyn_dtree[jh(e)*2]++),n.sym_next===n.sym_end),"_tr_tally$1"),IM=CM,OM=Rh,NM=SM,BM=jM,RM=AM,DM={_tr_init:IM,_tr_stored_block:OM,_tr_flush_block:NM,_tr_tally:BM,_tr_align:RM},MM=s((n,e,t,i)=>{let r=n&65535|0,a=n>>>16&65535|0,o=0;for(;t!==0;){o=t>2e3?2e3:t,t-=o;do r=r+e[i++]|0,a=a+r|0;while(--o);r%=65521,a%=65521}return r|a<<16|0},"adler32"),il=MM,FM=s(()=>{let n,e=[];for(var t=0;t<256;t++){n=t;for(var i=0;i<8;i++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e},"makeTable"),LM=new Uint32Array(FM()),PM=s((n,e,t,i)=>{let r=LM,a=i+t;n^=-1;for(let o=i;o>>8^r[(n^e[o])&255];return n^-1},"crc32"),Ln=PM,Ga={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"},Ha={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_MEM_ERROR:-4,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},{_tr_init:VM,_tr_stored_block:Ff,_tr_flush_block:zM,_tr_tally:la,_tr_align:GM}=DM,{Z_NO_FLUSH:ca,Z_PARTIAL_FLUSH:UM,Z_FULL_FLUSH:JM,Z_FINISH:Pi,Z_BLOCK:zg,Z_OK:qn,Z_STREAM_END:Gg,Z_STREAM_ERROR:Tr,Z_DATA_ERROR:HM,Z_BUF_ERROR:Tf,Z_DEFAULT_COMPRESSION:$M,Z_FILTERED:qM,Z_HUFFMAN_ONLY:Ac,Z_RLE:KM,Z_FIXED:WM,Z_DEFAULT_STRATEGY:ZM,Z_UNKNOWN:XM,Z_DEFLATED:Mc}=Ha,YM=9,QM=15,eF=8,tF=29,nF=256,Lf=nF+1+tF,iF=30,rF=19,aF=2*Lf+1,oF=15,jt=3,sa=258,Cr=sa+jt+1,sF=32,Do=42,Kf=57,Pf=69,Vf=73,zf=91,Gf=103,Va=113,Ks=666,di=1,Lo=2,Ua=3,Po=4,lF=3,za=s((n,e)=>(n.msg=Ga[e],e),"err"),Ug=s(n=>n*2-(n>4?9:0),"rank"),oa=s(n=>{let e=n.length;for(;--e>=0;)n[e]=0},"zero"),cF=s(n=>{let e,t,i,r=n.w_size;e=n.hash_size,i=e;do t=n.head[--i],n.head[i]=t>=r?t-r:0;while(--e);e=r,i=e;do t=n.prev[--i],n.prev[i]=t>=r?t-r:0;while(--e)},"slide_hash"),uF=s((n,e,t)=>(e<{let e=n.state,t=e.pending;t>n.avail_out&&(t=n.avail_out),t!==0&&(n.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+t),n.next_out),n.next_out+=t,e.pending_out+=t,n.total_out+=t,n.avail_out-=t,e.pending-=t,e.pending===0&&(e.pending_out=0))},"flush_pending"),ji=s((n,e)=>{zM(n,n.block_start>=0?n.block_start:-1,n.strstart-n.block_start,e),n.block_start=n.strstart,Si(n.strm)},"flush_block_only"),Gt=s((n,e)=>{n.pending_buf[n.pending++]=e},"put_byte"),qs=s((n,e)=>{n.pending_buf[n.pending++]=e>>>8&255,n.pending_buf[n.pending++]=e&255},"putShortMSB"),Uf=s((n,e,t,i)=>{let r=n.avail_in;return r>i&&(r=i),r===0?0:(n.avail_in-=r,e.set(n.input.subarray(n.next_in,n.next_in+r),t),n.state.wrap===1?n.adler=il(n.adler,e,r,t):n.state.wrap===2&&(n.adler=Ln(n.adler,e,r,t)),n.next_in+=r,n.total_in+=r,r)},"read_buf"),Dh=s((n,e)=>{let t=n.max_chain_length,i=n.strstart,r,a,o=n.prev_length,l=n.nice_match,u=n.strstart>n.w_size-Cr?n.strstart-(n.w_size-Cr):0,c=n.window,d=n.w_mask,m=n.prev,p=n.strstart+sa,f=c[i+o-1],_=c[i+o];n.prev_length>=n.good_match&&(t>>=2),l>n.lookahead&&(l=n.lookahead);do if(r=e,!(c[r+o]!==_||c[r+o-1]!==f||c[r]!==c[i]||c[++r]!==c[i+1])){i+=2,r++;do;while(c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&io){if(n.match_start=e,o=a,a>=l)break;f=c[i+o-1],_=c[i+o]}}while((e=m[e&d])>u&&--t!==0);return o<=n.lookahead?o:n.lookahead},"longest_match"),Mo=s(n=>{let e=n.w_size,t,i,r;do{if(i=n.window_size-n.lookahead-n.strstart,n.strstart>=e+(e-Cr)&&(n.window.set(n.window.subarray(e,e+e-i),0),n.match_start-=e,n.strstart-=e,n.block_start-=e,n.insert>n.strstart&&(n.insert=n.strstart),cF(n),i+=e),n.strm.avail_in===0)break;if(t=Uf(n.strm,n.window,n.strstart+n.lookahead,i),n.lookahead+=t,n.lookahead+n.insert>=jt)for(r=n.strstart-n.insert,n.ins_h=n.window[r],n.ins_h=ua(n,n.ins_h,n.window[r+1]);n.insert&&(n.ins_h=ua(n,n.ins_h,n.window[r+jt-1]),n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++,n.insert--,!(n.lookahead+n.insert{let t=n.pending_buf_size-5>n.w_size?n.w_size:n.pending_buf_size-5,i,r,a,o=0,l=n.strm.avail_in;do{if(i=65535,a=n.bi_valid+42>>3,n.strm.avail_outr+n.strm.avail_in&&(i=r+n.strm.avail_in),i>a&&(i=a),i>8,n.pending_buf[n.pending-2]=~i,n.pending_buf[n.pending-1]=~i>>8,Si(n.strm),r&&(r>i&&(r=i),n.strm.output.set(n.window.subarray(n.block_start,n.block_start+r),n.strm.next_out),n.strm.next_out+=r,n.strm.avail_out-=r,n.strm.total_out+=r,n.block_start+=r,i-=r),i&&(Uf(n.strm,n.strm.output,n.strm.next_out,i),n.strm.next_out+=i,n.strm.avail_out-=i,n.strm.total_out+=i)}while(o===0);return l-=n.strm.avail_in,l&&(l>=n.w_size?(n.matches=2,n.window.set(n.strm.input.subarray(n.strm.next_in-n.w_size,n.strm.next_in),0),n.strstart=n.w_size,n.insert=n.strstart):(n.window_size-n.strstart<=l&&(n.strstart-=n.w_size,n.window.set(n.window.subarray(n.w_size,n.w_size+n.strstart),0),n.matches<2&&n.matches++,n.insert>n.strstart&&(n.insert=n.strstart)),n.window.set(n.strm.input.subarray(n.strm.next_in-l,n.strm.next_in),n.strstart),n.strstart+=l,n.insert+=l>n.w_size-n.insert?n.w_size-n.insert:l),n.block_start=n.strstart),n.high_watera&&n.block_start>=n.w_size&&(n.block_start-=n.w_size,n.strstart-=n.w_size,n.window.set(n.window.subarray(n.w_size,n.w_size+n.strstart),0),n.matches<2&&n.matches++,a+=n.w_size,n.insert>n.strstart&&(n.insert=n.strstart)),a>n.strm.avail_in&&(a=n.strm.avail_in),a&&(Uf(n.strm,n.window,n.strstart,a),n.strstart+=a,n.insert+=a>n.w_size-n.insert?n.w_size-n.insert:a),n.high_water>3,a=n.pending_buf_size-a>65535?65535:n.pending_buf_size-a,t=a>n.w_size?n.w_size:a,r=n.strstart-n.block_start,(r>=t||(r||e===Pi)&&e!==ca&&n.strm.avail_in===0&&r<=a)&&(i=r>a?a:r,o=e===Pi&&n.strm.avail_in===0&&i===r?1:0,Ff(n,n.block_start,i,o),n.block_start+=i,Si(n.strm)),o?Ua:di)},"deflate_stored"),Cf=s((n,e)=>{let t,i;for(;;){if(n.lookahead=jt&&(n.ins_h=ua(n,n.ins_h,n.window[n.strstart+jt-1]),t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart),t!==0&&n.strstart-t<=n.w_size-Cr&&(n.match_length=Dh(n,t)),n.match_length>=jt)if(i=la(n,n.strstart-n.match_start,n.match_length-jt),n.lookahead-=n.match_length,n.match_length<=n.max_lazy_match&&n.lookahead>=jt){n.match_length--;do n.strstart++,n.ins_h=ua(n,n.ins_h,n.window[n.strstart+jt-1]),t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart;while(--n.match_length!==0);n.strstart++}else n.strstart+=n.match_length,n.match_length=0,n.ins_h=n.window[n.strstart],n.ins_h=ua(n,n.ins_h,n.window[n.strstart+1]);else i=la(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++;if(i&&(ji(n,!1),n.strm.avail_out===0))return di}return n.insert=n.strstart{let t,i,r;for(;;){if(n.lookahead=jt&&(n.ins_h=ua(n,n.ins_h,n.window[n.strstart+jt-1]),t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart),n.prev_length=n.match_length,n.prev_match=n.match_start,n.match_length=jt-1,t!==0&&n.prev_length4096)&&(n.match_length=jt-1)),n.prev_length>=jt&&n.match_length<=n.prev_length){r=n.strstart+n.lookahead-jt,i=la(n,n.strstart-1-n.prev_match,n.prev_length-jt),n.lookahead-=n.prev_length-1,n.prev_length-=2;do++n.strstart<=r&&(n.ins_h=ua(n,n.ins_h,n.window[n.strstart+jt-1]),t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart);while(--n.prev_length!==0);if(n.match_available=0,n.match_length=jt-1,n.strstart++,i&&(ji(n,!1),n.strm.avail_out===0))return di}else if(n.match_available){if(i=la(n,0,n.window[n.strstart-1]),i&&ji(n,!1),n.strstart++,n.lookahead--,n.strm.avail_out===0)return di}else n.match_available=1,n.strstart++,n.lookahead--}return n.match_available&&(i=la(n,0,n.window[n.strstart-1]),n.match_available=0),n.insert=n.strstart{let t,i,r,a,o=n.window;for(;;){if(n.lookahead<=sa){if(Mo(n),n.lookahead<=sa&&e===ca)return di;if(n.lookahead===0)break}if(n.match_length=0,n.lookahead>=jt&&n.strstart>0&&(r=n.strstart-1,i=o[r],i===o[++r]&&i===o[++r]&&i===o[++r])){a=n.strstart+sa;do;while(i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&rn.lookahead&&(n.match_length=n.lookahead)}if(n.match_length>=jt?(t=la(n,1,n.match_length-jt),n.lookahead-=n.match_length,n.strstart+=n.match_length,n.match_length=0):(t=la(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++),t&&(ji(n,!1),n.strm.avail_out===0))return di}return n.insert=0,e===Pi?(ji(n,!0),n.strm.avail_out===0?Ua:Po):n.sym_next&&(ji(n,!1),n.strm.avail_out===0)?di:Lo},"deflate_rle"),fF=s((n,e)=>{let t;for(;;){if(n.lookahead===0&&(Mo(n),n.lookahead===0)){if(e===ca)return di;break}if(n.match_length=0,t=la(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++,t&&(ji(n,!1),n.strm.avail_out===0))return di}return n.insert=0,e===Pi?(ji(n,!0),n.strm.avail_out===0?Ua:Po):n.sym_next&&(ji(n,!1),n.strm.avail_out===0)?di:Lo},"deflate_huff");function kr(n,e,t,i,r){this.good_length=n,this.max_lazy=e,this.nice_length=t,this.max_chain=i,this.func=r}s(kr,"Config");var Ws=[new kr(0,0,0,0,Mh),new kr(4,4,8,4,Cf),new kr(4,5,16,8,Cf),new kr(4,6,32,32,Cf),new kr(4,4,16,16,No),new kr(8,16,32,32,No),new kr(8,16,128,128,No),new kr(8,32,128,256,No),new kr(32,128,258,1024,No),new kr(32,258,258,4096,No)],mF=s(n=>{n.window_size=2*n.w_size,oa(n.head),n.max_lazy_match=Ws[n.level].max_lazy,n.good_match=Ws[n.level].good_length,n.nice_match=Ws[n.level].nice_length,n.max_chain_length=Ws[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=jt-1,n.match_available=0,n.ins_h=0},"lm_init");function pF(){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=Mc,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 Uint16Array(aF*2),this.dyn_dtree=new Uint16Array((2*iF+1)*2),this.bl_tree=new Uint16Array((2*rF+1)*2),oa(this.dyn_ltree),oa(this.dyn_dtree),oa(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(oF+1),this.heap=new Uint16Array(2*Lf+1),oa(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Lf+1),oa(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}s(pF,"DeflateState");var ll=s(n=>{if(!n)return 1;let e=n.state;return!e||e.strm!==n||e.status!==Do&&e.status!==Kf&&e.status!==Pf&&e.status!==Vf&&e.status!==zf&&e.status!==Gf&&e.status!==Va&&e.status!==Ks?1:0},"deflateStateCheck"),Fh=s(n=>{if(ll(n))return za(n,Tr);n.total_in=n.total_out=0,n.data_type=XM;let e=n.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?Kf:e.wrap?Do:Va,n.adler=e.wrap===2?0:1,e.last_flush=-2,VM(e),qn},"deflateResetKeep"),Lh=s(n=>{let e=Fh(n);return e===qn&&mF(n.state),e},"deflateReset"),_F=s((n,e)=>ll(n)||n.state.wrap!==2?Tr:(n.state.gzhead=e,qn),"deflateSetHeader"),Ph=s((n,e,t,i,r,a)=>{if(!n)return Tr;let o=1;if(e===$M&&(e=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),r<1||r>YM||t!==Mc||i<8||i>15||e<0||e>9||a<0||a>WM||i===8&&o!==1)return za(n,Tr);i===8&&(i=9);let l=new pF;return n.state=l,l.strm=n,l.status=Do,l.wrap=o,l.gzhead=null,l.w_bits=i,l.w_size=1<Ph(n,e,Mc,QM,eF,ZM),"deflateInit"),hF=s((n,e)=>{if(ll(n)||e>zg||e<0)return n?za(n,Tr):Tr;let t=n.state;if(!n.output||n.avail_in!==0&&!n.input||t.status===Ks&&e!==Pi)return za(n,n.avail_out===0?Tf:Tr);let i=t.last_flush;if(t.last_flush=e,t.pending!==0){if(Si(n),n.avail_out===0)return t.last_flush=-1,qn}else if(n.avail_in===0&&Ug(e)<=Ug(i)&&e!==Pi)return za(n,Tf);if(t.status===Ks&&n.avail_in!==0)return za(n,Tf);if(t.status===Do&&t.wrap===0&&(t.status=Va),t.status===Do){let r=Mc+(t.w_bits-8<<4)<<8,a=-1;if(t.strategy>=Ac||t.level<2?a=0:t.level<6?a=1:t.level===6?a=2:a=3,r|=a<<6,t.strstart!==0&&(r|=sF),r+=31-r%31,qs(t,r),t.strstart!==0&&(qs(t,n.adler>>>16),qs(t,n.adler&65535)),n.adler=1,t.status=Va,Si(n),t.pending!==0)return t.last_flush=-1,qn}if(t.status===Kf){if(n.adler=0,Gt(t,31),Gt(t,139),Gt(t,8),t.gzhead)Gt(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),Gt(t,t.gzhead.time&255),Gt(t,t.gzhead.time>>8&255),Gt(t,t.gzhead.time>>16&255),Gt(t,t.gzhead.time>>24&255),Gt(t,t.level===9?2:t.strategy>=Ac||t.level<2?4:0),Gt(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(Gt(t,t.gzhead.extra.length&255),Gt(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(n.adler=Ln(n.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=Pf;else if(Gt(t,0),Gt(t,0),Gt(t,0),Gt(t,0),Gt(t,0),Gt(t,t.level===9?2:t.strategy>=Ac||t.level<2?4:0),Gt(t,lF),t.status=Va,Si(n),t.pending!==0)return t.last_flush=-1,qn}if(t.status===Pf){if(t.gzhead.extra){let r=t.pending,a=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+a>t.pending_buf_size;){let l=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+l),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>r&&(n.adler=Ln(n.adler,t.pending_buf,t.pending-r,r)),t.gzindex+=l,Si(n),t.pending!==0)return t.last_flush=-1,qn;r=0,a-=l}let o=new Uint8Array(t.gzhead.extra);t.pending_buf.set(o.subarray(t.gzindex,t.gzindex+a),t.pending),t.pending+=a,t.gzhead.hcrc&&t.pending>r&&(n.adler=Ln(n.adler,t.pending_buf,t.pending-r,r)),t.gzindex=0}t.status=Vf}if(t.status===Vf){if(t.gzhead.name){let r=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>r&&(n.adler=Ln(n.adler,t.pending_buf,t.pending-r,r)),Si(n),t.pending!==0)return t.last_flush=-1,qn;r=0}t.gzindexr&&(n.adler=Ln(n.adler,t.pending_buf,t.pending-r,r)),t.gzindex=0}t.status=zf}if(t.status===zf){if(t.gzhead.comment){let r=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>r&&(n.adler=Ln(n.adler,t.pending_buf,t.pending-r,r)),Si(n),t.pending!==0)return t.last_flush=-1,qn;r=0}t.gzindexr&&(n.adler=Ln(n.adler,t.pending_buf,t.pending-r,r))}t.status=Gf}if(t.status===Gf){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(Si(n),t.pending!==0))return t.last_flush=-1,qn;Gt(t,n.adler&255),Gt(t,n.adler>>8&255),n.adler=0}if(t.status=Va,Si(n),t.pending!==0)return t.last_flush=-1,qn}if(n.avail_in!==0||t.lookahead!==0||e!==ca&&t.status!==Ks){let r=t.level===0?Mh(t,e):t.strategy===Ac?fF(t,e):t.strategy===KM?dF(t,e):Ws[t.level].func(t,e);if((r===Ua||r===Po)&&(t.status=Ks),r===di||r===Ua)return n.avail_out===0&&(t.last_flush=-1),qn;if(r===Lo&&(e===UM?GM(t):e!==zg&&(Ff(t,0,0,!1),e===JM&&(oa(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),Si(n),n.avail_out===0))return t.last_flush=-1,qn}return e!==Pi?qn:t.wrap<=0?Gg:(t.wrap===2?(Gt(t,n.adler&255),Gt(t,n.adler>>8&255),Gt(t,n.adler>>16&255),Gt(t,n.adler>>24&255),Gt(t,n.total_in&255),Gt(t,n.total_in>>8&255),Gt(t,n.total_in>>16&255),Gt(t,n.total_in>>24&255)):(qs(t,n.adler>>>16),qs(t,n.adler&65535)),Si(n),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?qn:Gg)},"deflate$2"),bF=s(n=>{if(ll(n))return Tr;let e=n.state.status;return n.state=null,e===Va?za(n,HM):qn},"deflateEnd"),vF=s((n,e)=>{let t=e.length;if(ll(n))return Tr;let i=n.state,r=i.wrap;if(r===2||r===1&&i.status!==Do||i.lookahead)return Tr;if(r===1&&(n.adler=il(n.adler,e,t,0)),i.wrap=0,t>=i.w_size){r===0&&(oa(i.head),i.strstart=0,i.block_start=0,i.insert=0);let u=new Uint8Array(i.w_size);u.set(e.subarray(t-i.w_size,t),0),e=u,t=i.w_size}let a=n.avail_in,o=n.next_in,l=n.input;for(n.avail_in=t,n.next_in=0,n.input=e,Mo(i);i.lookahead>=jt;){let u=i.strstart,c=i.lookahead-(jt-1);do i.ins_h=ua(i,i.ins_h,i.window[u+jt-1]),i.prev[u&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=u,u++;while(--c);i.strstart=u,i.lookahead=jt-1,Mo(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=jt-1,i.match_available=0,n.next_in=o,n.input=l,n.avail_in=a,i.wrap=r,qn},"deflateSetDictionary"),yF=gF,wF=Ph,xF=Lh,kF=Fh,EF=_F,TF=hF,CF=bF,AF=vF,SF="pako deflate (from Nodeca project)",Xs={deflateInit:yF,deflateInit2:wF,deflateReset:xF,deflateResetKeep:kF,deflateSetHeader:EF,deflate:TF,deflateEnd:CF,deflateSetDictionary:AF,deflateInfo:SF},jF=s((n,e)=>Object.prototype.hasOwnProperty.call(n,e),"_has"),IF=s(function(n){let e=Array.prototype.slice.call(arguments,1);for(;e.length;){let t=e.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(let i in t)jF(t,i)&&(n[i]=t[i])}}return n},"assign"),OF=s(n=>{let e=0;for(let i=0,r=n.length;i=252?6:n>=248?5:n>=240?4:n>=224?3:n>=192?2:1;rl[254]=rl[254]=1;var NF=s(n=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(n);let e,t,i,r,a,o=n.length,l=0;for(r=0;r>>6,e[a++]=128|t&63):t<65536?(e[a++]=224|t>>>12,e[a++]=128|t>>>6&63,e[a++]=128|t&63):(e[a++]=240|t>>>18,e[a++]=128|t>>>12&63,e[a++]=128|t>>>6&63,e[a++]=128|t&63);return e},"string2buf"),BF=s((n,e)=>{if(e<65534&&n.subarray&&Vh)return String.fromCharCode.apply(null,n.length===e?n:n.subarray(0,e));let t="";for(let i=0;i{let t=e||n.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(n.subarray(0,e));let i,r,a=new Array(t*2);for(r=0,i=0;i4){a[r++]=65533,i+=l-1;continue}for(o&=l===2?31:l===3?15:7;l>1&&i1){a[r++]=65533;continue}o<65536?a[r++]=o:(o-=65536,a[r++]=55296|o>>10&1023,a[r++]=56320|o&1023)}return BF(a,r)},"buf2string"),DF=s((n,e)=>{e=e||n.length,e>n.length&&(e=n.length);let t=e-1;for(;t>=0&&(n[t]&192)===128;)t--;return t<0||t===0?e:t+rl[n[t]]>e?t:e},"utf8border"),al={string2buf:NF,buf2string:RF,utf8border:DF};function MF(){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}s(MF,"ZStream");var zh=MF,Gh=Object.prototype.toString,{Z_NO_FLUSH:FF,Z_SYNC_FLUSH:LF,Z_FULL_FLUSH:PF,Z_FINISH:VF,Z_OK:Rc,Z_STREAM_END:zF,Z_DEFAULT_COMPRESSION:GF,Z_DEFAULT_STRATEGY:UF,Z_DEFLATED:JF}=Ha;function cl(n){this.options=Fc.assign({level:GF,method:JF,chunkSize:16384,windowBits:15,memLevel:8,strategy:UF},n||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zh,this.strm.avail_out=0;let t=Xs.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(t!==Rc)throw new Error(Ga[t]);if(e.header&&Xs.deflateSetHeader(this.strm,e.header),e.dictionary){let i;if(typeof e.dictionary=="string"?i=al.string2buf(e.dictionary):Gh.call(e.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(e.dictionary):i=e.dictionary,t=Xs.deflateSetDictionary(this.strm,i),t!==Rc)throw new Error(Ga[t]);this._dict_set=!0}}s(cl,"Deflate$1");cl.prototype.push=function(n,e){let t=this.strm,i=this.options.chunkSize,r,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?VF:FF,typeof n=="string"?t.input=al.string2buf(n):Gh.call(n)==="[object ArrayBuffer]"?t.input=new Uint8Array(n):t.input=n,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),(a===LF||a===PF)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(r=Xs.deflate(t,a),r===zF)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),r=Xs.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Rc;if(t.avail_out===0){this.onData(t.output);continue}if(a>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0};cl.prototype.onData=function(n){this.chunks.push(n)};cl.prototype.onEnd=function(n){n===Rc&&(this.result=Fc.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function Wf(n,e){let t=new cl(e);if(t.push(n,!0),t.err)throw t.msg||Ga[t.err];return t.result}s(Wf,"deflate$1");function HF(n,e){return e=e||{},e.raw=!0,Wf(n,e)}s(HF,"deflateRaw$1");function $F(n,e){return e=e||{},e.gzip=!0,Wf(n,e)}s($F,"gzip$1");var qF=cl,KF=Wf,WF=HF,ZF=$F,XF=Ha,YF={Deflate:qF,deflate:KF,deflateRaw:WF,gzip:ZF,constants:XF},Sc=16209,QF=16191,eL=s(function(e,t){let i,r,a,o,l,u,c,d,m,p,f,_,g,h,v,y,k,b,x,E,C,j,S,B,O=e.state;i=e.next_in,S=e.input,r=i+(e.avail_in-5),a=e.next_out,B=e.output,o=a-(t-e.avail_out),l=a+(e.avail_out-257),u=O.dmax,c=O.wsize,d=O.whave,m=O.wnext,p=O.window,f=O.hold,_=O.bits,g=O.lencode,h=O.distcode,v=(1<>>24,f>>>=b,_-=b,b=k>>>16&255,b===0)B[a++]=k&65535;else if(b&16){x=k&65535,b&=15,b&&(_>>=b,_-=b),_<15&&(f+=S[i++]<<_,_+=8,f+=S[i++]<<_,_+=8),k=h[f&y];n:for(;;){if(b=k>>>24,f>>>=b,_-=b,b=k>>>16&255,b&16){if(E=k&65535,b&=15,_u){e.msg="invalid distance too far back",O.mode=Sc;break e}if(f>>>=b,_-=b,b=a-o,E>b){if(b=E-b,b>d&&O.sane){e.msg="invalid distance too far back",O.mode=Sc;break e}if(C=0,j=p,m===0){if(C+=c-b,b2;)B[a++]=j[C++],B[a++]=j[C++],B[a++]=j[C++],x-=3;x&&(B[a++]=j[C++],x>1&&(B[a++]=j[C++]))}else{C=a-E;do B[a++]=B[C++],B[a++]=B[C++],B[a++]=B[C++],x-=3;while(x>2);x&&(B[a++]=B[C++],x>1&&(B[a++]=B[C++]))}}else if(b&64){e.msg="invalid distance code",O.mode=Sc;break e}else{k=h[(k&65535)+(f&(1<>3,i-=x,_-=x<<3,f&=(1<<_)-1,e.next_in=i,e.next_out=a,e.avail_in=i{let u=l.bits,c=0,d=0,m=0,p=0,f=0,_=0,g=0,h=0,v=0,y=0,k,b,x,E,C,j=null,S,B=new Uint16Array(Bo+1),O=new Uint16Array(Bo+1),A=null,V,K,te;for(c=0;c<=Bo;c++)B[c]=0;for(d=0;d=1&&B[p]===0;p--);if(f>p&&(f=p),p===0)return r[a++]=1<<24|64<<16|0,r[a++]=1<<24|64<<16|0,l.bits=1,0;for(m=1;m0&&(n===$g||p!==1))return-1;for(O[1]=0,c=1;cJg||n===qg&&v>Hg)return 1;for(;;){V=c-g,o[d]+1=S?(K=A[o[d]-S],te=j[o[d]-S]):(K=32+64,te=0),k=1<>g)+b]=V<<24|K<<16|te|0;while(b!==0);for(k=1<>=1;if(k!==0?(y&=k-1,y+=k):y=0,d++,--B[c]===0){if(c===p)break;c=e[t+o[d]]}if(c>f&&(y&E)!==x){for(g===0&&(g=f),C+=m,_=c-g,h=1<<_;_+gJg||n===qg&&v>Hg)return 1;x=y&E,r[x]=f<<24|_<<16|C-a|0}}return y!==0&&(r[C+y]=c-g<<24|64<<16|0),l.bits=f,0},"inflate_table"),Ys=aL,oL=0,Uh=1,Jh=2,{Z_FINISH:Kg,Z_BLOCK:sL,Z_TREES:jc,Z_OK:Ja,Z_STREAM_END:lL,Z_NEED_DICT:cL,Z_STREAM_ERROR:Vi,Z_DATA_ERROR:Hh,Z_MEM_ERROR:$h,Z_BUF_ERROR:uL,Z_DEFLATED:Wg}=Ha,Lc=16180,Zg=16181,Xg=16182,Yg=16183,Qg=16184,eh=16185,th=16186,nh=16187,ih=16188,rh=16189,Dc=16190,zr=16191,Sf=16192,ah=16193,jf=16194,oh=16195,sh=16196,lh=16197,ch=16198,Ic=16199,Oc=16200,uh=16201,dh=16202,fh=16203,mh=16204,ph=16205,If=16206,_h=16207,gh=16208,_n=16209,qh=16210,Kh=16211,dL=852,fL=592,mL=15,pL=mL,hh=s(n=>(n>>>24&255)+(n>>>8&65280)+((n&65280)<<8)+((n&255)<<24),"zswap32");function _L(){this.strm=null,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 Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}s(_L,"InflateState");var $a=s(n=>{if(!n)return 1;let e=n.state;return!e||e.strm!==n||e.modeKh?1:0},"inflateStateCheck"),Wh=s(n=>{if($a(n))return Vi;let e=n.state;return n.total_in=n.total_out=e.total=0,n.msg="",e.wrap&&(n.adler=e.wrap&1),e.mode=Lc,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(dL),e.distcode=e.distdyn=new Int32Array(fL),e.sane=1,e.back=-1,Ja},"inflateResetKeep"),Zh=s(n=>{if($a(n))return Vi;let e=n.state;return e.wsize=0,e.whave=0,e.wnext=0,Wh(n)},"inflateReset"),Xh=s((n,e)=>{let t;if($a(n))return Vi;let i=n.state;return e<0?(t=0,e=-e):(t=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Vi:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=t,i.wbits=e,Zh(n))},"inflateReset2"),Yh=s((n,e)=>{if(!n)return Vi;let t=new _L;n.state=t,t.strm=n,t.window=null,t.mode=Lc;let i=Xh(n,e);return i!==Ja&&(n.state=null),i},"inflateInit2"),gL=s(n=>Yh(n,pL),"inflateInit"),bh=!0,Of,Nf,hL=s(n=>{if(bh){Of=new Int32Array(512),Nf=new Int32Array(32);let e=0;for(;e<144;)n.lens[e++]=8;for(;e<256;)n.lens[e++]=9;for(;e<280;)n.lens[e++]=7;for(;e<288;)n.lens[e++]=8;for(Ys(Uh,n.lens,0,288,Of,0,n.work,{bits:9}),e=0;e<32;)n.lens[e++]=5;Ys(Jh,n.lens,0,32,Nf,0,n.work,{bits:5}),bh=!1}n.lencode=Of,n.lenbits=9,n.distcode=Nf,n.distbits=5},"fixedtables"),Qh=s((n,e,t,i)=>{let r,a=n.state;return a.window===null&&(a.wsize=1<=a.wsize?(a.window.set(e.subarray(t-a.wsize,t),0),a.wnext=0,a.whave=a.wsize):(r=a.wsize-a.wnext,r>i&&(r=i),a.window.set(e.subarray(t-i,t-i+r),a.wnext),i-=r,i?(a.window.set(e.subarray(t-i,t),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=r,a.wnext===a.wsize&&(a.wnext=0),a.whave{let t,i,r,a,o,l,u,c,d,m,p,f,_,g,h=0,v,y,k,b,x,E,C,j,S=new Uint8Array(4),B,O,A=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if($a(n)||!n.output||!n.input&&n.avail_in!==0)return Vi;t=n.state,t.mode===zr&&(t.mode=Sf),o=n.next_out,r=n.output,u=n.avail_out,a=n.next_in,i=n.input,l=n.avail_in,c=t.hold,d=t.bits,m=l,p=u,j=Ja;e:for(;;)switch(t.mode){case Lc:if(t.wrap===0){t.mode=Sf;break}for(;d<16;){if(l===0)break e;l--,c+=i[a++]<>>8&255,t.check=Ln(t.check,S,2,0),c=0,d=0,t.mode=Zg;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((c&255)<<8)+(c>>8))%31){n.msg="incorrect header check",t.mode=_n;break}if((c&15)!==Wg){n.msg="unknown compression method",t.mode=_n;break}if(c>>>=4,d-=4,C=(c&15)+8,t.wbits===0&&(t.wbits=C),C>15||C>t.wbits){n.msg="invalid window size",t.mode=_n;break}t.dmax=1<>8&1),t.flags&512&&t.wrap&4&&(S[0]=c&255,S[1]=c>>>8&255,t.check=Ln(t.check,S,2,0)),c=0,d=0,t.mode=Xg;case Xg:for(;d<32;){if(l===0)break e;l--,c+=i[a++]<>>8&255,S[2]=c>>>16&255,S[3]=c>>>24&255,t.check=Ln(t.check,S,4,0)),c=0,d=0,t.mode=Yg;case Yg:for(;d<16;){if(l===0)break e;l--,c+=i[a++]<>8),t.flags&512&&t.wrap&4&&(S[0]=c&255,S[1]=c>>>8&255,t.check=Ln(t.check,S,2,0)),c=0,d=0,t.mode=Qg;case Qg:if(t.flags&1024){for(;d<16;){if(l===0)break e;l--,c+=i[a++]<>>8&255,t.check=Ln(t.check,S,2,0)),c=0,d=0}else t.head&&(t.head.extra=null);t.mode=eh;case eh:if(t.flags&1024&&(f=t.length,f>l&&(f=l),f&&(t.head&&(C=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(i.subarray(a,a+f),C)),t.flags&512&&t.wrap&4&&(t.check=Ln(t.check,i,f,a)),l-=f,a+=f,t.length-=f),t.length))break e;t.length=0,t.mode=th;case th:if(t.flags&2048){if(l===0)break e;f=0;do C=i[a+f++],t.head&&C&&t.length<65536&&(t.head.name+=String.fromCharCode(C));while(C&&f>9&1,t.head.done=!0),n.adler=t.check=0,t.mode=zr;break;case rh:for(;d<32;){if(l===0)break e;l--,c+=i[a++]<>>=d&7,d-=d&7,t.mode=If;break}for(;d<3;){if(l===0)break e;l--,c+=i[a++]<>>=1,d-=1,c&3){case 0:t.mode=ah;break;case 1:if(hL(t),t.mode=Ic,e===jc){c>>>=2,d-=2;break e}break;case 2:t.mode=sh;break;case 3:n.msg="invalid block type",t.mode=_n}c>>>=2,d-=2;break;case ah:for(c>>>=d&7,d-=d&7;d<32;){if(l===0)break e;l--,c+=i[a++]<>>16^65535)){n.msg="invalid stored block lengths",t.mode=_n;break}if(t.length=c&65535,c=0,d=0,t.mode=jf,e===jc)break e;case jf:t.mode=oh;case oh:if(f=t.length,f){if(f>l&&(f=l),f>u&&(f=u),f===0)break e;r.set(i.subarray(a,a+f),o),l-=f,a+=f,u-=f,o+=f,t.length-=f;break}t.mode=zr;break;case sh:for(;d<14;){if(l===0)break e;l--,c+=i[a++]<>>=5,d-=5,t.ndist=(c&31)+1,c>>>=5,d-=5,t.ncode=(c&15)+4,c>>>=4,d-=4,t.nlen>286||t.ndist>30){n.msg="too many length or distance symbols",t.mode=_n;break}t.have=0,t.mode=lh;case lh:for(;t.have>>=3,d-=3}for(;t.have<19;)t.lens[A[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,B={bits:t.lenbits},j=Ys(oL,t.lens,0,19,t.lencode,0,t.work,B),t.lenbits=B.bits,j){n.msg="invalid code lengths set",t.mode=_n;break}t.have=0,t.mode=ch;case ch:for(;t.have>>24,y=h>>>16&255,k=h&65535,!(v<=d);){if(l===0)break e;l--,c+=i[a++]<>>=v,d-=v,t.lens[t.have++]=k;else{if(k===16){for(O=v+2;d>>=v,d-=v,t.have===0){n.msg="invalid bit length repeat",t.mode=_n;break}C=t.lens[t.have-1],f=3+(c&3),c>>>=2,d-=2}else if(k===17){for(O=v+3;d>>=v,d-=v,C=0,f=3+(c&7),c>>>=3,d-=3}else{for(O=v+7;d>>=v,d-=v,C=0,f=11+(c&127),c>>>=7,d-=7}if(t.have+f>t.nlen+t.ndist){n.msg="invalid bit length repeat",t.mode=_n;break}for(;f--;)t.lens[t.have++]=C}}if(t.mode===_n)break;if(t.lens[256]===0){n.msg="invalid code -- missing end-of-block",t.mode=_n;break}if(t.lenbits=9,B={bits:t.lenbits},j=Ys(Uh,t.lens,0,t.nlen,t.lencode,0,t.work,B),t.lenbits=B.bits,j){n.msg="invalid literal/lengths set",t.mode=_n;break}if(t.distbits=6,t.distcode=t.distdyn,B={bits:t.distbits},j=Ys(Jh,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,B),t.distbits=B.bits,j){n.msg="invalid distances set",t.mode=_n;break}if(t.mode=Ic,e===jc)break e;case Ic:t.mode=Oc;case Oc:if(l>=6&&u>=258){n.next_out=o,n.avail_out=u,n.next_in=a,n.avail_in=l,t.hold=c,t.bits=d,eL(n,p),o=n.next_out,r=n.output,u=n.avail_out,a=n.next_in,i=n.input,l=n.avail_in,c=t.hold,d=t.bits,t.mode===zr&&(t.back=-1);break}for(t.back=0;h=t.lencode[c&(1<>>24,y=h>>>16&255,k=h&65535,!(v<=d);){if(l===0)break e;l--,c+=i[a++]<>b)],v=h>>>24,y=h>>>16&255,k=h&65535,!(b+v<=d);){if(l===0)break e;l--,c+=i[a++]<>>=b,d-=b,t.back+=b}if(c>>>=v,d-=v,t.back+=v,t.length=k,y===0){t.mode=ph;break}if(y&32){t.back=-1,t.mode=zr;break}if(y&64){n.msg="invalid literal/length code",t.mode=_n;break}t.extra=y&15,t.mode=uh;case uh:if(t.extra){for(O=t.extra;d>>=t.extra,d-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=dh;case dh:for(;h=t.distcode[c&(1<>>24,y=h>>>16&255,k=h&65535,!(v<=d);){if(l===0)break e;l--,c+=i[a++]<>b)],v=h>>>24,y=h>>>16&255,k=h&65535,!(b+v<=d);){if(l===0)break e;l--,c+=i[a++]<>>=b,d-=b,t.back+=b}if(c>>>=v,d-=v,t.back+=v,y&64){n.msg="invalid distance code",t.mode=_n;break}t.offset=k,t.extra=y&15,t.mode=fh;case fh:if(t.extra){for(O=t.extra;d>>=t.extra,d-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){n.msg="invalid distance too far back",t.mode=_n;break}t.mode=mh;case mh:if(u===0)break e;if(f=p-u,t.offset>f){if(f=t.offset-f,f>t.whave&&t.sane){n.msg="invalid distance too far back",t.mode=_n;break}f>t.wnext?(f-=t.wnext,_=t.wsize-f):_=t.wnext-f,f>t.length&&(f=t.length),g=t.window}else g=r,_=o-t.offset,f=t.length;f>u&&(f=u),u-=f,t.length-=f;do r[o++]=g[_++];while(--f);t.length===0&&(t.mode=Oc);break;case ph:if(u===0)break e;r[o++]=t.length,u--,t.mode=Oc;break;case If:if(t.wrap){for(;d<32;){if(l===0)break e;l--,c|=i[a++]<{if($a(n))return Vi;let e=n.state;return e.window&&(e.window=null),n.state=null,Ja},"inflateEnd"),yL=s((n,e)=>{if($a(n))return Vi;let t=n.state;return t.wrap&2?(t.head=e,e.done=!1,Ja):Vi},"inflateGetHeader"),wL=s((n,e)=>{let t=e.length,i,r,a;return $a(n)||(i=n.state,i.wrap!==0&&i.mode!==Dc)?Vi:i.mode===Dc&&(r=1,r=il(r,e,t,0),r!==i.check)?Hh:(a=Qh(n,e,t,t),a?(i.mode=qh,$h):(i.havedict=1,Ja))},"inflateSetDictionary"),xL=Zh,kL=Xh,EL=Wh,TL=gL,CL=Yh,AL=bL,SL=vL,jL=yL,IL=wL,OL="pako inflate (from Nodeca project)",Ur={inflateReset:xL,inflateReset2:kL,inflateResetKeep:EL,inflateInit:TL,inflateInit2:CL,inflate:AL,inflateEnd:SL,inflateGetHeader:jL,inflateSetDictionary:IL,inflateInfo:OL};function NL(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}s(NL,"GZheader");var BL=NL,eb=Object.prototype.toString,{Z_NO_FLUSH:RL,Z_FINISH:DL,Z_OK:ol,Z_STREAM_END:Bf,Z_NEED_DICT:Rf,Z_STREAM_ERROR:ML,Z_DATA_ERROR:vh,Z_MEM_ERROR:FL}=Ha;function ul(n){this.options=Fc.assign({chunkSize:1024*64,windowBits:15,to:""},n||{});let e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(n&&n.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zh,this.strm.avail_out=0;let t=Ur.inflateInit2(this.strm,e.windowBits);if(t!==ol)throw new Error(Ga[t]);if(this.header=new BL,Ur.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=al.string2buf(e.dictionary):eb.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=Ur.inflateSetDictionary(this.strm,e.dictionary),t!==ol)))throw new Error(Ga[t])}s(ul,"Inflate$1");ul.prototype.push=function(n,e){let t=this.strm,i=this.options.chunkSize,r=this.options.dictionary,a,o,l;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?DL:RL,eb.call(n)==="[object ArrayBuffer]"?t.input=new Uint8Array(n):t.input=n,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),a=Ur.inflate(t,o),a===Rf&&r&&(a=Ur.inflateSetDictionary(t,r),a===ol?a=Ur.inflate(t,o):a===vh&&(a=Rf));t.avail_in>0&&a===Bf&&t.state.wrap>0&&n[t.next_in]!==0;)Ur.inflateReset(t),a=Ur.inflate(t,o);switch(a){case ML:case vh:case Rf:case FL:return this.onEnd(a),this.ended=!0,!1}if(l=t.avail_out,t.next_out&&(t.avail_out===0||a===Bf))if(this.options.to==="string"){let u=al.utf8border(t.output,t.next_out),c=t.next_out-u,d=al.buf2string(t.output,u);t.next_out=c,t.avail_out=i-c,c&&t.output.set(t.output.subarray(u,u+c),0),this.onData(d)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(a===ol&&l===0)){if(a===Bf)return a=Ur.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(t.avail_in===0)break}}return!0};ul.prototype.onData=function(n){this.chunks.push(n)};ul.prototype.onEnd=function(n){n===ol&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Fc.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function Zf(n,e){let t=new ul(e);if(t.push(n),t.err)throw t.msg||Ga[t.err];return t.result}s(Zf,"inflate$1");function LL(n,e){return e=e||{},e.raw=!0,Zf(n,e)}s(LL,"inflateRaw$1");var PL=ul,VL=Zf,zL=LL,GL=Zf,UL=Ha,JL={Inflate:PL,inflate:VL,inflateRaw:zL,ungzip:GL,constants:UL},{Deflate:HL,deflate:$L,deflateRaw:qL,gzip:KL}=YF,{Inflate:WL,inflate:ZL,inflateRaw:XL,ungzip:YL}=JL,QL=HL,eP=$L,tP=qL,nP=KL,iP=WL,rP=ZL,aP=XL,oP=YL,sP=Ha,Pc={Deflate:QL,deflate:eP,deflateRaw:tP,gzip:nP,Inflate:iP,inflate:rP,inflateRaw:aP,ungzip:oP,constants:sP};var je;(function(n){n[n.End=0]="End",n[n.Byte=1]="Byte",n[n.Short=2]="Short",n[n.Int=3]="Int",n[n.Long=4]="Long",n[n.Float=5]="Float",n[n.Double=6]="Double",n[n.ByteArray=7]="ByteArray",n[n.String=8]="String",n[n.List=9]="List",n[n.Compound=10]="Compound",n[n.IntArray=11]="IntArray",n[n.LongArray=12]="LongArray"})(je||(je={}));var Vc=class{static register(e,t){let i=t.create().getId();if(i!==e)throw new Error(`Registered factory ${je[i]} does not match type ${je[e]}`);Vc.FACTORIES.set(e,t)}isEnd(){return this.getId()===je.End}isByte(){return this.getId()===je.Byte}isShort(){return this.getId()===je.Short}isInt(){return this.getId()===je.Int}isLong(){return this.getId()===je.Long}isFloat(){return this.getId()===je.Float}isDouble(){return this.getId()===je.Double}isByteArray(){return this.getId()===je.ByteArray}isString(){return this.getId()===je.String}isList(){return this.getId()===je.List}isCompound(){return this.getId()===je.Compound}isIntArray(){return this.getId()===je.IntArray}isLongArray(){return this.getId()===je.LongArray}isNumber(){return this.isByte()||this.isShort()||this.isInt()||this.isLong()||this.isFloat()||this.isDouble()}isArray(){return this.isByteArray()||this.isIntArray()||this.isLongArray()}isListOrArray(){return this.isList()||this.isArray()}getAsNumber(){return 0}getAsString(){return""}toJsonWithId(){return{type:this.getId(),value:this.toJson()}}static getFactory(e){let t=this.FACTORIES.get(e);if(!t)throw new Error(`Invalid tag id ${e}`);return t}static create(e){return this.getFactory(e).create()}static fromString(e){let t=typeof e=="string"?new $n(e):e;return this.getFactory(je.Compound).fromString(t)}static fromJson(e,t=je.Compound){return this.getFactory(t).fromJson(e)}static fromJsonWithId(e){let t=lt.readObject(e)??{},i=lt.readInt(t.type)??0;return Vc.fromJson(t.value??{},i)}static fromBytes(e,t=je.Compound){return this.getFactory(t).fromBytes(e)}},Ze=Vc;s(Ze,"NbtTag"),kt(Ze,"FACTORIES",new Map);var qa=class extends Ze{value;constructor(e){super(),this.value=typeof e=="number"?e:e?1:0}getId(){return je.Byte}getAsNumber(){return this.value}toString(){return this.value.toFixed()+"b"}toPrettyString(){return this.toString()}toSimplifiedJson(){return this.value}toJson(){return this.value}toBytes(e){e.writeByte(this.value)}static create(){return qa.ZERO}static fromJson(e){return new qa(lt.readInt(e)??0)}static fromBytes(e){let t=e.readByte();return new qa(t)}},Dn=qa;s(Dn,"NbtByte"),kt(Dn,"ZERO",new qa(0)),kt(Dn,"ONE",new qa(1));Ze.register(je.Byte,Dn);var nr=class extends Ze{items;constructor(e){super(),this.items=e}getItems(){return this.items.slice(0)}getAsTuple(e,t){return[...Array(e)].map((i,r)=>t(this.items[r]))}get(e){if(e=Math.floor(e),!(e<0||e>=this.items.length))return this.items[e]}get length(){return this.items.length}map(e){return this.items.map(e)}filter(e){return this.items.filter(e)}forEach(e){this.items.forEach(e)}set(e,t){this.items[e]=t}add(e){this.items.push(e)}insert(e,t){this.items.splice(e,0,t)}delete(e){this.items.splice(e,1)}clear(){this.items=[]}};s(nr,"NbtAbstractList");var zi=class extends nr{constructor(e){super(Array.from(e??[],t=>typeof t=="number"?new Dn(t):t))}getId(){return je.ByteArray}getType(){return je.Byte}toString(){return"[B;"+this.items.map(t=>t.getAsNumber().toFixed()+"B").join(",")+"]"}toPrettyString(){return this.toString()}toSimplifiedJson(){return this.items.map(e=>e.getAsNumber())}toJson(){return this.items.map(e=>e.getAsNumber())}toBytes(e){e.writeInt(this.items.length),e.writeBytes(this.items.map(t=>t.getAsNumber()))}static create(){return new zi([])}static fromJson(e){let t=lt.readArray(e,i=>lt.readNumber(i)??0)??[];return new zi(t)}static fromBytes(e){let t=e.readInt(),i=e.readBytes(t);return new zi(i)}};s(zi,"NbtByteArray");Ze.register(je.ByteArray,zi);var At=class extends Ze{value;constructor(e){super(),this.value=e}getId(){return je.Float}getAsNumber(){return this.value}toString(){return this.value.toString()+"f"}toPrettyString(){return this.toString()}toSimplifiedJson(){return this.value}toJson(){return this.value}toBytes(e){e.writeFloat(this.value)}static create(){return new At(0)}static fromJson(e){return new At(lt.readNumber(e)??0)}static fromBytes(e){let t=e.readFloat();return new At(t)}};s(At,"NbtFloat");Ze.register(je.Float,At);var Qt=class extends Ze{value;constructor(e){super(),this.value=e}getId(){return je.Int}getAsNumber(){return this.value}toString(){return this.value.toFixed()}toPrettyString(){return this.toString()}toSimplifiedJson(){return this.value}toJson(){return this.value}toBytes(e){e.writeInt(this.value)}static create(){return new Qt(0)}static fromJson(e){return new Qt(lt.readInt(e)??0)}static fromBytes(e){let t=e.readInt();return new Qt(t)}};s(Qt,"NbtInt");Ze.register(je.Int,Qt);var Gi=class extends nr{constructor(e){super(Array.from(e??[],t=>typeof t=="number"?new Qt(t):t))}getId(){return je.IntArray}getType(){return je.Int}get length(){return this.items.length}toString(){return"[I;"+this.items.map(t=>t.getAsNumber().toFixed()).join(",")+"]"}toPrettyString(){return this.toString()}toSimplifiedJson(){return this.items.map(e=>e.getAsNumber())}toJson(){return this.items.map(e=>e.getAsNumber())}toBytes(e){e.writeInt(this.items.length);for(let t of this.items)e.writeInt(t.getAsNumber())}static create(){return new Gi}static fromJson(e){let t=lt.readArray(e,i=>lt.readNumber(i)??0)??[];return new Gi(t)}static fromBytes(e){let t=e.readInt(),i=[];for(let r=0;rnew e(i)))}getId(){return je.List}getType(){return this.type}getNumber(e){let t=this.get(e);return t?.isNumber()?t.getAsNumber():0}getString(e){let t=this.get(e);return t?.isString()?t.getAsString():""}getList(e,t){let i=this.get(e);return i?.isList()&&i.getType()===t?i:En.create()}getCompound(e){let t=this.get(e);return t?.isCompound()?t:Ye.create()}set(e,t){this.updateType(t),super.set(e,t)}add(e){this.updateType(e),super.add(e)}insert(e,t){this.updateType(t),super.insert(e,t)}updateType(e){if(e.getId()!==je.End){if(this.type===je.End)this.type=e.getId();else if(this.type!==e.getId())throw new Error(`Trying to add tag of type ${je[e.getId()]} to list of ${je[this.type]}`)}}clear(){super.clear(),this.type=je.End}toString(){return"["+this.items.map(e=>e.toString()).join(",")+"]"}toPrettyString(e=" ",t=0){if(this.length===0)return"[]";let i=e.repeat(t),r=e.repeat(t+1);return`[ `+this.map(a=>r+a.toPrettyString(e,t+1)).join(`, `)+` -`+i+"]"}toSimplifiedJson(){return this.map(e=>e.toSimplifiedJson())}toJson(){return{type:this.type,items:this.items.map(e=>e.toJson())}}toBytes(e){this.items.length===0?this.type=Ce.End:this.type=this.items[0].getId(),e.writeByte(this.type),e.writeInt(this.items.length);for(let t of this.items)t.toBytes(e)}static create(){return new wn}static fromJson(e){let t=nt.readObject(e)??{},i=nt.readNumber(t.type)??Ce.Compound,r=(nt.readArray(t.items)??[]).flatMap(a=>a!==void 0?[qe.fromJson(a,i)]:[]);return new wn(r,i)}static fromBytes(e){let t=e.readByte(),i=e.readInt();if(t===Ce.End&&i>0)throw new Error(`Missing type on ListTag but length is ${i}`);let r=[];for(let a=0;atypeof t=="number"?t:0):[0,0])}static fromBytes(e){let t=e.readInt(),i=e.readInt();return new jn([t,i])}},Vr=jn;s(Vr,"NbtLong"),ht(Vr,"dataview",new DataView(new Uint8Array(8).buffer));qe.register(Ce.Long,Vr);var Mi=class extends Zi{constructor(e){super(Array.from(e??[],t=>typeof t=="bigint"||Array.isArray(t)?new Vr(t):t))}getId(){return Ce.LongArray}getType(){return Ce.Long}get length(){return this.items.length}toString(){return"[I;"+this.items.map(t=>t.toString()).join(",")+"]"}toPrettyString(){return this.toString()}toSimplifiedJson(){return this.items.map(e=>e.getAsPair())}toJson(){return this.items.map(e=>e.getAsPair())}toBytes(e){e.writeInt(this.items.length);for(let t of this.items){let[i,r]=t.getAsPair();e.writeInt(i),e.writeInt(r)}}static create(){return new Mi}static fromJson(e){let t=nt.readArray(e,i=>nt.readPair(i,r=>nt.readNumber(r)??0)??[0,0])??[];return new Mi(t)}static fromBytes(e){let t=e.readInt(),i=[];for(let r=0;re(t,i,this)))}forEach(e){[...this.properties.entries()].forEach(([t,i])=>e(t,i,this))}set(e,t){return this.properties.set(e,t),this}delete(e){return this.properties.delete(e)}clear(){return this.properties.clear(),this}toString(){let e=[];for(let[t,i]of this.properties.entries()){let r=t.split("").some(a=>!Un.isAllowedInUnquotedString(a));e.push((r?JSON.stringify(t):t)+":"+i.toString())}return"{"+e.join(",")+"}"}toPrettyString(e=" ",t=0){if(this.size===0)return"{}";let i=e.repeat(t),r=e.repeat(t+1);return`{ +`+i+"]"}toSimplifiedJson(){return this.map(e=>e.toSimplifiedJson())}toJson(){return{type:this.type,items:this.items.map(e=>e.toJson())}}toBytes(e){this.items.length===0?this.type=je.End:this.type=this.items[0].getId(),e.writeByte(this.type),e.writeInt(this.items.length);for(let t of this.items)t.toBytes(e)}static create(){return new En}static fromJson(e){let t=lt.readObject(e)??{},i=lt.readNumber(t.type)??je.Compound,r=(lt.readArray(t.items)??[]).flatMap(a=>a!==void 0?[Ze.fromJson(a,i)]:[]);return new En(r,i)}static fromBytes(e){let t=e.readByte(),i=e.readInt();if(t===je.End&&i>0)throw new Error(`Missing type on ListTag but length is ${i}`);let r=[];for(let a=0;atypeof t=="number"?t:0):[0,0])}static fromBytes(e){let t=e.readInt(),i=e.readInt();return new Mn([t,i])}},Jr=Mn;s(Jr,"NbtLong"),kt(Jr,"dataview",new DataView(new Uint8Array(8).buffer));Ze.register(je.Long,Jr);var Ui=class extends nr{constructor(e){super(Array.from(e??[],t=>typeof t=="bigint"||Array.isArray(t)?new Jr(t):t))}getId(){return je.LongArray}getType(){return je.Long}get length(){return this.items.length}toString(){return"[I;"+this.items.map(t=>t.toString()).join(",")+"]"}toPrettyString(){return this.toString()}toSimplifiedJson(){return this.items.map(e=>e.getAsPair())}toJson(){return this.items.map(e=>e.getAsPair())}toBytes(e){e.writeInt(this.items.length);for(let t of this.items){let[i,r]=t.getAsPair();e.writeInt(i),e.writeInt(r)}}static create(){return new Ui}static fromJson(e){let t=lt.readArray(e,i=>lt.readPair(i,r=>lt.readNumber(r)??0)??[0,0])??[];return new Ui(t)}static fromBytes(e){let t=e.readInt(),i=[];for(let r=0;re(t,i,this)))}forEach(e){[...this.properties.entries()].forEach(([t,i])=>e(t,i,this))}set(e,t){return this.properties.set(e,t),this}delete(e){return this.properties.delete(e)}clear(){return this.properties.clear(),this}toString(){let e=[];for(let[t,i]of this.properties.entries()){let r=t.split("").some(a=>!$n.isAllowedInUnquotedString(a));e.push((r?JSON.stringify(t):t)+":"+i.toString())}return"{"+e.join(",")+"}"}toPrettyString(e=" ",t=0){if(this.size===0)return"{}";let i=e.repeat(t),r=e.repeat(t+1);return`{ `+Object.values(this.map((a,o)=>[a,r+a+": "+o.toPrettyString(e,t+1)])).join(`, `)+` -`+i+"}"}toSimplifiedJson(){return this.map((e,t)=>[e,t.toSimplifiedJson()])}toJson(){return this.map((e,t)=>[e,{type:t.getId(),value:t.toJson()}])}toBytes(e){for(let[t,i]of this.properties.entries()){let r=i.getId();e.writeByte(r),e.writeString(t),i.toBytes(e)}e.writeByte(Ce.End)}static create(){return new Ze}static fromString(e){return Bc.readTag(e)}static fromJson(e){let t=nt.readMap(e,i=>{let{type:r,value:a}=nt.readObject(i)??{},o=nt.readNumber(r);return qe.fromJson(a??{},o)});return new Ze(new Map(Object.entries(t)))}static fromBytes(e){let t=new Map;for(;;){let i=e.readByte();if(i===Ce.End)break;let r=e.readString(),a=qe.fromBytes(e,i);t.set(r,a)}return new Ze(t)}};s(Ze,"NbtCompound");qe.register(Ce.Compound,Ze);var oa=class{name;root;compression;littleEndian;bedrockHeader;constructor(e,t,i,r,a){this.name=e,this.root=t,this.compression=i,this.littleEndian=r,this.bedrockHeader=a}writeNamedTag(e){e.writeByte(Ce.Compound),e.writeString(this.name),this.root.toBytes(e)}write(){let e=this.littleEndian===!0||this.bedrockHeader!==void 0,t=new Vs({littleEndian:e,offset:this.bedrockHeader&&8});if(this.writeNamedTag(t),this.bedrockHeader!==void 0){let r=t.offset;t.offset=0,t.writeInt(this.bedrockHeader),t.writeInt(r-8),t.offset=r}let i=t.getData();return this.compression==="gzip"?Oc.gzip(i):this.compression==="zlib"?Oc.deflate(i):i}static readNamedTag(e){if(e.readByte()!==Ce.Compound)throw new Error("Top tag should be a compound");return{name:e.readString(),root:Ze.fromBytes(e)}}static create(e={}){let t=e.name??oa.DEFAULT_NAME,i=Ze.create(),r=e.compression??"none",a=typeof e.bedrockHeader=="boolean"?oa.DEFAULT_BEDROCK_HEADER:e.bedrockHeader,o=e.littleEndian??e.bedrockHeader!==void 0;return new oa(t,i,r,o,a)}static read(e,t={}){let i=typeof t.bedrockHeader=="number"?t.bedrockHeader:t.bedrockHeader?gg(e):void 0,r=t.compression==="gzip"||!i&&t.compression===void 0&&pg(e),a=t.compression==="zlib"||!i&&t.compression===void 0&&_g(e),o=a||r?Oc.inflate(e):e,l=t.littleEndian||i!==void 0,c=r?"gzip":a?"zlib":"none",u=new Ps(o,{littleEndian:l,offset:i&&8}),{name:d,root:m}=oa.readNamedTag(u);return new oa(t.name??d,m,c,l,i)}toJson(){return{name:this.name,root:this.root.toJson(),compression:this.compression,littleEndian:this.littleEndian,bedrockHeader:this.bedrockHeader??null}}static fromJson(e){let t=nt.readObject(e)??{},i=nt.readString(t.name)??"",r=Ze.fromJson(t.root??{}),a=nt.readString(t.compression)??"none",o=nt.readBoolean(t.littleEndian)??!1,l=nt.readNumber(t.bedrockHeader);return new oa(i,r,a,o,l)}},Yi=oa;s(Yi,"NbtFile"),ht(Yi,"DEFAULT_NAME",""),ht(Yi,"DEFAULT_BEDROCK_HEADER",4);var Fi=class{x;z;compression;timestamp;raw;file;dirty;constructor(e,t,i,r,a){this.x=e,this.z=t,this.compression=i,this.timestamp=r,this.raw=a,this.dirty=!1}getCompression(){switch(this.compression){case 1:return"gzip";case 2:return"zlib";case 3:return"none";default:throw new Error(`Invalid compression mode ${this.compression}`)}}setCompression(e){switch(e){case"gzip":this.compression=1;break;case"zlib":this.compression=2;break;case"none":this.compression=3;break;default:throw new Error(`Invalid compression mode ${e}`)}}getFile(){return this.file===void 0&&(this.file=Yi.read(this.raw,{compression:this.getCompression()})),this.file}getRoot(){return this.getFile().root}setRoot(e){this.file===void 0&&(this.file=Yi.create({compression:this.getCompression()})),this.file.root=e,this.markDirty()}markDirty(){this.dirty=!0}getRaw(){if(this.file===void 0||this.dirty===!1)return this.raw;this.file.compression=this.getCompression();let e=this.file.write();return this.raw=e,this.dirty=!1,e}toJson(){return{x:this.x,z:this.z,compression:this.compression,timestamp:this.timestamp,size:this.raw.byteLength}}toRef(e){return new Fi.Ref(this.x,this.z,this.compression,this.timestamp,this.raw.byteLength,e)}static create(e,t,i,r){let a=new Fi(e,t,0,r??0,i.write());return a.setCompression(i.compression),a}static fromJson(e,t){let i=nt.readObject(e)??{},r=nt.readInt(i.x)??0,a=nt.readInt(i.z)??0,o=nt.readNumber(i.compression)??2,l=nt.readInt(i.timestamp)??0,c=nt.readInt(i.size)??0;return new Fi.Ref(r,a,o,l,c,t)}};s(Fi,"NbtChunk");(function(n){class e{x;z;compression;timestamp;size;resolver;file;constructor(i,r,a,o,l,c){this.x=i,this.z=r,this.compression=a,this.timestamp=o,this.size=l,this.resolver=c}getFile(){if(this.file instanceof Yi)return this.file}getRoot(){if(this.file instanceof Yi)return this.file.root}async getFileAsync(){return this.file?this.file:(this.file=(async()=>{let i=await this.resolver(this.x,this.z);return this.file=i,i})(),this.file)}async getRootAsync(){return(await this.getFileAsync()).root}isResolved(){return this.file instanceof Yi}}s(e,"Ref"),n.Ref=e})(Fi||(Fi={}));var al=class{chunks;constructor(e){this.chunks=Array(32*32).fill(void 0);for(let t of e){let i=Er.getIndex(t.x,t.z);this.chunks[i]=t}}getChunkPositions(){return this.chunks.flatMap(e=>e?[[e.x,e.z]]:[])}getChunk(e){if(!(e<0||e>=32*32))return this.chunks[e]}findChunk(e,t){return this.getChunk(Er.getIndex(e,t))}getFirstChunk(){return this.chunks.filter(e=>e!==void 0)[0]}filter(e){return this.chunks.filter(t=>t!==void 0&&e(t))}map(e){return this.chunks.flatMap(t=>t!==void 0?[e(t)]:[])}};s(al,"NbtAbstractRegion");var Er=class extends al{constructor(e){super(e)}write(){let e=0;for(let a of this.chunks)a!==void 0&&(e+=Math.ceil(a.getRaw().length/4096));let t=new Uint8Array(8192+e*4096),i=new DataView(t.buffer),r=2;for(let a of this.chunks){if(a===void 0)continue;let o=a.getRaw(),l=4*((a.x&31)+(a.z&31)*32),c=Math.ceil(o.length/4096);i.setInt8(l,r>>16),i.setInt16(l+1,r&65535),i.setInt8(l+3,c),i.setInt32(l+4096,a.timestamp);let u=r*4096;i.setInt32(u,o.length+1),i.setInt8(u+4,a.compression),t.set(o,u+5),r+=c}return t}static read(e){let t=[];for(let i=0;i<32;i+=1)for(let r=0;r<32;r+=1){let a=4*((i&31)+(r&31)*32);if(e[a+3]===0)continue;let l=(e[a]<<16)+(e[a+1]<<8)+e[a+2],c=(e[a+4096]<<24)+(e[a+4097]<<16)+(e[a+4098]<<8)+e[a+4099],u=l*4096,d=(e[u]<<24)+(e[u+1]<<16)+(e[u+2]<<8)+e[u+3],m=e[u+4],p=e.slice(u+5,u+4+d);t.push(new Fi(i,r,m,c,p))}return new Er(t)}static getIndex(e,t){return(e&31)+(t&31)*32}toJson(){return{chunks:this.map(e=>e.toJson())}}static fromJson(e,t){let i=nt.readObject(e)??{},a=(nt.readArray(i.chunks)??[]).flatMap(o=>o!==void 0?[Fi.fromJson(o,t)]:[]);return new Er.Ref(a)}};s(Er,"NbtRegion");(function(n){class e extends al{}s(e,"Ref"),n.Ref=e})(Er||(Er={}));var Xi=class extends qe{value;constructor(e){super(),this.value=e}getId(){return Ce.Double}getAsNumber(){return this.value}toString(){return Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}toPrettyString(){return this.toString()}toSimplifiedJson(){return this.value}toJson(){return this.value}toBytes(e){e.writeDouble(this.value)}static create(){return new Xi(0)}static fromJson(e){return new Xi(nt.readNumber(e)??0)}static fromBytes(e){let t=e.readDouble();return new Xi(t)}};s(Xi,"NbtDouble");qe.register(Ce.Double,Xi);var Bo=class extends qe{constructor(){super()}getId(){return Ce.End}toString(){return"END"}toPrettyString(){return this.toString()}toSimplifiedJson(){return null}toJson(){return null}toBytes(){}static create(){return Bo.INSTANCE}static fromJson(){return Bo.INSTANCE}static fromBytes(){return Bo.INSTANCE}},ol=Bo;s(ol,"NbtEnd"),ht(ol,"INSTANCE",new Bo);qe.register(Ce.End,ol);var Pe=class{_vanillaModel;_billboard;_overrideBrightness;_brightnessOverride;_enchanted;_glowing;_overrideGlowColor;_glowColor;_inheritSettings;_invisible;_nbt;_shadowRadius;_shadowStrength;_useNBT;static getDefault(){return Pe.fromJSON({billboard:"fixed",override_brightness:!1,brightness_override:0,enchanted:!1,glowing:!1,override_glow_color:!1,glow_color:"#ffffff",inherit_settings:!0,invisible:!1,nbt:"{}",shadow_radius:0,shadow_strength:1,use_nbt:!1})}get billboard(){return this._billboard!==void 0?this._billboard:Pe.getDefault().billboard}set billboard(e){this._billboard=e}get overrideBrightness(){return this._overrideBrightness!==void 0?this._overrideBrightness:Pe.getDefault().overrideBrightness}set overrideBrightness(e){this._overrideBrightness=e}get brightnessOverride(){return this._brightnessOverride!==void 0?this._brightnessOverride:Pe.getDefault().brightnessOverride}set brightnessOverride(e){this._brightnessOverride=e}get enchanted(){return this._enchanted!==void 0?this._enchanted:Pe.getDefault().enchanted}set enchanted(e){this._enchanted=e}get glowing(){return this._glowing!==void 0?this._glowing:Pe.getDefault().glowing}set glowing(e){this._glowing=e}get overrideGlowColor(){return this._overrideGlowColor!==void 0?this._overrideGlowColor:Pe.getDefault().overrideGlowColor}set overrideGlowColor(e){this._overrideGlowColor=e}get glowColor(){return this._glowColor!==void 0?this._glowColor:Pe.getDefault().glowColor}set glowColor(e){this._glowColor=e}get inheritSettings(){return this._inheritSettings!==void 0?this._inheritSettings:Pe.getDefault().inheritSettings}set inheritSettings(e){this._inheritSettings=e}get invisible(){return this._invisible!==void 0?this._invisible:Pe.getDefault().invisible}set invisible(e){this._invisible=e}get nbt(){return this._nbt!==void 0?this._nbt:Pe.getDefault().nbt}set nbt(e){this._nbt=e}get shadowRadius(){return this._shadowRadius!==void 0?this._shadowRadius:Pe.getDefault().shadowRadius}set shadowRadius(e){this._shadowRadius=e}get shadowStrength(){return this._shadowStrength!==void 0?this._shadowStrength:Pe.getDefault().shadowStrength}set shadowStrength(e){this._shadowStrength=e}get useNBT(){return this._useNBT!==void 0?this._useNBT:Pe.getDefault().useNBT}set useNBT(e){this._useNBT=e}checkIfEqual(e){return this._vanillaModel===e._vanillaModel&&this._billboard===e._billboard&&this._overrideBrightness===e._overrideBrightness&&this._brightnessOverride===e._brightnessOverride&&this._enchanted===e._enchanted&&this._glowing===e._glowing&&this._overrideGlowColor===e._overrideGlowColor&&this._glowColor===e._glowColor&&this._inheritSettings===e._inheritSettings&&this._invisible===e._invisible&&this._nbt===e._nbt&&this._shadowRadius===e._shadowRadius&&this._shadowStrength===e._shadowStrength&&this._useNBT===e._useNBT}isDefault(){return this.checkIfEqual(Pe.getDefault())}toJSON(){return{billboard:this._billboard,override_brightness:this._overrideBrightness,brightness_override:this._brightnessOverride,enchanted:this._enchanted,glowing:this._glowing,override_glow_color:this._overrideGlowColor,glow_color:this._glowColor,inherit_settings:this._inheritSettings,invisible:this._invisible,nbt:this._nbt,shadow_radius:this._shadowRadius,shadow_strength:this._shadowStrength,use_nbt:this._useNBT}}inheritFrom(e){e._billboard!==void 0&&(this.billboard=e.billboard),e._overrideBrightness!==void 0&&(this.overrideBrightness=e.overrideBrightness),e._brightnessOverride!==void 0&&(this.brightnessOverride=e.brightnessOverride),e._enchanted!==void 0&&(this.enchanted=e.enchanted),e._glowing!==void 0&&(this.glowing=e.glowing),e._overrideGlowColor!==void 0&&(this.overrideGlowColor=e.overrideGlowColor),e._glowColor!==void 0&&(this.glowColor=e.glowColor),e._inheritSettings!==void 0&&(this.inheritSettings=e.inheritSettings),e._invisible!==void 0&&(this.invisible=e.invisible),e._nbt!==void 0&&(this.nbt=e.nbt),e._shadowRadius!==void 0&&(this.shadowRadius=e.shadowRadius),e._shadowStrength!==void 0&&(this.shadowStrength=e.shadowStrength),e._useNBT!==void 0&&(this.useNBT=e.useNBT)}static fromJSON(e){let t=new Pe;return e.billboard!==void 0&&(t._billboard=e.billboard),e.override_brightness!==void 0&&(t._overrideBrightness=e.override_brightness),e.brightness_override!==void 0&&(t._brightnessOverride=e.brightness_override),e.enchanted!==void 0&&(t._enchanted=e.enchanted),e.glowing!==void 0&&(t._glowing=e.glowing),e.override_glow_color!==void 0&&(t._overrideGlowColor=e.override_glow_color),e.glow_color!==void 0&&(t._glowColor=e.glow_color),e.inherit_settings!==void 0&&(t._inheritSettings=e.inherit_settings),e.invisible!==void 0&&(t._invisible=e.invisible),e.nbt!==void 0&&(t._nbt=e.nbt),e.shadow_radius!==void 0&&(t._shadowRadius=e.shadow_radius),e.shadow_strength!==void 0&&(t._shadowStrength=e.shadow_strength),e.use_nbt!==void 0&&(t._useNBT=e.use_nbt),t}toNBT(e=new Ze){if(this.useNBT){let t=qe.fromString(this.nbt);for(let i of t.keys())e.set(i,t.get(i));return e}if(this._billboard&&e.set("billboard",new at(this.billboard)),this.overrideBrightness&&e.set("brightness",new Ze().set("block",new wt(this.brightnessOverride)).set("sky",new wt(this.brightnessOverride))),this.enchanted){let t=e.get("item")||new Ze;e.set("item",t.set("components",new Ze().set("minecraft:enchantments",new Ze().set("levels",new Ze().set("minecraft:infinity",new Kt(1))))))}return this.glowing&&e.set("Glowing",new Bn(Number(this.glowing))),this.overrideGlowColor&&e.set("glow_color_override",new Kt(Number(this.glowColor.replace("#","0x")))),this._shadowRadius&&e.set("shadow_radius",new wt(this.shadowRadius)),this._shadowStrength&&e.set("shadow_strength",new wt(this.shadowStrength)),e}};s(Pe,"BoneConfig");var Tr=class{_useEntity;_entityType;_summonCommands;_tickingCommands;getDefault(){return Tr.fromJSON({use_entity:!1,entity_type:"minecraft:pig",summon_commands:"",ticking_commands:""})}get useEntity(){return this._useEntity!==void 0?this._useEntity:this.getDefault().useEntity}set useEntity(e){this._useEntity=e}get entityType(){return this._entityType!==void 0?this._entityType:this.getDefault().entityType}set entityType(e){this._entityType=e}get summonCommands(){return this._summonCommands!==void 0?this._summonCommands:this.getDefault().summonCommands}set summonCommands(e){this._summonCommands=e}get tickingCommands(){return this._tickingCommands!==void 0?this._tickingCommands:this.getDefault().tickingCommands}set tickingCommands(e){this._tickingCommands=e}toJSON(){return{use_entity:this._useEntity,entity_type:this._entityType,summon_commands:this._summonCommands,ticking_commands:this._tickingCommands}}static fromJSON(e){let t=new Tr;return e.use_entity!==void 0&&(t._useEntity=e.use_entity),e.entity_type!==void 0&&(t._entityType=e.entity_type),e.summon_commands!==void 0&&(t._summonCommands=e.summon_commands),e.ticking_commands!==void 0&&(t._tickingCommands=e.ticking_commands),t}isDefault(){return this.checkIfEqual(new Tr)}checkIfEqual(e){return this.useEntity===e.useEntity&&this.entityType===e.entityType&&this.summonCommands===e.summonCommands&&this.tickingCommands===e.tickingCommands}};s(Tr,"LocatorConfig");var Mt=class{_billboard;_overrideBrightness;_brightnessOverride;_glowing;_overrideGlowColor;_glowColor;_invisible;_shadowRadius;_shadowStrength;_useNBT;_nbt;static getDefault(){return Mt.fromJSON({billboard:"fixed",override_brightness:!1,brightness_override:0,glowing:!1,override_glow_color:!1,glow_color:"#ffffff",invisible:!1,nbt:"{}",shadow_radius:0,shadow_strength:1,use_nbt:!1})}get billboard(){return this._billboard!==void 0?this._billboard:Pe.getDefault().billboard}set billboard(e){this._billboard=e}get overrideBrightness(){return this._overrideBrightness!==void 0?this._overrideBrightness:Pe.getDefault().overrideBrightness}set overrideBrightness(e){this._overrideBrightness=e}get brightnessOverride(){return this._brightnessOverride!==void 0?this._brightnessOverride:Pe.getDefault().brightnessOverride}set brightnessOverride(e){this._brightnessOverride=e}get glowing(){return this._glowing!==void 0?this._glowing:Pe.getDefault().glowing}set glowing(e){this._glowing=e}get overrideGlowColor(){return this._overrideGlowColor!==void 0?this._overrideGlowColor:Pe.getDefault().overrideGlowColor}set overrideGlowColor(e){this._overrideGlowColor=e}get glowColor(){return this._glowColor!==void 0?this._glowColor:Pe.getDefault().glowColor}set glowColor(e){this._glowColor=e}get invisible(){return this._invisible!==void 0?this._invisible:Pe.getDefault().invisible}set invisible(e){this._invisible=e}get nbt(){return this._nbt!==void 0?this._nbt:Pe.getDefault().nbt}set nbt(e){this._nbt=e}get shadowRadius(){return this._shadowRadius!==void 0?this._shadowRadius:Pe.getDefault().shadowRadius}set shadowRadius(e){this._shadowRadius=e}get shadowStrength(){return this._shadowStrength!==void 0?this._shadowStrength:Pe.getDefault().shadowStrength}set shadowStrength(e){this._shadowStrength=e}get useNBT(){return this._useNBT!==void 0?this._useNBT:Pe.getDefault().useNBT}set useNBT(e){this._useNBT=e}getDefault(){return Mt.fromJSON({billboard:"center"})}get tickingCommands(){return this._billboard!==void 0?this._billboard:this.getDefault().tickingCommands}set tickingCommands(e){this._billboard=e}toJSON(){return{billboard:this._billboard,override_brightness:this._overrideBrightness,brightness_override:this._brightnessOverride,glowing:this._glowing,override_glow_color:this._overrideGlowColor,glow_color:this._glowColor,invisible:this._invisible,nbt:this._nbt,shadow_radius:this._shadowRadius,shadow_strength:this._shadowStrength,use_nbt:this._useNBT}}static fromJSON(e){let t=new Mt;return e.billboard!==void 0&&(t._billboard=e.billboard),e.override_brightness!==void 0&&(t._overrideBrightness=e.override_brightness),e.brightness_override!==void 0&&(t._brightnessOverride=e.brightness_override),e.glowing!==void 0&&(t._glowing=e.glowing),e.override_glow_color!==void 0&&(t._overrideGlowColor=e.override_glow_color),e.glow_color!==void 0&&(t._glowColor=e.glow_color),e.invisible!==void 0&&(t._invisible=e.invisible),e.nbt!==void 0&&(t._nbt=e.nbt),e.shadow_radius!==void 0&&(t._shadowRadius=e.shadow_radius),e.shadow_strength!==void 0&&(t._shadowStrength=e.shadow_strength),e.use_nbt!==void 0&&(t._useNBT=e.use_nbt),t}toNBT(e=new Ze){if(this.useNBT){let t=qe.fromString(this.nbt);for(let i of t.keys())e.set(i,t.get(i));return e}return this._billboard&&e.set("billboard",new at(this.billboard)),this.overrideBrightness&&e.set("brightness",new Ze().set("block",new wt(this.brightnessOverride)).set("sky",new wt(this.brightnessOverride))),this.glowing&&e.set("Glowing",new Bn(Number(this.glowing))),this.overrideGlowColor&&e.set("glow_color_override",new Kt(Number(this.glowColor.replace("#","0x")))),this._shadowRadius&&e.set("shadow_radius",new wt(this.shadowRadius)),this._shadowStrength&&e.set("shadow_strength",new wt(this.shadowStrength)),e}isDefault(){return this.checkIfEqual(new Mt)}checkIfEqual(e){return this._billboard===e._billboard&&this._overrideBrightness===e._overrideBrightness&&this._brightnessOverride===e._brightnessOverride&&this._glowing===e._glowing&&this._overrideGlowColor===e._overrideGlowColor&&this._glowColor===e._glowColor&&this._invisible===e._invisible&&this._nbt===e._nbt&&this._shadowRadius===e._shadowRadius&&this._shadowStrength===e._shadowStrength&&this._useNBT===e._useNBT}};s(Mt,"TextDisplayConfig");function XF(n){let e,t,i,r,a,o=YF()+"",l,c,u,d,m=w("dialog.unexpected_error.paragraph",'Discord','Github')+"",p,f,_,v,g,h,b,x;return{c(){e=V("div"),t=V("div"),i=V("i"),r=K(),a=V("h2"),l=K(),c=V("i"),u=K(),d=V("p"),p=K(),f=V("div"),_=V("textarea"),v=K(),g=V("i"),T(i,"class","fas fa-quote-left dialog_form_warning text_icon svelte-hszt7f"),$e(a,"font-size","24px"),$e(a,"text-align","center"),T(c,"class","fas fa-quote-right dialog_form_warning text_icon svelte-hszt7f"),T(t,"class","quote svelte-hszt7f"),_.readOnly=!0,T(_,"class","svelte-hszt7f"),T(g,"class","fas fa-copy dialog_form_warning text_icon svelte-hszt7f"),T(g,"title",h=w("dialog.unexpected_error.copy_error_message_button.description")),T(f,"class","codebox dark_bordered svelte-hszt7f"),T(e,"class","container svelte-hszt7f")},m(y,k){G(y,e,k),N(e,t),N(t,i),N(t,r),N(t,a),a.innerHTML=o,N(t,l),N(t,c),N(e,u),N(e,d),d.innerHTML=m,N(e,p),N(e,f),N(f,_),mt(_,n[0]),N(f,v),N(f,g),b||(x=[De(_,"input",n[3]),De(g,"click",n[1])],b=!0)},p(y,[k]){k&1&&mt(_,y[0])},i:re,o:re,d(y){y&&z(e),b=!1,At(x)}}}s(XF,"create_fragment");var Lh=["Uh oh!","Time to fire up the ol' debugger!","Your item displays are sad \u{1F97A}",'Ok, who pushed the big red button?',"Skill Issue.","You have how many elements!?","I'll export successfully some day!","When I grow up, I wanna be just like Blender!","Should'a seen that one comming...","It's all Jannis' fault! :(","Snaviewavie did an oopsie poopsie x3","We to a little trolling","execute run execute run execute run execute run say This is fine.","This is why we can't have nice things. :(","Have you tried turning it off and on again?","What if I put my command block next to yours? Haha just kidding... Unless?","If at first you don't succeed, Try, try again!","B:01010111 01100101 00100000 01100100 01101111 00100000 01100001 00100000 01101100 01101001 01110100 01110100 01101100 01100101 00100000 01110100 01110010 01101111 01101100 01101100 01101001 01101110 01100111",`
      +`+i+"}"}toSimplifiedJson(){return this.map((e,t)=>[e,t.toSimplifiedJson()])}toJson(){return this.map((e,t)=>[e,{type:t.getId(),value:t.toJson()}])}toBytes(e){for(let[t,i]of this.properties.entries()){let r=i.getId();e.writeByte(r),e.writeString(t),i.toBytes(e)}e.writeByte(je.End)}static create(){return new Ye}static fromString(e){return zc.readTag(e)}static fromJson(e){let t=lt.readMap(e,i=>{let{type:r,value:a}=lt.readObject(i)??{},o=lt.readNumber(r);return Ze.fromJson(a??{},o)});return new Ye(new Map(Object.entries(t)))}static fromBytes(e){let t=new Map;for(;;){let i=e.readByte();if(i===je.End)break;let r=e.readString(),a=Ze.fromBytes(e,i);t.set(r,a)}return new Ye(t)}};s(Ye,"NbtCompound");Ze.register(je.Compound,Ye);var da=class{name;root;compression;littleEndian;bedrockHeader;constructor(e,t,i,r,a){this.name=e,this.root=t,this.compression=i,this.littleEndian=r,this.bedrockHeader=a}writeNamedTag(e){e.writeByte(je.Compound),e.writeString(this.name),this.root.toBytes(e)}write(){let e=this.littleEndian===!0||this.bedrockHeader!==void 0,t=new $s({littleEndian:e,offset:this.bedrockHeader&&8});if(this.writeNamedTag(t),this.bedrockHeader!==void 0){let r=t.offset;t.offset=0,t.writeInt(this.bedrockHeader),t.writeInt(r-8),t.offset=r}let i=t.getData();return this.compression==="gzip"?Pc.gzip(i):this.compression==="zlib"?Pc.deflate(i):i}static readNamedTag(e){if(e.readByte()!==je.Compound)throw new Error("Top tag should be a compound");return{name:e.readString(),root:Ye.fromBytes(e)}}static create(e={}){let t=e.name??da.DEFAULT_NAME,i=Ye.create(),r=e.compression??"none",a=typeof e.bedrockHeader=="boolean"?da.DEFAULT_BEDROCK_HEADER:e.bedrockHeader,o=e.littleEndian??e.bedrockHeader!==void 0;return new da(t,i,r,o,a)}static read(e,t={}){let i=typeof t.bedrockHeader=="number"?t.bedrockHeader:t.bedrockHeader?Bg(e):void 0,r=t.compression==="gzip"||!i&&t.compression===void 0&&Og(e),a=t.compression==="zlib"||!i&&t.compression===void 0&&Ng(e),o=a||r?Pc.inflate(e):e,l=t.littleEndian||i!==void 0,u=r?"gzip":a?"zlib":"none",c=new Hs(o,{littleEndian:l,offset:i&&8}),{name:d,root:m}=da.readNamedTag(c);return new da(t.name??d,m,u,l,i)}toJson(){return{name:this.name,root:this.root.toJson(),compression:this.compression,littleEndian:this.littleEndian,bedrockHeader:this.bedrockHeader??null}}static fromJson(e){let t=lt.readObject(e)??{},i=lt.readString(t.name)??"",r=Ye.fromJson(t.root??{}),a=lt.readString(t.compression)??"none",o=lt.readBoolean(t.littleEndian)??!1,l=lt.readNumber(t.bedrockHeader);return new da(i,r,a,o,l)}},rr=da;s(rr,"NbtFile"),kt(rr,"DEFAULT_NAME",""),kt(rr,"DEFAULT_BEDROCK_HEADER",4);var Ji=class{x;z;compression;timestamp;raw;file;dirty;constructor(e,t,i,r,a){this.x=e,this.z=t,this.compression=i,this.timestamp=r,this.raw=a,this.dirty=!1}getCompression(){switch(this.compression){case 1:return"gzip";case 2:return"zlib";case 3:return"none";default:throw new Error(`Invalid compression mode ${this.compression}`)}}setCompression(e){switch(e){case"gzip":this.compression=1;break;case"zlib":this.compression=2;break;case"none":this.compression=3;break;default:throw new Error(`Invalid compression mode ${e}`)}}getFile(){return this.file===void 0&&(this.file=rr.read(this.raw,{compression:this.getCompression()})),this.file}getRoot(){return this.getFile().root}setRoot(e){this.file===void 0&&(this.file=rr.create({compression:this.getCompression()})),this.file.root=e,this.markDirty()}markDirty(){this.dirty=!0}getRaw(){if(this.file===void 0||this.dirty===!1)return this.raw;this.file.compression=this.getCompression();let e=this.file.write();return this.raw=e,this.dirty=!1,e}toJson(){return{x:this.x,z:this.z,compression:this.compression,timestamp:this.timestamp,size:this.raw.byteLength}}toRef(e){return new Ji.Ref(this.x,this.z,this.compression,this.timestamp,this.raw.byteLength,e)}static create(e,t,i,r){let a=new Ji(e,t,0,r??0,i.write());return a.setCompression(i.compression),a}static fromJson(e,t){let i=lt.readObject(e)??{},r=lt.readInt(i.x)??0,a=lt.readInt(i.z)??0,o=lt.readNumber(i.compression)??2,l=lt.readInt(i.timestamp)??0,u=lt.readInt(i.size)??0;return new Ji.Ref(r,a,o,l,u,t)}};s(Ji,"NbtChunk");(function(n){class e{x;z;compression;timestamp;size;resolver;file;constructor(i,r,a,o,l,u){this.x=i,this.z=r,this.compression=a,this.timestamp=o,this.size=l,this.resolver=u}getFile(){if(this.file instanceof rr)return this.file}getRoot(){if(this.file instanceof rr)return this.file.root}async getFileAsync(){return this.file?this.file:(this.file=(async()=>{let i=await this.resolver(this.x,this.z);return this.file=i,i})(),this.file)}async getRootAsync(){return(await this.getFileAsync()).root}isResolved(){return this.file instanceof rr}}s(e,"Ref"),n.Ref=e})(Ji||(Ji={}));var dl=class{chunks;constructor(e){this.chunks=Array(32*32).fill(void 0);for(let t of e){let i=Sr.getIndex(t.x,t.z);this.chunks[i]=t}}getChunkPositions(){return this.chunks.flatMap(e=>e?[[e.x,e.z]]:[])}getChunk(e){if(!(e<0||e>=32*32))return this.chunks[e]}findChunk(e,t){return this.getChunk(Sr.getIndex(e,t))}getFirstChunk(){return this.chunks.filter(e=>e!==void 0)[0]}filter(e){return this.chunks.filter(t=>t!==void 0&&e(t))}map(e){return this.chunks.flatMap(t=>t!==void 0?[e(t)]:[])}};s(dl,"NbtAbstractRegion");var Sr=class extends dl{constructor(e){super(e)}write(){let e=0;for(let a of this.chunks)a!==void 0&&(e+=Math.ceil(a.getRaw().length/4096));let t=new Uint8Array(8192+e*4096),i=new DataView(t.buffer),r=2;for(let a of this.chunks){if(a===void 0)continue;let o=a.getRaw(),l=4*((a.x&31)+(a.z&31)*32),u=Math.ceil(o.length/4096);i.setInt8(l,r>>16),i.setInt16(l+1,r&65535),i.setInt8(l+3,u),i.setInt32(l+4096,a.timestamp);let c=r*4096;i.setInt32(c,o.length+1),i.setInt8(c+4,a.compression),t.set(o,c+5),r+=u}return t}static read(e){let t=[];for(let i=0;i<32;i+=1)for(let r=0;r<32;r+=1){let a=4*((i&31)+(r&31)*32);if(e[a+3]===0)continue;let l=(e[a]<<16)+(e[a+1]<<8)+e[a+2],u=(e[a+4096]<<24)+(e[a+4097]<<16)+(e[a+4098]<<8)+e[a+4099],c=l*4096,d=(e[c]<<24)+(e[c+1]<<16)+(e[c+2]<<8)+e[c+3],m=e[c+4],p=e.slice(c+5,c+4+d);t.push(new Ji(i,r,m,u,p))}return new Sr(t)}static getIndex(e,t){return(e&31)+(t&31)*32}toJson(){return{chunks:this.map(e=>e.toJson())}}static fromJson(e,t){let i=lt.readObject(e)??{},a=(lt.readArray(i.chunks)??[]).flatMap(o=>o!==void 0?[Ji.fromJson(o,t)]:[]);return new Sr.Ref(a)}};s(Sr,"NbtRegion");(function(n){class e extends dl{}s(e,"Ref"),n.Ref=e})(Sr||(Sr={}));var ir=class extends Ze{value;constructor(e){super(),this.value=e}getId(){return je.Double}getAsNumber(){return this.value}toString(){return Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}toPrettyString(){return this.toString()}toSimplifiedJson(){return this.value}toJson(){return this.value}toBytes(e){e.writeDouble(this.value)}static create(){return new ir(0)}static fromJson(e){return new ir(lt.readNumber(e)??0)}static fromBytes(e){let t=e.readDouble();return new ir(t)}};s(ir,"NbtDouble");Ze.register(je.Double,ir);var zo=class extends Ze{constructor(){super()}getId(){return je.End}toString(){return"END"}toPrettyString(){return this.toString()}toSimplifiedJson(){return null}toJson(){return null}toBytes(){}static create(){return zo.INSTANCE}static fromJson(){return zo.INSTANCE}static fromBytes(){return zo.INSTANCE}},fl=zo;s(fl,"NbtEnd"),kt(fl,"INSTANCE",new zo);Ze.register(je.End,fl);var Te=class{_customName;_customNameVisible;_billboard;_overrideBrightness;_brightnessOverride;_enchanted;_glowing;_overrideGlowColor;_glowColor;_inheritSettings;_invisible;_nbt;_shadowRadius;_shadowStrength;_useNBT;static getDefault(){return Te.fromJSON({custom_name:"",custom_name_visible:!1,billboard:"fixed",override_brightness:!1,brightness_override:0,enchanted:!1,glowing:!1,override_glow_color:!1,glow_color:"#ffffff",inherit_settings:!0,invisible:!1,nbt:"{}",shadow_radius:0,shadow_strength:1,use_nbt:!1})}get customName(){return this._customName!==void 0?this._customName:Te.getDefault().customName}set customName(e){this._customName=e}get customNameVisible(){return this._customNameVisible!==void 0?this._customNameVisible:Te.getDefault().customNameVisible}set customNameVisible(e){this._customNameVisible=e}get billboard(){return this._billboard!==void 0?this._billboard:Te.getDefault().billboard}set billboard(e){this._billboard=e}get overrideBrightness(){return this._overrideBrightness!==void 0?this._overrideBrightness:Te.getDefault().overrideBrightness}set overrideBrightness(e){this._overrideBrightness=e}get brightnessOverride(){return this._brightnessOverride!==void 0?this._brightnessOverride:Te.getDefault().brightnessOverride}set brightnessOverride(e){this._brightnessOverride=e}get enchanted(){return this._enchanted!==void 0?this._enchanted:Te.getDefault().enchanted}set enchanted(e){this._enchanted=e}get glowing(){return this._glowing!==void 0?this._glowing:Te.getDefault().glowing}set glowing(e){this._glowing=e}get overrideGlowColor(){return this._overrideGlowColor!==void 0?this._overrideGlowColor:Te.getDefault().overrideGlowColor}set overrideGlowColor(e){this._overrideGlowColor=e}get glowColor(){return this._glowColor!==void 0?this._glowColor:Te.getDefault().glowColor}set glowColor(e){this._glowColor=e}get inheritSettings(){return this._inheritSettings!==void 0?this._inheritSettings:Te.getDefault().inheritSettings}set inheritSettings(e){this._inheritSettings=e}get invisible(){return this._invisible!==void 0?this._invisible:Te.getDefault().invisible}set invisible(e){this._invisible=e}get nbt(){return this._nbt!==void 0?this._nbt:Te.getDefault().nbt}set nbt(e){this._nbt=e}get shadowRadius(){return this._shadowRadius!==void 0?this._shadowRadius:Te.getDefault().shadowRadius}set shadowRadius(e){this._shadowRadius=e}get shadowStrength(){return this._shadowStrength!==void 0?this._shadowStrength:Te.getDefault().shadowStrength}set shadowStrength(e){this._shadowStrength=e}get useNBT(){return this._useNBT!==void 0?this._useNBT:Te.getDefault().useNBT}set useNBT(e){this._useNBT=e}checkIfEqual(e){return this._customName===e._customName&&this._customNameVisible===e._customNameVisible&&this._billboard===e._billboard&&this._overrideBrightness===e._overrideBrightness&&this._brightnessOverride===e._brightnessOverride&&this._enchanted===e._enchanted&&this._glowing===e._glowing&&this._overrideGlowColor===e._overrideGlowColor&&this._glowColor===e._glowColor&&this._inheritSettings===e._inheritSettings&&this._invisible===e._invisible&&this._nbt===e._nbt&&this._shadowRadius===e._shadowRadius&&this._shadowStrength===e._shadowStrength&&this._useNBT===e._useNBT}isDefault(){return this.checkIfEqual(Te.getDefault())}toJSON(){return{custom_name:this._customName,custom_name_visible:this._customNameVisible,billboard:this._billboard,override_brightness:this._overrideBrightness,brightness_override:this._brightnessOverride,enchanted:this._enchanted,glowing:this._glowing,override_glow_color:this._overrideGlowColor,glow_color:this._glowColor,inherit_settings:this._inheritSettings,invisible:this._invisible,nbt:this._nbt,shadow_radius:this._shadowRadius,shadow_strength:this._shadowStrength,use_nbt:this._useNBT}}inheritFrom(e){e._customName!==void 0&&(this.customName=e.customName),e._customNameVisible!==void 0&&(this.customNameVisible=e.customNameVisible),e._billboard!==void 0&&(this.billboard=e.billboard),e._overrideBrightness!==void 0&&(this.overrideBrightness=e.overrideBrightness),e._brightnessOverride!==void 0&&(this.brightnessOverride=e.brightnessOverride),e._enchanted!==void 0&&(this.enchanted=e.enchanted),e._glowing!==void 0&&(this.glowing=e.glowing),e._overrideGlowColor!==void 0&&(this.overrideGlowColor=e.overrideGlowColor),e._glowColor!==void 0&&(this.glowColor=e.glowColor),e._inheritSettings!==void 0&&(this.inheritSettings=e.inheritSettings),e._invisible!==void 0&&(this.invisible=e.invisible),e._nbt!==void 0&&(this.nbt=e.nbt),e._shadowRadius!==void 0&&(this.shadowRadius=e.shadowRadius),e._shadowStrength!==void 0&&(this.shadowStrength=e.shadowStrength),e._useNBT!==void 0&&(this.useNBT=e.useNBT)}static fromJSON(e){let t=new Te;return e.custom_name!==void 0&&(t._customName=e.custom_name),e.custom_name_visible!==void 0&&(t._customNameVisible=e.custom_name_visible),e.billboard!==void 0&&(t._billboard=e.billboard),e.override_brightness!==void 0&&(t._overrideBrightness=e.override_brightness),e.brightness_override!==void 0&&(t._brightnessOverride=e.brightness_override),e.enchanted!==void 0&&(t._enchanted=e.enchanted),e.glowing!==void 0&&(t._glowing=e.glowing),e.override_glow_color!==void 0&&(t._overrideGlowColor=e.override_glow_color),e.glow_color!==void 0&&(t._glowColor=e.glow_color),e.inherit_settings!==void 0&&(t._inheritSettings=e.inherit_settings),e.invisible!==void 0&&(t._invisible=e.invisible),e.nbt!==void 0&&(t._nbt=e.nbt),e.shadow_radius!==void 0&&(t._shadowRadius=e.shadow_radius),e.shadow_strength!==void 0&&(t._shadowStrength=e.shadow_strength),e.use_nbt!==void 0&&(t._useNBT=e.use_nbt),t}toNBT(e=new Ye){if(this.useNBT){let t=Ze.fromString(this.nbt);for(let i of t.keys())e.set(i,t.get(i));return e}if(this._customName&&e.set("CustomName",new ct(this.customName)),this._customNameVisible&&e.set("CustomNameVisible",new Dn(Number(this.customNameVisible))),this._billboard&&e.set("billboard",new ct(this.billboard)),this.overrideBrightness&&e.set("brightness",new Ye().set("block",new At(this.brightnessOverride)).set("sky",new At(this.brightnessOverride))),this.enchanted){let t=e.get("item")||new Ye;e.set("item",t.set("components",new Ye().set("minecraft:enchantments",new Ye().set("levels",new Ye().set("minecraft:infinity",new Qt(1))))))}return this.glowing&&e.set("Glowing",new Dn(Number(this.glowing))),this.overrideGlowColor&&e.set("glow_color_override",new Qt(Number(this.glowColor.replace("#","0x")))),this._shadowRadius&&e.set("shadow_radius",new At(this.shadowRadius)),this._shadowStrength&&e.set("shadow_strength",new At(this.shadowStrength)),e}};s(Te,"BoneConfig");var jr=class{_useEntity;_entityType;_summonCommands;_tickingCommands;getDefault(){return jr.fromJSON({use_entity:!1,entity_type:"minecraft:pig",summon_commands:"",ticking_commands:""})}get useEntity(){return this._useEntity!==void 0?this._useEntity:this.getDefault().useEntity}set useEntity(e){this._useEntity=e}get entityType(){return this._entityType!==void 0?this._entityType:this.getDefault().entityType}set entityType(e){this._entityType=e}get summonCommands(){return this._summonCommands!==void 0?this._summonCommands:this.getDefault().summonCommands}set summonCommands(e){this._summonCommands=e}get tickingCommands(){return this._tickingCommands!==void 0?this._tickingCommands:this.getDefault().tickingCommands}set tickingCommands(e){this._tickingCommands=e}toJSON(){return{use_entity:this._useEntity,entity_type:this._entityType,summon_commands:this._summonCommands,ticking_commands:this._tickingCommands}}static fromJSON(e){let t=new jr;return e.use_entity!==void 0&&(t._useEntity=e.use_entity),e.entity_type!==void 0&&(t._entityType=e.entity_type),e.summon_commands!==void 0&&(t._summonCommands=e.summon_commands),e.ticking_commands!==void 0&&(t._tickingCommands=e.ticking_commands),t}isDefault(){return this.checkIfEqual(new jr)}checkIfEqual(e){return this.useEntity===e.useEntity&&this.entityType===e.entityType&&this.summonCommands===e.summonCommands&&this.tickingCommands===e.tickingCommands}};s(jr,"LocatorConfig");var Tn=class{_billboard;_overrideBrightness;_brightnessOverride;_glowing;_overrideGlowColor;_glowColor;_invisible;_shadowRadius;_shadowStrength;_useNBT;_nbt;static getDefault(){return Tn.fromJSON({billboard:"fixed",override_brightness:!1,brightness_override:0,glowing:!1,override_glow_color:!1,glow_color:"#ffffff",invisible:!1,nbt:"{}",shadow_radius:0,shadow_strength:1,use_nbt:!1})}get billboard(){return this._billboard!==void 0?this._billboard:Te.getDefault().billboard}set billboard(e){this._billboard=e}get overrideBrightness(){return this._overrideBrightness!==void 0?this._overrideBrightness:Te.getDefault().overrideBrightness}set overrideBrightness(e){this._overrideBrightness=e}get brightnessOverride(){return this._brightnessOverride!==void 0?this._brightnessOverride:Te.getDefault().brightnessOverride}set brightnessOverride(e){this._brightnessOverride=e}get glowing(){return this._glowing!==void 0?this._glowing:Te.getDefault().glowing}set glowing(e){this._glowing=e}get overrideGlowColor(){return this._overrideGlowColor!==void 0?this._overrideGlowColor:Te.getDefault().overrideGlowColor}set overrideGlowColor(e){this._overrideGlowColor=e}get glowColor(){return this._glowColor!==void 0?this._glowColor:Te.getDefault().glowColor}set glowColor(e){this._glowColor=e}get invisible(){return this._invisible!==void 0?this._invisible:Te.getDefault().invisible}set invisible(e){this._invisible=e}get nbt(){return this._nbt!==void 0?this._nbt:Te.getDefault().nbt}set nbt(e){this._nbt=e}get shadowRadius(){return this._shadowRadius!==void 0?this._shadowRadius:Te.getDefault().shadowRadius}set shadowRadius(e){this._shadowRadius=e}get shadowStrength(){return this._shadowStrength!==void 0?this._shadowStrength:Te.getDefault().shadowStrength}set shadowStrength(e){this._shadowStrength=e}get useNBT(){return this._useNBT!==void 0?this._useNBT:Te.getDefault().useNBT}set useNBT(e){this._useNBT=e}getDefault(){return Tn.fromJSON({billboard:"center"})}get tickingCommands(){return this._billboard!==void 0?this._billboard:this.getDefault().tickingCommands}set tickingCommands(e){this._billboard=e}toJSON(){return{billboard:this._billboard,override_brightness:this._overrideBrightness,brightness_override:this._brightnessOverride,glowing:this._glowing,override_glow_color:this._overrideGlowColor,glow_color:this._glowColor,invisible:this._invisible,nbt:this._nbt,shadow_radius:this._shadowRadius,shadow_strength:this._shadowStrength,use_nbt:this._useNBT}}static fromJSON(e){let t=new Tn;return e.billboard!==void 0&&(t._billboard=e.billboard),e.override_brightness!==void 0&&(t._overrideBrightness=e.override_brightness),e.brightness_override!==void 0&&(t._brightnessOverride=e.brightness_override),e.glowing!==void 0&&(t._glowing=e.glowing),e.override_glow_color!==void 0&&(t._overrideGlowColor=e.override_glow_color),e.glow_color!==void 0&&(t._glowColor=e.glow_color),e.invisible!==void 0&&(t._invisible=e.invisible),e.nbt!==void 0&&(t._nbt=e.nbt),e.shadow_radius!==void 0&&(t._shadowRadius=e.shadow_radius),e.shadow_strength!==void 0&&(t._shadowStrength=e.shadow_strength),e.use_nbt!==void 0&&(t._useNBT=e.use_nbt),t}toNBT(e=new Ye){if(this.useNBT){let t=Ze.fromString(this.nbt);for(let i of t.keys())e.set(i,t.get(i));return e}return this._billboard&&e.set("billboard",new ct(this.billboard)),this.overrideBrightness&&e.set("brightness",new Ye().set("block",new At(this.brightnessOverride)).set("sky",new At(this.brightnessOverride))),this.glowing&&e.set("Glowing",new Dn(Number(this.glowing))),this.overrideGlowColor&&e.set("glow_color_override",new Qt(Number(this.glowColor.replace("#","0x")))),this._shadowRadius&&e.set("shadow_radius",new At(this.shadowRadius)),this._shadowStrength&&e.set("shadow_strength",new At(this.shadowStrength)),e}isDefault(){return this.checkIfEqual(new Tn)}checkIfEqual(e){return this._billboard===e._billboard&&this._overrideBrightness===e._overrideBrightness&&this._brightnessOverride===e._brightnessOverride&&this._glowing===e._glowing&&this._overrideGlowColor===e._overrideGlowColor&&this._glowColor===e._glowColor&&this._invisible===e._invisible&&this._nbt===e._nbt&&this._shadowRadius===e._shadowRadius&&this._shadowStrength===e._shadowStrength&&this._useNBT===e._useNBT}};s(Tn,"TextDisplayConfig");function lP(n){let e,t,i,r,a,o=cP()+"",l,u,c,d,m=w("dialog.unexpected_error.paragraph",'Discord','Github')+"",p,f,_,g,h,v,y,k;return{c(){e=P("div"),t=P("div"),i=P("i"),r=G(),a=P("h2"),l=G(),u=P("i"),c=G(),d=P("p"),p=G(),f=P("div"),_=P("textarea"),g=G(),h=P("i"),T(i,"class","fas fa-quote-left dialog_form_warning text_icon svelte-hszt7f"),Ge(a,"font-size","24px"),Ge(a,"text-align","center"),T(u,"class","fas fa-quote-right dialog_form_warning text_icon svelte-hszt7f"),T(t,"class","quote svelte-hszt7f"),_.readOnly=!0,T(_,"class","svelte-hszt7f"),T(h,"class","fas fa-copy dialog_form_warning text_icon svelte-hszt7f"),T(h,"title",v=w("dialog.unexpected_error.copy_error_message_button.description")),T(f,"class","codebox dark_bordered svelte-hszt7f"),T(e,"class","container svelte-hszt7f")},m(b,x){L(b,e,x),N(e,t),N(t,i),N(t,r),N(t,a),a.innerHTML=o,N(t,l),N(t,u),N(e,c),N(e,d),d.innerHTML=m,N(e,p),N(e,f),N(f,_),bt(_,n[0]),N(f,g),N(f,h),y||(k=[Le(_,"input",n[3]),Le(h,"click",n[1])],y=!0)},p(b,[x]){x&1&&bt(_,b[0])},i:ue,o:ue,d(b){b&&F(e),y=!1,Lt(k)}}}s(lP,"create_fragment");var tb=["Uh oh!","Time to fire up the ol' debugger!","Your item displays are sad \u{1F97A}",'Ok, who pushed the big red button?',"Skill Issue.","You have how many elements!?","I'll export successfully some day!","When I grow up, I wanna be just like Blender!","Should'a seen that one comming...","It's all Jannis' fault! :(","Snaviewavie did an oopsie poopsie x3","We to a little trolling","execute run execute run execute run execute run say This is fine.","This is why we can't have nice things. :(","Have you tried turning it off and on again?","What if I put my command block next to yours? Haha just kidding... Unless?","If at first you don't succeed, Try, try again!","B:01010111 01100101 00100000 01100100 01101111 00100000 01100001 00100000 01101100 01101001 01110100 01110100 01101100 01100101 00100000 01110100 01110010 01101111 01101100 01101100 01101001 01101110 01100111",`

      SnaveSutit would like to know your location

      -
      `,"I've decided to stop working for today. Try again tomorrow!","Every time you see this error message, a developer vanishes in a puff of binary.",`"Flavor Text"? I've never tasted text before...`,"( \u0361\xB0 \u035C\u0296 \u0361\xB0)","That's a nice model you have there, it'd be a shame if something were to happen to it...","Some day you'll learn. But until then, I control the cheese","Please deposit 5 coins!",'Click here to find a solution!','roflcopter',"Failed to find global 'pandemic'"];function YF(){return Lh[Math.floor(Math.random()*Lh.length)]}s(YF,"pickRandomFlavorQuote");function QF(n,e,t){let{error:i}=e,r=i.message+` -`+(i.stack||"");function a(){navigator.clipboard.writeText(r),Blockbench.showQuickMessage(w("dialog.unexpected_error.copy_error_message_button.message"))}s(a,"copyError");function o(){r=this.value,t(0,r)}return s(o,"textarea_input_handler"),n.$$set=l=>{"error"in l&&t(2,i=l.error)},[r,a,i,o]}s(QF,"instance");var Dc=class extends je{constructor(e){super(),Ie(this,e,QF,XF,Ae,{error:2})}};s(Dc,"UnexpectedErrorDialog");var Ph=Dc;(()=>{let n=Blockbench.addCSS(".container.svelte-hszt7f{height:25rem;display:flex;flex-direction:column}.codebox.svelte-hszt7f{height:25rem;display:flex;margin-top:16px}.quote.svelte-hszt7f{display:flex;justify-content:center;align-items:center;margin-bottom:1rem}textarea.svelte-hszt7f{width:100%;height:100%;border:unset}i.svelte-hszt7f{cursor:pointer;padding:5px;max-height:2rem}i.svelte-hszt7f:hover{color:var(--color-light)}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();var Pf=[],Pt=class extends Dialog{instance;constructor(e){let t=document.createComment("svelte-dialog-"+guid()),i={...e};delete i.component,super(e.id,{...i,lines:[t]}),this.onOpen=()=>{let r=t.parentElement;this.instance||!r||(r.style.overflow="visible",this.instance=new e.component({target:r,props:e.props}),e.onOpen&&e.onOpen(),e.stackable||(Pf.forEach(a=>a.cancel()),Pf.empty()),Pf.push(this))},this.confirm=r=>{if(r instanceof KeyboardEvent){if(e.preventKeybinds){r.preventDefault(),r.stopPropagation();return}else if(e.preventKeybindConfirm&&r.key===Keybinds.extra.confirm.keybind.getCode()){r.preventDefault(),r.stopPropagation();return}else if(e.preventKeybindCancel&&r.key===Keybinds.extra.cancel.keybind.getCode()){r.preventDefault(),r.stopPropagation();return}}this.close(this.confirmIndex,r)},this.onButton=(...r)=>{this.instance&&(this.instance.$destroy(),this.instance=void 0,e.onButton&&e.onButton(...r),e.onClose&&e.onClose())},this.onCancel=(...r)=>{this.instance&&(this.instance.$destroy(),this.instance=void 0,e.onCancel&&e.onCancel(...r),e.onClose&&e.onClose())}}};s(Pt,"SvelteDialog");function sa(n){new Pt({id:`${_e.name}:unexpectedError`,title:w("dialog.unexpected_error.title"),width:600,component:Ph,props:{error:n},preventKeybinds:!0,buttons:[w("dialog.unexpected_error.close_button")]}).show()}s(sa,"openUnexpectedErrorDialog");function Rc(n){console.log("Running MDFU...",JSON.parse(JSON.stringify(n))),n?.meta?.model_format==="animatedJava/ajmodel"&&(n.meta.model_format="animated_java/ajmodel",n.meta.format_version="0.0");try{let e=n.meta.format_version.length===3;return e=e||compareVersions(_e.version,n.meta.format_version),e&&(console.log("Upgrading model from version",n.meta.format_version,"to",_e.version),console.group("Upgrade process"),n.meta.format_version.length===3&&(console.log("Processing old model format",JSON.parse(JSON.stringify(n))),compareVersions("1.0",n.meta.format_version)&&eL(n),compareVersions("1.1",n.meta.format_version)&&tL(n),compareVersions("1.2",n.meta.format_version)&&nL(n),compareVersions("1.3",n.meta.format_version)&&iL(n),compareVersions("1.4",n.meta.format_version)&&rL(n),n.meta.format_version="0.3.9"),compareVersions("0.3.10",n.meta.format_version)&&aL(n),compareVersions("0.5.0",n.meta.format_version)&&(n=oL(n)),compareVersions("0.5.5",n.meta.format_version)&&(n=sL(n)),compareVersions("0.5.6",n.meta.format_version)&&(n=lL(n)),compareVersions("0.5.7",n.meta.format_version)&&(n=cL(n)),console.groupEnd(),n.meta.format_version=_e.version,console.log("Upgrade complete")),n}catch(e){throw sa(e),e}}s(Rc,"process");function eL(n){if(console.log("Processing model format 1.0",JSON.parse(JSON.stringify(n))),n.meta.settings){console.log("Upgrading settings...");let e={settings:{project_name:n.meta.settings.animatedJava.projectName,verbose:n.meta.settings.animatedJava.verbose,rig_item:n.meta.settings.animatedJava.rigItem,rig_item_model:n.meta.settings.animatedJava.predicateFilePath,rig_export_folder:n.meta.settings.animatedJava.rigModelsExportFolder},exporter_settings:{},variants:[]};n.animated_java=e}if(n.meta.variants){console.log("Upgrading variants...");let e=[];for(let[t,i]of Object.entries(n.meta.variants))e.push({name:t,uuid:guid(),textureMap:i,default:t==="default",boneConfig:{},affectedBones:[],affectedBonesIsAWhitelist:!1});n.animated_java.variants=e}if(n.animations&&n.animations.find(e=>Object.keys(e.animators).find(t=>t==="effects"))){console.log("Upgrading effects...");for(let e of n.animations){let t=e.animators.effects;if(t){for(let i of t.keyframes)if(i.channel==="timeline")for(let r of i.data_points)r.script&&(r.commands=r.script,delete r.script,i.channel="commands")}}console.log("Upgrading effects complete",n.animations)}n.meta.format_version=_e.version,delete n.meta.variants,delete n.meta.settings,delete n.meta.uuid}s(eL,"updateModelToOld1_0");function tL(n){console.log("Processing model format 1.1",JSON.parse(JSON.stringify(n))),n.animated_java.settings.resource_pack_mcmeta=n.animated_java.settings.resource_pack_folder,delete n.animated_java.settings.resource_pack_folder;let e=n.animated_java.exporter_settings["animated_java:animation_exporter"];e&&(e.datapack_mcmeta=e.datapack_folder,delete e.datapack_folder)}s(tL,"updateModelToOld1_1");function nL(n){console.log("Processing model format 1.2",JSON.parse(JSON.stringify(n)));for(let e of n.animated_java.variants)for(let[t,i]of Object.entries(e.textureMap)){let r=t.split("::")[0],a=i.split("::")[0];e.textureMap[r]=a,delete e.textureMap[t]}}s(nL,"updateModelToOld1_2");function iL(n){console.log("Processing model format 1.3",JSON.parse(JSON.stringify(n))),n.animated_java.settings.exporter==="animated_java:animation_exporter"&&(n.animated_java.settings.exporter="animated_java:datapack_exporter"),n.animated_java.exporter_settings["animated_java:animation_exporter"]&&(n.animated_java.exporter_settings["animated_java:datapack_exporter"]=n.animated_java.exporter_settings["animated_java:animation_exporter"],delete n.animated_java.exporter_settings["animated_java:animation_exporter"])}s(iL,"updateModelToOld1_3");function rL(n){console.log("Processing model format 1.4",JSON.parse(JSON.stringify(n)));let e=n.animated_java.exporter_settings["animated_java:datapack_exporter"];e&&e.outdated_rig_warning!==void 0&&(n.animated_java.exporter_settings["animated_java:datapack_exporter"].enable_outdated_rig_warning=n.animated_java.exporter_settings["animated_java:datapack_exporter"].outdated_rig_warning,delete n.animated_java.exporter_settings["animated_java:datapack_exporter"].outdated_rig_warning)}s(rL,"updateModelToOld1_4");function aL(n){console.log("Processing model for AJ 0.3.10",JSON.parse(JSON.stringify(n)))}s(aL,"updateModelTo0_3_10");function oL(n){console.log("Processing model format 1.0.0-pre1",JSON.parse(JSON.stringify(n)));let e=Vf(),t=n.animated_java.exporter_settings["animated_java:datapack_exporter"],i=n.animated_java.variants.find(d=>!!d.default),r=n.animated_java.variants.filter(d=>!d.default),a={meta:{format:"animated_java_blueprint",format_version:"0.5.0",uuid:n.meta.uuid||guid(),last_used_export_namespace:n.animated_java.settings.project_namespace},project_settings:{show_bounding_box:e.show_bounding_box,auto_bounding_box:e.auto_bounding_box,bounding_box:e.bounding_box,export_namespace:n.animated_java.settings.project_namespace,enable_plugin_mode:e.enable_plugin_mode,resource_pack_export_mode:e.resource_pack_export_mode,data_pack_export_mode:e.data_pack_export_mode,display_item:n.animated_java.settings.rig_item,custom_model_data_offset:0,enable_advanced_resource_pack_settings:n.animated_java.settings.enable_advanced_resource_pack_settings,resource_pack:n.animated_java.settings.resource_pack_mcmeta?n.animated_java.settings.resource_pack_mcmeta.replace(/pack\.mcmeta$/,""):"",display_item_path:n.animated_java.settings.rig_item_model,model_folder:n.animated_java.settings.rig_export_folder,texture_folder:n.animated_java.settings.texture_export_folder,enable_advanced_data_pack_settings:e.enable_advanced_data_pack_settings,data_pack:t?.datapack_mcmeta?t.datapack_mcmeta.replace(/pack\.mcmeta$/,""):"",summon_commands:e.summon_commands,interpolation_duration:e.interpolation_duration,teleportation_duration:e.teleportation_duration,use_storage_for_animation:e.use_storage_for_animation,baked_animations:e.baked_animations,json_file:e.json_file},variants:{default:{name:"default",display_name:i.name||"Default",uuid:i.uuid||guid(),texture_map:i.textureMap||{},excluded_bones:[]},list:[]},resolution:n.resolution,outliner:[],elements:n.elements,animations:n.animations,textures:n.textures,animation_variable_placeholders:n.animation_variable_placeholders},o=[],l=s(d=>{typeof d!="string"&&(o.push(d.uuid),d.configs={default:new Pe().toJSON(),variants:{}},d.children.forEach(m=>{typeof m!="string"&&l(m)}),d.nbt&&d.nbt!=="{}"&&(d.configs.default.use_nbt=!0,d.configs.default.nbt=d.nbt,delete d.nbt))},"recurseOutliner");n.outliner.forEach(l),a.outliner=n.outliner;for(let d of a.elements)if(d.type==="locator"&&(d.config={use_entity:!0},d.entity_type&&(d.config.entity_type=d.entity_type),d.nbt)){let m=[],p=qe.fromString(d.nbt);p.delete("Passengers");let f=p.get("Tags")?.map(v=>v.getAsString());p.delete("Tags"),m.push("data merge entity @s "+p.toString()),f&&m.push(...f.map(v=>`tag @s add ${v}`));let _=s(v=>{let g=qe.fromString(v);if(!(g instanceof Ze))throw new Error("NBT is not a compound");let h=g.get("Passengers");if(h){console.log("Found passengers");let b=h.map(x=>{let y=x.get("id").getAsString();x.delete("id");let k=x.get("Tags").map(A=>A.getAsString());x.delete("Tags");let C=x.toString();return`execute summon ${y} run { - ${[`data merge entity @s ${C}`,...k.map(A=>`tag @s add ${A}`),"tag @s add to_mount",..._(C)].join(` +
      `,"I've decided to stop working for today. Try again tomorrow!","Every time you see this error message, a developer vanishes in a puff of binary.",`"Flavor Text"? I've never tasted text before...`,"( \u0361\xB0 \u035C\u0296 \u0361\xB0)","That's a nice model you have there, it'd be a shame if something were to happen to it...","Some day you'll learn. But until then, I control the cheese","Please deposit 5 coins!",'Click here to find a solution!','roflcopter',"Failed to find global 'pandemic'"];function cP(){return tb[Math.floor(Math.random()*tb.length)]}s(cP,"pickRandomFlavorQuote");function uP(n,e,t){let{error:i}=e,r=i.message+` +`+(i.stack||"");function a(){navigator.clipboard.writeText(r),Blockbench.showQuickMessage(w("dialog.unexpected_error.copy_error_message_button.message"))}s(a,"copyError");function o(){r=this.value,t(0,r)}return s(o,"textarea_input_handler"),n.$$set=l=>{"error"in l&&t(2,i=l.error)},[r,a,i,o]}s(uP,"instance");var Gc=class extends Be{constructor(e){super(),De(this,e,uP,lP,Oe,{error:2})}};s(Gc,"UnexpectedErrorDialog");var nb=Gc;(()=>{let n=Blockbench.addCSS(".container.svelte-hszt7f{height:25rem;display:flex;flex-direction:column}.codebox.svelte-hszt7f{height:25rem;display:flex;margin-top:16px}.quote.svelte-hszt7f{display:flex;justify-content:center;align-items:center;margin-bottom:1rem}textarea.svelte-hszt7f{width:100%;height:100%;border:unset}i.svelte-hszt7f{cursor:pointer;padding:5px;max-height:2rem}i.svelte-hszt7f:hover{color:var(--color-light)}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();var Xf=[],qt=class extends Dialog{instance;constructor(e){let t=document.createComment("svelte-dialog-"+guid()),i={...e};delete i.component,super(e.id,{...i,lines:[t]}),this.onOpen=()=>{let r=t.parentElement;this.instance||!r||(r.style.overflow="visible",this.instance=new e.component({target:r,props:e.props}),e.onOpen&&e.onOpen(),e.stackable||(Xf.forEach(a=>a.cancel()),Xf.empty()),Xf.push(this))},this.confirm=r=>{if(r instanceof KeyboardEvent){if(e.preventKeybinds){r.preventDefault(),r.stopPropagation();return}else if(e.preventKeybindConfirm&&r.key===Keybinds.extra.confirm.keybind.getCode()){r.preventDefault(),r.stopPropagation();return}else if(e.preventKeybindCancel&&r.key===Keybinds.extra.cancel.keybind.getCode()){r.preventDefault(),r.stopPropagation();return}}this.close(this.confirmIndex,r)},this.onButton=(...r)=>{this.instance&&(this.instance.$destroy(),this.instance=void 0,e.onButton&&e.onButton(...r),e.onClose&&e.onClose())},this.onCancel=(...r)=>{this.instance&&(this.instance.$destroy(),this.instance=void 0,e.onCancel&&e.onCancel(...r),e.onClose&&e.onClose())}}};s(qt,"SvelteDialog");function fa(n){new qt({id:`${ke.name}:unexpectedError`,title:w("dialog.unexpected_error.title"),width:600,component:nb,props:{error:n},preventKeybinds:!0,buttons:[w("dialog.unexpected_error.close_button")]}).show()}s(fa,"openUnexpectedErrorDialog");function Uc(n){console.log("Running MDFU...",JSON.parse(JSON.stringify(n))),n?.meta?.model_format==="animatedJava/ajmodel"&&(n.meta.model_format="animated_java/ajmodel",n.meta.format_version="0.0");try{let e=n.meta.format_version.length===3;return e=e||compareVersions(ke.version,n.meta.format_version),e&&(console.log("Upgrading model from version",n.meta.format_version,"to",ke.version),console.group("Upgrade process"),n.meta.format_version.length===3&&(console.log("Processing old model format",JSON.parse(JSON.stringify(n))),compareVersions("1.0",n.meta.format_version)&&dP(n),compareVersions("1.1",n.meta.format_version)&&fP(n),compareVersions("1.2",n.meta.format_version)&&mP(n),compareVersions("1.3",n.meta.format_version)&&pP(n),compareVersions("1.4",n.meta.format_version)&&_P(n),n.meta.format_version="0.3.9"),compareVersions("0.3.10",n.meta.format_version)&&gP(n),compareVersions("0.5.0",n.meta.format_version)&&(n=hP(n)),compareVersions("0.5.5",n.meta.format_version)&&(n=bP(n)),compareVersions("0.5.6",n.meta.format_version)&&(n=vP(n)),compareVersions("0.5.7",n.meta.format_version)&&(n=yP(n)),compareVersions("1.4.0",n.meta.format_version)&&(n=wP(n)),console.groupEnd(),n.meta.format_version=ke.version,console.log("Upgrade complete")),n}catch(e){throw fa(e),e}}s(Uc,"process");function dP(n){if(console.log("Processing model format 1.0",JSON.parse(JSON.stringify(n))),n.meta.settings){console.log("Upgrading settings...");let e={settings:{project_name:n.meta.settings.animatedJava.projectName,verbose:n.meta.settings.animatedJava.verbose,rig_item:n.meta.settings.animatedJava.rigItem,rig_item_model:n.meta.settings.animatedJava.predicateFilePath,rig_export_folder:n.meta.settings.animatedJava.rigModelsExportFolder},exporter_settings:{},variants:[]};n.animated_java=e}if(n.meta.variants){console.log("Upgrading variants...");let e=[];for(let[t,i]of Object.entries(n.meta.variants))e.push({name:t,uuid:guid(),textureMap:i,default:t==="default",boneConfig:{},affectedBones:[],affectedBonesIsAWhitelist:!1});n.animated_java.variants=e}if(n.animations&&n.animations.find(e=>Object.keys(e.animators).find(t=>t==="effects"))){console.log("Upgrading effects...");for(let e of n.animations){let t=e.animators.effects;if(t){for(let i of t.keyframes)if(i.channel==="timeline")for(let r of i.data_points)r.script&&(r.commands=r.script,delete r.script,i.channel="commands")}}console.log("Upgrading effects complete",n.animations)}n.meta.format_version=ke.version,delete n.meta.variants,delete n.meta.settings,delete n.meta.uuid}s(dP,"updateModelToOld1_0");function fP(n){console.log("Processing model format 1.1",JSON.parse(JSON.stringify(n))),n.animated_java.settings.resource_pack_mcmeta=n.animated_java.settings.resource_pack_folder,delete n.animated_java.settings.resource_pack_folder;let e=n.animated_java.exporter_settings["animated_java:animation_exporter"];e&&(e.datapack_mcmeta=e.datapack_folder,delete e.datapack_folder)}s(fP,"updateModelToOld1_1");function mP(n){console.log("Processing model format 1.2",JSON.parse(JSON.stringify(n)));for(let e of n.animated_java.variants)for(let[t,i]of Object.entries(e.textureMap)){let r=t.split("::")[0],a=i.split("::")[0];e.textureMap[r]=a,delete e.textureMap[t]}}s(mP,"updateModelToOld1_2");function pP(n){console.log("Processing model format 1.3",JSON.parse(JSON.stringify(n))),n.animated_java.settings.exporter==="animated_java:animation_exporter"&&(n.animated_java.settings.exporter="animated_java:datapack_exporter"),n.animated_java.exporter_settings["animated_java:animation_exporter"]&&(n.animated_java.exporter_settings["animated_java:datapack_exporter"]=n.animated_java.exporter_settings["animated_java:animation_exporter"],delete n.animated_java.exporter_settings["animated_java:animation_exporter"])}s(pP,"updateModelToOld1_3");function _P(n){console.log("Processing model format 1.4",JSON.parse(JSON.stringify(n)));let e=n.animated_java.exporter_settings["animated_java:datapack_exporter"];e&&e.outdated_rig_warning!==void 0&&(n.animated_java.exporter_settings["animated_java:datapack_exporter"].enable_outdated_rig_warning=n.animated_java.exporter_settings["animated_java:datapack_exporter"].outdated_rig_warning,delete n.animated_java.exporter_settings["animated_java:datapack_exporter"].outdated_rig_warning)}s(_P,"updateModelToOld1_4");function gP(n){console.log("Processing model for AJ 0.3.10",JSON.parse(JSON.stringify(n)))}s(gP,"updateModelTo0_3_10");function hP(n){console.log("Processing model format 1.0.0-pre1",JSON.parse(JSON.stringify(n)));let e=Yf(),t=n.animated_java.exporter_settings["animated_java:datapack_exporter"],i=n.animated_java.variants.find(u=>!!u.default),r=n.animated_java.variants.filter(u=>!u.default),a={meta:{format:"animated_java_blueprint",format_version:"0.5.0",uuid:n.meta.uuid||guid(),last_used_export_namespace:n.animated_java.settings.project_namespace},project_settings:{show_bounding_box:e.show_bounding_box,auto_bounding_box:e.auto_bounding_box,bounding_box:e.bounding_box,export_namespace:n.animated_java.settings.project_namespace,enable_plugin_mode:e.enable_plugin_mode,resource_pack_export_mode:e.resource_pack_export_mode,data_pack_export_mode:e.data_pack_export_mode,display_item:n.animated_java.settings.rig_item,custom_model_data_offset:0,enable_advanced_resource_pack_settings:n.animated_java.settings.enable_advanced_resource_pack_settings,resource_pack:n.animated_java.settings.resource_pack_mcmeta?n.animated_java.settings.resource_pack_mcmeta.replace(/pack\.mcmeta$/,""):"",display_item_path:n.animated_java.settings.rig_item_model,model_folder:n.animated_java.settings.rig_export_folder,texture_folder:n.animated_java.settings.texture_export_folder,enable_advanced_data_pack_settings:e.enable_advanced_data_pack_settings,data_pack:t?.datapack_mcmeta?t.datapack_mcmeta.replace(/pack\.mcmeta$/,""):"",summon_commands:e.summon_commands,interpolation_duration:e.interpolation_duration,teleportation_duration:e.teleportation_duration,use_storage_for_animation:e.use_storage_for_animation,baked_animations:e.baked_animations,json_file:e.json_file},variants:{default:{name:"default",display_name:i.name||"Default",uuid:i.uuid||guid(),texture_map:i.textureMap||{},excluded_bones:[]},list:[]},resolution:n.resolution,outliner:[],elements:n.elements,animations:n.animations,textures:n.textures,animation_variable_placeholders:n.animation_variable_placeholders},o=[],l=s(u=>{typeof u!="string"&&(o.push(u.uuid),u.configs={default:new Te().toJSON(),variants:{}},u.children.forEach(c=>{typeof c!="string"&&l(c)}),u.nbt&&u.nbt!=="{}"&&(u.configs.default.use_nbt=!0,u.configs.default.nbt=u.nbt,delete u.nbt))},"recurseOutliner");n.outliner.forEach(l),a.outliner=n.outliner;for(let u of a.elements)if(u.type==="locator"&&(u.config={use_entity:!0},u.entity_type&&(u.config.entity_type=u.entity_type),u.nbt)){let c=[],d=Ze.fromString(u.nbt);d.delete("Passengers");let m=d.get("Tags")?.map(f=>f.getAsString());d.delete("Tags"),c.push("data merge entity @s "+d.toString()),m&&c.push(...m.map(f=>`tag @s add ${f}`));let p=s(f=>{let _=Ze.fromString(f);if(!(_ instanceof Ye))throw new Error("NBT is not a compound");let g=_.get("Passengers");if(g){console.log("Found passengers");let h=g.map(v=>{let y=v.get("id").getAsString();v.delete("id");let k=v.get("Tags").map(x=>x.getAsString());v.delete("Tags");let b=v.toString();return`execute summon ${y} run { + ${[`data merge entity @s ${b}`,...k.map(x=>`tag @s add ${x}`),"tag @s add to_mount",...p(b)].join(` `)} -}`});return b.push("tag @s add vehicle","execute as @e[tag=to_mount,distance=..0.01] run {"," ride @s mount @e[tag=vehicle,limit=1]"," tag @s remove to_mount","}","tag @s remove vehicle","execute on passengers run tag @s remove to_mount"),b}return[]},"recursePassengers");try{m.push(..._(d.nbt))}catch(v){console.error("Failed to parse NBT",d.nbt),console.error(v)}m.length===0&&m.push(`data merge entity @s ${d.nbt}`),d.config.summon_commands=m.join(` -`)}for(let d of r){let m=d.affectedBones.map(f=>f.value),p;d.affectedBonesIsAWhitelist?p=o.filter(f=>!m.includes(f)):p=m,a.variants.list.push({name:d.name,display_name:d.name,uuid:d.uuid,texture_map:d.textureMap,excluded_nodes:p})}let c=new Locator({name:"commands",from:[0,0,0]}).getSaveCopy(),u=0;if(a.animations)for(let d of a.animations){if(d.animators?.effects)for(let f of d.animators.effects.keyframes)f.channel==="variants"&&(f.channel="variant");let m=[],p=d.animators?.effects;if(!(!p||!p.keyframes)){for(let f of p.keyframes)if(!(!f||f.channel!=="commands"||f.data_points&&f.data_points.length<1))for(let _ of f.data_points)_.commands&&m.push({...f,data_points:[{commands:_.commands,time:_.time}]});if(m.length>0){d.animators[c.uuid]??={type:"locator",name:"commands",keyframes:[]};let f=d.animators[c.uuid];for(let _ of m)f.keyframes.push(_),u++}}}if(u>0&&a.elements.push(c),t?.root_entity_nbt&&t.root_entity_nbt!=="{}"){let d=[],m=qe.fromString(t.root_entity_nbt),p=m.get("Tags")?.map(f=>f.getAsString());m.delete("Tags"),[...m.keys()].length!==0&&d.push("data merge entity @s "+m.toString()),p&&d.push(...p.map(f=>`tag @s add ${f}`)),a.project_settings.summon_commands=d.join(` -`)}return a}s(oL,"updateModelTo1_0pre1");function sL(n){console.log("Processing model format 1.0.0-pre6",JSON.parse(JSON.stringify(n)));let e=n.variants.default;e?.excluded_bones&&(e.excluded_nodes=e.excluded_bones,delete e.excluded_bones);for(let t of n?.variants?.list||[])t?.excluded_bones&&(t.excluded_nodes=t.excluded_bones,delete t.excluded_bones);for(let t of n?.animations||[])t?.excluded_bones&&(t.excluded_nodes=t.excluded_bones,delete t.excluded_bones);return n}s(sL,"updateModelTo1_0pre6");function lL(n){return console.log("Processing model format 1.0.0-pre7",JSON.parse(JSON.stringify(n))),n.project_settings.enable_resource_pack!==void 0&&(n.project_settings.resource_pack_export_mode=n.project_settings.enable_resource_pack?"raw":"none",delete n.project_settings.enable_resource_pack),n.project_settings.enable_data_pack!==void 0&&(n.project_settings.data_pack_export_mode=n.project_settings.enable_data_pack?"raw":"none",delete n.project_settings.enable_data_pack),n}s(lL,"updateModelTo1_0pre7");function cL(n){return console.log("Processing model format 1.0.0-pre8",JSON.parse(JSON.stringify(n))),n.project_settings&&(n.blueprint_settings=n.project_settings,delete n.project_settings),n}s(cL,"updateModelTo1_0pre8");function Vh(){Project.save_path="";for(let n of Group.all)n.createUniqueName(Group.all.filter(e=>e!==n)),n.sanitizeName();for(let n of Blockbench.Animation.all)n.createUniqueName(Blockbench.Animation.all.filter(e=>e!==n)),n.name=Rt(n.name)}s(Vh,"convertToBlueprint");function Vf(){return Ms}s(Vf,"getDefaultProjectSettings");function Mc(){if(!Project||!Ue()||(Project.visualBoundingBox&&scene.remove(Project.visualBoundingBox),!Project.animated_java.show_bounding_box))return;let n=0,e=0;if(Project.animated_java.auto_bounding_box){for(let r of Cube.all)n=Math.max(n,Math.abs(r.to[0]),Math.abs(r.to[2]),Math.abs(r.from[0]),Math.abs(r.from[2])),e=Math.max(e,r.to[1],r.from[1]);let i=8;n+=i,e+=i}else n=Project.animated_java.bounding_box[0],e=Project.animated_java.bounding_box[1];let t=new THREE.BoxGeometry(n*2,e,n*2);Project.visualBoundingBox=new THREE.LineSegments(new THREE.EdgesGeometry(t),new THREE.LineBasicMaterial({color:"#855000"})),Project.visualBoundingBox.position.set(0,e/2,0),scene.add(Project.visualBoundingBox)}s(Mc,"updateBoundingBox");var xn=new Blockbench.Codec("animated_java_blueprint",{name:"Animated Java Blueprint",extension:"ajblueprint",remember:!0,load_filter:{extensions:["ajblueprint"],type:"json"},load(n,e){if(console.log(`Loading Animated Java Blueprint from '${e.name}'...`),n=Rc(n),setupProject(et,n.meta.uuid),!Project)throw new Error("Failed to load Animated Java Blueprint");ag(e),xn.parse(n,e.path),console.log(`Successfully loaded Animated Java Blueprint +}`});return h.push("tag @s add vehicle","execute as @e[tag=to_mount,distance=..0.01] run {"," ride @s mount @e[tag=vehicle,limit=1]"," tag @s remove to_mount","}","tag @s remove vehicle","execute on passengers run tag @s remove to_mount"),h}return[]},"recursePassengers");try{c.push(...p(u.nbt))}catch(f){console.error("Failed to parse NBT",u.nbt),console.error(f)}c.length===0&&c.push(`data merge entity @s ${u.nbt}`),u.config.summon_commands=c.join(` +`)}for(let u of r){let c=u.affectedBones.map(m=>m.value),d;u.affectedBonesIsAWhitelist?d=o.filter(m=>!c.includes(m)):d=c,a.variants.list.push({name:u.name,display_name:u.name,uuid:u.uuid,texture_map:u.textureMap,excluded_nodes:d})}if(t?.root_entity_nbt&&t.root_entity_nbt!=="{}"){let u=[],c=Ze.fromString(t.root_entity_nbt),d=c.get("Tags")?.map(m=>m.getAsString());c.delete("Tags"),[...c.keys()].length!==0&&u.push("data merge entity @s "+c.toString()),d&&u.push(...d.map(m=>`tag @s add ${m}`)),a.project_settings.summon_commands=u.join(` +`)}return a}s(hP,"updateModelTo1_0pre1");function bP(n){console.log("Processing model format 1.0.0-pre6",JSON.parse(JSON.stringify(n)));let e=n.variants.default;e?.excluded_bones&&(e.excluded_nodes=e.excluded_bones,delete e.excluded_bones);for(let t of n?.variants?.list||[])t?.excluded_bones&&(t.excluded_nodes=t.excluded_bones,delete t.excluded_bones);for(let t of n?.animations||[])t?.excluded_bones&&(t.excluded_nodes=t.excluded_bones,delete t.excluded_bones);return n}s(bP,"updateModelTo1_0pre6");function vP(n){return console.log("Processing model format 1.0.0-pre7",JSON.parse(JSON.stringify(n))),n.project_settings.enable_resource_pack!==void 0&&(n.project_settings.resource_pack_export_mode=n.project_settings.enable_resource_pack?"raw":"none",delete n.project_settings.enable_resource_pack),n.project_settings.enable_data_pack!==void 0&&(n.project_settings.data_pack_export_mode=n.project_settings.enable_data_pack?"raw":"none",delete n.project_settings.enable_data_pack),n}s(vP,"updateModelTo1_0pre7");function yP(n){return console.log("Processing model format 1.0.0-pre8",JSON.parse(JSON.stringify(n))),n.project_settings&&(n.blueprint_settings=n.project_settings,delete n.project_settings),n}s(yP,"updateModelTo1_0pre8");function wP(n){return console.log("Processing model format 1.4.0",JSON.parse(JSON.stringify(n))),n.blueprint_settings.enable_advanced_resource_pack_settings&&(n.blueprint_settings.enable_advanced_resource_pack_folders=!0),n.blueprint_settings.custom_model_data_offset!==void 0&&n.blueprint_settings.custom_model_data_offset!==0&&(n.blueprint_settings.enable_advanced_resource_pack_settings=!0),n}s(wP,"updateModelTo1_4_0");function ib(){Project.save_path="";for(let n of Group.all)n.createUniqueName(Group.all.filter(e=>e!==n)),n.sanitizeName();for(let n of Blockbench.Animation.all)n.createUniqueName(Blockbench.Animation.all.filter(e=>e!==n)),n.name=Ht(n.name)}s(ib,"convertToBlueprint");function Yf(){return zt}s(Yf,"getDefaultProjectSettings");function Jc(){if(!Project||!Ue()||(Project.visualBoundingBox&&scene.remove(Project.visualBoundingBox),!Project.animated_java.show_bounding_box))return;let n=0,e=0;if(Project.animated_java.auto_bounding_box){for(let r of Cube.all)n=Math.max(n,Math.abs(r.to[0]),Math.abs(r.to[2]),Math.abs(r.from[0]),Math.abs(r.from[2])),e=Math.max(e,r.to[1],r.from[1]);let i=8;n+=i,e+=i}else n=Project.animated_java.bounding_box[0],e=Project.animated_java.bounding_box[1];let t=new THREE.BoxGeometry(n*2,e,n*2);Project.visualBoundingBox=new THREE.LineSegments(new THREE.EdgesGeometry(t),new THREE.LineBasicMaterial({color:"#855000"})),Project.visualBoundingBox.position.set(0,e/2,0),scene.add(Project.visualBoundingBox)}s(Jc,"updateBoundingBox");var Cn=new Blockbench.Codec("animated_java_blueprint",{name:"Animated Java Blueprint",extension:"ajblueprint",remember:!0,load_filter:{extensions:["ajblueprint"],type:"json"},load(n,e){if(console.log(`Loading Animated Java Blueprint from '${e.name}'...`),n=Uc(n),setupProject(rt,n.meta.uuid),!Project)throw new Error("Failed to load Animated Java Blueprint");xg(e),Cn.parse(n,e.path),console.log(`Successfully loaded Animated Java Blueprint Project: ${Project.name} - ${Project.uuid}`)},parse(n,e){if(console.log(`Parsing Animated Java Blueprint from '${e}'...`),!Project)throw new Error("No project to parse into");Project.loadingPromises=[],Project.save_path=e,n.meta.box_uv!==void 0&&(Project.box_uv=n.meta.box_uv),n.resolution!==void 0&&(Project.texture_width=n.resolution.width,Project.texture_height=n.resolution.height);for(let t in ModelProject.properties)ModelProject.properties[t].merge(Project,n);if(n.blueprint_settings&&(Project.animated_java={...Project.animated_java,...n.blueprint_settings}),Project.last_used_export_namespace=n.meta.last_used_export_namespace||Project.animated_java.export_namespace,n.textures)for(let t of n.textures){let i=new Texture(t,t.uuid).add(!1);if(t.relative_path&&Project.save_path){let r=PathModule.resolve(Project.save_path,t.relative_path);if(fs.existsSync(r)){i.fromPath(r);continue}}t.path&&fs.existsSync(t.path)&&!n.meta.backup?i.fromPath(t.path):t.source&&t.source.startsWith("data:")&&i.fromDataURL(t.source)}if(n.elements){let t=Texture.getDefault();for(let i of n.elements){let r=OutlinerElement.fromSave(i,!0);switch(!0){case r instanceof Cube:{for(let a in r.faces)if(i.faces){let o=i.faces[a].texture!==void 0&&Texture.all[i.faces[a].texture];o&&(r.faces[a].texture=o.uuid)}else t&&r.faces&&r.faces[a].texture!==void 0&&(r.faces[a].texture=t.uuid);break}case r instanceof AnimatedJava.API.TextDisplay:case r instanceof AnimatedJava.API.VanillaItemDisplay:case r instanceof AnimatedJava.API.VanillaBlockDisplay:{Project.loadingPromises.push(r.waitForReady());break}}}}if(n.outliner){parseGroups(n.outliner);for(let t of Group.all)t.name=Rt(t.name)}if(n.variants){Se.fromJSON(n.variants.default,!0);for(let t of n.variants.list)Se.fromJSON(t);Project.variants=Se.all}else new Se("Default",!0);if(n.animations)for(let t of n.animations){let i=new Blockbench.Animation;i.uuid=t.uuid||guid(),i.extend(t).add()}if(n.animation_controllers)for(let t of n.animation_controllers){let i=new Blockbench.AnimationController;i.uuid=t.uuid||guid(),i.extend(t).add()}if(n.animation_variable_placeholders&&(Interface.Panels.variable_placeholders.inside_vue._data.text=n.animation_variable_placeholders),n.backgrounds){for(let t in n.backgrounds)if(Object.hasOwn(Project.backgrounds,t)){let i=n.backgrounds[t],r=Project.backgrounds[t];i.image!==void 0&&(r.image=i.image),i.size!==void 0&&(r.size=i.size),i.x!==void 0&&(r.x=i.x),i.y!==void 0&&(r.y=i.y),i.lock!==void 0&&(r.lock=i.lock)}Preview.all.forEach(t=>{t.canvas.isConnected&&t.loadBackground()})}Canvas.updateAll(),Validator.validate(),xn.dispatchEvent("parsed",{model:n})},compile(n){if(n||(n={}),console.log(`Compiling Animated Java Blueprint from ${Project.name}...`),!Project)throw new Error("No project to compile.");let e={meta:{format:et.id,format_version:_e.version,uuid:Project.uuid,save_location:Project.save_path,last_used_export_namespace:Project.last_used_export_namespace},blueprint_settings:Project.animated_java,resolution:{width:Project.texture_width||16,height:Project.texture_height||16}};console.log(Project.animated_java);let t=Se.selected;Se.selectDefault();for(let r in ModelProject.properties)ModelProject.properties[r].export&&ModelProject.properties[r].copy(Project,e);e.elements=[];for(let r of elements)e.elements.push(r.getSaveCopy&&r.getSaveCopy(!!e.meta));e.outliner=compileGroups(!0),e.textures=[];for(let r of Texture.all){let a=r.getUndoCopy();if(delete a.selected,Project.save_path&&r.path){let o=PathModule.relative(Project.save_path,r.path);r.relative_path=o.replace(/\\/g,"/")}a.source="data:image/png;base64,"+r.getBase64(),a.mode="bitmap",n.absolute_paths===!1&&delete a.path,e.textures.push(a)}e.variants={default:Se.all.find(r=>r.isDefault).toJSON(),list:Se.all.filter(r=>!r.isDefault).map(r=>r.toJSON())},e.animations=[];let i={bone_names:!0,absolute_paths:n.absolute_paths};for(let r of Blockbench.Animation.all)r.getUndoCopy&&e.animations.push(r.getUndoCopy(i,!0));e.animation_controllers=[];for(let r of Blockbench.AnimationController.all)r.getUndoCopy&&e.animation_controllers.push(r.getUndoCopy(i,!0));if(Interface.Panels.variable_placeholders.inside_vue._data.text&&(e.animation_variable_placeholders=Interface.Panels.variable_placeholders.inside_vue._data.text),!n.backup){let r={};for(let a in Project.backgrounds){let o=Project.backgrounds[a];o.image&&(r[a]=o.getSaveCopy())}Object.keys(r).length&&(e.backgrounds=r)}return t?.select(),n.raw?e:compileJSON(e)},export(){if(console.log(`Exporting Animated Java Blueprint for ${Project.name}...`),!Project)throw new Error("No project to export.");Blockbench.export({resource_id:"animated_java_blueprint.export",name:(Project.name||"unnamed")+".ajblueprint",startpath:Project.save_path,type:"json",extensions:[xn.extension],content:xn.compile(),custom_writer:(n,e)=>{fs.existsSync(PathModule.dirname(e))?(Project.save_path=e,xn.write(n,e)):(console.error(`Failed to export Animated Java Blueprint, file location '${e}' does not exist!`),Blockbench.showMessageBox({title:w("error.blueprint_export_path_doesnt_exist.title"),message:w("error.blueprint_export_path_doesnt_exist",e)}))}})},fileName(){return!Project||!Project.name?"unnamed_project.ajblueprint":`${Project.name}.ajblueprint`}}),et=new Blockbench.ModelFormat({id:"animated_java_blueprint",name:"Animated Java Blueprint",icon:"icon-armor_stand",category:"minecraft",target:"Minecraft: Java Edition",confidential:!1,condition:()=>!0,show_on_start_screen:!0,format_page:{component:{methods:{},created(){Wi({elementSelector:()=>$("#format_page_animated_java_blueprint_mount")[0],component:mg,props:{}})},template:'
      '}},onSetup(n,e){if(!Project)return;console.log("Animated Java Blueprint format setup");let t=Vf();Project.animated_java??=t;for(let[a,o]of Object.entries(t))Project.animated_java[a]===void 0&&(Project.animated_java[a]=o);let i=Project;Project.variants??=[],Project.last_used_export_namespace=Project.animated_java.export_namespace;let r=setInterval(()=>{Mc()},500);te.UNLOAD.subscribe(()=>clearInterval(r),!0),te.UNINSTALL.subscribe(()=>clearInterval(r),!0),i.materials[zn.uuid]=dg,zn.updateMaterial(),Project.loadingPromises??=[],Project.loadingPromises.push(new Promise(a=>{requestAnimationFrame(()=>{i.pluginMode=new me(i.animated_java.enable_plugin_mode),document.querySelector("#tab_bar_list .icon-armor_stand.icon")?.remove(),Wi({elementSelector:()=>{let l=[...document.querySelectorAll(`.project_tab[title="${n.name}"]`)];if(l.length)return l[0]},prepend:!0,component:Y_,props:{pluginMode:i.pluginMode}}),Se.all.length===0&&new Se("Default",!0),Se.selectDefault()}),a()}))},onActivation(){console.log("Animated Java Blueprint format activated")},codec:xn,animated_textures:!0,animation_controllers:!0,animation_files:!0,animation_mode:!0,bone_binding_expression:!0,bone_rig:!0,box_uv:!1,centered_grid:!0,display_mode:!1,edit_mode:!0,integer_size:!1,java_face_properties:!0,locators:!0,meshes:!1,model_identifier:!1,optional_box_uv:!0,paint_mode:!0,parent_model_id:!1,pose_mode:!1,render_sides:"front",rotate_cubes:!0,rotation_limit:!1,select_texture_for_particles:!1,single_texture:!1,texture_folder:!1,texture_meshes:!1,uv_rotation:!0,vertex_color_ambient_occlusion:!0});xn.format=et;function Ue(){return Format.id===et.id}s(Ue,"isCurrentFormat");function Fc(){!Project||!Format||Format===et&&xn.write(xn.compile(),Project.save_path)}s(Fc,"saveBlueprint");function zh(){Ue()&&(et.rotation_limit=!(Group.selected||AnimatedJava.API.TextDisplay.selected.length||AnimatedJava.API.VanillaItemDisplay.selected.length||AnimatedJava.API.VanillaBlockDisplay.selected.length||OutlinerElement.types.camera?.all.length),et.rotation_snap=et.rotation_limit)}s(zh,"updateRotationLock");function dL(){Ue()&&(et.rotation_limit=!1,et.rotation_snap=!1)}s(dL,"disableRotationLock");te.SELECT_PROJECT.subscribe(n=>{n.format.id===et.id&&te.SELECT_AJ_PROJECT.dispatch(n)});te.UNSELECT_PROJECT.subscribe(n=>{n.format.id===et.id&&te.UNSELECT_AJ_PROJECT.dispatch(n)});te.UPDATE_SELECTION.subscribe(zh);te.SELECT_AJ_PROJECT.subscribe(()=>{requestAnimationFrame(()=>{Mc(),zh()})});te.UNSELECT_AJ_PROJECT.subscribe(n=>{n.visualBoundingBox&&scene.remove(n.visualBoundingBox),dL()});function fL(n){return n.replace(/\\/g,"/")}s(fL,"normalizePath");function zf(n){return n.endsWith(".json")&&(n.includes("tags\\function")||n.includes("tags/function"))}s(zf,"isFunctionTagPath");function mL(n){return n.replace(/%([^%]+)%/g,function(e,t){if(!process.env[t])throw new Error("Environment variable "+t+" does not exist.");return process.env[t]})}s(mL,"resolveEnvVariables");function pL(n){return n.startsWith("./")||n.startsWith("../")}s(pL,"isRelativePath");function _L(n){if(!Project?.save_path)return;let e=PathModule.dirname(Project.save_path);return PathModule.resolve(e,n)}s(_L,"resolveRelativePath");function Li(n){if(pL(n)){let e=_L(n);if(!e)throw new Error(`Failed to resolve relative path '${n}'`);n=e}return fL(mL(n))}s(Li,"resolvePath");var gL={};vn(gL,{default:()=>Uf});var Uf=uw("AAEAAAANAIAAAwBQRkZUTTylB+MAAaIMAAAAHEdERUYAJQAAAAGh9AAAABhPUy8y/fxN0gAAAVgAAABgY21hcHhH6IYAABRAAAAKrmdhc3D//wADAAGh7AAAAAhnbHlmcJz5JAAAKDgAAU3kaGVhZL/tgK4AAADcAAAANmhoZWEHggijAAABFAAAACRobXR4GdUXAAAAAbgAABKIbG9jYfA4nFgAAB7wAAAJRm1heHAEwwCCAAABOAAAACBuYW1lrGdvGwABdhwAAAJMcG9zdEMAzNIAAXhoAAAphAABAAAAAQAA3fpnrl8PPPUACwQAAAAAAHw3nBsAAAAA4JaglgAA/4AEAAOAAAAACAACAAAAAAAAAAEAAAOA/4AAAASAAAAAAAQAAAEAAAAAAAAAAAAAAAAAAASiAAEAAASiAIAAIAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAgKSAZAABQAEAgACAAAA/8ACAAIAAAACAAAzAMwAAAAABAAAAAAAAACkAA6/QAnw+wAAoDAAAAAAWUFMLgBAACD//QOA/4AAAAOAAIAAAAH/AAAAAAKAA4AAAAAgAAEAgAAAAIAAAAFVAAACAAAAAQAAAAIAAAADAAAAAwAAAAMAAAADAAAAAQAAAAIAAAACAAAAAgAAAAMAAAABAAAAAwAAAAEAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAEAAAABAAAAAoAAAAMAAAACgAAAAwAAAAOAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAIAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAIAAAADAAAAAgAAAAMAAAADAAAAAYAAAAMAAAADAAAAAwAAAAMAAAADAAAAAoAAAAMAAAADAAAAAQAAAAMAAAACgAAAAYAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAACAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAgAAAAEAAAACAAAAA4AAAAEAAAADAAAAAwAAAAQAAAADAAAAAQAAAAMAAAACAAAABAAAAAKAAAADgAAAAwAAAAIAAAAEAAAAAwAAAAKAAAADAAAAAoAAAAKAAAABgAAAAwAAAAOAAAAAgAAAAgAAAAKAAAADgAAABAAAAAQAAAAEAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAKAAAACgAAAAgAAAAQAAAADgAAAA4AAAAMAAAADgAAAAwAAAAMAAAADAAAAA4AAAAMAAAACAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAEAAAACAAAAAwAAAAEAAAAEAAAAAwAAAAMAAAADAAAAAwAAAAMAAAAEAAAAAwAAAAMAAAACAAAABAAAAAKAAAADAAAAAwAAAAMAAAADgAAAAwAAAAMAAAADAAAAA4AAAAQAAAADAAAAAwAAAAOAAAADgAAAA4AAAAOAAAADgAAAA4AAAAOAAAAEAAAABAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAOAAAADgAAAAwAAAAMAAAAEAAAAAwAAAAMAAAAEAAAAAwAAAAKAAAADgAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAgAAAAIAAAADAAAAAoAAAAGAAAADAAAAAwAAAAMAAAADAAAAA4AAAAOAAAADAAAAAwAAAAQAAAADAAAAAwAAAAMAAAADgAAAAwAAAAMAAAADAAAAAwAAAAMAAAADgAAAAwAAAAOAAAACAAAAAgAAAAQAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAA4AAAAMAAAADAAAAAoAAAAMAAAADgAAAAwAAAAMAAAADAAAAAQAAAAEAAAABAAAAAQAAAAEAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAIAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAGAAAACgAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADgAAAAwAAAAMAAAADAAAAAwAAAAMAAAAEAAAAAwAAAAQAAAADAAAAAwAAAAIAAAADAAAABAAAAAOAAAADgAAAAwAAAAMAAAADAAAAAwAAAAOAAAADAAAABAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAQAAAADAAAAA4AAAAMAAAAEAAAABIAAAAOAAAAEAAAAAwAAAAMAAAAEAAAAAwAAAAMAAAADAAAAAwAAAAKAAAADgAAAAwAAAAMAAAADAAAAAwAAAAKAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAOAAAADgAAAA4AAAAMAAAADAAAABAAAAAMAAAADAAAAAwAAAAEAAAADAAAABAAAAAOAAAADgAAAA4AAAAMAAAADAAAAA4AAAAOAAAADgAAAAwAAAASAAAADgAAAA4AAAAMAAAADgAAAA4AAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAIAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAA4AAAAOAAAADAAAAAwAAAAMAAAADAAAAA4AAAAOAAAADAAAAAoAAAAOAAAADAAAAAwAAAAMAAAADAAAAA4AAAAMAAAADgAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAOAAAADAAAAAwAAAAMAAAADAAAAAwAAAAKAAAADAAAAAwAAAAMAAAADAAAAAYAAAAGAAAABgAAAAgAAAAGAAAACAAAAAwAAAAMAAAADAAAAAwAAAAOAAAADgAAAAwAAAAOAAAACgAAAAwAAAAMAAAADgAAAAwAAAAGAAAADgAAAAwAAAAMAAAADAAAAAwAAAAOAAAADAAAAA4AAAAMAAAADgAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAOAAAAEAAAAAwAAAAMAAAACgAAABAAAAAOAAAADAAAAAwAAAAOAAAADgAAAAwAAAAMAAAADAAAAAQAAAAIAAAADAAAAAwAAAAKAAAADAAAAAwAAAAEAAAACAAAAAwAAAAMAAAABAAAAAwAAAAMAAAADAAAAAwAAAAMAAAABAAAAAgAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAACAAAAAgAAAAIAAAABgAAAAoAAAAMAAAADAAAABAAAAAQAAAADAAAAAwAAAAQAAAAEAAAABAAAAAMAAAADAAAABAAAAAOAAAADAAAABAAAAAQAAAADgAAABAAAAAMAAAADAAAABAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAAEAAAAAwAAAAMAAAADAAAAAwAAAAQAAAADAAAAAwAAAAMAAAADAAAABAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAQAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAKAAAADAAAAA4AAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAIAAAACAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAoAAAAMAAAADAAAAAwAAAAMAAAACgAAAAoAAAAIAAAACgAAAAoAAAAKAAAADAAAAAgAAAAIAAAADAAAAAwAAAAKAAAACAAAAAoAAAAKAAAADAAAAAwAAAAMAAAACgAAAAwAAAAMAAAADAAAAAgAAAAMAAAACAAAAAwAAAAEAAAACAAAAA4AAAAMAAAADAAAAAgAAAAMAAAACgAAAAwAAAAIAAAADAAAAAQAAAAIAAAADAAAAAwAAAAIAAAACgAAAAoAAAAIAAAACgAAAAoAAAAMAAAADAAAAAwAAAAIAAAACAAAAAoAAAAMAAAADAAAAAwAAAAOAAIAEAAAAAwAAAAQAAAADAAAAAwAAAAMAAAADAAAAAQAAAAMAAAACgAAABAAAAAGAAAABAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAABAAAAAKAAAABgAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAEAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADgAAAAoAAAAKAAAADAAAAAwAAAAMAAAACgAAAAwAAAAOAAAACAAAAAgAAAAOAAAAEgAAAAYAAAAGAAAABgAAAAoAAAAKAAAACgAAAAwAAAAMAAAABgAAABAAAAAQAAAAEgAAAAYAAAAKAAAADgAAAAYAAAAKAAAADgAAAAgAAAAIAAAAEAAAAAgAAAAMAAAAEAAAABAAAAAQAAAACgAAAA4AAAAIAAAABAAAAAgAAAAIAAAAEgAAAAoAAAAEAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACAAAAAgAAAAIAAAABgAAAAYAAAAKAAAACgAAAAgAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAgAAAAIAAAACAAAAAYAAAAGAAAADAAAAAwAAAAMAAAADgAAAAwAAAAMAAAAEAAAABAAAAAQAAAADgAAAA4AAAAOAAAADAAAAAwAAAAQAAAADAAAABAAAAAQAAAADAAAAAwAAAAQAAAADAAAAAwAAAAOAAAAEAAAAAwAAAAOAAAADgAAAAwAAAAQAAAAEgAAAAwAAAAMAAAADAAAAAwAAAASAAAAEgAAABIAAAASAAAAEgAAABIAAAASAAAAEAAAABAAAAASAAAAEgAAABIAAAASAAAADgAAABIAAAAQAAAADAAAABAAAAAMAAAAEgAAABAAAAASAAAAEgAAABIAAAAOAAAAEAAAAAoAAAAMAAAADAAAAAwAAAAQAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwABgAOAAAAEAAAABAAAAAOAAAAEAAAAAgAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADgAAABAAAAAMAAAADgAAAA4AAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAACAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAGAAoAAAAMAAAADgAAAA4AAAAQAAAAEAAAAA4AAAAIAAAACAAAAAwAAAAMAAAACAAAAAwAAAAMAAAAEAAAABAAAAAEAAAAEgAAAAwABgASAAYADAAAABIABgAMAAAAEgAGAAwAAAASAAAAEgAAABIAAAASAAAAEAAEABIABgASAAQAEgAEAAwAAAAQAAAAEAAAABIABgASAAQAEgAEAAwAAAAQAAAAEAAAABIABgASAAQAEgAEAAwAAAAQAAAAEAAAABIAAAASAAAAEgAAABIAAAASAAAAEgAAABIAAAASAAAAEgAAABIAAAASAAAAEgAAAAoAAAASAAgAEAAAABIAAAASAAAADAAAAAwAAAAMAAAADAAAAA4AAAAOAAAADAAAAAwAAAAOAAAADgAAAAwAAAAMAAAADAAAABAAAAAKAAAACAAAAAgAAAASAAAAEgAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAABAAAAASAAAACAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAgAAAAMAAAAEAAAABAAAAAIAAAACAAAAAwAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAAwAAAAMAAAADgAAABIAAAASAAAAEAAAABAAAAAQAAAAEAAAAA4AAAAOAAAAEAAAAA4AAAAMAAAAEAAAAAwAAAAMAAAAEAAAABAAAAAQAAAAEAAAABAAAAAOAAAADAAAAAwAAAAMAAAAEAAAAAwAAAAOAAAADgAAAAwAAAAMAAAADAAAAA4AAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADgAAAA4AAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADgAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAEAAAADAAAAAQAAAAMAAAADAAAAAwAAAAMAAAADAAAABAAAAAOAAAADAAAAAwAAAASAAAAEgAAAAwAAAAKAAAADAAAAAwAAAAGAAAADgAAAAwAAAAMAAAADAAAABAAAAAMAAAADgAAABIAAAAMAAAABAAAAAgAAAAMAAAADAAAAAgAAAAKAAAADAAAAAwAAAAGAAAADAAAAAwAAAAMAAAAEAAAAAAAAAwAAAAMAAAAcAAEAAAAACKQAAwABAAAAHAAECIgAAAGAAQAABwCAAH4AtwC/ANgA3wDwAPgA/gEzATgBiQGSAZ8BqgGyAbkBwwHJAd0B9wIlAjYCPgJiAmgCdQJ8AoECjwKiAqwCuwLMAtkDfgOHA6EDqQPJA9sECwQYBDgETwRaBGMEdQSbBKMEsQS7BMAE2QTpBQAFVgWIBYoFjwW+BcYF6gX0B8gQxRDHEM0Q/xXhFfoWFBagFrQW+B0PHSIddx2RHp8e/yAmIDcgPSBCIFIgVyBxII4gpiCuIL8hFyEiITIhRCFLIVEhVyFfIYkhlCHEIdQh9SIFIgwiEyIeIi4iNSJIIlQiZSKHIqgivSLGIwIjGyMhI88j7yP9JQIlHCUkJSwlNCU8JWwlkyWhJbclwSXPJdgl5iYGJggmFCYgJjcmQiZnJm8mhSaXJqUmyCbPJugnAicJJw4nGCdEJ0wnZCfYKV0pyCtQK1gr6yxmLHEtJS4YLi4uOC5BLkswEjElpymnMac7p1uneaeBp6mnsPsF+x/7K/s1+zv7RPtO/wv//f//AAAAIAChALkA1wDeAPAA9wD+ATIBOAF/AY4BmgGnAbIBtwG7AckB3QH3AhwCNAI6AkECZAJqAncCfgKEApECrAK7AswC2QN+A4cDkQOjA7ED2wQCBBAEGgQ6BFQEYgRyBJIEogSuBLoEwATYBOgFAAUxBVkFigWPBb4FwwXQBfAHyBCgEMcQzRDQFeEV+hYUFqAWoha2HQAdGB13HZEenB78IBAgMCA5IEIgSCBXIHAgdCCgIKkgsCEXISIhMiFBIUshUCFTIVkhiSGQIcQhzyH1IgAiCCIRIhkiJSI0IkgiVCJgIoIioiK7IsMjACMYIyAjzyPpI/QlACUMJSQlLCU0JTwlUCWAJaAlsiW8JcYl2CXmJgAmCCYUJiAmMCY5JmAmaSaAJpAmoSbEJs8m6CcCJwknDicUJ0QnTCdjJ9gpXSnIK1ArWCvqLGUsbS0ALhguLi41LkEuSzASMSWnJqcwpzmnWqd5p4CnqKev+wD7Hfsr+zH7O/tE+0r/C//9////4//B/8D/qf+k/5T/jv+J/1b/UgAA/wMAAP7z/uz+6P7n/uL+z/62AAD+gP59/nv+ev55/nj+d/51/nT+a/5d/k3+Qf2d/ZX9jP2L/YT9cwAA/Uf9Rv1FAAD9Of0rAAD9Bfz7/PP87/zY/Mr8tPyE/IL8gfx9/E8AAPxA/Dv6aPGR8ZDxi/GJ7KjskOx36+zr6+vqAAAAAOV85WPkWeP9AADi2+La4tYAAOLK4rLisOKf4p3inOJF4jviLAAA4hbiEuIR4hDh5+Hh4bIAAOGF4XsAAOF04W8AAOFg4U7hQwAA4RsAAODsAAAAAAAA4JHf5AAA38UAAAAA3qben96Y3pHefgAA3lMAAAAAAADeKt4d3gTeA9343e3d3gAA3bzdu92rAAAAAAAA3WvdU9063TTdMAAA3P3c9tzg3G3a6dp/2PjY8dhg1+cAANdR1l/WSgAA1jrWMdRr01kAAAAAAAAAAF0QAAAAAAAAAAAAAAlsAAAJXwlXAAAFlQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAFsAAABfgAAAAAAAAAAAAAAAAAAAXoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFmAAAAAAAAAXIAAAAAAXoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABdAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWABfgAAAAAAAAAAAYoAAAAAAAABsAAAAAAAAAAAAAAAAAAAAAAAAAGyAAAAAAAAAAAAAAAAAAABqgAAAAABsAAAAAABtAAAAAAAAAHAAAAByAAAAdIB2AHcAAAAAAHeAAAB6AHsAAAAAAAAAAAAAAICAAACJgIwAjoAAAAAAAAAAAAAAAAAAAI+AAAAAAAAAkoCWAJgAAAAAAAAAAAAAAJeAAAAAAAAAAAAAAAAAAAAAAAAAAACUgAAAAAAAAJUAAAAAAAAAAACUgJYAloCXgAAAl4CYAJiAmQCbgAAAnAAAAAAAnQAAAJ6AAAAiwAAAIwAAAAAAI0AjgCPAAAAAACQAJYAlwAAAAAAmACZAK4ArwAAAAAAsACxAAAAAACyALMBTwAAAVABUQFSAAABUwFUAVUBVgGVAZYBlwAAAZgBmQGaAaEBogAAAAABowGkAAAAAAGlAaYCDgAAAAACDwLjAAAAAAAAAuQC5QAAAuYAAALnAugC6QAAAuoAAALrAuwAAALtAu4C7wAAAAAAAALwAvEC8gL9Av4AAAL/AwAAAAAAAAADAQMCAwMAAAMEAwUDBgAAAwcDCAMJAAAAAAAAAwoDGQMaAxsDHAAAAAADHQMeAAADHwMgA18AAAAAA2ADdwAAAAADeAAAA3kDgQOCAAADgwOEA44AAAOPA5ADkQAAA5IAAAAAA5MDmAOZA5oAAAObA5wDowAAA6QDpQAAAAADpgOqAAAAAAOrA6wAAAOtA64AAAOvA7ADtAO1AAAAAAO2A7cDuAPDAAADxAPFAAAAAAAAA8YAAAAAAAADxwAAAAAAAAPIAAAAAAAAA8kD6wAAAAAAAAPsAAAAAAAAA+0AAAAAAAAD7gAAAAAAAAPvA/AD8QPyA/UD9gAAAAAD9wP4A/kD+gAAAAAD+wP8A/0D/gAAAAAAAAP/AAAAAAQABAEEFgQXBBgAAAQZAAAAAAQaAAAEGwQxBDIAAAQzBDQAAAAABDUENgAAAAAAAAQ3BDgAAAAAAAAEOQQ/AAAAAAAABEAETgAABE8AAARQBHkAAAAABHoEfwSABIEEggSDBIQEhQAABIYEhwSIBIoEiwSMBI0EjgSPBJAEkQSSBJMAAASUBJUAAASWBJgAAAAAAAAEmQScBJ0EngAABJ8EoQAGAgoAAAAAAQAAAQAAAAAAAAAAAAAAAAAAAAEAAgAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgAGQAaABsAHAAdAB4AHwAgACEAIgAjACQAJQAmACcAKAApACoAKwAsAC0ALgAvADAAMQAyADMANAA1ADYANwA4ADkAOgA7ADwAPQA+AD8AQABBAEIAQwBEAEUARgBHAEgASQBKAEsATABNAE4ATwBQAFEAUgBTAFQAVQBWAFcAWABZAFoAWwBcAF0AXgBfAGAAYQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMHAHEAYwBkAGgDCQB3AIMAbwBqA10AdQBpA5gAAACBA40AcgObA5wAZgB2A30DhQAAAUQDkgBrAHoBNAAAAIYAfwBiAG0DiQCVA5YAAABsAHsDCgAAAAAAAAAAAAAAAAL/AwADBAMFAwEDAgCFAAAAAAAAAAADSQMTAxQEkQSSAwgAeAMDAwYDCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAEaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASACYAVACCALIA8AD8AR4BPgFgAXgBhAGSAZ4BwAHwAggCOAJqAowCsALcAvoDLgNaA2wDfgOqA74D6AQQBDoEWAR8BKIEvATUBOgFDAUkBToFVAV8BYwFrgXQBfAGDAY4BlgGggaUBq4G1Ab2BzAHVAd8B44HsAfEB+gH9AgGCCgISghwCJIIsgjQCPIJEAkiCUIJaAl6CZwJsgnSCfYKGgo4ClwKeAqOCrIKzgsICygLSgtsC3gLmgu6C8wL+gwkDFwMkgykDNoM7A0wDVANkg2iDbAOAg4QDjAOUA54DqgOug7SDu4O7g8EDywPbA+qD+oQNBBeEJgQwBDeEQoRQBFaEYIRoBHAEeYSDBIgEkwSbhKUEroS3BL0Ex4TUBNqE5gTtBPoE/4UIhROFHIUmBS8FNwVBBUsFVQVhhWuFdAV+BYgFiwWQBZiFnQWoBbCFu4XIBdQF2YXlhfAF+QYABgmGEwYcBikGM4Y6BkKGSwZThl8GaQZyhnsGhIaNhpeGoQarhrUGvobIBtKG2wbjhuwG9gb/hwqHFIceByYHLoc5B0IHS4dWh2GHaQdzh3wHhQePh5eHoQesB7MHuIfCh8wH0Ifah+MH7Af2B/0IBAgMiBUIIIgriDMIOohDCEqIUQhXiF+IZ4hxCHeIgYiICI8Il4iiiKqItAi7CMMIzAjZCOMI74j4CQEJCYkTCR0JJYkwiTuJQYlLiVWJWYljiW6JeYmFCYgJiwmOCZKJlYmdCaYJqgmzibmJw4nJidOJ2QnjCe0J9Yn+CgUKDQoRihiKIgomii+KOopJClIKXQpoinQKgQqOipeKpAqpirKKtwrAisuK0YrbCueK74r1Cv0LCAsPixYLHgsoizcLQAtNC1aLYQtsC3aLfAuCi4yLlgugC6eLrwu4C7wLxIvKi9wL6IvxC/sMAQwJjA+MF4wcDCMMLIwxDDkMRQxTjFmMYAxmDG0MdQx+DIUMkAyajKKMqwy0jL0MwQzJjNGM3gzqjPMM/I0CjQsNEQ0ZDR2NJo0wDTSNPI1GDVSNWo1hDWcNbg11jX4NhQ2PjZoNog2sjbWNug3CDcuN1Q3eDecN8A34jgMODY4TjhmOLI46DkUOT45Wjl2OZo5vjnqOhY6MDpOOmQ6jjqwOtQ69jsSOzg7WDt8O5o7uDveO/Q8EDw8PGA8ejyKPKw84Dz6PRo9UD1sPYo9pj3YPfQ+Hj44PmY+hD6yPtA+6j8EPzY/UD+CP5Q/wD/kQARAMkBEQFZAaEB8QI5ApkC2QNhA+kEcQURBXkGCQahBwEHiQhBCMkJQQmBCiEK+Qt5C/EMuQ0hDckOMQ6ZDwEPoRAZEKERMRHREkkSoRMRE5ET6RRxFLEVSRXxFnEXORe5GEkYkRlBGXkZwRoZGsEbIRuxG/kcURyBHMkdIR2hHdEeER55HvEfSR/pIBkgcSDxIYkh6SJpIvkjmSQhJHEk+SVhJbEmASZRJpknGSehKDEouSkRKbkqASppKwkriSvJLEEs6S2BLfEuuS8xL6EwKTCRMQkxqTJJMrkzITOJNCE0iTUZNak2MTbZN0k4MTixORE5mToZOpE7UTwBPKE9KT3JPnE/WT/xQLlBcUIhQrlDWUSBRSlFyUaRR1FH+UjhSWFKKUrpS/FMgU1ZTfFOyU9xUDFQwVHJUrlTOVPhVMFV2VaxV1FYKVkJWelamVsxW+FciVzpXVleAV7hX2FfyWBZYRlhwWJJYuljiWRBZLllQWW5Zllm6WeJaFlo2WlZailq2WuRbBlsiWz5bYFucW+ZcClwoXE5chlyeXMJc2lz+XQpdIl1gXYpdrl3GXeZeDl4wXlxeel6GXpheul7cXvRfFl9CX2JfiF+0X9ZgAGAkYDZgTmBuYKJg7GEYYWJhjGHEYe5iEmJWYoxisGK8YvJjFmNEY1JjZGN8Y55j2GQEZCZkRmSEZJpkxGTwZQ5lMmVQZXZlkGWoZbpl1GX8Zh5mPmZaZnxmjmaoZsxm7mcQZzJnXmeEZ6Zn0GgGaDBoVGiGaLZoxGjSaOBo7mkAaRJpJGlEaWRphGmcab5pzGnkahpqWGpqaohqsmrEauJrDGsua05ruGvYbABsXmyUbMps5m0AbSJtNG1ybZZtzG3sbf5uHG46bl5uem6qbtBu5G7ybwZvHm80b0pvam+Ab6hv2G/2cBRwOHBUcIRwqnC+cMxw4HD4cQ5xNnFkcZRxsnHgcgByMHJocpBywHL4cyRzRnOEc6xz2HQMdDp0anSQdM505nUQdT51hHWodc51/nYudnh2ona4dtx3AHc+d3x3ungAeEx4kHjceSx5anm0efp6THqceuZ7Entoe4R7oHu6e9R7/HwifFB8cnyifMZ89n0cfU59Zn2OfeR+DH5Efm5+qH7Oftx++n8IfyZ/Vn9+f65/5H/4gB6ARIBegHiAsIDKgOKBHIE8gV6BeIGigcqB8oIWgjqCcoKogsiC6IL6gwyDIIM2g2CDioOyg8yD7oREhHSEzoT2hSqFRIVehXyFnoXAheaGDIYshkKGVoZshoCGlIaihriG8ocyhz6HTIdah2yHfIeOh6CHtIfIh9yH8IgKiB6INIhKiGCIfIiSiKiIwojYiO6JCokgiTaJUolsiYiJqonEieCKBIoeijaKVopyioqKrIrQivSLJIsyi0CLTotci2qLzoySjOqM+I0OjSaNTI1kjYqNoo3Gjd6OBI4ijlaOdo68jtKO5o8Cj16Pko/GkA6QWJB6kLyQ7JE0kWaRgJGikcSR7pIOkjaSXpKOkrSS2pMQkziTWJN4k5iTzpQElCCUVJRylJCUvpTQlOiVCJUqlUKVXpWKlZ6VuJXYlf6WKpZcloqWpJbol1CXhpeyl96YEJhSmISYwpjymSqZdpmamcKaKJpWmnqanJqwmsaa6JsQm0ibdJugm8ab8pwUnDCcXpx4nJqcvJzmnPydHp0+nWKdeJ2Wnbqd4J4AniKePJ5annyekp68nuCfDp8mnzyfVJ90n46frJ/Sn/SgGqA6oG6gjqCmoMag4KD+oSihUKF6oYyhpKGwodyh9KISojCiVqKEorKixqLqoxyjSqN0o5ajwqPSo+SkHKREpHCkmqTIpOilDqVApWSldqWQpbal1KXopgimLKZKplymeqagprim8gAAAAIAAAAAAIADgAADAAcAABEzESMVMxUjgICAgAOA/YCAgAAAAAIAAAKAAYADgAADAAcAABEzESMBMxEjgIABAICAA4D/AAEA/wAAAAACAAAAAAKAA4AAGwAfAAATMxEzETMRMxUjFTMVIxEjESMRIxEjNTM1IzUzFxUzNYCAgICAgICAgICAgICAgICAA4D/AAEA/wCAgID/AAEA/wABAICAgICAgAAAAAUAAAAAAoADgAAHAAsADwATABsAAAEzFSEVITUzBTMVIzMhFSkBMxUjKQEVIxUjNSEBAIABAP4AgP8AgICAAYD+gAGAgID+AAIAgID/AAOAgICAgICAgICAgAAABwAAAAACgAOAAAMABwALAA8AEwAXABsAABEzESMBMxUrATMRKwEzFSsBMxEjJTMRIyUzFSOAgAIAgICAgICAgICAgIABgICA/gCAgAOA/wABAID/AID/AID/AICAAAAACAAAAAACgAOAAAMABwALABcAGwAfACMAJwAAATMVKwEzFSMlMxUrATMRMxEjNSM1IzUzITMVIyEzESMzIRUhJTMVIwEAgICAgIABAICAgICAgICAgAEAgID+AICAgAEA/wABgICAA4CAgICA/wD/AICAgID/AICAgAAAAAEAAAKAAIADgAADAAARMxEjgIADgP8AAAUAAAAAAYADgAADAAcACwAPABMAAAEzFSsBMxUrATMRIzsBFSM7ARUjAQCAgICAgICAgICAgICAgAOAgID+gICAAAAABQAAAAABgAOAAAMABwALAA8AEwAAETMVIzsBFSM7ARErATMVKwEzFSOAgICAgICAgICAgICAgAOAgID+gICAAAUAAAIAAYADgAADAAcACwAPABMAABEzFSMlMxUrATMVKwEzFSMlMxUjgIABAICAgICAgICAAQCAgAOAgICAgICAgAAAAQAAAIACgAMAAAsAAAEzESEVIREjESE1IQEAgAEA/wCA/wABAAMA/wCA/wABAIAAAQAA/4AAgACAAAMAADUzESOAgID/AAAAAQAAAYACgAIAAAMAABEhFSECgP2AAgCAAAAAAAEAAAAAAIAAgAADAAA1MxUjgICAgAAAAAUAAAAAAoADgAADAAcACwAPABMAAAEzFSsBMxErATMVKwEzESsBMxUjAgCAgICAgICAgICAgICAgAOAgP8AgP8AgAAABQAAAAACgAOAAAMACwATABcAGwAAEyEVISMzETMVIxUjATMRIxEjNTMFMxUjAyEVIYABgP6AgICAgIACAICAgID/AICAgAGA/oADgID+gICAAoD9gAGAgICA/wCAAAAAAQAAAAACgAOAAAsAAAEzESEVITUhESM1MwEAgAEA/YABAICAA4D9AICAAgCAAAAABgAAAAACgAOAAAMABwALAA8AEwAbAAATIRUhIzMVIyUzESMpARUhIzMVKwEzFSE1MxEhgAGA/oCAgIACAICA/wABAP8AgICAgIABgID9gAOAgICA/wCAgICA/wAAAAAABwAAAAACgAOAAAMABwALAA8AEwAXABsAABMhFSEjMxUjJTMRIykBFSkBMxEjJTMVIzMhFSGAAYD+gICAgAIAgID/AAEA/wABAICA/gCAgIABgP6AA4CAgID/AID/AICAgAAAAAMAAAAAAoADgAALAA8AEwAAASERIxEhETMVIRErATMVKwEzFSMBgAEAgP4AgAGAgICAgICAgAOA/IABAAEAgAGAgIAABAAAAAACgAOAAAcACwAPABMAABEhFSEVIRUpATMRIyUzFSMzIRUhAoD+AAGA/gACAICA/gCAgIABgP6AA4CAgID+gICAgAAABQAAAAACgAOAAAMABwAPABMAFwAAASEVISMzFSsBMxUhFSERIwEzESMpARUhAQABAP8AgICAgIABgP6AgAIAgID+gAGA/oADgICAgID/AAEA/wCAAAAAAAMAAAAAAoADgAAHAAsADwAAESERIxEhFSMFMxUrATMRIwKAgP6AgAGAgICAgIADgP6AAQCAgID+gAAAAAcAAAAAAoADgAADAAcACwAPABMAFwAbAAATIRUhIzMRIwEzESMpARUhIzMRIwEzESMpARUhgAGA/oCAgIACAICA/oABgP6AgICAAgCAgP6AAYD+gAOAgP8AAQD/AID/AAEA/wCAAAAABQAAAAACgAOAAAMABwAPABMAFwAAEyEVISMzESMBMxEjNSE1IQMzFSMpARUhgAGA/oCAgIACAICA/oABgICAgP8AAQD/AAOAgP8AAQD+AICA/wCAgAAAAAIAAAAAAIACgAADAAcAABEzFSMRMxUjgICAgAKAgP6AgAAAAAIAAP+AAIACgAADAAcAABEzFSMRMxEjgICAgAKAgP6A/wAAAAcAAAAAAgADgAADAAcACwAPABMAFwAbAAABMxUrATMVKwEzFSsBMxUjOwEVIzsBFSM7ARUjAYCAgICAgICAgICAgICAgICAgICAgAOAgICAgICAgAAAAAACAAAAgAKAAoAAAwAHAAARIRUhESEVIQKA/YACgP2AAoCA/wCAAAAABwAAAAACAAOAAAMABwALAA8AEwAXABsAABEzFSM7ARUjOwEVIzsBFSsBMxUrATMVKwEzFSOAgICAgICAgICAgICAgICAgICAgAOAgICAgICAgAAABgAAAAACgAOAAAMABwALAA8AEwAXAAATIRUhIzMVIyUzESsBMxUrATMVIxUzFSOAAYD+gICAgAIAgICAgICAgICAgAOAgICA/wCAgICAAAAEAAD/gAMAAwAAAwAHABEAFQAAEyEVISMzESMBMxEhESEVIxUhASEVIYACAP4AgICAAoCA/gABAIABAP4AAgD+AAMAgP2AAoD+AAGAgID/AIAAAAACAAAAAAKAA4AAAwAPAAATIRUhIzMVITUzESMRIREjgAGA/oCAgAGAgID+gIADgICAgP0AAgD+AAAAAAADAAAAAAKAA4AACwAPABMAABEhFSEVIRUhESEVIQEzFSMVMxEjAgD+gAGA/oABgP4AAgCAgICAA4CAgID+gIADAICA/oAAAAAFAAAAAAKAA4AAAwAHAAsADwATAAATIRUhIzMRIwEzFSMRMxUjKQEVIYABgP6AgICAAgCAgICA/oABgP6AA4CA/YACgID+gICAAAAAAgAAAAACgAOAAAcACwAAESEVIREhFSEBMxEjAgD+gAGA/gACAICAA4CA/YCAAwD9gAAAAAEAAAAAAoADgAALAAARIRUhFSEVIREhFSECgP4AAQD/AAIA/YADgICAgP6AgAAAAAEAAAAAAoADgAAJAAARIRUhFSEVIREjAoD+AAEA/wCAA4CAgID+AAAEAAAAAAKAA4AAAwAHAA0AEQAAEyEVISMzESMBIREjESMBIRUhgAIA/gCAgIABgAEAgID/AAGA/oADgID9gAIA/gABgP6AgAABAAAAAAKAA4AACwAAETMRIREzESMRIREjgAGAgID+gIADgP8AAQD8gAIA/gAAAAABAAAAAAGAA4AACwAAESEVIxEzFSE1MxEjAYCAgP6AgIADgID9gICAAoAAAAMAAAAAAoADgAADAAcACwAAATMRIyUzFSMzIRUhAgCAgP4AgICAAYD+gAOA/QCAgIAAAAAFAAAAAAKAA4AABwALAA8AEwAXAAARMxEhFSERIwEzFSsBMxUjFTMVIzsBESOAAQD/AIACAICAgICAgICAgIADgP8AgP4AA4CAgICA/oAAAAEAAAAAAoADgAAFAAARMxEhFSGAAgD9gAOA/QCAAAAAAwAAAAACgAOAAAcADwATAAARMxUzFSMRIwEzESMRIzUzBTMVI4CAgIACAICAgID/AICAA4CAgP2AA4D8gAKAgICAAAADAAAAAAKAA4AABwAPABMAABEzFTMVIxEjATMRIxEjNTMlMxUjgICAgAIAgICAgP8AgIADgICA/YADgPyAAYCAgIAAAAQAAAAAAoADgAADAAcACwAPAAATIRUhIzMRIwEzESMpARUhgAGA/oCAgIACAICA/oABgP6AA4CA/YACgP2AgAACAAAAAAKAA4AACQANAAARIRUhFSEVIREjATMVIwIA/oABgP6AgAIAgIADgICAgP4AAwCAAAAAAAYAAAAAAoADgAADAAcACwAPABMAFwAAEyEVISMzESMBMxErATMVIykBFSElMxUjgAGA/oCAgIACAICAgICA/wABAP8AAYCAgAOAgP2AAoD+AICAgIAAAAADAAAAAAKAA4AACQANABEAABEhFSEVIRUhESMBMxUjFTMRIwIA/oABgP6AgAIAgICAgAOAgICA/gADAICA/gAABgAAAAACgAOAAAMABwALAA8AEwAXAAATIRUhIzMVIzMhFSkBMxEjJTMVIzMhFSGAAgD+AICAgIABgP6AAYCAgP4AgICAAYD+gAOAgICA/oCAgIAAAQAAAAACgAOAAAcAABEhFSERIxEhAoD/AID/AAOAgP0AAwAAAwAAAAACgAOAAAMABwALAAARMxEjATMRIykBFSGAgAIAgID+gAGA/oADgP0AAwD9AIAAAAUAAAAAAoADgAADAAcACwAPABMAABEzESMBMxEjITMRIwEzESsBMxUjgIACAICA/oCAgAEAgICAgIADgP4AAgD+AP8AAQD/AIAAAAADAAAAAAKAA4AABwAPABMAABEzETMVIxUjATMRIzUjNTMlMxUjgICAgAIAgICAgP8AgIADgP2AgIADgPyAgICAgAAAAAkAAAAAAoADgAADAAcACwAPABMAFwAbAB8AIwAAETMVIyUzFSMhMxUjJTMVKwEzFSsBMxUjJTMVIyEzESMBMxEjgIACAICA/oCAgAEAgICAgICAgIABAICA/oCAgAIAgIADgICAgICAgICAgID+gAGA/oAABQAAAAACgAOAAAMABwALAA8AEwAAETMVIyUzFSMhMxUjJTMVKwEzESOAgAIAgID+gICAAQCAgICAgAOAgICAgICA/YAAAAAABQAAAAACgAOAAAUACQANABEAFwAAESERIzUhBTMVKwEzFSsBMxUrATMVIRUhAoCA/gABgICAgICAgICAgIACAP2AA4D/AICAgICAgIAAAAABAAAAAAGAA4AABwAAESEVIREhFSEBgP8AAQD+gAOAgP2AgAAFAAAAAAKAA4AAAwAHAAsADwATAAARMxUjOwERIzsBFSM7AREjOwEVI4CAgICAgICAgICAgICAA4CA/wCA/wCAAAAAAAEAAAAAAYADgAAHAAARIREhNSERIQGA/oABAP8AA4D8gIACgAAAAAAFAAACAAKAA4AAAwAHAAsADwATAAABMxUrATMVIyUzFSMhMxUjJTMVIwEAgICAgIABAICA/oCAgAIAgIADgICAgICAgIAAAAABAAD/gAKAAAAAAwAAMSEVIQKA/YCAAAACAAACgAEAA4AAAwAHAAARMxUjOwEVI4CAgICAA4CAgAAAAAADAAAAAAKAAoAAAwANABEAABMhFSkBMxEhNSE1ITUhBTMVI4ABgP6AAYCA/gABgP6AAYD+AICAAoCA/gCAgICAgAAAAAMAAAAAAoADgAAJAA0AEQAAETMRMxUjESEVIQEhFSkBMxEjgICAAYD+AAEAAQD/AAEAgIADgP6AgP8AgAKAgP6AAAAABQAAAAACgAKAAAMABwALAA8AEwAAEyEVISMzESMBMxUjFTMVIykBFSGAAYD+gICAgAIAgICAgP6AAYD+gAKAgP6AAYCAgICAAAAAAAMAAAAAAoADgAAJAA0AEQAAATMRITUhESM1MyUhFSEjMxEjAgCA/gABgICA/oABAP8AgICAA4D8gIABAICAgP6AAAAAAwAAAAACgAKAAAMADQARAAATIRUhIzMVITUzESEVIzMhFSGAAYD+gICAAYCA/gCAgAIA/gACgICAgP8AgIAAAAIAAAAAAgADgAADAA8AAAEhFSEjMxUhFSERIxEjNTMBAAEA/wCAgAEA/wCAgIADgICAgP4AAgCAAAAAAAMAAP+AAoACgAAJAA0AEQAAEyERIzUhNSERISMzESMRIRUhgAIAgP6AAYD+gICAgAIA/gACgP2AgIABAP8A/wCAAAAAAwAAAAACgAOAAAcACwAPAAARMxEzFSMRIwEhFSkBMxEjgICAgAEAAQD/AAEAgIADgP6AgP6AAoCA/gAAAgAAAAAAgAOAAAMABwAAETMVIxUzESOAgICAA4CAgP2AAAAABAAA/4ACgAOAAAMABwALAA8AAAEzFSMVMxEjATMRIzMhFSECAICAgID+AICAgAGA/oADgICA/YABAP8AgAAAAAUAAAAAAgADgAAHAAsADwATABcAABEzETMVIxEjATMVKwEzFSMVMxUjOwEVI4CAgIABgICAgICAgICAgIADgP4AgP8AAoCAgICAgAACAAAAAAEAA4AAAwAHAAARMxEjOwEVI4CAgICAA4D9AIAAAAAEAAAAAAKAAoAABQAJAA0AEQAAESEVIxEjATMVKwEzESMBMxEjAQCAgAGAgICAgIABAICAAoCA/gACgID/AAEA/gAAAAIAAAAAAoACgAAFAAkAABEhFSERIwEzESMCAP6AgAIAgIACgID+AAIA/gAABAAAAAACgAKAAAMABwALAA8AABMhFSEjMxEjATMRIykBFSGAAYD+gICAgAIAgID+gAGA/oACgID+gAGA/oCAAAMAAP+AAoACgAALAA8AEwAAETMVMxUjFSEVIREjASEVKQEzESOAgIABgP6AgAEAAQD/AAEAgIACgICAgID/AAMAgP8AAAAAAAMAAP+AAoACgAADAA8AEwAAEyEVISUzESMRITUhNSM1MyEzESOAAQD/AAGAgID+gAGAgID+AICAAoCAgP0AAQCAgID/AAAAAAMAAAAAAoACgAAHAAsADwAAETMVMxUjESMBIRUpATMVI4CAgIABAAEA/wABAICAAoCAgP6AAoCAgAAAAAUAAAAAAoACgAADAAcACwAPABMAABMhFSEjMxUjMyEVKQEzFSMpARUhgAIA/gCAgICAAYD+gAGAgID+AAIA/gACgICAgICAAAIAAAAAAYADgAALAA8AABMzETMVIxEjESM1MxMzFSOAgICAgICAgICAA4D/AID+gAGAgP4AgAAAAgAAAAACgAKAAAMACQAAETMRIwEzESE1IYCAAgCA/gABgAKA/gACAP2AgAAFAAAAAAKAAoAAAwAHAAsADwATAAARMxEjATMRIyEzFSMlMxUrATMVI4CAAgCAgP6AgIABAICAgICAAoD+gAGA/oCAgICAAAACAAAAAAKAAoAAAwANAAARMxEjATMRITUzETMRM4CAAgCA/gCAgIACgP4AAgD9gIABAP8AAAAAAAkAAAAAAoACgAADAAcACwAPABMAFwAbAB8AIwAAETMVIyUzFSMhMxUjJTMVKwEzFSsBMxUjJTMVIyEzFSMlMxUjgIACAICA/oCAgAEAgICAgICAgIABAICA/oCAgAIAgIACgICAgICAgICAgICAgIAAAAAAAwAA/4ACgAKAAAMACwAPAAARMxEjATMRIzUhNSEBIRUhgIACAICA/oABgP4AAgD+AAKA/oABgP2AgID/AIAAAAMAAAAAAoACgAAHAAsAEwAAESEVIxUjNSEFMxUrATMVIRUhNTMCgICA/oABAICAgIABgP2AgAKAgICAgICAgIAAAAAABQAAAAABgAOAAAMABwALAA8AEwAAATMVKwEzESsBMxUjOwERIzsBFSMBAICAgICAgICAgICAgICAA4CA/wCA/wCAAAABAAAAAACAA4AAAwAAETMRI4CAA4D8gAAFAAAAAAGAA4AAAwAHAAsADwATAAARMxUjOwERIzsBFSsBMxErATMVI4CAgICAgICAgICAgICAA4CA/wCA/wCAAAAAAAQAAAKAAwADgAADAAcACwAPAAATIRUhJTMVIyEzFSMlIRUhgAEA/wACAICA/YCAgAGAAQD/AAOAgICAgICAAAACAAD/gACAAwAAAwAHAAARMxUjFTMRI4CAgIADAICA/YAAAAAFAAD/gAKAAwAABwALAA8AEwAbAAABMxUzFSE1MwUzESMBMxUjFTMVIykBFSMVIzUjAQCAgP6AgP8AgIACAICAgID+gAGAgICAAwCAgICA/oABgICAgICAgAAAAAMAAAAAAoADgAADABMAFwAAASEVISMzESEVIREhFSE1MxEjNTMBMxUjAQABAP8AgIABAP8AAYD9gICAgAGAgIADgID/AID/AICAAQCAAQCAAAAAAAgAAAAAA4ACgAADAAcACwAPABMAFwAbAB8AABEzFSMlIRUhJTMVIyEzESMBMxEjITMVIyUhFSElMxUjgIABAAGA/oACAICA/YCAgAIAgID9gICAAQABgP6AAgCAgAKAgICAgID+gAGA/oCAgICAgAAFAAAAAAKAA4AAAwAHAAsADwAjAAARMxUjJTMVIyEzFSMlMxUrATMVIRUhFSEVIRUjNSE1ITUhNSGAgAIAgID+gICAAQCAgICAAQD/AAEA/wCA/wABAP8AAQADgICAgICAgICAgICAgICAgAACAAAAAACAA4AAAwAHAAARMxEjFTMRI4CAgIADgP6AgP6AAAAIAAAAAAKAA4AAAwAHAAsADwATABcAGwAfAAATIRUhIzMVIzMhFSEjMxUjJTMVIykBFSkBMxUjKQEVIYACAP4AgICAgAGA/oCAgIACAICA/oABgP6AAYCAgP4AAgD+AAOAgICAgICAgICAAAACAAADAAGAA4AAAwAHAAARMxUjJTMVI4CAAQCAgAOAgICAAAAJAAAAAAOAA4AAAwAHAAsADwAXABsAHwAjACcAAAEhFSEjMxUjJTMVIyEzESMBIRUhFSEVIQEzESMhMxUjJTMVIykBFSEBAAGA/oCAgIACAICA/YCAgAEAAYD/AAEA/oACAICA/YCAgAIAgID+gAGA/oADgICAgID+gAGAgICAAYD+gICAgIAAAwAAAIACAAOAAAMACwAPAAATIRUpATMRITUjNSEBIRUhgAEA/wABAID+gIABgP6AAgD+AAOAgP6AgID+gIAAAAoAAACAAwADAAADAAcACwAPABMAFwAbAB8AIwAnAAABMxUjJTMVIyEzFSMlMxUjITMVIyUzFSMhMxUjJTMVIyEzFSMlMxUjAQCAgAGAgID+AICAAYCAgP4AgIABgICA/wCAgAGAgID/AICAAYCAgAMAgICAgICAgICAgICAgICAAAAAAAEAAACAAoACAAAFAAARIREjESECgID+AAIA/oABAAAAAQAAAQABgAGAAAMAABEhFSEBgP6AAYCAAAAAAAsAAAAAA4ADgAAHAAsADwATABsAHwAjACcAKwAvADMAAAEhFSMVIzUrATMVIyUzFSMhMxEjATMVMxUjFSMBMxUjJTMRIyUzFSMhMxUjJTMVIykBFSEBAAGAgICAgICAAgCAgP2AgIABAICAgIABAICAAQCAgP8AgID+gICAAgCAgP6AAYD+gAOAgICAgICA/oABgICAgAGAgID+gICAgICAgAAAAQAAAwACgAOAAAMAABEhFSECgP2AA4CAAAAAAAQAAAGAAgADgAADAAcACwAPAAATIRUhIzMRIwEzESMpARUhgAEA/wCAgIABgICA/wABAP8AA4CA/wABAP8AgAACAAAAAAKAA4AACwAPAAABMxEhFSERIxEhNSEBIRUhAQCAAQD/AID/AAEA/wACgP2AA4D/AID/AAEAgP4AgAAABQAAAQACAAOAAAMABwALAA8AFwAAEyEVISMzFSMlMxUrATMVKwEzFSEVITUzgAEA/wCAgIABgICAgICAgIABAP4AgAOAgICAgICAgIAAAAAHAAABAAIAA4AAAwAHAAsADwATABcAGwAAEyEVISMzFSMlMxUrATMVIyEzFSMlMxUjKQEVIYABAP8AgICAAYCAgICAgP8AgIABgICA/wABAP8AA4CAgICAgICAgIAAAAACAAACgAEAA4AAAwAHAAATMxUrATMVI4CAgICAgAOAgIAAAAACAAD/gAKAAoAABwALAAARMxEhFSEVIwEzESOAAYD+gIACAICAAoD+AICAAwD+AAABAAAAAAMAA4AADwAAEyEVIxEjESMRIxEjNSM1M4ACgICAgICAgIADgID9AAMA/QACAICAAAAAAAEAAAEAAYADgAALAAATMxEzFSE1MxEjNTOAgID+gICAgAOA/gCAgAEAgAAABQAAAIACAAOAAAMABwALAA8AEwAAEyEVISMzESMBMxEjKQEVIQchFSGAAQD/AICAgAGAgID/AAEA/wCAAgD+AAOAgP8AAQD/AICAgAAAAAAKAAAAgAMAAwAAAwAHAAsADwATABcAGwAfACMAJwAAETMVIyUzFSMhMxUjJTMVIyEzFSMlMxUjITMVIyUzFSMhMxUjJTMVI4CAAYCAgP8AgIABgICA/wCAgAGAgID+AICAAYCAgP4AgIABgICAAwCAgICAgICAgICAgICAgIAAAAcAAAAAA4ADgAAHAAsADwATAB8AIwAnAAATMxEjESM1MyUzFSsBMxErATMVIyUhESM1IREzFTM1IyEzESsBMxUjgICAgIACAICAgICAgICAAQABAID/AICAgP6AgICAgIADgP4AAQCAgID/AICA/gCAAQCAgP8AgAAAAAAIAAAAAAOAA4AABwALAA8AEwAZAB0AIwAnAAATMxEjESM1MyUzFSsBMxErATMVIyUhESM1IyEzESMlMxUzFSElMxUjgICAgIACAICAgICAgICAAQABAICA/oCAgAGAgID/AP4AgIADgP4AAQCAgID/AICA/wCA/wCAgICAgAAAAAkAAAAAA4ADgAAHAAsADwATABcAGwAnACsALwAAESEVIxUjNSMlMxUrATMRIyUzFSMpARUhJTMVIyUhESM1IREzFTM1IyEzESsBMxUjAYCAgIACgICAgICA/wCAgP8AAQD/AAGAgIABAAEAgP8AgICA/oCAgICAgAOAgICAgID/AICAgICAgP4AgAEAgID/AIAAAAAGAAD/gAKAAwAAAwAHAAsADwATABcAAAEzFSMVMxUrATMVKwEzESMlMxUjKQEVIQEAgICAgICAgICAgAIAgID+gAGA/oADAICAgID/AICAgAAAAAAJAAAAgAKAAwAAAwAHAAsADwATABcAGwAfACMAABEzFSMlMxUjITMVIyUzFSsBMxUrATMVIyUzFSMhMxUjJTMVI4CAAgCAgP6AgIABAICAgICAgICAAQCAgP6AgIACAICAAwCAgICAgICAgICAgICAAAAAAAMAAAAAAoADgAAJABMAFwAAEyEVMxEjESMRISMzETMRIRUhNSMBMxUjgAGAgICA/wCAgIABAP6AgAEAgIADgID9gAGAAQD+gP8AgIABgIAAAgAAAAACgAOAAAsADwAAETMRIRUhFSEVIREjATMVI4ABgP6AAYD+gIACAICAA4D/AICAgP8AAgCAAAAABgAA/4ACgAOAAAMABwALAA8AEwAXAAATIRUhIzMRIwEzFSMpARUpATMRIykBFSGAAYD+gICAgAIAgID/AAEA/wABAICA/wABAP8AA4CA/IADgICA/oCAAAcAAAAAAoADgAADAAcACwAPABcAGwAfAAATIRUhJTMVKwEzFSsBMxUjJTMRIzUhNSEFMxUjMyEVIYABAP8AAYCAgICAgICAgAEAgID+gAGA/gCAgIABgP6AA4CAgICAgID+AICAgICAAAAAAAMAAACAAoADAAADAAcACwAAATMVIwUhFSEFMxUjAQCAgP8AAoD9gAEAgIADAICAgICAAAADAAAAAAKAAoAACQATABcAABMhFTMRIxEjNSEjMxEzFSEVITUjATMVI4ABgICAgP8AgICAAQD+gIABAICAAoCA/oABAID/AICAgAEAgAAAAAIAAP+AAoADgAALAA8AABEzESEVIREhFSERIwEzESOAAYD+gAGA/oCAAgCAgAOA/wCA/wCA/wACgP8AAAQAAAAAAoADgAADAAcACwAPAAARMxEjATMRIyUzFSMzIRUhgIACAICA/gCAgIABgP6AA4D+AAIA/QCAgIAAAAAFAAD/gAIAA4AAAwAHAAsADwATAAARMxUjJTMVIwUzESMBMxEjKQEVIYCAAYCAgP6AgIABgICA/oABgP6AA4CAgICA/gACAP2AgAAABQAAAAACAAKAAAcACwAPABMAFwAAETMRMxUjESMBMxUrATMVIxUzFSM7ARUjgICAgAGAgICAgICAgICAgAKA/wCA/wACgICAgICAAAIAAAAAAYADgAADAAcAABMhFSEjMxEjgAEA/wCAgIADgID9AAAAAAAEAAAAAAOAA4AADQARABUAGQAAEyEVIRUhFSERIRUhESsBMxUjJTMVIxUzESOAAoD+gAGA/oABgP4AgICAgAMAgICAgAOAgICA/oCAAwCAgICA/oAAAAAAAgAAAAADAAOAAA0AEQAAEzMRIRUhESEVIREjNTMBMxEjgIABgP6AAYD+AICAAgCAgAOA/oCA/wCAAoCA/oD/AAAAAAADAAAAAAMAA4AADQARABUAABMzETMVIxEhFSERIzUzBSEVKQEzESOAgICAAYD+AICAAQABAP8AAQCAgAOA/oCA/wCAAoCAgID+gAAABQAAAAACgAOAAAMABwALAA8AEwAAEyEVISMzFSMlMxEjJTMVIzMhFSGAAYD+gICAgAIAgID+AICAgAGA/oADgICAgP2AgICAAAAAAAIAAAAAAwADgAAPABMAABMhFSEVMxUjESEVIREjNTMlMxEjgAIA/oCAgAGA/gCAgAIAgIADgICAgP6AgAIAgID9gAAAAQAAAAACgAOAAAsAABEhESE1ITUhNSERIQKA/YACAP8AAQD+AAOA/ICAgIABgAAABAAAAAACgAOAAAMABwARABUAABMhFSEjMxUjJTMRIxEhESMRIQEhFSGAAYD+gICAgAIAgID+gIACAP6AAYD+gAOAgICA/YABAP8AAYD+gIAAAAAABwAAAAACgAOAAAMABwALAA8AEwAXABsAABMhFSEjMxEjATMVIwUhFSEjMxEjJTMVIykBFSGAAYD+gICAgAIAgID+gAEA/wCAgIACAICA/oABgP6AA4CA/wABAICAgP8AgICAAAIAAP+AAwADgAAJAA0AABMhFSEVIRUhESsBMxUjgAKA/gABAP8AgICAgAOAgICA/gCAAAAFAAD/gAKAA4AAAwAPABMAFwAbAAABMxUrATMRMxUjESMRIzUzATMVIwEzFSM7ARUjAYCAgICAgICAgIABAICA/gCAgICAgAOAgP8AgP6AAYCAAQCA/gCAgAAAAAIAAAAAAYADgAALAA8AABMzETMVIxEjESM1MxMzFSOAgICAgICAgICAA4D+gID/AAEAgP6AgAAABgAAAAACgAOAAAMADwATABcAGwAfAAARIRUpATMVMxUjFSM1IzUzAzMVIyUzFSMhMxEjATMRIwEA/wABAICAgICAgICAgAEAgID+gICAAgCAgAOAgICAgICA/wCAgID/AAEA/wAAAAACAAD/gAKAAoAABQAJAAARIRUhESMBMxEjAgD+gIACAICAAoCA/gACAP2AAAMAAAAAAoADgAADAA8AEwAAEyEVISMzESERMxEjESERIzMhFSGAAYD+gICAAYCAgP6AgIABgP6AA4CA/wABAP2AAQD/AIAAAAYAAAAAAoADgAADAAcACwAPABMAFwAAESEVKQEzFSMpARUhIzMRIyUzFSMpARUhAgD+AAIAgID+gAGA/oCAgIACAICA/oABgP6AA4CAgID+gICAgAAAAAAFAAAAAAKAAoAAAwAHAAsADwATAAARIRUpATMVIykBFSEjMxUjMyEVIQIA/gACAICA/oABgP6AgICAgAIA/gACgICAgICAAAAFAAAAAAKAA4AABQAJAA0AEQAXAAARIRUhFSM7ARUjOwEVKwEzFSsBMxUhFSECgP4AgICAgICAgICAgICAAgD9gAOAgICAgICAgAAABAAA/4ACgAOAAAMABwAPABMAABMzFSsBMxUjJTMRIxEjNTMTIRUhgICAgICAAQCAgICAgAEA/wADgICAgP0AAgCA/YCAAAAABAAAAAACgAOAAAUACQANABEAABEzESEVIQEzFSM7ARErATMVI4ABAP6AAYCAgICAgICAgAOA/QCAA4CA/gCAAAUAAP+AAoADgAAFAAkADQARABUAABEhESM1IQUhFSkBMxEjJTMVIzMhFSECgID+AAEAAQD/AAEAgID+AICAgAGA/oADgP8AgICA/gCAgIAABQAA/4ACgAOAAAUACQANABEAFQAAESEVIRUjMyEVISMzESMlMxUjKQEVIQKA/gCAgAEA/wCAgIACAICA/oABgP6AA4CAgID+AICAgAAAAAAFAAD/gAKAAoAABQAJAA0AEQAVAAARIRUhFSMzIRUhIzMRIyUzFSMpARUhAoD+AICAAQD/AICAgAIAgID+gAGA/oACgICAgP8AgICAAAAAAAUAAAAAAoADgAADAAcACwAXAB8AABMhFSEjMxUjJTMVKwEzFTMVIRUjNSM1IQEzFSE1MxEhgAGA/oCAgIACAICAgICA/oCAgAGA/oCAAYCA/YADgICAgICAgICAgP8AgID/AAAEAAAAAAKAA4AACQANABEAFQAAESEVIRUhFSERIwEzESMlMxUjMyEVIQKA/oABAP6AgAIAgID+AICAgAGA/oADgICAgAEA/wD+gICAgAAAAAMAAAAAAoACgAAJAA0AEQAAESEVIRUhFSERIwEzFSMpARUhAoD+gAEA/oCAAgCAgP4AAgD+AAKAgICAAQD/AICAAAAABAAAAAACgAOAAAsADwATABcAABMzETMVIxUjNSM1MxMhFSkBMxUjKQEVIYCAgICAgICAAQD/AAEAgID+AAIA/gADgP8AgICAgP8AgICAAAAEAAD/gAKAAoAACwAPABMAFwAAETMVMxUjESEVIRUjASEVKQEzESsBMxUjgICAAQD/AIABAAEA/wABAICAgICAAoCAgP8AgIADAID/AIAAAAEAAAAAAIADgAADAAARMxEjgIADgPyAAAIAAAAAAYADgAADAAcAABEzESMBMxEjgIABAICAA4D8gAOA/IAAAAABAAAAAAKAA4AAEwAAATMRIRUhFSEVIREjESE1ITUhNSEBAIABAP8AAQD/AID/AAEA/wABAAOA/wCAgID/AAEAgICAAAIAAAAAAIADgAADAAcAABEzESMVMxUjgICAgAOA/YCAgAAAAAYAAP+AA4ADgAADAAcACwAPABMAFwAAETMRIwEzFSMVMxEjATMRIyUzFSMpARUhgIADAICAgID+gICA/wCAgAGAAQD/AAOA/QADAICA/YABAP8AgICAAAADAAAAAAKAAoAAAwANABEAABEhFSkBMxEjNSEVIxEhASEVIQIA/gACAICA/oCAAgD+gAGA/oACgID+gICAAQD/AIAAAAUAAP+AAoADgAALAA8AEwAXABsAABEzFTMVIxEzFSMRIwEhFSkBMxErATMVKwEzFSOAgICAgIABAAEA/wABAICAgICAgICAA4CAgP6AgP8ABACA/wCAgAAHAAD/gAKAA4AAAwAHAAsAEQAVABkAHQAAEyEVISMzFSMlMxUrATMRITUzFzMRKwEzFSMpARUhgAGA/oCAgIACAICAgID/AICAgICAgID+gAGA/oADgICAgID/AICA/wCAgAAABwAA/4ACgAKAAAMABwALAA8AEwAXABsAABMhFSEjMxUjJTMVIykBFSkBMxUrATMVIykBFSGAAYD+gICAgAIAgID/AAEA/wABAICAgICA/oABgP6AAoCAgICAgICAgAAAAgAA/4ACgAOAAAUACQAAESEVIREjATMRIwIA/oCAAgCAgAOAgP0AAwD8gAAFAAD/gAOAA4AADQARABUAGQAdAAABMxEzFSMVITUhESM1MyUhFSEjMxEjITMVKwEzFSMCAICAgP4AAYCAgP6AAQD/AICAgAMAgICAgIADgP2AgICAAQCAgID+gICAAAAFAAD/gAKAA4AABQAJAA0AEQAZAAARIREjNSEFMxUrATMVKwEzFSsBMxUhESM1IQKAgP4AAYCAgICAgICAgICAAgCA/gADgP8AgICAgICA/wCAAAADAAD/gAKAAoAABwALABUAABEhFSMVIzUhBTMVKwEzFSERIzUhNTMCgICA/oABAICAgIABgID+AIACgICAgICAgP8AgIAAAAADAAD/gAGAA4AABwALAA8AABEzETMVIxUjJTMVKwEzFSOAgICAAQCAgICAgAOA/YCAgICAgAAAAAQAAP+AA4ACgAAFAA0AEQAVAAARIRUhESMBMxEzFSMVIyUzFSsBMxUjAgD+gIACAICAgIABAICAgICAAoCA/gACAP8AgICAgIAAAAADAAAAAAIAA4AADwATABcAABMzETMVIxUzFSMVIxEjNTMBMxUrATMVI4CAgICAgICAgAEAgICAgIADgP8AgICAgAGAgP6AgIAAAAAAAQAAAAACgAOAABcAABMhFTMRIxEjFSM1IxUzESMVIxEzFSE1IYABgICAgICAgICAgAEA/wADgID9AAIAgICA/wCAAwCAgAAABwAAAAACgAOAAAMACwAPABMAFwAbAB8AABMhFSEjMxEzFSMVIwEzFSsBMxUrATMVIwUzFSMpARUhgAGA/oCAgICAgAIAgICAgICAgIABAICA/oABgP6AA4CA/oCAgAKAgICAgICAAAAEAAAAAAKAAoAABwARABUAGQAAEyEVMxUhNSEjMxEzFSEVITUjATMVIyEzFSOAAYCA/wD/AICAgAEA/oCAAQCAgAEAgIACgICAgP8AgICAAQCAgAABAAAAAAMAA4AADQAAEzMRMxUjESEVIREjNTOAgICAAgD9gICAA4D+gID/AIABgIAAAAAAAgAAAAACgAOAABEAFQAAESERIzUjFTMVIxEjESM1MxEhETMVIwKAgICAgICAgP8AgIADgP8AgICA/gABAIABgP4AgAAEAAAAAAKAA4AAAwAHAAsAEQAAEyEVISMzFSMlMxEjKQEVIxEjgAGA/oCAgIACAICA/wABAICAA4CAgID+gID/AAAAAAQAAAAAAoACgAADAAcACwARAAATIRUhIzMVIyUzESMpARUjFSOAAYD+gICAgAIAgID/AAEAgIACgICAgP8AgIAAAAAAAwAAAAADAAOAABMAFwAbAAATIRUhFSEVIRUhFSEVIRUhESM1MwEzFSMVMxEjgAIA/oABgP6AAQD/AAGA/gCAgAIAgICAgAOAgICAgICAgAEAgAGAgID+gAAAAAACAAAAAAOAA4AAEwAXAAATMxEhETMRMxUjESMRIREjESM1MxMhFSGAgAGAgICAgP6AgICAgAGA/oADgP8AAQD/AID+gAGA/oABgID+AIAAAAUAAAAAAoADgAADAAcACwAPABMAAAEzFSsBMxEjATMRIyEzESMBMxEjAQCAgICAgAEAgID+gICAAgCAgAOAgP8AAQD/AP4AAgD+AAABAAAAAAKAA4AAFQAAESERIzUhFSEVIxUjNSMVMxUjFSEVIQKAgP6AAYCAgICAgAIA/YADgP8AgICAgICAgICAAAAAAAIAAAAAAwACgAARABUAAAEhFTMRIRUhFSE1IxEzFSE1IQEzFSMBAAGAgP6AAYD+AICAAQD/AP8AgIACgID/AICAgAGAgID+gIAAAAADAAAAAAMAA4AACwAPABMAAAEzETMVIxEjESM1MwEzFSMzIRUhAgCAgICAgID+AICAgAGA/oADgP8AgP6AAYCA/oCAgAAAAAAEAAD/gAMAA4AAAwAPABMAFwAAATMVIxUzFTMVIxEjESM1MwEzESMzIRUhAgCAgICAgICAgP4AgICAAYD+gAOAgICAgP6AAYCA/wD/AIAAAAQAAP+AAwADgAAJAA0AEQAVAAATIREjNSM1MxEhIzMRIzMhFSkBMxUjgAIAgICA/oCAgICAAQD/AAIAgIADgPyAgIACAP2AgIAAAAAEAAD/gAMAAoAAAwAPABMAFwAAEyEVISUzESM1ITUhNSM1MyEzESMBMxUjgAEA/wABgICA/oABgICA/gCAgAKAgIACgICA/YCAgICA/wD/AIAAAAADAAAAAAMAA4AADQARABUAABMhFSEVIRUhESMRIzUzJTMVIxUzESOAAgD+gAGA/oCAgIACAICAgIADgICAgP4AAgCAgICA/gAAAAAAAwAAAAADAAKAAA8AEwAXAAATMxUzFSMVMxUjFSM1IzUzASEVKQEzFSOAgICAgICAgIABAAEA/wABAICAAoCAgICAgICAAYCAgAAAAAIAAAAAA4ADgAATABcAABMzFSE1MxUzFSEVIzUjFSM1ITUzATMRI4CAAYCAgP8AgICA/wCAAQCAgAOAgICAgICAgICA/wD+AAAAAAACAAD/gAOAAoAAFwAbAAATMxUhNTMVMxUjESM1ITUhNSEVIzUjNTMRIRUhgIABgICAgID+gAGA/oCAgIACAP4AAoCAgICA/oCAgICAgID+AIAAAAADAAAAAAKAAoAACQANABEAABEhFSEVIRUhFSMBMxUjASEVIQIA/oABgP6AgAIAgID+gAGA/oACgICAgIABgID/AIAAAAMAAAAAAoACgAADAA0AEQAAEyEVISUzESE1IREjNTMhMxEjgAEA/wABgID+AAGAgID+AICAAoCAgP2AgAEAgP6AAAAAAwAAAAACgAKAAAkADQARAAARIRUhETMVIxUjATMRIykBFSECAP6AgICAAgCAgP8AAQD/AAKAgP8AgIACAP6AgAAAAAAEAAAAAAKAA4AAAwANABEAFQAAEyEVISMzETMVIxEhFSEBIRUpATMRI4ABgP6AgICAgAGA/gABAAEA/wABAICAA4CA/wCA/wCAAoCA/oAAAAUAAAAAAoACgAADAAcACwAPABMAABMhFSEjMxUjJTMRIyUzFSMzIRUhgAGA/oCAgIACAICA/gCAgIABgP6AAoCAgID+gICAgAAAAAAFAAD/gAKAAoAAAwAHAAsAFwAbAAATIRUhIzMRIwEzFSsBMxUzFSMVIzUjNTMlMxUjgAGA/oCAgIABgICAgICAgICAgAEAgIACgID+gAEAgICAgICAgIAABAAA/4ADAAOAAAkADQARABUAAAEzESE1IREjNTMlIRUhIzMRIwUzFSMCAID+AAGAgID+gAEA/wCAgIACgICAA4D8gIABAICAgP6AgIAAAAAEAAAAAAMAA4AAAwANABEAFQAAATMVKwEzESE1IREjNTMlIRUhIzMRIwKAgICAgP4AAYCAgP6AAQD/AICAgAOAgP0AgAEAgICA/oAAAwAAAAACgAKAAAMADQARAAATIRUhIzMVITUzESM1IRUhFSGAAYD+gICAAYCAgP4AAgD+AAKAgICA/oCAgIAAAAMAAAAAAoACgAADAA0AEQAAESEVKQEzESM1IRUjESEBIRUhAgD+AAIAgID+gIACAP6AAYD+gAKAgP6AgIABAP8AgAAABAAAAAADgAKAAAMADwATABcAABEhFSkCFSMRIzUhFSMRKQEzFSMFIRUhAgD+AAIAAQCAgP6AgAIAAQCAgP2AAYD+gAKAgID/AICAAQCAgIAAAAAABQAAAAACgAKAAAMABwALAA8AEwAAEyEVISMzFSMzIRUhIzMVIzMhFSGAAgD+AICAgIABAP8AgICAgAIA/gACgICAgICAAAAABQAAAAACgAKAAAMABwALAA8AEwAAESEVKQEzFSMpARUpATMVIykBFSECAP4AAgCAgP8AAQD/AAEAgID+AAIA/gACgICAgICAAAAAAAYAAAAAA4ACgAADAAcACwAPABMAFwAAESEVKQIVKQIVISUzFSMhMxUjKQEVIQIA/gACAAEA/wD/AAEA/wACAICA/wCAgP4AAgD+AAKAgICAgICAgAAAAAAGAAAAAAKAAoAAAwAHAAsADwATABcAABMhFSEjMxEjATMVIykBFSkBMxUjKQEVIYABgP6AgICAAgCAgP8AAQD/AAEAgID+gAGA/oACgID+gAGAgICAgAAAAgAA/4ACAAMAAAsADwAAATMRMxUjFSM1ITUhASEVIQEAgICAgP8AAQD/AAEA/wADAP4AgICAgP8AgAAABAAA/4ADAAOAAAMADwATABcAAAEzFSsBMxEjNSE1IREhNSEFMxEjESEVIQKAgICAgID+gAGA/oABgP4AgIACAP4AA4CA/QCAgAEAgID/AP8AgAAAAwAA/4ACgAKAAAkADQARAAATIREjNSE1IREhIzMRIxEhFSGAAgCA/oABgP6AgICAAgD+AAKA/YCAgAEA/wD/AIAAAAAEAAAAAAKAAoAAAwAHAA0AEQAAEyEVISMzESMBIREjNSMFIRUhgAIA/gCAgIABgAEAgID/AAGA/oACgID+gAEA/wCAgIAAAAAGAAAAAAKAAoAAAwAHAAsADwATABcAABEhFSElIRUhIzMVKwEzESMBMxErATMVIwEA/wABgAEA/wCAgICAgIABAICAgICAAoCAgICA/wABAP8AgAADAAD/gAKAAwAAAwALAA8AABEzESMBMxEjESM1MwUhFSGAgAIAgICAgP6AAQD/AAMA/gACAPyAAYCAgIAAAAAABAAAAAACgAOAAAMACwAPABMAABMhFSEjMxEzFSMRIwEhFSkBMxEjgAIA/gCAgICAgAEAAQD/AAEAgIADgID/AID+gAKAgP4AAAAAAAUAAP+AAoADgAADAAsADwATABcAABMhFSEjMxEzFSMRIwEhFSkBMxEjKQEVIYACAP4AgICAgIABAAEA/wABAICA/wABAP8AA4CA/wCA/oACgID+AIAAAAACAAAAAAGAA4AAAwAPAAATMxUjFTMRMxUjESMRIzUzgICAgICAgICAA4CAgP8AgP8AAQCAAAAAAAEAAAAAAYACgAALAAARIRUjETMVITUzESMBgICA/oCAgAKAgP6AgIABgAAABAAAAAACgAOAAAsADwATABcAAAEzETMVIxEjESM1MyEzFSMhMxUjATMVIwEAgICAgICAAQCAgP4AgIABgICAA4D+gID/AAGAgICA/wCAAAADAAAAAAIAA4AADwATABcAAAEzETMVIxUjNSM1MzUjNTMFMxUjATMVIwEAgICAgICAgID/AICAAYCAgAOA/gCAgICAgICAgP8AgAAAAgAA/4ABAAOAAAMABwAAETMRIzsBFSOAgICAgAOA/ICAAAAABAAA/4ACgAOAAAkADQARABUAABEzESERIzUhESMBIRUpATMRIykBFSGAAgCA/oCAAQABAP8AAQCAgP8AAQD/AAOA/wD/AID+AAGAgP8AgAAEAAAAAAKAAoAAAwAJAA0AEQAAETMRIwEzESE1MwEzESsBMxUjgIACAID/AID/AICAgICAAoD+AAIA/YCAAQD/AIAAAAQAAP+AAoACgAADAAsADwATAAARMxEjATMRIzUjNTMBMxErATMVI4CAAgCAgICA/wCAgICAgAKA/gACAP0AgIABAP8AgAAAAAUAAP+AAoACgAAFAAkADQARABUAABEhFSMRIwEzFSsBMxEjATMRKwEzFSMBAICAAYCAgICAgAEAgICAgIACgID+AAKAgP8AAQD+AIAAAAAAAwAA/4ADAAKAAAUACQANAAATIRUhESMBMxEjITMVI4ACAP6AgAIAgID9gICAAoCA/gACAP4AgAADAAD/gAMAAoAABQAJAA0AABEhFSERIwEzESM7ARUjAgD+gIACAICAgICAAoCA/gACAP4AgAAAAAMAAAAAAoACgAAHAA8AEwAAETMVMxUjESMBMxEjNSM1MyUzFSOAgICAAgCAgICA/wCAgAKAgID+gAKA/YCAgICAAAAAAwAAAAACgAKAAAMADwATAAATIRUhIzMVITUzESM1IRUjMyEVIYABgP6AgIABgICA/oCAgAGA/oACgICAgP6AgICAAAAGAAAAAAOAAoAAAwAHAAsADwATABcAABMhFSEjMxEjATMRIwEzESMpARUhJSEVIYACgP2AgICAAwCAgP6AgID/AAEA/wABgAEA/wACgID+gAGA/oABAP8AgICAAAMAAP+AAoADAAATABcAGwAAATMVMxUjETMVIxUjNSM1MxEjNTMFMxEjATMRIwEAgICAgICAgICAgP8AgIACAICAAwCAgP6AgICAgAGAgID+gAGA/oAAAAADAAAAAAKAAoAABwALAA8AAAEzESM1IzUzITMVIzMhFSECAICAgID+AICAgAEA/wACgP2AgICAgAAAAAADAAAAAAKAA4AABwALAA8AAAEzESM1IzUzITMVIzMhFSECAICAgID+AICAgAEA/wADgPyAgICAgAAAAAAEAAD/gAMAAoAABwALAA8AEwAAATMRIzUjNTMhMxUjMyEVKQEzFSMCAICAgID+AICAgAEA/wACAICAAoD9gICAgICAAAMAAP+AAoACgAAHAAsADwAAETMVMxUjESMBIRUpATMVI4CAgIABAAEA/wABAICAAoCAgP4AAwCAgAAAAAMAAAAAAoACgAADAAcACwAAEyEVISMzESMBMxUjgAGA/oCAgIACAICAAoCA/gACAIAAAAADAAD/gAKAAoAAAwAHAAsAABMhFSEjMxUjJTMRI4ABgP6AgICAAgCAgAKAgICA/YAAAAAAAwAAAAACgAKAAAkADQARAAARIRUhFSEVIREjATMVIxUzESMCAP6AAYD+gIACAICAgIACgICAgP8AAgCAgP8AAAMAAAAAAoACgAAJAA0AEQAAETMRIRUhFSEVIQEzESMVMxUjgAGA/oABgP4AAgCAgICAAoD/AICAgAKA/wCAgAAEAAD/gAMAA4AAAwAPABMAFwAAATMVKwEzETMVIxUjNSM1MyEzESMzIRUhAoCAgICAgICAgID+AICAgAGA/oADgID+AICAgID/AIAAAwAA/4ACgAKAAAMABwALAAARIRUpATMRIzMhFSEBAP8AAQCAgIABAP8AAoCA/gCAAAAAAAQAAP+AAwADgAADAA8AEwAXAAABIRUhIzMRMxUjFSM1ITUhBTMVIzMhFSECAAEA/wCAgICAgP8AAQD+gICAgAEA/wADgID+AICAgICAgIAAAgAA/4ABgAMAAAMADwAAETMVIzsBETMVIxEjESM1M4CAgICAgICAgAMAgP6AgP8AAQCAAAIAAP+AAYADgAALAA8AABMzETMVIxEjESM1MxMzFSOAgICAgICAgICAA4D/AID+AAIAgP2AgAAAAQAAAAADgAKAABUAABMzESERMxEzFSMRITUhNSEVIzUjNTOAgAGAgICA/gABgP6AgICAAoD/AAEA/wCA/wCAgICAgAAFAAAAAAKAAoAABQALAA8AEwAXAAARIREjNSMlIRUjFSMhMxEjATMRIykBFSEBAICAAYABAICA/oCAgAIAgID+gAGA/oACgP8AgICAgP8AAQD/AIAAAAAABAAAAAACgAKAAAMABwALAA8AABEzESMBMxUjOwERIykBFSGAgAGAgICAgID+gAGA/oACgP4AAgCA/oCAAAAAAAUAAAAAAoACgAADAAcACwAPABMAAAEzFSsBMxUjJTMVIyEzESMBMxEjAQCAgICAgAEAgID+gICAAgCAgAKAgICAgP6AAYD+gAAAAAACAAAAAAKAAoAACQANAAARIRUjESMRIxEjATMRIwIAgICAgAIAgIACgID/AAEA/gACAP4AAAAAAAMAAAAAAoADAAADAAsADwAAEyEVISMzFSEVIREjATMRI4ACAP4AgIABgP6AgAIAgIADAICAgP6AAYD+gAAAAAAFAAAAAAKAAoAAAwAHAAsADwATAAARMxUjJTMVIyEzFSMlMxUrATMRI4CAAgCAgP6AgIABAICAgICAAoCAgICAgID+gAAAAAAFAAD/gAKAAoAABwALAA8AHQAhAAARIRUjFSM1IRczFSMlMxUjITMVMzUzFTMVIxUjNSEBMxUjAgCAgP8AgICAAQCAgP6AgICAgICA/wACAICAAoCAgICAgICAgICAgICAAQCAAAAAAAUAAP+AAoACgAAFAAkADQARABUAABEhESM1IQUhFSkBMxEjJTMVIzMhFSECgID+AAEAAQD/AAEAgID+AICAgAGA/oACgP8AgICA/wCAgIAABgAA/4ACgAKAAAUACQANABEAFQAdAAARIREjNSEFIRUhIzMVIyUzESMlMxUjJTMVMxUhNTMCgID+AAEAAQD/AICAgAGAgID+AICAAQCAgP6AgAKA/wCAgICAgP8AgICAgICAAAQAAAAAAoADgAADAAcACwARAAATIRUhIzMVIyUzESMpARUjESOAAYD+gICAgAIAgID/AAEAgIADgICAgP6AgP8AAAAABAAAAAACgAOAAAMABwALABEAABMhFSEjMxEjATMVIwEhESMRI4ABgP6AgICAAgCAgP6AAQCAgAOAgP6AAYCA/wD+gAEAAAAABAAAAAACgAOAAAUACQANABEAAAEzETMVKQEzESMlMxUjMyEVIQEAgID/AAEAgID+AICAgAGA/oADgP8AgP6AgICAAAAFAAD/gAKAAoAAAwAHAAsADwATAAATIRUhIzMRIwEzFSMRMxUjKQEVIYABgP6AgICAAgCAgICA/oABgP6AAoCA/gACAID/AICAAAAABQAAAAACgAOAAAMABwALAA8AEwAAEyEVISMzESMBMxEjATMVIwMhFSGAAYD+gICAgAIAgID/AICAgAGA/oADgID9gAKA/YABgID/AIAAAAADAAAAAAKAAoAACwAPABMAABEhFSEVIRUhFSEVIQEzFSMVMxUjAgD+gAGA/oABgP4AAgCAgICAAoCAgICAgAIAgICAAAYAAAAAAoACgAADAAcACwAPABMAFwAAEyEVISMzFSMlMxEjASEVISMzFSMzIRUhgAGA/oCAgIACAICA/oABAP8AgICAgAGA/oACgICAgP6AAQCAgIAAAAAFAAAAAAMAA4AAAwAJAA0AEwAXAAABMxUrATMRITUhBTMRIwEhESM1IwUhFSECgICAgID+AAGA/gCAgAGAAQCAgP8AAYD+gAOAgP8AgID+gAEA/wCAgIAAAQAAAAACgAKAAAsAABEzESERMxEjESERI4ABgICA/oCAAoD/AAEA/YABAP8AAAAABAAA/4ACgAOAAAMADwATABcAAAEzFSMVMxEzFSMVIzUhNSEFMxUjMyEVIQGAgICAgICA/wABAP6AgICAAQD/AAOAgID+gICAgICAgIAAAAAFAAD/gAIAAwAAAwALAA8AEwAXAAARMxUjJTMRIxEjNTMlMxUjFTMVKwEzFSOAgAGAgICAgP8AgICAgICAgAMAgID8gAIAgICAgICAAAAAAAEAAAAAAoACgAAFAAARMxEhFSGAAgD9gAKA/gCAAAAABAAA/4ADAAOAAAMADwATABcAAAEzFSsBMxEjESE1ITUjNTMlIRUhIzMRIwKAgICAgID+gAGAgID+gAEA/wCAgIADgID8gAEAgICAgID/AAAEAAAAAAKAA4AAAwAHAAsAGQAAEyEVISMzFSMlMxEjKQEVIxUhFSEVIzUhNSGAAYD+gICAgAIAgID/AAEAgAEA/wCA/wABAAOAgICA/wCAgICAgIAAAAAABAAAAAACgAOAAAMABwALABkAABMhFSEjMxEjATMVIwUhESEVIRUjNSE1ITUjgAGA/oCAgIACAICA/oABAAEA/wCA/wABAIADgID/AAEAgID/AICAgICAAAQAAAAAAoADgAAJAA0AFwAbAAARMxEzNTMVMxUhATMRIwEzETM1MxUzFSEBMxEjgICAgP4AAgCAgP4AgICAgP4AAgCAgAOA/wCAgIABgP8A/wD/AICAgAGA/wAAAQAAAoAAgAOAAAMAABEzESOAgAOA/wAAAQAA/4AAgACAAAMAADUzESOAgID/AAAAAQAAAoAAgAMAAAMAABEzFSOAgAMAgAAAAgAA/4AAgAIAAAMABwAAETMVIxEzESOAgICAAgCA/wD/AAAAAQAAAgAAgAKAAAMAABEzFSOAgAKAgAAAAgAAAAACgAOAAAMADwAAEyEVISMzFSE1MxEjESERI4ABgP6AgIABgICA/oCAA4CAgID9AAIA/gAAAAAAAwAAAAACgAOAAAsADwATAAARIRUhFSEVIREhFSEBMxUjFTMRIwIA/oABgP6AAYD+AAIAgICAgAOAgICA/oCAAwCAgP6AAAAAAQAAAAACgAOAAAUAABEhFSERIwKA/gCAA4CA/QAAAAAEAAAAAAKAA4AAAwAHAAsAEwAAATMRKwEzESMBMxEjITMVITUzESEBAICAgICAAQCAgP6AgAGAgP2AA4D/AP6AAYD+gICA/wAAAAAAAQAAAAACgAOAAAsAABEhFSEVIRUhESEVIQKA/gABAP8AAgD9gAOAgICA/oCAAAAABQAAAAACgAOAAAUACQANABEAFwAAESERIzUhBTMVKwEzFSsBMxUrATMVIRUhAoCA/gABgICAgICAgICAgIACAP2AA4D/AICAgICAgIAAAAABAAAAAAKAA4AACwAAETMRIREzESMRIREjgAGAgID+gIADgP8AAQD8gAIA/gAAAAAFAAAAAAKAA4AAAwAHAAsADwATAAATIRUhIzMRIwEzESMBMxUjAyEVIYABgP6AgICAAgCAgP8AgICAAYD+gAOAgP2AAoD9gAGAgP8AgAAAAAEAAAAAAYADgAALAAARIRUjETMVITUzESMBgICA/oCAgAOAgP2AgIACgAAABQAAAAACgAOAAAcACwAPABMAFwAAETMRIRUhESMBMxUrATMVIxUzFSM7AREjgAEA/wCAAgCAgICAgICAgICAA4D/AID+AAOAgICAgP6AAAAFAAAAAAKAA4AAAwAHAAsADwATAAABMxErATMRIwEzESMhMxEjATMRIwEAgICAgIABAICA/oCAgAIAgIADgP8A/oABgP6A/wABAP8AAAAAAAMAAAAAAoADgAAHAA8AEwAAETMVMxUjESMBMxEjESM1MwUzFSOAgICAAgCAgICA/wCAgAOAgID9gAOA/IACgICAgAAAAwAAAAACgAOAAAcADwATAAARMxUzFSMRIwEzESMRIzUzJTMVI4CAgIACAICAgID/AICAA4CAgP2AA4D8gAGAgICAAAADAAAAAAKAA4AAAwAHAAsAABEhFSETIRUhAyEVIQKA/YCAAYD+gIACgP2AA4CA/wCA/wCAAAAAAAQAAAAAAoADgAADAAcACwAPAAATIRUhIzMRIwEzESMpARUhgAGA/oCAgIACAICA/oABgP6AA4CA/YACgP2AgAABAAAAAAKAA4AABwAAESERIxEhESMCgID+gIADgPyAAwD9AAACAAAAAAKAA4AACQANAAARIRUhFSEVIREjATMVIwIA/oABgP6AgAIAgIADgICAgP4AAwCAAAAAAAUAAAAAAoADgAAFAAkADQARABcAABEhFSEVIzsBFSM7ARUrATMVKwEzFSEVIQKA/gCAgICAgICAgICAgIACAP2AA4CAgICAgICAAAABAAAAAAKAA4AABwAAESEVIREjESECgP8AgP8AA4CA/QADAAAFAAAAAAKAA4AAAwAHAAsADwATAAARMxUjJTMVIyEzFSMlMxUrATMRI4CAAgCAgP6AgIABAICAgICAA4CAgICAgID9gAAAAAADAAAAAAKAA4AAEwAXABsAAAEzFTMVIxEzFSMVIzUjNTMRIzUzBTMRIwEzESMBAICAgICAgICAgID/AICAAgCAgAOAgID+gICAgIABgICA/oABgP6AAAAACQAAAAACgAOAAAMABwALAA8AEwAXABsAHwAjAAARMxUjJTMVIyEzFSMlMxUrATMVKwEzFSMlMxUjITMRIwEzESOAgAIAgID+gICAAQCAgICAgICAgAEAgID+gICAAgCAgAOAgICAgICAgICAgP6AAYD+gAADAAAAAAKAA4AAAwAPABMAABEzESMBMxEzFSMRIxEjNTMBMxEjgIABAICAgICAgAEAgIADgP8AAQD/AID+AAIAgAEA/wAAAAAFAAAAAAKAA4AAAwAHAAsAEQAXAAATIRUhIzMRIwEzESMhMxEhNTMlMxUzFSGAAYD+gICAgAIAgID+gID/AIABAICA/wADgID+AAIA/gD/AICAgIAAAAAABgAAAAACgAKAAAMABwALAA8AEwAXAAATIRUhJTMVIyEzESMBMxEjKQEVISUzFSOAAQD/AAGAgID+AICAAYCAgP8AAQD/AAGAgIACgICAgP6AAYD+gICAgAAAAAAGAAD/gAKAA4AAAwALAA8AEwAXABsAABMhFSEjMxEhFSEVIwEzFSsBMxUjOwEVIzsBESOAAQD/AICAAYD+gIABgICAgICAgICAgICAA4CA/YCAgAOAgICA/wAAAAgAAP+AAoACgAADAAcACwAPABMAFwAbAB8AABEzFSMlMxUjITMVIyUzFSsBMxUrATMRIwEzESsBMxUjgIACAICA/oCAgAEAgICAgICAgIABAICAgICAAoCAgICAgICA/wABAP8AgAAACAAAAAACgAOAAAMABwALAA8AEwAXABsAHwAAASEVISMzFSM7ARUrATMVIyUzFSMhMxEjATMRIykBFSEBAAEA/wCAgICAgICAgIABAICA/oCAgAIAgID+gAGA/oADgICAgICAgP8AAQD/AIAABQAAAAACgAKAAAMABwALAA8AEwAAEyEVISMzFSMzIRUhIzMVIzMhFSGAAgD+AICAgIABAP8AgICAgAIA/gACgICAgICAAAAACAAA/4ACgAOAAAMABwALAA8AEwAXABsAHwAAESEVKQEzFSsBMxUrATMVKwEzFSMzIRUpATMVKwEzFSMCAP4AAgCAgICAgICAgICAgIABAP8AAQCAgICAgAOAgICAgICAgIAAAAIAAP+AAoACgAAFAAkAABEhFSERIwEzESMCAP6AgAIAgIACgID+AAIA/YAAAwAAAAACgAOAAAMADwATAAATIRUhIzMRIREzESMRIREjMyEVIYABgP6AgIABgICA/oCAgAGA/oADgID/AAEA/YABAP8AgAAAAgAAAAABAAKAAAMABwAAETMRIzsBFSOAgICAgAKA/gCAAAAABQAAAAACAAKAAAcACwAPABMAFwAAETMRMxUjESMBMxUrATMVIxUzFSM7ARUjgICAgAGAgICAgICAgICAgAKA/wCA/wACgICAgICAAAYAAAAAAoADgAADAAcACwAPABMAFwAAESEVKQEzESsBMxEjATMRIyEzESMBMxEjAQD/AAEAgICAgIABAICA/oCAgAIAgIADgID/AP8AAQD/AP8AAQD/AAACAAD/gAKAAoAABwALAAARMxEhFSEVIwEzESOAAYD+gIACAICAAoD+AICAAwD+AAAFAAAAAAKAAoAAAwAHAAsADwATAAARMxEjATMRIyEzESMBMxErATMVI4CAAgCAgP6AgIABAICAgICAAoD/AAEA/wD/AAEA/wCAAAAACAAA/4ACgAOAAAMABwALAA8AEwAXABsAHwAAETMVIzMhFSEjMxUjMyEVISMzFSMzIRUpATMVKwEzFSOAgIABgP6AgICAgAGA/oCAgICAAYD+gAGAgICAgIADgICAgICAgICAAAQAAAAAAoACgAADAAcACwAPAAATIRUhIzMRIwEzESMpARUhgAGA/oCAgIACAICA/oABgP6AAoCA/oABgP6AgAABAAAAAAKAAoAACwAAESEVIxEjESMRIxEjAoCAgICAgAKAgP4AAgD+AAIAAAMAAP+AAoACgAADAAsADwAAEyEVISMzESEVIREjATMRI4ABgP6AgIABgP6AgAIAgIACgID/AID/AAKA/wAAAAAGAAD/gAKAAoAAAwAHAAsADwATABcAABMhFSEjMxEjATMVIwUhFSkBMxUrATMVI4ABgP6AgICAAgCAgP6AAYD+gAGAgICAgIACgID/AAEAgICAgIAAAAAAAwAAAAADAAKAAAcACwAPAAATIRUjESMRISMzESMzIRUhgAKAgID+gICAgIABgP6AAoCA/oABgP6AgAAAAgAAAAACgAKAAAcACwAAESEVIREjESEBMxUjAoD/AID/AAGAgIACgID+gAGA/oCAAAAAAAQAAAAAAoACgAADAAcACwAPAAARMxEjATMVIzsBESMpARUhgIABgICAgICA/oABgP6AAoD+AAIAgP6AgAAAAAAEAAD/gAKAAoAAAwAHABMAFwAAATMVIyEzESMBMxEzFSMVIzUjNTMBMxEjAYCAgP6AgIABAICAgICAgAEAgIACgID+gAGA/oCAgICAAYD+gAAAAAAJAAD/gAKAAoAAAwAHAAsADwATABcAGwAfACMAABEzFSMlMxUjITMVIyUzFSsBMxUrATMVIyUzFSMhMxEjATMRI4CAAgCAgP6AgIABAICAgICAgICAAQCAgP6AgIACAICAAoCAgICAgICAgICA/wABAP8AAAMAAP+AAoACgAADAA8AEwAAETMRIwEzETMVIxEjESM1MwEzESOAgAEAgICAgICAAQCAgAKA/oABgP6AgP8AAQCAAYD+gAAAAAcAAAAAA4ACgAADAAcACwAPABMAFwAbAAATMxUjJTMVIyEzESMBMxEjATMRIykBFSElIRUhgICAAgCAgP2AgIADAICA/oCAgP8AAQD/AAGAAQD/AAKAgICA/oABgP6AAQD/AICAgAAABAAAAAACgAOAAAMABwALABMAABMhFSEjMxEjATMVIwEhESE1ITUhgAGA/oCAgIACAICA/oACAP2AAgD+gAOAgP6AAYCA/wD+gICAAAQAAAAAA4ADgAALAA8AEwAXAAARIRUhETMVIxEjESEFIRUpATMRKwEzFSMCgP8AgICA/wACAAEA/wABAICAgICAA4CA/wCA/oADAICA/oCAAAAAAAUAAAAAAoADgAADAAsADwATABcAABMhFSEjMxEhFSERIwEzFSMRMxUjKQEVIYABgP6AgIABAP8AgAIAgICAgP6AAYD+gAOAgP8AgP8AAoCA/oCAgAAAAAAGAAAAAAKAA4AAAwAHAAsADwATABcAABMhFSEjMxUjMyEVKQEzESMlMxUjMyEVIYACAP4AgICAgAGA/oABgICA/gCAgIABgP6AA4CAgID+gICAgAABAAAAAAGAA4AACwAAESEVIxEzFSE1MxEjAYCAgP6AgIADgID9gICAAoAAAAMAAAAAAoADgAADAAcACwAAATMRIyUzFSMzIRUhAgCAgP4AgICAAYD+gAOA/QCAgIAAAAADAAAAAAOAA4AADQARABUAABMhESEVIREhFSERIxEjATMRIyEzFSOAAYABAP8AAQD+gICAAoCAgP0AgIADgP8AgP6AgAMA/YABgP6AgAAAAAIAAAAAAwADgAARABUAABEzETMRMxEhFSERIRUhESMRIwEzESOAgIABAP8AAQD+gICAAoCAgAOA/wABAP8AgP6AgAIA/gACAP6AAAADAAAAAAMAA4AADwATABcAABMzFSEVIREzFSMRIxEjNTMBIRUpATMRI4CAAYD+gICAgICAAQABAP8AAQCAgAOAgID/AID/AAKAgP8AgP6AAAIAAAAAAoADgAADAA8AABMhFSEjMxUhNTMRIxEhESOAAYD+gICAAYCAgP6AgAOAgICA/QACAP4AAAAAAAIAAAAAAoADgAALAA8AABEhFSEVIRUhESEVIQEzESMCgP4AAYD+gAGA/gACAICAA4CAgID+gIACAP6AAAMAAAAAAoADgAALAA8AEwAAESEVIRUhFSERIRUhATMVIxUzESMCAP6AAYD+gAGA/gACAICAgIADgICAgP6AgAMAgID+gAAAAAEAAAAAAoADgAAFAAARIRUhESMCgP4AgAOAgP0AAAAAAQAA/4ADAAOAABMAAAEhETMRIzUhFSMRMxEzESERIxEjAQABgICA/gCAgIABAICAA4D9AP8AgIABAAGA/oACgP8AAAABAAAAAAKAA4AACwAAESEVIRUhFSERIRUhAoD+AAEA/wACAP2AA4CAgID+gIAAAAAJAAAAAAOAA4AAAwAPABMAFwAbAB8AIwAnACsAABEzFSMlMxEzFSMRIxEjNTMBMxUjITMVIyUzFSMFMxUjJTMVIyEzESMBMxEjgIABgICAgICAgAGAgID9gICAAgCAgP4AgIACAICA/YCAgAMAgIADgICA/wCA/gACAIABAICAgICAgICA/oABgP6AAAcAAAAAAoADgAADAAcACwAPABMAFwAbAAATIRUhIzMVIyUzFSMpARUpATMRIyUzFSMzIRUhgAGA/oCAgIACAICA/wABAP8AAQCAgP4AgICAAYD+gAOAgICAgID+gICAgAAAAAADAAAAAAKAA4AABwAPABMAABEzETMVIxEjATMRIxEjNTMFMxUjgICAgAIAgICAgP8AgIADgP6AgP6AA4D8gAKAgICAAAUAAAAAAoADgAAHAAsADwATABcAABEzESEVIREjATMVKwEzFSMVMxUjOwERI4ABAP8AgAIAgICAgICAgICAgAOA/wCA/gADgICAgID+gAAAAgAAAAACgAOAAAcACwAAEyERIxEhESsBMxUjgAIAgP8AgICAgAOA/IADAP2AgAAAAwAAAAACgAOAAAcADwATAAARMxUzFSMRIwEzESMRIzUzBTMVI4CAgIACAICAgID/AICAA4CAgP2AA4D8gAKAgICAAAABAAAAAAKAA4AACwAAETMRIREzESMRIREjgAGAgID+gIADgP8AAQD8gAIA/gAAAAAEAAAAAAKAA4AAAwAHAAsADwAAEyEVISMzESMBMxEjKQEVIYABgP6AgICAAgCAgP6AAYD+gAOAgP2AAoD9gIAAAQAAAAACgAOAAAcAABEhESMRIREjAoCA/oCAA4D8gAMA/QAAAgAAAAACgAOAAAkADQAAESEVIRUhFSERIwEzFSMCAP6AAYD+gIACAICAA4CAgID+AAMAgAAAAAAFAAAAAAKAA4AAAwAHAAsADwATAAATIRUhIzMRIwEzFSMRMxUjKQEVIYABgP6AgICAAgCAgICA/oABgP6AA4CA/YACgID+gICAAAAAAQAAAAACgAOAAAcAABEhFSERIxEhAoD/AID/AAOAgP0AAwAAAwAAAAACgAOAAAMACwAPAAARMxEjATMRIxEhNSEBIRUhgIACAICA/oABgP4AAgD+AAOA/oABgP0AAQCA/oCAAAMAAP+AA4ADgAATABcAGwAAATMVIRUhESEVIRUjNSE1IREhNSEFMxEjATMRIwGAgAEA/wABAP8AgP8AAQD/AAEA/oCAgAMAgIADgICA/gCAgICAAgCAgP4AAgD+AAAAAAkAAAAAAoADgAADAAcACwAPABMAFwAbAB8AIwAAETMVIyUzFSMhMxUjJTMVKwEzFSsBMxUjJTMVIyEzESMBMxEjgIACAICA/oCAgAEAgICAgICAgIABAICA/oCAgAIAgIADgICAgICAgICAgID+gAGA/oAAAQAA/4ADAAOAAAsAABEzESERMxEzESM1IYABgICAgP2AA4D9AAMA/QD/AIAAAAAAAgAAAAACgAOAAAMACwAAETMRIwEzESMRITUhgIACAICA/oABgAOA/oABgPyAAYCAAAAAAAEAAAAAA4ADgAALAAARMxEhETMRIREzESGAAQCAAQCA/IADgP0AAwD9AAMA/IAAAAEAAP+ABAADgAAPAAARMxEhETMRIREzETMRIzUhgAEAgAEAgICA/IADgP0AAwD9AAMA/QD/AIAAAgAAAAADAAOAAAsADwAAESERIRUhESEVIREjATMRIwEAAYD+gAGA/gCAAoCAgAOA/oCA/wCAAwD+gP8AAAAAAAMAAAAAA4ADgAAJAA0AEQAAETMRIRUhESEVIQEzESMBMxEjgAGA/oABgP4AAwCAgP8AgIADgP6AgP8AgAOA/IABgP8AAAAAAAIAAAAAAoADgAAJAA0AABEzESEVIREhFSEBMxEjgAGA/oABgP4AAgCAgAOA/oCA/wCAAYD/AAAABQAAAAACgAOAAAMABwAPABMAFwAAEyEVISMzFSMlMxEjESE1IQEzFSMzIRUhgAGA/oCAgIACAICA/wABAP4AgICAAYD+gAOAgICA/YABAID/AICAAAAAAAQAAAAAA4ADgAALAA8AEwAXAAARMxEzETMRIxEjESMBIRUpATMRIykBFSGAgICAgIABgAGA/oABgICA/oABgP6AA4D+gAEA/YABAP6AA4CA/YCAAAMAAAAAAoADgAAJAA0AEQAAEyERIxEhNSE1ISMzFSMVMxEjgAIAgP6AAYD+gICAgICAA4D8gAIAgICAgP4AAAADAAAAAAKAAoAAAwANABEAABMhFSkBMxEhNSE1ITUhBTMVI4ABgP6AAYCA/gABgP6AAYD+AICAAoCA/gCAgICAgAAAAAQAAAAAAoADgAADAAsADwATAAATIRUhIzMVIRUhESMBMxEjKQEVIYACAP4AgIABgP6AgAIAgID+gAGA/oADgICAgP6AAYD+gIAAAAADAAAAAAKAAoAACwAPABMAABEhFSEVIRUhFSEVIQEzFSMVMxUjAgD+gAGA/oABgP4AAgCAgICAAoCAgICAgAIAgICAAAEAAAAAAgACgAAFAAARIRUhESMCAP6AgAKAgP4AAAAAAQAA/4ADAAKAABMAAAEhETMRIzUhFSMRMxEzESERIxUjAQABgICA/gCAgIABAICAAoD+AP8AgIABAAEA/wABgIAAAAADAAAAAAKAAoAAAwANABEAABMhFSEjMxUhNTMRIRUjMyEVIYABgP6AgIABgID+AICAAgD+AAKAgICA/wCAgAAABQAAAAACgAKAAAMADwATABcAGwAAETMRIwEzETMVIxEjESM1MwEzESMFMxEjATMRI4CAAQCAgICAgIABAICA/gCAgAIAgIACgP8AAQD/AID/AAEAgAEA/wCA/wABAP8AAAAAAAcAAAAAAoACgAADAAcACwAPABMAFwAbAAATIRUhIzMVIyUzFSMpARUpATMVIyUzFSMpARUhgAGA/oCAgIACAICA/wABAP8A/wCAgAIAgID+gAGA/oACgICAgICAgICAgAAAAAADAAAAAAKAAoAABwAPABMAABEzETMVIxUjATMRIxEjNTMFMxUjgICAgAIAgICAgP8AgIACgP6AgIACgP2AAYCAgIAAAAUAAAAAAgACgAAHAAsADwATABcAABEzETMVIxEjATMVKwEzFSMVMxUjOwEVI4CAgIABgICAgICAgICAgIACgP8AgP8AAoCAgICAgAACAAAAAAKAAoAABwALAAATIREjESERKwEzFSOAAgCA/wCAgICAAoD9gAIA/oCAAAADAAAAAAKAAoAABwAPABMAABEzFTMVIxEjATMRIxEjNTMFMxUjgICAgAIAgICAgP8AgIACgICA/oACgP2AAYCAgIAAAAEAAAAAAoACgAALAAARMxEhETMRIxEhESOAAYCAgP6AgAKA/wABAP2AAQD/AAAAAAQAAAAAAoACgAADAAcACwAPAAATIRUhIzMRIwEzESMpARUhgAGA/oCAgIACAICA/oABgP6AAoCA/oABgP6AgAABAAAAAAKAAoAABwAAESERIxEhESMCgID+gIACgP2AAgD+AAADAAD/gAKAAoAACwAPABMAABEzFTMVIxUhFSERIwEhFSkBMxEjgICAAYD+gIABAAEA/wABAICAAoCAgICA/wADAID/AAAAAAAFAAAAAAKAAoAAAwAHAAsADwATAAATIRUhIzMRIwEzFSMVMxUjKQEVIYABgP6AgICAAgCAgICA/oABgP6AAoCA/oABgICAgIAAAAAAAQAAAAACgAKAAAcAABEhFSERIxEhAoD/AID/AAKAgP4AAgAAAwAA/4ACgAKAAAMACwAPAAARMxEjATMRIzUhNSEBIRUhgIACAICA/oABgP4AAgD+AAKA/oABgP2AgID/AIAAAAMAAP+AAoACgAAPABMAFwAAEyEVIxEzFSMVIzUjNTMRKwEzESMBMxEjgAGAgICAgICAgICAgAIAgIACgID+gICAgIABgP6AAYD+gAAJAAAAAAKAAoAAAwAHAAsADwATABcAGwAfACMAABEzFSMlMxUjITMVIyUzFSsBMxUrATMVIyUzFSMhMxUjJTMVI4CAAgCAgP6AgIABAICAgICAgICAAQCAgP6AgIACAICAAoCAgICAgICAgICAgICAAAAAAAEAAP+AAoACgAALAAARMxEhETMRMxEjNSGAAQCAgID+AAKA/gACAP4A/wCAAAAAAAIAAAAAAoACgAADAAsAABEzESMBMxEjESE1IYCAAgCAgP6AAYACgP8AAQD9gAEAgAAAAAABAAAAAAKAAoAACwAAETMRMxEzETMRMxEhgICAgID9gAKA/gACAP4AAgD9gAAAAAABAAD/gAMAAoAADwAAETMRMxEzETMRMxEzESM1IYCAgICAgID9gAKA/gACAP4AAgD+AP8AgAAAAAIAAAAAAwACgAALAA8AABEhESEVIRUhFSERIwEzFSMBAAGA/oABgP4AgAKAgIACgP8AgICAAgD/AIAAAAMAAAAAAwACgAAJAA0AEQAAETMRIRUhFSEVIQEzESMBMxUjgAEA/wABAP6AAoCAgP8AgIACgP8AgICAAoD9gAEAgAAAAgAAAAACgAKAAAkADQAAETMRIRUhFSEVIQEzFSOAAYD+gAGA/gACAICAAoD/AICAgAEAgAAAAAAFAAAAAAKAAoAAAwAHAA8AEwAXAAATIRUhIzMVIyUzESM1ITUhBTMVIzMhFSGAAYD+gICAgAIAgID/AAEA/gCAgIABgP6AAoCAgID+gICAgICAAAAEAAAAAAOAAoAACwAPABMAFwAAETMRMzUzESM1IxEjASEVKQEzESMpARUhgICAgICAAYABgP6AAYCAgP6AAYD+gAKA/wCA/oCA/wACgID+gIAAAAADAAAAAAKAAoAACQANABEAABMhESMRITUhNSEjMxUjFTMRI4ACAID+gAGA/oCAgICAgAKA/YABAICAgID/AAAABQAAAAACgAKAAAMACwAPABMAFwAAEyEVISMzFSEVIRUjATMVIxUzFSMpARUhgAGA/oCAgAEA/wCAAgCAgICA/oABgP6AAoCAgICAAYCAgICAAAAABQAAAAACgAKAAAMABwALAA8AEwAAEyEVISMzFSMzIRUpATMVIykBFSGAAgD+AICAgIABgP6AAYCAgP4AAgD+AAKAgICAgIAAAgAAAAAAgAOAAAMABwAAETMVIxUzESOAgICAA4CAgP2AAAAABAAA/4ACgAOAAAMABwALAA8AAAEzFSMVMxEjATMRIzMhFSECAICAgID+AICAgAGA/oADgICA/YABAP8AgAAAAAMAAAAAA4ACgAANABEAFQAAEyERIRUhFSEVIREjESMlMxUjITMVI4ABgAEA/wABAP6AgIACgICA/QCAgAKA/wCAgIACAP6AgICAAAACAAAAAAMAAoAAEQAVAAARMxEzETMRIRUhFSEVIREjESMBMxUjgICAAQD/AAEA/oCAgAKAgIACgP8AAQD/AICAgAEA/wABAIAAAAAAAgAAAAADAAOAABEAFQAAEzMVMxUjFSEVIREhFSERIzUzATMRI4CAgIABgP6AAYD+AICAAgCAgAOAgICAgP8AgAKAgP6A/wAAAgAAAAADAAMAABEAFQAAEzMVMxUjFSEVIRUhFSERIzUzATMVI4CAgIABgP6AAYD+AICAAgCAgAMAgICAgICAAgCA/oCAAAAAAwAAAAACgAOAAAMADwATAAATIRUhIzMRIREzESMRIREjMyEVIYABgP6AgIABgICA/oCAgAGA/oADgID/AAEA/YABAP8AgAAAAwAAAAACgAKAAAMADwATAAATIRUhIzMVITUzESM1IRUjMyEVIYABgP6AgIABgICA/oCAgAGA/oACgICAgP6AgICAAAAGAAAAAAMAA4AAAwAHAAsADwATABcAABEzESMBMxUrATMRIyEzESMBMxErATMVI4CAAoCAgICAgP6AgIABAICAgICAA4D+AAIAgP6A/wABAP8AgAAGAAAAAAMAAoAAAwAHAAsADwATABcAABEzESMBMxUrATMRIyEzFSMlMxUrATMVI4CAAoCAgICAgP6AgIABAICAgICAAoD+gAGAgP8AgICAgAAAAAABAAAAAAMAA4AADQAAEyEVIRUzFSMRIxEjNTOAAoD+AICAgICAA4CAgID+AAIAgAABAAAAAAKAAoAADQAAEyEVIRUzFSMRIxEjNTOAAgD+gICAgICAAoCAgID/AAEAgAAJAAD/gAQAA4AAAwAPABMAFwAbAB8AIwAnAC8AABEzFSMlMxEzFSMRIxEjNTMBMxUjITMVIyUzFSMFMxUjJTMVIyEzESMBMxEzESM1I4CAAYCAgICAgIABgICA/YCAgAIAgID+AICAAgCAgP2AgIADAICAgIADgICA/wCA/gACAIABAICAgICAgICA/oABgP8A/wCAAAAAAAUAAP+AAwACgAADAA8AEwAXAB8AABEzESMBMxEzFSMRIxEjNTMBMxEjBTMRIwEzFTMRIzUjgIABAICAgICAgAEAgID+AICAAgCAgICAAoD/AAEA/wCA/wABAIABAP8AgP8AAQCA/wCAAAAAAAUAAP+AAwADgAAHAAsADwATABsAABEzESEVIREjATMVKwEzFSMVMxUjOwERMxEjNSOAAQD/AIACAICAgICAgICAgICAgAOA/wCA/gADgICAgID/AP8AgAAFAAD/gAKAAoAABwALAA8AEwAZAAARMxEzFSMRIwEzFSsBMxUjFTMVIzMhESM1I4CAgIABgICAgICAgICAAQCAgAKA/wCA/wACgICAgID/AIAAAAABAAD/gAMAA4AADwAAETMRIREzETMRIzUjESERI4ABgICAgID+gIADgP8AAQD9AP8AgAIA/gAAAAEAAP+AAwACgAAPAAARMxEhETMRMxEjNSMRIREjgAGAgICAgP6AgAKA/wABAP4A/wCAAQD/AAAABQAAAAACgAOAAAMABwALAA8AEwAAETMVIyUzFSMhMxUjJTMVKwEzESOAgAIAgID+gICAAQCAgICAgAOAgICAgICA/YAAAAAABQAA/4ACgAKAAAMABwALAA8AEwAAETMRIwEzESMhMxUjJTMVKwEzESOAgAIAgID+gICAAQCAgICAgAKA/wABAP8AgICA/oAABQAAAAACgAOAAAMABwALAA8AGwAAETMVIyUzFSMhMxUjJTMVKwEzFTMVIxEjESM1M4CAAgCAgP6AgIABAICAgICAgICAgAOAgICAgICAgID+gAGAgAAAAAUAAP+AAoACgAADAAcACwAPABsAABEzESMBMxEjITMVIyUzFSsBMxUzFSMVIzUjNTOAgAIAgID+gICAAQCAgICAgICAgIACgP8AAQD/AICAgICAgICAAAACAAAAAAKAA4AABwALAAARMxEhFSERIwEzESOAAYD+gIACAICAA4D/AID+AAIA/gAAAAAAAwAAAAACgAOAAAcACwAPAAARMxEzFSMRIwEhFSkBMxEjgICAgAEAAQD/AAEAgIADgP6AgP6AAoCA/gAAAQAAAAABgAOAAAsAABEhFSMRMxUhNTMRIwGAgID+gICAA4CA/YCAgAKAAAAEAAAAAAKAA4AAAwAHABEAFQAAEyEVISMzFSMlMxEjESERIxEhASEVIYABgP6AgICAAgCAgP6AgAIA/oABgP6AA4CAgID9gAEA/wABgP6AgAAAAAADAAAAAAKAAoAAAwANABEAABEhFSkBMxEjNSEVIxEhASEVIQIA/gACAICA/oCAAgD+gAGA/oACgID+gICAAQD/AIAAAAMAAAAAAoADgAADAA8AEwAAEyEVISMzESERMxEjESERIzMhFSGAAYD+gICAAYCAgP6AgIABgP6AA4CA/wABAP2AAQD/AIAAAAMAAAAAAoACgAADAA8AEwAAEyEVISMzFSE1MxEjNSEVIzMhFSGAAYD+gICAAYCAgP6AgIABgP6AAoCAgID+gICAgAAAAgAAAAACgAOAAAkADQAAATMRITUhNSE1IQUzFSMCAID+AAGA/oABgP4AgIADgPyAgICAgIAAAAAFAAAAAAKAA4AAAwAHAAsADwATAAARMxEjATMRKwEzFSMpARUhJTMVI4CAAgCAgICAgP8AAQD/AAGAgIADgP0AAwD9gICAgIAAAAAAAwAAAAACgAOAAAMACwAPAAATIRUhIzMRIRUhESMBMxEjgAGA/oCAgAIA/gCAAgCAgAOAgP6AgP8AAwD/AAAAAAMAAAAAAwADgAADAAcAEwAAEyEVISMzESMBMxEzFSMRIxEhNSGAAYD+gICAgAIAgICAgP6AAYADgID+gAGA/oCA/wABAIAAAAMAAAAAAwADgAADAAcADwAAEyEVISMzESMBMxEzFSMRI4ABgP6AgICAAgCAgICAA4CA/oABgP6AgP8AAAMAAAAAAoADgAAHAAsADwAAETMRIRUhESMlMxUjKQEVIYACAP4AgAIAgID+gAGA/oADgP8AgP6AgICAAAQAAAAAAoADgAADAAcACwAVAAATIRUhIzMVIyUzESMhMxUhNTMVMxUhgAGA/oCAgIACAICA/gCAAQCAgP2AA4CAgID+AICAgIAAAAABAAAAAAKAA4AACQAAETMRIRUhESEVIYACAP4AAgD9gAOA/wCA/oCAAAAAAAMAAAAAAoADgAADAAkADQAAEyEVISMzESEVIQEzFSOAAYD+gICAAgD9gAIAgIADgID9gIADAIAABQAAAAADAAOAAAMABwAPABMAFwAAEyEVISMzESMBMxEjESE1IQUzESMzIRUhgAIA/gCAgIACgICA/wABAP6AgICAAQD/AAOAgP0AAwD9gAEAgID/AIAAAAMAAAAAAwADgAALAA8AEwAAATMRMxUjESMRITUhBTMRIzMhFSECAICAgID+gAGA/gCAgIABgP6AA4D/AID+gAGAgID+gIAAAAIAAAAAAoADgAAHAAsAABEzESEVIREjATMRI4ABgP6AgAIAgIADgP8AgP4AAgD+gAAAAAABAAAAAAIAA4AABQAAETMRIRUhgAGA/gADgP0AgAAAAAMAAAAAAwADgAAJAA0AEQAAETMRIREjESMRIwEzESMpARUhgAEAgICAAoCAgP8AAQD/AAOA/wD+AAGA/gACgP4AgAAABwAAAAACgAOAAAMABwANABEAFQAZAB0AABEzFSMlIRUpAhUjFSMlMxUjITMRIwEzESMpARUhgIABgAEA/wD/AAEAgIABAICA/oCAgAIAgID+gAGA/oADgICAgICAgID+gAGA/oCAAAACAAAAAAKAA4AAAwALAAARMxEjATMRIxEhNSGAgAIAgID+gAGAA4D+gAEA/QABgIAAAAAABAAAAAACgAOAAAMABwALAA8AABEhFSkBMxUjKQEVKQEzESMCAP4AAgCAgP4AAgD+AAIAgIADgICAgP4AAAAAAAcAAAAAAoADgAADAAcACwAPABMAFwAfAAATIRUhIzMRIwEzESMhMxUjJTMVIyEzFSMlMxUhFSE1M4ABgP6AgICAAgCAgP6AgIABAICA/oCAgAEAgAEA/gCAA4CA/wABAP6AgICAgICAgIAAAAMAAAAAAwADgAADAAcADQAAEyEVISMzESMBMxEzFSGAAYD+gICAgAIAgID/AAOAgP8AAQD9gIAAAgAAAAACgAOAAAMADwAAEyEVISMzFSEVIREhETMRIYABgP6AgIABgP6AAYCA/YADgICAgP6AAYD+AAAAAwAAAAADAAOAAAMACQANAAARMxEjASEVIxEjKQEVIYCAAgABAICA/oABgP6AA4D9AAMAgP2AgAAHAAAAAAKAA4AAAwAHAAsADwATABcAGwAAEyEVISMzFSMlMxEjKQEVKQEzESMlMxUjMyEVIYABgP6AgICAAgCAgP4AAgD+AAIAgID+AICAgAGA/oADgICAgP8AgP8AgICAAAAAAwAAAAACgAOAAAUACQANAAARIREjESMBMxUjKQEVIQEAgIACAICA/wABAP8AA4D9AAKA/gCAgAAFAAAAAAKAA4AABwALAA8AEwAXAAARIRUhFSM1IRczFSsBMxEjJTMVIykBFSECgP8AgP8AgICAgICAAgCAgP6AAYD+gAOAgICAgID+gICAgAAAAAADAAAAAAKAA4AAAwAHAAsAABMhFSEjMxEjATMRI4ABgP6AgICAAgCAgAOAgP0AAwD9AAAABgAAAAACgAOAAAMABwALAA8AFQAZAAATIRUhIzMVIyUzESsBMxUrATMRITUhFyEVIYABgP6AgICAAgCAgICAgICA/oABAIABAP8AA4CAgID/AID/AICAgAAAAAADAAAAAAKAA4AABwALAA8AABMhFSMRIxErATMRIwEzESOAAYCAgICAgIACAICAA4CA/oABgP8AAQD9AAAFAAAAAAKAA4AAAwAJAA0AEQAZAAATIRUhIzMVMxUhATMRIwEzESM7ARUzFSE1IYABgP6AgICA/wACAICA/wCAgICAgP2AAYADgICAgAEA/gABAP8AgICAAAAAAAMAAAAAAwADgAADAAcADwAAEyEVISMzESMBMxEzFSMVI4ABgP6AgICAAgCAgICAA4CA/QADAP4AgIAAAAMAAAAAAoADgAADAAcACwAAETMRIwEzESMpARUhgIACAICA/oABgP6AA4D9AAMA/QCAAAACAAAAAAKAA4AABwALAAABMxEjESE1IQEzESMCAICA/oABgP4AgIADgPyAAQCAAQD/AAAABwAAAAACgAOAAAMABwALAA8AEwAXABsAABMhFSEjMxEjATMVIwUhFSkBMxEjJTMVIzMhFSGAAYD+gICAgAIAgID+gAGA/oABgICA/gCAgIABgP6AA4CA/wABAICAgP8AgICAAAMAAAAAAoADgAADAAcACwAAEyEVISMzESMBMxUjgAGA/oCAgIACAICAA4CA/QADAIAAAAAHAAAAAAKAA4AAAwAHAAsADwATABcAGwAAEyEVISMzESMBMxEjKQEVISMzFSMlMxEjKQEVIYABgP6AgICAAgCAgP6AAYD+gICAgAIAgID+gAGA/oADgID/AAEA/wCAgID/AIAAAQAAAAACAAOAAAcAABEzESEVIREjgAGA/oCAA4D/AID+AAAAAwAAAAACgAOAABMAFwAbAAABMxUzFSMRMxUjFSM1IzUzESM1MwUzESMBMxEjAQCAgICAgICAgICA/wCAgAIAgIADgICA/oCAgICAAYCAgP6AAYD+gAAAAAMAAAAAAoADgAADAA8AEwAAEyEVISMzESEVIRUhFSEVIwEzESOAAYD+gICAAYD+gAIA/gCAAgCAgAOAgP8AgICAgAMA/wAAAAQAAAAAAoADgAADAAcACwAPAAATIRUhIzMRIwEzESMpARUhgAGA/oCAgIACAICA/oABgP6AA4CA/YACgP2AgAAEAAAAAAKAA4AAEQAVABkAHQAAEyERMxUjETMVITUzESM1MzUrATMVIwUzESMlMxUjgAEAgICA/oCAgICAgICAAgCAgP4AgIADgP8AgP6AgIABgICAgID+gICAAAIAAAIAAQADgAADAAcAABEzESM7ARUjgICAgIADgP8AgAAAAAIAAAIAAQADgAADAAcAABMzESsBMxUjgICAgICAA4D/AIAAAAIAAAKAAQADgAADAAcAABMzFSsBMxUjgICAgICAA4CAgAAAAAEAAAIAAYADgAAHAAABMxEhFSMRIQEAgP8AgAEAA4D/AIABAAAAAAACAAACgAEAA4AAAwAHAAARMxUjOwEVI4CAgICAA4CAgAAAAAADAAACAAGAA4AAAwAHAAsAABMzFSsBMxEjATMVI4CAgICAgAEAgIADgID/AAEAgAABAAACgAKAA4AABQAAETMVIRUhgAIA/YADgICAAAAAAAQAAAAAAoACgAAFAAkADQARAAARIRUjESMBMxUrATMRIwEzESMBAICAAYCAgICAgAEAgIACgID+AAKAgP8AAQD+AAAABAAAAAACgAKAAAMACQANABEAABEzESMBMxEhNTMBMxErATMVI4CAAgCA/wCA/wCAgICAgAKA/gACAP2AgAEA/wCAAAADAAD/gAKAAoAACwAPABMAABEzFTMVIxUhFSERIwEhFSkBMxUjgICAAgD+AIABAAEA/wABAICAAoCAgICA/wADAICAAAMAAP+AAwACgAADABMAFwAAEyEVISUzETMVIxEjESE1ITUjNTMhMxEjgAEA/wABgICAgID+gAGAgID+AICAAoCAgP6AgP8AAQCAgID/AAAAAgAA/4ADAAKAAAUADQAAESEVIREjATMRMxUjFSMCAP6AgAIAgICAgAKAgP4AAgD+gICAAAMAAAAAAoADgAAHAA8AEwAAETMRIRUhESMBMxEjNSM1MwUhFSGAAQD/AIACAICAgID+gAEA/wADgP8AgP6AAQD+gICAgIAAAAMAAP+AAwACgAADABEAFQAAEyEVISUzETMVIREhNSE1IzUzITMRI4ABAP8AAYCAgP8A/oABgICA/gCAgAKAgID9gIABAICAgP8AAAABAAD/gAIAA4AACwAAETMRIRUhESERIzUhgAGA/oABgID+gAOA/wCA/oD/AIAAAAADAAD/gAKAAoAACQANABEAABEzFTMVIxEhFSEBIRUpATMRI4CAgAIA/YABAAEA/wABAICAAoCAgP6AgAMAgP6AAAAAAAUAAP+AAoACgAAHAAsAEwAXABsAABEzFTMVIxEjASEVKQEzESM1IzUzBTMVIzsBFSOAgICAAQABAP8AAQCAgICA/wCAgICAgAKAgID+AAMAgP6AgICAgIAAAAAAAgAAAAADAAOAAA0AEQAAATMRMxUjESE1IREhNSEFMxEjAgCAgID+AAGA/oABgP4AgIADgP8AgP4AgAGAgID+gAAAAAADAAD/gAKAA4AABwALAA8AABEzETMVIxEjASEVKQEzESOAgICAAQABAP8AAQCAgAOA/oCA/gADAID+AAABAAD/gAEAAoAABQAAETMRMxUhgID/AAKA/YCAAAAAAAQAAP+AAwADgAAHAAsAEQAVAAARMxEzFSMRIwEzFSMlMxEhNTMBMxEjgICAgAEAgIABgID/AID/AICAA4D+gID+AAMAgID9gIABgP6AAAAACAAAAAACgAOAAAMABwALAA8AEwAXABsAHwAAEzMVKwEzFSMlIRUpAhUhIzMRIwEzFSM7AREjKQEVIYCAgICAgAGAAQD/AP8AAQD/AICAgAGAgICAgID+gAGA/oADgICAgICA/oABgID/AIAAAwAA/4ACgAOAAAMACwAPAAARMxEjATMRIxEjNTMFIRUhgIACAICAgID+gAEA/wADgP2AAgD8gAGAgICAAAAAAAMAAAAAAoADgAAHAAsADwAAETMRMxUjESMBIRUpATMRI4CAgIABAAEA/wABAICAA4D+gID+gAKAgP4AAAYAAAAAAoADgAADAAkADQARABkAHQAAETMVIzMhESM1IRUhFSEjMxEjATMRIzUjNTMFIRUhgICAAgCA/oABgP6AgICAAgCAgICA/oABAP8AA4CA/wCAgID/AAEA/oCAgICAAAACAAD/gAMAAoAABQALAAARIRUhESMBMxEzFSECAP6AgAIAgID/AAKAgP4AAgD+AIAAAAAABAAAAAACgAOAAAMACwATABcAABMhFSEjMxUhFSERIwEzESM1IzUzBSEVIYACAP4AgIABgP6AgAIAgICAgP6AAQD/AAOAgICA/oABgP4AgICAgAAAAgAAAAADAAOAAAcACwAAASEVIxEhNSEBMxEjAgABAID+AAGA/gCAgAOAgP0AgAIA/gAAAAMAAP+AAoACgAADAAcACwAAATMRIyUzFSMzIRUhAgCAgP4AgICAAYD+gAKA/YCAgIAAAAACAAAAAAMAA4AABQALAAARIREjESMFMxEhNSEBAICAAoCA/gABgAOA/QACgID9gIAAAAAABQAA/4ACgAKAAAMABwALAA8AFQAAEyEVISMzFSMlMxEjKQEVISMzFSEVIYABgP6AgICAAgCAgP6AAYD+gICAAgD9gAKAgICA/wCAgIAAAAADAAAAAAKAAoAABwALAA8AABEzFTMVIxEjASEVKQEzESOAgICAAQABAP8AAQCAgAKAgID+gAKAgP4AAAAEAAD/gAKAAoAAAwAJAA0AEwAAETMVIzMhESM1IRUhFSEjMxUhFSGAgIACAID+gAGA/oCAgAIA/YACgID/AICAgICAAAQAAP+AAoACgAADAAsADwATAAARMxEjATMRIzUjNTMBMxErATMVI4CAAgCAgICA/wCAgICAgAKA/gACAP0AgIABAP8AgAAAAAUAAP+AAoACgAADAAcACwAPABUAABMhFSEjMxEjATMRIykBFSEjMxUhFSGAAYD+gICAgAIAgID+gAGA/oCAgAIA/YACgID/AAEA/wCAgIAAAwAAAAACgAKAAAUACQAPAAARIRUhESMBMxErATMVMxUhAgD+gIACAICAgICA/wACgID+AAIA/wCAgAAAAgAAAAACgAKAAAMACQAAETMRIwEzESE1IYCAAgCA/gABgAKA/gACAP2AgAACAAD/gAMAA4AACQANAAABMxEzFSE1ITUhATMRIwIAgID/AP6AAYD+AICAA4D8gICAgAIA/gAAAAMAAAAAA4ACgAADAAsADwAAETMRIwEhFSERITUhATMRI4CAAYABgP8A/oABAAGAgIACgP4AAgCA/gCAAYD+AAACAAD/gAKAAoAABQAJAAARIRUhESMBMxEjAgD+gIACAICAAoCA/YACgP4AAAMAAP+AAoACgAAJAA0AEQAAEyERIzUhNSERISMzESMRIRUhgAIAgP6AAYD+gICAgAIA/gACgP2AgIABAP8A/wCAAAAAAQAAAAACAAKAAAUAABEzESEVIYABgP4AAoD+AIAAAAADAAD/gAOAA4AACwAPABMAAAEzESEVIREjNSE1IQEzESMBMxEjAYCAAQD/AID/AAEA/oCAgAMAgIADgP8AgP2AgIACAP4AAYD+AAAAAwAA/4ADAAKAABEAFQAZAAATMxUzFSEVIRUhFSEVIzUjNTMBIRUpATMVI4CAgAEA/oACAP4AgICAAQABAP8AAQCAgAKAgICAgICAgIACAICAAAAABAAAAAACgAKAAAMABwALAA8AABMhFSEjMxEjATMRIykBFSGAAYD+gICAgAIAgID+gAGA/oACgID+gAGA/oCAAAQAAP+AAoADgAAVABkAHQAhAAATIREzFSMRMxUjFSM1IzUzESM1MzUrATMVIwUzESMlMxUjgAEAgICAgICAgICAgICAgAIAgID+AICAA4D/AID+gICAgIABgICAgID+gICAAAADAAAAAAMAA4AAAwANABEAABEzESMBMxEhFSE1IzUzBTMVI4CAAYCAAQD+gICA/wCAgAOA/QABgP6AgICAgIAAAwAA/4ADAAKAAAsADwATAAABMxEzFSMRIxEhNSEBMxUjMyEVIQIAgICAgP8AAQD+AICAgAGA/oACgP8AgP8AAQCA/wCAgAAAAgAAAYACgAKAAAMABwAAETMVIzMhFSGAgIACAP4AAoCAgAAAAwAAAAACgAOAAAMABwAbAAATIRUhIzMVIyUzETMVIxUzFSMVIzUhNSE1ITUhgAEA/wCAgIABgICAgICAgP8AAQD/AAEAA4CAgID/AICAgICAgICAAAAAAAEAAAIAAoACgAADAAARIRUhAoD9gAKAgAAAAAACAAAAAACAAoAAAwAHAAARMxUjETMVI4CAgIACgID+gIAAAAACAAAAAAGAAoAAAwAJAAATIRUhIzMRIRUhgAEA/wCAgAEA/oACgID+gIAAAAUAAAAAAoACgAADAAcADwATABcAABEzFSMlMxEjJTMVIREjNSEjMxEjJTMVI4CAAgCAgP6AgAEAgP8AgICAAgCAgAKAgID/AICA/wCA/wCAgAAAAAIAAAAAAoACgAADAAsAABEhFSkBMxEzFSE1IQGA/oABgICA/YABgAKAgP6AgIAAAAUAAAAAAgACgAADAAcACwAPABMAABEhFSkBMxErATMVIyUzESMlMxUjAQD/AAEAgICAgIABAICA/oCAgAKAgP8AgID/AICAAAEAAAAAAoACgAAHAAARIRUjESMRIQKAgID+gAKAgP4AAgAAAAIAAAAAAoACgAAFAAkAABEhESMRIRUzESMCgID+AICAAoD9gAIAgP6AAAAAAQAAAAAAgAKAAAMAABEzESOAgAKA/YAAAQAAAAABgAKAAAcAABEhFSMRIxEjAYCAgIACgID+AAIAAAAAAgAAAAACgAKAAAUACQAAESEVIREjATMRIwIA/oCAAgCAgAKAgP4AAgD+AAAEAAAAAAKAAoAAAwAHAAsADwAAETMRIwEhFSkBMxEjKQEVIYCAAQABAP8AAQCAgP6AAYD+gAKA/gACAID+gIAAAQAAAYAAgAKAAAMAABEzESOAgAKA/wAAAQAA/4ACgAKAAAUAABEhESMRIQKAgP4AAoD9AAKAAAADAAAAAAKAAoAAAwAHAAsAABEhFSkBMxEjKQEVIQIA/gACAICA/gACAP4AAoCA/oCAAAAAAwAAAAACgAMAAAcACwAPAAARMxUhESMRIQEzFSsBMxUjgAIAgP4AAYCAgICAgAMAgP6AAQD/AICAAAAAAQAAAAACgAKAAAkAABEhFSERIREzESECAP6AAYCA/YACgID+gAGA/gAAAAAFAAAAAAKAAoAAAwAHAAsAEQAVAAARMxUjJSEVISMzFSMlMxEhNTMBMxEjgIABAAEA/wCAgIABgID/AID+AICAAoCAgICAgP4AgAEA/oAAAAEAAP+AAIACgAADAAARMxEjgIACgP0AAAIAAAAAAYACgAADAAkAABEhFSkBMxEhNSEBAP8AAQCA/oABAAKAgP4AgAAABAAAAAACgAKAAAMABwALAA8AABMhFSEjMxEjATMRIykBFSGAAYD+gICAgAIAgID+gAGA/oACgID+gAGA/oCAAAUAAP+AAoACgAADAAcACwAPABMAABMzESMBMxEjJTMVIzsBFSMpARUhgICAAYCAgP8AgICAgID+gAGA/oACgP6AAYD+AICAgIAAAAACAAD/gAKAAoAABwALAAARIRUhFTMVIQEzESMCAP6AgP8AAgCAgAKAgICAAQD9gAADAAAAAAKAAoAABwALAA8AABEhFSEVIRUhATMRIykBFSECAP6AAQD+gAIAgID+AAIA/gACgICAgAEA/oCAAAAABQAA/4ACgAKAAAMABwALAA8AEwAAETMVIyUzESMlMxEjJTMVKwEzESOAgAIAgID+gICAAQCAgICAgAKAgID/AID/AICA/oAABQAAAAACgAKAAAMABwALAA8AFQAAETMVIyUzESMlMxUjMyEVKQEzESE1IYCAAgCAgP6AgICAAQD/AAEAgP2AAgACgICA/wCAgID/AIAAAAAEAAD/gAKAAoAABQAJAA0AEQAAESERIzUhFTMRIwEzFSsBMxEjAoCA/gCAgAGAgICAgIACgP8AgID+AAIAgP8AAAAAAAIAAAAAAoACgAADAAcAABEhFSkBMxEjAgD+AAIAgIACgID+AAAAAAADAAAAAAKAAoAABwALABEAABEzETMVIxUjATMRIwEzESE1IYCAgIABAICAAQCA/gABgAKA/wCAgAIA/wABAP2AgAAAAAIAAAAAAoACgAAJAA0AABEhFSERITUzESMhMxEjAgD/AP8AgIACAICAAoCA/gCAAYD+AAACAAAAAAGAAoAAAwAHAAARMxEjATMRI4CAAQCAgAKA/YACgP2AAAAAAgAAAAABgAKAAAMABwAAETMRIwEzESOAgAEAgIACgP8AAQD9gAAAAAIAAAGAAYACgAADAAcAABEzESMBMxEjgIABAICAAoD/AAEA/wAAAAACAAABAAEAAoAAAwAHAAATMxErATMVI4CAgICAgAKA/wCAAAAEAAABAAIAAoAAAwAHAAsADwAAEzMRIwEzESMhMxUjJTMVI4CAgAEAgID+gICAAQCAgAKA/wABAP8AgICAAAAAAwAAAAACgAOAAAsADwATAAARMxEhESM1IREzFSEBMxUrATMVI4ACAID+gID/AAGAgICAgIADgP8A/wCA/oCAAYCAgAAEAAAAAAKAA4AABwALAA8AEwAAESEVIRUjNSMVMxEjJTMVIykBFSECgP6AgICAgAIAgID+gAGA/oADgICAgID+AICAgAAAAAADAAAAAAOAA4AAAwANABEAABMzFSMlMxEhFSERITUhATMRI4CAgAGAgAEA/oD+gAGA/gCAgAOAgID9AIABgIABAP8AAAEAAAAAA4ADgAAJAAARIREhFSERIRUjAoABAP6A/oCAA4D9AIADAIAAAAAABAAAAAACgAOAAAsADwATABcAABEhFSEVMxUhNTM1IREzESMBMxEjKQEVIQKA/wCA/oCA/wCAgAIAgID+gAGA/oADgICAgICA/wD+gAGA/oCAAAAAAQAAAAACgAOAAAcAABEhESMRIRUjAoCA/oCAA4D8gAMAgAAAAQAAAAADgAOAAA0AABEhESERIzUjESMRIRUjAoABAICAgP6AgAOA/wD/AID+AAMAgAAAAAQAAAAAA4ADgAAJAA0AEQAVAAARIREzFSMRIxEhBSEVKQEzESMpARUhAYCAgID/AAIAAQD/AAEAgID+gAGA/oADgP6AgP8AAoCAgP6AgAAAAgAAAAADgAOAAA0AEQAAEyERIREjNSMRITUhESEjMxEjgAIAAQCAgP4AAYD+gICAgAOA/wD/AID+AIACgP2AAAEAAAAAAoADgAAFAAARIREjESECgID+AAOA/IADAAAAAgAAAAACgAOAAAcADwAAETMVIRUhESMBMxEjNSE1IYABgP6AgAIAgID+gAGAA4CAgP6AAYD9gICAAAAABAAAAAADgAOAAAsADwATABcAABEhETMVIxEjESMVIykBFSkBMxEjKQEVIQGAgICAgIACAAEA/wABAICA/oABgP6AA4D+gID/AAKAgID+gIAAAAAAAwAAAAADAAOAAA0AEQAVAAARIREzFSMRIxEhNSE1IREzESMzIRUhAoCAgID+gAGA/gCAgIABgP6AA4D/AID+gAGAgID/AP6AgAAAAAIAAAAAAoADgAAJAA0AABEhFSEVIRUhESMBMxEjAoD+AAGA/oCAAgCAgAOAgICA/gACAP4AAAAABwAAAAADgAOAAAMABwALAA8AEwAXABsAABMhFSEjMxEjATMRKwEzFSMlMxUjKQEVISUhFSGAAYD+gICAgAIAgICAgIABgICA/YABAP8AAYABAP8AA4CA/YACgP4AgICAgICAAAMAAAAAA4ADgAAFAAkADQAAESERIxEhJTMRIykBFSEBgID/AAMAgID+gAGA/oADgP0AAoCA/QCAAAAAAAIAAAAAAwADgAAFAA0AABEhESMRIyUzESMRITUhAQCAgAKAgID+gAGAA4D+gAEAgPyAAYCAAAAAAwAAAAADgAOAAAkADQARAAABMxEhESM1IxEjATMRIzMhFSECAIABAICAgP4AgICAAYD+gAOA/wD/AID+gAEA/wCAAAADAAAAAAKAA4AAAwAHAAsAABEzESMBMxEjKQEVIYCAAgCAgP6AAYD+gAOA/QABAP8AgAAAAgAAAAACgAOAAAsADwAAESEVIRUhFSERIRUhATMVIwIA/oABgP6AAgD9gAIAgIADgICAgP6AgAMAgAAABQAAAAADgAOAAAMABwANABEAFQAAEyEVISMzESMBMxEzFSkCFSElMxUjgAGA/oCAgIACAICA/wD+gAGA/oACgICAA4CA/YACgP4AgICAgAADAAAAAAKAA4AADwATABcAABMhFSMRMxUjESMRIzUzESsBMxEjATMRI4ABgICAgICAgICAgIACAICAA4CA/oCA/wABAIABgP6AAYD+gAAAAAEAAAAAAoADgAAPAAABMxEhESM1IxEjESERMxUzAQCAAQCAgID/AICAA4D/AP8AgP4AAgABAIAAAwAAAAACgAOAAAMABwALAAATIRUhIzMRIwEzESOAAYD+gICAgAIAgIADgID9AAMA/QAAAAIAAAAAAoADgAADAAsAABEzESMBMxEjESE1IYCAAgCAgP6AAYADgP6AAYD8gAGAgAAAAAAEAAAAAAKAA4AAAwALAA8AEwAAETMRIwEzESMRITUhATMVIzMhFSGAgAIAgID+gAGA/gCAgIABgP6AA4D+gAGA/QABAID/AICAAAAAAgAAAAACgAOAAAcACwAAETMRIRUhESMBMxEjgAGA/oCAAgCAgAOA/wCA/gACAP4AAAAAAAQAAP+AAoADgAADAAcACwATAAATIRUhIzMRIwEzFSMRMxEjNSE1IYABgP6AgICAAgCAgICA/oABgAOAgP2AAoCA/oD+gICAAAIAAAAAA4ADgAAPABMAAAEzESERIzUjESE1IREhNSEFMxEjAgCAAQCAgP4AAYD+gAGA/gCAgAOA/wD/AID+AIABgICA/oAAAAIAAAAAAoADgAAPABMAABEhFSEVIRUhFSERIzUjESMBMxUjAgD+gAGA/oABAICAgAIAgIADgICAgID/AID/AAMAgAAABgAAAAACgAOAAAMABwALAA8AEwAXAAATIRUhIzMVIzMhFSkBMxEjJTMVIzMhFSGAAgD+AICAgIABgP6AAYCAgP4AgICAAYD+gAOAgICA/oCAgIAAAgAAAAACgAOAAAkADQAAETMRIRUhESEVIQEzESOAAYD+gAIA/YACAICAA4D+gID/AIADgP6AAAAIAAD/gAKAA4AABwALAA8AEwAXABsAHwAjAAARIREjNSEVIzsBESMBMxErATMVKwEzESMBMxUjOwEVIyEzFSMCgID+gICAgIABAICAgICAgICAAQCAgICAgP4AgIADgP8AgID/AAEA/wCA/wABAICAgAAAAAMAAAAAA4ADgAAHAAsADwAAESERIxEjFSMBMxEjKQEVIQGAgICAAwCAgP6AAYD+gAOA/QACgID/AP8AgAAAAAACAAAAAAKAA4AABwALAAARMxEhFSERIwEzFSOAAYD+gIACAICAA4D/AID+AAIAgAAEAAAAAAKAA4AABQAJAA0AEQAAETMVIRUpATMRIyUzFSMzIRUhgAGA/gACAICA/gCAgIABgP6AA4CAgP4AgICAAAAAAAMAAAAAAoADgAADAAsADwAAEzMVIyUzESMRITUhATMRI4CAgAGAgID+gAGA/gCAgAOAgID8gAGAgAEA/wAAAAADAAAAAAKAA4AAAwAHAA8AABEzESMBMxEjKQEVIxEjESOAgAIAgID+gAGAgICAA4D+gAGA/oCA/oABgAADAAAAAAOAA4AAEwAXABsAAAEhFSEVIRUhFSEVIREhNSE1ITUhATMVIwEzFSMBgAGA/wABAP8AAQD/AP6AAQD/AAEAAYCAgP0AgIADgICAgICA/wCAgIABgID+gIAAAAAGAAAAAAKAA4AAAwAHAAsADwATABcAABEhFSkBMxUjKQEVISMzESMlMxUjKQEVIQIA/gACAICA/oABgP6AgICAAgCAgP6AAYD+gAOAgICA/oCAgIAAAAAABQAAAAACgAOAAAUACQANABEAFwAAESERIzUhBTMVKwEzFSsBMxUrATMVIRUhAoCA/gABgICAgICAgICAgIACAP2AA4D/AICAgICAgIAAAAAEAAAAAAKAAoAABQAJAA0AEQAAATMVMxUpATMRIyUzFSMzIRUhAQCAgP8AAQCAgP4AgICAAYD+gAKAgID/AICAgAAAAAQAAAAAAoADgAAJAA0AEQAVAAARIREzFSE1MxEhETMRIwEzESMpARUhAYCA/oCA/wCAgAIAgID+gAGA/oADgP6AgIABAP6A/wABAP8AgAAABQAA/4ACgAKAAAMACQANABEAFQAAESEVKQEzESE1IQUzESMBMxEjKQEVIQGA/oABgID+gAEA/oCAgAIAgID+gAGA/oACgID/AICA/wABAP8AgAAACAAA/4ACgAKAAAMABwALAA8AEwAXAB8AIwAAEzMVIyUzFSMhMxEjATMVIyUzFSsBMxUjITMVMxUhNTMFMxUjgICAAQCAgP6AgIABAICAAQCAgICAgP8AgID+gIABAICAAoCAgID/AAEAgICAgICAgICAAAAFAAD/gAKAAoAAAwAHAAsADwATAAATIRUhIzMVIyUzESMlMxUjMyEVIYABgP6AgICAAgCAgP4AgICAAYD+gAKAgICA/gCAgIAAAAAABwAA/4ACgAKAAAMABwALAA8AEwAXABsAABMhFSEjMxUjJTMVIykBFSkBMxEjJTMVIzMhFSGAAYD+gICAgAIAgID/AAEA/wABAICA/gCAgIABgP6AAoCAgICAgP8AgICAAAAAAAUAAAAAAoADgAADAAcAEwAXABsAABMzFSsBMxEjATMRMxUjESMRIzUzBTMRKwEzFSOAgICAgIABAICAgICAgAEAgICAgIADgID/AAEA/wCA/wABAICA/wCAAAAABgAAAAACgAKAAAMABwALAA8AEwAXAAATMxUjJTMVIyEzESMBMxEjATMRIyUzFSOAgIABAICA/oCAgAEAgIABAICA/oCAgAKAgICA/oABgP6AAYD+AICAAAUAAAAAAoACgAADAAcACwAPABMAABMhFSEjMxEjATMRIyEzFSMlMxUjgAGA/oCAgIACAICA/oCAgAEAgIACgID+gAGA/oCAgIAAAAAGAAD/gAKAAoAAAwAHAAsADwATABcAAAEzFSM7ARUrATMVIzsBESMlMxUjMyEVIQGAgICAgICAgICAgID+AICAgAGA/oACgICAgP8AgICAAAsAAP+AA4ACgAADAAcACwAPABMAFwAbAB8AIwAnACsAABMzFSMlMxUjJTMVIyEzESMBMxUjJTMVIyUzESMpARUhIzMVIyUhFSkBMxUjgICAAQCAgAEAgID9gICAAQCAgAEAgIABAICA/YABAP8AgICAAYABAP8AAQCAgAKAgICAgID/AAEAgICAgP8AgICAgIAAAAAFAAAAAAKAA4AAAwALAA8AEwAXAAATIRUpATMRIxEjNTMlIRUhIzMRIzMhFSGAAYD+gAGAgICAgP6AAQD/AICAgIABgP6AA4CA/YABAICAgP6AgAAEAAAAAAKAA4AACQANABEAFQAAESEVIREzFSMRIwEhFSkBMxEjKQEVIQKA/gCAgIABAAEA/wABAICA/oABgP6AA4CA/wCA/wACAID+gIAAAAcAAAAAAoACgAADAAcACwAPABMAFwAbAAATMxUjJTMVIyEzESMBMxEjATMRIyEzFSMlMxUjgICAAQCAgP6AgIABAICAAQCAgP6AgIABAICAAoCAgID+gAGA/wABAP6AgICAAAAHAAD/gAKAA4AAAwAHAAsADwATABcAGwAAETMVIzMhFSkBMxEjKQEVKQEzESMlMxUjMyEVIYCAgAGA/oABgICA/wABAP8AAQCAgP4AgICAAYD+gAOAgID/AID/AICAgAAFAAD/gAKAAoAABwALAA8AEwAXAAABIREjESMVIyUzFSM7ARUjBzMVIzMhFSEBAAGAgICA/wCAgICAgICAgIABgP6AAoD9gAIAgICAgICAgAAAAAAIAAAAAAKAA4AAAwAHAA8AEwAXABsAHwAjAAABMxUjKQEVISMzFTMVIxEjATMVKwEzFSMlMxEjITMVIyUzFSMCAICA/oABgP6AgICAgIABgICAgICAAQCAgP6AgIABAICAA4CAgICA/wABgICAgP8AgICAAAQAAAAAAoADgAADAAcACwAPAAARMxEjATMVIzsBESMpARUhgIABgICAgICA/oABgP6AA4D9AAIAgP6AgAAAAAAGAAD/gAKAAwAAAwAHAA8AEwAXABsAAAEzFSsBMxUjJTMRIxUjETMFMxEjATMRIykBFSEBAICAgICAAQCAgICA/oCAgAIAgID+gAGA/oADAICAgP8AgAEAgP6AAYD+gIAAAAAABwAA/4ACgAKAAAMABwALAA8AEwAXABsAABMzFSMlMxUjITMVIyUzFSMlMxEjJTMVIzMhFSGAgIABAICA/oCAgAEAgIABAICA/gCAgIABgP6AAoCAgICAgICA/gCAgIAACgAA/4ACgAKAAAMABwALAA8AEwAXABsAHwAjACcAABMzFSMlMxUjITMVIyUzFSMlMxEjJTMVIyEzFSMhMxUjJTMVIykBFSGAgIABAICA/oCAgAEAgIABAICA/oCAgAEAgID/AICAAYCAgP8AAQD/AAKAgICAgICAgP8AgICAgICAgAAABAAA/4ACgAOAAAcACwAPABMAAAEzESMRITUhBTMVIwczFSMzIRUhAgCAgP8AAQD+gICAgICAgAGA/oADgPyAAYCAgICAgIAABwAA/4ACgAKAAAMABwALAA8AEwAbAB8AABMzFSMlMxUjITMRIwEzFSMlMxEjITMVMxUhNTMFMxUjgICAAQCAgP6AgIABAICAAQCAgP6AgID+gIABAICAAoCAgID/AAEAgID/AICAgICAAAAABAAA/4ACgAKAAAMACwAPABMAABMzFSMlMxEjNSE1IQEzESMRIRUhgICAAYCAgP6AAYD+AICAAgD+AAKAgID9gICAAQD/AP8AgAAAAAcAAAAAAoADgAADAAcACwAPABcAGwAfAAATMxUjJTMVIyEzFSMlMxUjJTMRIxEhNSEFMxEjMyEVIYCAgAEAgID+gICAAQCAgAEAgID/AAEA/oCAgIABAP8AA4CAgICAgICA/YABAICA/wCAAAQAAAAAAoADgAADAA8AEwAXAAATIRUhIzMVIRUhFSEVIREjATMVIxMzESOAAQD/AICAAQD/AAGA/oCAAYCAgICAgAOAgICAgID/AAMAgP6A/wAAAAcAAP+AAoACgAADAAcACwAPABMAFwAbAAATMxUjJTMVIyEzESMBMxUrATMVIzsBESMpARUhgICAAQCAgP6AgIACAICAgICAgICA/oABgP6AAoCAgID+AAIAgID/AIAAAAQAAAAAAoADgAAHAAsADwATAAABMxEjESM1MyUhFSEjMxEjMyEVIQIAgICAgP6AAQD/AICAgIABgP6AA4D9AAEAgICA/oCAAAkAAP+AAoADgAADAAcADwATABcAGwAfACMAJwAAEzMVIyUzFSMhMxEhFSEVIwEzFSMlMxUjETMVIyEzESMBMxErATMVI4CAgAEAgID+gIABgP6AgAEAgIABAICAgID+gICAAQCAgICAgAOAgICA/wCAgAIAgICA/wCA/wABAP8AgAAAAAYAAP+AAoADgAADABcAGwAfACMAJwAAESEVKQEzFTMVIxUzFSMVIzUjNTM1IzUzBTMVIwMzFSMlMxUjKQEVIQGA/oABgICAgICAgICAgID/AICAgICAAgCAgP6AAYD+gAOAgICAgICAgICAgICA/wCAgICAAAAAAAMAAAAAAoADgAAHAAsADwAAETMRIRUhESMBMxEjKQEVIYABgP6AgAIAgID+gAGA/oADgP6AgP8AAQD/AIAAAAAEAAD/gAIAA4AACwAPABMAFwAAATMRMxUjESMRIzUzEzMRIyUzFSMzIRUhAQCAgICAgICAgID+gICAgAEA/wADgP8AgP8AAQCA/oD/AICAgAAAAAAIAAAAAAKAA4AAAwAHAAsADwATABcAGwAfAAABIRUpATMVIykBFSkBMxUjKQEVKQEzFSMlMxUjKQEVIQEAAQD/AAEAgID/AAEA/wABAICA/wABAP8A/wCAgAIAgID+gAGA/oADgICAgICAgICAgAAACgAAAAADAAOAAAMABwAPABMAFwAbAB8AIwAnACsAABMzFSMlMxUjITMRMxUjESMBMxEjATMVKwEzFSM7ARUrATMVIzsBFSMpARUhgICAAYCAgP4AgICAgAEAgIABgICAgICAgICAgICAgICA/gACAP4AA4CAgID/AID/AAKA/wABAICAgICAgAAAAAAIAAD/gAKAAoAAAwAHAAsADwATABcAGwAfAAATIRUhIzMRIwEzESMhMxUjJTMVKwEzFSsBMxUjJTMVI4ABgP6AgICAAgCAgP6AgIABAICAgICAgICAAQCAgAKAgP8AAQD/AICAgICAgIAAAAAEAAD/gAKAAoAACQANABEAFQAAESEVIxEhNTM1IQEzESMlMxUjMyEVIQKAgP8AgP6AAgCAgP4AgICAAYD+gAKAgP8AgID/AP8AgICAAAAAAAgAAP+AAoADgAADAAcACwAPABMAFwAbAB8AABMhFSEjMxUjMyEVKQEzFSMpARUpATMRIyUzFSMzIRUhgAEA/wCAgICAAYD+gAGAgID/AAEA/wABAICA/gCAgIABgP6AA4CAgICAgP8AgICAAAUAAP+AAoADgAADAAcAGwAfACMAABMhFSEjMxUjJTMVMxUjFTMVIxEjESE1ITUhNSEBMxEjMyEVIYABAP8AgICAAYCAgICAgID/AAEA/wABAP6AgICAAQD/AAOAgICAgICAgP8AAQCAgID+gP8AgAAFAAD/gAKAA4AAAwAXABsAHwAjAAARIRUpATMVMxUjETMVIxUjNSM1MxEjNTMFMxEjATMRIwMhFSEBAP8AAQCAgICAgICAgICA/wCAgAIAgICAAQD/AAOAgICA/wCAgICAAQCAgP8AAQD/AP8AgAAABgAA/4ACgAKAAAMABwALAA8AEwAXAAARIRUpATMVIykBFSEjMxEjJTMVIykBFSECAP4AAgCAgP6AAYD+gICAgAIAgID+gAGA/oACgICAgP8AgICAAAAAAAQAAP+AAoACgAAHAAsADwATAAARMxEhFSEVIwEzFSM7AREjASEVIYABgP6AgAGAgICAgID+gAIA/gACgP6AgIACgID/AP8AgAAAAAAFAAD/gAKAAoAAAwAHAAsAEwAXAAATIRUhIzMRIwEzESMpARUjFSM1IwUhFSGAAYD+gICAgAIAgID+gAGAgICAAQABAP8AAoCA/wABAP8AgICAgIAAAAAABQAA/4ACgAKAAAMABwALABMAFwAAEyEVISMzESMBMxUjBTMVIRUhNTMFMxUjgAGA/oCAgIACAICA/oCAAQD+AIABgICAAoCA/wABAICAgICAgIAAAwAAAIABgAIAAAMABwALAAARMxUjITMVIyEzFSOAgAEAgID/AICAAgCAgIAAAAAAAgAAAQABgAOAAAsADwAAESEVIRUzFSMVMxUhATMVIwGA/wCAgID/AAEAgIADgICAgICAAQCAAAAGAAD/gAKAAoAAAwAHAAsADwATABcAABMhFSEjMxUjMyEVKQEzESMlMxUjMyEVIYACAP4AgICAgAGA/oABgICA/gCAgIABgP6AAoCAgID/AICAgAAIAAD/gAKAAoAAAwAHAAsADwATABcAGwAfAAARIRUhJSEVISMzFSsBMxUjJTMVIyEzESMBMxEjKQEVIQEA/wABgAEA/wCAgICAgIABAICA/oCAgAIAgID+gAGA/oACgICAgICAgID/AAEA/wCAAAAABAAAAAACgAKAAAMABwALAA8AABMhFSEjMxEjATMRIykBFSGAAYD+gICAgAIAgID+gAGA/oACgID+gAGA/oCAAAIAAAAAAoADgAAHAAsAABMhESE1IREhIzMRI4ACAP4AAYD+gICAgAOA/ICAAoD9gAAAAAADAAAAAAKAA4AACwAPABMAABMhESE1ITUhNSERISMzESMVMxUjgAIA/gABgP6AAYD+gICAgICAA4D8gICAgAGA/oCAgAAAAAAGAAAAAAKAA4AABwALAA8AEwAXABsAABEhESM1IRUjITMVIykBFSEjMxEjJTMVIykBFSECgID+gIABgICA/wABAP8AgICAAgCAgP6AAYD+gAOA/wCAgICA/wCAgIAAAAAFAAAAAAIAA4AACwAPABMAFwAbAAARMxEzFSMVMxUjESMBMxUrATMVIzsBFSsBMxUjgICAgICAAYCAgICAgICAgICAgAOA/wCAgID/AAOAgICAgAAEAAAAAAKAA4AABQAJAA0AEQAAESEVIxEjATMRIzsBESM7AREjAQCAgAEAgICAgICAgIADgID9AAMA/wD/AP8AAAAAAAUAAAAAAoADgAAFAAkADQARABUAABEhFSMRIwEzESM7ARErATMRIwEzESMBAICAAQCAgICAgICAgAEAgIADgID9AAMA/wD/AP8AAQD/AAAABQAAAAACgAOAAAUACQANABEAFQAAESEVIxEjATMRIzsBESsBMxUjJTMRIwEAgIABAICAgICAgICAAQCAgAOAgP0AAwD/AP8AgID/AAAAAAAFAAAAAAKAA4AACQANABEAFQAZAAARIRUjETMRIxEjATMRIzsBESsBMxEjATMRIwEAgICAgAEAgICAgICAgIABAICAA4CA/wD/AP8AAwD/AP8A/wABAP8AAAAAAAIAAAAAAgADgAALAA8AABEzESEVIRUhFSERIwEzFSOAAQD/AAEA/wCAAYCAgAOA/wCAgID/AAIAgAAAAAIAAAAAAgADgAAPABMAABEzFSEVIRUzFSMVIRUhFSMBMxEjgAEA/wCAgAEA/wCAAYCAgAOAgICAgICAgAKA/oAAAAAAAwAAAAABgAOAAAkADQARAAARIRUjFTMVIxEjATMVIxUzFSMBAICAgIABAICAgIADgICAgP4AAwCAgIAABQAAAAACAAOAAAkADQARABUAGQAAESEVIxUzFSMRIwEzFSsBMxUjOwEVKwEzFSMBAICAgIABgICAgICAgICAgICAA4CAgID+AAOAgICAgAAEAAAAAAIAA4AACQANABEAFQAAESEVIxUzFSMRIwEzFSsBMxUjFTMVIwEAgICAgAGAgICAgICAgAOAgICA/gADgICAgIAAAAAFAAAAAAIAA4AACQANABEAFQAZAAARIRUjFTMVIxEjATMVIzsBFSsBMxUjOwEVIwEAgICAgAEAgICAgICAgICAgIADgICAgP4AAwCAgICAAAUAAAAAAoADgAATABcAGwAfACMAAAEzETMVIxUzFSMVIxEjNTM1IzUzJTMVIxUzFSMhMxUjFTMVIwEAgICAgICAgICAgP8AgICAgAIAgICAgAOA/oCAgICAAQCAgICAgICAgICAAAAAAwAAAAABgAOAAAsADwATAAARMxEzFSMVMxUjFSMBMxUjFTMVI4CAgICAgAEAgICAgAOA/oCAgICAAYCAgIAAAAMAAAAAAYADgAALAA8AEwAAATMRIzUjNTM1IzUzBTMVIxUzFSMBAICAgICAgP8AgICAgAOA/ICAgICAgICAgAAFAAAAAAKAA4AAEwAXABsAHwAjAAABMxEzFSMVMxUjESM1IzUzNSM1MwEzFSMVMxUjITMVIxUzFSMBAICAgICAgICAgIABAICAgID+AICAgIADgP8AgICA/wCAgICAAQCAgICAgIAAAAQAAAAAAoADgAAPABMAFwAbAAABMxEzFSMRIzUjNTM1IzUzATMVIwEzFSMVMxUjAQCAgICAgICAgAEAgID+AICAgIADgP8AgP4AgICAgAEAgP8AgICAAAAGAAAAAAIAA4AACQANABEAFQAZAB0AABEhFSMRMxUjESMBMxUjOwEVKwEzFSMVMxUjOwEVIwEAgICAgAEAgICAgICAgICAgICAgAOAgP6AgP8AAwCAgICAgIAAAAUAAACAAYADAAADAAcACwAPABMAAAEzFSsBMxUrATMVIzsBFSM7ARUjAQCAgICAgICAgICAgICAgAMAgICAgIAAAAAAAwAAAAACAAOAAAcACwAPAAARMxEzFSMRIwEzFSM7ARUjgICAgAEAgICAgIADgP4AgP8AAQCAgAADAAAAAAIAA4AABwALAA8AABEzETMVIxEjATMVKwEzFSOAgICAAYCAgICAgAOA/wCA/gADgICAAAMAAAAAAoADgAALAA8AEwAAEzMRMxEjESMRIxEzATMVKwEzFSOAgICAgICAAYCAgICAgAOA/wD/AP6AAYABAAEAgIAACQAAAAACgAOAAAMABwALAA8AEwAXABsAHwAjAAARMxUjJTMVIyEzESMBMxErATMVKwEzESMBMxEjITMVIyUzFSOAgAIAgID+gICAAQCAgICAgICAgAEAgID+gICAAgCAgAOAgICA/wABAP8AgP8AAQD/AICAgAAACwAAAAACgAOAAAMABwALAA8AEwAXABsAHwAjACcAKwAAETMVIyUzFSMhMxEjATMRIyEzFSMlMxUjJTMVIyEzESMBMxEjITMVIyUzFSOAgAIAgID+gICAAQCAgP6AgIABAICAAQCAgP6AgIABAICA/oCAgAIAgIADgICAgP8AAQD/AICAgICA/wABAP8AgICAAAAAAAQAAAAAAgADgAAJAA0AEQAVAAARIRUjETMVIxEjATMVIzsBFSsBMxUjAQCAgICAAQCAgICAgICAgAOAgP6AgP8AAwCAgIAAAAIAAAAAAoADgAAHAA8AABEzESEVIREjATMRIxEjNTOAAQD/AIACAICAgIADgP6AgP6AA4D8gAEAgAAAAAIAAAAAAoADgAALABcAABEzESEVIRUhFSERIwEzESM1IzUzNSM1M4ABAP8AAQD/AIACAICAgICAgAOA/wCAgID/AAOA/ICAgICAAAAFAAAAAAKAA4AAEwAXABsAHwAjAAABMxEzFSMVMxUjESMRIzUzNSM1MyUzFSMlMxUjATMVIyUzFSMBAICAgICAgICAgID/AICAAgCAgP4AgIACAICAA4D/AICAgP8AAQCAgICAgICA/oCAgIAAAAAAAQAAAAABgAOAAAsAABMzETMRIxEjESMRM4CAgICAgIADgP8A/wD+gAGAAQAAAAAAAwAAAAACgAOAAAsADwATAAABMxEzFSMRIxEjNTMlMxUjATMVIwEAgICAgICA/wCAgAIAgIADgP6AgP6AAgCAgID/AIAAAAAAAgAAAAABgAOAAAcACwAAETMRMxUjESMBMxUjgICAgAEAgIADgP6AgP6AAYCAAAAAAwAAAAACgAOAAAsADwATAAABMxEzESMRIxEjETMlMxUjATMVIwEAgICAgICA/wCAgAIAgIADgP8A/wD+gAGAAQCAgP8AgAAAAQAAAAAAgAOAAAMAABEzESOAgAOA/IAAAQAAAAABgAOAAAsAABMzETMRIxEjESMRM4CAgICAgIADgP8A/wD+gAGAAQAAAAAACgAAAAADAAOAAAMABwALAA8AEwAXABsAHwAjACcAAAEzFSsBMxUrATMVIyUzFSMhMxUjJTMVIyEzFSMlMxUrATMVKwEzFSMBAICAgICAgICAAYCAgP8AgIABgICA/wCAgAGAgICAgICAgIADgICAgICAgICAgICAgIAAAAMAAAAAAoADgAATABcAGwAAATMRMxUjFTMVIxEjESM1MzUjNTMFMxUjJTMVIwEAgICAgICAgICAgP8AgIACAICAA4D/AICAgP8AAQCAgICAgICAAAMAAAAAAoADgAALAA8AEwAAATMRMxUjESMRIzUzATMVIwEzFSMBAICAgICAgAEAgID+AICAA4D/AID+AAGAgAEAgP8AgAAAAAIAAAAAAYADgAAHAAsAAAEzESMRIzUzBTMVIwEAgICAgP8AgIADgPyAAYCAgIAAAAMAAAAAAoADgAAHAAsADwAAASEVIxEhNTMBMxUjATMVIwEAAQCA/wCAAQCAgP4AgIADgID9AIACgID+gIAAAAAFAAAAAAIAA4AABwALAA8AEwAXAAARIRUjETMVIQEzFSsBMxUjETMVIzsBFSMBAICA/wABgICAgICAgICAgIADgID9gIADgICA/oCAgAAAAAMAAAAAAoADgAADAA8AEwAAETMVIyUzFTMRIxEjESMRMyUzFSOAgAEAgICAgICAAQCAgAOAgICA/wD+AAIAAQCAgAAABwAAAAABgAOAAAMABwALAA8AEwAXABsAAAEzFSsBMxUrATMVIzMhFSEjMxUjOwEVIzsBFSMBAICAgICAgICAgAEA/wCAgICAgICAgIADgICAgICAgIAAAAMAAAAAAoADgAAFAAsADwAAETMRMxUhASERIxErATMVI4CA/wABgAEAgICAgIADgP4AgAGA/YACAIAAAAEAAAIAAIADgAADAAARMxEjgIADgP6AAAEAAAGAAYADgAAHAAATMxEzESERM4CAgP6AgAOA/wD/AAEAAAMAAAEAAoADgAALAA8AEwAAATMRMxUjFSM1IzUzJTMVIyUzFSMBAICAgICAgP8AgIACAICAA4D+gICAgICAgICAAAAAAwAAAAACgAOAAAsADwATAAABMxUzFSMRIxEjNTMFMxUjJTMVIwEAgICAgICA/wCAgAIAgIADgICA/YACgICAgICAAAACAAAAAAGAA4AABwALAAABMxEjESM1MwUzFSMBAICAgID/AICAA4D8gAKAgICAAAACAAAAAAIAA4AADwATAAABMxEzESMRIxEjETM1IzUzBTMVIwEAgICAgICAgID/AICAA4D+gP8A/wABAAEAgICAgAAAAAUAAAAAAgADgAALAA8AEwAXABsAABEhFSERMxUjESEVIQEzFSsBMxUjFTMVIzsBFSMBgP8AgIABAP6AAYCAgICAgICAgICAA4CA/wCA/wCAAwCAgICAgAADAAAAAAGAA4AACwAPABMAABEzETMVIxUzFSMRIwEzFSMVMxUjgICAgICAAQCAgICAA4D/AICAgP8AAwCAgIAAAwAAAAACAAOAAA8AEwAXAAARIRUhFTMVMxUhFTMVMxUhATMRIxUzESMBgP8AgID/AICA/oABgICAgIADgICAgICAgIADAP8AgP8AAAUAAAAAAgADgAALAA8AEwAXABsAABEzETMVIxUzFSMRIwEzFSsBMxUjETMVIzsBFSOAgICAgIABgICAgICAgICAgIADgP8AgICA/wADgICA/oCAgAAAAAADAAAAAAKAA4AABwAPABMAABEzFTMVIxEjATMRIxEjNTMFMxUjgICAgAIAgICAgP8AgIADgICA/YADgPyAAoCAgIAAAAMAAAAAAoADgAALABcAGwAAETMVMxUjFTMVIxEjATMRIxEjNTM1IzUzBTMVI4CAgICAgAIAgICAgICA/wCAgAOAgICAgP6AA4D8gAGAgICAgIAAAAMAAAAAAoADgAADAA8AEwAAETMRIwEzETMVIxEjESM1MwEzESOAgAEAgICAgICAAQCAgAOA/wABAP8AgP4AAgCAAQD/AAAAAAEAAAAAAYADgAAHAAARIREjESMRIwGAgICAA4D/AP2AAoAAAAIAAAAAAYADgAAHAAsAABEzFTMVIxEjATMVI4CAgIABAICAA4CAgP2AAoCAAAAAAAIAAAAAAgADgAAPABMAABMzFTMVIxUzESMRIxEjETMlMxUjgICAgICAgICAAQCAgAOAgICA/wD/AAEAAQCAgAAIAAAAgAKAAwAAAwAHAAsADwATABcAGwAfAAABMxUrATMVIyUzFSMhMxUjJTMVIyEzFSMlMxUrATMVIwEAgICAgIABAICA/oCAgAIAgID+gICAAQCAgICAgAMAgICAgICAgICAgIAAAAwAAAAAAoADgAADAAcACwAPABMAFwAbAB8AIwAnACsALwAAEzMVIyUzFSsBMxUrATMVIyUzFSMhMxUjJTMVIyEzFSMlMxUrATMVKwEzFSMlMxUjgICAAQCAgICAgICAgAEAgID+gICAAgCAgP6AgIABAICAgICAgICAAQCAgAOAgICAgICAgICAgICAgICAgIAAAAADAAAAAAKAA4AACwAXABsAABEzFTMRIxUzESMVIwEzESM1IxEzNSMRMwEzFSOAgICAgIACAICAgICAgP8AgIADgID/AID/AIADgPyAgAEAgAEA/wCAAAAADACAAAADAAOAAAMABwALAA8AEwAXABsAHwAjACcAKwAvAAABMxUrATMVIyUzFSMhMxUjJTMVIyEzFSMlMxUrATMVKwEzFSMlMxUjITMVIyUzFSMBgICAgICAAQCAgP6AgIACAICA/oCAgAEAgICAgICAgIABAICA/oCAgAIAgIADgICAgICAgICAgICAgICAgICAAAUAAAAAA4ADgAADAAsADwATABcAABEzFSMlIRUjESMRIyUzFSMhMxUjJTMVI4CAAQABgICAgAIAgID9gICAAgCAgAOAgICA/QADAICAgICAAAAAAAUAAAAAAoADgAATABcAGwAfACMAAAEzETMVIxUzFSMRIxEjNTM1IzUzJTMVIyUzFSMBMxUjJTMVIwEAgICAgICAgICAgP8AgIACAICA/gCAgAIAgIADgP8AgICA/wABAICAgICAgID+gICAgAAAAAAFAAAAAAOAA4AABwALAA8AEwAXAAABIRUjESE1MwEzFSsBMxUjATMVKwEzFSMBgAEAgP8AgAGAgICAgID+AICAgICAA4CA/QCAAwCAgP6AgIAAAAADAAAAAAKAA4AACwAPABMAAAEzETMRIxUjNSMRMwEzFSMlMxUjAQCAgICAgID/AICAAgCAgAOA/gD/AICAAQD/AICAgAAAAAAHAAAAAAKAA4AAAwAXABsAHwAjACcAKwAAETMVIyUzFTMRIxUzESMVIzUjETM1IxEzJTMVIwEzFSMlMxUjATMVIyUzFSOAgAEAgICAgICAgICAgAEAgID+AICAAgCAgP4AgIACAICAA4CAgID/AID/AICAAQCAAQCAgP8AgICA/wCAgIAAAAAABAAAAAACgAOAAA8AHwAjACcAABEzFTMVIxUzFSMVMxUjFSMBMxEjNSM1MzUjNTM1IzUzBTMVIxUzFSOAgICAgICAgAIAgICAgICAgID/AICAgIADgICAgICAgIADgPyAgICAgICAgICAgAAAAwAAAAACgAOAAAsADwATAAABMxEzFSMRIxEjNTMFMxEjATMRIwEAgICAgICA/wCAgAIAgIADgP4AgP8AAQCAgP8AAQD/AAAAAQAAAAAAgAGAAAMAABEzESOAgAGA/oAABQAAAAACgAOAABMAFwAbAB8AIwAAATMVMxUjETMVIxUjNSM1MxEjNTMFMxUjJTMVIwUzFSMlMxUjAQCAgICAgICAgICA/wCAgAIAgID+AICAAgCAgAOAgID+gICAgIABgICAgICAgICAgAAABAAAAAACAAOAAAkADQARABUAAAEhESMRIzUzESsBMxUrATMVIzsBFSMBAAEAgICAgICAgICAgICAgAOA/IABAIABgICAgAAAAwAAAAADgAOAAA0AGwAfAAATMxUzFSMRMxUhESM1MykBETMVIxEjNSM1MxErATMVI4CAgICA/wCAgAGAAQCAgICAgICAgIADgICA/wCAAQCA/wCA/wCAgAEAgAABAAABAAEAAgAAAwAAESERIQEA/wACAP8AAAAAAgAAAIAAgAKAAAMABwAAETMVIxEzFSOAgICAAoCA/wCAAAAAAQAAAIACgAMAAAsAAAEzESEVIREjESE1IQEAgAEA/wCA/wABAAMA/wCA/wABAIAAAwAAAAACgAOAAAkADQARAAABIRUjESMRIzUzATMVIwEzFSMBAAEAgICAgAEAgID+AICAA4CA/QABgIABAID/AIAAAAAFAAAAAAKAA4AAAwAXABsAHwAjAAARMxEjATMRMxUjFTMVIxEjESM1MzUjNTMBMxEjATMRIwEzESOAgAEAgICAgICAgICAgAEAgID+AICAAgCAgAOA/wABAP8AgICA/wABAICAgAEA/wD+gP8AAQD/AAAAAAMAAAAAAoADgAATABcAGwAAATMVMxUjETMVIxUjNSM1MxEjNTMFMxEjATMRIwEAgICAgICAgICAgP8AgIACAICAA4CAgP6AgICAgAGAgID+gAGA/oAAAAAEAAAAAAKAA4AABwALAA8AEwAAETMRMxUjESMBMxUjOwERIzsBESOAgICAAQCAgICAgICAgAOA/oCA/oACgID/AP8AAAMAAAAAAoADgAAFAAsADwAAATMRITUzASEVIxEjATMVIwIAgP8AgP4AAQCAgAEAgIADgP2AgAEAgP4AAgCAAAAHAAAAAAOAA4AADwATABcAGwAfACMAJwAAASEVIxEzFSMRIxEjNTMRKwEzFSMlMxUjITMVIyUzFSMhMxUjJTMVIwEAAYCAgICAgICAgICAAgCAgP2AgIADAICA/YCAgAIAgIADgID+gID/AAEAgAGAgICAgICAgICAAAAAAQAAAAACAAOAAAsAABEzESE1MxEjESEVI4ABAICA/wCAA4D+gID9gAGAgAAHAAAAAAEAA4AAAwAHAAsADwATABcAGwAAEzMVKwEzFSM7ARUrATMVIzsBFSsBMxUjOwEVI4CAgICAgICAgICAgICAgICAgICAgAOAgICAgICAgAAFAAAAAAKAA4AAAwAPABMAFwAbAAATMxEjOwEVMxUjFSM1IzUzJTMVIwUzFSMhMxEjgICAgICAgICAgAEAgID+AICAAYCAgAOA/wCAgICAgICAgID/AAAAAwAAAAACgAOAAAcACwAPAAARMxEhFSERIwEzESM7AREjgAEA/wCAAYCAgICAgAOA/wCA/gACAP8A/wAAAwAAAAACgAOAAAsADwATAAABMxEzESM1IxUjETMBMxUjJTMVIwEAgICAgICA/wCAgAIAgIADgP4A/wCAgAEA/wCAgIAAAAAAAgAAAAACgAKAAAMADwAAEyEVISMzFSE1MxEjESERI4ABgP6AgIABgICA/oCAAoCAgID+AAEA/wAAAAAABQAAAAACgAKAAAMABwALAA8AEwAAEyEVISMzESMBMxUjFTMVIykBFSGAAYD+gICAgAIAgICAgP6AAYD+gAKAgP6AAYCAgICAAAAAAAIAAAAAAoACgAAHAAsAABEhFSERIRUhATMRIwIA/oABgP4AAgCAgAKAgP6AgAIA/oAAAAABAAAAAAKAAoAACwAAESEVIRUhFSEVIRUhAoD+AAEA/wACAP2AAoCAgICAgAAAAAACAAD/gACAAwAAAwAHAAARMxEjFTMVI4CAgIADAP2AgIAAAAADAAAAAAKAAoAAAwAHAAsAAAEzESMlMxUjMyEVIQIAgID+AICAgAGA/oACgP4AgICAAAAABQAAAAACgAKAAAcACwAPABMAFwAAETMRIRUhESMBMxUrATMVIxUzFSM7ARUjgAEA/wCAAgCAgICAgICAgICAAoD/AID/AAKAgICAgIAAAAADAAAAAAKAAoAABwAPABMAABEzFTMVIxEjATMRIxEjNTMFMxUjgICAgAIAgICAgP8AgIACgICA/oACgP2AAYCAgIAAAAQAAAAAAoACgAADAAcACwAPAAATIRUhIzMRIwEzESMpARUhgAGA/oCAgIACAICA/oABgP6AAoCA/oABgP6AgAACAAAAAAKAAoAACQANAAARIRUhFSEVIREjATMVIwIA/oABgP6AgAIAgIACgICAgP8AAgCAAAAAAAMAAAAAAoADgAADAA0AEQAAETMRIwEzESE1ITUhNSEFMxUjgIACAID+AAGA/oABgP4AgIADgP4AAgD8gICAgICAAAAAAQAAAAACgAKAAAcAABEhFSERIxEhAoD/AID/AAKAgP4AAgAAAwAAAAACgAKAAAMABwALAAARMxEjATMRIykBFSGAgAIAgID+gAGA/oACgP4AAgD+AIAAAAUAAAAAAoACgAADAAcACwAPABMAABEzESMBMxEjITMVIyUzFSsBMxUjgIACAICA/oCAgAEAgICAgIACgP6AAYD+gICAgIAAAAMAAAAAAoACgAAHAA8AEwAAETMRMxUjFSMBMxEjNSM1MyUzFSOAgICAAgCAgICA/wCAgAKA/oCAgAKA/YCAgICAAAAAAwAAAAACgAKAAAcACwATAAARIRUjFSM1IQUzFSsBMxUhFSE1MwKAgID+gAEAgICAgAGA/YCAAoCAgICAgICAgAAAAAADAAAAAAKAAwAAAwANABEAABMhFSEjMxUhFSERIRUhATMRI4ACAP4AgIABgP6AAYD+AAIAgIADAICAgP8AgAGA/wAAAAUAAP+AAwADgAADAA0AEQAVABkAAAEzFSsBMxEhNSERIzUzJSEVISMzESMFMxUjAoCAgICA/gABgICA/oABAP8AgICAAoCAgAOAgP0AgAEAgICA/oCAgAADAAAAAAIAA4AAAwATABcAAAEhFSEjMxEzFSMRIzUjNTMRIzUzBTMVIwEAAQD/AICAgICAgICAgAEAgIADgID+gID/AICAAQCAgIAAAgAAAAACAAOAAAMAEwAAASEVISMzFSEVIREjESM1MzUjNTMBAAEA/wCAgAEA/wCAgICAgAOAgICA/gABAICAgAAAAAAFAAAAAAKAA4AABQAJAA0AEQAVAAATIREjNSEjMxEjASEVKQEzESMpARUhgAIAgP6AgICAAQABAP8AAQCAgP8AAQD/AAOA/wCA/QACgID+gIAAAAAIAAAAAAKAA4AAAwAHAAsADwATABcAGwAfAAABIRUhIzMVIzsBFSsBMxUjJTMVIyEzESMBMxEjKQEVIQEAAQD/AICAgICAgICAgAEAgID+gICAAgCAgP6AAYD+gAOAgICAgICA/wABAP8AgAAGAAAAAAKAA4AAAwAHAAsADwATABcAAAEzFSsBMxUrATMRIwEzFSM7AREjKQEVIQEAgICAgICAgIABgICAgICA/oABgP6AA4CAgP4AAgCA/oCAAAAFAAAAAAIAA4AAAwAHAAsADwATAAATMxUrATMRIwEzFSM7AREjKQEVIYCAgICAgAEAgICAgID/AAEA/wADgID9gAIAgP6AgAAHAAAAAAKAA4AAAwAHAAsADwAXABsAHwAAETMVIyUzFSMhMxUjJTMVKwEzESM1IzUzBTMVIzsBFSOAgAIAgID+gICAAQCAgICAgICA/wCAgICAgAOAgICAgICA/gCAgICAgAAABQAA/4ADAAKAAAMACwAPABMAGwAAEzMRIwEzESMRITUhBTMVKwEzFSMlMxUhFSE1M4CAgAIAgID+gAGA/gCAgICAgAEAgAEA/gCAAoD/AAEA/YABAICAgICAgICAAAAAAQAAAYABgAIAAAMAABEhFSEBgP6AAgCAAAAAAAEAAAGAAYACAAADAAARIRUhAYD+gAIAgAAAAAABAAABgAMAAgAAAwAAESEVIQMA/QACAIAAAAAAAQAAAYAEAAIAAAMAABEhFSEEAPwAAgCAAAAAAAIAAAIAAQADgAADAAcAABMzFSsBMxEjgICAgICAA4CA/wAAAAIAAAIAAQADgAADAAcAABMzESsBMxUjgICAgICAA4D/AIAAAAIAAP+AAQABAAADAAcAABMzESsBMxUjgICAgICAAQD/AIAAAAQAAAIAAgADgAADAAcACwAPAAATMxUjJTMVIyEzESMBMxEjgICAAQCAgP6AgIABAICAA4CAgID/AAEA/wAAAAAEAAACAAIAA4AAAwAHAAsADwAAEzMRIwEzESMhMxUjJTMVI4CAgAEAgID+gICAAQCAgAOA/wABAP8AgICAAAAABAAA/4ACAAEAAAMABwALAA8AABMzESMBMxEjITMVIyUzFSOAgIABAICA/oCAgAEAgIABAP8AAQD/AICAgAAAAAEAAAAAAoADgAALAAABMxEhFSERIxEhNSEBAIABAP8AgP8AAQADgP8AgP4AAgCAAAEAAAAAAoADgAATAAABMxEhFSEVIRUhESMRITUhNSE1IQEAgAEA/wABAP8AgP8AAQD/AAEAA4D/AICAgP8AAQCAgIAAAQAAAQABAAIAAAMAABEhESEBAP8AAgD/AAAAAAMAAAAAA4AAgAADAAcACwAANTMVIyUzFSMlMxUjgIABgICAAYCAgICAgICAgAAAAAgAAAAAA4ADgAADAAcACwAPABMAFwAbAB8AABEzESMBMxUrATMRKwEzFSsBMxEjJTMRIwEzESMlMxUjgIACAICAgICAgICAgICAAYCAgAEAgID9AICAA4D/AAEAgP8AgP8AgP8AAQD/AICAAAkAAAAABAADgAADAAcACwAPABMAFwAbAB8AIwAAETMRIwEzFSsBMxErATMVKwEzESMlMxEjATMRIwEzESMlMxUjgIACAICAgICAgICAgICAAQCAgAEAgIABAICA/ICAgAOA/wABAID/AID/AID/AAEA/wABAP8AgIAAAAACAAACgAEAA4AAAwAHAAATMxUrATMVI4CAgICAgAOAgIAAAAAEAAACgAIAA4AAAwAHAAsADwAAEzMVIyUzFSMhMxUjJTMVI4CAgAEAgID+gICAAQCAgAOAgICAgICAAAAGAAACgAMAA4AAAwAHAAsADwATABcAABMzFSMlMxUjJTMVIyEzFSMlMxUjJTMVI4CAgAEAgIABAICA/YCAgAEAgIABAICAA4CAgICAgICAgICAAAACAAACgAEAA4AAAwAHAAARMxUjOwEVI4CAgICAA4CAgAAAAAAEAAACgAIAA4AAAwAHAAsADwAAETMVIyUzFSsBMxUjJTMVI4CAAQCAgICAgAEAgIADgICAgICAgAAAAAAGAAACgAMAA4AAAwAHAAsADwATABcAABEzFSMlMxUjJTMVIyEzFSMlMxUjJTMVI4CAAQCAgAEAgID+gICAAQCAgAEAgIADgICAgICAgICAgIAAAAAFAAAAgAGAAwAAAwAHAAsADwATAAABMxUrATMVKwEzFSM7ARUjOwEVIwEAgICAgICAgICAgICAgIADAICAgICAAAAAAAUAAACAAYADAAADAAcACwAPABMAABEzFSM7ARUjOwEVKwEzFSsBMxUjgICAgICAgICAgICAgIADAICAgICAAAARAAAAAAOAA4AAAwAHAAsADwATABcAGwAfACMAJwArAC8AMwA3ADsAPwBDAAARMxUjJTMVIyUzFSMhMxUjJTMVIyEzFSMlMxUjITMVIyUzFSMlMxUjITMVIyUzFSMhMxUjJTMVIyEzFSMlMxUjJTMVI4CAAYCAgAGAgID9gICAAgCAgP6AgIABAICA/gCAgAGAgIABgICA/gCAgAEAgID+gICAAgCAgP2AgIABgICAAYCAgAOAgICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAAAQAAAAAAYADgAADAAcACwAPAAARMxEjATMRIwUzFSMlMxUjgIABAICA/wCAgAEAgIADgP2AAoD9gICAgIAAAAAEAAAAAAKAA4AACwAPABMAFwAAEyEVIxEzFSMVIxErATMVIyUzESMBMxUjgAGAgICAgICAgIACAICA/wCAgAOAgP8AgIACAICA/wD+gIAAAA8AAAAAA4ADgAADAAcACwAPABMAFwAbAB8AIwAnACsALwAzADcAOwAAATMVIyUzFSsBMxUrATMVIyUzFSMFMxUjJTMVIyUzFSMlMxUjITMVIyUzFSMhMxUjJTMVIyUzFSMlMxUjAQCAgAEAgICAgICAgIABAICA/gCAgAEAgIABAICAAQCAgP2AgIACAICA/YCAgAEAgIABAICAAQCAgAOAgICAgICAgICAgICAgICAgICAgICAgICAgAAACAAAAAADgAOAAAMABwALAA8AEwAXABsAHwAAEyEVISUzESMBMxUjJTMRKwEzFSsBMxUjFTMVIyUzFSOAAYD+gAKAgID9AICAAgCAgICAgICAgICAAgCAgAOAgID9gAIAgID/AICAgICAgAAACAAAAAADgAOAAAMABwALAA8AEwAXABsAHwAAETMRIwEhFSEjMxUjJTMRKwEzFSsBMxUjBTMVIyUzFSOAgAGAAYD+gICAgAIAgICAgICAgID+AICAAgCAgAOA/YACgICAgP8AgICAgICAAAAAAwAAAAACAAKAAAUACQANAAARIREjNSEFMxErATMVIwIAgP6AAQCAgICAgAKA/wCAgP8AgAAAAAABAAAAAAMAA4AADwAAESEVMxUjFSMRIxEjESMRIwKAgICAgICAgAOAgICA/gADAP0AAwAABQAAAQABgAKAAAMABwALAA8AEwAAETMVIyUzFSsBMxUrATMVIyUzFSOAgAEAgICAgICAgIABAICAAoCAgICAgICAAAACAAD/gACAAoAAAwAHAAARMxUjETMRI4CAgIACgID+gP8AAAAKAAAAAAGAA4AAAwAHAAsADwATABcAGwAfACMAJwAAETMVIyUzFSsBMxUrATMVIyUzFSMFMxUjJTMVKwEzFSsBMxUjJTMVI4CAAQCAgICAgICAgAEAgID/AICAAQCAgICAgICAgAEAgIADgICAgICAgICAgICAgICAgAAABQAAAAABgAOAAAMABwALAA8AEwAAETMVIyUzESsBMxErATMRIyUzFSOAgAEAgICAgICAgIABAICAA4CAgP8A/oD/AICAAAAACAAAAoAEAAOAAAMABwALAA8AEwAXABsAHwAAEzMVIyUzFSMlMxUjJTMVIyEzFSMlMxUjJTMVIyUzFSOAgIABAICAAQCAgAEAgID8gICAAQCAgAEAgIABAICAA4CAgICAgICAgICAgICAgAAABAAAAQACAAOAAAMABwALAA8AABMhFSEjMxEjATMRIykBFSGAAQD/AICAgAGAgID/AAEA/wADgID+gAGA/oCAAAIAAAEAAIADgAADAAcAABEzFSMVMxEjgICAgAOAgID+gAAAAAIAAAEAAgADgAALAA8AAAEhESM1IREzFSERKwEzFSMBAAEAgP6AgAEAgICAgAOA/YCAAQCAAQCAAAAAAAMAAAEAAgADgAAHAAsADwAAESEVIRUhFSkBMxUjKQEVIQIA/oABAP6AAYCAgP6AAYD+gAOAgICAgIAAAAQAAAEAAgADgAADAAsADwATAAATIRUhIzMVIRUhFSMlMxUjKQEVIYABAP8AgIABAP8AgAGAgID/AAEA/wADgICAgICAgIAAAAMAAAEAAgADgAAHAAsADwAAESERIzUhFSMhMxUrATMRIwIAgP8AgAEAgICAgIADgP8AgICA/wAABwAAAQACAAOAAAMABwALAA8AEwAXABsAABMhFSEjMxUjJTMVIykBFSEjMxUjJTMVIykBFSGAAQD/AICAgAGAgID/AAEA/wCAgIABgICA/wABAP8AA4CAgICAgICAgIAABAAAAQACAAOAAAMABwAPABMAABMhFSEjMxUjJTMRIzUhNSEBIRUhgAEA/wCAgIABgICA/wABAP8AAQD/AAOAgICA/oCAgP8AgAAAAAEAAAGAAYADAAALAAATMxUzFSMVIzUjNTOAgICAgICAAwCAgICAgAABAAACAAGAAoAAAwAAESEVIQGA/oACgIAAAAAAAgAAAYABgAMAAAMABwAAESEVIRUhFSEBgP6AAYD+gAMAgICAAAAAAAMAAAEAAQADgAADAAcACwAAEzMVKwEzESM7ARUjgICAgICAgICAA4CA/oCAAAAAAAMAAAEAAQADgAADAAcACwAAETMVIzsBESsBMxUjgICAgICAgIADgID+gIAAAgAAAQACAAMAAAUACQAAESEVIREjATMRIwGA/wCAAYCAgAMAgP6AAYD+gAAEAAD/gAIAAgAAAwAHAAsADwAAEyEVISMzESMBMxEjKQEVIYABAP8AgICAAYCAgP8AAQD/AAIAgP6AAYD+gIAAAQAA/4ABgAIAAAsAABMzETMVITUzESM1M4CAgP6AgICAAgD+AICAAQCAAAAFAAD/gAIAAgAAAwAHAAsADwAXAAATIRUhIzMVIyUzFSsBMxUrATMVIRUhNTOAAQD/AICAgAGAgICAgICAgAEA/gCAAgCAgICAgICAgAAAAAcAAP+AAgACAAADAAcACwAPABMAFwAbAAATIRUhIzMVIyUzFSsBMxUjITMVIyUzFSMpARUhgAEA/wCAgIABgICAgICA/wCAgAGAgID/AAEA/wACAICAgICAgICAgAAAAAIAAP+AAgACAAALAA8AAAEhESM1IREzFSERKwEzFSMBAAEAgP6AgAEAgICAgAIA/YCAAQCAAQCAAAAAAAMAAP+AAgACAAAHAAsADwAAESEVIRUhFSkBMxUjKQEVIQIA/oABAP6AAYCAgP6AAYD+gAIAgICAgIAAAAQAAP+AAgACAAADAAsADwATAAATIRUhIzMVIRUhFSMlMxUjKQEVIYABAP8AgIABAP8AgAGAgID/AAEA/wACAICAgICAgIAAAAMAAP+AAgACAAAHAAsADwAAESERIzUhFSMhMxUrATMRIwIAgP8AgAEAgICAgIACAP8AgICA/wAABwAA/4ACAAIAAAMABwALAA8AEwAXABsAABMhFSEjMxUjJTMVIykBFSEjMxUjJTMVIykBFSGAAQD/AICAgAGAgID/AAEA/wCAgIABgICA/wABAP8AAgCAgICAgICAgIAABAAA/4ACAAIAAAMABwAPABMAABMhFSEjMxUjJTMRIzUhNSEBIRUhgAEA/wCAgIABgICA/wABAP8AAQD/AAIAgICA/oCAgP8AgAAAAAEAAAAAAYABgAALAAATMxUzFSMVIzUjNTOAgICAgICAAYCAgICAgAABAAAAgAGAAQAAAwAAESEVIQGA/oABAIAAAAAAAgAAAAABgAGAAAMABwAAESEVIRUhFSEBgP6AAYD+gAGAgICAAAAAAAMAAP+AAQACAAADAAcACwAAEzMVKwEzESM7ARUjgICAgICAgICAAgCA/oCAAAAAAAMAAP+AAQACAAADAAcACwAAETMVIzsBESsBMxUjgICAgICAgIACAID+gIAAAwAAAAACgAOAAAMABwAXAAATIRUhIzMRIwEhFSEVMxUjFSEVIREjNTOAAYD+gICAgAEAAYD/AICAAQD+gICAA4CA/oABAICAgICAAQCAAAAFAAAAAAKAA4AABwALAA8AEwAbAAATMxUzNTMRISMzESMBMxUjFTMVIykBESM1IxUjgICAgP6AgICAAgCAgICA/oABgICAgAOAgID/AP6AAYCAgID/AICAAAAAAAYAAAAAAoADgAADAAcACwAPABcAGwAAEyEVISMzESMBMxUjByEVISMzETMVITUzJTMVI4ABgP6AgICAAgCAgIABAP8AgICA/oCAAQCAgAOAgP2AAoCAgID/AICAgIAAAAEAAAAAAwADgAARAAATIRUhFSEVIRUzFSMRIxEjNTOAAoD+AAEA/wCAgICAgAOAgICAgID/AAEAgAAAAAMAAAAAAoADgAADABsAHwAAASEVISMzFTMVIxUzFSMVIRUhNTM1IzUzNSM1MyUzFSMBAAEA/wCAgICAgIABgP2AgICAgIABgICAA4CAgICAgICAgICAgICAgAAAAgAA/4ACgAKAAA0AEQAAATMVMxUjESMRIxEjESEFMxEjAQCAgICAgIABAAEAgIACgICA/gACAP6AAgCA/oAAAAIAAAAAA4ADgAAdACEAABMzFTMVIREzETMVIxUzFSMRIxEhESMRIzUzNSM1MxcVITWAgIABAICAgICAgP6AgICAgICAAQADgICAAQD/AICAgP8AAQD/AAEAgICAgICAAAIAAAAAA4ADgAAnACsAABMzFSE1MxUzFSMVMxUjESM1IzUzNSMVIzUjFTMVIxUjESM1MzUjNTMXFSE1gIABgICAgICAgICAgICAgICAgICAgIABgAOAgICAgICA/oCAgICAgICAgAGAgICAgICAAAAEAAAAAAOAAoAABQALAA8AEwAAESEVIREjATMRITUhATMRIyUzESMCAP6AgAMAgP4AAYD/AICA/wCAgAKAgP4AAoD9gIABgP8AgP8AAAAAAAQAAP+AAwADgAARABUAGQAdAAABMxUzFSMRITUhNSM1MzUjNTMFIRUhIzMRIxEhFSECAICAgP4AAYCAgICA/oABAP8AgICAAoD9gAOAgID+AICAgICAgID/AP8AgAAAAAUAAAAAAwADgAADABcAGwAfACMAAAEhFSEjMxUhFSEVIRUhFSM1IzUzNSM1MyUzFSMRMxUjKQEVIQEAAYD+gICAAQD/AAEA/wCAgICAgAIAgICAgP6AAYD+gAOAgICAgICAgICAgICA/oCAgAAAAAADAAAAAAMAA4AAEwAXABsAABMzESE1MxUzFSMVIzUhESMRIzUzATMVIxEzESOAgAEAgICAgP8AgICAAgCAgICAA4D/AICAgICA/gACAIABAID+gP6AAAAAAQAAAAACgAOAABcAABEhFSEVMxUjFTMVIxEjNSM1MzUjNTMRIQKA/wCAgICAgICAgID/AAOAgICAgID/AICAgIABAAAJAAD/gAKAA4AAAwAHAAsADwATABcAGwAfACMAAAEzFSsBMxEjATMRKwEzESMlMxUrATMVIyUzFSMlMxEjKQEVIQGAgICAgIABAICAgICA/wCAgICAgAEAgIABAICA/wABAP8AA4CA/wABAP8A/wCAgICAgID/AIAAAAAAAgAAAAADgAOAABUAGQAAEyEVIRUjFTMVIRUhESMRIzUzNSM1MxcVITWAAgABAICA/wD+gICAgICAgAGAA4CAgICAgP8AAYCAgICAgIAAAAACAAAAAAKAA4AAGQAdAAABMxUhFSEVIREjNSMVMxUjFSM1IzUzESM1MwUzESMBAIABAP8AAQCAgICAgICAgID/AICAA4CAgID/AICAgICAgAGAgID+gAAAAwAAAAADgAOAAAMAHwAjAAABIRUhIzMVITUzFTMVIxUzFSMRIxEhESMRIzUzNSM1MxcVITUBAAGA/oCAgAGAgICAgICA/oCAgICAgIABgAOAgICAgICAgP8AAQD/AAEAgICAgICAAAADAAAAAAOAA4AAAwAXABsAABMhFSkBMxUzFSEVIRUhFSM1IzUhNSE1IQEhFSGAAgD+AAIAgID+gAGA/YCAgAGA/oACgP6AAgD+AAOAgICAgICAgICAgP4AgAAAAAQAAAAAAoADgAATABcAGwAfAAABMxUzFSMRMxUjFSM1IzUzESM1MwUzESMBMxUjFTMVIwEAgICAgICAgICAgP8AgIACAICAgIADgICA/oCAgICAAYCAgP6AAYCAgIAAAAIAAAAAAoADgAATABcAABMzETMRMxEzFSMRIxEjESMRIzUzATMVI4CAgICAgICAgICAAYCAgAOA/wABAP8AgP6AAYD+AAIAgP4AgAAIAAAAAAOAA4AAAwAHAAsADwAVABkAHQAjAAABIRUhIzMVIzMhFSkBMxEjJSEVIxEjATMVKwEzESMBIRUjFSMBgAIA/gCAgICAAYD+gAGAgID9AAEAgIABgICAgICAAQABAICAA4CAgID/AICA/wABgID/AAEAgIAAAAAAAgAAAAACgAOAAAMACwAAESEVIRUhFSERIxEhAoD9gAKA/wCA/wADgICAgP4AAgAABAAAAAACgAOAAA8AEwAXABsAABEhFSMVMxUhFSM1ITUhNSETMxUjOwEVIzsBFSMCgICA/wCA/wABgP6AgICAgICAgICAA4CAgICAgICA/oCAgIAAAwAAAAADAAOAABUAGQAdAAATMxUhFSEVIRUhESEVIREjNTM1IzUzATMVKwEzFSOAgAEA/wABAP8AAQD+gICAgIACAICAgICAA4CAgICA/wCAAQCAgID/AICAAAAJAAAAAAOAA4AAAwAHAAsAFwAbAB8AIwAnACsAABMzFSsBMxUjJSEVISMzFTMVIxEjNSM1MwEzESMlMxUrATMVIyUzFSMFIRUhgICAgICAAQACAP4AgICAgICAgAKAgID/AICAgICAAQCAgP6AAYD+gAOAgICAgICA/wCAgAEA/wCAgICAgICAAAAAAAMAAAAAAoACgAALAA8AEwAAATMVMxUjESMRIzUzBTMRIwEzESMBAICAgICAgP8AgIACAICAAoCAgP6AAYCAgP6AAYD+gAAAAAIAAAAAAwADgAARABUAABMhFSEVIRUhFSEVIREjESM1MwEzFSOAAgD+gAGA/oABAP8AgICAAgCAgAOAgICAgID/AAEAgAGAgAAAAAADAAAAAAMAA4AAEwAXAB8AAAEzFTM1MxUzFSMRIxEjESMRIzUzBTMRIzsBFSEVITUzAQCAgICAgICAgICA/wCAgICAAgD9AIADgICAgID/AAEA/wABAICA/oCAgIAAAAADAAAAAAKAA4AAFwAbAB8AABMzFTM1MxEhFSEVIRUhESM1IxUjNSMRMwUzFSMVMxUjgICAgP6AAYD+gAGAgICAgIABgICAgIADgICA/wCAgID/AICAgAKAgICAgAAAAAAJAAAAAAOAA4AABwALAA8AEwAdACEAJQApAC0AAAEhFSMVIzUrATMVIyUzFSMhMxEjATMVMzUzESEVIwEzESMhMxUjJTMVIykBFSEBAAGAgICAgICAAgCAgP2AgIABAICAgP8AgAIAgID9gICAAgCAgP6AAYD+gAOAgICAgICA/oABgICA/wCAAYD+gICAgIAAAAAAAwAAAYAEAAOAAA0AFQAZAAARIRUzFSMRIxEjESMRIyUzESMRIzUzBTMVIwIAgICAgICAA4CAgICA/wCAgAOAgID/AAGA/oABgID+AAEAgICAAAAAAQAAAAACgAOAAAkAAAEzESE1ITUhNSECAID9gAIA/wABAAOA/ICAgIAAAAAEAAAAAAKAA4AAAwAJAA0AEQAAEyEVISMzETMVIQEzESMpARUhgAGA/oCAgID/AAIAgID+AAIA/gADgID+gIACAP2AgAAAAAAFAAAAAAKAA4AAAwAHAAsADwATAAABMxErATMVIyUzFSMhMxUjJTMVIwEAgICAgIABAICA/oCAgAIAgIADgP2AgICAgICAAAAIAAAAAAKAA4AAAwAHABMAFwAbAB8AIwAnAAARMxUjJSEVISMzFTMVMxUjFSMRIwEzESMhMxUjFzMVIyUzFSsBMxUjgIABAAEA/wCAgICAgICAAYCAgP4AgICAgIABAICAgICAA4CAgICAgICAAQABAP8AgICAgICAAAAACAAAAAAEAAOAAAcACwAPABMAGQAdACEAJQAAEzMRIxEjNTMlMxUrATMRKwEzFSMlIREjNSkBMxEjJTMRIyUzFSOAgICAgAIAgICAgICAgIABAAGAgP8A/oCAgAIAgID9gICAA4D+AAEAgICA/wCAgP8AgP8AgP8AgIAAAAgAAAAABAADgAAHAAsADwATABkAHQAhACUAABMzESMRIzUzJTMVKwEzESsBMxUjJSERIzUhJTMRKwEzFSMlMxUjgICAgIACAICAgICAgICAAQABgID/AP6AgICAgIACgICAA4D+AAEAgICA/wCAgP6AgID/AICAgAAAAAAJAAAAAAQAA4AABwALAA8AEwAbAB8AIwAnACsAABMzESMRIzUzJTMVKwEzESsBMxUjJSEVIxUjNSMhMxEjJTMVIyEzFSMlIRUhgICAgIACAICAgICAgICAAQABgICAgP6AgIACgICA/QCAgAIAAQD/AAOA/gABAICAgP8AgICAgID/AICAgICAAAAAAAoAAAAABAADgAAFAAkADQATABcAHwAjACcAKwAvAAARIREjNSMlMxUrATMRIyUzFTMVISUzFSMlIRUjFSM1IyEzESMlMxUjITMVIyUhFSEBAICAAoCAgICAgP4AgID/AAGAgIABAAGAgICA/oCAgAKAgID9AICAAgABAP8AA4D/AICAgP8AgICAgICAgICA/wCAgICAgAAACQAAAAAEAAOAAAcACwAPABMAGQAdACEAJQApAAATMxEjESM1MyUzFSsBMxErATMVIyUhFSMVISUzESMlMxUjITMVIyUhFSGAgICAgAIAgICAgICAgIABAAGAgP8A/oCAgAKAgID9AICAAgABAP8AA4D+AAEAgICA/wCAgICAgP8AgICAgIAAAAoAAAAABAADgAAFAAkADQATABcAHQAhACUAKQAtAAARIREjNSMlMxUrATMRIyUzFTMVISUzFSMlIRUjFSElMxEjJTMVIyEzFSMlIRUhAQCAgAKAgICAgID+AICA/wABgICAAQABgID/AP6AgIACgICA/QCAgAIAAQD/AAOA/wCAgID/AICAgICAgICAgP8AgICAgIAAAAAACwAAAAAEAAOAAAcACwAPABMAFwAbACEAJQApAC0AMQAAESEVIxUjNSMlMxUrATMRIyUzFSMpARUhJTMVIyUhFSMVISUzESMlMxUjITMVIyUhFSEBgICAgAKAgICAgID/AICA/wABAP8AAYCAgAEAAYCA/wD+gICAAoCAgP0AgIACAAEA/wADgICAgICA/wCAgICAgICAgID/AICAgICAAAgAAAAAA4ADgAAHAAsADwATABcAGwAhACUAABMzESMRIzUzJTMVKwEzESsBMxUjJTMVIyEzESMBMxUhESElMxUjgICAgIACAICAgICAgICAAQCAgP6AgIABAIABAP6A/oCAgAOA/gABAICAgP8AgICA/wABAID/AICAAAAKAAAAAAOAA4AABQAJAA0AEQAVABkAHQAhACcAKwAAESEVIxUhATMVKwEzESMlMxUjKQEVISUzFSMlMxUjITMRIwEzFSERISUzFSMBgID/AAKAgICAgID/AICA/wABAP8AAYCAgAEAgID+gICAAQCAAQD+gP6AgIADgICAAQCA/wCAgICAgICA/wABAID/AICAAAAACAAAAAAEAAOAAAcACwAPABMAGQAdACcAKwAAEzMRIxEjNTMlMxUrATMRKwEzFSMlIREjNSMhMxEjASEVIxUzNTMRISUzFSOAgICAgAIAgICAgICAgIABgAEAgID+AICAAQABAICAgP6A/oCAgAOA/gABAICAgP8AgID/AID/AAEAgICA/wCAgAAAAAAKAAAAAAQAA4AABwALAA8AEwAXABsAIQAlAC8AMwAAESEVIxUjNSMlMxUrATMRIyUzFSMpARUhJTMVIyUhESM1IyEzESMBIRUjFTM1MxEhJTMVIwGAgICAAoCAgICAgP8AgID/AAEA/wABgICAAYABAICA/gCAgAEAAQCAgID+gP6AgIADgICAgICA/wCAgICAgID/AID/AAEAgICA/wCAgAAAAAoAAAAABAADgAAFAAkADQARABUAGQAfACMALQAxAAARIRUjFSEBMxUrATMRIyUzFSMpARUhJTMVIyUhESM1IyEzESMBIRUjFTM1MxEhJTMVIwGAgP8AAoCAgICAgP8AgID/AAEA/wABgICAAYABAICA/gCAgAEAAQCAgID+gP6AgIADgICAAQCA/wCAgICAgID/AID/AAEAgICA/wCAgAAJAAAAAAQAA4AABQAJAA0AEQAVABsAHwApAC0AABEhESM1ISUzFSsBMxEjJTMRIyUzFSMlIREjNSMhMxEjASEVIxUzNTMRISUzFSMBgID/AAKAgICAgID+gICAAQCAgAGAAQCAgP4AgIABAAEAgICA/oD+gICAA4D/AICAgP8AgP8AgICA/wCA/wABAICAgP8AgIAABgAAAAADAAOAAAcACwAPABMAFwAbAAATMxEjESM1MyUzFSsBMxErATMVKwEzESsBMxUjgICAgIACAICAgICAgICAgICAgICAA4D+AAEAgICA/wCA/wCAAAwAAAAABAADgAADAAcACwAPABMAFwAbACMAJwArAC8AMwAAEzMVIyUzFSMhMxEjATMRIwEzESMhMxUjJTMVIyUhFSMVIzUjITMRIyUzFSMhMxUjJSEVIYCAgAIAgID9gICAAQCAgAEAgID+gICAAQCAgAEAAYCAgID+gICAAoCAgP0AgIACAAEA/wADgICAgP8AAQD/AAEA/wCAgICAgICA/wCAgICAgAAAAAABAAAAgAOAAwAADwAAATMRIRUhESM1IzUjNTM1MwEAgAIA/gCAgICAgAMA/wCA/wCAgICAAAAAAAEAAAAAAoADgAAPAAABMxUzFTMVIREjESE1MzUzAQCAgID/AID/AICAA4CAgID+AAIAgIAAAAAAAQAAAIADgAMAAA8AAAEzFTMVMxUjFSMVIxEhNSECAICAgICAgP4AAgADAICAgICAAQCAAAEAAAAAAoADgAAPAAABMxEhFSMVIxUjNSM1IzUhAQCAAQCAgICAgAEAA4D+AICAgICAgAABAAAAgAQAAwAAGwAAATMRIREzFTMVMxUjFSMVIxEhESM1IzUjNTM1MwEAgAEAgICAgICA/wCAgICAgAMA/wABAICAgICAAQD/AICAgIAAAAIAAACAA4ADgAALABcAAAEzFTMVIxUjNSE1IQEzFSEVIRUjNSM1MwKAgICAgP2AAoD+AIACgP2AgICAA4CAgICAgP8AgICAgIAAAAACAAAAgAQAAwAAGwAfAAABMxUzNTMVMxUhFSEVIxUjNSEVIzUjNSE1ITUhBTMVIwGAgICAgP4AAgCAgP6AgIABAP8AAYACAICAAwCAgICAgICAgICAgICAgIAAAAMAAACABAADAAAHAAsAEwAAATMVMxUhNSEFMxUjKQEVIxUjNSECgICA/IACgAEAgID8gAOAgID9gAMAgICAgICAgIAABAAAAIAEAAMAAAsADwATAB8AAAEzFSE1MxUzFSE1MwUzFSMlMxUjKQEVIxUjNSEVIzUjAQCAAQCAgP0AgP8AgIADgICA/QADAICA/wCAgAMAgICAgICAgICAgICAgIAAAgAAAAADAAOAAAsAFwAAEzMRMxUjFSM1IzUzATMVMxUjESMRIzUzgICAgICAgAGAgICAgICAA4D9gICAgIACgICA/YACgIAABgAAAAADgAOAAAMABwAPABMAFwAbAAARMxEjATMRIykBESM1IRUjOwERIwEzESsBMxUjgIADAICA/YACgID+gICAgIABAICAgICAA4D/AAEA/wD/AICA/wABAP8AgAAABQAAAAACAAOAAAMABwALAA8AEwAAEyEVISMzESMBMxUjETMVIykBFSGAAQD/AICAgAGAgICAgP8AAQD/AAOAgP2AAoCA/oCAgAAAAAYAAAAAAoADgAADAAcADwATABcAGwAAASEVISMzFSMlMxEjNSE1IQUzESMlMxUjKQEVIQEAAQD/AICAgAGAgID+gAGA/gCAgAGAgID/AAEA/wADgICAgP4AgICA/wCAgIAAAAABAAAAAAKAA4AACwAAESERITUhESE1IREhAoD9gAIA/gACAP4AA4D8gIABAIABAAADAAD/gAKAA4AADQARABUAABEhESEVIxEzESM1IREpAREzEQERIRECgP4AgICAAQD/AAGAgP8AAQADgPyAgAEAAQCAAQD/AAEA/oD/AAEAAA0AAAAAA4ADgAADAAcACwAPABMAFwAbAB8AIwAnACsALwAzAAABIRUhJTMVIyEzFSMlMxUjITMRIwEzFSMlMxEjATMVKwEzFSsBMxUjJTMVIyEzFSMlIRUhAQABgP6AAgCAgP2AgIACAICA/YCAgAIAgIABAICA/oCAgICAgICAgAIAgID9gICAAQABgP6AA4CAgICAgID+gAGAgID+gAEAgICAgICAgIAAAAAFAAAAAAKAA4AAAwAHAA8AEwAXAAABIRUhIzMVKwEzFSEVIRUjOwEVIzMhFSEBAAGA/oCAgICAgAIA/gCAgICAgAGA/oADgICAgICAgIAAAAYAAAAAAoADgAAFAAkAGQAdACEAJQAAASERIzUhIzMVKwEzFSE1MxUzFSEVIzUjFSM7ARUrATMVIyUhFSEBAAGAgP8AgICAgIABAICA/wCAgICAgICAgIABAAGA/oADgP8AgICAgICAgICAgICAgAAFAAAAAAKAA4AAAwAHAA8AEwAXAAARIRUpATMVIzsBESM1ITUhAzMVIykBFSEBgP6AAYCAgICAgP4AAgCAgID+gAGA/oADgICA/oCAgP8AgIAAAAAGAAAAAAKAA4AAAwAHAAsAGwAhACUAABEhFSElMxUrATMVKwEzFTM1MxEjNSEVIzUjNSEBMxUhFSEBMxUjAYD+gAIAgICAgICAgICAgP8AgIABAP8AgAEA/oABgICAA4CAgICAgID+gICAgID/AICAAQCAAAUAAAAAAoADgAAFAAkADQARABcAABEhFSEVIzsBFSM7ARUrATMVKwEzFSEVIQKA/gCAgICAgICAgICAgIACAP2AA4CAgICAgICAAAABAAABgAKAAgAAAwAAESEVIQKA/YACAIAAAAAAAgAAAAACgAOAAAMADwAAESEVIQUzESEVIREjESE1IQKA/YABAIABAP8AgP8AAQADgICA/wCA/wABAIAAAQGAAQACgAIAAAMAAAEhESEBgAEA/wACAP8AAAMAAAAAAwADgAAHAAsADwAAASEVIREhNTMBMxUjOwEVIwGAAYD/AP8AgP6AgICAgIADgID9AIABAICAAAUAAAAAA4ADgAAHAA8AEwAXABsAABEhFSMVIzUjJSEVIREhNTMBMxUjKQEVIQUzFSMBgICAgAIAAYD/AP8AgP8AgID/AAEA/wABAICAA4CAgICAgP0AgAIAgICAgAAAAAMAAAAAA4ADgAALABMAFwAAEyERIzUhETMVMzUjJSEVIREhNTMlMxUjgAEAgP8AgICAAYABgP8A/wCA/wCAgAOA/gCAAQCAgICA/QCAgIAABgAAAIADAAKAAAMABwALAA8AEwAXAAATIRUhJSEVKQEzESMBMxEjKQEVISUhFSGAAQD/AAGAAQD/AP4AgIABgICA/wABAP8AAYABAP8AAoCAgID/AAEA/wCAgIAAAAAABwAAAIADgAKAAAMABwALAA8AEwAXABsAABMhFSElIRUpATMRIwEzESMBMxEjKQEVISUhFSGAAQD/AAGAAQD/AP4AgIABgICAAYCAgP2AAQD/AAGAAQD/AAKAgICA/wABAP8AAQD/AICAgAAAAgAAAAABgAOAAAMABwAAETMRIwEzESOAgAEAgIADgPyAA4D8gAAAAAUAAACAAoADAAADAAcACwAPABMAAAEzFSsBMxEjATMRIyEzESMBMxEjAQCAgICAgAEAgID+gICAAgCAgAMAgP8AAQD/AP8AAQD/AAAFAAAAgAKAAwAAAwAHAAsADwATAAARMxEjATMRIyEzESMBMxErATMVI4CAAgCAgP6AgIABAICAgICAAwD/AAEA/wD/AAEA/wCAAAAAAwAAAAACgAOAAAMABwALAAATIRUhIzMRIwEzESOAAYD+gICAgAIAgIADgID9AAMA/QAAAAMAAP+AAoADgAADAAcACwAAASEVISMzESMpARUhAYABAP8AgICA/wABAP8AA4CA/QCAAAAFAAD/gAKAA4AAAwAXABsAHwAjAAABIRUhIzMVMxUjFTMVIxEjESM1MzUjNTMFMxUjJTMVIwEhFSEBgAEA/wCAgICAgICAgICAgP8AgIACAICA/gABAP8AA4CAgICAgP8AAQCAgICAgICA/oCAAAAAAwAAAIACgAMAAAMABwALAAABMxUjATMVIyUzFSMBAICA/wCAgAIAgIADAID+gICAgAAAAAMAAACAAoADAAADAAcACwAAETMVIyUzFSMBMxUjgIACAICA/wCAgAMAgICA/oCAAAgAAACAAwADAAADAAcACwAPABMAFwAbAB8AABMhFSElMxUjITMVIyUhFSEFIRUhJTMVIyEzFSMlIRUhgAEA/wACAICA/YCAgAGAAQD/AP8AAQD/AAIAgID9gICAAYABAP8AAwCAgICAgICAgICAgICAAAAABAAAAQADgAKAAAMABwALAA8AABEzFSMlIRUhBTMVIyUhFSGAgAEAAoD9gP8AgIABAAKA/YACgICAgICAgIAAAAEAAAAAAoADAAATAAABMxUzFSERIRUhFSM1IzUhESE1IQGAgID/AAEA/oCAgAEA/wABgAMAgID/AICAgIABAIAAAAAAAwAAAIADAAMAAAMABwALAAARIRUhFSEVIRUhFSEDAP0AAwD9AAMA/QADAICAgICAAAAAAAEAAAAAAwADgAAbAAABMxUzFSEVIRUhFSEVIRUjNSM1ITUhNSE1ITUhAgCAgP8AAQD+gAGA/gCAgAEA/wABgP6AAgADgICAgICAgICAgICAgIAAAAYAAAAAAoADgAADAAcACwAPABMAFwAAATMVKwEzFSsBMxUjOwEVIzsBFSMFIRUhAYCAgICAgICAgICAgICAgP6AAoD9gAOAgICAgICAgAAABgAAAAACgAOAAAMABwALAA8AEwAXAAATMxUjOwEVIzsBFSsBMxUrATMVIwchFSGAgICAgICAgICAgICAgICAAoD9gAOAgICAgICAgAAAAAAFAAAAAAKAA4AAAwAHAAsADwATAAABIRUhIzMVKwEzESM7ARUjMyEVIQEAAYD+gICAgICAgICAgIABgP6AA4CAgP6AgIAAAAAFAAAAAAKAA4AAAwAHAAsADwATAAARIRUpATMVIzsBESsBMxUjKQEVIQGA/oABgICAgICAgICA/oABgP6AA4CAgP6AgIAAAAAHAAAAAAKAA4AABQAJABEAFQAZAB0AIQAAASERIzUhIzMVKwEzETMRIzUjATMVKwEzFSMBMxUjJSEVIQEAAYCA/wCAgICAgICAgAGAgICAgID/AICAAQABgP6AA4D/AICA/wD/AIABgICA/wCAgIAABwAAAAACgAOAAAMABwAPABMAFwAdACEAABEhFSElMxUrATMVMxEjESsBMxUrATMVKwEzFSEVIQEzFSMBgP6AAgCAgICAgICAgICAgICAgIABAP6AAYCAgAOAgICAgP6AAQCAgICAAQCAAAAABAAAAAACgAOAAAMABwALAA8AABMhFSEjMxEjMyEVIQchFSGAAgD+AICAgIACAP4AgAKA/YADgID+gICAgAAAAAQAAAAAAoADgAADAAcACwAPAAARIRUpATMRIykBFSEVIRUhAgD+AAIAgID+AAIA/gACgP2AA4CA/oCAgIAAAAABAAAAgAKAAwAABwAAETMRIRUhESOAAgD+AIADAP8AgP8AAAABAAAAgAKAAwAABwAAESEVIREjESECgP8AgP8AAwCA/gACAAABAAAAgAKAAwAABwAAATMRIRUhNSEBAIABAP2AAQADAP4AgIAAAAAAAQAAAIACgAMAAAsAABEzFSEVIRUhFSEVI4ACAP4AAgD+AIADAICAgICAAAAGAAAAgAKAAwAAAwAHAAsADwATABcAABEzFSMlMxUjITMVIyUzFSsBMxUjBSEVIYCAAgCAgP6AgIABAICAgICA/wACgP2AAwCAgICAgICAgIAAAAAGAAAAgAKAAwAAAwAHAAsADwATABcAABEhFSEFMxUrATMVIyUzFSMhMxUjJTMVIwKA/YABAICAgICAAQCAgP6AgIACAICAAwCAgICAgICAgIAAAAAGAAAAgAKAAwAAAwAHAAsADwATABcAABEhFSEVMxUjJTMVIyEzFSMlMxUrATMVIwKA/YCAgAIAgID+gICAAQCAgICAgAMAgICAgICAgICAAAMAAAAAAoADgAADAAcACwAAETMRIwEzESMpARUhgIACAICA/oABgP6AA4D9AAMA/QCAAAAFAAABAAGAAoAAAwAHAAsADwATAAARMxUjJTMVKwEzFSsBMxUjJTMVI4CAAQCAgICAgICAgAEAgIACgICAgICAgIAAAA0AAAAAA4ADgAADAAcACwAPABMAFwAbAB8AIwAnACsALwAzAAABIRUhJTMVIyEzFSMlMxUjITMRIwEzFSMlMxEjATMVKwEzFSsBMxUjJTMVIyEzFSMlIRUhAQABgP6AAgCAgP2AgIACAICA/YCAgAIAgIABAICA/oCAgICAgICAgAIAgID9gICAAQABgP6AA4CAgICAgID+gAGAgID+gAEAgICAgICAgIAAAAAGAAAAAAOAA4AAAwAHAAsADwATABsAAAEzFSsBMxUjJTMVIyEzFSMlMxUjITMRIREzESEBgICAgICAAQCAgP6AgIACAICA/YCAAoCA/IADgICAgICAgID+gAGA/gAAAAAKAAAAAAOAA4AAAwAHAAsAJwArAC8AMwA3ADsAPwAAEzMVIyUzFSMhMxUjJTMVMzUzFTMVIxUzFSMVIzUjFSM1IzUzNSM1MxcVMzUBMxUjATMVIyUzFSMhMxUjJTMVI4CAgAIAgID9gICAAQCAgICAgICAgICAgICAgICAAQCAgP0AgIADAICA/YCAgAIAgIADgICAgICAgICAgICAgICAgICAgICAgAEAgP6AgICAgICAAAAEAAAAAAOAA4AACQANABEAFQAAEyEVIREzFSERISMzESMBMxEjKQEVIYACgP8AgP8A/wCAgIADAICA/YACgP2AA4CA/wCAAYD9gAKA/YCAAAQAAAAAA4ADgAALAA8AEwAfAAARIRUjESMRIREjESMBMxUjJTMVIyEzESERMxEzFSE1MwOAgID+gICAAQCAgAEAgID+gIABgICA/ICAA4CA/wABAP8AAQD/AICAgP8AAQD/AICAAAAAAwGA/4ADgAOAAAMABwALAAABIRUhIzMRIwEzESMCAAEA/wCAgIABgICAA4CA/IADgP8AAAMAAP+AAgADgAADAAcACwAAATMRIwEzESMzIRUhAYCAgP6AgICAAQD/AAOA/IABAP8AgAACAAAAgAKAAwAACwAPAAABMxUzFTMVITUzNTMBIRUhAQCAgID9gICA/wACgP2AAwCAgICAgP6AgAAAAAABAAAAgAMAAwAAFwAAETMVMxUzETMVMxUzFSMVIxUjESMVIxUjgICAgICAgICAgICAAwCAgAEAgICAgIABAICAAAAAAAEAAACAAwADAAAXAAABMxEzNTM1MxEjNSM1IxEjNSM1IzUzNTMBAICAgICAgICAgICAgAMA/wCAgP2AgID/AICAgIAAAQAAAIADgAMAABsAABEzFTMVMxEzFTMVMxEzESMRIxUjFSMRIxUjFSOAgICAgICAgICAgICAgAMAgIABAICAAQD9gAEAgIABAICAAAEAAACAA4ADAAAbAAARMxEzNTM1MxEzNTM1MxEjNSM1IxEjNSM1IxEjgICAgICAgICAgICAgIADAP8AgID/AICA/YCAgP8AgID/AAACAAAAgAMAAwAADwATAAARMxUzFTMRMxEjESMVIxUjATMRI4CAgICAgICAAoCAgAMAgIABAP2AAQCAgAKA/YAAAQAAAIABgAMAAAsAAAEzESM1IzUjNTM1MwEAgICAgICAAwD9gICAgIAAAAABAAAAgAGAAwAACwAAETMVMxUzFSMVIxUjgICAgICAAwCAgICAgAAAAQAAAQACgAKAAAsAAAEzFTMVMxUhNTM1MwEAgICA/YCAgAKAgICAgIAAAAABAAABAAKAAoAACwAAESEVIxUjFSM1IzUjAoCAgICAgAKAgICAgIAAAgAAAIABgAMAAAMABwAAETMRIwEzESOAgAEAgIADAP2AAoD9gAAAAAEAAACAAoADAAADAAARIREhAoD9gAMA/YAAAAABAAAAgAKAAwAACwAAEyEVMxEjFSE1IxEzgAGAgID+gICAAwCA/oCAgAGAAAgAAAAAA4ADgAADAAcACwAPABMAFwAbAB8AAAEzESMBMxUjJTMVIyEzESMBMxEjITMVIyUzFSMpARUhAYCAgP8AgIACAICA/YCAgAMAgID9gICAAgCAgP6AAYD+gAOA/oABAICAgP6AAYD+gICAgIAAAAAACQAAAAADgAOAAAMABwALAA8AEwAXABsAHwAjAAABIRUhIzMVIyUzFSMhMxEjATMRIwEzESMhMxUjJTMVIykBFSEBAAGA/oCAgIACAICA/YCAgAGAgIABgICA/YCAgAIAgID+gAGA/oADgICAgID+gAGA/oABgP6AgICAgAAAAAABAAAAAACAA4AAAwAAETMRI4CAA4D8gAABAAABAAQAAYAAAwAAESEVIQQA/AABgIAAAAAAAQGA/4ACgAOAAAMAAAEhESEBgAEA/wADgPwAAAEBgP+ABAABgAAFAAABIRUhESEBgAKA/oD/AAGAgP6AAAAAAAEAAP+AAoABgAAFAAARIREhESECgP8A/oABgP4AAYAAAQGAAQAEAAOAAAUAAAEhESEVIQGAAQABgP2AA4D+AIAAAAAAAQAAAQACgAOAAAUAAAEhESE1IQGAAQD9gAGAA4D9gIAAAAAAAQGA/4AEAAOAAAcAAAEhESEVIREhAYABAAGA/oD/AAOA/gCA/oAAAAEAAP+AAoADgAAHAAABIREhESE1IQGAAQD/AP6AAYADgPwAAYCAAAABAAD/gAQAAYAABwAAESEVIREhESEEAP6A/wD+gAGAgP6AAYAAAAAAAQAAAQAEAAOAAAcAAAEhESEVITUhAYABAAGA/AABgAOA/gCAgAAAAAEAAP+ABAADgAALAAABIREhFSERIREhNSEBgAEAAYD+gP8A/oABgAOA/gCA/oABgIAAAAACAAABAAQAAoAAAwAHAAARIRUhFSEVIQQA/AAEAPwAAoCAgIAAAAAAAgEA/4ADgAOAAAMABwAAASERIQEhESEBAAEA/wABgAEA/wADgPwABAD8AAABAYD/gAQAAoAACQAAASEVIRUhFSERIQGAAoD+gAGA/oD/AAKAgICA/oAAAAEBAP+ABAABgAAJAAABIRUjESERIxEhAQADAID/AID/AAGAgP6AAYD+gAAAAgEA/4AEAAKAAAUACwAAASEVIREhASEVIxEhAQADAP4A/wABgAGAgP8AAoCA/YACAID+gAAAAAABAAD/gAKAAoAACQAAESERIREhNSE1IQKA/wD+gAGA/oACgP0AAYCAgAAAAAEAAP+AA4ABgAAJAAARIREhESMRIREhA4D/AID/AP8AAYD+AAGA/oABgAAAAgAA/4ADgAKAAAUACwAAESERIREhFSERIREhA4D/AP2AAgD/AP8AAoD9AAKAgP4AAYAAAAEBgAEABAADgAAJAAABIREhFSEVIRUhAYABAAGA/oABgP2AA4D/AICAgAAAAQEAAQAEAAOAAAkAAAEhETMRIREzFSEBAAEAgAEAgP0AA4D+AAIA/gCAAAACAQABAAQAA4AABQALAAABIREhFSEBIREzFSEBAAEAAgD9AAGAAQCA/oADgP4AgAKA/wCAAAAAAAEAAAEAAoADgAAJAAABIREhNSE1ITUhAYABAP2AAYD+gAGAA4D9gICAgAAAAQAAAQADgAOAAAkAAAEhETMRIREhNSEBAAEAgAEA/IABAAOA/gACAP2AgAACAAABAAOAA4AABQALAAABIREhNSEBIREhNSEBAAEA/gABAAGAAQD8gAKAA4D+gIABAP2AgAAAAAEBgP+ABAADgAALAAABIREhFSEVIRUhESEBgAEAAYD+gAGA/oD/AAOA/wCAgID+gAAAAAACAQD/gAQAA4AAAwALAAABIREhASERMxUjESEBAAEA/wABgAEAgID/AAOA/AAEAP4AgP6AAAAAAAMBAP+ABAADgAADAAkADwAAASERIQEhETMVIRUhFSMRIQEAAQD/AAGAAQCA/oABgID/AAOA/AAEAP8AgICA/oAAAAAAAQAA/4ACgAOAAAsAAAEhESERITUhNSE1IQGAAQD/AP6AAYD+gAGAA4D8AAGAgICAAAAAAAIAAP+AA4ADgAAHAAsAAAEhESERITUhASERIQEAAQD/AP8AAQABgAEA/wADgPwAAYCAAgD8AAAAAwAA/4ADgAOAAAUACQAPAAABIREhNSEBIREhASERIREhAQABAP4AAQABgAEA/wD9gAIA/wD/AAOA/oCAAQD8AAIA/gABgAAAAgAA/4AEAAKAAAMACwAAESEVIRUhFSERIREhBAD8AAQA/oD/AP6AAoCAgID+gAGAAAAAAAEAAP+ABAABgAALAAARIRUjESERIxEhESEEAID/AID/AP8AAYCA/oABgP6AAYAAAAMAAP+ABAACgAADAAkADwAAESEVIRUhESERISUhFSMRIQQA/AACAP8A/wACgAGAgP8AAoCAgP4AAYCAgP6AAAACAAABAAQAA4AABwALAAABIREhFSE1IQEhFSEBgAEAAYD8AAGA/oAEAPwAA4D/AICA/wCAAAAAAAEAAAEABAADgAALAAABIREzESERMxUhNSEBAAEAgAEAgPwAAQADgP4AAgD+AICAAAMAAAEABAADgAAFAAsADwAAASERITUhASERMxUhBSEVIQEAAQD+AAEAAYABAID+gP2ABAD8AAOA/oCAAQD/AICAgAAAAQAA/4AEAAOAABMAAAEhESEVIRUhFSERIREhNSE1ITUhAYABAAGA/oABgP6A/wD+gAGA/oABgAOA/wCAgID+gAGAgICAAAAAAQAA/4AEAAOAABMAAAEhETMRIREzFSMRIREjESERITUhAQABAIABAICA/wCA/wD/AAEAA4D+AAIA/gCA/oABgP6AAYCAAAAABAAA/4AEAAOAAAUACwARABcAAAEhESE1IQEhETMVIQUhESERISUhFSMRIQEAAQD+AAEAAYABAID+gP2AAgD/AP8AAoABgID/AAOA/oCAAQD/AICA/gABgICA/oAAAAAAAQAAAYAEAAOAAAMAABEhESEEAPwAA4D+AAAAAAEAAP+ABAABgAADAAARIREhBAD8AAGA/gAAAAABAAD/gAQAA4AAAwAAESERIQQA/AADgPwAAAAAAQAA/4ACAAOAAAMAABEhESECAP4AA4D8AAAAAAECAP+ABAADgAADAAABIREhAgACAP4AA4D8AAAQAAD/gAOAA4AAAwAHAAsADwATABcAGwAfACMAJwArAC8AMwA3ADsAPwAAATMVIyUzFSMhMxUjJTMVIyEzFSMlMxUjITMVIyUzFSMhMxUjJTMVIyEzFSMlMxUjITMVIyUzFSMhMxUjJTMVIwEAgIACAICA/QCAgAIAgID/AICAAgCAgP0AgIACAICA/wCAgAIAgID9AICAAgCAgP8AgIACAICA/QCAgAIAgIADgICAgICAgICAgICAgICAgICAgICAgICAgAAAACAAAP+ABAADgAADAAcACwAPABMAFwAbAB8AIwAnACsALwAzADcAOwA/AEMARwBLAE8AUwBXAFsAXwBjAGcAawBvAHMAdwB7AH8AABMzFSMlMxUjJTMVIyUzFSMhMxUjJTMVIyUzFSMlMxUjITMVIyUzFSMlMxUjJTMVIyEzFSMlMxUjJTMVIyUzFSMhMxUjJTMVIyUzFSMlMxUjITMVIyUzFSMlMxUjJTMVIyEzFSMlMxUjJTMVIyUzFSMhMxUjJTMVIyUzFSMlMxUjgICAAQCAgAEAgIABAICA/ICAgAEAgIABAICAAQCAgP2AgIABAICAAQCAgAEAgID8gICAAQCAgAEAgIABAICA/YCAgAEAgIABAICAAQCAgPyAgIABAICAAQCAgAEAgID9gICAAQCAgAEAgIABAICA/ICAgAEAgIABAICAAQCAgAOAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAAAABwAA/4AEAAOAACkALQAxADUAOQA9AEEAABEhFTM1IRUjFTMVMzUjNTM1IREjFTMRIxUhNSM1IxUzFSERMzUjETM1IwUVMzUdATM1BRUzNSEVMzUFFTM1HQEzNQEAgAEAgICAgIABAICAgP6AgICA/oCAgICAAQCAgP8AgAEAgP8AgIADgICAgICAgICA/oCA/oCAgICAgAEAgAGAgICAgICAgICAgICAgICAgICAAAABAAAAgAKAAwAAAwAAESERIQKA/YADAP2AAAAAAgAAAIACgAMAAAMABwAAESERIRMRIRECgP2AgAGAAwD9gAIA/oABgAAAAAABAAAAgAKAA4AACwAAATMRMxEzESERMxEzAQCAgID9gICAA4D/AP8A/wABAAEAAAAEAAAAgAKAA4AAAwAHAAsAEwAAATMRKwEzESMBMxEjITMVITUzESEBAICAgICAAQCAgP6AgAGAgP2AA4D/AP8AAQD/AICA/wAAAAAAAQAAAIADAAMAAAsAABEhFSEVIRUhFSEVIQEAAQABAP8A/wD/AAMAgICAgIAAAAAABAAAAIADAAMAAAcACwAPABMAABEhFSMRMxUhASEVKQIVKQIVIQEAgID/AAEAAQD/AAEAAQD/AP8AAQD/AAMAgP6AgAIAgICAAAAAAAEAAACAAoADgAALAAARIREjESMRIxEjESMCgICAgICAA4D/AP8A/wABAAEAAAAAAAQAAACAAoADgAAHAAsADwATAAARIREjNSEVIzsBESMBMxErATMRIwKAgP6AgICAgAEAgICAgIADgP8AgID/AAEA/wD/AAAAAAEAAACAAwADAAALAAABIREhNSE1ITUhNSECAAEA/wD/AP8AAQABAAMA/YCAgICAAAQAAACAAwADAAAHAAsADwATAAABIREhNTMRIykBFSkCFSkCFSECAAEA/wCAgP8AAQD/AP8AAQD/AAEAAQD/AAMA/YCAAYCAgIAAAAABAAAAgAKAAwAAEwAAATMVMxUzFSMVIxUjNSM1IzUzNTMBAICAgICAgICAgIADAICAgICAgICAgAAAAAAIAAAAgAKAAwAAAwAHAAsADwATABcAGwAfAAABMxUrATMVIyUzFSMhMxUjJTMVIyEzFSMlMxUrATMVIwEAgICAgIABAICA/oCAgAIAgID+gICAAQCAgICAgAMAgICAgICAgICAgIAAAAQAAACAAoADAAADAAcACwAPAAATIRUhIzMRIwEzESMpARUhgAGA/oCAgIACAICA/oABgP6AAwCA/oABgP6AgAAKAAAAAAOAA4AAAwAHAAsADwATABcAGwAfACMAJwAAASEVISMzFSMlMxUjITMRIwEhESETFTM1JTMRIyEzFSMlMxUjKQEVIQEAAYD+gICAgAIAgID9gICAAQABgP6AgIABAICA/YCAgAIAgID+gAGA/oADgICAgID+gAGA/oABAICAgP6AgICAgAAAAAEAAACAAgACgAALAAATIRUzESMVITUjETOAAQCAgP8AgIACgID/AICAAQAAAgAAAQABgAKAAAMABwAAESERIRMVMzUBgP6AgIACgP6AAQCAgAAAAAQAAAEAAYACgAADAAcACwAPAAATMxUrATMVIyUzFSsBMxUjgICAgICAAQCAgICAgAKAgICAgIAADQAA/4AEAAOAAAMABwALAA8AEwAfACMAJwArAC8AMwA3ADsAABEzFSMlMxUjJTMVIyEzFSMlMxUjKQEVMxEjFSE1IxEzITMVIyEzFSMXMxUjJTMVIyEzFSMlMxUjJTMVI4CAAYCAgAIAgID9AICAAoCAgP6AAQCAgP8AgIACAICA/ICAgICAgAKAgID9AICAAgCAgAGAgIADgICAgICAgICAgP8AgIABAICAgICAgICAgICAAAAAAAcAAACABAADgAADAAcACwAPABMAFwAbAAABIRUhIzMVIyUzESMlIRUhIzMRIwEzESMpARUhAgABAP8AgICAAYCAgP2AAQD/AICAgAOAgID9AAMA/QADgICAgP8AgID/AAEA/wCAAAAABgAA/4ADgAOAAAMABwALABcAGwAfAAABIRUhIzMVIyUzFSMhMxUhNTMRIREjESETMxUjOwEVIwEAAYD+gICAgAIAgID9gIACgID+gID+gICAgICAgAOAgICAgICA/wD+gAGA/wCAgAAIAAD/gAOAA4AAAwAHAAsAGwAfACMAJwArAAATMxUjJSEVISUzFSMhMxEhETMVMxUjFSERIxEjJTMVIzsBESMBMxEjKQEVIYCAgAEAAQD/AAGAgID+AIABAICAgP8AgID/AICAgICAAoCAgP4AAgD+AAOAgICAgID/AAEAgICA/wABAICA/oABgP6AgAAAAAALAAAAAAOAA4AAAwAHAAsADwATABcAGwAfACMAJwArAAABMxUjJTMVIyEzFSMlMxUrATMVIykBFSElMxUjITMRIwEzESMBMxUjBSEVIQGAgIABgICA/gCAgAGAgICAgID+gAEA/wACgICA/QCAgAGAgIABAICA/gABAP8AA4CAgICAgICAgICA/wABAP8AAQCAgIAAAQAAAAADgAOAABMAAAEzFTMVIREjESE1IxUhESMRITUzAYCAgAEAgP8AgP8AgAEAgAOAgID/AP6AgIABgAEAgAAAAAAIAAAAAAOAA4AAAwAHAAsAEQAXAB0AIwAnAAABMxUrATMVIyUzFSMpARUjFSMBIREjNSMFMxEzFSEBMxEhNTMlMxUjAYCAgICAgAEAgID+AAEAgIACgAEAgID+AICA/wACAID/AID/AICAA4CAgICAgIABAP8AgID/AIABgP6AgICAAAAFAAAAAAOAA4AACQANABEAFQAdAAARIRUjFSM1IREjATMVKwEzFSM7ARUjJTMRITUzNTMDgICA/gCAAgCAgICAgICAgAEAgP6AgIADgICAgP0AAoCAgICA/oCAgAAAAAAJAAD/gAOAA4AABQAJAA0AEQAVABkAJQApAC0AAAEzFSEVIQEzFSMhMxUjJTMVIyEzFSMlMxUjITMVITUzESERIxEhFzMVIzsBFSMBAIABAP6AAYCAgP2AgIADAICA/YCAgAIAgID9gIACgID+gID+gICAgICAgAOAgIABAICAgICAgICAgP8A/wABAICAgAACAAAAAAOAA4AAGwAfAAATIRUzESMRIzUjESERIREjESERIREjFSMRIxEzATMVI4ACgICAgIABAP8AgP8AAQCAgICAAQCAgAOAgP4A/wCAAQABAP8AAQD/AP8AgAEAAgD9gIAAAwAAAIACgAMAAAMABwALAAARIRUhFSEVIRUhFSECgP2AAoD9gAKA/YADAICAgICAAAAAAAQAAACAAoADAAADAAcACwAPAAARIRUhJSEVIQUhFSEVIRUhAQD/AAGAAQD/AP6AAoD9gAKA/YADAICAgICAgIAAAAAABAAAAIACgAMAAAMABwALAA8AABEhFSEVIRUhJSEVIQUhFSECgP2AAQD/AAGAAQD/AP6AAoD9gAMAgICAgICAgAAAAAAFAAAAgAKAAwAAAwAHAAsADwATAAARIRUhJSEVIQUhFSElIRUhBSEVIQEA/wABgAEA/wD+gAEA/wABgAEA/wD+gAKA/YADAICAgICAgICAgAAAAAAEAAAAgAKAAwAAAwAHAAsADwAAESEVIRUhFSEVIRUhJSEVIQKA/YACgP2AAQD/AAGAAQD/AAMAgICAgICAgAAABQAAAIACgAMAAAMABwALAA8AEwAAESEVISUhFSEFIRUhFSEVISUhFSEBAP8AAYABAP8A/oACgP2AAQD/AAGAAQD/AAMAgICAgICAgICAAAAFAAAAgAKAAwAAAwAHAAsADwATAAARIRUhFSEVISUhFSEFIRUhJSEVIQKA/YABAP8AAYABAP8A/oABAP8AAYABAP8AAwCAgICAgICAgIAAAAYAAACAAoADAAADAAcACwAPABMAFwAAESEVISUhFSEFIRUhJSEVIQUhFSElIRUhAQD/AAGAAQD/AP6AAQD/AAGAAQD/AP6AAQD/AAGAAQD/AAMAgICAgICAgICAgIAAAAUAAACAAoADAAADAAcACwAPABMAABMzESMBMxEjBSEVISMzFSMlMxUjgICAAQCAgP8AAYD+gICAgAIAgIADAP8AAQD/AICAgICAAAAFAAAAgAKAAwAAAwAHAAsADwATAAATMxEjATMRIwUzFSMlMxUjKQEVIYCAgAEAgID+gICAAgCAgP6AAYD+gAMA/wABAP8AgICAgIAABgAAAAADgAOAAAsADwATABcAGwAfAAATIRUzESMVITUjETsBETMRMxEzEQEVMzUhFTM1BRUhNYACgICA/YCAgICAgID+AIABgID+AAGAA4CA/YCAgAKA/wABAP8AAQD+gICAgICAgIAAAAAAAQAA/4AEAAOAABsAAAEhFTMVMxEjFSMVITUjNSMRMxUzFSE1MxEjNSMCAAEAgICAgP4AgICAgAGAgICAA4CAgP4AgICAgAEAgICAAYCAAAACAAAAAAGAAwAADwATAAARIREjFTMVIxUjNSM1MzUjExUzNQGAgICAgICAgICAAwD+gICAgICAgAEAgIAAAAAAAwAAAIACgAMAAAcACwAPAAABIREjNSM1IwUhESETFTM1AQABgICAgP8AAYD+gICAAwD+gICAgP6AAQCAgAAAAAEAAAAAAoADAAATAAABMxUzFTMRIRUzFSE1MzUhETM1MwEAgICA/wCA/oCA/wCAgAMAgID/AICAgIABAIAAAAAIAAAAAAKAAwAAAwAHAAsADwATABcAGwAfAAATMxUjJTMVIyEzESMBMxUjJTMRIyEzFSMlMxUrATMVI4CAgAEAgID+gICAAQCAgAEAgID+gICAAQCAgICAgAMAgICA/oABgICA/oCAgICAAAAIAAAAAAKAAwAAAwAHAAsADwATABcAGwAfAAABMxUrATMVIyUzFSMhMxEjATMRIyEzFSMlMxUrATMVIwEAgICAgIABAICA/oCAgAIAgID+gICAAQCAgICAgAMAgICAgP8AAQD/AICAgIAAAAABAAAAAAKAAwAADwAAEyERMxEhFTMVITUzNSERM4ABgID/AID+gID/AIADAP8A/wCAgICAAQAAAAYAAAAAAoADAAADAAcACwARABcAHwAAATMVKwEzFSMlMxUjITMVMxUhATMRITUzBTMVMxUhNTMBAICAgICAAQCAgP6AgID/AAIAgP8AgP8AgID+gIADAICAgICAgAEA/wCAgICAgAAAAQAAAAACgAMAABMAABMzFTM1MxUzESMVIxUjNSM1IxEzgICAgICAgICAgIADAICAgP6AgICAgAGAAAAAAQAAAAACgAMAABMAAAEzFTMVMxEjFSMVIzUjNSMRMzUzAQCAgICAgICAgICAAwCAgP8AgICAgAEAgAAABAAAAAACgAMAAAcADQATABsAABMhESM1IxUrATMVMxUhATMRITUzBTMVMxUhNTOAAYCAgICAgID/AAIAgP8AgP8AgID+gIADAP8AgICAgAEA/wCAgICAgAAAAAABAAAAAAGAA4AABQAAATMRIREhAQCA/oABAAOA/IABAAAAAAABAAAAAAKAA4AACwAAASEVMxEjNSMRIREhAQABAICAgP6AAQADgID/AID9gAEAAAACAAAAAAOAA4AABwAPAAABIREhESERKQIVIxEhESECAAGA/oABAP8A/wABAID+gAEAA4D9AAEAAYCA/YABAAAAAgAAAAADgAOAAAsADwAAASERIREhESERIREhExUhNQEAAoD+gAEA/oD+gAEAgAGAA4D8gAEAAQD+AAEAAgCAgAAAAAABAAAAAAGAA4AACwAAETMRIREjESMRMxUhgAEAgICA/wADgP6A/oABAP8AgAAAAAACAAAAAAGAA4AACwAPAAARMxEzNTMRIxEjFSMTFTM1gICAgICAgIADgP8AgP0AAQCAAYCAgAAAAAIAAAAAAoADgAAbAB8AAAEzFTMVIxUzFSMRIzUjESM1IzUzNSM1MxEzFTMHFTM1AYCAgICAgICAgICAgICAgICAA4CAgICA/wCA/wCAgICAAQCAgICAAAACAAAAAAOAA4AAAwAHAAARIREhARUzNQOA/IABgIADgPyAAgCAgAAAAwAAAAADgAOAAAMABwALAAARIREhExUzNQEVMzUDgPyAgIABgIADgPyAAwCAgP4AgIAAAAQAAAAAA4ADgAADAAcACwAPAAARIREhExUzNRMVMzUTFTM1A4D8gICAgICAgAOA/IADAICA/wCAgP8AgIAAAAAFAAAAAAOAA4AAAwAHAAsADwATAAARIREhExUzNSEVMzUBFTM1IRUzNQOA/ICAgAGAgP2AgAGAgAOA/IADAICAgID+AICAgIAAAAAABgAAAAADgAOAAAMABwALAA8AEwAXAAARIREhExUzNSEVMzUBFTM1ARUzNSEVMzUDgPyAgIABgID+gID+gIABgIADgPyAAwCAgICA/wCAgP8AgICAgAAAAAcAAAAAA4ADgAADAAcACwAPABMAFwAbAAARIREhExUzNSEVMzUBFTM1IRUzNQEVMzUhFTM1A4D8gICAAYCA/YCAAYCA/YCAAYCAA4D8gAMAgICAgP8AgICAgP8AgICAgAAAAAAEAAD/gAOAA4AACQARABUAGQAAESEVIREhFSERIwEhESE1MxEjKQEVIREhFSEBgP8AAQD/AIACgAEA/wCAgP8AAQD/AAEA/wADgID+gID+gAQA/YCAAYCA/oCAAAEAAP+AA4ADgAANAAARIRUhNSERIRUhNSERIwGAAQABAP8A/wD/AIADgICA/YCAgP6AAAAIAAD/gAOAA4AAAwAHAAsAGwAfACMAJwArAAABMxUrATMVIyUzFSsBMxUzFSMRMxUhNTMRIzUzBTMRIwEzESMhMxUjJTMVIwGAgICAgIABAICAgICAgID+gICAgP6AgIADAICA/YCAgAIAgIADgICAgICAgP6AgIABgICA/wABAP8AgICAAAAAEQAAAAADgAOAAAMABwALAA8AEwAXABsAHwAjACcAKwAvADMANwA7AD8AQwAAETMVIyUzFSMhMxUjJTMVIyEzFSMlMxUrATMVIyEzFSMlMxUjJTMVIyUzFSMhMxUjJTMVIyEzFSMlMxUjJTMVIyUzFSOAgAMAgID9gICAAgCAgP6AgIABAICAgICA/oCAgAEAgIABAICAAQCAgP2AgIACAICA/YCAgAEAgIABAICAAQCAgAOAgICAgICAgICAgICAgICAgICAgICAgICAgICAAAUAAP+AA4ADgAAJAA0AEQAVACUAAAEhESMVIxEzNSEjMxUrATMVKwEzFSsBMxUhNTMRIxUjFSE1IzUjAgABgICAgP8AgICAgICAgICAgIACgICAgP6AgIADgP6AgAEAgICAgICA/wCAgICAAAUAAAAAAoADgAADAAcAEwAXABsAAAEzFSsBMxUrATMVIRUjFSM1ITUzEzMVKwEzFSMBgICAgICAgIABgICA/oCAgICAgICAA4CAgICAgICA/wCAgAAAAAADAAD/gAKAA4AABwAXABsAAAEhESM1IzUjBSERIxUzFSMVIzUjNTM1IxMVMzUBAAGAgICA/wABgICAgICAgICAgAOA/oCAgID+gICAgICAgAEAgIAAAAAABQAA/4ADAAOAAAMADwATABcAGwAAASEVISMzESERMxEhESMRKwEzESMBMxEjKQEVIQEAAQD/AICAAQCA/wCAgICAgAKAgID+AAIA/gADgID/AAEA/oD/AAEA/oABgP6AgAAAAAgAAP+ABAADgAADAAcACwAPABMAFwAjACcAAAEhFSEjMxUjJTMRIyUhFSEjMxEjATMRIyUzFSEVIxUjNSE1IREzFSMCAAEA/wCAgIABgICA/YABAP8AgICAA4CAgP6AgAEAgID+AAGAgIADgICAgP8AgID/AAEA/wCAgICAgID/AIAAAAYAAP+ABAADgAALAA8AEwAXABsAHwAAASEVMxUzESMRIREhATMVKwEzFSsBMxUrATMVKwEzFSMBAAIAgICA/wD+gAEAgICAgICAgICAgICAgIADgICA/gABgAEA/wCAgICAgAAHAAD/gAOAA4AABwATABcAGwAfACMAJwAAESERIxEhESMBMxUzFSMVIzUjNTMBMxUjJTMVIyEzFSMlMxUrATMVIwOAgP2AgAGAgICAgICA/wCAgAIAgID+gICAAQCAgICAgAOA/YACAP4AAYCAgICAgP8AgICAgICAgAAAAQAAAAADgAOAACEAAAEhFSMVIxUhESMVMzUhETM1MzUzESMVIxUhFSERMxEzNTMBgAGAgID/AICAAQCAgICAgP8A/oCAgIADgICAgP8AgIABAICA/oCAgIABgAEAgAAABgAAAAADgAMAAAMACwAXABsAHwAjAAARIREhARUzFTM1MzUFESERIxUjFSM1IzUxMxUjJTMVKwEzFSMDgPyAAQCAgID+AAKAgICAgICAAQCAgICAgAMA/QACgICAgICA/oABgICAgICAgICAAAAAAAsAAAAAA4ADgAADAAcACwAPABMAFwAbAB8AIwArAC8AAAEzFSsBMxUjJTMVIyEzFSMlMxUjJTMVIyEzFSMlMxUjITMVIyUzESE1MzUzITMVIwEAgICAgIABAICA/oCAgAEAgIABAICA/oCAgAIAgID+gICAAgCA/oCAgP6AgIADgICAgICAgICAgICAgICA/oCAgIAAAAAAAQAAAAADAAOAABcAAAEzESMRIxEjFSM1IzUjETMVMxUzETMRMwKAgICAgICAgICAgICAA4D/AP8A/wCAgIABAICAAQABAAAAAQAAAAADAAOAABsAAAEzESMVIxUzESM1IRUjFSMRMzUzNSMRMxUhNTMCgICAgICA/wCAgICAgIABAIADgP8AgID/AICAgAEAgIABAICAAAAQAAAAAAOAA4AAAwAHAAsADwATABcAGwAfACMAJwArAC8AMwA3ADsAPwAAATMVIyUzFSMhMxUjJTMRIwEzFSMhMxUjJTMVIyEzFSMlMxUjITMVIyUzESMBMxUjITMVIyUzFSMhMxUjJTMVIwEAgIABAICA/gCAgAGAgIABgICA/YCAgAIAgID+gICAAQCAgP6AgIABAICAAQCAgP2AgIADAICA/gCAgAEAgIADgICAgICA/wABAICAgICAgICAgP8AAQCAgICAgICAAAABAAAAAAMAA4AAIwAAETMVMxUhNTM1MxEjFSMVMxUzESM1IzUhFSMVIxEzNTM1IzUjgIABAICAgICAgICA/wCAgICAgIADgICAgID/AICAgP8AgICAgAEAgICAAAIAAAAAAoADgAATABcAABMzFTM1MxUzESMVIxUjNSM1IxEzEzMVI4CAgICAgICAgICAgICAA4CAgID/AICAgIABAP2AgAAAAAEAAAAAA4ADgAAXAAATIRUzNSEVMxEjFSMVIxUjNSM1IzUjETOAAQCAAQCAgICAgICAgIADgICAgP6AgICAgICAAYAAAQAAAAACgAOAAAcAAAEzESEVITUhAQCAAQD9gAEAA4D9AICAAAAAAAEAAAAAAoADgAALAAARIRUhETMVIxUjESECgP8AgICA/wADgID+AICAAwAABAAAAAADgAOAAAMABwALAA8AABEhESETESERBSERIRMVMzUDgPyAgAKA/gABgP6AgIADgPyAAwD9gAKAgP6AAQCAgAABAAAAAAOAA4AAGwAAATMRIRUjFSMVMxEjNSM1IxUjFSMRMzUjNSM1IQGAgAGAgICAgICAgICAgIABgAOA/wCAgID/AICAgIABAICAgAAAAAgAAAAAA4ADgAADAAcACwAPABMAFwAbAB8AAAEhFSEjMxUjJTMVIyEzESMBMxEjITMVIyUzFSMpARUhAQABgP6AgICAAgCAgP2AgIADAICA/YCAgAIAgID+gAGA/oADgICAgID+gAGA/oCAgICAAAADAAAAAAOAA4AADwAVABsAAAEzFTMVIxEjFSERIxEhNTMFIREjNSMVMxEhNTMBgICAgID/AIABAIABAAEAgICA/wCAA4CAgP4AgAGAAQCAgP8AgID+gIAAAwAAAAADgAOAAA8AFQAbAAABMxUzFSERIxEhNSMRIzUzBSEVIxUjOwERMxUhAYCAgAEAgP8AgICA/oABAICAgICA/wADgICA/wD+gIACAICAgID/AIAAAAMAAAAAAwACgAANABEAFQAAEyEVMxEhNSM1MzUhNSETFSE1EzMVI4ABgID+AICAAQD/AIABAICAgAKAgP4AgICAgP8AgIABgIAAAAAEAAAAAAKAA4AADQARABUAGQAAATMRMxUjESE1MxEjNTMlMxUjATMVIyUzFSMBAICAgP8AgICAAQCAgP4AgIABgICAA4D/AID+gIABAICAgP4AgICAAAAAAwAAAAACgAOAAAMADQARAAATIRUhJTMRITUhESM1MyEzESOAAQD/AAGAgP4AAYCAgP4AgIADgICA/ICAAgCA/YAAAAACAAAAAAKAA4AACwAPAAARMxEhETMRIzUhFSMzIRUhgAGAgID+gICAAYD+gAOA/gACAP0AgICAAAYAAAAAA4ACgAADAAkADQARABUAGQAAETMRIwEhFSMRIwEzFSMFMxUjJTMVKwEzFSOAgAIAAQCAgAEAgID9gICAAQCAgICAgAKA/oABgID/AAEAgICAgICAAAAAAgAAAAACgAKAAAcACwAAESEVIREhFSEBMxUjAgD+gAIA/YACAICAAoCA/oCAAgCAAAAAAAQAAP+AAwACgAADAAkADQARAAARMxEjATMRITUhFzMVIykBFSGAgAIAgP4AAYCAgID+AAIA/gACgP6AAYD+AICAgIAABAAA/4ADAAKAAAUACQANABEAABEhFSERIwEzESM7ARUjKQEVIQIA/oCAAgCAgICAgP4AAgD+AAKAgP6AAYD+gICAAAAEAAAAAAKAA4AACwAPABMAFwAAEyEVIxUzFSE1MzUjAzMRIwEzESMpARUhgAGAgID+gICAgICAAgCAgP6AAYD+gAOAgICAgID/AP6AAYD+gIAAAAACAAD/gAKAAoAABQAJAAARIRUhESMBMxEjAgD+gIACAICAAoCA/gACAP2AAAQAAP+AAoACgAAFAAkADQARAAARIRUjESMBMxUrATMRIwEzESMBAICAAYCAgICAgAEAgIACgID+AAKAgP2AAoD+AAAAAgAAAAADAAOAAAsADwAAESERIRUhESEVIREjATMRIwEAAYD+gAGA/gCAAoCAgAOA/wCA/oCAAwD/AP6AAAAAAAQAAAAAAoACgAAHAAsADwATAAARIRUjETMVIQEzFSsBMxEjATMRIwEAgID/AAGAgICAgIABAICAAoCA/oCAAoCA/oABgP4AAAIAAAAAAoACgAAFAAkAABEhFSERIwEzESMCAP6AgAIAgIACgID/AAEA/gAAAgAA/4ACgAOAAAcADwAAETMVIRUhESMBMxEjESE1IYABgP6AgAIAgID+gAGAA4CAgP6AAYD9AAEAgAAABAAAAAACgAKAAAUACQANABMAABEhFSMRIwEzFSsBMxEjATMRITUzAQCAgAGAgICAgIABAID/AIACgID+AAKAgP6AAYD+AIAABAAAAAACgAOAAAMACwAPABMAABEhFSkBMxEjESE1IQUzESMzIRUhAgD+AAIAgID+gAGA/gCAgIABgP6AA4CA/YABgICA/oCAAAAAAAMAAAAAAoADgAADAAsADwAAEyEVISMzFSEVIREjATMRI4ACAP4AgIABgP6AgAIAgIADgICAgP4AAgD+AAAAAAAEAAAAAAKAAoAAAwAHAA0AEQAAETMRIwEzESMBMxEhNTMhMxUjgIABAICAAQCA/wCA/oCAgAKA/gACAP4AAgD9gICAAAIAAAAAAwACgAAFAAsAABEhESMRIyUzESE1IQEAgIACgID+AAGAAoD+AAGAgP2AgAAAAAACAAD/gAMAA4AABwANAAABMxEjESE1IQEhESMRIwKAgID+gAGA/YABAICAA4D8AAEAgAGA/oABAAAAAAADAAAAAAKAA4AACQANABEAAAEzETMVIxEhNTMBMxEjATMRIwEAgICA/wCA/wCAgAIAgIADgP8AgP4AgAIA/gABgP4AAAIAAAAAAoADgAADAAkAABEzESMBMxEhNSGAgAIAgP4AAYADgP0AAgD9gIAABAAA/4ACgAKAAAsADwATABcAABEzFTMVIxUhFSEVIwEhFSkBMxEjASEVIYCAgAGA/oCAAQABAP8AAQCAgP6AAgD+AAKAgICAgIACgID/AP8AgAAABAAA/4ACgAOAAAcACwAPABMAAAEzESM1IzUzATMRIwEzESsBMxUjAgCAgICA/gCAgAEAgICAgIADgPwAgIACAP4AAgD+AIAABQAA/4ACgAKAAAMABwALABcAGwAAEzMVIyUzFSMhMxEjATMRMxUjFSM1IzUzATMRI4CAgAEAgID+gICAAQCAgICAgIABAICAAoCAgID+gAGA/oCAgICAAYD+gAABAAD/gAKAA4AACwAAATMRIRUhESMRITUhAQCAAQD/AID/AAEAA4D/AID9gAKAgAACAAAAAAKAAoAABQAJAAARIRUhESMBMxEjAgD+gIACAICAAoCA/gACAP4AAAIAAP+AAoACgAADAAsAABEzESMBMxEjNSE1IYCAAgCAgP6AAYACgP4AAgD9AICAAAMAAP+AAoACgAADAAsADwAAETMRIwEzESM1ITUhASEVIYCAAgCAgP6AAYD+AAIA/gACgP6AAYD9gICA/wCAAAACAAD/gAKAA4AABwALAAARMxEhFSERIwEzESOAAYD+gIACAICAA4D/AID9gAKA/gAAAAAAAwAA/4ACgAKAAAUACQANAAARIRUhESMBMxEjBSEVIQIA/oCAAgCAgP6AAgD+AAKAgP4AAgD+gICAAAAAAwAAAAACgAOAAA0AEQAVAAABMxEzFSMRITUzESM1MwUzESMBMxEjAQCAgID/AICAgP8AgIACAICAA4D/AID+AIABgICA/oABgP4AAAQAAP+AAoACgAAFAAkADQARAAARIRUjESMBMxUrATMRIwEzESMBAICAAYCAgICAgAEAgIACgID9gAMAgP4AAgD+AAAABAAA/4ADAAKAAAcACwAPABMAABEhFSERIRUhATMVIxMzFSMpARUhAgD+gAIA/YACAICAgICA/gACAP4AAoCA/wCAAYCA/wCAgAAAAAMAAP+AAoACgAAHAAsADwAAETMRIRUhFSMBMxEjASEVIYABgP6AgAIAgID+gAIA/gACgP6AgIACgP6A/wCAAAAHAAD/gAKAAoAABwALAA8AEwAXABsAHwAAESERIzUhFSM7ARUjJTMVKwEzFSsBMxUjJSEVKQEzFSMCgID+gICAgIABAICAgICAgICAAQABAP8A/oCAgAKA/wCAgICAgICAgICAAAAAAAMAAAAAAoACgAAFAAsADwAAESEVIxEjATMRITUzATMRIwEAgIACAID/AID/AICAAoCA/gACgP2AgAGA/oAAAAACAAD/gAKAA4AABwALAAARMxEhFSERIwEzFSOAAYD+gIACAICAA4D/AID9gAKAgAAEAAAAAAKAAoAAAwAHAAsADwAAESEVKQEzESMBMxEjMyEVIQIA/gACAICA/gCAgIABgP6AAoCA/oABAP8AgAAAAgAA/4ACgAOAAAcACwAAATMRIzUhNSEBMxEjAgCAgP6AAYD+AICAA4D8AICAAgD+AAAAAAMAAP+AAoACgAADAAcADwAAETMRIwEzESMpARUjESMRI4CAAgCAgP6AAYCAgIACgP6AAYD+gID/AAEAAAMAAAAAAoADgAAPABMAFwAAASEVIREzFSMRITUzESM1MwUzESMBMxEjAQABgP8AgID/AICAgP8AgIACAICAA4CA/wCA/oCAAYCAgP6AAQD+gAAAAAQAAP+AAoADAAADAA8AEwAXAAABMxUjFTMRMxUhNTMRIzUzBTMRIyUzFSMBAICAgID+gICAgP8AgIACAICAAwCAgP4AgIABAICA/wCAgAAABgAAAAACgAOAAAMABwALAA8AEwAXAAATIRUhIzMRIwEzFSMFMxUjOwEVIxUzFSOAAYD+gICAgAIAgID+gICAgICAgIADgID/AAEAgICAgICAAAAAAgAAAIAAgAOAAAMABwAAETMRIxEzFSOAgICAA4D/AP6AgAAAAQAAAAACgAOAAAsAAAEzESEVIREjESE1IQEAgAEA/wCA/wABAAOA/gCA/wABAIAAAQAA/4AAgACAAAMAADUzESOAgID/AAAAAQAAAAACgAOAABsAAAEzFSEVIRUhFSEVIRUhFSM1ITUhNSE1ITUhNSEBAIABAP8AAQD/AAEA/wCA/wABAP8AAQD/AAEAA4CAgICAgICAgICAgICAAAAAAAIAAAAAAoADAAADAAsAABEhFSEVIRUhESMRIQKA/YACgP8AgP8AAwCAgID+gAGAAAMAAAAAAoADgAADAAcADwAAATMRKwEzFSsBMxEhNTMRIQEAgICAgICAgAGAgP2AA4D+gID/AID/AAAAAAIAAP+AAoADgAALAA8AABEzESERMxEjESERIykBFSGAAYCAgP6AgAEAAQD/AAOA/wABAPyAAgD+AIAAAAQAAP+AAoADgAAHAAsADwATAAARMxEzFSMRIwEhFSkBMxEjKQEVIYCAgIABAAEA/wABAICA/wABAP8AA4D+gID+gAKAgP4AgAAAAAAEAAD/gAOAA4AADQARABUAGQAAESEVIRUhESM1IREjESEBIRUpATMRIykBFSECgP8AAgCA/oCA/wACAAEA/wABAICA/wABAP8AA4CAgP8AgP4AAwD+gID/AIAAAAQAAP+AAwADgAANABEAFQAZAAATMxEhESM1IREjESM1MwEhFSkBMxEjKQEVIYCAAgCA/oCAgIABAAEA/wABAICA/wABAP8AA4D/AP8AgP4AAgCA/wCA/wCAAAAAAQAAAAACgAKAAAkAABEhFSEVIRUhESMCgP4AAQD/AIACgICAgP8AAAUAAAAAAoACgAADAAcACwAPABMAABMhFSEjMxUjMyEVKQEzFSMpARUhgAIA/gCAgICAAYD+gAGAgID+AAIA/gACgICAgICAAAUAAAAABAACgAADAAcAEwAXABsAABMhFSElMxEjATMRMxUhNSE1ITUhBTMVIyUzFSOAAYD+gAMAgID+gICA/YABgP6AAYD+AICAAwCAgAKAgID+gAEA/oCAgICAgICAgAAAAAADAAAAAAQAAoAAAwAZAB0AABMhFSElMxEjFSM1IxUzFSE1ITUhNSE1MxUhBTMVI4ABgP6AAwCAgICAgP2AAYD+gAGAgAEA/ICAgAKAgID+gICAgICAgICAgICAAAYAAAAAAoADgAADAAcADQARABUAGQAAESEVKQEzFSMpARUhFSM7ARUjOwEVIzsBFSMCAP4AAgCAgP6AAYD/AICAgICAgICAgIADgICAgICAgIAAAAQAAAAAAgACgAADAAcADQARAAARIRUpATMVIykBESM1IwUzFSMBgP6AAYCAgP8AAQCAgAEAgIACgICA/wCAgIAAAAAABgAAAAACgAOAAAMABwALAA8AEwAXAAARMxUjJSEVISMzFSMlMxEjATMRIzMhFSGAgAEAAQD/AICAgAGAgID+AICAgAGA/oADgICAgICA/YACAP4AgAAAAAEAAAAAAoADgAAFAAARIREjESECgID+AAOA/IADAAAAAgAA/4ABAAMAAAMABwAAETMVIzsBESOAgICAgAMAgP0AAAAABwAAAAADAAOAAAMABwARABUAGQAdACEAABMhFSEjMxUjMyEVMxEjESM1ISUzFSMFMxUjITMVIzMhFSGAAgD+AICAgIABgICAgP8AAgCAgP6AgID/AICAgAGA/oADgICAgP6AAQCAgICAgICAAAAAAAMAAAAAAoACgAARABUAGQAAEyEVIxEjFTMVITUhNSM1ITUhIzMVIwUzFSOAAgCAgID+AAEAgAEA/wCAgIACAICAAoCA/wCAgICAgICAgIAABgAAAAACgAKAAAMABwALAA8AEwAXAAATIRUhIzMRIwEzESsBMxUjKQEVISUzFSOAAYD+gICAgAIAgICAgID/AAEA/wABgICAAoCA/oABgP8AgICAgAAAAAUAAAAAAoADgAADAAsADwATABcAABEzESMBMxEjESE1ISUzFSMVMxUrATMVI4CAAgCAgP8AAQD+gICAgICAgIADgP6AAYD8gAEAgICAgICAAAAAAAMAAAAAA4ADgAADAAcAGwAAASEVISUhFSkBMxUhNTMVIRUhESMRIREjESM1MwEAAQD/AAGAAQD/AP4AgAEAgAEA/wCA/wCAgIADgICAgICAgID+AAIA/gACAIAAAgAAAAACgAOAAAMAEQAAASEVISMzFSERIxEhESMRIzUzAQABgP6AgIABgID/AICAgAOAgID9gAIA/gACAIAAAAIAAAAAAwADgAARABUAAAEhESMRIREjESM1MzUzFSE1IQEzFSMBAAGAgP8AgICAgAEA/wABgICAA4D9AAGA/gACAICAgID9gIAAAAADAAAAAAQAA4AAAwAHAB0AAAEhFSElIRUpATMVITUzFSERIxEhESMRIREjESM1MwEAAQD/AAGAAYD+gP4AgAEAgAGAgP8AgP8AgICAA4CAgICAgID9gAIA/gACAP4AAgCAAAAAAwAAAAACgAOAAA0AEQAVAAATIREzFSMRIxEjNTM1ISMzESMlMxUjgAGAgICAgID/AICAgAIAgIADgP8AgP6AAYCAgP0AgIAAAgAAAIAAgAKAAAMABwAAETMRIxUzFSOAgICAAoD/AICAAAAAAwAAAIABgAKAAAMABwALAAARMxEjATMRIwUhFSGAgAEAgID/AAGA/oACgP8AAQD/AICAAAQAAAAAAoADgAADAAsADwAVAAARMxUjFTMRMxUjFSMBMxEjATMRITUhgICAgICAAQCAgAEAgP4AAYADgICA/wCAgAIA/wABAP2AgAADAAAAAAKAAoAAAwALAA8AABEhFSkBMxEzFSE1IQEzFSMBgP6AAYCAgP2AAYD/AICAAoCA/oCAgAEAgAACAAAAAAGAAoAAAwAHAAABMxEjATMVIwEAgID/AICAAoD9gAGAgAAABAAAAAACAAKAAAMABwALAA8AABEhFSkBMxEjATMVIwchFSEBgP6AAYCAgP8AgICAAYD+gAKAgP6AAQCAgIAAAAQAAAAAAoACgAAFAAkADQARAAARIRUhESMBMxEjATMVIwUhFSECAP6AgAIAgID/AICA/wACAP4AAoCA/wABAP6AAQCAgIAAAAIAAAAAAoACgAANABEAABEhFSEVMxUjESE1MxEjITMRIwIA/wCAgP8AgIACAICAAoCAgID/AIABgP4AAAIAAAAAAQADgAADAAcAABMzFSMHMxEjgICAgICAA4CAgP2AAAMAAAAAAoADgAADAAcADwAAESEVIRUhFSkBMxEzFSE1IQGA/oABgP6AAYCAgP2AAYADgICAgP6AgIAAAAQAAAAAAoADgAADAAsADwATAAATIRUhByEVIRUhFSEBMxEjKQEVIYABgP6AgAIA/oABAP6AAgCAgP4AAgD+AAOAgICAgIABAP6AgAABAAAAAAKAAoAACwAAATMRIRUhESMRITUhAQCAAQD/AID/AAEAAoD/AID/AAEAgAADAAD/gAOAA4AABwAlACkAAAEzFTMVITUzBTMVIRUjFTM1MxEzFTMRIxUjFSM1IxUjNSM1IxEzATMVIwGAgID+gID/AIABAICAgICAgICAgICAgIABAICAA4CAgICAgICAgAEAgP8AgICAgICAAQD+AIAAAAAAFAD2AAEAAAAAAAAAAwAIAAEAAAAAAAEACQAgAAEAAAAAAAIABwA6AAEAAAAAAAMACQBWAAEAAAAAAAQAEQCEAAEAAAAAAAUACwCuAAEAAAAAAAYACQDOAAEAAAAAAAkADgD2AAEAAAAAAA0AEwEtAAEAAAAAABMABgFPAAMAAQQJAAAABgAAAAMAAQQJAAEAEgAMAAMAAQQJAAIADgAqAAMAAQQJAAMAEgBCAAMAAQQJAAQAIgBgAAMAAQQJAAUAFgCWAAMAAQQJAAYAEgC6AAMAAQQJAAkAHADYAAMAAQQJAA0AJgEFAAMAAQQJABMADAFBACgAYwApAAAoYykAAE0AaQBuAGUAYwByAGEAZgB0AABNaW5lY3JhZnQAAFIAZQBnAHUAbABhAHIAAFJlZ3VsYXIAAE0AaQBuAGUAYwByAGEAZgB0AABNaW5lY3JhZnQAAE0AaQBuAGUAYwByAGEAZgB0ACAAUgBlAGcAdQBsAGEAcgAATWluZWNyYWZ0IFJlZ3VsYXIAAFYAZQByAHMAaQBvAG4AIAAxAC4AMAAAVmVyc2lvbiAxLjAAAE0AaQBuAGUAYwByAGEAZgB0AABNaW5lY3JhZnQAAE0AbwBqAGEAbgBnACAAUwB0AHUAZABpAG8AcwAATW9qYW5nIFN0dWRpb3MAAEEAbABsACAAcgBpAGcAaAB0AHMAIAByAGUAcwBlAHIAdgBlAGQAAEFsbCByaWdodHMgcmVzZXJ2ZWQAAEgAZQBsAGwAbwAhAABIZWxsbyEAAAIAAAAAAAAAZgAzAAAAAAAAAAAAAAAAAAAAAAAAAAAEogAAAQIAAgADAAQABQAGAAcACAAJAAoACwAMAA0ADgAPABAAEQASABMAFAAVABYAFwAYABkAGgAbABwAHQAeAB8AIAAhACIAIwAkACUAJgAnACgAKQAqACsALAAtAC4ALwAwADEAMgAzADQANQA2ADcAOAA5ADoAOwA8AD0APgA/AEAAQQBCAEMARABFAEYARwBIAEkASgBLAEwATQBOAE8AUABRAFIAUwBUAFUAVgBXAFgAWQBaAFsAXABdAF4AXwBgAGEAowCEAIUAvQCWAOgAhgCOAIsAnQCpAKQBAwCKANoAgwCTAQQBBQCNAJcAiADDAQYAngCqAPUA9AD2AKIA8ACRAO0AiQDqALgAoQDuAQcBCAEJAQoBCwEMAQ0BDgEPARABEQESARMApgEUARUBFgEXARgBGQEaARsBHAEdAR4BHwEgASEBIgEjASQBJQEmAScBKAEpASoBKwEsAS0BLgEvATABMQEyATMBNAE1ATYBNwE4ATkBOgE7ATwBPQE+AT8BQAFBAUIBQwFEAUUBRgFHAUgBSQFKAUsBTAFNAU4BTwFQAVEBUgFTAVQBVQFWAVcBWAFZAVoBWwFcAV0BXgFfAWABYQFiAWMBZAFlAWYBZwFoAWkBagFrAWwBbQFuAW8BcAFxAXIBcwF0AXUBdgF3AXgBeQF6AXsBfAF9AX4BfwGAAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwDcAZgBmQGaAZsBnAGdAZ4BnwGgAaEBogGjAaQBpQGmAacBqAGpAaoBqwGsAa0BrgGvAbABsQGyAbMBtAG1AbYBtwG4AbkBugG7AbwBvQG+Ab8BwACbAcEBwgHDAcQBxQHGAccByAHJAcoBywHMAc0BzgHPAdAB0QHSAdMB1AHVAdYB1wHYAdkB2gHbAdwB3QHeAd8B4AHhAeIB4wHkAeUB5gHnAegB6QHqAesB7AHtAe4B7wHwAfEB8gHzAfQB9QH2AfcB+AH5AfoB+wH8Af0B/gH/AgACAQICAgMCBAIFAgYCBwIIAgkCCgILAgwCDQIOAg8CEAIRAhICEwIUAhUCFgIXAhgCGQIaAhsCHAIdAh4CHwIgAiECIgIjAiQCJQImAicCKAIpAioCKwIsAi0CLgIvAjACMQIyAjMCNAI1AjYCNwI4AjkCOgI7AjwCPQI+Aj8CQAJBAkICQwJEAkUCRgJHAkgCSQJKAksCTAJNAk4CTwJQAlECUgJTAlQCVQJWAlcCWAJZAloCWwJcAl0CXgJfAmACYQJiAmMCZAJlAmYCZwJoAmkCagJrAmwCbQJuAm8CcAJxAnICcwJ0AnUCdgJ3AngCeQJ6AnsCfAJ9An4CfwKAAoECggKDAoQChQKGAocCiAKJAooCiwKMAo0CjgKPApACkQKSApMClAKVApYClwKYApkCmgKbApwCnQKeAp8CoAKhAqICowKkAqUCpgKnAqgCqQKqAqsCrAKtAq4CrwKwArECsgKzArQCtQK2ArcCuAK5AroCuwK8Ar0CvgK/AsACwQLCAsMCxALFAsYCxwLIAskCygLLAswCzQLOAs8C0ALRAtIC0wLUAtUC1gLXAtgC2QLaAtsC3ALdAt4C3wLgAuEC4gLjAuQC5QLmAucC6ALpAuoC6wLsAu0C7gLvAvAC8QLyAvMC9AL1AvYC9wL4AvkC+gL7AvwC/QL+Av8DAAMBAwIDAwMEAwUDBgMHAwgDCQMKAwsDDAMNAw4DDwMQAxEDEgMTAxQDFQMWAxcDGAMZAxoDGwMcAx0DHgMfAyADIQMiAyMDJAMlAyYDJwMoAykDKgMrAywDLQMuAy8DMAMxAzIDMwM0AzUDNgM3AzgDOQM6AzsDPAM9Az4DPwNAA0EDQgNDA0QDRQNGA0cDSANJA0oDSwNMA00DTgNPA1ADUQNSA1MDVANVA1YDVwNYA1kDWgNbA1wDXQNeA18DYANhA2IDYwNkA2UDZgNnA2gDaQNqA2sDbANtA24DbwNwA3EDcgNzA3QDdQN2A3cDeAN5A3oAsgCzALYAtwDEALQAtQDFAIIAwgCHAKsAxgN7A3wDfQN+A38DgAOBAL4AvwOCA4MDhAOFA4YDhwOIA4kDigOLA4wDjQOOA48DkAORA5IDkwOUA5UDlgOXA5gDmQOaA5sDnAOdA54DnwOgA6EDogOjA6QDpQOmA6cDqAOpA6oDqwOsA60DrgD3A68DsAOxA7IDswO0A7UDtgO3A7gDuQO6A7sDvAO9A74DvwPAA8EDwgPDA8QDxQPGA8cDyACMA8kDygPLA8wDzQPOA88D0APRA9ID0wPUA9UD1gPXA9gD2QPaA9sD3APdA94D3wPgA+ED4gPjA+QD5QPmA+cAmAPoA+kD6gPrA+wD7QPuAJkA7wPvA/AApQPxA/ID8wCSA/QD9QP2A/cAnAP4A/kD+gCnA/sAjwP8A/0AlACVA/4D/wQABAEEAgQDBAQEBQQGBAcECAQJBAoECwQMBA0EDgQPBBAEEQQSBBMEFAQVBBYEFwQYBBkEGgQbBBwEHQQeBB8EIAQhBCIEIwQkBCUEJgQnBCgEKQQqBCsELAQtBC4ELwQwBDEEMgQzBDQENQQ2BDcEOAQ5BDoEOwQ8BD0EPgQ/BEAEQQRCBEMERARFBEYERwRIBEkESgRLBEwETQROBE8EUARRBFIEUwRUBFUEVgRXBFgEWQRaBFsEXARdBF4EXwRgBGEEYgRjBGQEZQRmBGcEaARpBGoEawRsBG0EbgRvBHAEcQRyBHMEdAR1BHYEdwR4BHkEegR7BHwEfQR+BH8EgASBBIIEgwSEBIUEhgSHBIgEiQSKBIsEjASNBI4EjwSQBJEEkgSTBJQElQSWBJcEmASZBJoEmwScBJ0EngSfBKAEoQSiBKMEpASlBKYEpwSoBKkEqgSrBKwErQSuBK8EsASxBLIEswS0BLUEtgS3BLgEuQS6BLsEvAS9BL4EvwTABMEEwgTDBMQExQTGBMcEyATJBMoEywTMBM0EzgTPBNAE0QTSBNME1ATVBNYE1wTYBNkE2gTbBNwE3QTeBN8E4AThBOIE4wTkBOUE5gTnBOgE6QTqBOsE7ATtBO4E7wTwBPEE8gTzBPQE9QT2BPcE+AT5BPoE+wT8BP0E/gT/BQAFAQUCBmdseXBoMQd1bmkwMEFEB3VuaTAwQjIHdW5pMDBCMwd1bmkwMEI5AklKAmlqDGtncmVlbmxhbmRpYwVsb25ncwd1bmkwMTgxB3VuaTAxODQHdW5pMDE4NQd1bmkwMTg2B3VuaTAxODkHdW5pMDE4RQd1bmkwMThGB3VuaTAxOTAHdW5pMDE5MQd1bmkwMTlBB3VuaTAxOUIHdW5pMDE5RQd1bmkwMTlGB3VuaTAxQTcHdW5pMDFBOAd1bmkwMUE5B3VuaTAxQUEHdW5pMDFCMgd1bmkwMUI3B3VuaTAxQjgHdW5pMDFCOQd1bmkwMUJCB3VuaTAxQkMHdW5pMDFCRAd1bmkwMUJFB3VuaTAxQkYHdW5pMDFDMAd1bmkwMUMxB3VuaTAxQzIHdW5pMDFDMwd1bmkwMUM5B3VuaTAxREQHdW5pMDFGNwd1bmkwMjFDB3VuaTAyMUQHdW5pMDIyMAd1bmkwMjIxB3VuaTAyMjQHdW5pMDIyNQd1bmkwMjM0B3VuaTAyMzUHdW5pMDIzNgd1bmkwMjNBB3VuaTAyM0IHdW5pMDIzQwd1bmkwMjNEB3VuaTAyM0UHdW5pMDI0MQd1bmkwMjQyB3VuaTAyNDMHdW5pMDI0NAd1bmkwMjQ1B3VuaTAyNDYHdW5pMDI0Nwd1bmkwMjQ4B3VuaTAyNDkHdW5pMDI0QQd1bmkwMjRCB3VuaTAyNEMHdW5pMDI0RAd1bmkwMjRFB3VuaTAyNEYHdW5pMDI1MAd1bmkwMjUxB3VuaTAyNTIHdW5pMDI1Mwd1bmkwMjU0B3VuaTAyNTUHdW5pMDI1Ngd1bmkwMjU3B3VuaTAyNTgHdW5pMDI1OQd1bmkwMjVBB3VuaTAyNUIHdW5pMDI1Qwd1bmkwMjVEB3VuaTAyNUUHdW5pMDI1Rgd1bmkwMjYwB3VuaTAyNjEHdW5pMDI2Mgd1bmkwMjY0B3VuaTAyNjUHdW5pMDI2Ngd1bmkwMjY3B3VuaTAyNjgHdW5pMDI2QQd1bmkwMjZCB3VuaTAyNkMHdW5pMDI2RAd1bmkwMjZFB3VuaTAyNkYHdW5pMDI3MAd1bmkwMjcxB3VuaTAyNzIHdW5pMDI3Mwd1bmkwMjc0B3VuaTAyNzUHdW5pMDI3Nwd1bmkwMjc4B3VuaTAyNzkHdW5pMDI3QQd1bmkwMjdCB3VuaTAyN0MHdW5pMDI3RQd1bmkwMjdGB3VuaTAyODAHdW5pMDI4MQd1bmkwMjg0B3VuaTAyODUHdW5pMDI4Ngd1bmkwMjg3B3VuaTAyODgHdW5pMDI4OQd1bmkwMjhBB3VuaTAyOEIHdW5pMDI4Qwd1bmkwMjhEB3VuaTAyOEUHdW5pMDI4Rgd1bmkwMjkxB3VuaTAyOTIHdW5pMDI5Mwd1bmkwMjk0B3VuaTAyOTUHdW5pMDI5Ngd1bmkwMjk3B3VuaTAyOTgHdW5pMDI5OQd1bmkwMjlBB3VuaTAyOUIHdW5pMDI5Qwd1bmkwMjlEB3VuaTAyOUUHdW5pMDI5Rgd1bmkwMkEwB3VuaTAyQTEHdW5pMDJBMgd1bmkwMkFDB3VuaTAyQkIHdW5pMDJDQwd1bmkwMzdFCWFub3RlbGVpYQVBbHBoYQRCZXRhBUdhbW1hB3VuaTAzOTQHRXBzaWxvbgRaZXRhA0V0YQVUaGV0YQRJb3RhBUthcHBhBkxhbWJkYQJNdQJOdQJYaQdPbWljcm9uAlBpA1JobwVTaWdtYQNUYXUHVXBzaWxvbgNQaGkDQ2hpA1BzaQd1bmkwM0E5BWFscGhhBGJldGEFZ2FtbWEFZGVsdGEHZXBzaWxvbgR6ZXRhA2V0YQV0aGV0YQRpb3RhBWthcHBhBmxhbWJkYQd1bmkwM0JDAm51AnhpB29taWNyb24DcmhvBnNpZ21hMQVzaWdtYQN0YXUHdXBzaWxvbgNwaGkDY2hpA3BzaQVvbWVnYQd1bmkwM0RCB3VuaTA0MDIHdW5pMDQwNAd1bmkwNDA1B3VuaTA0MDYHdW5pMDQwOAd1bmkwNDA5B3VuaTA0MEEHdW5pMDQwQgd1bmkwNDEwB3VuaTA0MTEHdW5pMDQxMgd1bmkwNDEzB3VuaTA0MTQHdW5pMDQxNQd1bmkwNDE2B3VuaTA0MTcHdW5pMDQxOAd1bmkwNDFBB3VuaTA0MUIHdW5pMDQxQwd1bmkwNDFEB3VuaTA0MUUHdW5pMDQxRgd1bmkwNDIwB3VuaTA0MjEHdW5pMDQyMgd1bmkwNDIzB3VuaTA0MjQHdW5pMDQyNQd1bmkwNDI2B3VuaTA0MjcHdW5pMDQyOAd1bmkwNDI5B3VuaTA0MkEHdW5pMDQyQgd1bmkwNDJDB3VuaTA0MkQHdW5pMDQyRQd1bmkwNDJGB3VuaTA0MzAHdW5pMDQzMQd1bmkwNDMyB3VuaTA0MzMHdW5pMDQzNAd1bmkwNDM1B3VuaTA0MzYHdW5pMDQzNwd1bmkwNDM4B3VuaTA0M0EHdW5pMDQzQgd1bmkwNDNDB3VuaTA0M0QHdW5pMDQzRQd1bmkwNDNGB3VuaTA0NDAHdW5pMDQ0MQd1bmkwNDQyB3VuaTA0NDMHdW5pMDQ0NAd1bmkwNDQ1B3VuaTA0NDYHdW5pMDQ0Nwd1bmkwNDQ4B3VuaTA0NDkHdW5pMDQ0QQd1bmkwNDRCB3VuaTA0NEMHdW5pMDQ0RAd1bmkwNDRFB3VuaTA0NEYHdW5pMDQ1NAd1bmkwNDU1B3VuaTA0NTYHdW5pMDQ1OAd1bmkwNDU5B3VuaTA0NUEHdW5pMDQ2Mgd1bmkwNDYzB3VuaTA0NzIHdW5pMDQ3Mwd1bmkwNDc0B3VuaTA0NzUHdW5pMDQ5Mgd1bmkwNDkzB3VuaTA0OTYHdW5pMDQ5Nwd1bmkwNDlBB3VuaTA0OUIHdW5pMDRBMgd1bmkwNEEzB3VuaTA0QUUHdW5pMDRBRgd1bmkwNEIwB3VuaTA0QjEHdW5pMDRCQQd1bmkwNEJCB3VuaTA0QzAHdW5pMDREOAd1bmkwNEQ5B3VuaTA0RTgHdW5pMDRFOQd1bmkwNTAwB3VuaTA1MzEHdW5pMDUzMgd1bmkwNTMzB3VuaTA1MzQHdW5pMDUzNQd1bmkwNTM2B3VuaTA1MzcHdW5pMDUzOAd1bmkwNTM5B3VuaTA1M0EHdW5pMDUzQgd1bmkwNTNDB3VuaTA1M0QHdW5pMDUzRQd1bmkwNTNGB3VuaTA1NDAHdW5pMDU0MQd1bmkwNTQyB3VuaTA1NDMHdW5pMDU0NAd1bmkwNTQ1B3VuaTA1NDYHdW5pMDU0Nwd1bmkwNTQ4B3VuaTA1NDkHdW5pMDU0QQd1bmkwNTRCB3VuaTA1NEMHdW5pMDU0RAd1bmkwNTRFB3VuaTA1NEYHdW5pMDU1MAd1bmkwNTUxB3VuaTA1NTIHdW5pMDU1Mwd1bmkwNTU0B3VuaTA1NTUHdW5pMDU1Ngd1bmkwNTU5B3VuaTA1NUEHdW5pMDU1Qgd1bmkwNTVDB3VuaTA1NUQHdW5pMDU1RQd1bmkwNTVGB3VuaTA1NjAHdW5pMDU2MQd1bmkwNTYyB3VuaTA1NjMHdW5pMDU2NAd1bmkwNTY1B3VuaTA1NjYHdW5pMDU2Nwd1bmkwNTY4B3VuaTA1NjkHdW5pMDU2QQd1bmkwNTZCB3VuaTA1NkMHdW5pMDU2RAd1bmkwNTZFB3VuaTA1NkYHdW5pMDU3MAd1bmkwNTcxB3VuaTA1NzIHdW5pMDU3Mwd1bmkwNTc0B3VuaTA1NzUHdW5pMDU3Ngd1bmkwNTc3B3VuaTA1NzgHdW5pMDU3OQd1bmkwNTdBB3VuaTA1N0IHdW5pMDU3Qwd1bmkwNTdEB3VuaTA1N0UHdW5pMDU3Rgd1bmkwNTgwB3VuaTA1ODEHdW5pMDU4Mgd1bmkwNTgzB3VuaTA1ODQHdW5pMDU4NQd1bmkwNTg2B3VuaTA1ODcHdW5pMDU4OAd1bmkwNThBB3VuaTA1OEYHdW5pMDVCRQd1bmkwNUMzB3VuaTA1QzYHdW5pMDVEMAd1bmkwNUQxB3VuaTA1RDIHdW5pMDVEMwd1bmkwNUQ0B3VuaTA1RDUHdW5pMDVENgd1bmkwNUQ3B3VuaTA1RDgHdW5pMDVEOQd1bmkwNURBB3VuaTA1REIHdW5pMDVEQwd1bmkwNUREB3VuaTA1REUHdW5pMDVERgd1bmkwNUUwB3VuaTA1RTEHdW5pMDVFMgd1bmkwNUUzB3VuaTA1RTQHdW5pMDVFNQd1bmkwNUU2B3VuaTA1RTcHdW5pMDVFOAd1bmkwNUU5B3VuaTA1RUEHdW5pMDVGMAd1bmkwNUYxB3VuaTA1RjIHdW5pMDVGMwd1bmkwNUY0B3VuaTA3QzgHdW5pMTBBMAd1bmkxMEExB3VuaTEwQTIHdW5pMTBBMwd1bmkxMEE0B3VuaTEwQTUHdW5pMTBBNgd1bmkxMEE3B3VuaTEwQTgHdW5pMTBBOQd1bmkxMEFBB3VuaTEwQUIHdW5pMTBBQwd1bmkxMEFEB3VuaTEwQUUHdW5pMTBBRgd1bmkxMEIwB3VuaTEwQjEHdW5pMTBCMgd1bmkxMEIzB3VuaTEwQjQHdW5pMTBCNQd1bmkxMEI2B3VuaTEwQjcHdW5pMTBCOAd1bmkxMEI5B3VuaTEwQkEHdW5pMTBCQgd1bmkxMEJDB3VuaTEwQkQHdW5pMTBCRQd1bmkxMEJGB3VuaTEwQzAHdW5pMTBDMQd1bmkxMEMyB3VuaTEwQzMHdW5pMTBDNAd1bmkxMEM1B3VuaTEwQzcHdW5pMTBDRAd1bmkxMEQwB3VuaTEwRDEHdW5pMTBEMgd1bmkxMEQzB3VuaTEwRDQHdW5pMTBENQd1bmkxMEQ2B3VuaTEwRDcHdW5pMTBEOAd1bmkxMEQ5B3VuaTEwREEHdW5pMTBEQgd1bmkxMERDB3VuaTEwREQHdW5pMTBERQd1bmkxMERGB3VuaTEwRTAHdW5pMTBFMQd1bmkxMEUyB3VuaTEwRTMHdW5pMTBFNAd1bmkxMEU1B3VuaTEwRTYHdW5pMTBFNwd1bmkxMEU4B3VuaTEwRTkHdW5pMTBFQQd1bmkxMEVCB3VuaTEwRUMHdW5pMTBFRAd1bmkxMEVFB3VuaTEwRUYHdW5pMTBGMAd1bmkxMEYxB3VuaTEwRjIHdW5pMTBGMwd1bmkxMEY0B3VuaTEwRjUHdW5pMTBGNgd1bmkxMEY3B3VuaTEwRjgHdW5pMTBGOQd1bmkxMEZBB3VuaTEwRkIHdW5pMTBGQwd1bmkxMEZEB3VuaTEwRkUHdW5pMTBGRgd1bmkxNUUxB3VuaTE1RkEHdW5pMTYxNAd1bmkxNkEwB3VuaTE2QTIHdW5pMTZBMwd1bmkxNkE0B3VuaTE2QTUHdW5pMTZBNgd1bmkxNkE3B3VuaTE2QTgHdW5pMTZBOQd1bmkxNkFBB3VuaTE2QUIHdW5pMTZBQwd1bmkxNkFEB3VuaTE2QUUHdW5pMTZBRgd1bmkxNkIwB3VuaTE2QjEHdW5pMTZCMgd1bmkxNkIzB3VuaTE2QjQHdW5pMTZCNgd1bmkxNkI3B3VuaTE2QjgHdW5pMTZCOQd1bmkxNkJBB3VuaTE2QkIHdW5pMTZCQwd1bmkxNkJEB3VuaTE2QkUHdW5pMTZCRgd1bmkxNkMwB3VuaTE2QzEHdW5pMTZDMgd1bmkxNkMzB3VuaTE2QzQHdW5pMTZDNQd1bmkxNkM2B3VuaTE2QzcHdW5pMTZDOAd1bmkxNkM5B3VuaTE2Q0EHdW5pMTZDQgd1bmkxNkNDB3VuaTE2Q0QHdW5pMTZDRQd1bmkxNkNGB3VuaTE2RDAHdW5pMTZEMQd1bmkxNkQyB3VuaTE2RDMHdW5pMTZENAd1bmkxNkQ1B3VuaTE2RDYHdW5pMTZENwd1bmkxNkQ4B3VuaTE2RDkHdW5pMTZEQQd1bmkxNkRCB3VuaTE2REMHdW5pMTZERAd1bmkxNkRFB3VuaTE2REYHdW5pMTZFMAd1bmkxNkUxB3VuaTE2RTIHdW5pMTZFMwd1bmkxNkU0B3VuaTE2RTUHdW5pMTZFNgd1bmkxNkU3B3VuaTE2RTgHdW5pMTZFOQd1bmkxNkVBB3VuaTE2RUIHdW5pMTZFQwd1bmkxNkVEB3VuaTE2RUUHdW5pMTZFRgd1bmkxNkYwB3VuaTE2RjEHdW5pMTZGMgd1bmkxNkYzB3VuaTE2RjQHdW5pMTZGNQd1bmkxNkY2B3VuaTE2RjcHdW5pMTZGOAd1bmkxRDAwB3VuaTFEMDQHdW5pMUQwNQd1bmkxRDA3B3VuaTFEMDkHdW5pMUQwQQd1bmkxRDBCB3VuaTFEMEQHdW5pMUQwRgd1bmkxRDE4B3VuaTFEMUEHdW5pMUQxQgd1bmkxRDFDB3VuaTFEMjAHdW5pMUQyMQd1bmkxRDIyB3VuaTFENzcHdW5pMUQ5MQd1bmkxRTlDB3VuaTFFOUQHdW5pMUU5RQd1bmkxRTlGB3VuaTFFRkMHdW5pMUVGRAd1bmkxRUZFB3VuaTFFRkYHdW5pMjAxMAd1bmkyMDExB3VuaTIwMzEGbWludXRlBnNlY29uZAd1bmkyMDM0B3VuaTIwMzUHdW5pMjAzNgd1bmkyMDM3B3VuaTIwM0IJZXhjbGFtZGJsB3VuaTIwM0QHdW5pMjA0Mgd1bmkyMDQ4B3VuaTIwNDkHdW5pMjA0QQd1bmkyMDRCB3VuaTIwNEUHdW5pMjA0Rgd1bmkyMDUxB3VuaTIwNTIHdW5pMjA1Nwd1bmkyMDcwB3VuaTIwNzEHdW5pMjA3NAd1bmkyMDc1B3VuaTIwNzYHdW5pMjA3Nwd1bmkyMDc4B3VuaTIwNzkHdW5pMjA3QQd1bmkyMDdCB3VuaTIwN0MHdW5pMjA3RAd1bmkyMDdFB3VuaTIwN0YHdW5pMjA4MAd1bmkyMDgxB3VuaTIwODIHdW5pMjA4Mwd1bmkyMDg0B3VuaTIwODUHdW5pMjA4Ngd1bmkyMDg3B3VuaTIwODgHdW5pMjA4OQd1bmkyMDhBB3VuaTIwOEIHdW5pMjA4Qwd1bmkyMDhEB3VuaTIwOEUHdW5pMjBBMA1jb2xvbm1vbmV0YXJ5B3VuaTIwQTIEbGlyYQd1bmkyMEE1B3VuaTIwQTYHdW5pMjBBOQd1bmkyMEFBBGRvbmcERXVybwd1bmkyMEFEB3VuaTIwQUUHdW5pMjBCMAd1bmkyMEIxB3VuaTIwQjIHdW5pMjBCMwd1bmkyMEI0B3VuaTIwQjUHdW5pMjBCNgd1bmkyMEI3B3VuaTIwQjgHdW5pMjBCOQd1bmkyMEJBB3VuaTIwQkIHdW5pMjBCQwd1bmkyMEJEB3VuaTIwQkUHdW5pMjBCRgd1bmkyMTE3B3VuaTIxMzIHdW5pMjE0MQd1bmkyMTQ0B3VuaTIxNEIHdW5pMjE1MAd1bmkyMTUxCG9uZXRoaXJkCXR3b3RoaXJkcwd1bmkyMTU1B3VuaTIxNTYHdW5pMjE1Nwd1bmkyMTU5B3VuaTIxNUEJb25lZWlnaHRoDHRocmVlZWlnaHRocwtmaXZlZWlnaHRocwxzZXZlbmVpZ2h0aHMHdW5pMjE1Rgd1bmkyMTg5CWFycm93bGVmdAdhcnJvd3VwCmFycm93cmlnaHQJYXJyb3dkb3duCWFycm93Ym90aAd1bmkyMUM0B3VuaTIxQ0YNYXJyb3dkYmxyaWdodAxhcnJvd2RibGJvdGgHdW5pMjFGNQl1bml2ZXJzYWwHdW5pMjIwMQtleGlzdGVudGlhbAd1bmkyMjA0CGVtcHR5c2V0B2VsZW1lbnQKbm90ZWxlbWVudAhzdWNodGhhdAd1bmkyMjBDB3VuaTIyMTMHdW5pMjIxOQd1bmkyMjFCB3VuaTIyMUMMcHJvcG9ydGlvbmFsB3VuaTIyMjUKbG9naWNhbGFuZAlsb2dpY2Fsb3IMaW50ZXJzZWN0aW9uB3VuaTIyMkUJdGhlcmVmb3JlB3VuaTIyMzUHdW5pMjI1NAtlcXVpdmFsZW5jZQd1bmkyMjYyDHByb3BlcnN1YnNldA5wcm9wZXJzdXBlcnNldAlub3RzdWJzZXQHdW5pMjI4NQxyZWZsZXhzdWJzZXQOcmVmbGV4c3VwZXJzZXQHdW5pMjJBMgd1bmkyMkE0DXBlcnBlbmRpY3VsYXIHdW5pMjJBOAd1bmkyMkJCB3VuaTIyQkMHdW5pMjJCRAd1bmkyMkMzB3VuaTIyQzYHdW5pMjMwMAVob3VzZQd1bmkyMzE4B3VuaTIzMUEHdW5pMjMxQgppbnRlZ3JhbHRwCmludGVncmFsYnQHdW5pMjNDRgd1bmkyM0U5B3VuaTIzRUEHdW5pMjNFRAd1bmkyM0VFB3VuaTIzRUYHdW5pMjNGNAd1bmkyM0Y1B3VuaTIzRjYHdW5pMjNGNwd1bmkyM0Y4B3VuaTIzRjkHdW5pMjNGQQd1bmkyM0ZCB3VuaTIzRkMHdW5pMjNGRAhTRjEwMDAwMAhTRjExMDAwMAhTRjAxMDAwMAhTRjAzMDAwMAhTRjAyMDAwMAhTRjA0MDAwMAhTRjA4MDAwMAhTRjA5MDAwMAhTRjA2MDAwMAhTRjA3MDAwMAhTRjA1MDAwMAhTRjQzMDAwMAhTRjI0MDAwMAhTRjUxMDAwMAhTRjUyMDAwMAhTRjM5MDAwMAhTRjIyMDAwMAhTRjIxMDAwMAhTRjI1MDAwMAhTRjUwMDAwMAhTRjQ5MDAwMAhTRjM4MDAwMAhTRjI4MDAwMAhTRjI3MDAwMAhTRjI2MDAwMAhTRjM2MDAwMAhTRjM3MDAwMAhTRjQyMDAwMAhTRjE5MDAwMAhTRjIwMDAwMAhTRjIzMDAwMAhTRjQ3MDAwMAhTRjQ4MDAwMAhTRjQxMDAwMAhTRjQ1MDAwMAhTRjQ2MDAwMAhTRjQwMDAwMAhTRjU0MDAwMAhTRjUzMDAwMAhTRjQ0MDAwMAd1cGJsb2NrB2RuYmxvY2sFYmxvY2sHbGZibG9jawdydGJsb2NrB2x0c2hhZGUFc2hhZGUHZGtzaGFkZQlmaWxsZWRib3gGSDIyMDczB3RyaWFndXAHdW5pMjVCMwd1bmkyNUI2B3VuaTI1QjcHdHJpYWdkbgd1bmkyNUJEB3VuaTI1QzAHdW5pMjVDMQd1bmkyNUM2B3VuaTI1QzcGY2lyY2xlB3VuaTI1Q0UGSDE4NTMzCWludmJ1bGxldApvcGVuYnVsbGV0B3VuaTI2MDAHdW5pMjYwMQd1bmkyNjAyB3VuaTI2MDMHdW5pMjYwNAd1bmkyNjA1B3VuaTI2MDYHdW5pMjYwOAd1bmkyNjE0B3VuaTI2MjAHdW5pMjYzMAd1bmkyNjMxB3VuaTI2MzIHdW5pMjYzMwd1bmkyNjM0B3VuaTI2MzUHdW5pMjYzNgd1bmkyNjM3B3VuaTI2MzkJc21pbGVmYWNlDGludnNtaWxlZmFjZQd1bmkyNjNEBmZlbWFsZQRtYWxlBXNwYWRlB3VuaTI2NjEHdW5pMjY2MgRjbHViB3VuaTI2NjQFaGVhcnQHZGlhbW9uZAd1bmkyNjY3B3VuaTI2NjkLbXVzaWNhbG5vdGUObXVzaWNhbG5vdGVkYmwHdW5pMjY2Qwd1bmkyNjZEB3VuaTI2NkUHdW5pMjY2Rgd1bmkyNjgwB3VuaTI2ODEHdW5pMjY4Mgd1bmkyNjgzB3VuaTI2ODQHdW5pMjY4NQd1bmkyNjkwB3VuaTI2OTEHdW5pMjY5Mwd1bmkyNjk0B3VuaTI2OTcHdW5pMjZBMQd1bmkyNkE1B3VuaTI2QzQHdW5pMjZDOAd1bmkyNkNGB3VuaTI2RTgHdW5pMjcwMgd1bmkyNzA5B3VuaTI3MEUHdW5pMjcxNAd1bmkyNzE4B3VuaTI3NDQHdW5pMjc0Qwd1bmkyNzYzB3VuaTI3NjQHdW5pMjdEOAd1bmkyOTVEB3VuaTI5QzgHdW5pMkI1MAd1bmkyQjU4B3VuaTJCRUEHdW5pMkJFQgd1bmkyQzY1B3VuaTJDNjYHdW5pMkM2RAd1bmkyQzZGB3VuaTJDNzEHdW5pMkQwMAd1bmkyRDAxB3VuaTJEMDIHdW5pMkQwMwd1bmkyRDA0B3VuaTJEMDUHdW5pMkQwNgd1bmkyRDA3B3VuaTJEMDgHdW5pMkQwOQd1bmkyRDBBB3VuaTJEMEIHdW5pMkQwQwd1bmkyRDBEB3VuaTJEMEUHdW5pMkQwRgd1bmkyRDEwB3VuaTJEMTEHdW5pMkQxMgd1bmkyRDEzB3VuaTJEMTQHdW5pMkQxNQd1bmkyRDE2B3VuaTJEMTcHdW5pMkQxOAd1bmkyRDE5B3VuaTJEMUEHdW5pMkQxQgd1bmkyRDFDB3VuaTJEMUQHdW5pMkQxRQd1bmkyRDFGB3VuaTJEMjAHdW5pMkQyMQd1bmkyRDIyB3VuaTJEMjMHdW5pMkQyNAd1bmkyRDI1B3VuaTJFMTgHdW5pMkUyRQd1bmkyRTM1B3VuaTJFMzgHdW5pMkU0MQd1bmkyRTRCB3VuaTMwMTIHdW5pMzEyNQd1bmlBNzI2B3VuaUE3MjcHdW5pQTcyOAd1bmlBNzI5B3VuaUE3MzAHdW5pQTczMQd1bmlBNzM5B3VuaUE3M0IHdW5pQTc1QQd1bmlBNzVCB3VuaUE3NzkHdW5pQTc4MAd1bmlBNzgxB3VuaUE3QTgHdW5pQTdBOQd1bmlBN0FGB3VuaUE3QjAHdW5pRkIwMAd1bmlGQjAxB3VuaUZCMDIHdW5pRkIwMwd1bmlGQjA1B3VuaUZCMUQHdW5pRkIxRgd1bmlGQjJCB3VuaUZCMzEHdW5pRkIzNQd1bmlGQjNCB3VuaUZCNDQHdW5pRkI0QQd1bmlGQjRCB3VuaUZCNEMHdW5pRkI0RQd1bmlGRjBCB3VuaUZGRkQAAAAB//8AAgABAAAADAAAABAAAAACAAAABAAAAAIAAAAAAAEAAAAA39bLMQAAAAB8N5wbAAAAAOCWoJY=");var Uh="data:image/webp;base64,UklGRmYKAABXRUJQVlA4TFoKAAAvVAEgEH+itpGk5t7hof9G/wgJaYGB27ZxnKTN0V3//+zEsG0kRbO8+9R/m8xAIAjR/7NYICGA8McPwiD007LSTzpfz8L0E+bVmncrItVRPTuWMHugG3p21IkVMVwtZ660fsWKGKkVtMB+40u1Tt4kLPlSkcaLuJw465MshJdQRC2nLvokdeYpIlykia3evJJRMiMLakNWZEV2lw3ZXA5kd3UgB3JJTsZR0LYNk/CH3e5AiIgJIE02fqBspe5qe9tGCpjeE0koEAwCU9LDH2massLCTe6W7/921iQ/8hPH5nZ+Ef13BElS28zeFShWsK0Ah8wblgLAVSP0Dn6UIikqVjRoqJb64HH/a9XJZLTR3c+ZiP47lGS1bQ6TShwkVJBSPmBH1eXxAfM77R+d74C6OGA+qL0zPdfHzBd1cK3zfeaP2r3UuofaAfNL7UkTT5lv6mg9btc7oQsp9dFk30Oh6yvmo5xfeCknwUs59FMO/quPwRQiuvtnUiso2ecfyZorybSpciVi/GDM8n8AHyUFPE2mKj8wSobTIxxUhY3G6r6b/wZEFjmqrPj0gkehZMVHIfMBzOANRjMKtxXiyyBzp+sO6V2mqtvZcmEN51ZCHrSSduDVppXNVzOAibgys1W8ri7MxzX+daaouxUpxWC+3v6CInJaCb3gzW1c7dvqOMmXTFWdbKItXz5qk3y1ZgEg40aiNItImykobGc0SrpEvlJDN5MRuAxckWJ1zCmYX0parYC3x8Mj55XcYI2WopvdFOANlCSS1TpRUkNfmHWdKams2mdTWfUPg1yNXGRK8kIGDJFsCxSLFImSDHF58x8qqRQJ9FJGbMoohM2QgQ040x8ikq+wpgdAtrXpCnSqGkZ4TBSv0MMZfxgj+YTSKhE9h2umZAYFGKCHIzr6ddDNDJa3nsE8Y7Dp/BKEkGKsZoQ9XPKZxmyFRCMVLquSfBtoMjt4HWAMacCQz19Wezqe7VEpQWI127mPVjJu5Fbv1dgoa8jcE5zhWM9yYBwlYAVMlBRwLrWdwiIyKDHQQzJsOY44xUoqs0m2gTlvxa/dqO3iYhNJCOaiXh46qf4eBOnmbq2U1BQKSG4R2mDVv1oUh4LIB6N1NA3+LeSsSp7o5kKyOVHZngsCo92Kh99QM5AxpF1cGER0o8kkpdVSs42SHPDZyBwPs5IK8PkCzoGMt9IpYSefvYyEIRobxGolw7VBxDGyP1ViVkClpAXUoNJtKsunDpCv0CkdCoPpEiQSjNMpqfcimTWbDmYWS3LoCm/T7tVBL6lqFqfwRAlXhuttP2fegiuS14lCkMKwbKcDSGa4wPI7bTjbTodgJRhVO+/joySpW1PYA7iVEdZGEsXj9UFVrljHItlChK6raiXgAdtEW2s3CFzXJTO+kuvgSFSF2JVI4SSDtEoYycnBwIUd9krOQXVJEBXB/vZmNBW+Oc7V14d1rOx2/6kLaVdkXjSF1PbGQVuI1IPl7YAWBFvJrZpl4wM9WTUckubNZTM4bEyBFMlUM6CtxtNzk8nK+UNlYgl6qZmz21uccXP87KRBq0IYbBD3MkSAlGt+EWUsEVc+Bg+gYs3ITy0mtWpROlX9/YRwAxVvJE5Ujf8HCAI6JT1seQbj6Zwo1D2A3mg2/0PT2opCEPH1PTF0+k7kjdrmdMfLlapFrfuAZ5qtacZdc0i+JKqZApgcb3H6y5VeYSB/wlJOlwmWEN0oVgK1Gy9bm3oFa7Ie28BbU5sDWQHcI3/a1vQbA2jeNfmEiYa2UA6caTryhG3NfGWkJRnRdG0pgZU8yHUPW5rBClNjWyjVb8iLXGy0YVjeZ2GKSmOI+YZsGvpnHGwSPd5nYIkKDUyBZs4Ayg3B+xZgUn6ZnjHzo/GWFS5jWwRAsCzMnUrmN5XXPSonz0gDh0zhEkEPGk/puwXHpIFtdU/Nv31WfoccQGJPGbhIB4UpgNLvqHnxiTIgUHoOuUVhNMuL5fEt97TmxR8mt0bLtZLIxY7QYrbs0Mgjngj3OPpye4Xy8p0FLkNjzIoZXtohRVMDf7jZt6atu7y3kQ4x0b4ywaVrBjgcQ/d11tD15tE1BxYvR7r8uHMU69BXhqjMmCnAT6KAyhysIevdI0USjOhcew5LTGo7qlS5IgIn9k/W7FAPSc/FGJEFs0IoMXEZ9Hsha+jqI+W56DaID8c2vBRqNU4JnNgTZs1xOjXPmL+jLz+bxRemN3tGW5MnzJCMKJeiOYDTTKXEceGx3PdpEweoHLgVM5WPmO0C3eJNUg1LxY/Nld5jaIq1DE4tbgE2ayjtoWhK24VxStwfwyugyR0cqZWEewzNcWbqmmDjL+qJ3Z5D9BmQpDwqMSa6jOZ32me6CxzH4BMcxCUQOECXOCBKesiymEqMz5oeYWYIjhHDlenOMYWaInDA7Tsz+bga2rCmZ98YNKb1rwGuJcdgv6a8Q56/u+MpLVjTt2hhxNf6JIiRiXOGgUObfXNclOo3a4nQncPd9BHVxFOMzcpbCu1KGQp7dYmQW+ViuVJi+xIHbDfoktnuY3EJ5BWKp5ibI17lmscPHHY+KyWiPa3hN79ZdHiLhTnhD7HqLwyF5z3YN4xEqJKO2xVCNG3fRRYhuZQBSaKJ/ryEDtGB81Og5hlj8tDLKcG1RRdzPTdZpPU24Dv5LDE9nyipqcltuhZo2p6XN3mM2iq+PCg7u1OvRRpHlBtKCnwx0ATZywdBxKnIYrglBz7EsO3Y1l4cHpHWelcD1ZheZZGZ4gdGyEQp1abHPxWk9p3LhGrE/I2h84phE/VhTLR571myxbYhdacnuh6obmSm9ksYpTEvGeGAK7644OdBNR7j2d8UudEXBPUbyRnhk99UjLBwqEiP2vwA6WPXK3V4BsCCQIFiOE4J9DIsaQw+dyvF1aiNm8cezr3oAOP/MGxcMwzUd7ZxuhH4YVWEj2weFJtlz4ItuiJcUYUTTYxY4bjcMBt3yCZ6gO5/EEJuoekGTpvG7jX0F9q5n/wZGETBOgHBxh7gHZsRpLg3fwYGzTVcgGSzuD6IiR0g25TRciHwljFoWOQSlD1dZIknRPfS8FTYnijSljGILXQJ6SOnzYT1GeTJHtFougYelC+1S3OHwi2kwW2cK9/0tYTCrxT/5PAaoFh5V50LvMRoLYnaCzaO8QSPvOt7FRRqkaAD+VhNXYBss5A/icUeuwxKtfC67YmlLrbQCcg273DnIX14NnBeAfhJWM5eCXM98FT7qhYnINtMoXXgT+IT5mH0NCa/oDRySh0Hmv+QQpK6U+IlJX3e83sLDTgm2u567wlVuhlcpNmzEksJX459P5xf3/qNIQkfuBqaMzr0BKoyZ4jRplq1iSXH5MUsbi/1w3o7eRz/FW5hXXJPc+Yt3kDEYzfIS/br6f2Vk/95g+VInrQ/R/HiJf+DJXhmPSmzUE4PnvqPbf/7z19EnPtpp2I8tfs7ntpRIz/tUpS3dn7LQ5NDL+1Q3O61r3Z9TzHPdNUOvZH9K6Djm/se2fFNIHO873tjjs53DHV94W9yDDcM";var Gh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AYht+malUqDnYQcchQnSyIiugmVSyChdJWaNXB5NI/aNKQpLg4Cq4FB38Wqw4uzro6uAqC4A+Iq4uToouU+F1SaBHjHcc9vPe9L3ffAUK9zFSzYxxQNctIxqJiJrsqBl7RRbMHs5iRmKnHU4tpeI6ve/j4fhfhWd51f44+JWcywCcSzzHdsIg3iKc3LZ3zPnGIFSWF+Jx4zKALEj9yXXb5jXPBYYFnhox0cp44RCwW2lhuY1Y0VOIp4rCiapQvZFxWOG9xVstV1rwnf2Ewp62kuE5rGDEsIY4ERMioooQyLERo10gxkaTzqId/yPEnyCWTqwRGjgVUoEJy/OB/8Lu3Zn5ywk0KRoHOF9v+GAECu0CjZtvfx7bdOAH8z8CV1vJX6sDMJ+m1lhY+Avq3gYvrlibvAZc7wOCTLhmSI/lpCfk88H5G35QFBm6B3jW3b81znD4AaerV8g1wcAiMFih73ePd3e19+7em2b8f4B1y0yv9YvYAAAAGYktHRADZAKIAhTqIWPYAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfnBgYJOi0CGZJlAAAAGXRFWHRDb21tZW50AENyZWF0ZWQgd2l0aCBHSU1QV4EOFwAAAD9JREFUCNd1jcEJADAIA1NXyP5j+LK7pR8tIhgQNBciAECkRGruJlJwRwGkROp0Y8ruAr4f+acmZltsoAf6/QADBCX4xA+nZQAAAABJRU5ErkJggg==";function Jh(n,e,t){let i=n.slice();return i[7]=e[t],i}s(Jh,"get_each_context_1");function Hh(n,e,t){let i=n.slice();return i[7]=e[t],i}s(Hh,"get_each_context");function yL(n){let e;return{c(){e=V("i"),T(e,"class","fa fa-question dialog_form_description dialog-form-description svelte-plkvsq"),$e(e,"visibility","hidden")},m(t,i){G(t,e,i)},p:re,d(t){t&&z(e)}}}s(yL,"create_else_block");function wL(n){let e,t,i;return{c(){e=V("i"),T(e,"class","fa fa-question dialog_form_description dialog-form-description svelte-plkvsq")},m(r,a){G(r,e,a),t||(i=De(e,"click",n[3]),t=!0)},p:re,d(r){r&&z(e),t=!1,i()}}}s(wL,"create_if_block_2");function xL(n){let e,t,i,r,a=n[1].split(` -`),o=[];for(let l=0;l{"label"in d&&t(4,a=d.label),"tooltip"in d&&t(0,o=d.tooltip),"warning_text"in d&&t(1,l=d.warning_text),"error_text"in d&&t(2,c=d.error_text),"$$scope"in d&&t(5,r=d.$$scope)},n.$$.update=()=>{if(n.$$.dirty&20)e:c&&(Rr.get()[a]=c)},[o,l,c,u,a,r,i]}s(TL,"instance");var Lc=class extends je{constructor(e){super(),Ie(this,e,TL,EL,Ae,{label:4,tooltip:0,warning_text:1,error_text:2})}};s(Lc,"BaseDialogItem");var kn=Lc;(()=>{let n=Blockbench.addCSS(".base_dialog_item.svelte-plkvsq{display:flex;flex-direction:row;justify-content:space-between}.slot_container.svelte-plkvsq{flex-grow:1}.warning_text.svelte-plkvsq{display:flex;align-items:center;color:var(--color-warning);font-family:var(--font-code);font-size:0.8em}.warning_lines.svelte-plkvsq{display:flex;flex-direction:column}.error_text.svelte-plkvsq{display:flex;align-items:center;color:var(--color-error);font-family:var(--font-code);font-size:0.8em}.error_lines.svelte-plkvsq{display:flex;flex-direction:column}.text_icon.svelte-plkvsq{margin-right:8px}.dialog-form-description.svelte-plkvsq{padding-top:12px}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();function CL(n){let e,t,i,r,a,o,l,c;return{c(){e=V("div"),t=V("label"),i=Ne(n[0]),r=K(),a=V("input"),T(t,"class","name_space_left"),T(t,"for","name"),T(a,"type","text"),T(a,"class","dark_bordered half focusable_input svelte-oj6m6h"),T(a,"id","name"),a.disabled=n[2],T(a,"style",o=n[2]?"color: var(--color-subtle_text);":""),T(e,"class","dialog_bar form_bar")},m(u,d){G(u,e,d),N(e,t),N(t,i),N(e,r),N(e,a),mt(a,n[3]),l||(c=[De(a,"input",n[9]),De(a,"change",n[6])],l=!0)},p(u,d){d&1&&tt(i,u[0]),d&4&&(a.disabled=u[2]),d&4&&o!==(o=u[2]?"color: var(--color-subtle_text);":"")&&T(a,"style",o),d&8&&a.value!==u[3]&&mt(a,u[3])},d(u){u&&z(e),l=!1,At(c)}}}s(CL,"create_default_slot");function AL(n){let e,t;return e=new kn({props:{label:n[0],tooltip:n[1],warning_text:n[4],error_text:n[5],$$slots:{default:[CL]},$$scope:{ctx:n}}}),{c(){fe(e.$$.fragment)},m(i,r){de(e,i,r),t=!0},p(i,[r]){let a={};r&1&&(a.label=i[0]),r&2&&(a.tooltip=i[1]),r&16&&(a.warning_text=i[4]),r&32&&(a.error_text=i[5]),r&1037&&(a.$$scope={dirty:r,ctx:i}),e.$set(a)},i(i){t||(W(e.$$.fragment,i),t=!0)},o(i){Y(e.$$.fragment,i),t=!1},d(i){ue(e,i)}}}s(AL,"create_fragment");function SL(n,e,t){let{label:i}=e,{tooltip:r=""}=e,{value:a}=e,{disabled:o=!1}=e,{valueChecker:l=void 0}=e,c=a.get(),u="",d="";function m(){if(l){let f=l(c);f.type==="error"?t(5,d=f.message):t(5,d=""),f.type==="warning"?t(4,u=f.message):t(4,u="")}a.set(c),t(3,c=a.get())}s(m,"onValueChange"),m();function p(){c=this.value,t(3,c)}return s(p,"input_input_handler"),n.$$set=f=>{"label"in f&&t(0,i=f.label),"tooltip"in f&&t(1,r=f.tooltip),"value"in f&&t(7,a=f.value),"disabled"in f&&t(2,o=f.disabled),"valueChecker"in f&&t(8,l=f.valueChecker)},[i,r,o,c,u,d,m,a,l,p]}s(SL,"instance");var Pc=class extends je{constructor(e){super(),Ie(this,e,SL,AL,Ae,{label:0,tooltip:1,value:7,disabled:2,valueChecker:8})}};s(Pc,"LineInput");var hn=Pc;(()=>{let n=Blockbench.addCSS("input.svelte-oj6m6h{font-family:var(--font-code)}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();function jL(n){let e,t,i,r,a,o,l,c,u,d;return{c(){e=V("div"),t=V("label"),i=Ne(n[0]),r=K(),a=V("div"),o=V("input"),l=K(),c=V("div"),c.innerHTML='code',T(t,"class","name_space_left"),T(t,"for","name"),T(o,"id","snapping"),T(o,"class","dark_bordered focusable_input"),T(o,"inputmode","decimal"),T(c,"class","tool numaric_input_slider"),T(a,"class","numeric_input"),T(e,"class","dialog_bar form_bar")},m(m,p){G(m,e,p),N(e,t),N(t,i),N(e,r),N(e,a),N(a,o),n[9](o),mt(o,n[5]),N(a,l),N(a,c),n[11](c),u||(d=De(o,"input",n[10]),u=!0)},p(m,p){p&1&&tt(i,m[0]),p&32&&o.value!==m[5]&&mt(o,m[5])},d(m){m&&z(e),n[9](null),n[11](null),u=!1,d()}}}s(jL,"create_default_slot");function IL(n){let e,t;return e=new kn({props:{label:n[0],tooltip:n[1],$$slots:{default:[jL]},$$scope:{ctx:n}}}),{c(){fe(e.$$.fragment)},m(i,r){de(e,i,r),t=!0},p(i,[r]){let a={};r&1&&(a.label=i[0]),r&2&&(a.tooltip=i[1]),r&8249&&(a.$$scope={dirty:r,ctx:i}),e.$set(a)},i(i){t||(W(e.$$.fragment,i),t=!0)},o(i){Y(e.$$.fragment,i),t=!1},d(i){ue(e,i)}}}s(IL,"create_fragment");function OL(n,e,t){let i,r=re,a=s(()=>(r(),r=ze(c,b=>t(5,i=b)),c),"$$subscribe_value");n.$$.on_destroy.push(()=>r());let{label:o}=e,{tooltip:l=""}=e,{value:c}=e;a();let{min:u=void 0}=e,{max:d=void 0}=e,{step:m=void 0}=e,p=new Molang,f,_;requestAnimationFrame(()=>{addEventListeners(_,"mousedown touchstart",b=>{convertTouchEvent(b);let x=0;function y(C){convertTouchEvent(C);let A=Math.trunc((C.clientX-b.clientX)/10)*(m||1);A!=x&&(c.set(Math.clamp(c.get()+(A-x),u!==void 0?u:-1/0,d!==void 0?d:1/0)||0),x=A)}s(y,"move");function k(C){removeEventListeners(document,"mousemove touchmove",y,null),removeEventListeners(document,"mouseup touchend",k,null)}s(k,"stop"),addEventListeners(document,"mousemove touchmove",y),addEventListeners(document,"mouseup touchend",k)}),addEventListeners(f,"focusout dblclick",()=>{c.set(Math.clamp(p.parse(c.get()),u!==void 0?u:-1/0,d!==void 0?d:1/0)||0)})});function v(b){se[b?"unshift":"push"](()=>{f=b,t(3,f)})}s(v,"input_1_binding");function g(){i=this.value,c.set(i)}s(g,"input_1_input_handler");function h(b){se[b?"unshift":"push"](()=>{_=b,t(4,_)})}return s(h,"div0_binding"),n.$$set=b=>{"label"in b&&t(0,o=b.label),"tooltip"in b&&t(1,l=b.tooltip),"value"in b&&a(t(2,c=b.value)),"min"in b&&t(6,u=b.min),"max"in b&&t(7,d=b.max),"step"in b&&t(8,m=b.step)},[o,l,c,f,_,i,u,d,m,v,g,h]}s(OL,"instance");var Vc=class extends je{constructor(e){super(),Ie(this,e,OL,IL,Ae,{label:0,tooltip:1,value:2,min:6,max:7,step:8})}};s(Vc,"NumberSlider");var xt=Vc;function sl(n){return n*n*n}s(sl,"cubicIn");function Gf(n){let e=n-1;return e*e*e+1}s(Gf,"cubicOut");function ll(n,{delay:e=0,duration:t=400,easing:i=Is}={}){let r=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:a=>`opacity: ${a*r}`}}s(ll,"fade");function cl(n,{from:e,to:t},i={}){let r=getComputedStyle(n),a=r.transform==="none"?"":r.transform,[o,l]=r.transformOrigin.split(" ").map(parseFloat),c=e.left+e.width*o/t.width-(t.left+o),u=e.top+e.height*l/t.height-(t.top+l),{delay:d=0,duration:m=s(f=>Math.sqrt(f)*120,"duration"),easing:p=Gf}=i;return{delay:d,duration:Vn(m)?m(Math.sqrt(c*c+u*u)):m,easing:p,css:(f,_)=>{let v=_*c,g=_*u,h=f+_*e.width/t.width,b=f+_*e.height/t.height;return`transform: ${a} translate(${v}px, ${g}px) scale(${h}, ${b});`}}}s(cl,"flip");function qh(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}s(qh,"ownKeys");function Gc(n){for(var e=1;e=0)&&(t[r]=n[r]);return t}s(NL,"_objectWithoutPropertiesLoose");function BL(n,e){if(n==null)return{};var t=NL(n,e),i,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}s(BL,"_objectWithoutProperties");function DL(n,e){return ML(n)||LL(n,e)||Qf(n,e)||VL()}s(DL,"_slicedToArray");function Vi(n){return RL(n)||FL(n)||Qf(n)||PL()}s(Vi,"_toConsumableArray");function RL(n){if(Array.isArray(n))return Hf(n)}s(RL,"_arrayWithoutHoles");function ML(n){if(Array.isArray(n))return n}s(ML,"_arrayWithHoles");function FL(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}s(FL,"_iterableToArray");function LL(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i=[],r=!0,a=!1,o,l;try{for(t=t.call(n);!(r=(o=t.next()).done)&&(i.push(o.value),!(e&&i.length===e));r=!0);}catch(c){a=!0,l=c}finally{try{!r&&t.return!=null&&t.return()}finally{if(a)throw l}}return i}}s(LL,"_iterableToArrayLimit");function Qf(n,e){if(n){if(typeof n=="string")return Hf(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Hf(n,e)}}s(Qf,"_unsupportedIterableToArray");function Hf(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t=n.length?{done:!0}:{done:!1,value:n[i++]}},e:function(c){throw c},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,l;return{s:function(){t=t.call(n)},n:function(){var c=t.next();return a=c.done,c},e:function(c){o=!0,l=c},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw l}}}}s(gl,"_createForOfIteratorHelper");var zL="finalize",UL="consider";function Fo(n,e,t){n.dispatchEvent(new CustomEvent(zL,{detail:{items:e,info:t}}))}s(Fo,"dispatchFinalizeEvent");function da(n,e,t){n.dispatchEvent(new CustomEvent(UL,{detail:{items:e,info:t}}))}s(da,"dispatchConsiderEvent");var Zc="draggedEntered",hl="draggedLeft",Xc="draggedOverIndex",em="draggedLeftDocument",Jc={LEFT_FOR_ANOTHER:"leftForAnother",OUTSIDE_OF_ANY:"outsideOfAny"};function GL(n,e,t){n.dispatchEvent(new CustomEvent(Zc,{detail:{indexObj:e,draggedEl:t}}))}s(GL,"dispatchDraggedElementEnteredContainer");function JL(n,e,t){n.dispatchEvent(new CustomEvent(hl,{detail:{draggedEl:e,type:Jc.LEFT_FOR_ANOTHER,theOtherDz:t}}))}s(JL,"dispatchDraggedElementLeftContainerForAnother");function HL(n,e){n.dispatchEvent(new CustomEvent(hl,{detail:{draggedEl:e,type:Jc.OUTSIDE_OF_ANY}}))}s(HL,"dispatchDraggedElementLeftContainerForNone");function $L(n,e,t){n.dispatchEvent(new CustomEvent(Xc,{detail:{indexObj:e,draggedEl:t}}))}s($L,"dispatchDraggedElementIsOverIndex");function KL(n){window.dispatchEvent(new CustomEvent(em,{detail:{draggedEl:n}}))}s(KL,"dispatchDraggedLeftDocument");var si={DRAG_STARTED:"dragStarted",DRAGGED_ENTERED:Zc,DRAGGED_ENTERED_ANOTHER:"dragEnteredAnother",DRAGGED_OVER_INDEX:Xc,DRAGGED_LEFT:hl,DRAGGED_LEFT_ALL:"draggedLeftAll",DROPPED_INTO_ZONE:"droppedIntoZone",DROPPED_INTO_ANOTHER:"droppedIntoAnother",DROPPED_OUTSIDE_OF_ANY:"droppedOutsideOfAny",DRAG_STOPPED:"dragStopped"},mi={POINTER:"pointer",KEYBOARD:"keyboard"},ir="isDndShadowItem",tm="data-is-dnd-shadow-item-internal",qL="data-is-dnd-shadow-item-hint",WL="id:dnd-shadow-placeholder-0000",ZL="dnd-action-dragged-el",Dn="id",$f=0;function sb(){$f++}s(sb,"incrementActiveDropZoneCount");function lb(){if($f===0)throw new Error("Bug! trying to decrement when there are no dropzones");$f--}s(lb,"decrementActiveDropZoneCount");var nm=typeof window>"u",dt=s(function(){},"printDebug");function Kf(n){var e,t=n.getBoundingClientRect(),i=getComputedStyle(n),r=i.transform;if(r){var a,o,l,c;if(r.startsWith("matrix3d("))e=r.slice(9,-1).split(/, /),a=+e[0],o=+e[5],l=+e[12],c=+e[13];else if(r.startsWith("matrix("))e=r.slice(7,-1).split(/, /),a=+e[0],o=+e[3],l=+e[4],c=+e[5];else return t;var u=i.transformOrigin,d=t.x-l-(1-a)*parseFloat(u),m=t.y-c-(1-o)*parseFloat(u.slice(u.indexOf(" ")+1)),p=a?t.width/a:n.offsetWidth,f=o?t.height/o:n.offsetHeight;return{x:d,y:m,width:p,height:f,top:m,right:d+p,bottom:m+f,left:d}}else return t}s(Kf,"getBoundingRectNoTransforms");function cb(n){var e=Kf(n);return{top:e.top+window.scrollY,bottom:e.bottom+window.scrollY,left:e.left+window.scrollX,right:e.right+window.scrollX}}s(cb,"getAbsoluteRectNoTransforms");function ub(n){var e=n.getBoundingClientRect();return{top:e.top+window.scrollY,bottom:e.bottom+window.scrollY,left:e.left+window.scrollX,right:e.right+window.scrollX}}s(ub,"getAbsoluteRect");function db(n){return{x:(n.left+n.right)/2,y:(n.top+n.bottom)/2}}s(db,"findCenter");function XL(n,e){return Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2))}s(XL,"calcDistance");function Yc(n,e){return n.y<=e.bottom&&n.y>=e.top&&n.x>=e.left&&n.x<=e.right}s(Yc,"isPointInsideRect");function ml(n){return db(ub(n))}s(ml,"findCenterOfElement");function Wh(n,e){var t=ml(n),i=cb(e);return Yc(t,i)}s(Wh,"isCenterOfAInsideB");function YL(n,e){var t=ml(n),i=ml(e);return XL(t,i)}s(YL,"calcDistanceBetweenCenters");function QL(n){var e=ub(n);return e.right<0||e.left>document.documentElement.scrollWidth||e.bottom<0||e.top>document.documentElement.scrollHeight}s(QL,"isElementOffDocument");var Do;function im(){dt(function(){return"resetting indexes cache"}),Do=new Map}s(im,"resetIndexesCache");im();function eP(n){var e=Array.from(n.children).findIndex(function(t){return t.getAttribute(tm)});if(e>=0)return Do.has(n)||Do.set(n,new Map),Do.get(n).set(e,cb(n.children[e])),e}s(eP,"cacheShadowRect");function tP(n,e){if(!Wh(n,e))return null;var t=e.children;if(t.length===0)return{index:0,isProximityBased:!0};for(var i=eP(e),r=0;r1&&arguments[1]!==void 0?arguments[1]:0;return n.parentElement?fb(n.parentElement,e+1):e-1}s(fb,"_getDepth");function nP(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(var t in n)if(!{}.hasOwnProperty.call(e,t)||e[t]!==n[t])return!1;return!0}s(nP,"areObjectsShallowEqual");function iP(n,e){if(n.length!==e.length)return!1;for(var t=0;t2&&arguments[2]!==void 0?arguments[2]:rP,i=arguments.length>3?arguments[3]:void 0,r,a,o=!1,l,c=Array.from(e).sort(function(d,m){return Hc(m)-Hc(d)});function u(){var d=ml(n),m=i.multiScrollIfNeeded();if(!m&&l&&Math.abs(l.x-d.x)o.clientHeight&&(l.bottomo.clientWidth&&(l.right0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0;dt(function(){return"creating multi-scroller"});var t=dP(n),i=Array.from(t).sort(function(l,c){return Hc(c)-Hc(l)}),r=sP(),a=r.scrollIfNeeded;function o(){var l=e();if(!l||!i)return!1;for(var c=i.filter(function(m){return Yc(l,m.getBoundingClientRect())||m===document.scrollingElement}),u=0;u0?o:function(){return!1}}}s(cP,"createMultiScroller");function uP(n){if(!n)return[];for(var e=[],t=n;t;){var i=window.getComputedStyle(t),r=i.overflow;r.split(" ").some(function(a){return a.includes("auto")||a.includes("scroll")})&&e.push(t),t=t.parentElement}return e}s(uP,"findScrollableParents");function dP(n){var e=new Set,t=gl(n),i;try{for(t.s();!(i=t.n()).done;){var r=i.value;uP(r).forEach(function(a){return e.add(a)})}}catch(a){t.e(a)}finally{t.f()}return(document.scrollingElement.scrollHeight>document.scrollingElement.clientHeight||document.scrollingElement.scrollWidth>document.scrollingElement.clientHeight)&&e.add(document.scrollingElement),e}s(dP,"findRelevantScrollContainers");function fP(n){var e=n.cloneNode(!0),t=[],i=n.tagName==="SELECT",r=i?[n]:Vi(n.querySelectorAll("select")),a=gl(r),o;try{for(a.s();!(o=a.n()).done;){var l=o.value;t.push(l.value)}}catch(x){a.e(x)}finally{a.f()}if(r.length>0)for(var c=i?[e]:Vi(e.querySelectorAll("select")),u=0;u0)for(var v=f?[e]:Vi(e.querySelectorAll("canvas")),g=0;g1&&arguments[1]!==void 0?arguments[1]:function(){},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){return[]};n.forEach(function(i){var r=e(i);Object.keys(r).forEach(function(a){i.style[a]=r[a]}),t(i).forEach(function(a){return i.classList.add(a)})})}s(Uc,"styleActiveDropZones");function $c(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){return[]};n.forEach(function(i){var r=e(i);Object.keys(r).forEach(function(a){i.style[a]=""}),t(i).forEach(function(a){return i.classList.contains(a)&&i.classList.remove(a)})})}s($c,"styleInactiveDropZones");function wP(n){var e=n.style.minHeight;n.style.minHeight=window.getComputedStyle(n).getPropertyValue("height");var t=n.style.minWidth;return n.style.minWidth=window.getComputedStyle(n).getPropertyValue("width"),s(function(){n.style.minHeight=e,n.style.minWidth=t},"undo")}s(wP,"preventShrinking");var xP="--any--",kP=100,EP=20,Xh=3,Yh={outline:"rgba(255, 255, 102, 0.7) solid 2px"},Qh="data-is-dnd-original-dragged-item",Qi,$n,fi,Qc,pn,eu,ua,Hn,la,xi,Ga=!1,rm=!1,am,bl=!1,dl=[],nr=new Map,Tn=new Map,Jf=new WeakMap;function TP(n,e){dt(function(){return"registering drop-zone if absent"}),nr.has(e)||nr.set(e,new Set),nr.get(e).has(n)||(nr.get(e).add(n),sb())}s(TP,"registerDropZone");function eb(n,e){nr.get(e).delete(n),lb(),nr.get(e).size===0&&nr.delete(e)}s(eb,"unregisterDropZone");function CP(){dt(function(){return"watching dragged element"});var n=nr.get(Qc),e=gl(n),t;try{for(e.s();!(t=e.n()).done;){var i=t.value;i.addEventListener(Zc,gb),i.addEventListener(hl,hb),i.addEventListener(Xc,bb)}}catch(l){e.e(l)}finally{e.f()}window.addEventListener(em,Lo);var r=Math.max.apply(Math,Vi(Array.from(n.keys()).map(function(l){return Tn.get(l).dropAnimationDurationMs}))),a=r===0?EP:Math.max(r,kP),o=cP(n,function(){return xi});aP($n,n,a*1.07,o)}s(CP,"watchDraggedElement");function AP(){dt(function(){return"unwatching dragged element"});var n=nr.get(Qc),e=gl(n),t;try{for(e.s();!(t=e.n()).done;){var i=t.value;i.removeEventListener(Zc,gb),i.removeEventListener(hl,hb),i.removeEventListener(Xc,bb)}}catch(r){e.e(r)}finally{e.f()}window.removeEventListener(em,Lo),oP()}s(AP,"unWatchDraggedElement");function tu(n){return n.findIndex(function(e){return!!e[ir]})}s(tu,"findShadowElementIdx");function SP(n){var e;return Gc(Gc({},n),{},(e={},Mo(e,ir,!0),Mo(e,Dn,WL),e))}s(SP,"createShadowElData");function gb(n){dt(function(){return["dragged entered",n.currentTarget,n.detail]});var e=Tn.get(n.currentTarget),t=e.items,i=e.dropFromOthersDisabled;if(i&&n.currentTarget!==pn){dt(function(){return"ignoring dragged entered because drop is currently disabled"});return}if(bl=!1,t=t.filter(function(d){return d[Dn]!==ua[Dn]}),dt(function(){return"dragged entered items ".concat(Cr(t))}),pn!==n.currentTarget){var r=Tn.get(pn).items,a=r.filter(function(d){return!d[ir]});da(pn,a,{trigger:si.DRAGGED_ENTERED_ANOTHER,id:fi[Dn],source:mi.POINTER})}var o=n.detail.indexObj,l=o.index,c=o.isProximityBased,u=c&&l===n.currentTarget.children.length-1?l+1:l;Hn=n.currentTarget,t.splice(u,0,ua),da(n.currentTarget,t,{trigger:si.DRAGGED_ENTERED,id:fi[Dn],source:mi.POINTER})}s(gb,"handleDraggedEntered");function hb(n){if(Ga){dt(function(){return["dragged left",n.currentTarget,n.detail]});var e=Tn.get(n.currentTarget),t=e.items,i=e.dropFromOthersDisabled;if(i&&n.currentTarget!==pn&&n.currentTarget!==Hn){dt(function(){return"drop is currently disabled"});return}var r=Vi(t),a=tu(r);a!==-1&&r.splice(a,1);var o=Hn;Hn=void 0;var l=n.detail,c=l.type,u=l.theOtherDz;if(c===Jc.OUTSIDE_OF_ANY||c===Jc.LEFT_FOR_ANOTHER&&u!==pn&&Tn.get(u).dropFromOthersDisabled){dt(function(){return"dragged left all, putting shadow element back in the origin dz"}),bl=!0,Hn=pn;var d=o===pn?r:Vi(Tn.get(pn).items);d.splice(eu,0,ua),da(pn,d,{trigger:si.DRAGGED_LEFT_ALL,id:fi[Dn],source:mi.POINTER})}da(n.currentTarget,r,{trigger:si.DRAGGED_LEFT,id:fi[Dn],source:mi.POINTER})}}s(hb,"handleDraggedLeft");function bb(n){dt(function(){return["dragged is over index",n.currentTarget,n.detail]});var e=Tn.get(n.currentTarget),t=e.items,i=e.dropFromOthersDisabled;if(i&&n.currentTarget!==pn){dt(function(){return"drop is currently disabled"});return}var r=Vi(t);bl=!1;var a=n.detail.indexObj.index,o=tu(r);o!==-1&&r.splice(o,1),r.splice(a,0,ua),da(n.currentTarget,r,{trigger:si.DRAGGED_OVER_INDEX,id:fi[Dn],source:mi.POINTER})}s(bb,"handleDraggedIsOverIndex");function Kc(n){n.preventDefault();var e=n.touches?n.touches[0]:n;xi={x:e.clientX,y:e.clientY},$n.style.transform="translate3d(".concat(xi.x-la.x,"px, ").concat(xi.y-la.y,"px, 0)")}s(Kc,"handleMouseMove");function Lo(){dt(function(){return"dropped"}),rm=!0,window.removeEventListener("mousemove",Kc),window.removeEventListener("touchmove",Kc),window.removeEventListener("mouseup",Lo),window.removeEventListener("touchend",Lo),AP(),gP($n),Hn||(dt(function(){return"element was dropped right after it left origin but before entering somewhere else"}),Hn=pn),dt(function(){return["dropped in dz",Hn]});var n=Tn.get(Hn),e=n.items,t=n.type;$c(nr.get(t),function(a){return Tn.get(a).dropTargetStyle},function(a){return Tn.get(a).dropTargetClasses});var i=tu(e);i===-1&&Hn===pn&&(i=eu),e=e.map(function(a){return a[ir]?fi:a});function r(){am(),Fo(Hn,e,{trigger:bl?si.DROPPED_OUTSIDE_OF_ANY:si.DROPPED_INTO_ZONE,id:fi[Dn],source:mi.POINTER}),Hn!==pn&&Fo(pn,Tn.get(pn).items,{trigger:si.DROPPED_INTO_ANOTHER,id:fi[Dn],source:mi.POINTER}),i!==-1&&yP(Hn.children[i]),OP()}s(r,"finalizeWithinZone"),jP(i,r)}s(Lo,"handleDrop");function jP(n,e){var t=n>-1?Kf(Hn.children[n]):Kf(Hn),i={x:t.left-parseFloat($n.style.left),y:t.top-parseFloat($n.style.top)},r=Tn.get(Hn),a=r.dropAnimationDurationMs,o="transform ".concat(a,"ms ease");$n.style.transition=$n.style.transition?$n.style.transition+","+o:o,$n.style.transform="translate3d(".concat(i.x,"px, ").concat(i.y,"px, 0)"),window.setTimeout(e,a)}s(jP,"animateDraggedToFinalPosition");function IP(n,e){dl.push({dz:n,destroy:e}),window.requestAnimationFrame(function(){_b(n),document.body.appendChild(n)})}s(IP,"scheduleDZForRemovalAfterDrop");function OP(){$n.remove(),Qi.remove(),dl.length&&(dt(function(){return["will destroy zones that were removed during drag",dl]}),dl.forEach(function(n){var e=n.dz,t=n.destroy;t(),e.remove()}),dl=[]),$n=void 0,Qi=void 0,fi=void 0,Qc=void 0,pn=void 0,eu=void 0,ua=void 0,Hn=void 0,la=void 0,xi=void 0,Ga=!1,rm=!1,am=void 0,bl=!1}s(OP,"cleanupPostDrop");function NP(n,e){var t=!1,i={items:void 0,type:void 0,flipDurationMs:0,dragDisabled:!1,morphDisabled:!1,dropFromOthersDisabled:!1,dropTargetStyle:Yh,dropTargetClasses:[],transformDraggedElement:s(function(){},"transformDraggedElement"),centreDraggedOnCursor:!1};dt(function(){return["dndzone good to go options: ".concat(Cr(e),", config: ").concat(Cr(i)),{node:n}]});var r=new Map;function a(){window.addEventListener("mousemove",c,{passive:!1}),window.addEventListener("touchmove",c,{passive:!1,capture:!1}),window.addEventListener("mouseup",l,{passive:!1}),window.addEventListener("touchend",l,{passive:!1})}s(a,"addMaybeListeners");function o(){window.removeEventListener("mousemove",c),window.removeEventListener("touchmove",c),window.removeEventListener("mouseup",l),window.removeEventListener("touchend",l)}s(o,"removeMaybeListeners");function l(p){o(),Qi=void 0,la=void 0,xi=void 0,p.type==="touchend"&&p.target.click()}s(l,"handleFalseAlarm");function c(p){p.preventDefault();var f=p.touches?p.touches[0]:p;xi={x:f.clientX,y:f.clientY},(Math.abs(xi.x-la.x)>=Xh||Math.abs(xi.y-la.y)>=Xh)&&(o(),d())}s(c,"handleMouseMoveMaybeDragStart");function u(p){if(p.target!==p.currentTarget&&(p.target.value!==void 0||p.target.isContentEditable)){dt(function(){return"won't initiate drag on a nested input element"});return}if(p.button){dt(function(){return"ignoring none left click button: ".concat(p.button)});return}if(Ga){dt(function(){return"cannot start a new drag before finalizing previous one"});return}p.preventDefault(),p.stopPropagation();var f=p.touches?p.touches[0]:p;la={x:f.clientX,y:f.clientY},xi=Gc({},la),Qi=p.currentTarget,a()}s(u,"handleMouseDown");function d(){dt(function(){return["drag start config: ".concat(Cr(i)),Qi]}),Ga=!0;var p=r.get(Qi);eu=p,pn=Qi.parentElement;var f=pn.closest("dialog")||pn.getRootNode(),_=f.body||f,v=i.items,g=i.type,h=i.centreDraggedOnCursor,b=Vi(v);fi=b[p],Qc=g,ua=SP(fi),$n=_P(Qi,h&&xi),Qi.setAttribute(Qh,!0);function x(){$n.parentElement?window.requestAnimationFrame(x):(_.appendChild($n),$n.focus(),CP(),_b(Qi),_.appendChild(Qi),ua[Dn]=fi[Dn])}s(x,"keepOriginalElementInDom"),window.requestAnimationFrame(x),Uc(Array.from(nr.get(i.type)).filter(function(y){return y===pn||!Tn.get(y).dropFromOthersDisabled}),function(y){return Tn.get(y).dropTargetStyle},function(y){return Tn.get(y).dropTargetClasses}),b.splice(p,1,ua),am=wP(pn),da(pn,b,{trigger:si.DRAG_STARTED,id:fi[Dn],source:mi.POINTER}),window.addEventListener("mousemove",Kc,{passive:!1}),window.addEventListener("touchmove",Kc,{passive:!1,capture:!1}),window.addEventListener("mouseup",Lo,{passive:!1}),window.addEventListener("touchend",Lo,{passive:!1})}s(d,"handleDragStart");function m(p){var f=p.items,_=f===void 0?void 0:f,v=p.flipDurationMs,g=v===void 0?0:v,h=p.type,b=h===void 0?xP:h,x=p.dragDisabled,y=x===void 0?!1:x,k=p.morphDisabled,C=k===void 0?!1:k,A=p.dropFromOthersDisabled,I=A===void 0?!1:A,S=p.dropTargetStyle,L=S===void 0?Yh:S,O=p.dropTargetClasses,E=O===void 0?[]:O,B=p.transformDraggedElement,H=B===void 0?function(){}:B,ee=p.centreDraggedOnCursor,ae=ee===void 0?!1:ee;i.dropAnimationDurationMs=g,i.type&&b!==i.type&&eb(n,i.type),i.type=b,i.items=Vi(_),i.dragDisabled=y,i.morphDisabled=C,i.transformDraggedElement=H,i.centreDraggedOnCursor=ae,t&&Ga&&!rm&&(!nP(L,i.dropTargetStyle)||!iP(E,i.dropTargetClasses))&&($c([n],function(){return i.dropTargetStyle},function(){return E}),Uc([n],function(){return L},function(){return E})),i.dropTargetStyle=L,i.dropTargetClasses=Vi(E);function ne(Q,P){return Tn.get(Q)?Tn.get(Q)[P]:i[P]}s(ne,"getConfigProp"),t&&Ga&&i.dropFromOthersDisabled!==I&&(I?$c([n],function(Q){return ne(Q,"dropTargetStyle")},function(Q){return ne(Q,"dropTargetClasses")}):Uc([n],function(Q){return ne(Q,"dropTargetStyle")},function(Q){return ne(Q,"dropTargetClasses")})),i.dropFromOthersDisabled=I,Tn.set(n,i),TP(n,b);for(var ve=tu(i.items),X=0;X".concat(e,"

      "),t.style.display="none",t.style.position="fixed",t.style.zIndex="-5",t}s(MP,"instructionToHiddenDiv");function Ro(n){if(!nm){En||Zf(),En.innerHTML="";var e=document.createTextNode(n);En.appendChild(e),En.style.display="none",En.style.display="inline"}}s(Ro,"alertToScreenReader");var FP="--any--",tb={outline:"rgba(255, 255, 102, 0.7) solid 2px"},Pi=!1,Xf,Xn,Ja="",Ua,er,ca="",qc=new WeakSet,nb=new WeakMap,ib=new WeakMap,Yf=new Map,Jn=new Map,tr=new Map,Wc;function LP(n,e){dt(function(){return"registering drop-zone if absent"}),tr.size===0&&(dt(function(){return"adding global keydown and click handlers"}),Wc=DP(),window.addEventListener("keydown",yb),window.addEventListener("click",wb)),tr.has(e)||tr.set(e,new Set),tr.get(e).has(n)||(tr.get(e).add(n),sb())}s(LP,"registerDropZone$1");function rb(n,e){dt(function(){return"unregistering drop-zone"}),Xn===n&&_l(),tr.get(e).delete(n),lb(),tr.get(e).size===0&&tr.delete(e),tr.size===0&&(dt(function(){return"removing global keydown and click handlers"}),window.removeEventListener("keydown",yb),window.removeEventListener("click",wb),Wc=void 0,RP())}s(rb,"unregisterDropZone$1");function yb(n){if(Pi)switch(n.key){case"Escape":{_l();break}}}s(yb,"globalKeyDownHandler");function wb(){Pi&&(qc.has(document.activeElement)||(dt(function(){return"clicked outside of any draggable"}),_l()))}s(wb,"globalClickHandler");function PP(n){if(dt(function(){return"zone focus"}),!!Pi){var e=n.currentTarget;if(e!==Xn){Ja=e.getAttribute("aria-label")||"";var t=Jn.get(Xn),i=t.items,r=i.find(function(m){return m[Dn]===er}),a=i.indexOf(r),o=i.splice(a,1)[0],l=Jn.get(e),c=l.items,u=l.autoAriaDisabled;e.getBoundingClientRect().top0&&arguments[0]!==void 0?arguments[0]:!0;dt(function(){return"drop"}),Jn.get(Xn).autoAriaDisabled||Ro("Stopped dragging item ".concat(ca)),qc.has(document.activeElement)&&document.activeElement.blur(),n&&da(Xn,Jn.get(Xn).items,{trigger:si.DRAG_STOPPED,id:er,source:mi.KEYBOARD}),$c(tr.get(Xf),function(e){return Jn.get(e).dropTargetStyle},function(e){return Jn.get(e).dropTargetClasses}),Ua=null,er=null,ca="",Xf=null,Xn=null,Ja="",Pi=!1,xb()}s(_l,"handleDrop$1");function VP(n,e){var t={items:void 0,type:void 0,dragDisabled:!1,zoneTabIndex:0,zoneItemTabIndex:0,dropFromOthersDisabled:!1,dropTargetStyle:tb,dropTargetClasses:[],autoAriaDisabled:!1};function i(d,m,p){d.length<=1||d.splice(p,1,d.splice(m,1,d[p])[0])}s(i,"swap");function r(d){switch(dt(function(){return["handling key down",d.key]}),d.key){case"Enter":case" ":{if((d.target.disabled!==void 0||d.target.href||d.target.isContentEditable)&&!qc.has(d.target))return;d.preventDefault(),d.stopPropagation(),Pi?_l():a(d);break}case"ArrowDown":case"ArrowRight":{if(!Pi)return;d.preventDefault(),d.stopPropagation();var m=Jn.get(n),p=m.items,f=Array.from(n.children),_=f.indexOf(d.currentTarget);dt(function(){return["arrow down",_]}),_0&&(t.autoAriaDisabled||Ro("Moved item ".concat(ca," to position ").concat(b," in the list ").concat(Ja)),i(g,b,b-1),Fo(n,g,{trigger:si.DROPPED_INTO_ZONE,id:er,source:mi.KEYBOARD}));break}}}s(r,"handleKeyDown");function a(d){dt(function(){return"drag start"}),l(d.currentTarget),Xn=n,Xf=t.type,Pi=!0;var m=Array.from(tr.get(t.type)).filter(function(f){return f===Xn||!Jn.get(f).dropFromOthersDisabled});if(Uc(m,function(f){return Jn.get(f).dropTargetStyle},function(f){return Jn.get(f).dropTargetClasses}),!t.autoAriaDisabled){var p="Started dragging item ".concat(ca,". Use the arrow keys to move it within its list ").concat(Ja);m.length>1&&(p+=", or tab to another list in order to move the item into it"),Ro(p)}da(n,Jn.get(n).items,{trigger:si.DRAG_STARTED,id:er,source:mi.KEYBOARD}),xb()}s(a,"handleDragStart");function o(d){Pi&&d.currentTarget!==Ua&&(d.stopPropagation(),_l(!1),a(d))}s(o,"handleClick");function l(d){var m=Jn.get(n),p=m.items,f=Array.from(n.children),_=f.indexOf(d);Ua=d,Ua.tabIndex=t.zoneItemTabIndex,er=p[_][Dn],ca=f[_].getAttribute("aria-label")||""}s(l,"setCurrentFocusedItem");function c(d){var m=d.items,p=m===void 0?[]:m,f=d.type,_=f===void 0?FP:f,v=d.dragDisabled,g=v===void 0?!1:v,h=d.zoneTabIndex,b=h===void 0?0:h,x=d.zoneItemTabIndex,y=x===void 0?0:x,k=d.dropFromOthersDisabled,C=k===void 0?!1:k,A=d.dropTargetStyle,I=A===void 0?tb:A,S=d.dropTargetClasses,L=S===void 0?[]:S,O=d.autoAriaDisabled,E=O===void 0?!1:O;t.items=Vi(p),t.dragDisabled=g,t.dropFromOthersDisabled=C,t.zoneTabIndex=b,t.zoneItemTabIndex=y,t.dropTargetStyle=I,t.dropTargetClasses=L,t.autoAriaDisabled=E,t.type&&_!==t.type&&rb(n,t.type),t.type=_,LP(n,_),E||(n.setAttribute("aria-disabled",g),n.setAttribute("role","list"),n.setAttribute("aria-describedby",g?Wc.DND_ZONE_DRAG_DISABLED:Wc.DND_ZONE_ACTIVE)),Jn.set(n,t),Pi?n.tabIndex=n===Xn||Ua.contains(n)||t.dropFromOthersDisabled||Xn&&t.type!==Jn.get(Xn).type?-1:0:n.tabIndex=t.zoneTabIndex,n.addEventListener("focus",PP);for(var B=s(function(ae){var ne=n.children[ae];qc.add(ne),ne.tabIndex=Pi?-1:t.zoneItemTabIndex,E||ne.setAttribute("role","listitem"),ne.removeEventListener("keydown",nb.get(ne)),ne.removeEventListener("click",ib.get(ne)),g||(ne.addEventListener("keydown",r),nb.set(ne,r),ne.addEventListener("click",o),ib.set(ne,o)),Pi&&t.items[ae][Dn]===er&&(dt(function(){return["focusing on",{i:ae,focusedItemId:er}]}),Ua=ne,Ua.tabIndex=t.zoneItemTabIndex,ne.focus())},"_loop"),H=0;H0&&console.warn("dndzone will ignore unknown options",_),!e)throw new Error("no 'items' key provided to dndzone");var v=e.find(function(g){return!{}.hasOwnProperty.call(g,Dn)});if(v)throw new Error("missing '".concat(Dn,"' property for item ").concat(Cr(v)));if(d&&!Array.isArray(d))throw new Error("dropTargetClasses should be an array but instead it is a ".concat(fl(d),", ").concat(Cr(d)));if(l&&!ob(l))throw new Error("zoneTabIndex should be a number but instead it is a ".concat(fl(l),", ").concat(Cr(l)));if(c&&!ob(c))throw new Error("zoneItemTabIndex should be a number but instead it is a ".concat(fl(c),", ").concat(Cr(c)))}s(ab,"validateOptions");function ob(n){return!isNaN(n)&&function(e){return(e|0)===e}(parseFloat(n))}s(ob,"isInt");function GP(n){var e=n,t=new Set;return{get:s(function(){return e},"get"),set:s(function(r){e=r,Array.from(t).forEach(function(a){return a(e)})},"set"),subscribe:s(function(r){t.add(r),r(e)},"subscribe"),unsubscribe:s(function(r){t.delete(r)},"unsubscribe")}}s(GP,"createStore");var tW=GP(!0);function kb(n,e,t){let i=n.slice();return i[17]=e[t],i}s(kb,"get_each_context");function Eb(n,e,t){let i=n.slice();return i[17]=e[t],i}s(Eb,"get_each_context_1");function Tb(n){let e,t;return{c(){e=V("div"),$e(e,"visibility","visible",1),$e(e,"border-bottom","2px solid var(--color-accent)"),$e(e,"width","100%"),$e(e,"height","50%")},m(i,r){G(i,e,r)},p(i,r){n=i},i(i){t||Br(()=>{t=Bs(e,ll,{duration:150,easing:sl}),t.start()})},o:re,d(i){i&&z(e)}}}s(Tb,"create_if_block_1");function Cb(n,e){let t,i,r,a=(e[17].icon||"folder")+"",o,l,c,u=e[17].title+"",d,m,p,f=re,_=e[17][ir]&&Tb(e);return{key:n,first:null,c(){t=V("div"),_&&_.c(),i=K(),r=V("i"),o=Ne(a),l=K(),c=V("span"),d=Ne(u),m=K(),T(r,"class","material-icons notranslate icon"),$e(r,"color","rgb(162, 235, 255)"),T(c,"class","svelte-rl3m5y"),T(t,"class","list-item svelte-rl3m5y"),this.first=t},m(v,g){G(v,t,g),_&&_.m(t,null),N(t,i),N(t,r),N(r,o),N(t,l),N(t,c),N(c,d),N(t,m)},p(v,g){e=v,e[17][ir]?_?g&256&&W(_,1):(_=Tb(e),_.c(),W(_,1),_.m(t,i)):_&&(_.d(1),_=null),g&256&&a!==(a=(e[17].icon||"folder")+"")&&tt(o,a),g&256&&u!==(u=e[17].title+"")&&tt(d,u)},r(){p=t.getBoundingClientRect()},f(){Ns(t),f()},a(){f(),f=Os(t,p,cl,{duration:150})},i(v){W(_)},o:re,d(v){v&&z(t),_&&_.d()}}}s(Cb,"create_each_block_1");function Ab(n){let e,t;return{c(){e=V("div"),$e(e,"visibility","visible",1),$e(e,"border-bottom","2px solid var(--color-accent)"),$e(e,"width","100%"),$e(e,"height","50%")},m(i,r){G(i,e,r)},p(i,r){n=i},i(i){t||Br(()=>{t=Bs(e,ll,{duration:150,easing:sl}),t.start()})},o:re,d(i){i&&z(e)}}}s(Ab,"create_if_block");function Sb(n,e){let t,i,r,a=(e[17].icon||"folder")+"",o,l,c,u=e[17].title+"",d,m,p,f=re,_=e[17][ir]&&Ab(e);return{key:n,first:null,c(){t=V("div"),_&&_.c(),i=K(),r=V("i"),o=Ne(a),l=K(),c=V("span"),d=Ne(u),m=K(),T(r,"class","material-icons notranslate icon"),$e(r,"color","rgb(162, 235, 255)"),T(c,"class","svelte-rl3m5y"),T(t,"class","list-item svelte-rl3m5y"),this.first=t},m(v,g){G(v,t,g),_&&_.m(t,null),N(t,i),N(t,r),N(r,o),N(t,l),N(t,c),N(c,d),N(t,m)},p(v,g){e=v,e[17][ir]?_?g&128&&W(_,1):(_=Ab(e),_.c(),W(_,1),_.m(t,i)):_&&(_.d(1),_=null),g&128&&a!==(a=(e[17].icon||"folder")+"")&&tt(o,a),g&128&&u!==(u=e[17].title+"")&&tt(d,u)},r(){p=t.getBoundingClientRect()},f(){Ns(t),f()},a(){f(),f=Os(t,p,cl,{duration:150})},i(v){W(_)},o:re,d(v){v&&z(t),_&&_.d()}}}s(Sb,"create_each_block");function JP(n){let e,t,i,r,a,o,l=[],c=new Map,u,d,m,p,f,_,v,g,h,b=[],x=new Map,y,k,C,A=n[8],I=s(O=>O[17].id,"get_key");for(let O=0;OO[17].id,"get_key_1");for(let O=0;OC.value===k.value)?p.push({id:y,title:k.name,icon:k.icon}):f.push({id:y,title:k.name,icon:k.icon})}function _(y){t(8,f=y.detail.items)}s(_,"handleSortAvailableItems");function v(y){t(7,p=y.detail.items)}s(v,"handleSortIncludedItems");function g(){m.update(y=>p.map(k=>d.find(C=>C.name===k.title)))}s(g,"finalizeSort");function h(){let y=f;t(8,f=p),t(7,p=y),g()}s(h,"swapColumns");let b=s(y=>{_(y),g()},"finalize_handler"),x=s(y=>{v(y),g()},"finalize_handler_1");return n.$$set=y=>{"label"in y&&t(0,i=y.label),"tooltip"in y&&t(1,r=y.tooltip),"availableItemsColumnLable"in y&&t(2,a=y.availableItemsColumnLable),"availableItemsColumnTooltip"in y&&t(3,o=y.availableItemsColumnTooltip),"includedItemsColumnLable"in y&&t(4,l=y.includedItemsColumnLable),"includedItemsColumnTooltip"in y&&t(5,c=y.includedItemsColumnTooltip),"swapColumnsButtonTooltip"in y&&t(6,u=y.swapColumnsButtonTooltip),"availableItems"in y&&t(13,d=y.availableItems),"includedItems"in y&&t(14,m=y.includedItems)},[i,r,a,o,l,c,u,p,f,_,v,g,h,d,m,b,x]}s($P,"instance");var nu=class extends je{constructor(e){super(),Ie(this,e,$P,HP,Ae,{label:0,tooltip:1,availableItemsColumnLable:2,availableItemsColumnTooltip:3,includedItemsColumnLable:4,includedItemsColumnTooltip:5,swapColumnsButtonTooltip:6,availableItems:13,includedItems:14})}};s(nu,"Collection");var iu=nu;(()=>{let n=Blockbench.addCSS(".main-column-container.svelte-rl3m5y{display:flex;justify-content:space-around}section.sub-column-container.svelte-rl3m5y{display:flex;flex-direction:column;align-items:stretch;width:unset;height:100%;background-color:var(--color-back);border:1px solid var(--color-border);margin:8px;margin-top:0px;padding:4px 8px 30px;max-height:16rem;overflow-y:auto}h3.svelte-rl3m5y{text-align:center;font-size:16px;padding:0px;margin:8px 0px}.column.svelte-rl3m5y{display:flex;flex-direction:column;width:50%}.list-item.svelte-rl3m5y{display:flex;cursor:default !important;width:100%}span.svelte-rl3m5y{padding:0 8px}span.svelte-rl3m5y:hover{color:var(--color-light)}.fa-icon.svelte-rl3m5y{display:flex;align-items:center;justify-content:center;padding-right:8px;padding-left:8px;margin-top:68px}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();function KP(n){let e,t,i;return{c(){e=V("div"),t=V("label"),i=Ne(n[0]),T(t,"class","name_space_left"),T(t,"for","name"),T(e,"class","dialog_bar form_bar")},m(r,a){G(r,e,a),N(e,t),N(t,i),n[6](e)},p(r,a){a&1&&tt(i,r[0])},d(r){r&&z(e),n[6](null)}}}s(KP,"create_default_slot");function qP(n){let e,t;return e=new kn({props:{label:n[0],tooltip:n[1],$$slots:{default:[KP]},$$scope:{ctx:n}}}),{c(){fe(e.$$.fragment)},m(i,r){de(e,i,r),t=!0},p(i,[r]){let a={};r&1&&(a.label=i[0]),r&2&&(a.tooltip=i[1]),r&261&&(a.$$scope={dirty:r,ctx:i}),e.$set(a)},i(i){t||(W(e.$$.fragment,i),t=!0)},o(i){Y(e.$$.fragment,i),t=!1},d(i){ue(e,i)}}}s(qP,"create_fragment");function WP(n,e,t){let{label:i}=e,{tooltip:r=""}=e,{options:a}=e,{defaultOption:o}=e,{value:l}=e,c;l.get()||a[l.get()]||l.set(o);let u=new Interface.CustomElements.SelectInput("dialog-select",{options:a,value:l.get(),onChange(){l.set(u.node.getAttribute("value"))}});requestAnimationFrame(()=>{c.appendChild(u.node)});function d(m){se[m?"unshift":"push"](()=>{c=m,t(2,c)})}return s(d,"div_binding"),n.$$set=m=>{"label"in m&&t(0,i=m.label),"tooltip"in m&&t(1,r=m.tooltip),"options"in m&&t(3,a=m.options),"defaultOption"in m&&t(4,o=m.defaultOption),"value"in m&&t(5,l=m.value)},[i,r,c,a,o,l,d]}s(WP,"instance");var ru=class extends je{constructor(e){super(),Ie(this,e,WP,qP,Ae,{label:0,tooltip:1,options:3,defaultOption:4,value:5})}};s(ru,"Select");var Kn=ru;var jb=s(class{item;index=-1;string;itemCode;line=1;column=0;lineStart=0;lines=[{number:1,startIndex:0,content:""}];constructor(n){this.string=n,this.consume()}get length(){return this.string.length}get progress(){return Math.min(this.index/this.length,1)}get next(){return this.string.at(this.index+1)}get nextCode(){return this.string.charCodeAt(this.index+1)}get currentLine(){return this.lines[this.line-1]}look(n,e=1){return this.string.slice(this.index+n,this.index+n+e)}consume(){let n=this.item;this.item&&(this.currentLine.content+=this.item),this.item=this.string.at(this.index+1),this.itemCode=this.item?.charCodeAt(0),this.index++,this.column++,(n===` -`||n!=null&&this.item==null)&&this.completeLine()}consumeN(n){for(let e=0;e!!e.item&&this.whitespaceChars.includes(e.item))}parseTextComponent(e=!1){let t;if(this.consumeWhitespace(),this.s.item==="{")t=this.parseTextObject();else if(this.s.item==="[")t=this.parseArray();else if(this.s.item==='"')t=this.parseString();else throw new kt(`Unexpected '${this.s.item}' in JsonTextComponent`,this.s);if(this.consumeWhitespace(),e&&this.s.item)throw new kt(`Unexpected '${this.s.item}' in JsonTextComponent`,this.s);return t}parseValue(){let{line:e,column:t}=this.s;if(this.consumeWhitespace(),this.s.item==="{")return this.parseTextObject();if(this.s.item==="[")return this.parseArray();if(this.s.item==='"')return this.parseString();if(this.s.item==="t"||this.s.item==="f")return this.parseBoolean();if(this.s.item==="-"||this.s.item==="."||this.s.item&&this.numChars.includes(this.s.item))return this.parseNumber();throw new kt(`Unexpected ${this.s.item}`,this.s,void 0,e,t)}parseObject(e,t){let{line:i,column:r}=this.s;try{if(this.s.item!=="{")throw new kt(`Unexpected '${this.s.item}' in JsonTextObject`,this.s);this.s.consume(),this.consumeWhitespace();let a={};for(;this.s.item!=="}";){let o=this.parseString();if(this.consumeWhitespace(),this.s.consume(),this.consumeWhitespace(),e(o,a),this.consumeWhitespace(),this.s.item===",")this.s.consume(),this.consumeWhitespace();else{if(this.s.item==="}")break;throw this.s.item===void 0?new kt("Unexpected EOF in JsonTextObject",this.s):new kt(`Unexpected '${this.s.item}' in JsonTextObject`,this.s)}}return this.s.consume(),t&&t(a),a}catch(a){throw new kt("Failed to parse JsonTextObject",this.s,a,i,r)}}parseTextObject(){return this.parseObject((e,t)=>{switch(e){case"block":case"entity":case"font":case"insertion":case"keybind":case"nbt":case"selector":case"separator":case"storage":case"text":case"translate":case"fallback":t[e]=this.parseString();break;case"color":{let i=this.parseString();if(!(i.startsWith("#")||om[i]))throw new kt(`Unknown color '${i}'`,this.s);t.color=i;break}case"bold":case"italic":case"obfuscated":case"strikethrough":case"underlined":t[e]=this.parseBoolean();break;case"with":case"extra":t[e]=this.parseArray();break;case"score":t[e]=this.parseScoreObject();break;case"clickEvent":t[e]=this.parseClickEventObject();break;case"hoverEvent":t[e]=this.parseHoverEventObject();break;default:throw new kt(`Unknown key '${e}' in JsonTextObject`,this.s)}},e=>{if(e.text===void 0&&e.translate===void 0&&e.score===void 0&&e.selector===void 0&&e.keybind===void 0&&e.nbt===void 0)throw new kt("JsonTextObject does not include one of 'text', 'translate', 'score', 'selector', 'keybind', or 'nbt'.",this.s);if(e.nbt!==void 0&&e.block===void 0&&e.entity===void 0&&e.storage===void 0)throw new kt("JsonTextObject includes 'nbt' but does not include one of 'block', 'entity', or 'storage'.",this.s)})}parseScoreObject(){return this.parseObject((e,t)=>{switch(e){case"name":case"objective":t[e]=this.parseString();break;case"value":t[e]=this.parseNumber();break;default:throw new kt(`Unknown key '${e}' in JsonTextObject.score`,this.s)}},e=>{if(e.name===void 0||e.objective===void 0)throw new kt("JsonTextObject.score must include 'name' and 'objective'",this.s)})}parseClickEventObject(){return this.parseObject((e,t)=>{switch(e){case"action":t[e]=this.parseString(["open_url","open_file","run_command","suggest_command","change_page","copy_to_clipboard"]);break;case"value":t[e]=this.parseString();break;default:throw new kt(`Unknown key '${e}' in JsonTextObject.clickEvent`,this.s)}},e=>{if(e.action===void 0)throw new kt("JsonTextObject.clickEvent must include 'action'",this.s);if(e.value===void 0)throw new kt("JsonTextObject.clickEvent must include 'value'",this.s)})}parseHoverEventObject(){return this.parseObject((e,t)=>{switch(e){case"action":t[e]=this.parseString(["show_text","show_item","show_entity"]);break;case"contents":switch(t.action){case void 0:throw new kt("HoverEvent 'action' is required, and must be defined before 'contents'.",this.s);case"show_text":{t[e]=this.parseTextComponent();break}case"show_item":{t[e]=this.parseObject((i,r)=>{switch(i){case"id":r[i]=this.parseString();break;case"count":r[i]=this.parseNumber();break;case"tag":r[i]=this.parseString();break;default:throw new kt(`Unknown key '${i}' in JsonTextObject.itemHoverEvent.contents`,this.s)}},i=>{if(i.id===void 0)throw new kt("JsonTextObject.itemHoverEvent.contents must include 'id'",this.s)});break}case"show_entity":{t[e]=this.parseObject((i,r)=>{switch(i){case"type":r[i]=this.parseString();break;case"id":r[i]=this.parseString();break;case"name":r[i]=this.parseString();break;default:throw new kt(`Unknown key '${i}' in JsonTextObject.entityHoverEvent.contents`,this.s)}},i=>{if(i.type===void 0)throw new kt("JsonTextObject.entityHoverEvent.contents must include 'type'",this.s)});break}}break;default:throw new kt(`Unknown key '${e}' in JsonTextObject.hoverEvent`,this.s)}},e=>{if(e.action===void 0)throw new kt("JsonTextObject.hoverEvent must include 'action'",this.s);if(e.contents===void 0)throw new kt("JsonTextObject.hoverEvent must include 'contents'",this.s)})}parseArray(){this.s.consume(),this.consumeWhitespace();let e=[];for(;this.s.item!=="]";){this.consumeWhitespace();let t=this.parseTextComponent();if(e.push(t),this.s.item===",")this.s.consume(),this.consumeWhitespace();else{if(this.s.item==="]")break;throw new kt(`Unexpected '${this.s.item}' in JsonTextArray`,this.s)}}return this.s.consume(),e}parseString(e){if(this.s.item!=='"')throw new kt(`Unexpected '${this.s.item}' in string`,this.s);this.s.consume();let t="";for(;this.s.item;){if(this.s.item==="\\")if(this.s.look(1)==="n"){t+=` -`,this.s.consume(),this.s.consume();continue}else{this.s.consume(),t+=this.s.item,this.s.consume();continue}if(this.s.item==='"')break;if(this.s.item===` -`)throw new kt("Unexpected newline in string",this.s);t+=this.s.item,this.s.consume()}if(!this.s.item)throw new kt("Unexpected EOF in string",this.s);if(this.s.consume(),e&&!e.includes(t))throw new kt(`Unexpected string value '${t}'. Expected one of ${e.join(", ")}`,this.s);return t}parseBoolean(){if(this.s.item==='"'){let e=this.parseString();if(e==="true")return!0;if(e==="false")return!1;throw new kt("Unexpected incomplete string boolean",this.s)}if(this.s.look(0,4)==="true")return this.s.consumeN(4),!0;if(this.s.look(0,5)==="false")return this.s.consumeN(5),!1;throw new kt("Unexpected incomplete boolean",this.s)}parseNumber(){let e="",t=!1;for(;this.s.item;){if(this.s.item==="."){if(t)throw new kt("Unexpected second decimal point in number",this.s);t=!0}e+=this.s.item,this.s.consume()}return parseInt(e)}};s(au,"JsonTextParser");var bu={};vn(bu,{assetsLoaded:()=>Tl,checkForAssetsUpdate:()=>xm,extractAssets:()=>i0,getJSONAsset:()=>Gr,getLatestVersionClientDownloadUrl:()=>hu,getPngAssetAsDataUrl:()=>$a,getRawAsset:()=>km,updateAssets:()=>_u});var Ib={"assets/animated_java/textures/steve.png":"iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABL1BMVEUBAABGOqUwKHIAr6+qfWaWX0EAaGgAf38AqKgAmZlqQDB1Ry8qHQ0mIVs/Pz9ra2uHVTuWb1soKCgAYGBWScwmGgoAzMwvHw86MYkkGAgoGwoAW1sAAABRMSUAnp4pHAwsHg6GUzQrHg2BUzkfEAsmGAsoGg0nGwstHQ4tIBCaY0QzJBFFIg6cZ0gjFwkkGAomGgwoGwsoHAsrHg4sHhEvIhEyIxBBIQw6KBRiQy9SPYl0SC+KTD2EUjGHWDqIWjmKWTucY0WcaUydak+iake0hG27iXL///8vIA1CHQo0JRI/KhVCKhJSKCZtQypvRSx6TjOAUzSDVTuPXj6QXkOWX0CcY0aaZEqfaEmcclysdlqze2K1e2etgG23gnK2iWy+iGy9i3K9jnK9jnTGloCtoI9HAAAAAXRSTlMAQObYZgAAAwBJREFUWMPtlmd7okAQxyNL2UX04O4QhAvNWNN7v/Tkeu+9ff/PcLO7bqIYA8a3/h8fdyjzY2aZh5mpqa4Mowq/6kyxq6lRZVQdBwDVos50C4Dj2BzwAPR8dEDVoTk4BgfcKgLDtp1xAMx/HIDthPYMBcR6HN/mLYQ2yDBGfo2eZzfDjXb7UeKsVO3EaLc3wqbteaIu8gDsKExmkySZffY0WplNwsimgG5dZAKiuh2uLi+Gyc8//37//fIkXFxeDe16JOoiO4JGK/Ka0bp8Jn//fH58vB41vajV8ERd5EjBW1p4eLR1drHz7XznQt46eriwBCdFXeQANOpr+8rBh68/dP3X6esDZX+t3qCbyOsiew+81vZJJy6+e7+5tzf3tlaMOyfbLS8SdZEJiONOPK8c7r58sfl4bu7Nq93DT/Mf5ztQS7QuinGuWrgPugsSxxVeS5V7XYnzuFLB+rQ+nQ3g34QBQAU0LgCDvz5WCgMASSpJBRAsdHU1TfNJUDut1YIAbC3AGCOEMbcRWxHoClDqAxQ0VdUwDsAfIbBVTO8GAJgawiig11MAqQ/AbkQ4IOAJtoq4MAMjBr0Z4KuqD9cDAn/cJggTDoCgbogADBek+r5PCHUjBEyfecOxoiimDDLBoGs/wHULdC8oAHxUwh9KAKYidoA5wJJlxbwO0LsHFAABYAaAPaDeADE5wGIAy+oBSNLAWxAAjW3iJYA+mQLM/ggEQLoCIOaFiNgwKvDjACUFKJcFoFy+A9JUTSOEBsABYLNtUDhAVmgkkEoPgDuKFVIpUWDBBQAtMtfFhLgFDrBkFkkGgEUEBCLKm8AffTL4WWY6gokmmmiiUeYFPKwr5x44QGMB8LDBYpQUcgN65wWX9gkQfOODgbkgG1C6bDQBNAmt2+rzA6RSb6fCA219FMC1c8FQQGpeGDoXDAeU+LxwCRAtLS8glQIFWBxg9s0F2QCeiskArCubOSOQUgCFA8ycgPS8oHRzp6MNTSUHoL/dsydb4wAgd8tio821gP/oPFz1ouD5GQAAAABJRU5ErkJggg==","assets/index.json":`{}\r + ${Project.uuid}`)},parse(n,e){if(console.log(`Parsing Animated Java Blueprint from '${e}'...`),!Project)throw new Error("No project to parse into");Project.loadingPromises=[],Project.save_path=e,n.meta.box_uv!==void 0&&(Project.box_uv=n.meta.box_uv),n.resolution!==void 0&&(Project.texture_width=n.resolution.width,Project.texture_height=n.resolution.height);for(let t in ModelProject.properties)ModelProject.properties[t].merge(Project,n);if(n.blueprint_settings&&(Project.animated_java={...Project.animated_java,...n.blueprint_settings}),Project.last_used_export_namespace=n.meta.last_used_export_namespace||Project.animated_java.export_namespace,n.textures)for(let t of n.textures){let i=new Texture(t,t.uuid).add(!1);if(t.relative_path&&Project.save_path){let r=PathModule.resolve(Project.save_path,t.relative_path);if(fs.existsSync(r)){i.fromPath(r);continue}}t.path&&fs.existsSync(t.path)&&!n.meta.backup?i.fromPath(t.path):t.source&&t.source.startsWith("data:")&&i.fromDataURL(t.source)}if(n.elements){let t=Texture.getDefault();for(let i of n.elements){let r=OutlinerElement.fromSave(i,!0);switch(!0){case r instanceof Cube:{for(let a in r.faces)if(i.faces){let o=i.faces[a].texture!==void 0&&Texture.all[i.faces[a].texture];o&&(r.faces[a].texture=o.uuid)}else t&&r.faces&&r.faces[a].texture!==void 0&&(r.faces[a].texture=t.uuid);break}case r instanceof AnimatedJava.API.TextDisplay:case r instanceof AnimatedJava.API.VanillaItemDisplay:case r instanceof AnimatedJava.API.VanillaBlockDisplay:{Project.loadingPromises.push(r.waitForReady());break}}}}if(n.outliner){parseGroups(n.outliner);for(let t of Group.all)t.name=Ht(t.name)}if(n.variants){Ne.fromJSON(n.variants.default,!0);for(let t of n.variants.list)Ne.fromJSON(t);Project.variants=Ne.all}else new Ne("Default",!0);if(n.animations)for(let t of n.animations){let i=new Blockbench.Animation;i.uuid=t.uuid||guid(),i.extend(t).add()}if(n.animation_controllers)for(let t of n.animation_controllers){let i=new Blockbench.AnimationController;i.uuid=t.uuid||guid(),i.extend(t).add()}if(n.animation_variable_placeholders&&(Interface.Panels.variable_placeholders.inside_vue._data.text=n.animation_variable_placeholders),n.backgrounds){for(let t in n.backgrounds)if(Object.hasOwn(Project.backgrounds,t)){let i=n.backgrounds[t],r=Project.backgrounds[t];i.image!==void 0&&(r.image=i.image),i.size!==void 0&&(r.size=i.size),i.x!==void 0&&(r.x=i.x),i.y!==void 0&&(r.y=i.y),i.lock!==void 0&&(r.lock=i.lock)}Preview.all.forEach(t=>{t.canvas.isConnected&&t.loadBackground()})}Canvas.updateAll(),Validator.validate(),Cn.dispatchEvent("parsed",{model:n})},compile(n){if(n||(n={}),console.log(`Compiling Animated Java Blueprint from ${Project.name}...`),!Project)throw new Error("No project to compile.");let e={meta:{format:rt.id,format_version:ke.version,uuid:Project.uuid,save_location:Project.save_path,last_used_export_namespace:Project.last_used_export_namespace},blueprint_settings:Project.animated_java,resolution:{width:Project.texture_width||16,height:Project.texture_height||16}};console.log(Project.animated_java);let t=Ne.selected;Ne.selectDefault();for(let r in ModelProject.properties)ModelProject.properties[r].export&&ModelProject.properties[r].copy(Project,e);e.elements=[];for(let r of elements)e.elements.push(r.getSaveCopy&&r.getSaveCopy(!!e.meta));e.outliner=compileGroups(!0),e.textures=[];for(let r of Texture.all){let a=r.getUndoCopy();if(delete a.selected,Project.save_path&&r.path){let o=PathModule.relative(Project.save_path,r.path);r.relative_path=o.replace(/\\/g,"/")}a.source="data:image/png;base64,"+r.getBase64(),a.mode="bitmap",n.absolute_paths===!1&&delete a.path,e.textures.push(a)}e.variants={default:Ne.all.find(r=>r.isDefault).toJSON(),list:Ne.all.filter(r=>!r.isDefault).map(r=>r.toJSON())},e.animations=[];let i={bone_names:!0,absolute_paths:n.absolute_paths};for(let r of Blockbench.Animation.all)r.getUndoCopy&&e.animations.push(r.getUndoCopy(i,!0));e.animation_controllers=[];for(let r of Blockbench.AnimationController.all)r.getUndoCopy&&e.animation_controllers.push(r.getUndoCopy(i,!0));if(Interface.Panels.variable_placeholders.inside_vue._data.text&&(e.animation_variable_placeholders=Interface.Panels.variable_placeholders.inside_vue._data.text),!n.backup){let r={};for(let a in Project.backgrounds){let o=Project.backgrounds[a];o.image&&(r[a]=o.getSaveCopy())}Object.keys(r).length&&(e.backgrounds=r)}return t?.select(),n.raw?e:compileJSON(e)},export(){if(console.log(`Exporting Animated Java Blueprint for ${Project.name}...`),!Project)throw new Error("No project to export.");Blockbench.export({resource_id:"animated_java_blueprint.export",name:(Project.name||"unnamed")+".ajblueprint",startpath:Project.save_path,type:"json",extensions:[Cn.extension],content:Cn.compile(),custom_writer:(n,e)=>{fs.existsSync(PathModule.dirname(e))?(Project.save_path=e,Cn.write(n,e)):(console.error(`Failed to export Animated Java Blueprint, file location '${e}' does not exist!`),Blockbench.showMessageBox({title:w("error.blueprint_export_path_doesnt_exist.title"),message:w("error.blueprint_export_path_doesnt_exist",e)}))}})},fileName(){return!Project||!Project.name?"unnamed_project.ajblueprint":`${Project.name}.ajblueprint`}}),rt=new Blockbench.ModelFormat({id:"animated_java_blueprint",name:"Animated Java Blueprint",icon:"icon-armor_stand",category:"minecraft",target:"Minecraft: Java Edition",confidential:!1,condition:()=>!0,show_on_start_screen:!0,format_page:{component:{methods:{},created(){tr({elementSelector:()=>$("#format_page_animated_java_blueprint_mount")[0],component:Ig,props:{}})},template:'
      '}},onSetup(n,e){if(!Project)return;console.log("Animated Java Blueprint format setup");let t=Yf();Project.animated_java??=t;for(let[a,o]of Object.entries(t))Project.animated_java[a]===void 0&&(Project.animated_java[a]=o);let i=Project;Project.variants??=[],Project.last_used_export_namespace=Project.animated_java.export_namespace;let r=setInterval(()=>{Jc()},500);re.UNLOAD.subscribe(()=>clearInterval(r),!0),re.UNINSTALL.subscribe(()=>clearInterval(r),!0),i.materials[Hn.uuid]=Sg,Hn.updateMaterial(),Project.loadingPromises??=[],Project.loadingPromises.push(new Promise(a=>{requestAnimationFrame(()=>{i.pluginMode=new ge(i.animated_java.enable_plugin_mode),document.querySelector("#tab_bar_list .icon-armor_stand.icon")?.remove(),tr({elementSelector:()=>{let l=[...document.querySelectorAll(`.project_tab[title="${n.name}"]`)];if(l.length)return l[0]},prepend:!0,component:_g,props:{pluginMode:i.pluginMode}}),Ne.all.length===0&&new Ne("Default",!0),Ne.selectDefault()}),a()}))},onActivation(){console.log("Animated Java Blueprint format activated")},codec:Cn,animated_textures:!0,animation_controllers:!0,animation_files:!0,animation_mode:!0,bone_binding_expression:!0,bone_rig:!0,box_uv:!1,centered_grid:!0,display_mode:!1,edit_mode:!0,integer_size:!1,java_face_properties:!0,locators:!0,meshes:!1,model_identifier:!1,optional_box_uv:!0,paint_mode:!0,parent_model_id:!1,pose_mode:!1,render_sides:"front",rotate_cubes:!0,rotation_limit:!1,select_texture_for_particles:!1,single_texture:!1,texture_folder:!1,texture_meshes:!1,uv_rotation:!0,vertex_color_ambient_occlusion:!0});Cn.format=rt;function Ue(){return Format.id===rt.id}s(Ue,"isCurrentFormat");function Hc(){!Project||!Format||Format===rt&&Cn.write(Cn.compile(),Project.save_path)}s(Hc,"saveBlueprint");function rb(){Ue()&&(rt.rotation_limit=!(Group.selected||AnimatedJava.API.TextDisplay.selected.length||AnimatedJava.API.VanillaItemDisplay.selected.length||AnimatedJava.API.VanillaBlockDisplay.selected.length||OutlinerElement.types.camera?.all.length),rt.rotation_snap=rt.rotation_limit)}s(rb,"updateRotationLock");function kP(){Ue()&&(rt.rotation_limit=!1,rt.rotation_snap=!1)}s(kP,"disableRotationLock");re.SELECT_PROJECT.subscribe(n=>{n.format.id===rt.id&&re.SELECT_AJ_PROJECT.dispatch(n)});re.UNSELECT_PROJECT.subscribe(n=>{n.format.id===rt.id&&re.UNSELECT_AJ_PROJECT.dispatch(n)});re.UPDATE_SELECTION.subscribe(rb);re.SELECT_AJ_PROJECT.subscribe(()=>{requestAnimationFrame(()=>{Jc(),rb()})});re.UNSELECT_AJ_PROJECT.subscribe(n=>{n.visualBoundingBox&&scene.remove(n.visualBoundingBox),kP()});var cu={};xn(cu,{assetsLoaded:()=>yl,checkForAssetsUpdate:()=>ym,extractAssets:()=>Xb,getJSONAsset:()=>or,getLatestVersionClientDownloadUrl:()=>lu,getPngAssetAsDataUrl:()=>Wa,getRawAsset:()=>wm,updateAssets:()=>ou});var ab={"assets/animated_java/textures/steve.png":"iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABL1BMVEUBAABGOqUwKHIAr6+qfWaWX0EAaGgAf38AqKgAmZlqQDB1Ry8qHQ0mIVs/Pz9ra2uHVTuWb1soKCgAYGBWScwmGgoAzMwvHw86MYkkGAgoGwoAW1sAAABRMSUAnp4pHAwsHg6GUzQrHg2BUzkfEAsmGAsoGg0nGwstHQ4tIBCaY0QzJBFFIg6cZ0gjFwkkGAomGgwoGwsoHAsrHg4sHhEvIhEyIxBBIQw6KBRiQy9SPYl0SC+KTD2EUjGHWDqIWjmKWTucY0WcaUydak+iake0hG27iXL///8vIA1CHQo0JRI/KhVCKhJSKCZtQypvRSx6TjOAUzSDVTuPXj6QXkOWX0CcY0aaZEqfaEmcclysdlqze2K1e2etgG23gnK2iWy+iGy9i3K9jnK9jnTGloCtoI9HAAAAAXRSTlMAQObYZgAAAwBJREFUWMPtlmd7okAQxyNL2UX04O4QhAvNWNN7v/Tkeu+9ff/PcLO7bqIYA8a3/h8fdyjzY2aZh5mpqa4Mowq/6kyxq6lRZVQdBwDVos50C4Dj2BzwAPR8dEDVoTk4BgfcKgLDtp1xAMx/HIDthPYMBcR6HN/mLYQ2yDBGfo2eZzfDjXb7UeKsVO3EaLc3wqbteaIu8gDsKExmkySZffY0WplNwsimgG5dZAKiuh2uLi+Gyc8//37//fIkXFxeDe16JOoiO4JGK/Ka0bp8Jn//fH58vB41vajV8ERd5EjBW1p4eLR1drHz7XznQt46eriwBCdFXeQANOpr+8rBh68/dP3X6esDZX+t3qCbyOsiew+81vZJJy6+e7+5tzf3tlaMOyfbLS8SdZEJiONOPK8c7r58sfl4bu7Nq93DT/Mf5ztQS7QuinGuWrgPugsSxxVeS5V7XYnzuFLB+rQ+nQ3g34QBQAU0LgCDvz5WCgMASSpJBRAsdHU1TfNJUDut1YIAbC3AGCOEMbcRWxHoClDqAxQ0VdUwDsAfIbBVTO8GAJgawiig11MAqQ/AbkQ4IOAJtoq4MAMjBr0Z4KuqD9cDAn/cJggTDoCgbogADBek+r5PCHUjBEyfecOxoiimDDLBoGs/wHULdC8oAHxUwh9KAKYidoA5wJJlxbwO0LsHFAABYAaAPaDeADE5wGIAy+oBSNLAWxAAjW3iJYA+mQLM/ggEQLoCIOaFiNgwKvDjACUFKJcFoFy+A9JUTSOEBsABYLNtUDhAVmgkkEoPgDuKFVIpUWDBBQAtMtfFhLgFDrBkFkkGgEUEBCLKm8AffTL4WWY6gokmmmiiUeYFPKwr5x44QGMB8LDBYpQUcgN65wWX9gkQfOODgbkgG1C6bDQBNAmt2+rzA6RSb6fCA219FMC1c8FQQGpeGDoXDAeU+LxwCRAtLS8glQIFWBxg9s0F2QCeiskArCubOSOQUgCFA8ycgPS8oHRzp6MNTSUHoL/dsydb4wAgd8tio821gP/oPFz1ouD5GQAAAABJRU5ErkJggg==","assets/index.json":`{}\r `,"assets/minecraft/blockstates/black_bed.json":`{\r "variants": {\r "": {\r @@ -2886,9 +2877,24 @@ ${t}`}};s(kt,"ParserError");var au=class{constructor(e){this.str=e;this.s=new jb }\r }\r ]\r -}`};var Ob={},ZP=s(function(n,e,t,i,r){var a=new Worker(Ob[e]||(Ob[e]=URL.createObjectURL(new Blob([n+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(o){var l=o.data,c=l.$e$;if(c){var u=new Error(c[0]);u.code=c[1],u.stack=c[2],r(u,null)}else r(null,l)},a.postMessage(t,i),a},"wk"),Yt=Uint8Array,li=Uint16Array,xl=Int32Array,Uo=new Yt([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,0,0,0]),Go=new Yt([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,0,0]),yl=new Yt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Mb=s(function(n,e){for(var t=new li(31),i=0;i<31;++i)t[i]=e+=1<>1|(Bt&21845)<<1,zr=(zr&52428)>>2|(zr&13107)<<2,zr=(zr&61680)>>4|(zr&3855)<<4,wl[Bt]=((zr&65280)>>8|(zr&255)<<8)>>1;var zr,Bt,Ui=s(function(n,e,t){for(var i=n.length,r=0,a=new li(e);r>c]=u}else for(l=new li(i),r=0;r>15-n[r]);return l},"hMap"),Ur=new Yt(288);for(Bt=0;Bt<144;++Bt)Ur[Bt]=8;var Bt;for(Bt=144;Bt<256;++Bt)Ur[Bt]=9;var Bt;for(Bt=256;Bt<280;++Bt)Ur[Bt]=7;var Bt;for(Bt=280;Bt<288;++Bt)Ur[Bt]=8;var Bt,zo=new Yt(32);for(Bt=0;Bt<32;++Bt)zo[Bt]=5;var Bt,Vb=Ui(Ur,9,0),zb=Ui(Ur,9,1),Ub=Ui(zo,5,0),Gb=Ui(zo,5,1),su=s(function(n){for(var e=n[0],t=1;te&&(e=n[t]);return e},"max"),zi=s(function(n,e,t){var i=e/8|0;return(n[i]|n[i+1]<<8)>>(e&7)&t},"bits"),lu=s(function(n,e){var t=e/8|0;return(n[t]|n[t+1]<<8|n[t+2]<<16)>>(e&7)},"bits16"),kl=s(function(n){return(n+7)/8|0},"shft"),Ha=s(function(n,e,t){return(e==null||e<0)&&(e=0),(t==null||t>n.length)&&(t=n.length),new Yt(n.subarray(e,t))},"slc");var Jb=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Cn=s(function(n,e,t){var i=new Error(e||Jb[n]);if(i.code=n,Error.captureStackTrace&&Error.captureStackTrace(i,Cn),!t)throw i;return i},"err"),Hb=s(function(n,e,t,i){var r=n.length,a=i?i.length:0;if(!r||e.f&&!e.l)return t||new Yt(0);var o=!t,l=o||e.i!=2,c=e.i;o&&(t=new Yt(r*3));var u=s(function(Re){var le=t.length;if(Re>le){var pe=new Yt(Math.max(le*2,Re));pe.set(t),t=pe}},"cbuf"),d=e.f||0,m=e.p||0,p=e.b||0,f=e.l,_=e.d,v=e.m,g=e.n,h=r*8;do{if(!f){d=zi(n,m,1);var b=zi(n,m+1,3);if(m+=3,b)if(b==1)f=zb,_=Gb,v=9,g=5;else if(b==2){var C=zi(n,m,31)+257,A=zi(n,m+10,15)+4,I=C+zi(n,m+5,31)+1;m+=14;for(var S=new Yt(I),L=new Yt(19),O=0;O>4;if(x<16)S[O++]=x;else{var ae=0,ne=0;for(x==16?(ne=3+zi(n,m,3),m+=2,ae=S[O-1]):x==17?(ne=3+zi(n,m,7),m+=3):x==18&&(ne=11+zi(n,m,127),m+=7);ne--;)S[O++]=ae}}var ve=S.subarray(0,C),X=S.subarray(C);v=su(ve),g=su(X),f=Ui(ve,v,1),_=Ui(X,g,1)}else Cn(1);else{var x=kl(m)+4,y=n[x-4]|n[x-3]<<8,k=x+y;if(k>r){c&&Cn(0);break}l&&u(p+y),t.set(n.subarray(x,k),p),e.b=p+=y,e.p=m=k*8,e.f=d;continue}if(m>h){c&&Cn(0);break}}l&&u(p+131072);for(var j=(1<>4;if(m+=ae&15,m>h){c&&Cn(0);break}if(ae||Cn(2),oe<256)t[p++]=oe;else if(oe==256){P=m,f=null;break}else{var Z=oe-254;if(oe>264){var O=oe-257,J=Uo[O];Z=zi(n,m,(1<>4;ie||Cn(3),m+=ie&15;var X=Pb[U];if(U>3){var J=Go[U];X+=lu(n,m)&(1<h){c&&Cn(0);break}l&&u(p+131072);var q=p+Z;if(p>8},"wbits"),Po=s(function(n,e,t){t<<=e&7;var i=e/8|0;n[i]|=t,n[i+1]|=t>>8,n[i+2]|=t>>16},"wbits16"),cu=s(function(n,e){for(var t=[],i=0;ip&&(p=a[i].s);var f=new li(p+1),_=du(t[d-1],f,0);if(_>e){var i=0,v=0,g=_-e,h=1<e)v+=h-(1<<_-f[b]),f[b]=e;else break}for(v>>=g;v>0;){var x=a[i].s;f[x]=0&&v;--i){var y=a[i].s;f[y]==e&&(--f[y],++v)}_=e}return{t:new Yt(f),l:_}},"hTree"),du=s(function(n,e,t){return n.s==-1?Math.max(du(n.l,e,t+1),du(n.r,e,t+1)):e[n.s]=t},"ln"),cm=s(function(n){for(var e=n.length;e&&!n[--e];);for(var t=new li(++e),i=0,r=n[0],a=1,o=s(function(c){t[i++]=c},"w"),l=1;l<=e;++l)if(n[l]==r&&l!=e)++a;else{if(!r&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(r),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(r);a=1,r=n[l]}return{c:t.subarray(0,i),n:e}},"lc"),Vo=s(function(n,e){for(var t=0,i=0;i>8,n[r+2]=n[r]^255,n[r+3]=n[r+1]^255;for(var a=0;a4&&!L[yl[E-1]];--E);var B=u+5<<3,H=Vo(r,Ur)+Vo(a,zo)+o,ee=Vo(r,p)+Vo(a,v)+o+14+3*E+Vo(A,L)+2*A[16]+3*A[17]+7*A[18];if(c>=0&&B<=H&&B<=ee)return pm(e,d,n.subarray(c,c+u));var ae,ne,ve,X;if(Ar(e,d,1+(ee15&&(Ar(e,d,oe[I]>>5&127),d+=oe[I]>>12)}}else ae=Vb,ne=Ur,ve=Ub,X=zo;for(var I=0;I255){var Z=J>>18&31;Po(e,d,ae[Z+257]),d+=ne[Z+257],Z>7&&(Ar(e,d,J>>23&31),d+=Uo[Z]);var ie=J&31;Po(e,d,ve[ie]),d+=X[ie],ie>3&&(Po(e,d,J>>5&8191),d+=Go[ie])}else Po(e,d,ae[J]),d+=ne[J]}return Po(e,d,ae[256]),d+ne[256]},"wblk"),$b=new xl([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),_m=new Yt(0),Kb=s(function(n,e,t,i,r,a){var o=a.z||n.length,l=new Yt(i+o+5*(1+Math.ceil(o/7e3))+r),c=l.subarray(i,l.length-r),u=a.l,d=(a.r||0)&7;if(e){d&&(c[0]=a.r>>3);for(var m=$b[e-1],p=m>>13,f=m&8191,_=(1<7e3||L>24576)&&(ae>423||!u)){d=um(n,c,0,y,k,C,I,L,E,S-E,d),L=A=I=0,E=S;for(var ne=0;ne<286;++ne)k[ne]=0;for(var ne=0;ne<30;++ne)C[ne]=0}var ve=2,X=0,j=f,Q=H-ee&32767;if(ae>2&&B==x(S-Q))for(var P=Math.min(p,ae)-1,oe=Math.min(32767,S),Z=Math.min(258,ae);Q<=oe&&--j&&H!=ee;){if(n[S+ve]==n[S+ve-Q]){for(var J=0;Jve){if(ve=J,X=Q,J>P)break;for(var ie=Math.min(Q,J-2),U=0,ne=0;neU&&(U=Te,ee=q)}}}H=ee,ee=v[H],Q+=H-ee&32767}if(X){y[L++]=268435456|uu[ve]<<18|lm[X];var Re=uu[ve]&31,le=lm[X]&31;I+=Uo[Re]+Go[le],++k[257+Re],++C[le],O=S+ve,++A}else y[L++]=n[S],++k[n[S]]}}for(S=Math.max(S,O);S=o&&(c[d/8|0]=u,pe=o),d=pm(c,d+1,n.subarray(S,pe))}a.i=o}return Ha(l,0,i+kl(d)+r)},"dflt"),XP=function(){for(var n=new Int32Array(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(t&1&&-306674912)^t>>>1;n[e]=t}return n}(),YP=s(function(){var n=-1;return{p:function(e){for(var t=n,i=0;i>>8;n=t},d:function(){return~n}}},"crc");var qb=s(function(n,e,t,i,r){if(!r&&(r={l:1},e.dictionary)){var a=e.dictionary.subarray(-32768),o=new Yt(a.length+n.length);o.set(a),o.set(n,a.length),n=o,r.w=a.length}return Kb(n,e.level==null?6:e.level,e.mem==null?r.l?Math.ceil(Math.max(8,Math.min(13,Math.log(n.length)))*1.5):20:12+e.mem,t,i,r)},"dopt"),gm=s(function(n,e){var t={};for(var i in n)t[i]=n[i];for(var i in e)t[i]=e[i];return t},"mrg"),Nb=s(function(n,e,t){for(var i=n(),r=n.toString(),a=r.slice(r.indexOf("[")+1,r.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o>>0},"b4"),sm=s(function(n,e){return rr(n,e)+rr(n,e+4)*4294967296},"b8"),qn=s(function(n,e,t){for(;t;++e)n[e]=t,t>>>=8},"wbytes");function i7(n,e,t){return t||(t=e,e={}),typeof t!="function"&&Cn(7),Zb(n,e,[n7],function(i){return mu(hm(i.data[0],i.data[1]))},0,t)}s(i7,"deflate");function hm(n,e){return qb(n,e||{},0,0)}s(hm,"deflateSync");function r7(n,e,t){return t||(t=e,e={}),typeof t!="function"&&Cn(7),Zb(n,e,[t7],function(i){return mu(bm(i.data[0],Wb(i.data[1])))},1,t)}s(r7,"inflate");function bm(n,e){return Hb(n,{i:2},e&&e.out,e&&e.dictionary)}s(bm,"inflateSync");var Xb=s(function(n,e,t,i){for(var r in n){var a=n[r],o=e+r,l=i;Array.isArray(a)&&(l=gm(i,a[1]),a=a[0]),a instanceof Yt?t[o]=[a,l]:(t[o+="/"]=[new Yt(0),l],Xb(a,o,t,i))}},"fltn"),Bb=typeof TextEncoder<"u"&&new TextEncoder,dm=typeof TextDecoder<"u"&&new TextDecoder,a7=0;try{dm.decode(_m,{stream:!0}),a7=1}catch{}var o7=s(function(n){for(var e="",t=0;;){var i=n[t++],r=(i>127)+(i>223)+(i>239);if(t+r>n.length)return{s:e,r:Ha(n,t-1)};r?r==3?(i=((i&15)<<18|(n[t++]&63)<<12|(n[t++]&63)<<6|n[t++]&63)-65536,e+=String.fromCharCode(55296|i>>10,56320|i&1023)):r&1?e+=String.fromCharCode((i&31)<<6|n[t++]&63):e+=String.fromCharCode((i&15)<<12|(n[t++]&63)<<6|n[t++]&63):e+=String.fromCharCode(i)}},"dutf8");function Db(n,e){if(e){for(var t=new Yt(n.length),i=0;i>1)),o=0,l=s(function(d){a[o++]=d},"w"),i=0;ia.length){var c=new Yt(o+8+(r-i<<1));c.set(a),a=c}var u=n.charCodeAt(i);u<128||e?l(u):u<2048?(l(192|u>>6),l(128|u&63)):u>55295&&u<57344?(u=65536+(u&1047552)|n.charCodeAt(++i)&1023,l(240|u>>18),l(128|u>>12&63),l(128|u>>6&63),l(128|u&63)):(l(224|u>>12),l(128|u>>6&63),l(128|u&63))}return Ha(a,0,o)}s(Db,"strToU8");function s7(n,e){if(e){for(var t="",i=0;i65535&&Cn(9),e+=i+4}return e},"exfl"),Rb=s(function(n,e,t,i,r,a,o,l){var c=i.length,u=t.extra,d=l&&l.length,m=fm(u);qn(n,e,o!=null?33639248:67324752),e+=4,o!=null&&(n[e++]=20,n[e++]=t.os),n[e]=20,e+=2,n[e++]=t.flag<<1|(a<0&&8),n[e++]=r&&8,n[e++]=t.compression&255,n[e++]=t.compression>>8;var p=new Date(t.mtime==null?Date.now():t.mtime),f=p.getFullYear()-1980;if((f<0||f>119)&&Cn(10),qn(n,e,f<<25|p.getMonth()+1<<21|p.getDate()<<16|p.getHours()<<11|p.getMinutes()<<5|p.getSeconds()>>1),e+=4,a!=-1&&(qn(n,e,t.crc),qn(n,e+4,a<0?-a-2:a),qn(n,e+8,t.size)),qn(n,e+12,c),qn(n,e+14,m),e+=16,o!=null&&(qn(n,e,d),qn(n,e+6,t.attrs),qn(n,e+10,o),e+=14),n.set(i,e),e+=c,m)for(var _ in u){var v=u[_],g=v.length;qn(n,e,+_),qn(n,e+2,g),n.set(v,e+4),e+=4+g}return d&&(n.set(l,e),e+=d),e},"wzh"),d7=s(function(n,e,t,i,r){qn(n,e,101010256),qn(n,e+8,t),qn(n,e+10,t),qn(n,e+12,i),qn(n,e+16,r)},"wzf");function Yb(n,e,t){t||(t=e,e={}),typeof t!="function"&&Cn(7);var i={};Xb(n,"",i,e);var r=Object.keys(i),a=r.length,o=0,l=0,c=a,u=new Array(a),d=[],m=s(function(){for(var g=0;g65535&&H(Cn(11,0,1),null),!B)H(null,x);else if(C<16e4)try{H(null,hm(x,y))}catch(ee){H(ee,null)}else d.push(i7(x,y,H))},"_loop_1"),v=0;v65558)return o(Cn(13,0,1),null),r;var c=Sr(n,l+8);if(c){var u=c,d=rr(n,l+16),m=d==4294967295||u==65535;if(m){var p=rr(n,l-12);m=rr(n,p)==101075792,m&&(u=c=rr(n,p+32),d=rr(n,p+48))}for(var f=e&&e.filter,_=s(function(g){var h=c7(n,d,m),b=h[0],x=h[1],y=h[2],k=h[3],C=h[4],A=h[5],I=l7(n,A);d=C;var S=s(function(O,E){O?(r(),o(O,null)):(E&&(a[k]=E),--c||o(null,a))},"cbl");if(!f||f({name:k,size:x,originalSize:y,compression:b}))if(!b)S(null,Ha(n,I,I+x));else if(b==8){var L=n.subarray(I,I+x);if(y<524288||x>.8*y)try{S(null,bm(L,{out:new Yt(y)}))}catch(O){S(O,null)}else i.push(r7(L,{size:y},S))}else S(Cn(14,"unknown compression type "+b,1),null);else S(null,null)},"_loop_3"),v=0;vnew wt(e)))}s(ki,"arrayToNbtFloatArray");function vm(n){let e=new THREE.Matrix4().copy(n).transpose().toArray();return ki(e)}s(vm,"matrixToNbtFloatArray");function e0(n){let e=new Ze;return e.set("translation",ki(n.translation.toArray())),e.set("left_rotation",ki(n.left_rotation.toArray())),e.set("scale",ki(n.scale.toArray())),e}s(e0,"transformationToNbt");function t0(n,e,t){return n.split(PathModule.sep).map(i=>i===e?t:i).join(PathModule.sep)}s(t0,"replacePathPart");function El(n){let e={};return Object.keys(n).sort().forEach(t=>{e[t]=n[t]}),e}s(El,"sortObjectKeys");var pu=s((n,e)=>new Promise((t,i)=>{Yb(n,e,(r,a)=>{r?i(r):t(a)})}),"zip"),n0=s((n,e)=>new Promise((t,i)=>{Qb(n,e,(r,a)=>{r?i(r):t(a)})}),"unzip");var ym=Ib;async function hu(){let n=3,e=await Mr();for(n=3;n-->=0;){let t;try{t=await fetch(e.url)}catch(i){console.error("Failed to fetch latest Minecraft version API:",i)}if(t&&t.ok){let i=await t.json();if(!i?.downloads?.client)throw new Error(`Failed to find client download for ${e.id}`);return i.downloads.client.url}}throw new Error("Failed to fetch latest Minecraft version API after 3 retries.")}s(hu,"getLatestVersionClientDownloadUrl");function wm(){let n=electron.app.getPath("userData");return PathModule.join(n,`${_e.name}/latest.jar`)}s(wm,"getCachedJarFilePath");async function _u(){let n=await hu();console.log("Downloading latest Minecraft client:",n);let e=await fetch(n),t=wm();await fs.promises.mkdir(PathModule.dirname(t),{recursive:!0});let i=new Uint8Array(await e.arrayBuffer());await fs.promises.writeFile(t,i),console.log("Downloaded latest Minecraft client:",t)}s(_u,"updateAssets");async function xm(){console.log("Checking for Minecraft assets update...");let n=ja();if(!n)console.log("No current Minecraft version found, updating assets..."),await _u();else{let t=await Mr();n.id!==t.id&&(console.log("Minecraft assets are outdated, updating..."),await _u())}let e=wm();fs.existsSync(e)||(console.log("No cached Minecraft client found, updating assets..."),await _u()),await i0(),console.log("Minecraft assets are up to date!"),requestAnimationFrame(()=>te.MINECRAFT_ASSETS_LOADED.dispatch())}s(xm,"checkForAssetsUpdate");var gu;async function i0(){let n=wm();gu=await n0(new Uint8Array(await fs.promises.readFile(n)),{filter:e=>e.name.startsWith("assets/")})}s(i0,"extractAssets");async function Tl(){return new Promise(n=>{gu!==void 0?n():te.MINECRAFT_ASSETS_LOADED.subscribe(()=>n(),!0)})}s(Tl,"assetsLoaded");function km(n){if(!gu)throw new Error("Assets not loaded");if(ym[n])return n.endsWith(".png")?Buffer.from(ym[n],"base64"):ym[n];let e=gu[n];if(!e)throw new Error(`Asset not found: ${n}`);return e}s(km,"getRawAsset");function $a(n){let e=km(n);if(!e)throw new Error(`Asset not found: ${n}`);return`data:image/png;base64,${Buffer.from(e).toString("base64")}`}s($a,"getPngAssetAsDataUrl");function Gr(n){let e=km(n);if(!e)throw new Error(`Asset not found: ${n}`);return JSON.parse(Buffer.from(e).toString("utf-8"))}s(Gr,"getJSONAsset");var r0="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9ba0UqCnYQcYjQOtlFRRxLFYtgobQVWnUwufQLmjQkKS6OgmvBwY/FqoOLs64OroIg+AHi7OCk6CIl/i8ptIjx4Lgf7+497t4B3maVKUZPDFBUU08n4kIuvyoEXuHHEHoxjojIDC2ZWczCdXzdw8PXuyjPcj/35xiQCwYDPAJxjGm6SbxBPLtpapz3iUOsLMrE58STOl2Q+JHrksNvnEs2e3lmSM+m54lDxEKpi6UuZmVdIZ4hDsuKSvnenMMy5y3OSrXO2vfkLwwW1JUM12mOIYElJJGCAAl1VFCFiSitKikG0rQfd/GP2v4UuSRyVcDIsYAaFIi2H/wPfndrFKennKRgHPC/WNZHBAjsAq2GZX0fW1brBPA9A1dqx19rAnOfpDc6WvgIGNwGLq47mrQHXO4AI0+aqIu25KPpLRaB9zP6pjwwfAv0rzm9tfdx+gBkqavlG+DgEJgoUfa6y7v7unv790y7vx+v+3K/mrIdyAAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAAd0SU1FB+gFEAYjBv19RUYAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAJUlEQVQY02P8////fwY0wMjIyAjnoCtA5zMxEAB0UMCCzWEkAQDoPxACvFjV6wAAAABJRU5ErkJggg==";var Cl=class{constructor(e){this.str=e;if(e!=="")for(let t of e.matchAll(Cl.regex))this.chars.push(t[0])}chars=[];[Symbol.iterator](){return this.chars[Symbol.iterator]()}get length(){return this.chars.length}includes(e){return this.chars.includes(e)}indexOf(e){return this.chars.indexOf(e)}slice(e,t){let i=this.chars.slice(e,t);return Cl.fromChars(i)}at(e){if(!(e<0||e>=this.chars.length))return this.chars[e]}append(e){this.chars.push(e),this.str+=e}toString(){return this.str}static fromChars(e){return new Cl(e.join(""))}},cn=Cl;s(cn,"UnicodeString"),ht(cn,"regex",/[^]/gmu);var m7=["bold","italic","underlined","strikethrough","obfuscated","color","font"];function Jo(n,e={color:"white"}){for(let t of m7)n[t]&&(e[t]=n[t]);return e}s(Jo,"getStylesFromComponent");function Em(n){let e=n.at(0);return Array.isArray(e)?Em(e):e instanceof ln?(e=e.toJSON(),Array.isArray(e)?Em(e):Jo(e)):typeof e=="object"?Jo(e):{}}s(Em,"getFirstItemStyle");function p7(n){let e=[];function t(i,r={}){if(Array.isArray(i)){r=Object.assign({},r,Em(i));for(let a of i)t(a,r)}else if(typeof i=="string")e.push(Object.assign({},r,{text:i}));else if(i instanceof ln)t(i.toJSON(),r);else if(typeof i=="object"&&(e.push(Object.assign({},r,i,{extra:void 0})),i.extra)){let a=Jo(i);t(i.extra,a)}}return s(t,"flattenComponent"),t(n),e}s(p7,"flattenTextComponent");function a0(n){return typeof n=="string"?new cn(n):n.text?new cn(n.text):n.translate?new cn(`{${n.translate}}`):n.selector?new cn(`{${n.selector}}`):n.score?n.score.value?new cn(`{${n.score.value}}`):new cn(`{${n.score.name}:${n.score.objective}}`):n.keybind?new cn(`{${n.keybind}}`):n.nbt?n.block?new cn(`{${n.block}:${n.nbt}}`):n.entity?new cn(`{${n.entity}:${n.nbt}}`):n.storage?new cn(`{${n.storage}:${n.nbt}}`):new cn(`{${n.nbt}}`):new cn("")}s(a0,"getText");function o0(n){console.time("getComponentWords");let e=p7(n);if(!e.length)return[];let t=[],i,r=e.shift(),a=a0(r),o={style:Jo(r),start:0,end:0};for(;r;){for(let l of a){if(l===" ")i&&i.text.at(-1)!==" "&&(o.end++,Object.keys(o.style).length&&(i.styles.push({...o}),o.start=0,o.end=0),t.push(i),i=void 0);else if(l===` -`){i&&(Object.keys(o.style).length&&(i.styles.push({...o}),o.start=0,o.end=0),t.push(i)),t.push({styles:[],text:new cn(""),width:0,forceWrap:!0}),i=void 0;continue}else l!==" "&&i?.text.at(-1)===" "&&(o.end++,Object.keys(o.style).length&&(i.styles.push({...o}),o.start=0,o.end=0),t.push(i),i=void 0);i||(i={styles:[],text:new cn(""),width:0}),i.text.append(l),o.end++}r=e.shift(),r&&(a=a0(r),i?(i.styles.push(o),o={style:Jo(r),start:o.end,end:o.end}):o={style:Jo(r),start:0,end:0})}return i&&(Object.keys(o.style).length&&i.styles.push(o),t.push(i)),console.timeEnd("getComponentWords"),t}s(o0,"getComponentWords");async function s0(n,e=200){console.time("computeTextWrapping");let t=[],i=await Ka(),r=0,a={words:[],width:0};for(let o of n){let l=i.getWordWidth(o),c=[...o.styles];if(l-1>e){a.words.length&&(t.push(a),r=Math.max(r,a.width)),a={words:[],width:0};let u=new cn(""),d=0,m=0,p=c.shift();if(!p)throw new Error(`No active style found for word '${o.text.toString()}'`);for(let f=0;f1&&f>=p.end&&(p=c.shift());let v=i.getTextWidth(new cn(_),p);if(u.length>0&&d+(v-1)>e){let g=o.styles.filter(h=>h.start=m).map(h=>({...h,start:Math.max(h.start-m,0),end:Math.min(h.end-m,u.length)}));t.push({words:[{text:u,styles:g,width:l}],width:d}),r=Math.max(r,d),m+=u.length,u=new cn(""),d=0}u.append(_),d+=v}if(u){let f=o.styles.filter(_=>_.start=m).map(_=>({..._,start:Math.max(_.start-m,0),end:Math.min(_.end-m,u.length)}));r=Math.max(r,d),a={words:[{text:u,styles:f,width:l}],width:d}}continue}else if(o.forceWrap)a.words.length&&(t.push(a),r=Math.max(r,a.width)),a={words:[],width:0};else if(a.words.length&&a.width+(l-1)>e){let u=a.words.at(-1);u?.text.at(-1)===" "&&(a.words.pop(),a.width-=u.width),t.push(a),r=Math.max(r,a.width),a={words:[],width:0}}o.width=l,a.words.push(o),a.width+=l}return a.words.length&&(t.push(a),r=Math.max(r,a.width)),console.timeEnd("computeTextWrapping"),{lines:t,backgroundWidth:r}}s(s0,"computeTextWrapping");var d0=rn("crypto");var{BufferAttribute:_7,BufferGeometry:g7,Float32BufferAttribute:QW,InstancedBufferAttribute:eZ,InterleavedBuffer:tZ,InterleavedBufferAttribute:nZ,TriangleFanDrawMode:iZ,TriangleStripDrawMode:rZ,TrianglesDrawMode:aZ,Vector3:oZ}=THREE;function jr(n,e=!1){let t=n[0].index!==null,i=new Set(Object.keys(n[0].attributes)),r=new Set(Object.keys(n[0].morphAttributes)),a={},o={},l=n[0].morphTargetsRelative,c=new g7,u=0;for(let d=0;d0){o=c+1;break}}let l=this;this.charCache.set(e,{type:"bitmap",ascent:this.ascent,width:o+1,get atlas(){return l.atlas},pixelUV:[i,r,o,this.charHeight],uv:[i/l.atlas.image.width,r/l.atlas.image.height,o/l.atlas.image.width,this.charHeight/l.atlas.image.height]})}return this.charCache.get(e)}};s(jl,"BitmapFontProvider");var fa=class{id;providers=[];fallback;charCache=new Map;loaded=!1;characterMeshCache=new Map;constructor(e,t,i){this.id=e,this.fallback=i;let r=Gr(t);for(let a of r.providers)switch(a.type){case"bitmap":this.providers.push(new jl(a));break;case"reference":this.providers.push(new Al(a));break;case"space":this.providers.push(new Sl(a));break;default:throw new Error(`Unsupported font provider type: ${a.type}`)}fa.all.push(this)}static getById(e){return fa.all.find(t=>t.id===e)}async load(){return this.loaded?this:(await Promise.all(this.providers.map(e=>e.load())).then(()=>{}),this.loaded=!0,this)}getChar(e,t=!0){if(!this.charCache.has(e)){for(let i of this.providers){let r=i.getChar(e,!1);if(r)return this.charCache.set(e,r),r}if(t)return{type:"bitmap",ascent:7,width:6,atlas:fa.missingCharacterAtlas,pixelUV:[0,0,8,8],uv:[0,0,1/8*6,1]}}return this.charCache.get(e)}getTextWidth(e,t){let i=0,r=t.style.bold?1:0,a=this;if(t.style.font&&t.style.font!==this.id){let o=fa.getById(t.style.font);o&&(a=o)}for(let o of e){if(o===` -`)break;let l=a.getChar(o);if(!l){console.warn(`Missing character: '${o}'`);continue}i+=l.width+r}return Math.max(i,0)}getWordWidth(e){let t=0,i=this;for(let r of e.styles){if(r.style.font&&r.style.font!==this.id){let l=fa.getById(r.style.font);l&&(i=l)}let a=e.text.slice(r.start,r.end),o=i.getTextWidth(a,r);t+=o}return Math.max(t,0)}async generateTextMesh({jsonText:e,maxLineWidth:t,backgroundColor:i,backgroundAlpha:r,shadow:a,alignment:o}){console.time("drawTextToMesh");let l=new THREE.Mesh,c=o0(e),{lines:u,backgroundWidth:d}=await s0(c,t),m=d+1,p=u.length*10+1,f=new THREE.PlaneBufferGeometry(m,p),_=new THREE.Mesh(f,new THREE.MeshBasicMaterial({color:i,transparent:!0,opacity:r})).translateY(p/2).translateZ(-.05);l.add(_);let v=[],g={x:0,y:p-9};for(let k of u){switch(o){case"center":g.x=-m/2+Math.ceil((m-k.width)/2);break;case"right":g.x=-m/2+m-k.width;break;default:g.x=-m/2+1}for(let C of k.words)for(let A of C.styles){let I=C.text.slice(A.start,A.end);for(let S of I){let L=this.generateCharMesh(S,A.style,a);if(L){if(L.geo){let O=L.geo.clone();O.translate(g.x,g.y,0),v.push(O)}g.x+=L.width}}}g.y-=10}let h;if(v.length>0){h=jr(v);let k=new THREE.Mesh(h,new THREE.MeshBasicMaterial({vertexColors:!0}));l.add(k)}l.scale.set(.4,.4,.4),l.rotateY(Math.PI),l.translateX(1/5);let b=new THREE.EdgesGeometry(f.clone().scale(.4,.4,.4)),x=new THREE.LineSegments(b,Canvas.outlineMaterial),y=Array.from(b.getAttribute("position").array);for(let k=0;k{let I=h.length/3;if(h.push(y,k,0,y+C,k,0,y+C,k+A,0,y,k+A,0),b.push(I,I+1,I+2,I,I+2,I+3),g.push(o.r,o.g,o.b,o.r,o.g,o.b,o.r,o.g,o.b,o.r,o.g,o.b),i){let S=h.length/3;y+=1,k-=1;let L=-.01;h.push(y,k,L,y+C,k,L,y+C,k+A,L,y,k+A,L),b.push(S,S+1,S+2,S,S+2,S+3),g.push(l.r,l.g,l.b,l.r,l.g,l.b,l.r,l.g,l.b,l.r,l.g,l.b)}},"createQuad");for(let y=0;y0&&(x(A-C,k,C+c,1),C=0);continue}else C++}C>0&&x(p.width-C,k,C+c,1)}if(v.setIndex(b),v.setAttribute("position",new THREE.BufferAttribute(new Float32Array(h),3)),v.setAttribute("color",new THREE.BufferAttribute(new Float32Array(g),3)),t.italic&&(v.applyMatrix4(new THREE.Matrix4().makeShear(0,0,.2,0,0,0)),v.translate(-1,0,0)),h=Array.from(v.getAttribute("position").array),g=Array.from(v.getAttribute("color").array),b=Array.from(v.getIndex().array),t.underlined&&x(-1,-1,p.width+2,1),t.strikethrough){let y=a.ascent/2+1;x(-1,y,p.width+2,1)}v.setIndex(b),v.setAttribute("position",new THREE.BufferAttribute(new Float32Array(h),3)),v.setAttribute("color",new THREE.BufferAttribute(new Float32Array(g),3)),v.attributes.position.needsUpdate=!0,v.attributes.color.needsUpdate=!0,m={geo:v,width:a.width+c},this.characterMeshCache.set(d,m)}return m}else return{width:a.width}}},Jr=fa;s(Jr,"MinecraftFont"),ht(Jr,"all",[]),ht(Jr,"missingCharacterAtlas",new THREE.TextureLoader().load(r0));var Ho,c0,u0;function h7(){console.log("Loading Minecraft fonts..."),Ho=new Jr("minecraft:default","assets/minecraft/font/default.json"),c0=new Jr("minecraft:illageralt","assets/minecraft/font/illageralt.json",Ho),u0=new Jr("minecraft:alt","assets/minecraft/font/alt.json",Ho),Promise.all([Ho.load(),c0.load(),u0.load()]).then(()=>{console.log("Minecraft fonts loaded!"),requestAnimationFrame(()=>te.MINECRAFT_FONTS_LOADED.dispatch())})}s(h7,"loadMinecraftFonts");async function Ka(){return Ho||await new Promise(n=>{te.MINECRAFT_FONTS_LOADED.subscribe(()=>n())}),Ho.load()}s(Ka,"getVanillaFont");te.MINECRAFT_ASSETS_LOADED.subscribe(()=>{h7()});function b7(n){let e,t,i,r,a,o,l,c;return{c(){e=V("div"),t=V("label"),i=Ne(n[0]),r=K(),a=V("div"),T(t,"class","name_space_left"),T(t,"for","export"),T(e,"class","dialog_bar form_bar")},m(u,d){G(u,e,d),N(e,t),N(t,i),N(e,r),N(e,a),n[5](a),l||(c=Dr(o=n[3].call(null,a)),l=!0)},p(u,d){d&1&&tt(i,u[0])},d(u){u&&z(e),n[5](null),l=!1,c()}}}s(b7,"create_default_slot");function v7(n){let e,t;return e=new kn({props:{label:n[0],tooltip:n[1],$$slots:{default:[b7]},$$scope:{ctx:n}}}),{c(){fe(e.$$.fragment)},m(i,r){de(e,i,r),t=!0},p(i,[r]){let a={};r&1&&(a.label=i[0]),r&2&&(a.tooltip=i[1]),r&133&&(a.$$scope={dirty:r,ctx:i}),e.$set(a)},i(i){t||(W(e.$$.fragment,i),t=!0)},o(i){Y(e.$$.fragment,i),t=!1},d(i){ue(e,i)}}}s(v7,"create_fragment");function y7(n,e,t){let{label:i}=e,{tooltip:r=""}=e,{value:a}=e,o=new ColorPicker(`${_e.name}:${i}-color_picker`,{onChange(){let d=o.get();a.set(d.toHexString())}}),l;function c(d){o.toElement(d),o.set(a.get())}s(c,"onLoad"),rf(()=>{o.delete()});function u(d){se[d?"unshift":"push"](()=>{l=d,t(2,l)})}return s(u,"div0_binding"),n.$$set=d=>{"label"in d&&t(0,i=d.label),"tooltip"in d&&t(1,r=d.tooltip),"value"in d&&t(4,a=d.value)},[i,r,l,c,a,u]}s(y7,"instance");var vu=class extends je{constructor(e){super(),Ie(this,e,y7,v7,Ae,{label:0,tooltip:1,value:4})}};s(vu,"ColorPicker_1");var Gi=vu;function w7(n){let e,t,i,r,a,o,l,c,u;return{c(){e=V("div"),t=V("label"),i=Ne(n[0]),r=K(),a=V("div"),o=K(),l=V("input"),T(t,"class","name_space_left"),T(t,"for","export"),T(a,"class","spacer svelte-1va5pvv"),T(l,"type","checkbox"),T(l,"class","focusable_input"),T(l,"id","export"),T(e,"class","dialog_bar form_bar checkbox_bar svelte-1va5pvv")},m(d,m){G(d,e,m),N(e,t),N(t,i),N(e,r),N(e,a),N(e,o),N(e,l),l.checked=n[3],c||(u=De(l,"change",n[4]),c=!0)},p(d,m){m&1&&tt(i,d[0]),m&8&&(l.checked=d[3])},d(d){d&&z(e),c=!1,u()}}}s(w7,"create_default_slot");function x7(n){let e,t;return e=new kn({props:{label:n[0],tooltip:n[1],$$slots:{default:[w7]},$$scope:{ctx:n}}}),{c(){fe(e.$$.fragment)},m(i,r){de(e,i,r),t=!0},p(i,[r]){let a={};r&1&&(a.label=i[0]),r&2&&(a.tooltip=i[1]),r&41&&(a.$$scope={dirty:r,ctx:i}),e.$set(a)},i(i){t||(W(e.$$.fragment,i),t=!0)},o(i){Y(e.$$.fragment,i),t=!1},d(i){ue(e,i)}}}s(x7,"create_fragment");function k7(n,e,t){let i,r=re,a=s(()=>(r(),r=ze(c,d=>t(3,i=d)),c),"$$subscribe_checked");n.$$.on_destroy.push(()=>r());let{label:o}=e,{tooltip:l=""}=e,{checked:c}=e;a();function u(){i=this.checked,c.set(i)}return s(u,"input_change_handler"),n.$$set=d=>{"label"in d&&t(0,o=d.label),"tooltip"in d&&t(1,l=d.tooltip),"checked"in d&&a(t(2,c=d.checked))},[o,l,c,i,u]}s(k7,"instance");var yu=class extends je{constructor(e){super(),Ie(this,e,k7,x7,Ae,{label:0,tooltip:1,checked:2})}};s(yu,"Checkbox");var it=yu;(()=>{let n=Blockbench.addCSS(".checkbox_bar.svelte-1va5pvv{flex-direction:row;align-items:center}.spacer.svelte-1va5pvv{flex-grow:1;border-bottom:2px dashed var(--color-button);height:0px;margin:8px;margin-left:0px}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();function E7(n){let e,t,i,r,a,o,l;function c(f){n[24](f)}s(c,"checkbox_checked_binding");let u={label:w("dialog.text_display_config.use_nbt.title"),tooltip:w("dialog.text_display_config.use_nbt.description")};n[10]!==void 0&&(u.checked=n[10]),e=new it({props:u}),se.push(()=>be(e,"checked",c));let d=[A7,C7],m=[];function p(f,_){return f[12]?0:1}return s(p,"select_block_type_1"),r=p(n,[-1,-1]),a=m[r]=d[r](n),{c(){fe(e.$$.fragment),i=K(),a.c(),o=St()},m(f,_){de(e,f,_),G(f,i,_),m[r].m(f,_),G(f,o,_),l=!0},p(f,_){let v={};!t&&_[0]&1024&&(t=!0,v.checked=f[10],he(()=>t=!1)),e.$set(v);let g=r;r=p(f,_),r===g?m[r].p(f,_):(bt(),Y(m[g],1,1,()=>{m[g]=null}),vt(),a=m[r],a?a.p(f,_):(a=m[r]=d[r](f),a.c()),W(a,1),a.m(o.parentNode,o))},i(f){l||(W(e.$$.fragment,f),W(a),l=!0)},o(f){Y(e.$$.fragment,f),Y(a),l=!1},d(f){ue(e,f),f&&z(i),m[r].d(f),f&&z(o)}}}s(E7,"create_else_block");function T7(n){let e,t,i,r,a,o,l,c,u,d,m,p,f,_,v,g,h,b,x,y,k,C;function A(P){n[16](P)}s(A,"select_value_binding");let I={label:w("dialog.text_display_config.billboard.title"),tooltip:w("dialog.text_display_config.billboard.description"),options:n[15],defaultOption:Mt.prototype.billboard};n[0]!==void 0&&(I.value=n[0]),e=new Kn({props:I}),se.push(()=>be(e,"value",A));function S(P){n[17](P)}s(S,"checkbox0_checked_binding");let L={label:w("dialog.text_display_config.glowing.title"),tooltip:w("dialog.text_display_config.glowing.description")};n[3]!==void 0&&(L.checked=n[3]),r=new it({props:L}),se.push(()=>be(r,"checked",S));function O(P){n[18](P)}s(O,"colorpicker_value_binding");let E={label:w("dialog.text_display_config.glow_color.title"),tooltip:w("dialog.text_display_config.glow_color.description")};n[5]!==void 0&&(E.value=n[5]),l=new Gi({props:E}),se.push(()=>be(l,"value",O));function B(P){n[19](P)}s(B,"numberslider0_value_binding");let H={label:w("dialog.text_display_config.shadow_radius.title"),tooltip:w("dialog.text_display_config.shadow_radius.description"),min:0,max:64};n[8]!==void 0&&(H.value=n[8]),d=new xt({props:H}),se.push(()=>be(d,"value",B));function ee(P){n[20](P)}s(ee,"numberslider1_value_binding");let ae={label:w("dialog.text_display_config.shadow_strength.title"),tooltip:w("dialog.text_display_config.shadow_strength.description"),min:0};n[9]!==void 0&&(ae.value=n[9]),f=new xt({props:ae}),se.push(()=>be(f,"value",ee));function ne(P){n[21](P)}s(ne,"checkbox1_checked_binding");let ve={label:w("dialog.text_display_config.override_brightness.title"),tooltip:w("dialog.text_display_config.override_brightness.description")};n[1]!==void 0&&(ve.checked=n[1]),g=new it({props:ve}),se.push(()=>be(g,"checked",ne));let X=n[11]&&p0(n);function j(P){n[23](P)}s(j,"checkbox2_checked_binding");let Q={label:w("dialog.text_display_config.invisible.title"),tooltip:w("dialog.text_display_config.invisible.description")};return n[6]!==void 0&&(Q.checked=n[6]),y=new it({props:Q}),se.push(()=>be(y,"checked",j)),{c(){fe(e.$$.fragment),i=K(),fe(r.$$.fragment),o=K(),fe(l.$$.fragment),u=K(),fe(d.$$.fragment),p=K(),fe(f.$$.fragment),v=K(),fe(g.$$.fragment),b=K(),X&&X.c(),x=K(),fe(y.$$.fragment)},m(P,oe){de(e,P,oe),G(P,i,oe),de(r,P,oe),G(P,o,oe),de(l,P,oe),G(P,u,oe),de(d,P,oe),G(P,p,oe),de(f,P,oe),G(P,v,oe),de(g,P,oe),G(P,b,oe),X&&X.m(P,oe),G(P,x,oe),de(y,P,oe),C=!0},p(P,oe){let Z={};!t&&oe[0]&1&&(t=!0,Z.value=P[0],he(()=>t=!1)),e.$set(Z);let J={};!a&&oe[0]&8&&(a=!0,J.checked=P[3],he(()=>a=!1)),r.$set(J);let ie={};!c&&oe[0]&32&&(c=!0,ie.value=P[5],he(()=>c=!1)),l.$set(ie);let U={};!m&&oe[0]&256&&(m=!0,U.value=P[8],he(()=>m=!1)),d.$set(U);let q={};!_&&oe[0]&512&&(_=!0,q.value=P[9],he(()=>_=!1)),f.$set(q);let ge={};!h&&oe[0]&2&&(h=!0,ge.checked=P[1],he(()=>h=!1)),g.$set(ge),P[11]?X?(X.p(P,oe),oe[0]&2048&&W(X,1)):(X=p0(P),X.c(),W(X,1),X.m(x.parentNode,x)):X&&(bt(),Y(X,1,1,()=>{X=null}),vt());let Te={};!k&&oe[0]&64&&(k=!0,Te.checked=P[6],he(()=>k=!1)),y.$set(Te)},i(P){C||(W(e.$$.fragment,P),W(r.$$.fragment,P),W(l.$$.fragment,P),W(d.$$.fragment,P),W(f.$$.fragment,P),W(g.$$.fragment,P),W(X),W(y.$$.fragment,P),C=!0)},o(P){Y(e.$$.fragment,P),Y(r.$$.fragment,P),Y(l.$$.fragment,P),Y(d.$$.fragment,P),Y(f.$$.fragment,P),Y(g.$$.fragment,P),Y(X),Y(y.$$.fragment,P),C=!1},d(P){ue(e,P),P&&z(i),ue(r,P),P&&z(o),ue(l,P),P&&z(u),ue(d,P),P&&z(p),ue(f,P),P&&z(v),ue(g,P),P&&z(b),X&&X.d(P),P&&z(x),ue(y,P)}}}s(T7,"create_if_block");function C7(n){let e,t,i,r,a,o,l,c,u,d,m,p,f,_,v,g,h,b,x,y,k;function C(j){n[26](j)}s(C,"select_value_binding_1");let A={label:w("dialog.text_display_config.billboard.title"),tooltip:w("dialog.text_display_config.billboard.description"),options:n[15],defaultOption:Mt.prototype.billboard};n[0]!==void 0&&(A.value=n[0]),e=new Kn({props:A}),se.push(()=>be(e,"value",C));function I(j){n[27](j)}s(I,"checkbox0_checked_binding_1");let S={label:w("dialog.text_display_config.glowing.title"),tooltip:w("dialog.text_display_config.glowing.description")};n[3]!==void 0&&(S.checked=n[3]),r=new it({props:S}),se.push(()=>be(r,"checked",I));function L(j){n[28](j)}s(L,"checkbox1_checked_binding_1");let O={label:w("dialog.text_display_config.override_glow_color.title"),tooltip:w("dialog.text_display_config.override_glow_color.description")};n[4]!==void 0&&(O.checked=n[4]),l=new it({props:O}),se.push(()=>be(l,"checked",L));let E=n[13]&&f0(n);function B(j){n[30](j)}s(B,"numberslider0_value_binding_1");let H={label:w("dialog.text_display_config.shadow_radius.title"),tooltip:w("dialog.text_display_config.shadow_radius.description"),min:0,max:15};n[8]!==void 0&&(H.value=n[8]),m=new xt({props:H}),se.push(()=>be(m,"value",B));function ee(j){n[31](j)}s(ee,"numberslider1_value_binding_1");let ae={label:w("dialog.text_display_config.shadow_strength.title"),tooltip:w("dialog.text_display_config.shadow_strength.description"),min:0,max:15};n[9]!==void 0&&(ae.value=n[9]),_=new xt({props:ae}),se.push(()=>be(_,"value",ee));function ne(j){n[32](j)}s(ne,"checkbox2_checked_binding_1");let ve={label:w("dialog.text_display_config.override_brightness.title"),tooltip:w("dialog.text_display_config.override_brightness.description")};n[1]!==void 0&&(ve.checked=n[1]),h=new it({props:ve}),se.push(()=>be(h,"checked",ne));let X=n[11]&&m0(n);return{c(){fe(e.$$.fragment),i=K(),fe(r.$$.fragment),o=K(),fe(l.$$.fragment),u=K(),E&&E.c(),d=K(),fe(m.$$.fragment),f=K(),fe(_.$$.fragment),g=K(),fe(h.$$.fragment),x=K(),X&&X.c(),y=St()},m(j,Q){de(e,j,Q),G(j,i,Q),de(r,j,Q),G(j,o,Q),de(l,j,Q),G(j,u,Q),E&&E.m(j,Q),G(j,d,Q),de(m,j,Q),G(j,f,Q),de(_,j,Q),G(j,g,Q),de(h,j,Q),G(j,x,Q),X&&X.m(j,Q),G(j,y,Q),k=!0},p(j,Q){let P={};!t&&Q[0]&1&&(t=!0,P.value=j[0],he(()=>t=!1)),e.$set(P);let oe={};!a&&Q[0]&8&&(a=!0,oe.checked=j[3],he(()=>a=!1)),r.$set(oe);let Z={};!c&&Q[0]&16&&(c=!0,Z.checked=j[4],he(()=>c=!1)),l.$set(Z),j[13]?E?(E.p(j,Q),Q[0]&8192&&W(E,1)):(E=f0(j),E.c(),W(E,1),E.m(d.parentNode,d)):E&&(bt(),Y(E,1,1,()=>{E=null}),vt());let J={};!p&&Q[0]&256&&(p=!0,J.value=j[8],he(()=>p=!1)),m.$set(J);let ie={};!v&&Q[0]&512&&(v=!0,ie.value=j[9],he(()=>v=!1)),_.$set(ie);let U={};!b&&Q[0]&2&&(b=!0,U.checked=j[1],he(()=>b=!1)),h.$set(U),j[11]?X?(X.p(j,Q),Q[0]&2048&&W(X,1)):(X=m0(j),X.c(),W(X,1),X.m(y.parentNode,y)):X&&(bt(),Y(X,1,1,()=>{X=null}),vt())},i(j){k||(W(e.$$.fragment,j),W(r.$$.fragment,j),W(l.$$.fragment,j),W(E),W(m.$$.fragment,j),W(_.$$.fragment,j),W(h.$$.fragment,j),W(X),k=!0)},o(j){Y(e.$$.fragment,j),Y(r.$$.fragment,j),Y(l.$$.fragment,j),Y(E),Y(m.$$.fragment,j),Y(_.$$.fragment,j),Y(h.$$.fragment,j),Y(X),k=!1},d(j){ue(e,j),j&&z(i),ue(r,j),j&&z(o),ue(l,j),j&&z(u),E&&E.d(j),j&&z(d),ue(m,j),j&&z(f),ue(_,j),j&&z(g),ue(h,j),j&&z(x),X&&X.d(j),j&&z(y)}}}s(C7,"create_else_block_1");function A7(n){let e,t,i,r,a;function o(c){n[25](c)}s(o,"lineinput_value_binding");let l={label:w("dialog.text_display_config.nbt.title"),tooltip:w("dialog.text_display_config.nbt.description")};return n[7]!==void 0&&(l.value=n[7]),i=new hn({props:l}),se.push(()=>be(i,"value",o)),{c(){e=V("p"),e.textContent=`${w("dialog.text_display_config.use_nbt.use_nbt_warning")}`,t=K(),fe(i.$$.fragment),T(e,"class","use_nbt_warning")},m(c,u){G(c,e,u),G(c,t,u),de(i,c,u),a=!0},p(c,u){let d={};!r&&u[0]&128&&(r=!0,d.value=c[7],he(()=>r=!1)),i.$set(d)},i(c){a||(W(i.$$.fragment,c),a=!0)},o(c){Y(i.$$.fragment,c),a=!1},d(c){c&&z(e),c&&z(t),ue(i,c)}}}s(A7,"create_if_block_2");function f0(n){let e,t,i;function r(o){n[29](o)}s(r,"colorpicker_value_binding_1");let a={label:w("dialog.text_display_config.glow_color.title"),tooltip:w("dialog.text_display_config.glow_color.description")};return n[5]!==void 0&&(a.value=n[5]),e=new Gi({props:a}),se.push(()=>be(e,"value",r)),{c(){fe(e.$$.fragment)},m(o,l){de(e,o,l),i=!0},p(o,l){let c={};!t&&l[0]&32&&(t=!0,c.value=o[5],he(()=>t=!1)),e.$set(c)},i(o){i||(W(e.$$.fragment,o),i=!0)},o(o){Y(e.$$.fragment,o),i=!1},d(o){ue(e,o)}}}s(f0,"create_if_block_4");function m0(n){let e,t,i;function r(o){n[33](o)}s(r,"numberslider_value_binding_1");let a={label:w("dialog.text_display_config.brightness_override.title"),tooltip:w("dialog.text_display_config.brightness_override.description"),min:0,max:15};return n[2]!==void 0&&(a.value=n[2]),e=new xt({props:a}),se.push(()=>be(e,"value",r)),{c(){fe(e.$$.fragment)},m(o,l){de(e,o,l),i=!0},p(o,l){let c={};!t&&l[0]&4&&(t=!0,c.value=o[2],he(()=>t=!1)),e.$set(c)},i(o){i||(W(e.$$.fragment,o),i=!0)},o(o){Y(e.$$.fragment,o),i=!1},d(o){ue(e,o)}}}s(m0,"create_if_block_3");function p0(n){let e,t,i;function r(o){n[22](o)}s(r,"numberslider_value_binding");let a={label:w("dialog.text_display_config.brightness_override.title"),tooltip:w("dialog.text_display_config.brightness_override.description"),min:0,max:15};return n[2]!==void 0&&(a.value=n[2]),e=new xt({props:a}),se.push(()=>be(e,"value",r)),{c(){fe(e.$$.fragment)},m(o,l){de(e,o,l),i=!0},p(o,l){let c={};!t&&l[0]&4&&(t=!0,c.value=o[2],he(()=>t=!1)),e.$set(c)},i(o){i||(W(e.$$.fragment,o),i=!0)},o(o){Y(e.$$.fragment,o),i=!1},d(o){ue(e,o)}}}s(p0,"create_if_block_1");function S7(n){let e,t,i,r,a=[T7,E7],o=[];function l(c,u){return c[14]?0:1}return s(l,"select_block_type"),t=l(n,[-1,-1]),i=o[t]=a[t](n),{c(){e=V("div"),i.c()},m(c,u){G(c,e,u),o[t].m(e,null),r=!0},p(c,u){i.p(c,u)},i(c){r||(W(i),r=!0)},o(c){Y(i),r=!1},d(c){c&&z(e),o[t].d()}}}s(S7,"create_fragment");function j7(n,e,t){let i,r=re,a=s(()=>(r(),r=ze(_,U=>t(11,i=U)),_),"$$subscribe_overrideBrightness"),o,l=re,c=s(()=>(l(),l=ze(A,U=>t(12,o=U)),A),"$$subscribe_useNBT"),u,d=re,m=s(()=>(d(),d=ze(h,U=>t(13,u=U)),h),"$$subscribe_overrideGlowColor");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l()),n.$$.on_destroy.push(()=>d());let p=!!Project?.animated_java?.enable_plugin_mode,{billboard:f}=e,{overrideBrightness:_}=e;a();let{brightnessOverride:v}=e,{glowing:g}=e,{overrideGlowColor:h}=e;m();let{glowColor:b}=e,{invisible:x}=e,{nbt:y}=e,{shadowRadius:k}=e,{shadowStrength:C}=e,{useNBT:A}=e;c();let I={fixed:w("dialog.text_display_config.billboard.options.fixed"),vertical:w("dialog.text_display_config.billboard.options.vertical"),horizontal:w("dialog.text_display_config.billboard.options.horizontal"),center:w("dialog.text_display_config.billboard.options.center")};function S(U){f=U,t(0,f)}s(S,"select_value_binding");function L(U){g=U,t(3,g)}s(L,"checkbox0_checked_binding");function O(U){b=U,t(5,b)}s(O,"colorpicker_value_binding");function E(U){k=U,t(8,k)}s(E,"numberslider0_value_binding");function B(U){C=U,t(9,C)}s(B,"numberslider1_value_binding");function H(U){_=U,a(t(1,_))}s(H,"checkbox1_checked_binding");function ee(U){v=U,t(2,v)}s(ee,"numberslider_value_binding");function ae(U){x=U,t(6,x)}s(ae,"checkbox2_checked_binding");function ne(U){A=U,c(t(10,A))}s(ne,"checkbox_checked_binding");function ve(U){y=U,t(7,y)}s(ve,"lineinput_value_binding");function X(U){f=U,t(0,f)}s(X,"select_value_binding_1");function j(U){g=U,t(3,g)}s(j,"checkbox0_checked_binding_1");function Q(U){h=U,m(t(4,h))}s(Q,"checkbox1_checked_binding_1");function P(U){b=U,t(5,b)}s(P,"colorpicker_value_binding_1");function oe(U){k=U,t(8,k)}s(oe,"numberslider0_value_binding_1");function Z(U){C=U,t(9,C)}s(Z,"numberslider1_value_binding_1");function J(U){_=U,a(t(1,_))}s(J,"checkbox2_checked_binding_1");function ie(U){v=U,t(2,v)}return s(ie,"numberslider_value_binding_1"),n.$$set=U=>{"billboard"in U&&t(0,f=U.billboard),"overrideBrightness"in U&&a(t(1,_=U.overrideBrightness)),"brightnessOverride"in U&&t(2,v=U.brightnessOverride),"glowing"in U&&t(3,g=U.glowing),"overrideGlowColor"in U&&m(t(4,h=U.overrideGlowColor)),"glowColor"in U&&t(5,b=U.glowColor),"invisible"in U&&t(6,x=U.invisible),"nbt"in U&&t(7,y=U.nbt),"shadowRadius"in U&&t(8,k=U.shadowRadius),"shadowStrength"in U&&t(9,C=U.shadowStrength),"useNBT"in U&&c(t(10,A=U.useNBT))},[f,_,v,g,h,b,x,y,k,C,A,i,o,u,p,I,S,L,O,E,B,H,ee,ae,ne,ve,X,j,Q,P,oe,Z,J,ie]}s(j7,"instance");var wu=class extends je{constructor(e){super(),Ie(this,e,j7,S7,Ae,{billboard:0,overrideBrightness:1,brightnessOverride:2,glowing:3,overrideGlowColor:4,glowColor:5,invisible:6,nbt:7,shadowRadius:8,shadowStrength:9,useNBT:10},null,[-1,-1])}};s(wu,"TextDisplayConfigDialog");var _0=wu;function I7(n){let e=Mt.fromJSON(n.config??=new Mt().toJSON()),t=new me(e.billboard),i=new me(e.overrideBrightness),r=new me(e.brightnessOverride),a=new me(e.glowing),o=new me(e.overrideGlowColor),l=new me(e.glowColor),c=new me(e.invisible),u=new me(e.nbt),d=new me(e.shadowRadius),m=new me(e.shadowStrength),p=new me(e.useNBT);new Pt({id:`${_e.name}:textDisplayConfigDialog`,title:w("dialog.text_display_config.title"),width:400,component:_0,props:{variant:Se.selected,billboard:t,overrideBrightness:i,brightnessOverride:r,glowing:a,overrideGlowColor:o,glowColor:l,invisible:c,nbt:u,shadowRadius:d,shadowStrength:m,useNBT:p},preventKeybinds:!0,onConfirm(){let f=new Mt;f.billboard=t.get(),f.overrideBrightness=i.get(),f.brightnessOverride=r.get(),f.glowing=a.get(),f.overrideGlowColor=o.get(),f.glowColor=l.get(),f.invisible=c.get(),f.nbt=u.get(),f.shadowRadius=d.get(),f.shadowStrength=m.get(),f.useNBT=p.get();let _=Mt.getDefault();f.billboard===_.billboard&&(f.billboard=void 0),f.overrideBrightness===_.overrideBrightness&&(f.overrideBrightness=void 0),f.brightnessOverride===_.brightnessOverride&&(f.brightnessOverride=void 0),f.glowing===_.glowing&&(f.glowing=void 0),f.overrideGlowColor===_.overrideGlowColor&&(f.overrideGlowColor=void 0),f.glowColor===_.glowColor&&(f.glowColor=void 0),f.invisible===_.invisible&&(f.invisible=void 0),f.nbt===_.nbt&&(f.nbt=void 0),f.shadowRadius===_.shadowRadius&&(f.shadowRadius=void 0),f.shadowStrength===_.shadowStrength&&(f.shadowStrength=void 0),f.useNBT===_.useNBT&&(f.useNBT=void 0),n.config=f.toJSON()}}).show()}s(I7,"openBoneConfigDialog");var g0=Xt(`${_e.name}:text_display_config`,{icon:"settings",name:w("action.open_text_display_config.name"),condition:()=>Ue(),click:()=>{Je.selected.length!==0&&I7(Je.selected[0])}});var un=class extends OutlinerElement{name;position;rotation;scale;visibility;preview_controller=O7;movable=!0;rotatable=!0;scalable=!0;resizable=!0;get from(){return this.position}set from(e){this.position=e}get to(){return[0,0,0]}get stretch(){return[]}get uv_offset(){return[]}constructor(e,t=guid()){super(e,t),this.extend(e),this.name??="resizable_outliner_element",this.position??=[0,0,0],this.rotation??=[0,0,0],this.scale??=[1,1,1],this.visibility??=!0}get origin(){return this.position}getWorldCenter(){return Reusable.vec3.set(0,0,0),THREE.fastWorldPosition(this.mesh,Reusable.vec2).add(Reusable.vec3)}extend(e){for(let t in un.properties)un.properties[t].merge(this,e);return e.visibility!==void 0&&(this.visibility=e.visibility),this}selectLow(){return Project.selected_elements.safePush(this),this.selected=!0,TickUpdates.selection=!0,this}size(e,t){return e===void 0?t?this.scale.map(i=>Math.floor(i)):[...this.scale]:t?Math.floor(this.scale[e]):this.scale[e]}oldScale;resize(e,t){let i=this.oldScale!==void 0?this.oldScale:this.size(t);i instanceof Array&&(i=i[t]);let r=i<0&&t!==1?-1:1,a=typeof e=="function"?e:o=>o+e*r/16;this.scale[t]=a(i),this.preview_controller.updateGeometry?.(this),this.preview_controller.updateTransform(this)}};s(un,"ResizableOutlinerElement");new Property(un,"string","name",{default:"resizable_outliner_element"});new Property(un,"vector","position",{default:[0,0,0]});new Property(un,"vector","rotation",{default:[0,0,0]});new Property(un,"vector","scale",{default:[1,1,1]});new Property(un,"string","visibility",{default:!0});var O7=new NodePreviewController(un,{setup(n){let e=new THREE.Mesh;e.isElement=!0,e.fix_rotation=new THREE.Euler(0,0,0,"ZYX"),e.fix_rotation.x=Math.degToRad(n.rotation[0]),e.fix_rotation.y=Math.degToRad(n.rotation[1]),e.fix_rotation.z=Math.degToRad(n.rotation[2]),e.fix_position=new THREE.Vector3(...n.position),e.fix_scale=new THREE.Vector3(...n.scale),Project.nodes_3d[n.uuid]=e,n.preview_controller.updateGeometry?.(n),n.preview_controller.dispatchEvent("setup",{element:n})},updateTransform(n){NodePreviewController.prototype.updateTransform.call(n.preview_controller,n),n.mesh.fix_position&&(n.mesh.fix_position.set(...n.position),n.parent instanceof Group&&(n.mesh.fix_position.x-=n.parent.origin[0],n.mesh.fix_position.y-=n.parent.origin[1],n.mesh.fix_position.z-=n.parent.origin[2])),n.mesh.fix_rotation&&n.mesh.fix_rotation.copy(n.mesh.rotation),n.mesh.fix_scale&&(n.mesh.fix_scale.set(...n.scale),lg(n.mesh.fix_scale)),n.preview_controller.dispatchEvent("update_transform",{element:n})}});function N7(n){let e,t,i,r,a,o,l;function c(f){n[25](f)}s(c,"checkbox_checked_binding");let u={label:w("dialog.bone_config.use_nbt.title"),tooltip:w("dialog.bone_config.use_nbt.description")};n[10]!==void 0&&(u.checked=n[10]),e=new it({props:u}),se.push(()=>be(e,"checked",c));let d=[R7,D7],m=[];function p(f,_){return f[12]?0:1}return s(p,"select_block_type_1"),r=p(n,[-1,-1]),a=m[r]=d[r](n),{c(){fe(e.$$.fragment),i=K(),a.c(),o=St()},m(f,_){de(e,f,_),G(f,i,_),m[r].m(f,_),G(f,o,_),l=!0},p(f,_){let v={};!t&&_[0]&1024&&(t=!0,v.checked=f[10],he(()=>t=!1)),e.$set(v);let g=r;r=p(f,_),r===g?m[r].p(f,_):(bt(),Y(m[g],1,1,()=>{m[g]=null}),vt(),a=m[r],a?a.p(f,_):(a=m[r]=d[r](f),a.c()),W(a,1),a.m(o.parentNode,o))},i(f){l||(W(e.$$.fragment,f),W(a),l=!0)},o(f){Y(e.$$.fragment,f),Y(a),l=!1},d(f){ue(e,f),f&&z(i),m[r].d(f),f&&z(o)}}}s(N7,"create_else_block");function B7(n){let e,t,i,r,a,o,l,c,u,d,m,p,f,_,v,g,h,b,x,y,k,C;function A(P){n[17](P)}s(A,"select_value_binding");let I={label:w("dialog.bone_config.billboard.title"),tooltip:w("dialog.bone_config.billboard.description"),options:n[15],defaultOption:Pe.prototype.billboard};n[0]!==void 0&&(I.value=n[0]),e=new Kn({props:I}),se.push(()=>be(e,"value",A));function S(P){n[18](P)}s(S,"checkbox0_checked_binding");let L={label:w("dialog.bone_config.glowing.title"),tooltip:w("dialog.bone_config.glowing.description")};n[3]!==void 0&&(L.checked=n[3]),r=new it({props:L}),se.push(()=>be(r,"checked",S));function O(P){n[19](P)}s(O,"colorpicker_value_binding");let E={label:w("dialog.bone_config.glow_color.title"),tooltip:w("dialog.bone_config.glow_color.description")};n[5]!==void 0&&(E.value=n[5]),l=new Gi({props:E}),se.push(()=>be(l,"value",O));function B(P){n[20](P)}s(B,"numberslider0_value_binding");let H={label:w("dialog.bone_config.shadow_radius.title"),tooltip:w("dialog.bone_config.shadow_radius.description"),min:0,max:64};n[8]!==void 0&&(H.value=n[8]),d=new xt({props:H}),se.push(()=>be(d,"value",B));function ee(P){n[21](P)}s(ee,"numberslider1_value_binding");let ae={label:w("dialog.bone_config.shadow_strength.title"),tooltip:w("dialog.bone_config.shadow_strength.description"),min:0};n[9]!==void 0&&(ae.value=n[9]),f=new xt({props:ae}),se.push(()=>be(f,"value",ee));function ne(P){n[22](P)}s(ne,"checkbox1_checked_binding");let ve={label:w("dialog.bone_config.override_brightness.title"),tooltip:w("dialog.bone_config.override_brightness.description")};n[1]!==void 0&&(ve.checked=n[1]),g=new it({props:ve}),se.push(()=>be(g,"checked",ne));let X=n[11]&&v0(n);function j(P){n[24](P)}s(j,"checkbox2_checked_binding");let Q={label:w("dialog.bone_config.invisible.title"),tooltip:w("dialog.bone_config.invisible.description")};return n[6]!==void 0&&(Q.checked=n[6]),y=new it({props:Q}),se.push(()=>be(y,"checked",j)),{c(){fe(e.$$.fragment),i=K(),fe(r.$$.fragment),o=K(),fe(l.$$.fragment),u=K(),fe(d.$$.fragment),p=K(),fe(f.$$.fragment),v=K(),fe(g.$$.fragment),b=K(),X&&X.c(),x=K(),fe(y.$$.fragment)},m(P,oe){de(e,P,oe),G(P,i,oe),de(r,P,oe),G(P,o,oe),de(l,P,oe),G(P,u,oe),de(d,P,oe),G(P,p,oe),de(f,P,oe),G(P,v,oe),de(g,P,oe),G(P,b,oe),X&&X.m(P,oe),G(P,x,oe),de(y,P,oe),C=!0},p(P,oe){let Z={};!t&&oe[0]&1&&(t=!0,Z.value=P[0],he(()=>t=!1)),e.$set(Z);let J={};!a&&oe[0]&8&&(a=!0,J.checked=P[3],he(()=>a=!1)),r.$set(J);let ie={};!c&&oe[0]&32&&(c=!0,ie.value=P[5],he(()=>c=!1)),l.$set(ie);let U={};!m&&oe[0]&256&&(m=!0,U.value=P[8],he(()=>m=!1)),d.$set(U);let q={};!_&&oe[0]&512&&(_=!0,q.value=P[9],he(()=>_=!1)),f.$set(q);let ge={};!h&&oe[0]&2&&(h=!0,ge.checked=P[1],he(()=>h=!1)),g.$set(ge),P[11]?X?(X.p(P,oe),oe[0]&2048&&W(X,1)):(X=v0(P),X.c(),W(X,1),X.m(x.parentNode,x)):X&&(bt(),Y(X,1,1,()=>{X=null}),vt());let Te={};!k&&oe[0]&64&&(k=!0,Te.checked=P[6],he(()=>k=!1)),y.$set(Te)},i(P){C||(W(e.$$.fragment,P),W(r.$$.fragment,P),W(l.$$.fragment,P),W(d.$$.fragment,P),W(f.$$.fragment,P),W(g.$$.fragment,P),W(X),W(y.$$.fragment,P),C=!0)},o(P){Y(e.$$.fragment,P),Y(r.$$.fragment,P),Y(l.$$.fragment,P),Y(d.$$.fragment,P),Y(f.$$.fragment,P),Y(g.$$.fragment,P),Y(X),Y(y.$$.fragment,P),C=!1},d(P){ue(e,P),P&&z(i),ue(r,P),P&&z(o),ue(l,P),P&&z(u),ue(d,P),P&&z(p),ue(f,P),P&&z(v),ue(g,P),P&&z(b),X&&X.d(P),P&&z(x),ue(y,P)}}}s(B7,"create_if_block");function D7(n){let e,t,i,r,a,o,l,c,u,d,m,p,f,_,v,g,h,b,x,y,k;function C(j){n[27](j)}s(C,"select_value_binding_1");let A={label:w("dialog.bone_config.billboard.title"),tooltip:w("dialog.bone_config.billboard.description"),options:n[15],defaultOption:Pe.prototype.billboard};n[0]!==void 0&&(A.value=n[0]),e=new Kn({props:A}),se.push(()=>be(e,"value",C));function I(j){n[28](j)}s(I,"checkbox0_checked_binding_1");let S={label:w("dialog.bone_config.glowing.title"),tooltip:w("dialog.bone_config.glowing.description")};n[3]!==void 0&&(S.checked=n[3]),r=new it({props:S}),se.push(()=>be(r,"checked",I));function L(j){n[29](j)}s(L,"checkbox1_checked_binding_1");let O={label:w("dialog.bone_config.override_glow_color.title"),tooltip:w("dialog.bone_config.override_glow_color.description")};n[4]!==void 0&&(O.checked=n[4]),l=new it({props:O}),se.push(()=>be(l,"checked",L));let E=n[13]&&h0(n);function B(j){n[31](j)}s(B,"numberslider0_value_binding_1");let H={label:w("dialog.bone_config.shadow_radius.title"),tooltip:w("dialog.bone_config.shadow_radius.description"),min:0,max:15};n[8]!==void 0&&(H.value=n[8]),m=new xt({props:H}),se.push(()=>be(m,"value",B));function ee(j){n[32](j)}s(ee,"numberslider1_value_binding_1");let ae={label:w("dialog.bone_config.shadow_strength.title"),tooltip:w("dialog.bone_config.shadow_strength.description"),min:0,max:15};n[9]!==void 0&&(ae.value=n[9]),_=new xt({props:ae}),se.push(()=>be(_,"value",ee));function ne(j){n[33](j)}s(ne,"checkbox2_checked_binding_1");let ve={label:w("dialog.bone_config.override_brightness.title"),tooltip:w("dialog.bone_config.override_brightness.description")};n[1]!==void 0&&(ve.checked=n[1]),h=new it({props:ve}),se.push(()=>be(h,"checked",ne));let X=n[11]&&b0(n);return{c(){fe(e.$$.fragment),i=K(),fe(r.$$.fragment),o=K(),fe(l.$$.fragment),u=K(),E&&E.c(),d=K(),fe(m.$$.fragment),f=K(),fe(_.$$.fragment),g=K(),fe(h.$$.fragment),x=K(),X&&X.c(),y=St()},m(j,Q){de(e,j,Q),G(j,i,Q),de(r,j,Q),G(j,o,Q),de(l,j,Q),G(j,u,Q),E&&E.m(j,Q),G(j,d,Q),de(m,j,Q),G(j,f,Q),de(_,j,Q),G(j,g,Q),de(h,j,Q),G(j,x,Q),X&&X.m(j,Q),G(j,y,Q),k=!0},p(j,Q){let P={};!t&&Q[0]&1&&(t=!0,P.value=j[0],he(()=>t=!1)),e.$set(P);let oe={};!a&&Q[0]&8&&(a=!0,oe.checked=j[3],he(()=>a=!1)),r.$set(oe);let Z={};!c&&Q[0]&16&&(c=!0,Z.checked=j[4],he(()=>c=!1)),l.$set(Z),j[13]?E?(E.p(j,Q),Q[0]&8192&&W(E,1)):(E=h0(j),E.c(),W(E,1),E.m(d.parentNode,d)):E&&(bt(),Y(E,1,1,()=>{E=null}),vt());let J={};!p&&Q[0]&256&&(p=!0,J.value=j[8],he(()=>p=!1)),m.$set(J);let ie={};!v&&Q[0]&512&&(v=!0,ie.value=j[9],he(()=>v=!1)),_.$set(ie);let U={};!b&&Q[0]&2&&(b=!0,U.checked=j[1],he(()=>b=!1)),h.$set(U),j[11]?X?(X.p(j,Q),Q[0]&2048&&W(X,1)):(X=b0(j),X.c(),W(X,1),X.m(y.parentNode,y)):X&&(bt(),Y(X,1,1,()=>{X=null}),vt())},i(j){k||(W(e.$$.fragment,j),W(r.$$.fragment,j),W(l.$$.fragment,j),W(E),W(m.$$.fragment,j),W(_.$$.fragment,j),W(h.$$.fragment,j),W(X),k=!0)},o(j){Y(e.$$.fragment,j),Y(r.$$.fragment,j),Y(l.$$.fragment,j),Y(E),Y(m.$$.fragment,j),Y(_.$$.fragment,j),Y(h.$$.fragment,j),Y(X),k=!1},d(j){ue(e,j),j&&z(i),ue(r,j),j&&z(o),ue(l,j),j&&z(u),E&&E.d(j),j&&z(d),ue(m,j),j&&z(f),ue(_,j),j&&z(g),ue(h,j),j&&z(x),X&&X.d(j),j&&z(y)}}}s(D7,"create_else_block_1");function R7(n){let e,t,i,r,a;function o(c){n[26](c)}s(o,"lineinput_value_binding");let l={label:w("dialog.bone_config.nbt.title"),tooltip:w("dialog.bone_config.nbt.description"),valueChecker:n[16]};return n[7]!==void 0&&(l.value=n[7]),i=new hn({props:l}),se.push(()=>be(i,"value",o)),{c(){e=V("p"),e.textContent=`${w("dialog.bone_config.use_nbt.use_nbt_warning")}`,t=K(),fe(i.$$.fragment),T(e,"class","use_nbt_warning")},m(c,u){G(c,e,u),G(c,t,u),de(i,c,u),a=!0},p(c,u){let d={};!r&&u[0]&128&&(r=!0,d.value=c[7],he(()=>r=!1)),i.$set(d)},i(c){a||(W(i.$$.fragment,c),a=!0)},o(c){Y(i.$$.fragment,c),a=!1},d(c){c&&z(e),c&&z(t),ue(i,c)}}}s(R7,"create_if_block_2");function h0(n){let e,t,i;function r(o){n[30](o)}s(r,"colorpicker_value_binding_1");let a={label:w("dialog.bone_config.glow_color.title"),tooltip:w("dialog.bone_config.glow_color.description")};return n[5]!==void 0&&(a.value=n[5]),e=new Gi({props:a}),se.push(()=>be(e,"value",r)),{c(){fe(e.$$.fragment)},m(o,l){de(e,o,l),i=!0},p(o,l){let c={};!t&&l[0]&32&&(t=!0,c.value=o[5],he(()=>t=!1)),e.$set(c)},i(o){i||(W(e.$$.fragment,o),i=!0)},o(o){Y(e.$$.fragment,o),i=!1},d(o){ue(e,o)}}}s(h0,"create_if_block_4");function b0(n){let e,t,i;function r(o){n[34](o)}s(r,"numberslider_value_binding_1");let a={label:w("dialog.bone_config.brightness_override.title"),tooltip:w("dialog.bone_config.brightness_override.description"),min:0,max:15};return n[2]!==void 0&&(a.value=n[2]),e=new xt({props:a}),se.push(()=>be(e,"value",r)),{c(){fe(e.$$.fragment)},m(o,l){de(e,o,l),i=!0},p(o,l){let c={};!t&&l[0]&4&&(t=!0,c.value=o[2],he(()=>t=!1)),e.$set(c)},i(o){i||(W(e.$$.fragment,o),i=!0)},o(o){Y(e.$$.fragment,o),i=!1},d(o){ue(e,o)}}}s(b0,"create_if_block_3");function v0(n){let e,t,i;function r(o){n[23](o)}s(r,"numberslider_value_binding");let a={label:w("dialog.bone_config.brightness_override.title"),tooltip:w("dialog.bone_config.brightness_override.description"),min:0,max:15};return n[2]!==void 0&&(a.value=n[2]),e=new xt({props:a}),se.push(()=>be(e,"value",r)),{c(){fe(e.$$.fragment)},m(o,l){de(e,o,l),i=!0},p(o,l){let c={};!t&&l[0]&4&&(t=!0,c.value=o[2],he(()=>t=!1)),e.$set(c)},i(o){i||(W(e.$$.fragment,o),i=!0)},o(o){Y(e.$$.fragment,o),i=!1},d(o){ue(e,o)}}}s(v0,"create_if_block_1");function M7(n){let e,t,i,r,a=[B7,N7],o=[];function l(c,u){return c[14]?0:1}return s(l,"select_block_type"),t=l(n,[-1,-1]),i=o[t]=a[t](n),{c(){e=V("div"),i.c()},m(c,u){G(c,e,u),o[t].m(e,null),r=!0},p(c,u){i.p(c,u)},i(c){r||(W(i),r=!0)},o(c){Y(i),r=!1},d(c){c&&z(e),o[t].d()}}}s(M7,"create_fragment");function F7(n,e,t){let i,r=re,a=s(()=>(r(),r=ze(_,q=>t(11,i=q)),_),"$$subscribe_overrideBrightness"),o,l=re,c=s(()=>(l(),l=ze(A,q=>t(12,o=q)),A),"$$subscribe_useNBT"),u,d=re,m=s(()=>(d(),d=ze(h,q=>t(13,u=q)),h),"$$subscribe_overrideGlowColor");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l()),n.$$.on_destroy.push(()=>d());let p=!!Project?.animated_java?.enable_plugin_mode,{billboard:f}=e,{overrideBrightness:_}=e;a();let{brightnessOverride:v}=e,{glowing:g}=e,{overrideGlowColor:h}=e;m();let{glowColor:b}=e,{invisible:x}=e,{nbt:y}=e,{shadowRadius:k}=e,{shadowStrength:C}=e,{useNBT:A}=e;c();let I={fixed:w("dialog.bone_config.billboard.options.fixed"),vertical:w("dialog.bone_config.billboard.options.vertical"),horizontal:w("dialog.bone_config.billboard.options.horizontal"),center:w("dialog.bone_config.billboard.options.center")},S=s(q=>{let ge;try{ge=qe.fromString(q)}catch(Te){return{type:"error",message:w("dialog.bone_config.nbt.invalid_nbt.error",Te.message)}}return ge instanceof Ze?{type:"success",message:""}:{type:"error",message:w("dialog.bone_config.nbt.invalid_nbt.not_compound")}},"nbtChecker");function L(q){f=q,t(0,f)}s(L,"select_value_binding");function O(q){g=q,t(3,g)}s(O,"checkbox0_checked_binding");function E(q){b=q,t(5,b)}s(E,"colorpicker_value_binding");function B(q){k=q,t(8,k)}s(B,"numberslider0_value_binding");function H(q){C=q,t(9,C)}s(H,"numberslider1_value_binding");function ee(q){_=q,a(t(1,_))}s(ee,"checkbox1_checked_binding");function ae(q){v=q,t(2,v)}s(ae,"numberslider_value_binding");function ne(q){x=q,t(6,x)}s(ne,"checkbox2_checked_binding");function ve(q){A=q,c(t(10,A))}s(ve,"checkbox_checked_binding");function X(q){y=q,t(7,y)}s(X,"lineinput_value_binding");function j(q){f=q,t(0,f)}s(j,"select_value_binding_1");function Q(q){g=q,t(3,g)}s(Q,"checkbox0_checked_binding_1");function P(q){h=q,m(t(4,h))}s(P,"checkbox1_checked_binding_1");function oe(q){b=q,t(5,b)}s(oe,"colorpicker_value_binding_1");function Z(q){k=q,t(8,k)}s(Z,"numberslider0_value_binding_1");function J(q){C=q,t(9,C)}s(J,"numberslider1_value_binding_1");function ie(q){_=q,a(t(1,_))}s(ie,"checkbox2_checked_binding_1");function U(q){v=q,t(2,v)}return s(U,"numberslider_value_binding_1"),n.$$set=q=>{"billboard"in q&&t(0,f=q.billboard),"overrideBrightness"in q&&a(t(1,_=q.overrideBrightness)),"brightnessOverride"in q&&t(2,v=q.brightnessOverride),"glowing"in q&&t(3,g=q.glowing),"overrideGlowColor"in q&&m(t(4,h=q.overrideGlowColor)),"glowColor"in q&&t(5,b=q.glowColor),"invisible"in q&&t(6,x=q.invisible),"nbt"in q&&t(7,y=q.nbt),"shadowRadius"in q&&t(8,k=q.shadowRadius),"shadowStrength"in q&&t(9,C=q.shadowStrength),"useNBT"in q&&c(t(10,A=q.useNBT))},[f,_,v,g,h,b,x,y,k,C,A,i,o,u,p,I,S,L,O,E,B,H,ee,ae,ne,ve,X,j,Q,P,oe,Z,J,ie,U]}s(F7,"instance");var xu=class extends je{constructor(e){super(),Ie(this,e,F7,M7,Ae,{billboard:0,overrideBrightness:1,brightnessOverride:2,glowing:3,overrideGlowColor:4,glowColor:5,invisible:6,nbt:7,shadowRadius:8,shadowStrength:9,useNBT:10},null,[-1,-1])}};s(xu,"VanillaBlockDisplayConfigDialog");var y0=xu;function L7(n){let e=Mt.fromJSON(n.config??=new Mt().toJSON()),t=new me(e.billboard),i=new me(e.overrideBrightness),r=new me(e.brightnessOverride),a=new me(e.glowing),o=new me(e.overrideGlowColor),l=new me(e.glowColor),c=new me(e.invisible),u=new me(e.nbt),d=new me(e.shadowRadius),m=new me(e.shadowStrength),p=new me(e.useNBT);new Pt({id:`${_e.name}:vanillaItemDisplayConfigDialog`,title:w("dialog.vanilla_block_display_config.title"),width:400,component:y0,props:{variant:Se.selected,billboard:t,overrideBrightness:i,brightnessOverride:r,glowing:a,overrideGlowColor:o,glowColor:l,invisible:c,nbt:u,shadowRadius:d,shadowStrength:m,useNBT:p},preventKeybinds:!0,onConfirm(){let f=new Mt;f.billboard=t.get(),f.overrideBrightness=i.get(),f.brightnessOverride=r.get(),f.glowing=a.get(),f.overrideGlowColor=o.get(),f.glowColor=l.get(),f.invisible=c.get(),f.nbt=u.get(),f.shadowRadius=d.get(),f.shadowStrength=m.get(),f.useNBT=p.get();let _=Mt.getDefault();f.billboard===_.billboard&&(f.billboard=void 0),f.overrideBrightness===_.overrideBrightness&&(f.overrideBrightness=void 0),f.brightnessOverride===_.brightnessOverride&&(f.brightnessOverride=void 0),f.glowing===_.glowing&&(f.glowing=void 0),f.overrideGlowColor===_.overrideGlowColor&&(f.overrideGlowColor=void 0),f.glowColor===_.glowColor&&(f.glowColor=void 0),f.invisible===_.invisible&&(f.invisible=void 0),f.nbt===_.nbt&&(f.nbt=void 0),f.shadowRadius===_.shadowRadius&&(f.shadowRadius=void 0),f.shadowStrength===_.shadowStrength&&(f.shadowStrength=void 0),f.useNBT===_.useNBT&&(f.useNBT=void 0),n.config=f.toJSON()}}).show()}s(L7,"openVanillaBlockDisplayConfigDialog");var w0=Xt(`${_e.name}:open_vanilla_block_display_config`,{icon:"settings",name:w("action.open_vanilla_block_display_config.name"),condition:()=>Ue(),click:()=>{ft.selected.length!==0&&L7(ft.selected[0])}});var Am={};vn(Am,{getBlockModel:()=>Cm,parseBlockModel:()=>ar,parseBlockState:()=>T0});var ku=` +}`};var ob={},EP=s(function(n,e,t,i,r){var a=new Worker(ob[e]||(ob[e]=URL.createObjectURL(new Blob([n+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(o){var l=o.data,u=l.$e$;if(u){var c=new Error(u[0]);c.code=u[1],c.stack=u[2],r(c,null)}else r(null,l)},a.postMessage(t,i),a},"wk"),sn=Uint8Array,fi=Uint16Array,_l=Int32Array,Ho=new sn([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,0,0,0]),$o=new sn([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,0,0]),ml=new sn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),db=s(function(n,e){for(var t=new fi(31),i=0;i<31;++i)t[i]=e+=1<>1|(Ut&21845)<<1,Hr=(Hr&52428)>>2|(Hr&13107)<<2,Hr=(Hr&61680)>>4|(Hr&3855)<<4,pl[Ut]=((Hr&65280)>>8|(Hr&255)<<8)>>1;var Hr,Ut,$i=s(function(n,e,t){for(var i=n.length,r=0,a=new fi(e);r>u]=c}else for(l=new fi(i),r=0;r>15-n[r]);return l},"hMap"),$r=new sn(288);for(Ut=0;Ut<144;++Ut)$r[Ut]=8;var Ut;for(Ut=144;Ut<256;++Ut)$r[Ut]=9;var Ut;for(Ut=256;Ut<280;++Ut)$r[Ut]=7;var Ut;for(Ut=280;Ut<288;++Ut)$r[Ut]=8;var Ut,Jo=new sn(32);for(Ut=0;Ut<32;++Ut)Jo[Ut]=5;var Ut,_b=$i($r,9,0),gb=$i($r,9,1),hb=$i(Jo,5,0),bb=$i(Jo,5,1),qc=s(function(n){for(var e=n[0],t=1;te&&(e=n[t]);return e},"max"),Hi=s(function(n,e,t){var i=e/8|0;return(n[i]|n[i+1]<<8)>>(e&7)&t},"bits"),Kc=s(function(n,e){var t=e/8|0;return(n[t]|n[t+1]<<8|n[t+2]<<16)>>(e&7)},"bits16"),gl=s(function(n){return(n+7)/8|0},"shft"),Ka=s(function(n,e,t){return(e==null||e<0)&&(e=0),(t==null||t>n.length)&&(t=n.length),new sn(n.subarray(e,t))},"slc");var vb=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],An=s(function(n,e,t){var i=new Error(e||vb[n]);if(i.code=n,Error.captureStackTrace&&Error.captureStackTrace(i,An),!t)throw i;return i},"err"),yb=s(function(n,e,t,i){var r=n.length,a=i?i.length:0;if(!r||e.f&&!e.l)return t||new sn(0);var o=!t,l=o||e.i!=2,u=e.i;o&&(t=new sn(r*3));var c=s(function(be){var H=t.length;if(be>H){var ie=new sn(Math.max(H*2,be));ie.set(t),t=ie}},"cbuf"),d=e.f||0,m=e.p||0,p=e.b||0,f=e.l,_=e.d,g=e.m,h=e.n,v=r*8;do{if(!f){d=Hi(n,m,1);var y=Hi(n,m+1,3);if(m+=3,y)if(y==1)f=gb,_=bb,g=9,h=5;else if(y==2){var E=Hi(n,m,31)+257,C=Hi(n,m+10,15)+4,j=E+Hi(n,m+5,31)+1;m+=14;for(var S=new sn(j),B=new sn(19),O=0;O>4;if(k<16)S[O++]=k;else{var fe=0,ae=0;for(k==16?(ae=3+Hi(n,m,3),m+=2,fe=S[O-1]):k==17?(ae=3+Hi(n,m,7),m+=3):k==18&&(ae=11+Hi(n,m,127),m+=7);ae--;)S[O++]=fe}}var ee=S.subarray(0,E),se=S.subarray(E);g=qc(ee),h=qc(se),f=$i(ee,g,1),_=$i(se,h,1)}else An(1);else{var k=gl(m)+4,b=n[k-4]|n[k-3]<<8,x=k+b;if(x>r){u&&An(0);break}l&&c(p+b),t.set(n.subarray(k,x),p),e.b=p+=b,e.p=m=x*8,e.f=d;continue}if(m>v){u&&An(0);break}}l&&c(p+131072);for(var oe=(1<>4;if(m+=fe&15,m>v){u&&An(0);break}if(fe||An(2),pe<256)t[p++]=pe;else if(pe==256){ne=m,f=null;break}else{var W=pe-254;if(pe>264){var O=pe-257,U=Ho[O];W=Hi(n,m,(1<>4;ce||An(3),m+=ce&15;var se=pb[J];if(J>3){var U=$o[J];se+=Kc(n,m)&(1<v){u&&An(0);break}l&&c(p+131072);var Ce=p+W;if(p>8},"wbits"),Go=s(function(n,e,t){t<<=e&7;var i=e/8|0;n[i]|=t,n[i+1]|=t>>8,n[i+2]|=t>>16},"wbits16"),Wc=s(function(n,e){for(var t=[],i=0;ip&&(p=a[i].s);var f=new fi(p+1),_=Xc(t[d-1],f,0);if(_>e){var i=0,g=0,h=_-e,v=1<e)g+=v-(1<<_-f[y]),f[y]=e;else break}for(g>>=h;g>0;){var k=a[i].s;f[k]=0&&g;--i){var b=a[i].s;f[b]==e&&(--f[b],++g)}_=e}return{t:new sn(f),l:_}},"hTree"),Xc=s(function(n,e,t){return n.s==-1?Math.max(Xc(n.l,e,t+1),Xc(n.r,e,t+1)):e[n.s]=t},"ln"),tm=s(function(n){for(var e=n.length;e&&!n[--e];);for(var t=new fi(++e),i=0,r=n[0],a=1,o=s(function(u){t[i++]=u},"w"),l=1;l<=e;++l)if(n[l]==r&&l!=e)++a;else{if(!r&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(r),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(r);a=1,r=n[l]}return{c:t.subarray(0,i),n:e}},"lc"),Uo=s(function(n,e){for(var t=0,i=0;i>8,n[r+2]=n[r]^255,n[r+3]=n[r+1]^255;for(var a=0;a4&&!B[ml[A-1]];--A);var V=c+5<<3,K=Uo(r,$r)+Uo(a,Jo)+o,te=Uo(r,p)+Uo(a,g)+o+14+3*A+Uo(C,B)+2*C[16]+3*C[17]+7*C[18];if(u>=0&&V<=K&&V<=te)return om(e,d,n.subarray(u,u+c));var fe,ae,ee,se;if(Ir(e,d,1+(te15&&(Ir(e,d,pe[j]>>5&127),d+=pe[j]>>12)}}else fe=_b,ae=$r,ee=hb,se=Jo;for(var j=0;j255){var W=U>>18&31;Go(e,d,fe[W+257]),d+=ae[W+257],W>7&&(Ir(e,d,U>>23&31),d+=Ho[W]);var ce=U&31;Go(e,d,ee[ce]),d+=se[ce],ce>3&&(Go(e,d,U>>5&8191),d+=$o[ce])}else Go(e,d,fe[U]),d+=ae[U]}return Go(e,d,fe[256]),d+ae[256]},"wblk"),wb=new _l([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),sm=new sn(0),xb=s(function(n,e,t,i,r,a){var o=a.z||n.length,l=new sn(i+o+5*(1+Math.ceil(o/7e3))+r),u=l.subarray(i,l.length-r),c=a.l,d=(a.r||0)&7;if(e){d&&(u[0]=a.r>>3);for(var m=wb[e-1],p=m>>13,f=m&8191,_=(1<7e3||B>24576)&&(fe>423||!c)){d=nm(n,u,0,b,x,E,j,B,A,S-A,d),B=C=j=0,A=S;for(var ae=0;ae<286;++ae)x[ae]=0;for(var ae=0;ae<30;++ae)E[ae]=0}var ee=2,se=0,oe=f,xe=K-te&32767;if(fe>2&&V==k(S-xe))for(var ne=Math.min(p,fe)-1,pe=Math.min(32767,S),W=Math.min(258,fe);xe<=pe&&--oe&&K!=te;){if(n[S+ee]==n[S+ee-xe]){for(var U=0;Uee){if(ee=U,se=xe,U>ne)break;for(var ce=Math.min(xe,U-2),J=0,ae=0;aeJ&&(J=z,te=Ce)}}}K=te,te=g[K],xe+=K-te&32767}if(se){b[B++]=268435456|Zc[ee]<<18|em[se];var be=Zc[ee]&31,H=em[se]&31;j+=Ho[be]+$o[H],++x[257+be],++E[H],O=S+ee,++C}else b[B++]=n[S],++x[n[S]]}}for(S=Math.max(S,O);S=o&&(u[d/8|0]=c,ie=o),d=om(u,d+1,n.subarray(S,ie))}a.i=o}return Ka(l,0,i+gl(d)+r)},"dflt"),TP=function(){for(var n=new Int32Array(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(t&1&&-306674912)^t>>>1;n[e]=t}return n}(),CP=s(function(){var n=-1;return{p:function(e){for(var t=n,i=0;i>>8;n=t},d:function(){return~n}}},"crc");var kb=s(function(n,e,t,i,r){if(!r&&(r={l:1},e.dictionary)){var a=e.dictionary.subarray(-32768),o=new sn(a.length+n.length);o.set(a),o.set(n,a.length),n=o,r.w=a.length}return xb(n,e.level==null?6:e.level,e.mem==null?r.l?Math.ceil(Math.max(8,Math.min(13,Math.log(n.length)))*1.5):20:12+e.mem,t,i,r)},"dopt"),lm=s(function(n,e){var t={};for(var i in n)t[i]=n[i];for(var i in e)t[i]=e[i];return t},"mrg"),sb=s(function(n,e,t){for(var i=n(),r=n.toString(),a=r.slice(r.indexOf("[")+1,r.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o>>0},"b4"),Qf=s(function(n,e){return ar(n,e)+ar(n,e+4)*4294967296},"b8"),Kn=s(function(n,e,t){for(;t;++e)n[e]=t,t>>>=8},"wbytes");function OP(n,e,t){return t||(t=e,e={}),typeof t!="function"&&An(7),Tb(n,e,[IP],function(i){return Qc(cm(i.data[0],i.data[1]))},0,t)}s(OP,"deflate");function cm(n,e){return kb(n,e||{},0,0)}s(cm,"deflateSync");function NP(n,e,t){return t||(t=e,e={}),typeof t!="function"&&An(7),Tb(n,e,[jP],function(i){return Qc(um(i.data[0],Eb(i.data[1])))},1,t)}s(NP,"inflate");function um(n,e){return yb(n,{i:2},e&&e.out,e&&e.dictionary)}s(um,"inflateSync");var Cb=s(function(n,e,t,i){for(var r in n){var a=n[r],o=e+r,l=i;Array.isArray(a)&&(l=lm(i,a[1]),a=a[0]),a instanceof sn?t[o]=[a,l]:(t[o+="/"]=[new sn(0),l],Cb(a,o,t,i))}},"fltn"),lb=typeof TextEncoder<"u"&&new TextEncoder,im=typeof TextDecoder<"u"&&new TextDecoder,BP=0;try{im.decode(sm,{stream:!0}),BP=1}catch{}var RP=s(function(n){for(var e="",t=0;;){var i=n[t++],r=(i>127)+(i>223)+(i>239);if(t+r>n.length)return{s:e,r:Ka(n,t-1)};r?r==3?(i=((i&15)<<18|(n[t++]&63)<<12|(n[t++]&63)<<6|n[t++]&63)-65536,e+=String.fromCharCode(55296|i>>10,56320|i&1023)):r&1?e+=String.fromCharCode((i&31)<<6|n[t++]&63):e+=String.fromCharCode((i&15)<<12|(n[t++]&63)<<6|n[t++]&63):e+=String.fromCharCode(i)}},"dutf8");function cb(n,e){if(e){for(var t=new sn(n.length),i=0;i>1)),o=0,l=s(function(d){a[o++]=d},"w"),i=0;ia.length){var u=new sn(o+8+(r-i<<1));u.set(a),a=u}var c=n.charCodeAt(i);c<128||e?l(c):c<2048?(l(192|c>>6),l(128|c&63)):c>55295&&c<57344?(c=65536+(c&1047552)|n.charCodeAt(++i)&1023,l(240|c>>18),l(128|c>>12&63),l(128|c>>6&63),l(128|c&63)):(l(224|c>>12),l(128|c>>6&63),l(128|c&63))}return Ka(a,0,o)}s(cb,"strToU8");function DP(n,e){if(e){for(var t="",i=0;i65535&&An(9),e+=i+4}return e},"exfl"),ub=s(function(n,e,t,i,r,a,o,l){var u=i.length,c=t.extra,d=l&&l.length,m=rm(c);Kn(n,e,o!=null?33639248:67324752),e+=4,o!=null&&(n[e++]=20,n[e++]=t.os),n[e]=20,e+=2,n[e++]=t.flag<<1|(a<0&&8),n[e++]=r&&8,n[e++]=t.compression&255,n[e++]=t.compression>>8;var p=new Date(t.mtime==null?Date.now():t.mtime),f=p.getFullYear()-1980;if((f<0||f>119)&&An(10),Kn(n,e,f<<25|p.getMonth()+1<<21|p.getDate()<<16|p.getHours()<<11|p.getMinutes()<<5|p.getSeconds()>>1),e+=4,a!=-1&&(Kn(n,e,t.crc),Kn(n,e+4,a<0?-a-2:a),Kn(n,e+8,t.size)),Kn(n,e+12,u),Kn(n,e+14,m),e+=16,o!=null&&(Kn(n,e,d),Kn(n,e+6,t.attrs),Kn(n,e+10,o),e+=14),n.set(i,e),e+=u,m)for(var _ in c){var g=c[_],h=g.length;Kn(n,e,+_),Kn(n,e+2,h),n.set(g,e+4),e+=4+h}return d&&(n.set(l,e),e+=d),e},"wzh"),PP=s(function(n,e,t,i,r){Kn(n,e,101010256),Kn(n,e+8,t),Kn(n,e+10,t),Kn(n,e+12,i),Kn(n,e+16,r)},"wzf");function Ab(n,e,t){t||(t=e,e={}),typeof t!="function"&&An(7);var i={};Cb(n,"",i,e);var r=Object.keys(i),a=r.length,o=0,l=0,u=a,c=new Array(a),d=[],m=s(function(){for(var h=0;h65535&&K(An(11,0,1),null),!V)K(null,k);else if(E<16e4)try{K(null,cm(k,b))}catch(te){K(te,null)}else d.push(OP(k,b,K))},"_loop_1"),g=0;g65558)return o(An(13,0,1),null),r;var u=Or(n,l+8);if(u){var c=u,d=ar(n,l+16),m=d==4294967295||c==65535;if(m){var p=ar(n,l-12);m=ar(n,p)==101075792,m&&(c=u=ar(n,p+32),d=ar(n,p+48))}for(var f=e&&e.filter,_=s(function(h){var v=FP(n,d,m),y=v[0],k=v[1],b=v[2],x=v[3],E=v[4],C=v[5],j=MP(n,C);d=E;var S=s(function(O,A){O?(r(),o(O,null)):(A&&(a[x]=A),--u||o(null,a))},"cbl");if(!f||f({name:x,size:k,originalSize:b,compression:y}))if(!y)S(null,Ka(n,j,j+k));else if(y==8){var B=n.subarray(j,j+k);if(b<524288||k>.8*b)try{S(null,um(B,{out:new sn(b)}))}catch(O){S(O,null)}else i.push(NP(B,{size:b},S))}else S(An(14,"unknown compression type "+y,1),null);else S(null,null)},"_loop_3"),g=0;gnew At(e)))}s(Ii,"arrayToNbtFloatArray");function dm(n){let e=new THREE.Matrix4().copy(n).transpose().toArray();return Ii(e)}s(dm,"matrixToNbtFloatArray");function jb(n){let e=new Ye;return e.set("translation",Ii(n.translation.toArray())),e.set("left_rotation",Ii(n.left_rotation.toArray())),e.set("scale",Ii(n.scale.toArray())),e}s(jb,"transformationToNbt");function Ib(n,e,t){return n.split(PathModule.sep).map(i=>i===e?t:i).join(PathModule.sep)}s(Ib,"replacePathPart");function hl(n){let e={};return Object.keys(n).sort().forEach(t=>{e[t]=n[t]}),e}s(hl,"sortObjectKeys");var eu=s((n,e)=>new Promise((t,i)=>{Ab(n,e,(r,a)=>{r?i(r):t(a)})}),"zip"),Ob=s((n,e)=>new Promise((t,i)=>{Sb(n,e,(r,a)=>{r?i(r):t(a)})}),"unzip");var Zb=ci(Vb(),1);var qo="data:image/webp;base64,UklGRlIHAQBXRUJQVlA4WAoAAAASAAAAfwAAfwAAQU5JTQYAAAD/////AABBTk1GngcAABEAAAQAADUAAFgAABQAAAJBTFBIAQIAAAHXoKiRJDW3vSTl8MUREYIHnjMwluM4UeI7EYAl227bhmZxGIci0giW/e9UFvgIpvxG9J+BI0lKGpnM4TAnfMH80Cke5xS908XxOKdemV408XVcp/zzif1Kj5pkQav/+2CnCQmQbrh2xeSXkvbQgm6Q/9JIFntJjtXl3cfjSG/EJaoGudfzg5zlLYeVDHsfErWBTfyCnS8eB3GtQMlCZlzmWvtYnaoHX7s6jnVgN0+uDgR8YR3y3Guh6+EqbstkUYtJaGPLudJQY+b1UPViFd/iR555PWDfPvsasCdfAcTOGvU9QuH8atiRsYsfB6renxWD5Hwj9M8O4VjMN/QZ66cUE9hDe7JARlvcaCAoC4CeHVa/swToyWB7vpIQE9Rj1DsjR4aJh47ke0VIcrrBPb0ElOIWQLJAsVA1KxZrFnoU7iVjPoHNQs/v4wrkOcBdE388S4uQJ7y/oNuDx+glSl4OiUvU0HY+pBytwbwzablbRn3W6pZNnqSYMPq3XRmxFot1gp0pWmRkJ79qX5ESbKRN8quer/qbWxhSy9GOZTpgWCddhjptaIyXY5FS/DTdPobKyNflNnmeMH1XK4WVKTksN2uTPf88lXUxosts17RHbdmjse/W7z3KYY9m8+9raFvU5D3qeI/ab1lVK6egutPjacf2MNpTHoMpGnVcSjq7GQBWUDggfAUAABAaAJ0BKjYAWQA+MRSIQqIhIRgKBqggAwSygGN4vGy/Jz9B8oHy5WRtFOCE6Hbj8696LN4r9ADpdv9HWyfCPxHeuPbXlWs1/0P5YevnffLFsg8S/cc+jHhK0AP0B6qn9t5NvzH/QewP/J/7Pvo/7YrQiIUMLY/te+mXcn0kvyckNXt8ESRHOPGdfKYe3Lj/VoX5PUNmddsqyT31jCVCss1m/mnrUdX2UBMsSyIIQhTM5jiW3+z9b4uUrMeZV5pPIgOzNzubr4Pf+qKPnrU3ilHammJ5VBBeJwAA/vVAP/Z3eP3fh+HD/PTLqVt7dqhoDFPndzpU816yX21DU/6j/gtphtci73eW6Eaa+eQUY8HGal2yhdlh6kwA/Q3aezICxzf2U4Dsmh/7YvZLP4DdOESKLh1qltVSn4Ptgm+r0VnfatMhKey3vF5PiKk7/gaWF+Roz7hHj+t+4r2eSHsAgx1t1wAPf0xG1GjpcOu/13bFG/p3W5AdqBqjOg1z1xbshcP4XY6OMfApKKdys0Z+12Dp6XqBnmmnChoxcUxnsGL5xUEa9bZPWLvEUPfqxyk6cR5pwZoddXJdnjzgQJ1eXqwQ/MXjW6g/TSnOGI1f1EV2KYjOzDg2X/ARv/URGAgAEc41FspR0Vgj6Y5wLFFjCtWY8l97L41on2TKxZVUO9JXtijJ2B3jNSA1XdOKfpd6n1zDS/MV4S/ZwGgieEVZmw7VUEdiZvfvm0IUhZrvyekE7S3CquSNKYTCO6mLI0hHHiXCy68IVZdl9EK06cF2aPzop3iDe7W6wrwtIad7zhyvqu3VmddzLqPc6xcMx6I3982Y5yIN5toRP69Mv7XEHeSxp0h0jZFnaBFC3mPS35RWZoSynRtUWxgWiy/F676Hwzan26Iwzy9JR/YSN6gX1uenziCX85sKxHlGiQALoiWYfBbX5ARgzwRDT3vvLtqqRIa2mSqcVbG5/EnTfJeKGC2zWArQWZGrcx4jSiv1BkuxLrx55ezwMxnaioyZxLNtFVy1c4Xyf5Ri3xA86f5ELClqDf76n/xw7YejPHv3O2e73+xu/6ko3bCSxvcrVT347rXcFu15AbkQHP4zGCKy0ktUvjlw/eOkMr1AdpNHSdH/opuTKHz9dP9D2ovUvh33hkNUPv1615i3YcJTHT55wuHfRX2poFykM+NByUX87VnP+GZrin1cKphOVo8rYqVmAyB9m2L4qoFziCnKKmtyRe5qjZLtdCkdQ+Xdwsw8GKs79byQsWN+UzyhonzvfVSIP+hzkQ5S31hcbj9C6hYcoOmicPUCrRR6dXXZ5P6Izxk3bVhck1o/NWyciG8hW5UTGgW6BVB1qt2ay9W721CMlK7/sRIMxd7/U4uddFXujMUO+wqnscWBtjV2FuuIWS855m3/Hg6Ke86WMBY2Vn9FQ9bUkG6U/Rki/7s6GLk8FvnxihxBLOtemYlvDROQcd6VYdNc3KzD3Pj7Y36PFFpoLF+D/yG3ush05syzSiVRuRB+bWGSfF4DUy/xNyF7R7APLREQ9lezGgP/7dHd9MSRoQnXVu5RS06lgC9UHfhHfJsgQAVqVhcex2lP2q7WDimV5l7+LmXyeUJz6BWl9qc/8D7Hkedf4YXajARpBGpquMX8zOPidZmH23v4bIL3aGMNFmgq8jn19Gr8nD3gHXcG/89sn8Adl8Yb1ONeLzL2s3J99eKCiEygKJpTAGdCAAXTh3Tz6NTUiKNYwc6u2wigMOPKsJ7gdROMxJWP4D6+0r/+JkTh9pruYcQyBeyNlMsy2qBRH3BQoShnAXAQcoHhS8HMVAOwl2IMgtWWzZgEqc/m1AhTE/+Jj/0ugHTeGUgCAo1uvEPHDJ1zAAAAAEFOTUZcCAAADwAABAAAOQAAXAAAFAAAA0FMUEhPAgAAAaCjbW/bQPobNGTBfu6Dwj7QJBVmoZkN95nETQeKKMgGG1BYgiBqQxsRE4B/dsqb6Qpv+6asD56u2r6k2VZHz5MlcTSaLHdHxf+aMvaUZ1tsv+fZ6n+2RrOtjorJk1wn9383vaecy8tSFk6z2U/S+/h7DFOp5TTK+a4Ov3BYypkfj0frXS26RtDbx2OV3tVODmG1OSOo2WVYL0PNLlPGdapdpsh1ql2myHWqnT2+1agkp625R7GeVsOo2dnKYawO/alrRM9R1MzZcn4XISmK1aEMrBErgqiZsxGSRNQoVocykHvEErWas1HQKEFFHMoAWAN6DqrmbASgWmAjUAso4lkQVQHUgGpOKQCoRSwxRTwVAHIPGCVmMaeUsJ5DqHkqnssIaBTC6pCysVhgRQQ1c1Zs1llYHVJOaCmAmjkrNqlF2Ac6xuqQspV7SM/HVnNWPBO/05BGAI+twQCKOKRsPNRiKwBwUzNtDADVnBXPSSx4eQLdpTEBQBGHlI3cg6RsAImwWc1ZcYLKyjiafnZI2WI9NGTlhMDb2KvYXuzoeJEQfJMtKTvpgx6wBeHl40bFPt3FpxyH9KHVuiQHUH5ySToBRDjKw7Vi5tTMqzxVNbekmXj4VkycmrmVJ6IP5pc00V0PrJi3iPmV56EPdlDSPHc9smLaInZQeRr6YEclTXPXQytm5WFHlWehD3a40SyoxxZMm9qRUeYBq5kNR6OJ6ENvy4uxt2BmygTWnVGmel5tt9FsSfYWXGaU6XAbW43mw208CeOKt6FtKbgmM+F0AFZQOCDsBQAAsBkAnQEqOgBdAD4xFIhCoiEhGVreACADBLGAXZnJobvjvNAsvbgEVwr9upzs3o13iX0AOl4rtH694K+OkFfpA1Duy/9L5Td6vvgyib2T4j/VelulfzKf8j6rP9T/0/ux9zf0v7Bn6s759+0ax+NDEelV5XIu1mDfm+3hldWjtLtoup8Nv8wCk+i84E6TBZtEUTLop2Nllpuz50gcKeOYQLeJyhkqgNshkv85kaN6HE5jkakp6kJ3j7CQaS/jpL64ePTE0mrEwBCw2o0QjewgQ8yVwAGAAAD+9UA//2rb/Tgf6cD8qf/88x+w/NDoTJiuVErfh/f8djKyhTSRv0ELGTnmZLtRHfop4jeYBSN78Dz/6XrhaMm0o5yJTI6VhL1ceJawRp8Ozq2tFgK+8eQgXI3xsW+yDTM+Al1Yw37LyBLoxrPe2OsMwYY+IZhhtiI2Z2q3QHxYWaT40+n28GmV74USRaV7fgoSex2PGgMZaZetL/OQtGAOr+0GabgJHFdNXqNtek8L1HPMOBxnz8WP4ECoCJ9iNuqjocZiuYZkEyCa2AMATBmX+e0zgRdDkcpLmK+Hcf2isr6RlaUQOJRvFdC5yMlTsUszWxTtoF626EbBCP4Dg8MsebPewZm/bQ8nprpAOTDWbiLLfSE3qJNqk8ftE+cR7fR8/Tbk1Ape7Ow7Zk0/ysLgzTz6eROR1NOvKk8mj5z+OT4lQ1HLELXcV4ks8elwAFwJBA0LT2PQADKxou3Ti0ewCaFrZy9tmsahb8Eeoe9ZVzZCJzoPIFr7IE2dfNyNeehEan9pPLWV5r8DN1XBb0wsybVuwgM2kGXybWNTVq8I97trxARIWXV/8dvz0AgPGiBD25t+hM56+Y4bOaER7SgTNcf+W1NyBd3+v1XRcO2cdw1PbKJ0qT+aUhJKNYSViDX/A9QsoT9jo/K4pdfQrjeO+T3BwN+xyj5Pe//28Y9qK1gmCvQPQGB3nAa11dC3V8gs3K1/w2u5r+5Zn7h0x1s3sSQRQ2ZQnNU+53zNsZMF70ehagV6AG5221Oz0YWkoAxxToHGIDGnOJQ+1yxcbGvBvdyEqrysh/EMnNFyBSQFZMEchAvTCSAJ3AHqrnxoGvddh3Kd9LZEpJFc287woNpNT09mtRztTSq7k83dN3aB4sAVyITomBd02TRTpjeDZSdpHIcWsb4/dpeNXKmOwtgYobe1CqV4p1Ql8qvP7EqBtF5rx1xqjV+7pjQemT9L1gOUl2k0WCPRNTZMXI7f46esz1ZsLI4TkyqTz+YqkbO/yn2xgkiakqjyxJlVWCFGbptG6hfoQUuAWoj7d2ub61WIHCZG1urTnYDMRcaSAQZvceSdyg8IM7UrB4ZrHRulXJA35BvPbB2UUR5OEbH5u3srXklyQa5aSQvdliBP0t+WAl68m8Ku4wPh0L3e9pZWXXj4T0Hz/xntmt6wWSTqGYBwfFf7hQ2nMnO6IKeyfDxjpZ+5otN274dCSt3lTeCxnXAMaA8/kS8Fihx2crwo+s937IkfAZhUg81NG1bjKwakPxL6+TV/+sXhV+qA3996TRAh7v6ojqqhZ8T3Mu6G7YcFrERbYG3jONhtVJvR/QLDipbv86sbSI2NRh15sNjeg+rK0TQSdEwqrwUvCeq4BX7oC7JW3WJDH4qcnT5pljSuoA7DkgfnmFBmc53C22HFwikV7kpf0nQvU9U36wX8nzxekdVpaTalYn8ZvLYy829bYbXLGF8kS+7unC68vzeJ3RAXhAg7uS7P0gOTZG8z+5NYiaJ0ssFHoKS2CjYeQCKzURs9npWXTvxHEqUitnBSXDbx9r30hjwpYEjcAhq0L+HljQb5a1baGUAwmEc3XHK72HvLH9s5khmLUbbO1GEXCPahlgLHM5DuhrqTzywxmqTwbVnsNIbgbnsul8X7zNmssctxmEwcP+IDv/+9n/zse+1/6BEUIiqLzoh+rw9Fc3Z/GnRERPYfwJqH6iTeXfedykzlyOwBdWxBQn71RzL6wsgAAAAAAEFOTUawCAAADgAABQAAPwAAXgAAFAAAAkFMUEhvAgAAAZAjAGwaSW7c2IX36D+oY3iQi6jIPulIzeFrrnJhHwwszgisgzYiHMq2EjfX0qQtSxZA008Ic0bKuVTIKXiN9L33cb7pbV3u+pD7+fFAH2DDUH1ARkbxpuf/MysDRZ+0bd5pl/v/gw34UIa3r/ofKZtxJ2dYllpyzsmF89H75tBTb0uc1bHh4zk/ZvWwmA+u0NquT1Q9qqHPLgt1g78JRVCO69yL+OZ8Fqt+lphGS8otnU+jZ+3WmaTbTk08PJ85qiGEoys8dwaGnY+IH5nEcwmB7LVpySNEZelZDjEpVyqHxYaof9xoc7UMJvEMIVqJ+aRroMjPQ1W/3Tw7mO90qcKD+i1F9V1EITtQ3W42IOSw4YBWdYg3UU3PAi0pU7aVw+WOtlVpXT3byPWUmr5VlsGgtEkh6C2lIxpFFwKCgSoeUWW2oo3oiz1Pnav4RrQxWB4dkggINhYoiqyKEJRMoLwSakncboDrYUpUrhJJNhbLj0xK8KBgY+O8JTnxpBAY+EIwGEbi26jOBtahnaoVrmCobFKzLhWQe4ONwcZiCO3gaBsmNudbsU8gg7swQJ1qEWYLtE6fgxCElV2UJktKJjantRjWmU9b74R3+aW6gmfm1WmUDgSHZpE1ebw+VPZ74ktv5UWqt5xXbxnF6UnD64nl6VB1TGc5Rx8Z3zhNH3l2ymm6yNPcOE0XCbnP1wReQhnzNZGXUB00YcNKQAfNSKyElc36qZtBcNT8PbI+viGmQebukvUxss3f8986UdObnn2I5Pdvl0bTC29N2PzlmmH11kyN0/TCWzM8HYym76st0Y0A9LthCZ4j3bWvNgIAVlA4ICAGAAAwHACdASpAAF8APi0Sh0KhoQ2tptoMAWJYwCzs18KP6z5qlmdwDtO6c89UbDbfc6n6Yd5T9ADpe8Aa65u9vxf+0JCxiP7c/s/LTvV4AX4z+nd9SylxPfW3XVqAH5p/Uz3Wf7fybfmP+Y9gX+Xf2DrMeiB+ziLYUr1+WePJRy9od+VwfQNCga7XeefD286YCIpdw4bxvNl+xu/Do472PLLY3aq6cEkUviO7hfzF+X58thGO8NAvoBS2nikCl+WjnfgXxJXAiW2Bd4eHwyLcrB7ckHe3FyWHsNWQ905+MtjQMOFCCDxCBl0NxAAA/vPCZ/7Vo/pvf9N7+gj/+eXfRHVPuah3Tla/XxtFY7KD8Lmc8G2JnXnzWLqqs/aDZkxZqdDzQyWXl3POmQyaQEEp9vwO6WODfSE51wIWLpWd1Lh9lz8i03gx/OhF2dKtpGsagUCwvN9/t/HVeiDN+kcu/6gO/NOogkisrh5hV61PI/2j6CKwkJrCKEnTyHn1SRDMWGz1SMuEAcPVjZt0GXIg++j3IC0JOtZYrRrsWLFf5XP+B7UR6wHOvsedzZ6NZhiHv6T79Z2jQEl4aY23NELv2afomzs/lIrBP1il8uV6BpD/3yPpL0315OhoRX8SNlhWGFA8Ehm87UNqhSb87xFQhvfzq1ZjTyM6U20DDnTmjrQ85NS8CUoTvfQVApOjMf/RdxnBZJR5+Cyt52ze4UEM5+jqqVFbvxerNTxSm8ocXaoLEb2qRs1ZbuMvVDleZn1GRxjXG2O8xB9f+d8Uh6GwA4jufizz3bFs6w4hqW8ndWi3cD/olR/yOWbDpoBl7l8xLMD1KhDXi70w5z52AzRJx018aRVEVcdWAzpxt9AJCjYMaRiqvXp6glm3rQdKX8Nz/3/FAEeT6B0xPnD0mpDFLUSqMLZHirFd3ZJoFE7Rh7urE4SFaVpNqQs0aSU+OBSuaS1JTUvvAqHtTjZGv4lQf8aiiHSMFIVmYDn5aG8/mAnF+ZTVtEP/Ng0plAGO8zFJsM9n6V6Mv78Zi3SkanX4PiHeAljWh5X5V777/u8griEtQ3UiwPweZMV7mVm9jX3oQjQTGk6Lmp5JevDeM/QuMi8zLIN338wkIFRnmtvBvFJUPV6OYO9Z4yQVZ57usm3WiNXGVQed6RDvvnJoNQd1hgqJRMneYMk4bfZM7Lc+RKpsl5MLZtqbRBusbyhM4Hqw2bJKOuzFq05tfwW0PTJtMMSfAHz+yItpn+nWTgyRrMv52D/+PycgruBlhjeoR8mkR/BX0aE4ofH5YjNgswVHPWdNI5YP1a2xWnmjVHdXqbcgImLE86H6JIAZnTNVD3vnT182wvifSOcFHH4QtSkBm7jbPrXGYCxG1sH3DC4bgcqxqBIcHcmApd6KtucaveSiim8NvZJiPCNnuksZ8zTKdLHXfnHkQNSGGTHLN4SFZ3oejrGHNZqsEWJJuoGSRu/7fmuDiZwXUAqAnNMrlnOCHm76b4PjNzv+DCHYINPzH1t74TbQfPPddTy1mfm+Od5j+YeqsR94px9hKmO1y/SlFfBuWSGITAgyuAkxjjnHu///21pxoib+Ab67/EigZR9p5wjoSOHbsL8Z3GpWHzsU51VEyzK3hvBJNRrJCPgIT2O/znSp28//tFSkZ5XSM6HyO24I7CZt/a0CH+FIXHWyP+Pbl7fwuZkK8ogxFYewJO3KIprFdYvTLVzNjMhQPzej6V776OmpPQr74FOIvS4Hdwmwhc/87Jw5sn/sFtERrfT1kYDTKbk8I2j+lSrjT+G0GFJKb5zRhsKEuKT1VIX8101eOpTeZKfXZQlT4cIJnxLCIhDGtZt/LamEtodVq6du4n8EtK5aPAetMweu2/VIHqQ2by2Qg1wXaKkXNQh9XxJ52wC8e29r94nVTd7fVQuXcOGUvh54GK/diA+12HcdU3qxAD4LJXafrP735n6v6Nn/vu5AroQ3E1/81YYo+4mBt/RC3y9Webpjcd26XV7Cd7YOSlkLjfp45mUsNOMx/d1GhaI9rO/vayMX/RiQJ4kBkmlPrGZO6VWnaWqmceGpYl31tz+DgIhvDfq+SdAAfIAAAEFOTUZyCQAADQAABQAARQAAYQAAFAAAAkFMUEiWAgAAAZAjAGzbRlyYuwMHfekarvhJThEHXp3zlcrlentL5UAuXNwBkHAbIwKC2zaSJFX3zKzdR1VPUsfsD8yOFXDLYrV5GFJeljieDqr42Wb5DYrYSJCdIi4TRLsdeHNUMBSCU01Oib0M2xHs2R0rRKtJ2I4whbSvEs8653CtqwVn9fgQc851NkshpHzVdbNuUmd06R1usHpm4xizeJ9VbG42jmNIWXxut+94bL1er9jHMuOLhgFxxqNi+FnH4tu1bkaj1tFQ1cjuX1ejhiK51pmgp5Xg/YdNEqhpYdXINsO2aJWJcKxNxqQ27L+YoHK5xRgSWd33bFfCYGODYa9mFFcn4Nwr6m86TWgjuyYtDVykXBYyZWmjYotWXhqOOiNhDN+i+Y1QkZ3JVilauRaBbWi5pJ8/a8g1FIxclYwF3mjQNhEmLG9Iteu10GMy41sl6yowZFoaqC6BgM40gSHS6oTqWNq6Q6xEVUTalRVRyUgQGKdSTfDI6y9JutrIftGe1RrPpJ4Q1yIstEYjzDupAZFJFhm/iO0DGqnhuWRhGik6EYUGJPlAHaRTAqFho1Cz01CaR2GsZF2wEBrrNuMy/Vz85r3aBkSyGxMYdUqdeGW7UKeC5VqJuFZj/B28PwXTTkkB6SbCaUjJD5tVgT7j6tfTQVI/gMbZ7ZXk80uV1cIHwZZAYfnjiSjVXJMN18K5eW9e0hMFNeyEPOz6vRZwRTW7ePBKIN3NoTFKvCzUNa/AKGFHak8Ta2gqdjwjUXcbBNMJhRV78WB6I+rjI9mrd4WubE0eyBFG56cN/B0QjFGE7OMYtLoSOcFsB/5gMJTt4HSmD9sJbAfZHbck0MTGw9MJQJKiNuEoaHTLcLX2Qyca7WLRt/+fyQBWUDggvAYAAFAfAJ0BKkYAYgA+MRaJQqIhIRX7tgAgAwSygGeQAqkr1Xzcua/E55zt2j5W3vRZ5gHO252v0SbyB6EvS3f32v7Pu/hP4v/gD0B5Hfu1iA5KfFXUC9a/5/zvPeu4PAH9X+KDgh/FB8d9Sz+6eqh/d/9jzMfTvsCfy7+v9bD0J/1aRz69hM80vD/G/QCszT9e+OVxz447FZvec1YGA2EGc1o6FniQ/5aEluyoBKPgqvNMZOih1+8XFdUtO6vSzW5rMQ494iRRdKszpBaat9ZDMgGLBCYNk7sw25nLkB/lOPqsCTihW9yG3Ss0kqqpK8lEyl23EOh1W5s6Zgq3XyM8liGGDuAA/vPCZ/+1XP9Nt/0239AX//PJ/z/6le0oR2mnR/6vJf0e+SBNGrom8/i7HNjnMg6aTCn/tPOteDlhtGUvckUbIILjpMXlBqTqcoegniMV2RChJd7rL3u2I39aH98G9SHqzo09WDXNECyw9+4ZsizCKkjeL3dIXHxl+xVoAVmg6M/IuPUaeMbEV3krFt9lI+xntLHPvx6qGn7s6Qygj7EbNdeph3zKqpUiTG8S589AQEUMrrsvXS0sAH1e9Es00IVjH3eH/iSsRop4xA1ffFUr4HP0bhP/JXjfzIaTouLnAxt2NO8YjOOAwpsJpSARkf3aX6cypRZNJC2iI56c7RzMFLhs5aAv7ONAF/Z5B+yQ6l2giGfckCFF1yhNaXeHxyUXEuEnm7C5oSDR+ur+qYEvNvGC3NDyC1yooBM8XT/+17ONwYKPeeQ45Jq+bMvOAn+pEStAPgB13avva5AaOxzuQEmEEtIom6e9UQ0L/fiZBbhHgcJ6iD8G0y4Ax6xPENrojUshkK7vLDsQXHf5ofp0+r7wnguysVB+eI6lRVtwHk6e4BwgnLGC8JVM7OLMaX41PrA1HIa3hMRRocw8vzNmf408yv7W8rR78Dg2+ZkU/iCymP5XrCv5ENyMGQ8ryh7PiQ9n+63aTRlflRbqBc8Kw/uQkrPLUE+ieH/RmSQpzheBMBDOoYouAvaLy72AZDIbyhmqbE0hhww3Epx6lI+zL6eKuHvbhK8iiqKRbXofScVTEfpqTEi5Pdres3E6lkS+zLsTTRxe184Az3g4Fa4UD01B6X/CbSuMvdUB6j2LZq80+8zW+2cDlN8mblsZzH0TPPfaH3HTKsahDW6Bv/hMToHiAIlaAXA0L4xXZT2p4VDHkYydFJSDlXi1NLnD+2b6OFX7eDtsoeQP6Syg0wGzBveruGJ168ncplIwLCLaSQ0suVy2BP9lsxGyde2IA9uRCU0oMHgQL3pK5ZDPLk97rlAQY4lnpuedL0WYvH6KLSZYQ/45Sk9dA0MLqZ/MEXngcazxNSAigRZ8+A6yH/z5f0yNtiVMrmaYgK6KNjGusGDShODt3RLjbfe/PnI7hQx0B1aAro6ftRBKAuiCCKdowtRz91T1ybXw0fSohrgF7n0LjUpPbFY2RtzKgLOJpVV0+hu8V/hOfSsuP89ykQgQLxlwuJu1FwxP17RTDHIsSP72oVsfCX0BOZTZS2pq/DH7a21IMzpSqNKBOaWaTRzR3U7naVUGMgeqmA2aKkucCpIfkxDm6YGLiFucNtwfjnkDK+YGBadu0aESoXEBUTG/zuxi3bI6RhkOQeqneeA+BAaBVmYinu7HSWmpqmtn6ZtShVCr9mZ/avyeW7Viv8DL7Qt6xvTcG+uDUrqqKKJSfLkJFXcWTGqcEG2zcdJtoIBUhUqToACk0iwT8wwcHT79k0FbjRqHh1UWGZOvztxG/RqjgEGKfFGAfqoVP+19IHUSRt0dzlBwH2o4D/TgRTF+9NuQXEEAlHMm6FbH4hNcb3Hn85uCL/UgUuJnTx4gAyOPsPCNEGlr3fdu8Bg6uHW6iUQKbR0NqNKheCaoNe8T5dR37c6+s4XbBNe//lKabRLJT4MT/h+6swglfSAgWLkBhp/e1YHo94b0uM0Qm4Tv1rwSIzjrTeqMU6wLYi8VbEp7i0IG7vq9GKFP7CMV5moSrJbN1Tl2S9NcfvseZr+J+AYR4uyu8mzsJXAhVOxpA1h3u8FXTRq0Rf2nmc57yFGWzGxVlU10BAABMw7ojdLk71MqNu9OthrGvqPPY/OnffHZ9JgHS84cN2PsF5k0f1By3DFYd9f7w5wLn7DNucUlCW5eiNjC63WJq0v5KoUK1BJse/8GJl9YA1kdv9Haau0hvoqq1AkqWItyAAzdzSILMITlGuP87kD/db9iowi41C9fEhmr1zHHuG14Nf5TirVQ/KCOrEhgmQAAQU5NRvYIAAANAAAFAABJAABkAAAUAAADQUxQSHQCAAABkGJtW2s7v8GAYEo3hfSiMpkgNoJjznxuw6RPpTcEGAwpO38BUlVEOHDbxpF0bYTLztZMtvwA/gpe1m/fX94aNR39oe9etaST6b+1//wKs/Edwc8mIFS7DsX8LZH1ZFRCiLN/TcES4q8JP5910t3WdRLCdwJtzI8xWxk1dzB7uG0xl1LSHZ/KNpXekAUYnbLKGOu37Unnvpob2F8qpXbOa2T2a4/2J2CMhk6/puntSjBTbe575qs+6yNpTh40UsVBY1UYtIaq0977InqnDVn9kmOsYnVjgoLRAFGqOok+1HDtGqLDg141arjWGVNx0JNKcCzEEhMqndeZcSGElyjoViRVmJ1JU5uuPapopRVrwPemI6tiOeCVllZJdtbbQHNEKy1DJUEBaPIRrbQc5QedacbqHhNasznKDsoWWRrWlEmBTB0VJCMAsJSXne0OYPD64i2W42XnqWKd1pYDb1/YSuudRqeCpK9i8BNoTDlBDkYCntpCOhE9MHnyBJ1SoIFKBWIBmVPyVWc8FagTP9aomCxwlSDpIRU3O4EGtAeKyC0fArUZSwV84Vys3MLKVuwwPlUEj9l1shgQqDotJUfPCBLA1Nd6fwqqAcRB6IHM0ZaDFZxzZWaNzfGEUb5qSU7LLpE4/R+85SypE9+aUXcahzDlitklfOqZF3A2VHwTtHkXlTpkvJXcYRbKJaqlIEzCnjayBbPQH9Bjf9eah8L+zT+OtdEwB9Vd1k3GVqQ1HZVajt4CLACcOC25jg/z76HWdTDlT0lciKzXoZi/ZXReB4gLEf5f0dx0/Dr30sF+aPvfUz3/qaF2qfWanIIVXsp5K24BVlA4IGIGAABQHgCdASpKAGUAPjEUiUKiISEZK5yIIAMEsoBo3NCubzkze8Mza3Dnmsc1c63bQc7B6LfOq9IT1Q/QA6Xf/N18N+W8I/Er67zPcPdpP0k8r8TvwoyebzPYzv0cVemYzKv8B6Hmg580/zXsD/zP+pdbP0C/2gOKXtOqkVXclrHQwx5UI1525W467zp00jy/VTFVGuB/eT8jR0EQh/mR+3P/jBQMa8ztC6XUZ90AqqcUbhGCFJ1grV/Lk+EdJi2pxDJ5on6EvdHDoTbf83c6VrnVe0S/uaqcHA6MGwztW/n/od9A+wNZcgj7QiosRwMjNZTXgSrvBfJ7aZjg8AD+8kSv+u2f/nbP/ztn4/X/mS3+Wn8femlyW5p7mIX2XyU3Twj+sSSfe90r1R9qlDF9A03rlyCmj+G6p7HgiGT1f6HMVKGR4EaIr41RuOni+xvhjIFr7cITAxmARsoA+qWX8vDaxKGB/+WIlezWMby7SlfnU9XtF8ha5NZxZISAALldYXKcQ8Rdh7E4JSS/mh3DlzqUwhtsp0avurMiC9aMdWUYT/9zIxeYwglO1aqA16PXSapRhhZOmkEk7P4Z2ZYuzbnmBIqUXEt0g0mlNPLkLfyYmFhYq/c+G5ikE+aEz93PU1MeU1bUfsLO/A7sGZBi64wqMRJT4o/2mSje9f59zvEfL60maHdLUz8YWWZ6uAwxT951hF4a/xKZJ5Zp8eYekRXB0rhqx5/MmAVNYJoqe0fHpAG7vHKBGiTCr8o3AaVK130l1H42K5JSmMfWdM/4g9VIl+CU+0a+3OLfknJV3fE5W6FaBM+x7qmzpTjhgf+jYQrlH1Ytdiq/XsbOV62X5jRKqyS6uax/Z82iu9xwH9AgCQSEAQF76PwrG3kkd/u7FnJTygKWJSTmVM4s1tOg2aVkzYlTRXCUVbDBlYn+TCx3tFpGk51GrrLCDNDC1pf/Jez+5PcKVPrs+s14iJ1tGm447GROodEgRkTnTJUOL/7ts1LLBmFSmAiqRq5goh3keKTWVHqKWPxuo40JFULrK3xd2dBkBe0e0ycaOkaO7tmR6BT5/EbK2fOb/cK2P2MmNSH5ViGLVz21xlxQEnSHrFbrVbtnJ2jQnlKvq7ikU9Uw6/hwVF3rC8vaOlcF4zmnJPwrpi76R+FlJ+7i2l1Z/vED+nB7cyH0kcusSCT9i+rDJ/M8CMxmeDlSMkOeWfbtztWmuN8hDc2p0w3+wHRW8SPgxytV+Rl4F2/U5uVQfUVWnK/xLJjATWkk67q1edKCTUh0evcLeAnVnITCsQ9KCs3+Z8MlJlYzd6e1uLTVJGjCwf2AvPj99c1Io2TRbkCAQaGVwvwTQ9Ya3cMXgn5MWGnuvRtIAcVCUlBe2Pn+QYDxJmZJYjOb0edlIPkbbe/1ZWTktocf3ycUJHE3HrYch/NMFp5tD/6jB1Sfi/qh4JLXthMjooHAcjGi20iI/72z+5vsIjHMrleuWdN2qAvJhWOiElucxogAbQpfY0jstAh18zdUmOlGBVPokb+y0Mk5HEqNGwccqTG+zwTpm0xH/dYsqypByBD5LhQiawbtDlko1u69KzmAFBlNYkkQsMOlM1YEY5EgM9LdNGEWdahDruLhbQELtgd0N4g7js3J7KIMa9jjPLOXMxvapTK5vo6OdiOn6AGsZOJGf9R7TlQnVVvXXBVD+NAzJflv/j5O8h+xbzp1G2fah9iZvacEl3Ox7p/HN7eufBUtO384/0M+/pZ5gBzfGRFLskCgxqwfAZtVG3jZuV6t0Xr8aqe4fh1wL2xUl7Mg2sUh+fmwdpHBxgEvzy5aeKKxf1Sca0fX90QKjRTy9/QjRnTrSQ7PMpMXsxIB9NzrO0B8yA8rX+AFWfoZXlbEF/uuQob9NOHBIc+nnW4F8hN9tn3I+0ylJh60yLujyqalXgbpJr460oqi219ZEj/5uT/QPpdv/XrEcpoxqeKAmLQ4j9nCrAWFW7xL/v3DRl7d8+tmXgAAL1wzRVZ2KGB9TelyowJq/Vz8xgkXwbq+2HFJGhsk4u0C5RrOWd/+/9QsXIR18HURj+SkZoaFYvoK+KEHjt1FwULmlCAErLGOkyIxgBe9oQSwqsx0hxanWWegjmef/1EFf/Bu/ju7pX85+ctgPzoSmblhwhG2yTZSPP92+dO7jQfAvCON8wAAAEFOTUZiCQAADAAABwAATQAAYgAAFAAAAkFMUEieAgAAAZAjAFAiONvQQDHVxV6jRLa6Nh9RIhTn/4kRq/IfiiFChNjODDDRKiIguG0jSVJh7mpht44kXU9YhjXrHNwEZxYdzWfE8qVgeuhVENu2ZasLdBrY04XNuj44JNhbdBH/2ggagLKlgAaCsi0Y/8hkqwI2PBj3Q2ftfPYdhIcPE+a47uXsp4fVimX7F7TWkhmOcQ5iadJWYKRvM5goeTc6WljO10OGIY/HbVwLIzyP2igGdV7rSGq/2JfWFL3Y1MZSYIphmji24WTbw/UynuqnGypiSmTnyYbknTOQqZe5hgJ8rJ1heFOpJMJm4wwDDKVyU7SL7OIxiRL3GxKsGfMJNRA7yA+or5S411D8j/LfOiTYreQIsC/VdxrKdb7uySeS4Bd6xJF5CAZxL0oCAi3uMkTJvxajqC7Yo8Q9hsdWlHETPdWSzsAYuIcI9kpeHMQpI4Mof5dzSC5q8kXUea20QXZ7gueKDEt2pgyCB+/CfemyiQIxZHLjrouQRIBOXjpLtssjw9HlEgYJ84i1Cyc37nHbTS42iX7I9+VJZuKUVCxY+mLqjUIFNfY2getsM2mXP5GrjS09gRVH+WPZ60rc8iABWfgwEEs/shny8XsTBNq7RZ635Z2/3OyrsaWgW6QvOdquI4SOCkX2F9YUoKsSlRaPFZOXJOwvec93FXwQkuzxOnrZmZO92dcfYh5dDne986m0Dtvw4xveXTHF11RxPeHmnM7A6ccE0RlzIiUFMHz+nXUMUXMEYqrDPEz6ub+3TJqYd2H4gD+PLJPkJl54/qd9oYGuUKECWakBys5egzKiCoIyoGg5LRWU3VYHulQmKVvo8Q+60H3VhUOtJPPnW+haqf6/20JHpyr51kdGBTYkrG17B6HiEudDdzZaAFZQOCCkBgAAEB8AnQEqTgBjAD4xFIlCoiEhGKm1gCADBLGAZ+ygro8fvsvmvXbtDB5u4LPp6Mttnztnoy6JT1bd6Q/xNfW/fPCXx7+5ZJXdZqR/HvvlE78JdQJ13yA9AKyy1UPAfLAeNxIj6pv919QHuS+mvYJ/mf9r623oW/sAYR6EPypdsx8e0a5ZhC8plmpLT86kRufTP+lzbtx8HbEuVh4JL/fQt+BIL9PX5ue/DqxsoIkqzA/codIuMpmSQYD/omcav9cBsu75BqCIPSLGewMzPtYIOeng5G7XirR+aMA504oB8J3Hz9ArI/guF+ar6cXyMAJl64kWvn/V+JQtJd9GFHq8ZQAA/vJEr/Xcf87j/ncfy9//Mm/Lvnx2mnUIoz9dFZx2vJ53Ey/PiOFYWi+m1qNf5In9LzdEiNkUG0oYiADdze4Sf7SeMSSRYbhICaTkfwWTeG3VfwvUrkYFdEwEL5jBfLKQQ7XKIky9lW6VW/zTUvkkEnPLN3zPpWXUmesArbGetQ0sIWZSdmgE0Bwyoj7h46e1RV7TDjW4PXQOq6B4RqXnVF8p8yEgP3y0msfwg8qoHgkQuvs0K5Z95zsIO62zY99OwCizTn3NAiwhuIlTS8u7CAJrjpDVOuj7VcexwFfjg7TmpHTecwrgc5WrRn1j+qCSGqrMLXN0XwMjueo321AhtX9IhSybJLsqtyOqq5iBiNyJye3wEgS3ox5rNGWLLwNi+dUuwiBS+M8CPLXuJAGULnXGWRKeWa+mFbGyAK+kDeAGmScgj+PnztJTYUEVHDIndwRfTlo2hk9TSVmuHSvgLguV2kAv7XQw+oCIBKg9cPuJ3UUpX4PaerP0Cp1w20EAO7hLv7EwrQbJvZ6lJ2fbtCNKamFjdFdgPM0WCoaMbFPSb7LjOIXB0mXYxKNS6r47GtNOfVPbk3yBwNkbzfV3NdCmYs+6yTbSm3x7REf/5kFE06AwfAQsWGIHJKVQ3SWaGnt0hgnMIPHkC6JSQNV4ReiQipx9h5n/6H1V2T7G3fz6i/i7PYICGN6OKBT4j4Os/8oEvzDtCenwWGvXT9SYfO3JIUXEMgfp69AegrzB6ACP06mceFCK7XHU7saD4Hd6FxE4vSLE/O+QmSO798rH8YjM5gwJV8HlPogPRrDO+IhxyURhHLKfvJ1wpBCOGKyJSfILgs2aTkVrwi0fIC2sGff5fjr3If7abz0D/Nh2hvJfmLG9SBbvjTRgKJJ/3xyZHOtJn16BAngPc3FDiRjPGTrH9KHYW9s6KpzNE9Oy18iQXrh6ZSUVHLROH7JG6oBViTc6Dq88nvtiMYZUCYfH3prcjtRI61L5K0rR7IeuRBMZYnvYnZQ/iDl2uu/XKOq3PdmcrfITlbvtjsAtaarj7I99G+vZnwA6egh/tqk3FXeD0PaEgmRAViNOY5d/j6gWRtKb+zSl+5akc84gPyojT87TtMta3Oenu8zcb3dGekkwWxqO7ONN6lYHMaUMGvNyE7pYk7j68oLaEkz9J3AvW+9lvSWXmmjv8r2m7pie1dEbJ4Oz+eZI1Q6k2i3VZVk+8W07f9GiILBU6eXr2CQJr3eGBP2i4JZoz7bxp4CP14EwVvgvxRqBK5e+ma5Qh6lktchMvuxuqr/a2q7lHyxZxMKZ0AWZ+SUgnZzRA+8Ft9XTxG+za1RxJYunT/EdYlH/KUiJuu7Fjyo0tu25hyPu43kRH34O1s7eILmbGJxsaZH0ZkuHpWxwAsxSxbdoC3MZHXdmAU+nYxQ/swvLSnUMazeuKmgNnpQSyxe0qej/Mq5FEKG+Ex52OQ4X/JbuNwW5OhiGnEaVRv6qC9Qd3DS0rVYbulYmx+Kzw5GPy5uyVc78njWoXqVGPYaXmgeFNL/9p/v4w+ox8YABxLGERx7bOF74MqLWS7/QiiqnYBpZfEv//R6ZND5CJbAOylQT8Z+EPFlhsbvILkzBwYcizvde3QXu87odGPttf+4kfCD+f6hc9RvYuf3fTibOtEE69pjO+F/yhuxaOJ50eSk+q5xljgypTEx5ozkVQJmDJQUTdcgCbfJgwXWCWpgMqNiW9gJ/5+Mb+PZ5Eys/jqGxLhmdcMrPqXVZYcPl1NzPqIuSlT8z62Vaaypvr5F51rGLAn8Y7YHMj+Gn/v7lQvqmufjpa5oNtVTfyngpZsFxvL2SvPQJyxyWpVAB9/VZl9a4Pywou44gpgLxt5l850mtgYVLdQvoNYMMFbhcvy3WRuq3Kjhl3C3FyEJzEO+dWIgeqEAAAABBTk1GQgkAAAwAAAcAAE8AAGQAABQAAANBTFBIdwIAAAGQIwBQajk0bBIoiLtcRWftQLGVR8GPncaN2IGUAhoib3WYecxaFxEO3EZSpBq16qCHoeEJau8WY7eKlgMIKW+VOICQH0wad5X6SAZs3o3RHw0AFakGMuARzvaogWSkISgZCNKukUnir7m2ZkvP3ZSAmXUrwxBzCkMsGQSg5jJiJepOBnC5jtRSYer2YBhCyrkpPcgQ2utM7nu7vc5k3o0TlgpSZMqLr9+O0yI5NpbrxBg9F0tlHEURbIskMnHsgOQEtF5yDAWj3q3X2YqzWnmU+rTeNoUuYdSj9fq8Nk1rgyaQ2lyifC6jT8U05BK+0csQc07YYiQMXikKcVsvS0ppa808gjBfUVCI26EnzNx79CWbhDwu7wwL2aopaKm0hICVgHpOROIJAeVyQj0nPrlEFR1JbQWlqERtIRqavc+NtqhE7RAUDelyQXaw5aFRyLcOPBFhBRmZa0YcbVoqDWmB3ha6tU0yiSEKKhFMMokivGMfteIQ1eclHnt0cBxqjOOd4eBG2Y1voLikIy7kQ4ifFWDTozqWnN9SxCSqXeYTrDhSykTDrJLtPIP+32O5T3SjuKLoVLxh4CzdKBanqFQjcPzi0K6BR3o0KhE05xeG45+Jk4fv3ukOv4zRgyUPl7z5Q2K5JnW5R4DIdVm7BrA1f9uuXFLAjn/ol5CpKYCdW0pxxRncOpg+EWKJHnYO2OjW4mc7PfSLsEI4caFrEkkzswxeSctyBRmYQLHnbchWWlqluF7g2FchWBFX0RUs8SGlojRFHY8witlKU6ywbylKfnoPIsWjsi1kxKTiFKPe5xTrWy0Ej3YHS1oJgQbvI/JJzF/8TwoAVlA4IKoGAADQHgCdASpQAGUAPjEUiUKiISEYPAWkIAMEsoBogri/buv2nd4/zQLV15GhvOj569AHos8wDnk87x/pPWJvNPoUdLZ/oK/I/EeD/ic9fSYyRP9N5h96fAC9gbx9lDvl9X2KH8RCgB/Kv3G9lj+x8kP0/7A/6zb57+2Bos5rXUKjwPS9YnBYL54lgq7pLf5nUQQY16/0xGCnx0D40aw+QG2PwKUHQ3+usdhCk+M2SBeZu/vZix1z5vc/7bfMhACcCf9JB2z1cvvFA0Bomok4xlFEyj1b+iPRy38ltV5V/4dksloWDfssX9myHvK2p08ZNS7dhJNrL5RtZ1z0oz6oeAAA/vJEr13b/O7f53b8Dv5lB3U9Yevh5Sn9YVx/se3TCIovj3mmTV5PmBgV/hMVBDr8gUzj2uFonOBYbA4y1a8UYOsbp4tDfWK64bRu+9mwHzAl5ZzESj21uBljK/yEezmd776dJccdFuwIUVaOClUIuB6/HGwie1HWqsjYte3Y1sA1ABDiCVgIee7JMyoZQIa0Se2P6lYbb+MQZXEgedRHl1IbiTjJOfpqD925kAQqwyx3FFJoMdv/R02T/Kh3rX/PCAcrXwe2v6JEO1dmDfhv+J+mLBlkaIKKhuZ8HWPpTzm8+Pz+rj4S5ti57UQqWmyMfB1WzKx4F3i2Iv1quYgtYMlI0BLZXbCi3dYgdOezk9MmpO760onPkSfjP4hnbQAsijRMMJSJcl8LUFCe2OY7Hqa8M/GUYDBRjrq1ChlO7RwK3V+X0PZUR9hak91FXW0+50q1asTyraB0LCLuY82m0eXTEBQrujzfQw9AgvY5Xpn7Q1k/98qtFG/3XCykPPImhM0Jsybr5+m50+IvEPkUfulb5y4FEq+df7Vvv7IEqKVNf9K8VGkQ3VDrhrF7+Tb7U4XI/NPbdchPn4DByrZ/mYAUNnbjTO7f6yt/qaI+l8/fFHcPjNMvl4tVH6TcBcD9pMbbNhhDY75Rc9rpZiPjVActrHxuaaQ5eMEySHvDxuARVBZE0G9IWqkI4oz1xc8Tf0+RnOehTp0BK2NjJw7ALQ/AkX/p4TEOo+WtS3mb/mBz234Fty6/mAKS8jxcdW7Pld302h28dVBi+KgsKuIv4cxrgIBNgR8S1qcdEOoNjB9Hop5OqKa2CCR5AQQWIgxGeHsfTe4Bvl54pvlvETzB7JSsXe8mX7q5HGH9TlkL8W05KHJ1cvmIVT6p5QDYBe2WZHx9kg6Cc1fTx/WPn/frAHEGDtef15RECRqvUEHKA5ta1BxAJ7erKC4n/rgHwNuJ53hlOmFeXp/SzB0eIXsl2HIxutqk2xrRk24xjaFTJUkVk/2gee8QtgBo+UmFiOXCbz7yt+lekW8R2OVUv5JLuVuQeo63ibHlXVeLAI/EL84jtpX4skzFv83S3MO7/+JGpVbuPB/6mt0WYfbVstPsj3I77Ag/RRuOylBSYLglvn3egoQnfW7Zakpp5VgsJjAS+rj6+gib30IB9uYj3WFaituVlEraJjBTlqAL/dkSzpyJfCafQcrVYySlIJC9UFguqVLj/0N6dDTQIQYYk/N7MneiALXI+JYDpcZ/2IkBcyXVOk4ffqN5+9+R4BCdfPM8uvkLDyYxulKYmFLtdScqtNBR/mom13Efw3ccR9e0HR8v3aQ92rWdVLTFOdBui4vP94a6L8SQ34WY9ZldPmiW3+G41uZdVMnr36QkMTu0dr7sPtXsuXnzFVN2eLh9a68hxCpaZaoH4Aa/QFUKjGoaXZCWr57pbWmd2x+9bdlL9x/oaSF7w5WeOa4DgP9jd+rfC4w+Yfc28t3Pjm4JsktmNQdOCNgj4MnG0b0K6Mi7meX+fq8P4D03qZqh6LtR2G+pIJbyJ54xkcaQuIw/b93HWLsvRQLRjCbO+Azw1hrhjOV1pw9m/9Iy/9MrNfeBz1b4S3jEA2tBH4pqEHgzgIGWhESvxyvfrlQ6oNwbMv5jq1nRT4ZGXol5wb5b+H7GeSAJV0D713gEut3twv0u6cHpCzMmnS94j4L41YVltTjvKrEBE1eCkeq0IKm7jHWa4nlkBOYpytHxUc8gk7m4OoHa7kJ0g339QdgkQ2nnrccg7h/uLSn/Wael0Rl/5erwgRD9NdJv7M08GS43nEpQlHeuMr7i2zCiBB5hJSApD8yza9Q7uSP5LLlWOSVD0e9//6/c2fjuEyYbS4q0Dpc0rKZZZxD3jXRZRadEj94MYaytn3nie0+erU/h/G+eruOZz8rWAk5qqpX8wAAAAEFOTUY2CQAADAAACAAAUAAAYgAAFAAAAkFMUEh7AgAAAZAjAFBqOTTsJlCwsfsocbmNUjwKfuw0bsQOpFNAhAirwwATrSLCYQK2YSMjxGZI0tZ2nJwgRpnU2jhnlGBj8nFKudYMwSkm0KnuNccPnglMZgeHsFgm8AiS/icBKHYIXEpIZJdPOv1FQM5EoyZJvW1ryoZ7kgMuu2WJadveQKnFcvhRKm5xhiit7bIqlWiDRe6MtwRIqflPS9Qo341liZ3jDQ/fc6WOMzBDcDbXkeaHkZXYHbISFetoZNvLJ3W8RTmPU7JKPh66flSmB35JELxboTJ7wnJO7yS6ATTxJwd+0oTX6GcEfrlb2p9KRjSrBgT+m+ZTxY1EeA0Wlf4Jn2gbU/RvsJXagoIk3VQ7hVgKj8Gj3T1JHsu+wH+yJ1qIyEZg0jHDudJiG8V6tO+jSWzI2UykCNjqAw3yMSpDqADBESC+AgM0MUCl0AlDokamRxMXHx3PXhzU8KcKGBKzFUR47MjlBFmqJ/Es+eDmHTpWr1z5iZN+cPP4WL1iMsqONTqPnhZ6RUaUdOSNgJ4WCNJKfIexA+kI9EA1E98AnSKQqnD2e7aFnsT3X1NKgBFPUJo5wmmnKeqo1pq2Gx3Ow1oUW8Z0GzZAJaND8tmeTuNcx87mBF2ATGVcAEJngKYoUUp0htiB2wCd2/hbJUjyNlhJ7MFjZwOeIThDfZvkcaCvJVhNuSMLnd3d3IuhDIHQ8fpJV1d7v5DaqdAlRb9Ce58513/RI19IOaul0GnyxYmUPRUiG8Hu5sRxgUUcgQt0mn5Z9JfqUMDPEfg5HK8LrVabFCU7R9LsHMX+X3E0dsi/xOL+z+z47dWlAlawKu4lWiXYmPXbZrurpgAAVlA4IJoGAABQHwCdASpRAGMAPjEWiUKiISEW3AVUIAMEsoBo+DlDs+W85W29zWPx27T2vMA51vOxejPeg/Qz6YD/CV/T+E8LfFH73zcMk/SNqL/JPvZi7ZNcAL1jvoYAPrJxR/XnlcPElMMf9H6l/rd7ofpz2BP1h6yP7gewb+w5ggDuHd0B8aDJKzRrcT1VaDY2pKKKCw/ZJw7IJAKAbd9t1fJj7W4X+dH/tK0fvNtbn7+UKW6jxqmvo8X5AIR3hmqeUNunfHI7HGY+PMqMsCfQquukhEVSx9iuo6d5BHY0WYi/PcyafB+3eKoS0uHn4av4htVZmIrfiUkLx3EG0eCOVgM7JGqtIX7AAP7xcg//rEf+sR/6xH9cr//kgerbj7v4MsMYgyU3nkkyP53QT2h6ZGADS07QVSEKT/534XVL/jfJysMvebmSOsk/sX/B84SL0wmXmgD32xL4zFdabkeBtPHU4pdjn1ox/w6hxTVSmD3lei+wrQCp/oUTYFFexhpVgkyKSulBT1oYgYuBsAZfu795+/D383HfZpStv/2O71A7v0ResUsHRYbCeX9yzUy5dxpzbThUdpBl++eGExyq/tONiodbnuqQ/8L6t1d1B0RfrKH/VawGF2k11eNv6g0LWPyJNHUO1qX7qNQBzYUNaIgeqCToa6rk6ZkwMdsvEIv8jAKG10sv/y9ZZAX0wTu0ukhmcJBhMGtipkGMQp9R42CGs5YHbQO3r1nFrOXemmtjUgehFyrq09FBs2TjLVl5T0CEbbIaN0GThpLQKwbRx7vBsCN0UGwtm8GoSjh9te/sNCTqIK7xrbG8RLskdGOZY8F2l0QbOYpJeeitq5BwkV7FH4V3/WVuf9n9q3Bi2retIQUGgtDk7o0gHToWhS3WnQad1dVAtB3JBolAS0Ntn7bUM9N604wqnieiVYRTF7TPtYjqUW8QaN3M6uuGmXN3JjnpXtrWpVomfEXrH/0329kSXUMH05drXyIb/EcLOmws5mN9WZtqOsXcGLe+69+W8QqLzmYP9Mj4Lia1vXWLYyK3oxivieay3FnUxe1lUZF04OrdpJgkWm8XX6dcMlu0N57D6JwF32iXO0vkd4Vcwhakfcr9Zep98JXTLB9mfb1sFEwJhm1VFaidgMIX+zHRKQ3OKit0DVtvqNvf2dCRHxbmxgWAkuNx6Jm99cC4ppA4ml93HvDo/OYDe3ItnAD5+xyDnGUk7LVensyVRAq4b9c/rW0pdYmBwN7JZm5lcc/sj3AAzJV+uJjdNLs4ElAlKZbWtvjXXQvgN6KeyZ/ifwbH2iRtqOh5p4K25YSRupMwY13++mIXkYO8XqhdSzfxSudTWEGkkVE4CfyjcwvuUq8e57fknBu5FkoeX0QqB3O+IT72Ih+ekQYpn/7663hb9L5LGImmT/+jotfvu+FO695wD+1e3ni3gtGqHRYedZ6Est4CSIFy9u3YaxEedclSa0L29SzkrU4oRvMJ6ZQwgSPDrpRovwE7vYKPeCLkuRyHHn/4MOQgJIFFDzOtqyJwKUTlyJ/ZL2SmGrfNbT8BKWfpZbIAQmya0QbfDv2sB3f/vjJUd/GnWhFpO542d5eWmhNlES45qkbi5pMx8lVMWtQ8wb0yFpqYm93iJHBi4bRi5KFxHElBQx6ARWGqOhK8b3WFsOwXYm8VKGaC4hN5Fbd7iewYh/j9QxjjW9rapHz5wMbO6k7YmoBz5sG9h5XczQ8pgdEJhEDd1qW6Ea0M1Sz79MXqSQuViE0e5CAwbT+XkFYLMIeZolxLW3TcP47vxZpVWVzDdP/mL434AOswH+++pvaQCDRhT7gO5euWVn7+X2gq0W4J6WEP6abeEBo99bgKTQQF7oxuGbtgPzdG4P8W3dTRkkGtihc1D3T/uFprJlzVQeZ0yBxMM8VTMLc5fQKal0rSfGMEn2Gg//ioItUSQtWJx4k2vUrILrVKdJQf6vqbdf9zKE+/fSd64dvFVzpWa4FxB5FHTTY8gnfXfqlhhD8I61JU0RuvvA/S9gD+1A5goBhfeR9bhkghVh5xSZB+FojL2cWMkoyazxkedPO1W5QeFGPUJxekTp5X4UJNOF2PTnnm6hGB27GodBhxSn34qHHnSU9Gj8dyOUkkDG8DRHAJJrHUU6BKo9RA70wQuoCVk5+N0axr9N7/v0DLmA7ig8kyj4AATdvy+qEe/BzwvC5aTXLVW8d6ZfdNnpN0l9pYnvxw0HC5TMjAgbMeVS5JPxRnSFA6lh4AAAAAQU5NRnwJAAAMAAAIAABRAABjAAAUAAADQUxQSHcCAAABkCMAUGMrfJWGKTDWnmYM70hSLAXPdJr4E+ZwmzgFNDQY9sMMi7GKCAaOJEWZzQR1g4MHy7JPUAPNAGg1kek7S6CU4oJmGkCqayuEswBLPWt+FvjagJsP2c6HBP8uiHqWyR/nm1iQ/kLh5kE/QBmjtHU4B64B4LIEohBzJbsdbG5F0ZRK3fxragBf2ZZx/P2sW5aYUulji2BgAFf3y1VsZVhzm/qvQ9KYQcxVbqO7WKojMUbBHNXB5udjzbgdN1PQh5WBrRV2pY2BCjMIlkQhNrtszrL3CEaZ2FTY+jgBJ/XcZEblh6X/T+nYVBghmLsIkJovgtFELefR1cNS2uHT29wEoykop1EaEWDfgmMtmpglCvqwR0ae5Twvu/YShV3hUTWH73lZoSW+wu3MpI6t4YdmnsltRGSt5ukaNX8nZpNRQiYS90PteAqWetGGh3ixC57CjieYUXXAmgZOsA0ky+Jtdg7jHX9rphmxz3HZHZNv36vb5G6DRUDlW5O7D67CoV69rSb5SBAkschSN6y4FiW4RqIQ7Lurp818qtB4bdfzWbxGxWl6Cvow/TBi0TQnojAv2DUVzDqbBDDMtF+QvAgUDkVJg3X7Mi4dwtKNHaxe1gtWO6f4TTk0bJ8LxFiOpfUMzLVQQJZXC3ztb86yJSJzPPpRlicxEbmJGv9PCFKfxw0qbE6CDzdAb7oHK4keZM53GwDu9MwUPII5WC1SuQze4PB+P++sOTuGw+Csn2wDvg5g0xVblKH5CkIqtBzTwM1WyfjXceg4U/GYk7Or+arwQc1XCiPzP9vxF7kk/T9yfDSzOcjPE5oVUkrp59FMZgBgRC8FAFZQOCDkBgAA8B8AnQEqUgBkAD4xFolCoiEhFzqNOCADBLKAaRZMP8Pk/yl9mi0d3kNh2yTpvMG52/mM81D0d7yp6IHS4f3uvufzHhD48PcWZ7l36NNRHsr/a+XPerL8spd8FqZd+eWQ8LygJ5Lf9h5G/zX/T+wN+sHQgexR+wBhS4iK04nIBtiiyO3+6bXlsaQ3RXA06u6+Fsa37xOVWVrPGzv5yiOP/he/0wRF+HCTiAJ37G+ObE83nf2PcFuL+Gr5LAlarnhsoOUpmLof/wxE1ehXTEMYhfGazjFilhdF6SZAeP/eVyt0M4r+ZaygQLqnnmeF6ZIFfBgCOYC+u5RA8Hpcglyvmx1wLIn8NF8AAP7xcg//rCfzCfzCf4k3//I6nKo3ZgeWRcntIPahgCmpo6bQc3RBm+iM5FINyHxJG7/Sx6nWNBC9Rfo5VxlptVXsWI5uQFLUKPmI9oDXr3CirUlHWqhicjXVZ+2txKzEmAsgvSc0iTkeZJg2i9fWaE+Tnp0VmNpW9LucgzffctIAMn3d9YfVvj83Gyucvx3/Y9csxLliyO/duWznQvs5+dvjeDq5wMB4H78P+g/EkMnt1MbxxJ8T3wT3XA6QPfWsTEM9FM1Ll8EuJjS0onl9/xXW7g6OpUG0pt5jF1IoFq7+RHzFjRbyJeqgzTQ1yUM05Gxs7m0/KMlG3ypNseyY6xJZXFuvVG9I0YAM1gcMmPV9WJXOUn0AjqNSBKmX3/EfkyE1/2hy4AGRcN1ONAbFfnXjVkX1WPPeR/0gFLCUe5aSGcHC8MNgxvjkXq3f/hH2FXZTRXWT8of86q3vhQjXxROIMVBrwgvTpV+TDrZlMZoGnwJCBWVmpWFmjoD73XCJpMSNzqq/ppEL5d18G5ZxPtqH/kGP3WL6DWohsyyq99fVZCSDJQJPiB0unv89eI7XXlaAz37cxS8RsQqOkaynGKHhN+L4dFbXDLiA2flVHwxiKQ9p3gSvmsQyprlPNXTeW7qhcZVug99L19eoVmGoz3kr7yS7fJoBi5MX+ajHQqDIagef3hLo2RtxLVZhh7UmiCbNdIjssmya7syFOWtBHZlFONDG4MvLsi+flIbalRXZ38s1tyNU2k6GeYQlZaEUw25okyY7pmJdq9DABvZ/7HFXK4wvXAb8OSi037W9l44Rgy1s3n40BYG0zFN9cBhUW+KTkeIkaS5odpcIDb6Kd4AIYiKvCobai9UR6aJT3gjNhKqqqlSrnyFndhx2k2YJnUoIdh7yAajif8WP8wgYwFMaS+aUpAUacQ+lyn4jdTaEbxOcFkZLCWuyzZAAGcCqMy6FfnJyNF9sYGnN0qyLPucIiAOkiRnKnueZ/BVzLdkgCsaKVQMf6T6XB/kYLJ0yfwYJ149fNbj7ncVs8tKhn+0Pb9bNsTVm//EgfzrFWP+bj/+0j3rCiUdZTVeOWQ05luD1P1hIoM3mNGmlI+PqcO3UM3HVi4K3gIxszGN9kezO16w7dVtWr1uGqKJqBPHBdSd6nX6TLTfSLd3I/jy6OJtVRfYQ0oc4j1EvX7jhAqu02h8yyFmYudXHxqLhPpbxrw5EiaH/XganO66euYprf2ORfqItfa5zjiQmE8B2mD1A52V+jprVZVWlwe/s5KOjH3ZeU+EFFN42UuP0tapuIBkrkawjigoK2USESecbT/UrRAx0rq77Xu4jiTbUUTMSut5oIPks8r72fbSj5RwnoUxQs/NwhGPyGJNNk8kbaUkjPzKU/mTnwLuS2Rcxqja6EGwCOlgHlEJA6O0Yj2w9WMv6R1czQ89z2Ja1GIxosgWgnKKom/rqlfSWuM6h87z/SbfTbh7JN1pyqubGwo72NQqbz+Ijm/TJapnuT01wiYOp8xaSp3c+9RCaOituyUnhZRkX5gu65MnXS6b7Xn6fy4zrYRkZacQjt4mXqSAqOs04K5RtO5XGi6HlJoEhSH0azaUgKlSIXD0yBAoyyF0M5fZXPzHU5K+2csyzfoMZnWZQgxRbjkrnOoloNcfyenCGgW7ktx44c0bFl7RyS68c6Rr6NPrcvGRzVuOSg8lCu0zlYQvo6gXsR+MFT1+xERAIwdNAPAXGD0mDBIx5eTaXUqW/7KFfxsm6i93t8a9g/EHp0Mf0FzhmKKZLTjT45YhU5u2Da12sj4nn4LtgOxFekMnGO7DT9NDXirc/t2LzIMRzufD6tKXjExWb7DgKd2e5K/LKGKDEPyRRdvmGHacET63dF4yXFIzoEfel61ScDu3O3JNZjWxQA4RJ6f9+UushPutFr9xySMtDULnIke+Ro19mIslq94CGQDuGo1mYJcu7S7fjadTRpscrzbSYbsH/AFsSl+h8k68AAAAAQU5NRvYIAAAMAAAIAABRAABjAAAUAAADQUxQSG0CAAABkCMATGs3LCww4LQ5V6mkHSkMjwGn3ceN9HIgBmlh+dVC4ik9Q0Q4dNu2jhz4soPRZtdn2vsDM8+s994ZRWZfLBUAWklBDTxsrlmLWhDwOjZZC9KGQNKCTACDPoD/c0G1WiZ/1TexPPyGIunBcIGy3hkbUtSBOz6kZanQSsVNCyq+IOBms3pvOu+f9w3XMM6vLy5LaQAMrrEYuJAG9QnQp7lnDTfTrLpJnPA0vUicyzkR3GHJ1OXc+WY2MK5HUYT5XDtC3qxi1WkIiFBzJYuszn6agrf0WGxhpWdGqhC73IUma9+3fTymbCUjzKgdhygeyIZguGrlPL+dAaF9p9ozIAmG61FOZ8y94F2mkFibZkRJBHs2ImNa5MzLrrMkwvM+4hg9Zl5WGBo/wjNk0lbq9QuZZ3KdiKy9F+40cjhNcHFIJui6uO7MMpf26gwP9YQNR0cgA9KTjokccJhxMacXi8/Yh8ac+EczS7rnxwdDLofvlOm6xm5YJHYOpdNANCnzcWuR5AN8Ga5FsgiJIgOsaVCOtjBhhIB8mkI0210kW5DjRhHsGQBAY9E13jKNcYKznn2Z4oGbvMhcFiaap12QDvGXzHMn0Iok0UyC4yWe8WjZmvQ+I/ZNbzlYw8C9pcq39sb8/Wc1cksleRLTCje7slZwoSTUUnBrnuB7H+HTLI09kxFqjs+RkeevhNhaScFbRvpVzHrmqDaNORckh5YWK/qu1QydFOm7nyxq4JpmoUeFQlYoVKtPAP8TE2LXJ3jQJ9iqUMj/awhF4/+UTp+AQZ+wSb97QiI+7mlLklrW4q+frGtS9HTtZD1neTIAVlA4IGgGAADQHACdASpSAGQAPjEWikKiISEW3AUAIAMEsoBogvevLy0/UebHZu7XHF7Z56u3f52DTh96Hrx/7R4T+KP2DmpZA+nbUd7R/3HEHLC4UcEz4j3mfSs/23kk+oPYL/VrrO/sz7CP6uGB7/RHfFpVTND2PflkG+59ZQHmx7cEqQD/LvG/xEkessdMMXT7+dH/tNbvKz+T3Fz8FOBh7r0rNTE6RbidmmRemaQHi/6i7vITBJI0mVM/VXOvDVPzAEZjSd7HMIWw96y/GjMkE3JQaId3sJ8xks1Nx72ALhrgA2Ds+chdHPOyfbV0FsgVFQNvAAD+8XIP+sL/8wv/zC/28f/kefOj1U6d+V7/fstlwG7TRSJfhXWFggy0t39tYkGi8rdzi1FmdRZfpY7Q8Tv9RfpMOCch5uW3uqNOmMEw91YZzVn8ZniH98fgtNmxoNB9FbvGi1Jy7uMiD9m/D9TIbvIQ+slpsvncb1CUgXd12XhK22iiy0xJ0IDZ9i/n3vO0/m42aNZWd+2PWaSpsv2MMY+ItNsj26T5weo/WWoQGDgdF3cJddvNhM3OOsxGESfR+NFQaZ50dlZAbsIrRyg4on6eoMa7gLHaW05ZSORFTlVzJUhkZ9J9YDCuv7hKvfROq8l/dwK7wFDwIpPNn2LfhowobJcVC6f9keFrd+q3lzIAYQuwhZja0lUNdCKnhxqj+O1LbxMA1Z45S5kwLs1IlEEDQM5aLipBmATi4WgzuoImsVEzD/pd45Bt6AHR5O/w4udoDqWs9rTr5xF8cMt6xdKyIxwwYqZ2KKNOoB/US537FvzwYxQ3RdJ/tGbjagFbjCVKlfME0NxSaxeK1qc4MoQng+6dgmIoQrduuKxPJGbDGwZq+kvycr7SsfWcZYdLvmjNqanSkLU4iYfzNhwxZip8r/jI8FjbBxkPyKfN/aW4uBnZAEProHN1gHXu3PG+JxSEOUlXNypvIZHvXE0zEuWVCGM6QBDW4qjAqMPJbEzlZB0MuEIXX54ap95O2U3RdrDX6XJv4xQtZDGd/yzkUO/cZZGvpNtdsylDeIOuAs5EIgdOxGostSufQZMwIXQwQXaH9lZiPrFb7RNh0bGHX3V6g1eiubuTeSjNJ3B4hhyO+gbBhz+uRLcqF0HcVniJy0FYXb+dNy6nC0tWj2Xd7xMvzT3sN+coBj2cbzlETtV5/6qtlLmCPFZkUZwblp+0dooAquWdmyFU8jMpVx6Y9wJK/HdzzO6Nqh/IJuhkk/pCBe/gCBSkV1imRcP+lQRB/P6gD0KJRVuR5BImioNHMfLALU5iHrHy7rA8WJ1y+obi9e5SRobpp6EmFjD/y0q4/2n+Iuw4bqCV2dK+Z8PueCw0aQW0MNBFEt5/KaMCAw6HHKA8OMVducz6af+9V0217s5u0Ywgs5T+j5+4foc7Z3CIfgTnwuNkzoIcRZZbxDpDa4XTq0l9qi4TyLi5ndYiCunXwDun3ZppBkaa9bduNmCaUXG89CEjvOCvh86kZH8qL4MwbbgZXhTy/2l5miUjv/vlUeaKzYAMGXHvbuqCBcdhPDdFAgImDeK9VEhIQBZhP0X/RIDCw1kQuBPj4MiO8x05RtkrGJe+/nq4gdSoa/pDAYvnM+Hvllwh3lU1dNUQCWriqJP5WDxWEIDpctD8XLE0NQpuHoOE1PDubKTcrq7uN5uDW58LH7apdHh/k4ca7TU5vIL2ddtG1oYf2kvjeMToARgs9Gwu0kAeM/xpiEFRuVrN8RLUX4XDmejOtn125F8vEGa1O90zI6LWxVMCs/sZB0I663Jmn4H2jQ1yPloQWmgjP6TIW4n+g92llCgfRrddZM1HSZdi3aYf9Gp9fbG+GtMBMW5cmoD28XhJ9Bne866InyoQ7jc0Zst55A8kAl/LWcJFdr3yiVXxi6DH+f/npYHxQsseOfQsX0h9mRixC+SoBY9Ho0jAL4cACwgBTmSkZ6ML5HiO6024nJiHChE8KG2Pt7f9blgyBsT4fL16gFo/GHX6XjKs+i6LVkfz/f/v/nWxvtO66gO92yyZ79DCaFNpofreHV/j2b8Xt+LV3Eeb7t8XFxUjnDGk8Xj6YT/J/uA5125jfxyAY6GDLzORL4dnXHrsP94uWWmj1GaAk3JSxym7sitpK87Mfbb2Ee6aEfhEh0TieETwhPcRX/wpnfVIH4gAAEFOTUYCCQAADAAACAAAUAAAYgAAFAAAA0FMUEiDAgAAAZAjAFBiOzQ0UBB7da6ixKXKVZQCin2x+3wjdh+nYCJEiL3ZGXa+dRHhwG0bR3JgeK/lsiVl5glqlBnrY4zBGSXFzNva+l+DMp0TAlv7pqVDE74hCEKQEIITh2qPJchaHJIQ6iywhBzY0FoKtLU+BudC3tIS8CbGXGvrHaD35heDg061vEBvM9aFGHOnWxrqz/oYp1Kh86y4Ue+Eqfy7QZgtLXqr4yZBrrcNiJFr0PtYGURR4oezg+d6z328Zc3jdl8Azctgq22MpFF3q0zJ24TK0t5h9V8pcgWVRQiEDn69scUzeRbmr4POaPnk/2Fb/xcFesNPVEIGeSysxPe+pU3aSuE5FqlvKAhSHJfb5l+cM4NFQkfdMZIIVIoKcGqIXIM5zqP5hI5pRBlDNSHRn8jINTCKKkNoCoJV3cSkFF9coVLZigH3RRTwuHf8itFQcJAlaxLhmiJiutyw9J6XuYj01gzJk0rCf8mVc98YVKETwRUHKBlZFhLqiys6o6QDVpnma+NezYpvCBlod2ET65kiPl/hDZY17boiYMLOGYtgy7DqT/ovjl9Qa4maUklLp1lgSflP7jlrSaVer2DYiJJQMBq5jxk6GQyBa9Qx0oWpNNY8QZaWPc2vC0S/+LKVKJA9rYv7AuxRhbiGufYuOb3EzNJqTp4aL+MhCMzPrF5wKQQVZo7WIz+jFK1Wc3DWbfcuYwPBb21eUbP9q8nYJtLYDb53p4nYyCL3HinQ+BQgbdekWikIjMohYIWexGz6FnE7T2qS90GS9wE6gR/GKQVOXEr1cJim1IFYl46EKeUPwJZrirwPpiNnyz2MUypIq0slGSXmZam15uCUIDPWjlp9KABWUDggXgYAAHAfAJ0BKlEAYwA+MRaKQqIhIRZ6XRwgAwSygGk25m/PC39j5tFu7VQa3sxnceUB0Tudo9G/989LfqU951/wFfx/YfCPxK+3JKrbPqKdreGXfHLjwAflH9T4mOOX/XeJmdV/w/JP9QewN/Mv7B1tf1V9hn9eSu4l8ukNOMgqHxC7PzH1aqgWntOrrb6ERXAcEOOeYXQCzXDj8Pb1Nbf+dH/tKx1+jJNHvgB8o/LDnRtHmQb5tcd+9of19a7DvoSDZ6dXcc/vug3QmcIVkUDxPOmCFKvm+wPjAUA+Sdwx1NVRn2STNob2uQ6E8OspMhx9DQ1Rg8jmjDFLmHioKng9Zk5F9IUAAP7xcg/6wl/zCX/MJfgvf/I6+crqj3aJnqb3XFenPrZe3Oyia/xgda6NpMJlPa/d+LT1538zG7WrTSHrGGyjjAjDe0g+WnLhNW4yzjcEkHujdgfFof63CNp++5DjX1iVjy7RxFdaVg6xg/2lkNxeCUTPxJkMRuBy4tMDJBZ6JcCs9+v499Wkfm42aVsuyMWQ3sb0UAu65fUqChC/IqHJbFhLxSOoUqjLPkrU9TfofW+iwWBLgCNDQ+jJBD/6U5a8gxzkvoh/IUEjXVG0aEvKXFqBiYxA01y7AMAV3KBuLJCy/4iifYMx5wfS4Obu6ZWggxK/9ep0a0uqgHb5UFVvaakOSIy+BzZTvzmdlucBErMVQpZCqKz0aYbFpIwYZFBkpSzdNbSL9dDChsa5HLFab1NujjqkhTxSWmdSzzbI4rdxTO0dpStF/qw2Y/4yKzWKXs80qicKCKm6R3X+0eftnt6UGAJxLD+nDMLRIdyZkm2T6KCYi0xyFXiS4J4s+vY5FCQpm7hg3vGBTN4FCo/NaeOjjbKXKSyfD2NeZBPrnR9EVErRX4a+sQztQ+vzyPm/n7LoTRYem1I/ElI/mUfOv8oEapOyMuTRNhiiQHip1D9sZD8zkJBPp2yaXJWl7K8m8VcH2Bw3DwbzZuGKOlS2rhgbVlxtZSqEuMfUNub3eFtM9RfZ7lo+v+G7iFg0X0LRxMPiF2wqIUtdYN0526RsMXGxgys2DuSH8hqefQi/VMGi8gbjoIzx45zBE6L1bEiIGkAQ5303YFN+oS4g9IcFMAMMMeTRyhf5tn1Rr05MZ8L+QB/DJGBe9RLCO92hxYO8LMzmPBO9DSUkP5b2LnaC0gjtQE8H8qiVh2k07sBbnEQt412EKYHB10hpaxpXObyCHh9wNgYJEXpBJOyqI5gmEcFgs2I1byb6WxJEB8G0D/qc0FG+7OCu4xtkxPpapakDrA6OS2i1y+wrw/dlocc4thXa8Ge3SZ9e9poEgRH5GSSganz8MRCt1l7fQPeLUTj2qKBX/CU77vn1hIlWXw/N54bXT4kR1z4YxOvmsPuoUV8EvxxCkFWdbYW5hFf7ps9lLwcJbbtXGqdl8JmVeDvy82Zrf/psuvEZXfHROXzZGebY6rJRH9IX6ZpXLrkrZXs/jEdFY5Gl/hqaZAtWIS8sjXg4dXEplAahdlNsytNHDT/kWSNI8qH5487hD8ko/LDYJr3+X4sjSJWh4HlN5HBIQMl6i1SYdAE0NrMknHq1Ao8irprj0Kt0X3vGhhNoczm0GBBuoPFTRtra1xfKg5n4sJ9c4s8lI2f3XiQASIEtcapbFSKfJSKtRWqjyMrgOko4mTnOFHVgjlzaIP5RPEeR8PVhLasrxElcZh1jDz6st1qXyJj+6SpqV065R8ZL0N+EzSX91O2xZpZ3/art1sQemOMkG2OP9i3yYE51MWYynegQr5wVT0Bxhfmv8A3fzRgeQDVJJTpWi7Igr31D+e4CgXugHlyh0Bn5EBsa1x/tfxgnFY2YEeZPowDX3VOkdOSfPrzXfb+msvixwe9odlZF/RYw5o/stBOrMieeqGaImmLc6bAuq5EiFJ1q8/bao3Hr4K0bRbhedvNdWVMNNzYn4ilOOAaEVgADBjlDCUv/7fUwRQRufQp9BCx36rrU0BY3cwvXwf33iBrGzP4zhDT1GL4wxTjBja2vbj4VgDJt0hvuVQgT0GnbqGz3tEzgtEkmRFA8ZjR/U/LOkWftsnfKdEL2BMt2DNDQAKiYWNvDfuDUqbocxilQ+4k//gUHU3Dx0vgWuDQb4wnu41Mi6LbG/juXFGsxCVEAAABBTk1G+AgAAAwAAAcAAE8AAGMAABQAAANBTFBIeQIAAAGQIwBQIkkknEBAdPoa5Vwi/coQNAFz9hpd4+xBSgAn47ZFFV1rWUQ4kCQ1bkZFNoeM8SWQ8gNxUJvUxnWdM4qNbeUyX7WSguWBzvP97bviRmD34o99OB7Y0X6K4YEHNOuTBlFywwseBG6oVEFqba5IadxAMnjM37iuizmX/zGW+cgyYDSHW+xBlDauG4LRw7QVpbXtupBymddaP2LX/jJ8NnqWO7Vz0b8Y4LZkImp7Pp83FS7WMFH4eevm6R6akwzd2gvdew/Su4dRTsGHAknvdleryv2STC/eR/XUZRJd7hSSPQaCSutKtolY2Mq3UYV8LoOVbF0crlOE7c6puyl6aMDNlwtwVhtlW7VdsXUkEqy/Iiq1mkIZjeRW5c7B5GePiVlGitwdgWxJElmD5SMkJO/bSmAIIA3EVg3B6FECI6aLiliTEfQFPjRkUdvoUUVnLFSRW7UdwqBue4eugALkvWJIokfkFfzDfqdUrAbNF3Y0Uolgwo6QEKSOJ4ybwwg+gVTx4A7xjJ4XcJ5MFVMAo4RY4GtBFRnxJgKycLCE6JLZ/5CXvKXaJVmPmFRWQ7LeGY0Yia90cd4IGZssaij7jVLJ4SWiizxpfCIUsVkLpIySx743LtKKnS0pUFKixb6zIZGydQoOFa58643Er0BRqpvorUJHKwjNEX7TPc3CTNkfeoEYtvwNeZOMUrDabDOZfQ6A62MSj8UyCZ3TAJZezKbvWTPBcVs9EgZMptyWyzwTVGKzGnp4bUgYoUeWX8dDCgmWI/w6HtM2VIkbIhx6Gzp2mHKUb3hCyNUyssvV/vDM1Vkz65g6yaXjIObyP3nD60/xK808CABWUDggXgYAABAfAJ0BKlAAZAA+MRSIQqIhIRmZ7EggAwSxgGkYtn+A7E6jfiPNUuPWlak84p/b0heYB/iuhBzp3/A9Xv+E31fegv85X5H3PwV8antbM0yb2lfyH72fsPJ7vr+C2UTeAs2cTmll0APzt6qn+H5Hvzj/PewL/MP7P1ov239jH9WjYpw5Lv/c+HqKQxxosUJRXSrU6cXlM+XA5XIjI3V8DBb4B6XDIRUT9K0N7tbSehuLRwaSgvtp1d9Phr1A/3/luAZQAQlZ1jGM4aBvP6Wa9j90JgLQXzm9xTt581cEOzY/d2+DOs8JBp5WlHYHLgVIx4IGDgmvP4LPJcBlm7I59HbgAP7yRK+u5/67n/ruf5Af5k73SdX+5hm3IuxO3fmvm8/US85aQTt9VUvfGx4TWV7TFJ+Al7ii3yzrcb/T7OugWgOApEZKcl+qxwwNxz6u4EyIHL7vPKip55OypMiUsJ4HheL3WxmTiL0IcjVl3kLvT0dQwuju/MNSDwMVrZwuGAAj7mdKjTzFJTaNL/coakGBmZ5FNe/u8gQSwrpdbrklPcd8T8kh3uZlo7yJVrKTrl3UeaMapqK1Kq+aQyIDCdHk+v1i4fF/wm8PbluFAXi6yAtJ6tMvixw0yl+65O0NzbvGC/aNc0Nj+f4h9ZAG6MkKpcj6PNJV3g/whRmyc6WdMWG8OQBUTQtOJGaMLDsCnoci1+HhhAovQ7gYTeNmizQ3sPTXR8cfgXlOUW6TcnlXb5SnyJlu107nNj7mrhVoq7kupqoOPKavkyZuLUOYcmQ1WcRSX1zM2/APcvnF1T5uAsxqXykVQco0WcxlMK98MK6NvqJmMxyAP617GLCob4rf8U918RuPoS5ZGeUZEXkYWm10IcGarf+sFC56Wdz3Y40k0VFeY3tFYs+k4N2N271Jv0vPq6+pmDBl/q/nzhxvrur6MPDo470MTcWiIc2euq3zVmcX1p/e5/TiwX7pE/wS8oguxLHMVlhk9VSP7C5TbqokvkBMHzIMvnxflntlh4WaoV97/IFatVSFp9pvKcASaUqoK6CEGEFjT+hE8yUuA02l7uKwrWOHv9dzZrCHylcrsdHszMWqFNnOxWKvfqqEfLI4KUxLo8XvzN7FUv6a3dQLG+PTH1BQq9KkJOsZRLGJApHUQNEXe2n3ml98XQ+H5xXv5mLxP1/U5LavL4DScrkdvsM3ZSIQMBXAfC0kxEqDLkniTE9UskKLAtCbpDldyZMI98clS1Ae4/cqTmPzEmxnDzTbmEKqccSmJL5DvkTqcxiYZcwq5z/5Ste0oImKm+ws8dk4f3X/4zuOyVUxNjOCoZGQelJN/KrkfTbwlRpCgYnHbWHPz/nbnUltGMgFywkllbT1HacYovFoaUAcjRW1+F/wte3XUW3+MRL9NB5ZqJ1ljHaLi+936qiD6o/fb+Y+nUf1UccEKHdMVR3ITvgEDkpLC9Nl0qqIfLEDFQFtaBDMnwdarldOzHYgVEcx641/T5PKvnMUTx+nhYPO37DzgU/6K3F0n3MmC+g5pCT0ysG/0xF4YGn/KZSmmw2dGhO79Tkea60u5IaAlcgrIOs29L/mTVxc78D0xDkvXXF8qUOXSQCuN2BT9uxqD8lrzQBB9tzKHqSRzqaI0uknUK0t3kB3gWcj14PBEO+AzdkrveHPBIN/7Zb68nffBiaQfiwdaAh6nKV38CqZe2fBamKS/rDYf4dXJ8F1J0M8gsnmMRbCGlwmZJViIJJCS/541KztNhUHaCUcs95jl+jxDVHv48d3PYoBS60BjMjTb/5/cz4b2aY/a8PWunhtruW1kswN28+K6ZmjMlmJcwIzO9/luGP/7gOcMGaRq987D4kS7YKPGo+jL7wBXzT957XVLGf4c4PmgLPmMCFmTRNlweD6kwFWlrmKDZ76pb17M4pXdDlwf51Qqblaskw/gZw6ZfXtLr0gh8tR3MAAAAcm5QZ0MRvL1iJNZkM4fJl7a+4FvccHGTW5DSi7fNpXQ3QCfF62h2lMVgfDn2anu1Rf2mn7yGKd0yZs/s6XOyDKzPY9odt40emfyw1N8A5L99bnsW2VrKbkt3zOBKh1G5FB0ymecmPzWsd8KACgkiOU7UQ3/GZUgGUnzwnptieJP8qAGbPhK+nUwxQRYCSbVbKANNsMdMpSKiaYTwQAAABBTk1G3AgAAA0AAAcAAEoAAGIAABQAAAJBTFBIdwIAAAGQo21bqjk0NJyCamaSrEaJ22qUCAUnLqsZo85ulAIiRH7/eJFfyoiAKNlq3eYQJ2l7i19cjP0JrE5w9XwRWg6cNY/HabIUMRy2f5nJaoRh54E7Ai9aMwQCyzrC7FTojoiyOSrtUNZnhrY+HwaptWRc3hdt+WSeuxDiZOKti/9Ni4Y0TjLRpD0tH8Pnz12CSapmvhDipCwcr2CF8nwVTSf9pF4Ui8XRBKGV2EwgGomvx6pMbKmoLl52IKrRg/nhBKFVSd9I9dZWLlaxjtZbo8disXB1lhsiUxVeVs+Q8l3XUuLqnvgYs6hEiUs94VzmEKR7IbvF3JWIpacXIbQxd6lDsBfynUNT4jJRVNlLeLiXMpSJ+SG9XGd53mTObl5c4Il0A5gG3JjpsoAY98QhB0rJWOQKLDwlhj1xJBjAGw81WUOJ0QwO28YxQGUiIyI22ezACY3nqFzgwK4JT+SyIychnIt0lRSIpQeyA7no/8T2MUpAdMhB/Bt0hDK5q6fJZQexhr5KgmKRq2Qn4Hl1dIDPoV5i6Ox4s/sY6ZaBi1Uis+OkTGXhYu6I7JVacFQMFxMfh7zWZGhYgZg7KDtjQsOToS4Snzfz0ILl0NVGOV1jMLMwYUCvH9Gdhx+N2AhzyKF9Td5Ijn6Dc0RvgRPAlPdWCVb1WwpOS3BLBT5xisOE/c2oFo+B7v8Hvo01/4bWeqNbM7DWYxe3sXqlqG6kDm6u5eflohpC7Vv+gqJa0MeDiI0Gdy0paN6Od0QYNgq6J2Qk6ChVUjuRNzq12U7kja1nM+F7Kmi7U9lMpa68seH4fb6D/r0yD3sjWAcvZX1wWrJOQlQcpRkAVlA4IEQGAAAQIACdASpLAGMAPjEUiUKiISEZKs0QIAMEsoBofe89x81Sz9kLpzzvBkvMA/y/RQ51X/gep3/IdFv7JvoX9Lz/n69f/FeEfiO+AZbuDvpz1F/kP34/c8O/wf1AvYW7ogA6rXWDvRvFV8N+gB+e/VV/wvJt9P+wJ/Lf7b6QHsq9Ev9tDY27o9xY7WEsrSkpIevMSnxiJBVNxGZv/fr4+jX2nsEUapqpI9Ie2yGB6ZyXOpjKED4AQ//ceDIm10vKt7jTt85vRrw/MFeN33NGe1pAwiwatVTNfyNov8p6wELJicifSrTr3qNUwUp9RjK+ldyztbH+sVzbwWbgylGDhxvhQ1r1P9D2b5AAAP7yRK//rvP/O8/87z9yv//mUnrJ7rd0H73TkfE2+suaBTT1w/pUlUCSEZflMXHlKgMAIa6rJTjvm0+QwXJZzXcbCrsFCdyoo7C6H9sNRenroVCsVmxqkV+TzOEFXS8OhCOshEQV9vOGm4QV80mGzvkBjBSKJNJQ/d3H2hCsqHb8HbydcTtF/8tlZ9MDl5zXcvGFx8N9zzOFojzO1IJymChtQ1+8CpVwmgT+qB4qj4FS5mHAyz2eMxm2qMo5Js7w4ymgWAMxDTJFGgQsM+1zWmvScNlSNw5HHtJlNnrzFbLF8h17ycliLlc2Uf7f9SWnnZVBcwD9JNVNhI+5w6HFahXDd1e/H5rNH7P450z4ERlUDW51j8pp2GYyk6YZLzexXEof0l9RgWWjoUtylV65VS+VVSCI10hRoNWRr85ELOHz7qEBXkvEES3wkauhmnn+QPkriSenp86/TfB58gD6fV3/1nU7g1N3INbrnYlSSfHReNzZFK+Y7fjs1r4erkf9meN97vqUdNq8ncCCGBjfv8ix+vfZj5C2sRFAXW12Kk/fSzvADa0nYoM17Ocg6Bwc0a+0FcOqIJErRvB8uWQbb6+Ad97VRtfEzAV64u6VTVEYea8Qt9igfgdcBWn4/lQwQcImS9GYIY1pKjCZU7GGor4PEIAUeLCyGrNm0yTHrA3hk+7TnYT4ygZmEiTeC/qv2yX3oAuI6ZwboL+14LpM8Zg8wtTit4gRfkBNhNzI+l4sVzcSXz7Lg2FgWJoGIomnAhpNxBAskLdKJXDDGeYkPb24kzxbppbYXDXUqbNOqcQGnJs8M+JCrM9IuKmRVZTw2loNFNSuaL1nbpNy6/pbMk1cDvPrB6peLZ6uXQswcCvoPTtf6F7p0euyhI49cQp9pzg2XF7gEHs2GfrRj1LVViqocRfWY3Wj6NHGYZUW0xmpCaw337RiO4UCPE6vN+2YgrwOXsrn+GfztTmkuQu0cMMSKgkuVsnPAAp2sDWf65hwvQ/lJ7VznxNQP0zAQV4yALvozp0ULctEyJ8WWwhmfFNU90bLMJgBrW1+ZwyCtG67mkMSQ5W5vs1noHb0gGbmVtB7fhybxEGP4n7+r3jqUyDTxzwM2FghDefqmVx7TrXRAGssJUs36XDAsGYFdBLzjfjOx7M/P35sePkhEloD9sw25dMECruLy9m6QId/nW/NasZp4j5QS8WHx7VhxMYAG5cCsL7MLUj9G0eyvNmsttgQQ36KLdntNNSUuJdjeEOhfp20D7rwYBTdY0YrCqN/4JJ435n3C3OtzL8L56YYXx8Z2zlBqrNvliV8sYcN2TD8eP7gGKFGbsMVn8xRb79rAwp2YcjfhZlYHgx4In0rB6K3RzBWpr1Mjx8R7i50qJjh2BKnrNLcHfAt4PhBRuHeIF+gq0ekvInTFcPQPRYlOp/qb95O3txOVyqQyKRn1hbmUcWW5VDqGRObdk1oFXGjqv1TOdicjSq47VLJM52Dg+uMQJhJfNtXxbc8fViKqcE8mv3Wdy5Zeisdlebc38irsSxfiEGq5roAxoYkVOpX4Zb0RWLZQAAFYUno4gzLPSK5VhP9veLlnaknCDReCHDYA4YD69s7yNbw4EECPEeB0L9rckUrQIOVu/Vbih9CIrB5WSh5aNcnuQ6ze1iLugZWrU35/5jExTtBfDJ5L8D3uPa862vu0MoSPSNF3En18N/6b8xzgWdnnrdfrJnUV2eDyvPglet9n/wulnxudS6dfeGYCl2uoPWvdiF4QNBGW+ti4v5Jj8p6YgAAAEFOTUbeCAAADQAABgAASgAAZAAAFAAAA0FMUEhtAgAAAQ+hoG0jN/iRGiC/V0REUSLf4CcErRIJy6CQJABs2zYEiSS0U4ryUJgOcPz/lxkAOLovEf2HKElShWZOTU7J8dwDyR+YUWbdu4FZwGCj/G5p8zAdl9snq18WosVfCVgWIjDP6qcTGbL7k4LsdHaGffrT0lIi+50SFqLgSjw65/y2BTTg/NMMfGWcknOu7xLZU65p+K4Azl2a1rIbGQ/DtqWcq8TgpGk/xStNaUPliz96441MKnA02ea558ox2/UfPl3DtamNYJTqYhtroYtTGUyX0JDaYApOr6sUzp1b12sM+Fj6gyINm2FI3UHty8BZCZzQBtRVJb5XKaMh5w6Q1yXmkrmi18yOpOh2y+vFmid0FxW7OHIFe+silLrcvjIDE+XNIXTWVU7ytnSTF7AlTmh9dUUjkq+Kcdz1LhxSoY6X7IzC7XkvWUUrvxV2oWhcfV2FWexR+5eym526rno2fUTNBl+9Wl4HcKhiBdWxY+fTrFhIsThu4jLRCw1JLKSY0HyV50ObSuBQFOqJRVb3jSuq6jpAyTc+/7CuGNSLhfjeKmOp3CKnilak9BlUWbJEpRtE6rlvJ+blqRaar3whXi8X/eatFxocykI2UtVvuB1CQ1IW6jms8q64DLb8ZnQadWQha1RuvcPnw65z1gyibKozO+19NyigOpLVnAKCmKlzTgFNnz0UOW6KXnUXBP0XRHAm4TPaA866BMKDraumgF3froe+W59n3knBXZLEAfOvDRa5hsCyEJAmI8u+pNdFsCEgxIWubMz/QcJKYFkIl//bYGkhzFY/HhGPFf4ZCT7VVpMHs4SBjx7ML98MAFZQOCBQBgAAEBwAnQEqSwBlAD4xFIlCoiEhGKr1ACADBLKAaCPmfivNPtjZiD5QqfKM6IHmY81n0b+eB1IG8zf4nBGuw/vh8NfwCSOcT/FPwD+74V9rveSQAbsOlx+M+gj1Wf8HyJfm/+k9gj+Yf2b0meoi/Y0z5IO8dnRVv+wsTTR64EDlvTEyfr/1pPcZMmO6OLSfL/tppzPkVA9Hr8BCtffo66Tje8nSOmmpnALESkqptqbTHmvZUIW0GPjH6y8JP6Wbtx80do4lzGARYjaQ3cRIiKy0lzeYjMI2+VSGCkyxy0JA1b7mzfSdG+B7tEAA/vJEr/+u6f87p/zun4jX/+ZPe6b1g6/P8JkkD8e8BMWerMfc1OqR7okXa7S7WkJeAY+WfBG0VJ9ES9EGba6YGZSya1ObwVFDft8xvwa2oLSaG8G7xtX75o7mbim+7w63E2OzBW2cBg9ViD7tlEoSVMZdVATtXalrL5dvXGpnhI2Da2HxQWuJJOJ9bZwkCQ6b0XB/C9w0NI0ndEOfdM/ueQblPi/bGASb65Qz2U2KRYP7nt7cnJso58ZMAFPS78/KBXqU13KzLMNjVHUHZuzIYPOndDiRnZafghwFV0rW26mdpsgu2KNC2odkQyuYFhLvBxM3f7VbqScqtljf8f1erolWXNcrRRvFW3imm4Undhy+fkIKV5zvAJaLlKjEQcFLp8ogzwf4bLuLbZOOri8lil/IIg6rGJWUDF1yhszbiNmcWQ9LnJ/eabMKjyYxXRDfi1wxNY0p2DBXgobd7G7IoIyHafK48Te7tGLBXOkL0skXlxNPuI4TyYRbciu3Sgm6IXAbEN9MwP5c9Y090yi8RzI/JCJNAEl5gcKsZqmX3rTf0c61QaaaaET/Rfwgs70hbTyHcMYbO0iLr+x87ELOFvS5ik1gdFxFvt/p8sUzVSBgWbtNMm8gVxvT0kiIA/jPvPND790hc8w+XLpJNTvXIVtIVK3P7rVd39rD8k5M7jEy+I0Hiju/xBAb7Vol0yGNe5ry40i0def3CctjaO/oXYntlZCprKjugDN4Rj1vJhxcN1IdtuHADBN2iiEChMrL7pdxDdsRssuNbcbdOKtz65U55SY2gspqT0oZBz7fiWXQVfUx+qQ8/qjFZSG/d9oRleYVUymPNVliBB3L243Ux2FOdgmQ9E8H/UzKwv4fKyFp9f8Vloz42ulm3dKcG8OdT8O/EvScrHXnVIb6yMqFAbSsQ8WG40B7gtncqyZprlxIbU1ZqRUOC01cE1veLMoyDQPv//RjqBErNyHOcSvTvXwaqqpupNl/0LEyQCE+r1C7/cQvcnRGA7XnoA6WaLrxPOvLGNLHQhO7gvorkS70vpimcn/DNMwfRoGQG3X8ap3lOZAmX0PKadDGwRQqZimGdPCLAoGgw9J+DLMnL0co3kVPqlLqt4APL4QQk8qjVIhb2Lceh8s9WABtYXKyTOadGamENnJa3D+swqGcvL0xciYXnO+PsWyXRbq5B8q2xhbzTI99bLBm+paKfk1cQnxiIoZaxD22KTjYKMf9IZcMRHrX3JpLGpVP1typGzOQzAF6Y6HHYsHolv0ankE+geOBNzO9vpriRKI1Ya76HZJDZ343ytvMvtjFgPiA4Br5Sx0wgzj2HNa3TAp6vPfsXk8wLGzPb6d9gzTUt9NnfmMu+LWP6XrPOSPtBbF3m7k4pe0Sy3Zsc27n36aONnL7YhFjUOUr2Szd6PCJScF3pTT9nnZJxD8pr2xbPGk5/v1mwHQq+xabTTp0tUSvlNOfrVzhJiseflquCmCgoiDPntzqwFy4vyFOmkKKWse00ErOE3bLkDUssJ479vw+sN84VCEwU+VgHJBmKYFs8MuTcGNfHSMauTZvfHlAQUeJkhMav4KiDCKzJH87AbmVSQcsr+Rh4NsRT2bEFTiHfC/KYWTGHCrWQqoIUCWmy26rFPIa2NHe/Fn8oErvRwAD5fggeXsdvjIjudM1qWMcfREW18NjCkOT4zgQjKpB4UTrQNvitrv4U1YU/Qvev1rznOqPUGHQY+69LRvDM7ePzIxmoOQ5v1wYLYYcVsBpNBtwAxH/ev9D7f6cn3W/v/PwYdd+SRHB68pCzUlC2uv0c1dOxncyE/Bbr5facAK/JAPI3z8A+lBGbQAAAABBTk1GoAgAAA4AAAUAAEIAAGIAABQAAAJBTFBIYgIAAAHnoKBtIzd2UQeZnxERk+CwYj7GZOGsGhNAEgC0baORQVIZp65aScX/f2gGAqGOY0T/IbiRpEiKWrpSDhe17gfup5iPsCxLOkRvyFul/W6t5jdvBu6vVuNPZp2AUBiymTtWBnT/CZIZh/ZKO5iRpkiKv4js7ZggHH3uErxpRN8iLMtaMsS7BSOo0ssB7vYVRtX7eEg32js2LEVCfGoWuda2KyypPGkttdIutiFx4bddaUOiE2gYNcp9eRcwXIj7QEtiXxsJqrLIWHilB7bCQ9mH0g5WoUhsoiSjUPyEeGqM0CgUkX/U2ZuEIgF/fjWqQpFI9fCTXOh5H8K2vpOEEjptNWlCMQfnXdolrL1ZCRWh2ODpkShyaRUK/SY4QZRmtEIIHd/zdKjIAyCRMOS+z4WiyMZYRUKU1I5YhVvKhdB43yvCLftChe8p6jTFLXFCjc/JwpG4y+oKD4X3iTKVv1ah0G8dnxJBEqIgo1BYvSVJgNypyHz9LTsXJhRi36fcl0wIjW9IWtrChF/hhCHzPn39/j4LllfoktTn403abkTCJPT5rZK06QluTo0hy3xA+tYbK3c10CQ+h5oBoCssi2dOE90AqLCXB7kSFXx6KGGrd9uCmpYRQnf5D4EbSWP0yp7e1nQYPmtfWu/pgbOwK7F8BJMVwwE5Gpq83cL+3S7OxI7FfB/uwr1pM5H1qs7N2y2H7VdwB/Zv+MmL2UObAJ8nwOFUZD8B6H55fLZEMrRMQDtMQI2/PYfGD8jWtW6dIin+A6z2Rd+F8mckhd8mSAoXNnp6X2z/D3NtTzOksQGMlDlWUDggHgYAALAcAJ0BKkMAYwA+MRSIQqIhIRkrnAAgAwSygGmOR4HX5vzXrk1zZCHWdnf9F+3F8x/mq+g/eQvQl6Xb/RV+7id5i/aftl6iGNecXjNZUzvtwFZTawF6Lxysy/+9+qh/cf93zSfmH+a9gf9XOs9+4HsV/sQcQ4kH7JIJDXZr5H3Kwh2dHxTCTtqbn7vof7D6iHe5tdUGSeZ6fkW7qQexqSFtXXdguZxHC9piALKSXkdwUG3HUMYz0X3FJWtRqmEPw3rDNizuGEj0W5HFh0bazZ1ln+U7mzY3+UteC5pHZcyzsBYEvM80cOdhkR8cLAAA/vJEr//Xev+d6/53r8EH//MpfIzyM455ftOO7VmpCWohCL0YT4F93yDj64cGZDMd/KyAfdnv4jaEbrv9okR1LdfFgy0CB6VLxpGScD16x2EnTgs/1aoqHv4MyfHrM4FtAtLlv3X5hg/TAmPFmLUPEJ78oclJ3unacCGVbRgCC7b1vOC/1Z+pDlWOdtHyvrlK4/w/VnjXi+dxQRc/fyP7xmaR4JIJ3aAmodvrlfwU5kYbNoUWwvvrorLGH2NGccmz+8ElWOoK+2WkDQ2HkqA6SRANqR8q1+hssMm/u0SGVQQ/G52Chb5NPOzLBEDMnPcM52RYmxuNq+p8j82KMcldJJbuaV09sraQjvfBevgY9kikRwHkk0XzB/kE3E16+F6tvy+MVnE3UdcuHYvgIhr67auseylleZz3owaMUovQ6FecBEhmquTNm90My9EFieJ0PGnYMv/hPK/2x7WdLwEiSKZdqPHgPHFPPkoWcg5wWSBAFW+Hl8skJoYx9uM69A68w6VI6jbe8yStlE5Uo5vdaTJdOWlJP70fuBi9rRSJ8oqnZhf12P+ymp3a/V7H8ubugBrMZnMW2JOssV3XVmzSwNAwJhWx5geSFsUUtGR487MxjBrPvkKyusuwc/NDB5krreERHCdLp16hNWfeiw6K8HZAKbQ4mzUzMLvzHppSw3JfcADUe9tZ1v3imqD0w/6MkXH4wvyPpDHjeRQbdb+K1+NpP4cNKICspWmyJy+G65NbGFagQya+BQIg6P9b6ZJzgDlT4PU13QvUL4MPVl4V5gJnZ74YQeDHcbxCX6yzftmZqz5JNx/GmEPOC48n9FgoNJwTmm21P2bw3xrUFuy8L88BxwrtKqB688Aip455lgMIIocg3JFnt63ey0ylPz0+PcHN89yq+BmY6pmxtCNzHG1Djyn5FAL/H0YkpuoUXQM3O9Ykg/Pjpk/u8bcVxF4J69Llk1K3fs4IS3PiJoyGp7/UiA4o0+qkl/FCg7BGrKjew1HgEfAfeGHa0uAS+bYpc10kGKLEVqSyRpquLlY5Zk3vhr/ptN9e63CUK/LGtOih7/hmVX6141CPOihZJO/AHcK+5JIQ5jC4AewPTdqBk87C8hHXLz2Um3n6BrwGANk0XJGHe8kgOHdQ1gnMK5/039q6roNwp52FhUDQ1wGEICRySgisJ3HBgkW5kRE3zpR2FoSzOri+n0nsTmo3+wFThbQC8KAkc7zoPembdmnXELtVBo0mGv7ffIshEqVO73GFDIMLMR+ikXQHUOEI7l3IGjubWJYHoD9J6IPT1uN+4/Tgl7lq5gJLMzj77IxXN7hKuY7zu9LPhbvQQmNNk/uRkl4ZX3uBjII3bhdvTF0yUU4Umjo0TWJz1bPcnw+3p+R7kWcS7G6CKZp1aSPvoZ/VeouuUnQd8a01TrY+Eems13pvNA7qpcKEdQIEmRKNsz3E4ZyXCxYK9Zt3qKgqxdPfdv/fdhKRbhaAYOGtJWLH54VZ+meIW0vJLcSTdHM2YAztafWLvuppoy3uexQGUZeICcsf8KNOUKmX99v3alBouzvntB8ucAAAAx6s2YHhxfv73sgeJZUqjjrCnV/nGqaI2CzOAsDVVglzpZBZuIYu3h1Pi3YjWEfw2wQLwrhYOSeO/hMMAn3Q1smgLrK6+tL/l4fQxBhJlc8u6uiyGXAAC7VPtrHMtfgUTWCPdk3vATVddH7pueDEBAQp3E4lhMkjy2Or+6c/b04hr8Dn2rkce/HXT7P7QFsX9f7BoAAAAEFOTUYoCAAADgAABQAAQgAAYgAAFAAAA0FMUEhTAgAAAZAjAExbO1pYeIUp9TSVwe9AaQxmcI5USZtzlc6AFlJ+s4WESBkjwoEjSY3TsBoHkrldgp8AfZKfV8nvLKglm89WqZbs1diVs22Kf3l83VK9GpHQsvufIBktTBrCo/9FhAFAp4bDAdwxnDUwVtej8XaY55SXeZ6Ds11ZzqhMDuFTn2x2u52fFzxrpF5rlt3t3NVUlVLqmSBFEVMuhfjJSrjVXqNMPNPH5X4oao91z2M/yk6wNOrja1f42hU1RaRWLS1N7hqRg5ZG2BWZQ9oe3wcasTcj93sHNotwmSLfCs8q9+kvBEKtp6tNhxtMccsi1GS4RCDJVqZ+temwStKUnVghMEsCBAqJom+uNo3BOmTjkV7EmjRmfVcIBCGVHT/IFqCpvhlSLZXUpMOCr8nyqb41xtjW5rQ45K9MkYCvZnuQ6IFE+TWTEWBJfW4kRFjD2n5iswtBW825Kjs6pOg5EbSFs4GWTzOVhFewCUfriXgsp9qVyNqep1wl27fNBBz1jeusoOJc149k6zWBVnah5o5lfMLfOTrDcGf00n0MPzsijNxDRwbVc46TR96rKDni2hfbLmTgdHU2FeaaJ/p8xDNhDjF621h0PnQ09hHLhUuqqt1Jq/cfKxUsalcOeuFRuMw2eWE17oD6Bg71DcIABnEAM4lhuiWT1bsOt1Yd3ZI46f/R8sGrGOu8oFyyamn7BKdeMhk9IvXNACXDACXRDUC2oP+H6AJ/cklYlB26eWQZoGQyA5SMI5QMA4BOEY/6Dg0wrXKdAZQzJm90AR+cgX9zAgBWUDggtAUAAHAZAJ0BKkMAYwA+MRaJQqIhIRg6rDwgAwSygGdR7z0PzWbs2vGbtN55gHPw3D28hegB0stZe8E/FH7Wk8EeeIneztbb7CADdn0unyf0Aeqv/ieTb6T9gX9ZOsJ+0nsc/tub+hq7Escidpq8trIJYQHSeidju6p/yTDEZd06dl4Cvr+hMnQy3UR4+ySK+V0c6GFLM5Ga+0D+v9yREtc+hs4qMREWl5L4e7COPhgI0VlH+pNwazmig1NVXKkXwyZ/+JH6nAO5OCmvIqaVyfGoHwTi4hoAAP7xcg//rK/+ZX/zK/uS//5KfXdlFjwF+isdNdfZ6A6nzaL48b86tevfUWIPji8JMhIQlzZne/Pl8VOs0Adr8Esw5GBRjDw4xy1lmDApX+vOX/CbJnt77E+aXbotTexIbiXvPw2+FP5T2BtRHIBrXHPPhcopE1V3UHeiQAVIqLhzd4SwM61835Nrp2n1p/emiN0PFy3CMqPuvj2aQecVm8G8o8QyMhfbRn5Oqy2feUVWeq0xvJAUvZ9RJ2eGYogjDjwM5Fa0SEErN2+T3qg01PGe1tnoUF69/wyt+OcdsCGkIhH8jvKgJhqkjxOCSM7mE1WQMqfejPgp977GF9E6CIWq++lvnkpUQywX1uftbfKs3KS0zD0swSgj2l1BTbDeXelozUuZ5A2O73MHyFrt8Ubssl0HES6P+vV5gZ5+tsbFq/ei8d24l93YXbTHk70Vt1SLgTR2VF7Q7T6MR8em9dtz/FX5WsKJtCBi0AjDeYOPNo5nsn6SRiaheIH3n8wY2BPh1s/7wPs7VH52dH8jFfKpbRjkOyV+iOP4g7ZFQp9BcEGnBeZvLcsX63/34pZmZIxdVy2USFiCFhO+3BKoQQgzeU59GBeZ0fxkEQT7VzysS035PqsqrWmgoitx92Mu1m048/O02efbyyokfaraSAOfnN8L2W5nE90ASANcOEOhnVonSii/qDAgrrWGjclQoTIjCSli7FP1GXG91/mndGmrYNGGbri6+D8wP2FiO/vHI3pqfMQAkm5W/wBkWMxA27Zz56gSVr/jdyvZPEoSJgQlbf9PZZQHfiJpehKWOGyWjMEAz6SUL09JiI1KloWfT4F3EEb7PtB0GkpAgn+9qfFZYgTPfIj45/1hlUqSFPfZrz3sj9P7bVIZqOJs7outxi8ie94tqzssMXo/sifLUvX6iB6MTHm00ixz7jjXxpI7Hwq8kJC/pr6GIGIFxVT+Fy0B9Ju3lycPNCUikoDID5vx215AnTfRKiMyPeFWqtG5YMabKBsehDapYUtvl/wb9TIuplZRtWbsdHX/E13vhukmP/6dgXN0Uewd5MveS5cyQ41e1AqxWQ+VyFmr5X87KwlLHBmMWAwWx4NyL10NRd2vacfMkB8GtM0YXw2nD3xzm7ErrYE1WdI6NT0JIlYz2e29F3cR4SYMGnauWma8VU+LAmnsRQTowfbQsAPFm94Kslij/vL/I6H+Y55Uypc84SJ5pBx3mfvvUb660hR1f1zv8EP5EMN9bnKuxRVal2DS5y37IGwC1qb72dyE0cWwSwaeMelyrGzJKW3b9rM4rGeqj8AwuVmdAAYk2P9P9s2y5lHSr/vmlye3Gxh1gVR3wclvUWSDEwaMTF8bSB9ksvS3/sYTh/NfKEXn9r+dqiPGuUPS2XpzCmLMj1jPruEnNdq2aO+j8ljjPqPIxrOQAoXoE0yTlQ8/19l1FVgFgWBUaGEUj5GhSjJ2VKwe27UAAH4Zs5Cj1aHc2qfQKhzQuRRkJNusPZJH/0GBTMXE7fwLqvXaXL/D84ANwxMapYac4XY6Km2nG/wXPn1eSphtK0wQn/uqDnxz3HInvVT/cN/jgjLGfmyLs9JSQwgOCJ4XonfTGRsHZWE7fgkv45SaNiiYlBDqvybhyma08O+GiHaANDaaTkINd4Q57uAAYKAAQU5NRoQIAAAQAAAEAAA3AABeAAAUAAADQUxQSGECAAABkGNbc6I5nSiRAo1hQShTzBtBBa1AE3s1wwy7MSkoGcogU5e+rh/iiHAgSWrcjGxTUKrNhZDIE4blHcY5H8fgrDpviGprTCW/MbqkNh3k1htZoFhVbBHIutaRQFqbRF18nVK9LnFtpmkS01SZRaWp2V/hdNt0LozxehyjV4aJuLV/6VdymLl0nfOJGzZqQCunC+OYC1Ft8EgAYdwnIm4zBwMPX5rKIIfk14KwZVEEVgNIZzX6dlHktiB8WRSpKaKrXC8ldGfnJKGrnERULQeBYlHlk61L7EcQyKgyB5MQihVIHWW5REPkQQJVTmDGJhFwdvFYCnHAMPsd6wjKTRHYDr5CMzFy62xAEZspAiqjKyvJQMr7BoQDhJUtukTIQQTuWUezQZTjgLJvZCBleEmmQYIDoJwmhWom5PrKxePs28Hs90jivjinDm8ZRx2sZKufUxj3jdkSygymbOMmo1u0TfXf7PKgq8xh6K+JbmKEfdoPFsk1oJz2vzrjzHQFdq2j+VsYoGxnsWW6B9u+sq8ickLhFP8fN75htf4hcKra7i+ucWpqJ4ZcvXO73Thp3Frdj89ZjnWvSRZV+v+jhFxq47cpeuOLGANHSNG7/25fhHOf2RJjem3Dvh0eijHNY3WUY6rdTUxiTLO7qY+qWCg0/ctT8Wis6rNyGxCxcqbcpIgxXV+7WYlYTMeHYrq+mKDK/sm+nKD6a4Lf+UHZL354QCUHO2j7+V9x85qdKdA7qftWmdjrn5ffDyzsacrkBfxr0tvZq1dH8pXHg6o+u3Oi5C2jj93+VXL4ey/geqGqNgAAVlA4IAIGAABQGwCdASo4AF8APjESh0KiIQ39VlYQAYJYwDGeUFY3j3+h80q6f57erUCW8PRPtxPMB5uvo53ireeP8ZQKed/3XI87OsBP9xw1+/vUC9cb4NzL+v98jq0RMHhlR4eqZ/a/+XzW/S/sC/qp1rvRp/YpHJMzfMsksW3ksL6zujmnL/JfM3C3TsPQfWu7zJ2Fq9LPSYuZtxdUctnkxcsAECqmdT52VIdl1KAlVL2aM6nsD/wejid+9YfFEKtI7VYHM6lz3LlmiWVm0zOJN3fMa7U8Yw+Vx2i1rtlqOF5o0FFLqCSmAAD+88Jn9qw/6br/puvlNf55V+TvMTTSJlbUbfq8eaoUxzwcIswymeeV43eMiHujbO6DY6gByDSL0pob8p0dYjT/+VruqIbMeuUMBde+x4dY3qo62sR/QJlLMv7ilTXyOtQx4sK7wrkUxVZuk1WstJrgALSoVwPs0PYh1R82Pv07rwxCAnDxJ9bmqVejEC9uz1lycsjgk4pUmYkxKZ4p2P4IziYH3zNU7qhmLAge6585pv1P2ge4+TwpQmjMamhNP4E9bNuHRR+AG5AbMjblkIeziAwhyrivk/dghmRZz1z92dwfvaZIQ0E2QOqkaHOXIlYmcpvKODs+CmwxTAwaBA+X0kW7cgVNecFilt6Qk76M0Mi04wD5k+TPQSqs3vweEyXL3wreFi/ZBWsEBCFqZnFaZToWVbAAP7b5HDJ4V8KJZoApM/52jNdqDlPcUxeVhUeyW/ju3+VQ+tvmYL11oLcOfHheSc+3E4whVnFD5Jhc1vbW3qT7RXb/ZP4hOg8x6t/Rom2s50cFcNVY9xF7MuO5aaDIPSiohkgR9h9lev4aoHcBwqeLoTlwrBo0ch2J4L5uJk3cJaaC7jmGe3KJNN9/3+Knp4Oi+AY0lvrpfUp13kbrObgp81kTsWros8Ojt15/UJ5f+DX8tXiu8hYDJSjq1B2Z+QTq2RGRsiAlV4wPZhye9/1y+tw7ULJRtQR25UoRzpG6fylg7eYqYKOYGUwxYeDyAtbXTCIpmHvh+H+JP1Qs8MFQCW4Jufz2ZJsG4lH479bRrPHcnyp3ZCq+eXNTaZ8/I+PDB6xPSrHRJZVp91utf3DrVSmHxQwJ9Vm8q29TNyKK8ZCsXQ8iuyz7+Qe6bEBeS2gi04eEBfd/vK38cb13+6KS7nMM19oRForO12LnzPp83afirwUffhC7TWnbc8N9jQ5GoC9MAXYaB12kdWnEMzLpE6jip2gsNeaa72fJhOZ7YOW/rJhpzFrdKStkH440sVwhhATY4VvGYxTVJzwKgYaEGgWNBkorBTnIs0wq3KCDe6bjsBOkA5VXZb4cS7ojbWd2pNqKbHIjhfwDPf68o8O595GPZhDEXOd3oaZIeJetDsdIOzCz5Ml3EYK4sVVU7t5F/26aBNX/upKyQqE4vIYbfaCBltwYcBFWSiMAmJIWH0RC7uHiyU2G8sfYuLC/6ewru+LG4nj+QPYQQBUFfUtyZE/AJXG70KZUwyjBtZ//CX37DHnMfTZH2Ltl8Mi3nThBO0mTnxxQ1EVhv1fd4ZWR/aOj41lvX2xqGWfnbcCxBS+q1v7pTXU+CI/pKDnw8ZOPfvNCdm47vrPa7BiNqH9ZadXeMWD5K8IUk/+aE+eN85GqYEgwSrx3BCDxY7BSo1rAOa7LkiSBDOyR8ylTSj9wNLJYnYFrn0u+luDUjtI84LacB2eyLqVbjaaLKZBn7Qi3+DaiOkG5j+RRgFCDpMe1FEXnay80cw7MHHOjFF4otv2G6Ef1+toXZUKAEmc/LCUHpMnYTGx/5DwgJB7lApZlx6W98IX2wWdN5YrBdAi0RXFvrf4tn/GL86sN9Gs7gKzdbAgkRDtazrM+Pbre7/pNFv8P3vQ4vUUghU5dEUiOx+Y/1SbOkXFov50LsUtORAa0bO1ku/sPj6HxYPcda3wtFhk+AfbzQfVdmYhsgr4fP2qedSJpVXKv3nL9xTFFh9C15drGFNzPkmAGme4kysPe8TAZc6bpyqFdAN8kc28mOmg+AJyFAAAAAEFOTUYoCAAAEgAABAAAMwAAWwAAFAAAA0FMUEgyAgAAAZCjbXPbRmjgAiymsjecJmJzOk1EoSlY7X2cZnPePUtEQTTYgEISJsCP6ohwIAFt25DB0RhnFK8vuDO4xdV6i1OwRMhtvdUlz5fsMC1te8PdAygdJDukzlHADtjBMu0ykDeDp16Udlr80gC0ApaRHVFXOhtR8pO3RNmHtEq3aTkEQ7Sy/qS1tZYxyJM3TZBWb5psO+RLhY36VrQspXGb/H/wq9yrzwyxNostBwZzM8HMdr02QFbbIA3QrYBIGzhZPcCJbYDTUxvghNIGOFOzcnLayslpK6dUf6pmzrmD+nBROaXhy/sqJGn45utV5ZTqiDqnVAcVyEv1HqlKivWkc4q1CjUKwze7WI1Kpv4bWDk9dXMsQu05hVrWsL5t7yjWSqdML5MI9ZPEOS39fMWqQA6y8CVpt/eGNo5bsvAVkPbiGDBTAmH4aC/ORRq74MX9dopFNzxKNerGE6n24rweBefkWt65/n+kmLGAPHuZk566mhn6uplC3Xz/9nbUCuGD0mPFfP8iJKof8/qXBP3wzo4FO5l6cSEl8MzHqpGvC7N0HhWraoIOh5UJ6G3nhMxVEg9nfF65YQqKeh3gJWsFFLDElDvVR+45yFvMRdEZMpebMIRjHcCeTLneHsCNvCVzrwNlADs05bLF2ZSRffYcDDgD2wGiIfvDTldixJt0ZMvbO63/iEOL69R9tJgpgeIW4bvw/wzKxd/taruSZ/6dIoyNrmCh6Iy3W98RvDPfgvU1B1ZQOCDWBQAA0BoAnQEqNABcAD4xFIhCoiEhGAleqCADBLGAYoXChMvlfNjvD+Y4X868MLbec8R6I95A3oCu7PvXhH41PbkkqknfL2tt9NAB+W/13ij0vWgB/L/736pf9x/4vMf+Zf5//ye4H/K/6v1t/SF/apX3myqlCFdt0/oXof8QYRdUdHDW8vg3/8gnPklT4hwx8buW/0u9sfFh7rPP2Wc3lxaZMsYhbjb9v+4Bdzqcmnvg3rR9fbBj8rx6keKXE3qalmtMXAM849L/XwhpbGng8/pu6chOywHGX60gdGK4pOn6AAD+9UA//7VT/02X/TZfVT//nkf5490eav7Q7q9Uf0n8yKCPuMQOi737rfZ/NsbXeXwiV9P5noqySeCAXrnuU7TUQjKI0eVsLtzd4WiptrFny93FPUyVcp3UdCoROx69umXdJ1hLYm2Pk1E8H2wTSss4zBBbR1J5zO516sGRxoWeNcHG5YPNRPvWPfWXS3XuLq1yrHHBESJzHO6u9/VUt0IUgoA2B2rIbVxjZ5AbsLzH3Ci5R9NifuY1rHkXRrqcx/xj0pAGMQyU/s9g107cKCz49CIid0T7do0MH0rTkmhvzr0RSocBd7vbKzy8GB8BxEarKu1x6e6Sfl0fZ7JGaJ3A/4DTdJgIT4dxJNBsOa/VjGFCG6p6bHXMjw8TNj9iKT0Pm7ggJwJTLt+uAZlQQfcwTHKqSuIeQImbx0hN9UCrvVozbE+3CNrllN9+DFb51T69Vc/95FwPRh7+lddlyCjWfcnHqZVV8eGpJIlQCCloMzYGV+Ex/cXfmfBmWcCwqy1gIdOWuftvWwPOiRwh5zl92vxg255yEhrwo/QeAvJsOdiUtDWS1lPNz7FLizTa3sP+q36y3jK0hHyxPNF8EvdNSlGm8Gu3DXzYrLiJSq4fxwJFl29h1lI+EYVYgQfraXSIRym2RrUUyQF4QBE2p3nWXOx0JWf5EhqpWio2X+Juwhke+/age5/Jn0hGw+MIhDhqXSqKLi0BKjspuqKdvqqqym53GGxIoBtEV+tr+jWEPfs9R3browvFAXp6ipMLuxAyv9VNzWG6rZOQN1Wr9DL+3qfN0wjugoPZG2K8u+BzSbpKpFvbmozKjlvdMfmdQHAuUq29ngdWJX4+3Dvitg7Cg+wIH9arbBPiuYll1lzAgPSJoFuvz9ICH98zLW+Zbpbmo/V8PvHew82NqzVmX8d95VaF7MhgBFM+x9XGBi9QN5nCXtaYzPfK8GsHRP+vWay9xF8PgTX4L3ALyCkfA/W7irFqvJH0Gu8F4/tAPQPdmXc5/I2A+btT+dlhG3AwC/RY5b4NeTaCFrpj4Gdwp4htaOBLk5ttBMCGgiOFsE8twTUgkKK2IJ7/BLdE7zXh7lJAVs+K63LgiBoIEaiFh5PRg+Jjc6RkZPIxDvy3K1Kz1qtdnIaxZxnBhvkx7HLho6p8rg59vMrjZYh5Q/W/ny7ksq/pKKiZW7yAPs1nNKB2hxnmDBxePFjRlD4jhW8xBoWghjyYXQabIqG+KlWCiXRh/Rzv5n4o1RofXbfXNVWATwjwEZvlxZjwkLdZ1Dk78YFTirGbO4Q9mj5u3rd3kx839WeGvTZJYDI8Iu1C7ZGAWup90X/r+rOKzGemh3Iya4/rgOG47AOUTpuUh/jlwSABXQyx8AUUpMfM/FKwpqbWyj7jerwsdMrYax0ClsSD8QRM2FLNZUpbNYfMKRKMrO81GQfaoj8Ga017MAOoS1CvmtMuCzH1i8n3hkfav6AcMp6Z0fJv8qbuPNA2Ug9vg+UkTMt+MpX9olosWdrhBbXgAsO1nnu6j4G6MvM5jxJrJ4658Ug/V5Z8RN/Iv3yFJXw0QJJ8qQ+S2m1nT9fgyt4rf3CGEcd54WwNkVQKegQ7gqAvx7tlQlCF63mcEsFV1vlTujceVnZhMm5/MUEVtGNoI+ws9wXHp4AlJRpH6ghCMopHbOmq1khCXmDwpDN0LWwZiAAAAAAAQU5NRuwHAAARAAAEAAA1AABaAAAUAAACQUxQSAsCAAAB72CmbdvkIiVUtnsRERPiJ52Ij7UkCWDJttu2EQPStJLQpFxZov3v0wXCA2J/R/TfgdtIUlSchXpqEVQ1s1+Y/utC/r6QOsKt3ZdaDpFUkdaXZVxV1/yKtflPhcLg5DRVK4OsefTtPTGiqiW7zcj0puaqZIOiGrXCan08S47Zee9DOkTl3enUWuvr2meHN7h5rIJlLAT0w3g4lNrGKlsWyenuSU82FjLa7rzKF8Ro7oRsSFZ900DzqoDaXRwaSKJsKaAHSbZsOFUb7psND92ETwngWL6zjiFNfFzJprJMIuhwRR+DPTzrcBMfJ1mv1jCkaiU4kwjdhE9JhYtG2nB30kiMSeWIqkA/7nEoGNKkssbJwMc135X1fXwK8u+xhrq6j5sHpmo4DEaO2d1h4OOxEF4pnzuYhPrk9CpHvaBTsSy6UiJl1CmFu8un9PRTJP7dVEJ9fJ5P7ZSC23o3BR455i/vmNRyHA515RJS0On2L4u/H8nzKlJLfg/RLnQ2a6hQ30vMU0mIfecq2UygPFSZz30DOR05m5PohTYPF0Xep2BiYt9QkKgm2bWTNFChQ98wtzDbkTZCi/F5bCiIVBP2Wz1uBgnhdNxS4FURnoHWUhBOlVPYviOIVy7MYl4JGN33wCMrQK+vgs2d0J7T+ikFkefQSO+Ck+ZP4Y8ssNZMk/qalxQmi0X8h3cCAFZQOCDABQAAkBsAnQEqNgBbAD4xFIlCoiEhF1i+dCADBLKAYDDXfzPohsC2q+xjde6qIc7AZ2u3Q52/0Xf5HfYPQA6Wz/O195+F8JfCA4g7P/2flf3r/BDJxu/HMv7BxT9yTxq0y//AeqX/hf8vzMfm3+f9gf+Xf17rM+iN+wCk6Gi4K6LALEzSOrkf0/pB5NSKA3cGaDjAqCJ6iKZezGsHDa0C1Z1IbuOQ3Ue7Idc7sm0U047QBMF9vUUo5277bGflYv66kxvbfOp0q2FrsKRP7mBCV3mSMCbZgZPfsaDXTc8xiX+UPLzKQaAewAD+88Jm1af0339N9+rJzy70Ts55lg3z553FxhKpOU16JsQzB+NvAPHjGX1tT9XlPU4ighm/2/Kkdmi//I83BI4Gc1d+SLjrizM/MFX+9XP1E/51mHwLGR2Kw03F/wRm/Td5wj3mo/LOibkZ3FfvkHkyMuz45d2aAwcxSCxqaUt+2lmqPPU+35ZGDX/6jEpY0K8SNkVX7H8CYeenXmqxZZH1FelYoN7YCUZeZejucIDK895xXmPpMlgJ48E7vIULO6lWvER88JZGdF9F3kzOcck43ABUvW7a+KA2yJXBeWXFqMwLdPYSZZ17UVdahqqM2kwAhE0bOuITOa/bMmFFrmk4soS8Co92gdCVAmLQaDPHTRmK33T06tEMrCsoJAt2AEwx2IHboOYwSXb/1H9mYi2PNd3ppf2k9SIjhtrhrt4O3smH8pBULGUf9ZN3rId3RmS3cIKqXejuuSZGltvElTPBuBpQFSvdD4j8615v0VeVqmecl4uq9CFaxN7GiAGa8SJiXT0BWMKMRbaymmlTWPjmTUaKubCn3MJh9V2bqUFXBhKShopy6eUcdzyJvCCTaBA3rqTKPFIlE3m5tdPCdCiGhVJayg4O2j4E4GC6HQDA2ghmehNre7PTeZA+CxeWOLsaP2VT6WFGEik6FHtxiDS7uxtiPI07bAraA6kV4RkdM6dARFZzl9jWKsCnEB93GfaSAz9C7+i4JLwdKLFkLcMhhAFxOKEjRBNAaTeQUwL0z9QaRlyM0xgSTTjV/HpQoWisrssK5RGumARRHTb+3ZqlK4AyIom2hCoey6Vh4TgFcbC8Hgk+KjSxHv7WZzVCw43N8auUzjIyCO3/9fsjQBHMUO1lZJlArUoTP0RveouhjEhFVTcQFQtp9X5s3dLmdrfPuX5B0dqemfXU123UCbnFtXysrB8VkQxZ1cWmhTf3tb27T1+cBfT/ykmufcJSVVWusdS//pdg4KCbrqDFvqUNcYjgFiDMxZ7+BmlmeswL1v85THmrukz6dec4/Fwvs8rHy+rjbu3GGDSQpXwU+BdMHUhRP8am+8BvKbroe77ox8YesXYRbasbinR0Vo1wukP4ViEFA/DrWHl0gjC0d7Q/nof4gHsnjuTZW2Sjyei9LIXYgbif3SbF8OC/gQj+bvB7tO7wmWMY9rjnYztBFDwY2XblKIDTHhb4wVYqzZ3hbQPoLJ/HEBom0WSNJ62HtUsaypDWythh9dyAcrRF5nYuzT/gQNv9v2xQB9fQPEicw5EUy5aQ/o6+jknMb2S/HZJ2Ra/XeA9d87BOgEKqqle7/5Qn9eojkmUvZdXWqx86obLcP5+ozcvwb9895CpDyKsvtDX/cPo+zIu3bg+gCroc4/pMKGmwlbKLsT/xondPCQYHQhD4c4RB/AayWyPGBKbSJoHRXutKHuXoLUhHi6pk1NcGD6pq5iD4fk3c7eaVngVf1obGvlZLgfOvjltjE4Xbo/ugAyyo1CJZyMQ4af+YXQo+hrY59fZvk4bS0U7zex0l1yTR/+aOBDpr07Z48R/iSesc1VxpAqO9N3wU0tQC/+NN/wgb4jg5JhtBH90PkpyTWtotwWnJhChYkH4reiJ5RVRBdArIz093gusgUMbUEtvnhMCYNo96gTOzyqDhQjDGrktjDAAAAABBTk1G2AYAABAAAAQAADcAAF0AABQAAAJBTFBIAQIAAAGQGwBMazlqaKDAcZ9IwQ3khAMFjvtcwmmgSIEaHOTw9Z5APtcRMQHwP2rc32Y9c9z/rk+TN2u5Tiw+1EL5wklrhcGhXysT391F0+xaZUOBpW3bkNdy/R+QtKBfyyPX3VqJtOQNzWopcNCu98w550L5GNcwdcPovfdBhHEB667jho0YJ1jnwtOnpXUkUYxCN56W1vugmcdGxFeaPgJI2o80v1kR1xfIoAS9jMd5zcokml9ANi+QtDSv5EMAHSOAkmqUjABKmtWSQUnzWjLImzoF/QTXp1SjZARQUo2SEUBJNVoSKGleSwYd49jqGEcGJnsU6g5mJxLGa9OyFH20WrrTUo0ar4XakVFCowYlRM2uhYPrbkbZgzVdes01KxcKbhotewO2cQXEI9JWLMECALjOZbGItLnA4S1JKiJtz0wYDHqhiCSUie1OJiJNa1YkIkmZyhWQjEh7RwuHXOeyRETiseRcjnOwsC8JRCS+RQAAAxs9Muj3RST+xMPuRGx3uyISf2Jhf+aq2ROR+BMLgoXLsDMi8ScWBG2TikjsOLYg6Tozwjb7kVg8MjCnu22QGYwgHIaUbwcwgnQmtpodkIkIa4B5Gfb6jzV5A+KmyoE1MNN1ZoR9kzd0t5hHptnFErEFFs9cVpNWezgOoV/NHOFf49isBhDqT6zBgEJ71xvYDwBWUDggtgQAAPAVAJ0BKjgAXgA+MRSIQqIhIRn8zAAgAwSxgGbAvH9V6C7GXlfN85x7+fr3VA2W2x54r0nbyfvQldQ/cvCHypBVz4w0mzv8N5zYeL/neyd/lf9LzN/Un/b9wn9Zusj6HP7boPl0hheYCZwFmK3bdKxF3ODcDfbyIcuiizC3wl0Ff91L+Nh1BGmxmsWXwHDl8Ahg1GwrnABw+7g8x8NnMyrF4RBmnoIP7Kug/cx3ze0xWTKc8BD2dBAA/vJEr13b/O7f53b9Un5lD6m91PQ5T1sJcs3m3FPu9ZACmjVRg+nGRS5lXWQZo2vfgZ9MTA1fFtVWbo5IrmbNmRauQLvczva6EPJzCk7xL/TwwUrfLcBlLiv5lTwVjkZ8w5aBbUkhzZ1VWKoUN66HJRUgDDngxB+yCB/Y/41ixfmT1HaHGuEBZMfEVySfh4ToU1A0fU7JVBA8qi4FvEnXDXT61uLG36HDe/+YNjWQcK+LgoR0gxYIn+1cxtu59omXHie7Za7yVAEK7gSryJhb2i4EVwO3hIGlsnCslii0QH1zFLO24thmwJw2UrAaLiMKLZ/4WBwqOW+UAdTm3e9ciof9p9DM7YYPBRN/CuLb5xPZErAGX0vhsAFDQkJ16ti8uggEA8+VjPF8+K18GUVyYbHT5ILoIW0CMI3d6KP3JBsC5Ibz9JTZxP1UrzqqZczNBMqOHqygqAUeQcsGYiIVKVXI5AliUTlh/o42+dsBjx0xxR816mZ6s4mr9ZS+z27Cff0SdONCNasD01KIjdphsn+O0Yk7+vYHcvlOgC4HGLADH1qrKgbS7SIz1p6LOHwEEnIjEyvcqnfeUcEYKFxQ0xaunC9/TsnvxlJyObxq/57GKbLwHb/cn6U3+uxRYQ7j3/ClWi6SMh2417wEkvi1myQIPdIykhsHwbEGzLRrW+DOuRFTjxAFeYyXSUBL7mdrR+/xlh9JDtEHMqrFFng9AyUkk76yCoubfxsPjqPhQcYH97d/f9IMycm4BZtKT+xW8ADw9pUHKpKW7mHJ+zGOZD0W36vQ51mVfdcUPp5GAA/7RjIeQfEsSVs4DLNB/6+BYVQhhz5i7zBa21PfVoxvZRi7QeXQv1+pHoScQpAZpXfDHwVxb9P75jzbFZCBAQR9NO42bTy8CQz3EJ9ygCIitaTTe7GAE5p3sPRUHokZn6EToao+XNzf9ptUJlhhZ5ZFDDDQuzhPfMdrA/f0Ycu3Ypj4uCE2/vIXV1hmWBj/B3bvocZHe3Vn4Of/hBrAfakq9Yghx2JaStjeKcDE63TMX2f3iP0uBQudqlT408/mGcS/GyHfZVUuaVGx7OrbjTXanIT0SbEq9uYW/MGsn+kYjBv/Br8AzaGlpWeRcGrYDOCnzJT9xiJl0WNVnRxHmuALRmYuKnxTYnxiDBToJlgQDnaUh8c5vieZvj33UQ6lkFQXz5NU6MSDgMxP9C3QXZqVqojDzeKCyU/NpAKkCfOfhRCb7qyeN39+GjC9559UA2TVCSmOwy516LWePLu2Sujtagx0uFcyMqR+m1H7RvAy9H81fh6dVkA6F1CTN6Q1+YpLpxJQIrF/B+FOh88zpKO/4Zas3v1M8u2FbX4AAEFOTUYQBwAADwAABQAAOQAAXgAAFAAAAkFMUEjvAQAAAZAbAExjO3JQIwo8UpRT7W0oTgXPYZv4E04DRQpoaNTc8QU4lRExAfD3enfbZUfzie62kjdcRFWLWyfTbLEjwuSUO2Q2V34LYZ3qZ+N2VNxsor+DTOtEmD12yGyU13GlI6xT/TrFzcat445D9CHQNKLH7WtJqaqe0xzoTh2d5zQIneNtS6VZ6DnZUdi2VEpT+2CGZzq6shVJGyZgHXR49WYyLpMZt2ERzF0ZFtapfp1MdtzGJGGwFx2aCEbe/TqiMYyVEWe4TPawjMBobmaJhrli1RiWSbhMZRhP2UhgxmiT/RRiI7BM9etkmiOYRJjTV4swiSsG1a9T3DoJJ8FkcJoFxKC9wWU0wpx4spA58KwZNJ6Dm1qcNqYJRI1bjjwsWqlqphHoQ6zXqenrUXF2FFLV61bxKBNwUsPXNwDTUSYjfFb1sPZkAleOItj6s6aH7XnqKK5LbJ5m7T2LE5FU7U0c5vHn2luFwNej6ofgs6y9iQHAlSMNI+isaWcVgr6aeQAn7U0Mu3hWSkkiwROY4bOqnVUIDtE5h7BvhGdNOxODcU/ocUWPqxAMq74H01FisO8orgfCXhWCgdxsfFbVmhiGitrAVlLwCEugQxhuNuVfW8J1BP5bxHUo/w7CdMBpp33z8wFJ1paYYEkfGKEfAFZQOCAABQAA0BcAnQEqOgBfAD4xFIlCoiEhGAleVCADBLGG2AKkJt8z/tnL2dFw8HttuzzwHos3iveg8AA69f734X+KP31Hvo3/2/lj3g/BnJ1vM2XOJfggPFI8c8+foMf6vm2+tfYJ/l/9p3yJUyCiwberqwdz2e4Ju0PJuZLEzjy2qi3fmLUM+Jxuc42kt/cQvudJQWW6HQofrL0pdQpS2B4oDsGhp0VBsollxE7a7Igt3D5mIS/4i5pcc+WV5ZSxUfCYvLUCVZbq/3r1AAD+88Jn/2tD+zu/07vp2f/npnx/wFjvgFdZkS190L1MY7+Odyc/MN1xTFxdNjf5fy63dxiB+6tgKX+OU4e3sji7JS0cOLYlyOLOdSGsu5yvLG0xiAwFtafWu4CaIBaYbZX/6J0qlMrh5kyJxbvwWjMcuOTQRVr9vHz/zPCdQ/97/0sGrFkei4AWfSiukahphOOZ8iMYTIRF3qVPtzSdbn26nV7VHIS/D+Ptbe2xrdZ2CYLQ0N5wcPkOEUK7Tin+oG7qliSnls+Jv7w8siZIEAj2u9ru0UW3ZEP4H8AIMGB8eTuv0MFjzBZOwpzfyqtBeA2CysG38Wk2tEGE3PtGbq7afoJuIWw9bjXyik2b1/6pm64WqwtUckfuxvFhej+hLxlt13p/fm7pFN6qXmlDwW0wWaGsxydie0EvEwnJJW68DEjD67l6VyUuCX/g48qD7CP8tPs2J3Ez9xKNhnxfV1UQ4iJYR6NIZiMuiUwz+A86Jn1U6hdw8l5H+tOAbfm8a0jqqiBaWtITbzcJsqnlAG8chuWZVVoXewRDUZA1pMT5Ys2R5/kovz/hom6Kz1AfFZUL2p+NXQEJrXYalRCmuWvQYD7TadRujhM0Cwu0rAdlYoMRiruQoooMh3/YeY5yNJ4mCjAD3UoWn6bZt4fVympyhDJIO5+B5j/FgWv9YFzNY5jHatT1UJFj1lTpiNiw2P/eborur/feFZsWlrxUMdqPY5zxI7enGTeTp0o/CzheV1BnJKH+g0CPExjZkuO47QUbqr/hHWspGcG+jMjt9puKNlhckPscRRlfffK9Ti73VK7aslp9NoilcwVky3kLd76aIowHHs7oDm20/B2YmKciNrhDSUxTI3lVCNnQ5O641cOsx3j+hHXvJNGLMjC27ugIsc0KF+pqt9E77YmKnK+SWOg+Tc8zTDQo4kkGRHZDR1X9Ohhru9yt9t9mUlzEN7oBSxP9BpJ3pQ93cG50/QidK9Itvk4DDRPXQ8Xyr31n0fKj8vF29knzewkQPtkOTrk5MqdTaxqdJe5HMWuBOL7+xmkMwVevFauLhfKAPZD6qghzjqGuI6fWvebKgrgeOfLqeSYCHH6jIbemEd04tur0L/j+BMPctoIJeZGtVuoJmGScbpdbtS29KiZ5qIwk3uwztfx0jrf6fnwsxcNrsbMofkyHynCgZ1+V+lPVEKjL84SHt2Tm2sF3WhPGU6wfOLEHcX7IjH2AmMk2ThRZ+/vKAt5C8uFrMfcphXI0ygpd3vXOKdfj3Wp1xK/7y+fX6eBuH/tQOvIxBPq9ZugYKoR+rhmV6s08eYHPiAbkrRpIzU9I9eYf4ODSUTipnepi7NMytXFWLsp4Bv2xfxsCuUszyQZj0pom3tRHNwhd287efRPpg5NLYnG6swN1whzqdw46Bki1CeD2P2aAlDABfrs8DU1yscwAAABBTk1GxgYAAA8AAAYAADgAAF8AABQAAANBTFBI7wEAAAGQKwBMoj1ZssCQ6vsotQdShmPge5+6UHsfzwBLKtTuLoRfOkbEBMBR7/w/0Z77UP9ZluiM+dpXf94xRm2tkbHY16s3lo4CdtNksI1lQzLm6xEgYZrqjQWZJvUjoOA0CYznaRxviMZ8XWsEAC6ECeSwLJml3bJCbW293RrnfFiW0hWZBqCnuGSu0pWfoRo+q60PZadGrY+V26AdSh/MTst97KMzqOdhUS+OaqRHbRA7vSCDMuinPrJxvjQgj3hODgbiQ9ErDsbi7abVAgzPWgnGB9F57gz4qsIEBrGoZDCZNCTYCKJQvQ1fFQrawKKQwGjcJ8EKtV3VW/F1V8FpEkwTzQTZ08hM6nvZWcGyK4NVX6ehtqsFK7Hvj0bwsK+RjVBkX/UmHHfF92e8G4cXm4bUynkJIxzF0ro+OzVK3PrQ6pUocR8tQYUSd4NJgRL3rfIPEQN4m/v2Q+KfnMNtGYWhSN/MyQHdIQBfx2Ao0jdzIljFMgJDkb6ZE8HWNICeSd/MiWB7EDX3sW/mRLDXce+N80H2YdkgnAgUQ4rkAMtaXoG4IiU4GJnW2K1Q+0tKQBi7ofoVLF04B4TRGnApBQcGVayeqIJM4+t8Eqbp6X8ElmkgHWcFp6n+2Ihrz9Cai6X1Lpwc2EdKz4KDSRE2AgBWUDggtgQAADAXAJ0BKjkAYAA+LRSIQqGhIRqrhYAYAsSxgGUcoK1/Jb7jybfUcdh94OP5YHRr8wH8A9HH0Ab0BvOX+XravhX42/X0dq4P6qIeWSM8ddDSZX7x42MdXoVf6Hmk+r/YN/V3fO/2ZQkTLOGfgnK/JUjz3ywvrljOS+bprnz2d6fKpK+qud7QL0BOeEwgiPUwtQAdPSJcY0QAM+Txi7qksLBTI6C0g7AK9ApM/7SvVeeABUjWXX+vmE+hRokc6ThFmpZ4AP7yRK/13n/O8/53n1TP+ZSdZO62h+COZILkzk+3RkTrZK0oIXyNXRzKE0ArVbrhxbqXNt2gP5ZsC1dgjWvZoC8H3W0XYjVHgeLdzcxSEJQypT6FD0IQS+oC8WMit3GJGtfUQN3aeWce9qd7Qpg2NdHkDIcAPszUPszO3ohZloPosVO7gsrenuPl8NiSSkxh4IbFf7T6aCFU50ivXGEbslhtvi5hU4KXfB6EHkdcBA6hhi7TGr5WFXtOMSLjkH6BU9ZHWM/UnZFikYEYCuxTK1TeULSsj+RbiwTKX5Q/G8tGgrNgln/0y9n/U0DqqXAgRNIn0MGkECWpTtWvvcP4P2pCt8Bj5x+6tv66DHcf2igh2u91THscbVTbeCbeyah26gK4wHT5qdPoWW90uA21ZYUJLA02HhwjLxLt+dHzWm4/U/0Wx8ffOiE8p7V2/4VOvNsvVP0X0H3dJEvOzjBI10stals8LZJGx03/1hQCFp8M655dMc/jRW3a3z3IGjJwY7Z25xiNzZnwb0g0Y49ESya5gecWLRAHlOoOh2sMKz+lfATSUgRxOqzA/ABmI+osCL58WeL/9c4b5qN+n9BgsYWjuKmwpkGDCwA5Knrzv+BO2549J7Jzv091c54/N2grXkNkQShwEley7pRSllgaOGLXN08BgOCyP1mHubv6GEqpz0tLQypZ52Hg43fr25btAXXu6TmaC5bVXO8SQJ//zLnzVCG4xnOSQCK7YzC3ZfHrTIexpELwiul46ZzWFwQweRJ0DsoFXJHxH9jrc+4YW9xsf3pDWUMOKbPWGj4FWN3dqmFIG4v4IXPYNrm95ZmDza+vSjQ4QJKRRX1flZrkePhYPXYX4CG2MACxPi7LUtmnRfClGSWmik5pw0XrjpfxPI39Pg/LoE83y+qCawumlyamyP9SYYbB5KlAF+iXzSI2qy82P5/aX/Lz+Dnpi18BbyvJJs7l/EVqDiX3adCDyLO6/TTA+bj/dryfRTXcgFYZcJi95VgLZTfLGu2mAgofwh7aJYzVJ+Zzgi4Q0fGWZu+vE8J7hlr97GmlL7X+9gLYD/eTNKjYBHqhlzLS7kGIzbEUiAKQ2udagDtmgNX/Hi1Hkt9i/PRMOhGnNlWXNFMnkZHgfLdTKhdZN7/wKDGByILTQ8TAnLsgI21ihD0JrjurPttaSSfnmzCuXOGGkB5OPW26b2UEmMHojCD8fZ9pzgA5gPpc3GY5cM1pgrIIaUFSWckJdMuPPUFE3cl5ZKL7Lm2D588czHoAk6n34wqUq/5q5nVaZcqOCAI3aQY55HhGt2qZp/Q5Wl9++JGrqbIMy97oBEEsj1vtDPBMj6UlyAAAAEFOTUbaBgAADwAABwAAOAAAXgAAFAAAAkFMUEjhAQAAAdegoG0bObhICZvdExExhW3yEfnYJhIgCQCbtjE1Wus4oAYm//+lBUdQOkb034HbSIpUtXvQUEcNe19wSvTxTu8MeNnuxB7UXR7rI2m7KCNu9Znl/UCgDKBnbFEZpb4A1mCGwSljMMsM60toqcMsM+1myK+hZYZiWz6+Cxblc+0B8H8OilOgRaJbnMrhY8oj1WNOspEXIvQ9bntlkc4CdMO6URVwCcKfXoD9T+BFIQaBDasQWTIVpc+TpNZ40OmxQewxQ3Y2T2gtQdQWfGCB4Jz6jU5bwcB8gCqNfGoe2lO58OpGexirz0iP8rpRbJQ9aQ9HizUwcDxWjqx4ccTyaEmZeTLDYxZZnJUWgXqkwVUAkBlKNdMaqihEeWqtSa3sWN1sNnjQq9jKbjTqfOauHGl8ysN05W7Hoe/4ujCszasNvYSUkaqUW2TGc78YOoBe/FrSmdoFL47fG48Oh16Wxe+YT2WthDkxGrQI4mktyT98DvCNfuHgQoeWgbewC0cqH1vknbbF47eyIwTJTmDA4/PPkGQ91yFDKjMsbNOxVMg3i86sZf6ReGl41Jo/ohLa4tsgCxaCplQ78feTAjKTitv7SYXVDG74rFINmCUSvJ0UYacuBbjtlRC806ePjdXpAABWUDgg2AQAAHAUAJ0BKjkAXwA+MRSJQqIhIRqqBYAgAwSxgGQsy25vOf6l5tFobZsRTb7XdLAounv5rIG/1HCDLmMt8Tel3+D9Kf/Wf9zzN/VPsE/rTvh54cIEJa5dRRK8jKtyuK4Vi7GBR/c/7AzbH6z7liHbERFyxnH7vPYwsPNAjw1vxeTjEWxj4+neIsZZjA1etJ2il+8QZ7MGA2gAiCPm3xJ5jhWM9hU6Q6stb7K3VAAA/vJEr/Xo/6M3+vR/Fj/zNHfJsNsGUdZHw5CzbDh+oEPlF/T/cCFOVGlMW+pekWfaV0VD0KatljSmBy0JQC040+1nXfiin936uvCNGJ4lHiiJMOcawtPjegLJs4qcMRKnpxurFfCR2NRHed7csBbf/9b0+0r/8eH8a8/+5P/5/7h3zh8/v/zy0cY8HBwr7hdlI7WmY6VtqoGPQxIVfydYPqGyEG26LLdfu2pqIdT6fa8sGERMroukeJCT2jdCBrq0AyjWVy7Bx2o3D58qgzEyr7WDJctdkH6SigGSDbwyU7k7t1UqExHinR0gqyXGPGov+r0K2Ug78a0WzCXBe8GaEcmbj1ORFNzbl0yrDmjU/Pp3XX9bZCHaIunFhanqYrvNZef9vlN2giWY7nOL2arX9gqtlA2FCRvLI9/TYyhQW7RlA5NUuL8LKYi8acXoDrBr3RDin893N+1WrW/15Hn4Uob1zQnIwptLINMkoPAFxZrvImsH4rxSxnPMRZmlqCk/ntntJ0uagORt3sKo1F3rg1IgA64Ped8nwXzvYqIgANiWJ91MIFutjk8xqflPeWJoDj/Xkm4/Ew0hr3pJHb8rM4qNibWrsdcQ0/ElsJYuMQAbiP9UkuBGpwxfdC9v1w94hoWyexvg6PYL3/qThwdvSYvKfDcV6EyqDD+PFYr9CT+ek/8Hn0HXWkFNqKOjMGMkuk9Bti01jfgr/LFSC3JzeV9RRHtNJ2s+O412rnlJ8tLANmy1SpT53DUAL8yrBX3bryYpCDddpqAHgRIFvUIQhWq+OyT/p2amrr+fPLfL9d0wLj/ZQRHjT6Ohq9Lrle+1O/i/C6pMlKmciHYVqPkyK6sw17mRFscuTJg4naIx98E3xpcFRsk6MaFgPhRqHkX5ZpCRF0tjJcJt8jWsMuMvt2nGUOGAiiOZl6zVeqkyXx628ghFfBZMtnF1RrNOsbGr7SAN+PMRGv+mE/cvigBDYlS05rQTJa/iznI0xx39Y7/jUXvxm/7F8Iw41tNJeqP34j8l6/9EU2PvKKB0f9U9RGuupjvQ3NjOcYBe+DsubdrbhqPT7ah+XMsZoqldfqxlqXOC/YyZnZAbPbCPlctuGdqDjfp7x4p+sEWUKzwhYGVRNLwm1/ywD7Wzk2YSW2EzpCK2VK/uw8tcG8q0WZ92LpKcoaarKWa1zvkV7J2vLHDR0Ugh0p/RZV1u3qu5MRelZG1wnitrL31Whcb7b44qcakVmt5Iua+xtkaulJ6TPWQpfuFzXglNYGnz/+hliv/02vHILwpwAdGTbKzBbyGsSfS9+usClHmgB1j0eTLX9PxV7lKzrR+oHRo/fhAGfvrJt/xvVems9HcSVzZhL9TIkpw9ehQQlHF6u5mjwBp1bmUIk6v3GLBkyMH5K1k8WZ0CBXi0jrhES6JcAABBTk1GLgcAAA4AAAcAADoAAF8AABQAAANBTFBI7wEAAAHfoKBtGzm3SAmaeyMippCffERW2E4kwLJtK06UB5RUJGDzFCiY/0QTxdfY1V9E/xlIkhplcxdIzMGiX5heIhm7JtCBz2VNuASnIIr9LtUj6KEn8QI4QBSHLU+B5hVRrLytNoLik9m8kK0pKT5p8tu15aoiwrPYUobZGZ3rVNMc89/ZiF6nUbrxopMMRYF14dD6w9RmPvn6ZcFSOynVX57dJZfWGekIbC5jAA2TVXgIvHLhlepYFq6dh8wbRyYS10m5EqYmV6I1qLgHpqfR7Sd+fIYjdYBOxN08DjvibArD26hAib4SxiBPaCqBw1W2RNLhixWt9CRTUJRMUVEC+FjyGpq+KQ4i9xKzHV6tMZlJ+3xaVHOeQCMnJ6ep1gASudRLXkSdGeZ2A4UZjI21d4UGrE/XUYAV/AgxLuD4K0JuBuNTrl0gRdL2ZLrdfGE0wNyeHN3Pg004wXBb1+1h9bbLRZqBuK0V422oaxgc5Uq3/c27nAiHXjA4uImTDT1QHGnwNvGhLHoL93HSA8l96wwE4qs5rTIB0khD77qTBWeYVEUB4M2mCjBWIn2r7bwFWcIpdtL7E21eHrZwf+zEFQUDCfkf69MpIigoagqCyGe4gNOGl1IE1FSM/yfFt0tueVF40Od6H+knBbELMdz0JgBWUDggHgUAAFAZAJ0BKjsAYAA+LRKHQqGhDlWuAAwBYljAMnBQVw+Tn0/zaLN3MRAMJf8v7znzL9DLeJvQA6XKu2vyXhT4jveL9ztTvoeF34A4it+YylxP9x14wHiWUAP5P/ZvVV/qf+/5mPzX/RewT/Kv63vsX67JumXh767xXSvLM4D62yoBbVelYnxiZAIJT+GWumMzVpGjDYuOqAn3h1XXR1UDnMC+zwp6m6AGDdvIkLMstRjmtbPvNDT8yil4Vmh9vWH9qOLnSG++pqaMpiL03aBgFk/UtEAA/vPCZ/asH9Nz/puf1Xv+eVfXfmJ1xf8kD9q77vqQMCM7YE1Y9CU66xx4WCZ/eQ0n1CHLybNE/mUEklZf+o7PpftjccmlNcocufwJy65++7adtSS3tcPrIB+WgGL7hJXoPrYcg8FFUSG7lR13C4pklg7aiDzA+ba9hYB92tkh4W7bC3zRfbEtuAZEDlrcnMT7JTSrjni9HB74axda2iGLXNN+vBevxBpsSThYKgyOAinAHqssU5KgoSYeLwQZ6IfcSm5XQfFY2gmOyhrUX3cOshOtwy9dzcnpEzH90D9b3TDK4djR7Bm68bKYgA8p1chdO0etNvbw3djG+Ya2s0qMY9k58S9N10SqydYSX0KHtk1HPR3vGyuBzWaBJ4ry/LCSvz6tVnxYzyvdfYngA6nojFx56kdahswr5Sb3TFz8FVAvPM/WmB2abNQWgjyD7kJgfx6rTUOS/+//8z6cYMGzcLBa7xdf2c9GsRQiFKwUtb19vLVUq+lKpx/u995NzjLb668PPQNhE5/zH7ongWFBBjwG8a0EWtDWktbJs2bumjByr2P1iGj3Fj06cWEtH5oHXa6aNMx7QrXkziIrhNAG1TFtsSYfDf2BhWR1foYYzQUtRN1vmuZDFv4xwXtciyrO52t3pB+bFiwJDQWgzuaIvwqig/YXrZjfqBv1L96kD775B14RbmiAk3S/HsAOVRZ77fY+0AWOYB57T6X720qruZS7kA/sshQjgtGaIuuodMxfPCKv1APO6ik13f152ljiaBH+40VvYw/DiR9DiJiAC+DhH3uhhgTEUp3KDn4fwdMGZsOozB7TKZpbvEUx3pb0wYbATWnR4oPLftVyVs2ggObsXOYt/2oRbg98yaCd2ItbKOJ3bjZ3QCngKYUeZZVPF5USMiX0+q4npr+corgYFx5KQZ/npiEgv+mNvv3+KQ9WF7zNRKOp3a+XE4yRYPWE6KdTYyYEmC/SRj7u7LBiL7Tmee/uDy64aRw6WaGmj/+6u67HbSiPY9J0brT3B73moVbPjqj5WY5N/84TZciXmBD4X3NTmrdBa1uhTPvt4hPJAHGhgWopVncMuggA0YABePBr6N/2ZD6XGt6ANTdLidD8s9APlzxj0zk0YdEtf+jX6QWsSd38Mc5i8Q3J9o6JBldcwoEI2QhGQmdrMVT/8NzJvZggxe5grEIDadR4UO1fSk2k4/kld1ht1wVU4xla7ZmpE/J3ki/nZI20IbznhP0gCUQoGedMQ0eMfqu0YwiNtBBahyywavf7iHMqTPJIYAcU0zp5rnuMByIEjofg2MFAs06VKnoAAZH+1uQVKDZZ4UaAwdtb/4EzZ+weNMKsDSxA+TnJbBVAF0Jl6Vxm0TGwe/A4v+770f2X/mJVb3GEP2e3iVLsjyrYkWjooJOiaFe7xuq6eR60VF3UbCxWbQjUuEmUw05WVWxLaxHlD+56m/xAsFKOAAAAQU5NRiYHAAAOAAAIAAA6AABeAAAUAAACQUxQSOgBAAABkCMAcGopbyVbJMXskXaBYDWn4ctLsXobXII7HMQ1RaZJM2jeCE4TEQ4DoG0bPAPdRZLzwqDW/GwcxxkENxi0GX1tWPMY9ZHo+1a8IbK+uNNBUh++GCLUDmaGQFAH4PeowcBOPfxMr5UMn+nyL/e1QjV8Zmw/zms5K8AGzC6fsgHhnUJU9F7eQabJdsVrPDbAbMxIjHbZSb/kbMwVidlalOEskqRhlMaLCEmYVYQryMYV2Vq8iDtHMuxIw0WGmTQ1CBU7tMvO6ALLTpSGbGLvEiiEzVZmLkkpTmM33PRTouvY0eQ8AGXaggYngV72N4BJ9vfFThlCFSq6Vk4GyZtf1HVzWzttp6jWDEBW3tc89JhRO7xECopGZFFqjxRRJrmtgJYRRZRNsWunlRQTym1AakQGlIdZPnxLotpxmq3tFCTisPiwTzE1frU5sztBqWlE1J5hY1EuRKFG5Q7zUODjmGsj2S7BJrJexD/naa3W1ttxvIXJ8yK61bITQ4i5fbtjOTpHTnBhzSkG/32dLAlYcdQu+ymft5rT5I2x86zoxZ3outGFZSfF4JQC6XClW/zTDLxm+BZveM+NoAaWMNNHqIJa+X9FqMFQaNFSSJZCdn9KQvFmQssG9ODf1C8tRzdYNB++tG92A1ZQOCAeBQAA8BcAnQEqOwBfAD4tEoZCoaEOVlIADAFiWMAzyWB/mfPgTK7p5qlqbPEiuEzt2/MB5uv+K9cO8l+gB0tuAAdgn+J8J/EP7QQB/2Xkl3w/BBO8TR71XVWiVfFrOsf13kk+n/YG/l39Y3y39pFM7z0oAKFCkhY4ixywUP0CYPF5WnHjC7sC7J1HaeQgJ9VP2HQNgbR2FbSO3/ukpqqhl+DqzUINlsKRRk6cXHCOvJXp+n9/iT4sVLWjbqWstoQubPNCYHN1JmCBwMAA/vPCZ2rb/Tgf6cD9BbzzH5Z5odM/5u7/De9dspdgoymBeTy+yYi39pu8/N9BH8h6I2vzQgjADHdOz/U+vuvpe7eBixbEh/q/CYK7rzvhn8WAZhwypFKN2Y15p4d9d+p9Ujl5haDYY0/Izffrb3llAeplLtsjxCOUXqa9p90pCEnEYdvQIZ77yFs1Aj4ol3N+jvOfmGK2hDvrxQGfaMiC0R8aTN+ffbf7N8zkX8IcmBnHpvI9vRi7Bb+SLC6cOjPKj6q1/+uvg/gNEnKAcqWVqJhSl1CS+70WEdHBXJ+MKFjVhnx8eg4MppLbyWVO1qEXWFMC00G6UX2w9Kjw64ZTHjc1QkSY0RvJyPIXsdyRt/GHWZEzCtS0FFaZZBkYVgkMcQRg0KDWjq8govf8NTtNix8ojA5DeZb87k61ebnL+U9KXzsq//IPzP2OTdfEoOQG09+G/EFJM0IgZ+rb831NaqE5amEzLsb+5tqsB9EibUR6kObokI215WYdO8nW+P/du1a/yxzT5OaWMp3S9hFgeS/zX/n+1RS84oosfzt53qUgtalvaOdBFoK37G3BiVLlpOFvhN+seZwdAEGWHybPIDMR+yu250GaLN5NH9tF+skmJ+jV7qKuM9gYB+GYU2XKAjBs+DjkuCz1QiCEL1pNTQMqH8jO6r/p8mjqO908VZRr/KCqN61t5TWzw7a9c9n+X/+K5X5f+JcPAKrr0yhwVaR5V/qpLgo2CyGsWsVx/cgUlDyNTF3jAyYRrk3dwnEgpCHj3IqNaC/O838tnidp2uitp1SAVTfFGhVtOex/U+6FPh7CVLFqlZXIWPgLzg4bv/KaOe2J+JD9SXNPT4R6CjDIj6VB9voSXw0mkChU73DA5UqKU41vS/VqeoMpCm5WD6NShs2DHp4Tp1UgAt7ADUNeCRoW0Zd9Sm+44RFbcT4+QnzgRp1GCUq135SucZvdVObkNhH8rxV8VDpk7EqJ8j32PIfhIgwSwHESeL4nQg0y5nZcUeqYQRymH3evuHbM9MN666CVwX8j1ddxnG9fN4+u/8iCIjxZjuFNjrOPNFSorwzd/+jQtnEbnIUpPNWGJNUrNMQ+BMA69s8b3GxihkYO4VlgALLCNajXpsGF9iLbSefPbr3N35NFXR/UYJcDGdrlZWYkm+8WmALgSZakFGrEScpBkaxezU4zLZU/87OIF1O1kxMs2vrNjjt0f/qigrYlxjV0/aBjLtRMagutdbkGvaoMS/kIF4iCQO+HJQ+mQOS2W2i0866MOkYM6HvGwkQW+GP6PJV9rJrb/vxgBJ+z+DcRz+sSMa4w5dKPX7+guPYk9ACI8Rq5dTbxDFhy+jV979Xi9SMZmyHi+qc4C1mIrRrEHwMVmH3FWJsq1kvx1Wp5IGn2V1s2jPqcr6FrpTndBJDrP73IyZL0IMD5XVdjjt+9D/qBwXH8pujGfHnIcwAAmZ92utK82mHL4OxzEuy6AABBTk1GIgcAAA4AAAgAADsAAF4AABQAAAJBTFBI8gEAAAEXgbZt20YjQMonmdqIiEHEftIeIj2MjkQCLNu22jYEw4txQ0iySUPkMf9ZWkavpP5F9N+B2zaOZO9cS6anzNwTjBydv9MaFYay3JmH4BSQ2gPx3SmiFVWM8sXmDpI8/PI1gEETi1cwK+zhx2zLjJo1XfmJ24KqifhF2pp3xoZhrwTMQ8aWnWRbuW3yKhMwrYc4EErDI3+ad92lNhprYIfkta4OxsbiyPYdFjAwS0IWiuOasOb3gDxEdjRnoYImPhzb3Rm/5gjGqKjUMYKVSPR9iIdJiBnJvcn4biA4blENGKNsoNq2RU1UUDhmKEVnv2hKAqpqciOcdLjLTjRl8xIC24d5CUHDhwvIaZJ4c1IWqen+fmGmIqUQnZ2khNyVViLEo5xFanTldkdsTeEn6yGOHy/bBV/ZP1kf6GeM8pz7XdFk9BXC4emE/a5oMire5mksFLO2EFcyJhFJeXQ/5MrWzS+9MXRW/cCw2lp7n4JNneGcH54bEL0FlzJGgLRa1TIG2x0bHq+r5pJ78NIt3RT8ekCQSkmwadojlLtaJzps6G7YtCO4VPEhdY8M8fNBlxf1yNnM7b2TjLbRaFyQVO5lFIFTQGSl719J0HeHYDSvk2kD0oktW81/dBb/XxL8wv7/lxKUwaoJSgKjQXtJqZN+DVZQOCAQBQAAkBYAnQEqPABfAD4tEoZCoaEOVoYADAFiWMAyQ1BfqvOpZE6/5m1g7wQhmE1tv/MB5t3ox/wG+b7zzXO/2Xwh8TnvQ/d/NeRPefK+c60at9m8ebwD0B+h/n/eo/YP/WNJlLHNxe/eMqVlMFT/37lXTcbN77QLCR4qvyCKwtDShZA/PkT2uHFHkvaQA1vRB+s49gaXv10osdXSeXuVEaPVL//z+KgL8tSqGl/CrCMtDO3n8OvXVjBie+3oP/kgAP7zwmbVo/pvf9N7+gj55d9EdU+0dcqo8e/ktP6kR5w8C2yAOlNUZfiu9tzL578Zl3nzBkYvdhDIK5h8nvnHSS1Ji+fYf0GEyIyW6zI3Ka7KD+uwyQMGeomz2QT5fwnuti/g4CFU/VA35aiTAAcJABLOCZ6RYWEmgGhfvR3QLQhaQI/RhCDKUDsEIjzHqustkBZJKlDCz31smD2SZBcq57MdgdLO74QaEmWoloaIbfU2WD8JWr5GIjt0NW6Z8YMWktN5mNvnD4waAgaA6bGUCE1bPv8UzqSthZZOu8IeR89uQwGUFo4HIk9Ww++sDFu6CGfiYrXIX/w7Tl4fzzDf/oaO2KH1NmfSNaMZY6z6Osbzz6k1iau3XFs+/JQwhcJOzKqhUvxwilB0542CIX4hUMBfb39f84Ajkq7mooMNqSAnHfT3V+1TRtUn2JStyE4uYtqgPJngI/V6EfC1lpLVvH4fkii0M6k8gh9XcHkzHV+2YhvjafSib4ragI8zzCuTOp2mIjxtRyE9RCI2Zdsti8QKHgAgOyajT/kT2CMAfiurUfRTODQZl9VZqbuGTxjNA2tyyfL33OxgJglnVvj8LIdW1jlgf1k8z4y7G846imROPyXGxZZTPGvCqxQkPFTFX73xwFkc9LpzNdwOVQOseRIdTH9w/PNHQvmfP6iHRZfkCLJnZT7eJdkAf/sB/t9heVytcPH4pXpWtSZrCymsLtvQflFgxW2wqoXanen/V+DXZa6zmEWihmm5uHOfEAvlRzuPgiT6mRRkHj807tDqh0FaOvUXa2bTQWjX/+2YQlQ5RA2zDcabIYSuNzVikY0eiLL5Y3U6IF4QSnNqT7oMuwyBONFTrOEjwe0GlVNn5HadWtFxaTnLIK64KlTwB2YVoDNVrv7JJU+vbpL56F8lKuQpU8gdHq8PPpPKxtpxkUXLnwsUF1K1pXpkGxoSau0HWLa8RO6zALUkpGhiu3epP13Q3xbok2gm3UPhiUawMuLQ27Pnv7L87p8IRCtXYfIrhD/IropJ4zW0tJ7HgHw0KP2QX196yyvC1vDP5vJz8xH5whvE4ujQ2UHMO7S/dO48dRLPWRiJVHxz7FdV6p5060RvThglTKNkpju8nrfH8XgU8e0t8iFoZyoPmCBxbx13DKFuu/zZFMvj2pkdYEXkgyhV7bfiXoVGBvPpdKLCKDQduX8Jlv+z0yNaeOpSmf+4be/btmD7yh/vep50xOcVOer2sK0V8aNuT4se7B682N4EUyo6IAxAB6QyN0kqVYHa6TNAwqgNlMvAakRv/onuo/KiXKufPCpu7R0QWTYAHU3aMIE/jF/A+fB7vDSnlhjSyqNFbwPjQr+yMR2Alm/YSk27o7JtdtDBQL0sFrV8/Mqg+/hDouJpAP6QJEhP7S11Ry+SgYx11g+VoQZdC8oWidSgV5/nl0m+wafDaKWmswRT7qzq468Bmgz+NXFxepHrAAAAQU5NRkwHAAAPAAAIAAA5AABeAAAUAAACQUxQSOYBAAAB/6Cwbds2WQHK/KNtRMQJxP0h+xCJFxjBTYkAJAFg2yYxsqDLo4Mur/9/M0O2JODEIaL/DNy2jePd9q4Cib19YRKawHnvHVozyU+uLVPJd78TR2jbKYEe7uJiJBCkF0h6sJmA00NBaWDZIlv5MqLwe+4V9K4097/1XjbrXbmrP+ZeRgn4ge62V0Erj9RaEru9wXvrTt8gcK5F5++lDUw3wxyi8/dc2uBUdyycSuNMZcfsERYCz0SYW2Qt37xtAg53bTxEZovw4JhWwFTUUG9G56CkuGM2aRjeC8hvla87vRE2TrMjO0zc/gxRhRpxj6lfefJBT7m8PDRcHpKaMtnMVEQLOMi79HhoixpZPagpktGAZcjfBb9ntKg45pkoV39DlNSZLErDyBIK1R+LYgeaCmXMyq/lKdj5ewy1NWEK0MVUW+OlUj0MauOpW57DlLG7WWON73juUITm77k25lRqn4KuxiJfHSuEN18rBC6FPBzqp5pTDEScpfCZCP8LRCBCv4dLvoedhVWc1dUekm9233wF3ndr3yCHSP2frnbmvY6zZLsrS+DD1quIIfYrH7puVneTJwPfXFdDFLKWMBl6WBLmEpX+krqCIAaEMYgJvekfnpBAS0hRnp7MLee8jlWF2VoyZydWUDggRgUAALAYAJ0BKjoAXwA+MRKFQqIhDlTYEAGCWMAyrEAOfszR0j8qvZosH+Z3ppDMJjbmblDeMt5u/yeCAdhf+E8LfG361kv9r1/H+18wP8V4A7XG7eZQ72HVZ79crX4gUyL/HehPn6ejPYK/k/9r3zP9oEaWJu6vk414Ovw9MlSBqWpPtXC8nAPA6/iVHiJ7vJZf8aJBabM4/O1NgG1FX/85/KHGwZjn8G4U8tbWfFSBZFLoaWWRAQqpuPJCRHBzuJmf+RNyEhKwMxFsx6nsfF4AAP7zwmf2rR03vpvfa3/55dYBl3rDFKMmOtovMf9Pigxkx1OtIVJeAoFSg//wa+eYEisAC3+xN7BhE+WfVdyte26II9CKIqz6W8I3x0Cmty5+cjZVFjHusgWhDFUbXyzbhnIxf7W6izhsbS+Dj2+eKfcX9sp1vuXkZhsB0DbCI8QgOPUYrpUSN2qJADK9CgQQsvzjwj0Hs9SeDvrmweK2fSVOnsdqUlTrgvECsMlXOJ6XxFJAX+hGLwnCBjE1pl/ZqzISJQ7d8uR9d5eZ1DmC5P3n1WRdS6Essol6tycGaDEbbn4Y4RVnRJmMKOMwFnZb4bxouDe1rWKHffAFNW5qFvr/n9DqslX4MY1PmVV1kyqPnF1XtCBog0M23xdjBOJMIT+krlMwIBgFVzhGIAO6w9PrOjuDORqOh/eJLDFlB6F4cJkRyegtEAutK4RK6HMxsD+74T9ZeQd2QCG0waIgQiRhi1/eqSM6A1KfbzBbF4fJbVowazosz/ox0kC01B+dAe/ne6a+vF3WefQ07zS72zU5rRZErULFbpTglP9usebMxfkwMNHhIC+439Q3kC4A8OQvjj7f2n2s9ligTKWMHfT2SHtXiJHlcYu6Wg2xEuMIk9G5cqsfbCvhPYWX7rXkdy8QX5EnolikWRnQ4F5Ubx1bEQez6QC/EHo4prLQyPW78PHhS9reTDgZ28qeSMVb/nx7+B1zmVnEHSb+/lWGctCPdlvtFYIQTjmwkglueQGfRD+zDOaCERQzZ9P6MHORW511Nnt4UPbWrmqYRkpaua/lT31WlVcvq/bFbv0T3mINFj5fBSH3lKkPkDb2yGEqqxPWUQ8ZB2PS5pHZlSXk/DYKOYT00MJFT1zcb/Cve3zn9zYqmAtjFnL5QHeH3TIX/f1/3cGN3UKkEBw3W5jisFp2j4oAJFAqqVJJeZTviqE5LJxIby5M8o5kTy6R01VEvL7kK2iPxdsJIPCMTLUOfaBFJM6RBFkt3K7OeOjUp5N7eAnFDeDEPK1w8dUndwebyeO14aZnR26auo+TcTWWx13gQYK40iRut9/5DVboETbmdsMq/y4/4KZtXFYtN838P5NIT/q80/h/8Vrs/9S0SOa1PsZ91EiLH0PCvIImCiL9U8KEC/cMWtHY5Tkh4lWMpeVrpa30eILfYIOZPYx1MP1NWea3ehwGz7IQu/BMfWkw00pcnAeF1+pqBMfWWO0aLuwf2mB/rHqU5NiBAggr9KuLxBx9uf04LmZEEmZxFm9uy0rcAP6y4+gLnn6fmvoZuIvTqcZLJDbzylbVhymhhRXCPjJFdfwFEOtkot1i+flfRett9gnD+TbkP+ISJlAWTJJU1TajA3kNAA2lL9GryD6HeSkHS83i8iGN1Pv8ytf+BdqTPnkuEWmFwvnWnXRwrM4Cn6lEPy3+G7HRK/9OmLyFG83KaeAuaj9n+f3FA7D+Yvi1PcqCAZkfFPe7ldFDu9E+QTHwjxlWIYg+y4ap/ZC4+b0Tri1hmoeX00Lsd21tZPb6y6/AAEFOTUYwBwAADwAABwAAOAAAYAAAFAAAA0FMUEj0AQAAAe/AqG0kydGJlACZ97kbETEK/6SFSM2wnUiAJABo28ZIChmynFVaSUX//2eGLMAdx4j+M3IbSVH14HYNHBp2vjBtXpx/CFgAc3kIzTGoq1J7k3oDK7RFuQJ1kJThywbAaIbitffiHsxWZvdD9poWs5Uu/6J7hWqGuI29TOF2zsJ86nJI+fvDKZpPT1685a4RfsCHeOa2KnyQBlScZyq1DUndS/adc+EmkBsIo5QAJCEjyxAl9VNWaxDs8NWGoGPxSYhF5ohSjYgp1dhMKp1A5E/j+y/SDAu30QkFBadC6g6UYyR0bU891GEdmIN2qDJIA6GKNXouXbxiY6WZoplmSmYaoHXN9pnIZpMkNVihSxt1LgvDuHa4S0pmNxZ4ghbTqAMajJAKS9xbtlM+ATwuXxd+geYJLkR6y8iqncMl1yYUPgx+4aYgOeh8kZ4AIfa+aHYhUm2K0vu92uWhPNjNO4IMFOqa7iUPvqcspngewmnVpLlQDK6X7ZgQRpyTCaHvRJUSeljJdghr//Ov7AP0Qhq/5Gm5k13zY5RC70anhE7Hrel4j8HmXVbU39i+jPzkqAfLOJk9zBZ1pJVHixVxsiIy2hHTzyFGO2KoP48IZEdM/yUigRmxeH3iTwxbmyD+uLCVZ/UG7qUwv2Ys9eI9opu2IBNWUDggHAUAAJAXAJ0BKjkAYQA+MRSJQqIhIRm61RggAwSxgGi+vGxvCf8x/RvRttLZmCM7cXzG+cT6St5e3m6uYvwHhX44vX0jy4X6YhkXM3i13jOB2lHzIf69/zvVC0CPS/sE/qz1qPRQ/Yw5/QC/k+AfzA+QqOkE6arfhhgF2QOyzXmOaSVXgd5LyDM2ENd1pN0fzWTd2xES1ooJlr63QRGS9O4FHAGw+6chsFk9b1gTfjTroM1PAATbN+42BAOwD6nuHXGjgMfinynAAP7yRK/69H/PR/z0fxY/+Zo9AtJtNIeqT9lwXMLv3phiFI/hjgmzJigCoMedJyxVAH1B3U0iG7dwnC4zAn6CNvPkhwRJlnCrCh9GPM6Lt8yymwCnps6pMd0rAJYM95m6DjXMz8hI/HiBZrFPvrYYI65Tt4aTzS7cfm6VQRKGtjCQTR+u6oqscBBM7RgobLfTUgAvIvrPko32Wr49AHXScYYemHCZgdXPDjSCI+7PdX9pcDIssKmytOEImgz6GEiljyDOzdWmVoY8Z+3HOWAfF6v65+UIHMUdH/hCqyGrERSr3ckhWO/TG02KSQH0Xn9vxHjDblqDCgPcYjPRUL4uiqEXOFYyaEgvXTX+6WxdjaW1IeZ68h18BPU+kQthb7rvDOVcPk3+7efNYv2XkljzBnR6RgKs5DpmPhZjhLEqp8NHdUTbCeT/naE9pe26LXmv/a+MdvAjcjNTee0mw/veRFDgtMvtZYH9edFw8erIaw5JV37fGu7aCGkbQ4atvbGyee44Bhk8eGckR0LRJV/tW2Unh+b0/qkap1Sjdy0lYimdoqLXeqfXH6BwbHWhYlOvItqR65RcZIaWw81mEq0EGPTYpuQfe+ByHPdI4rupF0r0UNMYY4i2ZPUW34p7hVWTYIP6/l2fma6sCpJn14Mab0q+YAhnw3wMAS8P+9mR5zZq/dhV2+3Gu5bt0/YwCOTsv3XrR8evxNd37bcy1JqQkyn/A/2/ZHs8/+JYyzjqng1WcWnzWP6MHeqIw890lxHCi+i+UbTc5A3NWFIk4MLRFfN8lOE8cb0BUgus36EPfgiHFd84VBErkEtNK/sQm8OH3UcXhosWIDb/LbKjvtaVSCQsMR/NhIn4hZ4CE5VlHQ5Pd4bXks0716mLJ1n/M7QgRPzheDh2fAIl+Xi8aZ3TEcoxAlQmuOsOU4UUHVSG+Xqx3kN7zJUTeicCGeKWozhng1lMXmYS7XkPqOYdDWpd7MEGn9XJZho6fEu3Y/o3735qqzmHscBi76xGMOvzs5e0jXn0e266wnvs4T1lMot/0755HbCwL5usDdyGoYU1LjwyiAAeMd0Lg1tanxa4S85b2YsFNEFxsv3d7k7qID2nTLdOMC1mConOJlvkUnKr0p//Bda+DiMsnhnkhS5B2r74wsPSiS/tiNMZe/8ACBVH3nxJHckTM/ei6Yxl7/wh0chxsWoN7rL6eavIf9Dt/McEQEnk8EBmHGb00q6V9mILFna1hf1sa6bmPYk/mUcgVQ0AysM2NTWDG72GX+k3ArfzO1BnEStcSjE+jZ6ygB7P6jfwfzNLHpvygEVYXBtERDgKmxPZlD/tn+JC/FyaQx9rw+uCzIyEfSnguxVt9uaXcKCR0Qbb9hdp6Bd06Lm7MbO7XxIc+IhP+nfLZTw3yEGfWnkDjGu8rl/ajWP6wm3uOaI6Cl4YuS5B456mhGADjidPWkfX4HNYSWYgON+6yBPPkj+Yf9AAAEFOTUaQBgAAEAAABwAANgAAXgAAFAAAAkFMUEjlAQAAAZCjbW/bMFywUIPrlNNUpB3JlQNzpIq0A1UOcuPiLgE/0saIcOC2jSM5u1dSvC3x7BsCxKi5GgW4zdqryZrBIZLjrdV2BkXTHu8t/VmoDAXXe7QNFOnojhKdkAMU2akylt+ACwynysHGCfPfgcsJybNd6GHEt8vXNbMc3kbYlHdZrZc8wEbNYP66HvvtDVnuScPrtbSbo8rqKzUe5tLWo8G+qV3paLPNS3VUjMhqnxyNmOu1zvp/oO8sHRCTlM0RJ8yDx59aUjS0vx6SOIYA/kAMD2flDwGM6rRzw+ps0vUJVl7Bykdi7xPYQGwGWMnDi3rWRHwCc9jrjCqCoXKKzBURp8wUfLgqgzPhKzhXJ6SjE1c+mlKgelQwX9ONw7zGwVynYUK2yeFcNlplZks+S8UvHjRIxbbGlYE2v/+mIIjV+caZJY36I5IH8/7bf3ckG3FMRbECTu/PZWP4enjo82SOt7f4WGX+oH/LuqbfCMeuW8YUSAzJucMzH5B1bKvMqEcHakk3Hhs2wtTZXr82kjjatUVxPQ8HhFCyzVT1og3BAItY+lceuLgnMJI7hLQwU7UNurADfwQViRdV+sOo5l5Ug81/JBXXDiq3wj8CsThRhexNVRhdWNp6sxoEtMWG07zvVwAAVlA4IIoEAAAQFQCdASo3AF8APjEUh0KiIQ1WPkAQAYJYwDJhYf/HdWxWzrnm22HtkhM9vRzseml7zl/u8EA67v8N4N+JUBe0P6ioeuRc+Nc+q4Uc3qp/1f/c80P017Av62dZ30RkS1sscROsNesRFbfMUPJk/YMHYxogR1RwpqEzbFsXGIt81yPsCbt//+HiTRDcUCob9DgVy+7Dsb45RKZ3z8b6A+R5qxSQu9O1AyE/ITv1L5dJFCgA/vJEr16P+ej/no/hC+Zo6TbDa+fdzTCN1H70LIJw6iW2oD2ZP8lLTkd179thin2c09rgvXWipr6B9/1t2ZBgbMy1dPxNgkZpAAEolHPN2W/oFEERYMT1PBCpUzMLPyq8/HhNL3pzDE2OUT1Mjrf9ktgE5kb7scZVIBUjQ/RA6vyEDR4Q3+St3W1a4j5f5bzcWiImwmMgJ8Px1Uqmdhya2lRjR2qR9QQBStG0CSikzF48JoSJQNeUBVO3aQn15Brk0qsvEgo+PlUC55B40GCwTMQlNG7mOg1284MZ0j10jbbSmJn083cHIZihws6vTt0GYQz0Yqiq+KNlRwGwORFtDs1De0/nNv5BFDOtXlYSZSNhXsCMUIuGP8Fym779h+t1C2c0LKYLy5A3C5RWHdo9nWpQVhS2LFIpK2rK688I2DCKKlw2kgtnjbvyi/xGXiiRlo+c21OMqRs8I5AolEVGXuvOwvdOBhebkPBwPfdn/M7Lm5t2irEC4AXNaNzo/pFc/iSOO7a4r+B0L4Ie34k5G1a507Ny6BxbIQ4ob+FHGRpI/c4mBMXpwkNpxLpaYWoit40f8t33jmeVvy+YF+sT262NTPaed6D3dCQA3GnsQJg04Iowd/ecAAmwSa9v4pSpVf133rsluN0OAuh9oMGvvakThcoTQlWbQL3ognn3A2avQ6uECxKbyNPA9WtXSr9yKBGrj4341XCN5PZuLmOFwNNmYfcEdN8+gZQpWd38QMFJs9Y6X/QNFLJzWBh8x3G/GXncf0GOYIz/hi+3oZEgaVOq88QRXoE4RkpTlNpyMmFyCdQsq3ixhPasgHgjTo5DMV5Py1iS2mqyd4DsnGmbWv7wV0F6hInA7g76kmII1bHJ+br2ql59D+HHqzIpKhUMcCzUO8UhZtoP4XPDVTrZqaErU3l5x6uFXQEX6OyKn81yxOALwIVdinuvsBP1Nhmef/zhrzL+rEJFbrA8csb6wAeGejb/uGmDuETFhGaIQaZZI73+Qcfb8a/yfiV4Hnbvx7JLlP5Q6pY+RqZ2rgGcAW2YcqP/CEf5/wDNuJPXbCurp8YB7wxzY2QlXl3YMFi+K2oIegiRWvLuClCBg0qppT5a/Wq+1hPwtkx3hTg9w0EJaHr/CBS2Z9Nw6gJzRzEmD6OlYr2uTU1dF3tGDSzVDxlwkHqIqYuzU341rXyBnnAfAAt3DwJ85qwS8QfYe3LM9ND1zVm42fAKJwTwFnXrdO8lZxeUA7qiJ+OW5xkTXqWlmhf+O2v/sCWhsYCWz/mhTkZR7sTwIcXT6MrIwfwegttXxNx0gAAAQU5NRm4GAAAQAAAGAAA2AABgAAAUAAADQUxQSN8BAAABkGPbTrM7amigUOX5RDkNKFJ8FHg+OeE0n0yBGhxw+AEh3lt2GRETAGe5dSeNNvuhnEyHt6pcad2ft1Uh9xhV+dYvTlXYL9tNImg2aSCocmW7SpsUp4rqJqFtl8wmAVTHTWwe8Kpc6TECgCVSVx8cR8yVb+pA7vX55irr6DhSE8woZhz6I+ZSm/AzI2SeFW5LsxVCbmvrLZCl1BZnK2M/ttURhOMyL+VXMUohL8pWiuqiCNKhreQcL4rFFc/Rgrh5WOWShZXmFksxweIoFWA1VZnndpkrIhlhuUkiERQGiUoaqAoUp8EVgWQ0mCQQQKWfq6QDeao4Ha5MJbNJgE28EqozjEpCm81Wh0lTEXS6sgnyFJMO3+a9AuPo/RzjMvSp1DZf3CIbcpNNZomh1KQ9LDSUahOuwS6gVJt4JRDHwG1lkMKQ29pkRGzIbZx5rjgBQ6mN54AY8s8c349UmqNU23AOCACAtxHCSAtT5lkbzgFhcCyZGfAjOSAM+6HippBP1RwQJpF7nO6bKZP+qoksTLvS4QsGBH2rOZIBwYHiQNJ6siC7auF5Y3OHURfETvPKQi/8R/C7IHeiMlc62W5S3D+IzZtA3CV0GDdp/nwgPvURlQHFXGvyCPotkYGzEwBWUDggbgQAAJAUAJ0BKjcAYQA+MRSHQqIhDbVmABABgljAMqsZEYXu/KuBE+O27u4l/1W/Kbz1XPX3Twb8XD+/CXP+jVHr95R695xaVOdT/r/+l5wvpX2Cv1n6znoXobUv1CjfBbP+f8uFdUNN3os6tbUEY8uehPWD6Xq79Zxce0ZXjj0IJ2CGZgH9vDMeCwR85veO6YfjsoCDLGachtHzsUhL2HecNfdlMtiSitRMy/pMZZuAAP7yRK//Xo/69H/Xo/q+//zNHfJsNw5IdaVDyHIrRYqSBJGNc/YNxtjKL39u7atPYeh2HPFsKpXQPsrw7GRh17vnafC8zlgTOPWp9ad/B3eV02ExNgha4aL7c8n0PXhr+EFDyHsntD6NV6YJvjM770RRly4hsYIByndGXnOhKQDATws19fkDFQS9W9ObXo+8iL2fzIZhW2onRlrP+kGRtZwi1TiZS1hLNRoaBgE42ja9zwPqGhCLH4/vMI9X/GE+PKEX5YYSpFPxC59+tq8GlmqYaXEbVH4LM93qMHlicU1vPvfoZgZkbSSJTNE6ivcMVLFYYLfFrT29uKv6ksO74ygGSh64Ot9S43mGjgpBXPt+luIwywJTzKAI9/o9mTABdFeX2o6wNT3GZTT1eKC0oBLFPVjKt6WdrE/O/FWac/m5Cw8CkfHn6sFuUB+98XMKz/RcjJNqpuUp/H2NxruXj32JUobz7QZ2c8AHPaWoUraD9n4P0KNMHqTEysqzaiB9vCUz/qp2ppupq9kQnJ62gZR7gaiP7ODzTopOTF5QrV+Ro41LfLEliMAqZyzAtr07D2KUCLSwFQ02WZsjDentwhROtNsxkcrH4hUfA5yqtETadfxW+WADJjt5szlf8JXy/JWKP8HlpVf3T4K79y9XyfG9T5qarYgusO2/3r/GM4iWs2RMevp/Ru7WM/E/Srl+Gr2RKOwxfw1kZ8A9qk2eKzMPleUfutwb7qk4eLu1nqm6fedFBnWB9C5WYz6QPnvxvISDWfyxVtwuHCE4xEdltyzYLsZBZQA9UrZ/siA6WbeXtErVMDeUK+FJdOmaCqAXQDovZztSzngxs27O1yk+hbN3//j5dYopyQZ+qHPfv5NA58oF97Uv/ZKIj+wHOT/3Yfalqcf96kvAm5uC2yyprr6TNyWbz3SmnJbO+PYdCyZTd8xX9r6GZplTrr2kbtBCE27K2ASZ7e1D99yuciBhwATZAhLQwg4kEAEzLbwqCeWf4rcJjJIK0jeJjjwuoPIQ+zijELUeCqfAO4q2rfvxHf+X363TW9UKcDrg/i6dPB56uLssGcgofO7ifTk0TEWVDgpIgkI9D5bN2AzZ5ozVzmpiRsPa3lOwhry8AMygEwI3roKtBL80XVWSgIVyk7yQd6NfdxRFeNAb6h6g2HQmHYz19CVfmCJgC7wNl2989e5QFlYWVtAgbB+7TCAf3kJsVinie8zR6S0iEtOiCnseSLiUciSTLL+6Z3SjUVEyRhShAuC/3wbVYMPTiudAAAAAAEFOTUZUBgAAEQAABgAANAAAXgAAFAAAA0FMUEjBAQAAAZAjAGzrKlr0AXkw9T7VlDdzFaY0Dy/3ob0Mph2oerApWkRJjGRTt4iYALC/vjsaHEHPUY5yyTvsT0SKGyJTR3PDDP1SbogduTLaaojqOwp8qriOogyWaYgZOp4bYkeUh3ClYTVE9UMU11HghosO0a9W1EOU0/y6pFRFDmSGbt/QeCA9dC7sdqmwhhxIhVa7XSqFRX+lgYtY16BAkc0iKK7EvHqNaJdJI7DZDJqumK2GqH6ITCqBbVIMoBrFNBEoX39twQHUo8WCI2QPI0QwDKyWyMIVLQ4wQsIRagBTykoRjGed7K2iToQRqh8ik9lKZQZzXzVWdq4oVD9EcUMktMOksO8AogI/whFkBnPca0SzkFiBgxFOVTSLs6GFRXVBk5BEk3MkMMSpimJNgcDSLyyK/OAMTO9n0c1kQbGKcnEG/iCtzH3glKU1T/suaGFp5MXDqoeQpDVPCOCr3f0qjbx4AABXzOiNNOYJoROYT/Hi4TgupVoFPpYnhNPorlUjTD/w4qHdFSMIX2qKAaEzfOgRfr4hk5JywwxDxF+fr0OsZIj4/2U1RPVDFPfrC/VYpq4gJBapKUDnGJboEfpHUAcAVlA4IHIEAADwEwCdASo1AF8APjEUiUKiISEXXF2IIAMEsYBmveYky+c5aoCD2O273Gu8P7zhgAH8A7Ov7X4R+KoEOdn+14Z5drCbTnfFuhL0K/S/sE/rXvo36wF7Btz1LwSiSPMnlEn8jBFIn9EopNT/lrCBy2ebwXMv4hzb9HFwLSXDSSyO3kCtm67GkFMT2J/FZq1T6Z72O6xRGYdDyLb4ZQTCHDUlzJ5ap3v+ElAA/vJEr/+vR/56P/PR/V9//maPkjsNxxyQiR5v/f9OpIEm7+Fb/EjDUWydi1Yc2KhtuObyQKoLlZ6TDPbKUQR2M2iFx9/D1FrkYhn7wQM1hYcqCyPKxoVfome00DSy2CM/sVwJSH6VVhcr8FtyoK+4a80F8ijgwxL5XNk9IDc04BdFwcP//xnn3fgkb8o0d+/UE2V8aTCgc6+AEkI+sXRy2qninxCYdMpi6WIQU1sRjMFZJI1u8fClkFPWvEV2eEI7GUPmYs3qh7eS5akH5fP8+dzYUP/Z039/c75rgzRMajWI0AXhK61o3yGYG5jljHwFn6PD39YKft3LHioMI6cMh2DmXp13PRr89qllVMYr/pjwhv5Y+yH+f+V9ppvaL2wlEXWivviLj67CaicR2cNycbHDdt0j08mzKA38o6ZGkmA42tagMKJ/L6acHX6MBQpmz2poJDeNV/dxCgB1/ubQJc3BKxj2QsUMuxrkprhxuLHYSnxS8bga8xWtV5ZvZMRCzmW+bkV0OB51ayEnr7a5uyb43TpVpwWM3O3TgZK3twxf8CsLrS1ohSe5RDO47wP/tGkd2JIXRaFLCAvHu+UbLbvvgOOHPB1tfCeNN6Js4kbTykvGEYsoRBGQ6x7f3SHMNTvx8kbd3/of0uko5bNXwnFm8/Puu1A9mBWcizCpexoj3BwpMrvlGhtXoYnRNeJDpTNkf2jkMkGLhgrgvN2E4YI+TSbHXCHq3AICct1ItbFonr7PGB1Z+VCpTxpP/RVxIcHulfvEJAnyf9rHU5m6XbpZCNBoYCPOOPR2BC/4L/vspMOCZfHq/+TeCcbwGyYn/Z4jYG8fDzVCNc55jImGYCR+idcF3AKu3aFSKvlX7173tlFU37/GUJdaEV6opZXIA4AUBG/PG3wg3lP0S/9Dzg9ju9dqzI/3dT/QASrqF1nNXSe745o5/q/2aZ3ODIenO1TYmWbOdnjIN3+S2wVQhXHJSATUpVIdX/W4+FLGYNsqy+dzhcWKF/qmJeRzXcL/S8H581+QpQf5vwGeNdC7FO+ZEnyVYb7MkYkl9udg/10/Drmypl/wtZj91+MxSixpAWl1i2Ivao54M+d4IhHuw8+8bs/xYuoo7s0RWq1/X57lv5ii5Gy8s7GqKxW8jT8j5Mm1oIT1Bx5nh5voWw67Ly/T5P54ZrQX0KTLF0EKKLSWn/3+8Ymd76FyuyF+lonod/uNhQ1BC7gUL5ig0qbciNrXIKdgx57/E77VDezT9rx7Fj3DoyIZnXaSBRRSfZ5LT3PfQYMAAAAAQU5NRiAGAAATAAAFAAAxAABdAAAUAAADQUxQSLoBAAABkGPbUms5lZAUAS03H0uAhiSCT0APySI3IEtAJSQl8+DBlTqPiAmgvcb+bQjY3LS/yyU6g2KbDuU9nqZHIaL4PhKHknTc7GNQGSVPZALlOpFQbPunIp44FCejZlGi4qWJyniZDhnp2lprff4adpky0VtrratK2ML2hUxMSljC1vrLJdcmulTCqZeXXFvruvPGnHBFt3dP8/xV91c+YRtAIjhxZ5zsq3wm6v5MZxNAxKsO7osntO4Jrhi47gmuMl4iuOrwEq00ZYu4JbZtKQaue4IrBq57gisGLxJcdXiJ0PoNo/V3hpY7WdQsrY+6WJ5vSKv0K+M1i1cMXiK47vEqg/WaPUFJ8Uxb86kv0RnaG+Scp81B9HzlPUF0YbNbgujKyjuC6NJMG4Po2rQhiC6O64LoYnHLguhYcso3133Q7KogOpZARMa2XV50XAP9PVHMoqjjW0eHvg8SLXZ1cMt0nHQXpaNbplPdL3NVtdfENM6DZpfRpWbPNMkVwDDN2zaovO70RCZYJ4OEE3UYcdJAHF6zMKbg2TYoBi/Rf8z3QcRJeiwOJw6axeEkBzcGhyhU7SUyQbvoDe0EVlA4IEYEAABQFACdASoyAF4APjEUiUKiISEXXF2IIAMEsoBnOKCszzD/Dfxi/Wpx88J6Od5Aj33FBzvhSEjb88qx753Y9c6MeaGHzL/S+wV+tG+Z/qAXXZ4p+oniYb6PEv8f8BfZDK/M3eaqG3aoV+YLF8tl/66o/94vNoB7YAgp1IvFfitq+0wg1tmWmkYxh84HlMvLEhsyDw25QN5d+dhkrmEuvQwFLpAeBzUwS+2ZOKAA/vJEr/Xo/69H/Yzf2AP+Zo75NhvFl8I/N4oqqCyQX5ATZnbSP+Wy5kuRA6h4Do2Sy5msdGntgJg+IBKrHyHSz14Fl+ljYU7sVU9G/+IuzwLNSOcHt3BdN+S4bxmDRrPBsv7VlJnMZEjo/MuUK+EI5BBDz6NkDOxpSADeOfRHmCXQfY07PqvOnLsc504iDbmgZ+Oql+1y0fTd0T1lHJxP0Tsb0oEpQJh7cKh+Sqd6CCso8942J9vQ7copKPM85t2rrT/NYBJKvL8TR5G3plahrS1SDzDzuvGnsL5tL5SzLFKmhtc3wh1e7cgD738Gvv37NOCZ6VIvPJ7Cu4F5vCwHxi8DXt8eo52+mQtw3iUpDOEEYHrTc6zryd2mp7CXhyr0+Nsz8EcGlpgy1zQa3cce5e2QGboTbu8yVzG5br6C45ZbA3/6a6jKRCvr8+RDtrVwQT9PoUmiU7CuR7NUkiBIak3xF/6P/vZOFHtzUVSgwmzEus70v9iKNgWY0D5oRrWwPWq2qMdHfRCpv1Pjc2OFNF0IQZagl37ErcpCEKTo0A3q7bdOMn0L3TVFyTTRqJY9wQX5WE/7vFJndrk75Seebm7mBxdWs2EZNJFpo1Kn4iZihwv+kEBMlQ9seYsMu5rygJRtn+DF06Bv2iIWoYOkf7dBS+LFLO+8kpQdKkhON0q4ji2WTLNqnANp7RC70vlYO0Mska/GxGufn3SAS34sx19wRz36I/SD07xIDH1IRr2B2lk6l7wpArTdKuD8rp2P6E5vxtKtFudO+d/ZB8DOp13PGfm4U+w5Rj6syUsEZnXEf3H7GzfWCTbyoige4Xmrt8oBWPo39KzhQVbySwBquHG9wurDazw8z7S2Z/RudzD0l8NuDikAwz8E3fJ/4JaCZ+U/cngem1byiwm2O8RRQ8OCS8Zhx5d2dfGSuxKfydamIun+b7VT9oWNtwZyG1LIwbWTP0BzraQi7VkhqBlrcLCEfwfQNjWZ7riDkk3MP2Sf5q0Tc/qTFcqvl6dDHsQmQINkFQYM1M9n/xrtPZXt17/mgQOGO0RKPu+nV7AM/3X9p2Cd7XXbsJQkh1p4xiOrGvHDY+x0A3sgFVmsFDrjppxUWZHjGHecqDNQe+81PevF5Jce0NwSJOSBhT5f01RD7FjI/NTF3G3lK9ZAKSdG3iv4FUwx3Y9gWs4c7pxxwApPIwxu+DLUyX3DAvp7YFcIY+T44xnaxgAAAEFOTUbIBgAAFAAABAAALwAAXQAAFAAAAkFMUEjdAQAAAffAqI0kx9ktqfq1PHK4i4goCfJHkoZYG+ImIgEs27YiNY8moibIi7EDQs1/nDYUnDTfEf13IElS2yxJJx/nNODDT5DfVKy7FwvK38q9ZD0ECykuL6VdoZpetRT3P0g7Ohkmau4oMaMrf0ctQFhVemb8Q5hkS0uFxirJP4NV2xnnnI+HgHWnUymlLkvdmZktZteWgdKOdmgvCoeD5tKWsXLsX26e4o3NHURmc1mAor1mTkRrof9FECqO1qnrGRqhuLIOAFXfXwe0bTNtu0LbvsK2RMJOK9sEAxVMYba0p8qKGJulMNsVT9oWZaBiKaye9jwZWaEQtiXStiTaNieCcdizBVrZCkyhCuyZg6AU5nSPTFJ48iO/YUT0eQrnsooIPBc6U58aSWEU1LPlZEHPlnUwBY+zdyDP9t5PzhAK83YmY5r8vodmAmIWnY4bHysikmMTNLdRvCem7AfqyczpaxxXjpTqp7Stc1FHOO+B0nkOhZzOn52jBuNU95mIGmqnbd8qETX18meJSNTQejmtjkSd2GW+rNjMQBXqa4rtK3QSSN9Zg3lsINTBzW5eIFL4oNR7RKUr5BuKlNLkmpjZvk9G4JNSEtizBaHKtr5GRWs93Uew3pI37F81wCwBAFZQOCDKBAAA0BYAnQEqMABeAD4tEodCoaEONbcADAFiWMAvN1BVt5FfceVO7H87ty+dv9GG8Z+iB0xX+lr1zFHy/++o/tw/1KRIsiPhLkn3QkAG7Pxi/6fyRI5PQ80RPUXsDfzD+z9Xz9u0iLy/RGo4Y+HZqreC1oT3d8a0nhOKpA3ZHlLVe+O3f7pCuPYkyH5ITkX/D4b4KRs5i5dabLOqYKO8VoheDq8t1olzeotz1aZoPF8clICw5bApw9BbbisRUVaUHAAA/vPCZ+1of07v9Wh+W7/PTOwPJHjib1PoT/kI8VN+YnY3T4Yqd4cNrJLjhobo/I+xM88/82eO6Z5h04ZY4CzqkEVUsFyxmUJwuAbPFPH+R+61SJCtwXyKsXyUtUuA1D9Cz/f/SKB8AAFdzBi3zptbdPTv+d1J6WPvtsZKZ+c9G3eTfbp3ZwjDO+Y28lelRZ01LUsXmxSM4yqQljdC3EsxoRSXz7a7R5SOGtDYUU+RU3onaUYWXLAz/YQzLfddWGyFdoCQOk2I886eV3tC2hBoQJLNbdFE9fQ3ojJtLW8IqNdKr1oYlqVYsli6hxey8C4RR7vyF1V4cUvekZkSe2qo3QVgsE+PouvJ+P5PTd1uvbrC+Hrf+0QF+8JI7hwZUTBATUSSV1hn8G+qleDWhnL2hTq/ThhAYq3HCxGrUVyc33v+AoVYZoxX5RHRopAHmPh7op8M2euaWOiqVBNFk2UORggrk4Vy9dsk4DCtkbkIsAPNPX3Z9+Od8GPinf77bVEJNHQ8b9jrCK6Hav+SEXKpHY9WYummHd4c26moWuVeGRnw/xUQ+KL/dQlZLr59fuX4ihjll8psfWMq3MLJerRVacXfihJoLK5qJAVK9gzGTpWg2uOHh9o9Qb/s/se3V31jyYeA60/3e6V8SuqDpuV9TFgkxsoLB8EPgzjBHi1KT8P+WvDyFf6+cltN/l4MbO5+s/9Y/zNbuwYn7O0UbiAAeP+2Z8Qh2odrSf3GjEomEU3mmctsFkd/cVlEYoW8Id4depB7WO657D4SZ5jZOlpNusYNHYhdYuqr3358YXKv+nNnNyKzDdDM+QTb3fiLGlWGqiGCk+cptl6v4GNTzk0Mv19oXBYjN77x+9j0bgku2pblIDrHioEkrKyhM6+Fl9bwJ2HdgP9pG9ZVOxRhboTcF30FO8xRvPRioNfP8CEzAMtv4XxAYPT+R46dE8p1fOHjD8NeF6aue7fO7WTbtg4HRBnqp/1r0VTjUKIe3s9e8YiPUT7d2lMs1jMSjOggLDj6Uk/o/L/joYK605jyL8B9o+C+i285ioj40FVH0M6PE8wQVzeYyjOU0FEF9Gyfxut1EF8Gj68WOtA4o5JLZGfa3U+aJV5cPDdq9Lrd7sZ1AOwtYVr7mj1YEjvHU0pLyIHvOm/tjAkTJ45Y5A+EQGZ/uXmfDjtU5pyK7h4SvlJicy2fBv+EBbz9Pxdtt4aNj0/jgLiNdBKDi8IVrSzfvO4JFL9rcnzkAvIrNOii3XQh1rds5QEVw/hfU3wztmqIzGLQTgfj/jwPmBul5DbSkgu6rU4D+QzmihKkNHZLA3unp5QUBjX/GKO1X6bY36g4G2+LnTv8DutSt09akyWaWDML7H9CF/DzMgsAAAA=";function s7(n){let e,t,i,r,a,o,l,u=(n[6]!==""||n[7]!==0)&&zb(n);return{c(){e=P("div"),t=P("div"),t.textContent=`${w("popup.loading.loading")}`,i=G(),r=P("img"),o=G(),u&&u.c(),l=Dt(),T(t,"class","text svelte-biysx8"),Yt(r.src,a=qo)||T(r,"src",a),T(r,"alt","Running Armor Stand"),T(r,"class","svelte-biysx8"),Ge(e,"display","flex"),Ge(e,"flex-direction","row")},m(c,d){L(c,e,d),N(e,t),N(e,i),N(e,r),L(c,o,d),u&&u.m(c,d),L(c,l,d)},p(c,d){c[6]!==""||c[7]!==0?u?u.p(c,d):(u=zb(c),u.c(),u.m(l.parentNode,l)):u&&(u.d(1),u=null)},d(c){c&&F(e),c&&F(o),u&&u.d(c),c&&F(l)}}}s(s7,"create_else_block");function l7(n){let e;return{c(){e=P("div"),e.textContent=`${w("popup.loading.success")}`},m(t,i){L(t,e,i)},p:ue,d(t){t&&F(e)}}}s(l7,"create_if_block_1");function c7(n){let e,t=w("popup.loading.offline").split(` +`).map(d7).join("")+"";return{c(){e=P("div"),Ge(e,"display","flex"),Ge(e,"flex-direction","column")},m(i,r){L(i,e,r),e.innerHTML=t},p:ue,d(i){i&&F(e)}}}s(c7,"create_if_block");function zb(n){let e,t,i,r;return{c(){e=P("div"),t=Re(n[6]),i=G(),r=P("progress"),r.value=n[7],T(r,"max","100"),T(r,"class","svelte-biysx8")},m(a,o){L(a,e,o),N(e,t),L(a,i,o),L(a,r,o)},p(a,o){o&64&&ot(t,a[6]),o&128&&(r.value=a[7])},d(a){a&&F(e),a&&F(i),a&&F(r)}}}s(zb,"create_if_block_2");function u7(n){let e,t;function i(o,l){return o[4]?c7:o[5]?l7:s7}s(i,"select_block_type");let r=i(n,-1),a=r(n);return{c(){e=P("div"),a.c(),T(e,"class",t=Ai(`floating ${n[4]?"red-border":"blue-border"}`)+" svelte-biysx8")},m(o,l){L(o,e,l),a.m(e,null)},p(o,[l]){r===(r=i(o,l))&&a?a.p(o,l):(a.d(1),a=r(o),a&&(a.c(),a.m(e,null))),l&16&&t!==(t=Ai(`floating ${o[4]?"red-border":"blue-border"}`)+" svelte-biysx8")&&T(e,"class",t)},i:ue,o:ue,d(o){o&&F(e),a.d()}}}s(u7,"create_fragment");var d7=s(n=>"

      "+n+"

      ","func");function f7(n,e,t){let i,r=ue,a=s(()=>(r(),r=ze(h,k=>t(4,i=k)),h),"$$subscribe_offline"),o,l=ue,u=s(()=>(l(),l=ze(g,k=>t(5,o=k)),g),"$$subscribe_loaded"),c,d=ue,m=s(()=>(d(),d=ze(y,k=>t(6,c=k)),y),"$$subscribe_progressLabel"),p,f=ue,_=s(()=>(f(),f=ze(v,k=>t(7,p=k)),v),"$$subscribe_progress");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l()),n.$$.on_destroy.push(()=>d()),n.$$.on_destroy.push(()=>f());let{loaded:g}=e;u();let{offline:h}=e;a();let{progress:v}=e;_();let{progressLabel:y}=e;return m(),n.$$set=k=>{"loaded"in k&&u(t(0,g=k.loaded)),"offline"in k&&a(t(1,h=k.offline)),"progress"in k&&_(t(2,v=k.progress)),"progressLabel"in k&&m(t(3,y=k.progressLabel))},[g,h,v,y,i,o,c,p]}s(f7,"instance");var au=class extends Be{constructor(e){super(),De(this,e,f7,u7,Oe,{loaded:0,offline:1,progress:2,progressLabel:3})}};s(au,"AnimatedJavaLoadingPopup");var Gb=au;(()=>{let n=Blockbench.addCSS(".floating.svelte-biysx8{position:absolute;bottom:2rem;right:2rem;background:var(--color-ui);padding:8px 16px;display:flex;align-items:center;flex-direction:column}.blue-border.svelte-biysx8{border:1px solid var(--color-accent)}.red-border.svelte-biysx8{border:1px solid var(--color-error)}.text.svelte-biysx8{margin-right:16px}img.svelte-biysx8{width:32px;height:32px;margin:-4px -10px}progress.svelte-biysx8{width:100%}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();var Ub=new ge(!1),Jb=new ge(!1),Hb=new ge(0),$b=new ge(""),Nr;async function qb(){Nr||(Nr=await tr({component:Gb,props:{loaded:Ub,offline:Jb,progress:Hb,progressLabel:$b},elementSelector(){return document.body}}))}s(qb,"showLoadingPopup");function Kb(){Nr&&(Ub.set(!0),setTimeout(()=>{Nr&&(Nr.$destroy(),Nr=void 0)},2e3))}s(Kb,"hideLoadingPopup");function Wb(){Nr&&(Jb.set(!0),setTimeout(()=>{Nr&&(Nr.$destroy(),Nr=void 0)},1e4))}s(Wb,"showOfflineError");function gm(n){Hb.set(n)}s(gm,"updateLoadingProgress");function hm(n){$b.set(n)}s(hm,"updateLoadingProgressLabel");var bm=ab;async function m7(n,e){hm("Downloading Minecraft Assets..."),await new Zb.default(n,e,{existBehavior:"overwrite",maxRetry:3,reportInterval:100}).on("progress",t=>{gm(t.total.percentage)}).on("error",t=>{console.error("Failed to download Minecraft client:",t)}).on("end",()=>{gm(100),hm("")}).wait()}s(m7,"downloadJar");async function lu(){let n=3,e=await Vr();for(n=3;n-->=0;){let t;try{t=await fetch(e.url)}catch(i){console.error("Failed to fetch latest Minecraft version API:",i)}if(t&&t.ok){let i=await t.json();if(!i?.downloads?.client)throw new Error(`Failed to find client download for ${e.id}`);return i.downloads.client.url}}throw new Error("Failed to fetch latest Minecraft version API after 3 retries.")}s(lu,"getLatestVersionClientDownloadUrl");function vm(){let n=electron.app.getPath("userData");return PathModule.join(n,`${ke.name}/latest.jar`)}s(vm,"getCachedJarFilePath");async function ou(){localStorage.setItem("assetsLoaded","false");let n=await lu();console.log("Downloading latest Minecraft client:",n);let e=vm();await fs.promises.mkdir(PathModule.dirname(e),{recursive:!0}),await m7(n,e),console.log("Downloaded latest Minecraft client:",e)}s(ou,"updateAssets");async function ym(){console.log("Checking for Minecraft assets update...");let n=Ma();if(!n)console.log("No current Minecraft version found, updating assets..."),await ou();else{let t=await Vr();n.id!==t.id&&(console.log("Minecraft assets are outdated, updating..."),await ou())}let e=vm();(!fs.existsSync(e)||localStorage.getItem("assetsLoaded")!=="true")&&(console.log("No cached Minecraft client found, updating assets..."),await ou()),await Xb(),console.log("Minecraft assets are up to date!"),localStorage.setItem("assetsLoaded","true"),requestAnimationFrame(()=>re.MINECRAFT_ASSETS_LOADED.dispatch())}s(ym,"checkForAssetsUpdate");var su;async function Xb(){let n=vm();su=await Ob(new Uint8Array(await fs.promises.readFile(n)),{filter:e=>e.name.startsWith("assets/")})}s(Xb,"extractAssets");async function yl(){return new Promise(n=>{su!==void 0?n():re.MINECRAFT_ASSETS_LOADED.subscribe(()=>n(),!0)})}s(yl,"assetsLoaded");function wm(n){if(!su)throw new Error("Assets not loaded");if(bm[n])return n.endsWith(".png")?Buffer.from(bm[n],"base64"):bm[n];let e=su[n];if(!e)throw new Error(`Asset not found: ${n}`);return e}s(wm,"getRawAsset");function Wa(n){let e=wm(n);if(!e)throw new Error(`Asset not found: ${n}`);return`data:image/png;base64,${Buffer.from(e).toString("base64")}`}s(Wa,"getPngAssetAsDataUrl");function or(n){let e=wm(n);if(!e)throw new Error(`Asset not found: ${n}`);return JSON.parse(Buffer.from(e).toString("utf-8"))}s(or,"getJSONAsset");function p7(n){return n.replace(/\\/g,"/")}s(p7,"normalizePath");function xm(n){return n.endsWith(".json")&&(n.includes("tags\\function")||n.includes("tags/function"))}s(xm,"isFunctionTagPath");function _7(n){return n.replace(/%([^%]+)%/g,function(e,t){if(!process.env[t])throw new Error("Environment variable "+t+" does not exist.");return process.env[t]})}s(_7,"resolveEnvVariables");function g7(n){return n.startsWith("./")||n.startsWith("../")}s(g7,"isRelativePath");function h7(n){if(!Project?.save_path)return;let e=PathModule.dirname(Project.save_path);return PathModule.resolve(e,n)}s(h7,"resolveRelativePath");function qi(n){if(g7(n)){let e=h7(n);if(!e)throw new Error(`Failed to resolve relative path '${n}'`);n=e}return p7(_7(n))}s(qi,"resolvePath");var b7={};xn(b7,{default:()=>km});var km=Gw("AAEAAAANAIAAAwBQRkZUTTylB+MAAaIMAAAAHEdERUYAJQAAAAGh9AAAABhPUy8y/fxN0gAAAVgAAABgY21hcHhH6IYAABRAAAAKrmdhc3D//wADAAGh7AAAAAhnbHlmcJz5JAAAKDgAAU3kaGVhZL/tgK4AAADcAAAANmhoZWEHggijAAABFAAAACRobXR4GdUXAAAAAbgAABKIbG9jYfA4nFgAAB7wAAAJRm1heHAEwwCCAAABOAAAACBuYW1lrGdvGwABdhwAAAJMcG9zdEMAzNIAAXhoAAAphAABAAAAAQAA3fpnrl8PPPUACwQAAAAAAHw3nBsAAAAA4JaglgAA/4AEAAOAAAAACAACAAAAAAAAAAEAAAOA/4AAAASAAAAAAAQAAAEAAAAAAAAAAAAAAAAAAASiAAEAAASiAIAAIAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAgKSAZAABQAEAgACAAAA/8ACAAIAAAACAAAzAMwAAAAABAAAAAAAAACkAA6/QAnw+wAAoDAAAAAAWUFMLgBAACD//QOA/4AAAAOAAIAAAAH/AAAAAAKAA4AAAAAgAAEAgAAAAIAAAAFVAAACAAAAAQAAAAIAAAADAAAAAwAAAAMAAAADAAAAAQAAAAIAAAACAAAAAgAAAAMAAAABAAAAAwAAAAEAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAEAAAABAAAAAoAAAAMAAAACgAAAAwAAAAOAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAIAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAIAAAADAAAAAgAAAAMAAAADAAAAAYAAAAMAAAADAAAAAwAAAAMAAAADAAAAAoAAAAMAAAADAAAAAQAAAAMAAAACgAAAAYAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAACAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAgAAAAEAAAACAAAAA4AAAAEAAAADAAAAAwAAAAQAAAADAAAAAQAAAAMAAAACAAAABAAAAAKAAAADgAAAAwAAAAIAAAAEAAAAAwAAAAKAAAADAAAAAoAAAAKAAAABgAAAAwAAAAOAAAAAgAAAAgAAAAKAAAADgAAABAAAAAQAAAAEAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAKAAAACgAAAAgAAAAQAAAADgAAAA4AAAAMAAAADgAAAAwAAAAMAAAADAAAAA4AAAAMAAAACAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAEAAAACAAAAAwAAAAEAAAAEAAAAAwAAAAMAAAADAAAAAwAAAAMAAAAEAAAAAwAAAAMAAAACAAAABAAAAAKAAAADAAAAAwAAAAMAAAADgAAAAwAAAAMAAAADAAAAA4AAAAQAAAADAAAAAwAAAAOAAAADgAAAA4AAAAOAAAADgAAAA4AAAAOAAAAEAAAABAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAOAAAADgAAAAwAAAAMAAAAEAAAAAwAAAAMAAAAEAAAAAwAAAAKAAAADgAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAgAAAAIAAAADAAAAAoAAAAGAAAADAAAAAwAAAAMAAAADAAAAA4AAAAOAAAADAAAAAwAAAAQAAAADAAAAAwAAAAMAAAADgAAAAwAAAAMAAAADAAAAAwAAAAMAAAADgAAAAwAAAAOAAAACAAAAAgAAAAQAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAA4AAAAMAAAADAAAAAoAAAAMAAAADgAAAAwAAAAMAAAADAAAAAQAAAAEAAAABAAAAAQAAAAEAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAIAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAGAAAACgAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADgAAAAwAAAAMAAAADAAAAAwAAAAMAAAAEAAAAAwAAAAQAAAADAAAAAwAAAAIAAAADAAAABAAAAAOAAAADgAAAAwAAAAMAAAADAAAAAwAAAAOAAAADAAAABAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAQAAAADAAAAA4AAAAMAAAAEAAAABIAAAAOAAAAEAAAAAwAAAAMAAAAEAAAAAwAAAAMAAAADAAAAAwAAAAKAAAADgAAAAwAAAAMAAAADAAAAAwAAAAKAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAOAAAADgAAAA4AAAAMAAAADAAAABAAAAAMAAAADAAAAAwAAAAEAAAADAAAABAAAAAOAAAADgAAAA4AAAAMAAAADAAAAA4AAAAOAAAADgAAAAwAAAASAAAADgAAAA4AAAAMAAAADgAAAA4AAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAIAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAA4AAAAOAAAADAAAAAwAAAAMAAAADAAAAA4AAAAOAAAADAAAAAoAAAAOAAAADAAAAAwAAAAMAAAADAAAAA4AAAAMAAAADgAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAOAAAADAAAAAwAAAAMAAAADAAAAAwAAAAKAAAADAAAAAwAAAAMAAAADAAAAAYAAAAGAAAABgAAAAgAAAAGAAAACAAAAAwAAAAMAAAADAAAAAwAAAAOAAAADgAAAAwAAAAOAAAACgAAAAwAAAAMAAAADgAAAAwAAAAGAAAADgAAAAwAAAAMAAAADAAAAAwAAAAOAAAADAAAAA4AAAAMAAAADgAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAOAAAAEAAAAAwAAAAMAAAACgAAABAAAAAOAAAADAAAAAwAAAAOAAAADgAAAAwAAAAMAAAADAAAAAQAAAAIAAAADAAAAAwAAAAKAAAADAAAAAwAAAAEAAAACAAAAAwAAAAMAAAABAAAAAwAAAAMAAAADAAAAAwAAAAMAAAABAAAAAgAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAACAAAAAgAAAAIAAAABgAAAAoAAAAMAAAADAAAABAAAAAQAAAADAAAAAwAAAAQAAAAEAAAABAAAAAMAAAADAAAABAAAAAOAAAADAAAABAAAAAQAAAADgAAABAAAAAMAAAADAAAABAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAAEAAAAAwAAAAMAAAADAAAAAwAAAAQAAAADAAAAAwAAAAMAAAADAAAABAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAQAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAKAAAADAAAAA4AAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAIAAAACAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAoAAAAMAAAADAAAAAwAAAAMAAAACgAAAAoAAAAIAAAACgAAAAoAAAAKAAAADAAAAAgAAAAIAAAADAAAAAwAAAAKAAAACAAAAAoAAAAKAAAADAAAAAwAAAAMAAAACgAAAAwAAAAMAAAADAAAAAgAAAAMAAAACAAAAAwAAAAEAAAACAAAAA4AAAAMAAAADAAAAAgAAAAMAAAACgAAAAwAAAAIAAAADAAAAAQAAAAIAAAADAAAAAwAAAAIAAAACgAAAAoAAAAIAAAACgAAAAoAAAAMAAAADAAAAAwAAAAIAAAACAAAAAoAAAAMAAAADAAAAAwAAAAOAAIAEAAAAAwAAAAQAAAADAAAAAwAAAAMAAAADAAAAAQAAAAMAAAACgAAABAAAAAGAAAABAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAABAAAAAKAAAABgAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAEAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADgAAAAoAAAAKAAAADAAAAAwAAAAMAAAACgAAAAwAAAAOAAAACAAAAAgAAAAOAAAAEgAAAAYAAAAGAAAABgAAAAoAAAAKAAAACgAAAAwAAAAMAAAABgAAABAAAAAQAAAAEgAAAAYAAAAKAAAADgAAAAYAAAAKAAAADgAAAAgAAAAIAAAAEAAAAAgAAAAMAAAAEAAAABAAAAAQAAAACgAAAA4AAAAIAAAABAAAAAgAAAAIAAAAEgAAAAoAAAAEAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACAAAAAgAAAAIAAAABgAAAAYAAAAKAAAACgAAAAgAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAgAAAAIAAAACAAAAAYAAAAGAAAADAAAAAwAAAAMAAAADgAAAAwAAAAMAAAAEAAAABAAAAAQAAAADgAAAA4AAAAOAAAADAAAAAwAAAAQAAAADAAAABAAAAAQAAAADAAAAAwAAAAQAAAADAAAAAwAAAAOAAAAEAAAAAwAAAAOAAAADgAAAAwAAAAQAAAAEgAAAAwAAAAMAAAADAAAAAwAAAASAAAAEgAAABIAAAASAAAAEgAAABIAAAASAAAAEAAAABAAAAASAAAAEgAAABIAAAASAAAADgAAABIAAAAQAAAADAAAABAAAAAMAAAAEgAAABAAAAASAAAAEgAAABIAAAAOAAAAEAAAAAoAAAAMAAAADAAAAAwAAAAQAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwABgAOAAAAEAAAABAAAAAOAAAAEAAAAAgAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADgAAABAAAAAMAAAADgAAAA4AAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAACAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAGAAoAAAAMAAAADgAAAA4AAAAQAAAAEAAAAA4AAAAIAAAACAAAAAwAAAAMAAAACAAAAAwAAAAMAAAAEAAAABAAAAAEAAAAEgAAAAwABgASAAYADAAAABIABgAMAAAAEgAGAAwAAAASAAAAEgAAABIAAAASAAAAEAAEABIABgASAAQAEgAEAAwAAAAQAAAAEAAAABIABgASAAQAEgAEAAwAAAAQAAAAEAAAABIABgASAAQAEgAEAAwAAAAQAAAAEAAAABIAAAASAAAAEgAAABIAAAASAAAAEgAAABIAAAASAAAAEgAAABIAAAASAAAAEgAAAAoAAAASAAgAEAAAABIAAAASAAAADAAAAAwAAAAMAAAADAAAAA4AAAAOAAAADAAAAAwAAAAOAAAADgAAAAwAAAAMAAAADAAAABAAAAAKAAAACAAAAAgAAAASAAAAEgAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAABAAAAASAAAACAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAgAAAAMAAAAEAAAABAAAAAIAAAACAAAAAwAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAAwAAAAMAAAADgAAABIAAAASAAAAEAAAABAAAAAQAAAAEAAAAA4AAAAOAAAAEAAAAA4AAAAMAAAAEAAAAAwAAAAMAAAAEAAAABAAAAAQAAAAEAAAABAAAAAOAAAADAAAAAwAAAAMAAAAEAAAAAwAAAAOAAAADgAAAAwAAAAMAAAADAAAAA4AAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADgAAAA4AAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADgAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAEAAAADAAAAAQAAAAMAAAADAAAAAwAAAAMAAAADAAAABAAAAAOAAAADAAAAAwAAAASAAAAEgAAAAwAAAAKAAAADAAAAAwAAAAGAAAADgAAAAwAAAAMAAAADAAAABAAAAAMAAAADgAAABIAAAAMAAAABAAAAAgAAAAMAAAADAAAAAgAAAAKAAAADAAAAAwAAAAGAAAADAAAAAwAAAAMAAAAEAAAAAAAAAwAAAAMAAAAcAAEAAAAACKQAAwABAAAAHAAECIgAAAGAAQAABwCAAH4AtwC/ANgA3wDwAPgA/gEzATgBiQGSAZ8BqgGyAbkBwwHJAd0B9wIlAjYCPgJiAmgCdQJ8AoECjwKiAqwCuwLMAtkDfgOHA6EDqQPJA9sECwQYBDgETwRaBGMEdQSbBKMEsQS7BMAE2QTpBQAFVgWIBYoFjwW+BcYF6gX0B8gQxRDHEM0Q/xXhFfoWFBagFrQW+B0PHSIddx2RHp8e/yAmIDcgPSBCIFIgVyBxII4gpiCuIL8hFyEiITIhRCFLIVEhVyFfIYkhlCHEIdQh9SIFIgwiEyIeIi4iNSJIIlQiZSKHIqgivSLGIwIjGyMhI88j7yP9JQIlHCUkJSwlNCU8JWwlkyWhJbclwSXPJdgl5iYGJggmFCYgJjcmQiZnJm8mhSaXJqUmyCbPJugnAicJJw4nGCdEJ0wnZCfYKV0pyCtQK1gr6yxmLHEtJS4YLi4uOC5BLkswEjElpymnMac7p1uneaeBp6mnsPsF+x/7K/s1+zv7RPtO/wv//f//AAAAIAChALkA1wDeAPAA9wD+ATIBOAF/AY4BmgGnAbIBtwG7AckB3QH3AhwCNAI6AkECZAJqAncCfgKEApECrAK7AswC2QN+A4cDkQOjA7ED2wQCBBAEGgQ6BFQEYgRyBJIEogSuBLoEwATYBOgFAAUxBVkFigWPBb4FwwXQBfAHyBCgEMcQzRDQFeEV+hYUFqAWoha2HQAdGB13HZEenB78IBAgMCA5IEIgSCBXIHAgdCCgIKkgsCEXISIhMiFBIUshUCFTIVkhiSGQIcQhzyH1IgAiCCIRIhkiJSI0IkgiVCJgIoIioiK7IsMjACMYIyAjzyPpI/QlACUMJSQlLCU0JTwlUCWAJaAlsiW8JcYl2CXmJgAmCCYUJiAmMCY5JmAmaSaAJpAmoSbEJs8m6CcCJwknDicUJ0QnTCdjJ9gpXSnIK1ArWCvqLGUsbS0ALhguLi41LkEuSzASMSWnJqcwpzmnWqd5p4CnqKev+wD7Hfsr+zH7O/tE+0r/C//9////4//B/8D/qf+k/5T/jv+J/1b/UgAA/wMAAP7z/uz+6P7n/uL+z/62AAD+gP59/nv+ev55/nj+d/51/nT+a/5d/k3+Qf2d/ZX9jP2L/YT9cwAA/Uf9Rv1FAAD9Of0rAAD9Bfz7/PP87/zY/Mr8tPyE/IL8gfx9/E8AAPxA/Dv6aPGR8ZDxi/GJ7KjskOx36+zr6+vqAAAAAOV85WPkWeP9AADi2+La4tYAAOLK4rLisOKf4p3inOJF4jviLAAA4hbiEuIR4hDh5+Hh4bIAAOGF4XsAAOF04W8AAOFg4U7hQwAA4RsAAODsAAAAAAAA4JHf5AAA38UAAAAA3qben96Y3pHefgAA3lMAAAAAAADeKt4d3gTeA9343e3d3gAA3bzdu92rAAAAAAAA3WvdU9063TTdMAAA3P3c9tzg3G3a6dp/2PjY8dhg1+cAANdR1l/WSgAA1jrWMdRr01kAAAAAAAAAAF0QAAAAAAAAAAAAAAlsAAAJXwlXAAAFlQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAFsAAABfgAAAAAAAAAAAAAAAAAAAXoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFmAAAAAAAAAXIAAAAAAXoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABdAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWABfgAAAAAAAAAAAYoAAAAAAAABsAAAAAAAAAAAAAAAAAAAAAAAAAGyAAAAAAAAAAAAAAAAAAABqgAAAAABsAAAAAABtAAAAAAAAAHAAAAByAAAAdIB2AHcAAAAAAHeAAAB6AHsAAAAAAAAAAAAAAICAAACJgIwAjoAAAAAAAAAAAAAAAAAAAI+AAAAAAAAAkoCWAJgAAAAAAAAAAAAAAJeAAAAAAAAAAAAAAAAAAAAAAAAAAACUgAAAAAAAAJUAAAAAAAAAAACUgJYAloCXgAAAl4CYAJiAmQCbgAAAnAAAAAAAnQAAAJ6AAAAiwAAAIwAAAAAAI0AjgCPAAAAAACQAJYAlwAAAAAAmACZAK4ArwAAAAAAsACxAAAAAACyALMBTwAAAVABUQFSAAABUwFUAVUBVgGVAZYBlwAAAZgBmQGaAaEBogAAAAABowGkAAAAAAGlAaYCDgAAAAACDwLjAAAAAAAAAuQC5QAAAuYAAALnAugC6QAAAuoAAALrAuwAAALtAu4C7wAAAAAAAALwAvEC8gL9Av4AAAL/AwAAAAAAAAADAQMCAwMAAAMEAwUDBgAAAwcDCAMJAAAAAAAAAwoDGQMaAxsDHAAAAAADHQMeAAADHwMgA18AAAAAA2ADdwAAAAADeAAAA3kDgQOCAAADgwOEA44AAAOPA5ADkQAAA5IAAAAAA5MDmAOZA5oAAAObA5wDowAAA6QDpQAAAAADpgOqAAAAAAOrA6wAAAOtA64AAAOvA7ADtAO1AAAAAAO2A7cDuAPDAAADxAPFAAAAAAAAA8YAAAAAAAADxwAAAAAAAAPIAAAAAAAAA8kD6wAAAAAAAAPsAAAAAAAAA+0AAAAAAAAD7gAAAAAAAAPvA/AD8QPyA/UD9gAAAAAD9wP4A/kD+gAAAAAD+wP8A/0D/gAAAAAAAAP/AAAAAAQABAEEFgQXBBgAAAQZAAAAAAQaAAAEGwQxBDIAAAQzBDQAAAAABDUENgAAAAAAAAQ3BDgAAAAAAAAEOQQ/AAAAAAAABEAETgAABE8AAARQBHkAAAAABHoEfwSABIEEggSDBIQEhQAABIYEhwSIBIoEiwSMBI0EjgSPBJAEkQSSBJMAAASUBJUAAASWBJgAAAAAAAAEmQScBJ0EngAABJ8EoQAGAgoAAAAAAQAAAQAAAAAAAAAAAAAAAAAAAAEAAgAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgAGQAaABsAHAAdAB4AHwAgACEAIgAjACQAJQAmACcAKAApACoAKwAsAC0ALgAvADAAMQAyADMANAA1ADYANwA4ADkAOgA7ADwAPQA+AD8AQABBAEIAQwBEAEUARgBHAEgASQBKAEsATABNAE4ATwBQAFEAUgBTAFQAVQBWAFcAWABZAFoAWwBcAF0AXgBfAGAAYQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMHAHEAYwBkAGgDCQB3AIMAbwBqA10AdQBpA5gAAACBA40AcgObA5wAZgB2A30DhQAAAUQDkgBrAHoBNAAAAIYAfwBiAG0DiQCVA5YAAABsAHsDCgAAAAAAAAAAAAAAAAL/AwADBAMFAwEDAgCFAAAAAAAAAAADSQMTAxQEkQSSAwgAeAMDAwYDCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAEaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASACYAVACCALIA8AD8AR4BPgFgAXgBhAGSAZ4BwAHwAggCOAJqAowCsALcAvoDLgNaA2wDfgOqA74D6AQQBDoEWAR8BKIEvATUBOgFDAUkBToFVAV8BYwFrgXQBfAGDAY4BlgGggaUBq4G1Ab2BzAHVAd8B44HsAfEB+gH9AgGCCgISghwCJIIsgjQCPIJEAkiCUIJaAl6CZwJsgnSCfYKGgo4ClwKeAqOCrIKzgsICygLSgtsC3gLmgu6C8wL+gwkDFwMkgykDNoM7A0wDVANkg2iDbAOAg4QDjAOUA54DqgOug7SDu4O7g8EDywPbA+qD+oQNBBeEJgQwBDeEQoRQBFaEYIRoBHAEeYSDBIgEkwSbhKUEroS3BL0Ex4TUBNqE5gTtBPoE/4UIhROFHIUmBS8FNwVBBUsFVQVhhWuFdAV+BYgFiwWQBZiFnQWoBbCFu4XIBdQF2YXlhfAF+QYABgmGEwYcBikGM4Y6BkKGSwZThl8GaQZyhnsGhIaNhpeGoQarhrUGvobIBtKG2wbjhuwG9gb/hwqHFIceByYHLoc5B0IHS4dWh2GHaQdzh3wHhQePh5eHoQesB7MHuIfCh8wH0Ifah+MH7Af2B/0IBAgMiBUIIIgriDMIOohDCEqIUQhXiF+IZ4hxCHeIgYiICI8Il4iiiKqItAi7CMMIzAjZCOMI74j4CQEJCYkTCR0JJYkwiTuJQYlLiVWJWYljiW6JeYmFCYgJiwmOCZKJlYmdCaYJqgmzibmJw4nJidOJ2QnjCe0J9Yn+CgUKDQoRihiKIgomii+KOopJClIKXQpoinQKgQqOipeKpAqpirKKtwrAisuK0YrbCueK74r1Cv0LCAsPixYLHgsoizcLQAtNC1aLYQtsC3aLfAuCi4yLlgugC6eLrwu4C7wLxIvKi9wL6IvxC/sMAQwJjA+MF4wcDCMMLIwxDDkMRQxTjFmMYAxmDG0MdQx+DIUMkAyajKKMqwy0jL0MwQzJjNGM3gzqjPMM/I0CjQsNEQ0ZDR2NJo0wDTSNPI1GDVSNWo1hDWcNbg11jX4NhQ2PjZoNog2sjbWNug3CDcuN1Q3eDecN8A34jgMODY4TjhmOLI46DkUOT45Wjl2OZo5vjnqOhY6MDpOOmQ6jjqwOtQ69jsSOzg7WDt8O5o7uDveO/Q8EDw8PGA8ejyKPKw84Dz6PRo9UD1sPYo9pj3YPfQ+Hj44PmY+hD6yPtA+6j8EPzY/UD+CP5Q/wD/kQARAMkBEQFZAaEB8QI5ApkC2QNhA+kEcQURBXkGCQahBwEHiQhBCMkJQQmBCiEK+Qt5C/EMuQ0hDckOMQ6ZDwEPoRAZEKERMRHREkkSoRMRE5ET6RRxFLEVSRXxFnEXORe5GEkYkRlBGXkZwRoZGsEbIRuxG/kcURyBHMkdIR2hHdEeER55HvEfSR/pIBkgcSDxIYkh6SJpIvkjmSQhJHEk+SVhJbEmASZRJpknGSehKDEouSkRKbkqASppKwkriSvJLEEs6S2BLfEuuS8xL6EwKTCRMQkxqTJJMrkzITOJNCE0iTUZNak2MTbZN0k4MTixORE5mToZOpE7UTwBPKE9KT3JPnE/WT/xQLlBcUIhQrlDWUSBRSlFyUaRR1FH+UjhSWFKKUrpS/FMgU1ZTfFOyU9xUDFQwVHJUrlTOVPhVMFV2VaxV1FYKVkJWelamVsxW+FciVzpXVleAV7hX2FfyWBZYRlhwWJJYuljiWRBZLllQWW5Zllm6WeJaFlo2WlZailq2WuRbBlsiWz5bYFucW+ZcClwoXE5chlyeXMJc2lz+XQpdIl1gXYpdrl3GXeZeDl4wXlxeel6GXpheul7cXvRfFl9CX2JfiF+0X9ZgAGAkYDZgTmBuYKJg7GEYYWJhjGHEYe5iEmJWYoxisGK8YvJjFmNEY1JjZGN8Y55j2GQEZCZkRmSEZJpkxGTwZQ5lMmVQZXZlkGWoZbpl1GX8Zh5mPmZaZnxmjmaoZsxm7mcQZzJnXmeEZ6Zn0GgGaDBoVGiGaLZoxGjSaOBo7mkAaRJpJGlEaWRphGmcab5pzGnkahpqWGpqaohqsmrEauJrDGsua05ruGvYbABsXmyUbMps5m0AbSJtNG1ybZZtzG3sbf5uHG46bl5uem6qbtBu5G7ybwZvHm80b0pvam+Ab6hv2G/2cBRwOHBUcIRwqnC+cMxw4HD4cQ5xNnFkcZRxsnHgcgByMHJocpBywHL4cyRzRnOEc6xz2HQMdDp0anSQdM505nUQdT51hHWodc51/nYudnh2ona4dtx3AHc+d3x3ungAeEx4kHjceSx5anm0efp6THqceuZ7Entoe4R7oHu6e9R7/HwifFB8cnyifMZ89n0cfU59Zn2OfeR+DH5Efm5+qH7Oftx++n8IfyZ/Vn9+f65/5H/4gB6ARIBegHiAsIDKgOKBHIE8gV6BeIGigcqB8oIWgjqCcoKogsiC6IL6gwyDIIM2g2CDioOyg8yD7oREhHSEzoT2hSqFRIVehXyFnoXAheaGDIYshkKGVoZshoCGlIaihriG8ocyhz6HTIdah2yHfIeOh6CHtIfIh9yH8IgKiB6INIhKiGCIfIiSiKiIwojYiO6JCokgiTaJUolsiYiJqonEieCKBIoeijaKVopyioqKrIrQivSLJIsyi0CLTotci2qLzoySjOqM+I0OjSaNTI1kjYqNoo3Gjd6OBI4ijlaOdo68jtKO5o8Cj16Pko/GkA6QWJB6kLyQ7JE0kWaRgJGikcSR7pIOkjaSXpKOkrSS2pMQkziTWJN4k5iTzpQElCCUVJRylJCUvpTQlOiVCJUqlUKVXpWKlZ6VuJXYlf6WKpZcloqWpJbol1CXhpeyl96YEJhSmISYwpjymSqZdpmamcKaKJpWmnqanJqwmsaa6JsQm0ibdJugm8ab8pwUnDCcXpx4nJqcvJzmnPydHp0+nWKdeJ2Wnbqd4J4AniKePJ5annyekp68nuCfDp8mnzyfVJ90n46frJ/Sn/SgGqA6oG6gjqCmoMag4KD+oSihUKF6oYyhpKGwodyh9KISojCiVqKEorKixqLqoxyjSqN0o5ajwqPSo+SkHKREpHCkmqTIpOilDqVApWSldqWQpbal1KXopgimLKZKplymeqagprim8gAAAAIAAAAAAIADgAADAAcAABEzESMVMxUjgICAgAOA/YCAgAAAAAIAAAKAAYADgAADAAcAABEzESMBMxEjgIABAICAA4D/AAEA/wAAAAACAAAAAAKAA4AAGwAfAAATMxEzETMRMxUjFTMVIxEjESMRIxEjNTM1IzUzFxUzNYCAgICAgICAgICAgICAgICAA4D/AAEA/wCAgID/AAEA/wABAICAgICAgAAAAAUAAAAAAoADgAAHAAsADwATABsAAAEzFSEVITUzBTMVIzMhFSkBMxUjKQEVIxUjNSEBAIABAP4AgP8AgICAAYD+gAGAgID+AAIAgID/AAOAgICAgICAgICAgAAABwAAAAACgAOAAAMABwALAA8AEwAXABsAABEzESMBMxUrATMRKwEzFSsBMxEjJTMRIyUzFSOAgAIAgICAgICAgICAgIABgICA/gCAgAOA/wABAID/AID/AID/AICAAAAACAAAAAACgAOAAAMABwALABcAGwAfACMAJwAAATMVKwEzFSMlMxUrATMRMxEjNSM1IzUzITMVIyEzESMzIRUhJTMVIwEAgICAgIABAICAgICAgICAgAEAgID+AICAgAEA/wABgICAA4CAgICA/wD/AICAgID/AICAgAAAAAEAAAKAAIADgAADAAARMxEjgIADgP8AAAUAAAAAAYADgAADAAcACwAPABMAAAEzFSsBMxUrATMRIzsBFSM7ARUjAQCAgICAgICAgICAgICAgAOAgID+gICAAAAABQAAAAABgAOAAAMABwALAA8AEwAAETMVIzsBFSM7ARErATMVKwEzFSOAgICAgICAgICAgICAgAOAgID+gICAAAUAAAIAAYADgAADAAcACwAPABMAABEzFSMlMxUrATMVKwEzFSMlMxUjgIABAICAgICAgICAAQCAgAOAgICAgICAgAAAAQAAAIACgAMAAAsAAAEzESEVIREjESE1IQEAgAEA/wCA/wABAAMA/wCA/wABAIAAAQAA/4AAgACAAAMAADUzESOAgID/AAAAAQAAAYACgAIAAAMAABEhFSECgP2AAgCAAAAAAAEAAAAAAIAAgAADAAA1MxUjgICAgAAAAAUAAAAAAoADgAADAAcACwAPABMAAAEzFSsBMxErATMVKwEzESsBMxUjAgCAgICAgICAgICAgICAgAOAgP8AgP8AgAAABQAAAAACgAOAAAMACwATABcAGwAAEyEVISMzETMVIxUjATMRIxEjNTMFMxUjAyEVIYABgP6AgICAgIACAICAgID/AICAgAGA/oADgID+gICAAoD9gAGAgICA/wCAAAAAAQAAAAACgAOAAAsAAAEzESEVITUhESM1MwEAgAEA/YABAICAA4D9AICAAgCAAAAABgAAAAACgAOAAAMABwALAA8AEwAbAAATIRUhIzMVIyUzESMpARUhIzMVKwEzFSE1MxEhgAGA/oCAgIACAICA/wABAP8AgICAgIABgID9gAOAgICA/wCAgICA/wAAAAAABwAAAAACgAOAAAMABwALAA8AEwAXABsAABMhFSEjMxUjJTMRIykBFSkBMxEjJTMVIzMhFSGAAYD+gICAgAIAgID/AAEA/wABAICA/gCAgIABgP6AA4CAgID/AID/AICAgAAAAAMAAAAAAoADgAALAA8AEwAAASERIxEhETMVIRErATMVKwEzFSMBgAEAgP4AgAGAgICAgICAgAOA/IABAAEAgAGAgIAABAAAAAACgAOAAAcACwAPABMAABEhFSEVIRUpATMRIyUzFSMzIRUhAoD+AAGA/gACAICA/gCAgIABgP6AA4CAgID+gICAgAAABQAAAAACgAOAAAMABwAPABMAFwAAASEVISMzFSsBMxUhFSERIwEzESMpARUhAQABAP8AgICAgIABgP6AgAIAgID+gAGA/oADgICAgID/AAEA/wCAAAAAAAMAAAAAAoADgAAHAAsADwAAESERIxEhFSMFMxUrATMRIwKAgP6AgAGAgICAgIADgP6AAQCAgID+gAAAAAcAAAAAAoADgAADAAcACwAPABMAFwAbAAATIRUhIzMRIwEzESMpARUhIzMRIwEzESMpARUhgAGA/oCAgIACAICA/oABgP6AgICAAgCAgP6AAYD+gAOAgP8AAQD/AID/AAEA/wCAAAAABQAAAAACgAOAAAMABwAPABMAFwAAEyEVISMzESMBMxEjNSE1IQMzFSMpARUhgAGA/oCAgIACAICA/oABgICAgP8AAQD/AAOAgP8AAQD+AICA/wCAgAAAAAIAAAAAAIACgAADAAcAABEzFSMRMxUjgICAgAKAgP6AgAAAAAIAAP+AAIACgAADAAcAABEzFSMRMxEjgICAgAKAgP6A/wAAAAcAAAAAAgADgAADAAcACwAPABMAFwAbAAABMxUrATMVKwEzFSsBMxUjOwEVIzsBFSM7ARUjAYCAgICAgICAgICAgICAgICAgICAgAOAgICAgICAgAAAAAACAAAAgAKAAoAAAwAHAAARIRUhESEVIQKA/YACgP2AAoCA/wCAAAAABwAAAAACAAOAAAMABwALAA8AEwAXABsAABEzFSM7ARUjOwEVIzsBFSsBMxUrATMVKwEzFSOAgICAgICAgICAgICAgICAgICAgAOAgICAgICAgAAABgAAAAACgAOAAAMABwALAA8AEwAXAAATIRUhIzMVIyUzESsBMxUrATMVIxUzFSOAAYD+gICAgAIAgICAgICAgICAgAOAgICA/wCAgICAAAAEAAD/gAMAAwAAAwAHABEAFQAAEyEVISMzESMBMxEhESEVIxUhASEVIYACAP4AgICAAoCA/gABAIABAP4AAgD+AAMAgP2AAoD+AAGAgID/AIAAAAACAAAAAAKAA4AAAwAPAAATIRUhIzMVITUzESMRIREjgAGA/oCAgAGAgID+gIADgICAgP0AAgD+AAAAAAADAAAAAAKAA4AACwAPABMAABEhFSEVIRUhESEVIQEzFSMVMxEjAgD+gAGA/oABgP4AAgCAgICAA4CAgID+gIADAICA/oAAAAAFAAAAAAKAA4AAAwAHAAsADwATAAATIRUhIzMRIwEzFSMRMxUjKQEVIYABgP6AgICAAgCAgICA/oABgP6AA4CA/YACgID+gICAAAAAAgAAAAACgAOAAAcACwAAESEVIREhFSEBMxEjAgD+gAGA/gACAICAA4CA/YCAAwD9gAAAAAEAAAAAAoADgAALAAARIRUhFSEVIREhFSECgP4AAQD/AAIA/YADgICAgP6AgAAAAAEAAAAAAoADgAAJAAARIRUhFSEVIREjAoD+AAEA/wCAA4CAgID+AAAEAAAAAAKAA4AAAwAHAA0AEQAAEyEVISMzESMBIREjESMBIRUhgAIA/gCAgIABgAEAgID/AAGA/oADgID9gAIA/gABgP6AgAABAAAAAAKAA4AACwAAETMRIREzESMRIREjgAGAgID+gIADgP8AAQD8gAIA/gAAAAABAAAAAAGAA4AACwAAESEVIxEzFSE1MxEjAYCAgP6AgIADgID9gICAAoAAAAMAAAAAAoADgAADAAcACwAAATMRIyUzFSMzIRUhAgCAgP4AgICAAYD+gAOA/QCAgIAAAAAFAAAAAAKAA4AABwALAA8AEwAXAAARMxEhFSERIwEzFSsBMxUjFTMVIzsBESOAAQD/AIACAICAgICAgICAgIADgP8AgP4AA4CAgICA/oAAAAEAAAAAAoADgAAFAAARMxEhFSGAAgD9gAOA/QCAAAAAAwAAAAACgAOAAAcADwATAAARMxUzFSMRIwEzESMRIzUzBTMVI4CAgIACAICAgID/AICAA4CAgP2AA4D8gAKAgICAAAADAAAAAAKAA4AABwAPABMAABEzFTMVIxEjATMRIxEjNTMlMxUjgICAgAIAgICAgP8AgIADgICA/YADgPyAAYCAgIAAAAQAAAAAAoADgAADAAcACwAPAAATIRUhIzMRIwEzESMpARUhgAGA/oCAgIACAICA/oABgP6AA4CA/YACgP2AgAACAAAAAAKAA4AACQANAAARIRUhFSEVIREjATMVIwIA/oABgP6AgAIAgIADgICAgP4AAwCAAAAAAAYAAAAAAoADgAADAAcACwAPABMAFwAAEyEVISMzESMBMxErATMVIykBFSElMxUjgAGA/oCAgIACAICAgICA/wABAP8AAYCAgAOAgP2AAoD+AICAgIAAAAADAAAAAAKAA4AACQANABEAABEhFSEVIRUhESMBMxUjFTMRIwIA/oABgP6AgAIAgICAgAOAgICA/gADAICA/gAABgAAAAACgAOAAAMABwALAA8AEwAXAAATIRUhIzMVIzMhFSkBMxEjJTMVIzMhFSGAAgD+AICAgIABgP6AAYCAgP4AgICAAYD+gAOAgICA/oCAgIAAAQAAAAACgAOAAAcAABEhFSERIxEhAoD/AID/AAOAgP0AAwAAAwAAAAACgAOAAAMABwALAAARMxEjATMRIykBFSGAgAIAgID+gAGA/oADgP0AAwD9AIAAAAUAAAAAAoADgAADAAcACwAPABMAABEzESMBMxEjITMRIwEzESsBMxUjgIACAICA/oCAgAEAgICAgIADgP4AAgD+AP8AAQD/AIAAAAADAAAAAAKAA4AABwAPABMAABEzETMVIxUjATMRIzUjNTMlMxUjgICAgAIAgICAgP8AgIADgP2AgIADgPyAgICAgAAAAAkAAAAAAoADgAADAAcACwAPABMAFwAbAB8AIwAAETMVIyUzFSMhMxUjJTMVKwEzFSsBMxUjJTMVIyEzESMBMxEjgIACAICA/oCAgAEAgICAgICAgIABAICA/oCAgAIAgIADgICAgICAgICAgID+gAGA/oAABQAAAAACgAOAAAMABwALAA8AEwAAETMVIyUzFSMhMxUjJTMVKwEzESOAgAIAgID+gICAAQCAgICAgAOAgICAgICA/YAAAAAABQAAAAACgAOAAAUACQANABEAFwAAESERIzUhBTMVKwEzFSsBMxUrATMVIRUhAoCA/gABgICAgICAgICAgIACAP2AA4D/AICAgICAgIAAAAABAAAAAAGAA4AABwAAESEVIREhFSEBgP8AAQD+gAOAgP2AgAAFAAAAAAKAA4AAAwAHAAsADwATAAARMxUjOwERIzsBFSM7AREjOwEVI4CAgICAgICAgICAgICAA4CA/wCA/wCAAAAAAAEAAAAAAYADgAAHAAARIREhNSERIQGA/oABAP8AA4D8gIACgAAAAAAFAAACAAKAA4AAAwAHAAsADwATAAABMxUrATMVIyUzFSMhMxUjJTMVIwEAgICAgIABAICA/oCAgAIAgIADgICAgICAgIAAAAABAAD/gAKAAAAAAwAAMSEVIQKA/YCAAAACAAACgAEAA4AAAwAHAAARMxUjOwEVI4CAgICAA4CAgAAAAAADAAAAAAKAAoAAAwANABEAABMhFSkBMxEhNSE1ITUhBTMVI4ABgP6AAYCA/gABgP6AAYD+AICAAoCA/gCAgICAgAAAAAMAAAAAAoADgAAJAA0AEQAAETMRMxUjESEVIQEhFSkBMxEjgICAAYD+AAEAAQD/AAEAgIADgP6AgP8AgAKAgP6AAAAABQAAAAACgAKAAAMABwALAA8AEwAAEyEVISMzESMBMxUjFTMVIykBFSGAAYD+gICAgAIAgICAgP6AAYD+gAKAgP6AAYCAgICAAAAAAAMAAAAAAoADgAAJAA0AEQAAATMRITUhESM1MyUhFSEjMxEjAgCA/gABgICA/oABAP8AgICAA4D8gIABAICAgP6AAAAAAwAAAAACgAKAAAMADQARAAATIRUhIzMVITUzESEVIzMhFSGAAYD+gICAAYCA/gCAgAIA/gACgICAgP8AgIAAAAIAAAAAAgADgAADAA8AAAEhFSEjMxUhFSERIxEjNTMBAAEA/wCAgAEA/wCAgIADgICAgP4AAgCAAAAAAAMAAP+AAoACgAAJAA0AEQAAEyERIzUhNSERISMzESMRIRUhgAIAgP6AAYD+gICAgAIA/gACgP2AgIABAP8A/wCAAAAAAwAAAAACgAOAAAcACwAPAAARMxEzFSMRIwEhFSkBMxEjgICAgAEAAQD/AAEAgIADgP6AgP6AAoCA/gAAAgAAAAAAgAOAAAMABwAAETMVIxUzESOAgICAA4CAgP2AAAAABAAA/4ACgAOAAAMABwALAA8AAAEzFSMVMxEjATMRIzMhFSECAICAgID+AICAgAGA/oADgICA/YABAP8AgAAAAAUAAAAAAgADgAAHAAsADwATABcAABEzETMVIxEjATMVKwEzFSMVMxUjOwEVI4CAgIABgICAgICAgICAgIADgP4AgP8AAoCAgICAgAACAAAAAAEAA4AAAwAHAAARMxEjOwEVI4CAgICAA4D9AIAAAAAEAAAAAAKAAoAABQAJAA0AEQAAESEVIxEjATMVKwEzESMBMxEjAQCAgAGAgICAgIABAICAAoCA/gACgID/AAEA/gAAAAIAAAAAAoACgAAFAAkAABEhFSERIwEzESMCAP6AgAIAgIACgID+AAIA/gAABAAAAAACgAKAAAMABwALAA8AABMhFSEjMxEjATMRIykBFSGAAYD+gICAgAIAgID+gAGA/oACgID+gAGA/oCAAAMAAP+AAoACgAALAA8AEwAAETMVMxUjFSEVIREjASEVKQEzESOAgIABgP6AgAEAAQD/AAEAgIACgICAgID/AAMAgP8AAAAAAAMAAP+AAoACgAADAA8AEwAAEyEVISUzESMRITUhNSM1MyEzESOAAQD/AAGAgID+gAGAgID+AICAAoCAgP0AAQCAgID/AAAAAAMAAAAAAoACgAAHAAsADwAAETMVMxUjESMBIRUpATMVI4CAgIABAAEA/wABAICAAoCAgP6AAoCAgAAAAAUAAAAAAoACgAADAAcACwAPABMAABMhFSEjMxUjMyEVKQEzFSMpARUhgAIA/gCAgICAAYD+gAGAgID+AAIA/gACgICAgICAAAIAAAAAAYADgAALAA8AABMzETMVIxEjESM1MxMzFSOAgICAgICAgICAA4D/AID+gAGAgP4AgAAAAgAAAAACgAKAAAMACQAAETMRIwEzESE1IYCAAgCA/gABgAKA/gACAP2AgAAFAAAAAAKAAoAAAwAHAAsADwATAAARMxEjATMRIyEzFSMlMxUrATMVI4CAAgCAgP6AgIABAICAgICAAoD+gAGA/oCAgICAAAACAAAAAAKAAoAAAwANAAARMxEjATMRITUzETMRM4CAAgCA/gCAgIACgP4AAgD9gIABAP8AAAAAAAkAAAAAAoACgAADAAcACwAPABMAFwAbAB8AIwAAETMVIyUzFSMhMxUjJTMVKwEzFSsBMxUjJTMVIyEzFSMlMxUjgIACAICA/oCAgAEAgICAgICAgIABAICA/oCAgAIAgIACgICAgICAgICAgICAgIAAAAAAAwAA/4ACgAKAAAMACwAPAAARMxEjATMRIzUhNSEBIRUhgIACAICA/oABgP4AAgD+AAKA/oABgP2AgID/AIAAAAMAAAAAAoACgAAHAAsAEwAAESEVIxUjNSEFMxUrATMVIRUhNTMCgICA/oABAICAgIABgP2AgAKAgICAgICAgIAAAAAABQAAAAABgAOAAAMABwALAA8AEwAAATMVKwEzESsBMxUjOwERIzsBFSMBAICAgICAgICAgICAgICAA4CA/wCA/wCAAAABAAAAAACAA4AAAwAAETMRI4CAA4D8gAAFAAAAAAGAA4AAAwAHAAsADwATAAARMxUjOwERIzsBFSsBMxErATMVI4CAgICAgICAgICAgICAA4CA/wCA/wCAAAAAAAQAAAKAAwADgAADAAcACwAPAAATIRUhJTMVIyEzFSMlIRUhgAEA/wACAICA/YCAgAGAAQD/AAOAgICAgICAAAACAAD/gACAAwAAAwAHAAARMxUjFTMRI4CAgIADAICA/YAAAAAFAAD/gAKAAwAABwALAA8AEwAbAAABMxUzFSE1MwUzESMBMxUjFTMVIykBFSMVIzUjAQCAgP6AgP8AgIACAICAgID+gAGAgICAAwCAgICA/oABgICAgICAgAAAAAMAAAAAAoADgAADABMAFwAAASEVISMzESEVIREhFSE1MxEjNTMBMxUjAQABAP8AgIABAP8AAYD9gICAgAGAgIADgID/AID/AICAAQCAAQCAAAAAAAgAAAAAA4ACgAADAAcACwAPABMAFwAbAB8AABEzFSMlIRUhJTMVIyEzESMBMxEjITMVIyUhFSElMxUjgIABAAGA/oACAICA/YCAgAIAgID9gICAAQABgP6AAgCAgAKAgICAgID+gAGA/oCAgICAgAAFAAAAAAKAA4AAAwAHAAsADwAjAAARMxUjJTMVIyEzFSMlMxUrATMVIRUhFSEVIRUjNSE1ITUhNSGAgAIAgID+gICAAQCAgICAAQD/AAEA/wCA/wABAP8AAQADgICAgICAgICAgICAgICAgAACAAAAAACAA4AAAwAHAAARMxEjFTMRI4CAgIADgP6AgP6AAAAIAAAAAAKAA4AAAwAHAAsADwATABcAGwAfAAATIRUhIzMVIzMhFSEjMxUjJTMVIykBFSkBMxUjKQEVIYACAP4AgICAgAGA/oCAgIACAICA/oABgP6AAYCAgP4AAgD+AAOAgICAgICAgICAAAACAAADAAGAA4AAAwAHAAARMxUjJTMVI4CAAQCAgAOAgICAAAAJAAAAAAOAA4AAAwAHAAsADwAXABsAHwAjACcAAAEhFSEjMxUjJTMVIyEzESMBIRUhFSEVIQEzESMhMxUjJTMVIykBFSEBAAGA/oCAgIACAICA/YCAgAEAAYD/AAEA/oACAICA/YCAgAIAgID+gAGA/oADgICAgID+gAGAgICAAYD+gICAgIAAAwAAAIACAAOAAAMACwAPAAATIRUpATMRITUjNSEBIRUhgAEA/wABAID+gIABgP6AAgD+AAOAgP6AgID+gIAAAAoAAACAAwADAAADAAcACwAPABMAFwAbAB8AIwAnAAABMxUjJTMVIyEzFSMlMxUjITMVIyUzFSMhMxUjJTMVIyEzFSMlMxUjAQCAgAGAgID+AICAAYCAgP4AgIABgICA/wCAgAGAgID/AICAAYCAgAMAgICAgICAgICAgICAgICAAAAAAAEAAACAAoACAAAFAAARIREjESECgID+AAIA/oABAAAAAQAAAQABgAGAAAMAABEhFSEBgP6AAYCAAAAAAAsAAAAAA4ADgAAHAAsADwATABsAHwAjACcAKwAvADMAAAEhFSMVIzUrATMVIyUzFSMhMxEjATMVMxUjFSMBMxUjJTMRIyUzFSMhMxUjJTMVIykBFSEBAAGAgICAgICAAgCAgP2AgIABAICAgIABAICAAQCAgP8AgID+gICAAgCAgP6AAYD+gAOAgICAgICA/oABgICAgAGAgID+gICAgICAgAAAAQAAAwACgAOAAAMAABEhFSECgP2AA4CAAAAAAAQAAAGAAgADgAADAAcACwAPAAATIRUhIzMRIwEzESMpARUhgAEA/wCAgIABgICA/wABAP8AA4CA/wABAP8AgAACAAAAAAKAA4AACwAPAAABMxEhFSERIxEhNSEBIRUhAQCAAQD/AID/AAEA/wACgP2AA4D/AID/AAEAgP4AgAAABQAAAQACAAOAAAMABwALAA8AFwAAEyEVISMzFSMlMxUrATMVKwEzFSEVITUzgAEA/wCAgIABgICAgICAgIABAP4AgAOAgICAgICAgIAAAAAHAAABAAIAA4AAAwAHAAsADwATABcAGwAAEyEVISMzFSMlMxUrATMVIyEzFSMlMxUjKQEVIYABAP8AgICAAYCAgICAgP8AgIABgICA/wABAP8AA4CAgICAgICAgIAAAAACAAACgAEAA4AAAwAHAAATMxUrATMVI4CAgICAgAOAgIAAAAACAAD/gAKAAoAABwALAAARMxEhFSEVIwEzESOAAYD+gIACAICAAoD+AICAAwD+AAABAAAAAAMAA4AADwAAEyEVIxEjESMRIxEjNSM1M4ACgICAgICAgIADgID9AAMA/QACAICAAAAAAAEAAAEAAYADgAALAAATMxEzFSE1MxEjNTOAgID+gICAgAOA/gCAgAEAgAAABQAAAIACAAOAAAMABwALAA8AEwAAEyEVISMzESMBMxEjKQEVIQchFSGAAQD/AICAgAGAgID/AAEA/wCAAgD+AAOAgP8AAQD/AICAgAAAAAAKAAAAgAMAAwAAAwAHAAsADwATABcAGwAfACMAJwAAETMVIyUzFSMhMxUjJTMVIyEzFSMlMxUjITMVIyUzFSMhMxUjJTMVI4CAAYCAgP8AgIABgICA/wCAgAGAgID+AICAAYCAgP4AgIABgICAAwCAgICAgICAgICAgICAgIAAAAcAAAAAA4ADgAAHAAsADwATAB8AIwAnAAATMxEjESM1MyUzFSsBMxErATMVIyUhESM1IREzFTM1IyEzESsBMxUjgICAgIACAICAgICAgICAAQABAID/AICAgP6AgICAgIADgP4AAQCAgID/AICA/gCAAQCAgP8AgAAAAAAIAAAAAAOAA4AABwALAA8AEwAZAB0AIwAnAAATMxEjESM1MyUzFSsBMxErATMVIyUhESM1IyEzESMlMxUzFSElMxUjgICAgIACAICAgICAgICAAQABAICA/oCAgAGAgID/AP4AgIADgP4AAQCAgID/AICA/wCA/wCAgICAgAAAAAkAAAAAA4ADgAAHAAsADwATABcAGwAnACsALwAAESEVIxUjNSMlMxUrATMRIyUzFSMpARUhJTMVIyUhESM1IREzFTM1IyEzESsBMxUjAYCAgIACgICAgICA/wCAgP8AAQD/AAGAgIABAAEAgP8AgICA/oCAgICAgAOAgICAgID/AICAgICAgP4AgAEAgID/AIAAAAAGAAD/gAKAAwAAAwAHAAsADwATABcAAAEzFSMVMxUrATMVKwEzESMlMxUjKQEVIQEAgICAgICAgICAgAIAgID+gAGA/oADAICAgID/AICAgAAAAAAJAAAAgAKAAwAAAwAHAAsADwATABcAGwAfACMAABEzFSMlMxUjITMVIyUzFSsBMxUrATMVIyUzFSMhMxUjJTMVI4CAAgCAgP6AgIABAICAgICAgICAAQCAgP6AgIACAICAAwCAgICAgICAgICAgICAAAAAAAMAAAAAAoADgAAJABMAFwAAEyEVMxEjESMRISMzETMRIRUhNSMBMxUjgAGAgICA/wCAgIABAP6AgAEAgIADgID9gAGAAQD+gP8AgIABgIAAAgAAAAACgAOAAAsADwAAETMRIRUhFSEVIREjATMVI4ABgP6AAYD+gIACAICAA4D/AICAgP8AAgCAAAAABgAA/4ACgAOAAAMABwALAA8AEwAXAAATIRUhIzMRIwEzFSMpARUpATMRIykBFSGAAYD+gICAgAIAgID/AAEA/wABAICA/wABAP8AA4CA/IADgICA/oCAAAcAAAAAAoADgAADAAcACwAPABcAGwAfAAATIRUhJTMVKwEzFSsBMxUjJTMRIzUhNSEFMxUjMyEVIYABAP8AAYCAgICAgICAgAEAgID+gAGA/gCAgIABgP6AA4CAgICAgID+AICAgICAAAAAAAMAAACAAoADAAADAAcACwAAATMVIwUhFSEFMxUjAQCAgP8AAoD9gAEAgIADAICAgICAAAADAAAAAAKAAoAACQATABcAABMhFTMRIxEjNSEjMxEzFSEVITUjATMVI4ABgICAgP8AgICAAQD+gIABAICAAoCA/oABAID/AICAgAEAgAAAAAIAAP+AAoADgAALAA8AABEzESEVIREhFSERIwEzESOAAYD+gAGA/oCAAgCAgAOA/wCA/wCA/wACgP8AAAQAAAAAAoADgAADAAcACwAPAAARMxEjATMRIyUzFSMzIRUhgIACAICA/gCAgIABgP6AA4D+AAIA/QCAgIAAAAAFAAD/gAIAA4AAAwAHAAsADwATAAARMxUjJTMVIwUzESMBMxEjKQEVIYCAAYCAgP6AgIABgICA/oABgP6AA4CAgICA/gACAP2AgAAABQAAAAACAAKAAAcACwAPABMAFwAAETMRMxUjESMBMxUrATMVIxUzFSM7ARUjgICAgAGAgICAgICAgICAgAKA/wCA/wACgICAgICAAAIAAAAAAYADgAADAAcAABMhFSEjMxEjgAEA/wCAgIADgID9AAAAAAAEAAAAAAOAA4AADQARABUAGQAAEyEVIRUhFSERIRUhESsBMxUjJTMVIxUzESOAAoD+gAGA/oABgP4AgICAgAMAgICAgAOAgICA/oCAAwCAgICA/oAAAAAAAgAAAAADAAOAAA0AEQAAEzMRIRUhESEVIREjNTMBMxEjgIABgP6AAYD+AICAAgCAgAOA/oCA/wCAAoCA/oD/AAAAAAADAAAAAAMAA4AADQARABUAABMzETMVIxEhFSERIzUzBSEVKQEzESOAgICAAYD+AICAAQABAP8AAQCAgAOA/oCA/wCAAoCAgID+gAAABQAAAAACgAOAAAMABwALAA8AEwAAEyEVISMzFSMlMxEjJTMVIzMhFSGAAYD+gICAgAIAgID+AICAgAGA/oADgICAgP2AgICAAAAAAAIAAAAAAwADgAAPABMAABMhFSEVMxUjESEVIREjNTMlMxEjgAIA/oCAgAGA/gCAgAIAgIADgICAgP6AgAIAgID9gAAAAQAAAAACgAOAAAsAABEhESE1ITUhNSERIQKA/YACAP8AAQD+AAOA/ICAgIABgAAABAAAAAACgAOAAAMABwARABUAABMhFSEjMxUjJTMRIxEhESMRIQEhFSGAAYD+gICAgAIAgID+gIACAP6AAYD+gAOAgICA/YABAP8AAYD+gIAAAAAABwAAAAACgAOAAAMABwALAA8AEwAXABsAABMhFSEjMxEjATMVIwUhFSEjMxEjJTMVIykBFSGAAYD+gICAgAIAgID+gAEA/wCAgIACAICA/oABgP6AA4CA/wABAICAgP8AgICAAAIAAP+AAwADgAAJAA0AABMhFSEVIRUhESsBMxUjgAKA/gABAP8AgICAgAOAgICA/gCAAAAFAAD/gAKAA4AAAwAPABMAFwAbAAABMxUrATMRMxUjESMRIzUzATMVIwEzFSM7ARUjAYCAgICAgICAgIABAICA/gCAgICAgAOAgP8AgP6AAYCAAQCA/gCAgAAAAAIAAAAAAYADgAALAA8AABMzETMVIxEjESM1MxMzFSOAgICAgICAgICAA4D+gID/AAEAgP6AgAAABgAAAAACgAOAAAMADwATABcAGwAfAAARIRUpATMVMxUjFSM1IzUzAzMVIyUzFSMhMxEjATMRIwEA/wABAICAgICAgICAgAEAgID+gICAAgCAgAOAgICAgICA/wCAgID/AAEA/wAAAAACAAD/gAKAAoAABQAJAAARIRUhESMBMxEjAgD+gIACAICAAoCA/gACAP2AAAMAAAAAAoADgAADAA8AEwAAEyEVISMzESERMxEjESERIzMhFSGAAYD+gICAAYCAgP6AgIABgP6AA4CA/wABAP2AAQD/AIAAAAYAAAAAAoADgAADAAcACwAPABMAFwAAESEVKQEzFSMpARUhIzMRIyUzFSMpARUhAgD+AAIAgID+gAGA/oCAgIACAICA/oABgP6AA4CAgID+gICAgAAAAAAFAAAAAAKAAoAAAwAHAAsADwATAAARIRUpATMVIykBFSEjMxUjMyEVIQIA/gACAICA/oABgP6AgICAgAIA/gACgICAgICAAAAFAAAAAAKAA4AABQAJAA0AEQAXAAARIRUhFSM7ARUjOwEVKwEzFSsBMxUhFSECgP4AgICAgICAgICAgICAAgD9gAOAgICAgICAgAAABAAA/4ACgAOAAAMABwAPABMAABMzFSsBMxUjJTMRIxEjNTMTIRUhgICAgICAAQCAgICAgAEA/wADgICAgP0AAgCA/YCAAAAABAAAAAACgAOAAAUACQANABEAABEzESEVIQEzFSM7ARErATMVI4ABAP6AAYCAgICAgICAgAOA/QCAA4CA/gCAAAUAAP+AAoADgAAFAAkADQARABUAABEhESM1IQUhFSkBMxEjJTMVIzMhFSECgID+AAEAAQD/AAEAgID+AICAgAGA/oADgP8AgICA/gCAgIAABQAA/4ACgAOAAAUACQANABEAFQAAESEVIRUjMyEVISMzESMlMxUjKQEVIQKA/gCAgAEA/wCAgIACAICA/oABgP6AA4CAgID+AICAgAAAAAAFAAD/gAKAAoAABQAJAA0AEQAVAAARIRUhFSMzIRUhIzMRIyUzFSMpARUhAoD+AICAAQD/AICAgAIAgID+gAGA/oACgICAgP8AgICAAAAAAAUAAAAAAoADgAADAAcACwAXAB8AABMhFSEjMxUjJTMVKwEzFTMVIRUjNSM1IQEzFSE1MxEhgAGA/oCAgIACAICAgICA/oCAgAGA/oCAAYCA/YADgICAgICAgICAgP8AgID/AAAEAAAAAAKAA4AACQANABEAFQAAESEVIRUhFSERIwEzESMlMxUjMyEVIQKA/oABAP6AgAIAgID+AICAgAGA/oADgICAgAEA/wD+gICAgAAAAAMAAAAAAoACgAAJAA0AEQAAESEVIRUhFSERIwEzFSMpARUhAoD+gAEA/oCAAgCAgP4AAgD+AAKAgICAAQD/AICAAAAABAAAAAACgAOAAAsADwATABcAABMzETMVIxUjNSM1MxMhFSkBMxUjKQEVIYCAgICAgICAAQD/AAEAgID+AAIA/gADgP8AgICAgP8AgICAAAAEAAD/gAKAAoAACwAPABMAFwAAETMVMxUjESEVIRUjASEVKQEzESsBMxUjgICAAQD/AIABAAEA/wABAICAgICAAoCAgP8AgIADAID/AIAAAAEAAAAAAIADgAADAAARMxEjgIADgPyAAAIAAAAAAYADgAADAAcAABEzESMBMxEjgIABAICAA4D8gAOA/IAAAAABAAAAAAKAA4AAEwAAATMRIRUhFSEVIREjESE1ITUhNSEBAIABAP8AAQD/AID/AAEA/wABAAOA/wCAgID/AAEAgICAAAIAAAAAAIADgAADAAcAABEzESMVMxUjgICAgAOA/YCAgAAAAAYAAP+AA4ADgAADAAcACwAPABMAFwAAETMRIwEzFSMVMxEjATMRIyUzFSMpARUhgIADAICAgID+gICA/wCAgAGAAQD/AAOA/QADAICA/YABAP8AgICAAAADAAAAAAKAAoAAAwANABEAABEhFSkBMxEjNSEVIxEhASEVIQIA/gACAICA/oCAAgD+gAGA/oACgID+gICAAQD/AIAAAAUAAP+AAoADgAALAA8AEwAXABsAABEzFTMVIxEzFSMRIwEhFSkBMxErATMVKwEzFSOAgICAgIABAAEA/wABAICAgICAgICAA4CAgP6AgP8ABACA/wCAgAAHAAD/gAKAA4AAAwAHAAsAEQAVABkAHQAAEyEVISMzFSMlMxUrATMRITUzFzMRKwEzFSMpARUhgAGA/oCAgIACAICAgID/AICAgICAgID+gAGA/oADgICAgID/AICA/wCAgAAABwAA/4ACgAKAAAMABwALAA8AEwAXABsAABMhFSEjMxUjJTMVIykBFSkBMxUrATMVIykBFSGAAYD+gICAgAIAgID/AAEA/wABAICAgICA/oABgP6AAoCAgICAgICAgAAAAgAA/4ACgAOAAAUACQAAESEVIREjATMRIwIA/oCAAgCAgAOAgP0AAwD8gAAFAAD/gAOAA4AADQARABUAGQAdAAABMxEzFSMVITUhESM1MyUhFSEjMxEjITMVKwEzFSMCAICAgP4AAYCAgP6AAQD/AICAgAMAgICAgIADgP2AgICAAQCAgID+gICAAAAFAAD/gAKAA4AABQAJAA0AEQAZAAARIREjNSEFMxUrATMVKwEzFSsBMxUhESM1IQKAgP4AAYCAgICAgICAgICAAgCA/gADgP8AgICAgICA/wCAAAADAAD/gAKAAoAABwALABUAABEhFSMVIzUhBTMVKwEzFSERIzUhNTMCgICA/oABAICAgIABgID+AIACgICAgICAgP8AgIAAAAADAAD/gAGAA4AABwALAA8AABEzETMVIxUjJTMVKwEzFSOAgICAAQCAgICAgAOA/YCAgICAgAAAAAQAAP+AA4ACgAAFAA0AEQAVAAARIRUhESMBMxEzFSMVIyUzFSsBMxUjAgD+gIACAICAgIABAICAgICAAoCA/gACAP8AgICAgIAAAAADAAAAAAIAA4AADwATABcAABMzETMVIxUzFSMVIxEjNTMBMxUrATMVI4CAgICAgICAgAEAgICAgIADgP8AgICAgAGAgP6AgIAAAAAAAQAAAAACgAOAABcAABMhFTMRIxEjFSM1IxUzESMVIxEzFSE1IYABgICAgICAgICAgAEA/wADgID9AAIAgICA/wCAAwCAgAAABwAAAAACgAOAAAMACwAPABMAFwAbAB8AABMhFSEjMxEzFSMVIwEzFSsBMxUrATMVIwUzFSMpARUhgAGA/oCAgICAgAIAgICAgICAgIABAICA/oABgP6AA4CA/oCAgAKAgICAgICAAAAEAAAAAAKAAoAABwARABUAGQAAEyEVMxUhNSEjMxEzFSEVITUjATMVIyEzFSOAAYCA/wD/AICAgAEA/oCAAQCAgAEAgIACgICAgP8AgICAAQCAgAABAAAAAAMAA4AADQAAEzMRMxUjESEVIREjNTOAgICAAgD9gICAA4D+gID/AIABgIAAAAAAAgAAAAACgAOAABEAFQAAESERIzUjFTMVIxEjESM1MxEhETMVIwKAgICAgICAgP8AgIADgP8AgICA/gABAIABgP4AgAAEAAAAAAKAA4AAAwAHAAsAEQAAEyEVISMzFSMlMxEjKQEVIxEjgAGA/oCAgIACAICA/wABAICAA4CAgID+gID/AAAAAAQAAAAAAoACgAADAAcACwARAAATIRUhIzMVIyUzESMpARUjFSOAAYD+gICAgAIAgID/AAEAgIACgICAgP8AgIAAAAAAAwAAAAADAAOAABMAFwAbAAATIRUhFSEVIRUhFSEVIRUhESM1MwEzFSMVMxEjgAIA/oABgP6AAQD/AAGA/gCAgAIAgICAgAOAgICAgICAgAEAgAGAgID+gAAAAAACAAAAAAOAA4AAEwAXAAATMxEhETMRMxUjESMRIREjESM1MxMhFSGAgAGAgICAgP6AgICAgAGA/oADgP8AAQD/AID+gAGA/oABgID+AIAAAAUAAAAAAoADgAADAAcACwAPABMAAAEzFSsBMxEjATMRIyEzESMBMxEjAQCAgICAgAEAgID+gICAAgCAgAOAgP8AAQD/AP4AAgD+AAABAAAAAAKAA4AAFQAAESERIzUhFSEVIxUjNSMVMxUjFSEVIQKAgP6AAYCAgICAgAIA/YADgP8AgICAgICAgICAAAAAAAIAAAAAAwACgAARABUAAAEhFTMRIRUhFSE1IxEzFSE1IQEzFSMBAAGAgP6AAYD+AICAAQD/AP8AgIACgID/AICAgAGAgID+gIAAAAADAAAAAAMAA4AACwAPABMAAAEzETMVIxEjESM1MwEzFSMzIRUhAgCAgICAgID+AICAgAGA/oADgP8AgP6AAYCA/oCAgAAAAAAEAAD/gAMAA4AAAwAPABMAFwAAATMVIxUzFTMVIxEjESM1MwEzESMzIRUhAgCAgICAgICAgP4AgICAAYD+gAOAgICAgP6AAYCA/wD/AIAAAAQAAP+AAwADgAAJAA0AEQAVAAATIREjNSM1MxEhIzMRIzMhFSkBMxUjgAIAgICA/oCAgICAAQD/AAIAgIADgPyAgIACAP2AgIAAAAAEAAD/gAMAAoAAAwAPABMAFwAAEyEVISUzESM1ITUhNSM1MyEzESMBMxUjgAEA/wABgICA/oABgICA/gCAgAKAgIACgICA/YCAgICA/wD/AIAAAAADAAAAAAMAA4AADQARABUAABMhFSEVIRUhESMRIzUzJTMVIxUzESOAAgD+gAGA/oCAgIACAICAgIADgICAgP4AAgCAgICA/gAAAAAAAwAAAAADAAKAAA8AEwAXAAATMxUzFSMVMxUjFSM1IzUzASEVKQEzFSOAgICAgICAgIABAAEA/wABAICAAoCAgICAgICAAYCAgAAAAAIAAAAAA4ADgAATABcAABMzFSE1MxUzFSEVIzUjFSM1ITUzATMRI4CAAYCAgP8AgICA/wCAAQCAgAOAgICAgICAgICA/wD+AAAAAAACAAD/gAOAAoAAFwAbAAATMxUhNTMVMxUjESM1ITUhNSEVIzUjNTMRIRUhgIABgICAgID+gAGA/oCAgIACAP4AAoCAgICA/oCAgICAgID+AIAAAAADAAAAAAKAAoAACQANABEAABEhFSEVIRUhFSMBMxUjASEVIQIA/oABgP6AgAIAgID+gAGA/oACgICAgIABgID/AIAAAAMAAAAAAoACgAADAA0AEQAAEyEVISUzESE1IREjNTMhMxEjgAEA/wABgID+AAGAgID+AICAAoCAgP2AgAEAgP6AAAAAAwAAAAACgAKAAAkADQARAAARIRUhETMVIxUjATMRIykBFSECAP6AgICAAgCAgP8AAQD/AAKAgP8AgIACAP6AgAAAAAAEAAAAAAKAA4AAAwANABEAFQAAEyEVISMzETMVIxEhFSEBIRUpATMRI4ABgP6AgICAgAGA/gABAAEA/wABAICAA4CA/wCA/wCAAoCA/oAAAAUAAAAAAoACgAADAAcACwAPABMAABMhFSEjMxUjJTMRIyUzFSMzIRUhgAGA/oCAgIACAICA/gCAgIABgP6AAoCAgID+gICAgAAAAAAFAAD/gAKAAoAAAwAHAAsAFwAbAAATIRUhIzMRIwEzFSsBMxUzFSMVIzUjNTMlMxUjgAGA/oCAgIABgICAgICAgICAgAEAgIACgID+gAEAgICAgICAgIAABAAA/4ADAAOAAAkADQARABUAAAEzESE1IREjNTMlIRUhIzMRIwUzFSMCAID+AAGAgID+gAEA/wCAgIACgICAA4D8gIABAICAgP6AgIAAAAAEAAAAAAMAA4AAAwANABEAFQAAATMVKwEzESE1IREjNTMlIRUhIzMRIwKAgICAgP4AAYCAgP6AAQD/AICAgAOAgP0AgAEAgICA/oAAAwAAAAACgAKAAAMADQARAAATIRUhIzMVITUzESM1IRUhFSGAAYD+gICAAYCAgP4AAgD+AAKAgICA/oCAgIAAAAMAAAAAAoACgAADAA0AEQAAESEVKQEzESM1IRUjESEBIRUhAgD+AAIAgID+gIACAP6AAYD+gAKAgP6AgIABAP8AgAAABAAAAAADgAKAAAMADwATABcAABEhFSkCFSMRIzUhFSMRKQEzFSMFIRUhAgD+AAIAAQCAgP6AgAIAAQCAgP2AAYD+gAKAgID/AICAAQCAgIAAAAAABQAAAAACgAKAAAMABwALAA8AEwAAEyEVISMzFSMzIRUhIzMVIzMhFSGAAgD+AICAgIABAP8AgICAgAIA/gACgICAgICAAAAABQAAAAACgAKAAAMABwALAA8AEwAAESEVKQEzFSMpARUpATMVIykBFSECAP4AAgCAgP8AAQD/AAEAgID+AAIA/gACgICAgICAAAAAAAYAAAAAA4ACgAADAAcACwAPABMAFwAAESEVKQIVKQIVISUzFSMhMxUjKQEVIQIA/gACAAEA/wD/AAEA/wACAICA/wCAgP4AAgD+AAKAgICAgICAgAAAAAAGAAAAAAKAAoAAAwAHAAsADwATABcAABMhFSEjMxEjATMVIykBFSkBMxUjKQEVIYABgP6AgICAAgCAgP8AAQD/AAEAgID+gAGA/oACgID+gAGAgICAgAAAAgAA/4ACAAMAAAsADwAAATMRMxUjFSM1ITUhASEVIQEAgICAgP8AAQD/AAEA/wADAP4AgICAgP8AgAAABAAA/4ADAAOAAAMADwATABcAAAEzFSsBMxEjNSE1IREhNSEFMxEjESEVIQKAgICAgID+gAGA/oABgP4AgIACAP4AA4CA/QCAgAEAgID/AP8AgAAAAwAA/4ACgAKAAAkADQARAAATIREjNSE1IREhIzMRIxEhFSGAAgCA/oABgP6AgICAAgD+AAKA/YCAgAEA/wD/AIAAAAAEAAAAAAKAAoAAAwAHAA0AEQAAEyEVISMzESMBIREjNSMFIRUhgAIA/gCAgIABgAEAgID/AAGA/oACgID+gAEA/wCAgIAAAAAGAAAAAAKAAoAAAwAHAAsADwATABcAABEhFSElIRUhIzMVKwEzESMBMxErATMVIwEA/wABgAEA/wCAgICAgIABAICAgICAAoCAgICA/wABAP8AgAADAAD/gAKAAwAAAwALAA8AABEzESMBMxEjESM1MwUhFSGAgAIAgICAgP6AAQD/AAMA/gACAPyAAYCAgIAAAAAABAAAAAACgAOAAAMACwAPABMAABMhFSEjMxEzFSMRIwEhFSkBMxEjgAIA/gCAgICAgAEAAQD/AAEAgIADgID/AID+gAKAgP4AAAAAAAUAAP+AAoADgAADAAsADwATABcAABMhFSEjMxEzFSMRIwEhFSkBMxEjKQEVIYACAP4AgICAgIABAAEA/wABAICA/wABAP8AA4CA/wCA/oACgID+AIAAAAACAAAAAAGAA4AAAwAPAAATMxUjFTMRMxUjESMRIzUzgICAgICAgICAA4CAgP8AgP8AAQCAAAAAAAEAAAAAAYACgAALAAARIRUjETMVITUzESMBgICA/oCAgAKAgP6AgIABgAAABAAAAAACgAOAAAsADwATABcAAAEzETMVIxEjESM1MyEzFSMhMxUjATMVIwEAgICAgICAAQCAgP4AgIABgICAA4D+gID/AAGAgICA/wCAAAADAAAAAAIAA4AADwATABcAAAEzETMVIxUjNSM1MzUjNTMFMxUjATMVIwEAgICAgICAgID/AICAAYCAgAOA/gCAgICAgICAgP8AgAAAAgAA/4ABAAOAAAMABwAAETMRIzsBFSOAgICAgAOA/ICAAAAABAAA/4ACgAOAAAkADQARABUAABEzESERIzUhESMBIRUpATMRIykBFSGAAgCA/oCAAQABAP8AAQCAgP8AAQD/AAOA/wD/AID+AAGAgP8AgAAEAAAAAAKAAoAAAwAJAA0AEQAAETMRIwEzESE1MwEzESsBMxUjgIACAID/AID/AICAgICAAoD+AAIA/YCAAQD/AIAAAAQAAP+AAoACgAADAAsADwATAAARMxEjATMRIzUjNTMBMxErATMVI4CAAgCAgICA/wCAgICAgAKA/gACAP0AgIABAP8AgAAAAAUAAP+AAoACgAAFAAkADQARABUAABEhFSMRIwEzFSsBMxEjATMRKwEzFSMBAICAAYCAgICAgAEAgICAgIACgID+AAKAgP8AAQD+AIAAAAAAAwAA/4ADAAKAAAUACQANAAATIRUhESMBMxEjITMVI4ACAP6AgAIAgID9gICAAoCA/gACAP4AgAADAAD/gAMAAoAABQAJAA0AABEhFSERIwEzESM7ARUjAgD+gIACAICAgICAAoCA/gACAP4AgAAAAAMAAAAAAoACgAAHAA8AEwAAETMVMxUjESMBMxEjNSM1MyUzFSOAgICAAgCAgICA/wCAgAKAgID+gAKA/YCAgICAAAAAAwAAAAACgAKAAAMADwATAAATIRUhIzMVITUzESM1IRUjMyEVIYABgP6AgIABgICA/oCAgAGA/oACgICAgP6AgICAAAAGAAAAAAOAAoAAAwAHAAsADwATABcAABMhFSEjMxEjATMRIwEzESMpARUhJSEVIYACgP2AgICAAwCAgP6AgID/AAEA/wABgAEA/wACgID+gAGA/oABAP8AgICAAAMAAP+AAoADAAATABcAGwAAATMVMxUjETMVIxUjNSM1MxEjNTMFMxEjATMRIwEAgICAgICAgICAgP8AgIACAICAAwCAgP6AgICAgAGAgID+gAGA/oAAAAADAAAAAAKAAoAABwALAA8AAAEzESM1IzUzITMVIzMhFSECAICAgID+AICAgAEA/wACgP2AgICAgAAAAAADAAAAAAKAA4AABwALAA8AAAEzESM1IzUzITMVIzMhFSECAICAgID+AICAgAEA/wADgPyAgICAgAAAAAAEAAD/gAMAAoAABwALAA8AEwAAATMRIzUjNTMhMxUjMyEVKQEzFSMCAICAgID+AICAgAEA/wACAICAAoD9gICAgICAAAMAAP+AAoACgAAHAAsADwAAETMVMxUjESMBIRUpATMVI4CAgIABAAEA/wABAICAAoCAgP4AAwCAgAAAAAMAAAAAAoACgAADAAcACwAAEyEVISMzESMBMxUjgAGA/oCAgIACAICAAoCA/gACAIAAAAADAAD/gAKAAoAAAwAHAAsAABMhFSEjMxUjJTMRI4ABgP6AgICAAgCAgAKAgICA/YAAAAAAAwAAAAACgAKAAAkADQARAAARIRUhFSEVIREjATMVIxUzESMCAP6AAYD+gIACAICAgIACgICAgP8AAgCAgP8AAAMAAAAAAoACgAAJAA0AEQAAETMRIRUhFSEVIQEzESMVMxUjgAGA/oABgP4AAgCAgICAAoD/AICAgAKA/wCAgAAEAAD/gAMAA4AAAwAPABMAFwAAATMVKwEzETMVIxUjNSM1MyEzESMzIRUhAoCAgICAgICAgID+AICAgAGA/oADgID+AICAgID/AIAAAwAA/4ACgAKAAAMABwALAAARIRUpATMRIzMhFSEBAP8AAQCAgIABAP8AAoCA/gCAAAAAAAQAAP+AAwADgAADAA8AEwAXAAABIRUhIzMRMxUjFSM1ITUhBTMVIzMhFSECAAEA/wCAgICAgP8AAQD+gICAgAEA/wADgID+AICAgICAgIAAAgAA/4ABgAMAAAMADwAAETMVIzsBETMVIxEjESM1M4CAgICAgICAgAMAgP6AgP8AAQCAAAIAAP+AAYADgAALAA8AABMzETMVIxEjESM1MxMzFSOAgICAgICAgICAA4D/AID+AAIAgP2AgAAAAQAAAAADgAKAABUAABMzESERMxEzFSMRITUhNSEVIzUjNTOAgAGAgICA/gABgP6AgICAAoD/AAEA/wCA/wCAgICAgAAFAAAAAAKAAoAABQALAA8AEwAXAAARIREjNSMlIRUjFSMhMxEjATMRIykBFSEBAICAAYABAICA/oCAgAIAgID+gAGA/oACgP8AgICAgP8AAQD/AIAAAAAABAAAAAACgAKAAAMABwALAA8AABEzESMBMxUjOwERIykBFSGAgAGAgICAgID+gAGA/oACgP4AAgCA/oCAAAAAAAUAAAAAAoACgAADAAcACwAPABMAAAEzFSsBMxUjJTMVIyEzESMBMxEjAQCAgICAgAEAgID+gICAAgCAgAKAgICAgP6AAYD+gAAAAAACAAAAAAKAAoAACQANAAARIRUjESMRIxEjATMRIwIAgICAgAIAgIACgID/AAEA/gACAP4AAAAAAAMAAAAAAoADAAADAAsADwAAEyEVISMzFSEVIREjATMRI4ACAP4AgIABgP6AgAIAgIADAICAgP6AAYD+gAAAAAAFAAAAAAKAAoAAAwAHAAsADwATAAARMxUjJTMVIyEzFSMlMxUrATMRI4CAAgCAgP6AgIABAICAgICAAoCAgICAgID+gAAAAAAFAAD/gAKAAoAABwALAA8AHQAhAAARIRUjFSM1IRczFSMlMxUjITMVMzUzFTMVIxUjNSEBMxUjAgCAgP8AgICAAQCAgP6AgICAgICA/wACAICAAoCAgICAgICAgICAgICAAQCAAAAAAAUAAP+AAoACgAAFAAkADQARABUAABEhESM1IQUhFSkBMxEjJTMVIzMhFSECgID+AAEAAQD/AAEAgID+AICAgAGA/oACgP8AgICA/wCAgIAABgAA/4ACgAKAAAUACQANABEAFQAdAAARIREjNSEFIRUhIzMVIyUzESMlMxUjJTMVMxUhNTMCgID+AAEAAQD/AICAgAGAgID+AICAAQCAgP6AgAKA/wCAgICAgP8AgICAgICAAAQAAAAAAoADgAADAAcACwARAAATIRUhIzMVIyUzESMpARUjESOAAYD+gICAgAIAgID/AAEAgIADgICAgP6AgP8AAAAABAAAAAACgAOAAAMABwALABEAABMhFSEjMxEjATMVIwEhESMRI4ABgP6AgICAAgCAgP6AAQCAgAOAgP6AAYCA/wD+gAEAAAAABAAAAAACgAOAAAUACQANABEAAAEzETMVKQEzESMlMxUjMyEVIQEAgID/AAEAgID+AICAgAGA/oADgP8AgP6AgICAAAAFAAD/gAKAAoAAAwAHAAsADwATAAATIRUhIzMRIwEzFSMRMxUjKQEVIYABgP6AgICAAgCAgICA/oABgP6AAoCA/gACAID/AICAAAAABQAAAAACgAOAAAMABwALAA8AEwAAEyEVISMzESMBMxEjATMVIwMhFSGAAYD+gICAgAIAgID/AICAgAGA/oADgID9gAKA/YABgID/AIAAAAADAAAAAAKAAoAACwAPABMAABEhFSEVIRUhFSEVIQEzFSMVMxUjAgD+gAGA/oABgP4AAgCAgICAAoCAgICAgAIAgICAAAYAAAAAAoACgAADAAcACwAPABMAFwAAEyEVISMzFSMlMxEjASEVISMzFSMzIRUhgAGA/oCAgIACAICA/oABAP8AgICAgAGA/oACgICAgP6AAQCAgIAAAAAFAAAAAAMAA4AAAwAJAA0AEwAXAAABMxUrATMRITUhBTMRIwEhESM1IwUhFSECgICAgID+AAGA/gCAgAGAAQCAgP8AAYD+gAOAgP8AgID+gAEA/wCAgIAAAQAAAAACgAKAAAsAABEzESERMxEjESERI4ABgICA/oCAAoD/AAEA/YABAP8AAAAABAAA/4ACgAOAAAMADwATABcAAAEzFSMVMxEzFSMVIzUhNSEFMxUjMyEVIQGAgICAgICA/wABAP6AgICAAQD/AAOAgID+gICAgICAgIAAAAAFAAD/gAIAAwAAAwALAA8AEwAXAAARMxUjJTMRIxEjNTMlMxUjFTMVKwEzFSOAgAGAgICAgP8AgICAgICAgAMAgID8gAIAgICAgICAAAAAAAEAAAAAAoACgAAFAAARMxEhFSGAAgD9gAKA/gCAAAAABAAA/4ADAAOAAAMADwATABcAAAEzFSsBMxEjESE1ITUjNTMlIRUhIzMRIwKAgICAgID+gAGAgID+gAEA/wCAgIADgID8gAEAgICAgID/AAAEAAAAAAKAA4AAAwAHAAsAGQAAEyEVISMzFSMlMxEjKQEVIxUhFSEVIzUhNSGAAYD+gICAgAIAgID/AAEAgAEA/wCA/wABAAOAgICA/wCAgICAgIAAAAAABAAAAAACgAOAAAMABwALABkAABMhFSEjMxEjATMVIwUhESEVIRUjNSE1ITUjgAGA/oCAgIACAICA/oABAAEA/wCA/wABAIADgID/AAEAgID/AICAgICAAAQAAAAAAoADgAAJAA0AFwAbAAARMxEzNTMVMxUhATMRIwEzETM1MxUzFSEBMxEjgICAgP4AAgCAgP4AgICAgP4AAgCAgAOA/wCAgIABgP8A/wD/AICAgAGA/wAAAQAAAoAAgAOAAAMAABEzESOAgAOA/wAAAQAA/4AAgACAAAMAADUzESOAgID/AAAAAQAAAoAAgAMAAAMAABEzFSOAgAMAgAAAAgAA/4AAgAIAAAMABwAAETMVIxEzESOAgICAAgCA/wD/AAAAAQAAAgAAgAKAAAMAABEzFSOAgAKAgAAAAgAAAAACgAOAAAMADwAAEyEVISMzFSE1MxEjESERI4ABgP6AgIABgICA/oCAA4CAgID9AAIA/gAAAAAAAwAAAAACgAOAAAsADwATAAARIRUhFSEVIREhFSEBMxUjFTMRIwIA/oABgP6AAYD+AAIAgICAgAOAgICA/oCAAwCAgP6AAAAAAQAAAAACgAOAAAUAABEhFSERIwKA/gCAA4CA/QAAAAAEAAAAAAKAA4AAAwAHAAsAEwAAATMRKwEzESMBMxEjITMVITUzESEBAICAgICAAQCAgP6AgAGAgP2AA4D/AP6AAYD+gICA/wAAAAAAAQAAAAACgAOAAAsAABEhFSEVIRUhESEVIQKA/gABAP8AAgD9gAOAgICA/oCAAAAABQAAAAACgAOAAAUACQANABEAFwAAESERIzUhBTMVKwEzFSsBMxUrATMVIRUhAoCA/gABgICAgICAgICAgIACAP2AA4D/AICAgICAgIAAAAABAAAAAAKAA4AACwAAETMRIREzESMRIREjgAGAgID+gIADgP8AAQD8gAIA/gAAAAAFAAAAAAKAA4AAAwAHAAsADwATAAATIRUhIzMRIwEzESMBMxUjAyEVIYABgP6AgICAAgCAgP8AgICAAYD+gAOAgP2AAoD9gAGAgP8AgAAAAAEAAAAAAYADgAALAAARIRUjETMVITUzESMBgICA/oCAgAOAgP2AgIACgAAABQAAAAACgAOAAAcACwAPABMAFwAAETMRIRUhESMBMxUrATMVIxUzFSM7AREjgAEA/wCAAgCAgICAgICAgICAA4D/AID+AAOAgICAgP6AAAAFAAAAAAKAA4AAAwAHAAsADwATAAABMxErATMRIwEzESMhMxEjATMRIwEAgICAgIABAICA/oCAgAIAgIADgP8A/oABgP6A/wABAP8AAAAAAAMAAAAAAoADgAAHAA8AEwAAETMVMxUjESMBMxEjESM1MwUzFSOAgICAAgCAgICA/wCAgAOAgID9gAOA/IACgICAgAAAAwAAAAACgAOAAAcADwATAAARMxUzFSMRIwEzESMRIzUzJTMVI4CAgIACAICAgID/AICAA4CAgP2AA4D8gAGAgICAAAADAAAAAAKAA4AAAwAHAAsAABEhFSETIRUhAyEVIQKA/YCAAYD+gIACgP2AA4CA/wCA/wCAAAAAAAQAAAAAAoADgAADAAcACwAPAAATIRUhIzMRIwEzESMpARUhgAGA/oCAgIACAICA/oABgP6AA4CA/YACgP2AgAABAAAAAAKAA4AABwAAESERIxEhESMCgID+gIADgPyAAwD9AAACAAAAAAKAA4AACQANAAARIRUhFSEVIREjATMVIwIA/oABgP6AgAIAgIADgICAgP4AAwCAAAAAAAUAAAAAAoADgAAFAAkADQARABcAABEhFSEVIzsBFSM7ARUrATMVKwEzFSEVIQKA/gCAgICAgICAgICAgIACAP2AA4CAgICAgICAAAABAAAAAAKAA4AABwAAESEVIREjESECgP8AgP8AA4CA/QADAAAFAAAAAAKAA4AAAwAHAAsADwATAAARMxUjJTMVIyEzFSMlMxUrATMRI4CAAgCAgP6AgIABAICAgICAA4CAgICAgID9gAAAAAADAAAAAAKAA4AAEwAXABsAAAEzFTMVIxEzFSMVIzUjNTMRIzUzBTMRIwEzESMBAICAgICAgICAgID/AICAAgCAgAOAgID+gICAgIABgICA/oABgP6AAAAACQAAAAACgAOAAAMABwALAA8AEwAXABsAHwAjAAARMxUjJTMVIyEzFSMlMxUrATMVKwEzFSMlMxUjITMRIwEzESOAgAIAgID+gICAAQCAgICAgICAgAEAgID+gICAAgCAgAOAgICAgICAgICAgP6AAYD+gAADAAAAAAKAA4AAAwAPABMAABEzESMBMxEzFSMRIxEjNTMBMxEjgIABAICAgICAgAEAgIADgP8AAQD/AID+AAIAgAEA/wAAAAAFAAAAAAKAA4AAAwAHAAsAEQAXAAATIRUhIzMRIwEzESMhMxEhNTMlMxUzFSGAAYD+gICAgAIAgID+gID/AIABAICA/wADgID+AAIA/gD/AICAgIAAAAAABgAAAAACgAKAAAMABwALAA8AEwAXAAATIRUhJTMVIyEzESMBMxEjKQEVISUzFSOAAQD/AAGAgID+AICAAYCAgP8AAQD/AAGAgIACgICAgP6AAYD+gICAgAAAAAAGAAD/gAKAA4AAAwALAA8AEwAXABsAABMhFSEjMxEhFSEVIwEzFSsBMxUjOwEVIzsBESOAAQD/AICAAYD+gIABgICAgICAgICAgICAA4CA/YCAgAOAgICA/wAAAAgAAP+AAoACgAADAAcACwAPABMAFwAbAB8AABEzFSMlMxUjITMVIyUzFSsBMxUrATMRIwEzESsBMxUjgIACAICA/oCAgAEAgICAgICAgIABAICAgICAAoCAgICAgICA/wABAP8AgAAACAAAAAACgAOAAAMABwALAA8AEwAXABsAHwAAASEVISMzFSM7ARUrATMVIyUzFSMhMxEjATMRIykBFSEBAAEA/wCAgICAgICAgIABAICA/oCAgAIAgID+gAGA/oADgICAgICAgP8AAQD/AIAABQAAAAACgAKAAAMABwALAA8AEwAAEyEVISMzFSMzIRUhIzMVIzMhFSGAAgD+AICAgIABAP8AgICAgAIA/gACgICAgICAAAAACAAA/4ACgAOAAAMABwALAA8AEwAXABsAHwAAESEVKQEzFSsBMxUrATMVKwEzFSMzIRUpATMVKwEzFSMCAP4AAgCAgICAgICAgICAgIABAP8AAQCAgICAgAOAgICAgICAgIAAAAIAAP+AAoACgAAFAAkAABEhFSERIwEzESMCAP6AgAIAgIACgID+AAIA/YAAAwAAAAACgAOAAAMADwATAAATIRUhIzMRIREzESMRIREjMyEVIYABgP6AgIABgICA/oCAgAGA/oADgID/AAEA/YABAP8AgAAAAgAAAAABAAKAAAMABwAAETMRIzsBFSOAgICAgAKA/gCAAAAABQAAAAACAAKAAAcACwAPABMAFwAAETMRMxUjESMBMxUrATMVIxUzFSM7ARUjgICAgAGAgICAgICAgICAgAKA/wCA/wACgICAgICAAAYAAAAAAoADgAADAAcACwAPABMAFwAAESEVKQEzESsBMxEjATMRIyEzESMBMxEjAQD/AAEAgICAgIABAICA/oCAgAIAgIADgID/AP8AAQD/AP8AAQD/AAACAAD/gAKAAoAABwALAAARMxEhFSEVIwEzESOAAYD+gIACAICAAoD+AICAAwD+AAAFAAAAAAKAAoAAAwAHAAsADwATAAARMxEjATMRIyEzESMBMxErATMVI4CAAgCAgP6AgIABAICAgICAAoD/AAEA/wD/AAEA/wCAAAAACAAA/4ACgAOAAAMABwALAA8AEwAXABsAHwAAETMVIzMhFSEjMxUjMyEVISMzFSMzIRUpATMVKwEzFSOAgIABgP6AgICAgAGA/oCAgICAAYD+gAGAgICAgIADgICAgICAgICAAAQAAAAAAoACgAADAAcACwAPAAATIRUhIzMRIwEzESMpARUhgAGA/oCAgIACAICA/oABgP6AAoCA/oABgP6AgAABAAAAAAKAAoAACwAAESEVIxEjESMRIxEjAoCAgICAgAKAgP4AAgD+AAIAAAMAAP+AAoACgAADAAsADwAAEyEVISMzESEVIREjATMRI4ABgP6AgIABgP6AgAIAgIACgID/AID/AAKA/wAAAAAGAAD/gAKAAoAAAwAHAAsADwATABcAABMhFSEjMxEjATMVIwUhFSkBMxUrATMVI4ABgP6AgICAAgCAgP6AAYD+gAGAgICAgIACgID/AAEAgICAgIAAAAAAAwAAAAADAAKAAAcACwAPAAATIRUjESMRISMzESMzIRUhgAKAgID+gICAgIABgP6AAoCA/oABgP6AgAAAAgAAAAACgAKAAAcACwAAESEVIREjESEBMxUjAoD/AID/AAGAgIACgID+gAGA/oCAAAAAAAQAAAAAAoACgAADAAcACwAPAAARMxEjATMVIzsBESMpARUhgIABgICAgICA/oABgP6AAoD+AAIAgP6AgAAAAAAEAAD/gAKAAoAAAwAHABMAFwAAATMVIyEzESMBMxEzFSMVIzUjNTMBMxEjAYCAgP6AgIABAICAgICAgAEAgIACgID+gAGA/oCAgICAAYD+gAAAAAAJAAD/gAKAAoAAAwAHAAsADwATABcAGwAfACMAABEzFSMlMxUjITMVIyUzFSsBMxUrATMVIyUzFSMhMxEjATMRI4CAAgCAgP6AgIABAICAgICAgICAAQCAgP6AgIACAICAAoCAgICAgICAgICA/wABAP8AAAMAAP+AAoACgAADAA8AEwAAETMRIwEzETMVIxEjESM1MwEzESOAgAEAgICAgICAAQCAgAKA/oABgP6AgP8AAQCAAYD+gAAAAAcAAAAAA4ACgAADAAcACwAPABMAFwAbAAATMxUjJTMVIyEzESMBMxEjATMRIykBFSElIRUhgICAAgCAgP2AgIADAICA/oCAgP8AAQD/AAGAAQD/AAKAgICA/oABgP6AAQD/AICAgAAABAAAAAACgAOAAAMABwALABMAABMhFSEjMxEjATMVIwEhESE1ITUhgAGA/oCAgIACAICA/oACAP2AAgD+gAOAgP6AAYCA/wD+gICAAAQAAAAAA4ADgAALAA8AEwAXAAARIRUhETMVIxEjESEFIRUpATMRKwEzFSMCgP8AgICA/wACAAEA/wABAICAgICAA4CA/wCA/oADAICA/oCAAAAAAAUAAAAAAoADgAADAAsADwATABcAABMhFSEjMxEhFSERIwEzFSMRMxUjKQEVIYABgP6AgIABAP8AgAIAgICAgP6AAYD+gAOAgP8AgP8AAoCA/oCAgAAAAAAGAAAAAAKAA4AAAwAHAAsADwATABcAABMhFSEjMxUjMyEVKQEzESMlMxUjMyEVIYACAP4AgICAgAGA/oABgICA/gCAgIABgP6AA4CAgID+gICAgAABAAAAAAGAA4AACwAAESEVIxEzFSE1MxEjAYCAgP6AgIADgID9gICAAoAAAAMAAAAAAoADgAADAAcACwAAATMRIyUzFSMzIRUhAgCAgP4AgICAAYD+gAOA/QCAgIAAAAADAAAAAAOAA4AADQARABUAABMhESEVIREhFSERIxEjATMRIyEzFSOAAYABAP8AAQD+gICAAoCAgP0AgIADgP8AgP6AgAMA/YABgP6AgAAAAAIAAAAAAwADgAARABUAABEzETMRMxEhFSERIRUhESMRIwEzESOAgIABAP8AAQD+gICAAoCAgAOA/wABAP8AgP6AgAIA/gACAP6AAAADAAAAAAMAA4AADwATABcAABMzFSEVIREzFSMRIxEjNTMBIRUpATMRI4CAAYD+gICAgICAAQABAP8AAQCAgAOAgID/AID/AAKAgP8AgP6AAAIAAAAAAoADgAADAA8AABMhFSEjMxUhNTMRIxEhESOAAYD+gICAAYCAgP6AgAOAgICA/QACAP4AAAAAAAIAAAAAAoADgAALAA8AABEhFSEVIRUhESEVIQEzESMCgP4AAYD+gAGA/gACAICAA4CAgID+gIACAP6AAAMAAAAAAoADgAALAA8AEwAAESEVIRUhFSERIRUhATMVIxUzESMCAP6AAYD+gAGA/gACAICAgIADgICAgP6AgAMAgID+gAAAAAEAAAAAAoADgAAFAAARIRUhESMCgP4AgAOAgP0AAAAAAQAA/4ADAAOAABMAAAEhETMRIzUhFSMRMxEzESERIxEjAQABgICA/gCAgIABAICAA4D9AP8AgIABAAGA/oACgP8AAAABAAAAAAKAA4AACwAAESEVIRUhFSERIRUhAoD+AAEA/wACAP2AA4CAgID+gIAAAAAJAAAAAAOAA4AAAwAPABMAFwAbAB8AIwAnACsAABEzFSMlMxEzFSMRIxEjNTMBMxUjITMVIyUzFSMFMxUjJTMVIyEzESMBMxEjgIABgICAgICAgAGAgID9gICAAgCAgP4AgIACAICA/YCAgAMAgIADgICA/wCA/gACAIABAICAgICAgICA/oABgP6AAAcAAAAAAoADgAADAAcACwAPABMAFwAbAAATIRUhIzMVIyUzFSMpARUpATMRIyUzFSMzIRUhgAGA/oCAgIACAICA/wABAP8AAQCAgP4AgICAAYD+gAOAgICAgID+gICAgAAAAAADAAAAAAKAA4AABwAPABMAABEzETMVIxEjATMRIxEjNTMFMxUjgICAgAIAgICAgP8AgIADgP6AgP6AA4D8gAKAgICAAAUAAAAAAoADgAAHAAsADwATABcAABEzESEVIREjATMVKwEzFSMVMxUjOwERI4ABAP8AgAIAgICAgICAgICAgAOA/wCA/gADgICAgID+gAAAAgAAAAACgAOAAAcACwAAEyERIxEhESsBMxUjgAIAgP8AgICAgAOA/IADAP2AgAAAAwAAAAACgAOAAAcADwATAAARMxUzFSMRIwEzESMRIzUzBTMVI4CAgIACAICAgID/AICAA4CAgP2AA4D8gAKAgICAAAABAAAAAAKAA4AACwAAETMRIREzESMRIREjgAGAgID+gIADgP8AAQD8gAIA/gAAAAAEAAAAAAKAA4AAAwAHAAsADwAAEyEVISMzESMBMxEjKQEVIYABgP6AgICAAgCAgP6AAYD+gAOAgP2AAoD9gIAAAQAAAAACgAOAAAcAABEhESMRIREjAoCA/oCAA4D8gAMA/QAAAgAAAAACgAOAAAkADQAAESEVIRUhFSERIwEzFSMCAP6AAYD+gIACAICAA4CAgID+AAMAgAAAAAAFAAAAAAKAA4AAAwAHAAsADwATAAATIRUhIzMRIwEzFSMRMxUjKQEVIYABgP6AgICAAgCAgICA/oABgP6AA4CA/YACgID+gICAAAAAAQAAAAACgAOAAAcAABEhFSERIxEhAoD/AID/AAOAgP0AAwAAAwAAAAACgAOAAAMACwAPAAARMxEjATMRIxEhNSEBIRUhgIACAICA/oABgP4AAgD+AAOA/oABgP0AAQCA/oCAAAMAAP+AA4ADgAATABcAGwAAATMVIRUhESEVIRUjNSE1IREhNSEFMxEjATMRIwGAgAEA/wABAP8AgP8AAQD/AAEA/oCAgAMAgIADgICA/gCAgICAAgCAgP4AAgD+AAAAAAkAAAAAAoADgAADAAcACwAPABMAFwAbAB8AIwAAETMVIyUzFSMhMxUjJTMVKwEzFSsBMxUjJTMVIyEzESMBMxEjgIACAICA/oCAgAEAgICAgICAgIABAICA/oCAgAIAgIADgICAgICAgICAgID+gAGA/oAAAQAA/4ADAAOAAAsAABEzESERMxEzESM1IYABgICAgP2AA4D9AAMA/QD/AIAAAAAAAgAAAAACgAOAAAMACwAAETMRIwEzESMRITUhgIACAICA/oABgAOA/oABgPyAAYCAAAAAAAEAAAAAA4ADgAALAAARMxEhETMRIREzESGAAQCAAQCA/IADgP0AAwD9AAMA/IAAAAEAAP+ABAADgAAPAAARMxEhETMRIREzETMRIzUhgAEAgAEAgICA/IADgP0AAwD9AAMA/QD/AIAAAgAAAAADAAOAAAsADwAAESERIRUhESEVIREjATMRIwEAAYD+gAGA/gCAAoCAgAOA/oCA/wCAAwD+gP8AAAAAAAMAAAAAA4ADgAAJAA0AEQAAETMRIRUhESEVIQEzESMBMxEjgAGA/oABgP4AAwCAgP8AgIADgP6AgP8AgAOA/IABgP8AAAAAAAIAAAAAAoADgAAJAA0AABEzESEVIREhFSEBMxEjgAGA/oABgP4AAgCAgAOA/oCA/wCAAYD/AAAABQAAAAACgAOAAAMABwAPABMAFwAAEyEVISMzFSMlMxEjESE1IQEzFSMzIRUhgAGA/oCAgIACAICA/wABAP4AgICAAYD+gAOAgICA/YABAID/AICAAAAAAAQAAAAAA4ADgAALAA8AEwAXAAARMxEzETMRIxEjESMBIRUpATMRIykBFSGAgICAgIABgAGA/oABgICA/oABgP6AA4D+gAEA/YABAP6AA4CA/YCAAAMAAAAAAoADgAAJAA0AEQAAEyERIxEhNSE1ISMzFSMVMxEjgAIAgP6AAYD+gICAgICAA4D8gAIAgICAgP4AAAADAAAAAAKAAoAAAwANABEAABMhFSkBMxEhNSE1ITUhBTMVI4ABgP6AAYCA/gABgP6AAYD+AICAAoCA/gCAgICAgAAAAAQAAAAAAoADgAADAAsADwATAAATIRUhIzMVIRUhESMBMxEjKQEVIYACAP4AgIABgP6AgAIAgID+gAGA/oADgICAgP6AAYD+gIAAAAADAAAAAAKAAoAACwAPABMAABEhFSEVIRUhFSEVIQEzFSMVMxUjAgD+gAGA/oABgP4AAgCAgICAAoCAgICAgAIAgICAAAEAAAAAAgACgAAFAAARIRUhESMCAP6AgAKAgP4AAAAAAQAA/4ADAAKAABMAAAEhETMRIzUhFSMRMxEzESERIxUjAQABgICA/gCAgIABAICAAoD+AP8AgIABAAEA/wABgIAAAAADAAAAAAKAAoAAAwANABEAABMhFSEjMxUhNTMRIRUjMyEVIYABgP6AgIABgID+AICAAgD+AAKAgICA/wCAgAAABQAAAAACgAKAAAMADwATABcAGwAAETMRIwEzETMVIxEjESM1MwEzESMFMxEjATMRI4CAAQCAgICAgIABAICA/gCAgAIAgIACgP8AAQD/AID/AAEAgAEA/wCA/wABAP8AAAAAAAcAAAAAAoACgAADAAcACwAPABMAFwAbAAATIRUhIzMVIyUzFSMpARUpATMVIyUzFSMpARUhgAGA/oCAgIACAICA/wABAP8A/wCAgAIAgID+gAGA/oACgICAgICAgICAgAAAAAADAAAAAAKAAoAABwAPABMAABEzETMVIxUjATMRIxEjNTMFMxUjgICAgAIAgICAgP8AgIACgP6AgIACgP2AAYCAgIAAAAUAAAAAAgACgAAHAAsADwATABcAABEzETMVIxEjATMVKwEzFSMVMxUjOwEVI4CAgIABgICAgICAgICAgIACgP8AgP8AAoCAgICAgAACAAAAAAKAAoAABwALAAATIREjESERKwEzFSOAAgCA/wCAgICAAoD9gAIA/oCAAAADAAAAAAKAAoAABwAPABMAABEzFTMVIxEjATMRIxEjNTMFMxUjgICAgAIAgICAgP8AgIACgICA/oACgP2AAYCAgIAAAAEAAAAAAoACgAALAAARMxEhETMRIxEhESOAAYCAgP6AgAKA/wABAP2AAQD/AAAAAAQAAAAAAoACgAADAAcACwAPAAATIRUhIzMRIwEzESMpARUhgAGA/oCAgIACAICA/oABgP6AAoCA/oABgP6AgAABAAAAAAKAAoAABwAAESERIxEhESMCgID+gIACgP2AAgD+AAADAAD/gAKAAoAACwAPABMAABEzFTMVIxUhFSERIwEhFSkBMxEjgICAAYD+gIABAAEA/wABAICAAoCAgICA/wADAID/AAAAAAAFAAAAAAKAAoAAAwAHAAsADwATAAATIRUhIzMRIwEzFSMVMxUjKQEVIYABgP6AgICAAgCAgICA/oABgP6AAoCA/oABgICAgIAAAAAAAQAAAAACgAKAAAcAABEhFSERIxEhAoD/AID/AAKAgP4AAgAAAwAA/4ACgAKAAAMACwAPAAARMxEjATMRIzUhNSEBIRUhgIACAICA/oABgP4AAgD+AAKA/oABgP2AgID/AIAAAAMAAP+AAoACgAAPABMAFwAAEyEVIxEzFSMVIzUjNTMRKwEzESMBMxEjgAGAgICAgICAgICAgAIAgIACgID+gICAgIABgP6AAYD+gAAJAAAAAAKAAoAAAwAHAAsADwATABcAGwAfACMAABEzFSMlMxUjITMVIyUzFSsBMxUrATMVIyUzFSMhMxUjJTMVI4CAAgCAgP6AgIABAICAgICAgICAAQCAgP6AgIACAICAAoCAgICAgICAgICAgICAAAAAAAEAAP+AAoACgAALAAARMxEhETMRMxEjNSGAAQCAgID+AAKA/gACAP4A/wCAAAAAAAIAAAAAAoACgAADAAsAABEzESMBMxEjESE1IYCAAgCAgP6AAYACgP8AAQD9gAEAgAAAAAABAAAAAAKAAoAACwAAETMRMxEzETMRMxEhgICAgID9gAKA/gACAP4AAgD9gAAAAAABAAD/gAMAAoAADwAAETMRMxEzETMRMxEzESM1IYCAgICAgID9gAKA/gACAP4AAgD+AP8AgAAAAAIAAAAAAwACgAALAA8AABEhESEVIRUhFSERIwEzFSMBAAGA/oABgP4AgAKAgIACgP8AgICAAgD/AIAAAAMAAAAAAwACgAAJAA0AEQAAETMRIRUhFSEVIQEzESMBMxUjgAEA/wABAP6AAoCAgP8AgIACgP8AgICAAoD9gAEAgAAAAgAAAAACgAKAAAkADQAAETMRIRUhFSEVIQEzFSOAAYD+gAGA/gACAICAAoD/AICAgAEAgAAAAAAFAAAAAAKAAoAAAwAHAA8AEwAXAAATIRUhIzMVIyUzESM1ITUhBTMVIzMhFSGAAYD+gICAgAIAgID/AAEA/gCAgIABgP6AAoCAgID+gICAgICAAAAEAAAAAAOAAoAACwAPABMAFwAAETMRMzUzESM1IxEjASEVKQEzESMpARUhgICAgICAAYABgP6AAYCAgP6AAYD+gAKA/wCA/oCA/wACgID+gIAAAAADAAAAAAKAAoAACQANABEAABMhESMRITUhNSEjMxUjFTMRI4ACAID+gAGA/oCAgICAgAKA/YABAICAgID/AAAABQAAAAACgAKAAAMACwAPABMAFwAAEyEVISMzFSEVIRUjATMVIxUzFSMpARUhgAGA/oCAgAEA/wCAAgCAgICA/oABgP6AAoCAgICAAYCAgICAAAAABQAAAAACgAKAAAMABwALAA8AEwAAEyEVISMzFSMzIRUpATMVIykBFSGAAgD+AICAgIABgP6AAYCAgP4AAgD+AAKAgICAgIAAAgAAAAAAgAOAAAMABwAAETMVIxUzESOAgICAA4CAgP2AAAAABAAA/4ACgAOAAAMABwALAA8AAAEzFSMVMxEjATMRIzMhFSECAICAgID+AICAgAGA/oADgICA/YABAP8AgAAAAAMAAAAAA4ACgAANABEAFQAAEyERIRUhFSEVIREjESMlMxUjITMVI4ABgAEA/wABAP6AgIACgICA/QCAgAKA/wCAgIACAP6AgICAAAACAAAAAAMAAoAAEQAVAAARMxEzETMRIRUhFSEVIREjESMBMxUjgICAAQD/AAEA/oCAgAKAgIACgP8AAQD/AICAgAEA/wABAIAAAAAAAgAAAAADAAOAABEAFQAAEzMVMxUjFSEVIREhFSERIzUzATMRI4CAgIABgP6AAYD+AICAAgCAgAOAgICAgP8AgAKAgP6A/wAAAgAAAAADAAMAABEAFQAAEzMVMxUjFSEVIRUhFSERIzUzATMVI4CAgIABgP6AAYD+AICAAgCAgAMAgICAgICAAgCA/oCAAAAAAwAAAAACgAOAAAMADwATAAATIRUhIzMRIREzESMRIREjMyEVIYABgP6AgIABgICA/oCAgAGA/oADgID/AAEA/YABAP8AgAAAAwAAAAACgAKAAAMADwATAAATIRUhIzMVITUzESM1IRUjMyEVIYABgP6AgIABgICA/oCAgAGA/oACgICAgP6AgICAAAAGAAAAAAMAA4AAAwAHAAsADwATABcAABEzESMBMxUrATMRIyEzESMBMxErATMVI4CAAoCAgICAgP6AgIABAICAgICAA4D+AAIAgP6A/wABAP8AgAAGAAAAAAMAAoAAAwAHAAsADwATABcAABEzESMBMxUrATMRIyEzFSMlMxUrATMVI4CAAoCAgICAgP6AgIABAICAgICAAoD+gAGAgP8AgICAgAAAAAABAAAAAAMAA4AADQAAEyEVIRUzFSMRIxEjNTOAAoD+AICAgICAA4CAgID+AAIAgAABAAAAAAKAAoAADQAAEyEVIRUzFSMRIxEjNTOAAgD+gICAgICAAoCAgID/AAEAgAAJAAD/gAQAA4AAAwAPABMAFwAbAB8AIwAnAC8AABEzFSMlMxEzFSMRIxEjNTMBMxUjITMVIyUzFSMFMxUjJTMVIyEzESMBMxEzESM1I4CAAYCAgICAgIABgICA/YCAgAIAgID+AICAAgCAgP2AgIADAICAgIADgICA/wCA/gACAIABAICAgICAgICA/oABgP8A/wCAAAAAAAUAAP+AAwACgAADAA8AEwAXAB8AABEzESMBMxEzFSMRIxEjNTMBMxEjBTMRIwEzFTMRIzUjgIABAICAgICAgAEAgID+AICAAgCAgICAAoD/AAEA/wCA/wABAIABAP8AgP8AAQCA/wCAAAAAAAUAAP+AAwADgAAHAAsADwATABsAABEzESEVIREjATMVKwEzFSMVMxUjOwERMxEjNSOAAQD/AIACAICAgICAgICAgICAgAOA/wCA/gADgICAgID/AP8AgAAFAAD/gAKAAoAABwALAA8AEwAZAAARMxEzFSMRIwEzFSsBMxUjFTMVIzMhESM1I4CAgIABgICAgICAgICAAQCAgAKA/wCA/wACgICAgID/AIAAAAABAAD/gAMAA4AADwAAETMRIREzETMRIzUjESERI4ABgICAgID+gIADgP8AAQD9AP8AgAIA/gAAAAEAAP+AAwACgAAPAAARMxEhETMRMxEjNSMRIREjgAGAgICAgP6AgAKA/wABAP4A/wCAAQD/AAAABQAAAAACgAOAAAMABwALAA8AEwAAETMVIyUzFSMhMxUjJTMVKwEzESOAgAIAgID+gICAAQCAgICAgAOAgICAgICA/YAAAAAABQAA/4ACgAKAAAMABwALAA8AEwAAETMRIwEzESMhMxUjJTMVKwEzESOAgAIAgID+gICAAQCAgICAgAKA/wABAP8AgICA/oAABQAAAAACgAOAAAMABwALAA8AGwAAETMVIyUzFSMhMxUjJTMVKwEzFTMVIxEjESM1M4CAAgCAgP6AgIABAICAgICAgICAgAOAgICAgICAgID+gAGAgAAAAAUAAP+AAoACgAADAAcACwAPABsAABEzESMBMxEjITMVIyUzFSsBMxUzFSMVIzUjNTOAgAIAgID+gICAAQCAgICAgICAgIACgP8AAQD/AICAgICAgICAAAACAAAAAAKAA4AABwALAAARMxEhFSERIwEzESOAAYD+gIACAICAA4D/AID+AAIA/gAAAAAAAwAAAAACgAOAAAcACwAPAAARMxEzFSMRIwEhFSkBMxEjgICAgAEAAQD/AAEAgIADgP6AgP6AAoCA/gAAAQAAAAABgAOAAAsAABEhFSMRMxUhNTMRIwGAgID+gICAA4CA/YCAgAKAAAAEAAAAAAKAA4AAAwAHABEAFQAAEyEVISMzFSMlMxEjESERIxEhASEVIYABgP6AgICAAgCAgP6AgAIA/oABgP6AA4CAgID9gAEA/wABgP6AgAAAAAADAAAAAAKAAoAAAwANABEAABEhFSkBMxEjNSEVIxEhASEVIQIA/gACAICA/oCAAgD+gAGA/oACgID+gICAAQD/AIAAAAMAAAAAAoADgAADAA8AEwAAEyEVISMzESERMxEjESERIzMhFSGAAYD+gICAAYCAgP6AgIABgP6AA4CA/wABAP2AAQD/AIAAAAMAAAAAAoACgAADAA8AEwAAEyEVISMzFSE1MxEjNSEVIzMhFSGAAYD+gICAAYCAgP6AgIABgP6AAoCAgID+gICAgAAAAgAAAAACgAOAAAkADQAAATMRITUhNSE1IQUzFSMCAID+AAGA/oABgP4AgIADgPyAgICAgIAAAAAFAAAAAAKAA4AAAwAHAAsADwATAAARMxEjATMRKwEzFSMpARUhJTMVI4CAAgCAgICAgP8AAQD/AAGAgIADgP0AAwD9gICAgIAAAAAAAwAAAAACgAOAAAMACwAPAAATIRUhIzMRIRUhESMBMxEjgAGA/oCAgAIA/gCAAgCAgAOAgP6AgP8AAwD/AAAAAAMAAAAAAwADgAADAAcAEwAAEyEVISMzESMBMxEzFSMRIxEhNSGAAYD+gICAgAIAgICAgP6AAYADgID+gAGA/oCA/wABAIAAAAMAAAAAAwADgAADAAcADwAAEyEVISMzESMBMxEzFSMRI4ABgP6AgICAAgCAgICAA4CA/oABgP6AgP8AAAMAAAAAAoADgAAHAAsADwAAETMRIRUhESMlMxUjKQEVIYACAP4AgAIAgID+gAGA/oADgP8AgP6AgICAAAQAAAAAAoADgAADAAcACwAVAAATIRUhIzMVIyUzESMhMxUhNTMVMxUhgAGA/oCAgIACAICA/gCAAQCAgP2AA4CAgID+AICAgIAAAAABAAAAAAKAA4AACQAAETMRIRUhESEVIYACAP4AAgD9gAOA/wCA/oCAAAAAAAMAAAAAAoADgAADAAkADQAAEyEVISMzESEVIQEzFSOAAYD+gICAAgD9gAIAgIADgID9gIADAIAABQAAAAADAAOAAAMABwAPABMAFwAAEyEVISMzESMBMxEjESE1IQUzESMzIRUhgAIA/gCAgIACgICA/wABAP6AgICAAQD/AAOAgP0AAwD9gAEAgID/AIAAAAMAAAAAAwADgAALAA8AEwAAATMRMxUjESMRITUhBTMRIzMhFSECAICAgID+gAGA/gCAgIABgP6AA4D/AID+gAGAgID+gIAAAAIAAAAAAoADgAAHAAsAABEzESEVIREjATMRI4ABgP6AgAIAgIADgP8AgP4AAgD+gAAAAAABAAAAAAIAA4AABQAAETMRIRUhgAGA/gADgP0AgAAAAAMAAAAAAwADgAAJAA0AEQAAETMRIREjESMRIwEzESMpARUhgAEAgICAAoCAgP8AAQD/AAOA/wD+AAGA/gACgP4AgAAABwAAAAACgAOAAAMABwANABEAFQAZAB0AABEzFSMlIRUpAhUjFSMlMxUjITMRIwEzESMpARUhgIABgAEA/wD/AAEAgIABAICA/oCAgAIAgID+gAGA/oADgICAgICAgID+gAGA/oCAAAACAAAAAAKAA4AAAwALAAARMxEjATMRIxEhNSGAgAIAgID+gAGAA4D+gAEA/QABgIAAAAAABAAAAAACgAOAAAMABwALAA8AABEhFSkBMxUjKQEVKQEzESMCAP4AAgCAgP4AAgD+AAIAgIADgICAgP4AAAAAAAcAAAAAAoADgAADAAcACwAPABMAFwAfAAATIRUhIzMRIwEzESMhMxUjJTMVIyEzFSMlMxUhFSE1M4ABgP6AgICAAgCAgP6AgIABAICA/oCAgAEAgAEA/gCAA4CA/wABAP6AgICAgICAgIAAAAMAAAAAAwADgAADAAcADQAAEyEVISMzESMBMxEzFSGAAYD+gICAgAIAgID/AAOAgP8AAQD9gIAAAgAAAAACgAOAAAMADwAAEyEVISMzFSEVIREhETMRIYABgP6AgIABgP6AAYCA/YADgICAgP6AAYD+AAAAAwAAAAADAAOAAAMACQANAAARMxEjASEVIxEjKQEVIYCAAgABAICA/oABgP6AA4D9AAMAgP2AgAAHAAAAAAKAA4AAAwAHAAsADwATABcAGwAAEyEVISMzFSMlMxEjKQEVKQEzESMlMxUjMyEVIYABgP6AgICAAgCAgP4AAgD+AAIAgID+AICAgAGA/oADgICAgP8AgP8AgICAAAAAAwAAAAACgAOAAAUACQANAAARIREjESMBMxUjKQEVIQEAgIACAICA/wABAP8AA4D9AAKA/gCAgAAFAAAAAAKAA4AABwALAA8AEwAXAAARIRUhFSM1IRczFSsBMxEjJTMVIykBFSECgP8AgP8AgICAgICAAgCAgP6AAYD+gAOAgICAgID+gICAgAAAAAADAAAAAAKAA4AAAwAHAAsAABMhFSEjMxEjATMRI4ABgP6AgICAAgCAgAOAgP0AAwD9AAAABgAAAAACgAOAAAMABwALAA8AFQAZAAATIRUhIzMVIyUzESsBMxUrATMRITUhFyEVIYABgP6AgICAAgCAgICAgICA/oABAIABAP8AA4CAgID/AID/AICAgAAAAAADAAAAAAKAA4AABwALAA8AABMhFSMRIxErATMRIwEzESOAAYCAgICAgIACAICAA4CA/oABgP8AAQD9AAAFAAAAAAKAA4AAAwAJAA0AEQAZAAATIRUhIzMVMxUhATMRIwEzESM7ARUzFSE1IYABgP6AgICA/wACAICA/wCAgICAgP2AAYADgICAgAEA/gABAP8AgICAAAAAAAMAAAAAAwADgAADAAcADwAAEyEVISMzESMBMxEzFSMVI4ABgP6AgICAAgCAgICAA4CA/QADAP4AgIAAAAMAAAAAAoADgAADAAcACwAAETMRIwEzESMpARUhgIACAICA/oABgP6AA4D9AAMA/QCAAAACAAAAAAKAA4AABwALAAABMxEjESE1IQEzESMCAICA/oABgP4AgIADgPyAAQCAAQD/AAAABwAAAAACgAOAAAMABwALAA8AEwAXABsAABMhFSEjMxEjATMVIwUhFSkBMxEjJTMVIzMhFSGAAYD+gICAgAIAgID+gAGA/oABgICA/gCAgIABgP6AA4CA/wABAICAgP8AgICAAAMAAAAAAoADgAADAAcACwAAEyEVISMzESMBMxUjgAGA/oCAgIACAICAA4CA/QADAIAAAAAHAAAAAAKAA4AAAwAHAAsADwATABcAGwAAEyEVISMzESMBMxEjKQEVISMzFSMlMxEjKQEVIYABgP6AgICAAgCAgP6AAYD+gICAgAIAgID+gAGA/oADgID/AAEA/wCAgID/AIAAAQAAAAACAAOAAAcAABEzESEVIREjgAGA/oCAA4D/AID+AAAAAwAAAAACgAOAABMAFwAbAAABMxUzFSMRMxUjFSM1IzUzESM1MwUzESMBMxEjAQCAgICAgICAgICA/wCAgAIAgIADgICA/oCAgICAAYCAgP6AAYD+gAAAAAMAAAAAAoADgAADAA8AEwAAEyEVISMzESEVIRUhFSEVIwEzESOAAYD+gICAAYD+gAIA/gCAAgCAgAOAgP8AgICAgAMA/wAAAAQAAAAAAoADgAADAAcACwAPAAATIRUhIzMRIwEzESMpARUhgAGA/oCAgIACAICA/oABgP6AA4CA/YACgP2AgAAEAAAAAAKAA4AAEQAVABkAHQAAEyERMxUjETMVITUzESM1MzUrATMVIwUzESMlMxUjgAEAgICA/oCAgICAgICAAgCAgP4AgIADgP8AgP6AgIABgICAgID+gICAAAIAAAIAAQADgAADAAcAABEzESM7ARUjgICAgIADgP8AgAAAAAIAAAIAAQADgAADAAcAABMzESsBMxUjgICAgICAA4D/AIAAAAIAAAKAAQADgAADAAcAABMzFSsBMxUjgICAgICAA4CAgAAAAAEAAAIAAYADgAAHAAABMxEhFSMRIQEAgP8AgAEAA4D/AIABAAAAAAACAAACgAEAA4AAAwAHAAARMxUjOwEVI4CAgICAA4CAgAAAAAADAAACAAGAA4AAAwAHAAsAABMzFSsBMxEjATMVI4CAgICAgAEAgIADgID/AAEAgAABAAACgAKAA4AABQAAETMVIRUhgAIA/YADgICAAAAAAAQAAAAAAoACgAAFAAkADQARAAARIRUjESMBMxUrATMRIwEzESMBAICAAYCAgICAgAEAgIACgID+AAKAgP8AAQD+AAAABAAAAAACgAKAAAMACQANABEAABEzESMBMxEhNTMBMxErATMVI4CAAgCA/wCA/wCAgICAgAKA/gACAP2AgAEA/wCAAAADAAD/gAKAAoAACwAPABMAABEzFTMVIxUhFSERIwEhFSkBMxUjgICAAgD+AIABAAEA/wABAICAAoCAgICA/wADAICAAAMAAP+AAwACgAADABMAFwAAEyEVISUzETMVIxEjESE1ITUjNTMhMxEjgAEA/wABgICAgID+gAGAgID+AICAAoCAgP6AgP8AAQCAgID/AAAAAgAA/4ADAAKAAAUADQAAESEVIREjATMRMxUjFSMCAP6AgAIAgICAgAKAgP4AAgD+gICAAAMAAAAAAoADgAAHAA8AEwAAETMRIRUhESMBMxEjNSM1MwUhFSGAAQD/AIACAICAgID+gAEA/wADgP8AgP6AAQD+gICAgIAAAAMAAP+AAwACgAADABEAFQAAEyEVISUzETMVIREhNSE1IzUzITMRI4ABAP8AAYCAgP8A/oABgICA/gCAgAKAgID9gIABAICAgP8AAAABAAD/gAIAA4AACwAAETMRIRUhESERIzUhgAGA/oABgID+gAOA/wCA/oD/AIAAAAADAAD/gAKAAoAACQANABEAABEzFTMVIxEhFSEBIRUpATMRI4CAgAIA/YABAAEA/wABAICAAoCAgP6AgAMAgP6AAAAAAAUAAP+AAoACgAAHAAsAEwAXABsAABEzFTMVIxEjASEVKQEzESM1IzUzBTMVIzsBFSOAgICAAQABAP8AAQCAgICA/wCAgICAgAKAgID+AAMAgP6AgICAgIAAAAAAAgAAAAADAAOAAA0AEQAAATMRMxUjESE1IREhNSEFMxEjAgCAgID+AAGA/oABgP4AgIADgP8AgP4AgAGAgID+gAAAAAADAAD/gAKAA4AABwALAA8AABEzETMVIxEjASEVKQEzESOAgICAAQABAP8AAQCAgAOA/oCA/gADAID+AAABAAD/gAEAAoAABQAAETMRMxUhgID/AAKA/YCAAAAAAAQAAP+AAwADgAAHAAsAEQAVAAARMxEzFSMRIwEzFSMlMxEhNTMBMxEjgICAgAEAgIABgID/AID/AICAA4D+gID+AAMAgID9gIABgP6AAAAACAAAAAACgAOAAAMABwALAA8AEwAXABsAHwAAEzMVKwEzFSMlIRUpAhUhIzMRIwEzFSM7AREjKQEVIYCAgICAgAGAAQD/AP8AAQD/AICAgAGAgICAgID+gAGA/oADgICAgICA/oABgID/AIAAAwAA/4ACgAOAAAMACwAPAAARMxEjATMRIxEjNTMFIRUhgIACAICAgID+gAEA/wADgP2AAgD8gAGAgICAAAAAAAMAAAAAAoADgAAHAAsADwAAETMRMxUjESMBIRUpATMRI4CAgIABAAEA/wABAICAA4D+gID+gAKAgP4AAAYAAAAAAoADgAADAAkADQARABkAHQAAETMVIzMhESM1IRUhFSEjMxEjATMRIzUjNTMFIRUhgICAAgCA/oABgP6AgICAAgCAgICA/oABAP8AA4CA/wCAgID/AAEA/oCAgICAAAACAAD/gAMAAoAABQALAAARIRUhESMBMxEzFSECAP6AgAIAgID/AAKAgP4AAgD+AIAAAAAABAAAAAACgAOAAAMACwATABcAABMhFSEjMxUhFSERIwEzESM1IzUzBSEVIYACAP4AgIABgP6AgAIAgICAgP6AAQD/AAOAgICA/oABgP4AgICAgAAAAgAAAAADAAOAAAcACwAAASEVIxEhNSEBMxEjAgABAID+AAGA/gCAgAOAgP0AgAIA/gAAAAMAAP+AAoACgAADAAcACwAAATMRIyUzFSMzIRUhAgCAgP4AgICAAYD+gAKA/YCAgIAAAAACAAAAAAMAA4AABQALAAARIREjESMFMxEhNSEBAICAAoCA/gABgAOA/QACgID9gIAAAAAABQAA/4ACgAKAAAMABwALAA8AFQAAEyEVISMzFSMlMxEjKQEVISMzFSEVIYABgP6AgICAAgCAgP6AAYD+gICAAgD9gAKAgICA/wCAgIAAAAADAAAAAAKAAoAABwALAA8AABEzFTMVIxEjASEVKQEzESOAgICAAQABAP8AAQCAgAKAgID+gAKAgP4AAAAEAAD/gAKAAoAAAwAJAA0AEwAAETMVIzMhESM1IRUhFSEjMxUhFSGAgIACAID+gAGA/oCAgAIA/YACgID/AICAgICAAAQAAP+AAoACgAADAAsADwATAAARMxEjATMRIzUjNTMBMxErATMVI4CAAgCAgICA/wCAgICAgAKA/gACAP0AgIABAP8AgAAAAAUAAP+AAoACgAADAAcACwAPABUAABMhFSEjMxEjATMRIykBFSEjMxUhFSGAAYD+gICAgAIAgID+gAGA/oCAgAIA/YACgID/AAEA/wCAgIAAAwAAAAACgAKAAAUACQAPAAARIRUhESMBMxErATMVMxUhAgD+gIACAICAgICA/wACgID+AAIA/wCAgAAAAgAAAAACgAKAAAMACQAAETMRIwEzESE1IYCAAgCA/gABgAKA/gACAP2AgAACAAD/gAMAA4AACQANAAABMxEzFSE1ITUhATMRIwIAgID/AP6AAYD+AICAA4D8gICAgAIA/gAAAAMAAAAAA4ACgAADAAsADwAAETMRIwEhFSERITUhATMRI4CAAYABgP8A/oABAAGAgIACgP4AAgCA/gCAAYD+AAACAAD/gAKAAoAABQAJAAARIRUhESMBMxEjAgD+gIACAICAAoCA/YACgP4AAAMAAP+AAoACgAAJAA0AEQAAEyERIzUhNSERISMzESMRIRUhgAIAgP6AAYD+gICAgAIA/gACgP2AgIABAP8A/wCAAAAAAQAAAAACAAKAAAUAABEzESEVIYABgP4AAoD+AIAAAAADAAD/gAOAA4AACwAPABMAAAEzESEVIREjNSE1IQEzESMBMxEjAYCAAQD/AID/AAEA/oCAgAMAgIADgP8AgP2AgIACAP4AAYD+AAAAAwAA/4ADAAKAABEAFQAZAAATMxUzFSEVIRUhFSEVIzUjNTMBIRUpATMVI4CAgAEA/oACAP4AgICAAQABAP8AAQCAgAKAgICAgICAgIACAICAAAAABAAAAAACgAKAAAMABwALAA8AABMhFSEjMxEjATMRIykBFSGAAYD+gICAgAIAgID+gAGA/oACgID+gAGA/oCAAAQAAP+AAoADgAAVABkAHQAhAAATIREzFSMRMxUjFSM1IzUzESM1MzUrATMVIwUzESMlMxUjgAEAgICAgICAgICAgICAgAIAgID+AICAA4D/AID+gICAgIABgICAgID+gICAAAADAAAAAAMAA4AAAwANABEAABEzESMBMxEhFSE1IzUzBTMVI4CAAYCAAQD+gICA/wCAgAOA/QABgP6AgICAgIAAAwAA/4ADAAKAAAsADwATAAABMxEzFSMRIxEhNSEBMxUjMyEVIQIAgICAgP8AAQD+AICAgAGA/oACgP8AgP8AAQCA/wCAgAAAAgAAAYACgAKAAAMABwAAETMVIzMhFSGAgIACAP4AAoCAgAAAAwAAAAACgAOAAAMABwAbAAATIRUhIzMVIyUzETMVIxUzFSMVIzUhNSE1ITUhgAEA/wCAgIABgICAgICAgP8AAQD/AAEAA4CAgID/AICAgICAgICAAAAAAAEAAAIAAoACgAADAAARIRUhAoD9gAKAgAAAAAACAAAAAACAAoAAAwAHAAARMxUjETMVI4CAgIACgID+gIAAAAACAAAAAAGAAoAAAwAJAAATIRUhIzMRIRUhgAEA/wCAgAEA/oACgID+gIAAAAUAAAAAAoACgAADAAcADwATABcAABEzFSMlMxEjJTMVIREjNSEjMxEjJTMVI4CAAgCAgP6AgAEAgP8AgICAAgCAgAKAgID/AICA/wCA/wCAgAAAAAIAAAAAAoACgAADAAsAABEhFSkBMxEzFSE1IQGA/oABgICA/YABgAKAgP6AgIAAAAUAAAAAAgACgAADAAcACwAPABMAABEhFSkBMxErATMVIyUzESMlMxUjAQD/AAEAgICAgIABAICA/oCAgAKAgP8AgID/AICAAAEAAAAAAoACgAAHAAARIRUjESMRIQKAgID+gAKAgP4AAgAAAAIAAAAAAoACgAAFAAkAABEhESMRIRUzESMCgID+AICAAoD9gAIAgP6AAAAAAQAAAAAAgAKAAAMAABEzESOAgAKA/YAAAQAAAAABgAKAAAcAABEhFSMRIxEjAYCAgIACgID+AAIAAAAAAgAAAAACgAKAAAUACQAAESEVIREjATMRIwIA/oCAAgCAgAKAgP4AAgD+AAAEAAAAAAKAAoAAAwAHAAsADwAAETMRIwEhFSkBMxEjKQEVIYCAAQABAP8AAQCAgP6AAYD+gAKA/gACAID+gIAAAQAAAYAAgAKAAAMAABEzESOAgAKA/wAAAQAA/4ACgAKAAAUAABEhESMRIQKAgP4AAoD9AAKAAAADAAAAAAKAAoAAAwAHAAsAABEhFSkBMxEjKQEVIQIA/gACAICA/gACAP4AAoCA/oCAAAAAAwAAAAACgAMAAAcACwAPAAARMxUhESMRIQEzFSsBMxUjgAIAgP4AAYCAgICAgAMAgP6AAQD/AICAAAAAAQAAAAACgAKAAAkAABEhFSERIREzESECAP6AAYCA/YACgID+gAGA/gAAAAAFAAAAAAKAAoAAAwAHAAsAEQAVAAARMxUjJSEVISMzFSMlMxEhNTMBMxEjgIABAAEA/wCAgIABgID/AID+AICAAoCAgICAgP4AgAEA/oAAAAEAAP+AAIACgAADAAARMxEjgIACgP0AAAIAAAAAAYACgAADAAkAABEhFSkBMxEhNSEBAP8AAQCA/oABAAKAgP4AgAAABAAAAAACgAKAAAMABwALAA8AABMhFSEjMxEjATMRIykBFSGAAYD+gICAgAIAgID+gAGA/oACgID+gAGA/oCAAAUAAP+AAoACgAADAAcACwAPABMAABMzESMBMxEjJTMVIzsBFSMpARUhgICAAYCAgP8AgICAgID+gAGA/oACgP6AAYD+AICAgIAAAAACAAD/gAKAAoAABwALAAARIRUhFTMVIQEzESMCAP6AgP8AAgCAgAKAgICAAQD9gAADAAAAAAKAAoAABwALAA8AABEhFSEVIRUhATMRIykBFSECAP6AAQD+gAIAgID+AAIA/gACgICAgAEA/oCAAAAABQAA/4ACgAKAAAMABwALAA8AEwAAETMVIyUzESMlMxEjJTMVKwEzESOAgAIAgID+gICAAQCAgICAgAKAgID/AID/AICA/oAABQAAAAACgAKAAAMABwALAA8AFQAAETMVIyUzESMlMxUjMyEVKQEzESE1IYCAAgCAgP6AgICAAQD/AAEAgP2AAgACgICA/wCAgID/AIAAAAAEAAD/gAKAAoAABQAJAA0AEQAAESERIzUhFTMRIwEzFSsBMxEjAoCA/gCAgAGAgICAgIACgP8AgID+AAIAgP8AAAAAAAIAAAAAAoACgAADAAcAABEhFSkBMxEjAgD+AAIAgIACgID+AAAAAAADAAAAAAKAAoAABwALABEAABEzETMVIxUjATMRIwEzESE1IYCAgIABAICAAQCA/gABgAKA/wCAgAIA/wABAP2AgAAAAAIAAAAAAoACgAAJAA0AABEhFSERITUzESMhMxEjAgD/AP8AgIACAICAAoCA/gCAAYD+AAACAAAAAAGAAoAAAwAHAAARMxEjATMRI4CAAQCAgAKA/YACgP2AAAAAAgAAAAABgAKAAAMABwAAETMRIwEzESOAgAEAgIACgP8AAQD9gAAAAAIAAAGAAYACgAADAAcAABEzESMBMxEjgIABAICAAoD/AAEA/wAAAAACAAABAAEAAoAAAwAHAAATMxErATMVI4CAgICAgAKA/wCAAAAEAAABAAIAAoAAAwAHAAsADwAAEzMRIwEzESMhMxUjJTMVI4CAgAEAgID+gICAAQCAgAKA/wABAP8AgICAAAAAAwAAAAACgAOAAAsADwATAAARMxEhESM1IREzFSEBMxUrATMVI4ACAID+gID/AAGAgICAgIADgP8A/wCA/oCAAYCAgAAEAAAAAAKAA4AABwALAA8AEwAAESEVIRUjNSMVMxEjJTMVIykBFSECgP6AgICAgAIAgID+gAGA/oADgICAgID+AICAgAAAAAADAAAAAAOAA4AAAwANABEAABMzFSMlMxEhFSERITUhATMRI4CAgAGAgAEA/oD+gAGA/gCAgAOAgID9AIABgIABAP8AAAEAAAAAA4ADgAAJAAARIREhFSERIRUjAoABAP6A/oCAA4D9AIADAIAAAAAABAAAAAACgAOAAAsADwATABcAABEhFSEVMxUhNTM1IREzESMBMxEjKQEVIQKA/wCA/oCA/wCAgAIAgID+gAGA/oADgICAgICA/wD+gAGA/oCAAAAAAQAAAAACgAOAAAcAABEhESMRIRUjAoCA/oCAA4D8gAMAgAAAAQAAAAADgAOAAA0AABEhESERIzUjESMRIRUjAoABAICAgP6AgAOA/wD/AID+AAMAgAAAAAQAAAAAA4ADgAAJAA0AEQAVAAARIREzFSMRIxEhBSEVKQEzESMpARUhAYCAgID/AAIAAQD/AAEAgID+gAGA/oADgP6AgP8AAoCAgP6AgAAAAgAAAAADgAOAAA0AEQAAEyERIREjNSMRITUhESEjMxEjgAIAAQCAgP4AAYD+gICAgAOA/wD/AID+AIACgP2AAAEAAAAAAoADgAAFAAARIREjESECgID+AAOA/IADAAAAAgAAAAACgAOAAAcADwAAETMVIRUhESMBMxEjNSE1IYABgP6AgAIAgID+gAGAA4CAgP6AAYD9gICAAAAABAAAAAADgAOAAAsADwATABcAABEhETMVIxEjESMVIykBFSkBMxEjKQEVIQGAgICAgIACAAEA/wABAICA/oABgP6AA4D+gID/AAKAgID+gIAAAAAAAwAAAAADAAOAAA0AEQAVAAARIREzFSMRIxEhNSE1IREzESMzIRUhAoCAgID+gAGA/gCAgIABgP6AA4D/AID+gAGAgID/AP6AgAAAAAIAAAAAAoADgAAJAA0AABEhFSEVIRUhESMBMxEjAoD+AAGA/oCAAgCAgAOAgICA/gACAP4AAAAABwAAAAADgAOAAAMABwALAA8AEwAXABsAABMhFSEjMxEjATMRKwEzFSMlMxUjKQEVISUhFSGAAYD+gICAgAIAgICAgIABgICA/YABAP8AAYABAP8AA4CA/YACgP4AgICAgICAAAMAAAAAA4ADgAAFAAkADQAAESERIxEhJTMRIykBFSEBgID/AAMAgID+gAGA/oADgP0AAoCA/QCAAAAAAAIAAAAAAwADgAAFAA0AABEhESMRIyUzESMRITUhAQCAgAKAgID+gAGAA4D+gAEAgPyAAYCAAAAAAwAAAAADgAOAAAkADQARAAABMxEhESM1IxEjATMRIzMhFSECAIABAICAgP4AgICAAYD+gAOA/wD/AID+gAEA/wCAAAADAAAAAAKAA4AAAwAHAAsAABEzESMBMxEjKQEVIYCAAgCAgP6AAYD+gAOA/QABAP8AgAAAAgAAAAACgAOAAAsADwAAESEVIRUhFSERIRUhATMVIwIA/oABgP6AAgD9gAIAgIADgICAgP6AgAMAgAAABQAAAAADgAOAAAMABwANABEAFQAAEyEVISMzESMBMxEzFSkCFSElMxUjgAGA/oCAgIACAICA/wD+gAGA/oACgICAA4CA/YACgP4AgICAgAADAAAAAAKAA4AADwATABcAABMhFSMRMxUjESMRIzUzESsBMxEjATMRI4ABgICAgICAgICAgIACAICAA4CA/oCA/wABAIABgP6AAYD+gAAAAAEAAAAAAoADgAAPAAABMxEhESM1IxEjESERMxUzAQCAAQCAgID/AICAA4D/AP8AgP4AAgABAIAAAwAAAAACgAOAAAMABwALAAATIRUhIzMRIwEzESOAAYD+gICAgAIAgIADgID9AAMA/QAAAAIAAAAAAoADgAADAAsAABEzESMBMxEjESE1IYCAAgCAgP6AAYADgP6AAYD8gAGAgAAAAAAEAAAAAAKAA4AAAwALAA8AEwAAETMRIwEzESMRITUhATMVIzMhFSGAgAIAgID+gAGA/gCAgIABgP6AA4D+gAGA/QABAID/AICAAAAAAgAAAAACgAOAAAcACwAAETMRIRUhESMBMxEjgAGA/oCAAgCAgAOA/wCA/gACAP4AAAAAAAQAAP+AAoADgAADAAcACwATAAATIRUhIzMRIwEzFSMRMxEjNSE1IYABgP6AgICAAgCAgICA/oABgAOAgP2AAoCA/oD+gICAAAIAAAAAA4ADgAAPABMAAAEzESERIzUjESE1IREhNSEFMxEjAgCAAQCAgP4AAYD+gAGA/gCAgAOA/wD/AID+AIABgICA/oAAAAIAAAAAAoADgAAPABMAABEhFSEVIRUhFSERIzUjESMBMxUjAgD+gAGA/oABAICAgAIAgIADgICAgID/AID/AAMAgAAABgAAAAACgAOAAAMABwALAA8AEwAXAAATIRUhIzMVIzMhFSkBMxEjJTMVIzMhFSGAAgD+AICAgIABgP6AAYCAgP4AgICAAYD+gAOAgICA/oCAgIAAAgAAAAACgAOAAAkADQAAETMRIRUhESEVIQEzESOAAYD+gAIA/YACAICAA4D+gID/AIADgP6AAAAIAAD/gAKAA4AABwALAA8AEwAXABsAHwAjAAARIREjNSEVIzsBESMBMxErATMVKwEzESMBMxUjOwEVIyEzFSMCgID+gICAgIABAICAgICAgICAAQCAgICAgP4AgIADgP8AgID/AAEA/wCA/wABAICAgAAAAAMAAAAAA4ADgAAHAAsADwAAESERIxEjFSMBMxEjKQEVIQGAgICAAwCAgP6AAYD+gAOA/QACgID/AP8AgAAAAAACAAAAAAKAA4AABwALAAARMxEhFSERIwEzFSOAAYD+gIACAICAA4D/AID+AAIAgAAEAAAAAAKAA4AABQAJAA0AEQAAETMVIRUpATMRIyUzFSMzIRUhgAGA/gACAICA/gCAgIABgP6AA4CAgP4AgICAAAAAAAMAAAAAAoADgAADAAsADwAAEzMVIyUzESMRITUhATMRI4CAgAGAgID+gAGA/gCAgAOAgID8gAGAgAEA/wAAAAADAAAAAAKAA4AAAwAHAA8AABEzESMBMxEjKQEVIxEjESOAgAIAgID+gAGAgICAA4D+gAGA/oCA/oABgAADAAAAAAOAA4AAEwAXABsAAAEhFSEVIRUhFSEVIREhNSE1ITUhATMVIwEzFSMBgAGA/wABAP8AAQD/AP6AAQD/AAEAAYCAgP0AgIADgICAgICA/wCAgIABgID+gIAAAAAGAAAAAAKAA4AAAwAHAAsADwATABcAABEhFSkBMxUjKQEVISMzESMlMxUjKQEVIQIA/gACAICA/oABgP6AgICAAgCAgP6AAYD+gAOAgICA/oCAgIAAAAAABQAAAAACgAOAAAUACQANABEAFwAAESERIzUhBTMVKwEzFSsBMxUrATMVIRUhAoCA/gABgICAgICAgICAgIACAP2AA4D/AICAgICAgIAAAAAEAAAAAAKAAoAABQAJAA0AEQAAATMVMxUpATMRIyUzFSMzIRUhAQCAgP8AAQCAgP4AgICAAYD+gAKAgID/AICAgAAAAAQAAAAAAoADgAAJAA0AEQAVAAARIREzFSE1MxEhETMRIwEzESMpARUhAYCA/oCA/wCAgAIAgID+gAGA/oADgP6AgIABAP6A/wABAP8AgAAABQAA/4ACgAKAAAMACQANABEAFQAAESEVKQEzESE1IQUzESMBMxEjKQEVIQGA/oABgID+gAEA/oCAgAIAgID+gAGA/oACgID/AICA/wABAP8AgAAACAAA/4ACgAKAAAMABwALAA8AEwAXAB8AIwAAEzMVIyUzFSMhMxEjATMVIyUzFSsBMxUjITMVMxUhNTMFMxUjgICAAQCAgP6AgIABAICAAQCAgICAgP8AgID+gIABAICAAoCAgID/AAEAgICAgICAgICAAAAFAAD/gAKAAoAAAwAHAAsADwATAAATIRUhIzMVIyUzESMlMxUjMyEVIYABgP6AgICAAgCAgP4AgICAAYD+gAKAgICA/gCAgIAAAAAABwAA/4ACgAKAAAMABwALAA8AEwAXABsAABMhFSEjMxUjJTMVIykBFSkBMxEjJTMVIzMhFSGAAYD+gICAgAIAgID/AAEA/wABAICA/gCAgIABgP6AAoCAgICAgP8AgICAAAAAAAUAAAAAAoADgAADAAcAEwAXABsAABMzFSsBMxEjATMRMxUjESMRIzUzBTMRKwEzFSOAgICAgIABAICAgICAgAEAgICAgIADgID/AAEA/wCA/wABAICA/wCAAAAABgAAAAACgAKAAAMABwALAA8AEwAXAAATMxUjJTMVIyEzESMBMxEjATMRIyUzFSOAgIABAICA/oCAgAEAgIABAICA/oCAgAKAgICA/oABgP6AAYD+AICAAAUAAAAAAoACgAADAAcACwAPABMAABMhFSEjMxEjATMRIyEzFSMlMxUjgAGA/oCAgIACAICA/oCAgAEAgIACgID+gAGA/oCAgIAAAAAGAAD/gAKAAoAAAwAHAAsADwATABcAAAEzFSM7ARUrATMVIzsBESMlMxUjMyEVIQGAgICAgICAgICAgID+AICAgAGA/oACgICAgP8AgICAAAsAAP+AA4ACgAADAAcACwAPABMAFwAbAB8AIwAnACsAABMzFSMlMxUjJTMVIyEzESMBMxUjJTMVIyUzESMpARUhIzMVIyUhFSkBMxUjgICAAQCAgAEAgID9gICAAQCAgAEAgIABAICA/YABAP8AgICAAYABAP8AAQCAgAKAgICAgID/AAEAgICAgP8AgICAgIAAAAAFAAAAAAKAA4AAAwALAA8AEwAXAAATIRUpATMRIxEjNTMlIRUhIzMRIzMhFSGAAYD+gAGAgICAgP6AAQD/AICAgIABgP6AA4CA/YABAICAgP6AgAAEAAAAAAKAA4AACQANABEAFQAAESEVIREzFSMRIwEhFSkBMxEjKQEVIQKA/gCAgIABAAEA/wABAICA/oABgP6AA4CA/wCA/wACAID+gIAAAAcAAAAAAoACgAADAAcACwAPABMAFwAbAAATMxUjJTMVIyEzESMBMxEjATMRIyEzFSMlMxUjgICAAQCAgP6AgIABAICAAQCAgP6AgIABAICAAoCAgID+gAGA/wABAP6AgICAAAAHAAD/gAKAA4AAAwAHAAsADwATABcAGwAAETMVIzMhFSkBMxEjKQEVKQEzESMlMxUjMyEVIYCAgAGA/oABgICA/wABAP8AAQCAgP4AgICAAYD+gAOAgID/AID/AICAgAAFAAD/gAKAAoAABwALAA8AEwAXAAABIREjESMVIyUzFSM7ARUjBzMVIzMhFSEBAAGAgICA/wCAgICAgICAgIABgP6AAoD9gAIAgICAgICAgAAAAAAIAAAAAAKAA4AAAwAHAA8AEwAXABsAHwAjAAABMxUjKQEVISMzFTMVIxEjATMVKwEzFSMlMxEjITMVIyUzFSMCAICA/oABgP6AgICAgIABgICAgICAAQCAgP6AgIABAICAA4CAgICA/wABgICAgP8AgICAAAQAAAAAAoADgAADAAcACwAPAAARMxEjATMVIzsBESMpARUhgIABgICAgICA/oABgP6AA4D9AAIAgP6AgAAAAAAGAAD/gAKAAwAAAwAHAA8AEwAXABsAAAEzFSsBMxUjJTMRIxUjETMFMxEjATMRIykBFSEBAICAgICAAQCAgICA/oCAgAIAgID+gAGA/oADAICAgP8AgAEAgP6AAYD+gIAAAAAABwAA/4ACgAKAAAMABwALAA8AEwAXABsAABMzFSMlMxUjITMVIyUzFSMlMxEjJTMVIzMhFSGAgIABAICA/oCAgAEAgIABAICA/gCAgIABgP6AAoCAgICAgICA/gCAgIAACgAA/4ACgAKAAAMABwALAA8AEwAXABsAHwAjACcAABMzFSMlMxUjITMVIyUzFSMlMxEjJTMVIyEzFSMhMxUjJTMVIykBFSGAgIABAICA/oCAgAEAgIABAICA/oCAgAEAgID/AICAAYCAgP8AAQD/AAKAgICAgICAgP8AgICAgICAgAAABAAA/4ACgAOAAAcACwAPABMAAAEzESMRITUhBTMVIwczFSMzIRUhAgCAgP8AAQD+gICAgICAgAGA/oADgPyAAYCAgICAgIAABwAA/4ACgAKAAAMABwALAA8AEwAbAB8AABMzFSMlMxUjITMRIwEzFSMlMxEjITMVMxUhNTMFMxUjgICAAQCAgP6AgIABAICAAQCAgP6AgID+gIABAICAAoCAgID/AAEAgID/AICAgICAAAAABAAA/4ACgAKAAAMACwAPABMAABMzFSMlMxEjNSE1IQEzESMRIRUhgICAAYCAgP6AAYD+AICAAgD+AAKAgID9gICAAQD/AP8AgAAAAAcAAAAAAoADgAADAAcACwAPABcAGwAfAAATMxUjJTMVIyEzFSMlMxUjJTMRIxEhNSEFMxEjMyEVIYCAgAEAgID+gICAAQCAgAEAgID/AAEA/oCAgIABAP8AA4CAgICAgICA/YABAICA/wCAAAQAAAAAAoADgAADAA8AEwAXAAATIRUhIzMVIRUhFSEVIREjATMVIxMzESOAAQD/AICAAQD/AAGA/oCAAYCAgICAgAOAgICAgID/AAMAgP6A/wAAAAcAAP+AAoACgAADAAcACwAPABMAFwAbAAATMxUjJTMVIyEzESMBMxUrATMVIzsBESMpARUhgICAAQCAgP6AgIACAICAgICAgICA/oABgP6AAoCAgID+AAIAgID/AIAAAAQAAAAAAoADgAAHAAsADwATAAABMxEjESM1MyUhFSEjMxEjMyEVIQIAgICAgP6AAQD/AICAgIABgP6AA4D9AAEAgICA/oCAAAkAAP+AAoADgAADAAcADwATABcAGwAfACMAJwAAEzMVIyUzFSMhMxEhFSEVIwEzFSMlMxUjETMVIyEzESMBMxErATMVI4CAgAEAgID+gIABgP6AgAEAgIABAICAgID+gICAAQCAgICAgAOAgICA/wCAgAIAgICA/wCA/wABAP8AgAAAAAYAAP+AAoADgAADABcAGwAfACMAJwAAESEVKQEzFTMVIxUzFSMVIzUjNTM1IzUzBTMVIwMzFSMlMxUjKQEVIQGA/oABgICAgICAgICAgID/AICAgICAAgCAgP6AAYD+gAOAgICAgICAgICAgICA/wCAgICAAAAAAAMAAAAAAoADgAAHAAsADwAAETMRIRUhESMBMxEjKQEVIYABgP6AgAIAgID+gAGA/oADgP6AgP8AAQD/AIAAAAAEAAD/gAIAA4AACwAPABMAFwAAATMRMxUjESMRIzUzEzMRIyUzFSMzIRUhAQCAgICAgICAgID+gICAgAEA/wADgP8AgP8AAQCA/oD/AICAgAAAAAAIAAAAAAKAA4AAAwAHAAsADwATABcAGwAfAAABIRUpATMVIykBFSkBMxUjKQEVKQEzFSMlMxUjKQEVIQEAAQD/AAEAgID/AAEA/wABAICA/wABAP8A/wCAgAIAgID+gAGA/oADgICAgICAgICAgAAACgAAAAADAAOAAAMABwAPABMAFwAbAB8AIwAnACsAABMzFSMlMxUjITMRMxUjESMBMxEjATMVKwEzFSM7ARUrATMVIzsBFSMpARUhgICAAYCAgP4AgICAgAEAgIABgICAgICAgICAgICAgICA/gACAP4AA4CAgID/AID/AAKA/wABAICAgICAgAAAAAAIAAD/gAKAAoAAAwAHAAsADwATABcAGwAfAAATIRUhIzMRIwEzESMhMxUjJTMVKwEzFSsBMxUjJTMVI4ABgP6AgICAAgCAgP6AgIABAICAgICAgICAAQCAgAKAgP8AAQD/AICAgICAgIAAAAAEAAD/gAKAAoAACQANABEAFQAAESEVIxEhNTM1IQEzESMlMxUjMyEVIQKAgP8AgP6AAgCAgP4AgICAAYD+gAKAgP8AgID/AP8AgICAAAAAAAgAAP+AAoADgAADAAcACwAPABMAFwAbAB8AABMhFSEjMxUjMyEVKQEzFSMpARUpATMRIyUzFSMzIRUhgAEA/wCAgICAAYD+gAGAgID/AAEA/wABAICA/gCAgIABgP6AA4CAgICAgP8AgICAAAUAAP+AAoADgAADAAcAGwAfACMAABMhFSEjMxUjJTMVMxUjFTMVIxEjESE1ITUhNSEBMxEjMyEVIYABAP8AgICAAYCAgICAgID/AAEA/wABAP6AgICAAQD/AAOAgICAgICAgP8AAQCAgID+gP8AgAAFAAD/gAKAA4AAAwAXABsAHwAjAAARIRUpATMVMxUjETMVIxUjNSM1MxEjNTMFMxEjATMRIwMhFSEBAP8AAQCAgICAgICAgICA/wCAgAIAgICAAQD/AAOAgICA/wCAgICAAQCAgP8AAQD/AP8AgAAABgAA/4ACgAKAAAMABwALAA8AEwAXAAARIRUpATMVIykBFSEjMxEjJTMVIykBFSECAP4AAgCAgP6AAYD+gICAgAIAgID+gAGA/oACgICAgP8AgICAAAAAAAQAAP+AAoACgAAHAAsADwATAAARMxEhFSEVIwEzFSM7AREjASEVIYABgP6AgAGAgICAgID+gAIA/gACgP6AgIACgID/AP8AgAAAAAAFAAD/gAKAAoAAAwAHAAsAEwAXAAATIRUhIzMRIwEzESMpARUjFSM1IwUhFSGAAYD+gICAgAIAgID+gAGAgICAAQABAP8AAoCA/wABAP8AgICAgIAAAAAABQAA/4ACgAKAAAMABwALABMAFwAAEyEVISMzESMBMxUjBTMVIRUhNTMFMxUjgAGA/oCAgIACAICA/oCAAQD+AIABgICAAoCA/wABAICAgICAgIAAAwAAAIABgAIAAAMABwALAAARMxUjITMVIyEzFSOAgAEAgID/AICAAgCAgIAAAAAAAgAAAQABgAOAAAsADwAAESEVIRUzFSMVMxUhATMVIwGA/wCAgID/AAEAgIADgICAgICAAQCAAAAGAAD/gAKAAoAAAwAHAAsADwATABcAABMhFSEjMxUjMyEVKQEzESMlMxUjMyEVIYACAP4AgICAgAGA/oABgICA/gCAgIABgP6AAoCAgID/AICAgAAIAAD/gAKAAoAAAwAHAAsADwATABcAGwAfAAARIRUhJSEVISMzFSsBMxUjJTMVIyEzESMBMxEjKQEVIQEA/wABgAEA/wCAgICAgIABAICA/oCAgAIAgID+gAGA/oACgICAgICAgID/AAEA/wCAAAAABAAAAAACgAKAAAMABwALAA8AABMhFSEjMxEjATMRIykBFSGAAYD+gICAgAIAgID+gAGA/oACgID+gAGA/oCAAAIAAAAAAoADgAAHAAsAABMhESE1IREhIzMRI4ACAP4AAYD+gICAgAOA/ICAAoD9gAAAAAADAAAAAAKAA4AACwAPABMAABMhESE1ITUhNSERISMzESMVMxUjgAIA/gABgP6AAYD+gICAgICAA4D8gICAgAGA/oCAgAAAAAAGAAAAAAKAA4AABwALAA8AEwAXABsAABEhESM1IRUjITMVIykBFSEjMxEjJTMVIykBFSECgID+gIABgICA/wABAP8AgICAAgCAgP6AAYD+gAOA/wCAgICA/wCAgIAAAAAFAAAAAAIAA4AACwAPABMAFwAbAAARMxEzFSMVMxUjESMBMxUrATMVIzsBFSsBMxUjgICAgICAAYCAgICAgICAgICAgAOA/wCAgID/AAOAgICAgAAEAAAAAAKAA4AABQAJAA0AEQAAESEVIxEjATMRIzsBESM7AREjAQCAgAEAgICAgICAgIADgID9AAMA/wD/AP8AAAAAAAUAAAAAAoADgAAFAAkADQARABUAABEhFSMRIwEzESM7ARErATMRIwEzESMBAICAAQCAgICAgICAgAEAgIADgID9AAMA/wD/AP8AAQD/AAAABQAAAAACgAOAAAUACQANABEAFQAAESEVIxEjATMRIzsBESsBMxUjJTMRIwEAgIABAICAgICAgICAAQCAgAOAgP0AAwD/AP8AgID/AAAAAAAFAAAAAAKAA4AACQANABEAFQAZAAARIRUjETMRIxEjATMRIzsBESsBMxEjATMRIwEAgICAgAEAgICAgICAgIABAICAA4CA/wD/AP8AAwD/AP8A/wABAP8AAAAAAAIAAAAAAgADgAALAA8AABEzESEVIRUhFSERIwEzFSOAAQD/AAEA/wCAAYCAgAOA/wCAgID/AAIAgAAAAAIAAAAAAgADgAAPABMAABEzFSEVIRUzFSMVIRUhFSMBMxEjgAEA/wCAgAEA/wCAAYCAgAOAgICAgICAgAKA/oAAAAAAAwAAAAABgAOAAAkADQARAAARIRUjFTMVIxEjATMVIxUzFSMBAICAgIABAICAgIADgICAgP4AAwCAgIAABQAAAAACAAOAAAkADQARABUAGQAAESEVIxUzFSMRIwEzFSsBMxUjOwEVKwEzFSMBAICAgIABgICAgICAgICAgICAA4CAgID+AAOAgICAgAAEAAAAAAIAA4AACQANABEAFQAAESEVIxUzFSMRIwEzFSsBMxUjFTMVIwEAgICAgAGAgICAgICAgAOAgICA/gADgICAgIAAAAAFAAAAAAIAA4AACQANABEAFQAZAAARIRUjFTMVIxEjATMVIzsBFSsBMxUjOwEVIwEAgICAgAEAgICAgICAgICAgIADgICAgP4AAwCAgICAAAUAAAAAAoADgAATABcAGwAfACMAAAEzETMVIxUzFSMVIxEjNTM1IzUzJTMVIxUzFSMhMxUjFTMVIwEAgICAgICAgICAgP8AgICAgAIAgICAgAOA/oCAgICAAQCAgICAgICAgICAAAAAAwAAAAABgAOAAAsADwATAAARMxEzFSMVMxUjFSMBMxUjFTMVI4CAgICAgAEAgICAgAOA/oCAgICAAYCAgIAAAAMAAAAAAYADgAALAA8AEwAAATMRIzUjNTM1IzUzBTMVIxUzFSMBAICAgICAgP8AgICAgAOA/ICAgICAgICAgAAFAAAAAAKAA4AAEwAXABsAHwAjAAABMxEzFSMVMxUjESM1IzUzNSM1MwEzFSMVMxUjITMVIxUzFSMBAICAgICAgICAgIABAICAgID+AICAgIADgP8AgICA/wCAgICAAQCAgICAgIAAAAQAAAAAAoADgAAPABMAFwAbAAABMxEzFSMRIzUjNTM1IzUzATMVIwEzFSMVMxUjAQCAgICAgICAgAEAgID+AICAgIADgP8AgP4AgICAgAEAgP8AgICAAAAGAAAAAAIAA4AACQANABEAFQAZAB0AABEhFSMRMxUjESMBMxUjOwEVKwEzFSMVMxUjOwEVIwEAgICAgAEAgICAgICAgICAgICAgAOAgP6AgP8AAwCAgICAgIAAAAUAAACAAYADAAADAAcACwAPABMAAAEzFSsBMxUrATMVIzsBFSM7ARUjAQCAgICAgICAgICAgICAgAMAgICAgIAAAAAAAwAAAAACAAOAAAcACwAPAAARMxEzFSMRIwEzFSM7ARUjgICAgAEAgICAgIADgP4AgP8AAQCAgAADAAAAAAIAA4AABwALAA8AABEzETMVIxEjATMVKwEzFSOAgICAAYCAgICAgAOA/wCA/gADgICAAAMAAAAAAoADgAALAA8AEwAAEzMRMxEjESMRIxEzATMVKwEzFSOAgICAgICAAYCAgICAgAOA/wD/AP6AAYABAAEAgIAACQAAAAACgAOAAAMABwALAA8AEwAXABsAHwAjAAARMxUjJTMVIyEzESMBMxErATMVKwEzESMBMxEjITMVIyUzFSOAgAIAgID+gICAAQCAgICAgICAgAEAgID+gICAAgCAgAOAgICA/wABAP8AgP8AAQD/AICAgAAACwAAAAACgAOAAAMABwALAA8AEwAXABsAHwAjACcAKwAAETMVIyUzFSMhMxEjATMRIyEzFSMlMxUjJTMVIyEzESMBMxEjITMVIyUzFSOAgAIAgID+gICAAQCAgP6AgIABAICAAQCAgP6AgIABAICA/oCAgAIAgIADgICAgP8AAQD/AICAgICA/wABAP8AgICAAAAAAAQAAAAAAgADgAAJAA0AEQAVAAARIRUjETMVIxEjATMVIzsBFSsBMxUjAQCAgICAAQCAgICAgICAgAOAgP6AgP8AAwCAgIAAAAIAAAAAAoADgAAHAA8AABEzESEVIREjATMRIxEjNTOAAQD/AIACAICAgIADgP6AgP6AA4D8gAEAgAAAAAIAAAAAAoADgAALABcAABEzESEVIRUhFSERIwEzESM1IzUzNSM1M4ABAP8AAQD/AIACAICAgICAgAOA/wCAgID/AAOA/ICAgICAAAAFAAAAAAKAA4AAEwAXABsAHwAjAAABMxEzFSMVMxUjESMRIzUzNSM1MyUzFSMlMxUjATMVIyUzFSMBAICAgICAgICAgID/AICAAgCAgP4AgIACAICAA4D/AICAgP8AAQCAgICAgICA/oCAgIAAAAAAAQAAAAABgAOAAAsAABMzETMRIxEjESMRM4CAgICAgIADgP8A/wD+gAGAAQAAAAAAAwAAAAACgAOAAAsADwATAAABMxEzFSMRIxEjNTMlMxUjATMVIwEAgICAgICA/wCAgAIAgIADgP6AgP6AAgCAgID/AIAAAAAAAgAAAAABgAOAAAcACwAAETMRMxUjESMBMxUjgICAgAEAgIADgP6AgP6AAYCAAAAAAwAAAAACgAOAAAsADwATAAABMxEzESMRIxEjETMlMxUjATMVIwEAgICAgICA/wCAgAIAgIADgP8A/wD+gAGAAQCAgP8AgAAAAQAAAAAAgAOAAAMAABEzESOAgAOA/IAAAQAAAAABgAOAAAsAABMzETMRIxEjESMRM4CAgICAgIADgP8A/wD+gAGAAQAAAAAACgAAAAADAAOAAAMABwALAA8AEwAXABsAHwAjACcAAAEzFSsBMxUrATMVIyUzFSMhMxUjJTMVIyEzFSMlMxUrATMVKwEzFSMBAICAgICAgICAAYCAgP8AgIABgICA/wCAgAGAgICAgICAgIADgICAgICAgICAgICAgIAAAAMAAAAAAoADgAATABcAGwAAATMRMxUjFTMVIxEjESM1MzUjNTMFMxUjJTMVIwEAgICAgICAgICAgP8AgIACAICAA4D/AICAgP8AAQCAgICAgICAAAMAAAAAAoADgAALAA8AEwAAATMRMxUjESMRIzUzATMVIwEzFSMBAICAgICAgAEAgID+AICAA4D/AID+AAGAgAEAgP8AgAAAAAIAAAAAAYADgAAHAAsAAAEzESMRIzUzBTMVIwEAgICAgP8AgIADgPyAAYCAgIAAAAMAAAAAAoADgAAHAAsADwAAASEVIxEhNTMBMxUjATMVIwEAAQCA/wCAAQCAgP4AgIADgID9AIACgID+gIAAAAAFAAAAAAIAA4AABwALAA8AEwAXAAARIRUjETMVIQEzFSsBMxUjETMVIzsBFSMBAICA/wABgICAgICAgICAgIADgID9gIADgICA/oCAgAAAAAMAAAAAAoADgAADAA8AEwAAETMVIyUzFTMRIxEjESMRMyUzFSOAgAEAgICAgICAAQCAgAOAgICA/wD+AAIAAQCAgAAABwAAAAABgAOAAAMABwALAA8AEwAXABsAAAEzFSsBMxUrATMVIzMhFSEjMxUjOwEVIzsBFSMBAICAgICAgICAgAEA/wCAgICAgICAgIADgICAgICAgIAAAAMAAAAAAoADgAAFAAsADwAAETMRMxUhASERIxErATMVI4CA/wABgAEAgICAgIADgP4AgAGA/YACAIAAAAEAAAIAAIADgAADAAARMxEjgIADgP6AAAEAAAGAAYADgAAHAAATMxEzESERM4CAgP6AgAOA/wD/AAEAAAMAAAEAAoADgAALAA8AEwAAATMRMxUjFSM1IzUzJTMVIyUzFSMBAICAgICAgP8AgIACAICAA4D+gICAgICAgICAAAAAAwAAAAACgAOAAAsADwATAAABMxUzFSMRIxEjNTMFMxUjJTMVIwEAgICAgICA/wCAgAIAgIADgICA/YACgICAgICAAAACAAAAAAGAA4AABwALAAABMxEjESM1MwUzFSMBAICAgID/AICAA4D8gAKAgICAAAACAAAAAAIAA4AADwATAAABMxEzESMRIxEjETM1IzUzBTMVIwEAgICAgICAgID/AICAA4D+gP8A/wABAAEAgICAgAAAAAUAAAAAAgADgAALAA8AEwAXABsAABEhFSERMxUjESEVIQEzFSsBMxUjFTMVIzsBFSMBgP8AgIABAP6AAYCAgICAgICAgICAA4CA/wCA/wCAAwCAgICAgAADAAAAAAGAA4AACwAPABMAABEzETMVIxUzFSMRIwEzFSMVMxUjgICAgICAAQCAgICAA4D/AICAgP8AAwCAgIAAAwAAAAACAAOAAA8AEwAXAAARIRUhFTMVMxUhFTMVMxUhATMRIxUzESMBgP8AgID/AICA/oABgICAgIADgICAgICAgIADAP8AgP8AAAUAAAAAAgADgAALAA8AEwAXABsAABEzETMVIxUzFSMRIwEzFSsBMxUjETMVIzsBFSOAgICAgIABgICAgICAgICAgIADgP8AgICA/wADgICA/oCAgAAAAAADAAAAAAKAA4AABwAPABMAABEzFTMVIxEjATMRIxEjNTMFMxUjgICAgAIAgICAgP8AgIADgICA/YADgPyAAoCAgIAAAAMAAAAAAoADgAALABcAGwAAETMVMxUjFTMVIxEjATMRIxEjNTM1IzUzBTMVI4CAgICAgAIAgICAgICA/wCAgAOAgICAgP6AA4D8gAGAgICAgIAAAAMAAAAAAoADgAADAA8AEwAAETMRIwEzETMVIxEjESM1MwEzESOAgAEAgICAgICAAQCAgAOA/wABAP8AgP4AAgCAAQD/AAAAAAEAAAAAAYADgAAHAAARIREjESMRIwGAgICAA4D/AP2AAoAAAAIAAAAAAYADgAAHAAsAABEzFTMVIxEjATMVI4CAgIABAICAA4CAgP2AAoCAAAAAAAIAAAAAAgADgAAPABMAABMzFTMVIxUzESMRIxEjETMlMxUjgICAgICAgICAAQCAgAOAgICA/wD/AAEAAQCAgAAIAAAAgAKAAwAAAwAHAAsADwATABcAGwAfAAABMxUrATMVIyUzFSMhMxUjJTMVIyEzFSMlMxUrATMVIwEAgICAgIABAICA/oCAgAIAgID+gICAAQCAgICAgAMAgICAgICAgICAgIAAAAwAAAAAAoADgAADAAcACwAPABMAFwAbAB8AIwAnACsALwAAEzMVIyUzFSsBMxUrATMVIyUzFSMhMxUjJTMVIyEzFSMlMxUrATMVKwEzFSMlMxUjgICAAQCAgICAgICAgAEAgID+gICAAgCAgP6AgIABAICAgICAgICAAQCAgAOAgICAgICAgICAgICAgICAgIAAAAADAAAAAAKAA4AACwAXABsAABEzFTMRIxUzESMVIwEzESM1IxEzNSMRMwEzFSOAgICAgIACAICAgICAgP8AgIADgID/AID/AIADgPyAgAEAgAEA/wCAAAAADACAAAADAAOAAAMABwALAA8AEwAXABsAHwAjACcAKwAvAAABMxUrATMVIyUzFSMhMxUjJTMVIyEzFSMlMxUrATMVKwEzFSMlMxUjITMVIyUzFSMBgICAgICAAQCAgP6AgIACAICA/oCAgAEAgICAgICAgIABAICA/oCAgAIAgIADgICAgICAgICAgICAgICAgICAAAUAAAAAA4ADgAADAAsADwATABcAABEzFSMlIRUjESMRIyUzFSMhMxUjJTMVI4CAAQABgICAgAIAgID9gICAAgCAgAOAgICA/QADAICAgICAAAAAAAUAAAAAAoADgAATABcAGwAfACMAAAEzETMVIxUzFSMRIxEjNTM1IzUzJTMVIyUzFSMBMxUjJTMVIwEAgICAgICAgICAgP8AgIACAICA/gCAgAIAgIADgP8AgICA/wABAICAgICAgID+gICAgAAAAAAFAAAAAAOAA4AABwALAA8AEwAXAAABIRUjESE1MwEzFSsBMxUjATMVKwEzFSMBgAEAgP8AgAGAgICAgID+AICAgICAA4CA/QCAAwCAgP6AgIAAAAADAAAAAAKAA4AACwAPABMAAAEzETMRIxUjNSMRMwEzFSMlMxUjAQCAgICAgID/AICAAgCAgAOA/gD/AICAAQD/AICAgAAAAAAHAAAAAAKAA4AAAwAXABsAHwAjACcAKwAAETMVIyUzFTMRIxUzESMVIzUjETM1IxEzJTMVIwEzFSMlMxUjATMVIyUzFSOAgAEAgICAgICAgICAgAEAgID+AICAAgCAgP4AgIACAICAA4CAgID/AID/AICAAQCAAQCAgP8AgICA/wCAgIAAAAAABAAAAAACgAOAAA8AHwAjACcAABEzFTMVIxUzFSMVMxUjFSMBMxEjNSM1MzUjNTM1IzUzBTMVIxUzFSOAgICAgICAgAIAgICAgICAgID/AICAgIADgICAgICAgIADgPyAgICAgICAgICAgAAAAwAAAAACgAOAAAsADwATAAABMxEzFSMRIxEjNTMFMxEjATMRIwEAgICAgICA/wCAgAIAgIADgP4AgP8AAQCAgP8AAQD/AAAAAQAAAAAAgAGAAAMAABEzESOAgAGA/oAABQAAAAACgAOAABMAFwAbAB8AIwAAATMVMxUjETMVIxUjNSM1MxEjNTMFMxUjJTMVIwUzFSMlMxUjAQCAgICAgICAgICA/wCAgAIAgID+AICAAgCAgAOAgID+gICAgIABgICAgICAgICAgAAABAAAAAACAAOAAAkADQARABUAAAEhESMRIzUzESsBMxUrATMVIzsBFSMBAAEAgICAgICAgICAgICAgAOA/IABAIABgICAgAAAAwAAAAADgAOAAA0AGwAfAAATMxUzFSMRMxUhESM1MykBETMVIxEjNSM1MxErATMVI4CAgICA/wCAgAGAAQCAgICAgICAgIADgICA/wCAAQCA/wCA/wCAgAEAgAABAAABAAEAAgAAAwAAESERIQEA/wACAP8AAAAAAgAAAIAAgAKAAAMABwAAETMVIxEzFSOAgICAAoCA/wCAAAAAAQAAAIACgAMAAAsAAAEzESEVIREjESE1IQEAgAEA/wCA/wABAAMA/wCA/wABAIAAAwAAAAACgAOAAAkADQARAAABIRUjESMRIzUzATMVIwEzFSMBAAEAgICAgAEAgID+AICAA4CA/QABgIABAID/AIAAAAAFAAAAAAKAA4AAAwAXABsAHwAjAAARMxEjATMRMxUjFTMVIxEjESM1MzUjNTMBMxEjATMRIwEzESOAgAEAgICAgICAgICAgAEAgID+AICAAgCAgAOA/wABAP8AgICA/wABAICAgAEA/wD+gP8AAQD/AAAAAAMAAAAAAoADgAATABcAGwAAATMVMxUjETMVIxUjNSM1MxEjNTMFMxEjATMRIwEAgICAgICAgICAgP8AgIACAICAA4CAgP6AgICAgAGAgID+gAGA/oAAAAAEAAAAAAKAA4AABwALAA8AEwAAETMRMxUjESMBMxUjOwERIzsBESOAgICAAQCAgICAgICAgAOA/oCA/oACgID/AP8AAAMAAAAAAoADgAAFAAsADwAAATMRITUzASEVIxEjATMVIwIAgP8AgP4AAQCAgAEAgIADgP2AgAEAgP4AAgCAAAAHAAAAAAOAA4AADwATABcAGwAfACMAJwAAASEVIxEzFSMRIxEjNTMRKwEzFSMlMxUjITMVIyUzFSMhMxUjJTMVIwEAAYCAgICAgICAgICAAgCAgP2AgIADAICA/YCAgAIAgIADgID+gID/AAEAgAGAgICAgICAgICAAAAAAQAAAAACAAOAAAsAABEzESE1MxEjESEVI4ABAICA/wCAA4D+gID9gAGAgAAHAAAAAAEAA4AAAwAHAAsADwATABcAGwAAEzMVKwEzFSM7ARUrATMVIzsBFSsBMxUjOwEVI4CAgICAgICAgICAgICAgICAgICAgAOAgICAgICAgAAFAAAAAAKAA4AAAwAPABMAFwAbAAATMxEjOwEVMxUjFSM1IzUzJTMVIwUzFSMhMxEjgICAgICAgICAgAEAgID+AICAAYCAgAOA/wCAgICAgICAgID/AAAAAwAAAAACgAOAAAcACwAPAAARMxEhFSERIwEzESM7AREjgAEA/wCAAYCAgICAgAOA/wCA/gACAP8A/wAAAwAAAAACgAOAAAsADwATAAABMxEzESM1IxUjETMBMxUjJTMVIwEAgICAgICA/wCAgAIAgIADgP4A/wCAgAEA/wCAgIAAAAAAAgAAAAACgAKAAAMADwAAEyEVISMzFSE1MxEjESERI4ABgP6AgIABgICA/oCAAoCAgID+AAEA/wAAAAAABQAAAAACgAKAAAMABwALAA8AEwAAEyEVISMzESMBMxUjFTMVIykBFSGAAYD+gICAgAIAgICAgP6AAYD+gAKAgP6AAYCAgICAAAAAAAIAAAAAAoACgAAHAAsAABEhFSERIRUhATMRIwIA/oABgP4AAgCAgAKAgP6AgAIA/oAAAAABAAAAAAKAAoAACwAAESEVIRUhFSEVIRUhAoD+AAEA/wACAP2AAoCAgICAgAAAAAACAAD/gACAAwAAAwAHAAARMxEjFTMVI4CAgIADAP2AgIAAAAADAAAAAAKAAoAAAwAHAAsAAAEzESMlMxUjMyEVIQIAgID+AICAgAGA/oACgP4AgICAAAAABQAAAAACgAKAAAcACwAPABMAFwAAETMRIRUhESMBMxUrATMVIxUzFSM7ARUjgAEA/wCAAgCAgICAgICAgICAAoD/AID/AAKAgICAgIAAAAADAAAAAAKAAoAABwAPABMAABEzFTMVIxEjATMRIxEjNTMFMxUjgICAgAIAgICAgP8AgIACgICA/oACgP2AAYCAgIAAAAQAAAAAAoACgAADAAcACwAPAAATIRUhIzMRIwEzESMpARUhgAGA/oCAgIACAICA/oABgP6AAoCA/oABgP6AgAACAAAAAAKAAoAACQANAAARIRUhFSEVIREjATMVIwIA/oABgP6AgAIAgIACgICAgP8AAgCAAAAAAAMAAAAAAoADgAADAA0AEQAAETMRIwEzESE1ITUhNSEFMxUjgIACAID+AAGA/oABgP4AgIADgP4AAgD8gICAgICAAAAAAQAAAAACgAKAAAcAABEhFSERIxEhAoD/AID/AAKAgP4AAgAAAwAAAAACgAKAAAMABwALAAARMxEjATMRIykBFSGAgAIAgID+gAGA/oACgP4AAgD+AIAAAAUAAAAAAoACgAADAAcACwAPABMAABEzESMBMxEjITMVIyUzFSsBMxUjgIACAICA/oCAgAEAgICAgIACgP6AAYD+gICAgIAAAAMAAAAAAoACgAAHAA8AEwAAETMRMxUjFSMBMxEjNSM1MyUzFSOAgICAAgCAgICA/wCAgAKA/oCAgAKA/YCAgICAAAAAAwAAAAACgAKAAAcACwATAAARIRUjFSM1IQUzFSsBMxUhFSE1MwKAgID+gAEAgICAgAGA/YCAAoCAgICAgICAgAAAAAADAAAAAAKAAwAAAwANABEAABMhFSEjMxUhFSERIRUhATMRI4ACAP4AgIABgP6AAYD+AAIAgIADAICAgP8AgAGA/wAAAAUAAP+AAwADgAADAA0AEQAVABkAAAEzFSsBMxEhNSERIzUzJSEVISMzESMFMxUjAoCAgICA/gABgICA/oABAP8AgICAAoCAgAOAgP0AgAEAgICA/oCAgAADAAAAAAIAA4AAAwATABcAAAEhFSEjMxEzFSMRIzUjNTMRIzUzBTMVIwEAAQD/AICAgICAgICAgAEAgIADgID+gID/AICAAQCAgIAAAgAAAAACAAOAAAMAEwAAASEVISMzFSEVIREjESM1MzUjNTMBAAEA/wCAgAEA/wCAgICAgAOAgICA/gABAICAgAAAAAAFAAAAAAKAA4AABQAJAA0AEQAVAAATIREjNSEjMxEjASEVKQEzESMpARUhgAIAgP6AgICAAQABAP8AAQCAgP8AAQD/AAOA/wCA/QACgID+gIAAAAAIAAAAAAKAA4AAAwAHAAsADwATABcAGwAfAAABIRUhIzMVIzsBFSsBMxUjJTMVIyEzESMBMxEjKQEVIQEAAQD/AICAgICAgICAgAEAgID+gICAAgCAgP6AAYD+gAOAgICAgICA/wABAP8AgAAGAAAAAAKAA4AAAwAHAAsADwATABcAAAEzFSsBMxUrATMRIwEzFSM7AREjKQEVIQEAgICAgICAgIABgICAgICA/oABgP6AA4CAgP4AAgCA/oCAAAAFAAAAAAIAA4AAAwAHAAsADwATAAATMxUrATMRIwEzFSM7AREjKQEVIYCAgICAgAEAgICAgID/AAEA/wADgID9gAIAgP6AgAAHAAAAAAKAA4AAAwAHAAsADwAXABsAHwAAETMVIyUzFSMhMxUjJTMVKwEzESM1IzUzBTMVIzsBFSOAgAIAgID+gICAAQCAgICAgICA/wCAgICAgAOAgICAgICA/gCAgICAgAAABQAA/4ADAAKAAAMACwAPABMAGwAAEzMRIwEzESMRITUhBTMVKwEzFSMlMxUhFSE1M4CAgAIAgID+gAGA/gCAgICAgAEAgAEA/gCAAoD/AAEA/YABAICAgICAgICAAAAAAQAAAYABgAIAAAMAABEhFSEBgP6AAgCAAAAAAAEAAAGAAYACAAADAAARIRUhAYD+gAIAgAAAAAABAAABgAMAAgAAAwAAESEVIQMA/QACAIAAAAAAAQAAAYAEAAIAAAMAABEhFSEEAPwAAgCAAAAAAAIAAAIAAQADgAADAAcAABMzFSsBMxEjgICAgICAA4CA/wAAAAIAAAIAAQADgAADAAcAABMzESsBMxUjgICAgICAA4D/AIAAAAIAAP+AAQABAAADAAcAABMzESsBMxUjgICAgICAAQD/AIAAAAQAAAIAAgADgAADAAcACwAPAAATMxUjJTMVIyEzESMBMxEjgICAAQCAgP6AgIABAICAA4CAgID/AAEA/wAAAAAEAAACAAIAA4AAAwAHAAsADwAAEzMRIwEzESMhMxUjJTMVI4CAgAEAgID+gICAAQCAgAOA/wABAP8AgICAAAAABAAA/4ACAAEAAAMABwALAA8AABMzESMBMxEjITMVIyUzFSOAgIABAICA/oCAgAEAgIABAP8AAQD/AICAgAAAAAEAAAAAAoADgAALAAABMxEhFSERIxEhNSEBAIABAP8AgP8AAQADgP8AgP4AAgCAAAEAAAAAAoADgAATAAABMxEhFSEVIRUhESMRITUhNSE1IQEAgAEA/wABAP8AgP8AAQD/AAEAA4D/AICAgP8AAQCAgIAAAQAAAQABAAIAAAMAABEhESEBAP8AAgD/AAAAAAMAAAAAA4AAgAADAAcACwAANTMVIyUzFSMlMxUjgIABgICAAYCAgICAgICAgAAAAAgAAAAAA4ADgAADAAcACwAPABMAFwAbAB8AABEzESMBMxUrATMRKwEzFSsBMxEjJTMRIwEzESMlMxUjgIACAICAgICAgICAgICAAYCAgAEAgID9AICAA4D/AAEAgP8AgP8AgP8AAQD/AICAAAkAAAAABAADgAADAAcACwAPABMAFwAbAB8AIwAAETMRIwEzFSsBMxErATMVKwEzESMlMxEjATMRIwEzESMlMxUjgIACAICAgICAgICAgICAAQCAgAEAgIABAICA/ICAgAOA/wABAID/AID/AID/AAEA/wABAP8AgIAAAAACAAACgAEAA4AAAwAHAAATMxUrATMVI4CAgICAgAOAgIAAAAAEAAACgAIAA4AAAwAHAAsADwAAEzMVIyUzFSMhMxUjJTMVI4CAgAEAgID+gICAAQCAgAOAgICAgICAAAAGAAACgAMAA4AAAwAHAAsADwATABcAABMzFSMlMxUjJTMVIyEzFSMlMxUjJTMVI4CAgAEAgIABAICA/YCAgAEAgIABAICAA4CAgICAgICAgICAAAACAAACgAEAA4AAAwAHAAARMxUjOwEVI4CAgICAA4CAgAAAAAAEAAACgAIAA4AAAwAHAAsADwAAETMVIyUzFSsBMxUjJTMVI4CAAQCAgICAgAEAgIADgICAgICAgAAAAAAGAAACgAMAA4AAAwAHAAsADwATABcAABEzFSMlMxUjJTMVIyEzFSMlMxUjJTMVI4CAAQCAgAEAgID+gICAAQCAgAEAgIADgICAgICAgICAgIAAAAAFAAAAgAGAAwAAAwAHAAsADwATAAABMxUrATMVKwEzFSM7ARUjOwEVIwEAgICAgICAgICAgICAgIADAICAgICAAAAAAAUAAACAAYADAAADAAcACwAPABMAABEzFSM7ARUjOwEVKwEzFSsBMxUjgICAgICAgICAgICAgIADAICAgICAAAARAAAAAAOAA4AAAwAHAAsADwATABcAGwAfACMAJwArAC8AMwA3ADsAPwBDAAARMxUjJTMVIyUzFSMhMxUjJTMVIyEzFSMlMxUjITMVIyUzFSMlMxUjITMVIyUzFSMhMxUjJTMVIyEzFSMlMxUjJTMVI4CAAYCAgAGAgID9gICAAgCAgP6AgIABAICA/gCAgAGAgIABgICA/gCAgAEAgID+gICAAgCAgP2AgIABgICAAYCAgAOAgICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAAAQAAAAAAYADgAADAAcACwAPAAARMxEjATMRIwUzFSMlMxUjgIABAICA/wCAgAEAgIADgP2AAoD9gICAgIAAAAAEAAAAAAKAA4AACwAPABMAFwAAEyEVIxEzFSMVIxErATMVIyUzESMBMxUjgAGAgICAgICAgIACAICA/wCAgAOAgP8AgIACAICA/wD+gIAAAA8AAAAAA4ADgAADAAcACwAPABMAFwAbAB8AIwAnACsALwAzADcAOwAAATMVIyUzFSsBMxUrATMVIyUzFSMFMxUjJTMVIyUzFSMlMxUjITMVIyUzFSMhMxUjJTMVIyUzFSMlMxUjAQCAgAEAgICAgICAgIABAICA/gCAgAEAgIABAICAAQCAgP2AgIACAICA/YCAgAEAgIABAICAAQCAgAOAgICAgICAgICAgICAgICAgICAgICAgICAgAAACAAAAAADgAOAAAMABwALAA8AEwAXABsAHwAAEyEVISUzESMBMxUjJTMRKwEzFSsBMxUjFTMVIyUzFSOAAYD+gAKAgID9AICAAgCAgICAgICAgICAAgCAgAOAgID9gAIAgID/AICAgICAgAAACAAAAAADgAOAAAMABwALAA8AEwAXABsAHwAAETMRIwEhFSEjMxUjJTMRKwEzFSsBMxUjBTMVIyUzFSOAgAGAAYD+gICAgAIAgICAgICAgID+AICAAgCAgAOA/YACgICAgP8AgICAgICAAAAAAwAAAAACAAKAAAUACQANAAARIREjNSEFMxErATMVIwIAgP6AAQCAgICAgAKA/wCAgP8AgAAAAAABAAAAAAMAA4AADwAAESEVMxUjFSMRIxEjESMRIwKAgICAgICAgAOAgICA/gADAP0AAwAABQAAAQABgAKAAAMABwALAA8AEwAAETMVIyUzFSsBMxUrATMVIyUzFSOAgAEAgICAgICAgIABAICAAoCAgICAgICAAAACAAD/gACAAoAAAwAHAAARMxUjETMRI4CAgIACgID+gP8AAAAKAAAAAAGAA4AAAwAHAAsADwATABcAGwAfACMAJwAAETMVIyUzFSsBMxUrATMVIyUzFSMFMxUjJTMVKwEzFSsBMxUjJTMVI4CAAQCAgICAgICAgAEAgID/AICAAQCAgICAgICAgAEAgIADgICAgICAgICAgICAgICAgAAABQAAAAABgAOAAAMABwALAA8AEwAAETMVIyUzESsBMxErATMRIyUzFSOAgAEAgICAgICAgIABAICAA4CAgP8A/oD/AICAAAAACAAAAoAEAAOAAAMABwALAA8AEwAXABsAHwAAEzMVIyUzFSMlMxUjJTMVIyEzFSMlMxUjJTMVIyUzFSOAgIABAICAAQCAgAEAgID8gICAAQCAgAEAgIABAICAA4CAgICAgICAgICAgICAgAAABAAAAQACAAOAAAMABwALAA8AABMhFSEjMxEjATMRIykBFSGAAQD/AICAgAGAgID/AAEA/wADgID+gAGA/oCAAAIAAAEAAIADgAADAAcAABEzFSMVMxEjgICAgAOAgID+gAAAAAIAAAEAAgADgAALAA8AAAEhESM1IREzFSERKwEzFSMBAAEAgP6AgAEAgICAgAOA/YCAAQCAAQCAAAAAAAMAAAEAAgADgAAHAAsADwAAESEVIRUhFSkBMxUjKQEVIQIA/oABAP6AAYCAgP6AAYD+gAOAgICAgIAAAAQAAAEAAgADgAADAAsADwATAAATIRUhIzMVIRUhFSMlMxUjKQEVIYABAP8AgIABAP8AgAGAgID/AAEA/wADgICAgICAgIAAAAMAAAEAAgADgAAHAAsADwAAESERIzUhFSMhMxUrATMRIwIAgP8AgAEAgICAgIADgP8AgICA/wAABwAAAQACAAOAAAMABwALAA8AEwAXABsAABMhFSEjMxUjJTMVIykBFSEjMxUjJTMVIykBFSGAAQD/AICAgAGAgID/AAEA/wCAgIABgICA/wABAP8AA4CAgICAgICAgIAABAAAAQACAAOAAAMABwAPABMAABMhFSEjMxUjJTMRIzUhNSEBIRUhgAEA/wCAgIABgICA/wABAP8AAQD/AAOAgICA/oCAgP8AgAAAAAEAAAGAAYADAAALAAATMxUzFSMVIzUjNTOAgICAgICAAwCAgICAgAABAAACAAGAAoAAAwAAESEVIQGA/oACgIAAAAAAAgAAAYABgAMAAAMABwAAESEVIRUhFSEBgP6AAYD+gAMAgICAAAAAAAMAAAEAAQADgAADAAcACwAAEzMVKwEzESM7ARUjgICAgICAgICAA4CA/oCAAAAAAAMAAAEAAQADgAADAAcACwAAETMVIzsBESsBMxUjgICAgICAgIADgID+gIAAAgAAAQACAAMAAAUACQAAESEVIREjATMRIwGA/wCAAYCAgAMAgP6AAYD+gAAEAAD/gAIAAgAAAwAHAAsADwAAEyEVISMzESMBMxEjKQEVIYABAP8AgICAAYCAgP8AAQD/AAIAgP6AAYD+gIAAAQAA/4ABgAIAAAsAABMzETMVITUzESM1M4CAgP6AgICAAgD+AICAAQCAAAAFAAD/gAIAAgAAAwAHAAsADwAXAAATIRUhIzMVIyUzFSsBMxUrATMVIRUhNTOAAQD/AICAgAGAgICAgICAgAEA/gCAAgCAgICAgICAgAAAAAcAAP+AAgACAAADAAcACwAPABMAFwAbAAATIRUhIzMVIyUzFSsBMxUjITMVIyUzFSMpARUhgAEA/wCAgIABgICAgICA/wCAgAGAgID/AAEA/wACAICAgICAgICAgAAAAAIAAP+AAgACAAALAA8AAAEhESM1IREzFSERKwEzFSMBAAEAgP6AgAEAgICAgAIA/YCAAQCAAQCAAAAAAAMAAP+AAgACAAAHAAsADwAAESEVIRUhFSkBMxUjKQEVIQIA/oABAP6AAYCAgP6AAYD+gAIAgICAgIAAAAQAAP+AAgACAAADAAsADwATAAATIRUhIzMVIRUhFSMlMxUjKQEVIYABAP8AgIABAP8AgAGAgID/AAEA/wACAICAgICAgIAAAAMAAP+AAgACAAAHAAsADwAAESERIzUhFSMhMxUrATMRIwIAgP8AgAEAgICAgIACAP8AgICA/wAABwAA/4ACAAIAAAMABwALAA8AEwAXABsAABMhFSEjMxUjJTMVIykBFSEjMxUjJTMVIykBFSGAAQD/AICAgAGAgID/AAEA/wCAgIABgICA/wABAP8AAgCAgICAgICAgIAABAAA/4ACAAIAAAMABwAPABMAABMhFSEjMxUjJTMRIzUhNSEBIRUhgAEA/wCAgIABgICA/wABAP8AAQD/AAIAgICA/oCAgP8AgAAAAAEAAAAAAYABgAALAAATMxUzFSMVIzUjNTOAgICAgICAAYCAgICAgAABAAAAgAGAAQAAAwAAESEVIQGA/oABAIAAAAAAAgAAAAABgAGAAAMABwAAESEVIRUhFSEBgP6AAYD+gAGAgICAAAAAAAMAAP+AAQACAAADAAcACwAAEzMVKwEzESM7ARUjgICAgICAgICAAgCA/oCAAAAAAAMAAP+AAQACAAADAAcACwAAETMVIzsBESsBMxUjgICAgICAgIACAID+gIAAAwAAAAACgAOAAAMABwAXAAATIRUhIzMRIwEhFSEVMxUjFSEVIREjNTOAAYD+gICAgAEAAYD/AICAAQD+gICAA4CA/oABAICAgICAAQCAAAAFAAAAAAKAA4AABwALAA8AEwAbAAATMxUzNTMRISMzESMBMxUjFTMVIykBESM1IxUjgICAgP6AgICAAgCAgICA/oABgICAgAOAgID/AP6AAYCAgID/AICAAAAAAAYAAAAAAoADgAADAAcACwAPABcAGwAAEyEVISMzESMBMxUjByEVISMzETMVITUzJTMVI4ABgP6AgICAAgCAgIABAP8AgICA/oCAAQCAgAOAgP2AAoCAgID/AICAgIAAAAEAAAAAAwADgAARAAATIRUhFSEVIRUzFSMRIxEjNTOAAoD+AAEA/wCAgICAgAOAgICAgID/AAEAgAAAAAMAAAAAAoADgAADABsAHwAAASEVISMzFTMVIxUzFSMVIRUhNTM1IzUzNSM1MyUzFSMBAAEA/wCAgICAgIABgP2AgICAgIABgICAA4CAgICAgICAgICAgICAgAAAAgAA/4ACgAKAAA0AEQAAATMVMxUjESMRIxEjESEFMxEjAQCAgICAgIABAAEAgIACgICA/gACAP6AAgCA/oAAAAIAAAAAA4ADgAAdACEAABMzFTMVIREzETMVIxUzFSMRIxEhESMRIzUzNSM1MxcVITWAgIABAICAgICAgP6AgICAgICAAQADgICAAQD/AICAgP8AAQD/AAEAgICAgICAAAIAAAAAA4ADgAAnACsAABMzFSE1MxUzFSMVMxUjESM1IzUzNSMVIzUjFTMVIxUjESM1MzUjNTMXFSE1gIABgICAgICAgICAgICAgICAgICAgIABgAOAgICAgICA/oCAgICAgICAgAGAgICAgICAAAAEAAAAAAOAAoAABQALAA8AEwAAESEVIREjATMRITUhATMRIyUzESMCAP6AgAMAgP4AAYD/AICA/wCAgAKAgP4AAoD9gIABgP8AgP8AAAAAAAQAAP+AAwADgAARABUAGQAdAAABMxUzFSMRITUhNSM1MzUjNTMFIRUhIzMRIxEhFSECAICAgP4AAYCAgICA/oABAP8AgICAAoD9gAOAgID+AICAgICAgID/AP8AgAAAAAUAAAAAAwADgAADABcAGwAfACMAAAEhFSEjMxUhFSEVIRUhFSM1IzUzNSM1MyUzFSMRMxUjKQEVIQEAAYD+gICAAQD/AAEA/wCAgICAgAIAgICAgP6AAYD+gAOAgICAgICAgICAgICA/oCAgAAAAAADAAAAAAMAA4AAEwAXABsAABMzESE1MxUzFSMVIzUhESMRIzUzATMVIxEzESOAgAEAgICAgP8AgICAAgCAgICAA4D/AICAgICA/gACAIABAID+gP6AAAAAAQAAAAACgAOAABcAABEhFSEVMxUjFTMVIxEjNSM1MzUjNTMRIQKA/wCAgICAgICAgID/AAOAgICAgID/AICAgIABAAAJAAD/gAKAA4AAAwAHAAsADwATABcAGwAfACMAAAEzFSsBMxEjATMRKwEzESMlMxUrATMVIyUzFSMlMxEjKQEVIQGAgICAgIABAICAgICA/wCAgICAgAEAgIABAICA/wABAP8AA4CA/wABAP8A/wCAgICAgID/AIAAAAAAAgAAAAADgAOAABUAGQAAEyEVIRUjFTMVIRUhESMRIzUzNSM1MxcVITWAAgABAICA/wD+gICAgICAgAGAA4CAgICAgP8AAYCAgICAgIAAAAACAAAAAAKAA4AAGQAdAAABMxUhFSEVIREjNSMVMxUjFSM1IzUzESM1MwUzESMBAIABAP8AAQCAgICAgICAgID/AICAA4CAgID/AICAgICAgAGAgID+gAAAAwAAAAADgAOAAAMAHwAjAAABIRUhIzMVITUzFTMVIxUzFSMRIxEhESMRIzUzNSM1MxcVITUBAAGA/oCAgAGAgICAgICA/oCAgICAgIABgAOAgICAgICAgP8AAQD/AAEAgICAgICAAAADAAAAAAOAA4AAAwAXABsAABMhFSkBMxUzFSEVIRUhFSM1IzUhNSE1IQEhFSGAAgD+AAIAgID+gAGA/YCAgAGA/oACgP6AAgD+AAOAgICAgICAgICAgP4AgAAAAAQAAAAAAoADgAATABcAGwAfAAABMxUzFSMRMxUjFSM1IzUzESM1MwUzESMBMxUjFTMVIwEAgICAgICAgICAgP8AgIACAICAgIADgICA/oCAgICAAYCAgP6AAYCAgIAAAAIAAAAAAoADgAATABcAABMzETMRMxEzFSMRIxEjESMRIzUzATMVI4CAgICAgICAgICAAYCAgAOA/wABAP8AgP6AAYD+AAIAgP4AgAAIAAAAAAOAA4AAAwAHAAsADwAVABkAHQAjAAABIRUhIzMVIzMhFSkBMxEjJSEVIxEjATMVKwEzESMBIRUjFSMBgAIA/gCAgICAAYD+gAGAgID9AAEAgIABgICAgICAAQABAICAA4CAgID/AICA/wABgID/AAEAgIAAAAAAAgAAAAACgAOAAAMACwAAESEVIRUhFSERIxEhAoD9gAKA/wCA/wADgICAgP4AAgAABAAAAAACgAOAAA8AEwAXABsAABEhFSMVMxUhFSM1ITUhNSETMxUjOwEVIzsBFSMCgICA/wCA/wABgP6AgICAgICAgICAA4CAgICAgICA/oCAgIAAAwAAAAADAAOAABUAGQAdAAATMxUhFSEVIRUhESEVIREjNTM1IzUzATMVKwEzFSOAgAEA/wABAP8AAQD+gICAgIACAICAgICAA4CAgICA/wCAAQCAgID/AICAAAAJAAAAAAOAA4AAAwAHAAsAFwAbAB8AIwAnACsAABMzFSsBMxUjJSEVISMzFTMVIxEjNSM1MwEzESMlMxUrATMVIyUzFSMFIRUhgICAgICAAQACAP4AgICAgICAgAKAgID/AICAgICAAQCAgP6AAYD+gAOAgICAgICA/wCAgAEA/wCAgICAgICAAAAAAAMAAAAAAoACgAALAA8AEwAAATMVMxUjESMRIzUzBTMRIwEzESMBAICAgICAgP8AgIACAICAAoCAgP6AAYCAgP6AAYD+gAAAAAIAAAAAAwADgAARABUAABMhFSEVIRUhFSEVIREjESM1MwEzFSOAAgD+gAGA/oABAP8AgICAAgCAgAOAgICAgID/AAEAgAGAgAAAAAADAAAAAAMAA4AAEwAXAB8AAAEzFTM1MxUzFSMRIxEjESMRIzUzBTMRIzsBFSEVITUzAQCAgICAgICAgICA/wCAgICAAgD9AIADgICAgID/AAEA/wABAICA/oCAgIAAAAADAAAAAAKAA4AAFwAbAB8AABMzFTM1MxEhFSEVIRUhESM1IxUjNSMRMwUzFSMVMxUjgICAgP6AAYD+gAGAgICAgIABgICAgIADgICA/wCAgID/AICAgAKAgICAgAAAAAAJAAAAAAOAA4AABwALAA8AEwAdACEAJQApAC0AAAEhFSMVIzUrATMVIyUzFSMhMxEjATMVMzUzESEVIwEzESMhMxUjJTMVIykBFSEBAAGAgICAgICAAgCAgP2AgIABAICAgP8AgAIAgID9gICAAgCAgP6AAYD+gAOAgICAgICA/oABgICA/wCAAYD+gICAgIAAAAAAAwAAAYAEAAOAAA0AFQAZAAARIRUzFSMRIxEjESMRIyUzESMRIzUzBTMVIwIAgICAgICAA4CAgICA/wCAgAOAgID/AAGA/oABgID+AAEAgICAAAAAAQAAAAACgAOAAAkAAAEzESE1ITUhNSECAID9gAIA/wABAAOA/ICAgIAAAAAEAAAAAAKAA4AAAwAJAA0AEQAAEyEVISMzETMVIQEzESMpARUhgAGA/oCAgID/AAIAgID+AAIA/gADgID+gIACAP2AgAAAAAAFAAAAAAKAA4AAAwAHAAsADwATAAABMxErATMVIyUzFSMhMxUjJTMVIwEAgICAgIABAICA/oCAgAIAgIADgP2AgICAgICAAAAIAAAAAAKAA4AAAwAHABMAFwAbAB8AIwAnAAARMxUjJSEVISMzFTMVMxUjFSMRIwEzESMhMxUjFzMVIyUzFSsBMxUjgIABAAEA/wCAgICAgICAAYCAgP4AgICAgIABAICAgICAA4CAgICAgICAAQABAP8AgICAgICAAAAACAAAAAAEAAOAAAcACwAPABMAGQAdACEAJQAAEzMRIxEjNTMlMxUrATMRKwEzFSMlIREjNSkBMxEjJTMRIyUzFSOAgICAgAIAgICAgICAgIABAAGAgP8A/oCAgAIAgID9gICAA4D+AAEAgICA/wCAgP8AgP8AgP8AgIAAAAgAAAAABAADgAAHAAsADwATABkAHQAhACUAABMzESMRIzUzJTMVKwEzESsBMxUjJSERIzUhJTMRKwEzFSMlMxUjgICAgIACAICAgICAgICAAQABgID/AP6AgICAgIACgICAA4D+AAEAgICA/wCAgP6AgID/AICAgAAAAAAJAAAAAAQAA4AABwALAA8AEwAbAB8AIwAnACsAABMzESMRIzUzJTMVKwEzESsBMxUjJSEVIxUjNSMhMxEjJTMVIyEzFSMlIRUhgICAgIACAICAgICAgICAAQABgICAgP6AgIACgICA/QCAgAIAAQD/AAOA/gABAICAgP8AgICAgID/AICAgICAAAAAAAoAAAAABAADgAAFAAkADQATABcAHwAjACcAKwAvAAARIREjNSMlMxUrATMRIyUzFTMVISUzFSMlIRUjFSM1IyEzESMlMxUjITMVIyUhFSEBAICAAoCAgICAgP4AgID/AAGAgIABAAGAgICA/oCAgAKAgID9AICAAgABAP8AA4D/AICAgP8AgICAgICAgICA/wCAgICAgAAACQAAAAAEAAOAAAcACwAPABMAGQAdACEAJQApAAATMxEjESM1MyUzFSsBMxErATMVIyUhFSMVISUzESMlMxUjITMVIyUhFSGAgICAgAIAgICAgICAgIABAAGAgP8A/oCAgAKAgID9AICAAgABAP8AA4D+AAEAgICA/wCAgICAgP8AgICAgIAAAAoAAAAABAADgAAFAAkADQATABcAHQAhACUAKQAtAAARIREjNSMlMxUrATMRIyUzFTMVISUzFSMlIRUjFSElMxEjJTMVIyEzFSMlIRUhAQCAgAKAgICAgID+AICA/wABgICAAQABgID/AP6AgIACgICA/QCAgAIAAQD/AAOA/wCAgID/AICAgICAgICAgP8AgICAgIAAAAAACwAAAAAEAAOAAAcACwAPABMAFwAbACEAJQApAC0AMQAAESEVIxUjNSMlMxUrATMRIyUzFSMpARUhJTMVIyUhFSMVISUzESMlMxUjITMVIyUhFSEBgICAgAKAgICAgID/AICA/wABAP8AAYCAgAEAAYCA/wD+gICAAoCAgP0AgIACAAEA/wADgICAgICA/wCAgICAgICAgID/AICAgICAAAgAAAAAA4ADgAAHAAsADwATABcAGwAhACUAABMzESMRIzUzJTMVKwEzESsBMxUjJTMVIyEzESMBMxUhESElMxUjgICAgIACAICAgICAgICAAQCAgP6AgIABAIABAP6A/oCAgAOA/gABAICAgP8AgICA/wABAID/AICAAAAKAAAAAAOAA4AABQAJAA0AEQAVABkAHQAhACcAKwAAESEVIxUhATMVKwEzESMlMxUjKQEVISUzFSMlMxUjITMRIwEzFSERISUzFSMBgID/AAKAgICAgID/AICA/wABAP8AAYCAgAEAgID+gICAAQCAAQD+gP6AgIADgICAAQCA/wCAgICAgICA/wABAID/AICAAAAACAAAAAAEAAOAAAcACwAPABMAGQAdACcAKwAAEzMRIxEjNTMlMxUrATMRKwEzFSMlIREjNSMhMxEjASEVIxUzNTMRISUzFSOAgICAgAIAgICAgICAgIABgAEAgID+AICAAQABAICAgP6A/oCAgAOA/gABAICAgP8AgID/AID/AAEAgICA/wCAgAAAAAAKAAAAAAQAA4AABwALAA8AEwAXABsAIQAlAC8AMwAAESEVIxUjNSMlMxUrATMRIyUzFSMpARUhJTMVIyUhESM1IyEzESMBIRUjFTM1MxEhJTMVIwGAgICAAoCAgICAgP8AgID/AAEA/wABgICAAYABAICA/gCAgAEAAQCAgID+gP6AgIADgICAgICA/wCAgICAgID/AID/AAEAgICA/wCAgAAAAAoAAAAABAADgAAFAAkADQARABUAGQAfACMALQAxAAARIRUjFSEBMxUrATMRIyUzFSMpARUhJTMVIyUhESM1IyEzESMBIRUjFTM1MxEhJTMVIwGAgP8AAoCAgICAgP8AgID/AAEA/wABgICAAYABAICA/gCAgAEAAQCAgID+gP6AgIADgICAAQCA/wCAgICAgID/AID/AAEAgICA/wCAgAAJAAAAAAQAA4AABQAJAA0AEQAVABsAHwApAC0AABEhESM1ISUzFSsBMxEjJTMRIyUzFSMlIREjNSMhMxEjASEVIxUzNTMRISUzFSMBgID/AAKAgICAgID+gICAAQCAgAGAAQCAgP4AgIABAAEAgICA/oD+gICAA4D/AICAgP8AgP8AgICA/wCA/wABAICAgP8AgIAABgAAAAADAAOAAAcACwAPABMAFwAbAAATMxEjESM1MyUzFSsBMxErATMVKwEzESsBMxUjgICAgIACAICAgICAgICAgICAgICAA4D+AAEAgICA/wCA/wCAAAwAAAAABAADgAADAAcACwAPABMAFwAbACMAJwArAC8AMwAAEzMVIyUzFSMhMxEjATMRIwEzESMhMxUjJTMVIyUhFSMVIzUjITMRIyUzFSMhMxUjJSEVIYCAgAIAgID9gICAAQCAgAEAgID+gICAAQCAgAEAAYCAgID+gICAAoCAgP0AgIACAAEA/wADgICAgP8AAQD/AAEA/wCAgICAgICA/wCAgICAgAAAAAABAAAAgAOAAwAADwAAATMRIRUhESM1IzUjNTM1MwEAgAIA/gCAgICAgAMA/wCA/wCAgICAAAAAAAEAAAAAAoADgAAPAAABMxUzFTMVIREjESE1MzUzAQCAgID/AID/AICAA4CAgID+AAIAgIAAAAAAAQAAAIADgAMAAA8AAAEzFTMVMxUjFSMVIxEhNSECAICAgICAgP4AAgADAICAgICAAQCAAAEAAAAAAoADgAAPAAABMxEhFSMVIxUjNSM1IzUhAQCAAQCAgICAgAEAA4D+AICAgICAgAABAAAAgAQAAwAAGwAAATMRIREzFTMVMxUjFSMVIxEhESM1IzUjNTM1MwEAgAEAgICAgICA/wCAgICAgAMA/wABAICAgICAAQD/AICAgIAAAAIAAACAA4ADgAALABcAAAEzFTMVIxUjNSE1IQEzFSEVIRUjNSM1MwKAgICAgP2AAoD+AIACgP2AgICAA4CAgICAgP8AgICAgIAAAAACAAAAgAQAAwAAGwAfAAABMxUzNTMVMxUhFSEVIxUjNSEVIzUjNSE1ITUhBTMVIwGAgICAgP4AAgCAgP6AgIABAP8AAYACAICAAwCAgICAgICAgICAgICAgIAAAAMAAACABAADAAAHAAsAEwAAATMVMxUhNSEFMxUjKQEVIxUjNSECgICA/IACgAEAgID8gAOAgID9gAMAgICAgICAgIAABAAAAIAEAAMAAAsADwATAB8AAAEzFSE1MxUzFSE1MwUzFSMlMxUjKQEVIxUjNSEVIzUjAQCAAQCAgP0AgP8AgIADgICA/QADAICA/wCAgAMAgICAgICAgICAgICAgIAAAgAAAAADAAOAAAsAFwAAEzMRMxUjFSM1IzUzATMVMxUjESMRIzUzgICAgICAgAGAgICAgICAA4D9gICAgIACgICA/YACgIAABgAAAAADgAOAAAMABwAPABMAFwAbAAARMxEjATMRIykBESM1IRUjOwERIwEzESsBMxUjgIADAICA/YACgID+gICAgIABAICAgICAA4D/AAEA/wD/AICA/wABAP8AgAAABQAAAAACAAOAAAMABwALAA8AEwAAEyEVISMzESMBMxUjETMVIykBFSGAAQD/AICAgAGAgICAgP8AAQD/AAOAgP2AAoCA/oCAgAAAAAYAAAAAAoADgAADAAcADwATABcAGwAAASEVISMzFSMlMxEjNSE1IQUzESMlMxUjKQEVIQEAAQD/AICAgAGAgID+gAGA/gCAgAGAgID/AAEA/wADgICAgP4AgICA/wCAgIAAAAABAAAAAAKAA4AACwAAESERITUhESE1IREhAoD9gAIA/gACAP4AA4D8gIABAIABAAADAAD/gAKAA4AADQARABUAABEhESEVIxEzESM1IREpAREzEQERIRECgP4AgICAAQD/AAGAgP8AAQADgPyAgAEAAQCAAQD/AAEA/oD/AAEAAA0AAAAAA4ADgAADAAcACwAPABMAFwAbAB8AIwAnACsALwAzAAABIRUhJTMVIyEzFSMlMxUjITMRIwEzFSMlMxEjATMVKwEzFSsBMxUjJTMVIyEzFSMlIRUhAQABgP6AAgCAgP2AgIACAICA/YCAgAIAgIABAICA/oCAgICAgICAgAIAgID9gICAAQABgP6AA4CAgICAgID+gAGAgID+gAEAgICAgICAgIAAAAAFAAAAAAKAA4AAAwAHAA8AEwAXAAABIRUhIzMVKwEzFSEVIRUjOwEVIzMhFSEBAAGA/oCAgICAgAIA/gCAgICAgAGA/oADgICAgICAgIAAAAYAAAAAAoADgAAFAAkAGQAdACEAJQAAASERIzUhIzMVKwEzFSE1MxUzFSEVIzUjFSM7ARUrATMVIyUhFSEBAAGAgP8AgICAgIABAICA/wCAgICAgICAgIABAAGA/oADgP8AgICAgICAgICAgICAgAAFAAAAAAKAA4AAAwAHAA8AEwAXAAARIRUpATMVIzsBESM1ITUhAzMVIykBFSEBgP6AAYCAgICAgP4AAgCAgID+gAGA/oADgICA/oCAgP8AgIAAAAAGAAAAAAKAA4AAAwAHAAsAGwAhACUAABEhFSElMxUrATMVKwEzFTM1MxEjNSEVIzUjNSEBMxUhFSEBMxUjAYD+gAIAgICAgICAgICAgP8AgIABAP8AgAEA/oABgICAA4CAgICAgID+gICAgID/AICAAQCAAAUAAAAAAoADgAAFAAkADQARABcAABEhFSEVIzsBFSM7ARUrATMVKwEzFSEVIQKA/gCAgICAgICAgICAgIACAP2AA4CAgICAgICAAAABAAABgAKAAgAAAwAAESEVIQKA/YACAIAAAAAAAgAAAAACgAOAAAMADwAAESEVIQUzESEVIREjESE1IQKA/YABAIABAP8AgP8AAQADgICA/wCA/wABAIAAAQGAAQACgAIAAAMAAAEhESEBgAEA/wACAP8AAAMAAAAAAwADgAAHAAsADwAAASEVIREhNTMBMxUjOwEVIwGAAYD/AP8AgP6AgICAgIADgID9AIABAICAAAUAAAAAA4ADgAAHAA8AEwAXABsAABEhFSMVIzUjJSEVIREhNTMBMxUjKQEVIQUzFSMBgICAgAIAAYD/AP8AgP8AgID/AAEA/wABAICAA4CAgICAgP0AgAIAgICAgAAAAAMAAAAAA4ADgAALABMAFwAAEyERIzUhETMVMzUjJSEVIREhNTMlMxUjgAEAgP8AgICAAYABgP8A/wCA/wCAgAOA/gCAAQCAgICA/QCAgIAABgAAAIADAAKAAAMABwALAA8AEwAXAAATIRUhJSEVKQEzESMBMxEjKQEVISUhFSGAAQD/AAGAAQD/AP4AgIABgICA/wABAP8AAYABAP8AAoCAgID/AAEA/wCAgIAAAAAABwAAAIADgAKAAAMABwALAA8AEwAXABsAABMhFSElIRUpATMRIwEzESMBMxEjKQEVISUhFSGAAQD/AAGAAQD/AP4AgIABgICAAYCAgP2AAQD/AAGAAQD/AAKAgICA/wABAP8AAQD/AICAgAAAAgAAAAABgAOAAAMABwAAETMRIwEzESOAgAEAgIADgPyAA4D8gAAAAAUAAACAAoADAAADAAcACwAPABMAAAEzFSsBMxEjATMRIyEzESMBMxEjAQCAgICAgAEAgID+gICAAgCAgAMAgP8AAQD/AP8AAQD/AAAFAAAAgAKAAwAAAwAHAAsADwATAAARMxEjATMRIyEzESMBMxErATMVI4CAAgCAgP6AgIABAICAgICAAwD/AAEA/wD/AAEA/wCAAAAAAwAAAAACgAOAAAMABwALAAATIRUhIzMRIwEzESOAAYD+gICAgAIAgIADgID9AAMA/QAAAAMAAP+AAoADgAADAAcACwAAASEVISMzESMpARUhAYABAP8AgICA/wABAP8AA4CA/QCAAAAFAAD/gAKAA4AAAwAXABsAHwAjAAABIRUhIzMVMxUjFTMVIxEjESM1MzUjNTMFMxUjJTMVIwEhFSEBgAEA/wCAgICAgICAgICAgP8AgIACAICA/gABAP8AA4CAgICAgP8AAQCAgICAgICA/oCAAAAAAwAAAIACgAMAAAMABwALAAABMxUjATMVIyUzFSMBAICA/wCAgAIAgIADAID+gICAgAAAAAMAAACAAoADAAADAAcACwAAETMVIyUzFSMBMxUjgIACAICA/wCAgAMAgICA/oCAAAgAAACAAwADAAADAAcACwAPABMAFwAbAB8AABMhFSElMxUjITMVIyUhFSEFIRUhJTMVIyEzFSMlIRUhgAEA/wACAICA/YCAgAGAAQD/AP8AAQD/AAIAgID9gICAAYABAP8AAwCAgICAgICAgICAgICAAAAABAAAAQADgAKAAAMABwALAA8AABEzFSMlIRUhBTMVIyUhFSGAgAEAAoD9gP8AgIABAAKA/YACgICAgICAgIAAAAEAAAAAAoADAAATAAABMxUzFSERIRUhFSM1IzUhESE1IQGAgID/AAEA/oCAgAEA/wABgAMAgID/AICAgIABAIAAAAAAAwAAAIADAAMAAAMABwALAAARIRUhFSEVIRUhFSEDAP0AAwD9AAMA/QADAICAgICAAAAAAAEAAAAAAwADgAAbAAABMxUzFSEVIRUhFSEVIRUjNSM1ITUhNSE1ITUhAgCAgP8AAQD+gAGA/gCAgAEA/wABgP6AAgADgICAgICAgICAgICAgIAAAAYAAAAAAoADgAADAAcACwAPABMAFwAAATMVKwEzFSsBMxUjOwEVIzsBFSMFIRUhAYCAgICAgICAgICAgICAgP6AAoD9gAOAgICAgICAgAAABgAAAAACgAOAAAMABwALAA8AEwAXAAATMxUjOwEVIzsBFSsBMxUrATMVIwchFSGAgICAgICAgICAgICAgICAAoD9gAOAgICAgICAgAAAAAAFAAAAAAKAA4AAAwAHAAsADwATAAABIRUhIzMVKwEzESM7ARUjMyEVIQEAAYD+gICAgICAgICAgIABgP6AA4CAgP6AgIAAAAAFAAAAAAKAA4AAAwAHAAsADwATAAARIRUpATMVIzsBESsBMxUjKQEVIQGA/oABgICAgICAgICA/oABgP6AA4CAgP6AgIAAAAAHAAAAAAKAA4AABQAJABEAFQAZAB0AIQAAASERIzUhIzMVKwEzETMRIzUjATMVKwEzFSMBMxUjJSEVIQEAAYCA/wCAgICAgICAgAGAgICAgID/AICAAQABgP6AA4D/AICA/wD/AIABgICA/wCAgIAABwAAAAACgAOAAAMABwAPABMAFwAdACEAABEhFSElMxUrATMVMxEjESsBMxUrATMVKwEzFSEVIQEzFSMBgP6AAgCAgICAgICAgICAgICAgIABAP6AAYCAgAOAgICAgP6AAQCAgICAAQCAAAAABAAAAAACgAOAAAMABwALAA8AABMhFSEjMxEjMyEVIQchFSGAAgD+AICAgIACAP4AgAKA/YADgID+gICAgAAAAAQAAAAAAoADgAADAAcACwAPAAARIRUpATMRIykBFSEVIRUhAgD+AAIAgID+AAIA/gACgP2AA4CA/oCAgIAAAAABAAAAgAKAAwAABwAAETMRIRUhESOAAgD+AIADAP8AgP8AAAABAAAAgAKAAwAABwAAESEVIREjESECgP8AgP8AAwCA/gACAAABAAAAgAKAAwAABwAAATMRIRUhNSEBAIABAP2AAQADAP4AgIAAAAAAAQAAAIACgAMAAAsAABEzFSEVIRUhFSEVI4ACAP4AAgD+AIADAICAgICAAAAGAAAAgAKAAwAAAwAHAAsADwATABcAABEzFSMlMxUjITMVIyUzFSsBMxUjBSEVIYCAAgCAgP6AgIABAICAgICA/wACgP2AAwCAgICAgICAgIAAAAAGAAAAgAKAAwAAAwAHAAsADwATABcAABEhFSEFMxUrATMVIyUzFSMhMxUjJTMVIwKA/YABAICAgICAAQCAgP6AgIACAICAAwCAgICAgICAgIAAAAAGAAAAgAKAAwAAAwAHAAsADwATABcAABEhFSEVMxUjJTMVIyEzFSMlMxUrATMVIwKA/YCAgAIAgID+gICAAQCAgICAgAMAgICAgICAgICAAAMAAAAAAoADgAADAAcACwAAETMRIwEzESMpARUhgIACAICA/oABgP6AA4D9AAMA/QCAAAAFAAABAAGAAoAAAwAHAAsADwATAAARMxUjJTMVKwEzFSsBMxUjJTMVI4CAAQCAgICAgICAgAEAgIACgICAgICAgIAAAA0AAAAAA4ADgAADAAcACwAPABMAFwAbAB8AIwAnACsALwAzAAABIRUhJTMVIyEzFSMlMxUjITMRIwEzFSMlMxEjATMVKwEzFSsBMxUjJTMVIyEzFSMlIRUhAQABgP6AAgCAgP2AgIACAICA/YCAgAIAgIABAICA/oCAgICAgICAgAIAgID9gICAAQABgP6AA4CAgICAgID+gAGAgID+gAEAgICAgICAgIAAAAAGAAAAAAOAA4AAAwAHAAsADwATABsAAAEzFSsBMxUjJTMVIyEzFSMlMxUjITMRIREzESEBgICAgICAAQCAgP6AgIACAICA/YCAAoCA/IADgICAgICAgID+gAGA/gAAAAAKAAAAAAOAA4AAAwAHAAsAJwArAC8AMwA3ADsAPwAAEzMVIyUzFSMhMxUjJTMVMzUzFTMVIxUzFSMVIzUjFSM1IzUzNSM1MxcVMzUBMxUjATMVIyUzFSMhMxUjJTMVI4CAgAIAgID9gICAAQCAgICAgICAgICAgICAgICAAQCAgP0AgIADAICA/YCAgAIAgIADgICAgICAgICAgICAgICAgICAgICAgAEAgP6AgICAgICAAAAEAAAAAAOAA4AACQANABEAFQAAEyEVIREzFSERISMzESMBMxEjKQEVIYACgP8AgP8A/wCAgIADAICA/YACgP2AA4CA/wCAAYD9gAKA/YCAAAQAAAAAA4ADgAALAA8AEwAfAAARIRUjESMRIREjESMBMxUjJTMVIyEzESERMxEzFSE1MwOAgID+gICAAQCAgAEAgID+gIABgICA/ICAA4CA/wABAP8AAQD/AICAgP8AAQD/AICAAAAAAwGA/4ADgAOAAAMABwALAAABIRUhIzMRIwEzESMCAAEA/wCAgIABgICAA4CA/IADgP8AAAMAAP+AAgADgAADAAcACwAAATMRIwEzESMzIRUhAYCAgP6AgICAAQD/AAOA/IABAP8AgAACAAAAgAKAAwAACwAPAAABMxUzFTMVITUzNTMBIRUhAQCAgID9gICA/wACgP2AAwCAgICAgP6AgAAAAAABAAAAgAMAAwAAFwAAETMVMxUzETMVMxUzFSMVIxUjESMVIxUjgICAgICAgICAgICAAwCAgAEAgICAgIABAICAAAAAAAEAAACAAwADAAAXAAABMxEzNTM1MxEjNSM1IxEjNSM1IzUzNTMBAICAgICAgICAgICAgAMA/wCAgP2AgID/AICAgIAAAQAAAIADgAMAABsAABEzFTMVMxEzFTMVMxEzESMRIxUjFSMRIxUjFSOAgICAgICAgICAgICAgAMAgIABAICAAQD9gAEAgIABAICAAAEAAACAA4ADAAAbAAARMxEzNTM1MxEzNTM1MxEjNSM1IxEjNSM1IxEjgICAgICAgICAgICAgIADAP8AgID/AICA/YCAgP8AgID/AAACAAAAgAMAAwAADwATAAARMxUzFTMRMxEjESMVIxUjATMRI4CAgICAgICAAoCAgAMAgIABAP2AAQCAgAKA/YAAAQAAAIABgAMAAAsAAAEzESM1IzUjNTM1MwEAgICAgICAAwD9gICAgIAAAAABAAAAgAGAAwAACwAAETMVMxUzFSMVIxUjgICAgICAAwCAgICAgAAAAQAAAQACgAKAAAsAAAEzFTMVMxUhNTM1MwEAgICA/YCAgAKAgICAgIAAAAABAAABAAKAAoAACwAAESEVIxUjFSM1IzUjAoCAgICAgAKAgICAgIAAAgAAAIABgAMAAAMABwAAETMRIwEzESOAgAEAgIADAP2AAoD9gAAAAAEAAACAAoADAAADAAARIREhAoD9gAMA/YAAAAABAAAAgAKAAwAACwAAEyEVMxEjFSE1IxEzgAGAgID+gICAAwCA/oCAgAGAAAgAAAAAA4ADgAADAAcACwAPABMAFwAbAB8AAAEzESMBMxUjJTMVIyEzESMBMxEjITMVIyUzFSMpARUhAYCAgP8AgIACAICA/YCAgAMAgID9gICAAgCAgP6AAYD+gAOA/oABAICAgP6AAYD+gICAgIAAAAAACQAAAAADgAOAAAMABwALAA8AEwAXABsAHwAjAAABIRUhIzMVIyUzFSMhMxEjATMRIwEzESMhMxUjJTMVIykBFSEBAAGA/oCAgIACAICA/YCAgAGAgIABgICA/YCAgAIAgID+gAGA/oADgICAgID+gAGA/oABgP6AgICAgAAAAAABAAAAAACAA4AAAwAAETMRI4CAA4D8gAABAAABAAQAAYAAAwAAESEVIQQA/AABgIAAAAAAAQGA/4ACgAOAAAMAAAEhESEBgAEA/wADgPwAAAEBgP+ABAABgAAFAAABIRUhESEBgAKA/oD/AAGAgP6AAAAAAAEAAP+AAoABgAAFAAARIREhESECgP8A/oABgP4AAYAAAQGAAQAEAAOAAAUAAAEhESEVIQGAAQABgP2AA4D+AIAAAAAAAQAAAQACgAOAAAUAAAEhESE1IQGAAQD9gAGAA4D9gIAAAAAAAQGA/4AEAAOAAAcAAAEhESEVIREhAYABAAGA/oD/AAOA/gCA/oAAAAEAAP+AAoADgAAHAAABIREhESE1IQGAAQD/AP6AAYADgPwAAYCAAAABAAD/gAQAAYAABwAAESEVIREhESEEAP6A/wD+gAGAgP6AAYAAAAAAAQAAAQAEAAOAAAcAAAEhESEVITUhAYABAAGA/AABgAOA/gCAgAAAAAEAAP+ABAADgAALAAABIREhFSERIREhNSEBgAEAAYD+gP8A/oABgAOA/gCA/oABgIAAAAACAAABAAQAAoAAAwAHAAARIRUhFSEVIQQA/AAEAPwAAoCAgIAAAAAAAgEA/4ADgAOAAAMABwAAASERIQEhESEBAAEA/wABgAEA/wADgPwABAD8AAABAYD/gAQAAoAACQAAASEVIRUhFSERIQGAAoD+gAGA/oD/AAKAgICA/oAAAAEBAP+ABAABgAAJAAABIRUjESERIxEhAQADAID/AID/AAGAgP6AAYD+gAAAAgEA/4AEAAKAAAUACwAAASEVIREhASEVIxEhAQADAP4A/wABgAGAgP8AAoCA/YACAID+gAAAAAABAAD/gAKAAoAACQAAESERIREhNSE1IQKA/wD+gAGA/oACgP0AAYCAgAAAAAEAAP+AA4ABgAAJAAARIREhESMRIREhA4D/AID/AP8AAYD+AAGA/oABgAAAAgAA/4ADgAKAAAUACwAAESERIREhFSERIREhA4D/AP2AAgD/AP8AAoD9AAKAgP4AAYAAAAEBgAEABAADgAAJAAABIREhFSEVIRUhAYABAAGA/oABgP2AA4D/AICAgAAAAQEAAQAEAAOAAAkAAAEhETMRIREzFSEBAAEAgAEAgP0AA4D+AAIA/gCAAAACAQABAAQAA4AABQALAAABIREhFSEBIREzFSEBAAEAAgD9AAGAAQCA/oADgP4AgAKA/wCAAAAAAAEAAAEAAoADgAAJAAABIREhNSE1ITUhAYABAP2AAYD+gAGAA4D9gICAgAAAAQAAAQADgAOAAAkAAAEhETMRIREhNSEBAAEAgAEA/IABAAOA/gACAP2AgAACAAABAAOAA4AABQALAAABIREhNSEBIREhNSEBAAEA/gABAAGAAQD8gAKAA4D+gIABAP2AgAAAAAEBgP+ABAADgAALAAABIREhFSEVIRUhESEBgAEAAYD+gAGA/oD/AAOA/wCAgID+gAAAAAACAQD/gAQAA4AAAwALAAABIREhASERMxUjESEBAAEA/wABgAEAgID/AAOA/AAEAP4AgP6AAAAAAAMBAP+ABAADgAADAAkADwAAASERIQEhETMVIRUhFSMRIQEAAQD/AAGAAQCA/oABgID/AAOA/AAEAP8AgICA/oAAAAAAAQAA/4ACgAOAAAsAAAEhESERITUhNSE1IQGAAQD/AP6AAYD+gAGAA4D8AAGAgICAAAAAAAIAAP+AA4ADgAAHAAsAAAEhESERITUhASERIQEAAQD/AP8AAQABgAEA/wADgPwAAYCAAgD8AAAAAwAA/4ADgAOAAAUACQAPAAABIREhNSEBIREhASERIREhAQABAP4AAQABgAEA/wD9gAIA/wD/AAOA/oCAAQD8AAIA/gABgAAAAgAA/4AEAAKAAAMACwAAESEVIRUhFSERIREhBAD8AAQA/oD/AP6AAoCAgID+gAGAAAAAAAEAAP+ABAABgAALAAARIRUjESERIxEhESEEAID/AID/AP8AAYCA/oABgP6AAYAAAAMAAP+ABAACgAADAAkADwAAESEVIRUhESERISUhFSMRIQQA/AACAP8A/wACgAGAgP8AAoCAgP4AAYCAgP6AAAACAAABAAQAA4AABwALAAABIREhFSE1IQEhFSEBgAEAAYD8AAGA/oAEAPwAA4D/AICA/wCAAAAAAAEAAAEABAADgAALAAABIREzESERMxUhNSEBAAEAgAEAgPwAAQADgP4AAgD+AICAAAMAAAEABAADgAAFAAsADwAAASERITUhASERMxUhBSEVIQEAAQD+AAEAAYABAID+gP2ABAD8AAOA/oCAAQD/AICAgAAAAQAA/4AEAAOAABMAAAEhESEVIRUhFSERIREhNSE1ITUhAYABAAGA/oABgP6A/wD+gAGA/oABgAOA/wCAgID+gAGAgICAAAAAAQAA/4AEAAOAABMAAAEhETMRIREzFSMRIREjESERITUhAQABAIABAICA/wCA/wD/AAEAA4D+AAIA/gCA/oABgP6AAYCAAAAABAAA/4AEAAOAAAUACwARABcAAAEhESE1IQEhETMVIQUhESERISUhFSMRIQEAAQD+AAEAAYABAID+gP2AAgD/AP8AAoABgID/AAOA/oCAAQD/AICA/gABgICA/oAAAAAAAQAAAYAEAAOAAAMAABEhESEEAPwAA4D+AAAAAAEAAP+ABAABgAADAAARIREhBAD8AAGA/gAAAAABAAD/gAQAA4AAAwAAESERIQQA/AADgPwAAAAAAQAA/4ACAAOAAAMAABEhESECAP4AA4D8AAAAAAECAP+ABAADgAADAAABIREhAgACAP4AA4D8AAAQAAD/gAOAA4AAAwAHAAsADwATABcAGwAfACMAJwArAC8AMwA3ADsAPwAAATMVIyUzFSMhMxUjJTMVIyEzFSMlMxUjITMVIyUzFSMhMxUjJTMVIyEzFSMlMxUjITMVIyUzFSMhMxUjJTMVIwEAgIACAICA/QCAgAIAgID/AICAAgCAgP0AgIACAICA/wCAgAIAgID9AICAAgCAgP8AgIACAICA/QCAgAIAgIADgICAgICAgICAgICAgICAgICAgICAgICAgAAAACAAAP+ABAADgAADAAcACwAPABMAFwAbAB8AIwAnACsALwAzADcAOwA/AEMARwBLAE8AUwBXAFsAXwBjAGcAawBvAHMAdwB7AH8AABMzFSMlMxUjJTMVIyUzFSMhMxUjJTMVIyUzFSMlMxUjITMVIyUzFSMlMxUjJTMVIyEzFSMlMxUjJTMVIyUzFSMhMxUjJTMVIyUzFSMlMxUjITMVIyUzFSMlMxUjJTMVIyEzFSMlMxUjJTMVIyUzFSMhMxUjJTMVIyUzFSMlMxUjgICAAQCAgAEAgIABAICA/ICAgAEAgIABAICAAQCAgP2AgIABAICAAQCAgAEAgID8gICAAQCAgAEAgIABAICA/YCAgAEAgIABAICAAQCAgPyAgIABAICAAQCAgAEAgID9gICAAQCAgAEAgIABAICA/ICAgAEAgIABAICAAQCAgAOAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAAAABwAA/4AEAAOAACkALQAxADUAOQA9AEEAABEhFTM1IRUjFTMVMzUjNTM1IREjFTMRIxUhNSM1IxUzFSERMzUjETM1IwUVMzUdATM1BRUzNSEVMzUFFTM1HQEzNQEAgAEAgICAgIABAICAgP6AgICA/oCAgICAAQCAgP8AgAEAgP8AgIADgICAgICAgICA/oCA/oCAgICAgAEAgAGAgICAgICAgICAgICAgICAgICAAAABAAAAgAKAAwAAAwAAESERIQKA/YADAP2AAAAAAgAAAIACgAMAAAMABwAAESERIRMRIRECgP2AgAGAAwD9gAIA/oABgAAAAAABAAAAgAKAA4AACwAAATMRMxEzESERMxEzAQCAgID9gICAA4D/AP8A/wABAAEAAAAEAAAAgAKAA4AAAwAHAAsAEwAAATMRKwEzESMBMxEjITMVITUzESEBAICAgICAAQCAgP6AgAGAgP2AA4D/AP8AAQD/AICA/wAAAAAAAQAAAIADAAMAAAsAABEhFSEVIRUhFSEVIQEAAQABAP8A/wD/AAMAgICAgIAAAAAABAAAAIADAAMAAAcACwAPABMAABEhFSMRMxUhASEVKQIVKQIVIQEAgID/AAEAAQD/AAEAAQD/AP8AAQD/AAMAgP6AgAIAgICAAAAAAAEAAACAAoADgAALAAARIREjESMRIxEjESMCgICAgICAA4D/AP8A/wABAAEAAAAAAAQAAACAAoADgAAHAAsADwATAAARIREjNSEVIzsBESMBMxErATMRIwKAgP6AgICAgAEAgICAgIADgP8AgID/AAEA/wD/AAAAAAEAAACAAwADAAALAAABIREhNSE1ITUhNSECAAEA/wD/AP8AAQABAAMA/YCAgICAAAQAAACAAwADAAAHAAsADwATAAABIREhNTMRIykBFSkCFSkCFSECAAEA/wCAgP8AAQD/AP8AAQD/AAEAAQD/AAMA/YCAAYCAgIAAAAABAAAAgAKAAwAAEwAAATMVMxUzFSMVIxUjNSM1IzUzNTMBAICAgICAgICAgIADAICAgICAgICAgAAAAAAIAAAAgAKAAwAAAwAHAAsADwATABcAGwAfAAABMxUrATMVIyUzFSMhMxUjJTMVIyEzFSMlMxUrATMVIwEAgICAgIABAICA/oCAgAIAgID+gICAAQCAgICAgAMAgICAgICAgICAgIAAAAQAAACAAoADAAADAAcACwAPAAATIRUhIzMRIwEzESMpARUhgAGA/oCAgIACAICA/oABgP6AAwCA/oABgP6AgAAKAAAAAAOAA4AAAwAHAAsADwATABcAGwAfACMAJwAAASEVISMzFSMlMxUjITMRIwEhESETFTM1JTMRIyEzFSMlMxUjKQEVIQEAAYD+gICAgAIAgID9gICAAQABgP6AgIABAICA/YCAgAIAgID+gAGA/oADgICAgID+gAGA/oABAICAgP6AgICAgAAAAAEAAACAAgACgAALAAATIRUzESMVITUjETOAAQCAgP8AgIACgID/AICAAQAAAgAAAQABgAKAAAMABwAAESERIRMVMzUBgP6AgIACgP6AAQCAgAAAAAQAAAEAAYACgAADAAcACwAPAAATMxUrATMVIyUzFSsBMxUjgICAgICAAQCAgICAgAKAgICAgIAADQAA/4AEAAOAAAMABwALAA8AEwAfACMAJwArAC8AMwA3ADsAABEzFSMlMxUjJTMVIyEzFSMlMxUjKQEVMxEjFSE1IxEzITMVIyEzFSMXMxUjJTMVIyEzFSMlMxUjJTMVI4CAAYCAgAIAgID9AICAAoCAgP6AAQCAgP8AgIACAICA/ICAgICAgAKAgID9AICAAgCAgAGAgIADgICAgICAgICAgP8AgIABAICAgICAgICAgICAAAAAAAcAAACABAADgAADAAcACwAPABMAFwAbAAABIRUhIzMVIyUzESMlIRUhIzMRIwEzESMpARUhAgABAP8AgICAAYCAgP2AAQD/AICAgAOAgID9AAMA/QADgICAgP8AgID/AAEA/wCAAAAABgAA/4ADgAOAAAMABwALABcAGwAfAAABIRUhIzMVIyUzFSMhMxUhNTMRIREjESETMxUjOwEVIwEAAYD+gICAgAIAgID9gIACgID+gID+gICAgICAgAOAgICAgICA/wD+gAGA/wCAgAAIAAD/gAOAA4AAAwAHAAsAGwAfACMAJwArAAATMxUjJSEVISUzFSMhMxEhETMVMxUjFSERIxEjJTMVIzsBESMBMxEjKQEVIYCAgAEAAQD/AAGAgID+AIABAICAgP8AgID/AICAgICAAoCAgP4AAgD+AAOAgICAgID/AAEAgICA/wABAICA/oABgP6AgAAAAAALAAAAAAOAA4AAAwAHAAsADwATABcAGwAfACMAJwArAAABMxUjJTMVIyEzFSMlMxUrATMVIykBFSElMxUjITMRIwEzESMBMxUjBSEVIQGAgIABgICA/gCAgAGAgICAgID+gAEA/wACgICA/QCAgAGAgIABAICA/gABAP8AA4CAgICAgICAgICA/wABAP8AAQCAgIAAAQAAAAADgAOAABMAAAEzFTMVIREjESE1IxUhESMRITUzAYCAgAEAgP8AgP8AgAEAgAOAgID/AP6AgIABgAEAgAAAAAAIAAAAAAOAA4AAAwAHAAsAEQAXAB0AIwAnAAABMxUrATMVIyUzFSMpARUjFSMBIREjNSMFMxEzFSEBMxEhNTMlMxUjAYCAgICAgAEAgID+AAEAgIACgAEAgID+AICA/wACAID/AID/AICAA4CAgICAgIABAP8AgID/AIABgP6AgICAAAAFAAAAAAOAA4AACQANABEAFQAdAAARIRUjFSM1IREjATMVKwEzFSM7ARUjJTMRITUzNTMDgICA/gCAAgCAgICAgICAgAEAgP6AgIADgICAgP0AAoCAgICA/oCAgAAAAAAJAAD/gAOAA4AABQAJAA0AEQAVABkAJQApAC0AAAEzFSEVIQEzFSMhMxUjJTMVIyEzFSMlMxUjITMVITUzESERIxEhFzMVIzsBFSMBAIABAP6AAYCAgP2AgIADAICA/YCAgAIAgID9gIACgID+gID+gICAgICAgAOAgIABAICAgICAgICAgP8A/wABAICAgAACAAAAAAOAA4AAGwAfAAATIRUzESMRIzUjESERIREjESERIREjFSMRIxEzATMVI4ACgICAgIABAP8AgP8AAQCAgICAAQCAgAOAgP4A/wCAAQABAP8AAQD/AP8AgAEAAgD9gIAAAwAAAIACgAMAAAMABwALAAARIRUhFSEVIRUhFSECgP2AAoD9gAKA/YADAICAgICAAAAAAAQAAACAAoADAAADAAcACwAPAAARIRUhJSEVIQUhFSEVIRUhAQD/AAGAAQD/AP6AAoD9gAKA/YADAICAgICAgIAAAAAABAAAAIACgAMAAAMABwALAA8AABEhFSEVIRUhJSEVIQUhFSECgP2AAQD/AAGAAQD/AP6AAoD9gAMAgICAgICAgAAAAAAFAAAAgAKAAwAAAwAHAAsADwATAAARIRUhJSEVIQUhFSElIRUhBSEVIQEA/wABgAEA/wD+gAEA/wABgAEA/wD+gAKA/YADAICAgICAgICAgAAAAAAEAAAAgAKAAwAAAwAHAAsADwAAESEVIRUhFSEVIRUhJSEVIQKA/YACgP2AAQD/AAGAAQD/AAMAgICAgICAgAAABQAAAIACgAMAAAMABwALAA8AEwAAESEVISUhFSEFIRUhFSEVISUhFSEBAP8AAYABAP8A/oACgP2AAQD/AAGAAQD/AAMAgICAgICAgICAAAAFAAAAgAKAAwAAAwAHAAsADwATAAARIRUhFSEVISUhFSEFIRUhJSEVIQKA/YABAP8AAYABAP8A/oABAP8AAYABAP8AAwCAgICAgICAgIAAAAYAAACAAoADAAADAAcACwAPABMAFwAAESEVISUhFSEFIRUhJSEVIQUhFSElIRUhAQD/AAGAAQD/AP6AAQD/AAGAAQD/AP6AAQD/AAGAAQD/AAMAgICAgICAgICAgIAAAAUAAACAAoADAAADAAcACwAPABMAABMzESMBMxEjBSEVISMzFSMlMxUjgICAAQCAgP8AAYD+gICAgAIAgIADAP8AAQD/AICAgICAAAAFAAAAgAKAAwAAAwAHAAsADwATAAATMxEjATMRIwUzFSMlMxUjKQEVIYCAgAEAgID+gICAAgCAgP6AAYD+gAMA/wABAP8AgICAgIAABgAAAAADgAOAAAsADwATABcAGwAfAAATIRUzESMVITUjETsBETMRMxEzEQEVMzUhFTM1BRUhNYACgICA/YCAgICAgID+AIABgID+AAGAA4CA/YCAgAKA/wABAP8AAQD+gICAgICAgIAAAAAAAQAA/4AEAAOAABsAAAEhFTMVMxEjFSMVITUjNSMRMxUzFSE1MxEjNSMCAAEAgICAgP4AgICAgAGAgICAA4CAgP4AgICAgAEAgICAAYCAAAACAAAAAAGAAwAADwATAAARIREjFTMVIxUjNSM1MzUjExUzNQGAgICAgICAgICAAwD+gICAgICAgAEAgIAAAAAAAwAAAIACgAMAAAcACwAPAAABIREjNSM1IwUhESETFTM1AQABgICAgP8AAYD+gICAAwD+gICAgP6AAQCAgAAAAAEAAAAAAoADAAATAAABMxUzFTMRIRUzFSE1MzUhETM1MwEAgICA/wCA/oCA/wCAgAMAgID/AICAgIABAIAAAAAIAAAAAAKAAwAAAwAHAAsADwATABcAGwAfAAATMxUjJTMVIyEzESMBMxUjJTMRIyEzFSMlMxUrATMVI4CAgAEAgID+gICAAQCAgAEAgID+gICAAQCAgICAgAMAgICA/oABgICA/oCAgICAAAAIAAAAAAKAAwAAAwAHAAsADwATABcAGwAfAAABMxUrATMVIyUzFSMhMxEjATMRIyEzFSMlMxUrATMVIwEAgICAgIABAICA/oCAgAIAgID+gICAAQCAgICAgAMAgICAgP8AAQD/AICAgIAAAAABAAAAAAKAAwAADwAAEyERMxEhFTMVITUzNSERM4ABgID/AID+gID/AIADAP8A/wCAgICAAQAAAAYAAAAAAoADAAADAAcACwARABcAHwAAATMVKwEzFSMlMxUjITMVMxUhATMRITUzBTMVMxUhNTMBAICAgICAAQCAgP6AgID/AAIAgP8AgP8AgID+gIADAICAgICAgAEA/wCAgICAgAAAAQAAAAACgAMAABMAABMzFTM1MxUzESMVIxUjNSM1IxEzgICAgICAgICAgIADAICAgP6AgICAgAGAAAAAAQAAAAACgAMAABMAAAEzFTMVMxEjFSMVIzUjNSMRMzUzAQCAgICAgICAgICAAwCAgP8AgICAgAEAgAAABAAAAAACgAMAAAcADQATABsAABMhESM1IxUrATMVMxUhATMRITUzBTMVMxUhNTOAAYCAgICAgID/AAIAgP8AgP8AgID+gIADAP8AgICAgAEA/wCAgICAgAAAAAABAAAAAAGAA4AABQAAATMRIREhAQCA/oABAAOA/IABAAAAAAABAAAAAAKAA4AACwAAASEVMxEjNSMRIREhAQABAICAgP6AAQADgID/AID9gAEAAAACAAAAAAOAA4AABwAPAAABIREhESERKQIVIxEhESECAAGA/oABAP8A/wABAID+gAEAA4D9AAEAAYCA/YABAAAAAgAAAAADgAOAAAsADwAAASERIREhESERIREhExUhNQEAAoD+gAEA/oD+gAEAgAGAA4D8gAEAAQD+AAEAAgCAgAAAAAABAAAAAAGAA4AACwAAETMRIREjESMRMxUhgAEAgICA/wADgP6A/oABAP8AgAAAAAACAAAAAAGAA4AACwAPAAARMxEzNTMRIxEjFSMTFTM1gICAgICAgIADgP8AgP0AAQCAAYCAgAAAAAIAAAAAAoADgAAbAB8AAAEzFTMVIxUzFSMRIzUjESM1IzUzNSM1MxEzFTMHFTM1AYCAgICAgICAgICAgICAgICAA4CAgICA/wCA/wCAgICAAQCAgICAAAACAAAAAAOAA4AAAwAHAAARIREhARUzNQOA/IABgIADgPyAAgCAgAAAAwAAAAADgAOAAAMABwALAAARIREhExUzNQEVMzUDgPyAgIABgIADgPyAAwCAgP4AgIAAAAQAAAAAA4ADgAADAAcACwAPAAARIREhExUzNRMVMzUTFTM1A4D8gICAgICAgAOA/IADAICA/wCAgP8AgIAAAAAFAAAAAAOAA4AAAwAHAAsADwATAAARIREhExUzNSEVMzUBFTM1IRUzNQOA/ICAgAGAgP2AgAGAgAOA/IADAICAgID+AICAgIAAAAAABgAAAAADgAOAAAMABwALAA8AEwAXAAARIREhExUzNSEVMzUBFTM1ARUzNSEVMzUDgPyAgIABgID+gID+gIABgIADgPyAAwCAgICA/wCAgP8AgICAgAAAAAcAAAAAA4ADgAADAAcACwAPABMAFwAbAAARIREhExUzNSEVMzUBFTM1IRUzNQEVMzUhFTM1A4D8gICAAYCA/YCAAYCA/YCAAYCAA4D8gAMAgICAgP8AgICAgP8AgICAgAAAAAAEAAD/gAOAA4AACQARABUAGQAAESEVIREhFSERIwEhESE1MxEjKQEVIREhFSEBgP8AAQD/AIACgAEA/wCAgP8AAQD/AAEA/wADgID+gID+gAQA/YCAAYCA/oCAAAEAAP+AA4ADgAANAAARIRUhNSERIRUhNSERIwGAAQABAP8A/wD/AIADgICA/YCAgP6AAAAIAAD/gAOAA4AAAwAHAAsAGwAfACMAJwArAAABMxUrATMVIyUzFSsBMxUzFSMRMxUhNTMRIzUzBTMRIwEzESMhMxUjJTMVIwGAgICAgIABAICAgICAgID+gICAgP6AgIADAICA/YCAgAIAgIADgICAgICAgP6AgIABgICA/wABAP8AgICAAAAAEQAAAAADgAOAAAMABwALAA8AEwAXABsAHwAjACcAKwAvADMANwA7AD8AQwAAETMVIyUzFSMhMxUjJTMVIyEzFSMlMxUrATMVIyEzFSMlMxUjJTMVIyUzFSMhMxUjJTMVIyEzFSMlMxUjJTMVIyUzFSOAgAMAgID9gICAAgCAgP6AgIABAICAgICA/oCAgAEAgIABAICAAQCAgP2AgIACAICA/YCAgAEAgIABAICAAQCAgAOAgICAgICAgICAgICAgICAgICAgICAgICAgICAAAUAAP+AA4ADgAAJAA0AEQAVACUAAAEhESMVIxEzNSEjMxUrATMVKwEzFSsBMxUhNTMRIxUjFSE1IzUjAgABgICAgP8AgICAgICAgICAgIACgICAgP6AgIADgP6AgAEAgICAgICA/wCAgICAAAUAAAAAAoADgAADAAcAEwAXABsAAAEzFSsBMxUrATMVIRUjFSM1ITUzEzMVKwEzFSMBgICAgICAgIABgICA/oCAgICAgICAA4CAgICAgICA/wCAgAAAAAADAAD/gAKAA4AABwAXABsAAAEhESM1IzUjBSERIxUzFSMVIzUjNTM1IxMVMzUBAAGAgICA/wABgICAgICAgICAgAOA/oCAgID+gICAgICAgAEAgIAAAAAABQAA/4ADAAOAAAMADwATABcAGwAAASEVISMzESERMxEhESMRKwEzESMBMxEjKQEVIQEAAQD/AICAAQCA/wCAgICAgAKAgID+AAIA/gADgID/AAEA/oD/AAEA/oABgP6AgAAAAAgAAP+ABAADgAADAAcACwAPABMAFwAjACcAAAEhFSEjMxUjJTMRIyUhFSEjMxEjATMRIyUzFSEVIxUjNSE1IREzFSMCAAEA/wCAgIABgICA/YABAP8AgICAA4CAgP6AgAEAgID+AAGAgIADgICAgP8AgID/AAEA/wCAgICAgID/AIAAAAYAAP+ABAADgAALAA8AEwAXABsAHwAAASEVMxUzESMRIREhATMVKwEzFSsBMxUrATMVKwEzFSMBAAIAgICA/wD+gAEAgICAgICAgICAgICAgIADgICA/gABgAEA/wCAgICAgAAHAAD/gAOAA4AABwATABcAGwAfACMAJwAAESERIxEhESMBMxUzFSMVIzUjNTMBMxUjJTMVIyEzFSMlMxUrATMVIwOAgP2AgAGAgICAgICA/wCAgAIAgID+gICAAQCAgICAgAOA/YACAP4AAYCAgICAgP8AgICAgICAgAAAAQAAAAADgAOAACEAAAEhFSMVIxUhESMVMzUhETM1MzUzESMVIxUhFSERMxEzNTMBgAGAgID/AICAAQCAgICAgP8A/oCAgIADgICAgP8AgIABAICA/oCAgIABgAEAgAAABgAAAAADgAMAAAMACwAXABsAHwAjAAARIREhARUzFTM1MzUFESERIxUjFSM1IzUxMxUjJTMVKwEzFSMDgPyAAQCAgID+AAKAgICAgICAAQCAgICAgAMA/QACgICAgICA/oABgICAgICAgICAAAAAAAsAAAAAA4ADgAADAAcACwAPABMAFwAbAB8AIwArAC8AAAEzFSsBMxUjJTMVIyEzFSMlMxUjJTMVIyEzFSMlMxUjITMVIyUzESE1MzUzITMVIwEAgICAgIABAICA/oCAgAEAgIABAICA/oCAgAIAgID+gICAAgCA/oCAgP6AgIADgICAgICAgICAgICAgICA/oCAgIAAAAAAAQAAAAADAAOAABcAAAEzESMRIxEjFSM1IzUjETMVMxUzETMRMwKAgICAgICAgICAgICAA4D/AP8A/wCAgIABAICAAQABAAAAAQAAAAADAAOAABsAAAEzESMVIxUzESM1IRUjFSMRMzUzNSMRMxUhNTMCgICAgICA/wCAgICAgIABAIADgP8AgID/AICAgAEAgIABAICAAAAQAAAAAAOAA4AAAwAHAAsADwATABcAGwAfACMAJwArAC8AMwA3ADsAPwAAATMVIyUzFSMhMxUjJTMRIwEzFSMhMxUjJTMVIyEzFSMlMxUjITMVIyUzESMBMxUjITMVIyUzFSMhMxUjJTMVIwEAgIABAICA/gCAgAGAgIABgICA/YCAgAIAgID+gICAAQCAgP6AgIABAICAAQCAgP2AgIADAICA/gCAgAEAgIADgICAgICA/wABAICAgICAgICAgP8AAQCAgICAgICAAAABAAAAAAMAA4AAIwAAETMVMxUhNTM1MxEjFSMVMxUzESM1IzUhFSMVIxEzNTM1IzUjgIABAICAgICAgICA/wCAgICAgIADgICAgID/AICAgP8AgICAgAEAgICAAAIAAAAAAoADgAATABcAABMzFTM1MxUzESMVIxUjNSM1IxEzEzMVI4CAgICAgICAgICAgICAA4CAgID/AICAgIABAP2AgAAAAAEAAAAAA4ADgAAXAAATIRUzNSEVMxEjFSMVIxUjNSM1IzUjETOAAQCAAQCAgICAgICAgIADgICAgP6AgICAgICAAYAAAQAAAAACgAOAAAcAAAEzESEVITUhAQCAAQD9gAEAA4D9AICAAAAAAAEAAAAAAoADgAALAAARIRUhETMVIxUjESECgP8AgICA/wADgID+AICAAwAABAAAAAADgAOAAAMABwALAA8AABEhESETESERBSERIRMVMzUDgPyAgAKA/gABgP6AgIADgPyAAwD9gAKAgP6AAQCAgAABAAAAAAOAA4AAGwAAATMRIRUjFSMVMxEjNSM1IxUjFSMRMzUjNSM1IQGAgAGAgICAgICAgICAgIABgAOA/wCAgID/AICAgIABAICAgAAAAAgAAAAAA4ADgAADAAcACwAPABMAFwAbAB8AAAEhFSEjMxUjJTMVIyEzESMBMxEjITMVIyUzFSMpARUhAQABgP6AgICAAgCAgP2AgIADAICA/YCAgAIAgID+gAGA/oADgICAgID+gAGA/oCAgICAAAADAAAAAAOAA4AADwAVABsAAAEzFTMVIxEjFSERIxEhNTMFIREjNSMVMxEhNTMBgICAgID/AIABAIABAAEAgICA/wCAA4CAgP4AgAGAAQCAgP8AgID+gIAAAwAAAAADgAOAAA8AFQAbAAABMxUzFSERIxEhNSMRIzUzBSEVIxUjOwERMxUhAYCAgAEAgP8AgICA/oABAICAgICA/wADgICA/wD+gIACAICAgID/AIAAAAMAAAAAAwACgAANABEAFQAAEyEVMxEhNSM1MzUhNSETFSE1EzMVI4ABgID+AICAAQD/AIABAICAgAKAgP4AgICAgP8AgIABgIAAAAAEAAAAAAKAA4AADQARABUAGQAAATMRMxUjESE1MxEjNTMlMxUjATMVIyUzFSMBAICAgP8AgICAAQCAgP4AgIABgICAA4D/AID+gIABAICAgP4AgICAAAAAAwAAAAACgAOAAAMADQARAAATIRUhJTMRITUhESM1MyEzESOAAQD/AAGAgP4AAYCAgP4AgIADgICA/ICAAgCA/YAAAAACAAAAAAKAA4AACwAPAAARMxEhETMRIzUhFSMzIRUhgAGAgID+gICAAYD+gAOA/gACAP0AgICAAAYAAAAAA4ACgAADAAkADQARABUAGQAAETMRIwEhFSMRIwEzFSMFMxUjJTMVKwEzFSOAgAIAAQCAgAEAgID9gICAAQCAgICAgAKA/oABgID/AAEAgICAgICAAAAAAgAAAAACgAKAAAcACwAAESEVIREhFSEBMxUjAgD+gAIA/YACAICAAoCA/oCAAgCAAAAAAAQAAP+AAwACgAADAAkADQARAAARMxEjATMRITUhFzMVIykBFSGAgAIAgP4AAYCAgID+AAIA/gACgP6AAYD+AICAgIAABAAA/4ADAAKAAAUACQANABEAABEhFSERIwEzESM7ARUjKQEVIQIA/oCAAgCAgICAgP4AAgD+AAKAgP6AAYD+gICAAAAEAAAAAAKAA4AACwAPABMAFwAAEyEVIxUzFSE1MzUjAzMRIwEzESMpARUhgAGAgID+gICAgICAAgCAgP6AAYD+gAOAgICAgID/AP6AAYD+gIAAAAACAAD/gAKAAoAABQAJAAARIRUhESMBMxEjAgD+gIACAICAAoCA/gACAP2AAAQAAP+AAoACgAAFAAkADQARAAARIRUjESMBMxUrATMRIwEzESMBAICAAYCAgICAgAEAgIACgID+AAKAgP2AAoD+AAAAAgAAAAADAAOAAAsADwAAESERIRUhESEVIREjATMRIwEAAYD+gAGA/gCAAoCAgAOA/wCA/oCAAwD/AP6AAAAAAAQAAAAAAoACgAAHAAsADwATAAARIRUjETMVIQEzFSsBMxEjATMRIwEAgID/AAGAgICAgIABAICAAoCA/oCAAoCA/oABgP4AAAIAAAAAAoACgAAFAAkAABEhFSERIwEzESMCAP6AgAIAgIACgID/AAEA/gAAAgAA/4ACgAOAAAcADwAAETMVIRUhESMBMxEjESE1IYABgP6AgAIAgID+gAGAA4CAgP6AAYD9AAEAgAAABAAAAAACgAKAAAUACQANABMAABEhFSMRIwEzFSsBMxEjATMRITUzAQCAgAGAgICAgIABAID/AIACgID+AAKAgP6AAYD+AIAABAAAAAACgAOAAAMACwAPABMAABEhFSkBMxEjESE1IQUzESMzIRUhAgD+AAIAgID+gAGA/gCAgIABgP6AA4CA/YABgICA/oCAAAAAAAMAAAAAAoADgAADAAsADwAAEyEVISMzFSEVIREjATMRI4ACAP4AgIABgP6AgAIAgIADgICAgP4AAgD+AAAAAAAEAAAAAAKAAoAAAwAHAA0AEQAAETMRIwEzESMBMxEhNTMhMxUjgIABAICAAQCA/wCA/oCAgAKA/gACAP4AAgD9gICAAAIAAAAAAwACgAAFAAsAABEhESMRIyUzESE1IQEAgIACgID+AAGAAoD+AAGAgP2AgAAAAAACAAD/gAMAA4AABwANAAABMxEjESE1IQEhESMRIwKAgID+gAGA/YABAICAA4D8AAEAgAGA/oABAAAAAAADAAAAAAKAA4AACQANABEAAAEzETMVIxEhNTMBMxEjATMRIwEAgICA/wCA/wCAgAIAgIADgP8AgP4AgAIA/gABgP4AAAIAAAAAAoADgAADAAkAABEzESMBMxEhNSGAgAIAgP4AAYADgP0AAgD9gIAABAAA/4ACgAKAAAsADwATABcAABEzFTMVIxUhFSEVIwEhFSkBMxEjASEVIYCAgAGA/oCAAQABAP8AAQCAgP6AAgD+AAKAgICAgIACgID/AP8AgAAABAAA/4ACgAOAAAcACwAPABMAAAEzESM1IzUzATMRIwEzESsBMxUjAgCAgICA/gCAgAEAgICAgIADgPwAgIACAP4AAgD+AIAABQAA/4ACgAKAAAMABwALABcAGwAAEzMVIyUzFSMhMxEjATMRMxUjFSM1IzUzATMRI4CAgAEAgID+gICAAQCAgICAgIABAICAAoCAgID+gAGA/oCAgICAAYD+gAABAAD/gAKAA4AACwAAATMRIRUhESMRITUhAQCAAQD/AID/AAEAA4D/AID9gAKAgAACAAAAAAKAAoAABQAJAAARIRUhESMBMxEjAgD+gIACAICAAoCA/gACAP4AAAIAAP+AAoACgAADAAsAABEzESMBMxEjNSE1IYCAAgCAgP6AAYACgP4AAgD9AICAAAMAAP+AAoACgAADAAsADwAAETMRIwEzESM1ITUhASEVIYCAAgCAgP6AAYD+AAIA/gACgP6AAYD9gICA/wCAAAACAAD/gAKAA4AABwALAAARMxEhFSERIwEzESOAAYD+gIACAICAA4D/AID9gAKA/gAAAAAAAwAA/4ACgAKAAAUACQANAAARIRUhESMBMxEjBSEVIQIA/oCAAgCAgP6AAgD+AAKAgP4AAgD+gICAAAAAAwAAAAACgAOAAA0AEQAVAAABMxEzFSMRITUzESM1MwUzESMBMxEjAQCAgID/AICAgP8AgIACAICAA4D/AID+AIABgICA/oABgP4AAAQAAP+AAoACgAAFAAkADQARAAARIRUjESMBMxUrATMRIwEzESMBAICAAYCAgICAgAEAgIACgID9gAMAgP4AAgD+AAAABAAA/4ADAAKAAAcACwAPABMAABEhFSERIRUhATMVIxMzFSMpARUhAgD+gAIA/YACAICAgICA/gACAP4AAoCA/wCAAYCA/wCAgAAAAAMAAP+AAoACgAAHAAsADwAAETMRIRUhFSMBMxEjASEVIYABgP6AgAIAgID+gAIA/gACgP6AgIACgP6A/wCAAAAHAAD/gAKAAoAABwALAA8AEwAXABsAHwAAESERIzUhFSM7ARUjJTMVKwEzFSsBMxUjJSEVKQEzFSMCgID+gICAgIABAICAgICAgICAAQABAP8A/oCAgAKA/wCAgICAgICAgICAAAAAAAMAAAAAAoACgAAFAAsADwAAESEVIxEjATMRITUzATMRIwEAgIACAID/AID/AICAAoCA/gACgP2AgAGA/oAAAAACAAD/gAKAA4AABwALAAARMxEhFSERIwEzFSOAAYD+gIACAICAA4D/AID9gAKAgAAEAAAAAAKAAoAAAwAHAAsADwAAESEVKQEzESMBMxEjMyEVIQIA/gACAICA/gCAgIABgP6AAoCA/oABAP8AgAAAAgAA/4ACgAOAAAcACwAAATMRIzUhNSEBMxEjAgCAgP6AAYD+AICAA4D8AICAAgD+AAAAAAMAAP+AAoACgAADAAcADwAAETMRIwEzESMpARUjESMRI4CAAgCAgP6AAYCAgIACgP6AAYD+gID/AAEAAAMAAAAAAoADgAAPABMAFwAAASEVIREzFSMRITUzESM1MwUzESMBMxEjAQABgP8AgID/AICAgP8AgIACAICAA4CA/wCA/oCAAYCAgP6AAQD+gAAAAAQAAP+AAoADAAADAA8AEwAXAAABMxUjFTMRMxUhNTMRIzUzBTMRIyUzFSMBAICAgID+gICAgP8AgIACAICAAwCAgP4AgIABAICA/wCAgAAABgAAAAACgAOAAAMABwALAA8AEwAXAAATIRUhIzMRIwEzFSMFMxUjOwEVIxUzFSOAAYD+gICAgAIAgID+gICAgICAgIADgID/AAEAgICAgICAAAAAAgAAAIAAgAOAAAMABwAAETMRIxEzFSOAgICAA4D/AP6AgAAAAQAAAAACgAOAAAsAAAEzESEVIREjESE1IQEAgAEA/wCA/wABAAOA/gCA/wABAIAAAQAA/4AAgACAAAMAADUzESOAgID/AAAAAQAAAAACgAOAABsAAAEzFSEVIRUhFSEVIRUhFSM1ITUhNSE1ITUhNSEBAIABAP8AAQD/AAEA/wCA/wABAP8AAQD/AAEAA4CAgICAgICAgICAgICAAAAAAAIAAAAAAoADAAADAAsAABEhFSEVIRUhESMRIQKA/YACgP8AgP8AAwCAgID+gAGAAAMAAAAAAoADgAADAAcADwAAATMRKwEzFSsBMxEhNTMRIQEAgICAgICAgAGAgP2AA4D+gID/AID/AAAAAAIAAP+AAoADgAALAA8AABEzESERMxEjESERIykBFSGAAYCAgP6AgAEAAQD/AAOA/wABAPyAAgD+AIAAAAQAAP+AAoADgAAHAAsADwATAAARMxEzFSMRIwEhFSkBMxEjKQEVIYCAgIABAAEA/wABAICA/wABAP8AA4D+gID+gAKAgP4AgAAAAAAEAAD/gAOAA4AADQARABUAGQAAESEVIRUhESM1IREjESEBIRUpATMRIykBFSECgP8AAgCA/oCA/wACAAEA/wABAICA/wABAP8AA4CAgP8AgP4AAwD+gID/AIAAAAQAAP+AAwADgAANABEAFQAZAAATMxEhESM1IREjESM1MwEhFSkBMxEjKQEVIYCAAgCA/oCAgIABAAEA/wABAICA/wABAP8AA4D/AP8AgP4AAgCA/wCA/wCAAAAAAQAAAAACgAKAAAkAABEhFSEVIRUhESMCgP4AAQD/AIACgICAgP8AAAUAAAAAAoACgAADAAcACwAPABMAABMhFSEjMxUjMyEVKQEzFSMpARUhgAIA/gCAgICAAYD+gAGAgID+AAIA/gACgICAgICAAAUAAAAABAACgAADAAcAEwAXABsAABMhFSElMxEjATMRMxUhNSE1ITUhBTMVIyUzFSOAAYD+gAMAgID+gICA/YABgP6AAYD+AICAAwCAgAKAgID+gAEA/oCAgICAgICAgAAAAAADAAAAAAQAAoAAAwAZAB0AABMhFSElMxEjFSM1IxUzFSE1ITUhNSE1MxUhBTMVI4ABgP6AAwCAgICAgP2AAYD+gAGAgAEA/ICAgAKAgID+gICAgICAgICAgICAAAYAAAAAAoADgAADAAcADQARABUAGQAAESEVKQEzFSMpARUhFSM7ARUjOwEVIzsBFSMCAP4AAgCAgP6AAYD/AICAgICAgICAgIADgICAgICAgIAAAAQAAAAAAgACgAADAAcADQARAAARIRUpATMVIykBESM1IwUzFSMBgP6AAYCAgP8AAQCAgAEAgIACgICA/wCAgIAAAAAABgAAAAACgAOAAAMABwALAA8AEwAXAAARMxUjJSEVISMzFSMlMxEjATMRIzMhFSGAgAEAAQD/AICAgAGAgID+AICAgAGA/oADgICAgICA/YACAP4AgAAAAAEAAAAAAoADgAAFAAARIREjESECgID+AAOA/IADAAAAAgAA/4ABAAMAAAMABwAAETMVIzsBESOAgICAgAMAgP0AAAAABwAAAAADAAOAAAMABwARABUAGQAdACEAABMhFSEjMxUjMyEVMxEjESM1ISUzFSMFMxUjITMVIzMhFSGAAgD+AICAgIABgICAgP8AAgCAgP6AgID/AICAgAGA/oADgICAgP6AAQCAgICAgICAAAAAAAMAAAAAAoACgAARABUAGQAAEyEVIxEjFTMVITUhNSM1ITUhIzMVIwUzFSOAAgCAgID+AAEAgAEA/wCAgIACAICAAoCA/wCAgICAgICAgIAABgAAAAACgAKAAAMABwALAA8AEwAXAAATIRUhIzMRIwEzESsBMxUjKQEVISUzFSOAAYD+gICAgAIAgICAgID/AAEA/wABgICAAoCA/oABgP8AgICAgAAAAAUAAAAAAoADgAADAAsADwATABcAABEzESMBMxEjESE1ISUzFSMVMxUrATMVI4CAAgCAgP8AAQD+gICAgICAgIADgP6AAYD8gAEAgICAgICAAAAAAAMAAAAAA4ADgAADAAcAGwAAASEVISUhFSkBMxUhNTMVIRUhESMRIREjESM1MwEAAQD/AAGAAQD/AP4AgAEAgAEA/wCA/wCAgIADgICAgICAgID+AAIA/gACAIAAAgAAAAACgAOAAAMAEQAAASEVISMzFSERIxEhESMRIzUzAQABgP6AgIABgID/AICAgAOAgID9gAIA/gACAIAAAAIAAAAAAwADgAARABUAAAEhESMRIREjESM1MzUzFSE1IQEzFSMBAAGAgP8AgICAgAEA/wABgICAA4D9AAGA/gACAICAgID9gIAAAAADAAAAAAQAA4AAAwAHAB0AAAEhFSElIRUpATMVITUzFSERIxEhESMRIREjESM1MwEAAQD/AAGAAYD+gP4AgAEAgAGAgP8AgP8AgICAA4CAgICAgID9gAIA/gACAP4AAgCAAAAAAwAAAAACgAOAAA0AEQAVAAATIREzFSMRIxEjNTM1ISMzESMlMxUjgAGAgICAgID/AICAgAIAgIADgP8AgP6AAYCAgP0AgIAAAgAAAIAAgAKAAAMABwAAETMRIxUzFSOAgICAAoD/AICAAAAAAwAAAIABgAKAAAMABwALAAARMxEjATMRIwUhFSGAgAEAgID/AAGA/oACgP8AAQD/AICAAAQAAAAAAoADgAADAAsADwAVAAARMxUjFTMRMxUjFSMBMxEjATMRITUhgICAgICAAQCAgAEAgP4AAYADgICA/wCAgAIA/wABAP2AgAADAAAAAAKAAoAAAwALAA8AABEhFSkBMxEzFSE1IQEzFSMBgP6AAYCAgP2AAYD/AICAAoCA/oCAgAEAgAACAAAAAAGAAoAAAwAHAAABMxEjATMVIwEAgID/AICAAoD9gAGAgAAABAAAAAACAAKAAAMABwALAA8AABEhFSkBMxEjATMVIwchFSEBgP6AAYCAgP8AgICAAYD+gAKAgP6AAQCAgIAAAAQAAAAAAoACgAAFAAkADQARAAARIRUhESMBMxEjATMVIwUhFSECAP6AgAIAgID/AICA/wACAP4AAoCA/wABAP6AAQCAgIAAAAIAAAAAAoACgAANABEAABEhFSEVMxUjESE1MxEjITMRIwIA/wCAgP8AgIACAICAAoCAgID/AIABgP4AAAIAAAAAAQADgAADAAcAABMzFSMHMxEjgICAgICAA4CAgP2AAAMAAAAAAoADgAADAAcADwAAESEVIRUhFSkBMxEzFSE1IQGA/oABgP6AAYCAgP2AAYADgICAgP6AgIAAAAQAAAAAAoADgAADAAsADwATAAATIRUhByEVIRUhFSEBMxEjKQEVIYABgP6AgAIA/oABAP6AAgCAgP4AAgD+AAOAgICAgIABAP6AgAABAAAAAAKAAoAACwAAATMRIRUhESMRITUhAQCAAQD/AID/AAEAAoD/AID/AAEAgAADAAD/gAOAA4AABwAlACkAAAEzFTMVITUzBTMVIRUjFTM1MxEzFTMRIxUjFSM1IxUjNSM1IxEzATMVIwGAgID+gID/AIABAICAgICAgICAgICAgIABAICAA4CAgICAgICAgAEAgP8AgICAgICAAQD+AIAAAAAAFAD2AAEAAAAAAAAAAwAIAAEAAAAAAAEACQAgAAEAAAAAAAIABwA6AAEAAAAAAAMACQBWAAEAAAAAAAQAEQCEAAEAAAAAAAUACwCuAAEAAAAAAAYACQDOAAEAAAAAAAkADgD2AAEAAAAAAA0AEwEtAAEAAAAAABMABgFPAAMAAQQJAAAABgAAAAMAAQQJAAEAEgAMAAMAAQQJAAIADgAqAAMAAQQJAAMAEgBCAAMAAQQJAAQAIgBgAAMAAQQJAAUAFgCWAAMAAQQJAAYAEgC6AAMAAQQJAAkAHADYAAMAAQQJAA0AJgEFAAMAAQQJABMADAFBACgAYwApAAAoYykAAE0AaQBuAGUAYwByAGEAZgB0AABNaW5lY3JhZnQAAFIAZQBnAHUAbABhAHIAAFJlZ3VsYXIAAE0AaQBuAGUAYwByAGEAZgB0AABNaW5lY3JhZnQAAE0AaQBuAGUAYwByAGEAZgB0ACAAUgBlAGcAdQBsAGEAcgAATWluZWNyYWZ0IFJlZ3VsYXIAAFYAZQByAHMAaQBvAG4AIAAxAC4AMAAAVmVyc2lvbiAxLjAAAE0AaQBuAGUAYwByAGEAZgB0AABNaW5lY3JhZnQAAE0AbwBqAGEAbgBnACAAUwB0AHUAZABpAG8AcwAATW9qYW5nIFN0dWRpb3MAAEEAbABsACAAcgBpAGcAaAB0AHMAIAByAGUAcwBlAHIAdgBlAGQAAEFsbCByaWdodHMgcmVzZXJ2ZWQAAEgAZQBsAGwAbwAhAABIZWxsbyEAAAIAAAAAAAAAZgAzAAAAAAAAAAAAAAAAAAAAAAAAAAAEogAAAQIAAgADAAQABQAGAAcACAAJAAoACwAMAA0ADgAPABAAEQASABMAFAAVABYAFwAYABkAGgAbABwAHQAeAB8AIAAhACIAIwAkACUAJgAnACgAKQAqACsALAAtAC4ALwAwADEAMgAzADQANQA2ADcAOAA5ADoAOwA8AD0APgA/AEAAQQBCAEMARABFAEYARwBIAEkASgBLAEwATQBOAE8AUABRAFIAUwBUAFUAVgBXAFgAWQBaAFsAXABdAF4AXwBgAGEAowCEAIUAvQCWAOgAhgCOAIsAnQCpAKQBAwCKANoAgwCTAQQBBQCNAJcAiADDAQYAngCqAPUA9AD2AKIA8ACRAO0AiQDqALgAoQDuAQcBCAEJAQoBCwEMAQ0BDgEPARABEQESARMApgEUARUBFgEXARgBGQEaARsBHAEdAR4BHwEgASEBIgEjASQBJQEmAScBKAEpASoBKwEsAS0BLgEvATABMQEyATMBNAE1ATYBNwE4ATkBOgE7ATwBPQE+AT8BQAFBAUIBQwFEAUUBRgFHAUgBSQFKAUsBTAFNAU4BTwFQAVEBUgFTAVQBVQFWAVcBWAFZAVoBWwFcAV0BXgFfAWABYQFiAWMBZAFlAWYBZwFoAWkBagFrAWwBbQFuAW8BcAFxAXIBcwF0AXUBdgF3AXgBeQF6AXsBfAF9AX4BfwGAAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwDcAZgBmQGaAZsBnAGdAZ4BnwGgAaEBogGjAaQBpQGmAacBqAGpAaoBqwGsAa0BrgGvAbABsQGyAbMBtAG1AbYBtwG4AbkBugG7AbwBvQG+Ab8BwACbAcEBwgHDAcQBxQHGAccByAHJAcoBywHMAc0BzgHPAdAB0QHSAdMB1AHVAdYB1wHYAdkB2gHbAdwB3QHeAd8B4AHhAeIB4wHkAeUB5gHnAegB6QHqAesB7AHtAe4B7wHwAfEB8gHzAfQB9QH2AfcB+AH5AfoB+wH8Af0B/gH/AgACAQICAgMCBAIFAgYCBwIIAgkCCgILAgwCDQIOAg8CEAIRAhICEwIUAhUCFgIXAhgCGQIaAhsCHAIdAh4CHwIgAiECIgIjAiQCJQImAicCKAIpAioCKwIsAi0CLgIvAjACMQIyAjMCNAI1AjYCNwI4AjkCOgI7AjwCPQI+Aj8CQAJBAkICQwJEAkUCRgJHAkgCSQJKAksCTAJNAk4CTwJQAlECUgJTAlQCVQJWAlcCWAJZAloCWwJcAl0CXgJfAmACYQJiAmMCZAJlAmYCZwJoAmkCagJrAmwCbQJuAm8CcAJxAnICcwJ0AnUCdgJ3AngCeQJ6AnsCfAJ9An4CfwKAAoECggKDAoQChQKGAocCiAKJAooCiwKMAo0CjgKPApACkQKSApMClAKVApYClwKYApkCmgKbApwCnQKeAp8CoAKhAqICowKkAqUCpgKnAqgCqQKqAqsCrAKtAq4CrwKwArECsgKzArQCtQK2ArcCuAK5AroCuwK8Ar0CvgK/AsACwQLCAsMCxALFAsYCxwLIAskCygLLAswCzQLOAs8C0ALRAtIC0wLUAtUC1gLXAtgC2QLaAtsC3ALdAt4C3wLgAuEC4gLjAuQC5QLmAucC6ALpAuoC6wLsAu0C7gLvAvAC8QLyAvMC9AL1AvYC9wL4AvkC+gL7AvwC/QL+Av8DAAMBAwIDAwMEAwUDBgMHAwgDCQMKAwsDDAMNAw4DDwMQAxEDEgMTAxQDFQMWAxcDGAMZAxoDGwMcAx0DHgMfAyADIQMiAyMDJAMlAyYDJwMoAykDKgMrAywDLQMuAy8DMAMxAzIDMwM0AzUDNgM3AzgDOQM6AzsDPAM9Az4DPwNAA0EDQgNDA0QDRQNGA0cDSANJA0oDSwNMA00DTgNPA1ADUQNSA1MDVANVA1YDVwNYA1kDWgNbA1wDXQNeA18DYANhA2IDYwNkA2UDZgNnA2gDaQNqA2sDbANtA24DbwNwA3EDcgNzA3QDdQN2A3cDeAN5A3oAsgCzALYAtwDEALQAtQDFAIIAwgCHAKsAxgN7A3wDfQN+A38DgAOBAL4AvwOCA4MDhAOFA4YDhwOIA4kDigOLA4wDjQOOA48DkAORA5IDkwOUA5UDlgOXA5gDmQOaA5sDnAOdA54DnwOgA6EDogOjA6QDpQOmA6cDqAOpA6oDqwOsA60DrgD3A68DsAOxA7IDswO0A7UDtgO3A7gDuQO6A7sDvAO9A74DvwPAA8EDwgPDA8QDxQPGA8cDyACMA8kDygPLA8wDzQPOA88D0APRA9ID0wPUA9UD1gPXA9gD2QPaA9sD3APdA94D3wPgA+ED4gPjA+QD5QPmA+cAmAPoA+kD6gPrA+wD7QPuAJkA7wPvA/AApQPxA/ID8wCSA/QD9QP2A/cAnAP4A/kD+gCnA/sAjwP8A/0AlACVA/4D/wQABAEEAgQDBAQEBQQGBAcECAQJBAoECwQMBA0EDgQPBBAEEQQSBBMEFAQVBBYEFwQYBBkEGgQbBBwEHQQeBB8EIAQhBCIEIwQkBCUEJgQnBCgEKQQqBCsELAQtBC4ELwQwBDEEMgQzBDQENQQ2BDcEOAQ5BDoEOwQ8BD0EPgQ/BEAEQQRCBEMERARFBEYERwRIBEkESgRLBEwETQROBE8EUARRBFIEUwRUBFUEVgRXBFgEWQRaBFsEXARdBF4EXwRgBGEEYgRjBGQEZQRmBGcEaARpBGoEawRsBG0EbgRvBHAEcQRyBHMEdAR1BHYEdwR4BHkEegR7BHwEfQR+BH8EgASBBIIEgwSEBIUEhgSHBIgEiQSKBIsEjASNBI4EjwSQBJEEkgSTBJQElQSWBJcEmASZBJoEmwScBJ0EngSfBKAEoQSiBKMEpASlBKYEpwSoBKkEqgSrBKwErQSuBK8EsASxBLIEswS0BLUEtgS3BLgEuQS6BLsEvAS9BL4EvwTABMEEwgTDBMQExQTGBMcEyATJBMoEywTMBM0EzgTPBNAE0QTSBNME1ATVBNYE1wTYBNkE2gTbBNwE3QTeBN8E4AThBOIE4wTkBOUE5gTnBOgE6QTqBOsE7ATtBO4E7wTwBPEE8gTzBPQE9QT2BPcE+AT5BPoE+wT8BP0E/gT/BQAFAQUCBmdseXBoMQd1bmkwMEFEB3VuaTAwQjIHdW5pMDBCMwd1bmkwMEI5AklKAmlqDGtncmVlbmxhbmRpYwVsb25ncwd1bmkwMTgxB3VuaTAxODQHdW5pMDE4NQd1bmkwMTg2B3VuaTAxODkHdW5pMDE4RQd1bmkwMThGB3VuaTAxOTAHdW5pMDE5MQd1bmkwMTlBB3VuaTAxOUIHdW5pMDE5RQd1bmkwMTlGB3VuaTAxQTcHdW5pMDFBOAd1bmkwMUE5B3VuaTAxQUEHdW5pMDFCMgd1bmkwMUI3B3VuaTAxQjgHdW5pMDFCOQd1bmkwMUJCB3VuaTAxQkMHdW5pMDFCRAd1bmkwMUJFB3VuaTAxQkYHdW5pMDFDMAd1bmkwMUMxB3VuaTAxQzIHdW5pMDFDMwd1bmkwMUM5B3VuaTAxREQHdW5pMDFGNwd1bmkwMjFDB3VuaTAyMUQHdW5pMDIyMAd1bmkwMjIxB3VuaTAyMjQHdW5pMDIyNQd1bmkwMjM0B3VuaTAyMzUHdW5pMDIzNgd1bmkwMjNBB3VuaTAyM0IHdW5pMDIzQwd1bmkwMjNEB3VuaTAyM0UHdW5pMDI0MQd1bmkwMjQyB3VuaTAyNDMHdW5pMDI0NAd1bmkwMjQ1B3VuaTAyNDYHdW5pMDI0Nwd1bmkwMjQ4B3VuaTAyNDkHdW5pMDI0QQd1bmkwMjRCB3VuaTAyNEMHdW5pMDI0RAd1bmkwMjRFB3VuaTAyNEYHdW5pMDI1MAd1bmkwMjUxB3VuaTAyNTIHdW5pMDI1Mwd1bmkwMjU0B3VuaTAyNTUHdW5pMDI1Ngd1bmkwMjU3B3VuaTAyNTgHdW5pMDI1OQd1bmkwMjVBB3VuaTAyNUIHdW5pMDI1Qwd1bmkwMjVEB3VuaTAyNUUHdW5pMDI1Rgd1bmkwMjYwB3VuaTAyNjEHdW5pMDI2Mgd1bmkwMjY0B3VuaTAyNjUHdW5pMDI2Ngd1bmkwMjY3B3VuaTAyNjgHdW5pMDI2QQd1bmkwMjZCB3VuaTAyNkMHdW5pMDI2RAd1bmkwMjZFB3VuaTAyNkYHdW5pMDI3MAd1bmkwMjcxB3VuaTAyNzIHdW5pMDI3Mwd1bmkwMjc0B3VuaTAyNzUHdW5pMDI3Nwd1bmkwMjc4B3VuaTAyNzkHdW5pMDI3QQd1bmkwMjdCB3VuaTAyN0MHdW5pMDI3RQd1bmkwMjdGB3VuaTAyODAHdW5pMDI4MQd1bmkwMjg0B3VuaTAyODUHdW5pMDI4Ngd1bmkwMjg3B3VuaTAyODgHdW5pMDI4OQd1bmkwMjhBB3VuaTAyOEIHdW5pMDI4Qwd1bmkwMjhEB3VuaTAyOEUHdW5pMDI4Rgd1bmkwMjkxB3VuaTAyOTIHdW5pMDI5Mwd1bmkwMjk0B3VuaTAyOTUHdW5pMDI5Ngd1bmkwMjk3B3VuaTAyOTgHdW5pMDI5OQd1bmkwMjlBB3VuaTAyOUIHdW5pMDI5Qwd1bmkwMjlEB3VuaTAyOUUHdW5pMDI5Rgd1bmkwMkEwB3VuaTAyQTEHdW5pMDJBMgd1bmkwMkFDB3VuaTAyQkIHdW5pMDJDQwd1bmkwMzdFCWFub3RlbGVpYQVBbHBoYQRCZXRhBUdhbW1hB3VuaTAzOTQHRXBzaWxvbgRaZXRhA0V0YQVUaGV0YQRJb3RhBUthcHBhBkxhbWJkYQJNdQJOdQJYaQdPbWljcm9uAlBpA1JobwVTaWdtYQNUYXUHVXBzaWxvbgNQaGkDQ2hpA1BzaQd1bmkwM0E5BWFscGhhBGJldGEFZ2FtbWEFZGVsdGEHZXBzaWxvbgR6ZXRhA2V0YQV0aGV0YQRpb3RhBWthcHBhBmxhbWJkYQd1bmkwM0JDAm51AnhpB29taWNyb24DcmhvBnNpZ21hMQVzaWdtYQN0YXUHdXBzaWxvbgNwaGkDY2hpA3BzaQVvbWVnYQd1bmkwM0RCB3VuaTA0MDIHdW5pMDQwNAd1bmkwNDA1B3VuaTA0MDYHdW5pMDQwOAd1bmkwNDA5B3VuaTA0MEEHdW5pMDQwQgd1bmkwNDEwB3VuaTA0MTEHdW5pMDQxMgd1bmkwNDEzB3VuaTA0MTQHdW5pMDQxNQd1bmkwNDE2B3VuaTA0MTcHdW5pMDQxOAd1bmkwNDFBB3VuaTA0MUIHdW5pMDQxQwd1bmkwNDFEB3VuaTA0MUUHdW5pMDQxRgd1bmkwNDIwB3VuaTA0MjEHdW5pMDQyMgd1bmkwNDIzB3VuaTA0MjQHdW5pMDQyNQd1bmkwNDI2B3VuaTA0MjcHdW5pMDQyOAd1bmkwNDI5B3VuaTA0MkEHdW5pMDQyQgd1bmkwNDJDB3VuaTA0MkQHdW5pMDQyRQd1bmkwNDJGB3VuaTA0MzAHdW5pMDQzMQd1bmkwNDMyB3VuaTA0MzMHdW5pMDQzNAd1bmkwNDM1B3VuaTA0MzYHdW5pMDQzNwd1bmkwNDM4B3VuaTA0M0EHdW5pMDQzQgd1bmkwNDNDB3VuaTA0M0QHdW5pMDQzRQd1bmkwNDNGB3VuaTA0NDAHdW5pMDQ0MQd1bmkwNDQyB3VuaTA0NDMHdW5pMDQ0NAd1bmkwNDQ1B3VuaTA0NDYHdW5pMDQ0Nwd1bmkwNDQ4B3VuaTA0NDkHdW5pMDQ0QQd1bmkwNDRCB3VuaTA0NEMHdW5pMDQ0RAd1bmkwNDRFB3VuaTA0NEYHdW5pMDQ1NAd1bmkwNDU1B3VuaTA0NTYHdW5pMDQ1OAd1bmkwNDU5B3VuaTA0NUEHdW5pMDQ2Mgd1bmkwNDYzB3VuaTA0NzIHdW5pMDQ3Mwd1bmkwNDc0B3VuaTA0NzUHdW5pMDQ5Mgd1bmkwNDkzB3VuaTA0OTYHdW5pMDQ5Nwd1bmkwNDlBB3VuaTA0OUIHdW5pMDRBMgd1bmkwNEEzB3VuaTA0QUUHdW5pMDRBRgd1bmkwNEIwB3VuaTA0QjEHdW5pMDRCQQd1bmkwNEJCB3VuaTA0QzAHdW5pMDREOAd1bmkwNEQ5B3VuaTA0RTgHdW5pMDRFOQd1bmkwNTAwB3VuaTA1MzEHdW5pMDUzMgd1bmkwNTMzB3VuaTA1MzQHdW5pMDUzNQd1bmkwNTM2B3VuaTA1MzcHdW5pMDUzOAd1bmkwNTM5B3VuaTA1M0EHdW5pMDUzQgd1bmkwNTNDB3VuaTA1M0QHdW5pMDUzRQd1bmkwNTNGB3VuaTA1NDAHdW5pMDU0MQd1bmkwNTQyB3VuaTA1NDMHdW5pMDU0NAd1bmkwNTQ1B3VuaTA1NDYHdW5pMDU0Nwd1bmkwNTQ4B3VuaTA1NDkHdW5pMDU0QQd1bmkwNTRCB3VuaTA1NEMHdW5pMDU0RAd1bmkwNTRFB3VuaTA1NEYHdW5pMDU1MAd1bmkwNTUxB3VuaTA1NTIHdW5pMDU1Mwd1bmkwNTU0B3VuaTA1NTUHdW5pMDU1Ngd1bmkwNTU5B3VuaTA1NUEHdW5pMDU1Qgd1bmkwNTVDB3VuaTA1NUQHdW5pMDU1RQd1bmkwNTVGB3VuaTA1NjAHdW5pMDU2MQd1bmkwNTYyB3VuaTA1NjMHdW5pMDU2NAd1bmkwNTY1B3VuaTA1NjYHdW5pMDU2Nwd1bmkwNTY4B3VuaTA1NjkHdW5pMDU2QQd1bmkwNTZCB3VuaTA1NkMHdW5pMDU2RAd1bmkwNTZFB3VuaTA1NkYHdW5pMDU3MAd1bmkwNTcxB3VuaTA1NzIHdW5pMDU3Mwd1bmkwNTc0B3VuaTA1NzUHdW5pMDU3Ngd1bmkwNTc3B3VuaTA1NzgHdW5pMDU3OQd1bmkwNTdBB3VuaTA1N0IHdW5pMDU3Qwd1bmkwNTdEB3VuaTA1N0UHdW5pMDU3Rgd1bmkwNTgwB3VuaTA1ODEHdW5pMDU4Mgd1bmkwNTgzB3VuaTA1ODQHdW5pMDU4NQd1bmkwNTg2B3VuaTA1ODcHdW5pMDU4OAd1bmkwNThBB3VuaTA1OEYHdW5pMDVCRQd1bmkwNUMzB3VuaTA1QzYHdW5pMDVEMAd1bmkwNUQxB3VuaTA1RDIHdW5pMDVEMwd1bmkwNUQ0B3VuaTA1RDUHdW5pMDVENgd1bmkwNUQ3B3VuaTA1RDgHdW5pMDVEOQd1bmkwNURBB3VuaTA1REIHdW5pMDVEQwd1bmkwNUREB3VuaTA1REUHdW5pMDVERgd1bmkwNUUwB3VuaTA1RTEHdW5pMDVFMgd1bmkwNUUzB3VuaTA1RTQHdW5pMDVFNQd1bmkwNUU2B3VuaTA1RTcHdW5pMDVFOAd1bmkwNUU5B3VuaTA1RUEHdW5pMDVGMAd1bmkwNUYxB3VuaTA1RjIHdW5pMDVGMwd1bmkwNUY0B3VuaTA3QzgHdW5pMTBBMAd1bmkxMEExB3VuaTEwQTIHdW5pMTBBMwd1bmkxMEE0B3VuaTEwQTUHdW5pMTBBNgd1bmkxMEE3B3VuaTEwQTgHdW5pMTBBOQd1bmkxMEFBB3VuaTEwQUIHdW5pMTBBQwd1bmkxMEFEB3VuaTEwQUUHdW5pMTBBRgd1bmkxMEIwB3VuaTEwQjEHdW5pMTBCMgd1bmkxMEIzB3VuaTEwQjQHdW5pMTBCNQd1bmkxMEI2B3VuaTEwQjcHdW5pMTBCOAd1bmkxMEI5B3VuaTEwQkEHdW5pMTBCQgd1bmkxMEJDB3VuaTEwQkQHdW5pMTBCRQd1bmkxMEJGB3VuaTEwQzAHdW5pMTBDMQd1bmkxMEMyB3VuaTEwQzMHdW5pMTBDNAd1bmkxMEM1B3VuaTEwQzcHdW5pMTBDRAd1bmkxMEQwB3VuaTEwRDEHdW5pMTBEMgd1bmkxMEQzB3VuaTEwRDQHdW5pMTBENQd1bmkxMEQ2B3VuaTEwRDcHdW5pMTBEOAd1bmkxMEQ5B3VuaTEwREEHdW5pMTBEQgd1bmkxMERDB3VuaTEwREQHdW5pMTBERQd1bmkxMERGB3VuaTEwRTAHdW5pMTBFMQd1bmkxMEUyB3VuaTEwRTMHdW5pMTBFNAd1bmkxMEU1B3VuaTEwRTYHdW5pMTBFNwd1bmkxMEU4B3VuaTEwRTkHdW5pMTBFQQd1bmkxMEVCB3VuaTEwRUMHdW5pMTBFRAd1bmkxMEVFB3VuaTEwRUYHdW5pMTBGMAd1bmkxMEYxB3VuaTEwRjIHdW5pMTBGMwd1bmkxMEY0B3VuaTEwRjUHdW5pMTBGNgd1bmkxMEY3B3VuaTEwRjgHdW5pMTBGOQd1bmkxMEZBB3VuaTEwRkIHdW5pMTBGQwd1bmkxMEZEB3VuaTEwRkUHdW5pMTBGRgd1bmkxNUUxB3VuaTE1RkEHdW5pMTYxNAd1bmkxNkEwB3VuaTE2QTIHdW5pMTZBMwd1bmkxNkE0B3VuaTE2QTUHdW5pMTZBNgd1bmkxNkE3B3VuaTE2QTgHdW5pMTZBOQd1bmkxNkFBB3VuaTE2QUIHdW5pMTZBQwd1bmkxNkFEB3VuaTE2QUUHdW5pMTZBRgd1bmkxNkIwB3VuaTE2QjEHdW5pMTZCMgd1bmkxNkIzB3VuaTE2QjQHdW5pMTZCNgd1bmkxNkI3B3VuaTE2QjgHdW5pMTZCOQd1bmkxNkJBB3VuaTE2QkIHdW5pMTZCQwd1bmkxNkJEB3VuaTE2QkUHdW5pMTZCRgd1bmkxNkMwB3VuaTE2QzEHdW5pMTZDMgd1bmkxNkMzB3VuaTE2QzQHdW5pMTZDNQd1bmkxNkM2B3VuaTE2QzcHdW5pMTZDOAd1bmkxNkM5B3VuaTE2Q0EHdW5pMTZDQgd1bmkxNkNDB3VuaTE2Q0QHdW5pMTZDRQd1bmkxNkNGB3VuaTE2RDAHdW5pMTZEMQd1bmkxNkQyB3VuaTE2RDMHdW5pMTZENAd1bmkxNkQ1B3VuaTE2RDYHdW5pMTZENwd1bmkxNkQ4B3VuaTE2RDkHdW5pMTZEQQd1bmkxNkRCB3VuaTE2REMHdW5pMTZERAd1bmkxNkRFB3VuaTE2REYHdW5pMTZFMAd1bmkxNkUxB3VuaTE2RTIHdW5pMTZFMwd1bmkxNkU0B3VuaTE2RTUHdW5pMTZFNgd1bmkxNkU3B3VuaTE2RTgHdW5pMTZFOQd1bmkxNkVBB3VuaTE2RUIHdW5pMTZFQwd1bmkxNkVEB3VuaTE2RUUHdW5pMTZFRgd1bmkxNkYwB3VuaTE2RjEHdW5pMTZGMgd1bmkxNkYzB3VuaTE2RjQHdW5pMTZGNQd1bmkxNkY2B3VuaTE2RjcHdW5pMTZGOAd1bmkxRDAwB3VuaTFEMDQHdW5pMUQwNQd1bmkxRDA3B3VuaTFEMDkHdW5pMUQwQQd1bmkxRDBCB3VuaTFEMEQHdW5pMUQwRgd1bmkxRDE4B3VuaTFEMUEHdW5pMUQxQgd1bmkxRDFDB3VuaTFEMjAHdW5pMUQyMQd1bmkxRDIyB3VuaTFENzcHdW5pMUQ5MQd1bmkxRTlDB3VuaTFFOUQHdW5pMUU5RQd1bmkxRTlGB3VuaTFFRkMHdW5pMUVGRAd1bmkxRUZFB3VuaTFFRkYHdW5pMjAxMAd1bmkyMDExB3VuaTIwMzEGbWludXRlBnNlY29uZAd1bmkyMDM0B3VuaTIwMzUHdW5pMjAzNgd1bmkyMDM3B3VuaTIwM0IJZXhjbGFtZGJsB3VuaTIwM0QHdW5pMjA0Mgd1bmkyMDQ4B3VuaTIwNDkHdW5pMjA0QQd1bmkyMDRCB3VuaTIwNEUHdW5pMjA0Rgd1bmkyMDUxB3VuaTIwNTIHdW5pMjA1Nwd1bmkyMDcwB3VuaTIwNzEHdW5pMjA3NAd1bmkyMDc1B3VuaTIwNzYHdW5pMjA3Nwd1bmkyMDc4B3VuaTIwNzkHdW5pMjA3QQd1bmkyMDdCB3VuaTIwN0MHdW5pMjA3RAd1bmkyMDdFB3VuaTIwN0YHdW5pMjA4MAd1bmkyMDgxB3VuaTIwODIHdW5pMjA4Mwd1bmkyMDg0B3VuaTIwODUHdW5pMjA4Ngd1bmkyMDg3B3VuaTIwODgHdW5pMjA4OQd1bmkyMDhBB3VuaTIwOEIHdW5pMjA4Qwd1bmkyMDhEB3VuaTIwOEUHdW5pMjBBMA1jb2xvbm1vbmV0YXJ5B3VuaTIwQTIEbGlyYQd1bmkyMEE1B3VuaTIwQTYHdW5pMjBBOQd1bmkyMEFBBGRvbmcERXVybwd1bmkyMEFEB3VuaTIwQUUHdW5pMjBCMAd1bmkyMEIxB3VuaTIwQjIHdW5pMjBCMwd1bmkyMEI0B3VuaTIwQjUHdW5pMjBCNgd1bmkyMEI3B3VuaTIwQjgHdW5pMjBCOQd1bmkyMEJBB3VuaTIwQkIHdW5pMjBCQwd1bmkyMEJEB3VuaTIwQkUHdW5pMjBCRgd1bmkyMTE3B3VuaTIxMzIHdW5pMjE0MQd1bmkyMTQ0B3VuaTIxNEIHdW5pMjE1MAd1bmkyMTUxCG9uZXRoaXJkCXR3b3RoaXJkcwd1bmkyMTU1B3VuaTIxNTYHdW5pMjE1Nwd1bmkyMTU5B3VuaTIxNUEJb25lZWlnaHRoDHRocmVlZWlnaHRocwtmaXZlZWlnaHRocwxzZXZlbmVpZ2h0aHMHdW5pMjE1Rgd1bmkyMTg5CWFycm93bGVmdAdhcnJvd3VwCmFycm93cmlnaHQJYXJyb3dkb3duCWFycm93Ym90aAd1bmkyMUM0B3VuaTIxQ0YNYXJyb3dkYmxyaWdodAxhcnJvd2RibGJvdGgHdW5pMjFGNQl1bml2ZXJzYWwHdW5pMjIwMQtleGlzdGVudGlhbAd1bmkyMjA0CGVtcHR5c2V0B2VsZW1lbnQKbm90ZWxlbWVudAhzdWNodGhhdAd1bmkyMjBDB3VuaTIyMTMHdW5pMjIxOQd1bmkyMjFCB3VuaTIyMUMMcHJvcG9ydGlvbmFsB3VuaTIyMjUKbG9naWNhbGFuZAlsb2dpY2Fsb3IMaW50ZXJzZWN0aW9uB3VuaTIyMkUJdGhlcmVmb3JlB3VuaTIyMzUHdW5pMjI1NAtlcXVpdmFsZW5jZQd1bmkyMjYyDHByb3BlcnN1YnNldA5wcm9wZXJzdXBlcnNldAlub3RzdWJzZXQHdW5pMjI4NQxyZWZsZXhzdWJzZXQOcmVmbGV4c3VwZXJzZXQHdW5pMjJBMgd1bmkyMkE0DXBlcnBlbmRpY3VsYXIHdW5pMjJBOAd1bmkyMkJCB3VuaTIyQkMHdW5pMjJCRAd1bmkyMkMzB3VuaTIyQzYHdW5pMjMwMAVob3VzZQd1bmkyMzE4B3VuaTIzMUEHdW5pMjMxQgppbnRlZ3JhbHRwCmludGVncmFsYnQHdW5pMjNDRgd1bmkyM0U5B3VuaTIzRUEHdW5pMjNFRAd1bmkyM0VFB3VuaTIzRUYHdW5pMjNGNAd1bmkyM0Y1B3VuaTIzRjYHdW5pMjNGNwd1bmkyM0Y4B3VuaTIzRjkHdW5pMjNGQQd1bmkyM0ZCB3VuaTIzRkMHdW5pMjNGRAhTRjEwMDAwMAhTRjExMDAwMAhTRjAxMDAwMAhTRjAzMDAwMAhTRjAyMDAwMAhTRjA0MDAwMAhTRjA4MDAwMAhTRjA5MDAwMAhTRjA2MDAwMAhTRjA3MDAwMAhTRjA1MDAwMAhTRjQzMDAwMAhTRjI0MDAwMAhTRjUxMDAwMAhTRjUyMDAwMAhTRjM5MDAwMAhTRjIyMDAwMAhTRjIxMDAwMAhTRjI1MDAwMAhTRjUwMDAwMAhTRjQ5MDAwMAhTRjM4MDAwMAhTRjI4MDAwMAhTRjI3MDAwMAhTRjI2MDAwMAhTRjM2MDAwMAhTRjM3MDAwMAhTRjQyMDAwMAhTRjE5MDAwMAhTRjIwMDAwMAhTRjIzMDAwMAhTRjQ3MDAwMAhTRjQ4MDAwMAhTRjQxMDAwMAhTRjQ1MDAwMAhTRjQ2MDAwMAhTRjQwMDAwMAhTRjU0MDAwMAhTRjUzMDAwMAhTRjQ0MDAwMAd1cGJsb2NrB2RuYmxvY2sFYmxvY2sHbGZibG9jawdydGJsb2NrB2x0c2hhZGUFc2hhZGUHZGtzaGFkZQlmaWxsZWRib3gGSDIyMDczB3RyaWFndXAHdW5pMjVCMwd1bmkyNUI2B3VuaTI1QjcHdHJpYWdkbgd1bmkyNUJEB3VuaTI1QzAHdW5pMjVDMQd1bmkyNUM2B3VuaTI1QzcGY2lyY2xlB3VuaTI1Q0UGSDE4NTMzCWludmJ1bGxldApvcGVuYnVsbGV0B3VuaTI2MDAHdW5pMjYwMQd1bmkyNjAyB3VuaTI2MDMHdW5pMjYwNAd1bmkyNjA1B3VuaTI2MDYHdW5pMjYwOAd1bmkyNjE0B3VuaTI2MjAHdW5pMjYzMAd1bmkyNjMxB3VuaTI2MzIHdW5pMjYzMwd1bmkyNjM0B3VuaTI2MzUHdW5pMjYzNgd1bmkyNjM3B3VuaTI2MzkJc21pbGVmYWNlDGludnNtaWxlZmFjZQd1bmkyNjNEBmZlbWFsZQRtYWxlBXNwYWRlB3VuaTI2NjEHdW5pMjY2MgRjbHViB3VuaTI2NjQFaGVhcnQHZGlhbW9uZAd1bmkyNjY3B3VuaTI2NjkLbXVzaWNhbG5vdGUObXVzaWNhbG5vdGVkYmwHdW5pMjY2Qwd1bmkyNjZEB3VuaTI2NkUHdW5pMjY2Rgd1bmkyNjgwB3VuaTI2ODEHdW5pMjY4Mgd1bmkyNjgzB3VuaTI2ODQHdW5pMjY4NQd1bmkyNjkwB3VuaTI2OTEHdW5pMjY5Mwd1bmkyNjk0B3VuaTI2OTcHdW5pMjZBMQd1bmkyNkE1B3VuaTI2QzQHdW5pMjZDOAd1bmkyNkNGB3VuaTI2RTgHdW5pMjcwMgd1bmkyNzA5B3VuaTI3MEUHdW5pMjcxNAd1bmkyNzE4B3VuaTI3NDQHdW5pMjc0Qwd1bmkyNzYzB3VuaTI3NjQHdW5pMjdEOAd1bmkyOTVEB3VuaTI5QzgHdW5pMkI1MAd1bmkyQjU4B3VuaTJCRUEHdW5pMkJFQgd1bmkyQzY1B3VuaTJDNjYHdW5pMkM2RAd1bmkyQzZGB3VuaTJDNzEHdW5pMkQwMAd1bmkyRDAxB3VuaTJEMDIHdW5pMkQwMwd1bmkyRDA0B3VuaTJEMDUHdW5pMkQwNgd1bmkyRDA3B3VuaTJEMDgHdW5pMkQwOQd1bmkyRDBBB3VuaTJEMEIHdW5pMkQwQwd1bmkyRDBEB3VuaTJEMEUHdW5pMkQwRgd1bmkyRDEwB3VuaTJEMTEHdW5pMkQxMgd1bmkyRDEzB3VuaTJEMTQHdW5pMkQxNQd1bmkyRDE2B3VuaTJEMTcHdW5pMkQxOAd1bmkyRDE5B3VuaTJEMUEHdW5pMkQxQgd1bmkyRDFDB3VuaTJEMUQHdW5pMkQxRQd1bmkyRDFGB3VuaTJEMjAHdW5pMkQyMQd1bmkyRDIyB3VuaTJEMjMHdW5pMkQyNAd1bmkyRDI1B3VuaTJFMTgHdW5pMkUyRQd1bmkyRTM1B3VuaTJFMzgHdW5pMkU0MQd1bmkyRTRCB3VuaTMwMTIHdW5pMzEyNQd1bmlBNzI2B3VuaUE3MjcHdW5pQTcyOAd1bmlBNzI5B3VuaUE3MzAHdW5pQTczMQd1bmlBNzM5B3VuaUE3M0IHdW5pQTc1QQd1bmlBNzVCB3VuaUE3NzkHdW5pQTc4MAd1bmlBNzgxB3VuaUE3QTgHdW5pQTdBOQd1bmlBN0FGB3VuaUE3QjAHdW5pRkIwMAd1bmlGQjAxB3VuaUZCMDIHdW5pRkIwMwd1bmlGQjA1B3VuaUZCMUQHdW5pRkIxRgd1bmlGQjJCB3VuaUZCMzEHdW5pRkIzNQd1bmlGQjNCB3VuaUZCNDQHdW5pRkI0QQd1bmlGQjRCB3VuaUZCNEMHdW5pRkI0RQd1bmlGRjBCB3VuaUZGRkQAAAAB//8AAgABAAAADAAAABAAAAACAAAABAAAAAIAAAAAAAEAAAAA39bLMQAAAAB8N5wbAAAAAOCWoJY=");var Yb="data:image/webp;base64,UklGRmYKAABXRUJQVlA4TFoKAAAvVAEgEH+itpGk5t7hof9G/wgJaYGB27ZxnKTN0V3//+zEsG0kRbO8+9R/m8xAIAjR/7NYICGA8McPwiD007LSTzpfz8L0E+bVmncrItVRPTuWMHugG3p21IkVMVwtZ660fsWKGKkVtMB+40u1Tt4kLPlSkcaLuJw465MshJdQRC2nLvokdeYpIlykia3evJJRMiMLakNWZEV2lw3ZXA5kd3UgB3JJTsZR0LYNk/CH3e5AiIgJIE02fqBspe5qe9tGCpjeE0koEAwCU9LDH2massLCTe6W7/921iQ/8hPH5nZ+Ef13BElS28zeFShWsK0Ah8wblgLAVSP0Dn6UIikqVjRoqJb64HH/a9XJZLTR3c+ZiP47lGS1bQ6TShwkVJBSPmBH1eXxAfM77R+d74C6OGA+qL0zPdfHzBd1cK3zfeaP2r3UuofaAfNL7UkTT5lv6mg9btc7oQsp9dFk30Oh6yvmo5xfeCknwUs59FMO/quPwRQiuvtnUiso2ecfyZorybSpciVi/GDM8n8AHyUFPE2mKj8wSobTIxxUhY3G6r6b/wZEFjmqrPj0gkehZMVHIfMBzOANRjMKtxXiyyBzp+sO6V2mqtvZcmEN51ZCHrSSduDVppXNVzOAibgys1W8ri7MxzX+daaouxUpxWC+3v6CInJaCb3gzW1c7dvqOMmXTFWdbKItXz5qk3y1ZgEg40aiNItImykobGc0SrpEvlJDN5MRuAxckWJ1zCmYX0parYC3x8Mj55XcYI2WopvdFOANlCSS1TpRUkNfmHWdKams2mdTWfUPg1yNXGRK8kIGDJFsCxSLFImSDHF58x8qqRQJ9FJGbMoohM2QgQ040x8ikq+wpgdAtrXpCnSqGkZ4TBSv0MMZfxgj+YTSKhE9h2umZAYFGKCHIzr6ddDNDJa3nsE8Y7Dp/BKEkGKsZoQ9XPKZxmyFRCMVLquSfBtoMjt4HWAMacCQz19Wezqe7VEpQWI127mPVjJu5Fbv1dgoa8jcE5zhWM9yYBwlYAVMlBRwLrWdwiIyKDHQQzJsOY44xUoqs0m2gTlvxa/dqO3iYhNJCOaiXh46qf4eBOnmbq2U1BQKSG4R2mDVv1oUh4LIB6N1NA3+LeSsSp7o5kKyOVHZngsCo92Kh99QM5AxpF1cGER0o8kkpdVSs42SHPDZyBwPs5IK8PkCzoGMt9IpYSefvYyEIRobxGolw7VBxDGyP1ViVkClpAXUoNJtKsunDpCv0CkdCoPpEiQSjNMpqfcimTWbDmYWS3LoCm/T7tVBL6lqFqfwRAlXhuttP2fegiuS14lCkMKwbKcDSGa4wPI7bTjbTodgJRhVO+/joySpW1PYA7iVEdZGEsXj9UFVrljHItlChK6raiXgAdtEW2s3CFzXJTO+kuvgSFSF2JVI4SSDtEoYycnBwIUd9krOQXVJEBXB/vZmNBW+Oc7V14d1rOx2/6kLaVdkXjSF1PbGQVuI1IPl7YAWBFvJrZpl4wM9WTUckubNZTM4bEyBFMlUM6CtxtNzk8nK+UNlYgl6qZmz21uccXP87KRBq0IYbBD3MkSAlGt+EWUsEVc+Bg+gYs3ITy0mtWpROlX9/YRwAxVvJE5Ujf8HCAI6JT1seQbj6Zwo1D2A3mg2/0PT2opCEPH1PTF0+k7kjdrmdMfLlapFrfuAZ5qtacZdc0i+JKqZApgcb3H6y5VeYSB/wlJOlwmWEN0oVgK1Gy9bm3oFa7Ie28BbU5sDWQHcI3/a1vQbA2jeNfmEiYa2UA6caTryhG3NfGWkJRnRdG0pgZU8yHUPW5rBClNjWyjVb8iLXGy0YVjeZ2GKSmOI+YZsGvpnHGwSPd5nYIkKDUyBZs4Ayg3B+xZgUn6ZnjHzo/GWFS5jWwRAsCzMnUrmN5XXPSonz0gDh0zhEkEPGk/puwXHpIFtdU/Nv31WfoccQGJPGbhIB4UpgNLvqHnxiTIgUHoOuUVhNMuL5fEt97TmxR8mt0bLtZLIxY7QYrbs0Mgjngj3OPpye4Xy8p0FLkNjzIoZXtohRVMDf7jZt6atu7y3kQ4x0b4ywaVrBjgcQ/d11tD15tE1BxYvR7r8uHMU69BXhqjMmCnAT6KAyhysIevdI0USjOhcew5LTGo7qlS5IgIn9k/W7FAPSc/FGJEFs0IoMXEZ9Hsha+jqI+W56DaID8c2vBRqNU4JnNgTZs1xOjXPmL+jLz+bxRemN3tGW5MnzJCMKJeiOYDTTKXEceGx3PdpEweoHLgVM5WPmO0C3eJNUg1LxY/Nld5jaIq1DE4tbgE2ayjtoWhK24VxStwfwyugyR0cqZWEewzNcWbqmmDjL+qJ3Z5D9BmQpDwqMSa6jOZ32me6CxzH4BMcxCUQOECXOCBKesiymEqMz5oeYWYIjhHDlenOMYWaInDA7Tsz+bga2rCmZ98YNKb1rwGuJcdgv6a8Q56/u+MpLVjTt2hhxNf6JIiRiXOGgUObfXNclOo3a4nQncPd9BHVxFOMzcpbCu1KGQp7dYmQW+ViuVJi+xIHbDfoktnuY3EJ5BWKp5ibI17lmscPHHY+KyWiPa3hN79ZdHiLhTnhD7HqLwyF5z3YN4xEqJKO2xVCNG3fRRYhuZQBSaKJ/ryEDtGB81Og5hlj8tDLKcG1RRdzPTdZpPU24Dv5LDE9nyipqcltuhZo2p6XN3mM2iq+PCg7u1OvRRpHlBtKCnwx0ATZywdBxKnIYrglBz7EsO3Y1l4cHpHWelcD1ZheZZGZ4gdGyEQp1abHPxWk9p3LhGrE/I2h84phE/VhTLR571myxbYhdacnuh6obmSm9ksYpTEvGeGAK7644OdBNR7j2d8UudEXBPUbyRnhk99UjLBwqEiP2vwA6WPXK3V4BsCCQIFiOE4J9DIsaQw+dyvF1aiNm8cezr3oAOP/MGxcMwzUd7ZxuhH4YVWEj2weFJtlz4ItuiJcUYUTTYxY4bjcMBt3yCZ6gO5/EEJuoekGTpvG7jX0F9q5n/wZGETBOgHBxh7gHZsRpLg3fwYGzTVcgGSzuD6IiR0g25TRciHwljFoWOQSlD1dZIknRPfS8FTYnijSljGILXQJ6SOnzYT1GeTJHtFougYelC+1S3OHwi2kwW2cK9/0tYTCrxT/5PAaoFh5V50LvMRoLYnaCzaO8QSPvOt7FRRqkaAD+VhNXYBss5A/icUeuwxKtfC67YmlLrbQCcg273DnIX14NnBeAfhJWM5eCXM98FT7qhYnINtMoXXgT+IT5mH0NCa/oDRySh0Hmv+QQpK6U+IlJX3e83sLDTgm2u567wlVuhlcpNmzEksJX459P5xf3/qNIQkfuBqaMzr0BKoyZ4jRplq1iSXH5MUsbi/1w3o7eRz/FW5hXXJPc+Yt3kDEYzfIS/br6f2Vk/95g+VInrQ/R/HiJf+DJXhmPSmzUE4PnvqPbf/7z19EnPtpp2I8tfs7ntpRIz/tUpS3dn7LQ5NDL+1Q3O61r3Z9TzHPdNUOvZH9K6Djm/se2fFNIHO873tjjs53DHV94W9yDDcM";var Qb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AYht+malUqDnYQcchQnSyIiugmVSyChdJWaNXB5NI/aNKQpLg4Cq4FB38Wqw4uzro6uAqC4A+Iq4uToouU+F1SaBHjHcc9vPe9L3ffAUK9zFSzYxxQNctIxqJiJrsqBl7RRbMHs5iRmKnHU4tpeI6ve/j4fhfhWd51f44+JWcywCcSzzHdsIg3iKc3LZ3zPnGIFSWF+Jx4zKALEj9yXXb5jXPBYYFnhox0cp44RCwW2lhuY1Y0VOIp4rCiapQvZFxWOG9xVstV1rwnf2Ewp62kuE5rGDEsIY4ERMioooQyLERo10gxkaTzqId/yPEnyCWTqwRGjgVUoEJy/OB/8Lu3Zn5ywk0KRoHOF9v+GAECu0CjZtvfx7bdOAH8z8CV1vJX6sDMJ+m1lhY+Avq3gYvrlibvAZc7wOCTLhmSI/lpCfk88H5G35QFBm6B3jW3b81znD4AaerV8g1wcAiMFih73ePd3e19+7em2b8f4B1y0yv9YvYAAAAGYktHRADZAKIAhTqIWPYAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfnBgYJOi0CGZJlAAAAGXRFWHRDb21tZW50AENyZWF0ZWQgd2l0aCBHSU1QV4EOFwAAAD9JREFUCNd1jcEJADAIA1NXyP5j+LK7pR8tIhgQNBciAECkRGruJlJwRwGkROp0Y8ruAr4f+acmZltsoAf6/QADBCX4xA+nZQAAAABJRU5ErkJggg==";function e0(n,e,t){let i=n.slice();return i[9]=e[t],i}s(e0,"get_each_context_1");function t0(n,e,t){let i=n.slice();return i[9]=e[t],i}s(t0,"get_each_context");var x7=s(n=>({}),"get_default_slot_changes"),n0=s(n=>({id:n[4]}),"get_default_slot_context");function k7(n){let e;return{c(){e=P("i"),T(e,"class","fa fa-question dialog_form_description dialog-form-description svelte-1ph6mp"),Ge(e,"visibility","hidden")},m(t,i){L(t,e,i)},p:ue,d(t){t&&F(e)}}}s(k7,"create_else_block");function E7(n){let e,t,i;return{c(){e=P("i"),T(e,"class","fa fa-question dialog_form_description dialog-form-description svelte-1ph6mp")},m(r,a){L(r,e,a),t||(i=Le(e,"click",n[5]),t=!0)},p:ue,d(r){r&&F(e),t=!1,i()}}}s(E7,"create_if_block_2");function T7(n){let e,t,i,r,a=n[1].split(` +`),o=[];for(let l=0;l{"label"in p&&t(6,a=p.label),"tooltip"in p&&t(0,o=p.tooltip),"warning_text"in p&&t(1,l=p.warning_text),"error_text"in p&&t(2,u=p.error_text),"onReset"in p&&t(3,c=p.onReset),"$$scope"in p&&t(7,r=p.$$scope)},n.$$.update=()=>{if(n.$$.dirty&68)e:u&&(Pr.get()[a]=u)},[o,l,u,c,d,m,a,r,i]}s(S7,"instance");var uu=class extends Be{constructor(e){super(),De(this,e,S7,A7,Oe,{label:6,tooltip:0,warning_text:1,error_text:2,onReset:3})}};s(uu,"BaseDialogItem");var jn=uu;(()=>{let n=Blockbench.addCSS(".base_dialog_item.svelte-1ph6mp{display:flex;flex-direction:row;justify-content:space-between}.slot_container.svelte-1ph6mp{flex-grow:1}.warning_text.svelte-1ph6mp{display:flex;align-items:center;color:var(--color-warning);font-family:var(--font-code);font-size:0.8em}.warning_lines.svelte-1ph6mp{display:flex;flex-direction:column}.error_text.svelte-1ph6mp{display:flex;align-items:center;color:var(--color-error);font-family:var(--font-code);font-size:0.8em}.error_lines.svelte-1ph6mp{display:flex;flex-direction:column}.text_icon.svelte-1ph6mp{margin-right:8px}.dialog-form-description.svelte-1ph6mp{padding-top:12px}.reset-button.svelte-1ph6mp{padding-top:12px;margin-left:4px}.reset-button.svelte-1ph6mp:hover{color:var(--color-error);transition:unset}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();function j7(n){let e,t,i,r,a,o,l,u,c,d;return{c(){e=P("div"),t=P("label"),i=Re(n[0]),a=G(),o=P("input"),T(t,"class","name_space_left"),T(t,"for",r=n[12]),T(o,"type","text"),T(o,"class","dark_bordered half focusable_input svelte-oj6m6h"),T(o,"id",l=n[12]),o.disabled=n[2],T(o,"style",u=n[2]?"color: var(--color-subtle_text);":""),T(e,"class","dialog_bar form_bar")},m(m,p){L(m,e,p),N(e,t),N(t,i),N(e,a),N(e,o),bt(o,n[3]),c||(d=[Le(o,"input",n[11]),Le(o,"change",n[6])],c=!0)},p(m,p){p&1&&ot(i,m[0]),p&4096&&r!==(r=m[12])&&T(t,"for",r),p&4096&&l!==(l=m[12])&&T(o,"id",l),p&4&&(o.disabled=m[2]),p&4&&u!==(u=m[2]?"color: var(--color-subtle_text);":"")&&T(o,"style",u),p&8&&o.value!==m[3]&&bt(o,m[3])},d(m){m&&F(e),c=!1,Lt(d)}}}s(j7,"create_default_slot");function I7(n){let e,t;return e=new jn({props:{label:n[0],tooltip:n[1],warning_text:n[4],error_text:n[5],onReset:n[7],$$slots:{default:[j7,({id:i})=>({12:i}),({id:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){_e(e.$$.fragment)},m(i,r){me(e,i,r),t=!0},p(i,[r]){let a={};r&1&&(a.label=i[0]),r&2&&(a.tooltip=i[1]),r&16&&(a.warning_text=i[4]),r&32&&(a.error_text=i[5]),r&12301&&(a.$$scope={dirty:r,ctx:i}),e.$set(a)},i(i){t||(q(e.$$.fragment,i),t=!0)},o(i){Z(e.$$.fragment,i),t=!1},d(i){de(e,i)}}}s(I7,"create_fragment");function O7(n,e,t){let{label:i}=e,{tooltip:r=""}=e,{value:a}=e,{defaultValue:o}=e,{disabled:l=!1}=e,{valueChecker:u=void 0}=e,c=a.get(),d="",m="";function p(){if(u){let g=u(c);g.type==="error"?t(5,m=g.message):t(5,m=""),g.type==="warning"?t(4,d=g.message):t(4,d="")}a.set(c),t(3,c=a.get())}s(p,"onValueChange");function f(){t(3,c=o),p()}s(f,"onReset"),p();function _(){c=this.value,t(3,c)}return s(_,"input_input_handler"),n.$$set=g=>{"label"in g&&t(0,i=g.label),"tooltip"in g&&t(1,r=g.tooltip),"value"in g&&t(8,a=g.value),"defaultValue"in g&&t(9,o=g.defaultValue),"disabled"in g&&t(2,l=g.disabled),"valueChecker"in g&&t(10,u=g.valueChecker)},[i,r,l,c,d,m,p,f,a,o,u,_]}s(O7,"instance");var du=class extends Be{constructor(e){super(),De(this,e,O7,I7,Oe,{label:0,tooltip:1,value:8,defaultValue:9,disabled:2,valueChecker:10})}};s(du,"LineInput");var en=du;(()=>{let n=Blockbench.addCSS("input.svelte-oj6m6h{font-family:var(--font-code)}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();function N7(n){let e,t,i,r,a,o,l,u,c,d,m,p;return{c(){e=P("div"),t=P("label"),i=Re(n[0]),a=G(),o=P("div"),l=P("input"),c=G(),d=P("div"),d.innerHTML='code',T(t,"class","name_space_left"),T(t,"for",r=n[15]),T(l,"id",u=n[15]),T(l,"class","dark_bordered focusable_input"),T(l,"inputmode","decimal"),T(d,"class","tool numaric_input_slider"),T(o,"class","numeric_input"),T(e,"class","dialog_bar form_bar")},m(f,_){L(f,e,_),N(e,t),N(t,i),N(e,a),N(e,o),N(o,l),n[11](l),bt(l,n[5]),N(o,c),N(o,d),n[13](d),m||(p=Le(l,"input",n[12]),m=!0)},p(f,_){_&1&&ot(i,f[0]),_&32768&&r!==(r=f[15])&&T(t,"for",r),_&32768&&u!==(u=f[15])&&T(l,"id",u),_&32&&l.value!==f[5]&&bt(l,f[5])},d(f){f&&F(e),n[11](null),n[13](null),m=!1,p()}}}s(N7,"create_default_slot");function B7(n){let e,t;return e=new jn({props:{label:n[0],tooltip:n[1],onReset:n[6],$$slots:{default:[N7,({id:i})=>({15:i}),({id:i})=>i?32768:0]},$$scope:{ctx:n}}}),{c(){_e(e.$$.fragment)},m(i,r){me(e,i,r),t=!0},p(i,[r]){let a={};r&1&&(a.label=i[0]),r&2&&(a.tooltip=i[1]),r&98361&&(a.$$scope={dirty:r,ctx:i}),e.$set(a)},i(i){t||(q(e.$$.fragment,i),t=!0)},o(i){Z(e.$$.fragment,i),t=!1},d(i){de(e,i)}}}s(B7,"create_fragment");function R7(n,e,t){let i,r=ue,a=s(()=>(r(),r=ze(u,b=>t(5,i=b)),u),"$$subscribe_value");n.$$.on_destroy.push(()=>r());let{label:o}=e,{tooltip:l=""}=e,{value:u}=e;a();let{defaultValue:c}=e,{min:d=void 0}=e,{max:m=void 0}=e,{step:p=void 0}=e,f=new Molang,_,g;requestAnimationFrame(()=>{addEventListeners(g,"mousedown touchstart",b=>{convertTouchEvent(b);let x=0;function E(j){convertTouchEvent(j);let S=Math.trunc((j.clientX-b.clientX)/10)*(p||1);S!=x&&(u.set(Math.clamp(u.get()+(S-x),d!==void 0?d:-1/0,m!==void 0?m:1/0)||0),x=S)}s(E,"move");function C(j){removeEventListeners(document,"mousemove touchmove",E,null),removeEventListeners(document,"mouseup touchend",C,null)}s(C,"stop"),addEventListeners(document,"mousemove touchmove",E),addEventListeners(document,"mouseup touchend",C)}),addEventListeners(_,"focusout dblclick",()=>{u.set(Math.clamp(f.parse(u.get()),d!==void 0?d:-1/0,m!==void 0?m:1/0)||0)})});function h(){u.set(c)}s(h,"onReset");function v(b){le[b?"unshift":"push"](()=>{_=b,t(3,_)})}s(v,"input_1_binding");function y(){i=this.value,u.set(i)}s(y,"input_1_input_handler");function k(b){le[b?"unshift":"push"](()=>{g=b,t(4,g)})}return s(k,"div0_binding"),n.$$set=b=>{"label"in b&&t(0,o=b.label),"tooltip"in b&&t(1,l=b.tooltip),"value"in b&&a(t(2,u=b.value)),"defaultValue"in b&&t(7,c=b.defaultValue),"min"in b&&t(8,d=b.min),"max"in b&&t(9,m=b.max),"step"in b&&t(10,p=b.step)},[o,l,u,_,g,i,h,c,d,m,p,v,y,k]}s(R7,"instance");var fu=class extends Be{constructor(e){super(),De(this,e,R7,B7,Oe,{label:0,tooltip:1,value:2,defaultValue:7,min:8,max:9,step:10})}};s(fu,"NumberSlider");var Ot=fu;function wl(n){return n*n*n}s(wl,"cubicIn");function Em(n){let e=n-1;return e*e*e+1}s(Em,"cubicOut");function xl(n,{delay:e=0,duration:t=400,easing:i=Fs}={}){let r=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:a=>`opacity: ${a*r}`}}s(xl,"fade");function kl(n,{from:e,to:t},i={}){let r=getComputedStyle(n),a=r.transform==="none"?"":r.transform,[o,l]=r.transformOrigin.split(" ").map(parseFloat),u=e.left+e.width*o/t.width-(t.left+o),c=e.top+e.height*l/t.height-(t.top+l),{delay:d=0,duration:m=s(f=>Math.sqrt(f)*120,"duration"),easing:p=Em}=i;return{delay:d,duration:Rn(m)?m(Math.sqrt(u*u+c*c)):m,easing:p,css:(f,_)=>{let g=_*u,h=_*c,v=f+_*e.width/t.width,y=f+_*e.height/t.height;return`transform: ${a} translate(${g}px, ${h}px) scale(${v}, ${y});`}}}s(kl,"flip");function a0(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}s(a0,"ownKeys");function _u(n){for(var e=1;e=0)&&(t[r]=n[r]);return t}s(D7,"_objectWithoutPropertiesLoose");function M7(n,e){if(n==null)return{};var t=D7(n,e),i,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}s(M7,"_objectWithoutProperties");function F7(n,e){return P7(n)||z7(n,e)||Rm(n,e)||U7()}s(F7,"_slicedToArray");function Wi(n){return L7(n)||V7(n)||Rm(n)||G7()}s(Wi,"_toConsumableArray");function L7(n){if(Array.isArray(n))return Cm(n)}s(L7,"_arrayWithoutHoles");function P7(n){if(Array.isArray(n))return n}s(P7,"_arrayWithHoles");function V7(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}s(V7,"_iterableToArray");function z7(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i=[],r=!0,a=!1,o,l;try{for(t=t.call(n);!(r=(o=t.next()).done)&&(i.push(o.value),!(e&&i.length===e));r=!0);}catch(u){a=!0,l=u}finally{try{!r&&t.return!=null&&t.return()}finally{if(a)throw l}}return i}}s(z7,"_iterableToArrayLimit");function Rm(n,e){if(n){if(typeof n=="string")return Cm(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Cm(n,e)}}s(Rm,"_unsupportedIterableToArray");function Cm(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t=n.length?{done:!0}:{done:!1,value:n[i++]}},e:function(u){throw u},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,l;return{s:function(){t=t.call(n)},n:function(){var u=t.next();return a=u.done,u},e:function(u){o=!0,l=u},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw l}}}}s(Il,"_createForOfIteratorHelper");var J7="finalize",H7="consider";function Xo(n,e,t){n.dispatchEvent(new CustomEvent(J7,{detail:{items:e,info:t}}))}s(Xo,"dispatchFinalizeEvent");function ba(n,e,t){n.dispatchEvent(new CustomEvent(H7,{detail:{items:e,info:t}}))}s(ba,"dispatchConsiderEvent");var xu="draggedEntered",Ol="draggedLeft",ku="draggedOverIndex",Dm="draggedLeftDocument",gu={LEFT_FOR_ANOTHER:"leftForAnother",OUTSIDE_OF_ANY:"outsideOfAny"};function $7(n,e,t){n.dispatchEvent(new CustomEvent(xu,{detail:{indexObj:e,draggedEl:t}}))}s($7,"dispatchDraggedElementEnteredContainer");function q7(n,e,t){n.dispatchEvent(new CustomEvent(Ol,{detail:{draggedEl:e,type:gu.LEFT_FOR_ANOTHER,theOtherDz:t}}))}s(q7,"dispatchDraggedElementLeftContainerForAnother");function K7(n,e){n.dispatchEvent(new CustomEvent(Ol,{detail:{draggedEl:e,type:gu.OUTSIDE_OF_ANY}}))}s(K7,"dispatchDraggedElementLeftContainerForNone");function W7(n,e,t){n.dispatchEvent(new CustomEvent(ku,{detail:{indexObj:e,draggedEl:t}}))}s(W7,"dispatchDraggedElementIsOverIndex");function Z7(n){window.dispatchEvent(new CustomEvent(Dm,{detail:{draggedEl:n}}))}s(Z7,"dispatchDraggedLeftDocument");var pi={DRAG_STARTED:"dragStarted",DRAGGED_ENTERED:xu,DRAGGED_ENTERED_ANOTHER:"dragEnteredAnother",DRAGGED_OVER_INDEX:ku,DRAGGED_LEFT:Ol,DRAGGED_LEFT_ALL:"draggedLeftAll",DROPPED_INTO_ZONE:"droppedIntoZone",DROPPED_INTO_ANOTHER:"droppedIntoAnother",DROPPED_OUTSIDE_OF_ANY:"droppedOutsideOfAny",DRAG_STOPPED:"dragStopped"},vi={POINTER:"pointer",KEYBOARD:"keyboard"},dr="isDndShadowItem",Mm="data-is-dnd-shadow-item-internal",X7="data-is-dnd-shadow-item-hint",Y7="id:dnd-shadow-placeholder-0000",Q7="dnd-action-dragged-el",Pn="id",Am=0;function b0(){Am++}s(b0,"incrementActiveDropZoneCount");function v0(){if(Am===0)throw new Error("Bug! trying to decrement when there are no dropzones");Am--}s(v0,"decrementActiveDropZoneCount");var Fm=typeof window>"u",gt=s(function(){},"printDebug");function Sm(n){var e,t=n.getBoundingClientRect(),i=getComputedStyle(n),r=i.transform;if(r){var a,o,l,u;if(r.startsWith("matrix3d("))e=r.slice(9,-1).split(/, /),a=+e[0],o=+e[5],l=+e[12],u=+e[13];else if(r.startsWith("matrix("))e=r.slice(7,-1).split(/, /),a=+e[0],o=+e[3],l=+e[4],u=+e[5];else return t;var c=i.transformOrigin,d=t.x-l-(1-a)*parseFloat(c),m=t.y-u-(1-o)*parseFloat(c.slice(c.indexOf(" ")+1)),p=a?t.width/a:n.offsetWidth,f=o?t.height/o:n.offsetHeight;return{x:d,y:m,width:p,height:f,top:m,right:d+p,bottom:m+f,left:d}}else return t}s(Sm,"getBoundingRectNoTransforms");function y0(n){var e=Sm(n);return{top:e.top+window.scrollY,bottom:e.bottom+window.scrollY,left:e.left+window.scrollX,right:e.right+window.scrollX}}s(y0,"getAbsoluteRectNoTransforms");function w0(n){var e=n.getBoundingClientRect();return{top:e.top+window.scrollY,bottom:e.bottom+window.scrollY,left:e.left+window.scrollX,right:e.right+window.scrollX}}s(w0,"getAbsoluteRect");function x0(n){return{x:(n.left+n.right)/2,y:(n.top+n.bottom)/2}}s(x0,"findCenter");function eV(n,e){return Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2))}s(eV,"calcDistance");function Eu(n,e){return n.y<=e.bottom&&n.y>=e.top&&n.x>=e.left&&n.x<=e.right}s(Eu,"isPointInsideRect");function Al(n){return x0(w0(n))}s(Al,"findCenterOfElement");function o0(n,e){var t=Al(n),i=y0(e);return Eu(t,i)}s(o0,"isCenterOfAInsideB");function tV(n,e){var t=Al(n),i=Al(e);return eV(t,i)}s(tV,"calcDistanceBetweenCenters");function nV(n){var e=w0(n);return e.right<0||e.left>document.documentElement.scrollWidth||e.bottom<0||e.top>document.documentElement.scrollHeight}s(nV,"isElementOffDocument");var Ko;function Lm(){gt(function(){return"resetting indexes cache"}),Ko=new Map}s(Lm,"resetIndexesCache");Lm();function iV(n){var e=Array.from(n.children).findIndex(function(t){return t.getAttribute(Mm)});if(e>=0)return Ko.has(n)||Ko.set(n,new Map),Ko.get(n).set(e,y0(n.children[e])),e}s(iV,"cacheShadowRect");function rV(n,e){if(!o0(n,e))return null;var t=e.children;if(t.length===0)return{index:0,isProximityBased:!0};for(var i=iV(e),r=0;r1&&arguments[1]!==void 0?arguments[1]:0;return n.parentElement?k0(n.parentElement,e+1):e-1}s(k0,"_getDepth");function aV(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(var t in n)if(!{}.hasOwnProperty.call(e,t)||e[t]!==n[t])return!1;return!0}s(aV,"areObjectsShallowEqual");function oV(n,e){if(n.length!==e.length)return!1;for(var t=0;t2&&arguments[2]!==void 0?arguments[2]:sV,i=arguments.length>3?arguments[3]:void 0,r,a,o=!1,l,u=Array.from(e).sort(function(d,m){return hu(m)-hu(d)});function c(){var d=Al(n),m=i.multiScrollIfNeeded();if(!m&&l&&Math.abs(l.x-d.x)o.clientHeight&&(l.bottomo.clientWidth&&(l.right0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0;gt(function(){return"creating multi-scroller"});var t=pV(n),i=Array.from(t).sort(function(l,u){return hu(u)-hu(l)}),r=uV(),a=r.scrollIfNeeded;function o(){var l=e();if(!l||!i)return!1;for(var u=i.filter(function(m){return Eu(l,m.getBoundingClientRect())||m===document.scrollingElement}),c=0;c0?o:function(){return!1}}}s(fV,"createMultiScroller");function mV(n){if(!n)return[];for(var e=[],t=n;t;){var i=window.getComputedStyle(t),r=i.overflow;r.split(" ").some(function(a){return a.includes("auto")||a.includes("scroll")})&&e.push(t),t=t.parentElement}return e}s(mV,"findScrollableParents");function pV(n){var e=new Set,t=Il(n),i;try{for(t.s();!(i=t.n()).done;){var r=i.value;mV(r).forEach(function(a){return e.add(a)})}}catch(a){t.e(a)}finally{t.f()}return(document.scrollingElement.scrollHeight>document.scrollingElement.clientHeight||document.scrollingElement.scrollWidth>document.scrollingElement.clientHeight)&&e.add(document.scrollingElement),e}s(pV,"findRelevantScrollContainers");function _V(n){var e=n.cloneNode(!0),t=[],i=n.tagName==="SELECT",r=i?[n]:Wi(n.querySelectorAll("select")),a=Il(r),o;try{for(a.s();!(o=a.n()).done;){var l=o.value;t.push(l.value)}}catch(k){a.e(k)}finally{a.f()}if(r.length>0)for(var u=i?[e]:Wi(e.querySelectorAll("select")),c=0;c0)for(var g=f?[e]:Wi(e.querySelectorAll("canvas")),h=0;h1&&arguments[1]!==void 0?arguments[1]:function(){},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){return[]};n.forEach(function(i){var r=e(i);Object.keys(r).forEach(function(a){i.style[a]=r[a]}),t(i).forEach(function(a){return i.classList.add(a)})})}s(pu,"styleActiveDropZones");function bu(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){return[]};n.forEach(function(i){var r=e(i);Object.keys(r).forEach(function(a){i.style[a]=""}),t(i).forEach(function(a){return i.classList.contains(a)&&i.classList.remove(a)})})}s(bu,"styleInactiveDropZones");function EV(n){var e=n.style.minHeight;n.style.minHeight=window.getComputedStyle(n).getPropertyValue("height");var t=n.style.minWidth;return n.style.minWidth=window.getComputedStyle(n).getPropertyValue("width"),s(function(){n.style.minHeight=e,n.style.minWidth=t},"undo")}s(EV,"preventShrinking");var TV="--any--",CV=100,AV=20,l0=3,c0={outline:"rgba(255, 255, 102, 0.7) solid 2px"},u0="data-is-dnd-original-dragged-item",sr,Xn,bi,Tu,yn,Cu,ha,Zn,_a,Oi,Ya=!1,Pm=!1,Vm,Nl=!1,Tl=[],ur=new Map,On=new Map,Tm=new WeakMap;function SV(n,e){gt(function(){return"registering drop-zone if absent"}),ur.has(e)||ur.set(e,new Set),ur.get(e).has(n)||(ur.get(e).add(n),b0())}s(SV,"registerDropZone");function d0(n,e){ur.get(e).delete(n),v0(),ur.get(e).size===0&&ur.delete(e)}s(d0,"unregisterDropZone");function jV(){gt(function(){return"watching dragged element"});var n=ur.get(Tu),e=Il(n),t;try{for(e.s();!(t=e.n()).done;){var i=t.value;i.addEventListener(xu,A0),i.addEventListener(Ol,S0),i.addEventListener(ku,j0)}}catch(l){e.e(l)}finally{e.f()}window.addEventListener(Dm,Yo);var r=Math.max.apply(Math,Wi(Array.from(n.keys()).map(function(l){return On.get(l).dropAnimationDurationMs}))),a=r===0?AV:Math.max(r,CV),o=fV(n,function(){return Oi});lV(Xn,n,a*1.07,o)}s(jV,"watchDraggedElement");function IV(){gt(function(){return"unwatching dragged element"});var n=ur.get(Tu),e=Il(n),t;try{for(e.s();!(t=e.n()).done;){var i=t.value;i.removeEventListener(xu,A0),i.removeEventListener(Ol,S0),i.removeEventListener(ku,j0)}}catch(r){e.e(r)}finally{e.f()}window.removeEventListener(Dm,Yo),cV()}s(IV,"unWatchDraggedElement");function Au(n){return n.findIndex(function(e){return!!e[dr]})}s(Au,"findShadowElementIdx");function OV(n){var e;return _u(_u({},n),{},(e={},Zo(e,dr,!0),Zo(e,Pn,Y7),e))}s(OV,"createShadowElData");function A0(n){gt(function(){return["dragged entered",n.currentTarget,n.detail]});var e=On.get(n.currentTarget),t=e.items,i=e.dropFromOthersDisabled;if(i&&n.currentTarget!==yn){gt(function(){return"ignoring dragged entered because drop is currently disabled"});return}if(Nl=!1,t=t.filter(function(d){return d[Pn]!==ha[Pn]}),gt(function(){return"dragged entered items ".concat(Br(t))}),yn!==n.currentTarget){var r=On.get(yn).items,a=r.filter(function(d){return!d[dr]});ba(yn,a,{trigger:pi.DRAGGED_ENTERED_ANOTHER,id:bi[Pn],source:vi.POINTER})}var o=n.detail.indexObj,l=o.index,u=o.isProximityBased,c=u&&l===n.currentTarget.children.length-1?l+1:l;Zn=n.currentTarget,t.splice(c,0,ha),ba(n.currentTarget,t,{trigger:pi.DRAGGED_ENTERED,id:bi[Pn],source:vi.POINTER})}s(A0,"handleDraggedEntered");function S0(n){if(Ya){gt(function(){return["dragged left",n.currentTarget,n.detail]});var e=On.get(n.currentTarget),t=e.items,i=e.dropFromOthersDisabled;if(i&&n.currentTarget!==yn&&n.currentTarget!==Zn){gt(function(){return"drop is currently disabled"});return}var r=Wi(t),a=Au(r);a!==-1&&r.splice(a,1);var o=Zn;Zn=void 0;var l=n.detail,u=l.type,c=l.theOtherDz;if(u===gu.OUTSIDE_OF_ANY||u===gu.LEFT_FOR_ANOTHER&&c!==yn&&On.get(c).dropFromOthersDisabled){gt(function(){return"dragged left all, putting shadow element back in the origin dz"}),Nl=!0,Zn=yn;var d=o===yn?r:Wi(On.get(yn).items);d.splice(Cu,0,ha),ba(yn,d,{trigger:pi.DRAGGED_LEFT_ALL,id:bi[Pn],source:vi.POINTER})}ba(n.currentTarget,r,{trigger:pi.DRAGGED_LEFT,id:bi[Pn],source:vi.POINTER})}}s(S0,"handleDraggedLeft");function j0(n){gt(function(){return["dragged is over index",n.currentTarget,n.detail]});var e=On.get(n.currentTarget),t=e.items,i=e.dropFromOthersDisabled;if(i&&n.currentTarget!==yn){gt(function(){return"drop is currently disabled"});return}var r=Wi(t);Nl=!1;var a=n.detail.indexObj.index,o=Au(r);o!==-1&&r.splice(o,1),r.splice(a,0,ha),ba(n.currentTarget,r,{trigger:pi.DRAGGED_OVER_INDEX,id:bi[Pn],source:vi.POINTER})}s(j0,"handleDraggedIsOverIndex");function vu(n){n.preventDefault();var e=n.touches?n.touches[0]:n;Oi={x:e.clientX,y:e.clientY},Xn.style.transform="translate3d(".concat(Oi.x-_a.x,"px, ").concat(Oi.y-_a.y,"px, 0)")}s(vu,"handleMouseMove");function Yo(){gt(function(){return"dropped"}),Pm=!0,window.removeEventListener("mousemove",vu),window.removeEventListener("touchmove",vu),window.removeEventListener("mouseup",Yo),window.removeEventListener("touchend",Yo),IV(),vV(Xn),Zn||(gt(function(){return"element was dropped right after it left origin but before entering somewhere else"}),Zn=yn),gt(function(){return["dropped in dz",Zn]});var n=On.get(Zn),e=n.items,t=n.type;bu(ur.get(t),function(a){return On.get(a).dropTargetStyle},function(a){return On.get(a).dropTargetClasses});var i=Au(e);i===-1&&Zn===yn&&(i=Cu),e=e.map(function(a){return a[dr]?bi:a});function r(){Vm(),Xo(Zn,e,{trigger:Nl?pi.DROPPED_OUTSIDE_OF_ANY:pi.DROPPED_INTO_ZONE,id:bi[Pn],source:vi.POINTER}),Zn!==yn&&Xo(yn,On.get(yn).items,{trigger:pi.DROPPED_INTO_ANOTHER,id:bi[Pn],source:vi.POINTER}),i!==-1&&kV(Zn.children[i]),RV()}s(r,"finalizeWithinZone"),NV(i,r)}s(Yo,"handleDrop");function NV(n,e){var t=n>-1?Sm(Zn.children[n]):Sm(Zn),i={x:t.left-parseFloat(Xn.style.left),y:t.top-parseFloat(Xn.style.top)},r=On.get(Zn),a=r.dropAnimationDurationMs,o="transform ".concat(a,"ms ease");Xn.style.transition=Xn.style.transition?Xn.style.transition+","+o:o,Xn.style.transform="translate3d(".concat(i.x,"px, ").concat(i.y,"px, 0)"),window.setTimeout(e,a)}s(NV,"animateDraggedToFinalPosition");function BV(n,e){Tl.push({dz:n,destroy:e}),window.requestAnimationFrame(function(){C0(n),document.body.appendChild(n)})}s(BV,"scheduleDZForRemovalAfterDrop");function RV(){Xn.remove(),sr.remove(),Tl.length&&(gt(function(){return["will destroy zones that were removed during drag",Tl]}),Tl.forEach(function(n){var e=n.dz,t=n.destroy;t(),e.remove()}),Tl=[]),Xn=void 0,sr=void 0,bi=void 0,Tu=void 0,yn=void 0,Cu=void 0,ha=void 0,Zn=void 0,_a=void 0,Oi=void 0,Ya=!1,Pm=!1,Vm=void 0,Nl=!1}s(RV,"cleanupPostDrop");function DV(n,e){var t=!1,i={items:void 0,type:void 0,flipDurationMs:0,dragDisabled:!1,morphDisabled:!1,dropFromOthersDisabled:!1,dropTargetStyle:c0,dropTargetClasses:[],transformDraggedElement:s(function(){},"transformDraggedElement"),centreDraggedOnCursor:!1};gt(function(){return["dndzone good to go options: ".concat(Br(e),", config: ").concat(Br(i)),{node:n}]});var r=new Map;function a(){window.addEventListener("mousemove",u,{passive:!1}),window.addEventListener("touchmove",u,{passive:!1,capture:!1}),window.addEventListener("mouseup",l,{passive:!1}),window.addEventListener("touchend",l,{passive:!1})}s(a,"addMaybeListeners");function o(){window.removeEventListener("mousemove",u),window.removeEventListener("touchmove",u),window.removeEventListener("mouseup",l),window.removeEventListener("touchend",l)}s(o,"removeMaybeListeners");function l(p){o(),sr=void 0,_a=void 0,Oi=void 0,p.type==="touchend"&&p.target.click()}s(l,"handleFalseAlarm");function u(p){p.preventDefault();var f=p.touches?p.touches[0]:p;Oi={x:f.clientX,y:f.clientY},(Math.abs(Oi.x-_a.x)>=l0||Math.abs(Oi.y-_a.y)>=l0)&&(o(),d())}s(u,"handleMouseMoveMaybeDragStart");function c(p){if(p.target!==p.currentTarget&&(p.target.value!==void 0||p.target.isContentEditable)){gt(function(){return"won't initiate drag on a nested input element"});return}if(p.button){gt(function(){return"ignoring none left click button: ".concat(p.button)});return}if(Ya){gt(function(){return"cannot start a new drag before finalizing previous one"});return}p.preventDefault(),p.stopPropagation();var f=p.touches?p.touches[0]:p;_a={x:f.clientX,y:f.clientY},Oi=_u({},_a),sr=p.currentTarget,a()}s(c,"handleMouseDown");function d(){gt(function(){return["drag start config: ".concat(Br(i)),sr]}),Ya=!0;var p=r.get(sr);Cu=p,yn=sr.parentElement;var f=yn.closest("dialog")||yn.getRootNode(),_=f.body||f,g=i.items,h=i.type,v=i.centreDraggedOnCursor,y=Wi(g);bi=y[p],Tu=h,ha=OV(bi),Xn=bV(sr,v&&Oi),sr.setAttribute(u0,!0);function k(){Xn.parentElement?window.requestAnimationFrame(k):(_.appendChild(Xn),Xn.focus(),jV(),C0(sr),_.appendChild(sr),ha[Pn]=bi[Pn])}s(k,"keepOriginalElementInDom"),window.requestAnimationFrame(k),pu(Array.from(ur.get(i.type)).filter(function(b){return b===yn||!On.get(b).dropFromOthersDisabled}),function(b){return On.get(b).dropTargetStyle},function(b){return On.get(b).dropTargetClasses}),y.splice(p,1,ha),Vm=EV(yn),ba(yn,y,{trigger:pi.DRAG_STARTED,id:bi[Pn],source:vi.POINTER}),window.addEventListener("mousemove",vu,{passive:!1}),window.addEventListener("touchmove",vu,{passive:!1,capture:!1}),window.addEventListener("mouseup",Yo,{passive:!1}),window.addEventListener("touchend",Yo,{passive:!1})}s(d,"handleDragStart");function m(p){var f=p.items,_=f===void 0?void 0:f,g=p.flipDurationMs,h=g===void 0?0:g,v=p.type,y=v===void 0?TV:v,k=p.dragDisabled,b=k===void 0?!1:k,x=p.morphDisabled,E=x===void 0?!1:x,C=p.dropFromOthersDisabled,j=C===void 0?!1:C,S=p.dropTargetStyle,B=S===void 0?c0:S,O=p.dropTargetClasses,A=O===void 0?[]:O,V=p.transformDraggedElement,K=V===void 0?function(){}:V,te=p.centreDraggedOnCursor,fe=te===void 0?!1:te;i.dropAnimationDurationMs=h,i.type&&y!==i.type&&d0(n,i.type),i.type=y,i.items=Wi(_),i.dragDisabled=b,i.morphDisabled=E,i.transformDraggedElement=K,i.centreDraggedOnCursor=fe,t&&Ya&&!Pm&&(!aV(B,i.dropTargetStyle)||!oV(A,i.dropTargetClasses))&&(bu([n],function(){return i.dropTargetStyle},function(){return A}),pu([n],function(){return B},function(){return A})),i.dropTargetStyle=B,i.dropTargetClasses=Wi(A);function ae(xe,ne){return On.get(xe)?On.get(xe)[ne]:i[ne]}s(ae,"getConfigProp"),t&&Ya&&i.dropFromOthersDisabled!==j&&(j?bu([n],function(xe){return ae(xe,"dropTargetStyle")},function(xe){return ae(xe,"dropTargetClasses")}):pu([n],function(xe){return ae(xe,"dropTargetStyle")},function(xe){return ae(xe,"dropTargetClasses")})),i.dropFromOthersDisabled=j,On.set(n,i),SV(n,y);for(var ee=Au(i.items),se=0;se".concat(e,"

      "),t.style.display="none",t.style.position="fixed",t.style.zIndex="-5",t}s(PV,"instructionToHiddenDiv");function Wo(n){if(!Fm){In||Om(),In.innerHTML="";var e=document.createTextNode(n);In.appendChild(e),In.style.display="none",In.style.display="inline"}}s(Wo,"alertToScreenReader");var VV="--any--",f0={outline:"rgba(255, 255, 102, 0.7) solid 2px"},Ki=!1,Nm,ti,Qa="",Xa,lr,ga="",yu=new WeakSet,m0=new WeakMap,p0=new WeakMap,Bm=new Map,Wn=new Map,cr=new Map,wu;function zV(n,e){gt(function(){return"registering drop-zone if absent"}),cr.size===0&&(gt(function(){return"adding global keydown and click handlers"}),wu=FV(),window.addEventListener("keydown",O0),window.addEventListener("click",N0)),cr.has(e)||cr.set(e,new Set),cr.get(e).has(n)||(cr.get(e).add(n),b0())}s(zV,"registerDropZone$1");function _0(n,e){gt(function(){return"unregistering drop-zone"}),ti===n&&jl(),cr.get(e).delete(n),v0(),cr.get(e).size===0&&cr.delete(e),cr.size===0&&(gt(function(){return"removing global keydown and click handlers"}),window.removeEventListener("keydown",O0),window.removeEventListener("click",N0),wu=void 0,LV())}s(_0,"unregisterDropZone$1");function O0(n){if(Ki)switch(n.key){case"Escape":{jl();break}}}s(O0,"globalKeyDownHandler");function N0(){Ki&&(yu.has(document.activeElement)||(gt(function(){return"clicked outside of any draggable"}),jl()))}s(N0,"globalClickHandler");function GV(n){if(gt(function(){return"zone focus"}),!!Ki){var e=n.currentTarget;if(e!==ti){Qa=e.getAttribute("aria-label")||"";var t=Wn.get(ti),i=t.items,r=i.find(function(m){return m[Pn]===lr}),a=i.indexOf(r),o=i.splice(a,1)[0],l=Wn.get(e),u=l.items,c=l.autoAriaDisabled;e.getBoundingClientRect().top0&&arguments[0]!==void 0?arguments[0]:!0;gt(function(){return"drop"}),Wn.get(ti).autoAriaDisabled||Wo("Stopped dragging item ".concat(ga)),yu.has(document.activeElement)&&document.activeElement.blur(),n&&ba(ti,Wn.get(ti).items,{trigger:pi.DRAG_STOPPED,id:lr,source:vi.KEYBOARD}),bu(cr.get(Nm),function(e){return Wn.get(e).dropTargetStyle},function(e){return Wn.get(e).dropTargetClasses}),Xa=null,lr=null,ga="",Nm=null,ti=null,Qa="",Ki=!1,B0()}s(jl,"handleDrop$1");function UV(n,e){var t={items:void 0,type:void 0,dragDisabled:!1,zoneTabIndex:0,zoneItemTabIndex:0,dropFromOthersDisabled:!1,dropTargetStyle:f0,dropTargetClasses:[],autoAriaDisabled:!1};function i(d,m,p){d.length<=1||d.splice(p,1,d.splice(m,1,d[p])[0])}s(i,"swap");function r(d){switch(gt(function(){return["handling key down",d.key]}),d.key){case"Enter":case" ":{if((d.target.disabled!==void 0||d.target.href||d.target.isContentEditable)&&!yu.has(d.target))return;d.preventDefault(),d.stopPropagation(),Ki?jl():a(d);break}case"ArrowDown":case"ArrowRight":{if(!Ki)return;d.preventDefault(),d.stopPropagation();var m=Wn.get(n),p=m.items,f=Array.from(n.children),_=f.indexOf(d.currentTarget);gt(function(){return["arrow down",_]}),_0&&(t.autoAriaDisabled||Wo("Moved item ".concat(ga," to position ").concat(y," in the list ").concat(Qa)),i(h,y,y-1),Xo(n,h,{trigger:pi.DROPPED_INTO_ZONE,id:lr,source:vi.KEYBOARD}));break}}}s(r,"handleKeyDown");function a(d){gt(function(){return"drag start"}),l(d.currentTarget),ti=n,Nm=t.type,Ki=!0;var m=Array.from(cr.get(t.type)).filter(function(f){return f===ti||!Wn.get(f).dropFromOthersDisabled});if(pu(m,function(f){return Wn.get(f).dropTargetStyle},function(f){return Wn.get(f).dropTargetClasses}),!t.autoAriaDisabled){var p="Started dragging item ".concat(ga,". Use the arrow keys to move it within its list ").concat(Qa);m.length>1&&(p+=", or tab to another list in order to move the item into it"),Wo(p)}ba(n,Wn.get(n).items,{trigger:pi.DRAG_STARTED,id:lr,source:vi.KEYBOARD}),B0()}s(a,"handleDragStart");function o(d){Ki&&d.currentTarget!==Xa&&(d.stopPropagation(),jl(!1),a(d))}s(o,"handleClick");function l(d){var m=Wn.get(n),p=m.items,f=Array.from(n.children),_=f.indexOf(d);Xa=d,Xa.tabIndex=t.zoneItemTabIndex,lr=p[_][Pn],ga=f[_].getAttribute("aria-label")||""}s(l,"setCurrentFocusedItem");function u(d){var m=d.items,p=m===void 0?[]:m,f=d.type,_=f===void 0?VV:f,g=d.dragDisabled,h=g===void 0?!1:g,v=d.zoneTabIndex,y=v===void 0?0:v,k=d.zoneItemTabIndex,b=k===void 0?0:k,x=d.dropFromOthersDisabled,E=x===void 0?!1:x,C=d.dropTargetStyle,j=C===void 0?f0:C,S=d.dropTargetClasses,B=S===void 0?[]:S,O=d.autoAriaDisabled,A=O===void 0?!1:O;t.items=Wi(p),t.dragDisabled=h,t.dropFromOthersDisabled=E,t.zoneTabIndex=y,t.zoneItemTabIndex=b,t.dropTargetStyle=j,t.dropTargetClasses=B,t.autoAriaDisabled=A,t.type&&_!==t.type&&_0(n,t.type),t.type=_,zV(n,_),A||(n.setAttribute("aria-disabled",h),n.setAttribute("role","list"),n.setAttribute("aria-describedby",h?wu.DND_ZONE_DRAG_DISABLED:wu.DND_ZONE_ACTIVE)),Wn.set(n,t),Ki?n.tabIndex=n===ti||Xa.contains(n)||t.dropFromOthersDisabled||ti&&t.type!==Wn.get(ti).type?-1:0:n.tabIndex=t.zoneTabIndex,n.addEventListener("focus",GV);for(var V=s(function(fe){var ae=n.children[fe];yu.add(ae),ae.tabIndex=Ki?-1:t.zoneItemTabIndex,A||ae.setAttribute("role","listitem"),ae.removeEventListener("keydown",m0.get(ae)),ae.removeEventListener("click",p0.get(ae)),h||(ae.addEventListener("keydown",r),m0.set(ae,r),ae.addEventListener("click",o),p0.set(ae,o)),Ki&&t.items[fe][Pn]===lr&&(gt(function(){return["focusing on",{i:fe,focusedItemId:lr}]}),Xa=ae,Xa.tabIndex=t.zoneItemTabIndex,ae.focus())},"_loop"),K=0;K0&&console.warn("dndzone will ignore unknown options",_),!e)throw new Error("no 'items' key provided to dndzone");var g=e.find(function(h){return!{}.hasOwnProperty.call(h,Pn)});if(g)throw new Error("missing '".concat(Pn,"' property for item ").concat(Br(g)));if(d&&!Array.isArray(d))throw new Error("dropTargetClasses should be an array but instead it is a ".concat(Cl(d),", ").concat(Br(d)));if(l&&!h0(l))throw new Error("zoneTabIndex should be a number but instead it is a ".concat(Cl(l),", ").concat(Br(l)));if(u&&!h0(u))throw new Error("zoneItemTabIndex should be a number but instead it is a ".concat(Cl(u),", ").concat(Br(u)))}s(g0,"validateOptions");function h0(n){return!isNaN(n)&&function(e){return(e|0)===e}(parseFloat(n))}s(h0,"isInt");function $V(n){var e=n,t=new Set;return{get:s(function(){return e},"get"),set:s(function(r){e=r,Array.from(t).forEach(function(a){return a(e)})},"set"),subscribe:s(function(r){t.add(r),r(e)},"subscribe"),unsubscribe:s(function(r){t.delete(r)},"unsubscribe")}}s($V,"createStore");var IX=$V(!0);function R0(n,e,t){let i=n.slice();return i[19]=e[t],i}s(R0,"get_each_context");function D0(n,e,t){let i=n.slice();return i[19]=e[t],i}s(D0,"get_each_context_1");function M0(n){let e,t;return{c(){e=P("div"),Ge(e,"visibility","visible",1),Ge(e,"border-bottom","2px solid var(--color-accent)"),Ge(e,"width","100%"),Ge(e,"height","50%")},m(i,r){L(i,e,r)},p(i,r){n=i},i(i){t||Fr(()=>{t=Vs(e,xl,{duration:150,easing:wl}),t.start()})},o:ue,d(i){i&&F(e)}}}s(M0,"create_if_block_1");function F0(n,e){let t,i,r,a=(e[19].icon||"folder")+"",o,l,u,c=e[19].title+"",d,m,p,f=ue,_=e[19][dr]&&M0(e);return{key:n,first:null,c(){t=P("div"),_&&_.c(),i=G(),r=P("i"),o=Re(a),l=G(),u=P("span"),d=Re(c),m=G(),T(r,"class","material-icons notranslate icon"),Ge(r,"color","rgb(162, 235, 255)"),T(u,"class","svelte-rl3m5y"),T(t,"class","list-item svelte-rl3m5y"),this.first=t},m(g,h){L(g,t,h),_&&_.m(t,null),N(t,i),N(t,r),N(r,o),N(t,l),N(t,u),N(u,d),N(t,m)},p(g,h){e=g,e[19][dr]?_?h&256&&q(_,1):(_=M0(e),_.c(),q(_,1),_.m(t,i)):_&&(_.d(1),_=null),h&256&&a!==(a=(e[19].icon||"folder")+"")&&ot(o,a),h&256&&c!==(c=e[19].title+"")&&ot(d,c)},r(){p=t.getBoundingClientRect()},f(){Ps(t),f()},a(){f(),f=Ls(t,p,kl,{duration:150})},i(g){q(_)},o:ue,d(g){g&&F(t),_&&_.d()}}}s(F0,"create_each_block_1");function L0(n){let e,t;return{c(){e=P("div"),Ge(e,"visibility","visible",1),Ge(e,"border-bottom","2px solid var(--color-accent)"),Ge(e,"width","100%"),Ge(e,"height","50%")},m(i,r){L(i,e,r)},p(i,r){n=i},i(i){t||Fr(()=>{t=Vs(e,xl,{duration:150,easing:wl}),t.start()})},o:ue,d(i){i&&F(e)}}}s(L0,"create_if_block");function P0(n,e){let t,i,r,a=(e[19].icon||"folder")+"",o,l,u,c=e[19].title+"",d,m,p,f=ue,_=e[19][dr]&&L0(e);return{key:n,first:null,c(){t=P("div"),_&&_.c(),i=G(),r=P("i"),o=Re(a),l=G(),u=P("span"),d=Re(c),m=G(),T(r,"class","material-icons notranslate icon"),Ge(r,"color","rgb(162, 235, 255)"),T(u,"class","svelte-rl3m5y"),T(t,"class","list-item svelte-rl3m5y"),this.first=t},m(g,h){L(g,t,h),_&&_.m(t,null),N(t,i),N(t,r),N(r,o),N(t,l),N(t,u),N(u,d),N(t,m)},p(g,h){e=g,e[19][dr]?_?h&128&&q(_,1):(_=L0(e),_.c(),q(_,1),_.m(t,i)):_&&(_.d(1),_=null),h&128&&a!==(a=(e[19].icon||"folder")+"")&&ot(o,a),h&128&&c!==(c=e[19].title+"")&&ot(d,c)},r(){p=t.getBoundingClientRect()},f(){Ps(t),f()},a(){f(),f=Ls(t,p,kl,{duration:150})},i(g){q(_)},o:ue,d(g){g&&F(t),_&&_.d()}}}s(P0,"create_each_block");function qV(n){let e,t,i,r,a,o,l=[],u=new Map,c,d,m,p,f,_,g,h,v,y=[],k=new Map,b,x,E,C=n[8],j=s(O=>O[19].id,"get_key");for(let O=0;OO[19].id,"get_key_1");for(let O=0;O({18:i}),({id:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){_e(e.$$.fragment)},m(i,r){me(e,i,r),t=!0},p(i,[r]){let a={};r&1&&(a.label=i[0]),r&2&&(a.tooltip=i[1]),r&16777724&&(a.$$scope={dirty:r,ctx:i}),e.$set(a)},i(i){t||(q(e.$$.fragment,i),t=!0)},o(i){Z(e.$$.fragment,i),t=!1},d(i){de(e,i)}}}s(KV,"create_fragment");function WV(n,e,t){let{label:i}=e,{tooltip:r}=e,{availableItemsColumnLable:a}=e,{availableItemsColumnTooltip:o}=e,{includedItemsColumnLable:l}=e,{includedItemsColumnTooltip:u}=e,{swapColumnsButtonTooltip:c}=e,{availableItems:d}=e,{includedItems:m}=e,p=[],f=[];for(let x=0;xC.value===E.value)?p.push({id:x,title:E.name,icon:E.icon}):f.push({id:x,title:E.name,icon:E.icon})}function _(x){t(8,f=x.detail.items)}s(_,"handleSortAvailableItems");function g(x){t(7,p=x.detail.items)}s(g,"handleSortIncludedItems");function h(){m.update(x=>p.map(E=>d.find(C=>C.name===E.title)))}s(h,"finalizeSort");function v(){let x=f;t(8,f=p),t(7,p=x),h()}s(v,"swapColumns");function y(){m.set([])}s(y,"onReset");let k=s(x=>{_(x),h()},"finalize_handler"),b=s(x=>{g(x),h()},"finalize_handler_1");return n.$$set=x=>{"label"in x&&t(0,i=x.label),"tooltip"in x&&t(1,r=x.tooltip),"availableItemsColumnLable"in x&&t(2,a=x.availableItemsColumnLable),"availableItemsColumnTooltip"in x&&t(3,o=x.availableItemsColumnTooltip),"includedItemsColumnLable"in x&&t(4,l=x.includedItemsColumnLable),"includedItemsColumnTooltip"in x&&t(5,u=x.includedItemsColumnTooltip),"swapColumnsButtonTooltip"in x&&t(6,c=x.swapColumnsButtonTooltip),"availableItems"in x&&t(14,d=x.availableItems),"includedItems"in x&&t(15,m=x.includedItems)},[i,r,a,o,l,u,c,p,f,_,g,h,v,y,d,m,k,b]}s(WV,"instance");var Su=class extends Be{constructor(e){super(),De(this,e,WV,KV,Oe,{label:0,tooltip:1,availableItemsColumnLable:2,availableItemsColumnTooltip:3,includedItemsColumnLable:4,includedItemsColumnTooltip:5,swapColumnsButtonTooltip:6,availableItems:14,includedItems:15})}};s(Su,"Collection");var ju=Su;(()=>{let n=Blockbench.addCSS(".main-column-container.svelte-rl3m5y{display:flex;justify-content:space-around}section.sub-column-container.svelte-rl3m5y{display:flex;flex-direction:column;align-items:stretch;width:unset;height:100%;background-color:var(--color-back);border:1px solid var(--color-border);margin:8px;margin-top:0px;padding:4px 8px 30px;max-height:16rem;overflow-y:auto}h3.svelte-rl3m5y{text-align:center;font-size:16px;padding:0px;margin:8px 0px}.column.svelte-rl3m5y{display:flex;flex-direction:column;width:50%}.list-item.svelte-rl3m5y{display:flex;cursor:default !important;width:100%}span.svelte-rl3m5y{padding:0 8px}span.svelte-rl3m5y:hover{color:var(--color-light)}.fa-icon.svelte-rl3m5y{display:flex;align-items:center;justify-content:center;padding-right:8px;padding-left:8px;margin-top:68px}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();function ZV(n){let e,t,i,r;return{c(){e=P("div"),t=P("label"),i=Re(n[0]),T(t,"class","name_space_left"),T(t,"for",r=n[9]),T(e,"class","dialog_bar form_bar")},m(a,o){L(a,e,o),N(e,t),N(t,i),n[7](e)},p(a,o){o&1&&ot(i,a[0]),o&512&&r!==(r=a[9])&&T(t,"for",r)},d(a){a&&F(e),n[7](null)}}}s(ZV,"create_default_slot");function XV(n){let e,t;return e=new jn({props:{label:n[0],tooltip:n[1],onReset:n[3],$$slots:{default:[ZV,({id:i})=>({9:i}),({id:i})=>i?512:0]},$$scope:{ctx:n}}}),{c(){_e(e.$$.fragment)},m(i,r){me(e,i,r),t=!0},p(i,[r]){let a={};r&1&&(a.label=i[0]),r&2&&(a.tooltip=i[1]),r&1541&&(a.$$scope={dirty:r,ctx:i}),e.$set(a)},i(i){t||(q(e.$$.fragment,i),t=!0)},o(i){Z(e.$$.fragment,i),t=!1},d(i){de(e,i)}}}s(XV,"create_fragment");function YV(n,e,t){let{label:i}=e,{tooltip:r=""}=e,{options:a}=e,{defaultOption:o}=e,{value:l}=e,u;l.get()||a[l.get()]||l.set(o);let c=new Interface.CustomElements.SelectInput("dialog-select",{options:a,value:l.get(),onChange(){l.set(c.node.getAttribute("value"))}});function d(){l.set(o),c.node&&c.set(o)}s(d,"onReset"),requestAnimationFrame(()=>{u.appendChild(c.node)});function m(p){le[p?"unshift":"push"](()=>{u=p,t(2,u)})}return s(m,"div_binding"),n.$$set=p=>{"label"in p&&t(0,i=p.label),"tooltip"in p&&t(1,r=p.tooltip),"options"in p&&t(4,a=p.options),"defaultOption"in p&&t(5,o=p.defaultOption),"value"in p&&t(6,l=p.value)},[i,r,u,d,a,o,l,m]}s(YV,"instance");var Iu=class extends Be{constructor(e){super(),De(this,e,YV,XV,Oe,{label:0,tooltip:1,options:4,defaultOption:5,value:6})}};s(Iu,"Select");var Yn=Iu;var V0=s(class{item;index=-1;string;itemCode;line=1;column=0;lineStart=0;lines=[{number:1,startIndex:0,content:""}];constructor(n){this.string=n,this.consume()}get length(){return this.string.length}get progress(){return Math.min(this.index/this.length,1)}get next(){return this.string.at(this.index+1)}get nextCode(){return this.string.charCodeAt(this.index+1)}get currentLine(){return this.lines[this.line-1]}look(n,e=1){return this.string.slice(this.index+n,this.index+n+e)}consume(){let n=this.item;this.item&&(this.currentLine.content+=this.item),this.item=this.string.at(this.index+1),this.itemCode=this.item?.charCodeAt(0),this.index++,this.column++,(n===` +`||n!=null&&this.item==null)&&this.completeLine()}consumeN(n){for(let e=0;e!!e.item&&this.whitespaceChars.includes(e.item))}parseTextComponent(e=!1){let t;if(this.consumeWhitespace(),this.s.item==="{")t=this.parseTextObject();else if(this.s.item==="[")t=this.parseArray();else if(this.s.item==='"')t=this.parseString();else throw new St(`Unexpected '${this.s.item}' in JsonTextComponent`,this.s);if(this.consumeWhitespace(),e&&this.s.item)throw new St(`Unexpected '${this.s.item}' in JsonTextComponent`,this.s);return t}parseValue(){let{line:e,column:t}=this.s;if(this.consumeWhitespace(),this.s.item==="{")return this.parseTextObject();if(this.s.item==="[")return this.parseArray();if(this.s.item==='"')return this.parseString();if(this.s.item==="t"||this.s.item==="f")return this.parseBoolean();if(this.s.item==="-"||this.s.item==="."||this.s.item&&this.numChars.includes(this.s.item))return this.parseNumber();throw new St(`Unexpected ${this.s.item}`,this.s,void 0,e,t)}parseObject(e,t){let{line:i,column:r}=this.s;try{if(this.s.item!=="{")throw new St(`Unexpected '${this.s.item}' in JsonTextObject`,this.s);this.s.consume(),this.consumeWhitespace();let a={};for(;this.s.item!=="}";){let o=this.parseString();if(this.consumeWhitespace(),this.s.consume(),this.consumeWhitespace(),e(o,a),this.consumeWhitespace(),this.s.item===",")this.s.consume(),this.consumeWhitespace();else{if(this.s.item==="}")break;throw this.s.item===void 0?new St("Unexpected EOF in JsonTextObject",this.s):new St(`Unexpected '${this.s.item}' in JsonTextObject`,this.s)}}return this.s.consume(),t&&t(a),a}catch(a){throw new St("Failed to parse JsonTextObject",this.s,a,i,r)}}parseTextObject(){return this.parseObject((e,t)=>{switch(e){case"block":case"entity":case"font":case"insertion":case"keybind":case"nbt":case"selector":case"separator":case"storage":case"text":case"translate":case"fallback":t[e]=this.parseString();break;case"color":{let i=this.parseString();if(!(i.startsWith("#")||zm[i]))throw new St(`Unknown color '${i}'`,this.s);t.color=i;break}case"bold":case"italic":case"obfuscated":case"strikethrough":case"underlined":t[e]=this.parseBoolean();break;case"with":case"extra":t[e]=this.parseArray();break;case"score":t[e]=this.parseScoreObject();break;case"clickEvent":t[e]=this.parseClickEventObject();break;case"hoverEvent":t[e]=this.parseHoverEventObject();break;default:throw new St(`Unknown key '${e}' in JsonTextObject`,this.s)}},e=>{if(e.text===void 0&&e.translate===void 0&&e.score===void 0&&e.selector===void 0&&e.keybind===void 0&&e.nbt===void 0)throw new St("JsonTextObject does not include one of 'text', 'translate', 'score', 'selector', 'keybind', or 'nbt'.",this.s);if(e.nbt!==void 0&&e.block===void 0&&e.entity===void 0&&e.storage===void 0)throw new St("JsonTextObject includes 'nbt' but does not include one of 'block', 'entity', or 'storage'.",this.s)})}parseScoreObject(){return this.parseObject((e,t)=>{switch(e){case"name":case"objective":t[e]=this.parseString();break;case"value":t[e]=this.parseNumber();break;default:throw new St(`Unknown key '${e}' in JsonTextObject.score`,this.s)}},e=>{if(e.name===void 0||e.objective===void 0)throw new St("JsonTextObject.score must include 'name' and 'objective'",this.s)})}parseClickEventObject(){return this.parseObject((e,t)=>{switch(e){case"action":t[e]=this.parseString(["open_url","open_file","run_command","suggest_command","change_page","copy_to_clipboard"]);break;case"value":t[e]=this.parseString();break;default:throw new St(`Unknown key '${e}' in JsonTextObject.clickEvent`,this.s)}},e=>{if(e.action===void 0)throw new St("JsonTextObject.clickEvent must include 'action'",this.s);if(e.value===void 0)throw new St("JsonTextObject.clickEvent must include 'value'",this.s)})}parseHoverEventObject(){return this.parseObject((e,t)=>{switch(e){case"action":t[e]=this.parseString(["show_text","show_item","show_entity"]);break;case"contents":switch(t.action){case void 0:throw new St("HoverEvent 'action' is required, and must be defined before 'contents'.",this.s);case"show_text":{t[e]=this.parseTextComponent();break}case"show_item":{t[e]=this.parseObject((i,r)=>{switch(i){case"id":r[i]=this.parseString();break;case"count":r[i]=this.parseNumber();break;case"tag":r[i]=this.parseString();break;default:throw new St(`Unknown key '${i}' in JsonTextObject.itemHoverEvent.contents`,this.s)}},i=>{if(i.id===void 0)throw new St("JsonTextObject.itemHoverEvent.contents must include 'id'",this.s)});break}case"show_entity":{t[e]=this.parseObject((i,r)=>{switch(i){case"type":r[i]=this.parseString();break;case"id":r[i]=this.parseString();break;case"name":r[i]=this.parseString();break;default:throw new St(`Unknown key '${i}' in JsonTextObject.entityHoverEvent.contents`,this.s)}},i=>{if(i.type===void 0)throw new St("JsonTextObject.entityHoverEvent.contents must include 'type'",this.s)});break}}break;default:throw new St(`Unknown key '${e}' in JsonTextObject.hoverEvent`,this.s)}},e=>{if(e.action===void 0)throw new St("JsonTextObject.hoverEvent must include 'action'",this.s);if(e.contents===void 0)throw new St("JsonTextObject.hoverEvent must include 'contents'",this.s)})}parseArray(){this.s.consume(),this.consumeWhitespace();let e=[];for(;this.s.item!=="]";){this.consumeWhitespace();let t=this.parseTextComponent();if(e.push(t),this.s.item===",")this.s.consume(),this.consumeWhitespace();else{if(this.s.item==="]")break;throw new St(`Unexpected '${this.s.item}' in JsonTextArray`,this.s)}}return this.s.consume(),e}parseString(e){if(this.s.item!=='"')throw new St(`Unexpected '${this.s.item}' in string`,this.s);this.s.consume();let t="";for(;this.s.item;){if(this.s.item==="\\")if(this.s.look(1)==="n"){t+=` +`,this.s.consume(),this.s.consume();continue}else{this.s.consume(),t+=this.s.item,this.s.consume();continue}if(this.s.item==='"')break;if(this.s.item===` +`)throw new St("Unexpected newline in string",this.s);t+=this.s.item,this.s.consume()}if(!this.s.item)throw new St("Unexpected EOF in string",this.s);if(this.s.consume(),e&&!e.includes(t))throw new St(`Unexpected string value '${t}'. Expected one of ${e.join(", ")}`,this.s);return t}parseBoolean(){if(this.s.item==='"'){let e=this.parseString();if(e==="true")return!0;if(e==="false")return!1;throw new St("Unexpected incomplete string boolean",this.s)}if(this.s.look(0,4)==="true")return this.s.consumeN(4),!0;if(this.s.look(0,5)==="false")return this.s.consumeN(5),!1;throw new St("Unexpected incomplete boolean",this.s)}parseNumber(){let e="",t=!1;for(;this.s.item;){if(this.s.item==="."){if(t)throw new St("Unexpected second decimal point in number",this.s);t=!0}e+=this.s.item,this.s.consume()}return parseInt(e)}};s(Ou,"JsonTextParser");var z0="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9ba0UqCnYQcYjQOtlFRRxLFYtgobQVWnUwufQLmjQkKS6OgmvBwY/FqoOLs64OroIg+AHi7OCk6CIl/i8ptIjx4Lgf7+497t4B3maVKUZPDFBUU08n4kIuvyoEXuHHEHoxjojIDC2ZWczCdXzdw8PXuyjPcj/35xiQCwYDPAJxjGm6SbxBPLtpapz3iUOsLMrE58STOl2Q+JHrksNvnEs2e3lmSM+m54lDxEKpi6UuZmVdIZ4hDsuKSvnenMMy5y3OSrXO2vfkLwwW1JUM12mOIYElJJGCAAl1VFCFiSitKikG0rQfd/GP2v4UuSRyVcDIsYAaFIi2H/wPfndrFKennKRgHPC/WNZHBAjsAq2GZX0fW1brBPA9A1dqx19rAnOfpDc6WvgIGNwGLq47mrQHXO4AI0+aqIu25KPpLRaB9zP6pjwwfAv0rzm9tfdx+gBkqavlG+DgEJgoUfa6y7v7unv790y7vx+v+3K/mrIdyAAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAAd0SU1FB+gFEAYjBv19RUYAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAJUlEQVQY02P8////fwY0wMjIyAjnoCtA5zMxEAB0UMCCzWEkAQDoPxACvFjV6wAAAABJRU5ErkJggg==";var Rl=class{constructor(e){this.str=e;if(e!=="")for(let t of e.matchAll(Rl.regex))this.chars.push(t[0])}chars=[];[Symbol.iterator](){return this.chars[Symbol.iterator]()}get length(){return this.chars.length}includes(e){return this.chars.includes(e)}indexOf(e){return this.chars.indexOf(e)}slice(e,t){let i=this.chars.slice(e,t);return Rl.fromChars(i)}at(e){if(!(e<0||e>=this.chars.length))return this.chars[e]}append(e){this.chars.push(e),this.str+=e}toString(){return this.str}static fromChars(e){return new Rl(e.join(""))}},gn=Rl;s(gn,"UnicodeString"),kt(gn,"regex",/[^]/gmu);var e9=["bold","italic","underlined","strikethrough","obfuscated","color","font"];function Qo(n,e={color:"white"}){for(let t of e9)n[t]&&(e[t]=n[t]);return e}s(Qo,"getStylesFromComponent");function Gm(n){let e=n.at(0);return Array.isArray(e)?Gm(e):e instanceof $t?(e=e.toJSON(),Array.isArray(e)?Gm(e):Qo(e)):typeof e=="object"?Qo(e):{}}s(Gm,"getFirstItemStyle");function t9(n){let e=[];function t(i,r={}){if(Array.isArray(i)){r=Object.assign({},r,Gm(i));for(let a of i)t(a,r)}else if(typeof i=="string")e.push(Object.assign({},r,{text:i}));else if(i instanceof $t)t(i.toJSON(),r);else if(typeof i=="object"&&(e.push(Object.assign({},r,i,{extra:void 0})),i.extra)){let a=Qo(i);t(i.extra,a)}}return s(t,"flattenComponent"),t(n),e}s(t9,"flattenTextComponent");function G0(n){return typeof n=="string"?new gn(n):n.text?new gn(n.text):n.translate?new gn(`{${n.translate}}`):n.selector?new gn(`{${n.selector}}`):n.score?n.score.value?new gn(`{${n.score.value}}`):new gn(`{${n.score.name}:${n.score.objective}}`):n.keybind?new gn(`{${n.keybind}}`):n.nbt?n.block?new gn(`{${n.block}:${n.nbt}}`):n.entity?new gn(`{${n.entity}:${n.nbt}}`):n.storage?new gn(`{${n.storage}:${n.nbt}}`):new gn(`{${n.nbt}}`):new gn("")}s(G0,"getText");function U0(n){console.time("getComponentWords");let e=t9(n);if(!e.length)return[];let t=[],i,r=e.shift(),a=G0(r),o={style:Qo(r),start:0,end:0};for(;r;){for(let l of a){if(l===" ")i&&i.text.at(-1)!==" "&&(o.end++,Object.keys(o.style).length&&(i.styles.push({...o}),o.start=0,o.end=0),t.push(i),i=void 0);else if(l===` +`){i&&(Object.keys(o.style).length&&(i.styles.push({...o}),o.start=0,o.end=0),t.push(i)),t.push({styles:[],text:new gn(""),width:0,forceWrap:!0}),i=void 0;continue}else l!==" "&&i?.text.at(-1)===" "&&(o.end++,Object.keys(o.style).length&&(i.styles.push({...o}),o.start=0,o.end=0),t.push(i),i=void 0);i||(i={styles:[],text:new gn(""),width:0}),i.text.append(l),o.end++}r=e.shift(),r&&(a=G0(r),i?(i.styles.push(o),o={style:Qo(r),start:o.end,end:o.end}):o={style:Qo(r),start:0,end:0})}return i&&(Object.keys(o.style).length&&i.styles.push(o),t.push(i)),console.timeEnd("getComponentWords"),t}s(U0,"getComponentWords");async function J0(n,e=200){console.time("computeTextWrapping");let t=[],i=await eo(),r=0,a={words:[],width:0};for(let o of n){let l=i.getWordWidth(o),u=[...o.styles];if(l-1>e){a.words.length&&(t.push(a),r=Math.max(r,a.width)),a={words:[],width:0};let c=new gn(""),d=0,m=0,p=u.shift();if(!p)throw new Error(`No active style found for word '${o.text.toString()}'`);for(let f=0;f1&&f>=p.end&&(p=u.shift());let g=i.getTextWidth(new gn(_),p);if(c.length>0&&d+(g-1)>e){let h=o.styles.filter(v=>v.start=m).map(v=>({...v,start:Math.max(v.start-m,0),end:Math.min(v.end-m,c.length)}));t.push({words:[{text:c,styles:h,width:l}],width:d}),r=Math.max(r,d),m+=c.length,c=new gn(""),d=0}c.append(_),d+=g}if(c){let f=o.styles.filter(_=>_.start=m).map(_=>({..._,start:Math.max(_.start-m,0),end:Math.min(_.end-m,c.length)}));r=Math.max(r,d),a={words:[{text:c,styles:f,width:l}],width:d}}continue}else if(o.forceWrap)a.words.length&&(t.push(a),r=Math.max(r,a.width)),a={words:[],width:0};else if(a.words.length&&a.width+(l-1)>e){let c=a.words.at(-1);c?.text.at(-1)===" "&&(a.words.pop(),a.width-=c.width),t.push(a),r=Math.max(r,a.width),a={words:[],width:0}}o.width=l,a.words.push(o),a.width+=l}return a.words.length&&(t.push(a),r=Math.max(r,a.width)),console.timeEnd("computeTextWrapping"),{lines:t,backgroundWidth:r}}s(J0,"computeTextWrapping");var K0=Rt("crypto");var{BufferAttribute:n9,BufferGeometry:i9,Float32BufferAttribute:mY,InstancedBufferAttribute:pY,InterleavedBuffer:_Y,InterleavedBufferAttribute:gY,TriangleFanDrawMode:hY,TriangleStripDrawMode:bY,TrianglesDrawMode:vY,Vector3:yY}=THREE;function Rr(n,e=!1){let t=n[0].index!==null,i=new Set(Object.keys(n[0].attributes)),r=new Set(Object.keys(n[0].morphAttributes)),a={},o={},l=n[0].morphTargetsRelative,u=new i9,c=0;for(let d=0;d0){o=u+1;break}}let l=this;this.charCache.set(e,{type:"bitmap",ascent:this.ascent,width:o+1,get atlas(){return l.atlas},pixelUV:[i,r,o,this.charHeight],uv:[i/l.atlas.image.width,r/l.atlas.image.height,o/l.atlas.image.width,this.charHeight/l.atlas.image.height]})}return this.charCache.get(e)}};s(Fl,"BitmapFontProvider");var va=class{id;providers=[];fallback;charCache=new Map;loaded=!1;characterMeshCache=new Map;constructor(e,t,i){this.id=e,this.fallback=i;let r=or(t);for(let a of r.providers)switch(a.type){case"bitmap":this.providers.push(new Fl(a));break;case"reference":this.providers.push(new Dl(a));break;case"space":this.providers.push(new Ml(a));break;default:throw new Error(`Unsupported font provider type: ${a.type}`)}va.all.push(this)}static getById(e){return va.all.find(t=>t.id===e)}async load(){return this.loaded?this:(await Promise.all(this.providers.map(e=>e.load())).then(()=>{}),this.loaded=!0,this)}getChar(e,t=!0){if(!this.charCache.has(e)){for(let i of this.providers){let r=i.getChar(e,!1);if(r)return this.charCache.set(e,r),r}if(t)return{type:"bitmap",ascent:7,width:6,atlas:va.missingCharacterAtlas,pixelUV:[0,0,8,8],uv:[0,0,1/8*6,1]}}return this.charCache.get(e)}getTextWidth(e,t){let i=0,r=t.style.bold?1:0,a=this;if(t.style.font&&t.style.font!==this.id){let o=va.getById(t.style.font);o&&(a=o)}for(let o of e){if(o===` +`)break;let l=a.getChar(o);if(!l){console.warn(`Missing character: '${o}'`);continue}i+=l.width+r}return Math.max(i,0)}getWordWidth(e){let t=0,i=this;for(let r of e.styles){if(r.style.font&&r.style.font!==this.id){let l=va.getById(r.style.font);l&&(i=l)}let a=e.text.slice(r.start,r.end),o=i.getTextWidth(a,r);t+=o}return Math.max(t,0)}async generateTextMesh({jsonText:e,maxLineWidth:t,backgroundColor:i,backgroundAlpha:r,shadow:a,alignment:o}){console.time("drawTextToMesh");let l=new THREE.Mesh,u=U0(e),{lines:c,backgroundWidth:d}=await J0(u,t),m=d+1,p=c.length*10+1,f=new THREE.PlaneBufferGeometry(m,p),_=new THREE.Mesh(f,new THREE.MeshBasicMaterial({color:i,transparent:!0,opacity:r})).translateY(p/2).translateZ(-.05);l.add(_);let g=[],h={x:0,y:p-9};for(let x of c){switch(o){case"center":h.x=-m/2+Math.ceil((m-x.width)/2);break;case"right":h.x=-m/2+m-x.width;break;default:h.x=-m/2+1}for(let E of x.words)for(let C of E.styles){let j=E.text.slice(C.start,C.end);for(let S of j){let B=this.generateCharMesh(S,C.style,a);if(B){if(B.geo){let O=B.geo.clone();O.translate(h.x,h.y,0),g.push(O)}h.x+=B.width}}}h.y-=10}let v;if(g.length>0){v=Rr(g);let x=new THREE.Mesh(v,new THREE.MeshBasicMaterial({vertexColors:!0}));l.add(x)}l.scale.set(.4,.4,.4),l.rotateY(Math.PI),l.translateX(1/5);let y=new THREE.EdgesGeometry(f.clone().scale(.4,.4,.4)),k=new THREE.LineSegments(y,Canvas.outlineMaterial),b=Array.from(y.getAttribute("position").array);for(let x=0;x{let j=v.length/3;if(v.push(b,x,0,b+E,x,0,b+E,x+C,0,b,x+C,0),y.push(j,j+1,j+2,j,j+2,j+3),h.push(o.r,o.g,o.b,o.r,o.g,o.b,o.r,o.g,o.b,o.r,o.g,o.b),i){let S=v.length/3;b+=1,x-=1;let B=-.01;v.push(b,x,B,b+E,x,B,b+E,x+C,B,b,x+C,B),y.push(S,S+1,S+2,S,S+2,S+3),h.push(l.r,l.g,l.b,l.r,l.g,l.b,l.r,l.g,l.b,l.r,l.g,l.b)}},"createQuad");for(let b=0;b0&&(k(C-E,x,E+u,1),E=0);continue}else E++}E>0&&k(p.width-E,x,E+u,1)}if(g.setIndex(y),g.setAttribute("position",new THREE.BufferAttribute(new Float32Array(v),3)),g.setAttribute("color",new THREE.BufferAttribute(new Float32Array(h),3)),t.italic&&(g.applyMatrix4(new THREE.Matrix4().makeShear(0,0,.2,0,0,0)),g.translate(-1,0,0)),v=Array.from(g.getAttribute("position").array),h=Array.from(g.getAttribute("color").array),y=Array.from(g.getIndex().array),t.underlined&&k(-1,-1,p.width+2,1),t.strikethrough){let b=a.ascent/2+1;k(-1,b,p.width+2,1)}g.setIndex(y),g.setAttribute("position",new THREE.BufferAttribute(new Float32Array(v),3)),g.setAttribute("color",new THREE.BufferAttribute(new Float32Array(h),3)),g.attributes.position.needsUpdate=!0,g.attributes.color.needsUpdate=!0,m={geo:g,width:a.width+u},this.characterMeshCache.set(d,m)}return m}else return{width:a.width}}},Kr=va;s(Kr,"MinecraftFont"),kt(Kr,"all",[]),kt(Kr,"missingCharacterAtlas",new THREE.TextureLoader().load(z0));var es,$0,q0;function r9(){console.log("Loading Minecraft fonts..."),es=new Kr("minecraft:default","assets/minecraft/font/default.json"),$0=new Kr("minecraft:illageralt","assets/minecraft/font/illageralt.json",es),q0=new Kr("minecraft:alt","assets/minecraft/font/alt.json",es),Promise.all([es.load(),$0.load(),q0.load()]).then(()=>{console.log("Minecraft fonts loaded!"),requestAnimationFrame(()=>re.MINECRAFT_FONTS_LOADED.dispatch())})}s(r9,"loadMinecraftFonts");async function eo(){return es||await new Promise(n=>{re.MINECRAFT_FONTS_LOADED.subscribe(()=>n())}),es.load()}s(eo,"getVanillaFont");re.MINECRAFT_ASSETS_LOADED.subscribe(()=>{r9()});function a9(n){let e,t,i,r,a,o,l,u,c;return{c(){e=P("div"),t=P("label"),i=Re(n[0]),a=G(),o=P("div"),T(t,"class","name_space_left"),T(t,"for",r=n[8]),T(e,"class","dialog_bar form_bar")},m(d,m){L(d,e,m),N(e,t),N(t,i),N(e,a),N(e,o),n[6](o),u||(c=Lr(l=n[3].call(null,o)),u=!0)},p(d,m){m&1&&ot(i,d[0]),m&256&&r!==(r=d[8])&&T(t,"for",r)},d(d){d&&F(e),n[6](null),u=!1,c()}}}s(a9,"create_default_slot");function o9(n){let e,t;return e=new jn({props:{label:n[0],tooltip:n[1],onReset:n[4],$$slots:{default:[a9,({id:i})=>({8:i}),({id:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){_e(e.$$.fragment)},m(i,r){me(e,i,r),t=!0},p(i,[r]){let a={};r&1&&(a.label=i[0]),r&2&&(a.tooltip=i[1]),r&773&&(a.$$scope={dirty:r,ctx:i}),e.$set(a)},i(i){t||(q(e.$$.fragment,i),t=!0)},o(i){Z(e.$$.fragment,i),t=!1},d(i){de(e,i)}}}s(o9,"create_fragment");function s9(n,e,t){let{label:i}=e,{tooltip:r=""}=e,{value:a}=e,o=new ColorPicker(`${ke.name}:${i}-color_picker`,{onChange(){let m=o.get();a.set(m.toHexString())}}),l;function u(m){o.toElement(m),o.set(a.get())}s(u,"onLoad");function c(){a.set("#ffffff")}s(c,"onReset"),gf(()=>{o.delete()});function d(m){le[m?"unshift":"push"](()=>{l=m,t(2,l)})}return s(d,"div0_binding"),n.$$set=m=>{"label"in m&&t(0,i=m.label),"tooltip"in m&&t(1,r=m.tooltip),"value"in m&&t(5,a=m.value)},[i,r,l,u,c,a,d]}s(s9,"instance");var Nu=class extends Be{constructor(e){super(),De(this,e,s9,o9,Oe,{label:0,tooltip:1,value:5})}};s(Nu,"ColorPicker_1");var Zi=Nu;function l9(n){let e,t,i,r,a,o,l,u,c,d,m,p;return{c(){e=P("div"),t=P("label"),i=Re(n[0]),a=G(),o=P("div"),l=P("div"),u=G(),c=P("input"),T(t,"class","name_space_left"),T(t,"for",r=n[7]),T(l,"class","spacer svelte-1ai5ebm"),T(c,"type","checkbox"),T(c,"class","focusable_input"),T(c,"id",d=n[7]),T(o,"class","checkbox-line svelte-1ai5ebm"),T(e,"class","dialog_bar form_bar checkbox_bar svelte-1ai5ebm")},m(f,_){L(f,e,_),N(e,t),N(t,i),N(e,a),N(e,o),N(o,l),N(o,u),N(o,c),c.checked=n[3],m||(p=Le(c,"change",n[6]),m=!0)},p(f,_){_&1&&ot(i,f[0]),_&128&&r!==(r=f[7])&&T(t,"for",r),_&128&&d!==(d=f[7])&&T(c,"id",d),_&8&&(c.checked=f[3])},d(f){f&&F(e),m=!1,p()}}}s(l9,"create_default_slot");function c9(n){let e,t;return e=new jn({props:{label:n[0],tooltip:n[1],onReset:n[4],$$slots:{default:[l9,({id:i})=>({7:i}),({id:i})=>i?128:0]},$$scope:{ctx:n}}}),{c(){_e(e.$$.fragment)},m(i,r){me(e,i,r),t=!0},p(i,[r]){let a={};r&1&&(a.label=i[0]),r&2&&(a.tooltip=i[1]),r&393&&(a.$$scope={dirty:r,ctx:i}),e.$set(a)},i(i){t||(q(e.$$.fragment,i),t=!0)},o(i){Z(e.$$.fragment,i),t=!1},d(i){de(e,i)}}}s(c9,"create_fragment");function u9(n,e,t){let i,r=ue,a=s(()=>(r(),r=ze(u,p=>t(3,i=p)),u),"$$subscribe_checked");n.$$.on_destroy.push(()=>r());let{label:o}=e,{tooltip:l=""}=e,{checked:u}=e;a();let{defaultValue:c}=e;function d(){u.set(c)}s(d,"onReset");function m(){i=this.checked,u.set(i)}return s(m,"input_change_handler"),n.$$set=p=>{"label"in p&&t(0,o=p.label),"tooltip"in p&&t(1,l=p.tooltip),"checked"in p&&a(t(2,u=p.checked)),"defaultValue"in p&&t(5,c=p.defaultValue)},[o,l,u,i,d,c,m]}s(u9,"instance");var Bu=class extends Be{constructor(e){super(),De(this,e,u9,c9,Oe,{label:0,tooltip:1,checked:2,defaultValue:5})}};s(Bu,"Checkbox");var tt=Bu;(()=>{let n=Blockbench.addCSS(".checkbox_bar.svelte-1ai5ebm{flex-direction:row}.checkbox-line.svelte-1ai5ebm{display:flex;flex-direction:row;align-items:center;height:min-content;flex-grow:1}.spacer.svelte-1ai5ebm{flex-grow:1;border-bottom:2px dashed var(--color-button);height:0px;margin:8px;margin-left:0px}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();function d9(n){let e,t,i,r,a,o,l;function u(f){n[24](f)}s(u,"checkbox_checked_binding");let c={label:w("dialog.text_display_config.use_nbt.title"),tooltip:w("dialog.text_display_config.use_nbt.description")};n[10]!==void 0&&(c.checked=n[10]),e=new tt({props:c}),le.push(()=>we(e,"checked",u));let d=[p9,m9],m=[];function p(f,_){return f[12]?0:1}return s(p,"select_block_type_1"),r=p(n,[-1,-1]),a=m[r]=d[r](n),{c(){_e(e.$$.fragment),i=G(),a.c(),o=Dt()},m(f,_){me(e,f,_),L(f,i,_),m[r].m(f,_),L(f,o,_),l=!0},p(f,_){let g={};!t&&_[0]&1024&&(t=!0,g.checked=f[10],ye(()=>t=!1)),e.$set(g);let h=r;r=p(f,_),r===h?m[r].p(f,_):(Et(),Z(m[h],1,1,()=>{m[h]=null}),Tt(),a=m[r],a?a.p(f,_):(a=m[r]=d[r](f),a.c()),q(a,1),a.m(o.parentNode,o))},i(f){l||(q(e.$$.fragment,f),q(a),l=!0)},o(f){Z(e.$$.fragment,f),Z(a),l=!1},d(f){de(e,f),f&&F(i),m[r].d(f),f&&F(o)}}}s(d9,"create_else_block");function f9(n){let e,t,i,r,a,o,l,u,c,d,m,p,f,_,g,h,v,y,k,b,x,E;function C(ne){n[16](ne)}s(C,"select_value_binding");let j={label:w("dialog.text_display_config.billboard.title"),tooltip:w("dialog.text_display_config.billboard.description"),options:n[15],defaultOption:Tn.prototype.billboard};n[0]!==void 0&&(j.value=n[0]),e=new Yn({props:j}),le.push(()=>we(e,"value",C));function S(ne){n[17](ne)}s(S,"checkbox0_checked_binding");let B={label:w("dialog.text_display_config.glowing.title"),tooltip:w("dialog.text_display_config.glowing.description")};n[3]!==void 0&&(B.checked=n[3]),r=new tt({props:B}),le.push(()=>we(r,"checked",S));function O(ne){n[18](ne)}s(O,"colorpicker_value_binding");let A={label:w("dialog.text_display_config.glow_color.title"),tooltip:w("dialog.text_display_config.glow_color.description")};n[5]!==void 0&&(A.value=n[5]),l=new Zi({props:A}),le.push(()=>we(l,"value",O));function V(ne){n[19](ne)}s(V,"numberslider0_value_binding");let K={label:w("dialog.text_display_config.shadow_radius.title"),tooltip:w("dialog.text_display_config.shadow_radius.description"),min:0,max:64};n[8]!==void 0&&(K.value=n[8]),d=new Ot({props:K}),le.push(()=>we(d,"value",V));function te(ne){n[20](ne)}s(te,"numberslider1_value_binding");let fe={label:w("dialog.text_display_config.shadow_strength.title"),tooltip:w("dialog.text_display_config.shadow_strength.description"),min:0};n[9]!==void 0&&(fe.value=n[9]),f=new Ot({props:fe}),le.push(()=>we(f,"value",te));function ae(ne){n[21](ne)}s(ae,"checkbox1_checked_binding");let ee={label:w("dialog.text_display_config.override_brightness.title"),tooltip:w("dialog.text_display_config.override_brightness.description")};n[1]!==void 0&&(ee.checked=n[1]),h=new tt({props:ee}),le.push(()=>we(h,"checked",ae));let se=n[11]&&X0(n);function oe(ne){n[23](ne)}s(oe,"checkbox2_checked_binding");let xe={label:w("dialog.text_display_config.invisible.title"),tooltip:w("dialog.text_display_config.invisible.description")};return n[6]!==void 0&&(xe.checked=n[6]),b=new tt({props:xe}),le.push(()=>we(b,"checked",oe)),{c(){_e(e.$$.fragment),i=G(),_e(r.$$.fragment),o=G(),_e(l.$$.fragment),c=G(),_e(d.$$.fragment),p=G(),_e(f.$$.fragment),g=G(),_e(h.$$.fragment),y=G(),se&&se.c(),k=G(),_e(b.$$.fragment)},m(ne,pe){me(e,ne,pe),L(ne,i,pe),me(r,ne,pe),L(ne,o,pe),me(l,ne,pe),L(ne,c,pe),me(d,ne,pe),L(ne,p,pe),me(f,ne,pe),L(ne,g,pe),me(h,ne,pe),L(ne,y,pe),se&&se.m(ne,pe),L(ne,k,pe),me(b,ne,pe),E=!0},p(ne,pe){let W={};!t&&pe[0]&1&&(t=!0,W.value=ne[0],ye(()=>t=!1)),e.$set(W);let U={};!a&&pe[0]&8&&(a=!0,U.checked=ne[3],ye(()=>a=!1)),r.$set(U);let ce={};!u&&pe[0]&32&&(u=!0,ce.value=ne[5],ye(()=>u=!1)),l.$set(ce);let J={};!m&&pe[0]&256&&(m=!0,J.value=ne[8],ye(()=>m=!1)),d.$set(J);let Ce={};!_&&pe[0]&512&&(_=!0,Ce.value=ne[9],ye(()=>_=!1)),f.$set(Ce);let Y={};!v&&pe[0]&2&&(v=!0,Y.checked=ne[1],ye(()=>v=!1)),h.$set(Y),ne[11]?se?(se.p(ne,pe),pe[0]&2048&&q(se,1)):(se=X0(ne),se.c(),q(se,1),se.m(k.parentNode,k)):se&&(Et(),Z(se,1,1,()=>{se=null}),Tt());let z={};!x&&pe[0]&64&&(x=!0,z.checked=ne[6],ye(()=>x=!1)),b.$set(z)},i(ne){E||(q(e.$$.fragment,ne),q(r.$$.fragment,ne),q(l.$$.fragment,ne),q(d.$$.fragment,ne),q(f.$$.fragment,ne),q(h.$$.fragment,ne),q(se),q(b.$$.fragment,ne),E=!0)},o(ne){Z(e.$$.fragment,ne),Z(r.$$.fragment,ne),Z(l.$$.fragment,ne),Z(d.$$.fragment,ne),Z(f.$$.fragment,ne),Z(h.$$.fragment,ne),Z(se),Z(b.$$.fragment,ne),E=!1},d(ne){de(e,ne),ne&&F(i),de(r,ne),ne&&F(o),de(l,ne),ne&&F(c),de(d,ne),ne&&F(p),de(f,ne),ne&&F(g),de(h,ne),ne&&F(y),se&&se.d(ne),ne&&F(k),de(b,ne)}}}s(f9,"create_if_block");function m9(n){let e,t,i,r,a,o,l,u,c,d,m,p,f,_,g,h,v,y,k,b,x;function E(oe){n[26](oe)}s(E,"select_value_binding_1");let C={label:w("dialog.text_display_config.billboard.title"),tooltip:w("dialog.text_display_config.billboard.description"),options:n[15],defaultOption:Tn.prototype.billboard};n[0]!==void 0&&(C.value=n[0]),e=new Yn({props:C}),le.push(()=>we(e,"value",E));function j(oe){n[27](oe)}s(j,"checkbox0_checked_binding_1");let S={label:w("dialog.text_display_config.glowing.title"),tooltip:w("dialog.text_display_config.glowing.description")};n[3]!==void 0&&(S.checked=n[3]),r=new tt({props:S}),le.push(()=>we(r,"checked",j));function B(oe){n[28](oe)}s(B,"checkbox1_checked_binding_1");let O={label:w("dialog.text_display_config.override_glow_color.title"),tooltip:w("dialog.text_display_config.override_glow_color.description")};n[4]!==void 0&&(O.checked=n[4]),l=new tt({props:O}),le.push(()=>we(l,"checked",B));let A=n[13]&&W0(n);function V(oe){n[30](oe)}s(V,"numberslider0_value_binding_1");let K={label:w("dialog.text_display_config.shadow_radius.title"),tooltip:w("dialog.text_display_config.shadow_radius.description"),min:0,max:15};n[8]!==void 0&&(K.value=n[8]),m=new Ot({props:K}),le.push(()=>we(m,"value",V));function te(oe){n[31](oe)}s(te,"numberslider1_value_binding_1");let fe={label:w("dialog.text_display_config.shadow_strength.title"),tooltip:w("dialog.text_display_config.shadow_strength.description"),min:0,max:15};n[9]!==void 0&&(fe.value=n[9]),_=new Ot({props:fe}),le.push(()=>we(_,"value",te));function ae(oe){n[32](oe)}s(ae,"checkbox2_checked_binding_1");let ee={label:w("dialog.text_display_config.override_brightness.title"),tooltip:w("dialog.text_display_config.override_brightness.description")};n[1]!==void 0&&(ee.checked=n[1]),v=new tt({props:ee}),le.push(()=>we(v,"checked",ae));let se=n[11]&&Z0(n);return{c(){_e(e.$$.fragment),i=G(),_e(r.$$.fragment),o=G(),_e(l.$$.fragment),c=G(),A&&A.c(),d=G(),_e(m.$$.fragment),f=G(),_e(_.$$.fragment),h=G(),_e(v.$$.fragment),k=G(),se&&se.c(),b=Dt()},m(oe,xe){me(e,oe,xe),L(oe,i,xe),me(r,oe,xe),L(oe,o,xe),me(l,oe,xe),L(oe,c,xe),A&&A.m(oe,xe),L(oe,d,xe),me(m,oe,xe),L(oe,f,xe),me(_,oe,xe),L(oe,h,xe),me(v,oe,xe),L(oe,k,xe),se&&se.m(oe,xe),L(oe,b,xe),x=!0},p(oe,xe){let ne={};!t&&xe[0]&1&&(t=!0,ne.value=oe[0],ye(()=>t=!1)),e.$set(ne);let pe={};!a&&xe[0]&8&&(a=!0,pe.checked=oe[3],ye(()=>a=!1)),r.$set(pe);let W={};!u&&xe[0]&16&&(u=!0,W.checked=oe[4],ye(()=>u=!1)),l.$set(W),oe[13]?A?(A.p(oe,xe),xe[0]&8192&&q(A,1)):(A=W0(oe),A.c(),q(A,1),A.m(d.parentNode,d)):A&&(Et(),Z(A,1,1,()=>{A=null}),Tt());let U={};!p&&xe[0]&256&&(p=!0,U.value=oe[8],ye(()=>p=!1)),m.$set(U);let ce={};!g&&xe[0]&512&&(g=!0,ce.value=oe[9],ye(()=>g=!1)),_.$set(ce);let J={};!y&&xe[0]&2&&(y=!0,J.checked=oe[1],ye(()=>y=!1)),v.$set(J),oe[11]?se?(se.p(oe,xe),xe[0]&2048&&q(se,1)):(se=Z0(oe),se.c(),q(se,1),se.m(b.parentNode,b)):se&&(Et(),Z(se,1,1,()=>{se=null}),Tt())},i(oe){x||(q(e.$$.fragment,oe),q(r.$$.fragment,oe),q(l.$$.fragment,oe),q(A),q(m.$$.fragment,oe),q(_.$$.fragment,oe),q(v.$$.fragment,oe),q(se),x=!0)},o(oe){Z(e.$$.fragment,oe),Z(r.$$.fragment,oe),Z(l.$$.fragment,oe),Z(A),Z(m.$$.fragment,oe),Z(_.$$.fragment,oe),Z(v.$$.fragment,oe),Z(se),x=!1},d(oe){de(e,oe),oe&&F(i),de(r,oe),oe&&F(o),de(l,oe),oe&&F(c),A&&A.d(oe),oe&&F(d),de(m,oe),oe&&F(f),de(_,oe),oe&&F(h),de(v,oe),oe&&F(k),se&&se.d(oe),oe&&F(b)}}}s(m9,"create_else_block_1");function p9(n){let e,t,i,r,a;function o(u){n[25](u)}s(o,"lineinput_value_binding");let l={label:w("dialog.text_display_config.nbt.title"),tooltip:w("dialog.text_display_config.nbt.description")};return n[7]!==void 0&&(l.value=n[7]),i=new en({props:l}),le.push(()=>we(i,"value",o)),{c(){e=P("p"),e.textContent=`${w("dialog.text_display_config.use_nbt.use_nbt_warning")}`,t=G(),_e(i.$$.fragment),T(e,"class","use_nbt_warning")},m(u,c){L(u,e,c),L(u,t,c),me(i,u,c),a=!0},p(u,c){let d={};!r&&c[0]&128&&(r=!0,d.value=u[7],ye(()=>r=!1)),i.$set(d)},i(u){a||(q(i.$$.fragment,u),a=!0)},o(u){Z(i.$$.fragment,u),a=!1},d(u){u&&F(e),u&&F(t),de(i,u)}}}s(p9,"create_if_block_2");function W0(n){let e,t,i;function r(o){n[29](o)}s(r,"colorpicker_value_binding_1");let a={label:w("dialog.text_display_config.glow_color.title"),tooltip:w("dialog.text_display_config.glow_color.description")};return n[5]!==void 0&&(a.value=n[5]),e=new Zi({props:a}),le.push(()=>we(e,"value",r)),{c(){_e(e.$$.fragment)},m(o,l){me(e,o,l),i=!0},p(o,l){let u={};!t&&l[0]&32&&(t=!0,u.value=o[5],ye(()=>t=!1)),e.$set(u)},i(o){i||(q(e.$$.fragment,o),i=!0)},o(o){Z(e.$$.fragment,o),i=!1},d(o){de(e,o)}}}s(W0,"create_if_block_4");function Z0(n){let e,t,i;function r(o){n[33](o)}s(r,"numberslider_value_binding_1");let a={label:w("dialog.text_display_config.brightness_override.title"),tooltip:w("dialog.text_display_config.brightness_override.description"),min:0,max:15};return n[2]!==void 0&&(a.value=n[2]),e=new Ot({props:a}),le.push(()=>we(e,"value",r)),{c(){_e(e.$$.fragment)},m(o,l){me(e,o,l),i=!0},p(o,l){let u={};!t&&l[0]&4&&(t=!0,u.value=o[2],ye(()=>t=!1)),e.$set(u)},i(o){i||(q(e.$$.fragment,o),i=!0)},o(o){Z(e.$$.fragment,o),i=!1},d(o){de(e,o)}}}s(Z0,"create_if_block_3");function X0(n){let e,t,i;function r(o){n[22](o)}s(r,"numberslider_value_binding");let a={label:w("dialog.text_display_config.brightness_override.title"),tooltip:w("dialog.text_display_config.brightness_override.description"),min:0,max:15};return n[2]!==void 0&&(a.value=n[2]),e=new Ot({props:a}),le.push(()=>we(e,"value",r)),{c(){_e(e.$$.fragment)},m(o,l){me(e,o,l),i=!0},p(o,l){let u={};!t&&l[0]&4&&(t=!0,u.value=o[2],ye(()=>t=!1)),e.$set(u)},i(o){i||(q(e.$$.fragment,o),i=!0)},o(o){Z(e.$$.fragment,o),i=!1},d(o){de(e,o)}}}s(X0,"create_if_block_1");function _9(n){let e,t,i,r,a=[f9,d9],o=[];function l(u,c){return u[14]?0:1}return s(l,"select_block_type"),t=l(n,[-1,-1]),i=o[t]=a[t](n),{c(){e=P("div"),i.c()},m(u,c){L(u,e,c),o[t].m(e,null),r=!0},p(u,c){i.p(u,c)},i(u){r||(q(i),r=!0)},o(u){Z(i),r=!1},d(u){u&&F(e),o[t].d()}}}s(_9,"create_fragment");function g9(n,e,t){let i,r=ue,a=s(()=>(r(),r=ze(_,J=>t(11,i=J)),_),"$$subscribe_overrideBrightness"),o,l=ue,u=s(()=>(l(),l=ze(C,J=>t(12,o=J)),C),"$$subscribe_useNBT"),c,d=ue,m=s(()=>(d(),d=ze(v,J=>t(13,c=J)),v),"$$subscribe_overrideGlowColor");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l()),n.$$.on_destroy.push(()=>d());let p=!!Project?.animated_java?.enable_plugin_mode,{billboard:f}=e,{overrideBrightness:_}=e;a();let{brightnessOverride:g}=e,{glowing:h}=e,{overrideGlowColor:v}=e;m();let{glowColor:y}=e,{invisible:k}=e,{nbt:b}=e,{shadowRadius:x}=e,{shadowStrength:E}=e,{useNBT:C}=e;u();let j={fixed:w("dialog.text_display_config.billboard.options.fixed"),vertical:w("dialog.text_display_config.billboard.options.vertical"),horizontal:w("dialog.text_display_config.billboard.options.horizontal"),center:w("dialog.text_display_config.billboard.options.center")};function S(J){f=J,t(0,f)}s(S,"select_value_binding");function B(J){h=J,t(3,h)}s(B,"checkbox0_checked_binding");function O(J){y=J,t(5,y)}s(O,"colorpicker_value_binding");function A(J){x=J,t(8,x)}s(A,"numberslider0_value_binding");function V(J){E=J,t(9,E)}s(V,"numberslider1_value_binding");function K(J){_=J,a(t(1,_))}s(K,"checkbox1_checked_binding");function te(J){g=J,t(2,g)}s(te,"numberslider_value_binding");function fe(J){k=J,t(6,k)}s(fe,"checkbox2_checked_binding");function ae(J){C=J,u(t(10,C))}s(ae,"checkbox_checked_binding");function ee(J){b=J,t(7,b)}s(ee,"lineinput_value_binding");function se(J){f=J,t(0,f)}s(se,"select_value_binding_1");function oe(J){h=J,t(3,h)}s(oe,"checkbox0_checked_binding_1");function xe(J){v=J,m(t(4,v))}s(xe,"checkbox1_checked_binding_1");function ne(J){y=J,t(5,y)}s(ne,"colorpicker_value_binding_1");function pe(J){x=J,t(8,x)}s(pe,"numberslider0_value_binding_1");function W(J){E=J,t(9,E)}s(W,"numberslider1_value_binding_1");function U(J){_=J,a(t(1,_))}s(U,"checkbox2_checked_binding_1");function ce(J){g=J,t(2,g)}return s(ce,"numberslider_value_binding_1"),n.$$set=J=>{"billboard"in J&&t(0,f=J.billboard),"overrideBrightness"in J&&a(t(1,_=J.overrideBrightness)),"brightnessOverride"in J&&t(2,g=J.brightnessOverride),"glowing"in J&&t(3,h=J.glowing),"overrideGlowColor"in J&&m(t(4,v=J.overrideGlowColor)),"glowColor"in J&&t(5,y=J.glowColor),"invisible"in J&&t(6,k=J.invisible),"nbt"in J&&t(7,b=J.nbt),"shadowRadius"in J&&t(8,x=J.shadowRadius),"shadowStrength"in J&&t(9,E=J.shadowStrength),"useNBT"in J&&u(t(10,C=J.useNBT))},[f,_,g,h,v,y,k,b,x,E,C,i,o,c,p,j,S,B,O,A,V,K,te,fe,ae,ee,se,oe,xe,ne,pe,W,U,ce]}s(g9,"instance");var Ru=class extends Be{constructor(e){super(),De(this,e,g9,_9,Oe,{billboard:0,overrideBrightness:1,brightnessOverride:2,glowing:3,overrideGlowColor:4,glowColor:5,invisible:6,nbt:7,shadowRadius:8,shadowStrength:9,useNBT:10},null,[-1,-1])}};s(Ru,"TextDisplayConfigDialog");var Y0=Ru;function h9(n){let e=Tn.fromJSON(n.config??=new Tn().toJSON()),t=new ge(e.billboard),i=new ge(e.overrideBrightness),r=new ge(e.brightnessOverride),a=new ge(e.glowing),o=new ge(e.overrideGlowColor),l=new ge(e.glowColor),u=new ge(e.invisible),c=new ge(e.nbt),d=new ge(e.shadowRadius),m=new ge(e.shadowStrength),p=new ge(e.useNBT);new qt({id:`${ke.name}:textDisplayConfigDialog`,title:w("dialog.text_display_config.title"),width:400,component:Y0,props:{variant:Ne.selected,billboard:t,overrideBrightness:i,brightnessOverride:r,glowing:a,overrideGlowColor:o,glowColor:l,invisible:u,nbt:c,shadowRadius:d,shadowStrength:m,useNBT:p},preventKeybinds:!0,onConfirm(){let f=new Tn;f.billboard=t.get(),f.overrideBrightness=i.get(),f.brightnessOverride=r.get(),f.glowing=a.get(),f.overrideGlowColor=o.get(),f.glowColor=l.get(),f.invisible=u.get(),f.nbt=c.get(),f.shadowRadius=d.get(),f.shadowStrength=m.get(),f.useNBT=p.get();let _=Tn.getDefault();f.billboard===_.billboard&&(f.billboard=void 0),f.overrideBrightness===_.overrideBrightness&&(f.overrideBrightness=void 0),f.brightnessOverride===_.brightnessOverride&&(f.brightnessOverride=void 0),f.glowing===_.glowing&&(f.glowing=void 0),f.overrideGlowColor===_.overrideGlowColor&&(f.overrideGlowColor=void 0),f.glowColor===_.glowColor&&(f.glowColor=void 0),f.invisible===_.invisible&&(f.invisible=void 0),f.nbt===_.nbt&&(f.nbt=void 0),f.shadowRadius===_.shadowRadius&&(f.shadowRadius=void 0),f.shadowStrength===_.shadowStrength&&(f.shadowStrength=void 0),f.useNBT===_.useNBT&&(f.useNBT=void 0),n.config=f.toJSON()}}).show()}s(h9,"openBoneConfigDialog");var Q0=on(`${ke.name}:text_display_config`,{icon:"settings",name:w("action.open_text_display_config.name"),condition:()=>Ue(),click:()=>{qe.selected.length!==0&&h9(qe.selected[0])}});var hn=class extends OutlinerElement{name;position;rotation;scale;visibility;preview_controller=b9;movable=!0;rotatable=!0;scalable=!0;resizable=!0;get from(){return this.position}set from(e){this.position=e}get to(){return[0,0,0]}get stretch(){return[]}get uv_offset(){return[]}constructor(e,t=guid()){super(e,t),this.extend(e),this.name??="resizable_outliner_element",this.position??=[0,0,0],this.rotation??=[0,0,0],this.scale??=[1,1,1],this.visibility??=!0}get origin(){return this.position}getWorldCenter(){return Reusable.vec3.set(0,0,0),THREE.fastWorldPosition(this.mesh,Reusable.vec2).add(Reusable.vec3)}extend(e){for(let t in hn.properties)hn.properties[t].merge(this,e);return e.visibility!==void 0&&(this.visibility=e.visibility),this}selectLow(){return Project.selected_elements.safePush(this),this.selected=!0,TickUpdates.selection=!0,this}size(e,t){return e===void 0?t?this.scale.map(i=>Math.floor(i)):[...this.scale]:t?Math.floor(this.scale[e]):this.scale[e]}oldScale;resize(e,t){let i=this.oldScale!==void 0?this.oldScale:this.size(t);i instanceof Array&&(i=i[t]);let r=i<0&&t!==1?-1:1,a=typeof e=="function"?e:o=>o+e*r/16;this.scale[t]=a(i),this.preview_controller.updateGeometry?.(this),this.preview_controller.updateTransform(this)}};s(hn,"ResizableOutlinerElement");new Property(hn,"string","name",{default:"resizable_outliner_element"});new Property(hn,"vector","position",{default:[0,0,0]});new Property(hn,"vector","rotation",{default:[0,0,0]});new Property(hn,"vector","scale",{default:[1,1,1]});new Property(hn,"string","visibility",{default:!0});var b9=new NodePreviewController(hn,{setup(n){let e=new THREE.Mesh;e.isElement=!0,e.fix_rotation=new THREE.Euler(0,0,0,"ZYX"),e.fix_rotation.x=Math.degToRad(n.rotation[0]),e.fix_rotation.y=Math.degToRad(n.rotation[1]),e.fix_rotation.z=Math.degToRad(n.rotation[2]),e.fix_position=new THREE.Vector3(...n.position),e.fix_scale=new THREE.Vector3(...n.scale),Project.nodes_3d[n.uuid]=e,n.preview_controller.updateGeometry?.(n),n.preview_controller.dispatchEvent("setup",{element:n})},updateTransform(n){NodePreviewController.prototype.updateTransform.call(n.preview_controller,n),n.mesh.fix_position&&(n.mesh.fix_position.set(...n.position),n.parent instanceof Group&&(n.mesh.fix_position.x-=n.parent.origin[0],n.mesh.fix_position.y-=n.parent.origin[1],n.mesh.fix_position.z-=n.parent.origin[2])),n.mesh.fix_rotation&&n.mesh.fix_rotation.copy(n.mesh.rotation),n.mesh.fix_scale&&(n.mesh.fix_scale.set(...n.scale),Tg(n.mesh.fix_scale)),n.preview_controller.dispatchEvent("update_transform",{element:n})}});function v9(n){let e,t,i,r,a,o,l;function u(f){n[30](f)}s(u,"checkbox_checked_binding");let c={label:w("dialog.bone_config.use_nbt.title"),tooltip:w("dialog.bone_config.use_nbt.description"),defaultValue:Te.prototype.useNBT};n[12]!==void 0&&(c.checked=n[12]),e=new tt({props:c}),le.push(()=>we(e,"checked",u));let d=[x9,w9],m=[];function p(f,_){return f[14]?0:1}return s(p,"select_block_type_1"),r=p(n,[-1,-1]),a=m[r]=d[r](n),{c(){_e(e.$$.fragment),i=G(),a.c(),o=Dt()},m(f,_){me(e,f,_),L(f,i,_),m[r].m(f,_),L(f,o,_),l=!0},p(f,_){let g={};!t&&_[0]&4096&&(t=!0,g.checked=f[12],ye(()=>t=!1)),e.$set(g);let h=r;r=p(f,_),r===h?m[r].p(f,_):(Et(),Z(m[h],1,1,()=>{m[h]=null}),Tt(),a=m[r],a?a.p(f,_):(a=m[r]=d[r](f),a.c()),q(a,1),a.m(o.parentNode,o))},i(f){l||(q(e.$$.fragment,f),q(a),l=!0)},o(f){Z(e.$$.fragment,f),Z(a),l=!1},d(f){de(e,f),f&&F(i),m[r].d(f),f&&F(o)}}}s(v9,"create_else_block");function y9(n){let e,t,i,r,a,o,l,u,c,d,m,p,f,_,g,h,v,y,k,b,x,E,C,j,S,B,O,A;function V(H){n[20](H)}s(V,"select_value_binding");let K={label:w("dialog.bone_config.billboard.title"),tooltip:w("dialog.bone_config.billboard.description"),options:n[17],defaultOption:Te.prototype.billboard};n[2]!==void 0&&(K.value=n[2]),e=new Yn({props:K}),le.push(()=>we(e,"value",V));function te(H){n[21](H)}s(te,"lineinput_value_binding");let fe={label:w("dialog.bone_config.custom_name.title"),tooltip:w("dialog.bone_config.custom_name.description"),defaultValue:Te.prototype.customName,valueChecker:n[19]};n[0]!==void 0&&(fe.value=n[0]),r=new en({props:fe}),le.push(()=>we(r,"value",te));function ae(H){n[22](H)}s(ae,"checkbox0_checked_binding");let ee={label:w("dialog.bone_config.custom_name_visible.title"),tooltip:w("dialog.bone_config.custom_name_visible.description"),defaultValue:Te.prototype.customNameVisible};n[1]!==void 0&&(ee.checked=n[1]),l=new tt({props:ee}),le.push(()=>we(l,"checked",ae));function se(H){n[23](H)}s(se,"checkbox1_checked_binding");let oe={label:w("dialog.bone_config.glowing.title"),tooltip:w("dialog.bone_config.glowing.description"),defaultValue:Te.prototype.glowing};n[5]!==void 0&&(oe.checked=n[5]),d=new tt({props:oe}),le.push(()=>we(d,"checked",se));function xe(H){n[24](H)}s(xe,"colorpicker_value_binding");let ne={label:w("dialog.bone_config.glow_color.title"),tooltip:w("dialog.bone_config.glow_color.description")};n[7]!==void 0&&(ne.value=n[7]),f=new Zi({props:ne}),le.push(()=>we(f,"value",xe));function pe(H){n[25](H)}s(pe,"numberslider0_value_binding");let W={label:w("dialog.bone_config.shadow_radius.title"),tooltip:w("dialog.bone_config.shadow_radius.description"),defaultValue:Te.prototype.shadowRadius,min:0,max:64};n[10]!==void 0&&(W.value=n[10]),h=new Ot({props:W}),le.push(()=>we(h,"value",pe));function U(H){n[26](H)}s(U,"numberslider1_value_binding");let ce={label:w("dialog.bone_config.shadow_strength.title"),tooltip:w("dialog.bone_config.shadow_strength.description"),defaultValue:Te.prototype.shadowStrength,min:0};n[11]!==void 0&&(ce.value=n[11]),k=new Ot({props:ce}),le.push(()=>we(k,"value",U));function J(H){n[27](H)}s(J,"checkbox2_checked_binding");let Ce={label:w("dialog.bone_config.override_brightness.title"),tooltip:w("dialog.bone_config.override_brightness.description"),defaultValue:Te.prototype.overrideBrightness};n[3]!==void 0&&(Ce.checked=n[3]),E=new tt({props:Ce}),le.push(()=>we(E,"checked",J));let Y=n[13]&&nv(n);function z(H){n[29](H)}s(z,"checkbox3_checked_binding");let be={label:w("dialog.bone_config.invisible.title"),tooltip:w("dialog.bone_config.invisible.description"),defaultValue:Te.prototype.invisible};return n[8]!==void 0&&(be.checked=n[8]),B=new tt({props:be}),le.push(()=>we(B,"checked",z)),{c(){_e(e.$$.fragment),i=G(),_e(r.$$.fragment),o=G(),_e(l.$$.fragment),c=G(),_e(d.$$.fragment),p=G(),_e(f.$$.fragment),g=G(),_e(h.$$.fragment),y=G(),_e(k.$$.fragment),x=G(),_e(E.$$.fragment),j=G(),Y&&Y.c(),S=G(),_e(B.$$.fragment)},m(H,ie){me(e,H,ie),L(H,i,ie),me(r,H,ie),L(H,o,ie),me(l,H,ie),L(H,c,ie),me(d,H,ie),L(H,p,ie),me(f,H,ie),L(H,g,ie),me(h,H,ie),L(H,y,ie),me(k,H,ie),L(H,x,ie),me(E,H,ie),L(H,j,ie),Y&&Y.m(H,ie),L(H,S,ie),me(B,H,ie),A=!0},p(H,ie){let Ie={};!t&&ie[0]&4&&(t=!0,Ie.value=H[2],ye(()=>t=!1)),e.$set(Ie);let Q={};!a&&ie[0]&1&&(a=!0,Q.value=H[0],ye(()=>a=!1)),r.$set(Q);let st={};!u&&ie[0]&2&&(u=!0,st.checked=H[1],ye(()=>u=!1)),l.$set(st);let at={};!m&&ie[0]&32&&(m=!0,at.checked=H[5],ye(()=>m=!1)),d.$set(at);let Vt={};!_&&ie[0]&128&&(_=!0,Vt.value=H[7],ye(()=>_=!1)),f.$set(Vt);let We={};!v&&ie[0]&1024&&(v=!0,We.value=H[10],ye(()=>v=!1)),h.$set(We);let wt={};!b&&ie[0]&2048&&(b=!0,wt.value=H[11],ye(()=>b=!1)),k.$set(wt);let Jt={};!C&&ie[0]&8&&(C=!0,Jt.checked=H[3],ye(()=>C=!1)),E.$set(Jt),H[13]?Y?(Y.p(H,ie),ie[0]&8192&&q(Y,1)):(Y=nv(H),Y.c(),q(Y,1),Y.m(S.parentNode,S)):Y&&(Et(),Z(Y,1,1,()=>{Y=null}),Tt());let X={};!O&&ie[0]&256&&(O=!0,X.checked=H[8],ye(()=>O=!1)),B.$set(X)},i(H){A||(q(e.$$.fragment,H),q(r.$$.fragment,H),q(l.$$.fragment,H),q(d.$$.fragment,H),q(f.$$.fragment,H),q(h.$$.fragment,H),q(k.$$.fragment,H),q(E.$$.fragment,H),q(Y),q(B.$$.fragment,H),A=!0)},o(H){Z(e.$$.fragment,H),Z(r.$$.fragment,H),Z(l.$$.fragment,H),Z(d.$$.fragment,H),Z(f.$$.fragment,H),Z(h.$$.fragment,H),Z(k.$$.fragment,H),Z(E.$$.fragment,H),Z(Y),Z(B.$$.fragment,H),A=!1},d(H){de(e,H),H&&F(i),de(r,H),H&&F(o),de(l,H),H&&F(c),de(d,H),H&&F(p),de(f,H),H&&F(g),de(h,H),H&&F(y),de(k,H),H&&F(x),de(E,H),H&&F(j),Y&&Y.d(H),H&&F(S),de(B,H)}}}s(y9,"create_if_block");function w9(n){let e,t,i,r,a,o,l,u,c,d,m,p,f,_,g,h,v,y,k,b,x,E,C,j,S,B,O;function A(z){n[32](z)}s(A,"lineinput_value_binding_2");let V={label:w("dialog.bone_config.custom_name.title"),tooltip:w("dialog.bone_config.custom_name.description"),defaultValue:Te.prototype.customName,valueChecker:n[19]};n[0]!==void 0&&(V.value=n[0]),e=new en({props:V}),le.push(()=>we(e,"value",A));function K(z){n[33](z)}s(K,"checkbox0_checked_binding_1");let te={label:w("dialog.bone_config.custom_name_visible.title"),tooltip:w("dialog.bone_config.custom_name_visible.description"),defaultValue:Te.prototype.customNameVisible};n[1]!==void 0&&(te.checked=n[1]),r=new tt({props:te}),le.push(()=>we(r,"checked",K));function fe(z){n[34](z)}s(fe,"select_value_binding_1");let ae={label:w("dialog.bone_config.billboard.title"),tooltip:w("dialog.bone_config.billboard.description"),options:n[17],defaultOption:Te.prototype.billboard};n[2]!==void 0&&(ae.value=n[2]),l=new Yn({props:ae}),le.push(()=>we(l,"value",fe));function ee(z){n[35](z)}s(ee,"checkbox1_checked_binding_1");let se={label:w("dialog.bone_config.glowing.title"),tooltip:w("dialog.bone_config.glowing.description"),defaultValue:Te.prototype.glowing};n[5]!==void 0&&(se.checked=n[5]),d=new tt({props:se}),le.push(()=>we(d,"checked",ee));function oe(z){n[36](z)}s(oe,"checkbox2_checked_binding_1");let xe={label:w("dialog.bone_config.override_glow_color.title"),tooltip:w("dialog.bone_config.override_glow_color.description"),defaultValue:Te.prototype.overrideGlowColor};n[6]!==void 0&&(xe.checked=n[6]),f=new tt({props:xe}),le.push(()=>we(f,"checked",oe));let ne=n[15]&&ev(n);function pe(z){n[38](z)}s(pe,"numberslider0_value_binding_1");let W={label:w("dialog.bone_config.shadow_radius.title"),tooltip:w("dialog.bone_config.shadow_radius.description"),defaultValue:Te.prototype.shadowRadius,min:0,max:15};n[10]!==void 0&&(W.value=n[10]),v=new Ot({props:W}),le.push(()=>we(v,"value",pe));function U(z){n[39](z)}s(U,"numberslider1_value_binding_1");let ce={label:w("dialog.bone_config.shadow_strength.title"),tooltip:w("dialog.bone_config.shadow_strength.description"),defaultValue:Te.prototype.shadowStrength,min:0,max:15};n[11]!==void 0&&(ce.value=n[11]),b=new Ot({props:ce}),le.push(()=>we(b,"value",U));function J(z){n[40](z)}s(J,"checkbox3_checked_binding_1");let Ce={label:w("dialog.bone_config.override_brightness.title"),tooltip:w("dialog.bone_config.override_brightness.description"),defaultValue:Te.prototype.overrideBrightness};n[3]!==void 0&&(Ce.checked=n[3]),C=new tt({props:Ce}),le.push(()=>we(C,"checked",J));let Y=n[13]&&tv(n);return{c(){_e(e.$$.fragment),i=G(),_e(r.$$.fragment),o=G(),_e(l.$$.fragment),c=G(),_e(d.$$.fragment),p=G(),_e(f.$$.fragment),g=G(),ne&&ne.c(),h=G(),_e(v.$$.fragment),k=G(),_e(b.$$.fragment),E=G(),_e(C.$$.fragment),S=G(),Y&&Y.c(),B=Dt()},m(z,be){me(e,z,be),L(z,i,be),me(r,z,be),L(z,o,be),me(l,z,be),L(z,c,be),me(d,z,be),L(z,p,be),me(f,z,be),L(z,g,be),ne&&ne.m(z,be),L(z,h,be),me(v,z,be),L(z,k,be),me(b,z,be),L(z,E,be),me(C,z,be),L(z,S,be),Y&&Y.m(z,be),L(z,B,be),O=!0},p(z,be){let H={};!t&&be[0]&1&&(t=!0,H.value=z[0],ye(()=>t=!1)),e.$set(H);let ie={};!a&&be[0]&2&&(a=!0,ie.checked=z[1],ye(()=>a=!1)),r.$set(ie);let Ie={};!u&&be[0]&4&&(u=!0,Ie.value=z[2],ye(()=>u=!1)),l.$set(Ie);let Q={};!m&&be[0]&32&&(m=!0,Q.checked=z[5],ye(()=>m=!1)),d.$set(Q);let st={};!_&&be[0]&64&&(_=!0,st.checked=z[6],ye(()=>_=!1)),f.$set(st),z[15]?ne?(ne.p(z,be),be[0]&32768&&q(ne,1)):(ne=ev(z),ne.c(),q(ne,1),ne.m(h.parentNode,h)):ne&&(Et(),Z(ne,1,1,()=>{ne=null}),Tt());let at={};!y&&be[0]&1024&&(y=!0,at.value=z[10],ye(()=>y=!1)),v.$set(at);let Vt={};!x&&be[0]&2048&&(x=!0,Vt.value=z[11],ye(()=>x=!1)),b.$set(Vt);let We={};!j&&be[0]&8&&(j=!0,We.checked=z[3],ye(()=>j=!1)),C.$set(We),z[13]?Y?(Y.p(z,be),be[0]&8192&&q(Y,1)):(Y=tv(z),Y.c(),q(Y,1),Y.m(B.parentNode,B)):Y&&(Et(),Z(Y,1,1,()=>{Y=null}),Tt())},i(z){O||(q(e.$$.fragment,z),q(r.$$.fragment,z),q(l.$$.fragment,z),q(d.$$.fragment,z),q(f.$$.fragment,z),q(ne),q(v.$$.fragment,z),q(b.$$.fragment,z),q(C.$$.fragment,z),q(Y),O=!0)},o(z){Z(e.$$.fragment,z),Z(r.$$.fragment,z),Z(l.$$.fragment,z),Z(d.$$.fragment,z),Z(f.$$.fragment,z),Z(ne),Z(v.$$.fragment,z),Z(b.$$.fragment,z),Z(C.$$.fragment,z),Z(Y),O=!1},d(z){de(e,z),z&&F(i),de(r,z),z&&F(o),de(l,z),z&&F(c),de(d,z),z&&F(p),de(f,z),z&&F(g),ne&&ne.d(z),z&&F(h),de(v,z),z&&F(k),de(b,z),z&&F(E),de(C,z),z&&F(S),Y&&Y.d(z),z&&F(B)}}}s(w9,"create_else_block_1");function x9(n){let e,t,i,r,a;function o(u){n[31](u)}s(o,"lineinput_value_binding_1");let l={label:w("dialog.bone_config.nbt.title"),tooltip:w("dialog.bone_config.nbt.description"),defaultValue:Te.prototype.nbt,valueChecker:n[18]};return n[9]!==void 0&&(l.value=n[9]),i=new en({props:l}),le.push(()=>we(i,"value",o)),{c(){e=P("p"),e.textContent=`${w("dialog.bone_config.use_nbt.use_nbt_warning")}`,t=G(),_e(i.$$.fragment),T(e,"class","use_nbt_warning")},m(u,c){L(u,e,c),L(u,t,c),me(i,u,c),a=!0},p(u,c){let d={};!r&&c[0]&512&&(r=!0,d.value=u[9],ye(()=>r=!1)),i.$set(d)},i(u){a||(q(i.$$.fragment,u),a=!0)},o(u){Z(i.$$.fragment,u),a=!1},d(u){u&&F(e),u&&F(t),de(i,u)}}}s(x9,"create_if_block_2");function ev(n){let e,t,i;function r(o){n[37](o)}s(r,"colorpicker_value_binding_1");let a={label:w("dialog.bone_config.glow_color.title"),tooltip:w("dialog.bone_config.glow_color.description")};return n[7]!==void 0&&(a.value=n[7]),e=new Zi({props:a}),le.push(()=>we(e,"value",r)),{c(){_e(e.$$.fragment)},m(o,l){me(e,o,l),i=!0},p(o,l){let u={};!t&&l[0]&128&&(t=!0,u.value=o[7],ye(()=>t=!1)),e.$set(u)},i(o){i||(q(e.$$.fragment,o),i=!0)},o(o){Z(e.$$.fragment,o),i=!1},d(o){de(e,o)}}}s(ev,"create_if_block_4");function tv(n){let e,t,i;function r(o){n[41](o)}s(r,"numberslider_value_binding_1");let a={label:w("dialog.bone_config.brightness_override.title"),tooltip:w("dialog.bone_config.brightness_override.description"),defaultValue:Te.prototype.brightnessOverride,min:0,max:15};return n[4]!==void 0&&(a.value=n[4]),e=new Ot({props:a}),le.push(()=>we(e,"value",r)),{c(){_e(e.$$.fragment)},m(o,l){me(e,o,l),i=!0},p(o,l){let u={};!t&&l[0]&16&&(t=!0,u.value=o[4],ye(()=>t=!1)),e.$set(u)},i(o){i||(q(e.$$.fragment,o),i=!0)},o(o){Z(e.$$.fragment,o),i=!1},d(o){de(e,o)}}}s(tv,"create_if_block_3");function nv(n){let e,t,i;function r(o){n[28](o)}s(r,"numberslider_value_binding");let a={label:w("dialog.bone_config.brightness_override.title"),tooltip:w("dialog.bone_config.brightness_override.description"),defaultValue:Te.prototype.brightnessOverride,min:0,max:15};return n[4]!==void 0&&(a.value=n[4]),e=new Ot({props:a}),le.push(()=>we(e,"value",r)),{c(){_e(e.$$.fragment)},m(o,l){me(e,o,l),i=!0},p(o,l){let u={};!t&&l[0]&16&&(t=!0,u.value=o[4],ye(()=>t=!1)),e.$set(u)},i(o){i||(q(e.$$.fragment,o),i=!0)},o(o){Z(e.$$.fragment,o),i=!1},d(o){de(e,o)}}}s(nv,"create_if_block_1");function k9(n){let e,t,i,r,a=[y9,v9],o=[];function l(u,c){return u[16]?0:1}return s(l,"select_block_type"),t=l(n,[-1,-1]),i=o[t]=a[t](n),{c(){e=P("div"),i.c()},m(u,c){L(u,e,c),o[t].m(e,null),r=!0},p(u,c){i.p(u,c)},i(u){r||(q(i),r=!0)},o(u){Z(i),r=!1},d(u){u&&F(e),o[t].d()}}}s(k9,"create_fragment");function E9(n,e,t){let i,r=ue,a=s(()=>(r(),r=ze(h,Q=>t(13,i=Q)),h),"$$subscribe_overrideBrightness"),o,l=ue,u=s(()=>(l(),l=ze(S,Q=>t(14,o=Q)),S),"$$subscribe_useNBT"),c,d=ue,m=s(()=>(d(),d=ze(k,Q=>t(15,c=Q)),k),"$$subscribe_overrideGlowColor");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l()),n.$$.on_destroy.push(()=>d());let p=!!Project?.animated_java?.enable_plugin_mode,{customName:f}=e,{customNameVisible:_}=e,{billboard:g}=e,{overrideBrightness:h}=e;a();let{brightnessOverride:v}=e,{glowing:y}=e,{overrideGlowColor:k}=e;m();let{glowColor:b}=e,{invisible:x}=e,{nbt:E}=e,{shadowRadius:C}=e,{shadowStrength:j}=e,{useNBT:S}=e;u();let B={fixed:w("dialog.bone_config.billboard.options.fixed"),vertical:w("dialog.bone_config.billboard.options.vertical"),horizontal:w("dialog.bone_config.billboard.options.horizontal"),center:w("dialog.bone_config.billboard.options.center")},O=s(Q=>{let st;try{st=Ze.fromString(Q)}catch(at){return{type:"error",message:w("dialog.bone_config.nbt.invalid_nbt.error",at.message)}}return st instanceof Ye?{type:"success",message:""}:{type:"error",message:w("dialog.bone_config.nbt.invalid_nbt.not_compound")}},"nbtChecker"),A=s(Q=>{if(Q==="")return{type:"success",message:""};try{$t.fromString(Q)}catch(st){return{type:"error",message:w("dialog.bone_config.custom_name.invalid_json.error",st.message)}}return{type:"success",message:""}},"customNameChecker");function V(Q){g=Q,t(2,g)}s(V,"select_value_binding");function K(Q){f=Q,t(0,f)}s(K,"lineinput_value_binding");function te(Q){_=Q,t(1,_)}s(te,"checkbox0_checked_binding");function fe(Q){y=Q,t(5,y)}s(fe,"checkbox1_checked_binding");function ae(Q){b=Q,t(7,b)}s(ae,"colorpicker_value_binding");function ee(Q){C=Q,t(10,C)}s(ee,"numberslider0_value_binding");function se(Q){j=Q,t(11,j)}s(se,"numberslider1_value_binding");function oe(Q){h=Q,a(t(3,h))}s(oe,"checkbox2_checked_binding");function xe(Q){v=Q,t(4,v)}s(xe,"numberslider_value_binding");function ne(Q){x=Q,t(8,x)}s(ne,"checkbox3_checked_binding");function pe(Q){S=Q,u(t(12,S))}s(pe,"checkbox_checked_binding");function W(Q){E=Q,t(9,E)}s(W,"lineinput_value_binding_1");function U(Q){f=Q,t(0,f)}s(U,"lineinput_value_binding_2");function ce(Q){_=Q,t(1,_)}s(ce,"checkbox0_checked_binding_1");function J(Q){g=Q,t(2,g)}s(J,"select_value_binding_1");function Ce(Q){y=Q,t(5,y)}s(Ce,"checkbox1_checked_binding_1");function Y(Q){k=Q,m(t(6,k))}s(Y,"checkbox2_checked_binding_1");function z(Q){b=Q,t(7,b)}s(z,"colorpicker_value_binding_1");function be(Q){C=Q,t(10,C)}s(be,"numberslider0_value_binding_1");function H(Q){j=Q,t(11,j)}s(H,"numberslider1_value_binding_1");function ie(Q){h=Q,a(t(3,h))}s(ie,"checkbox3_checked_binding_1");function Ie(Q){v=Q,t(4,v)}return s(Ie,"numberslider_value_binding_1"),n.$$set=Q=>{"customName"in Q&&t(0,f=Q.customName),"customNameVisible"in Q&&t(1,_=Q.customNameVisible),"billboard"in Q&&t(2,g=Q.billboard),"overrideBrightness"in Q&&a(t(3,h=Q.overrideBrightness)),"brightnessOverride"in Q&&t(4,v=Q.brightnessOverride),"glowing"in Q&&t(5,y=Q.glowing),"overrideGlowColor"in Q&&m(t(6,k=Q.overrideGlowColor)),"glowColor"in Q&&t(7,b=Q.glowColor),"invisible"in Q&&t(8,x=Q.invisible),"nbt"in Q&&t(9,E=Q.nbt),"shadowRadius"in Q&&t(10,C=Q.shadowRadius),"shadowStrength"in Q&&t(11,j=Q.shadowStrength),"useNBT"in Q&&u(t(12,S=Q.useNBT))},[f,_,g,h,v,y,k,b,x,E,C,j,S,i,o,c,p,B,O,A,V,K,te,fe,ae,ee,se,oe,xe,ne,pe,W,U,ce,J,Ce,Y,z,be,H,ie,Ie]}s(E9,"instance");var Du=class extends Be{constructor(e){super(),De(this,e,E9,k9,Oe,{customName:0,customNameVisible:1,billboard:2,overrideBrightness:3,brightnessOverride:4,glowing:5,overrideGlowColor:6,glowColor:7,invisible:8,nbt:9,shadowRadius:10,shadowStrength:11,useNBT:12},null,[-1,-1])}};s(Du,"VanillaBlockDisplayConfigDialog");var iv=Du;function T9(n){let e=Te.fromJSON(n.config??=new Te().toJSON()),t=new ge(e.customName),i=new ge(e.customNameVisible),r=new ge(e.billboard),a=new ge(e.overrideBrightness),o=new ge(e.brightnessOverride),l=new ge(e.glowing),u=new ge(e.overrideGlowColor),c=new ge(e.glowColor),d=new ge(e.invisible),m=new ge(e.nbt),p=new ge(e.shadowRadius),f=new ge(e.shadowStrength),_=new ge(e.useNBT);new qt({id:`${ke.name}:vanillaItemDisplayConfigDialog`,title:w("dialog.vanilla_block_display_config.title"),width:400,component:iv,props:{variant:Ne.selected,customName:t,customNameVisible:i,billboard:r,overrideBrightness:a,brightnessOverride:o,glowing:l,overrideGlowColor:u,glowColor:c,invisible:d,nbt:m,shadowRadius:p,shadowStrength:f,useNBT:_},preventKeybinds:!0,onConfirm(){let g=new Te;g.customName=t.get(),g.customNameVisible=i.get(),g.billboard=r.get(),g.overrideBrightness=a.get(),g.brightnessOverride=o.get(),g.glowing=l.get(),g.overrideGlowColor=u.get(),g.glowColor=c.get(),g.invisible=d.get(),g.nbt=m.get(),g.shadowRadius=p.get(),g.shadowStrength=f.get(),g.useNBT=_.get();let h=Te.getDefault();g.customName===h.customName&&(g.customName=void 0),g.customNameVisible===h.customNameVisible&&(g.customNameVisible=void 0),g.billboard===h.billboard&&(g.billboard=void 0),g.overrideBrightness===h.overrideBrightness&&(g.overrideBrightness=void 0),g.brightnessOverride===h.brightnessOverride&&(g.brightnessOverride=void 0),g.glowing===h.glowing&&(g.glowing=void 0),g.overrideGlowColor===h.overrideGlowColor&&(g.overrideGlowColor=void 0),g.glowColor===h.glowColor&&(g.glowColor=void 0),g.invisible===h.invisible&&(g.invisible=void 0),g.nbt===h.nbt&&(g.nbt=void 0),g.shadowRadius===h.shadowRadius&&(g.shadowRadius=void 0),g.shadowStrength===h.shadowStrength&&(g.shadowStrength=void 0),g.useNBT===h.useNBT&&(g.useNBT=void 0),n.config=g.toJSON()}}).show()}s(T9,"openVanillaBlockDisplayConfigDialog");var rv=on(`${ke.name}:open_vanilla_block_display_config`,{icon:"settings",name:w("action.open_vanilla_block_display_config.name"),condition:()=>Ue(),click:()=>{ht.selected.length!==0&&T9(ht.selected[0])}});var Hm={};xn(Hm,{getBlockModel:()=>Jm,parseBlockModel:()=>fr,parseBlockState:()=>lv});var Mu=` attribute float highlight; uniform bool SHADE; @@ -2953,7 +2959,7 @@ ${t}`}};s(kt,"ParserError");var au=class{constructor(e){this.str=e;this.s=new jb vUv = uv; vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); gl_Position = projectionMatrix * mvPosition; - }`,Eu=` + }`,Fu=` #ifdef GL_ES precision highp float; #endif @@ -2994,94 +3000,94 @@ ${t}`}};s(kt,"ParserError");var au=class{constructor(e){this.str=e;this.s=new jb gl_FragColor.r = gl_FragColor.r * 0.6; gl_FragColor.g = gl_FragColor.g * 0.7; } - }`;var P7=new THREE.TextureLoader,x0=new Map,k0=new Map([["water",w("block_model_manager.fluid_warning")],["lava",w("block_model_manager.fluid_warning")],["player_head",w("block_model_manager.mob_head_warning")],["player_wall_head",w("block_model_manager.mob_head_warning")],["skeleton_skull",w("block_model_manager.mob_head_warning")],["skeleton_wall_skull",w("block_model_manager.mob_head_warning")],["wither_skeleton_skull",w("block_model_manager.mob_head_warning")],["wither_skeleton_wall_skull",w("block_model_manager.mob_head_warning")],["creeper_head",w("block_model_manager.mob_head_warning")],["creeper_wall_head",w("block_model_manager.mob_head_warning")],["zombie_head",w("block_model_manager.mob_head_warning")],["zombie_wall_head",w("block_model_manager.mob_head_warning")],["dragon_head",w("block_model_manager.mob_head_warning")],["dragon_wall_head",w("block_model_manager.mob_head_warning")],["piglin_head",w("block_model_manager.mob_head_warning")],["piglin_wall_head",w("block_model_manager.mob_head_warning")]]);async function Cm(n){await Tl();let e=x0.get(n);if(!e){let t=await xo(n);if(!t)return;if(k0.has(n))throw new Error(k0.get(n));e=await T0(t),x0.set(n,e)}if(e){e={mesh:e.mesh.clone(!0),outline:e.outline.clone(!0),boundingBox:e.boundingBox.clone(),isBlock:!0};for(let t of e.mesh.children)t.geometry=t.geometry.clone();return e.mesh.geometry=e.mesh.geometry.clone(),e.mesh.name=n,e.mesh.isVanillaBlockModel=!0,e}}s(Cm,"getBlockModel");async function ar(n,e){let t=hr(n.model,"models"),i=Gr(t+".json");if(e&&(e.textures!==void 0&&(i.textures??={},Object.assign(i.textures,e.textures)),e.elements!==void 0&&(i.elements=e.elements),e.display!==void 0&&(i.display=Object.assign(i.display||{},e.display)),e.ambientocclusion!==void 0&&(i.ambientocclusion=e.ambientocclusion)),i.parent){let r={...n,model:i.parent};return await ar(r,i)}return await V7(n,i)}s(ar,"parseBlockModel");async function V7(n,e){if(console.log(`Generating block mesh for '${n.model}' from `,n,e),!e.elements)throw new Error(`No elements defined in block model '${n.model}'`);if(!e.textures)throw new Error(`No textures defined in block model '${n.model}'`);let t=new THREE.Mesh,i=[],r=[];for(let c of e.elements){let u=[c.to[0]-c.from[0],c.to[1]-c.from[1],c.to[2]-c.from[2]],d=[c.from[0]+(c.to[0]-c.from[0])/2,c.from[1]+(c.to[1]-c.from[1])/2,c.from[2]+(c.to[2]-c.from[2])/2];u[0]===0&&(u[0]+=.01,d[0]-=.005),u[1]===0&&(u[1]+=.01,d[1]-=.005),u[2]===0&&(u[2]+=.01,d[2]-=.005);let m=new THREE.BoxGeometry(...u);if(m.translate(...d),c.rotation){let h;c.rotation.rescale&&(h=getRescalingFactor(c.rotation.angle));let b=c.rotation.origin;switch(b&&m.translate(...b.map(x=>-x)),c.rotation.axis){case"x":m.rotateX(Math.degToRad(c.rotation.angle)),h!==void 0&&m.scale(1,h,h);break;case"y":m.rotateY(Math.degToRad(c.rotation.angle)),h!==void 0&&m.scale(h,1,h);break;case"z":m.rotateZ(Math.degToRad(c.rotation.angle)),h!==void 0&&m.scale(h,h,1);break}b&&m.translate(...b)}m.translate(-8,-8,-8),n.x&&m.rotateX(Math.degToRad(n.x)),n.y&&m.rotateY(-Math.degToRad(n.y)),n.isItemModel?m.translate(0,8,0):m.translate(8,8,8);let p=[];for(let h=0;h<6;h++)p.push(0+h*4,2+h*4,1+h*4,2+h*4,3+h*4,1+h*4),m.addGroup(h*6,6,h);if(m.setIndex(p),m.setAttribute("highlight",new THREE.BufferAttribute(new Uint8Array(m.attributes.position.count),1)),!c.faces)throw new Error(`No faces defined in element for block model '${n.model}'`);let f=[],_=[];for(let h of Canvas.face_order){let b=c.faces[h];if(!b){_.push(Canvas.transparentMaterial),f.push(0,0,0,0,0,0,0,0);continue}let x=(await E0(e.textures,b.texture)).clone(),y=new THREE.ShaderMaterial({uniforms:{map:new THREE.Uniform(x),SHADE:{type:"bool",value:settings.shading.value},LIGHTCOLOR:{type:"vec3",value:new THREE.Color().copy(Canvas.global_light_color).multiplyScalar(settings.brightness.value/50)},LIGHTSIDE:{type:"int",value:Canvas.global_light_side},EMISSIVE:{type:"bool",value:!1}},vertexShader:ku,fragmentShader:Eu,blending:THREE.NormalBlending,side:Canvas.getRenderSide(),transparent:!0});y.map=x,y.name=n.model,_.push(y);let k=16,C=16;if(b.uv){let[A,I,S,L]=b.uv,O=[[A/k,I/C],[S/k,I/C],[A/k,L/C],[S/k,L/C]];if(b.rotation){let E=b.rotation+0;for(;E>0;){let B=O[0];O[0]=O[2],O[2]=O[3],O[3]=O[1],O[1]=B,E-=90}}x.flipY=!1,f.push(...O.flat())}else{let[A,I,S]=c.from,[L,O,E]=u;switch(h){case"down":f.push(A/k,S/C,(A+L)/k,S/C,A/k,(S+E)/C,(A+L)/k,(S+E)/C);break;case"up":f.push(A/k,S/C,(A+L)/k,S/C,A/k,(S+E)/C,(A+L)/k,(S+E)/C);break;case"north":f.push((A+L)/k,(I+O)/C,A/k,(I+O)/C,(A+L)/k,I/C,A/k,I/C);break;case"south":f.push((A+L)/k,(I+O)/C,A/k,(I+O)/C,(A+L)/k,I/C,A/k,I/C);break;case"west":f.push((S+E)/k,(I+O)/C,S/k,(I+O)/C,(S+E)/k,I/C,S/k,I/C);break;case"east":f.push((S+E)/k,(I+O)/C,S/k,(I+O)/C,(S+E)/k,I/C,S/k,I/C);break}}x.needsUpdate=!0}m.setAttribute("uv",new THREE.Float32BufferAttribute(f,2)),m.attributes.uv.needsUpdate=!0,i.push(m.clone());let v=new THREE.EdgesGeometry(m);r.push(v);let g=new THREE.Mesh(m,_);t.add(g)}let a=jr(r),o=new THREE.LineSegments(a,Canvas.outlineMaterial),l=jr(i);return o.no_export=!0,o.renderOrder=2,o.frustumCulled=!1,{mesh:t,outline:o,boundingBox:l,isBlock:!0}}s(V7,"generateModelMesh");var Tm=new Map;async function E0(n,e){e.at(0)==="#"&&(e=e.slice(1));let t=n[e];if(t?.at(0)==="#")return await E0(n,t.slice(1));let i=hr(t,"textures")+".png";if(Tm.has(i))return Tm.get(i);let r=await P7.loadAsync($a(i));return r.magFilter=THREE.NearestFilter,r.minFilter=THREE.NearestFilter,Tm.set(i,r),r}s(E0,"loadTexture");async function T0(n){let e=hr(n.resourceLocation,"blockstates"),t=await Gr(e+".json");if(!n.blockStateRegistryEntry)throw new Error(`Block state registry entry not found for '${n.resource.name}'`);n.states=Object.assign({},n.blockStateRegistryEntry.defaultStates,n.states);for(let[i,r]of Object.entries(n.states))if(n.blockStateRegistryEntry.stateValues[i]){if(!n.blockStateRegistryEntry.stateValues[i].includes(r))throw new Error(`Invalid block state value '${r.toString()}' for '${i}'`)}else throw new Error(`Invalid block state '${i}' for '${n.resource.name}' `);if(t.variants){let i=t.variants[""];if(i)return Array.isArray(i)?await ar(i[0]):await ar(i);for(let[r,a]of Object.entries(t.variants)){let o={},l=r.split(",");for(let d of l){let[m,p]=d.trim().split("="),f=Ia(p,!1);o[m]=f}if(!Object.entries(o).allAre(([d,m])=>C0(n,d,m,!1)))continue;let u;return Array.isArray(a)?u=await ar(a[0]):u=await ar(a),u}}else if(t.multipart){let i=new THREE.Mesh,r=[],a=[];for(let u of t.multipart){let d=await z7(n,u);if(!d)continue;for(let p of d.mesh.children){let f=p.clone();f.geometry=f.geometry.clone(),f.rotateY(d.mesh.rotation.y),f.rotateX(d.mesh.rotation.x),i.add(f);let _=d.boundingBox.clone();_.rotateY(d.mesh.rotation.y),_.rotateX(d.mesh.rotation.x),r.push(_)}let m=d.outline.geometry.clone();m.rotateY(d.mesh.rotation.y),m.rotateX(d.mesh.rotation.x),a.push(m)}if(a.length===0)throw new Error(`The selected block state for '${n.resourceLocation}' has no model!`);let o=jr(a),l=new THREE.LineSegments(o,Canvas.outlineMaterial),c=jr(r);return l.no_export=!0,l.renderOrder=2,l.frustumCulled=!1,{mesh:i,outline:l,boundingBox:c,isBlock:!0}}throw new Error(`Unsupported block state '${n.resourceLocation}'`)}s(T0,"parseBlockState");async function z7(n,e){if(e.when){let t=s(r=>{if(r.OR&&r.AND)throw new Error("Cannot have both OR and AND in a multipart case condition");if(r.OR)return r.OR.some(o=>t(o));if(r.AND)return r.AND.every(o=>t(o));let a=!0;for(let[o,l]of Object.entries(r)){let c=Ia(l,!0);if(a=C0(n,o,c,!0),!a)break}return a},"recurse");if(!t(e.when))return}return Array.isArray(e.apply)?await ar(e.apply[0]):await ar(e.apply)}s(z7,"parseMultipartCase");function C0(n,e,t,i){if(typeof t=="string"&&t.includes("|")){if(!i)throw new Error(`Unsupported OR condition in block state '${e}': '${t}'`);t=t.split("|")}if(typeof t=="boolean")return!!n.states[e]===t;if(typeof t=="string")return n.states[e]===t;if(typeof t=="number")return t===0?n.states[e]===t||n.states[e]===void 0:n.states[e]===t;if(i)return t.includes(n.states[e]);throw new Error(`Unsupported variant state type '${typeof t}'`)}s(C0,"checkIfBlockStateMatches");var U7="https://raw.githubusercontent.com/misode/mcmeta/summary/registries/data.json",Tu=class{items=[];constructor(e){this.items=e}has(e){return this.items.includes(e)}find(e){return this.items.find(e)}};s(Tu,"MinecraftRegistryEntry");var Rn={};function G7(){let n=localStorage.getItem("animated_java:minecraftRegistry");if(!n){console.error("Minecraft Registry not found in local storage");return}let e=JSON.parse(n);for(let t in e)Rn[t]=new Tu(e[t])}s(G7,"updateMemoryRegistry");async function Sm(){console.log("Updating Minecraft Registry...");let n=3;for(;n-->=0;){let e;try{e=await fetch(U7)}catch(t){console.error("Failed to fetch latest Minecraft registry:",t)}if(e&&e.ok){let t=await e.json();localStorage.setItem("animated_java:minecraftRegistry",JSON.stringify(t));let i=await Mr();localStorage.setItem("animated_java:minecraftRegistryVersion",JSON.stringify(i)),console.log("Minecraft Registry updated!");return}}throw new Error("Failed to fetch latest Minecraft registry after 3 retries.")}s(Sm,"updateLocalRegistry");async function J7(){if(console.log("Checking if Minecraft Registry update..."),!localStorage.getItem("animated_java:minecraftRegistry")){console.log("No Minecraft Registry found. Updating..."),await Sm();return}let e=localStorage.getItem("animated_java:minecraftRegistryVersion");if(!e){console.log("No Minecraft Registry version found. Updating..."),await Sm();return}let t=JSON.parse(e),i=await Mr();if(t.id!==i.id){console.log("Minecraft Registry is outdated. Updating..."),await Sm();return}console.log("Minecraft Registry is up to date!"),G7(),requestAnimationFrame(()=>te.MINECRAFT_REGISTRY_LOADED.dispatch())}s(J7,"checkForRegistryUpdate");te.NETWORK_CONNECTED.subscribe(()=>{J7().then(async()=>{await xm()})});function H7(n){let e,t,i,r,a,o,l;function c(f){n[25](f)}s(c,"checkbox_checked_binding");let u={label:w("dialog.bone_config.use_nbt.title"),tooltip:w("dialog.bone_config.use_nbt.description")};n[10]!==void 0&&(u.checked=n[10]),e=new it({props:u}),se.push(()=>be(e,"checked",c));let d=[q7,K7],m=[];function p(f,_){return f[12]?0:1}return s(p,"select_block_type_1"),r=p(n,[-1,-1]),a=m[r]=d[r](n),{c(){fe(e.$$.fragment),i=K(),a.c(),o=St()},m(f,_){de(e,f,_),G(f,i,_),m[r].m(f,_),G(f,o,_),l=!0},p(f,_){let v={};!t&&_[0]&1024&&(t=!0,v.checked=f[10],he(()=>t=!1)),e.$set(v);let g=r;r=p(f,_),r===g?m[r].p(f,_):(bt(),Y(m[g],1,1,()=>{m[g]=null}),vt(),a=m[r],a?a.p(f,_):(a=m[r]=d[r](f),a.c()),W(a,1),a.m(o.parentNode,o))},i(f){l||(W(e.$$.fragment,f),W(a),l=!0)},o(f){Y(e.$$.fragment,f),Y(a),l=!1},d(f){ue(e,f),f&&z(i),m[r].d(f),f&&z(o)}}}s(H7,"create_else_block");function $7(n){let e,t,i,r,a,o,l,c,u,d,m,p,f,_,v,g,h,b,x,y,k,C;function A(P){n[17](P)}s(A,"select_value_binding");let I={label:w("dialog.bone_config.billboard.title"),tooltip:w("dialog.bone_config.billboard.description"),options:n[15],defaultOption:Pe.prototype.billboard};n[0]!==void 0&&(I.value=n[0]),e=new Kn({props:I}),se.push(()=>be(e,"value",A));function S(P){n[18](P)}s(S,"checkbox0_checked_binding");let L={label:w("dialog.bone_config.glowing.title"),tooltip:w("dialog.bone_config.glowing.description")};n[3]!==void 0&&(L.checked=n[3]),r=new it({props:L}),se.push(()=>be(r,"checked",S));function O(P){n[19](P)}s(O,"colorpicker_value_binding");let E={label:w("dialog.bone_config.glow_color.title"),tooltip:w("dialog.bone_config.glow_color.description")};n[5]!==void 0&&(E.value=n[5]),l=new Gi({props:E}),se.push(()=>be(l,"value",O));function B(P){n[20](P)}s(B,"numberslider0_value_binding");let H={label:w("dialog.bone_config.shadow_radius.title"),tooltip:w("dialog.bone_config.shadow_radius.description"),min:0,max:64};n[8]!==void 0&&(H.value=n[8]),d=new xt({props:H}),se.push(()=>be(d,"value",B));function ee(P){n[21](P)}s(ee,"numberslider1_value_binding");let ae={label:w("dialog.bone_config.shadow_strength.title"),tooltip:w("dialog.bone_config.shadow_strength.description"),min:0};n[9]!==void 0&&(ae.value=n[9]),f=new xt({props:ae}),se.push(()=>be(f,"value",ee));function ne(P){n[22](P)}s(ne,"checkbox1_checked_binding");let ve={label:w("dialog.bone_config.override_brightness.title"),tooltip:w("dialog.bone_config.override_brightness.description")};n[1]!==void 0&&(ve.checked=n[1]),g=new it({props:ve}),se.push(()=>be(g,"checked",ne));let X=n[11]&&j0(n);function j(P){n[24](P)}s(j,"checkbox2_checked_binding");let Q={label:w("dialog.bone_config.invisible.title"),tooltip:w("dialog.bone_config.invisible.description")};return n[6]!==void 0&&(Q.checked=n[6]),y=new it({props:Q}),se.push(()=>be(y,"checked",j)),{c(){fe(e.$$.fragment),i=K(),fe(r.$$.fragment),o=K(),fe(l.$$.fragment),u=K(),fe(d.$$.fragment),p=K(),fe(f.$$.fragment),v=K(),fe(g.$$.fragment),b=K(),X&&X.c(),x=K(),fe(y.$$.fragment)},m(P,oe){de(e,P,oe),G(P,i,oe),de(r,P,oe),G(P,o,oe),de(l,P,oe),G(P,u,oe),de(d,P,oe),G(P,p,oe),de(f,P,oe),G(P,v,oe),de(g,P,oe),G(P,b,oe),X&&X.m(P,oe),G(P,x,oe),de(y,P,oe),C=!0},p(P,oe){let Z={};!t&&oe[0]&1&&(t=!0,Z.value=P[0],he(()=>t=!1)),e.$set(Z);let J={};!a&&oe[0]&8&&(a=!0,J.checked=P[3],he(()=>a=!1)),r.$set(J);let ie={};!c&&oe[0]&32&&(c=!0,ie.value=P[5],he(()=>c=!1)),l.$set(ie);let U={};!m&&oe[0]&256&&(m=!0,U.value=P[8],he(()=>m=!1)),d.$set(U);let q={};!_&&oe[0]&512&&(_=!0,q.value=P[9],he(()=>_=!1)),f.$set(q);let ge={};!h&&oe[0]&2&&(h=!0,ge.checked=P[1],he(()=>h=!1)),g.$set(ge),P[11]?X?(X.p(P,oe),oe[0]&2048&&W(X,1)):(X=j0(P),X.c(),W(X,1),X.m(x.parentNode,x)):X&&(bt(),Y(X,1,1,()=>{X=null}),vt());let Te={};!k&&oe[0]&64&&(k=!0,Te.checked=P[6],he(()=>k=!1)),y.$set(Te)},i(P){C||(W(e.$$.fragment,P),W(r.$$.fragment,P),W(l.$$.fragment,P),W(d.$$.fragment,P),W(f.$$.fragment,P),W(g.$$.fragment,P),W(X),W(y.$$.fragment,P),C=!0)},o(P){Y(e.$$.fragment,P),Y(r.$$.fragment,P),Y(l.$$.fragment,P),Y(d.$$.fragment,P),Y(f.$$.fragment,P),Y(g.$$.fragment,P),Y(X),Y(y.$$.fragment,P),C=!1},d(P){ue(e,P),P&&z(i),ue(r,P),P&&z(o),ue(l,P),P&&z(u),ue(d,P),P&&z(p),ue(f,P),P&&z(v),ue(g,P),P&&z(b),X&&X.d(P),P&&z(x),ue(y,P)}}}s($7,"create_if_block");function K7(n){let e,t,i,r,a,o,l,c,u,d,m,p,f,_,v,g,h,b,x,y,k;function C(j){n[27](j)}s(C,"select_value_binding_1");let A={label:w("dialog.bone_config.billboard.title"),tooltip:w("dialog.bone_config.billboard.description"),options:n[15],defaultOption:Pe.prototype.billboard};n[0]!==void 0&&(A.value=n[0]),e=new Kn({props:A}),se.push(()=>be(e,"value",C));function I(j){n[28](j)}s(I,"checkbox0_checked_binding_1");let S={label:w("dialog.bone_config.glowing.title"),tooltip:w("dialog.bone_config.glowing.description")};n[3]!==void 0&&(S.checked=n[3]),r=new it({props:S}),se.push(()=>be(r,"checked",I));function L(j){n[29](j)}s(L,"checkbox1_checked_binding_1");let O={label:w("dialog.bone_config.override_glow_color.title"),tooltip:w("dialog.bone_config.override_glow_color.description")};n[4]!==void 0&&(O.checked=n[4]),l=new it({props:O}),se.push(()=>be(l,"checked",L));let E=n[13]&&A0(n);function B(j){n[31](j)}s(B,"numberslider0_value_binding_1");let H={label:w("dialog.bone_config.shadow_radius.title"),tooltip:w("dialog.bone_config.shadow_radius.description"),min:0,max:15};n[8]!==void 0&&(H.value=n[8]),m=new xt({props:H}),se.push(()=>be(m,"value",B));function ee(j){n[32](j)}s(ee,"numberslider1_value_binding_1");let ae={label:w("dialog.bone_config.shadow_strength.title"),tooltip:w("dialog.bone_config.shadow_strength.description"),min:0,max:15};n[9]!==void 0&&(ae.value=n[9]),_=new xt({props:ae}),se.push(()=>be(_,"value",ee));function ne(j){n[33](j)}s(ne,"checkbox2_checked_binding_1");let ve={label:w("dialog.bone_config.override_brightness.title"),tooltip:w("dialog.bone_config.override_brightness.description")};n[1]!==void 0&&(ve.checked=n[1]),h=new it({props:ve}),se.push(()=>be(h,"checked",ne));let X=n[11]&&S0(n);return{c(){fe(e.$$.fragment),i=K(),fe(r.$$.fragment),o=K(),fe(l.$$.fragment),u=K(),E&&E.c(),d=K(),fe(m.$$.fragment),f=K(),fe(_.$$.fragment),g=K(),fe(h.$$.fragment),x=K(),X&&X.c(),y=St()},m(j,Q){de(e,j,Q),G(j,i,Q),de(r,j,Q),G(j,o,Q),de(l,j,Q),G(j,u,Q),E&&E.m(j,Q),G(j,d,Q),de(m,j,Q),G(j,f,Q),de(_,j,Q),G(j,g,Q),de(h,j,Q),G(j,x,Q),X&&X.m(j,Q),G(j,y,Q),k=!0},p(j,Q){let P={};!t&&Q[0]&1&&(t=!0,P.value=j[0],he(()=>t=!1)),e.$set(P);let oe={};!a&&Q[0]&8&&(a=!0,oe.checked=j[3],he(()=>a=!1)),r.$set(oe);let Z={};!c&&Q[0]&16&&(c=!0,Z.checked=j[4],he(()=>c=!1)),l.$set(Z),j[13]?E?(E.p(j,Q),Q[0]&8192&&W(E,1)):(E=A0(j),E.c(),W(E,1),E.m(d.parentNode,d)):E&&(bt(),Y(E,1,1,()=>{E=null}),vt());let J={};!p&&Q[0]&256&&(p=!0,J.value=j[8],he(()=>p=!1)),m.$set(J);let ie={};!v&&Q[0]&512&&(v=!0,ie.value=j[9],he(()=>v=!1)),_.$set(ie);let U={};!b&&Q[0]&2&&(b=!0,U.checked=j[1],he(()=>b=!1)),h.$set(U),j[11]?X?(X.p(j,Q),Q[0]&2048&&W(X,1)):(X=S0(j),X.c(),W(X,1),X.m(y.parentNode,y)):X&&(bt(),Y(X,1,1,()=>{X=null}),vt())},i(j){k||(W(e.$$.fragment,j),W(r.$$.fragment,j),W(l.$$.fragment,j),W(E),W(m.$$.fragment,j),W(_.$$.fragment,j),W(h.$$.fragment,j),W(X),k=!0)},o(j){Y(e.$$.fragment,j),Y(r.$$.fragment,j),Y(l.$$.fragment,j),Y(E),Y(m.$$.fragment,j),Y(_.$$.fragment,j),Y(h.$$.fragment,j),Y(X),k=!1},d(j){ue(e,j),j&&z(i),ue(r,j),j&&z(o),ue(l,j),j&&z(u),E&&E.d(j),j&&z(d),ue(m,j),j&&z(f),ue(_,j),j&&z(g),ue(h,j),j&&z(x),X&&X.d(j),j&&z(y)}}}s(K7,"create_else_block_1");function q7(n){let e,t,i,r,a;function o(c){n[26](c)}s(o,"lineinput_value_binding");let l={label:w("dialog.bone_config.nbt.title"),tooltip:w("dialog.bone_config.nbt.description"),valueChecker:n[16]};return n[7]!==void 0&&(l.value=n[7]),i=new hn({props:l}),se.push(()=>be(i,"value",o)),{c(){e=V("p"),e.textContent=`${w("dialog.bone_config.use_nbt.use_nbt_warning")}`,t=K(),fe(i.$$.fragment),T(e,"class","use_nbt_warning")},m(c,u){G(c,e,u),G(c,t,u),de(i,c,u),a=!0},p(c,u){let d={};!r&&u[0]&128&&(r=!0,d.value=c[7],he(()=>r=!1)),i.$set(d)},i(c){a||(W(i.$$.fragment,c),a=!0)},o(c){Y(i.$$.fragment,c),a=!1},d(c){c&&z(e),c&&z(t),ue(i,c)}}}s(q7,"create_if_block_2");function A0(n){let e,t,i;function r(o){n[30](o)}s(r,"colorpicker_value_binding_1");let a={label:w("dialog.bone_config.glow_color.title"),tooltip:w("dialog.bone_config.glow_color.description")};return n[5]!==void 0&&(a.value=n[5]),e=new Gi({props:a}),se.push(()=>be(e,"value",r)),{c(){fe(e.$$.fragment)},m(o,l){de(e,o,l),i=!0},p(o,l){let c={};!t&&l[0]&32&&(t=!0,c.value=o[5],he(()=>t=!1)),e.$set(c)},i(o){i||(W(e.$$.fragment,o),i=!0)},o(o){Y(e.$$.fragment,o),i=!1},d(o){ue(e,o)}}}s(A0,"create_if_block_4");function S0(n){let e,t,i;function r(o){n[34](o)}s(r,"numberslider_value_binding_1");let a={label:w("dialog.bone_config.brightness_override.title"),tooltip:w("dialog.bone_config.brightness_override.description"),min:0,max:15};return n[2]!==void 0&&(a.value=n[2]),e=new xt({props:a}),se.push(()=>be(e,"value",r)),{c(){fe(e.$$.fragment)},m(o,l){de(e,o,l),i=!0},p(o,l){let c={};!t&&l[0]&4&&(t=!0,c.value=o[2],he(()=>t=!1)),e.$set(c)},i(o){i||(W(e.$$.fragment,o),i=!0)},o(o){Y(e.$$.fragment,o),i=!1},d(o){ue(e,o)}}}s(S0,"create_if_block_3");function j0(n){let e,t,i;function r(o){n[23](o)}s(r,"numberslider_value_binding");let a={label:w("dialog.bone_config.brightness_override.title"),tooltip:w("dialog.bone_config.brightness_override.description"),min:0,max:15};return n[2]!==void 0&&(a.value=n[2]),e=new xt({props:a}),se.push(()=>be(e,"value",r)),{c(){fe(e.$$.fragment)},m(o,l){de(e,o,l),i=!0},p(o,l){let c={};!t&&l[0]&4&&(t=!0,c.value=o[2],he(()=>t=!1)),e.$set(c)},i(o){i||(W(e.$$.fragment,o),i=!0)},o(o){Y(e.$$.fragment,o),i=!1},d(o){ue(e,o)}}}s(j0,"create_if_block_1");function W7(n){let e,t,i,r,a=[$7,H7],o=[];function l(c,u){return c[14]?0:1}return s(l,"select_block_type"),t=l(n,[-1,-1]),i=o[t]=a[t](n),{c(){e=V("div"),i.c()},m(c,u){G(c,e,u),o[t].m(e,null),r=!0},p(c,u){i.p(c,u)},i(c){r||(W(i),r=!0)},o(c){Y(i),r=!1},d(c){c&&z(e),o[t].d()}}}s(W7,"create_fragment");function Z7(n,e,t){let i,r=re,a=s(()=>(r(),r=ze(_,q=>t(11,i=q)),_),"$$subscribe_overrideBrightness"),o,l=re,c=s(()=>(l(),l=ze(A,q=>t(12,o=q)),A),"$$subscribe_useNBT"),u,d=re,m=s(()=>(d(),d=ze(h,q=>t(13,u=q)),h),"$$subscribe_overrideGlowColor");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l()),n.$$.on_destroy.push(()=>d());let p=!!Project?.animated_java?.enable_plugin_mode,{billboard:f}=e,{overrideBrightness:_}=e;a();let{brightnessOverride:v}=e,{glowing:g}=e,{overrideGlowColor:h}=e;m();let{glowColor:b}=e,{invisible:x}=e,{nbt:y}=e,{shadowRadius:k}=e,{shadowStrength:C}=e,{useNBT:A}=e;c();let I={fixed:w("dialog.bone_config.billboard.options.fixed"),vertical:w("dialog.bone_config.billboard.options.vertical"),horizontal:w("dialog.bone_config.billboard.options.horizontal"),center:w("dialog.bone_config.billboard.options.center")},S=s(q=>{let ge;try{ge=qe.fromString(q)}catch(Te){return{type:"error",message:w("dialog.bone_config.nbt.invalid_nbt.error",Te.message)}}return ge instanceof Ze?{type:"success",message:""}:{type:"error",message:w("dialog.bone_config.nbt.invalid_nbt.not_compound")}},"nbtChecker");function L(q){f=q,t(0,f)}s(L,"select_value_binding");function O(q){g=q,t(3,g)}s(O,"checkbox0_checked_binding");function E(q){b=q,t(5,b)}s(E,"colorpicker_value_binding");function B(q){k=q,t(8,k)}s(B,"numberslider0_value_binding");function H(q){C=q,t(9,C)}s(H,"numberslider1_value_binding");function ee(q){_=q,a(t(1,_))}s(ee,"checkbox1_checked_binding");function ae(q){v=q,t(2,v)}s(ae,"numberslider_value_binding");function ne(q){x=q,t(6,x)}s(ne,"checkbox2_checked_binding");function ve(q){A=q,c(t(10,A))}s(ve,"checkbox_checked_binding");function X(q){y=q,t(7,y)}s(X,"lineinput_value_binding");function j(q){f=q,t(0,f)}s(j,"select_value_binding_1");function Q(q){g=q,t(3,g)}s(Q,"checkbox0_checked_binding_1");function P(q){h=q,m(t(4,h))}s(P,"checkbox1_checked_binding_1");function oe(q){b=q,t(5,b)}s(oe,"colorpicker_value_binding_1");function Z(q){k=q,t(8,k)}s(Z,"numberslider0_value_binding_1");function J(q){C=q,t(9,C)}s(J,"numberslider1_value_binding_1");function ie(q){_=q,a(t(1,_))}s(ie,"checkbox2_checked_binding_1");function U(q){v=q,t(2,v)}return s(U,"numberslider_value_binding_1"),n.$$set=q=>{"billboard"in q&&t(0,f=q.billboard),"overrideBrightness"in q&&a(t(1,_=q.overrideBrightness)),"brightnessOverride"in q&&t(2,v=q.brightnessOverride),"glowing"in q&&t(3,g=q.glowing),"overrideGlowColor"in q&&m(t(4,h=q.overrideGlowColor)),"glowColor"in q&&t(5,b=q.glowColor),"invisible"in q&&t(6,x=q.invisible),"nbt"in q&&t(7,y=q.nbt),"shadowRadius"in q&&t(8,k=q.shadowRadius),"shadowStrength"in q&&t(9,C=q.shadowStrength),"useNBT"in q&&c(t(10,A=q.useNBT))},[f,_,v,g,h,b,x,y,k,C,A,i,o,u,p,I,S,L,O,E,B,H,ee,ae,ne,ve,X,j,Q,P,oe,Z,J,ie,U]}s(Z7,"instance");var Cu=class extends je{constructor(e){super(),Ie(this,e,Z7,W7,Ae,{billboard:0,overrideBrightness:1,brightnessOverride:2,glowing:3,overrideGlowColor:4,glowColor:5,invisible:6,nbt:7,shadowRadius:8,shadowStrength:9,useNBT:10},null,[-1,-1])}};s(Cu,"VanillaItemDisplayConfigDialog");var I0=Cu;function X7(n){let e=Mt.fromJSON(n.config??=new Mt().toJSON()),t=new me(e.billboard),i=new me(e.overrideBrightness),r=new me(e.brightnessOverride),a=new me(e.glowing),o=new me(e.overrideGlowColor),l=new me(e.glowColor),c=new me(e.invisible),u=new me(e.nbt),d=new me(e.shadowRadius),m=new me(e.shadowStrength),p=new me(e.useNBT);new Pt({id:`${_e.name}:vanillaItemDisplayConfigDialog`,title:w("dialog.vanilla_item_display_config.title"),width:400,component:I0,props:{variant:Se.selected,billboard:t,overrideBrightness:i,brightnessOverride:r,glowing:a,overrideGlowColor:o,glowColor:l,invisible:c,nbt:u,shadowRadius:d,shadowStrength:m,useNBT:p},preventKeybinds:!0,onConfirm(){let f=new Mt;f.billboard=t.get(),f.overrideBrightness=i.get(),f.brightnessOverride=r.get(),f.glowing=a.get(),f.overrideGlowColor=o.get(),f.glowColor=l.get(),f.invisible=c.get(),f.nbt=u.get(),f.shadowRadius=d.get(),f.shadowStrength=m.get(),f.useNBT=p.get();let _=Mt.getDefault();f.billboard===_.billboard&&(f.billboard=void 0),f.overrideBrightness===_.overrideBrightness&&(f.overrideBrightness=void 0),f.brightnessOverride===_.brightnessOverride&&(f.brightnessOverride=void 0),f.glowing===_.glowing&&(f.glowing=void 0),f.overrideGlowColor===_.overrideGlowColor&&(f.overrideGlowColor=void 0),f.glowColor===_.glowColor&&(f.glowColor=void 0),f.invisible===_.invisible&&(f.invisible=void 0),f.nbt===_.nbt&&(f.nbt=void 0),f.shadowRadius===_.shadowRadius&&(f.shadowRadius=void 0),f.shadowStrength===_.shadowStrength&&(f.shadowStrength=void 0),f.useNBT===_.useNBT&&(f.useNBT=void 0),n.config=f.toJSON()}}).show()}s(X7,"openVanillaItemDisplayConfigDialog");var O0=Xt(`${_e.name}:open_vanilla_item_display_config`,{icon:"settings",name:w("action.open_vanilla_item_display_config.name"),condition:()=>Ue(),click:()=>{gt.selected.length!==0&&X7(gt.selected[0])}});var Im={};vn(Im,{getItemModel:()=>jm});var Y7=new THREE.TextureLoader,N0=new Map;async function jm(n){await Tl();let e=N0.get(n);if(e||(e=await B0(Q7(n)),N0.set(n,e)),!!e)return e={mesh:e.mesh.clone(!0),outline:e.outline.clone(!0),boundingBox:e.boundingBox.clone(),isBlock:e.isBlock},e.mesh.geometry=e.mesh.geometry.clone(),e.outline.geometry=e.outline.geometry.clone(),e.mesh.name=n,e.isBlock?e.mesh.isVanillaBlockModel=!0:e.mesh.isVanillaItemModel=!0,e}s(jm,"getItemModel");function Q7(n){let e=wo(n);return e.namespace+":item/"+e.path}s(Q7,"getItemResourceLocation");async function B0(n,e){let t=hr(n,"models"),i=Gr(t+".json");if(e&&(e.textures!==void 0&&(i.textures??={},Object.assign(i.textures,e.textures)),e.elements!==void 0&&(i.elements=e.elements),e.display!==void 0&&Object.assign(i.display,e.display),e.gui_light!==void 0&&(i.gui_light=e.gui_light),e.overrides!==void 0&&(i.overrides=e.overrides)),i.parent){let r=wo(i.parent);return r.type==="block"?await ar({model:i.parent,isItemModel:!0},i):r.path==="item/generated"?await eV(n,i):await B0(i.parent,i)}else return await ar({model:n,isItemModel:!0},i);throw new Error(`Unsupported item model '${n}'`)}s(B0,"parseItemModel");async function eV(n,e){let t=new THREE.Mesh,i=[],r=[];for(let c of Object.values(e.textures)){let u=hr(c,"textures")+".png",d=$a(u),m=await Y7.loadAsync(d);m.magFilter=THREE.NearestFilter,m.minFilter=THREE.NearestFilter;let p=new THREE.ShaderMaterial({uniforms:{map:{type:"t",value:m},SHADE:{type:"bool",value:settings.shading.value},LIGHTCOLOR:{type:"vec3",value:new THREE.Color().copy(Canvas.global_light_color).multiplyScalar(settings.brightness.value/50)},LIGHTSIDE:{type:"int",value:Canvas.global_light_side},EMISSIVE:{type:"bool",value:!1}},vertexShader:ku,fragmentShader:Eu,blending:THREE.NormalBlending,side:Canvas.getRenderSide(),transparent:!0});p.map=m,p.name=n;let f=new THREE.Mesh(new THREE.BoxGeometry(1,1,1),p),_=[],v=[],g=[],h=[],b=[],x=s((C,A,I)=>{h.push(C,A,I,C,A,I,C,A,I,C,A,I)},"addNormal");if(m&&m.image.width){let C=document.createElement("canvas"),A=C.getContext("2d");C.width=m.image.width,C.height=m.image.height,A.drawImage(m.image,0,0);let I=s((B,H,ee,ae,ne)=>{let ve=_.length/3,X=ne===1?-1:0;_.push(-B,X,H,-B,X,H+1,-B-ee,X,H+ae,-B-ee,X,H+ae-1),ne===1?v.push(ve+0,ve+1,ve+2,ve+0,ve+2,ve+3):ne===-1&&v.push(ve+0,ve+2,ve+1,ve+0,ve+3,ve+2),x(ne,0,0),g.push((B+ee)/C.width,1-H/C.height,(B+ee)/C.width,1-(H+ae)/C.height,B/C.width,1-(H+ae)/C.height,B/C.width,1-H/C.height),b.push(1,1,1,1,1,1,1,1,1,1,1,1)},"addFace"),S=s((B,H,ee,ae,ne)=>{let ve=_.length/3;_.push(-B,0,H,-B,-1,H,-ee,-1,ae,-ee,0,ae),ne===1?v.push(ve+0,ve+1,ve+2,ve+0,ve+2,ve+3):ne===-1&&v.push(ve+0,ve+2,ve+1,ve+0,ve+3,ve+2),B==ee&&(B+=.1*-ne,ee+=.4*-ne,H+=.1,ae-=.1,x(-ne,0,0)),H==ae&&(H+=.1*ne,ae+=.4*ne,B+=.1,ee-=.1,x(0,0,-ne)),g.push(ee/C.width,1-H/C.height,ee/C.width,1-ae/C.height,B/C.width,1-ae/C.height,B/C.width,1-H/C.height),b.push(1,1,1,1,1,1,1,1,1,1,1,1)},"addEdge"),L=A.getImageData(0,0,C.width,C.height),O=[];for(let B=0;B140?1:0);let E=O.slice();for(let B=0;B{_[A]=C+[8,.5,-8][A%3]}),f.geometry.setAttribute("position",new THREE.BufferAttribute(new Float32Array(_),3)),f.geometry.setAttribute("highlight",new THREE.BufferAttribute(new Uint8Array(f.geometry.attributes.position.count),1)),f.geometry.setIndex(v),f.geometry.setAttribute("uv",new THREE.BufferAttribute(new Float32Array(g),2)),f.geometry.setAttribute("color",new THREE.BufferAttribute(new Float32Array(b),3)),f.geometry.setAttribute("normal",new THREE.BufferAttribute(new Float32Array(h),3)),f.geometry.attributes.color.needsUpdate=!0,f.geometry.attributes.normal.needsUpdate=!0,f.geometry.rotateX(Math.PI/2);let y=f.geometry.clone(),k=Array.from(y.attributes.position.array);k.splice(0,24),y.setAttribute("position",new THREE.BufferAttribute(new Float32Array(k),3)),r.push(y),i.push(f.geometry.clone()),t.add(f)}let a=jr(r),o=jr(i),l=new THREE.LineSegments(new THREE.EdgesGeometry(a),Canvas.outlineMaterial);return{mesh:t,outline:l,boundingBox:o}}s(eV,"generateItemMesh");var Ei=class extends un{type=Ei.type;icon="icecream";needsUniqueName=!0;_item=new me("minecraft:diamond");config;error=new me("");menu=new Menu([...Outliner.control_menu_group,O0,"_","rename","delete"]);buttons=[Outliner.buttons.export,Outliner.buttons.locked,Outliner.buttons.visibility];preview_controller=tV;ready=!1;constructor(e,t=guid()){super(e,t),Ei.all.push(this);for(let r in Ei.properties)Ei.properties[r].reset(this);this.name="vanilla_item_display",this.extend(e),this.item??="minecraft:diamond",this.position??=[0,0,0],this.rotation??=[0,0,0],this.scale??=[1,1,1],this.visibility??=!0,this.config??={},this.sanitizeName();let i=s(r=>{if(!Rn.item){requestAnimationFrame(()=>i(r));return}let[a,o]=r.split(":");o||(o=a,a="minecraft"),(a==="minecraft"||a==="")&&Rn.item.has(o)?(this.error.set(""),this.preview_controller.updateGeometry(this)):this.error.set(`This item does not exist in Minecraft ${ja().id}.`)},"updateItem");this._item.subscribe(r=>{i(r)})}get item(){return this._item===void 0?"minecraft:diamond":this._item.get()}set item(e){this._item!==void 0&&this._item.set(e)}async waitForReady(){for(;!this.ready;)await new Promise(e=>setTimeout(e,1e3/framespersecond))}sanitizeName(){this.name=Rt(this.name);let e=[...Ei.all.filter(o=>o.uuid!==this.uuid),...Group.all,...Je.all,...ft.all],t=new Set(e.map(o=>o.name));if(!t.has(this.name))return this.name;let i=1,r=this.name.match(/\d+$/);r&&(i=parseInt(r[0]),this.name=this.name.slice(0,-r[0].length));let a=1e4;for(;a-- >0;){let o=`${this.name}${i}`;if(!t.has(o))return this.name=o,o;i++}throw new Error("Could not make VanillaItemDisplay name unique!")}getUndoCopy(){let e={};for(let t in Ei.properties)Ei.properties[t].copy(this,e);return e.uuid=this.uuid,e.type=this.type,e}getSaveCopy(){let e={};for(let t in Ei.properties)Ei.properties[t].copy(this,e);return e.uuid=this.uuid,e.type=this.type,e}select(){return Group.selected&&Group.selected.unselect(),!Pressing.ctrl&&!Pressing.shift&&(Cube.selected.length&&Cube.selected.forEachReverse(e=>e.unselect()),selected.length&&selected.forEachReverse(e=>e!==this&&e.unselect())),Ei.selected.safePush(this),this.selectLow(),this.showInOutliner(),updateSelection(),Animator.open&&Blockbench.Animation.selected&&Blockbench.Animation.selected.getBoneAnimator(this).select(),this}unselect(){this.selected&&(Animator.open&&Timeline.selected_animator&&Timeline.selected_animator.element===this&&Timeline.selected&&Timeline.selected.empty(),Project.selected_elements.remove(this),Ei.selected.remove(this),this.selected=!1,TickUpdates.selection=!0,this.preview_controller.updateHighlight(this))}},gt=Ei;s(gt,"VanillaItemDisplay"),ht(gt,"type",`${_e.name}:vanilla_item_display`),ht(gt,"selected",[]),ht(gt,"all",[]);new Property(gt,"string","item",{default:"minecraft:diamond"});new Property(gt,"object","config",{get default(){return new Pe().toJSON()}});OutlinerElement.registerType(gt,gt.type);var tV=new NodePreviewController(gt,{setup(n){un.prototype.preview_controller.setup(n)},updateGeometry(n){n.mesh&&jm(n.item).then(e=>{if(!e)return;let t=n.mesh;t.name=n.uuid,t.geometry=e.boundingBox,t.material=Canvas.transparentMaterial,t.clear(),t.add(e.mesh),t.add(e.outline),t.outline=e.outline,n.preview_controller.updateHighlight(n),n.preview_controller.updateTransform(n),t.visible=n.visibility,TickUpdates.selection=!0,n.ready=!0}).catch(e=>{typeof e.message=="string"&&n.error.set(e.message)})},updateTransform(n){un.prototype.preview_controller.updateTransform(n)},updateHighlight(n,e){if(!Ue()||!n?.mesh)return;let t=Modes.edit&&(e===!0||e===n||n.selected)?1:0,i=n.mesh.children.at(0);if(i)for(let r of i.children){if(!(r instanceof THREE.Mesh))continue;let a=r.geometry.attributes.highlight;a.array[0]!=t&&(a.array.set(Array(a.count).fill(t)),a.needsUpdate=!0)}}}),Il=class extends BoneAnimator{_name;uuid;element;constructor(e,t,i){super(e,t,i),this.uuid=e,this._name=i}getElement(){return this.element=OutlinerNode.uuids[this.uuid],this.element}select(){if(this.getElement(),!this.element)return unselectAllElements(),this;if(this.element.locked)return this;if(!this.element.selected&&this.element&&this.element.select(),GeneralAnimator.prototype.select.call(this),this[Toolbox.selected.animation_channel]&&(Timeline.selected&&Timeline.selected.length===0||(Timeline.selected&&Timeline.selected[0].animator)!==this)){let e;this[Toolbox.selected.animation_channel].forEach(t=>{Math.abs(t.time-Timeline.time)<.002&&(e=t)}),e&&e.select()}return this.element&&this.element.parent&&this.element.parent!=="root"&&this.element.parent.openUp(),this}doRender(){return this.getElement(),!!(this.element&&this.element.mesh)}displayRotation(e,t=1){let i=this.getElement().mesh;if(i.fix_rotation&&i.rotation.copy(i.fix_rotation),e)if(e.length===4){let r=new THREE.Euler().setFromQuaternion(new THREE.Quaternion().fromArray(e),"ZYX");i.rotation.x-=r.x*t,i.rotation.y-=r.y*t,i.rotation.z+=r.z*t}else i.rotation.x+=Math.degToRad(-e[0])*t,i.rotation.y+=Math.degToRad(-e[1])*t,i.rotation.z+=Math.degToRad(e[2])*t;if(this.rotation_global){let r=i.parent?.getWorldQuaternion(Reusable.quat1);if(!r)return this;r.invert(),i.quaternion.premultiply(r)}return this}displayPosition(e,t=1){let i=this.getElement().mesh;return i.fix_position&&i.position.copy(i.fix_position),e&&(i.position.x-=e[0]*t,i.position.y+=e[1]*t,i.position.z+=e[2]*t),this}displayScale(e,t=1){if(!e)return this;let i=this.getElement().mesh;return i.fix_scale&&i.scale.copy(i.fix_scale),i.scale.x=1+(e[0]-1)*t||1e-5,i.scale.y=1+(e[1]-1)*t||1e-5,i.scale.z=1+(e[2]-1)*t||1e-5,this}};s(Il,"VanillaItemDisplayAnimator");Il.prototype.type=gt.type;gt.animator=Il;Ke(`${_e.name}:vanillaItemDisplay`,{subscriptions:[]},n=>(Interface.Panels.outliner.menu.addAction(Ko,3),Toolbars.outliner.add(Ko,0),MenuBar.menus.edit.addAction(Ko,8),n.subscriptions.push(te.SELECT_PROJECT.subscribe(e=>{e.vanillaItemDisplays??=[],gt.all.empty(),gt.all.push(...e.vanillaItemDisplays)}),te.UNSELECT_PROJECT.subscribe(e=>{e.vanillaItemDisplays=[...gt.all],gt.all.empty()})),n),n=>{Interface.Panels.outliner.menu.removeAction(Ko.id),Toolbars.outliner.remove(Ko),MenuBar.menus.edit.removeAction(Ko.id),n.subscriptions.forEach(e=>e())});var Ko=Xt(`${_e.name}:create_vanilla_item_display`,{name:w("action.create_vanilla_item_display.title"),icon:"icecream",category:"animated_java",condition(){return Ue()&&Mode.selected.id===Modes.options.edit.id},click(){Undo.initEdit({outliner:!0,elements:[],selection:!0});let n=new gt({}).init(),e=getCurrentGroup();return e instanceof Group&&(n.addTo(e),n.extend({position:e.origin.slice()})),selected.forEachReverse(t=>t.unselect()),Group.selected&&Group.selected.unselect(),n.select(),Undo.finishEdit("Create Vanilla Item Display",{outliner:!0,elements:selected,selection:!0}),n}});var Om=Canvas.outlineMaterial.clone();Om.color.set("#ff0000");var Ti=class extends un{type=Ti.type;icon="deployed_code";needsUniqueName=!0;_block=new me("minecraft:stone");config;error=new me("");menu=new Menu([...Outliner.control_menu_group,w0,"_","rename","delete"]);buttons=[Outliner.buttons.export,Outliner.buttons.locked,Outliner.buttons.visibility];preview_controller=nV;ready=!1;constructor(e,t=guid()){super(e,t),Ti.all.push(this);for(let r in Ti.properties)Ti.properties[r].reset(this);this.name="vanilla_block_display",this.extend(e),this.block??="minecraft:stone",this.config??={};let i=s(async r=>{if(!Rn.block){requestAnimationFrame(()=>void i(r));return}let a=await xo(r);a?(a.resource.namespace==="minecraft"||a.resource.namespace==="")&&Rn.block.has(a.resource.name)?(this.error.set(""),this.preview_controller.updateGeometry(this)):this.error.set(`This block does not exist in Minecraft ${ja().id}.`):this.error.set("Invalid block ID."),this.mesh?.outline instanceof THREE.LineSegments&&(this.error.get()?this.mesh.outline.material=Om:this.mesh.outline.material=Canvas.outlineMaterial)},"updateBlock");this._block.subscribe(r=>{i(r)})}get block(){return this._block===void 0?"minecraft:stone":this._block.get()}set block(e){this._block!==void 0&&this.block!==e&&this._block.set(e)}async waitForReady(){for(;!this.ready;)await new Promise(e=>setTimeout(e,1e3/framespersecond))}sanitizeName(){this.name=Rt(this.name);let e=[...Ti.all.filter(o=>o.uuid!==this.uuid),...Group.all,...Je.all,...gt.all],t=new Set(e.map(o=>o.name));if(!t.has(this.name))return this.name;let i=1,r=this.name.match(/\d+$/);r&&(i=parseInt(r[0]),this.name=this.name.slice(0,-r[0].length));let a=1e4;for(;a-- >0;){let o=`${this.name}${i}`;if(!t.has(o))return this.name=o,o;i++}throw new Error("Could not make VanillaBlockDisplay name unique!")}getUndoCopy(){let e={};for(let t in Ti.properties)Ti.properties[t].copy(this,e);return e.uuid=this.uuid,e.type=this.type,e}getSaveCopy(){let e={};for(let t in Ti.properties)Ti.properties[t].copy(this,e);return e.uuid=this.uuid,e.type=this.type,e}select(){return Group.selected&&Group.selected.unselect(),!Pressing.ctrl&&!Pressing.shift&&(Cube.selected.length&&Cube.selected.forEachReverse(e=>e.unselect()),selected.length&&selected.forEachReverse(e=>e!==this&&e.unselect())),Ti.selected.safePush(this),this.selectLow(),this.showInOutliner(),updateSelection(),Animator.open&&Blockbench.Animation.selected&&Blockbench.Animation.selected.getBoneAnimator(this).select(),this}unselect(){this.selected&&(Animator.open&&Timeline.selected_animator&&Timeline.selected_animator.element===this&&Timeline.selected&&Timeline.selected.empty(),Project.selected_elements.remove(this),Ti.selected.remove(this),this.selected=!1,TickUpdates.selection=!0,this.preview_controller.updateHighlight(this))}},ft=Ti;s(ft,"VanillaBlockDisplay"),ht(ft,"type",`${_e.name}:vanilla_block_display`),ht(ft,"selected",[]),ht(ft,"all",[]);new Property(ft,"string","block",{default:"minecraft:stone"});new Property(ft,"object","config",{get default(){return new Pe().toJSON()}});OutlinerElement.registerType(ft,ft.type);var nV=new NodePreviewController(ft,{setup(n){un.prototype.preview_controller.setup(n)},updateGeometry(n){n.mesh&&Cm(n.block).then(e=>{if(!e?.mesh)return;let t=n.mesh;t.name=n.uuid,t.geometry=e.boundingBox,t.material=Canvas.transparentMaterial,t.clear(),e.outline.name=n.uuid+"_outline",e.outline.visible=n.selected,t.outline=e.outline,t.add(e.mesh),t.add(e.outline),n.preview_controller.updateHighlight(n),n.preview_controller.updateTransform(n),t.visible=n.visibility,TickUpdates.selection=!0,n.ready=!0}).catch(e=>{console.error(e),typeof e.message=="string"&&n.error.set(e.message)}).finally(()=>{n.mesh?.outline instanceof THREE.LineSegments&&(n.error.get()?n.mesh.outline.material=Om:n.mesh.outline.material=Canvas.outlineMaterial)})},updateTransform(n){un.prototype.preview_controller.updateTransform(n)},updateHighlight(n,e){if(!Ue()||!n?.mesh)return;let t=Modes.edit&&(e===!0||e===n||n.selected)?1:0,i=n.mesh.children.at(0);if(i)for(let r of i.children){if(!(r instanceof THREE.Mesh))continue;let a=r.geometry.attributes.highlight;a.array[0]!=t&&(a.array.set(Array(a.count).fill(t)),a.needsUpdate=!0)}}}),Ol=class extends BoneAnimator{_name;uuid;element;constructor(e,t,i){super(e,t,i),this.uuid=e,this._name=i}getElement(){return this.element=OutlinerNode.uuids[this.uuid],this.element}select(){if(this.getElement(),!this.element)return unselectAllElements(),this;if(this.element.locked)return this;if(!this.element.selected&&this.element&&this.element.select(),GeneralAnimator.prototype.select.call(this),this[Toolbox.selected.animation_channel]&&(Timeline.selected&&Timeline.selected.length===0||(Timeline.selected&&Timeline.selected[0].animator)!==this)){let e;this[Toolbox.selected.animation_channel].forEach(t=>{Math.abs(t.time-Timeline.time)<.002&&(e=t)}),e&&e.select()}return this.element&&this.element.parent&&this.element.parent!=="root"&&this.element.parent.openUp(),this}doRender(){return this.getElement(),!!(this.element&&this.element.mesh)}displayRotation(e,t=1){let i=this.getElement().mesh;if(i.fix_rotation&&i.rotation.copy(i.fix_rotation),e)if(e.length===4){let r=new THREE.Euler().setFromQuaternion(new THREE.Quaternion().fromArray(e),"ZYX");i.rotation.x-=r.x*t,i.rotation.y-=r.y*t,i.rotation.z+=r.z*t}else i.rotation.x-=Math.degToRad(e[0])*t,i.rotation.y-=Math.degToRad(e[1])*t,i.rotation.z+=Math.degToRad(e[2])*t;if(this.rotation_global){let r=i.parent?.getWorldQuaternion(Reusable.quat1);if(!r)return this;r.invert(),i.quaternion.premultiply(r)}return this}displayPosition(e,t=1){let i=this.getElement().mesh;return i.fix_position&&i.position.copy(i.fix_position),e&&(i.position.x-=e[0]*t,i.position.y+=e[1]*t,i.position.z+=e[2]*t),this}displayScale(e,t=1){if(!e)return this;let i=this.getElement().mesh;return i.fix_scale&&i.scale.copy(i.fix_scale),i.scale.x*=1+(e[0]-1)*t||1e-5,i.scale.y*=1+(e[1]-1)*t||1e-5,i.scale.z*=1+(e[2]-1)*t||1e-5,this}};s(Ol,"VanillaBlockDisplayAnimator");Ol.prototype.type=ft.type;ft.animator=Ol;Ke(`${_e.name}:vanillaBlockDisplay`,{subscriptions:[]},n=>(Interface.Panels.outliner.menu.addAction(qo,3),Toolbars.outliner.add(qo,0),MenuBar.menus.edit.addAction(qo,8),n.subscriptions.push(te.SELECT_PROJECT.subscribe(e=>{e.vanillaBlockDisplays??=[],ft.all.empty(),ft.all.push(...e.vanillaBlockDisplays)}),te.UNSELECT_PROJECT.subscribe(e=>{e.vanillaBlockDisplays=[...ft.all],ft.all.empty()})),n),n=>{Interface.Panels.outliner.menu.removeAction(qo.id),Toolbars.outliner.remove(qo),MenuBar.menus.edit.removeAction(qo.id),n.subscriptions.forEach(e=>e())});var qo=Xt(`${_e.name}:create_vanilla_block_display`,{name:w("action.create_vanilla_block_display.title"),icon:"deployed_code",category:"animated_java",condition(){return Ue()&&Mode.selected.id===Modes.options.edit.id},click(){Undo.initEdit({outliner:!0,elements:[],selection:!0});let n=new ft({}).init(),e=getCurrentGroup();return e instanceof Group&&(n.addTo(e),n.extend({position:e.origin.slice()})),selected.forEachReverse(t=>t.unselect()),Group.selected&&Group.selected.unselect(),n.select(),Undo.finishEdit("Create Vanilla Block Display",{outliner:!0,elements:selected,selection:!0}),n}});function D0(){let n=Math.floor(Math.sqrt(Rn.block.items.length));for(let e=0;e`${t}=${i.toString()}`).join(",")}]`}s(iV,"generateBlockStateString");function rV(n){let e=Object.values(n).reduce((i,r)=>i*r.length,1),t=[];for(let i=0;i{let c=a%l.length;r[o]=String(l[c]),a=Math.floor(a/l.length)}),t.push(r)}return t}s(rV,"computeAllStatePermutations");var An=class extends un{type=An.type;icon="text_fields";needsUniqueName=!0;config;menu=new Menu([...Outliner.control_menu_group,g0,"_","rename","delete"]);buttons=[Outliner.buttons.export,Outliner.buttons.locked,Outliner.buttons.visibility];preview_controller=aV;ready=!1;textError=new me("");_updating=!1;_text=new me("Hello World!");_newText;_lineWidth=new me(200);_newLineWidth;_backgroundColor=new me("#000000");_newBackgroundColor;_backgroundAlpha=new me(.25);_newBackgroundAlpha;_shadow=new me(!1);_newShadow;_align=new me("center");_newAlign;seeThrough=!1;constructor(e,t=guid()){super(e,t),An.all.push(this);for(let i in An.properties)An.properties[i].reset(this);this.name="text_display",this.extend(e),this.name??="text_display",this.position??=[0,0,0],this.rotation??=[0,0,0],this.scale??=[1,1,1],this.align??="center",this.visibility??=!0,this.config??={},this.sanitizeName(),this._text.subscribe(i=>{this._newText=i,this.updateText()}),this._lineWidth.subscribe(i=>{this._newLineWidth=i,this.updateText()}),this._backgroundColor.subscribe(i=>{this._newBackgroundColor=i,this.updateText()}),this._backgroundAlpha.subscribe(i=>{this._newBackgroundAlpha=i,this.updateText()}),this._shadow.subscribe(i=>{this._newShadow=i,this.updateText()}),this._align.subscribe(i=>{this._newAlign=i,this.updateText()})}sanitizeName(){this.name=Rt(this.name);let e=[...An.all.filter(o=>o.uuid!==this.uuid),...Group.all,...ft.all,...gt.all],t=new Set(e.map(o=>o.name));if(!t.has(this.name))return this.name;let i=1,r=this.name.match(/\d+$/);r&&(i=parseInt(r[0]),this.name=this.name.slice(0,-r[0].length));let a=1e4;for(;a-- >0;){let o=`${this.name}${i}`;if(!t.has(o))return this.name=o,o;i++}throw new Error("Could not make TextDisplay name unique!")}get text(){return this._text===void 0?An.properties.text.default:this._text.get()}set text(e){this._text!==void 0&&e!==this.text&&this._text.set(e)}get lineWidth(){return this._lineWidth===void 0?An.properties.lineWidth.default:this._lineWidth.get()}set lineWidth(e){this._lineWidth!==void 0&&this._lineWidth.set(e)}get backgroundColor(){return this._backgroundColor===void 0?An.properties.backgroundColor.default:this._backgroundColor.get()}set backgroundColor(e){this._backgroundColor!==void 0&&this._backgroundColor.set(e)}get backgroundAlpha(){return this._backgroundAlpha===void 0?An.properties.backgroundAlpha.default:this._backgroundAlpha.get()}set backgroundAlpha(e){this._backgroundAlpha!==void 0&&this._backgroundAlpha.set(e)}get shadow(){return this._shadow===void 0?An.properties.shadow.default:this._shadow.get()}set shadow(e){this._shadow!==void 0&&this._shadow.set(e)}get align(){return this._align===void 0?An.properties.align.default:this._align.get()}set align(e){this._align!==void 0&&this._align.set(e)}getUndoCopy(){let e=new An(this);for(let t in An.properties)An.properties[t].copy(this,e);return e.uuid=this.uuid,e.type=this.type,delete e.parent,e}getSaveCopy(){let e={};for(let t in An.properties)An.properties[t].copy(this,e);return e.uuid=this.uuid,e.type=this.type,e}select(){return Group.selected&&Group.selected.unselect(),!Pressing.ctrl&&!Pressing.shift&&(Cube.selected.length&&Cube.selected.forEachReverse(e=>e.unselect()),selected.length&&selected.forEachReverse(e=>e!==this&&e.unselect())),An.selected.safePush(this),this.selectLow(),this.showInOutliner(),updateSelection(),Animator.open&&Blockbench.Animation.selected&&Blockbench.Animation.selected.getBoneAnimator(this).select(),this}unselect(){this.selected&&(Animator.open&&Timeline.selected_animator&&Timeline.selected_animator.element===this&&Timeline.selected&&Timeline.selected.empty(),Project.selected_elements.remove(this),An.selected.remove(this),this.selected=!1,TickUpdates.selection=!0)}async updateText(){if(this._updating)return;this._updating=!0;let e;for(;this._newText!==void 0||this._newLineWidth!==void 0||this._newBackgroundColor!==void 0||this._newBackgroundAlpha!==void 0||this._newShadow!==void 0||this._newAlign!==void 0;){let t;this.textError.set("");try{t=ln.fromString(this.text)}catch(i){console.error(i),this.textError.set(i.message),this._updating=!1,t=new ln({text:"Invalid JSON Text!",color:"red"})}this._newText=void 0,this._newLineWidth=void 0,this._newBackgroundColor=void 0,this._newBackgroundAlpha=void 0,this._newShadow=void 0,this._newAlign=void 0,t&&(e=await this.setText(t))}return this._updating=!1,e}async waitForReady(){for(;!this.ready;)await new Promise(e=>setTimeout(e,1e3/framespersecond))}async setText(e){await this.waitForReady();let t=await Ka(),{mesh:i,outline:r}=await t.generateTextMesh({jsonText:e,maxLineWidth:this.lineWidth,backgroundColor:this.backgroundColor,backgroundAlpha:this.backgroundAlpha,shadow:this.shadow,alignment:this.align});i.name=this.uuid+"_text";let a=this.mesh.children.find(c=>c.name===i.name);a&&this.mesh.remove(a);let o=this.mesh;o.name=this.uuid,o.geometry=i.children[0].geometry.clone(),o.geometry.translate(i.children[0].position.x,i.children[0].position.y,i.children[0].position.z),o.geometry.rotateY(Math.PI),o.geometry.scale(i.scale.x,i.scale.y,i.scale.z),o.material=Canvas.transparentMaterial,o.add(i),r.name=this.uuid+"_outline",r.visible=this.selected,o.outline=r;let l=o.children.find(c=>c.name===r.name);return l&&o.remove(l),o.add(r),o.visible=this.visibility,i}},Je=An;s(Je,"TextDisplay"),ht(Je,"type",`${_e.name}:text_display`),ht(Je,"selected",[]),ht(Je,"all",[]);new Property(Je,"string","text",{default:'"Hello World!"'});new Property(Je,"number","lineWidth",{default:200});new Property(Je,"string","backgroundColor",{default:"#000000"});new Property(Je,"number","backgroundAlpha",{default:.25});new Property(Je,"string","align",{default:"center"});new Property(Je,"boolean","shadow",{default:!1});new Property(Je,"boolean","seeThrough",{default:!1});new Property(Je,"object","config",{get default(){return new Mt().toJSON()}});OutlinerElement.registerType(Je,Je.type);var aV=new NodePreviewController(Je,{setup(n){un.prototype.preview_controller.setup(n),Project.nodes_3d[n.uuid].renderOrder=-1,Ka().then(()=>{n.ready=!0,n.preview_controller.updateTransform(n),n.preview_controller.updateGeometry(n),n.preview_controller.dispatchEvent("setup",{element:n})})},updateGeometry(n){n.updateText().then(()=>{n.preview_controller.updateTransform(n)})},updateTransform(n){un.prototype.preview_controller.updateTransform(n)}}),Nl=class extends BoneAnimator{_name;uuid;element;constructor(e,t,i){super(e,t,i),this.uuid=e,this._name=i}getElement(){return this.element=OutlinerNode.uuids[this.uuid],this.element}select(){if(this.getElement(),!this.element)return unselectAllElements(),this;if(this.element.locked)return this;if(!this.element.selected&&this.element&&this.element.select(),GeneralAnimator.prototype.select.call(this),this[Toolbox.selected.animation_channel]&&(Timeline.selected&&Timeline.selected.length===0||(Timeline.selected&&Timeline.selected[0].animator)!==this)){let e;this[Toolbox.selected.animation_channel].forEach(t=>{Math.abs(t.time-Timeline.time)<.002&&(e=t)}),e&&e.select()}return this.element&&this.element.parent&&this.element.parent!=="root"&&this.element.parent.openUp(),this}doRender(){return this.getElement(),!!(this.element&&this.element.mesh)}displayRotation(e,t=1){let i=this.getElement().mesh;if(i.fix_rotation&&i.rotation.copy(i.fix_rotation),e)if(e.length===4){let r=new THREE.Euler().setFromQuaternion(new THREE.Quaternion().fromArray(e),"ZYX");i.rotation.x-=r.x*t,i.rotation.y-=r.y*t,i.rotation.z+=r.z*t}else i.rotation.x-=Math.degToRad(e[0])*t,i.rotation.y-=Math.degToRad(e[1])*t,i.rotation.z+=Math.degToRad(e[2])*t;if(this.rotation_global){let r=i.parent?.getWorldQuaternion(Reusable.quat1);if(!r)return this;r.invert(),i.quaternion.premultiply(r)}return this}displayPosition(e,t=1){let i=this.getElement().mesh;return i.fix_position&&i.position.copy(i.fix_position),e&&(i.position.x-=e[0]*t,i.position.y+=e[1]*t,i.position.z+=e[2]*t),this}displayScale(e,t=1){if(!e)return this;let i=this.getElement().mesh;return i.fix_scale&&i.scale.copy(i.fix_scale),i.scale.x*=1+(e[0]-1)*t||1e-5,i.scale.y*=1+(e[1]-1)*t||1e-5,i.scale.z*=1+(e[2]-1)*t||1e-5,this}};s(Nl,"TextDisplayAnimator");Nl.prototype.type=Je.type;Je.animator=Nl;Ke(`${_e.name}:textDisplay`,{subscriptions:[]},n=>(Interface.Panels.outliner.menu.addAction(Wo,3),Toolbars.outliner.add(Wo,0),MenuBar.menus.edit.addAction(Wo,8),n.subscriptions.push(te.SELECT_PROJECT.subscribe(e=>{e.format.id===et.id&&(e.textDisplays??=[],Je.all.empty(),Je.all.push(...e.textDisplays))}),te.UNSELECT_PROJECT.subscribe(e=>{e.format.id===et.id&&(e.textDisplays=[...Je.all],Je.all.empty())})),n),n=>{Interface.Panels.outliner.menu.removeAction(Wo.id),Toolbars.outliner.remove(Wo),MenuBar.menus.edit.removeAction(Wo.id),n.subscriptions.forEach(e=>e())});var Wo=Xt(`${_e.name}:create_text_display`,{name:w("action.create_text_display.title"),icon:"text_fields",category:"animated_java",condition(){return Ue()&&Mode.selected.id===Modes.options.edit.id},click(){Undo.initEdit({outliner:!0,elements:[],selection:!0});let n=new Je({}).init(),e=getCurrentGroup();return e instanceof Group&&(n.addTo(e),n.extend({position:e.origin.slice()})),selected.forEachReverse(t=>t.unselect()),Group.selected&&Group.selected.unselect(),n.select(),Undo.finishEdit("Create Text Display",{outliner:!0,elements:selected,selection:!0}),n}});function Au(n,e={}){let t=[];return e?.excludeEmptyGroups?t.push(...Group.all.filter(r=>r.children.length>0&&r.children.some(a=>a instanceof Cube))):t.push(...Group.all),e?.groupsOnly||t.push(...Locator.all,...Je.all,...gt.all,...ft.all,...OutlinerElement.types.camera?.all||[]),t.map(r=>{let a=n.find(l=>l.value===r.uuid);a&&(a.name=r.name);let o;switch(!0){case r instanceof Group:o="folder";break;case r instanceof Locator:o="anchor";break;case r instanceof Je:case r instanceof gt:case r instanceof ft:o=r.icon;break;case r instanceof OutlinerElement.types.camera:o="videocam";break;default:o="close";break}return{icon:o,name:r.name,value:r.uuid}})}s(Au,"getAvailableNodes");function oV(n){let e,t,i,r,a,o,l,c,u,d,m,p,f;function _(C){n[5](C)}s(_,"lineinput_value_binding");let v={label:w("dialog.animation_properties.animation_name.title"),tooltip:w("dialog.animation_properties.animation_name.description"),valueChecker:sV};n[0]!==void 0&&(v.value=n[0]),t=new hn({props:v}),se.push(()=>be(t,"value",_));function g(C){n[6](C)}s(g,"select_value_binding");let h={label:w("dialog.animation_properties.loop_mode.title"),tooltip:w("dialog.animation_properties.loop_mode.description"),options:{once:w("dialog.animation_properties.loop_mode.options.once"),hold:w("dialog.animation_properties.loop_mode.options.hold"),loop:w("dialog.animation_properties.loop_mode.options.loop")},defaultOption:"once"};n[1]!==void 0&&(h.value=n[1]),a=new Kn({props:h}),se.push(()=>be(a,"value",g));function b(C){n[7](C)}s(b,"numberslider_value_binding");let x={label:w("dialog.animation_properties.loop_delay.title"),tooltip:w("dialog.animation_properties.loop_delay.description"),min:0};n[2]!==void 0&&(x.value=n[2]),c=new xt({props:x}),se.push(()=>be(c,"value",b));function y(C){n[8](C)}s(y,"collection_includedItems_binding");let k={label:w("dialog.animation_properties.excluded_nodes.title"),tooltip:w("dialog.animation_properties.bone_lists.description"),availableItemsColumnLable:w("dialog.animation_properties.included_nodes.title"),availableItemsColumnTooltip:w("dialog.animation_properties.included_nodes.description"),includedItemsColumnLable:w("dialog.animation_properties.excluded_nodes.title"),includedItemsColumnTooltip:w("dialog.animation_properties.excluded_nodes.description"),swapColumnsButtonTooltip:w("dialog.animation_properties.swap_columns_button.tooltip"),availableItems:n[4]};return n[3]!==void 0&&(k.includedItems=n[3]),m=new iu({props:k}),se.push(()=>be(m,"includedItems",y)),{c(){e=V("div"),fe(t.$$.fragment),r=K(),fe(a.$$.fragment),l=K(),fe(c.$$.fragment),d=K(),fe(m.$$.fragment)},m(C,A){G(C,e,A),de(t,e,null),N(e,r),de(a,e,null),N(e,l),de(c,e,null),N(e,d),de(m,e,null),f=!0},p(C,[A]){let I={};!i&&A&1&&(i=!0,I.value=C[0],he(()=>i=!1)),t.$set(I);let S={};!o&&A&2&&(o=!0,S.value=C[1],he(()=>o=!1)),a.$set(S);let L={};!u&&A&4&&(u=!0,L.value=C[2],he(()=>u=!1)),c.$set(L);let O={};!p&&A&8&&(p=!0,O.includedItems=C[3],he(()=>p=!1)),m.$set(O)},i(C){f||(W(t.$$.fragment,C),W(a.$$.fragment,C),W(c.$$.fragment,C),W(m.$$.fragment,C),f=!0)},o(C){Y(t.$$.fragment,C),Y(a.$$.fragment,C),Y(c.$$.fragment,C),Y(m.$$.fragment,C),f=!1},d(C){C&&z(e),ue(t),ue(a),ue(c),ue(m)}}}s(oV,"create_fragment");function sV(n){return n.trim().length===0?{type:"error",message:w("dialog.animation_properties.animation_name.error.empty")}:n.match(/[^a-zA-Z0-9_\.]/)?{type:"error",message:w("dialog.animation_properties.animation_name.error.invalid_characters")}:{type:"success",message:""}}s(sV,"animationNameValueChecker");function lV(n,e,t){let{animationName:i}=e,{loopMode:r}=e,{loopDelay:a}=e,{excludedNodes:o}=e,l=Au(o.get());function c(p){i=p,t(0,i)}s(c,"lineinput_value_binding");function u(p){r=p,t(1,r)}s(u,"select_value_binding");function d(p){a=p,t(2,a)}s(d,"numberslider_value_binding");function m(p){o=p,t(3,o)}return s(m,"collection_includedItems_binding"),n.$$set=p=>{"animationName"in p&&t(0,i=p.animationName),"loopMode"in p&&t(1,r=p.loopMode),"loopDelay"in p&&t(2,a=p.loopDelay),"excludedNodes"in p&&t(3,o=p.excludedNodes)},[i,r,a,o,l,c,u,d,m]}s(lV,"instance");var Su=class extends je{constructor(e){super(),Ie(this,e,lV,oV,Ae,{animationName:0,loopMode:1,loopDelay:2,excludedNodes:3})}};s(Su,"AnimationProperties");var M0=Su;var Nm=`${_e.name}:animationPropertiesDialog`;function F0(n){let e=new me(n.name),t=new me(n.loop),i=new me(Number(n.loop_delay)||0),r=new me(n.excluded_nodes);new Pt({id:Nm,title:w("dialog.animation_properties.title",n.name),width:600,component:M0,props:{animationName:e,loopMode:t,loopDelay:i,excludedNodes:r},preventKeybinds:!0,onConfirm(){n.name=e.get(),n.createUniqueName(Blockbench.Animation.all),n.loop=t.get(),n.loop_delay=i.get().toString(),n.excluded_nodes=r.get()}}).show()}s(F0,"openAnimationPropertiesDialog");function cV(n){let e,t,i,r,a,o,l,c;return{c(){e=V("div"),t=V("label"),i=Ne(n[0]),r=K(),a=V("textarea"),T(t,"class","name_space_left"),T(t,"for","name"),T(a,"class","dark_bordered half focusable_input svelte-1hf5813"),T(a,"id","name"),a.disabled=n[2],T(a,"style",o=n[2]?"color: var(--color-subtle_text);":""),T(e,"class","dialog_bar form_bar")},m(u,d){G(u,e,d),N(e,t),N(t,i),N(e,r),N(e,a),mt(a,n[3]),l||(c=[De(a,"input",n[9]),De(a,"change",n[6])],l=!0)},p(u,d){d&1&&tt(i,u[0]),d&4&&(a.disabled=u[2]),d&4&&o!==(o=u[2]?"color: var(--color-subtle_text);":"")&&T(a,"style",o),d&8&&mt(a,u[3])},d(u){u&&z(e),l=!1,At(c)}}}s(cV,"create_default_slot");function uV(n){let e,t;return e=new kn({props:{label:n[0],tooltip:n[1],warning_text:n[4],error_text:n[5],$$slots:{default:[cV]},$$scope:{ctx:n}}}),{c(){fe(e.$$.fragment)},m(i,r){de(e,i,r),t=!0},p(i,[r]){let a={};r&1&&(a.label=i[0]),r&2&&(a.tooltip=i[1]),r&16&&(a.warning_text=i[4]),r&32&&(a.error_text=i[5]),r&1037&&(a.$$scope={dirty:r,ctx:i}),e.$set(a)},i(i){t||(W(e.$$.fragment,i),t=!0)},o(i){Y(e.$$.fragment,i),t=!1},d(i){ue(e,i)}}}s(uV,"create_fragment");function dV(n,e,t){let{label:i}=e,{tooltip:r=""}=e,{value:a}=e,{disabled:o=!1}=e,{valueChecker:l=void 0}=e,c=a.get(),u="",d="";function m(){if(l){let f=l(c);f.type==="error"?t(5,d=f.message):t(5,d=""),f.type==="warning"?t(4,u=f.message):t(4,u="")}a.set(c),t(3,c=a.get())}s(m,"onValueChange"),m();function p(){c=this.value,t(3,c)}return s(p,"textarea_input_handler"),n.$$set=f=>{"label"in f&&t(0,i=f.label),"tooltip"in f&&t(1,r=f.tooltip),"value"in f&&t(7,a=f.value),"disabled"in f&&t(2,o=f.disabled),"valueChecker"in f&&t(8,l=f.valueChecker)},[i,r,o,c,u,d,m,a,l,p]}s(dV,"instance");var ju=class extends je{constructor(e){super(),Ie(this,e,dV,uV,Ae,{label:0,tooltip:1,value:7,disabled:2,valueChecker:8})}};s(ju,"CodeInput");var Bl=ju;(()=>{let n=Blockbench.addCSS("textarea.svelte-1hf5813{resize:vertical;text-wrap:nowrap;min-height:60px;font-family:var(--font-code)}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();function fV(n){let e,t,i,r,a,o,l,c,u;return{c(){e=V("div"),t=V("label"),i=Ne(n[0]),r=K(),a=V("input"),o=K(),l=V("div"),l.innerHTML='insert_drive_file',T(t,"class","name_space_left"),T(t,"for","name"),T(a,"type","text"),T(a,"class","dark_bordered half focusable_input svelte-9od7jv"),T(a,"id","name"),T(l,"class","tool animated-java-file-select-icon svelte-9od7jv"),T(e,"class","dialog_bar form_bar")},m(d,m){G(d,e,m),N(e,t),N(t,i),N(e,r),N(e,a),mt(a,n[2]),N(e,o),N(e,l),c||(u=[De(a,"input",n[11]),De(a,"input",n[5]),De(a,"change",n[5]),De(l,"click",n[12])],c=!0)},p(d,m){m&1&&tt(i,d[0]),m&4&&a.value!==d[2]&&mt(a,d[2])},d(d){d&&z(e),c=!1,At(u)}}}s(fV,"create_default_slot");function mV(n){let e,t,i,r;function a(c){n[13](c)}s(a,"basedialogitem_warning_text_binding");function o(c){n[14](c)}s(o,"basedialogitem_error_text_binding");let l={label:n[0],tooltip:n[1],$$slots:{default:[fV]},$$scope:{ctx:n}};return n[3]!==void 0&&(l.warning_text=n[3]),n[4]!==void 0&&(l.error_text=n[4]),e=new kn({props:l}),se.push(()=>be(e,"warning_text",a)),se.push(()=>be(e,"error_text",o)),{c(){fe(e.$$.fragment)},m(c,u){de(e,c,u),r=!0},p(c,[u]){let d={};u&1&&(d.label=c[0]),u&2&&(d.tooltip=c[1]),u&65541&&(d.$$scope={dirty:u,ctx:c}),!t&&u&8&&(t=!0,d.warning_text=c[3],he(()=>t=!1)),!i&&u&16&&(i=!0,d.error_text=c[4],he(()=>i=!1)),e.$set(d)},i(c){r||(W(e.$$.fragment,c),r=!0)},o(c){Y(e.$$.fragment,c),r=!1},d(c){ue(e,c)}}}s(mV,"create_fragment");function pV(n,e,t){let{label:i}=e,{tooltip:r=""}=e,{value:a}=e,{filters:o=[]}=e,{fileSelectMessage:l="Select Folder"}=e,c=a.get(),{valueChecker:u=void 0}=e,d="",m="";function p(){if(!u)return;let x=u(a.get());x.type==="error"?t(4,m=x.message):t(4,m=""),x.type==="warning"?t(3,d=x.message):t(3,d="")}s(p,"checkValue"),a.subscribe(()=>p());function f(){a.set(c),t(2,c=a.get())}s(f,"onValueChange");function _(){Promise.any([electron.dialog.showOpenDialog({properties:["openDirectory"],filters:o,message:l})]).then(x=>{x.canceled||(t(2,c=x.filePaths[0]),f())})}s(_,"selectFile"),f();function v(){c=this.value,t(2,c)}s(v,"input_input_handler");let g=s(()=>_(),"click_handler");function h(x){d=x,t(3,d)}s(h,"basedialogitem_warning_text_binding");function b(x){m=x,t(4,m)}return s(b,"basedialogitem_error_text_binding"),n.$$set=x=>{"label"in x&&t(0,i=x.label),"tooltip"in x&&t(1,r=x.tooltip),"value"in x&&t(7,a=x.value),"filters"in x&&t(8,o=x.filters),"fileSelectMessage"in x&&t(9,l=x.fileSelectMessage),"valueChecker"in x&&t(10,u=x.valueChecker)},[i,r,c,d,m,f,_,a,o,l,u,v,g,h,b]}s(pV,"instance");var Iu=class extends je{constructor(e){super(),Ie(this,e,pV,mV,Ae,{label:0,tooltip:1,value:7,filters:8,fileSelectMessage:9,valueChecker:10})}};s(Iu,"FolderSelect");var Zo=Iu;(()=>{let n=Blockbench.addCSS(".animated-java-file-select-icon.svelte-9od7jv{display:flex;justify-content:flex-end}i.svelte-9od7jv{font-size:20px;margin-right:4px;color:var(--color-subtle_text);cursor:pointer}i.svelte-9od7jv:hover{color:var(--color-text)}input.svelte-9od7jv{font-family:var(--font-code)}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();function _V(n){let e,t,i,r,a,o,l,c,u;return{c(){e=V("div"),t=V("label"),i=Ne(n[0]),r=K(),a=V("input"),o=K(),l=V("div"),l.innerHTML='insert_drive_file',T(t,"class","name_space_left"),T(t,"for","name"),T(a,"type","text"),T(a,"class","dark_bordered half focusable_input svelte-9od7jv"),T(a,"id","name"),T(l,"class","tool animated-java-file-select-icon svelte-9od7jv"),T(e,"class","dialog_bar form_bar")},m(d,m){G(d,e,m),N(e,t),N(t,i),N(e,r),N(e,a),mt(a,n[2]),N(e,o),N(e,l),c||(u=[De(a,"input",n[11]),De(a,"input",n[5]),De(a,"change",n[5]),De(l,"click",n[12])],c=!0)},p(d,m){m&1&&tt(i,d[0]),m&4&&a.value!==d[2]&&mt(a,d[2])},d(d){d&&z(e),c=!1,At(u)}}}s(_V,"create_default_slot");function gV(n){let e,t,i,r;function a(c){n[13](c)}s(a,"basedialogitem_warning_text_binding");function o(c){n[14](c)}s(o,"basedialogitem_error_text_binding");let l={label:n[0],tooltip:n[1],$$slots:{default:[_V]},$$scope:{ctx:n}};return n[3]!==void 0&&(l.warning_text=n[3]),n[4]!==void 0&&(l.error_text=n[4]),e=new kn({props:l}),se.push(()=>be(e,"warning_text",a)),se.push(()=>be(e,"error_text",o)),{c(){fe(e.$$.fragment)},m(c,u){de(e,c,u),r=!0},p(c,[u]){let d={};u&1&&(d.label=c[0]),u&2&&(d.tooltip=c[1]),u&65541&&(d.$$scope={dirty:u,ctx:c}),!t&&u&8&&(t=!0,d.warning_text=c[3],he(()=>t=!1)),!i&&u&16&&(i=!0,d.error_text=c[4],he(()=>i=!1)),e.$set(d)},i(c){r||(W(e.$$.fragment,c),r=!0)},o(c){Y(e.$$.fragment,c),r=!1},d(c){ue(e,c)}}}s(gV,"create_fragment");function hV(n,e,t){let{label:i}=e,{tooltip:r=""}=e,{value:a}=e,{filters:o=[]}=e,{fileSelectMessage:l="Select File"}=e,c=a.get(),{valueChecker:u=void 0}=e,d="",m="";function p(){if(!u)return;let x=u(a.get());x.type==="error"?t(4,m=x.message):t(4,m=""),x.type==="warning"?t(3,d=x.message):t(3,d="")}s(p,"checkValue"),a.subscribe(()=>p());function f(){a.set(c),t(2,c=a.get())}s(f,"onValueChange");function _(){Promise.any([electron.dialog.showOpenDialog({properties:["openFile","promptToCreate"],filters:o,message:l})]).then(x=>{x.canceled||(t(2,c=x.filePaths[0]),f())})}s(_,"selectFile"),f();function v(){c=this.value,t(2,c)}s(v,"input_input_handler");let g=s(()=>_(),"click_handler");function h(x){d=x,t(3,d)}s(h,"basedialogitem_warning_text_binding");function b(x){m=x,t(4,m)}return s(b,"basedialogitem_error_text_binding"),n.$$set=x=>{"label"in x&&t(0,i=x.label),"tooltip"in x&&t(1,r=x.tooltip),"value"in x&&t(7,a=x.value),"filters"in x&&t(8,o=x.filters),"fileSelectMessage"in x&&t(9,l=x.fileSelectMessage),"valueChecker"in x&&t(10,u=x.valueChecker)},[i,r,c,d,m,f,_,a,o,l,u,v,g,h,b]}s(hV,"instance");var Ou=class extends je{constructor(e){super(),Ie(this,e,hV,gV,Ae,{label:0,tooltip:1,value:7,filters:8,fileSelectMessage:9,valueChecker:10})}};s(Ou,"FileSelect");var Dl=Ou;(()=>{let n=Blockbench.addCSS(".animated-java-file-select-icon.svelte-9od7jv{display:flex;justify-content:flex-end}i.svelte-9od7jv{font-size:20px;margin-right:4px;color:var(--color-subtle_text);cursor:pointer}i.svelte-9od7jv:hover{color:var(--color-text)}input.svelte-9od7jv{font-family:var(--font-code)}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();function bV(n){let e,t,i;return{c(){e=V("div"),t=V("h4"),i=Ne(n[0]),T(t,"class","name_space_left svelte-1p3llgn"),T(e,"class","dialog_bar form_bar animated-java-section-header svelte-1p3llgn")},m(r,a){G(r,e,a),N(e,t),N(t,i)},p(r,[a]){a&1&&tt(i,r[0])},i:re,o:re,d(r){r&&z(e)}}}s(bV,"create_fragment");function vV(n,e,t){let{label:i}=e;return n.$$set=r=>{"label"in r&&t(0,i=r.label)},[i]}s(vV,"instance");var Nu=class extends je{constructor(e){super(),Ie(this,e,vV,bV,Ae,{label:0})}};s(Nu,"SectionHeader");var Bu=Nu;(()=>{let n=Blockbench.addCSS(".animated-java-section-header.svelte-1p3llgn{display:flex;flex-direction:row;justify-content:flex-start;align-items:center}h4.svelte-1p3llgn{padding:0px 8px;flex-grow:1;font-size:1.12em;border-bottom:2px solid var(--color-back);background-color:var(--color-button)}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();function yV(n){let e,t,i,r,a,o,l,c,u,d,m,p,f,_,v,g;return{c(){e=V("div"),t=V("label"),i=Ne(n[0]),r=K(),a=V("div"),o=V("div"),l=V("input"),c=K(),u=V("div"),u.innerHTML='code',d=K(),m=V("div"),p=V("input"),f=K(),_=V("div"),_.innerHTML='code',T(t,"class","name_space_left"),T(t,"for","name"),T(l,"id","snapping"),T(l,"class","dark_bordered focusable_input"),T(l,"inputmode","decimal"),T(u,"class","tool numaric_input_slider"),T(o,"class","numeric_input"),T(p,"id","snapping"),T(p,"class","dark_bordered focusable_input"),T(p,"inputmode","decimal"),T(_,"class","tool numaric_input_slider"),T(m,"class","numeric_input"),T(a,"class","dialog_vector_group half"),T(e,"class","dialog_bar form_bar")},m(h,b){G(h,e,b),N(e,t),N(t,i),N(e,r),N(e,a),N(a,o),N(o,l),n[18](l),mt(l,n[10]),N(o,c),N(o,u),n[20](u),N(a,d),N(a,m),N(m,p),n[21](p),mt(p,n[11]),N(m,f),N(m,_),n[23](_),v||(g=[De(l,"input",n[19]),De(p,"input",n[22])],v=!0)},p(h,b){b&1&&tt(i,h[0]),b&1024&&l.value!==h[10]&&mt(l,h[10]),b&2048&&p.value!==h[11]&&mt(p,h[11])},d(h){h&&z(e),n[18](null),n[20](null),n[21](null),n[23](null),v=!1,At(g)}}}s(yV,"create_default_slot");function wV(n){let e,t,i,r;function a(c){n[24](c)}s(a,"basedialogitem_warning_text_binding");function o(c){n[25](c)}s(o,"basedialogitem_error_text_binding");let l={label:n[0],tooltip:n[1],$$slots:{default:[yV]},$$scope:{ctx:n}};return n[4]!==void 0&&(l.warning_text=n[4]),n[5]!==void 0&&(l.error_text=n[5]),e=new kn({props:l}),se.push(()=>be(e,"warning_text",a)),se.push(()=>be(e,"error_text",o)),{c(){fe(e.$$.fragment)},m(c,u){de(e,c,u),r=!0},p(c,[u]){let d={};u&1&&(d.label=c[0]),u&2&&(d.tooltip=c[1]),u&536874945&&(d.$$scope={dirty:u,ctx:c}),!t&&u&16&&(t=!0,d.warning_text=c[4],he(()=>t=!1)),!i&&u&32&&(i=!0,d.error_text=c[5],he(()=>i=!1)),e.$set(d)},i(c){r||(W(e.$$.fragment,c),r=!0)},o(c){Y(e.$$.fragment,c),r=!1},d(c){ue(e,c)}}}s(wV,"create_fragment");function xV(n,e,t){let i,r=re,a=s(()=>(r(),r=ze(p,j=>t(10,i=j)),p),"$$subscribe_valueX"),o,l=re,c=s(()=>(l(),l=ze(v,j=>t(11,o=j)),v),"$$subscribe_valueY");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l());let{label:u}=e,{tooltip:d=""}=e,{step:m=void 0}=e,{valueX:p}=e;a();let{minX:f=void 0}=e,{maxX:_=void 0}=e,{valueY:v}=e;c();let{minY:g=void 0}=e,{maxY:h=void 0}=e,{valueChecker:b=void 0}=e,x="",y="";function k(){if(!b)return;let j=b({x:p.get(),y:v.get()});j.type==="error"?t(5,y=j.message):t(5,y=""),j.type==="warning"?t(4,x=j.message):t(4,x="")}s(k,"checkValue"),p.subscribe(()=>k()),v.subscribe(()=>k());let C=new Molang,A,I,S,L;function O(j,Q,P,oe){addEventListeners(j,"mousedown touchstart",Z=>{convertTouchEvent(Z);let J=0;function ie(q){convertTouchEvent(q);let ge=Math.trunc((q.clientX-Z.clientX)/10)*(m||1);ge!=J&&(Q.set(Math.clamp(Q.get()+(ge-J),P!==void 0?P:-1/0,oe!==void 0?oe:1/0)),J=ge)}s(ie,"move");function U(q){removeEventListeners(document,"mousemove touchmove",ie,null),removeEventListeners(document,"mouseup touchend",U,null)}s(U,"stop"),addEventListeners(document,"mousemove touchmove",ie),addEventListeners(document,"mouseup touchend",U)}),addEventListeners(A,"focusout dblclick",()=>{Q.set(Math.clamp(C.parse(Q.get()),P!==void 0?P:-1/0,oe!==void 0?oe:1/0))})}s(O,"eventListenerFactory"),requestAnimationFrame(()=>{O(I,p,f,_),O(L,v,g,h)});function E(j){se[j?"unshift":"push"](()=>{A=j,t(6,A)})}s(E,"input0_binding");function B(){i=this.value,p.set(i)}s(B,"input0_input_handler");function H(j){se[j?"unshift":"push"](()=>{I=j,t(7,I)})}s(H,"div0_binding");function ee(j){se[j?"unshift":"push"](()=>{S=j,t(8,S)})}s(ee,"input1_binding");function ae(){o=this.value,v.set(o)}s(ae,"input1_input_handler");function ne(j){se[j?"unshift":"push"](()=>{L=j,t(9,L)})}s(ne,"div2_binding");function ve(j){x=j,t(4,x)}s(ve,"basedialogitem_warning_text_binding");function X(j){y=j,t(5,y)}return s(X,"basedialogitem_error_text_binding"),n.$$set=j=>{"label"in j&&t(0,u=j.label),"tooltip"in j&&t(1,d=j.tooltip),"step"in j&&t(12,m=j.step),"valueX"in j&&a(t(2,p=j.valueX)),"minX"in j&&t(13,f=j.minX),"maxX"in j&&t(14,_=j.maxX),"valueY"in j&&c(t(3,v=j.valueY)),"minY"in j&&t(15,g=j.minY),"maxY"in j&&t(16,h=j.maxY),"valueChecker"in j&&t(17,b=j.valueChecker)},[u,d,p,v,x,y,A,I,S,L,i,o,m,f,_,g,h,b,E,B,H,ee,ae,ne,ve,X]}s(xV,"instance");var Du=class extends je{constructor(e){super(),Ie(this,e,xV,wV,Ae,{label:0,tooltip:1,step:12,valueX:2,minX:13,maxX:14,valueY:3,minY:15,maxY:16,valueChecker:17})}};s(Du,"Vector2d");var Bm=Du;function L0(n){let e,t,i,r;function a(c){n[39](c)}s(a,"vector2d_valueX_binding_1");function o(c){n[40](c)}s(o,"vector2d_valueY_binding_1");let l={label:w("dialog.blueprint_settings.bounding_box.title"),tooltip:w("dialog.blueprint_settings.bounding_box.description"),minX:2,maxX:4096,minY:2,maxY:4096};return n[9]!==void 0&&(l.valueX=n[9]),n[10]!==void 0&&(l.valueY=n[10]),e=new Bm({props:l}),se.push(()=>be(e,"valueX",a)),se.push(()=>be(e,"valueY",o)),{c(){fe(e.$$.fragment)},m(c,u){de(e,c,u),r=!0},p(c,u){let d={};!t&&u[0]&512&&(t=!0,d.valueX=c[9],he(()=>t=!1)),!i&&u[0]&1024&&(i=!0,d.valueY=c[10],he(()=>i=!1)),e.$set(d)},i(c){r||(W(e.$$.fragment,c),r=!0)},o(c){Y(e.$$.fragment,c),r=!1},d(c){ue(e,c)}}}s(L0,"create_if_block_10");function kV(n){let e,t,i,r,a,o,l,c,u;function d(g){n[47](g)}s(d,"select0_value_binding");let m={label:w("dialog.blueprint_settings.resource_pack_export_mode.title"),tooltip:w("dialog.blueprint_settings.resource_pack_export_mode.description"),options:{raw:w("dialog.blueprint_settings.resource_pack_export_mode.options.raw"),zip:w("dialog.blueprint_settings.resource_pack_export_mode.options.zip"),none:w("dialog.blueprint_settings.resource_pack_export_mode.options.none")},defaultOption:"raw"};n[5]!==void 0&&(m.value=n[5]),e=new Kn({props:m}),se.push(()=>be(e,"value",d));function p(g){n[48](g)}s(p,"select1_value_binding");let f={label:w("dialog.blueprint_settings.data_pack_export_mode.title"),tooltip:w("dialog.blueprint_settings.data_pack_export_mode.description"),options:{raw:w("dialog.blueprint_settings.data_pack_export_mode.options.raw"),zip:w("dialog.blueprint_settings.data_pack_export_mode.options.zip"),none:w("dialog.blueprint_settings.data_pack_export_mode.options.none")},defaultOption:"raw"};n[6]!==void 0&&(f.value=n[6]),r=new Kn({props:f}),se.push(()=>be(r,"value",p));let _=n[29]!=="none"&&P0(n),v=n[31]!=="none"&&V0(n);return{c(){fe(e.$$.fragment),i=K(),fe(r.$$.fragment),o=K(),_&&_.c(),l=K(),v&&v.c(),c=St()},m(g,h){de(e,g,h),G(g,i,h),de(r,g,h),G(g,o,h),_&&_.m(g,h),G(g,l,h),v&&v.m(g,h),G(g,c,h),u=!0},p(g,h){let b={};!t&&h[0]&32&&(t=!0,b.value=g[5],he(()=>t=!1)),e.$set(b);let x={};!a&&h[0]&64&&(a=!0,x.value=g[6],he(()=>a=!1)),r.$set(x),g[29]!=="none"?_?(_.p(g,h),h[0]&536870912&&W(_,1)):(_=P0(g),_.c(),W(_,1),_.m(l.parentNode,l)):_&&(bt(),Y(_,1,1,()=>{_=null}),vt()),g[31]!=="none"?v?(v.p(g,h),h[1]&1&&W(v,1)):(v=V0(g),v.c(),W(v,1),v.m(c.parentNode,c)):v&&(bt(),Y(v,1,1,()=>{v=null}),vt())},i(g){u||(W(e.$$.fragment,g),W(r.$$.fragment,g),W(_),W(v),u=!0)},o(g){Y(e.$$.fragment,g),Y(r.$$.fragment,g),Y(_),Y(v),u=!1},d(g){ue(e,g),g&&z(i),ue(r,g),g&&z(o),_&&_.d(g),g&&z(l),v&&v.d(g),g&&z(c)}}}s(kV,"create_else_block");function EV(n){let e,t,i,r,a,o,l,c,u,d,m,p;function f(k){n[43](k)}s(f,"lineinput_value_binding");let _={label:w("dialog.blueprint_settings.display_item.title"),tooltip:w("dialog.blueprint_settings.display_item.description"),valueChecker:Dm};n[11]!==void 0&&(_.value=n[11]),e=new hn({props:_}),se.push(()=>be(e,"value",f));function v(k){n[44](k)}s(v,"numberslider_value_binding");let g={label:w("dialog.blueprint_settings.custom_model_data_offset.title"),tooltip:w("dialog.blueprint_settings.custom_model_data_offset.description")};n[12]!==void 0&&(g.value=n[12]),r=new xt({props:g}),se.push(()=>be(r,"value",v));function h(k){n[45](k)}s(h,"checkbox_checked_binding");let b={label:w("dialog.blueprint_settings.baked_animations.title"),tooltip:w("dialog.blueprint_settings.baked_animations.description")};n[23]!==void 0&&(b.checked=n[23]),l=new it({props:b}),se.push(()=>be(l,"checked",h));function x(k){n[46](k)}s(x,"fileselect_value_binding");let y={label:w("dialog.blueprint_settings.json_file.title"),tooltip:w("dialog.blueprint_settings.json_file.description"),valueChecker:LV};return n[24]!==void 0&&(y.value=n[24]),d=new Dl({props:y}),se.push(()=>be(d,"value",x)),{c(){fe(e.$$.fragment),i=K(),fe(r.$$.fragment),o=K(),fe(l.$$.fragment),u=K(),fe(d.$$.fragment)},m(k,C){de(e,k,C),G(k,i,C),de(r,k,C),G(k,o,C),de(l,k,C),G(k,u,C),de(d,k,C),p=!0},p(k,C){let A={};!t&&C[0]&2048&&(t=!0,A.value=k[11],he(()=>t=!1)),e.$set(A);let I={};!a&&C[0]&4096&&(a=!0,I.value=k[12],he(()=>a=!1)),r.$set(I);let S={};!c&&C[0]&8388608&&(c=!0,S.checked=k[23],he(()=>c=!1)),l.$set(S);let L={};!m&&C[0]&16777216&&(m=!0,L.value=k[24],he(()=>m=!1)),d.$set(L)},i(k){p||(W(e.$$.fragment,k),W(r.$$.fragment,k),W(l.$$.fragment,k),W(d.$$.fragment,k),p=!0)},o(k){Y(e.$$.fragment,k),Y(r.$$.fragment,k),Y(l.$$.fragment,k),Y(d.$$.fragment,k),p=!1},d(k){ue(e,k),k&&z(i),ue(r,k),k&&z(o),ue(l,k),k&&z(u),ue(d,k)}}}s(EV,"create_if_block_1");function P0(n){let e,t,i,r,a,o;e=new Bu({props:{label:w("dialog.blueprint_settings.resource_pack_settings.title")}});let l=[CV,TV],c=[];function u(d,m){return d[29]==="raw"?0:d[29]==="zip"?1:-1}return s(u,"select_block_type_1"),~(i=u(n,[-1,-1,-1]))&&(r=c[i]=l[i](n)),{c(){fe(e.$$.fragment),t=K(),r&&r.c(),a=St()},m(d,m){de(e,d,m),G(d,t,m),~i&&c[i].m(d,m),G(d,a,m),o=!0},p(d,m){let p=i;i=u(d,m),i===p?~i&&c[i].p(d,m):(r&&(bt(),Y(c[p],1,1,()=>{c[p]=null}),vt()),~i?(r=c[i],r?r.p(d,m):(r=c[i]=l[i](d),r.c()),W(r,1),r.m(a.parentNode,a)):r=null)},i(d){o||(W(e.$$.fragment,d),W(r),o=!0)},o(d){Y(e.$$.fragment,d),Y(r),o=!1},d(d){ue(e,d),d&&z(t),~i&&c[i].d(d),d&&z(a)}}}s(P0,"create_if_block_6");function TV(n){let e,t,i;function r(o){n[58](o)}s(r,"fileselect_value_binding_2");let a={label:w("dialog.blueprint_settings.resource_pack_zip.title"),tooltip:w("dialog.blueprint_settings.resource_pack_zip.description"),valueChecker:J0};return n[14]!==void 0&&(a.value=n[14]),e=new Dl({props:a}),se.push(()=>be(e,"value",r)),{c(){fe(e.$$.fragment)},m(o,l){de(e,o,l),i=!0},p(o,l){let c={};!t&&l[0]&16384&&(t=!0,c.value=o[14],he(()=>t=!1)),e.$set(c)},i(o){i||(W(e.$$.fragment,o),i=!0)},o(o){Y(e.$$.fragment,o),i=!1},d(o){ue(e,o)}}}s(TV,"create_if_block_9");function CV(n){let e,t,i,r,a,o,l;function c(f){n[49](f)}s(c,"checkbox_checked_binding_1");let u={label:w("dialog.blueprint_settings.enable_advanced_resource_pack_settings.title")};n[13]!==void 0&&(u.checked=n[13]),e=new it({props:u}),se.push(()=>be(e,"checked",c));let d=[SV,AV],m=[];function p(f,_){return f[30]?0:1}return s(p,"select_block_type_2"),r=p(n,[-1,-1,-1]),a=m[r]=d[r](n),{c(){fe(e.$$.fragment),i=K(),a.c(),o=St()},m(f,_){de(e,f,_),G(f,i,_),m[r].m(f,_),G(f,o,_),l=!0},p(f,_){let v={};!t&&_[0]&8192&&(t=!0,v.checked=f[13],he(()=>t=!1)),e.$set(v);let g=r;r=p(f,_),r===g?m[r].p(f,_):(bt(),Y(m[g],1,1,()=>{m[g]=null}),vt(),a=m[r],a?a.p(f,_):(a=m[r]=d[r](f),a.c()),W(a,1),a.m(o.parentNode,o))},i(f){l||(W(e.$$.fragment,f),W(a),l=!0)},o(f){Y(e.$$.fragment,f),Y(a),l=!1},d(f){ue(e,f),f&&z(i),m[r].d(f),f&&z(o)}}}s(CV,"create_if_block_7");function AV(n){let e,t,i,r,a,o,l,c,u;function d(g){n[55](g)}s(d,"lineinput_value_binding_2");let m={label:w("dialog.blueprint_settings.display_item.title"),tooltip:w("dialog.blueprint_settings.display_item.description"),valueChecker:Dm};n[11]!==void 0&&(m.value=n[11]),e=new hn({props:m}),se.push(()=>be(e,"value",d));function p(g){n[56](g)}s(p,"numberslider_value_binding_2");let f={label:w("dialog.blueprint_settings.custom_model_data_offset.title"),tooltip:w("dialog.blueprint_settings.custom_model_data_offset.description"),min:0,max:2147483647};n[12]!==void 0&&(f.value=n[12]),r=new xt({props:f}),se.push(()=>be(r,"value",p));function _(g){n[57](g)}s(_,"folderselect_value_binding");let v={label:w("dialog.blueprint_settings.resource_pack.title"),tooltip:w("dialog.blueprint_settings.resource_pack.description"),valueChecker:MV};return n[14]!==void 0&&(v.value=n[14]),l=new Zo({props:v}),se.push(()=>be(l,"value",_)),{c(){fe(e.$$.fragment),i=K(),fe(r.$$.fragment),o=K(),fe(l.$$.fragment)},m(g,h){de(e,g,h),G(g,i,h),de(r,g,h),G(g,o,h),de(l,g,h),u=!0},p(g,h){let b={};!t&&h[0]&2048&&(t=!0,b.value=g[11],he(()=>t=!1)),e.$set(b);let x={};!a&&h[0]&4096&&(a=!0,x.value=g[12],he(()=>a=!1)),r.$set(x);let y={};!c&&h[0]&16384&&(c=!0,y.value=g[14],he(()=>c=!1)),l.$set(y)},i(g){u||(W(e.$$.fragment,g),W(r.$$.fragment,g),W(l.$$.fragment,g),u=!0)},o(g){Y(e.$$.fragment,g),Y(r.$$.fragment,g),Y(l.$$.fragment,g),u=!1},d(g){ue(e,g),g&&z(i),ue(r,g),g&&z(o),ue(l,g)}}}s(AV,"create_else_block_2");function SV(n){let e,t,i,r,a,o,l,c,u,d,m,p,f,_,v,g,h;function b(E){n[50](E)}s(b,"lineinput_value_binding_1");let x={label:w("dialog.blueprint_settings.display_item.title"),tooltip:w("dialog.blueprint_settings.display_item.description"),valueChecker:Dm};n[11]!==void 0&&(x.value=n[11]),i=new hn({props:x}),se.push(()=>be(i,"value",b));function y(E){n[51](E)}s(y,"numberslider_value_binding_1");let k={label:w("dialog.blueprint_settings.custom_model_data_offset.title"),tooltip:w("dialog.blueprint_settings.custom_model_data_offset.description")};n[12]!==void 0&&(k.value=n[12]),o=new xt({props:k}),se.push(()=>be(o,"value",y));function C(E){n[52](E)}s(C,"fileselect_value_binding_1");let A={label:w("dialog.blueprint_settings.display_item_path.title"),tooltip:w("dialog.blueprint_settings.display_item_path.description"),valueChecker:FV};n[15]!==void 0&&(A.value=n[15]),u=new Dl({props:A}),se.push(()=>be(u,"value",C));function I(E){n[53](E)}s(I,"folderselect0_value_binding");let S={label:w("dialog.blueprint_settings.model_folder.title"),tooltip:w("dialog.blueprint_settings.model_folder.description"),valueChecker:U0};n[16]!==void 0&&(S.value=n[16]),p=new Zo({props:S}),se.push(()=>be(p,"value",I));function L(E){n[54](E)}s(L,"folderselect1_value_binding");let O={label:w("dialog.blueprint_settings.texture_folder.title"),tooltip:w("dialog.blueprint_settings.texture_folder.description"),valueChecker:U0};return n[17]!==void 0&&(O.value=n[17]),v=new Zo({props:O}),se.push(()=>be(v,"value",L)),{c(){e=V("p"),e.textContent=`${w("dialog.blueprint_settings.advanced_settings_warning")}`,t=K(),fe(i.$$.fragment),a=K(),fe(o.$$.fragment),c=K(),fe(u.$$.fragment),m=K(),fe(p.$$.fragment),_=K(),fe(v.$$.fragment),T(e,"class","warning svelte-1wavurd")},m(E,B){G(E,e,B),G(E,t,B),de(i,E,B),G(E,a,B),de(o,E,B),G(E,c,B),de(u,E,B),G(E,m,B),de(p,E,B),G(E,_,B),de(v,E,B),h=!0},p(E,B){let H={};!r&&B[0]&2048&&(r=!0,H.value=E[11],he(()=>r=!1)),i.$set(H);let ee={};!l&&B[0]&4096&&(l=!0,ee.value=E[12],he(()=>l=!1)),o.$set(ee);let ae={};!d&&B[0]&32768&&(d=!0,ae.value=E[15],he(()=>d=!1)),u.$set(ae);let ne={};!f&&B[0]&65536&&(f=!0,ne.value=E[16],he(()=>f=!1)),p.$set(ne);let ve={};!g&&B[0]&131072&&(g=!0,ve.value=E[17],he(()=>g=!1)),v.$set(ve)},i(E){h||(W(i.$$.fragment,E),W(o.$$.fragment,E),W(u.$$.fragment,E),W(p.$$.fragment,E),W(v.$$.fragment,E),h=!0)},o(E){Y(i.$$.fragment,E),Y(o.$$.fragment,E),Y(u.$$.fragment,E),Y(p.$$.fragment,E),Y(v.$$.fragment,E),h=!1},d(E){E&&z(e),E&&z(t),ue(i,E),E&&z(a),ue(o,E),E&&z(c),ue(u,E),E&&z(m),ue(p,E),E&&z(_),ue(v,E)}}}s(SV,"create_if_block_8");function V0(n){let e,t,i,r,a,o,l,c,u,d,m,p,f,_,v,g,h;e=new Bu({props:{label:w("dialog.blueprint_settings.data_pack_settings.title")}});let b=[IV,jV],x=[];function y(B,H){return B[31]==="raw"?0:B[31]==="zip"?1:-1}s(y,"select_block_type_3"),~(i=y(n,[-1,-1,-1]))&&(r=x[i]=b[i](n));function k(B){n[62](B)}s(k,"codeinput_value_binding");let C={label:w("dialog.blueprint_settings.summon_commands.title"),tooltip:w("dialog.blueprint_settings.summon_commands.description")};n[19]!==void 0&&(C.value=n[19]),o=new Bl({props:C}),se.push(()=>be(o,"value",k));function A(B){n[63](B)}s(A,"numberslider0_value_binding");let I={label:w("dialog.blueprint_settings.interpolation_duration.title"),tooltip:w("dialog.blueprint_settings.interpolation_duration.description"),min:0,max:2147483647};n[20]!==void 0&&(I.value=n[20]),u=new xt({props:I}),se.push(()=>be(u,"value",A));function S(B){n[64](B)}s(S,"numberslider1_value_binding");let L={label:w("dialog.blueprint_settings.teleportation_duration.title"),tooltip:w("dialog.blueprint_settings.teleportation_duration.description"),min:0,max:2147483647};n[21]!==void 0&&(L.value=n[21]),p=new xt({props:L}),se.push(()=>be(p,"value",S));function O(B){n[65](B)}s(O,"checkbox_checked_binding_2");let E={label:w("dialog.blueprint_settings.use_storage_for_animation.title"),tooltip:w("dialog.blueprint_settings.use_storage_for_animation.description")};return n[22]!==void 0&&(E.checked=n[22]),v=new it({props:E}),se.push(()=>be(v,"checked",O)),{c(){fe(e.$$.fragment),t=K(),r&&r.c(),a=K(),fe(o.$$.fragment),c=K(),fe(u.$$.fragment),m=K(),fe(p.$$.fragment),_=K(),fe(v.$$.fragment)},m(B,H){de(e,B,H),G(B,t,H),~i&&x[i].m(B,H),G(B,a,H),de(o,B,H),G(B,c,H),de(u,B,H),G(B,m,H),de(p,B,H),G(B,_,H),de(v,B,H),h=!0},p(B,H){let ee=i;i=y(B,H),i===ee?~i&&x[i].p(B,H):(r&&(bt(),Y(x[ee],1,1,()=>{x[ee]=null}),vt()),~i?(r=x[i],r?r.p(B,H):(r=x[i]=b[i](B),r.c()),W(r,1),r.m(a.parentNode,a)):r=null);let ae={};!l&&H[0]&524288&&(l=!0,ae.value=B[19],he(()=>l=!1)),o.$set(ae);let ne={};!d&&H[0]&1048576&&(d=!0,ne.value=B[20],he(()=>d=!1)),u.$set(ne);let ve={};!f&&H[0]&2097152&&(f=!0,ve.value=B[21],he(()=>f=!1)),p.$set(ve);let X={};!g&&H[0]&4194304&&(g=!0,X.checked=B[22],he(()=>g=!1)),v.$set(X)},i(B){h||(W(e.$$.fragment,B),W(r),W(o.$$.fragment,B),W(u.$$.fragment,B),W(p.$$.fragment,B),W(v.$$.fragment,B),h=!0)},o(B){Y(e.$$.fragment,B),Y(r),Y(o.$$.fragment,B),Y(u.$$.fragment,B),Y(p.$$.fragment,B),Y(v.$$.fragment,B),h=!1},d(B){ue(e,B),B&&z(t),~i&&x[i].d(B),B&&z(a),ue(o,B),B&&z(c),ue(u,B),B&&z(m),ue(p,B),B&&z(_),ue(v,B)}}}s(V0,"create_if_block_2");function jV(n){let e,t,i;function r(o){n[61](o)}s(r,"fileselect_value_binding_3");let a={label:w("dialog.blueprint_settings.data_pack_zip.title"),tooltip:w("dialog.blueprint_settings.data_pack_zip.description"),valueChecker:J0};return n[18]!==void 0&&(a.value=n[18]),e=new Dl({props:a}),se.push(()=>be(e,"value",r)),{c(){fe(e.$$.fragment)},m(o,l){de(e,o,l),i=!0},p(o,l){let c={};!t&&l[0]&262144&&(t=!0,c.value=o[18],he(()=>t=!1)),e.$set(c)},i(o){i||(W(e.$$.fragment,o),i=!0)},o(o){Y(e.$$.fragment,o),i=!1},d(o){ue(e,o)}}}s(jV,"create_if_block_5");function IV(n){let e,t,i,r,a=[NV,OV],o=[];function l(c,u){return c[32]?0:1}return s(l,"select_block_type_4"),e=l(n,[-1,-1,-1]),t=o[e]=a[e](n),{c(){t.c(),i=St()},m(c,u){o[e].m(c,u),G(c,i,u),r=!0},p(c,u){let d=e;e=l(c,u),e===d?o[e].p(c,u):(bt(),Y(o[d],1,1,()=>{o[d]=null}),vt(),t=o[e],t?t.p(c,u):(t=o[e]=a[e](c),t.c()),W(t,1),t.m(i.parentNode,i))},i(c){r||(W(t),r=!0)},o(c){Y(t),r=!1},d(c){o[e].d(c),c&&z(i)}}}s(IV,"create_if_block_3");function OV(n){let e,t,i;function r(o){n[60](o)}s(r,"folderselect_value_binding_2");let a={label:w("dialog.blueprint_settings.data_pack.title"),tooltip:w("dialog.blueprint_settings.data_pack.description"),valueChecker:G0};return n[18]!==void 0&&(a.value=n[18]),e=new Zo({props:a}),se.push(()=>be(e,"value",r)),{c(){fe(e.$$.fragment)},m(o,l){de(e,o,l),i=!0},p(o,l){let c={};!t&&l[0]&262144&&(t=!0,c.value=o[18],he(()=>t=!1)),e.$set(c)},i(o){i||(W(e.$$.fragment,o),i=!0)},o(o){Y(e.$$.fragment,o),i=!1},d(o){ue(e,o)}}}s(OV,"create_else_block_1");function NV(n){let e,t,i,r,a;function o(c){n[59](c)}s(o,"folderselect_value_binding_1");let l={label:w("dialog.blueprint_settings.data_pack.title"),tooltip:w("dialog.blueprint_settings.data_pack.description"),valueChecker:G0};return n[18]!==void 0&&(l.value=n[18]),i=new Zo({props:l}),se.push(()=>be(i,"value",o)),{c(){e=V("p"),e.textContent=`${w("dialog.blueprint_settings.advanced_settings_warning")}`,t=K(),fe(i.$$.fragment),T(e,"class","warning svelte-1wavurd")},m(c,u){G(c,e,u),G(c,t,u),de(i,c,u),a=!0},p(c,u){let d={};!r&&u[0]&262144&&(r=!0,d.value=c[18],he(()=>r=!1)),i.$set(d)},i(c){a||(W(i.$$.fragment,c),a=!0)},o(c){Y(i.$$.fragment,c),a=!1},d(c){c&&z(e),c&&z(t),ue(i,c)}}}s(NV,"create_if_block_4");function z0(n){let e,t,i,r,a,o,l,c,u,d,m,p,f,_,v,g,h;return{c(){e=V("div"),t=V("div"),i=V("div"),r=V("img"),o=K(),l=V("span"),l.textContent="Animated Java?",c=K(),u=V("i"),u.textContent="close",d=K(),m=V("a"),p=V("img"),_=K(),v=V("div"),T(r,"class","heart svelte-1wavurd"),$t(r.src,a=Gh)||T(r,"src",a),T(r,"alt","\u2764\uFE0F"),T(l,"class","svelte-1wavurd"),T(u,"class","material-icons icon svelte-1wavurd"),T(i,"class","title svelte-1wavurd"),$t(p.src,f=Uh)||T(p,"src",f),T(p,"alt",""),T(p,"class","svelte-1wavurd"),T(m,"href","https://ko-fi.com/snavesutit"),T(m,"class","ko-fi-button svelte-1wavurd"),T(t,"class","ko-fi-popup svelte-1wavurd"),T(v,"class","shadow svelte-1wavurd"),T(e,"class","ko-fi-popup-container svelte-1wavurd")},m(b,x){G(b,e,x),N(e,t),N(t,i),N(i,r),N(i,o),N(i,l),N(i,c),N(i,u),N(t,d),N(t,m),N(m,p),N(e,_),N(e,v),g||(h=[De(u,"click",n[33]),De(u,"mouseenter",PV),De(u,"mouseleave",VV)],g=!0)},p:re,d(b){b&&z(e),g=!1,At(h)}}}s(z0,"create_if_block");function BV(n){let e,t,i,r,a,o,l,c,u,d,m,p,f,_,v,g,h,b,x,y,k,C,A,I,S,L,O,E,B,H;function ee(pe){n[34](pe)}s(ee,"lineinput0_value_binding");let ae={label:w("dialog.blueprint_settings.blueprint_name.title"),tooltip:w("dialog.blueprint_settings.blueprint_name.description")};n[0]!==void 0&&(ae.value=n[0]),r=new hn({props:ae}),se.push(()=>be(r,"value",ee));function ne(pe){n[35](pe)}s(ne,"vector2d_valueX_binding");function ve(pe){n[36](pe)}s(ve,"vector2d_valueY_binding");let X={label:w("dialog.blueprint_settings.texture_size.title"),tooltip:w("dialog.blueprint_settings.texture_size.description"),minX:2,maxX:4096,minY:2,maxY:4096,valueChecker:RV};n[1]!==void 0&&(X.valueX=n[1]),n[2]!==void 0&&(X.valueY=n[2]),l=new Bm({props:X}),se.push(()=>be(l,"valueX",ne)),se.push(()=>be(l,"valueY",ve));function j(pe){n[37](pe)}s(j,"checkbox0_checked_binding");let Q={label:w("dialog.blueprint_settings.show_bounding_box.title"),tooltip:w("dialog.blueprint_settings.show_bounding_box.description")};n[7]!==void 0&&(Q.checked=n[7]),m=new it({props:Q}),se.push(()=>be(m,"checked",j));function P(pe){n[38](pe)}s(P,"checkbox1_checked_binding");let oe={label:w("dialog.blueprint_settings.auto_bounding_box.title"),tooltip:w("dialog.blueprint_settings.auto_bounding_box.description")};n[8]!==void 0&&(oe.checked=n[8]),_=new it({props:oe}),se.push(()=>be(_,"checked",P));let Z=!n[27]&&L0(n);b=new Bu({props:{label:w("dialog.blueprint_settings.export_settings.title")}});function J(pe){n[41](pe)}s(J,"lineinput1_value_binding");let ie={label:w("dialog.blueprint_settings.export_namespace.title"),tooltip:w("dialog.blueprint_settings.export_namespace.description"),valueChecker:DV};n[3]!==void 0&&(ie.value=n[3]),y=new hn({props:ie}),se.push(()=>be(y,"value",J));function U(pe){n[42](pe)}s(U,"checkbox2_checked_binding");let q={label:w("dialog.blueprint_settings.enable_plugin_mode.title"),tooltip:w("dialog.blueprint_settings.enable_plugin_mode.description")};n[4]!==void 0&&(q.checked=n[4]),A=new it({props:q}),se.push(()=>be(A,"checked",U));let ge=[EV,kV],Te=[];function Re(pe,Le){return pe[28]?0:1}s(Re,"select_block_type"),L=Re(n,[-1,-1,-1]),O=Te[L]=ge[L](n);let le=n[26]&&z0(n);return{c(){e=V("div"),t=K(),i=V("div"),fe(r.$$.fragment),o=K(),fe(l.$$.fragment),d=K(),fe(m.$$.fragment),f=K(),fe(_.$$.fragment),g=K(),Z&&Z.c(),h=K(),fe(b.$$.fragment),x=K(),fe(y.$$.fragment),C=K(),fe(A.$$.fragment),S=K(),O.c(),E=K(),le&&le.c(),B=St(),$e(e,"--aj-dialog-id","'"+Nm+"'"),T(e,"class","svelte-1wavurd"),T(i,"class","svelte-1wavurd")},m(pe,Le){G(pe,e,Le),G(pe,t,Le),G(pe,i,Le),de(r,i,null),N(i,o),de(l,i,null),N(i,d),de(m,i,null),N(i,f),de(_,i,null),N(i,g),Z&&Z.m(i,null),N(i,h),de(b,i,null),N(i,x),de(y,i,null),N(i,C),de(A,i,null),N(i,S),Te[L].m(i,null),G(pe,E,Le),le&&le.m(pe,Le),G(pe,B,Le),H=!0},p(pe,Le){let ke={};!a&&Le[0]&1&&(a=!0,ke.value=pe[0],he(()=>a=!1)),r.$set(ke);let Ut={};!c&&Le[0]&2&&(c=!0,Ut.valueX=pe[1],he(()=>c=!1)),!u&&Le[0]&4&&(u=!0,Ut.valueY=pe[2],he(()=>u=!1)),l.$set(Ut);let In={};!p&&Le[0]&128&&(p=!0,In.checked=pe[7],he(()=>p=!1)),m.$set(In);let On={};!v&&Le[0]&256&&(v=!0,On.checked=pe[8],he(()=>v=!1)),_.$set(On),pe[27]?Z&&(bt(),Y(Z,1,1,()=>{Z=null}),vt()):Z?(Z.p(pe,Le),Le[0]&134217728&&W(Z,1)):(Z=L0(pe),Z.c(),W(Z,1),Z.m(i,h));let rt={};!k&&Le[0]&8&&(k=!0,rt.value=pe[3],he(()=>k=!1)),y.$set(rt);let It={};!I&&Le[0]&16&&(I=!0,It.checked=pe[4],he(()=>I=!1)),A.$set(It);let _n=L;L=Re(pe,Le),L===_n?Te[L].p(pe,Le):(bt(),Y(Te[_n],1,1,()=>{Te[_n]=null}),vt(),O=Te[L],O?O.p(pe,Le):(O=Te[L]=ge[L](pe),O.c()),W(O,1),O.m(i,null)),pe[26]?le?le.p(pe,Le):(le=z0(pe),le.c(),le.m(B.parentNode,B)):le&&(le.d(1),le=null)},i(pe){H||(W(r.$$.fragment,pe),W(l.$$.fragment,pe),W(m.$$.fragment,pe),W(_.$$.fragment,pe),W(Z),W(b.$$.fragment,pe),W(y.$$.fragment,pe),W(A.$$.fragment,pe),W(O),H=!0)},o(pe){Y(r.$$.fragment,pe),Y(l.$$.fragment,pe),Y(m.$$.fragment,pe),Y(_.$$.fragment,pe),Y(Z),Y(b.$$.fragment,pe),Y(y.$$.fragment,pe),Y(A.$$.fragment,pe),Y(O),H=!1},d(pe){pe&&z(e),pe&&z(t),pe&&z(i),ue(r),ue(l),ue(m),ue(_),Z&&Z.d(),ue(b),ue(y),ue(A),Te[L].d(),pe&&z(E),le&&le.d(pe),pe&&z(B)}}}s(BV,"create_fragment");[...document.fonts.keys()].some(n=>n.family==="MinecraftFull")||new FontFace("MinecraftFull",Uf,{}).load().then(n=>{document.fonts.add(n)});localStorage.setItem("animated_java_settings_support_me_popup","true");function DV(n){return n===""?{type:"error",message:w("dialog.blueprint_settings.export_namespace.error.empty")}:n.trim().match("[^a-zA-Z0-9_]")?{type:"error",message:w("dialog.blueprint_settings.export_namespace.error.invalid_characters")}:["global","animated_java"].includes(n)?{type:"error",message:w("dialog.blueprint_settings.export_namespace.error.reserved",n)}:{type:"success",message:""}}s(DV,"exportNamespaceChecker");function Dm(n){return n===""?{type:"error",message:w("dialog.blueprint_settings.display_item.error.no_item_selected")}:n.split(":").length!==2?{type:"error",message:w("dialog.blueprint_settings.display_item.error.invalid_item_id.no_namespace")}:n.includes(" ")?{type:"error",message:w("dialog.blueprint_settings.display_item.error.invalid_item_id.whitespace")}:Rn.item&&!Rn.item.has(n.replace("minecraft:",""))?{type:"warning",message:w("dialog.blueprint_settings.display_item.warning.item_does_not_exist")}:{type:"success",message:""}}s(Dm,"displayItemChecker");function RV(n){let e=Number(n.x),t=Number(n.y),i=Number(Texture.all.map(a=>a.height).reduce((a,o)=>Math.max(a,o),0)),r=Number(Texture.all.map(a=>a.width).reduce((a,o)=>Math.max(a,o),0));return e===r&&t===i?e!==t?{type:"warning",message:w("dialog.blueprint_settings.texture_size.warning.not_square")}:e!==2**Math.floor(Math.log2(e))||t!==2**Math.floor(Math.log2(t))?{type:"warning",message:w("dialog.blueprint_settings.texture_size.warning.not_a_power_of_2")}:{type:"success",message:""}:{type:"warning",message:w("dialog.blueprint_settings.texture_size.warning.does_not_match_largest_texture")}}s(RV,"textureSizeChecker");function G0(n){let e;try{e=Li(n)}catch(t){return console.error(t),{type:"error",message:w("dialog.blueprint_settings.data_pack.error.folder_does_not_exist")}}switch(console.log(e),!0){case n==="":return{type:"error",message:w("dialog.blueprint_settings.data_pack.error.no_folder_selected")};case!fs.existsSync(e):return{type:"error",message:w("dialog.blueprint_settings.data_pack.error.folder_does_not_exist")};case!fs.statSync(e).isDirectory():return{type:"error",message:w("dialog.blueprint_settings.data_pack.error.not_a_folder")};case!fs.existsSync(PathModule.join(e,"pack.mcmeta")):return{type:"error",message:w("dialog.blueprint_settings.data_pack.error.missing_pack_mcmeta")};case!fs.existsSync(PathModule.join(e,"data")):return{type:"error",message:w("dialog.blueprint_settings.data_pack.error.missing_data_folder")};default:return{type:"success",message:""}}}s(G0,"dataPackFolderChecker");function MV(n){let e;try{e=Li(n)}catch(t){return console.error(t),{type:"error",message:w("dialog.blueprint_settings.resource_pack.error.folder_does_not_exist")}}switch(console.log(e),!0){case n==="":return{type:"error",message:w("dialog.blueprint_settings.resource_pack.error.no_folder_selected")};case!fs.existsSync(e):return{type:"error",message:w("dialog.blueprint_settings.resource_pack.error.folder_does_not_exist")};case!fs.statSync(e).isDirectory():return{type:"error",message:w("dialog.blueprint_settings.resource_pack.error.not_a_folder")};case!fs.existsSync(PathModule.join(e,"pack.mcmeta")):return{type:"error",message:w("dialog.blueprint_settings.resource_pack.error.missing_pack_mcmeta")};case!fs.existsSync(PathModule.join(e,"assets")):return{type:"error",message:w("dialog.blueprint_settings.resource_pack.error.missing_assets_folder")};default:return{type:"success",message:""}}}s(MV,"resourcePackFolderChecker");function FV(n){let e;try{e=Li(n)}catch(t){return console.error(t),{type:"error",message:w("dialog.blueprint_settings.advanced_resource_pack_file.error.file_does_not_exist")}}switch(console.log(e),!0){case n==="":return{type:"error",message:w("dialog.blueprint_settings.advanced_resource_pack_file.error.no_file_selected")};case!fs.existsSync(e):return{type:"error",message:w("dialog.blueprint_settings.advanced_resource_pack_file.error.file_does_not_exist")};case!fs.statSync(e).isFile():return{type:"error",message:w("dialog.blueprint_settings.advanced_resource_pack_file.error.not_a_file")};default:return{type:"success",message:""}}}s(FV,"advancedResourcePackFileChecker");function LV(n){let e;try{e=Li(n)}catch(t){return console.error(t),{type:"error",message:w("dialog.blueprint_settings.json_file.error.file_does_not_exist")}}switch(console.log(e),!0){case n==="":return{type:"error",message:w("dialog.blueprint_settings.json_file.error.no_file_selected")};case(fs.existsSync(e)&&!fs.statSync(e).isFile()):return{type:"error",message:w("dialog.blueprint_settings.json_file.error.not_a_file")};default:return{type:"success",message:""}}}s(LV,"jsonFileChecker");function U0(n){let e;try{e=Li(n)}catch(t){return console.error(t),{type:"error",message:w("dialog.blueprint_settings.advanced_resource_pack_folder.error.folder_does_not_exist")}}switch(console.log(e),!0){case n==="":return{type:"error",message:w("dialog.blueprint_settings.advanced_resource_pack_folder.error.no_folder_selected")};case!fs.existsSync(e):return{type:"error",message:w("dialog.blueprint_settings.advanced_resource_pack_folder.error.folder_does_not_exist")};case!fs.statSync(e).isDirectory():return{type:"error",message:w("dialog.blueprint_settings.advanced_resource_pack_folder.error.not_a_folder")};default:return{type:"success",message:""}}}s(U0,"advancedResourcePackFolderChecker");function J0(n){let e;try{e=Li(n)}catch(t){return console.error(t),{type:"error",message:w("dialog.blueprint_settings.data_pack_zip.error.file_does_not_exist")}}switch(console.log(e),!0){case n==="":return{type:"error",message:w("dialog.blueprint_settings.resource_pack_zip.error.no_file_selected")};case(fs.existsSync(e)&&!fs.statSync(e).isFile()):return{type:"error",message:w("dialog.blueprint_settings.resource_pack_zip.error.not_a_file")};default:return{type:"success",message:""}}}s(J0,"zipChecker");function PV(n){n.target.textContent="sentiment_sad"}s(PV,"hoverCloseButton");function VV(n){n.target.textContent="close"}s(VV,"leaveCloseButton");function zV(n,e,t){let i,r=re,a=s(()=>(r(),r=ze(B,ye=>t(27,i=ye)),B),"$$subscribe_autoBoundingBox"),o,l=re,c=s(()=>(l(),l=ze(S,ye=>t(28,o=ye)),S),"$$subscribe_enablePluginMode"),u,d=re,m=s(()=>(d(),d=ze(L,ye=>t(29,u=ye)),L),"$$subscribe_resourcePackExportMode"),p,f=re,_=s(()=>(f(),f=ze(ve,ye=>t(30,p=ye)),ve),"$$subscribe_enableAdvancedResourcePackSettings"),v,g=re,h=s(()=>(g(),g=ze(O,ye=>t(31,v=ye)),O),"$$subscribe_dataPackExportMode"),b,x=re,y=s(()=>(x(),x=ze(oe,ye=>t(32,b=ye)),oe),"$$subscribe_enableAdvancedDataPackSettings");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l()),n.$$.on_destroy.push(()=>d()),n.$$.on_destroy.push(()=>f()),n.$$.on_destroy.push(()=>g()),n.$$.on_destroy.push(()=>x());let{blueprintName:k}=e,{textureSizeX:C}=e,{textureSizeY:A}=e,{exportNamespace:I}=e,{enablePluginMode:S}=e;c();let{resourcePackExportMode:L}=e;m();let{dataPackExportMode:O}=e;h();let{showBoundingBox:E}=e,{autoBoundingBox:B}=e;a();let{boundingBoxX:H}=e,{boundingBoxY:ee}=e,{displayItem:ae}=e,{customModelDataOffset:ne}=e,{enableAdvancedResourcePackSettings:ve}=e;_();let{resourcePack:X}=e,{displayItemPath:j}=e,{modelFolder:Q}=e,{textureFolder:P}=e,{enableAdvancedDataPackSettings:oe}=e;y();let{dataPack:Z}=e,{summonCommands:J}=e,{interpolationDuration:ie}=e,{teleportationDuration:U}=e,{useStorageForAnimation:q}=e,{bakedAnimations:ge}=e,{jsonFile:Te}=e,Re=localStorage.getItem("animated_java_settings_support_me_popup")==="true";function le(){localStorage.setItem("animated_java_settings_support_me_popup","false"),t(26,Re=!1)}s(le,"clickSupportMeXButton");function pe(ye){k=ye,t(0,k)}s(pe,"lineinput0_value_binding");function Le(ye){C=ye,t(1,C)}s(Le,"vector2d_valueX_binding");function ke(ye){A=ye,t(2,A)}s(ke,"vector2d_valueY_binding");function Ut(ye){E=ye,t(7,E)}s(Ut,"checkbox0_checked_binding");function In(ye){B=ye,a(t(8,B))}s(In,"checkbox1_checked_binding");function On(ye){H=ye,t(9,H)}s(On,"vector2d_valueX_binding_1");function rt(ye){ee=ye,t(10,ee)}s(rt,"vector2d_valueY_binding_1");function It(ye){I=ye,t(3,I)}s(It,"lineinput1_value_binding");function _n(ye){S=ye,c(t(4,S))}s(_n,"checkbox2_checked_binding");function Si(ye){ae=ye,t(11,ae)}s(Si,"lineinput_value_binding");function Ki(ye){ne=ye,t(12,ne)}s(Ki,"numberslider_value_binding");function fr(ye){ge=ye,t(23,ge)}s(fr,"checkbox_checked_binding");function mr(ye){Te=ye,t(24,Te)}s(mr,"fileselect_value_binding");function pr(ye){L=ye,m(t(5,L))}s(pr,"select0_value_binding");function ii(ye){O=ye,h(t(6,O))}s(ii,"select1_value_binding");function fn(ye){ve=ye,_(t(13,ve))}s(fn,"checkbox_checked_binding_1");function Dt(ye){ae=ye,t(11,ae)}s(Dt,"lineinput_value_binding_1");function bn(ye){ne=ye,t(12,ne)}s(bn,"numberslider_value_binding_1");function Ft(ye){j=ye,t(15,j)}s(Ft,"fileselect_value_binding_1");function Et(ye){Q=ye,t(16,Q)}s(Et,"folderselect0_value_binding");function Lt(ye){P=ye,t(17,P)}s(Lt,"folderselect1_value_binding");function Ot(ye){ae=ye,t(11,ae)}s(Ot,"lineinput_value_binding_2");function Gt(ye){ne=ye,t(12,ne)}s(Gt,"numberslider_value_binding_2");function on(ye){X=ye,t(14,X)}s(on,"folderselect_value_binding");function gn(ye){X=ye,t(14,X)}s(gn,"fileselect_value_binding_2");function qi(ye){Z=ye,t(18,Z)}s(qi,"folderselect_value_binding_1");function Zn(ye){Z=ye,t(18,Z)}s(Zn,"folderselect_value_binding_2");function ri(ye){Z=ye,t(18,Z)}s(ri,"fileselect_value_binding_3");function Pn(ye){J=ye,t(19,J)}s(Pn,"codeinput_value_binding");function oo(ye){ie=ye,t(20,ie)}s(oo,"numberslider0_value_binding");function ya(ye){U=ye,t(21,U)}s(ya,"numberslider1_value_binding");function Jt(ye){q=ye,t(22,q)}return s(Jt,"checkbox_checked_binding_2"),n.$$set=ye=>{"blueprintName"in ye&&t(0,k=ye.blueprintName),"textureSizeX"in ye&&t(1,C=ye.textureSizeX),"textureSizeY"in ye&&t(2,A=ye.textureSizeY),"exportNamespace"in ye&&t(3,I=ye.exportNamespace),"enablePluginMode"in ye&&c(t(4,S=ye.enablePluginMode)),"resourcePackExportMode"in ye&&m(t(5,L=ye.resourcePackExportMode)),"dataPackExportMode"in ye&&h(t(6,O=ye.dataPackExportMode)),"showBoundingBox"in ye&&t(7,E=ye.showBoundingBox),"autoBoundingBox"in ye&&a(t(8,B=ye.autoBoundingBox)),"boundingBoxX"in ye&&t(9,H=ye.boundingBoxX),"boundingBoxY"in ye&&t(10,ee=ye.boundingBoxY),"displayItem"in ye&&t(11,ae=ye.displayItem),"customModelDataOffset"in ye&&t(12,ne=ye.customModelDataOffset),"enableAdvancedResourcePackSettings"in ye&&_(t(13,ve=ye.enableAdvancedResourcePackSettings)),"resourcePack"in ye&&t(14,X=ye.resourcePack),"displayItemPath"in ye&&t(15,j=ye.displayItemPath),"modelFolder"in ye&&t(16,Q=ye.modelFolder),"textureFolder"in ye&&t(17,P=ye.textureFolder),"enableAdvancedDataPackSettings"in ye&&y(t(25,oe=ye.enableAdvancedDataPackSettings)),"dataPack"in ye&&t(18,Z=ye.dataPack),"summonCommands"in ye&&t(19,J=ye.summonCommands),"interpolationDuration"in ye&&t(20,ie=ye.interpolationDuration),"teleportationDuration"in ye&&t(21,U=ye.teleportationDuration),"useStorageForAnimation"in ye&&t(22,q=ye.useStorageForAnimation),"bakedAnimations"in ye&&t(23,ge=ye.bakedAnimations),"jsonFile"in ye&&t(24,Te=ye.jsonFile)},[k,C,A,I,S,L,O,E,B,H,ee,ae,ne,ve,X,j,Q,P,Z,J,ie,U,q,ge,Te,oe,Re,i,o,u,p,v,b,le,pe,Le,ke,Ut,In,On,rt,It,_n,Si,Ki,fr,mr,pr,ii,fn,Dt,bn,Ft,Et,Lt,Ot,Gt,on,gn,qi,Zn,ri,Pn,oo,ya,Jt]}s(zV,"instance");var Ru=class extends je{constructor(e){super(),Ie(this,e,zV,BV,Ae,{blueprintName:0,textureSizeX:1,textureSizeY:2,exportNamespace:3,enablePluginMode:4,resourcePackExportMode:5,dataPackExportMode:6,showBoundingBox:7,autoBoundingBox:8,boundingBoxX:9,boundingBoxY:10,displayItem:11,customModelDataOffset:12,enableAdvancedResourcePackSettings:13,resourcePack:14,displayItemPath:15,modelFolder:16,textureFolder:17,enableAdvancedDataPackSettings:25,dataPack:18,summonCommands:19,interpolationDuration:20,teleportationDuration:21,useStorageForAnimation:22,bakedAnimations:23,jsonFile:24},null,[-1,-1,-1])}};s(Ru,"BlueprintSettingsDialog");var H0=Ru;(()=>{let n=Blockbench.addCSS(`i.svelte-1wavurd.svelte-1wavurd{cursor:pointer;height:fit-content;transition:transform 0.2s ease 0s,\r - color 0.2s ease 0s;text-shadow:1.5px 1.5px 0px rgba(0, 0, 0, 0.25)}i.svelte-1wavurd.svelte-1wavurd:hover{transform:scale(1.25)}.ko-fi-popup-container.svelte-1wavurd.svelte-1wavurd{position:absolute;top:30px;right:-287px;font-family:'MinecraftFull';font-size:20px;display:flex;align-items:center;justify-content:center;flex-direction:column;color:white;overflow:hidden}.ko-fi-popup.svelte-1wavurd.svelte-1wavurd{position:relative;display:flex;align-items:center;justify-content:center;flex-direction:column;padding:8px;padding-right:0px;background-color:#00aced;border-radius:0 8px 8px 0;box-shadow:4px 4px 8px rgba(0, 0, 0, 0.2);animation:svelte-1wavurd-slideIn 0.75s}.heart.svelte-1wavurd.svelte-1wavurd{width:28px;height:28px;animation:svelte-1wavurd-beat 2s ease infinite}@keyframes svelte-1wavurd-beat{0%{transform:scale(1)}10%{transform:scale(1.2)}20%{transform:scale(1)}}.ko-fi-popup.svelte-1wavurd span.svelte-1wavurd{text-shadow:2.4px 2.4px 0px rgba(0, 0, 0, 0.25)}.ko-fi-button.svelte-1wavurd img.svelte-1wavurd{width:100%;image-rendering:auto;border-radius:12px}.ko-fi-button.svelte-1wavurd.svelte-1wavurd{width:250px;margin-right:8px;margin-top:12px;transition:transform 0.2s ease}.ko-fi-button.svelte-1wavurd.svelte-1wavurd:hover{transform:scale(1.05);transition:transform 0.2s ease}.ko-fi-popup.svelte-1wavurd .title.svelte-1wavurd{display:flex;justify-content:center;gap:0.75rem}.shadow.svelte-1wavurd.svelte-1wavurd{position:absolute;top:0;left:0;height:100%;background:linear-gradient(90deg, #00000066, #00000000);width:0px}@keyframes svelte-1wavurd-slideIn{0%{right:287px}100%{right:0}}@keyframes svelte-1wavurd-slideInPanel{0%{right:0}100%{right:-287px}}dialog#animated_java\\:blueprintSettingsDialog .dialog_wrapper .dialog_content{overflow-y:auto !important}div.svelte-1wavurd.svelte-1wavurd{padding-right:8px;max-height:50rem}.warning.svelte-1wavurd.svelte-1wavurd{color:var(--color-warning);font-family:var(--font-code);font-size:0.8em;margin-bottom:8px}`);function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();function UV(){return{blueprintName:new me(Project.name,n=>n||"My Blueprint"),textureSizeX:new me(Project.texture_width),textureSizeY:new me(Project.texture_height),showBoundingBox:new me(Project.animated_java.show_bounding_box),autoBoundingBox:new me(Project.animated_java.auto_bounding_box),boundingBoxX:new me(Project.animated_java.bounding_box[0]),boundingBoxY:new me(Project.animated_java.bounding_box[1]),enablePluginMode:new me(Project.animated_java.enable_plugin_mode),exportNamespace:new me(Project.animated_java.export_namespace,n=>n?Rt(n):Ms.export_namespace),resourcePackExportMode:new me(Project.animated_java.resource_pack_export_mode),dataPackExportMode:new me(Project.animated_java.data_pack_export_mode),displayItem:new me(Project.animated_java.display_item,n=>n||Ms.display_item),customModelDataOffset:new me(Project.animated_java.custom_model_data_offset),enableAdvancedResourcePackSettings:new me(Project.animated_java.enable_advanced_resource_pack_settings),resourcePack:new me(Project.animated_java.resource_pack),displayItemPath:new me(Project.animated_java.display_item_path),modelFolder:new me(Project.animated_java.model_folder),textureFolder:new me(Project.animated_java.texture_folder),enableAdvancedDataPackSettings:new me(Project.animated_java.enable_advanced_data_pack_settings),dataPack:new me(Project.animated_java.data_pack),summonCommands:new me(Project.animated_java.summon_commands),interpolationDuration:new me(Project.animated_java.interpolation_duration),teleportationDuration:new me(Project.animated_java.teleportation_duration),useStorageForAnimation:new me(Project.animated_java.use_storage_for_animation),bakedAnimations:new me(Project.animated_java.baked_animations),jsonFile:new me(Project.animated_java.json_file)}}s(UV,"getSettings");function GV(n){Project&&(Project.name=n.blueprintName.get(),setProjectResolution(n.textureSizeX.get(),n.textureSizeY.get(),!0),Project.animated_java.show_bounding_box=n.showBoundingBox.get(),Project.animated_java.auto_bounding_box=n.autoBoundingBox.get(),Project.animated_java.bounding_box=[n.boundingBoxX.get(),n.boundingBoxY.get()],Project.animated_java.enable_plugin_mode=n.enablePluginMode.get(),Project.pluginMode.set(n.enablePluginMode.get()),Project.animated_java.export_namespace=n.exportNamespace.get(),Project.animated_java.resource_pack_export_mode=n.resourcePackExportMode.get(),Project.animated_java.data_pack_export_mode=n.dataPackExportMode.get(),Project.animated_java.display_item=n.displayItem.get(),Project.animated_java.custom_model_data_offset=n.customModelDataOffset.get(),Project.animated_java.enable_advanced_resource_pack_settings=n.enableAdvancedResourcePackSettings.get(),Project.animated_java.resource_pack=n.resourcePack.get(),Project.animated_java.display_item_path=n.displayItemPath.get(),Project.animated_java.model_folder=n.modelFolder.get(),Project.animated_java.texture_folder=n.textureFolder.get(),Project.animated_java.enable_advanced_data_pack_settings=n.enableAdvancedDataPackSettings.get(),Project.animated_java.data_pack=n.dataPack.get(),Project.animated_java.summon_commands=n.summonCommands.get(),Project.animated_java.interpolation_duration=n.interpolationDuration.get(),Project.animated_java.teleportation_duration=n.teleportationDuration.get(),Project.animated_java.use_storage_for_animation=n.useStorageForAnimation.get(),Project.animated_java.baked_animations=n.bakedAnimations.get(),Project.animated_java.json_file=n.jsonFile.get(),console.log("Successfully saved project settings",Project))}s(GV,"setSettings");function Xo(){if(!Project)return;let n=UV();return new Pt({id:`${_e.name}:blueprintSettingsDialog`,title:w("dialog.blueprint_settings.title"),width:512,component:H0,props:n,preventKeybinds:!0,onConfirm(){GV(n),Mc()}}).show()}s(Xo,"openBlueprintSettingsDialog");var Yo="data:image/webp;base64,UklGRlIHAQBXRUJQVlA4WAoAAAASAAAAfwAAfwAAQU5JTQYAAAD/////AABBTk1GngcAABEAAAQAADUAAFgAABQAAAJBTFBIAQIAAAHXoKiRJDW3vSTl8MUREYIHnjMwluM4UeI7EYAl227bhmZxGIci0giW/e9UFvgIpvxG9J+BI0lKGpnM4TAnfMH80Cke5xS908XxOKdemV408XVcp/zzif1Kj5pkQav/+2CnCQmQbrh2xeSXkvbQgm6Q/9JIFntJjtXl3cfjSG/EJaoGudfzg5zlLYeVDHsfErWBTfyCnS8eB3GtQMlCZlzmWvtYnaoHX7s6jnVgN0+uDgR8YR3y3Guh6+EqbstkUYtJaGPLudJQY+b1UPViFd/iR555PWDfPvsasCdfAcTOGvU9QuH8atiRsYsfB6renxWD5Hwj9M8O4VjMN/QZ66cUE9hDe7JARlvcaCAoC4CeHVa/swToyWB7vpIQE9Rj1DsjR4aJh47ke0VIcrrBPb0ElOIWQLJAsVA1KxZrFnoU7iVjPoHNQs/v4wrkOcBdE388S4uQJ7y/oNuDx+glSl4OiUvU0HY+pBytwbwzablbRn3W6pZNnqSYMPq3XRmxFot1gp0pWmRkJ79qX5ESbKRN8quer/qbWxhSy9GOZTpgWCddhjptaIyXY5FS/DTdPobKyNflNnmeMH1XK4WVKTksN2uTPf88lXUxosts17RHbdmjse/W7z3KYY9m8+9raFvU5D3qeI/ab1lVK6egutPjacf2MNpTHoMpGnVcSjq7GQBWUDggfAUAABAaAJ0BKjYAWQA+MRSIQqIhIRgKBqggAwSygGN4vGy/Jz9B8oHy5WRtFOCE6Hbj8696LN4r9ADpdv9HWyfCPxHeuPbXlWs1/0P5YevnffLFsg8S/cc+jHhK0AP0B6qn9t5NvzH/QewP/J/7Pvo/7YrQiIUMLY/te+mXcn0kvyckNXt8ESRHOPGdfKYe3Lj/VoX5PUNmddsqyT31jCVCss1m/mnrUdX2UBMsSyIIQhTM5jiW3+z9b4uUrMeZV5pPIgOzNzubr4Pf+qKPnrU3ilHammJ5VBBeJwAA/vVAP/Z3eP3fh+HD/PTLqVt7dqhoDFPndzpU816yX21DU/6j/gtphtci73eW6Eaa+eQUY8HGal2yhdlh6kwA/Q3aezICxzf2U4Dsmh/7YvZLP4DdOESKLh1qltVSn4Ptgm+r0VnfatMhKey3vF5PiKk7/gaWF+Roz7hHj+t+4r2eSHsAgx1t1wAPf0xG1GjpcOu/13bFG/p3W5AdqBqjOg1z1xbshcP4XY6OMfApKKdys0Z+12Dp6XqBnmmnChoxcUxnsGL5xUEa9bZPWLvEUPfqxyk6cR5pwZoddXJdnjzgQJ1eXqwQ/MXjW6g/TSnOGI1f1EV2KYjOzDg2X/ARv/URGAgAEc41FspR0Vgj6Y5wLFFjCtWY8l97L41on2TKxZVUO9JXtijJ2B3jNSA1XdOKfpd6n1zDS/MV4S/ZwGgieEVZmw7VUEdiZvfvm0IUhZrvyekE7S3CquSNKYTCO6mLI0hHHiXCy68IVZdl9EK06cF2aPzop3iDe7W6wrwtIad7zhyvqu3VmddzLqPc6xcMx6I3982Y5yIN5toRP69Mv7XEHeSxp0h0jZFnaBFC3mPS35RWZoSynRtUWxgWiy/F676Hwzan26Iwzy9JR/YSN6gX1uenziCX85sKxHlGiQALoiWYfBbX5ARgzwRDT3vvLtqqRIa2mSqcVbG5/EnTfJeKGC2zWArQWZGrcx4jSiv1BkuxLrx55ezwMxnaioyZxLNtFVy1c4Xyf5Ri3xA86f5ELClqDf76n/xw7YejPHv3O2e73+xu/6ko3bCSxvcrVT347rXcFu15AbkQHP4zGCKy0ktUvjlw/eOkMr1AdpNHSdH/opuTKHz9dP9D2ovUvh33hkNUPv1615i3YcJTHT55wuHfRX2poFykM+NByUX87VnP+GZrin1cKphOVo8rYqVmAyB9m2L4qoFziCnKKmtyRe5qjZLtdCkdQ+Xdwsw8GKs79byQsWN+UzyhonzvfVSIP+hzkQ5S31hcbj9C6hYcoOmicPUCrRR6dXXZ5P6Izxk3bVhck1o/NWyciG8hW5UTGgW6BVB1qt2ay9W721CMlK7/sRIMxd7/U4uddFXujMUO+wqnscWBtjV2FuuIWS855m3/Hg6Ke86WMBY2Vn9FQ9bUkG6U/Rki/7s6GLk8FvnxihxBLOtemYlvDROQcd6VYdNc3KzD3Pj7Y36PFFpoLF+D/yG3ush05syzSiVRuRB+bWGSfF4DUy/xNyF7R7APLREQ9lezGgP/7dHd9MSRoQnXVu5RS06lgC9UHfhHfJsgQAVqVhcex2lP2q7WDimV5l7+LmXyeUJz6BWl9qc/8D7Hkedf4YXajARpBGpquMX8zOPidZmH23v4bIL3aGMNFmgq8jn19Gr8nD3gHXcG/89sn8Adl8Yb1ONeLzL2s3J99eKCiEygKJpTAGdCAAXTh3Tz6NTUiKNYwc6u2wigMOPKsJ7gdROMxJWP4D6+0r/+JkTh9pruYcQyBeyNlMsy2qBRH3BQoShnAXAQcoHhS8HMVAOwl2IMgtWWzZgEqc/m1AhTE/+Jj/0ugHTeGUgCAo1uvEPHDJ1zAAAAAEFOTUZcCAAADwAABAAAOQAAXAAAFAAAA0FMUEhPAgAAAaCjbW/bQPobNGTBfu6Dwj7QJBVmoZkN95nETQeKKMgGG1BYgiBqQxsRE4B/dsqb6Qpv+6asD56u2r6k2VZHz5MlcTSaLHdHxf+aMvaUZ1tsv+fZ6n+2RrOtjorJk1wn9383vaecy8tSFk6z2U/S+/h7DFOp5TTK+a4Ov3BYypkfj0frXS26RtDbx2OV3tVODmG1OSOo2WVYL0PNLlPGdapdpsh1ql2myHWqnT2+1agkp625R7GeVsOo2dnKYawO/alrRM9R1MzZcn4XISmK1aEMrBErgqiZsxGSRNQoVocykHvEErWas1HQKEFFHMoAWAN6DqrmbASgWmAjUAso4lkQVQHUgGpOKQCoRSwxRTwVAHIPGCVmMaeUsJ5DqHkqnssIaBTC6pCysVhgRQQ1c1Zs1llYHVJOaCmAmjkrNqlF2Ac6xuqQspV7SM/HVnNWPBO/05BGAI+twQCKOKRsPNRiKwBwUzNtDADVnBXPSSx4eQLdpTEBQBGHlI3cg6RsAImwWc1ZcYLKyjiafnZI2WI9NGTlhMDb2KvYXuzoeJEQfJMtKTvpgx6wBeHl40bFPt3FpxyH9KHVuiQHUH5ySToBRDjKw7Vi5tTMqzxVNbekmXj4VkycmrmVJ6IP5pc00V0PrJi3iPmV56EPdlDSPHc9smLaInZQeRr6YEclTXPXQytm5WFHlWehD3a40SyoxxZMm9qRUeYBq5kNR6OJ6ENvy4uxt2BmygTWnVGmel5tt9FsSfYWXGaU6XAbW43mw208CeOKt6FtKbgmM+F0AFZQOCDsBQAAsBkAnQEqOgBdAD4xFIhCoiEhGVreACADBLGAXZnJobvjvNAsvbgEVwr9upzs3o13iX0AOl4rtH694K+OkFfpA1Duy/9L5Td6vvgyib2T4j/VelulfzKf8j6rP9T/0/ux9zf0v7Bn6s759+0ax+NDEelV5XIu1mDfm+3hldWjtLtoup8Nv8wCk+i84E6TBZtEUTLop2Nllpuz50gcKeOYQLeJyhkqgNshkv85kaN6HE5jkakp6kJ3j7CQaS/jpL64ePTE0mrEwBCw2o0QjewgQ8yVwAGAAAD+9UA//2rb/Tgf6cD8qf/88x+w/NDoTJiuVErfh/f8djKyhTSRv0ELGTnmZLtRHfop4jeYBSN78Dz/6XrhaMm0o5yJTI6VhL1ceJawRp8Ozq2tFgK+8eQgXI3xsW+yDTM+Al1Yw37LyBLoxrPe2OsMwYY+IZhhtiI2Z2q3QHxYWaT40+n28GmV74USRaV7fgoSex2PGgMZaZetL/OQtGAOr+0GabgJHFdNXqNtek8L1HPMOBxnz8WP4ECoCJ9iNuqjocZiuYZkEyCa2AMATBmX+e0zgRdDkcpLmK+Hcf2isr6RlaUQOJRvFdC5yMlTsUszWxTtoF626EbBCP4Dg8MsebPewZm/bQ8nprpAOTDWbiLLfSE3qJNqk8ftE+cR7fR8/Tbk1Ape7Ow7Zk0/ysLgzTz6eROR1NOvKk8mj5z+OT4lQ1HLELXcV4ks8elwAFwJBA0LT2PQADKxou3Ti0ewCaFrZy9tmsahb8Eeoe9ZVzZCJzoPIFr7IE2dfNyNeehEan9pPLWV5r8DN1XBb0wsybVuwgM2kGXybWNTVq8I97trxARIWXV/8dvz0AgPGiBD25t+hM56+Y4bOaER7SgTNcf+W1NyBd3+v1XRcO2cdw1PbKJ0qT+aUhJKNYSViDX/A9QsoT9jo/K4pdfQrjeO+T3BwN+xyj5Pe//28Y9qK1gmCvQPQGB3nAa11dC3V8gs3K1/w2u5r+5Zn7h0x1s3sSQRQ2ZQnNU+53zNsZMF70ehagV6AG5221Oz0YWkoAxxToHGIDGnOJQ+1yxcbGvBvdyEqrysh/EMnNFyBSQFZMEchAvTCSAJ3AHqrnxoGvddh3Kd9LZEpJFc287woNpNT09mtRztTSq7k83dN3aB4sAVyITomBd02TRTpjeDZSdpHIcWsb4/dpeNXKmOwtgYobe1CqV4p1Ql8qvP7EqBtF5rx1xqjV+7pjQemT9L1gOUl2k0WCPRNTZMXI7f46esz1ZsLI4TkyqTz+YqkbO/yn2xgkiakqjyxJlVWCFGbptG6hfoQUuAWoj7d2ub61WIHCZG1urTnYDMRcaSAQZvceSdyg8IM7UrB4ZrHRulXJA35BvPbB2UUR5OEbH5u3srXklyQa5aSQvdliBP0t+WAl68m8Ku4wPh0L3e9pZWXXj4T0Hz/xntmt6wWSTqGYBwfFf7hQ2nMnO6IKeyfDxjpZ+5otN274dCSt3lTeCxnXAMaA8/kS8Fihx2crwo+s937IkfAZhUg81NG1bjKwakPxL6+TV/+sXhV+qA3996TRAh7v6ojqqhZ8T3Mu6G7YcFrERbYG3jONhtVJvR/QLDipbv86sbSI2NRh15sNjeg+rK0TQSdEwqrwUvCeq4BX7oC7JW3WJDH4qcnT5pljSuoA7DkgfnmFBmc53C22HFwikV7kpf0nQvU9U36wX8nzxekdVpaTalYn8ZvLYy829bYbXLGF8kS+7unC68vzeJ3RAXhAg7uS7P0gOTZG8z+5NYiaJ0ssFHoKS2CjYeQCKzURs9npWXTvxHEqUitnBSXDbx9r30hjwpYEjcAhq0L+HljQb5a1baGUAwmEc3XHK72HvLH9s5khmLUbbO1GEXCPahlgLHM5DuhrqTzywxmqTwbVnsNIbgbnsul8X7zNmssctxmEwcP+IDv/+9n/zse+1/6BEUIiqLzoh+rw9Fc3Z/GnRERPYfwJqH6iTeXfedykzlyOwBdWxBQn71RzL6wsgAAAAAAEFOTUawCAAADgAABQAAPwAAXgAAFAAAAkFMUEhvAgAAAZAjAGwaSW7c2IX36D+oY3iQi6jIPulIzeFrrnJhHwwszgisgzYiHMq2EjfX0qQtSxZA008Ic0bKuVTIKXiN9L33cb7pbV3u+pD7+fFAH2DDUH1ARkbxpuf/MysDRZ+0bd5pl/v/gw34UIa3r/ofKZtxJ2dYllpyzsmF89H75tBTb0uc1bHh4zk/ZvWwmA+u0NquT1Q9qqHPLgt1g78JRVCO69yL+OZ8Fqt+lphGS8otnU+jZ+3WmaTbTk08PJ85qiGEoys8dwaGnY+IH5nEcwmB7LVpySNEZelZDjEpVyqHxYaof9xoc7UMJvEMIVqJ+aRroMjPQ1W/3Tw7mO90qcKD+i1F9V1EITtQ3W42IOSw4YBWdYg3UU3PAi0pU7aVw+WOtlVpXT3byPWUmr5VlsGgtEkh6C2lIxpFFwKCgSoeUWW2oo3oiz1Pnav4RrQxWB4dkggINhYoiqyKEJRMoLwSakncboDrYUpUrhJJNhbLj0xK8KBgY+O8JTnxpBAY+EIwGEbi26jOBtahnaoVrmCobFKzLhWQe4ONwcZiCO3gaBsmNudbsU8gg7swQJ1qEWYLtE6fgxCElV2UJktKJjantRjWmU9b74R3+aW6gmfm1WmUDgSHZpE1ebw+VPZ74ktv5UWqt5xXbxnF6UnD64nl6VB1TGc5Rx8Z3zhNH3l2ymm6yNPcOE0XCbnP1wReQhnzNZGXUB00YcNKQAfNSKyElc36qZtBcNT8PbI+viGmQebukvUxss3f8986UdObnn2I5Pdvl0bTC29N2PzlmmH11kyN0/TCWzM8HYym76st0Y0A9LthCZ4j3bWvNgIAVlA4ICAGAAAwHACdASpAAF8APi0Sh0KhoQ2tptoMAWJYwCzs18KP6z5qlmdwDtO6c89UbDbfc6n6Yd5T9ADpe8Aa65u9vxf+0JCxiP7c/s/LTvV4AX4z+nd9SylxPfW3XVqAH5p/Uz3Wf7fybfmP+Y9gX+Xf2DrMeiB+ziLYUr1+WePJRy9od+VwfQNCga7XeefD286YCIpdw4bxvNl+xu/Do472PLLY3aq6cEkUviO7hfzF+X58thGO8NAvoBS2nikCl+WjnfgXxJXAiW2Bd4eHwyLcrB7ckHe3FyWHsNWQ905+MtjQMOFCCDxCBl0NxAAA/vPCZ/7Vo/pvf9N7+gj/+eXfRHVPuah3Tla/XxtFY7KD8Lmc8G2JnXnzWLqqs/aDZkxZqdDzQyWXl3POmQyaQEEp9vwO6WODfSE51wIWLpWd1Lh9lz8i03gx/OhF2dKtpGsagUCwvN9/t/HVeiDN+kcu/6gO/NOogkisrh5hV61PI/2j6CKwkJrCKEnTyHn1SRDMWGz1SMuEAcPVjZt0GXIg++j3IC0JOtZYrRrsWLFf5XP+B7UR6wHOvsedzZ6NZhiHv6T79Z2jQEl4aY23NELv2afomzs/lIrBP1il8uV6BpD/3yPpL0315OhoRX8SNlhWGFA8Ehm87UNqhSb87xFQhvfzq1ZjTyM6U20DDnTmjrQ85NS8CUoTvfQVApOjMf/RdxnBZJR5+Cyt52ze4UEM5+jqqVFbvxerNTxSm8ocXaoLEb2qRs1ZbuMvVDleZn1GRxjXG2O8xB9f+d8Uh6GwA4jufizz3bFs6w4hqW8ndWi3cD/olR/yOWbDpoBl7l8xLMD1KhDXi70w5z52AzRJx018aRVEVcdWAzpxt9AJCjYMaRiqvXp6glm3rQdKX8Nz/3/FAEeT6B0xPnD0mpDFLUSqMLZHirFd3ZJoFE7Rh7urE4SFaVpNqQs0aSU+OBSuaS1JTUvvAqHtTjZGv4lQf8aiiHSMFIVmYDn5aG8/mAnF+ZTVtEP/Ng0plAGO8zFJsM9n6V6Mv78Zi3SkanX4PiHeAljWh5X5V777/u8griEtQ3UiwPweZMV7mVm9jX3oQjQTGk6Lmp5JevDeM/QuMi8zLIN338wkIFRnmtvBvFJUPV6OYO9Z4yQVZ57usm3WiNXGVQed6RDvvnJoNQd1hgqJRMneYMk4bfZM7Lc+RKpsl5MLZtqbRBusbyhM4Hqw2bJKOuzFq05tfwW0PTJtMMSfAHz+yItpn+nWTgyRrMv52D/+PycgruBlhjeoR8mkR/BX0aE4ofH5YjNgswVHPWdNI5YP1a2xWnmjVHdXqbcgImLE86H6JIAZnTNVD3vnT182wvifSOcFHH4QtSkBm7jbPrXGYCxG1sH3DC4bgcqxqBIcHcmApd6KtucaveSiim8NvZJiPCNnuksZ8zTKdLHXfnHkQNSGGTHLN4SFZ3oejrGHNZqsEWJJuoGSRu/7fmuDiZwXUAqAnNMrlnOCHm76b4PjNzv+DCHYINPzH1t74TbQfPPddTy1mfm+Od5j+YeqsR94px9hKmO1y/SlFfBuWSGITAgyuAkxjjnHu///21pxoib+Ab67/EigZR9p5wjoSOHbsL8Z3GpWHzsU51VEyzK3hvBJNRrJCPgIT2O/znSp28//tFSkZ5XSM6HyO24I7CZt/a0CH+FIXHWyP+Pbl7fwuZkK8ogxFYewJO3KIprFdYvTLVzNjMhQPzej6V776OmpPQr74FOIvS4Hdwmwhc/87Jw5sn/sFtERrfT1kYDTKbk8I2j+lSrjT+G0GFJKb5zRhsKEuKT1VIX8101eOpTeZKfXZQlT4cIJnxLCIhDGtZt/LamEtodVq6du4n8EtK5aPAetMweu2/VIHqQ2by2Qg1wXaKkXNQh9XxJ52wC8e29r94nVTd7fVQuXcOGUvh54GK/diA+12HcdU3qxAD4LJXafrP735n6v6Nn/vu5AroQ3E1/81YYo+4mBt/RC3y9Webpjcd26XV7Cd7YOSlkLjfp45mUsNOMx/d1GhaI9rO/vayMX/RiQJ4kBkmlPrGZO6VWnaWqmceGpYl31tz+DgIhvDfq+SdAAfIAAAEFOTUZyCQAADQAABQAARQAAYQAAFAAAAkFMUEiWAgAAAZAjAGzbRlyYuwMHfekarvhJThEHXp3zlcrlentL5UAuXNwBkHAbIwKC2zaSJFX3zKzdR1VPUsfsD8yOFXDLYrV5GFJeljieDqr42Wb5DYrYSJCdIi4TRLsdeHNUMBSCU01Oib0M2xHs2R0rRKtJ2I4whbSvEs8653CtqwVn9fgQc851NkshpHzVdbNuUmd06R1usHpm4xizeJ9VbG42jmNIWXxut+94bL1er9jHMuOLhgFxxqNi+FnH4tu1bkaj1tFQ1cjuX1ejhiK51pmgp5Xg/YdNEqhpYdXINsO2aJWJcKxNxqQ27L+YoHK5xRgSWd33bFfCYGODYa9mFFcn4Nwr6m86TWgjuyYtDVykXBYyZWmjYotWXhqOOiNhDN+i+Y1QkZ3JVilauRaBbWi5pJ8/a8g1FIxclYwF3mjQNhEmLG9Iteu10GMy41sl6yowZFoaqC6BgM40gSHS6oTqWNq6Q6xEVUTalRVRyUgQGKdSTfDI6y9JutrIftGe1RrPpJ4Q1yIstEYjzDupAZFJFhm/iO0DGqnhuWRhGik6EYUGJPlAHaRTAqFho1Cz01CaR2GsZF2wEBrrNuMy/Vz85r3aBkSyGxMYdUqdeGW7UKeC5VqJuFZj/B28PwXTTkkB6SbCaUjJD5tVgT7j6tfTQVI/gMbZ7ZXk80uV1cIHwZZAYfnjiSjVXJMN18K5eW9e0hMFNeyEPOz6vRZwRTW7ePBKIN3NoTFKvCzUNa/AKGFHak8Ta2gqdjwjUXcbBNMJhRV78WB6I+rjI9mrd4WubE0eyBFG56cN/B0QjFGE7OMYtLoSOcFsB/5gMJTt4HSmD9sJbAfZHbck0MTGw9MJQJKiNuEoaHTLcLX2Qyca7WLRt/+fyQBWUDggvAYAAFAfAJ0BKkYAYgA+MRaJQqIhIRX7tgAgAwSygGeQAqkr1Xzcua/E55zt2j5W3vRZ5gHO252v0SbyB6EvS3f32v7Pu/hP4v/gD0B5Hfu1iA5KfFXUC9a/5/zvPeu4PAH9X+KDgh/FB8d9Sz+6eqh/d/9jzMfTvsCfy7+v9bD0J/1aRz69hM80vD/G/QCszT9e+OVxz447FZvec1YGA2EGc1o6FniQ/5aEluyoBKPgqvNMZOih1+8XFdUtO6vSzW5rMQ494iRRdKszpBaat9ZDMgGLBCYNk7sw25nLkB/lOPqsCTihW9yG3Ss0kqqpK8lEyl23EOh1W5s6Zgq3XyM8liGGDuAA/vPCZ/+1XP9Nt/0239AX//PJ/z/6le0oR2mnR/6vJf0e+SBNGrom8/i7HNjnMg6aTCn/tPOteDlhtGUvckUbIILjpMXlBqTqcoegniMV2RChJd7rL3u2I39aH98G9SHqzo09WDXNECyw9+4ZsizCKkjeL3dIXHxl+xVoAVmg6M/IuPUaeMbEV3krFt9lI+xntLHPvx6qGn7s6Qygj7EbNdeph3zKqpUiTG8S589AQEUMrrsvXS0sAH1e9Es00IVjH3eH/iSsRop4xA1ffFUr4HP0bhP/JXjfzIaTouLnAxt2NO8YjOOAwpsJpSARkf3aX6cypRZNJC2iI56c7RzMFLhs5aAv7ONAF/Z5B+yQ6l2giGfckCFF1yhNaXeHxyUXEuEnm7C5oSDR+ur+qYEvNvGC3NDyC1yooBM8XT/+17ONwYKPeeQ45Jq+bMvOAn+pEStAPgB13avva5AaOxzuQEmEEtIom6e9UQ0L/fiZBbhHgcJ6iD8G0y4Ax6xPENrojUshkK7vLDsQXHf5ofp0+r7wnguysVB+eI6lRVtwHk6e4BwgnLGC8JVM7OLMaX41PrA1HIa3hMRRocw8vzNmf408yv7W8rR78Dg2+ZkU/iCymP5XrCv5ENyMGQ8ryh7PiQ9n+63aTRlflRbqBc8Kw/uQkrPLUE+ieH/RmSQpzheBMBDOoYouAvaLy72AZDIbyhmqbE0hhww3Epx6lI+zL6eKuHvbhK8iiqKRbXofScVTEfpqTEi5Pdres3E6lkS+zLsTTRxe184Az3g4Fa4UD01B6X/CbSuMvdUB6j2LZq80+8zW+2cDlN8mblsZzH0TPPfaH3HTKsahDW6Bv/hMToHiAIlaAXA0L4xXZT2p4VDHkYydFJSDlXi1NLnD+2b6OFX7eDtsoeQP6Syg0wGzBveruGJ168ncplIwLCLaSQ0suVy2BP9lsxGyde2IA9uRCU0oMHgQL3pK5ZDPLk97rlAQY4lnpuedL0WYvH6KLSZYQ/45Sk9dA0MLqZ/MEXngcazxNSAigRZ8+A6yH/z5f0yNtiVMrmaYgK6KNjGusGDShODt3RLjbfe/PnI7hQx0B1aAro6ftRBKAuiCCKdowtRz91T1ybXw0fSohrgF7n0LjUpPbFY2RtzKgLOJpVV0+hu8V/hOfSsuP89ykQgQLxlwuJu1FwxP17RTDHIsSP72oVsfCX0BOZTZS2pq/DH7a21IMzpSqNKBOaWaTRzR3U7naVUGMgeqmA2aKkucCpIfkxDm6YGLiFucNtwfjnkDK+YGBadu0aESoXEBUTG/zuxi3bI6RhkOQeqneeA+BAaBVmYinu7HSWmpqmtn6ZtShVCr9mZ/avyeW7Viv8DL7Qt6xvTcG+uDUrqqKKJSfLkJFXcWTGqcEG2zcdJtoIBUhUqToACk0iwT8wwcHT79k0FbjRqHh1UWGZOvztxG/RqjgEGKfFGAfqoVP+19IHUSRt0dzlBwH2o4D/TgRTF+9NuQXEEAlHMm6FbH4hNcb3Hn85uCL/UgUuJnTx4gAyOPsPCNEGlr3fdu8Bg6uHW6iUQKbR0NqNKheCaoNe8T5dR37c6+s4XbBNe//lKabRLJT4MT/h+6swglfSAgWLkBhp/e1YHo94b0uM0Qm4Tv1rwSIzjrTeqMU6wLYi8VbEp7i0IG7vq9GKFP7CMV5moSrJbN1Tl2S9NcfvseZr+J+AYR4uyu8mzsJXAhVOxpA1h3u8FXTRq0Rf2nmc57yFGWzGxVlU10BAABMw7ojdLk71MqNu9OthrGvqPPY/OnffHZ9JgHS84cN2PsF5k0f1By3DFYd9f7w5wLn7DNucUlCW5eiNjC63WJq0v5KoUK1BJse/8GJl9YA1kdv9Haau0hvoqq1AkqWItyAAzdzSILMITlGuP87kD/db9iowi41C9fEhmr1zHHuG14Nf5TirVQ/KCOrEhgmQAAQU5NRvYIAAANAAAFAABJAABkAAAUAAADQUxQSHQCAAABkGJtW2s7v8GAYEo3hfSiMpkgNoJjznxuw6RPpTcEGAwpO38BUlVEOHDbxpF0bYTLztZMtvwA/gpe1m/fX94aNR39oe9etaST6b+1//wKs/Edwc8mIFS7DsX8LZH1ZFRCiLN/TcES4q8JP5910t3WdRLCdwJtzI8xWxk1dzB7uG0xl1LSHZ/KNpXekAUYnbLKGOu37Unnvpob2F8qpXbOa2T2a4/2J2CMhk6/puntSjBTbe575qs+6yNpTh40UsVBY1UYtIaq0977InqnDVn9kmOsYnVjgoLRAFGqOok+1HDtGqLDg141arjWGVNx0JNKcCzEEhMqndeZcSGElyjoViRVmJ1JU5uuPapopRVrwPemI6tiOeCVllZJdtbbQHNEKy1DJUEBaPIRrbQc5QedacbqHhNasznKDsoWWRrWlEmBTB0VJCMAsJSXne0OYPD64i2W42XnqWKd1pYDb1/YSuudRqeCpK9i8BNoTDlBDkYCntpCOhE9MHnyBJ1SoIFKBWIBmVPyVWc8FagTP9aomCxwlSDpIRU3O4EGtAeKyC0fArUZSwV84Vys3MLKVuwwPlUEj9l1shgQqDotJUfPCBLA1Nd6fwqqAcRB6IHM0ZaDFZxzZWaNzfGEUb5qSU7LLpE4/R+85SypE9+aUXcahzDlitklfOqZF3A2VHwTtHkXlTpkvJXcYRbKJaqlIEzCnjayBbPQH9Bjf9eah8L+zT+OtdEwB9Vd1k3GVqQ1HZVajt4CLACcOC25jg/z76HWdTDlT0lciKzXoZi/ZXReB4gLEf5f0dx0/Dr30sF+aPvfUz3/qaF2qfWanIIVXsp5K24BVlA4IGIGAABQHgCdASpKAGUAPjEUiUKiISEZK5yIIAMEsoBo3NCubzkze8Mza3Dnmsc1c63bQc7B6LfOq9IT1Q/QA6Xf/N18N+W8I/Er67zPcPdpP0k8r8TvwoyebzPYzv0cVemYzKv8B6Hmg580/zXsD/zP+pdbP0C/2gOKXtOqkVXclrHQwx5UI1525W467zp00jy/VTFVGuB/eT8jR0EQh/mR+3P/jBQMa8ztC6XUZ90AqqcUbhGCFJ1grV/Lk+EdJi2pxDJ5on6EvdHDoTbf83c6VrnVe0S/uaqcHA6MGwztW/n/od9A+wNZcgj7QiosRwMjNZTXgSrvBfJ7aZjg8AD+8kSv+u2f/nbP/ztn4/X/mS3+Wn8femlyW5p7mIX2XyU3Twj+sSSfe90r1R9qlDF9A03rlyCmj+G6p7HgiGT1f6HMVKGR4EaIr41RuOni+xvhjIFr7cITAxmARsoA+qWX8vDaxKGB/+WIlezWMby7SlfnU9XtF8ha5NZxZISAALldYXKcQ8Rdh7E4JSS/mh3DlzqUwhtsp0avurMiC9aMdWUYT/9zIxeYwglO1aqA16PXSapRhhZOmkEk7P4Z2ZYuzbnmBIqUXEt0g0mlNPLkLfyYmFhYq/c+G5ikE+aEz93PU1MeU1bUfsLO/A7sGZBi64wqMRJT4o/2mSje9f59zvEfL60maHdLUz8YWWZ6uAwxT951hF4a/xKZJ5Zp8eYekRXB0rhqx5/MmAVNYJoqe0fHpAG7vHKBGiTCr8o3AaVK130l1H42K5JSmMfWdM/4g9VIl+CU+0a+3OLfknJV3fE5W6FaBM+x7qmzpTjhgf+jYQrlH1Ytdiq/XsbOV62X5jRKqyS6uax/Z82iu9xwH9AgCQSEAQF76PwrG3kkd/u7FnJTygKWJSTmVM4s1tOg2aVkzYlTRXCUVbDBlYn+TCx3tFpGk51GrrLCDNDC1pf/Jez+5PcKVPrs+s14iJ1tGm447GROodEgRkTnTJUOL/7ts1LLBmFSmAiqRq5goh3keKTWVHqKWPxuo40JFULrK3xd2dBkBe0e0ycaOkaO7tmR6BT5/EbK2fOb/cK2P2MmNSH5ViGLVz21xlxQEnSHrFbrVbtnJ2jQnlKvq7ikU9Uw6/hwVF3rC8vaOlcF4zmnJPwrpi76R+FlJ+7i2l1Z/vED+nB7cyH0kcusSCT9i+rDJ/M8CMxmeDlSMkOeWfbtztWmuN8hDc2p0w3+wHRW8SPgxytV+Rl4F2/U5uVQfUVWnK/xLJjATWkk67q1edKCTUh0evcLeAnVnITCsQ9KCs3+Z8MlJlYzd6e1uLTVJGjCwf2AvPj99c1Io2TRbkCAQaGVwvwTQ9Ya3cMXgn5MWGnuvRtIAcVCUlBe2Pn+QYDxJmZJYjOb0edlIPkbbe/1ZWTktocf3ycUJHE3HrYch/NMFp5tD/6jB1Sfi/qh4JLXthMjooHAcjGi20iI/72z+5vsIjHMrleuWdN2qAvJhWOiElucxogAbQpfY0jstAh18zdUmOlGBVPokb+y0Mk5HEqNGwccqTG+zwTpm0xH/dYsqypByBD5LhQiawbtDlko1u69KzmAFBlNYkkQsMOlM1YEY5EgM9LdNGEWdahDruLhbQELtgd0N4g7js3J7KIMa9jjPLOXMxvapTK5vo6OdiOn6AGsZOJGf9R7TlQnVVvXXBVD+NAzJflv/j5O8h+xbzp1G2fah9iZvacEl3Ox7p/HN7eufBUtO384/0M+/pZ5gBzfGRFLskCgxqwfAZtVG3jZuV6t0Xr8aqe4fh1wL2xUl7Mg2sUh+fmwdpHBxgEvzy5aeKKxf1Sca0fX90QKjRTy9/QjRnTrSQ7PMpMXsxIB9NzrO0B8yA8rX+AFWfoZXlbEF/uuQob9NOHBIc+nnW4F8hN9tn3I+0ylJh60yLujyqalXgbpJr460oqi219ZEj/5uT/QPpdv/XrEcpoxqeKAmLQ4j9nCrAWFW7xL/v3DRl7d8+tmXgAAL1wzRVZ2KGB9TelyowJq/Vz8xgkXwbq+2HFJGhsk4u0C5RrOWd/+/9QsXIR18HURj+SkZoaFYvoK+KEHjt1FwULmlCAErLGOkyIxgBe9oQSwqsx0hxanWWegjmef/1EFf/Bu/ju7pX85+ctgPzoSmblhwhG2yTZSPP92+dO7jQfAvCON8wAAAEFOTUZiCQAADAAABwAATQAAYgAAFAAAAkFMUEieAgAAAZAjAFAiONvQQDHVxV6jRLa6Nh9RIhTn/4kRq/IfiiFChNjODDDRKiIguG0jSVJh7mpht44kXU9YhjXrHNwEZxYdzWfE8qVgeuhVENu2ZasLdBrY04XNuj44JNhbdBH/2ggagLKlgAaCsi0Y/8hkqwI2PBj3Q2ftfPYdhIcPE+a47uXsp4fVimX7F7TWkhmOcQ5iadJWYKRvM5goeTc6WljO10OGIY/HbVwLIzyP2igGdV7rSGq/2JfWFL3Y1MZSYIphmji24WTbw/UynuqnGypiSmTnyYbknTOQqZe5hgJ8rJ1heFOpJMJm4wwDDKVyU7SL7OIxiRL3GxKsGfMJNRA7yA+or5S411D8j/LfOiTYreQIsC/VdxrKdb7uySeS4Bd6xJF5CAZxL0oCAi3uMkTJvxajqC7Yo8Q9hsdWlHETPdWSzsAYuIcI9kpeHMQpI4Mof5dzSC5q8kXUea20QXZ7gueKDEt2pgyCB+/CfemyiQIxZHLjrouQRIBOXjpLtssjw9HlEgYJ84i1Cyc37nHbTS42iX7I9+VJZuKUVCxY+mLqjUIFNfY2getsM2mXP5GrjS09gRVH+WPZ60rc8iABWfgwEEs/shny8XsTBNq7RZ635Z2/3OyrsaWgW6QvOdquI4SOCkX2F9YUoKsSlRaPFZOXJOwvec93FXwQkuzxOnrZmZO92dcfYh5dDne986m0Dtvw4xveXTHF11RxPeHmnM7A6ccE0RlzIiUFMHz+nXUMUXMEYqrDPEz6ub+3TJqYd2H4gD+PLJPkJl54/qd9oYGuUKECWakBys5egzKiCoIyoGg5LRWU3VYHulQmKVvo8Q+60H3VhUOtJPPnW+haqf6/20JHpyr51kdGBTYkrG17B6HiEudDdzZaAFZQOCCkBgAAEB8AnQEqTgBjAD4xFIlCoiEhGKm1gCADBLGAZ+ygro8fvsvmvXbtDB5u4LPp6Mttnztnoy6JT1bd6Q/xNfW/fPCXx7+5ZJXdZqR/HvvlE78JdQJ13yA9AKyy1UPAfLAeNxIj6pv919QHuS+mvYJ/mf9r623oW/sAYR6EPypdsx8e0a5ZhC8plmpLT86kRufTP+lzbtx8HbEuVh4JL/fQt+BIL9PX5ue/DqxsoIkqzA/codIuMpmSQYD/omcav9cBsu75BqCIPSLGewMzPtYIOeng5G7XirR+aMA504oB8J3Hz9ArI/guF+ar6cXyMAJl64kWvn/V+JQtJd9GFHq8ZQAA/vJEr/Xcf87j/ncfy9//Mm/Lvnx2mnUIoz9dFZx2vJ53Ey/PiOFYWi+m1qNf5In9LzdEiNkUG0oYiADdze4Sf7SeMSSRYbhICaTkfwWTeG3VfwvUrkYFdEwEL5jBfLKQQ7XKIky9lW6VW/zTUvkkEnPLN3zPpWXUmesArbGetQ0sIWZSdmgE0Bwyoj7h46e1RV7TDjW4PXQOq6B4RqXnVF8p8yEgP3y0msfwg8qoHgkQuvs0K5Z95zsIO62zY99OwCizTn3NAiwhuIlTS8u7CAJrjpDVOuj7VcexwFfjg7TmpHTecwrgc5WrRn1j+qCSGqrMLXN0XwMjueo321AhtX9IhSybJLsqtyOqq5iBiNyJye3wEgS3ox5rNGWLLwNi+dUuwiBS+M8CPLXuJAGULnXGWRKeWa+mFbGyAK+kDeAGmScgj+PnztJTYUEVHDIndwRfTlo2hk9TSVmuHSvgLguV2kAv7XQw+oCIBKg9cPuJ3UUpX4PaerP0Cp1w20EAO7hLv7EwrQbJvZ6lJ2fbtCNKamFjdFdgPM0WCoaMbFPSb7LjOIXB0mXYxKNS6r47GtNOfVPbk3yBwNkbzfV3NdCmYs+6yTbSm3x7REf/5kFE06AwfAQsWGIHJKVQ3SWaGnt0hgnMIPHkC6JSQNV4ReiQipx9h5n/6H1V2T7G3fz6i/i7PYICGN6OKBT4j4Os/8oEvzDtCenwWGvXT9SYfO3JIUXEMgfp69AegrzB6ACP06mceFCK7XHU7saD4Hd6FxE4vSLE/O+QmSO798rH8YjM5gwJV8HlPogPRrDO+IhxyURhHLKfvJ1wpBCOGKyJSfILgs2aTkVrwi0fIC2sGff5fjr3If7abz0D/Nh2hvJfmLG9SBbvjTRgKJJ/3xyZHOtJn16BAngPc3FDiRjPGTrH9KHYW9s6KpzNE9Oy18iQXrh6ZSUVHLROH7JG6oBViTc6Dq88nvtiMYZUCYfH3prcjtRI61L5K0rR7IeuRBMZYnvYnZQ/iDl2uu/XKOq3PdmcrfITlbvtjsAtaarj7I99G+vZnwA6egh/tqk3FXeD0PaEgmRAViNOY5d/j6gWRtKb+zSl+5akc84gPyojT87TtMta3Oenu8zcb3dGekkwWxqO7ONN6lYHMaUMGvNyE7pYk7j68oLaEkz9J3AvW+9lvSWXmmjv8r2m7pie1dEbJ4Oz+eZI1Q6k2i3VZVk+8W07f9GiILBU6eXr2CQJr3eGBP2i4JZoz7bxp4CP14EwVvgvxRqBK5e+ma5Qh6lktchMvuxuqr/a2q7lHyxZxMKZ0AWZ+SUgnZzRA+8Ft9XTxG+za1RxJYunT/EdYlH/KUiJuu7Fjyo0tu25hyPu43kRH34O1s7eILmbGJxsaZH0ZkuHpWxwAsxSxbdoC3MZHXdmAU+nYxQ/swvLSnUMazeuKmgNnpQSyxe0qej/Mq5FEKG+Ex52OQ4X/JbuNwW5OhiGnEaVRv6qC9Qd3DS0rVYbulYmx+Kzw5GPy5uyVc78njWoXqVGPYaXmgeFNL/9p/v4w+ox8YABxLGERx7bOF74MqLWS7/QiiqnYBpZfEv//R6ZND5CJbAOylQT8Z+EPFlhsbvILkzBwYcizvde3QXu87odGPttf+4kfCD+f6hc9RvYuf3fTibOtEE69pjO+F/yhuxaOJ50eSk+q5xljgypTEx5ozkVQJmDJQUTdcgCbfJgwXWCWpgMqNiW9gJ/5+Mb+PZ5Eys/jqGxLhmdcMrPqXVZYcPl1NzPqIuSlT8z62Vaaypvr5F51rGLAn8Y7YHMj+Gn/v7lQvqmufjpa5oNtVTfyngpZsFxvL2SvPQJyxyWpVAB9/VZl9a4Pywou44gpgLxt5l850mtgYVLdQvoNYMMFbhcvy3WRuq3Kjhl3C3FyEJzEO+dWIgeqEAAAABBTk1GQgkAAAwAAAcAAE8AAGQAABQAAANBTFBIdwIAAAGQIwBQajk0bBIoiLtcRWftQLGVR8GPncaN2IGUAhoib3WYecxaFxEO3EZSpBq16qCHoeEJau8WY7eKlgMIKW+VOICQH0wad5X6SAZs3o3RHw0AFakGMuARzvaogWSkISgZCNKukUnir7m2ZkvP3ZSAmXUrwxBzCkMsGQSg5jJiJepOBnC5jtRSYer2YBhCyrkpPcgQ2utM7nu7vc5k3o0TlgpSZMqLr9+O0yI5NpbrxBg9F0tlHEURbIskMnHsgOQEtF5yDAWj3q3X2YqzWnmU+rTeNoUuYdSj9fq8Nk1rgyaQ2lyifC6jT8U05BK+0csQc07YYiQMXikKcVsvS0ppa808gjBfUVCI26EnzNx79CWbhDwu7wwL2aopaKm0hICVgHpOROIJAeVyQj0nPrlEFR1JbQWlqERtIRqavc+NtqhE7RAUDelyQXaw5aFRyLcOPBFhBRmZa0YcbVoqDWmB3ha6tU0yiSEKKhFMMokivGMfteIQ1eclHnt0cBxqjOOd4eBG2Y1voLikIy7kQ4ifFWDTozqWnN9SxCSqXeYTrDhSykTDrJLtPIP+32O5T3SjuKLoVLxh4CzdKBanqFQjcPzi0K6BR3o0KhE05xeG45+Jk4fv3ukOv4zRgyUPl7z5Q2K5JnW5R4DIdVm7BrA1f9uuXFLAjn/ol5CpKYCdW0pxxRncOpg+EWKJHnYO2OjW4mc7PfSLsEI4caFrEkkzswxeSctyBRmYQLHnbchWWlqluF7g2FchWBFX0RUs8SGlojRFHY8witlKU6ywbylKfnoPIsWjsi1kxKTiFKPe5xTrWy0Ej3YHS1oJgQbvI/JJzF/8TwoAVlA4IKoGAADQHgCdASpQAGUAPjEUiUKiISEYPAWkIAMEsoBogri/buv2nd4/zQLV15GhvOj569AHos8wDnk87x/pPWJvNPoUdLZ/oK/I/EeD/ic9fSYyRP9N5h96fAC9gbx9lDvl9X2KH8RCgB/Kv3G9lj+x8kP0/7A/6zb57+2Bos5rXUKjwPS9YnBYL54lgq7pLf5nUQQY16/0xGCnx0D40aw+QG2PwKUHQ3+usdhCk+M2SBeZu/vZix1z5vc/7bfMhACcCf9JB2z1cvvFA0Bomok4xlFEyj1b+iPRy38ltV5V/4dksloWDfssX9myHvK2p08ZNS7dhJNrL5RtZ1z0oz6oeAAA/vJEr13b/O7f53b8Dv5lB3U9Yevh5Sn9YVx/se3TCIovj3mmTV5PmBgV/hMVBDr8gUzj2uFonOBYbA4y1a8UYOsbp4tDfWK64bRu+9mwHzAl5ZzESj21uBljK/yEezmd776dJccdFuwIUVaOClUIuB6/HGwie1HWqsjYte3Y1sA1ABDiCVgIee7JMyoZQIa0Se2P6lYbb+MQZXEgedRHl1IbiTjJOfpqD925kAQqwyx3FFJoMdv/R02T/Kh3rX/PCAcrXwe2v6JEO1dmDfhv+J+mLBlkaIKKhuZ8HWPpTzm8+Pz+rj4S5ti57UQqWmyMfB1WzKx4F3i2Iv1quYgtYMlI0BLZXbCi3dYgdOezk9MmpO760onPkSfjP4hnbQAsijRMMJSJcl8LUFCe2OY7Hqa8M/GUYDBRjrq1ChlO7RwK3V+X0PZUR9hak91FXW0+50q1asTyraB0LCLuY82m0eXTEBQrujzfQw9AgvY5Xpn7Q1k/98qtFG/3XCykPPImhM0Jsybr5+m50+IvEPkUfulb5y4FEq+df7Vvv7IEqKVNf9K8VGkQ3VDrhrF7+Tb7U4XI/NPbdchPn4DByrZ/mYAUNnbjTO7f6yt/qaI+l8/fFHcPjNMvl4tVH6TcBcD9pMbbNhhDY75Rc9rpZiPjVActrHxuaaQ5eMEySHvDxuARVBZE0G9IWqkI4oz1xc8Tf0+RnOehTp0BK2NjJw7ALQ/AkX/p4TEOo+WtS3mb/mBz234Fty6/mAKS8jxcdW7Pld302h28dVBi+KgsKuIv4cxrgIBNgR8S1qcdEOoNjB9Hop5OqKa2CCR5AQQWIgxGeHsfTe4Bvl54pvlvETzB7JSsXe8mX7q5HGH9TlkL8W05KHJ1cvmIVT6p5QDYBe2WZHx9kg6Cc1fTx/WPn/frAHEGDtef15RECRqvUEHKA5ta1BxAJ7erKC4n/rgHwNuJ53hlOmFeXp/SzB0eIXsl2HIxutqk2xrRk24xjaFTJUkVk/2gee8QtgBo+UmFiOXCbz7yt+lekW8R2OVUv5JLuVuQeo63ibHlXVeLAI/EL84jtpX4skzFv83S3MO7/+JGpVbuPB/6mt0WYfbVstPsj3I77Ag/RRuOylBSYLglvn3egoQnfW7Zakpp5VgsJjAS+rj6+gib30IB9uYj3WFaituVlEraJjBTlqAL/dkSzpyJfCafQcrVYySlIJC9UFguqVLj/0N6dDTQIQYYk/N7MneiALXI+JYDpcZ/2IkBcyXVOk4ffqN5+9+R4BCdfPM8uvkLDyYxulKYmFLtdScqtNBR/mom13Efw3ccR9e0HR8v3aQ92rWdVLTFOdBui4vP94a6L8SQ34WY9ZldPmiW3+G41uZdVMnr36QkMTu0dr7sPtXsuXnzFVN2eLh9a68hxCpaZaoH4Aa/QFUKjGoaXZCWr57pbWmd2x+9bdlL9x/oaSF7w5WeOa4DgP9jd+rfC4w+Yfc28t3Pjm4JsktmNQdOCNgj4MnG0b0K6Mi7meX+fq8P4D03qZqh6LtR2G+pIJbyJ54xkcaQuIw/b93HWLsvRQLRjCbO+Azw1hrhjOV1pw9m/9Iy/9MrNfeBz1b4S3jEA2tBH4pqEHgzgIGWhESvxyvfrlQ6oNwbMv5jq1nRT4ZGXol5wb5b+H7GeSAJV0D713gEut3twv0u6cHpCzMmnS94j4L41YVltTjvKrEBE1eCkeq0IKm7jHWa4nlkBOYpytHxUc8gk7m4OoHa7kJ0g339QdgkQ2nnrccg7h/uLSn/Wael0Rl/5erwgRD9NdJv7M08GS43nEpQlHeuMr7i2zCiBB5hJSApD8yza9Q7uSP5LLlWOSVD0e9//6/c2fjuEyYbS4q0Dpc0rKZZZxD3jXRZRadEj94MYaytn3nie0+erU/h/G+eruOZz8rWAk5qqpX8wAAAAEFOTUY2CQAADAAACAAAUAAAYgAAFAAAAkFMUEh7AgAAAZAjAFBqOTTsJlCwsfsocbmNUjwKfuw0bsQOpFNAhAirwwATrSLCYQK2YSMjxGZI0tZ2nJwgRpnU2jhnlGBj8nFKudYMwSkm0KnuNccPnglMZgeHsFgm8AiS/icBKHYIXEpIZJdPOv1FQM5EoyZJvW1ryoZ7kgMuu2WJadveQKnFcvhRKm5xhiit7bIqlWiDRe6MtwRIqflPS9Qo341liZ3jDQ/fc6WOMzBDcDbXkeaHkZXYHbISFetoZNvLJ3W8RTmPU7JKPh66flSmB35JELxboTJ7wnJO7yS6ATTxJwd+0oTX6GcEfrlb2p9KRjSrBgT+m+ZTxY1EeA0Wlf4Jn2gbU/RvsJXagoIk3VQ7hVgKj8Gj3T1JHsu+wH+yJ1qIyEZg0jHDudJiG8V6tO+jSWzI2UykCNjqAw3yMSpDqADBESC+AgM0MUCl0AlDokamRxMXHx3PXhzU8KcKGBKzFUR47MjlBFmqJ/Es+eDmHTpWr1z5iZN+cPP4WL1iMsqONTqPnhZ6RUaUdOSNgJ4WCNJKfIexA+kI9EA1E98AnSKQqnD2e7aFnsT3X1NKgBFPUJo5wmmnKeqo1pq2Gx3Ow1oUW8Z0GzZAJaND8tmeTuNcx87mBF2ATGVcAEJngKYoUUp0htiB2wCd2/hbJUjyNlhJ7MFjZwOeIThDfZvkcaCvJVhNuSMLnd3d3IuhDIHQ8fpJV1d7v5DaqdAlRb9Ce58513/RI19IOaul0GnyxYmUPRUiG8Hu5sRxgUUcgQt0mn5Z9JfqUMDPEfg5HK8LrVabFCU7R9LsHMX+X3E0dsi/xOL+z+z47dWlAlawKu4lWiXYmPXbZrurpgAAVlA4IJoGAABQHwCdASpRAGMAPjEWiUKiISEW3AVUIAMEsoBo+DlDs+W85W29zWPx27T2vMA51vOxejPeg/Qz6YD/CV/T+E8LfFH73zcMk/SNqL/JPvZi7ZNcAL1jvoYAPrJxR/XnlcPElMMf9H6l/rd7ofpz2BP1h6yP7gewb+w5ggDuHd0B8aDJKzRrcT1VaDY2pKKKCw/ZJw7IJAKAbd9t1fJj7W4X+dH/tK0fvNtbn7+UKW6jxqmvo8X5AIR3hmqeUNunfHI7HGY+PMqMsCfQquukhEVSx9iuo6d5BHY0WYi/PcyafB+3eKoS0uHn4av4htVZmIrfiUkLx3EG0eCOVgM7JGqtIX7AAP7xcg//rEf+sR/6xH9cr//kgerbj7v4MsMYgyU3nkkyP53QT2h6ZGADS07QVSEKT/534XVL/jfJysMvebmSOsk/sX/B84SL0wmXmgD32xL4zFdabkeBtPHU4pdjn1ox/w6hxTVSmD3lei+wrQCp/oUTYFFexhpVgkyKSulBT1oYgYuBsAZfu795+/D383HfZpStv/2O71A7v0ResUsHRYbCeX9yzUy5dxpzbThUdpBl++eGExyq/tONiodbnuqQ/8L6t1d1B0RfrKH/VawGF2k11eNv6g0LWPyJNHUO1qX7qNQBzYUNaIgeqCToa6rk6ZkwMdsvEIv8jAKG10sv/y9ZZAX0wTu0ukhmcJBhMGtipkGMQp9R42CGs5YHbQO3r1nFrOXemmtjUgehFyrq09FBs2TjLVl5T0CEbbIaN0GThpLQKwbRx7vBsCN0UGwtm8GoSjh9te/sNCTqIK7xrbG8RLskdGOZY8F2l0QbOYpJeeitq5BwkV7FH4V3/WVuf9n9q3Bi2retIQUGgtDk7o0gHToWhS3WnQad1dVAtB3JBolAS0Ntn7bUM9N604wqnieiVYRTF7TPtYjqUW8QaN3M6uuGmXN3JjnpXtrWpVomfEXrH/0329kSXUMH05drXyIb/EcLOmws5mN9WZtqOsXcGLe+69+W8QqLzmYP9Mj4Lia1vXWLYyK3oxivieay3FnUxe1lUZF04OrdpJgkWm8XX6dcMlu0N57D6JwF32iXO0vkd4Vcwhakfcr9Zep98JXTLB9mfb1sFEwJhm1VFaidgMIX+zHRKQ3OKit0DVtvqNvf2dCRHxbmxgWAkuNx6Jm99cC4ppA4ml93HvDo/OYDe3ItnAD5+xyDnGUk7LVensyVRAq4b9c/rW0pdYmBwN7JZm5lcc/sj3AAzJV+uJjdNLs4ElAlKZbWtvjXXQvgN6KeyZ/ifwbH2iRtqOh5p4K25YSRupMwY13++mIXkYO8XqhdSzfxSudTWEGkkVE4CfyjcwvuUq8e57fknBu5FkoeX0QqB3O+IT72Ih+ekQYpn/7663hb9L5LGImmT/+jotfvu+FO695wD+1e3ni3gtGqHRYedZ6Est4CSIFy9u3YaxEedclSa0L29SzkrU4oRvMJ6ZQwgSPDrpRovwE7vYKPeCLkuRyHHn/4MOQgJIFFDzOtqyJwKUTlyJ/ZL2SmGrfNbT8BKWfpZbIAQmya0QbfDv2sB3f/vjJUd/GnWhFpO542d5eWmhNlES45qkbi5pMx8lVMWtQ8wb0yFpqYm93iJHBi4bRi5KFxHElBQx6ARWGqOhK8b3WFsOwXYm8VKGaC4hN5Fbd7iewYh/j9QxjjW9rapHz5wMbO6k7YmoBz5sG9h5XczQ8pgdEJhEDd1qW6Ea0M1Sz79MXqSQuViE0e5CAwbT+XkFYLMIeZolxLW3TcP47vxZpVWVzDdP/mL434AOswH+++pvaQCDRhT7gO5euWVn7+X2gq0W4J6WEP6abeEBo99bgKTQQF7oxuGbtgPzdG4P8W3dTRkkGtihc1D3T/uFprJlzVQeZ0yBxMM8VTMLc5fQKal0rSfGMEn2Gg//ioItUSQtWJx4k2vUrILrVKdJQf6vqbdf9zKE+/fSd64dvFVzpWa4FxB5FHTTY8gnfXfqlhhD8I61JU0RuvvA/S9gD+1A5goBhfeR9bhkghVh5xSZB+FojL2cWMkoyazxkedPO1W5QeFGPUJxekTp5X4UJNOF2PTnnm6hGB27GodBhxSn34qHHnSU9Gj8dyOUkkDG8DRHAJJrHUU6BKo9RA70wQuoCVk5+N0axr9N7/v0DLmA7ig8kyj4AATdvy+qEe/BzwvC5aTXLVW8d6ZfdNnpN0l9pYnvxw0HC5TMjAgbMeVS5JPxRnSFA6lh4AAAAAQU5NRnwJAAAMAAAIAABRAABjAAAUAAADQUxQSHcCAAABkCMAUGMrfJWGKTDWnmYM70hSLAXPdJr4E+ZwmzgFNDQY9sMMi7GKCAaOJEWZzQR1g4MHy7JPUAPNAGg1kek7S6CU4oJmGkCqayuEswBLPWt+FvjagJsP2c6HBP8uiHqWyR/nm1iQ/kLh5kE/QBmjtHU4B64B4LIEohBzJbsdbG5F0ZRK3fxragBf2ZZx/P2sW5aYUulji2BgAFf3y1VsZVhzm/qvQ9KYQcxVbqO7WKojMUbBHNXB5udjzbgdN1PQh5WBrRV2pY2BCjMIlkQhNrtszrL3CEaZ2FTY+jgBJ/XcZEblh6X/T+nYVBghmLsIkJovgtFELefR1cNS2uHT29wEoykop1EaEWDfgmMtmpglCvqwR0ae5Twvu/YShV3hUTWH73lZoSW+wu3MpI6t4YdmnsltRGSt5ukaNX8nZpNRQiYS90PteAqWetGGh3ixC57CjieYUXXAmgZOsA0ky+Jtdg7jHX9rphmxz3HZHZNv36vb5G6DRUDlW5O7D67CoV69rSb5SBAkschSN6y4FiW4RqIQ7Lurp818qtB4bdfzWbxGxWl6Cvow/TBi0TQnojAv2DUVzDqbBDDMtF+QvAgUDkVJg3X7Mi4dwtKNHaxe1gtWO6f4TTk0bJ8LxFiOpfUMzLVQQJZXC3ztb86yJSJzPPpRlicxEbmJGv9PCFKfxw0qbE6CDzdAb7oHK4keZM53GwDu9MwUPII5WC1SuQze4PB+P++sOTuGw+Csn2wDvg5g0xVblKH5CkIqtBzTwM1WyfjXceg4U/GYk7Or+arwQc1XCiPzP9vxF7kk/T9yfDSzOcjPE5oVUkrp59FMZgBgRC8FAFZQOCDkBgAA8B8AnQEqUgBkAD4xFolCoiEhFzqNOCADBLKAaRZMP8Pk/yl9mi0d3kNh2yTpvMG52/mM81D0d7yp6IHS4f3uvufzHhD48PcWZ7l36NNRHsr/a+XPerL8spd8FqZd+eWQ8LygJ5Lf9h5G/zX/T+wN+sHQgexR+wBhS4iK04nIBtiiyO3+6bXlsaQ3RXA06u6+Fsa37xOVWVrPGzv5yiOP/he/0wRF+HCTiAJ37G+ObE83nf2PcFuL+Gr5LAlarnhsoOUpmLof/wxE1ehXTEMYhfGazjFilhdF6SZAeP/eVyt0M4r+ZaygQLqnnmeF6ZIFfBgCOYC+u5RA8Hpcglyvmx1wLIn8NF8AAP7xcg//rCfzCfzCf4k3//I6nKo3ZgeWRcntIPahgCmpo6bQc3RBm+iM5FINyHxJG7/Sx6nWNBC9Rfo5VxlptVXsWI5uQFLUKPmI9oDXr3CirUlHWqhicjXVZ+2txKzEmAsgvSc0iTkeZJg2i9fWaE+Tnp0VmNpW9LucgzffctIAMn3d9YfVvj83Gyucvx3/Y9csxLliyO/duWznQvs5+dvjeDq5wMB4H78P+g/EkMnt1MbxxJ8T3wT3XA6QPfWsTEM9FM1Ll8EuJjS0onl9/xXW7g6OpUG0pt5jF1IoFq7+RHzFjRbyJeqgzTQ1yUM05Gxs7m0/KMlG3ypNseyY6xJZXFuvVG9I0YAM1gcMmPV9WJXOUn0AjqNSBKmX3/EfkyE1/2hy4AGRcN1ONAbFfnXjVkX1WPPeR/0gFLCUe5aSGcHC8MNgxvjkXq3f/hH2FXZTRXWT8of86q3vhQjXxROIMVBrwgvTpV+TDrZlMZoGnwJCBWVmpWFmjoD73XCJpMSNzqq/ppEL5d18G5ZxPtqH/kGP3WL6DWohsyyq99fVZCSDJQJPiB0unv89eI7XXlaAz37cxS8RsQqOkaynGKHhN+L4dFbXDLiA2flVHwxiKQ9p3gSvmsQyprlPNXTeW7qhcZVug99L19eoVmGoz3kr7yS7fJoBi5MX+ajHQqDIagef3hLo2RtxLVZhh7UmiCbNdIjssmya7syFOWtBHZlFONDG4MvLsi+flIbalRXZ38s1tyNU2k6GeYQlZaEUw25okyY7pmJdq9DABvZ/7HFXK4wvXAb8OSi037W9l44Rgy1s3n40BYG0zFN9cBhUW+KTkeIkaS5odpcIDb6Kd4AIYiKvCobai9UR6aJT3gjNhKqqqlSrnyFndhx2k2YJnUoIdh7yAajif8WP8wgYwFMaS+aUpAUacQ+lyn4jdTaEbxOcFkZLCWuyzZAAGcCqMy6FfnJyNF9sYGnN0qyLPucIiAOkiRnKnueZ/BVzLdkgCsaKVQMf6T6XB/kYLJ0yfwYJ149fNbj7ncVs8tKhn+0Pb9bNsTVm//EgfzrFWP+bj/+0j3rCiUdZTVeOWQ05luD1P1hIoM3mNGmlI+PqcO3UM3HVi4K3gIxszGN9kezO16w7dVtWr1uGqKJqBPHBdSd6nX6TLTfSLd3I/jy6OJtVRfYQ0oc4j1EvX7jhAqu02h8yyFmYudXHxqLhPpbxrw5EiaH/XganO66euYprf2ORfqItfa5zjiQmE8B2mD1A52V+jprVZVWlwe/s5KOjH3ZeU+EFFN42UuP0tapuIBkrkawjigoK2USESecbT/UrRAx0rq77Xu4jiTbUUTMSut5oIPks8r72fbSj5RwnoUxQs/NwhGPyGJNNk8kbaUkjPzKU/mTnwLuS2Rcxqja6EGwCOlgHlEJA6O0Yj2w9WMv6R1czQ89z2Ja1GIxosgWgnKKom/rqlfSWuM6h87z/SbfTbh7JN1pyqubGwo72NQqbz+Ijm/TJapnuT01wiYOp8xaSp3c+9RCaOituyUnhZRkX5gu65MnXS6b7Xn6fy4zrYRkZacQjt4mXqSAqOs04K5RtO5XGi6HlJoEhSH0azaUgKlSIXD0yBAoyyF0M5fZXPzHU5K+2csyzfoMZnWZQgxRbjkrnOoloNcfyenCGgW7ktx44c0bFl7RyS68c6Rr6NPrcvGRzVuOSg8lCu0zlYQvo6gXsR+MFT1+xERAIwdNAPAXGD0mDBIx5eTaXUqW/7KFfxsm6i93t8a9g/EHp0Mf0FzhmKKZLTjT45YhU5u2Da12sj4nn4LtgOxFekMnGO7DT9NDXirc/t2LzIMRzufD6tKXjExWb7DgKd2e5K/LKGKDEPyRRdvmGHacET63dF4yXFIzoEfel61ScDu3O3JNZjWxQA4RJ6f9+UushPutFr9xySMtDULnIke+Ro19mIslq94CGQDuGo1mYJcu7S7fjadTRpscrzbSYbsH/AFsSl+h8k68AAAAAQU5NRvYIAAAMAAAIAABRAABjAAAUAAADQUxQSG0CAAABkCMATGs3LCww4LQ5V6mkHSkMjwGn3ceN9HIgBmlh+dVC4ik9Q0Q4dNu2jhz4soPRZtdn2vsDM8+s994ZRWZfLBUAWklBDTxsrlmLWhDwOjZZC9KGQNKCTACDPoD/c0G1WiZ/1TexPPyGIunBcIGy3hkbUtSBOz6kZanQSsVNCyq+IOBms3pvOu+f9w3XMM6vLy5LaQAMrrEYuJAG9QnQp7lnDTfTrLpJnPA0vUicyzkR3GHJ1OXc+WY2MK5HUYT5XDtC3qxi1WkIiFBzJYuszn6agrf0WGxhpWdGqhC73IUma9+3fTymbCUjzKgdhygeyIZguGrlPL+dAaF9p9ozIAmG61FOZ8y94F2mkFibZkRJBHs2ImNa5MzLrrMkwvM+4hg9Zl5WGBo/wjNk0lbq9QuZZ3KdiKy9F+40cjhNcHFIJui6uO7MMpf26gwP9YQNR0cgA9KTjokccJhxMacXi8/Yh8ac+EczS7rnxwdDLofvlOm6xm5YJHYOpdNANCnzcWuR5AN8Ga5FsgiJIgOsaVCOtjBhhIB8mkI0210kW5DjRhHsGQBAY9E13jKNcYKznn2Z4oGbvMhcFiaap12QDvGXzHMn0Iok0UyC4yWe8WjZmvQ+I/ZNbzlYw8C9pcq39sb8/Wc1cksleRLTCje7slZwoSTUUnBrnuB7H+HTLI09kxFqjs+RkeevhNhaScFbRvpVzHrmqDaNORckh5YWK/qu1QydFOm7nyxq4JpmoUeFQlYoVKtPAP8TE2LXJ3jQJ9iqUMj/awhF4/+UTp+AQZ+wSb97QiI+7mlLklrW4q+frGtS9HTtZD1neTIAVlA4IGgGAADQHACdASpSAGQAPjEWikKiISEW3AUAIAMEsoBogvevLy0/UebHZu7XHF7Z56u3f52DTh96Hrx/7R4T+KP2DmpZA+nbUd7R/3HEHLC4UcEz4j3mfSs/23kk+oPYL/VrrO/sz7CP6uGB7/RHfFpVTND2PflkG+59ZQHmx7cEqQD/LvG/xEkessdMMXT7+dH/tNbvKz+T3Fz8FOBh7r0rNTE6RbidmmRemaQHi/6i7vITBJI0mVM/VXOvDVPzAEZjSd7HMIWw96y/GjMkE3JQaId3sJ8xks1Nx72ALhrgA2Ds+chdHPOyfbV0FsgVFQNvAAD+8XIP+sL/8wv/zC/28f/kefOj1U6d+V7/fstlwG7TRSJfhXWFggy0t39tYkGi8rdzi1FmdRZfpY7Q8Tv9RfpMOCch5uW3uqNOmMEw91YZzVn8ZniH98fgtNmxoNB9FbvGi1Jy7uMiD9m/D9TIbvIQ+slpsvncb1CUgXd12XhK22iiy0xJ0IDZ9i/n3vO0/m42aNZWd+2PWaSpsv2MMY+ItNsj26T5weo/WWoQGDgdF3cJddvNhM3OOsxGESfR+NFQaZ50dlZAbsIrRyg4on6eoMa7gLHaW05ZSORFTlVzJUhkZ9J9YDCuv7hKvfROq8l/dwK7wFDwIpPNn2LfhowobJcVC6f9keFrd+q3lzIAYQuwhZja0lUNdCKnhxqj+O1LbxMA1Z45S5kwLs1IlEEDQM5aLipBmATi4WgzuoImsVEzD/pd45Bt6AHR5O/w4udoDqWs9rTr5xF8cMt6xdKyIxwwYqZ2KKNOoB/US537FvzwYxQ3RdJ/tGbjagFbjCVKlfME0NxSaxeK1qc4MoQng+6dgmIoQrduuKxPJGbDGwZq+kvycr7SsfWcZYdLvmjNqanSkLU4iYfzNhwxZip8r/jI8FjbBxkPyKfN/aW4uBnZAEProHN1gHXu3PG+JxSEOUlXNypvIZHvXE0zEuWVCGM6QBDW4qjAqMPJbEzlZB0MuEIXX54ap95O2U3RdrDX6XJv4xQtZDGd/yzkUO/cZZGvpNtdsylDeIOuAs5EIgdOxGostSufQZMwIXQwQXaH9lZiPrFb7RNh0bGHX3V6g1eiubuTeSjNJ3B4hhyO+gbBhz+uRLcqF0HcVniJy0FYXb+dNy6nC0tWj2Xd7xMvzT3sN+coBj2cbzlETtV5/6qtlLmCPFZkUZwblp+0dooAquWdmyFU8jMpVx6Y9wJK/HdzzO6Nqh/IJuhkk/pCBe/gCBSkV1imRcP+lQRB/P6gD0KJRVuR5BImioNHMfLALU5iHrHy7rA8WJ1y+obi9e5SRobpp6EmFjD/y0q4/2n+Iuw4bqCV2dK+Z8PueCw0aQW0MNBFEt5/KaMCAw6HHKA8OMVducz6af+9V0217s5u0Ywgs5T+j5+4foc7Z3CIfgTnwuNkzoIcRZZbxDpDa4XTq0l9qi4TyLi5ndYiCunXwDun3ZppBkaa9bduNmCaUXG89CEjvOCvh86kZH8qL4MwbbgZXhTy/2l5miUjv/vlUeaKzYAMGXHvbuqCBcdhPDdFAgImDeK9VEhIQBZhP0X/RIDCw1kQuBPj4MiO8x05RtkrGJe+/nq4gdSoa/pDAYvnM+Hvllwh3lU1dNUQCWriqJP5WDxWEIDpctD8XLE0NQpuHoOE1PDubKTcrq7uN5uDW58LH7apdHh/k4ca7TU5vIL2ddtG1oYf2kvjeMToARgs9Gwu0kAeM/xpiEFRuVrN8RLUX4XDmejOtn125F8vEGa1O90zI6LWxVMCs/sZB0I663Jmn4H2jQ1yPloQWmgjP6TIW4n+g92llCgfRrddZM1HSZdi3aYf9Gp9fbG+GtMBMW5cmoD28XhJ9Bne866InyoQ7jc0Zst55A8kAl/LWcJFdr3yiVXxi6DH+f/npYHxQsseOfQsX0h9mRixC+SoBY9Ho0jAL4cACwgBTmSkZ6ML5HiO6024nJiHChE8KG2Pt7f9blgyBsT4fL16gFo/GHX6XjKs+i6LVkfz/f/v/nWxvtO66gO92yyZ79DCaFNpofreHV/j2b8Xt+LV3Eeb7t8XFxUjnDGk8Xj6YT/J/uA5125jfxyAY6GDLzORL4dnXHrsP94uWWmj1GaAk3JSxym7sitpK87Mfbb2Ee6aEfhEh0TieETwhPcRX/wpnfVIH4gAAEFOTUYCCQAADAAACAAAUAAAYgAAFAAAA0FMUEiDAgAAAZAjAFBiOzQ0UBB7da6ixKXKVZQCin2x+3wjdh+nYCJEiL3ZGXa+dRHhwG0bR3JgeK/lsiVl5glqlBnrY4zBGSXFzNva+l+DMp0TAlv7pqVDE74hCEKQEIITh2qPJchaHJIQ6iywhBzY0FoKtLU+BudC3tIS8CbGXGvrHaD35heDg061vEBvM9aFGHOnWxrqz/oYp1Kh86y4Ue+Eqfy7QZgtLXqr4yZBrrcNiJFr0PtYGURR4oezg+d6z328Zc3jdl8Azctgq22MpFF3q0zJ24TK0t5h9V8pcgWVRQiEDn69scUzeRbmr4POaPnk/2Fb/xcFesNPVEIGeSysxPe+pU3aSuE5FqlvKAhSHJfb5l+cM4NFQkfdMZIIVIoKcGqIXIM5zqP5hI5pRBlDNSHRn8jINTCKKkNoCoJV3cSkFF9coVLZigH3RRTwuHf8itFQcJAlaxLhmiJiutyw9J6XuYj01gzJk0rCf8mVc98YVKETwRUHKBlZFhLqiys6o6QDVpnma+NezYpvCBlod2ET65kiPl/hDZY17boiYMLOGYtgy7DqT/ovjl9Qa4maUklLp1lgSflP7jlrSaVer2DYiJJQMBq5jxk6GQyBa9Qx0oWpNNY8QZaWPc2vC0S/+LKVKJA9rYv7AuxRhbiGufYuOb3EzNJqTp4aL+MhCMzPrF5wKQQVZo7WIz+jFK1Wc3DWbfcuYwPBb21eUbP9q8nYJtLYDb53p4nYyCL3HinQ+BQgbdekWikIjMohYIWexGz6FnE7T2qS90GS9wE6gR/GKQVOXEr1cJim1IFYl46EKeUPwJZrirwPpiNnyz2MUypIq0slGSXmZam15uCUIDPWjlp9KABWUDggXgYAAHAfAJ0BKlEAYwA+MRaKQqIhIRZ6XRwgAwSygGk25m/PC39j5tFu7VQa3sxnceUB0Tudo9G/989LfqU951/wFfx/YfCPxK+3JKrbPqKdreGXfHLjwAflH9T4mOOX/XeJmdV/w/JP9QewN/Mv7B1tf1V9hn9eSu4l8ukNOMgqHxC7PzH1aqgWntOrrb6ERXAcEOOeYXQCzXDj8Pb1Nbf+dH/tKx1+jJNHvgB8o/LDnRtHmQb5tcd+9of19a7DvoSDZ6dXcc/vug3QmcIVkUDxPOmCFKvm+wPjAUA+Sdwx1NVRn2STNob2uQ6E8OspMhx9DQ1Rg8jmjDFLmHioKng9Zk5F9IUAAP7xcg/6wl/zCX/MJfgvf/I6+crqj3aJnqb3XFenPrZe3Oyia/xgda6NpMJlPa/d+LT1538zG7WrTSHrGGyjjAjDe0g+WnLhNW4yzjcEkHujdgfFof63CNp++5DjX1iVjy7RxFdaVg6xg/2lkNxeCUTPxJkMRuBy4tMDJBZ6JcCs9+v499Wkfm42aVsuyMWQ3sb0UAu65fUqChC/IqHJbFhLxSOoUqjLPkrU9TfofW+iwWBLgCNDQ+jJBD/6U5a8gxzkvoh/IUEjXVG0aEvKXFqBiYxA01y7AMAV3KBuLJCy/4iifYMx5wfS4Obu6ZWggxK/9ep0a0uqgHb5UFVvaakOSIy+BzZTvzmdlucBErMVQpZCqKz0aYbFpIwYZFBkpSzdNbSL9dDChsa5HLFab1NujjqkhTxSWmdSzzbI4rdxTO0dpStF/qw2Y/4yKzWKXs80qicKCKm6R3X+0eftnt6UGAJxLD+nDMLRIdyZkm2T6KCYi0xyFXiS4J4s+vY5FCQpm7hg3vGBTN4FCo/NaeOjjbKXKSyfD2NeZBPrnR9EVErRX4a+sQztQ+vzyPm/n7LoTRYem1I/ElI/mUfOv8oEapOyMuTRNhiiQHip1D9sZD8zkJBPp2yaXJWl7K8m8VcH2Bw3DwbzZuGKOlS2rhgbVlxtZSqEuMfUNub3eFtM9RfZ7lo+v+G7iFg0X0LRxMPiF2wqIUtdYN0526RsMXGxgys2DuSH8hqefQi/VMGi8gbjoIzx45zBE6L1bEiIGkAQ5303YFN+oS4g9IcFMAMMMeTRyhf5tn1Rr05MZ8L+QB/DJGBe9RLCO92hxYO8LMzmPBO9DSUkP5b2LnaC0gjtQE8H8qiVh2k07sBbnEQt412EKYHB10hpaxpXObyCHh9wNgYJEXpBJOyqI5gmEcFgs2I1byb6WxJEB8G0D/qc0FG+7OCu4xtkxPpapakDrA6OS2i1y+wrw/dlocc4thXa8Ge3SZ9e9poEgRH5GSSganz8MRCt1l7fQPeLUTj2qKBX/CU77vn1hIlWXw/N54bXT4kR1z4YxOvmsPuoUV8EvxxCkFWdbYW5hFf7ps9lLwcJbbtXGqdl8JmVeDvy82Zrf/psuvEZXfHROXzZGebY6rJRH9IX6ZpXLrkrZXs/jEdFY5Gl/hqaZAtWIS8sjXg4dXEplAahdlNsytNHDT/kWSNI8qH5487hD8ko/LDYJr3+X4sjSJWh4HlN5HBIQMl6i1SYdAE0NrMknHq1Ao8irprj0Kt0X3vGhhNoczm0GBBuoPFTRtra1xfKg5n4sJ9c4s8lI2f3XiQASIEtcapbFSKfJSKtRWqjyMrgOko4mTnOFHVgjlzaIP5RPEeR8PVhLasrxElcZh1jDz6st1qXyJj+6SpqV065R8ZL0N+EzSX91O2xZpZ3/art1sQemOMkG2OP9i3yYE51MWYynegQr5wVT0Bxhfmv8A3fzRgeQDVJJTpWi7Igr31D+e4CgXugHlyh0Bn5EBsa1x/tfxgnFY2YEeZPowDX3VOkdOSfPrzXfb+msvixwe9odlZF/RYw5o/stBOrMieeqGaImmLc6bAuq5EiFJ1q8/bao3Hr4K0bRbhedvNdWVMNNzYn4ilOOAaEVgADBjlDCUv/7fUwRQRufQp9BCx36rrU0BY3cwvXwf33iBrGzP4zhDT1GL4wxTjBja2vbj4VgDJt0hvuVQgT0GnbqGz3tEzgtEkmRFA8ZjR/U/LOkWftsnfKdEL2BMt2DNDQAKiYWNvDfuDUqbocxilQ+4k//gUHU3Dx0vgWuDQb4wnu41Mi6LbG/juXFGsxCVEAAABBTk1G+AgAAAwAAAcAAE8AAGMAABQAAANBTFBIeQIAAAGQIwBQIkkknEBAdPoa5Vwi/coQNAFz9hpd4+xBSgAn47ZFFV1rWUQ4kCQ1bkZFNoeM8SWQ8gNxUJvUxnWdM4qNbeUyX7WSguWBzvP97bviRmD34o99OB7Y0X6K4YEHNOuTBlFywwseBG6oVEFqba5IadxAMnjM37iuizmX/zGW+cgyYDSHW+xBlDauG4LRw7QVpbXtupBymddaP2LX/jJ8NnqWO7Vz0b8Y4LZkImp7Pp83FS7WMFH4eevm6R6akwzd2gvdew/Su4dRTsGHAknvdleryv2STC/eR/XUZRJd7hSSPQaCSutKtolY2Mq3UYV8LoOVbF0crlOE7c6puyl6aMDNlwtwVhtlW7VdsXUkEqy/Iiq1mkIZjeRW5c7B5GePiVlGitwdgWxJElmD5SMkJO/bSmAIIA3EVg3B6FECI6aLiliTEfQFPjRkUdvoUUVnLFSRW7UdwqBue4eugALkvWJIokfkFfzDfqdUrAbNF3Y0Uolgwo6QEKSOJ4ybwwg+gVTx4A7xjJ4XcJ5MFVMAo4RY4GtBFRnxJgKycLCE6JLZ/5CXvKXaJVmPmFRWQ7LeGY0Yia90cd4IGZssaij7jVLJ4SWiizxpfCIUsVkLpIySx743LtKKnS0pUFKixb6zIZGydQoOFa58643Er0BRqpvorUJHKwjNEX7TPc3CTNkfeoEYtvwNeZOMUrDabDOZfQ6A62MSj8UyCZ3TAJZezKbvWTPBcVs9EgZMptyWyzwTVGKzGnp4bUgYoUeWX8dDCgmWI/w6HtM2VIkbIhx6Gzp2mHKUb3hCyNUyssvV/vDM1Vkz65g6yaXjIObyP3nD60/xK808CABWUDggXgYAABAfAJ0BKlAAZAA+MRSIQqIhIRmZ7EggAwSxgGkYtn+A7E6jfiPNUuPWlak84p/b0heYB/iuhBzp3/A9Xv+E31fegv85X5H3PwV8antbM0yb2lfyH72fsPJ7vr+C2UTeAs2cTmll0APzt6qn+H5Hvzj/PewL/MP7P1ov239jH9WjYpw5Lv/c+HqKQxxosUJRXSrU6cXlM+XA5XIjI3V8DBb4B6XDIRUT9K0N7tbSehuLRwaSgvtp1d9Phr1A/3/luAZQAQlZ1jGM4aBvP6Wa9j90JgLQXzm9xTt581cEOzY/d2+DOs8JBp5WlHYHLgVIx4IGDgmvP4LPJcBlm7I59HbgAP7yRK+u5/67n/ruf5Af5k73SdX+5hm3IuxO3fmvm8/US85aQTt9VUvfGx4TWV7TFJ+Al7ii3yzrcb/T7OugWgOApEZKcl+qxwwNxz6u4EyIHL7vPKip55OypMiUsJ4HheL3WxmTiL0IcjVl3kLvT0dQwuju/MNSDwMVrZwuGAAj7mdKjTzFJTaNL/coakGBmZ5FNe/u8gQSwrpdbrklPcd8T8kh3uZlo7yJVrKTrl3UeaMapqK1Kq+aQyIDCdHk+v1i4fF/wm8PbluFAXi6yAtJ6tMvixw0yl+65O0NzbvGC/aNc0Nj+f4h9ZAG6MkKpcj6PNJV3g/whRmyc6WdMWG8OQBUTQtOJGaMLDsCnoci1+HhhAovQ7gYTeNmizQ3sPTXR8cfgXlOUW6TcnlXb5SnyJlu107nNj7mrhVoq7kupqoOPKavkyZuLUOYcmQ1WcRSX1zM2/APcvnF1T5uAsxqXykVQco0WcxlMK98MK6NvqJmMxyAP617GLCob4rf8U918RuPoS5ZGeUZEXkYWm10IcGarf+sFC56Wdz3Y40k0VFeY3tFYs+k4N2N271Jv0vPq6+pmDBl/q/nzhxvrur6MPDo470MTcWiIc2euq3zVmcX1p/e5/TiwX7pE/wS8oguxLHMVlhk9VSP7C5TbqokvkBMHzIMvnxflntlh4WaoV97/IFatVSFp9pvKcASaUqoK6CEGEFjT+hE8yUuA02l7uKwrWOHv9dzZrCHylcrsdHszMWqFNnOxWKvfqqEfLI4KUxLo8XvzN7FUv6a3dQLG+PTH1BQq9KkJOsZRLGJApHUQNEXe2n3ml98XQ+H5xXv5mLxP1/U5LavL4DScrkdvsM3ZSIQMBXAfC0kxEqDLkniTE9UskKLAtCbpDldyZMI98clS1Ae4/cqTmPzEmxnDzTbmEKqccSmJL5DvkTqcxiYZcwq5z/5Ste0oImKm+ws8dk4f3X/4zuOyVUxNjOCoZGQelJN/KrkfTbwlRpCgYnHbWHPz/nbnUltGMgFywkllbT1HacYovFoaUAcjRW1+F/wte3XUW3+MRL9NB5ZqJ1ljHaLi+936qiD6o/fb+Y+nUf1UccEKHdMVR3ITvgEDkpLC9Nl0qqIfLEDFQFtaBDMnwdarldOzHYgVEcx641/T5PKvnMUTx+nhYPO37DzgU/6K3F0n3MmC+g5pCT0ysG/0xF4YGn/KZSmmw2dGhO79Tkea60u5IaAlcgrIOs29L/mTVxc78D0xDkvXXF8qUOXSQCuN2BT9uxqD8lrzQBB9tzKHqSRzqaI0uknUK0t3kB3gWcj14PBEO+AzdkrveHPBIN/7Zb68nffBiaQfiwdaAh6nKV38CqZe2fBamKS/rDYf4dXJ8F1J0M8gsnmMRbCGlwmZJViIJJCS/541KztNhUHaCUcs95jl+jxDVHv48d3PYoBS60BjMjTb/5/cz4b2aY/a8PWunhtruW1kswN28+K6ZmjMlmJcwIzO9/luGP/7gOcMGaRq987D4kS7YKPGo+jL7wBXzT957XVLGf4c4PmgLPmMCFmTRNlweD6kwFWlrmKDZ76pb17M4pXdDlwf51Qqblaskw/gZw6ZfXtLr0gh8tR3MAAAAcm5QZ0MRvL1iJNZkM4fJl7a+4FvccHGTW5DSi7fNpXQ3QCfF62h2lMVgfDn2anu1Rf2mn7yGKd0yZs/s6XOyDKzPY9odt40emfyw1N8A5L99bnsW2VrKbkt3zOBKh1G5FB0ymecmPzWsd8KACgkiOU7UQ3/GZUgGUnzwnptieJP8qAGbPhK+nUwxQRYCSbVbKANNsMdMpSKiaYTwQAAABBTk1G3AgAAA0AAAcAAEoAAGIAABQAAAJBTFBIdwIAAAGQo21bqjk0NJyCamaSrEaJ22qUCAUnLqsZo85ulAIiRH7/eJFfyoiAKNlq3eYQJ2l7i19cjP0JrE5w9XwRWg6cNY/HabIUMRy2f5nJaoRh54E7Ai9aMwQCyzrC7FTojoiyOSrtUNZnhrY+HwaptWRc3hdt+WSeuxDiZOKti/9Ni4Y0TjLRpD0tH8Pnz12CSapmvhDipCwcr2CF8nwVTSf9pF4Ui8XRBKGV2EwgGomvx6pMbKmoLl52IKrRg/nhBKFVSd9I9dZWLlaxjtZbo8disXB1lhsiUxVeVs+Q8l3XUuLqnvgYs6hEiUs94VzmEKR7IbvF3JWIpacXIbQxd6lDsBfynUNT4jJRVNlLeLiXMpSJ+SG9XGd53mTObl5c4Il0A5gG3JjpsoAY98QhB0rJWOQKLDwlhj1xJBjAGw81WUOJ0QwO28YxQGUiIyI22ezACY3nqFzgwK4JT+SyIychnIt0lRSIpQeyA7no/8T2MUpAdMhB/Bt0hDK5q6fJZQexhr5KgmKRq2Qn4Hl1dIDPoV5i6Ox4s/sY6ZaBi1Uis+OkTGXhYu6I7JVacFQMFxMfh7zWZGhYgZg7KDtjQsOToS4Snzfz0ILl0NVGOV1jMLMwYUCvH9Gdhx+N2AhzyKF9Td5Ijn6Dc0RvgRPAlPdWCVb1WwpOS3BLBT5xisOE/c2oFo+B7v8Hvo01/4bWeqNbM7DWYxe3sXqlqG6kDm6u5eflohpC7Vv+gqJa0MeDiI0Gdy0paN6Od0QYNgq6J2Qk6ChVUjuRNzq12U7kja1nM+F7Kmi7U9lMpa68seH4fb6D/r0yD3sjWAcvZX1wWrJOQlQcpRkAVlA4IEQGAAAQIACdASpLAGMAPjEUiUKiISEZKs0QIAMEsoBofe89x81Sz9kLpzzvBkvMA/y/RQ51X/gep3/IdFv7JvoX9Lz/n69f/FeEfiO+AZbuDvpz1F/kP34/c8O/wf1AvYW7ogA6rXWDvRvFV8N+gB+e/VV/wvJt9P+wJ/Lf7b6QHsq9Ev9tDY27o9xY7WEsrSkpIevMSnxiJBVNxGZv/fr4+jX2nsEUapqpI9Ie2yGB6ZyXOpjKED4AQ//ceDIm10vKt7jTt85vRrw/MFeN33NGe1pAwiwatVTNfyNov8p6wELJicifSrTr3qNUwUp9RjK+ldyztbH+sVzbwWbgylGDhxvhQ1r1P9D2b5AAAP7yRK//rvP/O8/87z9yv//mUnrJ7rd0H73TkfE2+suaBTT1w/pUlUCSEZflMXHlKgMAIa6rJTjvm0+QwXJZzXcbCrsFCdyoo7C6H9sNRenroVCsVmxqkV+TzOEFXS8OhCOshEQV9vOGm4QV80mGzvkBjBSKJNJQ/d3H2hCsqHb8HbydcTtF/8tlZ9MDl5zXcvGFx8N9zzOFojzO1IJymChtQ1+8CpVwmgT+qB4qj4FS5mHAyz2eMxm2qMo5Js7w4ymgWAMxDTJFGgQsM+1zWmvScNlSNw5HHtJlNnrzFbLF8h17ycliLlc2Uf7f9SWnnZVBcwD9JNVNhI+5w6HFahXDd1e/H5rNH7P450z4ERlUDW51j8pp2GYyk6YZLzexXEof0l9RgWWjoUtylV65VS+VVSCI10hRoNWRr85ELOHz7qEBXkvEES3wkauhmnn+QPkriSenp86/TfB58gD6fV3/1nU7g1N3INbrnYlSSfHReNzZFK+Y7fjs1r4erkf9meN97vqUdNq8ncCCGBjfv8ix+vfZj5C2sRFAXW12Kk/fSzvADa0nYoM17Ocg6Bwc0a+0FcOqIJErRvB8uWQbb6+Ad97VRtfEzAV64u6VTVEYea8Qt9igfgdcBWn4/lQwQcImS9GYIY1pKjCZU7GGor4PEIAUeLCyGrNm0yTHrA3hk+7TnYT4ygZmEiTeC/qv2yX3oAuI6ZwboL+14LpM8Zg8wtTit4gRfkBNhNzI+l4sVzcSXz7Lg2FgWJoGIomnAhpNxBAskLdKJXDDGeYkPb24kzxbppbYXDXUqbNOqcQGnJs8M+JCrM9IuKmRVZTw2loNFNSuaL1nbpNy6/pbMk1cDvPrB6peLZ6uXQswcCvoPTtf6F7p0euyhI49cQp9pzg2XF7gEHs2GfrRj1LVViqocRfWY3Wj6NHGYZUW0xmpCaw337RiO4UCPE6vN+2YgrwOXsrn+GfztTmkuQu0cMMSKgkuVsnPAAp2sDWf65hwvQ/lJ7VznxNQP0zAQV4yALvozp0ULctEyJ8WWwhmfFNU90bLMJgBrW1+ZwyCtG67mkMSQ5W5vs1noHb0gGbmVtB7fhybxEGP4n7+r3jqUyDTxzwM2FghDefqmVx7TrXRAGssJUs36XDAsGYFdBLzjfjOx7M/P35sePkhEloD9sw25dMECruLy9m6QId/nW/NasZp4j5QS8WHx7VhxMYAG5cCsL7MLUj9G0eyvNmsttgQQ36KLdntNNSUuJdjeEOhfp20D7rwYBTdY0YrCqN/4JJ435n3C3OtzL8L56YYXx8Z2zlBqrNvliV8sYcN2TD8eP7gGKFGbsMVn8xRb79rAwp2YcjfhZlYHgx4In0rB6K3RzBWpr1Mjx8R7i50qJjh2BKnrNLcHfAt4PhBRuHeIF+gq0ekvInTFcPQPRYlOp/qb95O3txOVyqQyKRn1hbmUcWW5VDqGRObdk1oFXGjqv1TOdicjSq47VLJM52Dg+uMQJhJfNtXxbc8fViKqcE8mv3Wdy5Zeisdlebc38irsSxfiEGq5roAxoYkVOpX4Zb0RWLZQAAFYUno4gzLPSK5VhP9veLlnaknCDReCHDYA4YD69s7yNbw4EECPEeB0L9rckUrQIOVu/Vbih9CIrB5WSh5aNcnuQ6ze1iLugZWrU35/5jExTtBfDJ5L8D3uPa862vu0MoSPSNF3En18N/6b8xzgWdnnrdfrJnUV2eDyvPglet9n/wulnxudS6dfeGYCl2uoPWvdiF4QNBGW+ti4v5Jj8p6YgAAAEFOTUbeCAAADQAABgAASgAAZAAAFAAAA0FMUEhtAgAAAQ+hoG0jN/iRGiC/V0REUSLf4CcErRIJy6CQJABs2zYEiSS0U4ryUJgOcPz/lxkAOLovEf2HKElShWZOTU7J8dwDyR+YUWbdu4FZwGCj/G5p8zAdl9snq18WosVfCVgWIjDP6qcTGbL7k4LsdHaGffrT0lIi+50SFqLgSjw65/y2BTTg/NMMfGWcknOu7xLZU65p+K4Azl2a1rIbGQ/DtqWcq8TgpGk/xStNaUPliz96441MKnA02ea558ox2/UfPl3DtamNYJTqYhtroYtTGUyX0JDaYApOr6sUzp1b12sM+Fj6gyINm2FI3UHty8BZCZzQBtRVJb5XKaMh5w6Q1yXmkrmi18yOpOh2y+vFmid0FxW7OHIFe+silLrcvjIDE+XNIXTWVU7ytnSTF7AlTmh9dUUjkq+Kcdz1LhxSoY6X7IzC7XkvWUUrvxV2oWhcfV2FWexR+5eym526rno2fUTNBl+9Wl4HcKhiBdWxY+fTrFhIsThu4jLRCw1JLKSY0HyV50ObSuBQFOqJRVb3jSuq6jpAyTc+/7CuGNSLhfjeKmOp3CKnilak9BlUWbJEpRtE6rlvJ+blqRaar3whXi8X/eatFxocykI2UtVvuB1CQ1IW6jms8q64DLb8ZnQadWQha1RuvcPnw65z1gyibKozO+19NyigOpLVnAKCmKlzTgFNnz0UOW6KXnUXBP0XRHAm4TPaA866BMKDraumgF3froe+W59n3knBXZLEAfOvDRa5hsCyEJAmI8u+pNdFsCEgxIWubMz/QcJKYFkIl//bYGkhzFY/HhGPFf4ZCT7VVpMHs4SBjx7ML98MAFZQOCBQBgAAEBwAnQEqSwBlAD4xFIlCoiEhGKr1ACADBLKAaCPmfivNPtjZiD5QqfKM6IHmY81n0b+eB1IG8zf4nBGuw/vh8NfwCSOcT/FPwD+74V9rveSQAbsOlx+M+gj1Wf8HyJfm/+k9gj+Yf2b0meoi/Y0z5IO8dnRVv+wsTTR64EDlvTEyfr/1pPcZMmO6OLSfL/tppzPkVA9Hr8BCtffo66Tje8nSOmmpnALESkqptqbTHmvZUIW0GPjH6y8JP6Wbtx80do4lzGARYjaQ3cRIiKy0lzeYjMI2+VSGCkyxy0JA1b7mzfSdG+B7tEAA/vJEr/+u6f87p/zun4jX/+ZPe6b1g6/P8JkkD8e8BMWerMfc1OqR7okXa7S7WkJeAY+WfBG0VJ9ES9EGba6YGZSya1ObwVFDft8xvwa2oLSaG8G7xtX75o7mbim+7w63E2OzBW2cBg9ViD7tlEoSVMZdVATtXalrL5dvXGpnhI2Da2HxQWuJJOJ9bZwkCQ6b0XB/C9w0NI0ndEOfdM/ueQblPi/bGASb65Qz2U2KRYP7nt7cnJso58ZMAFPS78/KBXqU13KzLMNjVHUHZuzIYPOndDiRnZafghwFV0rW26mdpsgu2KNC2odkQyuYFhLvBxM3f7VbqScqtljf8f1erolWXNcrRRvFW3imm4Undhy+fkIKV5zvAJaLlKjEQcFLp8ogzwf4bLuLbZOOri8lil/IIg6rGJWUDF1yhszbiNmcWQ9LnJ/eabMKjyYxXRDfi1wxNY0p2DBXgobd7G7IoIyHafK48Te7tGLBXOkL0skXlxNPuI4TyYRbciu3Sgm6IXAbEN9MwP5c9Y090yi8RzI/JCJNAEl5gcKsZqmX3rTf0c61QaaaaET/Rfwgs70hbTyHcMYbO0iLr+x87ELOFvS5ik1gdFxFvt/p8sUzVSBgWbtNMm8gVxvT0kiIA/jPvPND790hc8w+XLpJNTvXIVtIVK3P7rVd39rD8k5M7jEy+I0Hiju/xBAb7Vol0yGNe5ry40i0def3CctjaO/oXYntlZCprKjugDN4Rj1vJhxcN1IdtuHADBN2iiEChMrL7pdxDdsRssuNbcbdOKtz65U55SY2gspqT0oZBz7fiWXQVfUx+qQ8/qjFZSG/d9oRleYVUymPNVliBB3L243Ux2FOdgmQ9E8H/UzKwv4fKyFp9f8Vloz42ulm3dKcG8OdT8O/EvScrHXnVIb6yMqFAbSsQ8WG40B7gtncqyZprlxIbU1ZqRUOC01cE1veLMoyDQPv//RjqBErNyHOcSvTvXwaqqpupNl/0LEyQCE+r1C7/cQvcnRGA7XnoA6WaLrxPOvLGNLHQhO7gvorkS70vpimcn/DNMwfRoGQG3X8ap3lOZAmX0PKadDGwRQqZimGdPCLAoGgw9J+DLMnL0co3kVPqlLqt4APL4QQk8qjVIhb2Lceh8s9WABtYXKyTOadGamENnJa3D+swqGcvL0xciYXnO+PsWyXRbq5B8q2xhbzTI99bLBm+paKfk1cQnxiIoZaxD22KTjYKMf9IZcMRHrX3JpLGpVP1typGzOQzAF6Y6HHYsHolv0ankE+geOBNzO9vpriRKI1Ya76HZJDZ343ytvMvtjFgPiA4Br5Sx0wgzj2HNa3TAp6vPfsXk8wLGzPb6d9gzTUt9NnfmMu+LWP6XrPOSPtBbF3m7k4pe0Sy3Zsc27n36aONnL7YhFjUOUr2Szd6PCJScF3pTT9nnZJxD8pr2xbPGk5/v1mwHQq+xabTTp0tUSvlNOfrVzhJiseflquCmCgoiDPntzqwFy4vyFOmkKKWse00ErOE3bLkDUssJ479vw+sN84VCEwU+VgHJBmKYFs8MuTcGNfHSMauTZvfHlAQUeJkhMav4KiDCKzJH87AbmVSQcsr+Rh4NsRT2bEFTiHfC/KYWTGHCrWQqoIUCWmy26rFPIa2NHe/Fn8oErvRwAD5fggeXsdvjIjudM1qWMcfREW18NjCkOT4zgQjKpB4UTrQNvitrv4U1YU/Qvev1rznOqPUGHQY+69LRvDM7ePzIxmoOQ5v1wYLYYcVsBpNBtwAxH/ev9D7f6cn3W/v/PwYdd+SRHB68pCzUlC2uv0c1dOxncyE/Bbr5facAK/JAPI3z8A+lBGbQAAAABBTk1GoAgAAA4AAAUAAEIAAGIAABQAAAJBTFBIYgIAAAHnoKBtIzd2UQeZnxERk+CwYj7GZOGsGhNAEgC0baORQVIZp65aScX/f2gGAqGOY0T/IbiRpEiKWrpSDhe17gfup5iPsCxLOkRvyFul/W6t5jdvBu6vVuNPZp2AUBiymTtWBnT/CZIZh/ZKO5iRpkiKv4js7ZggHH3uErxpRN8iLMtaMsS7BSOo0ssB7vYVRtX7eEg32js2LEVCfGoWuda2KyypPGkttdIutiFx4bddaUOiE2gYNcp9eRcwXIj7QEtiXxsJqrLIWHilB7bCQ9mH0g5WoUhsoiSjUPyEeGqM0CgUkX/U2ZuEIgF/fjWqQpFI9fCTXOh5H8K2vpOEEjptNWlCMQfnXdolrL1ZCRWh2ODpkShyaRUK/SY4QZRmtEIIHd/zdKjIAyCRMOS+z4WiyMZYRUKU1I5YhVvKhdB43yvCLftChe8p6jTFLXFCjc/JwpG4y+oKD4X3iTKVv1ah0G8dnxJBEqIgo1BYvSVJgNypyHz9LTsXJhRi36fcl0wIjW9IWtrChF/hhCHzPn39/j4LllfoktTn403abkTCJPT5rZK06QluTo0hy3xA+tYbK3c10CQ+h5oBoCssi2dOE90AqLCXB7kSFXx6KGGrd9uCmpYRQnf5D4EbSWP0yp7e1nQYPmtfWu/pgbOwK7F8BJMVwwE5Gpq83cL+3S7OxI7FfB/uwr1pM5H1qs7N2y2H7VdwB/Zv+MmL2UObAJ8nwOFUZD8B6H55fLZEMrRMQDtMQI2/PYfGD8jWtW6dIin+A6z2Rd+F8mckhd8mSAoXNnp6X2z/D3NtTzOksQGMlDlWUDggHgYAALAcAJ0BKkMAYwA+MRSIQqIhIRkrnAAgAwSygGmOR4HX5vzXrk1zZCHWdnf9F+3F8x/mq+g/eQvQl6Xb/RV+7id5i/aftl6iGNecXjNZUzvtwFZTawF6Lxysy/+9+qh/cf93zSfmH+a9gf9XOs9+4HsV/sQcQ4kH7JIJDXZr5H3Kwh2dHxTCTtqbn7vof7D6iHe5tdUGSeZ6fkW7qQexqSFtXXdguZxHC9piALKSXkdwUG3HUMYz0X3FJWtRqmEPw3rDNizuGEj0W5HFh0bazZ1ln+U7mzY3+UteC5pHZcyzsBYEvM80cOdhkR8cLAAA/vJEr//Xev+d6/53r8EH//MpfIzyM455ftOO7VmpCWohCL0YT4F93yDj64cGZDMd/KyAfdnv4jaEbrv9okR1LdfFgy0CB6VLxpGScD16x2EnTgs/1aoqHv4MyfHrM4FtAtLlv3X5hg/TAmPFmLUPEJ78oclJ3unacCGVbRgCC7b1vOC/1Z+pDlWOdtHyvrlK4/w/VnjXi+dxQRc/fyP7xmaR4JIJ3aAmodvrlfwU5kYbNoUWwvvrorLGH2NGccmz+8ElWOoK+2WkDQ2HkqA6SRANqR8q1+hssMm/u0SGVQQ/G52Chb5NPOzLBEDMnPcM52RYmxuNq+p8j82KMcldJJbuaV09sraQjvfBevgY9kikRwHkk0XzB/kE3E16+F6tvy+MVnE3UdcuHYvgIhr67auseylleZz3owaMUovQ6FecBEhmquTNm90My9EFieJ0PGnYMv/hPK/2x7WdLwEiSKZdqPHgPHFPPkoWcg5wWSBAFW+Hl8skJoYx9uM69A68w6VI6jbe8yStlE5Uo5vdaTJdOWlJP70fuBi9rRSJ8oqnZhf12P+ymp3a/V7H8ubugBrMZnMW2JOssV3XVmzSwNAwJhWx5geSFsUUtGR487MxjBrPvkKyusuwc/NDB5krreERHCdLp16hNWfeiw6K8HZAKbQ4mzUzMLvzHppSw3JfcADUe9tZ1v3imqD0w/6MkXH4wvyPpDHjeRQbdb+K1+NpP4cNKICspWmyJy+G65NbGFagQya+BQIg6P9b6ZJzgDlT4PU13QvUL4MPVl4V5gJnZ74YQeDHcbxCX6yzftmZqz5JNx/GmEPOC48n9FgoNJwTmm21P2bw3xrUFuy8L88BxwrtKqB688Aip455lgMIIocg3JFnt63ey0ylPz0+PcHN89yq+BmY6pmxtCNzHG1Djyn5FAL/H0YkpuoUXQM3O9Ykg/Pjpk/u8bcVxF4J69Llk1K3fs4IS3PiJoyGp7/UiA4o0+qkl/FCg7BGrKjew1HgEfAfeGHa0uAS+bYpc10kGKLEVqSyRpquLlY5Zk3vhr/ptN9e63CUK/LGtOih7/hmVX6141CPOihZJO/AHcK+5JIQ5jC4AewPTdqBk87C8hHXLz2Um3n6BrwGANk0XJGHe8kgOHdQ1gnMK5/039q6roNwp52FhUDQ1wGEICRySgisJ3HBgkW5kRE3zpR2FoSzOri+n0nsTmo3+wFThbQC8KAkc7zoPembdmnXELtVBo0mGv7ffIshEqVO73GFDIMLMR+ikXQHUOEI7l3IGjubWJYHoD9J6IPT1uN+4/Tgl7lq5gJLMzj77IxXN7hKuY7zu9LPhbvQQmNNk/uRkl4ZX3uBjII3bhdvTF0yUU4Umjo0TWJz1bPcnw+3p+R7kWcS7G6CKZp1aSPvoZ/VeouuUnQd8a01TrY+Eems13pvNA7qpcKEdQIEmRKNsz3E4ZyXCxYK9Zt3qKgqxdPfdv/fdhKRbhaAYOGtJWLH54VZ+meIW0vJLcSTdHM2YAztafWLvuppoy3uexQGUZeICcsf8KNOUKmX99v3alBouzvntB8ucAAAAx6s2YHhxfv73sgeJZUqjjrCnV/nGqaI2CzOAsDVVglzpZBZuIYu3h1Pi3YjWEfw2wQLwrhYOSeO/hMMAn3Q1smgLrK6+tL/l4fQxBhJlc8u6uiyGXAAC7VPtrHMtfgUTWCPdk3vATVddH7pueDEBAQp3E4lhMkjy2Or+6c/b04hr8Dn2rkce/HXT7P7QFsX9f7BoAAAAEFOTUYoCAAADgAABQAAQgAAYgAAFAAAA0FMUEhTAgAAAZAjAExbO1pYeIUp9TSVwe9AaQxmcI5USZtzlc6AFlJ+s4WESBkjwoEjSY3TsBoHkrldgp8AfZKfV8nvLKglm89WqZbs1diVs22Kf3l83VK9GpHQsvufIBktTBrCo/9FhAFAp4bDAdwxnDUwVtej8XaY55SXeZ6Ds11ZzqhMDuFTn2x2u52fFzxrpF5rlt3t3NVUlVLqmSBFEVMuhfjJSrjVXqNMPNPH5X4oao91z2M/yk6wNOrja1f42hU1RaRWLS1N7hqRg5ZG2BWZQ9oe3wcasTcj93sHNotwmSLfCs8q9+kvBEKtp6tNhxtMccsi1GS4RCDJVqZ+temwStKUnVghMEsCBAqJom+uNo3BOmTjkV7EmjRmfVcIBCGVHT/IFqCpvhlSLZXUpMOCr8nyqb41xtjW5rQ45K9MkYCvZnuQ6IFE+TWTEWBJfW4kRFjD2n5iswtBW825Kjs6pOg5EbSFs4GWTzOVhFewCUfriXgsp9qVyNqep1wl27fNBBz1jeusoOJc149k6zWBVnah5o5lfMLfOTrDcGf00n0MPzsijNxDRwbVc46TR96rKDni2hfbLmTgdHU2FeaaJ/p8xDNhDjF621h0PnQ09hHLhUuqqt1Jq/cfKxUsalcOeuFRuMw2eWE17oD6Bg71DcIABnEAM4lhuiWT1bsOt1Yd3ZI46f/R8sGrGOu8oFyyamn7BKdeMhk9IvXNACXDACXRDUC2oP+H6AJ/cklYlB26eWQZoGQyA5SMI5QMA4BOEY/6Dg0wrXKdAZQzJm90AR+cgX9zAgBWUDggtAUAAHAZAJ0BKkMAYwA+MRaJQqIhIRg6rDwgAwSygGdR7z0PzWbs2vGbtN55gHPw3D28hegB0stZe8E/FH7Wk8EeeIneztbb7CADdn0unyf0Aeqv/ieTb6T9gX9ZOsJ+0nsc/tub+hq7Escidpq8trIJYQHSeidju6p/yTDEZd06dl4Cvr+hMnQy3UR4+ySK+V0c6GFLM5Ga+0D+v9yREtc+hs4qMREWl5L4e7COPhgI0VlH+pNwazmig1NVXKkXwyZ/+JH6nAO5OCmvIqaVyfGoHwTi4hoAAP7xcg//rK/+ZX/zK/uS//5KfXdlFjwF+isdNdfZ6A6nzaL48b86tevfUWIPji8JMhIQlzZne/Pl8VOs0Adr8Esw5GBRjDw4xy1lmDApX+vOX/CbJnt77E+aXbotTexIbiXvPw2+FP5T2BtRHIBrXHPPhcopE1V3UHeiQAVIqLhzd4SwM61835Nrp2n1p/emiN0PFy3CMqPuvj2aQecVm8G8o8QyMhfbRn5Oqy2feUVWeq0xvJAUvZ9RJ2eGYogjDjwM5Fa0SEErN2+T3qg01PGe1tnoUF69/wyt+OcdsCGkIhH8jvKgJhqkjxOCSM7mE1WQMqfejPgp977GF9E6CIWq++lvnkpUQywX1uftbfKs3KS0zD0swSgj2l1BTbDeXelozUuZ5A2O73MHyFrt8Ubssl0HES6P+vV5gZ5+tsbFq/ei8d24l93YXbTHk70Vt1SLgTR2VF7Q7T6MR8em9dtz/FX5WsKJtCBi0AjDeYOPNo5nsn6SRiaheIH3n8wY2BPh1s/7wPs7VH52dH8jFfKpbRjkOyV+iOP4g7ZFQp9BcEGnBeZvLcsX63/34pZmZIxdVy2USFiCFhO+3BKoQQgzeU59GBeZ0fxkEQT7VzysS035PqsqrWmgoitx92Mu1m048/O02efbyyokfaraSAOfnN8L2W5nE90ASANcOEOhnVonSii/qDAgrrWGjclQoTIjCSli7FP1GXG91/mndGmrYNGGbri6+D8wP2FiO/vHI3pqfMQAkm5W/wBkWMxA27Zz56gSVr/jdyvZPEoSJgQlbf9PZZQHfiJpehKWOGyWjMEAz6SUL09JiI1KloWfT4F3EEb7PtB0GkpAgn+9qfFZYgTPfIj45/1hlUqSFPfZrz3sj9P7bVIZqOJs7outxi8ie94tqzssMXo/sifLUvX6iB6MTHm00ixz7jjXxpI7Hwq8kJC/pr6GIGIFxVT+Fy0B9Ju3lycPNCUikoDID5vx215AnTfRKiMyPeFWqtG5YMabKBsehDapYUtvl/wb9TIuplZRtWbsdHX/E13vhukmP/6dgXN0Uewd5MveS5cyQ41e1AqxWQ+VyFmr5X87KwlLHBmMWAwWx4NyL10NRd2vacfMkB8GtM0YXw2nD3xzm7ErrYE1WdI6NT0JIlYz2e29F3cR4SYMGnauWma8VU+LAmnsRQTowfbQsAPFm94Kslij/vL/I6H+Y55Uypc84SJ5pBx3mfvvUb660hR1f1zv8EP5EMN9bnKuxRVal2DS5y37IGwC1qb72dyE0cWwSwaeMelyrGzJKW3b9rM4rGeqj8AwuVmdAAYk2P9P9s2y5lHSr/vmlye3Gxh1gVR3wclvUWSDEwaMTF8bSB9ksvS3/sYTh/NfKEXn9r+dqiPGuUPS2XpzCmLMj1jPruEnNdq2aO+j8ljjPqPIxrOQAoXoE0yTlQ8/19l1FVgFgWBUaGEUj5GhSjJ2VKwe27UAAH4Zs5Cj1aHc2qfQKhzQuRRkJNusPZJH/0GBTMXE7fwLqvXaXL/D84ANwxMapYac4XY6Km2nG/wXPn1eSphtK0wQn/uqDnxz3HInvVT/cN/jgjLGfmyLs9JSQwgOCJ4XonfTGRsHZWE7fgkv45SaNiiYlBDqvybhyma08O+GiHaANDaaTkINd4Q57uAAYKAAQU5NRoQIAAAQAAAEAAA3AABeAAAUAAADQUxQSGECAAABkGNbc6I5nSiRAo1hQShTzBtBBa1AE3s1wwy7MSkoGcogU5e+rh/iiHAgSWrcjGxTUKrNhZDIE4blHcY5H8fgrDpviGprTCW/MbqkNh3k1htZoFhVbBHIutaRQFqbRF18nVK9LnFtpmkS01SZRaWp2V/hdNt0LozxehyjV4aJuLV/6VdymLl0nfOJGzZqQCunC+OYC1Ft8EgAYdwnIm4zBwMPX5rKIIfk14KwZVEEVgNIZzX6dlHktiB8WRSpKaKrXC8ldGfnJKGrnERULQeBYlHlk61L7EcQyKgyB5MQihVIHWW5REPkQQJVTmDGJhFwdvFYCnHAMPsd6wjKTRHYDr5CMzFy62xAEZspAiqjKyvJQMr7BoQDhJUtukTIQQTuWUezQZTjgLJvZCBleEmmQYIDoJwmhWom5PrKxePs28Hs90jivjinDm8ZRx2sZKufUxj3jdkSygymbOMmo1u0TfXf7PKgq8xh6K+JbmKEfdoPFsk1oJz2vzrjzHQFdq2j+VsYoGxnsWW6B9u+sq8ickLhFP8fN75htf4hcKra7i+ucWpqJ4ZcvXO73Thp3Frdj89ZjnWvSRZV+v+jhFxq47cpeuOLGANHSNG7/25fhHOf2RJjem3Dvh0eijHNY3WUY6rdTUxiTLO7qY+qWCg0/ctT8Wis6rNyGxCxcqbcpIgxXV+7WYlYTMeHYrq+mKDK/sm+nKD6a4Lf+UHZL354QCUHO2j7+V9x85qdKdA7qftWmdjrn5ffDyzsacrkBfxr0tvZq1dH8pXHg6o+u3Oi5C2jj93+VXL4ey/geqGqNgAAVlA4IAIGAABQGwCdASo4AF8APjESh0KiIQ39VlYQAYJYwDGeUFY3j3+h80q6f57erUCW8PRPtxPMB5uvo53ireeP8ZQKed/3XI87OsBP9xw1+/vUC9cb4NzL+v98jq0RMHhlR4eqZ/a/+XzW/S/sC/qp1rvRp/YpHJMzfMsksW3ksL6zujmnL/JfM3C3TsPQfWu7zJ2Fq9LPSYuZtxdUctnkxcsAECqmdT52VIdl1KAlVL2aM6nsD/wejid+9YfFEKtI7VYHM6lz3LlmiWVm0zOJN3fMa7U8Yw+Vx2i1rtlqOF5o0FFLqCSmAAD+88Jn9qw/6br/puvlNf55V+TvMTTSJlbUbfq8eaoUxzwcIswymeeV43eMiHujbO6DY6gByDSL0pob8p0dYjT/+VruqIbMeuUMBde+x4dY3qo62sR/QJlLMv7ilTXyOtQx4sK7wrkUxVZuk1WstJrgALSoVwPs0PYh1R82Pv07rwxCAnDxJ9bmqVejEC9uz1lycsjgk4pUmYkxKZ4p2P4IziYH3zNU7qhmLAge6585pv1P2ge4+TwpQmjMamhNP4E9bNuHRR+AG5AbMjblkIeziAwhyrivk/dghmRZz1z92dwfvaZIQ0E2QOqkaHOXIlYmcpvKODs+CmwxTAwaBA+X0kW7cgVNecFilt6Qk76M0Mi04wD5k+TPQSqs3vweEyXL3wreFi/ZBWsEBCFqZnFaZToWVbAAP7b5HDJ4V8KJZoApM/52jNdqDlPcUxeVhUeyW/ju3+VQ+tvmYL11oLcOfHheSc+3E4whVnFD5Jhc1vbW3qT7RXb/ZP4hOg8x6t/Rom2s50cFcNVY9xF7MuO5aaDIPSiohkgR9h9lev4aoHcBwqeLoTlwrBo0ch2J4L5uJk3cJaaC7jmGe3KJNN9/3+Knp4Oi+AY0lvrpfUp13kbrObgp81kTsWros8Ojt15/UJ5f+DX8tXiu8hYDJSjq1B2Z+QTq2RGRsiAlV4wPZhye9/1y+tw7ULJRtQR25UoRzpG6fylg7eYqYKOYGUwxYeDyAtbXTCIpmHvh+H+JP1Qs8MFQCW4Jufz2ZJsG4lH479bRrPHcnyp3ZCq+eXNTaZ8/I+PDB6xPSrHRJZVp91utf3DrVSmHxQwJ9Vm8q29TNyKK8ZCsXQ8iuyz7+Qe6bEBeS2gi04eEBfd/vK38cb13+6KS7nMM19oRForO12LnzPp83afirwUffhC7TWnbc8N9jQ5GoC9MAXYaB12kdWnEMzLpE6jip2gsNeaa72fJhOZ7YOW/rJhpzFrdKStkH440sVwhhATY4VvGYxTVJzwKgYaEGgWNBkorBTnIs0wq3KCDe6bjsBOkA5VXZb4cS7ojbWd2pNqKbHIjhfwDPf68o8O595GPZhDEXOd3oaZIeJetDsdIOzCz5Ml3EYK4sVVU7t5F/26aBNX/upKyQqE4vIYbfaCBltwYcBFWSiMAmJIWH0RC7uHiyU2G8sfYuLC/6ewru+LG4nj+QPYQQBUFfUtyZE/AJXG70KZUwyjBtZ//CX37DHnMfTZH2Ltl8Mi3nThBO0mTnxxQ1EVhv1fd4ZWR/aOj41lvX2xqGWfnbcCxBS+q1v7pTXU+CI/pKDnw8ZOPfvNCdm47vrPa7BiNqH9ZadXeMWD5K8IUk/+aE+eN85GqYEgwSrx3BCDxY7BSo1rAOa7LkiSBDOyR8ylTSj9wNLJYnYFrn0u+luDUjtI84LacB2eyLqVbjaaLKZBn7Qi3+DaiOkG5j+RRgFCDpMe1FEXnay80cw7MHHOjFF4otv2G6Ef1+toXZUKAEmc/LCUHpMnYTGx/5DwgJB7lApZlx6W98IX2wWdN5YrBdAi0RXFvrf4tn/GL86sN9Gs7gKzdbAgkRDtazrM+Pbre7/pNFv8P3vQ4vUUghU5dEUiOx+Y/1SbOkXFov50LsUtORAa0bO1ku/sPj6HxYPcda3wtFhk+AfbzQfVdmYhsgr4fP2qedSJpVXKv3nL9xTFFh9C15drGFNzPkmAGme4kysPe8TAZc6bpyqFdAN8kc28mOmg+AJyFAAAAAEFOTUYoCAAAEgAABAAAMwAAWwAAFAAAA0FMUEgyAgAAAZCjbXPbRmjgAiymsjecJmJzOk1EoSlY7X2cZnPePUtEQTTYgEISJsCP6ohwIAFt25DB0RhnFK8vuDO4xdV6i1OwRMhtvdUlz5fsMC1te8PdAygdJDukzlHADtjBMu0ykDeDp16Udlr80gC0ApaRHVFXOhtR8pO3RNmHtEq3aTkEQ7Sy/qS1tZYxyJM3TZBWb5psO+RLhY36VrQspXGb/H/wq9yrzwyxNostBwZzM8HMdr02QFbbIA3QrYBIGzhZPcCJbYDTUxvghNIGOFOzcnLayslpK6dUf6pmzrmD+nBROaXhy/sqJGn45utV5ZTqiDqnVAcVyEv1HqlKivWkc4q1CjUKwze7WI1Kpv4bWDk9dXMsQu05hVrWsL5t7yjWSqdML5MI9ZPEOS39fMWqQA6y8CVpt/eGNo5bsvAVkPbiGDBTAmH4aC/ORRq74MX9dopFNzxKNerGE6n24rweBefkWt65/n+kmLGAPHuZk566mhn6uplC3Xz/9nbUCuGD0mPFfP8iJKof8/qXBP3wzo4FO5l6cSEl8MzHqpGvC7N0HhWraoIOh5UJ6G3nhMxVEg9nfF65YQqKeh3gJWsFFLDElDvVR+45yFvMRdEZMpebMIRjHcCeTLneHsCNvCVzrwNlADs05bLF2ZSRffYcDDgD2wGiIfvDTldixJt0ZMvbO63/iEOL69R9tJgpgeIW4bvw/wzKxd/taruSZ/6dIoyNrmCh6Iy3W98RvDPfgvU1B1ZQOCDWBQAA0BoAnQEqNABcAD4xFIhCoiEhGAleqCADBLGAYoXChMvlfNjvD+Y4X868MLbec8R6I95A3oCu7PvXhH41PbkkqknfL2tt9NAB+W/13ij0vWgB/L/736pf9x/4vMf+Zf5//ye4H/K/6v1t/SF/apX3myqlCFdt0/oXof8QYRdUdHDW8vg3/8gnPklT4hwx8buW/0u9sfFh7rPP2Wc3lxaZMsYhbjb9v+4Bdzqcmnvg3rR9fbBj8rx6keKXE3qalmtMXAM849L/XwhpbGng8/pu6chOywHGX60gdGK4pOn6AAD+9UA//7VT/02X/TZfVT//nkf5490eav7Q7q9Uf0n8yKCPuMQOi737rfZ/NsbXeXwiV9P5noqySeCAXrnuU7TUQjKI0eVsLtzd4WiptrFny93FPUyVcp3UdCoROx69umXdJ1hLYm2Pk1E8H2wTSss4zBBbR1J5zO516sGRxoWeNcHG5YPNRPvWPfWXS3XuLq1yrHHBESJzHO6u9/VUt0IUgoA2B2rIbVxjZ5AbsLzH3Ci5R9NifuY1rHkXRrqcx/xj0pAGMQyU/s9g107cKCz49CIid0T7do0MH0rTkmhvzr0RSocBd7vbKzy8GB8BxEarKu1x6e6Sfl0fZ7JGaJ3A/4DTdJgIT4dxJNBsOa/VjGFCG6p6bHXMjw8TNj9iKT0Pm7ggJwJTLt+uAZlQQfcwTHKqSuIeQImbx0hN9UCrvVozbE+3CNrllN9+DFb51T69Vc/95FwPRh7+lddlyCjWfcnHqZVV8eGpJIlQCCloMzYGV+Ex/cXfmfBmWcCwqy1gIdOWuftvWwPOiRwh5zl92vxg255yEhrwo/QeAvJsOdiUtDWS1lPNz7FLizTa3sP+q36y3jK0hHyxPNF8EvdNSlGm8Gu3DXzYrLiJSq4fxwJFl29h1lI+EYVYgQfraXSIRym2RrUUyQF4QBE2p3nWXOx0JWf5EhqpWio2X+Juwhke+/age5/Jn0hGw+MIhDhqXSqKLi0BKjspuqKdvqqqym53GGxIoBtEV+tr+jWEPfs9R3browvFAXp6ipMLuxAyv9VNzWG6rZOQN1Wr9DL+3qfN0wjugoPZG2K8u+BzSbpKpFvbmozKjlvdMfmdQHAuUq29ngdWJX4+3Dvitg7Cg+wIH9arbBPiuYll1lzAgPSJoFuvz9ICH98zLW+Zbpbmo/V8PvHew82NqzVmX8d95VaF7MhgBFM+x9XGBi9QN5nCXtaYzPfK8GsHRP+vWay9xF8PgTX4L3ALyCkfA/W7irFqvJH0Gu8F4/tAPQPdmXc5/I2A+btT+dlhG3AwC/RY5b4NeTaCFrpj4Gdwp4htaOBLk5ttBMCGgiOFsE8twTUgkKK2IJ7/BLdE7zXh7lJAVs+K63LgiBoIEaiFh5PRg+Jjc6RkZPIxDvy3K1Kz1qtdnIaxZxnBhvkx7HLho6p8rg59vMrjZYh5Q/W/ny7ksq/pKKiZW7yAPs1nNKB2hxnmDBxePFjRlD4jhW8xBoWghjyYXQabIqG+KlWCiXRh/Rzv5n4o1RofXbfXNVWATwjwEZvlxZjwkLdZ1Dk78YFTirGbO4Q9mj5u3rd3kx839WeGvTZJYDI8Iu1C7ZGAWup90X/r+rOKzGemh3Iya4/rgOG47AOUTpuUh/jlwSABXQyx8AUUpMfM/FKwpqbWyj7jerwsdMrYax0ClsSD8QRM2FLNZUpbNYfMKRKMrO81GQfaoj8Ga017MAOoS1CvmtMuCzH1i8n3hkfav6AcMp6Z0fJv8qbuPNA2Ug9vg+UkTMt+MpX9olosWdrhBbXgAsO1nnu6j4G6MvM5jxJrJ4658Ug/V5Z8RN/Iv3yFJXw0QJJ8qQ+S2m1nT9fgyt4rf3CGEcd54WwNkVQKegQ7gqAvx7tlQlCF63mcEsFV1vlTujceVnZhMm5/MUEVtGNoI+ws9wXHp4AlJRpH6ghCMopHbOmq1khCXmDwpDN0LWwZiAAAAAAAQU5NRuwHAAARAAAEAAA1AABaAAAUAAACQUxQSAsCAAAB72CmbdvkIiVUtnsRERPiJ52Ij7UkCWDJttu2EQPStJLQpFxZov3v0wXCA2J/R/TfgdtIUlSchXpqEVQ1s1+Y/utC/r6QOsKt3ZdaDpFUkdaXZVxV1/yKtflPhcLg5DRVK4OsefTtPTGiqiW7zcj0puaqZIOiGrXCan08S47Zee9DOkTl3enUWuvr2meHN7h5rIJlLAT0w3g4lNrGKlsWyenuSU82FjLa7rzKF8Ro7oRsSFZ900DzqoDaXRwaSKJsKaAHSbZsOFUb7psND92ETwngWL6zjiFNfFzJprJMIuhwRR+DPTzrcBMfJ1mv1jCkaiU4kwjdhE9JhYtG2nB30kiMSeWIqkA/7nEoGNKkssbJwMc135X1fXwK8u+xhrq6j5sHpmo4DEaO2d1h4OOxEF4pnzuYhPrk9CpHvaBTsSy6UiJl1CmFu8un9PRTJP7dVEJ9fJ5P7ZSC23o3BR455i/vmNRyHA515RJS0On2L4u/H8nzKlJLfg/RLnQ2a6hQ30vMU0mIfecq2UygPFSZz30DOR05m5PohTYPF0Xep2BiYt9QkKgm2bWTNFChQ98wtzDbkTZCi/F5bCiIVBP2Wz1uBgnhdNxS4FURnoHWUhBOlVPYviOIVy7MYl4JGN33wCMrQK+vgs2d0J7T+ikFkefQSO+Ck+ZP4Y8ssNZMk/qalxQmi0X8h3cCAFZQOCDABQAAkBsAnQEqNgBbAD4xFIlCoiEhF1i+dCADBLKAYDDXfzPohsC2q+xjde6qIc7AZ2u3Q52/0Xf5HfYPQA6Wz/O195+F8JfCA4g7P/2flf3r/BDJxu/HMv7BxT9yTxq0y//AeqX/hf8vzMfm3+f9gf+Xf17rM+iN+wCk6Gi4K6LALEzSOrkf0/pB5NSKA3cGaDjAqCJ6iKZezGsHDa0C1Z1IbuOQ3Ue7Idc7sm0U047QBMF9vUUo5277bGflYv66kxvbfOp0q2FrsKRP7mBCV3mSMCbZgZPfsaDXTc8xiX+UPLzKQaAewAD+88Jm1af0339N9+rJzy70Ts55lg3z553FxhKpOU16JsQzB+NvAPHjGX1tT9XlPU4ighm/2/Kkdmi//I83BI4Gc1d+SLjrizM/MFX+9XP1E/51mHwLGR2Kw03F/wRm/Td5wj3mo/LOibkZ3FfvkHkyMuz45d2aAwcxSCxqaUt+2lmqPPU+35ZGDX/6jEpY0K8SNkVX7H8CYeenXmqxZZH1FelYoN7YCUZeZejucIDK895xXmPpMlgJ48E7vIULO6lWvER88JZGdF9F3kzOcck43ABUvW7a+KA2yJXBeWXFqMwLdPYSZZ17UVdahqqM2kwAhE0bOuITOa/bMmFFrmk4soS8Co92gdCVAmLQaDPHTRmK33T06tEMrCsoJAt2AEwx2IHboOYwSXb/1H9mYi2PNd3ppf2k9SIjhtrhrt4O3smH8pBULGUf9ZN3rId3RmS3cIKqXejuuSZGltvElTPBuBpQFSvdD4j8615v0VeVqmecl4uq9CFaxN7GiAGa8SJiXT0BWMKMRbaymmlTWPjmTUaKubCn3MJh9V2bqUFXBhKShopy6eUcdzyJvCCTaBA3rqTKPFIlE3m5tdPCdCiGhVJayg4O2j4E4GC6HQDA2ghmehNre7PTeZA+CxeWOLsaP2VT6WFGEik6FHtxiDS7uxtiPI07bAraA6kV4RkdM6dARFZzl9jWKsCnEB93GfaSAz9C7+i4JLwdKLFkLcMhhAFxOKEjRBNAaTeQUwL0z9QaRlyM0xgSTTjV/HpQoWisrssK5RGumARRHTb+3ZqlK4AyIom2hCoey6Vh4TgFcbC8Hgk+KjSxHv7WZzVCw43N8auUzjIyCO3/9fsjQBHMUO1lZJlArUoTP0RveouhjEhFVTcQFQtp9X5s3dLmdrfPuX5B0dqemfXU123UCbnFtXysrB8VkQxZ1cWmhTf3tb27T1+cBfT/ykmufcJSVVWusdS//pdg4KCbrqDFvqUNcYjgFiDMxZ7+BmlmeswL1v85THmrukz6dec4/Fwvs8rHy+rjbu3GGDSQpXwU+BdMHUhRP8am+8BvKbroe77ox8YesXYRbasbinR0Vo1wukP4ViEFA/DrWHl0gjC0d7Q/nof4gHsnjuTZW2Sjyei9LIXYgbif3SbF8OC/gQj+bvB7tO7wmWMY9rjnYztBFDwY2XblKIDTHhb4wVYqzZ3hbQPoLJ/HEBom0WSNJ62HtUsaypDWythh9dyAcrRF5nYuzT/gQNv9v2xQB9fQPEicw5EUy5aQ/o6+jknMb2S/HZJ2Ra/XeA9d87BOgEKqqle7/5Qn9eojkmUvZdXWqx86obLcP5+ozcvwb9895CpDyKsvtDX/cPo+zIu3bg+gCroc4/pMKGmwlbKLsT/xondPCQYHQhD4c4RB/AayWyPGBKbSJoHRXutKHuXoLUhHi6pk1NcGD6pq5iD4fk3c7eaVngVf1obGvlZLgfOvjltjE4Xbo/ugAyyo1CJZyMQ4af+YXQo+hrY59fZvk4bS0U7zex0l1yTR/+aOBDpr07Z48R/iSesc1VxpAqO9N3wU0tQC/+NN/wgb4jg5JhtBH90PkpyTWtotwWnJhChYkH4reiJ5RVRBdArIz093gusgUMbUEtvnhMCYNo96gTOzyqDhQjDGrktjDAAAAABBTk1G2AYAABAAAAQAADcAAF0AABQAAAJBTFBIAQIAAAGQGwBMazlqaKDAcZ9IwQ3khAMFjvtcwmmgSIEaHOTw9Z5APtcRMQHwP2rc32Y9c9z/rk+TN2u5Tiw+1EL5wklrhcGhXysT391F0+xaZUOBpW3bkNdy/R+QtKBfyyPX3VqJtOQNzWopcNCu98w550L5GNcwdcPovfdBhHEB667jho0YJ1jnwtOnpXUkUYxCN56W1vugmcdGxFeaPgJI2o80v1kR1xfIoAS9jMd5zcokml9ANi+QtDSv5EMAHSOAkmqUjABKmtWSQUnzWjLImzoF/QTXp1SjZARQUo2SEUBJNVoSKGleSwYd49jqGEcGJnsU6g5mJxLGa9OyFH20WrrTUo0ar4XakVFCowYlRM2uhYPrbkbZgzVdes01KxcKbhotewO2cQXEI9JWLMECALjOZbGItLnA4S1JKiJtz0wYDHqhiCSUie1OJiJNa1YkIkmZyhWQjEh7RwuHXOeyRETiseRcjnOwsC8JRCS+RQAAAxs9Muj3RST+xMPuRGx3uyISf2Jhf+aq2ROR+BMLgoXLsDMi8ScWBG2TikjsOLYg6Tozwjb7kVg8MjCnu22QGYwgHIaUbwcwgnQmtpodkIkIa4B5Gfb6jzV5A+KmyoE1MNN1ZoR9kzd0t5hHptnFErEFFs9cVpNWezgOoV/NHOFf49isBhDqT6zBgEJ71xvYDwBWUDggtgQAAPAVAJ0BKjgAXgA+MRSIQqIhIRn8zAAgAwSxgGbAvH9V6C7GXlfN85x7+fr3VA2W2x54r0nbyfvQldQ/cvCHypBVz4w0mzv8N5zYeL/neyd/lf9LzN/Un/b9wn9Zusj6HP7boPl0hheYCZwFmK3bdKxF3ODcDfbyIcuiizC3wl0Ff91L+Nh1BGmxmsWXwHDl8Ahg1GwrnABw+7g8x8NnMyrF4RBmnoIP7Kug/cx3ze0xWTKc8BD2dBAA/vJEr13b/O7f53b9Un5lD6m91PQ5T1sJcs3m3FPu9ZACmjVRg+nGRS5lXWQZo2vfgZ9MTA1fFtVWbo5IrmbNmRauQLvczva6EPJzCk7xL/TwwUrfLcBlLiv5lTwVjkZ8w5aBbUkhzZ1VWKoUN66HJRUgDDngxB+yCB/Y/41ixfmT1HaHGuEBZMfEVySfh4ToU1A0fU7JVBA8qi4FvEnXDXT61uLG36HDe/+YNjWQcK+LgoR0gxYIn+1cxtu59omXHie7Za7yVAEK7gSryJhb2i4EVwO3hIGlsnCslii0QH1zFLO24thmwJw2UrAaLiMKLZ/4WBwqOW+UAdTm3e9ciof9p9DM7YYPBRN/CuLb5xPZErAGX0vhsAFDQkJ16ti8uggEA8+VjPF8+K18GUVyYbHT5ILoIW0CMI3d6KP3JBsC5Ibz9JTZxP1UrzqqZczNBMqOHqygqAUeQcsGYiIVKVXI5AliUTlh/o42+dsBjx0xxR816mZ6s4mr9ZS+z27Cff0SdONCNasD01KIjdphsn+O0Yk7+vYHcvlOgC4HGLADH1qrKgbS7SIz1p6LOHwEEnIjEyvcqnfeUcEYKFxQ0xaunC9/TsnvxlJyObxq/57GKbLwHb/cn6U3+uxRYQ7j3/ClWi6SMh2417wEkvi1myQIPdIykhsHwbEGzLRrW+DOuRFTjxAFeYyXSUBL7mdrR+/xlh9JDtEHMqrFFng9AyUkk76yCoubfxsPjqPhQcYH97d/f9IMycm4BZtKT+xW8ADw9pUHKpKW7mHJ+zGOZD0W36vQ51mVfdcUPp5GAA/7RjIeQfEsSVs4DLNB/6+BYVQhhz5i7zBa21PfVoxvZRi7QeXQv1+pHoScQpAZpXfDHwVxb9P75jzbFZCBAQR9NO42bTy8CQz3EJ9ygCIitaTTe7GAE5p3sPRUHokZn6EToao+XNzf9ptUJlhhZ5ZFDDDQuzhPfMdrA/f0Ycu3Ypj4uCE2/vIXV1hmWBj/B3bvocZHe3Vn4Of/hBrAfakq9Yghx2JaStjeKcDE63TMX2f3iP0uBQudqlT408/mGcS/GyHfZVUuaVGx7OrbjTXanIT0SbEq9uYW/MGsn+kYjBv/Br8AzaGlpWeRcGrYDOCnzJT9xiJl0WNVnRxHmuALRmYuKnxTYnxiDBToJlgQDnaUh8c5vieZvj33UQ6lkFQXz5NU6MSDgMxP9C3QXZqVqojDzeKCyU/NpAKkCfOfhRCb7qyeN39+GjC9559UA2TVCSmOwy516LWePLu2Sujtagx0uFcyMqR+m1H7RvAy9H81fh6dVkA6F1CTN6Q1+YpLpxJQIrF/B+FOh88zpKO/4Zas3v1M8u2FbX4AAEFOTUYQBwAADwAABQAAOQAAXgAAFAAAAkFMUEjvAQAAAZAbAExjO3JQIwo8UpRT7W0oTgXPYZv4E04DRQpoaNTc8QU4lRExAfD3enfbZUfzie62kjdcRFWLWyfTbLEjwuSUO2Q2V34LYZ3qZ+N2VNxsor+DTOtEmD12yGyU13GlI6xT/TrFzcat445D9CHQNKLH7WtJqaqe0xzoTh2d5zQIneNtS6VZ6DnZUdi2VEpT+2CGZzq6shVJGyZgHXR49WYyLpMZt2ERzF0ZFtapfp1MdtzGJGGwFx2aCEbe/TqiMYyVEWe4TPawjMBobmaJhrli1RiWSbhMZRhP2UhgxmiT/RRiI7BM9etkmiOYRJjTV4swiSsG1a9T3DoJJ8FkcJoFxKC9wWU0wpx4spA58KwZNJ6Dm1qcNqYJRI1bjjwsWqlqphHoQ6zXqenrUXF2FFLV61bxKBNwUsPXNwDTUSYjfFb1sPZkAleOItj6s6aH7XnqKK5LbJ5m7T2LE5FU7U0c5vHn2luFwNej6ofgs6y9iQHAlSMNI+isaWcVgr6aeQAn7U0Mu3hWSkkiwROY4bOqnVUIDtE5h7BvhGdNOxODcU/ocUWPqxAMq74H01FisO8orgfCXhWCgdxsfFbVmhiGitrAVlLwCEugQxhuNuVfW8J1BP5bxHUo/w7CdMBpp33z8wFJ1paYYEkfGKEfAFZQOCAABQAA0BcAnQEqOgBfAD4xFIlCoiEhGAleVCADBLGG2AKkJt8z/tnL2dFw8HttuzzwHos3iveg8AA69f734X+KP31Hvo3/2/lj3g/BnJ1vM2XOJfggPFI8c8+foMf6vm2+tfYJ/l/9p3yJUyCiwberqwdz2e4Ju0PJuZLEzjy2qi3fmLUM+Jxuc42kt/cQvudJQWW6HQofrL0pdQpS2B4oDsGhp0VBsollxE7a7Igt3D5mIS/4i5pcc+WV5ZSxUfCYvLUCVZbq/3r1AAD+88Jn/2tD+zu/07vp2f/npnx/wFjvgFdZkS190L1MY7+Odyc/MN1xTFxdNjf5fy63dxiB+6tgKX+OU4e3sji7JS0cOLYlyOLOdSGsu5yvLG0xiAwFtafWu4CaIBaYbZX/6J0qlMrh5kyJxbvwWjMcuOTQRVr9vHz/zPCdQ/97/0sGrFkei4AWfSiukahphOOZ8iMYTIRF3qVPtzSdbn26nV7VHIS/D+Ptbe2xrdZ2CYLQ0N5wcPkOEUK7Tin+oG7qliSnls+Jv7w8siZIEAj2u9ru0UW3ZEP4H8AIMGB8eTuv0MFjzBZOwpzfyqtBeA2CysG38Wk2tEGE3PtGbq7afoJuIWw9bjXyik2b1/6pm64WqwtUckfuxvFhej+hLxlt13p/fm7pFN6qXmlDwW0wWaGsxydie0EvEwnJJW68DEjD67l6VyUuCX/g48qD7CP8tPs2J3Ez9xKNhnxfV1UQ4iJYR6NIZiMuiUwz+A86Jn1U6hdw8l5H+tOAbfm8a0jqqiBaWtITbzcJsqnlAG8chuWZVVoXewRDUZA1pMT5Ys2R5/kovz/hom6Kz1AfFZUL2p+NXQEJrXYalRCmuWvQYD7TadRujhM0Cwu0rAdlYoMRiruQoooMh3/YeY5yNJ4mCjAD3UoWn6bZt4fVympyhDJIO5+B5j/FgWv9YFzNY5jHatT1UJFj1lTpiNiw2P/eborur/feFZsWlrxUMdqPY5zxI7enGTeTp0o/CzheV1BnJKH+g0CPExjZkuO47QUbqr/hHWspGcG+jMjt9puKNlhckPscRRlfffK9Ti73VK7aslp9NoilcwVky3kLd76aIowHHs7oDm20/B2YmKciNrhDSUxTI3lVCNnQ5O641cOsx3j+hHXvJNGLMjC27ugIsc0KF+pqt9E77YmKnK+SWOg+Tc8zTDQo4kkGRHZDR1X9Ohhru9yt9t9mUlzEN7oBSxP9BpJ3pQ93cG50/QidK9Itvk4DDRPXQ8Xyr31n0fKj8vF29knzewkQPtkOTrk5MqdTaxqdJe5HMWuBOL7+xmkMwVevFauLhfKAPZD6qghzjqGuI6fWvebKgrgeOfLqeSYCHH6jIbemEd04tur0L/j+BMPctoIJeZGtVuoJmGScbpdbtS29KiZ5qIwk3uwztfx0jrf6fnwsxcNrsbMofkyHynCgZ1+V+lPVEKjL84SHt2Tm2sF3WhPGU6wfOLEHcX7IjH2AmMk2ThRZ+/vKAt5C8uFrMfcphXI0ygpd3vXOKdfj3Wp1xK/7y+fX6eBuH/tQOvIxBPq9ZugYKoR+rhmV6s08eYHPiAbkrRpIzU9I9eYf4ODSUTipnepi7NMytXFWLsp4Bv2xfxsCuUszyQZj0pom3tRHNwhd287efRPpg5NLYnG6swN1whzqdw46Bki1CeD2P2aAlDABfrs8DU1yscwAAABBTk1GxgYAAA8AAAYAADgAAF8AABQAAANBTFBI7wEAAAGQKwBMoj1ZssCQ6vsotQdShmPge5+6UHsfzwBLKtTuLoRfOkbEBMBR7/w/0Z77UP9ZluiM+dpXf94xRm2tkbHY16s3lo4CdtNksI1lQzLm6xEgYZrqjQWZJvUjoOA0CYznaRxviMZ8XWsEAC6ECeSwLJml3bJCbW293RrnfFiW0hWZBqCnuGSu0pWfoRo+q60PZadGrY+V26AdSh/MTst97KMzqOdhUS+OaqRHbRA7vSCDMuinPrJxvjQgj3hODgbiQ9ErDsbi7abVAgzPWgnGB9F57gz4qsIEBrGoZDCZNCTYCKJQvQ1fFQrawKKQwGjcJ8EKtV3VW/F1V8FpEkwTzQTZ08hM6nvZWcGyK4NVX6ehtqsFK7Hvj0bwsK+RjVBkX/UmHHfF92e8G4cXm4bUynkJIxzF0ro+OzVK3PrQ6pUocR8tQYUSd4NJgRL3rfIPEQN4m/v2Q+KfnMNtGYWhSN/MyQHdIQBfx2Ao0jdzIljFMgJDkb6ZE8HWNICeSd/MiWB7EDX3sW/mRLDXce+N80H2YdkgnAgUQ4rkAMtaXoG4IiU4GJnW2K1Q+0tKQBi7ofoVLF04B4TRGnApBQcGVayeqIJM4+t8Eqbp6X8ElmkgHWcFp6n+2Ihrz9Cai6X1Lpwc2EdKz4KDSRE2AgBWUDggtgQAADAXAJ0BKjkAYAA+LRSIQqGhIRqrhYAYAsSxgGUcoK1/Jb7jybfUcdh94OP5YHRr8wH8A9HH0Ab0BvOX+XravhX42/X0dq4P6qIeWSM8ddDSZX7x42MdXoVf6Hmk+r/YN/V3fO/2ZQkTLOGfgnK/JUjz3ywvrljOS+bprnz2d6fKpK+qud7QL0BOeEwgiPUwtQAdPSJcY0QAM+Txi7qksLBTI6C0g7AK9ApM/7SvVeeABUjWXX+vmE+hRokc6ThFmpZ4AP7yRK/13n/O8/53n1TP+ZSdZO62h+COZILkzk+3RkTrZK0oIXyNXRzKE0ArVbrhxbqXNt2gP5ZsC1dgjWvZoC8H3W0XYjVHgeLdzcxSEJQypT6FD0IQS+oC8WMit3GJGtfUQN3aeWce9qd7Qpg2NdHkDIcAPszUPszO3ohZloPosVO7gsrenuPl8NiSSkxh4IbFf7T6aCFU50ivXGEbslhtvi5hU4KXfB6EHkdcBA6hhi7TGr5WFXtOMSLjkH6BU9ZHWM/UnZFikYEYCuxTK1TeULSsj+RbiwTKX5Q/G8tGgrNgln/0y9n/U0DqqXAgRNIn0MGkECWpTtWvvcP4P2pCt8Bj5x+6tv66DHcf2igh2u91THscbVTbeCbeyah26gK4wHT5qdPoWW90uA21ZYUJLA02HhwjLxLt+dHzWm4/U/0Wx8ffOiE8p7V2/4VOvNsvVP0X0H3dJEvOzjBI10stals8LZJGx03/1hQCFp8M655dMc/jRW3a3z3IGjJwY7Z25xiNzZnwb0g0Y49ESya5gecWLRAHlOoOh2sMKz+lfATSUgRxOqzA/ABmI+osCL58WeL/9c4b5qN+n9BgsYWjuKmwpkGDCwA5Knrzv+BO2549J7Jzv091c54/N2grXkNkQShwEley7pRSllgaOGLXN08BgOCyP1mHubv6GEqpz0tLQypZ52Hg43fr25btAXXu6TmaC5bVXO8SQJ//zLnzVCG4xnOSQCK7YzC3ZfHrTIexpELwiul46ZzWFwQweRJ0DsoFXJHxH9jrc+4YW9xsf3pDWUMOKbPWGj4FWN3dqmFIG4v4IXPYNrm95ZmDza+vSjQ4QJKRRX1flZrkePhYPXYX4CG2MACxPi7LUtmnRfClGSWmik5pw0XrjpfxPI39Pg/LoE83y+qCawumlyamyP9SYYbB5KlAF+iXzSI2qy82P5/aX/Lz+Dnpi18BbyvJJs7l/EVqDiX3adCDyLO6/TTA+bj/dryfRTXcgFYZcJi95VgLZTfLGu2mAgofwh7aJYzVJ+Zzgi4Q0fGWZu+vE8J7hlr97GmlL7X+9gLYD/eTNKjYBHqhlzLS7kGIzbEUiAKQ2udagDtmgNX/Hi1Hkt9i/PRMOhGnNlWXNFMnkZHgfLdTKhdZN7/wKDGByILTQ8TAnLsgI21ihD0JrjurPttaSSfnmzCuXOGGkB5OPW26b2UEmMHojCD8fZ9pzgA5gPpc3GY5cM1pgrIIaUFSWckJdMuPPUFE3cl5ZKL7Lm2D588czHoAk6n34wqUq/5q5nVaZcqOCAI3aQY55HhGt2qZp/Q5Wl9++JGrqbIMy97oBEEsj1vtDPBMj6UlyAAAAEFOTUbaBgAADwAABwAAOAAAXgAAFAAAAkFMUEjhAQAAAdegoG0bObhICZvdExExhW3yEfnYJhIgCQCbtjE1Wus4oAYm//+lBUdQOkb034HbSIpUtXvQUEcNe19wSvTxTu8MeNnuxB7UXR7rI2m7KCNu9Znl/UCgDKBnbFEZpb4A1mCGwSljMMsM60toqcMsM+1myK+hZYZiWz6+Cxblc+0B8H8OilOgRaJbnMrhY8oj1WNOspEXIvQ9bntlkc4CdMO6URVwCcKfXoD9T+BFIQaBDasQWTIVpc+TpNZ40OmxQewxQ3Y2T2gtQdQWfGCB4Jz6jU5bwcB8gCqNfGoe2lO58OpGexirz0iP8rpRbJQ9aQ9HizUwcDxWjqx4ccTyaEmZeTLDYxZZnJUWgXqkwVUAkBlKNdMaqihEeWqtSa3sWN1sNnjQq9jKbjTqfOauHGl8ysN05W7Hoe/4ujCszasNvYSUkaqUW2TGc78YOoBe/FrSmdoFL47fG48Oh16Wxe+YT2WthDkxGrQI4mktyT98DvCNfuHgQoeWgbewC0cqH1vknbbF47eyIwTJTmDA4/PPkGQ91yFDKjMsbNOxVMg3i86sZf6ReGl41Jo/ohLa4tsgCxaCplQ78feTAjKTitv7SYXVDG74rFINmCUSvJ0UYacuBbjtlRC806ePjdXpAABWUDgg2AQAAHAUAJ0BKjkAXwA+MRSJQqIhIRqqBYAgAwSxgGQsy25vOf6l5tFobZsRTb7XdLAounv5rIG/1HCDLmMt8Tel3+D9Kf/Wf9zzN/VPsE/rTvh54cIEJa5dRRK8jKtyuK4Vi7GBR/c/7AzbH6z7liHbERFyxnH7vPYwsPNAjw1vxeTjEWxj4+neIsZZjA1etJ2il+8QZ7MGA2gAiCPm3xJ5jhWM9hU6Q6stb7K3VAAA/vJEr/Xo/6M3+vR/Fj/zNHfJsNsGUdZHw5CzbDh+oEPlF/T/cCFOVGlMW+pekWfaV0VD0KatljSmBy0JQC040+1nXfiin936uvCNGJ4lHiiJMOcawtPjegLJs4qcMRKnpxurFfCR2NRHed7csBbf/9b0+0r/8eH8a8/+5P/5/7h3zh8/v/zy0cY8HBwr7hdlI7WmY6VtqoGPQxIVfydYPqGyEG26LLdfu2pqIdT6fa8sGERMroukeJCT2jdCBrq0AyjWVy7Bx2o3D58qgzEyr7WDJctdkH6SigGSDbwyU7k7t1UqExHinR0gqyXGPGov+r0K2Ug78a0WzCXBe8GaEcmbj1ORFNzbl0yrDmjU/Pp3XX9bZCHaIunFhanqYrvNZef9vlN2giWY7nOL2arX9gqtlA2FCRvLI9/TYyhQW7RlA5NUuL8LKYi8acXoDrBr3RDin893N+1WrW/15Hn4Uob1zQnIwptLINMkoPAFxZrvImsH4rxSxnPMRZmlqCk/ntntJ0uagORt3sKo1F3rg1IgA64Ped8nwXzvYqIgANiWJ91MIFutjk8xqflPeWJoDj/Xkm4/Ew0hr3pJHb8rM4qNibWrsdcQ0/ElsJYuMQAbiP9UkuBGpwxfdC9v1w94hoWyexvg6PYL3/qThwdvSYvKfDcV6EyqDD+PFYr9CT+ek/8Hn0HXWkFNqKOjMGMkuk9Bti01jfgr/LFSC3JzeV9RRHtNJ2s+O412rnlJ8tLANmy1SpT53DUAL8yrBX3bryYpCDddpqAHgRIFvUIQhWq+OyT/p2amrr+fPLfL9d0wLj/ZQRHjT6Ohq9Lrle+1O/i/C6pMlKmciHYVqPkyK6sw17mRFscuTJg4naIx98E3xpcFRsk6MaFgPhRqHkX5ZpCRF0tjJcJt8jWsMuMvt2nGUOGAiiOZl6zVeqkyXx628ghFfBZMtnF1RrNOsbGr7SAN+PMRGv+mE/cvigBDYlS05rQTJa/iznI0xx39Y7/jUXvxm/7F8Iw41tNJeqP34j8l6/9EU2PvKKB0f9U9RGuupjvQ3NjOcYBe+DsubdrbhqPT7ah+XMsZoqldfqxlqXOC/YyZnZAbPbCPlctuGdqDjfp7x4p+sEWUKzwhYGVRNLwm1/ywD7Wzk2YSW2EzpCK2VK/uw8tcG8q0WZ92LpKcoaarKWa1zvkV7J2vLHDR0Ugh0p/RZV1u3qu5MRelZG1wnitrL31Whcb7b44qcakVmt5Iua+xtkaulJ6TPWQpfuFzXglNYGnz/+hliv/02vHILwpwAdGTbKzBbyGsSfS9+usClHmgB1j0eTLX9PxV7lKzrR+oHRo/fhAGfvrJt/xvVems9HcSVzZhL9TIkpw9ehQQlHF6u5mjwBp1bmUIk6v3GLBkyMH5K1k8WZ0CBXi0jrhES6JcAABBTk1GLgcAAA4AAAcAADoAAF8AABQAAANBTFBI7wEAAAHfoKBtGzm3SAmaeyMippCffERW2E4kwLJtK06UB5RUJGDzFCiY/0QTxdfY1V9E/xlIkhplcxdIzMGiX5heIhm7JtCBz2VNuASnIIr9LtUj6KEn8QI4QBSHLU+B5hVRrLytNoLik9m8kK0pKT5p8tu15aoiwrPYUobZGZ3rVNMc89/ZiF6nUbrxopMMRYF14dD6w9RmPvn6ZcFSOynVX57dJZfWGekIbC5jAA2TVXgIvHLhlepYFq6dh8wbRyYS10m5EqYmV6I1qLgHpqfR7Sd+fIYjdYBOxN08DjvibArD26hAib4SxiBPaCqBw1W2RNLhixWt9CRTUJRMUVEC+FjyGpq+KQ4i9xKzHV6tMZlJ+3xaVHOeQCMnJ6ep1gASudRLXkSdGeZ2A4UZjI21d4UGrE/XUYAV/AgxLuD4K0JuBuNTrl0gRdL2ZLrdfGE0wNyeHN3Pg004wXBb1+1h9bbLRZqBuK0V422oaxgc5Uq3/c27nAiHXjA4uImTDT1QHGnwNvGhLHoL93HSA8l96wwE4qs5rTIB0khD77qTBWeYVEUB4M2mCjBWIn2r7bwFWcIpdtL7E21eHrZwf+zEFQUDCfkf69MpIigoagqCyGe4gNOGl1IE1FSM/yfFt0tueVF40Od6H+knBbELMdz0JgBWUDggHgUAAFAZAJ0BKjsAYAA+LRKHQqGhDlWuAAwBYljAMnBQVw+Tn0/zaLN3MRAMJf8v7znzL9DLeJvQA6XKu2vyXhT4jveL9ztTvoeF34A4it+YylxP9x14wHiWUAP5P/ZvVV/qf+/5mPzX/RewT/Kv63vsX67JumXh767xXSvLM4D62yoBbVelYnxiZAIJT+GWumMzVpGjDYuOqAn3h1XXR1UDnMC+zwp6m6AGDdvIkLMstRjmtbPvNDT8yil4Vmh9vWH9qOLnSG++pqaMpiL03aBgFk/UtEAA/vPCZ/asH9Nz/puf1Xv+eVfXfmJ1xf8kD9q77vqQMCM7YE1Y9CU66xx4WCZ/eQ0n1CHLybNE/mUEklZf+o7PpftjccmlNcocufwJy65++7adtSS3tcPrIB+WgGL7hJXoPrYcg8FFUSG7lR13C4pklg7aiDzA+ba9hYB92tkh4W7bC3zRfbEtuAZEDlrcnMT7JTSrjni9HB74axda2iGLXNN+vBevxBpsSThYKgyOAinAHqssU5KgoSYeLwQZ6IfcSm5XQfFY2gmOyhrUX3cOshOtwy9dzcnpEzH90D9b3TDK4djR7Bm68bKYgA8p1chdO0etNvbw3djG+Ya2s0qMY9k58S9N10SqydYSX0KHtk1HPR3vGyuBzWaBJ4ry/LCSvz6tVnxYzyvdfYngA6nojFx56kdahswr5Sb3TFz8FVAvPM/WmB2abNQWgjyD7kJgfx6rTUOS/+//8z6cYMGzcLBa7xdf2c9GsRQiFKwUtb19vLVUq+lKpx/u995NzjLb668PPQNhE5/zH7ongWFBBjwG8a0EWtDWktbJs2bumjByr2P1iGj3Fj06cWEtH5oHXa6aNMx7QrXkziIrhNAG1TFtsSYfDf2BhWR1foYYzQUtRN1vmuZDFv4xwXtciyrO52t3pB+bFiwJDQWgzuaIvwqig/YXrZjfqBv1L96kD775B14RbmiAk3S/HsAOVRZ77fY+0AWOYB57T6X720qruZS7kA/sshQjgtGaIuuodMxfPCKv1APO6ik13f152ljiaBH+40VvYw/DiR9DiJiAC+DhH3uhhgTEUp3KDn4fwdMGZsOozB7TKZpbvEUx3pb0wYbATWnR4oPLftVyVs2ggObsXOYt/2oRbg98yaCd2ItbKOJ3bjZ3QCngKYUeZZVPF5USMiX0+q4npr+corgYFx5KQZ/npiEgv+mNvv3+KQ9WF7zNRKOp3a+XE4yRYPWE6KdTYyYEmC/SRj7u7LBiL7Tmee/uDy64aRw6WaGmj/+6u67HbSiPY9J0brT3B73moVbPjqj5WY5N/84TZciXmBD4X3NTmrdBa1uhTPvt4hPJAHGhgWopVncMuggA0YABePBr6N/2ZD6XGt6ANTdLidD8s9APlzxj0zk0YdEtf+jX6QWsSd38Mc5i8Q3J9o6JBldcwoEI2QhGQmdrMVT/8NzJvZggxe5grEIDadR4UO1fSk2k4/kld1ht1wVU4xla7ZmpE/J3ki/nZI20IbznhP0gCUQoGedMQ0eMfqu0YwiNtBBahyywavf7iHMqTPJIYAcU0zp5rnuMByIEjofg2MFAs06VKnoAAZH+1uQVKDZZ4UaAwdtb/4EzZ+weNMKsDSxA+TnJbBVAF0Jl6Vxm0TGwe/A4v+770f2X/mJVb3GEP2e3iVLsjyrYkWjooJOiaFe7xuq6eR60VF3UbCxWbQjUuEmUw05WVWxLaxHlD+56m/xAsFKOAAAAQU5NRiYHAAAOAAAIAAA6AABeAAAUAAACQUxQSOgBAAABkCMAcGopbyVbJMXskXaBYDWn4ctLsXobXII7HMQ1RaZJM2jeCE4TEQ4DoG0bPAPdRZLzwqDW/GwcxxkENxi0GX1tWPMY9ZHo+1a8IbK+uNNBUh++GCLUDmaGQFAH4PeowcBOPfxMr5UMn+nyL/e1QjV8Zmw/zms5K8AGzC6fsgHhnUJU9F7eQabJdsVrPDbAbMxIjHbZSb/kbMwVidlalOEskqRhlMaLCEmYVYQryMYV2Vq8iDtHMuxIw0WGmTQ1CBU7tMvO6ALLTpSGbGLvEiiEzVZmLkkpTmM33PRTouvY0eQ8AGXaggYngV72N4BJ9vfFThlCFSq6Vk4GyZtf1HVzWzttp6jWDEBW3tc89JhRO7xECopGZFFqjxRRJrmtgJYRRZRNsWunlRQTym1AakQGlIdZPnxLotpxmq3tFCTisPiwTzE1frU5sztBqWlE1J5hY1EuRKFG5Q7zUODjmGsj2S7BJrJexD/naa3W1ttxvIXJ8yK61bITQ4i5fbtjOTpHTnBhzSkG/32dLAlYcdQu+ymft5rT5I2x86zoxZ3outGFZSfF4JQC6XClW/zTDLxm+BZveM+NoAaWMNNHqIJa+X9FqMFQaNFSSJZCdn9KQvFmQssG9ODf1C8tRzdYNB++tG92A1ZQOCAeBQAA8BcAnQEqOwBfAD4tEoZCoaEOVlIADAFiWMAzyWB/mfPgTK7p5qlqbPEiuEzt2/MB5uv+K9cO8l+gB0tuAAdgn+J8J/EP7QQB/2Xkl3w/BBO8TR71XVWiVfFrOsf13kk+n/YG/l39Y3y39pFM7z0oAKFCkhY4ixywUP0CYPF5WnHjC7sC7J1HaeQgJ9VP2HQNgbR2FbSO3/ukpqqhl+DqzUINlsKRRk6cXHCOvJXp+n9/iT4sVLWjbqWstoQubPNCYHN1JmCBwMAA/vPCZ2rb/Tgf6cD9BbzzH5Z5odM/5u7/De9dspdgoymBeTy+yYi39pu8/N9BH8h6I2vzQgjADHdOz/U+vuvpe7eBixbEh/q/CYK7rzvhn8WAZhwypFKN2Y15p4d9d+p9Ujl5haDYY0/Izffrb3llAeplLtsjxCOUXqa9p90pCEnEYdvQIZ77yFs1Aj4ol3N+jvOfmGK2hDvrxQGfaMiC0R8aTN+ffbf7N8zkX8IcmBnHpvI9vRi7Bb+SLC6cOjPKj6q1/+uvg/gNEnKAcqWVqJhSl1CS+70WEdHBXJ+MKFjVhnx8eg4MppLbyWVO1qEXWFMC00G6UX2w9Kjw64ZTHjc1QkSY0RvJyPIXsdyRt/GHWZEzCtS0FFaZZBkYVgkMcQRg0KDWjq8govf8NTtNix8ojA5DeZb87k61ebnL+U9KXzsq//IPzP2OTdfEoOQG09+G/EFJM0IgZ+rb831NaqE5amEzLsb+5tqsB9EibUR6kObokI215WYdO8nW+P/du1a/yxzT5OaWMp3S9hFgeS/zX/n+1RS84oosfzt53qUgtalvaOdBFoK37G3BiVLlpOFvhN+seZwdAEGWHybPIDMR+yu250GaLN5NH9tF+skmJ+jV7qKuM9gYB+GYU2XKAjBs+DjkuCz1QiCEL1pNTQMqH8jO6r/p8mjqO908VZRr/KCqN61t5TWzw7a9c9n+X/+K5X5f+JcPAKrr0yhwVaR5V/qpLgo2CyGsWsVx/cgUlDyNTF3jAyYRrk3dwnEgpCHj3IqNaC/O838tnidp2uitp1SAVTfFGhVtOex/U+6FPh7CVLFqlZXIWPgLzg4bv/KaOe2J+JD9SXNPT4R6CjDIj6VB9voSXw0mkChU73DA5UqKU41vS/VqeoMpCm5WD6NShs2DHp4Tp1UgAt7ADUNeCRoW0Zd9Sm+44RFbcT4+QnzgRp1GCUq135SucZvdVObkNhH8rxV8VDpk7EqJ8j32PIfhIgwSwHESeL4nQg0y5nZcUeqYQRymH3evuHbM9MN666CVwX8j1ddxnG9fN4+u/8iCIjxZjuFNjrOPNFSorwzd/+jQtnEbnIUpPNWGJNUrNMQ+BMA69s8b3GxihkYO4VlgALLCNajXpsGF9iLbSefPbr3N35NFXR/UYJcDGdrlZWYkm+8WmALgSZakFGrEScpBkaxezU4zLZU/87OIF1O1kxMs2vrNjjt0f/qigrYlxjV0/aBjLtRMagutdbkGvaoMS/kIF4iCQO+HJQ+mQOS2W2i0866MOkYM6HvGwkQW+GP6PJV9rJrb/vxgBJ+z+DcRz+sSMa4w5dKPX7+guPYk9ACI8Rq5dTbxDFhy+jV979Xi9SMZmyHi+qc4C1mIrRrEHwMVmH3FWJsq1kvx1Wp5IGn2V1s2jPqcr6FrpTndBJDrP73IyZL0IMD5XVdjjt+9D/qBwXH8pujGfHnIcwAAmZ92utK82mHL4OxzEuy6AABBTk1GIgcAAA4AAAgAADsAAF4AABQAAAJBTFBI8gEAAAEXgbZt20YjQMonmdqIiEHEftIeIj2MjkQCLNu22jYEw4txQ0iySUPkMf9ZWkavpP5F9N+B2zaOZO9cS6anzNwTjBydv9MaFYay3JmH4BSQ2gPx3SmiFVWM8sXmDpI8/PI1gEETi1cwK+zhx2zLjJo1XfmJ24KqifhF2pp3xoZhrwTMQ8aWnWRbuW3yKhMwrYc4EErDI3+ad92lNhprYIfkta4OxsbiyPYdFjAwS0IWiuOasOb3gDxEdjRnoYImPhzb3Rm/5gjGqKjUMYKVSPR9iIdJiBnJvcn4biA4blENGKNsoNq2RU1UUDhmKEVnv2hKAqpqciOcdLjLTjRl8xIC24d5CUHDhwvIaZJ4c1IWqen+fmGmIqUQnZ2khNyVViLEo5xFanTldkdsTeEn6yGOHy/bBV/ZP1kf6GeM8pz7XdFk9BXC4emE/a5oMire5mksFLO2EFcyJhFJeXQ/5MrWzS+9MXRW/cCw2lp7n4JNneGcH54bEL0FlzJGgLRa1TIG2x0bHq+r5pJ78NIt3RT8ekCQSkmwadojlLtaJzps6G7YtCO4VPEhdY8M8fNBlxf1yNnM7b2TjLbRaFyQVO5lFIFTQGSl719J0HeHYDSvk2kD0oktW81/dBb/XxL8wv7/lxKUwaoJSgKjQXtJqZN+DVZQOCAQBQAAkBYAnQEqPABfAD4tEoZCoaEOVoYADAFiWMAyQ1BfqvOpZE6/5m1g7wQhmE1tv/MB5t3ox/wG+b7zzXO/2Xwh8TnvQ/d/NeRPefK+c60at9m8ebwD0B+h/n/eo/YP/WNJlLHNxe/eMqVlMFT/37lXTcbN77QLCR4qvyCKwtDShZA/PkT2uHFHkvaQA1vRB+s49gaXv10osdXSeXuVEaPVL//z+KgL8tSqGl/CrCMtDO3n8OvXVjBie+3oP/kgAP7zwmbVo/pvf9N7+gj55d9EdU+0dcqo8e/ktP6kR5w8C2yAOlNUZfiu9tzL578Zl3nzBkYvdhDIK5h8nvnHSS1Ji+fYf0GEyIyW6zI3Ka7KD+uwyQMGeomz2QT5fwnuti/g4CFU/VA35aiTAAcJABLOCZ6RYWEmgGhfvR3QLQhaQI/RhCDKUDsEIjzHqustkBZJKlDCz31smD2SZBcq57MdgdLO74QaEmWoloaIbfU2WD8JWr5GIjt0NW6Z8YMWktN5mNvnD4waAgaA6bGUCE1bPv8UzqSthZZOu8IeR89uQwGUFo4HIk9Ww++sDFu6CGfiYrXIX/w7Tl4fzzDf/oaO2KH1NmfSNaMZY6z6Osbzz6k1iau3XFs+/JQwhcJOzKqhUvxwilB0542CIX4hUMBfb39f84Ajkq7mooMNqSAnHfT3V+1TRtUn2JStyE4uYtqgPJngI/V6EfC1lpLVvH4fkii0M6k8gh9XcHkzHV+2YhvjafSib4ragI8zzCuTOp2mIjxtRyE9RCI2Zdsti8QKHgAgOyajT/kT2CMAfiurUfRTODQZl9VZqbuGTxjNA2tyyfL33OxgJglnVvj8LIdW1jlgf1k8z4y7G846imROPyXGxZZTPGvCqxQkPFTFX73xwFkc9LpzNdwOVQOseRIdTH9w/PNHQvmfP6iHRZfkCLJnZT7eJdkAf/sB/t9heVytcPH4pXpWtSZrCymsLtvQflFgxW2wqoXanen/V+DXZa6zmEWihmm5uHOfEAvlRzuPgiT6mRRkHj807tDqh0FaOvUXa2bTQWjX/+2YQlQ5RA2zDcabIYSuNzVikY0eiLL5Y3U6IF4QSnNqT7oMuwyBONFTrOEjwe0GlVNn5HadWtFxaTnLIK64KlTwB2YVoDNVrv7JJU+vbpL56F8lKuQpU8gdHq8PPpPKxtpxkUXLnwsUF1K1pXpkGxoSau0HWLa8RO6zALUkpGhiu3epP13Q3xbok2gm3UPhiUawMuLQ27Pnv7L87p8IRCtXYfIrhD/IropJ4zW0tJ7HgHw0KP2QX196yyvC1vDP5vJz8xH5whvE4ujQ2UHMO7S/dO48dRLPWRiJVHxz7FdV6p5060RvThglTKNkpju8nrfH8XgU8e0t8iFoZyoPmCBxbx13DKFuu/zZFMvj2pkdYEXkgyhV7bfiXoVGBvPpdKLCKDQduX8Jlv+z0yNaeOpSmf+4be/btmD7yh/vep50xOcVOer2sK0V8aNuT4se7B682N4EUyo6IAxAB6QyN0kqVYHa6TNAwqgNlMvAakRv/onuo/KiXKufPCpu7R0QWTYAHU3aMIE/jF/A+fB7vDSnlhjSyqNFbwPjQr+yMR2Alm/YSk27o7JtdtDBQL0sFrV8/Mqg+/hDouJpAP6QJEhP7S11Ry+SgYx11g+VoQZdC8oWidSgV5/nl0m+wafDaKWmswRT7qzq468Bmgz+NXFxepHrAAAAQU5NRkwHAAAPAAAIAAA5AABeAAAUAAACQUxQSOYBAAAB/6Cwbds2WQHK/KNtRMQJxP0h+xCJFxjBTYkAJAFg2yYxsqDLo4Mur/9/M0O2JODEIaL/DNy2jePd9q4Cib19YRKawHnvHVozyU+uLVPJd78TR2jbKYEe7uJiJBCkF0h6sJmA00NBaWDZIlv5MqLwe+4V9K4097/1XjbrXbmrP+ZeRgn4ge62V0Erj9RaEru9wXvrTt8gcK5F5++lDUw3wxyi8/dc2uBUdyycSuNMZcfsERYCz0SYW2Qt37xtAg53bTxEZovw4JhWwFTUUG9G56CkuGM2aRjeC8hvla87vRE2TrMjO0zc/gxRhRpxj6lfefJBT7m8PDRcHpKaMtnMVEQLOMi79HhoixpZPagpktGAZcjfBb9ntKg45pkoV39DlNSZLErDyBIK1R+LYgeaCmXMyq/lKdj5ewy1NWEK0MVUW+OlUj0MauOpW57DlLG7WWON73juUITm77k25lRqn4KuxiJfHSuEN18rBC6FPBzqp5pTDEScpfCZCP8LRCBCv4dLvoedhVWc1dUekm9233wF3ndr3yCHSP2frnbmvY6zZLsrS+DD1quIIfYrH7puVneTJwPfXFdDFLKWMBl6WBLmEpX+krqCIAaEMYgJvekfnpBAS0hRnp7MLee8jlWF2VoyZydWUDggRgUAALAYAJ0BKjoAXwA+MRKFQqIhDlTYEAGCWMAyrEAOfszR0j8qvZosH+Z3ppDMJjbmblDeMt5u/yeCAdhf+E8LfG361kv9r1/H+18wP8V4A7XG7eZQ72HVZ79crX4gUyL/HehPn6ejPYK/k/9r3zP9oEaWJu6vk414Ovw9MlSBqWpPtXC8nAPA6/iVHiJ7vJZf8aJBabM4/O1NgG1FX/85/KHGwZjn8G4U8tbWfFSBZFLoaWWRAQqpuPJCRHBzuJmf+RNyEhKwMxFsx6nsfF4AAP7zwmf2rR03vpvfa3/55dYBl3rDFKMmOtovMf9Pigxkx1OtIVJeAoFSg//wa+eYEisAC3+xN7BhE+WfVdyte26II9CKIqz6W8I3x0Cmty5+cjZVFjHusgWhDFUbXyzbhnIxf7W6izhsbS+Dj2+eKfcX9sp1vuXkZhsB0DbCI8QgOPUYrpUSN2qJADK9CgQQsvzjwj0Hs9SeDvrmweK2fSVOnsdqUlTrgvECsMlXOJ6XxFJAX+hGLwnCBjE1pl/ZqzISJQ7d8uR9d5eZ1DmC5P3n1WRdS6Essol6tycGaDEbbn4Y4RVnRJmMKOMwFnZb4bxouDe1rWKHffAFNW5qFvr/n9DqslX4MY1PmVV1kyqPnF1XtCBog0M23xdjBOJMIT+krlMwIBgFVzhGIAO6w9PrOjuDORqOh/eJLDFlB6F4cJkRyegtEAutK4RK6HMxsD+74T9ZeQd2QCG0waIgQiRhi1/eqSM6A1KfbzBbF4fJbVowazosz/ox0kC01B+dAe/ne6a+vF3WefQ07zS72zU5rRZErULFbpTglP9usebMxfkwMNHhIC+439Q3kC4A8OQvjj7f2n2s9ligTKWMHfT2SHtXiJHlcYu6Wg2xEuMIk9G5cqsfbCvhPYWX7rXkdy8QX5EnolikWRnQ4F5Ubx1bEQez6QC/EHo4prLQyPW78PHhS9reTDgZ28qeSMVb/nx7+B1zmVnEHSb+/lWGctCPdlvtFYIQTjmwkglueQGfRD+zDOaCERQzZ9P6MHORW511Nnt4UPbWrmqYRkpaua/lT31WlVcvq/bFbv0T3mINFj5fBSH3lKkPkDb2yGEqqxPWUQ8ZB2PS5pHZlSXk/DYKOYT00MJFT1zcb/Cve3zn9zYqmAtjFnL5QHeH3TIX/f1/3cGN3UKkEBw3W5jisFp2j4oAJFAqqVJJeZTviqE5LJxIby5M8o5kTy6R01VEvL7kK2iPxdsJIPCMTLUOfaBFJM6RBFkt3K7OeOjUp5N7eAnFDeDEPK1w8dUndwebyeO14aZnR26auo+TcTWWx13gQYK40iRut9/5DVboETbmdsMq/y4/4KZtXFYtN838P5NIT/q80/h/8Vrs/9S0SOa1PsZ91EiLH0PCvIImCiL9U8KEC/cMWtHY5Tkh4lWMpeVrpa30eILfYIOZPYx1MP1NWea3ehwGz7IQu/BMfWkw00pcnAeF1+pqBMfWWO0aLuwf2mB/rHqU5NiBAggr9KuLxBx9uf04LmZEEmZxFm9uy0rcAP6y4+gLnn6fmvoZuIvTqcZLJDbzylbVhymhhRXCPjJFdfwFEOtkot1i+flfRett9gnD+TbkP+ISJlAWTJJU1TajA3kNAA2lL9GryD6HeSkHS83i8iGN1Pv8ytf+BdqTPnkuEWmFwvnWnXRwrM4Cn6lEPy3+G7HRK/9OmLyFG83KaeAuaj9n+f3FA7D+Yvi1PcqCAZkfFPe7ldFDu9E+QTHwjxlWIYg+y4ap/ZC4+b0Tri1hmoeX00Lsd21tZPb6y6/AAEFOTUYwBwAADwAABwAAOAAAYAAAFAAAA0FMUEj0AQAAAe/AqG0kydGJlACZ97kbETEK/6SFSM2wnUiAJABo28ZIChmynFVaSUX//2eGLMAdx4j+M3IbSVH14HYNHBp2vjBtXpx/CFgAc3kIzTGoq1J7k3oDK7RFuQJ1kJThywbAaIbitffiHsxWZvdD9poWs5Uu/6J7hWqGuI29TOF2zsJ86nJI+fvDKZpPT1685a4RfsCHeOa2KnyQBlScZyq1DUndS/adc+EmkBsIo5QAJCEjyxAl9VNWaxDs8NWGoGPxSYhF5ohSjYgp1dhMKp1A5E/j+y/SDAu30QkFBadC6g6UYyR0bU891GEdmIN2qDJIA6GKNXouXbxiY6WZoplmSmYaoHXN9pnIZpMkNVihSxt1LgvDuHa4S0pmNxZ4ghbTqAMajJAKS9xbtlM+ATwuXxd+geYJLkR6y8iqncMl1yYUPgx+4aYgOeh8kZ4AIfa+aHYhUm2K0vu92uWhPNjNO4IMFOqa7iUPvqcspngewmnVpLlQDK6X7ZgQRpyTCaHvRJUSeljJdghr//Ov7AP0Qhq/5Gm5k13zY5RC70anhE7Hrel4j8HmXVbU39i+jPzkqAfLOJk9zBZ1pJVHixVxsiIy2hHTzyFGO2KoP48IZEdM/yUigRmxeH3iTwxbmyD+uLCVZ/UG7qUwv2Ys9eI9opu2IBNWUDggHAUAAJAXAJ0BKjkAYQA+MRSJQqIhIRm61RggAwSxgGi+vGxvCf8x/RvRttLZmCM7cXzG+cT6St5e3m6uYvwHhX44vX0jy4X6YhkXM3i13jOB2lHzIf69/zvVC0CPS/sE/qz1qPRQ/Yw5/QC/k+AfzA+QqOkE6arfhhgF2QOyzXmOaSVXgd5LyDM2ENd1pN0fzWTd2xES1ooJlr63QRGS9O4FHAGw+6chsFk9b1gTfjTroM1PAATbN+42BAOwD6nuHXGjgMfinynAAP7yRK/69H/PR/z0fxY/+Zo9AtJtNIeqT9lwXMLv3phiFI/hjgmzJigCoMedJyxVAH1B3U0iG7dwnC4zAn6CNvPkhwRJlnCrCh9GPM6Lt8yymwCnps6pMd0rAJYM95m6DjXMz8hI/HiBZrFPvrYYI65Tt4aTzS7cfm6VQRKGtjCQTR+u6oqscBBM7RgobLfTUgAvIvrPko32Wr49AHXScYYemHCZgdXPDjSCI+7PdX9pcDIssKmytOEImgz6GEiljyDOzdWmVoY8Z+3HOWAfF6v65+UIHMUdH/hCqyGrERSr3ckhWO/TG02KSQH0Xn9vxHjDblqDCgPcYjPRUL4uiqEXOFYyaEgvXTX+6WxdjaW1IeZ68h18BPU+kQthb7rvDOVcPk3+7efNYv2XkljzBnR6RgKs5DpmPhZjhLEqp8NHdUTbCeT/naE9pe26LXmv/a+MdvAjcjNTee0mw/veRFDgtMvtZYH9edFw8erIaw5JV37fGu7aCGkbQ4atvbGyee44Bhk8eGckR0LRJV/tW2Unh+b0/qkap1Sjdy0lYimdoqLXeqfXH6BwbHWhYlOvItqR65RcZIaWw81mEq0EGPTYpuQfe+ByHPdI4rupF0r0UNMYY4i2ZPUW34p7hVWTYIP6/l2fma6sCpJn14Mab0q+YAhnw3wMAS8P+9mR5zZq/dhV2+3Gu5bt0/YwCOTsv3XrR8evxNd37bcy1JqQkyn/A/2/ZHs8/+JYyzjqng1WcWnzWP6MHeqIw890lxHCi+i+UbTc5A3NWFIk4MLRFfN8lOE8cb0BUgus36EPfgiHFd84VBErkEtNK/sQm8OH3UcXhosWIDb/LbKjvtaVSCQsMR/NhIn4hZ4CE5VlHQ5Pd4bXks0716mLJ1n/M7QgRPzheDh2fAIl+Xi8aZ3TEcoxAlQmuOsOU4UUHVSG+Xqx3kN7zJUTeicCGeKWozhng1lMXmYS7XkPqOYdDWpd7MEGn9XJZho6fEu3Y/o3735qqzmHscBi76xGMOvzs5e0jXn0e266wnvs4T1lMot/0755HbCwL5usDdyGoYU1LjwyiAAeMd0Lg1tanxa4S85b2YsFNEFxsv3d7k7qID2nTLdOMC1mConOJlvkUnKr0p//Bda+DiMsnhnkhS5B2r74wsPSiS/tiNMZe/8ACBVH3nxJHckTM/ei6Yxl7/wh0chxsWoN7rL6eavIf9Dt/McEQEnk8EBmHGb00q6V9mILFna1hf1sa6bmPYk/mUcgVQ0AysM2NTWDG72GX+k3ArfzO1BnEStcSjE+jZ6ygB7P6jfwfzNLHpvygEVYXBtERDgKmxPZlD/tn+JC/FyaQx9rw+uCzIyEfSnguxVt9uaXcKCR0Qbb9hdp6Bd06Lm7MbO7XxIc+IhP+nfLZTw3yEGfWnkDjGu8rl/ajWP6wm3uOaI6Cl4YuS5B456mhGADjidPWkfX4HNYSWYgON+6yBPPkj+Yf9AAAEFOTUaQBgAAEAAABwAANgAAXgAAFAAAAkFMUEjlAQAAAZCjbW/bMFywUIPrlNNUpB3JlQNzpIq0A1UOcuPiLgE/0saIcOC2jSM5u1dSvC3x7BsCxKi5GgW4zdqryZrBIZLjrdV2BkXTHu8t/VmoDAXXe7QNFOnojhKdkAMU2akylt+ACwynysHGCfPfgcsJybNd6GHEt8vXNbMc3kbYlHdZrZc8wEbNYP66HvvtDVnuScPrtbSbo8rqKzUe5tLWo8G+qV3paLPNS3VUjMhqnxyNmOu1zvp/oO8sHRCTlM0RJ8yDx59aUjS0vx6SOIYA/kAMD2flDwGM6rRzw+ps0vUJVl7Bykdi7xPYQGwGWMnDi3rWRHwCc9jrjCqCoXKKzBURp8wUfLgqgzPhKzhXJ6SjE1c+mlKgelQwX9ONw7zGwVynYUK2yeFcNlplZks+S8UvHjRIxbbGlYE2v/+mIIjV+caZJY36I5IH8/7bf3ckG3FMRbECTu/PZWP4enjo82SOt7f4WGX+oH/LuqbfCMeuW8YUSAzJucMzH5B1bKvMqEcHakk3Hhs2wtTZXr82kjjatUVxPQ8HhFCyzVT1og3BAItY+lceuLgnMJI7hLQwU7UNurADfwQViRdV+sOo5l5Ug81/JBXXDiq3wj8CsThRhexNVRhdWNp6sxoEtMWG07zvVwAAVlA4IIoEAAAQFQCdASo3AF8APjEUh0KiIQ1WPkAQAYJYwDJhYf/HdWxWzrnm22HtkhM9vRzseml7zl/u8EA67v8N4N+JUBe0P6ioeuRc+Nc+q4Uc3qp/1f/c80P017Av62dZ30RkS1sscROsNesRFbfMUPJk/YMHYxogR1RwpqEzbFsXGIt81yPsCbt//+HiTRDcUCob9DgVy+7Dsb45RKZ3z8b6A+R5qxSQu9O1AyE/ITv1L5dJFCgA/vJEr16P+ej/no/hC+Zo6TbDa+fdzTCN1H70LIJw6iW2oD2ZP8lLTkd179thin2c09rgvXWipr6B9/1t2ZBgbMy1dPxNgkZpAAEolHPN2W/oFEERYMT1PBCpUzMLPyq8/HhNL3pzDE2OUT1Mjrf9ktgE5kb7scZVIBUjQ/RA6vyEDR4Q3+St3W1a4j5f5bzcWiImwmMgJ8Px1Uqmdhya2lRjR2qR9QQBStG0CSikzF48JoSJQNeUBVO3aQn15Brk0qsvEgo+PlUC55B40GCwTMQlNG7mOg1284MZ0j10jbbSmJn083cHIZihws6vTt0GYQz0Yqiq+KNlRwGwORFtDs1De0/nNv5BFDOtXlYSZSNhXsCMUIuGP8Fym779h+t1C2c0LKYLy5A3C5RWHdo9nWpQVhS2LFIpK2rK688I2DCKKlw2kgtnjbvyi/xGXiiRlo+c21OMqRs8I5AolEVGXuvOwvdOBhebkPBwPfdn/M7Lm5t2irEC4AXNaNzo/pFc/iSOO7a4r+B0L4Ie34k5G1a507Ny6BxbIQ4ob+FHGRpI/c4mBMXpwkNpxLpaYWoit40f8t33jmeVvy+YF+sT262NTPaed6D3dCQA3GnsQJg04Iowd/ecAAmwSa9v4pSpVf133rsluN0OAuh9oMGvvakThcoTQlWbQL3ognn3A2avQ6uECxKbyNPA9WtXSr9yKBGrj4341XCN5PZuLmOFwNNmYfcEdN8+gZQpWd38QMFJs9Y6X/QNFLJzWBh8x3G/GXncf0GOYIz/hi+3oZEgaVOq88QRXoE4RkpTlNpyMmFyCdQsq3ixhPasgHgjTo5DMV5Py1iS2mqyd4DsnGmbWv7wV0F6hInA7g76kmII1bHJ+br2ql59D+HHqzIpKhUMcCzUO8UhZtoP4XPDVTrZqaErU3l5x6uFXQEX6OyKn81yxOALwIVdinuvsBP1Nhmef/zhrzL+rEJFbrA8csb6wAeGejb/uGmDuETFhGaIQaZZI73+Qcfb8a/yfiV4Hnbvx7JLlP5Q6pY+RqZ2rgGcAW2YcqP/CEf5/wDNuJPXbCurp8YB7wxzY2QlXl3YMFi+K2oIegiRWvLuClCBg0qppT5a/Wq+1hPwtkx3hTg9w0EJaHr/CBS2Z9Nw6gJzRzEmD6OlYr2uTU1dF3tGDSzVDxlwkHqIqYuzU341rXyBnnAfAAt3DwJ85qwS8QfYe3LM9ND1zVm42fAKJwTwFnXrdO8lZxeUA7qiJ+OW5xkTXqWlmhf+O2v/sCWhsYCWz/mhTkZR7sTwIcXT6MrIwfwegttXxNx0gAAAQU5NRm4GAAAQAAAGAAA2AABgAAAUAAADQUxQSN8BAAABkGPbTrM7amigUOX5RDkNKFJ8FHg+OeE0n0yBGhxw+AEh3lt2GRETAGe5dSeNNvuhnEyHt6pcad2ft1Uh9xhV+dYvTlXYL9tNImg2aSCocmW7SpsUp4rqJqFtl8wmAVTHTWwe8Kpc6TECgCVSVx8cR8yVb+pA7vX55irr6DhSE8woZhz6I+ZSm/AzI2SeFW5LsxVCbmvrLZCl1BZnK2M/ttURhOMyL+VXMUohL8pWiuqiCNKhreQcL4rFFc/Rgrh5WOWShZXmFksxweIoFWA1VZnndpkrIhlhuUkiERQGiUoaqAoUp8EVgWQ0mCQQQKWfq6QDeao4Ha5MJbNJgE28EqozjEpCm81Wh0lTEXS6sgnyFJMO3+a9AuPo/RzjMvSp1DZf3CIbcpNNZomh1KQ9LDSUahOuwS6gVJt4JRDHwG1lkMKQ29pkRGzIbZx5rjgBQ6mN54AY8s8c349UmqNU23AOCACAtxHCSAtT5lkbzgFhcCyZGfAjOSAM+6HippBP1RwQJpF7nO6bKZP+qoksTLvS4QsGBH2rOZIBwYHiQNJ6siC7auF5Y3OHURfETvPKQi/8R/C7IHeiMlc62W5S3D+IzZtA3CV0GDdp/nwgPvURlQHFXGvyCPotkYGzEwBWUDggbgQAAJAUAJ0BKjcAYQA+MRSHQqIhDbVmABABgljAMqsZEYXu/KuBE+O27u4l/1W/Kbz1XPX3Twb8XD+/CXP+jVHr95R695xaVOdT/r/+l5wvpX2Cv1n6znoXobUv1CjfBbP+f8uFdUNN3os6tbUEY8uehPWD6Xq79Zxce0ZXjj0IJ2CGZgH9vDMeCwR85veO6YfjsoCDLGachtHzsUhL2HecNfdlMtiSitRMy/pMZZuAAP7yRK//Xo/69H/Xo/q+//zNHfJsNw5IdaVDyHIrRYqSBJGNc/YNxtjKL39u7atPYeh2HPFsKpXQPsrw7GRh17vnafC8zlgTOPWp9ad/B3eV02ExNgha4aL7c8n0PXhr+EFDyHsntD6NV6YJvjM770RRly4hsYIByndGXnOhKQDATws19fkDFQS9W9ObXo+8iL2fzIZhW2onRlrP+kGRtZwi1TiZS1hLNRoaBgE42ja9zwPqGhCLH4/vMI9X/GE+PKEX5YYSpFPxC59+tq8GlmqYaXEbVH4LM93qMHlicU1vPvfoZgZkbSSJTNE6ivcMVLFYYLfFrT29uKv6ksO74ygGSh64Ot9S43mGjgpBXPt+luIwywJTzKAI9/o9mTABdFeX2o6wNT3GZTT1eKC0oBLFPVjKt6WdrE/O/FWac/m5Cw8CkfHn6sFuUB+98XMKz/RcjJNqpuUp/H2NxruXj32JUobz7QZ2c8AHPaWoUraD9n4P0KNMHqTEysqzaiB9vCUz/qp2ppupq9kQnJ62gZR7gaiP7ODzTopOTF5QrV+Ro41LfLEliMAqZyzAtr07D2KUCLSwFQ02WZsjDentwhROtNsxkcrH4hUfA5yqtETadfxW+WADJjt5szlf8JXy/JWKP8HlpVf3T4K79y9XyfG9T5qarYgusO2/3r/GM4iWs2RMevp/Ru7WM/E/Srl+Gr2RKOwxfw1kZ8A9qk2eKzMPleUfutwb7qk4eLu1nqm6fedFBnWB9C5WYz6QPnvxvISDWfyxVtwuHCE4xEdltyzYLsZBZQA9UrZ/siA6WbeXtErVMDeUK+FJdOmaCqAXQDovZztSzngxs27O1yk+hbN3//j5dYopyQZ+qHPfv5NA58oF97Uv/ZKIj+wHOT/3Yfalqcf96kvAm5uC2yyprr6TNyWbz3SmnJbO+PYdCyZTd8xX9r6GZplTrr2kbtBCE27K2ASZ7e1D99yuciBhwATZAhLQwg4kEAEzLbwqCeWf4rcJjJIK0jeJjjwuoPIQ+zijELUeCqfAO4q2rfvxHf+X363TW9UKcDrg/i6dPB56uLssGcgofO7ifTk0TEWVDgpIgkI9D5bN2AzZ5ozVzmpiRsPa3lOwhry8AMygEwI3roKtBL80XVWSgIVyk7yQd6NfdxRFeNAb6h6g2HQmHYz19CVfmCJgC7wNl2989e5QFlYWVtAgbB+7TCAf3kJsVinie8zR6S0iEtOiCnseSLiUciSTLL+6Z3SjUVEyRhShAuC/3wbVYMPTiudAAAAAAEFOTUZUBgAAEQAABgAANAAAXgAAFAAAA0FMUEjBAQAAAZAjAGzrKlr0AXkw9T7VlDdzFaY0Dy/3ob0Mph2oerApWkRJjGRTt4iYALC/vjsaHEHPUY5yyTvsT0SKGyJTR3PDDP1SbogduTLaaojqOwp8qriOogyWaYgZOp4bYkeUh3ClYTVE9UMU11HghosO0a9W1EOU0/y6pFRFDmSGbt/QeCA9dC7sdqmwhhxIhVa7XSqFRX+lgYtY16BAkc0iKK7EvHqNaJdJI7DZDJqumK2GqH6ITCqBbVIMoBrFNBEoX39twQHUo8WCI2QPI0QwDKyWyMIVLQ4wQsIRagBTykoRjGed7K2iToQRqh8ik9lKZQZzXzVWdq4oVD9EcUMktMOksO8AogI/whFkBnPca0SzkFiBgxFOVTSLs6GFRXVBk5BEk3MkMMSpimJNgcDSLyyK/OAMTO9n0c1kQbGKcnEG/iCtzH3glKU1T/suaGFp5MXDqoeQpDVPCOCr3f0qjbx4AABXzOiNNOYJoROYT/Hi4TgupVoFPpYnhNPorlUjTD/w4qHdFSMIX2qKAaEzfOgRfr4hk5JywwxDxF+fr0OsZIj4/2U1RPVDFPfrC/VYpq4gJBapKUDnGJboEfpHUAcAVlA4IHIEAADwEwCdASo1AF8APjEUiUKiISEXXF2IIAMEsYBmveYky+c5aoCD2O273Gu8P7zhgAH8A7Ov7X4R+KoEOdn+14Z5drCbTnfFuhL0K/S/sE/rXvo36wF7Btz1LwSiSPMnlEn8jBFIn9EopNT/lrCBy2ebwXMv4hzb9HFwLSXDSSyO3kCtm67GkFMT2J/FZq1T6Z72O6xRGYdDyLb4ZQTCHDUlzJ5ap3v+ElAA/vJEr/+vR/56P/PR/V9//maPkjsNxxyQiR5v/f9OpIEm7+Fb/EjDUWydi1Yc2KhtuObyQKoLlZ6TDPbKUQR2M2iFx9/D1FrkYhn7wQM1hYcqCyPKxoVfome00DSy2CM/sVwJSH6VVhcr8FtyoK+4a80F8ijgwxL5XNk9IDc04BdFwcP//xnn3fgkb8o0d+/UE2V8aTCgc6+AEkI+sXRy2qninxCYdMpi6WIQU1sRjMFZJI1u8fClkFPWvEV2eEI7GUPmYs3qh7eS5akH5fP8+dzYUP/Z039/c75rgzRMajWI0AXhK61o3yGYG5jljHwFn6PD39YKft3LHioMI6cMh2DmXp13PRr89qllVMYr/pjwhv5Y+yH+f+V9ppvaL2wlEXWivviLj67CaicR2cNycbHDdt0j08mzKA38o6ZGkmA42tagMKJ/L6acHX6MBQpmz2poJDeNV/dxCgB1/ubQJc3BKxj2QsUMuxrkprhxuLHYSnxS8bga8xWtV5ZvZMRCzmW+bkV0OB51ayEnr7a5uyb43TpVpwWM3O3TgZK3twxf8CsLrS1ohSe5RDO47wP/tGkd2JIXRaFLCAvHu+UbLbvvgOOHPB1tfCeNN6Js4kbTykvGEYsoRBGQ6x7f3SHMNTvx8kbd3/of0uko5bNXwnFm8/Puu1A9mBWcizCpexoj3BwpMrvlGhtXoYnRNeJDpTNkf2jkMkGLhgrgvN2E4YI+TSbHXCHq3AICct1ItbFonr7PGB1Z+VCpTxpP/RVxIcHulfvEJAnyf9rHU5m6XbpZCNBoYCPOOPR2BC/4L/vspMOCZfHq/+TeCcbwGyYn/Z4jYG8fDzVCNc55jImGYCR+idcF3AKu3aFSKvlX7173tlFU37/GUJdaEV6opZXIA4AUBG/PG3wg3lP0S/9Dzg9ju9dqzI/3dT/QASrqF1nNXSe745o5/q/2aZ3ODIenO1TYmWbOdnjIN3+S2wVQhXHJSATUpVIdX/W4+FLGYNsqy+dzhcWKF/qmJeRzXcL/S8H581+QpQf5vwGeNdC7FO+ZEnyVYb7MkYkl9udg/10/Drmypl/wtZj91+MxSixpAWl1i2Ivao54M+d4IhHuw8+8bs/xYuoo7s0RWq1/X57lv5ii5Gy8s7GqKxW8jT8j5Mm1oIT1Bx5nh5voWw67Ly/T5P54ZrQX0KTLF0EKKLSWn/3+8Ymd76FyuyF+lonod/uNhQ1BC7gUL5ig0qbciNrXIKdgx57/E77VDezT9rx7Fj3DoyIZnXaSBRRSfZ5LT3PfQYMAAAAAQU5NRiAGAAATAAAFAAAxAABdAAAUAAADQUxQSLoBAAABkGPbUms5lZAUAS03H0uAhiSCT0APySI3IEtAJSQl8+DBlTqPiAmgvcb+bQjY3LS/yyU6g2KbDuU9nqZHIaL4PhKHknTc7GNQGSVPZALlOpFQbPunIp44FCejZlGi4qWJyniZDhnp2lprff4adpky0VtrratK2ML2hUxMSljC1vrLJdcmulTCqZeXXFvruvPGnHBFt3dP8/xV91c+YRtAIjhxZ5zsq3wm6v5MZxNAxKsO7osntO4Jrhi47gmuMl4iuOrwEq00ZYu4JbZtKQaue4IrBq57gisGLxJcdXiJ0PoNo/V3hpY7WdQsrY+6WJ5vSKv0K+M1i1cMXiK47vEqg/WaPUFJ8Uxb86kv0RnaG+Scp81B9HzlPUF0YbNbgujKyjuC6NJMG4Po2rQhiC6O64LoYnHLguhYcso3133Q7KogOpZARMa2XV50XAP9PVHMoqjjW0eHvg8SLXZ1cMt0nHQXpaNbplPdL3NVtdfENM6DZpfRpWbPNMkVwDDN2zaovO70RCZYJ4OEE3UYcdJAHF6zMKbg2TYoBi/Rf8z3QcRJeiwOJw6axeEkBzcGhyhU7SUyQbvoDe0EVlA4IEYEAABQFACdASoyAF4APjEUiUKiISEXXF2IIAMEsoBnOKCszzD/Dfxi/Wpx88J6Od5Aj33FBzvhSEjb88qx753Y9c6MeaGHzL/S+wV+tG+Z/qAXXZ4p+oniYb6PEv8f8BfZDK/M3eaqG3aoV+YLF8tl/66o/94vNoB7YAgp1IvFfitq+0wg1tmWmkYxh84HlMvLEhsyDw25QN5d+dhkrmEuvQwFLpAeBzUwS+2ZOKAA/vJEr/Xo/69H/Yzf2AP+Zo75NhvFl8I/N4oqqCyQX5ATZnbSP+Wy5kuRA6h4Do2Sy5msdGntgJg+IBKrHyHSz14Fl+ljYU7sVU9G/+IuzwLNSOcHt3BdN+S4bxmDRrPBsv7VlJnMZEjo/MuUK+EI5BBDz6NkDOxpSADeOfRHmCXQfY07PqvOnLsc504iDbmgZ+Oql+1y0fTd0T1lHJxP0Tsb0oEpQJh7cKh+Sqd6CCso8942J9vQ7copKPM85t2rrT/NYBJKvL8TR5G3plahrS1SDzDzuvGnsL5tL5SzLFKmhtc3wh1e7cgD738Gvv37NOCZ6VIvPJ7Cu4F5vCwHxi8DXt8eo52+mQtw3iUpDOEEYHrTc6zryd2mp7CXhyr0+Nsz8EcGlpgy1zQa3cce5e2QGboTbu8yVzG5br6C45ZbA3/6a6jKRCvr8+RDtrVwQT9PoUmiU7CuR7NUkiBIak3xF/6P/vZOFHtzUVSgwmzEus70v9iKNgWY0D5oRrWwPWq2qMdHfRCpv1Pjc2OFNF0IQZagl37ErcpCEKTo0A3q7bdOMn0L3TVFyTTRqJY9wQX5WE/7vFJndrk75Seebm7mBxdWs2EZNJFpo1Kn4iZihwv+kEBMlQ9seYsMu5rygJRtn+DF06Bv2iIWoYOkf7dBS+LFLO+8kpQdKkhON0q4ji2WTLNqnANp7RC70vlYO0Mska/GxGufn3SAS34sx19wRz36I/SD07xIDH1IRr2B2lk6l7wpArTdKuD8rp2P6E5vxtKtFudO+d/ZB8DOp13PGfm4U+w5Rj6syUsEZnXEf3H7GzfWCTbyoige4Xmrt8oBWPo39KzhQVbySwBquHG9wurDazw8z7S2Z/RudzD0l8NuDikAwz8E3fJ/4JaCZ+U/cngem1byiwm2O8RRQ8OCS8Zhx5d2dfGSuxKfydamIun+b7VT9oWNtwZyG1LIwbWTP0BzraQi7VkhqBlrcLCEfwfQNjWZ7riDkk3MP2Sf5q0Tc/qTFcqvl6dDHsQmQINkFQYM1M9n/xrtPZXt17/mgQOGO0RKPu+nV7AM/3X9p2Cd7XXbsJQkh1p4xiOrGvHDY+x0A3sgFVmsFDrjppxUWZHjGHecqDNQe+81PevF5Jce0NwSJOSBhT5f01RD7FjI/NTF3G3lK9ZAKSdG3iv4FUwx3Y9gWs4c7pxxwApPIwxu+DLUyX3DAvp7YFcIY+T44xnaxgAAAEFOTUbIBgAAFAAABAAALwAAXQAAFAAAAkFMUEjdAQAAAffAqI0kx9ktqfq1PHK4i4goCfJHkoZYG+ImIgEs27YiNY8moibIi7EDQs1/nDYUnDTfEf13IElS2yxJJx/nNODDT5DfVKy7FwvK38q9ZD0ECykuL6VdoZpetRT3P0g7Ohkmau4oMaMrf0ctQFhVemb8Q5hkS0uFxirJP4NV2xnnnI+HgHWnUymlLkvdmZktZteWgdKOdmgvCoeD5tKWsXLsX26e4o3NHURmc1mAor1mTkRrof9FECqO1qnrGRqhuLIOAFXfXwe0bTNtu0LbvsK2RMJOK9sEAxVMYba0p8qKGJulMNsVT9oWZaBiKaye9jwZWaEQtiXStiTaNieCcdizBVrZCkyhCuyZg6AU5nSPTFJ48iO/YUT0eQrnsooIPBc6U58aSWEU1LPlZEHPlnUwBY+zdyDP9t5PzhAK83YmY5r8vodmAmIWnY4bHysikmMTNLdRvCem7AfqyczpaxxXjpTqp7Stc1FHOO+B0nkOhZzOn52jBuNU95mIGmqnbd8qETX18meJSNTQejmtjkSd2GW+rNjMQBXqa4rtK3QSSN9Zg3lsINTBzW5eIFL4oNR7RKUr5BuKlNLkmpjZvk9G4JNSEtizBaHKtr5GRWs93Uew3pI37F81wCwBAFZQOCDKBAAA0BYAnQEqMABeAD4tEodCoaEONbcADAFiWMAvN1BVt5FfceVO7H87ty+dv9GG8Z+iB0xX+lr1zFHy/++o/tw/1KRIsiPhLkn3QkAG7Pxi/6fyRI5PQ80RPUXsDfzD+z9Xz9u0iLy/RGo4Y+HZqreC1oT3d8a0nhOKpA3ZHlLVe+O3f7pCuPYkyH5ITkX/D4b4KRs5i5dabLOqYKO8VoheDq8t1olzeotz1aZoPF8clICw5bApw9BbbisRUVaUHAAA/vPCZ+1of07v9Wh+W7/PTOwPJHjib1PoT/kI8VN+YnY3T4Yqd4cNrJLjhobo/I+xM88/82eO6Z5h04ZY4CzqkEVUsFyxmUJwuAbPFPH+R+61SJCtwXyKsXyUtUuA1D9Cz/f/SKB8AAFdzBi3zptbdPTv+d1J6WPvtsZKZ+c9G3eTfbp3ZwjDO+Y28lelRZ01LUsXmxSM4yqQljdC3EsxoRSXz7a7R5SOGtDYUU+RU3onaUYWXLAz/YQzLfddWGyFdoCQOk2I886eV3tC2hBoQJLNbdFE9fQ3ojJtLW8IqNdKr1oYlqVYsli6hxey8C4RR7vyF1V4cUvekZkSe2qo3QVgsE+PouvJ+P5PTd1uvbrC+Hrf+0QF+8JI7hwZUTBATUSSV1hn8G+qleDWhnL2hTq/ThhAYq3HCxGrUVyc33v+AoVYZoxX5RHRopAHmPh7op8M2euaWOiqVBNFk2UORggrk4Vy9dsk4DCtkbkIsAPNPX3Z9+Od8GPinf77bVEJNHQ8b9jrCK6Hav+SEXKpHY9WYummHd4c26moWuVeGRnw/xUQ+KL/dQlZLr59fuX4ihjll8psfWMq3MLJerRVacXfihJoLK5qJAVK9gzGTpWg2uOHh9o9Qb/s/se3V31jyYeA60/3e6V8SuqDpuV9TFgkxsoLB8EPgzjBHi1KT8P+WvDyFf6+cltN/l4MbO5+s/9Y/zNbuwYn7O0UbiAAeP+2Z8Qh2odrSf3GjEomEU3mmctsFkd/cVlEYoW8Id4depB7WO657D4SZ5jZOlpNusYNHYhdYuqr3358YXKv+nNnNyKzDdDM+QTb3fiLGlWGqiGCk+cptl6v4GNTzk0Mv19oXBYjN77x+9j0bgku2pblIDrHioEkrKyhM6+Fl9bwJ2HdgP9pG9ZVOxRhboTcF30FO8xRvPRioNfP8CEzAMtv4XxAYPT+R46dE8p1fOHjD8NeF6aue7fO7WTbtg4HRBnqp/1r0VTjUKIe3s9e8YiPUT7d2lMs1jMSjOggLDj6Uk/o/L/joYK605jyL8B9o+C+i285ioj40FVH0M6PE8wQVzeYyjOU0FEF9Gyfxut1EF8Gj68WOtA4o5JLZGfa3U+aJV5cPDdq9Lrd7sZ1AOwtYVr7mj1YEjvHU0pLyIHvOm/tjAkTJ45Y5A+EQGZ/uXmfDjtU5pyK7h4SvlJicy2fBv+EBbz9Pxdtt4aNj0/jgLiNdBKDi8IVrSzfvO4JFL9rcnzkAvIrNOii3XQh1rds5QEVw/hfU3wztmqIzGLQTgfj/jwPmBul5DbSkgu6rU4D+QzmihKkNHZLA3unp5QUBjX/GKO1X6bY36g4G2+LnTv8DutSt09akyWaWDML7H9CF/DzMgsAAAA=";function $0(n){let e,t;return{c(){e=V("progress"),e.value=t=n[4]/n[5]||0,T(e,"max","1"),T(e,"class","svelte-x7e53b")},m(i,r){G(i,e,r)},p(i,r){r&48&&t!==(t=i[4]/i[5]||0)&&(e.value=t)},d(i){i&&z(e)}}}s($0,"create_if_block");function HV(n){let e,t,i,r,a,o,l,c,u=n[4]!==0&&$0(n);return{c(){e=V("div"),t=V("div"),i=V("p"),r=Ne(n[3]),a=K(),o=V("img"),c=K(),u&&u.c(),$t(o.src,l=Yo)||T(o,"src",l),T(o,"width","64px"),T(t,"class","progress-container svelte-x7e53b"),T(e,"class","dialog-container svelte-x7e53b")},m(d,m){G(d,e,m),N(e,t),N(t,i),N(i,r),N(t,a),N(t,o),N(e,c),u&&u.m(e,null)},p(d,[m]){m&8&&tt(r,d[3]),d[4]!==0?u?u.p(d,m):(u=$0(d),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i:re,o:re,d(d){d&&z(e),u&&u.d()}}}s(HV,"create_fragment");function $V(n,e,t){let i,r=re,a=s(()=>(r(),r=ze(_,v=>t(3,i=v)),_),"$$subscribe_progressDescription"),o,l=re,c=s(()=>(l(),l=ze(p,v=>t(4,o=v)),p),"$$subscribe_progress"),u,d=re,m=s(()=>(d(),d=ze(f,v=>t(5,u=v)),f),"$$subscribe_maxProgress");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l()),n.$$.on_destroy.push(()=>d());let{progress:p}=e;c();let{maxProgress:f}=e;m();let{progressDescription:_}=e;return a(),n.$$set=v=>{"progress"in v&&c(t(0,p=v.progress)),"maxProgress"in v&&m(t(1,f=v.maxProgress)),"progressDescription"in v&&a(t(2,_=v.progressDescription))},[p,f,_,i,o,u]}s($V,"instance");var Mu=class extends je{constructor(e){super(),Ie(this,e,$V,HV,Ae,{progress:0,maxProgress:1,progressDescription:2})}};s(Mu,"ExportProgressDialog");var K0=Mu;(()=>{let n=Blockbench.addCSS(".dialog-container.svelte-x7e53b{display:flex;flex-direction:column;align-items:center}.progress-container.svelte-x7e53b{width:100%;display:flex;flex-direction:row;align-items:center;justify-content:space-between}progress.svelte-x7e53b{width:100%}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();var Qt=new me(0),or=new me(1),Wn=new me("");function Fu(n){return Qt.set(0),or.set(1),Wn.set("Preparing..."),n&&(or.set(1e3),setInterval(()=>{Qt.set(Qt.get()+1),Qt.get()>=or.get()&&Qt.set(0)},10)),new Pt({id:`${_e.name}:exportProgressDialog`,title:w("dialog.export_progress.title"),width:512,component:K0,props:{progress:Qt,maxProgress:or,progressDescription:Wn},preventKeybinds:!0,buttons:[]}).show()}s(Fu,"openExportProgressDialog");var Rm={...EffectAnimator.prototype.channels},KV=EffectAnimator.prototype.displayFrame,Rl=["variant","commands"],Lu=!1;function qV(){if(Lu)return;EffectAnimator.addChannel("variant",{name:w("effect_animator.timeline.variant"),mutable:!0,max_data_points:1});let n=new Property(KeyframeDataPoint,"string","variant",{label:w("effect_animator.keyframe.variant"),condition:e=>e.keyframe.channel==="variant",exposed:!1});Object.defineProperty(n,"default",{get(){return Se.getDefault().uuid}}),new Property(KeyframeDataPoint,"string","commands",{label:w("effect_animator.timeline.commands"),default:"",condition:e=>e.keyframe.channel==="commands",exposed:!1}),new Property(KeyframeDataPoint,"string","execute_condition",{label:w("effect_animator.timeline.execute_condition"),default:"",condition:e=>Rl.includes(e.keyframe.channel),exposed:!1}),new Property(KeyframeDataPoint,"boolean","repeat",{label:w("effect_animator.timeline.repeat"),default:!1,condition:e=>Rl.includes(e.keyframe.channel),exposed:!1}),new Property(KeyframeDataPoint,"number","repeat_frequency",{label:w("effect_animator.timeline.repeat_frequency"),default:1,condition:e=>Rl.includes(e.keyframe.channel),exposed:!1});for(let e of Object.keys(Rm))e!=="sound"&&delete EffectAnimator.prototype.channels[e];EffectAnimator.prototype.displayFrame=function(e){if(e&&!this.muted.sound&&this.sound.forEach(t=>{let i=this.animation.time-t.time;if(i<0)return;let r=Timeline.playing_sounds.find(a=>a.keyframe_id==t.uuid);i>=0&&i<1/60*(Timeline.playback_speed/100)&&!r?t.data_points[0].file&&!t.cooldown&&(r=new Audio(t.data_points[0].file),r.keyframe_id=t.uuid,r.playbackRate=Math.clamp(Timeline.playback_speed/100,.1,4),r.volume=Math.clamp(settings.volume.value/100,0,1),r.play().catch(()=>{}),Timeline.playing_sounds.push(r),r.onended=function(){Timeline.playing_sounds.remove(r)},t.cooldown=!0,setTimeout(()=>{delete t.cooldown},400)):i>0&&(r=Timeline.playing_sounds.find(a=>a.keyframe_id==t.uuid),r&&Math.abs(r.currentTime-i)>.08&&(r.currentTime=i,r.playbackRate=Math.clamp(Timeline.playback_speed/100,.1,4)))}),!!(Project&&Ue())){if(!this.muted.variant){let t,i,r;for(let a of this.variant)a.timei.time)&&(i=a):(!t||a.timeo.uuid===r.data_points[0].variant);a||console.error("Variant",r.data_points[0].variant,"not found."),a?.select()}}this.last_displayed_time=this.animation.time}},Lu=!0}s(qV,"injectCustomKeyframes");function WV(){if(Lu){for(let n of Object.keys(Rm))n!=="sound"&&(EffectAnimator.prototype.channels[n]=Rm[n]);KeyframeDataPoint.properties.variant?.delete(),KeyframeDataPoint.properties.commands?.delete(),KeyframeDataPoint.properties.execute_condition?.delete(),KeyframeDataPoint.properties.repeat?.delete(),KeyframeDataPoint.properties.repeat_frequency?.delete(),delete EffectAnimator.prototype.channels.variant,delete EffectAnimator.prototype.variant,delete BoneAnimator.prototype.channels.commands,delete BoneAnimator.prototype.commands,EffectAnimator.prototype.displayFrame=KV,Lu=!1}}s(WV,"extractCustomKeyframes");te.PRE_SELECT_PROJECT.subscribe(n=>{n.format.id===et.id?qV():WV()});function Ml(n){return function(e,t){e.data_points.length===0&&e.data_points.push(new KeyframeDataPoint(e)),e.data_points[0][n]=t}}s(Ml,"keyframeValueSetterFactory");function Fl(n){return function(e){return e.data_points.at(0)?.[n]}}s(Fl,"keyframeValueGetterFactory");var q0=Ml("variant"),Qo=Fl("variant"),W0=Ml("commands"),qa=Fl("commands"),Z0=Ml("execute_condition"),ma=Fl("execute_condition"),X0=Ml("repeat"),es=Fl("repeat"),Y0=Ml("repeat_frequency"),ts=Fl("repeat_frequency");var Q0=ui(rn("crypto"),1);function Pm(){main_preview.controls.rotateLeft(Math.PI),scene.setRotationFromAxisAngle(new THREE.Vector3(0,1,0),Math.PI)}s(Pm,"correctSceneAngle");function Vm(){main_preview.controls.rotateLeft(-Math.PI),scene.setRotationFromAxisAngle(new THREE.Vector3(0,1,0),0)}s(Vm,"restoreSceneAngle");function Mm(n,e){let t=n.mesh.matrixWorld.clone(),i=new THREE.Vector3().setFromMatrixPosition(t).multiplyScalar(1/16);t.setPosition(i);let r=new THREE.Vector3().setScalar(e);return t.scale(r),n instanceof Je&&t.multiply(new THREE.Matrix4().makeRotationFromEuler(new THREE.Euler(0,Math.PI,0,"XYZ"))),t}s(Mm,"getNodeMatrix");function ZV(n){let e=new THREE.Vector3,t=new THREE.Quaternion,i=new THREE.Vector3;return n.decompose(e,t,i),{translation:e,left_rotation:t,scale:i}}s(ZV,"getDecomposedTransformation");function XV(n){let e=new THREE.Euler().setFromQuaternion(n,"YXZ");return[Math.radToDeg(-e.x),Math.radToDeg(-e.y)+180]}s(XV,"threeAxisRotationToTwoAxisRotation");var Fm,Ll=new Map,Pl=new Map,Lm=new Set,Pu=new Map;function zm(n,e,t=0){let i={time:t,node_transforms:{},variant:YV(n,t)};if(Fm!==n){Fm=n,Ll=new Map,Pl=new Map;for(let r of Object.keys(e)){let a=n.animators[r];if(!a)continue;let o=a.keyframes?new Map(a.keyframes.map(l=>[l.time,l])):new Map;Pl.set(r,o)}Lm=new Set(n.excluded_nodes?n.excluded_nodes.map(r=>r.value):[]),Pu=new Map;for(let r of e9())Pu.set(r.uuid,r)}for(let[r,a]of Object.entries(e)){let o=Pu.get(r);if(!o||Lm.has(r))continue;let l=Pl.get(r);if(!l)continue;let c=l.get(t),u=l.get(t-.05),d=Ll.get(r),m,p,f,_,v,g;switch(a.type){case"text_display":case"item_display":case"block_display":case"bone":{if(m=Mm(o,a.base_scale),d&&d.matrix.equals(m))continue;if(a.parent&&a.parent!=="root"){let k=Pl.get(a.parent),C=k?.get(t),A=k?.get(t-.05);C?.interpolation==="step"?p="step":A?.data_points.length===2&&(p="pre-post")}c?.interpolation==="step"?p="step":u?.data_points.length===2&&(p="pre-post"),Ll.set(r,{matrix:m,keyframe:c});break}case"locator":{m=Mm(o,1),c?(f=qa(c),_=ma(c),Ll.set(r,{matrix:m,keyframe:c})):d?.keyframe&&(v=es(d.keyframe),g=ts(d.keyframe),v&&g&&Math.round(t*20)%g===0&&(f=qa(d.keyframe),_=ma(d.keyframe)));break}case"camera":case"struct":{m=Mm(o,1);break}}let h=new THREE.Vector3,b=new THREE.Quaternion,x=new THREE.Vector3;m.decompose(h,b,x);let y=ZV(m);i.node_transforms[r]={matrix:m,decomposed:y,pos:[h.x,h.y,h.z],rot:hc(b).toArray(),scale:[x.x,x.y,x.z],head_rot:XV(b),interpolation:p,commands:f,execute_condition:_}}return i}s(zm,"getFrame");function YV(n,e){let t=n.animators.effects?.variant;if(t)for(let i of t){if(i.time!==e)continue;let r=Qo(i);if(!r)return;let a=ma(i);return{uuid:r,executeCondition:a}}}s(YV,"getVariantKeyframe");function Um(n,e){Timeline.time=e,Animator.showDefaultPose(!0);let t=[...Group.all,...NullObject.all,...Locator.all,...Je.all,...ft.all,...gt.all];OutlinerElement.types.camera&&t.push(...OutlinerElement.types.camera.all);for(let i of t)i.constructor.animator&&(Animator.resetLastValues(),n.getBoneAnimator(i).displayFrame());Animator.resetLastValues(),scene.updateMatrixWorld(),n.effects&&n.effects.displayFrame()}s(Um,"updatePreview");function QV(n,e){let t={name:n.name,uuid:n.uuid,safe_name:Rt(n.name).replaceAll(".","_"),loop_delay:Number(n.loop_delay)||0,frames:[],duration:0,loop_mode:n.loop,modified_nodes:{}};n.select();let i=new Set;for(let r=0;r<=n.length;r=ea(r+.05,20)){Um(n,r);let a=zm(n,e.nodes,r);Object.keys(a.node_transforms).forEach(o=>i.add(o)),t.frames.push(a)}return t.duration=t.frames.length,t.modified_nodes=Object.fromEntries(Array.from(i).map(r=>[r,e.nodes[r]])),t}s(QV,"renderAnimation");function ev(n){let e=Q0.createHash("sha256");for(let t of n){e.update("anim;"+t.name),e.update(";"+t.duration.toString()),e.update(";"+t.loop_mode),e.update(";"+Object.keys(t.modified_nodes).join(";"));for(let i of t.frames){e.update(";"+i.time.toString());for(let[r,a]of Object.entries(i.node_transforms))e.update(";"+r),e.update(";"+a.pos.join(";")),e.update(";"+a.rot.join(";")),e.update(";"+a.scale.join(";")),a.interpolation&&e.update(";"+a.interpolation),a.commands&&e.update(";"+a.commands),a.execute_condition&&e.update(";"+a.execute_condition);i.variant&&(e.update(";"+i.variant.uuid),i.variant.execute_condition&&e.update(";"+i.variant.execute_condition))}}return e.digest("hex")}s(ev,"hashAnimations");function e9(){return[...Group.all,...Locator.all,...Je.all,...ft.all,...gt.all,...OutlinerElement.types.camera?OutlinerElement.types.camera.all:[]]}s(e9,"getAnimatableNodes");function tv(n,e){Fm=void 0,Ll=new Map,Pl=new Map,Lm=new Set,Pu=new Map,console.time("Rendering animations took");let t,i=0;Timeline.pause(),Mode.selected.id==="animate"&&(t=Animator.selected,i=Timeline.time),Pm();let r=[];for(let a of n.animations)r.push(QV(a,e));return Vm(),Mode.selected.id==="animate"&&t?(t.select(),Timeline.setTime(i),Animator.preview()):Mode.selected.id==="edit"&&Animator.showDefaultPose(),console.timeEnd("Rendering animations took"),console.log("Animations:",r),r}s(tv,"renderProjectAnimations");var M=class{static global(e){return M.globals[e]?M.globals[e]:M.globals[e]={}}static createStatic(e,t,i){let r=null;Object.defineProperty(e,t,{enumerable:!0,get:function(){return i!=null&&(r=i(),i=null),r},set:function(a){i!=null&&(r=i(),i=null),r=a}})}static iterator(e){if(Array.isArray(e)){let t=e;return function(){return M.mkIter(t)}}else return typeof e.iterator=="function"?e.iterator.bind(e):e.iterator}static getIterator(e){return Array.isArray(e)?M.mkIter(e):e.iterator()}static mkIter(e){return new t9(e)}static extend(e){function t(){this.new.apply(this,arguments)}return s(t,"res"),Object.setPrototypeOf(t.prototype,e.prototype),t}static inherits(e,t){t==null&&(t=!1);function i(){t&&e&&i.__init__&&i.__init__(),this.new.apply(this,arguments)}return s(i,"res"),t?i.__init__=()=>{let r=e();r.__init__&&r.__init__(),Object.setPrototypeOf(i.prototype,r.prototype),i.__init__=void 0}:e&&e.__init__?(t=!0,i.__init__=()=>{e.__init__&&e.__init__(),Object.setPrototypeOf(i.prototype,e.prototype),i.__init__=void 0}):e&&Object.setPrototypeOf(i.prototype,e.prototype),i}static bind(e,t){if(t==null)return null;t.__id__==null&&(t.__id__=M.fid++);let i=null;return e.hx__closures__==null?e.hx__closures__={}:i=e.hx__closures__[t.__id__],i==null&&(i=t.bind(e),e.hx__closures__[t.__id__]=i),i}static get __name__(){return"genes.Register"}get __class__(){return M}};s(M,"Register");M.$global=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:void 0;M.globals={};M.fid=0;var t9=M.global("$hxClasses")["genes._Register.ArrayIterator"]=s(class nv extends M.inherits(){new(e){this.current=0,this.array=e}hasNext(){return this.currentce,!0){new(e,t,i){super.new(String(e),t,i),this.value=e}unwrap(){return this.value}static get __name__(){return"haxe.ValueException"}static get __super__(){return ce}get __class__(){return iv}},"ValueException");var Qte=M.$global,ce=M.global("$hxClasses")["haxe.Exception"]=s(class Vl extends M.inherits(()=>Error,!0){new(e,t,i){Error.call(this,e),this.message=e,this.__previousException=t,this.__nativeException=i??this}unwrap(){return this.__nativeException}toString(){return this.get_message()}get_message(){return this.message}get_native(){return this.__nativeException}static caught(e){return e instanceof Vl?e:e instanceof Error?new Vl(e.message,null,e):new Gm(e,null,e)}static thrown(e){return e instanceof Vl?e.get_native():e instanceof Error?e:new Gm(e)}static get __name__(){return"haxe.Exception"}static get __super__(){return Error}get __class__(){return Vl}},"Exception");var rne=M.$global,Qe=M.global("$hxClasses").HxOverrides=s(class rv{static dateStr(e){let t=e.getMonth()+1,i=e.getDate(),r=e.getHours(),a=e.getMinutes(),o=e.getSeconds();return e.getFullYear()+"-"+(t<10?"0"+t:""+t)+"-"+(i<10?"0"+i:""+i)+" "+(r<10?"0"+r:""+r)+":"+(a<10?"0"+a:""+a)+":"+(o<10?"0"+o:""+o)}static strDate(e){switch(e.length){case 8:let t=e.split(":"),i=new Date;return i.setTime(0),i.setUTCHours(t[0]),i.setUTCMinutes(t[1]),i.setUTCSeconds(t[2]),i;break;case 10:let r=e.split("-");return new Date(r[0],r[1]-1,r[2],0,0,0);case 19:let a=e.split(" "),o=a[0].split("-"),l=a[1].split(":");return new Date(o[0],o[1]-1,o[2],l[0],l[1],l[2]);default:throw ce.thrown("Invalid date format : "+e)}}static cca(e,t){let i=e.charCodeAt(t);if(i==i)return i}static substr(e,t,i){if(i==null)i=e.length;else if(i<0)if(t==0)i=e.length+i;else return"";return e.substr(t,i)}static now(){return Date.now()}static get __name__(){return"HxOverrides"}get __class__(){return rv}},"HxOverrides");typeof performance<"u"&&typeof performance.now=="function"&&(Qe.now=performance.now.bind(performance));var cne=M.$global,yt=M.global("$hxClasses").StringTools=s(class ns{static isSpace(e,t){let i=Qe.cca(e,t);return i>8&&i<14?!0:i==32}static ltrim(e){let t=e.length,i=0;for(;i0?Qe.substr(e,i,t-i):e}static rtrim(e){let t=e.length,i=0;for(;i0?Qe.substr(e,0,t-i):e}static trim(e){return ns.ltrim(ns.rtrim(e))}static hex(e,t){let i="",r="0123456789ABCDEF";do i=r.charAt(e&15)+i,e>>>=4;while(e>0);if(t!=null)for(;i.length({_hx_index:0,__enum__:"mcl.Token",v:n,pos:e,"@kind":"Literal"}),{_hx_name:"Literal",__params__:["v","pos"]}),BracketOpen:Object.assign((n,e)=>({_hx_index:1,__enum__:"mcl.Token",pos:n,data:e,"@kind":"BracketOpen"}),{_hx_name:"BracketOpen",__params__:["pos","data"]}),BracketClose:Object.assign(n=>({_hx_index:2,__enum__:"mcl.Token",pos:n,"@kind":"BracketClose"}),{_hx_name:"BracketClose",__params__:["pos"]})};Sn.__constructs__=[Sn.Literal,Sn.BracketOpen,Sn.BracketClose];Sn.__empty_constructs__=[];var Hr=M.global("$hxEnums")["mcl.Brackets"]={__ename__:"mcl.Brackets",Curly:{_hx_name:"Curly",_hx_index:0,__enum__:"mcl.Brackets","@kind":"Curly"},Square:{_hx_name:"Square",_hx_index:1,__enum__:"mcl.Brackets","@kind":"Square"},Round:{_hx_name:"Round",_hx_index:2,__enum__:"mcl.Brackets","@kind":"Round"}};Hr.__constructs__=[Hr.Curly,Hr.Square,Hr.Round];Hr.__empty_constructs__=[Hr.Curly,Hr.Square,Hr.Round];var Yn=M.global("$hxClasses")["mcl.Tokenizer"]=s(class av{static tokenize(e,t){let i=!1,r=[],a=[],o=0,l=e.split(` -`);for(;o0&&u.push(Sn.Literal(k,{line:d,col:m+_,file:t}));let C=yt.trim(f.substring(x+1));u.push(Sn.BracketOpen({line:d,col:m+_+x,file:t},C)),h=!0;break}g.pop()}++v}let b=yt.trim(f);h||b.length==0||u.push(Sn.Literal(yt.trim(b),{line:d,col:m+_,file:t}))}return u}static get __name__(){return"mcl.Tokenizer"}get __class__(){return av}},"Tokenizer");var dp=ui(rn("module"));var vne=M.$global,pi=M.global("$hxClasses")["mcl.error.McbError"]=s(class Jm extends M.inherits(ce){new(e,t){super.new(e),this.mcbstack=t}__init__(){}static isMclError(e){return e instanceof Jm}static get __name__(){return"mcl.error.McbError"}static get __super__(){return ce}get __class__(){return Jm}},"McbError");var Ene=M.$global,Me=M.global("$hxClasses")["mcl.error.CompilerError"]=s(class ov extends M.inherits(pi){new(e,t,i){super.new((t?"Internal ":"")+`Compiler Error: - `+e,i),this.internal=t}static get __name__(){return"mcl.error.CompilerError"}static get __super__(){return pi}get __class__(){return ov}},"CompilerError");var jne=M.$global,Ge=M.global("$hxClasses")["haxe.io.Path"]=s(class Wa extends M.inherits(){new(e){switch(e){case".":case"..":this.dir=e,this.file="";return}let t=e.lastIndexOf("/"),i=e.lastIndexOf("\\");t0&&i[i.length-1]!=".."?i.pop():p==""?(i.length>0||Qe.cca(e,0)==47)&&i.push(p):p!="."&&i.push(p)}let o=i.join(t),l="",c=!1,u=!1,d=0,m=o;for(;d=55296&&_<=56319&&(_=_-55232<<10|p.charCodeAt(f+1)&1023);let v=_;v>=65536&&++d;let g=v;switch(g){case 47:if(!c)u=!0;else{let b=g;c=!1,u&&(l+="/",u=!1),l+=String.fromCodePoint(b)}break;case 58:l+=":",c=!0;break;default:let h=g;c=!1,u&&(l+="/",u=!1),l+=String.fromCodePoint(h)}}return l}static addTrailingSlash(e){if(e.length==0)return"/";let t=e.lastIndexOf("/"),i=e.lastIndexOf("\\");return t({_hx_index:0,__enum__:"mcl.JsonTagType",subType:n,replace:e,entries:t,"@kind":"Tag"}),{_hx_name:"Tag",__params__:["subType","replace","entries"]}),Advancement:Object.assign(n=>({_hx_index:1,__enum__:"mcl.JsonTagType",entries:n,"@kind":"Advancement"}),{_hx_name:"Advancement",__params__:["entries"]}),ItemModifier:Object.assign(n=>({_hx_index:2,__enum__:"mcl.JsonTagType",entries:n,"@kind":"ItemModifier"}),{_hx_name:"ItemModifier",__params__:["entries"]}),LootTable:Object.assign(n=>({_hx_index:3,__enum__:"mcl.JsonTagType",entries:n,"@kind":"LootTable"}),{_hx_name:"LootTable",__params__:["entries"]}),Predicate:Object.assign(n=>({_hx_index:4,__enum__:"mcl.JsonTagType",entries:n,"@kind":"Predicate"}),{_hx_name:"Predicate",__params__:["entries"]}),Recipe:Object.assign(n=>({_hx_index:5,__enum__:"mcl.JsonTagType",entries:n,"@kind":"Recipe"}),{_hx_name:"Recipe",__params__:["entries"]}),ChatType:Object.assign(n=>({_hx_index:6,__enum__:"mcl.JsonTagType",entries:n,"@kind":"ChatType"}),{_hx_name:"ChatType",__params__:["entries"]}),DamageType:Object.assign(n=>({_hx_index:7,__enum__:"mcl.JsonTagType",entries:n,"@kind":"DamageType"}),{_hx_name:"DamageType",__params__:["entries"]}),Dimension:Object.assign(n=>({_hx_index:8,__enum__:"mcl.JsonTagType",entries:n,"@kind":"Dimension"}),{_hx_name:"Dimension",__params__:["entries"]}),DimensionType:Object.assign(n=>({_hx_index:9,__enum__:"mcl.JsonTagType",entries:n,"@kind":"DimensionType"}),{_hx_name:"DimensionType",__params__:["entries"]}),Enchantment:Object.assign(n=>({_hx_index:10,__enum__:"mcl.JsonTagType",entries:n,"@kind":"Enchantment"}),{_hx_name:"Enchantment",__params__:["entries"]}),WorldGen:Object.assign((n,e,t)=>({_hx_index:11,__enum__:"mcl.JsonTagType",subType:n,name:e,entries:t,"@kind":"WorldGen"}),{_hx_name:"WorldGen",__params__:["subType","name","entries"]})};Vt.__constructs__=[Vt.Tag,Vt.Advancement,Vt.ItemModifier,Vt.LootTable,Vt.Predicate,Vt.Recipe,Vt.ChatType,Vt.DamageType,Vt.Dimension,Vt.DimensionType,Vt.Enchantment,Vt.WorldGen];Vt.__empty_constructs__=[];var xe=M.global("$hxEnums")["mcl.AstNode"]={__ename__:"mcl.AstNode",Raw:Object.assign((n,e,t,i)=>({_hx_index:0,__enum__:"mcl.AstNode",pos:n,value:e,continuations:t,isMacro:i,"@kind":"Raw"}),{_hx_name:"Raw",__params__:["pos","value","continuations","isMacro"]}),FunctionDef:Object.assign((n,e,t,i)=>({_hx_index:1,__enum__:"mcl.AstNode",pos:n,name:e,body:t,appendTo:i,"@kind":"FunctionDef"}),{_hx_name:"FunctionDef",__params__:["pos","name","body","appendTo"]}),TemplateDef:Object.assign((n,e,t)=>({_hx_index:2,__enum__:"mcl.AstNode",pos:n,name:e,body:t,"@kind":"TemplateDef"}),{_hx_name:"TemplateDef",__params__:["pos","name","body"]}),Directory:Object.assign((n,e,t)=>({_hx_index:3,__enum__:"mcl.AstNode",pos:n,name:e,body:t,"@kind":"Directory"}),{_hx_name:"Directory",__params__:["pos","name","body"]}),Import:Object.assign((n,e)=>({_hx_index:4,__enum__:"mcl.AstNode",pos:n,name:e,"@kind":"Import"}),{_hx_name:"Import",__params__:["pos","name"]}),CompileTimeLoop:Object.assign((n,e,t,i)=>({_hx_index:5,__enum__:"mcl.AstNode",pos:n,expression:e,as:t,body:i,"@kind":"CompileTimeLoop"}),{_hx_name:"CompileTimeLoop",__params__:["pos","expression","as","body"]}),CompileTimeIf:Object.assign((n,e,t,i)=>({_hx_index:6,__enum__:"mcl.AstNode",pos:n,expression:e,body:t,elseExpressions:i,"@kind":"CompileTimeIf"}),{_hx_name:"CompileTimeIf",__params__:["pos","expression","body","elseExpressions"]}),MultiLineScript:Object.assign((n,e)=>({_hx_index:7,__enum__:"mcl.AstNode",pos:n,value:e,"@kind":"MultiLineScript"}),{_hx_name:"MultiLineScript",__params__:["pos","value"]}),Block:Object.assign((n,e,t,i,r,a)=>({_hx_index:8,__enum__:"mcl.AstNode",pos:n,name:e,body:t,data:i,isMacro:r,isInline:a,"@kind":"Block"}),{_hx_name:"Block",__params__:["pos","name","body","data","isMacro","isInline"]}),TickBlock:Object.assign((n,e)=>({_hx_index:9,__enum__:"mcl.AstNode",pos:n,body:e,"@kind":"TickBlock"}),{_hx_name:"TickBlock",__params__:["pos","body"]}),LoadBlock:Object.assign((n,e)=>({_hx_index:10,__enum__:"mcl.AstNode",pos:n,body:e,"@kind":"LoadBlock"}),{_hx_name:"LoadBlock",__params__:["pos","body"]}),ExecuteBlock:Object.assign((n,e,t,i,r,a)=>({_hx_index:11,__enum__:"mcl.AstNode",pos:n,execute:e,data:t,body:i,continuations:r,isMacro:a,"@kind":"ExecuteBlock"}),{_hx_name:"ExecuteBlock",__params__:["pos","execute","data","body","continuations","isMacro"]}),ScheduleBlock:Object.assign((n,e,t,i,r)=>({_hx_index:12,__enum__:"mcl.AstNode",pos:n,delay:e,type:t,body:i,isMacro:r,"@kind":"ScheduleBlock"}),{_hx_name:"ScheduleBlock",__params__:["pos","delay","type","body","isMacro"]}),SequenceBlock:Object.assign((n,e)=>({_hx_index:13,__enum__:"mcl.AstNode",pos:n,body:e,"@kind":"SequenceBlock"}),{_hx_name:"SequenceBlock",__params__:["pos","body"]}),RuntimeLoop:Object.assign((n,e,t)=>({_hx_index:14,__enum__:"mcl.AstNode",pos:n,expression:e,body:t,"@kind":"RuntimeLoop"}),{_hx_name:"RuntimeLoop",__params__:["pos","expression","body"]}),Comment:Object.assign((n,e)=>({_hx_index:15,__enum__:"mcl.AstNode",pos:n,value:e,"@kind":"Comment"}),{_hx_name:"Comment",__params__:["pos","value"]}),JsonFile:Object.assign((n,e,t)=>({_hx_index:16,__enum__:"mcl.AstNode",pos:n,name:e,info:t,"@kind":"JsonFile"}),{_hx_name:"JsonFile",__params__:["pos","name","info"]}),TemplateOverload:Object.assign((n,e,t)=>({_hx_index:17,__enum__:"mcl.AstNode",pos:n,args:e,body:t,"@kind":"TemplateOverload"}),{_hx_name:"TemplateOverload",__params__:["pos","args","body"]}),ClockExpr:Object.assign((n,e,t,i)=>({_hx_index:18,__enum__:"mcl.AstNode",pos:n,name:e,time:t,body:i,"@kind":"ClockExpr"}),{_hx_name:"ClockExpr",__params__:["pos","name","time","body"]}),Execute:Object.assign((n,e,t,i)=>({_hx_index:19,__enum__:"mcl.AstNode",pos:n,command:e,value:t,isMacro:i,"@kind":"Execute"}),{_hx_name:"Execute",__params__:["pos","command","value","isMacro"]}),FunctionCall:Object.assign((n,e,t,i)=>({_hx_index:20,__enum__:"mcl.AstNode",pos:n,name:e,data:t,isMacro:i,"@kind":"FunctionCall"}),{_hx_name:"FunctionCall",__params__:["pos","name","data","isMacro"]}),EqCommand:Object.assign((n,e)=>({_hx_index:21,__enum__:"mcl.AstNode",pos:n,command:e,"@kind":"EqCommand"}),{_hx_name:"EqCommand",__params__:["pos","command"]}),ScheduleCall:Object.assign((n,e,t,i,r)=>({_hx_index:22,__enum__:"mcl.AstNode",pos:n,delay:e,target:t,mode:i,isMacro:r,"@kind":"ScheduleCall"}),{_hx_name:"ScheduleCall",__params__:["pos","delay","target","mode","isMacro"]}),ReturnRun:Object.assign((n,e,t)=>({_hx_index:23,__enum__:"mcl.AstNode",pos:n,value:e,isMacro:t,"@kind":"ReturnRun"}),{_hx_name:"ReturnRun",__params__:["pos","value","isMacro"]}),ScheduleClear:Object.assign((n,e,t)=>({_hx_index:24,__enum__:"mcl.AstNode",pos:n,target:e,isMacro:t,"@kind":"ScheduleClear"}),{_hx_name:"ScheduleClear",__params__:["pos","target","isMacro"]}),Void:{_hx_name:"Void",_hx_index:25,__enum__:"mcl.AstNode","@kind":"Void"},Group:Object.assign(n=>({_hx_index:26,__enum__:"mcl.AstNode",body:n,"@kind":"Group"}),{_hx_name:"Group",__params__:["body"]})};xe.__constructs__=[xe.Raw,xe.FunctionDef,xe.TemplateDef,xe.Directory,xe.Import,xe.CompileTimeLoop,xe.CompileTimeIf,xe.MultiLineScript,xe.Block,xe.TickBlock,xe.LoadBlock,xe.ExecuteBlock,xe.ScheduleBlock,xe.SequenceBlock,xe.RuntimeLoop,xe.Comment,xe.JsonFile,xe.TemplateOverload,xe.ClockExpr,xe.Execute,xe.FunctionCall,xe.EqCommand,xe.ScheduleCall,xe.ReturnRun,xe.ScheduleClear,xe.Void,xe.Group];xe.__empty_constructs__=[xe.Void];var uie=M.$global,Ir=M.global("$hxClasses")["js.Boot"]=s(class ei{static getClass(e){if(e==null)return null;if(e instanceof Array)return Array;{let t=e.__class__;if(t!=null)return t;let i=ei.__nativeClassName(e);return i!=null?ei.__resolveNativeClass(i):null}}static __string_rec(e,t){if(e==null)return"null";if(t.length>=500)return"<...>";let i=typeof e;switch(i=="function"&&(e.__name__||e.__ename__)&&(i="object"),i){case"function":return"";case"object":if(e.__enum__){let u=M.global("$hxEnums")[e.__enum__].__constructs__[e._hx_index],d=u._hx_name;return u.__params__?(t=t+" ",d+"("+function(m){var p;let f=[];{let _=0,v=u.__params__;for(;_0?",":"")+ei.__string_rec(e[m],t)}return c+="]",c}let r;try{r=e.toString}catch{return"???"}if(r!=null&&r!=Object.toString&&typeof r=="function"){let c=e.toString();if(c!="[object Object]")return c}let a=`{ + }`;var C9=new THREE.TextureLoader,av=new Map,ov=new Map([["water",w("block_model_manager.fluid_warning")],["lava",w("block_model_manager.fluid_warning")],["player_head",w("block_model_manager.mob_head_warning")],["player_wall_head",w("block_model_manager.mob_head_warning")],["skeleton_skull",w("block_model_manager.mob_head_warning")],["skeleton_wall_skull",w("block_model_manager.mob_head_warning")],["wither_skeleton_skull",w("block_model_manager.mob_head_warning")],["wither_skeleton_wall_skull",w("block_model_manager.mob_head_warning")],["creeper_head",w("block_model_manager.mob_head_warning")],["creeper_wall_head",w("block_model_manager.mob_head_warning")],["zombie_head",w("block_model_manager.mob_head_warning")],["zombie_wall_head",w("block_model_manager.mob_head_warning")],["dragon_head",w("block_model_manager.mob_head_warning")],["dragon_wall_head",w("block_model_manager.mob_head_warning")],["piglin_head",w("block_model_manager.mob_head_warning")],["piglin_wall_head",w("block_model_manager.mob_head_warning")]]);async function Jm(n){await yl();let e=av.get(n);if(!e){let t=await Io(n);if(!t)return;if(ov.has(n))throw new Error(ov.get(n));e=await lv(t),av.set(n,e)}if(e){e={mesh:e.mesh.clone(!0),outline:e.outline.clone(!0),boundingBox:e.boundingBox.clone(),isBlock:!0};for(let t of e.mesh.children)t.geometry=t.geometry.clone();return e.mesh.geometry=e.mesh.geometry.clone(),e.mesh.name=n,e.mesh.isVanillaBlockModel=!0,e}}s(Jm,"getBlockModel");async function fr(n,e){let t=wr(n.model,"models"),i=or(t+".json");if(e&&(e.textures!==void 0&&(i.textures??={},Object.assign(i.textures,e.textures)),e.elements!==void 0&&(i.elements=e.elements),e.display!==void 0&&(i.display=Object.assign(i.display||{},e.display)),e.ambientocclusion!==void 0&&(i.ambientocclusion=e.ambientocclusion)),i.parent){let r={...n,model:i.parent};return await fr(r,i)}return await A9(n,i)}s(fr,"parseBlockModel");async function A9(n,e){if(console.log(`Generating block mesh for '${n.model}' from `,n,e),!e.elements)throw new Error(`No elements defined in block model '${n.model}'`);if(!e.textures)throw new Error(`No textures defined in block model '${n.model}'`);let t=new THREE.Mesh,i=[],r=[];for(let u of e.elements){let c=[u.to[0]-u.from[0],u.to[1]-u.from[1],u.to[2]-u.from[2]],d=[u.from[0]+(u.to[0]-u.from[0])/2,u.from[1]+(u.to[1]-u.from[1])/2,u.from[2]+(u.to[2]-u.from[2])/2];c[0]===0&&(c[0]+=.01,d[0]-=.005),c[1]===0&&(c[1]+=.01,d[1]-=.005),c[2]===0&&(c[2]+=.01,d[2]-=.005);let m=new THREE.BoxGeometry(...c);if(m.translate(...d),u.rotation){let v;u.rotation.rescale&&(v=getRescalingFactor(u.rotation.angle));let y=u.rotation.origin;switch(y&&m.translate(...y.map(k=>-k)),u.rotation.axis){case"x":m.rotateX(Math.degToRad(u.rotation.angle)),v!==void 0&&m.scale(1,v,v);break;case"y":m.rotateY(Math.degToRad(u.rotation.angle)),v!==void 0&&m.scale(v,1,v);break;case"z":m.rotateZ(Math.degToRad(u.rotation.angle)),v!==void 0&&m.scale(v,v,1);break}y&&m.translate(...y)}m.translate(-8,-8,-8),n.x&&m.rotateX(Math.degToRad(n.x)),n.y&&m.rotateY(-Math.degToRad(n.y)),n.isItemModel?m.translate(0,8,0):m.translate(8,8,8);let p=[];for(let v=0;v<6;v++)p.push(0+v*4,2+v*4,1+v*4,2+v*4,3+v*4,1+v*4),m.addGroup(v*6,6,v);if(m.setIndex(p),m.setAttribute("highlight",new THREE.BufferAttribute(new Uint8Array(m.attributes.position.count),1)),!u.faces)throw new Error(`No faces defined in element for block model '${n.model}'`);let f=[],_=[];for(let v of Canvas.face_order){let y=u.faces[v];if(!y){_.push(Canvas.transparentMaterial),f.push(0,0,0,0,0,0,0,0);continue}let k=(await sv(e.textures,y.texture)).clone(),b=new THREE.ShaderMaterial({uniforms:{map:new THREE.Uniform(k),SHADE:{type:"bool",value:settings.shading.value},LIGHTCOLOR:{type:"vec3",value:new THREE.Color().copy(Canvas.global_light_color).multiplyScalar(settings.brightness.value/50)},LIGHTSIDE:{type:"int",value:Canvas.global_light_side},EMISSIVE:{type:"bool",value:!1}},vertexShader:Mu,fragmentShader:Fu,blending:THREE.NormalBlending,side:Canvas.getRenderSide(),transparent:!0});b.map=k,b.name=n.model,_.push(b);let x=16,E=16;if(y.uv){let[C,j,S,B]=y.uv,O=[[C/x,j/E],[S/x,j/E],[C/x,B/E],[S/x,B/E]];if(y.rotation){let A=y.rotation+0;for(;A>0;){let V=O[0];O[0]=O[2],O[2]=O[3],O[3]=O[1],O[1]=V,A-=90}}k.flipY=!1,f.push(...O.flat())}else{let[C,j,S]=u.from,[B,O,A]=c;switch(v){case"down":f.push(C/x,S/E,(C+B)/x,S/E,C/x,(S+A)/E,(C+B)/x,(S+A)/E);break;case"up":f.push(C/x,S/E,(C+B)/x,S/E,C/x,(S+A)/E,(C+B)/x,(S+A)/E);break;case"north":f.push((C+B)/x,(j+O)/E,C/x,(j+O)/E,(C+B)/x,j/E,C/x,j/E);break;case"south":f.push((C+B)/x,(j+O)/E,C/x,(j+O)/E,(C+B)/x,j/E,C/x,j/E);break;case"west":f.push((S+A)/x,(j+O)/E,S/x,(j+O)/E,(S+A)/x,j/E,S/x,j/E);break;case"east":f.push((S+A)/x,(j+O)/E,S/x,(j+O)/E,(S+A)/x,j/E,S/x,j/E);break}}k.needsUpdate=!0}m.setAttribute("uv",new THREE.Float32BufferAttribute(f,2)),m.attributes.uv.needsUpdate=!0,i.push(m.clone());let g=new THREE.EdgesGeometry(m);r.push(g);let h=new THREE.Mesh(m,_);t.add(h)}let a=Rr(r),o=new THREE.LineSegments(a,Canvas.outlineMaterial),l=Rr(i);return o.no_export=!0,o.renderOrder=2,o.frustumCulled=!1,{mesh:t,outline:o,boundingBox:l,isBlock:!0}}s(A9,"generateModelMesh");var Um=new Map;async function sv(n,e){e.at(0)==="#"&&(e=e.slice(1));let t=n[e];if(t?.at(0)==="#")return await sv(n,t.slice(1));let i=wr(t,"textures")+".png";if(Um.has(i))return Um.get(i);let r=await C9.loadAsync(Wa(i));return r.magFilter=THREE.NearestFilter,r.minFilter=THREE.NearestFilter,Um.set(i,r),r}s(sv,"loadTexture");async function lv(n){let e=wr(n.resourceLocation,"blockstates"),t=await or(e+".json");if(!n.blockStateRegistryEntry)throw new Error(`Block state registry entry not found for '${n.resource.name}'`);n.states=Object.assign({},n.blockStateRegistryEntry.defaultStates,n.states);for(let[i,r]of Object.entries(n.states))if(n.blockStateRegistryEntry.stateValues[i]){if(!n.blockStateRegistryEntry.stateValues[i].includes(r))throw new Error(`Invalid block state value '${r.toString()}' for '${i}'`)}else throw new Error(`Invalid block state '${i}' for '${n.resource.name}' `);if(t.variants){let i=t.variants[""];if(i)return Array.isArray(i)?await fr(i[0]):await fr(i);for(let[r,a]of Object.entries(t.variants)){let o={},l=r.split(",");for(let d of l){let[m,p]=d.trim().split("="),f=Fa(p,!1);o[m]=f}if(!Object.entries(o).allAre(([d,m])=>cv(n,d,m,!1)))continue;let c;return Array.isArray(a)?c=await fr(a[0]):c=await fr(a),c}}else if(t.multipart){let i=new THREE.Mesh,r=[],a=[];for(let c of t.multipart){let d=await S9(n,c);if(!d)continue;for(let p of d.mesh.children){let f=p.clone();f.geometry=f.geometry.clone(),f.rotateY(d.mesh.rotation.y),f.rotateX(d.mesh.rotation.x),i.add(f);let _=d.boundingBox.clone();_.rotateY(d.mesh.rotation.y),_.rotateX(d.mesh.rotation.x),r.push(_)}let m=d.outline.geometry.clone();m.rotateY(d.mesh.rotation.y),m.rotateX(d.mesh.rotation.x),a.push(m)}if(a.length===0)throw new Error(`The selected block state for '${n.resourceLocation}' has no model!`);let o=Rr(a),l=new THREE.LineSegments(o,Canvas.outlineMaterial),u=Rr(r);return l.no_export=!0,l.renderOrder=2,l.frustumCulled=!1,{mesh:i,outline:l,boundingBox:u,isBlock:!0}}throw new Error(`Unsupported block state '${n.resourceLocation}'`)}s(lv,"parseBlockState");async function S9(n,e){if(e.when){let t=s(r=>{if(r.OR&&r.AND)throw new Error("Cannot have both OR and AND in a multipart case condition");if(r.OR)return r.OR.some(o=>t(o));if(r.AND)return r.AND.every(o=>t(o));let a=!0;for(let[o,l]of Object.entries(r)){let u=Fa(l,!0);if(a=cv(n,o,u,!0),!a)break}return a},"recurse");if(!t(e.when))return}return Array.isArray(e.apply)?await fr(e.apply[0]):await fr(e.apply)}s(S9,"parseMultipartCase");function cv(n,e,t,i){if(typeof t=="string"&&t.includes("|")){if(!i)throw new Error(`Unsupported OR condition in block state '${e}': '${t}'`);t=t.split("|")}if(typeof t=="boolean")return!!n.states[e]===t;if(typeof t=="string")return n.states[e]===t;if(typeof t=="number")return t===0?n.states[e]===t||n.states[e]===void 0:n.states[e]===t;if(i)return t.includes(n.states[e]);throw new Error(`Unsupported variant state type '${typeof t}'`)}s(cv,"checkIfBlockStateMatches");var j9="https://raw.githubusercontent.com/misode/mcmeta/summary/registries/data.json",Lu=class{items=[];constructor(e){this.items=e}has(e){return this.items.includes(e)}find(e){return this.items.find(e)}};s(Lu,"MinecraftRegistryEntry");var Vn={};function I9(){let n=localStorage.getItem("animated_java:minecraftRegistry");if(!n){console.error("Minecraft Registry not found in local storage");return}let e=JSON.parse(n);for(let t in e)Vn[t]=new Lu(e[t])}s(I9,"updateMemoryRegistry");async function $m(){console.log("Updating Minecraft Registry...");let n=3;for(;n-->=0;){let e;try{e=await fetch(j9)}catch(t){console.error("Failed to fetch latest Minecraft registry:",t)}if(e&&e.ok){let t=await e.json();localStorage.setItem("animated_java:minecraftRegistry",JSON.stringify(t));let i=await Vr();localStorage.setItem("animated_java:minecraftRegistryVersion",JSON.stringify(i)),console.log("Minecraft Registry updated!");return}}throw new Error("Failed to fetch latest Minecraft registry after 3 retries.")}s($m,"updateLocalRegistry");async function O9(){if(console.log("Checking if Minecraft Registry update..."),!localStorage.getItem("animated_java:minecraftRegistry")){console.log("No Minecraft Registry found. Updating..."),await $m();return}let e=localStorage.getItem("animated_java:minecraftRegistryVersion");if(!e){console.log("No Minecraft Registry version found. Updating..."),await $m();return}let t=JSON.parse(e),i=await Vr();if(t.id!==i.id){console.log("Minecraft Registry is outdated. Updating..."),await $m();return}console.log("Minecraft Registry is up to date!"),I9(),requestAnimationFrame(()=>re.MINECRAFT_REGISTRY_LOADED.dispatch())}s(O9,"checkForRegistryUpdate");re.NETWORK_CONNECTED.subscribe(()=>{O9().then(async()=>{await ym()})});function N9(n){let e,t,i,r,a,o,l;function u(f){n[30](f)}s(u,"checkbox_checked_binding");let c={label:w("dialog.bone_config.use_nbt.title"),tooltip:w("dialog.bone_config.use_nbt.description"),defaultValue:Te.prototype.useNBT};n[12]!==void 0&&(c.checked=n[12]),e=new tt({props:c}),le.push(()=>we(e,"checked",u));let d=[D9,R9],m=[];function p(f,_){return f[14]?0:1}return s(p,"select_block_type_1"),r=p(n,[-1,-1]),a=m[r]=d[r](n),{c(){_e(e.$$.fragment),i=G(),a.c(),o=Dt()},m(f,_){me(e,f,_),L(f,i,_),m[r].m(f,_),L(f,o,_),l=!0},p(f,_){let g={};!t&&_[0]&4096&&(t=!0,g.checked=f[12],ye(()=>t=!1)),e.$set(g);let h=r;r=p(f,_),r===h?m[r].p(f,_):(Et(),Z(m[h],1,1,()=>{m[h]=null}),Tt(),a=m[r],a?a.p(f,_):(a=m[r]=d[r](f),a.c()),q(a,1),a.m(o.parentNode,o))},i(f){l||(q(e.$$.fragment,f),q(a),l=!0)},o(f){Z(e.$$.fragment,f),Z(a),l=!1},d(f){de(e,f),f&&F(i),m[r].d(f),f&&F(o)}}}s(N9,"create_else_block");function B9(n){let e,t,i,r,a,o,l,u,c,d,m,p,f,_,g,h,v,y,k,b,x,E,C,j,S,B,O,A;function V(H){n[20](H)}s(V,"select_value_binding");let K={label:w("dialog.bone_config.billboard.title"),tooltip:w("dialog.bone_config.billboard.description"),options:n[17],defaultOption:Te.prototype.billboard};n[2]!==void 0&&(K.value=n[2]),e=new Yn({props:K}),le.push(()=>we(e,"value",V));function te(H){n[21](H)}s(te,"lineinput_value_binding");let fe={label:w("dialog.bone_config.custom_name.title"),tooltip:w("dialog.bone_config.custom_name.description"),defaultValue:Te.prototype.customName,valueChecker:n[19]};n[0]!==void 0&&(fe.value=n[0]),r=new en({props:fe}),le.push(()=>we(r,"value",te));function ae(H){n[22](H)}s(ae,"checkbox0_checked_binding");let ee={label:w("dialog.bone_config.custom_name_visible.title"),tooltip:w("dialog.bone_config.custom_name_visible.description"),defaultValue:Te.prototype.customNameVisible};n[1]!==void 0&&(ee.checked=n[1]),l=new tt({props:ee}),le.push(()=>we(l,"checked",ae));function se(H){n[23](H)}s(se,"checkbox1_checked_binding");let oe={label:w("dialog.bone_config.glowing.title"),tooltip:w("dialog.bone_config.glowing.description"),defaultValue:Te.prototype.glowing};n[5]!==void 0&&(oe.checked=n[5]),d=new tt({props:oe}),le.push(()=>we(d,"checked",se));function xe(H){n[24](H)}s(xe,"colorpicker_value_binding");let ne={label:w("dialog.bone_config.glow_color.title"),tooltip:w("dialog.bone_config.glow_color.description")};n[7]!==void 0&&(ne.value=n[7]),f=new Zi({props:ne}),le.push(()=>we(f,"value",xe));function pe(H){n[25](H)}s(pe,"numberslider0_value_binding");let W={label:w("dialog.bone_config.shadow_radius.title"),tooltip:w("dialog.bone_config.shadow_radius.description"),defaultValue:Te.prototype.shadowRadius,min:0,max:64};n[10]!==void 0&&(W.value=n[10]),h=new Ot({props:W}),le.push(()=>we(h,"value",pe));function U(H){n[26](H)}s(U,"numberslider1_value_binding");let ce={label:w("dialog.bone_config.shadow_strength.title"),tooltip:w("dialog.bone_config.shadow_strength.description"),defaultValue:Te.prototype.shadowStrength,min:0};n[11]!==void 0&&(ce.value=n[11]),k=new Ot({props:ce}),le.push(()=>we(k,"value",U));function J(H){n[27](H)}s(J,"checkbox2_checked_binding");let Ce={label:w("dialog.bone_config.override_brightness.title"),tooltip:w("dialog.bone_config.override_brightness.description"),defaultValue:Te.prototype.overrideBrightness};n[3]!==void 0&&(Ce.checked=n[3]),E=new tt({props:Ce}),le.push(()=>we(E,"checked",J));let Y=n[13]&&fv(n);function z(H){n[29](H)}s(z,"checkbox3_checked_binding");let be={label:w("dialog.bone_config.invisible.title"),tooltip:w("dialog.bone_config.invisible.description"),defaultValue:Te.prototype.invisible};return n[8]!==void 0&&(be.checked=n[8]),B=new tt({props:be}),le.push(()=>we(B,"checked",z)),{c(){_e(e.$$.fragment),i=G(),_e(r.$$.fragment),o=G(),_e(l.$$.fragment),c=G(),_e(d.$$.fragment),p=G(),_e(f.$$.fragment),g=G(),_e(h.$$.fragment),y=G(),_e(k.$$.fragment),x=G(),_e(E.$$.fragment),j=G(),Y&&Y.c(),S=G(),_e(B.$$.fragment)},m(H,ie){me(e,H,ie),L(H,i,ie),me(r,H,ie),L(H,o,ie),me(l,H,ie),L(H,c,ie),me(d,H,ie),L(H,p,ie),me(f,H,ie),L(H,g,ie),me(h,H,ie),L(H,y,ie),me(k,H,ie),L(H,x,ie),me(E,H,ie),L(H,j,ie),Y&&Y.m(H,ie),L(H,S,ie),me(B,H,ie),A=!0},p(H,ie){let Ie={};!t&&ie[0]&4&&(t=!0,Ie.value=H[2],ye(()=>t=!1)),e.$set(Ie);let Q={};!a&&ie[0]&1&&(a=!0,Q.value=H[0],ye(()=>a=!1)),r.$set(Q);let st={};!u&&ie[0]&2&&(u=!0,st.checked=H[1],ye(()=>u=!1)),l.$set(st);let at={};!m&&ie[0]&32&&(m=!0,at.checked=H[5],ye(()=>m=!1)),d.$set(at);let Vt={};!_&&ie[0]&128&&(_=!0,Vt.value=H[7],ye(()=>_=!1)),f.$set(Vt);let We={};!v&&ie[0]&1024&&(v=!0,We.value=H[10],ye(()=>v=!1)),h.$set(We);let wt={};!b&&ie[0]&2048&&(b=!0,wt.value=H[11],ye(()=>b=!1)),k.$set(wt);let Jt={};!C&&ie[0]&8&&(C=!0,Jt.checked=H[3],ye(()=>C=!1)),E.$set(Jt),H[13]?Y?(Y.p(H,ie),ie[0]&8192&&q(Y,1)):(Y=fv(H),Y.c(),q(Y,1),Y.m(S.parentNode,S)):Y&&(Et(),Z(Y,1,1,()=>{Y=null}),Tt());let X={};!O&&ie[0]&256&&(O=!0,X.checked=H[8],ye(()=>O=!1)),B.$set(X)},i(H){A||(q(e.$$.fragment,H),q(r.$$.fragment,H),q(l.$$.fragment,H),q(d.$$.fragment,H),q(f.$$.fragment,H),q(h.$$.fragment,H),q(k.$$.fragment,H),q(E.$$.fragment,H),q(Y),q(B.$$.fragment,H),A=!0)},o(H){Z(e.$$.fragment,H),Z(r.$$.fragment,H),Z(l.$$.fragment,H),Z(d.$$.fragment,H),Z(f.$$.fragment,H),Z(h.$$.fragment,H),Z(k.$$.fragment,H),Z(E.$$.fragment,H),Z(Y),Z(B.$$.fragment,H),A=!1},d(H){de(e,H),H&&F(i),de(r,H),H&&F(o),de(l,H),H&&F(c),de(d,H),H&&F(p),de(f,H),H&&F(g),de(h,H),H&&F(y),de(k,H),H&&F(x),de(E,H),H&&F(j),Y&&Y.d(H),H&&F(S),de(B,H)}}}s(B9,"create_if_block");function R9(n){let e,t,i,r,a,o,l,u,c,d,m,p,f,_,g,h,v,y,k,b,x,E,C,j,S,B,O;function A(z){n[32](z)}s(A,"lineinput_value_binding_2");let V={label:w("dialog.bone_config.custom_name.title"),tooltip:w("dialog.bone_config.custom_name.description"),defaultValue:Te.prototype.customName,valueChecker:n[19]};n[0]!==void 0&&(V.value=n[0]),e=new en({props:V}),le.push(()=>we(e,"value",A));function K(z){n[33](z)}s(K,"checkbox0_checked_binding_1");let te={label:w("dialog.bone_config.custom_name_visible.title"),tooltip:w("dialog.bone_config.custom_name_visible.description"),defaultValue:Te.prototype.customNameVisible};n[1]!==void 0&&(te.checked=n[1]),r=new tt({props:te}),le.push(()=>we(r,"checked",K));function fe(z){n[34](z)}s(fe,"select_value_binding_1");let ae={label:w("dialog.bone_config.billboard.title"),tooltip:w("dialog.bone_config.billboard.description"),options:n[17],defaultOption:Te.prototype.billboard};n[2]!==void 0&&(ae.value=n[2]),l=new Yn({props:ae}),le.push(()=>we(l,"value",fe));function ee(z){n[35](z)}s(ee,"checkbox1_checked_binding_1");let se={label:w("dialog.bone_config.glowing.title"),tooltip:w("dialog.bone_config.glowing.description"),defaultValue:Te.prototype.glowing};n[5]!==void 0&&(se.checked=n[5]),d=new tt({props:se}),le.push(()=>we(d,"checked",ee));function oe(z){n[36](z)}s(oe,"checkbox2_checked_binding_1");let xe={label:w("dialog.bone_config.override_glow_color.title"),tooltip:w("dialog.bone_config.override_glow_color.description"),defaultValue:Te.prototype.overrideGlowColor};n[6]!==void 0&&(xe.checked=n[6]),f=new tt({props:xe}),le.push(()=>we(f,"checked",oe));let ne=n[15]&&uv(n);function pe(z){n[38](z)}s(pe,"numberslider0_value_binding_1");let W={label:w("dialog.bone_config.shadow_radius.title"),tooltip:w("dialog.bone_config.shadow_radius.description"),defaultValue:Te.prototype.shadowRadius,min:0,max:15};n[10]!==void 0&&(W.value=n[10]),v=new Ot({props:W}),le.push(()=>we(v,"value",pe));function U(z){n[39](z)}s(U,"numberslider1_value_binding_1");let ce={label:w("dialog.bone_config.shadow_strength.title"),tooltip:w("dialog.bone_config.shadow_strength.description"),defaultValue:Te.prototype.shadowStrength,min:0,max:15};n[11]!==void 0&&(ce.value=n[11]),b=new Ot({props:ce}),le.push(()=>we(b,"value",U));function J(z){n[40](z)}s(J,"checkbox3_checked_binding_1");let Ce={label:w("dialog.bone_config.override_brightness.title"),tooltip:w("dialog.bone_config.override_brightness.description"),defaultValue:Te.prototype.overrideBrightness};n[3]!==void 0&&(Ce.checked=n[3]),C=new tt({props:Ce}),le.push(()=>we(C,"checked",J));let Y=n[13]&&dv(n);return{c(){_e(e.$$.fragment),i=G(),_e(r.$$.fragment),o=G(),_e(l.$$.fragment),c=G(),_e(d.$$.fragment),p=G(),_e(f.$$.fragment),g=G(),ne&&ne.c(),h=G(),_e(v.$$.fragment),k=G(),_e(b.$$.fragment),E=G(),_e(C.$$.fragment),S=G(),Y&&Y.c(),B=Dt()},m(z,be){me(e,z,be),L(z,i,be),me(r,z,be),L(z,o,be),me(l,z,be),L(z,c,be),me(d,z,be),L(z,p,be),me(f,z,be),L(z,g,be),ne&&ne.m(z,be),L(z,h,be),me(v,z,be),L(z,k,be),me(b,z,be),L(z,E,be),me(C,z,be),L(z,S,be),Y&&Y.m(z,be),L(z,B,be),O=!0},p(z,be){let H={};!t&&be[0]&1&&(t=!0,H.value=z[0],ye(()=>t=!1)),e.$set(H);let ie={};!a&&be[0]&2&&(a=!0,ie.checked=z[1],ye(()=>a=!1)),r.$set(ie);let Ie={};!u&&be[0]&4&&(u=!0,Ie.value=z[2],ye(()=>u=!1)),l.$set(Ie);let Q={};!m&&be[0]&32&&(m=!0,Q.checked=z[5],ye(()=>m=!1)),d.$set(Q);let st={};!_&&be[0]&64&&(_=!0,st.checked=z[6],ye(()=>_=!1)),f.$set(st),z[15]?ne?(ne.p(z,be),be[0]&32768&&q(ne,1)):(ne=uv(z),ne.c(),q(ne,1),ne.m(h.parentNode,h)):ne&&(Et(),Z(ne,1,1,()=>{ne=null}),Tt());let at={};!y&&be[0]&1024&&(y=!0,at.value=z[10],ye(()=>y=!1)),v.$set(at);let Vt={};!x&&be[0]&2048&&(x=!0,Vt.value=z[11],ye(()=>x=!1)),b.$set(Vt);let We={};!j&&be[0]&8&&(j=!0,We.checked=z[3],ye(()=>j=!1)),C.$set(We),z[13]?Y?(Y.p(z,be),be[0]&8192&&q(Y,1)):(Y=dv(z),Y.c(),q(Y,1),Y.m(B.parentNode,B)):Y&&(Et(),Z(Y,1,1,()=>{Y=null}),Tt())},i(z){O||(q(e.$$.fragment,z),q(r.$$.fragment,z),q(l.$$.fragment,z),q(d.$$.fragment,z),q(f.$$.fragment,z),q(ne),q(v.$$.fragment,z),q(b.$$.fragment,z),q(C.$$.fragment,z),q(Y),O=!0)},o(z){Z(e.$$.fragment,z),Z(r.$$.fragment,z),Z(l.$$.fragment,z),Z(d.$$.fragment,z),Z(f.$$.fragment,z),Z(ne),Z(v.$$.fragment,z),Z(b.$$.fragment,z),Z(C.$$.fragment,z),Z(Y),O=!1},d(z){de(e,z),z&&F(i),de(r,z),z&&F(o),de(l,z),z&&F(c),de(d,z),z&&F(p),de(f,z),z&&F(g),ne&&ne.d(z),z&&F(h),de(v,z),z&&F(k),de(b,z),z&&F(E),de(C,z),z&&F(S),Y&&Y.d(z),z&&F(B)}}}s(R9,"create_else_block_1");function D9(n){let e,t,i,r,a;function o(u){n[31](u)}s(o,"lineinput_value_binding_1");let l={label:w("dialog.bone_config.nbt.title"),tooltip:w("dialog.bone_config.nbt.description"),defaultValue:Te.prototype.nbt,valueChecker:n[18]};return n[9]!==void 0&&(l.value=n[9]),i=new en({props:l}),le.push(()=>we(i,"value",o)),{c(){e=P("p"),e.textContent=`${w("dialog.bone_config.use_nbt.use_nbt_warning")}`,t=G(),_e(i.$$.fragment),T(e,"class","use_nbt_warning")},m(u,c){L(u,e,c),L(u,t,c),me(i,u,c),a=!0},p(u,c){let d={};!r&&c[0]&512&&(r=!0,d.value=u[9],ye(()=>r=!1)),i.$set(d)},i(u){a||(q(i.$$.fragment,u),a=!0)},o(u){Z(i.$$.fragment,u),a=!1},d(u){u&&F(e),u&&F(t),de(i,u)}}}s(D9,"create_if_block_2");function uv(n){let e,t,i;function r(o){n[37](o)}s(r,"colorpicker_value_binding_1");let a={label:w("dialog.bone_config.glow_color.title"),tooltip:w("dialog.bone_config.glow_color.description")};return n[7]!==void 0&&(a.value=n[7]),e=new Zi({props:a}),le.push(()=>we(e,"value",r)),{c(){_e(e.$$.fragment)},m(o,l){me(e,o,l),i=!0},p(o,l){let u={};!t&&l[0]&128&&(t=!0,u.value=o[7],ye(()=>t=!1)),e.$set(u)},i(o){i||(q(e.$$.fragment,o),i=!0)},o(o){Z(e.$$.fragment,o),i=!1},d(o){de(e,o)}}}s(uv,"create_if_block_4");function dv(n){let e,t,i;function r(o){n[41](o)}s(r,"numberslider_value_binding_1");let a={label:w("dialog.bone_config.brightness_override.title"),tooltip:w("dialog.bone_config.brightness_override.description"),defaultValue:Te.prototype.brightnessOverride,min:0,max:15};return n[4]!==void 0&&(a.value=n[4]),e=new Ot({props:a}),le.push(()=>we(e,"value",r)),{c(){_e(e.$$.fragment)},m(o,l){me(e,o,l),i=!0},p(o,l){let u={};!t&&l[0]&16&&(t=!0,u.value=o[4],ye(()=>t=!1)),e.$set(u)},i(o){i||(q(e.$$.fragment,o),i=!0)},o(o){Z(e.$$.fragment,o),i=!1},d(o){de(e,o)}}}s(dv,"create_if_block_3");function fv(n){let e,t,i;function r(o){n[28](o)}s(r,"numberslider_value_binding");let a={label:w("dialog.bone_config.brightness_override.title"),tooltip:w("dialog.bone_config.brightness_override.description"),defaultValue:Te.prototype.brightnessOverride,min:0,max:15};return n[4]!==void 0&&(a.value=n[4]),e=new Ot({props:a}),le.push(()=>we(e,"value",r)),{c(){_e(e.$$.fragment)},m(o,l){me(e,o,l),i=!0},p(o,l){let u={};!t&&l[0]&16&&(t=!0,u.value=o[4],ye(()=>t=!1)),e.$set(u)},i(o){i||(q(e.$$.fragment,o),i=!0)},o(o){Z(e.$$.fragment,o),i=!1},d(o){de(e,o)}}}s(fv,"create_if_block_1");function M9(n){let e,t,i,r,a=[B9,N9],o=[];function l(u,c){return u[16]?0:1}return s(l,"select_block_type"),t=l(n,[-1,-1]),i=o[t]=a[t](n),{c(){e=P("div"),i.c()},m(u,c){L(u,e,c),o[t].m(e,null),r=!0},p(u,c){i.p(u,c)},i(u){r||(q(i),r=!0)},o(u){Z(i),r=!1},d(u){u&&F(e),o[t].d()}}}s(M9,"create_fragment");function F9(n,e,t){let i,r=ue,a=s(()=>(r(),r=ze(h,Q=>t(13,i=Q)),h),"$$subscribe_overrideBrightness"),o,l=ue,u=s(()=>(l(),l=ze(S,Q=>t(14,o=Q)),S),"$$subscribe_useNBT"),c,d=ue,m=s(()=>(d(),d=ze(k,Q=>t(15,c=Q)),k),"$$subscribe_overrideGlowColor");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l()),n.$$.on_destroy.push(()=>d());let p=!!Project?.animated_java?.enable_plugin_mode,{customName:f}=e,{customNameVisible:_}=e,{billboard:g}=e,{overrideBrightness:h}=e;a();let{brightnessOverride:v}=e,{glowing:y}=e,{overrideGlowColor:k}=e;m();let{glowColor:b}=e,{invisible:x}=e,{nbt:E}=e,{shadowRadius:C}=e,{shadowStrength:j}=e,{useNBT:S}=e;u();let B={fixed:w("dialog.bone_config.billboard.options.fixed"),vertical:w("dialog.bone_config.billboard.options.vertical"),horizontal:w("dialog.bone_config.billboard.options.horizontal"),center:w("dialog.bone_config.billboard.options.center")},O=s(Q=>{let st;try{st=Ze.fromString(Q)}catch(at){return{type:"error",message:w("dialog.bone_config.nbt.invalid_nbt.error",at.message)}}return st instanceof Ye?{type:"success",message:""}:{type:"error",message:w("dialog.bone_config.nbt.invalid_nbt.not_compound")}},"nbtChecker"),A=s(Q=>{if(Q==="")return{type:"success",message:""};try{$t.fromString(Q)}catch(st){return{type:"error",message:w("dialog.bone_config.custom_name.invalid_json.error",st.message)}}return{type:"success",message:""}},"customNameChecker");function V(Q){g=Q,t(2,g)}s(V,"select_value_binding");function K(Q){f=Q,t(0,f)}s(K,"lineinput_value_binding");function te(Q){_=Q,t(1,_)}s(te,"checkbox0_checked_binding");function fe(Q){y=Q,t(5,y)}s(fe,"checkbox1_checked_binding");function ae(Q){b=Q,t(7,b)}s(ae,"colorpicker_value_binding");function ee(Q){C=Q,t(10,C)}s(ee,"numberslider0_value_binding");function se(Q){j=Q,t(11,j)}s(se,"numberslider1_value_binding");function oe(Q){h=Q,a(t(3,h))}s(oe,"checkbox2_checked_binding");function xe(Q){v=Q,t(4,v)}s(xe,"numberslider_value_binding");function ne(Q){x=Q,t(8,x)}s(ne,"checkbox3_checked_binding");function pe(Q){S=Q,u(t(12,S))}s(pe,"checkbox_checked_binding");function W(Q){E=Q,t(9,E)}s(W,"lineinput_value_binding_1");function U(Q){f=Q,t(0,f)}s(U,"lineinput_value_binding_2");function ce(Q){_=Q,t(1,_)}s(ce,"checkbox0_checked_binding_1");function J(Q){g=Q,t(2,g)}s(J,"select_value_binding_1");function Ce(Q){y=Q,t(5,y)}s(Ce,"checkbox1_checked_binding_1");function Y(Q){k=Q,m(t(6,k))}s(Y,"checkbox2_checked_binding_1");function z(Q){b=Q,t(7,b)}s(z,"colorpicker_value_binding_1");function be(Q){C=Q,t(10,C)}s(be,"numberslider0_value_binding_1");function H(Q){j=Q,t(11,j)}s(H,"numberslider1_value_binding_1");function ie(Q){h=Q,a(t(3,h))}s(ie,"checkbox3_checked_binding_1");function Ie(Q){v=Q,t(4,v)}return s(Ie,"numberslider_value_binding_1"),n.$$set=Q=>{"customName"in Q&&t(0,f=Q.customName),"customNameVisible"in Q&&t(1,_=Q.customNameVisible),"billboard"in Q&&t(2,g=Q.billboard),"overrideBrightness"in Q&&a(t(3,h=Q.overrideBrightness)),"brightnessOverride"in Q&&t(4,v=Q.brightnessOverride),"glowing"in Q&&t(5,y=Q.glowing),"overrideGlowColor"in Q&&m(t(6,k=Q.overrideGlowColor)),"glowColor"in Q&&t(7,b=Q.glowColor),"invisible"in Q&&t(8,x=Q.invisible),"nbt"in Q&&t(9,E=Q.nbt),"shadowRadius"in Q&&t(10,C=Q.shadowRadius),"shadowStrength"in Q&&t(11,j=Q.shadowStrength),"useNBT"in Q&&u(t(12,S=Q.useNBT))},[f,_,g,h,v,y,k,b,x,E,C,j,S,i,o,c,p,B,O,A,V,K,te,fe,ae,ee,se,oe,xe,ne,pe,W,U,ce,J,Ce,Y,z,be,H,ie,Ie]}s(F9,"instance");var Pu=class extends Be{constructor(e){super(),De(this,e,F9,M9,Oe,{customName:0,customNameVisible:1,billboard:2,overrideBrightness:3,brightnessOverride:4,glowing:5,overrideGlowColor:6,glowColor:7,invisible:8,nbt:9,shadowRadius:10,shadowStrength:11,useNBT:12},null,[-1,-1])}};s(Pu,"VanillaItemDisplayConfigDialog");var mv=Pu;function L9(n){let e=Te.fromJSON(n.config??=new Te().toJSON()),t=new ge(e.customName),i=new ge(e.customNameVisible),r=new ge(e.billboard),a=new ge(e.overrideBrightness),o=new ge(e.brightnessOverride),l=new ge(e.glowing),u=new ge(e.overrideGlowColor),c=new ge(e.glowColor),d=new ge(e.invisible),m=new ge(e.nbt),p=new ge(e.shadowRadius),f=new ge(e.shadowStrength),_=new ge(e.useNBT);new qt({id:`${ke.name}:vanillaItemDisplayConfigDialog`,title:w("dialog.vanilla_item_display_config.title"),width:400,component:mv,props:{variant:Ne.selected,customName:t,customNameVisible:i,billboard:r,overrideBrightness:a,brightnessOverride:o,glowing:l,overrideGlowColor:u,glowColor:c,invisible:d,nbt:m,shadowRadius:p,shadowStrength:f,useNBT:_},preventKeybinds:!0,onConfirm(){let g=new Te;g.customName=t.get(),g.customNameVisible=i.get(),g.billboard=r.get(),g.overrideBrightness=a.get(),g.brightnessOverride=o.get(),g.glowing=l.get(),g.overrideGlowColor=u.get(),g.glowColor=c.get(),g.invisible=d.get(),g.nbt=m.get(),g.shadowRadius=p.get(),g.shadowStrength=f.get(),g.useNBT=_.get();let h=Te.getDefault();g.customName===h.customName&&(g.customName=void 0),g.customNameVisible===h.customNameVisible&&(g.customNameVisible=void 0),g.billboard===h.billboard&&(g.billboard=void 0),g.overrideBrightness===h.overrideBrightness&&(g.overrideBrightness=void 0),g.brightnessOverride===h.brightnessOverride&&(g.brightnessOverride=void 0),g.glowing===h.glowing&&(g.glowing=void 0),g.overrideGlowColor===h.overrideGlowColor&&(g.overrideGlowColor=void 0),g.glowColor===h.glowColor&&(g.glowColor=void 0),g.invisible===h.invisible&&(g.invisible=void 0),g.nbt===h.nbt&&(g.nbt=void 0),g.shadowRadius===h.shadowRadius&&(g.shadowRadius=void 0),g.shadowStrength===h.shadowStrength&&(g.shadowStrength=void 0),g.useNBT===h.useNBT&&(g.useNBT=void 0),n.config=g.toJSON()}}).show()}s(L9,"openVanillaItemDisplayConfigDialog");var pv=on(`${ke.name}:open_vanilla_item_display_config`,{icon:"settings",name:w("action.open_vanilla_item_display_config.name"),condition:()=>Ue(),click:()=>{ut.selected.length!==0&&L9(ut.selected[0])}});var Km={};xn(Km,{getItemModel:()=>qm});var P9=new THREE.TextureLoader,_v=new Map;async function qm(n){await yl();let e=_v.get(n);if(e||(e=await gv(V9(n)),_v.set(n,e)),!!e)return e={mesh:e.mesh.clone(!0),outline:e.outline.clone(!0),boundingBox:e.boundingBox.clone(),isBlock:e.isBlock},e.mesh.geometry=e.mesh.geometry.clone(),e.outline.geometry=e.outline.geometry.clone(),e.mesh.name=n,e.isBlock?e.mesh.isVanillaBlockModel=!0:e.mesh.isVanillaItemModel=!0,e}s(qm,"getItemModel");function V9(n){let e=jo(n);return e.namespace+":item/"+e.path}s(V9,"getItemResourceLocation");async function gv(n,e){let t=wr(n,"models"),i=or(t+".json");if(e&&(e.textures!==void 0&&(i.textures??={},Object.assign(i.textures,e.textures)),e.elements!==void 0&&(i.elements=e.elements),e.display!==void 0&&Object.assign(i.display,e.display),e.gui_light!==void 0&&(i.gui_light=e.gui_light),e.overrides!==void 0&&(i.overrides=e.overrides)),i.parent){let r=jo(i.parent);return r.type==="block"?await fr({model:i.parent,isItemModel:!0},i):r.path==="item/generated"?await z9(n,i):await gv(i.parent,i)}else return await fr({model:n,isItemModel:!0},i);throw new Error(`Unsupported item model '${n}'`)}s(gv,"parseItemModel");async function z9(n,e){let t=new THREE.Mesh,i=[],r=[];for(let u of Object.values(e.textures)){let c=wr(u,"textures")+".png",d=Wa(c),m=await P9.loadAsync(d);m.magFilter=THREE.NearestFilter,m.minFilter=THREE.NearestFilter;let p=new THREE.ShaderMaterial({uniforms:{map:{type:"t",value:m},SHADE:{type:"bool",value:settings.shading.value},LIGHTCOLOR:{type:"vec3",value:new THREE.Color().copy(Canvas.global_light_color).multiplyScalar(settings.brightness.value/50)},LIGHTSIDE:{type:"int",value:Canvas.global_light_side},EMISSIVE:{type:"bool",value:!1}},vertexShader:Mu,fragmentShader:Fu,blending:THREE.NormalBlending,side:Canvas.getRenderSide(),transparent:!0});p.map=m,p.name=n;let f=new THREE.Mesh(new THREE.BoxGeometry(1,1,1),p),_=[],g=[],h=[],v=[],y=[],k=s((E,C,j)=>{v.push(E,C,j,E,C,j,E,C,j,E,C,j)},"addNormal");if(m&&m.image.width){let E=document.createElement("canvas"),C=E.getContext("2d");E.width=m.image.width,E.height=m.image.height,C.drawImage(m.image,0,0);let j=s((V,K,te,fe,ae)=>{let ee=_.length/3,se=ae===1?-1:0;_.push(-V,se,K,-V,se,K+1,-V-te,se,K+fe,-V-te,se,K+fe-1),ae===1?g.push(ee+0,ee+1,ee+2,ee+0,ee+2,ee+3):ae===-1&&g.push(ee+0,ee+2,ee+1,ee+0,ee+3,ee+2),k(ae,0,0),h.push((V+te)/E.width,1-K/E.height,(V+te)/E.width,1-(K+fe)/E.height,V/E.width,1-(K+fe)/E.height,V/E.width,1-K/E.height),y.push(1,1,1,1,1,1,1,1,1,1,1,1)},"addFace"),S=s((V,K,te,fe,ae)=>{let ee=_.length/3;_.push(-V,0,K,-V,-1,K,-te,-1,fe,-te,0,fe),ae===1?g.push(ee+0,ee+1,ee+2,ee+0,ee+2,ee+3):ae===-1&&g.push(ee+0,ee+2,ee+1,ee+0,ee+3,ee+2),V==te&&(V+=.1*-ae,te+=.4*-ae,K+=.1,fe-=.1,k(-ae,0,0)),K==fe&&(K+=.1*ae,fe+=.4*ae,V+=.1,te-=.1,k(0,0,-ae)),h.push(te/E.width,1-K/E.height,te/E.width,1-fe/E.height,V/E.width,1-fe/E.height,V/E.width,1-K/E.height),y.push(1,1,1,1,1,1,1,1,1,1,1,1)},"addEdge"),B=C.getImageData(0,0,E.width,E.height),O=[];for(let V=0;V140?1:0);let A=O.slice();for(let V=0;V{_[C]=E+[8,.5,-8][C%3]}),f.geometry.setAttribute("position",new THREE.BufferAttribute(new Float32Array(_),3)),f.geometry.setAttribute("highlight",new THREE.BufferAttribute(new Uint8Array(f.geometry.attributes.position.count),1)),f.geometry.setIndex(g),f.geometry.setAttribute("uv",new THREE.BufferAttribute(new Float32Array(h),2)),f.geometry.setAttribute("color",new THREE.BufferAttribute(new Float32Array(y),3)),f.geometry.setAttribute("normal",new THREE.BufferAttribute(new Float32Array(v),3)),f.geometry.attributes.color.needsUpdate=!0,f.geometry.attributes.normal.needsUpdate=!0,f.geometry.rotateX(Math.PI/2);let b=f.geometry.clone(),x=Array.from(b.attributes.position.array);x.splice(0,24),b.setAttribute("position",new THREE.BufferAttribute(new Float32Array(x),3)),r.push(b),i.push(f.geometry.clone()),t.add(f)}let a=Rr(r),o=Rr(i),l=new THREE.LineSegments(new THREE.EdgesGeometry(a),Canvas.outlineMaterial);return{mesh:t,outline:l,boundingBox:o}}s(z9,"generateItemMesh");var Ni=class extends hn{type=Ni.type;icon="icecream";needsUniqueName=!0;_item=new ge("minecraft:diamond");_itemDisplay=new ge("none");config;error=new ge("");menu=new Menu([...Outliner.control_menu_group,pv,"_","rename","delete"]);buttons=[Outliner.buttons.export,Outliner.buttons.locked,Outliner.buttons.visibility];preview_controller=G9;ready=!1;constructor(e,t=guid()){super(e,t),Ni.all.push(this);for(let r in Ni.properties)Ni.properties[r].reset(this);this.name="item_display",this.extend(e),this.item??="minecraft:diamond",this.itemDisplay??="none",this.position??=[0,0,0],this.rotation??=[0,0,0],this.scale??=[1,1,1],this.visibility??=!0,this.config??={},this.sanitizeName();let i=s(r=>{if(!Vn.item){requestAnimationFrame(()=>i(r));return}let[a,o]=r.split(":");o||(o=a,a="minecraft"),(a==="minecraft"||a==="")&&Vn.item.has(o)?(this.error.set(""),this.preview_controller.updateGeometry(this)):this.error.set(`This item does not exist in Minecraft ${Ma().id}.`)},"updateItem");this._item.subscribe(r=>{i(r)})}get item(){return this._item===void 0?"minecraft:diamond":this._item.get()}set item(e){this._item!==void 0&&this._item.set(e)}get itemDisplay(){return this._itemDisplay===void 0?"none":this._itemDisplay.get()}set itemDisplay(e){this._itemDisplay!==void 0&&this._itemDisplay.set(e)}async waitForReady(){for(;!this.ready;)await new Promise(e=>setTimeout(e,1e3/framespersecond))}sanitizeName(){this.name=Ht(this.name);let e=[...Ni.all.filter(o=>o.uuid!==this.uuid),...Group.all,...qe.all,...ht.all],t=new Set(e.map(o=>o.name));if(!t.has(this.name))return this.name;let i=1,r=this.name.match(/\d+$/);r&&(i=parseInt(r[0]),this.name=this.name.slice(0,-r[0].length));let a=1e4;for(;a-- >0;){let o=`${this.name}${i}`;if(!t.has(o))return this.name=o,o;i++}throw new Error("Could not make VanillaItemDisplay name unique!")}getUndoCopy(){let e={};for(let t in Ni.properties)Ni.properties[t].copy(this,e);return e.uuid=this.uuid,e.type=this.type,e}getSaveCopy(){let e={};for(let t in Ni.properties)Ni.properties[t].copy(this,e);return e.uuid=this.uuid,e.type=this.type,e}select(){return Group.selected&&Group.selected.unselect(),!Pressing.ctrl&&!Pressing.shift&&(Cube.selected.length&&Cube.selected.forEachReverse(e=>e.unselect()),selected.length&&selected.forEachReverse(e=>e!==this&&e.unselect())),Ni.selected.safePush(this),this.selectLow(),this.showInOutliner(),updateSelection(),Animator.open&&Blockbench.Animation.selected&&Blockbench.Animation.selected.getBoneAnimator(this).select(),this}unselect(){this.selected&&(Animator.open&&Timeline.selected_animator&&Timeline.selected_animator.element===this&&Timeline.selected&&Timeline.selected.empty(),Project.selected_elements.remove(this),Ni.selected.remove(this),this.selected=!1,TickUpdates.selection=!0,this.preview_controller.updateHighlight(this))}},ut=Ni;s(ut,"VanillaItemDisplay"),kt(ut,"type",`${ke.name}:vanilla_item_display`),kt(ut,"selected",[]),kt(ut,"all",[]);new Property(ut,"string","item",{default:"minecraft:diamond"});new Property(ut,"string","item_display",{default:"none"});new Property(ut,"object","config",{get default(){return new Te().toJSON()}});OutlinerElement.registerType(ut,ut.type);var G9=new NodePreviewController(ut,{setup(n){hn.prototype.preview_controller.setup(n)},updateGeometry(n){n.mesh&&qm(n.item).then(e=>{if(!e)return;let t=n.mesh;t.name=n.uuid,t.geometry=e.boundingBox,t.material=Canvas.transparentMaterial,t.clear(),t.add(e.mesh),t.add(e.outline),t.outline=e.outline,n.preview_controller.updateHighlight(n),n.preview_controller.updateTransform(n),t.visible=n.visibility,TickUpdates.selection=!0,n.ready=!0}).catch(e=>{typeof e.message=="string"&&n.error.set(e.message)})},updateTransform(n){hn.prototype.preview_controller.updateTransform(n)},updateHighlight(n,e){if(!Ue()||!n?.mesh)return;let t=Modes.edit&&(e===!0||e===n||n.selected)?1:0,i=n.mesh.children.at(0);if(i)for(let r of i.children){if(!(r instanceof THREE.Mesh))continue;let a=r.geometry.attributes.highlight;a.array[0]!=t&&(a.array.set(Array(a.count).fill(t)),a.needsUpdate=!0)}}}),Ll=class extends BoneAnimator{_name;uuid;element;constructor(e,t,i){super(e,t,i),this.uuid=e,this._name=i}getElement(){return this.element=OutlinerNode.uuids[this.uuid],this.element}select(){if(this.getElement(),!this.element)return unselectAllElements(),this;if(this.element.locked)return this;if(!this.element.selected&&this.element&&this.element.select(),GeneralAnimator.prototype.select.call(this),this[Toolbox.selected.animation_channel]&&(Timeline.selected&&Timeline.selected.length===0||(Timeline.selected&&Timeline.selected[0].animator)!==this)){let e;this[Toolbox.selected.animation_channel].forEach(t=>{Math.abs(t.time-Timeline.time)<.002&&(e=t)}),e&&e.select()}return this.element&&this.element.parent&&this.element.parent!=="root"&&this.element.parent.openUp(),this}doRender(){return this.getElement(),!!(this.element&&this.element.mesh)}displayRotation(e,t=1){let i=this.getElement().mesh;if(i.fix_rotation&&i.rotation.copy(i.fix_rotation),e)if(e.length===4){let r=new THREE.Euler().setFromQuaternion(new THREE.Quaternion().fromArray(e),"ZYX");i.rotation.x-=r.x*t,i.rotation.y-=r.y*t,i.rotation.z+=r.z*t}else i.rotation.x+=Math.degToRad(-e[0])*t,i.rotation.y+=Math.degToRad(-e[1])*t,i.rotation.z+=Math.degToRad(e[2])*t;if(this.rotation_global){let r=i.parent?.getWorldQuaternion(Reusable.quat1);if(!r)return this;r.invert(),i.quaternion.premultiply(r)}return this}displayPosition(e,t=1){let i=this.getElement().mesh;return i.fix_position&&i.position.copy(i.fix_position),e&&(i.position.x-=e[0]*t,i.position.y+=e[1]*t,i.position.z+=e[2]*t),this}displayScale(e,t=1){if(!e)return this;let i=this.getElement().mesh;return i.fix_scale&&i.scale.copy(i.fix_scale),i.scale.x=1+(e[0]-1)*t||1e-5,i.scale.y=1+(e[1]-1)*t||1e-5,i.scale.z=1+(e[2]-1)*t||1e-5,this}};s(Ll,"VanillaItemDisplayAnimator");Ll.prototype.type=ut.type;ut.animator=Ll;$e(`${ke.name}:vanillaItemDisplay`,{subscriptions:[]},n=>(Interface.Panels.outliner.menu.addAction(ns,3),Toolbars.outliner.add(ns,0),MenuBar.menus.edit.addAction(ns,8),n.subscriptions.push(re.SELECT_PROJECT.subscribe(e=>{e.vanillaItemDisplays??=[],ut.all.empty(),ut.all.push(...e.vanillaItemDisplays)}),re.UNSELECT_PROJECT.subscribe(e=>{e.vanillaItemDisplays=[...ut.all],ut.all.empty()})),n),n=>{Interface.Panels.outliner.menu.removeAction(ns.id),Toolbars.outliner.remove(ns),MenuBar.menus.edit.removeAction(ns.id),n.subscriptions.forEach(e=>e())});var ns=on(`${ke.name}:create_vanilla_item_display`,{name:w("action.create_vanilla_item_display.title"),icon:"icecream",category:"animated_java",condition(){return Ue()&&Mode.selected.id===Modes.options.edit.id},click(){Undo.initEdit({outliner:!0,elements:[],selection:!0});let n=new ut({}).init(),e=getCurrentGroup();return e instanceof Group&&(n.addTo(e),n.extend({position:e.origin.slice()})),selected.forEachReverse(t=>t.unselect()),Group.selected&&Group.selected.unselect(),n.select(),Undo.finishEdit("Create Vanilla Item Display",{outliner:!0,elements:selected,selection:!0}),n}});var Wm=Canvas.outlineMaterial.clone();Wm.color.set("#ff0000");var Bi=class extends hn{type=Bi.type;icon="deployed_code";needsUniqueName=!0;_block=new ge("minecraft:stone");config;error=new ge("");menu=new Menu([...Outliner.control_menu_group,rv,"_","rename","delete"]);buttons=[Outliner.buttons.export,Outliner.buttons.locked,Outliner.buttons.visibility];preview_controller=U9;ready=!1;constructor(e,t=guid()){super(e,t),Bi.all.push(this);for(let r in Bi.properties)Bi.properties[r].reset(this);this.name="block_display",this.extend(e),this.block??="minecraft:stone",this.config??={};let i=s(async r=>{if(!Vn.block){requestAnimationFrame(()=>void i(r));return}let a=await Io(r);a?(a.resource.namespace==="minecraft"||a.resource.namespace==="")&&Vn.block.has(a.resource.name)?(this.error.set(""),this.preview_controller.updateGeometry(this)):this.error.set(`This block does not exist in Minecraft ${Ma().id}.`):this.error.set("Invalid block ID."),this.mesh?.outline instanceof THREE.LineSegments&&(this.error.get()?this.mesh.outline.material=Wm:this.mesh.outline.material=Canvas.outlineMaterial)},"updateBlock");this._block.subscribe(r=>{i(r)})}get block(){return this._block===void 0?"minecraft:stone":this._block.get()}set block(e){this._block!==void 0&&this.block!==e&&this._block.set(e)}async waitForReady(){for(;!this.ready;)await new Promise(e=>setTimeout(e,1e3/framespersecond))}sanitizeName(){this.name=Ht(this.name);let e=[...Bi.all.filter(o=>o.uuid!==this.uuid),...Group.all,...qe.all,...ut.all],t=new Set(e.map(o=>o.name));if(!t.has(this.name))return this.name;let i=1,r=this.name.match(/\d+$/);r&&(i=parseInt(r[0]),this.name=this.name.slice(0,-r[0].length));let a=1e4;for(;a-- >0;){let o=`${this.name}${i}`;if(!t.has(o))return this.name=o,o;i++}throw new Error("Could not make VanillaBlockDisplay name unique!")}getUndoCopy(){let e={};for(let t in Bi.properties)Bi.properties[t].copy(this,e);return e.uuid=this.uuid,e.type=this.type,e}getSaveCopy(){let e={};for(let t in Bi.properties)Bi.properties[t].copy(this,e);return e.uuid=this.uuid,e.type=this.type,e}select(){return Group.selected&&Group.selected.unselect(),!Pressing.ctrl&&!Pressing.shift&&(Cube.selected.length&&Cube.selected.forEachReverse(e=>e.unselect()),selected.length&&selected.forEachReverse(e=>e!==this&&e.unselect())),Bi.selected.safePush(this),this.selectLow(),this.showInOutliner(),updateSelection(),Animator.open&&Blockbench.Animation.selected&&Blockbench.Animation.selected.getBoneAnimator(this).select(),this}unselect(){this.selected&&(Animator.open&&Timeline.selected_animator&&Timeline.selected_animator.element===this&&Timeline.selected&&Timeline.selected.empty(),Project.selected_elements.remove(this),Bi.selected.remove(this),this.selected=!1,TickUpdates.selection=!0,this.preview_controller.updateHighlight(this))}},ht=Bi;s(ht,"VanillaBlockDisplay"),kt(ht,"type",`${ke.name}:vanilla_block_display`),kt(ht,"selected",[]),kt(ht,"all",[]);new Property(ht,"string","block",{default:"minecraft:stone"});new Property(ht,"object","config",{get default(){return new Te().toJSON()}});OutlinerElement.registerType(ht,ht.type);var U9=new NodePreviewController(ht,{setup(n){hn.prototype.preview_controller.setup(n)},updateGeometry(n){n.mesh&&Jm(n.block).then(e=>{if(!e?.mesh)return;let t=n.mesh;t.name=n.uuid,t.geometry=e.boundingBox,t.material=Canvas.transparentMaterial,t.clear(),e.outline.name=n.uuid+"_outline",e.outline.visible=n.selected,t.outline=e.outline,t.add(e.mesh),t.add(e.outline),n.preview_controller.updateHighlight(n),n.preview_controller.updateTransform(n),t.visible=n.visibility,TickUpdates.selection=!0,n.ready=!0}).catch(e=>{console.error(e),typeof e.message=="string"&&n.error.set(e.message)}).finally(()=>{n.mesh?.outline instanceof THREE.LineSegments&&(n.error.get()?n.mesh.outline.material=Wm:n.mesh.outline.material=Canvas.outlineMaterial)})},updateTransform(n){hn.prototype.preview_controller.updateTransform(n)},updateHighlight(n,e){if(!Ue()||!n?.mesh)return;let t=Modes.edit&&(e===!0||e===n||n.selected)?1:0,i=n.mesh.children.at(0);if(i)for(let r of i.children){if(!(r instanceof THREE.Mesh))continue;let a=r.geometry.attributes.highlight;a.array[0]!=t&&(a.array.set(Array(a.count).fill(t)),a.needsUpdate=!0)}}}),Pl=class extends BoneAnimator{_name;uuid;element;constructor(e,t,i){super(e,t,i),this.uuid=e,this._name=i}getElement(){return this.element=OutlinerNode.uuids[this.uuid],this.element}select(){if(this.getElement(),!this.element)return unselectAllElements(),this;if(this.element.locked)return this;if(!this.element.selected&&this.element&&this.element.select(),GeneralAnimator.prototype.select.call(this),this[Toolbox.selected.animation_channel]&&(Timeline.selected&&Timeline.selected.length===0||(Timeline.selected&&Timeline.selected[0].animator)!==this)){let e;this[Toolbox.selected.animation_channel].forEach(t=>{Math.abs(t.time-Timeline.time)<.002&&(e=t)}),e&&e.select()}return this.element&&this.element.parent&&this.element.parent!=="root"&&this.element.parent.openUp(),this}doRender(){return this.getElement(),!!(this.element&&this.element.mesh)}displayRotation(e,t=1){let i=this.getElement().mesh;if(i.fix_rotation&&i.rotation.copy(i.fix_rotation),e)if(e.length===4){let r=new THREE.Euler().setFromQuaternion(new THREE.Quaternion().fromArray(e),"ZYX");i.rotation.x-=r.x*t,i.rotation.y-=r.y*t,i.rotation.z+=r.z*t}else i.rotation.x-=Math.degToRad(e[0])*t,i.rotation.y-=Math.degToRad(e[1])*t,i.rotation.z+=Math.degToRad(e[2])*t;if(this.rotation_global){let r=i.parent?.getWorldQuaternion(Reusable.quat1);if(!r)return this;r.invert(),i.quaternion.premultiply(r)}return this}displayPosition(e,t=1){let i=this.getElement().mesh;return i.fix_position&&i.position.copy(i.fix_position),e&&(i.position.x-=e[0]*t,i.position.y+=e[1]*t,i.position.z+=e[2]*t),this}displayScale(e,t=1){if(!e)return this;let i=this.getElement().mesh;return i.fix_scale&&i.scale.copy(i.fix_scale),i.scale.x*=1+(e[0]-1)*t||1e-5,i.scale.y*=1+(e[1]-1)*t||1e-5,i.scale.z*=1+(e[2]-1)*t||1e-5,this}};s(Pl,"VanillaBlockDisplayAnimator");Pl.prototype.type=ht.type;ht.animator=Pl;$e(`${ke.name}:vanillaBlockDisplay`,{subscriptions:[]},n=>(Interface.Panels.outliner.menu.addAction(is,3),Toolbars.outliner.add(is,0),MenuBar.menus.edit.addAction(is,8),n.subscriptions.push(re.SELECT_PROJECT.subscribe(e=>{e.vanillaBlockDisplays??=[],ht.all.empty(),ht.all.push(...e.vanillaBlockDisplays)}),re.UNSELECT_PROJECT.subscribe(e=>{e.vanillaBlockDisplays=[...ht.all],ht.all.empty()})),n),n=>{Interface.Panels.outliner.menu.removeAction(is.id),Toolbars.outliner.remove(is),MenuBar.menus.edit.removeAction(is.id),n.subscriptions.forEach(e=>e())});var is=on(`${ke.name}:create_vanilla_block_display`,{name:w("action.create_vanilla_block_display.title"),icon:"deployed_code",category:"animated_java",condition(){return Ue()&&Mode.selected.id===Modes.options.edit.id},click(){Undo.initEdit({outliner:!0,elements:[],selection:!0});let n=new ht({}).init(),e=getCurrentGroup();return e instanceof Group&&(n.addTo(e),n.extend({position:e.origin.slice()})),selected.forEachReverse(t=>t.unselect()),Group.selected&&Group.selected.unselect(),n.select(),Undo.finishEdit("Create Vanilla Block Display",{outliner:!0,elements:selected,selection:!0}),n}});function hv(){let n=Math.floor(Math.sqrt(Vn.block.items.length));for(let e=0;e`${t}=${i.toString()}`).join(",")}]`}s(J9,"generateBlockStateString");function H9(n){let e=Object.values(n).reduce((i,r)=>i*r.length,1),t=[];for(let i=0;i{let u=a%l.length;r[o]=String(l[u]),a=Math.floor(a/l.length)}),t.push(r)}return t}s(H9,"computeAllStatePermutations");var Nn=class extends hn{type=Nn.type;icon="text_fields";needsUniqueName=!0;config;menu=new Menu([...Outliner.control_menu_group,Q0,"_","rename","delete"]);buttons=[Outliner.buttons.export,Outliner.buttons.locked,Outliner.buttons.visibility];preview_controller=$9;ready=!1;textError=new ge("");_updating=!1;_text=new ge("Hello World!");_newText;_lineWidth=new ge(200);_newLineWidth;_backgroundColor=new ge("#000000");_newBackgroundColor;_backgroundAlpha=new ge(.25);_newBackgroundAlpha;_shadow=new ge(!1);_newShadow;_align=new ge("center");_newAlign;seeThrough=!1;constructor(e,t=guid()){super(e,t),Nn.all.push(this);for(let i in Nn.properties)Nn.properties[i].reset(this);this.name="text_display",this.extend(e),this.name??="text_display",this.position??=[0,0,0],this.rotation??=[0,0,0],this.scale??=[1,1,1],this.align??="center",this.visibility??=!0,this.config??={},this.sanitizeName(),this._text.subscribe(i=>{this._newText=i,this.updateText()}),this._lineWidth.subscribe(i=>{this._newLineWidth=i,this.updateText()}),this._backgroundColor.subscribe(i=>{this._newBackgroundColor=i,this.updateText()}),this._backgroundAlpha.subscribe(i=>{this._newBackgroundAlpha=i,this.updateText()}),this._shadow.subscribe(i=>{this._newShadow=i,this.updateText()}),this._align.subscribe(i=>{this._newAlign=i,this.updateText()})}sanitizeName(){this.name=Ht(this.name);let e=[...Nn.all.filter(o=>o.uuid!==this.uuid),...Group.all,...ht.all,...ut.all],t=new Set(e.map(o=>o.name));if(!t.has(this.name))return this.name;let i=1,r=this.name.match(/\d+$/);r&&(i=parseInt(r[0]),this.name=this.name.slice(0,-r[0].length));let a=1e4;for(;a-- >0;){let o=`${this.name}${i}`;if(!t.has(o))return this.name=o,o;i++}throw new Error("Could not make TextDisplay name unique!")}get text(){return this._text===void 0?Nn.properties.text.default:this._text.get()}set text(e){this._text!==void 0&&e!==this.text&&this._text.set(e)}get lineWidth(){return this._lineWidth===void 0?Nn.properties.lineWidth.default:this._lineWidth.get()}set lineWidth(e){this._lineWidth!==void 0&&this._lineWidth.set(e)}get backgroundColor(){return this._backgroundColor===void 0?Nn.properties.backgroundColor.default:this._backgroundColor.get()}set backgroundColor(e){this._backgroundColor!==void 0&&this._backgroundColor.set(e)}get backgroundAlpha(){return this._backgroundAlpha===void 0?Nn.properties.backgroundAlpha.default:this._backgroundAlpha.get()}set backgroundAlpha(e){this._backgroundAlpha!==void 0&&this._backgroundAlpha.set(e)}get shadow(){return this._shadow===void 0?Nn.properties.shadow.default:this._shadow.get()}set shadow(e){this._shadow!==void 0&&this._shadow.set(e)}get align(){return this._align===void 0?Nn.properties.align.default:this._align.get()}set align(e){this._align!==void 0&&this._align.set(e)}getUndoCopy(){let e=new Nn(this);for(let t in Nn.properties)Nn.properties[t].copy(this,e);return e.uuid=this.uuid,e.type=this.type,delete e.parent,e}getSaveCopy(){let e={};for(let t in Nn.properties)Nn.properties[t].copy(this,e);return e.uuid=this.uuid,e.type=this.type,e}select(){return Group.selected&&Group.selected.unselect(),!Pressing.ctrl&&!Pressing.shift&&(Cube.selected.length&&Cube.selected.forEachReverse(e=>e.unselect()),selected.length&&selected.forEachReverse(e=>e!==this&&e.unselect())),Nn.selected.safePush(this),this.selectLow(),this.showInOutliner(),updateSelection(),Animator.open&&Blockbench.Animation.selected&&Blockbench.Animation.selected.getBoneAnimator(this).select(),this}unselect(){this.selected&&(Animator.open&&Timeline.selected_animator&&Timeline.selected_animator.element===this&&Timeline.selected&&Timeline.selected.empty(),Project.selected_elements.remove(this),Nn.selected.remove(this),this.selected=!1,TickUpdates.selection=!0)}async updateText(){if(this._updating)return;this._updating=!0;let e;for(;this._newText!==void 0||this._newLineWidth!==void 0||this._newBackgroundColor!==void 0||this._newBackgroundAlpha!==void 0||this._newShadow!==void 0||this._newAlign!==void 0;){let t;this.textError.set("");try{t=$t.fromString(this.text)}catch(i){console.error(i),this.textError.set(i.message),this._updating=!1,t=new $t({text:"Invalid JSON Text!",color:"red"})}this._newText=void 0,this._newLineWidth=void 0,this._newBackgroundColor=void 0,this._newBackgroundAlpha=void 0,this._newShadow=void 0,this._newAlign=void 0,t&&(e=await this.setText(t))}return this._updating=!1,e}async waitForReady(){for(;!this.ready;)await new Promise(e=>setTimeout(e,1e3/framespersecond))}async setText(e){await this.waitForReady();let t=await eo(),{mesh:i,outline:r}=await t.generateTextMesh({jsonText:e,maxLineWidth:this.lineWidth,backgroundColor:this.backgroundColor,backgroundAlpha:this.backgroundAlpha,shadow:this.shadow,alignment:this.align});i.name=this.uuid+"_text";let a=this.mesh.children.find(u=>u.name===i.name);a&&this.mesh.remove(a);let o=this.mesh;o.name=this.uuid,o.geometry=i.children[0].geometry.clone(),o.geometry.translate(i.children[0].position.x,i.children[0].position.y,i.children[0].position.z),o.geometry.rotateY(Math.PI),o.geometry.scale(i.scale.x,i.scale.y,i.scale.z),o.material=Canvas.transparentMaterial,o.add(i),r.name=this.uuid+"_outline",r.visible=this.selected,o.outline=r;let l=o.children.find(u=>u.name===r.name);return l&&o.remove(l),o.add(r),o.visible=this.visibility,i}},qe=Nn;s(qe,"TextDisplay"),kt(qe,"type",`${ke.name}:text_display`),kt(qe,"selected",[]),kt(qe,"all",[]);new Property(qe,"string","text",{default:'"Hello World!"'});new Property(qe,"number","lineWidth",{default:200});new Property(qe,"string","backgroundColor",{default:"#000000"});new Property(qe,"number","backgroundAlpha",{default:.25});new Property(qe,"string","align",{default:"center"});new Property(qe,"boolean","shadow",{default:!1});new Property(qe,"boolean","seeThrough",{default:!1});new Property(qe,"object","config",{get default(){return new Tn().toJSON()}});OutlinerElement.registerType(qe,qe.type);var $9=new NodePreviewController(qe,{setup(n){hn.prototype.preview_controller.setup(n),Project.nodes_3d[n.uuid].renderOrder=-1,eo().then(()=>{n.ready=!0,n.preview_controller.updateTransform(n),n.preview_controller.updateGeometry(n),n.preview_controller.dispatchEvent("setup",{element:n})})},updateGeometry(n){n.updateText().then(()=>{n.preview_controller.updateTransform(n)})},updateTransform(n){hn.prototype.preview_controller.updateTransform(n)}}),Vl=class extends BoneAnimator{_name;uuid;element;constructor(e,t,i){super(e,t,i),this.uuid=e,this._name=i}getElement(){return this.element=OutlinerNode.uuids[this.uuid],this.element}select(){if(this.getElement(),!this.element)return unselectAllElements(),this;if(this.element.locked)return this;if(!this.element.selected&&this.element&&this.element.select(),GeneralAnimator.prototype.select.call(this),this[Toolbox.selected.animation_channel]&&(Timeline.selected&&Timeline.selected.length===0||(Timeline.selected&&Timeline.selected[0].animator)!==this)){let e;this[Toolbox.selected.animation_channel].forEach(t=>{Math.abs(t.time-Timeline.time)<.002&&(e=t)}),e&&e.select()}return this.element&&this.element.parent&&this.element.parent!=="root"&&this.element.parent.openUp(),this}doRender(){return this.getElement(),!!(this.element&&this.element.mesh)}displayRotation(e,t=1){let i=this.getElement().mesh;if(i.fix_rotation&&i.rotation.copy(i.fix_rotation),e)if(e.length===4){let r=new THREE.Euler().setFromQuaternion(new THREE.Quaternion().fromArray(e),"ZYX");i.rotation.x-=r.x*t,i.rotation.y-=r.y*t,i.rotation.z+=r.z*t}else i.rotation.x-=Math.degToRad(e[0])*t,i.rotation.y-=Math.degToRad(e[1])*t,i.rotation.z+=Math.degToRad(e[2])*t;if(this.rotation_global){let r=i.parent?.getWorldQuaternion(Reusable.quat1);if(!r)return this;r.invert(),i.quaternion.premultiply(r)}return this}displayPosition(e,t=1){let i=this.getElement().mesh;return i.fix_position&&i.position.copy(i.fix_position),e&&(i.position.x-=e[0]*t,i.position.y+=e[1]*t,i.position.z+=e[2]*t),this}displayScale(e,t=1){if(!e)return this;let i=this.getElement().mesh;return i.fix_scale&&i.scale.copy(i.fix_scale),i.scale.x*=1+(e[0]-1)*t||1e-5,i.scale.y*=1+(e[1]-1)*t||1e-5,i.scale.z*=1+(e[2]-1)*t||1e-5,this}};s(Vl,"TextDisplayAnimator");Vl.prototype.type=qe.type;qe.animator=Vl;$e(`${ke.name}:textDisplay`,{subscriptions:[]},n=>(Interface.Panels.outliner.menu.addAction(rs,3),Toolbars.outliner.add(rs,0),MenuBar.menus.edit.addAction(rs,8),n.subscriptions.push(re.SELECT_PROJECT.subscribe(e=>{e.format.id===rt.id&&(e.textDisplays??=[],qe.all.empty(),qe.all.push(...e.textDisplays))}),re.UNSELECT_PROJECT.subscribe(e=>{e.format.id===rt.id&&(e.textDisplays=[...qe.all],qe.all.empty())})),n),n=>{Interface.Panels.outliner.menu.removeAction(rs.id),Toolbars.outliner.remove(rs),MenuBar.menus.edit.removeAction(rs.id),n.subscriptions.forEach(e=>e())});var rs=on(`${ke.name}:create_text_display`,{name:w("action.create_text_display.title"),icon:"text_fields",category:"animated_java",condition(){return Ue()&&Mode.selected.id===Modes.options.edit.id},click(){Undo.initEdit({outliner:!0,elements:[],selection:!0});let n=new qe({}).init(),e=getCurrentGroup();return e instanceof Group&&(n.addTo(e),n.extend({position:e.origin.slice()})),selected.forEachReverse(t=>t.unselect()),Group.selected&&Group.selected.unselect(),n.select(),Undo.finishEdit("Create Text Display",{outliner:!0,elements:selected,selection:!0}),n}});function Vu(n,e={}){let t=[];return e?.excludeEmptyGroups?t.push(...Group.all.filter(r=>r.children.length>0&&r.children.some(a=>a instanceof Cube))):t.push(...Group.all),e?.groupsOnly||t.push(...Locator.all,...qe.all,...ut.all,...ht.all,...OutlinerElement.types.camera?.all||[]),t.map(r=>{let a=n.find(l=>l.value===r.uuid);a&&(a.name=r.name);let o;switch(!0){case r instanceof Group:o="folder";break;case r instanceof Locator:o="anchor";break;case r instanceof qe:case r instanceof ut:case r instanceof ht:o=r.icon;break;case r instanceof OutlinerElement.types.camera:o="videocam";break;default:o="close";break}return{icon:o,name:r.name,value:r.uuid}})}s(Vu,"getAvailableNodes");function q9(n){let e,t,i,r,a,o,l,u,c,d,m,p,f;function _(E){n[5](E)}s(_,"lineinput_value_binding");let g={label:w("dialog.animation_properties.animation_name.title"),tooltip:w("dialog.animation_properties.animation_name.description"),valueChecker:K9};n[0]!==void 0&&(g.value=n[0]),t=new en({props:g}),le.push(()=>we(t,"value",_));function h(E){n[6](E)}s(h,"select_value_binding");let v={label:w("dialog.animation_properties.loop_mode.title"),tooltip:w("dialog.animation_properties.loop_mode.description"),options:{once:w("dialog.animation_properties.loop_mode.options.once"),hold:w("dialog.animation_properties.loop_mode.options.hold"),loop:w("dialog.animation_properties.loop_mode.options.loop")},defaultOption:"once"};n[1]!==void 0&&(v.value=n[1]),a=new Yn({props:v}),le.push(()=>we(a,"value",h));function y(E){n[7](E)}s(y,"numberslider_value_binding");let k={label:w("dialog.animation_properties.loop_delay.title"),tooltip:w("dialog.animation_properties.loop_delay.description"),min:0};n[2]!==void 0&&(k.value=n[2]),u=new Ot({props:k}),le.push(()=>we(u,"value",y));function b(E){n[8](E)}s(b,"collection_includedItems_binding");let x={label:w("dialog.animation_properties.excluded_nodes.title"),tooltip:w("dialog.animation_properties.bone_lists.description"),availableItemsColumnLable:w("dialog.animation_properties.included_nodes.title"),availableItemsColumnTooltip:w("dialog.animation_properties.included_nodes.description"),includedItemsColumnLable:w("dialog.animation_properties.excluded_nodes.title"),includedItemsColumnTooltip:w("dialog.animation_properties.excluded_nodes.description"),swapColumnsButtonTooltip:w("dialog.animation_properties.swap_columns_button.tooltip"),availableItems:n[4]};return n[3]!==void 0&&(x.includedItems=n[3]),m=new ju({props:x}),le.push(()=>we(m,"includedItems",b)),{c(){e=P("div"),_e(t.$$.fragment),r=G(),_e(a.$$.fragment),l=G(),_e(u.$$.fragment),d=G(),_e(m.$$.fragment)},m(E,C){L(E,e,C),me(t,e,null),N(e,r),me(a,e,null),N(e,l),me(u,e,null),N(e,d),me(m,e,null),f=!0},p(E,[C]){let j={};!i&&C&1&&(i=!0,j.value=E[0],ye(()=>i=!1)),t.$set(j);let S={};!o&&C&2&&(o=!0,S.value=E[1],ye(()=>o=!1)),a.$set(S);let B={};!c&&C&4&&(c=!0,B.value=E[2],ye(()=>c=!1)),u.$set(B);let O={};!p&&C&8&&(p=!0,O.includedItems=E[3],ye(()=>p=!1)),m.$set(O)},i(E){f||(q(t.$$.fragment,E),q(a.$$.fragment,E),q(u.$$.fragment,E),q(m.$$.fragment,E),f=!0)},o(E){Z(t.$$.fragment,E),Z(a.$$.fragment,E),Z(u.$$.fragment,E),Z(m.$$.fragment,E),f=!1},d(E){E&&F(e),de(t),de(a),de(u),de(m)}}}s(q9,"create_fragment");function K9(n){return n.trim().length===0?{type:"error",message:w("dialog.animation_properties.animation_name.error.empty")}:n.match(/[^a-zA-Z0-9_\.]/)?{type:"error",message:w("dialog.animation_properties.animation_name.error.invalid_characters")}:{type:"success",message:""}}s(K9,"animationNameValueChecker");function W9(n,e,t){let{animationName:i}=e,{loopMode:r}=e,{loopDelay:a}=e,{excludedNodes:o}=e,l=Vu(o.get());function u(p){i=p,t(0,i)}s(u,"lineinput_value_binding");function c(p){r=p,t(1,r)}s(c,"select_value_binding");function d(p){a=p,t(2,a)}s(d,"numberslider_value_binding");function m(p){o=p,t(3,o)}return s(m,"collection_includedItems_binding"),n.$$set=p=>{"animationName"in p&&t(0,i=p.animationName),"loopMode"in p&&t(1,r=p.loopMode),"loopDelay"in p&&t(2,a=p.loopDelay),"excludedNodes"in p&&t(3,o=p.excludedNodes)},[i,r,a,o,l,u,c,d,m]}s(W9,"instance");var zu=class extends Be{constructor(e){super(),De(this,e,W9,q9,Oe,{animationName:0,loopMode:1,loopDelay:2,excludedNodes:3})}};s(zu,"AnimationProperties");var vv=zu;var Zm=`${ke.name}:animationPropertiesDialog`;function yv(n){let e=new ge(n.name),t=new ge(n.loop),i=new ge(Number(n.loop_delay)||0),r=new ge(n.excluded_nodes);new qt({id:Zm,title:w("dialog.animation_properties.title",n.name),width:600,component:vv,props:{animationName:e,loopMode:t,loopDelay:i,excludedNodes:r},preventKeybinds:!0,onConfirm(){n.name=e.get(),n.createUniqueName(Blockbench.Animation.all),n.loop=t.get(),n.loop_delay=i.get().toString(),n.excluded_nodes=r.get()}}).show()}s(yv,"openAnimationPropertiesDialog");function Z9(n){let e,t,i,r,a,o,l,u,c,d;return{c(){e=P("div"),t=P("label"),i=Re(n[0]),a=G(),o=P("textarea"),T(t,"class","name_space_left"),T(t,"for",r=n[12]),T(o,"class","dark_bordered half focusable_input svelte-1hf5813"),T(o,"id",l=n[12]),o.disabled=n[2],T(o,"style",u=n[2]?"color: var(--color-subtle_text);":""),T(e,"class","dialog_bar form_bar")},m(m,p){L(m,e,p),N(e,t),N(t,i),N(e,a),N(e,o),bt(o,n[3]),c||(d=[Le(o,"input",n[11]),Le(o,"change",n[6])],c=!0)},p(m,p){p&1&&ot(i,m[0]),p&4096&&r!==(r=m[12])&&T(t,"for",r),p&4096&&l!==(l=m[12])&&T(o,"id",l),p&4&&(o.disabled=m[2]),p&4&&u!==(u=m[2]?"color: var(--color-subtle_text);":"")&&T(o,"style",u),p&8&&bt(o,m[3])},d(m){m&&F(e),c=!1,Lt(d)}}}s(Z9,"create_default_slot");function X9(n){let e,t;return e=new jn({props:{label:n[0],tooltip:n[1],warning_text:n[4],error_text:n[5],onReset:n[7],$$slots:{default:[Z9,({id:i})=>({12:i}),({id:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){_e(e.$$.fragment)},m(i,r){me(e,i,r),t=!0},p(i,[r]){let a={};r&1&&(a.label=i[0]),r&2&&(a.tooltip=i[1]),r&16&&(a.warning_text=i[4]),r&32&&(a.error_text=i[5]),r&12301&&(a.$$scope={dirty:r,ctx:i}),e.$set(a)},i(i){t||(q(e.$$.fragment,i),t=!0)},o(i){Z(e.$$.fragment,i),t=!1},d(i){de(e,i)}}}s(X9,"create_fragment");function Y9(n,e,t){let{label:i}=e,{tooltip:r=""}=e,{value:a}=e,{defaultValue:o}=e,{disabled:l=!1}=e,{valueChecker:u=void 0}=e,c=a.get(),d="",m="";function p(){if(u){let g=u(c);g.type==="error"?t(5,m=g.message):t(5,m=""),g.type==="warning"?t(4,d=g.message):t(4,d="")}a.set(c),t(3,c=a.get())}s(p,"onValueChange");function f(){t(3,c=o),p()}s(f,"onReset"),p();function _(){c=this.value,t(3,c)}return s(_,"textarea_input_handler"),n.$$set=g=>{"label"in g&&t(0,i=g.label),"tooltip"in g&&t(1,r=g.tooltip),"value"in g&&t(8,a=g.value),"defaultValue"in g&&t(9,o=g.defaultValue),"disabled"in g&&t(2,l=g.disabled),"valueChecker"in g&&t(10,u=g.valueChecker)},[i,r,l,c,d,m,p,f,a,o,u,_]}s(Y9,"instance");var Gu=class extends Be{constructor(e){super(),De(this,e,Y9,X9,Oe,{label:0,tooltip:1,value:8,defaultValue:9,disabled:2,valueChecker:10})}};s(Gu,"CodeInput");var as=Gu;(()=>{let n=Blockbench.addCSS("textarea.svelte-1hf5813{resize:vertical;text-wrap:nowrap;min-height:60px;font-family:var(--font-code)}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();function Q9(n){let e,t,i,r,a,o,l,u,c,d,m;return{c(){e=P("div"),t=P("label"),i=Re(n[0]),a=G(),o=P("input"),u=G(),c=P("div"),c.innerHTML='insert_drive_file',T(t,"class","name_space_left"),T(t,"for",r=n[18]),T(o,"type","text"),T(o,"class","dark_bordered half focusable_input svelte-9od7jv"),T(o,"id",l=n[18]),T(c,"class","tool animated-java-file-select-icon svelte-9od7jv"),T(e,"class","dialog_bar form_bar")},m(p,f){L(p,e,f),N(e,t),N(t,i),N(e,a),N(e,o),bt(o,n[2]),N(e,u),N(e,c),d||(m=[Le(o,"input",n[13]),Le(o,"input",n[5]),Le(o,"change",n[5]),Le(c,"click",n[14])],d=!0)},p(p,f){f&1&&ot(i,p[0]),f&262144&&r!==(r=p[18])&&T(t,"for",r),f&262144&&l!==(l=p[18])&&T(o,"id",l),f&4&&o.value!==p[2]&&bt(o,p[2])},d(p){p&&F(e),d=!1,Lt(m)}}}s(Q9,"create_default_slot");function ez(n){let e,t,i,r;function a(u){n[15](u)}s(a,"basedialogitem_warning_text_binding");function o(u){n[16](u)}s(o,"basedialogitem_error_text_binding");let l={label:n[0],tooltip:n[1],onReset:n[7],$$slots:{default:[Q9,({id:u})=>({18:u}),({id:u})=>u?262144:0]},$$scope:{ctx:n}};return n[3]!==void 0&&(l.warning_text=n[3]),n[4]!==void 0&&(l.error_text=n[4]),e=new jn({props:l}),le.push(()=>we(e,"warning_text",a)),le.push(()=>we(e,"error_text",o)),{c(){_e(e.$$.fragment)},m(u,c){me(e,u,c),r=!0},p(u,[c]){let d={};c&1&&(d.label=u[0]),c&2&&(d.tooltip=u[1]),c&786437&&(d.$$scope={dirty:c,ctx:u}),!t&&c&8&&(t=!0,d.warning_text=u[3],ye(()=>t=!1)),!i&&c&16&&(i=!0,d.error_text=u[4],ye(()=>i=!1)),e.$set(d)},i(u){r||(q(e.$$.fragment,u),r=!0)},o(u){Z(e.$$.fragment,u),r=!1},d(u){de(e,u)}}}s(ez,"create_fragment");function tz(n,e,t){let{label:i}=e,{tooltip:r=""}=e,{value:a}=e,{defaultValue:o}=e,{filters:l=[]}=e,{fileSelectMessage:u="Select Folder"}=e,c=a.get(),{valueChecker:d=void 0}=e,m="",p="";function f(){if(!d)return;let x=d(a.get());x.type==="error"?t(4,p=x.message):t(4,p=""),x.type==="warning"?t(3,m=x.message):t(3,m="")}s(f,"checkValue"),a.subscribe(()=>f());function _(){a.set(c),t(2,c=a.get())}s(_,"onValueChange");function g(){Promise.any([electron.dialog.showOpenDialog({properties:["openDirectory"],filters:l,message:u})]).then(x=>{x.canceled||(t(2,c=x.filePaths[0]),_())})}s(g,"selectFile");function h(){t(2,c=o),_()}s(h,"onReset"),_();function v(){c=this.value,t(2,c)}s(v,"input_input_handler");let y=s(()=>g(),"click_handler");function k(x){m=x,t(3,m)}s(k,"basedialogitem_warning_text_binding");function b(x){p=x,t(4,p)}return s(b,"basedialogitem_error_text_binding"),n.$$set=x=>{"label"in x&&t(0,i=x.label),"tooltip"in x&&t(1,r=x.tooltip),"value"in x&&t(8,a=x.value),"defaultValue"in x&&t(9,o=x.defaultValue),"filters"in x&&t(10,l=x.filters),"fileSelectMessage"in x&&t(11,u=x.fileSelectMessage),"valueChecker"in x&&t(12,d=x.valueChecker)},[i,r,c,m,p,_,g,h,a,o,l,u,d,v,y,k,b]}s(tz,"instance");var Uu=class extends Be{constructor(e){super(),De(this,e,tz,ez,Oe,{label:0,tooltip:1,value:8,defaultValue:9,filters:10,fileSelectMessage:11,valueChecker:12})}};s(Uu,"FolderSelect");var zl=Uu;(()=>{let n=Blockbench.addCSS(".animated-java-file-select-icon.svelte-9od7jv{display:flex;justify-content:flex-end}i.svelte-9od7jv{font-size:20px;margin-right:4px;color:var(--color-subtle_text);cursor:pointer}i.svelte-9od7jv:hover{color:var(--color-text)}input.svelte-9od7jv{font-family:var(--font-code)}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();function nz(n){let e,t,i,r,a,o,l,u,c,d,m;return{c(){e=P("div"),t=P("label"),i=Re(n[0]),a=G(),o=P("input"),u=G(),c=P("div"),c.innerHTML='insert_drive_file',T(t,"class","name_space_left"),T(t,"for",r=n[18]),T(o,"type","text"),T(o,"class","dark_bordered half focusable_input svelte-9od7jv"),T(o,"id",l=n[18]),T(c,"class","tool animated-java-file-select-icon svelte-9od7jv"),T(e,"class","dialog_bar form_bar")},m(p,f){L(p,e,f),N(e,t),N(t,i),N(e,a),N(e,o),bt(o,n[2]),N(e,u),N(e,c),d||(m=[Le(o,"input",n[13]),Le(o,"input",n[5]),Le(o,"change",n[5]),Le(c,"click",n[14])],d=!0)},p(p,f){f&1&&ot(i,p[0]),f&262144&&r!==(r=p[18])&&T(t,"for",r),f&262144&&l!==(l=p[18])&&T(o,"id",l),f&4&&o.value!==p[2]&&bt(o,p[2])},d(p){p&&F(e),d=!1,Lt(m)}}}s(nz,"create_default_slot");function iz(n){let e,t,i,r;function a(u){n[15](u)}s(a,"basedialogitem_warning_text_binding");function o(u){n[16](u)}s(o,"basedialogitem_error_text_binding");let l={label:n[0],tooltip:n[1],onReset:n[7],$$slots:{default:[nz,({id:u})=>({18:u}),({id:u})=>u?262144:0]},$$scope:{ctx:n}};return n[3]!==void 0&&(l.warning_text=n[3]),n[4]!==void 0&&(l.error_text=n[4]),e=new jn({props:l}),le.push(()=>we(e,"warning_text",a)),le.push(()=>we(e,"error_text",o)),{c(){_e(e.$$.fragment)},m(u,c){me(e,u,c),r=!0},p(u,[c]){let d={};c&1&&(d.label=u[0]),c&2&&(d.tooltip=u[1]),c&786437&&(d.$$scope={dirty:c,ctx:u}),!t&&c&8&&(t=!0,d.warning_text=u[3],ye(()=>t=!1)),!i&&c&16&&(i=!0,d.error_text=u[4],ye(()=>i=!1)),e.$set(d)},i(u){r||(q(e.$$.fragment,u),r=!0)},o(u){Z(e.$$.fragment,u),r=!1},d(u){de(e,u)}}}s(iz,"create_fragment");function rz(n,e,t){let{label:i}=e,{tooltip:r=""}=e,{value:a}=e,{defaultValue:o}=e,{filters:l=[]}=e,{fileSelectMessage:u="Select File"}=e,c=a.get(),{valueChecker:d=void 0}=e,m="",p="";function f(){if(!d)return;let x=d(a.get());x.type==="error"?t(4,p=x.message):t(4,p=""),x.type==="warning"?t(3,m=x.message):t(3,m="")}s(f,"checkValue"),a.subscribe(()=>f());function _(){a.set(c),t(2,c=a.get())}s(_,"onValueChange");function g(){Promise.any([electron.dialog.showOpenDialog({properties:["openFile","promptToCreate"],filters:l,message:u})]).then(x=>{x.canceled||(t(2,c=x.filePaths[0]),_())})}s(g,"selectFile");function h(){t(2,c=o),_()}s(h,"onReset"),_();function v(){c=this.value,t(2,c)}s(v,"input_input_handler");let y=s(()=>g(),"click_handler");function k(x){m=x,t(3,m)}s(k,"basedialogitem_warning_text_binding");function b(x){p=x,t(4,p)}return s(b,"basedialogitem_error_text_binding"),n.$$set=x=>{"label"in x&&t(0,i=x.label),"tooltip"in x&&t(1,r=x.tooltip),"value"in x&&t(8,a=x.value),"defaultValue"in x&&t(9,o=x.defaultValue),"filters"in x&&t(10,l=x.filters),"fileSelectMessage"in x&&t(11,u=x.fileSelectMessage),"valueChecker"in x&&t(12,d=x.valueChecker)},[i,r,c,m,p,_,g,h,a,o,l,u,d,v,y,k,b]}s(rz,"instance");var Ju=class extends Be{constructor(e){super(),De(this,e,rz,iz,Oe,{label:0,tooltip:1,value:8,defaultValue:9,filters:10,fileSelectMessage:11,valueChecker:12})}};s(Ju,"FileSelect");var Gl=Ju;(()=>{let n=Blockbench.addCSS(".animated-java-file-select-icon.svelte-9od7jv{display:flex;justify-content:flex-end}i.svelte-9od7jv{font-size:20px;margin-right:4px;color:var(--color-subtle_text);cursor:pointer}i.svelte-9od7jv:hover{color:var(--color-text)}input.svelte-9od7jv{font-family:var(--font-code)}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();function az(n){let e,t,i;return{c(){e=P("div"),t=P("h4"),i=Re(n[0]),T(t,"class","name_space_left svelte-1p3llgn"),T(e,"class","dialog_bar form_bar animated-java-section-header svelte-1p3llgn")},m(r,a){L(r,e,a),N(e,t),N(t,i)},p(r,[a]){a&1&&ot(i,r[0])},i:ue,o:ue,d(r){r&&F(e)}}}s(az,"create_fragment");function oz(n,e,t){let{label:i}=e;return n.$$set=r=>{"label"in r&&t(0,i=r.label)},[i]}s(oz,"instance");var Hu=class extends Be{constructor(e){super(),De(this,e,oz,az,Oe,{label:0})}};s(Hu,"SectionHeader");var $u=Hu;(()=>{let n=Blockbench.addCSS(".animated-java-section-header.svelte-1p3llgn{display:flex;flex-direction:row;justify-content:flex-start;align-items:center}h4.svelte-1p3llgn{padding:0px 8px;flex-grow:1;font-size:1.12em;border-bottom:2px solid var(--color-back);background-color:var(--color-button)}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();function sz(n){let e,t,i,r,a,o,l,u,c,d,m,p,f,_,g,h,v,y,k;return{c(){e=P("div"),t=P("label"),i=Re(n[0]),a=G(),o=P("div"),l=P("div"),u=P("input"),d=G(),m=P("div"),m.innerHTML='code',p=G(),f=P("div"),_=P("input"),h=G(),v=P("div"),v.innerHTML='code',T(t,"class","name_space_left"),T(t,"for",r=n[32]),T(u,"id",c=n[32]),T(u,"class","dark_bordered focusable_input"),T(u,"inputmode","decimal"),T(m,"class","tool numaric_input_slider"),T(l,"class","numeric_input"),T(_,"id",g=n[32]),T(_,"class","dark_bordered focusable_input"),T(_,"inputmode","decimal"),T(v,"class","tool numaric_input_slider"),T(f,"class","numeric_input"),T(o,"class","dialog_vector_group half"),Ge(o,"max-width","256px"),T(e,"class","dialog_bar form_bar")},m(b,x){L(b,e,x),N(e,t),N(t,i),N(e,a),N(e,o),N(o,l),N(l,u),n[21](u),bt(u,n[10]),N(l,d),N(l,m),n[23](m),N(o,p),N(o,f),N(f,_),n[24](_),bt(_,n[11]),N(f,h),N(f,v),n[26](v),y||(k=[Le(u,"input",n[22]),Le(_,"input",n[25])],y=!0)},p(b,x){x[0]&1&&ot(i,b[0]),x[1]&2&&r!==(r=b[32])&&T(t,"for",r),x[1]&2&&c!==(c=b[32])&&T(u,"id",c),x[0]&1024&&u.value!==b[10]&&bt(u,b[10]),x[1]&2&&g!==(g=b[32])&&T(_,"id",g),x[0]&2048&&_.value!==b[11]&&bt(_,b[11])},d(b){b&&F(e),n[21](null),n[23](null),n[24](null),n[26](null),y=!1,Lt(k)}}}s(sz,"create_default_slot");function lz(n){let e,t,i,r;function a(u){n[27](u)}s(a,"basedialogitem_warning_text_binding");function o(u){n[28](u)}s(o,"basedialogitem_error_text_binding");let l={label:n[0],tooltip:n[1],onReset:n[12],$$slots:{default:[sz,({id:u})=>({32:u}),({id:u})=>[0,u?2:0]]},$$scope:{ctx:n}};return n[4]!==void 0&&(l.warning_text=n[4]),n[5]!==void 0&&(l.error_text=n[5]),e=new jn({props:l}),le.push(()=>we(e,"warning_text",a)),le.push(()=>we(e,"error_text",o)),{c(){_e(e.$$.fragment)},m(u,c){me(e,u,c),r=!0},p(u,c){let d={};c[0]&1&&(d.label=u[0]),c[0]&2&&(d.tooltip=u[1]),c[0]&4033|c[1]&6&&(d.$$scope={dirty:c,ctx:u}),!t&&c[0]&16&&(t=!0,d.warning_text=u[4],ye(()=>t=!1)),!i&&c[0]&32&&(i=!0,d.error_text=u[5],ye(()=>i=!1)),e.$set(d)},i(u){r||(q(e.$$.fragment,u),r=!0)},o(u){Z(e.$$.fragment,u),r=!1},d(u){de(e,u)}}}s(lz,"create_fragment");function cz(n,e,t){let i,r=ue,a=s(()=>(r(),r=ze(p,pe=>t(10,i=pe)),p),"$$subscribe_valueX"),o,l=ue,u=s(()=>(l(),l=ze(h,pe=>t(11,o=pe)),h),"$$subscribe_valueY");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l());let{label:c}=e,{tooltip:d=""}=e,{step:m=void 0}=e,{valueX:p}=e;a();let{defaultValueX:f}=e,{minX:_=void 0}=e,{maxX:g=void 0}=e,{valueY:h}=e;u();let{defaultValueY:v}=e,{minY:y=void 0}=e,{maxY:k=void 0}=e,{valueChecker:b=void 0}=e,x="",E="";function C(){if(!b)return;let pe=b({x:p.get(),y:h.get()});pe.type==="error"?t(5,E=pe.message):t(5,E=""),pe.type==="warning"?t(4,x=pe.message):t(4,x="")}s(C,"checkValue"),p.subscribe(()=>C()),h.subscribe(()=>C());let j=new Molang,S,B,O,A;function V(pe,W,U,ce){addEventListeners(pe,"mousedown touchstart",J=>{convertTouchEvent(J);let Ce=0;function Y(be){convertTouchEvent(be);let H=Math.trunc((be.clientX-J.clientX)/10)*(m||1);H!=Ce&&(W.set(Math.clamp(W.get()+(H-Ce),U!==void 0?U:-1/0,ce!==void 0?ce:1/0)),Ce=H)}s(Y,"move");function z(be){removeEventListeners(document,"mousemove touchmove",Y,null),removeEventListeners(document,"mouseup touchend",z,null)}s(z,"stop"),addEventListeners(document,"mousemove touchmove",Y),addEventListeners(document,"mouseup touchend",z)}),addEventListeners(S,"focusout dblclick",()=>{W.set(Math.clamp(j.parse(W.get()),U!==void 0?U:-1/0,ce!==void 0?ce:1/0))})}s(V,"eventListenerFactory");function K(){p.set(f),h.set(v)}s(K,"onReset"),requestAnimationFrame(()=>{V(B,p,_,g),V(A,h,y,k)});function te(pe){le[pe?"unshift":"push"](()=>{S=pe,t(6,S)})}s(te,"input0_binding");function fe(){i=this.value,p.set(i)}s(fe,"input0_input_handler");function ae(pe){le[pe?"unshift":"push"](()=>{B=pe,t(7,B)})}s(ae,"div0_binding");function ee(pe){le[pe?"unshift":"push"](()=>{O=pe,t(8,O)})}s(ee,"input1_binding");function se(){o=this.value,h.set(o)}s(se,"input1_input_handler");function oe(pe){le[pe?"unshift":"push"](()=>{A=pe,t(9,A)})}s(oe,"div2_binding");function xe(pe){x=pe,t(4,x)}s(xe,"basedialogitem_warning_text_binding");function ne(pe){E=pe,t(5,E)}return s(ne,"basedialogitem_error_text_binding"),n.$$set=pe=>{"label"in pe&&t(0,c=pe.label),"tooltip"in pe&&t(1,d=pe.tooltip),"step"in pe&&t(13,m=pe.step),"valueX"in pe&&a(t(2,p=pe.valueX)),"defaultValueX"in pe&&t(14,f=pe.defaultValueX),"minX"in pe&&t(15,_=pe.minX),"maxX"in pe&&t(16,g=pe.maxX),"valueY"in pe&&u(t(3,h=pe.valueY)),"defaultValueY"in pe&&t(17,v=pe.defaultValueY),"minY"in pe&&t(18,y=pe.minY),"maxY"in pe&&t(19,k=pe.maxY),"valueChecker"in pe&&t(20,b=pe.valueChecker)},[c,d,p,h,x,E,S,B,O,A,i,o,K,m,f,_,g,v,y,k,b,te,fe,ae,ee,se,oe,xe,ne]}s(cz,"instance");var qu=class extends Be{constructor(e){super(),De(this,e,cz,lz,Oe,{label:0,tooltip:1,step:13,valueX:2,defaultValueX:14,minX:15,maxX:16,valueY:3,defaultValueY:17,minY:18,maxY:19,valueChecker:20},null,[-1,-1])}};s(qu,"Vector2d");var Xm=qu;function wv(n){let e,t,i,r;function a(u){n[40](u)}s(a,"vector2d_valueX_binding_1");function o(u){n[41](u)}s(o,"vector2d_valueY_binding_1");let l={label:w("dialog.blueprint_settings.bounding_box.title"),tooltip:w("dialog.blueprint_settings.bounding_box.description"),defaultValueX:zt.bounding_box[0],minX:2,maxX:4096,defaultValueY:zt.bounding_box[1],minY:2,maxY:4096};return n[9]!==void 0&&(l.valueX=n[9]),n[10]!==void 0&&(l.valueY=n[10]),e=new Xm({props:l}),le.push(()=>we(e,"valueX",a)),le.push(()=>we(e,"valueY",o)),{c(){_e(e.$$.fragment)},m(u,c){me(e,u,c),r=!0},p(u,c){let d={};!t&&c[0]&512&&(t=!0,d.valueX=u[9],ye(()=>t=!1)),!i&&c[0]&1024&&(i=!0,d.valueY=u[10],ye(()=>i=!1)),e.$set(d)},i(u){r||(q(e.$$.fragment,u),r=!0)},o(u){Z(e.$$.fragment,u),r=!1},d(u){de(e,u)}}}s(wv,"create_if_block_10");function uz(n){let e,t,i,r,a,o,l,u,c;function d(h){n[47](h)}s(d,"select0_value_binding");let m={label:w("dialog.blueprint_settings.resource_pack_export_mode.title"),tooltip:w("dialog.blueprint_settings.resource_pack_export_mode.description"),options:{raw:w("dialog.blueprint_settings.resource_pack_export_mode.options.raw"),zip:w("dialog.blueprint_settings.resource_pack_export_mode.options.zip"),none:w("dialog.blueprint_settings.resource_pack_export_mode.options.none")},defaultOption:"raw"};n[5]!==void 0&&(m.value=n[5]),e=new Yn({props:m}),le.push(()=>we(e,"value",d));function p(h){n[48](h)}s(p,"select1_value_binding");let f={label:w("dialog.blueprint_settings.data_pack_export_mode.title"),tooltip:w("dialog.blueprint_settings.data_pack_export_mode.description"),options:{raw:w("dialog.blueprint_settings.data_pack_export_mode.options.raw"),zip:w("dialog.blueprint_settings.data_pack_export_mode.options.zip"),none:w("dialog.blueprint_settings.data_pack_export_mode.options.none")},defaultOption:"raw"};n[6]!==void 0&&(f.value=n[6]),r=new Yn({props:f}),le.push(()=>we(r,"value",p));let _=n[30]!=="none"&&xv(n),g=n[33]!=="none"&&Ev(n);return{c(){_e(e.$$.fragment),i=G(),_e(r.$$.fragment),o=G(),_&&_.c(),l=G(),g&&g.c(),u=Dt()},m(h,v){me(e,h,v),L(h,i,v),me(r,h,v),L(h,o,v),_&&_.m(h,v),L(h,l,v),g&&g.m(h,v),L(h,u,v),c=!0},p(h,v){let y={};!t&&v[0]&32&&(t=!0,y.value=h[5],ye(()=>t=!1)),e.$set(y);let k={};!a&&v[0]&64&&(a=!0,k.value=h[6],ye(()=>a=!1)),r.$set(k),h[30]!=="none"?_?(_.p(h,v),v[0]&1073741824&&q(_,1)):(_=xv(h),_.c(),q(_,1),_.m(l.parentNode,l)):_&&(Et(),Z(_,1,1,()=>{_=null}),Tt()),h[33]!=="none"?g?(g.p(h,v),v[1]&4&&q(g,1)):(g=Ev(h),g.c(),q(g,1),g.m(u.parentNode,u)):g&&(Et(),Z(g,1,1,()=>{g=null}),Tt())},i(h){c||(q(e.$$.fragment,h),q(r.$$.fragment,h),q(_),q(g),c=!0)},o(h){Z(e.$$.fragment,h),Z(r.$$.fragment,h),Z(_),Z(g),c=!1},d(h){de(e,h),h&&F(i),de(r,h),h&&F(o),_&&_.d(h),h&&F(l),g&&g.d(h),h&&F(u)}}}s(uz,"create_else_block");function dz(n){let e,t,i,r,a,o,l,u,c;function d(h){n[44](h)}s(d,"lineinput_value_binding");let m={label:w("dialog.blueprint_settings.display_item.title"),tooltip:w("dialog.blueprint_settings.display_item.description"),defaultValue:zt.display_item,valueChecker:Av};n[11]!==void 0&&(m.value=n[11]),e=new en({props:m}),le.push(()=>we(e,"value",d));function p(h){n[45](h)}s(p,"checkbox_checked_binding");let f={label:w("dialog.blueprint_settings.baked_animations.title"),tooltip:w("dialog.blueprint_settings.baked_animations.description"),defaultValue:zt.baked_animations};n[25]!==void 0&&(f.checked=n[25]),r=new tt({props:f}),le.push(()=>we(r,"checked",p));function _(h){n[46](h)}s(_,"fileselect_value_binding");let g={label:w("dialog.blueprint_settings.json_file.title"),tooltip:w("dialog.blueprint_settings.json_file.description"),defaultValue:zt.json_file,valueChecker:Ez};return n[26]!==void 0&&(g.value=n[26]),l=new Gl({props:g}),le.push(()=>we(l,"value",_)),{c(){_e(e.$$.fragment),i=G(),_e(r.$$.fragment),o=G(),_e(l.$$.fragment)},m(h,v){me(e,h,v),L(h,i,v),me(r,h,v),L(h,o,v),me(l,h,v),c=!0},p(h,v){let y={};!t&&v[0]&2048&&(t=!0,y.value=h[11],ye(()=>t=!1)),e.$set(y);let k={};!a&&v[0]&33554432&&(a=!0,k.checked=h[25],ye(()=>a=!1)),r.$set(k);let b={};!u&&v[0]&67108864&&(u=!0,b.value=h[26],ye(()=>u=!1)),l.$set(b)},i(h){c||(q(e.$$.fragment,h),q(r.$$.fragment,h),q(l.$$.fragment,h),c=!0)},o(h){Z(e.$$.fragment,h),Z(r.$$.fragment,h),Z(l.$$.fragment,h),c=!1},d(h){de(e,h),h&&F(i),de(r,h),h&&F(o),de(l,h)}}}s(dz,"create_if_block_1");function xv(n){let e,t,i,r,a,o,l,u,c,d,m,p,f;e=new $u({props:{label:w("dialog.blueprint_settings.resource_pack_settings.title")}});function _(E){n[49](E)}s(_,"lineinput_value_binding_1");let g={label:w("dialog.blueprint_settings.display_item.title"),tooltip:w("dialog.blueprint_settings.display_item.description"),defaultValue:zt.display_item,valueChecker:Av};n[11]!==void 0&&(g.value=n[11]),i=new en({props:g}),le.push(()=>we(i,"value",_));function h(E){n[50](E)}s(h,"checkbox_checked_binding_1");let v={label:w("dialog.blueprint_settings.enable_advanced_resource_pack_settings.title"),defaultValue:zt.enable_advanced_resource_pack_settings};n[13]!==void 0&&(v.checked=n[13]),o=new tt({props:v}),le.push(()=>we(o,"checked",h));let y=n[31]&&kv(n),k=[mz,fz],b=[];function x(E,C){return E[30]==="raw"?0:E[30]==="zip"?1:-1}return s(x,"select_block_type_1"),~(d=x(n,[-1,-1,-1]))&&(m=b[d]=k[d](n)),{c(){_e(e.$$.fragment),t=G(),_e(i.$$.fragment),a=G(),_e(o.$$.fragment),u=G(),y&&y.c(),c=G(),m&&m.c(),p=Dt()},m(E,C){me(e,E,C),L(E,t,C),me(i,E,C),L(E,a,C),me(o,E,C),L(E,u,C),y&&y.m(E,C),L(E,c,C),~d&&b[d].m(E,C),L(E,p,C),f=!0},p(E,C){let j={};!r&&C[0]&2048&&(r=!0,j.value=E[11],ye(()=>r=!1)),i.$set(j);let S={};!l&&C[0]&8192&&(l=!0,S.checked=E[13],ye(()=>l=!1)),o.$set(S),E[31]?y?(y.p(E,C),C[1]&1&&q(y,1)):(y=kv(E),y.c(),q(y,1),y.m(c.parentNode,c)):y&&(Et(),Z(y,1,1,()=>{y=null}),Tt());let B=d;d=x(E,C),d===B?~d&&b[d].p(E,C):(m&&(Et(),Z(b[B],1,1,()=>{b[B]=null}),Tt()),~d?(m=b[d],m?m.p(E,C):(m=b[d]=k[d](E),m.c()),q(m,1),m.m(p.parentNode,p)):m=null)},i(E){f||(q(e.$$.fragment,E),q(i.$$.fragment,E),q(o.$$.fragment,E),q(y),q(m),f=!0)},o(E){Z(e.$$.fragment,E),Z(i.$$.fragment,E),Z(o.$$.fragment,E),Z(y),Z(m),f=!1},d(E){de(e,E),E&&F(t),de(i,E),E&&F(a),de(o,E),E&&F(u),y&&y.d(E),E&&F(c),~d&&b[d].d(E),E&&F(p)}}}s(xv,"create_if_block_5");function kv(n){let e,t,i,r,a;function o(u){n[51](u)}s(o,"numberslider_value_binding");let l={label:w("dialog.blueprint_settings.custom_model_data_offset.title"),tooltip:w("dialog.blueprint_settings.custom_model_data_offset.description"),defaultValue:zt.custom_model_data_offset,min:0,max:2147483647};return n[12]!==void 0&&(l.value=n[12]),i=new Ot({props:l}),le.push(()=>we(i,"value",o)),{c(){e=P("p"),e.textContent=`${w("dialog.blueprint_settings.advanced_settings_warning")}`,t=G(),_e(i.$$.fragment),T(e,"class","warning svelte-1wavurd")},m(u,c){L(u,e,c),L(u,t,c),me(i,u,c),a=!0},p(u,c){let d={};!r&&c[0]&4096&&(r=!0,d.value=u[12],ye(()=>r=!1)),i.$set(d)},i(u){a||(q(i.$$.fragment,u),a=!0)},o(u){Z(i.$$.fragment,u),a=!1},d(u){u&&F(e),u&&F(t),de(i,u)}}}s(kv,"create_if_block_9");function fz(n){let e,t,i;function r(o){n[57](o)}s(r,"fileselect_value_binding_2");let a={label:w("dialog.blueprint_settings.resource_pack_zip.title"),tooltip:w("dialog.blueprint_settings.resource_pack_zip.description"),defaultValue:zt.resource_pack,valueChecker:Sv};return n[15]!==void 0&&(a.value=n[15]),e=new Gl({props:a}),le.push(()=>we(e,"value",r)),{c(){_e(e.$$.fragment)},m(o,l){me(e,o,l),i=!0},p(o,l){let u={};!t&&l[0]&32768&&(t=!0,u.value=o[15],ye(()=>t=!1)),e.$set(u)},i(o){i||(q(e.$$.fragment,o),i=!0)},o(o){Z(e.$$.fragment,o),i=!1},d(o){de(e,o)}}}s(fz,"create_if_block_8");function mz(n){let e,t,i,r,a,o,l;function u(f){n[52](f)}s(u,"checkbox_checked_binding_2");let c={label:w("dialog.blueprint_settings.enable_advanced_resource_pack_folders.title"),defaultValue:zt.enable_advanced_resource_pack_folders};n[14]!==void 0&&(c.checked=n[14]),e=new tt({props:c}),le.push(()=>we(e,"checked",u));let d=[_z,pz],m=[];function p(f,_){return f[32]?0:1}return s(p,"select_block_type_2"),r=p(n,[-1,-1,-1]),a=m[r]=d[r](n),{c(){_e(e.$$.fragment),i=G(),a.c(),o=Dt()},m(f,_){me(e,f,_),L(f,i,_),m[r].m(f,_),L(f,o,_),l=!0},p(f,_){let g={};!t&&_[0]&16384&&(t=!0,g.checked=f[14],ye(()=>t=!1)),e.$set(g);let h=r;r=p(f,_),r===h?m[r].p(f,_):(Et(),Z(m[h],1,1,()=>{m[h]=null}),Tt(),a=m[r],a?a.p(f,_):(a=m[r]=d[r](f),a.c()),q(a,1),a.m(o.parentNode,o))},i(f){l||(q(e.$$.fragment,f),q(a),l=!0)},o(f){Z(e.$$.fragment,f),Z(a),l=!1},d(f){de(e,f),f&&F(i),m[r].d(f),f&&F(o)}}}s(mz,"create_if_block_6");function pz(n){let e,t,i;function r(o){n[56](o)}s(r,"folderselect_value_binding");let a={label:w("dialog.blueprint_settings.resource_pack.title"),tooltip:w("dialog.blueprint_settings.resource_pack.description"),defaultValue:zt.resource_pack,valueChecker:xz};return n[15]!==void 0&&(a.value=n[15]),e=new zl({props:a}),le.push(()=>we(e,"value",r)),{c(){_e(e.$$.fragment)},m(o,l){me(e,o,l),i=!0},p(o,l){let u={};!t&&l[0]&32768&&(t=!0,u.value=o[15],ye(()=>t=!1)),e.$set(u)},i(o){i||(q(e.$$.fragment,o),i=!0)},o(o){Z(e.$$.fragment,o),i=!1},d(o){de(e,o)}}}s(pz,"create_else_block_1");function _z(n){let e,t,i,r,a,o,l,u,c,d,m;function p(y){n[53](y)}s(p,"fileselect_value_binding_1");let f={label:w("dialog.blueprint_settings.display_item_path.title"),tooltip:w("dialog.blueprint_settings.display_item_path.description"),defaultValue:zt.display_item_path,valueChecker:kz};n[16]!==void 0&&(f.value=n[16]),i=new Gl({props:f}),le.push(()=>we(i,"value",p));function _(y){n[54](y)}s(_,"folderselect0_value_binding");let g={label:w("dialog.blueprint_settings.model_folder.title"),tooltip:w("dialog.blueprint_settings.model_folder.description"),defaultValue:zt.model_folder,valueChecker:Cv};n[17]!==void 0&&(g.value=n[17]),o=new zl({props:g}),le.push(()=>we(o,"value",_));function h(y){n[55](y)}s(h,"folderselect1_value_binding");let v={label:w("dialog.blueprint_settings.texture_folder.title"),tooltip:w("dialog.blueprint_settings.texture_folder.description"),defaultValue:zt.texture_folder,valueChecker:Cv};return n[18]!==void 0&&(v.value=n[18]),c=new zl({props:v}),le.push(()=>we(c,"value",h)),{c(){e=P("p"),e.textContent=`${w("dialog.blueprint_settings.advanced_settings_warning")}`,t=G(),_e(i.$$.fragment),a=G(),_e(o.$$.fragment),u=G(),_e(c.$$.fragment),T(e,"class","warning svelte-1wavurd")},m(y,k){L(y,e,k),L(y,t,k),me(i,y,k),L(y,a,k),me(o,y,k),L(y,u,k),me(c,y,k),m=!0},p(y,k){let b={};!r&&k[0]&65536&&(r=!0,b.value=y[16],ye(()=>r=!1)),i.$set(b);let x={};!l&&k[0]&131072&&(l=!0,x.value=y[17],ye(()=>l=!1)),o.$set(x);let E={};!d&&k[0]&262144&&(d=!0,E.value=y[18],ye(()=>d=!1)),c.$set(E)},i(y){m||(q(i.$$.fragment,y),q(o.$$.fragment,y),q(c.$$.fragment,y),m=!0)},o(y){Z(i.$$.fragment,y),Z(o.$$.fragment,y),Z(c.$$.fragment,y),m=!1},d(y){y&&F(e),y&&F(t),de(i,y),y&&F(a),de(o,y),y&&F(u),de(c,y)}}}s(_z,"create_if_block_7");function Ev(n){let e,t,i,r,a,o,l,u,c,d,m,p,f,_,g,h,v,y,k,b;e=new $u({props:{label:w("dialog.blueprint_settings.data_pack_settings.title")}});let x=[hz,gz],E=[];function C(ee,se){return ee[33]==="raw"?0:ee[33]==="zip"?1:-1}s(C,"select_block_type_3"),~(i=C(n,[-1,-1,-1]))&&(r=E[i]=x[i](n));function j(ee){n[60](ee)}s(j,"codeinput0_value_binding");let S={label:w("dialog.blueprint_settings.summon_commands.title"),tooltip:w("dialog.blueprint_settings.summon_commands.description"),defaultValue:zt.summon_commands};n[20]!==void 0&&(S.value=n[20]),o=new as({props:S}),le.push(()=>we(o,"value",j));function B(ee){n[61](ee)}s(B,"codeinput1_value_binding");let O={label:w("dialog.blueprint_settings.ticking_commands.title"),tooltip:w("dialog.blueprint_settings.ticking_commands.description"),defaultValue:zt.ticking_commands};n[21]!==void 0&&(O.value=n[21]),c=new as({props:O}),le.push(()=>we(c,"value",B));function A(ee){n[62](ee)}s(A,"numberslider0_value_binding");let V={label:w("dialog.blueprint_settings.interpolation_duration.title"),tooltip:w("dialog.blueprint_settings.interpolation_duration.description"),defaultValue:zt.interpolation_duration,min:0,max:2147483647};n[22]!==void 0&&(V.value=n[22]),p=new Ot({props:V}),le.push(()=>we(p,"value",A));function K(ee){n[63](ee)}s(K,"numberslider1_value_binding");let te={label:w("dialog.blueprint_settings.teleportation_duration.title"),tooltip:w("dialog.blueprint_settings.teleportation_duration.description"),defaultValue:zt.teleportation_duration,min:0,max:2147483647};n[23]!==void 0&&(te.value=n[23]),g=new Ot({props:te}),le.push(()=>we(g,"value",K));function fe(ee){n[64](ee)}s(fe,"checkbox_checked_binding_3");let ae={label:w("dialog.blueprint_settings.use_storage_for_animation.title"),tooltip:w("dialog.blueprint_settings.use_storage_for_animation.description"),defaultValue:zt.use_storage_for_animation};return n[24]!==void 0&&(ae.checked=n[24]),y=new tt({props:ae}),le.push(()=>we(y,"checked",fe)),{c(){_e(e.$$.fragment),t=G(),r&&r.c(),a=G(),_e(o.$$.fragment),u=G(),_e(c.$$.fragment),m=G(),_e(p.$$.fragment),_=G(),_e(g.$$.fragment),v=G(),_e(y.$$.fragment)},m(ee,se){me(e,ee,se),L(ee,t,se),~i&&E[i].m(ee,se),L(ee,a,se),me(o,ee,se),L(ee,u,se),me(c,ee,se),L(ee,m,se),me(p,ee,se),L(ee,_,se),me(g,ee,se),L(ee,v,se),me(y,ee,se),b=!0},p(ee,se){let oe=i;i=C(ee,se),i===oe?~i&&E[i].p(ee,se):(r&&(Et(),Z(E[oe],1,1,()=>{E[oe]=null}),Tt()),~i?(r=E[i],r?r.p(ee,se):(r=E[i]=x[i](ee),r.c()),q(r,1),r.m(a.parentNode,a)):r=null);let xe={};!l&&se[0]&1048576&&(l=!0,xe.value=ee[20],ye(()=>l=!1)),o.$set(xe);let ne={};!d&&se[0]&2097152&&(d=!0,ne.value=ee[21],ye(()=>d=!1)),c.$set(ne);let pe={};!f&&se[0]&4194304&&(f=!0,pe.value=ee[22],ye(()=>f=!1)),p.$set(pe);let W={};!h&&se[0]&8388608&&(h=!0,W.value=ee[23],ye(()=>h=!1)),g.$set(W);let U={};!k&&se[0]&16777216&&(k=!0,U.checked=ee[24],ye(()=>k=!1)),y.$set(U)},i(ee){b||(q(e.$$.fragment,ee),q(r),q(o.$$.fragment,ee),q(c.$$.fragment,ee),q(p.$$.fragment,ee),q(g.$$.fragment,ee),q(y.$$.fragment,ee),b=!0)},o(ee){Z(e.$$.fragment,ee),Z(r),Z(o.$$.fragment,ee),Z(c.$$.fragment,ee),Z(p.$$.fragment,ee),Z(g.$$.fragment,ee),Z(y.$$.fragment,ee),b=!1},d(ee){de(e,ee),ee&&F(t),~i&&E[i].d(ee),ee&&F(a),de(o,ee),ee&&F(u),de(c,ee),ee&&F(m),de(p,ee),ee&&F(_),de(g,ee),ee&&F(v),de(y,ee)}}}s(Ev,"create_if_block_2");function gz(n){let e,t,i;function r(o){n[59](o)}s(r,"fileselect_value_binding_3");let a={label:w("dialog.blueprint_settings.data_pack_zip.title"),tooltip:w("dialog.blueprint_settings.data_pack_zip.description"),defaultValue:zt.data_pack,valueChecker:Sv};return n[19]!==void 0&&(a.value=n[19]),e=new Gl({props:a}),le.push(()=>we(e,"value",r)),{c(){_e(e.$$.fragment)},m(o,l){me(e,o,l),i=!0},p(o,l){let u={};!t&&l[0]&524288&&(t=!0,u.value=o[19],ye(()=>t=!1)),e.$set(u)},i(o){i||(q(e.$$.fragment,o),i=!0)},o(o){Z(e.$$.fragment,o),i=!1},d(o){de(e,o)}}}s(gz,"create_if_block_4");function hz(n){let e,t,i;function r(o){n[58](o)}s(r,"folderselect_value_binding_1");let a={label:w("dialog.blueprint_settings.data_pack.title"),tooltip:w("dialog.blueprint_settings.data_pack.description"),defaultValue:zt.data_pack,valueChecker:wz};return n[19]!==void 0&&(a.value=n[19]),e=new zl({props:a}),le.push(()=>we(e,"value",r)),{c(){_e(e.$$.fragment)},m(o,l){me(e,o,l),i=!0},p(o,l){let u={};!t&&l[0]&524288&&(t=!0,u.value=o[19],ye(()=>t=!1)),e.$set(u)},i(o){i||(q(e.$$.fragment,o),i=!0)},o(o){Z(e.$$.fragment,o),i=!1},d(o){de(e,o)}}}s(hz,"create_if_block_3");function Tv(n){let e,t,i,r,a,o,l,u,c,d,m,p,f,_,g,h,v;return{c(){e=P("div"),t=P("div"),i=P("div"),r=P("img"),o=G(),l=P("span"),l.textContent="Animated Java?",u=G(),c=P("i"),c.textContent="close",d=G(),m=P("a"),p=P("img"),_=G(),g=P("div"),T(r,"class","heart svelte-1wavurd"),Yt(r.src,a=Qb)||T(r,"src",a),T(r,"alt","\u2764\uFE0F"),T(l,"class","svelte-1wavurd"),T(c,"class","material-icons icon svelte-1wavurd"),T(i,"class","title svelte-1wavurd"),Yt(p.src,f=Yb)||T(p,"src",f),T(p,"alt",""),T(p,"class","svelte-1wavurd"),T(m,"href","https://ko-fi.com/snavesutit"),T(m,"class","ko-fi-button svelte-1wavurd"),T(t,"class","ko-fi-popup svelte-1wavurd"),T(g,"class","shadow svelte-1wavurd"),T(e,"class","ko-fi-popup-container svelte-1wavurd")},m(y,k){L(y,e,k),N(e,t),N(t,i),N(i,r),N(i,o),N(i,l),N(i,u),N(i,c),N(t,d),N(t,m),N(m,p),N(e,_),N(e,g),h||(v=[Le(c,"click",n[34]),Le(c,"mouseenter",Tz),Le(c,"mouseleave",Cz)],h=!0)},p:ue,d(y){y&&F(e),h=!1,Lt(v)}}}s(Tv,"create_if_block");function bz(n){let e,t,i,r,a,o,l,u,c,d,m,p,f,_,g,h,v,y,k,b,x,E,C,j,S,B,O,A,V,K;function te(ie){n[35](ie)}s(te,"lineinput0_value_binding");let fe={label:w("dialog.blueprint_settings.blueprint_name.title"),tooltip:w("dialog.blueprint_settings.blueprint_name.description"),defaultValue:"My Blueprint"};n[0]!==void 0&&(fe.value=n[0]),r=new en({props:fe}),le.push(()=>we(r,"value",te));function ae(ie){n[36](ie)}s(ae,"vector2d_valueX_binding");function ee(ie){n[37](ie)}s(ee,"vector2d_valueY_binding");let se={label:w("dialog.blueprint_settings.texture_size.title"),tooltip:w("dialog.blueprint_settings.texture_size.description"),defaultValueX:16,minX:2,maxX:4096,defaultValueY:16,minY:2,maxY:4096,valueChecker:yz};n[1]!==void 0&&(se.valueX=n[1]),n[2]!==void 0&&(se.valueY=n[2]),l=new Xm({props:se}),le.push(()=>we(l,"valueX",ae)),le.push(()=>we(l,"valueY",ee));function oe(ie){n[38](ie)}s(oe,"checkbox0_checked_binding");let xe={label:w("dialog.blueprint_settings.show_bounding_box.title"),tooltip:w("dialog.blueprint_settings.show_bounding_box.description"),defaultValue:zt.show_bounding_box};n[7]!==void 0&&(xe.checked=n[7]),m=new tt({props:xe}),le.push(()=>we(m,"checked",oe));function ne(ie){n[39](ie)}s(ne,"checkbox1_checked_binding");let pe={label:w("dialog.blueprint_settings.auto_bounding_box.title"),tooltip:w("dialog.blueprint_settings.auto_bounding_box.description"),defaultValue:zt.auto_bounding_box};n[8]!==void 0&&(pe.checked=n[8]),_=new tt({props:pe}),le.push(()=>we(_,"checked",ne));let W=!n[28]&&wv(n);y=new $u({props:{label:w("dialog.blueprint_settings.export_settings.title")}});function U(ie){n[42](ie)}s(U,"lineinput1_value_binding");let ce={label:w("dialog.blueprint_settings.export_namespace.title"),tooltip:w("dialog.blueprint_settings.export_namespace.description"),defaultValue:zt.export_namespace,valueChecker:vz};n[3]!==void 0&&(ce.value=n[3]),b=new en({props:ce}),le.push(()=>we(b,"value",U));function J(ie){n[43](ie)}s(J,"checkbox2_checked_binding");let Ce={label:w("dialog.blueprint_settings.enable_plugin_mode.title"),tooltip:w("dialog.blueprint_settings.enable_plugin_mode.description"),defaultValue:zt.enable_plugin_mode};n[4]!==void 0&&(Ce.checked=n[4]),C=new tt({props:Ce}),le.push(()=>we(C,"checked",J));let Y=[dz,uz],z=[];function be(ie,Ie){return ie[29]?0:1}s(be,"select_block_type"),B=be(n,[-1,-1,-1]),O=z[B]=Y[B](n);let H=n[27]&&Tv(n);return{c(){e=P("div"),t=G(),i=P("div"),_e(r.$$.fragment),o=G(),_e(l.$$.fragment),d=G(),_e(m.$$.fragment),f=G(),_e(_.$$.fragment),h=G(),W&&W.c(),v=G(),_e(y.$$.fragment),k=G(),_e(b.$$.fragment),E=G(),_e(C.$$.fragment),S=G(),O.c(),A=G(),H&&H.c(),V=Dt(),Ge(e,"--aj-dialog-id","'"+Zm+"'"),T(e,"class","svelte-1wavurd"),T(i,"class","svelte-1wavurd")},m(ie,Ie){L(ie,e,Ie),L(ie,t,Ie),L(ie,i,Ie),me(r,i,null),N(i,o),me(l,i,null),N(i,d),me(m,i,null),N(i,f),me(_,i,null),N(i,h),W&&W.m(i,null),N(i,v),me(y,i,null),N(i,k),me(b,i,null),N(i,E),me(C,i,null),N(i,S),z[B].m(i,null),L(ie,A,Ie),H&&H.m(ie,Ie),L(ie,V,Ie),K=!0},p(ie,Ie){let Q={};!a&&Ie[0]&1&&(a=!0,Q.value=ie[0],ye(()=>a=!1)),r.$set(Q);let st={};!u&&Ie[0]&2&&(u=!0,st.valueX=ie[1],ye(()=>u=!1)),!c&&Ie[0]&4&&(c=!0,st.valueY=ie[2],ye(()=>c=!1)),l.$set(st);let at={};!p&&Ie[0]&128&&(p=!0,at.checked=ie[7],ye(()=>p=!1)),m.$set(at);let Vt={};!g&&Ie[0]&256&&(g=!0,Vt.checked=ie[8],ye(()=>g=!1)),_.$set(Vt),ie[28]?W&&(Et(),Z(W,1,1,()=>{W=null}),Tt()):W?(W.p(ie,Ie),Ie[0]&268435456&&q(W,1)):(W=wv(ie),W.c(),q(W,1),W.m(i,v));let We={};!x&&Ie[0]&8&&(x=!0,We.value=ie[3],ye(()=>x=!1)),b.$set(We);let wt={};!j&&Ie[0]&16&&(j=!0,wt.checked=ie[4],ye(()=>j=!1)),C.$set(wt);let Jt=B;B=be(ie,Ie),B===Jt?z[B].p(ie,Ie):(Et(),Z(z[Jt],1,1,()=>{z[Jt]=null}),Tt(),O=z[B],O?O.p(ie,Ie):(O=z[B]=Y[B](ie),O.c()),q(O,1),O.m(i,null)),ie[27]?H?H.p(ie,Ie):(H=Tv(ie),H.c(),H.m(V.parentNode,V)):H&&(H.d(1),H=null)},i(ie){K||(q(r.$$.fragment,ie),q(l.$$.fragment,ie),q(m.$$.fragment,ie),q(_.$$.fragment,ie),q(W),q(y.$$.fragment,ie),q(b.$$.fragment,ie),q(C.$$.fragment,ie),q(O),K=!0)},o(ie){Z(r.$$.fragment,ie),Z(l.$$.fragment,ie),Z(m.$$.fragment,ie),Z(_.$$.fragment,ie),Z(W),Z(y.$$.fragment,ie),Z(b.$$.fragment,ie),Z(C.$$.fragment,ie),Z(O),K=!1},d(ie){ie&&F(e),ie&&F(t),ie&&F(i),de(r),de(l),de(m),de(_),W&&W.d(),de(y),de(b),de(C),z[B].d(),ie&&F(A),H&&H.d(ie),ie&&F(V)}}}s(bz,"create_fragment");[...document.fonts.keys()].some(n=>n.family==="MinecraftFull")||new FontFace("MinecraftFull",km,{}).load().then(n=>{document.fonts.add(n)});localStorage.setItem("animated_java_settings_support_me_popup","true");function vz(n){return n===""?{type:"error",message:w("dialog.blueprint_settings.export_namespace.error.empty")}:n.trim().match("[^a-zA-Z0-9_]")?{type:"error",message:w("dialog.blueprint_settings.export_namespace.error.invalid_characters")}:["global","animated_java"].includes(n)?{type:"error",message:w("dialog.blueprint_settings.export_namespace.error.reserved",n)}:{type:"success",message:""}}s(vz,"exportNamespaceChecker");function Av(n){if(n==="")return{type:"error",message:w("dialog.blueprint_settings.display_item.error.no_item_selected")};if(n.split(":").length!==2)return{type:"error",message:w("dialog.blueprint_settings.display_item.error.invalid_item_id.no_namespace")};if(n.includes(" "))return{type:"error",message:w("dialog.blueprint_settings.display_item.error.invalid_item_id.whitespace")};if(Vn.item&&!Vn.item.has(n.replace("minecraft:","")))return{type:"warning",message:w("dialog.blueprint_settings.display_item.warning.item_does_not_exist")};{let e;try{e=or("assets/minecraft/models/item/"+n.replace("minecraft:","")+".json")}catch(t){return console.error(t),{type:"error",message:w("dialog.blueprint_settings.display_item.error.item_model_not_found")}}return e.parent==="item/generated"||e.parent==="minecraft:item/generated"?{type:"success",message:""}:{type:"warning",message:w("dialog.blueprint_settings.display_item.warning.item_model_not_generated")}}}s(Av,"displayItemChecker");function yz(n){let e=Number(n.x),t=Number(n.y),i=Number(Texture.all.map(a=>a.height).reduce((a,o)=>Math.max(a,o),0)),r=Number(Texture.all.map(a=>a.width).reduce((a,o)=>Math.max(a,o),0));return e===r&&t===i?e!==t?{type:"warning",message:w("dialog.blueprint_settings.texture_size.warning.not_square")}:e!==2**Math.floor(Math.log2(e))||t!==2**Math.floor(Math.log2(t))?{type:"warning",message:w("dialog.blueprint_settings.texture_size.warning.not_a_power_of_2")}:{type:"success",message:""}:{type:"warning",message:w("dialog.blueprint_settings.texture_size.warning.does_not_match_largest_texture")}}s(yz,"textureSizeChecker");function wz(n){let e;try{e=qi(n)}catch(t){return console.error(t),{type:"error",message:w("dialog.blueprint_settings.data_pack.error.folder_does_not_exist")}}switch(console.log(e),!0){case n==="":return{type:"error",message:w("dialog.blueprint_settings.data_pack.error.no_folder_selected")};case!fs.existsSync(e):return{type:"error",message:w("dialog.blueprint_settings.data_pack.error.folder_does_not_exist")};case!fs.statSync(e).isDirectory():return{type:"error",message:w("dialog.blueprint_settings.data_pack.error.not_a_folder")};case!fs.existsSync(PathModule.join(e,"pack.mcmeta")):return{type:"error",message:w("dialog.blueprint_settings.data_pack.error.missing_pack_mcmeta")};case!fs.existsSync(PathModule.join(e,"data")):return{type:"error",message:w("dialog.blueprint_settings.data_pack.error.missing_data_folder")};default:return{type:"success",message:""}}}s(wz,"dataPackFolderChecker");function xz(n){let e;try{e=qi(n)}catch(t){return console.error(t),{type:"error",message:w("dialog.blueprint_settings.resource_pack.error.folder_does_not_exist")}}switch(console.log(e),!0){case n==="":return{type:"error",message:w("dialog.blueprint_settings.resource_pack.error.no_folder_selected")};case!fs.existsSync(e):return{type:"error",message:w("dialog.blueprint_settings.resource_pack.error.folder_does_not_exist")};case!fs.statSync(e).isDirectory():return{type:"error",message:w("dialog.blueprint_settings.resource_pack.error.not_a_folder")};case!fs.existsSync(PathModule.join(e,"pack.mcmeta")):return{type:"error",message:w("dialog.blueprint_settings.resource_pack.error.missing_pack_mcmeta")};case!fs.existsSync(PathModule.join(e,"assets")):return{type:"error",message:w("dialog.blueprint_settings.resource_pack.error.missing_assets_folder")};default:return{type:"success",message:""}}}s(xz,"resourcePackFolderChecker");function kz(n){let e;try{e=qi(n)}catch(t){return console.error(t),{type:"error",message:w("dialog.blueprint_settings.advanced_resource_pack_file.error.file_does_not_exist")}}switch(console.log(e),!0){case n==="":return{type:"error",message:w("dialog.blueprint_settings.advanced_resource_pack_file.error.no_file_selected")};case!fs.existsSync(e):return{type:"error",message:w("dialog.blueprint_settings.advanced_resource_pack_file.error.file_does_not_exist")};case!fs.statSync(e).isFile():return{type:"error",message:w("dialog.blueprint_settings.advanced_resource_pack_file.error.not_a_file")};default:return{type:"success",message:""}}}s(kz,"advancedResourcePackFileChecker");function Ez(n){let e;try{e=qi(n)}catch(t){return console.error(t),{type:"error",message:w("dialog.blueprint_settings.json_file.error.file_does_not_exist")}}switch(console.log(e),!0){case n==="":return{type:"error",message:w("dialog.blueprint_settings.json_file.error.no_file_selected")};case(fs.existsSync(e)&&!fs.statSync(e).isFile()):return{type:"error",message:w("dialog.blueprint_settings.json_file.error.not_a_file")};default:return{type:"success",message:""}}}s(Ez,"jsonFileChecker");function Cv(n){let e;try{e=qi(n)}catch(t){return console.error(t),{type:"error",message:w("dialog.blueprint_settings.advanced_resource_pack_folder.error.folder_does_not_exist")}}switch(console.log(e),!0){case n==="":return{type:"error",message:w("dialog.blueprint_settings.advanced_resource_pack_folder.error.no_folder_selected")};case!fs.existsSync(e):return{type:"error",message:w("dialog.blueprint_settings.advanced_resource_pack_folder.error.folder_does_not_exist")};case!fs.statSync(e).isDirectory():return{type:"error",message:w("dialog.blueprint_settings.advanced_resource_pack_folder.error.not_a_folder")};default:return{type:"success",message:""}}}s(Cv,"advancedResourcePackFolderChecker");function Sv(n){let e;try{e=qi(n)}catch(t){return console.error(t),{type:"error",message:w("dialog.blueprint_settings.data_pack_zip.error.file_does_not_exist")}}switch(console.log(e),!0){case n==="":return{type:"error",message:w("dialog.blueprint_settings.resource_pack_zip.error.no_file_selected")};case(fs.existsSync(e)&&!fs.statSync(e).isFile()):return{type:"error",message:w("dialog.blueprint_settings.resource_pack_zip.error.not_a_file")};default:return{type:"success",message:""}}}s(Sv,"zipChecker");function Tz(n){n.target.textContent="sentiment_sad"}s(Tz,"hoverCloseButton");function Cz(n){n.target.textContent="close"}s(Cz,"leaveCloseButton");function Az(n,e,t){let i,r=ue,a=s(()=>(r(),r=ze(V,ve=>t(28,i=ve)),V),"$$subscribe_autoBoundingBox"),o,l=ue,u=s(()=>(l(),l=ze(S,ve=>t(29,o=ve)),S),"$$subscribe_enablePluginMode"),c,d=ue,m=s(()=>(d(),d=ze(B,ve=>t(30,c=ve)),B),"$$subscribe_resourcePackExportMode"),p,f=ue,_=s(()=>(f(),f=ze(ee,ve=>t(31,p=ve)),ee),"$$subscribe_enableAdvancedResourcePackSettings"),g,h=ue,v=s(()=>(h(),h=ze(se,ve=>t(32,g=ve)),se),"$$subscribe_enableAdvancedResourcePackFolders"),y,k=ue,b=s(()=>(k(),k=ze(O,ve=>t(33,y=ve)),O),"$$subscribe_dataPackExportMode");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l()),n.$$.on_destroy.push(()=>d()),n.$$.on_destroy.push(()=>f()),n.$$.on_destroy.push(()=>h()),n.$$.on_destroy.push(()=>k());let{blueprintName:x}=e,{textureSizeX:E}=e,{textureSizeY:C}=e,{exportNamespace:j}=e,{enablePluginMode:S}=e;u();let{resourcePackExportMode:B}=e;m();let{dataPackExportMode:O}=e;b();let{showBoundingBox:A}=e,{autoBoundingBox:V}=e;a();let{boundingBoxX:K}=e,{boundingBoxY:te}=e,{displayItem:fe}=e,{customModelDataOffset:ae}=e,{enableAdvancedResourcePackSettings:ee}=e;_();let{enableAdvancedResourcePackFolders:se}=e;v();let{resourcePack:oe}=e,{displayItemPath:xe}=e,{modelFolder:ne}=e,{textureFolder:pe}=e,{dataPack:W}=e,{summonCommands:U}=e,{tickingCommands:ce}=e,{interpolationDuration:J}=e,{teleportationDuration:Ce}=e,{useStorageForAnimation:Y}=e,{bakedAnimations:z}=e,{jsonFile:be}=e,H=localStorage.getItem("animated_java_settings_support_me_popup")==="true";function ie(){localStorage.setItem("animated_java_settings_support_me_popup","false"),t(27,H=!1)}s(ie,"clickSupportMeXButton");function Ie(ve){x=ve,t(0,x)}s(Ie,"lineinput0_value_binding");function Q(ve){E=ve,t(1,E)}s(Q,"vector2d_valueX_binding");function st(ve){C=ve,t(2,C)}s(st,"vector2d_valueY_binding");function at(ve){A=ve,t(7,A)}s(at,"checkbox0_checked_binding");function Vt(ve){V=ve,a(t(8,V))}s(Vt,"checkbox1_checked_binding");function We(ve){K=ve,t(9,K)}s(We,"vector2d_valueX_binding_1");function wt(ve){te=ve,t(10,te)}s(wt,"vector2d_valueY_binding_1");function Jt(ve){j=ve,t(3,j)}s(Jt,"lineinput1_value_binding");function X(ve){S=ve,u(t(4,S))}s(X,"checkbox2_checked_binding");function et(ve){fe=ve,t(11,fe)}s(et,"lineinput_value_binding");function si(ve){z=ve,t(25,z)}s(si,"checkbox_checked_binding");function Ei(ve){be=ve,t(26,be)}s(Ei,"fileselect_value_binding");function Ti(ve){B=ve,m(t(5,B))}s(Ti,"select0_value_binding");function Fn(ve){O=ve,b(t(6,O))}s(Fn,"select1_value_binding");function an(ve){fe=ve,t(11,fe)}s(an,"lineinput_value_binding_1");function Bt(ve){ee=ve,_(t(13,ee))}s(Bt,"checkbox_checked_binding_1");function mn(ve){ae=ve,t(12,ae)}s(mn,"numberslider_value_binding");function Mt(ve){se=ve,v(t(14,se))}s(Mt,"checkbox_checked_binding_2");function xt(ve){xe=ve,t(16,xe)}s(xt,"fileselect_value_binding_1");function Ft(ve){ne=ve,t(17,ne)}s(Ft,"folderselect0_value_binding");function It(ve){pe=ve,t(18,pe)}s(It,"folderselect1_value_binding");function Zt(ve){oe=ve,t(15,oe)}s(Zt,"folderselect_value_binding");function pn(ve){oe=ve,t(15,oe)}s(pn,"fileselect_value_binding_2");function wn(ve){W=ve,t(19,W)}s(wn,"folderselect_value_binding_1");function er(ve){W=ve,t(19,W)}s(er,"fileselect_value_binding_3");function ei(ve){U=ve,t(20,U)}s(ei,"codeinput0_value_binding");function li(ve){ce=ve,t(21,ce)}s(li,"codeinput1_value_binding");function Jn(ve){J=ve,t(22,J)}s(Jn,"numberslider0_value_binding");function po(ve){Ce=ve,t(23,Ce)}s(po,"numberslider1_value_binding");function Aa(ve){Y=ve,t(24,Y)}return s(Aa,"checkbox_checked_binding_3"),n.$$set=ve=>{"blueprintName"in ve&&t(0,x=ve.blueprintName),"textureSizeX"in ve&&t(1,E=ve.textureSizeX),"textureSizeY"in ve&&t(2,C=ve.textureSizeY),"exportNamespace"in ve&&t(3,j=ve.exportNamespace),"enablePluginMode"in ve&&u(t(4,S=ve.enablePluginMode)),"resourcePackExportMode"in ve&&m(t(5,B=ve.resourcePackExportMode)),"dataPackExportMode"in ve&&b(t(6,O=ve.dataPackExportMode)),"showBoundingBox"in ve&&t(7,A=ve.showBoundingBox),"autoBoundingBox"in ve&&a(t(8,V=ve.autoBoundingBox)),"boundingBoxX"in ve&&t(9,K=ve.boundingBoxX),"boundingBoxY"in ve&&t(10,te=ve.boundingBoxY),"displayItem"in ve&&t(11,fe=ve.displayItem),"customModelDataOffset"in ve&&t(12,ae=ve.customModelDataOffset),"enableAdvancedResourcePackSettings"in ve&&_(t(13,ee=ve.enableAdvancedResourcePackSettings)),"enableAdvancedResourcePackFolders"in ve&&v(t(14,se=ve.enableAdvancedResourcePackFolders)),"resourcePack"in ve&&t(15,oe=ve.resourcePack),"displayItemPath"in ve&&t(16,xe=ve.displayItemPath),"modelFolder"in ve&&t(17,ne=ve.modelFolder),"textureFolder"in ve&&t(18,pe=ve.textureFolder),"dataPack"in ve&&t(19,W=ve.dataPack),"summonCommands"in ve&&t(20,U=ve.summonCommands),"tickingCommands"in ve&&t(21,ce=ve.tickingCommands),"interpolationDuration"in ve&&t(22,J=ve.interpolationDuration),"teleportationDuration"in ve&&t(23,Ce=ve.teleportationDuration),"useStorageForAnimation"in ve&&t(24,Y=ve.useStorageForAnimation),"bakedAnimations"in ve&&t(25,z=ve.bakedAnimations),"jsonFile"in ve&&t(26,be=ve.jsonFile)},[x,E,C,j,S,B,O,A,V,K,te,fe,ae,ee,se,oe,xe,ne,pe,W,U,ce,J,Ce,Y,z,be,H,i,o,c,p,g,y,ie,Ie,Q,st,at,Vt,We,wt,Jt,X,et,si,Ei,Ti,Fn,an,Bt,mn,Mt,xt,Ft,It,Zt,pn,wn,er,ei,li,Jn,po,Aa]}s(Az,"instance");var Ku=class extends Be{constructor(e){super(),De(this,e,Az,bz,Oe,{blueprintName:0,textureSizeX:1,textureSizeY:2,exportNamespace:3,enablePluginMode:4,resourcePackExportMode:5,dataPackExportMode:6,showBoundingBox:7,autoBoundingBox:8,boundingBoxX:9,boundingBoxY:10,displayItem:11,customModelDataOffset:12,enableAdvancedResourcePackSettings:13,enableAdvancedResourcePackFolders:14,resourcePack:15,displayItemPath:16,modelFolder:17,textureFolder:18,dataPack:19,summonCommands:20,tickingCommands:21,interpolationDuration:22,teleportationDuration:23,useStorageForAnimation:24,bakedAnimations:25,jsonFile:26},null,[-1,-1,-1])}};s(Ku,"BlueprintSettingsDialog");var jv=Ku;(()=>{let n=Blockbench.addCSS(`i.svelte-1wavurd.svelte-1wavurd{cursor:pointer;height:fit-content;transition:transform 0.2s ease 0s,\r + color 0.2s ease 0s;text-shadow:1.5px 1.5px 0px rgba(0, 0, 0, 0.25)}i.svelte-1wavurd.svelte-1wavurd:hover{transform:scale(1.25)}.ko-fi-popup-container.svelte-1wavurd.svelte-1wavurd{position:absolute;top:30px;right:-287px;font-family:'MinecraftFull';font-size:20px;display:flex;align-items:center;justify-content:center;flex-direction:column;color:white;overflow:hidden}.ko-fi-popup.svelte-1wavurd.svelte-1wavurd{position:relative;display:flex;align-items:center;justify-content:center;flex-direction:column;padding:8px;padding-right:0px;background-color:#00aced;border-radius:0 8px 8px 0;box-shadow:4px 4px 8px rgba(0, 0, 0, 0.2);animation:svelte-1wavurd-slideIn 0.75s}.heart.svelte-1wavurd.svelte-1wavurd{width:28px;height:28px;animation:svelte-1wavurd-beat 2s ease infinite}@keyframes svelte-1wavurd-beat{0%{transform:scale(1)}10%{transform:scale(1.2)}20%{transform:scale(1)}}.ko-fi-popup.svelte-1wavurd span.svelte-1wavurd{text-shadow:2.4px 2.4px 0px rgba(0, 0, 0, 0.25)}.ko-fi-button.svelte-1wavurd img.svelte-1wavurd{width:100%;image-rendering:auto;border-radius:12px}.ko-fi-button.svelte-1wavurd.svelte-1wavurd{width:250px;margin-right:8px;margin-top:12px;transition:transform 0.2s ease}.ko-fi-button.svelte-1wavurd.svelte-1wavurd:hover{transform:scale(1.05);transition:transform 0.2s ease}.ko-fi-popup.svelte-1wavurd .title.svelte-1wavurd{display:flex;justify-content:center;gap:0.75rem}.shadow.svelte-1wavurd.svelte-1wavurd{position:absolute;top:0;left:0;height:100%;background:linear-gradient(90deg, #00000066, #00000000);width:0px}@keyframes svelte-1wavurd-slideIn{0%{right:287px}100%{right:0}}@keyframes svelte-1wavurd-slideInPanel{0%{right:0}100%{right:-287px}}dialog#animated_java\\:blueprintSettingsDialog .dialog_wrapper .dialog_content{overflow-y:auto !important}div.svelte-1wavurd.svelte-1wavurd{padding-right:8px;max-height:50rem}.warning.svelte-1wavurd.svelte-1wavurd{color:var(--color-warning);font-family:var(--font-code);font-size:0.8em;margin-bottom:8px}`);function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();function Sz(){return{blueprintName:new ge(Project.name,n=>n||"My Blueprint"),textureSizeX:new ge(Project.texture_width),textureSizeY:new ge(Project.texture_height),showBoundingBox:new ge(Project.animated_java.show_bounding_box),autoBoundingBox:new ge(Project.animated_java.auto_bounding_box),boundingBoxX:new ge(Project.animated_java.bounding_box[0]),boundingBoxY:new ge(Project.animated_java.bounding_box[1]),enablePluginMode:new ge(Project.animated_java.enable_plugin_mode),exportNamespace:new ge(Project.animated_java.export_namespace,n=>n?Ht(n):zt.export_namespace),resourcePackExportMode:new ge(Project.animated_java.resource_pack_export_mode),dataPackExportMode:new ge(Project.animated_java.data_pack_export_mode),displayItem:new ge(Project.animated_java.display_item,n=>n||zt.display_item),customModelDataOffset:new ge(Project.animated_java.custom_model_data_offset),enableAdvancedResourcePackSettings:new ge(Project.animated_java.enable_advanced_resource_pack_settings),enableAdvancedResourcePackFolders:new ge(Project.animated_java.enable_advanced_resource_pack_folders),resourcePack:new ge(Project.animated_java.resource_pack),displayItemPath:new ge(Project.animated_java.display_item_path),modelFolder:new ge(Project.animated_java.model_folder),textureFolder:new ge(Project.animated_java.texture_folder),enableAdvancedDataPackSettings:new ge(Project.animated_java.enable_advanced_data_pack_settings),dataPack:new ge(Project.animated_java.data_pack),summonCommands:new ge(Project.animated_java.summon_commands),tickingCommands:new ge(Project.animated_java.ticking_commands),interpolationDuration:new ge(Project.animated_java.interpolation_duration),teleportationDuration:new ge(Project.animated_java.teleportation_duration),useStorageForAnimation:new ge(Project.animated_java.use_storage_for_animation),bakedAnimations:new ge(Project.animated_java.baked_animations),jsonFile:new ge(Project.animated_java.json_file)}}s(Sz,"getSettings");function jz(n){Project&&(Project.name=n.blueprintName.get(),setProjectResolution(n.textureSizeX.get(),n.textureSizeY.get(),!0),Project.animated_java.show_bounding_box=n.showBoundingBox.get(),Project.animated_java.auto_bounding_box=n.autoBoundingBox.get(),Project.animated_java.bounding_box=[n.boundingBoxX.get(),n.boundingBoxY.get()],Project.animated_java.enable_plugin_mode=n.enablePluginMode.get(),Project.pluginMode.set(n.enablePluginMode.get()),Project.animated_java.export_namespace=n.exportNamespace.get(),Project.animated_java.resource_pack_export_mode=n.resourcePackExportMode.get(),Project.animated_java.data_pack_export_mode=n.dataPackExportMode.get(),Project.animated_java.display_item=n.displayItem.get(),Project.animated_java.custom_model_data_offset=n.customModelDataOffset.get(),Project.animated_java.enable_advanced_resource_pack_settings=n.enableAdvancedResourcePackSettings.get(),Project.animated_java.enable_advanced_resource_pack_folders=n.enableAdvancedResourcePackFolders.get(),Project.animated_java.resource_pack=n.resourcePack.get(),Project.animated_java.display_item_path=n.displayItemPath.get(),Project.animated_java.model_folder=n.modelFolder.get(),Project.animated_java.texture_folder=n.textureFolder.get(),Project.animated_java.enable_advanced_data_pack_settings=n.enableAdvancedDataPackSettings.get(),Project.animated_java.data_pack=n.dataPack.get(),Project.animated_java.summon_commands=n.summonCommands.get(),Project.animated_java.ticking_commands=n.tickingCommands.get(),Project.animated_java.interpolation_duration=n.interpolationDuration.get(),Project.animated_java.teleportation_duration=n.teleportationDuration.get(),Project.animated_java.use_storage_for_animation=n.useStorageForAnimation.get(),Project.animated_java.baked_animations=n.bakedAnimations.get(),Project.animated_java.json_file=n.jsonFile.get(),console.log("Successfully saved project settings",Project))}s(jz,"setSettings");function os(){if(!Project)return;let n=Sz();return new qt({id:`${ke.name}:blueprintSettingsDialog`,title:w("dialog.blueprint_settings.title"),width:512,component:jv,props:n,preventKeybinds:!0,onConfirm(){jz(n),Jc()}}).show()}s(os,"openBlueprintSettingsDialog");function Iv(n){let e,t;return{c(){e=P("progress"),e.value=t=n[4]/n[5]||0,T(e,"max","1"),T(e,"class","svelte-x7e53b")},m(i,r){L(i,e,r)},p(i,r){r&48&&t!==(t=i[4]/i[5]||0)&&(e.value=t)},d(i){i&&F(e)}}}s(Iv,"create_if_block");function Iz(n){let e,t,i,r,a,o,l,u,c=n[4]!==0&&Iv(n);return{c(){e=P("div"),t=P("div"),i=P("p"),r=Re(n[3]),a=G(),o=P("img"),u=G(),c&&c.c(),Yt(o.src,l=qo)||T(o,"src",l),T(o,"width","64px"),T(t,"class","progress-container svelte-x7e53b"),T(e,"class","dialog-container svelte-x7e53b")},m(d,m){L(d,e,m),N(e,t),N(t,i),N(i,r),N(t,a),N(t,o),N(e,u),c&&c.m(e,null)},p(d,[m]){m&8&&ot(r,d[3]),d[4]!==0?c?c.p(d,m):(c=Iv(d),c.c(),c.m(e,null)):c&&(c.d(1),c=null)},i:ue,o:ue,d(d){d&&F(e),c&&c.d()}}}s(Iz,"create_fragment");function Oz(n,e,t){let i,r=ue,a=s(()=>(r(),r=ze(_,g=>t(3,i=g)),_),"$$subscribe_progressDescription"),o,l=ue,u=s(()=>(l(),l=ze(p,g=>t(4,o=g)),p),"$$subscribe_progress"),c,d=ue,m=s(()=>(d(),d=ze(f,g=>t(5,c=g)),f),"$$subscribe_maxProgress");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l()),n.$$.on_destroy.push(()=>d());let{progress:p}=e;u();let{maxProgress:f}=e;m();let{progressDescription:_}=e;return a(),n.$$set=g=>{"progress"in g&&u(t(0,p=g.progress)),"maxProgress"in g&&m(t(1,f=g.maxProgress)),"progressDescription"in g&&a(t(2,_=g.progressDescription))},[p,f,_,i,o,c]}s(Oz,"instance");var Wu=class extends Be{constructor(e){super(),De(this,e,Oz,Iz,Oe,{progress:0,maxProgress:1,progressDescription:2})}};s(Wu,"ExportProgressDialog");var Ov=Wu;(()=>{let n=Blockbench.addCSS(".dialog-container.svelte-x7e53b{display:flex;flex-direction:column;align-items:center}.progress-container.svelte-x7e53b{width:100%;display:flex;flex-direction:row;align-items:center;justify-content:space-between}progress.svelte-x7e53b{width:100%}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();var ln=new ge(0),mr=new ge(1),Qn=new ge("");function Zu(n){return ln.set(0),mr.set(1),Qn.set("Preparing..."),n&&(mr.set(1e3),setInterval(()=>{ln.set(ln.get()+1),ln.get()>=mr.get()&&ln.set(0)},10)),new qt({id:`${ke.name}:exportProgressDialog`,title:w("dialog.export_progress.title"),width:512,component:Ov,props:{progress:ln,maxProgress:mr,progressDescription:Qn},preventKeybinds:!0,buttons:[]}).show()}s(Zu,"openExportProgressDialog");var Ym={...EffectAnimator.prototype.channels},Nz=EffectAnimator.prototype.displayFrame,Ul=["variant","commands"],Xu=!1;function Bz(){if(Xu)return;EffectAnimator.addChannel("variant",{name:w("effect_animator.timeline.variant"),mutable:!0,max_data_points:1}),EffectAnimator.addChannel("commands",{name:w("effect_animator.timeline.commands"),mutable:!0,max_data_points:1});let n=new Property(KeyframeDataPoint,"string","variant",{label:w("effect_animator.keyframe.variant"),condition:e=>e.keyframe.channel==="variant",exposed:!1});Object.defineProperty(n,"default",{get(){return Ne.getDefault().uuid}}),new Property(KeyframeDataPoint,"string","commands",{label:w("effect_animator.timeline.commands"),default:"",condition:e=>e.keyframe.channel==="commands",exposed:!1}),new Property(KeyframeDataPoint,"string","execute_condition",{label:w("effect_animator.timeline.execute_condition"),default:"",condition:e=>Ul.includes(e.keyframe.channel),exposed:!1}),new Property(KeyframeDataPoint,"boolean","repeat",{label:w("effect_animator.timeline.repeat"),default:!1,condition:e=>Ul.includes(e.keyframe.channel),exposed:!1}),new Property(KeyframeDataPoint,"number","repeat_frequency",{label:w("effect_animator.timeline.repeat_frequency"),default:1,condition:e=>Ul.includes(e.keyframe.channel),exposed:!1});for(let e of Object.keys(Ym))e!=="sound"&&delete EffectAnimator.prototype.channels[e];EffectAnimator.prototype.displayFrame=function(e){if(e&&!this.muted.sound&&this.sound.forEach(t=>{let i=this.animation.time-t.time;if(i<0)return;let r=Timeline.playing_sounds.find(a=>a.keyframe_id==t.uuid);i>=0&&i<1/60*(Timeline.playback_speed/100)&&!r?t.data_points[0].file&&!t.cooldown&&(r=new Audio(t.data_points[0].file),r.keyframe_id=t.uuid,r.playbackRate=Math.clamp(Timeline.playback_speed/100,.1,4),r.volume=Math.clamp(settings.volume.value/100,0,1),r.play().catch(()=>{}),Timeline.playing_sounds.push(r),r.onended=function(){Timeline.playing_sounds.remove(r)},t.cooldown=!0,setTimeout(()=>{delete t.cooldown},400)):i>0&&(r=Timeline.playing_sounds.find(a=>a.keyframe_id==t.uuid),r&&Math.abs(r.currentTime-i)>.08&&(r.currentTime=i,r.playbackRate=Math.clamp(Timeline.playback_speed/100,.1,4)))}),!!(Project&&Ue())){if(!this.muted.variant){let t,i,r;for(let a of this.variant)a.timei.time)&&(i=a):(!t||a.timeo.uuid===r.data_points[0].variant);a||console.error("Variant",r.data_points[0].variant,"not found."),a?.select()}}this.last_displayed_time=this.animation.time}},Xu=!0}s(Bz,"injectCustomKeyframes");function Rz(){if(Xu){for(let n of Object.keys(Ym))n!=="sound"&&(EffectAnimator.prototype.channels[n]=Ym[n]);KeyframeDataPoint.properties.variant?.delete(),KeyframeDataPoint.properties.commands?.delete(),KeyframeDataPoint.properties.execute_condition?.delete(),KeyframeDataPoint.properties.repeat?.delete(),KeyframeDataPoint.properties.repeat_frequency?.delete(),delete EffectAnimator.prototype.channels.variant,delete EffectAnimator.prototype.variant,delete EffectAnimator.prototype.channels.commands,delete EffectAnimator.prototype.commands,delete BoneAnimator.prototype.channels.commands,delete BoneAnimator.prototype.commands,EffectAnimator.prototype.displayFrame=Nz,Xu=!1}}s(Rz,"extractCustomKeyframes");re.PRE_SELECT_PROJECT.subscribe(n=>{n.format.id===rt.id?Bz():Rz()});function Jl(n){return function(e,t){e.data_points.length===0&&e.data_points.push(new KeyframeDataPoint(e)),e.data_points[0][n]=t}}s(Jl,"keyframeValueSetterFactory");function Hl(n){return function(e){return e.data_points.at(0)?.[n]}}s(Hl,"keyframeValueGetterFactory");var Nv=Jl("variant"),ss=Hl("variant"),Bv=Jl("commands"),ya=Hl("commands"),Rv=Jl("execute_condition"),Wr=Hl("execute_condition"),Dv=Jl("repeat"),ls=Hl("repeat"),Mv=Jl("repeat_frequency"),cs=Hl("repeat_frequency");var Fv=ci(Rt("crypto"),1);function np(){main_preview.controls.rotateLeft(Math.PI),scene.setRotationFromAxisAngle(new THREE.Vector3(0,1,0),Math.PI)}s(np,"correctSceneAngle");function ip(){main_preview.controls.rotateLeft(-Math.PI),scene.setRotationFromAxisAngle(new THREE.Vector3(0,1,0),0)}s(ip,"restoreSceneAngle");function Qm(n,e){let t=n.mesh.matrixWorld.clone(),i=new THREE.Vector3().setFromMatrixPosition(t).multiplyScalar(1/16);t.setPosition(i);let r=new THREE.Vector3().setScalar(e);return t.scale(r),n instanceof qe&&t.multiply(new THREE.Matrix4().makeRotationFromEuler(new THREE.Euler(0,Math.PI,0,"XYZ"))),t}s(Qm,"getNodeMatrix");function Dz(n){let e=new THREE.Vector3,t=new THREE.Quaternion,i=new THREE.Vector3;return n.decompose(e,t,i),{translation:e,left_rotation:t,scale:i}}s(Dz,"getDecomposedTransformation");function Mz(n){let e=new THREE.Euler().setFromQuaternion(n,"YXZ");return[Math.radToDeg(-e.x),Math.radToDeg(-e.y)+180]}s(Mz,"threeAxisRotationToTwoAxisRotation");var ep,$l=new Map,ql=new Map,tp=new Set,Yu=new Map;function rp(n,e,t=0){let i={time:t,node_transforms:{},variant:Fz(n,t),commands:Lz(n,t)};if(ep!==n){ep=n,$l=new Map,ql=new Map;for(let r of Object.keys(e)){let a=n.animators[r];if(!a)continue;let o=a.keyframes?new Map(a.keyframes.map(l=>[l.time,l])):new Map;ql.set(r,o)}tp=new Set(n.excluded_nodes?n.excluded_nodes.map(r=>r.value):[]),Yu=new Map;for(let r of Vz())Yu.set(r.uuid,r)}for(let[r,a]of Object.entries(e)){let o=Yu.get(r);if(!o||tp.has(r))continue;let l=ql.get(r);if(!l)continue;let u=l.get(t),c=l.get(t-.05),d=$l.get(r),m,p,f,_,g,h;switch(a.type){case"text_display":case"item_display":case"block_display":case"bone":{if(m=Qm(o,a.base_scale),d&&d.matrix.equals(m))continue;if(a.parent&&a.parent!=="root"){let x=ql.get(a.parent),E=x?.get(t),C=x?.get(t-.05);E?.interpolation==="step"?p="step":C?.data_points.length===2&&(p="pre-post")}u?.interpolation==="step"?p="step":c?.data_points.length===2&&(p="pre-post"),$l.set(r,{matrix:m,keyframe:u});break}case"locator":{m=Qm(o,1),u?(f=ya(u),_=Wr(u),$l.set(r,{matrix:m,keyframe:u})):d?.keyframe&&(g=ls(d.keyframe),h=cs(d.keyframe),g&&h&&Math.round(t*20)%h===0&&(f=ya(d.keyframe),_=Wr(d.keyframe)));break}case"camera":case"struct":{m=Qm(o,1);break}}let v=new THREE.Vector3,y=new THREE.Quaternion,k=new THREE.Vector3;m.decompose(v,y,k);let b=Dz(m);i.node_transforms[r]={matrix:m,decomposed:b,pos:[v.x,v.y,v.z],rot:Tc(y).toArray(),scale:[k.x,k.y,k.z],head_rot:Mz(y),interpolation:p,commands:f,execute_condition:_}}return i}s(rp,"getFrame");function Fz(n,e){let t=n.animators.effects?.variant;if(t)for(let i of t){if(i.time!==e)continue;let r=ss(i);return r?{uuid:r,execute_condition:Wr(i)}:void 0}}s(Fz,"getVariantKeyframe");function Lz(n,e){let t=n.animators.effects?.commands;if(t)for(let i of t){if(i.time!==e)continue;let r=ya(i);return r?{commands:r,execute_condition:Wr(i)}:void 0}}s(Lz,"getCommandsKeyframe");function ap(n,e){Timeline.time=e,Animator.showDefaultPose(!0);let t=[...Group.all,...NullObject.all,...Locator.all,...qe.all,...ht.all,...ut.all];OutlinerElement.types.camera&&t.push(...OutlinerElement.types.camera.all);for(let i of t)i.constructor.animator&&(Animator.resetLastValues(),n.getBoneAnimator(i).displayFrame());Animator.resetLastValues(),scene.updateMatrixWorld(),n.effects&&n.effects.displayFrame()}s(ap,"updatePreview");function Pz(n,e){let t={name:n.name,uuid:n.uuid,safe_name:Ht(n.name).replaceAll(".","_"),loop_delay:Number(n.loop_delay)||0,frames:[],duration:0,loop_mode:n.loop,modified_nodes:{}};n.select();let i=new Set;for(let r=0;r<=n.length;r=aa(r+.05,20)){ap(n,r);let a=rp(n,e.nodes,r);Object.keys(a.node_transforms).forEach(o=>i.add(o)),t.frames.push(a)}return t.duration=t.frames.length,t.modified_nodes=Object.fromEntries(Array.from(i).map(r=>[r,e.nodes[r]])),t}s(Pz,"renderAnimation");function Lv(n){let e=Fv.createHash("sha256");for(let t of n){e.update("anim;"+t.name),e.update(";"+t.duration.toString()),e.update(";"+t.loop_mode),e.update(";"+Object.keys(t.modified_nodes).join(";"));for(let i of t.frames){e.update(";"+i.time.toString());for(let[r,a]of Object.entries(i.node_transforms))e.update(";"+r),e.update(";"+a.pos.join(";")),e.update(";"+a.rot.join(";")),e.update(";"+a.scale.join(";")),a.interpolation&&e.update(";"+a.interpolation),a.commands&&e.update(";"+a.commands),a.execute_condition&&e.update(";"+a.execute_condition);i.variant&&(e.update(";"+i.variant.uuid),i.variant.execute_condition&&e.update(";"+i.variant.execute_condition))}}return e.digest("hex")}s(Lv,"hashAnimations");function Vz(){return[...Group.all,...Locator.all,...qe.all,...ht.all,...ut.all,...OutlinerElement.types.camera?OutlinerElement.types.camera.all:[]]}s(Vz,"getAnimatableNodes");function Pv(n,e){ep=void 0,$l=new Map,ql=new Map,tp=new Set,Yu=new Map,console.time("Rendering animations took");let t,i=0;Timeline.pause(),Mode.selected.id==="animate"&&(t=Animator.selected,i=Timeline.time),np();let r=[];for(let a of n.animations)r.push(Pz(a,e));return ip(),Mode.selected.id==="animate"&&t?(t.select(),Timeline.setTime(i),Animator.preview()):Mode.selected.id==="edit"&&Animator.showDefaultPose(),console.timeEnd("Rendering animations took"),console.log("Animations:",r),r}s(Pv,"renderProjectAnimations");var D=class{static global(e){return D.globals[e]?D.globals[e]:D.globals[e]={}}static createStatic(e,t,i){let r=null;Object.defineProperty(e,t,{enumerable:!0,get:function(){return i!=null&&(r=i(),i=null),r},set:function(a){i!=null&&(r=i(),i=null),r=a}})}static iterator(e){if(Array.isArray(e)){let t=e;return function(){return D.mkIter(t)}}else return typeof e.iterator=="function"?e.iterator.bind(e):e.iterator}static getIterator(e){return Array.isArray(e)?D.mkIter(e):e.iterator()}static mkIter(e){return new zz(e)}static extend(e){function t(){this.new.apply(this,arguments)}return s(t,"res"),Object.setPrototypeOf(t.prototype,e.prototype),t}static inherits(e,t){t==null&&(t=!1);function i(){t&&e&&i.__init__&&i.__init__(),this.new.apply(this,arguments)}return s(i,"res"),t?i.__init__=()=>{let r=e();r.__init__&&r.__init__(),Object.setPrototypeOf(i.prototype,r.prototype),i.__init__=void 0}:e&&e.__init__?(t=!0,i.__init__=()=>{e.__init__&&e.__init__(),Object.setPrototypeOf(i.prototype,e.prototype),i.__init__=void 0}):e&&Object.setPrototypeOf(i.prototype,e.prototype),i}static bind(e,t){if(t==null)return null;t.__id__==null&&(t.__id__=D.fid++);let i=null;return e.hx__closures__==null?e.hx__closures__={}:i=e.hx__closures__[t.__id__],i==null&&(i=t.bind(e),e.hx__closures__[t.__id__]=i),i}static get __name__(){return"genes.Register"}get __class__(){return D}};s(D,"Register");D.$global=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:void 0;D.globals={};D.fid=0;var zz=D.global("$hxClasses")["genes._Register.ArrayIterator"]=s(class Vv extends D.inherits(){new(e){this.current=0,this.array=e}hasNext(){return this.currenthe,!0){new(e,t,i){super.new(String(e),t,i),this.value=e}unwrap(){return this.value}static get __name__(){return"haxe.ValueException"}static get __super__(){return he}get __class__(){return zv}},"ValueException");var ore=D.$global,he=D.global("$hxClasses")["haxe.Exception"]=s(class Kl extends D.inherits(()=>Error,!0){new(e,t,i){Error.call(this,e),this.message=e,this.__previousException=t,this.__nativeException=i??this}unwrap(){return this.__nativeException}toString(){return this.get_message()}get_message(){return this.message}get_native(){return this.__nativeException}static caught(e){return e instanceof Kl?e:e instanceof Error?new Kl(e.message,null,e):new op(e,null,e)}static thrown(e){return e instanceof Kl?e.get_native():e instanceof Error?e:new op(e)}static get __name__(){return"haxe.Exception"}static get __super__(){return Error}get __class__(){return Kl}},"Exception");var dre=D.$global,it=D.global("$hxClasses").HxOverrides=s(class Gv{static dateStr(e){let t=e.getMonth()+1,i=e.getDate(),r=e.getHours(),a=e.getMinutes(),o=e.getSeconds();return e.getFullYear()+"-"+(t<10?"0"+t:""+t)+"-"+(i<10?"0"+i:""+i)+" "+(r<10?"0"+r:""+r)+":"+(a<10?"0"+a:""+a)+":"+(o<10?"0"+o:""+o)}static strDate(e){switch(e.length){case 8:let t=e.split(":"),i=new Date;return i.setTime(0),i.setUTCHours(t[0]),i.setUTCMinutes(t[1]),i.setUTCSeconds(t[2]),i;break;case 10:let r=e.split("-");return new Date(r[0],r[1]-1,r[2],0,0,0);case 19:let a=e.split(" "),o=a[0].split("-"),l=a[1].split(":");return new Date(o[0],o[1]-1,o[2],l[0],l[1],l[2]);default:throw he.thrown("Invalid date format : "+e)}}static cca(e,t){let i=e.charCodeAt(t);if(i==i)return i}static substr(e,t,i){if(i==null)i=e.length;else if(i<0)if(t==0)i=e.length+i;else return"";return e.substr(t,i)}static now(){return Date.now()}static get __name__(){return"HxOverrides"}get __class__(){return Gv}},"HxOverrides");typeof performance<"u"&&typeof performance.now=="function"&&(it.now=performance.now.bind(performance));var gre=D.$global,Ct=D.global("$hxClasses").StringTools=s(class us{static isSpace(e,t){let i=it.cca(e,t);return i>8&&i<14?!0:i==32}static ltrim(e){let t=e.length,i=0;for(;i0?it.substr(e,i,t-i):e}static rtrim(e){let t=e.length,i=0;for(;i0?it.substr(e,0,t-i):e}static trim(e){return us.ltrim(us.rtrim(e))}static hex(e,t){let i="",r="0123456789ABCDEF";do i=r.charAt(e&15)+i,e>>>=4;while(e>0);if(t!=null)for(;i.length({_hx_index:0,__enum__:"mcl.Token",v:n,pos:e,"@kind":"Literal"}),{_hx_name:"Literal",__params__:["v","pos"]}),BracketOpen:Object.assign((n,e)=>({_hx_index:1,__enum__:"mcl.Token",pos:n,data:e,"@kind":"BracketOpen"}),{_hx_name:"BracketOpen",__params__:["pos","data"]}),BracketClose:Object.assign(n=>({_hx_index:2,__enum__:"mcl.Token",pos:n,"@kind":"BracketClose"}),{_hx_name:"BracketClose",__params__:["pos"]})};Bn.__constructs__=[Bn.Literal,Bn.BracketOpen,Bn.BracketClose];Bn.__empty_constructs__=[];var Zr=D.global("$hxEnums")["mcl.Brackets"]={__ename__:"mcl.Brackets",Curly:{_hx_name:"Curly",_hx_index:0,__enum__:"mcl.Brackets","@kind":"Curly"},Square:{_hx_name:"Square",_hx_index:1,__enum__:"mcl.Brackets","@kind":"Square"},Round:{_hx_name:"Round",_hx_index:2,__enum__:"mcl.Brackets","@kind":"Round"}};Zr.__constructs__=[Zr.Curly,Zr.Square,Zr.Round];Zr.__empty_constructs__=[Zr.Curly,Zr.Square,Zr.Round];var ni=D.global("$hxClasses")["mcl.Tokenizer"]=s(class Uv{static tokenize(e,t){let i=!1,r=[],a=[],o=0,l=e.split(` +`);for(;o0&&c.push(Bn.Literal(x,{line:d,col:m+_,file:t}));let E=Ct.trim(f.substring(k+1));c.push(Bn.BracketOpen({line:d,col:m+_+k,file:t},E)),v=!0;break}h.pop()}++g}let y=Ct.trim(f);v||y.length==0||c.push(Bn.Literal(Ct.trim(y),{line:d,col:m+_,file:t}))}return c}static get __name__(){return"mcl.Tokenizer"}get __class__(){return Uv}},"Tokenizer");var Sp=ci(Rt("module"));var Cre=D.$global,yi=D.global("$hxClasses")["mcl.error.McbError"]=s(class sp extends D.inherits(he){new(e,t){super.new(e),this.mcbstack=t}__init__(){}static isMclError(e){return e instanceof sp}static get __name__(){return"mcl.error.McbError"}static get __super__(){return he}get __class__(){return sp}},"McbError");var Ore=D.$global,Pe=D.global("$hxClasses")["mcl.error.CompilerError"]=s(class Jv extends D.inherits(yi){new(e,t,i){super.new((t?"Internal ":"")+`Compiler Error: + `+e,i),this.internal=t}static get __name__(){return"mcl.error.CompilerError"}static get __super__(){return yi}get __class__(){return Jv}},"CompilerError");var Mre=D.$global,He=D.global("$hxClasses")["haxe.io.Path"]=s(class to extends D.inherits(){new(e){switch(e){case".":case"..":this.dir=e,this.file="";return}let t=e.lastIndexOf("/"),i=e.lastIndexOf("\\");t0&&i[i.length-1]!=".."?i.pop():p==""?(i.length>0||it.cca(e,0)==47)&&i.push(p):p!="."&&i.push(p)}let o=i.join(t),l="",u=!1,c=!1,d=0,m=o;for(;d=55296&&_<=56319&&(_=_-55232<<10|p.charCodeAt(f+1)&1023);let g=_;g>=65536&&++d;let h=g;switch(h){case 47:if(!u)c=!0;else{let y=h;u=!1,c&&(l+="/",c=!1),l+=String.fromCodePoint(y)}break;case 58:l+=":",u=!0;break;default:let v=h;u=!1,c&&(l+="/",c=!1),l+=String.fromCodePoint(v)}}return l}static addTrailingSlash(e){if(e.length==0)return"/";let t=e.lastIndexOf("/"),i=e.lastIndexOf("\\");return t({_hx_index:0,__enum__:"mcl.JsonTagType",subType:n,replace:e,entries:t,"@kind":"Tag"}),{_hx_name:"Tag",__params__:["subType","replace","entries"]}),Advancement:Object.assign(n=>({_hx_index:1,__enum__:"mcl.JsonTagType",entries:n,"@kind":"Advancement"}),{_hx_name:"Advancement",__params__:["entries"]}),ItemModifier:Object.assign(n=>({_hx_index:2,__enum__:"mcl.JsonTagType",entries:n,"@kind":"ItemModifier"}),{_hx_name:"ItemModifier",__params__:["entries"]}),LootTable:Object.assign(n=>({_hx_index:3,__enum__:"mcl.JsonTagType",entries:n,"@kind":"LootTable"}),{_hx_name:"LootTable",__params__:["entries"]}),Predicate:Object.assign(n=>({_hx_index:4,__enum__:"mcl.JsonTagType",entries:n,"@kind":"Predicate"}),{_hx_name:"Predicate",__params__:["entries"]}),Recipe:Object.assign(n=>({_hx_index:5,__enum__:"mcl.JsonTagType",entries:n,"@kind":"Recipe"}),{_hx_name:"Recipe",__params__:["entries"]}),ChatType:Object.assign(n=>({_hx_index:6,__enum__:"mcl.JsonTagType",entries:n,"@kind":"ChatType"}),{_hx_name:"ChatType",__params__:["entries"]}),DamageType:Object.assign(n=>({_hx_index:7,__enum__:"mcl.JsonTagType",entries:n,"@kind":"DamageType"}),{_hx_name:"DamageType",__params__:["entries"]}),Dimension:Object.assign(n=>({_hx_index:8,__enum__:"mcl.JsonTagType",entries:n,"@kind":"Dimension"}),{_hx_name:"Dimension",__params__:["entries"]}),DimensionType:Object.assign(n=>({_hx_index:9,__enum__:"mcl.JsonTagType",entries:n,"@kind":"DimensionType"}),{_hx_name:"DimensionType",__params__:["entries"]}),Enchantment:Object.assign(n=>({_hx_index:10,__enum__:"mcl.JsonTagType",entries:n,"@kind":"Enchantment"}),{_hx_name:"Enchantment",__params__:["entries"]}),WorldGen:Object.assign((n,e,t)=>({_hx_index:11,__enum__:"mcl.JsonTagType",subType:n,name:e,entries:t,"@kind":"WorldGen"}),{_hx_name:"WorldGen",__params__:["subType","name","entries"]})};Kt.__constructs__=[Kt.Tag,Kt.Advancement,Kt.ItemModifier,Kt.LootTable,Kt.Predicate,Kt.Recipe,Kt.ChatType,Kt.DamageType,Kt.Dimension,Kt.DimensionType,Kt.Enchantment,Kt.WorldGen];Kt.__empty_constructs__=[];var Ae=D.global("$hxEnums")["mcl.AstNode"]={__ename__:"mcl.AstNode",Raw:Object.assign((n,e,t,i)=>({_hx_index:0,__enum__:"mcl.AstNode",pos:n,value:e,continuations:t,isMacro:i,"@kind":"Raw"}),{_hx_name:"Raw",__params__:["pos","value","continuations","isMacro"]}),FunctionDef:Object.assign((n,e,t,i)=>({_hx_index:1,__enum__:"mcl.AstNode",pos:n,name:e,body:t,appendTo:i,"@kind":"FunctionDef"}),{_hx_name:"FunctionDef",__params__:["pos","name","body","appendTo"]}),TemplateDef:Object.assign((n,e,t)=>({_hx_index:2,__enum__:"mcl.AstNode",pos:n,name:e,body:t,"@kind":"TemplateDef"}),{_hx_name:"TemplateDef",__params__:["pos","name","body"]}),Directory:Object.assign((n,e,t)=>({_hx_index:3,__enum__:"mcl.AstNode",pos:n,name:e,body:t,"@kind":"Directory"}),{_hx_name:"Directory",__params__:["pos","name","body"]}),Import:Object.assign((n,e)=>({_hx_index:4,__enum__:"mcl.AstNode",pos:n,name:e,"@kind":"Import"}),{_hx_name:"Import",__params__:["pos","name"]}),CompileTimeLoop:Object.assign((n,e,t,i)=>({_hx_index:5,__enum__:"mcl.AstNode",pos:n,expression:e,as:t,body:i,"@kind":"CompileTimeLoop"}),{_hx_name:"CompileTimeLoop",__params__:["pos","expression","as","body"]}),CompileTimeIf:Object.assign((n,e,t,i)=>({_hx_index:6,__enum__:"mcl.AstNode",pos:n,expression:e,body:t,elseExpressions:i,"@kind":"CompileTimeIf"}),{_hx_name:"CompileTimeIf",__params__:["pos","expression","body","elseExpressions"]}),MultiLineScript:Object.assign((n,e)=>({_hx_index:7,__enum__:"mcl.AstNode",pos:n,value:e,"@kind":"MultiLineScript"}),{_hx_name:"MultiLineScript",__params__:["pos","value"]}),Block:Object.assign((n,e,t,i,r,a)=>({_hx_index:8,__enum__:"mcl.AstNode",pos:n,name:e,body:t,data:i,isMacro:r,isInline:a,"@kind":"Block"}),{_hx_name:"Block",__params__:["pos","name","body","data","isMacro","isInline"]}),TickBlock:Object.assign((n,e)=>({_hx_index:9,__enum__:"mcl.AstNode",pos:n,body:e,"@kind":"TickBlock"}),{_hx_name:"TickBlock",__params__:["pos","body"]}),LoadBlock:Object.assign((n,e)=>({_hx_index:10,__enum__:"mcl.AstNode",pos:n,body:e,"@kind":"LoadBlock"}),{_hx_name:"LoadBlock",__params__:["pos","body"]}),ExecuteBlock:Object.assign((n,e,t,i,r,a)=>({_hx_index:11,__enum__:"mcl.AstNode",pos:n,execute:e,data:t,body:i,continuations:r,isMacro:a,"@kind":"ExecuteBlock"}),{_hx_name:"ExecuteBlock",__params__:["pos","execute","data","body","continuations","isMacro"]}),ScheduleBlock:Object.assign((n,e,t,i,r)=>({_hx_index:12,__enum__:"mcl.AstNode",pos:n,delay:e,type:t,body:i,isMacro:r,"@kind":"ScheduleBlock"}),{_hx_name:"ScheduleBlock",__params__:["pos","delay","type","body","isMacro"]}),SequenceBlock:Object.assign((n,e)=>({_hx_index:13,__enum__:"mcl.AstNode",pos:n,body:e,"@kind":"SequenceBlock"}),{_hx_name:"SequenceBlock",__params__:["pos","body"]}),RuntimeLoop:Object.assign((n,e,t)=>({_hx_index:14,__enum__:"mcl.AstNode",pos:n,expression:e,body:t,"@kind":"RuntimeLoop"}),{_hx_name:"RuntimeLoop",__params__:["pos","expression","body"]}),Comment:Object.assign((n,e)=>({_hx_index:15,__enum__:"mcl.AstNode",pos:n,value:e,"@kind":"Comment"}),{_hx_name:"Comment",__params__:["pos","value"]}),JsonFile:Object.assign((n,e,t)=>({_hx_index:16,__enum__:"mcl.AstNode",pos:n,name:e,info:t,"@kind":"JsonFile"}),{_hx_name:"JsonFile",__params__:["pos","name","info"]}),TemplateOverload:Object.assign((n,e,t)=>({_hx_index:17,__enum__:"mcl.AstNode",pos:n,args:e,body:t,"@kind":"TemplateOverload"}),{_hx_name:"TemplateOverload",__params__:["pos","args","body"]}),ClockExpr:Object.assign((n,e,t,i)=>({_hx_index:18,__enum__:"mcl.AstNode",pos:n,name:e,time:t,body:i,"@kind":"ClockExpr"}),{_hx_name:"ClockExpr",__params__:["pos","name","time","body"]}),Execute:Object.assign((n,e,t,i)=>({_hx_index:19,__enum__:"mcl.AstNode",pos:n,command:e,value:t,isMacro:i,"@kind":"Execute"}),{_hx_name:"Execute",__params__:["pos","command","value","isMacro"]}),FunctionCall:Object.assign((n,e,t,i)=>({_hx_index:20,__enum__:"mcl.AstNode",pos:n,name:e,data:t,isMacro:i,"@kind":"FunctionCall"}),{_hx_name:"FunctionCall",__params__:["pos","name","data","isMacro"]}),EqCommand:Object.assign((n,e)=>({_hx_index:21,__enum__:"mcl.AstNode",pos:n,command:e,"@kind":"EqCommand"}),{_hx_name:"EqCommand",__params__:["pos","command"]}),ScheduleCall:Object.assign((n,e,t,i,r)=>({_hx_index:22,__enum__:"mcl.AstNode",pos:n,delay:e,target:t,mode:i,isMacro:r,"@kind":"ScheduleCall"}),{_hx_name:"ScheduleCall",__params__:["pos","delay","target","mode","isMacro"]}),ReturnRun:Object.assign((n,e,t)=>({_hx_index:23,__enum__:"mcl.AstNode",pos:n,value:e,isMacro:t,"@kind":"ReturnRun"}),{_hx_name:"ReturnRun",__params__:["pos","value","isMacro"]}),ScheduleClear:Object.assign((n,e,t)=>({_hx_index:24,__enum__:"mcl.AstNode",pos:n,target:e,isMacro:t,"@kind":"ScheduleClear"}),{_hx_name:"ScheduleClear",__params__:["pos","target","isMacro"]}),Void:{_hx_name:"Void",_hx_index:25,__enum__:"mcl.AstNode","@kind":"Void"},Group:Object.assign(n=>({_hx_index:26,__enum__:"mcl.AstNode",body:n,"@kind":"Group"}),{_hx_name:"Group",__params__:["body"]})};Ae.__constructs__=[Ae.Raw,Ae.FunctionDef,Ae.TemplateDef,Ae.Directory,Ae.Import,Ae.CompileTimeLoop,Ae.CompileTimeIf,Ae.MultiLineScript,Ae.Block,Ae.TickBlock,Ae.LoadBlock,Ae.ExecuteBlock,Ae.ScheduleBlock,Ae.SequenceBlock,Ae.RuntimeLoop,Ae.Comment,Ae.JsonFile,Ae.TemplateOverload,Ae.ClockExpr,Ae.Execute,Ae.FunctionCall,Ae.EqCommand,Ae.ScheduleCall,Ae.ReturnRun,Ae.ScheduleClear,Ae.Void,Ae.Group];Ae.__empty_constructs__=[Ae.Void];var hae=D.$global,Dr=D.global("$hxClasses")["js.Boot"]=s(class ri{static getClass(e){if(e==null)return null;if(e instanceof Array)return Array;{let t=e.__class__;if(t!=null)return t;let i=ri.__nativeClassName(e);return i!=null?ri.__resolveNativeClass(i):null}}static __string_rec(e,t){if(e==null)return"null";if(t.length>=500)return"<...>";let i=typeof e;switch(i=="function"&&(e.__name__||e.__ename__)&&(i="object"),i){case"function":return"";case"object":if(e.__enum__){let c=D.global("$hxEnums")[e.__enum__].__constructs__[e._hx_index],d=c._hx_name;return c.__params__?(t=t+" ",d+"("+function(m){var p;let f=[];{let _=0,g=c.__params__;for(;_0?",":"")+ri.__string_rec(e[m],t)}return u+="]",u}let r;try{r=e.toString}catch{return"???"}if(r!=null&&r!=Object.toString&&typeof r=="function"){let u=e.toString();if(u!="[object Object]")return u}let a=`{ `;t+=" ";let o=e.hasOwnProperty!=null,l=null;for(l in e)o&&!e.hasOwnProperty(l)||l=="prototype"||l=="__class__"||l=="__super__"||l=="__interfaces__"||l=="__properties__"||(a.length!=2&&(a+=`, -`),a+=t+l+" : "+ei.__string_rec(e[l],t));return t=t.substring(1),a+=` -`+t+"}",a;break;case"string":return e;default:return String(e)}}static __interfLoop(e,t){if(e==null)return!1;if(e==t)return!0;let i=e.__interfaces__;if(i!=null&&(e.__super__==null||e.__super__.__interfaces__!=i)){let r=0,a=i.length;for(;r=0&&e=this.array.length)throw new Qn("Tried to read past the end of the token list");let e=this.array,t=this.get_index();return this.set_index(t+1),e[t]}skip(){this.set_index(this.get_index()+1)}peek(){return this.array[this.get_index()]}hasNext(){return this.get_index()0)throw Ee.unreachable(i);return a}else return null}static block(e,t,i,r){i==null&&(i=!0);let a=Ee.expectThenData(e,i);for(;;){if(!e.hasNext())throw new Qn("Unexpected end of file!");let o=e.peek();if(o._hx_index==2){let l=o.pos;r?.(o);break}else t()}return Ee.expect(e,function(o){return o._hx_index==2}),a==""?null:a}static readFunction(e,t,i){let r=[],a=null,o=e.split(" ");return o.length==2?(e=o[0],a=o[1]):o.length==1&&(e=o[0]),Ee.block(t,function(){r.push(Ee.innerParse(t))},!1),xe.FunctionDef(i,e,r,a)}static innerParseTemplate(e){let t=e.peek();if(t._hx_index==0){let i=t.v,r=t.pos;switch(i){case"load":let a=r;e.skip();let o=[];return Ee.block(e,function(){o.push(Ee.innerParse(e))},!1),xe.LoadBlock(a,o);break;case"tick":let l=r;e.skip();let c=[];return Ee.block(e,function(){c.push(Ee.innerParse(e))},!1),xe.TickBlock(l,c);break;default:let u=i,d=r;if(u=="with"||u.startsWith("with ")){e.skip();let m=yt.trim(u.substring(5)),p=[];return Ee.block(e,function(){p.push(Ee.innerParse(e))},!1),xe.TemplateOverload(d,m,p)}else throw Ee.unreachable(e.next())}}else throw Ee.unreachable(e.next())}static readTemplate(e,t,i){let r=[];return Ee.block(t,function(){r.push(Ee.innerParseTemplate(t))},!1),xe.TemplateDef(i,e,r)}static pos(e){switch(e._hx_index){case 0:let t=e.v;return e.pos;case 1:let r=e.data;return e.pos;case 2:return e.pos}}static json(e){let t=Ee.pos(e.peek()),i=0,r="";do{if(!e.hasNext())throw new Qn("Unexpected end of file!");let a=e.next();switch(a._hx_index){case 0:let o=a.pos,l=a.v;r+=l;break;case 1:let c=a.pos,u=a.data;r+="{",r+=u,++i;break;case 2:let d=a.pos;--i,r+="}";break}}while(i>0);return xe.Raw(t,r,[],!1)}static parseMcbFile(e){let t=new Xa(e),i=[];for(;t.hasNext();)i.push(Ee.parseTLD(t));return i}static parseMcbtFile(e){let t=new Xa(e),i=[];for(;t.hasNext();){let r=t.next(),a;if(r._hx_index==0){let o=r.v,l=r.pos;if(o.startsWith("template ")){let c=yt.trim(o.substring(9));a=Ee.readTemplate(c,t,l)}else if(o.startsWith("#"))a=xe.Comment(l,o);else if(o.startsWith("import "))a=xe.Import(l,o.substring(7));else throw Ee.unreachable(r)}else throw Ee.unreachable(r);i.push(a)}return i}static parserCompilerLoop(e,t,i,r){let a=[];if(Ee.block(i,function(){a.push(r())}),Ee.loopRegExp.match(e)){let o=Ee.loopRegExp.matched(1),l=Ee.loopRegExp.matched(2);return xe.CompileTimeLoop(t,o,l,a)}return xe.CompileTimeLoop(t,e,null,a)}static parseTLD(e){let t=e.next();if(t._hx_index==0){let i=t.v,r=t.pos;if(i.startsWith("function ")){let a=yt.trim(i.substring(9));return Ee.readFunction(a,e,r)}else if(i.startsWith("clock ")){let a=yt.trim(i.substring(6));if(a.indexOf(" ")==-1)throw new Qn(Ee.format('"Expected a name and a time for the clock command" at {}:{}:{}',r.file,r.line,r.col));let o=yt.trim(a.substring(0,a.indexOf(" ")+1));a=yt.trim(a.substring(a.indexOf(" ")));let l=[];return Ee.block(e,function(){l.push(Ee.innerParse(e))}),xe.ClockExpr(r,o,a,l)}else{if(i.startsWith("import "))return xe.Import(r,i.substring(7));if(i.startsWith("dir ")&&e.peek()._hx_index==1){let a=[];if(Ee.block(e,function(){a.push(Ee.parseTLD(e))},!1)!=null)throw Ee.unreachable(Sn.Literal(i,r));return xe.Directory(r,i.substring(4),a)}else if(i.startsWith("<%%")){let a=[];for(;;){if(!e.hasNext())throw new Qn("Unexpected end of file!");let o=e.peek();if(o._hx_index==0){let l=o.pos;if(o.v=="%%>"){e.skip();break}}a.push(e.next())}return xe.MultiLineScript(r,a)}else{if(i.startsWith("#"))return xe.Comment(r,i);if(i.startsWith("REPEAT"))return Ee.parserCompilerLoop(i,r,e,function(){return Ee.parseTLD(e)});if(i.startsWith("IF"))return Ee.parseCompileTimeIf(i,r,e,function(){return Ee.parseTLD(e)});if(i.startsWith("tag ")){let a=yt.trim(i.substring(4)).split(" "),o=a.shift(),l=a.shift(),c=a.shift()=="replace",u=[];return Ee.block(e,function(){u.push(Ee.innerParse(e))}),xe.JsonFile(r,l,Vt.Tag(o,c,u))}else{if(i.startsWith("advancement ")||i.startsWith("enchantment ")||i.startsWith("item_modifier ")||i.startsWith("loot_table ")||i.startsWith("predicate ")||i.startsWith("recipe ")||i.startsWith("chat_type ")||i.startsWith("damage_type ")||i.startsWith("dimension ")||i.startsWith("dimension_type "))return Ee.readPlainJsonFile(i,r,e);if(i.startsWith("worldgen ")){let a=yt.trim(i.substring(9)),o=a.substring(0,a.indexOf(" "));a=a.substring(a.indexOf(" ")+1);let l=[];return Ee.block(e,function(){l.push(Ee.innerParse(e))}),xe.JsonFile(r,a,Vt.WorldGen(o,a,l))}else throw Ee.unreachable(Sn.Literal(i,r))}}}}else{let i=t;throw Ee.unreachable(i)}}static readPlainJsonFile(e,t,i){let r=[],a=0,o=e.split(" ");for(;a"){e.skip();break}}d.push(e.next())}return xe.MultiLineScript(r,d)}else{if(i.startsWith("IF"))return Ee.parseCompileTimeIf(i,r,e,function(){return Ee.innerParse(e)});if(i.startsWith("function ")){let d=i.substring(9),m=d.indexOf(" "),p=d.substring(0,m==-1?d.length:m),f=d.substring(p.length+1);return xe.FunctionCall(r,p,f,a)}else if(i.startsWith("schedule ")){let d=yt.trim(i.substring(9));if(d.startsWith("function ")){let v=d.substring(9),g=v.indexOf(" "),h=v.substring(0,g==-1?v.length:g),b=g==-1?null:v.substring(h.length+1),x="replace";if(b.endsWith(" append")&&(x="append",b=b.substring(0,b.length-7)),b.endsWith(" replace")&&(x="replace",b=b.substring(0,b.length-8)),b==null)throw new Qn(Ee.format('"Expected delay after function name in schedule command" at {}:{}:{}',r.file,r.line,r.col));return xe.ScheduleCall(r,b,h,x,a)}if(d.startsWith("clear "))return xe.ScheduleClear(r,d.substring(6),a);let m=d.indexOf(" "),p=m==-1?d:d.substring(0,m),f="append";p.endsWith(" append")&&(f="append",p=p.substring(0,p.length-7)),p.endsWith(" replace")&&(f="replace",p=p.substring(0,p.length-8));let _=[];if(e.peek()._hx_index!=1)throw new Qn("Expected { after delay in schedule block command");return Ee.block(e,function(){_.push(Ee.innerParse(e))}),xe.ScheduleBlock(r,p,f,_,a)}else if(i.startsWith("execute")&&(i.charAt(7)==" "||i.charAt(7)=="<"))if(e.hasNext()&&e.peek()._hx_index==1){let d=[];if(!i.endsWith("run")&&Ee.executeRegExp.match(i)){let f=Ee.executeRegExp.matchedPos(),_={file:r.file,line:r.line,col:r.col+f.pos+f.len},v=Sn.Literal(yt.ltrim(i.substring(f.pos+f.len)),_);return e.insert(v),xe.Execute(r,yt.rtrim(i.substring(0,f.pos+3)),Ee.innerParse(e),a)}let m=Ee.block(e,function(){d.push(Ee.innerParse(e))}),p=[];e:for(;;){if(!e.hasNext())throw new Qn("Unexpected end of file!");let f=e.peek();if(f._hx_index==0){let _=f.v,v=f.pos;switch(_){case"else $run":let g=v;e.skip();let h=[],b=Ee.block(e,function(){h.push(Ee.innerParse(e))});p.push(xe.Block(g,null,h,b,!0,!1));break;case"else run":let x=v;e.skip();let y=[],k=Ee.block(e,function(){y.push(Ee.innerParse(e))});p.push(xe.Block(x,null,y,k,!1,!1));break;default:let C=_,A=v;if(C.startsWith("else $")&&C.endsWith("run")){e.skip();let I=yt.trim(C.substring(6)),S=[],L=Ee.block(e,function(){S.push(Ee.innerParse(e))});A.col+=5,p.push(xe.ExecuteBlock(A,I,L,S,null,!0))}else{let I=_,S=v;if(I.startsWith("else ")&&I.endsWith("run")){e.skip();let L=yt.trim(I.substring(5)),O=[],E=Ee.block(e,function(){O.push(Ee.innerParse(e))});S.col+=5,p.push(xe.ExecuteBlock(S,L,E,O,null,!1))}else break e}}}else break}return xe.ExecuteBlock(r,i,m,d,p.length>0?p:null,a)}else{if(!Ee.executeRegExp.match(i))return Ee.readRaw(r,i,e,a);let d=Ee.executeRegExp.matchedPos(),m={file:r.file,line:r.line,col:r.col+d.pos+d.len},p=Sn.Literal(yt.ltrim(i.substring(d.pos+d.len)),m);return e.insert(p),xe.Execute(r,yt.rtrim(i.substring(0,d.pos+3)),Ee.innerParse(e),a)}else{if(i.startsWith("REPEAT"))return Ee.parserCompilerLoop(i,r,e,function(){return Ee.innerParse(e)});if(i.startsWith("#"))return xe.Comment(r,i);if(i=="block"||i.startsWith("block ")){let d=yt.trim(i.substring(6)),m=[],p=Ee.block(e,function(){m.push(Ee.innerParse(e))});return xe.Block(r,d,m,p,a,!1)}else if(i.startsWith("return run")){let d=yt.trim(i.substring(11)),m={file:r.file,line:r.line,col:r.col+11},p=e.peek();if(p._hx_index==1){let f=p.pos,_=p.data,v=[],g=Ee.block(e,function(){v.push(Ee.innerParse(e))});return xe.ReturnRun(f,xe.Block(f,null,v,g,!1,!1),a)}else return e.back(),e.update(Sn.Literal(d,m)),xe.ReturnRun(m,Ee.innerParse(e),a)}else if(i=="tick"){let d=[];return Ee.block(e,function(){d.push(Ee.innerParse(e))},!1),xe.TickBlock(r,d)}else if(i=="load"){let d=[];return Ee.block(e,function(){d.push(Ee.innerParse(e))},!1),xe.LoadBlock(r,d)}else return i.startsWith("eq ")?xe.EqCommand(r,i.substring(3)):Ee.readRaw(r,i,e,a)}}break;case 1:let o=t.data,l=t.pos,c=[],u=Ee.block(e,function(){c.push(Ee.innerParse(e))});return xe.Block(l,null,c,u,!1,!1);default:throw Ee.unreachable(t)}}static readRaw(e,t,i,r){if(!i.hasNext())return xe.Raw(e,t,[],r);let a=[],o=e.line;e:for(;;){if(!i.hasNext())throw new Qn("Unexpected end of file!");let l=i.peek();switch(l._hx_index){case 0:let c=l.v,u=l.pos;if(u.line==o)i.skip(),a.push(xe.Raw(u,c,[],!1));else break e;break;case 1:let d=l.pos,m=l.data;if(d.line==o){let f=[],_=Ee.block(i,function(){f.push(Ee.innerParse(i))});a.push(xe.Block(d,null,f,_,!1,!1))}else break e;break;case 2:let p=l.pos;if(p.line==o)throw Ee.unreachable(Sn.Literal(t,p));break e;default:break e}}return xe.Raw(e,t,a,r)}static parseCompileTimeIf(e,t,i,r){let a=yt.trim(e.substring(2)),o=[];Ee.block(i,function(){o.push(r())},!1);let l=[];for(;;){if(!i.hasNext())throw new Qn("Unexpected end of file!");let c=i.peek();if(c._hx_index==0){let u=c.v,d=c.pos;if(u=="ELSE"||u.startsWith("ELSE ")){i.skip();let m=u=="ELSE"?null:yt.trim(u.substring(5));m!=null?m.startsWith("IF")&&(m=yt.trim(m.substring(2))):m=null;let p=[];Ee.block(i,function(){p.push(r())},!1),l.push({condition:m,node:p})}else break}else break}return xe.CompileTimeIf(t,a,o,l)}static get __name__(){return"mcl.Parser"}get __class__(){return Ee}},"Parser");qt.loopRegExp=new $r("(REPEAT\\s*\\(.+?\\))\\s\\s*as\\s\\s*([a-zA-Z]+)","");qt.executeRegExp=new $r("\\b(run\\s+?)\\b","");var Rie=M.$global,ot=M.global("$hxEnums")["haxpression.ValueType"]={__ename__:"haxpression.ValueType",VFloat:Object.assign(n=>({_hx_index:0,__enum__:"haxpression.ValueType",v:n,"@kind":"VFloat"}),{_hx_name:"VFloat",__params__:["v"]}),VInt:Object.assign(n=>({_hx_index:1,__enum__:"haxpression.ValueType",v:n,"@kind":"VInt"}),{_hx_name:"VInt",__params__:["v"]}),VBool:Object.assign(n=>({_hx_index:2,__enum__:"haxpression.ValueType",v:n,"@kind":"VBool"}),{_hx_name:"VBool",__params__:["v"]}),VString:Object.assign(n=>({_hx_index:3,__enum__:"haxpression.ValueType",v:n,"@kind":"VString"}),{_hx_name:"VString",__params__:["v"]}),VNA:{_hx_name:"VNA",_hx_index:4,__enum__:"haxpression.ValueType","@kind":"VNA"},VNM:{_hx_name:"VNM",_hx_index:5,__enum__:"haxpression.ValueType","@kind":"VNM"}};ot.__constructs__=[ot.VFloat,ot.VInt,ot.VBool,ot.VString,ot.VNA,ot.VNM];ot.__empty_constructs__=[ot.VNA,ot.VNM];var Lie=M.$global,Xe=M.global("$hxClasses")["haxpression.utils.Chars"]=s(class _i{static isDecimalDigit(e){return e>=48?e<=57:!1}static isUpperCaseLetter(e){return e>=65?e<=90:!1}static isLowerCaseLetter(e){return e>=97?e<=122:!1}static isIdentifierStart(e){return e==_i.DOLLAR_CODE||e==_i.UNDERSCORE_CODE||_i.isUpperCaseLetter(e)||_i.isLowerCaseLetter(e)?!0:_i.OTHER_IDENTIFIER_START_CODES.includes(e)}static isIdentifierPart(e){return _i.isIdentifierStart(e)||_i.isDecimalDigit(e)?!0:_i.OTHER_IDENTIFIER_PART_CODES.includes(e)}static isWhiteSpace(e){return e==_i.TAB_CODE||e==_i.LF_CODE||e==_i.CR_CODE?!0:e==_i.SPACE_CODE}static get __name__(){return"haxpression.utils.Chars"}get __class__(){return _i}},"Chars");Xe.TAB_CODE=9;Xe.LF_CODE=10;Xe.CR_CODE=13;Xe.SPACE_CODE=32;Xe.EXCLAMATION_POINT_CODE=33;Xe.DOUBLE_QUOTE_CODE=34;Xe.DOLLAR_CODE=36;Xe.SINGLE_QUOTE_CODE=39;Xe.OPEN_PAREN_CODE=40;Xe.CLOSE_PAREN_CODE=41;Xe.COMMA_CODE=44;Xe.PERIOD_CODE=46;Xe.COLON_CODE=58;Xe.SEMICOLON_CODE=59;Xe.QUESTION_MARK_CODE=63;Xe.OPEN_BRACKET_CODE=91;Xe.CLOSE_BRACKET_CODE=93;Xe.UNDERSCORE_CODE=95;Xe.OTHER_IDENTIFIER_START_CODES=[];Xe.OTHER_IDENTIFIER_PART_CODES=[Xe.EXCLAMATION_POINT_CODE,Xe.DOLLAR_CODE,Xe.COLON_CODE];var Uie=M.$global,Vu=M.global("$hxClasses")["haxpression.utils.Iterators"]=s(class pv{static toArray(e){let t=[],i=e;for(;i.hasNext();){let r=i.next();t.push(r)}return t}static get __name__(){return"haxpression.utils.Iterators"}get __class__(){return pv}},"Iterators");var $ie=M.$global,is=M.global("$hxClasses")["haxpression.utils.Arrays"]=s(class _v{static all(e,t){let i=[],r=0,a=e;for(;re?t.length:e},0)}static wrapOperation(e){return function(t){return we.isNA(t)?we.fromValueType(ot.VNA):we.isNM(t)?we.fromValueType(ot.VNM):e(t)}}static get __name__(){return"haxpression.UnaryOperations"}get __class__(){return Ya}},"UnaryOperations");sr.map=new We,sr.addOperator("-",function(n){return we.fromFloat(we.toFloat(n)*-1)}),sr.addOperator("+",function(n){return we.fromFloat(we.toFloat(n))}),sr.addOperator("!",function(n){return we.fromBool(!we.toBool(n))}),sr.addOperator("~",function(n){return we.fromInt(~we.toInt(n))});var hre=M.$global,Fe=M.global("$hxEnums")["haxpression.ExpressionType"]={__ename__:"haxpression.ExpressionType",ELiteral:Object.assign(n=>({_hx_index:0,__enum__:"haxpression.ExpressionType",value:n,"@kind":"ELiteral"}),{_hx_name:"ELiteral",__params__:["value"]}),EIdentifier:Object.assign(n=>({_hx_index:1,__enum__:"haxpression.ExpressionType",name:n,"@kind":"EIdentifier"}),{_hx_name:"EIdentifier",__params__:["name"]}),EUnary:Object.assign((n,e)=>({_hx_index:2,__enum__:"haxpression.ExpressionType",operator2:n,operand:e,"@kind":"EUnary"}),{_hx_name:"EUnary",__params__:["operator2","operand"]}),EBinary:Object.assign((n,e,t)=>({_hx_index:3,__enum__:"haxpression.ExpressionType",operator2:n,left:e,right:t,"@kind":"EBinary"}),{_hx_name:"EBinary",__params__:["operator2","left","right"]}),ECall:Object.assign((n,e)=>({_hx_index:4,__enum__:"haxpression.ExpressionType",callee:n,arguments:e,"@kind":"ECall"}),{_hx_name:"ECall",__params__:["callee","arguments"]}),EConditional:Object.assign((n,e,t)=>({_hx_index:5,__enum__:"haxpression.ExpressionType",test:n,consequent:e,alternate:t,"@kind":"EConditional"}),{_hx_name:"EConditional",__params__:["test","consequent","alternate"]}),EArray:Object.assign(n=>({_hx_index:6,__enum__:"haxpression.ExpressionType",items:n,"@kind":"EArray"}),{_hx_name:"EArray",__params__:["items"]}),ECompound:Object.assign(n=>({_hx_index:7,__enum__:"haxpression.ExpressionType",items:n,"@kind":"ECompound"}),{_hx_name:"ECompound",__params__:["items"]})};Fe.__constructs__=[Fe.ELiteral,Fe.EIdentifier,Fe.EUnary,Fe.EBinary,Fe.ECall,Fe.EConditional,Fe.EArray,Fe.ECompound];Fe.__empty_constructs__=[];var xre=M.$global,Ci=M.global("$hxClasses")["haxpression.ExpressionTypes"]=s(class hv{static canEvaluateAll(e){return is.all(e,function(t){return pt.canEvaluate(pt.fromExpressionType(t))})}static simplify(e){let t=new Array(e.length),i=0,r=e.length;for(;i=0&&i!=t.length?!1:Ci.canEvaluateAll(t)}static evaluate(e,t){return Ji.getFunction(e)(t)}static wrapOperation(e,t,i){return function(r){if(t>=0&&r.length!=t)throw ce.thrown(new Ct("function "+e+" expects exactly "+t+" argument(s)"));return i(r)}}static get __name__(){return"haxpression.CallOperations"}get __class__(){return Ji}},"CallOperations");Wt.map=new We,Wt.addFunction("abs",1,function(n){return we.fromFloat(Math.abs(we.toFloat(n[0])))}),Wt.addFunction("acos",1,function(n){return we.fromFloat(Math.acos(we.toFloat(n[0])))}),Wt.addFunction("asin",1,function(n){return we.fromFloat(Math.asin(we.toFloat(n[0])))}),Wt.addFunction("atan",1,function(n){return we.fromFloat(Math.atan(we.toFloat(n[0])))}),Wt.addFunction("atan2",2,function(n){return we.fromFloat(Math.atan2(we.toFloat(n[0]),we.toFloat(n[1])))}),Wt.addFunction("ceil",1,function(n){return we.fromInt(Math.ceil(we.toFloat(n[0])))}),Wt.addFunction("cos",1,function(n){return we.fromFloat(Math.cos(we.toFloat(n[0])))}),Wt.addFunction("exp",1,function(n){return we.fromFloat(Math.exp(we.toFloat(n[0])))}),Wt.addFunction("fceil",1,function(n){return we.fromFloat(Math.ceil(we.toFloat(n[0])))}),Wt.addFunction("ffloor",1,function(n){return we.fromFloat(Math.floor(we.toFloat(n[0])))}),Wt.addFunction("floor",1,function(n){return we.fromInt(Math.floor(we.toFloat(n[0])))}),Wt.addFunction("fround",1,function(n){return we.fromFloat(Math.round(we.toFloat(n[0])))}),Wt.addFunction("log",1,function(n){return we.fromFloat(Math.log(we.toFloat(n[0])))}),Wt.addFunction("max",2,function(n){return we.fromFloat(Math.max(we.toFloat(n[0]),we.toFloat(n[1])))}),Wt.addFunction("min",2,function(n){return we.fromFloat(Math.min(we.toFloat(n[0]),we.toFloat(n[1])))}),Wt.addFunction("pow",2,function(n){return we.fromFloat(Math.pow(we.toFloat(n[0]),we.toFloat(n[1])))}),Wt.addFunction("random",0,function(n){return we.fromFloat(Math.random())}),Wt.addFunction("rand",0,function(n){return we.fromFloat(Math.random())}),Wt.addFunction("round",1,function(n){return we.fromInt(Math.round(we.toFloat(n[0])))}),Wt.addFunction("sin",1,function(n){return we.fromFloat(Math.sin(we.toFloat(n[0])))}),Wt.addFunction("sqrt",1,function(n){return we.fromFloat(Math.sqrt(we.toFloat(n[0])))}),Wt.addFunction("tan",1,function(n){return we.fromFloat(Math.tan(we.toFloat(n[0])))});var zre=M.$global,zt=M.global("$hxClasses")["haxpression.BinaryOperations"]=s(class pa{static evaluate(e,t,i){return pa.map.inst.get(e).operation(t,i)}static addOperator(e,t,i){let r=pa.map,a={precedence:t,operation:pa.wrapOperation(i)};r.inst.set(e,a)}static hasOperator(e){return pa.map.inst.has(e)}static getOperatorPrecedence(e){return pa.map.inst.get(e).precedence}static getMaxOperatorLength(){return is.reduce(Vu.toArray(jt.adaptIterator(pa.map.inst.keys())),function(e,t){return t.length>e?t.length:e},0)}static wrapOperation(e){return function(t,i){return we.isNA(t)||we.isNA(i)?we.fromValueType(ot.VNA):we.isNM(t)||we.isNM(i)?we.fromValueType(ot.VNM):e(t,i)}}static get __name__(){return"haxpression.BinaryOperations"}get __class__(){return pa}},"BinaryOperations");zt.map=new We,zt.addOperator("||",1,function(n,e){return we.fromBool(we.toBool(n)||we.toBool(e))}),zt.addOperator("&&",2,function(n,e){return we.fromBool(we.toBool(n)&&we.toBool(e))}),zt.addOperator("|",3,function(n,e){return we.fromInt(we.toInt(n)|we.toInt(e))}),zt.addOperator("^",4,function(n,e){return we.fromInt(we.toInt(n)^we.toInt(e))}),zt.addOperator("&",5,function(n,e){return we.fromInt(we.toInt(n)&we.toInt(e))}),zt.addOperator("==",6,function(n,e){return we.fromBool(we.toFloat(n)==we.toFloat(e))}),zt.addOperator("!=",6,function(n,e){return we.fromBool(we.toFloat(n)!=we.toFloat(e))}),zt.addOperator("<",7,function(n,e){return we.fromBool(we.toFloat(n)",7,function(n,e){return we.fromBool(we.toFloat(n)>we.toFloat(e))}),zt.addOperator("<=",7,function(n,e){return we.fromBool(we.toFloat(n)<=we.toFloat(e))}),zt.addOperator(">=",7,function(n,e){return we.fromBool(we.toFloat(n)>=we.toFloat(e))}),zt.addOperator("<<",8,function(n,e){return we.fromInt(we.toInt(n)<>",8,function(n,e){return we.fromInt(we.toInt(n)>>we.toInt(e))}),zt.addOperator(">>>",8,function(n,e){return we.fromInt(we.toInt(n)>>>we.toInt(e))}),zt.addOperator("+",9,function(n,e){return we.fromFloat(we.toFloat(n)+we.toFloat(e))}),zt.addOperator("-",9,function(n,e){return we.fromFloat(we.toFloat(n)-we.toFloat(e))}),zt.addOperator("*",10,function(n,e){return we.fromFloat(we.toFloat(n)*we.toFloat(e))}),zt.addOperator("/",10,function(n,e){return we.fromFloat(we.toFloat(n)/we.toFloat(e))}),zt.addOperator("%",10,function(n,e){return we.fromFloat(we.toFloat(n)%we.toFloat(e))}),zt.addOperator("**",11,function(n,e){return we.fromFloat(Math.pow(we.toFloat(n),we.toFloat(e)))});var tae=M.$global,pt=M.global("$hxClasses")["haxpression._Expression.Expression"]=s(class Oe{static fromExpressionType(e){return e}static toExpressionType(e){return e}static simplify(e){switch(e._hx_index){case 0:let t=e.value;return Oe.fromExpressionType(Fe.ELiteral(t));case 1:let i=e.name;return Oe.fromExpressionType(Fe.EIdentifier(i));case 2:let r=e.operator2,a=e.operand;return Oe.canEvaluate(Oe.fromExpressionType(a))?Oe.fromExpressionType(Fe.ELiteral(we.toValueType(sr.evaluate(r,Oe.evaluate(Oe.fromExpressionType(a)))))):Oe.fromExpressionType(Fe.EUnary(r,Oe.toExpressionType(Oe.simplify(Oe.fromExpressionType(a)))));case 3:let o=e.operator2,l=e.left,c=e.right;return Oe.canEvaluate(Oe.fromExpressionType(l))&&Oe.canEvaluate(Oe.fromExpressionType(c))?Oe.fromExpressionType(Fe.ELiteral(we.toValueType(zt.evaluate(o,Oe.evaluate(Oe.fromExpressionType(l)),Oe.evaluate(Oe.fromExpressionType(c)))))):Oe.fromExpressionType(Fe.EBinary(o,Oe.toExpressionType(Oe.simplify(Oe.fromExpressionType(l))),Oe.toExpressionType(Oe.simplify(Oe.fromExpressionType(c)))));case 4:let u=e.callee,d=e.arguments;return Ci.canEvaluateAll(d)?Oe.fromExpressionType(Fe.ELiteral(we.toValueType(Wt.evaluate(u,Ci.evaluate(d))))):Oe.fromExpressionType(Fe.ECall(u,Ci.simplify(d)));case 5:let m=e.test,p=e.consequent,f=e.alternate;return Oe.canEvaluate(Oe.fromExpressionType(m))?we.toBool(Oe.evaluate(Oe.fromExpressionType(m)))?Oe.simplify(Oe.fromExpressionType(p)):Oe.simplify(Oe.fromExpressionType(f)):Oe.fromExpressionType(Fe.EConditional(Oe.toExpressionType(Oe.simplify(Oe.fromExpressionType(m))),Oe.toExpressionType(Oe.simplify(Oe.fromExpressionType(p))),Oe.toExpressionType(Oe.simplify(Oe.fromExpressionType(f)))));case 6:let _=e.items;return Oe.fromExpressionType(Fe.EArray(Ci.simplify(_)));case 7:let v=e.items;return Oe.fromExpressionType(Fe.ECompound(Ci.simplify(v)))}}static canEvaluate(e){switch(e._hx_index){case 0:let t=e.value;return!0;case 1:let i=e.name;return!1;case 2:let r=e.operator2,a=e.operand;return Oe.canEvaluate(Oe.fromExpressionType(a));case 3:let o=e.operator2,l=e.left,c=e.right;return Oe.canEvaluate(Oe.fromExpressionType(l))?Oe.canEvaluate(Oe.fromExpressionType(c)):!1;case 4:let u=e.callee,d=e.arguments;return Wt.canEvaluate(u,d);case 5:let m=e.test,p=e.consequent,f=e.alternate;return Oe.canEvaluate(Oe.fromExpressionType(m))?we.toBool(Oe.evaluate(Oe.fromExpressionType(m)))?Oe.canEvaluate(Oe.fromExpressionType(p)):Oe.canEvaluate(Oe.fromExpressionType(f)):!1;case 6:let _=e.items;return Ci.canEvaluateAll(_);case 7:let v=e.items;return Ci.canEvaluateAll(v)}}static evaluate(e,t){switch(t==null&&(t=new We),e._hx_index){case 0:let i=e.value;return we.fromValueType(i);case 1:let r=e.name;if(!t.inst.has(r))throw ce.thrown(new Ct("cannot evaluate expression with unset variable: "+r));return t.inst.get(r);case 2:let a=e.operator2,o=e.operand,l=Oe.evaluate(Oe.fromExpressionType(o),t);return sr.evaluate(a,l);case 3:let c=e.operator2,u=e.left,d=e.right,m=Oe.evaluate(Oe.fromExpressionType(u),t),p=Oe.evaluate(Oe.fromExpressionType(d),t);return zt.evaluate(c,m,p);case 4:let f=e.callee,_=e.arguments;return Wt.evaluate(f,Ci.evaluate(_,t));case 5:let v=e.test,g=e.consequent,h=e.alternate;return we.toBool(Oe.evaluate(Oe.fromExpressionType(v),t))?Oe.evaluate(Oe.fromExpressionType(g),t):Oe.evaluate(Oe.fromExpressionType(h),t);case 6:let b=e.items;if(b.length==0)return we.fromValueType(ot.VNA);{let y=Ci.evaluate(b,t);return y[y.length-1]}break;case 7:let x=e.items;if(x.length==0)return we.fromValueType(ot.VNA);{let y=Ci.evaluate(x,t);return y[y.length-1]}break}}static isCompound(e){let t=Oe.toExpressionType(e);if(t._hx_index==7){let i=t.items;return!0}else return!1}static get __name__(){return"haxpression._Expression.Expression_Impl_"}get __class__(){return Oe}},"Expression");var pae=M.$global,bv=M.global("$hxClasses")["haxpression.Parser"]=s(class $m extends M.inherits(){new(e){this.inputString=e,this.index=0,this.length=e.length,this.expressions=[]}internalParse(){for(;this.index0;){if(zt.hasOperator(e))return this.index+=t,e;--t,e=Qe.substr(e,0,t)}return null}gobbleBinaryExpression(){let e,t,i,r,a,o,l,c=this.gobbleToken(),u=this.gobbleBinaryOperator();if(u==null)return c;let d={op:u,precedence:zt.getOperatorPrecedence(u)},m=this.gobbleToken();if(m==null)throw ce.thrown(new Ct('expected expression after binary op: "'+u+'"',this.inputString,this.index));let p=[c,d,m];for(;u=this.gobbleBinaryOperator(),!(u==null||(r=zt.getOperatorPrecedence(u),r==0));){for(d={op:u,precedence:r};p.length>2&&r<=p[p.length-2].precedence;){m=p.pop(),u=p.pop().op,c=p.pop();let _=Fe.EBinary(u,pt.toExpressionType(c),pt.toExpressionType(m));p.push(_)}if(t=this.gobbleToken(),t==null)throw ce.thrown(new Ct('expected expression after binary op: "'+u+'"',this.inputString,this.index));p.push(d),p.push(t)}let f=p.length-1;for(t=p[f];f>1;)t=pt.fromExpressionType(Fe.EBinary(p[f-1].op,p[f-2],pt.toExpressionType(t))),f-=2;return t}gobbleToken(){this.gobbleSpaces();let e=this.charCodeAt(this.index);if(Xe.isDecimalDigit(e)||e==Xe.PERIOD_CODE)return this.gobbleNumericLiteral();if(e==Xe.SINGLE_QUOTE_CODE||e==Xe.DOUBLE_QUOTE_CODE)return this.gobbleStringLiteral();if(Xe.isIdentifierStart(e)||e==Xe.OPEN_PAREN_CODE)return this.gobbleVariable();if(e==Xe.OPEN_BRACKET_CODE)return this.gobbleArray();{let t=Qe.substr(this.inputString,this.index,sr.getMaxOperatorLength()),i=t.length;for(;i>0;){if(sr.hasOperator(t))return this.index+=i,pt.fromExpressionType(Fe.EUnary(t,pt.toExpressionType(this.gobbleToken())));--i,t=Qe.substr(t,0,i)}return null}}gobbleNumericLiteral(){let e="";for(;this.index=this.length)return pt.fromExpressionType(Fe.ELiteral(ot.VFloat(parseFloat(e))));let i=this.charCodeAt(this.index);if(Xe.isIdentifierStart(i))throw ce.thrown(new Ct('variable names cannot start with a number: "'+e+this.charAt(this.index)+'"',this.inputString,this.index));if(i==Xe.PERIOD_CODE)throw ce.thrown(new Ct('unexpected period in numeric literal: "'+e+this.charAt(this.index)+'"',this.inputString,this.index));return pt.fromExpressionType(Fe.ELiteral(ot.VFloat(parseFloat(e))))}gobbleStringLiteral(){let e="",t=this.charAt(this.index++),i=!1;for(;this.index({_hx_index:0,__enum__:"mcl.FlattenedType",value:n,"@kind":"FLiteral"}),{_hx_name:"FLiteral",__params__:["value"]}),FIdentifier:Object.assign(n=>({_hx_index:1,__enum__:"mcl.FlattenedType",name:n,"@kind":"FIdentifier"}),{_hx_name:"FIdentifier",__params__:["name"]}),FUnary:Object.assign((n,e)=>({_hx_index:2,__enum__:"mcl.FlattenedType",operant:n,operand:e,"@kind":"FUnary"}),{_hx_name:"FUnary",__params__:["operant","operand"]}),FBinary:Object.assign((n,e,t)=>({_hx_index:3,__enum__:"mcl.FlattenedType",operant:n,left:e,right:t,"@kind":"FBinary"}),{_hx_name:"FBinary",__params__:["operant","left","right"]}),FAdd:Object.assign(n=>({_hx_index:4,__enum__:"mcl.FlattenedType",item:n,"@kind":"FAdd"}),{_hx_name:"FAdd",__params__:["item"]}),FMul:Object.assign(n=>({_hx_index:5,__enum__:"mcl.FlattenedType",item:n,"@kind":"FMul"}),{_hx_name:"FMul",__params__:["item"]}),FCall:Object.assign((n,e)=>({_hx_index:6,__enum__:"mcl.FlattenedType",callee:n,args:e,"@kind":"FCall"}),{_hx_name:"FCall",__params__:["callee","args"]}),FConditional:Object.assign((n,e,t)=>({_hx_index:7,__enum__:"mcl.FlattenedType",test:n,consequent:e,alternate:t,"@kind":"FConditional"}),{_hx_name:"FConditional",__params__:["test","consequent","alternate"]}),FArray:Object.assign(n=>({_hx_index:8,__enum__:"mcl.FlattenedType",items:n,"@kind":"FArray"}),{_hx_name:"FArray",__params__:["items"]}),FCompound:Object.assign(n=>({_hx_index:9,__enum__:"mcl.FlattenedType",items:n,"@kind":"FCompound"}),{_hx_name:"FCompound",__params__:["items"]})};dn.__constructs__=[dn.FLiteral,dn.FIdentifier,dn.FUnary,dn.FBinary,dn.FAdd,dn.FMul,dn.FCall,dn.FConditional,dn.FArray,dn.FCompound];dn.__empty_constructs__=[];var vv=M.global("$hxClasses")["mcl.McMath"]=s(class ct{static flatten(e){switch(e._hx_index){case 0:let t=e.value;return dn.FLiteral(t);case 1:let i=e.name;return dn.FIdentifier(i);case 2:let r=e.operator2,a=e.operand;return dn.FUnary(r,ct.flatten(a));case 3:let o=e.operator2,l=e.left,c=e.right;if(o=="+"){let E=new Array,B=0,H=null;return H=s(function(ee){switch(ee._hx_index){case 0:let ae=ee.value;switch(ae._hx_index){case 0:let ne=ae.v;ne==Math.floor(ne)?B+=Math.floor(ne):E.push(ct.flatten(ee));break;case 1:let ve=ae.v;B+=ve;break;default:E.push(ct.flatten(ee))}break;case 3:if(ee.operator2=="+"){let ne=ee.left,ve=ee.right;H(ne),H(ve)}else E.push(ct.flatten(ee));break;default:E.push(ct.flatten(ee))}},"flattenAdd"),H(e),B!=0&&E.push(dn.FLiteral(ot.VInt(B))),dn.FAdd(E)}if(o=="*"){let E=new Array,B=1,H=null;return H=s(function(ee){switch(ee._hx_index){case 0:let ae=ee.value;switch(ae._hx_index){case 0:let ne=ae.v;ne==Math.floor(ne)?B*=Math.floor(ne):E.push(ct.flatten(ee));break;case 1:let ve=ae.v;B*=ve;break;default:E.push(ct.flatten(ee))}break;case 3:if(ee.operator2=="*"){let ne=ee.left,ve=ee.right;H(ne),H(ve)}else E.push(ct.flatten(ee));break;default:E.push(ct.flatten(ee))}},"flattenMul"),H(e),B!=1&&E.push(dn.FLiteral(ot.VInt(B))),dn.FMul(E)}return dn.FBinary(o,ct.flatten(l),ct.flatten(c));case 4:let u=e.callee,d=e.arguments,m=ct.flatten,p=new Array(d.length),f=0,_=d.length;for(;f<_;){let E=f++;p[E]=m(d[E])}return dn.FCall(u,p);case 5:let v=e.test,g=e.consequent,h=e.alternate;return dn.FConditional(ct.flatten(v),ct.flatten(g),ct.flatten(h));case 6:let b=e.items,x=ct.flatten,y=new Array(b.length),k=0,C=b.length;for(;k=97&&C<=122||C>=65&&C<=90||C>=48&&C<=57||C==46||C==95||C==36||C==35?!0:C==64},"isAlphaNumeric"),f=0,_=s(function(){return f+=1,"var"+f},"getNextVarName"),v="";for(;m=97&&C<=122||C>=65&&C<=90){let A="";for(;m({_hx_index:6,__enum__:"ValueType",c:n,"@kind":"TClass"}),{_hx_name:"TClass",__params__:["c"]}),TEnum:Object.assign(n=>({_hx_index:7,__enum__:"ValueType",e:n,"@kind":"TEnum"}),{_hx_name:"TEnum",__params__:["e"]}),TUnknown:{_hx_name:"TUnknown",_hx_index:8,__enum__:"ValueType","@kind":"TUnknown"}};st.__constructs__=[st.TNull,st.TInt,st.TFloat,st.TBool,st.TObject,st.TFunction,st.TClass,st.TEnum,st.TUnknown];st.__empty_constructs__=[st.TNull,st.TInt,st.TFloat,st.TBool,st.TObject,st.TFunction,st.TUnknown];var gi=M.global("$hxClasses").Type=s(class Km{static createInstance(e,t){let i=Function.prototype.bind.apply(e,[null].concat(t));return new i}static createEnum(e,t,i){let r=Zt.field(e,t);if(r==null)throw ce.thrown("No such constructor "+t);if(Zt.isFunction(r)){if(i==null)throw ce.thrown("Constructor "+t+" need parameters");return r.apply(e,i)}if(i!=null&&i.length!=0)throw ce.thrown("Constructor "+t+" does not need parameters");return r}static typeof(e){switch(typeof e){case"boolean":return st.TBool;case"function":return e.__name__||e.__ename__?st.TObject:st.TFunction;case"number":return Math.ceil(e)==e%2147483648?st.TInt:st.TFloat;case"object":if(e==null)return st.TNull;let t=e.__enum__;if(t!=null)return st.TEnum(M.global("$hxEnums")[t]);let i=Ir.getClass(e);return i!=null?st.TClass(i):st.TObject;case"string":return st.TClass(String);case"undefined":return st.TNull;default:return st.TUnknown}}static enumEq(e,t){if(e==t)return!0;try{let i=e.__enum__;if(i==null||i!=t.__enum__||e._hx_index!=t._hx_index)return!1;let a=M.global("$hxEnums")[i].__constructs__[e._hx_index].__params__,o=0;for(;o=this.max}next(){let e=this.current;if(!this.hasNext())throw ce.thrown("No such element");return this.current+=this.offset,e}static get __name__(){return"mcl.McIntIterator"}get __class__(){return kv}},"McIntIterator"),c9=M.global("$hxClasses")["mcl.McFloatIterator"]=s(class Ev extends M.inherits(){new(e,t,i){if(this.min=e,this.max=t,this.current=e,this.offset=i,i<0&&e0&&e>t)throw ce.thrown("Invalid step for range")}hasNext(){return this.offset>0?this.current<=this.max:this.current>=this.max}next(){let e=this.current;if(!this.hasNext())throw ce.thrown("No such element");return this.current+=this.offset,e}static get __name__(){return"mcl.McFloatIterator"}get __class__(){return Ev}},"McFloatIterator"),_a=M.global("$hxClasses")["mcl.Globals"]=s(class os{static set(e,t){os.map.inst.set(e,t)}static get(e){return os.map.inst.get(e)}static has(e){return os.map.inst.has(e)}static delete(e){return os.map.inst.delete(e)}static get __name__(){return"mcl.Globals"}get __class__(){return os}},"Globals");_a.loopVariants=function(n){var e;let t=new as;return t.inst.set([st.TInt,st.TInt],function(i){let r=i[0],a=i[1];return new l9(r,a)}),t.inst.set([st.TFloat,st.TFloat,st.TFloat],function(i){let r=i[0],a=i[1],o=i[2];return new c9(r,a,o)}),t.inst.set([st.TClass(Array)],function(i){return new zl(i[0])}),t.inst.set([st.TFunction],function(i){let r=i[0];return new zl(Array.from(r()))}),e=t,e}(void 0);_a.map=function(n){var e;let t=new We;return t.inst.set("REPEAT",function(...i){let r=i.length,a=_a.loopVariants,o=a,l=a.keys();for(;l.hasNext();){let p=l.next(),f=o.get(p),v=p,g=f;if(v.length==r){let h=!1,b=0,x=r;for(;b({_hx_index:3,__enum__:"haxe.io.Error",e:n,"@kind":"Custom"}),{_hx_name:"Custom",__params__:["e"]})};cr.__constructs__=[cr.Blocked,cr.Overflow,cr.OutsideBounds,cr.Custom];cr.__empty_constructs__=[cr.Blocked,cr.Overflow,cr.OutsideBounds];var Zoe=M.$global,ur=M.global("$hxEnums")["haxe.io.Encoding"]={__ename__:"haxe.io.Encoding",UTF8:{_hx_name:"UTF8",_hx_index:0,__enum__:"haxe.io.Encoding","@kind":"UTF8"},RawNative:{_hx_name:"RawNative",_hx_index:1,__enum__:"haxe.io.Encoding","@kind":"RawNative"}};ur.__constructs__=[ur.UTF8,ur.RawNative];ur.__empty_constructs__=[ur.UTF8,ur.RawNative];var nse=M.$global,Ai=M.global("$hxClasses")["haxe.io.Bytes"]=s(class Jl extends M.inherits(){new(e){this.length=e.byteLength,this.b=new Uint8Array(e),this.b.bufferValue=e,e.hxBytes=this,e.bytes=this.b}getString(e,t,i){if(e<0||t<0||e+t>this.length)throw ce.thrown(cr.OutsideBounds);i==null&&(i=ur.UTF8);let r="",a=this.b,o=e,l=e+t;switch(i._hx_index){case 0:let c=e>0;for(;o>8}return new Jl(a.buffer)}let i=new Array,r=0;for(;r>6),i.push(128|a&63)):a<=65535?(i.push(224|a>>12),i.push(128|a>>6&63),i.push(128|a&63)):(i.push(240|a>>18),i.push(128|a>>12&63),i.push(128|a>>6&63),i.push(128|a&63))}return new Jl(new Uint8Array(i).buffer)}static ofData(e){let t=e.hxBytes;return t??new Jl(e)}static get __name__(){return"haxe.io.Bytes"}get __class__(){return Jl}},"Bytes");var sse=M.$global,s1=M.global("$hxClasses")["js.node.buffer._Buffer.Helper"]=s(class l1{static bytesOfBuffer(e){let t=Object.create(Ai.prototype);return t.length=e.byteLength,t.b=e,e.bufferValue=e,e.hxBytes=t,e.bytes=e,t}static get __name__(){return"js.node.buffer._Buffer.Helper"}get __class__(){return l1}},"Helper");var mse=M.$global,rp=M.global("$hxClasses")["haxe.crypto.Sha1"]=s(class Wu extends M.inherits(){new(){}doEncode(e){let t=new Array,i=1732584193,r=-271733879,a=-1732584194,o=271733878,l=-1009589776,c=0;for(;c>>31}let v=(i<<5|i>>>27)+this.ft(_,r,a,o)+l+t[_]+this.kt(_);l=o,o=a,a=r<<30|r>>>2,r=i,i=v,++_}i+=u,r+=d,a+=m,o+=p,l+=f,c+=16}return[i,r,a,o,l]}ft(e,t,i,r){return e<20?t&i|~t&r:e<40?t^i^r:e<60?t&i|t&r|i&r:t^i^r}kt(e){return e<20?1518500249:e<40?1859775393:e<60?-1894007588:-899497514}hex(e){let t="",i=0;for(;i>6)+1,r=new Array,a=0,o=i*16;for(;a>2;r[p]|=t.b[m]<<24-((m&3)<<3)}let u=t.length,d=u>>2;return r[d]|=128<<24-((u&3)<<3),r[i*16-1]=t.length*8,r}static get __name__(){return"haxe.crypto.Sha1"}get __class__(){return Wu}},"Sha1");var vse=M.$global,c1=M.global("$hxClasses")["haxe.crypto.BaseCode"]=s(class u1 extends M.inherits(){new(e){let t=e.length,i=1;for(;t>1<8||t!=1<>3,o=new Ai(new ArrayBuffer(a)),l=0,c=0,u=0,d=0;for(;d>c&255}return o}static get __name__(){return"haxe.crypto.BaseCode"}get __class__(){return u1}},"BaseCode");var Cse=M.$global,Hl=M.global("$hxClasses")["haxe.crypto.Base64"]=s(class ap{static decode(e,t){if(t==null&&(t=!0),t)for(;Qe.cca(e,e.length-1)==61;)e=Qe.substr(e,0,-1);return new c1(ap.BYTES).decodeBytes(Ai.ofString(e))}static get __name__(){return"haxe.crypto.Base64"}get __class__(){return ap}},"Base64");Hl.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";Hl.BYTES=Ai.ofString(Hl.CHARS);var Ose=M.$global,sp=M.global("$hxClasses")["haxe.Resource"]=s(class op{static getString(e){let t=0,i=op.content;for(;t0){let r=this.loadBlock[0].pos;i.push(xe.FunctionDef(r,"load",this.loadBlock,"minecraft:load"))}if(this.tickBlock!=null&&this.tickBlock.length>0){let r=this.tickBlock[0].pos;i.push(xe.FunctionDef(r,"tick",this.tickBlock,"minecraft:tick"))}if(i.length>0){let r=i[0].pos,a=e.compiler.getInitialPathInfo(this.file.name),o={append:function(c){throw new Me(Ve.formatContext("tried to append to a Void context (template virtual context)",r,e),!1,[r].concat(e.stack))},namespace:a.namespace,path:a.path,uidIndex:e.uidIndex,variables:new en(e.globalVariables),templates:this.file.templates,stack:e.stack,replacements:new en(null),isTemplate:!1,requireTemplateKeyword:!0,compiler:e.compiler,globalVariables:e.globalVariables,functions:e.functions,baseNamespaceInfo:e.baseNamespaceInfo,currentFunction:e.currentFunction},l=xe.Directory(r,this.name,i);t.embed(o,r,new We,[l],!0)}}injectTransform(e,t){this.hasBeenUsed=!0;let i=[];if(this.loadBlock!=null&&this.loadBlock.length>0){let r=this.loadBlock[0].pos;i.push(xe.FunctionDef(r,"load",this.loadBlock,"minecraft:load"))}if(this.tickBlock!=null&&this.tickBlock.length>0){let r=this.tickBlock[0].pos;i.push(xe.FunctionDef(r,"tick",this.tickBlock,"minecraft:tick"))}if(i.length>0){let r=i[0].pos,a=e.compiler.getInitialPathInfo(this.file.name),o={append:function(c){throw new Me(Ve.formatContext("tried to append to a Void context (template virtual context)",r,e),!1,[r].concat(e.stack))},namespace:a.namespace,path:a.path,uidIndex:e.uidIndex,variables:new en(e.globalVariables),templates:this.file.templates,stack:e.stack,replacements:new en(null),isTemplate:!1,requireTemplateKeyword:!0,compiler:e.compiler,globalVariables:e.globalVariables,functions:e.functions,baseNamespaceInfo:e.baseNamespaceInfo,currentFunction:e.currentFunction},l=xe.Directory(r,this.name,i);t.embedTransform(o,r,new We,[l],!0)}return xe.Void}process(e,t,i,r,a){let o=yt.ltrim(r.substring(this.name.length));this.jsValueCache.clear(),ut.jsCache=this.jsValueCache;let l=this.overloads,c=l,u=l.keys();for(;u.hasNext();){let d=u.next(),m=c.get(d),f=d,_=m,v=new We,g=0,h=0,b=[o].concat(a??[]),x=!1,y=0,k=0;for(;k=b.length)break;if(A.expectBlock){if(!gi.enumEq(gi.typeof(b[h]),st.TEnum(xe)))break;let I=A.parseValueBlock(b[h],i,t);if(!I.success)break;x=!0,v.inst.set(A.name,I.value),b[h]=I.raw,++g,++h}else{if(typeof b[h]!="string")break;let I=b[h],S=null;if(I.charAt(0)=="<"&&I.charAt(1)=="%"&&!A.expectJsValue){let O=I.indexOf("%>");if(O==-1)throw new Me(Ve.formatContext("Unexpected end of inline script block",i,t),!1,[i].concat(t.stack));let E=I.substring(2,O);if(S=E,this.jsValueCache.inst.has(y)){let B=this.jsValueCache.inst.get(y);I=B==null?"null":Be.string(B)}else{let B=no.invokeExpressionInline(E,t,i);this.jsValueCache.inst.set(y,B),I=B==null?"null":Be.string(B)}++y}else A.expectJsValue&&(ut.jsCacheIdx=y,++y);let L=A.parseValue(I,i,t);if(!L.success)break;A.name!=null&&v.inst.set(A.name,L.value),S!=null?b[h]=yt.ltrim(Ir.__cast(b[h],String).substring(S.length+4)):b[h]=yt.ltrim(Ir.__cast(b[h],String).substring(L.raw.length)),++g,x=!1}}for(;h=b.length)break;if(I.expectBlock){if(!gi.enumEq(gi.typeof(b[h]),st.TEnum(xe)))break;let S=I.parseValueBlock(b[h],i,t);if(!S.success)break;x=!0,v.inst.set(I.name,S.value),b[h]=S.raw,++g,++h}else{if(typeof b[h]!="string")break;let S=b[h],L=null;if(S.charAt(0)=="<"&&S.charAt(1)=="%"&&!I.expectJsValue){let E=S.indexOf("%>");if(E==-1)throw new Me(Ve.formatContext("Unexpected end of inline script block",i,t),!1,[i].concat(t.stack));let B=S.substring(2,E);if(L=B,this.jsValueCache.inst.has(y)){let H=this.jsValueCache.inst.get(y);S=H==null?"null":Be.string(H)}else{let H=no.invokeExpressionInline(B,t,i);this.jsValueCache.inst.set(y,H),S=H==null?"null":Be.string(H)}++y}else I.expectJsValue&&(ut.jsCacheIdx=y,++y);let O=I.parseValue(S,i,t);if(!O.success)break;I.name!=null&&v.inst.set(I.name,O.value),L!=null?b[h]=yt.ltrim(Ir.__cast(b[h],String).substring(L.length+4)):b[h]=yt.ltrim(Ir.__cast(b[h],String).substring(O.raw.length)),++g,x=!1}}for(;h({_hx_index:0,__enum__:"mcl.ImportFileType",f:n,"@kind":"IMcFile"}),{_hx_name:"IMcFile",__params__:["f"]}),IJsFile:Object.assign(n=>({_hx_index:1,__enum__:"mcl.ImportFileType",f:n,"@kind":"IJsFile"}),{_hx_name:"IJsFile",__params__:["f"]})};to.__constructs__=[to.IMcFile,to.IJsFile];to.__empty_constructs__=[];var no=M.global("$hxClasses")["mcl.McFile"]=s(class eo extends M.inherits(){new(e,t){this.tagsDir="tags",this.functionsDir="functions",this.fileJs={},this.tickCommands=[],this.loadCommands=[],this.imports=new We,this.exportedTemplates=new We,this.templates=new We,this.ast=[],this.name=e,this.ast=t,this.ext=Ge.extension(e)}getTemplates(){if(this.ext=="mcbt")return this.exportedTemplates;throw new Me("tried to get templates from non-template file:"+this.name,!0)}setup(e){e.config.features.useFolderRenames48&&(this.functionsDir="function");let t=this.ast;this.ast=[];let i=0;for(;i0&&E.endsWith(".mcfunction")&&(B=r.compiler.config.header+` -`+B),r.compiler.io.write(E,B);let H="function "+r.namespace+":"+r.path.concat([u]).join("/"),ee=i==null?"":" "+this.injectValues(i,r,e);return(o?"$":"")+(H+ee)}embedTransform(e,t,i,r,a){a==null&&(a=!1);let o=e.namespace,l=e.append,c=e.globalVariables,u=new en(en.globals,(i==null?c:new en(c,i)).get()),d=e.path,m={append:l,namespace:o,path:d??[],uidIndex:e.uidIndex,variables:u,stack:e.stack,replacements:e.replacements,isTemplate:this.ext=="mcbt",templates:e.templates,requireTemplateKeyword:e.requireTemplateKeyword,compiler:e.compiler,globalVariables:e.globalVariables,functions:e.functions,baseNamespaceInfo:e.baseNamespaceInfo,currentFunction:e.currentFunction},p=[],f=0;for(;f0)throw new Me(Ve.formatContext("Unexpected extra data in non template command",t,e),!1,[t].concat(e.stack))}return xe.Raw(t,this.injectValues(i,e,t),r,a)}processTemplate(e,t,i,r,a){if(e.compiler.templateParsingEnabled){i.startsWith("template ")&&(i=i.substring(9));let l=e.templates,c=l,u=l.keys();for(;u.hasNext();){let d=u.next(),m=c.get(d),f=d,_=m;if(i==f||i.startsWith(f)){_.process(this,e,t,i,r);return}}if(r!=null&&r.length>0)throw new Me(Ve.formatContext("Unexpected extra data in non template command",t,e),!1,[t].concat(e.stack))}let o=this.injectValues(i,e,t);e.append((a?"$":"")+o)}compileInline(e,t,i){i==null&&(i=!1);let r=Yn.tokenize(t,""),a=new Xa(r),o=[];for(;a.hasNext();)i?o.push(qt.parseTLD(a)):o.push(qt.innerParse(a));if(i){let l=0;for(;l"),a=new Xa(r),o=[];for(;a.hasNext();)i?o.push(qt.parseTLD(a)):o.push(qt.innerParse(a));let l;if(i){let c=[],u=0;for(;u0&&y.endsWith(".mcfunction")&&(k=e.compiler.config.header+` -`+k),e.compiler.io.write(y,k);let C=""+e.namespace+":"+e.path.concat([x]).join("/");return e.append("function "+C+(b==null?"":" "+b)),C},"emitBlock");c.mcb=d,r||(c.block=m);let p=[c,e,function(h){if(r)throw new Me(Ve.formatContext("embed not available in toplevel script blocks",t,e),!1,[t].concat(e.stack));return h.embedTo(e,t,u)},e.compiler.disableRequire?function(h){throw new Me(Ve.formatContext("Require not available as it has been disabled, please disable compiler.disableRequire",t,e),!1,[t].concat(e.stack))}:dp.createRequire(this.name)],_=e.variables.get(),v=_,g=_.keys();for(;g.hasNext();){let h=g.next(),b=v.get(h),y=h,k=b;l.push(y),p.push(k)}try{new Function(...l,a)(...p)}catch(h){let b=ce.caught(h);throw b instanceof pi?ce.thrown(b):new Me(Ve.formatContext("Error in multi-line script, '"+b.get_message()+"' at "+t.file+":"+t.line+":"+(t.col+1),t,e),!1,[t].concat(e.stack))}}processMlScriptTransform(e,t,i,r){r==null&&(r=!1);let a="",o=0;for(;o0&&ke.endsWith(".mcfunction")&&(Ut=t.compiler.config.header+` -`+Ut),t.compiler.io.write(ke,Ut);let In=t,On=this.injectValues((J?"$":"")+(""+Q+" function "+ge+(P==null?"":" "+P)),t,j);if(In.append(On),Z!=null){let _t=0,yn=0;for(;yn0&&__.endsWith(".mcfunction")&&(zd=t.compiler.config.header+` -`+zd),t.compiler.io.write(__,zd);let $y=t,Ky="execute if score #ifelse "+t.compiler.config.internalScoreboardName+" matches 0 run function "+t.namespace+":"+t.path.concat([t.compiler.config.generatedDirName,Pd]).join("/");$y.append((Vy?"$":"")+(Ky+(f_==null?"":" "+f_)));break;case 11:let hG=nn.continuations,bG=nn.pos,Ud=nn.execute,g_=nn.data,h_=nn.body,qy=nn.isMacro,b_=["scoreboard players set #ifelse "+t.compiler.config.internalScoreboardName+" 1"],Wy=s(function(Aa){b_.push(Aa)},"embedAppend"),Gd=Be.string(t.uidIndex.get()),Zy=""+t.namespace+":"+t.path.concat([t.compiler.config.generatedDirName,Gd]).join("/"),Xy=t.functions.concat([Zy]),v_=t.path,Yy={append:Wy,namespace:t.namespace,path:v_??[],uidIndex:t.uidIndex,variables:t.variables,stack:t.stack,replacements:t.replacements,isTemplate:this.ext=="mcbt",templates:t.templates,requireTemplateKeyword:t.requireTemplateKeyword,compiler:t.compiler,globalVariables:t.globalVariables,functions:Xy,baseNamespaceInfo:t.baseNamespaceInfo,currentFunction:t.currentFunction},Jd=0;for(;Jd0&&y_.endsWith(".mcfunction")&&(Hd=t.compiler.config.header+` -`+Hd),t.compiler.io.write(y_,Hd);let ew=Ud.startsWith("execute ")?Ud.substring(8):Ud,tw=t,nw="execute if score #ifelse "+t.compiler.config.internalScoreboardName+" matches 0 "+ew+" function "+t.namespace+":"+t.path.concat([t.compiler.config.generatedDirName,Gd]).join("/");tw.append((qy?"$":"")+(nw+(g_==null?"":" "+g_)));break;default:let w_=nn.pos;throw new Me(Ve.formatContext("Unexpected continuation type: "+Be.string(nn),w_,le),!1,[w_].concat(le.stack))}++_t}}break;case 12:let rt=e.pos,It=e.delay,_n=e.type,Si=e.body,Ki=e.isMacro;It=this.injectValues(It,t,rt),_n=this.injectValues(_n,t,rt);let fr=[],mr=s(function(_t){fr.push(_t)},"append1"),pr=Be.string(t.uidIndex.get()),ii=""+t.namespace+":"+t.path.concat([t.compiler.config.generatedDirName,pr]).join("/"),fn=t.functions.concat([ii]),Dt=t.path,bn={append:mr,namespace:t.namespace,path:Dt??[],uidIndex:t.uidIndex,variables:t.variables,stack:t.stack,replacements:t.replacements,isTemplate:this.ext=="mcbt",templates:t.templates,requireTemplateKeyword:t.requireTemplateKeyword,compiler:t.compiler,globalVariables:t.globalVariables,functions:fn,baseNamespaceInfo:t.baseNamespaceInfo,currentFunction:t.currentFunction},Ft=0;for(;Ft0&&Ot.endsWith(".mcfunction")&&(Gt=t.compiler.config.header+` -`+Gt),t.compiler.io.write(Ot,Gt);let on=t,gn="schedule function "+t.namespace+":"+t.path.concat([t.compiler.config.generatedDirName,Lt]).join("/")+" "+It+" "+_n;on.append((Ki?"$":"")+gn);break;case 15:let qi=e.pos,Zn=e.value;t.compiler.config.dontEmitComments||t.append(Zn);break;case 19:let ri=e.pos,Pn=e.command,oo=e.value,ya=e.isMacro,Jt=[],ye=t.path,Ql={append:function(_t){Jt.push(_t)},namespace:t.namespace,path:ye??[],uidIndex:t.uidIndex,variables:t.variables,stack:t.stack,replacements:t.replacements,isTemplate:this.ext=="mcbt",templates:t.templates,requireTemplateKeyword:t.requireTemplateKeyword,compiler:t.compiler,globalVariables:t.globalVariables,functions:t.functions,baseNamespaceInfo:t.baseNamespaceInfo,currentFunction:t.currentFunction};if(this.compileCommand(oo,Ql),Jt.length!=1)throw new Me(Ve.formatContext("Expected exactly 1 command after execute, got "+Jt.length,ri,t),!1,[ri].concat(t.stack));let Bd=t,s_=this.injectValues((ya?"$":"")+(""+Pn+" "+Jt[0]),t,ri);Bd.append(s_);break;case 20:let xs=e.pos,Dd=e.name,ec=e.data,tc=e.isMacro,l_=t,Rd="function "+this.evaluateFunctionHandle(Dd,t,xs,tc),Md=ec.length==0?"":" "+this.injectValues(ec,t,xs),c_=this.injectValues((tc?"$":"")+(Rd+Md),t,xs);l_.append(c_);break;case 21:let Fd=e.pos,Ld=e.command,ks=vv.compile(this.injectValues(Ld,t,Fd),t);t.append(ks.commands);let Zr="scoreboard objectives add "+t.compiler.config.eqConstScoreboardName+" dummy";this.loadCommands.includes(Zr)||this.loadCommands.push(Zr),Zr="scoreboard objectives add "+t.compiler.config.eqVarScoreboardName+" dummy",this.loadCommands.includes(Zr)||this.loadCommands.push(Zr);let wa=0,lt=ks.constants;for(;wa=0&&e=this.array.length)throw new ii("Tried to read past the end of the token list");let e=this.array,t=this.get_index();return this.set_index(t+1),e[t]}skip(){this.set_index(this.get_index()+1)}peek(){return this.array[this.get_index()]}hasNext(){return this.get_index()0)throw Se.unreachable(i);return a}else return null}static block(e,t,i,r){i==null&&(i=!0);let a=Se.expectThenData(e,i);for(;;){if(!e.hasNext())throw new ii("Unexpected end of file!");let o=e.peek();if(o._hx_index==2){let l=o.pos;r?.(o);break}else t()}return Se.expect(e,function(o){return o._hx_index==2}),a==""?null:a}static readFunction(e,t,i){let r=[],a=null,o=e.split(" ");return o.length==2?(e=o[0],a=o[1]):o.length==1&&(e=o[0]),Se.block(t,function(){r.push(Se.innerParse(t))},!1),Ae.FunctionDef(i,e,r,a)}static innerParseTemplate(e){let t=e.peek();if(t._hx_index==0){let i=t.v,r=t.pos;switch(i){case"load":let a=r;e.skip();let o=[];return Se.block(e,function(){o.push(Se.innerParse(e))},!1),Ae.LoadBlock(a,o);break;case"tick":let l=r;e.skip();let u=[];return Se.block(e,function(){u.push(Se.innerParse(e))},!1),Ae.TickBlock(l,u);break;default:let c=i,d=r;if(c=="with"||c.startsWith("with ")){e.skip();let m=Ct.trim(c.substring(5)),p=[];return Se.block(e,function(){p.push(Se.innerParse(e))},!1),Ae.TemplateOverload(d,m,p)}else throw Se.unreachable(e.next())}}else throw Se.unreachable(e.next())}static readTemplate(e,t,i){let r=[];return Se.block(t,function(){r.push(Se.innerParseTemplate(t))},!1),Ae.TemplateDef(i,e,r)}static pos(e){switch(e._hx_index){case 0:let t=e.v;return e.pos;case 1:let r=e.data;return e.pos;case 2:return e.pos}}static json(e){let t=Se.pos(e.peek()),i=0,r="";do{if(!e.hasNext())throw new ii("Unexpected end of file!");let a=e.next();switch(a._hx_index){case 0:let o=a.pos,l=a.v;r+=l;break;case 1:let u=a.pos,c=a.data;r+="{",r+=c,++i;break;case 2:let d=a.pos;--i,r+="}";break}}while(i>0);return Ae.Raw(t,r,[],!1)}static parseMcbFile(e){let t=new io(e),i=[];for(;t.hasNext();)i.push(Se.parseTLD(t));return i}static parseMcbtFile(e){let t=new io(e),i=[];for(;t.hasNext();){let r=t.next(),a;if(r._hx_index==0){let o=r.v,l=r.pos;if(o.startsWith("template ")){let u=Ct.trim(o.substring(9));a=Se.readTemplate(u,t,l)}else if(o.startsWith("#"))a=Ae.Comment(l,o);else if(o.startsWith("import "))a=Ae.Import(l,o.substring(7));else throw Se.unreachable(r)}else throw Se.unreachable(r);i.push(a)}return i}static parserCompilerLoop(e,t,i,r){let a=[];if(Se.block(i,function(){a.push(r())}),Se.loopRegExp.match(e)){let o=Se.loopRegExp.matched(1),l=Se.loopRegExp.matched(2);return Ae.CompileTimeLoop(t,o,l,a)}return Ae.CompileTimeLoop(t,e,null,a)}static parseTLD(e){let t=e.next();if(t._hx_index==0){let i=t.v,r=t.pos;if(i.startsWith("function ")){let a=Ct.trim(i.substring(9));return Se.readFunction(a,e,r)}else if(i.startsWith("clock ")){let a=Ct.trim(i.substring(6));if(a.indexOf(" ")==-1)throw new ii(Se.format('"Expected a name and a time for the clock command" at {}:{}:{}',r.file,r.line,r.col));let o=Ct.trim(a.substring(0,a.indexOf(" ")+1));a=Ct.trim(a.substring(a.indexOf(" ")));let l=[];return Se.block(e,function(){l.push(Se.innerParse(e))}),Ae.ClockExpr(r,o,a,l)}else{if(i.startsWith("import "))return Ae.Import(r,i.substring(7));if(i.startsWith("dir ")&&e.peek()._hx_index==1){let a=[];if(Se.block(e,function(){a.push(Se.parseTLD(e))},!1)!=null)throw Se.unreachable(Bn.Literal(i,r));return Ae.Directory(r,i.substring(4),a)}else if(i.startsWith("<%%")){let a=[];for(;;){if(!e.hasNext())throw new ii("Unexpected end of file!");let o=e.peek();if(o._hx_index==0){let l=o.pos;if(o.v=="%%>"){e.skip();break}}a.push(e.next())}return Ae.MultiLineScript(r,a)}else{if(i.startsWith("#"))return Ae.Comment(r,i);if(i.startsWith("REPEAT"))return Se.parserCompilerLoop(i,r,e,function(){return Se.parseTLD(e)});if(i.startsWith("IF"))return Se.parseCompileTimeIf(i,r,e,function(){return Se.parseTLD(e)});if(i.startsWith("tag ")){let a=Ct.trim(i.substring(4)).split(" "),o=a.shift(),l=a.shift(),u=a.shift()=="replace",c=[];return Se.block(e,function(){c.push(Se.innerParse(e))}),Ae.JsonFile(r,l,Kt.Tag(o,u,c))}else{if(i.startsWith("advancement ")||i.startsWith("enchantment ")||i.startsWith("item_modifier ")||i.startsWith("loot_table ")||i.startsWith("predicate ")||i.startsWith("recipe ")||i.startsWith("chat_type ")||i.startsWith("damage_type ")||i.startsWith("dimension ")||i.startsWith("dimension_type "))return Se.readPlainJsonFile(i,r,e);if(i.startsWith("worldgen ")){let a=Ct.trim(i.substring(9)),o=a.substring(0,a.indexOf(" "));a=a.substring(a.indexOf(" ")+1);let l=[];return Se.block(e,function(){l.push(Se.innerParse(e))}),Ae.JsonFile(r,a,Kt.WorldGen(o,a,l))}else throw Se.unreachable(Bn.Literal(i,r))}}}}else{let i=t;throw Se.unreachable(i)}}static readPlainJsonFile(e,t,i){let r=[],a=0,o=e.split(" ");for(;a"){e.skip();break}}d.push(e.next())}return Ae.MultiLineScript(r,d)}else{if(i.startsWith("IF"))return Se.parseCompileTimeIf(i,r,e,function(){return Se.innerParse(e)});if(i.startsWith("function ")){let d=i.substring(9),m=d.indexOf(" "),p=d.substring(0,m==-1?d.length:m),f=d.substring(p.length+1);return Ae.FunctionCall(r,p,f,a)}else if(i.startsWith("schedule ")){let d=Ct.trim(i.substring(9));if(d.startsWith("function ")){let g=d.substring(9),h=g.indexOf(" "),v=g.substring(0,h==-1?g.length:h),y=h==-1?null:g.substring(v.length+1),k="replace";if(y.endsWith(" append")&&(k="append",y=y.substring(0,y.length-7)),y.endsWith(" replace")&&(k="replace",y=y.substring(0,y.length-8)),y==null)throw new ii(Se.format('"Expected delay after function name in schedule command" at {}:{}:{}',r.file,r.line,r.col));return Ae.ScheduleCall(r,y,v,k,a)}if(d.startsWith("clear "))return Ae.ScheduleClear(r,d.substring(6),a);let m=d.indexOf(" "),p=m==-1?d:d.substring(0,m),f="append";p.endsWith(" append")&&(f="append",p=p.substring(0,p.length-7)),p.endsWith(" replace")&&(f="replace",p=p.substring(0,p.length-8));let _=[];if(e.peek()._hx_index!=1)throw new ii("Expected { after delay in schedule block command");return Se.block(e,function(){_.push(Se.innerParse(e))}),Ae.ScheduleBlock(r,p,f,_,a)}else if(i.startsWith("execute")&&(i.charAt(7)==" "||i.charAt(7)=="<"))if(e.hasNext()&&e.peek()._hx_index==1){let d=[];if(!i.endsWith("run")&&Se.executeRegExp.match(i)){let f=Se.executeRegExp.matchedPos(),_={file:r.file,line:r.line,col:r.col+f.pos+f.len},g=Bn.Literal(Ct.ltrim(i.substring(f.pos+f.len)),_);return e.insert(g),Ae.Execute(r,Ct.rtrim(i.substring(0,f.pos+3)),Se.innerParse(e),a)}let m=Se.block(e,function(){d.push(Se.innerParse(e))}),p=[];e:for(;;){if(!e.hasNext())throw new ii("Unexpected end of file!");let f=e.peek();if(f._hx_index==0){let _=f.v,g=f.pos;switch(_){case"else $run":let h=g;e.skip();let v=[],y=Se.block(e,function(){v.push(Se.innerParse(e))});p.push(Ae.Block(h,null,v,y,!0,!1));break;case"else run":let k=g;e.skip();let b=[],x=Se.block(e,function(){b.push(Se.innerParse(e))});p.push(Ae.Block(k,null,b,x,!1,!1));break;default:let E=_,C=g;if(E.startsWith("else $")&&E.endsWith("run")){e.skip();let j=Ct.trim(E.substring(6)),S=[],B=Se.block(e,function(){S.push(Se.innerParse(e))});C.col+=5,p.push(Ae.ExecuteBlock(C,j,B,S,null,!0))}else{let j=_,S=g;if(j.startsWith("else ")&&j.endsWith("run")){e.skip();let B=Ct.trim(j.substring(5)),O=[],A=Se.block(e,function(){O.push(Se.innerParse(e))});S.col+=5,p.push(Ae.ExecuteBlock(S,B,A,O,null,!1))}else break e}}}else break}return Ae.ExecuteBlock(r,i,m,d,p.length>0?p:null,a)}else{if(!Se.executeRegExp.match(i))return Se.readRaw(r,i,e,a);let d=Se.executeRegExp.matchedPos(),m={file:r.file,line:r.line,col:r.col+d.pos+d.len},p=Bn.Literal(Ct.ltrim(i.substring(d.pos+d.len)),m);return e.insert(p),Ae.Execute(r,Ct.rtrim(i.substring(0,d.pos+3)),Se.innerParse(e),a)}else{if(i.startsWith("REPEAT"))return Se.parserCompilerLoop(i,r,e,function(){return Se.innerParse(e)});if(i.startsWith("#"))return Ae.Comment(r,i);if(i=="block"||i.startsWith("block ")){let d=Ct.trim(i.substring(6)),m=[],p=Se.block(e,function(){m.push(Se.innerParse(e))});return Ae.Block(r,d,m,p,a,!1)}else if(i.startsWith("return run")){let d=Ct.trim(i.substring(11)),m={file:r.file,line:r.line,col:r.col+11},p=e.peek();if(p._hx_index==1){let f=p.pos,_=p.data,g=[],h=Se.block(e,function(){g.push(Se.innerParse(e))});return Ae.ReturnRun(f,Ae.Block(f,null,g,h,!1,!1),a)}else return e.back(),e.update(Bn.Literal(d,m)),Ae.ReturnRun(m,Se.innerParse(e),a)}else if(i=="tick"){let d=[];return Se.block(e,function(){d.push(Se.innerParse(e))},!1),Ae.TickBlock(r,d)}else if(i=="load"){let d=[];return Se.block(e,function(){d.push(Se.innerParse(e))},!1),Ae.LoadBlock(r,d)}else return i.startsWith("eq ")?Ae.EqCommand(r,i.substring(3)):Se.readRaw(r,i,e,a)}}break;case 1:let o=t.data,l=t.pos,u=[],c=Se.block(e,function(){u.push(Se.innerParse(e))});return Ae.Block(l,null,u,c,!1,!1);default:throw Se.unreachable(t)}}static readRaw(e,t,i,r){if(!i.hasNext())return Ae.Raw(e,t,[],r);let a=[],o=e.line;e:for(;;){if(!i.hasNext())throw new ii("Unexpected end of file!");let l=i.peek();switch(l._hx_index){case 0:let u=l.v,c=l.pos;if(c.line==o)i.skip(),a.push(Ae.Raw(c,u,[],!1));else break e;break;case 1:let d=l.pos,m=l.data;if(d.line==o){let f=[],_=Se.block(i,function(){f.push(Se.innerParse(i))});a.push(Ae.Block(d,null,f,_,!1,!1))}else break e;break;case 2:let p=l.pos;if(p.line==o)throw Se.unreachable(Bn.Literal(t,p));break e;default:break e}}return Ae.Raw(e,t,a,r)}static parseCompileTimeIf(e,t,i,r){let a=Ct.trim(e.substring(2)),o=[];Se.block(i,function(){o.push(r())},!1);let l=[];for(;;){if(!i.hasNext())throw new ii("Unexpected end of file!");let u=i.peek();if(u._hx_index==0){let c=u.v,d=u.pos;if(c=="ELSE"||c.startsWith("ELSE ")){i.skip();let m=c=="ELSE"?null:Ct.trim(c.substring(5));m!=null?m.startsWith("IF")&&(m=Ct.trim(m.substring(2))):m=null;let p=[];Se.block(i,function(){p.push(r())},!1),l.push({condition:m,node:p})}else break}else break}return Ae.CompileTimeIf(t,a,o,l)}static get __name__(){return"mcl.Parser"}get __class__(){return Se}},"Parser");tn.loopRegExp=new Xr("(REPEAT\\s*\\(.+?\\))\\s\\s*as\\s\\s*([a-zA-Z]+)","");tn.executeRegExp=new Xr("\\b(run\\s+?)\\b","");var Gae=D.$global,dt=D.global("$hxEnums")["haxpression.ValueType"]={__ename__:"haxpression.ValueType",VFloat:Object.assign(n=>({_hx_index:0,__enum__:"haxpression.ValueType",v:n,"@kind":"VFloat"}),{_hx_name:"VFloat",__params__:["v"]}),VInt:Object.assign(n=>({_hx_index:1,__enum__:"haxpression.ValueType",v:n,"@kind":"VInt"}),{_hx_name:"VInt",__params__:["v"]}),VBool:Object.assign(n=>({_hx_index:2,__enum__:"haxpression.ValueType",v:n,"@kind":"VBool"}),{_hx_name:"VBool",__params__:["v"]}),VString:Object.assign(n=>({_hx_index:3,__enum__:"haxpression.ValueType",v:n,"@kind":"VString"}),{_hx_name:"VString",__params__:["v"]}),VNA:{_hx_name:"VNA",_hx_index:4,__enum__:"haxpression.ValueType","@kind":"VNA"},VNM:{_hx_name:"VNM",_hx_index:5,__enum__:"haxpression.ValueType","@kind":"VNM"}};dt.__constructs__=[dt.VFloat,dt.VInt,dt.VBool,dt.VString,dt.VNA,dt.VNM];dt.__empty_constructs__=[dt.VNA,dt.VNM];var Hae=D.$global,Qe=D.global("$hxClasses")["haxpression.utils.Chars"]=s(class wi{static isDecimalDigit(e){return e>=48?e<=57:!1}static isUpperCaseLetter(e){return e>=65?e<=90:!1}static isLowerCaseLetter(e){return e>=97?e<=122:!1}static isIdentifierStart(e){return e==wi.DOLLAR_CODE||e==wi.UNDERSCORE_CODE||wi.isUpperCaseLetter(e)||wi.isLowerCaseLetter(e)?!0:wi.OTHER_IDENTIFIER_START_CODES.includes(e)}static isIdentifierPart(e){return wi.isIdentifierStart(e)||wi.isDecimalDigit(e)?!0:wi.OTHER_IDENTIFIER_PART_CODES.includes(e)}static isWhiteSpace(e){return e==wi.TAB_CODE||e==wi.LF_CODE||e==wi.CR_CODE?!0:e==wi.SPACE_CODE}static get __name__(){return"haxpression.utils.Chars"}get __class__(){return wi}},"Chars");Qe.TAB_CODE=9;Qe.LF_CODE=10;Qe.CR_CODE=13;Qe.SPACE_CODE=32;Qe.EXCLAMATION_POINT_CODE=33;Qe.DOUBLE_QUOTE_CODE=34;Qe.DOLLAR_CODE=36;Qe.SINGLE_QUOTE_CODE=39;Qe.OPEN_PAREN_CODE=40;Qe.CLOSE_PAREN_CODE=41;Qe.COMMA_CODE=44;Qe.PERIOD_CODE=46;Qe.COLON_CODE=58;Qe.SEMICOLON_CODE=59;Qe.QUESTION_MARK_CODE=63;Qe.OPEN_BRACKET_CODE=91;Qe.CLOSE_BRACKET_CODE=93;Qe.UNDERSCORE_CODE=95;Qe.OTHER_IDENTIFIER_START_CODES=[];Qe.OTHER_IDENTIFIER_PART_CODES=[Qe.EXCLAMATION_POINT_CODE,Qe.DOLLAR_CODE,Qe.COLON_CODE];var Wae=D.$global,Qu=D.global("$hxClasses")["haxpression.utils.Iterators"]=s(class Yv{static toArray(e){let t=[],i=e;for(;i.hasNext();){let r=i.next();t.push(r)}return t}static get __name__(){return"haxpression.utils.Iterators"}get __class__(){return Yv}},"Iterators");var Qae=D.$global,ds=D.global("$hxClasses")["haxpression.utils.Arrays"]=s(class Qv{static all(e,t){let i=[],r=0,a=e;for(;re?t.length:e},0)}static wrapOperation(e){return function(t){return Ee.isNA(t)?Ee.fromValueType(dt.VNA):Ee.isNM(t)?Ee.fromValueType(dt.VNM):e(t)}}static get __name__(){return"haxpression.UnaryOperations"}get __class__(){return ro}},"UnaryOperations");pr.map=new Xe,pr.addOperator("-",function(n){return Ee.fromFloat(Ee.toFloat(n)*-1)}),pr.addOperator("+",function(n){return Ee.fromFloat(Ee.toFloat(n))}),pr.addOperator("!",function(n){return Ee.fromBool(!Ee.toBool(n))}),pr.addOperator("~",function(n){return Ee.fromInt(~Ee.toInt(n))});var Eoe=D.$global,Ve=D.global("$hxEnums")["haxpression.ExpressionType"]={__ename__:"haxpression.ExpressionType",ELiteral:Object.assign(n=>({_hx_index:0,__enum__:"haxpression.ExpressionType",value:n,"@kind":"ELiteral"}),{_hx_name:"ELiteral",__params__:["value"]}),EIdentifier:Object.assign(n=>({_hx_index:1,__enum__:"haxpression.ExpressionType",name:n,"@kind":"EIdentifier"}),{_hx_name:"EIdentifier",__params__:["name"]}),EUnary:Object.assign((n,e)=>({_hx_index:2,__enum__:"haxpression.ExpressionType",operator2:n,operand:e,"@kind":"EUnary"}),{_hx_name:"EUnary",__params__:["operator2","operand"]}),EBinary:Object.assign((n,e,t)=>({_hx_index:3,__enum__:"haxpression.ExpressionType",operator2:n,left:e,right:t,"@kind":"EBinary"}),{_hx_name:"EBinary",__params__:["operator2","left","right"]}),ECall:Object.assign((n,e)=>({_hx_index:4,__enum__:"haxpression.ExpressionType",callee:n,arguments:e,"@kind":"ECall"}),{_hx_name:"ECall",__params__:["callee","arguments"]}),EConditional:Object.assign((n,e,t)=>({_hx_index:5,__enum__:"haxpression.ExpressionType",test:n,consequent:e,alternate:t,"@kind":"EConditional"}),{_hx_name:"EConditional",__params__:["test","consequent","alternate"]}),EArray:Object.assign(n=>({_hx_index:6,__enum__:"haxpression.ExpressionType",items:n,"@kind":"EArray"}),{_hx_name:"EArray",__params__:["items"]}),ECompound:Object.assign(n=>({_hx_index:7,__enum__:"haxpression.ExpressionType",items:n,"@kind":"ECompound"}),{_hx_name:"ECompound",__params__:["items"]})};Ve.__constructs__=[Ve.ELiteral,Ve.EIdentifier,Ve.EUnary,Ve.EBinary,Ve.ECall,Ve.EConditional,Ve.EArray,Ve.ECompound];Ve.__empty_constructs__=[];var joe=D.$global,Ri=D.global("$hxClasses")["haxpression.ExpressionTypes"]=s(class t1{static canEvaluateAll(e){return ds.all(e,function(t){return vt.canEvaluate(vt.fromExpressionType(t))})}static simplify(e){let t=new Array(e.length),i=0,r=e.length;for(;i=0&&i!=t.length?!1:Ri.canEvaluateAll(t)}static evaluate(e,t){return Xi.getFunction(e)(t)}static wrapOperation(e,t,i){return function(r){if(t>=0&&r.length!=t)throw he.thrown(new Nt("function "+e+" expects exactly "+t+" argument(s)"));return i(r)}}static get __name__(){return"haxpression.CallOperations"}get __class__(){return Xi}},"CallOperations");nn.map=new Xe,nn.addFunction("abs",1,function(n){return Ee.fromFloat(Math.abs(Ee.toFloat(n[0])))}),nn.addFunction("acos",1,function(n){return Ee.fromFloat(Math.acos(Ee.toFloat(n[0])))}),nn.addFunction("asin",1,function(n){return Ee.fromFloat(Math.asin(Ee.toFloat(n[0])))}),nn.addFunction("atan",1,function(n){return Ee.fromFloat(Math.atan(Ee.toFloat(n[0])))}),nn.addFunction("atan2",2,function(n){return Ee.fromFloat(Math.atan2(Ee.toFloat(n[0]),Ee.toFloat(n[1])))}),nn.addFunction("ceil",1,function(n){return Ee.fromInt(Math.ceil(Ee.toFloat(n[0])))}),nn.addFunction("cos",1,function(n){return Ee.fromFloat(Math.cos(Ee.toFloat(n[0])))}),nn.addFunction("exp",1,function(n){return Ee.fromFloat(Math.exp(Ee.toFloat(n[0])))}),nn.addFunction("fceil",1,function(n){return Ee.fromFloat(Math.ceil(Ee.toFloat(n[0])))}),nn.addFunction("ffloor",1,function(n){return Ee.fromFloat(Math.floor(Ee.toFloat(n[0])))}),nn.addFunction("floor",1,function(n){return Ee.fromInt(Math.floor(Ee.toFloat(n[0])))}),nn.addFunction("fround",1,function(n){return Ee.fromFloat(Math.round(Ee.toFloat(n[0])))}),nn.addFunction("log",1,function(n){return Ee.fromFloat(Math.log(Ee.toFloat(n[0])))}),nn.addFunction("max",2,function(n){return Ee.fromFloat(Math.max(Ee.toFloat(n[0]),Ee.toFloat(n[1])))}),nn.addFunction("min",2,function(n){return Ee.fromFloat(Math.min(Ee.toFloat(n[0]),Ee.toFloat(n[1])))}),nn.addFunction("pow",2,function(n){return Ee.fromFloat(Math.pow(Ee.toFloat(n[0]),Ee.toFloat(n[1])))}),nn.addFunction("random",0,function(n){return Ee.fromFloat(Math.random())}),nn.addFunction("rand",0,function(n){return Ee.fromFloat(Math.random())}),nn.addFunction("round",1,function(n){return Ee.fromInt(Math.round(Ee.toFloat(n[0])))}),nn.addFunction("sin",1,function(n){return Ee.fromFloat(Math.sin(Ee.toFloat(n[0])))}),nn.addFunction("sqrt",1,function(n){return Ee.fromFloat(Math.sqrt(Ee.toFloat(n[0])))}),nn.addFunction("tan",1,function(n){return Ee.fromFloat(Math.tan(Ee.toFloat(n[0])))});var Koe=D.$global,Wt=D.global("$hxClasses")["haxpression.BinaryOperations"]=s(class wa{static evaluate(e,t,i){return wa.map.inst.get(e).operation(t,i)}static addOperator(e,t,i){let r=wa.map,a={precedence:t,operation:wa.wrapOperation(i)};r.inst.set(e,a)}static hasOperator(e){return wa.map.inst.has(e)}static getOperatorPrecedence(e){return wa.map.inst.get(e).precedence}static getMaxOperatorLength(){return ds.reduce(Qu.toArray(Pt.adaptIterator(wa.map.inst.keys())),function(e,t){return t.length>e?t.length:e},0)}static wrapOperation(e){return function(t,i){return Ee.isNA(t)||Ee.isNA(i)?Ee.fromValueType(dt.VNA):Ee.isNM(t)||Ee.isNM(i)?Ee.fromValueType(dt.VNM):e(t,i)}}static get __name__(){return"haxpression.BinaryOperations"}get __class__(){return wa}},"BinaryOperations");Wt.map=new Xe,Wt.addOperator("||",1,function(n,e){return Ee.fromBool(Ee.toBool(n)||Ee.toBool(e))}),Wt.addOperator("&&",2,function(n,e){return Ee.fromBool(Ee.toBool(n)&&Ee.toBool(e))}),Wt.addOperator("|",3,function(n,e){return Ee.fromInt(Ee.toInt(n)|Ee.toInt(e))}),Wt.addOperator("^",4,function(n,e){return Ee.fromInt(Ee.toInt(n)^Ee.toInt(e))}),Wt.addOperator("&",5,function(n,e){return Ee.fromInt(Ee.toInt(n)&Ee.toInt(e))}),Wt.addOperator("==",6,function(n,e){return Ee.fromBool(Ee.toFloat(n)==Ee.toFloat(e))}),Wt.addOperator("!=",6,function(n,e){return Ee.fromBool(Ee.toFloat(n)!=Ee.toFloat(e))}),Wt.addOperator("<",7,function(n,e){return Ee.fromBool(Ee.toFloat(n)",7,function(n,e){return Ee.fromBool(Ee.toFloat(n)>Ee.toFloat(e))}),Wt.addOperator("<=",7,function(n,e){return Ee.fromBool(Ee.toFloat(n)<=Ee.toFloat(e))}),Wt.addOperator(">=",7,function(n,e){return Ee.fromBool(Ee.toFloat(n)>=Ee.toFloat(e))}),Wt.addOperator("<<",8,function(n,e){return Ee.fromInt(Ee.toInt(n)<>",8,function(n,e){return Ee.fromInt(Ee.toInt(n)>>Ee.toInt(e))}),Wt.addOperator(">>>",8,function(n,e){return Ee.fromInt(Ee.toInt(n)>>>Ee.toInt(e))}),Wt.addOperator("+",9,function(n,e){return Ee.fromFloat(Ee.toFloat(n)+Ee.toFloat(e))}),Wt.addOperator("-",9,function(n,e){return Ee.fromFloat(Ee.toFloat(n)-Ee.toFloat(e))}),Wt.addOperator("*",10,function(n,e){return Ee.fromFloat(Ee.toFloat(n)*Ee.toFloat(e))}),Wt.addOperator("/",10,function(n,e){return Ee.fromFloat(Ee.toFloat(n)/Ee.toFloat(e))}),Wt.addOperator("%",10,function(n,e){return Ee.fromFloat(Ee.toFloat(n)%Ee.toFloat(e))}),Wt.addOperator("**",11,function(n,e){return Ee.fromFloat(Math.pow(Ee.toFloat(n),Ee.toFloat(e)))});var lse=D.$global,vt=D.global("$hxClasses")["haxpression._Expression.Expression"]=s(class Me{static fromExpressionType(e){return e}static toExpressionType(e){return e}static simplify(e){switch(e._hx_index){case 0:let t=e.value;return Me.fromExpressionType(Ve.ELiteral(t));case 1:let i=e.name;return Me.fromExpressionType(Ve.EIdentifier(i));case 2:let r=e.operator2,a=e.operand;return Me.canEvaluate(Me.fromExpressionType(a))?Me.fromExpressionType(Ve.ELiteral(Ee.toValueType(pr.evaluate(r,Me.evaluate(Me.fromExpressionType(a)))))):Me.fromExpressionType(Ve.EUnary(r,Me.toExpressionType(Me.simplify(Me.fromExpressionType(a)))));case 3:let o=e.operator2,l=e.left,u=e.right;return Me.canEvaluate(Me.fromExpressionType(l))&&Me.canEvaluate(Me.fromExpressionType(u))?Me.fromExpressionType(Ve.ELiteral(Ee.toValueType(Wt.evaluate(o,Me.evaluate(Me.fromExpressionType(l)),Me.evaluate(Me.fromExpressionType(u)))))):Me.fromExpressionType(Ve.EBinary(o,Me.toExpressionType(Me.simplify(Me.fromExpressionType(l))),Me.toExpressionType(Me.simplify(Me.fromExpressionType(u)))));case 4:let c=e.callee,d=e.arguments;return Ri.canEvaluateAll(d)?Me.fromExpressionType(Ve.ELiteral(Ee.toValueType(nn.evaluate(c,Ri.evaluate(d))))):Me.fromExpressionType(Ve.ECall(c,Ri.simplify(d)));case 5:let m=e.test,p=e.consequent,f=e.alternate;return Me.canEvaluate(Me.fromExpressionType(m))?Ee.toBool(Me.evaluate(Me.fromExpressionType(m)))?Me.simplify(Me.fromExpressionType(p)):Me.simplify(Me.fromExpressionType(f)):Me.fromExpressionType(Ve.EConditional(Me.toExpressionType(Me.simplify(Me.fromExpressionType(m))),Me.toExpressionType(Me.simplify(Me.fromExpressionType(p))),Me.toExpressionType(Me.simplify(Me.fromExpressionType(f)))));case 6:let _=e.items;return Me.fromExpressionType(Ve.EArray(Ri.simplify(_)));case 7:let g=e.items;return Me.fromExpressionType(Ve.ECompound(Ri.simplify(g)))}}static canEvaluate(e){switch(e._hx_index){case 0:let t=e.value;return!0;case 1:let i=e.name;return!1;case 2:let r=e.operator2,a=e.operand;return Me.canEvaluate(Me.fromExpressionType(a));case 3:let o=e.operator2,l=e.left,u=e.right;return Me.canEvaluate(Me.fromExpressionType(l))?Me.canEvaluate(Me.fromExpressionType(u)):!1;case 4:let c=e.callee,d=e.arguments;return nn.canEvaluate(c,d);case 5:let m=e.test,p=e.consequent,f=e.alternate;return Me.canEvaluate(Me.fromExpressionType(m))?Ee.toBool(Me.evaluate(Me.fromExpressionType(m)))?Me.canEvaluate(Me.fromExpressionType(p)):Me.canEvaluate(Me.fromExpressionType(f)):!1;case 6:let _=e.items;return Ri.canEvaluateAll(_);case 7:let g=e.items;return Ri.canEvaluateAll(g)}}static evaluate(e,t){switch(t==null&&(t=new Xe),e._hx_index){case 0:let i=e.value;return Ee.fromValueType(i);case 1:let r=e.name;if(!t.inst.has(r))throw he.thrown(new Nt("cannot evaluate expression with unset variable: "+r));return t.inst.get(r);case 2:let a=e.operator2,o=e.operand,l=Me.evaluate(Me.fromExpressionType(o),t);return pr.evaluate(a,l);case 3:let u=e.operator2,c=e.left,d=e.right,m=Me.evaluate(Me.fromExpressionType(c),t),p=Me.evaluate(Me.fromExpressionType(d),t);return Wt.evaluate(u,m,p);case 4:let f=e.callee,_=e.arguments;return nn.evaluate(f,Ri.evaluate(_,t));case 5:let g=e.test,h=e.consequent,v=e.alternate;return Ee.toBool(Me.evaluate(Me.fromExpressionType(g),t))?Me.evaluate(Me.fromExpressionType(h),t):Me.evaluate(Me.fromExpressionType(v),t);case 6:let y=e.items;if(y.length==0)return Ee.fromValueType(dt.VNA);{let b=Ri.evaluate(y,t);return b[b.length-1]}break;case 7:let k=e.items;if(k.length==0)return Ee.fromValueType(dt.VNA);{let b=Ri.evaluate(k,t);return b[b.length-1]}break}}static isCompound(e){let t=Me.toExpressionType(e);if(t._hx_index==7){let i=t.items;return!0}else return!1}static get __name__(){return"haxpression._Expression.Expression_Impl_"}get __class__(){return Me}},"Expression");var wse=D.$global,n1=D.global("$hxClasses")["haxpression.Parser"]=s(class cp extends D.inherits(){new(e){this.inputString=e,this.index=0,this.length=e.length,this.expressions=[]}internalParse(){for(;this.index0;){if(Wt.hasOperator(e))return this.index+=t,e;--t,e=it.substr(e,0,t)}return null}gobbleBinaryExpression(){let e,t,i,r,a,o,l,u=this.gobbleToken(),c=this.gobbleBinaryOperator();if(c==null)return u;let d={op:c,precedence:Wt.getOperatorPrecedence(c)},m=this.gobbleToken();if(m==null)throw he.thrown(new Nt('expected expression after binary op: "'+c+'"',this.inputString,this.index));let p=[u,d,m];for(;c=this.gobbleBinaryOperator(),!(c==null||(r=Wt.getOperatorPrecedence(c),r==0));){for(d={op:c,precedence:r};p.length>2&&r<=p[p.length-2].precedence;){m=p.pop(),c=p.pop().op,u=p.pop();let _=Ve.EBinary(c,vt.toExpressionType(u),vt.toExpressionType(m));p.push(_)}if(t=this.gobbleToken(),t==null)throw he.thrown(new Nt('expected expression after binary op: "'+c+'"',this.inputString,this.index));p.push(d),p.push(t)}let f=p.length-1;for(t=p[f];f>1;)t=vt.fromExpressionType(Ve.EBinary(p[f-1].op,p[f-2],vt.toExpressionType(t))),f-=2;return t}gobbleToken(){this.gobbleSpaces();let e=this.charCodeAt(this.index);if(Qe.isDecimalDigit(e)||e==Qe.PERIOD_CODE)return this.gobbleNumericLiteral();if(e==Qe.SINGLE_QUOTE_CODE||e==Qe.DOUBLE_QUOTE_CODE)return this.gobbleStringLiteral();if(Qe.isIdentifierStart(e)||e==Qe.OPEN_PAREN_CODE)return this.gobbleVariable();if(e==Qe.OPEN_BRACKET_CODE)return this.gobbleArray();{let t=it.substr(this.inputString,this.index,pr.getMaxOperatorLength()),i=t.length;for(;i>0;){if(pr.hasOperator(t))return this.index+=i,vt.fromExpressionType(Ve.EUnary(t,vt.toExpressionType(this.gobbleToken())));--i,t=it.substr(t,0,i)}return null}}gobbleNumericLiteral(){let e="";for(;this.index=this.length)return vt.fromExpressionType(Ve.ELiteral(dt.VFloat(parseFloat(e))));let i=this.charCodeAt(this.index);if(Qe.isIdentifierStart(i))throw he.thrown(new Nt('variable names cannot start with a number: "'+e+this.charAt(this.index)+'"',this.inputString,this.index));if(i==Qe.PERIOD_CODE)throw he.thrown(new Nt('unexpected period in numeric literal: "'+e+this.charAt(this.index)+'"',this.inputString,this.index));return vt.fromExpressionType(Ve.ELiteral(dt.VFloat(parseFloat(e))))}gobbleStringLiteral(){let e="",t=this.charAt(this.index++),i=!1;for(;this.index({_hx_index:0,__enum__:"mcl.FlattenedType",value:n,"@kind":"FLiteral"}),{_hx_name:"FLiteral",__params__:["value"]}),FIdentifier:Object.assign(n=>({_hx_index:1,__enum__:"mcl.FlattenedType",name:n,"@kind":"FIdentifier"}),{_hx_name:"FIdentifier",__params__:["name"]}),FUnary:Object.assign((n,e)=>({_hx_index:2,__enum__:"mcl.FlattenedType",operant:n,operand:e,"@kind":"FUnary"}),{_hx_name:"FUnary",__params__:["operant","operand"]}),FBinary:Object.assign((n,e,t)=>({_hx_index:3,__enum__:"mcl.FlattenedType",operant:n,left:e,right:t,"@kind":"FBinary"}),{_hx_name:"FBinary",__params__:["operant","left","right"]}),FAdd:Object.assign(n=>({_hx_index:4,__enum__:"mcl.FlattenedType",item:n,"@kind":"FAdd"}),{_hx_name:"FAdd",__params__:["item"]}),FMul:Object.assign(n=>({_hx_index:5,__enum__:"mcl.FlattenedType",item:n,"@kind":"FMul"}),{_hx_name:"FMul",__params__:["item"]}),FCall:Object.assign((n,e)=>({_hx_index:6,__enum__:"mcl.FlattenedType",callee:n,args:e,"@kind":"FCall"}),{_hx_name:"FCall",__params__:["callee","args"]}),FConditional:Object.assign((n,e,t)=>({_hx_index:7,__enum__:"mcl.FlattenedType",test:n,consequent:e,alternate:t,"@kind":"FConditional"}),{_hx_name:"FConditional",__params__:["test","consequent","alternate"]}),FArray:Object.assign(n=>({_hx_index:8,__enum__:"mcl.FlattenedType",items:n,"@kind":"FArray"}),{_hx_name:"FArray",__params__:["items"]}),FCompound:Object.assign(n=>({_hx_index:9,__enum__:"mcl.FlattenedType",items:n,"@kind":"FCompound"}),{_hx_name:"FCompound",__params__:["items"]})};bn.__constructs__=[bn.FLiteral,bn.FIdentifier,bn.FUnary,bn.FBinary,bn.FAdd,bn.FMul,bn.FCall,bn.FConditional,bn.FArray,bn.FCompound];bn.__empty_constructs__=[];var i1=D.global("$hxClasses")["mcl.McMath"]=s(class pt{static flatten(e){switch(e._hx_index){case 0:let t=e.value;return bn.FLiteral(t);case 1:let i=e.name;return bn.FIdentifier(i);case 2:let r=e.operator2,a=e.operand;return bn.FUnary(r,pt.flatten(a));case 3:let o=e.operator2,l=e.left,u=e.right;if(o=="+"){let A=new Array,V=0,K=null;return K=s(function(te){switch(te._hx_index){case 0:let fe=te.value;switch(fe._hx_index){case 0:let ae=fe.v;ae==Math.floor(ae)?V+=Math.floor(ae):A.push(pt.flatten(te));break;case 1:let ee=fe.v;V+=ee;break;default:A.push(pt.flatten(te))}break;case 3:if(te.operator2=="+"){let ae=te.left,ee=te.right;K(ae),K(ee)}else A.push(pt.flatten(te));break;default:A.push(pt.flatten(te))}},"flattenAdd"),K(e),V!=0&&A.push(bn.FLiteral(dt.VInt(V))),bn.FAdd(A)}if(o=="*"){let A=new Array,V=1,K=null;return K=s(function(te){switch(te._hx_index){case 0:let fe=te.value;switch(fe._hx_index){case 0:let ae=fe.v;ae==Math.floor(ae)?V*=Math.floor(ae):A.push(pt.flatten(te));break;case 1:let ee=fe.v;V*=ee;break;default:A.push(pt.flatten(te))}break;case 3:if(te.operator2=="*"){let ae=te.left,ee=te.right;K(ae),K(ee)}else A.push(pt.flatten(te));break;default:A.push(pt.flatten(te))}},"flattenMul"),K(e),V!=1&&A.push(bn.FLiteral(dt.VInt(V))),bn.FMul(A)}return bn.FBinary(o,pt.flatten(l),pt.flatten(u));case 4:let c=e.callee,d=e.arguments,m=pt.flatten,p=new Array(d.length),f=0,_=d.length;for(;f<_;){let A=f++;p[A]=m(d[A])}return bn.FCall(c,p);case 5:let g=e.test,h=e.consequent,v=e.alternate;return bn.FConditional(pt.flatten(g),pt.flatten(h),pt.flatten(v));case 6:let y=e.items,k=pt.flatten,b=new Array(y.length),x=0,E=y.length;for(;x=97&&E<=122||E>=65&&E<=90||E>=48&&E<=57||E==46||E==95||E==36||E==35?!0:E==64},"isAlphaNumeric"),f=0,_=s(function(){return f+=1,"var"+f},"getNextVarName"),g="";for(;m=97&&E<=122||E>=65&&E<=90){let C="";for(;m({_hx_index:6,__enum__:"ValueType",c:n,"@kind":"TClass"}),{_hx_name:"TClass",__params__:["c"]}),TEnum:Object.assign(n=>({_hx_index:7,__enum__:"ValueType",e:n,"@kind":"TEnum"}),{_hx_name:"TEnum",__params__:["e"]}),TUnknown:{_hx_name:"TUnknown",_hx_index:8,__enum__:"ValueType","@kind":"TUnknown"}};ft.__constructs__=[ft.TNull,ft.TInt,ft.TFloat,ft.TBool,ft.TObject,ft.TFunction,ft.TClass,ft.TEnum,ft.TUnknown];ft.__empty_constructs__=[ft.TNull,ft.TInt,ft.TFloat,ft.TBool,ft.TObject,ft.TFunction,ft.TUnknown];var xi=D.global("$hxClasses").Type=s(class up{static createInstance(e,t){let i=Function.prototype.bind.apply(e,[null].concat(t));return new i}static createEnum(e,t,i){let r=rn.field(e,t);if(r==null)throw he.thrown("No such constructor "+t);if(rn.isFunction(r)){if(i==null)throw he.thrown("Constructor "+t+" need parameters");return r.apply(e,i)}if(i!=null&&i.length!=0)throw he.thrown("Constructor "+t+" does not need parameters");return r}static typeof(e){switch(typeof e){case"boolean":return ft.TBool;case"function":return e.__name__||e.__ename__?ft.TObject:ft.TFunction;case"number":return Math.ceil(e)==e%2147483648?ft.TInt:ft.TFloat;case"object":if(e==null)return ft.TNull;let t=e.__enum__;if(t!=null)return ft.TEnum(D.global("$hxEnums")[t]);let i=Dr.getClass(e);return i!=null?ft.TClass(i):ft.TObject;case"string":return ft.TClass(String);case"undefined":return ft.TNull;default:return ft.TUnknown}}static enumEq(e,t){if(e==t)return!0;try{let i=e.__enum__;if(i==null||i!=t.__enum__||e._hx_index!=t._hx_index)return!1;let a=D.global("$hxEnums")[i].__constructs__[e._hx_index].__params__,o=0;for(;o=this.max}next(){let e=this.current;if(!this.hasNext())throw he.thrown("No such element");return this.current+=this.offset,e}static get __name__(){return"mcl.McIntIterator"}get __class__(){return s1}},"McIntIterator"),Wz=D.global("$hxClasses")["mcl.McFloatIterator"]=s(class l1 extends D.inherits(){new(e,t,i){if(this.min=e,this.max=t,this.current=e,this.offset=i,i<0&&e0&&e>t)throw he.thrown("Invalid step for range")}hasNext(){return this.offset>0?this.current<=this.max:this.current>=this.max}next(){let e=this.current;if(!this.hasNext())throw he.thrown("No such element");return this.current+=this.offset,e}static get __name__(){return"mcl.McFloatIterator"}get __class__(){return l1}},"McFloatIterator"),xa=D.global("$hxClasses")["mcl.Globals"]=s(class _s{static set(e,t){_s.map.inst.set(e,t)}static get(e){return _s.map.inst.get(e)}static has(e){return _s.map.inst.has(e)}static delete(e){return _s.map.inst.delete(e)}static get __name__(){return"mcl.Globals"}get __class__(){return _s}},"Globals");xa.loopVariants=function(n){var e;let t=new ps;return t.inst.set([ft.TInt,ft.TInt],function(i){let r=i[0],a=i[1];return new Kz(r,a)}),t.inst.set([ft.TFloat,ft.TFloat,ft.TFloat],function(i){let r=i[0],a=i[1],o=i[2];return new Wz(r,a,o)}),t.inst.set([ft.TClass(Array)],function(i){return new Wl(i[0])}),t.inst.set([ft.TFunction],function(i){let r=i[0];return new Wl(Array.from(r()))}),e=t,e}(void 0);xa.map=function(n){var e;let t=new Xe;return t.inst.set("REPEAT",function(...i){let r=i.length,a=xa.loopVariants,o=a,l=a.keys();for(;l.hasNext();){let p=l.next(),f=o.get(p),g=p,h=f;if(g.length==r){let v=!1,y=0,k=r;for(;y({_hx_index:3,__enum__:"haxe.io.Error",e:n,"@kind":"Custom"}),{_hx_name:"Custom",__params__:["e"]})};gr.__constructs__=[gr.Blocked,gr.Overflow,gr.OutsideBounds,gr.Custom];gr.__empty_constructs__=[gr.Blocked,gr.Overflow,gr.OutsideBounds];var ice=D.$global,hr=D.global("$hxEnums")["haxe.io.Encoding"]={__ename__:"haxe.io.Encoding",UTF8:{_hx_name:"UTF8",_hx_index:0,__enum__:"haxe.io.Encoding","@kind":"UTF8"},RawNative:{_hx_name:"RawNative",_hx_index:1,__enum__:"haxe.io.Encoding","@kind":"RawNative"}};hr.__constructs__=[hr.UTF8,hr.RawNative];hr.__empty_constructs__=[hr.UTF8,hr.RawNative];var cce=D.$global,Di=D.global("$hxClasses")["haxe.io.Bytes"]=s(class Yl extends D.inherits(){new(e){this.length=e.byteLength,this.b=new Uint8Array(e),this.b.bufferValue=e,e.hxBytes=this,e.bytes=this.b}getString(e,t,i){if(e<0||t<0||e+t>this.length)throw he.thrown(gr.OutsideBounds);i==null&&(i=hr.UTF8);let r="",a=this.b,o=e,l=e+t;switch(i._hx_index){case 0:let u=e>0;for(;o>8}return new Yl(a.buffer)}let i=new Array,r=0;for(;r>6),i.push(128|a&63)):a<=65535?(i.push(224|a>>12),i.push(128|a>>6&63),i.push(128|a&63)):(i.push(240|a>>18),i.push(128|a>>12&63),i.push(128|a>>6&63),i.push(128|a&63))}return new Yl(new Uint8Array(i).buffer)}static ofData(e){let t=e.hxBytes;return t??new Yl(e)}static get __name__(){return"haxe.io.Bytes"}get __class__(){return Yl}},"Bytes");var pce=D.$global,H1=D.global("$hxClasses")["js.node.buffer._Buffer.Helper"]=s(class $1{static bytesOfBuffer(e){let t=Object.create(Di.prototype);return t.length=e.byteLength,t.b=e,e.bufferValue=e,e.hxBytes=t,e.bytes=e,t}static get __name__(){return"js.node.buffer._Buffer.Helper"}get __class__(){return $1}},"Helper");var yce=D.$global,wp=D.global("$hxClasses")["haxe.crypto.Sha1"]=s(class ld extends D.inherits(){new(){}doEncode(e){let t=new Array,i=1732584193,r=-271733879,a=-1732584194,o=271733878,l=-1009589776,u=0;for(;u>>31}let g=(i<<5|i>>>27)+this.ft(_,r,a,o)+l+t[_]+this.kt(_);l=o,o=a,a=r<<30|r>>>2,r=i,i=g,++_}i+=c,r+=d,a+=m,o+=p,l+=f,u+=16}return[i,r,a,o,l]}ft(e,t,i,r){return e<20?t&i|~t&r:e<40?t^i^r:e<60?t&i|t&r|i&r:t^i^r}kt(e){return e<20?1518500249:e<40?1859775393:e<60?-1894007588:-899497514}hex(e){let t="",i=0;for(;i>6)+1,r=new Array,a=0,o=i*16;for(;a>2;r[p]|=t.b[m]<<24-((m&3)<<3)}let c=t.length,d=c>>2;return r[d]|=128<<24-((c&3)<<3),r[i*16-1]=t.length*8,r}static get __name__(){return"haxe.crypto.Sha1"}get __class__(){return ld}},"Sha1");var Cce=D.$global,q1=D.global("$hxClasses")["haxe.crypto.BaseCode"]=s(class K1 extends D.inherits(){new(e){let t=e.length,i=1;for(;t>1<8||t!=1<>3,o=new Di(new ArrayBuffer(a)),l=0,u=0,c=0,d=0;for(;d>u&255}return o}static get __name__(){return"haxe.crypto.BaseCode"}get __class__(){return K1}},"BaseCode");var Bce=D.$global,Ql=D.global("$hxClasses")["haxe.crypto.Base64"]=s(class xp{static decode(e,t){if(t==null&&(t=!0),t)for(;it.cca(e,e.length-1)==61;)e=it.substr(e,0,-1);return new q1(xp.BYTES).decodeBytes(Di.ofString(e))}static get __name__(){return"haxe.crypto.Base64"}get __class__(){return xp}},"Base64");Ql.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";Ql.BYTES=Di.ofString(Ql.CHARS);var Lce=D.$global,Ep=D.global("$hxClasses")["haxe.Resource"]=s(class kp{static getString(e){let t=0,i=kp.content;for(;t0){let r=this.loadBlock[0].pos;i.push(Ae.FunctionDef(r,"load",this.loadBlock,"minecraft:load"))}if(this.tickBlock!=null&&this.tickBlock.length>0){let r=this.tickBlock[0].pos;i.push(Ae.FunctionDef(r,"tick",this.tickBlock,"minecraft:tick"))}if(i.length>0){let r=i[0].pos,a=e.compiler.getInitialPathInfo(this.file.name),o={append:function(u){throw new Pe(Je.formatContext("tried to append to a Void context (template virtual context)",r,e),!1,[r].concat(e.stack))},namespace:a.namespace,path:a.path,uidIndex:e.uidIndex,variables:new cn(e.globalVariables),templates:this.file.templates,stack:e.stack,replacements:new cn(null),isTemplate:!1,requireTemplateKeyword:!0,compiler:e.compiler,globalVariables:e.globalVariables,functions:e.functions,baseNamespaceInfo:e.baseNamespaceInfo,currentFunction:e.currentFunction},l=Ae.Directory(r,this.name,i);t.embed(o,r,new Xe,[l],!0)}}injectTransform(e,t){this.hasBeenUsed=!0;let i=[];if(this.loadBlock!=null&&this.loadBlock.length>0){let r=this.loadBlock[0].pos;i.push(Ae.FunctionDef(r,"load",this.loadBlock,"minecraft:load"))}if(this.tickBlock!=null&&this.tickBlock.length>0){let r=this.tickBlock[0].pos;i.push(Ae.FunctionDef(r,"tick",this.tickBlock,"minecraft:tick"))}if(i.length>0){let r=i[0].pos,a=e.compiler.getInitialPathInfo(this.file.name),o={append:function(u){throw new Pe(Je.formatContext("tried to append to a Void context (template virtual context)",r,e),!1,[r].concat(e.stack))},namespace:a.namespace,path:a.path,uidIndex:e.uidIndex,variables:new cn(e.globalVariables),templates:this.file.templates,stack:e.stack,replacements:new cn(null),isTemplate:!1,requireTemplateKeyword:!0,compiler:e.compiler,globalVariables:e.globalVariables,functions:e.functions,baseNamespaceInfo:e.baseNamespaceInfo,currentFunction:e.currentFunction},l=Ae.Directory(r,this.name,i);t.embedTransform(o,r,new Xe,[l],!0)}return Ae.Void}process(e,t,i,r,a){let o=Ct.ltrim(r.substring(this.name.length));this.jsValueCache.clear(),_t.jsCache=this.jsValueCache;let l=this.overloads,u=l,c=l.keys();for(;c.hasNext();){let d=c.next(),m=u.get(d),f=d,_=m,g=new Xe,h=0,v=0,y=[o].concat(a??[]),k=!1,b=0,x=0;for(;x=y.length)break;if(C.expectBlock){if(!xi.enumEq(xi.typeof(y[v]),ft.TEnum(Ae)))break;let j=C.parseValueBlock(y[v],i,t);if(!j.success)break;k=!0,g.inst.set(C.name,j.value),y[v]=j.raw,++h,++v}else{if(typeof y[v]!="string")break;let j=y[v],S=null;if(j.charAt(0)=="<"&&j.charAt(1)=="%"&&!C.expectJsValue){let O=j.indexOf("%>");if(O==-1)throw new Pe(Je.formatContext("Unexpected end of inline script block",i,t),!1,[i].concat(t.stack));let A=j.substring(2,O);if(S=A,this.jsValueCache.inst.has(b)){let V=this.jsValueCache.inst.get(b);j=V==null?"null":Fe.string(V)}else{let V=lo.invokeExpressionInline(A,t,i);this.jsValueCache.inst.set(b,V),j=V==null?"null":Fe.string(V)}++b}else C.expectJsValue&&(_t.jsCacheIdx=b,++b);let B=C.parseValue(j,i,t);if(!B.success)break;C.name!=null&&g.inst.set(C.name,B.value),S!=null?y[v]=Ct.ltrim(Dr.__cast(y[v],String).substring(S.length+4)):y[v]=Ct.ltrim(Dr.__cast(y[v],String).substring(B.raw.length)),++h,k=!1}}for(;v=y.length)break;if(j.expectBlock){if(!xi.enumEq(xi.typeof(y[v]),ft.TEnum(Ae)))break;let S=j.parseValueBlock(y[v],i,t);if(!S.success)break;k=!0,g.inst.set(j.name,S.value),y[v]=S.raw,++h,++v}else{if(typeof y[v]!="string")break;let S=y[v],B=null;if(S.charAt(0)=="<"&&S.charAt(1)=="%"&&!j.expectJsValue){let A=S.indexOf("%>");if(A==-1)throw new Pe(Je.formatContext("Unexpected end of inline script block",i,t),!1,[i].concat(t.stack));let V=S.substring(2,A);if(B=V,this.jsValueCache.inst.has(b)){let K=this.jsValueCache.inst.get(b);S=K==null?"null":Fe.string(K)}else{let K=lo.invokeExpressionInline(V,t,i);this.jsValueCache.inst.set(b,K),S=K==null?"null":Fe.string(K)}++b}else j.expectJsValue&&(_t.jsCacheIdx=b,++b);let O=j.parseValue(S,i,t);if(!O.success)break;j.name!=null&&g.inst.set(j.name,O.value),B!=null?y[v]=Ct.ltrim(Dr.__cast(y[v],String).substring(B.length+4)):y[v]=Ct.ltrim(Dr.__cast(y[v],String).substring(O.raw.length)),++h,k=!1}}for(;v({_hx_index:0,__enum__:"mcl.ImportFileType",f:n,"@kind":"IMcFile"}),{_hx_name:"IMcFile",__params__:["f"]}),IJsFile:Object.assign(n=>({_hx_index:1,__enum__:"mcl.ImportFileType",f:n,"@kind":"IJsFile"}),{_hx_name:"IJsFile",__params__:["f"]})};so.__constructs__=[so.IMcFile,so.IJsFile];so.__empty_constructs__=[];var lo=D.global("$hxClasses")["mcl.McFile"]=s(class oo extends D.inherits(){new(e,t){this.tagsDir="tags",this.functionsDir="functions",this.fileJs={},this.tickCommands=[],this.loadCommands=[],this.imports=new Xe,this.exportedTemplates=new Xe,this.templates=new Xe,this.ast=[],this.name=e,this.ast=t,this.ext=He.extension(e)}getTemplates(){if(this.ext=="mcbt")return this.exportedTemplates;throw new Pe("tried to get templates from non-template file:"+this.name,!0)}setup(e){e.config.features.useFolderRenames48&&(this.functionsDir="function");let t=this.ast;this.ast=[];let i=0;for(;i0&&A.endsWith(".mcfunction")&&(V=r.compiler.config.header+` +`+V),r.compiler.io.write(A,V);let K="function "+r.namespace+":"+r.path.concat([c]).join("/"),te=i==null?"":" "+this.injectValues(i,r,e);return(o?"$":"")+(K+te)}embedTransform(e,t,i,r,a){a==null&&(a=!1);let o=e.namespace,l=e.append,u=e.globalVariables,c=new cn(cn.globals,(i==null?u:new cn(u,i)).get()),d=e.path,m={append:l,namespace:o,path:d??[],uidIndex:e.uidIndex,variables:c,stack:e.stack,replacements:e.replacements,isTemplate:this.ext=="mcbt",templates:e.templates,requireTemplateKeyword:e.requireTemplateKeyword,compiler:e.compiler,globalVariables:e.globalVariables,functions:e.functions,baseNamespaceInfo:e.baseNamespaceInfo,currentFunction:e.currentFunction},p=[],f=0;for(;f0)throw new Pe(Je.formatContext("Unexpected extra data in non template command",t,e),!1,[t].concat(e.stack))}return Ae.Raw(t,this.injectValues(i,e,t),r,a)}processTemplate(e,t,i,r,a){if(e.compiler.templateParsingEnabled){i.startsWith("template ")&&(i=i.substring(9));let l=e.templates,u=l,c=l.keys();for(;c.hasNext();){let d=c.next(),m=u.get(d),f=d,_=m;if(i==f||i.startsWith(f)){_.process(this,e,t,i,r);return}}if(r!=null&&r.length>0)throw new Pe(Je.formatContext("Unexpected extra data in non template command",t,e),!1,[t].concat(e.stack))}let o=this.injectValues(i,e,t);e.append((a?"$":"")+o)}compileInline(e,t,i){i==null&&(i=!1);let r=ni.tokenize(t,""),a=new io(r),o=[];for(;a.hasNext();)i?o.push(tn.parseTLD(a)):o.push(tn.innerParse(a));if(i){let l=0;for(;l"),a=new io(r),o=[];for(;a.hasNext();)i?o.push(tn.parseTLD(a)):o.push(tn.innerParse(a));let l;if(i){let u=[],c=0;for(;c0&&b.endsWith(".mcfunction")&&(x=e.compiler.config.header+` +`+x),e.compiler.io.write(b,x);let E=""+e.namespace+":"+e.path.concat([k]).join("/");return e.append("function "+E+(y==null?"":" "+y)),E},"emitBlock");u.mcb=d,r||(u.block=m);let p=[u,e,function(v){if(r)throw new Pe(Je.formatContext("embed not available in toplevel script blocks",t,e),!1,[t].concat(e.stack));return v.embedTo(e,t,c)},e.compiler.disableRequire?function(v){throw new Pe(Je.formatContext("Require not available as it has been disabled, please disable compiler.disableRequire",t,e),!1,[t].concat(e.stack))}:Sp.createRequire(this.name)],_=e.variables.get(),g=_,h=_.keys();for(;h.hasNext();){let v=h.next(),y=g.get(v),b=v,x=y;l.push(b),p.push(x)}try{new Function(...l,a)(...p)}catch(v){let y=he.caught(v);throw y instanceof yi?he.thrown(y):new Pe(Je.formatContext("Error in multi-line script, '"+y.get_message()+"' at "+t.file+":"+t.line+":"+(t.col+1),t,e),!1,[t].concat(e.stack))}}processMlScriptTransform(e,t,i,r){r==null&&(r=!1);let a="",o=0;for(;o0&&Q.endsWith(".mcfunction")&&(st=t.compiler.config.header+` +`+st),t.compiler.io.write(Q,st);let at=t,Vt=this.injectValues((U?"$":"")+(""+xe+" function "+Y+(ne==null?"":" "+ne)),t,oe);if(at.append(Vt),W!=null){let yt=0,kn=0;for(;kn0&&N_.endsWith(".mcfunction")&&(Qd=t.compiler.config.header+` +`+Qd),t.compiler.io.write(N_,Qd);let Ew=t,Tw="execute if score #ifelse "+t.compiler.config.internalScoreboardName+" matches 0 run function "+t.namespace+":"+t.path.concat([t.compiler.config.generatedDirName,Xd]).join("/");Ew.append((bw?"$":"")+(Tw+(j_==null?"":" "+j_)));break;case 11:let XJ=dn.continuations,YJ=dn.pos,ef=dn.execute,B_=dn.data,R_=dn.body,Cw=dn.isMacro,D_=["scoreboard players set #ifelse "+t.compiler.config.internalScoreboardName+" 1"],Aw=s(function(Ra){D_.push(Ra)},"embedAppend"),tf=Fe.string(t.uidIndex.get()),Sw=""+t.namespace+":"+t.path.concat([t.compiler.config.generatedDirName,tf]).join("/"),jw=t.functions.concat([Sw]),M_=t.path,Iw={append:Aw,namespace:t.namespace,path:M_??[],uidIndex:t.uidIndex,variables:t.variables,stack:t.stack,replacements:t.replacements,isTemplate:this.ext=="mcbt",templates:t.templates,requireTemplateKeyword:t.requireTemplateKeyword,compiler:t.compiler,globalVariables:t.globalVariables,functions:jw,baseNamespaceInfo:t.baseNamespaceInfo,currentFunction:t.currentFunction},nf=0;for(;nf0&&F_.endsWith(".mcfunction")&&(rf=t.compiler.config.header+` +`+rf),t.compiler.io.write(F_,rf);let Nw=ef.startsWith("execute ")?ef.substring(8):ef,Bw=t,Rw="execute if score #ifelse "+t.compiler.config.internalScoreboardName+" matches 0 "+Nw+" function "+t.namespace+":"+t.path.concat([t.compiler.config.generatedDirName,tf]).join("/");Bw.append((Cw?"$":"")+(Rw+(B_==null?"":" "+B_)));break;default:let L_=dn.pos;throw new Pe(Je.formatContext("Unexpected continuation type: "+Fe.string(dn),L_,H),!1,[L_].concat(H.stack))}++yt}}break;case 12:let We=e.pos,wt=e.delay,Jt=e.type,X=e.body,et=e.isMacro;wt=this.injectValues(wt,t,We),Jt=this.injectValues(Jt,t,We);let si=[],Ei=s(function(yt){si.push(yt)},"append1"),Ti=Fe.string(t.uidIndex.get()),Fn=""+t.namespace+":"+t.path.concat([t.compiler.config.generatedDirName,Ti]).join("/"),an=t.functions.concat([Fn]),Bt=t.path,mn={append:Ei,namespace:t.namespace,path:Bt??[],uidIndex:t.uidIndex,variables:t.variables,stack:t.stack,replacements:t.replacements,isTemplate:this.ext=="mcbt",templates:t.templates,requireTemplateKeyword:t.requireTemplateKeyword,compiler:t.compiler,globalVariables:t.globalVariables,functions:an,baseNamespaceInfo:t.baseNamespaceInfo,currentFunction:t.currentFunction},Mt=0;for(;Mt0&&It.endsWith(".mcfunction")&&(Zt=t.compiler.config.header+` +`+Zt),t.compiler.io.write(It,Zt);let pn=t,wn="schedule function "+t.namespace+":"+t.path.concat([t.compiler.config.generatedDirName,Ft]).join("/")+" "+wt+" "+Jt;pn.append((et?"$":"")+wn);break;case 15:let er=e.pos,ei=e.value;t.compiler.config.dontEmitComments||t.append(ei);break;case 19:let li=e.pos,Jn=e.command,po=e.value,Aa=e.isMacro,ve=[],vr=t.path,lc={append:function(yt){ve.push(yt)},namespace:t.namespace,path:vr??[],uidIndex:t.uidIndex,variables:t.variables,stack:t.stack,replacements:t.replacements,isTemplate:this.ext=="mcbt",templates:t.templates,requireTemplateKeyword:t.requireTemplateKeyword,compiler:t.compiler,globalVariables:t.globalVariables,functions:t.functions,baseNamespaceInfo:t.baseNamespaceInfo,currentFunction:t.currentFunction};if(this.compileCommand(po,lc),ve.length!=1)throw new Pe(Je.formatContext("Expected exactly 1 command after execute, got "+ve.length,li,t),!1,[li].concat(t.stack));let Hd=t,E_=this.injectValues((Aa?"$":"")+(""+Jn+" "+ve[0]),t,li);Hd.append(E_);break;case 20:let js=e.pos,$d=e.name,cc=e.data,uc=e.isMacro,T_=t,qd="function "+this.evaluateFunctionHandle($d,t,js,uc),Kd=cc.length==0?"":" "+this.injectValues(cc,t,js),C_=this.injectValues((uc?"$":"")+(qd+Kd),t,js);T_.append(C_);break;case 21:let Wd=e.pos,Zd=e.command,Is=i1.compile(this.injectValues(Zd,t,Wd),t);t.append(Is.commands);let ta="scoreboard objectives add "+t.compiler.config.eqConstScoreboardName+" dummy";this.loadCommands.includes(ta)||this.loadCommands.push(ta),ta="scoreboard objectives add "+t.compiler.config.eqVarScoreboardName+" dummy",this.loadCommands.includes(ta)||this.loadCommands.push(ta);let Sa=0,mt=Is.constants;for(;Sa0&&f.endsWith(".mcfunction")&&(_=a.compiler.config.header+` -`+_),a.compiler.io.write(f,_)}compileDirectory(e,t,i,r){t=this.injectValues(t,r,e);let a=r.namespace,o=r.variables,l=r.path.concat([t]),c=new up,u={append:function(m){throw new Me(Ve.formatContext("append not available for directory context",e,r),!0,[e].concat(r.stack))},namespace:a,path:l??[],uidIndex:c,variables:o,stack:r.stack,replacements:r.replacements,isTemplate:this.ext=="mcbt",templates:r.templates,requireTemplateKeyword:r.requireTemplateKeyword,compiler:r.compiler,globalVariables:r.globalVariables,functions:r.functions,baseNamespaceInfo:r.baseNamespaceInfo,currentFunction:r.currentFunction},d=0;for(;d0&&P.endsWith(".mcfunction")&&(oe=t.compiler.config.header+` -`+oe),t.compiler.io.write(P,oe),t.compiler.tags.addTagEntry("minecraft:load",X,t);break;default:let Z=e.pos;throw new Me(Ve.formatContext("unexpected node type:"+Be.string(e),Z,t),!0,[Z].concat(t.stack))}}compileJsonFile(e,t,i,r){switch(i._hx_index){case 0:let a=i.subType,o=i.replace,l=i.entries;if(a=="function"||a=="functions"){t=r.namespace+":"+r.path.concat([t]).join("/");let fn=0;for(;fn0&&Lt.endsWith(".mcfunction")&&(Ot=r.compiler.config.header+` -`+Ot),r.compiler.io.write(Lt,Ot)}break;case 1:let c=i.entries,u="{"+this.stringifyJsonTag(e,t,c,r)+"}",d;switch(i._hx_index){case 1:let fn=i.entries;d=r.compiler.config.features.useFolderRenames48?"advancement":"advancements";break;case 2:let Dt=i.entries;d=r.compiler.config.features.useFolderRenames48?"item_modifier":"item_modifiers";break;case 3:let bn=i.entries;d=r.compiler.config.features.useFolderRenames48?"loot_table":"loot_tables";break;case 4:let Ft=i.entries;d=r.compiler.config.features.useFolderRenames48?"predicate":"predicates";break;case 5:let Et=i.entries;d=r.compiler.config.features.useFolderRenames48?"recipe":"recipes";break;case 6:let Lt=i.entries;d="chat";break;case 7:let Ot=i.entries;d="damage";break;case 8:let Gt=i.entries;d="dimension";break;case 9:let on=i.entries;d="dimension_type";break;case 10:let gn=i.entries;d="enchantment";break;default:throw new Me(Ve.formatContext("unexpected json tag type:"+Be.string(i),e,r),!0,[e].concat(r.stack))}let m=Ge.join(["data",r.namespace,d].concat(r.path.concat([t+".json"]))),p=u;r.compiler.config.header.length>0&&m.endsWith(".mcfunction")&&(p=r.compiler.config.header+` -`+p),r.compiler.io.write(m,p);break;case 2:let f=i.entries,_="{"+this.stringifyJsonTag(e,t,f,r)+"}",v;switch(i._hx_index){case 1:let fn=i.entries;v=r.compiler.config.features.useFolderRenames48?"advancement":"advancements";break;case 2:let Dt=i.entries;v=r.compiler.config.features.useFolderRenames48?"item_modifier":"item_modifiers";break;case 3:let bn=i.entries;v=r.compiler.config.features.useFolderRenames48?"loot_table":"loot_tables";break;case 4:let Ft=i.entries;v=r.compiler.config.features.useFolderRenames48?"predicate":"predicates";break;case 5:let Et=i.entries;v=r.compiler.config.features.useFolderRenames48?"recipe":"recipes";break;case 6:let Lt=i.entries;v="chat";break;case 7:let Ot=i.entries;v="damage";break;case 8:let Gt=i.entries;v="dimension";break;case 9:let on=i.entries;v="dimension_type";break;case 10:let gn=i.entries;v="enchantment";break;default:throw new Me(Ve.formatContext("unexpected json tag type:"+Be.string(i),e,r),!0,[e].concat(r.stack))}let g=Ge.join(["data",r.namespace,v].concat(r.path.concat([t+".json"]))),h=_;r.compiler.config.header.length>0&&g.endsWith(".mcfunction")&&(h=r.compiler.config.header+` -`+h),r.compiler.io.write(g,h);break;case 3:let b=i.entries,x="{"+this.stringifyJsonTag(e,t,b,r)+"}",y;switch(i._hx_index){case 1:let fn=i.entries;y=r.compiler.config.features.useFolderRenames48?"advancement":"advancements";break;case 2:let Dt=i.entries;y=r.compiler.config.features.useFolderRenames48?"item_modifier":"item_modifiers";break;case 3:let bn=i.entries;y=r.compiler.config.features.useFolderRenames48?"loot_table":"loot_tables";break;case 4:let Ft=i.entries;y=r.compiler.config.features.useFolderRenames48?"predicate":"predicates";break;case 5:let Et=i.entries;y=r.compiler.config.features.useFolderRenames48?"recipe":"recipes";break;case 6:let Lt=i.entries;y="chat";break;case 7:let Ot=i.entries;y="damage";break;case 8:let Gt=i.entries;y="dimension";break;case 9:let on=i.entries;y="dimension_type";break;case 10:let gn=i.entries;y="enchantment";break;default:throw new Me(Ve.formatContext("unexpected json tag type:"+Be.string(i),e,r),!0,[e].concat(r.stack))}let k=Ge.join(["data",r.namespace,y].concat(r.path.concat([t+".json"]))),C=x;r.compiler.config.header.length>0&&k.endsWith(".mcfunction")&&(C=r.compiler.config.header+` -`+C),r.compiler.io.write(k,C);break;case 4:let A=i.entries,I="{"+this.stringifyJsonTag(e,t,A,r)+"}",S;switch(i._hx_index){case 1:let fn=i.entries;S=r.compiler.config.features.useFolderRenames48?"advancement":"advancements";break;case 2:let Dt=i.entries;S=r.compiler.config.features.useFolderRenames48?"item_modifier":"item_modifiers";break;case 3:let bn=i.entries;S=r.compiler.config.features.useFolderRenames48?"loot_table":"loot_tables";break;case 4:let Ft=i.entries;S=r.compiler.config.features.useFolderRenames48?"predicate":"predicates";break;case 5:let Et=i.entries;S=r.compiler.config.features.useFolderRenames48?"recipe":"recipes";break;case 6:let Lt=i.entries;S="chat";break;case 7:let Ot=i.entries;S="damage";break;case 8:let Gt=i.entries;S="dimension";break;case 9:let on=i.entries;S="dimension_type";break;case 10:let gn=i.entries;S="enchantment";break;default:throw new Me(Ve.formatContext("unexpected json tag type:"+Be.string(i),e,r),!0,[e].concat(r.stack))}let L=Ge.join(["data",r.namespace,S].concat(r.path.concat([t+".json"]))),O=I;r.compiler.config.header.length>0&&L.endsWith(".mcfunction")&&(O=r.compiler.config.header+` -`+O),r.compiler.io.write(L,O);break;case 5:let E=i.entries,B="{"+this.stringifyJsonTag(e,t,E,r)+"}",H;switch(i._hx_index){case 1:let fn=i.entries;H=r.compiler.config.features.useFolderRenames48?"advancement":"advancements";break;case 2:let Dt=i.entries;H=r.compiler.config.features.useFolderRenames48?"item_modifier":"item_modifiers";break;case 3:let bn=i.entries;H=r.compiler.config.features.useFolderRenames48?"loot_table":"loot_tables";break;case 4:let Ft=i.entries;H=r.compiler.config.features.useFolderRenames48?"predicate":"predicates";break;case 5:let Et=i.entries;H=r.compiler.config.features.useFolderRenames48?"recipe":"recipes";break;case 6:let Lt=i.entries;H="chat";break;case 7:let Ot=i.entries;H="damage";break;case 8:let Gt=i.entries;H="dimension";break;case 9:let on=i.entries;H="dimension_type";break;case 10:let gn=i.entries;H="enchantment";break;default:throw new Me(Ve.formatContext("unexpected json tag type:"+Be.string(i),e,r),!0,[e].concat(r.stack))}let ee=Ge.join(["data",r.namespace,H].concat(r.path.concat([t+".json"]))),ae=B;r.compiler.config.header.length>0&&ee.endsWith(".mcfunction")&&(ae=r.compiler.config.header+` -`+ae),r.compiler.io.write(ee,ae);break;case 6:let ne=i.entries,ve="{"+this.stringifyJsonTag(e,t,ne,r)+"}",X;switch(i._hx_index){case 1:let fn=i.entries;X=r.compiler.config.features.useFolderRenames48?"advancement":"advancements";break;case 2:let Dt=i.entries;X=r.compiler.config.features.useFolderRenames48?"item_modifier":"item_modifiers";break;case 3:let bn=i.entries;X=r.compiler.config.features.useFolderRenames48?"loot_table":"loot_tables";break;case 4:let Ft=i.entries;X=r.compiler.config.features.useFolderRenames48?"predicate":"predicates";break;case 5:let Et=i.entries;X=r.compiler.config.features.useFolderRenames48?"recipe":"recipes";break;case 6:let Lt=i.entries;X="chat";break;case 7:let Ot=i.entries;X="damage";break;case 8:let Gt=i.entries;X="dimension";break;case 9:let on=i.entries;X="dimension_type";break;case 10:let gn=i.entries;X="enchantment";break;default:throw new Me(Ve.formatContext("unexpected json tag type:"+Be.string(i),e,r),!0,[e].concat(r.stack))}let j=Ge.join(["data",r.namespace,X].concat(r.path.concat([t+".json"]))),Q=ve;r.compiler.config.header.length>0&&j.endsWith(".mcfunction")&&(Q=r.compiler.config.header+` -`+Q),r.compiler.io.write(j,Q);break;case 7:let P=i.entries,oe="{"+this.stringifyJsonTag(e,t,P,r)+"}",Z;switch(i._hx_index){case 1:let fn=i.entries;Z=r.compiler.config.features.useFolderRenames48?"advancement":"advancements";break;case 2:let Dt=i.entries;Z=r.compiler.config.features.useFolderRenames48?"item_modifier":"item_modifiers";break;case 3:let bn=i.entries;Z=r.compiler.config.features.useFolderRenames48?"loot_table":"loot_tables";break;case 4:let Ft=i.entries;Z=r.compiler.config.features.useFolderRenames48?"predicate":"predicates";break;case 5:let Et=i.entries;Z=r.compiler.config.features.useFolderRenames48?"recipe":"recipes";break;case 6:let Lt=i.entries;Z="chat";break;case 7:let Ot=i.entries;Z="damage";break;case 8:let Gt=i.entries;Z="dimension";break;case 9:let on=i.entries;Z="dimension_type";break;case 10:let gn=i.entries;Z="enchantment";break;default:throw new Me(Ve.formatContext("unexpected json tag type:"+Be.string(i),e,r),!0,[e].concat(r.stack))}let J=Ge.join(["data",r.namespace,Z].concat(r.path.concat([t+".json"]))),ie=oe;r.compiler.config.header.length>0&&J.endsWith(".mcfunction")&&(ie=r.compiler.config.header+` -`+ie),r.compiler.io.write(J,ie);break;case 8:let U=i.entries,q="{"+this.stringifyJsonTag(e,t,U,r)+"}",ge;switch(i._hx_index){case 1:let fn=i.entries;ge=r.compiler.config.features.useFolderRenames48?"advancement":"advancements";break;case 2:let Dt=i.entries;ge=r.compiler.config.features.useFolderRenames48?"item_modifier":"item_modifiers";break;case 3:let bn=i.entries;ge=r.compiler.config.features.useFolderRenames48?"loot_table":"loot_tables";break;case 4:let Ft=i.entries;ge=r.compiler.config.features.useFolderRenames48?"predicate":"predicates";break;case 5:let Et=i.entries;ge=r.compiler.config.features.useFolderRenames48?"recipe":"recipes";break;case 6:let Lt=i.entries;ge="chat";break;case 7:let Ot=i.entries;ge="damage";break;case 8:let Gt=i.entries;ge="dimension";break;case 9:let on=i.entries;ge="dimension_type";break;case 10:let gn=i.entries;ge="enchantment";break;default:throw new Me(Ve.formatContext("unexpected json tag type:"+Be.string(i),e,r),!0,[e].concat(r.stack))}let Te=Ge.join(["data",r.namespace,ge].concat(r.path.concat([t+".json"]))),Re=q;r.compiler.config.header.length>0&&Te.endsWith(".mcfunction")&&(Re=r.compiler.config.header+` -`+Re),r.compiler.io.write(Te,Re);break;case 9:let le=i.entries,pe="{"+this.stringifyJsonTag(e,t,le,r)+"}",Le;switch(i._hx_index){case 1:let fn=i.entries;Le=r.compiler.config.features.useFolderRenames48?"advancement":"advancements";break;case 2:let Dt=i.entries;Le=r.compiler.config.features.useFolderRenames48?"item_modifier":"item_modifiers";break;case 3:let bn=i.entries;Le=r.compiler.config.features.useFolderRenames48?"loot_table":"loot_tables";break;case 4:let Ft=i.entries;Le=r.compiler.config.features.useFolderRenames48?"predicate":"predicates";break;case 5:let Et=i.entries;Le=r.compiler.config.features.useFolderRenames48?"recipe":"recipes";break;case 6:let Lt=i.entries;Le="chat";break;case 7:let Ot=i.entries;Le="damage";break;case 8:let Gt=i.entries;Le="dimension";break;case 9:let on=i.entries;Le="dimension_type";break;case 10:let gn=i.entries;Le="enchantment";break;default:throw new Me(Ve.formatContext("unexpected json tag type:"+Be.string(i),e,r),!0,[e].concat(r.stack))}let ke=Ge.join(["data",r.namespace,Le].concat(r.path.concat([t+".json"]))),Ut=pe;r.compiler.config.header.length>0&&ke.endsWith(".mcfunction")&&(Ut=r.compiler.config.header+` -`+Ut),r.compiler.io.write(ke,Ut);break;case 10:let In=i.entries,On="{"+this.stringifyJsonTag(e,t,In,r)+"}",rt;switch(i._hx_index){case 1:let fn=i.entries;rt=r.compiler.config.features.useFolderRenames48?"advancement":"advancements";break;case 2:let Dt=i.entries;rt=r.compiler.config.features.useFolderRenames48?"item_modifier":"item_modifiers";break;case 3:let bn=i.entries;rt=r.compiler.config.features.useFolderRenames48?"loot_table":"loot_tables";break;case 4:let Ft=i.entries;rt=r.compiler.config.features.useFolderRenames48?"predicate":"predicates";break;case 5:let Et=i.entries;rt=r.compiler.config.features.useFolderRenames48?"recipe":"recipes";break;case 6:let Lt=i.entries;rt="chat";break;case 7:let Ot=i.entries;rt="damage";break;case 8:let Gt=i.entries;rt="dimension";break;case 9:let on=i.entries;rt="dimension_type";break;case 10:let gn=i.entries;rt="enchantment";break;default:throw new Me(Ve.formatContext("unexpected json tag type:"+Be.string(i),e,r),!0,[e].concat(r.stack))}let It=Ge.join(["data",r.namespace,rt].concat(r.path.concat([t+".json"]))),_n=On;r.compiler.config.header.length>0&&It.endsWith(".mcfunction")&&(_n=r.compiler.config.header+` -`+_n),r.compiler.io.write(It,_n);break;case 11:let Si=i.subType,Ki=i.name,fr=i.entries,mr="{"+this.stringifyJsonTag(e,Ki,fr,r)+"}",pr=Ge.join(["data",r.namespace,"worldgen",Si].concat(r.path.concat([Ki+".json"]))),ii=mr;r.compiler.config.header.length>0&&pr.endsWith(".mcfunction")&&(ii=r.compiler.config.header+` -`+ii),r.compiler.io.write(pr,ii);break}}processCompilerLoop(e,t,i,r,a,o){let c=eo.invokeExpressionInline(e,i,a);for(;c.hasNext();){let u=c.next();if(t==null){let d=0;for(;d0)throw new Me(Ve.formatContext("Unexpected extra data in json tag",C,r),!1,[C].concat(r.stack));a.push(this.injectValues(k,r,C))}else{let y=d.pos;throw new Me(Ve.formatContext("unexpected node type:"+Be.string(d),y,r),!0,[y].concat(r.stack))}break;case 5:let m=d.pos,p=d.expression,f=d.as,_=d.body;this.processCompilerLoop(p,f,r,_,m,function(y,k){c.compileCommand(k,y)});break;case 6:let v=d.pos,g=d.expression,h=d.body,b=d.elseExpressions;this.compileTimeIf(g,h,b,v,l,function(y){c.compileCommand(y,r)});break;default:let x=d.pos;throw new Me(Ve.formatContext("unexpected node type:"+Be.string(d),x,r),!0,[x].concat(r.stack))}}return a.join("")}injectValues(e,t,i){if(e==null)return"";if(e.indexOf("<%")==-1)return e;let r=t.variables.get(),a=["embed","context"],o=this,l=[function(g){return g.embedTo(t,i,o)},t],c=r,u=c,d=c.keys();for(;d.hasNext();){let g=d.next(),h=u.get(g),x=g,y=h;a.push(x),l.push(y)}let m=[],p=[],f=0,_=e.split("<%");for(;f<_.length;){let g=_[f];++f;let h=g.split("%>");h.length==1?(p.push(h[0]),m.push("$$context["+Be.string(p.length-1)+"]")):(m.push(h[0]),p.push(h[1]),m.push("$$context["+Be.string(p.length-1)+"]"))}let v="return (["+m.join(",")+"].join(''));";try{return new Function(...a,"$$context",v).apply(null,l.concat([p]))}catch(g){let h=ce.caught(g);throw new Me(Ve.formatContext(qt.format("Encountered an error whilst evaluating expression '{}' at {}:{}:{}",h.get_message(),i.file,i.line,i.col+1),i,t),!1,[i].concat(t.stack))}}transformCompileTimeIf(e,t,i,r,a,o,l){if(l==null&&(l=!1),eo.invokeExpressionInline(e,a,r)){let u=[],d=0;for(;d0){let h=this.ast[0].pos;throw new Me(Ve.formatContext("Unexpected top-level content in template file",h,f),!1,[h].concat(f.stack))}return[xe.Void]}let _=[],v=0,g=this.ast;for(;v0){let g=this.ast[0].pos;throw new Me(Ve.formatContext("Unexpected top-level content in template file",g,f),!1,[g].concat(f.stack))}return}let _=0,v=this.ast;for(;_0){let g=Ge.join(["data",f.namespace,this.functionsDir].concat(f.path.concat([f.compiler.config.generatedDirName,"load.mcfunction"]))),h=this.loadCommands.join(` -`);f.compiler.config.header.length>0&&g.endsWith(".mcfunction")&&(h=f.compiler.config.header+` -`+h),f.compiler.io.write(g,h),t.tags.addTagEntry("minecraft:load",f.namespace+":"+f.path.concat([f.compiler.config.generatedDirName,"load"]).join("/"),f)}if(this.tickCommands.length>0){let g=Ge.join(["data",f.namespace,this.functionsDir].concat(f.path.concat([f.compiler.config.generatedDirName,"tick.mcfunction"]))),h=this.tickCommands.join(` -`);f.compiler.config.header.length>0&&g.endsWith(".mcfunction")&&(h=f.compiler.config.header+` -`+h),f.compiler.io.write(g,h),t.tags.addTagEntry("minecraft:tick",f.namespace+":"+f.path.concat([f.compiler.config.generatedDirName,"tick"]).join("/"),f)}}static invokeExpressionInline(e,t,i){let r=t.variables.get(),a=["context"],o=[t],l=r,c=l,u=l.keys();for(;u.hasNext();){let m=u.next(),p=c.get(m),_=m,v=p;a.push(_),o.push(v)}let d="return ("+e+");";try{return new Function(...a,d).apply(null,o)}catch(m){let p=ce.caught(m);throw new Me(Ve.formatContext(qt.format("Encountered an error whilst evaluating expression '{}' at {}:{}:{}",p.get_message(),i.file,i.line,i.col+1),i,t),!1,[i].concat(t.stack))}}static get __name__(){return"mcl.McFile"}get __class__(){return eo}},"McFile"),Kr=M.global("$hxClasses")["mcl.Compiler"]=s(class E1 extends M.inherits(){new(e,t,i){this.topLevelAstNodes=new Array,this.success=!0,this.templateParsingEnabled=!0,this.disableRequire=!1,this.packNamespace="mcb-"+Be.string(new Date),this.tags=new lv,this.libStore=null,this.alreadySetupFiles=new We,this.files=new We,this.io=new dr,this.config=w1.create(t),this.baseDir=e,this.libStore=i}addFile(e,t){let i=new no(e,t);this.files.inst.set(e,i)}resolve(e,t){if(t.charAt(0)=="."){let i=Ge.directory(e),r=Ge.join([i,t]),a=Ge.extension(t);if(a.endsWith("js")||a=="json")return to.IJsFile(rn(r));if(this.files.inst.has(r))return this.alreadySetupFiles.inst.has(r)||(this.alreadySetupFiles.inst.set(r,!0),this.files.inst.get(r).setup(this)),to.IMcFile(this.files.inst.get(r));throw new Me("Failed to resolve import: "+r,!1)}else return to.IMcFile(this.libStore.lookup(t,{file:e,line:0,col:0},this))}getInitialPathInfo(e){let t=(e.startsWith(this.baseDir)?e.substring(this.baseDir.length):e).split("\\").join("/");t.charAt(0)=="/"&&(t=t.substring(1));let i=t.split("/"),r=Ge.withoutExtension(i[0]),a=i.slice(1).join("/");return{namespace:r,path:i.length>1?Ge.withoutExtension(a).split("/"):[]}}compile(e){this.success=!0;try{let t=jt.adaptIterator(this.files.inst.values());for(;t.hasNext();){let r=t.next();this.alreadySetupFiles.inst.has(r.name)||r.setup(this)}let i=jt.adaptIterator(this.files.inst.values());for(;i.hasNext();)i.next().compile(e,this);this.tags.writeTagFiles(this)}catch(t){let i=ce.caught(t).unwrap();throw this.success=!1,ce.thrown(i)}}transform(e){let t=new Map,i=jt.adaptIterator(this.files.inst.values());for(;i.hasNext();){let a=i.next();this.alreadySetupFiles.inst.has(a.name)||a.setup(this)}let r=jt.adaptIterator(this.files.inst.values());for(;r.hasNext();){let a=r.next();this.topLevelAstNodes=[],t.set(a.name,xe.Group(a.transform(e,this).concat(this.topLevelAstNodes)))}return t}addTopLevelAstNode(e){this.topLevelAstNodes.push(e)}static get __name__(){return"mcl.Compiler"}get __class__(){return E1}},"Compiler");var Ole=M.$global,Xu=M.global("$hxClasses")["mcl.args.JsTemplateArgument"]=s(class pp extends M.inherits(()=>ut,!0){new(e,t){super.new(e,t),this.expectJsValue=!0}parseValue(e,t,i){if(e.startsWith("<%")){let r=e.indexOf("%>");if(r==-1)return{success:!1};let a=e.substring(2,r);try{let o=ut.jsCacheIdx,l=ut.jsCache.inst.has(o),c;return l?c=ut.jsCache.inst.get(o):(c=no.invokeExpressionInline(a,i,t),ut.jsCache.inst.set(o,c)),{success:!0,value:c,raw:e.substring(0,r+2)}}catch{return{success:!1}}}return{success:!1}}static register(){ut.register("js",pp)}static get __name__(){return"mcl.args.JsTemplateArgument"}static get __super__(){return ut}get __class__(){return pp}},"JsTemplateArgument");var Fle=M.$global,T1=M.global("$hxClasses")["mcl.args.LiteralTemplateArgument"]=s(class C1 extends M.inherits(()=>ut,!0){new(e,t){this.value=t,super.new(null,e)}parseValue(e,t,i){return e==this.value||e.startsWith(this.value+" ")?{success:!0,value:e,raw:this.value}:{success:!1}}static register(){ut.register("literal",Xu)}static get __name__(){return"mcl.args.LiteralTemplateArgument"}static get __super__(){return ut}get __class__(){return C1}},"LiteralTemplateArgument");var Hle=M.$global,ut=M.global("$hxClasses")["mcl.args.TemplateArgument"]=s(class gs extends M.inherits(){new(e,t){this.expectJsValue=!1,this.expectBlock=!1,this.name=e,this.pos=t}parseValue(e,t,i){throw ce.thrown("override this method in subclass, plz thx")}parseValueBlock(e,t,i){throw ce.thrown("override this method in subclass, plz thx")}static parse(e,t){let i=e.indexOf(":"),r=i==-1?"literal":e.substring(i+1),a=i==-1?e:e.substring(0,i);if(r=="literal")return new T1(t,a);if(!gs.argumentTypes.inst.has(r))throw ce.thrown("Unknown template argument type: '"+r+"'");return gi.createInstance(gs.argumentTypes.inst.get(r),[a])}static register(e,t){if(gs.argumentTypes.inst.has(e))throw ce.thrown("Template argument type already registered: "+e);gs.argumentTypes.inst.set(e,t)}static get __name__(){return"mcl.args.TemplateArgument"}get __class__(){return gs}},"TemplateArgument");ut.jsCache=null;ut.jsCacheIdx=0;ut.argumentTypes=new We;var Xle=M.$global,A1=M.global("$hxClasses")["mcl.args.WordTemplateArgument"]=s(class _p extends M.inherits(ut){new(e,t){super.new(e,t)}parseValue(e,t,i){if(e=="")return{success:!1};let r=e.indexOf(" "),a=r==-1?e:Qe.substr(e,0,r);return{success:!0,value:a,raw:a}}static register(){ut.register("word",_p)}static get __name__(){return"mcl.args.WordTemplateArgument"}static get __super__(){return ut}get __class__(){return _p}},"WordTemplateArgument");var nce=M.$global,S1=M.global("$hxClasses")["mcl.args.RawTemplateArgument"]=s(class gp extends M.inherits(ut){new(e,t){super.new(e,t)}parseValue(e,t,i){return{success:!0,value:e,raw:e}}static register(){ut.register("raw",gp)}static get __name__(){return"mcl.args.RawTemplateArgument"}static get __super__(){return ut}get __class__(){return gp}},"RawTemplateArgument");var lce=M.$global,j1=M.global("$hxClasses")["mcl.args.IntTemplateArgument"]=s(class hp extends M.inherits(ut){new(e,t){super.new(e,t)}parseValue(e,t,i){let r=e.indexOf(" ");r!=-1&&(e=e.substring(0,r));let a=Be.parseInt(e);return a==null?{success:!1}:{success:!0,value:a,raw:e}}static register(){ut.register("int",hp)}static get __name__(){return"mcl.args.IntTemplateArgument"}static get __super__(){return ut}get __class__(){return hp}},"IntTemplateArgument");var mce=M.$global,I1=M.global("$hxClasses")["mcl.args.FloatTemplateArgument"]=s(class bp extends M.inherits(ut){new(e,t){super.new(e,t)}parseValue(e,t,i){let r=e.indexOf(" ");r!=-1&&(e=e.substring(0,r));let a=parseFloat(e);return a==null?{success:!1}:{success:!0,value:a,raw:e}}static register(){ut.register("float",bp)}static get __name__(){return"mcl.args.FloatTemplateArgument"}static get __super__(){return ut}get __class__(){return bp}},"FloatTemplateArgument");var kce=M.$global,L9=M.global("$hxClasses")["mcl.args.BoundBlock"]=s(class O1 extends M.inherits(){new(e,t){this.node=e,this.ctx=t}appendAstNode(e){let t=this.node;if(t._hx_index==8){let i=t.pos,r=t.name,a=t.data,o=t.isMacro,l=t.isInline;t.body.push(e)}else throw ce.thrown("BoundBlock.append: node is not a block")}append(e){let t=Yn.tokenize(e,""),i=new Xa(t);for(;i.hasNext();)this.appendAstNode(qt.innerParse(i))}setName(e){let t=this.node;if(t._hx_index==8){let i=t.name,r=t.pos,a=t.body,o=t.data,l=t.isMacro,c=t.isInline;this.node=xe.Block(r,e,a,o,l,c)}else throw ce.thrown("BoundBlock.setName: node is not a block")}embedTo(e,t,i,r){r==null&&(r=!0);let a=[],o={isTemplate:!1,uidIndex:e.uidIndex,namespace:e.namespace,path:e.path,variables:this.ctx.variables,replacements:this.ctx.replacements,stack:this.ctx.stack,append:function(l){a.push(l)},templates:this.ctx.templates,requireTemplateKeyword:this.ctx.requireTemplateKeyword,compiler:this.ctx.compiler,globalVariables:this.ctx.globalVariables,functions:this.ctx.functions,baseNamespaceInfo:e.baseNamespaceInfo,currentFunction:this.ctx.currentFunction};return r?i.embed(o,t,new We,[this.node]):i.embedTransform(o,t,new We,[this.node]),a.join(` -`)}static get __name__(){return"mcl.args.BoundBlock"}get __class__(){return O1}},"BoundBlock"),N1=M.global("$hxClasses")["mcl.args.BlockTemplateArgument"]=s(class vp extends M.inherits(ut){new(e,t){super.new(e,t),this.expectBlock=!0}parseValueBlock(e,t,i){if(e._hx_index==8){let r=e.pos,a=e.name,o=e.body,l=e.data,c=e.isMacro,u=e.isInline;return{success:!0,value:new L9(e,i)}}else return{success:!1}}static register(){ut.register("block",vp)}static get __name__(){return"mcl.args.BlockTemplateArgument"}static get __super__(){return ut}get __class__(){return vp}},"BlockTemplateArgument");var Bce=M.$global,Yu=M.global("$hxClasses")["mcl.TemplateRegisterer"]=s(class B1{static register(){S1.register(),j1.register(),Xu.register(),N1.register(),I1.register(),A1.register()}static get __name__(){return"mcl.TemplateRegisterer"}get __class__(){return B1}},"TemplateRegisterer");var D1=ui(rn("fs"));var Jce=M.$global,wp=M.global("$hxClasses").LibMain=s(class yp{static main(){Yu.register()}static createCompiler(e,t,i){return new Kr(e,t,i)}static parseFile(e,t){let i=Ge.extension(e),r=Yn.tokenize(t,e);if(i=="mcb")return qt.parseMcbFile(r);if(i=="mcbt")return qt.parseMcbtFile(r);throw ce.thrown("Unknown file extension: "+i)}static addFileToCompiler(e,t){let i=Ge.extension(t),r=Yn.tokenize(D1.readFileSync(t,{encoding:"utf8"}),t);e.addFile(t,i=="mcb"?qt.parseMcbFile(r):qt.parseMcbtFile(r))}static compileFromFsLikeMap(e,t,i){let r=yp.createCompiler(e,{},null),a=t.entries(),o=a,l=a.next();for(;!l.done;){let c=l.value;l=o.next();let u=c,d=Yn.tokenize(u[1],u[0]),m=Ge.extension(u[0])=="mcb"?qt.parseMcbFile(d):qt.parseMcbtFile(d);r.addFile(u[0],m)}r.io=i,r.compile(new en(null))}static createIoProvider(e){switch(e){case 0:return new dr;case 1:return new ps;default:return new _s(e)}}static get __name__(){return"LibMain"}get __class__(){return yp}},"LibMain");var Xce=M.$global,P9=M.global("$hxClasses")["mcl.AstStringifier"]=s(class xp extends M.inherits(){new(){this.tabs=[""],this.indent=0,this.segments=[]}tab(){let e;if(this.tabs.length>this.indent)e=this.tabs[this.indent];else{let t=this.tabs[this.tabs.length-1],i=this.tabs.length-1,r=this.indent;for(;i0)throw ce.thrown("continuations not supported");this.segments.push(` -`);break;case 1:let c=e.pos,u=e.name,d=e.body,m=e.appendTo;t&&this.tab(),this.segments.push("function "),this.segments.push(u),m!=null&&(this.segments.push(" "),this.segments.push(m)),this.segments.push(`{ -`),this.inc();let p=0;for(;p=200&&b<400?v.success(v.responseBytes):v.onError("Http Error #"+b)})},"httpResponse");this.req=i?V1.request(_,g):z1.request(_,g),e&&(this.postData!=null?this.req.write(this.postData):this.postBytes!=null&&(this.req.setHeader("Content-Length",""+this.postBytes.length),this.req.write(ed.Buffer.from(this.postBytes.b.bufferValue)))),this.req.end()}static get __name__(){return"haxe.http.HttpNodeJs"}static get __super__(){return Ep}get __class__(){return G1}},"HttpNodeJs");var Bue=M.$global,ha=M.global("$hxClasses")["haxe.ds.List"]=s(class H1 extends M.inherits(){new(){this.length=0}add(e){let t=new J1(e,null);this.h==null?this.h=t:this.q.next=t,this.q=t,this.length++}push(e){let t=new J1(e,this.h);this.h=t,this.q==null&&(this.q=t),this.length++}first(){return this.h==null?null:this.h.item}pop(){if(this.h==null)return null;let e=this.h.item;return this.h=this.h.next,this.h==null&&(this.q=null),this.length--,e}isEmpty(){return this.h==null}toString(){let e="",t=!0,i=this.h;for(e+="{";i!=null;)t?t=!1:e+=", ",e+=Be.string(Be.string(i.item)),i=i.next;return e+="}",e}static get __name__(){return"haxe.ds.List"}get __class__(){return H1}},"List"),J1=M.global("$hxClasses")["haxe.ds._List.ListNode"]=s(class $1 extends M.inherits(){new(e,t){this.item=e,this.next=t}static get __name__(){return"haxe.ds._List.ListNode"}get __class__(){return $1}},"ListNode");var Hue=M.$global,K1=M.global("$hxClasses")["haxe._Unserializer.DefaultResolver"]=s(class q1 extends M.inherits(){new(){}resolveClass(e){return M.global("$hxClasses")[e]}resolveEnum(e){return M.global("$hxEnums")[e]}static get __name__(){return"haxe._Unserializer.DefaultResolver"}get __class__(){return q1}},"DefaultResolver"),$l=M.global("$hxClasses")["haxe.Unserializer"]=s(class qr extends M.inherits(){new(e){this.buf=e,this.length=this.buf.length,this.pos=0,this.scache=new Array,this.cache=new Array;let t=qr.DEFAULT_RESOLVER;t==null&&(t=new K1,qr.DEFAULT_RESOLVER=t),this.resolver=t}readDigits(){let e=0,t=!1,i=this.pos;for(;;){let r=this.buf.charCodeAt(this.pos);if(r!=r)break;if(r==45){if(this.pos!=i)break;t=!0,this.pos++;continue}if(r<48||r>57)break;e=e*10+(r-48),this.pos++}return t&&(e*=-1),e}readFloat(){let e=this.pos;for(;;){let t=this.buf.charCodeAt(this.pos);if(t!=t)break;if(t>=43&&t<58||t==101||t==69)this.pos++;else break}return parseFloat(Qe.substr(this.buf,e,this.pos-e))}unserializeObject(e){for(;;){if(this.pos>=this.length)throw ce.thrown("Invalid object");if(this.buf.charCodeAt(this.pos)==103)break;let t=this.unserialize();if(typeof t!="string")throw ce.thrown("Invalid object key");let i=this.unserialize();e[t]=i}this.pos++}unserializeEnum(e,t){if(this.buf.charCodeAt(this.pos++)!=58)throw ce.thrown("Invalid enum format");let i=this.readDigits();if(i==0)return gi.createEnum(e,t);let r=new Array;for(;i-- >0;)r.push(this.unserialize());return gi.createEnum(e,t,r)}unserialize(){switch(this.buf.charCodeAt(this.pos++)){case 65:let e=this.unserialize(),t=this.resolver.resolveClass(e);if(t==null)throw ce.thrown("Class not found "+e);return t;case 66:let i=this.unserialize(),r=this.resolver.resolveEnum(i);if(r==null)throw ce.thrown("Enum not found "+i);return r;case 67:let a=this.unserialize(),o=this.resolver.resolveClass(a);if(o==null)throw ce.thrown("Class not found "+a);let l=Object.create(o.prototype);if(this.cache.push(l),l.hxUnserialize(this),this.buf.charCodeAt(this.pos++)!=103)throw ce.thrown("Invalid custom data");return l;case 77:let c=new as;this.cache.push(c);let u=this.buf;for(;this.buf.charCodeAt(this.pos)!=104;){let pe=this.unserialize(),Le=this.unserialize();c.inst.set(pe,Le)}return this.pos++,c;break;case 82:let d=this.readDigits();if(d<0||d>=this.scache.length)throw ce.thrown("Invalid string reference");return this.scache[d];case 97:let m=this.buf,p=new Array;for(this.cache.push(p);;){let pe=this.buf.charCodeAt(this.pos);if(pe==104){this.pos++;break}if(pe==117){this.pos++;let Le=this.readDigits();p[p.length+Le-1]=null}else p.push(this.unserialize())}return p;case 98:let f=new We;this.cache.push(f);let _=this.buf;for(;this.buf.charCodeAt(this.pos)!=104;){let pe=this.unserialize(),Le=this.unserialize();f.inst.set(pe,Le)}return this.pos++,f;break;case 99:let v=this.unserialize(),g=this.resolver.resolveClass(v);if(g==null)throw ce.thrown("Class not found "+v);let h=Object.create(g.prototype);return this.cache.push(h),this.unserializeObject(h),h;break;case 100:return this.readFloat();case 102:return!1;case 105:return this.readDigits();case 106:let b=this.unserialize(),x=this.resolver.resolveEnum(b);if(x==null)throw ce.thrown("Enum not found "+b);this.pos++;let y=this.readDigits(),k=x.__constructs__,C=new Array(k.length),A=0,I=k.length;for(;A=this.cache.length)throw ce.thrown("Invalid reference");return this.cache[ne];case 115:let ve=this.readDigits(),X=this.buf;if(this.buf.charCodeAt(this.pos++)!=58||this.length-this.pos>2)*3+(P>=2?P-1:0),Z=Q+(ve-P),J=new Ai(new ArrayBuffer(oe)),ie=0;for(;Q>4;let ke=j[X.charCodeAt(Q++)];J.b[ie++]=Le<<4|ke>>2;let Ut=j[X.charCodeAt(Q++)];J.b[ie++]=ke<<6|Ut}if(P>=2){let pe=j[X.charCodeAt(Q++)],Le=j[X.charCodeAt(Q++)];if(J.b[ie++]=pe<<2|Le>>4,P==3){let ke=j[X.charCodeAt(Q++)];J.b[ie++]=Le<<4|ke>>2}}return this.pos+=ve,this.cache.push(J),J;break;case 116:return!0;case 118:let U;return this.buf.charCodeAt(this.pos)>=48&&this.buf.charCodeAt(this.pos)<=57&&this.buf.charCodeAt(this.pos+1)>=48&&this.buf.charCodeAt(this.pos+1)<=57&&this.buf.charCodeAt(this.pos+2)>=48&&this.buf.charCodeAt(this.pos+2)<=57&&this.buf.charCodeAt(this.pos+3)>=48&&this.buf.charCodeAt(this.pos+3)<=57&&this.buf.charCodeAt(this.pos+4)==45?(U=Qe.strDate(Qe.substr(this.buf,this.pos,19)),this.pos+=19):U=new Date(this.readFloat()),this.cache.push(U),U;break;case 119:let q=this.unserialize(),ge=this.resolver.resolveEnum(q);if(ge==null)throw ce.thrown("Enum not found "+q);let Te=this.unserializeEnum(ge,this.unserialize());return this.cache.push(Te),Te;break;case 120:throw ce.thrown(this.unserialize());case 121:let Re=this.readDigits();if(this.buf.charCodeAt(this.pos++)!=58||this.length-this.pos({_hx_index:0,__enum__:"haxe._Template.TemplateExpr",v:n,"@kind":"OpVar"}),{_hx_name:"OpVar",__params__:["v"]}),OpExpr:Object.assign(n=>({_hx_index:1,__enum__:"haxe._Template.TemplateExpr",expr:n,"@kind":"OpExpr"}),{_hx_name:"OpExpr",__params__:["expr"]}),OpIf:Object.assign((n,e,t)=>({_hx_index:2,__enum__:"haxe._Template.TemplateExpr",expr:n,eif:e,eelse:t,"@kind":"OpIf"}),{_hx_name:"OpIf",__params__:["expr","eif","eelse"]}),OpStr:Object.assign(n=>({_hx_index:3,__enum__:"haxe._Template.TemplateExpr",str:n,"@kind":"OpStr"}),{_hx_name:"OpStr",__params__:["str"]}),OpBlock:Object.assign(n=>({_hx_index:4,__enum__:"haxe._Template.TemplateExpr",l:n,"@kind":"OpBlock"}),{_hx_name:"OpBlock",__params__:["l"]}),OpForeach:Object.assign((n,e)=>({_hx_index:5,__enum__:"haxe._Template.TemplateExpr",expr:n,loop:e,"@kind":"OpForeach"}),{_hx_name:"OpForeach",__params__:["expr","loop"]}),OpMacro:Object.assign((n,e)=>({_hx_index:6,__enum__:"haxe._Template.TemplateExpr",name:n,params:e,"@kind":"OpMacro"}),{_hx_name:"OpMacro",__params__:["name","params"]})};ni.__constructs__=[ni.OpVar,ni.OpExpr,ni.OpIf,ni.OpStr,ni.OpBlock,ni.OpForeach,ni.OpMacro];ni.__empty_constructs__=[];var Wr=M.global("$hxClasses")["haxe.Template"]=s(class Fn extends M.inherits(){new(e){let t=this.parseTokens(e);if(this.expr=this.parseBlock(t),!t.isEmpty())throw ce.thrown("Unexpected '"+Be.string(t.first().s)+"'")}execute(e,t){return this.macros=t??{},this.context=e,this.stack=new ha,this.buf=new Tp,this.run(this.expr),this.buf.b}resolve(e){if(e=="__current__")return this.context;if(Zt.isObject(this.context)){let i=Zt.getProperty(this.context,e);if(i!=null||Object.prototype.hasOwnProperty.call(this.context,e))return i}let t=this.stack.h;for(;t!=null;){let i=t.item;t=t.next;let r=i,a=Zt.getProperty(r,e);if(a!=null||Object.prototype.hasOwnProperty.call(r,e))return a}return Zt.field(Fn.globals,e)}parseTokens(e){let t=new ha;for(;Fn.splitter.match(e);){let i=Fn.splitter.matchedPos();if(i.pos>0&&t.add({p:Qe.substr(e,0,i.pos),s:!0,l:null}),Qe.cca(e,i.pos)==58){t.add({p:Qe.substr(e,i.pos+2,i.len-4),s:!1,l:null}),e=Fn.splitter.matchedRight();continue}let r=i.pos+i.len,a=1,o=[],l="";for(;;){let c=Qe.cca(e,r);if(++r,c==40)++a;else if(c==41){if(--a,a<=0)break}else if(c==null)throw ce.thrown("Unclosed macro parenthesis");c==44&&a==1?(o.push(l),l=""):l+=String.fromCodePoint(c)}o.push(l),t.add({p:Fn.splitter.matched(2),s:!1,l:o}),e=Qe.substr(e,r,e.length-r)}return e.length>0&&t.add({p:e,s:!0,l:null}),t}parseBlock(e){let t=new ha;for(;;){let i=e.first();if(i==null||!i.s&&(i.p=="end"||i.p=="else"||Qe.substr(i.p,0,7)=="elseif "))break;t.add(this.parse(e))}return t.length==1?t.first():ni.OpBlock(t)}parse(e){let t=e.pop(),i=t.p;if(t.s)return ni.OpStr(i);if(t.l!=null){let l=new ha,c=0,u=t.l;for(;c0){i=Qe.substr(i,a,i.length-a);let l=this.parseExpr(i),c=this.parseBlock(e),u=e.first(),d;if(u==null)throw ce.thrown("Unclosed 'if'");if(u.p=="end")e.pop(),d=null;else if(u.p=="else"){if(e.pop(),d=this.parseBlock(e),u=e.pop(),u==null||u.p!="end")throw ce.thrown("Unclosed 'else'")}else u.p=Qe.substr(u.p,4,u.p.length-4),d=this.parse(e);return ni.OpIf(l,c,d)}let o=r("foreach");if(o>=0){i=Qe.substr(i,o,i.length-o);let l=this.parseExpr(i),c=this.parseBlock(e),u=e.pop();if(u==null||u.p!="end")throw ce.thrown("Unclosed 'foreach'");return ni.OpForeach(l,c)}return Fn.expr_splitter.match(i)?ni.OpExpr(this.parseExpr(i)):ni.OpVar(i)}parseExpr(e){let t=new ha,i=e;for(;Fn.expr_splitter.match(e);){let a=Fn.expr_splitter.matchedPos(),o=a.pos+a.len;a.pos!=0&&t.add({p:Qe.substr(e,0,a.pos),s:!0});let l=Fn.expr_splitter.matched(0);t.add({p:l,s:l.indexOf('"')>=0}),e=Fn.expr_splitter.matchedRight()}if(e.length!=0){let a=0,o=e;for(;a");if(t.s)return this.makeConst(t.p);switch(t.p){case"!":let i=this.makeExpr(e);return function(){let u=i();return u!=null?u==!1:!0};case"(":this.skipSpaces(e);let r=this.makeExpr(e);this.skipSpaces(e);let a=e.pop();if(a==null||a.s)throw ce.thrown(a);if(a.p==")")return r;this.skipSpaces(e);let o=this.makeExpr(e);this.skipSpaces(e);let l=e.pop();if(this.skipSpaces(e),l==null||l.p!=")")throw ce.thrown(l);switch(a.p){case"!=":return function(){return r()!=o()};case"&&":return function(){return r()&&o()};case"*":return function(){return r()*o()};case"+":return function(){return r()+o()};case"-":return function(){return r()-o()};case"/":return function(){return r()/o()};case"<":return function(){return r()":return function(){return r()>o()};case">=":return function(){return r()>=o()};case"||":return function(){return r()||o()};default:throw ce.thrown("Unknown operation "+a.p)}break;case"-":let c=this.makeExpr(e);return function(){return-c()}}throw ce.thrown(t.p)}run(e){switch(e._hx_index){case 0:let t=e.v,i=this.buf,r=Be.string(this.resolve(t));i.b+=Be.string(r);break;case 1:let a=e.expr,o=this.buf,l=Be.string(a());o.b+=Be.string(l);break;case 2:let c=e.expr,u=e.eif,d=e.eelse,m=c();m==null||m==!1?d!=null&&this.run(d):this.run(u);break;case 3:let p=e.str;this.buf.b+=p==null?"null":""+p;break;case 4:let _=e.l.h;for(;_!=null;){let L=_.item;_=_.next;let O=L;this.run(O)}break;case 5:let v=e.expr,g=e.loop,h=v();try{let L=M.getIterator(h);if(L.hasNext==null)throw ce.thrown(null);h=L}catch{try{if(h.hasNext==null)throw ce.thrown(null)}catch{throw ce.thrown("Cannot iter on "+Be.string(h))}}this.stack.push(this.context);let x=h;for(;x.hasNext();){let L=x.next();this.context=L,this.run(g)}this.context=this.stack.pop();break;case 6:let y=e.name,k=e.params,C=Zt.field(this.macros,y),A=new Array,I=this.buf;A.push(M.bind(this,this.resolve));let S=k.h;for(;S!=null;){let L=S.item;S=S.next;let O=L;if(O._hx_index==0){let E=O.v;A.push(this.resolve(E))}else this.buf=new Tp,this.run(O),A.push(this.buf.b)}this.buf=I;try{let L=this.buf,O=Be.string(C.apply(this.macros,A));L.b+=Be.string(O)}catch(L){let O=ce.caught(L).unwrap(),E;try{E=A.join(",")}catch{E="???"}let B="Macro call "+y+"("+E+") failed ("+Be.string(O)+")";throw ce.thrown(B)}break}}static get __name__(){return"haxe.Template"}get __class__(){return Fn}},"Template");Wr.splitter=new $r('(::[A-Za-z0-9_ ()&|!+=/><*."-]+::|\\$\\$([A-Za-z0-9_-]+)\\()',"");Wr.expr_splitter=new $r(`(\\(|\\)|[ \r +`+_),a.compiler.io.write(f,_)}compileDirectory(e,t,i,r){t=this.injectValues(t,r,e);let a=r.namespace,o=r.variables,l=r.path.concat([t]),u=new Ap,c={append:function(m){throw new Pe(Je.formatContext("append not available for directory context",e,r),!0,[e].concat(r.stack))},namespace:a,path:l??[],uidIndex:u,variables:o,stack:r.stack,replacements:r.replacements,isTemplate:this.ext=="mcbt",templates:r.templates,requireTemplateKeyword:r.requireTemplateKeyword,compiler:r.compiler,globalVariables:r.globalVariables,functions:r.functions,baseNamespaceInfo:r.baseNamespaceInfo,currentFunction:r.currentFunction},d=0;for(;d0&&ne.endsWith(".mcfunction")&&(pe=t.compiler.config.header+` +`+pe),t.compiler.io.write(ne,pe),t.compiler.tags.addTagEntry("minecraft:load",se,t);break;default:let W=e.pos;throw new Pe(Je.formatContext("unexpected node type:"+Fe.string(e),W,t),!0,[W].concat(t.stack))}}compileJsonFile(e,t,i,r){switch(i._hx_index){case 0:let a=i.subType,o=i.replace,l=i.entries;if(a=="function"||a=="functions"){t=r.namespace+":"+r.path.concat([t]).join("/");let an=0;for(;an0&&Ft.endsWith(".mcfunction")&&(It=r.compiler.config.header+` +`+It),r.compiler.io.write(Ft,It)}break;case 1:let u=i.entries,c="{"+this.stringifyJsonTag(e,t,u,r)+"}",d;switch(i._hx_index){case 1:let an=i.entries;d=r.compiler.config.features.useFolderRenames48?"advancement":"advancements";break;case 2:let Bt=i.entries;d=r.compiler.config.features.useFolderRenames48?"item_modifier":"item_modifiers";break;case 3:let mn=i.entries;d=r.compiler.config.features.useFolderRenames48?"loot_table":"loot_tables";break;case 4:let Mt=i.entries;d=r.compiler.config.features.useFolderRenames48?"predicate":"predicates";break;case 5:let xt=i.entries;d=r.compiler.config.features.useFolderRenames48?"recipe":"recipes";break;case 6:let Ft=i.entries;d="chat";break;case 7:let It=i.entries;d="damage";break;case 8:let Zt=i.entries;d="dimension";break;case 9:let pn=i.entries;d="dimension_type";break;case 10:let wn=i.entries;d="enchantment";break;default:throw new Pe(Je.formatContext("unexpected json tag type:"+Fe.string(i),e,r),!0,[e].concat(r.stack))}let m=He.join(["data",r.namespace,d].concat(r.path.concat([t+".json"]))),p=c;r.compiler.config.header.length>0&&m.endsWith(".mcfunction")&&(p=r.compiler.config.header+` +`+p),r.compiler.io.write(m,p);break;case 2:let f=i.entries,_="{"+this.stringifyJsonTag(e,t,f,r)+"}",g;switch(i._hx_index){case 1:let an=i.entries;g=r.compiler.config.features.useFolderRenames48?"advancement":"advancements";break;case 2:let Bt=i.entries;g=r.compiler.config.features.useFolderRenames48?"item_modifier":"item_modifiers";break;case 3:let mn=i.entries;g=r.compiler.config.features.useFolderRenames48?"loot_table":"loot_tables";break;case 4:let Mt=i.entries;g=r.compiler.config.features.useFolderRenames48?"predicate":"predicates";break;case 5:let xt=i.entries;g=r.compiler.config.features.useFolderRenames48?"recipe":"recipes";break;case 6:let Ft=i.entries;g="chat";break;case 7:let It=i.entries;g="damage";break;case 8:let Zt=i.entries;g="dimension";break;case 9:let pn=i.entries;g="dimension_type";break;case 10:let wn=i.entries;g="enchantment";break;default:throw new Pe(Je.formatContext("unexpected json tag type:"+Fe.string(i),e,r),!0,[e].concat(r.stack))}let h=He.join(["data",r.namespace,g].concat(r.path.concat([t+".json"]))),v=_;r.compiler.config.header.length>0&&h.endsWith(".mcfunction")&&(v=r.compiler.config.header+` +`+v),r.compiler.io.write(h,v);break;case 3:let y=i.entries,k="{"+this.stringifyJsonTag(e,t,y,r)+"}",b;switch(i._hx_index){case 1:let an=i.entries;b=r.compiler.config.features.useFolderRenames48?"advancement":"advancements";break;case 2:let Bt=i.entries;b=r.compiler.config.features.useFolderRenames48?"item_modifier":"item_modifiers";break;case 3:let mn=i.entries;b=r.compiler.config.features.useFolderRenames48?"loot_table":"loot_tables";break;case 4:let Mt=i.entries;b=r.compiler.config.features.useFolderRenames48?"predicate":"predicates";break;case 5:let xt=i.entries;b=r.compiler.config.features.useFolderRenames48?"recipe":"recipes";break;case 6:let Ft=i.entries;b="chat";break;case 7:let It=i.entries;b="damage";break;case 8:let Zt=i.entries;b="dimension";break;case 9:let pn=i.entries;b="dimension_type";break;case 10:let wn=i.entries;b="enchantment";break;default:throw new Pe(Je.formatContext("unexpected json tag type:"+Fe.string(i),e,r),!0,[e].concat(r.stack))}let x=He.join(["data",r.namespace,b].concat(r.path.concat([t+".json"]))),E=k;r.compiler.config.header.length>0&&x.endsWith(".mcfunction")&&(E=r.compiler.config.header+` +`+E),r.compiler.io.write(x,E);break;case 4:let C=i.entries,j="{"+this.stringifyJsonTag(e,t,C,r)+"}",S;switch(i._hx_index){case 1:let an=i.entries;S=r.compiler.config.features.useFolderRenames48?"advancement":"advancements";break;case 2:let Bt=i.entries;S=r.compiler.config.features.useFolderRenames48?"item_modifier":"item_modifiers";break;case 3:let mn=i.entries;S=r.compiler.config.features.useFolderRenames48?"loot_table":"loot_tables";break;case 4:let Mt=i.entries;S=r.compiler.config.features.useFolderRenames48?"predicate":"predicates";break;case 5:let xt=i.entries;S=r.compiler.config.features.useFolderRenames48?"recipe":"recipes";break;case 6:let Ft=i.entries;S="chat";break;case 7:let It=i.entries;S="damage";break;case 8:let Zt=i.entries;S="dimension";break;case 9:let pn=i.entries;S="dimension_type";break;case 10:let wn=i.entries;S="enchantment";break;default:throw new Pe(Je.formatContext("unexpected json tag type:"+Fe.string(i),e,r),!0,[e].concat(r.stack))}let B=He.join(["data",r.namespace,S].concat(r.path.concat([t+".json"]))),O=j;r.compiler.config.header.length>0&&B.endsWith(".mcfunction")&&(O=r.compiler.config.header+` +`+O),r.compiler.io.write(B,O);break;case 5:let A=i.entries,V="{"+this.stringifyJsonTag(e,t,A,r)+"}",K;switch(i._hx_index){case 1:let an=i.entries;K=r.compiler.config.features.useFolderRenames48?"advancement":"advancements";break;case 2:let Bt=i.entries;K=r.compiler.config.features.useFolderRenames48?"item_modifier":"item_modifiers";break;case 3:let mn=i.entries;K=r.compiler.config.features.useFolderRenames48?"loot_table":"loot_tables";break;case 4:let Mt=i.entries;K=r.compiler.config.features.useFolderRenames48?"predicate":"predicates";break;case 5:let xt=i.entries;K=r.compiler.config.features.useFolderRenames48?"recipe":"recipes";break;case 6:let Ft=i.entries;K="chat";break;case 7:let It=i.entries;K="damage";break;case 8:let Zt=i.entries;K="dimension";break;case 9:let pn=i.entries;K="dimension_type";break;case 10:let wn=i.entries;K="enchantment";break;default:throw new Pe(Je.formatContext("unexpected json tag type:"+Fe.string(i),e,r),!0,[e].concat(r.stack))}let te=He.join(["data",r.namespace,K].concat(r.path.concat([t+".json"]))),fe=V;r.compiler.config.header.length>0&&te.endsWith(".mcfunction")&&(fe=r.compiler.config.header+` +`+fe),r.compiler.io.write(te,fe);break;case 6:let ae=i.entries,ee="{"+this.stringifyJsonTag(e,t,ae,r)+"}",se;switch(i._hx_index){case 1:let an=i.entries;se=r.compiler.config.features.useFolderRenames48?"advancement":"advancements";break;case 2:let Bt=i.entries;se=r.compiler.config.features.useFolderRenames48?"item_modifier":"item_modifiers";break;case 3:let mn=i.entries;se=r.compiler.config.features.useFolderRenames48?"loot_table":"loot_tables";break;case 4:let Mt=i.entries;se=r.compiler.config.features.useFolderRenames48?"predicate":"predicates";break;case 5:let xt=i.entries;se=r.compiler.config.features.useFolderRenames48?"recipe":"recipes";break;case 6:let Ft=i.entries;se="chat";break;case 7:let It=i.entries;se="damage";break;case 8:let Zt=i.entries;se="dimension";break;case 9:let pn=i.entries;se="dimension_type";break;case 10:let wn=i.entries;se="enchantment";break;default:throw new Pe(Je.formatContext("unexpected json tag type:"+Fe.string(i),e,r),!0,[e].concat(r.stack))}let oe=He.join(["data",r.namespace,se].concat(r.path.concat([t+".json"]))),xe=ee;r.compiler.config.header.length>0&&oe.endsWith(".mcfunction")&&(xe=r.compiler.config.header+` +`+xe),r.compiler.io.write(oe,xe);break;case 7:let ne=i.entries,pe="{"+this.stringifyJsonTag(e,t,ne,r)+"}",W;switch(i._hx_index){case 1:let an=i.entries;W=r.compiler.config.features.useFolderRenames48?"advancement":"advancements";break;case 2:let Bt=i.entries;W=r.compiler.config.features.useFolderRenames48?"item_modifier":"item_modifiers";break;case 3:let mn=i.entries;W=r.compiler.config.features.useFolderRenames48?"loot_table":"loot_tables";break;case 4:let Mt=i.entries;W=r.compiler.config.features.useFolderRenames48?"predicate":"predicates";break;case 5:let xt=i.entries;W=r.compiler.config.features.useFolderRenames48?"recipe":"recipes";break;case 6:let Ft=i.entries;W="chat";break;case 7:let It=i.entries;W="damage";break;case 8:let Zt=i.entries;W="dimension";break;case 9:let pn=i.entries;W="dimension_type";break;case 10:let wn=i.entries;W="enchantment";break;default:throw new Pe(Je.formatContext("unexpected json tag type:"+Fe.string(i),e,r),!0,[e].concat(r.stack))}let U=He.join(["data",r.namespace,W].concat(r.path.concat([t+".json"]))),ce=pe;r.compiler.config.header.length>0&&U.endsWith(".mcfunction")&&(ce=r.compiler.config.header+` +`+ce),r.compiler.io.write(U,ce);break;case 8:let J=i.entries,Ce="{"+this.stringifyJsonTag(e,t,J,r)+"}",Y;switch(i._hx_index){case 1:let an=i.entries;Y=r.compiler.config.features.useFolderRenames48?"advancement":"advancements";break;case 2:let Bt=i.entries;Y=r.compiler.config.features.useFolderRenames48?"item_modifier":"item_modifiers";break;case 3:let mn=i.entries;Y=r.compiler.config.features.useFolderRenames48?"loot_table":"loot_tables";break;case 4:let Mt=i.entries;Y=r.compiler.config.features.useFolderRenames48?"predicate":"predicates";break;case 5:let xt=i.entries;Y=r.compiler.config.features.useFolderRenames48?"recipe":"recipes";break;case 6:let Ft=i.entries;Y="chat";break;case 7:let It=i.entries;Y="damage";break;case 8:let Zt=i.entries;Y="dimension";break;case 9:let pn=i.entries;Y="dimension_type";break;case 10:let wn=i.entries;Y="enchantment";break;default:throw new Pe(Je.formatContext("unexpected json tag type:"+Fe.string(i),e,r),!0,[e].concat(r.stack))}let z=He.join(["data",r.namespace,Y].concat(r.path.concat([t+".json"]))),be=Ce;r.compiler.config.header.length>0&&z.endsWith(".mcfunction")&&(be=r.compiler.config.header+` +`+be),r.compiler.io.write(z,be);break;case 9:let H=i.entries,ie="{"+this.stringifyJsonTag(e,t,H,r)+"}",Ie;switch(i._hx_index){case 1:let an=i.entries;Ie=r.compiler.config.features.useFolderRenames48?"advancement":"advancements";break;case 2:let Bt=i.entries;Ie=r.compiler.config.features.useFolderRenames48?"item_modifier":"item_modifiers";break;case 3:let mn=i.entries;Ie=r.compiler.config.features.useFolderRenames48?"loot_table":"loot_tables";break;case 4:let Mt=i.entries;Ie=r.compiler.config.features.useFolderRenames48?"predicate":"predicates";break;case 5:let xt=i.entries;Ie=r.compiler.config.features.useFolderRenames48?"recipe":"recipes";break;case 6:let Ft=i.entries;Ie="chat";break;case 7:let It=i.entries;Ie="damage";break;case 8:let Zt=i.entries;Ie="dimension";break;case 9:let pn=i.entries;Ie="dimension_type";break;case 10:let wn=i.entries;Ie="enchantment";break;default:throw new Pe(Je.formatContext("unexpected json tag type:"+Fe.string(i),e,r),!0,[e].concat(r.stack))}let Q=He.join(["data",r.namespace,Ie].concat(r.path.concat([t+".json"]))),st=ie;r.compiler.config.header.length>0&&Q.endsWith(".mcfunction")&&(st=r.compiler.config.header+` +`+st),r.compiler.io.write(Q,st);break;case 10:let at=i.entries,Vt="{"+this.stringifyJsonTag(e,t,at,r)+"}",We;switch(i._hx_index){case 1:let an=i.entries;We=r.compiler.config.features.useFolderRenames48?"advancement":"advancements";break;case 2:let Bt=i.entries;We=r.compiler.config.features.useFolderRenames48?"item_modifier":"item_modifiers";break;case 3:let mn=i.entries;We=r.compiler.config.features.useFolderRenames48?"loot_table":"loot_tables";break;case 4:let Mt=i.entries;We=r.compiler.config.features.useFolderRenames48?"predicate":"predicates";break;case 5:let xt=i.entries;We=r.compiler.config.features.useFolderRenames48?"recipe":"recipes";break;case 6:let Ft=i.entries;We="chat";break;case 7:let It=i.entries;We="damage";break;case 8:let Zt=i.entries;We="dimension";break;case 9:let pn=i.entries;We="dimension_type";break;case 10:let wn=i.entries;We="enchantment";break;default:throw new Pe(Je.formatContext("unexpected json tag type:"+Fe.string(i),e,r),!0,[e].concat(r.stack))}let wt=He.join(["data",r.namespace,We].concat(r.path.concat([t+".json"]))),Jt=Vt;r.compiler.config.header.length>0&&wt.endsWith(".mcfunction")&&(Jt=r.compiler.config.header+` +`+Jt),r.compiler.io.write(wt,Jt);break;case 11:let X=i.subType,et=i.name,si=i.entries,Ei="{"+this.stringifyJsonTag(e,et,si,r)+"}",Ti=He.join(["data",r.namespace,"worldgen",X].concat(r.path.concat([et+".json"]))),Fn=Ei;r.compiler.config.header.length>0&&Ti.endsWith(".mcfunction")&&(Fn=r.compiler.config.header+` +`+Fn),r.compiler.io.write(Ti,Fn);break}}processCompilerLoop(e,t,i,r,a,o){let u=oo.invokeExpressionInline(e,i,a);for(;u.hasNext();){let c=u.next();if(t==null){let d=0;for(;d0)throw new Pe(Je.formatContext("Unexpected extra data in json tag",E,r),!1,[E].concat(r.stack));a.push(this.injectValues(x,r,E))}else{let b=d.pos;throw new Pe(Je.formatContext("unexpected node type:"+Fe.string(d),b,r),!0,[b].concat(r.stack))}break;case 5:let m=d.pos,p=d.expression,f=d.as,_=d.body;this.processCompilerLoop(p,f,r,_,m,function(b,x){u.compileCommand(x,b)});break;case 6:let g=d.pos,h=d.expression,v=d.body,y=d.elseExpressions;this.compileTimeIf(h,v,y,g,l,function(b){u.compileCommand(b,r)});break;default:let k=d.pos;throw new Pe(Je.formatContext("unexpected node type:"+Fe.string(d),k,r),!0,[k].concat(r.stack))}}return a.join("")}injectValues(e,t,i){if(e==null)return"";if(e.indexOf("<%")==-1)return e;let r=t.variables.get(),a=["embed","context"],o=this,l=[function(h){return h.embedTo(t,i,o)},t],u=r,c=u,d=u.keys();for(;d.hasNext();){let h=d.next(),v=c.get(h),k=h,b=v;a.push(k),l.push(b)}let m=[],p=[],f=0,_=e.split("<%");for(;f<_.length;){let h=_[f];++f;let v=h.split("%>");v.length==1?(p.push(v[0]),m.push("$$context["+Fe.string(p.length-1)+"]")):(m.push(v[0]),p.push(v[1]),m.push("$$context["+Fe.string(p.length-1)+"]"))}let g="return (["+m.join(",")+"].join(''));";try{return new Function(...a,"$$context",g).apply(null,l.concat([p]))}catch(h){let v=he.caught(h);throw new Pe(Je.formatContext(tn.format("Encountered an error whilst evaluating expression '{}' at {}:{}:{}",v.get_message(),i.file,i.line,i.col+1),i,t),!1,[i].concat(t.stack))}}transformCompileTimeIf(e,t,i,r,a,o,l){if(l==null&&(l=!1),oo.invokeExpressionInline(e,a,r)){let c=[],d=0;for(;d0){let v=this.ast[0].pos;throw new Pe(Je.formatContext("Unexpected top-level content in template file",v,f),!1,[v].concat(f.stack))}return[Ae.Void]}let _=[],g=0,h=this.ast;for(;g0){let h=this.ast[0].pos;throw new Pe(Je.formatContext("Unexpected top-level content in template file",h,f),!1,[h].concat(f.stack))}return}let _=0,g=this.ast;for(;_0){let h=He.join(["data",f.namespace,this.functionsDir].concat(f.path.concat([f.compiler.config.generatedDirName,"load.mcfunction"]))),v=this.loadCommands.join(` +`);f.compiler.config.header.length>0&&h.endsWith(".mcfunction")&&(v=f.compiler.config.header+` +`+v),f.compiler.io.write(h,v),t.tags.addTagEntry("minecraft:load",f.namespace+":"+f.path.concat([f.compiler.config.generatedDirName,"load"]).join("/"),f)}if(this.tickCommands.length>0){let h=He.join(["data",f.namespace,this.functionsDir].concat(f.path.concat([f.compiler.config.generatedDirName,"tick.mcfunction"]))),v=this.tickCommands.join(` +`);f.compiler.config.header.length>0&&h.endsWith(".mcfunction")&&(v=f.compiler.config.header+` +`+v),f.compiler.io.write(h,v),t.tags.addTagEntry("minecraft:tick",f.namespace+":"+f.path.concat([f.compiler.config.generatedDirName,"tick"]).join("/"),f)}}static invokeExpressionInline(e,t,i){let r=t.variables.get(),a=["context"],o=[t],l=r,u=l,c=l.keys();for(;c.hasNext();){let m=c.next(),p=u.get(m),_=m,g=p;a.push(_),o.push(g)}let d="return ("+e+");";try{return new Function(...a,d).apply(null,o)}catch(m){let p=he.caught(m);throw new Pe(Je.formatContext(tn.format("Encountered an error whilst evaluating expression '{}' at {}:{}:{}",p.get_message(),i.file,i.line,i.col+1),i,t),!1,[i].concat(t.stack))}}static get __name__(){return"mcl.McFile"}get __class__(){return oo}},"McFile"),Yr=D.global("$hxClasses")["mcl.Compiler"]=s(class ly extends D.inherits(){new(e,t,i){this.topLevelAstNodes=new Array,this.success=!0,this.templateParsingEnabled=!0,this.disableRequire=!1,this.packNamespace="mcb-"+Fe.string(new Date),this.tags=new $v,this.libStore=null,this.alreadySetupFiles=new Xe,this.files=new Xe,this.io=new br,this.config=ay.create(t),this.baseDir=e,this.libStore=i}addFile(e,t){let i=new lo(e,t);this.files.inst.set(e,i)}resolve(e,t){if(t.charAt(0)=="."){let i=He.directory(e),r=He.join([i,t]),a=He.extension(t);if(a.endsWith("js")||a=="json")return so.IJsFile(Rt(r));if(this.files.inst.has(r))return this.alreadySetupFiles.inst.has(r)||(this.alreadySetupFiles.inst.set(r,!0),this.files.inst.get(r).setup(this)),so.IMcFile(this.files.inst.get(r));throw new Pe("Failed to resolve import: "+r,!1)}else return so.IMcFile(this.libStore.lookup(t,{file:e,line:0,col:0},this))}getInitialPathInfo(e){let t=(e.startsWith(this.baseDir)?e.substring(this.baseDir.length):e).split("\\").join("/");t.charAt(0)=="/"&&(t=t.substring(1));let i=t.split("/"),r=He.withoutExtension(i[0]),a=i.slice(1).join("/");return{namespace:r,path:i.length>1?He.withoutExtension(a).split("/"):[]}}compile(e){this.success=!0;try{let t=Pt.adaptIterator(this.files.inst.values());for(;t.hasNext();){let r=t.next();this.alreadySetupFiles.inst.has(r.name)||r.setup(this)}let i=Pt.adaptIterator(this.files.inst.values());for(;i.hasNext();)i.next().compile(e,this);this.tags.writeTagFiles(this)}catch(t){let i=he.caught(t).unwrap();throw this.success=!1,he.thrown(i)}}transform(e){let t=new Map,i=Pt.adaptIterator(this.files.inst.values());for(;i.hasNext();){let a=i.next();this.alreadySetupFiles.inst.has(a.name)||a.setup(this)}let r=Pt.adaptIterator(this.files.inst.values());for(;r.hasNext();){let a=r.next();this.topLevelAstNodes=[],t.set(a.name,Ae.Group(a.transform(e,this).concat(this.topLevelAstNodes)))}return t}addTopLevelAstNode(e){this.topLevelAstNodes.push(e)}static get __name__(){return"mcl.Compiler"}get __class__(){return ly}},"Compiler");var Lue=D.$global,ud=D.global("$hxClasses")["mcl.args.JsTemplateArgument"]=s(class Op extends D.inherits(()=>_t,!0){new(e,t){super.new(e,t),this.expectJsValue=!0}parseValue(e,t,i){if(e.startsWith("<%")){let r=e.indexOf("%>");if(r==-1)return{success:!1};let a=e.substring(2,r);try{let o=_t.jsCacheIdx,l=_t.jsCache.inst.has(o),u;return l?u=_t.jsCache.inst.get(o):(u=lo.invokeExpressionInline(a,i,t),_t.jsCache.inst.set(o,u)),{success:!0,value:u,raw:e.substring(0,r+2)}}catch{return{success:!1}}}return{success:!1}}static register(){_t.register("js",Op)}static get __name__(){return"mcl.args.JsTemplateArgument"}static get __super__(){return _t}get __class__(){return Op}},"JsTemplateArgument");var Jue=D.$global,cy=D.global("$hxClasses")["mcl.args.LiteralTemplateArgument"]=s(class uy extends D.inherits(()=>_t,!0){new(e,t){this.value=t,super.new(null,e)}parseValue(e,t,i){return e==this.value||e.startsWith(this.value+" ")?{success:!0,value:e,raw:this.value}:{success:!1}}static register(){_t.register("literal",ud)}static get __name__(){return"mcl.args.LiteralTemplateArgument"}static get __super__(){return _t}get __class__(){return uy}},"LiteralTemplateArgument");var Yue=D.$global,_t=D.global("$hxClasses")["mcl.args.TemplateArgument"]=s(class Es extends D.inherits(){new(e,t){this.expectJsValue=!1,this.expectBlock=!1,this.name=e,this.pos=t}parseValue(e,t,i){throw he.thrown("override this method in subclass, plz thx")}parseValueBlock(e,t,i){throw he.thrown("override this method in subclass, plz thx")}static parse(e,t){let i=e.indexOf(":"),r=i==-1?"literal":e.substring(i+1),a=i==-1?e:e.substring(0,i);if(r=="literal")return new cy(t,a);if(!Es.argumentTypes.inst.has(r))throw he.thrown("Unknown template argument type: '"+r+"'");return xi.createInstance(Es.argumentTypes.inst.get(r),[a])}static register(e,t){if(Es.argumentTypes.inst.has(e))throw he.thrown("Template argument type already registered: "+e);Es.argumentTypes.inst.set(e,t)}static get __name__(){return"mcl.args.TemplateArgument"}get __class__(){return Es}},"TemplateArgument");_t.jsCache=null;_t.jsCacheIdx=0;_t.argumentTypes=new Xe;var rde=D.$global,dy=D.global("$hxClasses")["mcl.args.WordTemplateArgument"]=s(class Np extends D.inherits(_t){new(e,t){super.new(e,t)}parseValue(e,t,i){if(e=="")return{success:!1};let r=e.indexOf(" "),a=r==-1?e:it.substr(e,0,r);return{success:!0,value:a,raw:a}}static register(){_t.register("word",Np)}static get __name__(){return"mcl.args.WordTemplateArgument"}static get __super__(){return _t}get __class__(){return Np}},"WordTemplateArgument");var cde=D.$global,fy=D.global("$hxClasses")["mcl.args.RawTemplateArgument"]=s(class Bp extends D.inherits(_t){new(e,t){super.new(e,t)}parseValue(e,t,i){return{success:!0,value:e,raw:e}}static register(){_t.register("raw",Bp)}static get __name__(){return"mcl.args.RawTemplateArgument"}static get __super__(){return _t}get __class__(){return Bp}},"RawTemplateArgument");var _de=D.$global,my=D.global("$hxClasses")["mcl.args.IntTemplateArgument"]=s(class Rp extends D.inherits(_t){new(e,t){super.new(e,t)}parseValue(e,t,i){let r=e.indexOf(" ");r!=-1&&(e=e.substring(0,r));let a=Fe.parseInt(e);return a==null?{success:!1}:{success:!0,value:a,raw:e}}static register(){_t.register("int",Rp)}static get __name__(){return"mcl.args.IntTemplateArgument"}static get __super__(){return _t}get __class__(){return Rp}},"IntTemplateArgument");var yde=D.$global,py=D.global("$hxClasses")["mcl.args.FloatTemplateArgument"]=s(class Dp extends D.inherits(_t){new(e,t){super.new(e,t)}parseValue(e,t,i){let r=e.indexOf(" ");r!=-1&&(e=e.substring(0,r));let a=parseFloat(e);return a==null?{success:!1}:{success:!0,value:a,raw:e}}static register(){_t.register("float",Dp)}static get __name__(){return"mcl.args.FloatTemplateArgument"}static get __super__(){return _t}get __class__(){return Dp}},"FloatTemplateArgument");var Ide=D.$global,EG=D.global("$hxClasses")["mcl.args.BoundBlock"]=s(class _y extends D.inherits(){new(e,t){this.node=e,this.ctx=t}appendAstNode(e){let t=this.node;if(t._hx_index==8){let i=t.pos,r=t.name,a=t.data,o=t.isMacro,l=t.isInline;t.body.push(e)}else throw he.thrown("BoundBlock.append: node is not a block")}append(e){let t=ni.tokenize(e,""),i=new io(t);for(;i.hasNext();)this.appendAstNode(tn.innerParse(i))}setName(e){let t=this.node;if(t._hx_index==8){let i=t.name,r=t.pos,a=t.body,o=t.data,l=t.isMacro,u=t.isInline;this.node=Ae.Block(r,e,a,o,l,u)}else throw he.thrown("BoundBlock.setName: node is not a block")}embedTo(e,t,i,r){r==null&&(r=!0);let a=[],o={isTemplate:!1,uidIndex:e.uidIndex,namespace:e.namespace,path:e.path,variables:this.ctx.variables,replacements:this.ctx.replacements,stack:this.ctx.stack,append:function(l){a.push(l)},templates:this.ctx.templates,requireTemplateKeyword:this.ctx.requireTemplateKeyword,compiler:this.ctx.compiler,globalVariables:this.ctx.globalVariables,functions:this.ctx.functions,baseNamespaceInfo:e.baseNamespaceInfo,currentFunction:this.ctx.currentFunction};return r?i.embed(o,t,new Xe,[this.node]):i.embedTransform(o,t,new Xe,[this.node]),a.join(` +`)}static get __name__(){return"mcl.args.BoundBlock"}get __class__(){return _y}},"BoundBlock"),gy=D.global("$hxClasses")["mcl.args.BlockTemplateArgument"]=s(class Mp extends D.inherits(_t){new(e,t){super.new(e,t),this.expectBlock=!0}parseValueBlock(e,t,i){if(e._hx_index==8){let r=e.pos,a=e.name,o=e.body,l=e.data,u=e.isMacro,c=e.isInline;return{success:!0,value:new EG(e,i)}}else return{success:!1}}static register(){_t.register("block",Mp)}static get __name__(){return"mcl.args.BlockTemplateArgument"}static get __super__(){return _t}get __class__(){return Mp}},"BlockTemplateArgument");var Vde=D.$global,dd=D.global("$hxClasses")["mcl.TemplateRegisterer"]=s(class hy{static register(){fy.register(),my.register(),ud.register(),gy.register(),py.register(),dy.register()}static get __name__(){return"mcl.TemplateRegisterer"}get __class__(){return hy}},"TemplateRegisterer");var by=ci(Rt("fs"));var Xde=D.$global,Lp=D.global("$hxClasses").LibMain=s(class Fp{static main(){dd.register()}static createCompiler(e,t,i){return new Yr(e,t,i)}static parseFile(e,t){let i=He.extension(e),r=ni.tokenize(t,e);if(i=="mcb")return tn.parseMcbFile(r);if(i=="mcbt")return tn.parseMcbtFile(r);throw he.thrown("Unknown file extension: "+i)}static addFileToCompiler(e,t){let i=He.extension(t),r=ni.tokenize(by.readFileSync(t,{encoding:"utf8"}),t);e.addFile(t,i=="mcb"?tn.parseMcbFile(r):tn.parseMcbtFile(r))}static compileFromFsLikeMap(e,t,i){let r=Fp.createCompiler(e,{},null),a=t.entries(),o=a,l=a.next();for(;!l.done;){let u=l.value;l=o.next();let c=u,d=ni.tokenize(c[1],c[0]),m=He.extension(c[0])=="mcb"?tn.parseMcbFile(d):tn.parseMcbtFile(d);r.addFile(c[0],m)}r.io=i,r.compile(new cn(null))}static createIoProvider(e){switch(e){case 0:return new br;case 1:return new xs;default:return new ks(e)}}static get __name__(){return"LibMain"}get __class__(){return Fp}},"LibMain");var rfe=D.$global,TG=D.global("$hxClasses")["mcl.AstStringifier"]=s(class Pp extends D.inherits(){new(){this.tabs=[""],this.indent=0,this.segments=[]}tab(){let e;if(this.tabs.length>this.indent)e=this.tabs[this.indent];else{let t=this.tabs[this.tabs.length-1],i=this.tabs.length-1,r=this.indent;for(;i0)throw he.thrown("continuations not supported");this.segments.push(` +`);break;case 1:let u=e.pos,c=e.name,d=e.body,m=e.appendTo;t&&this.tab(),this.segments.push("function "),this.segments.push(c),m!=null&&(this.segments.push(" "),this.segments.push(m)),this.segments.push(`{ +`),this.inc();let p=0;for(;p=200&&y<400?g.success(g.responseBytes):g.onError("Http Error #"+y)})},"httpResponse");this.req=i?Ey.request(_,h):Ty.request(_,h),e&&(this.postData!=null?this.req.write(this.postData):this.postBytes!=null&&(this.req.setHeader("Content-Length",""+this.postBytes.length),this.req.write(md.Buffer.from(this.postBytes.b.bufferValue)))),this.req.end()}static get __name__(){return"haxe.http.HttpNodeJs"}static get __super__(){return zp}get __class__(){return Ay}},"HttpNodeJs");var Vfe=D.$global,Ea=D.global("$hxClasses")["haxe.ds.List"]=s(class jy extends D.inherits(){new(){this.length=0}add(e){let t=new Sy(e,null);this.h==null?this.h=t:this.q.next=t,this.q=t,this.length++}push(e){let t=new Sy(e,this.h);this.h=t,this.q==null&&(this.q=t),this.length++}first(){return this.h==null?null:this.h.item}pop(){if(this.h==null)return null;let e=this.h.item;return this.h=this.h.next,this.h==null&&(this.q=null),this.length--,e}isEmpty(){return this.h==null}toString(){let e="",t=!0,i=this.h;for(e+="{";i!=null;)t?t=!1:e+=", ",e+=Fe.string(Fe.string(i.item)),i=i.next;return e+="}",e}static get __name__(){return"haxe.ds.List"}get __class__(){return jy}},"List"),Sy=D.global("$hxClasses")["haxe.ds._List.ListNode"]=s(class Iy extends D.inherits(){new(e,t){this.item=e,this.next=t}static get __name__(){return"haxe.ds._List.ListNode"}get __class__(){return Iy}},"ListNode");var Yfe=D.$global,Oy=D.global("$hxClasses")["haxe._Unserializer.DefaultResolver"]=s(class Ny extends D.inherits(){new(){}resolveClass(e){return D.global("$hxClasses")[e]}resolveEnum(e){return D.global("$hxEnums")[e]}static get __name__(){return"haxe._Unserializer.DefaultResolver"}get __class__(){return Ny}},"DefaultResolver"),ec=D.global("$hxClasses")["haxe.Unserializer"]=s(class Qr extends D.inherits(){new(e){this.buf=e,this.length=this.buf.length,this.pos=0,this.scache=new Array,this.cache=new Array;let t=Qr.DEFAULT_RESOLVER;t==null&&(t=new Oy,Qr.DEFAULT_RESOLVER=t),this.resolver=t}readDigits(){let e=0,t=!1,i=this.pos;for(;;){let r=this.buf.charCodeAt(this.pos);if(r!=r)break;if(r==45){if(this.pos!=i)break;t=!0,this.pos++;continue}if(r<48||r>57)break;e=e*10+(r-48),this.pos++}return t&&(e*=-1),e}readFloat(){let e=this.pos;for(;;){let t=this.buf.charCodeAt(this.pos);if(t!=t)break;if(t>=43&&t<58||t==101||t==69)this.pos++;else break}return parseFloat(it.substr(this.buf,e,this.pos-e))}unserializeObject(e){for(;;){if(this.pos>=this.length)throw he.thrown("Invalid object");if(this.buf.charCodeAt(this.pos)==103)break;let t=this.unserialize();if(typeof t!="string")throw he.thrown("Invalid object key");let i=this.unserialize();e[t]=i}this.pos++}unserializeEnum(e,t){if(this.buf.charCodeAt(this.pos++)!=58)throw he.thrown("Invalid enum format");let i=this.readDigits();if(i==0)return xi.createEnum(e,t);let r=new Array;for(;i-- >0;)r.push(this.unserialize());return xi.createEnum(e,t,r)}unserialize(){switch(this.buf.charCodeAt(this.pos++)){case 65:let e=this.unserialize(),t=this.resolver.resolveClass(e);if(t==null)throw he.thrown("Class not found "+e);return t;case 66:let i=this.unserialize(),r=this.resolver.resolveEnum(i);if(r==null)throw he.thrown("Enum not found "+i);return r;case 67:let a=this.unserialize(),o=this.resolver.resolveClass(a);if(o==null)throw he.thrown("Class not found "+a);let l=Object.create(o.prototype);if(this.cache.push(l),l.hxUnserialize(this),this.buf.charCodeAt(this.pos++)!=103)throw he.thrown("Invalid custom data");return l;case 77:let u=new ps;this.cache.push(u);let c=this.buf;for(;this.buf.charCodeAt(this.pos)!=104;){let ie=this.unserialize(),Ie=this.unserialize();u.inst.set(ie,Ie)}return this.pos++,u;break;case 82:let d=this.readDigits();if(d<0||d>=this.scache.length)throw he.thrown("Invalid string reference");return this.scache[d];case 97:let m=this.buf,p=new Array;for(this.cache.push(p);;){let ie=this.buf.charCodeAt(this.pos);if(ie==104){this.pos++;break}if(ie==117){this.pos++;let Ie=this.readDigits();p[p.length+Ie-1]=null}else p.push(this.unserialize())}return p;case 98:let f=new Xe;this.cache.push(f);let _=this.buf;for(;this.buf.charCodeAt(this.pos)!=104;){let ie=this.unserialize(),Ie=this.unserialize();f.inst.set(ie,Ie)}return this.pos++,f;break;case 99:let g=this.unserialize(),h=this.resolver.resolveClass(g);if(h==null)throw he.thrown("Class not found "+g);let v=Object.create(h.prototype);return this.cache.push(v),this.unserializeObject(v),v;break;case 100:return this.readFloat();case 102:return!1;case 105:return this.readDigits();case 106:let y=this.unserialize(),k=this.resolver.resolveEnum(y);if(k==null)throw he.thrown("Enum not found "+y);this.pos++;let b=this.readDigits(),x=k.__constructs__,E=new Array(x.length),C=0,j=x.length;for(;C=this.cache.length)throw he.thrown("Invalid reference");return this.cache[ae];case 115:let ee=this.readDigits(),se=this.buf;if(this.buf.charCodeAt(this.pos++)!=58||this.length-this.pos>2)*3+(ne>=2?ne-1:0),W=xe+(ee-ne),U=new Di(new ArrayBuffer(pe)),ce=0;for(;xe>4;let Q=oe[se.charCodeAt(xe++)];U.b[ce++]=Ie<<4|Q>>2;let st=oe[se.charCodeAt(xe++)];U.b[ce++]=Q<<6|st}if(ne>=2){let ie=oe[se.charCodeAt(xe++)],Ie=oe[se.charCodeAt(xe++)];if(U.b[ce++]=ie<<2|Ie>>4,ne==3){let Q=oe[se.charCodeAt(xe++)];U.b[ce++]=Ie<<4|Q>>2}}return this.pos+=ee,this.cache.push(U),U;break;case 116:return!0;case 118:let J;return this.buf.charCodeAt(this.pos)>=48&&this.buf.charCodeAt(this.pos)<=57&&this.buf.charCodeAt(this.pos+1)>=48&&this.buf.charCodeAt(this.pos+1)<=57&&this.buf.charCodeAt(this.pos+2)>=48&&this.buf.charCodeAt(this.pos+2)<=57&&this.buf.charCodeAt(this.pos+3)>=48&&this.buf.charCodeAt(this.pos+3)<=57&&this.buf.charCodeAt(this.pos+4)==45?(J=it.strDate(it.substr(this.buf,this.pos,19)),this.pos+=19):J=new Date(this.readFloat()),this.cache.push(J),J;break;case 119:let Ce=this.unserialize(),Y=this.resolver.resolveEnum(Ce);if(Y==null)throw he.thrown("Enum not found "+Ce);let z=this.unserializeEnum(Y,this.unserialize());return this.cache.push(z),z;break;case 120:throw he.thrown(this.unserialize());case 121:let be=this.readDigits();if(this.buf.charCodeAt(this.pos++)!=58||this.length-this.pos({_hx_index:0,__enum__:"haxe._Template.TemplateExpr",v:n,"@kind":"OpVar"}),{_hx_name:"OpVar",__params__:["v"]}),OpExpr:Object.assign(n=>({_hx_index:1,__enum__:"haxe._Template.TemplateExpr",expr:n,"@kind":"OpExpr"}),{_hx_name:"OpExpr",__params__:["expr"]}),OpIf:Object.assign((n,e,t)=>({_hx_index:2,__enum__:"haxe._Template.TemplateExpr",expr:n,eif:e,eelse:t,"@kind":"OpIf"}),{_hx_name:"OpIf",__params__:["expr","eif","eelse"]}),OpStr:Object.assign(n=>({_hx_index:3,__enum__:"haxe._Template.TemplateExpr",str:n,"@kind":"OpStr"}),{_hx_name:"OpStr",__params__:["str"]}),OpBlock:Object.assign(n=>({_hx_index:4,__enum__:"haxe._Template.TemplateExpr",l:n,"@kind":"OpBlock"}),{_hx_name:"OpBlock",__params__:["l"]}),OpForeach:Object.assign((n,e)=>({_hx_index:5,__enum__:"haxe._Template.TemplateExpr",expr:n,loop:e,"@kind":"OpForeach"}),{_hx_name:"OpForeach",__params__:["expr","loop"]}),OpMacro:Object.assign((n,e)=>({_hx_index:6,__enum__:"haxe._Template.TemplateExpr",name:n,params:e,"@kind":"OpMacro"}),{_hx_name:"OpMacro",__params__:["name","params"]})};oi.__constructs__=[oi.OpVar,oi.OpExpr,oi.OpIf,oi.OpStr,oi.OpBlock,oi.OpForeach,oi.OpMacro];oi.__empty_constructs__=[];var ea=D.global("$hxClasses")["haxe.Template"]=s(class Gn extends D.inherits(){new(e){let t=this.parseTokens(e);if(this.expr=this.parseBlock(t),!t.isEmpty())throw he.thrown("Unexpected '"+Fe.string(t.first().s)+"'")}execute(e,t){return this.macros=t??{},this.context=e,this.stack=new Ea,this.buf=new Gp,this.run(this.expr),this.buf.b}resolve(e){if(e=="__current__")return this.context;if(rn.isObject(this.context)){let i=rn.getProperty(this.context,e);if(i!=null||Object.prototype.hasOwnProperty.call(this.context,e))return i}let t=this.stack.h;for(;t!=null;){let i=t.item;t=t.next;let r=i,a=rn.getProperty(r,e);if(a!=null||Object.prototype.hasOwnProperty.call(r,e))return a}return rn.field(Gn.globals,e)}parseTokens(e){let t=new Ea;for(;Gn.splitter.match(e);){let i=Gn.splitter.matchedPos();if(i.pos>0&&t.add({p:it.substr(e,0,i.pos),s:!0,l:null}),it.cca(e,i.pos)==58){t.add({p:it.substr(e,i.pos+2,i.len-4),s:!1,l:null}),e=Gn.splitter.matchedRight();continue}let r=i.pos+i.len,a=1,o=[],l="";for(;;){let u=it.cca(e,r);if(++r,u==40)++a;else if(u==41){if(--a,a<=0)break}else if(u==null)throw he.thrown("Unclosed macro parenthesis");u==44&&a==1?(o.push(l),l=""):l+=String.fromCodePoint(u)}o.push(l),t.add({p:Gn.splitter.matched(2),s:!1,l:o}),e=it.substr(e,r,e.length-r)}return e.length>0&&t.add({p:e,s:!0,l:null}),t}parseBlock(e){let t=new Ea;for(;;){let i=e.first();if(i==null||!i.s&&(i.p=="end"||i.p=="else"||it.substr(i.p,0,7)=="elseif "))break;t.add(this.parse(e))}return t.length==1?t.first():oi.OpBlock(t)}parse(e){let t=e.pop(),i=t.p;if(t.s)return oi.OpStr(i);if(t.l!=null){let l=new Ea,u=0,c=t.l;for(;u0){i=it.substr(i,a,i.length-a);let l=this.parseExpr(i),u=this.parseBlock(e),c=e.first(),d;if(c==null)throw he.thrown("Unclosed 'if'");if(c.p=="end")e.pop(),d=null;else if(c.p=="else"){if(e.pop(),d=this.parseBlock(e),c=e.pop(),c==null||c.p!="end")throw he.thrown("Unclosed 'else'")}else c.p=it.substr(c.p,4,c.p.length-4),d=this.parse(e);return oi.OpIf(l,u,d)}let o=r("foreach");if(o>=0){i=it.substr(i,o,i.length-o);let l=this.parseExpr(i),u=this.parseBlock(e),c=e.pop();if(c==null||c.p!="end")throw he.thrown("Unclosed 'foreach'");return oi.OpForeach(l,u)}return Gn.expr_splitter.match(i)?oi.OpExpr(this.parseExpr(i)):oi.OpVar(i)}parseExpr(e){let t=new Ea,i=e;for(;Gn.expr_splitter.match(e);){let a=Gn.expr_splitter.matchedPos(),o=a.pos+a.len;a.pos!=0&&t.add({p:it.substr(e,0,a.pos),s:!0});let l=Gn.expr_splitter.matched(0);t.add({p:l,s:l.indexOf('"')>=0}),e=Gn.expr_splitter.matchedRight()}if(e.length!=0){let a=0,o=e;for(;a");if(t.s)return this.makeConst(t.p);switch(t.p){case"!":let i=this.makeExpr(e);return function(){let c=i();return c!=null?c==!1:!0};case"(":this.skipSpaces(e);let r=this.makeExpr(e);this.skipSpaces(e);let a=e.pop();if(a==null||a.s)throw he.thrown(a);if(a.p==")")return r;this.skipSpaces(e);let o=this.makeExpr(e);this.skipSpaces(e);let l=e.pop();if(this.skipSpaces(e),l==null||l.p!=")")throw he.thrown(l);switch(a.p){case"!=":return function(){return r()!=o()};case"&&":return function(){return r()&&o()};case"*":return function(){return r()*o()};case"+":return function(){return r()+o()};case"-":return function(){return r()-o()};case"/":return function(){return r()/o()};case"<":return function(){return r()":return function(){return r()>o()};case">=":return function(){return r()>=o()};case"||":return function(){return r()||o()};default:throw he.thrown("Unknown operation "+a.p)}break;case"-":let u=this.makeExpr(e);return function(){return-u()}}throw he.thrown(t.p)}run(e){switch(e._hx_index){case 0:let t=e.v,i=this.buf,r=Fe.string(this.resolve(t));i.b+=Fe.string(r);break;case 1:let a=e.expr,o=this.buf,l=Fe.string(a());o.b+=Fe.string(l);break;case 2:let u=e.expr,c=e.eif,d=e.eelse,m=u();m==null||m==!1?d!=null&&this.run(d):this.run(c);break;case 3:let p=e.str;this.buf.b+=p==null?"null":""+p;break;case 4:let _=e.l.h;for(;_!=null;){let B=_.item;_=_.next;let O=B;this.run(O)}break;case 5:let g=e.expr,h=e.loop,v=g();try{let B=D.getIterator(v);if(B.hasNext==null)throw he.thrown(null);v=B}catch{try{if(v.hasNext==null)throw he.thrown(null)}catch{throw he.thrown("Cannot iter on "+Fe.string(v))}}this.stack.push(this.context);let k=v;for(;k.hasNext();){let B=k.next();this.context=B,this.run(h)}this.context=this.stack.pop();break;case 6:let b=e.name,x=e.params,E=rn.field(this.macros,b),C=new Array,j=this.buf;C.push(D.bind(this,this.resolve));let S=x.h;for(;S!=null;){let B=S.item;S=S.next;let O=B;if(O._hx_index==0){let A=O.v;C.push(this.resolve(A))}else this.buf=new Gp,this.run(O),C.push(this.buf.b)}this.buf=j;try{let B=this.buf,O=Fe.string(E.apply(this.macros,C));B.b+=Fe.string(O)}catch(B){let O=he.caught(B).unwrap(),A;try{A=C.join(",")}catch{A="???"}let V="Macro call "+b+"("+A+") failed ("+Fe.string(O)+")";throw he.thrown(V)}break}}static get __name__(){return"haxe.Template"}get __class__(){return Gn}},"Template");ea.splitter=new Xr('(::[A-Za-z0-9_ ()&|!+=/><*."-]+::|\\$\\$([A-Za-z0-9_-]+)\\()',"");ea.expr_splitter=new Xr(`(\\(|\\)|[ \r ]*"[^"]*"[ \r - ]*|[!+=/><*.&|-]+)`,"");Wr.expr_trim=new $r("^[ ]*([^ ]+)[ ]*$","");Wr.expr_int=new $r("^[0-9]+$","");Wr.expr_float=new $r("^([+-]?)(?=\\d|,\\d)\\d*(,\\d*)?([Ee]([+-]?\\d+))?$","");Wr.globals={};Wr.hxKeepArrayIterator=new zl([]);var tn=ui(rn("fs"));var Sde=M.$global,Cp=M.global("$hxClasses")["mcb.AppMain"]=s(class ba{static loadDebugProject(e,t){let i=new $l(tn.readFileSync(e,{encoding:"utf8"}));for(;;){let r=i.unserialize();if(r==null)break;let a=Ge.join([t,r.f]);an.createDirectory(Ge.directory(a)),tn.writeFileSync(a,r.s),tn.writeFileSync(a+".tokens",Be.string(r.t)),tn.writeFileSync(a+".ast",Be.string(r.a))}}static discoverConfigFile(e){return an.exists(e+".cjs")?e+".cjs":an.exists(e+".js")?e+".js":an.exists(e+".json")?e+".json":e}static getFilesInDirectory(e){let t=tn.readdirSync(e),i=[],r=0;for(;r<*.&|-]+)`,"");ea.expr_trim=new Xr("^[ ]*([^ ]+)[ ]*$","");ea.expr_int=new Xr("^[0-9]+$","");ea.expr_float=new Xr("^([+-]?)(?=\\d|,\\d)\\d*(,\\d*)?([Ee]([+-]?\\d+))?$","");ea.globals={};ea.hxKeepArrayIterator=new Wl([]);var un=ci(Rt("fs"));var Dme=D.$global,Up=D.global("$hxClasses")["mcb.AppMain"]=s(class Ta{static loadDebugProject(e,t){let i=new ec(un.readFileSync(e,{encoding:"utf8"}));for(;;){let r=i.unserialize();if(r==null)break;let a=He.join([t,r.f]);fn.createDirectory(He.directory(a)),un.writeFileSync(a,r.s),un.writeFileSync(a+".tokens",Fe.string(r.t)),un.writeFileSync(a+".ast",Fe.string(r.a))}}static discoverConfigFile(e){return fn.exists(e+".cjs")?e+".cjs":fn.exists(e+".js")?e+".js":fn.exists(e+".json")?e+".json":e}static getFilesInDirectory(e){let t=un.readdirSync(e),i=[],r=0;for(;r {\r }\r # Rotation Logic\r execute at @s on passengers run tp @s ~ ~ ~ ~ ~\r + IF (root_ticking_commands) {\r + <%%\r + emit.mcb(root_ticking_commands)\r + %%>\r + }\r # Post tick\r function #*<%export_namespace%>/as_root/post_tick\r }\r @@ -3458,9 +3469,11 @@ dir <%export_namespace%> {\r function <%animation.frames.indexOf(frame)%> {\r <%%\r if (frame.variant) {\r + console.log('Variant:', frame.variant)\r const variant = rig.variants[frame.variant.uuid]\r if (!variant) return\r - emit.mcb(\`execute on vehicle unless entity @s[tag=<%TAGS.TRANSFORMS_ONLY()%>] run function *\${export_namespace}/variants/\${variant.name}/apply\`)\r + const execute_condition = variant.execute_condition ? variant.execute_condition.trim() + ' ' : ''\r + emit.mcb(\`execute \${execute_condition}on vehicle unless entity @s[tag=<%TAGS.TRANSFORMS_ONLY()%>] run function *\${export_namespace}/variants/\${variant.name}/apply\`)\r }\r global.merged = {\r locators: {},\r @@ -3503,7 +3516,7 @@ dir <%export_namespace%> {\r }\r %%>\r }\r - IF (node.commands) {\r + IF (global.transform.commands) {\r execute on vehicle unless entity @s[tag=<%TAGS.TRANSFORMS_ONLY()%>] <%global.transform.execute_condition ? global.transform.execute_condition.trim() + ' ' : ''%>positioned \\\r ^<%roundTo(global.transform.pos[0], 10)%> \\\r ^<%roundTo(global.transform.pos[1], 10)%> \\\r @@ -3512,9 +3525,6 @@ dir <%export_namespace%> {\r ~<%roundTo(global.transform.head_rot[1], 10)%> \\\r ~<%roundTo(global.transform.head_rot[0], 10)%> \\\r run {\r - REPEAT(0, 10) as i {\r - particle bubble ^ ^ ^<%i/10%>\r - }\r <%%\r emit.mcb(global.transform.commands)\r %%>\r @@ -3742,8 +3752,8 @@ dir <%export_namespace%> {\r execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \\\r function *global/errors/function_not_executed_as_root_entity \\\r {'export_namespace': '<%export_namespace%>', 'function_path': 'animated_java:<%export_namespace%>/variants/<%variant.name%>/apply'}\r - REPEAT (Object.entries(rig.nodes)) as node {\r - IF (node.type === 'bone' && !Object.values(variant.excluded_nodes).find(v => v.value === node.uuid) && (variant.models[node.uuid] !== undefined || node.configs.variants[variant.uuid])) {\r + REPEAT (Object.values(rig.nodes)) as node {\r + IF (node.type === 'bone' && !variant.excluded_nodes.includes(node.uuid) && (variant.models[node.uuid] !== undefined || node.configs.variants[variant.uuid] !== undefined)) {\r execute on passengers if entity @s[tag=aj.<%export_namespace%>.bone.<%node.safe_name%>] run {\r IF (variant.models[node.uuid] !== undefined) {\r data modify entity @s item.components.minecraft:custom_model_data set value <%variant.models[node.uuid].custom_model_data%>\r @@ -3792,24 +3802,24 @@ dir <%export_namespace%> {\r }\r }\r }\r -`;var X1=rn("timers");var Kl=class{constructor(e){this.limit=e;this.lastTime=performance.now()}lastTime;async sync(){return performance.now()-this.lastTime>=this.limit?(await new Promise(i=>requestAnimationFrame(i)),this.lastTime=performance.now(),!0):!1}};s(Kl,"MSLimiter");var z9=["bone","text_display","item_display","block_display"],Ln;(y=>(y.NEW=s(()=>"aj.new","NEW"),y.GLOBAL_RIG=s(()=>"aj.rig_entity","GLOBAL_RIG"),y.TRANSFORMS_ONLY=s(()=>"aj.transforms_only","TRANSFORMS_ONLY"),y.GLOBAL_ROOT=s(()=>"aj.rig_root","GLOBAL_ROOT"),y.PROJECT_ROOT=s(k=>`aj.${k}.root`,"PROJECT_ROOT"),y.OUTDATED_RIG_TEXT_DISPLAY=s(()=>"aj.outdated_rig_text_display","OUTDATED_RIG_TEXT_DISPLAY"),y.GLOBAL_BONE=s(()=>"aj.bone","GLOBAL_BONE"),y.GLOBAL_CAMERA=s(()=>"aj.camera","GLOBAL_CAMERA"),y.GLOBAL_LOCATOR=s(()=>"aj.locator","GLOBAL_LOCATOR"),y.GLOBAL_DATA=s(()=>"aj.data","GLOBAL_DATA"),y.PROJECT_BONE=s(k=>`aj.${k}.bone`,"PROJECT_BONE"),y.PROJECT_CAMERA=s(k=>`aj.${k}.camera`,"PROJECT_CAMERA"),y.PROJECT_LOCATOR=s(k=>`aj.${k}.locator`,"PROJECT_LOCATOR"),y.PROJECT_DATA=s(k=>`aj.${k}.data`,"PROJECT_DATA"),y.LOCAL_BONE=s((k,C)=>`aj.${k}.bone.${C}`,"LOCAL_BONE"),y.LOCAL_CAMERA=s((k,C)=>`aj.${k}.camera.${C}`,"LOCAL_CAMERA"),y.LOCAL_LOCATOR=s((k,C)=>`aj.${k}.locator.${C}`,"LOCAL_LOCATOR"),y.ANIMATION_PLAYING=s((k,C)=>`aj.${k}.animation.${C}.playing`,"ANIMATION_PLAYING"),y.TWEENING=s((k,C)=>`aj.${k}.animation.${C}.tween_playing`,"TWEENING"),y.VARIANT_APPLIED=s((k,C)=>`aj.${k}.variant.${C}.applied`,"VARIANT_APPLIED")))(Ln||={});var ql;(a=>(a.I=s(()=>"aj.i","I"),a.ID=s(()=>"aj.id","ID"),a.FRAME=s(o=>`aj.${o}.frame`,"FRAME"),a.IS_RIG_LOADED=s(()=>"aj.is_rig_loaded","IS_RIG_LOADED"),a.TWEEN_DURATION=s(()=>"aj.tween_duration","TWEEN_DURATION")))(ql||={});var io=new ln([{text:"[",color:"gray"},{text:"AJ",color:"aqua"},{text:"] "}]),Y1;(c=>(c.RIG_OUTDATED=s(u=>new ln(["",io,{text:"Error: ",color:"red"},{text:"The ",color:"red"},{text:u,color:"yellow"},{text:" rig instance at",color:"red"},[{text:" [",color:"yellow"},{score:{name:"#this.x",objective:ql.I()}},", ",{score:{name:"#this.y",objective:ql.I()}},", ",{score:{name:"#this.z",objective:ql.I()}},"]"],{text:" is outdated! It will not function correctly and should be removed or re-summoned.",color:"red"},` - `,{text:"[Click Here to Teleport to the Rig Instance]",clickEvent:{action:"suggest_command",value:"/tp @s $(x) $(y) $(z)"},color:"aqua",underlined:!0}]),"RIG_OUTDATED"),c.RIG_OUTDATED_TEXT_DISPLAY=s(()=>new ln(["",{text:"This rig instance is outdated!\\nIt will not function correctly and should be removed or re-summoned.",color:"red"}]),"RIG_OUTDATED_TEXT_DISPLAY"),c.FUNCTION_NOT_EXECUTED_AS_ROOT_ERROR=s((u,d)=>new ln(["",io,{text:"Error: ",color:"red"},{text:"The function ",color:"red"},{text:u,color:"yellow"},{text:" must be executed as the root entity.",color:"red"},{text:` - You can use `,color:"red"},{text:`execute as @e[tag=${d}] run ...`,color:"aqua"},{text:" to run the function as the root.",color:"red"}]),"FUNCTION_NOT_EXECUTED_AS_ROOT_ERROR"),c.VARIANT_CANNOT_BE_EMPTY=s(()=>new ln(["",io,{text:"Error: ",color:"red"},{text:"variant",color:"yellow"},{text:" cannot be an empty string.",color:"red"}]),"VARIANT_CANNOT_BE_EMPTY"),c.INVALID_VARIANT=s((u,d)=>new ln(["",io,{text:"Error: ",color:"red"},{text:"The variant ",color:"red"},{text:u,color:"yellow"},{text:" does not exist.",color:"red"},` - `,{text:" \u2261 ",color:"white"},{text:"Available Variants:",color:"green"},...Object.values(d).map(m=>new ln([` - `," "," ",{text:" \u25CF ",color:"gray"},{text:m.name,color:"yellow"}]))]),"INVALID_VARIANT"),c.ANIMATION_CANNOT_BE_EMPTY=s(()=>new ln(["",io,{text:"Error: ",color:"red"},{text:"animation",color:"yellow"},{text:" cannot be an empty string.",color:"red"}]),"ANIMATION_CANNOT_BE_EMPTY"),c.FRAME_CANNOT_BE_NEGATIVE=s(()=>new ln(["",io,{text:"Error: ",color:"red"},{text:"frame",color:"yellow"},{text:" must be a non-negative integer.",color:"red"}]),"FRAME_CANNOT_BE_NEGATIVE"),c.INVALID_ANIMATION=s((u,d)=>new ln(["",io,{text:"Error: ",color:"red"},{text:"The animation ",color:"red"},{text:u,color:"yellow"},{text:" does not exist.",color:"red"},` - `,{text:" \u2261 ",color:"white"},{text:"Available Animations:",color:"green"},...d.map(m=>new ln([` - `," "," ",{text:" \u25CF ",color:"gray"},{text:m.safe_name,color:"yellow"}]))]),"INVALID_ANIMATION")))(Y1||={});async function U9(n,e){let t=Project.animated_java,i=new wn,{locators:r,cameras:a,bones:o}=J9(n);i.add(new Ze().set("id",new at("minecraft:marker")).set("Tags",new wn([new at(Ln.GLOBAL_RIG()),new at(Ln.GLOBAL_DATA()),new at(Ln.PROJECT_DATA(t.export_namespace))])).set("data",new Ze().set("rigHash",new at(e)).set("locators",r).set("cameras",a).set("bones",o)));for(let[l,c]of Object.entries(n.nodes)){let u=new Ze,d=!0,m=new wn([new at(Ln.GLOBAL_RIG())]);switch(u.set("Tags",m),c.type){case"bone":{u.set("id",new at("minecraft:item_display")),m.add(new at(Ln.GLOBAL_BONE())),m.add(new at(Ln.PROJECT_BONE(t.export_namespace))),m.add(new at(Ln.LOCAL_BONE(t.export_namespace,c.safe_name))),u.set("transformation",new Ze().set("translation",ki([0,0,0])).set("left_rotation",ki([0,0,0,1])).set("right_rotation",ki([0,0,0,1])).set("scale",ki([0,0,0]))),u.set("interpolation_duration",new Kt(t.interpolation_duration)),u.set("teleport_duration",new Kt(0)),u.set("item_display",new at("head"));let p=new Ze,f=n.variants[Se.getDefault().uuid].models[l];if(!f)throw new Error(`Model for bone '${c.safe_name}' not found!`);u.set("item",p.set("id",new at(t.display_item)).set(d?"count":"Count",new Kt(1)).set(d?"components":"tag",new Ze().set(d?"minecraft:custom_model_data":"CustomModelData",new Kt(f.custom_model_data)))),c.configs.default&&Pe.fromJSON(c.configs.default).toNBT(u),u.set("height",new wt(t.bounding_box[1])),u.set("width",new wt(t.bounding_box[0]));break}case"text_display":{u.set("id",new at("minecraft:text_display")),m.add(new at(Ln.GLOBAL_BONE())),m.add(new at(Ln.PROJECT_BONE(t.export_namespace))),m.add(new at(Ln.LOCAL_BONE(t.export_namespace,c.safe_name))),u.set("transformation",new Ze().set("translation",ki([0,0,0])).set("left_rotation",ki([0,0,0,1])).set("right_rotation",ki([0,0,0,1])).set("scale",ki([0,0,0]))),u.set("interpolation_duration",new Kt(t.interpolation_duration)),u.set("teleport_duration",new Kt(0)),u.set("height",new wt(t.bounding_box[1])),u.set("width",new wt(t.bounding_box[0])),u.set("text",new at(c.text?c.text.toString():'"Invalid Text Component"'));let p=new tinycolor(c.background_color+ko(c.background_alpha));u.set("background",new Kt(sg(p))),u.set("line_width",new Kt(c.line_width)),u.set("shadow",new Bn(c.shadow?1:0)),u.set("see_through",new Bn(c.see_through?1:0)),c.config&&Mt.fromJSON(c.config).toNBT(u);break}case"item_display":{u.set("id",new at("minecraft:item_display")),m.add(new at(Ln.GLOBAL_BONE())),m.add(new at(Ln.PROJECT_BONE(t.export_namespace))),m.add(new at(Ln.LOCAL_BONE(t.export_namespace,c.safe_name))),u.set("item",new Ze().set("id",new at(c.item)).set("count",new Kt(1))),c.config&&Pe.fromJSON(c.config).toNBT(u);break}case"block_display":{u.set("id",new at("minecraft:block_display")),m.add(new at(Ln.GLOBAL_BONE())),m.add(new at(Ln.PROJECT_BONE(t.export_namespace))),m.add(new at(Ln.LOCAL_BONE(t.export_namespace,c.safe_name)));let p=await xo(c.block);if(!p)throw new Error(`Invalid Blockstate '${c.block}' in node '${c.safe_name}'!`);let f=new Ze;for(let[_,v]of Object.entries(p.states))f.set(_,new at(v.toString()));u.set("block_state",new Ze().set("Name",new at(p.resource.name)).set("Properties",f)),c.config&&Pe.fromJSON(c.config).toNBT(u);break}}i.add(u)}return i.toString()}s(U9,"generateRootEntityPassengers");var td=class{constructor(e,t,i,r){this.path=e;this.exportNamespace=t;this.lastUsedExportNamespace=i;this.dataPackFolder=r}files=new Set;oldFiles=new Set;oldContent={};read(){if(!fs.existsSync(this.path))return;this.oldContent=JSON.parse(fs.readFileSync(this.path,"utf-8"));let e=this.oldContent[this.exportNamespace],t=this.oldContent[this.lastUsedExportNamespace];if(t){Array.isArray(t.files)||(t.files=[]);for(let i of t.files)this.oldFiles.add(PathModule.join(this.dataPackFolder,i));delete this.oldContent[this.lastUsedExportNamespace]}if(e){Array.isArray(e.files)||(e.files=[]);for(let i of e.files)this.oldFiles.add(PathModule.join(this.dataPackFolder,i));delete this.oldContent[this.exportNamespace]}}write(){let e=PathModule.dirname(this.path),t={...this.oldContent,[this.exportNamespace]:{files:Array.from(this.files).map(i=>PathModule.relative(e,i).replace(/\\/g,"/"))}};fs.writeFileSync(this.path,autoStringify(El(t)))}};s(td,"DataPackAJMeta");async function G9(n,e){Wn.set("Creating Animation Storage..."),Qt.set(0),or.set(e.length+e.reduce((r,a)=>r+a.frames.length,0));let t=[],i=new Kl(16);for(let r of e){Wn.set(`Creating Animation Storage for '${r.safe_name}'`);let a=new Ze,o=s(()=>{let l=`data modify storage aj.${Project.animated_java.export_namespace}:animations ${r.safe_name} merge value ${a.toString()}`;t.push(l),a=new Ze},"addFrameDataCommand");for(let l=0;l1e6&&o(),Qt.set(Qt.get()+1),await i.sync()}o(),Qt.set(Qt.get()+1),await i.sync()}return t}s(G9,"createAnimationStorage");function J9(n){let e=new Ze,t=new Ze,i=new Ze;e.set("data_data",new at(""));for(let r of Object.values(n.nodes))switch(r.type){case"locator":case"camera":{let a=new Ze().set("posx",new wt(r.default_transform.pos[0])).set("posy",new wt(r.default_transform.pos[1])).set("posz",new wt(r.default_transform.pos[2])).set("rotx",new wt(Math.radToDeg(r.default_transform.rot[0]))).set("roty",new wt(Math.radToDeg(r.default_transform.rot[1])));r.type==="locator"&&r.config.use_entity&&a.set("uuid",new at("")),(r.type==="camera"?i:t).set(r.safe_name,a);break}case"bone":case"text_display":case"item_display":case"block_display":{e.set(r.type+"_"+r.safe_name,new at(""));break}}return{locators:t,cameras:i,bones:e}}s(J9,"createPassengerStorage");function H9(n,e){return n.type==="locator"&&e.type!=="locator"?1:n.type!=="locator"&&e.type==="locator"?-1:0}s(H9,"nodeSorter");async function nd(n){console.time("Data Pack Compilation took");let{rig:e,animations:t,rigHash:i,animationHash:r}=n,a=Project.animated_java;console.log("Compiling Data Pack...",n);let o=new Kr("src/",{libDir:null,generatedDirName:"zzz",internalScoreboardName:"aj.i",eqVarScoreboardName:null,eqConstScoreboardName:null,header:"# This file was generated by Animated Java via MC-Build. It is not recommended to edit this file directly.",ioThreadCount:null,dontEmitComments:!0,setup:null,formatVersion:1/0}),l=null;if(a.data_pack_export_mode==="raw"){l=new td(PathModule.join(n.dataPackFolder,"data.ajmeta"),a.export_namespace,Project.last_used_export_namespace,n.dataPackFolder),l.read(),Wn.set("Removing Old Data Pack Files..."),Qt.set(0),or.set(l.oldFiles.size);let p=new Set;for(let f of l.oldFiles){if(!zf(f))fs.existsSync(f)&&await fs.promises.unlink(f);else if(a.export_namespace!==Project.last_used_export_namespace&&gc(f).resourceLocation.startsWith(`animated_java:${Project.last_used_export_namespace}/`)&&fs.existsSync(f)){let g=t0(f,Project.last_used_export_namespace,a.export_namespace);await fs.promises.mkdir(PathModule.dirname(g),{recursive:!0}),await fs.promises.copyFile(f,g),await fs.promises.unlink(f)}let _=PathModule.dirname(f);for(;!p.has(_)&&fs.existsSync(_)&&(await fs.promises.readdir(_)).length===0;)await fs.promises.rm(_,{recursive:!0}),p.add(_),_=PathModule.dirname(_);Qt.set(Qt.get()+1)}}let c=new Map;function u(){let p=new dr;return p.write=(f,_)=>{let v=PathModule.join(n.dataPackFolder,f);c.set(v,_),l&&l.files.add(v)},p}s(u,"createSyncIO"),o.io=u(),o.disableRequire=!0,o.templateParsingEnabled=!1;let d={export_namespace:a.export_namespace,interpolation_duration:a.interpolation_duration,teleportation_duration:a.teleportation_duration,display_item:a.display_item,rig:e,animations:t,export_version:Math.random().toString().substring(2,10),root_entity_passengers:await U9(e,i),TAGS:Ln,OBJECTIVES:ql,TELLRAW:Y1,custom_summon_commands:a.summon_commands,matrixToNbtFloatArray:vm,transformationToNbt:e0,use_storage_for_animation:a.use_storage_for_animation,animationStorage:a.use_storage_for_animation?await G9(e,t):null,rigHash:i,animationHash:r,boundingBox:a.bounding_box,BoneConfig:Pe,roundTo:og,nodeSorter:H9,getRotationFromQuaternion:hc};console.log("Compiler Variables:",d),Wn.set("Compiling Data Pack..."),Qt.set(0),await new Promise(p=>(0,X1.setTimeout)(p,2e3/framespersecond)),console.time("MC-Build Compiler took");let m=Yn.tokenize(Z1,"src/animated_java.mcb");if(o.addFile("src/animated_java.mcb",qt.parseMcbFile(m)),o.compile(en.fromObject(d)),console.timeEnd("MC-Build Compiler took"),Wn.set("Writing Data Pack..."),a.data_pack_export_mode==="raw")console.time("Writing Files took"),await K9(c,n.dataPackFolder),console.timeEnd("Writing Files took"),l.write();else if(a.data_pack_export_mode==="zip"){c.set(PathModule.join(n.dataPackFolder,"pack.mcmeta"),autoStringify({pack:{pack_format:48,description:`${Project.name}. Generated with Animated Java`}}));let p=n.dataPackFolder+(n.dataPackFolder.endsWith(".zip")?"":".zip");console.time("Writing Zip took"),await $9(c,p),console.timeEnd("Writing Zip took")}console.timeEnd("Data Pack Compilation took")}s(nd,"compileDataPack");async function $9(n,e){let t={};for(let[r,a]of n){let o=PathModule.relative(e,r);typeof a=="string"?t[o]=Buffer.from(a):t[o]=a}let i=await pu(t,{});await fs.promises.writeFile(e,i)}s($9,"writeZip");async function K9(n,e){Qt.set(0),or.set(n.size);let t=Project.animated_java,i=new Set;async function r(l,c){if(zf(l)&&fs.existsSync(l)){let d=JSON.parse(fs.readFileSync(l,"utf-8")),m=JSON.parse(c),p=rg(d,m);t.export_namespace!==Project.last_used_export_namespace&&(p.values=p.values.filter(f=>{let _=typeof f=="string"?f:f.id;return!_.startsWith(`#animated_java:${Project.last_used_export_namespace}/`)||_.startsWith(`animated_java:${Project.last_used_export_namespace}/`)})),p.values=p.values.filter(f=>{let _=typeof f=="string"?f:f.id,v=_.startsWith("#"),g=wo(v?_.substring(1):_),h=PathModule.join(e,"data",g.namespace,v?"tags/function":"function",g.path+(v?".json":".mcfunction")),b=n.has(h)||fs.existsSync(h);if(!b){let x=gc(l);console.warn(`The referenced ${v?"tag":"function"} '${_}' in '${x?.resourceLocation||l}' does not exist! Removing reference...`)}return b}),c=JSON.stringify(p)}let u=PathModule.dirname(l);i.has(u)||(await fs.promises.mkdir(u,{recursive:!0}),i.add(u)),await fs.promises.writeFile(l,c),Qt.set(Qt.get()+1)}s(r,"writeFile");let a=8,o=new Map;for(let[l,c]of n)o.set(l,r(l,c).finally(()=>{o.delete(l)})),o.size>=a&&await Promise.any(o);await Promise.all(o.values())}s(K9,"writeFiles");function Ap(n,e,t){n[t]=n[e],delete n[e]}s(Ap,"transferKey");function q9(n){let e={time:n.time,channel:n.channel,commands:qa(n),variant:Qo(n),execute_condition:ma(n),repeat:es(n),repeat_frequency:ts(n)};switch(e.channel){case"variant":case"commands":break;default:e.value=[n.get("x",0).toString(),n.get("y",0).toString(),n.get("z",0).toString()],e.interpolation={type:n.interpolation}}if(e.interpolation)switch(e.interpolation.type){case"linear":{e.interpolation.easing=n.easing,n.easingArgs?.length&&(e.interpolation.easingArgs=n.easingArgs);break}case"bezier":{e.interpolation.bezier_linked=n.bezier_linked,e.interpolation.bezier_left_time=n.bezier_left_time.slice(),e.interpolation.bezier_left_value=n.bezier_left_value.slice(),e.interpolation.bezier_right_time=n.bezier_right_time.slice(),e.interpolation.bezier_right_value=n.bezier_right_value.slice();break}case"catmullrom":break;case"step":break}return n.data_points.length===2&&(e.post=[n.get("x",1).toString(),n.get("y",1).toString(),n.get("z",1).toString()]),e}s(q9,"serailizeKeyframe");function W9(n){return{...n,models:Ls(n.models,(t,i)=>{let r={model:i.model,custom_model_data:i.custom_model_data};return[t,r]})}}s(W9,"serializeVariant");function Q1(n){let e=Project.animated_java,{rig:t,animations:i}=n;console.log("Exporting JSON...",n);function r(l,c){return{name:c.name,id:l,src:c.getDataURL()}}s(r,"serializeTexture");let a={settings:{export_namespace:e.export_namespace,bounding_box:e.bounding_box,display_item:n.displayItemPath,custom_model_data_offset:e.custom_model_data_offset,baked_animations:e.baked_animations},textures:Ls(t.textures,(l,c)=>[c.uuid,r(l,c)]),nodes:Ls(t.nodes,(l,c)=>[l,Z9(c)]),variants:Ls(t.variants,(l,c)=>[l,W9(c)]),animations:{}};if(e.baked_animations)for(let l of i)a.animations[l.uuid]=X9(l);else for(let l of Blockbench.Animation.all){let c={name:l.name,loop_mode:l.loop,duration:l.length,excluded_nodes:l.excluded_nodes.map(u=>u.value),animators:{}};for(let[u,d]of Object.entries(l.animators))d.keyframes.length!==0&&(c.animators[u]=d.keyframes.map(q9));a.animations[l.uuid]=c}if(console.log("Exported JSON:",a),cg(a))throw new Error("Circular references detected in exported JSON.");console.log("Scrubbed:",lf(a));let o;try{o=Li(e.json_file)}catch(l){console.log(`Failed to resolve export path '${e.json_file}'`),console.error(l);return}fs.writeFileSync(o,compileJSON(a).toString())}s(Q1,"exportJSON");function e3(n){return{matrix:n.matrix.elements,decomposed:{translation:n.decomposed.translation.toArray(),left_rotation:n.decomposed.left_rotation.toArray(),scale:n.decomposed.scale.toArray()},pos:n.pos,rot:n.rot,head_rot:n.head_rot,scale:n.scale,interpolation:n.interpolation,commands:n.commands,execute_condition:n.execute_condition}}s(e3,"serailizeNodeTransform");function Z9(n){let e={...n};switch(delete e.node,delete e.parentNode,delete e.model,Ap(e,"lineWidth","line_width"),Ap(e,"backgroundColor","background_color"),Ap(e,"backgroundAlpha","background_alpha"),e.default_transform=e3(e.default_transform),n.type){case"bone":{delete e.boundingBox,e.bounding_box={min:n.bounding_box.min.toArray(),max:n.bounding_box.max.toArray()},delete e.configs,e.configs={...n.configs.variants};let t=Se.getDefault();n.configs.default&&t&&(e.configs[t.uuid]=n.configs.default);break}case"text_display":{e.text=n.text?.toJSON();break}}return e}s(Z9,"serailizeRenderedNode");function X9(n){let e={name:n.name,safe_name:n.safe_name,duration:n.duration,loop_delay:n.loop_delay,loop_mode:n.loop_mode,frames:[],modified_nodes:Object.keys(n.modified_nodes)},t=[];for(let i of n.frames){let r={};for(let[a,o]of Object.entries(i.node_transforms))r[a]=e3(o);t.push({...i,node_transforms:r})}return e.frames=t,e}s(X9,"serializeAnimation");var id=class{lastOverrideId=1;overrides=new Map;externalOverrides=new Map;rigs={};parent="item/generated";textures={};setOverride(e,t){this.overrides.set(e,t)}addOverride(e){let t=this.lastOverrideId;for(;this.overrides.has(t)||this.externalOverrides.has(t);)t++;return this.lastOverrideId=t,this.overrides.set(t,e),t}assertOverride(e,t){this.overrides.has(e)||this.externalOverrides.has(e)||this.setOverride(e,t)}readExisting(e){let t=Project.animated_java,i;try{i=JSON.parse(fs.readFileSync(e,"utf-8"))}catch(r){console.error("Failed to read existing display item model:",r);return}if(i.animated_java,i.parent&&(this.parent=i.parent),i.textures&&(this.textures=i.textures),i.overrides??=[],i.animated_java??={},typeof i.animated_java.rigs=="object"&&!Array.isArray(i.animated_java.rigs)){let r=i.animated_java.rigs;i.animated_java={};for(let a of Object.keys(r))i.animated_java[a]=r[a].used_ids}i.animated_java[t.export_namespace]??=[];for(let[r,a]of Object.entries(i.animated_java)){let o=t.export_namespace,l=Project.last_used_export_namespace;if(r===o||r===l){i.overrides=i.overrides.filter(c=>!a.includes(c.predicate.custom_model_data)),r===l&&o!==l&&delete i.animated_java[l];continue}else for(let c of a){let u=i.overrides.find(d=>d.predicate.custom_model_data===c);this.externalOverrides.set(c,u.model)}this.rigs[r]=a}}toJSON(){let[e,t]=Project.animated_java.display_item.split(":"),i=Project.animated_java.export_namespace;return{parent:this.parent,textures:Object.keys(this.textures).length>0?this.textures:{layer0:`${e}:item/${t}`},overrides:[...this.externalOverrides.entries(),...this.overrides.entries()].sort((r,a)=>r[0]-a[0]).map(([r,a])=>({predicate:{custom_model_data:r},model:a})),animated_java:El({...this.rigs,[i]:[...this.overrides.keys()]})}}};s(id,"PredicateItemModel");var rd=class{constructor(e,t,i,r){this.path=e;this.exportNamespace=t;this.lastUsedExportNamespace=i;this.resourcePackFolder=r}files=new Set;oldFiles=new Set;oldContent={};read(){if(!fs.existsSync(this.path))return;this.oldContent=JSON.parse(fs.readFileSync(this.path,"utf-8"));let e=this.oldContent[this.exportNamespace],t=this.oldContent[this.lastUsedExportNamespace];if(t){Array.isArray(t.files)||(t.files=[]);for(let i of t.files)this.oldFiles.add(PathModule.join(this.resourcePackFolder,i));delete this.oldContent[this.lastUsedExportNamespace]}if(e){Array.isArray(e.files)||(e.files=[]);for(let i of e.files)this.oldFiles.add(PathModule.join(this.resourcePackFolder,i));delete this.oldContent[this.exportNamespace]}}write(){let e=PathModule.dirname(this.path),t={...this.oldContent,[this.exportNamespace]:{files:Array.from(this.files).map(i=>PathModule.relative(e,i).replace(/\\/g,"/"))}};fs.writeFileSync(this.path,autoStringify(El(t)))}};s(rd,"ResourcePackAJMeta");async function ad(n){let{rig:e,displayItemPath:t,resourcePackFolder:i,textureExportFolder:r,modelExportFolder:a}=n,o=Project.animated_java,l=Project.last_used_export_namespace;Wn.set("Compiling Resource Pack..."),console.log("Compiling resource pack...",n);let c=new rd(PathModule.join(n.resourcePackFolder,"assets.ajmeta"),o.export_namespace,l,n.resourcePackFolder);if(o.resource_pack_export_mode==="raw"){c.read(),Wn.set("Removing Old Resource Pack Files..."),Qt.set(0),or.set(c.oldFiles.size);let p=new Set;for(let f of c.oldFiles){fs.existsSync(f)&&await fs.promises.unlink(f);let _=PathModule.dirname(f);for(;!p.has(_)&&fs.existsSync(_)&&(await fs.promises.readdir(_)).length===0;)await fs.promises.rm(_,{recursive:!0}),p.add(_),_=PathModule.dirname(_);Qt.set(Qt.get()+1)}}let u=new Map;u.set(PathModule.join(i,"assets/animated_java/models/empty.json"),"{}");let d=new id;fs.existsSync(t)&&(console.warn("Display item already exists! Attempting to merge..."),d.readExisting(t)),d.lastOverrideId=Math.max(1,o.custom_model_data_offset),d.assertOverride(1,"animated_java:empty");for(let p of Object.values(e.textures)){let f,_,v;if(p.source?.startsWith("data:"))f=Buffer.from(p.source.split(",")[1],"base64");else if(p.path&&fs.existsSync(p.path)){if(_c(p.path))continue;{f=fs.readFileSync(p.path);let h=p.path+".mcmeta",b=p.path.replace(".png","_e.png");fs.existsSync(h)&&(_=fs.readFileSync(h)),fs.existsSync(b)&&(v=fs.readFileSync(b))}}if(f===void 0)throw new Error(`Texture ${p.name} is missing it's image data.`);let g=Rt(p.name);p.name.endsWith(".png")||(g+=".png"),u.set(PathModule.join(r,g),f),_!==void 0&&u.set(PathModule.join(r,g+".mcmeta"),_),v!==void 0&&u.set(PathModule.join(r,g+"_e.png"),v)}let m=PathModule.join(i,"assets/animated_java/textures/item/transparent.png");u.set(m,nativeImage.createFromDataURL(zn.source).toPNG());for(let p of Object.values(e.variants))for(let[f,_]of Object.entries(p.models)){let v=e.nodes[f];_.custom_model_data=d.addOverride(_.resource_location),u.set(PathModule.join(a,p.name,v.name+".json"),autoStringify(_.model))}if(o.enable_plugin_mode)console.log("Plugin mode enabled. Skipping resource pack export.");else if(o.resource_pack_export_mode==="raw"){c.files=new Set(u.keys()),c.write(),console.log("Display Item Model",d.toJSON()),u.set(t,autoStringify(d.toJSON())),Wn.set("Writing Resource Pack..."),Qt.set(0),or.set(u.size);let p=new Set;for(let[f,_]of u){let v=PathModule.dirname(f);p.has(v)||(await fs.promises.mkdir(v,{recursive:!0}),p.add(v)),await fs.promises.writeFile(f,_),Qt.set(Qt.get()+1)}}else if(o.resource_pack_export_mode==="zip"){u.set(PathModule.join(i,"pack.mcmeta"),autoStringify({pack:{pack_format:32,description:`${Project.name}. Generated with Animated Java`}})),Wn.set("Writing Resource Pack Zip...");let p={};for(let[_,v]of u){let g=PathModule.relative(i,_);typeof v=="string"?p[g]=Buffer.from(v):p[g]=v}let f=await pu(p,{});await fs.promises.writeFile(i+(i.endsWith(".zip")?"":".zip"),f)}console.log("Resource pack compiled!")}s(ad,"compileResourcePack");var t3=ui(rn("crypto"),1);function Y9(n,e,t){if(!n.export)return;let i={};if(i.from=n.from.slice(),i.to=n.to.slice(),n.inflate&&(i.from=i.from.map(r=>r-n.inflate),i.to=i.to.map(r=>r+n.inflate)),n.shade===!1&&(i.shade=!1),!(n.rotation.allEqual(0)&&n.origin.allEqual(0))){let r=n.rotationAxis()||"y";i.rotation={angle:n.rotation[getAxisNumber(r)],axis:r,origin:n.origin}}if(n.rescale&&(i.rotation?i.rotation.rescale=!0:i.rotation={angle:0,axis:n.rotation_axis||"y",origin:n.origin,rescale:!0}),n.parent instanceof Group){let r=n.parent;i.from=i.from.map((a,o)=>a-r.origin[o]),i.to=i.to.map((a,o)=>a-r.origin[o]),i.rotation&&!Array.isArray(i.rotation)&&(i.rotation.origin=i.rotation.origin.map((a,o)=>a-r.origin[o]))}i.faces={};for(let[r,a]of Object.entries(n.faces)){if(!a||!a.texture||a.getTexture()?.uuid===zn.uuid)continue;let o={};if(a.enabled&&(o.uv=a.uv.slice().map((l,c)=>l*16/UVEditor.getResolution(c%2))),a.rotation&&(o.rotation=a.rotation),a.texture){let l=a.getTexture();if(!l)throw new Error("Texture not found");o.texture="#"+l.id,e.textures[l.id]=l;let c=n3(l,e).resourceLocation;c&&(t.textures[l.id]=c)}a.cullface&&(o.cullface=a.cullface),a.tint>=0&&(o.tintindex=a.tint),i.faces[r]=o}Object.keys(i.faces).length!==0&&(t.elements??=[],t.elements.push(i))}s(Y9,"renderCube");var Wl=new Map;function n3(n,e){if(Wl.has(n.uuid))return Wl.get(n.uuid);if(n.name.endsWith(".png")||(n.name+=".png"),n.path&&fs.existsSync(n.path)&&fs.statSync(n.path).isFile()){let r=br(n.path);if(r)return Wl.set(n.uuid,r),r}let t=PathModule.join(e.texture_export_folder,Rt(n.name)),i=br(t);if(i)return Wl.set(n.uuid,i),i;throw console.error(n),new Error(`Invalid texture path: ${t}`)}s(n3,"getTextureResourceLocation");function Q9(n){let e=n.children.filter(i=>i instanceof Cube),t=new THREE.Box3;t.expandByPoint(new THREE.Vector3(n.origin[0],n.origin[1],n.origin[2]));for(let i of e)t.expandByPoint(new THREE.Vector3(i.from[0]-i.inflate,i.from[1]-i.inflate,i.from[2]-i.inflate)),t.expandByPoint(new THREE.Vector3(i.to[0]+i.inflate,i.to[1]+i.inflate,i.to[2]+i.inflate));return t}s(Q9,"getBoneBoundingBox");function i3(n,e,t){if(!n.export)return;let i=n.parent instanceof Group?n.parent.uuid:n.parent,r=PathModule.join(e.model_export_folder,n.name+".json"),a=br(r);if(!a)throw console.error(n),new Error(`Invalid bone path: ${n.name} -> ${r}`);let o={type:"bone",name:n.name,safe_name:Rt(n.name),uuid:n.uuid,parent:i,bounding_box:Q9(n),base_scale:1,configs:n.configs,default_transform:{}},l=t.models[n.uuid];l||(l=t.models[n.uuid]={model:{textures:{},display:{head:{rotation:[0,180,0]}}},custom_model_data:-1,model_path:r,resource_location:a.resourceLocation});for(let m of n.children)if(m.export)switch(!0){case m instanceof Group:{i3(m,e,t);break}case m instanceof Locator:{s3(m,e);break}case m instanceof Je:{o3(m,e);break}case(OutlinerElement.types.camera&&m instanceof OutlinerElement.types.camera):{l3(m,e);break}case m instanceof gt:{r3(m,e);break}case m instanceof ft:{a3(m,e);break}case m instanceof Cube:{Y9(m,e,l.model),e.includes_custom_models=!0;break}default:console.warn("Encountered unknown node type:",m)}if(!l.model.elements||l.model.elements.length===0){delete t.models[n.uuid];let m={type:"struct",name:n.name,safe_name:o.safe_name,uuid:n.uuid,parent:i,default_transform:{}};e.nodes[n.uuid]=m;return}let c=new THREE.Vector3().subVectors(o.bounding_box.max,o.bounding_box.min),u=Math.max(c.x,c.y,c.z),d=Math.min(1,24/u);for(let m of l.model.elements)m.from=m.from.map(p=>p*d+8),m.to=m.to.map(p=>p*d+8),m.rotation&&!Array.isArray(m.rotation)&&(m.rotation.origin=m.rotation.origin.map(p=>p*d+8));o.base_scale=1/d,e.nodes[n.uuid]=o}s(i3,"renderGroup");function r3(n,e){if(!n.export)return;let t=n.parent instanceof Group?n.parent.uuid:n.parent,i=PathModule.join(e.model_export_folder,n.name+".json");if(!br(i))throw console.error(n),new Error(`Invalid bone path: ${n.name} -> ${i}`);let a={type:"item_display",name:n.name,safe_name:Rt(n.name),uuid:n.uuid,parent:t,item:n.item,base_scale:1,config:n.config,default_transform:{}};e.nodes[n.uuid]=a}s(r3,"renderItemDisplay");function a3(n,e){if(!n.export)return;let t=n.parent instanceof Group?n.parent.uuid:n.parent,i=PathModule.join(e.model_export_folder,n.name+".json");if(!br(i))throw console.error(n),new Error(`Invalid bone path: ${n.name} -> ${i}`);let a={type:"block_display",name:n.name,safe_name:Rt(n.name),uuid:n.uuid,block:n.block,parent:t,base_scale:1,config:n.config,default_transform:{}};e.nodes[n.uuid]=a}s(a3,"renderBlockDisplay");function o3(n,e){if(!n.export)return;let t=n.parent instanceof Group?n.parent.uuid:n.parent,i=PathModule.join(e.model_export_folder,n.name+".json");if(!br(i))throw console.error(n),new Error(`Invalid bone path: ${n.name} -> ${i}`);let a={type:"text_display",name:n.name,safe_name:Rt(n.name),uuid:n.uuid,parent:t,text:ln.fromString(n.text),line_width:n.lineWidth,background_color:n.backgroundColor,background_alpha:n.backgroundAlpha,align:n.align,shadow:n.shadow,see_through:n.seeThrough,base_scale:1,config:n.config,default_transform:{}};return e.nodes[n.uuid]=a,{uuid:n.uuid,children:[]}}s(o3,"renderTextDisplay");function s3(n,e){if(!n.export)return;let t=n.parent instanceof Group?n.parent.uuid:n.parent,i={type:"locator",name:n.name,safe_name:Rt(n.name),uuid:n.uuid,parent:t,config:n.config,default_transform:{}};e.nodes[n.uuid]=i}s(s3,"renderLocator");function l3(n,e){if(!n.export)return;let t=n.parent instanceof Group?n.parent.uuid:n.parent,i={type:"camera",name:n.name,safe_name:Rt(n.name),uuid:n.uuid,parent:t,config:n.config,default_transform:{}};e.nodes[n.uuid]=i}s(l3,"renderCamera");function ez(n,e){let t={};for(let[i,r]of Object.entries(e.nodes)){if(r.type!=="bone"||n.excludedNodes.find(d=>d.value===i))continue;let a={};for(let[d,m]of n.textureMap.map.entries()){let p=Texture.all.find(f=>f.uuid===d);if(!p)throw new Error(`From texture not found: ${d}`);if(m===zn.uuid)a[p.id]=fg,e.textures[zn.id]=zn;else{let f=Texture.all.find(_=>_.uuid===m);if(!f)throw new Error(`To texture not found: ${m}`);a[p.id]=n3(f,e).resourceLocation,e.textures[f.id]=f}}if(Object.keys(a).length===0)continue;let o=PathModule.join(e.model_export_folder,r.name),l=br(o);if(!l)throw new Error(`Invalid Bone Name: '${r.name}' -> '${o}'`);let c=PathModule.join(o,n.name+".json"),u=br(c);if(!u)throw new Error(`Invalid Variant Name: '${n.name}' -> '${c}'`);t[i]={model:{parent:l.resourceLocation,textures:a},custom_model_data:-1,model_path:c,resource_location:u.resourceLocation}}return t}s(ez,"renderVariantModels");function c3(n){let e=t3.createHash("sha256");for(let[t,i]of Object.entries(n.nodes))switch(e.update("node;"),e.update(t),e.update(i.name),e.update(i.default_transform.matrix.elements.toString()),i.type){case"bone":{let r=n.variants[Se.getDefault().uuid].models[t];if(e.update(";"+JSON.stringify(r)||""),i.configs.default){let a=Pe.fromJSON(i.configs.default);a.isDefault()||(e.update("defaultconfig;"),e.update(a.toNBT().toString()))}for(let[a,o]of Object.entries(i.configs.variants)){let l=Pe.fromJSON(o);l.isDefault()||(e.update("variantconfig;"),e.update(a),e.update(l.toNBT().toString()))}break}case"locator":{i.config&&e.update(";"+JSON.stringify(i.config));break}case"camera":{i.config&&e.update(";"+JSON.stringify(i.config));break}case"text_display":{e.update(`;${i.text?.toString()}`),i.config&&e.update(";"+JSON.stringify(i.config));break}}return e.digest("hex")}s(c3,"hashRig");function tz(n,e){return{...n.toJSON(),models:ez(n,e)}}s(tz,"renderVariant");function nz(n){let e=new Blockbench.Animation;Pm(),Um(e,0);let t=zm(e,n.nodes).node_transforms;return Vm(),t}s(nz,"getDefaultTransforms");function u3(n,e){console.time("Rendering rig took"),Texture.all.forEach((a,o)=>a.id=String(o)),Animator.showDefaultPose();let t={nodes:{},variants:{},textures:{},model_export_folder:n,texture_export_folder:e,includes_custom_models:!1},i=Se.getDefault();t.variants[i.uuid]={...i.toJSON(),models:{}};for(let a of Outliner.root)switch(!0){case a instanceof Group:{i3(a,t,t.variants[i.uuid]);break}case a instanceof Locator:{s3(a,t);break}case a instanceof Je:{o3(a,t);break}case(OutlinerElement.types.camera&&a instanceof OutlinerElement.types.camera):{l3(a,t);break}case a instanceof gt:{r3(a,t);break}case a instanceof ft:{a3(a,t);break}case a instanceof Cube:throw new hs(`Cubes cannot be exported as root nodes. Please parent them to a bone. (Found '${a.name}' outside of a bone)`);default:console.warn("Encountered unknown node type:",a)}let r=nz(t);for(let[a,o]of Object.entries(t.nodes))o.default_transform=r[a];for(let a of Se.all)a.isDefault||(t.variants[a.uuid]=tz(a,t));return Wl.clear(),console.timeEnd("Rendering rig took"),console.log("Rendered rig:",t),t}s(u3,"renderRig");var hs=class extends Error{};s(hs,"IntentionalExportError");async function iz(n=!0){let e=Project.animated_java,t=Fu();await new Promise(r=>requestAnimationFrame(r));let i=Se.selected;Se.getDefault().select();try{console.time("Exporting project took");let r,a,o,l=Li(e.resource_pack),c=Li(e.data_pack);e.enable_plugin_mode?(a=PathModule.join("assets/animated_java/models/item/",e.export_namespace),r=PathModule.join("assets/animated_java/textures/item/",e.export_namespace),o=PathModule.join("assets/minecraft/models/item/",e.display_item.split(":").at(-1)+".json")):e.enable_advanced_resource_pack_settings?(a=e.model_folder,r=e.texture_folder,o=e.display_item_path):(a=PathModule.join(l,"assets/animated_java/models/item/",e.export_namespace),r=PathModule.join(l,"assets/animated_java/textures/item/",e.export_namespace),o=PathModule.join(l,"assets/minecraft/models/item/",e.display_item.split(":").at(-1)+".json")),Wn.set("Rendering Rig...");let u=u3(a,r);if(Project.animated_java.resource_pack_export_mode==="none"&&u.includes_custom_models){Blockbench.showMessageBox({title:w("misc.failed_to_export.title"),message:w("misc.failed_to_export.custom_models.message"),buttons:[w("misc.failed_to_export.button")]}),t.close(0);return}Wn.set("Rendering Animations...");let d=tv(Project,u);Wn.set("Hashing Rendered Objects...");let m=c3(u),p=ev(d);await ad({rig:u,displayItemPath:o,resourcePackFolder:l,textureExportFolder:r,modelExportFolder:a}),e.enable_plugin_mode?Q1({rig:u,animations:d,displayItemPath:o,textureExportFolder:r,modelExportFolder:a}):(e.data_pack_export_mode!=="none"&&await nd({rig:u,animations:d,dataPackFolder:c,rigHash:m,animationHash:p}),Project.last_used_export_namespace=e.export_namespace),console.timeEnd("Exporting project took"),n&&Fc(),Blockbench.showQuickMessage("Project exported successfully!",2e3)}catch(r){if(console.error(r),r instanceof hs){Blockbench.showMessageBox({title:w("misc.failed_to_export.title"),message:r.message,buttons:[w("misc.failed_to_export.button")]});return}sa(r)}finally{i?.select(),t.close(0)}}s(iz,"actuallyExportProject");async function od(n=!0){if(!Project)return;Rr.set({});let e=Xo();if(await new Promise(t=>requestAnimationFrame(t)),console.log("Blueprint Setting Errors",Rr.get()),Object.keys(Rr.get()).length>0){Blockbench.showMessageBox({title:w("misc.failed_to_export.title"),message:w("misc.failed_to_export.blueprint_settings.message")+` +`;var Dy=Rt("timers");var tc=class{constructor(e){this.limit=e;this.lastTime=performance.now()}lastTime;async sync(){return performance.now()-this.lastTime>=this.limit?(await new Promise(i=>requestAnimationFrame(i)),this.lastTime=performance.now(),!0):!1}};s(tc,"MSLimiter");var AG=["bone","text_display","item_display","block_display"],Un;(b=>(b.NEW=s(()=>"aj.new","NEW"),b.GLOBAL_RIG=s(()=>"aj.rig_entity","GLOBAL_RIG"),b.TRANSFORMS_ONLY=s(()=>"aj.transforms_only","TRANSFORMS_ONLY"),b.GLOBAL_ROOT=s(()=>"aj.rig_root","GLOBAL_ROOT"),b.PROJECT_ROOT=s(x=>`aj.${x}.root`,"PROJECT_ROOT"),b.OUTDATED_RIG_TEXT_DISPLAY=s(()=>"aj.outdated_rig_text_display","OUTDATED_RIG_TEXT_DISPLAY"),b.GLOBAL_BONE=s(()=>"aj.bone","GLOBAL_BONE"),b.GLOBAL_CAMERA=s(()=>"aj.camera","GLOBAL_CAMERA"),b.GLOBAL_LOCATOR=s(()=>"aj.locator","GLOBAL_LOCATOR"),b.GLOBAL_DATA=s(()=>"aj.data","GLOBAL_DATA"),b.PROJECT_BONE=s(x=>`aj.${x}.bone`,"PROJECT_BONE"),b.PROJECT_CAMERA=s(x=>`aj.${x}.camera`,"PROJECT_CAMERA"),b.PROJECT_LOCATOR=s(x=>`aj.${x}.locator`,"PROJECT_LOCATOR"),b.PROJECT_DATA=s(x=>`aj.${x}.data`,"PROJECT_DATA"),b.LOCAL_BONE=s((x,E)=>`aj.${x}.bone.${E}`,"LOCAL_BONE"),b.LOCAL_CAMERA=s((x,E)=>`aj.${x}.camera.${E}`,"LOCAL_CAMERA"),b.LOCAL_LOCATOR=s((x,E)=>`aj.${x}.locator.${E}`,"LOCAL_LOCATOR"),b.ANIMATION_PLAYING=s((x,E)=>`aj.${x}.animation.${E}.playing`,"ANIMATION_PLAYING"),b.TWEENING=s((x,E)=>`aj.${x}.animation.${E}.tween_playing`,"TWEENING"),b.VARIANT_APPLIED=s((x,E)=>`aj.${x}.variant.${E}.applied`,"VARIANT_APPLIED")))(Un||={});var nc;(a=>(a.I=s(()=>"aj.i","I"),a.ID=s(()=>"aj.id","ID"),a.FRAME=s(o=>`aj.${o}.frame`,"FRAME"),a.IS_RIG_LOADED=s(()=>"aj.is_rig_loaded","IS_RIG_LOADED"),a.TWEEN_DURATION=s(()=>"aj.tween_duration","TWEEN_DURATION")))(nc||={});var co=new $t([{text:"[",color:"gray"},{text:"AJ",color:"aqua"},{text:"] "}]),My;(u=>(u.RIG_OUTDATED=s(c=>new $t(["",co,{text:"Error: ",color:"red"},{text:"The ",color:"red"},{text:c,color:"yellow"},{text:" rig instance at",color:"red"},[{text:" [",color:"yellow"},{score:{name:"#this.x",objective:nc.I()}},", ",{score:{name:"#this.y",objective:nc.I()}},", ",{score:{name:"#this.z",objective:nc.I()}},"]"],{text:" is outdated! It will not function correctly and should be removed or re-summoned.",color:"red"},` + `,{text:"[Click Here to Teleport to the Rig Instance]",clickEvent:{action:"suggest_command",value:"/tp @s $(x) $(y) $(z)"},color:"aqua",underlined:!0}]),"RIG_OUTDATED"),u.RIG_OUTDATED_TEXT_DISPLAY=s(()=>new $t(["",{text:"This rig instance is outdated!\\nIt will not function correctly and should be removed or re-summoned.",color:"red"}]),"RIG_OUTDATED_TEXT_DISPLAY"),u.FUNCTION_NOT_EXECUTED_AS_ROOT_ERROR=s((c,d)=>new $t(["",co,{text:"Error: ",color:"red"},{text:"The function ",color:"red"},{text:c,color:"yellow"},{text:" must be executed as the root entity.",color:"red"},{text:` + You can use `,color:"red"},{text:`execute as @e[tag=${d}] run ...`,color:"aqua"},{text:" to run the function as the root.",color:"red"}]),"FUNCTION_NOT_EXECUTED_AS_ROOT_ERROR"),u.VARIANT_CANNOT_BE_EMPTY=s(()=>new $t(["",co,{text:"Error: ",color:"red"},{text:"variant",color:"yellow"},{text:" cannot be an empty string.",color:"red"}]),"VARIANT_CANNOT_BE_EMPTY"),u.INVALID_VARIANT=s((c,d)=>new $t(["",co,{text:"Error: ",color:"red"},{text:"The variant ",color:"red"},{text:c,color:"yellow"},{text:" does not exist.",color:"red"},` + `,{text:" \u2261 ",color:"white"},{text:"Available Variants:",color:"green"},...Object.values(d).map(m=>new $t([` + `," "," ",{text:" \u25CF ",color:"gray"},{text:m.name,color:"yellow"}]))]),"INVALID_VARIANT"),u.ANIMATION_CANNOT_BE_EMPTY=s(()=>new $t(["",co,{text:"Error: ",color:"red"},{text:"animation",color:"yellow"},{text:" cannot be an empty string.",color:"red"}]),"ANIMATION_CANNOT_BE_EMPTY"),u.FRAME_CANNOT_BE_NEGATIVE=s(()=>new $t(["",co,{text:"Error: ",color:"red"},{text:"frame",color:"yellow"},{text:" must be a non-negative integer.",color:"red"}]),"FRAME_CANNOT_BE_NEGATIVE"),u.INVALID_ANIMATION=s((c,d)=>new $t(["",co,{text:"Error: ",color:"red"},{text:"The animation ",color:"red"},{text:c,color:"yellow"},{text:" does not exist.",color:"red"},` + `,{text:" \u2261 ",color:"white"},{text:"Available Animations:",color:"green"},...d.map(m=>new $t([` + `," "," ",{text:" \u25CF ",color:"gray"},{text:m.safe_name,color:"yellow"}]))]),"INVALID_ANIMATION")))(My||={});async function SG(n,e){let t=Project.animated_java,i=new En,{locators:r,cameras:a,bones:o}=IG(n);i.add(new Ye().set("id",new ct("minecraft:marker")).set("Tags",new En([new ct(Un.GLOBAL_RIG()),new ct(Un.GLOBAL_DATA()),new ct(Un.PROJECT_DATA(t.export_namespace))])).set("data",new Ye().set("rigHash",new ct(e)).set("locators",r).set("cameras",a).set("bones",o)));for(let[l,u]of Object.entries(n.nodes)){let c=new Ye,d=!0,m=new En([new ct(Un.GLOBAL_RIG())]);switch(c.set("Tags",m),u.type){case"bone":{c.set("id",new ct("minecraft:item_display")),m.add(new ct(Un.GLOBAL_BONE())),m.add(new ct(Un.PROJECT_BONE(t.export_namespace))),m.add(new ct(Un.LOCAL_BONE(t.export_namespace,u.safe_name))),c.set("transformation",new Ye().set("translation",Ii([0,0,0])).set("left_rotation",Ii([0,0,0,1])).set("right_rotation",Ii([0,0,0,1])).set("scale",Ii([0,0,0]))),c.set("interpolation_duration",new Qt(t.interpolation_duration)),c.set("teleport_duration",new Qt(0)),c.set("item_display",new ct("head"));let p=new Ye,f=n.variants[Ne.getDefault().uuid].models[l];if(!f)throw new Error(`Model for bone '${u.safe_name}' not found!`);c.set("item",p.set("id",new ct(t.display_item)).set(d?"count":"Count",new Qt(1)).set(d?"components":"tag",new Ye().set(d?"minecraft:custom_model_data":"CustomModelData",new Qt(f.custom_model_data)))),u.configs.default&&Te.fromJSON(u.configs.default).toNBT(c),c.set("height",new At(t.bounding_box[1])),c.set("width",new At(t.bounding_box[0]));break}case"text_display":{c.set("id",new ct("minecraft:text_display")),m.add(new ct(Un.GLOBAL_BONE())),m.add(new ct(Un.PROJECT_BONE(t.export_namespace))),m.add(new ct(Un.LOCAL_BONE(t.export_namespace,u.safe_name))),c.set("transformation",new Ye().set("translation",Ii([0,0,0])).set("left_rotation",Ii([0,0,0,1])).set("right_rotation",Ii([0,0,0,1])).set("scale",Ii([0,0,0]))),c.set("interpolation_duration",new Qt(t.interpolation_duration)),c.set("teleport_duration",new Qt(0)),c.set("height",new At(t.bounding_box[1])),c.set("width",new At(t.bounding_box[0])),c.set("text",new ct(u.text?u.text.toString():'"Invalid Text Component"'));let p=new tinycolor(u.background_color+Oo(u.background_alpha));c.set("background",new Qt(Eg(p))),c.set("line_width",new Qt(u.line_width)),c.set("shadow",new Dn(u.shadow?1:0)),c.set("see_through",new Dn(u.see_through?1:0)),u.config&&Tn.fromJSON(u.config).toNBT(c);break}case"item_display":{c.set("id",new ct("minecraft:item_display")),m.add(new ct(Un.GLOBAL_BONE())),m.add(new ct(Un.PROJECT_BONE(t.export_namespace))),m.add(new ct(Un.LOCAL_BONE(t.export_namespace,u.safe_name))),c.set("item",new Ye().set("id",new ct(u.item)).set("count",new Qt(1))),u.config&&Te.fromJSON(u.config).toNBT(c);break}case"block_display":{c.set("id",new ct("minecraft:block_display")),m.add(new ct(Un.GLOBAL_BONE())),m.add(new ct(Un.PROJECT_BONE(t.export_namespace))),m.add(new ct(Un.LOCAL_BONE(t.export_namespace,u.safe_name)));let p=await Io(u.block);if(!p)throw new Error(`Invalid Blockstate '${u.block}' in node '${u.safe_name}'!`);let f=new Ye;for(let[_,g]of Object.entries(p.states))f.set(_,new ct(g.toString()));c.set("block_state",new Ye().set("Name",new ct(p.resource.name)).set("Properties",f)),u.config&&Te.fromJSON(u.config).toNBT(c);break}}i.add(c)}return i.toString()}s(SG,"generateRootEntityPassengers");var pd=class{constructor(e,t,i,r){this.path=e;this.exportNamespace=t;this.lastUsedExportNamespace=i;this.dataPackFolder=r}files=new Set;oldFiles=new Set;oldContent={};read(){if(!fs.existsSync(this.path))return;this.oldContent=JSON.parse(fs.readFileSync(this.path,"utf-8"));let e=this.oldContent[this.exportNamespace],t=this.oldContent[this.lastUsedExportNamespace];if(t){Array.isArray(t.files)||(t.files=[]);for(let i of t.files)this.oldFiles.add(PathModule.join(this.dataPackFolder,i));delete this.oldContent[this.lastUsedExportNamespace]}if(e){Array.isArray(e.files)||(e.files=[]);for(let i of e.files)this.oldFiles.add(PathModule.join(this.dataPackFolder,i));delete this.oldContent[this.exportNamespace]}}write(){let e=PathModule.dirname(this.path),t={...this.oldContent,[this.exportNamespace]:{files:Array.from(this.files).map(i=>PathModule.relative(e,i).replace(/\\/g,"/"))}};fs.writeFileSync(this.path,autoStringify(hl(t)))}};s(pd,"DataPackAJMeta");async function jG(n,e){Qn.set("Creating Animation Storage..."),ln.set(0),mr.set(e.length+e.reduce((r,a)=>r+a.frames.length,0));let t=[],i=new tc(16);for(let r of e){Qn.set(`Creating Animation Storage for '${r.safe_name}'`);let a=new Ye,o=s(()=>{let l=`data modify storage aj.${Project.animated_java.export_namespace}:animations ${r.safe_name} merge value ${a.toString()}`;t.push(l),a=new Ye},"addFrameDataCommand");for(let l=0;l1e6&&o(),ln.set(ln.get()+1),await i.sync()}o(),ln.set(ln.get()+1),await i.sync()}return t}s(jG,"createAnimationStorage");function IG(n){let e=new Ye,t=new Ye,i=new Ye;e.set("data_data",new ct(""));for(let r of Object.values(n.nodes))switch(r.type){case"locator":case"camera":{let a=new Ye().set("posx",new At(r.default_transform.pos[0])).set("posy",new At(r.default_transform.pos[1])).set("posz",new At(r.default_transform.pos[2])).set("rotx",new At(Math.radToDeg(r.default_transform.rot[0]))).set("roty",new At(Math.radToDeg(r.default_transform.rot[1])));r.type==="locator"&&r.config?.use_entity&&a.set("uuid",new ct("")),(r.type==="camera"?i:t).set(r.safe_name,a);break}case"bone":case"text_display":case"item_display":case"block_display":{e.set(r.type+"_"+r.safe_name,new ct(""));break}}return{locators:t,cameras:i,bones:e}}s(IG,"createPassengerStorage");function OG(n,e){return n.type==="locator"&&e.type!=="locator"?1:n.type!=="locator"&&e.type==="locator"?-1:0}s(OG,"nodeSorter");async function _d(n){console.time("Data Pack Compilation took");let{rig:e,animations:t,rigHash:i,animationHash:r}=n,a=Project.animated_java;console.log("Compiling Data Pack...",n);let o=new Yr("src/",{libDir:null,generatedDirName:"zzz",internalScoreboardName:"aj.i",eqVarScoreboardName:null,eqConstScoreboardName:null,header:"# This file was generated by Animated Java via MC-Build. It is not recommended to edit this file directly.",ioThreadCount:null,dontEmitComments:!0,setup:null,formatVersion:1/0}),l=null;if(a.data_pack_export_mode==="raw"){l=new pd(PathModule.join(n.dataPackFolder,"data.ajmeta"),a.export_namespace,Project.last_used_export_namespace,n.dataPackFolder),l.read(),Qn.set("Removing Old Data Pack Files..."),ln.set(0),mr.set(l.oldFiles.size);let p=new Set;for(let f of l.oldFiles){if(!xm(f))fs.existsSync(f)&&await fs.promises.unlink(f);else if(a.export_namespace!==Project.last_used_export_namespace&&Ec(f).resourceLocation.startsWith(`animated_java:${Project.last_used_export_namespace}/`)&&fs.existsSync(f)){let h=Ib(f,Project.last_used_export_namespace,a.export_namespace);await fs.promises.mkdir(PathModule.dirname(h),{recursive:!0}),await fs.promises.copyFile(f,h),await fs.promises.unlink(f)}let _=PathModule.dirname(f);for(;!p.has(_)&&fs.existsSync(_)&&(await fs.promises.readdir(_)).length===0;)await fs.promises.rm(_,{recursive:!0}),p.add(_),_=PathModule.dirname(_);ln.set(ln.get()+1)}}let u=new Map;function c(){let p=new br;return p.write=(f,_)=>{let g=PathModule.join(n.dataPackFolder,f);u.set(g,_),l&&l.files.add(g)},p}s(c,"createSyncIO"),o.io=c(),o.disableRequire=!0,o.templateParsingEnabled=!1;let d={export_namespace:a.export_namespace,interpolation_duration:a.interpolation_duration,teleportation_duration:a.teleportation_duration,display_item:a.display_item,rig:e,animations:t,export_version:Math.random().toString().substring(2,10),root_entity_passengers:await SG(e,i),TAGS:Un,OBJECTIVES:nc,TELLRAW:My,custom_summon_commands:a.summon_commands,matrixToNbtFloatArray:dm,transformationToNbt:jb,use_storage_for_animation:a.use_storage_for_animation,animationStorage:a.use_storage_for_animation?await jG(e,t):null,rigHash:i,animationHash:r,boundingBox:a.bounding_box,BoneConfig:Te,roundTo:kg,nodeSorter:OG,getRotationFromQuaternion:Tc,root_ticking_commands:a.ticking_commands};console.log("Compiler Variables:",d),Qn.set("Compiling Data Pack..."),ln.set(0),await new Promise(p=>(0,Dy.setTimeout)(p,2e3/framespersecond)),console.time("MC-Build Compiler took");let m=ni.tokenize(Ry,"src/animated_java.mcb");if(o.addFile("src/animated_java.mcb",tn.parseMcbFile(m)),o.compile(cn.fromObject(d)),console.timeEnd("MC-Build Compiler took"),Qn.set("Writing Data Pack..."),a.data_pack_export_mode==="raw")console.time("Writing Files took"),await BG(u,n.dataPackFolder),console.timeEnd("Writing Files took"),l.write();else if(a.data_pack_export_mode==="zip"){u.set(PathModule.join(n.dataPackFolder,"pack.mcmeta"),autoStringify({pack:{pack_format:48,description:`${Project.name}. Generated with Animated Java`}}));let p=n.dataPackFolder+(n.dataPackFolder.endsWith(".zip")?"":".zip");console.time("Writing Zip took"),await NG(u,p),console.timeEnd("Writing Zip took")}console.timeEnd("Data Pack Compilation took")}s(_d,"compileDataPack");async function NG(n,e){let t={};for(let[r,a]of n){let o=PathModule.relative(e,r);typeof a=="string"?t[o]=Buffer.from(a):t[o]=a}let i=await eu(t,{});await fs.promises.writeFile(e,i)}s(NG,"writeZip");async function BG(n,e){ln.set(0),mr.set(n.size);let t=Project.animated_java,i=new Set;async function r(l,u){if(xm(l)&&fs.existsSync(l)){let d=JSON.parse(fs.readFileSync(l,"utf-8")),m=JSON.parse(u),p=wg(d,m);t.export_namespace!==Project.last_used_export_namespace&&(p.values=p.values.filter(f=>{let _=typeof f=="string"?f:f.id;return!_.startsWith(`#animated_java:${Project.last_used_export_namespace}/`)||_.startsWith(`animated_java:${Project.last_used_export_namespace}/`)})),p.values=p.values.filter(f=>{let _=typeof f=="string"?f:f.id,g=_.startsWith("#"),h=jo(g?_.substring(1):_),v=PathModule.join(e,"data",h.namespace,g?"tags/function":"function",h.path+(g?".json":".mcfunction")),y=n.has(v)||fs.existsSync(v);if(!y){let k=Ec(l);console.warn(`The referenced ${g?"tag":"function"} '${_}' in '${k?.resourceLocation||l}' does not exist! Removing reference...`)}return y}),u=JSON.stringify(p)}let c=PathModule.dirname(l);i.has(c)||(await fs.promises.mkdir(c,{recursive:!0}),i.add(c)),await fs.promises.writeFile(l,u),ln.set(ln.get()+1)}s(r,"writeFile");let a=8,o=new Map;for(let[l,u]of n)o.set(l,r(l,u).finally(()=>{o.delete(l)})),o.size>=a&&await Promise.any(o);await Promise.all(o.values())}s(BG,"writeFiles");function Jp(n,e,t){n[t]=n[e],delete n[e]}s(Jp,"transferKey");function RG(n){let e={time:n.time,channel:n.channel,commands:ya(n),variant:ss(n),execute_condition:Wr(n),repeat:ls(n),repeat_frequency:cs(n)};switch(e.channel){case"variant":case"commands":break;default:e.value=[n.get("x",0).toString(),n.get("y",0).toString(),n.get("z",0).toString()],e.interpolation={type:n.interpolation}}if(e.interpolation)switch(e.interpolation.type){case"linear":{e.interpolation.easing=n.easing,n.easingArgs?.length&&(e.interpolation.easingArgs=n.easingArgs);break}case"bezier":{e.interpolation.bezier_linked=n.bezier_linked,e.interpolation.bezier_left_time=n.bezier_left_time.slice(),e.interpolation.bezier_left_value=n.bezier_left_value.slice(),e.interpolation.bezier_right_time=n.bezier_right_time.slice(),e.interpolation.bezier_right_value=n.bezier_right_value.slice();break}case"catmullrom":break;case"step":break}return n.data_points.length===2&&(e.post=[n.get("x",1).toString(),n.get("y",1).toString(),n.get("z",1).toString()]),e}s(RG,"serailizeKeyframe");function DG(n,e){return{...e,models:Js(e.models,(i,r)=>{let a={model:{...r.model},custom_model_data:r.custom_model_data};return[i,a]})}}s(DG,"serializeVariant");function Fy(n){let e=Project.animated_java,{rig:t,animations:i}=n;console.log("Exporting JSON...",n);function r(l){return{name:l.name,src:l.getDataURL()}}s(r,"serializeTexture");let a={settings:{export_namespace:e.export_namespace,bounding_box:e.bounding_box,custom_model_data_offset:e.custom_model_data_offset,baked_animations:e.baked_animations},textures:Js(t.textures,(l,u)=>[u.uuid,r(u)]),nodes:Js(t.nodes,(l,u)=>[l,MG(u)]),variants:Js(t.variants,(l,u)=>[l,DG(t,u)]),animations:{}};if(e.baked_animations)for(let l of i)a.animations[l.uuid]=FG(l);else for(let l of Blockbench.Animation.all){let u={name:l.name,loop_mode:l.loop,duration:l.length,excluded_nodes:l.excluded_nodes.map(c=>c.value),animators:{}};for(let[c,d]of Object.entries(l.animators))d.keyframes.length!==0&&(u.animators[c]=d.keyframes.map(RG));a.animations[l.uuid]=u}if(console.log("Exported JSON:",a),Cg(a))throw new Error("Circular references detected in exported JSON.");console.log("Scrubbed:",yf(a));let o;try{o=qi(e.json_file)}catch(l){console.log(`Failed to resolve export path '${e.json_file}'`),console.error(l);return}fs.writeFileSync(o,compileJSON(a).toString())}s(Fy,"exportJSON");function Ly(n){return{matrix:n.matrix.elements,decomposed:{translation:n.decomposed.translation.toArray(),left_rotation:n.decomposed.left_rotation.toArray(),scale:n.decomposed.scale.toArray()},pos:n.pos,rot:n.rot,head_rot:n.head_rot,scale:n.scale,interpolation:n.interpolation,commands:n.commands,execute_condition:n.execute_condition}}s(Ly,"serailizeNodeTransform");function MG(n){let e={...n};switch(delete e.node,delete e.parentNode,delete e.safe_name,delete e.model,Jp(e,"lineWidth","line_width"),Jp(e,"backgroundColor","background_color"),Jp(e,"backgroundAlpha","background_alpha"),e.default_transform=Ly(e.default_transform),n.type){case"bone":{delete e.boundingBox,e.bounding_box={min:n.bounding_box.min.toArray(),max:n.bounding_box.max.toArray()},delete e.configs,e.configs={...n.configs.variants};let t=Ne.getDefault();n.configs.default&&t&&(e.configs[t.uuid]=n.configs.default);break}case"text_display":{e.text=n.text?.toJSON();break}}return e}s(MG,"serailizeRenderedNode");function FG(n){let e={name:n.name,duration:n.duration,loop_delay:n.loop_delay,loop_mode:n.loop_mode,frames:[],modified_nodes:Object.keys(n.modified_nodes)},t=[];for(let i of n.frames){let r={};for(let[a,o]of Object.entries(i.node_transforms))r[a]=Ly(o);t.push({...i,node_transforms:r})}return e.frames=t,e}s(FG,"serializeAnimation");var gd=class{lastOverrideId=1;overrides=new Map;externalOverrides=new Map;rigs={};parent="item/generated";textures={};setOverride(e,t){this.overrides.set(e,t)}addOverride(e){let t=this.lastOverrideId;for(;this.overrides.has(t)||this.externalOverrides.has(t);)t++;return this.lastOverrideId=t,this.overrides.set(t,e),t}assertOverride(e,t){this.overrides.has(e)||this.externalOverrides.has(e)||this.setOverride(e,t)}readExisting(e){let t=Project.animated_java,i;try{i=JSON.parse(fs.readFileSync(e,"utf-8"))}catch(r){console.error("Failed to read existing display item model:",r);return}if(i.animated_java,i.parent&&(this.parent=i.parent),i.textures&&(this.textures=i.textures),i.overrides??=[],i.animated_java??={},typeof i.animated_java.rigs=="object"&&!Array.isArray(i.animated_java.rigs)){let r=i.animated_java.rigs;i.animated_java={};for(let a of Object.keys(r))i.animated_java[a]=r[a].used_ids}i.animated_java[t.export_namespace]??=[];for(let[r,a]of Object.entries(i.animated_java)){let o=t.export_namespace,l=Project.last_used_export_namespace;if(r===o||r===l){i.overrides=i.overrides.filter(u=>!a.includes(u.predicate.custom_model_data)),r===l&&o!==l&&delete i.animated_java[l];continue}else for(let u of a){let c=i.overrides.find(d=>d.predicate.custom_model_data===u);this.externalOverrides.set(u,c.model)}this.rigs[r]=a}}toJSON(){let[e,t]=Project.animated_java.display_item.split(":"),i=Project.animated_java.export_namespace;return{parent:this.parent,textures:Object.keys(this.textures).length>0?this.textures:{layer0:`${e}:item/${t}`},overrides:[...this.externalOverrides.entries(),...this.overrides.entries()].sort((r,a)=>r[0]-a[0]).map(([r,a])=>({predicate:{custom_model_data:r},model:a})),animated_java:hl({...this.rigs,[i]:[...this.overrides.keys()]})}}};s(gd,"PredicateItemModel");var hd=class{constructor(e,t,i,r){this.path=e;this.exportNamespace=t;this.lastUsedExportNamespace=i;this.resourcePackFolder=r}files=new Set;oldFiles=new Set;oldContent={};read(){if(!fs.existsSync(this.path))return;this.oldContent=JSON.parse(fs.readFileSync(this.path,"utf-8"));let e=this.oldContent[this.exportNamespace],t=this.oldContent[this.lastUsedExportNamespace];if(t){Array.isArray(t.files)||(t.files=[]);for(let i of t.files)this.oldFiles.add(PathModule.join(this.resourcePackFolder,i));delete this.oldContent[this.lastUsedExportNamespace]}if(e){Array.isArray(e.files)||(e.files=[]);for(let i of e.files)this.oldFiles.add(PathModule.join(this.resourcePackFolder,i));delete this.oldContent[this.exportNamespace]}}write(){let e=PathModule.dirname(this.path),t={...this.oldContent,[this.exportNamespace]:{files:Array.from(this.files).map(i=>PathModule.relative(e,i).replace(/\\/g,"/"))}};fs.writeFileSync(this.path,autoStringify(hl(t)))}};s(hd,"ResourcePackAJMeta");async function bd(n){let{rig:e,displayItemPath:t,resourcePackFolder:i,textureExportFolder:r,modelExportFolder:a}=n,o=Project.animated_java,l=Project.last_used_export_namespace;Qn.set("Compiling Resource Pack..."),console.log("Compiling resource pack...",n);let u=new hd(PathModule.join(n.resourcePackFolder,"assets.ajmeta"),o.export_namespace,l,n.resourcePackFolder);if(o.resource_pack_export_mode==="raw"){u.read(),Qn.set("Removing Old Resource Pack Files..."),ln.set(0),mr.set(u.oldFiles.size);let p=new Set;for(let f of u.oldFiles){fs.existsSync(f)&&await fs.promises.unlink(f);let _=PathModule.dirname(f);for(;!p.has(_)&&fs.existsSync(_)&&(await fs.promises.readdir(_)).length===0;)await fs.promises.rm(_,{recursive:!0}),p.add(_),_=PathModule.dirname(_);ln.set(ln.get()+1)}}let c=new Map;c.set(PathModule.join(i,"assets/animated_java/models/empty.json"),"{}");let d=new gd;fs.existsSync(t)&&(console.warn("Display item already exists! Attempting to merge..."),d.readExisting(t)),d.lastOverrideId=Math.max(1,o.enable_advanced_resource_pack_settings?o.custom_model_data_offset:0),d.assertOverride(1,"animated_java:empty");for(let p of Object.values(e.textures)){let f,_,g;if(p.source?.startsWith("data:"))f=Buffer.from(p.source.split(",")[1],"base64");else if(p.path&&fs.existsSync(p.path)){if(So(p.path))continue;{f=fs.readFileSync(p.path);let v=p.path+".mcmeta",y=p.path.replace(".png","_e.png");fs.existsSync(v)&&(_=fs.readFileSync(v)),fs.existsSync(y)&&(g=fs.readFileSync(y))}}if(f===void 0)throw new Error(`Texture ${p.name} is missing it's image data.`);let h=Ht(p.name);p.name.endsWith(".png")||(h+=".png"),c.set(PathModule.join(r,h),f),_!==void 0&&c.set(PathModule.join(r,h+".mcmeta"),_),g!==void 0&&c.set(PathModule.join(r,h+"_e.png"),g)}let m=PathModule.join(i,"assets/animated_java/textures/item/transparent.png");c.set(m,nativeImage.createFromDataURL(Hn.source).toPNG());for(let p of Object.values(e.variants))for(let[f,_]of Object.entries(p.models)){let g=e.nodes[f];_.custom_model_data=d.addOverride(_.resource_location),c.set(PathModule.join(a,p.name,g.name+".json"),autoStringify(_.model))}if(o.enable_plugin_mode)console.log("Plugin mode enabled. Skipping resource pack export.");else if(o.resource_pack_export_mode==="raw"){u.files=new Set(c.keys()),u.write(),console.log("Display Item Model",d.toJSON()),c.set(t,autoStringify(d.toJSON())),Qn.set("Writing Resource Pack..."),ln.set(0),mr.set(c.size);let p=new Set;for(let[f,_]of c){let g=PathModule.dirname(f);p.has(g)||(await fs.promises.mkdir(g,{recursive:!0}),p.add(g)),await fs.promises.writeFile(f,_),ln.set(ln.get()+1)}}else if(o.resource_pack_export_mode==="zip"){c.set(PathModule.join(i,"pack.mcmeta"),autoStringify({pack:{pack_format:32,description:`${Project.name}. Generated with Animated Java`}})),Qn.set("Writing Resource Pack Zip...");let p={};for(let[_,g]of c){let h=PathModule.relative(i,_);typeof g=="string"?p[h]=Buffer.from(g):p[h]=g}let f=await eu(p,{});await fs.promises.writeFile(i+(i.endsWith(".zip")?"":".zip"),f)}console.log("Resource pack compiled!")}s(bd,"compileResourcePack");var Py=ci(Rt("crypto"),1);function LG(n,e,t){if(!n.export)return;let i={};if(i.from=n.from.slice(),i.to=n.to.slice(),n.inflate&&(i.from=i.from.map(r=>r-n.inflate),i.to=i.to.map(r=>r+n.inflate)),n.shade===!1&&(i.shade=!1),!(n.rotation.allEqual(0)&&n.origin.allEqual(0))){let r=n.rotationAxis()||"y";i.rotation={angle:n.rotation[getAxisNumber(r)],axis:r,origin:n.origin}}if(n.rescale&&(i.rotation?i.rotation.rescale=!0:i.rotation={angle:0,axis:n.rotation_axis||"y",origin:n.origin,rescale:!0}),n.parent instanceof Group){let r=n.parent;i.from=i.from.map((a,o)=>a-r.origin[o]),i.to=i.to.map((a,o)=>a-r.origin[o]),i.rotation&&!Array.isArray(i.rotation)&&(i.rotation.origin=i.rotation.origin.map((a,o)=>a-r.origin[o]))}i.faces={};for(let[r,a]of Object.entries(n.faces)){if(!a||!a.texture||a.getTexture()?.uuid===Hn.uuid)continue;let o={};if(a.enabled&&(o.uv=a.uv.slice().map((l,u)=>l*16/UVEditor.getResolution(u%2))),a.rotation&&(o.rotation=a.rotation),a.texture){let l=a.getTexture();if(!l)throw new Error("Texture not found");o.texture="#"+l.id,e.textures[l.id]=l;let u=Vy(l,e).resourceLocation;u&&(t.textures[l.id]=u)}a.cullface&&(o.cullface=a.cullface),a.tint>=0&&(o.tintindex=a.tint),i.faces[r]=o}Object.keys(i.faces).length!==0&&(t.elements??=[],t.elements.push(i))}s(LG,"renderCube");var ic=new Map;function Vy(n,e){if(ic.has(n.uuid))return ic.get(n.uuid);if(n.name.endsWith(".png")||(n.name+=".png"),n.path&&fs.existsSync(n.path)&&fs.statSync(n.path).isFile()){let r=xr(n.path);if(r)return ic.set(n.uuid,r),r}let t=PathModule.join(e.texture_export_folder,Ht(n.name)),i=xr(t);if(i)return ic.set(n.uuid,i),i;throw console.error(n),new Error(`Invalid texture path: ${t}`)}s(Vy,"getTextureResourceLocation");function PG(n){let e=n.children.filter(i=>i instanceof Cube),t=new THREE.Box3;t.expandByPoint(new THREE.Vector3(n.origin[0],n.origin[1],n.origin[2]));for(let i of e)t.expandByPoint(new THREE.Vector3(i.from[0]-i.inflate,i.from[1]-i.inflate,i.from[2]-i.inflate)),t.expandByPoint(new THREE.Vector3(i.to[0]+i.inflate,i.to[1]+i.inflate,i.to[2]+i.inflate));return t}s(PG,"getBoneBoundingBox");function zy(n,e,t){if(!n.export)return;let i=n.parent instanceof Group?n.parent.uuid:void 0,r=PathModule.join(e.model_export_folder,"default",n.name+".json"),a=xr(r);if(!a)throw console.error(n),new Error(`Invalid bone path: ${n.name} -> ${r}`);let o={type:"bone",name:n.name,safe_name:Ht(n.name),uuid:n.uuid,parent:i,bounding_box:PG(n),base_scale:1,configs:n.configs,default_transform:{}},l=t.models[n.uuid];l||(l=t.models[n.uuid]={model:{textures:{},display:{head:{rotation:[0,180,0]}}},custom_model_data:-1,model_path:r,resource_location:a.resourceLocation});for(let m of n.children)if(m.export)switch(!0){case m instanceof Group:{zy(m,e,t);break}case m instanceof Locator:{Hy(m,e);break}case m instanceof qe:{Jy(m,e);break}case(OutlinerElement.types.camera&&m instanceof OutlinerElement.types.camera):{$y(m,e);break}case m instanceof ut:{Gy(m,e);break}case m instanceof ht:{Uy(m,e);break}case m instanceof Cube:{LG(m,e,l.model),e.includes_custom_models=!0;break}default:console.warn("Encountered unknown node type:",m)}if(!l.model.elements||l.model.elements.length===0){delete t.models[n.uuid];let m={type:"struct",name:n.name,safe_name:o.safe_name,uuid:n.uuid,parent:i,default_transform:{}};e.nodes[n.uuid]=m;return}let u=new THREE.Vector3().subVectors(o.bounding_box.max,o.bounding_box.min),c=Math.max(u.x,u.y,u.z),d=Math.min(1,24/c);for(let m of l.model.elements)m.from=m.from.map(p=>p*d+8),m.to=m.to.map(p=>p*d+8),m.rotation&&!Array.isArray(m.rotation)&&(m.rotation.origin=m.rotation.origin.map(p=>p*d+8));o.base_scale=1/d,e.nodes[n.uuid]=o}s(zy,"renderGroup");function Gy(n,e){if(!n.export)return;let t=n.parent instanceof Group?n.parent.uuid:void 0,i=PathModule.join(e.model_export_folder,n.name+".json");if(!xr(i))throw console.error(n),new Error(`Invalid bone path: ${n.name} -> ${i}`);let a={type:"item_display",name:n.name,safe_name:Ht(n.name),uuid:n.uuid,parent:t,item:n.item,itme_display:n.itemDisplay,base_scale:1,config:n.config,default_transform:{}};e.nodes[n.uuid]=a}s(Gy,"renderItemDisplay");function Uy(n,e){if(!n.export)return;let t=n.parent instanceof Group?n.parent.uuid:void 0,i=PathModule.join(e.model_export_folder,n.name+".json");if(!xr(i))throw console.error(n),new Error(`Invalid bone path: ${n.name} -> ${i}`);let a={type:"block_display",name:n.name,safe_name:Ht(n.name),uuid:n.uuid,block:n.block,parent:t,base_scale:1,config:n.config,default_transform:{}};e.nodes[n.uuid]=a}s(Uy,"renderBlockDisplay");function Jy(n,e){if(!n.export)return;let t=n.parent instanceof Group?n.parent.uuid:void 0,i=PathModule.join(e.model_export_folder,n.name+".json");if(!xr(i))throw console.error(n),new Error(`Invalid bone path: ${n.name} -> ${i}`);let a={type:"text_display",name:n.name,safe_name:Ht(n.name),uuid:n.uuid,parent:t,text:$t.fromString(n.text),line_width:n.lineWidth,background_color:n.backgroundColor,background_alpha:n.backgroundAlpha,align:n.align,shadow:n.shadow,see_through:n.seeThrough,base_scale:1,config:n.config,default_transform:{}};return e.nodes[n.uuid]=a,{uuid:n.uuid,children:[]}}s(Jy,"renderTextDisplay");function Hy(n,e){if(!n.export)return;let t=n.parent instanceof Group?n.parent.uuid:n.parent,i={type:"locator",name:n.name,safe_name:Ht(n.name),uuid:n.uuid,parent:t,config:n.config,default_transform:{}};e.nodes[n.uuid]=i}s(Hy,"renderLocator");function $y(n,e){if(!n.export)return;let t=n.parent instanceof Group?n.parent.uuid:n.parent,i={type:"camera",name:n.name,safe_name:Ht(n.name),uuid:n.uuid,parent:t,config:n.config,default_transform:{}};e.nodes[n.uuid]=i}s($y,"renderCamera");function VG(n,e){let t={};for(let[i,r]of Object.entries(e.nodes)){if(r.type!=="bone"||n.excludedNodes.find(d=>d.value===i))continue;let a={};for(let[d,m]of n.textureMap.map.entries()){let p=Texture.all.find(f=>f.uuid===d);if(!p)throw new Error(`From texture not found: ${d}`);if(m===Hn.uuid)a[p.id]=jg,e.textures[Hn.id]=Hn;else{let f=Texture.all.find(_=>_.uuid===m);if(!f)throw new Error(`To texture not found: ${m}`);a[p.id]=Vy(f,e).resourceLocation,e.textures[f.id]=f}}if(Object.keys(a).length===0)continue;let o=PathModule.join(e.model_export_folder,"default",r.safe_name+".json"),l=xr(o);if(!l)throw new Error(`Invalid Bone Name: '${r.safe_name}' -> '${o}'`);let u=PathModule.join(e.model_export_folder,n.name,r.safe_name+".json"),c=xr(u);if(!c)throw new Error(`Invalid Variant Name: '${n.name}' -> '${u}'`);t[i]={model:{parent:l.resourceLocation,textures:a},custom_model_data:-1,model_path:u,resource_location:c.resourceLocation}}return t}s(VG,"renderVariantModels");function qy(n){let e=Py.createHash("sha256");for(let[t,i]of Object.entries(n.nodes))switch(e.update("node;"),e.update(t),e.update(i.name),e.update(i.default_transform.matrix.elements.toString()),i.type){case"bone":{let r=n.variants[Ne.getDefault().uuid].models[t];if(e.update(";"+JSON.stringify(r)||""),!i.configs)break;if(i.configs.default){let a=Te.fromJSON(i.configs.default);a.isDefault()||(e.update("defaultconfig;"),e.update(a.toNBT().toString()))}for(let[a,o]of Object.entries(i.configs.variants)){let l=Te.fromJSON(o);l.isDefault()||(e.update("variantconfig;"),e.update(a),e.update(l.toNBT().toString()))}break}case"locator":{i.config&&e.update(";"+JSON.stringify(i.config));break}case"camera":{i.config&&e.update(";"+JSON.stringify(i.config));break}case"text_display":{e.update(`;${i.text?.toString()}`),i.config&&e.update(";"+JSON.stringify(i.config));break}}return e.digest("hex")}s(qy,"hashRig");function zG(n,e){return{...n.toJSON(),models:VG(n,e)}}s(zG,"renderVariant");function GG(n){let e=new Blockbench.Animation;np(),ap(e,0);let t=rp(e,n.nodes).node_transforms;return ip(),t}s(GG,"getDefaultTransforms");function Ky(n,e){console.time("Rendering rig took"),Texture.all.forEach((a,o)=>a.id=String(o)),Animator.showDefaultPose();let t={nodes:{},variants:{},textures:{},model_export_folder:n,texture_export_folder:e,includes_custom_models:!1},i=Ne.getDefault();t.variants[i.uuid]={...i.toJSON(),models:{}};for(let a of Outliner.root)switch(!0){case a instanceof Group:{zy(a,t,t.variants[i.uuid]);break}case a instanceof Locator:{Hy(a,t);break}case a instanceof qe:{Jy(a,t);break}case(OutlinerElement.types.camera&&a instanceof OutlinerElement.types.camera):{$y(a,t);break}case a instanceof ut:{Gy(a,t);break}case a instanceof ht:{Uy(a,t);break}case a instanceof Cube:throw new uo(`Cubes cannot be exported as root nodes. Please parent them to a bone. (Found '${a.name}' outside of a bone)`);default:console.warn("Encountered unknown node type:",a)}let r=GG(t);for(let[a,o]of Object.entries(t.nodes))o.default_transform=r[a];for(let a of Ne.all)a.isDefault||(t.variants[a.uuid]=zG(a,t));return ic.clear(),console.timeEnd("Rendering rig took"),console.log("Rendered rig:",t),t}s(Ky,"renderRig");var uo=class extends Error{};s(uo,"IntentionalExportError");async function UG(n=!0){let e=Project.animated_java,t=Zu();await new Promise(r=>requestAnimationFrame(r));let i=Ne.selected;Ne.getDefault().select();try{console.time("Exporting project took");for(let f of Ne.all)f.verifyTextureMap();for(let f of Texture.all)if(!(f.path&&So(f.path)&&fs.existsSync(f.path))&&Texture.all.some(_=>_!==f&&_.name===f.name))throw new uo(`Texture name "${f.name}" is used more than once. Please make sure all textures have unique names.`);let r,a,o,l=qi(e.resource_pack),u=qi(e.data_pack);e.enable_plugin_mode?(a=PathModule.join("assets/animated_java/models/item/",e.export_namespace),r=PathModule.join("assets/animated_java/textures/item/",e.export_namespace),o=PathModule.join("assets/minecraft/models/item/",e.display_item.split(":").at(-1)+".json")):e.enable_advanced_resource_pack_folders?(a=e.model_folder,r=e.texture_folder,o=e.display_item_path):(a=PathModule.join(l,"assets/animated_java/models/item/",e.export_namespace),r=PathModule.join(l,"assets/animated_java/textures/item/",e.export_namespace),o=PathModule.join(l,"assets/minecraft/models/item/",e.display_item.split(":").at(-1)+".json")),Qn.set("Rendering Rig...");let c=Ky(a,r);if(Project.animated_java.resource_pack_export_mode==="none"&&c.includes_custom_models){Blockbench.showMessageBox({title:w("misc.failed_to_export.title"),message:w("misc.failed_to_export.custom_models.message"),buttons:[w("misc.failed_to_export.button")]}),t.close(0);return}Qn.set("Rendering Animations...");let d=Pv(Project,c);Qn.set("Hashing Rendered Objects...");let m=qy(c),p=Lv(d);await bd({rig:c,displayItemPath:o,resourcePackFolder:l,textureExportFolder:r,modelExportFolder:a}),e.enable_plugin_mode?Fy({rig:c,animations:d,displayItemPath:o,textureExportFolder:r,modelExportFolder:a}):(e.data_pack_export_mode!=="none"&&await _d({rig:c,animations:d,dataPackFolder:u,rigHash:m,animationHash:p}),Project.last_used_export_namespace=e.export_namespace),console.timeEnd("Exporting project took"),n&&Hc(),Blockbench.showQuickMessage("Project exported successfully!",2e3)}catch(r){if(console.error(r),r instanceof uo){Blockbench.showMessageBox({title:w("misc.failed_to_export.title"),message:r.message,buttons:[w("misc.failed_to_export.button")]});return}fa(r)}finally{i?.select(),t.close(0)}}s(UG,"actuallyExportProject");async function vd(n=!0){if(!Project)return;Pr.set({});let e=os();if(await new Promise(t=>requestAnimationFrame(t)),console.log("Blueprint Setting Errors",Pr.get()),Object.keys(Pr.get()).length>0){Blockbench.showMessageBox({title:w("misc.failed_to_export.title"),message:w("misc.failed_to_export.blueprint_settings.message")+` -`+Object.entries(Rr.get()).map(t=>w("misc.failed_to_export.blueprint_settings.error_item",t[0])+` +`+Object.entries(Pr.get()).map(t=>w("misc.failed_to_export.blueprint_settings.error_item",t[0])+` - `+t[1]).join(` -`),buttons:[w("misc.failed_to_export.button")]});return}e.close(0),await iz(n)}s(od,"exportProject");var d3='data:image/svg+xml,%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A';function f3(n,e,t){let i=n.slice();return i[0]=e[t],i}s(f3,"get_each_context");function m3(n,e,t){let i=n.slice();return i[0]=e[t],i}s(m3,"get_each_context_1");function p3(n){let e,t=n[0]+"",i;return{c(){e=V("p"),i=Ne(t),T(e,"class","svelte-by5dje")},m(r,a){G(r,e,a),N(e,i)},p:re,d(r){r&&z(e)}}}s(p3,"create_each_block_1");function _3(n){let e,t=n[0]+"",i;return{c(){e=V("p"),i=Ne(t),T(e,"class","svelte-by5dje")},m(r,a){G(r,e,a),N(e,i)},p:re,d(r){r&&z(e)}}}s(_3,"create_each_block");function az(n){let e,t,i,r,a,o,l,c,u,d,m,p,f,_,v,g,h,b,x,y,k,C,A,I,S,L,O,E,B,H,ee,ae,ne,ve,X,j,Q,P,oe=_e.subscription_supporters.sort(),Z=[];for(let U=0;U +`),buttons:[w("misc.failed_to_export.button")]});return}e.close(0),await UG(n)}s(vd,"exportProject");var Wy='data:image/svg+xml,%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A';function Zy(n,e,t){let i=n.slice();return i[0]=e[t],i}s(Zy,"get_each_context");function Xy(n,e,t){let i=n.slice();return i[0]=e[t],i}s(Xy,"get_each_context_1");function Yy(n){let e,t=n[0]+"",i;return{c(){e=P("p"),i=Re(t),T(e,"class","svelte-by5dje")},m(r,a){L(r,e,a),N(e,i)},p:ue,d(r){r&&F(e)}}}s(Yy,"create_each_block_1");function Qy(n){let e,t=n[0]+"",i;return{c(){e=P("p"),i=Re(t),T(e,"class","svelte-by5dje")},m(r,a){L(r,e,a),N(e,i)},p:ue,d(r){r&&F(e)}}}s(Qy,"create_each_block");function HG(n){let e,t,i,r,a,o,l,u,c,d,m,p,f,_,g,h,v,y,k,b,x,E,C,j,S,B,O,A,V,K,te,fe,ae,ee,se,oe,xe,ne,pe=ke.subscription_supporters.sort(),W=[];for(let J=0;J - `,x=K(),y=V("a"),y.innerHTML=` + `,k=G(),b=P("a"),b.innerHTML=` - `,k=K(),C=V("a"),C.innerHTML=` + `,x=G(),E=P("a"),E.innerHTML=` - `,A=K(),I=V("p"),I.textContent="Created by Titus Evans (SnaveSutit)",S=K(),L=V("p"),L.textContent=`${_e.description}`,O=K(),E=V("h4"),E.textContent="Special Thanks to",B=K(),H=V("div"),H.innerHTML=`

      Ian Senne (FetchBot)

      + `,C=G(),j=P("p"),j.textContent="Created by Titus Evans (SnaveSutit)",S=G(),B=P("p"),B.textContent=`${ke.description}`,O=G(),A=P("h4"),A.textContent="Special Thanks to",V=G(),K=P("div"),K.innerHTML=`

      Ian Senne (FetchBot)

      For always being there to help.

      Jesse Spicer (Dominexis)

      For making quaternions and matrices make sense.

      @@ -3820,22 +3830,22 @@ dir <%export_namespace%> {\r

      Boxic

      For throwing absurd amounts of money at me.

      Flubberschnub

      -

      For showing off the power of AJ with his boss fights.

      `,ee=K(),ae=V("h4"),ae.textContent="Ko-fi Supporters",ne=K(),ve=V("div");for(let U=0;U{let n=Blockbench.addCSS(".content.svelte-by5dje.svelte-by5dje{display:flex;flex-direction:column;align-items:center;overflow-y:scroll;max-height:55rem;padding-right:16px}.header-container.svelte-by5dje.svelte-by5dje{display:flex;align-items:center;margin-bottom:1.5rem}.header-container.svelte-by5dje div.svelte-by5dje{display:flex;flex-direction:column;justify-content:center;margin-left:2rem}.header-container.svelte-by5dje img.svelte-by5dje{width:128px;border-radius:16px;box-shadow:4px 4px 8px -4px black}.header-container.svelte-by5dje h1.svelte-by5dje{margin:0px}.header-container.svelte-by5dje h3.svelte-by5dje{margin:0px}h4.svelte-by5dje.svelte-by5dje{color:var(--color-subtle_text);margin-top:30px;border-top:2px solid var(--color-border);padding-top:12px;padding-bottom:8px;text-transform:uppercase;text-align:center;width:100%}.socials.svelte-by5dje.svelte-by5dje{display:flex;justify-content:space-evenly;width:100%;margin-bottom:16px}.socials.svelte-by5dje a.svelte-by5dje{display:flex;flex-direction:column;align-items:center;text-decoration:none;width:64px;height:64px;padding:8px;background-color:var(--color-button);border-radius:8px}.socials.svelte-by5dje a.svelte-by5dje:hover{background-color:var(--color-selected)}.socials.svelte-by5dje a .svelte-by5dje:not(label){flex-grow:1}.socials.svelte-by5dje a label.svelte-by5dje{color:var(--color-subtle_text)}.socials.svelte-by5dje a i.svelte-by5dje{display:flex;align-items:center;font-size:2em}.socials.svelte-by5dje img.svelte-by5dje{width:32px;height:32px}.grid.svelte-by5dje.svelte-by5dje{display:grid;grid-template-columns:1fr 1fr 1fr;grid-gap:0.75rem;justify-items:center}.grid.svelte-by5dje p.svelte-by5dje{text-align:center}.grid.svelte-by5dje p.svelte-by5dje:nth-child(even){color:var(--color-subtle_text)}.grid2.svelte-by5dje.svelte-by5dje{display:grid;grid-template-columns:1fr 1fr 1fr 1fr;justify-items:center;gap:4px 8px;margin-bottom:8px}.grid2.svelte-by5dje p.svelte-by5dje{text-align:center;width:100%;box-shadow:2px 2px 4px var(--color-back);background:var(--color-button);padding:0px 4px;border-radius:4px}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();function h3(){new Pt({id:`${_e.name}:aboutDialog`,title:w("dialog.about.title"),width:700,component:g3,props:{},buttons:[w("dialog.about.close_button")],preventKeybinds:!0}).show()}s(h3,"openAboutDialog");function oz(){let n=document.createElement("img");return Object.assign(n,{src:Oi,width:16,height:16}),Object.assign(n.style,{position:"relative",top:"2px",borderRadius:"2px",marginRight:"6px",boxShadow:"1px 1px 1px #000000aa"}),n}s(oz,"createIconImg");var sz=document.querySelector("#menu_bar"),va=ng(`${_e.name}:menu`,[],()=>Format===et);va.label.style.display="inline-block";va.label.innerHTML="Animated Java";va.label.prepend(oz());sz.appendChild(va.label);MenuBar.addAction(Xt(`${_e.name}:about`,{icon:"info",category:"animated_java",name:w("action.open_about.name"),click(){h3()}}),va.id);MenuBar.addAction(Xt(`${_e.name}:documentation`,{icon:"find_in_page",category:"animated_java",name:w("action.open_documentation.name"),click(){Blockbench.openLink("https://animated-java.dev/docs")}}),va.id);MenuBar.addAction(Xt(`${_e.name}:blueprint_settings`,{icon:"settings",category:"animated_java",name:w("action.open_blueprint_settings.name"),condition(){return Format===et},click(){Xo()}}),va.id);MenuBar.addAction(Xt(`${_e.name}:export`,{icon:"insert_drive_file",category:"animated_java",name:w("action.export.name"),condition(){return Format===et},click(){od()}}),va.id);function lz(n){let e;return{c(){e=V("div"),e.textContent=`${w("dialog.bone_config.selected_variant_subtitle")}`,T(e,"class","selected_variant_subtitle svelte-q98dtr")},m(t,i){G(t,e,i)},p:re,d(t){t&&z(e)}}}s(lz,"create_else_block_2");function cz(n){let e;return{c(){e=V("div"),e.textContent=`${w("dialog.bone_config.default_variant_subtitle")}`,T(e,"class","selected_variant_subtitle svelte-q98dtr")},m(t,i){G(t,e,i)},p:re,d(t){t&&z(e)}}}s(cz,"create_if_block_5");function uz(n){let e,t,i,r,a,o,l,c,u,d;function m(b){n[30](b)}s(m,"checkbox0_checked_binding_1");let p={label:w("dialog.bone_config.inherit_settings.title"),tooltip:w("dialog.bone_config.inherit_settings.description")};n[7]!==void 0&&(p.checked=n[7]),e=new it({props:p}),se.push(()=>be(e,"checked",m));function f(b){n[31](b)}s(f,"checkbox1_checked_binding_1");let _={label:w("dialog.bone_config.use_nbt.title"),tooltip:w("dialog.bone_config.use_nbt.description")};n[12]!==void 0&&(_.checked=n[12]),r=new it({props:_}),se.push(()=>be(r,"checked",f));let v=[mz,fz],g=[];function h(b,x){return b[15]?0:1}return s(h,"select_block_type_2"),l=h(n,[-1,-1]),c=g[l]=v[l](n),{c(){fe(e.$$.fragment),i=K(),fe(r.$$.fragment),o=K(),c.c(),u=St()},m(b,x){de(e,b,x),G(b,i,x),de(r,b,x),G(b,o,x),g[l].m(b,x),G(b,u,x),d=!0},p(b,x){let y={};!t&&x[0]&128&&(t=!0,y.checked=b[7],he(()=>t=!1)),e.$set(y);let k={};!a&&x[0]&4096&&(a=!0,k.checked=b[12],he(()=>a=!1)),r.$set(k);let C=l;l=h(b,x),l===C?g[l].p(b,x):(bt(),Y(g[C],1,1,()=>{g[C]=null}),vt(),c=g[l],c?c.p(b,x):(c=g[l]=v[l](b),c.c()),W(c,1),c.m(u.parentNode,u))},i(b){d||(W(e.$$.fragment,b),W(r.$$.fragment,b),W(c),d=!0)},o(b){Y(e.$$.fragment,b),Y(r.$$.fragment,b),Y(c),d=!1},d(b){ue(e,b),b&&z(i),ue(r,b),b&&z(o),g[l].d(b),b&&z(u)}}}s(uz,"create_else_block");function dz(n){let e,t,i,r,a,o,l,c,u,d,m,p,f,_,v,g,h,b,x,y,k,C,A,I,S,L,O,E;function B(le){n[20](le)}s(B,"checkbox0_checked_binding");let H={label:w("dialog.bone_config.inherit_settings.title"),tooltip:w("dialog.bone_config.inherit_settings.description")};n[7]!==void 0&&(H.checked=n[7]),e=new it({props:H}),se.push(()=>be(e,"checked",B));function ee(le){n[21](le)}s(ee,"select_value_binding");let ae={label:w("dialog.bone_config.billboard.title"),tooltip:w("dialog.bone_config.billboard.description"),options:n[18],defaultOption:Pe.prototype.billboard};n[0]!==void 0&&(ae.value=n[0]),r=new Kn({props:ae}),se.push(()=>be(r,"value",ee));function ne(le){n[22](le)}s(ne,"checkbox1_checked_binding");let ve={label:w("dialog.bone_config.glowing.title"),tooltip:w("dialog.bone_config.glowing.description")};n[4]!==void 0&&(ve.checked=n[4]),l=new it({props:ve}),se.push(()=>be(l,"checked",ne));function X(le){n[23](le)}s(X,"colorpicker_value_binding");let j={label:w("dialog.bone_config.glow_color.title"),tooltip:w("dialog.bone_config.glow_color.description")};n[6]!==void 0&&(j.value=n[6]),d=new Gi({props:j}),se.push(()=>be(d,"value",X));function Q(le){n[24](le)}s(Q,"numberslider0_value_binding");let P={label:w("dialog.bone_config.shadow_radius.title"),tooltip:w("dialog.bone_config.shadow_radius.description"),min:0,max:64};n[10]!==void 0&&(P.value=n[10]),f=new xt({props:P}),se.push(()=>be(f,"value",Q));function oe(le){n[25](le)}s(oe,"numberslider1_value_binding");let Z={label:w("dialog.bone_config.shadow_strength.title"),tooltip:w("dialog.bone_config.shadow_strength.description"),min:0};n[11]!==void 0&&(Z.value=n[11]),g=new xt({props:Z}),se.push(()=>be(g,"value",oe));function J(le){n[26](le)}s(J,"checkbox2_checked_binding");let ie={label:w("dialog.bone_config.override_brightness.title"),tooltip:w("dialog.bone_config.override_brightness.description")};n[1]!==void 0&&(ie.checked=n[1]),x=new it({props:ie}),se.push(()=>be(x,"checked",J));let U=n[14]&&y3(n);function q(le){n[28](le)}s(q,"checkbox3_checked_binding");let ge={label:w("dialog.bone_config.enchanted.title"),tooltip:w("dialog.bone_config.enchanted.description")};n[3]!==void 0&&(ge.checked=n[3]),A=new it({props:ge}),se.push(()=>be(A,"checked",q));function Te(le){n[29](le)}s(Te,"checkbox4_checked_binding");let Re={label:w("dialog.bone_config.invisible.title"),tooltip:w("dialog.bone_config.invisible.description")};return n[8]!==void 0&&(Re.checked=n[8]),L=new it({props:Re}),se.push(()=>be(L,"checked",Te)),{c(){fe(e.$$.fragment),i=K(),fe(r.$$.fragment),o=K(),fe(l.$$.fragment),u=K(),fe(d.$$.fragment),p=K(),fe(f.$$.fragment),v=K(),fe(g.$$.fragment),b=K(),fe(x.$$.fragment),k=K(),U&&U.c(),C=K(),fe(A.$$.fragment),S=K(),fe(L.$$.fragment)},m(le,pe){de(e,le,pe),G(le,i,pe),de(r,le,pe),G(le,o,pe),de(l,le,pe),G(le,u,pe),de(d,le,pe),G(le,p,pe),de(f,le,pe),G(le,v,pe),de(g,le,pe),G(le,b,pe),de(x,le,pe),G(le,k,pe),U&&U.m(le,pe),G(le,C,pe),de(A,le,pe),G(le,S,pe),de(L,le,pe),E=!0},p(le,pe){let Le={};!t&&pe[0]&128&&(t=!0,Le.checked=le[7],he(()=>t=!1)),e.$set(Le);let ke={};!a&&pe[0]&1&&(a=!0,ke.value=le[0],he(()=>a=!1)),r.$set(ke);let Ut={};!c&&pe[0]&16&&(c=!0,Ut.checked=le[4],he(()=>c=!1)),l.$set(Ut);let In={};!m&&pe[0]&64&&(m=!0,In.value=le[6],he(()=>m=!1)),d.$set(In);let On={};!_&&pe[0]&1024&&(_=!0,On.value=le[10],he(()=>_=!1)),f.$set(On);let rt={};!h&&pe[0]&2048&&(h=!0,rt.value=le[11],he(()=>h=!1)),g.$set(rt);let It={};!y&&pe[0]&2&&(y=!0,It.checked=le[1],he(()=>y=!1)),x.$set(It),le[14]?U?(U.p(le,pe),pe[0]&16384&&W(U,1)):(U=y3(le),U.c(),W(U,1),U.m(C.parentNode,C)):U&&(bt(),Y(U,1,1,()=>{U=null}),vt());let _n={};!I&&pe[0]&8&&(I=!0,_n.checked=le[3],he(()=>I=!1)),A.$set(_n);let Si={};!O&&pe[0]&256&&(O=!0,Si.checked=le[8],he(()=>O=!1)),L.$set(Si)},i(le){E||(W(e.$$.fragment,le),W(r.$$.fragment,le),W(l.$$.fragment,le),W(d.$$.fragment,le),W(f.$$.fragment,le),W(g.$$.fragment,le),W(x.$$.fragment,le),W(U),W(A.$$.fragment,le),W(L.$$.fragment,le),E=!0)},o(le){Y(e.$$.fragment,le),Y(r.$$.fragment,le),Y(l.$$.fragment,le),Y(d.$$.fragment,le),Y(f.$$.fragment,le),Y(g.$$.fragment,le),Y(x.$$.fragment,le),Y(U),Y(A.$$.fragment,le),Y(L.$$.fragment,le),E=!1},d(le){ue(e,le),le&&z(i),ue(r,le),le&&z(o),ue(l,le),le&&z(u),ue(d,le),le&&z(p),ue(f,le),le&&z(v),ue(g,le),le&&z(b),ue(x,le),le&&z(k),U&&U.d(le),le&&z(C),ue(A,le),le&&z(S),ue(L,le)}}}s(dz,"create_if_block");function fz(n){let e,t,i,r,a,o,l,c,u,d,m,p,f,_,v,g,h,b,x,y,k,C,A;function I(Z){n[33](Z)}s(I,"select_value_binding_1");let S={label:w("dialog.bone_config.billboard.title"),tooltip:w("dialog.bone_config.billboard.description"),options:n[18],defaultOption:Pe.prototype.billboard};n[0]!==void 0&&(S.value=n[0]),e=new Kn({props:S}),se.push(()=>be(e,"value",I));function L(Z){n[34](Z)}s(L,"checkbox0_checked_binding_2");let O={label:w("dialog.bone_config.glowing.title"),tooltip:w("dialog.bone_config.glowing.description")};n[4]!==void 0&&(O.checked=n[4]),r=new it({props:O}),se.push(()=>be(r,"checked",L));function E(Z){n[35](Z)}s(E,"checkbox1_checked_binding_2");let B={label:w("dialog.bone_config.override_glow_color.title"),tooltip:w("dialog.bone_config.override_glow_color.description")};n[5]!==void 0&&(B.checked=n[5]),l=new it({props:B}),se.push(()=>be(l,"checked",E));let H=n[16]&&b3(n);function ee(Z){n[37](Z)}s(ee,"numberslider0_value_binding_1");let ae={label:w("dialog.bone_config.shadow_radius.title"),tooltip:w("dialog.bone_config.shadow_radius.description"),min:0,max:15};n[10]!==void 0&&(ae.value=n[10]),m=new xt({props:ae}),se.push(()=>be(m,"value",ee));function ne(Z){n[38](Z)}s(ne,"numberslider1_value_binding_1");let ve={label:w("dialog.bone_config.shadow_strength.title"),tooltip:w("dialog.bone_config.shadow_strength.description"),min:0,max:15};n[11]!==void 0&&(ve.value=n[11]),_=new xt({props:ve}),se.push(()=>be(_,"value",ne));function X(Z){n[39](Z)}s(X,"checkbox2_checked_binding_1");let j={label:w("dialog.bone_config.override_brightness.title"),tooltip:w("dialog.bone_config.override_brightness.description")};n[1]!==void 0&&(j.checked=n[1]),h=new it({props:j}),se.push(()=>be(h,"checked",X));let Q=n[14]&&v3(n);function P(Z){n[41](Z)}s(P,"checkbox3_checked_binding_1");let oe={label:w("dialog.bone_config.enchanted.title"),tooltip:w("dialog.bone_config.enchanted.description")};return n[3]!==void 0&&(oe.checked=n[3]),k=new it({props:oe}),se.push(()=>be(k,"checked",P)),{c(){fe(e.$$.fragment),i=K(),fe(r.$$.fragment),o=K(),fe(l.$$.fragment),u=K(),H&&H.c(),d=K(),fe(m.$$.fragment),f=K(),fe(_.$$.fragment),g=K(),fe(h.$$.fragment),x=K(),Q&&Q.c(),y=K(),fe(k.$$.fragment)},m(Z,J){de(e,Z,J),G(Z,i,J),de(r,Z,J),G(Z,o,J),de(l,Z,J),G(Z,u,J),H&&H.m(Z,J),G(Z,d,J),de(m,Z,J),G(Z,f,J),de(_,Z,J),G(Z,g,J),de(h,Z,J),G(Z,x,J),Q&&Q.m(Z,J),G(Z,y,J),de(k,Z,J),A=!0},p(Z,J){let ie={};!t&&J[0]&1&&(t=!0,ie.value=Z[0],he(()=>t=!1)),e.$set(ie);let U={};!a&&J[0]&16&&(a=!0,U.checked=Z[4],he(()=>a=!1)),r.$set(U);let q={};!c&&J[0]&32&&(c=!0,q.checked=Z[5],he(()=>c=!1)),l.$set(q),Z[16]?H?(H.p(Z,J),J[0]&65536&&W(H,1)):(H=b3(Z),H.c(),W(H,1),H.m(d.parentNode,d)):H&&(bt(),Y(H,1,1,()=>{H=null}),vt());let ge={};!p&&J[0]&1024&&(p=!0,ge.value=Z[10],he(()=>p=!1)),m.$set(ge);let Te={};!v&&J[0]&2048&&(v=!0,Te.value=Z[11],he(()=>v=!1)),_.$set(Te);let Re={};!b&&J[0]&2&&(b=!0,Re.checked=Z[1],he(()=>b=!1)),h.$set(Re),Z[14]?Q?(Q.p(Z,J),J[0]&16384&&W(Q,1)):(Q=v3(Z),Q.c(),W(Q,1),Q.m(y.parentNode,y)):Q&&(bt(),Y(Q,1,1,()=>{Q=null}),vt());let le={};!C&&J[0]&8&&(C=!0,le.checked=Z[3],he(()=>C=!1)),k.$set(le)},i(Z){A||(W(e.$$.fragment,Z),W(r.$$.fragment,Z),W(l.$$.fragment,Z),W(H),W(m.$$.fragment,Z),W(_.$$.fragment,Z),W(h.$$.fragment,Z),W(Q),W(k.$$.fragment,Z),A=!0)},o(Z){Y(e.$$.fragment,Z),Y(r.$$.fragment,Z),Y(l.$$.fragment,Z),Y(H),Y(m.$$.fragment,Z),Y(_.$$.fragment,Z),Y(h.$$.fragment,Z),Y(Q),Y(k.$$.fragment,Z),A=!1},d(Z){ue(e,Z),Z&&z(i),ue(r,Z),Z&&z(o),ue(l,Z),Z&&z(u),H&&H.d(Z),Z&&z(d),ue(m,Z),Z&&z(f),ue(_,Z),Z&&z(g),ue(h,Z),Z&&z(x),Q&&Q.d(Z),Z&&z(y),ue(k,Z)}}}s(fz,"create_else_block_1");function mz(n){let e,t,i,r,a;function o(c){n[32](c)}s(o,"lineinput_value_binding");let l={label:w("dialog.bone_config.nbt.title"),tooltip:w("dialog.bone_config.nbt.description"),valueChecker:n[19]};return n[9]!==void 0&&(l.value=n[9]),i=new hn({props:l}),se.push(()=>be(i,"value",o)),{c(){e=V("p"),e.textContent=`${w("dialog.bone_config.use_nbt.use_nbt_warning")}`,t=K(),fe(i.$$.fragment),T(e,"class","use_nbt_warning svelte-q98dtr")},m(c,u){G(c,e,u),G(c,t,u),de(i,c,u),a=!0},p(c,u){let d={};!r&&u[0]&512&&(r=!0,d.value=c[9],he(()=>r=!1)),i.$set(d)},i(c){a||(W(i.$$.fragment,c),a=!0)},o(c){Y(i.$$.fragment,c),a=!1},d(c){c&&z(e),c&&z(t),ue(i,c)}}}s(mz,"create_if_block_2");function b3(n){let e,t,i;function r(o){n[36](o)}s(r,"colorpicker_value_binding_1");let a={label:w("dialog.bone_config.glow_color.title"),tooltip:w("dialog.bone_config.glow_color.description")};return n[6]!==void 0&&(a.value=n[6]),e=new Gi({props:a}),se.push(()=>be(e,"value",r)),{c(){fe(e.$$.fragment)},m(o,l){de(e,o,l),i=!0},p(o,l){let c={};!t&&l[0]&64&&(t=!0,c.value=o[6],he(()=>t=!1)),e.$set(c)},i(o){i||(W(e.$$.fragment,o),i=!0)},o(o){Y(e.$$.fragment,o),i=!1},d(o){ue(e,o)}}}s(b3,"create_if_block_4");function v3(n){let e,t,i;function r(o){n[40](o)}s(r,"numberslider_value_binding_1");let a={label:w("dialog.bone_config.brightness_override.title"),tooltip:w("dialog.bone_config.brightness_override.description"),min:0,max:15};return n[2]!==void 0&&(a.value=n[2]),e=new xt({props:a}),se.push(()=>be(e,"value",r)),{c(){fe(e.$$.fragment)},m(o,l){de(e,o,l),i=!0},p(o,l){let c={};!t&&l[0]&4&&(t=!0,c.value=o[2],he(()=>t=!1)),e.$set(c)},i(o){i||(W(e.$$.fragment,o),i=!0)},o(o){Y(e.$$.fragment,o),i=!1},d(o){ue(e,o)}}}s(v3,"create_if_block_3");function y3(n){let e,t,i;function r(o){n[27](o)}s(r,"numberslider_value_binding");let a={label:w("dialog.bone_config.brightness_override.title"),tooltip:w("dialog.bone_config.brightness_override.description"),min:0,max:15};return n[2]!==void 0&&(a.value=n[2]),e=new xt({props:a}),se.push(()=>be(e,"value",r)),{c(){fe(e.$$.fragment)},m(o,l){de(e,o,l),i=!0},p(o,l){let c={};!t&&l[0]&4&&(t=!0,c.value=o[2],he(()=>t=!1)),e.$set(c)},i(o){i||(W(e.$$.fragment,o),i=!0)},o(o){Y(e.$$.fragment,o),i=!1},d(o){ue(e,o)}}}s(y3,"create_if_block_1");function pz(n){let e,t,i=w("dialog.bone_config.selected_variant",n[13].displayName)+"",r,a,o,l,c,u;function d(g,h){return g[13].isDefault?cz:lz}s(d,"select_block_type");let m=d(n,[-1,-1]),p=m(n),f=[dz,uz],_=[];function v(g,h){return g[17]?0:1}return s(v,"select_block_type_1"),l=v(n,[-1,-1]),c=_[l]=f[l](n),{c(){e=V("div"),t=V("div"),r=Ne(i),a=K(),p.c(),o=K(),c.c(),T(t,"class","selected_variant_title svelte-q98dtr")},m(g,h){G(g,e,h),N(e,t),N(t,r),N(e,a),p.m(e,null),N(e,o),_[l].m(e,null),u=!0},p(g,h){(!u||h[0]&8192)&&i!==(i=w("dialog.bone_config.selected_variant",g[13].displayName)+"")&&tt(r,i),m===(m=d(g,h))&&p?p.p(g,h):(p.d(1),p=m(g),p&&(p.c(),p.m(e,o))),c.p(g,h)},i(g){u||(W(c),u=!0)},o(g){Y(c),u=!1},d(g){g&&z(e),p.d(),_[l].d()}}}s(pz,"create_fragment");function _z(n,e,t){let i,r=re,a=s(()=>(r(),r=ze(v,ke=>t(14,i=ke)),v),"$$subscribe_overrideBrightness"),o,l=re,c=s(()=>(l(),l=ze(L,ke=>t(15,o=ke)),L),"$$subscribe_useNBT"),u,d=re,m=s(()=>(d(),d=ze(x,ke=>t(16,u=ke)),x),"$$subscribe_overrideGlowColor");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l()),n.$$.on_destroy.push(()=>d());let p=!!Project?.animated_java?.enable_plugin_mode,{variant:f}=e,{billboard:_}=e,{overrideBrightness:v}=e;a();let{brightnessOverride:g}=e,{enchanted:h}=e,{glowing:b}=e,{overrideGlowColor:x}=e;m();let{glowColor:y}=e,{inheritSettings:k}=e,{invisible:C}=e,{nbt:A}=e,{shadowRadius:I}=e,{shadowStrength:S}=e,{useNBT:L}=e;c();let O={fixed:w("dialog.bone_config.billboard.options.fixed"),vertical:w("dialog.bone_config.billboard.options.vertical"),horizontal:w("dialog.bone_config.billboard.options.horizontal"),center:w("dialog.bone_config.billboard.options.center")},E=s(ke=>{let Ut;try{Ut=qe.fromString(ke)}catch(In){return{type:"error",message:w("dialog.bone_config.nbt.invalid_nbt.error",In.message)}}return Ut instanceof Ze?{type:"success",message:""}:{type:"error",message:w("dialog.bone_config.nbt.invalid_nbt.not_compound")}},"nbtChecker");function B(ke){k=ke,t(7,k)}s(B,"checkbox0_checked_binding");function H(ke){_=ke,t(0,_)}s(H,"select_value_binding");function ee(ke){b=ke,t(4,b)}s(ee,"checkbox1_checked_binding");function ae(ke){y=ke,t(6,y)}s(ae,"colorpicker_value_binding");function ne(ke){I=ke,t(10,I)}s(ne,"numberslider0_value_binding");function ve(ke){S=ke,t(11,S)}s(ve,"numberslider1_value_binding");function X(ke){v=ke,a(t(1,v))}s(X,"checkbox2_checked_binding");function j(ke){g=ke,t(2,g)}s(j,"numberslider_value_binding");function Q(ke){h=ke,t(3,h)}s(Q,"checkbox3_checked_binding");function P(ke){C=ke,t(8,C)}s(P,"checkbox4_checked_binding");function oe(ke){k=ke,t(7,k)}s(oe,"checkbox0_checked_binding_1");function Z(ke){L=ke,c(t(12,L))}s(Z,"checkbox1_checked_binding_1");function J(ke){A=ke,t(9,A)}s(J,"lineinput_value_binding");function ie(ke){_=ke,t(0,_)}s(ie,"select_value_binding_1");function U(ke){b=ke,t(4,b)}s(U,"checkbox0_checked_binding_2");function q(ke){x=ke,m(t(5,x))}s(q,"checkbox1_checked_binding_2");function ge(ke){y=ke,t(6,y)}s(ge,"colorpicker_value_binding_1");function Te(ke){I=ke,t(10,I)}s(Te,"numberslider0_value_binding_1");function Re(ke){S=ke,t(11,S)}s(Re,"numberslider1_value_binding_1");function le(ke){v=ke,a(t(1,v))}s(le,"checkbox2_checked_binding_1");function pe(ke){g=ke,t(2,g)}s(pe,"numberslider_value_binding_1");function Le(ke){h=ke,t(3,h)}return s(Le,"checkbox3_checked_binding_1"),n.$$set=ke=>{"variant"in ke&&t(13,f=ke.variant),"billboard"in ke&&t(0,_=ke.billboard),"overrideBrightness"in ke&&a(t(1,v=ke.overrideBrightness)),"brightnessOverride"in ke&&t(2,g=ke.brightnessOverride),"enchanted"in ke&&t(3,h=ke.enchanted),"glowing"in ke&&t(4,b=ke.glowing),"overrideGlowColor"in ke&&m(t(5,x=ke.overrideGlowColor)),"glowColor"in ke&&t(6,y=ke.glowColor),"inheritSettings"in ke&&t(7,k=ke.inheritSettings),"invisible"in ke&&t(8,C=ke.invisible),"nbt"in ke&&t(9,A=ke.nbt),"shadowRadius"in ke&&t(10,I=ke.shadowRadius),"shadowStrength"in ke&&t(11,S=ke.shadowStrength),"useNBT"in ke&&c(t(12,L=ke.useNBT))},[_,v,g,h,b,x,y,k,C,A,I,S,L,f,i,o,u,p,O,E,B,H,ee,ae,ne,ve,X,j,Q,P,oe,Z,J,ie,U,q,ge,Te,Re,le,pe,Le]}s(_z,"instance");var ld=class extends je{constructor(e){super(),Ie(this,e,_z,pz,Ae,{variant:13,billboard:0,overrideBrightness:1,brightnessOverride:2,enchanted:3,glowing:4,overrideGlowColor:5,glowColor:6,inheritSettings:7,invisible:8,nbt:9,shadowRadius:10,shadowStrength:11,useNBT:12},null,[-1,-1])}};s(ld,"BoneConfigDialog");var w3=ld;(()=>{let n=Blockbench.addCSS(".use_nbt_warning.svelte-q98dtr{color:var(--color-warning);font-family:var(--font-code);font-size:0.8em;margin-bottom:8px}.selected_variant_title.svelte-q98dtr{font-size:1.2em;margin-bottom:8px}.selected_variant_subtitle.svelte-q98dtr{text-align:center;font-size:0.8em;margin-bottom:8px}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();function Sp(n,e,t){if(n.parent instanceof Group){let i=t?n.parent.configs.variants[t]:n.parent.configs.default;if(i){let r=Pe.fromJSON(i);i.inherit_settings&&Sp(n.parent,r,t),e.inheritFrom(r),t?n.configs.variants[t]=e.toJSON():n.configs.default=e.toJSON()}}}s(Sp,"propagateInheritanceUp");function jp(n,e,t){for(let i of n.children){if(!(i instanceof Group))continue;let r=t?i.configs.variants[t]:i.configs.default;if(r&&r.inherit_settings){let a=Pe.fromJSON(r);a.inheritFrom(e),t?i.configs.variants[t]=a.toJSON():i.configs.default=a.toJSON(),jp(i,a,t)}}}s(jp,"propagateInheritanceDown");function gz(n){let e=n.configs.default??=new Pe().toJSON(),t=n.parent instanceof Group?n.parent.configs.default??=new Pe().toJSON():void 0;Se.selected&&!Se.selected.isDefault&&(e=n.configs.variants[Se.selected.uuid]??=new Pe().toJSON(),t=n.parent instanceof Group?n.parent.configs.variants[Se.selected.uuid]??=new Pe().toJSON():void 0);let i=t?Pe.fromJSON(t):Pe.getDefault(),r=Pe.fromJSON(e),a=new me(r.billboard),o=new me(r.overrideBrightness),l=new me(r.brightnessOverride),c=new me(r.enchanted),u=new me(r.glowing),d=new me(r.overrideGlowColor),m=new me(r.glowColor),p=new me(r.inheritSettings),f=new me(r.invisible),_=new me(r.nbt),v=new me(r.shadowRadius),g=new me(r.shadowStrength),h=new me(r.useNBT);new Pt({id:`${_e.name}:boneConfig`,title:w("dialog.bone_config.title"),width:400,component:w3,props:{variant:Se.selected,billboard:a,overrideBrightness:o,brightnessOverride:l,enchanted:c,glowing:u,overrideGlowColor:d,glowColor:m,inheritSettings:p,invisible:f,nbt:_,shadowRadius:v,shadowStrength:g,useNBT:h},preventKeybinds:!0,onConfirm(){let b=new Pe;if(b.billboard=a.get(),b.overrideBrightness=o.get(),b.brightnessOverride=l.get(),b.enchanted=c.get(),b.glowing=u.get(),b.overrideGlowColor=d.get(),b.glowColor=m.get(),b.inheritSettings=p.get(),b.invisible=f.get(),b.nbt=_.get(),b.shadowRadius=v.get(),b.shadowStrength=g.get(),b.useNBT=h.get(),b.billboard===i.billboard&&(b.billboard=void 0),b.overrideBrightness===i.overrideBrightness&&(b.overrideBrightness=void 0),b.brightnessOverride===i.brightnessOverride&&(b.brightnessOverride=void 0),b.enchanted===i.enchanted&&(b.enchanted=void 0),b.glowing===i.glowing&&(b.glowing=void 0),b.overrideGlowColor===i.overrideGlowColor&&(b.overrideGlowColor=void 0),b.glowColor===i.glowColor&&(b.glowColor=void 0),b.invisible===i.invisible&&(b.invisible=void 0),b.nbt===i.nbt&&(b.nbt=void 0),b.shadowRadius===i.shadowRadius&&(b.shadowRadius=void 0),b.shadowStrength===i.shadowStrength&&(b.shadowStrength=void 0),b.useNBT===i.useNBT&&(b.useNBT=void 0),b.checkIfEqual(Pe.fromJSON(n.configs.default))){delete n.configs.variants[Se.selected.uuid];return}Se.selected&&!Se.selected.isDefault?(b.inheritSettings&&Sp(n,b,Se.selected.uuid),n.configs.variants[Se.selected.uuid]=b.toJSON(),jp(n,b,Se.selected.uuid)):(b.inheritSettings&&Sp(n,b),n.configs.default=b.toJSON(),jp(n,b))}}).show()}s(gz,"openBoneConfigDialog");var x3=Xt(`${_e.name}:bone_config`,{icon:"settings",name:w("action.open_bone_config.name"),condition:()=>Format===et,click:()=>{gz(Group.selected)}});var k3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAA0SURBVHgB7ZKhDQBACAOPF7//vBgIC9RgCKH2khNtzYlA5GMK82jmBBMENbL8gWt8Je4QJCfXBhajwtfNAAAAAElFTkSuQmCC";function E3(n,e,t){let i=n.slice();return i[32]=e[t],i[34]=t,i}s(E3,"get_each_context");function T3(n,e,t){let i=n.slice();return i[35]=e[t],i}s(T3,"get_each_context_1");function C3(n,e,t){let i=n.slice();return i[35]=e[t],i}s(C3,"get_each_context_2");function bz(n){let e,t,i;function r(o){n[21](o)}s(r,"lineinput_value_binding_2");let a={label:w("dialog.variant_config.variant_name"),tooltip:w("dialog.variant_config.variant_name.description")};return n[1]!==void 0&&(a.value=n[1]),e=new hn({props:a}),se.push(()=>be(e,"value",r)),{c(){fe(e.$$.fragment)},m(o,l){de(e,o,l),i=!0},p(o,l){let c={};!t&&l[0]&2&&(t=!0,c.value=o[1],he(()=>t=!1)),e.$set(c)},i(o){i||(W(e.$$.fragment,o),i=!0)},o(o){Y(e.$$.fragment,o),i=!1},d(o){ue(e,o)}}}s(bz,"create_else_block_1");function vz(n){let e,t,i;function r(o){n[20](o)}s(r,"lineinput_value_binding_1");let a={label:w("dialog.variant_config.variant_name"),tooltip:w("dialog.variant_config.variant_name.description"),disabled:!0};return n[1]!==void 0&&(a.value=n[1]),e=new hn({props:a}),se.push(()=>be(e,"value",r)),{c(){fe(e.$$.fragment)},m(o,l){de(e,o,l),i=!0},p(o,l){let c={};!t&&l[0]&2&&(t=!0,c.value=o[1],he(()=>t=!1)),e.$set(c)},i(o){i||(W(e.$$.fragment,o),i=!0)},o(o){Y(e.$$.fragment,o),i=!1},d(o){ue(e,o)}}}s(vz,"create_if_block_1");function A3(n){let e,t,i,r,a=[vz,bz],o=[];function l(c,u){return c[8]?0:1}return s(l,"select_block_type"),e=l(n,[-1,-1]),t=o[e]=a[e](n),{c(){t.c(),i=St()},m(c,u){o[e].m(c,u),G(c,i,u),r=!0},p(c,u){let d=e;e=l(c,u),e===d?o[e].p(c,u):(bt(),Y(o[d],1,1,()=>{o[d]=null}),vt(),t=o[e],t?t.p(c,u):(t=o[e]=a[e](c),t.c()),W(t,1),t.m(i.parentNode,i))},i(c){r||(W(t),r=!0)},o(c){Y(t),r=!1},d(c){o[e].d(c),c&&z(i)}}}s(A3,"create_key_block_1");function S3(n){let e,t,i,r,a,o,l,c,u,d,m,p,f,_=n[7],v,g,h,b,x,y,k=B3(n);function C(I){n[28](I)}s(C,"collection_includedItems_binding");let A={label:w("dialog.variant_config.excluded_nodes.title"),tooltip:w("dialog.variant_config.bone_lists.description"),availableItemsColumnLable:w("dialog.variant_config.included_nodes.title"),availableItemsColumnTooltip:w("dialog.variant_config.included_nodes.description"),includedItemsColumnLable:w("dialog.variant_config.excluded_nodes.title"),includedItemsColumnTooltip:w("dialog.variant_config.excluded_nodes.description"),swapColumnsButtonTooltip:w("dialog.variant_config.swap_columns_button.tooltip"),availableItems:n[13]};return n[3]!==void 0&&(A.includedItems=n[3]),g=new iu({props:A}),se.push(()=>be(g,"includedItems",C)),{c(){e=V("div"),t=V("div"),t.textContent=`${w("dialog.variant_config.texture_map.title")}`,i=K(),r=V("div"),a=K(),o=V("div"),l=V("i"),l.textContent="add",u=K(),d=V("i"),p=K(),f=V("lu"),k.c(),v=K(),fe(g.$$.fragment),T(r,"class","spacer svelte-ezx8am"),T(l,"class","material-icons icon"),T(o,"class","tool"),T(o,"title",c=w("dialog.variant_config.texture_map.create_new_mapping")),T(d,"class","fa fa-question dialog_form_description"),T(d,"title",m=w("dialog.variant_config.texture_map.description")),T(e,"class","toolbar svelte-ezx8am"),$e(e,"margin","8px 0"),T(f,"class","texture-map-container svelte-ezx8am")},m(I,S){G(I,e,S),N(e,t),N(e,i),N(e,r),N(e,a),N(e,o),N(o,l),N(e,u),N(e,d),G(I,p,S),G(I,f,S),k.m(f,null),G(I,v,S),de(g,I,S),b=!0,x||(y=[De(l,"click",n[23]),De(o,"click",wz),De(d,"click",n[24])],x=!0)},p(I,S){S[0]&128&&Ae(_,_=I[7])?(k.d(1),k=B3(I),k.c(),k.m(f,null)):k.p(I,S);let L={};!h&&S[0]&8&&(h=!0,L.includedItems=I[3],he(()=>h=!1)),g.$set(L)},i(I){b||(W(g.$$.fragment,I),b=!0)},o(I){Y(g.$$.fragment,I),b=!1},d(I){I&&z(e),I&&z(p),I&&z(f),k.d(I),I&&z(v),ue(g,I),x=!1,At(y)}}}s(S3,"create_if_block");function j3(n){let e;return{c(){e=V("div"),e.textContent=`${w("dialog.variant_config.texture_map.no-mappings")} - `,T(e,"class","no-mappings svelte-ezx8am")},m(t,i){G(t,e,i)},p:re,d(t){t&&z(e)}}}s(j3,"create_else_block");function I3(n){let e,t=n[35].name+"",i,r,a,o;return{c(){e=V("option"),i=Ne(t),r=K(),e.selected=a=n[35].uuid===n[32][0],e.__value=o=`\r +

      For showing off the power of AJ with his boss fights.

      `,te=G(),fe=P("h4"),fe.textContent="Ko-fi Supporters",ae=G(),ee=P("div");for(let J=0;J{let n=Blockbench.addCSS(".content.svelte-by5dje.svelte-by5dje{display:flex;flex-direction:column;align-items:center;overflow-y:scroll;max-height:55rem;padding-right:16px}.header-container.svelte-by5dje.svelte-by5dje{display:flex;align-items:center;margin-bottom:1.5rem}.header-container.svelte-by5dje div.svelte-by5dje{display:flex;flex-direction:column;justify-content:center;margin-left:2rem}.header-container.svelte-by5dje img.svelte-by5dje{width:128px;border-radius:16px;box-shadow:4px 4px 8px -4px black}.header-container.svelte-by5dje h1.svelte-by5dje{margin:0px}.header-container.svelte-by5dje h3.svelte-by5dje{margin:0px}h4.svelte-by5dje.svelte-by5dje{color:var(--color-subtle_text);margin-top:30px;border-top:2px solid var(--color-border);padding-top:12px;padding-bottom:8px;text-transform:uppercase;text-align:center;width:100%}.socials.svelte-by5dje.svelte-by5dje{display:flex;justify-content:space-evenly;width:100%;margin-bottom:16px}.socials.svelte-by5dje a.svelte-by5dje{display:flex;flex-direction:column;align-items:center;text-decoration:none;width:64px;height:64px;padding:8px;background-color:var(--color-button);border-radius:8px}.socials.svelte-by5dje a.svelte-by5dje:hover{background-color:var(--color-selected)}.socials.svelte-by5dje a .svelte-by5dje:not(label){flex-grow:1}.socials.svelte-by5dje a label.svelte-by5dje{color:var(--color-subtle_text)}.socials.svelte-by5dje a i.svelte-by5dje{display:flex;align-items:center;font-size:2em}.socials.svelte-by5dje img.svelte-by5dje{width:32px;height:32px}.grid.svelte-by5dje.svelte-by5dje{display:grid;grid-template-columns:1fr 1fr 1fr;grid-gap:0.75rem;justify-items:center}.grid.svelte-by5dje p.svelte-by5dje{text-align:center}.grid.svelte-by5dje p.svelte-by5dje:nth-child(even){color:var(--color-subtle_text)}.grid2.svelte-by5dje.svelte-by5dje{display:grid;grid-template-columns:1fr 1fr 1fr 1fr;justify-items:center;gap:4px 8px;margin-bottom:8px}.grid2.svelte-by5dje p.svelte-by5dje{text-align:center;width:100%;box-shadow:2px 2px 4px var(--color-back);background:var(--color-button);padding:0px 4px;border-radius:4px}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();function t3(){new qt({id:`${ke.name}:aboutDialog`,title:w("dialog.about.title"),width:700,component:e3,props:{},buttons:[w("dialog.about.close_button")],preventKeybinds:!0}).show()}s(t3,"openAboutDialog");function $G(){let n=document.createElement("img");return Object.assign(n,{src:Li,width:16,height:16}),Object.assign(n.style,{position:"relative",top:"2px",borderRadius:"2px",marginRight:"6px",boxShadow:"1px 1px 1px #000000aa"}),n}s($G,"createIconImg");var qG=document.querySelector("#menu_bar"),Ca=vg(`${ke.name}:menu`,[],()=>Format===rt);Ca.label.style.display="inline-block";Ca.label.innerHTML="Animated Java";Ca.label.prepend($G());qG.appendChild(Ca.label);MenuBar.addAction(on(`${ke.name}:about`,{icon:"info",category:"animated_java",name:w("action.open_about.name"),click(){t3()}}),Ca.id);MenuBar.addAction(on(`${ke.name}:documentation`,{icon:"find_in_page",category:"animated_java",name:w("action.open_documentation.name"),click(){Blockbench.openLink("https://animated-java.dev/docs")}}),Ca.id);MenuBar.addAction(on(`${ke.name}:blueprint_settings`,{icon:"settings",category:"animated_java",name:w("action.open_blueprint_settings.name"),condition(){return Format===rt},click(){os()}}),Ca.id);MenuBar.addAction(on(`${ke.name}:export`,{icon:"insert_drive_file",category:"animated_java",name:w("action.export.name"),condition(){return Format===rt},click(){vd()}}),Ca.id);function KG(n){let e;return{c(){e=P("div"),e.textContent=`${w("dialog.bone_config.selected_variant_subtitle")}`,T(e,"class","selected_variant_subtitle svelte-q98dtr")},m(t,i){L(t,e,i)},p:ue,d(t){t&&F(e)}}}s(KG,"create_else_block_2");function WG(n){let e;return{c(){e=P("div"),e.textContent=`${w("dialog.bone_config.default_variant_subtitle")}`,T(e,"class","selected_variant_subtitle svelte-q98dtr")},m(t,i){L(t,e,i)},p:ue,d(t){t&&F(e)}}}s(WG,"create_if_block_5");function ZG(n){let e,t,i,r,a,o,l,u,c,d,m,p,f,_,g,h;function v(A){n[35](A)}s(v,"checkbox0_checked_binding_1");let y={label:w("dialog.bone_config.inherit_settings.title"),tooltip:w("dialog.bone_config.inherit_settings.description"),defaultValue:Te.prototype.inheritSettings};n[9]!==void 0&&(y.checked=n[9]),e=new tt({props:y}),le.push(()=>we(e,"checked",v));function k(A){n[36](A)}s(k,"lineinput_value_binding_1");let b={label:w("dialog.bone_config.custom_name.title"),tooltip:w("dialog.bone_config.custom_name.description"),defaultValue:Te.prototype.customName,valueChecker:n[22]};n[0]!==void 0&&(b.value=n[0]),r=new en({props:b}),le.push(()=>we(r,"value",k));function x(A){n[37](A)}s(x,"checkbox1_checked_binding_1");let E={label:w("dialog.bone_config.custom_name_visible.title"),tooltip:w("dialog.bone_config.custom_name_visible.description"),defaultValue:Te.prototype.customNameVisible};n[1]!==void 0&&(E.checked=n[1]),l=new tt({props:E}),le.push(()=>we(l,"checked",x));function C(A){n[38](A)}s(C,"checkbox2_checked_binding_1");let j={label:w("dialog.bone_config.use_nbt.title"),tooltip:w("dialog.bone_config.use_nbt.description"),defaultValue:Te.prototype.useNBT};n[14]!==void 0&&(j.checked=n[14]),d=new tt({props:j}),le.push(()=>we(d,"checked",C));let S=[QG,YG],B=[];function O(A,V){return A[17]?0:1}return s(O,"select_block_type_2"),f=O(n,[-1,-1]),_=B[f]=S[f](n),{c(){_e(e.$$.fragment),i=G(),_e(r.$$.fragment),o=G(),_e(l.$$.fragment),c=G(),_e(d.$$.fragment),p=G(),_.c(),g=Dt()},m(A,V){me(e,A,V),L(A,i,V),me(r,A,V),L(A,o,V),me(l,A,V),L(A,c,V),me(d,A,V),L(A,p,V),B[f].m(A,V),L(A,g,V),h=!0},p(A,V){let K={};!t&&V[0]&512&&(t=!0,K.checked=A[9],ye(()=>t=!1)),e.$set(K);let te={};!a&&V[0]&1&&(a=!0,te.value=A[0],ye(()=>a=!1)),r.$set(te);let fe={};!u&&V[0]&2&&(u=!0,fe.checked=A[1],ye(()=>u=!1)),l.$set(fe);let ae={};!m&&V[0]&16384&&(m=!0,ae.checked=A[14],ye(()=>m=!1)),d.$set(ae);let ee=f;f=O(A,V),f===ee?B[f].p(A,V):(Et(),Z(B[ee],1,1,()=>{B[ee]=null}),Tt(),_=B[f],_?_.p(A,V):(_=B[f]=S[f](A),_.c()),q(_,1),_.m(g.parentNode,g))},i(A){h||(q(e.$$.fragment,A),q(r.$$.fragment,A),q(l.$$.fragment,A),q(d.$$.fragment,A),q(_),h=!0)},o(A){Z(e.$$.fragment,A),Z(r.$$.fragment,A),Z(l.$$.fragment,A),Z(d.$$.fragment,A),Z(_),h=!1},d(A){de(e,A),A&&F(i),de(r,A),A&&F(o),de(l,A),A&&F(c),de(d,A),A&&F(p),B[f].d(A),A&&F(g)}}}s(ZG,"create_else_block");function XG(n){let e,t,i,r,a,o,l,u,c,d,m,p,f,_,g,h,v,y,k,b,x,E,C,j,S,B,O,A,V,K,te,fe,ae,ee;function se(X){n[23](X)}s(se,"checkbox0_checked_binding");let oe={label:w("dialog.bone_config.inherit_settings.title"),tooltip:w("dialog.bone_config.inherit_settings.description"),defaultValue:Te.prototype.inheritSettings};n[9]!==void 0&&(oe.checked=n[9]),e=new tt({props:oe}),le.push(()=>we(e,"checked",se));function xe(X){n[24](X)}s(xe,"lineinput_value_binding");let ne={label:w("dialog.bone_config.custom_name.title"),tooltip:w("dialog.bone_config.custom_name.description"),defaultValue:Te.prototype.customName,valueChecker:n[22]};n[0]!==void 0&&(ne.value=n[0]),r=new en({props:ne}),le.push(()=>we(r,"value",xe));function pe(X){n[25](X)}s(pe,"checkbox1_checked_binding");let W={label:w("dialog.bone_config.custom_name_visible.title"),tooltip:w("dialog.bone_config.custom_name_visible.description"),defaultValue:Te.prototype.customNameVisible};n[1]!==void 0&&(W.checked=n[1]),l=new tt({props:W}),le.push(()=>we(l,"checked",pe));function U(X){n[26](X)}s(U,"select_value_binding");let ce={label:w("dialog.bone_config.billboard.title"),tooltip:w("dialog.bone_config.billboard.description"),options:n[20],defaultOption:Te.prototype.billboard};n[2]!==void 0&&(ce.value=n[2]),d=new Yn({props:ce}),le.push(()=>we(d,"value",U));function J(X){n[27](X)}s(J,"checkbox2_checked_binding");let Ce={label:w("dialog.bone_config.glowing.title"),tooltip:w("dialog.bone_config.glowing.description"),defaultValue:Te.prototype.glowing};n[6]!==void 0&&(Ce.checked=n[6]),f=new tt({props:Ce}),le.push(()=>we(f,"checked",J));function Y(X){n[28](X)}s(Y,"colorpicker_value_binding");let z={label:w("dialog.bone_config.glow_color.title"),tooltip:w("dialog.bone_config.glow_color.description")};n[8]!==void 0&&(z.value=n[8]),h=new Zi({props:z}),le.push(()=>we(h,"value",Y));function be(X){n[29](X)}s(be,"numberslider0_value_binding");let H={label:w("dialog.bone_config.shadow_radius.title"),tooltip:w("dialog.bone_config.shadow_radius.description"),defaultValue:Te.prototype.shadowRadius,min:0,max:64};n[12]!==void 0&&(H.value=n[12]),k=new Ot({props:H}),le.push(()=>we(k,"value",be));function ie(X){n[30](X)}s(ie,"numberslider1_value_binding");let Ie={label:w("dialog.bone_config.shadow_strength.title"),tooltip:w("dialog.bone_config.shadow_strength.description"),defaultValue:Te.prototype.shadowStrength,min:0};n[13]!==void 0&&(Ie.value=n[13]),E=new Ot({props:Ie}),le.push(()=>we(E,"value",ie));function Q(X){n[31](X)}s(Q,"checkbox3_checked_binding");let st={label:w("dialog.bone_config.override_brightness.title"),tooltip:w("dialog.bone_config.override_brightness.description"),defaultValue:Te.prototype.overrideBrightness};n[3]!==void 0&&(st.checked=n[3]),S=new tt({props:st}),le.push(()=>we(S,"checked",Q));let at=n[16]&&r3(n);function Vt(X){n[33](X)}s(Vt,"checkbox4_checked_binding");let We={label:w("dialog.bone_config.enchanted.title"),tooltip:w("dialog.bone_config.enchanted.description"),defaultValue:Te.prototype.enchanted};n[5]!==void 0&&(We.checked=n[5]),V=new tt({props:We}),le.push(()=>we(V,"checked",Vt));function wt(X){n[34](X)}s(wt,"checkbox5_checked_binding");let Jt={label:w("dialog.bone_config.invisible.title"),tooltip:w("dialog.bone_config.invisible.description"),defaultValue:Te.prototype.invisible};return n[10]!==void 0&&(Jt.checked=n[10]),fe=new tt({props:Jt}),le.push(()=>we(fe,"checked",wt)),{c(){_e(e.$$.fragment),i=G(),_e(r.$$.fragment),o=G(),_e(l.$$.fragment),c=G(),_e(d.$$.fragment),p=G(),_e(f.$$.fragment),g=G(),_e(h.$$.fragment),y=G(),_e(k.$$.fragment),x=G(),_e(E.$$.fragment),j=G(),_e(S.$$.fragment),O=G(),at&&at.c(),A=G(),_e(V.$$.fragment),te=G(),_e(fe.$$.fragment)},m(X,et){me(e,X,et),L(X,i,et),me(r,X,et),L(X,o,et),me(l,X,et),L(X,c,et),me(d,X,et),L(X,p,et),me(f,X,et),L(X,g,et),me(h,X,et),L(X,y,et),me(k,X,et),L(X,x,et),me(E,X,et),L(X,j,et),me(S,X,et),L(X,O,et),at&&at.m(X,et),L(X,A,et),me(V,X,et),L(X,te,et),me(fe,X,et),ee=!0},p(X,et){let si={};!t&&et[0]&512&&(t=!0,si.checked=X[9],ye(()=>t=!1)),e.$set(si);let Ei={};!a&&et[0]&1&&(a=!0,Ei.value=X[0],ye(()=>a=!1)),r.$set(Ei);let Ti={};!u&&et[0]&2&&(u=!0,Ti.checked=X[1],ye(()=>u=!1)),l.$set(Ti);let Fn={};!m&&et[0]&4&&(m=!0,Fn.value=X[2],ye(()=>m=!1)),d.$set(Fn);let an={};!_&&et[0]&64&&(_=!0,an.checked=X[6],ye(()=>_=!1)),f.$set(an);let Bt={};!v&&et[0]&256&&(v=!0,Bt.value=X[8],ye(()=>v=!1)),h.$set(Bt);let mn={};!b&&et[0]&4096&&(b=!0,mn.value=X[12],ye(()=>b=!1)),k.$set(mn);let Mt={};!C&&et[0]&8192&&(C=!0,Mt.value=X[13],ye(()=>C=!1)),E.$set(Mt);let xt={};!B&&et[0]&8&&(B=!0,xt.checked=X[3],ye(()=>B=!1)),S.$set(xt),X[16]?at?(at.p(X,et),et[0]&65536&&q(at,1)):(at=r3(X),at.c(),q(at,1),at.m(A.parentNode,A)):at&&(Et(),Z(at,1,1,()=>{at=null}),Tt());let Ft={};!K&&et[0]&32&&(K=!0,Ft.checked=X[5],ye(()=>K=!1)),V.$set(Ft);let It={};!ae&&et[0]&1024&&(ae=!0,It.checked=X[10],ye(()=>ae=!1)),fe.$set(It)},i(X){ee||(q(e.$$.fragment,X),q(r.$$.fragment,X),q(l.$$.fragment,X),q(d.$$.fragment,X),q(f.$$.fragment,X),q(h.$$.fragment,X),q(k.$$.fragment,X),q(E.$$.fragment,X),q(S.$$.fragment,X),q(at),q(V.$$.fragment,X),q(fe.$$.fragment,X),ee=!0)},o(X){Z(e.$$.fragment,X),Z(r.$$.fragment,X),Z(l.$$.fragment,X),Z(d.$$.fragment,X),Z(f.$$.fragment,X),Z(h.$$.fragment,X),Z(k.$$.fragment,X),Z(E.$$.fragment,X),Z(S.$$.fragment,X),Z(at),Z(V.$$.fragment,X),Z(fe.$$.fragment,X),ee=!1},d(X){de(e,X),X&&F(i),de(r,X),X&&F(o),de(l,X),X&&F(c),de(d,X),X&&F(p),de(f,X),X&&F(g),de(h,X),X&&F(y),de(k,X),X&&F(x),de(E,X),X&&F(j),de(S,X),X&&F(O),at&&at.d(X),X&&F(A),de(V,X),X&&F(te),de(fe,X)}}}s(XG,"create_if_block");function YG(n){let e,t,i,r,a,o,l,u,c,d,m,p,f,_,g,h,v,y,k,b,x,E,C;function j(W){n[40](W)}s(j,"select_value_binding_1");let S={label:w("dialog.bone_config.billboard.title"),tooltip:w("dialog.bone_config.billboard.description"),options:n[20],defaultOption:Te.prototype.billboard};n[2]!==void 0&&(S.value=n[2]),e=new Yn({props:S}),le.push(()=>we(e,"value",j));function B(W){n[41](W)}s(B,"checkbox0_checked_binding_2");let O={label:w("dialog.bone_config.glowing.title"),tooltip:w("dialog.bone_config.glowing.description"),defaultValue:Te.prototype.glowing};n[6]!==void 0&&(O.checked=n[6]),r=new tt({props:O}),le.push(()=>we(r,"checked",B));function A(W){n[42](W)}s(A,"checkbox1_checked_binding_2");let V={label:w("dialog.bone_config.override_glow_color.title"),tooltip:w("dialog.bone_config.override_glow_color.description"),defaultValue:Te.prototype.overrideGlowColor};n[7]!==void 0&&(V.checked=n[7]),l=new tt({props:V}),le.push(()=>we(l,"checked",A));let K=n[18]&&n3(n);function te(W){n[44](W)}s(te,"numberslider0_value_binding_1");let fe={label:w("dialog.bone_config.shadow_radius.title"),tooltip:w("dialog.bone_config.shadow_radius.description"),defaultValue:Te.prototype.shadowRadius,min:0,max:15};n[12]!==void 0&&(fe.value=n[12]),m=new Ot({props:fe}),le.push(()=>we(m,"value",te));function ae(W){n[45](W)}s(ae,"numberslider1_value_binding_1");let ee={label:w("dialog.bone_config.shadow_strength.title"),tooltip:w("dialog.bone_config.shadow_strength.description"),defaultValue:Te.prototype.shadowStrength,min:0,max:15};n[13]!==void 0&&(ee.value=n[13]),_=new Ot({props:ee}),le.push(()=>we(_,"value",ae));function se(W){n[46](W)}s(se,"checkbox2_checked_binding_2");let oe={label:w("dialog.bone_config.override_brightness.title"),tooltip:w("dialog.bone_config.override_brightness.description"),defaultValue:Te.prototype.overrideBrightness};n[3]!==void 0&&(oe.checked=n[3]),v=new tt({props:oe}),le.push(()=>we(v,"checked",se));let xe=n[16]&&i3(n);function ne(W){n[48](W)}s(ne,"checkbox3_checked_binding_1");let pe={label:w("dialog.bone_config.enchanted.title"),tooltip:w("dialog.bone_config.enchanted.description"),defaultValue:Te.prototype.enchanted};return n[5]!==void 0&&(pe.checked=n[5]),x=new tt({props:pe}),le.push(()=>we(x,"checked",ne)),{c(){_e(e.$$.fragment),i=G(),_e(r.$$.fragment),o=G(),_e(l.$$.fragment),c=G(),K&&K.c(),d=G(),_e(m.$$.fragment),f=G(),_e(_.$$.fragment),h=G(),_e(v.$$.fragment),k=G(),xe&&xe.c(),b=G(),_e(x.$$.fragment)},m(W,U){me(e,W,U),L(W,i,U),me(r,W,U),L(W,o,U),me(l,W,U),L(W,c,U),K&&K.m(W,U),L(W,d,U),me(m,W,U),L(W,f,U),me(_,W,U),L(W,h,U),me(v,W,U),L(W,k,U),xe&&xe.m(W,U),L(W,b,U),me(x,W,U),C=!0},p(W,U){let ce={};!t&&U[0]&4&&(t=!0,ce.value=W[2],ye(()=>t=!1)),e.$set(ce);let J={};!a&&U[0]&64&&(a=!0,J.checked=W[6],ye(()=>a=!1)),r.$set(J);let Ce={};!u&&U[0]&128&&(u=!0,Ce.checked=W[7],ye(()=>u=!1)),l.$set(Ce),W[18]?K?(K.p(W,U),U[0]&262144&&q(K,1)):(K=n3(W),K.c(),q(K,1),K.m(d.parentNode,d)):K&&(Et(),Z(K,1,1,()=>{K=null}),Tt());let Y={};!p&&U[0]&4096&&(p=!0,Y.value=W[12],ye(()=>p=!1)),m.$set(Y);let z={};!g&&U[0]&8192&&(g=!0,z.value=W[13],ye(()=>g=!1)),_.$set(z);let be={};!y&&U[0]&8&&(y=!0,be.checked=W[3],ye(()=>y=!1)),v.$set(be),W[16]?xe?(xe.p(W,U),U[0]&65536&&q(xe,1)):(xe=i3(W),xe.c(),q(xe,1),xe.m(b.parentNode,b)):xe&&(Et(),Z(xe,1,1,()=>{xe=null}),Tt());let H={};!E&&U[0]&32&&(E=!0,H.checked=W[5],ye(()=>E=!1)),x.$set(H)},i(W){C||(q(e.$$.fragment,W),q(r.$$.fragment,W),q(l.$$.fragment,W),q(K),q(m.$$.fragment,W),q(_.$$.fragment,W),q(v.$$.fragment,W),q(xe),q(x.$$.fragment,W),C=!0)},o(W){Z(e.$$.fragment,W),Z(r.$$.fragment,W),Z(l.$$.fragment,W),Z(K),Z(m.$$.fragment,W),Z(_.$$.fragment,W),Z(v.$$.fragment,W),Z(xe),Z(x.$$.fragment,W),C=!1},d(W){de(e,W),W&&F(i),de(r,W),W&&F(o),de(l,W),W&&F(c),K&&K.d(W),W&&F(d),de(m,W),W&&F(f),de(_,W),W&&F(h),de(v,W),W&&F(k),xe&&xe.d(W),W&&F(b),de(x,W)}}}s(YG,"create_else_block_1");function QG(n){let e,t,i,r,a;function o(u){n[39](u)}s(o,"lineinput_value_binding_2");let l={label:w("dialog.bone_config.nbt.title"),tooltip:w("dialog.bone_config.nbt.description"),defaultValue:Te.prototype.nbt,valueChecker:n[21]};return n[11]!==void 0&&(l.value=n[11]),i=new en({props:l}),le.push(()=>we(i,"value",o)),{c(){e=P("p"),e.textContent=`${w("dialog.bone_config.use_nbt.use_nbt_warning")}`,t=G(),_e(i.$$.fragment),T(e,"class","use_nbt_warning svelte-q98dtr")},m(u,c){L(u,e,c),L(u,t,c),me(i,u,c),a=!0},p(u,c){let d={};!r&&c[0]&2048&&(r=!0,d.value=u[11],ye(()=>r=!1)),i.$set(d)},i(u){a||(q(i.$$.fragment,u),a=!0)},o(u){Z(i.$$.fragment,u),a=!1},d(u){u&&F(e),u&&F(t),de(i,u)}}}s(QG,"create_if_block_2");function n3(n){let e,t,i;function r(o){n[43](o)}s(r,"colorpicker_value_binding_1");let a={label:w("dialog.bone_config.glow_color.title"),tooltip:w("dialog.bone_config.glow_color.description")};return n[8]!==void 0&&(a.value=n[8]),e=new Zi({props:a}),le.push(()=>we(e,"value",r)),{c(){_e(e.$$.fragment)},m(o,l){me(e,o,l),i=!0},p(o,l){let u={};!t&&l[0]&256&&(t=!0,u.value=o[8],ye(()=>t=!1)),e.$set(u)},i(o){i||(q(e.$$.fragment,o),i=!0)},o(o){Z(e.$$.fragment,o),i=!1},d(o){de(e,o)}}}s(n3,"create_if_block_4");function i3(n){let e,t,i;function r(o){n[47](o)}s(r,"numberslider_value_binding_1");let a={label:w("dialog.bone_config.brightness_override.title"),tooltip:w("dialog.bone_config.brightness_override.description"),defaultValue:Te.prototype.brightnessOverride,min:0,max:15};return n[4]!==void 0&&(a.value=n[4]),e=new Ot({props:a}),le.push(()=>we(e,"value",r)),{c(){_e(e.$$.fragment)},m(o,l){me(e,o,l),i=!0},p(o,l){let u={};!t&&l[0]&16&&(t=!0,u.value=o[4],ye(()=>t=!1)),e.$set(u)},i(o){i||(q(e.$$.fragment,o),i=!0)},o(o){Z(e.$$.fragment,o),i=!1},d(o){de(e,o)}}}s(i3,"create_if_block_3");function r3(n){let e,t,i;function r(o){n[32](o)}s(r,"numberslider_value_binding");let a={label:w("dialog.bone_config.brightness_override.title"),tooltip:w("dialog.bone_config.brightness_override.description"),defaultValue:Te.prototype.brightnessOverride,min:0,max:15};return n[4]!==void 0&&(a.value=n[4]),e=new Ot({props:a}),le.push(()=>we(e,"value",r)),{c(){_e(e.$$.fragment)},m(o,l){me(e,o,l),i=!0},p(o,l){let u={};!t&&l[0]&16&&(t=!0,u.value=o[4],ye(()=>t=!1)),e.$set(u)},i(o){i||(q(e.$$.fragment,o),i=!0)},o(o){Z(e.$$.fragment,o),i=!1},d(o){de(e,o)}}}s(r3,"create_if_block_1");function eU(n){let e,t,i=w("dialog.bone_config.selected_variant",n[15].displayName)+"",r,a,o,l,u,c;function d(h,v){return h[15].isDefault?WG:KG}s(d,"select_block_type");let m=d(n,[-1,-1]),p=m(n),f=[XG,ZG],_=[];function g(h,v){return h[19]?0:1}return s(g,"select_block_type_1"),l=g(n,[-1,-1]),u=_[l]=f[l](n),{c(){e=P("div"),t=P("div"),r=Re(i),a=G(),p.c(),o=G(),u.c(),T(t,"class","selected_variant_title svelte-q98dtr")},m(h,v){L(h,e,v),N(e,t),N(t,r),N(e,a),p.m(e,null),N(e,o),_[l].m(e,null),c=!0},p(h,v){(!c||v[0]&32768)&&i!==(i=w("dialog.bone_config.selected_variant",h[15].displayName)+"")&&ot(r,i),m===(m=d(h,v))&&p?p.p(h,v):(p.d(1),p=m(h),p&&(p.c(),p.m(e,o))),u.p(h,v)},i(h){c||(q(u),c=!0)},o(h){Z(u),c=!1},d(h){h&&F(e),p.d(),_[l].d()}}}s(eU,"create_fragment");function tU(n,e,t){let i,r=ue,a=s(()=>(r(),r=ze(v,X=>t(16,i=X)),v),"$$subscribe_overrideBrightness"),o,l=ue,u=s(()=>(l(),l=ze(A,X=>t(17,o=X)),A),"$$subscribe_useNBT"),c,d=ue,m=s(()=>(d(),d=ze(x,X=>t(18,c=X)),x),"$$subscribe_overrideGlowColor");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l()),n.$$.on_destroy.push(()=>d());let p=!!Project?.animated_java?.enable_plugin_mode,{variant:f}=e,{customName:_}=e,{customNameVisible:g}=e,{billboard:h}=e,{overrideBrightness:v}=e;a();let{brightnessOverride:y}=e,{enchanted:k}=e,{glowing:b}=e,{overrideGlowColor:x}=e;m();let{glowColor:E}=e,{inheritSettings:C}=e,{invisible:j}=e,{nbt:S}=e,{shadowRadius:B}=e,{shadowStrength:O}=e,{useNBT:A}=e;u();let V={fixed:w("dialog.bone_config.billboard.options.fixed"),vertical:w("dialog.bone_config.billboard.options.vertical"),horizontal:w("dialog.bone_config.billboard.options.horizontal"),center:w("dialog.bone_config.billboard.options.center")},K=s(X=>{let et;try{et=Ze.fromString(X)}catch(si){return{type:"error",message:w("dialog.bone_config.nbt.invalid_nbt.error",si.message)}}return et instanceof Ye?{type:"success",message:""}:{type:"error",message:w("dialog.bone_config.nbt.invalid_nbt.not_compound")}},"nbtChecker"),te=s(X=>{if(X==="")return{type:"success",message:""};try{$t.fromString(X)}catch(et){return{type:"error",message:w("dialog.bone_config.custom_name.invalid_json.error",et.message)}}return{type:"success",message:""}},"customNameChecker");function fe(X){C=X,t(9,C)}s(fe,"checkbox0_checked_binding");function ae(X){_=X,t(0,_)}s(ae,"lineinput_value_binding");function ee(X){g=X,t(1,g)}s(ee,"checkbox1_checked_binding");function se(X){h=X,t(2,h)}s(se,"select_value_binding");function oe(X){b=X,t(6,b)}s(oe,"checkbox2_checked_binding");function xe(X){E=X,t(8,E)}s(xe,"colorpicker_value_binding");function ne(X){B=X,t(12,B)}s(ne,"numberslider0_value_binding");function pe(X){O=X,t(13,O)}s(pe,"numberslider1_value_binding");function W(X){v=X,a(t(3,v))}s(W,"checkbox3_checked_binding");function U(X){y=X,t(4,y)}s(U,"numberslider_value_binding");function ce(X){k=X,t(5,k)}s(ce,"checkbox4_checked_binding");function J(X){j=X,t(10,j)}s(J,"checkbox5_checked_binding");function Ce(X){C=X,t(9,C)}s(Ce,"checkbox0_checked_binding_1");function Y(X){_=X,t(0,_)}s(Y,"lineinput_value_binding_1");function z(X){g=X,t(1,g)}s(z,"checkbox1_checked_binding_1");function be(X){A=X,u(t(14,A))}s(be,"checkbox2_checked_binding_1");function H(X){S=X,t(11,S)}s(H,"lineinput_value_binding_2");function ie(X){h=X,t(2,h)}s(ie,"select_value_binding_1");function Ie(X){b=X,t(6,b)}s(Ie,"checkbox0_checked_binding_2");function Q(X){x=X,m(t(7,x))}s(Q,"checkbox1_checked_binding_2");function st(X){E=X,t(8,E)}s(st,"colorpicker_value_binding_1");function at(X){B=X,t(12,B)}s(at,"numberslider0_value_binding_1");function Vt(X){O=X,t(13,O)}s(Vt,"numberslider1_value_binding_1");function We(X){v=X,a(t(3,v))}s(We,"checkbox2_checked_binding_2");function wt(X){y=X,t(4,y)}s(wt,"numberslider_value_binding_1");function Jt(X){k=X,t(5,k)}return s(Jt,"checkbox3_checked_binding_1"),n.$$set=X=>{"variant"in X&&t(15,f=X.variant),"customName"in X&&t(0,_=X.customName),"customNameVisible"in X&&t(1,g=X.customNameVisible),"billboard"in X&&t(2,h=X.billboard),"overrideBrightness"in X&&a(t(3,v=X.overrideBrightness)),"brightnessOverride"in X&&t(4,y=X.brightnessOverride),"enchanted"in X&&t(5,k=X.enchanted),"glowing"in X&&t(6,b=X.glowing),"overrideGlowColor"in X&&m(t(7,x=X.overrideGlowColor)),"glowColor"in X&&t(8,E=X.glowColor),"inheritSettings"in X&&t(9,C=X.inheritSettings),"invisible"in X&&t(10,j=X.invisible),"nbt"in X&&t(11,S=X.nbt),"shadowRadius"in X&&t(12,B=X.shadowRadius),"shadowStrength"in X&&t(13,O=X.shadowStrength),"useNBT"in X&&u(t(14,A=X.useNBT))},[_,g,h,v,y,k,b,x,E,C,j,S,B,O,A,f,i,o,c,p,V,K,te,fe,ae,ee,se,oe,xe,ne,pe,W,U,ce,J,Ce,Y,z,be,H,ie,Ie,Q,st,at,Vt,We,wt,Jt]}s(tU,"instance");var wd=class extends Be{constructor(e){super(),De(this,e,tU,eU,Oe,{variant:15,customName:0,customNameVisible:1,billboard:2,overrideBrightness:3,brightnessOverride:4,enchanted:5,glowing:6,overrideGlowColor:7,glowColor:8,inheritSettings:9,invisible:10,nbt:11,shadowRadius:12,shadowStrength:13,useNBT:14},null,[-1,-1])}};s(wd,"BoneConfigDialog");var a3=wd;(()=>{let n=Blockbench.addCSS(".use_nbt_warning.svelte-q98dtr{color:var(--color-warning);font-family:var(--font-code);font-size:0.8em;margin-bottom:8px}.selected_variant_title.svelte-q98dtr{font-size:1.2em;margin-bottom:8px}.selected_variant_subtitle.svelte-q98dtr{text-align:center;font-size:0.8em;margin-bottom:8px}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();function Hp(n,e,t){if(n.parent instanceof Group){let i=t?n.parent.configs.variants[t]:n.parent.configs.default;if(i){let r=Te.fromJSON(i);i.inherit_settings&&Hp(n.parent,r,t),e.inheritFrom(r),t?n.configs.variants[t]=e.toJSON():n.configs.default=e.toJSON()}}}s(Hp,"propagateInheritanceUp");function $p(n,e,t){for(let i of n.children){if(!(i instanceof Group))continue;let r=t?i.configs.variants[t]:i.configs.default;if(r&&r.inherit_settings){let a=Te.fromJSON(r);a.inheritFrom(e),t?i.configs.variants[t]=a.toJSON():i.configs.default=a.toJSON(),$p(i,a,t)}}}s($p,"propagateInheritanceDown");function nU(n){let e=n.configs.default??=new Te().toJSON(),t=n.parent instanceof Group?n.parent.configs.default??=new Te().toJSON():void 0;Ne.selected&&!Ne.selected.isDefault&&(e=n.configs.variants[Ne.selected.uuid]??=new Te().toJSON(),t=n.parent instanceof Group?n.parent.configs.variants[Ne.selected.uuid]??=new Te().toJSON():void 0);let i=t?Te.fromJSON(t):Te.getDefault(),r=Te.fromJSON(e),a=new ge(r.customName),o=new ge(r.customNameVisible),l=new ge(r.billboard),u=new ge(r.overrideBrightness),c=new ge(r.brightnessOverride),d=new ge(r.enchanted),m=new ge(r.glowing),p=new ge(r.overrideGlowColor),f=new ge(r.glowColor),_=new ge(r.inheritSettings),g=new ge(r.invisible),h=new ge(r.nbt),v=new ge(r.shadowRadius),y=new ge(r.shadowStrength),k=new ge(r.useNBT);new qt({id:`${ke.name}:boneConfig`,title:w("dialog.bone_config.title"),width:400,component:a3,props:{variant:Ne.selected,customName:a,customNameVisible:o,billboard:l,overrideBrightness:u,brightnessOverride:c,enchanted:d,glowing:m,overrideGlowColor:p,glowColor:f,inheritSettings:_,invisible:g,nbt:h,shadowRadius:v,shadowStrength:y,useNBT:k},preventKeybinds:!0,onConfirm(){let b=new Te;if(b.customName=a.get(),b.customNameVisible=o.get(),b.billboard=l.get(),b.overrideBrightness=u.get(),b.brightnessOverride=c.get(),b.enchanted=d.get(),b.glowing=m.get(),b.overrideGlowColor=p.get(),b.glowColor=f.get(),b.inheritSettings=_.get(),b.invisible=g.get(),b.nbt=h.get(),b.shadowRadius=v.get(),b.shadowStrength=y.get(),b.useNBT=k.get(),b.customName===i.customName&&(b.customName=void 0),b.customNameVisible===i.customNameVisible&&(b.customNameVisible=void 0),b.billboard===i.billboard&&(b.billboard=void 0),b.overrideBrightness===i.overrideBrightness&&(b.overrideBrightness=void 0),b.brightnessOverride===i.brightnessOverride&&(b.brightnessOverride=void 0),b.enchanted===i.enchanted&&(b.enchanted=void 0),b.glowing===i.glowing&&(b.glowing=void 0),b.overrideGlowColor===i.overrideGlowColor&&(b.overrideGlowColor=void 0),b.glowColor===i.glowColor&&(b.glowColor=void 0),b.invisible===i.invisible&&(b.invisible=void 0),b.nbt===i.nbt&&(b.nbt=void 0),b.shadowRadius===i.shadowRadius&&(b.shadowRadius=void 0),b.shadowStrength===i.shadowStrength&&(b.shadowStrength=void 0),b.useNBT===i.useNBT&&(b.useNBT=void 0),b.checkIfEqual(Te.fromJSON(n.configs.default))){delete n.configs.variants[Ne.selected.uuid];return}Ne.selected&&!Ne.selected.isDefault?(b.inheritSettings&&Hp(n,b,Ne.selected.uuid),n.configs.variants[Ne.selected.uuid]=b.toJSON(),$p(n,b,Ne.selected.uuid)):(b.inheritSettings&&Hp(n,b),n.configs.default=b.toJSON(),$p(n,b))}}).show()}s(nU,"openBoneConfigDialog");var o3=on(`${ke.name}:bone_config`,{icon:"settings",name:w("action.open_bone_config.name"),condition:()=>Format===rt,click:()=>{nU(Group.selected)}});var s3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAA0SURBVHgB7ZKhDQBACAOPF7//vBgIC9RgCKH2khNtzYlA5GMK82jmBBMENbL8gWt8Je4QJCfXBhajwtfNAAAAAElFTkSuQmCC";function l3(n,e,t){let i=n.slice();return i[32]=e[t],i[34]=t,i}s(l3,"get_each_context");function c3(n,e,t){let i=n.slice();return i[35]=e[t],i}s(c3,"get_each_context_1");function u3(n,e,t){let i=n.slice();return i[35]=e[t],i}s(u3,"get_each_context_2");function rU(n){let e,t,i;function r(o){n[21](o)}s(r,"lineinput_value_binding_2");let a={label:w("dialog.variant_config.variant_name"),tooltip:w("dialog.variant_config.variant_name.description")};return n[1]!==void 0&&(a.value=n[1]),e=new en({props:a}),le.push(()=>we(e,"value",r)),{c(){_e(e.$$.fragment)},m(o,l){me(e,o,l),i=!0},p(o,l){let u={};!t&&l[0]&2&&(t=!0,u.value=o[1],ye(()=>t=!1)),e.$set(u)},i(o){i||(q(e.$$.fragment,o),i=!0)},o(o){Z(e.$$.fragment,o),i=!1},d(o){de(e,o)}}}s(rU,"create_else_block_1");function aU(n){let e,t,i;function r(o){n[20](o)}s(r,"lineinput_value_binding_1");let a={label:w("dialog.variant_config.variant_name"),tooltip:w("dialog.variant_config.variant_name.description"),disabled:!0};return n[1]!==void 0&&(a.value=n[1]),e=new en({props:a}),le.push(()=>we(e,"value",r)),{c(){_e(e.$$.fragment)},m(o,l){me(e,o,l),i=!0},p(o,l){let u={};!t&&l[0]&2&&(t=!0,u.value=o[1],ye(()=>t=!1)),e.$set(u)},i(o){i||(q(e.$$.fragment,o),i=!0)},o(o){Z(e.$$.fragment,o),i=!1},d(o){de(e,o)}}}s(aU,"create_if_block_1");function d3(n){let e,t,i,r,a=[aU,rU],o=[];function l(u,c){return u[8]?0:1}return s(l,"select_block_type"),e=l(n,[-1,-1]),t=o[e]=a[e](n),{c(){t.c(),i=Dt()},m(u,c){o[e].m(u,c),L(u,i,c),r=!0},p(u,c){let d=e;e=l(u,c),e===d?o[e].p(u,c):(Et(),Z(o[d],1,1,()=>{o[d]=null}),Tt(),t=o[e],t?t.p(u,c):(t=o[e]=a[e](u),t.c()),q(t,1),t.m(i.parentNode,i))},i(u){r||(q(t),r=!0)},o(u){Z(t),r=!1},d(u){o[e].d(u),u&&F(i)}}}s(d3,"create_key_block_1");function f3(n){let e,t,i,r,a,o,l,u,c,d,m,p,f,_=n[7],g,h,v,y,k,b,x=h3(n);function E(j){n[28](j)}s(E,"collection_includedItems_binding");let C={label:w("dialog.variant_config.excluded_nodes.title"),tooltip:w("dialog.variant_config.bone_lists.description"),availableItemsColumnLable:w("dialog.variant_config.included_nodes.title"),availableItemsColumnTooltip:w("dialog.variant_config.included_nodes.description"),includedItemsColumnLable:w("dialog.variant_config.excluded_nodes.title"),includedItemsColumnTooltip:w("dialog.variant_config.excluded_nodes.description"),swapColumnsButtonTooltip:w("dialog.variant_config.swap_columns_button.tooltip"),availableItems:n[13]};return n[3]!==void 0&&(C.includedItems=n[3]),h=new ju({props:C}),le.push(()=>we(h,"includedItems",E)),{c(){e=P("div"),t=P("div"),t.textContent=`${w("dialog.variant_config.texture_map.title")}`,i=G(),r=P("div"),a=G(),o=P("div"),l=P("i"),l.textContent="add",c=G(),d=P("i"),p=G(),f=P("lu"),x.c(),g=G(),_e(h.$$.fragment),T(r,"class","spacer svelte-ezx8am"),T(l,"class","material-icons icon"),T(o,"class","tool"),T(o,"title",u=w("dialog.variant_config.texture_map.create_new_mapping")),T(d,"class","fa fa-question dialog_form_description"),T(d,"title",m=w("dialog.variant_config.texture_map.description")),T(e,"class","toolbar svelte-ezx8am"),Ge(e,"margin","8px 0"),T(f,"class","texture-map-container svelte-ezx8am")},m(j,S){L(j,e,S),N(e,t),N(e,i),N(e,r),N(e,a),N(e,o),N(o,l),N(e,c),N(e,d),L(j,p,S),L(j,f,S),x.m(f,null),L(j,g,S),me(h,j,S),y=!0,k||(b=[Le(l,"click",n[23]),Le(o,"click",sU),Le(d,"click",n[24])],k=!0)},p(j,S){S[0]&128&&Oe(_,_=j[7])?(x.d(1),x=h3(j),x.c(),x.m(f,null)):x.p(j,S);let B={};!v&&S[0]&8&&(v=!0,B.includedItems=j[3],ye(()=>v=!1)),h.$set(B)},i(j){y||(q(h.$$.fragment,j),y=!0)},o(j){Z(h.$$.fragment,j),y=!1},d(j){j&&F(e),j&&F(p),j&&F(f),x.d(j),j&&F(g),de(h,j),k=!1,Lt(b)}}}s(f3,"create_if_block");function m3(n){let e;return{c(){e=P("div"),e.textContent=`${w("dialog.variant_config.texture_map.no-mappings")} + `,T(e,"class","no-mappings svelte-ezx8am")},m(t,i){L(t,e,i)},p:ue,d(t){t&&F(e)}}}s(m3,"create_else_block");function p3(n){let e,t=n[35].name+"",i,r,a,o;return{c(){e=P("option"),i=Re(t),r=G(),e.selected=a=n[35].uuid===n[32][0],e.__value=o=`\r `+n[35].name+`\r - `,e.value=e.__value},m(l,c){G(l,e,c),N(e,i),N(e,r)},p(l,c){c[0]&64&&a!==(a=l[35].uuid===l[32][0])&&(e.selected=a)},d(l){l&&z(e)}}}s(I3,"create_each_block_2");function O3(n){let e,t=n[35].name+"",i,r,a,o;return{c(){e=V("option"),i=Ne(t),r=K(),e.selected=a=n[35].uuid===n[32][1],e.__value=o=`\r + `,e.value=e.__value},m(l,u){L(l,e,u),N(e,i),N(e,r)},p(l,u){u[0]&64&&a!==(a=l[35].uuid===l[32][0])&&(e.selected=a)},d(l){l&&F(e)}}}s(p3,"create_each_block_2");function _3(n){let e,t=n[35].name+"",i,r,a,o;return{c(){e=P("option"),i=Re(t),r=G(),e.selected=a=n[35].uuid===n[32][1],e.__value=o=`\r `+n[35].name+`\r - `,e.value=e.__value},m(l,c){G(l,e,c),N(e,i),N(e,r)},p(l,c){c[0]&64&&a!==(a=l[35].uuid===l[32][1])&&(e.selected=a)},d(l){l&&z(e)}}}s(O3,"create_each_block_1");function N3(n){let e,t,i,r,a,o,l,c,u,d,m,p,f,_,v,g,h,b,x,y,k,C,A,I=n[11],S=[];for(let ee=0;eebe(t,"value",_));let g=A3(n);function h(y){n[22](y)}s(h,"checkbox_checked_binding");let b={label:w("dialog.variant_config.generate_name_from_display_name"),tooltip:w("dialog.variant_config.generate_name_from_display_name.description")};n[2]!==void 0&&(b.checked=n[2]),l=new it({props:b}),se.push(()=>be(l,"checked",h));let x=!n[4].isDefault&&S3(n);return{c(){e=V("div"),fe(t.$$.fragment),r=K(),g.c(),o=K(),fe(l.$$.fragment),u=K(),d=V("div"),m=Ne(n[10]),p=K(),x&&x.c(),T(d,"class","uuid svelte-ezx8am"),T(e,"class","dialog-container svelte-ezx8am")},m(y,k){G(y,e,k),de(t,e,null),N(e,r),g.m(e,null),N(e,o),de(l,e,null),N(e,u),N(e,d),N(d,m),N(e,p),x&&x.m(e,null),f=!0},p(y,k){let C={};!i&&k[0]&1&&(i=!0,C.value=y[0],he(()=>i=!1)),t.$set(C),k[0]&512&&Ae(a,a=y[9])?(bt(),Y(g,1,1,re),vt(),g=A3(y),g.c(),W(g,1),g.m(e,o)):g.p(y,k);let A={};!c&&k[0]&4&&(c=!0,A.checked=y[2],he(()=>c=!1)),l.$set(A),(!f||k[0]&1024)&&tt(m,y[10]),y[4].isDefault?x&&(bt(),Y(x,1,1,()=>{x=null}),vt()):x?(x.p(y,k),k[0]&16&&W(x,1)):(x=S3(y),x.c(),W(x,1),x.m(e,null))},i(y){f||(W(t.$$.fragment,y),W(g),W(l.$$.fragment,y),W(x),f=!0)},o(y){Y(t.$$.fragment,y),Y(g),Y(l.$$.fragment,y),Y(x),f=!1},d(y){y&&z(e),ue(t),g.d(y),ue(l),x&&x.d()}}}s(yz,"create_fragment");var wz=s(()=>{},"click_handler_1");function xz(n,e,t){let i,r=re,a=s(()=>(r(),r=ze(g,U=>t(29,i=U)),g),"$$subscribe_displayName"),o,l=re,c=s(()=>(l(),l=ze(y,U=>t(8,o=U)),y),"$$subscribe_generateNameFromDisplayName"),u,d=re,m=s(()=>(d(),d=ze(h,U=>t(9,u=U)),h),"$$subscribe_name"),p,f=re,_=s(()=>(f(),f=ze(b,U=>t(10,p=U)),b),"$$subscribe_uuid");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l()),n.$$.on_destroy.push(()=>d()),n.$$.on_destroy.push(()=>f());let{variant:v}=e,{displayName:g}=e;a();let{name:h}=e;m();let{uuid:b}=e;_();let{textureMap:x}=e,{generateNameFromDisplayName:y}=e;c();let{excludedNodes:k}=e,C=[...Texture.all,zn],A=[...Texture.all],I=C,S=Au(k.get(),{groupsOnly:!0,excludeEmptyGroups:!0}),L=0;g.subscribe(U=>{o&&h.set(Se.makeNameUnique(v,U))}),y.subscribe(U=>{U&&h.set(Se.makeNameUnique(v,i))});function O(){let U=ae()[0];U&&(x.add(U.uuid,U.uuid),t(7,L++,L))}s(O,"createTextureMapping");function E(U){x.delete(U),t(7,L++,L)}s(E,"deleteTextureMapping");function B(U){let q=C.find(ge=>ge.uuid===U);return q?q.img.src:k3}s(B,"getTextureSrc");function H(U,q){let Te=U.target.value.trim(),Re=A.find(pe=>pe.name===Te)?.uuid;if(!Re){console.error(`Failed to find new primary texture with the name: ${Te}`);return}let le=x.get(q);if(!le){console.error(`Failed to find secondary texture with the uuid: ${q}`);return}x.delete(q),x.add(Re,le),t(7,L++,L)}s(H,"selectNewPrimaryTexture");function ee(U,q){let Te=U.target.value.trim(),Re=I.find(le=>le.name===Te)?.uuid;if(!Re){console.error(`Failed to find new secondary texture with the name: ${Te}`);return}x.add(q,Re),t(7,L++,L)}s(ee,"selectNewSecondaryTexture");function ae(){let U=[...x.map.keys()];return A.filter(q=>!U.includes(q.uuid))}s(ae,"getUnusedPrimaryTextures");function ne(U){g=U,a(t(0,g))}s(ne,"lineinput_value_binding");function ve(U){h=U,m(t(1,h))}s(ve,"lineinput_value_binding_1");function X(U){h=U,m(t(1,h))}s(X,"lineinput_value_binding_2");function j(U){y=U,c(t(2,y))}s(j,"checkbox_checked_binding");let Q=s(()=>O(),"click_handler"),P=s(()=>{let U=w("dialog.variant_config.texture_map.description");Blockbench.showQuickMessage(U,50*U.length)},"click_handler_2"),oe=s((U,q)=>H(q,U[0]),"change_handler"),Z=s((U,q)=>ee(q,U[0]),"change_handler_1"),J=s(U=>E(U[0]),"click_handler_3");function ie(U){k=U,t(3,k)}return s(ie,"collection_includedItems_binding"),n.$$set=U=>{"variant"in U&&t(4,v=U.variant),"displayName"in U&&a(t(0,g=U.displayName)),"name"in U&&m(t(1,h=U.name)),"uuid"in U&&_(t(5,b=U.uuid)),"textureMap"in U&&t(6,x=U.textureMap),"generateNameFromDisplayName"in U&&c(t(2,y=U.generateNameFromDisplayName)),"excludedNodes"in U&&t(3,k=U.excludedNodes)},[g,h,y,k,v,b,x,L,o,u,p,A,I,S,O,E,B,H,ee,ne,ve,X,j,Q,P,oe,Z,J,ie]}s(xz,"instance");var cd=class extends je{constructor(e){super(),Ie(this,e,xz,yz,Ae,{variant:4,displayName:0,name:1,uuid:5,textureMap:6,generateNameFromDisplayName:2,excludedNodes:3},null,[-1,-1])}};s(cd,"VariantConfigDialog");var D3=cd;(()=>{let n=Blockbench.addCSS(`.dialog-container.svelte-ezx8am{display:flex;flex-direction:column}.uuid.svelte-ezx8am{color:var(--color-subtle_text);font-style:italic;text-align:center;font-size:14px;user-select:all}.no-mappings.svelte-ezx8am{color:var(--color-subtle_text);font-style:italic;text-align:center}.img-container.svelte-ezx8am{display:flex;align-items:flex-start;width:128px;height:128px;pointer-events:none;background:repeating-conic-gradient(var(--color-dark) 0% 25%, transparent 0% 50%) 50% /\r - 16px 16px}img.svelte-ezx8am{width:128px;pointer-events:none}.texture-mapping-item.svelte-ezx8am{display:flex;align-items:center;justify-content:space-between}.texture-mapping-item-dropdown-container.svelte-ezx8am{position:relative;flex-grow:1;height:164px;display:flex;flex-direction:column;align-items:center;justify-content:center}.texture-mapping-item-dropdown.svelte-ezx8am{display:flex;flex-direction:column;align-items:center;max-width:128px}.texture-map-container.svelte-ezx8am{display:flex;flex-direction:column;border:1px solid var(--color-border);background-color:var(--color-back);padding:4px;overflow-y:auto;max-height:600px;overflow-y:auto;max-height:16rem}.spacer.svelte-ezx8am{flex-grow:1}.toolbar.svelte-ezx8am{display:flex;flex-direction:row;align-items:center}`);function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();function ud(n){let e=new me(n.displayName),t=new me(n.name),i=new me(n.uuid),r=n.textureMap.copy(),a=new me(n.generateNameFromDisplayName),o=new me(n.excludedNodes);new Pt({id:`${_e.name}:variantConfig`,title:w("dialog.variant_config.title"),width:512,component:D3,props:{variant:n,displayName:e,name:t,uuid:i,textureMap:r,generateNameFromDisplayName:a,excludedNodes:o},preventKeybinds:!0,onConfirm(){n.displayName=e.get(),n.name=t.get(),n.uuid=i.get(),n.textureMap=r,n.generateNameFromDisplayName=a.get(),n.excludedNodes=o.get(),te.UPDATE_VARIANT.dispatch(n),n.select()}}).show()}s(ud,"openVariantConfigDialog");function R3(n,e,t){let i=n.slice();return i[12]=e[t],i}s(R3,"get_each_context");function kz(n){let e,t,i,r=n[12].value.displayName+"",a,o,l,c,u,d,m,p,f,_,v,g;function h(){return n[7](n[12])}s(h,"click_handler_3");function b(I,S){return Se.selected===I[12].value?Cz:Tz}s(b,"select_block_type_1");let x=b(n,-1),y=x(n);function k(I,S){return I[12].value.isDefault?Az:Sz}s(k,"select_block_type_2");let C=k(n,-1),A=C(n);return{c(){e=V("i"),e.textContent="texture",t=K(),i=V("div"),a=Ne(r),o=K(),l=V("div"),c=K(),u=V("i"),d=Ne("edit"),p=K(),y.c(),f=K(),A.c(),_=St(),T(e,"class","material-icons icon in_list_button"),T(i,"class","variant_item_name svelte-1deur0j"),T(l,"class","spacer svelte-1deur0j"),T(u,"class","material-icons icon in_list_button"),T(u,"title",m=w("panel.variants.tool.edit_variant"))},m(I,S){G(I,e,S),G(I,t,S),G(I,i,S),N(i,a),G(I,o,S),G(I,l,S),G(I,c,S),G(I,u,S),N(u,d),G(I,p,S),y.m(I,S),G(I,f,S),A.m(I,S),G(I,_,S),v||(g=De(u,"click",h),v=!0)},p(I,S){n=I,S&1&&r!==(r=n[12].value.displayName+"")&&tt(a,r),x===(x=b(n,S))&&y?y.p(n,S):(y.d(1),y=x(n),y&&(y.c(),y.m(f.parentNode,f))),C===(C=k(n,S))&&A?A.p(n,S):(A.d(1),A=C(n),A&&(A.c(),A.m(_.parentNode,_)))},i:re,o:re,d(I){I&&z(e),I&&z(t),I&&z(i),I&&z(o),I&&z(l),I&&z(c),I&&z(u),I&&z(p),y.d(I),I&&z(f),A.d(I),I&&z(_),v=!1,g()}}}s(kz,"create_else_block");function Ez(n){let e,t;return{c(){e=V("div"),$e(e,"visibility","visible",1),$e(e,"position","relative"),$e(e,"top","0"),$e(e,"left","0"),$e(e,"border-bottom","2px solid var(--color-accent)"),$e(e,"width","100%"),$e(e,"height","15px")},m(i,r){G(i,e,r)},p(i,r){n=i},i(i){t||Br(()=>{t=Bs(e,ll,{duration:150,easing:sl}),t.start()})},o:re,d(i){i&&z(e)}}}s(Ez,"create_if_block");function Tz(n){let e,t,i;return{c(){e=V("i"),t=Ne("visibility_off"),T(e,"class","material-icons icon in_list_button in_list_button_disabled svelte-1deur0j"),T(e,"title",i=w("panel.variants.tool.variant_not_visible"))},m(r,a){G(r,e,a),N(e,t)},p:re,d(r){r&&z(e)}}}s(Tz,"create_else_block_2");function Cz(n){let e,t,i;return{c(){e=V("i"),t=Ne("visibility"),T(e,"class","material-icons icon in_list_button"),T(e,"title",i=w("panel.variants.tool.variant_visible"))},m(r,a){G(r,e,a),N(e,t)},p:re,d(r){r&&z(e)}}}s(Cz,"create_if_block_2");function Az(n){let e,t,i;return{c(){e=V("i"),t=Ne("delete"),T(e,"class","material-icons icon in_list_button_disabled svelte-1deur0j"),T(e,"title",i=w("panel.variants.tool.cannot_delete_default_variant"))},m(r,a){G(r,e,a),N(e,t)},p:re,d(r){r&&z(e)}}}s(Az,"create_else_block_1");function Sz(n){let e,t,i;return{c(){e=V("i"),e.textContent="delete",T(e,"class","material-icons icon in_list_button")},m(r,a){G(r,e,a),t||(i=De(e,"click",n[8]),t=!0)},p:re,d(r){r&&z(e),t=!1,i()}}}s(Sz,"create_if_block_1");function M3(n,e){let t,i,r,a,o=re,l,c;function u(_,v){return _[12][ir]?Ez:kz}s(u,"select_block_type");let d=u(e,-1),m=d(e);function p(){return e[9](e[12])}s(p,"click_handler_5");function f(..._){return e[10](e[12],..._)}return s(f,"contextmenu_handler"),{key:n,first:null,c(){t=V("li"),m.c(),i=K(),T(t,"class",r=vi(e[12].value===Se.selected?"variant_item selected_variant_item":"variant_item")+" svelte-1deur0j"),this.first=t},m(_,v){G(_,t,v),m.m(t,null),N(t,i),l||(c=[De(t,"click",p),De(t,"contextmenu",H_(f))],l=!0)},p(_,v){e=_,d===(d=u(e,v))&&m?m.p(e,v):(m.d(1),m=d(e),m&&(m.c(),W(m,1),m.m(t,i))),v&1&&r!==(r=vi(e[12].value===Se.selected?"variant_item selected_variant_item":"variant_item")+" svelte-1deur0j")&&T(t,"class",r)},r(){a=t.getBoundingClientRect()},f(){Ns(t),o()},a(){o(),o=Os(t,a,cl,{duration:Ip})},i(_){W(m)},o:re,d(_){_&&z(t),m.d(),l=!1,At(c)}}}s(M3,"create_each_block");function jz(n){let e,t,i,r,a,o,l,c,u,d,m,p,f,_,v,g,h,b=[],x=new Map,y,k,C,A=n[0],I=s(S=>S[12].id,"get_key");for(let S=0;S({id:g,value:v})))}s(r,"updateLocalVariants"),te.CREATE_VARIANT.subscribe(()=>{r()}),te.UPDATE_VARIANT.subscribe(()=>{r()}),te.DELETE_VARIANT.subscribe(()=>{r()}),te.SELECT_PROJECT.subscribe(()=>{Se.selectDefault(),r()}),te.SELECT_VARIANT.subscribe(()=>{r()});function a(v){v.select(),r()}s(a,"selectVariant");function o(v){t(0,i=v.detail.items)}s(o,"handleSort");function l(v){t(0,i=v.detail.items),Se.all=i.map(g=>g.value)}return s(l,"finalizeSort"),r(),[i,a,o,l,s(v=>Iz(v),"click_handler"),s(v=>Oz(v),"click_handler_1"),s(v=>F3(v),"click_handler_2"),s(v=>ud(v.value),"click_handler_3"),s(v=>F3(v),"click_handler_4"),s(v=>a(v.value),"click_handler_5"),s((v,g)=>{v.value.select(),P3.open(g)},"contextmenu_handler")]}s(Nz,"instance");var dd=class extends je{constructor(e){super(),Ie(this,e,Nz,jz,Ae,{})}};s(dd,"VariantsPanel");var L3=dd;(()=>{let n=Blockbench.addCSS(".panel_container.svelte-1deur0j{display:flex;flex-direction:column}.spacer.svelte-1deur0j{flex-grow:1}.variants_list.svelte-1deur0j{list-style:none;background-color:var(--color-back);scroll-behavior:smooth;overflow-y:auto;max-height:250px}.variant_item.svelte-1deur0j{display:flex;flex-direction:row;justify-content:flex-start;padding:4px;cursor:unset !important;min-height:32px;max-height:32px}.variant_item_name.svelte-1deur0j{margin-left:8px}.variant_item.svelte-1deur0j:hover{color:var(--color-light)}.in_list_button_disabled.svelte-1deur0j{color:var(--color-subtle_text)}.selected_variant_item.svelte-1deur0j{background-color:var(--color-selected)}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();var Zl=class extends Panel{instance;constructor(e){let t=`${Ts}-svelte-panel-`+guid();super(e.id,{...e,component:{name:e.id,template:`
      `}}),Fs(()=>document.querySelector(`#${t}`)).then(i=>{this.instance=new e.component({target:i.parentElement,props:e.props})})}};s(Zl,"SveltePanel");var Op=Xt(`${_e.name}:createVariant`,{name:w("action.variants.create"),icon:"add",click(){new Se("New Variant")}}),Np=Xt(`${_e.name}:duplicateVariant`,{name:w("action.variants.duplicate"),icon:"content_copy",condition:()=>!!Se.selected,click(){Se.selected&&Se.selected.duplicate()}}),Bp=Xt(`${_e.name}:deleteVariant`,{name:w("action.variants.delete"),icon:"delete",condition:()=>!!Se.selected&&!Se.selected.isDefault,click(){!Se.selected||Se.selected.isDefault||Se.selected.delete()}}),Bz=Xt(`${_e.name}:openVariantConfig`,{name:w("action.variants.open_config"),icon:"settings",condition:()=>!!Se.selected,click(){Se.selected&&ud(Se.selected)}}),P3=tg([Op.id,Np.id,Bz.id,new MenuSeparator,Bp.id],{}),zpe=new Zl({id:`${_e.name}:variantsPanel`,name:w("panel.variants.title"),expand_button:!0,default_side:"right",default_position:{slot:"left_bar",height:200,float_position:[0,0],float_size:[200,200],folded:!1},icon:"settings",condition:()=>!!(Ue()&&Modes.selected&&(Modes.selected.id===Modes.options.edit.id||Modes.selected.id===Modes.options.paint.id)),component:L3,props:{}});function Dz(n){let e,t,i,r,a;return{c(){e=V("p"),e.textContent=`${w("action.upgrade_old_aj_model_loader.body")}`,t=K(),i=V("button"),i.textContent=`${w("action.upgrade_old_aj_model_loader.button")}`,T(i,"class","svelte-16p5p64")},m(o,l){G(o,e,l),G(o,t,l),G(o,i,l),r||(a=De(i,"click",Rz),r=!0)},p:re,i:re,o:re,d(o){o&&z(e),o&&z(t),o&&z(i),r=!1,a()}}}s(Dz,"create_fragment");function Rz(){Promise.any([electron.dialog.showOpenDialog({properties:["openFile"],filters:[{name:".ajmodel",extensions:["ajmodel"]}],message:w("action.upgrade_old_aj_model_loader.select_file")})]).then(n=>{n.canceled||z3(n.filePaths[0])})}s(Rz,"openAJModel");var fd=class extends je{constructor(e){super(),Ie(this,e,null,Dz,Ae,{})}};s(fd,"ImportAJModelLoaderDialog");var V3=fd;(()=>{let n=Blockbench.addCSS("button.svelte-16p5p64{width:100%;height:40px}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();var Dp=null;eg(`${_e.name}-upgradeAJModelLoader`,{icon:"folder_open",category:"animated_java",name:w("action.upgrade_old_aj_model_loader.name"),condition(){return!0},format_page:{component:{template:`
      `}},onFormatPage(){Dp&&Dp.$destroy(),Wi({component:V3,props:{},elementSelector(){return document.querySelector(`#${_e.name}-upgradeAJModelLoader-target`)},postMount(n){Dp=n},injectIndex:2})}});function z3(n){try{console.log(`Convert .ajmodel: ${n}`);let e=Rc(JSON.parse(fs.readFileSync(n,"utf8")));xn.load(e,{name:"Upgrade .ajmodel to Blueprint",path:n}),e.blueprint_settings.export_namespace??=Rt(Project.name),requestAnimationFrame(()=>{Project.save_path="",Project.export_path="",Project.openSettings()})}catch(e){console.error(e),sa(e)}}s(z3,"convertAJModelToBlueprint");function Mz(n){let e,t,i=w("panel.keyframe.variant.title")+"",r,a,o,l;return{c(){e=V("div"),t=V("label"),r=Ne(i),o=K(),l=V("div"),T(t,"for","variant_input"),T(t,"class","undefined"),$e(t,"font-weight","unset"),$e(t,"width","fit-content"),T(t,"title",a=w("panel.keyframe.variant.description")),T(l,"class","select-container svelte-1q3wj4f"),T(e,"class","bar flex")},m(c,u){G(c,e,u),N(e,t),N(t,r),N(e,o),N(e,l),n[2](l)},p:re,i:re,o:re,d(c){c&&z(e),n[2](null)}}}s(Mz,"create_fragment");function Fz(n,e,t){let{selectedKeyframe:i}=e,r=new me(Qo(i)),a;r.subscribe(u=>{q0(i,u)});let o=Object.fromEntries(Se.all.map(u=>[u.uuid,u.displayName])),l=new Interface.CustomElements.SelectInput("keyframe-variant-selector",{options:o,value:r.get(),onChange(){r.set(l.node.getAttribute("value")),Animator.preview()}});requestAnimationFrame(()=>{a.appendChild(l.node)});function c(u){se[u?"unshift":"push"](()=>{a=u,t(0,a)})}return s(c,"div0_binding"),n.$$set=u=>{"selectedKeyframe"in u&&t(1,i=u.selectedKeyframe)},[a,i,c]}s(Fz,"instance");var md=class extends je{constructor(e){super(),Ie(this,e,Fz,Mz,Ae,{selectedKeyframe:1})}};s(md,"VariantKeyframePanel");var U3=md;(()=>{let n=Blockbench.addCSS(".select-container.svelte-1q3wj4f{flex-grow:1;height:30px;padding-left:8px}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();function Lz(n){let e,t,i=w("panel.keyframe.commands.title")+"",r,a,o,l,c,u,d,m=w("panel.keyframe.repeat.title")+"",p,f,_,v,g,h,b,x=w("panel.keyframe.repeat_frequency.title")+"",y,k,C,A,I,S;return{c(){e=V("div"),t=V("label"),r=Ne(i),o=K(),l=V("textarea"),c=K(),u=V("div"),d=V("label"),p=Ne(m),_=K(),v=V("input"),g=K(),h=V("div"),b=V("label"),y=Ne(x),C=K(),A=V("input"),T(t,"for","commands_input"),T(t,"class","undefined"),$e(t,"font-weight","unset"),T(t,"title",a=w("panel.keyframe.commands.description")),T(l,"id","commands_input"),T(l,"class","dark_bordered code keyframe_input tab_target svelte-phbv96"),T(e,"class","bar flex"),T(d,"for","repeat_input"),T(d,"class","undefined"),$e(d,"font-weight","unset"),T(d,"title",f=w("animated_java.panel.keyframe.repeat.description")),T(v,"id","repeat_input"),T(v,"class","dark_bordered tab_target svelte-phbv96"),T(v,"type","checkbox"),T(u,"class","bar flex"),T(b,"for","repeat_frequency_input"),T(b,"class","undefined"),$e(b,"font-weight","unset"),T(b,"title",k=w("animated_java.panel.keyframe.repeat_frequency.description")),T(A,"id","repeat_frequency_input"),T(A,"class","dark_bordered tab_target"),T(A,"type","number"),T(h,"class","bar flex")},m(L,O){G(L,e,O),N(e,t),N(t,r),N(e,o),N(e,l),mt(l,n[0]),G(L,c,O),G(L,u,O),N(u,d),N(d,p),N(u,_),N(u,v),v.checked=n[1],G(L,g,O),G(L,h,O),N(h,b),N(b,y),N(h,C),N(h,A),mt(A,n[2]),I||(S=[De(l,"input",n[7]),De(v,"change",n[8]),De(A,"input",n[9])],I=!0)},p(L,[O]){O&1&&mt(l,L[0]),O&2&&(v.checked=L[1]),O&4&&go(A.value)!==L[2]&&mt(A,L[2])},i:re,o:re,d(L){L&&z(e),L&&z(c),L&&z(u),L&&z(g),L&&z(h),I=!1,At(S)}}}s(Lz,"create_fragment");function Pz(n,e,t){let i,r,a,{selectedKeyframe:o}=e,l=new me(qa(o)||"");_o(n,l,f=>t(0,i=f));let c=new me(es(o)||!1);_o(n,c,f=>t(1,r=f));let u=new me(ts(o)||1);_o(n,u,f=>t(2,a=f)),l.subscribe(f=>{W0(o,f)}),c.subscribe(f=>{X0(o,f)}),u.subscribe(f=>{f<1&&(f=1),u.set(f),Y0(o,f)});function d(){i=this.value,l.set(i)}s(d,"textarea_input_handler");function m(){r=this.checked,c.set(r)}s(m,"input0_change_handler");function p(){a=go(this.value),u.set(a)}return s(p,"input1_input_handler"),n.$$set=f=>{"selectedKeyframe"in f&&t(6,o=f.selectedKeyframe)},[i,r,a,l,c,u,o,d,m,p]}s(Pz,"instance");var pd=class extends je{constructor(e){super(),Ie(this,e,Pz,Lz,Ae,{selectedKeyframe:6})}};s(pd,"CommandsKeyframePanel");var G3=pd;(()=>{let n=Blockbench.addCSS("textarea.svelte-phbv96{min-height:90px;height:30px;resize:vertical;text-wrap:nowrap}input[type='checkbox'].svelte-phbv96{display:flex;align-items:center;justify-content:flex-start;padding-left:8px}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();function Vz(n){let e,t,i=n[0].channel+"",r,a;return{c(){e=V("p"),t=Ne("Unknown keyframe channel: '"),r=Ne(i),a=Ne("'")},m(o,l){G(o,e,l),N(e,t),N(e,r),N(e,a)},p(o,l){l&1&&i!==(i=o[0].channel+"")&&tt(r,i)},i:re,o:re,d(o){o&&z(e)}}}s(Vz,"create_else_block");function zz(n){let e,t;return e=new G3({props:{selectedKeyframe:n[0]}}),{c(){fe(e.$$.fragment)},m(i,r){de(e,i,r),t=!0},p(i,r){let a={};r&1&&(a.selectedKeyframe=i[0]),e.$set(a)},i(i){t||(W(e.$$.fragment,i),t=!0)},o(i){Y(e.$$.fragment,i),t=!1},d(i){ue(e,i)}}}s(zz,"create_if_block_1");function Uz(n){let e,t;return e=new U3({props:{selectedKeyframe:n[0]}}),{c(){fe(e.$$.fragment)},m(i,r){de(e,i,r),t=!0},p(i,r){let a={};r&1&&(a.selectedKeyframe=i[0]),e.$set(a)},i(i){t||(W(e.$$.fragment,i),t=!0)},o(i){Y(e.$$.fragment,i),t=!1},d(i){ue(e,i)}}}s(Uz,"create_if_block");function Gz(n){let e,t,i,r,a,o,l=w("panel.keyframe.execute_condition.title")+"",c,u,d,m,p,f,_,v=[Uz,zz,Vz],g=[];function h(b,x){return b[0].channel==="variant"?0:b[0].channel==="commands"?1:2}return s(h,"select_block_type"),t=h(n,-1),i=g[t]=v[t](n),{c(){e=V("div"),i.c(),r=K(),a=V("div"),o=V("label"),c=Ne(l),d=K(),m=V("input"),T(o,"for","execute_condition"),T(o,"class","undefined"),$e(o,"font-weight","unset"),T(o,"title",u=w("panel.keyframe.execute_condition.description")),T(m,"id","execute_condition"),T(m,"type","text"),T(m,"class","dark_bordered code keyframe_input tab_target"),T(a,"class","bar flex"),T(e,"class","container svelte-mrrs0k")},m(b,x){G(b,e,x),g[t].m(e,null),N(e,r),N(e,a),N(a,o),N(o,c),N(a,d),N(a,m),mt(m,n[1]),p=!0,f||(_=De(m,"input",n[3]),f=!0)},p(b,[x]){let y=t;t=h(b,x),t===y?g[t].p(b,x):(bt(),Y(g[y],1,1,()=>{g[y]=null}),vt(),i=g[t],i?i.p(b,x):(i=g[t]=v[t](b),i.c()),W(i,1),i.m(e,r)),x&2&&m.value!==b[1]&&mt(m,b[1])},i(b){p||(W(i),p=!0)},o(b){Y(i),p=!1},d(b){b&&z(e),g[t].d(),f=!1,_()}}}s(Gz,"create_fragment");function Jz(n,e,t){let i,{selectedKeyframe:r}=e,a=new me(ma(r)||"");_o(n,a,l=>t(1,i=l)),a.subscribe(l=>{Z0(r,l)});function o(){i=this.value,a.set(i)}return s(o,"input_input_handler"),n.$$set=l=>{"selectedKeyframe"in l&&t(0,r=l.selectedKeyframe)},[r,i,a,o]}s(Jz,"instance");var _d=class extends je{constructor(e){super(),Ie(this,e,Jz,Gz,Ae,{selectedKeyframe:0})}};s(_d,"CustomKeyframePanel");var J3=_d;(()=>{let n=Blockbench.addCSS(".container.svelte-mrrs0k{display:flex;flex-direction:column}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();var H3;function Hz(n){if(!Ue()||!n||!Rl.includes(n.channel))return;let e=document.querySelector("#panel_keyframe .panel_vue_wrapper .keyframe_data_point");if(!e){console.warn("Failed to find keyframe panel element. Aborting custom keyframe panel injection.");return}for(let t of[...e.children])t.remove();Wi({component:J3,props:{selectedKeyframe:n},elementSelector(){return e},postMount(t){let i=jQuery("#panel_keyframe .panel_vue_wrapper #keyframe_type_label label");if(i&&n.channel){let r=n.animator.channels[n.channel];i.text(w("panel.keyframe.keyframe_title",`${r.name}`))}H3?.$destroy(),H3=t}})}s(Hz,"injectCustomKeyframePanel");te.SELECT_KEYFRAME.subscribe(n=>{Hz(n)});var $z=window;function Rp(n,e,t={}){let i=Object.assign({tab:" ",indentOn:/[({\[]$/,moveToNewLine:/^[)}\]]/,spellcheck:!1,catchTab:!0,preserveIdent:!0,addClosing:!0,history:!0,window:$z},t),r=i.window,a=r.document,o=[],l=[],c=-1,u=!1,d,m;n.setAttribute("contenteditable","plaintext-only"),n.setAttribute("spellcheck",i.spellcheck?"true":"false"),n.style.outline="none",n.style.overflowWrap="break-word",n.style.overflowY="auto",n.style.whiteSpace="pre-wrap";let p=!1;e(n),n.contentEditable!=="plaintext-only"&&(p=!0),p&&n.setAttribute("contenteditable","true");let f=j(()=>{let J=b();e(n,J),x(J)},30),_=!1,v=s(J=>!ee(J)&&!ae(J)&&J.key!=="Meta"&&J.key!=="Control"&&J.key!=="Alt"&&!J.key.startsWith("Arrow"),"shouldRecord"),g=j(J=>{v(J)&&(O(),_=!1)},300),h=s((J,ie)=>{o.push([J,ie]),n.addEventListener(J,ie)},"on");h("keydown",J=>{J.defaultPrevented||(m=P(),i.preserveIdent?C(J):A(J),i.catchTab&&S(J),i.addClosing&&I(J),i.history&&(L(J),v(J)&&!_&&(O(),_=!0)),p&&!ne(J)&&x(b()))}),h("keyup",J=>{J.defaultPrevented||J.isComposing||(m!==P()&&f(),g(J),d&&d(P()))}),h("focus",J=>{u=!0}),h("blur",J=>{u=!1}),h("paste",J=>{O(),E(J),O(),d&&d(P())});function b(){let J=Z(),ie={start:0,end:0,dir:void 0},{anchorNode:U,anchorOffset:q,focusNode:ge,focusOffset:Te}=J;if(!U||!ge)throw"error1";if(U===n&&ge===n)return ie.start=q>0&&n.textContent?n.textContent.length:0,ie.end=Te>0&&n.textContent?n.textContent.length:0,ie.dir=Te>=q?"->":"<-",ie;if(U.nodeType===Node.ELEMENT_NODE){let Re=a.createTextNode("");U.insertBefore(Re,U.childNodes[q]),U=Re,q=0}if(ge.nodeType===Node.ELEMENT_NODE){let Re=a.createTextNode("");ge.insertBefore(Re,ge.childNodes[Te]),ge=Re,Te=0}return B(n,Re=>{if(Re===U&&Re===ge)return ie.start+=q,ie.end+=Te,ie.dir=q<=Te?"->":"<-","stop";if(Re===U)if(ie.start+=q,!ie.dir)ie.dir="->";else return"stop";else if(Re===ge)if(ie.end+=Te,!ie.dir)ie.dir="<-";else return"stop";Re.nodeType===Node.TEXT_NODE&&(ie.dir!="->"&&(ie.start+=Re.nodeValue.length),ie.dir!="<-"&&(ie.end+=Re.nodeValue.length))}),n.normalize(),ie}s(b,"save");function x(J){let ie=Z(),U,q=0,ge,Te=0;if(J.dir||(J.dir="->"),J.start<0&&(J.start=0),J.end<0&&(J.end=0),J.dir=="<-"){let{start:le,end:pe}=J;J.start=pe,J.end=le}let Re=0;B(n,le=>{if(le.nodeType!==Node.TEXT_NODE)return;let pe=(le.nodeValue||"").length;if(Re+pe>J.start&&(U||(U=le,q=J.start-Re),Re+pe>J.end))return ge=le,Te=J.end-Re,"stop";Re+=pe}),U||(U=n,q=n.childNodes.length),ge||(ge=n,Te=n.childNodes.length),J.dir=="<-"&&([U,q,ge,Te]=[ge,Te,U,q]),ie.setBaseAndExtent(U,q,ge,Te)}s(x,"restore");function y(){let ie=Z().getRangeAt(0),U=a.createRange();return U.selectNodeContents(n),U.setEnd(ie.startContainer,ie.startOffset),U.toString()}s(y,"beforeCursor");function k(){let ie=Z().getRangeAt(0),U=a.createRange();return U.selectNodeContents(n),U.setStart(ie.endContainer,ie.endOffset),U.toString()}s(k,"afterCursor");function C(J){if(J.key==="Enter"){let ie=y(),U=k(),[q]=Q(ie),ge=q;if(i.indentOn.test(ie)&&(ge+=i.tab),ge.length>0?(oe(J),J.stopPropagation(),X(` -`+ge)):A(J),ge!==q&&i.moveToNewLine.test(U)){let Te=b();X(` -`+q),x(Te)}}}s(C,"handleNewLine");function A(J){if(p&&J.key==="Enter")if(oe(J),J.stopPropagation(),k()==""){X(` - `);let ie=b();ie.start=--ie.end,x(ie)}else X(` -`)}s(A,"legacyNewLineFix");function I(J){let ie=`([{'"`,U=`)]}'"`,q=k(),ge=y(),Te=ge.substr(ge.length-1)==="\\",Re=q.substr(0,1);if(U.includes(J.key)&&!Te&&Re===J.key){let le=b();oe(J),le.start=++le.end,x(le)}else if(ie.includes(J.key)&&!Te&&(`"'`.includes(J.key)||[""," ",` -`].includes(Re))){oe(J);let le=b(),pe=le.start==le.end?"":Z().toString(),Le=J.key+pe+U[ie.indexOf(J.key)];X(Le),le.start++,le.end++,x(le)}}s(I,"handleSelfClosingCharacters");function S(J){if(J.key==="Tab")if(oe(J),J.shiftKey){let ie=y(),[U,q]=Q(ie);if(U.length>0){let ge=b(),Te=Math.min(i.tab.length,U.length);x({start:q,end:q+Te}),a.execCommand("delete"),ge.start-=Te,ge.end-=Te,x(ge)}}else X(i.tab)}s(S,"handleTabCharacters");function L(J){if(ee(J)){oe(J),c--;let ie=l[c];ie&&(n.innerHTML=ie.html,x(ie.pos)),c<0&&(c=0)}if(ae(J)){oe(J),c++;let ie=l[c];ie&&(n.innerHTML=ie.html,x(ie.pos)),c>=l.length&&c--}}s(L,"handleUndoRedo");function O(){if(!u)return;let J=n.innerHTML,ie=b(),U=l[c];if(U&&U.html===J&&U.pos.start===ie.start&&U.pos.end===ie.end)return;c++,l[c]={html:J,pos:ie},l.splice(c+1);let q=300;c>q&&(c=q,l.splice(0,1))}s(O,"recordHistory");function E(J){oe(J);let ie=(J.originalEvent||J).clipboardData.getData("text/plain").replace(/\r/g,""),U=b();X(ie),e(n),x({start:Math.min(U.start,U.end)+ie.length,end:Math.min(U.start,U.end)+ie.length,dir:"<-"})}s(E,"handlePaste");function B(J,ie){let U=[];J.firstChild&&U.push(J.firstChild);let q=U.pop();for(;q&&ie(q)!=="stop";)q.nextSibling&&U.push(q.nextSibling),q.firstChild&&U.push(q.firstChild),q=U.pop()}s(B,"visit");function H(J){return J.metaKey||J.ctrlKey}s(H,"isCtrl");function ee(J){return H(J)&&!J.shiftKey&&ve(J)==="Z"}s(ee,"isUndo");function ae(J){return H(J)&&J.shiftKey&&ve(J)==="Z"}s(ae,"isRedo");function ne(J){return H(J)&&ve(J)==="C"}s(ne,"isCopy");function ve(J){let ie=J.key||J.keyCode||J.which;if(ie)return(typeof ie=="string"?ie:String.fromCharCode(ie)).toUpperCase()}s(ve,"getKeyCode");function X(J){J=J.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),a.execCommand("insertHTML",!1,J)}s(X,"insert");function j(J,ie){let U=0;return(...q)=>{clearTimeout(U),U=r.setTimeout(()=>J(...q),ie)}}s(j,"debounce");function Q(J){let ie=J.length-1;for(;ie>=0&&J[ie]!==` -`;)ie--;ie++;let U=ie;for(;Ui.style.top=`-${r.scrollTop}px`));let o=(r.textContent||"").replace(/\n+$/,` + `,e.value=e.__value},m(l,u){L(l,e,u),N(e,i),N(e,r)},p(l,u){u[0]&64&&a!==(a=l[35].uuid===l[32][1])&&(e.selected=a)},d(l){l&&F(e)}}}s(_3,"create_each_block_1");function g3(n){let e,t,i,r,a,o,l,u,c,d,m,p,f,_,g,h,v,y,k,b,x,E,C,j=n[11],S=[];for(let te=0;tewe(t,"value",_));let h=d3(n);function v(b){n[22](b)}s(v,"checkbox_checked_binding");let y={label:w("dialog.variant_config.generate_name_from_display_name"),tooltip:w("dialog.variant_config.generate_name_from_display_name.description")};n[2]!==void 0&&(y.checked=n[2]),l=new tt({props:y}),le.push(()=>we(l,"checked",v));let k=!n[4].isDefault&&f3(n);return{c(){e=P("div"),_e(t.$$.fragment),r=G(),h.c(),o=G(),_e(l.$$.fragment),c=G(),d=P("div"),m=Re(n[10]),p=G(),k&&k.c(),T(d,"class","uuid svelte-ezx8am"),T(e,"class","dialog-container svelte-ezx8am")},m(b,x){L(b,e,x),me(t,e,null),N(e,r),h.m(e,null),N(e,o),me(l,e,null),N(e,c),N(e,d),N(d,m),N(e,p),k&&k.m(e,null),f=!0},p(b,x){let E={};!i&&x[0]&1&&(i=!0,E.value=b[0],ye(()=>i=!1)),t.$set(E),x[0]&512&&Oe(a,a=b[9])?(Et(),Z(h,1,1,ue),Tt(),h=d3(b),h.c(),q(h,1),h.m(e,o)):h.p(b,x);let C={};!u&&x[0]&4&&(u=!0,C.checked=b[2],ye(()=>u=!1)),l.$set(C),(!f||x[0]&1024)&&ot(m,b[10]),b[4].isDefault?k&&(Et(),Z(k,1,1,()=>{k=null}),Tt()):k?(k.p(b,x),x[0]&16&&q(k,1)):(k=f3(b),k.c(),q(k,1),k.m(e,null))},i(b){f||(q(t.$$.fragment,b),q(h),q(l.$$.fragment,b),q(k),f=!0)},o(b){Z(t.$$.fragment,b),Z(h),Z(l.$$.fragment,b),Z(k),f=!1},d(b){b&&F(e),de(t),h.d(b),de(l),k&&k.d()}}}s(oU,"create_fragment");var sU=s(()=>{},"click_handler_1");function lU(n,e,t){let i,r=ue,a=s(()=>(r(),r=ze(h,J=>t(29,i=J)),h),"$$subscribe_displayName"),o,l=ue,u=s(()=>(l(),l=ze(b,J=>t(8,o=J)),b),"$$subscribe_generateNameFromDisplayName"),c,d=ue,m=s(()=>(d(),d=ze(v,J=>t(9,c=J)),v),"$$subscribe_name"),p,f=ue,_=s(()=>(f(),f=ze(y,J=>t(10,p=J)),y),"$$subscribe_uuid");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l()),n.$$.on_destroy.push(()=>d()),n.$$.on_destroy.push(()=>f());let{variant:g}=e,{displayName:h}=e;a();let{name:v}=e;m();let{uuid:y}=e;_();let{textureMap:k}=e,{generateNameFromDisplayName:b}=e;u();let{excludedNodes:x}=e,E=[...Texture.all,Hn],C=[...Texture.all],j=E,S=Vu(x.get(),{groupsOnly:!0,excludeEmptyGroups:!0}),B=0;h.subscribe(J=>{o&&v.set(Ne.makeNameUnique(g,J))}),b.subscribe(J=>{J&&v.set(Ne.makeNameUnique(g,i))});function O(){let J=fe()[0];J&&(k.add(J.uuid,J.uuid),t(7,B++,B))}s(O,"createTextureMapping");function A(J){k.delete(J),t(7,B++,B)}s(A,"deleteTextureMapping");function V(J){let Ce=E.find(Y=>Y.uuid===J);return Ce?Ce.img.src:s3}s(V,"getTextureSrc");function K(J,Ce){let z=J.target.value.trim(),be=C.find(ie=>ie.name===z)?.uuid;if(!be){console.error(`Failed to find new primary texture with the name: ${z}`);return}let H=k.get(Ce);if(!H){console.error(`Failed to find secondary texture with the uuid: ${Ce}`);return}k.delete(Ce),k.add(be,H),t(7,B++,B)}s(K,"selectNewPrimaryTexture");function te(J,Ce){let z=J.target.value.trim(),be=j.find(H=>H.name===z)?.uuid;if(!be){console.error(`Failed to find new secondary texture with the name: ${z}`);return}k.add(Ce,be),t(7,B++,B)}s(te,"selectNewSecondaryTexture");function fe(){let J=[...k.map.keys()];return C.filter(Ce=>!J.includes(Ce.uuid))}s(fe,"getUnusedPrimaryTextures");function ae(J){h=J,a(t(0,h))}s(ae,"lineinput_value_binding");function ee(J){v=J,m(t(1,v))}s(ee,"lineinput_value_binding_1");function se(J){v=J,m(t(1,v))}s(se,"lineinput_value_binding_2");function oe(J){b=J,u(t(2,b))}s(oe,"checkbox_checked_binding");let xe=s(()=>O(),"click_handler"),ne=s(()=>{let J=w("dialog.variant_config.texture_map.description");Blockbench.showQuickMessage(J,50*J.length)},"click_handler_2"),pe=s((J,Ce)=>K(Ce,J[0]),"change_handler"),W=s((J,Ce)=>te(Ce,J[0]),"change_handler_1"),U=s(J=>A(J[0]),"click_handler_3");function ce(J){x=J,t(3,x)}return s(ce,"collection_includedItems_binding"),n.$$set=J=>{"variant"in J&&t(4,g=J.variant),"displayName"in J&&a(t(0,h=J.displayName)),"name"in J&&m(t(1,v=J.name)),"uuid"in J&&_(t(5,y=J.uuid)),"textureMap"in J&&t(6,k=J.textureMap),"generateNameFromDisplayName"in J&&u(t(2,b=J.generateNameFromDisplayName)),"excludedNodes"in J&&t(3,x=J.excludedNodes)},[h,v,b,x,g,y,k,B,o,c,p,C,j,S,O,A,V,K,te,ae,ee,se,oe,xe,ne,pe,W,U,ce]}s(lU,"instance");var xd=class extends Be{constructor(e){super(),De(this,e,lU,oU,Oe,{variant:4,displayName:0,name:1,uuid:5,textureMap:6,generateNameFromDisplayName:2,excludedNodes:3},null,[-1,-1])}};s(xd,"VariantConfigDialog");var b3=xd;(()=>{let n=Blockbench.addCSS(`.dialog-container.svelte-ezx8am{display:flex;flex-direction:column}.uuid.svelte-ezx8am{color:var(--color-subtle_text);font-style:italic;text-align:center;font-size:14px;user-select:all}.no-mappings.svelte-ezx8am{color:var(--color-subtle_text);font-style:italic;text-align:center}.img-container.svelte-ezx8am{display:flex;align-items:flex-start;width:128px;height:128px;pointer-events:none;background:repeating-conic-gradient(var(--color-dark) 0% 25%, transparent 0% 50%) 50% /\r + 16px 16px}img.svelte-ezx8am{width:128px;pointer-events:none}.texture-mapping-item.svelte-ezx8am{display:flex;align-items:center;justify-content:space-between}.texture-mapping-item-dropdown-container.svelte-ezx8am{position:relative;flex-grow:1;height:164px;display:flex;flex-direction:column;align-items:center;justify-content:center}.texture-mapping-item-dropdown.svelte-ezx8am{display:flex;flex-direction:column;align-items:center;max-width:128px}.texture-map-container.svelte-ezx8am{display:flex;flex-direction:column;border:1px solid var(--color-border);background-color:var(--color-back);padding:4px;overflow-y:auto;max-height:600px;overflow-y:auto;max-height:16rem}.spacer.svelte-ezx8am{flex-grow:1}.toolbar.svelte-ezx8am{display:flex;flex-direction:row;align-items:center}`);function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();function kd(n){let e=new ge(n.displayName),t=new ge(n.name),i=new ge(n.uuid),r=n.textureMap.copy(),a=new ge(n.generateNameFromDisplayName),o=new ge(n.excludedNodes);new qt({id:`${ke.name}:variantConfig`,title:w("dialog.variant_config.title"),width:512,component:b3,props:{variant:n,displayName:e,name:t,uuid:i,textureMap:r,generateNameFromDisplayName:a,excludedNodes:o},preventKeybinds:!0,onConfirm(){n.displayName=e.get(),n.name=t.get(),n.uuid=i.get(),n.textureMap=r,n.generateNameFromDisplayName=a.get(),n.excludedNodes=o.get(),re.UPDATE_VARIANT.dispatch(n),n.select()}}).show()}s(kd,"openVariantConfigDialog");function v3(n,e,t){let i=n.slice();return i[12]=e[t],i}s(v3,"get_each_context");function cU(n){let e,t,i,r=n[12].value.displayName+"",a,o,l,u,c,d,m,p,f,_,g,h;function v(){return n[7](n[12])}s(v,"click_handler_3");function y(j,S){return Ne.selected===j[12].value?fU:dU}s(y,"select_block_type_1");let k=y(n,-1),b=k(n);function x(j,S){return j[12].value.isDefault?mU:pU}s(x,"select_block_type_2");let E=x(n,-1),C=E(n);return{c(){e=P("i"),e.textContent="texture",t=G(),i=P("div"),a=Re(r),o=G(),l=P("div"),u=G(),c=P("i"),d=Re("edit"),p=G(),b.c(),f=G(),C.c(),_=Dt(),T(e,"class","material-icons icon in_list_button"),T(i,"class","variant_item_name svelte-1deur0j"),T(l,"class","spacer svelte-1deur0j"),T(c,"class","material-icons icon in_list_button"),T(c,"title",m=w("panel.variants.tool.edit_variant"))},m(j,S){L(j,e,S),L(j,t,S),L(j,i,S),N(i,a),L(j,o,S),L(j,l,S),L(j,u,S),L(j,c,S),N(c,d),L(j,p,S),b.m(j,S),L(j,f,S),C.m(j,S),L(j,_,S),g||(h=Le(c,"click",v),g=!0)},p(j,S){n=j,S&1&&r!==(r=n[12].value.displayName+"")&&ot(a,r),k===(k=y(n,S))&&b?b.p(n,S):(b.d(1),b=k(n),b&&(b.c(),b.m(f.parentNode,f))),E===(E=x(n,S))&&C?C.p(n,S):(C.d(1),C=E(n),C&&(C.c(),C.m(_.parentNode,_)))},i:ue,o:ue,d(j){j&&F(e),j&&F(t),j&&F(i),j&&F(o),j&&F(l),j&&F(u),j&&F(c),j&&F(p),b.d(j),j&&F(f),C.d(j),j&&F(_),g=!1,h()}}}s(cU,"create_else_block");function uU(n){let e,t;return{c(){e=P("div"),Ge(e,"visibility","visible",1),Ge(e,"position","relative"),Ge(e,"top","0"),Ge(e,"left","0"),Ge(e,"border-bottom","2px solid var(--color-accent)"),Ge(e,"width","100%"),Ge(e,"height","15px")},m(i,r){L(i,e,r)},p(i,r){n=i},i(i){t||Fr(()=>{t=Vs(e,xl,{duration:150,easing:wl}),t.start()})},o:ue,d(i){i&&F(e)}}}s(uU,"create_if_block");function dU(n){let e,t,i;return{c(){e=P("i"),t=Re("visibility_off"),T(e,"class","material-icons icon in_list_button in_list_button_disabled svelte-1deur0j"),T(e,"title",i=w("panel.variants.tool.variant_not_visible"))},m(r,a){L(r,e,a),N(e,t)},p:ue,d(r){r&&F(e)}}}s(dU,"create_else_block_2");function fU(n){let e,t,i;return{c(){e=P("i"),t=Re("visibility"),T(e,"class","material-icons icon in_list_button"),T(e,"title",i=w("panel.variants.tool.variant_visible"))},m(r,a){L(r,e,a),N(e,t)},p:ue,d(r){r&&F(e)}}}s(fU,"create_if_block_2");function mU(n){let e,t,i;return{c(){e=P("i"),t=Re("delete"),T(e,"class","material-icons icon in_list_button_disabled svelte-1deur0j"),T(e,"title",i=w("panel.variants.tool.cannot_delete_default_variant"))},m(r,a){L(r,e,a),N(e,t)},p:ue,d(r){r&&F(e)}}}s(mU,"create_else_block_1");function pU(n){let e,t,i;return{c(){e=P("i"),e.textContent="delete",T(e,"class","material-icons icon in_list_button")},m(r,a){L(r,e,a),t||(i=Le(e,"click",n[8]),t=!0)},p:ue,d(r){r&&F(e),t=!1,i()}}}s(pU,"create_if_block_1");function y3(n,e){let t,i,r,a,o=ue,l,u;function c(_,g){return _[12][dr]?uU:cU}s(c,"select_block_type");let d=c(e,-1),m=d(e);function p(){return e[9](e[12])}s(p,"click_handler_5");function f(..._){return e[10](e[12],..._)}return s(f,"contextmenu_handler"),{key:n,first:null,c(){t=P("li"),m.c(),i=G(),T(t,"class",r=Ai(e[12].value===Ne.selected?"variant_item selected_variant_item":"variant_item")+" svelte-1deur0j"),this.first=t},m(_,g){L(_,t,g),m.m(t,null),N(t,i),l||(u=[Le(t,"click",p),Le(t,"contextmenu",lg(f))],l=!0)},p(_,g){e=_,d===(d=c(e,g))&&m?m.p(e,g):(m.d(1),m=d(e),m&&(m.c(),q(m,1),m.m(t,i))),g&1&&r!==(r=Ai(e[12].value===Ne.selected?"variant_item selected_variant_item":"variant_item")+" svelte-1deur0j")&&T(t,"class",r)},r(){a=t.getBoundingClientRect()},f(){Ps(t),o()},a(){o(),o=Ls(t,a,kl,{duration:qp})},i(_){q(m)},o:ue,d(_){_&&F(t),m.d(),l=!1,Lt(u)}}}s(y3,"create_each_block");function _U(n){let e,t,i,r,a,o,l,u,c,d,m,p,f,_,g,h,v,y=[],k=new Map,b,x,E,C=n[0],j=s(S=>S[12].id,"get_key");for(let S=0;S({id:h,value:g})))}s(r,"updateLocalVariants"),re.CREATE_VARIANT.subscribe(()=>{r()}),re.UPDATE_VARIANT.subscribe(()=>{r()}),re.DELETE_VARIANT.subscribe(()=>{r()}),re.SELECT_PROJECT.subscribe(()=>{Ne.selectDefault(),r()}),re.SELECT_VARIANT.subscribe(()=>{r()});function a(g){g.select(),r()}s(a,"selectVariant");function o(g){t(0,i=g.detail.items)}s(o,"handleSort");function l(g){t(0,i=g.detail.items),Ne.all=i.map(h=>h.value)}return s(l,"finalizeSort"),r(),[i,a,o,l,s(g=>gU(g),"click_handler"),s(g=>hU(g),"click_handler_1"),s(g=>w3(g),"click_handler_2"),s(g=>kd(g.value),"click_handler_3"),s(g=>w3(g),"click_handler_4"),s(g=>a(g.value),"click_handler_5"),s((g,h)=>{g.value.select(),k3.open(h)},"contextmenu_handler")]}s(bU,"instance");var Ed=class extends Be{constructor(e){super(),De(this,e,bU,_U,Oe,{})}};s(Ed,"VariantsPanel");var x3=Ed;(()=>{let n=Blockbench.addCSS(".panel_container.svelte-1deur0j{display:flex;flex-direction:column}.spacer.svelte-1deur0j{flex-grow:1}.variants_list.svelte-1deur0j{list-style:none;background-color:var(--color-back);scroll-behavior:smooth;overflow-y:auto;max-height:250px}.variant_item.svelte-1deur0j{display:flex;flex-direction:row;justify-content:flex-start;padding:4px;cursor:unset !important;min-height:32px;max-height:32px}.variant_item_name.svelte-1deur0j{margin-left:8px}.variant_item.svelte-1deur0j:hover{color:var(--color-light)}.in_list_button_disabled.svelte-1deur0j{color:var(--color-subtle_text)}.selected_variant_item.svelte-1deur0j{background-color:var(--color-selected)}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();var rc=class extends Panel{instance;constructor(e){let t=`${Ns}-svelte-panel-`+guid();super(e.id,{...e,component:{name:e.id,template:`
      `}}),Us(()=>document.querySelector(`#${t}`)).then(i=>{this.instance=new e.component({target:i.parentElement,props:e.props})})}};s(rc,"SveltePanel");var Kp=on(`${ke.name}:createVariant`,{name:w("action.variants.create"),icon:"add",click(){new Ne("New Variant")}}),Wp=on(`${ke.name}:duplicateVariant`,{name:w("action.variants.duplicate"),icon:"content_copy",condition:()=>!!Ne.selected,click(){Ne.selected&&Ne.selected.duplicate()}}),Zp=on(`${ke.name}:deleteVariant`,{name:w("action.variants.delete"),icon:"delete",condition:()=>!!Ne.selected&&!Ne.selected.isDefault,click(){!Ne.selected||Ne.selected.isDefault||Ne.selected.delete()}}),vU=on(`${ke.name}:openVariantConfig`,{name:w("action.variants.open_config"),icon:"settings",condition:()=>!!Ne.selected,click(){Ne.selected&&kd(Ne.selected)}}),k3=bg([Kp.id,Wp.id,vU.id,new MenuSeparator,Zp.id],{}),Zge=new rc({id:`${ke.name}:variantsPanel`,name:w("panel.variants.title"),expand_button:!0,default_side:"right",default_position:{slot:"left_bar",height:200,float_position:[0,0],float_size:[200,200],folded:!1},icon:"settings",condition:()=>!!(Ue()&&Modes.selected&&(Modes.selected.id===Modes.options.edit.id||Modes.selected.id===Modes.options.paint.id)),component:x3,props:{}});function yU(n){let e,t,i,r,a;return{c(){e=P("p"),e.textContent=`${w("action.upgrade_old_aj_model_loader.body")}`,t=G(),i=P("button"),i.textContent=`${w("action.upgrade_old_aj_model_loader.button")}`,T(i,"class","svelte-16p5p64")},m(o,l){L(o,e,l),L(o,t,l),L(o,i,l),r||(a=Le(i,"click",wU),r=!0)},p:ue,i:ue,o:ue,d(o){o&&F(e),o&&F(t),o&&F(i),r=!1,a()}}}s(yU,"create_fragment");function wU(){Promise.any([electron.dialog.showOpenDialog({properties:["openFile"],filters:[{name:".ajmodel",extensions:["ajmodel"]}],message:w("action.upgrade_old_aj_model_loader.select_file")})]).then(n=>{n.canceled||T3(n.filePaths[0])})}s(wU,"openAJModel");var Td=class extends Be{constructor(e){super(),De(this,e,null,yU,Oe,{})}};s(Td,"ImportAJModelLoaderDialog");var E3=Td;(()=>{let n=Blockbench.addCSS("button.svelte-16p5p64{width:100%;height:40px}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();var Xp=null;hg(`${ke.name}-upgradeAJModelLoader`,{icon:"folder_open",category:"animated_java",name:w("action.upgrade_old_aj_model_loader.name"),condition(){return!0},format_page:{component:{template:`
      `}},onFormatPage(){Xp&&Xp.$destroy(),tr({component:E3,props:{},elementSelector(){return document.querySelector(`#${ke.name}-upgradeAJModelLoader-target`)},postMount(n){Xp=n},injectIndex:2})}});function T3(n){try{console.log(`Convert .ajmodel: ${n}`);let e=Uc(JSON.parse(fs.readFileSync(n,"utf8")));Cn.load(e,{name:"Upgrade .ajmodel to Blueprint",path:n}),e.blueprint_settings.export_namespace??=Ht(Project.name),requestAnimationFrame(()=>{Project.save_path="",Project.export_path="",Project.openSettings()})}catch(e){console.error(e),fa(e)}}s(T3,"convertAJModelToBlueprint");function xU(n){let e,t,i=w("panel.keyframe.variant.title")+"",r,a,o,l;return{c(){e=P("div"),t=P("label"),r=Re(i),o=G(),l=P("div"),T(t,"for","variant_input"),T(t,"class","undefined"),Ge(t,"font-weight","unset"),Ge(t,"width","fit-content"),T(t,"title",a=w("panel.keyframe.variant.description")),T(l,"class","select-container svelte-1q3wj4f"),T(e,"class","bar flex")},m(u,c){L(u,e,c),N(e,t),N(t,r),N(e,o),N(e,l),n[2](l)},p:ue,i:ue,o:ue,d(u){u&&F(e),n[2](null)}}}s(xU,"create_fragment");function kU(n,e,t){let{selectedKeyframe:i}=e,r=new ge(ss(i)),a;r.subscribe(c=>{Nv(i,c)});let o=Object.fromEntries(Ne.all.map(c=>[c.uuid,c.displayName])),l=new Interface.CustomElements.SelectInput("keyframe-variant-selector",{options:o,value:r.get(),onChange(){r.set(l.node.getAttribute("value")),Animator.preview()}});requestAnimationFrame(()=>{a.appendChild(l.node)});function u(c){le[c?"unshift":"push"](()=>{a=c,t(0,a)})}return s(u,"div0_binding"),n.$$set=c=>{"selectedKeyframe"in c&&t(1,i=c.selectedKeyframe)},[a,i,u]}s(kU,"instance");var Cd=class extends Be{constructor(e){super(),De(this,e,kU,xU,Oe,{selectedKeyframe:1})}};s(Cd,"VariantKeyframePanel");var C3=Cd;(()=>{let n=Blockbench.addCSS(".select-container.svelte-1q3wj4f{flex-grow:1;height:30px;padding-left:8px}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();function EU(n){let e,t,i=w("panel.keyframe.commands.title")+"",r,a,o,l,u,c,d,m=w("panel.keyframe.repeat.title")+"",p,f,_,g,h,v,y,k=w("panel.keyframe.repeat_frequency.title")+"",b,x,E,C,j,S;return{c(){e=P("div"),t=P("label"),r=Re(i),o=G(),l=P("textarea"),u=G(),c=P("div"),d=P("label"),p=Re(m),_=G(),g=P("input"),h=G(),v=P("div"),y=P("label"),b=Re(k),E=G(),C=P("input"),T(t,"for","commands_input"),T(t,"class","undefined"),Ge(t,"font-weight","unset"),T(t,"title",a=w("panel.keyframe.commands.description")),T(l,"id","commands_input"),T(l,"class","dark_bordered code keyframe_input tab_target svelte-phbv96"),T(e,"class","bar flex"),T(d,"for","repeat_input"),T(d,"class","undefined"),Ge(d,"font-weight","unset"),T(d,"title",f=w("animated_java.panel.keyframe.repeat.description")),T(g,"id","repeat_input"),T(g,"class","dark_bordered tab_target svelte-phbv96"),T(g,"type","checkbox"),T(c,"class","bar flex"),T(y,"for","repeat_frequency_input"),T(y,"class","undefined"),Ge(y,"font-weight","unset"),T(y,"title",x=w("animated_java.panel.keyframe.repeat_frequency.description")),T(C,"id","repeat_frequency_input"),T(C,"class","dark_bordered tab_target"),T(C,"type","number"),T(v,"class","bar flex")},m(B,O){L(B,e,O),N(e,t),N(t,r),N(e,o),N(e,l),bt(l,n[0]),L(B,u,O),L(B,c,O),N(c,d),N(d,p),N(c,_),N(c,g),g.checked=n[1],L(B,h,O),L(B,v,O),N(v,y),N(y,b),N(v,E),N(v,C),bt(C,n[2]),j||(S=[Le(l,"input",n[7]),Le(g,"change",n[8]),Le(C,"input",n[9])],j=!0)},p(B,[O]){O&1&&bt(l,B[0]),O&2&&(g.checked=B[1]),O&4&&ko(C.value)!==B[2]&&bt(C,B[2])},i:ue,o:ue,d(B){B&&F(e),B&&F(u),B&&F(c),B&&F(h),B&&F(v),j=!1,Lt(S)}}}s(EU,"create_fragment");function TU(n,e,t){let i,r,a,{selectedKeyframe:o}=e,l=new ge(ya(o)||"");xo(n,l,f=>t(0,i=f));let u=new ge(ls(o)||!1);xo(n,u,f=>t(1,r=f));let c=new ge(cs(o)||1);xo(n,c,f=>t(2,a=f)),l.subscribe(f=>{Bv(o,f)}),u.subscribe(f=>{Dv(o,f)}),c.subscribe(f=>{f<1&&(f=1),c.set(f),Mv(o,f)});function d(){i=this.value,l.set(i)}s(d,"textarea_input_handler");function m(){r=this.checked,u.set(r)}s(m,"input0_change_handler");function p(){a=ko(this.value),c.set(a)}return s(p,"input1_input_handler"),n.$$set=f=>{"selectedKeyframe"in f&&t(6,o=f.selectedKeyframe)},[i,r,a,l,u,c,o,d,m,p]}s(TU,"instance");var Ad=class extends Be{constructor(e){super(),De(this,e,TU,EU,Oe,{selectedKeyframe:6})}};s(Ad,"CommandsKeyframePanel");var A3=Ad;(()=>{let n=Blockbench.addCSS("textarea.svelte-phbv96{min-height:90px;height:30px;resize:vertical;text-wrap:nowrap}input[type='checkbox'].svelte-phbv96{display:flex;align-items:center;justify-content:flex-start;padding-left:8px}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();function CU(n){let e,t,i=n[0].channel+"",r,a;return{c(){e=P("p"),t=Re("Unknown keyframe channel: '"),r=Re(i),a=Re("'")},m(o,l){L(o,e,l),N(e,t),N(e,r),N(e,a)},p(o,l){l&1&&i!==(i=o[0].channel+"")&&ot(r,i)},i:ue,o:ue,d(o){o&&F(e)}}}s(CU,"create_else_block");function AU(n){let e,t;return e=new A3({props:{selectedKeyframe:n[0]}}),{c(){_e(e.$$.fragment)},m(i,r){me(e,i,r),t=!0},p(i,r){let a={};r&1&&(a.selectedKeyframe=i[0]),e.$set(a)},i(i){t||(q(e.$$.fragment,i),t=!0)},o(i){Z(e.$$.fragment,i),t=!1},d(i){de(e,i)}}}s(AU,"create_if_block_1");function SU(n){let e,t;return e=new C3({props:{selectedKeyframe:n[0]}}),{c(){_e(e.$$.fragment)},m(i,r){me(e,i,r),t=!0},p(i,r){let a={};r&1&&(a.selectedKeyframe=i[0]),e.$set(a)},i(i){t||(q(e.$$.fragment,i),t=!0)},o(i){Z(e.$$.fragment,i),t=!1},d(i){de(e,i)}}}s(SU,"create_if_block");function jU(n){let e,t,i,r,a,o,l=w("panel.keyframe.execute_condition.title")+"",u,c,d,m,p,f,_,g=[SU,AU,CU],h=[];function v(y,k){return y[0].channel==="variant"?0:y[0].channel==="commands"?1:2}return s(v,"select_block_type"),t=v(n,-1),i=h[t]=g[t](n),{c(){e=P("div"),i.c(),r=G(),a=P("div"),o=P("label"),u=Re(l),d=G(),m=P("input"),T(o,"for","execute_condition"),T(o,"class","undefined"),Ge(o,"font-weight","unset"),T(o,"title",c=w("panel.keyframe.execute_condition.description")),T(m,"id","execute_condition"),T(m,"type","text"),T(m,"class","dark_bordered code keyframe_input tab_target"),T(a,"class","bar flex"),T(e,"class","container svelte-mrrs0k")},m(y,k){L(y,e,k),h[t].m(e,null),N(e,r),N(e,a),N(a,o),N(o,u),N(a,d),N(a,m),bt(m,n[1]),p=!0,f||(_=Le(m,"input",n[3]),f=!0)},p(y,[k]){let b=t;t=v(y,k),t===b?h[t].p(y,k):(Et(),Z(h[b],1,1,()=>{h[b]=null}),Tt(),i=h[t],i?i.p(y,k):(i=h[t]=g[t](y),i.c()),q(i,1),i.m(e,r)),k&2&&m.value!==y[1]&&bt(m,y[1])},i(y){p||(q(i),p=!0)},o(y){Z(i),p=!1},d(y){y&&F(e),h[t].d(),f=!1,_()}}}s(jU,"create_fragment");function IU(n,e,t){let i,{selectedKeyframe:r}=e,a=new ge(Wr(r)||"");xo(n,a,l=>t(1,i=l)),a.subscribe(l=>{Rv(r,l)});function o(){i=this.value,a.set(i)}return s(o,"input_input_handler"),n.$$set=l=>{"selectedKeyframe"in l&&t(0,r=l.selectedKeyframe)},[r,i,a,o]}s(IU,"instance");var Sd=class extends Be{constructor(e){super(),De(this,e,IU,jU,Oe,{selectedKeyframe:0})}};s(Sd,"CustomKeyframePanel");var S3=Sd;(()=>{let n=Blockbench.addCSS(".container.svelte-mrrs0k{display:flex;flex-direction:column}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();var j3;function OU(n){if(!Ue()||!n||!Ul.includes(n.channel))return;let e=document.querySelector("#panel_keyframe .panel_vue_wrapper .keyframe_data_point");if(!e){console.warn("Failed to find keyframe panel element. Aborting custom keyframe panel injection.");return}for(let t of[...e.children])t.remove();tr({component:S3,props:{selectedKeyframe:n},elementSelector(){return e},postMount(t){let i=jQuery("#panel_keyframe .panel_vue_wrapper #keyframe_type_label label");if(i&&n.channel){let r=n.animator.channels[n.channel];i.text(w("panel.keyframe.keyframe_title",`${r.name}`))}j3?.$destroy(),j3=t}})}s(OU,"injectCustomKeyframePanel");re.SELECT_KEYFRAME.subscribe(n=>{OU(n)});var NU=window;function Yp(n,e,t={}){let i=Object.assign({tab:" ",indentOn:/[({\[]$/,moveToNewLine:/^[)}\]]/,spellcheck:!1,catchTab:!0,preserveIdent:!0,addClosing:!0,history:!0,window:NU},t),r=i.window,a=r.document,o=[],l=[],u=-1,c=!1,d,m;n.setAttribute("contenteditable","plaintext-only"),n.setAttribute("spellcheck",i.spellcheck?"true":"false"),n.style.outline="none",n.style.overflowWrap="break-word",n.style.overflowY="auto",n.style.whiteSpace="pre-wrap";let p=!1;e(n),n.contentEditable!=="plaintext-only"&&(p=!0),p&&n.setAttribute("contenteditable","true");let f=oe(()=>{let U=y();e(n,U),k(U)},30),_=!1,g=s(U=>!te(U)&&!fe(U)&&U.key!=="Meta"&&U.key!=="Control"&&U.key!=="Alt"&&!U.key.startsWith("Arrow"),"shouldRecord"),h=oe(U=>{g(U)&&(O(),_=!1)},300),v=s((U,ce)=>{o.push([U,ce]),n.addEventListener(U,ce)},"on");v("keydown",U=>{U.defaultPrevented||(m=ne(),i.preserveIdent?E(U):C(U),i.catchTab&&S(U),i.addClosing&&j(U),i.history&&(B(U),g(U)&&!_&&(O(),_=!0)),p&&!ae(U)&&k(y()))}),v("keyup",U=>{U.defaultPrevented||U.isComposing||(m!==ne()&&f(),h(U),d&&d(ne()))}),v("focus",U=>{c=!0}),v("blur",U=>{c=!1}),v("paste",U=>{O(),A(U),O(),d&&d(ne())});function y(){let U=W(),ce={start:0,end:0,dir:void 0},{anchorNode:J,anchorOffset:Ce,focusNode:Y,focusOffset:z}=U;if(!J||!Y)throw"error1";if(J===n&&Y===n)return ce.start=Ce>0&&n.textContent?n.textContent.length:0,ce.end=z>0&&n.textContent?n.textContent.length:0,ce.dir=z>=Ce?"->":"<-",ce;if(J.nodeType===Node.ELEMENT_NODE){let be=a.createTextNode("");J.insertBefore(be,J.childNodes[Ce]),J=be,Ce=0}if(Y.nodeType===Node.ELEMENT_NODE){let be=a.createTextNode("");Y.insertBefore(be,Y.childNodes[z]),Y=be,z=0}return V(n,be=>{if(be===J&&be===Y)return ce.start+=Ce,ce.end+=z,ce.dir=Ce<=z?"->":"<-","stop";if(be===J)if(ce.start+=Ce,!ce.dir)ce.dir="->";else return"stop";else if(be===Y)if(ce.end+=z,!ce.dir)ce.dir="<-";else return"stop";be.nodeType===Node.TEXT_NODE&&(ce.dir!="->"&&(ce.start+=be.nodeValue.length),ce.dir!="<-"&&(ce.end+=be.nodeValue.length))}),n.normalize(),ce}s(y,"save");function k(U){let ce=W(),J,Ce=0,Y,z=0;if(U.dir||(U.dir="->"),U.start<0&&(U.start=0),U.end<0&&(U.end=0),U.dir=="<-"){let{start:H,end:ie}=U;U.start=ie,U.end=H}let be=0;V(n,H=>{if(H.nodeType!==Node.TEXT_NODE)return;let ie=(H.nodeValue||"").length;if(be+ie>U.start&&(J||(J=H,Ce=U.start-be),be+ie>U.end))return Y=H,z=U.end-be,"stop";be+=ie}),J||(J=n,Ce=n.childNodes.length),Y||(Y=n,z=n.childNodes.length),U.dir=="<-"&&([J,Ce,Y,z]=[Y,z,J,Ce]),ce.setBaseAndExtent(J,Ce,Y,z)}s(k,"restore");function b(){let ce=W().getRangeAt(0),J=a.createRange();return J.selectNodeContents(n),J.setEnd(ce.startContainer,ce.startOffset),J.toString()}s(b,"beforeCursor");function x(){let ce=W().getRangeAt(0),J=a.createRange();return J.selectNodeContents(n),J.setStart(ce.endContainer,ce.endOffset),J.toString()}s(x,"afterCursor");function E(U){if(U.key==="Enter"){let ce=b(),J=x(),[Ce]=xe(ce),Y=Ce;if(i.indentOn.test(ce)&&(Y+=i.tab),Y.length>0?(pe(U),U.stopPropagation(),se(` +`+Y)):C(U),Y!==Ce&&i.moveToNewLine.test(J)){let z=y();se(` +`+Ce),k(z)}}}s(E,"handleNewLine");function C(U){if(p&&U.key==="Enter")if(pe(U),U.stopPropagation(),x()==""){se(` + `);let ce=y();ce.start=--ce.end,k(ce)}else se(` +`)}s(C,"legacyNewLineFix");function j(U){let ce=`([{'"`,J=`)]}'"`,Ce=x(),Y=b(),z=Y.substr(Y.length-1)==="\\",be=Ce.substr(0,1);if(J.includes(U.key)&&!z&&be===U.key){let H=y();pe(U),H.start=++H.end,k(H)}else if(ce.includes(U.key)&&!z&&(`"'`.includes(U.key)||[""," ",` +`].includes(be))){pe(U);let H=y(),ie=H.start==H.end?"":W().toString(),Ie=U.key+ie+J[ce.indexOf(U.key)];se(Ie),H.start++,H.end++,k(H)}}s(j,"handleSelfClosingCharacters");function S(U){if(U.key==="Tab")if(pe(U),U.shiftKey){let ce=b(),[J,Ce]=xe(ce);if(J.length>0){let Y=y(),z=Math.min(i.tab.length,J.length);k({start:Ce,end:Ce+z}),a.execCommand("delete"),Y.start-=z,Y.end-=z,k(Y)}}else se(i.tab)}s(S,"handleTabCharacters");function B(U){if(te(U)){pe(U),u--;let ce=l[u];ce&&(n.innerHTML=ce.html,k(ce.pos)),u<0&&(u=0)}if(fe(U)){pe(U),u++;let ce=l[u];ce&&(n.innerHTML=ce.html,k(ce.pos)),u>=l.length&&u--}}s(B,"handleUndoRedo");function O(){if(!c)return;let U=n.innerHTML,ce=y(),J=l[u];if(J&&J.html===U&&J.pos.start===ce.start&&J.pos.end===ce.end)return;u++,l[u]={html:U,pos:ce},l.splice(u+1);let Ce=300;u>Ce&&(u=Ce,l.splice(0,1))}s(O,"recordHistory");function A(U){pe(U);let ce=(U.originalEvent||U).clipboardData.getData("text/plain").replace(/\r/g,""),J=y();se(ce),e(n),k({start:Math.min(J.start,J.end)+ce.length,end:Math.min(J.start,J.end)+ce.length,dir:"<-"})}s(A,"handlePaste");function V(U,ce){let J=[];U.firstChild&&J.push(U.firstChild);let Ce=J.pop();for(;Ce&&ce(Ce)!=="stop";)Ce.nextSibling&&J.push(Ce.nextSibling),Ce.firstChild&&J.push(Ce.firstChild),Ce=J.pop()}s(V,"visit");function K(U){return U.metaKey||U.ctrlKey}s(K,"isCtrl");function te(U){return K(U)&&!U.shiftKey&&ee(U)==="Z"}s(te,"isUndo");function fe(U){return K(U)&&U.shiftKey&&ee(U)==="Z"}s(fe,"isRedo");function ae(U){return K(U)&&ee(U)==="C"}s(ae,"isCopy");function ee(U){let ce=U.key||U.keyCode||U.which;if(ce)return(typeof ce=="string"?ce:String.fromCharCode(ce)).toUpperCase()}s(ee,"getKeyCode");function se(U){U=U.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),a.execCommand("insertHTML",!1,U)}s(se,"insert");function oe(U,ce){let J=0;return(...Ce)=>{clearTimeout(J),J=r.setTimeout(()=>U(...Ce),ce)}}s(oe,"debounce");function xe(U){let ce=U.length-1;for(;ce>=0&&U[ce]!==` +`;)ce--;ce++;let J=ce;for(;Ji.style.top=`-${r.scrollTop}px`));let o=(r.textContent||"").replace(/\n+$/,` `).split(` -`).length+1,l="";for(let c=1;c{var v;_.innerHTML=p((v=_.textContent)!==null&&v!==void 0?v:"",r)}:_=>{};return o?$3(f):f}return s(m,"wrapHighlight"),n.addEventListener("input",d),{destroy(){u(),n.removeEventListener("input",d)},update(p){({highlight:t,onUpdate:i,syntax:r,value:a,withLineNumbers:o,...l}=p),e.highlight!==t||e.withLineNumbers!==o?(u(),c=Rp(n,m(t),e)):c.updateOptions(l),a!==c.toString()&&c.updateCode(a),e={highlight:t,value:a,withLineNumbers:o,...l}}}}s(K3,"codejar");function qz(n){let e;return{c(){e=Ne(n[1])},m(t,i){G(t,e,i)},p(t,i){i&2&&tt(e,t[1])},d(t){t&&z(e)}}}s(qz,"create_else_block");function Wz(n){let e,t=n[12](n[1],n[13])+"",i;return{c(){e=new As(!1),i=St(),e.a=i},m(r,a){e.m(t,r,a),G(r,i,a)},p(r,a){a&12290&&t!==(t=r[12](r[1],r[13])+"")&&e.p(t)},d(r){r&&z(i),r&&e.d()}}}s(Wz,"create_if_block");function Zz(n){let e,t,i,r,a,o,l,c;function u(p,f){return p[12]?Wz:qz}s(u,"select_block_type");let d=u(n,-1),m=d(n);return{c(){e=V("pre"),t=V("code"),m.c(),T(t,"class",i=n[13]?`language-${n[13]}`:""),T(e,"class",r=(n[13]?`language-${n[13]}`:"")+" "+(n[2]??"")),T(e,"style",a=n[3]?n[3]:"")},m(p,f){G(p,e,f),N(e,t),m.m(t,null),n[15](e),l||(c=Dr(o=K3.call(null,e,{addClosing:n[4],catchTab:n[5],highlight:n[12],history:n[6],indentOn:n[7],onUpdate:n[14],preserveIdent:n[8],spellcheck:n[9],syntax:n[13],tab:n[10],value:n[1],withLineNumbers:n[11]})),l=!0)},p(p,[f]){d===(d=u(p,f))&&m?m.p(p,f):(m.d(1),m=d(p),m&&(m.c(),m.m(t,null))),f&8192&&i!==(i=p[13]?`language-${p[13]}`:"")&&T(t,"class",i),f&8196&&r!==(r=(p[13]?`language-${p[13]}`:"")+" "+(p[2]??""))&&T(e,"class",r),f&8&&a!==(a=p[3]?p[3]:"")&&T(e,"style",a),o&&Vn(o.update)&&f&16370&&o.update.call(null,{addClosing:p[4],catchTab:p[5],highlight:p[12],history:p[6],indentOn:p[7],onUpdate:p[14],preserveIdent:p[8],spellcheck:p[9],syntax:p[13],tab:p[10],value:p[1],withLineNumbers:p[11]})},i:re,o:re,d(p){p&&z(e),m.d(),n[15](null),l=!1,c()}}}s(Zz,"create_fragment");function Xz(n,e,t){let i=af(),{element:r=void 0}=e,{class:a=void 0}=e,{style:o=void 0}=e,{addClosing:l=!0}=e,{catchTab:c=!0}=e,{history:u=!0}=e,{indentOn:d=/{$/}=e,{preserveIdent:m=!0}=e,{spellcheck:p=!1}=e,{tab:f=" "}=e,{withLineNumbers:_=void 0}=e,{highlight:v=void 0}=e,{syntax:g=void 0}=e,{value:h=""}=e;function b(y){t(1,h=y),i("change",{value:y})}s(b,"onUpdate");function x(y){se[y?"unshift":"push"](()=>{r=y,t(0,r)})}return s(x,"pre_binding"),n.$$set=y=>{"element"in y&&t(0,r=y.element),"class"in y&&t(2,a=y.class),"style"in y&&t(3,o=y.style),"addClosing"in y&&t(4,l=y.addClosing),"catchTab"in y&&t(5,c=y.catchTab),"history"in y&&t(6,u=y.history),"indentOn"in y&&t(7,d=y.indentOn),"preserveIdent"in y&&t(8,m=y.preserveIdent),"spellcheck"in y&&t(9,p=y.spellcheck),"tab"in y&&t(10,f=y.tab),"withLineNumbers"in y&&t(11,_=y.withLineNumbers),"highlight"in y&&t(12,v=y.highlight),"syntax"in y&&t(13,g=y.syntax),"value"in y&&t(1,h=y.value)},[r,h,a,o,l,c,u,d,m,p,f,_,v,g,b,x]}s(Xz,"instance");var gd=class extends je{constructor(e){super(),Ie(this,e,Xz,Zz,Ae,{element:0,class:2,style:3,addClosing:4,catchTab:5,history:6,indentOn:7,preserveIdent:8,spellcheck:9,tab:10,withLineNumbers:11,highlight:12,syntax:13,value:1})}};s(gd,"CodeJar");var Mp=gd;function q3(n){let e;return{c(){e=V("textarea"),e.readOnly=!0,e.value=n[10],T(e,"class","svelte-1vipl8y")},m(t,i){G(t,e,i)},p(t,i){i&1024&&(e.value=t[10])},d(t){t&&z(e)}}}s(q3,"create_if_block");function Yz(n){let e,t=w("panel.text_display.title")+"",i,r,a,o,l,c,u,d,m,p,f,_,v,g,h,b,x,y,k,C,A,I;function S(E){n[18](E)}s(S,"codejar_value_binding");let L={syntax:"json",highlight:Qz,style:`\r +`).length+1,l="";for(let u=1;u{var g;_.innerHTML=p((g=_.textContent)!==null&&g!==void 0?g:"",r)}:_=>{};return o?I3(f):f}return s(m,"wrapHighlight"),n.addEventListener("input",d),{destroy(){c(),n.removeEventListener("input",d)},update(p){({highlight:t,onUpdate:i,syntax:r,value:a,withLineNumbers:o,...l}=p),e.highlight!==t||e.withLineNumbers!==o?(c(),u=Yp(n,m(t),e)):u.updateOptions(l),a!==u.toString()&&u.updateCode(a),e={highlight:t,value:a,withLineNumbers:o,...l}}}}s(O3,"codejar");function RU(n){let e;return{c(){e=Re(n[1])},m(t,i){L(t,e,i)},p(t,i){i&2&&ot(e,t[1])},d(t){t&&F(e)}}}s(RU,"create_else_block");function DU(n){let e,t=n[12](n[1],n[13])+"",i;return{c(){e=new Rs(!1),i=Dt(),e.a=i},m(r,a){e.m(t,r,a),L(r,i,a)},p(r,a){a&12290&&t!==(t=r[12](r[1],r[13])+"")&&e.p(t)},d(r){r&&F(i),r&&e.d()}}}s(DU,"create_if_block");function MU(n){let e,t,i,r,a,o,l,u;function c(p,f){return p[12]?DU:RU}s(c,"select_block_type");let d=c(n,-1),m=d(n);return{c(){e=P("pre"),t=P("code"),m.c(),T(t,"class",i=n[13]?`language-${n[13]}`:""),T(e,"class",r=(n[13]?`language-${n[13]}`:"")+" "+(n[2]??"")),T(e,"style",a=n[3]?n[3]:"")},m(p,f){L(p,e,f),N(e,t),m.m(t,null),n[15](e),l||(u=Lr(o=O3.call(null,e,{addClosing:n[4],catchTab:n[5],highlight:n[12],history:n[6],indentOn:n[7],onUpdate:n[14],preserveIdent:n[8],spellcheck:n[9],syntax:n[13],tab:n[10],value:n[1],withLineNumbers:n[11]})),l=!0)},p(p,[f]){d===(d=c(p,f))&&m?m.p(p,f):(m.d(1),m=d(p),m&&(m.c(),m.m(t,null))),f&8192&&i!==(i=p[13]?`language-${p[13]}`:"")&&T(t,"class",i),f&8196&&r!==(r=(p[13]?`language-${p[13]}`:"")+" "+(p[2]??""))&&T(e,"class",r),f&8&&a!==(a=p[3]?p[3]:"")&&T(e,"style",a),o&&Rn(o.update)&&f&16370&&o.update.call(null,{addClosing:p[4],catchTab:p[5],highlight:p[12],history:p[6],indentOn:p[7],onUpdate:p[14],preserveIdent:p[8],spellcheck:p[9],syntax:p[13],tab:p[10],value:p[1],withLineNumbers:p[11]})},i:ue,o:ue,d(p){p&&F(e),m.d(),n[15](null),l=!1,u()}}}s(MU,"create_fragment");function FU(n,e,t){let i=hf(),{element:r=void 0}=e,{class:a=void 0}=e,{style:o=void 0}=e,{addClosing:l=!0}=e,{catchTab:u=!0}=e,{history:c=!0}=e,{indentOn:d=/{$/}=e,{preserveIdent:m=!0}=e,{spellcheck:p=!1}=e,{tab:f=" "}=e,{withLineNumbers:_=void 0}=e,{highlight:g=void 0}=e,{syntax:h=void 0}=e,{value:v=""}=e;function y(b){t(1,v=b),i("change",{value:b})}s(y,"onUpdate");function k(b){le[b?"unshift":"push"](()=>{r=b,t(0,r)})}return s(k,"pre_binding"),n.$$set=b=>{"element"in b&&t(0,r=b.element),"class"in b&&t(2,a=b.class),"style"in b&&t(3,o=b.style),"addClosing"in b&&t(4,l=b.addClosing),"catchTab"in b&&t(5,u=b.catchTab),"history"in b&&t(6,c=b.history),"indentOn"in b&&t(7,d=b.indentOn),"preserveIdent"in b&&t(8,m=b.preserveIdent),"spellcheck"in b&&t(9,p=b.spellcheck),"tab"in b&&t(10,f=b.tab),"withLineNumbers"in b&&t(11,_=b.withLineNumbers),"highlight"in b&&t(12,g=b.highlight),"syntax"in b&&t(13,h=b.syntax),"value"in b&&t(1,v=b.value)},[r,v,a,o,l,u,c,d,m,p,f,_,g,h,y,k]}s(FU,"instance");var jd=class extends Be{constructor(e){super(),De(this,e,FU,MU,Oe,{element:0,class:2,style:3,addClosing:4,catchTab:5,history:6,indentOn:7,preserveIdent:8,spellcheck:9,tab:10,withLineNumbers:11,highlight:12,syntax:13,value:1})}};s(jd,"CodeJar");var Qp=jd;function N3(n){let e;return{c(){e=P("textarea"),e.readOnly=!0,e.value=n[10],T(e,"class","svelte-1vipl8y")},m(t,i){L(t,e,i)},p(t,i){i&1024&&(e.value=t[10])},d(t){t&&F(e)}}}s(N3,"create_if_block");function LU(n){let e,t=w("panel.text_display.title")+"",i,r,a,o,l,u,c,d,m,p,f,_,g,h,v,y,k,b,x,E,C,j;function S(A){n[18](A)}s(S,"codejar_value_binding");let B={syntax:"json",highlight:PU,style:`\r background-color: var(--color-button);\r font-family: var(--font-code);\r font-size: 14px;\r @@ -3852,10 +3862,10 @@ dir <%export_namespace%> {\r white-space: nowrap;\r margin-top: 0px;\r margin-left: 2px;\r - `};n[9]!==void 0&&(L.value=n[9]),y=new Mp({props:L}),n[17](y),se.push(()=>be(y,"value",S)),y.$on("change",n[19]);let O=n[10]&&q3(n);return{c(){e=V("p"),i=Ne(t),a=K(),o=V("div"),l=V("div"),c=K(),u=V("div"),d=K(),m=V("div"),p=K(),f=V("div"),_=K(),v=V("div"),h=K(),b=V("div"),x=V("div"),fe(y.$$.fragment),C=K(),O&&O.c(),T(e,"class","panel_toolbar_label label svelte-1vipl8y"),T(e,"style",r=n[0]?"":"visibility:hidden; height: 0px;"),T(l,"class","content"),T(u,"class","content"),T(m,"class","content"),T(f,"class","content"),T(v,"class","content"),T(o,"class","toolbar custom-toolbar svelte-1vipl8y"),T(o,"style",g=n[0]?"":"visibility:hidden; height: 0px;"),T(x,"class","content"),T(b,"class","toolbar"),T(b,"style",A=n[0]?"margin-bottom: 16px;":"visibility:hidden; height: 0px;")},m(E,B){G(E,e,B),N(e,i),G(E,a,B),G(E,o,B),N(o,l),n[12](l),N(o,c),N(o,u),n[13](u),N(o,d),N(o,m),n[14](m),N(o,p),N(o,f),n[15](f),N(o,_),N(o,v),n[16](v),G(E,h,B),G(E,b,B),N(b,x),de(y,x,null),N(b,C),O&&O.m(b,null),I=!0},p(E,[B]){(!I||B&1&&r!==(r=E[0]?"":"visibility:hidden; height: 0px;"))&&T(e,"style",r),(!I||B&1&&g!==(g=E[0]?"":"visibility:hidden; height: 0px;"))&&T(o,"style",g);let H={};!k&&B&512&&(k=!0,H.value=E[9],he(()=>k=!1)),y.$set(H),E[10]?O?O.p(E,B):(O=q3(E),O.c(),O.m(b,null)):O&&(O.d(1),O=null),(!I||B&1&&A!==(A=E[0]?"margin-bottom: 16px;":"visibility:hidden; height: 0px;"))&&T(b,"style",A)},i(E){I||(W(y.$$.fragment,E),I=!0)},o(E){Y(y.$$.fragment,E),I=!1},d(E){E&&z(e),E&&z(a),E&&z(o),n[12](null),n[13](null),n[14](null),n[15](null),n[16](null),E&&z(h),E&&z(b),n[17](null),ue(y),O&&O.d()}}}s(Yz,"create_fragment");function Qz(n,e){return e?Prism.highlight(n,Prism.languages[e],e):n}s(Qz,"highlight");function eU(n,e,t){let i,r=re,a=s(()=>(r(),r=ze(d,O=>t(9,i=O)),d),"$$subscribe_text"),o,l=re,c=s(()=>(l(),l=ze(m,O=>t(10,o=O)),m),"$$subscribe_error");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l());let u=Je.selected.at(0),d=u?._text??new me("");a();let m=u?._textError??new me("");c();let p,f,_,v,g,h;te.UPDATE_SELECTION.subscribe(()=>{if(t(0,u=Je.selected.at(0)),!u)return;a(t(1,d=u._text)),c(t(2,m=u.textError)),Fp.setValue(u.lineWidth);let O=u.backgroundColor+ko(u.backgroundAlpha);ro.set(O),bs.set(u.shadow),Xl.set(u.align),vs.set(u.seeThrough)}),requestAnimationFrame(()=>{p.appendChild(Fp.node),f.appendChild(ro.node),_.appendChild(bs.node),v.appendChild(Xl.node),g.appendChild(vs.node),b()});function b(){h&&(t(8,h.$$.ctx[0].style.overflowWrap="unset",h),t(8,h.$$.ctx[0].style.whiteSpace="nowrap",h))}s(b,"forceNoWrap");function x(O){se[O?"unshift":"push"](()=>{p=O,t(3,p)})}s(x,"div0_binding");function y(O){se[O?"unshift":"push"](()=>{f=O,t(4,f)})}s(y,"div1_binding");function k(O){se[O?"unshift":"push"](()=>{_=O,t(5,_)})}s(k,"div2_binding");function C(O){se[O?"unshift":"push"](()=>{v=O,t(6,v)})}s(C,"div3_binding");function A(O){se[O?"unshift":"push"](()=>{g=O,t(7,g)})}s(A,"div4_binding");function I(O){se[O?"unshift":"push"](()=>{h=O,t(8,h)})}s(I,"codejar_binding");function S(O){i=O,d.set(i)}return s(S,"codejar_value_binding"),[u,d,m,p,f,_,v,g,h,i,o,b,x,y,k,C,A,I,S,s(()=>b(),"change_handler")]}s(eU,"instance");var hd=class extends je{constructor(e){super(),Ie(this,e,eU,Yz,Ae,{})}};s(hd,"TextDisplayElementPanel");var W3=hd;(()=>{let n=Blockbench.addCSS(".label.svelte-1vipl8y{margin-bottom:-3px !important}textarea.svelte-1vipl8y{margin-right:20px;margin-left:2px;color:var(--color-error);background-color:var(--color-back);padding:4px 8px;text-wrap:pretty;overflow:scroll;height:10rem;font-size:small;font-family:var(--font-code)}.custom-toolbar.svelte-1vipl8y{display:flex;flex-direction:row;margin-bottom:1px}.custom-toolbar.svelte-1vipl8y .sp-replacer{padding:4px 18px !important;height:28px !important;margin:2px 0px !important}.custom-toolbar.svelte-1vipl8y [toolbar_item='animated_java:textDisplayShadowToggle']{margin-right:2px !important}.custom-toolbar.svelte-1vipl8y .bar_select{height:28px !important;margin:2px 0px !important}.custom-toolbar.svelte-1vipl8y bb-select{height:28px !important;display:flex;align-items:center;padding-top:0}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();Qr({component:W3,props:{},elementSelector(){return document.querySelector("#panel_element")}});var Fp=new NumSlider(`${_e.name}:textDisplayLineWidthSlider`,{name:w("tool.text_display.line_width.title"),icon:"format_size",description:w("tool.text_display.line_width.description"),settings:{min:1,max:1e4,interval:1},condition:()=>Ue()&&!!Je.selected.length,get(){let n=Je.selected[0];return n?n.lineWidth:0},change(n){let e=Je.selected[0];e&&(e.lineWidth=Math.clamp(n(e.lineWidth),1,1e4))}}),ro=new ColorPicker(`${_e.name}:textDisplayBackgroundColorPicker`,{name:w("tool.text_display.background_color.title"),icon:"format_color_fill",description:w("tool.text_display.background_color.description"),condition:()=>Ue()&&!!Je.selected.length});ro.jq.spectrum("option","defaultColor","#0000003f");ro.get=function(){let n=Je.selected[0];return n?new tinycolor(n.backgroundColor+ko(n.backgroundAlpha)):new tinycolor("#0000003f")};ro.set=function(n){this.value=new tinycolor(n),this.jq.spectrum("set",this.value.toHex8String());let e=Je.selected[0];return e?(e.backgroundColor=this.value.toHexString(),e.backgroundAlpha=this.value.getAlpha(),this):this};ro.change=function(n){let e=Je.selected[0];return e?(e.backgroundColor=n.toHexString(),e.backgroundAlpha=n.getAlpha(),this):this};var bs=new Toggle(`${_e.name}:textDisplayShadowToggle`,{name:w("tool.text_display.text_shadow.title"),icon:"check_box_outline_blank",description:w("tool.text_display.text_shadow.description"),condition:()=>Ue()&&!!Je.selected.length,click(){},onChange(){let n=bs;n.setIcon(n.value?"check_box":"check_box_outline_blank");let e=Je.selected[0];e&&(e.shadow=bs.value)}});bs.set=function(n){return this.value===n?this:(this.click(),this)};var Xl=new BarSelect(`${_e.name}:textDisplayAlignmentSelect`,{name:w("tool.text_display.text_alignment.title"),icon:"format_align_left",description:w("tool.text_display.text_alignment.description"),condition:()=>Ue()&&!!Je.selected.length,options:{left:w("tool.text_display.text_alignment.options.left"),center:w("tool.text_display.text_alignment.options.center"),right:w("tool.text_display.text_alignment.options.right")}});Xl.get=function(){let n=Je.selected[0];return n?n.align:"left"};Xl.set=function(n){let e=Je.selected[0];if(!e)return this;this.value=n;let t=this.getNameFor(n);return this.nodes.forEach(i=>{$(i).find("bb-select").text(t)}),this.nodes.includes(this.node)||$(this.node).find("bb-select").text(t),e.align=n,this};var vs=new Toggle(`${_e.name}:textDisplaySeeThroughToggle`,{name:w("tool.text_display.see_through.title"),icon:"check_box_outline_blank",description:w("tool.text_display.see_through.description"),condition:()=>Ue()&&!!Je.selected.length,click(){},onChange(){let n=vs;n.setIcon(n.value?"check_box":"check_box_outline_blank");let e=Je.selected[0];e&&(e.seeThrough=vs.value)}});vs.set=function(n){return this.value===n?this:(this.click(),this)};function tU(n){let e,t=w("panel.vanilla_item_display.title")+"",i,r,a,o,l,c,u,d,m,p,f,_,v,g;return{c(){e=V("p"),i=Ne(t),a=K(),o=V("div"),l=V("div"),c=V("input"),m=K(),p=V("div"),f=Ne(n[4]),T(e,"class","panel_toolbar_label label svelte-1gpclxv"),T(e,"style",r=n[2]?"":"visibility:hidden; height: 0px;"),T(c,"type","text"),T(c,"class","svelte-1gpclxv"),T(l,"class","content"),$e(l,"width","95%"),T(o,"class","toolbar custom-toolbar svelte-1gpclxv"),T(o,"style",u=n[2]?"":"visibility:hidden; height: 0px;"),T(o,"title",d=w("panel.vanilla_item_display.description")),T(p,"class","error svelte-1gpclxv"),T(p,"style",_=n[4]?"":"visibility:hidden; height: 0px; color: var(--color-error);")},m(h,b){G(h,e,b),N(e,i),G(h,a,b),G(h,o,b),N(o,l),N(l,c),mt(c,n[3]),G(h,m,b),G(h,p,b),N(p,f),v||(g=De(c,"input",n[5]),v=!0)},p(h,[b]){b&4&&r!==(r=h[2]?"":"visibility:hidden; height: 0px;")&&T(e,"style",r),b&8&&c.value!==h[3]&&mt(c,h[3]),b&4&&u!==(u=h[2]?"":"visibility:hidden; height: 0px;")&&T(o,"style",u),b&16&&tt(f,h[4]),b&16&&_!==(_=h[4]?"":"visibility:hidden; height: 0px; color: var(--color-error);")&&T(p,"style",_)},i:re,o:re,d(h){h&&z(e),h&&z(a),h&&z(o),h&&z(m),h&&z(p),v=!1,g()}}}s(tU,"create_fragment");function nU(n,e,t){let i,r=re,a=s(()=>(r(),r=ze(d,_=>t(3,i=_)),d),"$$subscribe_item"),o,l=re,c=s(()=>(l(),l=ze(m,_=>t(4,o=_)),m),"$$subscribe_error");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l());let u=gt.selected.at(0),d=new me("");a();let m=new me("");c();let p=!1;te.UPDATE_SELECTION.subscribe(()=>{if(u=gt.selected.at(0),!u||selected.length>1){a(t(0,d=new me(""))),c(t(1,m=new me(""))),t(2,p=!1);return}a(t(0,d=u._item)),c(t(1,m=u.error)),t(2,p=!0)});function f(){i=this.value,d.set(i)}return s(f,"input_input_handler"),[d,m,p,i,o,f]}s(nU,"instance");var bd=class extends je{constructor(e){super(),Ie(this,e,nU,tU,Ae,{})}};s(bd,"VanillaItemDisplayElementPanel");var Z3=bd;(()=>{let n=Blockbench.addCSS("input.svelte-1gpclxv{background-color:var(--color-button);padding:2px 8px;width:100%}.label.svelte-1gpclxv{margin-bottom:-3px !important}.custom-toolbar.svelte-1gpclxv{display:flex;flex-direction:row;margin-bottom:1px}.custom-toolbar.svelte-1gpclxv .sp-replacer{padding:4px 18px !important;height:28px !important;margin:1px 0px !important}.error.svelte-1gpclxv{margin:2px 8px;font-size:14px;color:var(--color-error)}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();Qr({component:Z3,props:{},elementSelector(){return document.querySelector("#panel_element")}});function iU(n){let e,t=w("panel.vanilla_block_display.title")+"",i,r,a,o,l,c,u,d,m,p,f,_,v,g;return{c(){e=V("p"),i=Ne(t),a=K(),o=V("div"),l=V("div"),c=V("input"),m=K(),p=V("div"),f=Ne(n[4]),T(e,"class","panel_toolbar_label label svelte-1gpclxv"),T(e,"style",r=n[2]?"":"visibility:hidden; height: 0px;"),T(c,"type","text"),T(c,"class","svelte-1gpclxv"),T(l,"class","content"),$e(l,"width","95%"),T(o,"class","toolbar custom-toolbar svelte-1gpclxv"),T(o,"style",u=n[2]?"":"visibility:hidden; height: 0px;"),T(o,"title",d=w("panel.vanilla_block_display.description")),T(p,"class","error svelte-1gpclxv"),T(p,"style",_=n[4]?"":"visibility:hidden; height: 0px; color: var(--color-error);")},m(h,b){G(h,e,b),N(e,i),G(h,a,b),G(h,o,b),N(o,l),N(l,c),mt(c,n[3]),G(h,m,b),G(h,p,b),N(p,f),v||(g=De(c,"input",n[5]),v=!0)},p(h,[b]){b&4&&r!==(r=h[2]?"":"visibility:hidden; height: 0px;")&&T(e,"style",r),b&8&&c.value!==h[3]&&mt(c,h[3]),b&4&&u!==(u=h[2]?"":"visibility:hidden; height: 0px;")&&T(o,"style",u),b&16&&tt(f,h[4]),b&16&&_!==(_=h[4]?"":"visibility:hidden; height: 0px; color: var(--color-error);")&&T(p,"style",_)},i:re,o:re,d(h){h&&z(e),h&&z(a),h&&z(o),h&&z(m),h&&z(p),v=!1,g()}}}s(iU,"create_fragment");function rU(n,e,t){let i,r=re,a=s(()=>(r(),r=ze(d,_=>t(3,i=_)),d),"$$subscribe_block"),o,l=re,c=s(()=>(l(),l=ze(m,_=>t(4,o=_)),m),"$$subscribe_error");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l());let u=ft.selected.at(0),d=new me("");a();let m=new me("");c();let p=!1;te.UPDATE_SELECTION.subscribe(()=>{if(u=ft.selected.at(0),!u||selected.length>1){a(t(0,d=new me(""))),c(t(1,m=new me(""))),t(2,p=!1);return}a(t(0,d=u._block)),c(t(1,m=u.error)),t(2,p=!0)});function f(){i=this.value,d.set(i)}return s(f,"input_input_handler"),[d,m,p,i,o,f]}s(rU,"instance");var vd=class extends je{constructor(e){super(),Ie(this,e,rU,iU,Ae,{})}};s(vd,"VanillaBlockDisplayElementPanel");var X3=vd;(()=>{let n=Blockbench.addCSS("input.svelte-1gpclxv{background-color:var(--color-button);padding:2px 8px;width:100%}.label.svelte-1gpclxv{margin-bottom:-3px !important}.custom-toolbar.svelte-1gpclxv{display:flex;flex-direction:row;margin-bottom:1px}.custom-toolbar.svelte-1gpclxv .sp-replacer{padding:4px 18px !important;height:28px !important;margin:1px 0px !important}.error.svelte-1gpclxv{margin:2px 8px;font-size:14px;color:var(--color-error)}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();Qr({component:X3,props:{},elementSelector(){return document.querySelector("#panel_element")}});function aU(n,e,t){if(ne[e.length-1])return e.length-1;let i=0,r=0,a=e.length-1;for(;a-r!==1;)i=r+Math.floor((a-r)/2),n>=e[i]?r=i:a=i;return t?a:r}s(aU,"findIntervalBorderIndex");function oU(n,e=1){if(n<2)throw new Error(`steps must be > 2, got: ${n}`);let t=e/n;return Array.from({length:n},(i,r)=>r*t)}s(oU,"stepRange");var Ye=class{static step0(e){return e>0?1:0}static step1(e){return e>=1?1:0}static linear(e){return e}static quad(e){return e*e}static cubic(e){return e*e*e}static poly(e){return t=>Math.pow(t,e)}static sin(e){return 1-Math.cos(e*Math.PI/2)}static circle(e){return 1-Math.sqrt(1-e*e)}static exp(e){return Math.pow(2,10*(e-1))}static elastic(e=1){let t=e*Math.PI;return i=>1-Math.pow(Math.cos(i*Math.PI/2),3)*Math.cos(i*t)}static back(e=1.70158){return t=>t*t*((e+1)*t-e)}static bounce(e=.5){let t=s(o=>7.5625*o*o,"q"),i=s(o=>121/4*e*Math.pow(o-6/11,2)+1-e,"w"),r=s(o=>121*e*e*Math.pow(o-9/11,2)+1-e*e,"r"),a=s(o=>484*e*e*e*Math.pow(o-10.5/11,2)+1-e*e*e,"t");return o=>Math.min(t(o),i(o),r(o),a(o))}static in(e){return e}static out(e){return t=>1-e(1-t)}static inOut(e){return t=>t<.5?e(t*2)/2:1-e((1-t)*2)/2}};s(Ye,"Easing");var Lp=Ye.poly(4),Pp=Ye.poly(5),Vp=s((n,e,t)=>n(Ye.back(1.70158*e))(t),"back"),zp=s((n,e,t)=>n(Ye.elastic(e))(t),"elastic"),Up=s((n,e,t)=>n(Ye.bounce(e))(t),"bounce"),Gp={linear:Ye.linear,step(n,e){let t=oU(n);return t[aU(e,t,!1)]},easeInQuad:Ye.in(Ye.quad),easeOutQuad:Ye.out(Ye.quad),easeInOutQuad:Ye.inOut(Ye.quad),easeInCubic:Ye.in(Ye.cubic),easeOutCubic:Ye.out(Ye.cubic),easeInOutCubic:Ye.inOut(Ye.cubic),easeInQuart:Ye.in(Lp),easeOutQuart:Ye.out(Lp),easeInOutQuart:Ye.inOut(Lp),easeInQuint:Ye.in(Pp),easeOutQuint:Ye.out(Pp),easeInOutQuint:Ye.inOut(Pp),easeInSine:Ye.in(Ye.sin),easeOutSine:Ye.out(Ye.sin),easeInOutSine:Ye.inOut(Ye.sin),easeInExpo:Ye.in(Ye.exp),easeOutExpo:Ye.out(Ye.exp),easeInOutExpo:Ye.inOut(Ye.exp),easeInCirc:Ye.in(Ye.circle),easeOutCirc:Ye.out(Ye.circle),easeInOutCirc:Ye.inOut(Ye.circle),easeInBack:Vp.bind(null,Ye.in),easeOutBack:Vp.bind(null,Ye.out),easeInOutBack:Vp.bind(null,Ye.inOut),easeInElastic:zp.bind(null,Ye.in),easeOutElastic:zp.bind(null,Ye.out),easeInOutElastic:zp.bind(null,Ye.inOut),easeInBounce:Up.bind(null,Ye.in),easeOutBounce:Up.bind(null,Ye.out),easeInOutBounce:Up.bind(null,Ye.inOut)},$i=Object.fromEntries(Object.entries(Gp).map(n=>[n[0],n[0]]));Object.freeze($i);var Y3="linear",yd=s(n=>{switch(n.easing){case $i.easeInBack:case $i.easeOutBack:case $i.easeInOutBack:case $i.easeInElastic:case $i.easeOutElastic:case $i.easeInOutElastic:return 1;case $i.easeInBounce:case $i.easeOutBounce:case $i.easeInOutBounce:return .25;case $i.step:return 5;default:return null}},"getEasingArgDefault");function ao(n=""){return n.includes("Back")||n.includes("Elastic")||n.includes("Bounce")||n===$i.step}s(ao,"hasArgs");var Jp={};vn(Jp,{default:()=>lU});var lU='data:image/svg+xml,%0A%0A%0A';var Hp={};vn(Hp,{default:()=>uU});var uU='data:image/svg+xml,%0A%0A%0A';var $p={};vn($p,{default:()=>fU});var fU='data:image/svg+xml,%0A%0A%0A';var Kp={};vn(Kp,{default:()=>pU});var pU='data:image/svg+xml,%0A%0A%0A';var qp={};vn(qp,{default:()=>gU});var gU='data:image/svg+xml,%0A%0A%0A';var Wp={};vn(Wp,{default:()=>bU});var bU='data:image/svg+xml,%0A%0A%0A';var Zp={};vn(Zp,{default:()=>yU});var yU='data:image/svg+xml,%0A%0A%0A';var Xp={};vn(Xp,{default:()=>xU});var xU='data:image/svg+xml,%0A%0A%0A';var Yp={};vn(Yp,{default:()=>EU});var EU='data:image/svg+xml,%0A%0A%0A';var Qp={};vn(Qp,{default:()=>CU});var CU='data:image/svg+xml,%0A%0A%0A';var e_={};vn(e_,{default:()=>SU});var SU='data:image/svg+xml,%0A%0A%0A';var t_={};vn(t_,{default:()=>IU});var IU='data:image/svg+xml,%0A%0A%0A';var n_={};vn(n_,{default:()=>NU});var NU='data:image/svg+xml,%0A%0A%0A';var i_={};vn(i_,{default:()=>DU});var DU='data:image/svg+xml,%0A%0A%0A';var RU=[Jp,Hp,$p,Kp,qp,Wp,Zp,Xp,Yp,Qp,e_,t_,n_,i_],Q3=RU,ey=["../assets/easingIcons/Back.svg","../assets/easingIcons/Bounce.svg","../assets/easingIcons/Circ.svg","../assets/easingIcons/Cubic.svg","../assets/easingIcons/Elastic.svg","../assets/easingIcons/Expo.svg","../assets/easingIcons/InOut.svg","../assets/easingIcons/Linear.svg","../assets/easingIcons/Out.svg","../assets/easingIcons/Quad.svg","../assets/easingIcons/Quart.svg","../assets/easingIcons/Quint.svg","../assets/easingIcons/Sine.svg","../assets/easingIcons/Step.svg"];function ty(n,e,t){let i=n.slice();return i[15]=e[t],i}s(ty,"get_each_context");function ny(n,e,t){let i=n.slice();return i[18]=e[t],i}s(ny,"get_each_context_1");function iy(n){let e;function t(a,o){return a[3]?.interpolation==="linear"?FU:MU}s(t,"select_block_type");let i=t(n,-1),r=i(n);return{c(){r.c(),e=St()},m(a,o){r.m(a,o),G(a,e,o)},p(a,o){i===(i=t(a,o))&&r?r.p(a,o):(r.d(1),r=i(a),r&&(r.c(),r.m(e.parentNode,e)))},d(a){r.d(a),a&&z(e)}}}s(iy,"create_if_block");function MU(n){let e;return{c(){e=V("div"),e.textContent=`${w("panel.keyframe.nonlinear_interpolation")}`,T(e,"class","easings-disabled svelte-59d7u1")},m(t,i){G(t,e,i)},p:re,d(t){t&&z(e)}}}s(MU,"create_else_block");function FU(n){let e,t,i=w("panel.keyframe.easing_type.title")+"",r,a,o,l=n[0],c,u,d=ao(n[3]?.easing),m,p=ay(n),f=n[3].easing!=="linear"&&oy(n),_=d&&cy(n);return{c(){e=V("div"),t=V("label"),r=Ne(i),o=K(),p.c(),c=K(),f&&f.c(),u=K(),_&&_.c(),m=St(),T(t,"for","easing_type_input"),T(t,"class","undefined"),$e(t,"font-weight","unset"),$e(t,"width","100px"),$e(t,"text-align","left"),T(t,"title",a=w("panel.keyframe.easing_type.description")),T(e,"class","bar flex")},m(v,g){G(v,e,g),N(e,t),N(t,r),N(e,o),p.m(e,null),G(v,c,g),f&&f.m(v,g),G(v,u,g),_&&_.m(v,g),G(v,m,g)},p(v,g){g&1&&Ae(l,l=v[0])?(p.d(1),p=ay(v),p.c(),p.m(e,null)):p.p(v,g),v[3].easing!=="linear"?f?f.p(v,g):(f=oy(v),f.c(),f.m(u.parentNode,u)):f&&(f.d(1),f=null),g&8&&(d=ao(v[3]?.easing)),d?_?_.p(v,g):(_=cy(v),_.c(),_.m(m.parentNode,m)):_&&(_.d(1),_=null)},d(v){v&&z(e),p.d(v),v&&z(c),f&&f.d(v),v&&z(u),_&&_.d(v),v&&z(m)}}}s(FU,"create_if_block_1");function ry(n){let e,t,i,r,a,o,l,c,u;function d(){return n[8](n[18])}return s(d,"click_handler"),{c(){e=V("button"),t=V("img"),o=K(),T(t,"class",i=vi(n[0]===n[18]?"selected-keyframe-icon":"")+" svelte-59d7u1"),$t(t.src,r=wd[n[18]])||T(t,"src",r),T(t,"alt",a=n[18]),T(e,"class","easing-type svelte-59d7u1"),T(e,"title",l=w(`panel.keyframe.easing_type.options.${n[18]}`))},m(m,p){G(m,e,p),N(e,t),N(e,o),c||(u=De(e,"click",d),c=!0)},p(m,p){n=m,p&1&&i!==(i=vi(n[0]===n[18]?"selected-keyframe-icon":"")+" svelte-59d7u1")&&T(t,"class",i)},d(m){m&&z(e),c=!1,u()}}}s(ry,"create_each_block_1");function ay(n){let e,t=n[5],i=[];for(let r=0;r[PathModule.basename(ey[e]).replace(".svg","").toLowerCase(),n.default])),PU={in:wd.expo,out:wd.out,inout:wd.inout};function VU(n){return n.animator.keyframes.filter(e=>e.channel===n.channel).sort((e,t)=>e.time-t.time)[0]===n}s(VU,"isFirstKeyframe");function zU(n,e,t){let i,r=re,a=s(()=>(r(),r=ze(d,y=>t(4,i=y)),d),"$$subscribe_easingArg");n.$$.on_destroy.push(()=>r());let o=["linear","sine","quad","cubic","quart","quint","expo","circ","elastic","back","bounce"],l=["in","out","inout"],c="linear",u,d;function m(){if(!g?.easing)return;let y=g.easing.match(/ease(InOut|Out|In)(.+)/);return y?(ao(g.easing)&&_(),console.log(y[2].toLowerCase(),y[1].toLowerCase()),{type:y?.[2].toLowerCase(),mode:y?.[1].toLowerCase()}):{type:g.easing}}s(m,"getSelectedEasing");function p(y,k="inout"){g&&(y==="linear"?t(3,g.easing="linear",g):t(3,g.easing=`ease${k&&k!=="inout"?k[0].toUpperCase()+k.slice(1):"InOut"}${y[0].toUpperCase()+y.slice(1)}`,g),c!==y&&_(),t(0,c=y),t(1,u=k))}s(p,"setSelectedEasing");let f;function _(){g&&(f&&f(),ao(g.easing)?(a(t(2,d=new me(yd(g)||0))),f=d.subscribe(y=>v(y))):a(t(2,d=void 0)))}s(_,"getEasingArgs");function v(y){g&&t(3,g.easingArgs=[y],g)}s(v,"setEasingArgs");let g;te.SELECT_KEYFRAME.subscribe(y=>{if(console.log("selected keyframe",y),Ue()&&y&&["position","rotation","scale"].includes(y.channel)&&!VU(y)){console.log(y),t(3,g=y);let k=m();k&&(t(0,c=k.type),t(1,u=k.mode))}else t(3,g=void 0)}),te.UNSELECT_KEYFRAME.subscribe(()=>{t(3,g=void 0)}),te.UNSELECT_AJ_PROJECT.subscribe(()=>{t(3,g=void 0)});let h=s(y=>p(y,u),"click_handler"),b=s(y=>p(c,y),"click_handler_1");function x(){i=go(this.value),d.set(i)}return s(x,"input_input_handler"),[c,u,d,g,i,o,l,p,h,b,x]}s(zU,"instance");var xd=class extends je{constructor(e){super(),Ie(this,e,zU,LU,Ae,{})}};s(xd,"KeyframeEasings");var uy=xd;(()=>{let n=Blockbench.addCSS(`.easings-disabled.svelte-59d7u1{margin-left:16px;font-size:16px;color:var(--color-subtle_text);text-wrap:balance;margin-bottom:1rem;font-style:italic}.easing-container.svelte-59d7u1{display:flex;flex-direction:row;flex-wrap:wrap;grid-gap:2px;margin-left:2px}.easing-type.svelte-59d7u1{width:32px;padding:0px;margin:0px;min-width:unset;display:flex;align-items:center;justify-content:center}.easing-type.svelte-59d7u1:hover{background-color:var(--color-selected)}.selected-keyframe-icon.svelte-59d7u1{filter:invert(49%) sepia(16%) saturate(6320%) hue-rotate(198deg) brightness(101%)\r - contrast(106%)}`);function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();Qr({component:uy,props:{},elementSelector(){return $("#panel_keyframe")[0]}});function dy(n,e,t){let i=n.slice();return i[11]=e[t],i}s(dy,"get_each_context");function UU(n){let e,t,i,r,a,o,l;function c(f){n[7](f)}s(c,"checkbox_checked_binding");let u={label:w("dialog.locator_config.use_entity.title"),tooltip:w("dialog.locator_config.use_entity.description")};n[0]!==void 0&&(u.checked=n[0]),e=new it({props:u}),se.push(()=>be(e,"checked",c));let d=n[4]&&fy(n);function m(f){n[10](f)}s(m,"codeinput_value_binding_1");let p={label:w("dialog.locator_config.ticking_commands.title"),tooltip:w("dialog.locator_config.ticking_commands.description")};return n[3]!==void 0&&(p.value=n[3]),a=new Bl({props:p}),se.push(()=>be(a,"value",m)),{c(){fe(e.$$.fragment),i=K(),d&&d.c(),r=K(),fe(a.$$.fragment)},m(f,_){de(e,f,_),G(f,i,_),d&&d.m(f,_),G(f,r,_),de(a,f,_),l=!0},p(f,_){let v={};!t&&_&1&&(t=!0,v.checked=f[0],he(()=>t=!1)),e.$set(v),f[4]?d?(d.p(f,_),_&16&&W(d,1)):(d=fy(f),d.c(),W(d,1),d.m(r.parentNode,r)):d&&(bt(),Y(d,1,1,()=>{d=null}),vt());let g={};!o&&_&8&&(o=!0,g.value=f[3],he(()=>o=!1)),a.$set(g)},i(f){l||(W(e.$$.fragment,f),W(d),W(a.$$.fragment,f),l=!0)},o(f){Y(e.$$.fragment,f),Y(d),Y(a.$$.fragment,f),l=!1},d(f){ue(e,f),f&&z(i),d&&d.d(f),f&&z(r),ue(a,f)}}}s(UU,"create_else_block");function GU(n){let e,t=w("dialog.locator_config.plugin_mode_warning").split(` -`),i=[];for(let r=0;rbe(e,"value",l));function u(m){n[9](m)}s(u,"codeinput_value_binding");let d={label:w("dialog.locator_config.summon_commands.title"),tooltip:w("dialog.locator_config.summon_commands.description")};return n[2]!==void 0&&(d.value=n[2]),r=new Bl({props:d}),se.push(()=>be(r,"value",u)),{c(){fe(e.$$.fragment),i=K(),fe(r.$$.fragment)},m(m,p){de(e,m,p),G(m,i,p),de(r,m,p),o=!0},p(m,p){let f={};!t&&p&2&&(t=!0,f.value=m[1],he(()=>t=!1)),e.$set(f);let _={};!a&&p&4&&(a=!0,_.value=m[2],he(()=>a=!1)),r.$set(_)},i(m){o||(W(e.$$.fragment,m),W(r.$$.fragment,m),o=!0)},o(m){Y(e.$$.fragment,m),Y(r.$$.fragment,m),o=!1},d(m){ue(e,m),m&&z(i),ue(r,m)}}}s(fy,"create_if_block_1");function my(n){let e,t=n[11]+"",i;return{c(){e=V("p"),i=Ne(t)},m(r,a){G(r,e,a),N(e,i)},p:re,d(r){r&&z(e)}}}s(my,"create_each_block");function JU(n){let e,t,i,r,a=[GU,UU],o=[];function l(c,u){return c[5]?0:1}return s(l,"select_block_type"),t=l(n,-1),i=o[t]=a[t](n),{c(){e=V("div"),i.c()},m(c,u){G(c,e,u),o[t].m(e,null),r=!0},p(c,[u]){i.p(c,u)},i(c){r||(W(i),r=!0)},o(c){Y(i),r=!1},d(c){c&&z(e),o[t].d()}}}s(JU,"create_fragment");function HU(n,e,t){let i,r=re,a=s(()=>(r(),r=ze(l,g=>t(4,i=g)),l),"$$subscribe_useEntity");n.$$.on_destroy.push(()=>r());let o=!!Project?.animated_java?.enable_plugin_mode,{useEntity:l}=e;a();let{entityType:c}=e,{summonCommands:u}=e,{tickingCommands:d}=e,m=s(g=>g.length===0?{type:"error",message:w("dialog.locator_config.entity_type.error.empty")}:Rn.entity_type?.has(g)||Rn.entity_type?.has(g.replace(/^minecraft\:/,""))?{type:"success",message:""}:{type:"warning",message:w("dialog.locator_config.entity_type.warning.invalid")},"entityTypeValidator");function p(g){l=g,a(t(0,l))}s(p,"checkbox_checked_binding");function f(g){c=g,t(1,c)}s(f,"lineinput_value_binding");function _(g){u=g,t(2,u)}s(_,"codeinput_value_binding");function v(g){d=g,t(3,d)}return s(v,"codeinput_value_binding_1"),n.$$set=g=>{"useEntity"in g&&a(t(0,l=g.useEntity)),"entityType"in g&&t(1,c=g.entityType),"summonCommands"in g&&t(2,u=g.summonCommands),"tickingCommands"in g&&t(3,d=g.tickingCommands)},[l,c,u,d,i,o,m,p,f,_,v]}s(HU,"instance");var kd=class extends je{constructor(e){super(),Ie(this,e,HU,JU,Ae,{useEntity:0,entityType:1,summonCommands:2,tickingCommands:3})}};s(kd,"LocatorConfigDialog");var py=kd;function $U(n){let e=Tr.fromJSON(n.config??=new Tr().toJSON()),t=new me(e.useEntity),i=new me(e.entityType),r=new me(e.summonCommands),a=new me(e.tickingCommands);new Pt({id:`${_e.name}:locatorConfig`,title:w("dialog.locator_config.title"),width:600,component:py,props:{useEntity:t,entityType:i,summonCommands:r,tickingCommands:a},preventKeybinds:!0,onConfirm(){e.useEntity=t.get(),e.entityType=i.get(),e.summonCommands=r.get(),e.tickingCommands=a.get(),n.config=e.toJSON()}}).show()}s($U,"openLocatorConfigDialog");var _y=Xt(`${_e.name}:locator_config`,{icon:"settings",name:w("action.open_locator_config.name"),condition:()=>Format===et,click:()=>{let n=Locator.selected.at(0);n&&$U(n)}});Ke(`${_e.name}:animationControllerMod`,void 0,()=>{let[,n]=fc(AnimationController.prototype,"saved");return{unsubSet:n.subscribe(({storage:t})=>{Format.id===et.id&&(t.value=!0)})}},n=>{n.unsubSet()});Ke(`${_e.name}:animationPropertiesAction`,{originalOpen:Blockbench.Animation.prototype.propertiesDialog},n=>(Blockbench.Animation.prototype.propertiesDialog=function(){if(Ue()){if(!Blockbench.Animation.selected){Blockbench.showQuickMessage("No animation selected");return}F0(Blockbench.Animation.selected)}else n.originalOpen.call(this)},n),n=>{Blockbench.Animation.prototype.propertiesDialog=n.originalOpen});var gy=20,hy=.05;Ke(`${_e.name}:animationDefaultPropertiesMod`,{originalExtend:Blockbench.Animation.prototype.extend,originalSetLength:Blockbench.Animation.prototype.setLength},n=>(Blockbench.Animation.prototype.extend=function(e){if(n.originalExtend.call(this,e),Ue()){this.snapping=gy,this.length=Math.max(this.length,hy);for(let t of Object.values(this.animators)){if(!t)continue;let i=-1/0;for(let r of t.keyframes){let a=ea(r.time,gy);a!==r.time&&(a===i&&(a+=.05),r.time=a,i=a)}}}return this},Blockbench.Animation.prototype.setLength=function(e){return Ue()&&(e=Math.max(e||this.length,hy)),n.originalSetLength.call(this,e)},n),n=>{Blockbench.Animation.prototype.extend=n.originalExtend,Blockbench.Animation.prototype.setLength=n.originalSetLength});Ke(`${_e.name}:animationPropertiesMod`,{excludedNodesProperty:void 0},n=>(n.excludedNodesProperty=new Property(Blockbench.Animation,"array","excluded_nodes",{condition:()=>Ue(),label:w("animation.excluded_nodes"),default:[]}),n),n=>{n.excludedNodesProperty?.delete()});var Ed=class extends Property{constructor(e,t,i){super(e,"object",t,i)}merge(e,t){typeof t[this.name]=="object"&&(e[this.name]=JSON.parse(JSON.stringify(t[this.name])))}copy(e,t){typeof e[this.name]=="object"&&(t[this.name]=JSON.parse(JSON.stringify(e[this.name])))}};s(Ed,"DeepClonedObjectProperty");Ke(`${_e.name}:boneProperties`,{configs:void 0},n=>(n.configs=new Ed(Group,"configs",{condition:Ue,default:{default:void 0,variants:{}}}),n),n=>{n.configs?.delete()});Ke(`${_e.name}:boneInterpolationMod`,{orignalInterpolate:BoneAnimator.prototype.interpolate},n=>(BoneAnimator.prototype.interpolate=function(e,t,i){if(!Ue()||!t)return n.orignalInterpolate.call(this,e,t,i);let r=this.animation.time;try{Timeline.time=ea(this.animation.time,20);let a,o,l,c;if(Timeline.time{n.orignalInterpolate=BoneAnimator.prototype.interpolate});var by=Canvas.outlineMaterial.clone();by.color.set("#ff0000");function KU(n){if(n.rotation[0]===0&&n.rotation[1]===0&&n.rotation[2]===0)return!0;let e=n.rotation[0]+n.rotation[1]+n.rotation[2];return(e===n.rotation[0]||e===n.rotation[1]||e===n.rotation[2])&&(e===-45||e===-22.5||e===0||e===22.5||e===45)}s(KU,"isCubeValid");Ke(`${_e.name}:cubeOutlineMod`,{originalUpdateTransform:Cube.preview_controller.updateTransform,originalInit:Cube.prototype.init},n=>(Cube.preview_controller.updateTransform=function(e){if(Ue()){let t=KU(e);e.rotationInvalid&&t?(e.mesh.outline.material=Canvas.outlineMaterial,e.rotationInvalid=!1):!e.rotationInvalid&&!t&&(e.mesh.outline.material=by,e.rotationInvalid=!0)}n.originalUpdateTransform.call(this,e)},Cube.prototype.init=function(){let e=n.originalInit.call(this);e.rotationInvalid=!1;let[t]=fc(this.mesh.outline,"visible");return t.subscribe(({storage:i})=>{Ue()&&(i.value=this.rotationInvalid||i.value)}),e},n),n=>{Cube.preview_controller.updateTransform=n.originalUpdateTransform,Cube.prototype.init=n.originalInit});Ke(`${_e.name}:exportOverAction`,{action:BarItems.export_over,originalClick:BarItems.export_over.click},n=>(n.action.click=e=>{if(!(!Project||!Format))if(Format.id===et.id){let t=Project.save_path||Project.export_path;t?fs.existsSync(PathModule.dirname(t))?(Project.save_path=t,xn.write(xn.compile(),t)):(console.error(`Failed to export Animated Java Blueprint, file location '${t}' does not exist!`),xn.export()):xn.export()}else n.originalClick.call(n.action,e)},n),n=>{n.action.click=n.originalClick});Ke(`${_e.name}:groupContextMenu`,{menuStructure:Group.prototype.menu.structure},n=>{let e=[...n.menuStructure];return e.splice(6,0,x3),Group.prototype.menu.structure=e,n},n=>{Group.prototype.menu.structure=n.menuStructure});Ke(`${_e.name}:groupNameMod`,{originalRename:Group.prototype.saveName,originalSanitize:Group.prototype.sanitizeName},n=>(Group.prototype.saveName=function(e){return Ue()&&(this.name=Rt(this.name)),n.originalRename.call(this,e)},Group.prototype.sanitizeName=function(){return Ue()&&(this.name=Rt(this.name)),n.originalSanitize.call(this)},n),n=>{Group.prototype.rename=n.originalRename});Ke(`${_e.name}:keyframeSelectEventMod`,{originalKeyframeSelect:Blockbench.Keyframe.prototype.select,originalUpdateKeyframeSelection:updateKeyframeSelection,barItem:BarItems.keyframe_interpolation,originalChange:BarItems.keyframe_interpolation.set},n=>(Blockbench.Keyframe.prototype.select=function(e){if(!Ue())return n.originalKeyframeSelect.call(this,e);let t=n.originalKeyframeSelect.call(this,e);return te.SELECT_KEYFRAME.dispatch(t),t},globalThis.updateKeyframeSelection=function(){return Ue()||(Timeline.keyframes.forEach(e=>{e.selected&&Timeline.selected&&!Timeline.selected.includes(e)&&(e.selected=!1,te.UNSELECT_KEYFRAME.dispatch());let t=!1;e.transform&&(t=!!e.data_points.find(i=>!isStringNumber(i.x)||!isStringNumber(i.y)||!isStringNumber(i.z))),t!=e.has_expressions&&(e.has_expressions=t)}),Timeline.selected&&(console.log("Selected keyframe:",Timeline.selected[0]),te.SELECT_KEYFRAME.dispatch(Timeline.selected[0]))),n.originalUpdateKeyframeSelection()},n.barItem.set=function(e){let t=n.originalChange.call(this,e);return Ue()&&(Timeline.selected&&Timeline.selected.length>0?te.SELECT_KEYFRAME.dispatch(Timeline.selected[0]):te.UNSELECT_KEYFRAME.dispatch()),t},n),n=>{Blockbench.Keyframe.prototype.select=n.originalKeyframeSelect,globalThis.updateKeyframeSelection=n.originalUpdateKeyframeSelection,n.barItem.change=n.originalChange});function qU(n){return!n||n.startsWith("easeInOut")?n:n.startsWith("easeIn")?n.replace("easeIn","easeOut"):n.startsWith("easeOut")?n.replace("easeOut","easeIn"):n}s(qU,"reverseEasing");Ke(`${_e.name}:reverseKeyframesMod`,{action:BarItems.reverse_keyframes,originalClick:BarItems.reverse_keyframes.click},n=>(n.action.click=function(e){n.originalClick.call(this,e),Undo.initEdit({keyframes:Timeline.selected||void 0});let t={};for(let r of Timeline.selected||[])t[r.animator.uuid]??=[],t[r.animator.uuid].push(r);let i={};for(let[r,a]of Object.entries(t)){let o={};i[r]=o;for(let l of a)o[l.channel]??=[],o[l.channel].push(l)}for(let r of Object.values(i))for(let a of Object.values(r)){a.sort((l,c)=>l.time-c.time);let o=a.map(l=>({easing:qU(l.easing),easingArgs:l.easingArgs}));a.forEach((l,c)=>{if(c==0){l.easing=void 0,l.easingArgs=void 0;return}let u=o[c-1];l.easing=u.easing,l.easingArgs=u.easingArgs})}Undo.finishEdit("Reverse keyframe easing"),updateKeyframeSelection(),Animator.preview()},n),n=>{n.action.click=n.originalClick});function WU(n,e,t){return t*(e-n)+n}s(WU,"lerp");Ke(`${_e.name}:keyframeEasingMod`,{originalGetLerp:Blockbench.Keyframe.prototype.getLerp,easingProperty:void 0,easingArgsProperty:void 0},n=>(n.easingProperty=new Property(Blockbench.Keyframe,"string","easing",{default:Y3,condition:Ue()}),n.easingArgsProperty=new Property(Blockbench.Keyframe,"array","easingArgs",{condition:Ue()}),Blockbench.Keyframe.prototype.getLerp=function(e,t,i,r){if(!Ue())return n.originalGetLerp.call(this,e,t,i,r);let a=e.easing||"linear",o=Gp[a];if(ao(a)){let m=Array.isArray(e.easingArgs)&&e.easingArgs.length>0?e.easingArgs[0]:yd(e);o=o.bind(null,m||0)}let l=o(i),c=this.calc(t),u=e.calc(t),d=WU(c,u,l);if(Number.isNaN(d))throw new Error("Invalid easing function or arguments.");return d},n),n=>{n.easingProperty?.delete(),n.easingArgsProperty?.delete(),Blockbench.Keyframe.prototype.getLerp=n.originalGetLerp});var vy=Animator.showMotionTrail,yy=Animator.preview,wy=globalThis.updateSelection,xy=Locator.prototype.select,ys=class extends BoneAnimator{_name;uuid;element;constructor(e,t,i){super(e,t,i),this.uuid=e,this._name=i}getElement(){return this.element=OutlinerNode.uuids[this.uuid],this.element}select(){if(this.getElement(),!this.element)return unselectAllElements(),this;if(this.element.locked)return this;if(this.element.selected!==!0&&this.element&&this.element.select(),GeneralAnimator.prototype.select.call(this),this[Toolbox.selected.animation_channel]&&(Timeline.selected&&Timeline.selected.length===0||(Timeline.selected&&Timeline.selected[0].animator)!==this)){let e;this[Toolbox.selected.animation_channel].forEach(t=>{Math.abs(t.time-Timeline.time)<.002&&(e=t)}),e&&e.select()}return this.element&&this.element.parent&&this.element.parent!=="root"&&this.element.parent.openUp(),this}doRender(){return this.getElement(),!!(this.element&&this.element.mesh)}displayPosition(e,t=1){let i=this.element.mesh;return e&&(i.position.x-=e[0]*t,i.position.y+=e[1]*t,i.position.z+=e[2]*t),this}interpolate(){return[0,0,0]}displayFrame(){this.doRender()&&this.getElement()}showMotionTrail(){}};s(ys,"LocatorAnimator");ys.prototype.type="locator";ys.prototype.channels={commands:{name:w("effect_animator.timeline.commands"),mutable:!0,transform:!0,max_data_points:1}};var Td=!1;function ZU(){Td||(Locator.animator=ys,Animator.showMotionTrail=function(n){!n||n instanceof Locator||vy(n)},Animator.preview=function(n){yy(n),Mode.selected.id===Modes.options.animate.id&&Outliner.selected[0]instanceof Locator&&(Canvas.gizmos[0].visible=!1,Transformer.visible=!1)},globalThis.updateSelection=function(){wy(),Mode.selected.id===Modes.options.animate.id&&Outliner.selected[0]instanceof Locator&&(Canvas.gizmos[0].visible=!1,Transformer.visible=!1)},Locator.prototype.select=function(n,e){let t=xy.call(this,n,e);return Animator.open&&Blockbench.Animation.selected&&Blockbench.Animation.selected.getBoneAnimator().select(),t},Td=!0)}s(ZU,"inject");function XU(){Td&&(Locator.animator=void 0,Animator.showMotionTrail=vy,Animator.preview=yy,globalThis.updateSelection=wy,Locator.prototype.select=xy,Td=!1)}s(XU,"extract");te.PRE_SELECT_PROJECT.subscribe(n=>{n.format.id===et.id?ZU():XU()});Ke(`${_e.name}:groupContextMenu`,{menuStructure:Locator.prototype.menu.structure},n=>{let e=[...n.menuStructure];return e.splice(6,0,_y),Locator.prototype.menu.structure=e,n},n=>{Locator.prototype.menu.structure=n.menuStructure});Ke(`${_e.name}:locatorProperties`,{config:void 0},n=>(n.config=new Property(Locator,"instance","config",{condition:Ue,default:void 0}),n),n=>{n.config?.delete()});Ke(`${_e.name}:modelFormatConvertToMod`,{original:ModelFormat.prototype.convertTo},n=>(ModelFormat.prototype.convertTo=function(){let e=n.original.call(this);return this===et&&Vh(),e},n),n=>{ModelFormat.prototype.convertTo=n.original});Ke(`${_e.name}:modelFormatPreSelectProjectEvent`,{originalSelect:ModelProject.prototype.select},n=>(ModelProject.prototype.select=function(){return this.format.id===et.id&&te.PRE_SELECT_PROJECT.dispatch(this),n.originalSelect.call(this)},n),n=>{ModelProject.prototype.select=n.originalSelect});var ky={"smoothmin(a, b, k)":`v.h = math.clamp(0.5 + (0.5 * (a - b) / k), 0, 1); + `};n[9]!==void 0&&(B.value=n[9]),b=new Qp({props:B}),n[17](b),le.push(()=>we(b,"value",S)),b.$on("change",n[19]);let O=n[10]&&N3(n);return{c(){e=P("p"),i=Re(t),a=G(),o=P("div"),l=P("div"),u=G(),c=P("div"),d=G(),m=P("div"),p=G(),f=P("div"),_=G(),g=P("div"),v=G(),y=P("div"),k=P("div"),_e(b.$$.fragment),E=G(),O&&O.c(),T(e,"class","panel_toolbar_label label svelte-1vipl8y"),T(e,"style",r=n[0]?"":"visibility:hidden; height: 0px;"),T(l,"class","content"),T(c,"class","content"),T(m,"class","content"),T(f,"class","content"),T(g,"class","content"),T(o,"class","toolbar custom-toolbar svelte-1vipl8y"),T(o,"style",h=n[0]?"":"visibility:hidden; height: 0px;"),T(k,"class","content"),T(y,"class","toolbar"),T(y,"style",C=n[0]?"margin-bottom: 16px;":"visibility:hidden; height: 0px;")},m(A,V){L(A,e,V),N(e,i),L(A,a,V),L(A,o,V),N(o,l),n[12](l),N(o,u),N(o,c),n[13](c),N(o,d),N(o,m),n[14](m),N(o,p),N(o,f),n[15](f),N(o,_),N(o,g),n[16](g),L(A,v,V),L(A,y,V),N(y,k),me(b,k,null),N(y,E),O&&O.m(y,null),j=!0},p(A,[V]){(!j||V&1&&r!==(r=A[0]?"":"visibility:hidden; height: 0px;"))&&T(e,"style",r),(!j||V&1&&h!==(h=A[0]?"":"visibility:hidden; height: 0px;"))&&T(o,"style",h);let K={};!x&&V&512&&(x=!0,K.value=A[9],ye(()=>x=!1)),b.$set(K),A[10]?O?O.p(A,V):(O=N3(A),O.c(),O.m(y,null)):O&&(O.d(1),O=null),(!j||V&1&&C!==(C=A[0]?"margin-bottom: 16px;":"visibility:hidden; height: 0px;"))&&T(y,"style",C)},i(A){j||(q(b.$$.fragment,A),j=!0)},o(A){Z(b.$$.fragment,A),j=!1},d(A){A&&F(e),A&&F(a),A&&F(o),n[12](null),n[13](null),n[14](null),n[15](null),n[16](null),A&&F(v),A&&F(y),n[17](null),de(b),O&&O.d()}}}s(LU,"create_fragment");function PU(n,e){return e?Prism.highlight(n,Prism.languages[e],e):n}s(PU,"highlight");function VU(n,e,t){let i,r=ue,a=s(()=>(r(),r=ze(d,O=>t(9,i=O)),d),"$$subscribe_text"),o,l=ue,u=s(()=>(l(),l=ze(m,O=>t(10,o=O)),m),"$$subscribe_error");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l());let c=qe.selected.at(0),d=c?._text??new ge("");a();let m=c?._textError??new ge("");u();let p,f,_,g,h,v;re.UPDATE_SELECTION.subscribe(()=>{if(t(0,c=qe.selected.at(0)),!c)return;a(t(1,d=c._text)),u(t(2,m=c.textError)),e_.setValue(c.lineWidth);let O=c.backgroundColor+Oo(c.backgroundAlpha);fo.set(O),Ts.set(c.shadow),ac.set(c.align),Cs.set(c.seeThrough)}),requestAnimationFrame(()=>{p.appendChild(e_.node),f.appendChild(fo.node),_.appendChild(Ts.node),g.appendChild(ac.node),h.appendChild(Cs.node),y()});function y(){v&&(t(8,v.$$.ctx[0].style.overflowWrap="unset",v),t(8,v.$$.ctx[0].style.whiteSpace="nowrap",v))}s(y,"forceNoWrap");function k(O){le[O?"unshift":"push"](()=>{p=O,t(3,p)})}s(k,"div0_binding");function b(O){le[O?"unshift":"push"](()=>{f=O,t(4,f)})}s(b,"div1_binding");function x(O){le[O?"unshift":"push"](()=>{_=O,t(5,_)})}s(x,"div2_binding");function E(O){le[O?"unshift":"push"](()=>{g=O,t(6,g)})}s(E,"div3_binding");function C(O){le[O?"unshift":"push"](()=>{h=O,t(7,h)})}s(C,"div4_binding");function j(O){le[O?"unshift":"push"](()=>{v=O,t(8,v)})}s(j,"codejar_binding");function S(O){i=O,d.set(i)}return s(S,"codejar_value_binding"),[c,d,m,p,f,_,g,h,v,i,o,y,k,b,x,E,C,j,S,s(()=>y(),"change_handler")]}s(VU,"instance");var Id=class extends Be{constructor(e){super(),De(this,e,VU,LU,Oe,{})}};s(Id,"TextDisplayElementPanel");var B3=Id;(()=>{let n=Blockbench.addCSS(".label.svelte-1vipl8y{margin-bottom:-3px !important}textarea.svelte-1vipl8y{margin-right:20px;margin-left:2px;color:var(--color-error);background-color:var(--color-back);padding:4px 8px;text-wrap:pretty;overflow:scroll;height:10rem;font-size:small;font-family:var(--font-code)}.custom-toolbar.svelte-1vipl8y{display:flex;flex-direction:row;margin-bottom:1px}.custom-toolbar.svelte-1vipl8y .sp-replacer{padding:4px 18px !important;height:28px !important;margin:2px 0px !important}.custom-toolbar.svelte-1vipl8y [toolbar_item='animated_java:textDisplayShadowToggle']{margin-right:2px !important}.custom-toolbar.svelte-1vipl8y .bar_select{height:28px !important;margin:2px 0px !important}.custom-toolbar.svelte-1vipl8y bb-select{height:28px !important;display:flex;align-items:center;padding-top:0}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();ra({component:B3,props:{},elementSelector(){return document.querySelector("#panel_element")}});var e_=new NumSlider(`${ke.name}:textDisplayLineWidthSlider`,{name:w("tool.text_display.line_width.title"),icon:"format_size",description:w("tool.text_display.line_width.description"),settings:{min:1,max:1e4,interval:1},condition:()=>Ue()&&!!qe.selected.length,get(){let n=qe.selected[0];return n?n.lineWidth:0},change(n){let e=qe.selected[0];e&&(e.lineWidth=Math.clamp(n(e.lineWidth),1,1e4))}}),fo=new ColorPicker(`${ke.name}:textDisplayBackgroundColorPicker`,{name:w("tool.text_display.background_color.title"),icon:"format_color_fill",description:w("tool.text_display.background_color.description"),condition:()=>Ue()&&!!qe.selected.length});fo.jq.spectrum("option","defaultColor","#0000003f");fo.get=function(){let n=qe.selected[0];return n?new tinycolor(n.backgroundColor+Oo(n.backgroundAlpha)):new tinycolor("#0000003f")};fo.set=function(n){this.value=new tinycolor(n),this.jq.spectrum("set",this.value.toHex8String());let e=qe.selected[0];return e?(e.backgroundColor=this.value.toHexString(),e.backgroundAlpha=this.value.getAlpha(),this):this};fo.change=function(n){let e=qe.selected[0];return e?(e.backgroundColor=n.toHexString(),e.backgroundAlpha=n.getAlpha(),this):this};var Ts=new Toggle(`${ke.name}:textDisplayShadowToggle`,{name:w("tool.text_display.text_shadow.title"),icon:"check_box_outline_blank",description:w("tool.text_display.text_shadow.description"),condition:()=>Ue()&&!!qe.selected.length,click(){},onChange(){let n=Ts;n.setIcon(n.value?"check_box":"check_box_outline_blank");let e=qe.selected[0];e&&(e.shadow=Ts.value)}});Ts.set=function(n){return this.value===n?this:(this.click(),this)};var ac=new BarSelect(`${ke.name}:textDisplayAlignmentSelect`,{name:w("tool.text_display.text_alignment.title"),icon:"format_align_left",description:w("tool.text_display.text_alignment.description"),condition:()=>Ue()&&!!qe.selected.length,options:{left:w("tool.text_display.text_alignment.options.left"),center:w("tool.text_display.text_alignment.options.center"),right:w("tool.text_display.text_alignment.options.right")}});ac.get=function(){let n=qe.selected[0];return n?n.align:"left"};ac.set=function(n){let e=qe.selected[0];if(!e)return this;this.value=n;let t=this.getNameFor(n);return this.nodes.forEach(i=>{$(i).find("bb-select").text(t)}),this.nodes.includes(this.node)||$(this.node).find("bb-select").text(t),e.align=n,this};var Cs=new Toggle(`${ke.name}:textDisplaySeeThroughToggle`,{name:w("tool.text_display.see_through.title"),icon:"check_box_outline_blank",description:w("tool.text_display.see_through.description"),condition:()=>Ue()&&!!qe.selected.length,click(){},onChange(){let n=Cs;n.setIcon(n.value?"check_box":"check_box_outline_blank");let e=qe.selected[0];e&&(e.seeThrough=Cs.value)}});Cs.set=function(n){return this.value===n?this:(this.click(),this)};function zU(n){let e,t=w("panel.vanilla_item_display.title")+"",i,r,a,o,l,u,c,d,m,p,f,_,g,h,v,y;return{c(){e=P("p"),i=Re(t),a=G(),o=P("div"),l=P("div"),u=P("input"),c=G(),d=P("div"),f=G(),_=P("div"),g=Re(n[5]),T(e,"class","panel_toolbar_label label svelte-lxqp9c"),T(e,"style",r=n[3]?"":"visibility:hidden; height: 0px;"),T(u,"type","text"),T(u,"class","svelte-lxqp9c"),T(l,"class","content"),Ge(l,"width","95%"),T(d,"class","content"),T(o,"class","toolbar custom-toolbar svelte-lxqp9c"),T(o,"style",m=n[3]?"":"visibility:hidden; height: 0px;"),T(o,"title",p=w("panel.vanilla_item_display.description")),T(_,"class","error svelte-lxqp9c"),T(_,"style",h=n[5]?"":"visibility:hidden; height: 0px; color: var(--color-error);")},m(k,b){L(k,e,b),N(e,i),L(k,a,b),L(k,o,b),N(o,l),N(l,u),bt(u,n[4]),N(o,c),N(o,d),n[7](d),L(k,f,b),L(k,_,b),N(_,g),v||(y=Le(u,"input",n[6]),v=!0)},p(k,[b]){b&8&&r!==(r=k[3]?"":"visibility:hidden; height: 0px;")&&T(e,"style",r),b&16&&u.value!==k[4]&&bt(u,k[4]),b&8&&m!==(m=k[3]?"":"visibility:hidden; height: 0px;")&&T(o,"style",m),b&32&&ot(g,k[5]),b&32&&h!==(h=k[5]?"":"visibility:hidden; height: 0px; color: var(--color-error);")&&T(_,"style",h)},i:ue,o:ue,d(k){k&&F(e),k&&F(a),k&&F(o),n[7](null),k&&F(f),k&&F(_),v=!1,y()}}}s(zU,"create_fragment");function GU(n,e,t){let i,r=ue,a=s(()=>(r(),r=ze(d,h=>t(4,i=h)),d),"$$subscribe_item"),o,l=ue,u=s(()=>(l(),l=ze(m,h=>t(5,o=h)),m),"$$subscribe_error");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l());let c=ut.selected.at(0),d=new ge("");a();let m=new ge("");u();let p,f=!1;re.UPDATE_SELECTION.subscribe(()=>{if(c=ut.selected.at(0),!c||selected.length>1){a(t(0,d=new ge(""))),u(t(1,m=new ge(""))),t(3,f=!1);return}a(t(0,d=c._item)),u(t(1,m=c.error)),oc.set(c.itemDisplay),t(3,f=!0)}),requestAnimationFrame(()=>{p.appendChild(oc.node)});function _(){i=this.value,d.set(i)}s(_,"input_input_handler");function g(h){le[h?"unshift":"push"](()=>{p=h,t(2,p)})}return s(g,"div1_binding"),[d,m,p,f,i,o,_,g]}s(GU,"instance");var Od=class extends Be{constructor(e){super(),De(this,e,GU,zU,Oe,{})}};s(Od,"VanillaItemDisplayElementPanel");var R3=Od;(()=>{let n=Blockbench.addCSS("input.svelte-lxqp9c{background-color:var(--color-button);padding:2px 8px;width:100%}.label.svelte-lxqp9c{margin-bottom:-3px !important}.custom-toolbar.svelte-lxqp9c{display:flex;flex-direction:row;margin-bottom:1px}.custom-toolbar.svelte-lxqp9c .sp-replacer{padding:4px 18px !important;height:28px !important;margin:1px 0px !important}.error.svelte-lxqp9c{margin:2px 8px;font-size:14px;color:var(--color-error)}.custom-toolbar.svelte-lxqp9c [toolbar_item='animated_java:itemDisplayAlignmentSelect']{margin:0px 2px !important}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();ra({component:R3,props:{},elementSelector(){return document.querySelector("#panel_element")}});var oc=new BarSelect(`${ke.name}:itemDisplayAlignmentSelect`,{name:w("tool.item_display.item_display.title"),icon:"format_align_left",description:w("tool.item_display.item_display.description"),condition:()=>Ue()&&!!ut.selected.length,options:{none:w("tool.item_display.item_display.options.none"),thirdperson_lefthand:w("tool.item_display.item_display.options.thirdperson_lefthand"),thirdperson_righthand:w("tool.item_display.item_display.options.thirdperson_righthand"),firstperson_lefthand:w("tool.item_display.item_display.options.firstperson_lefthand"),firstperson_righthand:w("tool.item_display.item_display.options.firstperson_righthand"),head:w("tool.item_display.item_display.options.head"),gui:w("tool.item_display.item_display.options.gui"),ground:w("tool.item_display.item_display.options.ground"),fixed:w("tool.item_display.item_display.options.fixed")}});oc.get=function(){let n=ut.selected[0];return n?n.itemDisplay:"left"};oc.set=function(n){let e=ut.selected[0];if(!e)return this;this.value=n;let t=this.getNameFor(n);return this.nodes.forEach(i=>{$(i).find("bb-select").text(t)}),this.nodes.includes(this.node)||$(this.node).find("bb-select").text(t),e.itemDisplay=n,this};function UU(n){let e,t=w("panel.vanilla_block_display.title")+"",i,r,a,o,l,u,c,d,m,p,f,_,g,h;return{c(){e=P("p"),i=Re(t),a=G(),o=P("div"),l=P("div"),u=P("input"),m=G(),p=P("div"),f=Re(n[4]),T(e,"class","panel_toolbar_label label svelte-1gpclxv"),T(e,"style",r=n[2]?"":"visibility:hidden; height: 0px;"),T(u,"type","text"),T(u,"class","svelte-1gpclxv"),T(l,"class","content"),Ge(l,"width","95%"),T(o,"class","toolbar custom-toolbar svelte-1gpclxv"),T(o,"style",c=n[2]?"":"visibility:hidden; height: 0px;"),T(o,"title",d=w("panel.vanilla_block_display.description")),T(p,"class","error svelte-1gpclxv"),T(p,"style",_=n[4]?"":"visibility:hidden; height: 0px; color: var(--color-error);")},m(v,y){L(v,e,y),N(e,i),L(v,a,y),L(v,o,y),N(o,l),N(l,u),bt(u,n[3]),L(v,m,y),L(v,p,y),N(p,f),g||(h=Le(u,"input",n[5]),g=!0)},p(v,[y]){y&4&&r!==(r=v[2]?"":"visibility:hidden; height: 0px;")&&T(e,"style",r),y&8&&u.value!==v[3]&&bt(u,v[3]),y&4&&c!==(c=v[2]?"":"visibility:hidden; height: 0px;")&&T(o,"style",c),y&16&&ot(f,v[4]),y&16&&_!==(_=v[4]?"":"visibility:hidden; height: 0px; color: var(--color-error);")&&T(p,"style",_)},i:ue,o:ue,d(v){v&&F(e),v&&F(a),v&&F(o),v&&F(m),v&&F(p),g=!1,h()}}}s(UU,"create_fragment");function JU(n,e,t){let i,r=ue,a=s(()=>(r(),r=ze(d,_=>t(3,i=_)),d),"$$subscribe_block"),o,l=ue,u=s(()=>(l(),l=ze(m,_=>t(4,o=_)),m),"$$subscribe_error");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l());let c=ht.selected.at(0),d=new ge("");a();let m=new ge("");u();let p=!1;re.UPDATE_SELECTION.subscribe(()=>{if(c=ht.selected.at(0),!c||selected.length>1){a(t(0,d=new ge(""))),u(t(1,m=new ge(""))),t(2,p=!1);return}a(t(0,d=c._block)),u(t(1,m=c.error)),t(2,p=!0)});function f(){i=this.value,d.set(i)}return s(f,"input_input_handler"),[d,m,p,i,o,f]}s(JU,"instance");var Nd=class extends Be{constructor(e){super(),De(this,e,JU,UU,Oe,{})}};s(Nd,"VanillaBlockDisplayElementPanel");var D3=Nd;(()=>{let n=Blockbench.addCSS("input.svelte-1gpclxv{background-color:var(--color-button);padding:2px 8px;width:100%}.label.svelte-1gpclxv{margin-bottom:-3px !important}.custom-toolbar.svelte-1gpclxv{display:flex;flex-direction:row;margin-bottom:1px}.custom-toolbar.svelte-1gpclxv .sp-replacer{padding:4px 18px !important;height:28px !important;margin:1px 0px !important}.error.svelte-1gpclxv{margin:2px 8px;font-size:14px;color:var(--color-error)}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();ra({component:D3,props:{},elementSelector(){return document.querySelector("#panel_element")}});function HU(n,e,t){if(ne[e.length-1])return e.length-1;let i=0,r=0,a=e.length-1;for(;a-r!==1;)i=r+Math.floor((a-r)/2),n>=e[i]?r=i:a=i;return t?a:r}s(HU,"findIntervalBorderIndex");function $U(n,e=1){if(n<2)throw new Error(`steps must be > 2, got: ${n}`);let t=e/n;return Array.from({length:n},(i,r)=>r*t)}s($U,"stepRange");var nt=class{static step0(e){return e>0?1:0}static step1(e){return e>=1?1:0}static linear(e){return e}static quad(e){return e*e}static cubic(e){return e*e*e}static poly(e){return t=>Math.pow(t,e)}static sin(e){return 1-Math.cos(e*Math.PI/2)}static circle(e){return 1-Math.sqrt(1-e*e)}static exp(e){return Math.pow(2,10*(e-1))}static elastic(e=1){let t=e*Math.PI;return i=>1-Math.pow(Math.cos(i*Math.PI/2),3)*Math.cos(i*t)}static back(e=1.70158){return t=>t*t*((e+1)*t-e)}static bounce(e=.5){let t=s(o=>7.5625*o*o,"q"),i=s(o=>121/4*e*Math.pow(o-6/11,2)+1-e,"w"),r=s(o=>121*e*e*Math.pow(o-9/11,2)+1-e*e,"r"),a=s(o=>484*e*e*e*Math.pow(o-10.5/11,2)+1-e*e*e,"t");return o=>Math.min(t(o),i(o),r(o),a(o))}static in(e){return e}static out(e){return t=>1-e(1-t)}static inOut(e){return t=>t<.5?e(t*2)/2:1-e((1-t)*2)/2}};s(nt,"Easing");var t_=nt.poly(4),n_=nt.poly(5),i_=s((n,e,t)=>n(nt.back(1.70158*e))(t),"back"),r_=s((n,e,t)=>n(nt.elastic(e))(t),"elastic"),a_=s((n,e,t)=>n(nt.bounce(e))(t),"bounce"),o_={linear:nt.linear,step(n,e){let t=$U(n);return t[HU(e,t,!1)]},easeInQuad:nt.in(nt.quad),easeOutQuad:nt.out(nt.quad),easeInOutQuad:nt.inOut(nt.quad),easeInCubic:nt.in(nt.cubic),easeOutCubic:nt.out(nt.cubic),easeInOutCubic:nt.inOut(nt.cubic),easeInQuart:nt.in(t_),easeOutQuart:nt.out(t_),easeInOutQuart:nt.inOut(t_),easeInQuint:nt.in(n_),easeOutQuint:nt.out(n_),easeInOutQuint:nt.inOut(n_),easeInSine:nt.in(nt.sin),easeOutSine:nt.out(nt.sin),easeInOutSine:nt.inOut(nt.sin),easeInExpo:nt.in(nt.exp),easeOutExpo:nt.out(nt.exp),easeInOutExpo:nt.inOut(nt.exp),easeInCirc:nt.in(nt.circle),easeOutCirc:nt.out(nt.circle),easeInOutCirc:nt.inOut(nt.circle),easeInBack:i_.bind(null,nt.in),easeOutBack:i_.bind(null,nt.out),easeInOutBack:i_.bind(null,nt.inOut),easeInElastic:r_.bind(null,nt.in),easeOutElastic:r_.bind(null,nt.out),easeInOutElastic:r_.bind(null,nt.inOut),easeInBounce:a_.bind(null,nt.in),easeOutBounce:a_.bind(null,nt.out),easeInOutBounce:a_.bind(null,nt.inOut)},Qi=Object.fromEntries(Object.entries(o_).map(n=>[n[0],n[0]]));Object.freeze(Qi);var M3="linear",Bd=s(n=>{switch(n.easing){case Qi.easeInBack:case Qi.easeOutBack:case Qi.easeInOutBack:case Qi.easeInElastic:case Qi.easeOutElastic:case Qi.easeInOutElastic:return 1;case Qi.easeInBounce:case Qi.easeOutBounce:case Qi.easeInOutBounce:return .25;case Qi.step:return 5;default:return null}},"getEasingArgDefault");function mo(n=""){return n.includes("Back")||n.includes("Elastic")||n.includes("Bounce")||n===Qi.step}s(mo,"hasArgs");var s_={};xn(s_,{default:()=>KU});var KU='data:image/svg+xml,%0A%0A%0A';var l_={};xn(l_,{default:()=>ZU});var ZU='data:image/svg+xml,%0A%0A%0A';var c_={};xn(c_,{default:()=>YU});var YU='data:image/svg+xml,%0A%0A%0A';var u_={};xn(u_,{default:()=>eJ});var eJ='data:image/svg+xml,%0A%0A%0A';var d_={};xn(d_,{default:()=>nJ});var nJ='data:image/svg+xml,%0A%0A%0A';var f_={};xn(f_,{default:()=>rJ});var rJ='data:image/svg+xml,%0A%0A%0A';var m_={};xn(m_,{default:()=>oJ});var oJ='data:image/svg+xml,%0A%0A%0A';var p_={};xn(p_,{default:()=>lJ});var lJ='data:image/svg+xml,%0A%0A%0A';var __={};xn(__,{default:()=>uJ});var uJ='data:image/svg+xml,%0A%0A%0A';var g_={};xn(g_,{default:()=>fJ});var fJ='data:image/svg+xml,%0A%0A%0A';var h_={};xn(h_,{default:()=>pJ});var pJ='data:image/svg+xml,%0A%0A%0A';var b_={};xn(b_,{default:()=>gJ});var gJ='data:image/svg+xml,%0A%0A%0A';var v_={};xn(v_,{default:()=>bJ});var bJ='data:image/svg+xml,%0A%0A%0A';var y_={};xn(y_,{default:()=>yJ});var yJ='data:image/svg+xml,%0A%0A%0A';var wJ=[s_,l_,c_,u_,d_,f_,m_,p_,__,g_,h_,b_,v_,y_],F3=wJ,L3=["../assets/easingIcons/Back.svg","../assets/easingIcons/Bounce.svg","../assets/easingIcons/Circ.svg","../assets/easingIcons/Cubic.svg","../assets/easingIcons/Elastic.svg","../assets/easingIcons/Expo.svg","../assets/easingIcons/InOut.svg","../assets/easingIcons/Linear.svg","../assets/easingIcons/Out.svg","../assets/easingIcons/Quad.svg","../assets/easingIcons/Quart.svg","../assets/easingIcons/Quint.svg","../assets/easingIcons/Sine.svg","../assets/easingIcons/Step.svg"];function P3(n,e,t){let i=n.slice();return i[15]=e[t],i}s(P3,"get_each_context");function V3(n,e,t){let i=n.slice();return i[18]=e[t],i}s(V3,"get_each_context_1");function z3(n){let e;function t(a,o){return a[3]?.interpolation==="linear"?kJ:xJ}s(t,"select_block_type");let i=t(n,-1),r=i(n);return{c(){r.c(),e=Dt()},m(a,o){r.m(a,o),L(a,e,o)},p(a,o){i===(i=t(a,o))&&r?r.p(a,o):(r.d(1),r=i(a),r&&(r.c(),r.m(e.parentNode,e)))},d(a){r.d(a),a&&F(e)}}}s(z3,"create_if_block");function xJ(n){let e;return{c(){e=P("div"),e.textContent=`${w("panel.keyframe.nonlinear_interpolation")}`,T(e,"class","easings-disabled svelte-59d7u1")},m(t,i){L(t,e,i)},p:ue,d(t){t&&F(e)}}}s(xJ,"create_else_block");function kJ(n){let e,t,i=w("panel.keyframe.easing_type.title")+"",r,a,o,l=n[0],u,c,d=mo(n[3]?.easing),m,p=U3(n),f=n[3].easing!=="linear"&&J3(n),_=d&&q3(n);return{c(){e=P("div"),t=P("label"),r=Re(i),o=G(),p.c(),u=G(),f&&f.c(),c=G(),_&&_.c(),m=Dt(),T(t,"for","easing_type_input"),T(t,"class","undefined"),Ge(t,"font-weight","unset"),Ge(t,"width","100px"),Ge(t,"text-align","left"),T(t,"title",a=w("panel.keyframe.easing_type.description")),T(e,"class","bar flex")},m(g,h){L(g,e,h),N(e,t),N(t,r),N(e,o),p.m(e,null),L(g,u,h),f&&f.m(g,h),L(g,c,h),_&&_.m(g,h),L(g,m,h)},p(g,h){h&1&&Oe(l,l=g[0])?(p.d(1),p=U3(g),p.c(),p.m(e,null)):p.p(g,h),g[3].easing!=="linear"?f?f.p(g,h):(f=J3(g),f.c(),f.m(c.parentNode,c)):f&&(f.d(1),f=null),h&8&&(d=mo(g[3]?.easing)),d?_?_.p(g,h):(_=q3(g),_.c(),_.m(m.parentNode,m)):_&&(_.d(1),_=null)},d(g){g&&F(e),p.d(g),g&&F(u),f&&f.d(g),g&&F(c),_&&_.d(g),g&&F(m)}}}s(kJ,"create_if_block_1");function G3(n){let e,t,i,r,a,o,l,u,c;function d(){return n[8](n[18])}return s(d,"click_handler"),{c(){e=P("button"),t=P("img"),o=G(),T(t,"class",i=Ai(n[0]===n[18]?"selected-keyframe-icon":"")+" svelte-59d7u1"),Yt(t.src,r=Rd[n[18]])||T(t,"src",r),T(t,"alt",a=n[18]),T(e,"class","easing-type svelte-59d7u1"),T(e,"title",l=w(`panel.keyframe.easing_type.options.${n[18]}`))},m(m,p){L(m,e,p),N(e,t),N(e,o),u||(c=Le(e,"click",d),u=!0)},p(m,p){n=m,p&1&&i!==(i=Ai(n[0]===n[18]?"selected-keyframe-icon":"")+" svelte-59d7u1")&&T(t,"class",i)},d(m){m&&F(e),u=!1,c()}}}s(G3,"create_each_block_1");function U3(n){let e,t=n[5],i=[];for(let r=0;r[PathModule.basename(L3[e]).replace(".svg","").toLowerCase(),n.default])),TJ={in:Rd.expo,out:Rd.out,inout:Rd.inout};function CJ(n){return n.animator.keyframes.filter(e=>e.channel===n.channel).sort((e,t)=>e.time-t.time)[0]===n}s(CJ,"isFirstKeyframe");function AJ(n,e,t){let i,r=ue,a=s(()=>(r(),r=ze(d,b=>t(4,i=b)),d),"$$subscribe_easingArg");n.$$.on_destroy.push(()=>r());let o=["linear","sine","quad","cubic","quart","quint","expo","circ","elastic","back","bounce"],l=["in","out","inout"],u="linear",c,d;function m(){if(!h?.easing)return;let b=h.easing.match(/ease(InOut|Out|In)(.+)/);return b?(mo(h.easing)&&_(),console.log(b[2].toLowerCase(),b[1].toLowerCase()),{type:b?.[2].toLowerCase(),mode:b?.[1].toLowerCase()}):{type:h.easing}}s(m,"getSelectedEasing");function p(b,x="inout"){h&&(b==="linear"?t(3,h.easing="linear",h):t(3,h.easing=`ease${x&&x!=="inout"?x[0].toUpperCase()+x.slice(1):"InOut"}${b[0].toUpperCase()+b.slice(1)}`,h),u!==b&&_(),t(0,u=b),t(1,c=x))}s(p,"setSelectedEasing");let f;function _(){h&&(f&&f(),mo(h.easing)?(a(t(2,d=new ge(Bd(h)||0))),f=d.subscribe(b=>g(b))):a(t(2,d=void 0)))}s(_,"getEasingArgs");function g(b){h&&t(3,h.easingArgs=[b],h)}s(g,"setEasingArgs");let h;re.SELECT_KEYFRAME.subscribe(b=>{if(console.log("selected keyframe",b),Ue()&&b&&["position","rotation","scale"].includes(b.channel)&&!CJ(b)){console.log(b),t(3,h=b);let x=m();x&&(t(0,u=x.type),t(1,c=x.mode))}else t(3,h=void 0)}),re.UNSELECT_KEYFRAME.subscribe(()=>{t(3,h=void 0)}),re.UNSELECT_AJ_PROJECT.subscribe(()=>{t(3,h=void 0)});let v=s(b=>p(b,c),"click_handler"),y=s(b=>p(u,b),"click_handler_1");function k(){i=ko(this.value),d.set(i)}return s(k,"input_input_handler"),[u,c,d,h,i,o,l,p,v,y,k]}s(AJ,"instance");var Dd=class extends Be{constructor(e){super(),De(this,e,AJ,EJ,Oe,{})}};s(Dd,"KeyframeEasings");var K3=Dd;(()=>{let n=Blockbench.addCSS(`.easings-disabled.svelte-59d7u1{margin-left:16px;font-size:16px;color:var(--color-subtle_text);text-wrap:balance;margin-bottom:1rem;font-style:italic}.easing-container.svelte-59d7u1{display:flex;flex-direction:row;flex-wrap:wrap;grid-gap:2px;margin-left:2px}.easing-type.svelte-59d7u1{width:32px;padding:0px;margin:0px;min-width:unset;display:flex;align-items:center;justify-content:center}.easing-type.svelte-59d7u1:hover{background-color:var(--color-selected)}.selected-keyframe-icon.svelte-59d7u1{filter:invert(49%) sepia(16%) saturate(6320%) hue-rotate(198deg) brightness(101%)\r + contrast(106%)}`);function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();ra({component:K3,props:{},elementSelector(){return $("#panel_keyframe")[0]}});function W3(n,e,t){let i=n.slice();return i[11]=e[t],i}s(W3,"get_each_context");function SJ(n){let e,t,i,r,a,o,l;function u(f){n[7](f)}s(u,"checkbox_checked_binding");let c={label:w("dialog.locator_config.use_entity.title"),tooltip:w("dialog.locator_config.use_entity.description")};n[0]!==void 0&&(c.checked=n[0]),e=new tt({props:c}),le.push(()=>we(e,"checked",u));let d=n[4]&&Z3(n);function m(f){n[10](f)}s(m,"codeinput_value_binding_1");let p={label:w("dialog.locator_config.ticking_commands.title"),tooltip:w("dialog.locator_config.ticking_commands.description")};return n[3]!==void 0&&(p.value=n[3]),a=new as({props:p}),le.push(()=>we(a,"value",m)),{c(){_e(e.$$.fragment),i=G(),d&&d.c(),r=G(),_e(a.$$.fragment)},m(f,_){me(e,f,_),L(f,i,_),d&&d.m(f,_),L(f,r,_),me(a,f,_),l=!0},p(f,_){let g={};!t&&_&1&&(t=!0,g.checked=f[0],ye(()=>t=!1)),e.$set(g),f[4]?d?(d.p(f,_),_&16&&q(d,1)):(d=Z3(f),d.c(),q(d,1),d.m(r.parentNode,r)):d&&(Et(),Z(d,1,1,()=>{d=null}),Tt());let h={};!o&&_&8&&(o=!0,h.value=f[3],ye(()=>o=!1)),a.$set(h)},i(f){l||(q(e.$$.fragment,f),q(d),q(a.$$.fragment,f),l=!0)},o(f){Z(e.$$.fragment,f),Z(d),Z(a.$$.fragment,f),l=!1},d(f){de(e,f),f&&F(i),d&&d.d(f),f&&F(r),de(a,f)}}}s(SJ,"create_else_block");function jJ(n){let e,t=w("dialog.locator_config.plugin_mode_warning").split(` +`),i=[];for(let r=0;rwe(e,"value",l));function c(m){n[9](m)}s(c,"codeinput_value_binding");let d={label:w("dialog.locator_config.summon_commands.title"),tooltip:w("dialog.locator_config.summon_commands.description")};return n[2]!==void 0&&(d.value=n[2]),r=new as({props:d}),le.push(()=>we(r,"value",c)),{c(){_e(e.$$.fragment),i=G(),_e(r.$$.fragment)},m(m,p){me(e,m,p),L(m,i,p),me(r,m,p),o=!0},p(m,p){let f={};!t&&p&2&&(t=!0,f.value=m[1],ye(()=>t=!1)),e.$set(f);let _={};!a&&p&4&&(a=!0,_.value=m[2],ye(()=>a=!1)),r.$set(_)},i(m){o||(q(e.$$.fragment,m),q(r.$$.fragment,m),o=!0)},o(m){Z(e.$$.fragment,m),Z(r.$$.fragment,m),o=!1},d(m){de(e,m),m&&F(i),de(r,m)}}}s(Z3,"create_if_block_1");function X3(n){let e,t=n[11]+"",i;return{c(){e=P("p"),i=Re(t)},m(r,a){L(r,e,a),N(e,i)},p:ue,d(r){r&&F(e)}}}s(X3,"create_each_block");function IJ(n){let e,t,i,r,a=[jJ,SJ],o=[];function l(u,c){return u[5]?0:1}return s(l,"select_block_type"),t=l(n,-1),i=o[t]=a[t](n),{c(){e=P("div"),i.c()},m(u,c){L(u,e,c),o[t].m(e,null),r=!0},p(u,[c]){i.p(u,c)},i(u){r||(q(i),r=!0)},o(u){Z(i),r=!1},d(u){u&&F(e),o[t].d()}}}s(IJ,"create_fragment");function OJ(n,e,t){let i,r=ue,a=s(()=>(r(),r=ze(l,h=>t(4,i=h)),l),"$$subscribe_useEntity");n.$$.on_destroy.push(()=>r());let o=!!Project?.animated_java?.enable_plugin_mode,{useEntity:l}=e;a();let{entityType:u}=e,{summonCommands:c}=e,{tickingCommands:d}=e,m=s(h=>h.length===0?{type:"error",message:w("dialog.locator_config.entity_type.error.empty")}:Vn.entity_type?.has(h)||Vn.entity_type?.has(h.replace(/^minecraft\:/,""))?{type:"success",message:""}:{type:"warning",message:w("dialog.locator_config.entity_type.warning.invalid")},"entityTypeValidator");function p(h){l=h,a(t(0,l))}s(p,"checkbox_checked_binding");function f(h){u=h,t(1,u)}s(f,"lineinput_value_binding");function _(h){c=h,t(2,c)}s(_,"codeinput_value_binding");function g(h){d=h,t(3,d)}return s(g,"codeinput_value_binding_1"),n.$$set=h=>{"useEntity"in h&&a(t(0,l=h.useEntity)),"entityType"in h&&t(1,u=h.entityType),"summonCommands"in h&&t(2,c=h.summonCommands),"tickingCommands"in h&&t(3,d=h.tickingCommands)},[l,u,c,d,i,o,m,p,f,_,g]}s(OJ,"instance");var Md=class extends Be{constructor(e){super(),De(this,e,OJ,IJ,Oe,{useEntity:0,entityType:1,summonCommands:2,tickingCommands:3})}};s(Md,"LocatorConfigDialog");var Y3=Md;function NJ(n){let e=jr.fromJSON(n.config??=new jr().toJSON()),t=new ge(e.useEntity),i=new ge(e.entityType),r=new ge(e.summonCommands),a=new ge(e.tickingCommands);new qt({id:`${ke.name}:locatorConfig`,title:w("dialog.locator_config.title"),width:600,component:Y3,props:{useEntity:t,entityType:i,summonCommands:r,tickingCommands:a},preventKeybinds:!0,onConfirm(){e.useEntity=t.get(),e.entityType=i.get(),e.summonCommands=r.get(),e.tickingCommands=a.get(),n.config=e.toJSON()}}).show()}s(NJ,"openLocatorConfigDialog");var Q3=on(`${ke.name}:locator_config`,{icon:"settings",name:w("action.open_locator_config.name"),condition:()=>Format===rt,click:()=>{let n=Locator.selected.at(0);n&&NJ(n)}});$e(`${ke.name}:animationControllerMod`,void 0,()=>{let[,n]=wc(AnimationController.prototype,"saved");return{unsubSet:n.subscribe(({storage:t})=>{Format.id===rt.id&&(t.value=!0)})}},n=>{n.unsubSet()});$e(`${ke.name}:animationPropertiesAction`,{originalOpen:Blockbench.Animation.prototype.propertiesDialog},n=>(Blockbench.Animation.prototype.propertiesDialog=function(){if(Ue()){if(!Blockbench.Animation.selected){Blockbench.showQuickMessage("No animation selected");return}yv(Blockbench.Animation.selected)}else n.originalOpen.call(this)},n),n=>{Blockbench.Animation.prototype.propertiesDialog=n.originalOpen});var ew=20,tw=.05;$e(`${ke.name}:animationDefaultPropertiesMod`,{originalExtend:Blockbench.Animation.prototype.extend,originalSetLength:Blockbench.Animation.prototype.setLength},n=>(Blockbench.Animation.prototype.extend=function(e){if(n.originalExtend.call(this,e),Ue()){this.snapping=ew,this.length=Math.max(this.length,tw);for(let t of Object.values(this.animators)){if(!t)continue;let i=-1/0;for(let r of t.keyframes){let a=aa(r.time,ew);a!==r.time&&(a===i&&(a+=.05),r.time=a,i=a)}}}return this},Blockbench.Animation.prototype.setLength=function(e){return Ue()&&(e=Math.max(e||this.length,tw)),n.originalSetLength.call(this,e)},n),n=>{Blockbench.Animation.prototype.extend=n.originalExtend,Blockbench.Animation.prototype.setLength=n.originalSetLength});$e(`${ke.name}:animationPropertiesMod`,{excludedNodesProperty:void 0},n=>(n.excludedNodesProperty=new Property(Blockbench.Animation,"array","excluded_nodes",{condition:()=>Ue(),label:w("animation.excluded_nodes"),default:[]}),n),n=>{n.excludedNodesProperty?.delete()});var Fd=class extends Property{constructor(e,t,i){super(e,"object",t,i)}merge(e,t){typeof t[this.name]=="object"&&(e[this.name]=JSON.parse(JSON.stringify(t[this.name])))}copy(e,t){typeof e[this.name]=="object"&&(t[this.name]=JSON.parse(JSON.stringify(e[this.name])))}};s(Fd,"DeepClonedObjectProperty");$e(`${ke.name}:boneProperties`,{configs:void 0},n=>(n.configs=new Fd(Group,"configs",{condition:Ue,default:{default:void 0,variants:{}}}),n),n=>{n.configs?.delete()});var nw=Canvas.outlineMaterial.clone();nw.color.set("#ff0000");function BJ(n){if(n.rotation[0]===0&&n.rotation[1]===0&&n.rotation[2]===0)return!0;let e=n.rotation[0]+n.rotation[1]+n.rotation[2];return(e===n.rotation[0]||e===n.rotation[1]||e===n.rotation[2])&&(e===-45||e===-22.5||e===0||e===22.5||e===45)}s(BJ,"isCubeValid");$e(`${ke.name}:cubeOutlineMod`,{originalUpdateTransform:Cube.preview_controller.updateTransform,originalInit:Cube.prototype.init},n=>(Cube.preview_controller.updateTransform=function(e){if(Ue()){let t=BJ(e);e.rotationInvalid&&t?(e.mesh.outline.material=Canvas.outlineMaterial,e.rotationInvalid=!1):!e.rotationInvalid&&!t&&(e.mesh.outline.material=nw,e.rotationInvalid=!0)}n.originalUpdateTransform.call(this,e)},Cube.prototype.init=function(){let e=n.originalInit.call(this);e.rotationInvalid=!1;let[t]=wc(this.mesh.outline,"visible");return t.subscribe(({storage:i})=>{Ue()&&(i.value=this.rotationInvalid||i.value)}),e},n),n=>{Cube.preview_controller.updateTransform=n.originalUpdateTransform,Cube.prototype.init=n.originalInit});$e(`${ke.name}:exportOverAction`,{action:BarItems.export_over,originalClick:BarItems.export_over.click},n=>(n.action.click=e=>{if(!(!Project||!Format))if(Format.id===rt.id){let t=Project.save_path||Project.export_path;t?fs.existsSync(PathModule.dirname(t))?(Project.save_path=t,Cn.write(Cn.compile(),t)):(console.error(`Failed to export Animated Java Blueprint, file location '${t}' does not exist!`),Cn.export()):Cn.export()}else n.originalClick.call(n.action,e)},n),n=>{n.action.click=n.originalClick});$e(`${ke.name}:groupContextMenu`,{menuStructure:Group.prototype.menu.structure},n=>{let e=[...n.menuStructure];return e.splice(6,0,o3),Group.prototype.menu.structure=e,n},n=>{Group.prototype.menu.structure=n.menuStructure});$e(`${ke.name}:groupNameMod`,{originalRename:Group.prototype.saveName,originalSanitize:Group.prototype.sanitizeName},n=>(Group.prototype.saveName=function(e){return Ue()&&(this.name=Ht(this.name)),n.originalRename.call(this,e)},Group.prototype.sanitizeName=function(){return Ue()&&(this.name=Ht(this.name)),n.originalSanitize.call(this)},n),n=>{Group.prototype.rename=n.originalRename});$e(`${ke.name}:keyframeSelectEventMod`,{originalKeyframeSelect:Blockbench.Keyframe.prototype.select,originalUpdateKeyframeSelection:updateKeyframeSelection,barItem:BarItems.keyframe_interpolation,originalChange:BarItems.keyframe_interpolation.set},n=>(Blockbench.Keyframe.prototype.select=function(e){if(!Ue())return n.originalKeyframeSelect.call(this,e);let t=n.originalKeyframeSelect.call(this,e);return re.SELECT_KEYFRAME.dispatch(t),t},globalThis.updateKeyframeSelection=function(){return Ue()||(Timeline.keyframes.forEach(e=>{e.selected&&Timeline.selected&&!Timeline.selected.includes(e)&&(e.selected=!1,re.UNSELECT_KEYFRAME.dispatch());let t=!1;e.transform&&(t=!!e.data_points.find(i=>!isStringNumber(i.x)||!isStringNumber(i.y)||!isStringNumber(i.z))),t!=e.has_expressions&&(e.has_expressions=t)}),Timeline.selected&&(console.log("Selected keyframe:",Timeline.selected[0]),re.SELECT_KEYFRAME.dispatch(Timeline.selected[0]))),n.originalUpdateKeyframeSelection()},n.barItem.set=function(e){let t=n.originalChange.call(this,e);return Ue()&&(Timeline.selected&&Timeline.selected.length>0?re.SELECT_KEYFRAME.dispatch(Timeline.selected[0]):re.UNSELECT_KEYFRAME.dispatch()),t},n),n=>{Blockbench.Keyframe.prototype.select=n.originalKeyframeSelect,globalThis.updateKeyframeSelection=n.originalUpdateKeyframeSelection,n.barItem.change=n.originalChange});function RJ(n){return!n||n.startsWith("easeInOut")?n:n.startsWith("easeIn")?n.replace("easeIn","easeOut"):n.startsWith("easeOut")?n.replace("easeOut","easeIn"):n}s(RJ,"reverseEasing");$e(`${ke.name}:reverseKeyframesMod`,{action:BarItems.reverse_keyframes,originalClick:BarItems.reverse_keyframes.click},n=>(n.action.click=function(e){n.originalClick.call(this,e),Undo.initEdit({keyframes:Timeline.selected||void 0});let t={};for(let r of Timeline.selected||[])t[r.animator.uuid]??=[],t[r.animator.uuid].push(r);let i={};for(let[r,a]of Object.entries(t)){let o={};i[r]=o;for(let l of a)o[l.channel]??=[],o[l.channel].push(l)}for(let r of Object.values(i))for(let a of Object.values(r)){a.sort((l,u)=>l.time-u.time);let o=a.map(l=>({easing:RJ(l.easing),easingArgs:l.easingArgs}));a.forEach((l,u)=>{if(u==0){l.easing=void 0,l.easingArgs=void 0;return}let c=o[u-1];l.easing=c.easing,l.easingArgs=c.easingArgs})}Undo.finishEdit("Reverse keyframe easing"),updateKeyframeSelection(),Animator.preview()},n),n=>{n.action.click=n.originalClick});function DJ(n,e,t){return t*(e-n)+n}s(DJ,"lerp");$e(`${ke.name}:keyframeEasingMod`,{originalGetLerp:Blockbench.Keyframe.prototype.getLerp,easingProperty:void 0,easingArgsProperty:void 0},n=>(n.easingProperty=new Property(Blockbench.Keyframe,"string","easing",{default:M3,condition:Ue()}),n.easingArgsProperty=new Property(Blockbench.Keyframe,"array","easingArgs",{condition:Ue()}),Blockbench.Keyframe.prototype.getLerp=function(e,t,i,r){if(!Ue())return n.originalGetLerp.call(this,e,t,i,r);let a=e.easing||"linear",o=o_[a];if(mo(a)){let m=Array.isArray(e.easingArgs)&&e.easingArgs.length>0?e.easingArgs[0]:Bd(e);o=o.bind(null,m||0)}let l=o(i),u=this.calc(t),c=e.calc(t),d=DJ(u,c,l);if(Number.isNaN(d))throw new Error("Invalid easing function or arguments.");return d},n),n=>{n.easingProperty?.delete(),n.easingArgsProperty?.delete(),Blockbench.Keyframe.prototype.getLerp=n.originalGetLerp});var iw=Animator.showMotionTrail,rw=Animator.preview,aw=globalThis.updateSelection,ow=Locator.prototype.select,As=class extends BoneAnimator{_name;uuid;element;constructor(e,t,i){super(e,t,i),this.uuid=e,this._name=i}getElement(){return this.element=OutlinerNode.uuids[this.uuid],this.element}select(){if(this.getElement(),!this.element)return unselectAllElements(),this;if(this.element.locked)return this;if(this.element.selected!==!0&&this.element&&this.element.select(),GeneralAnimator.prototype.select.call(this),this[Toolbox.selected.animation_channel]&&(Timeline.selected&&Timeline.selected.length===0||(Timeline.selected&&Timeline.selected[0].animator)!==this)){let e;this[Toolbox.selected.animation_channel].forEach(t=>{Math.abs(t.time-Timeline.time)<.002&&(e=t)}),e&&e.select()}return this.element&&this.element.parent&&this.element.parent!=="root"&&this.element.parent.openUp(),this}doRender(){return this.getElement(),!!(this.element&&this.element.mesh)}displayPosition(e,t=1){let i=this.element.mesh;return e&&(i.position.x-=e[0]*t,i.position.y+=e[1]*t,i.position.z+=e[2]*t),this}interpolate(){return[0,0,0]}displayFrame(){this.doRender()&&this.getElement()}showMotionTrail(){}};s(As,"LocatorAnimator");As.prototype.type="locator";As.prototype.channels={commands:{name:w("effect_animator.timeline.commands"),mutable:!0,transform:!0,max_data_points:1}};var Ld=!1;function MJ(){Ld||(Locator.animator=As,Animator.showMotionTrail=function(n){!n||n instanceof Locator||iw(n)},Animator.preview=function(n){rw(n),Mode.selected.id===Modes.options.animate.id&&Outliner.selected[0]instanceof Locator&&(Canvas.gizmos[0].visible=!1,Transformer.visible=!1)},globalThis.updateSelection=function(){aw(),Mode.selected.id===Modes.options.animate.id&&Outliner.selected[0]instanceof Locator&&(Canvas.gizmos[0].visible=!1,Transformer.visible=!1)},Locator.prototype.select=function(n,e){let t=ow.call(this,n,e);return Animator.open&&Blockbench.Animation.selected&&Blockbench.Animation.selected.getBoneAnimator().select(),t},Ld=!0)}s(MJ,"inject");function FJ(){Ld&&(Locator.animator=void 0,Animator.showMotionTrail=iw,Animator.preview=rw,globalThis.updateSelection=aw,Locator.prototype.select=ow,Ld=!1)}s(FJ,"extract");re.PRE_SELECT_PROJECT.subscribe(n=>{n.format.id===rt.id?MJ():FJ()});$e(`${ke.name}:groupContextMenu`,{menuStructure:Locator.prototype.menu.structure},n=>{let e=[...n.menuStructure];return e.splice(6,0,Q3),Locator.prototype.menu.structure=e,n},n=>{Locator.prototype.menu.structure=n.menuStructure});$e(`${ke.name}:locatorProperties`,{config:void 0},n=>(n.config=new Property(Locator,"instance","config",{condition:Ue,default:void 0}),n),n=>{n.config?.delete()});$e(`${ke.name}:modelFormatConvertToMod`,{original:ModelFormat.prototype.convertTo},n=>(ModelFormat.prototype.convertTo=function(){let e=n.original.call(this);return this===rt&&ib(),e},n),n=>{ModelFormat.prototype.convertTo=n.original});$e(`${ke.name}:modelFormatPreSelectProjectEvent`,{originalSelect:ModelProject.prototype.select},n=>(ModelProject.prototype.select=function(){return this.format.id===rt.id&&re.PRE_SELECT_PROJECT.dispatch(this),n.originalSelect.call(this)},n),n=>{ModelProject.prototype.select=n.originalSelect});var sw={"smoothmin(a, b, k)":`v.h = math.clamp(0.5 + (0.5 * (a - b) / k), 0, 1); return math.lerp(a, b, v.h) - (k * v.h * (1 - v.h));`,"smoothclamp(value, min, max, k)":"return lunar.smoothmin(lunar.smoothmin(value, min, -k), max, k);","lopsided_wave(value, lopside_mag)":"return math.sin(value + math.cos(value) * lopside_mag);","easeinsine(progress)":"return 1 - math.cos((progress * 180) / 2);","easeoutsine(progress)":"return math.sin((progress * 180) / 2);","easeinoutsine(progress)":"return(math.cos(180 * progress) - 1) * -1 / 2;","easeinquad(progress)":"return progress * progress;","easeoutquad(progress)":"return 1 - (1 - progress) * (1 - progress);","easeinoutquad(progress)":`return progress < 0.5 ? 2 * progress * progress : 1 - math.pow(-2 * progress + 2, 2) / 2;`,"easeincubic(progress)":"return progress * progress * progress;","easeoutcubic(progress)":"return 1 - math.pow(1 - progress, 3);","easeinoutcubic(progress)":`return progress < 0.5 @@ -3919,15 +3929,14 @@ return progress < 1 / t.d1 t.hang = hang * (math.pi / 180); return math.mod(math.abs(t.progress), 2 * math.pi + t.hang * 2) > math.pi + t.hang ? math.clamp(-math.mod(math.abs(t.progress), math.pi + t.hang) / math.pi + 1, 0, 1) - : math.clamp(math.mod(math.abs(t.progress), math.pi + t.hang) / math.pi, 0, 1);`};var r_=Animator.MolangParser.global_variables,QU=["true","false","math.","query.","variable.","temp.","context.","this","loop()","return","break","continue"],eG=["all_animations_finished","any_animation_finished","anim_time","life_time","yaw_speed","ground_speed","vertical_speed","property","has_property()","variant","mark_variant","skin_id","above_top_solid","actor_count","all()","all_tags","anger_level","any()","any_tag","approx_eq()","armor_color_slot","armor_material_slot","armor_texture_slot","average_frame_time","blocking","body_x_rotation","body_y_rotation","bone_aabb","bone_origin","bone_rotation","camera_distance_range_lerp","camera_rotation()","can_climb","can_damage_nearby_mobs","can_dash","can_fly","can_power_jump","can_swim","can_walk","cape_flap_amount","cardinal_facing","cardinal_facing_2d","cardinal_player_facing","combine_entities()","count","current_squish_value","dash_cooldown_progress","day","death_ticks","debug_output","delta_time","distance_from_camera","effect_emitter_count","effect_particle_count","equipment_count","equipped_item_all_tags","equipped_item_any_tag()","equipped_item_is_attachable","eye_target_x_rotation","eye_target_y_rotation","facing_target_to_range_attack","frame_alpha","get_actor_info_id","get_animation_frame","get_default_bone_pivot","get_locator_offset","get_root_locator_offset","had_component_group()","has_any_family()","has_armor_slot","has_biome_tag","has_block_property","has_cape","has_collision","has_dash_cooldown","has_gravity","has_owner","has_rider","has_target","head_roll_angle","head_x_rotation","head_y_rotation","health","heartbeat_interval","heartbeat_phase","heightmap","hurt_direction","hurt_time","in_range()","invulnerable_ticks","is_admiring","is_alive","is_angry","is_attached_to_entity","is_avoiding_block","is_avoiding_mobs","is_baby","is_breathing","is_bribed","is_carrying_block","is_casting","is_celebrating","is_celebrating_special","is_charged","is_charging","is_chested","is_critical","is_croaking","is_dancing","is_delayed_attacking","is_digging","is_eating","is_eating_mob","is_elder","is_emerging","is_emoting","is_enchanted","is_fire_immune","is_first_person","is_ghost","is_gliding","is_grazing","is_idling","is_ignited","is_illager_captain","is_in_contact_with_water","is_in_love","is_in_ui","is_in_water","is_in_water_or_rain","is_interested","is_invisible","is_item_equipped","is_item_name_any()","is_jump_goal_jumping","is_jumping","is_laying_down","is_laying_egg","is_leashed","is_levitating","is_lingering","is_moving","is_name_any()","is_on_fire","is_on_ground","is_on_screen","is_onfire","is_orphaned","is_owner_identifier_any()","is_persona_or_premium_skin","is_playing_dead","is_powered","is_pregnant","is_ram_attacking","is_resting","is_riding","is_roaring","is_rolling","is_saddled","is_scared","is_selected_item","is_shaking","is_shaking_wetness","is_sheared","is_shield_powered","is_silent","is_sitting","is_sleeping","is_sneaking","is_sneezing","is_sniffing","is_sonic_boom","is_spectator","is_sprinting","is_stackable","is_stalking","is_standing","is_stunned","is_swimming","is_tamed","is_transforming","is_using_item","is_wall_climbing","item_in_use_duration","item_is_charged","item_max_use_duration","item_remaining_use_duration","item_slot_to_bone_name()","key_frame_lerp_time","last_frame_time","last_hit_by_player","lie_amount","life_span","lod_index","log","main_hand_item_max_duration","main_hand_item_use_duration","max_durability","max_health","max_trade_tier","maximum_frame_time","minimum_frame_time","model_scale","modified_distance_moved","modified_move_speed","moon_brightness","moon_phase","movement_direction","noise","on_fire_time","out_of_control","player_level","position()","position_delta()","previous_squish_value","remaining_durability","roll_counter","rotation_to_camera()","shake_angle","shake_time","shield_blocking_bob","show_bottom","sit_amount","sleep_rotation","sneeze_counter","spellcolor","standing_scale","structural_integrity","surface_particle_color","surface_particle_texture_coordinate","surface_particle_texture_size","swell_amount","swelling_dir","swim_amount","tail_angle","target_x_rotation","target_y_rotation","texture_frame_index","time_of_day","time_since_last_vibration_detection","time_stamp","total_emitter_count","total_particle_count","trade_tier","unhappy_counter","walk_distance","wing_flap_position","wing_flap_speed"],tG={"in_range()":"in_range( value, min, max )","all()":"in_range( value, values... )","any()":"in_range( value, values... )","approx_eq()":"in_range( value, values... )"},nG=["item_slot","block_face","cardinal_block_face_placed_on","is_first_person","owning_entity","player_offhand_arm_height","other","count"],iG=["attack_time","is_first_person"],rG=["sin()","cos()","abs()","clamp()","pow()","sqrt()","random()","ceil()","round()","trunc()","floor()","mod()","min()","max()","exp()","ln()","lerp()","lerprotate()","pi","asin()","acos()","atan()","atan2()","die_roll()","die_roll_integer()","hermite_blend()","random_integer()"],aG={"clamp()":"clamp( value, min, max )","pow()":"pow( base, exponent )","random()":"random( low, high )","mod()":"mod( value, denominator )","min()":"min( A, B )","max()":"max( A, B )","lerp()":"lerp( start, end, 0_to_1 )","lerprotate()":"lerprotate( start, end, 0_to_1 )","atan2()":"atan2( y, x )","die_roll()":"die_roll( num, low, high )","die_roll_integer()":"die_roll_integer( num, low, high )","random_integer()":"random_integer( low, high )","hermite_blend()":"hermite_blend( 0_to_1 )"},Cd={},a_={};for(let[n,e]of Object.entries(ky)){let t=n.match(/^(.+?)\((.*?)\)$/);if(!t)continue;let i=t[1],r=t[2].split(",").map(a=>a.trim());Cd[i]=(...a)=>{let o={};for(let l=0;l{if(!i.value)return;let r=i.value.match(/(v|variable)\.\w+/gi);r&&r.forEach(a=>{let o=a.substring(a.indexOf(".")+1);o!==n&&e.add(o)})}),e}s(oG,"getProjectVariables");function ws(n,e,t=!1,i=void 0){let r=n.filter(a=>a.startsWith(e)&&a.length!=e.length);return n.forEach(a=>{!r.includes(a)&&a.includes(e)&&a.length!=e.length&&r.push(a)}),t&&t.forEach(a=>r.remove(a)),r.map(a=>({text:a,label:i&&i[a],overlap:e.length}))}s(ws,"filterAndSortList");Ke(`${_e.name}:molangMod`,{originalAutocompleteMolang:Animator.autocompleteMolang,unsubscribeSelectAjProject:void 0,unsuscribeUnselectAjProject:void 0},n=>(n.unsubscribeSelectAjProject=te.SELECT_AJ_PROJECT.subscribe(()=>{Object.assign(r_,Cd),Animator.autocompleteMolang=function(e,t,i){let r=e.substring(0,t).split(/[^a-zA-Z_.]\.*/g).last();if(!r)return[];if(r=r.toLowerCase(),r.includes(".")){let[a,o]=r.split(".");if(a=="math")return ws(rG,o,void 0,aG);if(a=="query"||a=="q")return ws(eG,o,i!=="controller"&&["all_animations_finished","any_animation_finished"],tG);if(a=="temp"||a=="t"){let l=e.match(/([^a-z]|^)t(emp)?\.\w+/gi);if(l){let c=l.map(d=>d.split(".")[1]),u=c.filter((d,m)=>d!==o&&c.indexOf(d)===m);return ws(u,o)}}if(a=="context"||a=="c")return ws([...nG],o);if(a=="variable"||a=="v"){let l=[...oG(o)];return l.safePush(...iG),ws(l,o)}}else{let a=QU.slice(),o={};return i==="placeholders"&&(o={"toggle()":"toggle( name )","slider()":"slider( name, step?, min?, max? )","impulse()":"impulse( name, duration )"},a.push(...Object.keys(o))),ws([...a,...Object.keys(a_)],r,void 0,{...o,...a_})}return[]}}),n.unsuscribeUnselectAjProject=te.UNSELECT_AJ_PROJECT.subscribe(()=>{for(let e of Object.keys(Cd))delete r_[e];Animator.autocompleteMolang=n.originalAutocompleteMolang}),n),n=>{for(let e of Object.keys(Cd))delete r_[e];Animator.autocompleteMolang=n.originalAutocompleteMolang,n.unsubscribeSelectAjProject?.(),n.unsuscribeUnselectAjProject?.()});Ke(`${_e.name}:panelMod`,{panel:Interface.Panels.animations},n=>{let e=n.panel.inside_vue.$options.computed.files;return n.panel.inside_vue.$options.computed.files=function(){return Format.id===et.id?{"":{animations:[...Blockbench.Animation.all,...Blockbench.AnimationController.all],name:"",hide_head:!0}}:e.call(this)},{...n,originalFilesFunction:e}},n=>{n.panel.inside_vue.$options.computed.files=n.originalFilesFunction});Ke(`${rc.name}:projectSettingsActionOverride`,{action:BarItems.project_window,oldClick:BarItems.project_window.click},n=>(n.action.click=function(e){Format.id===et.id?Xo():n.oldClick.call(this,e)},n),n=>{n.action.click=n.oldClick});Ke(`${_e.name}:saveAllAnimationsActionMod`,{action:BarItems.save_all_animations},n=>{let e=n.action.condition;return n.action.condition=function(){return Format.id===et.id?!1:e.call(this)},{...n,originalCondition:e}},n=>{n.action.condition=n.originalCondition});Ke(`${_e.name}:save_project`,{action:BarItems.save_project,originalClick:BarItems.save_project.click},n=>(n.action.click=e=>{!Project||!Format||(Format===et?Fc():n.originalClick.call(n.action,e))},n),n=>{n.action.click=n.originalClick});Ke(`${_e.name}:save_project_as`,{action:BarItems.save_project_as,originalClick:BarItems.save_project_as.click},n=>(n.action.click=e=>{!Project||!Format||(Format===et?xn.export():n.originalClick.call(n.action,e))},n),n=>{n.action.click=n.originalClick});Ke(`${_e.name}:variantPreviewCubeFace`,{originalGetTexture:CubeFace.prototype.getTexture},n=>(CubeFace.prototype.getTexture=function(){if(Ue()&&this.texture){let e=Se.selected;if(e&&this.cube.parent instanceof Group&&!e.excludedNodes.find(t=>t.value===this.cube.parent.uuid)&&e.textureMap.has(this.texture))return this.lastVariant=e,e.textureMap.getMappedTexture(this.texture);if(Mode.selected.id===Modes.options.animate.id&&this.lastVariant&&!e?.isDefault)return this.lastVariant.textureMap.getMappedTexture(this.texture)}return this.lastVariant=void 0,n.originalGetTexture.call(this)},n),n=>{CubeFace.prototype.getTexture=n.originalGetTexture});Ke(`${_e.name}:showDefaultPose`,{original:Animator.showDefaultPose},n=>(Animator.showDefaultPose=function(e){if(!Ue())return n.original(e);let t=[...Group.all,...Outliner.elements];for(let i of t){if(!i.constructor.animator)continue;let r=i.mesh;r.fix_rotation&&r.rotation.copy(r.fix_rotation),r.fix_position&&r.position.copy(r.fix_position),r.fix_scale?r.scale.copy(r.fix_scale):i.constructor.animator.prototype.channels&&i.constructor.animator.prototype.channels.scale&&(r.scale.x=r.scale.y=r.scale.z=1)}e||scene.updateMatrixWorld()},n),n=>{Animator.showDefaultPose=n.original});Ke(`${_e.name}:addLocatorAction`,{action:BarItems.add_locator,originalCondition:BarItems.add_locator.condition},n=>(n.action.condition=()=>Ue()?!0:!!n.originalCondition?.(),Toolbars.outliner.add(n.action,0),n),n=>{n.action.condition=n.originalCondition,Toolbars.outliner.remove(n.action)});function sG(n){let e,t,i,r,a;return{c(){e=V("div"),t=V("progress"),i=K(),r=V("img"),t.value=n[2],T(t,"max",n[3]),T(t,"class","svelte-3mo6sn"),$t(r.src,a=Yo)||T(r,"src",a),T(r,"width","64"),T(r,"class","svelte-3mo6sn"),T(e,"class","svelte-3mo6sn")},m(o,l){G(o,e,l),N(e,t),N(e,i),N(e,r)},p(o,[l]){l&4&&(t.value=o[2]),l&8&&T(t,"max",o[3])},i:re,o:re,d(o){o&&z(e)}}}s(sG,"create_fragment");function lG(n,e,t){let i,r=re,a=s(()=>(r(),r=ze(u,m=>t(2,i=m)),u),"$$subscribe_progress"),o,l=re,c=s(()=>(l(),l=ze(d,m=>t(3,o=m)),d),"$$subscribe_maxProgress");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l());let{progress:u}=e;a();let{maxProgress:d}=e;return c(),n.$$set=m=>{"progress"in m&&a(t(0,u=m.progress)),"maxProgress"in m&&c(t(1,d=m.maxProgress))},[u,d,i,o]}s(lG,"instance");var Ad=class extends je{constructor(e){super(),Ie(this,e,lG,sG,Ae,{progress:0,maxProgress:1})}};s(Ad,"BlueprintLoadingPopup");var Ey=Ad;(()=>{let n=Blockbench.addCSS("div.svelte-3mo6sn{display:flex;align-items:center;justify-content:center}img.svelte-3mo6sn{margin-left:16px}progress.svelte-3mo6sn{flex-grow:1}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();var Yl=new me(0),Ty=new me(1),Sd=null;function jd(){return Yl.set(0),Ty.set(1),Sd=new Pt({id:`${_e.name}:blueprintLoadingPopup`,title:w("dialog.blueprint_loading.title"),width:128,component:Ey,props:{progress:Yl,maxProgress:Ty},preventKeybinds:!0,buttons:[]}).show(),dialog}s(jd,"openBlueprintLoadingDialog");function Cy(){Sd&&Sd.close(0),Sd=null}s(Cy,"closeBlueprintLoadingDialog");Ke(`${_e.name}:blockbenchReadMod`,{original:Blockbench.read},n=>{async function e(t,i,r){for(let a of t)n.original([a],i,r),await new Promise(o=>{if(Project?.loadingPromises){jd();let l=[];for(let c of Project.loadingPromises)l.push(new Promise(u=>{c.finally(()=>{Yl.set(Yl.get()+1),u()})}));Promise.all(l).finally(()=>{Cy(),o()});return}o()})}return s(e,"asyncRead"),Blockbench.read=function(t,i,r){e(t,i,r).catch(console.error)},n},n=>{Blockbench.read=n.original});function cG(n){let e,t,i;return{c(){e=V("span"),t=V("img"),$t(t.src,i=Oi)||T(t,"src",i),T(t,"alt",""),T(t,"class","svelte-1wuqa5"),T(e,"class","icon_wrapper f_left"),T(e,"id","animated_java:icon")},m(r,a){G(r,e,a),N(e,t)},p:re,i:re,o:re,d(r){r&&z(e)}}}s(cG,"create_fragment");var Id=class extends je{constructor(e){super(),Ie(this,e,null,cG,Ae,{})}};s(Id,"Icon");var Ay=Id;(()=>{let n=Blockbench.addCSS("img.svelte-1wuqa5{border-radius:4px;width:24px;height:24px;margin-left:0.5px;margin-top:2px;box-shadow:1px 1px 1px #000000aa}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();Ke(`${_e.name}:formatIconMod`,void 0,()=>{Wi({elementSelector:()=>document.querySelector("[format=animated_java_blueprint]"),component:Ay,props:{},prepend:!0,postMount:()=>{document.querySelector("[format=animated_java_blueprint] span i")?.parentElement?.remove();let n=[...document.querySelectorAll("#animated_java\\:icon")];n.length>1&&n.slice(1).forEach(e=>e.remove())}})},()=>{document.querySelector("#animated_java\\:icon")?.remove()});function uG(n){let e,t,i,r;return{c(){e=V("div"),e.textContent=`${w("popup.loading.loading")}`,t=K(),i=V("img"),T(e,"class","text svelte-c9gbl3"),$t(i.src,r=Yo)||T(i,"src",r),T(i,"alt","Running Armor Stand"),T(i,"class","svelte-c9gbl3")},m(a,o){G(a,e,o),G(a,t,o),G(a,i,o)},p:re,d(a){a&&z(e),a&&z(t),a&&z(i)}}}s(uG,"create_else_block");function dG(n){let e;return{c(){e=V("div"),e.textContent=`${w("popup.loading.success")}`},m(t,i){G(t,e,i)},p:re,d(t){t&&z(e)}}}s(dG,"create_if_block_1");function fG(n){let e,t=w("popup.loading.offline").split(` -`).map(pG).join("")+"";return{c(){e=V("div"),$e(e,"display","flex"),$e(e,"flex-direction","column")},m(i,r){G(i,e,r),e.innerHTML=t},p:re,d(i){i&&z(e)}}}s(fG,"create_if_block");function mG(n){let e,t;function i(o,l){return o[2]?fG:o[3]?dG:uG}s(i,"select_block_type");let r=i(n,-1),a=r(n);return{c(){e=V("div"),a.c(),T(e,"class",t=vi(`floating ${n[2]?"red-border":"blue-border"}`)+" svelte-c9gbl3")},m(o,l){G(o,e,l),a.m(e,null)},p(o,[l]){r===(r=i(o,l))&&a?a.p(o,l):(a.d(1),a=r(o),a&&(a.c(),a.m(e,null))),l&4&&t!==(t=vi(`floating ${o[2]?"red-border":"blue-border"}`)+" svelte-c9gbl3")&&T(e,"class",t)},i:re,o:re,d(o){o&&z(e),a.d()}}}s(mG,"create_fragment");var pG=s(n=>"

      "+n+"

      ","func");function _G(n,e,t){let i,r=re,a=s(()=>(r(),r=ze(d,m=>t(2,i=m)),d),"$$subscribe_offline"),o,l=re,c=s(()=>(l(),l=ze(u,m=>t(3,o=m)),u),"$$subscribe_loaded");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l());let{loaded:u}=e;c();let{offline:d}=e;return a(),n.$$set=m=>{"loaded"in m&&c(t(0,u=m.loaded)),"offline"in m&&a(t(1,d=m.offline))},[u,d,i,o]}s(_G,"instance");var Od=class extends je{constructor(e){super(),Ie(this,e,_G,mG,Ae,{loaded:0,offline:1})}};s(Od,"AnimatedJavaLoadingPopup");var Sy=Od;(()=>{let n=Blockbench.addCSS(".floating.svelte-c9gbl3{position:absolute;bottom:2rem;right:2rem;background:var(--color-ui);padding:8px 16px;display:flex;align-items:center;flex-direction:row}.blue-border.svelte-c9gbl3{border:1px solid var(--color-accent)}.red-border.svelte-c9gbl3{border:1px solid var(--color-error)}.text.svelte-c9gbl3{margin-right:16px}img.svelte-c9gbl3{width:32px;height:32px;margin:-16px -10px}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();var jy=new me(!1),Iy=new me(!1),Or;async function Oy(){Or||(Or=await Wi({component:Sy,props:{loaded:jy,offline:Iy},elementSelector(){return document.body}}))}s(Oy,"showLoadingPopup");function Ny(){Or&&(jy.set(!0),setTimeout(()=>{Or&&(Or.$destroy(),Or=void 0)},2e3))}s(Ny,"hideLoadingPopup");function By(){Or&&(Iy.set(!0),setTimeout(()=>{Or&&(Or.$destroy(),Or=void 0)},1e4))}s(By,"showOfflineError");function gG(n){let e,t,i,r,a,o,l,c;return{c(){e=V("div"),t=V("div"),i=V("img"),a=K(),o=V("div"),o.innerHTML=`

      Welcome to Animated Java!

      + : math.clamp(math.mod(math.abs(t.progress), math.pi + t.hang) / math.pi, 0, 1);`};var w_=Animator.MolangParser.global_variables,PJ=["true","false","math.","query.","variable.","temp.","context.","this","loop()","return","break","continue"],VJ=["all_animations_finished","any_animation_finished","anim_time","life_time","yaw_speed","ground_speed","vertical_speed","property","has_property()","variant","mark_variant","skin_id","above_top_solid","actor_count","all()","all_tags","anger_level","any()","any_tag","approx_eq()","armor_color_slot","armor_material_slot","armor_texture_slot","average_frame_time","blocking","body_x_rotation","body_y_rotation","bone_aabb","bone_origin","bone_rotation","camera_distance_range_lerp","camera_rotation()","can_climb","can_damage_nearby_mobs","can_dash","can_fly","can_power_jump","can_swim","can_walk","cape_flap_amount","cardinal_facing","cardinal_facing_2d","cardinal_player_facing","combine_entities()","count","current_squish_value","dash_cooldown_progress","day","death_ticks","debug_output","delta_time","distance_from_camera","effect_emitter_count","effect_particle_count","equipment_count","equipped_item_all_tags","equipped_item_any_tag()","equipped_item_is_attachable","eye_target_x_rotation","eye_target_y_rotation","facing_target_to_range_attack","frame_alpha","get_actor_info_id","get_animation_frame","get_default_bone_pivot","get_locator_offset","get_root_locator_offset","had_component_group()","has_any_family()","has_armor_slot","has_biome_tag","has_block_property","has_cape","has_collision","has_dash_cooldown","has_gravity","has_owner","has_rider","has_target","head_roll_angle","head_x_rotation","head_y_rotation","health","heartbeat_interval","heartbeat_phase","heightmap","hurt_direction","hurt_time","in_range()","invulnerable_ticks","is_admiring","is_alive","is_angry","is_attached_to_entity","is_avoiding_block","is_avoiding_mobs","is_baby","is_breathing","is_bribed","is_carrying_block","is_casting","is_celebrating","is_celebrating_special","is_charged","is_charging","is_chested","is_critical","is_croaking","is_dancing","is_delayed_attacking","is_digging","is_eating","is_eating_mob","is_elder","is_emerging","is_emoting","is_enchanted","is_fire_immune","is_first_person","is_ghost","is_gliding","is_grazing","is_idling","is_ignited","is_illager_captain","is_in_contact_with_water","is_in_love","is_in_ui","is_in_water","is_in_water_or_rain","is_interested","is_invisible","is_item_equipped","is_item_name_any()","is_jump_goal_jumping","is_jumping","is_laying_down","is_laying_egg","is_leashed","is_levitating","is_lingering","is_moving","is_name_any()","is_on_fire","is_on_ground","is_on_screen","is_onfire","is_orphaned","is_owner_identifier_any()","is_persona_or_premium_skin","is_playing_dead","is_powered","is_pregnant","is_ram_attacking","is_resting","is_riding","is_roaring","is_rolling","is_saddled","is_scared","is_selected_item","is_shaking","is_shaking_wetness","is_sheared","is_shield_powered","is_silent","is_sitting","is_sleeping","is_sneaking","is_sneezing","is_sniffing","is_sonic_boom","is_spectator","is_sprinting","is_stackable","is_stalking","is_standing","is_stunned","is_swimming","is_tamed","is_transforming","is_using_item","is_wall_climbing","item_in_use_duration","item_is_charged","item_max_use_duration","item_remaining_use_duration","item_slot_to_bone_name()","key_frame_lerp_time","last_frame_time","last_hit_by_player","lie_amount","life_span","lod_index","log","main_hand_item_max_duration","main_hand_item_use_duration","max_durability","max_health","max_trade_tier","maximum_frame_time","minimum_frame_time","model_scale","modified_distance_moved","modified_move_speed","moon_brightness","moon_phase","movement_direction","noise","on_fire_time","out_of_control","player_level","position()","position_delta()","previous_squish_value","remaining_durability","roll_counter","rotation_to_camera()","shake_angle","shake_time","shield_blocking_bob","show_bottom","sit_amount","sleep_rotation","sneeze_counter","spellcolor","standing_scale","structural_integrity","surface_particle_color","surface_particle_texture_coordinate","surface_particle_texture_size","swell_amount","swelling_dir","swim_amount","tail_angle","target_x_rotation","target_y_rotation","texture_frame_index","time_of_day","time_since_last_vibration_detection","time_stamp","total_emitter_count","total_particle_count","trade_tier","unhappy_counter","walk_distance","wing_flap_position","wing_flap_speed"],zJ={"in_range()":"in_range( value, min, max )","all()":"in_range( value, values... )","any()":"in_range( value, values... )","approx_eq()":"in_range( value, values... )"},GJ=["item_slot","block_face","cardinal_block_face_placed_on","is_first_person","owning_entity","player_offhand_arm_height","other","count"],UJ=["attack_time","is_first_person"],JJ=["sin()","cos()","abs()","clamp()","pow()","sqrt()","random()","ceil()","round()","trunc()","floor()","mod()","min()","max()","exp()","ln()","lerp()","lerprotate()","pi","asin()","acos()","atan()","atan2()","die_roll()","die_roll_integer()","hermite_blend()","random_integer()"],HJ={"clamp()":"clamp( value, min, max )","pow()":"pow( base, exponent )","random()":"random( low, high )","mod()":"mod( value, denominator )","min()":"min( A, B )","max()":"max( A, B )","lerp()":"lerp( start, end, 0_to_1 )","lerprotate()":"lerprotate( start, end, 0_to_1 )","atan2()":"atan2( y, x )","die_roll()":"die_roll( num, low, high )","die_roll_integer()":"die_roll_integer( num, low, high )","random_integer()":"random_integer( low, high )","hermite_blend()":"hermite_blend( 0_to_1 )"},Pd={},x_={};for(let[n,e]of Object.entries(sw)){let t=n.match(/^(.+?)\((.*?)\)$/);if(!t)continue;let i=t[1],r=t[2].split(",").map(a=>a.trim());Pd[i]=(...a)=>{let o={};for(let l=0;l{if(!i.value)return;let r=i.value.match(/(v|variable)\.\w+/gi);r&&r.forEach(a=>{let o=a.substring(a.indexOf(".")+1);o!==n&&e.add(o)})}),e}s($J,"getProjectVariables");function Ss(n,e,t=!1,i=void 0){let r=n.filter(a=>a.startsWith(e)&&a.length!=e.length);return n.forEach(a=>{!r.includes(a)&&a.includes(e)&&a.length!=e.length&&r.push(a)}),t&&t.forEach(a=>r.remove(a)),r.map(a=>({text:a,label:i&&i[a],overlap:e.length}))}s(Ss,"filterAndSortList");$e(`${ke.name}:molangMod`,{originalAutocompleteMolang:Animator.autocompleteMolang,unsubscribeSelectAjProject:void 0,unsuscribeUnselectAjProject:void 0},n=>(n.unsubscribeSelectAjProject=re.SELECT_AJ_PROJECT.subscribe(()=>{Object.assign(w_,Pd),Animator.autocompleteMolang=function(e,t,i){let r=e.substring(0,t).split(/[^a-zA-Z_.]\.*/g).last();if(!r)return[];if(r=r.toLowerCase(),r.includes(".")){let[a,o]=r.split(".");if(a=="math")return Ss(JJ,o,void 0,HJ);if(a=="query"||a=="q")return Ss(VJ,o,i!=="controller"&&["all_animations_finished","any_animation_finished"],zJ);if(a=="temp"||a=="t"){let l=e.match(/([^a-z]|^)t(emp)?\.\w+/gi);if(l){let u=l.map(d=>d.split(".")[1]),c=u.filter((d,m)=>d!==o&&u.indexOf(d)===m);return Ss(c,o)}}if(a=="context"||a=="c")return Ss([...GJ],o);if(a=="variable"||a=="v"){let l=[...$J(o)];return l.safePush(...UJ),Ss(l,o)}}else{let a=PJ.slice(),o={};return i==="placeholders"&&(o={"toggle()":"toggle( name )","slider()":"slider( name, step?, min?, max? )","impulse()":"impulse( name, duration )"},a.push(...Object.keys(o))),Ss([...a,...Object.keys(x_)],r,void 0,{...o,...x_})}return[]}}),n.unsuscribeUnselectAjProject=re.UNSELECT_AJ_PROJECT.subscribe(()=>{for(let e of Object.keys(Pd))delete w_[e];Animator.autocompleteMolang=n.originalAutocompleteMolang}),n),n=>{for(let e of Object.keys(Pd))delete w_[e];Animator.autocompleteMolang=n.originalAutocompleteMolang,n.unsubscribeSelectAjProject?.(),n.unsuscribeUnselectAjProject?.()});$e(`${ke.name}:panelMod`,{panel:Interface.Panels.animations},n=>{let e=n.panel.inside_vue.$options.computed.files;return n.panel.inside_vue.$options.computed.files=function(){return Format.id===rt.id?{"":{animations:[...Blockbench.Animation.all,...Blockbench.AnimationController.all],name:"",hide_head:!0}}:e.call(this)},{...n,originalFilesFunction:e}},n=>{n.panel.inside_vue.$options.computed.files=n.originalFilesFunction});$e(`${mc.name}:projectSettingsActionOverride`,{action:BarItems.project_window,oldClick:BarItems.project_window.click},n=>(n.action.click=function(e){Format.id===rt.id?os():n.oldClick.call(this,e)},n),n=>{n.action.click=n.oldClick});$e(`${ke.name}:saveAllAnimationsActionMod`,{action:BarItems.save_all_animations},n=>{let e=n.action.condition;return n.action.condition=function(){return Format.id===rt.id?!1:e.call(this)},{...n,originalCondition:e}},n=>{n.action.condition=n.originalCondition});$e(`${ke.name}:save_project`,{action:BarItems.save_project,originalClick:BarItems.save_project.click},n=>(n.action.click=e=>{!Project||!Format||(Format===rt?Hc():n.originalClick.call(n.action,e))},n),n=>{n.action.click=n.originalClick});$e(`${ke.name}:save_project_as`,{action:BarItems.save_project_as,originalClick:BarItems.save_project_as.click},n=>(n.action.click=e=>{!Project||!Format||(Format===rt?Cn.export():n.originalClick.call(n.action,e))},n),n=>{n.action.click=n.originalClick});$e(`${ke.name}:variantPreviewCubeFace`,{originalGetTexture:CubeFace.prototype.getTexture},n=>(CubeFace.prototype.getTexture=function(){if(Ue()&&this.texture){let e=Ne.selected;if(e&&this.cube.parent instanceof Group&&!e.excludedNodes.find(t=>t.value===this.cube.parent.uuid)&&e.textureMap.has(this.texture))return this.lastVariant=e,e.textureMap.getMappedTexture(this.texture);if(Mode.selected.id===Modes.options.animate.id&&this.lastVariant&&!e?.isDefault)return this.lastVariant.textureMap.getMappedTexture(this.texture)}return this.lastVariant=void 0,n.originalGetTexture.call(this)},n),n=>{CubeFace.prototype.getTexture=n.originalGetTexture});$e(`${ke.name}:showDefaultPose`,{original:Animator.showDefaultPose},n=>(Animator.showDefaultPose=function(e){if(!Ue())return n.original(e);let t=[...Group.all,...Outliner.elements];for(let i of t){if(!i.constructor.animator)continue;let r=i.mesh;r.fix_rotation&&r.rotation.copy(r.fix_rotation),r.fix_position&&r.position.copy(r.fix_position),r.fix_scale?r.scale.copy(r.fix_scale):i.constructor.animator.prototype.channels&&i.constructor.animator.prototype.channels.scale&&(r.scale.x=r.scale.y=r.scale.z=1)}e||scene.updateMatrixWorld()},n),n=>{Animator.showDefaultPose=n.original});$e(`${ke.name}:addLocatorAction`,{action:BarItems.add_locator,originalCondition:BarItems.add_locator.condition},n=>(n.action.condition=()=>Ue()?!0:!!n.originalCondition?.(),Toolbars.outliner.add(n.action,0),n),n=>{n.action.condition=n.originalCondition,Toolbars.outliner.remove(n.action)});function qJ(n){let e,t,i,r,a;return{c(){e=P("div"),t=P("progress"),i=G(),r=P("img"),t.value=n[2],T(t,"max",n[3]),T(t,"class","svelte-3mo6sn"),Yt(r.src,a=qo)||T(r,"src",a),T(r,"width","64"),T(r,"class","svelte-3mo6sn"),T(e,"class","svelte-3mo6sn")},m(o,l){L(o,e,l),N(e,t),N(e,i),N(e,r)},p(o,[l]){l&4&&(t.value=o[2]),l&8&&T(t,"max",o[3])},i:ue,o:ue,d(o){o&&F(e)}}}s(qJ,"create_fragment");function KJ(n,e,t){let i,r=ue,a=s(()=>(r(),r=ze(c,m=>t(2,i=m)),c),"$$subscribe_progress"),o,l=ue,u=s(()=>(l(),l=ze(d,m=>t(3,o=m)),d),"$$subscribe_maxProgress");n.$$.on_destroy.push(()=>r()),n.$$.on_destroy.push(()=>l());let{progress:c}=e;a();let{maxProgress:d}=e;return u(),n.$$set=m=>{"progress"in m&&a(t(0,c=m.progress)),"maxProgress"in m&&u(t(1,d=m.maxProgress))},[c,d,i,o]}s(KJ,"instance");var Vd=class extends Be{constructor(e){super(),De(this,e,KJ,qJ,Oe,{progress:0,maxProgress:1})}};s(Vd,"BlueprintLoadingPopup");var lw=Vd;(()=>{let n=Blockbench.addCSS("div.svelte-3mo6sn{display:flex;align-items:center;justify-content:center}img.svelte-3mo6sn{margin-left:16px}progress.svelte-3mo6sn{flex-grow:1}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();var sc=new ge(0),cw=new ge(1),zd=null;function Gd(){return sc.set(0),cw.set(1),zd=new qt({id:`${ke.name}:blueprintLoadingPopup`,title:w("dialog.blueprint_loading.title"),width:128,component:lw,props:{progress:sc,maxProgress:cw},preventKeybinds:!0,buttons:[]}).show(),dialog}s(Gd,"openBlueprintLoadingDialog");function uw(){zd&&zd.close(0),zd=null}s(uw,"closeBlueprintLoadingDialog");$e(`${ke.name}:blockbenchReadMod`,{original:Blockbench.read},n=>{async function e(t,i,r){for(let a of t)n.original([a],i,r),await new Promise(o=>{if(Project?.loadingPromises){Gd();let l=[];for(let u of Project.loadingPromises)l.push(new Promise(c=>{u.finally(()=>{sc.set(sc.get()+1),c()})}));Promise.all(l).finally(()=>{uw(),o()});return}o()})}return s(e,"asyncRead"),Blockbench.read=function(t,i,r){e(t,i,r).catch(console.error)},n},n=>{Blockbench.read=n.original});function WJ(n){let e,t,i;return{c(){e=P("span"),t=P("img"),Yt(t.src,i=Li)||T(t,"src",i),T(t,"alt",""),T(t,"class","svelte-1wuqa5"),T(e,"class","icon_wrapper f_left"),T(e,"id","animated_java:icon")},m(r,a){L(r,e,a),N(e,t)},p:ue,i:ue,o:ue,d(r){r&&F(e)}}}s(WJ,"create_fragment");var Ud=class extends Be{constructor(e){super(),De(this,e,null,WJ,Oe,{})}};s(Ud,"Icon");var dw=Ud;(()=>{let n=Blockbench.addCSS("img.svelte-1wuqa5{border-radius:4px;width:24px;height:24px;margin-left:0.5px;margin-top:2px;box-shadow:1px 1px 1px #000000aa}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();$e(`${ke.name}:formatIconMod`,void 0,()=>{tr({elementSelector:()=>document.querySelector("[format=animated_java_blueprint]"),component:dw,props:{},prepend:!0,postMount:()=>{document.querySelector("[format=animated_java_blueprint] span i")?.parentElement?.remove();let n=[...document.querySelectorAll("#animated_java\\:icon")];n.length>1&&n.slice(1).forEach(e=>e.remove())}})},()=>{document.querySelector("#animated_java\\:icon")?.remove()});$e(`${ke.name}:boneInterpolationMod`,{orignalInterpolate:BoneAnimator.prototype.interpolate},n=>(BoneAnimator.prototype.interpolate=function(e,t,i){if(!Ue()||!t)return n.orignalInterpolate.call(this,e,t,i);let r=this.animation.time;try{Timeline.time=aa(this.animation.time,20);let a,o,l,u;if(Timeline.time{n.orignalInterpolate=BoneAnimator.prototype.interpolate});function ZJ(n){let e,t,i,r,a,o,l,u;return{c(){e=P("div"),t=P("div"),i=P("img"),a=G(),o=P("div"),o.innerHTML=`

      Welcome to Animated Java!

      A Blockbench plugin that makes complex animation a breeze in Minecraft: Java - Edition.

      `,l=K(),c=V("div"),c.innerHTML=`

      Not Sure Where to Start?

      + Edition.`,l=G(),u=P("div"),u.innerHTML=`

      Not Sure Where to Start?

      Check out our getting started page to learn how to use Animated Java.

      You can open our docs at any time via the Animated Java menu at the top of the screen.

      Need more help?

      Feel free to join our Discord server to ask - questions via our support channel.

      `,$t(i.src,r=Oi)||T(i,"src",r),T(i,"class","svelte-1h2xm0u"),T(o,"class","svelte-1h2xm0u"),T(t,"class","header-container svelte-1h2xm0u"),T(c,"class","another-container svelte-1h2xm0u"),T(e,"class","content-container svelte-1h2xm0u")},m(u,d){G(u,e,d),N(e,t),N(t,i),N(t,a),N(t,o),N(e,l),N(e,c)},p:re,i:re,o:re,d(u){u&&z(e)}}}s(gG,"create_fragment");var Nd=class extends je{constructor(e){super(),Ie(this,e,null,gG,Ae,{})}};s(Nd,"InstalledPopup");var Dy=Nd;(()=>{let n=Blockbench.addCSS(".another-container.svelte-1h2xm0u.svelte-1h2xm0u{display:flex;align-items:flex-start;flex-direction:column;padding:0 10%}.content-container.svelte-1h2xm0u.svelte-1h2xm0u{display:flex;flex-direction:column;align-items:center}p.svelte-1h2xm0u.svelte-1h2xm0u{text-align:left}h2.svelte-1h2xm0u.svelte-1h2xm0u{text-align:center;margin-top:2rem;font-weight:500;border-bottom:1px solid var(--color-accent);margin-bottom:1rem}.header-container.svelte-1h2xm0u.svelte-1h2xm0u{display:flex;align-items:center;margin-top:1rem;justify-content:center}.header-container.svelte-1h2xm0u div.svelte-1h2xm0u{display:flex;flex-direction:column;justify-content:center;margin-left:2rem}.header-container.svelte-1h2xm0u img.svelte-1h2xm0u{width:128px;border-radius:16px;box-shadow:4px 4px 8px -4px black}.header-container.svelte-1h2xm0u h1.svelte-1h2xm0u{margin:0px;border-bottom:1px solid var(--color-accent);margin-bottom:4px}.header-container.svelte-1h2xm0u h3.svelte-1h2xm0u{margin:0px;color:var(--color-subtle_text);font-size:medium;max-width:23rem}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),te.UNLOAD.subscribe(e,!0),te.UNINSTALL.subscribe(e,!0)})();function o_(){new Pt({id:`${_e.name}:installedPopup`,title:w("dialog.installed_popup.title"),width:700,component:Dy,props:{},preventKeybinds:!0,buttons:[w("dialog.installed_popup.close_button")]}).show()}s(o_,"openInstallPopup");Oy().then(async()=>{window.navigator.onLine||By(),te.NETWORK_CONNECTED.dispatch(),await Promise.all([new Promise(n=>te.MINECRAFT_ASSETS_LOADED.subscribe(()=>n())),new Promise(n=>te.MINECRAFT_REGISTRY_LOADED.subscribe(()=>n())),new Promise(n=>te.MINECRAFT_FONTS_LOADED.subscribe(()=>n())),new Promise(n=>te.BLOCKSTATE_REGISTRY_LOADED.subscribe(()=>n()))]).then(()=>{Ny()}).catch(n=>{console.error(n),Blockbench.showToastNotification({text:"Animated Java failed to load! Please restart Blockbench",color:"var(--color-error)"})})});globalThis.AnimatedJava={API:{compileDataPack:nd,compileResourcePack:ad,Variant:Se,MINECRAFT_REGISTRY:Rn,openExportProgressDialog:Fu,isResourcePackPath:_c,isDataPackPath:ig,blueprintSettingErrors:Rr,openUnexpectedErrorDialog:sa,TRANSPARENT_TEXTURE:zn,BLUEPRINT_FORMAT:et,BLUEPRINT_CODEC:xn,TextDisplay:Je,getLatestVersionClientDownloadUrl:hu,getVanillaFont:Ka,assetManager:bu,itemModelManager:Im,blockModelManager:Am,VanillaItemDisplay:gt,VanillaBlockDisplay:ft,debugBlocks:D0,debugBlockState:R0,BLOCKSTATE_REGISTRY:vo,exportProject:od,openBlueprintLoadingDialog:jd,openInstallPopup:o_}};te.EXTRACT_MODS.subscribe(()=>{globalThis.AnimatedJava=void 0});BBPlugin.register(_e.name,{title:_e.title,author:_e.author.name,description:_e.description,icon:"icon.svg",variant:"desktop",version:_e.version,min_version:_e.min_blockbench_version,tags:["Minecraft: Java Edition","Animation","Display Entities"],await_loading:!0,onload(){te.LOAD.dispatch()},onunload(){te.UNLOAD.dispatch()},oninstall(){te.INSTALL.dispatch(),o_()},onuninstall(){te.UNINSTALL.dispatch(),Blockbench.showMessageBox({title:"Animated Java has Been Uninstalled!",message:"In order to fully uninstall Animated Java, please restart Blockbench.",buttons:["OK"]})}});})(); + questions via our support channel.

      `,Yt(i.src,r=Li)||T(i,"src",r),T(i,"class","svelte-1h2xm0u"),T(o,"class","svelte-1h2xm0u"),T(t,"class","header-container svelte-1h2xm0u"),T(u,"class","another-container svelte-1h2xm0u"),T(e,"class","content-container svelte-1h2xm0u")},m(c,d){L(c,e,d),N(e,t),N(t,i),N(t,a),N(t,o),N(e,l),N(e,u)},p:ue,i:ue,o:ue,d(c){c&&F(e)}}}s(ZJ,"create_fragment");var Jd=class extends Be{constructor(e){super(),De(this,e,null,ZJ,Oe,{})}};s(Jd,"InstalledPopup");var fw=Jd;(()=>{let n=Blockbench.addCSS(".another-container.svelte-1h2xm0u.svelte-1h2xm0u{display:flex;align-items:flex-start;flex-direction:column;padding:0 10%}.content-container.svelte-1h2xm0u.svelte-1h2xm0u{display:flex;flex-direction:column;align-items:center}p.svelte-1h2xm0u.svelte-1h2xm0u{text-align:left}h2.svelte-1h2xm0u.svelte-1h2xm0u{text-align:center;margin-top:2rem;font-weight:500;border-bottom:1px solid var(--color-accent);margin-bottom:1rem}.header-container.svelte-1h2xm0u.svelte-1h2xm0u{display:flex;align-items:center;margin-top:1rem;justify-content:center}.header-container.svelte-1h2xm0u div.svelte-1h2xm0u{display:flex;flex-direction:column;justify-content:center;margin-left:2rem}.header-container.svelte-1h2xm0u img.svelte-1h2xm0u{width:128px;border-radius:16px;box-shadow:4px 4px 8px -4px black}.header-container.svelte-1h2xm0u h1.svelte-1h2xm0u{margin:0px;border-bottom:1px solid var(--color-accent);margin-bottom:4px}.header-container.svelte-1h2xm0u h3.svelte-1h2xm0u{margin:0px;color:var(--color-subtle_text);font-size:medium;max-width:23rem}");function e(){n?.delete()}s(e,"DELETE_SVELTE_CSS"),re.UNLOAD.subscribe(e,!0),re.UNINSTALL.subscribe(e,!0)})();function k_(){new qt({id:`${ke.name}:installedPopup`,title:w("dialog.installed_popup.title"),width:700,component:fw,props:{},preventKeybinds:!0,buttons:[w("dialog.installed_popup.close_button")]}).show()}s(k_,"openInstallPopup");qb().then(async()=>{window.navigator.onLine||Wb(),re.NETWORK_CONNECTED.dispatch(),await Promise.all([new Promise(n=>re.MINECRAFT_ASSETS_LOADED.subscribe(()=>n())),new Promise(n=>re.MINECRAFT_REGISTRY_LOADED.subscribe(()=>n())),new Promise(n=>re.MINECRAFT_FONTS_LOADED.subscribe(()=>n())),new Promise(n=>re.BLOCKSTATE_REGISTRY_LOADED.subscribe(()=>n()))]).then(()=>{Kb()}).catch(n=>{console.error(n),Blockbench.showToastNotification({text:"Animated Java failed to load! Please restart Blockbench",color:"var(--color-error)"})})});globalThis.AnimatedJava={API:{compileDataPack:_d,compileResourcePack:bd,Variant:Ne,MINECRAFT_REGISTRY:Vn,openExportProgressDialog:Zu,isResourcePackPath:So,isDataPackPath:yg,blueprintSettingErrors:Pr,openUnexpectedErrorDialog:fa,TRANSPARENT_TEXTURE:Hn,BLUEPRINT_FORMAT:rt,BLUEPRINT_CODEC:Cn,TextDisplay:qe,getLatestVersionClientDownloadUrl:lu,getVanillaFont:eo,assetManager:cu,itemModelManager:Km,blockModelManager:Hm,VanillaItemDisplay:ut,VanillaBlockDisplay:ht,debugBlocks:hv,debugBlockState:bv,BLOCKSTATE_REGISTRY:Co,exportProject:vd,openBlueprintLoadingDialog:Gd,openInstallPopup:k_}};re.EXTRACT_MODS.subscribe(()=>{globalThis.AnimatedJava=void 0});BBPlugin.register(ke.name,{title:ke.title,author:ke.author.name,description:ke.description,icon:"icon.svg",variant:"desktop",version:ke.version,min_version:ke.min_blockbench_version,tags:["Minecraft: Java Edition","Animation","Display Entities"],await_loading:!0,onload(){re.LOAD.dispatch()},onunload(){re.UNLOAD.dispatch()},oninstall(){re.INSTALL.dispatch(),k_()},onuninstall(){re.UNINSTALL.dispatch(),Blockbench.showMessageBox({title:"Animated Java has Been Uninstalled!",message:"In order to fully uninstall Animated Java, please restart Blockbench.",buttons:["OK"]})}});})(); /*! Bundled license information: pako/dist/pako.esm.mjs: From e6de06b6a10eae30c8f61dea8cbfa191a47d6445 Mon Sep 17 00:00:00 2001 From: JannisX11 Date: Sat, 24 Aug 2024 14:32:25 +0200 Subject: [PATCH 48/50] Fix plugins.json conflicts --- plugins.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins.json b/plugins.json index 123cfc3a..2f26c96d 100644 --- a/plugins.json +++ b/plugins.json @@ -359,7 +359,7 @@ "author": "Ewan Howell", "description": "A collection of utilities to assist with resource pack creation.", "tags": ["Minecraft: Java Edition", "Resource Packs", "Utilities"], - "version": "1.1.0", + "version": "1.0.0", "min_version": "4.10.0", "variant": "desktop", "website": "https://ewanhowell.com/plugins/resource-pack-utilities/", @@ -974,4 +974,4 @@ ], "min_version": "4.10.4" } -} \ No newline at end of file +} From b4bcb1ecc2ff3b16b416a533fbfd339c9531c769 Mon Sep 17 00:00:00 2001 From: JannisX11 Date: Sat, 24 Aug 2024 14:44:29 +0200 Subject: [PATCH 49/50] WASD Controls: Small fixes --- plugins.json | 2 +- plugins/wasd_controls.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins.json b/plugins.json index a2739c94..306e27e3 100644 --- a/plugins.json +++ b/plugins.json @@ -628,7 +628,7 @@ "wasd_controls": { "title": "WASD Controls", "icon": "sports_esports", - "author": "JannisX11", + "author": "JannisX11, caioraphael1", "description": "Adds a WASD controlled viewport navigation mode", "about": "The WASD mode can be enabled from the View menu.\nThe keys can be remapped in the keybindings menu.\nThe sensitivity can be changed in the settings under Preview, along with the movement plane.\nHold Control to move faster.", "version": "1.2.0", diff --git a/plugins/wasd_controls.js b/plugins/wasd_controls.js index 87ce65f7..8e5e7f05 100644 --- a/plugins/wasd_controls.js +++ b/plugins/wasd_controls.js @@ -6,7 +6,7 @@ let rightMouseDown = false; BBPlugin.register('wasd_controls', { title: 'WASD Controls', icon: 'sports_esports', - author: 'JannisX11', + author: 'JannisX11, caioraphael1', description: 'Adds a WASD controlled viewport navigation mode', about: 'The WASD mode can be enabled from the View menu.\nThe keys can be remapped in the keybindings menu.\nThe sensitivity can be changed in the settings under Preview, along with the movement plane.\nHold Control to move faster.', version: '1.2.0', @@ -54,7 +54,7 @@ BBPlugin.register('wasd_controls', { name: 'Move Faster', icon: 'expand_less', category: 'navigate', - keybind: new Keybind({key: 16, ctrl: null}) + keybind: new Keybind({key: 17, ctrl: null}) }); let navigate_slower = new KeybindItem('navigate_slower', { name: 'Move Slower', From 825844eb61de8ebda64a3d758b270f88618e6080 Mon Sep 17 00:00:00 2001 From: Ewan Howell <48070995+ewanhowell5195@users.noreply.github.com> Date: Sat, 24 Aug 2024 14:12:29 +0100 Subject: [PATCH 50/50] fix missing texture triggering connection error state --- plugins.json | 2 +- .../cem_template_loader.js | 19 ++++++++++++++----- plugins/cem_template_loader/changelog.json | 13 +++++++++++++ 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/plugins.json b/plugins.json index 416f9fec..abcba2ba 100644 --- a/plugins.json +++ b/plugins.json @@ -207,7 +207,7 @@ "author": "Ewan Howell", "description": "Load template Java Edition entity models for use with OptiFine CEM. Also includes an animation editor, so that you can create custom entity animations.", "tags": ["Minecraft: Java Edition", "OptiFine", "Templates"], - "version": "8.2.0", + "version": "8.2.1", "min_version": "4.10.0", "variant": "both", "creation_date": "2020-02-02", diff --git a/plugins/cem_template_loader/cem_template_loader.js b/plugins/cem_template_loader/cem_template_loader.js index 63293f59..d0a0e3f5 100644 --- a/plugins/cem_template_loader/cem_template_loader.js +++ b/plugins/cem_template_loader/cem_template_loader.js @@ -41,7 +41,7 @@ author: "Ewan Howell", description: description + " Also includes an animation editor, so that you can create custom entity animations.", tags: ["Minecraft: Java Edition", "OptiFine", "Templates"], - version: "8.2.0", + version: "8.2.1", min_version: "4.10.0", variant: "both", creation_date: "2020-02-02", @@ -65,17 +65,26 @@ async function fetchData(path, fallback) { try { const r = await fetch(`${root}/${path}`) - if (r.status !== 200 || r.headers.get("Content-Type")?.startsWith("text/html")) throw new Error - if (r.headers.get("Content-Type")?.startsWith("text/plain") || r.headers.get("Content-Type")?.startsWith("application/json")) return r.json() + if (!r.ok) throw new Error + if (r.headers.get("Content-Type")?.startsWith("text/html")) { + return + } + if (r.headers.get("Content-Type")?.startsWith("text/plain") || r.headers.get("Content-Type")?.startsWith("application/json")) { + return r.json() + } return r } catch { for (let x = connection.rootIndex + 1; x < connection.roots.length; x++) { connection.rootIndex = x try { const r = await fetch(`${connection.roots[x]}/${path}`) - if (r.status !== 200) throw new Error + if (r.status !== 200) { + throw new Error + } root = connection.roots[x] - if (r.headers.get("Content-Type")?.startsWith("text/plain") || r.headers.get("Content-Type")?.startsWith("application/json")) return r.json() + if (r.headers.get("Content-Type")?.startsWith("text/plain") || r.headers.get("Content-Type")?.startsWith("application/json")) { + return r.json() + } return r } catch {} } diff --git a/plugins/cem_template_loader/changelog.json b/plugins/cem_template_loader/changelog.json index ad0d979e..bc0555d2 100644 --- a/plugins/cem_template_loader/changelog.json +++ b/plugins/cem_template_loader/changelog.json @@ -900,5 +900,18 @@ ] } ] + }, + "8.2.1": { + "title": "8.2.1", + "date": "2024-08-25", + "author": "Ewan Howell", + "categories": [ + { + "title": "Bug Fixes", + "list": [ + "Loading a template model that is missing its vanilla texture will no longer trigger the connction error state" + ] + } + ] } } \ No newline at end of file