diff --git a/.gitattributes b/.gitattributes index c50f8044cff7e2e6b923e19286f3b95f8631cf41..a2ab844d346279757b8e486aa379dd0d90cbede9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -38,3 +38,8 @@ public/fonts/JetBrains/JetBrainsMono-VariableFont_wght.ttf filter=lfs diff=lfs m public/fonts/Söhne/Söhne-Buch.otf filter=lfs diff=lfs merge=lfs -text public/fonts/Söhne/Söhne-Kräftig.otf filter=lfs diff=lfs merge=lfs -text public/fonts/Söhne/Söhne-Leicht.otf filter=lfs diff=lfs merge=lfs -text +dist/fonts/JetBrains/JetBrainsMono-Italic-VariableFont_wght.ttf filter=lfs diff=lfs merge=lfs -text +dist/fonts/JetBrains/JetBrainsMono-VariableFont_wght.ttf filter=lfs diff=lfs merge=lfs -text +dist/fonts/Söhne/Söhne-Buch.otf filter=lfs diff=lfs merge=lfs -text +dist/fonts/Söhne/Söhne-Kräftig.otf filter=lfs diff=lfs merge=lfs -text +dist/fonts/Söhne/Söhne-Leicht.otf filter=lfs diff=lfs merge=lfs -text diff --git a/README.md b/README.md index b2a2fc85bfd26393738b4c1a841b44ebe0787795..ad5e178fec06e9d5d830b7dbb7228d07ca2b4935 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ colorTo: blue sdk: static pinned: false short_description: Run LFM2.5-1.2B-Thinking directly in your browser on WebGPU -app_build_command: npm run build app_file: dist/index.html models: - LiquidAI/LFM2.5-1.2B-Thinking diff --git a/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 b/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..0acaaff03d4bb7606de02a827aeee338e5a86910 Binary files /dev/null and b/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 differ diff --git a/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff b/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff new file mode 100644 index 0000000000000000000000000000000000000000..b804d7b33a3fa5b2587d2d1d55006aed678e3eb2 Binary files /dev/null and b/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff differ diff --git a/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf b/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf new file mode 100644 index 0000000000000000000000000000000000000000..c6f9a5e7c03f9e64e9c7b4773a8e37ade8eaf406 Binary files /dev/null and b/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf differ diff --git a/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf b/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf new file mode 100644 index 0000000000000000000000000000000000000000..9ff4a5e04421e5107f74c28e27354e0b2a4e7ef8 Binary files /dev/null and b/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf differ diff --git a/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff b/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff new file mode 100644 index 0000000000000000000000000000000000000000..9759710d1d3e16eb10012d56babb73f2479ba9f0 Binary files /dev/null and b/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff differ diff --git a/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 b/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..f390922eceffe1f6dfb81a3dc086a92d98171b02 Binary files /dev/null and b/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 differ diff --git a/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff b/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff new file mode 100644 index 0000000000000000000000000000000000000000..9bdd534fd2beb9b878f0219da9d63ffba56677e2 Binary files /dev/null and b/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff differ diff --git a/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 b/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..75344a1f98e37e2c631e178065854c3a81fb842f Binary files /dev/null and b/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 differ diff --git a/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf b/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf new file mode 100644 index 0000000000000000000000000000000000000000..f522294ff0f3f8c52dfdaef7ebfaa06ebfcfaabf Binary files /dev/null and b/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf differ diff --git a/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf b/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf new file mode 100644 index 0000000000000000000000000000000000000000..4e98259c3b54076d684bf3459baeaeae8dbce97a Binary files /dev/null and b/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf differ diff --git a/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff b/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff new file mode 100644 index 0000000000000000000000000000000000000000..e7730f66275c87c28f26530d89264cffecf90be0 Binary files /dev/null and b/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff differ diff --git a/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 b/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..395f28beac23c7b0f7f3a1e714bd8dac253dd3bc Binary files /dev/null and b/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 differ diff --git a/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf b/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf new file mode 100644 index 0000000000000000000000000000000000000000..b8461b275fae76efd0d21fd0f1aaa696a5b10f9a Binary files /dev/null and b/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf differ diff --git a/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 b/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..735f6948d63c8cc7f8233735bb9c8d843c83d804 Binary files /dev/null and b/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 differ diff --git a/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff b/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff new file mode 100644 index 0000000000000000000000000000000000000000..acab069f90b6fe6301a004e6f8beaf6a0db48bce Binary files /dev/null and b/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff differ diff --git a/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 b/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..ab2ad21da6fbe6c171bb869240954d0ead8f68fd Binary files /dev/null and b/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 differ diff --git a/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff b/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff new file mode 100644 index 0000000000000000000000000000000000000000..f38136ac1cc2dcdc9d9b10b8521487468b1f768c Binary files /dev/null and b/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff differ diff --git a/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf b/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf new file mode 100644 index 0000000000000000000000000000000000000000..4060e627dc341c1854260cbc3f7386e222a4d297 Binary files /dev/null and b/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf differ diff --git a/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 b/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..5931794de4a2a485fa70099bf2659b145976d043 Binary files /dev/null and b/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 differ diff --git a/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf b/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf new file mode 100644 index 0000000000000000000000000000000000000000..dc007977ee709a236d9e82719cf7d4e5577a81b9 Binary files /dev/null and b/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf differ diff --git a/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff b/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff new file mode 100644 index 0000000000000000000000000000000000000000..67807b0bd4f867853271f5917fb3adf377f93f53 Binary files /dev/null and b/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff differ diff --git a/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf b/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf new file mode 100644 index 0000000000000000000000000000000000000000..0e9b0f354ad460202bba554359f5adcc8da666b7 Binary files /dev/null and b/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf differ diff --git a/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff b/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff new file mode 100644 index 0000000000000000000000000000000000000000..6f43b594b6c1d863a0e3f93b001f8dd503316464 Binary files /dev/null and b/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff differ diff --git a/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 b/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..b50920e138807f385d0b0359f4f0f09891f18406 Binary files /dev/null and b/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 differ diff --git a/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 b/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..eb24a7ba282b03d830fa6c63ee897d92a5188736 Binary files /dev/null and b/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 differ diff --git a/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff b/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff new file mode 100644 index 0000000000000000000000000000000000000000..21f5812968c42392a3eaea9b0c6320870b6b8b38 Binary files /dev/null and b/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff differ diff --git a/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf b/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf new file mode 100644 index 0000000000000000000000000000000000000000..dd45e1ed2e18b32c516d9b481ebed3cb8bffa711 Binary files /dev/null and b/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf differ diff --git a/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf b/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf new file mode 100644 index 0000000000000000000000000000000000000000..728ce7a1e2cb689df32c3a6c26e1bd072dcf2acb Binary files /dev/null and b/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf differ diff --git a/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 b/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..29657023adc09956249f6295746c8ce4469b50d3 Binary files /dev/null and b/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 differ diff --git a/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff b/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff new file mode 100644 index 0000000000000000000000000000000000000000..0ae390d74c9f665cf8b1e5ea5483395da7513444 Binary files /dev/null and b/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff differ diff --git a/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff b/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff new file mode 100644 index 0000000000000000000000000000000000000000..eb5159d4c1ca83fb92b3190223698427df0e010c Binary files /dev/null and b/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff differ diff --git a/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf b/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf new file mode 100644 index 0000000000000000000000000000000000000000..70d559b4e937ca1b805eb39f544cbebe3c58ca6f Binary files /dev/null and b/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf differ diff --git a/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 b/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..215c143fd7805a5c2b222bd7892a1a2b09610020 Binary files /dev/null and b/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 differ diff --git a/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf b/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf new file mode 100644 index 0000000000000000000000000000000000000000..2f65a8a3a6d3628d11ea9c26c9077cef672fe427 Binary files /dev/null and b/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf differ diff --git a/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 b/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..cfaa3bda59246b49e94298478d6de3b3208066c8 Binary files /dev/null and b/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 differ diff --git a/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff b/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff new file mode 100644 index 0000000000000000000000000000000000000000..8d47c02d9408d34b2a9d566c0fe0d42bf82fb735 Binary files /dev/null and b/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff differ diff --git a/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 b/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..349c06dc609f896392fd5bc8b364d3bc3efc9330 Binary files /dev/null and b/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 differ diff --git a/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff b/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff new file mode 100644 index 0000000000000000000000000000000000000000..7e02df963621a5e26d53d510f0b4992eebde1c60 Binary files /dev/null and b/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff differ diff --git a/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf b/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf new file mode 100644 index 0000000000000000000000000000000000000000..d5850df98ec19de2eee9ff922ef59586efe471d0 Binary files /dev/null and b/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf differ diff --git a/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf b/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf new file mode 100644 index 0000000000000000000000000000000000000000..537279f6bd2184ed32f1a5168850609147d58ee6 Binary files /dev/null and b/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf differ diff --git a/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff b/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff new file mode 100644 index 0000000000000000000000000000000000000000..31b84829b42edae20d0148eeec0d922dad2108c4 Binary files /dev/null and b/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff differ diff --git a/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 b/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..a90eea85f6f7bded69ff5d40114447a6d8b48cfe Binary files /dev/null and b/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 differ diff --git a/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf b/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf new file mode 100644 index 0000000000000000000000000000000000000000..fd679bf374af72f2a183b97b40c9c7e9e51fbe5e Binary files /dev/null and b/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf differ diff --git a/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 b/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..b3048fc115681ee6c1bc86b0aa158cfbbf59daa3 Binary files /dev/null and b/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 differ diff --git a/dist/assets/KaTeX_Script-Regular-D5yQViql.woff b/dist/assets/KaTeX_Script-Regular-D5yQViql.woff new file mode 100644 index 0000000000000000000000000000000000000000..0e7da821eee0dd05a0a6f0b16c2c1345dc573a84 Binary files /dev/null and b/dist/assets/KaTeX_Script-Regular-D5yQViql.woff differ diff --git a/dist/assets/KaTeX_Size1-Regular-C195tn64.woff b/dist/assets/KaTeX_Size1-Regular-C195tn64.woff new file mode 100644 index 0000000000000000000000000000000000000000..7f292d91184f257054ef77cc1cd3443db757c9cc Binary files /dev/null and b/dist/assets/KaTeX_Size1-Regular-C195tn64.woff differ diff --git a/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf b/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf new file mode 100644 index 0000000000000000000000000000000000000000..871fd7d19d8658f64d8696ed9cdfc82c821ed76d Binary files /dev/null and b/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf differ diff --git a/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 b/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..c5a8462fbfe2c39a7c1857b9e296e62500a8a8a5 Binary files /dev/null and b/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 differ diff --git a/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf b/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf new file mode 100644 index 0000000000000000000000000000000000000000..7a212caf91c0007e826fee2d622bf48acbd30dde Binary files /dev/null and b/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf differ diff --git a/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 b/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..e1bccfe2403a4ed770c1697ae7c15b9e1cd9bc4e Binary files /dev/null and b/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 differ diff --git a/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff b/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff new file mode 100644 index 0000000000000000000000000000000000000000..d241d9be2d317f7b39b401d96c8b18836acea0fa Binary files /dev/null and b/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff differ diff --git a/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff b/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff new file mode 100644 index 0000000000000000000000000000000000000000..e6e9b658dcf1cd031ac82b6b8f312444c55d4fc0 Binary files /dev/null and b/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff differ diff --git a/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf b/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf new file mode 100644 index 0000000000000000000000000000000000000000..00bff3495fa9d2f98c1c9ce436add6a1bcfe87fb Binary files /dev/null and b/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf differ diff --git a/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff b/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff new file mode 100644 index 0000000000000000000000000000000000000000..e1ec5457664f438ce5a1cc6dd8409bf60ca7804b Binary files /dev/null and b/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff differ diff --git a/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf b/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf new file mode 100644 index 0000000000000000000000000000000000000000..74f08921f00f71f413ca42c9d1c90202e672ef38 Binary files /dev/null and b/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf differ diff --git a/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 b/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..680c13085076a2f6c5a7e695935ec3f21cddb65f Binary files /dev/null and b/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 differ diff --git a/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff b/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff new file mode 100644 index 0000000000000000000000000000000000000000..2432419f28936aff53ddfa2a732d027e6a6648fd Binary files /dev/null and b/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff differ diff --git a/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 b/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..771f1af705f5cef5f578b3a1e7d8eff66f9b76b0 Binary files /dev/null and b/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 differ diff --git a/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf b/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf new file mode 100644 index 0000000000000000000000000000000000000000..c83252c5714c71a3e0ec62195884167339a0129b Binary files /dev/null and b/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf differ diff --git a/dist/assets/code-block-OCS4YCEC-66Q0YcqX.js b/dist/assets/code-block-OCS4YCEC-66Q0YcqX.js new file mode 100644 index 0000000000000000000000000000000000000000..46f9a4920ae9efca87161e0ce85afc6103f0695b --- /dev/null +++ b/dist/assets/code-block-OCS4YCEC-66Q0YcqX.js @@ -0,0 +1,2 @@ +import{i as e,n as t,o as n,r,s as i,t as a}from"./index-BfkQJ3LR.js";var o=i(),s=n(),c=e(`block`,`before:content-[counter(line)]`,`before:inline-block`,`before:[counter-increment:line]`,`before:w-6`,`before:mr-4`,`before:text-[13px]`,`before:text-right`,`before:text-muted-foreground/50`,`before:font-mono`,`before:select-none`),l=e=>{let t={};for(let n of e.split(`;`)){let e=n.indexOf(`:`);if(e>0){let r=n.slice(0,e).trim(),i=n.slice(e+1).trim();r&&i&&(t[r]=i)}}return t},u=(0,o.memo)(({children:t,result:n,language:r,className:i,...a})=>{let u=(0,o.useMemo)(()=>{let e={};return n.bg&&(e[`--sdm-bg`]=n.bg),n.fg&&(e[`--sdm-fg`]=n.fg),n.rootStyle&&Object.assign(e,l(n.rootStyle)),e},[n.bg,n.fg,n.rootStyle]);return(0,s.jsx)(`pre`,{className:e(i,`p-4 text-sm`,`bg-[var(--sdm-bg,transparent)]`,`dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,transparent))]`),"data-language":r,"data-streamdown":`code-block-body`,style:u,...a,children:(0,s.jsx)(`code`,{className:`[counter-increment:line_0] [counter-reset:line]`,children:n.tokens.map((t,n)=>(0,s.jsx)(`span`,{className:c,children:t.map((t,n)=>(0,s.jsx)(`span`,{className:e(`text-[var(--sdm-c,inherit)]`,`dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]`,t.bgColor&&`bg-[var(--sdm-tbg)]`,t.bgColor&&`dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]`),style:{...t.color?{"--sdm-c":t.color}:{},...t.bgColor?{"--sdm-tbg":t.bgColor}:{},...t.htmlStyle},...t.htmlAttrs,children:t.content},n))},n))})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className),d=({className:t,language:n,style:r,...i})=>(0,s.jsx)(`div`,{className:e(`my-4 w-full overflow-hidden rounded-xl border border-border`,t),"data-language":n,"data-streamdown":`code-block`,style:{contentVisibility:`auto`,containIntrinsicSize:`auto 200px`,...r},...i}),f=({language:e,children:t})=>(0,s.jsxs)(`div`,{className:`flex items-center justify-between bg-muted/80 p-3 text-muted-foreground text-xs`,"data-language":e,"data-streamdown":`code-block-header`,children:[(0,s.jsx)(`span`,{className:`ml-1 font-mono lowercase`,children:e}),(0,s.jsx)(`div`,{className:`flex items-center gap-2`,children:t})]}),p=/\n+$/,m=({code:e,language:n,className:i,children:c,...l})=>{let{shikiTheme:m}=(0,o.useContext)(t),h=r(),g=(0,o.useMemo)(()=>e.replace(p,``),[e]),_=(0,o.useMemo)(()=>({bg:`transparent`,fg:`inherit`,tokens:g.split(` +`).map(e=>[{content:e,color:`inherit`,bgColor:`transparent`,htmlStyle:{},offset:0}])}),[g]),[v,y]=(0,o.useState)(_);return(0,o.useEffect)(()=>{if(!h){y(_);return}let e=h.highlight({code:g,language:n,themes:m},e=>{y(e)});if(e){y(e);return}y(_)},[g,n,m,h,_]),(0,s.jsx)(a.Provider,{value:{code:e},children:(0,s.jsxs)(d,{language:n,children:[(0,s.jsx)(f,{language:n,children:c}),(0,s.jsx)(u,{className:i,language:n,result:v,...l})]})})};export{m as CodeBlock}; \ No newline at end of file diff --git a/dist/assets/index-BfkQJ3LR.js b/dist/assets/index-BfkQJ3LR.js new file mode 100644 index 0000000000000000000000000000000000000000..a8cbb18ec9f220fe17dc4c4be8eded13b53a4fe5 --- /dev/null +++ b/dist/assets/index-BfkQJ3LR.js @@ -0,0 +1,4374 @@ +var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),u=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var d=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function ee(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function te(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ne(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ne(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ee(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),ne(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u{t.exports=d()})),p=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&ee(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-Tt&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ee(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function ee(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ee(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),m=o(((e,t)=>{t.exports=p()})),h=o((e=>{var t=f();function n(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=o((e=>{var t=m(),n=f(),r=g();function i(e){var t=`https://react.dev/errors/`+e;if(1se||(e.current=oe[se],oe[se]=null,se--)}function ue(e,t){se++,oe[se]=e.current,e.current=t}var de=ce(null),fe=ce(null),pe=ce(null),me=ce(null);function he(e,t){switch(ue(pe,t),ue(fe,e),ue(de,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?rf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=rf(t),e=af(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}le(de),ue(de,e)}function ge(){le(de),le(fe),le(pe)}function _e(e){e.memoizedState!==null&&ue(me,e);var t=de.current,n=af(t,e.type);t!==n&&(ue(fe,e),ue(de,n))}function ve(e){fe.current===e&&(le(de),le(fe)),me.current===e&&(le(me),up._currentValue=ae)}var ye,be;function xe(e){if(ye===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ye=t&&t[1]||``,be=-1)`:-1i||c[r]!==l[i]){var u=` +`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Se=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?xe(n):``}function we(e,t){switch(e.tag){case 26:case 27:case 5:return xe(e.type);case 16:return xe(`Lazy`);case 13:return e.child!==t&&t!==null?xe(`Suspense Fallback`):xe(`Suspense`);case 19:return xe(`SuspenseList`);case 0:case 15:return Ce(e.type,!1);case 11:return Ce(e.type.render,!1);case 1:return Ce(e.type,!0);case 31:return xe(`Activity`);default:return``}}function Te(e){try{var t=``,n=null;do t+=we(e,n),n=e,e=e.return;while(e);return t}catch(e){return` +Error generating stack: `+e.message+` +`+e.stack}}var Ee=Object.prototype.hasOwnProperty,De=t.unstable_scheduleCallback,Oe=t.unstable_cancelCallback,ke=t.unstable_shouldYield,Ae=t.unstable_requestPaint,je=t.unstable_now,Me=t.unstable_getCurrentPriorityLevel,Ne=t.unstable_ImmediatePriority,Pe=t.unstable_UserBlockingPriority,Fe=t.unstable_NormalPriority,Ie=t.unstable_LowPriority,Le=t.unstable_IdlePriority,Re=t.log,ze=t.unstable_setDisableYieldValue,Be=null,Ve=null;function He(e){if(typeof Re==`function`&&ze(e),Ve&&typeof Ve.setStrictMode==`function`)try{Ve.setStrictMode(Be,e)}catch{}}var Ue=Math.clz32?Math.clz32:Ke,We=Math.log,Ge=Math.LN2;function Ke(e){return e>>>=0,e===0?32:31-(We(e)/Ge|0)|0}var qe=256,Je=262144,Ye=4194304;function Xe(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ze(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Xe(n))):i=Xe(o):i=Xe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Xe(n))):i=Xe(o)):i=Xe(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Qe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function $e(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function et(){var e=Ye;return Ye<<=1,!(Ye&62914560)&&(Ye=4194304),e}function tt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function N(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function nt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),mn=!1;if(P)try{var hn={};Object.defineProperty(hn,`passive`,{get:function(){mn=!0}}),window.addEventListener(`test`,hn,hn),window.removeEventListener(`test`,hn,hn)}catch{mn=!1}var gn=null,_n=null,vn=null;function yn(){if(vn)return vn;var e,t=_n,n=t.length,r,i=`value`in gn?gn.value:gn.textContent,a=i.length;for(e=0;e=Zn),er=` `,tr=!1;function nr(e,t){switch(e){case`keyup`:return Yn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function rr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var ir=!1;function ar(e,t){switch(e){case`compositionend`:return rr(t);case`keypress`:return t.which===32?(tr=!0,er):null;case`textInput`:return e=t.data,e===er&&tr?null:e;default:return null}}function or(e,t){if(ir)return e===`compositionend`||!Xn&&nr(e,t)?(e=yn(),vn=_n=gn=null,ir=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Or(n)}}function Ar(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ar(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Vt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Vt(e.document)}return t}function Mr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Nr=P&&`documentMode`in document&&11>=document.documentMode,Pr=null,Fr=null,Ir=null,Lr=!1;function Rr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Lr||Pr==null||Pr!==Vt(r)||(r=Pr,`selectionStart`in r&&Mr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ir&&Dr(Ir,r)||(Ir=r,r=Ud(Fr,`onSelect`),0>=o,i-=o,Ai=1<<32-Ue(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),zi&&Mi(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),zi&&Mi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return zi&&Mi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),zi&&Mi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Na(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ba(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=_i(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=gi(o.type,o.key,o.props,null,e.mode,c),Ba(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=bi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Na(o),b(e,r,o,c)}if(re(o))return h(e,r,o,c);if(te(o)){if(l=te(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,za(o),c);if(o.$$typeof===C)return b(e,r,sa(e,o),c);Va(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=vi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ra=0;var i=b(e,t,n,r);return La=null,i}catch(t){if(t===Da||t===ka)throw t;var a=fi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ua=Ha(!0),Wa=Ha(!1),Ga=!1;function Ka(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ja(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ya(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Yl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=li(e),ci(e,null,n),t}return ai(e,r,t,n),li(e)}function Xa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,it(e,n)}}function Za(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Qa=!1;function $a(){if(Qa){var e=va;if(e!==null)throw e}}function eo(e,t,n,r){Qa=!1;var i=e.updateQueue;Ga=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,m=f!==s.lane;if(m?(Ql&f)===f:(r&f)===f){f!==0&&f===_a&&(Qa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=p({},d,f);break a;case 2:Ga=!0}}f=s.callback,f!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[f]:m.push(f))}else m={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),ou|=o,e.lanes=o,e.memoizedState=d}}function to(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function no(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=M.T,s={};M.T=s,Us(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Hs(e,t,xa(c,r),Ou(e)):Hs(e,t,r,Ou(e))}catch(n){Hs(e,t,{then:function(){},status:`rejected`,reason:n},Ou())}finally{ie.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function Ms(){}function Ns(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ps(e).queue;js(e,a,t,ae,n===null?Ms:function(){return Fs(e),n(r)})}function Ps(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wo,lastRenderedState:ae},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Fs(e){var t=Ps(e);t.next===null&&(t=e.alternate.memoizedState),Hs(e,t.next.queue,{},Ou())}function Is(){return oa(up)}function Ls(){return zo().memoizedState}function Rs(){return zo().memoizedState}function zs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ou();e=Ja(n);var r=Ya(t,e,n);r!==null&&(Au(r,t,n),Xa(r,t,n)),t={cache:pa()},e.payload=t;return}t=t.return}}function Bs(e,t,n){var r=Ou();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ws(e)?Gs(t,n):(n=oi(e,t,n,r),n!==null&&(Au(n,e,r),Ks(n,t,r)))}function Vs(e,t,n){Hs(e,t,n,Ou())}function Hs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ws(e))Gs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Er(s,o))return ai(e,t,i,0),Xl===null&&ii(),!1}catch{}if(n=oi(e,t,i,r),n!==null)return Au(n,e,r),Ks(n,t,r),!0}return!1}function Us(e,t,n,r){if(r={lane:2,revertLane:Dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ws(e)){if(t)throw Error(i(479))}else t=oi(e,n,r,2),t!==null&&Au(t,e,2)}function Ws(e){var t=e.alternate;return e===yo||t!==null&&t===yo}function Gs(e,t){Co=So=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ks(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,it(e,n)}}var qs={readContext:oa,use:Ho,useCallback:ko,useContext:ko,useEffect:ko,useImperativeHandle:ko,useLayoutEffect:ko,useInsertionEffect:ko,useMemo:ko,useReducer:ko,useRef:ko,useState:ko,useDebugValue:ko,useDeferredValue:ko,useTransition:ko,useSyncExternalStore:ko,useId:ko,useHostTransitionStatus:ko,useFormState:ko,useActionState:ko,useOptimistic:ko,useMemoCache:ko,useCacheRefresh:ko};qs.useEffectEvent=ko;var Js={readContext:oa,use:Ho,useCallback:function(e,t){return Ro().memoizedState=[e,t===void 0?null:t],e},useContext:oa,useEffect:vs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),gs(4194308,4,ws.bind(null,t,e),n)},useLayoutEffect:function(e,t){return gs(4194308,4,e,t)},useInsertionEffect:function(e,t){gs(4,2,e,t)},useMemo:function(e,t){var n=Ro();t=t===void 0?null:t;var r=e();if(wo){He(!0);try{e()}finally{He(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Ro();if(n!==void 0){var i=n(t);if(wo){He(!0);try{n(t)}finally{He(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Bs.bind(null,yo,e),[r.memoizedState,e]},useRef:function(e){var t=Ro();return e={current:e},t.memoizedState=e},useState:function(e){e=es(e);var t=e.queue,n=Vs.bind(null,yo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Es,useDeferredValue:function(e,t){return ks(Ro(),e,t)},useTransition:function(){var e=es(!1);return e=js.bind(null,yo,e.queue,!0,!1),Ro().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=yo,a=Ro();if(zi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Xl===null)throw Error(i(349));Ql&127||Yo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,vs(Zo.bind(null,r,o,e),[e]),r.flags|=2048,ms(9,{destroy:void 0},Xo.bind(null,r,o,n,t),null),n},useId:function(){var e=Ro(),t=Xl.identifierPrefix;if(zi){var n=ji,r=Ai;n=(r&~(1<<32-Ue(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=To++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[dt]=t,o[ft]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Zd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Hc(t)}}return qc(t),Uc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Hc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=pe.current,Ki(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Li,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[dt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||I(e.nodeValue,n)),e||Ui(t,!0)}else e=nf(e).createTextNode(r),e[dt]=t,t.stateNode=e}return qc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ki(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[dt]=t}else qi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;qc(t),e=!1}else n=Ji(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ho(t),t):(ho(t),null);if(t.flags&128)throw Error(i(558))}return qc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ki(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[dt]=t}else qi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;qc(t),a=!1}else a=Ji(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ho(t),t):(ho(t),null)}return ho(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Gc(t,t.updateQueue),qc(t),null);case 4:return ge(),e===null&&zd(t.stateNode.containerInfo),qc(t),null;case 10:return ea(t.type),qc(t),null;case 19:if(le(go),r=t.memoizedState,r===null)return qc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Kc(r,!1);else{if(au!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=_o(e),o!==null){for(t.flags|=128,Kc(r,!1),e=o.updateQueue,t.updateQueue=e,Gc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)hi(n,e),n=n.sibling;return ue(go,go.current&1|2),zi&&Mi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&je()>gu&&(t.flags|=128,a=!0,Kc(r,!1),t.lanes=4194304)}else{if(!a)if(e=_o(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Gc(t,e),Kc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!zi)return qc(t),null}else 2*je()-r.renderingStartTime>gu&&n!==536870912&&(t.flags|=128,a=!0,Kc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(qc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=je(),e.sibling=null,n=go.current,ue(go,a?n&1|2:n&1),zi&&Mi(t,r.treeForkCount),e);case 22:case 23:return ho(t),so(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(qc(t),t.subtreeFlags&6&&(t.flags|=8192)):qc(t),n=t.updateQueue,n!==null&&Gc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&le(Ca),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ea(fa),qc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Yc(e,t){switch(Fi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ea(fa),ge(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ve(t),null;case 31:if(t.memoizedState!==null){if(ho(t),t.alternate===null)throw Error(i(340));qi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ho(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));qi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(go),null;case 4:return ge(),null;case 10:return ea(t.type),null;case 22:case 23:return ho(t),so(),e!==null&&le(Ca),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ea(fa),null;case 25:return null;default:return null}}function Xc(e,t){switch(Fi(t),t.tag){case 3:ea(fa),ge();break;case 26:case 27:case 5:ve(t);break;case 4:ge();break;case 31:t.memoizedState!==null&&ho(t);break;case 13:ho(t);break;case 19:le(go);break;case 10:ea(t.type);break;case 22:case 23:ho(t),so(),e!==null&&le(Ca);break;case 24:ea(fa)}}function Zc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){od(t,t.return,e)}}function Qc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){od(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){od(t,t.return,e)}}function $c(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{no(t,n)}catch(t){od(e,e.return,t)}}}function el(e,t,n){n.props=tc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){od(e,t,n)}}function tl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){od(e,t,n)}}function nl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){od(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){od(e,t,n)}else n.current=null}function rl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){od(e,e.return,t)}}function il(e,t,n){try{var r=e.stateNode;Qd(r,e.type,n,t),r[ft]=t}catch(t){od(e,e.return,t)}}function al(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&mf(e.type)||e.tag===4}function ol(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||al(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&mf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function sl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=an));else if(r!==4&&(r===27&&mf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(sl(e,t,n),e=e.sibling;e!==null;)sl(e,t,n),e=e.sibling}function cl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&mf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(cl(e,t,n),e=e.sibling;e!==null;)cl(e,t,n),e=e.sibling}function ll(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Zd(t,r,n),t[dt]=e,t[ft]=n}catch(t){od(e,e.return,t)}}var ul=!1,dl=!1,fl=!1,F=typeof WeakSet==`function`?WeakSet:Set,pl=null;function ml(e,t){if(e=e.containerInfo,L=yp,e=jr(e),Mr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(tf={focusedElem:e,selectionRange:n},yp=!1,pl=t;pl!==null;)if(t=pl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,pl=e;else for(;pl!==null;){switch(t=pl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Zd(o,r,n),o[dt]=e,wt(o),r=o;break a;case`link`:var s=$f(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=kr(s,h),v=kr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,M.T=null,n=wu,wu=null;var o=bu,s=Su;if(yu=0,xu=bu=null,Su=0,Yl&6)throw Error(i(331));var c=Yl;if(Yl|=4,Wl(o.current),Il(o,o.current,s,n),Yl=c,bd(0,!1),Ve&&typeof Ve.onPostCommitFiberRoot==`function`)try{Ve.onPostCommitFiberRoot(Be,o)}catch{}return!0}finally{ie.p=a,M.T=r,nd(e,t)}}function ad(e,t,n){t=Si(n,t),t=sc(e.stateNode,t,2),e=Ya(e,t,2),e!==null&&(N(e,2),yd(e))}function od(e,t,n){if(e.tag===3)ad(e,e,n);else for(;t!==null;){if(t.tag===3){ad(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(vu===null||!vu.has(r))){e=Si(n,e),n=cc(2),r=Ya(t,n,2),r!==null&&(lc(n,r,t,e),N(r,2),yd(r));break}}t=t.return}}function sd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Jl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ru=!0,i.add(n),e=cd.bind(null,e,t,n),t.then(e,e))}function cd(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Xl===e&&(Ql&n)===n&&(au===4||au===3&&(Ql&62914560)===Ql&&300>je()-mu?!(Yl&2)&&Lu(e,0):cu|=n,uu===Ql&&(uu=0)),yd(e)}function ld(e,t){t===0&&(t=et()),e=si(e,t),e!==null&&(N(e,t),yd(e))}function ud(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ld(e,n)}function dd(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),ld(e,n)}function fd(e,t){return De(e,t)}var pd=null,md=null,hd=!1,gd=!1,_d=!1,vd=0;function yd(e){e!==md&&e.next===null&&(md===null?pd=md=e:md=md.next=e),gd=!0,hd||(hd=!0,Ed())}function bd(e,t){if(!_d&&gd){_d=!0;do for(var n=!1,r=pd;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ue(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Td(r,a))}else a=Ql,a=Ze(r,r===Xl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Qe(r,a)||(n=!0,Td(r,a));r=r.next}while(n);_d=!1}}function xd(){Sd()}function Sd(){gd=hd=!1;var e=0;vd!==0&&cf()&&(e=vd);for(var t=je(),n=null,r=pd;r!==null;){var i=r.next,a=Cd(r,t);a===0?(r.next=null,n===null?pd=i:n.next=i,i===null&&(md=n)):(n=r,(e!==0||a&3)&&(gd=!0)),r=i}yu!==0&&yu!==5||bd(e,!1),vd!==0&&(vd=0)}function Cd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&$d(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function Nf(e,t,n){var r=Mf;if(r&&typeof t==`string`&&t){var i=Ut(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Df.has(i)||(Df.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Zd(t,`link`,e),wt(t),r.head.appendChild(t)))}}function Pf(e){kf.D(e),Nf(`dns-prefetch`,e,null)}function Ff(e,t){kf.C(e,t),Nf(`preconnect`,e,t)}function If(e,t,n){kf.L(e,t,n);var r=Mf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Ut(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Ut(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Ut(n.imageSizes)+`"]`)):i+=`[href="`+Ut(e)+`"]`;var a=i;switch(t){case`style`:a=Hf(e);break;case`script`:a=Kf(e)}V.has(a)||(e=p({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),V.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Uf(a))||t===`script`&&r.querySelector(qf(a))||(t=r.createElement(`link`),Zd(t,`link`,e),wt(t),r.head.appendChild(t)))}}function Lf(e,t){kf.m(e,t);var n=Mf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Ut(r)+`"][href="`+Ut(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Kf(e)}if(!V.has(a)&&(e=p({rel:`modulepreload`,href:e},t),V.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(qf(a)))return}r=n.createElement(`link`),Zd(r,`link`,e),wt(r),n.head.appendChild(r)}}}function Rf(e,t,n){kf.S(e,t,n);var r=Mf;if(r&&e){var i=Ct(r).hoistableStyles,a=Hf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Uf(a)))s.loading=5;else{e=p({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=V.get(a))&&Xf(e,n);var c=o=r.createElement(`link`);wt(c),Zd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Yf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function zf(e,t){kf.X(e,t);var n=Mf;if(n&&e){var r=Ct(n).hoistableScripts,i=Kf(e),a=r.get(i);a||(a=n.querySelector(qf(i)),a||(e=p({src:e,async:!0},t),(t=V.get(i))&&Zf(e,t),a=n.createElement(`script`),wt(a),Zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bf(e,t){kf.M(e,t);var n=Mf;if(n&&e){var r=Ct(n).hoistableScripts,i=Kf(e),a=r.get(i);a||(a=n.querySelector(qf(i)),a||(e=p({src:e,async:!0,type:`module`},t),(t=V.get(i))&&Zf(e,t),a=n.createElement(`script`),wt(a),Zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Vf(e,t,n,r){var a=(a=pe.current)?Of(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Hf(n.href),n=Ct(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Hf(n.href);var o=Ct(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Uf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),V.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},V.set(e,n),o||Gf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Kf(n),n=Ct(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Hf(e){return`href="`+Ut(e)+`"`}function Uf(e){return`link[rel="stylesheet"][`+e+`]`}function Wf(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Gf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Zd(t,`link`,n),wt(t),e.head.appendChild(t))}function Kf(e){return`[src="`+Ut(e)+`"]`}function qf(e){return`script[async]`+e}function Jf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Ut(n.href)+`"]`);if(r)return t.instance=r,wt(r),r;var a=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),wt(r),Zd(r,`style`,a),Yf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Hf(n.href);var o=e.querySelector(Uf(a));if(o)return t.state.loading|=4,t.instance=o,wt(o),o;r=Wf(n),(a=V.get(a))&&Xf(r,a),o=(e.ownerDocument||e).createElement(`link`),wt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Zd(o,`link`,r),t.state.loading|=4,Yf(o,n.precedence,e),t.instance=o;case`script`:return o=Kf(n.src),(a=e.querySelector(qf(o)))?(t.instance=a,wt(a),a):(r=n,(a=V.get(o))&&(r=p({},n),Zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),wt(a),Zd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Yf(r,n.precedence,e));return t.instance}function Yf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function tp(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function np(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function rp(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Hf(r.href),a=t.querySelector(Uf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=op.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,wt(a);return}a=t.ownerDocument||t,r=Wf(r),(i=V.get(i))&&Xf(r,i),a=a.createElement(`link`),wt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Zd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=op.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ip=0;function ap(e,t){return e.stylesheets&&e.count===0&&cp(e,e.stylesheets),0ip?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function op(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var sp=null;function cp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,sp=new Map,t.forEach(lp,e),sp=null,op.call(e))}function lp(e,t){if(!(t.state.loading&4)){var n=sp.get(e);if(n)var r=n.get(null);else{n=new Map,sp.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=_()}))(),y=f(),b=`181`,x=0,S=1,C=2,w=100,T=101,E=102,D=200,O=201,k=202,A=203,ee=204,te=205,ne=206,j=207,re=208,M=209,ie=210,ae=211,oe=212,se=213,ce=214,le=0,ue=1,de=2,fe=3,pe=4,me=5,he=6,ge=7,_e=301,ve=302,ye=303,be=306,xe=1e3,Se=1001,Ce=1002,we=1003,Te=1004,Ee=1005,De=1006,Oe=1007,ke=1008,Ae=1009,je=1010,Me=1011,Ne=1012,Pe=1013,Fe=1014,Ie=1015,Le=1016,Re=1017,ze=1018,Be=1020,Ve=35902,He=35899,Ue=1023,We=1026,Ge=1027,Ke=1028,qe=1029,Je=1030,Ye=1031,Xe=1033,Ze=33776,Qe=33777,$e=33778,et=33779,tt=35840,N=35841,nt=35842,rt=35843,it=36196,at=37492,ot=37496,st=37808,ct=37809,lt=37810,ut=37811,dt=37812,ft=37813,pt=37814,mt=37815,ht=37816,gt=37817,_t=37818,vt=37819,yt=37820,bt=37821,xt=36492,St=36494,Ct=36495,wt=36283,Tt=36284,Et=36285,Dt=36286,Ot=``,kt=`srgb`,At=`srgb-linear`,jt=`linear`,Mt=`srgb`,Nt=7680,Pt=512,Ft=513,It=514,Lt=515,Rt=516,zt=517,Bt=518,Vt=519,Ht=`300 es`,Ut=2e3,Wt=2001;function Gt(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function Kt(e){return document.createElementNS(`http://www.w3.org/1999/xhtml`,e)}function qt(){let e=Kt(`canvas`);return e.style.display=`block`,e}var Jt={};function Yt(...e){let t=`THREE.`+e.shift();console.log(t,...e)}function Xt(...e){let t=`THREE.`+e.shift();console.warn(t,...e)}function Zt(...e){let t=`THREE.`+e.shift();console.error(t,...e)}function Qt(...e){let t=e.join(` `);t in Jt||(Jt[t]=!0,Xt(...e))}var $t=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n!==void 0&&n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners;if(n===void 0)return;let r=n[e];if(r!==void 0){let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(t===void 0)return;let n=t[e.type];if(n!==void 0){e.target=this;let t=n.slice(0);for(let n=0,r=t.length;n>8&255]+en[e>>16&255]+en[e>>24&255]+`-`+en[255&t]+en[t>>8&255]+`-`+en[t>>16&15|64]+en[t>>24&255]+`-`+en[63&n|128]+en[n>>8&255]+`-`+en[n>>16&255]+en[n>>24&255]+en[255&r]+en[r>>8&255]+en[r>>16&255]+en[r>>24&255]).toLowerCase()}function on(e,t,n){return Math.max(t,Math.min(n,e))}function sn(e,t){return(e%t+t)%t}function cn(e,t,n){return(1-n)*e+n*t}function ln(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error(`Invalid component type.`)}}function un(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(4294967295*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(2147483647*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw Error(`Invalid component type.`)}}var dn={DEG2RAD:nn,RAD2DEG:rn,generateUUID:an,clamp:on,euclideanModulo:sn,mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},inverseLerp:function(e,t,n){return e===t?0:(n-e)/(t-e)},lerp:cn,damp:function(e,t,n,r){return cn(e,t,1-Math.exp(-n*r))},pingpong:function(e,t=1){return t-Math.abs(sn(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){e!==void 0&&(tn=e);let t=tn+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296},degToRad:function(e){return e*nn},radToDeg:function(e){return e*rn},isPowerOfTwo:function(e){return!(e&e-1)&&e!==0},ceilPowerOfTwo:function(e){return 2**Math.ceil(Math.log(e)/Math.LN2)},floorPowerOfTwo:function(e){return 2**Math.floor(Math.log(e)/Math.LN2)},setQuaternionFromProperEuler:function(e,t,n,r,i){let a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((t+r)/2),u=o((t+r)/2),d=a((t-r)/2),f=o((t-r)/2),p=a((r-t)/2),m=o((r-t)/2);switch(i){case`XYX`:e.set(s*u,c*d,c*f,s*l);break;case`YZY`:e.set(c*f,s*u,c*d,s*l);break;case`ZXZ`:e.set(c*d,c*f,s*u,s*l);break;case`XZX`:e.set(s*u,c*m,c*p,s*l);break;case`YXY`:e.set(c*p,s*u,c*m,s*l);break;case`ZYZ`:e.set(c*m,c*p,s*u,s*l);break;default:Xt(`MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: `+i)}},normalize:un,denormalize:ln},fn=class e{constructor(t=0,n=0){e.prototype.isVector2=!0,this.x=t,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=on(this.x,e.x,t.x),this.y=on(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=on(this.x,e,t),this.y=on(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(on(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(on(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},pn=class{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],d=i[a+0],f=i[a+1],p=i[a+2],m=i[a+3];if(o<=0)return e[t+0]=s,e[t+1]=c,e[t+2]=l,void(e[t+3]=u);if(o>=1)return e[t+0]=d,e[t+1]=f,e[t+2]=p,void(e[t+3]=m);if(u!==m||s!==d||c!==f||l!==p){let e=s*d+c*f+l*p+u*m;e<0&&(d=-d,f=-f,p=-p,m=-m,e=-e);let t=1-o;if(e<.9995){let n=Math.acos(e),r=Math.sin(n);t=Math.sin(t*n)/r,s=s*t+d*(o=Math.sin(o*n)/r),c=c*t+f*o,l=l*t+p*o,u=u*t+m*o}else{s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o;let e=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=e,c*=e,l*=e,u*=e}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){let o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],u=i[a],d=i[a+1],f=i[a+2],p=i[a+3];return e[t]=o*p+l*u+s*f-c*d,e[t+1]=s*p+l*d+c*u-o*f,e[t+2]=c*p+l*f+o*d-s*u,e[t+3]=l*p-o*u-s*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),d=s(n/2),f=s(r/2),p=s(i/2);switch(a){case`XYZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`YXZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`ZXY`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`ZYX`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`YZX`:this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case`XZY`:this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+d*f*p;break;default:Xt(`Quaternion: .setFromEuler() encountered an unknown order: `+a)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],c=t[2],l=t[6],u=t[10],d=n+o+u;if(d>0){let e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(l-s)*e,this._y=(i-c)*e,this._z=(a-r)*e}else if(n>o&&n>u){let e=2*Math.sqrt(1+n-o-u);this._w=(l-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+c)/e}else if(o>u){let e=2*Math.sqrt(1+o-n-u);this._w=(i-c)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+l)/e}else{let e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+c)/e,this._y=(s+l)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(on(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x*=e,this._y*=e,this._z*=e,this._w*=e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this}slerp(e,t){if(t<=0)return this;if(t>=1)return this.copy(e);let n=e._x,r=e._y,i=e._z,a=e._w,o=this.dot(e);o<0&&(n=-n,r=-r,i=-i,a=-a,o=-o);let s=1-t;if(o<.9995){let e=Math.acos(o),c=Math.sin(e);s=Math.sin(s*e)/c,t=Math.sin(t*e)/c,this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this._onChangeCallback()}else this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},P=class e{constructor(t=0,n=0,r=0){e.prototype.isVector3=!0,this.x=t,this.y=n,this.z=r}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(hn.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(hn.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=2*(a*r-o*n),l=2*(o*t-i*r),u=2*(i*n-a*t);return this.x=t+s*c+a*u-o*l,this.y=n+s*l+o*c-i*u,this.z=r+s*u+i*l-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=on(this.x,e.x,t.x),this.y=on(this.y,e.y,t.y),this.z=on(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=on(this.x,e,t),this.y=on(this.y,e,t),this.z=on(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(on(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return mn.copy(this).projectOnVector(e),this.sub(mn)}reflect(e){return this.sub(mn.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(on(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=2*Math.random()-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},mn=new P,hn=new pn,gn=class e{constructor(t,n,r,i,a,o,s,c,l){e.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,n,r,i,a,o,s,c,l)}set(e,t,n,r,i,a,o,s,c){let l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],d=n[2],f=n[5],p=n[8],m=r[0],h=r[3],g=r[6],_=r[1],v=r[4],y=r[7],b=r[2],x=r[5],S=r[8];return i[0]=a*m+o*_+s*b,i[3]=a*h+o*v+s*x,i[6]=a*g+o*y+s*S,i[1]=c*m+l*_+u*b,i[4]=c*h+l*v+u*x,i[7]=c*g+l*y+u*S,i[2]=d*m+f*_+p*b,i[5]=d*h+f*v+p*x,i[8]=d*g+f*y+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*i*l+n*o*s+r*i*c-r*a*s}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=l*a-o*c,d=o*s-l*i,f=c*i-a*s,p=t*u+n*d+r*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=u*m,e[1]=(r*c-l*n)*m,e[2]=(o*n-r*a)*m,e[3]=d*m,e[4]=(l*t-r*s)*m,e[5]=(r*i-o*t)*m,e[6]=f*m,e[7]=(n*s-c*t)*m,e[8]=(a*t-n*i)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,a,o){let s=Math.cos(i),c=Math.sin(i);return this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(_n.makeScale(e,t)),this}rotate(e){return this.premultiply(_n.makeRotation(-e)),this}translate(e,t){return this.premultiply(_n.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}},_n=new gn,vn=new gn().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),yn=new gn().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function bn(){let e={enabled:!0,workingColorSpace:At,spaces:{},convert:function(e,t,n){return!1!==this.enabled&&t!==n&&t&&n?(this.spaces[t].transfer===Mt&&(e.r=Sn(e.r),e.g=Sn(e.g),e.b=Sn(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===Mt&&(e.r=Cn(e.r),e.g=Cn(e.g),e.b=Cn(e.b)),e):e},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===Ot?jt:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||`standard`},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,n){return Qt(`ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().`),e.workingToColorSpace(t,n)},toWorkingColorSpace:function(t,n){return Qt(`ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().`),e.colorSpaceToWorking(t,n)}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return e.define({[At]:{primaries:t,whitePoint:r,transfer:jt,toXYZ:vn,fromXYZ:yn,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:kt},outputColorSpaceConfig:{drawingBufferColorSpace:kt}},[kt]:{primaries:t,whitePoint:r,transfer:Mt,toXYZ:vn,fromXYZ:yn,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:kt}}}),e}var xn=bn();function Sn(e){return e<.04045?.0773993808*e:(.9478672986*e+.0521327014)**2.4}function Cn(e){return e<.0031308?12.92*e:1.055*e**.41666-.055}var wn,Tn=class{static getDataURL(e,t=`image/png`){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>`u`)return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{wn===void 0&&(wn=Kt(`canvas`)),wn.width=e.width,wn.height=e.height;let t=wn.getContext(`2d`);e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),n=wn}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap){let t=Kt(`canvas`);t.width=e.width,t.height=e.height;let n=t.getContext(`2d`);n.drawImage(e,0,0,e.width,e.height);let r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e1),this.pmremVersion=0}get width(){return this.source.getSize(An).x}get height(){return this.source.getSize(An).y}get depth(){return this.source.getSize(An).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let t in e){let n=e[t];if(n===void 0){Xt(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let r=this[t];r===void 0?Xt(`Texture.setValues(): property '${t}' does not exist.`):r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.7,type:`Texture`,generator:`Texture.toJSON`},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:`dispose`})}transformUv(e){if(this.mapping!==300)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case xe:e.x-=Math.floor(e.x);break;case Se:e.x=e.x<0?0:1;break;case Ce:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x-=Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case xe:e.y-=Math.floor(e.y);break;case Se:e.y=e.y<0?0:1;break;case Ce:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y-=Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){!0===e&&this.pmremVersion++}};jn.DEFAULT_IMAGE=null,jn.DEFAULT_MAPPING=300,jn.DEFAULT_ANISOTROPY=1;var Mn=class e{constructor(t=0,n=0,r=0,i=1){e.prototype.isVector4=!0,this.x=t,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w===void 0?1:e.w,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],u=s[8],d=s[1],f=s[5],p=s[9],m=s[2],h=s[6],g=s[10];if(Math.abs(l-d)s&&e>_?e_?s1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,zn),zn.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(qn),Jn.subVectors(this.max,qn),Vn.subVectors(e.a,qn),Hn.subVectors(e.b,qn),Un.subVectors(e.c,qn),Wn.subVectors(Hn,Vn),Gn.subVectors(Un,Hn),Kn.subVectors(Vn,Un);let t=[0,-Wn.z,Wn.y,0,-Gn.z,Gn.y,0,-Kn.z,Kn.y,Wn.z,0,-Wn.x,Gn.z,0,-Gn.x,Kn.z,0,-Kn.x,-Wn.y,Wn.x,0,-Gn.y,Gn.x,0,-Kn.y,Kn.x,0];return!!Zn(t,Vn,Hn,Un,Jn)&&(t=[1,0,0,0,1,0,0,0,1],!!Zn(t,Vn,Hn,Un,Jn)&&(Yn.crossVectors(Wn,Gn),t=[Yn.x,Yn.y,Yn.z],Zn(t,Vn,Hn,Un,Jn)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,zn).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(zn).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(Rn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Rn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Rn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Rn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Rn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Rn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Rn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Rn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Rn)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}},Rn=[new P,new P,new P,new P,new P,new P,new P,new P],zn=new P,Bn=new Ln,Vn=new P,Hn=new P,Un=new P,Wn=new P,Gn=new P,Kn=new P,qn=new P,Jn=new P,Yn=new P,Xn=new P;function Zn(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){Xn.fromArray(e,a);let o=i.x*Math.abs(Xn.x)+i.y*Math.abs(Xn.y)+i.z*Math.abs(Xn.z),s=t.dot(Xn),c=n.dot(Xn),l=r.dot(Xn);if(Math.max(-Math.max(s,c,l),Math.min(s,c,l))>o)return!1}return!0}var Qn=new Ln,$n=new P,er=new P,tr=class{constructor(e=new P,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t===void 0?Qn.setFromPoints(e).getCenter(n):n.copy(t);let r=0;for(let t=0,i=e.length;tthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius*=e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;$n.subVectors(e,this.center);let t=$n.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=.5*(e-this.radius);this.center.addScaledVector($n,n/e),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(er.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint($n.copy(e.center).add(er)),this.expandByPoint($n.copy(e.center).sub(er))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}},nr=new P,rr=new P,ir=new P,ar=new P,or=new P,sr=new P,cr=new P,lr=class{constructor(e=new P,t=new P(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,nr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=nr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(nr.copy(this.origin).addScaledVector(this.direction,t),nr.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){rr.copy(e).add(t).multiplyScalar(.5),ir.copy(t).sub(e).normalize(),ar.copy(this.origin).sub(rr);let i=.5*e.distanceTo(t),a=-this.direction.dot(ir),o=ar.dot(this.direction),s=-ar.dot(ir),c=ar.lengthSq(),l=Math.abs(1-a*a),u,d,f,p;if(l>0)if(u=a*s-o,d=a*o-s,p=i*l,u>=0)if(d>=-p)if(d<=p){let e=1/l;u*=e,d*=e,f=u*(u+a*d+2*o)+d*(a*u+d+2*s)+c}else d=i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d=-i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d<=-p?(u=Math.max(0,-(-a*i+o)),d=u>0?-i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c):d<=p?(u=0,d=Math.min(Math.max(-i,-s),i),f=d*(d+2*s)+c):(u=Math.max(0,-(a*i+o)),d=u>0?i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c);else d=a>0?-i:i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(rr).addScaledVector(ir,d),f}intersectSphere(e,t){nr.subVectors(e.center,this.origin);let n=nr.dot(this.direction),r=nr.dot(nr)-n*n,i=e.radius*e.radius;if(r>i)return null;let a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return!(e.radius<0)&&this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0?!0:e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),l>=0?(i=(e.min.y-d.y)*l,a=(e.max.y-d.y)*l):(i=(e.max.y-d.y)*l,a=(e.min.y-d.y)*l),n>a||i>r?null:((i>n||isNaN(n))&&(n=i),(a=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||o>r?null:((o>n||n!=n)&&(n=o),(s=0?n:r,t)))}intersectsBox(e){return this.intersectBox(e,nr)!==null}intersectTriangle(e,t,n,r,i){or.subVectors(t,e),sr.subVectors(n,e),cr.crossVectors(or,sr);let a,o=this.direction.dot(cr);if(o>0){if(r)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}ar.subVectors(this.origin,e);let s=a*this.direction.dot(sr.crossVectors(ar,sr));if(s<0)return null;let c=a*this.direction.dot(or.cross(ar));if(c<0||s+c>o)return null;let l=-a*ar.dot(cr);return l<0?null:this.at(l/o,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},ur=class e{constructor(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){e.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g)}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=h,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new e().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,r=1/dr.setFromMatrixColumn(e,0).length(),i=1/dr.setFromMatrixColumn(e,1).length(),a=1/dr.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if(e.order===`XYZ`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=n+r*c,t[5]=e-i*c,t[9]=-o*s,t[2]=i-e*c,t[6]=r+n*c,t[10]=a*s}else if(e.order===`YXZ`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if(e.order===`ZXY`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e-i*o,t[4]=-a*u,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*l,t[9]=i-e*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if(e.order===`ZYX`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=r*c-n,t[8]=e*c+i,t[1]=s*u,t[5]=i*c+e,t[9]=n*c-r,t[2]=-c,t[6]=o*s,t[10]=a*s}else if(e.order===`YZX`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=n*u+r,t[10]=e-i*u}else if(e.order===`XZY`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=e*u+i,t[5]=a*l,t[9]=n*u-r,t[2]=r*u-n,t[6]=o*l,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(pr,e,mr)}lookAt(e,t,n){let r=this.elements;return _r.subVectors(e,t),_r.lengthSq()===0&&(_r.z=1),_r.normalize(),hr.crossVectors(n,_r),hr.lengthSq()===0&&(Math.abs(n.z)===1?_r.x+=1e-4:_r.z+=1e-4,_r.normalize(),hr.crossVectors(n,_r)),hr.normalize(),gr.crossVectors(_r,hr),r[0]=hr.x,r[4]=gr.x,r[8]=_r.x,r[1]=hr.y,r[5]=gr.y,r[9]=_r.y,r[2]=hr.z,r[6]=gr.z,r[10]=_r.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],d=n[9],f=n[13],p=n[2],m=n[6],h=n[10],g=n[14],_=n[3],v=n[7],y=n[11],b=n[15],x=r[0],S=r[4],C=r[8],w=r[12],T=r[1],E=r[5],D=r[9],O=r[13],k=r[2],A=r[6],ee=r[10],te=r[14],ne=r[3],j=r[7],re=r[11],M=r[15];return i[0]=a*x+o*T+s*k+c*ne,i[4]=a*S+o*E+s*A+c*j,i[8]=a*C+o*D+s*ee+c*re,i[12]=a*w+o*O+s*te+c*M,i[1]=l*x+u*T+d*k+f*ne,i[5]=l*S+u*E+d*A+f*j,i[9]=l*C+u*D+d*ee+f*re,i[13]=l*w+u*O+d*te+f*M,i[2]=p*x+m*T+h*k+g*ne,i[6]=p*S+m*E+h*A+g*j,i[10]=p*C+m*D+h*ee+g*re,i[14]=p*w+m*O+h*te+g*M,i[3]=_*x+v*T+y*k+b*ne,i[7]=_*S+v*E+y*A+b*j,i[11]=_*C+v*D+y*ee+b*re,i[15]=_*w+v*O+y*te+b*M,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],d=e[10],f=e[14];return e[3]*(+i*s*u-r*c*u-i*o*d+n*c*d+r*o*f-n*s*f)+e[7]*(+t*s*f-t*c*d+i*a*d-r*a*f+r*c*l-i*s*l)+e[11]*(+t*c*u-t*o*f-i*a*u+n*a*f+i*o*l-n*c*l)+e[15]*(-r*o*l-t*s*u+t*o*d+r*a*u-n*a*d+n*s*l)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],h=e[14],g=e[15],_=u*h*c-m*d*c+m*s*f-o*h*f-u*s*g+o*d*g,v=p*d*c-l*h*c-p*s*f+a*h*f+l*s*g-a*d*g,y=l*m*c-p*u*c+p*o*f-a*m*f-l*o*g+a*u*g,b=p*u*s-l*m*s-p*o*d+a*m*d+l*o*h-a*u*h,x=t*_+n*v+r*y+i*b;if(x===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/x;return e[0]=_*S,e[1]=(m*d*i-u*h*i-m*r*f+n*h*f+u*r*g-n*d*g)*S,e[2]=(o*h*i-m*s*i+m*r*c-n*h*c-o*r*g+n*s*g)*S,e[3]=(u*s*i-o*d*i-u*r*c+n*d*c+o*r*f-n*s*f)*S,e[4]=v*S,e[5]=(l*h*i-p*d*i+p*r*f-t*h*f-l*r*g+t*d*g)*S,e[6]=(p*s*i-a*h*i-p*r*c+t*h*c+a*r*g-t*s*g)*S,e[7]=(a*d*i-l*s*i+l*r*c-t*d*c-a*r*f+t*s*f)*S,e[8]=y*S,e[9]=(p*u*i-l*m*i-p*n*f+t*m*f+l*n*g-t*u*g)*S,e[10]=(a*m*i-p*o*i+p*n*c-t*m*c-a*n*g+t*o*g)*S,e[11]=(l*o*i-a*u*i-l*n*c+t*u*c+a*n*f-t*o*f)*S,e[12]=b*S,e[13]=(l*m*r-p*u*r+p*n*d-t*m*d-l*n*h+t*u*h)*S,e[14]=(p*o*r-a*m*r-p*n*s+t*m*s+a*n*h-t*o*h)*S,e[15]=(a*u*r-l*o*r+l*n*s-t*u*s-a*n*d+t*o*d)*S,this}scale(e){let t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,a){return this.set(1,n,i,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){let r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,c=i+i,l=a+a,u=o+o,d=i*c,f=i*l,p=i*u,m=a*l,h=a*u,g=o*u,_=s*c,v=s*l,y=s*u,b=n.x,x=n.y,S=n.z;return r[0]=(1-(m+g))*b,r[1]=(f+y)*b,r[2]=(p-v)*b,r[3]=0,r[4]=(f-y)*x,r[5]=(1-(d+g))*x,r[6]=(h+_)*x,r[7]=0,r[8]=(p+v)*S,r[9]=(h-_)*S,r[10]=(1-(d+m))*S,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){let r=this.elements,i=dr.set(r[0],r[1],r[2]).length(),a=dr.set(r[4],r[5],r[6]).length(),o=dr.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],fr.copy(this);let s=1/i,c=1/a,l=1/o;return fr.elements[0]*=s,fr.elements[1]*=s,fr.elements[2]*=s,fr.elements[4]*=c,fr.elements[5]*=c,fr.elements[6]*=c,fr.elements[8]*=l,fr.elements[9]*=l,fr.elements[10]*=l,t.setFromRotationMatrix(fr),n.x=i,n.y=a,n.z=o,this}makePerspective(e,t,n,r,i,a,o=2e3,s=!1){let c=this.elements,l=2*i/(t-e),u=2*i/(n-r),d=(t+e)/(t-e),f=(n+r)/(n-r),p,m;if(s)p=i/(a-i),m=a*i/(a-i);else if(o===Ut)p=-(a+i)/(a-i),m=-2*a*i/(a-i);else{if(o!==Wt)throw Error(`THREE.Matrix4.makePerspective(): Invalid coordinate system: `+o);p=-a/(a-i),m=-a*i/(a-i)}return c[0]=l,c[4]=0,c[8]=d,c[12]=0,c[1]=0,c[5]=u,c[9]=f,c[13]=0,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,r,i,a,o=2e3,s=!1){let c=this.elements,l=2/(t-e),u=2/(n-r),d=-(t+e)/(t-e),f=-(n+r)/(n-r),p,m;if(s)p=1/(a-i),m=a/(a-i);else if(o===Ut)p=-2/(a-i),m=-(a+i)/(a-i);else{if(o!==Wt)throw Error(`THREE.Matrix4.makeOrthographic(): Invalid coordinate system: `+o);p=-1/(a-i),m=-i/(a-i)}return c[0]=l,c[4]=0,c[8]=0,c[12]=d,c[1]=0,c[5]=u,c[9]=0,c[13]=f,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}},dr=new P,fr=new ur,pr=new P(0,0,0),mr=new P(1,1,1),hr=new P,gr=new P,_r=new P,vr=new ur,yr=new pn,br=class e{constructor(t=0,n=0,r=0,i=e.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],c=r[5],l=r[9],u=r[2],d=r[6],f=r[10];switch(t){case`XYZ`:this._y=Math.asin(on(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,f),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(d,c),this._z=0);break;case`YXZ`:this._x=Math.asin(-on(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(s,c)):(this._y=Math.atan2(-u,i),this._z=0);break;case`ZXY`:this._x=Math.asin(on(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(s,i));break;case`ZYX`:this._y=Math.asin(-on(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,c));break;case`YZX`:this._z=Math.asin(on(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(o,f));break;case`XZY`:this._z=Math.asin(-on(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-l,f),this._y=0);break;default:Xt(`Euler: .setFromRotationMatrix() encountered an unknown order: `+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return vr.makeRotationFromQuaternion(e),this.setFromRotationMatrix(vr,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return yr.setFromEuler(this),this.setFromQuaternion(yr,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};br.DEFAULT_ORDER=`XYZ`;var xr=class{constructor(){this.mask=1}set(e){this.mask=1<>>0}enable(e){this.mask|=1<1){for(let e=0;e1){for(let e=0;e0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type=`InstancedMesh`,r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type=`BatchedMesh`,r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(e=>({...e})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON())),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);let t=this.geometry.parameters;if(t!==void 0&&t.shapes!==void 0){let n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t0){r.children=[];for(let t=0;t0){r.animations=[];for(let t=0;t0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),c.length>0&&(n.skeletons=c),l.length>0&&(n.animations=l),u.length>0&&(n.nodes=u)}return n.object=r,n;function a(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){Rr.subVectors(r,t),zr.subVectors(n,t),Br.subVectors(e,t);let a=Rr.dot(Rr),o=Rr.dot(zr),s=Rr.dot(Br),c=zr.dot(zr),l=zr.dot(Br),u=a*c-o*o;if(u===0)return i.set(0,0,0),null;let d=1/u,f=(c*s-o*l)*d,p=(a*l-o*s)*d;return i.set(1-f-p,p,f)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Vr)!==null&&Vr.x>=0&&Vr.y>=0&&Vr.x+Vr.y<=1}static getInterpolation(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,Vr)===null?(s.x=0,s.y=0,`z`in s&&(s.z=0),`w`in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,Vr.x),s.addScaledVector(a,Vr.y),s.addScaledVector(o,Vr.z),s)}static getInterpolatedAttribute(e,t,n,r,i,a){return Jr.setScalar(0),Yr.setScalar(0),Xr.setScalar(0),Jr.fromBufferAttribute(e,t),Yr.fromBufferAttribute(e,n),Xr.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(Jr,i.x),a.addScaledVector(Yr,i.y),a.addScaledVector(Xr,i.z),a}static isFrontFacing(e,t,n,r){return Rr.subVectors(n,t),zr.subVectors(e,t),Rr.cross(zr).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Rr.subVectors(this.c,this.b),zr.subVectors(this.a,this.b),.5*Rr.cross(zr).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return e.getNormal(this.a,this.b,this.c,t)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)}getInterpolation(t,n,r,i,a){return e.getInterpolation(t,this.a,this.b,this.c,n,r,i,a)}containsPoint(t){return e.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return e.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,r=this.b,i=this.c,a,o;Hr.subVectors(r,n),Ur.subVectors(i,n),Gr.subVectors(e,n);let s=Hr.dot(Gr),c=Ur.dot(Gr);if(s<=0&&c<=0)return t.copy(n);Kr.subVectors(e,r);let l=Hr.dot(Kr),u=Ur.dot(Kr);if(l>=0&&u<=l)return t.copy(r);let d=s*u-l*c;if(d<=0&&s>=0&&l<=0)return a=s/(s-l),t.copy(n).addScaledVector(Hr,a);qr.subVectors(e,i);let f=Hr.dot(qr),p=Ur.dot(qr);if(p>=0&&f<=p)return t.copy(i);let m=f*c-s*p;if(m<=0&&c>=0&&p<=0)return o=c/(c-p),t.copy(n).addScaledVector(Ur,o);let h=l*p-f*u;if(h<=0&&u-l>=0&&f-p>=0)return Wr.subVectors(i,r),o=(u-l)/(u-l+(f-p)),t.copy(r).addScaledVector(Wr,o);let g=1/(h+m+d);return a=m*g,o=d*g,t.copy(n).addScaledVector(Hr,a).addScaledVector(Ur,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},Qr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},$r={h:0,s:0,l:0},ei={h:0,s:0,l:0};function ti(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}var ni=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){let t=e;t&&t.isColor?this.copy(t):typeof t==`number`?this.setHex(t):typeof t==`string`&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=kt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,xn.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=xn.workingColorSpace){return this.r=e,this.g=t,this.b=n,xn.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=xn.workingColorSpace){if(e=sn(e,1),t=on(t,0,1),n=on(n,0,1),t===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=ti(i,r,e+1/3),this.g=ti(i,r,e),this.b=ti(i,r,e-1/3)}return xn.colorSpaceToWorking(this,r),this}setStyle(e,t=kt){function n(t){t!==void 0&&parseFloat(t)<1&&Xt(`Color: Alpha component of `+e+` will be ignored.`)}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let i,a=r[1],o=r[2];switch(a){case`rgb`:case`rgba`:if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case`hsl`:case`hsla`:if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:Xt(`Color: Unknown color model `+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){let n=r[1],i=n.length;if(i===3)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(i===6)return this.setHex(parseInt(n,16),t);Xt(`Color: Invalid hex color `+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=kt){let n=Qr[e.toLowerCase()];return n===void 0?Xt(`Color: Unknown color `+e):this.setHex(n,t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Sn(e.r),this.g=Sn(e.g),this.b=Sn(e.b),this}copyLinearToSRGB(e){return this.r=Cn(e.r),this.g=Cn(e.g),this.b=Cn(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=kt){return xn.workingToColorSpace(ri.copy(this),e),65536*Math.round(on(255*ri.r,0,255))+256*Math.round(on(255*ri.g,0,255))+Math.round(on(255*ri.b,0,255))}getHexString(e=kt){return(`000000`+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=xn.workingColorSpace){xn.workingToColorSpace(ri.copy(this),t);let n=ri.r,r=ri.g,i=ri.b,a=Math.max(n,r,i),o=Math.min(n,r,i),s,c,l=(o+a)/2;if(o===a)s=0,c=0;else{let e=a-o;switch(c=l<=.5?e/(a+o):e/(2-a-o),a){case n:s=(r-i)/e+(r0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){Xt(`Material: parameter '${t}' has value of undefined.`);continue}let r=this[t];r===void 0?Xt(`Material: '${t}' is not a property of THREE.${this.type}.`):r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:`Material`,generator:`Material.toJSON`}};function r(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,this.name!==``&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==1&&(n.blending=this.blending),this.side!==0&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),this.blendSrc!==204&&(n.blendSrc=this.blendSrc),this.blendDst!==205&&(n.blendDst=this.blendDst),this.blendEquation!==w&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==3&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==519&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Nt&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Nt&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Nt&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!==`round`&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!==`round`&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),t){let t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let e=t.length;n=Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:`dispose`})}set needsUpdate(e){!0===e&&this.version++}},oi=class extends ai{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type=`MeshBasicMaterial`,this.color=new ni(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new br,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}},si=ci();function ci(){let e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),r=new Uint32Array(512),i=new Uint32Array(512);for(let e=0;e<256;++e){let t=e-127;t<-27?(r[e]=0,r[256|e]=32768,i[e]=24,i[256|e]=24):t<-14?(r[e]=1024>>-t-14,r[256|e]=1024>>-t-14|32768,i[e]=-t-1,i[256|e]=-t-1):t<=15?(r[e]=t+15<<10,r[256|e]=t+15<<10|32768,i[e]=13,i[256|e]=13):t<128?(r[e]=31744,r[256|e]=64512,i[e]=24,i[256|e]=24):(r[e]=31744,r[256|e]=64512,i[e]=13,i[256|e]=13)}let a=new Uint32Array(2048),o=new Uint32Array(64),s=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;!(8388608&t);)t<<=1,n-=8388608;t&=-8388609,n+=947912704,a[e]=t|n}for(let e=1024;e<2048;++e)a[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)o[e]=e<<23;o[31]=1199570944,o[32]=2147483648;for(let e=33;e<63;++e)o[e]=2147483648+(e-32<<23);o[63]=3347054592;for(let e=1;e<64;++e)e!==32&&(s[e]=1024);return{floatView:t,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:a,exponentTable:o,offsetTable:s}}var li=class{static toHalfFloat(e){return function(e){Math.abs(e)>65504&&Xt(`DataUtils.toHalfFloat(): Value out of range.`),e=on(e,-65504,65504),si.floatView[0]=e;let t=si.uint32View[0],n=t>>23&511;return si.baseTable[n]+((8388607&t)>>si.shiftTable[n])}(e)}static fromHalfFloat(e){return function(e){let t=e>>10;return si.uint32View[0]=si.mantissaTable[si.offsetTable[t]+(1023&e)]+si.exponentTable[t],si.floatView[0]}(e)}},ui=new P,di=new fn,fi=0,pi=class{constructor(e,t,n=!1){if(Array.isArray(e))throw TypeError(`THREE.BufferAttribute: array should be a Typed Array.`);this.isBufferAttribute=!0,Object.defineProperty(this,`id`,{value:fi++}),this.name=``,this.array=e,this.itemSize=t,this.count=e===void 0?0:e.length/t,this.normalized=n,this.usage=35044,this.updateRanges=[],this.gpuType=Ie,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;rt.count&&Xt(`BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.`),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ln);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return Zt(`BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.`,this),void this.boundingBox.set(new P(-1/0,-1/0,-1/0),new P(1/0,1/0,1/0));if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e0&&(e.userData=this.userData),this.parameters!==void 0){let t=this.parameters;for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let t in n){let r=n[t];e.data.attributes[t]=r.toJSON(e.data)}let r={},i=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,r=n.length;t0&&(r[t]=a,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone());let r=e.attributes;for(let e in r){let n=r[e];this.setAttribute(e,n.clone(t))}let i=e.morphAttributes;for(let e in i){let n=[],r=i[e];for(let e=0,i=r.length;e0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e(e.far-e.near)**2))return;Ti.copy(i).invert(),Ei.copy(e.ray).applyMatrix4(Ti),n.boundingBox!==null&&!1===Ei.intersectsBox(n.boundingBox)||this._computeIntersections(e,t,Ei)}}_computeIntersections(e,t,n){let r,i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,c=i.attributes.uv,l=i.attributes.uv1,u=i.attributes.normal,d=i.groups,f=i.drawRange;if(o!==null)if(Array.isArray(a))for(let i=0,s=d.length;in.far?null:{distance:l,point:Fi.clone(),object:e}}(e,t,n,r,ki,Ai,ji,Pi);if(u){let e=new P;Zr.getBarycoord(Pi,ki,Ai,ji,e),i&&(u.uv=Zr.getInterpolatedAttribute(i,s,c,l,e,new fn)),a&&(u.uv1=Zr.getInterpolatedAttribute(a,s,c,l,e,new fn)),o&&(u.normal=Zr.getInterpolatedAttribute(o,s,c,l,e,new P),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));let t={a:s,b:c,c:l,normal:new P,materialIndex:0};Zr.getNormal(ki,Ai,ji,t.normal),u.face=t,u.barycoord=e}return u}var Ri=class e extends wi{constructor(e=1,t=1,n=1,r=1,i=1,a=1){super(),this.type=`BoxGeometry`,this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};let o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);let s=[],c=[],l=[],u=[],d=0,f=0;function p(e,t,n,r,i,a,p,m,h,g,_){let v=a/h,y=p/g,b=a/2,x=p/2,S=m/2,C=h+1,w=g+1,T=0,E=0,D=new P;for(let a=0;a0?1:-1,l.push(D.x,D.y,D.z),u.push(s/h),u.push(1-a/g),T+=1}for(let e=0;e0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let n={};for(let e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}},Wi=class extends Lr{constructor(){super(),this.isCamera=!0,this.type=`Camera`,this.matrixWorldInverse=new ur,this.projectionMatrix=new ur,this.projectionMatrixInverse=new ur,this.coordinateSystem=Ut,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}},Gi=new P,Ki=new fn,qi=new fn,Ji=class extends Wi{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type=`PerspectiveCamera`,this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=2*rn*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(.5*nn*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*rn*Math.atan(Math.tan(.5*nn*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){Gi.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Gi.x,Gi.y).multiplyScalar(-e/Gi.z),Gi.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Gi.x,Gi.y).multiplyScalar(-e/Gi.z)}getViewSize(e,t){return this.getViewBounds(e,Ki,qi),t.subVectors(qi,Ki)}setViewOffset(e,t,n,r,i,a){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(.5*nn*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(this.view!==null&&this.view.enabled){let e=a.fullWidth,o=a.fullHeight;i+=a.offsetX*r/e,t-=a.offsetY*n/o,r*=a.width/e,n*=a.height/o}let o=this.filmOffset;o!==0&&(i+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}},Yi=-90,Xi=class extends Lr{constructor(e,t,n){super(),this.type=`CubeCamera`,this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let r=new Ji(Yi,1,e,t);r.layers=this.layers,this.add(r);let i=new Ji(Yi,1,e,t);i.layers=this.layers,this.add(i);let a=new Ji(Yi,1,e,t);a.layers=this.layers,this.add(a);let o=new Ji(Yi,1,e,t);o.layers=this.layers,this.add(o);let s=new Ji(Yi,1,e,t);s.layers=this.layers,this.add(s);let c=new Ji(Yi,1,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[n,r,i,a,o,s]=t;for(let e of t)this.remove(e);if(e===Ut)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),s.up.set(0,1,0),s.lookAt(0,0,-1);else{if(e!==Wt)throw Error(`THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: `+e);n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),s.up.set(0,-1,0),s.lookAt(0,0,-1)}for(let e of t)this.add(e),e.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[i,a,o,s,c,l]=this.children,u=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;let m=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,r),e.render(t,i),e.setRenderTarget(n,1,r),e.render(t,a),e.setRenderTarget(n,2,r),e.render(t,o),e.setRenderTarget(n,3,r),e.render(t,s),e.setRenderTarget(n,4,r),e.render(t,c),n.texture.generateMipmaps=m,e.setRenderTarget(n,5,r),e.render(t,l),e.setRenderTarget(u,d,f),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}},Zi=class extends jn{constructor(e=[],t=301,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,s,c,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},Qi=class extends Pn{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let n={width:e,height:e,depth:1};this.texture=new Zi([n,n,n,n,n,n]),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},r=new Ri(5,5,5),i=new Ui({name:`CubemapFromEquirect`,uniforms:zi(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=t;let a=new Ii(r,i),o=t.minFilter;return t.minFilter===ke&&(t.minFilter=De),new Xi(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,r=!0){let i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}},$i=class extends Lr{constructor(){super(),this.isGroup=!0,this.type=`Group`}},ea={type:`move`},ta=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new $i,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new $i,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new P,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new P),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new $i,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new P,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new P),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:`connected`,data:e}),this}disconnect(e){return this.dispatchEvent({type:`disconnected`,data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let r=null,i=null,a=null,o=this._targetRay,s=this._grip,c=this._hand;if(e&&t.session.visibilityState!==`visible-blurred`){if(c&&e.hand){a=!0;for(let r of e.hand.values()){let e=t.getJointPose(r,n),i=this._getHandJoint(c,r);e!==null&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=e.radius),i.visible=e!==null}let r=c.joints[`index-finger-tip`],i=c.joints[`thumb-tip`],o=r.position.distanceTo(i.position),s=.02,l=.005;c.inputState.pinching&&o>s+l?(c.inputState.pinching=!1,this.dispatchEvent({type:`pinchend`,handedness:e.handedness,target:this})):!c.inputState.pinching&&o<=s-l&&(c.inputState.pinching=!0,this.dispatchEvent({type:`pinchstart`,handedness:e.handedness,target:this}))}else s!==null&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1));o!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&i!==null&&(r=i),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(ea)))}return o!==null&&(o.visible=r!==null),s!==null&&(s.visible=i!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let n=new $i;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}},na=class extends Lr{constructor(){super(),this.isScene=!0,this.type=`Scene`,this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new br,this.environmentIntensity=1,this.environmentRotation=new br,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}},ra=class extends jn{constructor(e=null,t=1,n=1,r,i,a,o,s,c=1003,l=1003,u,d){super(null,a,o,s,c,l,r,i,u,d),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},ia=class extends pi{constructor(e,t,n,r=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){let e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}},aa=new ur,oa=new ur,sa=[],ca=new Ln,la=new ur,ua=new Ii,da=new tr,fa=class extends Ii{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new ia(new Float32Array(16*n),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let e=0;e1?null:t.copy(e.start).addScaledVector(n,i)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||ha.getNormalMatrix(e),r=this.coplanarPoint(pa).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}},_a=new tr,va=new fn(.5,.5),ya=new P,ba=class{constructor(e=new ga,t=new ga,n=new ga,r=new ga,i=new ga,a=new ga){this.planes=[e,t,n,r,i,a]}set(e,t,n,r,i,a){let o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=2e3,n=!1){let r=this.planes,i=e.elements,a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],_=i[12],v=i[13],y=i[14],b=i[15];if(r[0].setComponents(c-a,f-l,g-p,b-_).normalize(),r[1].setComponents(c+a,f+l,g+p,b+_).normalize(),r[2].setComponents(c+o,f+u,g+m,b+v).normalize(),r[3].setComponents(c-o,f-u,g-m,b-v).normalize(),n)r[4].setComponents(s,d,h,y).normalize(),r[5].setComponents(c-s,f-d,g-h,b-y).normalize();else if(r[4].setComponents(c-s,f-d,g-h,b-y).normalize(),t===Ut)r[5].setComponents(c+s,f+d,g+h,b+y).normalize();else{if(t!==Wt)throw Error(`THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: `+t);r[5].setComponents(s,d,h,y).normalize()}return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),_a.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),_a.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(_a)}intersectsSprite(e){return _a.center.set(0,0,0),_a.radius=.7071067811865476+va.distanceTo(e.center),_a.applyMatrix4(e.matrixWorld),this.intersectsSphere(_a)}intersectsSphere(e){let t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)0?e.max.x:e.min.x,ya.y=r.normal.y>0?e.max.y:e.min.y,ya.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(ya)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}},xa=class extends jn{constructor(e,t,n=1014,r,i,a,o=1003,s=1003,c,l=1026,u=1){if(l!==We&&l!==Ge)throw Error(`DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat`);super({width:e,height:t,depth:u},r,i,a,o,s,l,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Dn(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}},Sa=class extends jn{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}},Ca=class e extends wi{constructor(e=1,t=1,n=1,r=1){super(),this.type=`PlaneGeometry`,this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};let i=e/2,a=t/2,o=Math.floor(n),s=Math.floor(r),c=o+1,l=s+1,u=e/o,d=t/s,f=[],p=[],m=[],h=[];for(let e=0;e{t&&t(i),this.manager.itemEnd(e)},0),i;if(ja[e]!==void 0)return void ja[e].push({onLoad:t,onProgress:n,onError:r});ja[e]=[],ja[e].push({onLoad:t,onProgress:n,onError:r});let a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?`include`:`same-origin`,signal:typeof AbortSignal.any==`function`?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),o=this.mimeType,s=this.responseType;fetch(a).then(t=>{if(t.status===200||t.status===0){if(t.status===0&&Xt(`FileLoader: HTTP Status 0 received.`),typeof ReadableStream>`u`||t.body===void 0||t.body.getReader===void 0)return t;let n=ja[e],r=t.body.getReader(),i=t.headers.get(`X-File-Size`)||t.headers.get(`Content-Length`),a=i?parseInt(i):0,o=a!==0,s=0,c=new ReadableStream({start(e){(function t(){r.read().then(({done:r,value:i})=>{if(r)e.close();else{s+=i.byteLength;let r=new ProgressEvent(`progress`,{lengthComputable:o,loaded:s,total:a});for(let e=0,t=n.length;e{e.error(t)})})()}});return new Response(c)}throw new Ma(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)}).then(e=>{switch(s){case`arraybuffer`:return e.arrayBuffer();case`blob`:return e.blob();case`document`:return e.text().then(e=>new DOMParser().parseFromString(e,o));case`json`:return e.json();default:if(o===``)return e.text();{let t=/charset="?([^;"\s]*)"?/i.exec(o),n=t&&t[1]?t[1].toLowerCase():void 0,r=new TextDecoder(n);return e.arrayBuffer().then(e=>r.decode(e))}}}).then(t=>{Oa.add(`file:${e}`,t);let n=ja[e];delete ja[e];for(let e=0,r=n.length;e{let n=ja[e];if(n===void 0)throw this.manager.itemError(e),t;delete ja[e];for(let e=0,r=n.length;e{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}},Pa=new WeakMap,Fa=class extends Aa{constructor(e){super(e)}load(e,t,n,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let i=this,a=Oa.get(`image:${e}`);if(a!==void 0){if(!0===a.complete)i.manager.itemStart(e),setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0);else{let e=Pa.get(a);e===void 0&&(e=[],Pa.set(a,e)),e.push({onLoad:t,onError:r})}return a}let o=Kt(`img`);function s(){l(),t&&t(this);let n=Pa.get(this)||[];for(let e=0;ee.start-t.start);let t=0;for(let e=1;e 0 + vec4 plane; + #ifdef ALPHA_TO_COVERAGE + float distanceToPlane, distanceGradient; + float clipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + if ( clipOpacity == 0.0 ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + float unionClipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + } + #pragma unroll_loop_end + clipOpacity *= 1.0 - unionClipOpacity; + #endif + diffuseColor.a *= clipOpacity; + if ( diffuseColor.a == 0.0 ) discard; + #else + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif + #endif +#endif`,clipping_planes_pars_fragment:`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,clipping_planes_pars_vertex:`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,clipping_planes_vertex:`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,color_fragment:`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,color_pars_fragment:`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,color_pars_vertex:`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + varying vec3 vColor; +#endif`,color_vertex:`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif +#ifdef USE_BATCHING_COLOR + vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); + vColor.xyz *= batchingColor.xyz; +#endif`,common:`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} +float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} // validated`,cube_uv_reflection_fragment:`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,defaultnormal_vertex:`vec3 transformedNormal = objectNormal; +#ifdef USE_TANGENT + vec3 transformedTangent = objectTangent; +#endif +#ifdef USE_BATCHING + mat3 bm = mat3( batchingMatrix ); + transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); + transformedNormal = bm * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = bm * transformedTangent; + #endif +#endif +#ifdef USE_INSTANCING + mat3 im = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); + transformedNormal = im * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = im * transformedTangent; + #endif +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,displacementmap_pars_vertex:`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,displacementmap_vertex:`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,emissivemap_fragment:`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE + emissiveColor = sRGBTransferEOTF( emissiveColor ); + #endif + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,emissivemap_pars_fragment:`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,colorspace_fragment:`gl_FragColor = linearToOutputTexel( gl_FragColor );`,colorspace_pars_fragment:`vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferEOTF( in vec4 value ) { + return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); +} +vec4 sRGBTransferOETF( in vec4 value ) { + return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); +}`,envmap_fragment:`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif +#endif`,envmap_common_pars_fragment:`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + uniform mat3 envMapRotation; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif +#endif`,envmap_pars_fragment:`#ifdef USE_ENVMAP + uniform float reflectivity; + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + varying vec3 vWorldPosition; + uniform float refractionRatio; + #else + varying vec3 vReflect; + #endif +#endif`,envmap_pars_vertex:`#ifdef USE_ENVMAP + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + + varying vec3 vWorldPosition; + #else + varying vec3 vReflect; + uniform float refractionRatio; + #endif +#endif`,envmap_physical_pars_fragment:`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,envmap_vertex:`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vWorldPosition = worldPosition.xyz; + #else + vec3 cameraToVertex; + if ( isOrthographic ) { + cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,fog_vertex:`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,fog_pars_vertex:`#ifdef USE_FOG + varying float vFogDepth; +#endif`,fog_fragment:`#ifdef USE_FOG + #ifdef FOG_EXP2 + float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); + #else + float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); + #endif + gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); +#endif`,fog_pars_fragment:`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,gradientmap_pars_fragment:`#ifdef USE_GRADIENTMAP + uniform sampler2D gradientMap; +#endif +vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { + float dotNL = dot( normal, lightDirection ); + vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); + #ifdef USE_GRADIENTMAP + return vec3( texture2D( gradientMap, coord ).r ); + #else + vec2 fw = fwidth( coord ) * 0.5; + return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); + #endif +}`,lightmap_pars_fragment:`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,lights_lambert_fragment:`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,lights_lambert_pars_fragment:`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,lights_pars_begin:`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +#if defined( USE_LIGHT_PROBES ) + uniform vec3 lightProbe[ 9 ]; +#endif +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometryPosition; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometryPosition; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif`,lights_toon_fragment:`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,lights_toon_pars_fragment:`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,lights_phong_fragment:`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,lights_phong_pars_fragment:`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,lights_physical_fragment:`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); +float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_DISPERSION + material.dispersion = dispersion; +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + if( material.anisotropy == 0.0 ) { + anisotropyV = vec2( 1.0, 0.0 ); + } else { + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + } + material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); + material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; + material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; +#endif`,lights_physical_pars_fragment:`uniform sampler2D dfgLUT; +struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + float dispersion; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecularDirect = vec3( 0.0 ); +vec3 clearcoatSpecularIndirect = vec3( 0.0 ); +vec3 sheenSpecularDirect = vec3( 0.0 ); +vec3 sheenSpecularIndirect = vec3(0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + float v = 0.5 / ( gv + gl ); + return saturate(v); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColor; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transpose( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + vec2 uv = vec2( roughness, dotNV ); + return texture2D( dfgLUT, uv ).rg; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +vec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + vec2 dfgV = DFGApprox( vec3(0.0, 0.0, 1.0), vec3(sqrt(1.0 - dotNV * dotNV), 0.0, dotNV), material.roughness ); + vec2 dfgL = DFGApprox( vec3(0.0, 0.0, 1.0), vec3(sqrt(1.0 - dotNL * dotNL), 0.0, dotNL), material.roughness ); + vec3 FssEss_V = material.specularColor * dfgV.x + material.specularF90 * dfgV.y; + vec3 FssEss_L = material.specularColor * dfgL.x + material.specularF90 * dfgL.y; + float Ess_V = dfgV.x + dfgV.y; + float Ess_L = dfgL.x + dfgL.y; + float Ems_V = 1.0 - Ess_V; + float Ems_L = 1.0 - Ess_L; + vec3 Favg = material.specularColor + ( 1.0 - material.specularColor ) * 0.047619; + vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg * Favg + EPSILON ); + float compensationFactor = Ems_V * Ems_L; + vec3 multiScatter = Fms * compensationFactor; + return singleScatter + multiScatter; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometryNormal; + vec3 viewDir = geometryViewDir; + vec3 position = geometryPosition; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#define RE_IndirectSpecular RE_IndirectSpecular_Physical +float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { + return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); +}`,lights_fragment_begin:` +vec3 geometryPosition = - vViewPosition; +vec3 geometryNormal = normal; +vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +vec3 geometryClearcoatNormal = vec3( 0.0 ); +#ifdef USE_CLEARCOAT + geometryClearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometryViewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometryPosition, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + } + #pragma unroll_loop_end + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,lights_fragment_maps:`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,lights_fragment_end:`#if defined( RE_IndirectDiffuse ) + RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif`,logdepthbuf_fragment:`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,logdepthbuf_pars_fragment:`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,logdepthbuf_pars_vertex:`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER + varying float vFragDepth; + varying float vIsPerspective; +#endif`,logdepthbuf_vertex:`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); +#endif`,map_fragment:`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,map_pars_fragment:`#ifdef USE_MAP + uniform sampler2D map; +#endif`,map_particle_fragment:`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + #if defined( USE_POINTS_UV ) + vec2 uv = vUv; + #else + vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; + #endif +#endif +#ifdef USE_MAP + diffuseColor *= texture2D( map, uv ); +#endif +#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, uv ).g; +#endif`,map_particle_pars_fragment:`#if defined( USE_POINTS_UV ) + varying vec2 vUv; +#else + #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + uniform mat3 uvTransform; + #endif +#endif +#ifdef USE_MAP + uniform sampler2D map; +#endif +#ifdef USE_ALPHAMAP + uniform sampler2D alphaMap; +#endif`,metalnessmap_fragment:`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,metalnessmap_pars_fragment:`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,morphinstance_vertex:`#ifdef USE_INSTANCING_MORPH + float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; + } +#endif`,morphcolor_vertex:`#if defined( USE_MORPHCOLORS ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,morphnormal_vertex:`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,morphtarget_pars_vertex:`#ifdef USE_MORPHTARGETS + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetBaseInfluence; + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + #endif + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } +#endif`,morphtarget_vertex:`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,normal_fragment_begin:`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 nonPerturbedNormal = normal;`,normal_fragment_maps:`#ifdef USE_NORMALMAP_OBJECTSPACE + normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #ifdef FLIP_SIDED + normal = - normal; + #endif + #ifdef DOUBLE_SIDED + normal = normal * faceDirection; + #endif + normal = normalize( normalMatrix * normal ); +#elif defined( USE_NORMALMAP_TANGENTSPACE ) + vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,normal_pars_fragment:`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,normal_pars_vertex:`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,normal_vertex:`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,normalmap_pars_fragment:`#ifdef USE_NORMALMAP + uniform sampler2D normalMap; + uniform vec2 normalScale; +#endif +#ifdef USE_NORMALMAP_OBJECTSPACE + uniform mat3 normalMatrix; +#endif +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + vec3 N = surf_norm; + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + return mat3( T * scale, B * scale, N ); + } +#endif`,clearcoat_normal_fragment_begin:`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,clearcoat_normal_fragment_maps:`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,clearcoat_pars_fragment:`#ifdef USE_CLEARCOATMAP + uniform sampler2D clearcoatMap; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform sampler2D clearcoatNormalMap; + uniform vec2 clearcoatNormalScale; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform sampler2D clearcoatRoughnessMap; +#endif`,iridescence_pars_fragment:`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,opaque_fragment:`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,packing:`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; +const float Inv255 = 1. / 255.; +const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); +const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); +const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); +const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); +vec4 packDepthToRGBA( const in float v ) { + if( v <= 0.0 ) + return vec4( 0., 0., 0., 0. ); + if( v >= 1.0 ) + return vec4( 1., 1., 1., 1. ); + float vuf; + float af = modf( v * PackFactors.a, vuf ); + float bf = modf( vuf * ShiftRight8, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); +} +vec3 packDepthToRGB( const in float v ) { + if( v <= 0.0 ) + return vec3( 0., 0., 0. ); + if( v >= 1.0 ) + return vec3( 1., 1., 1. ); + float vuf; + float bf = modf( v * PackFactors.b, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec3( vuf * Inv255, gf * PackUpscale, bf ); +} +vec2 packDepthToRG( const in float v ) { + if( v <= 0.0 ) + return vec2( 0., 0. ); + if( v >= 1.0 ) + return vec2( 1., 1. ); + float vuf; + float gf = modf( v * 256., vuf ); + return vec2( vuf * Inv255, gf ); +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors4 ); +} +float unpackRGBToDepth( const in vec3 v ) { + return dot( v, UnpackFactors3 ); +} +float unpackRGToDepth( const in vec2 v ) { + return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; +} +vec4 pack2HalfToRGBA( const in vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( const in vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + return depth * ( near - far ) - near; +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,premultiplied_alpha_fragment:`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,project_vertex:`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_BATCHING + mvPosition = batchingMatrix * mvPosition; +#endif +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,dithering_fragment:`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,dithering_pars_fragment:`#ifdef DITHERING + vec3 dithering( vec3 color ) { + float grid_position = rand( gl_FragCoord.xy ); + vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); + dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); + return color + dither_shift_RGB; + } +#endif`,roughnessmap_fragment:`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,roughnessmap_pars_fragment:`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,shadowmap_pars_fragment:`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + float depth = unpackRGBAToDepth( texture2D( depths, uv ) ); + #ifdef USE_REVERSED_DEPTH_BUFFER + return step( depth, compare ); + #else + return step( compare, depth ); + #endif + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow( sampler2D shadow, vec2 uv, float compare ) { + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + #ifdef USE_REVERSED_DEPTH_BUFFER + float hard_shadow = step( distribution.x, compare ); + #else + float hard_shadow = step( compare, distribution.x ); + #endif + if ( hard_shadow != 1.0 ) { + float distance = compare - distribution.x; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + float shadow = 1.0; + vec3 lightToPosition = shadowCoord.xyz; + + float lightToPositionLength = length( lightToPosition ); + if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { + float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + shadow = ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } +#endif`,shadowmap_pars_vertex:`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,shadowmap_vertex:`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) + vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + vec4 shadowWorldPosition; +#endif +#if defined( USE_SHADOWMAP ) + #if NUM_DIR_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); + vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); + vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif +#endif +#if NUM_SPOT_LIGHT_COORDS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { + shadowWorldPosition = worldPosition; + #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; + #endif + vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end +#endif`,shadowmask_pars_fragment:`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,skinbase_vertex:`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,skinning_pars_vertex:`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + mat4 getBoneMatrix( const in float i ) { + int size = textureSize( boneTexture, 0 ).x; + int j = int( i ) * 4; + int x = j % size; + int y = j / size; + vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); + vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); + vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); + vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); + return mat4( v1, v2, v3, v4 ); + } +#endif`,skinning_vertex:`#ifdef USE_SKINNING + vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); + vec4 skinned = vec4( 0.0 ); + skinned += boneMatX * skinVertex * skinWeight.x; + skinned += boneMatY * skinVertex * skinWeight.y; + skinned += boneMatZ * skinVertex * skinWeight.z; + skinned += boneMatW * skinVertex * skinWeight.w; + transformed = ( bindMatrixInverse * skinned ).xyz; +#endif`,skinnormal_vertex:`#ifdef USE_SKINNING + mat4 skinMatrix = mat4( 0.0 ); + skinMatrix += skinWeight.x * boneMatX; + skinMatrix += skinWeight.y * boneMatY; + skinMatrix += skinWeight.z * boneMatZ; + skinMatrix += skinWeight.w * boneMatW; + skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; + objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; + #ifdef USE_TANGENT + objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #endif +#endif`,specularmap_fragment:`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,specularmap_pars_fragment:`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,tonemapping_fragment:`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,tonemapping_pars_fragment:`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 CineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( + vec3( 1.6605, - 0.1246, - 0.0182 ), + vec3( - 0.5876, 1.1329, - 0.1006 ), + vec3( - 0.0728, - 0.0083, 1.1187 ) +); +const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( + vec3( 0.6274, 0.0691, 0.0164 ), + vec3( 0.3293, 0.9195, 0.0880 ), + vec3( 0.0433, 0.0113, 0.8956 ) +); +vec3 agxDefaultContrastApprox( vec3 x ) { + vec3 x2 = x * x; + vec3 x4 = x2 * x2; + return + 15.5 * x4 * x2 + - 40.14 * x4 * x + + 31.96 * x4 + - 6.868 * x2 * x + + 0.4298 * x2 + + 0.1191 * x + - 0.00232; +} +vec3 AgXToneMapping( vec3 color ) { + const mat3 AgXInsetMatrix = mat3( + vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), + vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), + vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) + ); + const mat3 AgXOutsetMatrix = mat3( + vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), + vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), + vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) + ); + const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; + color *= toneMappingExposure; + color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color = AgXInsetMatrix * color; + color = max( color, 1e-10 ); color = log2( color ); + color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); + color = clamp( color, 0.0, 1.0 ); + color = agxDefaultContrastApprox( color ); + color = AgXOutsetMatrix * color; + color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); + color = LINEAR_REC2020_TO_LINEAR_SRGB * color; + color = clamp( color, 0.0, 1.0 ); + return color; +} +vec3 NeutralToneMapping( vec3 color ) { + const float StartCompression = 0.8 - 0.04; + const float Desaturation = 0.15; + color *= toneMappingExposure; + float x = min( color.r, min( color.g, color.b ) ); + float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; + color -= offset; + float peak = max( color.r, max( color.g, color.b ) ); + if ( peak < StartCompression ) return color; + float d = 1. - StartCompression; + float newPeak = 1. - d * d / ( peak + d - StartCompression ); + color *= newPeak / peak; + float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); + return mix( color, vec3( newPeak ), g ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,transmission_fragment:`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,transmission_pars_fragment:`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec4 transmittedLight; + vec3 transmittance; + #ifdef USE_DISPERSION + float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; + vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); + for ( int i = 0; i < 3; i ++ ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); + transmittedLight[ i ] = transmissionSample[ i ]; + transmittedLight.a += transmissionSample.a; + transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; + } + transmittedLight.a /= 3.0; + #else + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + #endif + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,uv_pars_fragment:`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + varying vec2 vNormalMapUv; +#endif +#ifdef USE_EMISSIVEMAP + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_SPECULARMAP + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,uv_pars_vertex:`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + uniform mat3 mapTransform; + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + uniform mat3 alphaMapTransform; + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + uniform mat3 lightMapTransform; + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + uniform mat3 aoMapTransform; + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + uniform mat3 bumpMapTransform; + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + uniform mat3 normalMapTransform; + varying vec2 vNormalMapUv; +#endif +#ifdef USE_DISPLACEMENTMAP + uniform mat3 displacementMapTransform; + varying vec2 vDisplacementMapUv; +#endif +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapTransform; + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + uniform mat3 metalnessMapTransform; + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + uniform mat3 roughnessMapTransform; + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + uniform mat3 anisotropyMapTransform; + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + uniform mat3 clearcoatMapTransform; + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform mat3 clearcoatNormalMapTransform; + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform mat3 clearcoatRoughnessMapTransform; + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + uniform mat3 sheenColorMapTransform; + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + uniform mat3 sheenRoughnessMapTransform; + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + uniform mat3 iridescenceMapTransform; + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform mat3 iridescenceThicknessMapTransform; + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SPECULARMAP + uniform mat3 specularMapTransform; + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + uniform mat3 specularColorMapTransform; + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + uniform mat3 specularIntensityMapTransform; + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,uv_vertex:`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + vUv = vec3( uv, 1 ).xy; +#endif +#ifdef USE_MAP + vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ALPHAMAP + vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_LIGHTMAP + vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_AOMAP + vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_BUMPMAP + vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_NORMALMAP + vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_DISPLACEMENTMAP + vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_EMISSIVEMAP + vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_METALNESSMAP + vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ROUGHNESSMAP + vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ANISOTROPYMAP + vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOATMAP + vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCEMAP + vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_COLORMAP + vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULARMAP + vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_COLORMAP + vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_TRANSMISSIONMAP + vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_THICKNESSMAP + vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; +#endif`,worldpos_vertex:`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 + vec4 worldPosition = vec4( transformed, 1.0 ); + #ifdef USE_BATCHING + worldPosition = batchingMatrix * worldPosition; + #endif + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`,background_vert:`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,background_frag:`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,backgroundCube_vert:`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,backgroundCube_frag:`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +uniform mat3 backgroundRotation; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,cube_vert:`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,cube_frag:`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,depth_vert:`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,depth_frag:`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + #ifdef USE_REVERSED_DEPTH_BUFFER + float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ]; + #else + float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5; + #endif + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #elif DEPTH_PACKING == 3202 + gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); + #elif DEPTH_PACKING == 3203 + gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); + #endif +}`,distanceRGBA_vert:`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,distanceRGBA_frag:`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,equirect_vert:`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,equirect_frag:`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,linedashed_vert:`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,linedashed_frag:`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,meshbasic_vert:`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,meshbasic_frag:`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,meshlambert_vert:`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,meshlambert_frag:`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,meshmatcap_vert:`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,meshmatcap_frag:`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,meshnormal_vert:`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,meshnormal_frag:`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,meshphong_vert:`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,meshphong_frag:`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,meshphysical_vert:`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,meshphysical_frag:`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_DISPERSION + uniform float dispersion; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,meshtoon_vert:`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,meshtoon_frag:`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,points_vert:`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#ifdef USE_POINTS_UV + varying vec2 vUv; + uniform mat3 uvTransform; +#endif +void main() { + #ifdef USE_POINTS_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #include + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,points_frag:`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,shadow_vert:`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,shadow_frag:`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,sprite_vert:`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix[ 3 ]; + vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,sprite_frag:`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`},no={common:{diffuse:{value:new ni(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new gn},alphaMap:{value:null},alphaMapTransform:{value:new gn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new gn}},envmap:{envMap:{value:null},envMapRotation:{value:new gn},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new gn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new gn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new gn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new gn},normalScale:{value:new fn(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new gn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new gn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new gn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new gn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ni(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ni(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new gn},alphaTest:{value:0},uvTransform:{value:new gn}},sprite:{diffuse:{value:new ni(16777215)},opacity:{value:1},center:{value:new fn(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new gn},alphaMap:{value:null},alphaMapTransform:{value:new gn},alphaTest:{value:0}}},ro={basic:{uniforms:Bi([no.common,no.specularmap,no.envmap,no.aomap,no.lightmap,no.fog]),vertexShader:to.meshbasic_vert,fragmentShader:to.meshbasic_frag},lambert:{uniforms:Bi([no.common,no.specularmap,no.envmap,no.aomap,no.lightmap,no.emissivemap,no.bumpmap,no.normalmap,no.displacementmap,no.fog,no.lights,{emissive:{value:new ni(0)}}]),vertexShader:to.meshlambert_vert,fragmentShader:to.meshlambert_frag},phong:{uniforms:Bi([no.common,no.specularmap,no.envmap,no.aomap,no.lightmap,no.emissivemap,no.bumpmap,no.normalmap,no.displacementmap,no.fog,no.lights,{emissive:{value:new ni(0)},specular:{value:new ni(1118481)},shininess:{value:30}}]),vertexShader:to.meshphong_vert,fragmentShader:to.meshphong_frag},standard:{uniforms:Bi([no.common,no.envmap,no.aomap,no.lightmap,no.emissivemap,no.bumpmap,no.normalmap,no.displacementmap,no.roughnessmap,no.metalnessmap,no.fog,no.lights,{emissive:{value:new ni(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:to.meshphysical_vert,fragmentShader:to.meshphysical_frag},toon:{uniforms:Bi([no.common,no.aomap,no.lightmap,no.emissivemap,no.bumpmap,no.normalmap,no.displacementmap,no.gradientmap,no.fog,no.lights,{emissive:{value:new ni(0)}}]),vertexShader:to.meshtoon_vert,fragmentShader:to.meshtoon_frag},matcap:{uniforms:Bi([no.common,no.bumpmap,no.normalmap,no.displacementmap,no.fog,{matcap:{value:null}}]),vertexShader:to.meshmatcap_vert,fragmentShader:to.meshmatcap_frag},points:{uniforms:Bi([no.points,no.fog]),vertexShader:to.points_vert,fragmentShader:to.points_frag},dashed:{uniforms:Bi([no.common,no.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:to.linedashed_vert,fragmentShader:to.linedashed_frag},depth:{uniforms:Bi([no.common,no.displacementmap]),vertexShader:to.depth_vert,fragmentShader:to.depth_frag},normal:{uniforms:Bi([no.common,no.bumpmap,no.normalmap,no.displacementmap,{opacity:{value:1}}]),vertexShader:to.meshnormal_vert,fragmentShader:to.meshnormal_frag},sprite:{uniforms:Bi([no.sprite,no.fog]),vertexShader:to.sprite_vert,fragmentShader:to.sprite_frag},background:{uniforms:{uvTransform:{value:new gn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:to.background_vert,fragmentShader:to.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new gn}},vertexShader:to.backgroundCube_vert,fragmentShader:to.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:to.cube_vert,fragmentShader:to.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:to.equirect_vert,fragmentShader:to.equirect_frag},distanceRGBA:{uniforms:Bi([no.common,no.displacementmap,{referencePosition:{value:new P},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:to.distanceRGBA_vert,fragmentShader:to.distanceRGBA_frag},shadow:{uniforms:Bi([no.lights,no.fog,{color:{value:new ni(0)},opacity:{value:1}}]),vertexShader:to.shadow_vert,fragmentShader:to.shadow_frag}};ro.physical={uniforms:Bi([ro.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new gn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new gn},clearcoatNormalScale:{value:new fn(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new gn},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new gn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new gn},sheen:{value:0},sheenColor:{value:new ni(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new gn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new gn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new gn},transmissionSamplerSize:{value:new fn},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new gn},attenuationDistance:{value:0},attenuationColor:{value:new ni(0)},specularColor:{value:new ni(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new gn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new gn},anisotropyVector:{value:new fn},anisotropyMap:{value:null},anisotropyMapTransform:{value:new gn}}]),vertexShader:to.meshphysical_vert,fragmentShader:to.meshphysical_frag};var io={r:0,b:0,g:0},ao=new br,oo=new ur;function so(e,t,n,r,i,a,o){let s=new ni(0),c,l,u=!0===a?0:1,d=null,f=0,p=null;function m(e){let r=!0===e.isScene?e.background:null;return r&&r.isTexture&&(r=(e.backgroundBlurriness>0?n:t).get(r)),r}function h(t,n){t.getRGB(io,Vi(e)),r.buffers.color.setClear(io.r,io.g,io.b,n,o)}return{getClearColor:function(){return s},setClearColor:function(e,t=1){s.set(e),u=t,h(s,u)},getClearAlpha:function(){return u},setClearAlpha:function(e){u=e,h(s,u)},render:function(t){let n=!1,i=m(t);i===null?h(s,u):i&&i.isColor&&(h(i,1),n=!0);let a=e.xr.getEnvironmentBlendMode();a===`additive`?r.buffers.color.setClear(0,0,0,1,o):a===`alpha-blend`&&r.buffers.color.setClear(0,0,0,0,o),(e.autoClear||n)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))},addToRenderList:function(t,n){let r=m(n);r&&(r.isCubeTexture||r.mapping===be)?(l===void 0&&(l=new Ii(new Ri(1,1,1),new Ui({name:`BackgroundCubeMaterial`,uniforms:zi(ro.backgroundCube.uniforms),vertexShader:ro.backgroundCube.vertexShader,fragmentShader:ro.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute(`normal`),l.geometry.deleteAttribute(`uv`),l.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(l.material,`envMap`,{get:function(){return this.uniforms.envMap.value}}),i.update(l)),ao.copy(n.backgroundRotation),ao.x*=-1,ao.y*=-1,ao.z*=-1,r.isCubeTexture&&!1===r.isRenderTargetTexture&&(ao.y*=-1,ao.z*=-1),l.material.uniforms.envMap.value=r,l.material.uniforms.flipEnvMap.value=r.isCubeTexture&&!1===r.isRenderTargetTexture?-1:1,l.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.uniforms.backgroundRotation.value.setFromMatrix4(oo.makeRotationFromEuler(ao)),l.material.toneMapped=xn.getTransfer(r.colorSpace)!==Mt,d===r&&f===r.version&&p===e.toneMapping||(l.material.needsUpdate=!0,d=r,f=r.version,p=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null)):r&&r.isTexture&&(c===void 0&&(c=new Ii(new Ca(2,2),new Ui({name:`BackgroundMaterial`,uniforms:zi(ro.background.uniforms),vertexShader:ro.background.vertexShader,fragmentShader:ro.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute(`normal`),Object.defineProperty(c.material,`map`,{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=r,c.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,c.material.toneMapped=xn.getTransfer(r.colorSpace)!==Mt,!0===r.matrixAutoUpdate&&r.updateMatrix(),c.material.uniforms.uvTransform.value.copy(r.matrix),d===r&&f===r.version&&p===e.toneMapping||(c.material.needsUpdate=!0,d=r,f=r.version,p=e.toneMapping),c.layers.enableAll(),t.unshift(c,c.geometry,c.material,0,0,null))},dispose:function(){l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}}}function co(e,t){let n=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},i=l(null),a=i,o=!1;function s(t){return e.bindVertexArray(t)}function c(t){return e.deleteVertexArray(t)}function l(e){let t=[],r=[],i=[];for(let e=0;e=0){let n=i[t],r=o[t];if(r===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(r=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(r=e.instanceColor)),n===void 0||n.attribute!==r||r&&n.data!==r.data)return!0;s++}return a.attributesNum!==s||a.index!==r}(n,h,c,g),_&&function(e,t,n,r){let i={},o=t.attributes,s=0,c=n.getAttributes();for(let t in c)if(c[t].location>=0){let n=o[t];n===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(n=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(n=e.instanceColor));let r={};r.attribute=n,n&&n.data&&(r.data=n.data),i[t]=r,s++}a.attributes=i,a.attributesNum=s,a.index=r}(n,h,c,g),g!==null&&t.update(g,e.ELEMENT_ARRAY_BUFFER),(_||o)&&(o=!1,function(n,r,i,a){u();let o=a.attributes,s=i.getAttributes(),c=r.defaultAttributeValues;for(let r in s){let i=s[r];if(i.location>=0){let s=o[r];if(s===void 0&&(r===`instanceMatrix`&&n.instanceMatrix&&(s=n.instanceMatrix),r===`instanceColor`&&n.instanceColor&&(s=n.instanceColor)),s!==void 0){let r=s.normalized,o=s.itemSize,c=t.get(s);if(c===void 0)continue;let l=c.buffer,u=c.type,p=c.bytesPerElement,h=u===e.INT||u===e.UNSIGNED_INT||s.gpuType===Pe;if(s.isInterleavedBufferAttribute){let t=s.data,c=t.stride,g=s.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return`highp`;t=`mediump`}return t===`mediump`&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?`mediump`:`lowp`}let o=n.precision===void 0?`highp`:n.precision,s=a(o);s!==o&&(Xt(`WebGLRenderer:`,o,`not supported, using`,s,`instead.`),o=s);let c=!0===n.logarithmicDepthBuffer,l=!0===n.reversedDepthBuffer&&t.has(`EXT_clip_control`),u=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),d=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS);return{isWebGL2:!0,getMaxAnisotropy:function(){if(i!==void 0)return i;if(!0===t.has(`EXT_texture_filter_anisotropic`)){let n=t.get(`EXT_texture_filter_anisotropic`);i=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:a,textureFormatReadable:function(t){return t===Ue||r.convert(t)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(n){let i=n===Le&&(t.has(`EXT_color_buffer_half_float`)||t.has(`EXT_color_buffer_float`));return!(n!==Ae&&r.convert(n)!==e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)&&n!==Ie&&!i)},precision:o,logarithmicDepthBuffer:c,reversedDepthBuffer:l,maxTextures:u,maxVertexTextures:d,maxTextureSize:e.getParameter(e.MAX_TEXTURE_SIZE),maxCubemapSize:e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:e.getParameter(e.MAX_VERTEX_ATTRIBS),maxVertexUniforms:e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:e.getParameter(e.MAX_VARYING_VECTORS),maxFragmentUniforms:e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),vertexTextures:d>0,maxSamples:e.getParameter(e.MAX_SAMPLES)}}function fo(e){let t=this,n=null,r=0,i=!1,a=!1,o=new ga,s=new gn,c={value:null,needsUpdate:!1};function l(e,n,r,i){let a=e===null?0:e.length,l=null;if(a!==0){if(l=c.value,!0!==i||l===null){let t=r+4*a,i=n.matrixWorldInverse;s.getNormalMatrix(i),(l===null||l.length0),t.numPlanes=r,t.numIntersection=0}();else{let e=a?0:r,t=4*e,i=m.clippingState||null;c.value=i,i=l(d,s,t,u);for(let e=0;e!==t;++e)i[e]=n[e];m.clippingState=i,this.numIntersection=f?this.numPlanes:0,this.numPlanes+=e}}}function po(e){let t=new WeakMap;function n(e,t){return t===ye?e.mapping=_e:t===304&&(e.mapping=ve),e}function r(e){let n=e.target;n.removeEventListener(`dispose`,r);let i=t.get(n);i!==void 0&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){let a=i.mapping;if(a===ye||a===304){if(t.has(i))return n(t.get(i).texture,i.mapping);{let a=i.image;if(a&&a.height>0){let o=new Qi(a.height);return o.fromEquirectangularTexture(e,i),t.set(i,o),i.addEventListener(`dispose`,r),n(o.texture,i.mapping)}return null}}}return i},dispose:function(){t=new WeakMap}}}var mo=[.125,.215,.35,.446,.526,.582],ho=20,go=new Ja,_o=new ni,vo=null,yo=0,bo=0,xo=!1,So=new P,Co=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,n=.1,r=100,i={}){let{size:a=256,position:o=So}=i;vo=this._renderer.getRenderTarget(),yo=this._renderer.getActiveCubeFace(),bo=this._renderer.getActiveMipmapLevel(),xo=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);let s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,r,s,o),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Do(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Eo(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=2**this._lodMax}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;ee-4?s=mo[o-e+4-1]:o===0&&(s=0),n.push(s);let c=1/(a-2),l=-c,u=1+c,d=[l,l,u,l,u,u,l,l,u,u,l,u],f=new Float32Array(108),p=new Float32Array(72),m=new Float32Array(36);for(let e=0;e<6;e++){let t=e%3*2/3-1,n=e>2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];f.set(r,18*e),p.set(d,12*e);let i=[e,e,e,e,e,e];m.set(i,6*e)}let h=new wi;h.setAttribute(`position`,new pi(f,3)),h.setAttribute(`uv`,new pi(p,2)),h.setAttribute(`faceIndex`,new pi(m,1)),r.push(new Ii(h,null)),i>4&&i--}return{lodMeshes:r,sizeLods:t,sigmas:n}}(r)),this._blurMaterial=function(e,t,n){let r=new Float32Array(ho),i=new P(0,1,0);return new Ui({name:`SphericalGaussianBlur`,defines:{n:ho,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Oo(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:0,depthTest:!1,depthWrite:!1})}(r,e,t)}return r}_compileMaterial(e){let t=new Ii(new wi,e);this._renderer.compile(t,go)}_sceneToCubeUV(e,t,n,r,i){let a=new Ji(90,1,t,n),o=[1,-1,1,1,1,1],s=[1,1,1,-1,-1,-1],c=this._renderer,l=c.autoClear,u=c.toneMapping;c.getClearColor(_o),c.toneMapping=0,c.autoClear=!1,c.state.buffers.depth.getReversed()&&(c.setRenderTarget(r),c.clearDepth(),c.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new Ii(new Ri,new oi({name:`PMREM.Background`,side:1,depthWrite:!1,depthTest:!1})));let d=this._backgroundBox,f=d.material,p=!1,m=e.background;m?m.isColor&&(f.color.copy(m),e.background=null,p=!0):(f.color.copy(_o),p=!0);for(let t=0;t<6;t++){let n=t%3;n===0?(a.up.set(0,o[t],0),a.position.set(i.x,i.y,i.z),a.lookAt(i.x+s[t],i.y,i.z)):n===1?(a.up.set(0,0,o[t]),a.position.set(i.x,i.y,i.z),a.lookAt(i.x,i.y+s[t],i.z)):(a.up.set(0,o[t],0),a.position.set(i.x,i.y,i.z),a.lookAt(i.x,i.y,i.z+s[t]));let l=this._cubeSize;To(r,n*l,t>2?l:0,l,l),c.setRenderTarget(r),p&&c.render(d,a),c.render(e,a)}c.toneMapping=u,c.autoClear=l,e.background=m}_textureToCubeUV(e,t){let n=this._renderer,r=e.mapping===_e||e.mapping===ve;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=Do()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Eo());let i=r?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=i,i.uniforms.envMap.value=e;let o=this._cubeSize;To(t,0,0,3*o,2*o),n.setRenderTarget(t),n.render(a,go)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;let r=this._lodMeshes.length;for(let t=1;t + + #define PI 3.14159265359 + + // Van der Corput radical inverse + float radicalInverse_VdC(uint bits) { + bits = (bits << 16u) | (bits >> 16u); + bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u); + bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u); + bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u); + bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u); + return float(bits) * 2.3283064365386963e-10; // / 0x100000000 + } + + // Hammersley sequence + vec2 hammersley(uint i, uint N) { + return vec2(float(i) / float(N), radicalInverse_VdC(i)); + } + + // GGX VNDF importance sampling (Eric Heitz 2018) + // "Sampling the GGX Distribution of Visible Normals" + // https://jcgt.org/published/0007/04/01/ + vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) { + float alpha = roughness * roughness; + + // Section 3.2: Transform view direction to hemisphere configuration + vec3 Vh = normalize(vec3(alpha * V.x, alpha * V.y, V.z)); + + // Section 4.1: Orthonormal basis + float lensq = Vh.x * Vh.x + Vh.y * Vh.y; + vec3 T1 = lensq > 0.0 ? vec3(-Vh.y, Vh.x, 0.0) / sqrt(lensq) : vec3(1.0, 0.0, 0.0); + vec3 T2 = cross(Vh, T1); + + // Section 4.2: Parameterization of projected area + float r = sqrt(Xi.x); + float phi = 2.0 * PI * Xi.y; + float t1 = r * cos(phi); + float t2 = r * sin(phi); + float s = 0.5 * (1.0 + Vh.z); + t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2; + + // Section 4.3: Reprojection onto hemisphere + vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * Vh; + + // Section 3.4: Transform back to ellipsoid configuration + return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z))); + } + + void main() { + vec3 N = normalize(vOutputDirection); + vec3 V = N; // Assume view direction equals normal for pre-filtering + + vec3 prefilteredColor = vec3(0.0); + float totalWeight = 0.0; + + // For very low roughness, just sample the environment directly + if (roughness < 0.001) { + gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0); + return; + } + + // Tangent space basis for VNDF sampling + vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); + vec3 tangent = normalize(cross(up, N)); + vec3 bitangent = cross(N, tangent); + + for(uint i = 0u; i < uint(GGX_SAMPLES); i++) { + vec2 Xi = hammersley(i, uint(GGX_SAMPLES)); + + // For PMREM, V = N, so in tangent space V is always (0, 0, 1) + vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness); + + // Transform H back to world space + vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z); + vec3 L = normalize(2.0 * dot(V, H) * H - V); + + float NdotL = max(dot(N, L), 0.0); + + if(NdotL > 0.0) { + // Sample environment at fixed mip level + // VNDF importance sampling handles the distribution filtering + vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt); + + // Weight by NdotL for the split-sum approximation + // VNDF PDF naturally accounts for the visible microfacet distribution + prefilteredColor += sampleColor * NdotL; + totalWeight += NdotL; + } + } + + if (totalWeight > 0.0) { + prefilteredColor = prefilteredColor / totalWeight; + } + + gl_FragColor = vec4(prefilteredColor, 1.0); + } + `,blending:0,depthTest:!1,depthWrite:!1})}(this._lodMax,e,t)}let a=this._ggxMaterial,o=this._lodMeshes[n];o.material=a;let s=a.uniforms,c=n/(this._lodMeshes.length-1),l=t/(this._lodMeshes.length-1),u=Math.sqrt(c*c-l*l)*(.05+.95*c),{_lodMax:d}=this,f=this._sizeLods[n],p=3*f*(n>d-4?n-d+4:0),m=4*(this._cubeSize-f);s.envMap.value=e.texture,s.roughness.value=u,s.mipInt.value=d-t,To(i,p,m,3*f,2*f),r.setRenderTarget(i),r.render(o,go),s.envMap.value=i.texture,s.roughness.value=0,s.mipInt.value=d-n,To(e,p,m,3*f,2*f),r.setRenderTarget(e),r.render(o,go)}_blur(e,t,n,r,i){let a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,r,`latitudinal`,i),this._halfBlur(a,e,n,n,r,`longitudinal`,i)}_halfBlur(e,t,n,r,i,a,o){let s=this._renderer,c=this._blurMaterial;a!==`latitudinal`&&a!==`longitudinal`&&Zt(`blur direction must be either latitudinal or longitudinal!`);let l=this._lodMeshes[r];l.material=c;let u=c.uniforms,d=this._sizeLods[n]-1,f=isFinite(i)?Math.PI/(2*d):2*Math.PI/39,p=i/f,m=isFinite(i)?1+Math.floor(3*p):ho;m>ho&&Xt(`sigmaRadians, ${i}, is too large and will clip, as it requested ${m} samples when the maximum is set to 20`);let h=[],g=0;for(let e=0;e_-4?r-_+4:0),4*(this._cubeSize-v),3*v,2*v),s.setRenderTarget(t),s.render(l,go)}};function wo(e,t,n){let r=new Pn(e,t,n);return r.texture.mapping=be,r.texture.name=`PMREM.cubeUv`,r.scissorTest=!0,r}function To(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function Eo(){return new Ui({name:`EquirectangularToCubeUV`,uniforms:{envMap:{value:null}},vertexShader:Oo(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:0,depthTest:!1,depthWrite:!1})}function Do(){return new Ui({name:`CubemapToCubeUV`,uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Oo(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:0,depthTest:!1,depthWrite:!1})}function Oo(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}function ko(e){let t=new WeakMap,n=null;function r(e){let n=e.target;n.removeEventListener(`dispose`,r);let i=t.get(n);i!==void 0&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){let a=i.mapping,o=a===ye||a===304,s=a===_e||a===ve;if(o||s){let a=t.get(i),c=a===void 0?0:a.texture.pmremVersion;if(i.isRenderTargetTexture&&i.pmremVersion!==c)return n===null&&(n=new Co(e)),a=o?n.fromEquirectangular(i,a):n.fromCubemap(i,a),a.texture.pmremVersion=i.pmremVersion,t.set(i,a),a.texture;if(a!==void 0)return a.texture;{let c=i.image;return o&&c&&c.height>0||s&&c&&function(e){let t=0;for(let n=0;n<6;n++)e[n]!==void 0&&t++;return t===6}(c)?(n===null&&(n=new Co(e)),a=o?n.fromEquirectangular(i):n.fromCubemap(i),a.texture.pmremVersion=i.pmremVersion,t.set(i,a),i.addEventListener(`dispose`,r),a.texture):null}}}return i},dispose:function(){t=new WeakMap,n!==null&&(n.dispose(),n=null)}}}function Ao(e){let t={};function n(n){if(t[n]!==void 0)return t[n];let r=e.getExtension(n);return t[n]=r,r}return{has:function(e){return n(e)!==null},init:function(){n(`EXT_color_buffer_float`),n(`WEBGL_clip_cull_distance`),n(`OES_texture_float_linear`),n(`EXT_color_buffer_half_float`),n(`WEBGL_multisampled_render_to_texture`),n(`WEBGL_render_shared_exponent`)},get:function(e){let t=n(e);return t===null&&Qt(`WebGLRenderer: `+e+` extension not supported.`),t}}}function jo(e,t,n,r){let i={},a=new WeakMap;function o(e){let s=e.target;s.index!==null&&t.remove(s.index);for(let e in s.attributes)t.remove(s.attributes[e]);s.removeEventListener(`dispose`,o),delete i[s.id];let c=a.get(s);c&&(t.remove(c),a.delete(s)),r.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(e){let n=[],r=e.index,i=e.attributes.position,o=0;if(r!==null){let e=r.array;o=r.version;for(let t=0,r=e.length;tt.maxTextureSize&&(m=Math.ceil(p/t.maxTextureSize),p=t.maxTextureSize);let h=new Float32Array(p*m*4*u),g=new Fn(h,p,m,u);g.type=Ie,g.needsUpdate=!0;let _=4*f;for(let t=0;t0)return e;let i=t*n,a=Vo[i];if(a===void 0&&(a=new Float32Array(i),Vo[i]=a),t!==0){r.toArray(a,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(a,i)}return a}function qo(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n`:` `} ${i}: ${n[e]}`)}return r.join(` +`)}(e.getShaderSource(t),r)}return i}function Gs(e,t){let n=function(e){xn._getMatrix(Us,xn.workingColorSpace,e);let t=`mat3( ${Us.elements.map(e=>e.toFixed(4))} )`;switch(xn.getTransfer(e)){case jt:return[t,`LinearTransferOETF`];case Mt:return[t,`sRGBTransferOETF`];default:return Xt(`WebGLProgram: Unsupported color space: `,e),[t,`LinearTransferOETF`]}}(t);return[`vec4 ${e}( vec4 value ) {`,`\treturn ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,`}`].join(` +`)}function Ks(e,t){let n;switch(t){case 1:n=`Linear`;break;case 2:n=`Reinhard`;break;case 3:n=`Cineon`;break;case 4:n=`ACESFilmic`;break;case 6:n=`AgX`;break;case 7:n=`Neutral`;break;case 5:n=`Custom`;break;default:Xt(`WebGLProgram: Unsupported toneMapping:`,t),n=`Linear`}return`vec3 `+e+`( vec3 color ) { return `+n+`ToneMapping( color ); }`}var qs=new P;function Js(){return xn.getLuminanceCoefficients(qs),[`float luminance( const in vec3 rgb ) {`,`\tconst vec3 weights = vec3( ${qs.x.toFixed(4)}, ${qs.y.toFixed(4)}, ${qs.z.toFixed(4)} );`,` return dot( weights, rgb );`,`}`].join(` +`)}function Ys(e){return e!==``}function Xs(e,t){let n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function Zs(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var Qs=/^[ \t]*#include +<([\w\d./]+)>/gm;function $s(e){return e.replace(Qs,tc)}var ec=new Map;function tc(e,t){let n=to[t];if(n===void 0){let e=ec.get(t);if(e===void 0)throw Error(`Can not resolve #include <`+t+`>`);n=to[e],Xt(`WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.`,t,e)}return $s(n)}var nc=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function rc(e){return e.replace(nc,ic)}function ic(e,t,n,r){let i=``;for(let e=parseInt(t);e0&&(g+=` +`),_=[`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m].filter(Ys).join(` +`),_.length>0&&(_+=` +`)):(g=[ac(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m,n.extensionClipCullDistance?`#define USE_CLIP_DISTANCE`:``,n.batching?`#define USE_BATCHING`:``,n.batchingColor?`#define USE_BATCHING_COLOR`:``,n.instancing?`#define USE_INSTANCING`:``,n.instancingColor?`#define USE_INSTANCING_COLOR`:``,n.instancingMorph?`#define USE_INSTANCING_MORPH`:``,n.useFog&&n.fog?`#define USE_FOG`:``,n.useFog&&n.fogExp2?`#define FOG_EXP2`:``,n.map?`#define USE_MAP`:``,n.envMap?`#define USE_ENVMAP`:``,n.envMap?`#define `+u:``,n.lightMap?`#define USE_LIGHTMAP`:``,n.aoMap?`#define USE_AOMAP`:``,n.bumpMap?`#define USE_BUMPMAP`:``,n.normalMap?`#define USE_NORMALMAP`:``,n.normalMapObjectSpace?`#define USE_NORMALMAP_OBJECTSPACE`:``,n.normalMapTangentSpace?`#define USE_NORMALMAP_TANGENTSPACE`:``,n.displacementMap?`#define USE_DISPLACEMENTMAP`:``,n.emissiveMap?`#define USE_EMISSIVEMAP`:``,n.anisotropy?`#define USE_ANISOTROPY`:``,n.anisotropyMap?`#define USE_ANISOTROPYMAP`:``,n.clearcoatMap?`#define USE_CLEARCOATMAP`:``,n.clearcoatRoughnessMap?`#define USE_CLEARCOAT_ROUGHNESSMAP`:``,n.clearcoatNormalMap?`#define USE_CLEARCOAT_NORMALMAP`:``,n.iridescenceMap?`#define USE_IRIDESCENCEMAP`:``,n.iridescenceThicknessMap?`#define USE_IRIDESCENCE_THICKNESSMAP`:``,n.specularMap?`#define USE_SPECULARMAP`:``,n.specularColorMap?`#define USE_SPECULAR_COLORMAP`:``,n.specularIntensityMap?`#define USE_SPECULAR_INTENSITYMAP`:``,n.roughnessMap?`#define USE_ROUGHNESSMAP`:``,n.metalnessMap?`#define USE_METALNESSMAP`:``,n.alphaMap?`#define USE_ALPHAMAP`:``,n.alphaHash?`#define USE_ALPHAHASH`:``,n.transmission?`#define USE_TRANSMISSION`:``,n.transmissionMap?`#define USE_TRANSMISSIONMAP`:``,n.thicknessMap?`#define USE_THICKNESSMAP`:``,n.sheenColorMap?`#define USE_SHEEN_COLORMAP`:``,n.sheenRoughnessMap?`#define USE_SHEEN_ROUGHNESSMAP`:``,n.mapUv?`#define MAP_UV `+n.mapUv:``,n.alphaMapUv?`#define ALPHAMAP_UV `+n.alphaMapUv:``,n.lightMapUv?`#define LIGHTMAP_UV `+n.lightMapUv:``,n.aoMapUv?`#define AOMAP_UV `+n.aoMapUv:``,n.emissiveMapUv?`#define EMISSIVEMAP_UV `+n.emissiveMapUv:``,n.bumpMapUv?`#define BUMPMAP_UV `+n.bumpMapUv:``,n.normalMapUv?`#define NORMALMAP_UV `+n.normalMapUv:``,n.displacementMapUv?`#define DISPLACEMENTMAP_UV `+n.displacementMapUv:``,n.metalnessMapUv?`#define METALNESSMAP_UV `+n.metalnessMapUv:``,n.roughnessMapUv?`#define ROUGHNESSMAP_UV `+n.roughnessMapUv:``,n.anisotropyMapUv?`#define ANISOTROPYMAP_UV `+n.anisotropyMapUv:``,n.clearcoatMapUv?`#define CLEARCOATMAP_UV `+n.clearcoatMapUv:``,n.clearcoatNormalMapUv?`#define CLEARCOAT_NORMALMAP_UV `+n.clearcoatNormalMapUv:``,n.clearcoatRoughnessMapUv?`#define CLEARCOAT_ROUGHNESSMAP_UV `+n.clearcoatRoughnessMapUv:``,n.iridescenceMapUv?`#define IRIDESCENCEMAP_UV `+n.iridescenceMapUv:``,n.iridescenceThicknessMapUv?`#define IRIDESCENCE_THICKNESSMAP_UV `+n.iridescenceThicknessMapUv:``,n.sheenColorMapUv?`#define SHEEN_COLORMAP_UV `+n.sheenColorMapUv:``,n.sheenRoughnessMapUv?`#define SHEEN_ROUGHNESSMAP_UV `+n.sheenRoughnessMapUv:``,n.specularMapUv?`#define SPECULARMAP_UV `+n.specularMapUv:``,n.specularColorMapUv?`#define SPECULAR_COLORMAP_UV `+n.specularColorMapUv:``,n.specularIntensityMapUv?`#define SPECULAR_INTENSITYMAP_UV `+n.specularIntensityMapUv:``,n.transmissionMapUv?`#define TRANSMISSIONMAP_UV `+n.transmissionMapUv:``,n.thicknessMapUv?`#define THICKNESSMAP_UV `+n.thicknessMapUv:``,n.vertexTangents&&!1===n.flatShading?`#define USE_TANGENT`:``,n.vertexColors?`#define USE_COLOR`:``,n.vertexAlphas?`#define USE_COLOR_ALPHA`:``,n.vertexUv1s?`#define USE_UV1`:``,n.vertexUv2s?`#define USE_UV2`:``,n.vertexUv3s?`#define USE_UV3`:``,n.pointsUvs?`#define USE_POINTS_UV`:``,n.flatShading?`#define FLAT_SHADED`:``,n.skinning?`#define USE_SKINNING`:``,n.morphTargets?`#define USE_MORPHTARGETS`:``,n.morphNormals&&!1===n.flatShading?`#define USE_MORPHNORMALS`:``,n.morphColors?`#define USE_MORPHCOLORS`:``,n.morphTargetsCount>0?`#define MORPHTARGETS_TEXTURE_STRIDE `+n.morphTextureStride:``,n.morphTargetsCount>0?`#define MORPHTARGETS_COUNT `+n.morphTargetsCount:``,n.doubleSided?`#define DOUBLE_SIDED`:``,n.flipSided?`#define FLIP_SIDED`:``,n.shadowMapEnabled?`#define USE_SHADOWMAP`:``,n.shadowMapEnabled?`#define `+c:``,n.sizeAttenuation?`#define USE_SIZEATTENUATION`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.logarithmicDepthBuffer?`#define USE_LOGARITHMIC_DEPTH_BUFFER`:``,n.reversedDepthBuffer?`#define USE_REVERSED_DEPTH_BUFFER`:``,`uniform mat4 modelMatrix;`,`uniform mat4 modelViewMatrix;`,`uniform mat4 projectionMatrix;`,`uniform mat4 viewMatrix;`,`uniform mat3 normalMatrix;`,`uniform vec3 cameraPosition;`,`uniform bool isOrthographic;`,`#ifdef USE_INSTANCING`,` attribute mat4 instanceMatrix;`,`#endif`,`#ifdef USE_INSTANCING_COLOR`,` attribute vec3 instanceColor;`,`#endif`,`#ifdef USE_INSTANCING_MORPH`,` uniform sampler2D morphTexture;`,`#endif`,`attribute vec3 position;`,`attribute vec3 normal;`,`attribute vec2 uv;`,`#ifdef USE_UV1`,` attribute vec2 uv1;`,`#endif`,`#ifdef USE_UV2`,` attribute vec2 uv2;`,`#endif`,`#ifdef USE_UV3`,` attribute vec2 uv3;`,`#endif`,`#ifdef USE_TANGENT`,` attribute vec4 tangent;`,`#endif`,`#if defined( USE_COLOR_ALPHA )`,` attribute vec4 color;`,`#elif defined( USE_COLOR )`,` attribute vec3 color;`,`#endif`,`#ifdef USE_SKINNING`,` attribute vec4 skinIndex;`,` attribute vec4 skinWeight;`,`#endif`,` +`].filter(Ys).join(` +`),_=[ac(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m,n.useFog&&n.fog?`#define USE_FOG`:``,n.useFog&&n.fogExp2?`#define FOG_EXP2`:``,n.alphaToCoverage?`#define ALPHA_TO_COVERAGE`:``,n.map?`#define USE_MAP`:``,n.matcap?`#define USE_MATCAP`:``,n.envMap?`#define USE_ENVMAP`:``,n.envMap?`#define `+l:``,n.envMap?`#define `+u:``,n.envMap?`#define `+d:``,f?`#define CUBEUV_TEXEL_WIDTH `+f.texelWidth:``,f?`#define CUBEUV_TEXEL_HEIGHT `+f.texelHeight:``,f?`#define CUBEUV_MAX_MIP `+f.maxMip+`.0`:``,n.lightMap?`#define USE_LIGHTMAP`:``,n.aoMap?`#define USE_AOMAP`:``,n.bumpMap?`#define USE_BUMPMAP`:``,n.normalMap?`#define USE_NORMALMAP`:``,n.normalMapObjectSpace?`#define USE_NORMALMAP_OBJECTSPACE`:``,n.normalMapTangentSpace?`#define USE_NORMALMAP_TANGENTSPACE`:``,n.emissiveMap?`#define USE_EMISSIVEMAP`:``,n.anisotropy?`#define USE_ANISOTROPY`:``,n.anisotropyMap?`#define USE_ANISOTROPYMAP`:``,n.clearcoat?`#define USE_CLEARCOAT`:``,n.clearcoatMap?`#define USE_CLEARCOATMAP`:``,n.clearcoatRoughnessMap?`#define USE_CLEARCOAT_ROUGHNESSMAP`:``,n.clearcoatNormalMap?`#define USE_CLEARCOAT_NORMALMAP`:``,n.dispersion?`#define USE_DISPERSION`:``,n.iridescence?`#define USE_IRIDESCENCE`:``,n.iridescenceMap?`#define USE_IRIDESCENCEMAP`:``,n.iridescenceThicknessMap?`#define USE_IRIDESCENCE_THICKNESSMAP`:``,n.specularMap?`#define USE_SPECULARMAP`:``,n.specularColorMap?`#define USE_SPECULAR_COLORMAP`:``,n.specularIntensityMap?`#define USE_SPECULAR_INTENSITYMAP`:``,n.roughnessMap?`#define USE_ROUGHNESSMAP`:``,n.metalnessMap?`#define USE_METALNESSMAP`:``,n.alphaMap?`#define USE_ALPHAMAP`:``,n.alphaTest?`#define USE_ALPHATEST`:``,n.alphaHash?`#define USE_ALPHAHASH`:``,n.sheen?`#define USE_SHEEN`:``,n.sheenColorMap?`#define USE_SHEEN_COLORMAP`:``,n.sheenRoughnessMap?`#define USE_SHEEN_ROUGHNESSMAP`:``,n.transmission?`#define USE_TRANSMISSION`:``,n.transmissionMap?`#define USE_TRANSMISSIONMAP`:``,n.thicknessMap?`#define USE_THICKNESSMAP`:``,n.vertexTangents&&!1===n.flatShading?`#define USE_TANGENT`:``,n.vertexColors||n.instancingColor||n.batchingColor?`#define USE_COLOR`:``,n.vertexAlphas?`#define USE_COLOR_ALPHA`:``,n.vertexUv1s?`#define USE_UV1`:``,n.vertexUv2s?`#define USE_UV2`:``,n.vertexUv3s?`#define USE_UV3`:``,n.pointsUvs?`#define USE_POINTS_UV`:``,n.gradientMap?`#define USE_GRADIENTMAP`:``,n.flatShading?`#define FLAT_SHADED`:``,n.doubleSided?`#define DOUBLE_SIDED`:``,n.flipSided?`#define FLIP_SIDED`:``,n.shadowMapEnabled?`#define USE_SHADOWMAP`:``,n.shadowMapEnabled?`#define `+c:``,n.premultipliedAlpha?`#define PREMULTIPLIED_ALPHA`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.decodeVideoTexture?`#define DECODE_VIDEO_TEXTURE`:``,n.decodeVideoTextureEmissive?`#define DECODE_VIDEO_TEXTURE_EMISSIVE`:``,n.logarithmicDepthBuffer?`#define USE_LOGARITHMIC_DEPTH_BUFFER`:``,n.reversedDepthBuffer?`#define USE_REVERSED_DEPTH_BUFFER`:``,`uniform mat4 viewMatrix;`,`uniform vec3 cameraPosition;`,`uniform bool isOrthographic;`,n.toneMapping===0?``:`#define TONE_MAPPING`,n.toneMapping===0?``:to.tonemapping_pars_fragment,n.toneMapping===0?``:Ks(`toneMapping`,n.toneMapping),n.dithering?`#define DITHERING`:``,n.opaque?`#define OPAQUE`:``,to.colorspace_pars_fragment,Gs(`linearToOutputTexel`,n.outputColorSpace),Js(),n.useDepthPacking?`#define DEPTH_PACKING `+n.depthPacking:``,` +`].filter(Ys).join(` +`)),o=$s(o),o=Xs(o,n),o=Zs(o,n),s=$s(s),s=Xs(s,n),s=Zs(s,n),o=rc(o),s=rc(s),!0!==n.isRawShaderMaterial&&(v=`#version 300 es +`,g=[p,`#define attribute in`,`#define varying out`,`#define texture2D texture`].join(` +`)+` +`+g,_=[`#define varying in`,n.glslVersion===Ht?``:`layout(location = 0) out highp vec4 pc_fragColor;`,n.glslVersion===Ht?``:`#define gl_FragColor pc_fragColor`,`#define gl_FragDepthEXT gl_FragDepth`,`#define texture2D texture`,`#define textureCube texture`,`#define texture2DProj textureProj`,`#define texture2DLodEXT textureLod`,`#define texture2DProjLodEXT textureProjLod`,`#define textureCubeLodEXT textureLod`,`#define texture2DGradEXT textureGrad`,`#define texture2DProjGradEXT textureProjGrad`,`#define textureCubeGradEXT textureGrad`].join(` +`)+` +`+_);let y=v+g+o,b=v+_+s,x=Vs(i,i.VERTEX_SHADER,y),S=Vs(i,i.FRAGMENT_SHADER,b);function C(t){if(e.debug.checkShaderErrors){let n=i.getProgramInfoLog(h)||``,r=i.getShaderInfoLog(x)||``,a=i.getShaderInfoLog(S)||``,o=n.trim(),s=r.trim(),c=a.trim(),l=!0,u=!0;if(!1===i.getProgramParameter(h,i.LINK_STATUS))if(l=!1,typeof e.debug.onShaderError==`function`)e.debug.onShaderError(i,h,x,S);else{let e=Ws(i,x,`vertex`),n=Ws(i,S,`fragment`);Zt(`THREE.WebGLProgram: Shader Error `+i.getError()+` - VALIDATE_STATUS `+i.getProgramParameter(h,i.VALIDATE_STATUS)+` + +Material Name: `+t.name+` +Material Type: `+t.type+` + +Program Info Log: `+o+` +`+e+` +`+n)}else o===``?s!==``&&c!==``||(u=!1):Xt(`WebGLProgram: Program Info Log:`,o);u&&(t.diagnostics={runnable:l,programLog:o,vertexShader:{log:s,prefix:g},fragmentShader:{log:c,prefix:_}})}i.deleteShader(x),i.deleteShader(S),w=new Bs(i,h),T=function(e,t){let n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i0,me=a.clearcoat>0,he=a.dispersion>0,ge=a.iridescence>0,_e=a.sheen>0,ve=a.transmission>0,ye=pe&&!!a.anisotropyMap,xe=me&&!!a.clearcoatMap,Se=me&&!!a.clearcoatNormalMap,Ce=me&&!!a.clearcoatRoughnessMap,we=ge&&!!a.iridescenceMap,Te=ge&&!!a.iridescenceThicknessMap,Ee=_e&&!!a.sheenColorMap,De=_e&&!!a.sheenRoughnessMap,Oe=!!a.specularMap,ke=!!a.specularColorMap,Ae=!!a.specularIntensityMap,je=ve&&!!a.transmissionMap,Me=ve&&!!a.thicknessMap,Ne=!!a.gradientMap,Pe=!!a.alphaMap,Fe=a.alphaTest>0,Ie=!!a.alphaHash,Le=!!a.extensions,Re=0;a.toneMapped&&(ee!==null&&!0!==ee.isXRRenderTarget||(Re=e.toneMapping));let ze={shaderID:C,shaderType:a.type,shaderName:a.name,vertexShader:E,fragmentShader:D,defines:a.defines,customVertexShaderID:O,customFragmentShaderID:k,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:p,batching:j,batchingColor:j&&_._colorsTexture!==null,instancing:ne,instancingColor:ne&&_.instanceColor!==null,instancingMorph:ne&&_.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:ee===null?e.outputColorSpace:!0===ee.isXRRenderTarget?ee.texture.colorSpace:At,alphaToCoverage:!!a.alphaToCoverage,map:re,matcap:M,envMap:ie,envMapMode:ie&&x.mapping,envMapCubeUVHeight:S,aoMap:ae,lightMap:oe,bumpMap:se,normalMap:ce,displacementMap:f&&le,emissiveMap:ue,normalMapObjectSpace:ce&&a.normalMapType===1,normalMapTangentSpace:ce&&a.normalMapType===0,metalnessMap:de,roughnessMap:fe,anisotropy:pe,anisotropyMap:ye,clearcoat:me,clearcoatMap:xe,clearcoatNormalMap:Se,clearcoatRoughnessMap:Ce,dispersion:he,iridescence:ge,iridescenceMap:we,iridescenceThicknessMap:Te,sheen:_e,sheenColorMap:Ee,sheenRoughnessMap:De,specularMap:Oe,specularColorMap:ke,specularIntensityMap:Ae,transmission:ve,transmissionMap:je,thicknessMap:Me,gradientMap:Ne,opaque:!1===a.transparent&&a.blending===1&&!1===a.alphaToCoverage,alphaMap:Pe,alphaTest:Fe,alphaHash:Ie,combine:a.combine,mapUv:re&&h(a.map.channel),aoMapUv:ae&&h(a.aoMap.channel),lightMapUv:oe&&h(a.lightMap.channel),bumpMapUv:se&&h(a.bumpMap.channel),normalMapUv:ce&&h(a.normalMap.channel),displacementMapUv:le&&h(a.displacementMap.channel),emissiveMapUv:ue&&h(a.emissiveMap.channel),metalnessMapUv:de&&h(a.metalnessMap.channel),roughnessMapUv:fe&&h(a.roughnessMap.channel),anisotropyMapUv:ye&&h(a.anisotropyMap.channel),clearcoatMapUv:xe&&h(a.clearcoatMap.channel),clearcoatNormalMapUv:Se&&h(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ce&&h(a.clearcoatRoughnessMap.channel),iridescenceMapUv:we&&h(a.iridescenceMap.channel),iridescenceThicknessMapUv:Te&&h(a.iridescenceThicknessMap.channel),sheenColorMapUv:Ee&&h(a.sheenColorMap.channel),sheenRoughnessMapUv:De&&h(a.sheenRoughnessMap.channel),specularMapUv:Oe&&h(a.specularMap.channel),specularColorMapUv:ke&&h(a.specularColorMap.channel),specularIntensityMapUv:Ae&&h(a.specularIntensityMap.channel),transmissionMapUv:je&&h(a.transmissionMap.channel),thicknessMapUv:Me&&h(a.thicknessMap.channel),alphaMapUv:Pe&&h(a.alphaMap.channel),vertexTangents:!!y.attributes.tangent&&(ce||pe),vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!y.attributes.color&&y.attributes.color.itemSize===4,pointsUvs:!0===_.isPoints&&!!y.attributes.uv&&(re||Pe),fog:!!v,useFog:!0===a.fog,fogExp2:!!v&&v.isFogExp2,flatShading:!0===a.flatShading&&!1===a.wireframe,sizeAttenuation:!0===a.sizeAttenuation,logarithmicDepthBuffer:d,reversedDepthBuffer:te,skinning:!0===_.isSkinnedMesh,morphTargets:y.morphAttributes.position!==void 0,morphNormals:y.morphAttributes.normal!==void 0,morphColors:y.morphAttributes.color!==void 0,morphTargetsCount:T,morphTextureStride:A,numDirLights:s.directional.length,numPointLights:s.point.length,numSpotLights:s.spot.length,numSpotLightMaps:s.spotLightMap.length,numRectAreaLights:s.rectArea.length,numHemiLights:s.hemi.length,numDirLightShadows:s.directionalShadowMap.length,numPointLightShadows:s.pointShadowMap.length,numSpotLightShadows:s.spotShadowMap.length,numSpotLightShadowsWithMaps:s.numSpotLightShadowsWithMaps,numLightProbes:s.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:a.dithering,shadowMapEnabled:e.shadowMap.enabled&&u.length>0,shadowMapType:e.shadowMap.type,toneMapping:Re,decodeVideoTexture:re&&!0===a.map.isVideoTexture&&xn.getTransfer(a.map.colorSpace)===Mt,decodeVideoTextureEmissive:ue&&!0===a.emissiveMap.isVideoTexture&&xn.getTransfer(a.emissiveMap.colorSpace)===Mt,premultipliedAlpha:a.premultipliedAlpha,doubleSided:a.side===2,flipSided:a.side===1,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionClipCullDistance:Le&&!0===a.extensions.clipCullDistance&&r.has(`WEBGL_clip_cull_distance`),extensionMultiDraw:(Le&&!0===a.extensions.multiDraw||j)&&r.has(`WEBGL_multi_draw`),rendererExtensionParallelShaderCompile:r.has(`KHR_parallel_shader_compile`),customProgramCacheKey:a.customProgramCacheKey()};return ze.vertexUv1s=l.has(1),ze.vertexUv2s=l.has(2),ze.vertexUv3s=l.has(3),l.clear(),ze},getProgramCacheKey:function(t){let n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),t.defines!==void 0)for(let e in t.defines)n.push(e),n.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(function(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}(n,t),function(e,t){s.disableAll(),t.supportsVertexTextures&&s.enable(0),t.instancing&&s.enable(1),t.instancingColor&&s.enable(2),t.instancingMorph&&s.enable(3),t.matcap&&s.enable(4),t.envMap&&s.enable(5),t.normalMapObjectSpace&&s.enable(6),t.normalMapTangentSpace&&s.enable(7),t.clearcoat&&s.enable(8),t.iridescence&&s.enable(9),t.alphaTest&&s.enable(10),t.vertexColors&&s.enable(11),t.vertexAlphas&&s.enable(12),t.vertexUv1s&&s.enable(13),t.vertexUv2s&&s.enable(14),t.vertexUv3s&&s.enable(15),t.vertexTangents&&s.enable(16),t.anisotropy&&s.enable(17),t.alphaHash&&s.enable(18),t.batching&&s.enable(19),t.dispersion&&s.enable(20),t.batchingColor&&s.enable(21),t.gradientMap&&s.enable(22),e.push(s.mask),s.disableAll(),t.fog&&s.enable(0),t.useFog&&s.enable(1),t.flatShading&&s.enable(2),t.logarithmicDepthBuffer&&s.enable(3),t.reversedDepthBuffer&&s.enable(4),t.skinning&&s.enable(5),t.morphTargets&&s.enable(6),t.morphNormals&&s.enable(7),t.morphColors&&s.enable(8),t.premultipliedAlpha&&s.enable(9),t.shadowMapEnabled&&s.enable(10),t.doubleSided&&s.enable(11),t.flipSided&&s.enable(12),t.useDepthPacking&&s.enable(13),t.dithering&&s.enable(14),t.transmission&&s.enable(15),t.sheen&&s.enable(16),t.opaque&&s.enable(17),t.pointsUvs&&s.enable(18),t.decodeVideoTexture&&s.enable(19),t.decodeVideoTextureEmissive&&s.enable(20),t.alphaToCoverage&&s.enable(21),e.push(s.mask)}(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()},getUniforms:function(e){let t=m[e.type],n;if(t){let e=ro[t];n=Hi.clone(e.uniforms)}else n=e.uniforms;return n},acquireProgram:function(t,n){let r;for(let e=0,t=u.length;e0?r.push(u):!0===o.transparent?i.push(u):n.push(u)},unshift:function(e,t,o,s,c,l){let u=a(e,t,o,s,c,l);o.transmission>0?r.unshift(u):!0===o.transparent?i.unshift(u):n.unshift(u)},finish:function(){for(let n=t,r=e.length;n1&&n.sort(e||fc),r.length>1&&r.sort(t||pc),i.length>1&&i.sort(t||pc)}}}function hc(){let e=new WeakMap;return{get:function(t,n){let r=e.get(t),i;return r===void 0?(i=new mc,e.set(t,[i])):n>=r.length?(i=new mc,r.push(i)):i=r[n],i},dispose:function(){e=new WeakMap}}}function gc(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={direction:new P,color:new ni};break;case`SpotLight`:n={position:new P,direction:new P,color:new ni,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case`PointLight`:n={position:new P,color:new ni,distance:0,decay:0};break;case`HemisphereLight`:n={direction:new P,skyColor:new ni,groundColor:new ni};break;case`RectAreaLight`:n={color:new ni,position:new P,halfWidth:new P,halfHeight:new P}}return e[t.id]=n,n}}}var _c=0;function vc(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function yc(e){let t=new gc,n=function(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:case`SpotLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new fn};break;case`PointLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new fn,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let e=0;e<9;e++)r.probe.push(new P);let i=new P,a=new ur,o=new ur;return{setup:function(i){let a=0,o=0,s=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0;i.sort(vc);for(let e=0,y=i.length;e0&&(!0===e.has(`OES_texture_float_linear`)?(r.rectAreaLTC1=no.LTC_FLOAT_1,r.rectAreaLTC2=no.LTC_FLOAT_2):(r.rectAreaLTC1=no.LTC_HALF_1,r.rectAreaLTC2=no.LTC_HALF_2)),r.ambient[0]=a,r.ambient[1]=o,r.ambient[2]=s;let y=r.hash;y.directionalLength===c&&y.pointLength===l&&y.spotLength===u&&y.rectAreaLength===d&&y.hemiLength===f&&y.numDirectionalShadows===p&&y.numPointShadows===m&&y.numSpotShadows===h&&y.numSpotMaps===g&&y.numLightProbes===v||(r.directional.length=c,r.spot.length=u,r.rectArea.length=d,r.point.length=l,r.hemi.length=f,r.directionalShadow.length=p,r.directionalShadowMap.length=p,r.pointShadow.length=m,r.pointShadowMap.length=m,r.spotShadow.length=h,r.spotShadowMap.length=h,r.directionalShadowMatrix.length=p,r.pointShadowMatrix.length=m,r.spotLightMatrix.length=h+g-_,r.spotLightMap.length=g,r.numSpotLightShadowsWithMaps=_,r.numLightProbes=v,y.directionalLength=c,y.pointLength=l,y.spotLength=u,y.rectAreaLength=d,y.hemiLength=f,y.numDirectionalShadows=p,y.numPointShadows=m,y.numSpotShadows=h,y.numSpotMaps=g,y.numLightProbes=v,r.version=_c++)},setupView:function(e,t){let n=0,s=0,c=0,l=0,u=0,d=t.matrixWorldInverse;for(let t=0,f=e.length;t=i.length?(a=new bc(e),i.push(a)):a=i[r],a},dispose:function(){t=new WeakMap}}}function Sc(e,t,n){let r=new ba,i=new fn,a=new fn,o=new Mn,s=new Ea({depthPacking:3201}),c=new Da,l={},u=n.maxTextureSize,d={[x]:1,[S]:0,[C]:2},f=new Ui({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new fn},radius:{value:4}},vertexShader:`void main() { + gl_Position = vec4( position, 1.0 ); +}`,fragmentShader:`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`}),p=f.clone();p.defines.HORIZONTAL_PASS=1;let m=new wi;m.setAttribute(`position`,new pi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let h=new Ii(m,f),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let _=this.type;function v(n,r){let a=t.update(h);f.defines.VSM_SAMPLES!==n.blurSamples&&(f.defines.VSM_SAMPLES=n.blurSamples,p.defines.VSM_SAMPLES=n.blurSamples,f.needsUpdate=!0,p.needsUpdate=!0),n.mapPass===null&&(n.mapPass=new Pn(i.x,i.y)),f.uniforms.shadow_pass.value=n.map.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,a,f,h,null),p.uniforms.shadow_pass.value=n.mapPass.texture,p.uniforms.resolution.value=n.mapSize,p.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,a,p,h,null)}function y(t,n,r,i){let a=null,o=!0===r.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(o!==void 0)a=o;else if(a=!0===r.isPointLight?c:s,e.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&n.clippingPlanes.length!==0||n.displacementMap&&n.displacementScale!==0||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0||!0===n.alphaToCoverage){let e=a.uuid,t=n.uuid,r=l[e];r===void 0&&(r={},l[e]=r);let i=r[t];i===void 0&&(i=a.clone(),r[t]=i,n.addEventListener(`dispose`,w)),a=i}return a.visible=n.visible,a.wireframe=n.wireframe,a.side=i===3?n.shadowSide===null?n.side:n.shadowSide:n.shadowSide===null?d[n.side]:n.shadowSide,a.alphaMap=n.alphaMap,a.alphaTest=!0===n.alphaToCoverage?.5:n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,!0===r.isPointLight&&!0===a.isMeshDistanceMaterial&&(e.properties.get(a).light=r),a}function b(n,i,a,o,s){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===3)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);let r=t.update(n),c=n.material;if(Array.isArray(c)){let t=r.groups;for(let l=0,u=t.length;lu||i.y>u)&&(i.x>u&&(a.x=Math.floor(u/h.x),i.x=a.x*h.x,d.mapSize.x=a.x),i.y>u&&(a.y=Math.floor(u/h.y),i.y=a.y*h.y,d.mapSize.y=a.y)),d.map===null||!0===p||!0===m){let e=this.type===3?{}:{minFilter:we,magFilter:we};d.map!==null&&d.map.dispose(),d.map=new Pn(i.x,i.y,e),d.map.texture.name=l.name+`.shadowMap`,d.camera.updateProjectionMatrix()}e.setRenderTarget(d.map),e.clear();let g=d.getViewportCount();for(let e=0;e=2):(he=parseFloat(/^WebGL (\d)/.exec(ge)[1]),me=he>=1);let _e=null,ve={},ye=e.getParameter(e.SCISSOR_BOX),be=e.getParameter(e.VIEWPORT),xe=new Mn().fromArray(ye),Se=new Mn().fromArray(be);function Ce(t,n,r,i){let a=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let o=0;on||i.height>n)&&(r=n/Math.max(i.width,i.height)),r<1){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap||typeof VideoFrame<`u`&&e instanceof VideoFrame){let n=Math.floor(r*i.width),a=Math.floor(r*i.height);d===void 0&&(d=m(n,a));let o=t?m(n,a):d;return o.width=n,o.height=a,o.getContext(`2d`).drawImage(e,0,0,n,a),Xt(`WebGLRenderer: Texture has been resized from (`+i.width+`x`+i.height+`) to (`+n+`x`+a+`).`),o}return`data`in e&&Xt(`WebGLRenderer: Image in DataTexture is too big (`+i.width+`x`+i.height+`).`),e}return e}function g(e){return e.generateMipmaps}function _(t){e.generateMipmap(t)}function v(t){return t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:t.isWebGL3DRenderTarget?e.TEXTURE_3D:t.isWebGLArrayRenderTarget||t.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:e.TEXTURE_2D}function y(n,r,i,a,o=!1){if(n!==null){if(e[n]!==void 0)return e[n];Xt(`WebGLRenderer: Attempt to use non-existing WebGL internal format '`+n+`'`)}let s=r;if(r===e.RED&&(i===e.FLOAT&&(s=e.R32F),i===e.HALF_FLOAT&&(s=e.R16F),i===e.UNSIGNED_BYTE&&(s=e.R8)),r===e.RED_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.R8UI),i===e.UNSIGNED_SHORT&&(s=e.R16UI),i===e.UNSIGNED_INT&&(s=e.R32UI),i===e.BYTE&&(s=e.R8I),i===e.SHORT&&(s=e.R16I),i===e.INT&&(s=e.R32I)),r===e.RG&&(i===e.FLOAT&&(s=e.RG32F),i===e.HALF_FLOAT&&(s=e.RG16F),i===e.UNSIGNED_BYTE&&(s=e.RG8)),r===e.RG_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.RG8UI),i===e.UNSIGNED_SHORT&&(s=e.RG16UI),i===e.UNSIGNED_INT&&(s=e.RG32UI),i===e.BYTE&&(s=e.RG8I),i===e.SHORT&&(s=e.RG16I),i===e.INT&&(s=e.RG32I)),r===e.RGB_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.RGB8UI),i===e.UNSIGNED_SHORT&&(s=e.RGB16UI),i===e.UNSIGNED_INT&&(s=e.RGB32UI),i===e.BYTE&&(s=e.RGB8I),i===e.SHORT&&(s=e.RGB16I),i===e.INT&&(s=e.RGB32I)),r===e.RGBA_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.RGBA8UI),i===e.UNSIGNED_SHORT&&(s=e.RGBA16UI),i===e.UNSIGNED_INT&&(s=e.RGBA32UI),i===e.BYTE&&(s=e.RGBA8I),i===e.SHORT&&(s=e.RGBA16I),i===e.INT&&(s=e.RGBA32I)),r===e.RGB&&(i===e.UNSIGNED_INT_5_9_9_9_REV&&(s=e.RGB9_E5),i===e.UNSIGNED_INT_10F_11F_11F_REV&&(s=e.R11F_G11F_B10F)),r===e.RGBA){let t=o?jt:xn.getTransfer(a);i===e.FLOAT&&(s=e.RGBA32F),i===e.HALF_FLOAT&&(s=e.RGBA16F),i===e.UNSIGNED_BYTE&&(s=t===Mt?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT_4_4_4_4&&(s=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(s=e.RGB5_A1)}return s!==e.R16F&&s!==e.R32F&&s!==e.RG16F&&s!==e.RG32F&&s!==e.RGBA16F&&s!==e.RGBA32F||t.get(`EXT_color_buffer_float`),s}function b(t,n){let r;return t?n===null||n===Fe||n===Be?r=e.DEPTH24_STENCIL8:n===Ie?r=e.DEPTH32F_STENCIL8:n===Ne&&(r=e.DEPTH24_STENCIL8,Xt(`DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.`)):n===null||n===Fe||n===Be?r=e.DEPTH_COMPONENT24:n===Ie?r=e.DEPTH_COMPONENT32F:n===Ne&&(r=e.DEPTH_COMPONENT16),r}function x(e,t){return!0===g(e)||e.isFramebufferTexture&&e.minFilter!==we&&e.minFilter!==De?Math.log2(Math.max(t.width,t.height))+1:e.mipmaps!==void 0&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function S(e){let t=e.target;t.removeEventListener(`dispose`,S),function(e){let t=r.get(e);if(t.__webglInit===void 0)return;let n=e.source,i=f.get(n);if(i){let r=i[t.__cacheKey];r.usedTimes--,r.usedTimes===0&&w(e),Object.keys(i).length===0&&f.delete(n)}r.remove(e)}(t),t.isVideoTexture&&u.delete(t)}function C(t){let n=t.target;n.removeEventListener(`dispose`,C),function(t){let n=r.get(t);if(t.depthTexture&&(t.depthTexture.dispose(),r.remove(t.depthTexture)),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(n.__webglFramebuffer[t]))for(let r=0;r0&&a.__version!==t.version){let e=t.image;if(e===null)Xt(`WebGLRenderer: Texture marked for update but no image data found.`);else{if(!1!==e.complete)return void ne(a,t,i);Xt(`WebGLRenderer: Texture marked for update but image is incomplete`)}}else t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D,a.__webglTexture,e.TEXTURE0+i)}let D={[xe]:e.REPEAT,[Se]:e.CLAMP_TO_EDGE,[Ce]:e.MIRRORED_REPEAT},O={[we]:e.NEAREST,[Te]:e.NEAREST_MIPMAP_NEAREST,[Ee]:e.NEAREST_MIPMAP_LINEAR,[De]:e.LINEAR,[Oe]:e.LINEAR_MIPMAP_NEAREST,[ke]:e.LINEAR_MIPMAP_LINEAR},k={[Pt]:e.NEVER,[Vt]:e.ALWAYS,[Ft]:e.LESS,[Lt]:e.LEQUAL,[It]:e.EQUAL,[Bt]:e.GEQUAL,[Rt]:e.GREATER,[zt]:e.NOTEQUAL};function A(n,a){if(a.type!==Ie||!1!==t.has(`OES_texture_float_linear`)||a.magFilter!==De&&a.magFilter!==Oe&&a.magFilter!==Ee&&a.magFilter!==ke&&a.minFilter!==De&&a.minFilter!==Oe&&a.minFilter!==Ee&&a.minFilter!==ke||Xt(`WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.`),e.texParameteri(n,e.TEXTURE_WRAP_S,D[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,D[a.wrapT]),n!==e.TEXTURE_3D&&n!==e.TEXTURE_2D_ARRAY||e.texParameteri(n,e.TEXTURE_WRAP_R,D[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,O[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,O[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,k[a.compareFunction])),!0===t.has(`EXT_texture_filter_anisotropic`)){if(a.magFilter===we||a.minFilter!==Ee&&a.minFilter!==ke||a.type===Ie&&!1===t.has(`OES_texture_float_linear`))return;if(a.anisotropy>1||r.get(a).__currentAnisotropy){let o=t.get(`EXT_texture_filter_anisotropic`);e.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy}}}function ee(t,n){let r=!1;t.__webglInit===void 0&&(t.__webglInit=!0,n.addEventListener(`dispose`,S));let i=n.source,a=f.get(i);a===void 0&&(a={},f.set(i,a));let s=function(e){let t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}(n);if(s!==t.__cacheKey){a[s]===void 0&&(a[s]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,r=!0),a[s].usedTimes++;let i=a[t.__cacheKey];i!==void 0&&(a[t.__cacheKey].usedTimes--,i.usedTimes===0&&w(n)),t.__cacheKey=s,t.__webglTexture=a[s].texture}return r}function te(e,t,n){return Math.floor(Math.floor(e/n)/t)}function ne(t,o,s){let c=e.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(c=e.TEXTURE_2D_ARRAY),o.isData3DTexture&&(c=e.TEXTURE_3D);let l=ee(t,o),u=o.source;n.bindTexture(c,t.__webglTexture,e.TEXTURE0+s);let d=r.get(u);if(u.version!==d.__version||!0===l){n.activeTexture(e.TEXTURE0+s);let t=xn.getPrimaries(xn.workingColorSpace),r=o.colorSpace===Ot?null:xn.getPrimaries(o.colorSpace),f=o.colorSpace===Ot||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,f);let p=h(o.image,!1,i.maxTextureSize);p=le(o,p);let m=a.convert(o.format,o.colorSpace),v=a.convert(o.type),S,C=y(o.internalFormat,m,v,o.colorSpace,o.isVideoTexture);A(c,o);let w=o.mipmaps,T=!0!==o.isVideoTexture,E=d.__version===void 0||!0===l,D=u.dataReady,O=x(o,p);if(o.isDepthTexture)C=b(o.format===Ge,o.type),E&&(T?n.texStorage2D(e.TEXTURE_2D,1,C,p.width,p.height):n.texImage2D(e.TEXTURE_2D,0,C,p.width,p.height,0,m,v,null));else if(o.isDataTexture)if(w.length>0){T&&E&&n.texStorage2D(e.TEXTURE_2D,O,C,w[0].width,w[0].height);for(let t=0,r=w.length;te.start-t.start);let s=0;for(let e=1;e0){let r=Qa(S.width,S.height,o.format,o.type);for(let i of o.layerUpdates){let a=S.data.subarray(i*r/S.data.BYTES_PER_ELEMENT,(i+1)*r/S.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,i,S.width,S.height,1,m,a)}o.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,S.width,S.height,p.depth,m,S.data)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,t,C,S.width,S.height,p.depth,0,S.data,0,0);else Xt(`WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()`);else T?D&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,S.width,S.height,p.depth,m,v,S.data):n.texImage3D(e.TEXTURE_2D_ARRAY,t,C,S.width,S.height,p.depth,0,m,v,S.data)}else{T&&E&&n.texStorage2D(e.TEXTURE_2D,O,C,w[0].width,w[0].height);for(let t=0,r=w.length;t0){let t=Qa(p.width,p.height,o.format,o.type);for(let r of o.layerUpdates){let i=p.data.subarray(r*t/p.data.BYTES_PER_ELEMENT,(r+1)*t/p.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,r,p.width,p.height,1,m,v,i)}o.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,p.width,p.height,p.depth,m,v,p.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,C,p.width,p.height,p.depth,0,m,v,p.data);else if(o.isData3DTexture)T?(E&&n.texStorage3D(e.TEXTURE_3D,O,C,p.width,p.height,p.depth),D&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,p.width,p.height,p.depth,m,v,p.data)):n.texImage3D(e.TEXTURE_3D,0,C,p.width,p.height,p.depth,0,m,v,p.data);else if(o.isFramebufferTexture){if(E)if(T)n.texStorage2D(e.TEXTURE_2D,O,C,p.width,p.height);else{let t=p.width,r=p.height;for(let i=0;i>=1,r>>=1}}else if(w.length>0){if(T&&E){let t=ue(w[0]);n.texStorage2D(e.TEXTURE_2D,O,C,t.width,t.height)}for(let t=0,r=w.length;t>u),r=Math.max(1,i.height>>u);l===e.TEXTURE_3D||l===e.TEXTURE_2D_ARRAY?n.texImage3D(l,u,p,t,r,i.depth,0,d,f,null):n.texImage2D(l,u,p,t,r,0,d,f,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),ce(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,c,l,h.__webglTexture,0,se(i)):(l===e.TEXTURE_2D||l>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,c,l,h.__webglTexture,u),n.bindFramebuffer(e.FRAMEBUFFER,null)}function re(t,n,r){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){let i=n.depthTexture,a=i&&i.isDepthTexture?i.type:null,o=b(n.stencilBuffer,a),c=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,l=se(n);ce(n)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,l,o,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,l,o,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,o,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,c,e.RENDERBUFFER,t)}else{let t=n.textures;for(let i=0;i{delete i.__boundDepthTexture,delete i.__depthDisposeCallback,e.removeEventListener(`dispose`,t)};e.addEventListener(`dispose`,t),i.__depthDisposeCallback=t}i.__boundDepthTexture=e}if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(a)throw Error(`target.depthTexture not supported in Cube render targets`);let e=t.texture.mipmaps;e&&e.length>0?M(i.__webglFramebuffer[0],t):M(i.__webglFramebuffer,t)}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)if(n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]===void 0)i.__webglDepthbuffer[r]=e.createRenderbuffer(),re(i.__webglDepthbuffer[r],t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,a=i.__webglDepthbuffer[r];e.bindRenderbuffer(e.RENDERBUFFER,a),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,a)}}else{let r=t.texture.mipmaps;if(r&&r.length>0?n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[0]):n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer===void 0)i.__webglDepthbuffer=e.createRenderbuffer(),re(i.__webglDepthbuffer,t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,r=i.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,r)}}n.bindFramebuffer(e.FRAMEBUFFER,null)}let ae=[],oe=[];function se(e){return Math.min(i.maxSamples,e.samples)}function ce(e){let n=r.get(e);return e.samples>0&&!0===t.has(`WEBGL_multisampled_render_to_texture`)&&!1!==n.__useRenderToTexture}function le(e,t){let n=e.colorSpace,r=e.format,i=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||n!==At&&n!==Ot&&(xn.getTransfer(n)===Mt?r===Ue&&i===Ae||Xt(`WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.`):Zt(`WebGLTextures: Unsupported texture color space:`,n)),t}function ue(e){return typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement?(l.width=e.naturalWidth||e.width,l.height=e.naturalHeight||e.height):typeof VideoFrame<`u`&&e instanceof VideoFrame?(l.width=e.displayWidth,l.height=e.displayHeight):(l.width=e.width,l.height=e.height),l}this.allocateTextureUnit=function(){let e=T;return e>=i.maxTextures&&Xt(`WebGLTextures: Trying to use `+e+` texture units while this GPU supports only `+i.maxTextures),T+=1,e},this.resetTextureUnits=function(){T=0},this.setTexture2D=E,this.setTexture2DArray=function(t,i){let a=r.get(t);!1===t.isRenderTargetTexture&&t.version>0&&a.__version!==t.version?ne(a,t,i):(t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null),n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+i))},this.setTexture3D=function(t,i){let a=r.get(t);!1===t.isRenderTargetTexture&&t.version>0&&a.__version!==t.version?ne(a,t,i):n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+i)},this.setTextureCube=function(t,o){let s=r.get(t);t.version>0&&s.__version!==t.version?function(t,o,s){if(o.image.length!==6)return;let c=ee(t,o),l=o.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+s);let u=r.get(l);if(l.version!==u.__version||!0===c){n.activeTexture(e.TEXTURE0+s);let t=xn.getPrimaries(xn.workingColorSpace),r=o.colorSpace===Ot?null:xn.getPrimaries(o.colorSpace),d=o.colorSpace===Ot||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);let f=o.isCompressedTexture||o.image[0].isCompressedTexture,p=o.image[0]&&o.image[0].isDataTexture,m=[];for(let e=0;e<6;e++)m[e]=f||p?p?o.image[e].image:o.image[e]:h(o.image[e],!0,i.maxCubemapSize),m[e]=le(o,m[e]);let v=m[0],b=a.convert(o.format,o.colorSpace),S=a.convert(o.type),C=y(o.internalFormat,b,S,o.colorSpace),w=!0!==o.isVideoTexture,T=u.__version===void 0||!0===c,E=l.dataReady,D,O=x(o,v);if(A(e.TEXTURE_CUBE_MAP,o),f){w&&T&&n.texStorage2D(e.TEXTURE_CUBE_MAP,O,C,v.width,v.height);for(let t=0;t<6;t++){D=m[t].mipmaps;for(let r=0;r0&&O++;let t=ue(m[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,O,C,t.width,t.height)}for(let t=0;t<6;t++)if(p){w?E&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,m[t].width,m[t].height,b,S,m[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,C,m[t].width,m[t].height,0,b,S,m[t].data);for(let r=0;r1;if(d||(c.__webglTexture===void 0&&(c.__webglTexture=e.createTexture()),c.__version=i.version,o.memory.textures++),u){s.__webglFramebuffer=[];for(let t=0;t<6;t++)if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer[t]=[];for(let n=0;n0){s.__webglFramebuffer=[];for(let t=0;t0&&!1===ce(t)){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,s.__webglMultisampledFramebuffer);for(let n=0;n0)for(let r=0;r0)for(let n=0;n0){if(!1===ce(t)){let i=t.textures,a=t.width,o=t.height,s=e.COLOR_BUFFER_BIT,l=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=r.get(t),d=i.length>1;if(d)for(let t=0;t0?n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer[0]):n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n= 1.0 ) { + + gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Ii(new Ca(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},Oc=class extends $t{constructor(e,t){super();let n=this,r=null,i=1,a=null,o=`local-floor`,s=1,c=null,l=null,u=null,d=null,f=null,p=null,m=typeof XRWebGLBinding<`u`,h=new Dc,g={},_=t.getContextAttributes(),v=null,y=null,b=[],x=[],S=new fn,C=null,w=new Ji;w.viewport=new Mn;let T=new Ji;T.viewport=new Mn;let E=[w,T],D=new Ya,O=null,k=null;function A(e){let t=x.indexOf(e.inputSource);if(t===-1)return;let n=b[t];n!==void 0&&(n.update(e.inputSource,e.frame,c||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function ee(){r.removeEventListener(`select`,A),r.removeEventListener(`selectstart`,A),r.removeEventListener(`selectend`,A),r.removeEventListener(`squeeze`,A),r.removeEventListener(`squeezestart`,A),r.removeEventListener(`squeezeend`,A),r.removeEventListener(`end`,ee),r.removeEventListener(`inputsourceschange`,te);for(let e=0;e=0&&(x[r]=null,b[r].disconnect(n))}for(let t=0;t=x.length){x.push(n),r=e;break}if(x[e]===null){x[e]=n,r=e;break}}if(r===-1)break}let i=b[r];i&&i.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=b[e];return t===void 0&&(t=new ta,b[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=b[e];return t===void 0&&(t=new ta,b[e]=t),t.getGripSpace()},this.getHand=function(e){let t=b[e];return t===void 0&&(t=new ta,b[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){i=e,!0===n.isPresenting&&Xt(`WebXRManager: Cannot change framebuffer scale while presenting.`)},this.setReferenceSpaceType=function(e){o=e,!0===n.isPresenting&&Xt(`WebXRManager: Cannot change reference space type while presenting.`)},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(e){c=e},this.getBaseLayer=function(){return d===null?f:d},this.getBinding=function(){return u===null&&m&&(u=new XRWebGLBinding(r,t)),u},this.getFrame=function(){return p},this.getSession=function(){return r},this.setSession=async function(l){if(r=l,r!==null){if(v=e.getRenderTarget(),r.addEventListener(`select`,A),r.addEventListener(`selectstart`,A),r.addEventListener(`selectend`,A),r.addEventListener(`squeeze`,A),r.addEventListener(`squeezestart`,A),r.addEventListener(`squeezeend`,A),r.addEventListener(`end`,ee),r.addEventListener(`inputsourceschange`,te),!0!==_.xrCompatible&&await t.makeXRCompatible(),C=e.getPixelRatio(),e.getSize(S),m&&`createProjectionLayer`in XRWebGLBinding.prototype){let n=null,a=null,o=null;_.depth&&(o=_.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=_.stencil?Ge:We,a=_.stencil?Be:Fe);let s={colorFormat:t.RGBA8,depthFormat:o,scaleFactor:i};u=this.getBinding(),d=u.createProjectionLayer(s),r.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),y=new Pn(d.textureWidth,d.textureHeight,{format:Ue,type:Ae,depthTexture:new xa(d.textureWidth,d.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:_.stencil,colorSpace:e.outputColorSpace,samples:_.antialias?4:0,resolveDepthBuffer:!1===d.ignoreDepthValues,resolveStencilBuffer:!1===d.ignoreDepthValues})}else{let n={antialias:_.antialias,alpha:!0,depth:_.depth,stencil:_.stencil,framebufferScaleFactor:i};f=new XRWebGLLayer(r,t,n),r.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),y=new Pn(f.framebufferWidth,f.framebufferHeight,{format:Ue,type:Ae,colorSpace:e.outputColorSpace,stencilBuffer:_.stencil,resolveDepthBuffer:!1===f.ignoreDepthValues,resolveStencilBuffer:!1===f.ignoreDepthValues})}y.isXRRenderTarget=!0,this.setFoveation(s),c=null,a=await r.requestReferenceSpace(o),ie.setContext(r),ie.start(),n.isPresenting=!0,n.dispatchEvent({type:`sessionstart`})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return h.getDepthTexture()};let ne=new P,j=new P;function re(e,t){t===null?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(r===null)return;let t=e.near,n=e.far;h.texture!==null&&(h.depthNear>0&&(t=h.depthNear),h.depthFar>0&&(n=h.depthFar)),D.near=T.near=w.near=t,D.far=T.far=w.far=n,O===D.near&&k===D.far||(r.updateRenderState({depthNear:D.near,depthFar:D.far}),O=D.near,k=D.far),D.layers.mask=6|e.layers.mask,w.layers.mask=3&D.layers.mask,T.layers.mask=5&D.layers.mask;let i=e.parent,a=D.cameras;re(D,i);for(let e=0;e0&&(e.alphaTest.value=r.alphaTest);let i=t.get(r),a=i.envMap,o=i.envMapRotation;a&&(e.envMap.value=a,kc.copy(o),kc.x*=-1,kc.y*=-1,kc.z*=-1,a.isCubeTexture&&!1===a.isRenderTargetTexture&&(kc.y*=-1,kc.z*=-1),e.envMapRotation.value.setFromMatrix4(Ac.makeRotationFromEuler(kc)),e.flipEnvMap.value=a.isCubeTexture&&!1===a.isRenderTargetTexture?-1:1,e.reflectivity.value=r.reflectivity,e.ior.value=r.ior,e.refractionRatio.value=r.refractionRatio),r.lightMap&&(e.lightMap.value=r.lightMap,e.lightMapIntensity.value=r.lightMapIntensity,n(r.lightMap,e.lightMapTransform)),r.aoMap&&(e.aoMap.value=r.aoMap,e.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,e.aoMapTransform))}return{refreshFogUniforms:function(t,n){n.color.getRGB(t.fogColor.value,Vi(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)},refreshMaterialUniforms:function(e,i,a,o,s){i.isMeshBasicMaterial||i.isMeshLambertMaterial?r(e,i):i.isMeshToonMaterial?(r(e,i),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,i)):i.isMeshPhongMaterial?(r(e,i),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,i)):i.isMeshStandardMaterial?(r(e,i),function(e,t){e.metalness.value=t.metalness,t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap,n(t.metalnessMap,e.metalnessMapTransform)),e.roughness.value=t.roughness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap,n(t.roughnessMap,e.roughnessMapTransform)),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}(e,i),i.isMeshPhysicalMaterial&&function(e,t,r){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,n(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,n(t.sheenRoughnessMap,e.sheenRoughnessMapTransform))),t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,n(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,n(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,n(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===1&&e.clearcoatNormalScale.value.negate())),t.dispersion>0&&(e.dispersion.value=t.dispersion),t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,n(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,n(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform))),t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=r.texture,e.transmissionSamplerSize.value.set(r.width,r.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,n(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,n(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)),t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,n(t.anisotropyMap,e.anisotropyMapTransform))),e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,n(t.specularColorMap,e.specularColorMapTransform)),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,n(t.specularIntensityMap,e.specularIntensityMapTransform))}(e,i,s)):i.isMeshMatcapMaterial?(r(e,i),function(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,i)):i.isMeshDepthMaterial?r(e,i):i.isMeshDistanceMaterial?(r(e,i),function(e,n){let r=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(r.matrixWorld),e.nearDistance.value=r.shadow.camera.near,e.farDistance.value=r.shadow.camera.far}(e,i)):i.isMeshNormalMaterial?r(e,i):i.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform))}(e,i),i.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,i)):i.isPointsMaterial?function(e,t,r,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*r,e.scale.value=.5*i,t.map&&(e.map.value=t.map,n(t.map,e.uvTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i,a,o):i.isSpriteMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i):i.isShadowMaterial?(e.color.value.copy(i.color),e.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function Mc(e,t,n,r){let i={},a={},o=[],s=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function c(e,t,n,r){let i=e.value,a=t+`_`+n;if(r[a]===void 0)return r[a]=typeof i==`number`||typeof i==`boolean`?i:i.clone(),!0;{let e=r[a];if(typeof i==`number`||typeof i==`boolean`){if(e!==i)return r[a]=i,!0}else if(!1===e.equals(i))return e.copy(i),!0}return!1}function l(e){let t={boundary:0,storage:0};return typeof e==`number`||typeof e==`boolean`?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?Xt(`WebGLRenderer: Texture samplers can not be part of an uniforms group.`):Xt(`WebGLRenderer: Unsupported uniform value type.`,e),t}function u(t){let n=t.target;n.removeEventListener(`dispose`,u);let r=o.indexOf(n.__bindingPointIndex);o.splice(r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete a[n.id]}return{bind:function(e,t){let n=t.program;r.uniformBlockBinding(e,n)},update:function(n,d){let f=i[n.id];f===void 0&&(function(e){let t=e.uniforms,n=0;for(let e=0,r=t.length;e0&&(n+=16-r),e.__size=n,e.__cache={}}(n),f=function(t){let n=function(){for(let e=0;e0),d=!!n.morphAttributes.position,f=!!n.morphAttributes.normal,p=!!n.morphAttributes.color,m=0;r.toneMapped&&(E!==null&&!0!==E.isXRRenderTarget||(m=S.toneMapping));let h=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,g=h===void 0?0:h.length,_=Ce.get(r),y=v.state.lights;if(!0===ue&&(!0===de||e!==O)){let t=e===O&&r.id===D;Ue.setState(r,e,t)}let b=!1;r.version===_.__version?_.needsLights&&_.lightsStateVersion!==y.state.version||_.outputColorSpace!==s||i.isBatchedMesh&&!1===_.batching?b=!0:i.isBatchedMesh||!0!==_.batching?i.isBatchedMesh&&!0===_.batchingColor&&i.colorTexture===null||i.isBatchedMesh&&!1===_.batchingColor&&i.colorTexture!==null||i.isInstancedMesh&&!1===_.instancing?b=!0:i.isInstancedMesh||!0!==_.instancing?i.isSkinnedMesh&&!1===_.skinning?b=!0:i.isSkinnedMesh||!0!==_.skinning?i.isInstancedMesh&&!0===_.instancingColor&&i.instanceColor===null||i.isInstancedMesh&&!1===_.instancingColor&&i.instanceColor!==null||i.isInstancedMesh&&!0===_.instancingMorph&&i.morphTexture===null||i.isInstancedMesh&&!1===_.instancingMorph&&i.morphTexture!==null||_.envMap!==c||!0===r.fog&&_.fog!==a?b=!0:_.numClippingPlanes===void 0||_.numClippingPlanes===Ue.numPlanes&&_.numIntersection===Ue.numIntersection?(_.vertexAlphas!==l||_.vertexTangents!==u||_.morphTargets!==d||_.morphNormals!==f||_.morphColors!==p||_.toneMapping!==m||_.morphTargetsCount!==g)&&(b=!0):b=!0:b=!0:b=!0:b=!0:(b=!0,_.__version=r.version);let x=_.currentProgram;!0===b&&(x=yt(r,t,i));let C=!1,w=!1,T=!1,k=x.getUniforms(),A=_.uniforms;if(be.useProgram(x.program)&&(C=!0,w=!0,T=!0),r.id!==D&&(D=r.id,w=!0),C||O!==e){be.buffers.depth.getReversed()&&!0!==e.reversedDepth&&(e._reversedDepth=!0,e.updateProjectionMatrix()),k.setValue(N,`projectionMatrix`,e.projectionMatrix),k.setValue(N,`viewMatrix`,e.matrixWorldInverse);let t=k.map.cameraPosition;t!==void 0&&t.setValue(N,pe.setFromMatrixPosition(e.matrixWorld)),ye.logarithmicDepthBuffer&&k.setValue(N,`logDepthBufFC`,2/(Math.log(e.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&k.setValue(N,`isOrthographic`,!0===e.isOrthographicCamera),O!==e&&(O=e,w=!0,T=!0)}if(i.isSkinnedMesh){k.setOptional(N,i,`bindMatrix`),k.setOptional(N,i,`bindMatrixInverse`);let e=i.skeleton;e&&(e.boneTexture===null&&e.computeBoneTexture(),k.setValue(N,`boneTexture`,e.boneTexture,we))}i.isBatchedMesh&&(k.setOptional(N,i,`batchingTexture`),k.setValue(N,`batchingTexture`,i._matricesTexture,we),k.setOptional(N,i,`batchingIdTexture`),k.setValue(N,`batchingIdTexture`,i._indirectTexture,we),k.setOptional(N,i,`batchingColorTexture`),i._colorsTexture!==null&&k.setValue(N,`batchingColorTexture`,i._colorsTexture,we));let ee=n.morphAttributes;ee.position===void 0&&ee.normal===void 0&&ee.color===void 0||Ke.update(i,n,x),(w||_.receiveShadow!==i.receiveShadow)&&(_.receiveShadow=i.receiveShadow,k.setValue(N,`receiveShadow`,i.receiveShadow)),r.isMeshGouraudMaterial&&r.envMap!==null&&(A.envMap.value=c,A.flipEnvMap.value=c.isCubeTexture&&!1===c.isRenderTargetTexture?-1:1),r.isMeshStandardMaterial&&r.envMap===null&&t.environment!==null&&(A.envMapIntensity.value=t.environmentIntensity),A.dfgLUT!==void 0&&(A.dfgLUT.value=(Pc===null&&(Pc=new ra(Nc,32,32,Je,Le),Pc.minFilter=De,Pc.magFilter=De,Pc.wrapS=Se,Pc.wrapT=Se,Pc.generateMipmaps=!1,Pc.needsUpdate=!0),Pc)),w&&(k.setValue(N,`toneMappingExposure`,S.toneMappingExposure),_.needsLights&&(ne=T,(te=A).ambientLightColor.needsUpdate=ne,te.lightProbe.needsUpdate=ne,te.directionalLights.needsUpdate=ne,te.directionalLightShadows.needsUpdate=ne,te.pointLights.needsUpdate=ne,te.pointLightShadows.needsUpdate=ne,te.spotLights.needsUpdate=ne,te.spotLightShadows.needsUpdate=ne,te.rectAreaLights.needsUpdate=ne,te.hemisphereLights.needsUpdate=ne),a&&!0===r.fog&&Ie.refreshFogUniforms(A,a),Ie.refreshMaterialUniforms(A,r,M,re,v.state.transmissionRenderTarget[e.id]),Bs.upload(N,bt(_),A,we));var te,ne;if(r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(Bs.upload(N,bt(_),A,we),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&k.setValue(N,`center`,i.center),k.setValue(N,`modelViewMatrix`,i.modelViewMatrix),k.setValue(N,`normalMatrix`,i.normalMatrix),k.setValue(N,`modelMatrix`,i.matrixWorld),r.isShaderMaterial||r.isRawShaderMaterial){let e=r.uniformsGroups;for(let t=0,n=e.length;t{function n(){r.forEach(function(e){Ce.get(e).currentProgram.isReady()&&r.delete(e)}),r.size===0?t(e):setTimeout(n,10)}ve.get(`KHR_parallel_shader_compile`)===null?setTimeout(n,10):n()})};let ut=null;function dt(){pt.stop()}function ft(){pt.start()}let pt=new $a;function mt(e,t,n,r){if(!1===e.visible)return;if(e.layers.test(t.layers)){if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)v.pushLight(e),e.castShadow&&v.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||le.intersectsSprite(e)){r&&me.setFromMatrixPosition(e.matrixWorld).applyMatrix4(fe);let t=Me.update(e),i=e.material;i.visible&&_.push(e,t,i,n,me.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||le.intersectsObject(e))){let t=Me.update(e),i=e.material;if(r&&(e.boundingSphere===void 0?(t.boundingSphere===null&&t.computeBoundingSphere(),me.copy(t.boundingSphere.center)):(e.boundingSphere===null&&e.computeBoundingSphere(),me.copy(e.boundingSphere.center)),me.applyMatrix4(e.matrixWorld).applyMatrix4(fe)),Array.isArray(i)){let r=t.groups;for(let a=0,o=r.length;a0&&_t(i,t,n),a.length>0&&_t(a,t,n),o.length>0&&_t(o,t,n),be.buffers.depth.setTest(!0),be.buffers.depth.setMask(!0),be.buffers.color.setMask(!0),be.setPolygonOffset(!1)}function gt(e,t,n,r){if((!0===n.isScene?n.overrideMaterial:null)!==null)return;v.state.transmissionRenderTarget[r.id]===void 0&&(v.state.transmissionRenderTarget[r.id]=new Pn(1,1,{generateMipmaps:!0,type:ve.has(`EXT_color_buffer_half_float`)||ve.has(`EXT_color_buffer_float`)?Le:Ae,minFilter:ke,samples:4,stencilBuffer:i,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:xn.workingColorSpace}));let a=v.state.transmissionRenderTarget[r.id],o=r.viewport||k;a.setSize(o.z*S.transmissionResolutionScale,o.w*S.transmissionResolutionScale);let s=S.getRenderTarget(),c=S.getActiveCubeFace(),l=S.getActiveMipmapLevel();S.setRenderTarget(a),S.getClearColor(te),ne=S.getClearAlpha(),ne<1&&S.setClearColor(16777215,.5),S.clear(),ge&&Ge.render(n);let u=S.toneMapping;S.toneMapping=0;let d=r.viewport;if(r.viewport!==void 0&&(r.viewport=void 0),v.setupLightsView(r),!0===ue&&Ue.setGlobalState(S.clippingPlanes,r),_t(e,n,r),we.updateMultisampleRenderTarget(a),we.updateRenderTargetMipmap(a),!1===ve.has(`WEBGL_multisampled_render_to_texture`)){let e=!1;for(let i=0,a=t.length;i0)for(let t=0,a=n.length;t0&>(r,i,e,t),ge&&Ge.render(e),ht(_,e,t);E!==null&&T===0&&(we.updateMultisampleRenderTarget(E),we.updateRenderTargetMipmap(E)),!0===e.isScene&&e.onAfterRender(S,e,t),et.resetDefaultState(),D=-1,O=null,x.pop(),x.length>0?(v=x[x.length-1],!0===ue&&Ue.setGlobalState(S.clippingPlanes,v.state.camera)):v=null,y.pop(),_=y.length>0?y[y.length-1]:null},this.getActiveCubeFace=function(){return w},this.getActiveMipmapLevel=function(){return T},this.getRenderTarget=function(){return E},this.setRenderTargetTextures=function(e,t,n){let r=Ce.get(e);r.__autoAllocateDepthBuffer=!1===e.resolveDepthBuffer,!1===r.__autoAllocateDepthBuffer&&(r.__useRenderToTexture=!1),Ce.get(e.texture).__webglTexture=t,Ce.get(e.depthTexture).__webglTexture=r.__autoAllocateDepthBuffer?void 0:n,r.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(e,t){let n=Ce.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=t===void 0};let St=N.createFramebuffer();this.setRenderTarget=function(e,t=0,n=0){E=e,w=t,T=n;let r=!0,i=null,a=!1,o=!1;if(e){let s=Ce.get(e);if(s.__useDefaultFramebuffer!==void 0)be.bindFramebuffer(N.FRAMEBUFFER,null),r=!1;else if(s.__webglFramebuffer===void 0)we.setupRenderTarget(e);else if(s.__hasExternalTextures)we.rebindTextures(e,Ce.get(e.texture).__webglTexture,Ce.get(e.depthTexture).__webglTexture);else if(e.depthBuffer){let t=e.depthTexture;if(s.__boundDepthTexture!==t){if(t!==null&&Ce.has(t)&&(e.width!==t.image.width||e.height!==t.image.height))throw Error(`WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.`);we.setupDepthRenderbuffer(e)}}let c=e.texture;(c.isData3DTexture||c.isDataArrayTexture||c.isCompressedArrayTexture)&&(o=!0);let l=Ce.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(i=Array.isArray(l[t])?l[t][n]:l[t],a=!0):i=e.samples>0&&!1===we.useMultisampledRTT(e)?Ce.get(e).__webglMultisampledFramebuffer:Array.isArray(l)?l[n]:l,k.copy(e.viewport),A.copy(e.scissor),ee=e.scissorTest}else k.copy(oe).multiplyScalar(M).floor(),A.copy(se).multiplyScalar(M).floor(),ee=ce;if(n!==0&&(i=St),be.bindFramebuffer(N.FRAMEBUFFER,i)&&r&&be.drawBuffers(e,i),be.viewport(k),be.scissor(A),be.setScissorTest(ee),a){let r=Ce.get(e.texture);N.framebufferTexture2D(N.FRAMEBUFFER,N.COLOR_ATTACHMENT0,N.TEXTURE_CUBE_MAP_POSITIVE_X+t,r.__webglTexture,n)}else if(o){let r=t;for(let t=0;t=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&(e.textures.length>1&&N.readBuffer(N.COLOR_ATTACHMENT0+s),N.readPixels(t,n,r,i,$e.convert(c),$e.convert(l),a))}finally{let e=E===null?null:Ce.get(E).__webglFramebuffer;be.bindFramebuffer(N.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,r,i,a,o,s=0){if(!e||!e.isWebGLRenderTarget)throw Error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);let c=Ce.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&o!==void 0&&(c=c[o]),c){if(t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i){be.bindFramebuffer(N.FRAMEBUFFER,c);let o=e.textures[s],l=o.format,u=o.type;if(!ye.textureFormatReadable(l))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.`);if(!ye.textureTypeReadable(u))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.`);let d=N.createBuffer();N.bindBuffer(N.PIXEL_PACK_BUFFER,d),N.bufferData(N.PIXEL_PACK_BUFFER,a.byteLength,N.STREAM_READ),e.textures.length>1&&N.readBuffer(N.COLOR_ATTACHMENT0+s),N.readPixels(t,n,r,i,$e.convert(l),$e.convert(u),0);let f=E===null?null:Ce.get(E).__webglFramebuffer;be.bindFramebuffer(N.FRAMEBUFFER,f);let p=N.fenceSync(N.SYNC_GPU_COMMANDS_COMPLETE,0);return N.flush(),await function(e,t,n){return new Promise(function(r,i){setTimeout(function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:i();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:r()}},n)})}(N,p,4),N.bindBuffer(N.PIXEL_PACK_BUFFER,d),N.getBufferSubData(N.PIXEL_PACK_BUFFER,0,a),N.deleteBuffer(d),N.deleteSync(p),a}throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.`)}},this.copyFramebufferToTexture=function(e,t=null,n=0){let r=2**-n,i=Math.floor(e.image.width*r),a=Math.floor(e.image.height*r),o=t===null?0:t.x,s=t===null?0:t.y;we.setTexture2D(e,0),N.copyTexSubImage2D(N.TEXTURE_2D,n,0,0,o,s,i,a),be.unbindTexture()};let Ct=N.createFramebuffer(),wt=N.createFramebuffer();this.copyTextureToTexture=function(e,t,n=null,r=null,i=0,a=null){let o,s,c,l,u,d,f,p,m;a===null&&(i===0?a=0:(Qt(`WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels.`),a=i,i=0));let h=e.isCompressedTexture?e.mipmaps[a]:e.image;if(n!==null)o=n.max.x-n.min.x,s=n.max.y-n.min.y,c=n.isBox3?n.max.z-n.min.z:1,l=n.min.x,u=n.min.y,d=n.isBox3?n.min.z:0;else{let t=2**-i;o=Math.floor(h.width*t),s=Math.floor(h.height*t),c=e.isDataArrayTexture?h.depth:e.isData3DTexture?Math.floor(h.depth*t):1,l=0,u=0,d=0}r===null?(f=0,p=0,m=0):(f=r.x,p=r.y,m=r.z);let g=$e.convert(t.format),_=$e.convert(t.type),v;t.isData3DTexture?(we.setTexture3D(t,0),v=N.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(we.setTexture2DArray(t,0),v=N.TEXTURE_2D_ARRAY):(we.setTexture2D(t,0),v=N.TEXTURE_2D),N.pixelStorei(N.UNPACK_FLIP_Y_WEBGL,t.flipY),N.pixelStorei(N.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),N.pixelStorei(N.UNPACK_ALIGNMENT,t.unpackAlignment);let y=N.getParameter(N.UNPACK_ROW_LENGTH),b=N.getParameter(N.UNPACK_IMAGE_HEIGHT),x=N.getParameter(N.UNPACK_SKIP_PIXELS),S=N.getParameter(N.UNPACK_SKIP_ROWS),C=N.getParameter(N.UNPACK_SKIP_IMAGES);N.pixelStorei(N.UNPACK_ROW_LENGTH,h.width),N.pixelStorei(N.UNPACK_IMAGE_HEIGHT,h.height),N.pixelStorei(N.UNPACK_SKIP_PIXELS,l),N.pixelStorei(N.UNPACK_SKIP_ROWS,u),N.pixelStorei(N.UNPACK_SKIP_IMAGES,d);let w=e.isDataArrayTexture||e.isData3DTexture,T=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){let n=Ce.get(e),r=Ce.get(t),h=Ce.get(n.__renderTarget),g=Ce.get(r.__renderTarget);be.bindFramebuffer(N.READ_FRAMEBUFFER,h.__webglFramebuffer),be.bindFramebuffer(N.DRAW_FRAMEBUFFER,g.__webglFramebuffer);for(let n=0;n{};onAfterRender=()=>{};onAfterResize=()=>{};#n=!1;#r=!1;isDisposed=!1;#i;#a;#o;#s=new Xa;#c={elapsed:0,delta:0};#l;#u;#d=0;#f=0;constructor(e){this.#e={...e},this.#p(),this.#m(),this.#h(),this.resize(),this.#g()}#p(){this.camera=new Ji,this.cameraFov=this.camera.fov}#m(){this.scene=new na}#h(){this.#e.canvas?this.canvas=this.#e.canvas:this.#e.id?this.canvas=document.getElementById(this.#e.id):console.error(`Three: Missing canvas or id parameter`),this.canvas.style.display=`block`,this.canvas.style.touchAction=`none`,this.renderer=new Fc({canvas:this.canvas,powerPreference:`high-performance`,...this.#e.rendererOptions??{}}),this.renderer.outputColorSpace=kt}#g(){this.#e.size instanceof Object||(window.addEventListener(`resize`,this.#b.bind(this)),this.#e.size===`parent`&&(this.#a=new ResizeObserver(this.#b.bind(this)),this.#a.observe(this.canvas.parentNode))),this.#i=new IntersectionObserver(this.#v.bind(this),{root:null,rootMargin:`0px`,threshold:0}),this.#i.observe(this.canvas),document.addEventListener(`visibilitychange`,this.#y.bind(this))}#_(){window.removeEventListener(`resize`,this.#b.bind(this)),this.#a?.disconnect(),this.#i?.disconnect(),document.removeEventListener(`visibilitychange`,this.#y.bind(this))}#v(e){this.#n=e[0].isIntersecting,this.#n?this.#w():this.#T()}#y(e){this.#n&&(document.hidden?this.#T():this.#w())}#b(){this.#o&&clearTimeout(this.#o),this.#o=setTimeout(this.resize.bind(this),100)}resize(){let e,t;this.#e.size instanceof Object?(e=this.#e.size.width,t=this.#e.size.height):this.#e.size===`parent`&&this.canvas.parentNode?(e=this.canvas.parentNode.offsetWidth,t=this.canvas.parentNode.offsetHeight):(e=window.innerWidth,t=window.innerHeight),this.size.width=e,this.size.height=t,this.size.ratio=e/t,this.#x(),this.#C(),this.onAfterResize(this.size)}#x(){this.camera.aspect=this.size.width/this.size.height,this.camera.isPerspectiveCamera&&this.cameraFov&&(this.cameraMinAspect&&this.camera.aspectthis.cameraMaxAspect?this.#S(this.cameraMaxAspect):this.camera.fov=this.cameraFov),this.camera.updateProjectionMatrix(),this.updateWorldSize()}#S(e){let t=Math.tan(dn.degToRad(this.cameraFov/2))/(this.camera.aspect/e);this.camera.fov=2*dn.radToDeg(Math.atan(t))}updateWorldSize(){if(this.camera.isPerspectiveCamera){let e=this.camera.fov*Math.PI/180;this.size.wHeight=2*Math.tan(e/2)*this.camera.position.length(),this.size.wWidth=this.size.wHeight*this.camera.aspect}else this.camera.isOrthographicCamera&&(this.size.wHeight=this.camera.top-this.camera.bottom,this.size.wWidth=this.camera.right-this.camera.left)}#C(){this.renderer.setSize(this.size.width,this.size.height),this.#t?.setSize(this.size.width,this.size.height);let e=window.devicePixelRatio;this.maxPixelRatio&&e>this.maxPixelRatio?e=this.maxPixelRatio:this.minPixelRatio&&e0?1/e:0}#w(){if(this.#r)return;let e=()=>{this.#l=requestAnimationFrame(e),this.#c.elapsed=this.#s.getElapsedTime();let t=this.#c.elapsed-this.#f;(!this.#u||this.#u&&t>this.#d)&&(this.#c.delta=t,this.onBeforeRender(this.#c),this.render(),this.onAfterRender(this.#c),this.#f=this.#c.elapsed)};this.#r=!0,this.#s.start(),e()}#T(){this.#r&&(cancelAnimationFrame(this.#l),this.#r=!1,this.#s.stop(),this.#f=0)}#E(){this.renderer.render(this.scene,this.camera)}clear(){this.scene.traverse(e=>{e.isMesh&&typeof e.material==`object`&&(Object.keys(e.material).forEach(t=>{let n=e.material[t];typeof n==`object`&&n&&typeof n.dispose==`function`&&n.dispose()}),e.material.dispose(),e.geometry.dispose())}),this.scene.clear()}dispose(){this.#_(),this.#T(),this.clear(),this.#t?.dispose(),this.renderer.dispose(),this.isDisposed=!0}},Lc=new Map,Rc=new fn,zc,Bc,Vc=!1;function Hc(e){let t={position:new fn,nPosition:new fn,hover:!1,pressed:!1,onEnter(){},onLeave(){},onMove(){},onDown(){},onUp(){},onClick(){},...e};return function(e,t){Lc.has(e)||(Lc.set(e,t),Vc||=(document.body.addEventListener(`pointermove`,Wc),document.body.addEventListener(`pointerleave`,Gc),document.body.addEventListener(`pointerdown`,Kc),document.body.addEventListener(`pointerup`,qc),document.body.addEventListener(`click`,Jc),!0))}(e.domElement,t),t.dispose=()=>{var t=e.domElement;Lc.delete(t),Lc.size===0&&(document.body.removeEventListener(`pointermove`,Wc),document.body.removeEventListener(`pointerleave`,Gc),document.body.removeEventListener(`pointerdown`,Kc),document.body.removeEventListener(`pointerup`,qc),document.body.removeEventListener(`click`,Jc),Vc=!1)},t}function Uc(e,t){Rc.x=e.clientX,Rc.y=e.clientY;for(let[e,n]of Lc)t(n,e.getBoundingClientRect())}function Wc(e){Uc(e,(t,n)=>{Xc(n)?(Yc(t,n),t.hover||(t.hover=!0,t.onEnter(t)),t.pressed=e.buttons>0,t.onMove(t)):t.hover&&(t.hover=!1,t.pressed=!1,t.onLeave(t))})}function Gc(){for(let e of Lc.values())e.hover&&(e.hover=!1,e.onLeave(e))}function Kc(e){Uc(e,(e,t)=>{Xc(t)&&(Yc(e,t),e.onDown(e))})}function qc(e){Uc(e,(e,t)=>{Xc(t)&&(Yc(e,t),e.onUp(e))})}function Jc(e){Uc(e,(e,t)=>{Xc(t)&&(Yc(e,t),e.onClick(e))})}function Yc(e,t){let{position:n,nPosition:r}=e;n.x=Rc.x-t.left,n.y=Rc.y-t.top,r.x=n.x/t.width*2-1,r.y=-n.y/t.height*2+1}function Xc(e){let{x:t,y:n}=Rc,{left:r,top:i,width:a,height:o}=e;return t>=r&&t<=r+a&&n>=i&&n<=i+o}var Zc=class extends Ia{constructor(e){super(e),this.type=Le}parse(e){let t=function(e,t){switch(e){case 1:throw Error(`THREE.HDRLoader: Read Error: `+(t||``));case 2:throw Error(`THREE.HDRLoader: Write Error: `+(t||``));case 3:throw Error(`THREE.HDRLoader: Bad File Format: `+(t||``));default:throw Error(`THREE.HDRLoader: Memory Error: `+(t||``))}},n=function(e,t,n){t||=1024;let r=e.pos,i=-1,a=0,o=``,s=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));for(;0>(i=s.indexOf(` +`))&&a=e.byteLength||!(c=n(e)))&&t(1,`no header found`),(l=c.match(/^#\?(\S+)/))||t(3,`bad initial token`),s.valid|=1,s.programtype=l[1],s.string+=c+` +`;c=n(e),!1!==c;)if(s.string+=c+` +`,c.charAt(0)!==`#`){if((l=c.match(r))&&(s.gamma=parseFloat(l[1])),(l=c.match(i))&&(s.exposure=parseFloat(l[1])),(l=c.match(a))&&(s.valid|=2,s.format=l[1]),(l=c.match(o))&&(s.valid|=4,s.height=parseInt(l[1],10),s.width=parseInt(l[2],10)),2&s.valid&&4&s.valid)break}else s.comments+=c+` +`;return 2&s.valid||t(3,`missing format specifier`),4&s.valid||t(3,`missing image size specifier`),s}(a),s=o.width,c=o.height,l=function(e,n,r){let i=n;if(i<8||i>32767||e[0]!==2||e[1]!==2||128&e[2])return new Uint8Array(e);i!==(e[2]<<8|e[3])&&t(3,`wrong scanline width`);let a=new Uint8Array(4*n*r);a.length||t(4,`unable to allocate buffer space`);let o=0,s=0,c=4*i,l=new Uint8Array(4),u=new Uint8Array(c),d=r;for(;d>0&&se.byteLength&&t(1),l[0]=e[s++],l[1]=e[s++],l[2]=e[s++],l[3]=e[s++],l[0]==2&&l[1]==2&&(l[2]<<8|l[3])==i||t(3,`bad rgbe scanline format`);let n,r=0;for(;r128;if(i&&(n-=128),(n===0||r+n>c)&&t(3,`bad scanline data`),i){let t=e[s++];for(let e=0;e{t.isMesh&&(e.add(t.geometry),e.add(t.material))});for(let t of e)t.dispose()}};function el(e){return new Ta({color:0,emissive:16777215,emissiveIntensity:e})}var tl=new Ja(-1,1,1,-1,0,1),nl=new class extends wi{constructor(){super(),this.setAttribute(`position`,new gi([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute(`uv`,new gi([0,2,0,0,2,0],2))}},rl=class{constructor(e){this._mesh=new Ii(nl,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,tl)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}},il=`varying vec2 vUv;void main(){vUv=uv;gl_Position=vec4(position,1.0);}`,al=512,ol=class{#e;#t;#n;attenuation;#r;#i;#a;#o;#s;#c;#l;#u=[];constructor({renderer:e}){this.#e=e,this.#t={value:1},this.#n={value:new fn(1/al,1/al)},this.attenuation={value:.995},this.#d(),this.#f()}#d(){let e={minFilter:De,magFilter:De,type:Ie,format:Ue,depthBuffer:!1,stencilBuffer:!1};this.#r=new Pn(al,al,e),this.#i=new Pn(al,al,e),this.#a=new rl}#f(){this.#o=new Ui({uniforms:{tDiffuse:{value:null}},vertexShader:il,fragmentShader:`uniform sampler2D tDiffuse;varying vec2 vUv;void main(){gl_FragColor=texture2D(tDiffuse,vUv);}`}),this.#s=new Ui({uniforms:{tDiffuse:{value:null},texelSize:this.#n,attenuation:this.attenuation},vertexShader:il,fragmentShader:`uniform sampler2D tDiffuse;uniform vec2 texelSize;uniform float attenuation;varying vec2 vUv;void main(){vec4 texel=texture2D(tDiffuse,vUv);vec2 dx=vec2(texelSize.x,0.0);vec2 dy=vec2(0.0,texelSize.y);float average=(texture2D(tDiffuse,vUv-dx).r+texture2D(tDiffuse,vUv-dy).r+texture2D(tDiffuse,vUv+dx).r+texture2D(tDiffuse,vUv+dy).r)*0.25;texel.g+=(average-texel.r)*2.0;texel.g*=attenuation;texel.r+=texel.g;gl_FragColor=texel;}`}),this.#c=new Ui({uniforms:{tDiffuse:{value:null},texelSize:this.#n},vertexShader:il,fragmentShader:`uniform sampler2D tDiffuse;uniform vec2 texelSize;varying vec2 vUv;void main(){vec4 texel=texture2D(tDiffuse,vUv);vec3 dx=vec3(texelSize.x,0.0,texture2D(tDiffuse,vec2(vUv.x+texelSize.x,vUv.y)).r-texel.r);vec3 dy=vec3(0.0,texelSize.y,texture2D(tDiffuse,vec2(vUv.x,vUv.y+texelSize.y)).r-texel.r);texel.ba=normalize(cross(dx,dy)).xy;gl_FragColor=texel;}`}),this.#l=new Ui({uniforms:{tDiffuse:{value:null},aspectRatio:this.#t,center:new Za(new fn),radius:{value:.05},strength:{value:.5}},vertexShader:il,fragmentShader:`const float PI=3.1415926535897932384626433832795;uniform sampler2D tDiffuse;uniform float aspectRatio;uniform vec2 center;uniform float radius;uniform float strength;varying vec2 vUv;void main(){vec4 texel=texture2D(tDiffuse,vUv);vec2 p=center*0.5+0.5-vUv;p.x*=aspectRatio;float drop=max(0.0,1.0-length(p)/radius);drop=0.5-cos(drop*PI)*0.5;texel.r+=drop*strength;gl_FragColor=texel;}`})}get texture(){return this.#r.texture}setSize({width:e,height:t,ratio:n}){let r=e,i=t;e>t?(r=al,i=Math.floor(al/e*t)):(i=al,r=Math.floor(al/t*e)),this.#t.value=n,this.#n.value.set(1/r,1/i),this.#r.setSize(r,i),this.#i.setSize(r,i)}update(){let e=this.#e.getRenderTarget();this.#h(),this.#p(),this.#m(),this.#e.setRenderTarget(e)}#p(){this.#s.uniforms.tDiffuse.value=this.#r.texture,this.#_(this.#s,this.#i),this.#v()}#m(){this.#c.uniforms.tDiffuse.value=this.#r.texture,this.#_(this.#c,this.#i),this.#v()}addDrop(e,t,n,r){this.#u.push({x:e,y:t,radius:n,strength:r})}#h(){for(let e=0;e1?n*this.#t.value:n,this.#l.uniforms.strength.value=r,this.#_(this.#l,this.#i),this.#v()}#_(e,t){this.#a.material=e,this.#e.setRenderTarget(t),this.#a.render(this.#e)}#v(){let e=this.#r;this.#r=this.#i,this.#i=e}dispose(){this.#o.dispose(),this.#s.dispose(),this.#c.dispose(),this.#l.dispose(),this.#r.dispose(),this.#i.dispose()}},sl=class extends Ii{#e;#t=1;constructor({renderer:e}){super(new Ca(1,1,1,1),new wa({metalness:.75,roughness:.5})),this.rotation.x=-Math.PI/2,this.#e=new ol({renderer:e}),this.uniforms={uvMapScale:{value:new fn(1,1)},displacementMap:{value:this.#e.texture},displacementScale:{value:1}},this.material.defines={USE_UV:``},this.material.onBeforeCompile=e=>{Object.assign(e.uniforms,this.uniforms),e.fragmentShader=` + uniform vec2 uvMapScale; + uniform sampler2D displacementMap; + uniform float displacementScale; + + float redOffset = 0.01; + float greenOffset = 0.02; + float blueOffset = 0.03; + `+e.fragmentShader,e.fragmentShader=e.fragmentShader.replace(`#include `,` + vec4 disp = texture2D(displacementMap, vUv); + vec3 transformedNormal = vec3(disp.b, disp.a, sqrt(1.0 - dot(disp.ba, disp.ba))); + #ifdef USE_MAP + // vec2 newUv = ((vUv - 0.5) * uvMapScale + 0.5) + transformedNormal.xy * transformedNormal.z * displacementScale * 0.02; + vec2 dUv = transformedNormal.xy * displacementScale * 0.02; + vec2 newUv = ((vUv - 0.5) * uvMapScale + 0.5) + dUv; + float st = smoothstep(0.0, 0.1, length(dUv)); + diffuseColor.r *= texture2D(map, newUv + redOffset * st).r; + diffuseColor.g *= texture2D(map, newUv + greenOffset * st).g; + diffuseColor.b *= texture2D(map, newUv + blueOffset * st).b; + // vec4 sampledDiffuseColor = texture2D(map, newUv); + // diffuseColor *= sampledDiffuseColor; + #endif + `),e.fragmentShader=e.fragmentShader.replace(`#include `,` + normal = transformedNormal; + `)};let t=new Co(e).fromScene(new $c,.04).texture;this.material.envMap=t}get attenuation(){return this.#e.attenuation.value}set attenuation(e){this.#e.attenuation.value=e}update(){this.#e.update()}addDrop(e,t,n,r){this.#e.addDrop(e,t,n,r)}setImage(e){this.material.map=e,this.material.needsUpdate=!0,this.#n()}#n(){let e=this.material.map;if(e&&e.image){let t=e.image.width/e.image.height;this.#t{r.addDrop(a.nPosition.x,a.nPosition.y,.025,.0025)},a.onClick=()=>{r.addDrop(a.nPosition.x,a.nPosition.y,.025,.05)},n.onBeforeRender=e=>{i.enable&&(i.time+=e.delta,i.time>i.timeDelta&&(r.addDrop(cl(2),cl(2),ll(.01,.02),ll(.001,.005)),i.time=0)),r.update()},n.onAfterResize=e=>{r.setSize(e)},{three:n,liquidPlane:r,async loadImage(e){if(e){let t=await Qc(e);t.colorSpace=kt,r.setImage(t)}else r.setImage(null)},async loadEnvMap(e){if(e){let t=await Qc(e);t.colorSpace=kt,t.mapping=ye,r.setEnvMap(t)}else r.setEnvMap(null)},setRain(e){i.enable=e},setRainTime(e){i.timeDelta=e},dispose:()=>{a.dispose(),r.dispose(),n.dispose()}}}var dl=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),fl=o(((e,t)=>{t.exports=dl()})),F=fl();function pl({onEnter:e}){let t=(0,y.useRef)(null),n=(0,y.useRef)(null),[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(!1);return(0,y.useEffect)(()=>{let e=!1;async function r(){if(e||!t.current)return;let r=ul(t.current);n.current=r,r.loadImage(`/liquid-dark.webp`),r.liquidPlane.material.metalness=.75,r.liquidPlane.material.roughness=.58,r.liquidPlane.uniforms.displacementScale.value=5,r.setRain(!1),setTimeout(()=>{e||o(!0)},300)}return r(),()=>{e=!0,n.current&&=(n.current.dispose(),null)}},[]),(0,F.jsxs)(`div`,{className:`absolute inset-0 z-30 cursor-pointer`,onClick:(0,y.useCallback)(()=>{r||(i(!0),setTimeout(()=>{n.current&&=(n.current.dispose(),null),e()},600))},[r,e]),children:[(0,F.jsx)(`canvas`,{ref:t,className:`absolute inset-0 w-full h-full transition-opacity duration-700 ${a?`opacity-100`:`opacity-0`}`}),(0,F.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-end transition-opacity duration-500 pb-10 ${r?`opacity-0`:a?`opacity-100`:`opacity-0`}`,children:[(0,F.jsxs)(`h1`,{className:`text-6xl sm:text-7xl font-bold tracking-tight select-none`,children:[(0,F.jsx)(`span`,{className:`text-black`,children:`LFM2.5`}),` `,(0,F.jsx)(`span`,{className:`text-gray-900`,children:`WebGPU`})]}),(0,F.jsx)(`p`,{className:`mt-6 text-lg text-gray-800 select-none animate-pulse-gentle`,children:`Click anywhere to start`})]}),(0,F.jsxs)(`div`,{className:`absolute bottom-4 right-4 text-right text-gray-500/70 select-none transition-opacity duration-500 flex flex-col space-y-[4px] ${r?`opacity-0`:a?`opacity-100`:`opacity-0`}`,children:[(0,F.jsx)(`a`,{href:`https://codepen.io/soju22/pen/myVWBGa`,target:`_blank`,rel:`noreferrer`,className:`hover:text-gray-800 transition-colors text-[14px]`,onClick:e=>e.stopPropagation(),children:`Liquid effect by Kevin Levron`}),(0,F.jsx)(`a`,{href:`https://creativecommons.org/licenses/by-nc-sa/4.0/`,target:`_blank`,rel:`noreferrer`,className:`hover:text-gray-800 transition-colors text-[12px]`,onClick:e=>e.stopPropagation(),children:`Licensed under CC BY-NC-SA 4.0`})]}),(0,F.jsx)(`div`,{className:`absolute inset-0 bg-white transition-opacity duration-600 pointer-events-none ${r?`opacity-100`:`opacity-0`}`})]})}var ml=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),hl=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),gl=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),_l=e=>{let t=gl(e);return t.charAt(0).toUpperCase()+t.slice(1)},vl={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},yl=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},bl=(0,y.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,y.createElement)(`svg`,{ref:c,...vl,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ml(`lucide`,i),...!a&&!yl(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,y.createElement)(e,t)),...Array.isArray(a)?a:[a]])),xl=(e,t)=>{let n=(0,y.forwardRef)(({className:n,...r},i)=>(0,y.createElement)(bl,{ref:i,iconNode:t,className:ml(`lucide-${hl(_l(e))}`,`lucide-${e}`,n),...r}));return n.displayName=_l(e),n},Sl=xl(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),Cl=xl(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),wl=xl(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Tl=xl(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),El=xl(`clipboard-check`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`m9 14 2 2 4-4`,key:`df797q`}]]),Dl=xl(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Ol=xl(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),kl=xl(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Al=xl(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),jl=xl(`rocket`,[[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z`,key:`m3kijz`}],[`path`,{d:`m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z`,key:`1fmvmk`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0`,key:`1f8sc4`}],[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}]]),Ml=xl(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Nl=xl(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),Pl=xl(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Fl=xl(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Il=xl(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Ll=e=>(0,F.jsxs)(`svg`,{...e,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,children:[(0,F.jsx)(`path`,{d:`M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z`,fill:`#FF9D0B`}),(0,F.jsx)(`path`,{d:`M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z`,fill:`#FFD21E`}),(0,F.jsx)(`path`,{d:`M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-.576-.393-.394-1.023-.089-.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-.586 0 1.107.79 3.263 3.25 3.263h-.003z`,fill:`#FF323D`}),(0,F.jsx)(`path`,{d:`M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003zm1.12 5.34a2.166 2.166 0 011.325-1.106c.07-.02.144.06.219.171l.192.306c.069.1.139.175.209.175.074 0 .15-.074.223-.172l.205-.302c.08-.11.157-.188.234-.165.537.168.986.536 1.25 1.026.932-.724 1.275-1.905 1.275-2.633 0-.508-.306-.426-.81-.19l-.616.296c-.52.24-1.148.48-1.824.48-.676 0-1.302-.24-1.823-.48l-.589-.283c-.52-.248-.838-.342-.838.177 0 .703.32 1.831 1.187 2.56l.18.14z`,fill:`#3A3B45`}),(0,F.jsx)(`path`,{d:`M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8zM4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694.244-.162.523-.265.814-.3l.176-.012z`,fill:`#FF9D0B`}),(0,F.jsx)(`path`,{d:`M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-.573.534-.375-.677-1.405-2.416-1.94-2.751-.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-.522z`,fill:`#FFD21E`})]}),Rl=[{title:`Step-by-step reasoning`,eyebrow:`REASONING MODEL`,body:`LFM2.5-Thinking generates its reasoning process before producing final answers, improving accuracy on complex tasks like math, coding, and logic.`,Icon:jl},{title:`Private edge inference`,eyebrow:`LOCAL & PRIVATE`,body:`WebGPU-accelerated browser inference ensures high performance. No data is sent to a server, and the demo can even run offline after the initial download.`,Icon:Pl},{title:`Scaled reinforcement`,eyebrow:`TRAINING PIPELINE`,body:`The 1.2B parameter model benefits from extended pre-training on 28T tokens and large-scale multi-stage reinforcement learning for best-in-class performance.`,Icon:Cl}];function zl({onStart:e,status:t,isLoading:n,showChat:r}){let[i,a]=(0,y.useState)(!0);(0,y.useEffect)(()=>{let e=setTimeout(()=>a(!1),50);return()=>clearTimeout(e)},[]);let o=n||r,s=t.state===`ready`;return(0,F.jsxs)(`div`,{className:`brand-surface relative flex h-screen flex-col overflow-hidden text-black`,children:[(0,F.jsx)(`div`,{className:`landing-brand-glow absolute inset-0`}),(0,F.jsx)(`div`,{className:`absolute inset-0 z-50 bg-white transition-opacity duration-1000 pointer-events-none ${i?`opacity-100`:`opacity-0`}`}),(0,F.jsxs)(`div`,{className:`relative z-10 mx-auto flex h-full w-full max-w-7xl flex-col px-6 pb-10 pt-8 sm:px-8 lg:px-14 transition-all duration-700 ${o?`opacity-0 translate-y-4 pointer-events-none`:`opacity-100`}`,children:[(0,F.jsxs)(`header`,{className:`animate-rise-in flex items-start justify-between`,children:[(0,F.jsx)(`img`,{src:`/liquid.svg`,alt:`Liquid AI`,className:`h-10 w-auto sm:h-12`,draggable:!1}),(0,F.jsx)(`p`,{className:`font-support text-[10px] uppercase tracking-[0.22em] text-[#000000b3] sm:text-xs`,children:`LFM2.5 WebGPU Demo`})]}),(0,F.jsx)(`section`,{className:`mt-14 flex flex-col items-center text-center`,children:(0,F.jsxs)(`div`,{className:`animate-rise-in-delayed space-y-5`,children:[(0,F.jsx)(`p`,{className:`font-support text-xs uppercase tracking-[0.2em] text-[#5505afb3]`,children:`Capable and efficient general-purpose AI systems at every scale`}),(0,F.jsxs)(`h1`,{className:`max-w-3xl text-4xl font-bold leading-[1.04] tracking-tight sm:text-6xl lg:text-7xl`,children:[`Capable reasoning.`,(0,F.jsx)(`br`,{}),`Local inference.`,(0,F.jsx)(`br`,{}),`WebGPU accelerated.`]}),(0,F.jsxs)(`p`,{className:`max-w-2xl mx-auto text-base leading-relaxed text-[#000000b3] sm:text-lg`,children:[`Run`,(0,F.jsx)(`a`,{href:`https://huggingface.co/LiquidAI/LFM2.5-1.2B-Thinking-ONNX`,target:`_blank`,rel:`noreferrer`,className:`mx-1 underline decoration-[#5505af4d] underline-offset-4 hover:text-[#5505af] transition-colors`,children:`LFM2.5-1.2B-Thinking`}),`directly in your browser, powered by`,(0,F.jsx)(Ll,{className:`size-7 inline-block ml-1 mb-[1px]`}),(0,F.jsx)(`a`,{href:`https://github.com/huggingface/transformers.js`,target:`_blank`,rel:`noreferrer`,className:`ml-1 underline decoration-[#5505af4d] underline-offset-4 hover:text-[#5505af] transition-colors`,children:`Transformers.js`})]})]})}),(0,F.jsx)(`section`,{className:`mt-10 flex flex-col lg:flex-row gap-4`,children:Rl.map(({eyebrow:e,title:t,body:n,Icon:r},i)=>(0,F.jsxs)(`article`,{className:`animate-rise-in flex-1 flex items-start gap-4 rounded-2xl border border-[#0000001a] bg-[#ffffffcc] px-4 py-4 backdrop-blur-sm sm:gap-5 sm:px-6 sm:py-5`,style:{animationDelay:`${120+i*90}ms`},children:[(0,F.jsx)(`div`,{className:`flex h-11 w-11 shrink-0 items-center justify-center rounded-xl border border-[#5505af4d] bg-[linear-gradient(135deg,#5505AF_0%,#CD82F0_55%,#FF5F1E_100%)] text-white`,children:(0,F.jsx)(r,{className:`h-5 w-5`})}),(0,F.jsxs)(`div`,{className:`min-w-0 text-left`,children:[(0,F.jsx)(`p`,{className:`font-support text-[10px] uppercase tracking-[0.2em] text-[#00000080]`,children:e}),(0,F.jsx)(`h3`,{className:`mt-1 text-xl font-medium leading-tight text-black`,children:t}),(0,F.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-[#000000b3] sm:text-[15px]`,children:n})]})]},t))}),(0,F.jsxs)(`section`,{className:`mt-10 flex flex-col items-center animate-rise-in`,style:{animationDelay:`400ms`},children:[(0,F.jsxs)(`button`,{onClick:e,className:`inline-flex w-full max-w-sm items-center justify-center gap-2 rounded-xl bg-black px-6 py-3.5 text-base font-semibold text-white transition-transform duration-200 hover:-translate-y-0.5 hover:bg-[#5505af] cursor-pointer`,children:[s?`Start chatting`:`Load model & start chatting`,(0,F.jsx)(Sl,{className:`h-4 w-4`})]}),!s&&(0,F.jsx)(`p`,{className:`mt-3 text-xs text-[#00000080]`,children:`~750 MB will be downloaded and cached locally for future sessions.`})]})]}),(0,F.jsx)(`div`,{className:`brand-surface absolute inset-0 z-20 flex flex-col items-center justify-center transition-opacity duration-700 ${n?`opacity-100`:`opacity-0 pointer-events-none`}`,children:(0,F.jsxs)(`div`,{className:`flex w-full max-w-md flex-col items-center px-6 transition-all duration-700 ${n?`opacity-100 translate-y-0`:`opacity-0 translate-y-4`}`,children:[(0,F.jsx)(`img`,{src:`/liquid.svg`,alt:`Liquid AI`,className:`mb-8 h-9 w-auto`,draggable:!1}),(0,F.jsx)(Ol,{className:`h-10 w-10 animate-spin text-[#5505af]`}),(0,F.jsx)(`p`,{className:`mt-4 text-sm tracking-wide text-[#000000b3]`,children:t.state===`loading`?t.message??`Loading model…`:t.state===`error`?`Error`:`Initializing…`}),(0,F.jsx)(`div`,{className:`mt-4 h-1.5 w-full rounded-full bg-[#0000001a] overflow-hidden`,children:(0,F.jsx)(`div`,{className:`h-full rounded-full bg-[linear-gradient(90deg,#5505AF_0%,#CD82F0_60%,#FF5F1E_100%)] transition-[width] duration-300 ease-out`,style:{width:`${t.state===`ready`?100:t.state===`loading`&&t.progress!=null?t.progress:0}%`}})}),t.state===`error`&&(0,F.jsx)(`p`,{className:`mt-3 text-sm text-red-600`,children:t.error})]})})]})}var Bl=0;function Vl(){return Bl++}const Hl=(0,y.createContext)(null);function Ul(){let e=(0,y.useContext)(Hl);if(!e)throw Error(`useLLM must be used within `);return e}const Wl=(function(e){if(e==null)return Yl;if(typeof e==`function`)return Jl(e);if(typeof e==`object`)return Array.isArray(e)?Gl(e):Kl(e);if(typeof e==`string`)return ql(e);throw Error(`Expected function, string, or object as test`)});function Gl(e){let t=[],n=-1;for(;++n`:``))+`)`})}return u;function u(){let l=Ql,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=tu(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&de===`*`),c=n.length&&!n.every(e=>e===`*`);if(!e&&(s||c))throw Error(`defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided`);return s=>{nu(s,uu(e,t,n,r,i,a,o))}}function iu(e,t){if(typeof e!=`string`)return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`))try{return new URL(e,`http://example.com`)}catch{return null}return null}}function au(e){return typeof e==`string`?e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`):!1}var ou=new Set([`https:`,`http:`,`irc:`,`ircs:`,`mailto:`,`xmpp:`,`blob:`]),su=new Set([`javascript:`,`data:`,`file:`,`vbscript:`]);function cu(e,t,n,r=!1,i=!1,a=[]){if(!e)return null;if(typeof e==`string`&&e.startsWith(`#`)&&!i)try{if(new URL(e,`http://example.com`).hash===e)return e}catch{}if(typeof e==`string`&&e.startsWith(`data:`))return i&&r&&e.startsWith(`data:image/`)?e:null;if(typeof e==`string`&&e.startsWith(`blob:`)){try{if(new URL(e).protocol===`blob:`&&e.length>5){let t=e.substring(5);if(t&&t.length>0&&t!==`invalid`)return e}}catch{return null}return null}let o=iu(e,n);if(!o||su.has(o.protocol)||!(ou.has(o.protocol)||a.includes(o.protocol)||a.includes(`*`)))return null;if(o.protocol===`mailto:`||!o.protocol.match(/^https?:$/))return o.href;let s=au(e);return o&&t.some(e=>{let t=iu(e,n);return!t||t.origin!==o.origin?!1:o.href.startsWith(t.href)})?s?o.pathname+o.search+o.hash:o.href:t.includes(`*`)?o.protocol!==`https:`&&o.protocol!==`http:`?null:s?o.pathname+o.search+o.hash:o.href:null}var lu=Symbol(`node-seen`),uu=(e,t,n,r,i,a,o)=>{let s=(c,l,u)=>{if(c.type!==`element`||c[lu])return!0;if(c.tagName===`a`){let n=cu(c.properties.href,t,e,!1,!1,i);return n===null?(c[lu]=!0,nu(c,s),u&&typeof l==`number`&&(u.children[l]={type:`element`,tagName:`span`,properties:{title:`Blocked URL: `+String(c.properties.href),class:o},children:[...c.children,{type:`text`,value:` [blocked]`}]}),$l):(c.properties.href=n,c.properties.target=`_blank`,c.properties.rel=`noopener noreferrer`,!0)}if(c.tagName===`img`){let t=cu(c.properties.src,n,e,r,!0,i);return t===null?(c[lu]=!0,nu(c,s),u&&typeof l==`number`&&(u.children[l]={type:`element`,tagName:`span`,properties:{class:a},children:[{type:`text`,value:`[Image blocked: `+String(c.properties.alt||`No description`)+`]`}]}),$l):(c.properties.src=t,!0)}return!0};return s},du=typeof self==`object`?self:globalThis,fu=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new du[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new du[a](o),i)};return r};const pu=e=>fu(new Map,e)(0);var mu=``,{toString:hu}={},{keys:gu}=Object,_u=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=hu.call(e).slice(8,-1);switch(n){case`Array`:return[1,mu];case`Object`:return[2,mu];case`Date`:return[3,mu];case`RegExp`:return[4,mu];case`Map`:return[5,mu];case`Set`:return[6,mu];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},vu=([e,t])=>e===0&&(t===`function`||t===`symbol`),yu=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=_u(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of gu(r))(e||!vu(_u(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(vu(_u(n))||vu(_u(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!vu(_u(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a};const bu=(e,{json:t,lossy:n}={})=>{let r=[];return yu(!(t||n),!!t,new Map,r)(e),r};var xu=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?pu(bu(e,t)):structuredClone(e):(e,t)=>pu(bu(e,t)),Su=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Su.prototype.normal={},Su.prototype.property={},Su.prototype.space=void 0;function Cu(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Su(n,r,t)}function wu(e){return e.toLowerCase()}var Tu=class{constructor(e,t){this.attribute=t,this.property=e}};Tu.prototype.attribute=``,Tu.prototype.booleanish=!1,Tu.prototype.boolean=!1,Tu.prototype.commaOrSpaceSeparated=!1,Tu.prototype.commaSeparated=!1,Tu.prototype.defined=!1,Tu.prototype.mustUseProperty=!1,Tu.prototype.number=!1,Tu.prototype.overloadedBoolean=!1,Tu.prototype.property=``,Tu.prototype.spaceSeparated=!1,Tu.prototype.space=void 0;var Eu=s({boolean:()=>Ou,booleanish:()=>ku,commaOrSpaceSeparated:()=>Pu,commaSeparated:()=>Nu,number:()=>ju,overloadedBoolean:()=>Au,spaceSeparated:()=>Mu}),Du=0;const Ou=Fu(),ku=Fu(),Au=Fu(),ju=Fu(),Mu=Fu(),Nu=Fu(),Pu=Fu();function Fu(){return 2**++Du}var Iu=Object.keys(Eu),Lu=class extends Tu{constructor(e,t,n,r){let i=-1;if(super(e,t),Ru(this,`space`,r),typeof n==`number`)for(;++i4&&n.slice(0,4)===`data`&&Zu.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Xu,ed);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Xu.test(e)){let n=e.replace(Yu,$u);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Lu}return new i(r,t)}function $u(e){return`-`+e.toLowerCase()}function ed(e){return e.charAt(1).toUpperCase()}const td=Cu([Bu,Uu,Gu,Ku,qu],`html`),nd=Cu([Bu,Wu,Gu,Ku,qu],`svg`);function rd(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function id(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var ad=/[#.]/g;function od(e,t){let n=e||``,r={},i=0,a,o;for(;i-1&&e<=t.length){let r=0;for(;;){let i=n[r];if(i===void 0){let e=bd(t,n[r-1]);i=e===-1?t.length+1:e+1,n[r]=i}if(i>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}function i(e){if(e&&typeof e.line==`number`&&typeof e.column==`number`&&!Number.isNaN(e.line)&&!Number.isNaN(e.column)){for(;n.length1?n[e.line-2]:0)+e.column-1;if(r=55296&&e<=57343}function Zd(e){return e>=56320&&e<=57343}function Qd(e,t){return(e-55296)*1024+9216+t}function $d(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function ef(e){return e>=64976&&e<=65007||Jd.has(e)}var L;(function(e){e.controlCharacterInInputStream=`control-character-in-input-stream`,e.noncharacterInInputStream=`noncharacter-in-input-stream`,e.surrogateInInputStream=`surrogate-in-input-stream`,e.nonVoidHtmlElementStartTagWithTrailingSolidus=`non-void-html-element-start-tag-with-trailing-solidus`,e.endTagWithAttributes=`end-tag-with-attributes`,e.endTagWithTrailingSolidus=`end-tag-with-trailing-solidus`,e.unexpectedSolidusInTag=`unexpected-solidus-in-tag`,e.unexpectedNullCharacter=`unexpected-null-character`,e.unexpectedQuestionMarkInsteadOfTagName=`unexpected-question-mark-instead-of-tag-name`,e.invalidFirstCharacterOfTagName=`invalid-first-character-of-tag-name`,e.unexpectedEqualsSignBeforeAttributeName=`unexpected-equals-sign-before-attribute-name`,e.missingEndTagName=`missing-end-tag-name`,e.unexpectedCharacterInAttributeName=`unexpected-character-in-attribute-name`,e.unknownNamedCharacterReference=`unknown-named-character-reference`,e.missingSemicolonAfterCharacterReference=`missing-semicolon-after-character-reference`,e.unexpectedCharacterAfterDoctypeSystemIdentifier=`unexpected-character-after-doctype-system-identifier`,e.unexpectedCharacterInUnquotedAttributeValue=`unexpected-character-in-unquoted-attribute-value`,e.eofBeforeTagName=`eof-before-tag-name`,e.eofInTag=`eof-in-tag`,e.missingAttributeValue=`missing-attribute-value`,e.missingWhitespaceBetweenAttributes=`missing-whitespace-between-attributes`,e.missingWhitespaceAfterDoctypePublicKeyword=`missing-whitespace-after-doctype-public-keyword`,e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers=`missing-whitespace-between-doctype-public-and-system-identifiers`,e.missingWhitespaceAfterDoctypeSystemKeyword=`missing-whitespace-after-doctype-system-keyword`,e.missingQuoteBeforeDoctypePublicIdentifier=`missing-quote-before-doctype-public-identifier`,e.missingQuoteBeforeDoctypeSystemIdentifier=`missing-quote-before-doctype-system-identifier`,e.missingDoctypePublicIdentifier=`missing-doctype-public-identifier`,e.missingDoctypeSystemIdentifier=`missing-doctype-system-identifier`,e.abruptDoctypePublicIdentifier=`abrupt-doctype-public-identifier`,e.abruptDoctypeSystemIdentifier=`abrupt-doctype-system-identifier`,e.cdataInHtmlContent=`cdata-in-html-content`,e.incorrectlyOpenedComment=`incorrectly-opened-comment`,e.eofInScriptHtmlCommentLikeText=`eof-in-script-html-comment-like-text`,e.eofInDoctype=`eof-in-doctype`,e.nestedComment=`nested-comment`,e.abruptClosingOfEmptyComment=`abrupt-closing-of-empty-comment`,e.eofInComment=`eof-in-comment`,e.incorrectlyClosedComment=`incorrectly-closed-comment`,e.eofInCdata=`eof-in-cdata`,e.absenceOfDigitsInNumericCharacterReference=`absence-of-digits-in-numeric-character-reference`,e.nullCharacterReference=`null-character-reference`,e.surrogateCharacterReference=`surrogate-character-reference`,e.characterReferenceOutsideUnicodeRange=`character-reference-outside-unicode-range`,e.controlCharacterReference=`control-character-reference`,e.noncharacterCharacterReference=`noncharacter-character-reference`,e.missingWhitespaceBeforeDoctypeName=`missing-whitespace-before-doctype-name`,e.missingDoctypeName=`missing-doctype-name`,e.invalidCharacterSequenceAfterDoctypeName=`invalid-character-sequence-after-doctype-name`,e.duplicateAttribute=`duplicate-attribute`,e.nonConformingDoctype=`non-conforming-doctype`,e.missingDoctype=`missing-doctype`,e.misplacedDoctype=`misplaced-doctype`,e.endTagWithoutMatchingOpenElement=`end-tag-without-matching-open-element`,e.closingOfElementWithOpenChildElements=`closing-of-element-with-open-child-elements`,e.disallowedContentInNoscriptInHead=`disallowed-content-in-noscript-in-head`,e.openElementsLeftAfterEof=`open-elements-left-after-eof`,e.abandonedHeadElementChild=`abandoned-head-element-child`,e.misplacedStartTagForHeadElement=`misplaced-start-tag-for-head-element`,e.nestedNoscriptInHead=`nested-noscript-in-head`,e.eofInElementThatCanContainOnlyText=`eof-in-element-that-can-contain-only-text`})(L||={});var tf=65536,nf=class{constructor(e){this.handler=e,this.html=``,this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=tf,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(Zd(t))return this.pos++,this._addGap(),Qd(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,I.EOF;return this._err(L.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,I.EOF;let n=this.html.charCodeAt(t);return n===I.CARRIAGE_RETURN?I.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,I.EOF;let e=this.html.charCodeAt(this.pos);return e===I.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,I.LINE_FEED):e===I.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Xd(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===I.LINE_FEED||e===I.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){$d(e)?this._err(L.controlCharacterInInputStream):ef(e)&&this._err(L.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const of=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0)));var sf=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);String.fromCodePoint;function cf(e){return e>=55296&&e<=57343||e>1114111?65533:sf.get(e)??e}var lf;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(lf||={});var uf=32,df;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(df||={});function ff(e){return e>=lf.ZERO&&e<=lf.NINE}function pf(e){return e>=lf.UPPER_A&&e<=lf.UPPER_F||e>=lf.LOWER_A&&e<=lf.LOWER_F}function mf(e){return e>=lf.UPPER_A&&e<=lf.UPPER_Z||e>=lf.LOWER_A&&e<=lf.LOWER_Z||ff(e)}function hf(e){return e===lf.EQUALS||mf(e)}var gf;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(gf||={});var _f;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(_f||={});var vf=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=gf.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=_f.Strict}startEntity(e){this.decodeMode=e,this.state=gf.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case gf.EntityStart:return e.charCodeAt(t)===lf.NUM?(this.state=gf.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=gf.NamedEntity,this.stateNamedEntity(e,t));case gf.NumericStart:return this.stateNumericStart(e,t);case gf.NumericDecimal:return this.stateNumericDecimal(e,t);case gf.NumericHex:return this.stateNumericHex(e,t);case gf.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|uf)===lf.LOWER_X?(this.state=gf.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=gf.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t>14;for(;t>14,i!==0){if(a===lf.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==_f.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&df.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~df.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case gf.NamedEntity:return this.result!==0&&(this.decodeMode!==_f.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case gf.NumericDecimal:return this.emitNumericEntity(0,2);case gf.NumericHex:return this.emitNumericEntity(0,3);case gf.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case gf.EntityStart:return 0}}};function yf(e,t,n,r){let i=(t&df.BRANCH_LENGTH)>>7,a=t&df.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(nr)s=t-1;else return e[t+i]}return-1}var R;(function(e){e.HTML=`http://www.w3.org/1999/xhtml`,e.MATHML=`http://www.w3.org/1998/Math/MathML`,e.SVG=`http://www.w3.org/2000/svg`,e.XLINK=`http://www.w3.org/1999/xlink`,e.XML=`http://www.w3.org/XML/1998/namespace`,e.XMLNS=`http://www.w3.org/2000/xmlns/`})(R||={});var bf;(function(e){e.TYPE=`type`,e.ACTION=`action`,e.ENCODING=`encoding`,e.PROMPT=`prompt`,e.NAME=`name`,e.COLOR=`color`,e.FACE=`face`,e.SIZE=`size`})(bf||={});var xf;(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(xf||={});var z;(function(e){e.A=`a`,e.ADDRESS=`address`,e.ANNOTATION_XML=`annotation-xml`,e.APPLET=`applet`,e.AREA=`area`,e.ARTICLE=`article`,e.ASIDE=`aside`,e.B=`b`,e.BASE=`base`,e.BASEFONT=`basefont`,e.BGSOUND=`bgsound`,e.BIG=`big`,e.BLOCKQUOTE=`blockquote`,e.BODY=`body`,e.BR=`br`,e.BUTTON=`button`,e.CAPTION=`caption`,e.CENTER=`center`,e.CODE=`code`,e.COL=`col`,e.COLGROUP=`colgroup`,e.DD=`dd`,e.DESC=`desc`,e.DETAILS=`details`,e.DIALOG=`dialog`,e.DIR=`dir`,e.DIV=`div`,e.DL=`dl`,e.DT=`dt`,e.EM=`em`,e.EMBED=`embed`,e.FIELDSET=`fieldset`,e.FIGCAPTION=`figcaption`,e.FIGURE=`figure`,e.FONT=`font`,e.FOOTER=`footer`,e.FOREIGN_OBJECT=`foreignObject`,e.FORM=`form`,e.FRAME=`frame`,e.FRAMESET=`frameset`,e.H1=`h1`,e.H2=`h2`,e.H3=`h3`,e.H4=`h4`,e.H5=`h5`,e.H6=`h6`,e.HEAD=`head`,e.HEADER=`header`,e.HGROUP=`hgroup`,e.HR=`hr`,e.HTML=`html`,e.I=`i`,e.IMG=`img`,e.IMAGE=`image`,e.INPUT=`input`,e.IFRAME=`iframe`,e.KEYGEN=`keygen`,e.LABEL=`label`,e.LI=`li`,e.LINK=`link`,e.LISTING=`listing`,e.MAIN=`main`,e.MALIGNMARK=`malignmark`,e.MARQUEE=`marquee`,e.MATH=`math`,e.MENU=`menu`,e.META=`meta`,e.MGLYPH=`mglyph`,e.MI=`mi`,e.MO=`mo`,e.MN=`mn`,e.MS=`ms`,e.MTEXT=`mtext`,e.NAV=`nav`,e.NOBR=`nobr`,e.NOFRAMES=`noframes`,e.NOEMBED=`noembed`,e.NOSCRIPT=`noscript`,e.OBJECT=`object`,e.OL=`ol`,e.OPTGROUP=`optgroup`,e.OPTION=`option`,e.P=`p`,e.PARAM=`param`,e.PLAINTEXT=`plaintext`,e.PRE=`pre`,e.RB=`rb`,e.RP=`rp`,e.RT=`rt`,e.RTC=`rtc`,e.RUBY=`ruby`,e.S=`s`,e.SCRIPT=`script`,e.SEARCH=`search`,e.SECTION=`section`,e.SELECT=`select`,e.SOURCE=`source`,e.SMALL=`small`,e.SPAN=`span`,e.STRIKE=`strike`,e.STRONG=`strong`,e.STYLE=`style`,e.SUB=`sub`,e.SUMMARY=`summary`,e.SUP=`sup`,e.TABLE=`table`,e.TBODY=`tbody`,e.TEMPLATE=`template`,e.TEXTAREA=`textarea`,e.TFOOT=`tfoot`,e.TD=`td`,e.TH=`th`,e.THEAD=`thead`,e.TITLE=`title`,e.TR=`tr`,e.TRACK=`track`,e.TT=`tt`,e.U=`u`,e.UL=`ul`,e.SVG=`svg`,e.VAR=`var`,e.WBR=`wbr`,e.XMP=`xmp`})(z||={});var B;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.A=1]=`A`,e[e.ADDRESS=2]=`ADDRESS`,e[e.ANNOTATION_XML=3]=`ANNOTATION_XML`,e[e.APPLET=4]=`APPLET`,e[e.AREA=5]=`AREA`,e[e.ARTICLE=6]=`ARTICLE`,e[e.ASIDE=7]=`ASIDE`,e[e.B=8]=`B`,e[e.BASE=9]=`BASE`,e[e.BASEFONT=10]=`BASEFONT`,e[e.BGSOUND=11]=`BGSOUND`,e[e.BIG=12]=`BIG`,e[e.BLOCKQUOTE=13]=`BLOCKQUOTE`,e[e.BODY=14]=`BODY`,e[e.BR=15]=`BR`,e[e.BUTTON=16]=`BUTTON`,e[e.CAPTION=17]=`CAPTION`,e[e.CENTER=18]=`CENTER`,e[e.CODE=19]=`CODE`,e[e.COL=20]=`COL`,e[e.COLGROUP=21]=`COLGROUP`,e[e.DD=22]=`DD`,e[e.DESC=23]=`DESC`,e[e.DETAILS=24]=`DETAILS`,e[e.DIALOG=25]=`DIALOG`,e[e.DIR=26]=`DIR`,e[e.DIV=27]=`DIV`,e[e.DL=28]=`DL`,e[e.DT=29]=`DT`,e[e.EM=30]=`EM`,e[e.EMBED=31]=`EMBED`,e[e.FIELDSET=32]=`FIELDSET`,e[e.FIGCAPTION=33]=`FIGCAPTION`,e[e.FIGURE=34]=`FIGURE`,e[e.FONT=35]=`FONT`,e[e.FOOTER=36]=`FOOTER`,e[e.FOREIGN_OBJECT=37]=`FOREIGN_OBJECT`,e[e.FORM=38]=`FORM`,e[e.FRAME=39]=`FRAME`,e[e.FRAMESET=40]=`FRAMESET`,e[e.H1=41]=`H1`,e[e.H2=42]=`H2`,e[e.H3=43]=`H3`,e[e.H4=44]=`H4`,e[e.H5=45]=`H5`,e[e.H6=46]=`H6`,e[e.HEAD=47]=`HEAD`,e[e.HEADER=48]=`HEADER`,e[e.HGROUP=49]=`HGROUP`,e[e.HR=50]=`HR`,e[e.HTML=51]=`HTML`,e[e.I=52]=`I`,e[e.IMG=53]=`IMG`,e[e.IMAGE=54]=`IMAGE`,e[e.INPUT=55]=`INPUT`,e[e.IFRAME=56]=`IFRAME`,e[e.KEYGEN=57]=`KEYGEN`,e[e.LABEL=58]=`LABEL`,e[e.LI=59]=`LI`,e[e.LINK=60]=`LINK`,e[e.LISTING=61]=`LISTING`,e[e.MAIN=62]=`MAIN`,e[e.MALIGNMARK=63]=`MALIGNMARK`,e[e.MARQUEE=64]=`MARQUEE`,e[e.MATH=65]=`MATH`,e[e.MENU=66]=`MENU`,e[e.META=67]=`META`,e[e.MGLYPH=68]=`MGLYPH`,e[e.MI=69]=`MI`,e[e.MO=70]=`MO`,e[e.MN=71]=`MN`,e[e.MS=72]=`MS`,e[e.MTEXT=73]=`MTEXT`,e[e.NAV=74]=`NAV`,e[e.NOBR=75]=`NOBR`,e[e.NOFRAMES=76]=`NOFRAMES`,e[e.NOEMBED=77]=`NOEMBED`,e[e.NOSCRIPT=78]=`NOSCRIPT`,e[e.OBJECT=79]=`OBJECT`,e[e.OL=80]=`OL`,e[e.OPTGROUP=81]=`OPTGROUP`,e[e.OPTION=82]=`OPTION`,e[e.P=83]=`P`,e[e.PARAM=84]=`PARAM`,e[e.PLAINTEXT=85]=`PLAINTEXT`,e[e.PRE=86]=`PRE`,e[e.RB=87]=`RB`,e[e.RP=88]=`RP`,e[e.RT=89]=`RT`,e[e.RTC=90]=`RTC`,e[e.RUBY=91]=`RUBY`,e[e.S=92]=`S`,e[e.SCRIPT=93]=`SCRIPT`,e[e.SEARCH=94]=`SEARCH`,e[e.SECTION=95]=`SECTION`,e[e.SELECT=96]=`SELECT`,e[e.SOURCE=97]=`SOURCE`,e[e.SMALL=98]=`SMALL`,e[e.SPAN=99]=`SPAN`,e[e.STRIKE=100]=`STRIKE`,e[e.STRONG=101]=`STRONG`,e[e.STYLE=102]=`STYLE`,e[e.SUB=103]=`SUB`,e[e.SUMMARY=104]=`SUMMARY`,e[e.SUP=105]=`SUP`,e[e.TABLE=106]=`TABLE`,e[e.TBODY=107]=`TBODY`,e[e.TEMPLATE=108]=`TEMPLATE`,e[e.TEXTAREA=109]=`TEXTAREA`,e[e.TFOOT=110]=`TFOOT`,e[e.TD=111]=`TD`,e[e.TH=112]=`TH`,e[e.THEAD=113]=`THEAD`,e[e.TITLE=114]=`TITLE`,e[e.TR=115]=`TR`,e[e.TRACK=116]=`TRACK`,e[e.TT=117]=`TT`,e[e.U=118]=`U`,e[e.UL=119]=`UL`,e[e.SVG=120]=`SVG`,e[e.VAR=121]=`VAR`,e[e.WBR=122]=`WBR`,e[e.XMP=123]=`XMP`})(B||={});var Sf=new Map([[z.A,B.A],[z.ADDRESS,B.ADDRESS],[z.ANNOTATION_XML,B.ANNOTATION_XML],[z.APPLET,B.APPLET],[z.AREA,B.AREA],[z.ARTICLE,B.ARTICLE],[z.ASIDE,B.ASIDE],[z.B,B.B],[z.BASE,B.BASE],[z.BASEFONT,B.BASEFONT],[z.BGSOUND,B.BGSOUND],[z.BIG,B.BIG],[z.BLOCKQUOTE,B.BLOCKQUOTE],[z.BODY,B.BODY],[z.BR,B.BR],[z.BUTTON,B.BUTTON],[z.CAPTION,B.CAPTION],[z.CENTER,B.CENTER],[z.CODE,B.CODE],[z.COL,B.COL],[z.COLGROUP,B.COLGROUP],[z.DD,B.DD],[z.DESC,B.DESC],[z.DETAILS,B.DETAILS],[z.DIALOG,B.DIALOG],[z.DIR,B.DIR],[z.DIV,B.DIV],[z.DL,B.DL],[z.DT,B.DT],[z.EM,B.EM],[z.EMBED,B.EMBED],[z.FIELDSET,B.FIELDSET],[z.FIGCAPTION,B.FIGCAPTION],[z.FIGURE,B.FIGURE],[z.FONT,B.FONT],[z.FOOTER,B.FOOTER],[z.FOREIGN_OBJECT,B.FOREIGN_OBJECT],[z.FORM,B.FORM],[z.FRAME,B.FRAME],[z.FRAMESET,B.FRAMESET],[z.H1,B.H1],[z.H2,B.H2],[z.H3,B.H3],[z.H4,B.H4],[z.H5,B.H5],[z.H6,B.H6],[z.HEAD,B.HEAD],[z.HEADER,B.HEADER],[z.HGROUP,B.HGROUP],[z.HR,B.HR],[z.HTML,B.HTML],[z.I,B.I],[z.IMG,B.IMG],[z.IMAGE,B.IMAGE],[z.INPUT,B.INPUT],[z.IFRAME,B.IFRAME],[z.KEYGEN,B.KEYGEN],[z.LABEL,B.LABEL],[z.LI,B.LI],[z.LINK,B.LINK],[z.LISTING,B.LISTING],[z.MAIN,B.MAIN],[z.MALIGNMARK,B.MALIGNMARK],[z.MARQUEE,B.MARQUEE],[z.MATH,B.MATH],[z.MENU,B.MENU],[z.META,B.META],[z.MGLYPH,B.MGLYPH],[z.MI,B.MI],[z.MO,B.MO],[z.MN,B.MN],[z.MS,B.MS],[z.MTEXT,B.MTEXT],[z.NAV,B.NAV],[z.NOBR,B.NOBR],[z.NOFRAMES,B.NOFRAMES],[z.NOEMBED,B.NOEMBED],[z.NOSCRIPT,B.NOSCRIPT],[z.OBJECT,B.OBJECT],[z.OL,B.OL],[z.OPTGROUP,B.OPTGROUP],[z.OPTION,B.OPTION],[z.P,B.P],[z.PARAM,B.PARAM],[z.PLAINTEXT,B.PLAINTEXT],[z.PRE,B.PRE],[z.RB,B.RB],[z.RP,B.RP],[z.RT,B.RT],[z.RTC,B.RTC],[z.RUBY,B.RUBY],[z.S,B.S],[z.SCRIPT,B.SCRIPT],[z.SEARCH,B.SEARCH],[z.SECTION,B.SECTION],[z.SELECT,B.SELECT],[z.SOURCE,B.SOURCE],[z.SMALL,B.SMALL],[z.SPAN,B.SPAN],[z.STRIKE,B.STRIKE],[z.STRONG,B.STRONG],[z.STYLE,B.STYLE],[z.SUB,B.SUB],[z.SUMMARY,B.SUMMARY],[z.SUP,B.SUP],[z.TABLE,B.TABLE],[z.TBODY,B.TBODY],[z.TEMPLATE,B.TEMPLATE],[z.TEXTAREA,B.TEXTAREA],[z.TFOOT,B.TFOOT],[z.TD,B.TD],[z.TH,B.TH],[z.THEAD,B.THEAD],[z.TITLE,B.TITLE],[z.TR,B.TR],[z.TRACK,B.TRACK],[z.TT,B.TT],[z.U,B.U],[z.UL,B.UL],[z.SVG,B.SVG],[z.VAR,B.VAR],[z.WBR,B.WBR],[z.XMP,B.XMP]]);function Cf(e){return Sf.get(e)??B.UNKNOWN}var wf=B;const Tf={[R.HTML]:new Set([wf.ADDRESS,wf.APPLET,wf.AREA,wf.ARTICLE,wf.ASIDE,wf.BASE,wf.BASEFONT,wf.BGSOUND,wf.BLOCKQUOTE,wf.BODY,wf.BR,wf.BUTTON,wf.CAPTION,wf.CENTER,wf.COL,wf.COLGROUP,wf.DD,wf.DETAILS,wf.DIR,wf.DIV,wf.DL,wf.DT,wf.EMBED,wf.FIELDSET,wf.FIGCAPTION,wf.FIGURE,wf.FOOTER,wf.FORM,wf.FRAME,wf.FRAMESET,wf.H1,wf.H2,wf.H3,wf.H4,wf.H5,wf.H6,wf.HEAD,wf.HEADER,wf.HGROUP,wf.HR,wf.HTML,wf.IFRAME,wf.IMG,wf.INPUT,wf.LI,wf.LINK,wf.LISTING,wf.MAIN,wf.MARQUEE,wf.MENU,wf.META,wf.NAV,wf.NOEMBED,wf.NOFRAMES,wf.NOSCRIPT,wf.OBJECT,wf.OL,wf.P,wf.PARAM,wf.PLAINTEXT,wf.PRE,wf.SCRIPT,wf.SECTION,wf.SELECT,wf.SOURCE,wf.STYLE,wf.SUMMARY,wf.TABLE,wf.TBODY,wf.TD,wf.TEMPLATE,wf.TEXTAREA,wf.TFOOT,wf.TH,wf.THEAD,wf.TITLE,wf.TR,wf.TRACK,wf.UL,wf.WBR,wf.XMP]),[R.MATHML]:new Set([wf.MI,wf.MO,wf.MN,wf.MS,wf.MTEXT,wf.ANNOTATION_XML]),[R.SVG]:new Set([wf.TITLE,wf.FOREIGN_OBJECT,wf.DESC]),[R.XLINK]:new Set,[R.XML]:new Set,[R.XMLNS]:new Set},Ef=new Set([wf.H1,wf.H2,wf.H3,wf.H4,wf.H5,wf.H6]);new Set([z.STYLE,z.SCRIPT,z.XMP,z.IFRAME,z.NOEMBED,z.NOFRAMES,z.PLAINTEXT]);var V;(function(e){e[e.DATA=0]=`DATA`,e[e.RCDATA=1]=`RCDATA`,e[e.RAWTEXT=2]=`RAWTEXT`,e[e.SCRIPT_DATA=3]=`SCRIPT_DATA`,e[e.PLAINTEXT=4]=`PLAINTEXT`,e[e.TAG_OPEN=5]=`TAG_OPEN`,e[e.END_TAG_OPEN=6]=`END_TAG_OPEN`,e[e.TAG_NAME=7]=`TAG_NAME`,e[e.RCDATA_LESS_THAN_SIGN=8]=`RCDATA_LESS_THAN_SIGN`,e[e.RCDATA_END_TAG_OPEN=9]=`RCDATA_END_TAG_OPEN`,e[e.RCDATA_END_TAG_NAME=10]=`RCDATA_END_TAG_NAME`,e[e.RAWTEXT_LESS_THAN_SIGN=11]=`RAWTEXT_LESS_THAN_SIGN`,e[e.RAWTEXT_END_TAG_OPEN=12]=`RAWTEXT_END_TAG_OPEN`,e[e.RAWTEXT_END_TAG_NAME=13]=`RAWTEXT_END_TAG_NAME`,e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]=`SCRIPT_DATA_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_END_TAG_OPEN=15]=`SCRIPT_DATA_END_TAG_OPEN`,e[e.SCRIPT_DATA_END_TAG_NAME=16]=`SCRIPT_DATA_END_TAG_NAME`,e[e.SCRIPT_DATA_ESCAPE_START=17]=`SCRIPT_DATA_ESCAPE_START`,e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]=`SCRIPT_DATA_ESCAPE_START_DASH`,e[e.SCRIPT_DATA_ESCAPED=19]=`SCRIPT_DATA_ESCAPED`,e[e.SCRIPT_DATA_ESCAPED_DASH=20]=`SCRIPT_DATA_ESCAPED_DASH`,e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]=`SCRIPT_DATA_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]=`SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]=`SCRIPT_DATA_ESCAPED_END_TAG_OPEN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]=`SCRIPT_DATA_ESCAPED_END_TAG_NAME`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]=`SCRIPT_DATA_DOUBLE_ESCAPE_START`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]=`SCRIPT_DATA_DOUBLE_ESCAPED`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]=`SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]=`SCRIPT_DATA_DOUBLE_ESCAPE_END`,e[e.BEFORE_ATTRIBUTE_NAME=31]=`BEFORE_ATTRIBUTE_NAME`,e[e.ATTRIBUTE_NAME=32]=`ATTRIBUTE_NAME`,e[e.AFTER_ATTRIBUTE_NAME=33]=`AFTER_ATTRIBUTE_NAME`,e[e.BEFORE_ATTRIBUTE_VALUE=34]=`BEFORE_ATTRIBUTE_VALUE`,e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]=`ATTRIBUTE_VALUE_DOUBLE_QUOTED`,e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]=`ATTRIBUTE_VALUE_SINGLE_QUOTED`,e[e.ATTRIBUTE_VALUE_UNQUOTED=37]=`ATTRIBUTE_VALUE_UNQUOTED`,e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]=`AFTER_ATTRIBUTE_VALUE_QUOTED`,e[e.SELF_CLOSING_START_TAG=39]=`SELF_CLOSING_START_TAG`,e[e.BOGUS_COMMENT=40]=`BOGUS_COMMENT`,e[e.MARKUP_DECLARATION_OPEN=41]=`MARKUP_DECLARATION_OPEN`,e[e.COMMENT_START=42]=`COMMENT_START`,e[e.COMMENT_START_DASH=43]=`COMMENT_START_DASH`,e[e.COMMENT=44]=`COMMENT`,e[e.COMMENT_LESS_THAN_SIGN=45]=`COMMENT_LESS_THAN_SIGN`,e[e.COMMENT_LESS_THAN_SIGN_BANG=46]=`COMMENT_LESS_THAN_SIGN_BANG`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]=`COMMENT_LESS_THAN_SIGN_BANG_DASH`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]=`COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH`,e[e.COMMENT_END_DASH=49]=`COMMENT_END_DASH`,e[e.COMMENT_END=50]=`COMMENT_END`,e[e.COMMENT_END_BANG=51]=`COMMENT_END_BANG`,e[e.DOCTYPE=52]=`DOCTYPE`,e[e.BEFORE_DOCTYPE_NAME=53]=`BEFORE_DOCTYPE_NAME`,e[e.DOCTYPE_NAME=54]=`DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_NAME=55]=`AFTER_DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]=`AFTER_DOCTYPE_PUBLIC_KEYWORD`,e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]=`BEFORE_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]=`DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]=`DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]=`AFTER_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]=`BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS`,e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]=`AFTER_DOCTYPE_SYSTEM_KEYWORD`,e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]=`BEFORE_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]=`DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]=`DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]=`AFTER_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.BOGUS_DOCTYPE=67]=`BOGUS_DOCTYPE`,e[e.CDATA_SECTION=68]=`CDATA_SECTION`,e[e.CDATA_SECTION_BRACKET=69]=`CDATA_SECTION_BRACKET`,e[e.CDATA_SECTION_END=70]=`CDATA_SECTION_END`,e[e.CHARACTER_REFERENCE=71]=`CHARACTER_REFERENCE`,e[e.AMBIGUOUS_AMPERSAND=72]=`AMBIGUOUS_AMPERSAND`})(V||={});const Df={DATA:V.DATA,RCDATA:V.RCDATA,RAWTEXT:V.RAWTEXT,SCRIPT_DATA:V.SCRIPT_DATA,PLAINTEXT:V.PLAINTEXT,CDATA_SECTION:V.CDATA_SECTION};function Of(e){return e>=I.DIGIT_0&&e<=I.DIGIT_9}function kf(e){return e>=I.LATIN_CAPITAL_A&&e<=I.LATIN_CAPITAL_Z}function Af(e){return e>=I.LATIN_SMALL_A&&e<=I.LATIN_SMALL_Z}function jf(e){return Af(e)||kf(e)}function Mf(e){return jf(e)||Of(e)}function Nf(e){return e+32}function Pf(e){return e===I.SPACE||e===I.LINE_FEED||e===I.TABULATION||e===I.FORM_FEED}function Ff(e){return Pf(e)||e===I.SOLIDUS||e===I.GREATER_THAN_SIGN}function If(e){return e===I.NULL?L.nullCharacterReference:e>1114111?L.characterReferenceOutsideUnicodeRange:Xd(e)?L.surrogateCharacterReference:ef(e)?L.noncharacterCharacterReference:$d(e)||e===I.CARRIAGE_RETURN?L.controlCharacterReference:null}var Lf=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName=``,this.active=!1,this.state=V.DATA,this.returnState=V.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:``,value:``},this.preprocessor=new nf(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new vf(of,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(L.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(L.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=If(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)==null||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw Error(`Parser was already resumed`);this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t0&&this._err(L.endTagWithAttributes),e.selfClosing&&this._err(L.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case rf.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case rf.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case rf.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:rf.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,t)}_emitCodePoint(e){let t=Pf(e)?rf.WHITESPACE_CHARACTER:e===I.NULL?rf.NULL_CHARACTER:rf.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(rf.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=V.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?_f.Attribute:_f.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===V.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===V.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===V.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case V.DATA:this._stateData(e);break;case V.RCDATA:this._stateRcdata(e);break;case V.RAWTEXT:this._stateRawtext(e);break;case V.SCRIPT_DATA:this._stateScriptData(e);break;case V.PLAINTEXT:this._statePlaintext(e);break;case V.TAG_OPEN:this._stateTagOpen(e);break;case V.END_TAG_OPEN:this._stateEndTagOpen(e);break;case V.TAG_NAME:this._stateTagName(e);break;case V.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case V.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case V.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case V.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case V.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case V.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case V.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case V.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case V.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case V.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case V.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case V.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case V.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case V.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case V.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case V.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case V.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case V.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case V.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case V.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case V.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case V.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case V.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case V.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case V.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case V.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case V.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case V.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case V.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case V.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case V.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case V.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case V.BOGUS_COMMENT:this._stateBogusComment(e);break;case V.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case V.COMMENT_START:this._stateCommentStart(e);break;case V.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case V.COMMENT:this._stateComment(e);break;case V.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case V.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case V.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case V.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case V.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case V.COMMENT_END:this._stateCommentEnd(e);break;case V.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case V.DOCTYPE:this._stateDoctype(e);break;case V.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case V.DOCTYPE_NAME:this._stateDoctypeName(e);break;case V.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case V.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case V.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case V.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case V.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case V.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case V.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case V.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case V.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case V.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case V.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case V.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case V.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case V.CDATA_SECTION:this._stateCdataSection(e);break;case V.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case V.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case V.CHARACTER_REFERENCE:this._stateCharacterReference();break;case V.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw Error(`Unknown state`)}}_stateData(e){switch(e){case I.LESS_THAN_SIGN:this.state=V.TAG_OPEN;break;case I.AMPERSAND:this._startCharacterReference();break;case I.NULL:this._err(L.unexpectedNullCharacter),this._emitCodePoint(e);break;case I.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case I.AMPERSAND:this._startCharacterReference();break;case I.LESS_THAN_SIGN:this.state=V.RCDATA_LESS_THAN_SIGN;break;case I.NULL:this._err(L.unexpectedNullCharacter),this._emitChars(`�`);break;case I.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case I.LESS_THAN_SIGN:this.state=V.RAWTEXT_LESS_THAN_SIGN;break;case I.NULL:this._err(L.unexpectedNullCharacter),this._emitChars(`�`);break;case I.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case I.LESS_THAN_SIGN:this.state=V.SCRIPT_DATA_LESS_THAN_SIGN;break;case I.NULL:this._err(L.unexpectedNullCharacter),this._emitChars(`�`);break;case I.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case I.NULL:this._err(L.unexpectedNullCharacter),this._emitChars(`�`);break;case I.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(jf(e))this._createStartTagToken(),this.state=V.TAG_NAME,this._stateTagName(e);else switch(e){case I.EXCLAMATION_MARK:this.state=V.MARKUP_DECLARATION_OPEN;break;case I.SOLIDUS:this.state=V.END_TAG_OPEN;break;case I.QUESTION_MARK:this._err(L.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=V.BOGUS_COMMENT,this._stateBogusComment(e);break;case I.EOF:this._err(L.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(L.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=V.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(jf(e))this._createEndTagToken(),this.state=V.TAG_NAME,this._stateTagName(e);else switch(e){case I.GREATER_THAN_SIGN:this._err(L.missingEndTagName),this.state=V.DATA;break;case I.EOF:this._err(L.eofBeforeTagName),this._emitChars(``);break;case I.NULL:this._err(L.unexpectedNullCharacter),this.state=V.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case I.EOF:this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=V.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===I.SOLIDUS?this.state=V.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:jf(e)?(this._emitChars(`<`),this.state=V.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars(`<`),this.state=V.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){jf(e)?(this.state=V.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(``);break;case I.NULL:this._err(L.unexpectedNullCharacter),this.state=V.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case I.EOF:this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=V.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===I.SOLIDUS?(this.state=V.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars(`/`)):(this.state=V.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Yd.SCRIPT,!1)&&Ff(this.preprocessor.peek(Yd.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){let r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==R.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&--this.tmplCount,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(qf,R.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Kf,R.HTML)}clearBackToTableRowContext(){this.clearBackTo(Gf,R.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===B.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===B.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){let r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case R.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case R.SVG:if(Wf.has(r))return!1;break;case R.MATHML:if(Uf.has(r))return!1;break}}return!0}hasInScope(e){return this.hasInDynamicScope(e,Bf)}hasInListItemScope(e){return this.hasInDynamicScope(e,Vf)}hasInButtonScope(e){return this.hasInDynamicScope(e,Hf)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case R.HTML:if(Ef.has(t))return!0;if(Bf.has(t))return!1;break;case R.SVG:if(Wf.has(t))return!1;break;case R.MATHML:if(Uf.has(t))return!1;break}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===R.HTML)switch(this.tagIDs[t]){case e:return!0;case B.TABLE:case B.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===R.HTML)switch(this.tagIDs[e]){case B.TBODY:case B.THEAD:case B.TFOOT:return!0;case B.TABLE:case B.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===R.HTML)switch(this.tagIDs[t]){case e:return!0;case B.OPTION:case B.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Rf.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&zf.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&zf.has(this.currentTagId);)this.pop()}},Xf=3,Zf;(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(Zf||={});var Qf={type:Zf.Marker},$f=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e[e.name,e.value])),i=0;for(let e=0;er.get(e.name)===e.value)&&(i+=1,i>=Xf&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(Qf)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:Zf.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:Zf.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf(Qf);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===Zf.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===Zf.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===Zf.Element&&t.element===e)}};const ep={createDocument(){return{nodeName:`#document`,mode:xf.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:`#document-fragment`,childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:`#comment`,data:e,parentNode:null}},createTextNode(e){return{nodeName:`#text`,value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(e=>e.nodeName===`#documentType`);if(i)i.name=t,i.publicId=n,i.systemId=r;else{let i={nodeName:`#documentType`,name:t,publicId:n,systemId:r,parentNode:null};ep.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(ep.isTextNode(n)){n.value+=t;return}}ep.appendChild(e,ep.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&ep.isTextNode(r)?r.value+=t:ep.insertBefore(e,ep.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(e=>e.name));for(let r=0;re.startsWith(t))}function up(e){return e.name===tp&&e.publicId===null&&(e.systemId===null||e.systemId===np)}function dp(e){if(e.name!==tp)return xf.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===rp)return xf.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),op.has(n))return xf.QUIRKS;let e=t===null?ap:ip;if(lp(n,e))return xf.QUIRKS;if(e=t===null?sp:cp,lp(n,e))return xf.LIMITED_QUIRKS}return xf.NO_QUIRKS}var fp={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},pp=`definitionurl`,mp=`definitionURL`,hp=new Map(`attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`).map(e=>[e.toLowerCase(),e])),gp=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:R.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:R.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:R.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:R.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:R.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:R.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:R.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:R.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:R.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:R.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:R.XMLNS}]]);const _p=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(e=>[e.toLowerCase(),e]));var vp=new Set([B.B,B.BIG,B.BLOCKQUOTE,B.BODY,B.BR,B.CENTER,B.CODE,B.DD,B.DIV,B.DL,B.DT,B.EM,B.EMBED,B.H1,B.H2,B.H3,B.H4,B.H5,B.H6,B.HEAD,B.HR,B.I,B.IMG,B.LI,B.LISTING,B.MENU,B.META,B.NOBR,B.OL,B.P,B.PRE,B.RUBY,B.S,B.SMALL,B.SPAN,B.STRONG,B.STRIKE,B.SUB,B.SUP,B.TABLE,B.TT,B.U,B.UL,B.VAR]);function yp(e){let t=e.tagID;return t===B.FONT&&e.attrs.some(({name:e})=>e===bf.COLOR||e===bf.SIZE||e===bf.FACE)||vp.has(t)}function bp(e){for(let t=0;t0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)==null||r.call(n,e,this.openElements.current),t){let e,t;this.openElements.stackTop===0&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):{current:e,currentTagId:t}=this.openElements,this._setContextModes(e,t)}}_setContextModes(e,t){let n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===R.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,R.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=H.TEXT}switchToPlaintextParsing(){this.insertionMode=H.TEXT,this.originalInsertionMode=H.IN_BODY,this.tokenizer.state=Df.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===z.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==R.HTML))switch(this.fragmentContextID){case B.TITLE:case B.TEXTAREA:this.tokenizer.state=Df.RCDATA;break;case B.STYLE:case B.XMP:case B.IFRAME:case B.NOEMBED:case B.NOFRAMES:case B.NOSCRIPT:this.tokenizer.state=Df.RAWTEXT;break;case B.SCRIPT:this.tokenizer.state=Df.SCRIPT_DATA;break;case B.PLAINTEXT:this.tokenizer.state=Df.PLAINTEXT;break;default:}}_setDocumentType(e){let t=e.name||``,n=e.publicId||``,r=e.systemId||``;if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){let t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t??this.document,e)}}_appendElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){let n=this.treeAdapter.createElement(e,R.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,R.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(z.HTML,R.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,B.HTML)}_appendCommentNode(e,t){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){let{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===rf.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===B.SVG&&this.treeAdapter.getTagName(t)===z.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===R.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===B.MGLYPH||e.tagID===B.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,R.HTML)}_processToken(e){switch(e.type){case rf.CHARACTER:this.onCharacter(e);break;case rf.NULL_CHARACTER:this.onNullCharacter(e);break;case rf.COMMENT:this.onComment(e);break;case rf.DOCTYPE:this.onDoctype(e);break;case rf.START_TAG:this._processStartTag(e);break;case rf.END_TAG:this.onEndTag(e);break;case rf.EOF:this.onEof(e);break;case rf.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e);break}}_isIntegrationPoint(e,t,n){return Ep(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(e=>e.type===Zf.Marker||this.openElements.contains(e.element)),n=t===-1?e-1:t-1;for(let e=n;e>=0;e--){let t=this.activeFormattingElements.entries[e];this._insertElement(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=H.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(B.P),this.openElements.popUntilTagNamePopped(B.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case B.TR:this.insertionMode=H.IN_ROW;return;case B.TBODY:case B.THEAD:case B.TFOOT:this.insertionMode=H.IN_TABLE_BODY;return;case B.CAPTION:this.insertionMode=H.IN_CAPTION;return;case B.COLGROUP:this.insertionMode=H.IN_COLUMN_GROUP;return;case B.TABLE:this.insertionMode=H.IN_TABLE;return;case B.BODY:this.insertionMode=H.IN_BODY;return;case B.FRAMESET:this.insertionMode=H.IN_FRAMESET;return;case B.SELECT:this._resetInsertionModeForSelect(e);return;case B.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case B.HTML:this.insertionMode=this.headElement?H.AFTER_HEAD:H.BEFORE_HEAD;return;case B.TD:case B.TH:if(e>0){this.insertionMode=H.IN_CELL;return}break;case B.HEAD:if(e>0){this.insertionMode=H.IN_HEAD;return}break}this.insertionMode=H.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let e=this.openElements.tagIDs[t];if(e===B.TEMPLATE)break;if(e===B.TABLE){this.insertionMode=H.IN_SELECT_IN_TABLE;return}}this.insertionMode=H.IN_SELECT}_isElementCausesFosterParenting(e){return jp.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case B.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===R.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case B.TABLE:{let n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}default:}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){return Tf[this.treeAdapter.getNamespaceURI(e)].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Jh(this,e);return}switch(this.insertionMode){case H.INITIAL:Kp(this,e);break;case H.BEFORE_HTML:Yp(this,e);break;case H.BEFORE_HEAD:Qp(this,e);break;case H.IN_HEAD:nm(this,e);break;case H.IN_HEAD_NO_SCRIPT:am(this,e);break;case H.AFTER_HEAD:cm(this,e);break;case H.IN_BODY:case H.IN_CAPTION:case H.IN_CELL:case H.IN_TEMPLATE:dm(this,e);break;case H.TEXT:case H.IN_SELECT:case H.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case H.IN_TABLE:case H.IN_TABLE_BODY:case H.IN_ROW:ah(this,e);break;case H.IN_TABLE_TEXT:vh(this,e);break;case H.IN_COLUMN_GROUP:Ch(this,e);break;case H.AFTER_BODY:zh(this,e);break;case H.AFTER_AFTER_BODY:Gh(this,e);break;default:}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){qh(this,e);return}switch(this.insertionMode){case H.INITIAL:Kp(this,e);break;case H.BEFORE_HTML:Yp(this,e);break;case H.BEFORE_HEAD:Qp(this,e);break;case H.IN_HEAD:nm(this,e);break;case H.IN_HEAD_NO_SCRIPT:am(this,e);break;case H.AFTER_HEAD:cm(this,e);break;case H.TEXT:this._insertCharacters(e);break;case H.IN_TABLE:case H.IN_TABLE_BODY:case H.IN_ROW:ah(this,e);break;case H.IN_COLUMN_GROUP:Ch(this,e);break;case H.AFTER_BODY:zh(this,e);break;case H.AFTER_AFTER_BODY:Gh(this,e);break;default:}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){Vp(this,e);return}switch(this.insertionMode){case H.INITIAL:case H.BEFORE_HTML:case H.BEFORE_HEAD:case H.IN_HEAD:case H.IN_HEAD_NO_SCRIPT:case H.AFTER_HEAD:case H.IN_BODY:case H.IN_TABLE:case H.IN_CAPTION:case H.IN_COLUMN_GROUP:case H.IN_TABLE_BODY:case H.IN_ROW:case H.IN_CELL:case H.IN_SELECT:case H.IN_SELECT_IN_TABLE:case H.IN_TEMPLATE:case H.IN_FRAMESET:case H.AFTER_FRAMESET:Vp(this,e);break;case H.IN_TABLE_TEXT:yh(this,e);break;case H.AFTER_BODY:Hp(this,e);break;case H.AFTER_AFTER_BODY:case H.AFTER_AFTER_FRAMESET:Up(this,e);break;default:}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case H.INITIAL:Gp(this,e);break;case H.BEFORE_HEAD:case H.IN_HEAD:case H.IN_HEAD_NO_SCRIPT:case H.AFTER_HEAD:this._err(e,L.misplacedDoctype);break;case H.IN_TABLE_TEXT:yh(this,e);break;default:}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,L.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?Xh(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case H.INITIAL:Kp(this,e);break;case H.BEFORE_HTML:qp(this,e);break;case H.BEFORE_HEAD:Xp(this,e);break;case H.IN_HEAD:$p(this,e);break;case H.IN_HEAD_NO_SCRIPT:rm(this,e);break;case H.AFTER_HEAD:om(this,e);break;case H.IN_BODY:Um(this,e);break;case H.IN_TABLE:mh(this,e);break;case H.IN_TABLE_TEXT:yh(this,e);break;case H.IN_CAPTION:xh(this,e);break;case H.IN_COLUMN_GROUP:Sh(this,e);break;case H.IN_TABLE_BODY:wh(this,e);break;case H.IN_ROW:Eh(this,e);break;case H.IN_CELL:Oh(this,e);break;case H.IN_SELECT:Ah(this,e);break;case H.IN_SELECT_IN_TABLE:Mh(this,e);break;case H.IN_TEMPLATE:Ph(this,e);break;case H.AFTER_BODY:Lh(this,e);break;case H.IN_FRAMESET:Bh(this,e);break;case H.AFTER_FRAMESET:Hh(this,e);break;case H.AFTER_AFTER_BODY:Wh(this,e);break;case H.AFTER_AFTER_FRAMESET:Kh(this,e);break;default:}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?Zh(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case H.INITIAL:Kp(this,e);break;case H.BEFORE_HTML:Jp(this,e);break;case H.BEFORE_HEAD:Zp(this,e);break;case H.IN_HEAD:em(this,e);break;case H.IN_HEAD_NO_SCRIPT:im(this,e);break;case H.AFTER_HEAD:sm(this,e);break;case H.IN_BODY:th(this,e);break;case H.TEXT:rh(this,e);break;case H.IN_TABLE:hh(this,e);break;case H.IN_TABLE_TEXT:yh(this,e);break;case H.IN_CAPTION:tee(this,e);break;case H.IN_COLUMN_GROUP:nee(this,e);break;case H.IN_TABLE_BODY:Th(this,e);break;case H.IN_ROW:Dh(this,e);break;case H.IN_CELL:kh(this,e);break;case H.IN_SELECT:jh(this,e);break;case H.IN_SELECT_IN_TABLE:Nh(this,e);break;case H.IN_TEMPLATE:Fh(this,e);break;case H.AFTER_BODY:Rh(this,e);break;case H.IN_FRAMESET:Vh(this,e);break;case H.AFTER_FRAMESET:Uh(this,e);break;case H.AFTER_AFTER_BODY:Gh(this,e);break;default:}}onEof(e){switch(this.insertionMode){case H.INITIAL:Kp(this,e);break;case H.BEFORE_HTML:Yp(this,e);break;case H.BEFORE_HEAD:Qp(this,e);break;case H.IN_HEAD:nm(this,e);break;case H.IN_HEAD_NO_SCRIPT:am(this,e);break;case H.AFTER_HEAD:cm(this,e);break;case H.IN_BODY:case H.IN_TABLE:case H.IN_CAPTION:case H.IN_COLUMN_GROUP:case H.IN_TABLE_BODY:case H.IN_ROW:case H.IN_CELL:case H.IN_SELECT:case H.IN_SELECT_IN_TABLE:nh(this,e);break;case H.TEXT:ih(this,e);break;case H.IN_TABLE_TEXT:yh(this,e);break;case H.IN_TEMPLATE:Ih(this,e);break;case H.AFTER_BODY:case H.IN_FRAMESET:case H.AFTER_FRAMESET:case H.AFTER_AFTER_BODY:case H.AFTER_AFTER_FRAMESET:Wp(this,e);break;default:}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===I.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case H.IN_HEAD:case H.IN_HEAD_NO_SCRIPT:case H.AFTER_HEAD:case H.TEXT:case H.IN_COLUMN_GROUP:case H.IN_SELECT:case H.IN_SELECT_IN_TABLE:case H.IN_FRAMESET:case H.AFTER_FRAMESET:this._insertCharacters(e);break;case H.IN_BODY:case H.IN_CAPTION:case H.IN_CELL:case H.IN_TEMPLATE:case H.AFTER_BODY:case H.AFTER_AFTER_BODY:case H.AFTER_AFTER_FRAMESET:um(this,e);break;case H.IN_TABLE:case H.IN_TABLE_BODY:case H.IN_ROW:ah(this,e);break;case H.IN_TABLE_TEXT:_h(this,e);break;default:}}};function Pp(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):eh(e,t),n}function Fp(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function Ip(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);let n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=kp;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=Lp(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function Lp(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function Rp(e,t,n){let r=Cf(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===B.TEMPLATE&&i===R.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function zp(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function Bp(e,t){for(let n=0;n=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function Gp(e,t){e._setDocumentType(t);let n=t.forceQuirks?xf.QUIRKS:dp(t);up(t)||e._err(t,L.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=H.BEFORE_HTML}function Kp(e,t){e._err(t,L.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,xf.QUIRKS),e.insertionMode=H.BEFORE_HTML,e._processToken(t)}function qp(e,t){t.tagID===B.HTML?(e._insertElement(t,R.HTML),e.insertionMode=H.BEFORE_HEAD):Yp(e,t)}function Jp(e,t){let n=t.tagID;(n===B.HTML||n===B.HEAD||n===B.BODY||n===B.BR)&&Yp(e,t)}function Yp(e,t){e._insertFakeRootElement(),e.insertionMode=H.BEFORE_HEAD,e._processToken(t)}function Xp(e,t){switch(t.tagID){case B.HTML:Um(e,t);break;case B.HEAD:e._insertElement(t,R.HTML),e.headElement=e.openElements.current,e.insertionMode=H.IN_HEAD;break;default:Qp(e,t)}}function Zp(e,t){let n=t.tagID;n===B.HEAD||n===B.BODY||n===B.HTML||n===B.BR?Qp(e,t):e._err(t,L.endTagWithoutMatchingOpenElement)}function Qp(e,t){e._insertFakeElement(z.HEAD,B.HEAD),e.headElement=e.openElements.current,e.insertionMode=H.IN_HEAD,e._processToken(t)}function $p(e,t){switch(t.tagID){case B.HTML:Um(e,t);break;case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:e._appendElement(t,R.HTML),t.ackSelfClosing=!0;break;case B.TITLE:e._switchToTextParsing(t,Df.RCDATA);break;case B.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,Df.RAWTEXT):(e._insertElement(t,R.HTML),e.insertionMode=H.IN_HEAD_NO_SCRIPT);break;case B.NOFRAMES:case B.STYLE:e._switchToTextParsing(t,Df.RAWTEXT);break;case B.SCRIPT:e._switchToTextParsing(t,Df.SCRIPT_DATA);break;case B.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=H.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(H.IN_TEMPLATE);break;case B.HEAD:e._err(t,L.misplacedStartTagForHeadElement);break;default:nm(e,t)}}function em(e,t){switch(t.tagID){case B.HEAD:e.openElements.pop(),e.insertionMode=H.AFTER_HEAD;break;case B.BODY:case B.BR:case B.HTML:nm(e,t);break;case B.TEMPLATE:tm(e,t);break;default:e._err(t,L.endTagWithoutMatchingOpenElement)}}function tm(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==B.TEMPLATE&&e._err(t,L.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(B.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,L.endTagWithoutMatchingOpenElement)}function nm(e,t){e.openElements.pop(),e.insertionMode=H.AFTER_HEAD,e._processToken(t)}function rm(e,t){switch(t.tagID){case B.HTML:Um(e,t);break;case B.BASEFONT:case B.BGSOUND:case B.HEAD:case B.LINK:case B.META:case B.NOFRAMES:case B.STYLE:$p(e,t);break;case B.NOSCRIPT:e._err(t,L.nestedNoscriptInHead);break;default:am(e,t)}}function im(e,t){switch(t.tagID){case B.NOSCRIPT:e.openElements.pop(),e.insertionMode=H.IN_HEAD;break;case B.BR:am(e,t);break;default:e._err(t,L.endTagWithoutMatchingOpenElement)}}function am(e,t){let n=t.type===rf.EOF?L.openElementsLeftAfterEof:L.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=H.IN_HEAD,e._processToken(t)}function om(e,t){switch(t.tagID){case B.HTML:Um(e,t);break;case B.BODY:e._insertElement(t,R.HTML),e.framesetOk=!1,e.insertionMode=H.IN_BODY;break;case B.FRAMESET:e._insertElement(t,R.HTML),e.insertionMode=H.IN_FRAMESET;break;case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:case B.NOFRAMES:case B.SCRIPT:case B.STYLE:case B.TEMPLATE:case B.TITLE:e._err(t,L.abandonedHeadElementChild),e.openElements.push(e.headElement,B.HEAD),$p(e,t),e.openElements.remove(e.headElement);break;case B.HEAD:e._err(t,L.misplacedStartTagForHeadElement);break;default:cm(e,t)}}function sm(e,t){switch(t.tagID){case B.BODY:case B.HTML:case B.BR:cm(e,t);break;case B.TEMPLATE:tm(e,t);break;default:e._err(t,L.endTagWithoutMatchingOpenElement)}}function cm(e,t){e._insertFakeElement(z.BODY,B.BODY),e.insertionMode=H.IN_BODY,lm(e,t)}function lm(e,t){switch(t.type){case rf.CHARACTER:dm(e,t);break;case rf.WHITESPACE_CHARACTER:um(e,t);break;case rf.COMMENT:Vp(e,t);break;case rf.START_TAG:Um(e,t);break;case rf.END_TAG:th(e,t);break;case rf.EOF:nh(e,t);break;default:}}function um(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function dm(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function fm(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function pm(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function mm(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,R.HTML),e.insertionMode=H.IN_FRAMESET)}function eee(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,R.HTML)}function hm(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Ef.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,R.HTML)}function gm(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,R.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function _m(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,R.HTML),n||(e.formElement=e.openElements.current))}function vm(e,t){e.framesetOk=!1;let n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){let r=e.openElements.tagIDs[t];if(n===B.LI&&r===B.LI||(n===B.DD||n===B.DT)&&(r===B.DD||r===B.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==B.ADDRESS&&r!==B.DIV&&r!==B.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,R.HTML)}function ym(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,R.HTML),e.tokenizer.state=Df.PLAINTEXT}function bm(e,t){e.openElements.hasInScope(B.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(B.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,R.HTML),e.framesetOk=!1}function xm(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(z.A);n&&(Bp(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,R.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Sm(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,R.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Cm(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(B.NOBR)&&(Bp(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,R.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function wm(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,R.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Tm(e,t){e.treeAdapter.getDocumentMode(e.document)!==xf.QUIRKS&&e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,R.HTML),e.framesetOk=!1,e.insertionMode=H.IN_TABLE}function Em(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,R.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Dm(e){let t=af(e,bf.TYPE);return t!=null&&t.toLowerCase()===Dp}function Om(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,R.HTML),Dm(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function km(e,t){e._appendElement(t,R.HTML),t.ackSelfClosing=!0}function Am(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._appendElement(t,R.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function jm(e,t){t.tagName=z.IMG,t.tagID=B.IMG,Em(e,t)}function Mm(e,t){e._insertElement(t,R.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Df.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=H.TEXT}function Nm(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Df.RAWTEXT)}function Pm(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Df.RAWTEXT)}function Fm(e,t){e._switchToTextParsing(t,Df.RAWTEXT)}function Im(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,R.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===H.IN_TABLE||e.insertionMode===H.IN_CAPTION||e.insertionMode===H.IN_TABLE_BODY||e.insertionMode===H.IN_ROW||e.insertionMode===H.IN_CELL?H.IN_SELECT_IN_TABLE:H.IN_SELECT}function Lm(e,t){e.openElements.currentTagId===B.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,R.HTML)}function Rm(e,t){e.openElements.hasInScope(B.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,R.HTML)}function zm(e,t){e.openElements.hasInScope(B.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(B.RTC),e._insertElement(t,R.HTML)}function Bm(e,t){e._reconstructActiveFormattingElements(),bp(t),Sp(t),t.selfClosing?e._appendElement(t,R.MATHML):e._insertElement(t,R.MATHML),t.ackSelfClosing=!0}function Vm(e,t){e._reconstructActiveFormattingElements(),xp(t),Sp(t),t.selfClosing?e._appendElement(t,R.SVG):e._insertElement(t,R.SVG),t.ackSelfClosing=!0}function Hm(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,R.HTML)}function Um(e,t){switch(t.tagID){case B.I:case B.S:case B.B:case B.U:case B.EM:case B.TT:case B.BIG:case B.CODE:case B.FONT:case B.SMALL:case B.STRIKE:case B.STRONG:Sm(e,t);break;case B.A:xm(e,t);break;case B.H1:case B.H2:case B.H3:case B.H4:case B.H5:case B.H6:hm(e,t);break;case B.P:case B.DL:case B.OL:case B.UL:case B.DIV:case B.DIR:case B.NAV:case B.MAIN:case B.MENU:case B.ASIDE:case B.CENTER:case B.FIGURE:case B.FOOTER:case B.HEADER:case B.HGROUP:case B.DIALOG:case B.DETAILS:case B.ADDRESS:case B.ARTICLE:case B.SEARCH:case B.SECTION:case B.SUMMARY:case B.FIELDSET:case B.BLOCKQUOTE:case B.FIGCAPTION:eee(e,t);break;case B.LI:case B.DD:case B.DT:vm(e,t);break;case B.BR:case B.IMG:case B.WBR:case B.AREA:case B.EMBED:case B.KEYGEN:Em(e,t);break;case B.HR:Am(e,t);break;case B.RB:case B.RTC:Rm(e,t);break;case B.RT:case B.RP:zm(e,t);break;case B.PRE:case B.LISTING:gm(e,t);break;case B.XMP:Nm(e,t);break;case B.SVG:Vm(e,t);break;case B.HTML:fm(e,t);break;case B.BASE:case B.LINK:case B.META:case B.STYLE:case B.TITLE:case B.SCRIPT:case B.BGSOUND:case B.BASEFONT:case B.TEMPLATE:$p(e,t);break;case B.BODY:pm(e,t);break;case B.FORM:_m(e,t);break;case B.NOBR:Cm(e,t);break;case B.MATH:Bm(e,t);break;case B.TABLE:Tm(e,t);break;case B.INPUT:Om(e,t);break;case B.PARAM:case B.TRACK:case B.SOURCE:km(e,t);break;case B.IMAGE:jm(e,t);break;case B.BUTTON:bm(e,t);break;case B.APPLET:case B.OBJECT:case B.MARQUEE:wm(e,t);break;case B.IFRAME:Pm(e,t);break;case B.SELECT:Im(e,t);break;case B.OPTION:case B.OPTGROUP:Lm(e,t);break;case B.NOEMBED:case B.NOFRAMES:Fm(e,t);break;case B.FRAMESET:mm(e,t);break;case B.TEXTAREA:Mm(e,t);break;case B.NOSCRIPT:e.options.scriptingEnabled?Fm(e,t):Hm(e,t);break;case B.PLAINTEXT:ym(e,t);break;case B.COL:case B.TH:case B.TD:case B.TR:case B.HEAD:case B.FRAME:case B.TBODY:case B.TFOOT:case B.THEAD:case B.CAPTION:case B.COLGROUP:break;default:Hm(e,t)}}function Wm(e,t){if(e.openElements.hasInScope(B.BODY)&&(e.insertionMode=H.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Gm(e,t){e.openElements.hasInScope(B.BODY)&&(e.insertionMode=H.AFTER_BODY,Rh(e,t))}function Km(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function qm(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(B.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(B.FORM):n&&e.openElements.remove(n))}function Jm(e){e.openElements.hasInButtonScope(B.P)||e._insertFakeElement(z.P,B.P),e._closePElement()}function Ym(e){e.openElements.hasInListItemScope(B.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(B.LI),e.openElements.popUntilTagNamePopped(B.LI))}function Xm(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Zm(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Qm(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function $m(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(z.BR,B.BR),e.openElements.pop(),e.framesetOk=!1}function eh(e,t){let n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){let i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==B.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function th(e,t){switch(t.tagID){case B.A:case B.B:case B.I:case B.S:case B.U:case B.EM:case B.TT:case B.BIG:case B.CODE:case B.FONT:case B.NOBR:case B.SMALL:case B.STRIKE:case B.STRONG:Bp(e,t);break;case B.P:Jm(e);break;case B.DL:case B.UL:case B.OL:case B.DIR:case B.DIV:case B.NAV:case B.PRE:case B.MAIN:case B.MENU:case B.ASIDE:case B.BUTTON:case B.CENTER:case B.FIGURE:case B.FOOTER:case B.HEADER:case B.HGROUP:case B.DIALOG:case B.ADDRESS:case B.ARTICLE:case B.DETAILS:case B.SEARCH:case B.SECTION:case B.SUMMARY:case B.LISTING:case B.FIELDSET:case B.BLOCKQUOTE:case B.FIGCAPTION:Km(e,t);break;case B.LI:Ym(e);break;case B.DD:case B.DT:Xm(e,t);break;case B.H1:case B.H2:case B.H3:case B.H4:case B.H5:case B.H6:Zm(e);break;case B.BR:$m(e);break;case B.BODY:Wm(e,t);break;case B.HTML:Gm(e,t);break;case B.FORM:qm(e);break;case B.APPLET:case B.OBJECT:case B.MARQUEE:Qm(e,t);break;case B.TEMPLATE:tm(e,t);break;default:eh(e,t)}}function nh(e,t){e.tmplInsertionModeStack.length>0?Ih(e,t):Wp(e,t)}function rh(e,t){var n;t.tagID===B.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function ih(e,t){e._err(t,L.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function ah(e,t){if(e.openElements.currentTagId!==void 0&&jp.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=H.IN_TABLE_TEXT,t.type){case rf.CHARACTER:vh(e,t);break;case rf.WHITESPACE_CHARACTER:_h(e,t);break}else gh(e,t)}function oh(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,R.HTML),e.insertionMode=H.IN_CAPTION}function sh(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,R.HTML),e.insertionMode=H.IN_COLUMN_GROUP}function ch(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(z.COLGROUP,B.COLGROUP),e.insertionMode=H.IN_COLUMN_GROUP,Sh(e,t)}function lh(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,R.HTML),e.insertionMode=H.IN_TABLE_BODY}function uh(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(z.TBODY,B.TBODY),e.insertionMode=H.IN_TABLE_BODY,wh(e,t)}function dh(e,t){e.openElements.hasInTableScope(B.TABLE)&&(e.openElements.popUntilTagNamePopped(B.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function fh(e,t){Dm(t)?e._appendElement(t,R.HTML):gh(e,t),t.ackSelfClosing=!0}function ph(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,R.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function mh(e,t){switch(t.tagID){case B.TD:case B.TH:case B.TR:uh(e,t);break;case B.STYLE:case B.SCRIPT:case B.TEMPLATE:$p(e,t);break;case B.COL:ch(e,t);break;case B.FORM:ph(e,t);break;case B.TABLE:dh(e,t);break;case B.TBODY:case B.TFOOT:case B.THEAD:lh(e,t);break;case B.INPUT:fh(e,t);break;case B.CAPTION:oh(e,t);break;case B.COLGROUP:sh(e,t);break;default:gh(e,t)}}function hh(e,t){switch(t.tagID){case B.TABLE:e.openElements.hasInTableScope(B.TABLE)&&(e.openElements.popUntilTagNamePopped(B.TABLE),e._resetInsertionMode());break;case B.TEMPLATE:tm(e,t);break;case B.BODY:case B.CAPTION:case B.COL:case B.COLGROUP:case B.HTML:case B.TBODY:case B.TD:case B.TFOOT:case B.TH:case B.THEAD:case B.TR:break;default:gh(e,t)}}function gh(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,lm(e,t),e.fosterParentingEnabled=n}function _h(e,t){e.pendingCharacterTokens.push(t)}function vh(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function yh(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===B.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===B.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===B.OPTGROUP&&e.openElements.pop();break;case B.OPTION:e.openElements.currentTagId===B.OPTION&&e.openElements.pop();break;case B.SELECT:e.openElements.hasInSelectScope(B.SELECT)&&(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode());break;case B.TEMPLATE:tm(e,t);break;default:}}function Mh(e,t){let n=t.tagID;n===B.CAPTION||n===B.TABLE||n===B.TBODY||n===B.TFOOT||n===B.THEAD||n===B.TR||n===B.TD||n===B.TH?(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode(),e._processStartTag(t)):Ah(e,t)}function Nh(e,t){let n=t.tagID;n===B.CAPTION||n===B.TABLE||n===B.TBODY||n===B.TFOOT||n===B.THEAD||n===B.TR||n===B.TD||n===B.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode(),e.onEndTag(t)):jh(e,t)}function Ph(e,t){switch(t.tagID){case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:case B.NOFRAMES:case B.SCRIPT:case B.STYLE:case B.TEMPLATE:case B.TITLE:$p(e,t);break;case B.CAPTION:case B.COLGROUP:case B.TBODY:case B.TFOOT:case B.THEAD:e.tmplInsertionModeStack[0]=H.IN_TABLE,e.insertionMode=H.IN_TABLE,mh(e,t);break;case B.COL:e.tmplInsertionModeStack[0]=H.IN_COLUMN_GROUP,e.insertionMode=H.IN_COLUMN_GROUP,Sh(e,t);break;case B.TR:e.tmplInsertionModeStack[0]=H.IN_TABLE_BODY,e.insertionMode=H.IN_TABLE_BODY,wh(e,t);break;case B.TD:case B.TH:e.tmplInsertionModeStack[0]=H.IN_ROW,e.insertionMode=H.IN_ROW,Eh(e,t);break;default:e.tmplInsertionModeStack[0]=H.IN_BODY,e.insertionMode=H.IN_BODY,Um(e,t)}}function Fh(e,t){t.tagID===B.TEMPLATE&&tm(e,t)}function Ih(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(B.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Wp(e,t)}function Lh(e,t){t.tagID===B.HTML?Um(e,t):zh(e,t)}function Rh(e,t){if(t.tagID===B.HTML){if(e.fragmentContext||(e.insertionMode=H.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===B.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!e.treeAdapter.getNodeSourceCodeLocation(n)?.endTag&&e._setEndLocation(n,t)}}else zh(e,t)}function zh(e,t){e.insertionMode=H.IN_BODY,lm(e,t)}function Bh(e,t){switch(t.tagID){case B.HTML:Um(e,t);break;case B.FRAMESET:e._insertElement(t,R.HTML);break;case B.FRAME:e._appendElement(t,R.HTML),t.ackSelfClosing=!0;break;case B.NOFRAMES:$p(e,t);break;default:}}function Vh(e,t){t.tagID===B.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==B.FRAMESET&&(e.insertionMode=H.AFTER_FRAMESET))}function Hh(e,t){switch(t.tagID){case B.HTML:Um(e,t);break;case B.NOFRAMES:$p(e,t);break;default:}}function Uh(e,t){t.tagID===B.HTML&&(e.insertionMode=H.AFTER_AFTER_FRAMESET)}function Wh(e,t){t.tagID===B.HTML?Um(e,t):Gh(e,t)}function Gh(e,t){e.insertionMode=H.IN_BODY,lm(e,t)}function Kh(e,t){switch(t.tagID){case B.HTML:Um(e,t);break;case B.NOFRAMES:$p(e,t);break;default:}}function qh(e,t){t.chars=`�`,e._insertCharacters(t)}function Jh(e,t){e._insertCharacters(t),e.framesetOk=!1}function Yh(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==R.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Xh(e,t){if(yp(t))Yh(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===R.MATHML?bp(t):r===R.SVG&&(Cp(t),xp(t)),Sp(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function Zh(e,t){if(t.tagID===B.P||t.tagID===B.BR){Yh(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===R.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}new Set([z.AREA,z.BASE,z.BASEFONT,z.BGSOUND,z.BR,z.COL,z.EMBED,z.FRAME,z.HR,z.IMG,z.INPUT,z.KEYGEN,z.LINK,z.META,z.PARAM,z.SOURCE,z.TRACK,z.WBR]);const Qh=eg(`end`),$h=eg(`start`);function eg(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function tg(e){let t=$h(e),n=Qh(e);if(t&&n)return{start:t,end:n}}var ng=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,rg=new Set([`mdxFlowExpression`,`mdxJsxFlowElement`,`mdxJsxTextElement`,`mdxTextExpression`,`mdxjsEsm`]),ig={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function ag(e,t){let n=_g(e),r=Nd(`type`,{handlers:{root:sg,element:cg,text:lg,comment:fg,doctype:ug,raw:ree},unknown:iee}),i={parser:n?new Np(ig):Np.getFragmentParser(void 0,ig),handle(e){r(e,i)},stitches:!1,options:t||{}};r(e,i),pg(i,$h());let a=wd(n?i.parser.document:i.parser.getFragment(),{file:i.options.file});return i.stitches&&nu(a,`comment`,function(e,t,n){let r=e;if(r.value.stitch&&n&&t!==void 0){let e=n.children;return e[t]=r.value.stitch,t}}),a.type===`root`&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function og(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);let n={type:rf.CHARACTER,chars:e.value,location:vg(e)};pg(t,$h(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function ug(e,t){let n={type:rf.DOCTYPE,name:`html`,forceQuirks:!1,publicId:``,systemId:``,location:vg(e)};pg(t,$h(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function dg(e,t){t.stitches=!0;let n=yg(e);`children`in e&&`children`in n&&(n.children=ag({type:`root`,children:e.children},t.options).children),fg({type:`comment`,value:{stitch:n}},t)}function fg(e,t){let n=e.value,r={type:rf.COMMENT,data:n,location:vg(e)};pg(t,$h(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function ree(e,t){if(t.parser.tokenizer.preprocessor.html=``,t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,mg(t,$h(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(ng,`<$1$2`):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;let e=t.parser.tokenizer._consume();t.parser.tokenizer._callState(e)}}function iee(e,t){let n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))dg(n,t);else{let e=``;throw rg.has(n.type)&&(e=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),Error("Cannot compile `"+n.type+"` node"+e)}}function pg(e,t){mg(e,t);let n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Df.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:``,value:``}}function mg(e,t){if(t&&t.offset!==void 0){let n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function hg(e,t){let n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Df.PLAINTEXT)return;pg(t,$h(e));let r=t.parser.openElements.current,i=`namespaceURI`in r?r.namespaceURI:xd.html;i===xd.html&&n===`svg`&&(i=xd.svg);let a=Ld({...e,children:[]},{space:i===xd.svg?`svg`:`html`}),o={type:rf.START_TAG,tagName:n,tagID:Cf(n),selfClosing:!1,ackSelfClosing:!1,attrs:`attrs`in a?a.attrs:[],location:vg(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function gg(e,t){let n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&qd.includes(n)||t.parser.tokenizer.state===Df.PLAINTEXT)return;pg(t,Qh(e));let r={type:rf.END_TAG,tagName:n,tagID:Cf(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:vg(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Df.RCDATA||t.parser.tokenizer.state===Df.RAWTEXT||t.parser.tokenizer.state===Df.SCRIPT_DATA)&&(t.parser.tokenizer.state=Df.DATA)}function _g(e){let t=e.type===`root`?e.children[0]:e;return!!(t&&(t.type===`doctype`||t.type===`element`&&t.tagName.toLowerCase()===`html`))}function vg(e){let t=$h(e)||{line:void 0,column:void 0,offset:void 0},n=Qh(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function yg(e){return`children`in e?xu({...e,children:[]}):xu(e)}function bg(e){return function(t,n){return ag(t,{...e,file:n})}}var xg=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`];const Sg={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...xg,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...xg],h2:[[`className`,`sr-only`]],img:[...xg,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...xg,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...xg],table:[...xg],ul:[...xg,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)};var Cg={}.hasOwnProperty;function wg(e,t){let n={type:`root`,children:[]},r=Tg({schema:t?{...Sg,...t}:Sg,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function Tg(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return Eg(e,n);case`doctype`:return Dg(e,n);case`element`:return Og(e,n);case`root`:return kg(e,n);case`text`:return Ag(e,n);default:}}}function Eg(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return Lg(r,t),r}}function Dg(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return Lg(e,t),e}}function Og(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=jg(e,t.children),i=Mg(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&Cg.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r1){let e=!1,n=0;for(;++n-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l4&&t.slice(0,4).toLowerCase()===`data`)return n}function zg(e){return function(t){return wg(t,e)}}function Bg(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const Vg=$g(/[A-Za-z]/),Hg=$g(/[\dA-Za-z]/),Ug=$g(/[#-'*+\--9=?A-Z^-~]/);function Wg(e){return e!==null&&(e<32||e===127)}const Gg=$g(/\d/),Kg=$g(/[\dA-Fa-f]/),qg=$g(/[!-/:-@[-`{-~]/);function Jg(e){return e!==null&&e<-2}function Yg(e){return e!==null&&(e<0||e===32)}function Xg(e){return e===-2||e===-1||e===32}const Zg=$g(/\p{P}|\p{S}/u),Qg=$g(/\s/);function $g(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function e_(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function t_(e,t,n){let r=Wl((n||{}).ignore||[]),i=n_(t),a=-1;for(;++a0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Bg(e,`(`),a=Bg(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function b_(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Qg(n)||Zg(n))&&(!t||n!==47)}function x_(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}j_.peek=A_;function S_(){this.buffer()}function C_(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function w_(){this.buffer()}function T_(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function E_(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=x_(this.sliceSerialize(e)).toLowerCase(),n.label=t}function D_(e){this.exit(e)}function O_(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=x_(this.sliceSerialize(e)).toLowerCase(),n.label=t}function k_(e){this.exit(e)}function A_(){return`[`}function j_(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function M_(){return{enter:{gfmFootnoteCallString:S_,gfmFootnoteCall:C_,gfmFootnoteDefinitionLabelString:w_,gfmFootnoteDefinition:T_},exit:{gfmFootnoteCallString:E_,gfmFootnoteCall:D_,gfmFootnoteDefinitionLabelString:O_,gfmFootnoteDefinition:k_}}}function N_(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:j_},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?` +`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?F_:P_))),s(),o}}function P_(e,t,n){return t===0?e:F_(e,t,n)}function F_(e,t,n){return(n?``:` `)+e}var I_=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];V_.peek=H_;function L_(){return{canContainEols:[`delete`],enter:{strikethrough:z_},exit:{strikethrough:B_}}}function R_(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:I_}],handlers:{delete:V_}}}function z_(e){this.enter({type:`delete`,children:[]},e)}function B_(e){this.exit(e)}function V_(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function H_(){return`~`}function U_(e){return e.length}function W_(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||U_,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++ul&&(l=e[u].length);++ac[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++dc[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),J_);return i(),o}function J_(e,t,n){return`>`+(n?``:` `)+e}function Y_(e,t){return X_(e,t.inConstruct,!0)&&!X_(e,t.notInConstruct,!1)}function X_(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++ro&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function $_(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function ev(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function tv(e,t,n,r){let i=ev(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if($_(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,nv);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Q_(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:` +`,encode:["`"],...s.current()})),t()}return u+=s.move(` +`),a&&(u+=s.move(a+` +`)),u+=s.move(c),l(),u}function nv(e,t,n){return(n?``:` `)+e}function rv(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function iv(e,t,n,r){let i=rv(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:` +`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function av(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function ov(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function sv(e){if(e===null||Yg(e)||Qg(e))return 1;if(Zg(e))return 2}function cv(e,t,n){let r=sv(e),i=sv(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}lv.peek=uv;function lv(e,t,n,r){let i=av(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=cv(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=ov(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=cv(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+ov(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function uv(e,t,n){return n.options.emphasis||`*`}var dv={};function fv(e,t){let n=t||dv;return pv(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function pv(e,t,n){if(hv(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return mv(e.children,t,n)}return Array.isArray(e)?mv(e,t,n):``}function mv(e,t,n){let r=[],i=-1;for(;++i`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function xv(){return`!`}Sv.peek=Cv;function Sv(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Cv(){return`!`}wv.peek=Tv;function wv(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a\u007F]/.test(e.url))}Dv.peek=Ov;function Dv(e,t,n,r){let i=rv(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(Ev(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Ov(e,t,n){return Ev(e,n)?`<`:`[`}kv.peek=Av;function kv(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Av(){return`[`}function jv(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Mv(e){let t=jv(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Nv(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Pv(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Fv(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Nv(n):jv(n),s=e.ordered?o===`.`?`)`:`.`:Mv(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Pv(n)===o&&t){let t=-1;for(;++t-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function see(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}const cee=Wl([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function lee(e,t,n,r){return(e.children.some(function(e){return cee(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function uee(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Iv.peek=dee;function Iv(e,t,n,r){let i=uee(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=cv(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=ov(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=cv(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+ov(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function dee(e,t,n){return n.options.strong||`*`}function fee(e,t,n,r){return n.safe(e.value,r)}function pee(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function mee(e,t,n){let r=(Pv(n)+(n.options.ruleSpaces?` `:``)).repeat(pee(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Lv={blockquote:q_,break:Z_,code:tv,definition:iv,emphasis:lv,hardBreak:Z_,heading:_v,html:vv,image:bv,imageReference:Sv,inlineCode:wv,link:Dv,linkReference:kv,list:Fv,listItem:oee,paragraph:see,root:lee,strong:Iv,text:fee,thematicBreak:mee};var Rv=document.createElement(`i`);function zv(e){let t=`&`+e+`;`;Rv.innerHTML=t;let n=Rv.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function Bv(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}var hee=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function gee(e){return e.replace(hee,_ee)}function _ee(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Bv(n.slice(t?2:1),t?16:10)}return zv(n)||e}function vee(){return{enter:{table:Vv,tableData:Gv,tableHeader:Gv,tableRow:Uv},exit:{codeText:Kv,table:Hv,tableData:Wv,tableHeader:Wv,tableRow:Wv}}}function Vv(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function Hv(e){this.exit(e),this.data.inTable=void 0}function Uv(e){this.enter({type:`tableRow`,children:[]},e)}function Wv(e){this.exit(e)}function Gv(e){this.enter({type:`tableCell`,children:[]},e)}function Kv(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,qv));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function qv(e,t){return t===`|`?t:e}function Jv(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:` +`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(` +`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return W_(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++ii?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a0?(ny(e,e.length,0,t),e):t}var iy={}.hasOwnProperty;function ay(e){let t={},n=-1;for(;++n0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function My(e){let t=[],n=-1,r=0,i=0;for(;++n55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Ny(e,t,n){let r=[],i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Ly(d,-c),Ly(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=ry(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=ry(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=ry(l,Ny(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=ry(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=ry(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,ny(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n0&&Xg(t)?By(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Jg(t)?e.check(Zy,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Jg(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Xg(t)?By(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Xg(t)?By(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Jg(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function eb(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const tb={name:`codeIndented`,tokenize:rb};var nb={partial:!0,tokenize:ib};function rb(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),By(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):Jg(t)?e.attempt(nb,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Jg(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function ib(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Jg(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):By(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):Jg(e)?i(e):n(e)}}const ab={name:`codeText`,previous:sb,resolve:ob,tokenize:cb};function ob(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&ub(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),ub(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),ub(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function vb(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Wg(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Jg(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Yg(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Jg(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Jg(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Xg(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function bb(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Jg(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),By(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Jg(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function xb(e,t){let n;return r;function r(i){return Jg(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Xg(i)?By(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const Sb={name:`definition`,tokenize:wb};var Cb={partial:!0,tokenize:Tb};function wb(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return yb.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=x_(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Yg(t)?xb(e,l)(t):l(t)}function l(t){return vb(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Cb,d,d)(t)}function d(t){return Xg(t)?By(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Jg(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Tb(e,t,n){return r;function r(t){return Yg(t)?xb(e,i)(t):n(t)}function i(t){return bb(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Xg(t)?By(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Jg(e)?t(e):n(e)}}const Eb={name:`hardBreakEscape`,tokenize:Db};function Db(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Jg(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const Ob={name:`headingAtx`,resolve:kb,tokenize:Ab};function kb(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},ny(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Ab(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Yg(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Jg(n)?(e.exit(`atxHeading`),t(n)):Xg(n)?By(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Yg(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}const jb=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Mb=[`pre`,`script`,`style`,`textarea`],Nb={concrete:!0,name:`htmlFlow`,resolveTo:Ib,tokenize:Lb};var Pb={partial:!0,tokenize:zb},Fb={partial:!0,tokenize:Rb};function Ib(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Lb(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:M):Vg(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):Vg(a)?(e.consume(a),i=4,r.interrupt?t:M):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:M):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return Vg(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Yg(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Mb.includes(l)?(i=1,r.interrupt?t(s):O(s)):jb.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||Hg(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return Xg(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Vg(t)?(e.consume(t),b):Xg(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Hg(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Xg(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Xg(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Jg(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Yg(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Xg(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Jg(t)?O(t):Xg(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),te):t===60&&i===1?(e.consume(t),ne):t===62&&i===4?(e.consume(t),ie):t===63&&i===3?(e.consume(t),M):t===93&&i===5?(e.consume(t),re):Jg(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Pb,ae,k)(t)):t===null||Jg(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Fb,A,ae)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return t===null||Jg(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function te(t){return t===45?(e.consume(t),M):O(t)}function ne(t){return t===47?(e.consume(t),o=``,j):O(t)}function j(t){if(t===62){let n=o.toLowerCase();return Mb.includes(n)?(e.consume(t),ie):O(t)}return Vg(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),j):O(t)}function re(t){return t===93?(e.consume(t),M):O(t)}function M(t){return t===62?(e.consume(t),ie):t===45&&i===2?(e.consume(t),M):O(t)}function ie(t){return t===null||Jg(t)?(e.exit(`htmlFlowData`),ae(t)):(e.consume(t),ie)}function ae(n){return e.exit(`htmlFlow`),t(n)}}function Rb(e,t,n){let r=this;return i;function i(t){return Jg(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function zb(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Vy,t,n)}}const Bb={name:`htmlText`,tokenize:Vb};function Vb(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):Vg(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):Vg(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Jg(t)?(o=d,ne(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?te(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Jg(t)?(o=h,ne(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?te(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?te(t):Jg(t)?(o=v,ne(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Jg(t)?(o=y,ne(t)):(e.consume(t),y)}function b(e){return e===62?te(e):y(e)}function x(t){return Vg(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Hg(t)?(e.consume(t),S):C(t)}function C(t){return Jg(t)?(o=C,ne(t)):Xg(t)?(e.consume(t),C):te(t)}function w(t){return t===45||Hg(t)?(e.consume(t),w):t===47||t===62||Yg(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),te):t===58||t===95||Vg(t)?(e.consume(t),E):Jg(t)?(o=T,ne(t)):Xg(t)?(e.consume(t),T):te(t)}function E(t){return t===45||t===46||t===58||t===95||Hg(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Jg(t)?(o=D,ne(t)):Xg(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):Jg(t)?(o=O,ne(t)):Xg(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,ee):t===null?n(t):Jg(t)?(o=k,ne(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Yg(t)?T(t):(e.consume(t),A)}function ee(e){return e===47||e===62||Yg(e)?T(e):n(e)}function te(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function ne(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return Xg(t)?By(e,re,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):re(t)}function re(t){return e.enter(`htmlTextData`),o(t)}}const Hb={name:`labelEnd`,resolveAll:Kb,resolveTo:qb,tokenize:Jb};var Ub={tokenize:Yb},Wb={tokenize:Xb},Gb={tokenize:Zb};function Kb(e){let t=-1,n=[];for(;++t=3&&(a===null||Jg(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Xg(t)?By(e,s,`whitespace`)(t):s(t))}}const ox={continuation:{tokenize:ux},exit:fx,name:`list`,tokenize:lx};var sx={partial:!0,tokenize:px},cx={partial:!0,tokenize:dx};function lx(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Gg(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(ix,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Gg(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Vy,r.interrupt?n:u,e.attempt(sx,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Xg(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function ux(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Vy,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,By(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Xg(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(cx,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,By(e,e.attempt(ox,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function dx(e,t,n){let r=this;return By(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function fx(e){e.exit(this.containerState.type)}function px(e,t,n){let r=this;return By(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Xg(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}const mx={name:`setextUnderline`,resolveTo:hx,tokenize:gx};function hx(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function gx(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Xg(t)?By(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Jg(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var _x={tokenize:Tx,partial:!0};function vx(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Sx,continuation:{tokenize:Cx},exit:wx}},text:{91:{name:`gfmFootnoteCall`,tokenize:xx},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:yx,resolveTo:bx}}}}function yx(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=x_(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function bx(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function xx(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Yg(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(x_(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Yg(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function Sx(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Yg(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=x_(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Yg(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),By(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Cx(e,t,n){return e.check(Vy,t,e.attempt(_x,t,n))}function wx(e){e.exit(`gfmFootnoteDefinition`)}function Tx(e,t,n){let r=this;return By(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Ex(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=sv(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Dx=class{constructor(){this.map=[]}add(e,t,n){Ox(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function Ox(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Jg(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Xg(t)?By(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Yg(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Xg(t)?By(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Xg(t)?By(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Jg(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Xg(t)?By(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Jg(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Jg(n)?(e.exit(`tableRow`),t(n)):Xg(n)?By(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Yg(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Mx(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Dx;for(;++nn[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Fx(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Px(e,t,n,r,i){let a=[],o=Fx(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Fx(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Ix={name:`tasklistCheck`,tokenize:Rx};function Lx(){return{text:{91:Ix}}}function Rx(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Yg(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Jg(r)?t(r):Xg(r)?e.check({tokenize:zx},t,n)(r):n(r)}}function zx(e,t,n){return By(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Bx(e){return ay([_y(),vx(),Ex(e),Ax(),Lx()])}var Vx={};function Hx(e){let t=this,n=e||Vx,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Bx(n)),a.push(ey()),o.push(ty(n))}var Ux=Object.defineProperty,Wx=Object.defineProperties,Gx=Object.getOwnPropertyDescriptors,Kx=Object.getOwnPropertySymbols,qx=Object.prototype.hasOwnProperty,Jx=Object.prototype.propertyIsEnumerable,Yx=(e,t,n)=>t in e?Ux(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xx=(e,t)=>{for(var n in t||={})qx.call(t,n)&&Yx(e,n,t[n]);if(Kx)for(var n of Kx(t))Jx.call(t,n)&&Yx(e,n,t[n]);return e},Zx=(e,t)=>Wx(e,Gx(t)),Qx=/(\*\*)([^*]*\*?)$/,$x=/(__)([^_]*?)$/,eS=/(\*\*\*)([^*]*?)$/,tS=/(\*)([^*]*?)$/,nS=/(_)([^_]*?)$/,rS=/(`)([^`]*?)$/,iS=/(~~)([^~]*?)$/,aS=/^[\s_~*`]*$/,oS=/^[\s]*[-*+][\s]+$/,sS=/[\p{L}\p{N}_]/u,cS=/^```[^`\n]*```?$/,lS=/^\*{4,}$/,uS=/(__)([^_]+)_$/,dS=/(~~)([^~]+)~$/,fS=/__/g,pS=/~~/g,mS=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95?!0:sS.test(e)},hS=(e,t)=>{let n=!1;for(let r=0;r{let n=1;for(let r=t-1;r>=0;--r)if(e[r]===`]`)n+=1;else if(e[r]===`[`&&(--n,n===0))return r;return-1},_S=(e,t)=>{let n=1;for(let r=t+1;r{let n=!1,r=!1;for(let i=0;i{for(let n=t;n{for(let n=t-1;n>=0;--n){if(e[n]===`)`)return!1;if(e[n]===`(`)return n>0&&e[n-1]===`]`?yS(e,t):!1;if(e[n]===` +`)return!1}return!1},xS=(e,t,n)=>{let r=0;for(let n=t-1;n>=0;--n)if(e[n]===` +`){r=n+1;break}let i=e.length;for(let n=t;n=3&&!s},SS=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,CS=e=>!e||typeof e!=`string`||!e.includes(`>`)?e:e.replace(SS,(t,n,r,i)=>hS(e,i)?t:`${n}\\>${r}`),wS=(e,t,n)=>{if(n!==` `&&n!==` `)return!1;let r=0;for(let n=t-1;n>=0;--n)if(e[n]===` +`){r=n+1;break}for(let n=r;nn===`\\`||e.includes(`$`)&&vS(e,t)?!0:n!==`*`&&r===`*`?(t{let t=0,n=e.length;for(let r=0;r0?e[r-1]:``,a=r!!(n===`\\`||e.includes(`$`)&&vS(e,t)||bS(e,t)||n===`_`||r===`_`||n&&r&&mS(n)&&mS(r)),OS=e=>{let t=0,n=e.length;for(let r=0;r0?e[r-1]:``,a=r{let t=0,n=0;for(let r=0;r=3&&(t+=Math.floor(n/3)),n=0);return n>=3&&(t+=Math.floor(n/3)),t},AS=(e,t,n)=>{if(!t||aS.test(t))return!0;let r=e.substring(0,n).lastIndexOf(` +`),i=r===-1?0:r+1,a=e.substring(i,n);return oS.test(a)&&t.includes(` +`)?!0:xS(e,n,`*`)},jS=e=>{let t=e.match(Qx);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return hS(e,r)||AS(e,n,r)?e:(e.match(/\*\*/g)||[]).length%2==1?n.endsWith(`*`)?`${e}*`:`${e}**`:e},MS=(e,t,n)=>{if(!t||aS.test(t))return!0;let r=e.substring(0,n).lastIndexOf(` +`),i=r===-1?0:r+1,a=e.substring(i,n);return oS.test(a)&&t.includes(` +`)?!0:xS(e,n,`_`)},NS=e=>{let t=e.match($x);if(!t){let t=e.match(uS);return t&&!hS(e,e.lastIndexOf(t[1]))&&(e.match(fS)||[]).length%2==1?`${e}_`:e}let n=t[2],r=e.lastIndexOf(t[1]);return hS(e,r)||MS(e,n,r)?e:(e.match(/__/g)||[]).length%2==1?`${e}__`:e},PS=e=>{for(let t=0;t0?e[t-1]:``,r=t{if(!e.match(tS))return e;let t=PS(e);if(t===-1||hS(e,t))return e;let n=e.substring(t+1);return!n||aS.test(n)?e:ES(e)%2==1?`${e}*`:e},IS=e=>{for(let t=0;t0?e[t-1]:``,r=t{let t=e.length;for(;t>0&&e[t-1]===` +`;)--t;return t{if(!e.endsWith(`**`))return null;let t=e.slice(0,-2);if((t.match(/\*\*/g)||[]).length%2!=1)return null;let n=t.indexOf(`**`),r=IS(t);return n!==-1&&r!==-1&&n{if(!e.match(nS))return e;let t=IS(e);if(t===-1||hS(e,t))return e;let n=e.substring(t+1);if(!n||aS.test(n))return e;if(OS(e)%2==1){let t=RS(e);return t===null?LS(e):t}return e},BS=e=>{let t=(e.match(/\*\*/g)||[]).length,n=ES(e);return t%2==0&&n%2==0},VS=(e,t,n)=>!t||aS.test(t)||hS(e,n)?!0:xS(e,n,`*`),HS=e=>{if(lS.test(e))return e;let t=e.match(eS);if(!t)return e;let n=t[2];return VS(e,n,e.lastIndexOf(t[1]))?e:kS(e)%2==1?BS(e)?e:`${e}***`:e},US=(e,t)=>{let n=!1,r=!1;for(let i=0;i{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",i=t>1&&e.substring(t-2,t+1)==="```";return n||r||i},GS=e=>{let t=0;for(let n=0;n]*$/,qS=e=>{let t=e.match(KS);return!t||t.index===void 0||US(e,t.index)?e:e.substring(0,t.index).trimEnd()},JS=e=>!e.match(cS)||e.includes(` +`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,YS=e=>(e.match(/```/g)||[]).length%2==1,XS=e=>{let t=JS(e);if(t!==null)return t;let n=e.match(rS);if(n&&!YS(e)){let t=n[2];if(!t||aS.test(t))return e;if(GS(e)%2==1)return`${e}\``}return e},ZS=(e,t)=>t>=2&&e.substring(t-2,t+1)==="```"||t>=1&&e.substring(t-1,t+2)==="```"||t<=e.length-3&&e.substring(t,t+3)==="```",QS=e=>{let t=0,n=!1;for(let r=0;r{let t=e.indexOf(`$$`);return t!==-1&&e.indexOf(` +`,t)!==-1&&!e.endsWith(` +`)?`${e} +$$`:`${e}$$`},eC=e=>QS(e)%2==0?e:$S(e),tC=(e,t,n)=>{if(e.substring(t+2).includes(`)`))return null;let r=gS(e,t);if(r===-1||US(e,r))return null;let i=r>0&&e[r-1]===`!`,a=i?r-1:r,o=e.substring(0,a);if(i)return o;let s=e.substring(r+1,t);return n===`text-only`?`${o}${s}`:`${o}[${s}](streamdown:incomplete-link)`},nC=(e,t)=>{for(let n=0;n<=t;n++)if(e[n]===`[`&&!US(e,n)){if(n>0&&e[n-1]===`!`)continue;let t=_S(e,n);if(t===-1)return n;if(t+1{let r=t>0&&e[t-1]===`!`,i=r?t-1:t,a=e.substring(t+1);if(!a.includes(`]`)){let o=e.substring(0,i);if(r)return o;if(n===`text-only`){let n=nC(e,t);return n===-1?`${o}${a}`:e.substring(0,n)+e.substring(n+1)}return`${e}](streamdown:incomplete-link)`}if(_S(e,t)===-1){let a=e.substring(0,i);if(r)return a;if(n===`text-only`){let n=nC(e,t);return n===-1?`${a}${e.substring(t+1)}`:e.substring(0,n)+e.substring(n+1)}return`${e}](streamdown:incomplete-link)`}return null},iC=(e,t=`protocol`)=>{let n=e.lastIndexOf(`](`);if(n!==-1&&!US(e,n)){let r=tC(e,n,t);if(r!==null)return r}for(let n=e.length-1;n>=0;--n)if(e[n]===`[`&&!US(e,n)){let r=rC(e,n,t);if(r!==null)return r}return e},aC=/^-{1,2}$/,oC=/^[\s]*-{1,2}[\s]+$/,sC=/^={1,2}$/,cC=/^[\s]*={1,2}[\s]+$/,lC=e=>{if(!e||typeof e!=`string`)return e;let t=e.lastIndexOf(` +`);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(aC.test(i)&&!n.match(oC)){let t=r.split(` +`).at(-1);if(t&&t.trim().length>0)return`${e}\u200B`}if(sC.test(i)&&!n.match(cC)){let t=r.split(` +`).at(-1);if(t&&t.trim().length>0)return`${e}\u200B`}return e},uC=e=>{let t=e.match(iS);if(t){let n=t[2];if(!n||aS.test(n))return e;if((e.match(pS)||[]).length%2==1)return`${e}~~`}else if(e.match(dS)&&(e.match(pS)||[]).length%2==1)return`${e}~`;return e},dC=e=>e!==!1,fC={COMPARISON_OPERATORS:-10,HTML_TAGS:-5,SETEXT_HEADINGS:0,LINKS:10,BOLD_ITALIC:20,BOLD:30,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,DEFAULT:100},pC=[{handler:{name:`comparisonOperators`,handle:CS,priority:fC.COMPARISON_OPERATORS},optionKey:`comparisonOperators`},{handler:{name:`htmlTags`,handle:qS,priority:fC.HTML_TAGS},optionKey:`htmlTags`},{handler:{name:`setextHeadings`,handle:lC,priority:fC.SETEXT_HEADINGS},optionKey:`setextHeadings`},{handler:{name:`links`,handle:iC,priority:fC.LINKS},optionKey:`links`,earlyReturn:e=>e.endsWith(`](streamdown:incomplete-link)`)},{handler:{name:`boldItalic`,handle:HS,priority:fC.BOLD_ITALIC},optionKey:`boldItalic`},{handler:{name:`bold`,handle:jS,priority:fC.BOLD},optionKey:`bold`},{handler:{name:`italicDoubleUnderscore`,handle:NS,priority:fC.ITALIC_DOUBLE_UNDERSCORE},optionKey:`italic`},{handler:{name:`italicSingleAsterisk`,handle:FS,priority:fC.ITALIC_SINGLE_ASTERISK},optionKey:`italic`},{handler:{name:`italicSingleUnderscore`,handle:zS,priority:fC.ITALIC_SINGLE_UNDERSCORE},optionKey:`italic`},{handler:{name:`inlineCode`,handle:XS,priority:fC.INLINE_CODE},optionKey:`inlineCode`},{handler:{name:`strikethrough`,handle:uC,priority:fC.STRIKETHROUGH},optionKey:`strikethrough`},{handler:{name:`katex`,handle:eC,priority:fC.KATEX},optionKey:`katex`}],mC=e=>{let t=e?.linkMode??`protocol`;return pC.filter(({handler:t,optionKey:n})=>t.name===`links`?dC(e?.links)||dC(e?.images):dC(e?.[n])).map(({handler:e,earlyReturn:n})=>e.name===`links`?{handler:Zx(Xx({},e),{handle:e=>iC(e,t)}),earlyReturn:t===`protocol`?n:void 0}:{handler:e,earlyReturn:n})},hC=(e,t)=>{if(!e||typeof e!=`string`)return e;let n=e.endsWith(` `)&&!e.endsWith(` `)?e.slice(0,-1):e,r=mC(t),i=(t?.handlers??[]).map(e=>({handler:Zx(Xx({},e),{priority:e.priority??fC.DEFAULT}),earlyReturn:void 0})),a=[...r,...i].sort((e,t)=>(e.handler.priority??fC.DEFAULT)-(t.handler.priority??fC.DEFAULT));for(let{handler:e,earlyReturn:t}of a)if(n=e.handle(n),t!=null&&t(n))return n;return n};function gC(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t{let n=Array(e.length+t.length);for(let t=0;t({classGroupId:e,validator:t}),bC=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),xC=`-`,SC=[],CC=`arbitrary..`,wC=e=>{let t=DC(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return EC(e);let n=e.split(xC);return TC(n,n[0]===``&&n.length>1?1:0,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?vC(i,t):t:i||SC}return n[e]||SC}}},TC=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=TC(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(xC):e.slice(t).join(xC),s=a.length;for(let e=0;ee.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?CC+r:void 0})(),DC=e=>{let{theme:t,classGroups:n}=e;return OC(n,t)},OC=(e,t)=>{let n=bC();for(let r in e){let i=e[r];kC(i,n,r,t)}return n},kC=(e,t,n,r)=>{let i=e.length;for(let a=0;a{if(typeof e==`string`){jC(e,t,n);return}if(typeof e==`function`){MC(e,t,n,r);return}NC(e,t,n,r)},jC=(e,t,n)=>{let r=e===``?t:PC(t,e);r.classGroupId=n},MC=(e,t,n,r)=>{if(FC(e)){kC(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(yC(n,e))},NC=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e{let n=e,r=t.split(xC),i=r.length;for(let e=0;e`isThemeGetter`in e&&e.isThemeGetter===!0,IC=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},LC=`!`,RC=`:`,zC=[],BC=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),VC=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;si?a-i:void 0;return BC(t,l,c,u)};if(t){let e=t+RC,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):BC(zC,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},HC=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},UC=e=>({cache:IC(e.cacheSize),parseClassName:VC(e),sortModifiers:HC(e),...wC(e)}),WC=/\s+/,GC=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(WC),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+LC:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e0?` `+c:c)}return c},KC=(...e)=>{let t=0,n,r,i=``;for(;t{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r{let n,r,i,a,o=o=>(n=UC(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=GC(e,n);return i(e,a),a};return a=o,(...e)=>a(KC(...e))},YC=[],XC=e=>{let t=t=>t[e]||YC;return t.isThemeGetter=!0,t},ZC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,QC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$C=/^\d+\/\d+$/,ew=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,tw=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,nw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,rw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,iw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,aw=e=>$C.test(e),ow=e=>!!e&&!Number.isNaN(Number(e)),sw=e=>!!e&&Number.isInteger(Number(e)),cw=e=>e.endsWith(`%`)&&ow(e.slice(0,-1)),lw=e=>ew.test(e),uw=()=>!0,dw=e=>tw.test(e)&&!nw.test(e),fw=()=>!1,pw=e=>rw.test(e),mw=e=>iw.test(e),hw=e=>!_w(e)&&!Cw(e),gw=e=>Aw(e,Pw,fw),_w=e=>ZC.test(e),vw=e=>Aw(e,Fw,dw),yw=e=>Aw(e,Iw,ow),bw=e=>Aw(e,Mw,fw),xw=e=>Aw(e,Nw,mw),Sw=e=>Aw(e,Rw,pw),Cw=e=>QC.test(e),ww=e=>jw(e,Fw),Tw=e=>jw(e,Lw),Ew=e=>jw(e,Mw),Dw=e=>jw(e,Pw),Ow=e=>jw(e,Nw),kw=e=>jw(e,Rw,!0),Aw=(e,t,n)=>{let r=ZC.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},jw=(e,t,n=!1)=>{let r=QC.exec(e);return r?r[1]?t(r[1]):n:!1},Mw=e=>e===`position`||e===`percentage`,Nw=e=>e===`image`||e===`url`,Pw=e=>e===`length`||e===`size`||e===`bg-size`,Fw=e=>e===`length`,Iw=e=>e===`number`,Lw=e=>e===`family-name`,Rw=e=>e===`shadow`,zw=JC(()=>{let e=XC(`color`),t=XC(`font`),n=XC(`text`),r=XC(`font-weight`),i=XC(`tracking`),a=XC(`leading`),o=XC(`breakpoint`),s=XC(`container`),c=XC(`spacing`),l=XC(`radius`),u=XC(`shadow`),d=XC(`inset-shadow`),f=XC(`text-shadow`),p=XC(`drop-shadow`),m=XC(`blur`),h=XC(`perspective`),g=XC(`aspect`),_=XC(`ease`),v=XC(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Cw,_w],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Cw,_w,c],T=()=>[aw,`full`,`auto`,...w()],E=()=>[sw,`none`,`subgrid`,Cw,_w],D=()=>[`auto`,{span:[`full`,sw,Cw,_w]},sw,Cw,_w],O=()=>[sw,`auto`,Cw,_w],k=()=>[`auto`,`min`,`max`,`fr`,Cw,_w],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ee=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],te=()=>[`auto`,...w()],ne=()=>[aw,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],j=()=>[e,Cw,_w],re=()=>[...b(),Ew,bw,{position:[Cw,_w]}],M=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,Dw,gw,{size:[Cw,_w]}],ae=()=>[cw,ww,vw],oe=()=>[``,`none`,`full`,l,Cw,_w],se=()=>[``,ow,ww,vw],ce=()=>[`solid`,`dashed`,`dotted`,`double`],le=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ue=()=>[ow,cw,Ew,bw],de=()=>[``,`none`,m,Cw,_w],fe=()=>[`none`,ow,Cw,_w],pe=()=>[`none`,ow,Cw,_w],me=()=>[ow,Cw,_w],he=()=>[aw,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[lw],breakpoint:[lw],color:[uw],container:[lw],"drop-shadow":[lw],ease:[`in`,`out`,`in-out`],font:[hw],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[lw],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[lw],shadow:[lw],spacing:[`px`,ow],text:[lw],"text-shadow":[lw],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,aw,_w,Cw,g]}],container:[`container`],columns:[{columns:[ow,_w,Cw,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{start:T()}],end:[{end:T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[sw,`auto`,Cw,_w]}],basis:[{basis:[aw,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[ow,aw,`auto`,`initial`,`none`,_w]}],grow:[{grow:[``,ow,Cw,_w]}],shrink:[{shrink:[``,ow,Cw,_w]}],order:[{order:[sw,`first`,`last`,`none`,Cw,_w]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...ee(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ee()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...ee(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ee(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...ee(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ee()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:te()}],mx:[{mx:te()}],my:[{my:te()}],ms:[{ms:te()}],me:[{me:te()}],mt:[{mt:te()}],mr:[{mr:te()}],mb:[{mb:te()}],ml:[{ml:te()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:ne()}],w:[{w:[s,`screen`,...ne()]}],"min-w":[{"min-w":[s,`screen`,`none`,...ne()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...ne()]}],h:[{h:[`screen`,`lh`,...ne()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...ne()]}],"max-h":[{"max-h":[`screen`,`lh`,...ne()]}],"font-size":[{text:[`base`,n,ww,vw]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Cw,yw]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,cw,_w]}],"font-family":[{font:[Tw,_w,t]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Cw,_w]}],"line-clamp":[{"line-clamp":[ow,`none`,Cw,yw]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Cw,_w]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Cw,_w]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ce(),`wavy`]}],"text-decoration-thickness":[{decoration:[ow,`from-font`,`auto`,Cw,vw]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[ow,`auto`,Cw,_w]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Cw,_w]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Cw,_w]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:M()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},sw,Cw,_w],radial:[``,Cw,_w],conic:[sw,Cw,_w]},Ow,xw]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":se()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ce(),`hidden`,`none`]}],"divide-style":[{divide:[...ce(),`hidden`,`none`]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...ce(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[ow,Cw,_w]}],"outline-w":[{outline:[``,ow,ww,vw]}],"outline-color":[{outline:j()}],shadow:[{shadow:[``,`none`,u,kw,Sw]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":[`none`,d,kw,Sw]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:se()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[ow,vw]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":[`none`,f,kw,Sw]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[ow,Cw,_w]}],"mix-blend":[{"mix-blend":[...le(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":le()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[ow]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[Cw,_w]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[ow]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:M()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Cw,_w]}],filter:[{filter:[``,`none`,Cw,_w]}],blur:[{blur:de()}],brightness:[{brightness:[ow,Cw,_w]}],contrast:[{contrast:[ow,Cw,_w]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,kw,Sw]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:[``,ow,Cw,_w]}],"hue-rotate":[{"hue-rotate":[ow,Cw,_w]}],invert:[{invert:[``,ow,Cw,_w]}],saturate:[{saturate:[ow,Cw,_w]}],sepia:[{sepia:[``,ow,Cw,_w]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Cw,_w]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[ow,Cw,_w]}],"backdrop-contrast":[{"backdrop-contrast":[ow,Cw,_w]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,ow,Cw,_w]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ow,Cw,_w]}],"backdrop-invert":[{"backdrop-invert":[``,ow,Cw,_w]}],"backdrop-opacity":[{"backdrop-opacity":[ow,Cw,_w]}],"backdrop-saturate":[{"backdrop-saturate":[ow,Cw,_w]}],"backdrop-sepia":[{"backdrop-sepia":[``,ow,Cw,_w]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Cw,_w]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[ow,`initial`,Cw,_w]}],ease:[{ease:[`linear`,`initial`,_,Cw,_w]}],delay:[{delay:[ow,Cw,_w]}],animate:[{animate:[`none`,v,Cw,_w]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Cw,_w]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:fe()}],"rotate-x":[{"rotate-x":fe()}],"rotate-y":[{"rotate-y":fe()}],"rotate-z":[{"rotate-z":fe()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":[`scale-3d`],skew:[{skew:me()}],"skew-x":[{"skew-x":me()}],"skew-y":[{"skew-y":me()}],transform:[{transform:[Cw,_w,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:he()}],"translate-x":[{"translate-x":he()}],"translate-y":[{"translate-y":he()}],"translate-z":[{"translate-z":he()}],"translate-none":[`translate-none`],accent:[{accent:j()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:j()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Cw,_w]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Cw,_w]}],fill:[{fill:[`none`,...j()]}],"stroke-w":[{stroke:[ow,ww,vw,yw]}],stroke:[{stroke:[`none`,...j()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}}),Bw=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Vw=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Hw={};function Uw(e,t){return((t||Hw).jsx?Vw:Bw).test(e)}var Ww=/[ \t\n\f\r]/g;function Gw(e){return typeof e==`object`?e.type===`text`?Kw(e.value):!1:Kw(e)}function Kw(e){return e.replace(Ww,``)===``}var qw=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=` +`,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g})),Jw=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(qw());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),Yw=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Xw=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Jw()),r=Yw();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i}));function Zw(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?$w(e.position):`start`in e||`end`in e?$w(e):`line`in e||`column`in e?Qw(e):``}function Qw(e){return eT(e&&e.line)+`:`+eT(e&&e.column)}function $w(e){return Qw(e&&e.start)+`-`+Qw(e&&e.end)}function eT(e){return e&&typeof e==`number`?e:1}var tT=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Zw(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};tT.prototype.file=``,tT.prototype.name=``,tT.prototype.reason=``,tT.prototype.message=``,tT.prototype.stack=``,tT.prototype.column=void 0,tT.prototype.line=void 0,tT.prototype.ancestors=void 0,tT.prototype.cause=void 0,tT.prototype.fatal=void 0,tT.prototype.place=void 0,tT.prototype.ruleId=void 0,tT.prototype.source=void 0;var nT=l(Xw(),1),rT={}.hasOwnProperty,iT=new Map,aT=/[A-Z]/g,oT=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),sT=new Set([`td`,`th`]),cT=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function lT(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=bT(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=yT(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?nd:td,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=uT(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function uT(e,t,n){if(t.type===`element`)return dT(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return fT(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return mT(e,t,n);if(t.type===`mdxjsEsm`)return pT(e,t);if(t.type===`root`)return hT(e,t,n);if(t.type===`text`)return gT(e,t)}function dT(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=nd,e.schema=i),e.ancestors.push(t);let a=ET(e,t.tagName,!1),o=xT(e,t),s=CT(e,t);return oT.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!Gw(e):!0})),_T(e,o,a,t),vT(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function fT(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}DT(e,t.position)}function pT(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);DT(e,t.position)}function mT(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=nd,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:ET(e,t.name,!0),o=ST(e,t),s=CT(e,t);return _T(e,o,a,t),vT(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function hT(e,t,n){let r={};return vT(r,CT(e,t)),e.create(t,e.Fragment,r,n)}function gT(e,t){return t.value}function _T(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function vT(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function yT(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function bT(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=$h(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function xT(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&rT.call(t.properties,i)){let a=wT(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&sT.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function ST(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else DT(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else DT(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function CT(e,t){let n=[],r=-1,i=e.passKeys?new Map:iT;for(;++ro))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;er;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function LT(e,t,n){return By(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}const RT={tokenize:zT};function zT(e){let t=this,n=e.attempt(Vy,r,e.attempt(this.parser.constructs.flowInitial,i,By(e,e.attempt(this.parser.constructs.flow,i,e.attempt(pb,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}const BT={resolveAll:WT()},VT=UT(`string`),HT=UT(`text`);function UT(e){return{resolveAll:WT(e===`text`?GT:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++iwee,contentInitial:()=>JT,disable:()=>Tee,document:()=>qT,flow:()=>bee,flowInitial:()=>yee,insideSpan:()=>Cee,string:()=>xee,text:()=>See});const qT={42:ox,43:ox,45:ox,48:ox,49:ox,50:ox,51:ox,52:ox,53:ox,54:ox,55:ox,56:ox,57:ox,62:Uy},JT={91:Sb},yee={[-2]:tb,[-1]:tb,32:tb},bee={35:Ob,42:ix,45:[mx,ix],60:Nb,61:mx,95:ix,96:Qy,126:Qy},xee={38:Yy,92:qy},See={[-5]:nx,[-4]:nx,[-3]:nx,33:Qb,38:Yy,42:Py,60:[Ry,Bb],91:ex,92:[Eb,qy],93:Hb,95:Py,96:ab},Cee={null:[Py,BT]},wee={null:[42,95]},Tee={null:[]};function Eee(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=ry(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Ny(a,l.events,l),l.events):[]}function f(e,t){return Oee(p(e),t)}function p(e){return Dee(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Oee(e,t){let n=-1,r=[],i;for(;++n0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||$T).call(a,void 0,e[0])}for(r.position={start:ZT(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:ZT(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function iE(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aE(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oE(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=My(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function sE(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cE(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function lE(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function uE(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return lE(e,t);let i={src:My(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function dE(e,t){let n={src:My(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Fee(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Iee(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return lE(e,t);let i={href:My(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Lee(e,t){let n={href:My(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function fE(e,t,n){let r=e.all(t),i=n?pE(n):mE(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s1}function hE(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=$h(t.children[1]),o=Qh(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function bE(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(TE(t.slice(i),i>0,!1)),a.join(``)}function TE(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===SE||t===CE;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===SE||t===CE;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function EE(e,t){let n={type:`text`,value:wE(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function DE(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const OE={blockquote:tE,break:nE,code:rE,delete:iE,emphasis:aE,footnoteReference:oE,heading:sE,html:cE,imageReference:uE,image:dE,inlineCode:Fee,linkReference:Iee,link:Lee,listItem:fE,list:hE,paragraph:gE,root:_E,strong:vE,table:yE,tableCell:xE,tableRow:bE,text:EE,thematicBreak:DE,toml:kE,yaml:kE,definition:kE,footnoteDefinition:kE};function kE(){}function AE(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function jE(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function ME(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||AE,r=e.options.footnoteBackLabel||jE,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...xu(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:` +`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:` +`}]}}var NE={}.hasOwnProperty,PE={};function FE(e,t){let n=t||PE,r=new Map,i=new Map,a={all:s,applyData:LE,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...OE,...n.handlers},one:o,options:n,patch:IE,wrap:zE};return nu(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(NE.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=xu(n);return r.children=a.all(e),r}return xu(e)}return(a.options.unknownHandler||RE)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r0&&n.push({type:`text`,value:` +`}),n}function BE(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function VE(e,t){let n=FE(e,t),r=n.one(e,void 0),i=ME(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:` +`},i)),a}function HE(e,t){return e&&`run`in e?async function(n,r){let i=VE(n,{file:r,...t});await e.run(i,r)}:function(n,r){return VE(n,{file:r,...e||t})}}function UE(e){if(e)throw e}var WE=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});ft.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}const JE={basename:YE,dirname:XE,extname:ZE,join:QE,sep:`/`};function YE(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);tD(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function XE(e){if(tD(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function ZE(e){tD(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function QE(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function eD(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function tD(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}const Ree={cwd:zee};function zee(){return`/`}function nD(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Bee(e){if(typeof e==`string`)e=new URL(e);else if(!nD(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Vee(e)}function Vee(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n0){let[r,...a]=t,o=n[i][1];GE(o)&&GE(r)&&(r=(0,lD.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function fD(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function pD(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function mD(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function hD(e){if(!GE(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function gD(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function _D(e){return vD(e)?e:new Hee(e)}function vD(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function yD(e){return typeof e==`string`||bD(e)}function bD(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}function xD(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var SD=xD();function CD(e){SD=e}var wD={exec:()=>null};function TD(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(DD.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var ED=(()=>{try{return!0}catch{return!1}})(),DD={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},OD=/^(?:[ \t]*(?:\n|$))+/,kD=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,AD=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,jD=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,MD=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ND=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,PD=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,FD=TD(PD).replace(/bull/g,ND).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),ID=TD(PD).replace(/bull/g,ND).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),LD=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,RD=/^[^\n]+/,zD=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,BD=TD(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,zD).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),VD=TD(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ND).getRegex(),HD=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,UD=/|$))/,WD=TD(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,UD).replace(`tag`,HD).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),GD=TD(LD).replace(`hr`,jD).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,HD).getRegex(),KD={blockquote:TD(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,GD).getRegex(),code:kD,def:BD,fences:AD,heading:MD,hr:jD,html:WD,lheading:FD,list:VD,newline:OD,paragraph:GD,table:wD,text:RD},qD=TD(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,jD).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,HD).getRegex(),JD={...KD,lheading:ID,table:qD,paragraph:TD(LD).replace(`hr`,jD).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,qD).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,HD).getRegex()},YD={...KD,html:TD(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,UD).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:wD,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:TD(LD).replace(`hr`,jD).replace(`heading`,` *#{1,6} *[^ +]`).replace(`lheading`,FD).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},XD=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ZD=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,QD=/^( {2,}|\\)\n(?!\s*$)/,$D=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,ED?"(?`+)[^`]+\k(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),dO=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,fO=TD(dO,`u`).replace(/punct/g,eO).getRegex(),pO=TD(dO,`u`).replace(/punct/g,iO).getRegex(),mO=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,hO=TD(mO,`gu`).replace(/notPunctSpace/g,nO).replace(/punctSpace/g,tO).replace(/punct/g,eO).getRegex(),gO=TD(mO,`gu`).replace(/notPunctSpace/g,oO).replace(/punctSpace/g,aO).replace(/punct/g,iO).getRegex(),_O=TD(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,nO).replace(/punctSpace/g,tO).replace(/punct/g,eO).getRegex(),vO=TD(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,sO).getRegex(),yO=TD(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,lO).replace(/punctSpace/g,cO).replace(/punct/g,sO).getRegex(),bO=TD(/\\(punct)/,`gu`).replace(/punct/g,eO).getRegex(),xO=TD(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),SO=TD(UD).replace(`(?:-->|$)`,`-->`).getRegex(),CO=TD(`^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^`).replace(`comment`,SO).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),wO=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,TO=TD(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace(`label`,wO).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),EO=TD(/^!?\[(label)\]\[(ref)\]/).replace(`label`,wO).replace(`ref`,zD).getRegex(),DO=TD(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,zD).getRegex(),OO=TD(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,EO).replace(`nolink`,DO).getRegex(),kO=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,AO={_backpedal:wD,anyPunctuation:bO,autolink:xO,blockSkip:uO,br:QD,code:ZD,del:wD,delLDelim:wD,delRDelim:wD,emStrongLDelim:fO,emStrongRDelimAst:hO,emStrongRDelimUnd:_O,escape:XD,link:TO,nolink:DO,punctuation:rO,reflink:EO,reflinkSearch:OO,tag:CO,text:$D,url:wD},jO={...AO,link:TD(/^!?\[(label)\]\((.*?)\)/).replace(`label`,wO).getRegex(),reflink:TD(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,wO).getRegex()},MO={...AO,emStrongRDelimAst:gO,emStrongLDelim:pO,delLDelim:vO,delRDelim:yO,url:TD(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,kO).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:TD(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":`>`,'"':`"`,"'":`'`},LO=e=>IO[e];function RO(e,t){if(t){if(DD.escapeTest.test(e))return e.replace(DD.escapeReplace,LO)}else if(DD.escapeTestNoEncode.test(e))return e.replace(DD.escapeReplaceNoEncode,LO);return e}function zO(e){try{e=encodeURI(e).replace(DD.percentDecode,`%`)}catch{return null}return e}function BO(e,t){let n=e.replace(DD.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(DD.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length0?-2:-1}function UO(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function WO(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function GO(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(` +`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(` +`)}var KO=class{options;rules;lexer;constructor(e){this.options=e||SD}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:VO(e,` +`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=GO(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=VO(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:VO(t[0],` +`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=VO(t[0],` +`).split(` +`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=UO(t[2].split(` +`,1)[0],t[1].length),l=e.split(` +`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+` +`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(` +`,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=` +`+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=` +`+l}u=!l.trim(),r+=p+` +`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=BO(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(` +`):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===` +`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=VO(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=HO(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),WO(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return WO(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},qO=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||SD,this.options.tokenizer=this.options.tokenizer||new KO,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:DD,block:PO.normal,inline:FO.normal};this.options.pedantic?(t.block=PO.pedantic,t.inline=FO.pedantic):this.options.gfm&&(t.block=PO.gfm,this.options.breaks?t.inline=FO.breaks:t.inline=FO.gfm),this.tokenizer.rules=t}static get rules(){return{block:PO,inline:FO}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(DD.carriageReturn,` +`),this.blockTokens(e,this.tokens);for(let e=0;e(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=` +`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(` +`)?``:` +`)+r.raw,n.text+=` +`+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(` +`)?``:` +`)+r.raw,n.text+=` +`+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=(a.raw.endsWith(` +`)?``:` +`)+r.raw,a.text+=` +`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(` +`)?``:` +`)+r.raw,n.text+=` +`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},JO=class{options;parser;constructor(e){this.options=e||SD}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(DD.notSpaceStart)?.[0],i=e.replace(DD.endingNewline,``)+` +`;return r?`
`+(n?i:RO(i,!0))+`
+`:`
`+(n?i:RO(i,!0))+`
+`}blockquote({tokens:e}){return`
+${this.parser.parse(e)}
+`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)} +`}hr(e){return`
+`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t +`+r+` +`}listitem(e){return`
  • ${this.parser.parse(e.tokens)}
  • +`}checkbox({checked:e}){return` `}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    +`}table(e){let t=``,n=``;for(let t=0;t${r}`,` + +`+t+` +`+r+`
    +`}tablerow({text:e}){return` +${e} +`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+` +`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${RO(e,!0)}`}br(e){return`
    `}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=zO(e);if(i===null)return r;e=i;let a=`
    `+r+``,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=zO(e);if(i===null)return RO(n);e=i;let a=`${n}`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:RO(e.text)}},YO=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},XO=class e{options;renderer;textRenderer;constructor(e){this.options=e||SD,this.options.renderer=this.options.renderer||new JO,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new YO}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){let t=``;for(let n=0;n{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new JO(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new KO(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new ZO;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];ZO.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&ZO.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return qO.lex(e,t??this.defaults)}parser(e,t){return XO.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?qO.lex:qO.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?XO.parse:XO.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?qO.lex:qO.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?XO.parse:XO.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,e){let e=`

    An error occurred:

    `+RO(n.message+``,!0)+`
    `;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function $O(e,t){return QO.parse(e,t)}$O.options=$O.setOptions=function(e){return QO.setOptions(e),$O.defaults=QO.defaults,CD($O.defaults),$O},$O.getDefaults=xD,$O.defaults=SD,$O.use=function(...e){return QO.use(...e),$O.defaults=QO.defaults,CD($O.defaults),$O},$O.walkTokens=function(e,t){return QO.walkTokens(e,t)},$O.parseInline=QO.parseInline,$O.Parser=XO,$O.parser=XO.parse,$O.Renderer=JO,$O.TextRenderer=YO,$O.Lexer=qO,$O.lexer=qO.lex,$O.Tokenizer=KO,$O.Hooks=ZO,$O.parse=$O,$O.options,$O.setOptions,$O.use,$O.walkTokens,$O.parseInline,XO.parse,qO.lex;var ek=`modulepreload`,tk=function(e){return`/`+e},nk={};const rk=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=tk(t,n),t in nk)return;nk[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:ek,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};var ik=300,ak=`300px`,ok=500;function sk(e={}){let{immediate:t=!1,debounceDelay:n=ik,rootMargin:r=ak,idleTimeout:i=ok}=e,[a,o]=(0,y.useState)(!1),s=(0,y.useRef)(null),c=(0,y.useRef)(null),l=(0,y.useRef)(null),u=(0,y.useMemo)(()=>e=>{let t=Date.now();return window.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))})},1)},[]),d=(0,y.useMemo)(()=>typeof window<`u`&&window.requestIdleCallback?(e,t)=>window.requestIdleCallback(e,t):u,[u]),f=(0,y.useMemo)(()=>typeof window<`u`&&window.cancelIdleCallback?e=>window.cancelIdleCallback(e):e=>{clearTimeout(e)},[]);return(0,y.useEffect)(()=>{if(t){o(!0);return}let e=s.current;if(!e)return;c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null);let a=()=>{c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null)},u=e=>{l.current=d(t=>{t.timeRemaining()>0||t.didTimeout?(o(!0),e.disconnect()):l.current=d(()=>{o(!0),e.disconnect()},{timeout:i/2})},{timeout:i})},p=e=>{a(),c.current=window.setTimeout(()=>{var t;let n=e.takeRecords();(n.length===0||(t=n.at(-1)?.isIntersecting)!=null&&t)&&u(e)},n)},m=(e,t)=>{e.isIntersecting?p(t):a()},h=new IntersectionObserver(e=>{for(let t of e)m(t,h)},{rootMargin:r,threshold:0});return h.observe(e),()=>{c.current&&clearTimeout(c.current),l.current&&f(l.current),h.disconnect()}},[t,n,r,i,f,d]),{shouldRender:a,containerRef:s}}var ck=/\s/,lk=/^\s+$/,uk=new Set([`code`,`pre`,`svg`,`math`,`annotation`]),dk=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`element`,fk=e=>e.some(e=>dk(e)&&uk.has(e.tagName)),pk=e=>{let t=[],n=``,r=!1;for(let i of e){let e=ck.test(i);e!==r&&n&&(t.push(n),n=``),n+=i,r=e}return n&&t.push(n),t},mk=e=>{let t=[],n=``;for(let r of e)ck.test(r)?n+=r:(n&&=(t.push(n),``),t.push(r));return n&&t.push(n),t},hk=(e,t,n,r)=>({type:`element`,tagName:`span`,properties:{"data-sd-animate":!0,style:`--sd-animation:sd-${t};--sd-duration:${n}ms;--sd-easing:${r}`},children:[{type:`text`,value:e}]}),gk=(e,t,n)=>{let r=t.at(-1);if(!(r&&`children`in r))return;if(fk(t))return $l;let i=r,a=i.children.indexOf(e);if(a===-1)return;let o=e.value;if(!o.trim())return;let s=(n.sep===`char`?mk(o):pk(o)).map(e=>lk.test(e)?{type:`text`,value:e}:hk(e,n.animation,n.duration,n.easing));return i.children.splice(a,1,...s),a+s.length};function _k(e){let t={animation:e?.animation??`fadeIn`,duration:e?.duration??150,easing:e?.easing??`ease`,sep:e?.sep??`word`};return{name:`animate`,type:`animate`,rehypePlugin:()=>e=>{eu(e,`text`,(e,n)=>gk(e,n,t))}}}_k();var vk=e=>(0,F.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z`,fill:`currentColor`,fillRule:`evenodd`})}),yk=e=>(0,F.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),bk=e=>(0,F.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),xk=e=>(0,F.jsxs)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:[(0,F.jsx)(`path`,{d:`M8 0V4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M8 16V12`,opacity:`0.5`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M3.29773 1.52783L5.64887 4.7639`,opacity:`0.9`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M12.7023 1.52783L10.3511 4.7639`,opacity:`0.1`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M12.7023 14.472L10.3511 11.236`,opacity:`0.4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M3.29773 14.472L5.64887 11.236`,opacity:`0.6`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M15.6085 5.52783L11.8043 6.7639`,opacity:`0.2`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M0.391602 10.472L4.19583 9.23598`,opacity:`0.7`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M15.6085 10.4722L11.8043 9.2361`,opacity:`0.3`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M0.391602 5.52783L4.19583 6.7639`,opacity:`0.8`,stroke:`currentColor`,strokeWidth:`1.5`})]}),Sk=e=>(0,F.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z`,fill:`currentColor`,fillRule:`evenodd`})}),Ck=e=>(0,F.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z`,fill:`currentColor`,fillRule:`evenodd`})}),wk=e=>(0,F.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z`,fill:`currentColor`,fillRule:`evenodd`})}),Tk=e=>(0,F.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z`,fill:`currentColor`,fillRule:`evenodd`})}),Ek=e=>(0,F.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})}),Dk=e=>(0,F.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})}),Ok=(...e)=>zw(_C(e)),kk=(e,t,n)=>{let r=typeof t==`string`?new Blob([t],{type:n}):t,i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)},Ak=(0,y.createContext)({code:``}),jk=()=>(0,y.useContext)(Ak),Mk=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...o})=>{let[s,c]=(0,y.useState)(!1),l=(0,y.useRef)(0),{code:u}=jk(),{isAnimating:d}=(0,y.useContext)(KA),f=a??u,p=async()=>{var r;if(typeof window>`u`||!((r=navigator==null?void 0:navigator.clipboard)!=null&&r.writeText)){t?.(Error(`Clipboard API not available`));return}try{s||(await navigator.clipboard.writeText(f),c(!0),e?.(),l.current=window.setTimeout(()=>c(!1),n))}catch(e){t?.(e)}};(0,y.useEffect)(()=>()=>{window.clearTimeout(l.current)},[]);let m=s?vk:yk;return(0,F.jsx)(`button`,{className:Ok(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-copy-button`,disabled:d,onClick:p,title:`Copy Code`,type:`button`,...o,children:r??(0,F.jsx)(m,{size:14})})},Nk={"1c":`1c`,"1c-query":`1cq`,abap:`abap`,"actionscript-3":`as`,ada:`ada`,adoc:`adoc`,"angular-html":`html`,"angular-ts":`ts`,apache:`conf`,apex:`cls`,apl:`apl`,applescript:`applescript`,ara:`ara`,asciidoc:`adoc`,asm:`asm`,astro:`astro`,awk:`awk`,ballerina:`bal`,bash:`sh`,bat:`bat`,batch:`bat`,be:`be`,beancount:`beancount`,berry:`berry`,bibtex:`bib`,bicep:`bicep`,blade:`blade.php`,bsl:`bsl`,c:`c`,"c#":`cs`,"c++":`cpp`,cadence:`cdc`,cairo:`cairo`,cdc:`cdc`,clarity:`clar`,clj:`clj`,clojure:`clj`,"closure-templates":`soy`,cmake:`cmake`,cmd:`cmd`,cobol:`cob`,codeowners:`CODEOWNERS`,codeql:`ql`,coffee:`coffee`,coffeescript:`coffee`,"common-lisp":`lisp`,console:`sh`,coq:`v`,cpp:`cpp`,cql:`cql`,crystal:`cr`,cs:`cs`,csharp:`cs`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cql`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,docker:`dockerfile`,dockerfile:`dockerfile`,dotenv:`env`,"dream-maker":`dm`,edge:`edge`,elisp:`el`,elixir:`ex`,elm:`elm`,"emacs-lisp":`el`,erb:`erb`,erl:`erl`,erlang:`erl`,f:`f`,"f#":`fs`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`f90`,f95:`f95`,fennel:`fnl`,fish:`fish`,fluent:`ftl`,for:`for`,"fortran-fixed-form":`f`,"fortran-free-form":`f90`,fs:`fs`,fsharp:`fs`,fsl:`fsl`,ftl:`ftl`,gdresource:`tres`,gdscript:`gd`,gdshader:`gdshader`,genie:`gs`,gherkin:`feature`,"git-commit":`gitcommit`,"git-rebase":`gitrebase`,gjs:`js`,gleam:`gleam`,"glimmer-js":`js`,"glimmer-ts":`ts`,glsl:`glsl`,gnuplot:`plt`,go:`go`,gql:`gql`,graphql:`graphql`,groovy:`groovy`,gts:`gts`,hack:`hack`,haml:`haml`,handlebars:`hbs`,haskell:`hs`,haxe:`hx`,hbs:`hbs`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,hs:`hs`,html:`html`,"html-derivative":`html`,http:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,jade:`jade`,java:`java`,javascript:`js`,jinja:`jinja`,jison:`jison`,jl:`jl`,js:`js`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,julia:`jl`,kotlin:`kt`,kql:`kql`,kt:`kt`,kts:`kts`,kusto:`kql`,latex:`tex`,lean:`lean`,lean4:`lean`,less:`less`,liquid:`liquid`,lisp:`lisp`,lit:`lit`,llvm:`ll`,log:`log`,logo:`logo`,lua:`lua`,luau:`luau`,make:`mak`,makefile:`mak`,markdown:`md`,marko:`marko`,matlab:`m`,md:`md`,mdc:`mdc`,mdx:`mdx`,mediawiki:`wiki`,mermaid:`mmd`,mips:`s`,mipsasm:`s`,mmd:`mmd`,mojo:`mojo`,move:`move`,nar:`nar`,narrat:`narrat`,nextflow:`nf`,nf:`nf`,nginx:`conf`,nim:`nim`,nix:`nix`,nu:`nu`,nushell:`nu`,objc:`m`,"objective-c":`m`,"objective-cpp":`mm`,ocaml:`ml`,pascal:`pas`,perl:`pl`,perl6:`p6`,php:`php`,plsql:`pls`,po:`po`,polar:`polar`,postcss:`pcss`,pot:`pot`,potx:`potx`,powerquery:`pq`,powershell:`ps1`,prisma:`prisma`,prolog:`pl`,properties:`properties`,proto:`proto`,protobuf:`proto`,ps:`ps`,ps1:`ps1`,pug:`pug`,puppet:`pp`,purescript:`purs`,py:`py`,python:`py`,ql:`ql`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,racket:`rkt`,raku:`raku`,razor:`cshtml`,rb:`rb`,reg:`reg`,regex:`regex`,regexp:`regexp`,rel:`rel`,riscv:`s`,rs:`rs`,rst:`rst`,ruby:`rb`,rust:`rs`,sas:`sas`,sass:`sass`,scala:`scala`,scheme:`scm`,scss:`scss`,sdbl:`sdbl`,sh:`sh`,shader:`shader`,shaderlab:`shader`,shell:`sh`,shellscript:`sh`,shellsession:`sh`,smalltalk:`st`,solidity:`sol`,soy:`soy`,sparql:`rq`,spl:`spl`,splunk:`spl`,sql:`sql`,"ssh-config":`config`,stata:`do`,styl:`styl`,stylus:`styl`,svelte:`svelte`,swift:`swift`,"system-verilog":`sv`,systemd:`service`,talon:`talon`,talonscript:`talon`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,terraform:`tf`,tex:`tex`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`ts`,"ts-tags":`ts`,tsp:`tsp`,tsv:`tsv`,tsx:`tsx`,turtle:`ttl`,twig:`twig`,typ:`typ`,typescript:`ts`,typespec:`tsp`,typst:`typ`,v:`v`,vala:`vala`,vb:`vb`,verilog:`v`,vhdl:`vhdl`,vim:`vim`,viml:`vim`,vimscript:`vim`,vue:`vue`,"vue-html":`html`,"vue-vine":`vine`,vy:`vy`,vyper:`vy`,wasm:`wasm`,wenyan:`wy`,wgsl:`wgsl`,wiki:`wiki`,wikitext:`wiki`,wit:`wit`,wl:`wl`,wolfram:`wl`,xml:`xml`,xsl:`xsl`,yaml:`yaml`,yml:`yml`,zenscript:`zs`,zig:`zig`,zsh:`zsh`,文言:`wy`},Uee=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...o})=>{let{code:s}=jk(),{isAnimating:c}=(0,y.useContext)(KA),l=a??s,u=`file.${n&&n in Nk?Nk[n]:`txt`}`,d=()=>{try{kk(u,l,`text/plain`),e?.()}catch(e){t?.(e)}};return(0,F.jsx)(`button`,{className:Ok(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-download-button`,disabled:c,onClick:d,title:`Download file`,type:`button`,...o,children:r??(0,F.jsx)(bk,{size:14})})},Pk=()=>(0,F.jsxs)(`div`,{className:`w-full divide-y divide-border overflow-hidden rounded-xl border border-border`,children:[(0,F.jsx)(`div`,{className:`h-[46px] w-full bg-muted/80`}),(0,F.jsx)(`div`,{className:`flex w-full items-center justify-center p-4`,children:(0,F.jsx)(xk,{className:`size-4 animate-spin`})})]}),Wee=/\.[^/.]+$/,Gee=({node:e,className:t,src:n,alt:r,...i})=>{let a=async()=>{if(n)try{let e=await(await fetch(n)).blob(),t=new URL(n,window.location.origin).pathname.split(`/`).pop()||``,i=t.split(`.`).pop(),a=t.includes(`.`)&&i!==void 0&&i.length<=4,o=``;if(a)o=t;else{let n=e.type,i=`png`;n.includes(`jpeg`)||n.includes(`jpg`)?i=`jpg`:n.includes(`png`)?i=`png`:n.includes(`svg`)?i=`svg`:n.includes(`gif`)?i=`gif`:n.includes(`webp`)&&(i=`webp`),o=`${(r||t||`image`).replace(Wee,``)}.${i}`}kk(o,e,e.type)}catch{window.open(n,`_blank`)}};return n?(0,F.jsxs)(`div`,{className:`group relative my-4 inline-block`,"data-streamdown":`image-wrapper`,children:[(0,F.jsx)(`img`,{alt:r,className:Ok(`max-w-full rounded-lg`,t),"data-streamdown":`image`,src:n,...i}),(0,F.jsx)(`div`,{className:`pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block`}),(0,F.jsx)(`button`,{className:Ok(`absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background`,`opacity-0 group-hover:opacity-100`),onClick:a,title:`Download image`,type:`button`,children:(0,F.jsx)(bk,{size:14})})]}):null},Fk=0,Kee=()=>{Fk+=1,Fk===1&&(document.body.style.overflow=`hidden`)},qee=()=>{Fk=Math.max(0,Fk-1),Fk===0&&(document.body.style.overflow=``)},Jee=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let[i,a]=(0,y.useState)(!1),o=(0,y.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),2e3)}catch{}},[e]),s=(0,y.useCallback)(()=>{r(),n()},[r,n]);return(0,y.useEffect)(()=>{if(t){Kee();let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),qee()}}},[t,n]),t?(0,F.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm`,"data-streamdown":`link-safety-modal`,onClick:n,onKeyDown:e=>{e.key===`Escape`&&n()},role:`button`,tabIndex:0,children:(0,F.jsxs)(`div`,{className:`relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,F.jsx)(`button`,{className:`absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`,onClick:n,title:`Close`,type:`button`,children:(0,F.jsx)(wk,{size:16})}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 font-semibold text-lg`,children:[(0,F.jsx)(Tk,{size:20}),(0,F.jsx)(`span`,{children:`Open external link?`})]}),(0,F.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`You're about to visit an external website.`})]}),(0,F.jsx)(`div`,{className:Ok(`break-all rounded-md bg-muted p-3 font-mono text-sm`,e.length>100&&`max-h-32 overflow-y-auto`),children:e}),(0,F.jsxs)(`div`,{className:`flex gap-2`,children:[(0,F.jsx)(`button`,{className:`flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted`,onClick:o,type:`button`,children:i?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(vk,{size:14}),(0,F.jsx)(`span`,{children:`Copied`})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(yk,{size:14}),(0,F.jsx)(`span`,{children:`Copy link`})]})}),(0,F.jsxs)(`button`,{className:`flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90`,onClick:s,type:`button`,children:[(0,F.jsx)(Tk,{size:14}),(0,F.jsx)(`span`,{children:`Open link`})]})]})]})}):null},Ik=(0,y.createContext)(null),Lk=()=>(0,y.useContext)(Ik),Yee=()=>Lk()?.code??null,Rk=()=>Lk()?.mermaid??null,Xee=(e,t)=>new Promise((t,n)=>{let r=`data:image/svg+xml;base64,`+btoa(unescape(encodeURIComponent(e))),i=new Image;i.crossOrigin=`anonymous`,i.onload=()=>{let e=document.createElement(`canvas`),r=i.width*5,a=i.height*5;e.width=r,e.height=a;let o=e.getContext(`2d`);if(!o){n(Error(`Failed to create 2D canvas context for PNG export`));return}o.drawImage(i,0,0,r,a),e.toBlob(e=>{if(!e){n(Error(`Failed to create PNG blob`));return}t(e)},`image/png`)},i.onerror=()=>n(Error(`Failed to load SVG image`)),i.src=r}),Zee=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let[o,s]=(0,y.useState)(!1),c=(0,y.useRef)(null),{isAnimating:l}=(0,y.useContext)(KA),u=Rk(),d=async t=>{try{if(t===`mmd`){kk(`diagram.mmd`,e,`text/plain`),s(!1),r?.(t);return}if(!u){a?.(Error(`Mermaid plugin not available`));return}let n=u.getMermaid(i),o=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),c=`mermaid-${Math.abs(o)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:l}=await n.render(c,e);if(!l){a?.(Error(`SVG not found. Please wait for the diagram to render.`));return}if(t===`svg`){kk(`diagram.svg`,l,`image/svg+xml`),s(!1),r?.(t);return}if(t===`png`){kk(`diagram.png`,await Xee(l),`image/png`),r?.(t),s(!1);return}}catch(e){a?.(e)}};return(0,y.useEffect)(()=>{let e=e=>{let t=e.composedPath();c.current&&!t.includes(c.current)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,F.jsxs)(`div`,{className:`relative`,ref:c,children:[(0,F.jsx)(`button`,{className:Ok(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),disabled:l,onClick:()=>s(!o),title:`Download diagram`,type:`button`,children:t??(0,F.jsx)(bk,{size:14})}),o?(0,F.jsxs)(`div`,{className:`absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`,children:[(0,F.jsx)(`button`,{className:`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`,onClick:()=>d(`svg`),title:`Download diagram as SVG`,type:`button`,children:`SVG`}),(0,F.jsx)(`button`,{className:`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`,onClick:()=>d(`png`),title:`Download diagram as PNG`,type:`button`,children:`PNG`}),(0,F.jsx)(`button`,{className:`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`,onClick:()=>d(`mmd`),title:`Download diagram as MMD`,type:`button`,children:`MMD`})]}):null]})},zk=0,Qee=()=>{zk+=1,zk===1&&(document.body.style.overflow=`hidden`)},$ee=()=>{zk=Math.max(0,zk-1),zk===0&&(document.body.style.overflow=``)},ete=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let[o,s]=(0,y.useState)(!1),{isAnimating:c,controls:l}=(0,y.useContext)(KA),u=(()=>{if(typeof l==`boolean`)return l;let e=l.mermaid;return e===!1?!1:e===!0||e===void 0?!0:e.panZoom!==!1})(),d=()=>{s(!o)};return(0,y.useEffect)(()=>{if(o){Qee();let e=e=>{e.key===`Escape`&&s(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),$ee()}}},[o]),(0,y.useEffect)(()=>{o?n?.():r&&r()},[o,n,r]),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`button`,{className:Ok(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),disabled:c,onClick:d,title:`View fullscreen`,type:`button`,...a,children:(0,F.jsx)(Sk,{size:14})}),o?(0,F.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm`,onClick:d,onKeyDown:e=>{e.key===`Escape`&&d()},role:`button`,tabIndex:0,children:[(0,F.jsx)(`button`,{className:`absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`,onClick:d,title:`Exit fullscreen`,type:`button`,children:(0,F.jsx)(wk,{size:20})}),(0,F.jsx)(`div`,{className:`flex size-full items-center justify-center p-4`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:(0,F.jsx)(ZA,{chart:e,className:`size-full [&_svg]:h-auto [&_svg]:w-auto`,config:t,fullscreen:!0,showControls:u})})]}):null]})},Bk=e=>{let t=[],n=[],r=e.querySelectorAll(`thead th`);for(let e of r)t.push(e.textContent?.trim()||``);let i=e.querySelectorAll(`tbody tr`);for(let e of i){let t=[],r=e.querySelectorAll(`td`);for(let e of r)t.push(e.textContent?.trim()||``);n.push(t)}return{headers:t,rows:n}},Vk=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1,n=!1;for(let r of e){if(r===`"`){t=!0,n=!0;break}(r===`,`||r===` +`)&&(t=!0)}return t?n?`"${e.replace(/"/g,`""`)}"`:`"${e}"`:e},i=t.length>0?n.length+1:n.length,a=Array(i),o=0;t.length>0&&(a[o]=t.map(r).join(`,`),o+=1);for(let e of n)a[o]=e.map(r).join(`,`),o+=1;return a.join(` +`)},tte=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1;for(let n of e)if(n===` `||n===` +`||n===`\r`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===` `?n.push(`\\t`):t===` +`?n.push(`\\n`):t===`\r`?n.push(`\\r`):n.push(t);return n.join(``)},i=t.length>0?n.length+1:n.length,a=Array(i),o=0;t.length>0&&(a[o]=t.map(r).join(` `),o+=1);for(let e of n)a[o]=e.map(r).join(` `),o+=1;return a.join(` +`)},Hk=e=>{let t=!1;for(let n of e)if(n===`\\`||n===`|`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===`\\`?n.push(`\\\\`):t===`|`?n.push(`\\|`):n.push(t);return n.join(``)},nte=e=>{let{headers:t,rows:n}=e;if(t.length===0)return``;let r=Array(n.length+2),i=0;r[i]=`| ${t.map(e=>Hk(e)).join(` | `)} |`,i+=1;let a=Array(t.length);for(let e=0;eHk(e)).join(` | `)} |`,i+=1;return r.join(` +`)},rte=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(!1),l=(0,y.useRef)(null),u=(0,y.useRef)(0),{isAnimating:d}=(0,y.useContext)(KA),f=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(l.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=Bk(t),s=e===`csv`?Vk(a):tte(a),d=new ClipboardItem({"text/plain":new Blob([s],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([d]),c(!0),o(!1),n?.(e),u.current=window.setTimeout(()=>c(!1),i)}catch(e){r?.(e)}};(0,y.useEffect)(()=>{let e=e=>{let t=e.composedPath();l.current&&!t.includes(l.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(u.current)}},[]);let p=s?vk:yk;return(0,F.jsxs)(`div`,{className:`relative`,ref:l,children:[(0,F.jsx)(`button`,{className:Ok(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:d,onClick:()=>o(!a),title:`Copy table`,type:`button`,children:e??(0,F.jsx)(p,{size:14})}),a?(0,F.jsxs)(`div`,{className:`absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`,children:[(0,F.jsx)(`button`,{className:`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`,onClick:()=>f(`csv`),title:`Copy table as CSV`,type:`button`,children:`CSV`}),(0,F.jsx)(`button`,{className:`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`,onClick:()=>f(`tsv`),title:`Copy table as TSV`,type:`button`,children:`TSV`})]}):null]})},ite=({children:e,className:t,onDownload:n,onError:r})=>{let[i,a]=(0,y.useState)(!1),o=(0,y.useRef)(null),{isAnimating:s}=(0,y.useContext)(KA),c=e=>{try{let t=(o.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=Bk(t),s=e===`csv`?Vk(i):nte(i);kk(`table.${e===`csv`?`csv`:`md`}`,s,e===`csv`?`text/csv`:`text/markdown`),a(!1),n?.(e)}catch(e){r?.(e)}};return(0,y.useEffect)(()=>{let e=e=>{let t=e.composedPath();o.current&&!t.includes(o.current)&&a(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,F.jsxs)(`div`,{className:`relative`,ref:o,children:[(0,F.jsx)(`button`,{className:Ok(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:s,onClick:()=>a(!i),title:`Download table`,type:`button`,children:e??(0,F.jsx)(bk,{size:14})}),i?(0,F.jsxs)(`div`,{className:`absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`,children:[(0,F.jsx)(`button`,{className:`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`,onClick:()=>c(`csv`),title:`Download table as CSV`,type:`button`,children:`CSV`}),(0,F.jsx)(`button`,{className:`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`,onClick:()=>c(`markdown`),title:`Download table as Markdown`,type:`button`,children:`Markdown`})]}):null]})},ate=({children:e,className:t,showControls:n,...r})=>(0,F.jsxs)(`div`,{className:`my-4 flex flex-col space-y-2`,"data-streamdown":`table-wrapper`,children:[n?(0,F.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[(0,F.jsx)(rte,{}),(0,F.jsx)(ite,{})]}):null,(0,F.jsx)(`div`,{className:`overflow-x-auto overscroll-y-auto`,children:(0,F.jsx)(`table`,{className:Ok(`w-full border-collapse border border-border`,t),"data-streamdown":`table`,...r,children:e})})]}),ote=(0,y.lazy)(()=>rk(()=>import(`./code-block-OCS4YCEC-66Q0YcqX.js`),[]).then(e=>({default:e.CodeBlock}))),ste=(0,y.lazy)(()=>rk(()=>import(`./mermaid-NOHMQCX5-xIBRY4WD.js`),[]).then(e=>({default:e.Mermaid}))),cte=/language-([^\s]+)/;function Uk(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===a?.line&&i?.column===a?.column}function Wk(e,t){return e.className===t.className&&Uk(e.node,t.node)}var Gk=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,Kk=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},qk=(0,y.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`ol`,{className:Ok(`list-inside list-decimal whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`ordered-list`,...r,children:e}),(e,t)=>Wk(e,t));qk.displayName=`MarkdownOl`;var Jk=(0,y.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`li`,{className:Ok(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e}),(e,t)=>e.className===t.className&&Uk(e.node,t.node));Jk.displayName=`MarkdownLi`;var Yk=(0,y.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`ul`,{className:Ok(`list-inside list-disc whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`unordered-list`,...r,children:e}),(e,t)=>Wk(e,t));Yk.displayName=`MarkdownUl`;var Xk=(0,y.memo)(({className:e,node:t,...n})=>(0,F.jsx)(`hr`,{className:Ok(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n}),(e,t)=>Wk(e,t));Xk.displayName=`MarkdownHr`;var Zk=(0,y.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`span`,{className:Ok(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e}),(e,t)=>Wk(e,t));Zk.displayName=`MarkdownStrong`;var Qk=(0,y.memo)(({children:e,className:t,href:n,node:r,...i})=>{let{linkSafety:a}=(0,y.useContext)(KA),[o,s]=(0,y.useState)(!1),c=n===`streamdown:incomplete-link`,l=(0,y.useCallback)(async e=>{if(!(!(a!=null&&a.enabled&&n)||c)){if(e.preventDefault(),a.onLinkCheck&&await a.onLinkCheck(n)){window.open(n,`_blank`,`noreferrer`);return}s(!0)}},[a,n,c]),u=(0,y.useCallback)(()=>{n&&window.open(n,`_blank`,`noreferrer`)},[n]),d=(0,y.useCallback)(()=>{s(!1)},[]),f={url:n??``,isOpen:o,onClose:d,onConfirm:u};return a!=null&&a.enabled&&n?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`button`,{className:Ok(`wrap-anywhere appearance-none text-left font-medium text-primary underline`,t),"data-incomplete":c,"data-streamdown":`link`,onClick:l,type:`button`,children:e}),a.renderModal?a.renderModal(f):(0,F.jsx)(Jee,{...f})]}):(0,F.jsx)(`a`,{className:Ok(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":c,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>Wk(e,t)&&e.href===t.href);Qk.displayName=`MarkdownA`;var $k=(0,y.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`h1`,{className:Ok(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e}),(e,t)=>Wk(e,t));$k.displayName=`MarkdownH1`;var eA=(0,y.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`h2`,{className:Ok(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e}),(e,t)=>Wk(e,t));eA.displayName=`MarkdownH2`;var tA=(0,y.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`h3`,{className:Ok(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e}),(e,t)=>Wk(e,t));tA.displayName=`MarkdownH3`;var nA=(0,y.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`h4`,{className:Ok(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e}),(e,t)=>Wk(e,t));nA.displayName=`MarkdownH4`;var rA=(0,y.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`h5`,{className:Ok(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e}),(e,t)=>Wk(e,t));rA.displayName=`MarkdownH5`;var iA=(0,y.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`h6`,{className:Ok(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e}),(e,t)=>Wk(e,t));iA.displayName=`MarkdownH6`;var aA=(0,y.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i}=(0,y.useContext)(KA);return(0,F.jsx)(ate,{className:t,showControls:Gk(i,`table`),...r,children:e})},(e,t)=>Wk(e,t));aA.displayName=`MarkdownTable`;var oA=(0,y.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`thead`,{className:Ok(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e}),(e,t)=>Wk(e,t));oA.displayName=`MarkdownThead`;var sA=(0,y.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`tbody`,{className:Ok(`divide-y divide-border bg-muted/40`,t),"data-streamdown":`table-body`,...r,children:e}),(e,t)=>Wk(e,t));sA.displayName=`MarkdownTbody`;var cA=(0,y.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`tr`,{className:Ok(`border-border border-b`,t),"data-streamdown":`table-row`,...r,children:e}),(e,t)=>Wk(e,t));cA.displayName=`MarkdownTr`;var lA=(0,y.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`th`,{className:Ok(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e}),(e,t)=>Wk(e,t));lA.displayName=`MarkdownTh`;var uA=(0,y.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`td`,{className:Ok(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e}),(e,t)=>Wk(e,t));uA.displayName=`MarkdownTd`;var dA=(0,y.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`blockquote`,{className:Ok(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e}),(e,t)=>Wk(e,t));dA.displayName=`MarkdownBlockquote`;var fA=(0,y.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`sup`,{className:Ok(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e}),(e,t)=>Wk(e,t));fA.displayName=`MarkdownSup`;var pA=(0,y.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`sub`,{className:Ok(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e}),(e,t)=>Wk(e,t));pA.displayName=`MarkdownSub`;var mA=(0,y.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,y.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,y.isValidElement)(e))if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,y.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,y.isValidElement)(e))return e;if(e.type===qk){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,F.jsx)(`section`,{className:t,...r,children:i}):null}return(0,F.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>Wk(e,t));mA.displayName=`MarkdownSection`;var hA=(0,y.memo)(({node:e,className:t,children:n,...r})=>{let i=!(`data-block`in r),{mermaid:a,controls:o}=(0,y.useContext)(KA),s=Rk();if(i)return(0,F.jsx)(`code`,{className:Ok(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let c=(t?.match(cte))?.at(1)??``,l=``;if((0,y.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?l=n.props.children:typeof n==`string`&&(l=n),c===`mermaid`&&s){let e=Gk(o,`mermaid`),n=Kk(o,`download`),r=Kk(o,`copy`),i=Kk(o,`fullscreen`),s=Kk(o,`panZoom`),c=e&&(n||r||i);return(0,F.jsx)(y.Suspense,{fallback:(0,F.jsx)(Pk,{}),children:(0,F.jsxs)(`div`,{className:Ok(`group relative my-4 h-auto rounded-xl border p-4`,t),"data-streamdown":`mermaid-block`,children:[c?(0,F.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[n?(0,F.jsx)(Zee,{chart:l,config:a?.config}):null,r?(0,F.jsx)(Mk,{code:l}):null,i?(0,F.jsx)(ete,{chart:l,config:a?.config}):null]}):null,(0,F.jsx)(ste,{chart:l,config:a?.config,showControls:s})]})})}let u=Gk(o,`code`);return(0,F.jsx)(y.Suspense,{fallback:(0,F.jsx)(Pk,{}),children:(0,F.jsx)(ote,{className:Ok(`overflow-x-auto border-border border-t`,t),code:l,language:c,children:u?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Uee,{code:l,language:c}),(0,F.jsx)(Mk,{})]}):null})})},(e,t)=>e.className===t.className&&Uk(e.node,t.node));hA.displayName=`MarkdownCode`;var gA=(0,y.memo)(Gee,(e,t)=>e.className===t.className&&Uk(e.node,t.node));gA.displayName=`MarkdownImg`;var _A=(0,y.memo)(({children:e,className:t,node:n,...r})=>{let i=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);if(i.length===1&&(0,y.isValidElement)(i[0])){let t=i[0].props.node?.tagName;if(t===`img`||t===`code`&&`data-block`in i[0].props)return(0,F.jsx)(F.Fragment,{children:e})}return(0,F.jsx)(`p`,{className:t,...r,children:e})},(e,t)=>Wk(e,t));_A.displayName=`MarkdownParagraph`;var vA={ol:qk,li:Jk,ul:Yk,hr:Xk,strong:Zk,a:Qk,h1:$k,h2:eA,h3:tA,h4:nA,h5:rA,h6:iA,table:aA,thead:oA,tbody:sA,tr:cA,th:lA,td:uA,blockquote:dA,code:hA,img:gA,pre:({children:e})=>(0,y.isValidElement)(e)?(0,y.cloneElement)(e,{"data-block":`true`}):e,sup:fA,sub:pA,p:_A,section:mA},yA=()=>e=>{nu(e,`html`,(e,t,n)=>{!n||typeof t!=`number`||(n.children[t]={type:`text`,value:e.value})})},bA=[],xA={allowDangerousHtml:!0},SA=new WeakMap,CA=new class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let t=`default`;return this.keyCache.set(e,t),t}let a=e=>{if(!e||e.length===0)return``;let t=``;for(let n=0;n0&&(t+=`,`),Array.isArray(r)){let[e,n]=r;if(typeof e==`function`){let n=SA.get(e);n||(n=e.name,SA.set(e,n)),t+=n}else t+=String(e);t+=`:`,t+=JSON.stringify(n)}else if(typeof r==`function`){let e=SA.get(r);e||(e=r.name,SA.set(r,e)),t+=e}else t+=String(r)}return t},o=a(n),s=`${a(r)}::${o}::${i?JSON.stringify(i):``}`;return this.keyCache.set(e,s),s}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let e=this.cache.keys().next().value;e&&this.cache.delete(e)}this.cache.set(n,t)}clear(){this.cache.clear()}},wA=e=>{let t=TA(e),n=e.children||``;return MA(t.runSync(t.parse(n),n),e)},TA=e=>{let t=CA.get(e);if(t)return t;let n=DA(e);return CA.set(e,n),n},EA=e=>e.some(e=>Array.isArray(e)?e[0]===bg:e===bg),DA=e=>{let t=e.rehypePlugins||bA,n=e.remarkPlugins||bA,r=EA(t)?n:[...n,yA],i=e.remarkRehypeOptions?{...xA,...e.remarkRehypeOptions}:xA;return dD().use(eE).use(r).use(HE,i).use(t)},OA=e=>e,kA=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:`text`,value:r}},AA=(e,t)=>{for(let n in jT)if(Object.hasOwn(jT,n)&&Object.hasOwn(e.properties,n)){let r=e.properties[n],i=jT[n];(i===null||i.includes(e.tagName))&&(e.properties[n]=t(String(r||``),n,e)??void 0)}},jA=(e,t,n,r,i,a)=>{let o=!1;return r?o=!r.includes(e.tagName):i&&(o=i.includes(e.tagName)),!o&&a&&typeof t==`number`&&(o=!a(e,t,n)),o},MA=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:a,unwrapDisallowed:o,urlTransform:s}=t;if(n||r||i||a||s){let t=s||OA;nu(e,(e,s,c)=>{if(e.type===`raw`&&c&&typeof s==`number`)return kA(c,s,a,e.value),s;if(e.type===`element`&&(AA(e,t),jA(e,s,c,r,i,n)&&c&&typeof s==`number`))return o&&e.children?c.children.splice(s,1,...e.children):c.children.splice(s,1),s})}return lT(e,{Fragment:F.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:F.jsx,jsxs:F.jsxs,passKeys:!0,passNode:!0})},NA=/\[\^[\w-]{1,200}\](?!:)/,PA=/\[\^[\w-]{1,200}\]:/,FA=/<\/(\w+)>/,IA=/<(\w+)[\s>]/,LA=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),RA=e=>{let t=0;for(let n=0;n{let t=NA.test(e),n=PA.test(e);if(t||n)return[e];let r=qO.lex(e,{gfm:!0}),i=[],a=[],o=!1;for(let e of r){let t=e.raw,n=i.length;if(a.length>0){if(i[n-1]+=t,e.type===`html`){let e=t.match(FA);if(e){let t=e[1];a.at(-1)===t&&a.pop()}}continue}if(e.type===`html`&&e.block){let e=t.match(IA);if(e){let n=e[1];t.includes(``)||LA.has(n.toLowerCase())||a.push(n)}}if(n>0&&!o){let e=i[n-1];if(RA(e)%2==1){i[n-1]=e+t;continue}}i.push(t),e.type!==`space`&&(o=e.type===`code`)}return i},BA={...Sg,protocols:{...Sg.protocols,href:[...Sg.protocols?.href??[],`tel`]}},VA={raw:bg,sanitize:[zg,BA],harden:[ru,{allowedImagePrefixes:[`*`],allowedLinkPrefixes:[`*`],allowedProtocols:[`*`],defaultOrigin:void 0,allowDataImages:!0}]},HA={gfm:[Hx,{}]},UA=Object.values(VA),WA=Object.values(HA),GA={block:` ▋`,circle:` ●`},KA=(0,y.createContext)({shikiTheme:[`github-light`,`github-dark`],controls:!0,isAnimating:!1,mode:`streaming`,mermaid:void 0,linkSafety:{enabled:!0}}),qA=(0,y.memo)(({content:e,shouldParseIncompleteMarkdown:t,index:n,...r})=>(0,F.jsx)(wA,{...r,children:e}),(e,t)=>{if(e.content!==t.content||e.index!==t.index)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(n=>e.components?.[n]!==t.components?.[n]))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});qA.displayName=`Block`;var JA=[`github-light`,`github-dark`],YA=(0,y.memo)(({children:e,mode:t=`streaming`,parseIncompleteMarkdown:n=!0,components:r,rehypePlugins:i=UA,remarkPlugins:a=WA,className:o,shikiTheme:s=JA,mermaid:c,controls:l=!0,isAnimating:u=!1,animated:d,BlockComponent:f=qA,parseMarkdownIntoBlocksFn:p=zA,caret:m,plugins:h,remend:g,linkSafety:_={enabled:!0},allowedTags:v,...b})=>{let x=(0,y.useId)(),[S,C]=(0,y.useTransition)(),w=(0,y.useMemo)(()=>typeof e==`string`?t===`streaming`&&n?hC(e,g):e:``,[e,t,n,g]),T=(0,y.useMemo)(()=>p(w),[w,p]),[E,D]=(0,y.useState)(T);(0,y.useEffect)(()=>{t===`streaming`?C(()=>{D(T)}):D(T)},[T,t]);let O=t===`streaming`?E:T,k=(0,y.useMemo)(()=>O.map((e,t)=>`${x}-${t}`),[O.length,x]),A=(0,y.useMemo)(()=>d?d===!0?_k():_k(d):null,[d]),ee=(0,y.useMemo)(()=>({shikiTheme:(h?.code)?.getThemes()??s,controls:l,isAnimating:u,mode:t,mermaid:c,linkSafety:_}),[s,l,u,t,c,_,h?.code]),te=(0,y.useMemo)(()=>({...vA,...r}),[r]),ne=(0,y.useMemo)(()=>{let e=[];return h!=null&&h.cjk&&(e=[...e,...h.cjk.remarkPluginsBefore]),e=[...e,...a],h!=null&&h.cjk&&(e=[...e,...h.cjk.remarkPluginsAfter]),h!=null&&h.math&&(e=[...e,h.math.remarkPlugin]),e},[a,h?.math,h?.cjk]),j=(0,y.useMemo)(()=>{let e=i;if(v&&Object.keys(v).length>0&&i===UA){let t={...BA,tagNames:[...BA.tagNames??[],...Object.keys(v)],attributes:{...BA.attributes,...v}};e=[VA.raw,[zg,t],VA.harden]}return h!=null&&h.math&&(e=[...e,h.math.rehypePlugin]),A&&u&&(e=[...e,A.rehypePlugin]),e},[i,h?.math,A,u,v]),re=(0,y.useMemo)(()=>m&&u?{"--streamdown-caret":`"${GA[m]}"`}:void 0,[m,u]);return t===`static`?(0,F.jsx)(Ik.Provider,{value:h??null,children:(0,F.jsx)(KA.Provider,{value:ee,children:(0,F.jsx)(`div`,{className:Ok(`space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0`,o),children:(0,F.jsx)(wA,{components:te,rehypePlugins:j,remarkPlugins:ne,...b,children:e})})})}):(0,F.jsx)(Ik.Provider,{value:h??null,children:(0,F.jsx)(KA.Provider,{value:ee,children:(0,F.jsxs)(`div`,{className:Ok(`space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0`,m?`*:last:after:inline *:last:after:align-baseline *:last:after:content-[var(--streamdown-caret)]`:null,o),style:re,children:[O.length===0&&m&&u&&(0,F.jsx)(`span`,{}),O.map((e,t)=>(0,F.jsx)(f,{components:te,content:e,index:t,rehypePlugins:j,remarkPlugins:ne,shouldParseIncompleteMarkdown:n,...b},k[t]))]})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety);YA.displayName=`Streamdown`;var XA=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:a=!0,initialZoom:o=1,fullscreen:s=!1})=>{let c=(0,y.useRef)(null),l=(0,y.useRef)(null),[u,d]=(0,y.useState)(o),[f,p]=(0,y.useState)({x:0,y:0}),[m,h]=(0,y.useState)(!1),[g,_]=(0,y.useState)({x:0,y:0}),[v,b]=(0,y.useState)({x:0,y:0}),x=(0,y.useCallback)(e=>{d(t=>Math.max(n,Math.min(r,t+e)))},[n,r]),S=(0,y.useCallback)(()=>{x(i)},[x,i]),C=(0,y.useCallback)(()=>{x(-i)},[x,i]),w=(0,y.useCallback)(()=>{d(o),p({x:0,y:0})},[o]),T=(0,y.useCallback)(e=>{e.preventDefault(),x(e.deltaY>0?-i:i)},[x,i]),E=(0,y.useCallback)(e=>{if(e.button!==0||e.isPrimary===!1)return;h(!0),_({x:e.clientX,y:e.clientY}),b(f);let t=e.currentTarget;t instanceof HTMLElement&&t.setPointerCapture(e.pointerId)},[f]),D=(0,y.useCallback)(e=>{if(!m)return;e.preventDefault();let t=e.clientX-g.x,n=e.clientY-g.y;p({x:v.x+t,y:v.y+n})},[m,g,v]),O=(0,y.useCallback)(e=>{h(!1);let t=e.currentTarget;t instanceof HTMLElement&&t.releasePointerCapture(e.pointerId)},[]);return(0,y.useEffect)(()=>{let e=c.current;if(e)return e.addEventListener(`wheel`,T,{passive:!1}),()=>{e.removeEventListener(`wheel`,T)}},[T]),(0,y.useEffect)(()=>{let e=l.current;if(e&&m)return document.body.style.userSelect=`none`,e.addEventListener(`pointermove`,D,{passive:!1}),e.addEventListener(`pointerup`,O),e.addEventListener(`pointercancel`,O),()=>{document.body.style.userSelect=``,e.removeEventListener(`pointermove`,D),e.removeEventListener(`pointerup`,O),e.removeEventListener(`pointercancel`,O)}},[m,D,O]),(0,F.jsxs)(`div`,{className:Ok(`relative flex flex-col`,s?`h-full w-full`:`min-h-28 w-full`,t),ref:c,style:{cursor:m?`grabbing`:`grab`},children:[a?(0,F.jsxs)(`div`,{className:Ok(`absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/90 p-1 shadow-sm backdrop-blur-sm`,s?`bottom-4 left-4`:`bottom-2 left-2`),children:[(0,F.jsx)(`button`,{className:`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,disabled:u>=r,onClick:S,title:`Zoom in`,type:`button`,children:(0,F.jsx)(Ek,{size:16})}),(0,F.jsx)(`button`,{className:`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,disabled:u<=n,onClick:C,title:`Zoom out`,type:`button`,children:(0,F.jsx)(Dk,{size:16})}),(0,F.jsx)(`button`,{className:`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,onClick:w,title:`Reset zoom and pan`,type:`button`,children:(0,F.jsx)(Ck,{size:16})})]}):null,(0,F.jsx)(`div`,{className:Ok(`flex-1 origin-center transition-transform duration-150 ease-out`,s?`flex h-full w-full items-center justify-center`:`flex w-full items-center justify-center`),onPointerDown:E,ref:l,role:`application`,style:{transform:`translate(${f.x}px, ${f.y}px) scale(${u})`,transformOrigin:`center center`,touchAction:`none`,willChange:`transform`},children:e})]})},ZA=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(``),[d,f]=(0,y.useState)(``),[p,m]=(0,y.useState)(0),{mermaid:h}=(0,y.useContext)(KA),g=Rk(),_=h?.errorComponent,{shouldRender:v,containerRef:b}=sk({immediate:r});if((0,y.useEffect)(()=>{if(v){if(!g){o(`Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.`);return}(async()=>{try{o(null),c(!0);let t=g.getMermaid(n),r=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),i=`mermaid-${Math.abs(r)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:a}=await t.render(i,e);u(a),f(a)}catch(e){d||l||o(e instanceof Error?e.message:`Failed to render Mermaid chart`)}finally{c(!1)}})()}},[e,n,p,v,g]),!(v||l||d))return(0,F.jsx)(`div`,{className:Ok(`my-4 min-h-[200px]`,t),ref:b});if(s&&!l&&!d)return(0,F.jsx)(`div`,{className:Ok(`my-4 flex justify-center p-4`,t),ref:b,children:(0,F.jsxs)(`div`,{className:`flex items-center space-x-2 text-muted-foreground`,children:[(0,F.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-current border-b-2`}),(0,F.jsx)(`span`,{className:`text-sm`,children:`Loading diagram...`})]})});if(a&&!l&&!d)return _?(0,F.jsx)(`div`,{ref:b,children:(0,F.jsx)(_,{chart:e,error:a,retry:()=>m(e=>e+1)})}):(0,F.jsxs)(`div`,{className:Ok(`rounded-lg border border-red-200 bg-red-50 p-4`,t),ref:b,children:[(0,F.jsxs)(`p`,{className:`font-mono text-red-700 text-sm`,children:[`Mermaid Error: `,a]}),(0,F.jsxs)(`details`,{className:`mt-2`,children:[(0,F.jsx)(`summary`,{className:`cursor-pointer text-red-600 text-xs`,children:`Show Code`}),(0,F.jsx)(`pre`,{className:`mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs`,children:e})]})]});let x=l||d;return(0,F.jsx)(`div`,{className:Ok(`size-full`,t),"data-streamdown":`mermaid`,ref:b,children:(0,F.jsx)(XA,{className:Ok(r?`size-full overflow-hidden`:`my-4 overflow-hidden`,t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:(0,F.jsx)(`div`,{"aria-label":`Mermaid chart`,className:Ok(`flex justify-center`,r?`size-full items-center`:null),dangerouslySetInnerHTML:{__html:x},role:`img`})})})};function QA(e,t){return $A(e,t||{})||{type:`root`,children:[]}}function $A(e,t){let n=ej(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function ej(e,t){switch(e.nodeType){case 1:return aj(e,t);case 3:return rj(e);case 8:return ij(e);case 9:return tj(e,t);case 10:return nj();case 11:return tj(e,t);default:return}}function tj(e,t){return{type:`root`,children:oj(e,t)}}function nj(){return{type:`doctype`}}function rj(e){return{type:`text`,value:e.nodeValue||``}}function ij(e){return{type:`comment`,value:e.nodeValue||``}}function aj(e,t){let n=e.namespaceURI,r=n===xd.svg?vd:_d,i=n===xd.html?e.tagName.toLowerCase():e.tagName,a=n===xd.html&&i===`template`?e.content:e,o=e.getAttributeNames(),s={},c=-1;for(;++cl&&(l=e):e&&(l!==void 0&&l>-1&&c.push(` +`.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function Ej(e,t,n){return e.type===`element`?Dj(e,t,n):e.type===`text`?n.whitespace===`normal`?Oj(e,n):kj(e):[]}function Dj(e,t,n){let r=jj(e,n),i=e.children||[],a=-1,o=[];if(Cj(e))return o;let s,c;for(yj(e)||Sj(e)&&uj(t,e,Sj)?c=` +`:xj(e)?(s=2,c=2):wj(e)&&(s=1,c=1);++a15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15":`>`,"<":`<`,'"':`"`,"'":`'`},Hj=/[&><"']/g;function Uj(e){return String(e).replace(Hj,e=>Vj[e])}var Wj=function e(t){return t.type===`ordgroup`||t.type===`color`?t.body.length===1?e(t.body[0]):t:t.type===`font`?e(t.body):t},Gj=function(e){var t=Wj(e);return t.type===`mathord`||t.type===`textord`||t.type===`atom`},Kj=function(e){if(!e)throw Error(`Expected non-null, but got `+String(e));return e},qj={deflt:Rj,escape:Uj,hyphenate:Bj,getBaseElem:Wj,isCharacterBox:Gj,protocolFromUrl:function(e){var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`}},Jj={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format `},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color `,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro `,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness `,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size `,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand `,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function Yj(e){if(e.default)return e.default;var t=e.type,n=Array.isArray(t)?t[0]:t;if(typeof n!=`string`)return n.enum[0];switch(n){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{}}}var Xj=class{constructor(e){for(var t in this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={},Jj)if(Jj.hasOwnProperty(t)){var n=Jj[t];this[t]=e[t]===void 0?Yj(n):n.processor?n.processor(e[t]):e[t]}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),!(!r||r===`ignore`)){if(r===!0||r===`error`)throw new Lj(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(e.url&&!e.protocol){var t=qj.protocolFromUrl(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},Zj=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return oM[sM[this.id]]}sub(){return oM[cM[this.id]]}fracNum(){return oM[lM[this.id]]}fracDen(){return oM[uM[this.id]]}cramp(){return oM[dM[this.id]]}text(){return oM[fM[this.id]]}isTight(){return this.size>=2}},Qj=0,$j=1,eM=2,tM=3,nM=4,rM=5,iM=6,aM=7,oM=[new Zj(Qj,0,!1),new Zj($j,0,!0),new Zj(eM,1,!1),new Zj(tM,1,!0),new Zj(nM,2,!1),new Zj(rM,2,!0),new Zj(iM,3,!1),new Zj(aM,3,!0)],sM=[nM,rM,nM,rM,iM,aM,iM,aM],cM=[rM,rM,rM,rM,aM,aM,aM,aM],lM=[eM,tM,nM,rM,iM,aM,iM,aM],uM=[tM,tM,rM,rM,aM,aM,aM,aM],dM=[$j,$j,tM,tM,rM,rM,aM,aM],fM=[Qj,$j,eM,tM,eM,tM,eM,tM],pM={DISPLAY:oM[Qj],TEXT:oM[eM],SCRIPT:oM[nM],SCRIPTSCRIPT:oM[iM]},mM=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function hM(e){for(var t=0;t=i[0]&&e<=i[1])return n.name}return null}var gM=[];mM.forEach(e=>e.blocks.forEach(e=>gM.push(...e)));function _M(e){for(var t=0;t=gM[t]&&e<=gM[t+1])return!0;return!1}var vM=80,yM=function(e,t){return`M95,`+(622+e+t)+` +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l`+e/2.075+` -`+e+` +c5.3,-9.3,12,-14,20,-14 +H400000v`+(40+e)+`H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M`+(834+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},bM=function(e,t){return`M263,`+(601+e+t)+`c0.7,0,18,39.7,52,119 +c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 +c340,-704.7,510.7,-1060.3,512,-1067 +l`+e/2.084+` -`+e+` +c4.7,-7.3,11,-11,19,-11 +H40000v`+(40+e)+`H1012.3 +s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232 +c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 +s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 +c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z +M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},xM=function(e,t){return`M983 `+(10+e+t)+` +l`+e/3.13+` -`+e+` +c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+` +H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 +s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744 +c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 +c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 +c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 +c53.7,-170.3,84.5,-266.8,92.5,-289.5z +M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},SM=function(e,t){return`M424,`+(2398+e+t)+` +c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 +c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 +s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 +s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081 +l`+e/4.223+` -`+e+`c4,-6.7,10,-10,18,-10 H400000 +v`+(40+e)+`H1014.6 +s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 +c-2,6,-10,9,-24,9 +c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+` `+t+` +h400000v`+(40+e)+`h-400000z`},CM=function(e,t){return`M473,`+(2713+e+t)+` +c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+` -`+e+` +c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7 +s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 +c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 +c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 +s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, +606zM`+(1001+e)+` `+t+`h400000v`+(40+e)+`H1017.7z`},wM=function(e){var t=e/2;return`M400000 `+e+` H0 L`+t+` 0 l65 45 L145 `+(e-80)+` H400000z`},TM=function(e,t,n){var r=n-54-t-e;return`M702 `+(e+t)+`H400000`+(40+e)+` +H742v`+r+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 +h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 +c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 +219 661 l218 661zM702 `+t+`H400000v`+(40+e)+`H742z`},EM=function(e,t,n){t=1e3*t;var r=``;switch(e){case`sqrtMain`:r=yM(t,vM);break;case`sqrtSize1`:r=bM(t,vM);break;case`sqrtSize2`:r=xM(t,vM);break;case`sqrtSize3`:r=SM(t,vM);break;case`sqrtSize4`:r=CM(t,vM);break;case`sqrtTall`:r=TM(t,vM,n)}return r},DM=function(e,t){switch(e){case`⎜`:return`M291 0 H417 V`+t+` H291z M291 0 H417 V`+t+` H291z`;case`∣`:return`M145 0 H188 V`+t+` H145z M145 0 H188 V`+t+` H145z`;case`∥`:return`M145 0 H188 V`+t+` H145z M145 0 H188 V`+t+` H145z`+(`M367 0 H410 V`+t+` H367z M367 0 H410 V`+t+` H367z`);case`⎟`:return`M457 0 H583 V`+t+` H457z M457 0 H583 V`+t+` H457z`;case`⎢`:return`M319 0 H403 V`+t+` H319z M319 0 H403 V`+t+` H319z`;case`⎥`:return`M263 0 H347 V`+t+` H263z M263 0 H347 V`+t+` H263z`;case`⎪`:return`M384 0 H504 V`+t+` H384z M384 0 H504 V`+t+` H384z`;case`⏐`:return`M312 0 H355 V`+t+` H312z M312 0 H355 V`+t+` H312z`;case`‖`:return`M257 0 H300 V`+t+` H257z M257 0 H300 V`+t+` H257z`+(`M478 0 H521 V`+t+` H478z M478 0 H521 V`+t+` H478z`);default:return``}},OM={doubleleftarrow:`M262 157 +l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 + 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 + 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 +c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5 + 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87 +-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7 +-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z +m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l +-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5 + 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88 +-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68 +-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18 +-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782 +c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3 +-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120 + 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8 +-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247 +c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208 + 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3 + 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202 + l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117 +-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7 + 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13 + 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688 + 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7 +-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80 +H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0 + 435 0h399565z`,leftgroupunder:`M400000 262 +H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219 + 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3 +-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5 +-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7 +-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5 + 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3 +-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7 +-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z +m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333 + 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5 + 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667 +-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12 + 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7 +-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0 +v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 +-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 +-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 + 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z +M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z +M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 +-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 +c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 + 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z +M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334 +c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 +-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 + 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 + 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214 +c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14 + 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3 + 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0 +-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6 +-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z +m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8 +60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8 +-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z +m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2 +c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6 +-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z +m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0 +85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8 +-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z +m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1 +c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128 +-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 + 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 + 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85 +-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 +-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 + 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l +-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5 +s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1 +c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3 + 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237 +-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0 + 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18 + 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3 +-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2 +-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 + 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11 +-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7 + 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z +m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8 + 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5 +-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95 +-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8 + 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 + 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3 +-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z +m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 + 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 +-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 + 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z +M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 + 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 +-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 +-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 + 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69 +-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3 +-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19 +-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101 + 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167 +c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 + 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42 + 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333 +-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70 + 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7 +-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0 + 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0 + 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128 +-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418 +-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9 + 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114 +c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751 + 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457 +-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0 + 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697 + 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696 + -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345 +-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409 + 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9 + 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409 + -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5 +3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11 +10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63 +-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1 +-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59 +H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359 +c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22 +c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1, +-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202 +c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5 +c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130 +s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47 +121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6 +s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11 +c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z +M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32 +-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0 +13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39 +-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5 +-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 +-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 +151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 +c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17 +c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21 +c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40 +c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z +M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0 +c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, +-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 +c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z +M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 +c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9, +1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7, +-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z +M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0 +c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, +-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 +c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},kM=function(e,t){switch(e){case`lbrack`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v1759 h347 v-84 +H403z M403 1759 V0 H319 V1759 v`+t+` v1759 h84z`;case`rbrack`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v1759 H0 v84 H347z +M347 1759 V0 H263 V1759 v`+t+` v1759 h84z`;case`vert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z`;case`doublevert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z +M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+` v585 h43z`;case`lfloor`:return`M319 602 V0 H403 V602 v`+t+` v1715 h263 v84 H319z +MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`rfloor`:return`M319 602 V0 H403 V602 v`+t+` v1799 H0 v-84 H319z +MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`lceil`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v602 h84z +M403 1759 V0 H319 V1759 v`+t+` v602 h84z`;case`rceil`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v602 h84z +M347 1759 V0 h-84 V1759 v`+t+` v602 h84z`;case`lparen`:return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1 +c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349, +-36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210, +949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9 +c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5, +-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189 +l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3, +-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case`rparen`:return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3, +63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5 +c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+` +c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664 +c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11 +c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 +c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 +l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, +-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw Error(`Unknown stretchy delimiter.`)}},AM=class{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;te.toText()).join(``)}},jM={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},MM={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},NM={Å:`A`,Ð:`D`,Þ:`o`,å:`a`,ð:`d`,þ:`o`,А:`A`,Б:`B`,В:`B`,Г:`F`,Д:`A`,Е:`E`,Ж:`K`,З:`3`,И:`N`,Й:`N`,К:`K`,Л:`N`,М:`M`,Н:`H`,О:`O`,П:`N`,Р:`P`,С:`C`,Т:`T`,У:`y`,Ф:`O`,Х:`X`,Ц:`U`,Ч:`h`,Ш:`W`,Щ:`W`,Ъ:`B`,Ы:`X`,Ь:`B`,Э:`3`,Ю:`X`,Я:`R`,а:`a`,б:`b`,в:`a`,г:`r`,д:`y`,е:`e`,ж:`m`,з:`e`,и:`n`,й:`n`,к:`n`,л:`n`,м:`m`,н:`n`,о:`o`,п:`n`,р:`p`,с:`c`,т:`o`,у:`y`,ф:`b`,х:`x`,ц:`n`,ч:`n`,ш:`w`,щ:`w`,ъ:`a`,ы:`m`,ь:`a`,э:`e`,ю:`m`,я:`r`};function PM(e,t){jM[e]=t}function FM(e,t,n){if(!jM[t])throw Error(`Font metrics not found for font: `+t+`.`);var r=e.charCodeAt(0),i=jM[t][r];if(!i&&e[0]in NM&&(r=NM[e[0]].charCodeAt(0),i=jM[t][r]),!i&&n===`text`&&_M(r)&&(i=jM[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var IM={};function LM(e){var t=e>=5?0:e>=3?1:2;if(!IM[t]){var n=IM[t]={cssEmPerMu:MM.quad[t]/18};for(var r in MM)MM.hasOwnProperty(r)&&(n[r]=MM[r][t])}return IM[t]}var RM=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],zM=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],BM=function(e,t){return t.size<2?e:RM[e-1][t.size-1]},VM=class e{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||e.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||``,this.fontFamily=t.fontFamily||``,this.fontWeight=t.fontWeight||``,this.fontShape=t.fontShape||``,this.sizeMultiplier=zM[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return new e(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:BM(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:zM[e-1]})}havingBaseStyle(t){t||=this.style.text();var n=BM(e.BASESIZE,t);return this.size===n&&this.textSize===e.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:``})}withTextFontWeight(e){return this.extend({fontWeight:e,font:``})}withTextFontShape(e){return this.extend({fontShape:e,font:``})}sizingClasses(e){return e.size===this.size?[]:[`sizing`,`reset-size`+e.size,`size`+this.size]}baseSizingClasses(){return this.size===e.BASESIZE?[]:[`sizing`,`reset-size`+this.size,`size`+e.BASESIZE]}fontMetrics(){return this._fontMetrics||=LM(this.size),this._fontMetrics}getColor(){return this.phantom?`transparent`:this.color}};VM.BASESIZE=6;var HM={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},UM={ex:!0,em:!0,mu:!0},WM=function(e){return typeof e!=`string`&&(e=e.unit),e in HM||e in UM||e===`ex`},GM=function(e,t){var n;if(e.unit in HM)n=HM[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit===`mu`)n=t.fontMetrics().cssEmPerMu;else{var r=t.style.isTight()?t.havingStyle(t.style.text()):t;if(e.unit===`ex`)n=r.fontMetrics().xHeight;else if(e.unit===`em`)n=r.fontMetrics().quad;else throw new Lj(`Invalid unit: '`+e.unit+`'`);r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},KM=function(e){return+e.toFixed(4)+`em`},qM=function(e){return e.filter(e=>e).join(` `)},JM=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push(`mtight`);var r=t.getColor();r&&(this.style.color=r)}},YM=function(e){var t=document.createElement(e);for(var n in t.className=qM(this.classes),this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);for(var r in this.attributes)this.attributes.hasOwnProperty(r)&&t.setAttribute(r,this.attributes[r]);for(var i=0;i/=\x00-\x1f]/,ZM=function(e){var t=`<`+e;this.classes.length&&(t+=` class="`+qj.escape(qM(this.classes))+`"`);var n=``;for(var r in this.style)this.style.hasOwnProperty(r)&&(n+=qj.hyphenate(r)+`:`+this.style[r]+`;`);for(var i in n&&(t+=` style="`+qj.escape(n)+`"`),this.attributes)if(this.attributes.hasOwnProperty(i)){if(XM.test(i))throw new Lj(`Invalid attribute name '`+i+`'`);t+=` `+i+`="`+qj.escape(this.attributes[i])+`"`}t+=`>`;for(var a=0;a`,t},QM=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,JM.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return YM.call(this,`span`)}toMarkup(){return ZM.call(this,`span`)}},$M=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,JM.call(this,t,r),this.children=n||[],this.setAttribute(`href`,e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return YM.call(this,`a`)}toMarkup(){return ZM.call(this,`a`)}},eN=class{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=[`mord`],this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement(`img`);for(var t in e.src=this.src,e.alt=this.alt,e.className=`mord`,this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e=``+qj.escape(this.alt)+``,e}},tN={î:`ı̂`,ï:`ı̈`,í:`ı́`,ì:`ı̀`},nN=class{constructor(e,t,n,r,i,a,o,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=i||0,this.width=a||0,this.classes=o||[],this.style=s||{},this.maxFontSize=0;var c=hM(this.text.charCodeAt(0));c&&this.classes.push(c+`_fallback`),/[îïíì]/.test(this.text)&&(this.text=tN[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;for(var n in this.italic>0&&(t=document.createElement(`span`),t.style.marginRight=KM(this.italic)),this.classes.length>0&&(t||=document.createElement(`span`),t.className=qM(this.classes)),this.style)this.style.hasOwnProperty(n)&&(t||=document.createElement(`span`),t.style[n]=this.style[n]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t=`0&&(n+=`margin-right:`+this.italic+`em;`),this.style)this.style.hasOwnProperty(r)&&(n+=qj.hyphenate(r)+`:`+this.style[r]+`;`);n&&(e=!0,t+=` style="`+qj.escape(n)+`"`);var i=qj.escape(this.text);return e?(t+=`>`,t+=i,t+=``,t):i}},rN=class{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var n=0;n`;for(var n=0;n`,e}},iN=class{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return this.alternate?e.setAttribute(`d`,this.alternate):e.setAttribute(`d`,OM[this.pathName]),e}toMarkup(){return this.alternate?``:``}},aN=class{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`line`);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e=``,e}};function oN(e){if(e instanceof nN)return e;throw Error(`Expected symbolNode but got `+String(e)+`.`)}function sN(e){if(e instanceof QM)return e;throw Error(`Expected span but got `+String(e)+`.`)}var cN={bin:1,close:1,inner:1,open:1,punct:1,rel:1},lN={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},uN={math:{},text:{}};function U(e,t,n,r,i,a){uN[e][i]={font:t,group:n,replace:r},a&&r&&(uN[e][r]=uN[e][i])}var W=`math`,G=`text`,K=`main`,q=`ams`,dN=`accent-token`,fN=`bin`,pN=`close`,mN=`inner`,hN=`mathord`,gN=`op-token`,_N=`open`,vN=`punct`,J=`rel`,yN=`spacing`,Y=`textord`;U(W,K,J,`≡`,`\\equiv`,!0),U(W,K,J,`≺`,`\\prec`,!0),U(W,K,J,`≻`,`\\succ`,!0),U(W,K,J,`∼`,`\\sim`,!0),U(W,K,J,`⊥`,`\\perp`),U(W,K,J,`⪯`,`\\preceq`,!0),U(W,K,J,`⪰`,`\\succeq`,!0),U(W,K,J,`≃`,`\\simeq`,!0),U(W,K,J,`∣`,`\\mid`,!0),U(W,K,J,`≪`,`\\ll`,!0),U(W,K,J,`≫`,`\\gg`,!0),U(W,K,J,`≍`,`\\asymp`,!0),U(W,K,J,`∥`,`\\parallel`),U(W,K,J,`⋈`,`\\bowtie`,!0),U(W,K,J,`⌣`,`\\smile`,!0),U(W,K,J,`⊑`,`\\sqsubseteq`,!0),U(W,K,J,`⊒`,`\\sqsupseteq`,!0),U(W,K,J,`≐`,`\\doteq`,!0),U(W,K,J,`⌢`,`\\frown`,!0),U(W,K,J,`∋`,`\\ni`,!0),U(W,K,J,`∝`,`\\propto`,!0),U(W,K,J,`⊢`,`\\vdash`,!0),U(W,K,J,`⊣`,`\\dashv`,!0),U(W,K,J,`∋`,`\\owns`),U(W,K,vN,`.`,`\\ldotp`),U(W,K,vN,`⋅`,`\\cdotp`),U(W,K,Y,`#`,`\\#`),U(G,K,Y,`#`,`\\#`),U(W,K,Y,`&`,`\\&`),U(G,K,Y,`&`,`\\&`),U(W,K,Y,`ℵ`,`\\aleph`,!0),U(W,K,Y,`∀`,`\\forall`,!0),U(W,K,Y,`ℏ`,`\\hbar`,!0),U(W,K,Y,`∃`,`\\exists`,!0),U(W,K,Y,`∇`,`\\nabla`,!0),U(W,K,Y,`♭`,`\\flat`,!0),U(W,K,Y,`ℓ`,`\\ell`,!0),U(W,K,Y,`♮`,`\\natural`,!0),U(W,K,Y,`♣`,`\\clubsuit`,!0),U(W,K,Y,`℘`,`\\wp`,!0),U(W,K,Y,`♯`,`\\sharp`,!0),U(W,K,Y,`♢`,`\\diamondsuit`,!0),U(W,K,Y,`ℜ`,`\\Re`,!0),U(W,K,Y,`♡`,`\\heartsuit`,!0),U(W,K,Y,`ℑ`,`\\Im`,!0),U(W,K,Y,`♠`,`\\spadesuit`,!0),U(W,K,Y,`§`,`\\S`,!0),U(G,K,Y,`§`,`\\S`),U(W,K,Y,`¶`,`\\P`,!0),U(G,K,Y,`¶`,`\\P`),U(W,K,Y,`†`,`\\dag`),U(G,K,Y,`†`,`\\dag`),U(G,K,Y,`†`,`\\textdagger`),U(W,K,Y,`‡`,`\\ddag`),U(G,K,Y,`‡`,`\\ddag`),U(G,K,Y,`‡`,`\\textdaggerdbl`),U(W,K,pN,`⎱`,`\\rmoustache`,!0),U(W,K,_N,`⎰`,`\\lmoustache`,!0),U(W,K,pN,`⟯`,`\\rgroup`,!0),U(W,K,_N,`⟮`,`\\lgroup`,!0),U(W,K,fN,`∓`,`\\mp`,!0),U(W,K,fN,`⊖`,`\\ominus`,!0),U(W,K,fN,`⊎`,`\\uplus`,!0),U(W,K,fN,`⊓`,`\\sqcap`,!0),U(W,K,fN,`∗`,`\\ast`),U(W,K,fN,`⊔`,`\\sqcup`,!0),U(W,K,fN,`◯`,`\\bigcirc`,!0),U(W,K,fN,`∙`,`\\bullet`,!0),U(W,K,fN,`‡`,`\\ddagger`),U(W,K,fN,`≀`,`\\wr`,!0),U(W,K,fN,`⨿`,`\\amalg`),U(W,K,fN,`&`,`\\And`),U(W,K,J,`⟵`,`\\longleftarrow`,!0),U(W,K,J,`⇐`,`\\Leftarrow`,!0),U(W,K,J,`⟸`,`\\Longleftarrow`,!0),U(W,K,J,`⟶`,`\\longrightarrow`,!0),U(W,K,J,`⇒`,`\\Rightarrow`,!0),U(W,K,J,`⟹`,`\\Longrightarrow`,!0),U(W,K,J,`↔`,`\\leftrightarrow`,!0),U(W,K,J,`⟷`,`\\longleftrightarrow`,!0),U(W,K,J,`⇔`,`\\Leftrightarrow`,!0),U(W,K,J,`⟺`,`\\Longleftrightarrow`,!0),U(W,K,J,`↦`,`\\mapsto`,!0),U(W,K,J,`⟼`,`\\longmapsto`,!0),U(W,K,J,`↗`,`\\nearrow`,!0),U(W,K,J,`↩`,`\\hookleftarrow`,!0),U(W,K,J,`↪`,`\\hookrightarrow`,!0),U(W,K,J,`↘`,`\\searrow`,!0),U(W,K,J,`↼`,`\\leftharpoonup`,!0),U(W,K,J,`⇀`,`\\rightharpoonup`,!0),U(W,K,J,`↙`,`\\swarrow`,!0),U(W,K,J,`↽`,`\\leftharpoondown`,!0),U(W,K,J,`⇁`,`\\rightharpoondown`,!0),U(W,K,J,`↖`,`\\nwarrow`,!0),U(W,K,J,`⇌`,`\\rightleftharpoons`,!0),U(W,q,J,`≮`,`\\nless`,!0),U(W,q,J,``,`\\@nleqslant`),U(W,q,J,``,`\\@nleqq`),U(W,q,J,`⪇`,`\\lneq`,!0),U(W,q,J,`≨`,`\\lneqq`,!0),U(W,q,J,``,`\\@lvertneqq`),U(W,q,J,`⋦`,`\\lnsim`,!0),U(W,q,J,`⪉`,`\\lnapprox`,!0),U(W,q,J,`⊀`,`\\nprec`,!0),U(W,q,J,`⋠`,`\\npreceq`,!0),U(W,q,J,`⋨`,`\\precnsim`,!0),U(W,q,J,`⪹`,`\\precnapprox`,!0),U(W,q,J,`≁`,`\\nsim`,!0),U(W,q,J,``,`\\@nshortmid`),U(W,q,J,`∤`,`\\nmid`,!0),U(W,q,J,`⊬`,`\\nvdash`,!0),U(W,q,J,`⊭`,`\\nvDash`,!0),U(W,q,J,`⋪`,`\\ntriangleleft`),U(W,q,J,`⋬`,`\\ntrianglelefteq`,!0),U(W,q,J,`⊊`,`\\subsetneq`,!0),U(W,q,J,``,`\\@varsubsetneq`),U(W,q,J,`⫋`,`\\subsetneqq`,!0),U(W,q,J,``,`\\@varsubsetneqq`),U(W,q,J,`≯`,`\\ngtr`,!0),U(W,q,J,``,`\\@ngeqslant`),U(W,q,J,``,`\\@ngeqq`),U(W,q,J,`⪈`,`\\gneq`,!0),U(W,q,J,`≩`,`\\gneqq`,!0),U(W,q,J,``,`\\@gvertneqq`),U(W,q,J,`⋧`,`\\gnsim`,!0),U(W,q,J,`⪊`,`\\gnapprox`,!0),U(W,q,J,`⊁`,`\\nsucc`,!0),U(W,q,J,`⋡`,`\\nsucceq`,!0),U(W,q,J,`⋩`,`\\succnsim`,!0),U(W,q,J,`⪺`,`\\succnapprox`,!0),U(W,q,J,`≆`,`\\ncong`,!0),U(W,q,J,``,`\\@nshortparallel`),U(W,q,J,`∦`,`\\nparallel`,!0),U(W,q,J,`⊯`,`\\nVDash`,!0),U(W,q,J,`⋫`,`\\ntriangleright`),U(W,q,J,`⋭`,`\\ntrianglerighteq`,!0),U(W,q,J,``,`\\@nsupseteqq`),U(W,q,J,`⊋`,`\\supsetneq`,!0),U(W,q,J,``,`\\@varsupsetneq`),U(W,q,J,`⫌`,`\\supsetneqq`,!0),U(W,q,J,``,`\\@varsupsetneqq`),U(W,q,J,`⊮`,`\\nVdash`,!0),U(W,q,J,`⪵`,`\\precneqq`,!0),U(W,q,J,`⪶`,`\\succneqq`,!0),U(W,q,J,``,`\\@nsubseteqq`),U(W,q,fN,`⊴`,`\\unlhd`),U(W,q,fN,`⊵`,`\\unrhd`),U(W,q,J,`↚`,`\\nleftarrow`,!0),U(W,q,J,`↛`,`\\nrightarrow`,!0),U(W,q,J,`⇍`,`\\nLeftarrow`,!0),U(W,q,J,`⇏`,`\\nRightarrow`,!0),U(W,q,J,`↮`,`\\nleftrightarrow`,!0),U(W,q,J,`⇎`,`\\nLeftrightarrow`,!0),U(W,q,J,`△`,`\\vartriangle`),U(W,q,Y,`ℏ`,`\\hslash`),U(W,q,Y,`▽`,`\\triangledown`),U(W,q,Y,`◊`,`\\lozenge`),U(W,q,Y,`Ⓢ`,`\\circledS`),U(W,q,Y,`®`,`\\circledR`),U(G,q,Y,`®`,`\\circledR`),U(W,q,Y,`∡`,`\\measuredangle`,!0),U(W,q,Y,`∄`,`\\nexists`),U(W,q,Y,`℧`,`\\mho`),U(W,q,Y,`Ⅎ`,`\\Finv`,!0),U(W,q,Y,`⅁`,`\\Game`,!0),U(W,q,Y,`‵`,`\\backprime`),U(W,q,Y,`▲`,`\\blacktriangle`),U(W,q,Y,`▼`,`\\blacktriangledown`),U(W,q,Y,`■`,`\\blacksquare`),U(W,q,Y,`⧫`,`\\blacklozenge`),U(W,q,Y,`★`,`\\bigstar`),U(W,q,Y,`∢`,`\\sphericalangle`,!0),U(W,q,Y,`∁`,`\\complement`,!0),U(W,q,Y,`ð`,`\\eth`,!0),U(G,K,Y,`ð`,`ð`),U(W,q,Y,`╱`,`\\diagup`),U(W,q,Y,`╲`,`\\diagdown`),U(W,q,Y,`□`,`\\square`),U(W,q,Y,`□`,`\\Box`),U(W,q,Y,`◊`,`\\Diamond`),U(W,q,Y,`¥`,`\\yen`,!0),U(G,q,Y,`¥`,`\\yen`,!0),U(W,q,Y,`✓`,`\\checkmark`,!0),U(G,q,Y,`✓`,`\\checkmark`),U(W,q,Y,`ℶ`,`\\beth`,!0),U(W,q,Y,`ℸ`,`\\daleth`,!0),U(W,q,Y,`ℷ`,`\\gimel`,!0),U(W,q,Y,`ϝ`,`\\digamma`,!0),U(W,q,Y,`ϰ`,`\\varkappa`),U(W,q,_N,`┌`,`\\@ulcorner`,!0),U(W,q,pN,`┐`,`\\@urcorner`,!0),U(W,q,_N,`└`,`\\@llcorner`,!0),U(W,q,pN,`┘`,`\\@lrcorner`,!0),U(W,q,J,`≦`,`\\leqq`,!0),U(W,q,J,`⩽`,`\\leqslant`,!0),U(W,q,J,`⪕`,`\\eqslantless`,!0),U(W,q,J,`≲`,`\\lesssim`,!0),U(W,q,J,`⪅`,`\\lessapprox`,!0),U(W,q,J,`≊`,`\\approxeq`,!0),U(W,q,fN,`⋖`,`\\lessdot`),U(W,q,J,`⋘`,`\\lll`,!0),U(W,q,J,`≶`,`\\lessgtr`,!0),U(W,q,J,`⋚`,`\\lesseqgtr`,!0),U(W,q,J,`⪋`,`\\lesseqqgtr`,!0),U(W,q,J,`≑`,`\\doteqdot`),U(W,q,J,`≓`,`\\risingdotseq`,!0),U(W,q,J,`≒`,`\\fallingdotseq`,!0),U(W,q,J,`∽`,`\\backsim`,!0),U(W,q,J,`⋍`,`\\backsimeq`,!0),U(W,q,J,`⫅`,`\\subseteqq`,!0),U(W,q,J,`⋐`,`\\Subset`,!0),U(W,q,J,`⊏`,`\\sqsubset`,!0),U(W,q,J,`≼`,`\\preccurlyeq`,!0),U(W,q,J,`⋞`,`\\curlyeqprec`,!0),U(W,q,J,`≾`,`\\precsim`,!0),U(W,q,J,`⪷`,`\\precapprox`,!0),U(W,q,J,`⊲`,`\\vartriangleleft`),U(W,q,J,`⊴`,`\\trianglelefteq`),U(W,q,J,`⊨`,`\\vDash`,!0),U(W,q,J,`⊪`,`\\Vvdash`,!0),U(W,q,J,`⌣`,`\\smallsmile`),U(W,q,J,`⌢`,`\\smallfrown`),U(W,q,J,`≏`,`\\bumpeq`,!0),U(W,q,J,`≎`,`\\Bumpeq`,!0),U(W,q,J,`≧`,`\\geqq`,!0),U(W,q,J,`⩾`,`\\geqslant`,!0),U(W,q,J,`⪖`,`\\eqslantgtr`,!0),U(W,q,J,`≳`,`\\gtrsim`,!0),U(W,q,J,`⪆`,`\\gtrapprox`,!0),U(W,q,fN,`⋗`,`\\gtrdot`),U(W,q,J,`⋙`,`\\ggg`,!0),U(W,q,J,`≷`,`\\gtrless`,!0),U(W,q,J,`⋛`,`\\gtreqless`,!0),U(W,q,J,`⪌`,`\\gtreqqless`,!0),U(W,q,J,`≖`,`\\eqcirc`,!0),U(W,q,J,`≗`,`\\circeq`,!0),U(W,q,J,`≜`,`\\triangleq`,!0),U(W,q,J,`∼`,`\\thicksim`),U(W,q,J,`≈`,`\\thickapprox`),U(W,q,J,`⫆`,`\\supseteqq`,!0),U(W,q,J,`⋑`,`\\Supset`,!0),U(W,q,J,`⊐`,`\\sqsupset`,!0),U(W,q,J,`≽`,`\\succcurlyeq`,!0),U(W,q,J,`⋟`,`\\curlyeqsucc`,!0),U(W,q,J,`≿`,`\\succsim`,!0),U(W,q,J,`⪸`,`\\succapprox`,!0),U(W,q,J,`⊳`,`\\vartriangleright`),U(W,q,J,`⊵`,`\\trianglerighteq`),U(W,q,J,`⊩`,`\\Vdash`,!0),U(W,q,J,`∣`,`\\shortmid`),U(W,q,J,`∥`,`\\shortparallel`),U(W,q,J,`≬`,`\\between`,!0),U(W,q,J,`⋔`,`\\pitchfork`,!0),U(W,q,J,`∝`,`\\varpropto`),U(W,q,J,`◀`,`\\blacktriangleleft`),U(W,q,J,`∴`,`\\therefore`,!0),U(W,q,J,`∍`,`\\backepsilon`),U(W,q,J,`▶`,`\\blacktriangleright`),U(W,q,J,`∵`,`\\because`,!0),U(W,q,J,`⋘`,`\\llless`),U(W,q,J,`⋙`,`\\gggtr`),U(W,q,fN,`⊲`,`\\lhd`),U(W,q,fN,`⊳`,`\\rhd`),U(W,q,J,`≂`,`\\eqsim`,!0),U(W,K,J,`⋈`,`\\Join`),U(W,q,J,`≑`,`\\Doteq`,!0),U(W,q,fN,`∔`,`\\dotplus`,!0),U(W,q,fN,`∖`,`\\smallsetminus`),U(W,q,fN,`⋒`,`\\Cap`,!0),U(W,q,fN,`⋓`,`\\Cup`,!0),U(W,q,fN,`⩞`,`\\doublebarwedge`,!0),U(W,q,fN,`⊟`,`\\boxminus`,!0),U(W,q,fN,`⊞`,`\\boxplus`,!0),U(W,q,fN,`⋇`,`\\divideontimes`,!0),U(W,q,fN,`⋉`,`\\ltimes`,!0),U(W,q,fN,`⋊`,`\\rtimes`,!0),U(W,q,fN,`⋋`,`\\leftthreetimes`,!0),U(W,q,fN,`⋌`,`\\rightthreetimes`,!0),U(W,q,fN,`⋏`,`\\curlywedge`,!0),U(W,q,fN,`⋎`,`\\curlyvee`,!0),U(W,q,fN,`⊝`,`\\circleddash`,!0),U(W,q,fN,`⊛`,`\\circledast`,!0),U(W,q,fN,`⋅`,`\\centerdot`),U(W,q,fN,`⊺`,`\\intercal`,!0),U(W,q,fN,`⋒`,`\\doublecap`),U(W,q,fN,`⋓`,`\\doublecup`),U(W,q,fN,`⊠`,`\\boxtimes`,!0),U(W,q,J,`⇢`,`\\dashrightarrow`,!0),U(W,q,J,`⇠`,`\\dashleftarrow`,!0),U(W,q,J,`⇇`,`\\leftleftarrows`,!0),U(W,q,J,`⇆`,`\\leftrightarrows`,!0),U(W,q,J,`⇚`,`\\Lleftarrow`,!0),U(W,q,J,`↞`,`\\twoheadleftarrow`,!0),U(W,q,J,`↢`,`\\leftarrowtail`,!0),U(W,q,J,`↫`,`\\looparrowleft`,!0),U(W,q,J,`⇋`,`\\leftrightharpoons`,!0),U(W,q,J,`↶`,`\\curvearrowleft`,!0),U(W,q,J,`↺`,`\\circlearrowleft`,!0),U(W,q,J,`↰`,`\\Lsh`,!0),U(W,q,J,`⇈`,`\\upuparrows`,!0),U(W,q,J,`↿`,`\\upharpoonleft`,!0),U(W,q,J,`⇃`,`\\downharpoonleft`,!0),U(W,K,J,`⊶`,`\\origof`,!0),U(W,K,J,`⊷`,`\\imageof`,!0),U(W,q,J,`⊸`,`\\multimap`,!0),U(W,q,J,`↭`,`\\leftrightsquigarrow`,!0),U(W,q,J,`⇉`,`\\rightrightarrows`,!0),U(W,q,J,`⇄`,`\\rightleftarrows`,!0),U(W,q,J,`↠`,`\\twoheadrightarrow`,!0),U(W,q,J,`↣`,`\\rightarrowtail`,!0),U(W,q,J,`↬`,`\\looparrowright`,!0),U(W,q,J,`↷`,`\\curvearrowright`,!0),U(W,q,J,`↻`,`\\circlearrowright`,!0),U(W,q,J,`↱`,`\\Rsh`,!0),U(W,q,J,`⇊`,`\\downdownarrows`,!0),U(W,q,J,`↾`,`\\upharpoonright`,!0),U(W,q,J,`⇂`,`\\downharpoonright`,!0),U(W,q,J,`⇝`,`\\rightsquigarrow`,!0),U(W,q,J,`⇝`,`\\leadsto`),U(W,q,J,`⇛`,`\\Rrightarrow`,!0),U(W,q,J,`↾`,`\\restriction`),U(W,K,Y,`‘`,"`"),U(W,K,Y,`$`,`\\$`),U(G,K,Y,`$`,`\\$`),U(G,K,Y,`$`,`\\textdollar`),U(W,K,Y,`%`,`\\%`),U(G,K,Y,`%`,`\\%`),U(W,K,Y,`_`,`\\_`),U(G,K,Y,`_`,`\\_`),U(G,K,Y,`_`,`\\textunderscore`),U(W,K,Y,`∠`,`\\angle`,!0),U(W,K,Y,`∞`,`\\infty`,!0),U(W,K,Y,`′`,`\\prime`),U(W,K,Y,`△`,`\\triangle`),U(W,K,Y,`Γ`,`\\Gamma`,!0),U(W,K,Y,`Δ`,`\\Delta`,!0),U(W,K,Y,`Θ`,`\\Theta`,!0),U(W,K,Y,`Λ`,`\\Lambda`,!0),U(W,K,Y,`Ξ`,`\\Xi`,!0),U(W,K,Y,`Π`,`\\Pi`,!0),U(W,K,Y,`Σ`,`\\Sigma`,!0),U(W,K,Y,`Υ`,`\\Upsilon`,!0),U(W,K,Y,`Φ`,`\\Phi`,!0),U(W,K,Y,`Ψ`,`\\Psi`,!0),U(W,K,Y,`Ω`,`\\Omega`,!0),U(W,K,Y,`A`,`Α`),U(W,K,Y,`B`,`Β`),U(W,K,Y,`E`,`Ε`),U(W,K,Y,`Z`,`Ζ`),U(W,K,Y,`H`,`Η`),U(W,K,Y,`I`,`Ι`),U(W,K,Y,`K`,`Κ`),U(W,K,Y,`M`,`Μ`),U(W,K,Y,`N`,`Ν`),U(W,K,Y,`O`,`Ο`),U(W,K,Y,`P`,`Ρ`),U(W,K,Y,`T`,`Τ`),U(W,K,Y,`X`,`Χ`),U(W,K,Y,`¬`,`\\neg`,!0),U(W,K,Y,`¬`,`\\lnot`),U(W,K,Y,`⊤`,`\\top`),U(W,K,Y,`⊥`,`\\bot`),U(W,K,Y,`∅`,`\\emptyset`),U(W,q,Y,`∅`,`\\varnothing`),U(W,K,hN,`α`,`\\alpha`,!0),U(W,K,hN,`β`,`\\beta`,!0),U(W,K,hN,`γ`,`\\gamma`,!0),U(W,K,hN,`δ`,`\\delta`,!0),U(W,K,hN,`ϵ`,`\\epsilon`,!0),U(W,K,hN,`ζ`,`\\zeta`,!0),U(W,K,hN,`η`,`\\eta`,!0),U(W,K,hN,`θ`,`\\theta`,!0),U(W,K,hN,`ι`,`\\iota`,!0),U(W,K,hN,`κ`,`\\kappa`,!0),U(W,K,hN,`λ`,`\\lambda`,!0),U(W,K,hN,`μ`,`\\mu`,!0),U(W,K,hN,`ν`,`\\nu`,!0),U(W,K,hN,`ξ`,`\\xi`,!0),U(W,K,hN,`ο`,`\\omicron`,!0),U(W,K,hN,`π`,`\\pi`,!0),U(W,K,hN,`ρ`,`\\rho`,!0),U(W,K,hN,`σ`,`\\sigma`,!0),U(W,K,hN,`τ`,`\\tau`,!0),U(W,K,hN,`υ`,`\\upsilon`,!0),U(W,K,hN,`ϕ`,`\\phi`,!0),U(W,K,hN,`χ`,`\\chi`,!0),U(W,K,hN,`ψ`,`\\psi`,!0),U(W,K,hN,`ω`,`\\omega`,!0),U(W,K,hN,`ε`,`\\varepsilon`,!0),U(W,K,hN,`ϑ`,`\\vartheta`,!0),U(W,K,hN,`ϖ`,`\\varpi`,!0),U(W,K,hN,`ϱ`,`\\varrho`,!0),U(W,K,hN,`ς`,`\\varsigma`,!0),U(W,K,hN,`φ`,`\\varphi`,!0),U(W,K,fN,`∗`,`*`,!0),U(W,K,fN,`+`,`+`),U(W,K,fN,`−`,`-`,!0),U(W,K,fN,`⋅`,`\\cdot`,!0),U(W,K,fN,`∘`,`\\circ`,!0),U(W,K,fN,`÷`,`\\div`,!0),U(W,K,fN,`±`,`\\pm`,!0),U(W,K,fN,`×`,`\\times`,!0),U(W,K,fN,`∩`,`\\cap`,!0),U(W,K,fN,`∪`,`\\cup`,!0),U(W,K,fN,`∖`,`\\setminus`,!0),U(W,K,fN,`∧`,`\\land`),U(W,K,fN,`∨`,`\\lor`),U(W,K,fN,`∧`,`\\wedge`,!0),U(W,K,fN,`∨`,`\\vee`,!0),U(W,K,Y,`√`,`\\surd`),U(W,K,_N,`⟨`,`\\langle`,!0),U(W,K,_N,`∣`,`\\lvert`),U(W,K,_N,`∥`,`\\lVert`),U(W,K,pN,`?`,`?`),U(W,K,pN,`!`,`!`),U(W,K,pN,`⟩`,`\\rangle`,!0),U(W,K,pN,`∣`,`\\rvert`),U(W,K,pN,`∥`,`\\rVert`),U(W,K,J,`=`,`=`),U(W,K,J,`:`,`:`),U(W,K,J,`≈`,`\\approx`,!0),U(W,K,J,`≅`,`\\cong`,!0),U(W,K,J,`≥`,`\\ge`),U(W,K,J,`≥`,`\\geq`,!0),U(W,K,J,`←`,`\\gets`),U(W,K,J,`>`,`\\gt`,!0),U(W,K,J,`∈`,`\\in`,!0),U(W,K,J,``,`\\@not`),U(W,K,J,`⊂`,`\\subset`,!0),U(W,K,J,`⊃`,`\\supset`,!0),U(W,K,J,`⊆`,`\\subseteq`,!0),U(W,K,J,`⊇`,`\\supseteq`,!0),U(W,q,J,`⊈`,`\\nsubseteq`,!0),U(W,q,J,`⊉`,`\\nsupseteq`,!0),U(W,K,J,`⊨`,`\\models`),U(W,K,J,`←`,`\\leftarrow`,!0),U(W,K,J,`≤`,`\\le`),U(W,K,J,`≤`,`\\leq`,!0),U(W,K,J,`<`,`\\lt`,!0),U(W,K,J,`→`,`\\rightarrow`,!0),U(W,K,J,`→`,`\\to`),U(W,q,J,`≱`,`\\ngeq`,!0),U(W,q,J,`≰`,`\\nleq`,!0),U(W,K,yN,`\xA0`,`\\ `),U(W,K,yN,`\xA0`,`\\space`),U(W,K,yN,`\xA0`,`\\nobreakspace`),U(G,K,yN,`\xA0`,`\\ `),U(G,K,yN,`\xA0`,` `),U(G,K,yN,`\xA0`,`\\space`),U(G,K,yN,`\xA0`,`\\nobreakspace`),U(W,K,yN,null,`\\nobreak`),U(W,K,yN,null,`\\allowbreak`),U(W,K,vN,`,`,`,`),U(W,K,vN,`;`,`;`),U(W,q,fN,`⊼`,`\\barwedge`,!0),U(W,q,fN,`⊻`,`\\veebar`,!0),U(W,K,fN,`⊙`,`\\odot`,!0),U(W,K,fN,`⊕`,`\\oplus`,!0),U(W,K,fN,`⊗`,`\\otimes`,!0),U(W,K,Y,`∂`,`\\partial`,!0),U(W,K,fN,`⊘`,`\\oslash`,!0),U(W,q,fN,`⊚`,`\\circledcirc`,!0),U(W,q,fN,`⊡`,`\\boxdot`,!0),U(W,K,fN,`△`,`\\bigtriangleup`),U(W,K,fN,`▽`,`\\bigtriangledown`),U(W,K,fN,`†`,`\\dagger`),U(W,K,fN,`⋄`,`\\diamond`),U(W,K,fN,`⋆`,`\\star`),U(W,K,fN,`◃`,`\\triangleleft`),U(W,K,fN,`▹`,`\\triangleright`),U(W,K,_N,`{`,`\\{`),U(G,K,Y,`{`,`\\{`),U(G,K,Y,`{`,`\\textbraceleft`),U(W,K,pN,`}`,`\\}`),U(G,K,Y,`}`,`\\}`),U(G,K,Y,`}`,`\\textbraceright`),U(W,K,_N,`{`,`\\lbrace`),U(W,K,pN,`}`,`\\rbrace`),U(W,K,_N,`[`,`\\lbrack`,!0),U(G,K,Y,`[`,`\\lbrack`,!0),U(W,K,pN,`]`,`\\rbrack`,!0),U(G,K,Y,`]`,`\\rbrack`,!0),U(W,K,_N,`(`,`\\lparen`,!0),U(W,K,pN,`)`,`\\rparen`,!0),U(G,K,Y,`<`,`\\textless`,!0),U(G,K,Y,`>`,`\\textgreater`,!0),U(W,K,_N,`⌊`,`\\lfloor`,!0),U(W,K,pN,`⌋`,`\\rfloor`,!0),U(W,K,_N,`⌈`,`\\lceil`,!0),U(W,K,pN,`⌉`,`\\rceil`,!0),U(W,K,Y,`\\`,`\\backslash`),U(W,K,Y,`∣`,`|`),U(W,K,Y,`∣`,`\\vert`),U(G,K,Y,`|`,`\\textbar`,!0),U(W,K,Y,`∥`,`\\|`),U(W,K,Y,`∥`,`\\Vert`),U(G,K,Y,`∥`,`\\textbardbl`),U(G,K,Y,`~`,`\\textasciitilde`),U(G,K,Y,`\\`,`\\textbackslash`),U(G,K,Y,`^`,`\\textasciicircum`),U(W,K,J,`↑`,`\\uparrow`,!0),U(W,K,J,`⇑`,`\\Uparrow`,!0),U(W,K,J,`↓`,`\\downarrow`,!0),U(W,K,J,`⇓`,`\\Downarrow`,!0),U(W,K,J,`↕`,`\\updownarrow`,!0),U(W,K,J,`⇕`,`\\Updownarrow`,!0),U(W,K,gN,`∐`,`\\coprod`),U(W,K,gN,`⋁`,`\\bigvee`),U(W,K,gN,`⋀`,`\\bigwedge`),U(W,K,gN,`⨄`,`\\biguplus`),U(W,K,gN,`⋂`,`\\bigcap`),U(W,K,gN,`⋃`,`\\bigcup`),U(W,K,gN,`∫`,`\\int`),U(W,K,gN,`∫`,`\\intop`),U(W,K,gN,`∬`,`\\iint`),U(W,K,gN,`∭`,`\\iiint`),U(W,K,gN,`∏`,`\\prod`),U(W,K,gN,`∑`,`\\sum`),U(W,K,gN,`⨂`,`\\bigotimes`),U(W,K,gN,`⨁`,`\\bigoplus`),U(W,K,gN,`⨀`,`\\bigodot`),U(W,K,gN,`∮`,`\\oint`),U(W,K,gN,`∯`,`\\oiint`),U(W,K,gN,`∰`,`\\oiiint`),U(W,K,gN,`⨆`,`\\bigsqcup`),U(W,K,gN,`∫`,`\\smallint`),U(G,K,mN,`…`,`\\textellipsis`),U(W,K,mN,`…`,`\\mathellipsis`),U(G,K,mN,`…`,`\\ldots`,!0),U(W,K,mN,`…`,`\\ldots`,!0),U(W,K,mN,`⋯`,`\\@cdots`,!0),U(W,K,mN,`⋱`,`\\ddots`,!0),U(W,K,Y,`⋮`,`\\varvdots`),U(G,K,Y,`⋮`,`\\varvdots`),U(W,K,dN,`ˊ`,`\\acute`),U(W,K,dN,`ˋ`,`\\grave`),U(W,K,dN,`¨`,`\\ddot`),U(W,K,dN,`~`,`\\tilde`),U(W,K,dN,`ˉ`,`\\bar`),U(W,K,dN,`˘`,`\\breve`),U(W,K,dN,`ˇ`,`\\check`),U(W,K,dN,`^`,`\\hat`),U(W,K,dN,`⃗`,`\\vec`),U(W,K,dN,`˙`,`\\dot`),U(W,K,dN,`˚`,`\\mathring`),U(W,K,hN,``,`\\@imath`),U(W,K,hN,``,`\\@jmath`),U(W,K,Y,`ı`,`ı`),U(W,K,Y,`ȷ`,`ȷ`),U(G,K,Y,`ı`,`\\i`,!0),U(G,K,Y,`ȷ`,`\\j`,!0),U(G,K,Y,`ß`,`\\ss`,!0),U(G,K,Y,`æ`,`\\ae`,!0),U(G,K,Y,`œ`,`\\oe`,!0),U(G,K,Y,`ø`,`\\o`,!0),U(G,K,Y,`Æ`,`\\AE`,!0),U(G,K,Y,`Œ`,`\\OE`,!0),U(G,K,Y,`Ø`,`\\O`,!0),U(G,K,dN,`ˊ`,`\\'`),U(G,K,dN,`ˋ`,"\\`"),U(G,K,dN,`ˆ`,`\\^`),U(G,K,dN,`˜`,`\\~`),U(G,K,dN,`ˉ`,`\\=`),U(G,K,dN,`˘`,`\\u`),U(G,K,dN,`˙`,`\\.`),U(G,K,dN,`¸`,`\\c`),U(G,K,dN,`˚`,`\\r`),U(G,K,dN,`ˇ`,`\\v`),U(G,K,dN,`¨`,`\\"`),U(G,K,dN,`˝`,`\\H`),U(G,K,dN,`◯`,`\\textcircled`);var bN={"--":!0,"---":!0,"``":!0,"''":!0};U(G,K,Y,`–`,`--`,!0),U(G,K,Y,`–`,`\\textendash`),U(G,K,Y,`—`,`---`,!0),U(G,K,Y,`—`,`\\textemdash`),U(G,K,Y,`‘`,"`",!0),U(G,K,Y,`‘`,`\\textquoteleft`),U(G,K,Y,`’`,`'`,!0),U(G,K,Y,`’`,`\\textquoteright`),U(G,K,Y,`“`,"``",!0),U(G,K,Y,`“`,`\\textquotedblleft`),U(G,K,Y,`”`,`''`,!0),U(G,K,Y,`”`,`\\textquotedblright`),U(W,K,Y,`°`,`\\degree`,!0),U(G,K,Y,`°`,`\\degree`),U(G,K,Y,`°`,`\\textdegree`,!0),U(W,K,Y,`£`,`\\pounds`),U(W,K,Y,`£`,`\\mathsterling`,!0),U(G,K,Y,`£`,`\\pounds`),U(G,K,Y,`£`,`\\textsterling`,!0),U(W,q,Y,`✠`,`\\maltese`),U(G,q,Y,`✠`,`\\maltese`);for(var xN=`0123456789/@."`,SN=0;SN0)return HN(i,c,r,t,a.concat(l));if(s){var u,d;if(s===`boldsymbol`){var f=WN(i,r,t,a,n);u=f.fontName,d=[f.fontClass]}else o?(u=aP[s].fontName,d=[s]):(u=iP(s,t.fontWeight,t.fontShape),d=[s,t.fontWeight,t.fontShape]);if(VN(i,u,r).metrics)return HN(i,u,r,t,a.concat(d));if(bN.hasOwnProperty(i)&&u.slice(0,10)===`Typewriter`){for(var p=[],m=0;m{if(qM(e.classes)!==qM(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(e.classes.length===1){var n=e.classes[0];if(n===`mbin`||n===`mord`)return!1}for(var r in e.style)if(e.style.hasOwnProperty(r)&&e.style[r]!==t.style[r])return!1;for(var i in t.style)if(t.style.hasOwnProperty(i)&&e.style[i]!==t.style[i])return!1;return!0},qN=e=>{for(var t=0;tt&&(t=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>r&&(r=a.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},YN=function(e,t,n,r){var i=new QM(e,t,n,r);return JN(i),i},XN=(e,t,n,r)=>new QM(e,t,n,r),ZN=function(e,t,n){var r=YN([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=KM(r.height),r.maxFontSize=1,r},QN=function(e,t,n,r){var i=new $M(e,t,n,r);return JN(i),i},$N=function(e){var t=new AM(e);return JN(t),t},eP=function(e,t){return e instanceof AM?YN([],[e],t):e},tP=function(e){if(e.positionType===`individualShift`){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,a=1;a{var n=YN([`mspace`],[],t),r=GM(e,t);return n.style.marginRight=KM(r),n},iP=function(e,t,n){var r=``;switch(e){case`amsrm`:r=`AMS`;break;case`textrm`:r=`Main`;break;case`textsf`:r=`SansSerif`;break;case`texttt`:r=`Typewriter`;break;default:r=e}var i=t===`textbf`&&n===`textit`?`BoldItalic`:t===`textbf`?`Bold`:t===`textit`?`Italic`:`Regular`;return r+`-`+i},aP={mathbf:{variant:`bold`,fontName:`Main-Bold`},mathrm:{variant:`normal`,fontName:`Main-Regular`},textit:{variant:`italic`,fontName:`Main-Italic`},mathit:{variant:`italic`,fontName:`Main-Italic`},mathnormal:{variant:`italic`,fontName:`Math-Italic`},mathsfit:{variant:`sans-serif-italic`,fontName:`SansSerif-Italic`},mathbb:{variant:`double-struck`,fontName:`AMS-Regular`},mathcal:{variant:`script`,fontName:`Caligraphic-Regular`},mathfrak:{variant:`fraktur`,fontName:`Fraktur-Regular`},mathscr:{variant:`script`,fontName:`Script-Regular`},mathsf:{variant:`sans-serif`,fontName:`SansSerif-Regular`},mathtt:{variant:`monospace`,fontName:`Typewriter-Regular`}},oP={vec:[`vec`,.471,.714],oiintSize1:[`oiintSize1`,.957,.499],oiintSize2:[`oiintSize2`,1.472,.659],oiiintSize1:[`oiiintSize1`,1.304,.499],oiiintSize2:[`oiiintSize2`,1.98,.659]},X={fontMap:aP,makeSymbol:HN,mathsym:UN,makeSpan:YN,makeSvgSpan:XN,makeLineSpan:ZN,makeAnchor:QN,makeFragment:$N,wrapFragment:eP,makeVList:nP,makeOrd:GN,makeGlue:rP,staticSvg:function(e,t){var[n,r,i]=oP[e],a=XN([`overlay`],[new rN([new iN(n)],{width:KM(r),height:KM(i),style:`width:`+KM(r),viewBox:`0 0 `+1e3*r+` `+1e3*i,preserveAspectRatio:`xMinYMin`})],t);return a.height=i,a.style.height=KM(i),a.style.width=KM(r),a},svgData:oP,tryCombineChars:qN},sP={number:3,unit:`mu`},cP={number:4,unit:`mu`},lP={number:5,unit:`mu`},uP={mord:{mop:sP,mbin:cP,mrel:lP,minner:sP},mop:{mord:sP,mop:sP,mrel:lP,minner:sP},mbin:{mord:cP,mop:cP,mopen:cP,minner:cP},mrel:{mord:lP,mop:lP,mopen:lP,minner:lP},mopen:{},mclose:{mop:sP,mbin:cP,mrel:lP,minner:sP},mpunct:{mord:sP,mop:sP,mrel:lP,mopen:sP,mclose:sP,mpunct:sP,minner:sP},minner:{mord:sP,mop:sP,mbin:cP,mrel:lP,mopen:sP,mpunct:sP,minner:sP}},dP={mord:{mop:sP},mop:{mord:sP,mop:sP},mbin:{},mrel:{},mopen:{},mclose:{mop:sP},mpunct:{},minner:{mop:sP}},fP={},pP={},mP={};function hP(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},c=0;c{var n=t.classes[0],r=e.classes[0];n===`mbin`&&xP.includes(r)?t.classes[0]=`mord`:r===`mbin`&&bP.includes(n)&&(e.classes[0]=`mord`)},{node:u},d,f),TP(i,(e,t)=>{var n=OP(t),r=OP(e),i=n&&r?e.hasClass(`mtight`)?dP[n][r]:uP[n][r]:null;if(i)return X.makeGlue(i,c)},{node:u},d,f),i},TP=function e(t,n,r,i,a){i&&t.push(i);for(var o=0;on=>{t.splice(e+1,0,n),o++})(o)}i&&t.pop()},EP=function(e){return e instanceof AM||e instanceof $M||e instanceof QM&&e.hasClass(`enclosing`)?e:null},DP=function e(t,n){var r=EP(t);if(r){var i=r.children;if(i.length){if(n===`right`)return e(i[i.length-1],`right`);if(n===`left`)return e(i[0],`left`)}}return t},OP=function(e,t){return e?(t&&(e=DP(e,t)),CP[e.classes[0]]||null):null},kP=function(e,t){var n=[`nulldelimiter`].concat(e.baseSizingClasses());return yP(t.concat(n))},AP=function(e,t,n){if(!e)return yP();if(pP[e.type]){var r=pP[e.type](e,t);if(n&&t.size!==n.size){r=yP(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}else throw new Lj(`Got group of unknown type: '`+e.type+`'`)};function jP(e,t){var n=yP([`base`],e,t),r=yP([`strut`]);return r.style.height=KM(n.height+n.depth),n.depth&&(r.style.verticalAlign=KM(-n.depth)),n.children.unshift(r),n}function MP(e,t){var n=null;e.length===1&&e[0].type===`tag`&&(n=e[0].tag,e=e[0].body);var r=wP(e,t,`root`),i;r.length===2&&r[1].hasClass(`tag`)&&(i=r.pop());for(var a=[],o=[],s=0;s0&&(a.push(jP(o,t)),o=[]),a.push(r[s]));o.length>0&&a.push(jP(o,t));var l;n?(l=jP(wP(n,t,!0)),l.classes=[`tag`],a.push(l)):i&&a.push(i);var u=yP([`katex-html`],a);if(u.setAttribute(`aria-hidden`,`true`),l){var d=l.children[0];d.style.height=KM(u.height+u.depth),u.depth&&(d.style.verticalAlign=KM(-u.depth))}return u}function NP(e){return new AM(e)}var PP=class{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=qM(this.classes));for(var n=0;n0&&(e+=` class ="`+qj.escape(qM(this.classes))+`"`),e+=`>`;for(var n=0;n`,e}toText(){return this.children.map(e=>e.toText()).join(``)}},FP=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return qj.escape(this.toText())}toText(){return this.text}},IP={MathNode:PP,TextNode:FP,SpaceNode:class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=` `:e>=.1666&&e<=.1667?this.character=` `:e>=.2222&&e<=.2223?this.character=` `:e>=.2777&&e<=.2778?this.character=`  `:e>=-.05556&&e<=-.05555?this.character=` ⁣`:e>=-.1667&&e<=-.1666?this.character=` ⁣`:e>=-.2223&&e<=-.2222?this.character=` ⁣`:e>=-.2778&&e<=-.2777?this.character=` ⁣`:this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`mspace`);return e.setAttribute(`width`,KM(this.width)),e}toMarkup(){return this.character?``+this.character+``:``}toText(){return this.character?this.character:` `}},newDocumentFragment:NP},LP=function(e,t,n){return uN[t][e]&&uN[t][e].replace&&e.charCodeAt(0)!==55349&&!(bN.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)===`tt`||n.font&&n.font.slice(4,6)===`tt`))&&(e=uN[t][e].replace),new IP.TextNode(e)},RP=function(e){return e.length===1?e[0]:new IP.MathNode(`mrow`,e)},zP=function(e,t){if(t.fontFamily===`texttt`)return`monospace`;if(t.fontFamily===`textsf`)return t.fontShape===`textit`&&t.fontWeight===`textbf`?`sans-serif-bold-italic`:t.fontShape===`textit`?`sans-serif-italic`:t.fontWeight===`textbf`?`bold-sans-serif`:`sans-serif`;if(t.fontShape===`textit`&&t.fontWeight===`textbf`)return`bold-italic`;if(t.fontShape===`textit`)return`italic`;if(t.fontWeight===`textbf`)return`bold`;var n=t.font;if(!n||n===`mathnormal`)return null;var r=e.mode;if(n===`mathit`)return`italic`;if(n===`boldsymbol`)return e.type===`textord`?`bold`:`bold-italic`;if(n===`mathbf`)return`bold`;if(n===`mathbb`)return`double-struck`;if(n===`mathsfit`)return`sans-serif-italic`;if(n===`mathfrak`)return`fraktur`;if(n===`mathscr`||n===`mathcal`)return`script`;if(n===`mathsf`)return`sans-serif`;if(n===`mathtt`)return`monospace`;var i=e.text;if([`\\imath`,`\\jmath`].includes(i))return null;uN[r][i]&&uN[r][i].replace&&(i=uN[r][i].replace);var a=X.fontMap[n].fontName;return FM(i,a,r)?X.fontMap[n].variant:null};function BP(e){if(!e)return!1;if(e.type===`mi`&&e.children.length===1){var t=e.children[0];return t instanceof FP&&t.text===`.`}else if(e.type===`mo`&&e.children.length===1&&e.getAttribute(`separator`)===`true`&&e.getAttribute(`lspace`)===`0em`&&e.getAttribute(`rspace`)===`0em`){var n=e.children[0];return n instanceof FP&&n.text===`,`}else return!1}var VP=function(e,t,n){if(e.length===1){var r=UP(e[0],t);return n&&r instanceof PP&&r.type===`mo`&&(r.setAttribute(`lspace`,`0em`),r.setAttribute(`rspace`,`0em`)),[r]}for(var i=[],a,o=0;o=1&&(a.type===`mn`||BP(a))){var c=s.children[0];c instanceof PP&&c.type===`mn`&&(c.children=[...a.children,...c.children],i.pop())}else if(a.type===`mi`&&a.children.length===1){var l=a.children[0];if(l instanceof FP&&l.text===`̸`&&(s.type===`mo`||s.type===`mi`||s.type===`mn`)){var u=s.children[0];u instanceof FP&&u.text.length>0&&(u.text=u.text.slice(0,1)+`̸`+u.text.slice(1),i.pop())}}}i.push(s),a=s}return i},HP=function(e,t,n){return RP(VP(e,t,n))},UP=function(e,t){if(!e)return new IP.MathNode(`mrow`);if(mP[e.type])return mP[e.type](e,t);throw new Lj(`Got group of unknown type: '`+e.type+`'`)};function WP(e,t,n,r,i){var a=VP(e,n),o=a.length===1&&a[0]instanceof PP&&[`mrow`,`mtable`].includes(a[0].type)?a[0]:new IP.MathNode(`mrow`,a),s=new IP.MathNode(`annotation`,[new IP.TextNode(t)]);s.setAttribute(`encoding`,`application/x-tex`);var c=new IP.MathNode(`semantics`,[o,s]),l=new IP.MathNode(`math`,[c]);l.setAttribute(`xmlns`,`http://www.w3.org/1998/Math/MathML`),r&&l.setAttribute(`display`,`block`);var u=i?`katex`:`katex-mathml`;return X.makeSpan([u],[l])}var GP=function(e){return new VM({style:e.displayMode?pM.DISPLAY:pM.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},KP=function(e,t){if(t.displayMode){var n=[`katex-display`];t.leqno&&n.push(`leqno`),t.fleqn&&n.push(`fleqn`),e=X.makeSpan(n,[e])}return e},qP=function(e,t,n){var r=GP(n),i;if(n.output===`mathml`)return WP(e,t,r,n.displayMode,!0);if(n.output===`html`){var a=MP(e,r);i=X.makeSpan([`katex`],[a])}else{var o=WP(e,t,r,n.displayMode,!1),s=MP(e,r);i=X.makeSpan([`katex`],[o,s])}return KP(i,n)},JP=function(e,t,n){var r=MP(e,GP(n));return KP(X.makeSpan([`katex`],[r]),n)},YP={widehat:`^`,widecheck:`ˇ`,widetilde:`~`,utilde:`~`,overleftarrow:`←`,underleftarrow:`←`,xleftarrow:`←`,overrightarrow:`→`,underrightarrow:`→`,xrightarrow:`→`,underbrace:`⏟`,overbrace:`⏞`,overgroup:`⏠`,undergroup:`⏡`,overleftrightarrow:`↔`,underleftrightarrow:`↔`,xleftrightarrow:`↔`,Overrightarrow:`⇒`,xRightarrow:`⇒`,overleftharpoon:`↼`,xleftharpoonup:`↼`,overrightharpoon:`⇀`,xrightharpoonup:`⇀`,xLeftarrow:`⇐`,xLeftrightarrow:`⇔`,xhookleftarrow:`↩`,xhookrightarrow:`↪`,xmapsto:`↦`,xrightharpoondown:`⇁`,xleftharpoondown:`↽`,xrightleftharpoons:`⇌`,xleftrightharpoons:`⇋`,xtwoheadleftarrow:`↞`,xtwoheadrightarrow:`↠`,xlongequal:`=`,xtofrom:`⇄`,xrightleftarrows:`⇄`,xrightequilibrium:`⇌`,xleftequilibrium:`⇋`,"\\cdrightarrow":`→`,"\\cdleftarrow":`←`,"\\cdlongequal":`=`},XP=function(e){var t=new IP.MathNode(`mo`,[new IP.TextNode(YP[e.replace(/^\\/,``)])]);return t.setAttribute(`stretchy`,`true`),t},ZP={overrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],overleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],underrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],underleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],xrightarrow:[[`rightarrow`],1.469,522,`xMaxYMin`],"\\cdrightarrow":[[`rightarrow`],3,522,`xMaxYMin`],xleftarrow:[[`leftarrow`],1.469,522,`xMinYMin`],"\\cdleftarrow":[[`leftarrow`],3,522,`xMinYMin`],Overrightarrow:[[`doublerightarrow`],.888,560,`xMaxYMin`],xRightarrow:[[`doublerightarrow`],1.526,560,`xMaxYMin`],xLeftarrow:[[`doubleleftarrow`],1.526,560,`xMinYMin`],overleftharpoon:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoonup:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoondown:[[`leftharpoondown`],.888,522,`xMinYMin`],overrightharpoon:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoonup:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoondown:[[`rightharpoondown`],.888,522,`xMaxYMin`],xlongequal:[[`longequal`],.888,334,`xMinYMin`],"\\cdlongequal":[[`longequal`],3,334,`xMinYMin`],xtwoheadleftarrow:[[`twoheadleftarrow`],.888,334,`xMinYMin`],xtwoheadrightarrow:[[`twoheadrightarrow`],.888,334,`xMaxYMin`],overleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],overbrace:[[`leftbrace`,`midbrace`,`rightbrace`],1.6,548],underbrace:[[`leftbraceunder`,`midbraceunder`,`rightbraceunder`],1.6,548],underleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],xleftrightarrow:[[`leftarrow`,`rightarrow`],1.75,522],xLeftrightarrow:[[`doubleleftarrow`,`doublerightarrow`],1.75,560],xrightleftharpoons:[[`leftharpoondownplus`,`rightharpoonplus`],1.75,716],xleftrightharpoons:[[`leftharpoonplus`,`rightharpoondownplus`],1.75,716],xhookleftarrow:[[`leftarrow`,`righthook`],1.08,522],xhookrightarrow:[[`lefthook`,`rightarrow`],1.08,522],overlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],underlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],overgroup:[[`leftgroup`,`rightgroup`],.888,342],undergroup:[[`leftgroupunder`,`rightgroupunder`],.888,342],xmapsto:[[`leftmapsto`,`rightarrow`],1.5,522],xtofrom:[[`leftToFrom`,`rightToFrom`],1.75,528],xrightleftarrows:[[`baraboveleftarrow`,`rightarrowabovebar`],1.75,901],xrightequilibrium:[[`baraboveshortleftharpoon`,`rightharpoonaboveshortbar`],1.75,716],xleftequilibrium:[[`shortbaraboveleftharpoon`,`shortrightharpoonabovebar`],1.75,716]},QP=function(e){return e.type===`ordgroup`?e.body.length:1},$P={encloseSpan:function(e,t,n,r,i){var a,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(a=X.makeSpan([`stretchy`,t],[],i),t===`fbox`){var s=i.color&&i.getColor();s&&(a.style.borderColor=s)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new aN({x1:`0`,y1:`0`,x2:`100%`,y2:`100%`,"stroke-width":`0.046em`})),/^x?cancel$/.test(t)&&c.push(new aN({x1:`0`,y1:`100%`,x2:`100%`,y2:`0`,"stroke-width":`0.046em`}));var l=new rN(c,{width:`100%`,height:KM(o)});a=X.makeSvgSpan([],[l],i)}return a.height=o,a.style.height=KM(o),a},mathMLnode:XP,svgSpan:function(e,t){function n(){var n=4e5,r=e.label.slice(1);if([`widehat`,`widecheck`,`widetilde`,`utilde`].includes(r)){var i=QP(e.base),a,o,s;if(i>5)r===`widehat`||r===`widecheck`?(a=420,n=2364,s=.42,o=r+`4`):(a=312,n=2340,s=.34,o=`tilde4`);else{var c=[1,1,2,2,3,3][i];r===`widehat`||r===`widecheck`?(n=[0,1062,2364,2364,2364][c],a=[0,239,300,360,420][c],s=[0,.24,.3,.3,.36,.42][c],o=r+c):(n=[0,600,1033,2339,2340][c],a=[0,260,286,306,312][c],s=[0,.26,.286,.3,.306,.34][c],o=`tilde`+c)}var l=new rN([new iN(o)],{width:`100%`,height:KM(s),viewBox:`0 0 `+n+` `+a,preserveAspectRatio:`none`});return{span:X.makeSvgSpan([],[l],t),minWidth:0,height:s}}else{var u=[],d=ZP[r],[f,p,m]=d,h=m/1e3,g=f.length,_,v;if(g===1){var y=d[3];_=[`hide-tail`],v=[y]}else if(g===2)_=[`halfarrow-left`,`halfarrow-right`],v=[`xMinYMin`,`xMaxYMin`];else if(g===3)_=[`brace-left`,`brace-center`,`brace-right`],v=[`xMinYMin`,`xMidYMin`,`xMaxYMin`];else throw Error(`Correct katexImagesData or update code here to support + `+g+` children.`);for(var b=0;b0&&(r.style.minWidth=KM(i)),r}};function eF(e,t){if(!e||e.type!==t)throw Error(`Expected node of type `+t+`, but got `+(e?`node of type `+e.type:String(e)));return e}function tF(e){var t=nF(e);if(!t)throw Error(`Expected node of symbol group type, but got `+(e?`node of type `+e.type:String(e)));return t}function nF(e){return e&&(e.type===`atom`||lN.hasOwnProperty(e.type))?e:null}var rF=(e,t)=>{var n,r,i;e&&e.type===`supsub`?(r=eF(e.base,`accent`),n=r.base,e.base=n,i=sN(AP(e,t)),e.base=r):(r=eF(e,`accent`),n=r.base);var a=AP(n,t.havingCrampedStyle()),o=r.isShifty&&qj.isCharacterBox(n),s=0;o&&(s=oN(AP(qj.getBaseElem(n),t.havingCrampedStyle())).skew);var c=r.label===`\\c`,l=c?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),u;if(r.isStretchy)u=$P.svgSpan(r,t),u=X.makeVList({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`elem`,elem:u,wrapperClasses:[`svg-align`],wrapperStyle:s>0?{width:`calc(100% - `+KM(2*s)+`)`,marginLeft:KM(2*s)}:void 0}]},t);else{var d,f;r.label===`\\vec`?(d=X.staticSvg(`vec`,t),f=X.svgData.vec[1]):(d=X.makeOrd({mode:r.mode,text:r.label},t,`textord`),d=oN(d),d.italic=0,f=d.width,c&&(l+=d.depth)),u=X.makeSpan([`accent-body`],[d]);var p=r.label===`\\textcircled`;p&&(u.classes.push(`accent-full`),l=a.height);var m=s;p||(m-=f/2),u.style.left=KM(m),r.label===`\\textcircled`&&(u.style.top=`.2em`),u=X.makeVList({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:-l},{type:`elem`,elem:u}]},t)}var h=X.makeSpan([`mord`,`accent`],[u],t);return i?(i.children[0]=h,i.height=Math.max(h.height,i.height),i.classes[0]=`mord`,i):h},iF=(e,t)=>{var n=e.isStretchy?$P.mathMLnode(e.label):new IP.MathNode(`mo`,[LP(e.label,e.mode)]),r=new IP.MathNode(`mover`,[UP(e.base,t),n]);return r.setAttribute(`accent`,`true`),r},aF=new RegExp([`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`].map(e=>`\\`+e).join(`|`));hP({type:`accent`,names:[`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`,`\\widecheck`,`\\widehat`,`\\widetilde`,`\\overrightarrow`,`\\overleftarrow`,`\\Overrightarrow`,`\\overleftrightarrow`,`\\overgroup`,`\\overlinesegment`,`\\overleftharpoon`,`\\overrightharpoon`],props:{numArgs:1},handler:(e,t)=>{var n=_P(t[0]),r=!aF.test(e.funcName),i=!r||e.funcName===`\\widehat`||e.funcName===`\\widetilde`||e.funcName===`\\widecheck`;return{type:`accent`,mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:rF,mathmlBuilder:iF}),hP({type:`accent`,names:[`\\'`,"\\`",`\\^`,`\\~`,`\\=`,`\\u`,`\\.`,`\\"`,`\\c`,`\\r`,`\\H`,`\\v`,`\\textcircled`],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`primitive`]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r===`math`&&(e.parser.settings.reportNonstrict(`mathVsTextAccents`,`LaTeX's accent `+e.funcName+` works only in text mode`),r=`text`),{type:`accent`,mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:rF,mathmlBuilder:iF}),hP({type:`accentUnder`,names:[`\\underleftarrow`,`\\underrightarrow`,`\\underleftrightarrow`,`\\undergroup`,`\\underlinesegment`,`\\utilde`],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`accentUnder`,mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=AP(e.base,t),r=$P.svgSpan(e,t),i=e.label===`\\utilde`?.12:0,a=X.makeVList({positionType:`top`,positionData:n.height,children:[{type:`elem`,elem:r,wrapperClasses:[`svg-align`]},{type:`kern`,size:i},{type:`elem`,elem:n}]},t);return X.makeSpan([`mord`,`accentunder`],[a],t)},mathmlBuilder:(e,t)=>{var n=$P.mathMLnode(e.label),r=new IP.MathNode(`munder`,[UP(e.base,t),n]);return r.setAttribute(`accentunder`,`true`),r}});var oF=e=>{var t=new IP.MathNode(`mpadded`,e?[e]:[]);return t.setAttribute(`width`,`+0.6em`),t.setAttribute(`lspace`,`0.3em`),t};hP({type:`xArrow`,names:[`\\xleftarrow`,`\\xrightarrow`,`\\xLeftarrow`,`\\xRightarrow`,`\\xleftrightarrow`,`\\xLeftrightarrow`,`\\xhookleftarrow`,`\\xhookrightarrow`,`\\xmapsto`,`\\xrightharpoondown`,`\\xrightharpoonup`,`\\xleftharpoondown`,`\\xleftharpoonup`,`\\xrightleftharpoons`,`\\xleftrightharpoons`,`\\xlongequal`,`\\xtwoheadrightarrow`,`\\xtwoheadleftarrow`,`\\xtofrom`,`\\xrightleftarrows`,`\\xrightequilibrium`,`\\xleftequilibrium`,`\\\\cdrightarrow`,`\\\\cdleftarrow`,`\\\\cdlongequal`],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:i}=e;return{type:`xArrow`,mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=X.wrapFragment(AP(e.body,r,t),t),a=e.label.slice(0,2)===`\\x`?`x`:`cd`;i.classes.push(a+`-arrow-pad`);var o;e.below&&(r=t.havingStyle(n.sub()),o=X.wrapFragment(AP(e.below,r,t),t),o.classes.push(a+`-arrow-pad`));var s=$P.svgSpan(e,t),c=-t.fontMetrics().axisHeight+.5*s.height,l=-t.fontMetrics().axisHeight-.5*s.height-.111;(i.depth>.25||e.label===`\\xleftequilibrium`)&&(l-=i.depth);var u;if(o){var d=-t.fontMetrics().axisHeight+o.height+.5*s.height+.111;u=X.makeVList({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c},{type:`elem`,elem:o,shift:d}]},t)}else u=X.makeVList({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c}]},t);return u.children[0].children[0].children[1].classes.push(`svg-align`),X.makeSpan([`mrel`,`x-arrow`],[u],t)},mathmlBuilder(e,t){var n=$P.mathMLnode(e.label);n.setAttribute(`minsize`,e.label.charAt(0)===`x`?`1.75em`:`3.0em`);var r;if(e.body){var i=oF(UP(e.body,t));if(e.below){var a=oF(UP(e.below,t));r=new IP.MathNode(`munderover`,[n,a,i])}else r=new IP.MathNode(`mover`,[n,i])}else if(e.below){var o=oF(UP(e.below,t));r=new IP.MathNode(`munder`,[n,o])}else r=oF(),r=new IP.MathNode(`mover`,[n,r]);return r}});var sF=X.makeSpan;function cF(e,t){var n=wP(e.body,t,!0);return sF([e.mclass],n,t)}function lF(e,t){var n,r=VP(e.body,t);return e.mclass===`minner`?n=new IP.MathNode(`mpadded`,r):e.mclass===`mord`?e.isCharacterBox?(n=r[0],n.type=`mi`):n=new IP.MathNode(`mi`,r):(e.isCharacterBox?(n=r[0],n.type=`mo`):n=new IP.MathNode(`mo`,r),e.mclass===`mbin`?(n.attributes.lspace=`0.22em`,n.attributes.rspace=`0.22em`):e.mclass===`mpunct`?(n.attributes.lspace=`0em`,n.attributes.rspace=`0.17em`):e.mclass===`mopen`||e.mclass===`mclose`?(n.attributes.lspace=`0em`,n.attributes.rspace=`0em`):e.mclass===`minner`&&(n.attributes.lspace=`0.0556em`,n.attributes.width=`+0.1111em`)),n}hP({type:`mclass`,names:[`\\mathord`,`\\mathbin`,`\\mathrel`,`\\mathopen`,`\\mathclose`,`\\mathpunct`,`\\mathinner`],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`mclass`,mode:n.mode,mclass:`m`+r.slice(5),body:vP(i),isCharacterBox:qj.isCharacterBox(i)}},htmlBuilder:cF,mathmlBuilder:lF});var uF=e=>{var t=e.type===`ordgroup`&&e.body.length?e.body[0]:e;return t.type===`atom`&&(t.family===`bin`||t.family===`rel`)?`m`+t.family:`mord`};hP({type:`mclass`,names:[`\\@binrel`],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:`mclass`,mode:n.mode,mclass:uF(t[0]),body:vP(t[1]),isCharacterBox:qj.isCharacterBox(t[1])}}}),hP({type:`mclass`,names:[`\\stackrel`,`\\overset`,`\\underset`],props:{numArgs:2},handler(e,t){var{parser:n,funcName:r}=e,i=t[1],a=t[0],o=r===`\\stackrel`?`mrel`:uF(i),s={type:`op`,mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!==`\\stackrel`,body:vP(i)},c={type:`supsub`,mode:a.mode,base:s,sup:r===`\\underset`?null:a,sub:r===`\\underset`?a:null};return{type:`mclass`,mode:n.mode,mclass:o,body:[c],isCharacterBox:qj.isCharacterBox(c)}},htmlBuilder:cF,mathmlBuilder:lF}),hP({type:`pmb`,names:[`\\pmb`],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`pmb`,mode:n.mode,mclass:uF(t[0]),body:vP(t[0])}},htmlBuilder(e,t){var n=wP(e.body,t,!0),r=X.makeSpan([e.mclass],n,t);return r.style.textShadow=`0.02em 0.01em 0.04px`,r},mathmlBuilder(e,t){var n=VP(e.body,t),r=new IP.MathNode(`mstyle`,n);return r.setAttribute(`style`,`text-shadow: 0.02em 0.01em 0.04px`),r}});var dF={">":`\\\\cdrightarrow`,"<":`\\\\cdleftarrow`,"=":`\\\\cdlongequal`,A:`\\uparrow`,V:`\\downarrow`,"|":`\\Vert`,".":`no arrow`},fF=()=>({type:`styling`,body:[],mode:`math`,style:`display`}),pF=e=>e.type===`textord`&&e.text===`@`,mF=(e,t)=>(e.type===`mathord`||e.type===`atom`)&&e.text===t;function hF(e,t,n){var r=dF[e];switch(r){case`\\\\cdrightarrow`:case`\\\\cdleftarrow`:return n.callFunction(r,[t[0]],[t[1]]);case`\\uparrow`:case`\\downarrow`:var i=n.callFunction(`\\\\cdleft`,[t[0]],[]),a={type:`atom`,text:r,mode:`math`,family:`rel`},o={type:`ordgroup`,mode:`math`,body:[i,n.callFunction(`\\Big`,[a],[]),n.callFunction(`\\\\cdright`,[t[1]],[])]};return n.callFunction(`\\\\cdparent`,[o],[]);case`\\\\cdlongequal`:return n.callFunction(`\\\\cdlongequal`,[],[]);case`\\Vert`:return n.callFunction(`\\Big`,[{type:`textord`,text:`\\Vert`,mode:`math`}],[]);default:return{type:`textord`,text:` `,mode:`math`}}}function gF(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set(`\\cr`,`\\\\\\relax`),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,`\\\\`)),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n===`&`||n===`\\\\`)e.consume();else if(n===`\\end`){t[t.length-1].length===0&&t.pop();break}else throw new Lj(`Expected \\\\ or \\cr or \\end`,e.nextToken)}for(var r=[],i=[r],a=0;a-1))if(`<>AV`.indexOf(l)>-1)for(var d=0;d<2;d++){for(var f=!0,p=c+1;pAV=|." after @`,o[c]);var m={type:`styling`,body:[hF(l,u,e)],mode:`math`,style:`display`};r.push(m),s=fF()}a%2==0?r.push(s):r.shift(),r=[],i.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:`math`,body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:Array(i[0].length).fill({type:`align`,align:`c`,pregap:.25,postgap:.25}),colSeparationType:`CD`,hLinesBeforeRow:Array(i.length+1).fill([])}}hP({type:`cdlabel`,names:[`\\\\cdleft`,`\\\\cdright`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:`cdlabel`,mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=X.wrapFragment(AP(e.label,n,t),t);return r.classes.push(`cd-label-`+e.side),r.style.bottom=KM(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new IP.MathNode(`mrow`,[UP(e.label,t)]);return n=new IP.MathNode(`mpadded`,[n]),n.setAttribute(`width`,`0`),e.side===`left`&&n.setAttribute(`lspace`,`-1width`),n.setAttribute(`voffset`,`0.7em`),n=new IP.MathNode(`mstyle`,[n]),n.setAttribute(`displaystyle`,`false`),n.setAttribute(`scriptlevel`,`1`),n}}),hP({type:`cdlabelparent`,names:[`\\\\cdparent`],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:`cdlabelparent`,mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=X.wrapFragment(AP(e.fragment,t),t);return n.classes.push(`cd-vert-arrow`),n},mathmlBuilder(e,t){return new IP.MathNode(`mrow`,[UP(e.fragment,t)])}}),hP({type:`textord`,names:[`\\@char`],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=eF(t[0],`ordgroup`).body,i=``,a=0;a=1114111)throw new Lj(`\\@char with invalid code point `+i);return s<=65535?c=String.fromCharCode(s):(s-=65536,c=String.fromCharCode((s>>10)+55296,(s&1023)+56320)),{type:`textord`,mode:n.mode,text:c}}});var _F=(e,t)=>{var n=wP(e.body,t.withColor(e.color),!1);return X.makeFragment(n)},vF=(e,t)=>{var n=VP(e.body,t.withColor(e.color)),r=new IP.MathNode(`mstyle`,n);return r.setAttribute(`mathcolor`,e.color),r};hP({type:`color`,names:[`\\textcolor`],props:{numArgs:2,allowedInText:!0,argTypes:[`color`,`original`]},handler(e,t){var{parser:n}=e,r=eF(t[0],`color-token`).color,i=t[1];return{type:`color`,mode:n.mode,color:r,body:vP(i)}},htmlBuilder:_F,mathmlBuilder:vF}),hP({type:`color`,names:[`\\color`],props:{numArgs:1,allowedInText:!0,argTypes:[`color`]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=eF(t[0],`color-token`).color;n.gullet.macros.set(`\\current@color`,i);var a=n.parseExpression(!0,r);return{type:`color`,mode:n.mode,color:i,body:a}},htmlBuilder:_F,mathmlBuilder:vF}),hP({type:`cr`,names:[`\\\\`],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i=r.gullet.future().text===`[`?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior(`newLineInDisplayMode`,`In LaTeX, \\\\ or \\newline does nothing in display mode`);return{type:`cr`,mode:r.mode,newLine:a,size:i&&eF(i,`size`).value}},htmlBuilder(e,t){var n=X.makeSpan([`mspace`],[],t);return e.newLine&&(n.classes.push(`newline`),e.size&&(n.style.marginTop=KM(GM(e.size,t)))),n},mathmlBuilder(e,t){var n=new IP.MathNode(`mspace`);return e.newLine&&(n.setAttribute(`linebreak`,`newline`),e.size&&n.setAttribute(`height`,KM(GM(e.size,t)))),n}});var yF={"\\global":`\\global`,"\\long":`\\\\globallong`,"\\\\globallong":`\\\\globallong`,"\\def":`\\gdef`,"\\gdef":`\\gdef`,"\\edef":`\\xdef`,"\\xdef":`\\xdef`,"\\let":`\\\\globallet`,"\\futurelet":`\\\\globalfuture`},bF=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Lj(`Expected a control sequence`,e);return t},xF=e=>{var t=e.gullet.popToken();return t.text===`=`&&(t=e.gullet.popToken(),t.text===` `&&(t=e.gullet.popToken())),t},SF=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i??=(n.noexpand=!0,{tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};hP({type:`internal`,names:[`\\global`,`\\long`,`\\\\globallong`],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(yF[r.text])return(n===`\\global`||n===`\\\\globallong`)&&(r.text=yF[r.text]),eF(t.parseFunction(),`internal`);throw new Lj(`Invalid token after macro prefix`,r)}}),hP({type:`internal`,names:[`\\def`,`\\gdef`,`\\edef`,`\\xdef`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new Lj(`Expected a control sequence`,r);for(var a=0,o,s=[[]];t.gullet.future().text!==`{`;)if(r=t.gullet.popToken(),r.text===`#`){if(t.gullet.future().text===`{`){o=t.gullet.future(),s[a].push(`{`);break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Lj(`Invalid argument number "`+r.text+`"`);if(parseInt(r.text)!==a+1)throw new Lj(`Argument number "`+r.text+`" out of order`);a++,s.push([])}else if(r.text===`EOF`)throw new Lj(`Expected a macro definition`);else s[a].push(r.text);var{tokens:c}=t.gullet.consumeArg();return o&&c.unshift(o),(n===`\\edef`||n===`\\xdef`)&&(c=t.gullet.expandTokens(c),c.reverse()),t.gullet.macros.set(i,{tokens:c,numArgs:a,delimiters:s},n===yF[n]),{type:`internal`,mode:t.mode}}}),hP({type:`internal`,names:[`\\let`,`\\\\globallet`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=bF(t.gullet.popToken());return t.gullet.consumeSpaces(),SF(t,r,xF(t),n===`\\\\globallet`),{type:`internal`,mode:t.mode}}}),hP({type:`internal`,names:[`\\futurelet`,`\\\\globalfuture`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=bF(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return SF(t,r,a,n===`\\\\globalfuture`),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:`internal`,mode:t.mode}}});var CF=function(e,t,n){var r=FM(uN.math[e]&&uN.math[e].replace||e,t,n);if(!r)throw Error(`Unsupported symbol `+e+` and font size `+t+`.`);return r},wF=function(e,t,n,r){var i=n.havingBaseStyle(t),a=X.makeSpan(r.concat(i.sizingClasses(n)),[e],n),o=i.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},TF=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push(`delimcenter`),e.style.top=KM(i),e.height-=i,e.depth+=i},EF=function(e,t,n,r,i,a){var o=wF(X.makeSymbol(e,`Main-Regular`,i,r),t,r,a);return n&&TF(o,r,t),o},DF=function(e,t,n,r){return X.makeSymbol(e,`Size`+t+`-Regular`,n,r)},OF=function(e,t,n,r,i,a){var o=DF(e,t,i,r),s=wF(X.makeSpan([`delimsizing`,`size`+t],[o],r),pM.TEXT,r,a);return n&&TF(s,r,pM.TEXT),s},kF=function(e,t,n){var r=t===`Size1-Regular`?`delim-size1`:`delim-size4`;return{type:`elem`,elem:X.makeSpan([`delimsizinginner`,r],[X.makeSpan([],[X.makeSymbol(e,t,n)])])}},AF=function(e,t,n){var r=jM[`Size4-Regular`][e.charCodeAt(0)]?jM[`Size4-Regular`][e.charCodeAt(0)][4]:jM[`Size1-Regular`][e.charCodeAt(0)][4],i=new rN([new iN(`inner`,DM(e,Math.round(1e3*t)))],{width:KM(r),height:KM(t),style:`width:`+KM(r),viewBox:`0 0 `+1e3*r+` `+Math.round(1e3*t),preserveAspectRatio:`xMinYMin`}),a=X.makeSvgSpan([],[i],n);return a.height=t,a.style.height=KM(t),a.style.width=KM(r),{type:`elem`,elem:a}},jF=.008,MF={type:`kern`,size:-1*jF},NF=[`|`,`\\lvert`,`\\rvert`,`\\vert`],PF=[`\\|`,`\\lVert`,`\\rVert`,`\\Vert`],FF=function(e,t,n,r,i,a){var o,s,c,l,u=``,d=0;o=c=l=e,s=null;var f=`Size1-Regular`;e===`\\uparrow`?c=l=`⏐`:e===`\\Uparrow`?c=l=`‖`:e===`\\downarrow`?o=c=`⏐`:e===`\\Downarrow`?o=c=`‖`:e===`\\updownarrow`?(o=`\\uparrow`,c=`⏐`,l=`\\downarrow`):e===`\\Updownarrow`?(o=`\\Uparrow`,c=`‖`,l=`\\Downarrow`):NF.includes(e)?(c=`∣`,u=`vert`,d=333):PF.includes(e)?(c=`∥`,u=`doublevert`,d=556):e===`[`||e===`\\lbrack`?(o=`⎡`,c=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lbrack`,d=667):e===`]`||e===`\\rbrack`?(o=`⎤`,c=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rbrack`,d=667):e===`\\lfloor`||e===`⌊`?(c=o=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lfloor`,d=667):e===`\\lceil`||e===`⌈`?(o=`⎡`,c=l=`⎢`,f=`Size4-Regular`,u=`lceil`,d=667):e===`\\rfloor`||e===`⌋`?(c=o=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rfloor`,d=667):e===`\\rceil`||e===`⌉`?(o=`⎤`,c=l=`⎥`,f=`Size4-Regular`,u=`rceil`,d=667):e===`(`||e===`\\lparen`?(o=`⎛`,c=`⎜`,l=`⎝`,f=`Size4-Regular`,u=`lparen`,d=875):e===`)`||e===`\\rparen`?(o=`⎞`,c=`⎟`,l=`⎠`,f=`Size4-Regular`,u=`rparen`,d=875):e===`\\{`||e===`\\lbrace`?(o=`⎧`,s=`⎨`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\}`||e===`\\rbrace`?(o=`⎫`,s=`⎬`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lgroup`||e===`⟮`?(o=`⎧`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\rgroup`||e===`⟯`?(o=`⎫`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lmoustache`||e===`⎰`?(o=`⎧`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):(e===`\\rmoustache`||e===`⎱`)&&(o=`⎫`,l=`⎩`,c=`⎪`,f=`Size4-Regular`);var p=CF(o,f,i),m=p.height+p.depth,h=CF(c,f,i),g=h.height+h.depth,_=CF(l,f,i),v=_.height+_.depth,y=0,b=1;if(s!==null){var x=CF(s,f,i);y=x.height+x.depth,b=2}var S=m+v+y,C=S+Math.max(0,Math.ceil((t-S)/(b*g)))*b*g,w=r.fontMetrics().axisHeight;n&&(w*=r.sizeMultiplier);var T=C/2-w,E=[];if(u.length>0){var D=C-m-v,O=Math.round(C*1e3),k=kM(u,Math.round(D*1e3)),A=new iN(u,k),ee=(d/1e3).toFixed(3)+`em`,te=(O/1e3).toFixed(3)+`em`,ne=new rN([A],{width:ee,height:te,viewBox:`0 0 `+d+` `+O}),j=X.makeSvgSpan([],[ne],r);j.height=O/1e3,j.style.width=ee,j.style.height=te,E.push({type:`elem`,elem:j})}else{if(E.push(kF(l,f,i)),E.push(MF),s===null){var re=C-m-v+2*jF;E.push(AF(c,re,r))}else{var M=(C-m-v-y)/2+2*jF;E.push(AF(c,M,r)),E.push(MF),E.push(kF(s,f,i)),E.push(MF),E.push(AF(c,M,r))}E.push(MF),E.push(kF(o,f,i))}var ie=r.havingBaseStyle(pM.TEXT),ae=X.makeVList({positionType:`bottom`,positionData:T,children:E},ie);return wF(X.makeSpan([`delimsizing`,`mult`],[ae],ie),pM.TEXT,r,a)},IF=80,LF=.08,RF=function(e,t,n,r,i){var a=new rN([new iN(e,EM(e,r,n))],{width:`400em`,height:KM(t),viewBox:`0 0 400000 `+n,preserveAspectRatio:`xMinYMin slice`});return X.makeSvgSpan([`hide-tail`],[a],i)},zF=function(e,t){var n=t.havingBaseSizing(),r=YF(`\\surd`,e*n.sizeMultiplier,qF,n),i=n.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,s=0,c=0,l=0,u;return r.type===`small`?(l=1e3+1e3*a+IF,e<1?i=1:e<1.4&&(i=.7),s=(1+a+LF)/i,c=(1+a)/i,o=RF(`sqrtMain`,s,l,a,t),o.style.minWidth=`0.853em`,u=.833/i):r.type===`large`?(l=(1e3+IF)*UF[r.size],c=(UF[r.size]+a)/i,s=(UF[r.size]+a+LF)/i,o=RF(`sqrtSize`+r.size,s,l,a,t),o.style.minWidth=`1.02em`,u=1/i):(s=e+a+LF,c=e+a,l=Math.floor(1e3*e+a)+IF,o=RF(`sqrtTall`,s,l,a,t),o.style.minWidth=`0.742em`,u=1.056),o.height=c,o.style.height=KM(s),{span:o,advanceWidth:u,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},BF=[`(`,`\\lparen`,`)`,`\\rparen`,`[`,`\\lbrack`,`]`,`\\rbrack`,`\\{`,`\\lbrace`,`\\}`,`\\rbrace`,`\\lfloor`,`\\rfloor`,`⌊`,`⌋`,`\\lceil`,`\\rceil`,`⌈`,`⌉`,`\\surd`],VF=[`\\uparrow`,`\\downarrow`,`\\updownarrow`,`\\Uparrow`,`\\Downarrow`,`\\Updownarrow`,`|`,`\\|`,`\\vert`,`\\Vert`,`\\lvert`,`\\rvert`,`\\lVert`,`\\rVert`,`\\lgroup`,`\\rgroup`,`⟮`,`⟯`,`\\lmoustache`,`\\rmoustache`,`⎰`,`⎱`],HF=[`<`,`>`,`\\langle`,`\\rangle`,`/`,`\\backslash`,`\\lt`,`\\gt`],UF=[0,1.2,1.8,2.4,3],WF=function(e,t,n,r,i){if(e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`),BF.includes(e)||HF.includes(e))return OF(e,t,!1,n,r,i);if(VF.includes(e))return FF(e,UF[t],!1,n,r,i);throw new Lj(`Illegal delimiter: '`+e+`'`)},GF=[{type:`small`,style:pM.SCRIPTSCRIPT},{type:`small`,style:pM.SCRIPT},{type:`small`,style:pM.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4}],KF=[{type:`small`,style:pM.SCRIPTSCRIPT},{type:`small`,style:pM.SCRIPT},{type:`small`,style:pM.TEXT},{type:`stack`}],qF=[{type:`small`,style:pM.SCRIPTSCRIPT},{type:`small`,style:pM.SCRIPT},{type:`small`,style:pM.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4},{type:`stack`}],JF=function(e){if(e.type===`small`)return`Main-Regular`;if(e.type===`large`)return`Size`+e.size+`-Regular`;if(e.type===`stack`)return`Size4-Regular`;throw Error(`Add support for delim type '`+e.type+`' here.`)},YF=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size);it)return n[i]}return n[n.length-1]},XF=function(e,t,n,r,i,a){e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`);var o=HF.includes(e)?GF:BF.includes(e)?qF:KF,s=YF(e,t,o,r);return s.type===`small`?EF(e,s.style,n,r,i,a):s.type===`large`?OF(e,s.size,n,r,i,a):FF(e,t,n,r,i,a)},ZF={sqrtImage:zF,sizedDelim:WF,sizeToMaxHeight:UF,customSizedDelim:XF,leftRightDelim:function(e,t,n,r,i,a){var o=r.fontMetrics().axisHeight*r.sizeMultiplier,s=901,c=5/r.fontMetrics().ptPerEm,l=Math.max(t-o,n+o);return XF(e,Math.max(l/500*s,2*l-c),!0,r,i,a)}},QF={"\\bigl":{mclass:`mopen`,size:1},"\\Bigl":{mclass:`mopen`,size:2},"\\biggl":{mclass:`mopen`,size:3},"\\Biggl":{mclass:`mopen`,size:4},"\\bigr":{mclass:`mclose`,size:1},"\\Bigr":{mclass:`mclose`,size:2},"\\biggr":{mclass:`mclose`,size:3},"\\Biggr":{mclass:`mclose`,size:4},"\\bigm":{mclass:`mrel`,size:1},"\\Bigm":{mclass:`mrel`,size:2},"\\biggm":{mclass:`mrel`,size:3},"\\Biggm":{mclass:`mrel`,size:4},"\\big":{mclass:`mord`,size:1},"\\Big":{mclass:`mord`,size:2},"\\bigg":{mclass:`mord`,size:3},"\\Bigg":{mclass:`mord`,size:4}},lte=`(,\\lparen,),\\rparen,[,\\lbrack,],\\rbrack,\\{,\\lbrace,\\},\\rbrace,\\lfloor,\\rfloor,⌊,⌋,\\lceil,\\rceil,⌈,⌉,<,>,\\langle,⟨,\\rangle,⟩,\\lt,\\gt,\\lvert,\\rvert,\\lVert,\\rVert,\\lgroup,\\rgroup,⟮,⟯,\\lmoustache,\\rmoustache,⎰,⎱,/,\\backslash,|,\\vert,\\|,\\Vert,\\uparrow,\\Uparrow,\\downarrow,\\Downarrow,\\updownarrow,\\Updownarrow,.`.split(`,`);function $F(e,t){var n=nF(e);if(n&<e.includes(n.text))return n;throw n?new Lj(`Invalid delimiter '`+n.text+`' after '`+t.funcName+`'`,e):new Lj(`Invalid delimiter type '`+e.type+`'`,e)}hP({type:`delimsizing`,names:[`\\bigl`,`\\Bigl`,`\\biggl`,`\\Biggl`,`\\bigr`,`\\Bigr`,`\\biggr`,`\\Biggr`,`\\bigm`,`\\Bigm`,`\\biggm`,`\\Biggm`,`\\big`,`\\Big`,`\\bigg`,`\\Bigg`],props:{numArgs:1,argTypes:[`primitive`]},handler:(e,t)=>{var n=$F(t[0],e);return{type:`delimsizing`,mode:e.parser.mode,size:QF[e.funcName].size,mclass:QF[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim===`.`?X.makeSpan([e.mclass]):ZF.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!==`.`&&t.push(LP(e.delim,e.mode));var n=new IP.MathNode(`mo`,t);e.mclass===`mopen`||e.mclass===`mclose`?n.setAttribute(`fence`,`true`):n.setAttribute(`fence`,`false`),n.setAttribute(`stretchy`,`true`);var r=KM(ZF.sizeToMaxHeight[e.size]);return n.setAttribute(`minsize`,r),n.setAttribute(`maxsize`,r),n}});function eI(e){if(!e.body)throw Error(`Bug: The leftright ParseNode wasn't fully parsed.`)}hP({type:`leftright-right`,names:[`\\right`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get(`\\current@color`);if(n&&typeof n!=`string`)throw new Lj(`\\current@color set to non-string in \\right`);return{type:`leftright-right`,mode:e.parser.mode,delim:$F(t[0],e).text,color:n}}}),hP({type:`leftright`,names:[`\\left`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=$F(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect(`\\right`,!1);var a=eF(r.parseFunction(),`leftright-right`);return{type:`leftright`,mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{eI(e);for(var n=wP(e.body,t,!0,[`mopen`,`mclose`]),r=0,i=0,a=!1,o=0;o{eI(e);var n=VP(e.body,t);if(e.left!==`.`){var r=new IP.MathNode(`mo`,[LP(e.left,e.mode)]);r.setAttribute(`fence`,`true`),n.unshift(r)}if(e.right!==`.`){var i=new IP.MathNode(`mo`,[LP(e.right,e.mode)]);i.setAttribute(`fence`,`true`),e.rightColor&&i.setAttribute(`mathcolor`,e.rightColor),n.push(i)}return RP(n)}}),hP({type:`middle`,names:[`\\middle`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=$F(t[0],e);if(!e.parser.leftrightDepth)throw new Lj(`\\middle without preceding \\left`,n);return{type:`middle`,mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if(e.delim===`.`)n=kP(t,[]);else{n=ZF.sizedDelim(e.delim,1,t,e.mode,[]);var r={delim:e.delim,options:t};n.isMiddle=r}return n},mathmlBuilder:(e,t)=>{var n=e.delim===`\\vert`||e.delim===`|`?LP(`|`,`text`):LP(e.delim,e.mode),r=new IP.MathNode(`mo`,[n]);return r.setAttribute(`fence`,`true`),r.setAttribute(`lspace`,`0.05em`),r.setAttribute(`rspace`,`0.05em`),r}});var tI=(e,t)=>{var n=X.wrapFragment(AP(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o=0,s=qj.isCharacterBox(e.body);if(r===`sout`)a=X.makeSpan([`stretchy`,`sout`]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(r===`phase`){var c=GM({number:.6,unit:`pt`},t),l=GM({number:.35,unit:`ex`},t),u=t.havingBaseSizing();i/=u.sizeMultiplier;var d=n.height+n.depth+c+l;n.style.paddingLeft=KM(d/2+c);var f=Math.floor(1e3*d*i),p=new rN([new iN(`phase`,wM(f))],{width:`400em`,height:KM(f/1e3),viewBox:`0 0 400000 `+f,preserveAspectRatio:`xMinYMin slice`});a=X.makeSvgSpan([`hide-tail`],[p],t),a.style.height=KM(d),o=n.depth+c+l}else{/cancel/.test(r)?s||n.classes.push(`cancel-pad`):r===`angl`?n.classes.push(`anglpad`):n.classes.push(`boxpad`);var m=0,h=0,g=0;/box/.test(r)?(g=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),m=t.fontMetrics().fboxsep+(r===`colorbox`?0:g),h=m):r===`angl`?(g=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),m=4*g,h=Math.max(0,.25-n.depth)):(m=s?.2:0,h=m),a=$P.encloseSpan(n,r,m,h,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle=`solid`,a.style.borderWidth=KM(g)):r===`angl`&&g!==.049&&(a.style.borderTopWidth=KM(g),a.style.borderRightWidth=KM(g)),o=n.depth+h,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var _;if(e.backgroundColor)_=X.makeVList({positionType:`individualShift`,children:[{type:`elem`,elem:a,shift:o},{type:`elem`,elem:n,shift:0}]},t);else{var v=/cancel|phase/.test(r)?[`svg-align`]:[];_=X.makeVList({positionType:`individualShift`,children:[{type:`elem`,elem:n,shift:0},{type:`elem`,elem:a,shift:o,wrapperClasses:v}]},t)}return/cancel/.test(r)&&(_.height=n.height,_.depth=n.depth),/cancel/.test(r)&&!s?X.makeSpan([`mord`,`cancel-lap`],[_],t):X.makeSpan([`mord`],[_],t)},nI=(e,t)=>{var n=0,r=new IP.MathNode(e.label.indexOf(`colorbox`)>-1?`mpadded`:`menclose`,[UP(e.body,t)]);switch(e.label){case`\\cancel`:r.setAttribute(`notation`,`updiagonalstrike`);break;case`\\bcancel`:r.setAttribute(`notation`,`downdiagonalstrike`);break;case`\\phase`:r.setAttribute(`notation`,`phasorangle`);break;case`\\sout`:r.setAttribute(`notation`,`horizontalstrike`);break;case`\\fbox`:r.setAttribute(`notation`,`box`);break;case`\\angl`:r.setAttribute(`notation`,`actuarial`);break;case`\\fcolorbox`:case`\\colorbox`:if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute(`width`,`+`+2*n+`pt`),r.setAttribute(`height`,`+`+2*n+`pt`),r.setAttribute(`lspace`,n+`pt`),r.setAttribute(`voffset`,n+`pt`),e.label===`\\fcolorbox`){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute(`style`,`border: `+i+`em solid `+String(e.borderColor))}break;case`\\xcancel`:r.setAttribute(`notation`,`updiagonalstrike downdiagonalstrike`);break}return e.backgroundColor&&r.setAttribute(`mathbackground`,e.backgroundColor),r};hP({type:`enclose`,names:[`\\colorbox`],props:{numArgs:2,allowedInText:!0,argTypes:[`color`,`text`]},handler(e,t,n){var{parser:r,funcName:i}=e,a=eF(t[0],`color-token`).color,o=t[1];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:tI,mathmlBuilder:nI}),hP({type:`enclose`,names:[`\\fcolorbox`],props:{numArgs:3,allowedInText:!0,argTypes:[`color`,`color`,`text`]},handler(e,t,n){var{parser:r,funcName:i}=e,a=eF(t[0],`color-token`).color,o=eF(t[1],`color-token`).color,s=t[2];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:s}},htmlBuilder:tI,mathmlBuilder:nI}),hP({type:`enclose`,names:[`\\fbox`],props:{numArgs:1,argTypes:[`hbox`],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`enclose`,mode:n.mode,label:`\\fbox`,body:t[0]}}}),hP({type:`enclose`,names:[`\\cancel`,`\\bcancel`,`\\xcancel`,`\\sout`,`\\phase`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}},htmlBuilder:tI,mathmlBuilder:nI}),hP({type:`enclose`,names:[`\\angl`],props:{numArgs:1,argTypes:[`hbox`],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:`enclose`,mode:n.mode,label:`\\angl`,body:t[0]}}});var rI={};function iI(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},c=0;c{if(!e.parser.settings.displayMode)throw new Lj(`{`+e.envName+`} can be used only in display mode.`)};function cI(e){if(e.indexOf(`ed`)===-1)return e.indexOf(`*`)===-1}function lI(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:a,arraystretch:o,colSeparationType:s,autoTag:c,singleRow:l,emptySingleRow:u,maxNumCols:d,leqno:f}=t;if(e.gullet.beginGroup(),l||e.gullet.macros.set(`\\cr`,`\\\\\\relax`),!o){var p=e.gullet.expandMacroAsText(`\\arraystretch`);if(p==null)o=1;else if(o=parseFloat(p),!o||o<0)throw new Lj(`Invalid \\arraystretch: `+p)}e.gullet.beginGroup();var m=[],h=[m],g=[],_=[],v=c==null?void 0:[];function y(){c&&e.gullet.macros.set(`\\@eqnsw`,`1`,!0)}function b(){v&&(e.gullet.macros.get(`\\df@tag`)?(v.push(e.subparse([new Ij(`\\df@tag`)])),e.gullet.macros.set(`\\df@tag`,void 0,!0)):v.push(!!c&&e.gullet.macros.get(`\\@eqnsw`)===`1`))}for(y(),_.push(oI(e));;){var x=e.parseExpression(!1,l?`\\end`:`\\\\`);e.gullet.endGroup(),e.gullet.beginGroup(),x={type:`ordgroup`,mode:e.mode,body:x},n&&(x={type:`styling`,mode:e.mode,style:n,body:[x]}),m.push(x);var S=e.fetch().text;if(S===`&`){if(d&&m.length===d){if(l||s)throw new Lj(`Too many tab characters: &`,e.nextToken);e.settings.reportNonstrict(`textEnv`,`Too few columns specified in the {array} column argument.`)}e.consume()}else if(S===`\\end`){b(),m.length===1&&x.type===`styling`&&x.body[0].body.length===0&&(h.length>1||!u)&&h.pop(),_.length0&&(_+=.25),c.push({pos:_,isDashed:e[t]})}for(v(a[0]),n=0;n0&&(T+=g,xe))for(n=0;n=o)){var ce=void 0;(r>0||e.hskipBeforeAndAfter)&&(ce=qj.deflt(M.pregap,d),ce!==0&&(k=X.makeSpan([`arraycolsep`],[]),k.style.width=KM(ce),O.push(k)));var le=[];for(n=0;n0){for(var pe=X.makeLineSpan(`hline`,t,l),me=X.makeLineSpan(`hdashline`,t,l),he=[{type:`elem`,elem:s,shift:0}];c.length>0;){var ge=c.pop(),_e=ge.pos-E;ge.isDashed?he.push({type:`elem`,elem:me,shift:_e}):he.push({type:`elem`,elem:pe,shift:_e})}s=X.makeVList({positionType:`individualShift`,children:he},t)}if(ee.length===0)return X.makeSpan([`mord`],[s],t);var ve=X.makeVList({positionType:`individualShift`,children:ee},t);return ve=X.makeSpan([`tag`],[ve],t),X.makeFragment([s,ve])},ute={c:`center `,l:`left `,r:`right `},fI=function(e,t){for(var n=[],r=new IP.MathNode(`mtd`,[],[`mtr-glue`]),i=new IP.MathNode(`mtd`,[],[`mml-eqn-num`]),a=0;a0){var p=e.cols,m=``,h=!1,g=0,_=p.length;p[0].type===`separator`&&(d+=`top `,g=1),p[p.length-1].type===`separator`&&(d+=`bottom `,--_);for(var v=g;v<_;v++)p[v].type===`align`?(f+=ute[p[v].align],h&&(m+=`none `),h=!0):p[v].type===`separator`&&(h&&=(m+=p[v].separator===`|`?`solid `:`dashed `,!1));l.setAttribute(`columnalign`,f.trim()),/[sd]/.test(m)&&l.setAttribute(`columnlines`,m.trim())}if(e.colSeparationType===`align`){for(var y=e.cols||[],b=``,x=1;x0?`left `:``,d+=C[C.length-1].length>0?`right `:``;for(var w=1;w-1?`alignat`:`align`,i=e.envName===`split`,a=lI(e.parser,{cols:n,addJot:!0,autoTag:i?void 0:cI(e.envName),emptySingleRow:!0,colSeparationType:r,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},`display`),o,s=0,c={type:`ordgroup`,mode:e.mode,body:[]};if(t[0]&&t[0].type===`ordgroup`){for(var l=``,u=0;u0&&f&&(h=1),n[p]={type:`align`,align:m,pregap:h,postgap:0}}return a.colSeparationType=f?`align`:`alignat`,a};iI({type:`array`,names:[`array`,`darray`],props:{numArgs:1},handler(e,t){var n=(nF(t[0])?[t[0]]:eF(t[0],`ordgroup`).body).map(function(e){var t=tF(e).text;if(`lcr`.indexOf(t)!==-1)return{type:`align`,align:t};if(t===`|`)return{type:`separator`,separator:`|`};if(t===`:`)return{type:`separator`,separator:`:`};throw new Lj(`Unknown column alignment: `+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return lI(e.parser,r,uI(e.envName))},htmlBuilder:dI,mathmlBuilder:fI}),iI({type:`array`,names:[`matrix`,`pmatrix`,`bmatrix`,`Bmatrix`,`vmatrix`,`Vmatrix`,`matrix*`,`pmatrix*`,`bmatrix*`,`Bmatrix*`,`vmatrix*`,`Vmatrix*`],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:[`(`,`)`],bmatrix:[`[`,`]`],Bmatrix:[`\\{`,`\\}`],vmatrix:[`|`,`|`],Vmatrix:[`\\Vert`,`\\Vert`]}[e.envName.replace(`*`,``)],n=`c`,r={hskipBeforeAndAfter:!1,cols:[{type:`align`,align:n}]};if(e.envName.charAt(e.envName.length-1)===`*`){var i=e.parser;if(i.consumeSpaces(),i.fetch().text===`[`){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,`lcr`.indexOf(n)===-1)throw new Lj(`Expected l or c or r`,i.nextToken);i.consume(),i.consumeSpaces(),i.expect(`]`),i.consume(),r.cols=[{type:`align`,align:n}]}}var a=lI(e.parser,r,uI(e.envName)),o=Math.max(0,...a.body.map(e=>e.length));return a.cols=Array(o).fill({type:`align`,align:n}),t?{type:`leftright`,mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:dI,mathmlBuilder:fI}),iI({type:`array`,names:[`smallmatrix`],props:{numArgs:0},handler(e){var t=lI(e.parser,{arraystretch:.5},`script`);return t.colSeparationType=`small`,t},htmlBuilder:dI,mathmlBuilder:fI}),iI({type:`array`,names:[`subarray`],props:{numArgs:1},handler(e,t){var n=(nF(t[0])?[t[0]]:eF(t[0],`ordgroup`).body).map(function(e){var t=tF(e).text;if(`lc`.indexOf(t)!==-1)return{type:`align`,align:t};throw new Lj(`Unknown column alignment: `+t,e)});if(n.length>1)throw new Lj(`{subarray} can contain only one column`);var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if(r=lI(e.parser,r,`script`),r.body.length>0&&r.body[0].length>1)throw new Lj(`{subarray} can contain only one column`);return r},htmlBuilder:dI,mathmlBuilder:fI}),iI({type:`array`,names:[`cases`,`dcases`,`rcases`,`drcases`],props:{numArgs:0},handler(e){var t=lI(e.parser,{arraystretch:1.2,cols:[{type:`align`,align:`l`,pregap:0,postgap:1},{type:`align`,align:`l`,pregap:0,postgap:0}]},uI(e.envName));return{type:`leftright`,mode:e.mode,body:[t],left:e.envName.indexOf(`r`)>-1?`.`:`\\{`,right:e.envName.indexOf(`r`)>-1?`\\}`:`.`,rightColor:void 0}},htmlBuilder:dI,mathmlBuilder:fI}),iI({type:`array`,names:[`align`,`align*`,`aligned`,`split`],props:{numArgs:0},handler:pI,htmlBuilder:dI,mathmlBuilder:fI}),iI({type:`array`,names:[`gathered`,`gather`,`gather*`],props:{numArgs:0},handler(e){[`gather`,`gather*`].includes(e.envName)&&sI(e);var t={cols:[{type:`align`,align:`c`}],addJot:!0,colSeparationType:`gather`,autoTag:cI(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return lI(e.parser,t,`display`)},htmlBuilder:dI,mathmlBuilder:fI}),iI({type:`array`,names:[`alignat`,`alignat*`,`alignedat`],props:{numArgs:1},handler:pI,htmlBuilder:dI,mathmlBuilder:fI}),iI({type:`array`,names:[`equation`,`equation*`],props:{numArgs:0},handler(e){sI(e);var t={autoTag:cI(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return lI(e.parser,t,`display`)},htmlBuilder:dI,mathmlBuilder:fI}),iI({type:`array`,names:[`CD`],props:{numArgs:0},handler(e){return sI(e),gF(e.parser)},htmlBuilder:dI,mathmlBuilder:fI}),Z(`\\nonumber`,`\\gdef\\@eqnsw{0}`),Z(`\\notag`,`\\nonumber`),hP({type:`text`,names:[`\\hline`,`\\hdashline`],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new Lj(e.funcName+` valid only within array environment`)}});var mI=rI;hP({type:`environment`,names:[`\\begin`,`\\end`],props:{numArgs:1,argTypes:[`text`]},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if(i.type!==`ordgroup`)throw new Lj(`Invalid environment name`,i);for(var a=``,o=0;o{var n=e.font,r=t.withFont(n);return AP(e.body,r)},gI=(e,t)=>{var n=e.font,r=t.withFont(n);return UP(e.body,r)},_I={"\\Bbb":`\\mathbb`,"\\bold":`\\mathbf`,"\\frak":`\\mathfrak`,"\\bm":`\\boldsymbol`};hP({type:`font`,names:[`\\mathrm`,`\\mathit`,`\\mathbf`,`\\mathnormal`,`\\mathsfit`,`\\mathbb`,`\\mathcal`,`\\mathfrak`,`\\mathscr`,`\\mathsf`,`\\mathtt`,`\\Bbb`,`\\bold`,`\\frak`],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=_P(t[0]),a=r;return a in _I&&(a=_I[a]),{type:`font`,mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:hI,mathmlBuilder:gI}),hP({type:`mclass`,names:[`\\boldsymbol`,`\\bm`],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0],i=qj.isCharacterBox(r);return{type:`mclass`,mode:n.mode,mclass:uF(r),body:[{type:`font`,mode:n.mode,font:`boldsymbol`,body:r}],isCharacterBox:i}}}),hP({type:`font`,names:[`\\rm`,`\\sf`,`\\tt`,`\\bf`,`\\it`,`\\cal`],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:a}=n,o=n.parseExpression(!0,i);return{type:`font`,mode:a,font:`math`+r.slice(1),body:{type:`ordgroup`,mode:n.mode,body:o}}},htmlBuilder:hI,mathmlBuilder:gI});var vI=(e,t)=>{var n=t;return e===`display`?n=n.id>=pM.SCRIPT.id?n.text():pM.DISPLAY:e===`text`&&n.size===pM.DISPLAY.size?n=pM.TEXT:e===`script`?n=pM.SCRIPT:e===`scriptscript`&&(n=pM.SCRIPTSCRIPT),n},yI=(e,t)=>{var n=vI(e.size,t.style),r=n.fracNum(),i=n.fracDen(),a=t.havingStyle(r),o=AP(e.numer,a,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,c=3.5/t.fontMetrics().ptPerEm;o.height=o.height0?3*f:7*f,h=t.fontMetrics().denom1):(d>0?(p=t.fontMetrics().num2,m=f):(p=t.fontMetrics().num3,m=3*f),h=t.fontMetrics().denom2);var g;if(u){var _=t.fontMetrics().axisHeight;p-o.depth-(_+.5*d){var n=new IP.MathNode(`mfrac`,[UP(e.numer,t),UP(e.denom,t)]);if(!e.hasBarLine)n.setAttribute(`linethickness`,`0px`);else if(e.barSize){var r=GM(e.barSize,t);n.setAttribute(`linethickness`,KM(r))}var i=vI(e.size,t.style);if(i.size!==t.style.size){n=new IP.MathNode(`mstyle`,[n]);var a=i.size===pM.DISPLAY.size?`true`:`false`;n.setAttribute(`displaystyle`,a),n.setAttribute(`scriptlevel`,`0`)}if(e.leftDelim!=null||e.rightDelim!=null){var o=[];if(e.leftDelim!=null){var s=new IP.MathNode(`mo`,[new IP.TextNode(e.leftDelim.replace(`\\`,``))]);s.setAttribute(`fence`,`true`),o.push(s)}if(o.push(n),e.rightDelim!=null){var c=new IP.MathNode(`mo`,[new IP.TextNode(e.rightDelim.replace(`\\`,``))]);c.setAttribute(`fence`,`true`),o.push(c)}return RP(o)}return n};hP({type:`genfrac`,names:[`\\dfrac`,`\\frac`,`\\tfrac`,`\\dbinom`,`\\binom`,`\\tbinom`,`\\\\atopfrac`,`\\\\bracefrac`,`\\\\brackfrac`],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=t[1],o,s=null,c=null,l=`auto`;switch(r){case`\\dfrac`:case`\\frac`:case`\\tfrac`:o=!0;break;case`\\\\atopfrac`:o=!1;break;case`\\dbinom`:case`\\binom`:case`\\tbinom`:o=!1,s=`(`,c=`)`;break;case`\\\\bracefrac`:o=!1,s=`\\{`,c=`\\}`;break;case`\\\\brackfrac`:o=!1,s=`[`,c=`]`;break;default:throw Error(`Unrecognized genfrac command`)}switch(r){case`\\dfrac`:case`\\dbinom`:l=`display`;break;case`\\tfrac`:case`\\tbinom`:l=`text`;break}return{type:`genfrac`,mode:n.mode,continued:!1,numer:i,denom:a,hasBarLine:o,leftDelim:s,rightDelim:c,size:l,barSize:null}},htmlBuilder:yI,mathmlBuilder:bI}),hP({type:`genfrac`,names:[`\\cfrac`],props:{numArgs:2},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=t[1];return{type:`genfrac`,mode:n.mode,continued:!0,numer:i,denom:a,hasBarLine:!0,leftDelim:null,rightDelim:null,size:`display`,barSize:null}}}),hP({type:`infix`,names:[`\\over`,`\\choose`,`\\atop`,`\\brace`,`\\brack`],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:r}=e,i;switch(n){case`\\over`:i=`\\frac`;break;case`\\choose`:i=`\\binom`;break;case`\\atop`:i=`\\\\atopfrac`;break;case`\\brace`:i=`\\\\bracefrac`;break;case`\\brack`:i=`\\\\brackfrac`;break;default:throw Error(`Unrecognized infix genfrac command`)}return{type:`infix`,mode:t.mode,replaceWith:i,token:r}}});var xI=[`display`,`text`,`script`,`scriptscript`],SI=function(e){var t=null;return e.length>0&&(t=e,t=t===`.`?null:t),t};hP({type:`genfrac`,names:[`\\genfrac`],props:{numArgs:6,allowedInArgument:!0,argTypes:[`math`,`math`,`size`,`text`,`math`,`math`]},handler(e,t){var{parser:n}=e,r=t[4],i=t[5],a=_P(t[0]),o=a.type===`atom`&&a.family===`open`?SI(a.text):null,s=_P(t[1]),c=s.type===`atom`&&s.family===`close`?SI(s.text):null,l=eF(t[2],`size`),u,d=null;l.isBlank?u=!0:(d=l.value,u=d.number>0);var f=`auto`,p=t[3];if(p.type===`ordgroup`){if(p.body.length>0){var m=eF(p.body[0],`textord`);f=xI[Number(m.text)]}}else p=eF(p,`textord`),f=xI[Number(p.text)];return{type:`genfrac`,mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:u,barSize:d,leftDelim:o,rightDelim:c,size:f}},htmlBuilder:yI,mathmlBuilder:bI}),hP({type:`infix`,names:[`\\above`],props:{numArgs:1,argTypes:[`size`],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:`infix`,mode:n.mode,replaceWith:`\\\\abovefrac`,size:eF(t[0],`size`).value,token:i}}}),hP({type:`genfrac`,names:[`\\\\abovefrac`],props:{numArgs:3,argTypes:[`math`,`size`,`math`]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=Kj(eF(t[1],`infix`).size),o=t[2],s=a.number>0;return{type:`genfrac`,mode:n.mode,numer:i,denom:o,continued:!1,hasBarLine:s,barSize:a,leftDelim:null,rightDelim:null,size:`auto`}},htmlBuilder:yI,mathmlBuilder:bI});var CI=(e,t)=>{var n=t.style,r,i;e.type===`supsub`?(r=e.sup?AP(e.sup,t.havingStyle(n.sup()),t):AP(e.sub,t.havingStyle(n.sub()),t),i=eF(e.base,`horizBrace`)):i=eF(e,`horizBrace`);var a=AP(i.base,t.havingBaseStyle(pM.DISPLAY)),o=$P.svgSpan(i,t),s;if(i.isOver?(s=X.makeVList({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:.1},{type:`elem`,elem:o}]},t),s.children[0].children[0].children[1].classes.push(`svg-align`)):(s=X.makeVList({positionType:`bottom`,positionData:a.depth+.1+o.height,children:[{type:`elem`,elem:o},{type:`kern`,size:.1},{type:`elem`,elem:a}]},t),s.children[0].children[0].children[0].classes.push(`svg-align`)),r){var c=X.makeSpan([`mord`,i.isOver?`mover`:`munder`],[s],t);s=i.isOver?X.makeVList({positionType:`firstBaseline`,children:[{type:`elem`,elem:c},{type:`kern`,size:.2},{type:`elem`,elem:r}]},t):X.makeVList({positionType:`bottom`,positionData:c.depth+.2+r.height+r.depth,children:[{type:`elem`,elem:r},{type:`kern`,size:.2},{type:`elem`,elem:c}]},t)}return X.makeSpan([`mord`,i.isOver?`mover`:`munder`],[s],t)};hP({type:`horizBrace`,names:[`\\overbrace`,`\\underbrace`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:`horizBrace`,mode:n.mode,label:r,isOver:/^\\over/.test(r),base:t[0]}},htmlBuilder:CI,mathmlBuilder:(e,t)=>{var n=$P.mathMLnode(e.label);return new IP.MathNode(e.isOver?`mover`:`munder`,[UP(e.base,t),n])}}),hP({type:`href`,names:[`\\href`],props:{numArgs:2,argTypes:[`url`,`original`],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=eF(t[0],`url`).url;return n.settings.isTrusted({command:`\\href`,url:i})?{type:`href`,mode:n.mode,href:i,body:vP(r)}:n.formatUnsupportedCmd(`\\href`)},htmlBuilder:(e,t)=>{var n=wP(e.body,t,!1);return X.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=HP(e.body,t);return n instanceof PP||(n=new PP(`mrow`,[n])),n.setAttribute(`href`,e.href),n}}),hP({type:`href`,names:[`\\url`],props:{numArgs:1,argTypes:[`url`],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=eF(t[0],`url`).url;if(!n.settings.isTrusted({command:`\\url`,url:r}))return n.formatUnsupportedCmd(`\\url`);for(var i=[],a=0;a{var{parser:n,funcName:r,token:i}=e,a=eF(t[0],`raw`).string,o=t[1];n.settings.strict&&n.settings.reportNonstrict(`htmlExtension`,`HTML extension is disabled on strict mode`);var s,c={};switch(r){case`\\htmlClass`:c.class=a,s={command:`\\htmlClass`,class:a};break;case`\\htmlId`:c.id=a,s={command:`\\htmlId`,id:a};break;case`\\htmlStyle`:c.style=a,s={command:`\\htmlStyle`,style:a};break;case`\\htmlData`:for(var l=a.split(`,`),u=0;u{var n=wP(e.body,t,!1),r=[`enclosing`];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=X.makeSpan(r,n,t);for(var a in e.attributes)a!==`class`&&e.attributes.hasOwnProperty(a)&&i.setAttribute(a,e.attributes[a]);return i},mathmlBuilder:(e,t)=>HP(e.body,t)}),hP({type:`htmlmathml`,names:[`\\html@mathml`],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:`htmlmathml`,mode:n.mode,html:vP(t[0]),mathml:vP(t[1])}},htmlBuilder:(e,t)=>{var n=wP(e.html,t,!1);return X.makeFragment(n)},mathmlBuilder:(e,t)=>HP(e.mathml,t)});var wI=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:`bp`};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new Lj(`Invalid size: '`+e+`' in \\includegraphics`);var n={number:+(t[1]+t[2]),unit:t[3]};if(!WM(n))throw new Lj(`Invalid unit: '`+n.unit+`' in \\includegraphics.`);return n};hP({type:`includegraphics`,names:[`\\includegraphics`],props:{numArgs:1,numOptionalArgs:1,argTypes:[`raw`,`url`],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:`em`},a={number:.9,unit:`em`},o={number:0,unit:`em`},s=``;if(n[0])for(var c=eF(n[0],`raw`).string.split(`,`),l=0;l{var n=GM(e.height,t),r=0;e.totalheight.number>0&&(r=GM(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=GM(e.width,t));var a={height:KM(n+r)};i>0&&(a.width=KM(i)),r>0&&(a.verticalAlign=KM(-r));var o=new eN(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new IP.MathNode(`mglyph`,[]);n.setAttribute(`alt`,e.alt);var r=GM(e.height,t),i=0;if(e.totalheight.number>0&&(i=GM(e.totalheight,t)-r,n.setAttribute(`valign`,KM(-i))),n.setAttribute(`height`,KM(r+i)),e.width.number>0){var a=GM(e.width,t);n.setAttribute(`width`,KM(a))}return n.setAttribute(`src`,e.src),n}}),hP({type:`kern`,names:[`\\kern`,`\\mkern`,`\\hskip`,`\\mskip`],props:{numArgs:1,argTypes:[`size`],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=eF(t[0],`size`);if(n.settings.strict){var a=r[1]===`m`,o=i.value.unit===`mu`;a?(o||n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` supports only mu units, `+(`not `+i.value.unit+` units`)),n.mode!==`math`&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` works only in math mode`)):o&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` doesn't support mu units`)}return{type:`kern`,mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return X.makeGlue(e.dimension,t)},mathmlBuilder(e,t){var n=GM(e.dimension,t);return new IP.SpaceNode(n)}}),hP({type:`lap`,names:[`\\mathllap`,`\\mathrlap`,`\\mathclap`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`lap`,mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment===`clap`?(n=X.makeSpan([],[AP(e.body,t)]),n=X.makeSpan([`inner`],[n],t)):n=X.makeSpan([`inner`],[AP(e.body,t)]);var r=X.makeSpan([`fix`],[]),i=X.makeSpan([e.alignment],[n,r],t),a=X.makeSpan([`strut`]);return a.style.height=KM(i.height+i.depth),i.depth&&(a.style.verticalAlign=KM(-i.depth)),i.children.unshift(a),i=X.makeSpan([`thinbox`],[i],t),X.makeSpan([`mord`,`vbox`],[i],t)},mathmlBuilder:(e,t)=>{var n=new IP.MathNode(`mpadded`,[UP(e.body,t)]);if(e.alignment!==`rlap`){var r=e.alignment===`llap`?`-1`:`-0.5`;n.setAttribute(`lspace`,r+`width`)}return n.setAttribute(`width`,`0px`),n}}),hP({type:`styling`,names:[`\\(`,`$`],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode(`math`);var a=n===`\\(`?`\\)`:`$`,o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:`styling`,mode:r.mode,style:`text`,body:o}}}),hP({type:`text`,names:[`\\)`,`\\]`],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new Lj(`Mismatched `+e.funcName)}});var TI=(e,t)=>{switch(t.style.size){case pM.DISPLAY.size:return e.display;case pM.TEXT.size:return e.text;case pM.SCRIPT.size:return e.script;case pM.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};hP({type:`mathchoice`,names:[`\\mathchoice`],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:`mathchoice`,mode:n.mode,display:vP(t[0]),text:vP(t[1]),script:vP(t[2]),scriptscript:vP(t[3])}},htmlBuilder:(e,t)=>{var n=wP(TI(e,t),t,!1);return X.makeFragment(n)},mathmlBuilder:(e,t)=>HP(TI(e,t),t)});var EI=(e,t,n,r,i,a,o)=>{e=X.makeSpan([],[e]);var s=n&&qj.isCharacterBox(n),c,l;if(t){var u=AP(t,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=AP(n,r.havingStyle(i.sub()),r);c={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var f;if(l&&c){var p=r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+o;f=X.makeVList({positionType:`bottom`,positionData:p,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:KM(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:KM(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]},r)}else if(c){var m=e.height-o;f=X.makeVList({positionType:`top`,positionData:m,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:KM(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e}]},r)}else if(l){var h=e.depth+o;f=X.makeVList({positionType:`bottom`,positionData:h,children:[{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:KM(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]},r)}else return e;var g=[f];if(c&&a!==0&&!s){var _=X.makeSpan([`mspace`],[],r);_.style.marginRight=KM(a),g.unshift(_)}return X.makeSpan([`mop`,`op-limits`],g,r)},DI=[`\\smallint`],OI=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=eF(e.base,`op`),i=!0):a=eF(e,`op`);var o=t.style,s=!1;o.size===pM.DISPLAY.size&&a.symbol&&!DI.includes(a.name)&&(s=!0);var c;if(a.symbol){var l=s?`Size2-Regular`:`Size1-Regular`,u=``;if((a.name===`\\oiint`||a.name===`\\oiiint`)&&(u=a.name.slice(1),a.name=u===`oiint`?`\\iint`:`\\iiint`),c=X.makeSymbol(a.name,l,`math`,t,[`mop`,`op-symbol`,s?`large-op`:`small-op`]),u.length>0){var d=c.italic,f=X.staticSvg(u+`Size`+(s?`2`:`1`),t);c=X.makeVList({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:0},{type:`elem`,elem:f,shift:s?.08:0}]},t),a.name=`\\`+u,c.classes.unshift(`mop`),c.italic=d}}else if(a.body){var p=wP(a.body,t,!0);p.length===1&&p[0]instanceof nN?(c=p[0],c.classes[0]=`mop`):c=X.makeSpan([`mop`],p,t)}else{for(var m=[],h=1;h{var n;if(e.symbol)n=new PP(`mo`,[LP(e.name,e.mode)]),DI.includes(e.name)&&n.setAttribute(`largeop`,`false`);else if(e.body)n=new PP(`mo`,VP(e.body,t));else{n=new PP(`mi`,[new FP(e.name.slice(1))]);var r=new PP(`mo`,[LP(`⁡`,`text`)]);n=e.parentIsSupSub?new PP(`mrow`,[n,r]):NP([n,r])}return n},dte={"∏":`\\prod`,"∐":`\\coprod`,"∑":`\\sum`,"⋀":`\\bigwedge`,"⋁":`\\bigvee`,"⋂":`\\bigcap`,"⋃":`\\bigcup`,"⨀":`\\bigodot`,"⨁":`\\bigoplus`,"⨂":`\\bigotimes`,"⨄":`\\biguplus`,"⨆":`\\bigsqcup`};hP({type:`op`,names:`\\coprod.\\bigvee.\\bigwedge.\\biguplus.\\bigcap.\\bigcup.\\intop.\\prod.\\sum.\\bigotimes.\\bigoplus.\\bigodot.\\bigsqcup.\\smallint.∏.∐.∑.⋀.⋁.⋂.⋃.⨀.⨁.⨂.⨄.⨆`.split(`.`),props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return i.length===1&&(i=dte[i]),{type:`op`,mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:OI,mathmlBuilder:kI}),hP({type:`op`,names:[`\\mathop`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`op`,mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:vP(r)}},htmlBuilder:OI,mathmlBuilder:kI});var fte={"∫":`\\int`,"∬":`\\iint`,"∭":`\\iiint`,"∮":`\\oint`,"∯":`\\oiint`,"∰":`\\oiiint`};hP({type:`op`,names:`\\arcsin.\\arccos.\\arctan.\\arctg.\\arcctg.\\arg.\\ch.\\cos.\\cosec.\\cosh.\\cot.\\cotg.\\coth.\\csc.\\ctg.\\cth.\\deg.\\dim.\\exp.\\hom.\\ker.\\lg.\\ln.\\log.\\sec.\\sin.\\sinh.\\sh.\\tan.\\tanh.\\tg.\\th`.split(`.`),props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:OI,mathmlBuilder:kI}),hP({type:`op`,names:[`\\det`,`\\gcd`,`\\inf`,`\\lim`,`\\max`,`\\min`,`\\Pr`,`\\sup`],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:`op`,mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:OI,mathmlBuilder:kI}),hP({type:`op`,names:[`\\int`,`\\iint`,`\\iiint`,`\\oint`,`\\oiint`,`\\oiiint`,`∫`,`∬`,`∭`,`∮`,`∯`,`∰`],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=fte[r]),{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:OI,mathmlBuilder:kI});var AI=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=eF(e.base,`operatorname`),i=!0):a=eF(e,`operatorname`);var o;if(a.body.length>0){for(var s=wP(a.body.map(e=>{var t=e.text;return typeof t==`string`?{type:`textord`,mode:e.mode,text:t}:e}),t.withFont(`mathrm`),!0),c=0;c{var{parser:n,funcName:r}=e,i=t[0];return{type:`operatorname`,mode:n.mode,body:vP(i),alwaysHandleSupSub:r===`\\operatornamewithlimits`,limits:!1,parentIsSupSub:!1}},htmlBuilder:AI,mathmlBuilder:(e,t)=>{for(var n=VP(e.body,t.withFont(`mathrm`)),r=!0,i=0;ie.toText()).join(``);n=[new IP.TextNode(s)]}var c=new IP.MathNode(`mi`,n);c.setAttribute(`mathvariant`,`normal`);var l=new IP.MathNode(`mo`,[LP(`⁡`,`text`)]);return e.parentIsSupSub?new IP.MathNode(`mrow`,[c,l]):IP.newDocumentFragment([c,l])}}),Z(`\\operatorname`,`\\@ifstar\\operatornamewithlimits\\operatorname@`),gP({type:`ordgroup`,htmlBuilder(e,t){return e.semisimple?X.makeFragment(wP(e.body,t,!1)):X.makeSpan([`mord`],wP(e.body,t,!0),t)},mathmlBuilder(e,t){return HP(e.body,t,!0)}}),hP({type:`overline`,names:[`\\overline`],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:`overline`,mode:n.mode,body:r}},htmlBuilder(e,t){var n=AP(e.body,t.havingCrampedStyle()),r=X.makeLineSpan(`overline-line`,t),i=t.fontMetrics().defaultRuleThickness,a=X.makeVList({positionType:`firstBaseline`,children:[{type:`elem`,elem:n},{type:`kern`,size:3*i},{type:`elem`,elem:r},{type:`kern`,size:i}]},t);return X.makeSpan([`mord`,`overline`],[a],t)},mathmlBuilder(e,t){var n=new IP.MathNode(`mo`,[new IP.TextNode(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new IP.MathNode(`mover`,[UP(e.body,t),n]);return r.setAttribute(`accent`,`true`),r}}),hP({type:`phantom`,names:[`\\phantom`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`phantom`,mode:n.mode,body:vP(r)}},htmlBuilder:(e,t)=>{var n=wP(e.body,t.withPhantom(),!1);return X.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=VP(e.body,t);return new IP.MathNode(`mphantom`,n)}}),hP({type:`hphantom`,names:[`\\hphantom`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`hphantom`,mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=X.makeSpan([],[AP(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r{var n=VP(vP(e.body),t),r=new IP.MathNode(`mphantom`,n),i=new IP.MathNode(`mpadded`,[r]);return i.setAttribute(`height`,`0px`),i.setAttribute(`depth`,`0px`),i}}),hP({type:`vphantom`,names:[`\\vphantom`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`vphantom`,mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=X.makeSpan([`inner`],[AP(e.body,t.withPhantom())]),r=X.makeSpan([`fix`],[]);return X.makeSpan([`mord`,`rlap`],[n,r],t)},mathmlBuilder:(e,t)=>{var n=VP(vP(e.body),t),r=new IP.MathNode(`mphantom`,n),i=new IP.MathNode(`mpadded`,[r]);return i.setAttribute(`width`,`0px`),i}}),hP({type:`raisebox`,names:[`\\raisebox`],props:{numArgs:2,argTypes:[`size`,`hbox`],allowedInText:!0},handler(e,t){var{parser:n}=e,r=eF(t[0],`size`).value,i=t[1];return{type:`raisebox`,mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=AP(e.body,t),r=GM(e.dy,t);return X.makeVList({positionType:`shift`,positionData:-r,children:[{type:`elem`,elem:n}]},t)},mathmlBuilder(e,t){var n=new IP.MathNode(`mpadded`,[UP(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute(`voffset`,r),n}}),hP({type:`internal`,names:[`\\relax`],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:`internal`,mode:t.mode}}}),hP({type:`rule`,names:[`\\rule`],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`size`,`size`,`size`]},handler(e,t,n){var{parser:r}=e,i=n[0],a=eF(t[0],`size`),o=eF(t[1],`size`);return{type:`rule`,mode:r.mode,shift:i&&eF(i,`size`).value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=X.makeSpan([`mord`,`rule`],[],t),r=GM(e.width,t),i=GM(e.height,t),a=e.shift?GM(e.shift,t):0;return n.style.borderRightWidth=KM(r),n.style.borderTopWidth=KM(i),n.style.bottom=KM(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=GM(e.width,t),r=GM(e.height,t),i=e.shift?GM(e.shift,t):0,a=t.color&&t.getColor()||`black`,o=new IP.MathNode(`mspace`);o.setAttribute(`mathbackground`,a),o.setAttribute(`width`,KM(n)),o.setAttribute(`height`,KM(r));var s=new IP.MathNode(`mpadded`,[o]);return i>=0?s.setAttribute(`height`,KM(i)):(s.setAttribute(`height`,KM(i)),s.setAttribute(`depth`,KM(-i))),s.setAttribute(`voffset`,KM(i)),s}});function jI(e,t,n){for(var r=wP(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a{var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!1,n);return{type:`sizing`,mode:i.mode,size:MI.indexOf(r)+1,body:a}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return jI(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=VP(e.body,n),i=new IP.MathNode(`mstyle`,r);return i.setAttribute(`mathsize`,KM(n.sizeMultiplier)),i}}),hP({type:`smash`,names:[`\\smash`],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,a=!1,o=n[0]&&eF(n[0],`ordgroup`);if(o)for(var s=``,c=0;c{var n=X.makeSpan([],[AP(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var r=0;r{var n=new IP.MathNode(`mpadded`,[UP(e.body,t)]);return e.smashHeight&&n.setAttribute(`height`,`0px`),e.smashDepth&&n.setAttribute(`depth`,`0px`),n}}),hP({type:`sqrt`,names:[`\\sqrt`],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],a=t[0];return{type:`sqrt`,mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=AP(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=X.wrapFragment(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.idn.height+n.depth+a&&(a=(a+u-n.height-n.depth)/2);var d=s.height-n.height-a-c;n.style.paddingLeft=KM(l);var f=X.makeVList({positionType:`firstBaseline`,children:[{type:`elem`,elem:n,wrapperClasses:[`svg-align`]},{type:`kern`,size:-(n.height+d)},{type:`elem`,elem:s},{type:`kern`,size:c}]},t);if(e.index){var p=t.havingStyle(pM.SCRIPTSCRIPT),m=AP(e.index,p,t),h=.6*(f.height-f.depth),g=X.makeVList({positionType:`shift`,positionData:-h,children:[{type:`elem`,elem:m}]},t),_=X.makeSpan([`root`],[g]);return X.makeSpan([`mord`,`sqrt`],[_,f],t)}else return X.makeSpan([`mord`,`sqrt`],[f],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new IP.MathNode(`mroot`,[UP(n,t),UP(r,t)]):new IP.MathNode(`msqrt`,[UP(n,t)])}});var NI={display:pM.DISPLAY,text:pM.TEXT,script:pM.SCRIPT,scriptscript:pM.SCRIPTSCRIPT};hP({type:`styling`,names:[`\\displaystyle`,`\\textstyle`,`\\scriptstyle`,`\\scriptscriptstyle`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);return{type:`styling`,mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=NI[e.style],r=t.havingStyle(n).withFont(``);return jI(e.body,r,t)},mathmlBuilder(e,t){var n=NI[e.style],r=t.havingStyle(n),i=VP(e.body,r),a=new IP.MathNode(`mstyle`,i),o={display:[`0`,`true`],text:[`0`,`false`],script:[`1`,`false`],scriptscript:[`2`,`false`]}[e.style];return a.setAttribute(`scriptlevel`,o[0]),a.setAttribute(`displaystyle`,o[1]),a}});var pte=function(e,t){var n=e.base;return n?n.type===`op`?n.limits&&(t.style.size===pM.DISPLAY.size||n.alwaysHandleSupSub)?OI:null:n.type===`operatorname`?n.alwaysHandleSupSub&&(t.style.size===pM.DISPLAY.size||n.limits)?AI:null:n.type===`accent`?qj.isCharacterBox(n.base)?rF:null:n.type===`horizBrace`&&!e.sub===n.isOver?CI:null:null};gP({type:`supsub`,htmlBuilder(e,t){var n=pte(e,t);if(n)return n(e,t);var{base:r,sup:i,sub:a}=e,o=AP(r,t),s,c,l=t.fontMetrics(),u=0,d=0,f=r&&qj.isCharacterBox(r);if(i){var p=t.havingStyle(t.style.sup());s=AP(i,p,t),f||(u=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(a){var m=t.havingStyle(t.style.sub());c=AP(a,m,t),f||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}var h=t.style===pM.DISPLAY?l.sup1:t.style.cramped?l.sup3:l.sup2,g=t.sizeMultiplier,_=KM(.5/l.ptPerEm/g),v=null;if(c){var y=e.base&&e.base.type===`op`&&e.base.name&&(e.base.name===`\\oiint`||e.base.name===`\\oiiint`);(o instanceof nN||y)&&(v=KM(-o.italic))}var b;if(s&&c){u=Math.max(u,h,s.depth+.25*l.xHeight),d=Math.max(d,l.sub2);var x=4*l.defaultRuleThickness;if(u-s.depth-(c.height-d)0&&(u+=S,d-=S)}var C=[{type:`elem`,elem:c,shift:d,marginRight:_,marginLeft:v},{type:`elem`,elem:s,shift:-u,marginRight:_}];b=X.makeVList({positionType:`individualShift`,children:C},t)}else if(c){d=Math.max(d,l.sub1,c.height-.8*l.xHeight);var w=[{type:`elem`,elem:c,marginLeft:v,marginRight:_}];b=X.makeVList({positionType:`shift`,positionData:d,children:w},t)}else if(s)u=Math.max(u,h,s.depth+.25*l.xHeight),b=X.makeVList({positionType:`shift`,positionData:-u,children:[{type:`elem`,elem:s,marginRight:_}]},t);else throw Error(`supsub must have either sup or sub.`);var T=OP(o,`right`)||`mord`;return X.makeSpan([T],[o,X.makeSpan([`msupsub`],[b])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type===`horizBrace`&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type===`op`||e.base.type===`operatorname`)&&(e.base.parentIsSupSub=!0);var a=[UP(e.base,t)];e.sub&&a.push(UP(e.sub,t)),e.sup&&a.push(UP(e.sup,t));var o;if(n)o=r?`mover`:`munder`;else if(!e.sub){var s=e.base;o=s&&s.type===`op`&&s.limits&&(t.style===pM.DISPLAY||s.alwaysHandleSupSub)||s&&s.type===`operatorname`&&s.alwaysHandleSupSub&&(s.limits||t.style===pM.DISPLAY)?`mover`:`msup`}else if(e.sup){var c=e.base;o=c&&c.type===`op`&&c.limits&&t.style===pM.DISPLAY||c&&c.type===`operatorname`&&c.alwaysHandleSupSub&&(t.style===pM.DISPLAY||c.limits)?`munderover`:`msubsup`}else{var l=e.base;o=l&&l.type===`op`&&l.limits&&(t.style===pM.DISPLAY||l.alwaysHandleSupSub)||l&&l.type===`operatorname`&&l.alwaysHandleSupSub&&(l.limits||t.style===pM.DISPLAY)?`munder`:`msub`}return new IP.MathNode(o,a)}}),gP({type:`atom`,htmlBuilder(e,t){return X.mathsym(e.text,e.mode,t,[`m`+e.family])},mathmlBuilder(e,t){var n=new IP.MathNode(`mo`,[LP(e.text,e.mode)]);if(e.family===`bin`){var r=zP(e,t);r===`bold-italic`&&n.setAttribute(`mathvariant`,r)}else e.family===`punct`?n.setAttribute(`separator`,`true`):(e.family===`open`||e.family===`close`)&&n.setAttribute(`stretchy`,`false`);return n}});var PI={mi:`italic`,mn:`normal`,mtext:`normal`};gP({type:`mathord`,htmlBuilder(e,t){return X.makeOrd(e,t,`mathord`)},mathmlBuilder(e,t){var n=new IP.MathNode(`mi`,[LP(e.text,e.mode,t)]),r=zP(e,t)||`italic`;return r!==PI[n.type]&&n.setAttribute(`mathvariant`,r),n}}),gP({type:`textord`,htmlBuilder(e,t){return X.makeOrd(e,t,`textord`)},mathmlBuilder(e,t){var n=LP(e.text,e.mode,t),r=zP(e,t)||`normal`,i=e.mode===`text`?new IP.MathNode(`mtext`,[n]):/[0-9]/.test(e.text)?new IP.MathNode(`mn`,[n]):e.text===`\\prime`?new IP.MathNode(`mo`,[n]):new IP.MathNode(`mi`,[n]);return r!==PI[i.type]&&i.setAttribute(`mathvariant`,r),i}});var FI={"\\nobreak":`nobreak`,"\\allowbreak":`allowbreak`},II={" ":{},"\\ ":{},"~":{className:`nobreak`},"\\space":{},"\\nobreakspace":{className:`nobreak`}};gP({type:`spacing`,htmlBuilder(e,t){if(II.hasOwnProperty(e.text)){var n=II[e.text].className||``;if(e.mode===`text`){var r=X.makeOrd(e,t,`textord`);return r.classes.push(n),r}else return X.makeSpan([`mspace`,n],[X.mathsym(e.text,e.mode,t)],t)}else if(FI.hasOwnProperty(e.text))return X.makeSpan([`mspace`,FI[e.text]],[],t);else throw new Lj(`Unknown type of space "`+e.text+`"`)},mathmlBuilder(e,t){var n;if(II.hasOwnProperty(e.text))n=new IP.MathNode(`mtext`,[new IP.TextNode(`\xA0`)]);else if(FI.hasOwnProperty(e.text))return new IP.MathNode(`mspace`);else throw new Lj(`Unknown type of space "`+e.text+`"`);return n}});var LI=()=>{var e=new IP.MathNode(`mtd`,[]);return e.setAttribute(`width`,`50%`),e};gP({type:`tag`,mathmlBuilder(e,t){var n=new IP.MathNode(`mtable`,[new IP.MathNode(`mtr`,[LI(),new IP.MathNode(`mtd`,[HP(e.body,t)]),LI(),new IP.MathNode(`mtd`,[HP(e.tag,t)])])]);return n.setAttribute(`width`,`100%`),n}});var RI={"\\text":void 0,"\\textrm":`textrm`,"\\textsf":`textsf`,"\\texttt":`texttt`,"\\textnormal":`textrm`},zI={"\\textbf":`textbf`,"\\textmd":`textmd`},mte={"\\textit":`textit`,"\\textup":`textup`},BI=(e,t)=>{var n=e.font;return n?RI[n]?t.withTextFontFamily(RI[n]):zI[n]?t.withTextFontWeight(zI[n]):n===`\\emph`?t.fontShape===`textit`?t.withTextFontShape(`textup`):t.withTextFontShape(`textit`):t.withTextFontShape(mte[n]):t};hP({type:`text`,names:[`\\text`,`\\textrm`,`\\textsf`,`\\texttt`,`\\textnormal`,`\\textbf`,`\\textmd`,`\\textit`,`\\textup`,`\\emph`],props:{numArgs:1,argTypes:[`text`],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`text`,mode:n.mode,body:vP(i),font:r}},htmlBuilder(e,t){var n=BI(e,t),r=wP(e.body,n,!0);return X.makeSpan([`mord`,`text`],r,n)},mathmlBuilder(e,t){var n=BI(e,t);return HP(e.body,n)}}),hP({type:`underline`,names:[`\\underline`],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`underline`,mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=AP(e.body,t),r=X.makeLineSpan(`underline-line`,t),i=t.fontMetrics().defaultRuleThickness,a=X.makeVList({positionType:`top`,positionData:n.height,children:[{type:`kern`,size:i},{type:`elem`,elem:r},{type:`kern`,size:3*i},{type:`elem`,elem:n}]},t);return X.makeSpan([`mord`,`underline`],[a],t)},mathmlBuilder(e,t){var n=new IP.MathNode(`mo`,[new IP.TextNode(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new IP.MathNode(`munder`,[UP(e.body,t),n]);return r.setAttribute(`accentunder`,`true`),r}}),hP({type:`vcenter`,names:[`\\vcenter`],props:{numArgs:1,argTypes:[`original`],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:`vcenter`,mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=AP(e.body,t),r=t.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return X.makeVList({positionType:`shift`,positionData:i,children:[{type:`elem`,elem:n}]},t)},mathmlBuilder(e,t){return new IP.MathNode(`mpadded`,[UP(e.body,t)],[`vcenter`])}}),hP({type:`verb`,names:[`\\verb`],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new Lj(`\\verb ended by end of line instead of matching delimiter`)},htmlBuilder(e,t){for(var n=VI(e),r=[],i=t.havingStyle(t.style.text()),a=0;ae.body.replace(/ /g,e.star?`␣`:`\xA0`),HI=fP,UI=`[ \r + ]`,WI=`\\\\[a-zA-Z@]+`,GI=`\\\\[^\ud800-\udfff]`,KI=`(`+WI+`)`+UI+`*`,qI=`\\\\( +|[ \r ]+ +?)[ \r ]*`,JI=`[̀-ͯ]`,YI=RegExp(JI+`+$`),XI=`(`+UI+`+)|`+(qI+`|`)+`([!-\\[\\]-‧‪-퟿豈-￿]`+(JI+`*`)+`|[\ud800-\udbff][\udc00-\udfff]`+(JI+`*`)+`|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5`+(`|`+KI)+(`|`+GI+`)`),ZI=class{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(XI,`g`),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new Ij(`EOF`,new Fj(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new Lj(`Unexpected character: '`+e[t]+`'`,new Ij(e[t],new Fj(this,t,t+1)));var r=n[6]||n[3]||(n[2]?`\\ `:` `);if(this.catcodes[r]===14){var i=e.indexOf(` +`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict(`commentAtEnd`,`% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)`)):this.tokenRegex.lastIndex=i+1,this.lex()}return new Ij(r,new Fj(this,t,this.tokenRegex.lastIndex))}},QI=class{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Lj(`Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug`);var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var r=0;r0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}},$I=aI;Z(`\\noexpand`,function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),Z(`\\expandafter`,function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),Z(`\\@firstoftwo`,function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),Z(`\\@secondoftwo`,function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),Z(`\\@ifnextchar`,function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),Z(`\\@ifstar`,`\\@ifnextchar *{\\@firstoftwo{#1}}`),Z(`\\TextOrMath`,function(e){var t=e.consumeArgs(2);return e.mode===`text`?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var eL={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Z(`\\char`,function(e){var t=e.popToken(),n,r=``;if(t.text===`'`)n=8,t=e.popToken();else if(t.text===`"`)n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]===`\\`)r=t.text.charCodeAt(1);else if(t.text===`EOF`)throw new Lj("\\char` missing argument");else r=t.text.charCodeAt(0);else n=10;if(n){if(r=eL[t.text],r==null||r>=n)throw new Lj(`Invalid base-`+n+` digit `+t.text);for(var i;(i=eL[e.future().text])!=null&&i{var i=e.consumeArg().tokens;if(i.length!==1)throw new Lj(`\\newcommand's first argument must be a macro name`);var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new Lj(`\\newcommand{`+a+`} attempting to redefine `+(a+`; use \\renewcommand`));if(!o&&!n)throw new Lj(`\\renewcommand{`+a+`} when command `+a+` does not yet exist; use \\newcommand`);var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text===`[`){for(var c=``,l=e.expandNextToken();l.text!==`]`&&l.text!==`EOF`;)c+=l.text,l=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new Lj(`Invalid number of arguments: `+c);s=parseInt(c),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),``};Z(`\\newcommand`,e=>tL(e,!1,!0,!1)),Z(`\\renewcommand`,e=>tL(e,!0,!1,!1)),Z(`\\providecommand`,e=>tL(e,!0,!0,!0)),Z(`\\message`,e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join(``)),``}),Z(`\\errmessage`,e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join(``)),``}),Z(`\\show`,e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),HI[n],uN.math[n],uN.text[n]),``}),Z(`\\bgroup`,`{`),Z(`\\egroup`,`}`),Z(`~`,`\\nobreakspace`),Z(`\\lq`,"`"),Z(`\\rq`,`'`),Z(`\\aa`,`\\r a`),Z(`\\AA`,`\\r A`),Z(`\\textcopyright`,"\\html@mathml{\\textcircled{c}}{\\char`©}"),Z(`\\copyright`,`\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}`),Z(`\\textregistered`,"\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),Z(`ℬ`,`\\mathscr{B}`),Z(`ℰ`,`\\mathscr{E}`),Z(`ℱ`,`\\mathscr{F}`),Z(`ℋ`,`\\mathscr{H}`),Z(`ℐ`,`\\mathscr{I}`),Z(`ℒ`,`\\mathscr{L}`),Z(`ℳ`,`\\mathscr{M}`),Z(`ℛ`,`\\mathscr{R}`),Z(`ℭ`,`\\mathfrak{C}`),Z(`ℌ`,`\\mathfrak{H}`),Z(`ℨ`,`\\mathfrak{Z}`),Z(`\\Bbbk`,`\\Bbb{k}`),Z(`·`,`\\cdotp`),Z(`\\llap`,`\\mathllap{\\textrm{#1}}`),Z(`\\rlap`,`\\mathrlap{\\textrm{#1}}`),Z(`\\clap`,`\\mathclap{\\textrm{#1}}`),Z(`\\mathstrut`,`\\vphantom{(}`),Z(`\\underbar`,`\\underline{\\text{#1}}`),Z(`\\not`,`\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}`),Z(`\\neq`,"\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),Z(`\\ne`,`\\neq`),Z(`≠`,`\\neq`),Z(`\\notin`,"\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),Z(`∉`,`\\notin`),Z(`≘`,"\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),Z(`≙`,"\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),Z(`≚`,"\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),Z(`≛`,"\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),Z(`≝`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),Z(`≞`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),Z(`≟`,"\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),Z(`⟂`,`\\perp`),Z(`‼`,`\\mathclose{!\\mkern-0.8mu!}`),Z(`∌`,`\\notni`),Z(`⌜`,`\\ulcorner`),Z(`⌝`,`\\urcorner`),Z(`⌞`,`\\llcorner`),Z(`⌟`,`\\lrcorner`),Z(`©`,`\\copyright`),Z(`®`,`\\textregistered`),Z(`️`,`\\textregistered`),Z(`\\ulcorner`,`\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}`),Z(`\\urcorner`,`\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}`),Z(`\\llcorner`,`\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}`),Z(`\\lrcorner`,`\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}`),Z(`\\vdots`,`{\\varvdots\\rule{0pt}{15pt}}`),Z(`⋮`,`\\vdots`),Z(`\\varGamma`,`\\mathit{\\Gamma}`),Z(`\\varDelta`,`\\mathit{\\Delta}`),Z(`\\varTheta`,`\\mathit{\\Theta}`),Z(`\\varLambda`,`\\mathit{\\Lambda}`),Z(`\\varXi`,`\\mathit{\\Xi}`),Z(`\\varPi`,`\\mathit{\\Pi}`),Z(`\\varSigma`,`\\mathit{\\Sigma}`),Z(`\\varUpsilon`,`\\mathit{\\Upsilon}`),Z(`\\varPhi`,`\\mathit{\\Phi}`),Z(`\\varPsi`,`\\mathit{\\Psi}`),Z(`\\varOmega`,`\\mathit{\\Omega}`),Z(`\\substack`,`\\begin{subarray}{c}#1\\end{subarray}`),Z(`\\colon`,`\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax`),Z(`\\boxed`,`\\fbox{$\\displaystyle{#1}$}`),Z(`\\iff`,`\\DOTSB\\;\\Longleftrightarrow\\;`),Z(`\\implies`,`\\DOTSB\\;\\Longrightarrow\\;`),Z(`\\impliedby`,`\\DOTSB\\;\\Longleftarrow\\;`),Z(`\\dddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}`),Z(`\\ddddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}`);var nL={",":`\\dotsc`,"\\not":`\\dotsb`,"+":`\\dotsb`,"=":`\\dotsb`,"<":`\\dotsb`,">":`\\dotsb`,"-":`\\dotsb`,"*":`\\dotsb`,":":`\\dotsb`,"\\DOTSB":`\\dotsb`,"\\coprod":`\\dotsb`,"\\bigvee":`\\dotsb`,"\\bigwedge":`\\dotsb`,"\\biguplus":`\\dotsb`,"\\bigcap":`\\dotsb`,"\\bigcup":`\\dotsb`,"\\prod":`\\dotsb`,"\\sum":`\\dotsb`,"\\bigotimes":`\\dotsb`,"\\bigoplus":`\\dotsb`,"\\bigodot":`\\dotsb`,"\\bigsqcup":`\\dotsb`,"\\And":`\\dotsb`,"\\longrightarrow":`\\dotsb`,"\\Longrightarrow":`\\dotsb`,"\\longleftarrow":`\\dotsb`,"\\Longleftarrow":`\\dotsb`,"\\longleftrightarrow":`\\dotsb`,"\\Longleftrightarrow":`\\dotsb`,"\\mapsto":`\\dotsb`,"\\longmapsto":`\\dotsb`,"\\hookrightarrow":`\\dotsb`,"\\doteq":`\\dotsb`,"\\mathbin":`\\dotsb`,"\\mathrel":`\\dotsb`,"\\relbar":`\\dotsb`,"\\Relbar":`\\dotsb`,"\\xrightarrow":`\\dotsb`,"\\xleftarrow":`\\dotsb`,"\\DOTSI":`\\dotsi`,"\\int":`\\dotsi`,"\\oint":`\\dotsi`,"\\iint":`\\dotsi`,"\\iiint":`\\dotsi`,"\\iiiint":`\\dotsi`,"\\idotsint":`\\dotsi`,"\\DOTSX":`\\dotsx`};Z(`\\dots`,function(e){var t=`\\dotso`,n=e.expandAfterFuture().text;return n in nL?t=nL[n]:(n.slice(0,4)===`\\not`||n in uN.math&&[`bin`,`rel`].includes(uN.math[n].group))&&(t=`\\dotsb`),t});var rL={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Z(`\\dotso`,function(e){return e.future().text in rL?`\\ldots\\,`:`\\ldots`}),Z(`\\dotsc`,function(e){var t=e.future().text;return t in rL&&t!==`,`?`\\ldots\\,`:`\\ldots`}),Z(`\\cdots`,function(e){return e.future().text in rL?`\\@cdots\\,`:`\\@cdots`}),Z(`\\dotsb`,`\\cdots`),Z(`\\dotsm`,`\\cdots`),Z(`\\dotsi`,`\\!\\cdots`),Z(`\\dotsx`,`\\ldots\\,`),Z(`\\DOTSI`,`\\relax`),Z(`\\DOTSB`,`\\relax`),Z(`\\DOTSX`,`\\relax`),Z(`\\tmspace`,`\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax`),Z(`\\,`,`\\tmspace+{3mu}{.1667em}`),Z(`\\thinspace`,`\\,`),Z(`\\>`,`\\mskip{4mu}`),Z(`\\:`,`\\tmspace+{4mu}{.2222em}`),Z(`\\medspace`,`\\:`),Z(`\\;`,`\\tmspace+{5mu}{.2777em}`),Z(`\\thickspace`,`\\;`),Z(`\\!`,`\\tmspace-{3mu}{.1667em}`),Z(`\\negthinspace`,`\\!`),Z(`\\negmedspace`,`\\tmspace-{4mu}{.2222em}`),Z(`\\negthickspace`,`\\tmspace-{5mu}{.277em}`),Z(`\\enspace`,`\\kern.5em `),Z(`\\enskip`,`\\hskip.5em\\relax`),Z(`\\quad`,`\\hskip1em\\relax`),Z(`\\qquad`,`\\hskip2em\\relax`),Z(`\\tag`,`\\@ifstar\\tag@literal\\tag@paren`),Z(`\\tag@paren`,`\\tag@literal{({#1})}`),Z(`\\tag@literal`,e=>{if(e.macros.get(`\\df@tag`))throw new Lj(`Multiple \\tag`);return`\\gdef\\df@tag{\\text{#1}}`}),Z(`\\bmod`,`\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}`),Z(`\\pod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)`),Z(`\\pmod`,`\\pod{{\\rm mod}\\mkern6mu#1}`),Z(`\\mod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1`),Z(`\\newline`,`\\\\\\relax`),Z(`\\TeX`,`\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}`);var iL=KM(jM[`Main-Regular`][84][1]-.7*jM[`Main-Regular`][65][1]);Z(`\\LaTeX`,`\\textrm{\\html@mathml{`+(`L\\kern-.36em\\raisebox{`+iL+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{LaTeX}}`),Z(`\\KaTeX`,`\\textrm{\\html@mathml{`+(`K\\kern-.17em\\raisebox{`+iL+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{KaTeX}}`),Z(`\\hspace`,`\\@ifstar\\@hspacer\\@hspace`),Z(`\\@hspace`,`\\hskip #1\\relax`),Z(`\\@hspacer`,`\\rule{0pt}{0pt}\\hskip #1\\relax`),Z(`\\ordinarycolon`,`:`),Z(`\\vcentcolon`,`\\mathrel{\\mathop\\ordinarycolon}`),Z(`\\dblcolon`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}`),Z(`\\coloneqq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}`),Z(`\\Coloneqq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}`),Z(`\\coloneq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}`),Z(`\\Coloneq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}`),Z(`\\eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}`),Z(`\\Eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}`),Z(`\\eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}`),Z(`\\Eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}`),Z(`\\colonapprox`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}`),Z(`\\Colonapprox`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}`),Z(`\\colonsim`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}`),Z(`\\Colonsim`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}`),Z(`∷`,`\\dblcolon`),Z(`∹`,`\\eqcolon`),Z(`≔`,`\\coloneqq`),Z(`≕`,`\\eqqcolon`),Z(`⩴`,`\\Coloneqq`),Z(`\\ratio`,`\\vcentcolon`),Z(`\\coloncolon`,`\\dblcolon`),Z(`\\colonequals`,`\\coloneqq`),Z(`\\coloncolonequals`,`\\Coloneqq`),Z(`\\equalscolon`,`\\eqqcolon`),Z(`\\equalscoloncolon`,`\\Eqqcolon`),Z(`\\colonminus`,`\\coloneq`),Z(`\\coloncolonminus`,`\\Coloneq`),Z(`\\minuscolon`,`\\eqcolon`),Z(`\\minuscoloncolon`,`\\Eqcolon`),Z(`\\coloncolonapprox`,`\\Colonapprox`),Z(`\\coloncolonsim`,`\\Colonsim`),Z(`\\simcolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),Z(`\\simcoloncolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}`),Z(`\\approxcolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),Z(`\\approxcoloncolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}`),Z(`\\notni`,"\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),Z(`\\limsup`,`\\DOTSB\\operatorname*{lim\\,sup}`),Z(`\\liminf`,`\\DOTSB\\operatorname*{lim\\,inf}`),Z(`\\injlim`,`\\DOTSB\\operatorname*{inj\\,lim}`),Z(`\\projlim`,`\\DOTSB\\operatorname*{proj\\,lim}`),Z(`\\varlimsup`,`\\DOTSB\\operatorname*{\\overline{lim}}`),Z(`\\varliminf`,`\\DOTSB\\operatorname*{\\underline{lim}}`),Z(`\\varinjlim`,`\\DOTSB\\operatorname*{\\underrightarrow{lim}}`),Z(`\\varprojlim`,`\\DOTSB\\operatorname*{\\underleftarrow{lim}}`),Z(`\\gvertneqq`,`\\html@mathml{\\@gvertneqq}{≩}`),Z(`\\lvertneqq`,`\\html@mathml{\\@lvertneqq}{≨}`),Z(`\\ngeqq`,`\\html@mathml{\\@ngeqq}{≱}`),Z(`\\ngeqslant`,`\\html@mathml{\\@ngeqslant}{≱}`),Z(`\\nleqq`,`\\html@mathml{\\@nleqq}{≰}`),Z(`\\nleqslant`,`\\html@mathml{\\@nleqslant}{≰}`),Z(`\\nshortmid`,`\\html@mathml{\\@nshortmid}{∤}`),Z(`\\nshortparallel`,`\\html@mathml{\\@nshortparallel}{∦}`),Z(`\\nsubseteqq`,`\\html@mathml{\\@nsubseteqq}{⊈}`),Z(`\\nsupseteqq`,`\\html@mathml{\\@nsupseteqq}{⊉}`),Z(`\\varsubsetneq`,`\\html@mathml{\\@varsubsetneq}{⊊}`),Z(`\\varsubsetneqq`,`\\html@mathml{\\@varsubsetneqq}{⫋}`),Z(`\\varsupsetneq`,`\\html@mathml{\\@varsupsetneq}{⊋}`),Z(`\\varsupsetneqq`,`\\html@mathml{\\@varsupsetneqq}{⫌}`),Z(`\\imath`,`\\html@mathml{\\@imath}{ı}`),Z(`\\jmath`,`\\html@mathml{\\@jmath}{ȷ}`),Z(`\\llbracket`,"\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),Z(`\\rrbracket`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),Z(`⟦`,`\\llbracket`),Z(`⟧`,`\\rrbracket`),Z(`\\lBrace`,"\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),Z(`\\rBrace`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),Z(`⦃`,`\\lBrace`),Z(`⦄`,`\\rBrace`),Z(`\\minuso`,"\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),Z(`⦵`,`\\minuso`),Z(`\\darr`,`\\downarrow`),Z(`\\dArr`,`\\Downarrow`),Z(`\\Darr`,`\\Downarrow`),Z(`\\lang`,`\\langle`),Z(`\\rang`,`\\rangle`),Z(`\\uarr`,`\\uparrow`),Z(`\\uArr`,`\\Uparrow`),Z(`\\Uarr`,`\\Uparrow`),Z(`\\N`,`\\mathbb{N}`),Z(`\\R`,`\\mathbb{R}`),Z(`\\Z`,`\\mathbb{Z}`),Z(`\\alef`,`\\aleph`),Z(`\\alefsym`,`\\aleph`),Z(`\\Alpha`,`\\mathrm{A}`),Z(`\\Beta`,`\\mathrm{B}`),Z(`\\bull`,`\\bullet`),Z(`\\Chi`,`\\mathrm{X}`),Z(`\\clubs`,`\\clubsuit`),Z(`\\cnums`,`\\mathbb{C}`),Z(`\\Complex`,`\\mathbb{C}`),Z(`\\Dagger`,`\\ddagger`),Z(`\\diamonds`,`\\diamondsuit`),Z(`\\empty`,`\\emptyset`),Z(`\\Epsilon`,`\\mathrm{E}`),Z(`\\Eta`,`\\mathrm{H}`),Z(`\\exist`,`\\exists`),Z(`\\harr`,`\\leftrightarrow`),Z(`\\hArr`,`\\Leftrightarrow`),Z(`\\Harr`,`\\Leftrightarrow`),Z(`\\hearts`,`\\heartsuit`),Z(`\\image`,`\\Im`),Z(`\\infin`,`\\infty`),Z(`\\Iota`,`\\mathrm{I}`),Z(`\\isin`,`\\in`),Z(`\\Kappa`,`\\mathrm{K}`),Z(`\\larr`,`\\leftarrow`),Z(`\\lArr`,`\\Leftarrow`),Z(`\\Larr`,`\\Leftarrow`),Z(`\\lrarr`,`\\leftrightarrow`),Z(`\\lrArr`,`\\Leftrightarrow`),Z(`\\Lrarr`,`\\Leftrightarrow`),Z(`\\Mu`,`\\mathrm{M}`),Z(`\\natnums`,`\\mathbb{N}`),Z(`\\Nu`,`\\mathrm{N}`),Z(`\\Omicron`,`\\mathrm{O}`),Z(`\\plusmn`,`\\pm`),Z(`\\rarr`,`\\rightarrow`),Z(`\\rArr`,`\\Rightarrow`),Z(`\\Rarr`,`\\Rightarrow`),Z(`\\real`,`\\Re`),Z(`\\reals`,`\\mathbb{R}`),Z(`\\Reals`,`\\mathbb{R}`),Z(`\\Rho`,`\\mathrm{P}`),Z(`\\sdot`,`\\cdot`),Z(`\\sect`,`\\S`),Z(`\\spades`,`\\spadesuit`),Z(`\\sub`,`\\subset`),Z(`\\sube`,`\\subseteq`),Z(`\\supe`,`\\supseteq`),Z(`\\Tau`,`\\mathrm{T}`),Z(`\\thetasym`,`\\vartheta`),Z(`\\weierp`,`\\wp`),Z(`\\Zeta`,`\\mathrm{Z}`),Z(`\\argmin`,`\\DOTSB\\operatorname*{arg\\,min}`),Z(`\\argmax`,`\\DOTSB\\operatorname*{arg\\,max}`),Z(`\\plim`,`\\DOTSB\\mathop{\\operatorname{plim}}\\limits`),Z(`\\bra`,`\\mathinner{\\langle{#1}|}`),Z(`\\ket`,`\\mathinner{|{#1}\\rangle}`),Z(`\\braket`,`\\mathinner{\\langle{#1}\\rangle}`),Z(`\\Bra`,`\\left\\langle#1\\right|`),Z(`\\Ket`,`\\left|#1\\right\\rangle`);var aL=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get(`|`),s=t.macros.get(`\\|`);t.macros.beginGroup();var c=t=>n=>{e&&(n.macros.set(`|`,o),i.length&&n.macros.set(`\\|`,s));var a=t;return!t&&i.length&&n.future().text===`|`&&(n.popToken(),a=!0),{tokens:a?i:r,numArgs:0}};t.macros.set(`|`,c(!1)),i.length&&t.macros.set(`\\|`,c(!0));var l=t.consumeArg().tokens,u=t.expandTokens([...a,...l,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};Z(`\\bra@ket`,aL(!1)),Z(`\\bra@set`,aL(!0)),Z(`\\Braket`,`\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}`),Z(`\\Set`,`\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}`),Z(`\\set`,`\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}`),Z(`\\angln`,`{\\angl n}`),Z(`\\blue`,`\\textcolor{##6495ed}{#1}`),Z(`\\orange`,`\\textcolor{##ffa500}{#1}`),Z(`\\pink`,`\\textcolor{##ff00af}{#1}`),Z(`\\red`,`\\textcolor{##df0030}{#1}`),Z(`\\green`,`\\textcolor{##28ae7b}{#1}`),Z(`\\gray`,`\\textcolor{gray}{#1}`),Z(`\\purple`,`\\textcolor{##9d38bd}{#1}`),Z(`\\blueA`,`\\textcolor{##ccfaff}{#1}`),Z(`\\blueB`,`\\textcolor{##80f6ff}{#1}`),Z(`\\blueC`,`\\textcolor{##63d9ea}{#1}`),Z(`\\blueD`,`\\textcolor{##11accd}{#1}`),Z(`\\blueE`,`\\textcolor{##0c7f99}{#1}`),Z(`\\tealA`,`\\textcolor{##94fff5}{#1}`),Z(`\\tealB`,`\\textcolor{##26edd5}{#1}`),Z(`\\tealC`,`\\textcolor{##01d1c1}{#1}`),Z(`\\tealD`,`\\textcolor{##01a995}{#1}`),Z(`\\tealE`,`\\textcolor{##208170}{#1}`),Z(`\\greenA`,`\\textcolor{##b6ffb0}{#1}`),Z(`\\greenB`,`\\textcolor{##8af281}{#1}`),Z(`\\greenC`,`\\textcolor{##74cf70}{#1}`),Z(`\\greenD`,`\\textcolor{##1fab54}{#1}`),Z(`\\greenE`,`\\textcolor{##0d923f}{#1}`),Z(`\\goldA`,`\\textcolor{##ffd0a9}{#1}`),Z(`\\goldB`,`\\textcolor{##ffbb71}{#1}`),Z(`\\goldC`,`\\textcolor{##ff9c39}{#1}`),Z(`\\goldD`,`\\textcolor{##e07d10}{#1}`),Z(`\\goldE`,`\\textcolor{##a75a05}{#1}`),Z(`\\redA`,`\\textcolor{##fca9a9}{#1}`),Z(`\\redB`,`\\textcolor{##ff8482}{#1}`),Z(`\\redC`,`\\textcolor{##f9685d}{#1}`),Z(`\\redD`,`\\textcolor{##e84d39}{#1}`),Z(`\\redE`,`\\textcolor{##bc2612}{#1}`),Z(`\\maroonA`,`\\textcolor{##ffbde0}{#1}`),Z(`\\maroonB`,`\\textcolor{##ff92c6}{#1}`),Z(`\\maroonC`,`\\textcolor{##ed5fa6}{#1}`),Z(`\\maroonD`,`\\textcolor{##ca337c}{#1}`),Z(`\\maroonE`,`\\textcolor{##9e034e}{#1}`),Z(`\\purpleA`,`\\textcolor{##ddd7ff}{#1}`),Z(`\\purpleB`,`\\textcolor{##c6b9fc}{#1}`),Z(`\\purpleC`,`\\textcolor{##aa87ff}{#1}`),Z(`\\purpleD`,`\\textcolor{##7854ab}{#1}`),Z(`\\purpleE`,`\\textcolor{##543b78}{#1}`),Z(`\\mintA`,`\\textcolor{##f5f9e8}{#1}`),Z(`\\mintB`,`\\textcolor{##edf2df}{#1}`),Z(`\\mintC`,`\\textcolor{##e0e5cc}{#1}`),Z(`\\grayA`,`\\textcolor{##f6f7f7}{#1}`),Z(`\\grayB`,`\\textcolor{##f0f1f2}{#1}`),Z(`\\grayC`,`\\textcolor{##e3e5e6}{#1}`),Z(`\\grayD`,`\\textcolor{##d6d8da}{#1}`),Z(`\\grayE`,`\\textcolor{##babec2}{#1}`),Z(`\\grayF`,`\\textcolor{##888d93}{#1}`),Z(`\\grayG`,`\\textcolor{##626569}{#1}`),Z(`\\grayH`,`\\textcolor{##3b3e40}{#1}`),Z(`\\grayI`,`\\textcolor{##21242c}{#1}`),Z(`\\kaBlue`,`\\textcolor{##314453}{#1}`),Z(`\\kaGreen`,`\\textcolor{##71B307}{#1}`);var oL={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},sL=class{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new QI($I,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new ZI(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),this.future().text!==`[`)return null;t=this.popToken(),{tokens:r,end:n}=this.consumeArg([`]`])}else ({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new Ij(`EOF`,n.loc)),this.pushTokens(r),new Ij(``,Fj.range(t,n))}consumeSpaces(){for(;this.future().text===` `;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text===`{`)++a;else if(i.text===`}`){if(--a,a===-1)throw new Lj(`Extra }`,i)}else if(i.text===`EOF`)throw new Lj(`Unexpected end of input in a macro argument, expected '`+(e&&n?e[o]:`}`)+`'`,i);if(e&&n)if((a===0||a===1&&e[o]===`{`)&&i.text===e[o]){if(++o,o===e.length){t.splice(-o,o);break}}else o=0}while(a!==0||n);return r.text===`{`&&t[t.length-1].text===`}`&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new Lj(`The length of delimiters doesn't match the number of args!`);for(var n=t[0],r=0;rthis.settings.maxExpand)throw new Lj(`Too many expansions: infinite loop or need to increase maxExpand setting`)}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(r==null||e&&r.unexpandable){if(e&&r==null&&n[0]===`\\`&&!this.isDefined(n))throw new Lj(`Undefined control sequence: `+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var s=i[o];if(s.text===`#`){if(o===0)throw new Lj(`Incomplete placeholder at end of macro body`,s);if(s=i[--o],s.text===`#`)i.splice(o+1,1);else if(/^[1-9]$/.test(s.text))i.splice(o,2,...a[s.text-1]);else throw new Lj(`Not a valid argument number`,s)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text=`\\relax`),e}throw Error()}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Ij(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var r=this.stack.pop();r.treatAsRelax&&=(r.noexpand=!1,!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(e=>e.text).join(``)}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var r=typeof t==`function`?t(this):t;if(typeof r==`string`){var i=0;if(r.indexOf(`#`)!==-1)for(var a=r.replace(/##/g,``);a.indexOf(`#`+(i+1))!==-1;)++i;for(var o=new ZI(r,this.settings),s=[],c=o.lex();c.text!==`EOF`;)s.push(c),c=o.lex();return s.reverse(),{tokens:s,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||HI.hasOwnProperty(e)||uN.math.hasOwnProperty(e)||uN.text.hasOwnProperty(e)||oL.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t==null?HI.hasOwnProperty(e)&&!HI[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},cL=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,lL=Object.freeze({"₊":`+`,"₋":`-`,"₌":`=`,"₍":`(`,"₎":`)`,"₀":`0`,"₁":`1`,"₂":`2`,"₃":`3`,"₄":`4`,"₅":`5`,"₆":`6`,"₇":`7`,"₈":`8`,"₉":`9`,ₐ:`a`,ₑ:`e`,ₕ:`h`,ᵢ:`i`,ⱼ:`j`,ₖ:`k`,ₗ:`l`,ₘ:`m`,ₙ:`n`,ₒ:`o`,ₚ:`p`,ᵣ:`r`,ₛ:`s`,ₜ:`t`,ᵤ:`u`,ᵥ:`v`,ₓ:`x`,ᵦ:`β`,ᵧ:`γ`,ᵨ:`ρ`,ᵩ:`ϕ`,ᵪ:`χ`,"⁺":`+`,"⁻":`-`,"⁼":`=`,"⁽":`(`,"⁾":`)`,"⁰":`0`,"¹":`1`,"²":`2`,"³":`3`,"⁴":`4`,"⁵":`5`,"⁶":`6`,"⁷":`7`,"⁸":`8`,"⁹":`9`,ᴬ:`A`,ᴮ:`B`,ᴰ:`D`,ᴱ:`E`,ᴳ:`G`,ᴴ:`H`,ᴵ:`I`,ᴶ:`J`,ᴷ:`K`,ᴸ:`L`,ᴹ:`M`,ᴺ:`N`,ᴼ:`O`,ᴾ:`P`,ᴿ:`R`,ᵀ:`T`,ᵁ:`U`,ⱽ:`V`,ᵂ:`W`,ᵃ:`a`,ᵇ:`b`,ᶜ:`c`,ᵈ:`d`,ᵉ:`e`,ᶠ:`f`,ᵍ:`g`,ʰ:`h`,ⁱ:`i`,ʲ:`j`,ᵏ:`k`,ˡ:`l`,ᵐ:`m`,ⁿ:`n`,ᵒ:`o`,ᵖ:`p`,ʳ:`r`,ˢ:`s`,ᵗ:`t`,ᵘ:`u`,ᵛ:`v`,ʷ:`w`,ˣ:`x`,ʸ:`y`,ᶻ:`z`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),uL={"́":{text:`\\'`,math:`\\acute`},"̀":{text:"\\`",math:`\\grave`},"̈":{text:`\\"`,math:`\\ddot`},"̃":{text:`\\~`,math:`\\tilde`},"̄":{text:`\\=`,math:`\\bar`},"̆":{text:`\\u`,math:`\\breve`},"̌":{text:`\\v`,math:`\\check`},"̂":{text:`\\^`,math:`\\hat`},"̇":{text:`\\.`,math:`\\dot`},"̊":{text:`\\r`,math:`\\mathring`},"̋":{text:`\\H`},"̧":{text:`\\c`}},dL={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,ḉ:`ḉ`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ç:`ç`,ď:`ď`,ḋ:`ḋ`,ḑ:`ḑ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ḝ:`ḝ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ȩ:`ȩ`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ģ:`ģ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,ḩ:`ḩ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ķ:`ķ`,ĺ:`ĺ`,ľ:`ľ`,ļ:`ļ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ņ:`ņ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ŗ:`ŗ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ş:`ş`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ţ:`ţ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Ḉ:`Ḉ`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ç:`Ç`,Ď:`Ď`,Ḋ:`Ḋ`,Ḑ:`Ḑ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ḝ:`Ḝ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ȩ:`Ȩ`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ģ:`Ģ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Ḩ:`Ḩ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ķ:`Ķ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ļ:`Ļ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ņ:`Ņ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ŗ:`Ŗ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ş:`Ş`,Ť:`Ť`,Ṫ:`Ṫ`,Ţ:`Ţ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},fL=class e{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode=`math`,this.gullet=new sL(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new Lj(`Expected '`+e+`', got '`+this.fetch().text+`'`,this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken??=this.gullet.expandNextToken(),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set(`\\color`,`\\textcolor`);try{var e=this.parseExpression(!1);return this.expect(`EOF`),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Ij(`}`)),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect(`}`),this.nextToken=t,n}parseExpression(t,n){for(var r=[];;){this.mode===`math`&&this.consumeSpaces();var i=this.fetch();if(e.endOfExpression.indexOf(i.text)!==-1||n&&i.text===n||t&&HI[i.text]&&HI[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;a.type!==`internal`&&r.push(a)}return this.mode===`text`&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t=-1,n,r=0;r=0&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Latin-1/Unicode text character "`+t[0]+`" used in math mode`,e);var o=uN[this.mode][t].group,s=Fj.range(e),c;if(cN.hasOwnProperty(o)){var l=o;c={type:`atom`,mode:this.mode,family:l,loc:s,text:t}}else c={type:o,mode:this.mode,loc:s,text:t};a=c}else if(t.charCodeAt(0)>=128)this.settings.strict&&(_M(t.charCodeAt(0))?this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Unicode text character "`+t[0]+`" used in math mode`,e):this.settings.reportNonstrict(`unknownSymbol`,`Unrecognized Unicode character "`+t[0]+`"`+(` (`+t.charCodeAt(0)+`)`),e)),a={type:`textord`,mode:`text`,loc:Fj.range(e),text:t};else return null;if(this.consume(),i)for(var u=0;u{i(t)},[t]),(0,F.jsxs)(`div`,{className:`mb-3`,children:[(0,F.jsxs)(`button`,{onClick:()=>i(e=>!e),className:`flex items-center gap-2 text-xs text-[#6d6d6d] hover:text-black transition-colors cursor-pointer`,children:[(0,F.jsx)(Cl,{className:`h-3.5 w-3.5`}),t?(0,F.jsx)(`span`,{className:`thinking-shimmer font-medium`,children:`Thinking…`}):(0,F.jsxs)(`span`,{children:[`Thought for `,n,`s`]}),(0,F.jsx)(Tl,{className:`h-3 w-3 transition-transform duration-200 ${r?``:`-rotate-90`}`})]}),r&&(0,F.jsx)(`div`,{className:`mt-2 rounded-lg border border-[#0000001f] bg-[#f5f5f5] px-3 py-2 text-xs text-[#6d6d6d] whitespace-pre-wrap`,children:e.trim()})]})}var LL=FL({singleDollarTextMath:!0}),RL=[{prefix:`\\boxed{`,args:1},{prefix:`\\text{`,args:1},{prefix:`\\textbf{`,args:1},{prefix:`\\mathbf{`,args:1},{prefix:`\\mathrm{`,args:1},{prefix:`\\frac{`,args:2}];function zL(e,t){let n=1,r=t;for(;r0;)e[r]===`{`?n++:e[r]===`}`&&n--,r++;return r}function BL(e){let t=``,n=0,r=null;for(;ne.startsWith(t.prefix,n));if(i){let r=zL(e,n+i.prefix.length);for(let t=1;t{await navigator.clipboard.writeText(e.content),m(!0),setTimeout(()=>m(!1),2e3)},[e.content]);(0,y.useEffect)(()=>{l&&h.current&&(h.current.focus(),h.current.style.height=`auto`,h.current.style.height=h.current.scrollHeight+`px`)},[l]);let _=(0,y.useCallback)(()=>{f(e.content),u(!0)},[e.content]),v=(0,y.useCallback)(()=>{u(!1),f(e.content)},[e.content]),b=(0,y.useCallback)(()=>{let e=d.trim();e&&(u(!1),a(t,e))},[d,a,t]),x=(0,y.useCallback)(e=>{e.key===`Escape`&&v(),e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),b())},[v,b]);return l?(0,F.jsx)(`div`,{className:`flex justify-end`,children:(0,F.jsxs)(`div`,{className:`w-full max-w-[80%] flex flex-col gap-2`,children:[(0,F.jsx)(`textarea`,{ref:h,value:d,onChange:e=>{f(e.target.value),e.target.style.height=`auto`,e.target.style.height=e.target.scrollHeight+`px`},onKeyDown:x,className:`w-full rounded-xl border border-[#0000001f] bg-white px-4 py-3 text-sm text-black placeholder-[#6d6d6d] focus:border-[#5505af] focus:outline-none focus:ring-1 focus:ring-[#5505af] resize-none shadow-sm`,rows:1}),(0,F.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,F.jsxs)(`button`,{onClick:v,className:`flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium text-[#6d6d6d] hover:text-black border border-[#0000001f] hover:bg-[#f5f5f5] transition-colors cursor-pointer`,children:[(0,F.jsx)(Il,{className:`h-3 w-3`}),`Cancel`]}),(0,F.jsxs)(`button`,{onClick:b,disabled:!d.trim(),className:`flex items-center gap-1.5 rounded-lg bg-black px-3 py-1.5 text-xs font-medium text-white hover:bg-[#1f1f1f] disabled:opacity-40 transition-colors cursor-pointer`,children:[(0,F.jsx)(wl,{className:`h-3 w-3`}),`Update`]})]})]})}):(0,F.jsxs)(`div`,{className:`group flex items-start gap-2 ${s?`justify-end`:`justify-start`}`,children:[s&&!i&&(0,F.jsx)(`button`,{onClick:_,className:`mt-3 opacity-0 group-hover:opacity-100 transition-opacity text-[#6d6d6d] hover:text-black cursor-pointer`,title:`Edit message`,children:(0,F.jsx)(kl,{className:`h-3.5 w-3.5`})}),(0,F.jsxs)(`div`,{className:`max-w-[80%] rounded-2xl px-4 py-3 text-sm leading-relaxed ${s?`bg-black text-white rounded-br-md whitespace-pre-wrap`:`bg-white text-black rounded-bl-md border border-[#0000001f] shadow-sm`}`,children:[!s&&e.reasoning&&(0,F.jsx)(IL,{reasoning:e.reasoning,isThinking:c,thinkingSeconds:r??0}),e.content?s?e.content:(0,F.jsx)(YA,{plugins:{math:LL},parseIncompleteMarkdown:!1,isAnimating:n,children:VL(e.content)}):!s&&!n?(0,F.jsx)(`p`,{className:`italic text-[#6d6d6d]`,children:`No response`}):null]}),!s&&!n&&!i&&(0,F.jsxs)(`div`,{className:`mt-3 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity`,children:[e.content&&(0,F.jsx)(`button`,{onClick:g,className:`rounded-md p-1 text-[#6d6d6d] hover:text-black hover:bg-[#f5f5f5] transition-colors cursor-pointer`,title:`Copy response`,children:p?(0,F.jsx)(El,{className:`h-3.5 w-3.5`}):(0,F.jsx)(Dl,{className:`h-3.5 w-3.5`})}),(0,F.jsx)(`button`,{onClick:()=>o(t),className:`rounded-md p-1 text-[#6d6d6d] hover:text-black hover:bg-[#f5f5f5] transition-colors cursor-pointer`,title:`Retry`,children:(0,F.jsx)(Ml,{className:`h-3.5 w-3.5`})})]})]})}function UL(){let{status:e,tps:t,isGenerating:n}=Ul();return e.state===`loading`?(0,F.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-12 text-[#6d6d6d]`,children:[(0,F.jsx)(Ol,{className:`h-8 w-8 animate-spin text-[#5505af]`}),(0,F.jsx)(`p`,{className:`text-sm`,children:e.message??`Loading model…`}),e.progress!=null&&(0,F.jsx)(`div`,{className:`w-64 h-2 bg-[#e5e5e5] rounded-full overflow-hidden`,children:(0,F.jsx)(`div`,{className:`h-full bg-[#5505af]`,style:{width:`${e.progress}%`}})})]}):e.state===`error`?(0,F.jsxs)(`div`,{className:`py-12 text-center text-sm text-red-600`,children:[`Error loading model: `,e.error]}):n&&t>0?(0,F.jsxs)(`div`,{className:`text-center text-xs text-[#6d6d6d] py-1`,children:[t,` tokens/s`]}):null}var WL=[{label:`Solve x² + x - 12 = 0`,prompt:`Solve x^2 + x - 12 = 0`},{label:`Explain quantum computing`,prompt:`Explain quantum computing in simple terms. What makes it different from classical computing, and what are some real-world applications?`},{label:`Write a Python quicksort`,prompt:`Write a clean, well-commented Python implementation of the quicksort algorithm. Include an example of how to use it.`},{label:`Solve a logic puzzle`,prompt:`Five people were eating apples, A finished before B, but behind C. D finished before E, but behind B. What was the finishing order?`}];function GL({showDisclaimer:e,animated:t}){let{send:n,stop:r,status:i,isGenerating:a}=Ul(),o=i.state===`ready`,[s,c]=(0,y.useState)(``),l=(0,y.useRef)(null),u=(0,y.useCallback)(e=>{e?.preventDefault();let t=s.trim();!t||!o||a||(c(``),l.current&&(l.current.style.height=`7.5rem`),n(t))},[s,o,a,n]),d=(0,y.useCallback)(e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),u())},[u]);return(0,F.jsxs)(`div`,{className:`w-full ${t?`animate-rise-in-delayed`:``}`,children:[(0,F.jsx)(`form`,{onSubmit:u,className:`mx-auto max-w-3xl`,children:(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(`textarea`,{ref:l,className:`w-full rounded-xl border border-[#0000001f] bg-white px-4 py-3 pb-11 text-[15px] text-black placeholder-[#6d6d6d] focus:border-[#5505af] focus:outline-none focus:ring-1 focus:ring-[#5505af] disabled:opacity-50 resize-none max-h-40 shadow-sm`,style:{minHeight:`7.5rem`,height:`7.5rem`},placeholder:o?`Type a message…`:`Loading model…`,value:s,onChange:e=>{c(e.target.value),e.target.style.height=`7.5rem`,e.target.style.height=Math.max(e.target.scrollHeight,120)+`px`},onKeyDown:d,disabled:!o,autoFocus:!0}),(0,F.jsx)(`div`,{className:`absolute bottom-2 left-2 right-2 flex items-center justify-end pb-3 px-2`,children:a?(0,F.jsx)(`button`,{type:`button`,onClick:r,className:`flex items-center justify-center rounded-lg text-[#6d6d6d] hover:text-black transition-colors cursor-pointer`,title:`Stop generating`,children:(0,F.jsx)(Fl,{className:`h-4 w-4 fill-current`})}):(0,F.jsx)(`button`,{type:`submit`,disabled:!o||!s.trim(),className:`flex items-center justify-center rounded-lg text-[#6d6d6d] hover:text-black disabled:opacity-30 transition-colors cursor-pointer`,title:`Send message`,children:(0,F.jsx)(Nl,{className:`h-4 w-4`})})})]})}),e&&(0,F.jsx)(`p`,{className:`mx-auto max-w-3xl mt-1 text-center text-xs text-[#6d6d6d]`,children:`No chats are sent to a server. Everything runs locally in your browser. AI can make mistakes. Check important info.`})]})}function KL({onGoHome:e}){let{messages:t,isGenerating:n,send:r,status:i,clearChat:a}=Ul(),o=(0,y.useRef)(null),[s,c]=(0,y.useState)(0),l=(0,y.useRef)(null),u=(0,y.useRef)(new Map),d=(0,y.useRef)(!1),f=(0,y.useRef)(t),p=(0,y.useRef)(s);f.current=t,p.current=s;let m=i.state===`ready`,h=t.length>0,g=m&&h&&!n;(0,y.useEffect)(()=>{let e=o.current;e&&e.scrollTo({top:e.scrollHeight,behavior:`smooth`})},[t]),(0,y.useEffect)(()=>{if(d.current&&!n){let e=f.current.at(-1);e?.role===`assistant`&&e.reasoning&&p.current>0&&u.current.set(e.id,p.current)}d.current=n},[n]),(0,y.useEffect)(()=>{if(!n){l.current=null;return}l.current=Date.now(),c(0);let e=setInterval(()=>{l.current&&c(Math.round((Date.now()-l.current)/1e3))},500);return()=>clearInterval(e)},[n]);let _=t.at(-1);return(0,y.useEffect)(()=>{n&&_?.role===`assistant`&&_.content&&(l.current=null)},[n,_?.role,_?.content]),(0,F.jsxs)(`div`,{className:`flex h-full flex-col brand-surface text-black`,children:[(0,F.jsxs)(`header`,{className:`flex-none flex items-center justify-between border-b border-[#0000001f] px-6 py-3 h-14`,children:[(0,F.jsx)(`button`,{onClick:e,className:`cursor-pointer transition-transform duration-300 hover:scale-[1.02]`,title:`Back to home`,children:(0,F.jsx)(`img`,{src:`/liquid.svg`,alt:`Liquid AI`,className:`h-6 w-auto`,draggable:!1})}),(0,F.jsxs)(`button`,{onClick:a,className:`flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs text-[#6d6d6d] hover:text-black hover:bg-[#f5f5f5] transition-opacity duration-300 cursor-pointer ${g?`opacity-100`:`opacity-0 pointer-events-none`}`,title:`New chat`,children:[(0,F.jsx)(Al,{className:`h-3.5 w-3.5`}),`New chat`]})]}),h?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`main`,{ref:o,className:`min-h-0 flex-1 overflow-y-auto px-4 py-6 animate-fade-in`,children:(0,F.jsxs)(`div`,{className:`mx-auto flex max-w-3xl flex-col gap-4`,children:[!m&&(0,F.jsx)(UL,{}),t.map((e,r)=>{let i=r===t.length-1&&e.role===`assistant`;return(0,F.jsx)(HL,{msg:e,index:r,isStreaming:n&&i,thinkingSeconds:i?s:u.current.get(e.id),isGenerating:n},e.id)})]})}),(0,F.jsxs)(`footer`,{className:`flex-none px-4 py-3 animate-fade-in relative`,children:[m&&(0,F.jsx)(`div`,{className:`absolute bottom-full left-0 right-0 flex justify-center pointer-events-none mb-[-8px]`,children:(0,F.jsx)(`div`,{className:`pointer-events-auto`,children:(0,F.jsx)(UL,{})})}),(0,F.jsx)(GL,{showDisclaimer:!0,animated:!0})]})]}):(0,F.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center px-4`,children:[(0,F.jsx)(`div`,{className:`mb-8 text-center animate-rise-in`,children:(0,F.jsx)(`p`,{className:`text-3xl font-medium text-black`,children:`What can I help you with?`})}),(0,F.jsx)(GL,{showDisclaimer:!1,animated:!0}),(0,F.jsx)(`div`,{className:`mt-6 flex flex-wrap justify-center gap-2 max-w-3xl animate-rise-in-delayed`,children:WL.map(({label:e,prompt:t})=>(0,F.jsx)(`button`,{onClick:()=>r(t),className:`rounded-lg border border-[#0000001f] bg-white px-3 py-2 text-xs text-[#6d6d6d] hover:text-black hover:border-[#5505af] transition-colors cursor-pointer shadow-sm`,children:e},e))})]})]})}function qL(){let{status:e,loadModel:t}=Ul(),[n,r]=(0,y.useState)(`intro`),[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(!1),c=e.state===`ready`,l=i&&!c&&e.state!==`error`;return(0,y.useEffect)(()=>{c&&i&&s(!0)},[c,i]),(0,F.jsxs)(`div`,{className:`relative h-screen w-screen brand-surface`,children:[n===`intro`&&(0,F.jsx)(pl,{onEnter:()=>r(`app`)}),n===`app`&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`absolute inset-0 z-10 transition-all duration-700 ${o?`opacity-0 pointer-events-none`:`opacity-100`}`,children:(0,F.jsx)(zl,{onStart:()=>{a(!0),t()},status:e,isLoading:l,showChat:o})}),(0,F.jsx)(`div`,{className:`absolute inset-0 transition-all duration-700 ${o?`opacity-100`:`opacity-0 pointer-events-none`}`,children:i&&(0,F.jsx)(KL,{onGoHome:()=>{s(!1),setTimeout(()=>a(!1),700)}})})]})]})}var JL=s({InferenceSession:()=>YR,TRACE:()=>BR,TRACE_EVENT_BEGIN:()=>WR,TRACE_EVENT_END:()=>GR,TRACE_FUNC_BEGIN:()=>HR,TRACE_FUNC_END:()=>UR,Tensor:()=>RR,default:()=>EV,env:()=>gR,registerBackend:()=>oR}),YL=Object.defineProperty,XL=Object.getOwnPropertyDescriptor,ZL=Object.getOwnPropertyNames,QL=Object.prototype.hasOwnProperty,$L=(e=>typeof u<`u`?u:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof u<`u`?u:e)[t]}):e)(function(e){if(typeof u<`u`)return u.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),eR=(e,t)=>()=>(e&&(t=e(e=0)),t),tR=(e,t)=>{for(var n in t)YL(e,n,{get:t[n],enumerable:!0})},nR=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of ZL(t))!QL.call(e,i)&&i!==n&&YL(e,i,{get:()=>t[i],enumerable:!(r=XL(t,i))||r.enumerable});return e},rR=e=>nR(YL({},`__esModule`,{value:!0}),e),iR,aR,oR,sR,cR,lR=eR(()=>{iR=new Map,aR=[],oR=(e,t,n)=>{if(t&&typeof t.init==`function`&&typeof t.createInferenceSessionHandler==`function`){let r=iR.get(e);if(r===void 0)iR.set(e,{backend:t,priority:n});else{if(r.priority>n)return;if(r.priority===n&&r.backend!==t)throw Error(`cannot register backend "${e}" using priority ${n}`)}if(n>=0){let t=aR.indexOf(e);t!==-1&&aR.splice(t,1);for(let t=0;t{let t=iR.get(e);if(!t)return`backend not found.`;if(t.initialized)return t.backend;if(t.aborted)return t.error;{let n=!!t.initPromise;try{return n||(t.initPromise=t.backend.init(e)),await t.initPromise,t.initialized=!0,t.backend}catch(e){return n||(t.error=`${e}`,t.aborted=!0),t.error}finally{delete t.initPromise}}},cR=async e=>{let t=e.executionProviders||[],n=t.map(e=>typeof e==`string`?e:e.name),r=n.length===0?aR:n,i,a=[],o=new Set;for(let e of r){let t=await sR(e);typeof t==`string`?a.push({name:e,err:t}):(i||=t,i===t&&o.add(e))}if(!i)throw Error(`no available backend found. ERR: ${a.map(e=>`[${e.name}] ${e.err}`).join(`, `)}`);for(let{name:e,err:t}of a)n.includes(e)&&console.warn(`removing requested execution provider "${e}" from session options because it is not available: ${t}`);let s=t.filter(e=>o.has(typeof e==`string`?e:e.name));return[i,new Proxy(e,{get:(e,t)=>t===`executionProviders`?s:Reflect.get(e,t)})]}}),uR=eR(()=>{lR()}),dR,fR=eR(()=>{dR=`1.24.0-dev.20251116-b39e144322`}),pR,mR,hR=eR(()=>{fR(),pR=`warning`,mR={wasm:{},webgl:{},webgpu:{},versions:{common:dR},set logLevel(e){if(e!==void 0){if(typeof e!=`string`||[`verbose`,`info`,`warning`,`error`,`fatal`].indexOf(e)===-1)throw Error(`Unsupported logging level: ${e}`);pR=e}},get logLevel(){return pR}},Object.defineProperty(mR,`logLevel`,{enumerable:!0})}),gR,_R=eR(()=>{hR(),gR=mR}),vR,yR,bR=eR(()=>{vR=(e,t)=>{let n=typeof document<`u`?document.createElement(`canvas`):new OffscreenCanvas(1,1);n.width=e.dims[3],n.height=e.dims[2];let r=n.getContext(`2d`);if(r!=null){let i,a;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[3]):(i=e.dims[3],a=e.dims[2]);let o=t?.format===void 0?`RGB`:t.format,s=t?.norm,c,l;s===void 0||s.mean===void 0?c=[255,255,255,255]:typeof s.mean==`number`?c=[s.mean,s.mean,s.mean,s.mean]:(c=[s.mean[0],s.mean[1],s.mean[2],0],s.mean[3]!==void 0&&(c[3]=s.mean[3])),s===void 0||s.bias===void 0?l=[0,0,0,0]:typeof s.bias==`number`?l=[s.bias,s.bias,s.bias,s.bias]:(l=[s.bias[0],s.bias[1],s.bias[2],0],s.bias[3]!==void 0&&(l[3]=s.bias[3]));let u=a*i,d=0,f=u,p=u*2,m=-1;o===`RGBA`?(d=0,f=u,p=u*2,m=u*3):o===`RGB`?(d=0,f=u,p=u*2):o===`RBG`&&(d=0,p=u,f=u*2);for(let t=0;t{let n=typeof document<`u`?document.createElement(`canvas`).getContext(`2d`):new OffscreenCanvas(1,1).getContext(`2d`),r;if(n!=null){let i,a,o;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[1],o=e.dims[3]):(i=e.dims[3],a=e.dims[2],o=e.dims[1]);let s=t!==void 0&&t.format!==void 0?t.format:`RGB`,c=t?.norm,l,u;c===void 0||c.mean===void 0?l=[255,255,255,255]:typeof c.mean==`number`?l=[c.mean,c.mean,c.mean,c.mean]:(l=[c.mean[0],c.mean[1],c.mean[2],255],c.mean[3]!==void 0&&(l[3]=c.mean[3])),c===void 0||c.bias===void 0?u=[0,0,0,0]:typeof c.bias==`number`?u=[c.bias,c.bias,c.bias,c.bias]:(u=[c.bias[0],c.bias[1],c.bias[2],0],c.bias[3]!==void 0&&(u[3]=c.bias[3]));let d=a*i;if(t!==void 0&&(t.format!==void 0&&o===4&&t.format!==`RGBA`||o===3&&t.format!==`RGB`&&t.format!==`BGR`))throw Error(`Tensor format doesn't match input tensor dims`);let f=0,p=1,m=2,h=3,g=0,_=d,v=d*2,y=-1;s===`RGBA`?(g=0,_=d,v=d*2,y=d*3):s===`RGB`?(g=0,_=d,v=d*2):s===`RBG`&&(g=0,v=d,_=d*2),r=n.createImageData(i,a);for(let t=0;t{LR(),xR=(e,t)=>{if(e===void 0)throw Error(`Image buffer must be defined`);if(t.height===void 0||t.width===void 0)throw Error(`Image height and width must be defined`);if(t.tensorLayout===`NHWC`)throw Error(`NHWC Tensor layout is not supported yet`);let{height:n,width:r}=t,i=t.norm??{mean:255,bias:0},a,o;a=typeof i.mean==`number`?[i.mean,i.mean,i.mean,i.mean]:[i.mean[0],i.mean[1],i.mean[2],i.mean[3]??255],o=typeof i.bias==`number`?[i.bias,i.bias,i.bias,i.bias]:[i.bias[0],i.bias[1],i.bias[2],i.bias[3]??0];let s=t.format===void 0?`RGBA`:t.format,c=t.tensorFormat!==void 0&&t.tensorFormat!==void 0?t.tensorFormat:`RGB`,l=n*r,u=c===`RGBA`?new Float32Array(l*4):new Float32Array(l*3),d=4,f=0,p=1,m=2,h=3,g=0,_=l,v=l*2,y=-1;s===`RGB`&&(d=3,f=0,p=1,m=2,h=-1),c===`RGBA`?y=l*3:c===`RBG`?(g=0,v=l,_=l*2):c===`BGR`&&(v=0,_=l,g=l*2);for(let t=0;t{let n=typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement,r=typeof ImageData<`u`&&e instanceof ImageData,i=typeof ImageBitmap<`u`&&e instanceof ImageBitmap,a=typeof e==`string`,o,s=t??{},c=()=>{if(typeof document<`u`)return document.createElement(`canvas`);if(typeof OffscreenCanvas<`u`)return new OffscreenCanvas(1,1);throw Error(`Canvas is not supported`)},l=e=>typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||e instanceof OffscreenCanvas?e.getContext(`2d`):null;if(n){let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let n=e.height,i=e.width;if(t!==void 0&&t.resizedHeight!==void 0&&t.resizedWidth!==void 0&&(n=t.resizedHeight,i=t.resizedWidth),t!==void 0){if(s=t,t.tensorFormat!==void 0)throw Error(`Image input config format must be RGBA for HTMLImageElement`);s.tensorFormat=`RGBA`,s.height=n,s.width=i}else s.tensorFormat=`RGBA`,s.height=n,s.width=i;r.drawImage(e,0,0),o=r.getImageData(0,0,i,n).data}else throw Error(`Can not access image data`)}else if(r){let n,r;if(t!==void 0&&t.resizedWidth!==void 0&&t.resizedHeight!==void 0?(n=t.resizedHeight,r=t.resizedWidth):(n=e.height,r=e.width),t!==void 0&&(s=t),s.format=`RGBA`,s.height=n,s.width=r,t!==void 0){let t=c();t.width=r,t.height=n;let i=l(t);if(i!=null)i.putImageData(e,0,0),o=i.getImageData(0,0,r,n).data;else throw Error(`Can not access image data`)}else o=e.data}else if(i){if(t===void 0)throw Error(`Please provide image config with format for Imagebitmap`);let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let t=e.height,n=e.width;return r.drawImage(e,0,0,n,t),o=r.getImageData(0,0,n,t).data,s.height=t,s.width=n,xR(o,s)}else throw Error(`Can not access image data`)}else{if(a)return new Promise((t,n)=>{let r=c(),i=l(r);if(!e||!i)return n();let a=new Image;a.crossOrigin=`Anonymous`,a.src=e,a.onload=()=>{r.width=a.width,r.height=a.height,i.drawImage(a,0,0,r.width,r.height);let e=i.getImageData(0,0,r.width,r.height);s.height=r.height,s.width=r.width,t(xR(e.data,s))}});throw Error(`Input data provided is not supported - aborted tensor creation`)}if(o!==void 0)return xR(o,s);throw Error(`Input data provided is not supported - aborted tensor creation`)},CR=(e,t)=>{let{width:n,height:r,download:i,dispose:a}=t;return new IR({location:`texture`,type:`float32`,texture:e,dims:[1,r,n,4],download:i,dispose:a})},wR=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new IR({location:`gpu-buffer`,type:n??`float32`,gpuBuffer:e,dims:r,download:i,dispose:a})},TR=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new IR({location:`ml-tensor`,type:n??`float32`,mlTensor:e,dims:r,download:i,dispose:a})},ER=(e,t,n)=>new IR({location:`cpu-pinned`,type:e,data:t,dims:n??[t.length]})}),OR,kR,AR,jR,MR=eR(()=>{OR=new Map([[`float32`,Float32Array],[`uint8`,Uint8Array],[`int8`,Int8Array],[`uint16`,Uint16Array],[`int16`,Int16Array],[`int32`,Int32Array],[`bool`,Uint8Array],[`float64`,Float64Array],[`uint32`,Uint32Array],[`int4`,Uint8Array],[`uint4`,Uint8Array]]),kR=new Map([[Float32Array,`float32`],[Uint8Array,`uint8`],[Int8Array,`int8`],[Uint16Array,`uint16`],[Int16Array,`int16`],[Int32Array,`int32`],[Float64Array,`float64`],[Uint32Array,`uint32`]]),AR=!1,jR=()=>{if(!AR){AR=!0;let e=typeof BigInt64Array<`u`&&BigInt64Array.from,t=typeof BigUint64Array<`u`&&BigUint64Array.from,n=globalThis.Float16Array,r=typeof n<`u`&&n.from;e&&(OR.set(`int64`,BigInt64Array),kR.set(BigInt64Array,`int64`)),t&&(OR.set(`uint64`,BigUint64Array),kR.set(BigUint64Array,`uint64`)),r?(OR.set(`float16`,n),kR.set(n,`float16`)):OR.set(`float16`,Uint16Array)}}}),NR,PR,FR=eR(()=>{LR(),NR=e=>{let t=1;for(let n=0;n{switch(e.location){case`cpu`:return new IR(e.type,e.data,t);case`cpu-pinned`:return new IR({location:`cpu-pinned`,data:e.data,type:e.type,dims:t});case`texture`:return new IR({location:`texture`,texture:e.texture,type:e.type,dims:t});case`gpu-buffer`:return new IR({location:`gpu-buffer`,gpuBuffer:e.gpuBuffer,type:e.type,dims:t});case`ml-tensor`:return new IR({location:`ml-tensor`,mlTensor:e.mlTensor,type:e.type,dims:t});default:throw Error(`tensorReshape: tensor location ${e.location} is not supported`)}}}),IR,LR=eR(()=>{bR(),DR(),MR(),FR(),IR=class{constructor(e,t,n){jR();let r,i;if(typeof e==`object`&&`location`in e)switch(this.dataLocation=e.location,r=e.type,i=e.dims,e.location){case`cpu-pinned`:{let t=OR.get(r);if(!t)throw TypeError(`unsupported type "${r}" to create tensor from pinned buffer`);if(!(e.data instanceof t))throw TypeError(`buffer should be of type ${t.name}`);this.cpuData=e.data;break}case`texture`:if(r!==`float32`)throw TypeError(`unsupported type "${r}" to create tensor from texture`);this.gpuTextureData=e.texture,this.downloader=e.download,this.disposer=e.dispose;break;case`gpu-buffer`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from gpu buffer`);this.gpuBufferData=e.gpuBuffer,this.downloader=e.download,this.disposer=e.dispose;break;case`ml-tensor`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint64`&&r!==`int8`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from MLTensor`);this.mlTensorData=e.mlTensor,this.downloader=e.download,this.disposer=e.dispose;break;default:throw Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let a,o;if(typeof e==`string`)if(r=e,o=n,e===`string`){if(!Array.isArray(t))throw TypeError(`A string tensor's data must be a string array.`);a=t}else{let n=OR.get(e);if(n===void 0)throw TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(t)){if(e===`float16`&&n===Uint16Array||e===`uint4`||e===`int4`)throw TypeError(`Creating a ${e} tensor from number array is not supported. Please use ${n.name} as data.`);a=e===`uint64`||e===`int64`?n.from(t,BigInt):n.from(t)}else if(t instanceof n)a=t;else if(t instanceof Uint8ClampedArray)if(e===`uint8`)a=Uint8Array.from(t);else throw TypeError(`A Uint8ClampedArray tensor's data must be type of uint8`);else if(e===`float16`&&t instanceof Uint16Array&&n!==Uint16Array)a=new globalThis.Float16Array(t.buffer,t.byteOffset,t.length);else throw TypeError(`A ${r} tensor's data must be type of ${n}`)}else if(o=t,Array.isArray(e)){if(e.length===0)throw TypeError(`Tensor type cannot be inferred from an empty array.`);let t=typeof e[0];if(t===`string`)r=`string`,a=e;else if(t===`boolean`)r=`bool`,a=Uint8Array.from(e);else throw TypeError(`Invalid element type of data array: ${t}.`)}else if(e instanceof Uint8ClampedArray)r=`uint8`,a=Uint8Array.from(e);else{let t=kR.get(e.constructor);if(t===void 0)throw TypeError(`Unsupported type for tensor data: ${e.constructor}.`);r=t,a=e}if(o===void 0)o=[a.length];else if(!Array.isArray(o))throw TypeError(`A tensor's dims must be a number array`);i=o,this.cpuData=a,this.dataLocation=`cpu`}let a=NR(i);if(this.cpuData&&a!==this.cpuData.length&&!((r===`uint4`||r===`int4`)&&Math.ceil(a/2)===this.cpuData.length))throw Error(`Tensor's size(${a}) does not match data length(${this.cpuData.length}).`);this.type=r,this.dims=i,this.size=a}static async fromImage(e,t){return SR(e,t)}static fromTexture(e,t){return CR(e,t)}static fromGpuBuffer(e,t){return wR(e,t)}static fromMLTensor(e,t){return TR(e,t)}static fromPinnedBuffer(e,t,n){return ER(e,t,n)}toDataURL(e){return vR(this,e)}toImageData(e){return yR(this,e)}get data(){if(this.ensureValid(),!this.cpuData)throw Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw Error(`The data is not stored as a WebGL texture.`);return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw Error(`The data is not stored as a WebGPU buffer.`);return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw Error(`The data is not stored as a WebNN MLTensor.`);return this.mlTensorData}async getData(e){switch(this.ensureValid(),this.dataLocation){case`cpu`:case`cpu-pinned`:return this.data;case`texture`:case`gpu-buffer`:case`ml-tensor`:if(!this.downloader)throw Error(`The current tensor is not created with a specified data downloader.`);if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);try{this.isDownloading=!0;let t=await this.downloader();return this.downloader=void 0,this.dataLocation=`cpu`,this.cpuData=t,e&&this.disposer&&(this.disposer(),this.disposer=void 0),t}finally{this.isDownloading=!1}default:throw Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);this.disposer&&=(this.disposer(),void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation=`none`}ensureValid(){if(this.dataLocation===`none`)throw Error(`The tensor is disposed.`)}reshape(e){if(this.ensureValid(),this.downloader||this.disposer)throw Error(`Cannot reshape a tensor that owns GPU resource.`);return PR(this,e)}}}),RR,zR=eR(()=>{LR(),RR=IR}),BR,VR,HR,UR,WR,GR,KR=eR(()=>{hR(),BR=(e,t)=>{(typeof mR.trace>`u`?!mR.wasm.trace:!mR.trace)||console.timeStamp(`${e}::ORT::${t}`)},VR=(e,t)=>{let n=Error().stack?.split(/\r\n|\r|\n/g)||[],r=!1;for(let i=0;i{(typeof mR.trace>`u`?!mR.wasm.trace:!mR.trace)||VR(`BEGIN`,e)},UR=e=>{(typeof mR.trace>`u`?!mR.wasm.trace:!mR.trace)||VR(`END`,e)},WR=e=>{(typeof mR.trace>`u`?!mR.wasm.trace:!mR.trace)||console.time(`ORT::${e}`)},GR=e=>{(typeof mR.trace>`u`?!mR.wasm.trace:!mR.trace)||console.timeEnd(`ORT::${e}`)}}),qR,JR=eR(()=>{lR(),zR(),KR(),qR=class e{constructor(e){this.handler=e}async run(e,t,n){HR(),WR(`InferenceSession.run`);let r={},i={};if(typeof e!=`object`||!e||e instanceof RR||Array.isArray(e))throw TypeError(`'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.`);let a=!0;if(typeof t==`object`){if(t===null)throw TypeError(`Unexpected argument[1]: cannot be null.`);if(t instanceof RR)throw TypeError(`'fetches' cannot be a Tensor`);if(Array.isArray(t)){if(t.length===0)throw TypeError(`'fetches' cannot be an empty array.`);a=!1;for(let e of t){if(typeof e!=`string`)throw TypeError(`'fetches' must be a string array or an object.`);if(this.outputNames.indexOf(e)===-1)throw RangeError(`'fetches' contains invalid output name: ${e}.`);r[e]=null}if(typeof n==`object`&&n)i=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else{let e=!1,o=Object.getOwnPropertyNames(t);for(let n of this.outputNames)if(o.indexOf(n)!==-1){let i=t[n];(i===null||i instanceof RR)&&(e=!0,a=!1,r[n]=i)}if(e){if(typeof n==`object`&&n)i=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else i=t}}else if(typeof t<`u`)throw TypeError(`Unexpected argument[1]: must be 'fetches' or 'options'.`);for(let t of this.inputNames)if(typeof e[t]>`u`)throw Error(`input '${t}' is missing in 'feeds'.`);if(a)for(let e of this.outputNames)r[e]=null;let o=await this.handler.run(e,r,i),s={};for(let e in o)if(Object.hasOwnProperty.call(o,e)){let t=o[e];t instanceof RR?s[e]=t:s[e]=new RR(t.type,t.data,t.dims)}return GR(`InferenceSession.run`),UR(),s}async release(){return this.handler.dispose()}static async create(t,n,r,i){HR(),WR(`InferenceSession.create`);let a,o={};if(typeof t==`string`){if(a=t,typeof n==`object`&&n)o=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else if(t instanceof Uint8Array){if(a=t,typeof n==`object`&&n)o=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&t instanceof SharedArrayBuffer){let e=t,s=0,c=t.byteLength;if(typeof n==`object`&&n)o=n;else if(typeof n==`number`){if(s=n,!Number.isSafeInteger(s))throw RangeError(`'byteOffset' must be an integer.`);if(s<0||s>=e.byteLength)throw RangeError(`'byteOffset' is out of range [0, ${e.byteLength}).`);if(c=t.byteLength-s,typeof r==`number`){if(c=r,!Number.isSafeInteger(c))throw RangeError(`'byteLength' must be an integer.`);if(c<=0||s+c>e.byteLength)throw RangeError(`'byteLength' is out of range (0, ${e.byteLength-s}].`);if(typeof i==`object`&&i)o=i;else if(typeof i<`u`)throw TypeError(`'options' must be an object.`)}else if(typeof r<`u`)throw TypeError(`'byteLength' must be a number.`)}else if(typeof n<`u`)throw TypeError(`'options' must be an object.`);a=new Uint8Array(e,s,c)}else throw TypeError(`Unexpected argument[0]: must be 'path' or 'buffer'.`);let[s,c]=await cR(o),l=await s.createInferenceSessionHandler(a,c);return GR(`InferenceSession.create`),UR(),new e(l)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}}}),YR,XR=eR(()=>{JR(),YR=qR}),ZR=eR(()=>{}),QR=eR(()=>{}),$R=eR(()=>{}),ez=eR(()=>{}),tz={};tR(tz,{InferenceSession:()=>YR,TRACE:()=>BR,TRACE_EVENT_BEGIN:()=>WR,TRACE_EVENT_END:()=>GR,TRACE_FUNC_BEGIN:()=>HR,TRACE_FUNC_END:()=>UR,Tensor:()=>RR,env:()=>gR,registerBackend:()=>oR});var nz=eR(()=>{uR(),_R(),XR(),zR(),ZR(),QR(),KR(),$R(),ez()}),rz=eR(()=>{}),iz={};tR(iz,{default:()=>sz});var az,oz,sz,cz=eR(()=>{XB(),Rz(),Oz(),az=`ort-wasm-proxy-worker`,oz=globalThis.self?.name===az,oz&&(self.onmessage=e=>{let{type:t,in:n}=e.data;try{switch(t){case`init-wasm`:Iz(n.wasm).then(()=>{RB(n).then(()=>{postMessage({type:t})},e=>{postMessage({type:t,err:e})})},e=>{postMessage({type:t,err:e})});break;case`init-ep`:{let{epName:e,env:r}=n;zB(r,e).then(()=>{postMessage({type:t})},e=>{postMessage({type:t,err:e})});break}case`copy-from`:{let{buffer:e}=n,r=UB(e);postMessage({type:t,out:r});break}case`create`:{let{model:e,options:r}=n;WB(e,r).then(e=>{postMessage({type:t,out:e})},e=>{postMessage({type:t,err:e})});break}case`release`:GB(n),postMessage({type:t});break;case`run`:{let{sessionId:e,inputIndices:r,inputs:i,outputIndices:a,options:o}=n;qB(e,r,i,a,Array(a.length).fill(null),o).then(e=>{e.some(e=>e[3]!==`cpu`)?postMessage({type:t,err:`Proxy does not support non-cpu tensor location.`}):postMessage({type:t,out:e},YB([...i,...e]))},e=>{postMessage({type:t,err:e})});break}case`end-profiling`:JB(n),postMessage({type:t});break;default:}}catch(e){postMessage({type:t,err:e})}}),sz=oz?null:e=>new Worker(e??_z,{type:`module`,name:az})}),lz={};tR(lz,{default:()=>dz});async function uz(e={}){var t=e,n=!!globalThis.window,r=!!globalThis.WorkerGlobalScope,i=r&&self.name?.startsWith(`em-pthread`);t.mountExternalData=(e,n)=>{e.startsWith(`./`)&&(e=e.substring(2)),(t.Zc||=new Map).set(e,n)},t.unmountExternalData=()=>{delete t.Zc},globalThis.SharedArrayBuffer??new WebAssembly.Memory({initial:0,maximum:0,Me:!0}).buffer.constructor;let a=()=>{let e=e=>(...t)=>{let n=on;return t=e(...t),on==n?t:new Promise((e,t)=>{pn={resolve:e,reject:t}})};(()=>{for(let n of[`_OrtAppendExecutionProvider`,`_OrtCreateSession`,`_OrtRun`,`_OrtRunWithBinding`,`_OrtBindInput`])t[n]=e(t[n])})(),typeof jsepRunAsync<`u`&&(t._OrtRun=jsepRunAsync(t._OrtRun),t._OrtRunWithBinding=jsepRunAsync(t._OrtRunWithBinding)),a=void 0};t.asyncInit=()=>{a?.()};var o,s,c=(e,t)=>{throw t},l=import.meta.url,u=``;if(n||r){try{u=new URL(`.`,l).href}catch{}r&&(s=e=>{var t=new XMLHttpRequest;return t.open(`GET`,e,!1),t.responseType=`arraybuffer`,t.send(null),new Uint8Array(t.response)}),o=async e=>{if(S(e))return new Promise((t,n)=>{var r=new XMLHttpRequest;r.open(`GET`,e,!0),r.responseType=`arraybuffer`,r.onload=()=>{r.status==200||r.status==0&&r.response?t(r.response):n(r.status)},r.onerror=n,r.send(null)});var t=await fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)}}var d,f,p,m,h,g,_=console.log.bind(console),v=console.error.bind(console),y=_,b=v,x=!1,S=e=>e.startsWith(`file://`);function C(){Oe.buffer!=T.buffer&&ie()}if(i){let e=function(n){try{var r=n.data,i=r.Uc;if(i===`load`){let n=[];self.onmessage=e=>n.push(e),g=()=>{postMessage({Uc:`loaded`});for(let t of n)e(t);self.onmessage=e};for(let e of r.ne)t[e]&&!t[e].proxy||(t[e]=(...t)=>{postMessage({Uc:`callHandler`,me:e,args:t})},e==`print`&&(y=t[e]),e==`printErr`&&(b=t[e]));Oe=r.we,ie(),f=r.xe,ce(),Yo()}else if(i===`run`){(function(e){var t=(C(),A)[e+52>>>2>>>0];e=(C(),A)[e+56>>>2>>>0],ua(t,t-e),da(t)})(r.Sc),ea(r.Sc,0,0,1,0,0),Te(),Jt(r.Sc),w||=(ji(),!0);try{ke(r.te,r.ad)}catch(e){if(e!=`unwind`)throw e}}else r.target!==`setimmediate`&&(i===`checkMailbox`?w&&Yt():i&&(b(`worker: received unknown command ${i}`),b(r)))}catch(e){throw ta(),e}};var w=!1;self.onunhandledrejection=e=>{throw e.reason||e},self.onmessage=e}var T,E,D,O,k,A,ee,te,ne,j,re,M=!1;function ie(){var e=Oe.buffer;t.HEAP8=T=new Int8Array(e),D=new Int16Array(e),t.HEAPU8=E=new Uint8Array(e),O=new Uint16Array(e),t.HEAP32=k=new Int32Array(e),t.HEAPU32=A=new Uint32Array(e),ee=new Float32Array(e),te=new Float64Array(e),ne=new BigInt64Array(e),j=new BigUint64Array(e)}function ae(){M=!0,i?g():oo.dc()}function oe(e){throw b(e=`Aborted(`+e+`)`),x=!0,e=new WebAssembly.RuntimeError(e+`. Build with -sASSERTIONS for more info.`),h?.(e),e}function se(){return{a:{sa:lo,g:Ne,K:Fe,f:Be,n:Ve,h:He,wa:Ue,b:We,ea:Ge,Ja:qe,o:Je,fa:$e,Za:et,$b:tt,bc:N,_a:nt,Xa:rt,Qa:it,Wa:at,qa:ot,ac:st,Zb:ct,Ya:lt,_b:ut,db:dt,Fa:yt,Ub:bt,Sb:Ot,Ea:At,P:jt,J:Mt,Tb:Ft,ma:Ut,Vb:Wt,Ta:Gt,Xb:Xt,Ka:Qt,Pb:$t,Ha:en,Sa:Jt,ab:tn,W:hn,r:Sn,c:Ct,tb:Cn,y:wn,N:Tn,D:En,m:Dn,s:On,ub:kn,I:An,V:jn,j:Mn,u:Nn,q:Pn,k:Fn,Na:In,Oa:Bn,Pa:Vn,La:Hn,Ma:Un,Rb:Kn,fb:qn,cb:Xn,$:$n,sb:er,na:tr,bb:Jn,Y:nr,$a:rr,Yb:ir,G:Gn,ib:ar,_:or,ra:fr,Wb:pr,hb:dr,gb:mr,pb:Nr,F:Pr,va:Ir,ua:Lr,rb:Rr,Z:zr,w:Br,ob:Vr,nb:Hr,mb:Ur,qb:Wr,lb:Gr,kb:Kr,jb:qr,Ua:Zr,Va:Qr,Ia:ye,ga:$r,pa:ei,Ra:ti,oa:ri,Eb:qo,za:Bo,Fb:Ko,Aa:zo,H:Ao,e:mo,t:fo,x:uo,B:wo,Ib:Io,L:Do,v:go,Ba:Lo,ca:Vo,ja:Fo,Gb:Go,Hb:Wo,Da:jo,Ca:Po,Kb:Mo,O:Oo,da:Ro,d:ho,A:_o,l:po,Db:Jo,p:yo,z:Co,C:vo,E:bo,M:To,Lb:ko,U:Ho,ka:Eo,ba:Uo,Mb:So,Nb:xo,R:No,i:ii,a:Oe,eb:_e,Jb:ai,la:oi,Q:si,ta:ci,Ob:li,S:ui,Ab:di,Bb:fi,xa:pi,ha:mi,T:hi,Ga:gi,ya:_i,aa:vi,yb:yi,cc:bi,X:xi,Cb:Si,vb:Ci,wb:Ti,xb:Ei,ia:Di,zb:Oi,Qb:ki}}}async function ce(){function e(e,n){var r=oo=e.exports;e={};for(let[t,n]of Object.entries(r))typeof n==`function`?(r=rn(n),e[t]=r):e[t]=n;return oo=e,oo=function(){var e=oo,t=e=>t=>e(t)>>>0,n=e=>()=>e()>>>0;return(e=Object.assign({},e)).ec=t(e.ec),e.Hc=n(e.Hc),e.Jc=t(e.Jc),e.vd=(e=>(t,n)=>e(t,n)>>>0)(e.vd),e.Ad=t(e.Ad),e.Bd=n(e.Bd),e.Fd=t(e.Fd),e}(),Se.push(oo.md),Ai=(e=oo).ec,ji=e.fc,t._OrtInit=e.gc,t._OrtGetLastError=e.hc,t._OrtCreateSessionOptions=e.ic,t._OrtAppendExecutionProvider=e.jc,t._OrtAddFreeDimensionOverride=e.kc,t._OrtAddSessionConfigEntry=e.lc,t._OrtReleaseSessionOptions=e.mc,t._OrtCreateSession=e.nc,t._OrtReleaseSession=e.oc,t._OrtGetInputOutputCount=e.pc,t._OrtGetInputOutputMetadata=e.qc,t._OrtFree=e.rc,t._OrtCreateTensor=e.sc,t._OrtGetTensorData=e.tc,t._OrtReleaseTensor=e.uc,t._OrtCreateRunOptions=e.vc,t._OrtAddRunConfigEntry=e.wc,t._OrtReleaseRunOptions=e.xc,t._OrtCreateBinding=e.yc,t._OrtBindInput=e.zc,t._OrtBindOutput=e.Ac,t._OrtClearBoundOutputs=e.Bc,t._OrtReleaseBinding=e.Cc,t._OrtRunWithBinding=e.Dc,t._OrtRun=e.Ec,t._OrtEndProfiling=e.Fc,Mi=t._OrtGetWebGpuDevice=e.Gc,Ni=e.Hc,Pi=t._free=e.Ic,Fi=t._malloc=e.Jc,Ii=t._wgpuBufferRelease=e.Kc,Li=t._wgpuCreateInstance=e.Lc,Ri=e.Mc,zi=e.Nc,Bi=e.Oc,Vi=e.Pc,Hi=e.Qc,Ui=e.Tc,Wi=e.bd,Gi=e.cd,Ki=e.dd,qi=e.fd,Ji=e.gd,Yi=e.hd,Xi=e.id,Zi=e.jd,Qi=e.kd,$i=e.ld,ea=e.od,ta=e.pd,na=e.qd,ra=e.rd,ia=e.sd,aa=e.td,oa=e.ud,sa=e.vd,ca=e.wd,la=e.xd,ua=e.yd,da=e.zd,fa=e.Ad,pa=e.Bd,ma=e.Cd,ha=e.Dd,ga=e.Ed,_a=e.Fd,va=e.Gd,ya=e.Hd,ba=e.Id,xa=e.Jd,Sa=e.Kd,Ca=e.Ld,wa=e.Md,Ta=e.Nd,Ea=e.Od,Da=e.Pd,Oa=e.Qd,ka=e.Rd,Aa=e.Sd,ja=e.Td,Ma=e.Ud,Na=e.Vd,Pa=e.Wd,Fa=e.Yd,Ia=e.Zd,La=e._d,Ra=e.$d,za=e.be,Ba=e.ce,Va=e.de,Ha=e.ee,Ua=e.fe,Wa=e.ge,Ga=e.qe,Ka=e.ve,qa=e.ye,Ja=e.ze,Ya=e.Ae,Xa=e.Be,Za=e.Ce,Qa=e.De,$a=e.Ee,eo=e.Fe,to=e.Ge,no=e.ef,ro=e.ff,io=e.gf,ao=e.hf,f=n,oo}var n,r=se();return t.instantiateWasm?new Promise(n=>{t.instantiateWasm(r,(t,r)=>{n(e(t,r))})}):i?e(new WebAssembly.Instance(f,se()),f):(re??=t.locateFile?t.locateFile?t.locateFile(`ort-wasm-simd-threaded.asyncify.wasm`,u):u+`ort-wasm-simd-threaded.asyncify.wasm`:new URL(`/assets/ort-wasm-simd-threaded.asyncify-BC9nQecM.wasm`,``+import.meta.url).href,n=await async function(e){var t=re;if(!d&&!S(t))try{var n=fetch(t,{credentials:`same-origin`});return await WebAssembly.instantiateStreaming(n,e)}catch(e){b(`wasm streaming compile failed: ${e}`),b(`falling back to ArrayBuffer instantiation`)}return async function(e,t){try{var n=await async function(e){if(!d)try{var t=await o(e);return new Uint8Array(t)}catch{}if(e==re&&d)e=new Uint8Array(d);else{if(!s)throw`both async and sync fetching of the wasm failed`;e=s(e)}return e}(e);return await WebAssembly.instantiate(n,t)}catch(e){b(`failed to asynchronously prepare wasm: ${e}`),oe(e)}}(t,e)}(r),e(n.instance,n.module))}class le{name=`ExitStatus`;constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var ue=e=>{e.terminate(),e.onmessage=()=>{}},de=[],fe=0,pe=null,me=e=>{be.length==0&&(De(),Ee(be[0]));var t=be.pop();if(!t)return 6;xe.push(t),Ce[e.Sc]=t,t.Sc=e.Sc;var n={Uc:`run`,te:e.se,ad:e.ad,Sc:e.Sc};return t.postMessage(n,e.he),0},he=0,ge=(e,t,...n)=>{var r,i=16*n.length,a=pa(),o=fa(i),s=o>>>3;for(r of n)typeof r==`bigint`?((C(),ne)[s++>>>0]=1n,(C(),ne)[s++>>>0]=r):((C(),ne)[s++>>>0]=0n,(C(),te)[s++>>>0]=r);return e=na(e,0,i,o,t),da(a),e};function _e(e){if(i)return ge(0,1,e);if(p=e,!(0{if(p=e,i)throw ve(e),`unwind`;_e(e)},be=[],xe=[],Se=[],Ce={},we=e=>{var t=e.Sc;delete Ce[t],be.push(e),xe.splice(xe.indexOf(e),1),e.Sc=0,ra(t)};function Te(){Se.forEach(e=>e())}var Ee=e=>new Promise(n=>{e.onmessage=r=>{var i=r.data;if(r=i.Uc,i.$c&&i.$c!=Ni()){var a=Ce[i.$c];a?a.postMessage(i,i.he):b(`Internal error! Worker sent a message "${r}" to target pthread ${i.$c}, but that thread no longer exists!`)}else r===`checkMailbox`?Yt():r===`spawnThread`?me(i):r===`cleanupThread`?Kt(()=>{we(Ce[i.ue])}):r===`loaded`?(e.loaded=!0,n(e)):i.target===`setimmediate`?e.postMessage(i):r===`uncaughtException`?e.onerror(i.error):r===`callHandler`?t[i.me](...i.args):r&&b(`worker sent an unknown command ${r}`)},e.onerror=e=>{throw b(`worker sent an error! ${e.filename}:${e.lineno}: ${e.message}`),e};var r,i=[];for(r of[])t.propertyIsEnumerable(r)&&i.push(r);e.postMessage({Uc:`load`,ne:i,we:Oe,xe:f})});function De(){var e=new Worker((()=>{let e=URL;return import.meta.url>`file:`&&import.meta.url<`file;`?new e(`ort.webgpu.bundle.min.mjs`,import.meta.url):new URL(import.meta.url)})(),{type:`module`,workerData:`em-pthread`,name:`em-pthread`});be.push(e)}var Oe,ke=(e,t)=>{he=0,e=ya(e,t),0-9007199254740992>e||9007199254740992>>=0);return(C(),T)[t.Vc+12>>>0]==0&&(Ie(t,!0),je--),Le(t,!1),Ae.push(t),_a(e)}var Pe=0,Fe=()=>{ca(0,0);var e=Ae.pop();ma(e.nd),Pe=0};function Ie(e,t){t=t?1:0,(C(),T)[e.Vc+12>>>0]=t}function Le(e,t){t=t?1:0,(C(),T)[e.Vc+13>>>0]=t}class Re{constructor(e){this.nd=e,this.Vc=e-24}}var ze=e=>{var t=Pe;if(!t)return la(0),0;var n=new Re(t);(C(),A)[n.Vc+16>>>2>>>0]=t;var r=(C(),A)[n.Vc+4>>>2>>>0];if(!r)return la(0),t;for(var i of e){if(i===0||i===r)break;if(ga(i,r,n.Vc+16))return la(i),t}return la(r),t};function Be(){return ze([])}function Ve(e){return ze([e>>>0])}function He(e,t,n,r){return ze([e>>>0,t>>>0,n>>>0,r>>>0])}var Ue=()=>{var e=Ae.pop();e||oe(`no exception to throw`);var t=e.nd;throw(C(),T)[e.Vc+13>>>0]==0&&(Ae.push(e),Le(e,!0),Ie(e,!1),je++),ha(t),Pe=t};function We(e,t,n){var r=new Re(e>>>=0);throw t>>>=0,n>>>=0,(C(),A)[r.Vc+16>>>2>>>0]=0,(C(),A)[r.Vc+4>>>2>>>0]=t,(C(),A)[r.Vc+8>>>2>>>0]=n,ha(e),je++,Pe=e}var Ge=()=>je;function Ke(e,t,n,r){return i?ge(2,1,e,t,n,r):qe(e,t,n,r)}function qe(e,t,n,r){if(e>>>=0,t>>>=0,n>>>=0,r>>>=0,!globalThis.SharedArrayBuffer)return 6;var a=[];return i&&a.length===0?Ke(e,t,n,r):(e={se:n,Sc:e,ad:r,he:a},i?(e.Uc=`spawnThread`,postMessage(e,a),0):me(e))}function Je(e){throw Pe||=e>>>0,Pe}var Ye=globalThis.TextDecoder&&new TextDecoder,Xe=(e,t,n,r)=>{if(n=t+n,r)return n;for(;e[t]&&!(t>=n);)++t;return t},Ze=(e,t=0,n,r)=>{if(16<(n=Xe(e,t>>>=0,n,r))-t&&e.buffer&&Ye)return Ye.decode(e.buffer instanceof ArrayBuffer?e.subarray(t,n):e.slice(t,n));for(r=``;t(i=(240&i)==224?(15&i)<<12|a<<6|o:(7&i)<<18|a<<12|o<<6|63&e[t++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r},Qe=(e,t,n)=>(e>>>=0)?Ze((C(),E),e,t,n):``;function $e(e,t,n){return i?ge(3,1,e,t,n):0}function et(e,t){if(i)return ge(4,1,e,t)}function tt(e,t){if(i)return ge(5,1,e,t)}function N(e,t,n){if(i)return ge(6,1,e,t,n)}function nt(e,t,n){return i?ge(7,1,e,t,n):0}function rt(e,t){if(i)return ge(8,1,e,t)}function it(e,t,n){if(i)return ge(9,1,e,t,n)}function at(e,t,n,r){if(i)return ge(10,1,e,t,n,r)}function ot(e,t,n,r){if(i)return ge(11,1,e,t,n,r)}function st(e,t,n,r){if(i)return ge(12,1,e,t,n,r)}function ct(e){if(i)return ge(13,1,e)}function lt(e,t){if(i)return ge(14,1,e,t)}function ut(e,t,n){if(i)return ge(15,1,e,t,n)}var dt=()=>oe(``),ft=e=>{e>>>=0;for(var t=``;;){var n=(C(),E)[e++>>>0];if(!n)return t;t+=String.fromCharCode(n)}},pt={},mt={},ht={},gt=class extends Error{constructor(e){super(e),this.name=`BindingError`}};function _t(e,t,n={}){return function(e,t,n={}){var r=t.name;if(!e)throw new gt(`type "${r}" must have a positive integer typeid pointer`);if(mt.hasOwnProperty(e)){if(n.oe)return;throw new gt(`Cannot register type '${r}' twice`)}mt[e]=t,delete ht[e],pt.hasOwnProperty(e)&&(t=pt[e],delete pt[e],t.forEach(e=>e()))}(e,t,n)}var vt=(e,t,n)=>{switch(t){case 1:return n?e=>(C(),T)[e>>>0]:e=>(C(),E)[e>>>0];case 2:return n?e=>(C(),D)[e>>>1>>>0]:e=>(C(),O)[e>>>1>>>0];case 4:return n?e=>(C(),k)[e>>>2>>>0]:e=>(C(),A)[e>>>2>>>0];case 8:return n?e=>(C(),ne)[e>>>3>>>0]:e=>(C(),j)[e>>>3>>>0];default:throw TypeError(`invalid integer width (${t}): ${e}`)}};function yt(e,t,n,r,i){e>>>=0,n>>>=0,t=ft(t>>>0);let a=e=>e;if(r=r===0n){let e=8*n;a=t=>BigInt.asUintN(e,t),i=a(i)}_t(e,{name:t,Rc:a,Xc:(e,t)=>(typeof t==`number`&&(t=BigInt(t)),t),Wc:vt(t,n,!r),Yc:null})}function bt(e,t,n,r){_t(e>>>=0,{name:t=ft(t>>>0),Rc:function(e){return!!e},Xc:function(e,t){return t?n:r},Wc:function(e){return this.Rc((C(),E)[e>>>0])},Yc:null})}var xt=[],St=[0,1,,1,null,1,!0,1,!1,1];function Ct(e){9<(e>>>=0)&&--St[e+1]==0&&(St[e]=void 0,xt.push(e))}var wt=e=>{if(!e)throw new gt(`Cannot use deleted val. handle = ${e}`);return St[e]},Tt=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let t=xt.pop()||St.length;return St[t]=e,St[t+1]=1,t}};function Et(e){return this.Rc((C(),A)[e>>>2>>>0])}var Dt={name:`emscripten::val`,Rc:e=>{var t=wt(e);return Ct(e),t},Xc:(e,t)=>Tt(t),Wc:Et,Yc:null};function Ot(e){return _t(e>>>0,Dt)}var kt=(e,t)=>{switch(t){case 4:return function(e){return this.Rc((C(),ee)[e>>>2>>>0])};case 8:return function(e){return this.Rc((C(),te)[e>>>3>>>0])};default:throw TypeError(`invalid float width (${t}): ${e}`)}};function At(e,t,n){n>>>=0,_t(e>>>=0,{name:t=ft(t>>>0),Rc:e=>e,Xc:(e,t)=>t,Wc:kt(t,n),Yc:null})}function jt(e,t,n,r,i){e>>>=0,n>>>=0,t=ft(t>>>0);let a=e=>e;if(r===0){var o=32-8*n;a=e=>e<>>o,i=a(i)}_t(e,{name:t,Rc:a,Xc:(e,t)=>t,Wc:vt(t,n,r!==0),Yc:null})}function Mt(e,t,n){function r(e){var t=(C(),A)[e>>>2>>>0];return e=(C(),A)[e+4>>>2>>>0],new i((C(),T).buffer,e,t)}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];_t(e>>>=0,{name:n=ft(n>>>0),Rc:r,Wc:r},{oe:!0})}var Nt=(e,t,n)=>{var r=(C(),E);if(t>>>=0,0=o){if(t>=n)break;r[t++>>>0]=o}else if(2047>=o){if(t+1>=n)break;r[t++>>>0]=192|o>>6,r[t++>>>0]=128|63&o}else if(65535>=o){if(t+2>=n)break;r[t++>>>0]=224|o>>12,r[t++>>>0]=128|o>>6&63,r[t++>>>0]=128|63&o}else{if(t+3>=n)break;r[t++>>>0]=240|o>>18,r[t++>>>0]=128|o>>12&63,r[t++>>>0]=128|o>>6&63,r[t++>>>0]=128|63&o,a++}}r[t>>>0]=0,e=t-i}else e=0;return e},Pt=e=>{for(var t=0,n=0;n=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t};function Ft(e,t){_t(e>>>=0,{name:t=ft(t>>>0),Rc(e){var t=(C(),A)[e>>>2>>>0];return t=Qe(e+4,t,!0),Pi(e),t},Xc(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var n=typeof t==`string`;if(!(n||ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT==1))throw new gt(`Cannot pass non-string to std::string`);var r=n?Pt(t):t.length,i=Fi(4+r+1),a=i+4;return(C(),A)[i>>>2>>>0]=r,n?Nt(t,a,r+1):(C(),E).set(t,a>>>0),e!==null&&e.push(Pi,i),i},Wc:Et,Yc(e){Pi(e)}})}var It=globalThis.TextDecoder?new TextDecoder(`utf-16le`):void 0,Lt=(e,t,n)=>{if(e>>>=1,16<(t=Xe((C(),O),e,t/2,n))-e&&It)return It.decode((C(),O).slice(e,t));for(n=``;e>>0];n+=String.fromCharCode(r)}return n},Rt=(e,t,n)=>{if(n??=2147483647,2>n)return 0;var r=t;n=(n-=2)<2*e.length?n/2:e.length;for(var i=0;i>>1>>>0]=a,t+=2}return(C(),D)[t>>>1>>>0]=0,t-r},zt=e=>2*e.length,Bt=(e,t,n)=>{var r=``;e>>>=2;for(var i=0;!(i>=t/4);i++){var a=(C(),A)[e+i>>>0];if(!a&&!n)break;r+=String.fromCodePoint(a)}return r},Vt=(e,t,n)=>{if(t>>>=0,n??=2147483647,4>n)return 0;var r=t;n=r+n-4;for(var i=0;i>>2>>>0]=a,(t+=4)+4>n)break}return(C(),k)[t>>>2>>>0]=0,t-r},Ht=e=>{for(var t=0,n=0;n>>=0,t>>>=0,n=ft(n>>>=0),t===2)var r=Lt,i=Rt,a=zt;else r=Bt,i=Vt,a=Ht;_t(e,{name:n,Rc:e=>{var n=(C(),A)[e>>>2>>>0];return n=r(e+4,n*t,!0),Pi(e),n},Xc:(e,r)=>{if(typeof r!=`string`)throw new gt(`Cannot pass non-string to C++ string type ${n}`);var o=a(r),s=Fi(4+o+t);return(C(),A)[s>>>2>>>0]=o/t,i(r,s+4,o+t),e!==null&&e.push(Pi,s),s},Wc:Et,Yc(e){Pi(e)}})}function Wt(e,t){_t(e>>>=0,{pe:!0,name:t=ft(t>>>0),Rc:()=>{},Xc:()=>{}})}function Gt(e){ea(e>>>0,!r,1,!n,131072,!1),Te()}var Kt=e=>{if(!x)try{if(e(),!(0Number((navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)||[])[2]);function Jt(e){e>>>=0,qt||(Atomics.waitAsync((C(),k),e>>>2,e).value.then(Yt),e+=128,Atomics.store((C(),k),e>>>2,1))}var Yt=()=>Kt(()=>{var e=Ni();e&&(Jt(e),oa())});function Xt(e,t){(e>>>=0)==t>>>0?setTimeout(Yt):i?postMessage({$c:e,Uc:`checkMailbox`}):(e=Ce[e])&&e.postMessage({Uc:`checkMailbox`})}var Zt=[];function Qt(e,t,n,r,i){for(t>>>=0,i>>>=0,Zt.length=0,n=i>>>3,r=i+r>>>3;n>>0]?(C(),ne)[n++>>>0]:(C(),te)[n++>>>0];Zt.push(a)}return(t?co[t]:so[e])(...Zt)}var $t=()=>{he=0};function en(e){e>>>=0,i?postMessage({Uc:`cleanupThread`,ue:e}):we(Ce[e])}function tn(e){}var nn=e=>{try{e()}catch(e){oe(e)}};function rn(e){var t=(...t)=>{cn.push(e);try{return e(...t)}finally{x||(cn.pop(),on&&an===1&&cn.length===0&&(an=0,he+=1,nn(ro),typeof Fibers<`u`&&Fibers.Oe()))}};return dn.set(e,t),t}var an=0,on=null,sn=0,cn=[],ln=new Map,un=new Map,dn=new Map,fn=0,pn=null,P=[],mn=e=>function(e){if(!x){if(an===0){var t=!1,n=!1;e((e=0)=>{if(!x&&(sn=e,t=!0,n)){an=2,nn(()=>io(on)),typeof MainLoop<`u`&&MainLoop.le&&MainLoop.resume(),e=!1;try{var r=function(){var e=(C(),k)[on+8>>>2>>>0];return e=un.get(e),e=dn.get(e),--he,e()}()}catch(t){r=t,e=!0}var i=!1;if(!on){var a=pn;a&&(pn=null,(e?a.reject:a.resolve)(r),i=!0)}if(e&&!i)throw r}}),n=!0,t||(an=1,on=function(){var e=Fi(65548),t=e+12;if((C(),A)[e>>>2>>>0]=t,(C(),A)[e+4>>>2>>>0]=t+65536,t=cn[0],!ln.has(t)){var n=fn++;ln.set(t,n),un.set(n,t)}return t=ln.get(t),(C(),k)[e+8>>>2>>>0]=t,e}(),typeof MainLoop<`u`&&MainLoop.le&&MainLoop.pause(),nn(()=>no(on)))}else an===2?(an=0,nn(ao),Pi(on),on=null,P.forEach(Kt)):oe(`invalid state: ${an}`);return sn}}(t=>{e().then(t)});function hn(e){return e>>>=0,mn(async()=>Tt(await wt(e)))}var gn=[],_n=e=>{var t=gn.length;return gn.push(e),t},vn=(e,t)=>{for(var n=Array(e),r=0;r>>2>>>0],o=mt[a];if(o===void 0)throw e=`parameter ${r}`,a=Ai(a),t=ft(a),Pi(a),new gt(`${e} has unknown type ${t}`);n[i]=o}return n},yn=(e,t,n)=>{var r=[];return e=e(r,n),r.length&&((C(),A)[t>>>2>>>0]=Tt(r)),e},bn={},xn=e=>{var t=bn[e];return t===void 0?ft(e):t};function Sn(e,t,n){var[r,...i]=vn(e,t>>>0);t=r.Xc.bind(r);var a=i.map(e=>e.Wc.bind(e));e--;var o={toValue:wt};switch(e=a.map((e,t)=>{var n=`argFromPtr${t}`;return o[n]=e,`${n}(args${t?`+`+8*t:``})`}),n){case 0:var s=`toValue(handle)`;break;case 2:s=`new (toValue(handle))`;break;case 3:s=``;break;case 1:o.getStringOrSymbol=xn,s=`toValue(handle)[getStringOrSymbol(methodName)]`}return s+=`(${e})`,r.pe||(o.toReturnWire=t,o.emval_returnValue=yn,s=`return emval_returnValue(toReturnWire, destructorsRef, ${s})`),s=`return function (handle, methodName, destructorsRef, args) { + ${s} + }`,n=Function(Object.keys(o),s)(...Object.values(o)),s=`methodCaller<(${i.map(e=>e.name)}) => ${r.name}>`,_n(Object.defineProperty(n,`name`,{value:s}))}function Cn(e,t){return t>>>=0,(e=wt(e>>>0))==wt(t)}function wn(e){return(e>>>=0)?(e=xn(e),Tt(globalThis[e])):Tt(globalThis)}function Tn(e){return e=xn(e>>>0),Tt(t[e])}function En(e,t){return t>>>=0,e=wt(e>>>0),t=wt(t),Tt(e[t])}function Dn(e){9<(e>>>=0)&&(St[e+1]+=1)}function On(e,t,n,r,i){return gn[e>>>0](t>>>0,n>>>0,r>>>0,i>>>0)}function kn(e,t,n,r,i){return On(e>>>0,t>>>0,n>>>0,r>>>0,i>>>0)}function An(){return Tt([])}function jn(e){e=wt(e>>>0);for(var t=Array(e.length),n=0;n>>0))}function Nn(){return Tt({})}function Pn(e){for(var t=wt(e>>>=0);t.length;){var n=t.pop();t.pop()(n)}Ct(e)}function Fn(e,t,n){t>>>=0,n>>>=0,e=wt(e>>>0),t=wt(t),n=wt(n),e[t]=n}function In(e,t){e=Me(e),t>>>=0,e=new Date(1e3*e),(C(),k)[t>>>2>>>0]=e.getUTCSeconds(),(C(),k)[t+4>>>2>>>0]=e.getUTCMinutes(),(C(),k)[t+8>>>2>>>0]=e.getUTCHours(),(C(),k)[t+12>>>2>>>0]=e.getUTCDate(),(C(),k)[t+16>>>2>>>0]=e.getUTCMonth(),(C(),k)[t+20>>>2>>>0]=e.getUTCFullYear()-1900,(C(),k)[t+24>>>2>>>0]=e.getUTCDay(),e=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,(C(),k)[t+28>>>2>>>0]=e}var Ln=e=>e%4==0&&(e%100!=0||e%400==0),Rn=[0,31,60,91,121,152,182,213,244,274,305,335],zn=[0,31,59,90,120,151,181,212,243,273,304,334];function Bn(e,t){e=Me(e),t>>>=0,e=new Date(1e3*e),(C(),k)[t>>>2>>>0]=e.getSeconds(),(C(),k)[t+4>>>2>>>0]=e.getMinutes(),(C(),k)[t+8>>>2>>>0]=e.getHours(),(C(),k)[t+12>>>2>>>0]=e.getDate(),(C(),k)[t+16>>>2>>>0]=e.getMonth(),(C(),k)[t+20>>>2>>>0]=e.getFullYear()-1900,(C(),k)[t+24>>>2>>>0]=e.getDay();var n=(Ln(e.getFullYear())?Rn:zn)[e.getMonth()]+e.getDate()-1|0;(C(),k)[t+28>>>2>>>0]=n,(C(),k)[t+36>>>2>>>0]=-60*e.getTimezoneOffset(),n=new Date(e.getFullYear(),6,1).getTimezoneOffset();var r=new Date(e.getFullYear(),0,1).getTimezoneOffset();e=0|(n!=r&&e.getTimezoneOffset()==Math.min(r,n)),(C(),k)[t+32>>>2>>>0]=e}function Vn(e){e>>>=0;var t=new Date((C(),k)[e+20>>>2>>>0]+1900,(C(),k)[e+16>>>2>>>0],(C(),k)[e+12>>>2>>>0],(C(),k)[e+8>>>2>>>0],(C(),k)[e+4>>>2>>>0],(C(),k)[e>>>2>>>0],0),n=(C(),k)[e+32>>>2>>>0],r=t.getTimezoneOffset(),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),a=new Date(t.getFullYear(),0,1).getTimezoneOffset(),o=Math.min(a,i);return 0>n?(C(),k)[e+32>>>2>>>0]=+(i!=a&&o==r):0>>2>>>0]=t.getDay(),n=(Ln(t.getFullYear())?Rn:zn)[t.getMonth()]+t.getDate()-1|0,(C(),k)[e+28>>>2>>>0]=n,(C(),k)[e>>>2>>>0]=t.getSeconds(),(C(),k)[e+4>>>2>>>0]=t.getMinutes(),(C(),k)[e+8>>>2>>>0]=t.getHours(),(C(),k)[e+12>>>2>>>0]=t.getDate(),(C(),k)[e+16>>>2>>>0]=t.getMonth(),(C(),k)[e+20>>>2>>>0]=t.getYear(),e=t.getTime(),BigInt(isNaN(e)?-1:e/1e3)}function Hn(e,t,n,r,a,o,s){return i?ge(16,1,e,t,n,r,a,o,s):-52}function Un(e,t,n,r,a,o){if(i)return ge(17,1,e,t,n,r,a,o)}var Wn={},Gn=()=>performance.timeOrigin+performance.now();function Kn(e,t){return i?ge(18,1,e,t):(Wn[e]&&(clearTimeout(Wn[e].id),delete Wn[e]),t&&(Wn[e]={id:setTimeout(()=>{delete Wn[e],Kt(()=>aa(e,performance.timeOrigin+performance.now()))},t),Ne:t}),0)}function qn(e,t,n,r){e>>>=0,t>>>=0,n>>>=0,r>>>=0;var i=new Date().getFullYear(),a=new Date(i,0,1).getTimezoneOffset();i=new Date(i,6,1).getTimezoneOffset();var o=Math.max(a,i);(C(),A)[e>>>2>>>0]=60*o,(C(),k)[t>>>2>>>0]=+(a!=i),e=(t=e=>{var t=Math.abs(e);return`UTC${0<=e?`-`:`+`}${String(Math.floor(t/60)).padStart(2,`0`)}${String(t%60).padStart(2,`0`)}`})(a),t=t(i),iDate.now(),Yn=1;function Xn(e,t,n){if(n>>>=0,!(0<=e&&3>=e))return 28;if(e===0)e=Date.now();else{if(!Yn)return 52;e=performance.timeOrigin+performance.now()}return e=Math.round(1e6*e),(C(),ne)[n>>>3>>>0]=BigInt(e),0}var Zn=[],Qn=(e,t)=>{Zn.length=0;for(var n;n=(C(),E)[e++>>>0];){var r=n!=105;t+=(r&=n!=112)&&t%8?4:0,Zn.push(n==112?(C(),A)[t>>>2>>>0]:n==106?(C(),ne)[t>>>3>>>0]:n==105?(C(),k)[t>>>2>>>0]:(C(),te)[t>>>3>>>0]),t+=r?8:4}return Zn};function $n(e,t,n){return e>>>=0,t=Qn(t>>>0,n>>>0),co[e](...t)}function er(e,t,n){return e>>>=0,t=Qn(t>>>0,n>>>0),co[e](...t)}var tr=()=>{};function nr(e,t){return b(Qe(e>>>0,t>>>0))}var rr=()=>{throw he+=1,`unwind`};function ir(){return 4294901760}var ar=()=>1,or=()=>navigator.hardwareConcurrency,sr={},cr=e=>{var t=Pt(e)+1,n=Fi(t);return n&&Nt(e,n,t),n},lr=e=>{var t;return(t=/\bwasm-function\[\d+\]:(0x[0-9a-f]+)/.exec(e))?+t[1]:(t=/:(\d+):\d+(?:\)|$)/.exec(e))?2147483648|t[1]:0},ur=e=>{for(var t of e)(e=lr(t))&&(sr[e]=t)};function dr(){var e=Error().stack.toString().split(` +`);return e[0]==`Error`&&e.shift(),ur(e),sr.Xd=lr(e[3]),sr.re=e,sr.Xd}function fr(e){if(!(e=sr[e>>>0]))return 0;var t;if(t=/^\s+at .*\.wasm\.(.*) \(.*\)$/.exec(e))e=t[1];else if(t=/^\s+at (.*) \(.*\)$/.exec(e))e=t[1];else{if(!(t=/^(.+?)@/.exec(e)))return 0;e=t[1]}return Pi(fr.ae??0),fr.ae=cr(e),fr.ae}function pr(e){e>>>=0;var t=(C(),E).length;if(e<=t||4294901760=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296);e:{r=(Math.min(4294901760,65536*Math.ceil(Math.max(e,r)/65536))-Oe.buffer.byteLength+65535)/65536|0;try{Oe.grow(r),ie();var i=1;break e}catch{}i=void 0}if(i)return!0}return!1}function mr(e,t,n){if(e>>>=0,t>>>=0,sr.Xd==e)var r=sr.re;else (r=Error().stack.toString().split(` +`))[0]==`Error`&&r.shift(),ur(r);for(var i=3;r[i]&&lr(r[i])!=e;)++i;for(e=0;e>>2>>>0]=lr(r[e+i]);return e}var hr=e=>{var t=Pt(e)+1,n=fa(t);return Nt(e,n,t),n},gr=[],_r=(e,t)=>{gr[e>>>=0]=t},vr=[],yr=[],br=(e,t)=>{yr[e]=new Promise(n=>t.finally(()=>n(e)))},xr=e=>{if(e)return gr[e>>>0]},Sr=(e,t,n)=>{(C(),A)[e>>>2>>>0]=t,(C(),A)[e+4>>>2>>>0]=n},Cr=e=>{var t=(C(),A)[e>>>2>>>0];return e=(C(),A)[e+4>>>2>>>0],Qe(t,e)},wr=e=>{var t=(C(),A)[e>>>2>>>0];return e=(C(),A)[e+4>>>2>>>0],t?Qe(t,e):e===0?``:void 0},Tr=e=>{var t=wr(e+4),n=(n=(C(),A)[e+12>>>2>>>0])?xr(n):`auto`;if(e+=16){var r=xr((C(),A)[e+4>>>2>>>0]),i=(C(),A)[e+16>>>2>>>0],a=(C(),A)[e+20>>>2>>>0];if(i){for(var o={},s=0;s>>3>>>0]}i=o}else i=void 0;e={module:r,constants:i,entryPoint:wr(e+8)}}else e=void 0;return{label:t,layout:n,compute:e}},Er=(e,t)=>{function n(n,r){n=e[n],(C(),k)[t+r>>>2>>>0]=n}function r(n,r){n=e[n],(C(),ne)[t+r>>>3>>>0]=BigInt(n)}n(`maxTextureDimension1D`,4),n(`maxTextureDimension2D`,8),n(`maxTextureDimension3D`,12),n(`maxTextureArrayLayers`,16),n(`maxBindGroups`,20),n(`maxBindGroupsPlusVertexBuffers`,24),n(`maxBindingsPerBindGroup`,28),n(`maxDynamicUniformBuffersPerPipelineLayout`,32),n(`maxDynamicStorageBuffersPerPipelineLayout`,36),n(`maxSampledTexturesPerShaderStage`,40),n(`maxSamplersPerShaderStage`,44),n(`maxStorageBuffersPerShaderStage`,48),n(`maxStorageTexturesPerShaderStage`,52),n(`maxUniformBuffersPerShaderStage`,56),n(`minUniformBufferOffsetAlignment`,80),n(`minStorageBufferOffsetAlignment`,84),r(`maxUniformBufferBindingSize`,64),r(`maxStorageBufferBindingSize`,72),n(`maxVertexBuffers`,88),r(`maxBufferSize`,96),n(`maxVertexAttributes`,104),n(`maxVertexBufferArrayStride`,108),n(`maxInterStageShaderVariables`,112),n(`maxColorAttachments`,116),n(`maxColorAttachmentBytesPerSample`,120),n(`maxComputeWorkgroupStorageSize`,124),n(`maxComputeInvocationsPerWorkgroup`,128),n(`maxComputeWorkgroupSizeX`,132),n(`maxComputeWorkgroupSizeY`,136),n(`maxComputeWorkgroupSizeZ`,140),n(`maxComputeWorkgroupsPerDimension`,144),e.Le!==void 0&&n(`maxImmediateSize`,148)},Dr=[,`validation`,`out-of-memory`,`internal`],Or=[,`compatibility`,`core`],kr={1:`core-features-and-limits`,2:`depth-clip-control`,3:`depth32float-stencil8`,4:`texture-compression-bc`,5:`texture-compression-bc-sliced-3d`,6:`texture-compression-etc2`,7:`texture-compression-astc`,8:`texture-compression-astc-sliced-3d`,9:`timestamp-query`,10:`indirect-first-instance`,11:`shader-f16`,12:`rg11b10ufloat-renderable`,13:`bgra8unorm-storage`,14:`float32-filterable`,15:`float32-blendable`,16:`clip-distances`,17:`dual-source-blending`,18:`subgroups`,19:`texture-formats-tier1`,20:`texture-formats-tier2`,21:`primitive-index`,327692:`chromium-experimental-unorm16-texture-formats`,327693:`chromium-experimental-snorm16-texture-formats`,327732:`chromium-experimental-multi-draw-indirect`},Ar=[,`low-power`,`high-performance`],jr=[,`occlusion`,`timestamp`],Mr={undefined:1,unknown:1,destroyed:2};function Nr(e,t,n,r,i,a){t=Me(t),n=Me(n),r>>>=0,i>>>=0,a>>>=0;var o=xr(e>>>0);if(e={},a){var s=(C(),A)[a+12>>>2>>>0];if(s){var c=(C(),A)[a+16>>>2>>>0];e.requiredFeatures=Array.from((C(),A).subarray(c>>>2>>>0,c+4*s>>>2>>>0),e=>kr[e])}var l=(C(),A)[a+20>>>2>>>0];if(l){let t=function(e,t,n=!1){t=l+t,(t=(C(),A)[t>>>2>>>0])==4294967295||n&&t==0||(u[e]=t)},n=function(e,t){t=l+t;var n=(C(),A)[t>>>2>>>0],r=(C(),A)[t+4>>>2>>>0];n==4294967295&&r==4294967295||(u[e]=4294967296*(C(),A)[t+4>>>2>>>0]+(C(),A)[t>>>2>>>0])};var u={};t(`maxTextureDimension1D`,4),t(`maxTextureDimension2D`,8),t(`maxTextureDimension3D`,12),t(`maxTextureArrayLayers`,16),t(`maxBindGroups`,20),t(`maxBindGroupsPlusVertexBuffers`,24),t(`maxDynamicUniformBuffersPerPipelineLayout`,32),t(`maxDynamicStorageBuffersPerPipelineLayout`,36),t(`maxSampledTexturesPerShaderStage`,40),t(`maxSamplersPerShaderStage`,44),t(`maxStorageBuffersPerShaderStage`,48),t(`maxStorageTexturesPerShaderStage`,52),t(`maxUniformBuffersPerShaderStage`,56),t(`minUniformBufferOffsetAlignment`,80),t(`minStorageBufferOffsetAlignment`,84),n(`maxUniformBufferBindingSize`,64),n(`maxStorageBufferBindingSize`,72),t(`maxVertexBuffers`,88),n(`maxBufferSize`,96),t(`maxVertexAttributes`,104),t(`maxVertexBufferArrayStride`,108),t(`maxInterStageShaderVariables`,112),t(`maxColorAttachments`,116),t(`maxColorAttachmentBytesPerSample`,120),t(`maxComputeWorkgroupStorageSize`,124),t(`maxComputeInvocationsPerWorkgroup`,128),t(`maxComputeWorkgroupSizeX`,132),t(`maxComputeWorkgroupSizeY`,136),t(`maxComputeWorkgroupSizeZ`,140),t(`maxComputeWorkgroupsPerDimension`,144),t(`maxImmediateSize`,148,!0),e.requiredLimits=u}(s=(C(),A)[a+24>>>2>>>0])&&(s={label:wr(s+4)},e.defaultQueue=s),e.label=wr(a+4)}he+=1,br(t,o.requestDevice(e).then(e=>{--he,_r(i,e.queue),_r(r,e),n&&(he+=1,br(n,e.lost.then(t=>{--he,e.onuncapturederror=()=>{};var r=pa(),i=hr(t.message);Ji(n,Mr[t.reason],i),da(r)}))),e.onuncapturederror=e=>{var t=5;e.error instanceof GPUValidationError?t=2:e.error instanceof GPUOutOfMemoryError?t=3:e.error instanceof GPUInternalError&&(t=4);var n=pa();e=hr(e.error.message),$i(r,t,e),da(n)},`adapterInfo`in e||(e.adapterInfo=o.info),Qi(t,1,r,0)},e=>{--he;var i=pa();e=hr(e.message),Qi(t,3,r,e),n&&Ji(n,4,e),da(i)}))}function Pr(e){var t=xr(e>>>=0),n=vr[e];if(n){for(var r=0;r{var e=`getMappedRange size=0 no longer means WGPU_WHOLE_MAP_SIZE`;Fr.ed||={},Fr.ed[e]||(Fr.ed[e]=1,b(e))};function Ir(e,t,n){t>>>=0,n>>>=0;var r=xr(e>>>=0);n===0&&Fr(),n==4294967295&&(n=void 0);try{var i=r.getMappedRange(t,n)}catch{return 0}var a=sa(16,i.byteLength);return(C(),E).set(new Uint8Array(i),a>>>0),vr[e].push(()=>Pi(a)),a}function Lr(e,t,n){t>>>=0,n>>>=0;var r=xr(e>>>=0);n===0&&Fr(),n==4294967295&&(n=void 0);try{var i=r.getMappedRange(t,n)}catch{return 0}var a=sa(16,i.byteLength);return(C(),E).fill(0,a,i.byteLength),vr[e].push(()=>{new Uint8Array(i).set((C(),E).subarray(a>>>0,a+i.byteLength>>>0)),Pi(a)}),a}function Rr(e,t,n,r,i){e>>>=0,t=Me(t),n=Me(n),i>>>=0;var a=xr(e);vr[e]=[],i==4294967295&&(i=void 0),he+=1,br(t,a.mapAsync(n,r>>>0,i).then(()=>{--he,Yi(t,1,0)},n=>{--he,pa();var r=hr(n.message);Yi(t,n.name===`AbortError`?4:n.name===`OperationError`?3:0,r),delete vr[e]}))}function zr(e){var t=xr(e>>>=0),n=vr[e];if(n){for(var r=0;r>>0]}function Vr(e,t,n){e>>>=0,t>>>=0,n>>>=0;var r=!!(C(),A)[t+32>>>2>>>0];t={label:wr(t+4),usage:(C(),A)[t+16>>>2>>>0],size:4294967296*(C(),A)[t+28>>>2>>>0]+(C(),A)[t+24>>>2>>>0],mappedAtCreation:r},e=xr(e);try{var i=e.createBuffer(t)}catch{return!1}return _r(n,i),r&&(vr[n]=[]),!0}function Hr(e,t,n,r){e>>>=0,t=Me(t),r>>>=0,n=Tr(n>>>0),e=xr(e),he+=1,br(t,e.createComputePipelineAsync(n).then(e=>{--he,_r(r,e),qi(t,1,r,0)},e=>{--he;var n=pa(),i=hr(e.message);qi(t,e.reason===`validation`?3:e.reason===`internal`?4:0,r,i),da(n)}))}function Ur(e,t,n){e>>>=0,t>>>=0,n>>>=0;var r=(C(),A)[t>>>2>>>0],i=(C(),A)[r+4>>>2>>>0];t={label:wr(t+4),code:``},i===2&&(t.code=Cr(r+8)),_r(n,xr(e).createShaderModule(t))}var Wr=e=>{(e=xr(e)).onuncapturederror=null,e.destroy()};function Gr(e,t){t=Me(t),e=xr(e>>>0),he+=1,br(t,e.popErrorScope().then(e=>{--he;var n=5;e?e instanceof GPUValidationError?n=2:e instanceof GPUOutOfMemoryError?n=3:e instanceof GPUInternalError&&(n=4):n=1;var r=pa();e=e?hr(e.message):0,Xi(t,1,n,e),da(r)},e=>{--he;var n=pa();e=hr(e.message),Xi(t,1,5,e),da(n)}))}function Kr(e,t,n,r){if(t=Me(t),r>>>=0,n>>>=0){var i=(C(),A)[n+4>>>2>>>0];i={featureLevel:Or[i],powerPreference:Ar[(C(),A)[n+8>>>2>>>0]],forceFallbackAdapter:!!(C(),A)[n+12>>>2>>>0]},(n=(C(),A)[n>>>2>>>0])!==0&&(C(),i.Qe=!!(C(),A)[n+8>>>2>>>0])}`gpu`in navigator?(he+=1,br(t,navigator.gpu.requestAdapter(i).then(e=>{if(--he,e)_r(r,e),Zi(t,1,r,0);else{e=pa();var n=hr(`WebGPU not available on this browser (requestAdapter returned null)`);Zi(t,3,r,n),da(e)}},e=>{--he;var n=pa();e=hr(e.message),Zi(t,4,r,e),da(n)}))):(n=pa(),i=hr(`WebGPU not available on this browser (navigator.gpu is not available)`),Zi(t,3,r,i),da(n))}function qr(e,t,n){return e>>>=0,t>>>=0,n>>>=0,mn(async()=>{var r=[];if(n){var i=(C(),k)[n>>>2>>>0];r.length=t+1,r[t]=new Promise(e=>setTimeout(e,i,0))}else r.length=t;for(var a=0;a>>2>>>0]+(C(),A)[e+8*a>>>2>>>0];if(!(o in yr))return o;r[a]=yr[o]}return r=await Promise.race(r),delete yr[r],r})}var Jr,Yr={},Xr=()=>{if(!Jr){var e,t={USER:`web_user`,LOGNAME:`web_user`,PATH:`/`,PWD:`/`,HOME:`/home/web_user`,LANG:(globalThis.navigator?.language??`C`).replace(`-`,`_`)+`.UTF-8`,_:`./this.program`};for(e in Yr)Yr[e]===void 0?delete t[e]:t[e]=Yr[e];var n=[];for(e in t)n.push(`${e}=${t[e]}`);Jr=n}return Jr};function Zr(e,t){if(i)return ge(19,1,e,t);e>>>=0,t>>>=0;var n,r=0,a=0;for(n of Xr()){var o=t+r;(C(),A)[e+a>>>2>>>0]=o,r+=Nt(n,o,1/0)+1,a+=4}return 0}function Qr(e,t){if(i)return ge(20,1,e,t);e>>>=0,t>>>=0;var n=Xr();for(var r of((C(),A)[e>>>2>>>0]=n.length,e=0,n))e+=Pt(r)+1;return(C(),A)[t>>>2>>>0]=e,0}function $r(e){return i?ge(21,1,e):52}function ei(e,t,n,r){return i?ge(22,1,e,t,n,r):52}function ti(e,t,n,r){return i?ge(23,1,e,t,n,r):70}var ni=[null,[],[]];function ri(e,t,n,r){if(i)return ge(24,1,e,t,n,r);t>>>=0,n>>>=0,r>>>=0;for(var a=0,o=0;o>>2>>>0],c=(C(),A)[t+4>>>2>>>0];t+=8;for(var l=0;l>>0],f=ni[u];d===0||d===10?((u===1?y:b)(Ze(f)),f.length=0):f.push(d)}a+=c}return(C(),A)[r>>>2>>>0]=a,0}function ii(e){return e>>>0}function ai(e,t){return Er(xr(e>>>0).limits,t>>>0),1}function oi(e,t){return xr(e>>>0).features.has(kr[t])}function si(e){return BigInt(xr(e>>>0).size)}function ci(e){return BigInt(xr(e>>>0).usage)}function li(e,t){if(e>>>=0,t>>>=0){var n=wr(t+4);n={label:n,timestampWrites:t=(t=(C(),A)[t+12>>>2>>>0])===0?void 0:{querySet:xr((C(),A)[t+4>>>2>>>0]),beginningOfPassWriteIndex:(C(),A)[t+8>>>2>>>0],endOfPassWriteIndex:(C(),A)[t+12>>>2>>>0]}}}return e=xr(e),t=Hi(0),_r(t,e.beginComputePass(n)),t}function ui(e,t,n,r,i,a){n=Me(n),i=Me(i),a=Me(a),xr(e>>>0).copyBufferToBuffer(xr(t>>>0),n,xr(r>>>0),i,a)}function di(e){e=xr(e>>>0);var t=Bi(0);return _r(t,e.finish()),t}function fi(e,t,n,r,i,a){a=Me(a),xr(e>>>0).resolveQuerySet(xr(t>>>0),n,r,xr(i>>>0),a)}function pi(e,t,n,r){xr(e>>>0).dispatchWorkgroups(t,n,r)}function mi(e,t,n){n=Me(n),xr(e>>>0).dispatchWorkgroupsIndirect(xr(t>>>0),n)}function hi(e){xr(e>>>0).end()}function gi(e,t,n,r,i){r>>>=0,i>>>=0,e=xr(e>>>0),n=xr(n>>>0),r==0?e.setBindGroup(t,n):e.setBindGroup(t,n,(C(),A),i>>>2,r)}function _i(e,t){xr(e>>>0).setPipeline(xr(t>>>0))}function vi(e,t,n){xr(e>>>0).Pe(xr(t>>>0),n)}function yi(e,t){e=xr(e>>>0);var n=zi(0);return _r(n,e.getBindGroupLayout(t)),n}function bi(e,t){e>>>=0;var n=wr(4+(t>>>=0)),r=xr((C(),A)[t+12>>>2>>>0]),i=(C(),A)[t+16>>>2>>>0];t=(C(),A)[t+20>>>2>>>0];for(var a=[],o=0;o>>2>>>0],d=(C(),A)[l+32>>>2>>>0],f=(C(),A)[l+36>>>2>>>0],p=(C(),A)[l+4>>>2>>>0];u?(d=l+24,(d=(C(),A)[d>>>2>>>0]+4294967296*(C(),k)[d+4>>>2>>>0])==-1&&(d=void 0),l={binding:p,resource:{buffer:xr(u),offset:4294967296*(C(),A)[l+4+16>>>2>>>0]+(C(),A)[l+16>>>2>>>0],size:d}}):l=d?{binding:p,resource:xr(d)}:{binding:p,resource:xr(f)},c.call(s,l)}return n={label:n,layout:r,entries:a},e=xr(e),r=Ri(0),_r(r,e.createBindGroup(n)),r}function xi(e,t){var n;return e>>>=0,(t>>>=0)&&(n={label:wr(t+4)}),e=xr(e),t=Vi(0),_r(t,e.createCommandEncoder(n)),t}function Si(e,t){e>>>=0,t>>>=0,t={type:jr[(C(),A)[t+12>>>2>>>0]],count:(C(),A)[t+16>>>2>>>0]},e=xr(e);var n=Ui(0);return _r(n,e.createQuerySet(t)),n}function Ci(e,t){e=xr(e>>>0).adapterInfo,t>>>=0,(C(),k)[t+52>>>2>>>0]=e.subgroupMinSize,(C(),k)[t+56>>>2>>>0]=e.subgroupMaxSize;var n=cr(e.vendor+e.architecture+e.device+e.description),r=Pt(e.vendor);return Sr(t+4,n,r),n+=r,r=Pt(e.architecture),Sr(t+12,n,r),n+=r,r=Pt(e.device),Sr(t+20,n,r),Sr(t+28,n+r,Pt(e.description)),(C(),k)[t+36>>>2>>>0]=2,e=e.isFallbackAdapter?3:4,(C(),k)[t+40>>>2>>>0]=e,(C(),k)[t+44>>>2>>>0]=0,(C(),k)[t+48>>>2>>>0]=0,1}var wi={"core-features-and-limits":1,"depth-clip-control":2,"depth32float-stencil8":3,"texture-compression-bc":4,"texture-compression-bc-sliced-3d":5,"texture-compression-etc2":6,"texture-compression-astc":7,"texture-compression-astc-sliced-3d":8,"timestamp-query":9,"indirect-first-instance":10,"shader-f16":11,"rg11b10ufloat-renderable":12,"bgra8unorm-storage":13,"float32-filterable":14,"float32-blendable":15,"clip-distances":16,"dual-source-blending":17,subgroups:18,"texture-formats-tier1":19,"texture-formats-tier2":20,"primitive-index":21,"chromium-experimental-unorm16-texture-formats":327692,"chromium-experimental-snorm16-texture-formats":327693,"chromium-experimental-multi-draw-indirect":327732};function Ti(e,t){t>>>=0,e=xr(e>>>0);var n=Fi(4*e.features.size),r=0,i=0;e.features.forEach(e=>{0<=(e=wi[e])&&((C(),k)[n+r>>>2>>>0]=e,r+=4,i++)}),(C(),A)[t+4>>>2>>>0]=n,(C(),A)[t>>>2>>>0]=i}function Ei(e,t){return Er(xr(e>>>0).limits,t>>>0),1}function Di(e,t){xr(e>>>0).pushErrorScope(Dr[t])}function Oi(e,t,n){t>>>=0,n>>>=0,e=xr(e>>>0),t=Array.from((C(),k).subarray(n>>>2>>>0,n+4*t>>>2>>>0),e=>xr(e)),e.submit(t)}function ki(e,t,n,r,i){n=Me(n),r>>>=0,i>>>=0,e=xr(e>>>0),t=xr(t>>>0),r=(C(),E).subarray(r>>>0,r+i>>>0),e.writeBuffer(t,n,r,0,i)}i||function(){for(var e=t.numThreads-1;e--;)De();de.push(async()=>{var e=async function(){if(!i)return Promise.all(be.map(Ee))}();fe++,await e,--fe==0&&pe&&(e=pe,pe=null,e())})}(),i||(Oe=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0}),ie()),t.wasmBinary&&(d=t.wasmBinary),t.stackSave=()=>pa(),t.stackRestore=e=>da(e),t.stackAlloc=e=>fa(e),t.setValue=function(e,t,n=`i8`){switch(n.endsWith(`*`)&&(n=`*`),n){case`i1`:case`i8`:(C(),T)[e>>>0]=t;break;case`i16`:(C(),D)[e>>>1>>>0]=t;break;case`i32`:(C(),k)[e>>>2>>>0]=t;break;case`i64`:(C(),ne)[e>>>3>>>0]=BigInt(t);break;case`float`:(C(),ee)[e>>>2>>>0]=t;break;case`double`:(C(),te)[e>>>3>>>0]=t;break;case`*`:(C(),A)[e>>>2>>>0]=t;break;default:oe(`invalid type for setValue: ${n}`)}},t.getValue=function(e,t=`i8`){switch(t.endsWith(`*`)&&(t=`*`),t){case`i1`:case`i8`:return(C(),T)[e>>>0];case`i16`:return(C(),D)[e>>>1>>>0];case`i32`:return(C(),k)[e>>>2>>>0];case`i64`:return(C(),ne)[e>>>3>>>0];case`float`:return(C(),ee)[e>>>2>>>0];case`double`:return(C(),te)[e>>>3>>>0];case`*`:return(C(),A)[e>>>2>>>0];default:oe(`invalid type for getValue: ${t}`)}},t.UTF8ToString=Qe,t.stringToUTF8=Nt,t.lengthBytesUTF8=Pt;var Ai,ji,Mi,Ni,Pi,Fi,Ii,Li,Ri,zi,Bi,Vi,Hi,Ui,Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi,Qi,$i,ea,ta,na,ra,ia,aa,oa,sa,ca,la,ua,da,fa,pa,ma,ha,ga,_a,va,ya,ba,xa,Sa,Ca,wa,Ta,Ea,Da,Oa,ka,Aa,ja,Ma,Na,Pa,Fa,Ia,La,Ra,za,Ba,Va,Ha,Ua,Wa,Ga,Ka,qa,Ja,Ya,Xa,Za,Qa,$a,eo,to,no,ro,io,ao,oo,so=[_e,ve,Ke,$e,et,tt,N,nt,rt,it,at,ot,st,ct,lt,ut,Hn,Un,Kn,Zr,Qr,$r,ei,ti,ri],co={1117404:(e,n,r,i,a)=>{if(t===void 0||!t.Zc)return 1;if((e=Qe(Number(e>>>0))).startsWith(`./`)&&(e=e.substring(2)),!(e=t.Zc.get(e)))return 2;if(n=Number(n>>>0),r=Number(r>>>0),i=Number(i>>>0),n+r>e.byteLength)return 3;try{let o=e.subarray(n,n+r);switch(a){case 0:(C(),E).set(o,i>>>0);break;case 1:t.ie?t.ie(i,o):t.Ke(i,o);break;default:return 4}return 0}catch{return 4}},1118228:(e,n,r)=>{t.ke(e,(C(),E).subarray(n>>>0,n+r>>>0))},1118292:()=>t.Ie(),1118334:e=>{t.je(e)},1118371:()=>typeof wasmOffsetConverter<`u`};function lo(){return typeof wasmOffsetConverter<`u`}function uo(e,t,n,r){var i=pa();try{return Da(e,t,n,r)}catch(e){if(da(i),e!==e+0)throw e;ca(1,0)}}function fo(e,t,n){var r=pa();try{return wa(e,t,n)}catch(e){if(da(r),e!==e+0)throw e;ca(1,0)}}function po(e,t,n){var r=pa();try{va(e,t,n)}catch(e){if(da(r),e!==e+0)throw e;ca(1,0)}}function mo(e,t){var n=pa();try{return ya(e,t)}catch(e){if(da(n),e!==e+0)throw e;ca(1,0)}}function ho(e){var t=pa();try{ba(e)}catch(e){if(da(t),e!==e+0)throw e;ca(1,0)}}function go(e,t,n,r,i,a,o){var s=pa();try{return Ca(e,t,n,r,i,a,o)}catch(e){if(da(s),e!==e+0)throw e;ca(1,0)}}function _o(e,t){var n=pa();try{Oa(e,t)}catch(e){if(da(n),e!==e+0)throw e;ca(1,0)}}function vo(e,t,n,r,i,a){var o=pa();try{xa(e,t,n,r,i,a)}catch(e){if(da(o),e!==e+0)throw e;ca(1,0)}}function yo(e,t,n,r){var i=pa();try{Ea(e,t,n,r)}catch(e){if(da(i),e!==e+0)throw e;ca(1,0)}}function bo(e,t,n,r,i,a,o){var s=pa();try{Aa(e,t,n,r,i,a,o)}catch(e){if(da(s),e!==e+0)throw e;ca(1,0)}}function xo(e,t,n,r,i,a,o){var s=pa();try{ja(e,t,n,r,i,a,o)}catch(e){if(da(s),e!==e+0)throw e;ca(1,0)}}function So(e,t,n,r,i,a,o,s){var c=pa();try{Va(e,t,n,r,i,a,o,s)}catch(e){if(da(c),e!==e+0)throw e;ca(1,0)}}function Co(e,t,n,r,i){var a=pa();try{Sa(e,t,n,r,i)}catch(e){if(da(a),e!==e+0)throw e;ca(1,0)}}function wo(e,t,n,r,i){var a=pa();try{return ka(e,t,n,r,i)}catch(e){if(da(a),e!==e+0)throw e;ca(1,0)}}function To(e,t,n,r,i,a,o,s){var c=pa();try{Ha(e,t,n,r,i,a,o,s)}catch(e){if(da(c),e!==e+0)throw e;ca(1,0)}}function Eo(e,t,n,r,i,a,o,s,c,l,u,d){var f=pa();try{Ma(e,t,n,r,i,a,o,s,c,l,u,d)}catch(e){if(da(f),e!==e+0)throw e;ca(1,0)}}function Do(e,t,n,r,i,a){var o=pa();try{return za(e,t,n,r,i,a)}catch(e){if(da(o),e!==e+0)throw e;ca(1,0)}}function Oo(e,t,n){var r=pa();try{return Ia(e,t,n)}catch(e){if(da(r),e!==e+0)throw e;return ca(1,0),0n}}function ko(e,t,n,r,i,a,o,s,c){var l=pa();try{Ta(e,t,n,r,i,a,o,s,c)}catch(e){if(da(l),e!==e+0)throw e;ca(1,0)}}function Ao(e){var t=pa();try{return Pa(e)}catch(e){if(da(t),e!==e+0)throw e;ca(1,0)}}function jo(e,t,n){var r=pa();try{return Ua(e,t,n)}catch(e){if(da(r),e!==e+0)throw e;ca(1,0)}}function Mo(e,t){var n=pa();try{return to(e,t)}catch(e){if(da(n),e!==e+0)throw e;return ca(1,0),0n}}function No(e,t,n,r,i){var a=pa();try{Wa(e,t,n,r,i)}catch(e){if(da(a),e!==e+0)throw e;ca(1,0)}}function Po(e){var t=pa();try{return Na(e)}catch(e){if(da(t),e!==e+0)throw e;return ca(1,0),0n}}function Fo(e,t,n,r,i,a){var o=pa();try{return qa(e,t,n,r,i,a)}catch(e){if(da(o),e!==e+0)throw e;ca(1,0)}}function Io(e,t,n,r,i,a){var o=pa();try{return Ja(e,t,n,r,i,a)}catch(e){if(da(o),e!==e+0)throw e;ca(1,0)}}function Lo(e,t,n,r,i,a,o,s){var c=pa();try{return Ba(e,t,n,r,i,a,o,s)}catch(e){if(da(c),e!==e+0)throw e;ca(1,0)}}function Ro(e,t,n,r,i){var a=pa();try{return Ya(e,t,n,r,i)}catch(e){if(da(a),e!==e+0)throw e;return ca(1,0),0n}}function zo(e,t,n,r){var i=pa();try{return Xa(e,t,n,r)}catch(e){if(da(i),e!==e+0)throw e;ca(1,0)}}function Bo(e,t,n,r){var i=pa();try{return Za(e,t,n,r)}catch(e){if(da(i),e!==e+0)throw e;ca(1,0)}}function Vo(e,t,n,r,i,a,o,s,c,l,u,d){var f=pa();try{return Qa(e,t,n,r,i,a,o,s,c,l,u,d)}catch(e){if(da(f),e!==e+0)throw e;ca(1,0)}}function Ho(e,t,n,r,i,a,o,s,c,l,u){var d=pa();try{Ga(e,t,n,r,i,a,o,s,c,l,u)}catch(e){if(da(d),e!==e+0)throw e;ca(1,0)}}function Uo(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){var g=pa();try{Ka(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h)}catch(e){if(da(g),e!==e+0)throw e;ca(1,0)}}function Wo(e,t,n,r){var i=pa();try{return $a(e,t,n,r)}catch(e){if(da(i),e!==e+0)throw e;ca(1,0)}}function Go(e,t,n,r,i){var a=pa();try{return eo(e,t,n,r,i)}catch(e){if(da(a),e!==e+0)throw e;ca(1,0)}}function Ko(e,t,n){var r=pa();try{return Fa(e,t,n)}catch(e){if(da(r),e!==e+0)throw e;ca(1,0)}}function qo(e,t,n){var r=pa();try{return La(e,t,n)}catch(e){if(da(r),e!==e+0)throw e;ca(1,0)}}function Jo(e,t,n,r){var i=pa();try{Ra(e,t,n,r)}catch(e){if(da(i),e!==e+0)throw e;ca(1,0)}}function Yo(){if(0{let n=new WeakMap,r,i,a=1;t.webgpuRegisterDevice=e=>{if(i!==void 0)throw Error(`another WebGPU EP inference session is being created.`);if(e){var t=n.get(e);if(!t){let r=((e,t=0)=>{var n=Ki(t);return t=Gi(t,n),_r(n,e.queue),_r(t,e),t})(e,t=Li(0));t=[a++,t,r],n.set(e,t)}return r=e,i=t[0],t}r=void 0,i=0};let o=new Map;t.webgpuOnCreateSession=t=>{if(i!==void 0){var n=i;if(i=void 0,t){let i=Mi(n);o.set(t,i),n===0&&e(r??xr(i))}r=void 0}},t.webgpuOnReleaseSession=e=>{o.delete(e)};let s=Symbol(`gpuBufferMetadata`);t.webgpuRegisterBuffer=(e,t,n)=>{if(n)return e[s]=[n,NaN],n;if(n=e[s])return n[1]++,n[0];if((t=o.get(t))===void 0)throw Error(`Invalid session handle passed to webgpuRegisterBuffer`);return t=((e,t=0)=>(e.mapState!=`pending`||oe(),t=Wi(t,e.mapState==`mapped`?3:1),_r(t,e),e.mapState==`mapped`&&(vr[t]=[]),t))(e,t),e[s]=[t,1],t},t.webgpuUnregisterBuffer=e=>{let t=e[s];if(!t)throw Error(`Buffer is not registered`);t[1]--,t[1]===0&&(Ii(t[0]),delete e[s])},t.webgpuGetBuffer=e=>xr(e),t.webgpuCreateDownloader=(e,t,n)=>{if((n=o.get(n))===void 0)throw Error(`Invalid session handle passed to webgpuRegisterBuffer`);let r=xr(n),i=16*Math.ceil(Number(t)/16);return async()=>{let n=r.createBuffer({size:i,usage:9});try{let a=r.createCommandEncoder();return a.copyBufferToBuffer(e,0,n,0,i),r.queue.submit([a.finish()]),await n.mapAsync(GPUMapMode.READ),n.getMappedRange().slice(0,t)}finally{n.destroy()}}},t.ie=(e,t)=>{var n=t.buffer;let a=t.byteOffset,o=t.byteLength;if(t=16*Math.ceil(Number(o)/16),e=xr(e),!r){var s=Mi(i);r=xr(s)}let c=(s=r.createBuffer({mappedAtCreation:!0,size:t,usage:6})).getMappedRange();new Uint8Array(c).set(new Uint8Array(n,a,o)),s.unmap(),(n=r.createCommandEncoder()).copyBufferToBuffer(s,0,e,0,t),r.queue.submit([n.finish()]),s.destroy()}},t.webnnInit=e=>{let n=e[0];[t.Ie,t.je,t.webnnEnsureTensor,t.ke,t.webnnDownloadTensor,t.He,t.webnnEnableTraceEvent]=e.slice(1),t.webnnReleaseTensorId=t.je,t.webnnUploadTensor=t.ke,t.webnnRegisterMLContext=t.He,t.webnnOnRunStart=e=>n.onRunStart(e),t.webnnOnRunEnd=n.onRunEnd.bind(n),t.webnnOnReleaseSession=e=>{n.onReleaseSession(e)},t.webnnCreateMLTensorDownloader=(e,t)=>n.createMLTensorDownloader(e,t),t.webnnRegisterMLTensor=(e,t,r,i)=>n.registerMLTensor(e,t,r,i),t.webnnCreateMLContext=e=>n.createMLContext(e),t.webnnRegisterMLConstant=(e,r,i,a,o,s)=>n.registerMLConstant(e,r,i,a,o,t.Zc,s),t.webnnRegisterGraphInput=n.registerGraphInput.bind(n),t.webnnIsGraphInput=n.isGraphInput.bind(n),t.webnnRegisterGraphOutput=n.registerGraphOutput.bind(n),t.webnnIsGraphOutput=n.isGraphOutput.bind(n),t.webnnCreateTemporaryTensor=n.createTemporaryTensor.bind(n),t.webnnIsGraphInputOutputTypeSupported=n.isGraphInputOutputTypeSupported.bind(n)},M?t:new Promise((e,t)=>{m=e,h=t})}var dz,fz,pz=eR(()=>{dz=uz,fz=globalThis.self?.name?.startsWith(`em-pthread`),fz&&uz()}),mz,hz,gz,_z,vz,yz,bz,xz,Sz,Cz,wz,Tz,Ez,Dz,Oz=eR(()=>{rz(),mz=typeof location>`u`?void 0:location.origin,hz=import.meta.url>`file:`&&import.meta.url<`file;`,gz=()=>{if(hz){let e=URL;return new URL(new e(`ort.webgpu.bundle.min.mjs`,import.meta.url).href,mz).href}return import.meta.url},_z=gz(),vz=()=>{if(_z&&!_z.startsWith(`blob:`))return _z.substring(0,_z.lastIndexOf(`/`)+1)},yz=(e,t)=>{try{let n=t??_z;return(n?new URL(e,n):new URL(e)).origin===mz}catch{return!1}},bz=(e,t)=>{let n=t??_z;try{return(n?new URL(e,n):new URL(e)).href}catch{return}},xz=(e,t)=>`${t??`./`}${e}`,Sz=async e=>{let t=await(await fetch(e,{credentials:`same-origin`})).blob();return URL.createObjectURL(t)},Cz=async e=>(await rk(async()=>{let{default:t}=await import(e);return{default:t}},[])).default,wz=(cz(),rR(iz)).default,Tz=async()=>{if(!_z)throw Error(`Failed to load proxy worker: cannot determine the script source URL.`);if(yz(_z))return[void 0,wz()];let e=await Sz(_z);return[e,wz(e)]},Ez=(pz(),rR(lz)).default,Dz=async(e,t,n,r)=>{let i=Ez&&!(e||t);if(i)if(_z)i=yz(_z);else if(r&&!n)i=!0;else throw Error(`cannot determine the script source URL.`);if(i)return[void 0,Ez];{let r=`ort-wasm-simd-threaded.asyncify.mjs`,i=e??bz(r,t),a=n&&i&&!yz(i,t),o=a?await Sz(i):i??xz(r,t);return[a?o:void 0,await Cz(o)]}}}),kz,Az,jz,Mz,Nz,Pz,Fz,Iz,Lz,Rz=eR(()=>{Oz(),Az=!1,jz=!1,Mz=!1,Nz=()=>{if(typeof SharedArrayBuffer>`u`)return!1;try{return typeof MessageChannel<`u`&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch{return!1}},Pz=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch{return!1}},Fz=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,19,1,17,0,65,1,253,15,65,2,253,15,65,3,253,15,253,147,2,11]))}catch{return!1}},Iz=async e=>{if(Az)return Promise.resolve();if(jz)throw Error(`multiple calls to 'initializeWebAssembly()' detected.`);if(Mz)throw Error(`previous call to 'initializeWebAssembly()' failed.`);jz=!0;let t=e.initTimeout,n=e.numThreads;if(e.simd!==!1){if(e.simd===`relaxed`){if(!Fz())throw Error(`Relaxed WebAssembly SIMD is not supported in the current environment.`)}else if(!Pz())throw Error(`WebAssembly SIMD is not supported in the current environment.`)}let r=Nz();n>1&&!r&&(typeof self<`u`&&!self.crossOriginIsolated&&console.warn(`env.wasm.numThreads is set to `+n+`, but this will not work unless you enable crossOriginIsolated mode. See https://web.dev/cross-origin-isolation-guide/ for more info.`),console.warn(`WebAssembly multi-threading is not supported in the current environment. Falling back to single-threading.`),e.numThreads=n=1);let i=e.wasmPaths,a=typeof i==`string`?i:void 0,o=i?.mjs,s=o?.href??o,c=i?.wasm,l=c?.href??c,u=e.wasmBinary,[d,f]=await Dz(s,a,n>1,!!u||!!l),p=!1,m=[];if(t>0&&m.push(new Promise(e=>{setTimeout(()=>{p=!0,e()},t)})),m.push(new Promise((e,t)=>{let r={numThreads:n};if(u)r.wasmBinary=u;else if(l||a)r.locateFile=e=>l??a+e;else if(s&&s.indexOf(`blob:`)!==0)r.locateFile=e=>new URL(e,s).href;else if(d){let e=vz();e&&(r.locateFile=t=>e+t)}f(r).then(t=>{jz=!1,Az=!0,kz=t,e(),d&&URL.revokeObjectURL(d)},e=>{jz=!1,Mz=!0,t(e)})})),await Promise.race(m),p)throw Error(`WebAssembly backend initializing failed due to timeout: ${t}ms`)},Lz=()=>{if(Az&&kz)return kz;throw Error(`WebAssembly is not initialized yet.`)}}),zz,Bz,Vz,Hz=eR(()=>{Rz(),zz=(e,t)=>{let n=Lz(),r=n.lengthBytesUTF8(e)+1,i=n._malloc(r);return n.stringToUTF8(e,i,r),t.push(i),i},Bz=(e,t,n,r)=>{if(typeof e==`object`&&e){if(n.has(e))throw Error(`Circular reference in options`);n.add(e)}Object.entries(e).forEach(([e,i])=>{let a=t?t+e:e;if(typeof i==`object`)Bz(i,a+`.`,n,r);else if(typeof i==`string`||typeof i==`number`)r(a,i.toString());else if(typeof i==`boolean`)r(a,i?`1`:`0`);else throw Error(`Can't handle extra config type: ${typeof i}`)})},Vz=e=>{let t=Lz(),n=t.stackSave();try{let n=t.PTR_SIZE,r=t.stackAlloc(2*n);t._OrtGetLastError(r,r+n);let i=Number(t.getValue(r,n===4?`i32`:`i64`)),a=t.getValue(r+n,`*`),o=a?t.UTF8ToString(a):``;throw Error(`${e} ERROR_CODE: ${i}, ERROR_MESSAGE: ${o}`)}finally{t.stackRestore(n)}}}),Uz,Wz=eR(()=>{Rz(),Hz(),Uz=e=>{let t=Lz(),n=0,r=[],i=e||{};try{if(e?.logSeverityLevel===void 0)i.logSeverityLevel=2;else if(typeof e.logSeverityLevel!=`number`||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw Error(`log severity level is not valid: ${e.logSeverityLevel}`);if(e?.logVerbosityLevel===void 0)i.logVerbosityLevel=0;else if(typeof e.logVerbosityLevel!=`number`||!Number.isInteger(e.logVerbosityLevel))throw Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);e?.terminate===void 0&&(i.terminate=!1);let a=0;return e?.tag!==void 0&&(a=zz(e.tag,r)),n=t._OrtCreateRunOptions(i.logSeverityLevel,i.logVerbosityLevel,!!i.terminate,a),n===0&&Vz(`Can't create run options.`),e?.extra!==void 0&&Bz(e.extra,``,new WeakSet,(e,i)=>{let a=zz(e,r),o=zz(i,r);t._OrtAddRunConfigEntry(n,a,o)!==0&&Vz(`Can't set a run config entry: ${e} - ${i}.`)}),[n,r]}catch(e){throw n!==0&&t._OrtReleaseRunOptions(n),r.forEach(e=>t._free(e)),e}}}),Gz,Kz,qz,Jz,Yz,Xz,Zz,Qz=eR(()=>{Rz(),Hz(),Gz=e=>{switch(e){case`disabled`:return 0;case`basic`:return 1;case`extended`:return 2;case`layout`:return 3;case`all`:return 99;default:throw Error(`unsupported graph optimization level: ${e}`)}},Kz=e=>{switch(e){case`sequential`:return 0;case`parallel`:return 1;default:throw Error(`unsupported execution mode: ${e}`)}},qz=e=>{e.extra||={},e.extra.session||(e.extra.session={});let t=e.extra.session;t.use_ort_model_bytes_directly||=`1`,e.executionProviders&&e.executionProviders.some(e=>(typeof e==`string`?e:e.name)===`webgpu`)&&(e.enableMemPattern=!1)},Jz=(e,t,n,r)=>{let i=zz(t,r),a=zz(n,r);Lz()._OrtAddSessionConfigEntry(e,i,a)!==0&&Vz(`Can't set a session config entry: ${t} - ${n}.`)},Yz=(e,t,n,r)=>{let i=zz(t,r),a=zz(n,r);e.push([i,a])},Xz=async(e,t,n)=>{let r=t.executionProviders;for(let i of r){let r=typeof i==`string`?i:i.name,a=[];switch(r){case`webnn`:if(r=`WEBNN`,typeof i!=`string`){let t=i?.deviceType;t&&Jz(e,`deviceType`,t,n)}break;case`webgpu`:{r=`WebGPU`;let e;if(typeof i!=`string`){let r=i;if(r.device)if(typeof GPUDevice<`u`&&r.device instanceof GPUDevice)e=r.device;else throw Error(`Invalid GPU device set in WebGPU EP options.`);let{enableGraphCapture:o}=t;if(typeof o==`boolean`&&o&&Yz(a,`enableGraphCapture`,`1`,n),typeof r.preferredLayout==`string`&&Yz(a,`preferredLayout`,r.preferredLayout,n),r.forceCpuNodeNames){let e=Array.isArray(r.forceCpuNodeNames)?r.forceCpuNodeNames:[r.forceCpuNodeNames];Yz(a,`forceCpuNodeNames`,e.join(` +`),n)}r.validationMode&&Yz(a,`validationMode`,r.validationMode,n)}let o=Lz().webgpuRegisterDevice(e);if(o){let[e,t,r]=o;Yz(a,`deviceId`,e.toString(),n),Yz(a,`webgpuInstance`,t.toString(),n),Yz(a,`webgpuDevice`,r.toString(),n)}}break;case`wasm`:case`cpu`:continue;default:throw Error(`not supported execution provider: ${r}`)}let o=zz(r,n),s=a.length,c=0,l=0;if(s>0){c=Lz()._malloc(s*Lz().PTR_SIZE),n.push(c),l=Lz()._malloc(s*Lz().PTR_SIZE),n.push(l);for(let e=0;e{let t=Lz(),n=0,r=[],i=e||{};qz(i);try{let e=Gz(i.graphOptimizationLevel??`all`),a=Kz(i.executionMode??`sequential`),o=typeof i.logId==`string`?zz(i.logId,r):0,s=i.logSeverityLevel??2;if(!Number.isInteger(s)||s<0||s>4)throw Error(`log severity level is not valid: ${s}`);let c=i.logVerbosityLevel??0;if(!Number.isInteger(c)||c<0||c>4)throw Error(`log verbosity level is not valid: ${c}`);let l=typeof i.optimizedModelFilePath==`string`?zz(i.optimizedModelFilePath,r):0;if(n=t._OrtCreateSessionOptions(e,!!i.enableCpuMemArena,!!i.enableMemPattern,a,!!i.enableProfiling,0,o,s,c,l),n===0&&Vz(`Can't create session options.`),i.executionProviders&&await Xz(n,i,r),i.enableGraphCapture!==void 0){if(typeof i.enableGraphCapture!=`boolean`)throw Error(`enableGraphCapture must be a boolean value: ${i.enableGraphCapture}`);Jz(n,`enableGraphCapture`,i.enableGraphCapture.toString(),r)}if(i.freeDimensionOverrides)for(let[e,a]of Object.entries(i.freeDimensionOverrides)){if(typeof e!=`string`)throw Error(`free dimension override name must be a string: ${e}`);if(typeof a!=`number`||!Number.isInteger(a)||a<0)throw Error(`free dimension override value must be a non-negative integer: ${a}`);let i=zz(e,r);t._OrtAddFreeDimensionOverride(n,i,a)!==0&&Vz(`Can't set a free dimension override: ${e} - ${a}.`)}return i.extra!==void 0&&Bz(i.extra,``,new WeakSet,(e,t)=>{Jz(n,e,t,r)}),[n,r]}catch(e){throw n!==0&&t._OrtReleaseSessionOptions(n)!==0&&Vz(`Can't release session options.`),r.forEach(e=>t._free(e)),e}}}),$z,eB,tB,nB,rB,iB,aB,oB,sB=eR(()=>{$z=e=>{switch(e){case`int8`:return 3;case`uint8`:return 2;case`bool`:return 9;case`int16`:return 5;case`uint16`:return 4;case`int32`:return 6;case`uint32`:return 12;case`float16`:return 10;case`float32`:return 1;case`float64`:return 11;case`string`:return 8;case`int64`:return 7;case`uint64`:return 13;case`int4`:return 22;case`uint4`:return 21;default:throw Error(`unsupported data type: ${e}`)}},eB=e=>{switch(e){case 3:return`int8`;case 2:return`uint8`;case 9:return`bool`;case 5:return`int16`;case 4:return`uint16`;case 6:return`int32`;case 12:return`uint32`;case 10:return`float16`;case 1:return`float32`;case 11:return`float64`;case 8:return`string`;case 7:return`int64`;case 13:return`uint64`;case 22:return`int4`;case 21:return`uint4`;default:throw Error(`unsupported data type: ${e}`)}},tB=(e,t)=>{let n=[-1,4,1,1,2,2,4,8,-1,1,2,8,4,8,-1,-1,-1,-1,-1,-1,-1,.5,.5][e],r=typeof t==`number`?t:t.reduce((e,t)=>e*t,1);return n>0?Math.ceil(r*n):void 0},nB=e=>{switch(e){case`float16`:return typeof Float16Array<`u`&&Float16Array.from?Float16Array:Uint16Array;case`float32`:return Float32Array;case`uint8`:return Uint8Array;case`int8`:return Int8Array;case`uint16`:return Uint16Array;case`int16`:return Int16Array;case`int32`:return Int32Array;case`bool`:return Uint8Array;case`float64`:return Float64Array;case`uint32`:return Uint32Array;case`int64`:return BigInt64Array;case`uint64`:return BigUint64Array;default:throw Error(`unsupported type: ${e}`)}},rB=e=>{switch(e){case`verbose`:return 0;case`info`:return 1;case`warning`:return 2;case`error`:return 3;case`fatal`:return 4;default:throw Error(`unsupported logging level: ${e}`)}},iB=e=>e===`float32`||e===`float16`||e===`int32`||e===`int64`||e===`uint32`||e===`uint8`||e===`bool`||e===`uint4`||e===`int4`,aB=e=>e===`float32`||e===`float16`||e===`int32`||e===`int64`||e===`uint32`||e===`uint64`||e===`int8`||e===`uint8`||e===`bool`||e===`uint4`||e===`int4`,oB=e=>{switch(e){case`none`:return 0;case`cpu`:return 1;case`cpu-pinned`:return 2;case`texture`:return 3;case`gpu-buffer`:return 4;case`ml-tensor`:return 5;default:throw Error(`unsupported data location: ${e}`)}}}),cB,lB=eR(()=>{rz(),cB=async e=>{if(typeof e==`string`){let t=await fetch(e);if(!t.ok)throw Error(`failed to load external data file: ${e}`);let n=t.headers.get(`Content-Length`),r=n?parseInt(n,10):0;if(r<1073741824)return new Uint8Array(await t.arrayBuffer());{if(!t.body)throw Error(`failed to load external data file: ${e}, no response body.`);let n=t.body.getReader(),i;try{i=new ArrayBuffer(r)}catch(e){if(e instanceof RangeError){let e=Math.ceil(r/65536);i=new WebAssembly.Memory({initial:e,maximum:e}).buffer}else throw e}let a=0;for(;;){let{done:e,value:t}=await n.read();if(e)break;let r=t.byteLength;new Uint8Array(i,a,r).set(t),a+=r}return new Uint8Array(i,0,r)}}else return e instanceof Blob?new Uint8Array(await e.arrayBuffer()):e instanceof Uint8Array?e:new Uint8Array(e)}}),uB,dB=eR(()=>{sB(),uB=(e,t)=>new(nB(t))(e)}),fB,pB,mB,hB,gB,_B,vB,yB=eR(()=>{sB(),fB=[`V`,`I`,`W`,`E`,`F`],pB=(e,t)=>{console.log(`[${fB[e]},${new Date().toISOString()}]${t}`)},gB=(e,t)=>{mB=e,hB=t},_B=(e,t)=>{let n=rB(e);n>=rB(mB)&&pB(n,typeof t==`function`?t():t)},vB=(...e)=>{hB&&_B(...e)}}),bB,xB,SB,CB,wB,TB,EB,DB,OB,kB,AB,jB=eR(()=>{sB(),yB(),bB=new Map([[`float32`,32],[`float16`,16],[`int32`,32],[`uint32`,32],[`int64`,64],[`uint64`,64],[`int8`,8],[`uint8`,8],[`int4`,4],[`uint4`,4]]),xB=(e,t)=>{if(t===`int32`)return e;let n=bB.get(t);if(!n)throw Error(`WebNN backend does not support data type: ${t}`);let r=n/8;if(e.byteLength%r!==0)throw Error(`Invalid Uint8Array length - must be a multiple of ${r}.`);let i=e.byteLength/r,a=new(nB(t))(e.buffer,e.byteOffset,i);switch(t){case`int64`:case`uint64`:{let e=new Int32Array(i);for(let t=0;t2147483647n||n<-2147483648n)throw Error(`Can not convert int64 data to int32 - value out of range.`);e[t]=Number(n)}return new Uint8Array(e.buffer)}case`int8`:case`uint8`:case`uint32`:{if(t===`uint32`&&a.some(e=>e>2147483647))throw Error(`Can not convert uint32 data to int32 - value out of range.`);let e=Int32Array.from(a,Number);return new Uint8Array(e.buffer)}default:throw Error(`Unsupported data conversion from ${t} to 'int32'`)}},SB=(e,t)=>{if(t===`int32`)return e;if(e.byteLength%4!=0)throw Error(`Invalid Uint8Array length - must be a multiple of 4 (int32).`);let n=e.byteLength/4,r=new Int32Array(e.buffer,e.byteOffset,n);switch(t){case`int64`:{let e=BigInt64Array.from(r,BigInt);return new Uint8Array(e.buffer)}case`uint64`:{if(r.some(e=>e<0))throw Error(`Can not convert int32 data to uin64 - negative value found.`);let e=BigUint64Array.from(r,BigInt);return new Uint8Array(e.buffer)}case`int8`:{if(r.some(e=>e<-128||e>127))throw Error(`Can not convert int32 data to int8 - value out of range.`);let e=Int8Array.from(r,Number);return new Uint8Array(e.buffer)}case`uint8`:if(r.some(e=>e<0||e>255))throw Error(`Can not convert int32 data to uint8 - value out of range.`);return Uint8Array.from(r,Number);case`uint32`:{if(r.some(e=>e<0))throw Error(`Can not convert int32 data to uint32 - negative value found.`);let e=Uint32Array.from(r,Number);return new Uint8Array(e.buffer)}default:throw Error(`Unsupported data conversion from 'int32' to ${t}`)}},CB=1,wB=()=>CB++,TB=new Map([[`int8`,`int32`],[`uint8`,`int32`],[`uint32`,`int32`],[`int64`,`int32`]]),EB=(e,t)=>{let n=bB.get(e);if(!n)throw Error(`WebNN backend does not support data type: ${e}`);return t.length>0?Math.ceil(t.reduce((e,t)=>e*t)*n/8):0},DB=class{constructor(e){this.isDataConverted=!1;let{sessionId:t,context:n,tensor:r,dataType:i,shape:a,fallbackDataType:o}=e;this.sessionId=t,this.mlContext=n,this.mlTensor=r,this.dataType=i,this.tensorShape=a,this.fallbackDataType=o}get tensor(){return this.mlTensor}get type(){return this.dataType}get fallbackType(){return this.fallbackDataType}get shape(){return this.tensorShape}get byteLength(){return EB(this.dataType,this.tensorShape)}destroy(){vB(`verbose`,()=>`[WebNN] TensorWrapper.destroy`),this.mlTensor.destroy()}write(e){this.mlContext.writeTensor(this.mlTensor,e)}async read(e){if(this.fallbackDataType){let t=await this.mlContext.readTensor(this.mlTensor),n=SB(new Uint8Array(t),this.dataType);if(e){(e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)).set(n);return}else return n.buffer}else return e?this.mlContext.readTensor(this.mlTensor,e):this.mlContext.readTensor(this.mlTensor)}canReuseTensor(e,t,n){return this.mlContext===e&&this.dataType===t&&this.tensorShape.length===n.length&&this.tensorShape.every((e,t)=>e===n[t])}setIsDataConverted(e){this.isDataConverted=e}},OB=class{constructor(e,t){this.tensorManager=e,this.wrapper=t}get tensorWrapper(){return this.wrapper}releaseTensor(){this.tensorWrapper&&(this.tensorManager.releaseTensor(this.tensorWrapper),this.wrapper=void 0)}async ensureTensor(e,t,n,r){let i=this.tensorManager.getMLContext(e),a=this.tensorManager.getMLOpSupportLimits(e),o;if(!a?.input.dataTypes.includes(t)){if(o=TB.get(t),!o||a?.input.dataTypes.includes(o))throw Error(`WebNN backend does not support data type: ${t}`);vB(`verbose`,()=>`[WebNN] TensorIdTracker.ensureTensor: fallback dataType from ${t} to ${o}`)}if(this.wrapper){if(this.wrapper.canReuseTensor(i,t,n))return this.wrapper.tensor;if(r){if(this.wrapper.byteLength!==EB(t,n))throw Error(`Unable to copy data to tensor with different size.`);this.activeUpload=new Uint8Array(await this.wrapper.read())}this.tensorManager.releaseTensor(this.wrapper)}let s=typeof MLTensorUsage>`u`?void 0:MLTensorUsage.READ|MLTensorUsage.WRITE;return this.wrapper=await this.tensorManager.getCachedTensor(e,t,n,s,!0,!0,o),r&&this.activeUpload&&(this.wrapper.write(this.activeUpload),this.activeUpload=void 0),this.wrapper.tensor}upload(e){let t=e;if(this.wrapper){if(this.wrapper.fallbackType)if(this.wrapper.fallbackType===`int32`)t=xB(e,this.wrapper.type),this.wrapper.setIsDataConverted(!0);else throw Error(`Unsupported fallback data type: ${this.wrapper.fallbackType}`);if(e.byteLength===this.wrapper.byteLength){this.wrapper.write(t);return}else vB(`verbose`,()=>`Data size does not match tensor size. Releasing tensor.`),this.releaseTensor()}this.activeUpload?this.activeUpload.set(t):this.activeUpload=new Uint8Array(t)}async download(e){if(this.activeUpload){let t=this.wrapper?.isDataConverted?SB(this.activeUpload,this.wrapper?.type):this.activeUpload;if(e){e instanceof ArrayBuffer?new Uint8Array(e).set(t):new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(t);return}else return t.buffer}if(!this.wrapper)throw Error(`Tensor has not been created.`);return e?this.wrapper.read(e):this.wrapper.read()}},kB=class{constructor(e){this.backend=e,this.tensorTrackersById=new Map,this.freeTensors=[],this.externalTensors=new Set}getMLContext(e){let t=this.backend.getMLContext(e);if(!t)throw Error(`MLContext not found for session.`);return t}getMLOpSupportLimits(e){return this.backend.getMLOpSupportLimits(e)}reserveTensorId(){let e=wB();return this.tensorTrackersById.set(e,new OB(this)),e}releaseTensorId(e){let t=this.tensorTrackersById.get(e);t&&(this.tensorTrackersById.delete(e),t.tensorWrapper&&this.releaseTensor(t.tensorWrapper))}async ensureTensor(e,t,n,r,i){vB(`verbose`,()=>`[WebNN] TensorManager.ensureTensor {tensorId: ${t}, dataType: ${n}, shape: ${r}, copyOld: ${i}}`);let a=this.tensorTrackersById.get(t);if(!a)throw Error(`Tensor not found.`);return a.ensureTensor(e,n,r,i)}upload(e,t){let n=this.tensorTrackersById.get(e);if(!n)throw Error(`Tensor not found.`);n.upload(t)}async download(e,t){vB(`verbose`,()=>`[WebNN] TensorManager.download {tensorId: ${e}, dstBuffer: ${t?.byteLength}}`);let n=this.tensorTrackersById.get(e);if(!n)throw Error(`Tensor not found.`);return n.download(t)}releaseTensorsForSession(e){for(let t of this.freeTensors)t.sessionId===e&&t.destroy();this.freeTensors=this.freeTensors.filter(t=>t.sessionId!==e)}registerTensor(e,t,n,r){let i=this.getMLContext(e),a=wB(),o=new DB({sessionId:e,context:i,tensor:t,dataType:n,shape:r});return this.tensorTrackersById.set(a,new OB(this,o)),this.externalTensors.add(o),a}async getCachedTensor(e,t,n,r,i,a,o){let s=this.getMLContext(e);for(let[r,i]of this.freeTensors.entries())if(i.canReuseTensor(s,t,n)){vB(`verbose`,()=>`[WebNN] Reusing tensor {dataType: ${t}, ${o?`fallbackDataType: ${o},`:``} shape: ${n}`);let i=this.freeTensors.splice(r,1)[0];return i.sessionId=e,i}vB(`verbose`,()=>`[WebNN] MLContext.createTensor {dataType: ${t}, ${o?`fallbackDataType: ${o},`:``} shape: ${n}}`);let c=await s.createTensor({dataType:o??t,shape:n,dimensions:n,usage:r,writable:i,readable:a});return new DB({sessionId:e,context:s,tensor:c,dataType:t,shape:n,fallbackDataType:o})}releaseTensor(e){this.externalTensors.has(e)&&this.externalTensors.delete(e),this.freeTensors.push(e)}},AB=(...e)=>new kB(...e)}),MB={};tR(MB,{WebNNBackend:()=>FB});var NB,PB,FB,IB=eR(()=>{sB(),Rz(),dB(),jB(),yB(),NB=new Map([[1,`float32`],[10,`float16`],[6,`int32`],[12,`uint32`],[7,`int64`],[13,`uint64`],[22,`int4`],[21,`uint4`],[3,`int8`],[2,`uint8`],[9,`uint8`]]),PB=(e,t)=>{if(e===t)return!0;if(e===void 0||t===void 0)return!1;let n=Object.keys(e).sort(),r=Object.keys(t).sort();return n.length===r.length&&n.every((n,i)=>n===r[i]&&e[n]===t[n])},FB=class{constructor(e){this.tensorManager=AB(this),this.mlContextBySessionId=new Map,this.sessionIdsByMLContext=new Map,this.mlContextCache=[],this.sessionGraphInputs=new Map,this.sessionGraphOutputs=new Map,this.temporaryGraphInputs=[],this.temporaryGraphOutputs=[],this.temporarySessionTensorIds=new Map,this.mlOpSupportLimitsBySessionId=new Map,gB(e.logLevel,!!e.debug)}get currentSessionId(){if(this.activeSessionId===void 0)throw Error(`No active session`);return this.activeSessionId}onRunStart(e){vB(`verbose`,()=>`[WebNN] onRunStart {sessionId: ${e}}`),this.activeSessionId=e}onRunEnd(e){vB(`verbose`,()=>`[WebNN] onRunEnd {sessionId: ${e}}`);let t=this.temporarySessionTensorIds.get(e);if(t){for(let e of t)vB(`verbose`,()=>`[WebNN] releasing temporary tensor {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e);this.temporarySessionTensorIds.delete(e),this.activeSessionId=void 0}}async createMLContext(e){if(e instanceof GPUDevice){let t=this.mlContextCache.findIndex(t=>t.gpuDevice===e);if(t!==-1)return this.mlContextCache[t].mlContext;{let t=await navigator.ml.createContext(e);return this.mlContextCache.push({gpuDevice:e,mlContext:t}),t}}else if(e===void 0){let e=this.mlContextCache.findIndex(e=>e.options===void 0&&e.gpuDevice===void 0);if(e!==-1)return this.mlContextCache[e].mlContext;{let e=await navigator.ml.createContext();return this.mlContextCache.push({mlContext:e}),e}}let t=this.mlContextCache.findIndex(t=>PB(t.options,e));if(t!==-1)return this.mlContextCache[t].mlContext;{let t=await navigator.ml.createContext(e);return this.mlContextCache.push({options:e,mlContext:t}),t}}registerMLContext(e,t){this.mlContextBySessionId.set(e,t);let n=this.sessionIdsByMLContext.get(t);n||(n=new Set,this.sessionIdsByMLContext.set(t,n)),n.add(e),this.mlOpSupportLimitsBySessionId.has(e)||this.mlOpSupportLimitsBySessionId.set(e,t.opSupportLimits()),this.temporaryGraphInputs.length>0&&(this.sessionGraphInputs.set(e,this.temporaryGraphInputs),this.temporaryGraphInputs=[]),this.temporaryGraphOutputs.length>0&&(this.sessionGraphOutputs.set(e,this.temporaryGraphOutputs),this.temporaryGraphOutputs=[])}onReleaseSession(e){this.sessionGraphInputs.delete(e),this.sessionGraphOutputs.delete(e);let t=this.mlContextBySessionId.get(e);if(!t)return;this.tensorManager.releaseTensorsForSession(e),this.mlContextBySessionId.delete(e),this.mlOpSupportLimitsBySessionId.delete(e);let n=this.sessionIdsByMLContext.get(t);if(n.delete(e),n.size===0){this.sessionIdsByMLContext.delete(t);let e=this.mlContextCache.findIndex(e=>e.mlContext===t);e!==-1&&this.mlContextCache.splice(e,1)}}getMLContext(e){return this.mlContextBySessionId.get(e)}getMLOpSupportLimits(e){return this.mlOpSupportLimitsBySessionId.get(e)}reserveTensorId(){return this.tensorManager.reserveTensorId()}releaseTensorId(e){vB(`verbose`,()=>`[WebNN] releaseTensorId {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e)}async ensureTensor(e,t,n,r,i){let a=NB.get(n);if(!a)throw Error(`Unsupported ONNX data type: ${n}`);return this.tensorManager.ensureTensor(e??this.currentSessionId,t,a,r,i)}async createTemporaryTensor(e,t,n){vB(`verbose`,()=>`[WebNN] createTemporaryTensor {onnxDataType: ${t}, shape: ${n}}`);let r=NB.get(t);if(!r)throw Error(`Unsupported ONNX data type: ${t}`);let i=this.tensorManager.reserveTensorId();await this.tensorManager.ensureTensor(e,i,r,n,!1);let a=this.temporarySessionTensorIds.get(e);return a?a.push(i):this.temporarySessionTensorIds.set(e,[i]),i}uploadTensor(e,t){if(!Lz().shouldTransferToMLTensor)throw Error(`Trying to upload to a MLTensor while shouldTransferToMLTensor is false`);vB(`verbose`,()=>`[WebNN] uploadTensor {tensorId: ${e}, data: ${t.byteLength}}`),this.tensorManager.upload(e,t)}async downloadTensor(e,t){return this.tensorManager.download(e,t)}createMLTensorDownloader(e,t){return async()=>{let n=await this.tensorManager.download(e);return uB(n,t)}}registerMLTensor(e,t,n,r){let i=NB.get(n);if(!i)throw Error(`Unsupported ONNX data type: ${n}`);let a=this.tensorManager.registerTensor(e,t,i,r);return vB(`verbose`,()=>`[WebNN] registerMLTensor {tensor: ${t}, dataType: ${i}, dimensions: ${r}} -> {tensorId: ${a}}`),a}registerMLConstant(e,t,n,r,i,a,o=!1){if(!a)throw Error(`External mounted files are not available.`);let s=e;e.startsWith(`./`)&&(s=e.substring(2));let c=a.get(s);if(!c)throw Error(`File with name ${s} not found in preloaded files.`);if(t+n>c.byteLength)throw Error(`Out of bounds: data offset and length exceed the external file data size.`);let l=c.slice(t,t+n).buffer,u;switch(i.dataType){case`float32`:u=new Float32Array(l);break;case`float16`:u=typeof Float16Array<`u`&&Float16Array.from?new Float16Array(l):new Uint16Array(l);break;case`int32`:u=new Int32Array(l);break;case`uint32`:u=new Uint32Array(l);break;case`int64`:if(o){let e=xB(new Uint8Array(l),`int64`);u=new Int32Array(e.buffer),i.dataType=`int32`}else u=new BigInt64Array(l);break;case`uint64`:u=new BigUint64Array(l);break;case`int8`:u=new Int8Array(l);break;case`int4`:case`uint4`:case`uint8`:u=new Uint8Array(l);break;default:throw Error(`Unsupported data type: ${i.dataType} in creating WebNN Constant from external data.`)}return vB(`verbose`,()=>`[WebNN] registerMLConstant {dataType: ${i.dataType}, shape: ${i.shape}}} ${o?`(Note: it was int64 data type and registered to int32 as workaround)`:``}`),r.constant(i,u)}registerGraphInput(e){this.temporaryGraphInputs.push(e)}registerGraphOutput(e){this.temporaryGraphOutputs.push(e)}isGraphInput(e,t){let n=this.sessionGraphInputs.get(e);return n?n.includes(t):!1}isGraphOutput(e,t){let n=this.sessionGraphOutputs.get(e);return n?n.includes(t):!1}isGraphInputOutputTypeSupported(e,t,n=!0){let r=NB.get($z(t)),i=this.mlOpSupportLimitsBySessionId.get(e);return typeof r>`u`?!1:n?!!i?.input.dataTypes.includes(r):!!i?.output.dataTypes.includes(r)}flush(){}}}),LB,RB,zB,BB,VB,HB,UB,WB,GB,KB,qB,JB,YB,XB=eR(()=>{nz(),Wz(),Qz(),sB(),Rz(),Hz(),lB(),LB=(e,t)=>{Lz()._OrtInit(e,t)!==0&&Vz(`Can't initialize onnxruntime.`)},RB=async e=>{LB(e.wasm.numThreads,rB(e.logLevel))},zB=async(e,t)=>{Lz().asyncInit?.();let n=e.webgpu.adapter;if(t===`webgpu`){if(typeof navigator>`u`||!navigator.gpu)throw Error(`WebGPU is not supported in current environment`);if(n){if(typeof n.limits!=`object`||typeof n.features!=`object`||typeof n.requestDevice!=`function`)throw Error("Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.")}else{let t=e.webgpu.powerPreference;if(t!==void 0&&t!==`low-power`&&t!==`high-performance`)throw Error(`Invalid powerPreference setting: "${t}"`);let r=e.webgpu.forceFallbackAdapter;if(r!==void 0&&typeof r!=`boolean`)throw Error(`Invalid forceFallbackAdapter setting: "${r}"`);if(n=await navigator.gpu.requestAdapter({powerPreference:t,forceFallbackAdapter:r}),!n)throw Error(`Failed to get GPU adapter. You may need to enable flag "--enable-unsafe-webgpu" if you are using Chrome.`)}}if(t===`webnn`&&(typeof navigator>`u`||!navigator.ml))throw Error(`WebNN is not supported in current environment`);if(t===`webgpu`&&Lz().webgpuInit(t=>{e.webgpu.device=t}),t===`webnn`){let t=new(IB(),rR(MB)).WebNNBackend(e);Lz().webnnInit([t,()=>t.reserveTensorId(),e=>t.releaseTensorId(e),async(e,n,r,i,a)=>t.ensureTensor(e,n,r,i,a),(e,n)=>{t.uploadTensor(e,n)},async(e,n)=>t.downloadTensor(e,n),(e,n)=>t.registerMLContext(e,n),!!e.trace])}},BB=new Map,VB=e=>{let t=Lz(),n=t.stackSave();try{let n=t.PTR_SIZE,r=t.stackAlloc(2*n);t._OrtGetInputOutputCount(e,r,r+n)!==0&&Vz(`Can't get session input/output count.`);let i=n===4?`i32`:`i64`;return[Number(t.getValue(r,i)),Number(t.getValue(r+n,i))]}finally{t.stackRestore(n)}},HB=(e,t)=>{let n=Lz(),r=n.stackSave(),i=0;try{let r=n.PTR_SIZE,a=n.stackAlloc(2*r);n._OrtGetInputOutputMetadata(e,t,a,a+r)!==0&&Vz(`Can't get session input/output metadata.`);let o=Number(n.getValue(a,`*`));i=Number(n.getValue(a+r,`*`));let s=n.HEAP32[i/4];if(s===0)return[o,0];let c=n.HEAPU32[i/4+1],l=[];for(let e=0;e{let t=Lz(),n=t._malloc(e.byteLength);if(n===0)throw Error(`Can't create a session. failed to allocate a buffer of size ${e.byteLength}.`);return t.HEAPU8.set(e,n),[n,e.byteLength]},WB=async(e,t)=>{let n,r,i=Lz();Array.isArray(e)?[n,r]=e:e.buffer===i.HEAPU8.buffer?[n,r]=[e.byteOffset,e.byteLength]:[n,r]=UB(e);let a=0,o=0,s=0,c=[],l=[],u=[];try{if([o,c]=await Zz(t),t?.externalData&&i.mountExternalData){let e=[];for(let n of t.externalData){let t=typeof n==`string`?n:n.path;e.push(cB(typeof n==`string`?n:n.data).then(e=>{i.mountExternalData(t,e)}))}await Promise.all(e)}for(let e of t?.executionProviders??[])if((typeof e==`string`?e:e.name)===`webnn`){if(i.shouldTransferToMLTensor=!1,typeof e!=`string`){let t=e,n=t?.context,r=t?.gpuDevice,a=t?.deviceType,o=t?.powerPreference;n?i.currentContext=n:r?i.currentContext=await i.webnnCreateMLContext(r):i.currentContext=await i.webnnCreateMLContext({deviceType:a,powerPreference:o})}else i.currentContext=await i.webnnCreateMLContext();break}a=await i._OrtCreateSession(n,r,o),i.webgpuOnCreateSession?.(a),a===0&&Vz(`Can't create a session.`),i.jsepOnCreateSession?.(),i.currentContext&&(i.webnnRegisterMLContext(a,i.currentContext),i.currentContext=void 0,i.shouldTransferToMLTensor=!0);let[e,d]=VB(a),f=!!t?.enableGraphCapture,p=[],m=[],h=[],g=[],_=[];for(let t=0;te===`gpu-buffer`||e===`ml-tensor`||e===`ml-tensor-cpu-output`)&&(s=i._OrtCreateBinding(a),s===0&&Vz(`Can't create IO binding.`),v={handle:s,outputPreferredLocations:_,outputPreferredLocationsEncoded:_.map(e=>e===`ml-tensor-cpu-output`?`ml-tensor`:e).map(e=>oB(e))}),BB.set(a,[a,l,u,v,f,!1]),[a,p,m,h,g]}catch(e){throw l.forEach(e=>i._OrtFree(e)),u.forEach(e=>i._OrtFree(e)),s!==0&&i._OrtReleaseBinding(s)!==0&&Vz(`Can't release IO binding.`),a!==0&&i._OrtReleaseSession(a)!==0&&Vz(`Can't release session.`),e}finally{i._free(n),o!==0&&i._OrtReleaseSessionOptions(o)!==0&&Vz(`Can't release session options.`),c.forEach(e=>i._free(e)),i.unmountExternalData?.()}},GB=e=>{let t=Lz(),n=BB.get(e);if(!n)throw Error(`cannot release session. invalid session id: ${e}`);let[r,i,a,o,s]=n;o&&(s&&t._OrtClearBoundOutputs(o.handle)!==0&&Vz(`Can't clear bound outputs.`),t._OrtReleaseBinding(o.handle)!==0&&Vz(`Can't release IO binding.`)),t.jsepOnReleaseSession?.(e),t.webnnOnReleaseSession?.(e),t.webgpuOnReleaseSession?.(e),i.forEach(e=>t._OrtFree(e)),a.forEach(e=>t._OrtFree(e)),t._OrtReleaseSession(r)!==0&&Vz(`Can't release session.`),BB.delete(e)},KB=async(e,t,n,r,i,a,o=!1)=>{if(!e){t.push(0);return}let s=Lz(),c=s.PTR_SIZE,l=e[0],u=e[1],d=e[3],f=d,p,m;if(l===`string`&&(d===`gpu-buffer`||d===`ml-tensor`))throw Error(`String tensor is not supported on GPU.`);if(o&&d!==`gpu-buffer`)throw Error(`External buffer must be provided for input/output index ${a} when enableGraphCapture is true.`);if(d===`gpu-buffer`){let t=e[2].gpuBuffer;m=tB($z(l),u);{let e=s.webgpuRegisterBuffer;if(!e)throw Error(`Tensor location "gpu-buffer" is not supported without using WebGPU.`);p=e(t,r)}}else if(d===`ml-tensor`){let t=e[2].mlTensor;m=tB($z(l),u);let n=s.webnnRegisterMLTensor;if(!n)throw Error(`Tensor location "ml-tensor" is not supported without using WebNN.`);p=n(r,t,$z(l),u)}else{let t=e[2];if(Array.isArray(t)){m=c*t.length,p=s._malloc(m),n.push(p);for(let e=0;es.setValue(g+t*c,e,c===4?`i32`:`i64`));let e=s._OrtCreateTensor($z(l),p,m,g,u.length,oB(f));e===0&&Vz(`Can't create tensor for input/output. session=${r}, index=${a}.`),t.push(e)}finally{s.stackRestore(h)}},qB=async(e,t,n,r,i,a)=>{let o=Lz(),s=o.PTR_SIZE,c=BB.get(e);if(!c)throw Error(`cannot run inference. invalid session id: ${e}`);let l=c[0],u=c[1],d=c[2],f=c[3],p=c[4],m=c[5],h=t.length,g=r.length,_=0,v=[],y=[],b=[],x=[],S=[],C=o.stackSave(),w=o.stackAlloc(h*s),T=o.stackAlloc(h*s),E=o.stackAlloc(g*s),D=o.stackAlloc(g*s);try{[_,v]=Uz(a),WR(`wasm prepareInputOutputTensor`);for(let r=0;re*t,1);u=eB(a);let _=f?.outputPreferredLocations[r[t]];if(u===`string`){if(_===`gpu-buffer`||_===`ml-tensor`)throw Error(`String tensor is not supported on GPU.`);let e=[];for(let t=0;t0){let t=o.webgpuGetBuffer;if(!t)throw Error(`preferredLocation "gpu-buffer" is not supported without using WebGPU.`);let r=t(d),i=tB(a,g);if(i===void 0||!iB(u))throw Error(`Unsupported data type: ${u}`);l=!0;{o.webgpuRegisterBuffer(r,e,d);let t=o.webgpuCreateDownloader(r,i,e);C.push([u,h,{gpuBuffer:r,download:async()=>{let e=await t();return new(nB(u))(e)},dispose:()=>{o._OrtReleaseTensor(n)!==0&&Vz(`Can't release tensor.`)}},`gpu-buffer`])}}else if(_===`ml-tensor`&&g>0){let t=o.webnnEnsureTensor,r=o.webnnIsGraphInputOutputTypeSupported;if(!t||!r)throw Error(`preferredLocation "ml-tensor" is not supported without using WebNN.`);if(tB(a,g)===void 0||!aB(u))throw Error(`Unsupported data type: ${u}`);if(!r(e,u,!1))throw Error(`preferredLocation "ml-tensor" for ${u} output is not supported by current WebNN Context.`);let i=await t(e,d,a,h,!1);l=!0,C.push([u,h,{mlTensor:i,download:o.webnnCreateMLTensorDownloader(d,u),dispose:()=>{o.webnnReleaseTensorId(d),o._OrtReleaseTensor(n)}},`ml-tensor`])}else if(_===`ml-tensor-cpu-output`&&g>0){let e=o.webnnCreateMLTensorDownloader(d,u)(),t=C.length;l=!0,O.push((async()=>{let r=[t,await e];return o.webnnReleaseTensorId(d),o._OrtReleaseTensor(n),r})()),C.push([u,h,[],`cpu`])}else{let e=new(nB(u))(g);new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(o.HEAPU8.subarray(d,d+e.byteLength)),C.push([u,h,e,`cpu`])}}finally{o.stackRestore(a),u===`string`&&d&&o._free(d),l||o._OrtReleaseTensor(n)}}f&&!p&&(o._OrtClearBoundOutputs(f.handle)!==0&&Vz(`Can't clear bound outputs.`),BB.set(e,[l,u,d,f,p,!1]));for(let[e,t]of await Promise.all(O))C[e][2]=t;return GR(`wasm ProcessOutputTensor`),C}finally{o.webnnOnRunEnd?.(l),o.stackRestore(C),n.forEach(e=>{e&&e[3]===`gpu-buffer`&&o.webgpuUnregisterBuffer(e[2].gpuBuffer)}),i.forEach(e=>{e&&e[3]===`gpu-buffer`&&o.webgpuUnregisterBuffer(e[2].gpuBuffer)}),y.forEach(e=>o._OrtReleaseTensor(e)),b.forEach(e=>o._OrtReleaseTensor(e)),x.forEach(e=>o._free(e)),_!==0&&o._OrtReleaseRunOptions(_),v.forEach(e=>o._free(e))}},JB=e=>{let t=Lz(),n=BB.get(e);if(!n)throw Error(`invalid session id`);let r=n[0],i=t._OrtEndProfiling(r);i===0&&Vz(`Can't get an profile file name.`),t._OrtFree(i)},YB=e=>{let t=[];for(let n of e){let e=n[2];!Array.isArray(e)&&`buffer`in e&&t.push(e.buffer)}return t}}),ZB,QB,$B,eV,tV,nV,rV,iV,aV,oV,sV,cV,lV,uV,dV,fV,pV,mV,hV=eR(()=>{nz(),XB(),Rz(),Oz(),ZB=()=>!!gR.wasm.proxy&&typeof document<`u`,$B=!1,eV=!1,tV=!1,iV=new Map,aV=(e,t)=>{let n=iV.get(e);n?n.push(t):iV.set(e,[t])},oV=()=>{if($B||!eV||tV||!QB)throw Error(`worker not ready`)},sV=e=>{switch(e.data.type){case`init-wasm`:$B=!1,e.data.err?(tV=!0,rV[1](e.data.err)):(eV=!0,rV[0]()),nV&&=(URL.revokeObjectURL(nV),void 0);break;case`init-ep`:case`copy-from`:case`create`:case`release`:case`run`:case`end-profiling`:{let t=iV.get(e.data.type);e.data.err?t.shift()[1](e.data.err):t.shift()[0](e.data.out);break}default:}},cV=async()=>{if(!eV){if($B)throw Error(`multiple calls to 'initWasm()' detected.`);if(tV)throw Error(`previous call to 'initWasm()' failed.`);if($B=!0,ZB())return new Promise((e,t)=>{QB?.terminate(),Tz().then(([n,r])=>{try{QB=r,QB.onerror=e=>t(e),QB.onmessage=sV,rV=[e,t];let i={type:`init-wasm`,in:gR};!i.in.wasm.wasmPaths&&(n||hz)&&(i.in.wasm.wasmPaths={wasm:new URL(`/assets/ort-wasm-simd-threaded.asyncify-BC9nQecM.wasm`,``+import.meta.url).href}),QB.postMessage(i),nV=n}catch(e){t(e)}},t)});try{await Iz(gR.wasm),await RB(gR),eV=!0}catch(e){throw tV=!0,e}finally{$B=!1}}},lV=async e=>{if(ZB())return oV(),new Promise((t,n)=>{aV(`init-ep`,[t,n]);let r={type:`init-ep`,in:{epName:e,env:gR}};QB.postMessage(r)});await zB(gR,e)},uV=async e=>ZB()?(oV(),new Promise((t,n)=>{aV(`copy-from`,[t,n]);let r={type:`copy-from`,in:{buffer:e}};QB.postMessage(r,[e.buffer])})):UB(e),dV=async(e,t)=>{if(ZB()){if(t?.preferredOutputLocation)throw Error(`session option "preferredOutputLocation" is not supported for proxy.`);return oV(),new Promise((n,r)=>{aV(`create`,[n,r]);let i={type:`create`,in:{model:e,options:{...t}}},a=[];e instanceof Uint8Array&&a.push(e.buffer),QB.postMessage(i,a)})}else return WB(e,t)},fV=async e=>{if(ZB())return oV(),new Promise((t,n)=>{aV(`release`,[t,n]);let r={type:`release`,in:e};QB.postMessage(r)});GB(e)},pV=async(e,t,n,r,i,a)=>{if(ZB()){if(n.some(e=>e[3]!==`cpu`))throw Error(`input tensor on GPU is not supported for proxy.`);if(i.some(e=>e))throw Error(`pre-allocated output tensor is not supported for proxy.`);return oV(),new Promise((i,o)=>{aV(`run`,[i,o]);let s=n,c={type:`run`,in:{sessionId:e,inputIndices:t,inputs:s,outputIndices:r,options:a}};QB.postMessage(c,YB(s))})}else return qB(e,t,n,r,i,a)},mV=async e=>{if(ZB())return oV(),new Promise((t,n)=>{aV(`end-profiling`,[t,n]);let r={type:`end-profiling`,in:e};QB.postMessage(r)});JB(e)}}),gV,_V,vV,yV=eR(()=>{nz(),hV(),sB(),rz(),lB(),gV=(e,t)=>{switch(e.location){case`cpu`:return[e.type,e.dims,e.data,`cpu`];case`gpu-buffer`:return[e.type,e.dims,{gpuBuffer:e.gpuBuffer},`gpu-buffer`];case`ml-tensor`:return[e.type,e.dims,{mlTensor:e.mlTensor},`ml-tensor`];default:throw Error(`invalid data location: ${e.location} for ${t()}`)}},_V=e=>{switch(e[3]){case`cpu`:return new RR(e[0],e[2],e[1]);case`gpu-buffer`:{let t=e[0];if(!iB(t))throw Error(`not supported data type: ${t} for deserializing GPU tensor`);let{gpuBuffer:n,download:r,dispose:i}=e[2];return RR.fromGpuBuffer(n,{dataType:t,dims:e[1],download:r,dispose:i})}case`ml-tensor`:{let t=e[0];if(!aB(t))throw Error(`not supported data type: ${t} for deserializing MLTensor tensor`);let{mlTensor:n,download:r,dispose:i}=e[2];return RR.fromMLTensor(n,{dataType:t,dims:e[1],download:r,dispose:i})}default:throw Error(`invalid data location: ${e[3]}`)}},vV=class{async fetchModelAndCopyToWasmMemory(e){return uV(await cB(e))}async loadModel(e,t){HR();let n;n=typeof e==`string`?await this.fetchModelAndCopyToWasmMemory(e):e,[this.sessionId,this.inputNames,this.outputNames,this.inputMetadata,this.outputMetadata]=await dV(n,t),UR()}async dispose(){return fV(this.sessionId)}async run(e,t,n){HR();let r=[],i=[];Object.entries(e).forEach(e=>{let t=e[0],n=e[1],a=this.inputNames.indexOf(t);if(a===-1)throw Error(`invalid input '${t}'`);r.push(n),i.push(a)});let a=[],o=[];Object.entries(t).forEach(e=>{let t=e[0],n=e[1],r=this.outputNames.indexOf(t);if(r===-1)throw Error(`invalid output '${t}'`);a.push(n),o.push(r)});let s=r.map((e,t)=>gV(e,()=>`input "${this.inputNames[i[t]]}"`)),c=a.map((e,t)=>e?gV(e,()=>`output "${this.outputNames[o[t]]}"`):null),l=await pV(this.sessionId,i,s,o,c,n),u={};for(let e=0;eSV,initializeFlags:()=>xV,wasmBackend:()=>CV});var xV,SV,CV,wV=eR(()=>{nz(),hV(),yV(),xV=()=>{(typeof gR.wasm.initTimeout!=`number`||gR.wasm.initTimeout<0)&&(gR.wasm.initTimeout=0);let e=gR.wasm.simd;if(typeof e!=`boolean`&&e!==void 0&&e!==`fixed`&&e!==`relaxed`&&(console.warn(`Property "env.wasm.simd" is set to unknown value "${e}". Reset it to \`false\` and ignore SIMD feature checking.`),gR.wasm.simd=!1),typeof gR.wasm.proxy!=`boolean`&&(gR.wasm.proxy=!1),typeof gR.wasm.trace!=`boolean`&&(gR.wasm.trace=!1),typeof gR.wasm.numThreads!=`number`||!Number.isInteger(gR.wasm.numThreads)||gR.wasm.numThreads<=0)if(typeof self<`u`&&!self.crossOriginIsolated)gR.wasm.numThreads=1;else{let e=typeof navigator>`u`?$L(`node:os`).cpus().length:navigator.hardwareConcurrency;gR.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},SV=class{async init(e){xV(),await cV(),await lV(e)}async createInferenceSessionHandler(e,t){let n=new vV;return await n.loadModel(e,t),n}},CV=new SV});nz(),nz(),nz();var TV=`1.25.0-dev.20260212-1a71a5f46e`,EV=tz;{let e=(wV(),rR(bV)).wasmBackend;oR(`webgpu`,e,5),oR(`webnn`,e,5),oR(`cpu`,e,10),oR(`wasm`,e,10)}Object.defineProperty(gR.versions,`web`,{value:TV,enumerable:!0});var DV=`warning`;Object.defineProperty({wasm:{},webgl:{},webgpu:{},versions:{common:`1.24.1`},set logLevel(e){if(e!==void 0){if(typeof e!=`string`||[`verbose`,`info`,`warning`,`error`,`fatal`].indexOf(e)===-1)throw Error(`Unsupported logging level: ${e}`);DV=e}},get logLevel(){return DV}},`logLevel`,{enumerable:!0});const OV=(e,t)=>{let n=typeof document<`u`?document.createElement(`canvas`):new OffscreenCanvas(1,1);n.width=e.dims[3],n.height=e.dims[2];let r=n.getContext(`2d`);if(r!=null){let i,a;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[3]):(i=e.dims[3],a=e.dims[2]);let o=t?.format===void 0?`RGB`:t.format,s=t?.norm,c,l;s===void 0||s.mean===void 0?c=[255,255,255,255]:typeof s.mean==`number`?c=[s.mean,s.mean,s.mean,s.mean]:(c=[s.mean[0],s.mean[1],s.mean[2],0],s.mean[3]!==void 0&&(c[3]=s.mean[3])),s===void 0||s.bias===void 0?l=[0,0,0,0]:typeof s.bias==`number`?l=[s.bias,s.bias,s.bias,s.bias]:(l=[s.bias[0],s.bias[1],s.bias[2],0],s.bias[3]!==void 0&&(l[3]=s.bias[3]));let u=a*i,d=0,f=u,p=u*2,m=-1;o===`RGBA`?(d=0,f=u,p=u*2,m=u*3):o===`RGB`?(d=0,f=u,p=u*2):o===`RBG`&&(d=0,p=u,f=u*2);for(let t=0;t{let n=typeof document<`u`?document.createElement(`canvas`).getContext(`2d`):new OffscreenCanvas(1,1).getContext(`2d`),r;if(n!=null){let i,a,o;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[1],o=e.dims[3]):(i=e.dims[3],a=e.dims[2],o=e.dims[1]);let s=t===void 0||t.format===void 0?`RGB`:t.format,c=t?.norm,l,u;c===void 0||c.mean===void 0?l=[255,255,255,255]:typeof c.mean==`number`?l=[c.mean,c.mean,c.mean,c.mean]:(l=[c.mean[0],c.mean[1],c.mean[2],255],c.mean[3]!==void 0&&(l[3]=c.mean[3])),c===void 0||c.bias===void 0?u=[0,0,0,0]:typeof c.bias==`number`?u=[c.bias,c.bias,c.bias,c.bias]:(u=[c.bias[0],c.bias[1],c.bias[2],0],c.bias[3]!==void 0&&(u[3]=c.bias[3]));let d=a*i;if(t!==void 0&&(t.format!==void 0&&o===4&&t.format!==`RGBA`||o===3&&t.format!==`RGB`&&t.format!==`BGR`))throw Error(`Tensor format doesn't match input tensor dims`);let f=0,p=1,m=2,h=3,g=0,_=d,v=d*2,y=-1;s===`RGBA`?(g=0,_=d,v=d*2,y=d*3):s===`RGB`?(g=0,_=d,v=d*2):s===`RBG`&&(g=0,v=d,_=d*2),r=n.createImageData(i,a);for(let t=0;t{if(e===void 0)throw Error(`Image buffer must be defined`);if(t.height===void 0||t.width===void 0)throw Error(`Image height and width must be defined`);if(t.tensorLayout===`NHWC`)throw Error(`NHWC Tensor layout is not supported yet`);let{height:n,width:r}=t,i=t.norm??{mean:255,bias:0},a,o;a=typeof i.mean==`number`?[i.mean,i.mean,i.mean,i.mean]:[i.mean[0],i.mean[1],i.mean[2],i.mean[3]??255],o=typeof i.bias==`number`?[i.bias,i.bias,i.bias,i.bias]:[i.bias[0],i.bias[1],i.bias[2],i.bias[3]??0];let s=t.format===void 0?`RGBA`:t.format,c=t.tensorFormat===void 0||t.tensorFormat===void 0?`RGB`:t.tensorFormat,l=n*r,u=c===`RGBA`?new Float32Array(l*4):new Float32Array(l*3),d=4,f=0,p=1,m=2,h=3,g=0,_=l,v=l*2,y=-1;s===`RGB`&&(d=3,f=0,p=1,m=2,h=-1),c===`RGBA`?y=l*3:c===`RBG`?(g=0,v=l,_=l*2):c===`BGR`&&(v=0,_=l,g=l*2);for(let t=0;t{let n=typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement,r=typeof ImageData<`u`&&e instanceof ImageData,i=typeof ImageBitmap<`u`&&e instanceof ImageBitmap,a=typeof e==`string`,o,s=t??{},c=()=>{if(typeof document<`u`)return document.createElement(`canvas`);if(typeof OffscreenCanvas<`u`)return new OffscreenCanvas(1,1);throw Error(`Canvas is not supported`)},l=e=>typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||e instanceof OffscreenCanvas?e.getContext(`2d`):null;if(n){let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let n=e.height,i=e.width;if(t!==void 0&&t.resizedHeight!==void 0&&t.resizedWidth!==void 0&&(n=t.resizedHeight,i=t.resizedWidth),t!==void 0){if(s=t,t.tensorFormat!==void 0)throw Error(`Image input config format must be RGBA for HTMLImageElement`);s.tensorFormat=`RGBA`,s.height=n,s.width=i}else s.tensorFormat=`RGBA`,s.height=n,s.width=i;r.drawImage(e,0,0),o=r.getImageData(0,0,i,n).data}else throw Error(`Can not access image data`)}else if(r){let n,r;if(t!==void 0&&t.resizedWidth!==void 0&&t.resizedHeight!==void 0?(n=t.resizedHeight,r=t.resizedWidth):(n=e.height,r=e.width),t!==void 0&&(s=t),s.format=`RGBA`,s.height=n,s.width=r,t!==void 0){let t=c();t.width=r,t.height=n;let i=l(t);if(i!=null)i.putImageData(e,0,0),o=i.getImageData(0,0,r,n).data;else throw Error(`Can not access image data`)}else o=e.data}else if(i){if(t===void 0)throw Error(`Please provide image config with format for Imagebitmap`);let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let t=e.height,n=e.width;return r.drawImage(e,0,0,n,t),o=r.getImageData(0,0,n,t).data,s.height=t,s.width=n,AV(o,s)}else throw Error(`Can not access image data`)}else if(a)return new Promise((t,n)=>{let r=c(),i=l(r);if(!e||!i)return n();let a=new Image;a.crossOrigin=`Anonymous`,a.src=e,a.onload=()=>{r.width=a.width,r.height=a.height,i.drawImage(a,0,0,r.width,r.height);let e=i.getImageData(0,0,r.width,r.height);s.height=r.height,s.width=r.width,t(AV(e.data,s))}});else throw Error(`Input data provided is not supported - aborted tensor creation`);if(o!==void 0)return AV(o,s);throw Error(`Input data provided is not supported - aborted tensor creation`)},MV=(e,t)=>{let{width:n,height:r,download:i,dispose:a}=t;return new HV({location:`texture`,type:`float32`,texture:e,dims:[1,r,n,4],download:i,dispose:a})},NV=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new HV({location:`gpu-buffer`,type:n??`float32`,gpuBuffer:e,dims:r,download:i,dispose:a})},PV=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new HV({location:`ml-tensor`,type:n??`float32`,mlTensor:e,dims:r,download:i,dispose:a})},FV=(e,t,n)=>new HV({location:`cpu-pinned`,type:e,data:t,dims:n??[t.length]}),IV=new Map([[`float32`,Float32Array],[`uint8`,Uint8Array],[`int8`,Int8Array],[`uint16`,Uint16Array],[`int16`,Int16Array],[`int32`,Int32Array],[`bool`,Uint8Array],[`float64`,Float64Array],[`uint32`,Uint32Array],[`int4`,Uint8Array],[`uint4`,Uint8Array]]),LV=new Map([[Float32Array,`float32`],[Uint8Array,`uint8`],[Int8Array,`int8`],[Uint16Array,`uint16`],[Int16Array,`int16`],[Int32Array,`int32`],[Float64Array,`float64`],[Uint32Array,`uint32`]]);var RV=!1;const zV=()=>{if(!RV){RV=!0;let e=typeof BigInt64Array<`u`&&BigInt64Array.from,t=typeof BigUint64Array<`u`&&BigUint64Array.from,n=globalThis.Float16Array,r=n!==void 0&&n.from;e&&(IV.set(`int64`,BigInt64Array),LV.set(BigInt64Array,`int64`)),t&&(IV.set(`uint64`,BigUint64Array),LV.set(BigUint64Array,`uint64`)),r?(IV.set(`float16`,n),LV.set(n,`float16`)):IV.set(`float16`,Uint16Array)}},BV=e=>{let t=1;for(let n=0;n{switch(e.location){case`cpu`:return new HV(e.type,e.data,t);case`cpu-pinned`:return new HV({location:`cpu-pinned`,data:e.data,type:e.type,dims:t});case`texture`:return new HV({location:`texture`,texture:e.texture,type:e.type,dims:t});case`gpu-buffer`:return new HV({location:`gpu-buffer`,gpuBuffer:e.gpuBuffer,type:e.type,dims:t});case`ml-tensor`:return new HV({location:`ml-tensor`,mlTensor:e.mlTensor,type:e.type,dims:t});default:throw Error(`tensorReshape: tensor location ${e.location} is not supported`)}};var HV=class{constructor(e,t,n){zV();let r,i;if(typeof e==`object`&&`location`in e)switch(this.dataLocation=e.location,r=e.type,i=e.dims,e.location){case`cpu-pinned`:{let t=IV.get(r);if(!t)throw TypeError(`unsupported type "${r}" to create tensor from pinned buffer`);if(!(e.data instanceof t))throw TypeError(`buffer should be of type ${t.name}`);this.cpuData=e.data;break}case`texture`:if(r!==`float32`)throw TypeError(`unsupported type "${r}" to create tensor from texture`);this.gpuTextureData=e.texture,this.downloader=e.download,this.disposer=e.dispose;break;case`gpu-buffer`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from gpu buffer`);this.gpuBufferData=e.gpuBuffer,this.downloader=e.download,this.disposer=e.dispose;break;case`ml-tensor`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint64`&&r!==`int8`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from MLTensor`);this.mlTensorData=e.mlTensor,this.downloader=e.download,this.disposer=e.dispose;break;default:throw Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let a,o;if(typeof e==`string`)if(r=e,o=n,e===`string`){if(!Array.isArray(t))throw TypeError(`A string tensor's data must be a string array.`);a=t}else{let n=IV.get(e);if(n===void 0)throw TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(t)){if(e===`float16`&&n===Uint16Array||e===`uint4`||e===`int4`)throw TypeError(`Creating a ${e} tensor from number array is not supported. Please use ${n.name} as data.`);a=e===`uint64`||e===`int64`?n.from(t,BigInt):n.from(t)}else if(t instanceof n)a=t;else if(t instanceof Uint8ClampedArray)if(e===`uint8`)a=Uint8Array.from(t);else throw TypeError(`A Uint8ClampedArray tensor's data must be type of uint8`);else if(e===`float16`&&t instanceof Uint16Array&&n!==Uint16Array)a=new globalThis.Float16Array(t.buffer,t.byteOffset,t.length);else throw TypeError(`A ${r} tensor's data must be type of ${n}`)}else if(o=t,Array.isArray(e)){if(e.length===0)throw TypeError(`Tensor type cannot be inferred from an empty array.`);let t=typeof e[0];if(t===`string`)r=`string`,a=e;else if(t===`boolean`)r=`bool`,a=Uint8Array.from(e);else throw TypeError(`Invalid element type of data array: ${t}.`)}else if(e instanceof Uint8ClampedArray)r=`uint8`,a=Uint8Array.from(e);else{let t=LV.get(e.constructor);if(t===void 0)throw TypeError(`Unsupported type for tensor data: ${e.constructor}.`);r=t,a=e}if(o===void 0)o=[a.length];else if(!Array.isArray(o))throw TypeError(`A tensor's dims must be a number array`);i=o,this.cpuData=a,this.dataLocation=`cpu`}let a=BV(i);if(this.cpuData&&a!==this.cpuData.length&&!((r===`uint4`||r===`int4`)&&Math.ceil(a/2)===this.cpuData.length))throw Error(`Tensor's size(${a}) does not match data length(${this.cpuData.length}).`);this.type=r,this.dims=i,this.size=a}static async fromImage(e,t){return jV(e,t)}static fromTexture(e,t){return MV(e,t)}static fromGpuBuffer(e,t){return NV(e,t)}static fromMLTensor(e,t){return PV(e,t)}static fromPinnedBuffer(e,t,n){return FV(e,t,n)}toDataURL(e){return OV(this,e)}toImageData(e){return kV(this,e)}get data(){if(this.ensureValid(),!this.cpuData)throw Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw Error(`The data is not stored as a WebGL texture.`);return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw Error(`The data is not stored as a WebGPU buffer.`);return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw Error(`The data is not stored as a WebNN MLTensor.`);return this.mlTensorData}async getData(e){switch(this.ensureValid(),this.dataLocation){case`cpu`:case`cpu-pinned`:return this.data;case`texture`:case`gpu-buffer`:case`ml-tensor`:if(!this.downloader)throw Error(`The current tensor is not created with a specified data downloader.`);if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);try{this.isDownloading=!0;let t=await this.downloader();return this.downloader=void 0,this.dataLocation=`cpu`,this.cpuData=t,e&&this.disposer&&(this.disposer(),this.disposer=void 0),t}finally{this.isDownloading=!1}default:throw Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);this.disposer&&=(this.disposer(),void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation=`none`}ensureValid(){if(this.dataLocation===`none`)throw Error(`The tensor is disposed.`)}reshape(e){if(this.ensureValid(),this.downloader||this.disposer)throw Error(`Cannot reshape a tensor that owns GPU resource.`);return VV(this,e)}};const UV=HV;var WV=Object.defineProperty,GV=(e,t)=>{for(var n in t)WV(e,n,{get:t[n],enumerable:!0})},KV={},qV={},JV={},YV=`4.0.0-next.3`,XV=typeof process<`u`,ZV=XV&&process?.release?.name===`node`,QV=!mH(KV),$V=!mH(qV),eH=globalThis.Deno!==void 0;globalThis.Bun;var tH=typeof window<`u`&&window.document!==void 0,nH=typeof self<`u`&&[`DedicatedWorkerGlobalScope`,`ServiceWorkerGlobalScope`,`SharedWorkerGlobalScope`].includes(self.constructor?.name),rH=typeof self<`u`&&`caches`in self,iH=ZV||typeof navigator<`u`&&`gpu`in navigator,aH=typeof navigator<`u`&&`ml`in navigator,oH=(()=>{if(typeof navigator>`u`)return!1;let e=navigator.userAgent,t=(navigator.vendor||``).indexOf(`Apple`)>-1,n=!e.match(/CriOS|FxiOS|EdgiOS|OPiOS|mercury|brave/i)&&!e.includes(`Chrome`)&&!e.includes(`Android`);return t&&n})(),sH=Object.freeze({IS_BROWSER_ENV:tH,IS_WEBWORKER_ENV:nH,IS_WEB_CACHE_AVAILABLE:rH,IS_WEBGPU_AVAILABLE:iH,IS_WEBNN_AVAILABLE:aH,IS_SAFARI:oH,IS_PROCESS_AVAILABLE:XV,IS_NODE_ENV:ZV,IS_FS_AVAILABLE:QV,IS_PATH_AVAILABLE:$V}),cH=QV&&$V,lH=`./`;if(cH){let e=Object(import.meta).url;e?lH=qV.dirname(qV.dirname(JV.fileURLToPath(e))):typeof __dirname<`u`&&(lH=qV.dirname(__dirname))}var uH=cH?qV.join(lH,`/.cache/`):null,dH=`/models/`,fH=cH?qV.join(lH,dH):dH,pH={version:YV,backends:{onnx:{}},allowRemoteModels:!0,remoteHost:`https://huggingface.co/`,remotePathTemplate:`{model}/resolve/{revision}/`,allowLocalModels:!(tH||nH),localModelPath:fH,useFS:QV,useBrowserCache:rH&&!eH,useFSCache:QV,cacheDir:uH,useCustomCache:!1,customCache:null,useWasmCache:rH||QV,cacheKey:`transformers-cache`};function mH(e){return Object.keys(e).length===0}var hH=class{constructor(e){this.trie=this._build_trie(e)}_build_trie(e){let t=Object.create(null);for(let n of e){let e=t;for(let t=0;tr&&t.push(e.slice(r,i)),t.push(o),i+=o.length,r=i):++i}return r{let e=[...Array.from({length:94},(e,t)=>t+33),...Array.from({length:12},(e,t)=>t+161),...Array.from({length:82},(e,t)=>t+174)],t=e.slice(),n=0;for(let r=0;r<256;++r)e.includes(r)||(e.push(r),t.push(256+n),n+=1);let r=t.map(e=>String.fromCharCode(e));return Object.fromEntries(e.map((e,t)=>[e,r[t]]))})(),vH=(e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[t,e])))(_H),yH=`.,!?…。,、।۔،`,bH=new Map([[`(?i:'s|'t|'re|'ve|'m|'ll|'d)`,`(?:'([sS]|[tT]|[rR][eE]|[vV][eE]|[mM]|[lL][lL]|[dD]))`],[`(?i:[sdmt]|ll|ve|re)`,`(?:[sS]|[dD]|[mM]|[tT]|[lL][lL]|[vV][eE]|[rR][eE])`],[`[^\\r\\n\\p{L}\\p{N}]?+`,`[^\\r\\n\\p{L}\\p{N}]?`],[`[^\\s\\p{L}\\p{N}]++`,`[^\\s\\p{L}\\p{N}]+`],[` ?[^(\\s|[${yH}])]+`,` ?[^\\s${yH}]+`]]),xH=`\\p{P}\\u0021-\\u002F\\u003A-\\u0040\\u005B-\\u0060\\u007B-\\u007E`,SH=e=>e.replace(/ \./g,`.`).replace(/ \?/g,`?`).replace(/ \!/g,`!`).replace(/ ,/g,`,`).replace(/ \' /g,`'`).replace(/ n't/g,`n't`).replace(/ 'm/g,`'m`).replace(/ 's/g,`'s`).replace(/ 've/g,`'ve`).replace(/ 're/g,`'re`),CH=(e,t=!0)=>{if(e.Regex!==void 0){let t=e.Regex.replace(/\\([#&~])/g,`$1`);for(let[e,n]of bH)t=t.replaceAll(e,n);try{return new RegExp(t,`gu`)}catch(e){if(!(e instanceof SyntaxError)||!e.message.toLowerCase().includes(`invalid property name`))throw e;let n=!1,r=t.replace(/(\\[pP])\{([^}=]+)\}/g,(e,t,r)=>{try{return RegExp(`\\p{${r}}`,`u`),`${t}{${r}}`}catch{return n=!0,`${t}{Script=${r}}`}});if(!n)throw e;try{return new RegExp(r,`gu`)}catch{throw e}}}else if(e.String!==void 0){let n=wH(e.String);return new RegExp(t?n:`(${n})`,`gu`)}else return console.warn(`Unknown pattern type:`,e),null},wH=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),TH=(e,t,n)=>{let r=[],i=0;for(;ie>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=63744&&e<=64255||e>=194560&&e<=195103,DH=e=>Number.isInteger(e)||typeof e==`bigint`,OH=e=>{let t=0;for(let n of e)++t;return t},kH=e=>NH(e.toLowerCase()),AH=(...e)=>Array.prototype.concat.apply([],e),jH=e=>new Map(Object.entries(e)),MH=(e,t)=>{let n=[],r=0;for(let i of e.matchAll(t)){let t=i[0];r0&&n.push(t),r=i.index+t.length}return re.replace(/\p{M}/gu,``),PH=(e,t,n=[])=>{if(!e||Array.isArray(e)||typeof e!=`object`)return`${t} must be a valid object`;for(let r of n)if(!(r in e))return`${t} must contain a "${r}" property`;return null},FH=e=>e.match(/\S+/g)||[],IH=class{constructor(){let e=function(...t){return e._call(...t)};return Object.setPrototypeOf(e,new.target.prototype)}},LH=class extends IH{constructor(e){super(),this.config=e}_call(e){return this.normalize(e)}},RH=class extends LH{tokenize_chinese_chars(e){let t=[];for(let n=0;ne.normalize(`NFKC`)).join(`~`):e.normalize(`NFKC`),e}},BH=class extends LH{constructor(e){super(e),this.normalizers=(e.normalizers??[]).map(e=>QH(e))}normalize(e){return this.normalizers.reduce((e,t)=>t?t.normalize(e):e,e)}},VH=class extends LH{normalize(e){let t=CH(this.config.pattern??{});return t===null?e:e.replaceAll(t,this.config.content??``)}},HH=class extends LH{constructor(){super(...arguments),this.form=`NFC`}normalize(e){return e=e.normalize(this.form),e}},UH=class extends HH{constructor(){super(...arguments),this.form=`NFC`}},WH=class extends HH{constructor(){super(...arguments),this.form=`NFD`}},GH=class extends HH{constructor(){super(...arguments),this.form=`NFKC`}},KH=class extends HH{constructor(){super(...arguments),this.form=`NFKD`}},qH=class extends LH{normalize(e){return this.config.strip_left&&this.config.strip_right?e=e.trim():(this.config.strip_left&&(e=e.trimStart()),this.config.strip_right&&(e=e.trimEnd())),e}},JH=class extends LH{normalize(e){return NH(e)}},YH=class extends LH{normalize(e){return e.toLowerCase()}},XH=class extends LH{normalize(e){return e=this.config.prepend+e,e}};function ZH(e){if(e===null)return null;switch(e.type){case`BertNormalizer`:return new RH(e);case`Precompiled`:return new zH(e);case`Sequence`:return new BH(e);case`Replace`:return new VH(e);case`NFC`:return new UH(e);case`NFD`:return new WH(e);case`NFKC`:return new GH(e);case`NFKD`:return new KH(e);case`Strip`:return new qH(e);case`StripAccents`:return new JH(e);case`Lowercase`:return new YH(e);case`Prepend`:return new XH(e);default:throw Error(`Unknown Normalizer type: ${e.type}`)}}var QH=ZH,$H=class extends IH{pre_tokenize(e,t){return(Array.isArray(e)?e.map(e=>this.pre_tokenize_text(e,t)):this.pre_tokenize_text(e,t)).flat()}_call(e,t){return this.pre_tokenize(e,t)}},eU=class extends $H{constructor(e){super(),this.config=e,this.add_prefix_space=this.config.add_prefix_space??!1,this.trim_offsets=this.config.trim_offsets??!1,this.use_regex=this.config.use_regex??!0,this.pattern=/'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+/gu,this.byte_encoder=_H,this.text_encoder=new TextEncoder}pre_tokenize_text(e,t){return this.add_prefix_space&&!e.startsWith(` `)&&(e=` `+e),(this.use_regex?e.match(this.pattern)||[]:[e]).map(e=>Array.from(this.text_encoder.encode(e),e=>this.byte_encoder[e]).join(``))}},tU=class extends $H{pre_tokenize_text(e,t){return e.match(/\w+|[^\w\s]+/g)||[]}},nU=class extends $H{constructor(e){super(),this.replacement=e.replacement??`▁`,this.str_rep=e.str_rep||this.replacement,this.prepend_scheme=e.prepend_scheme??`always`}pre_tokenize_text(e,t){let{section_index:n=void 0}=t??{},r=e.replaceAll(` `,this.str_rep);return!r.startsWith(this.replacement)&&(this.prepend_scheme===`always`||this.prepend_scheme===`first`&&n===0)&&(r=this.str_rep+r),[r]}},rU=class extends $H{constructor(e){super(),this.config=e,this.pattern=CH(this.config.pattern??{},this.config.invert??!0)}pre_tokenize_text(e){return this.pattern===null?[]:this.config.invert?e.match(this.pattern)||[]:this.config.behavior?.toLowerCase()===`removed`?e.split(this.pattern).filter(e=>e):MH(e,this.pattern)}},iU=class extends $H{constructor(e){super(),this.config=e,this.pattern=RegExp(`[^${xH}]+|[${xH}]+`,`gu`)}pre_tokenize_text(e){return e.match(this.pattern)||[]}},aU=class extends $H{constructor(e){super(),this.config=e;let t=`[^\\d]+|\\d${this.config.individual_digits?``:`+`}`;this.pattern=new RegExp(t,`gu`)}pre_tokenize_text(e){return e.match(this.pattern)||[]}},oU=class extends $H{constructor(){super(),this.pattern=RegExp(`[^\\s${xH}]+|[${xH}]`,`gu`)}pre_tokenize_text(e,t){return e.trim().match(this.pattern)||[]}},sU=class extends $H{constructor(e){super(),this.config=e,this.pattern=CH(this.config.pattern??{}),this.content=this.config.content??``}pre_tokenize_text(e){return this.pattern===null?[e]:[e.replaceAll(this.pattern,this.config.content??``)]}},cU=class extends $H{constructor(e){super(),this.tokenizers=(e.pretokenizers??[]).map(e=>fU(e))}pre_tokenize_text(e,t){return this.tokenizers.reduce((e,n)=>n?n.pre_tokenize(e,t):e,[e])}},lU=class extends $H{pre_tokenize_text(e){return FH(e)}},uU=class extends $H{constructor(e){super(),this.config=e,this._length=e.length}pre_tokenize_text(e){let t=[];for(let n=0;nthis.max_input_chars_per_word){t.push(this.unk_token);continue}let r=!1,i=0,a=[];for(;i0&&(r=this.config.continuing_subword_prefix+r),this.tokens_to_ids.has(r)){n=r;break}--t}if(n===null){r=!0;break}a.push(n),i=t}r?t.push(this.unk_token):t.push(...a)}return t}},hU=class e{constructor(e,t){this.is_leaf=e,this.children=t}static default(){return new e(!1,new Map)}},gU=class{constructor(){this.root=hU.default()}extend(e){for(let t of e)this.push(t)}push(e){let t=this.root;for(let n of e){let e=t.children.get(n);e===void 0&&(e=hU.default(),t.children.set(n,e)),t=e}t.is_leaf=!0}*common_prefix_search(e){let t=this.root;if(t===void 0)return;let n=``;for(let r of e){if(n+=r,t=t.children.get(r),t===void 0)return;t.is_leaf&&(yield n)}}},_U=class e{constructor(e,t,n,r,i){this.token_id=e,this.node_id=t,this.pos=n,this.length=r,this.score=i,this.prev=null,this.backtrace_score=0}clone(){let t=new e(this.token_id,this.node_id,this.pos,this.length,this.score);return t.prev=this.prev,t.backtrace_score=this.backtrace_score,t}},vU=class{constructor(e,t,n){this.chars=Array.from(e),this.len=this.chars.length,this.bos_token_id=t,this.eos_token_id=n,this.nodes=[],this.begin_nodes=Array.from({length:this.len+1},()=>[]),this.end_nodes=Array.from({length:this.len+1},()=>[]);let r=new _U(this.bos_token_id??0,0,0,0,0),i=new _U(this.eos_token_id??0,1,this.len,0,0);this.nodes.push(r.clone()),this.nodes.push(i.clone()),this.begin_nodes[this.len].push(i),this.end_nodes[0].push(r)}insert(e,t,n,r){let i=this.nodes.length,a=new _U(r,i,e,t,n);this.begin_nodes[e].push(a),this.end_nodes[e+t].push(a),this.nodes.push(a)}viterbi(){let e=this.len,t=0;for(;t<=e;){if(this.begin_nodes[t].length==0)return[];for(let e of this.begin_nodes[t]){e.prev=null;let n=0,r=null;for(let i of this.end_nodes[t]){let t=i.backtrace_score+e.score;(r===null||t>n)&&(r=i.clone(),n=t)}if(r!==null)e.prev=r,e.backtrace_score=n;else return[]}++t}let n=[],r=this.begin_nodes[e][0].prev;if(r===null)return[];let i=r.clone();for(;i.prev!==null;)n.push(i.clone()),i=i.clone().prev.clone();return n.reverse(),n}piece(e){return this.chars.slice(e.pos,e.pos+e.length).join(``)}tokens(){return this.viterbi().map(e=>this.piece(e))}token_ids(){return this.viterbi().map(e=>e.token_id)}};function yU(e){if(e.length===0)throw Error(`Array must not be empty`);let t=e[0],n=0;for(let r=1;r[e,t])),this.bos_token=` `,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.unk_token=this.vocab[this.unk_token_id],this.min_score=yU(this.scores)[0],this.unk_score=this.min_score-10,this.scores[this.unk_token_id]=this.unk_score,this.trie=new gU,this.trie.extend(this.vocab),this.fuse_unk=!0}populate_nodes(e){let t=e.chars,n=0;for(;ne>t,t=1/0){this._heap=[],this._comparator=e,this._max_size=t}get size(){return this._heap.length}is_empty(){return this.size===0}peek(){return this._heap[0]}push(...e){return this.extend(e)}extend(e){for(let t of e)if(this.size0&&this._swap(0,t),this._heap.pop(),this._sift_down(),e}replace(e){let t=this.peek();return this._heap[0]=e,this._sift_down(),t}_parent(e){return(e+1>>>1)-1}_left(e){return(e<<1)+1}_right(e){return e+1<<1}_greater(e,t){return this._comparator(this._heap[e],this._heap[t])}_swap(e,t){let n=this._heap[e];this._heap[e]=this._heap[t],this._heap[t]=n}_sift_up(){this._sift_up_from(this.size-1)}_sift_up_from(e){for(;e>0&&this._greater(e,this._parent(e));)this._swap(e,this._parent(e)),e=this._parent(e)}_sift_down(){let e=0;for(;this._left(e)this.capacity&&this.cache.delete(this.cache.keys().next().value)}clear(){this.cache.clear()}},CU=class extends pU{constructor(e){super(e),this.tokens_to_ids=jH(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e;this.merges=Array.isArray(e.merges[0])?e.merges:e.merges.map(e=>e.split(` `,2)),this.bpe_ranks=new Map(this.merges.map((e,t)=>[JSON.stringify(e),t])),this.end_of_word_suffix=e.end_of_word_suffix,this.continuing_subword_suffix=e.continuing_subword_suffix??null,this.byte_fallback=this.config.byte_fallback??!1,this.byte_fallback&&(this.text_encoder=new TextEncoder),this.ignore_merges=this.config.ignore_merges??!1,this.max_length_to_cache=256,this.cache_capacity=1e4,this.cache=new SU(this.cache_capacity)}clear_cache(){this.cache.clear()}bpe(e){if(e.length===0)return[];let t=this.cache.get(e);if(t!==void 0)return t;let n=Array.from(e);this.end_of_word_suffix&&(n[n.length-1]+=this.end_of_word_suffix);let r=[];if(n.length>1){let e=new xU((e,t)=>e.score`<0x${e.toString(16).toUpperCase().padStart(2,`0`)}>`);e.every(e=>this.tokens_to_ids.has(e))?t.push(...e):t.push(this.unk_token)}else t.push(this.unk_token)}return t}},wU=class extends pU{constructor(e,t){super(e);let n=e.vocab;this.tokens_to_ids=jH(t.target_lang?n[t.target_lang]:n),this.bos_token=t.bos_token,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.pad_token=t.pad_token,this.pad_token_id=this.tokens_to_ids.get(this.pad_token),this.unk_token=t.unk_token,this.unk_token_id=this.tokens_to_ids.get(this.unk_token),this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e}encode(e){return e}};function TU(e,t){switch(e.type){case`WordPiece`:return new mU(e);case`Unigram`:return new bU(e,t.eos_token);case`BPE`:return new CU(e);default:if(e.vocab)return Array.isArray(e.vocab)?new bU(e,t.eos_token):Object.hasOwn(e,`continuing_subword_prefix`)&&Object.hasOwn(e,`unk_token`)?Object.hasOwn(e,`merges`)?new CU(e):new mU(e):new wU(e,{target_lang:t.target_lang,bos_token:t.bos_token,eos_token:t.eos_token,pad_token:t.pad_token,unk_token:t.unk_token});throw Error(`Unknown TokenizerModel type: ${e?.type}`)}}var EU=TU,DU=class extends IH{constructor(e){super(),this.config=e}_call(e,...t){return this.post_process(e,...t)}},OU=class extends DU{post_process(e,t=null,n=!0){let r=t===null?this.config.single:this.config.pair,i=[],a=[];for(let o of r)`SpecialToken`in o?n&&(i.push(o.SpecialToken.id),a.push(o.SpecialToken.type_id)):`Sequence`in o&&(o.Sequence.id===`A`?(i=AH(i,e),a=AH(a,Array(e.length).fill(o.Sequence.type_id))):o.Sequence.id===`B`&&(i=AH(i,t),a=AH(a,Array(t.length).fill(o.Sequence.type_id))));return{tokens:i,token_type_ids:a}}},kU=class extends DU{post_process(e,t=null){return{tokens:e,tokens_pair:t}}},AU=class extends DU{constructor(e){super(e),this.sep=e.sep,this.cls=e.cls}post_process(e,t=null,n=!0){n&&(e=AH([this.cls[0]],e,[this.sep[0]]));let r=Array(e.length).fill(0);if(t){let i=[],a=n?[this.sep[0]]:[];e=AH(e,i,t,a),r=AH(r,Array(t.length+i.length+a.length).fill(1))}return{tokens:e,token_type_ids:r}}},jU=class extends DU{constructor(e){super(e),this.sep=e.sep,this.cls=e.cls}post_process(e,t,n=!0){n&&(e=AH([this.cls[0]],e,[this.sep[0]]));let r=Array(e.length).fill(0);if(t){let i=n?[this.sep[0]]:[],a=n?[this.sep[0]]:[];e=AH(e,i,t,a),r=AH(r,Array(t.length+i.length+a.length).fill(1))}return{tokens:e,token_type_ids:r}}},MU=class extends DU{constructor(e){super(e),this.processors=(e.processors??[]).map(e=>PU(e))}post_process(e,t=null,n=!0){let r={tokens:e,tokens_pair:t};for(let e of this.processors)r=e.post_process(r.tokens,r.tokens_pair,n);return r}};function NU(e){if(e===null)return null;switch(e.type){case`TemplateProcessing`:return new OU(e);case`ByteLevel`:return new kU(e);case`BertProcessing`:return new AU(e);case`RobertaProcessing`:return new jU(e);case`Sequence`:return new MU(e);default:throw Error(`Unknown PostProcessor type: ${e.type}`)}}var PU=NU,FU=class extends IH{constructor(e){super(),this.config=e,this.added_tokens=[],this.end_of_word_suffix=null,this.trim_offsets=`trim_offsets`in e?e.trim_offsets:!1}_call(e){return this.decode(e)}decode(e){return this.decode_chain(e).join(``)}},IU=class extends FU{constructor(e){super(e),this.byte_decoder=vH,this.text_decoder=new TextDecoder(`utf-8`,{fatal:!1,ignoreBOM:!0}),this.end_of_word_suffix=null}convert_tokens_to_string(e){let t=e.join(``),n=new Uint8Array([...t].map(e=>this.byte_decoder[e]));return this.text_decoder.decode(n)}decode_chain(e){let t=[],n=[];for(let r of e)this.added_tokens.find(e=>e.content===r)===void 0?n.push(r):(n.length>0&&(t.push(this.convert_tokens_to_string(n)),n=[]),t.push(r));return n.length>0&&t.push(this.convert_tokens_to_string(n)),t}},LU=class extends FU{constructor(e){super(e),this.cleanup=e.cleanup}decode_chain(e){return e.map((e,t)=>{if(t!==0){let t=this.config.prefix;e=t&&e.startsWith(t)?e.replace(t,``):` `+e}return this.cleanup&&(e=SH(e)),e})}},RU=class extends FU{constructor(e){super(e),this.replacement=e.replacement??`▁`}decode_chain(e){let t=[];for(let n=0;nt.replaceAll(this.suffix,n===e.length-1?``:` `))}},BU=class extends FU{constructor(e){super(e),this.pad_token=e.pad_token??``,this.word_delimiter_token=e.word_delimiter_token??``,this.cleanup=e.cleanup}convert_tokens_to_string(e){if(e.length===0)return``;let t=[e[0]];for(let n=1;ne!==this.pad_token).join(``);return this.cleanup&&(n=SH(n).replaceAll(this.word_delimiter_token,` `).trim()),n}decode_chain(e){return[this.convert_tokens_to_string(e)]}},VU=class extends FU{constructor(e){super(e),this.decoders=(e.decoders??[]).map(e=>qU(e))}decode_chain(e){return this.decoders.reduce((e,t)=>t.decode_chain(e),e)}},HU=class extends FU{decode_chain(e){let t=CH(this.config.pattern),n=this.config.content??``;return t===null?e:e.map(e=>e.replaceAll(t,n))}},UU=class extends FU{decode_chain(e){return[e.join(``)]}},WU=class extends FU{constructor(e){super(e),this.content=e.content??``,this.start=e.start??0,this.stop=e.stop??0}decode_chain(e){return e.map(e=>{let t=0;for(let n=0;n`)){let t=parseInt(r.slice(3,5),16);isNaN(t)||(e=t)}if(e!==null)n.push(e);else{if(n.length>0){let e=this.text_decoder.decode(Uint8Array.from(n));t.push(e),n=[]}t.push(r)}}if(n.length>0){let e=this.text_decoder.decode(Uint8Array.from(n));t.push(e),n=[]}return t}};function KU(e){if(e===null)return null;switch(e.type){case`ByteLevel`:return new IU(e);case`WordPiece`:return new LU(e);case`Metaspace`:return new RU(e);case`BPEDecoder`:return new zU(e);case`CTC`:return new BU(e);case`Sequence`:return new VU(e);case`Replace`:return new HU(e);case`Fuse`:return new UU(e);case`Strip`:return new WU(e);case`ByteFallback`:return new GU(e);default:throw Error(`Unknown Decoder type: ${e.type}`)}}var qU=KU,JU=class{constructor(e,t){let n=PH(e,`Tokenizer`,[`model`,`decoder`,`post_processor`,`pre_tokenizer`,`normalizer`]);if(n)throw Error(n);let r=PH(t,`Config`);if(r)throw Error(r);this.tokenizer=e,this.config=t,this.normalizer=QH(this.tokenizer.normalizer),this.pre_tokenizer=fU(this.tokenizer.pre_tokenizer),this.model=EU(this.tokenizer.model,this.config),this.post_processor=PU(this.tokenizer.post_processor),this.decoder=qU(this.tokenizer.decoder),this.special_tokens=[],this.all_special_ids=[],this.added_tokens=[];let i=[],a=[];this.added_tokens_map=new Map;for(let e of this.tokenizer.added_tokens){let t=new gH(e);if(this.added_tokens.push(t),this.model.tokens_to_ids.set(t.content,t.id),this.model.vocab[t.id]=t.content,t.special&&(this.special_tokens.push(t.content),this.all_special_ids.push(t.id)),this.added_tokens_map.set(t.content,t),t.normalized&&this.normalizer!==null){let e=this.normalizer(t.content);a.push(e),this.added_tokens_map.set(e,t)}else i.push(t.content)}(this.config.additional_special_tokens??[]).forEach(e=>{this.special_tokens.includes(e)||this.special_tokens.push(e)}),this.decoder&&(this.decoder.added_tokens=this.added_tokens,this.decoder.end_of_word_suffix=this.model.end_of_word_suffix),this.splitter_unnormalized=new hH(i),this.splitter_normalized=new hH(a),this.remove_space=this.config.remove_space,this.clean_up_tokenization_spaces=this.config.clean_up_tokenization_spaces??!0,this.do_lowercase_and_remove_accent=this.config.do_lowercase_and_remove_accent??!1}encode(e,{text_pair:t=null,add_special_tokens:n=!0,return_token_type_ids:r=null}={}){let{tokens:i,token_type_ids:a}=this.tokenize_helper(e,{text_pair:t,add_special_tokens:n}),o=i.map(e=>this.added_tokens_map.get(e)?.id??this.model.tokens_to_ids.get(e)??this.model.unk_token_id),s={ids:o,tokens:i,attention_mask:Array(o.length).fill(1)};return r&&a&&(s.token_type_ids=a),s}decode(e,t={}){if(!Array.isArray(e)||e.length===0||!DH(e[0]))throw Error(`token_ids must be a non-empty array of integers.`);let n=e.map(e=>this.model.vocab[Number(e)]??this.model.unk_token);t.skip_special_tokens&&(n=n.filter(e=>!this.special_tokens.includes(e)));let r=this.decoder?this.decoder(n):n.join(` `);return this.decoder&&this.decoder.end_of_word_suffix&&(r=r.replaceAll(this.decoder.end_of_word_suffix,` `),t.skip_special_tokens&&(r=r.trim())),(t.clean_up_tokenization_spaces??this.clean_up_tokenization_spaces)&&(r=SH(r)),r}tokenize(e,{text_pair:t=null,add_special_tokens:n=!1}={}){return this.tokenize_helper(e,{text_pair:t,add_special_tokens:n}).tokens}encode_text(e){if(e===null)return null;let t=this.splitter_unnormalized.split(e);return t.forEach((e,n)=>{let r=this.added_tokens_map.get(e);r&&(r.lstrip&&n>0&&(t[n-1]=t[n-1].trimEnd()),r.rstrip&&n{if(e.length===0)return[];if(this.added_tokens_map.has(e))return[e];if(this.remove_space===!0&&(e=e.trim().split(/\s+/).join(` `)),this.do_lowercase_and_remove_accent&&(e=kH(e)),this.normalizer!==null&&(e=this.normalizer(e)),e.length===0)return[];let n=this.splitter_normalized.split(e);return n.forEach((e,t)=>{let r=this.added_tokens_map.get(e);r&&(r.lstrip&&t>0&&(n[t-1]=n[t-1].trimEnd()),r.rstrip&&t{if(e.length===0)return[];if(this.added_tokens_map.has(e))return[e];let n=this.pre_tokenizer===null?[e]:this.pre_tokenizer(e,{section_index:t});return this.model(n)})})}tokenize_helper(e,{text_pair:t=null,add_special_tokens:n=!0}){let r=this.encode_text(e),i=this.encode_text(t||null);return this.post_processor?this.post_processor(r,i,n):{tokens:AH(r??[],i??[])}}token_to_id(e){return this.model.tokens_to_ids.get(e)}id_to_token(e){return this.model.vocab[e]}get_added_tokens_decoder(){let e=new Map;for(let t of this.added_tokens)e.set(t.id,t);return e}get_vocab(e=!0){let t=new Map;for(let n=0;n=`,Q.ComparisonBinaryOperator],[`==`,Q.ComparisonBinaryOperator],[`!=`,Q.ComparisonBinaryOperator],[`<`,Q.ComparisonBinaryOperator],[`>`,Q.ComparisonBinaryOperator],[`+`,Q.AdditiveBinaryOperator],[`-`,Q.AdditiveBinaryOperator],[`~`,Q.AdditiveBinaryOperator],[`*`,Q.MultiplicativeBinaryOperator],[`/`,Q.MultiplicativeBinaryOperator],[`%`,Q.MultiplicativeBinaryOperator],[`=`,Q.Equals]],eW=new Map([[`n`,` +`],[`t`,` `],[`r`,`\r`],[`b`,`\b`],[`f`,`\f`],[`v`,`\v`],[`'`,`'`],[`"`,`"`],[`\\`,`\\`]]);function tW(e,t={}){return e.endsWith(` +`)&&(e=e.slice(0,-1)),t.lstrip_blocks&&(e=e.replace(/^[ \t]*({[#%-])/gm,`$1`)),t.trim_blocks&&(e=e.replace(/([#%-]})\n/g,`$1`)),e.replace(/{%\s*(end)?generation\s*%}/gs,``)}function nW(e,t={}){let n=[],r=tW(e,t),i=0,a=0,o=e=>{let t=``;for(;e(r[i]);){if(r[i]===`\\`){if(++i,i>=r.length)throw SyntaxError(`Unexpected end of input`);let e=r[i++],n=eW.get(e);if(n===void 0)throw SyntaxError(`Unexpected escaped character: ${e}`);t+=n;continue}if(t+=r[i++],i>=r.length)throw SyntaxError(`Unexpected end of input`)}return t},s=()=>{let e=n.at(-1);e&&e.type===Q.Text&&(e.value=e.value.trimEnd(),e.value===``&&n.pop())},c=()=>{for(;i0){n.push(new YU(e,Q.Text));continue}}if(r[i]===`{`&&r[i+1]===`#`){i+=2;let e=r[i]===`-`;e&&++i;let t=``;for(;r[i]!==`#`||r[i+1]!==`}`;){if(i+2>=r.length)throw SyntaxError(`Missing end of comment tag`);t+=r[i++]}let a=t.endsWith(`-`);a&&(t=t.slice(0,-1)),e&&s(),n.push(new YU(t,Q.Comment)),i+=2,a&&c();continue}if(r.slice(i,i+3)===`{%-`){s(),n.push(new YU(`{%`,Q.OpenStatement)),i+=3;continue}if(r.slice(i,i+3)===`{{-`){s(),n.push(new YU(`{{`,Q.OpenExpression)),a=0,i+=3;continue}if(o(QU),r.slice(i,i+3)===`-%}`){n.push(new YU(`%}`,Q.CloseStatement)),i+=3,c();continue}if(r.slice(i,i+3)===`-}}`){n.push(new YU(`}}`,Q.CloseExpression)),i+=3,c();continue}let t=r[i];if(t===`-`||t===`+`){let e=n.at(-1)?.type;if(e===Q.Text||e===void 0)throw SyntaxError(`Unexpected character: ${t}`);switch(e){case Q.Identifier:case Q.NumericLiteral:case Q.StringLiteral:case Q.CloseParen:case Q.CloseSquareBracket:break;default:{++i;let e=o(ZU);n.push(new YU(`${t}${e}`,e.length>0?Q.NumericLiteral:Q.UnaryOperator));continue}}}for(let[e,t]of $U)if(!(e===`}}`&&a>0)&&r.slice(i,i+e.length)===e){n.push(new YU(e,t)),t===Q.OpenExpression?a=0:t===Q.OpenCurlyBracket?++a:t===Q.CloseCurlyBracket&&--a,i+=e.length;continue main}if(t===`'`||t===`"`){++i;let e=o(e=>e!==t);n.push(new YU(e,Q.StringLiteral)),++i;continue}if(ZU(t)){let e=o(ZU);if(r[i]===`.`&&ZU(r[i+1])){++i;let t=o(ZU);e=`${e}.${t}`}n.push(new YU(e,Q.NumericLiteral));continue}if(XU(t)){let e=o(XU);n.push(new YU(e,Q.Identifier));continue}throw SyntaxError(`Unexpected character: ${t}`)}return n}var rW=class{type=`Statement`},iW=class extends rW{constructor(e){super(),this.body=e}type=`Program`},aW=class extends rW{constructor(e,t,n){super(),this.test=e,this.body=t,this.alternate=n}type=`If`},oW=class extends rW{constructor(e,t,n,r){super(),this.loopvar=e,this.iterable=t,this.body=n,this.defaultBlock=r}type=`For`},sW=class extends rW{type=`Break`},cW=class extends rW{type=`Continue`},lW=class extends rW{constructor(e,t,n){super(),this.assignee=e,this.value=t,this.body=n}type=`Set`},uW=class extends rW{constructor(e,t,n){super(),this.name=e,this.args=t,this.body=n}type=`Macro`},dW=class extends rW{constructor(e){super(),this.value=e}type=`Comment`},fW=class extends rW{type=`Expression`},pW=class extends fW{constructor(e,t,n){super(),this.object=e,this.property=t,this.computed=n}type=`MemberExpression`},mW=class extends fW{constructor(e,t){super(),this.callee=e,this.args=t}type=`CallExpression`},hW=class extends fW{constructor(e){super(),this.value=e}type=`Identifier`},gW=class extends fW{constructor(e){super(),this.value=e}type=`Literal`},_W=class extends gW{type=`IntegerLiteral`},vW=class extends gW{type=`FloatLiteral`},yW=class extends gW{type=`StringLiteral`},bW=class extends gW{type=`ArrayLiteral`},xW=class extends gW{type=`TupleLiteral`},SW=class extends gW{type=`ObjectLiteral`},CW=class extends fW{constructor(e,t,n){super(),this.operator=e,this.left=t,this.right=n}type=`BinaryExpression`},wW=class extends fW{constructor(e,t){super(),this.operand=e,this.filter=t}type=`FilterExpression`},TW=class extends rW{constructor(e,t){super(),this.filter=e,this.body=t}type=`FilterStatement`},EW=class extends fW{constructor(e,t){super(),this.lhs=e,this.test=t}type=`SelectExpression`},DW=class extends fW{constructor(e,t,n){super(),this.operand=e,this.negate=t,this.test=n}type=`TestExpression`},OW=class extends fW{constructor(e,t){super(),this.operator=e,this.argument=t}type=`UnaryExpression`},kW=class extends fW{constructor(e=void 0,t=void 0,n=void 0){super(),this.start=e,this.stop=t,this.step=n}type=`SliceExpression`},AW=class extends fW{constructor(e,t){super(),this.key=e,this.value=t}type=`KeywordArgumentExpression`},jW=class extends fW{constructor(e){super(),this.argument=e}type=`SpreadExpression`},MW=class extends rW{constructor(e,t,n){super(),this.call=e,this.callerArgs=t,this.body=n}type=`CallStatement`},NW=class extends fW{constructor(e,t,n){super(),this.condition=e,this.trueExpr=t,this.falseExpr=n}type=`Ternary`};function PW(e){let t=new iW([]),n=0;function r(t,r){let i=e[n++];if(!i||i.type!==t)throw Error(`Parser Error: ${r}. ${i.type} !== ${t}.`);return i}function i(e){if(!c(e))throw SyntaxError(`Expected ${e}`);++n}function a(){switch(e[n].type){case Q.Comment:return new dW(e[n++].value);case Q.Text:return l();case Q.OpenStatement:return u();case Q.OpenExpression:return d();default:throw SyntaxError(`Unexpected token type: ${e[n].type}`)}}function o(...t){return n+t.length<=e.length&&t.every((t,r)=>t===e[n+r].type)}function s(...t){return e[n]?.type===Q.OpenStatement&&e[n+1]?.type===Q.Identifier&&t.includes(e[n+1]?.value)}function c(...t){return n+t.length<=e.length&&t.every((t,r)=>e[n+r].type===`Identifier`&&t===e[n+r].value)}function l(){return new yW(r(Q.Text,`Expected text token`).value)}function u(){if(r(Q.OpenStatement,`Expected opening statement token`),e[n].type!==Q.Identifier)throw SyntaxError(`Unknown statement, got ${e[n].type}`);let t=e[n].value,c;switch(t){case`set`:++n,c=f();break;case`if`:++n,c=p(),r(Q.OpenStatement,`Expected {% token`),i(`endif`),r(Q.CloseStatement,`Expected %} token`);break;case`macro`:++n,c=m(),r(Q.OpenStatement,`Expected {% token`),i(`endmacro`),r(Q.CloseStatement,`Expected %} token`);break;case`for`:++n,c=g(),r(Q.OpenStatement,`Expected {% token`),i(`endfor`),r(Q.CloseStatement,`Expected %} token`);break;case`call`:{++n;let e=null;o(Q.OpenParen)&&(e=E());let t=ne();if(t.type!==`Identifier`)throw SyntaxError(`Expected identifier following call statement`);let l=E();r(Q.CloseStatement,`Expected closing statement token`);let u=[];for(;!s(`endcall`);)u.push(a());r(Q.OpenStatement,`Expected '{%'`),i(`endcall`),r(Q.CloseStatement,`Expected closing statement token`),c=new MW(new mW(t,l),e,u);break}case`break`:++n,r(Q.CloseStatement,`Expected closing statement token`),c=new sW;break;case`continue`:++n,r(Q.CloseStatement,`Expected closing statement token`),c=new cW;break;case`filter`:{++n;let e=ne();e instanceof hW&&o(Q.OpenParen)&&(e=T(e)),r(Q.CloseStatement,`Expected closing statement token`);let t=[];for(;!s(`endfilter`);)t.push(a());r(Q.OpenStatement,`Expected '{%'`),i(`endfilter`),r(Q.CloseStatement,`Expected '%}'`),c=new TW(e,t);break}default:throw SyntaxError(`Unknown statement type: ${t}`)}return c}function d(){r(Q.OpenExpression,`Expected opening expression token`);let e=_();return r(Q.CloseExpression,`Expected closing expression token`),e}function f(){let e=h(),t=null,c=[];if(o(Q.Equals))++n,t=h();else{for(r(Q.CloseStatement,`Expected %} token`);!s(`endset`);)c.push(a());r(Q.OpenStatement,`Expected {% token`),i(`endset`)}return r(Q.CloseStatement,`Expected closing statement token`),new lW(e,t,c)}function p(){let e=_();r(Q.CloseStatement,`Expected closing statement token`);let t=[],i=[];for(;!s(`elif`,`else`,`endif`);)t.push(a());if(s(`elif`)){++n,++n;let e=p();i.push(e)}else if(s(`else`))for(++n,++n,r(Q.CloseStatement,`Expected closing statement token`);!s(`endif`);)i.push(a());return new aW(e,t,i)}function m(){let e=ne();if(e.type!==`Identifier`)throw SyntaxError(`Expected identifier following macro statement`);let t=E();r(Q.CloseStatement,`Expected closing statement token`);let n=[];for(;!s(`endmacro`);)n.push(a());return new uW(e,t,n)}function h(e=!1){let t=e?ne:_,r=[t()],i=o(Q.Comma);for(;i&&(++n,r.push(t()),o(Q.Comma)););return i?new xW(r):r[0]}function g(){let e=h(!0);if(!(e instanceof hW||e instanceof xW))throw SyntaxError(`Expected identifier/tuple for the loop variable, got ${e.type} instead`);if(!c(`in`))throw SyntaxError("Expected `in` keyword following loop variable");++n;let t=_();r(Q.CloseStatement,`Expected closing statement token`);let i=[];for(;!s(`endfor`,`else`);)i.push(a());let o=[];if(s(`else`))for(++n,++n,r(Q.CloseStatement,`Expected closing statement token`);!s(`endfor`);)o.push(a());return new oW(e,t,i,o)}function _(){return v()}function v(){let e=y();if(c(`if`)){++n;let t=y();return c(`else`)?(++n,new NW(t,e,v())):new EW(e,t)}return e}function y(){let t=b();for(;c(`or`);){let r=e[n];++n;let i=b();t=new CW(r,t,i)}return t}function b(){let t=x();for(;c(`and`);){let r=e[n];++n;let i=x();t=new CW(r,t,i)}return t}function x(){let t;for(;c(`not`);){let r=e[n];++n,t=new OW(r,x())}return t??S()}function S(){let t=C();for(;;){let r;if(c(`not`,`in`))r=new YU(`not in`,Q.Identifier),n+=2;else if(c(`in`))r=e[n++];else if(o(Q.ComparisonBinaryOperator))r=e[n++];else break;let i=C();t=new CW(r,t,i)}return t}function C(){let t=A();for(;o(Q.AdditiveBinaryOperator);){let r=e[n];++n;let i=A();t=new CW(r,t,i)}return t}function w(){let e=k(ne());return o(Q.OpenParen)?T(e):e}function T(e){let t=new mW(e,E());return t=k(t),o(Q.OpenParen)&&(t=T(t)),t}function E(){r(Q.OpenParen,`Expected opening parenthesis for arguments list`);let e=D();return r(Q.CloseParen,`Expected closing parenthesis for arguments list`),e}function D(){let t=[];for(;!o(Q.CloseParen);){let r;if(e[n].type===Q.MultiplicativeBinaryOperator&&e[n].value===`*`)++n,r=new jW(_());else if(r=_(),o(Q.Equals)){if(++n,!(r instanceof hW))throw SyntaxError(`Expected identifier for keyword argument`);let e=_();r=new AW(r,e)}t.push(r),o(Q.Comma)&&++n}return t}function O(){let e=[],t=!1;for(;!o(Q.CloseSquareBracket);)o(Q.Colon)?(e.push(void 0),++n,t=!0):(e.push(_()),o(Q.Colon)&&(++n,t=!0));if(e.length===0)throw SyntaxError(`Expected at least one argument for member/slice expression`);if(t){if(e.length>3)throw SyntaxError(`Expected 0-3 arguments for slice expression`);return new kW(...e)}return e[0]}function k(t){for(;o(Q.Dot)||o(Q.OpenSquareBracket);){let i=e[n];++n;let a,o=i.type===Q.OpenSquareBracket;if(o)a=O(),r(Q.CloseSquareBracket,`Expected closing square bracket`);else if(a=ne(),a.type!==`Identifier`)throw SyntaxError(`Expected identifier following dot operator`);t=new pW(t,a,o)}return t}function A(){let t=ee();for(;o(Q.MultiplicativeBinaryOperator);){let r=e[n++],i=ee();t=new CW(r,t,i)}return t}function ee(){let e=te();for(;c(`is`);){++n;let t=c(`not`);t&&++n;let r=ne();if(!(r instanceof hW))throw SyntaxError(`Expected identifier for the test`);e=new DW(e,t,r)}return e}function te(){let e=w();for(;o(Q.Pipe);){++n;let t=ne();if(!(t instanceof hW))throw SyntaxError(`Expected identifier for the filter`);o(Q.OpenParen)&&(t=T(t)),e=new wW(e,t)}return e}function ne(){let t=e[n++];switch(t.type){case Q.NumericLiteral:{let e=t.value;return e.includes(`.`)?new vW(Number(e)):new _W(Number(e))}case Q.StringLiteral:{let r=t.value;for(;o(Q.StringLiteral);)r+=e[n++].value;return new yW(r)}case Q.Identifier:return new hW(t.value);case Q.OpenParen:{let e=h();return r(Q.CloseParen,"Expected closing parenthesis, got ${tokens[current].type} instead."),e}case Q.OpenSquareBracket:{let e=[];for(;!o(Q.CloseSquareBracket);)e.push(_()),o(Q.Comma)&&++n;return++n,new bW(e)}case Q.OpenCurlyBracket:{let e=new Map;for(;!o(Q.CloseCurlyBracket);){let t=_();r(Q.Colon,`Expected colon between key and value in object literal`);let i=_();e.set(t,i),o(Q.Comma)&&++n}return++n,new SW(e)}default:throw SyntaxError(`Unexpected token: ${t.type}`)}}for(;n0)for(let i=e;it;i+=n)r.push(i);return r}function IW(e,t,n,r=1){let i=Math.sign(r);i>=0?(t=(t??=0)<0?Math.max(e.length+t,0):Math.min(t,e.length),n=(n??=e.length)<0?Math.max(e.length+n,0):Math.min(n,e.length)):(t=(t??=e.length-1)<0?Math.max(e.length+t,-1):Math.min(t,e.length-1),n=(n??=-1)<-1?Math.max(e.length+n,-1):Math.min(n,e.length-1));let a=[];for(let o=t;i*oe.toUpperCase())}function RW(e){return zW(new Date,e)}function zW(e,t){let n=new Intl.DateTimeFormat(void 0,{month:`long`}),r=new Intl.DateTimeFormat(void 0,{month:`short`}),i=e=>e<10?`0`+e:e.toString();return t.replace(/%[YmdbBHM%]/g,t=>{switch(t){case`%Y`:return e.getFullYear().toString();case`%m`:return i(e.getMonth()+1);case`%d`:return i(e.getDate());case`%b`:return r.format(e);case`%B`:return n.format(e);case`%H`:return i(e.getHours());case`%M`:return i(e.getMinutes());case`%%`:return`%`;default:return t}})}function BW(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function VW(e,t,n,r){if(r===0)return e;let i=r==null||r<0?1/0:r,a=t.length===0?RegExp(`(?=)`,`gu`):new RegExp(BW(t),`gu`);return e.replaceAll(a,e=>i>0?(--i,n):e)}var HW=class extends Error{},UW=class extends Error{},WW=class{type=`RuntimeValue`;value;builtins=new Map;constructor(e=void 0){this.value=e}__bool__(){return new JW(!!this.value)}toString(){return String(this.value)}},GW=class extends WW{type=`IntegerValue`},KW=class extends WW{type=`FloatValue`;toString(){return this.value%1==0?this.value.toFixed(1):this.value.toString()}},qW=class extends WW{type=`StringValue`;builtins=new Map([[`upper`,new nG(()=>new qW(this.value.toUpperCase()))],[`lower`,new nG(()=>new qW(this.value.toLowerCase()))],[`strip`,new nG(()=>new qW(this.value.trim()))],[`title`,new nG(()=>new qW(LW(this.value)))],[`capitalize`,new nG(()=>new qW(this.value.charAt(0).toUpperCase()+this.value.slice(1)))],[`length`,new GW(this.value.length)],[`rstrip`,new nG(()=>new qW(this.value.trimEnd()))],[`lstrip`,new nG(()=>new qW(this.value.trimStart()))],[`startswith`,new nG(e=>{if(e.length===0)throw Error(`startswith() requires at least one argument`);let t=e[0];if(t instanceof qW)return new JW(this.value.startsWith(t.value));if(t instanceof eG){for(let e of t.value){if(!(e instanceof qW))throw Error(`startswith() tuple elements must be strings`);if(this.value.startsWith(e.value))return new JW(!0)}return new JW(!1)}throw Error(`startswith() argument must be a string or tuple of strings`)})],[`endswith`,new nG(e=>{if(e.length===0)throw Error(`endswith() requires at least one argument`);let t=e[0];if(t instanceof qW)return new JW(this.value.endsWith(t.value));if(t instanceof eG){for(let e of t.value){if(!(e instanceof qW))throw Error(`endswith() tuple elements must be strings`);if(this.value.endsWith(e.value))return new JW(!0)}return new JW(!1)}throw Error(`endswith() argument must be a string or tuple of strings`)})],[`split`,new nG(e=>{let t=e[0]??new rG;if(!(t instanceof qW||t instanceof rG))throw Error(`sep argument must be a string or null`);let n=e[1]??new GW(-1);if(!(n instanceof GW))throw Error(`maxsplit argument must be a number`);let r=[];if(t instanceof rG){let e=this.value.trimStart();for(let{0:t,index:i}of e.matchAll(/\S+/g)){if(n.value!==-1&&r.length>=n.value&&i!==void 0){r.push(t+e.slice(i+t.length));break}r.push(t)}}else{if(t.value===``)throw Error(`empty separator`);r=this.value.split(t.value),n.value!==-1&&r.length>n.value&&r.push(r.splice(n.value).join(t.value))}return new eG(r.map(e=>new qW(e)))})],[`replace`,new nG(e=>{if(e.length<2)throw Error(`replace() requires at least two arguments`);let t=e[0],n=e[1];if(!(t instanceof qW&&n instanceof qW))throw Error(`replace() arguments must be strings`);let r;if(r=e.length>2?e[2].type===`KeywordArgumentsValue`?e[2].value.get(`count`)??new rG:e[2]:new rG,!(r instanceof GW||r instanceof rG))throw Error(`replace() count argument must be a number or null`);return new qW(VW(this.value,t.value,n.value,r.value))})]])},JW=class extends WW{type=`BooleanValue`},YW=/[\x7f-\uffff]/g;function XW(e){return e.replace(YW,e=>`\\u`+e.charCodeAt(0).toString(16).padStart(4,`0`))}function ZW(e,t={},n=0,r=!0){let{indent:i=null,ensureAscii:a=!1,separators:o=null,sortKeys:s=!1}=t,c,l;switch(o?[c,l]=o:i?(c=`,`,l=`: `):(c=`, `,l=`: `),e.type){case`NullValue`:return`null`;case`UndefinedValue`:return r?`null`:`undefined`;case`IntegerValue`:case`FloatValue`:case`BooleanValue`:return JSON.stringify(e.value);case`StringValue`:{let t=JSON.stringify(e.value);return a&&(t=XW(t)),t}case`ArrayValue`:case`ObjectValue`:{let o=i?` `.repeat(i):``,u=` +`+o.repeat(n),d=u+o;if(e.type===`ArrayValue`){let a=e.value.map(e=>ZW(e,t,n+1,r));return i?`[${d}${a.join(`${c}${d}`)}${u}]`:`[${a.join(c)}]`}else{let o=Array.from(e.value.entries());s&&(o=o.sort(([e],[t])=>e.localeCompare(t)));let f=o.map(([e,o])=>{let s=JSON.stringify(e);a&&(s=XW(s));let c=`${s}${l}${ZW(o,t,n+1,r)}`;return i?`${d}${c}`:c});return i?`{${f.join(c)}${u}}`:`{${f.join(c)}}`}}default:throw Error(`Cannot convert to JSON: ${e.type}`)}}var QW=class extends WW{type=`ObjectValue`;__bool__(){return new JW(this.value.size>0)}builtins=new Map([[`get`,new nG(([e,t])=>{if(!(e instanceof qW))throw Error(`Object key must be a string: got ${e.type}`);return this.value.get(e.value)??t??new rG})],[`items`,new nG(()=>this.items())],[`keys`,new nG(()=>this.keys())],[`values`,new nG(()=>this.values())],[`dictsort`,new nG(e=>{let t=new Map,n=e.filter(e=>e instanceof $W?(t=e.value,!1):!0),r=n.at(0)??t.get(`case_sensitive`)??new JW(!1);if(!(r instanceof JW))throw Error(`case_sensitive must be a boolean`);let i=n.at(1)??t.get(`by`)??new qW(`key`);if(!(i instanceof qW))throw Error(`by must be a string`);if(![`key`,`value`].includes(i.value))throw Error(`by must be either 'key' or 'value'`);let a=n.at(2)??t.get(`reverse`)??new JW(!1);if(!(a instanceof JW))throw Error(`reverse must be a boolean`);return new eG(Array.from(this.value.entries()).map(([e,t])=>new eG([new qW(e),t])).sort((e,t)=>{let n=i.value===`key`?0:1,o=e.value[n],s=t.value[n],c=cG(o,s,r.value);return a.value?-c:c}))})]]);items(){return new eG(Array.from(this.value.entries()).map(([e,t])=>new eG([new qW(e),t])))}keys(){return new eG(Array.from(this.value.keys()).map(e=>new qW(e)))}values(){return new eG(Array.from(this.value.values()))}toString(){return ZW(this,{},0,!1)}},$W=class extends QW{type=`KeywordArgumentsValue`},eG=class extends WW{type=`ArrayValue`;builtins=new Map([[`length`,new GW(this.value.length)]]);__bool__(){return new JW(this.value.length>0)}toString(){return ZW(this,{},0,!1)}},tG=class extends eG{type=`TupleValue`},nG=class extends WW{type=`FunctionValue`},rG=class extends WW{type=`NullValue`},iG=class extends WW{type=`UndefinedValue`},aG=class{constructor(e){this.parent=e}variables=new Map([[`namespace`,new nG(e=>{if(e.length===0)return new QW(new Map);if(e.length!==1||!(e[0]instanceof QW))throw Error("`namespace` expects either zero arguments or a single object argument");return e[0]})]]);tests=new Map([[`boolean`,e=>e.type===`BooleanValue`],[`callable`,e=>e instanceof nG],[`odd`,e=>{if(!(e instanceof GW))throw Error(`cannot odd on ${e.type}`);return e.value%2!=0}],[`even`,e=>{if(!(e instanceof GW))throw Error(`cannot even on ${e.type}`);return e.value%2==0}],[`false`,e=>e.type===`BooleanValue`&&!e.value],[`true`,e=>e.type===`BooleanValue`&&e.value],[`none`,e=>e.type===`NullValue`],[`string`,e=>e.type===`StringValue`],[`number`,e=>e instanceof GW||e instanceof KW],[`integer`,e=>e instanceof GW],[`iterable`,e=>e.type===`ArrayValue`||e.type===`StringValue`],[`mapping`,e=>e.type===`ObjectValue`],[`lower`,e=>{let t=e.value;return e.type===`StringValue`&&t===t.toLowerCase()}],[`upper`,e=>{let t=e.value;return e.type===`StringValue`&&t===t.toUpperCase()}],[`none`,e=>e.type===`NullValue`],[`defined`,e=>e.type!==`UndefinedValue`],[`undefined`,e=>e.type===`UndefinedValue`],[`equalto`,(e,t)=>e.value===t.value],[`eq`,(e,t)=>e.value===t.value]]);set(e,t){return this.declareVariable(e,uG(t))}declareVariable(e,t){if(this.variables.has(e))throw SyntaxError(`Variable already declared: ${e}`);return this.variables.set(e,t),t}setVariable(e,t){return this.variables.set(e,t),t}resolve(e){if(this.variables.has(e))return this;if(this.parent)return this.parent.resolve(e);throw Error(`Unknown variable: ${e}`)}lookupVariable(e){try{return this.resolve(e).variables.get(e)??new iG}catch{return new iG}}};function oG(e){e.set(`false`,!1),e.set(`true`,!0),e.set(`none`,null),e.set(`raise_exception`,e=>{throw Error(e)}),e.set(`range`,FW),e.set(`strftime_now`,RW),e.set(`True`,!0),e.set(`False`,!1),e.set(`None`,null)}function sG(e,t){let n=t.split(`.`),r=e;for(let e of n)if(r instanceof QW)r=r.value.get(e)??new iG;else if(r instanceof eG){let t=parseInt(e,10);if(!isNaN(t)&&t>=0&&te instanceof GW||e instanceof KW||e instanceof JW,i=e=>e instanceof JW?e.value?1:0:e.value;if(r(e)&&r(t)){let n=i(e),r=i(t);return nr?1:0}if(e.type!==t.type)throw Error(`Cannot compare different types: ${e.type} and ${t.type}`);switch(e.type){case`StringValue`:{let r=e.value,i=t.value;return n||(r=r.toLowerCase(),i=i.toLowerCase()),ri?1:0}default:throw Error(`Cannot compare type: ${e.type}`)}}var lG=class{global;constructor(e){this.global=e??new aG}run(e){return this.evaluate(e,this.global)}evaluateBinaryExpression(e,t){let n=this.evaluate(e.left,t);switch(e.operator.value){case`and`:return n.__bool__().value?this.evaluate(e.right,t):n;case`or`:return n.__bool__().value?n:this.evaluate(e.right,t)}let r=this.evaluate(e.right,t);switch(e.operator.value){case`==`:return new JW(n.value==r.value);case`!=`:return new JW(n.value!=r.value)}if(n instanceof iG||r instanceof iG){if(r instanceof iG&&[`in`,`not in`].includes(e.operator.value))return new JW(e.operator.value===`not in`);throw Error(`Cannot perform operation ${e.operator.value} on undefined values`)}else if(n instanceof rG||r instanceof rG)throw Error(`Cannot perform operation on null values`);else if(e.operator.value===`~`)return new qW(n.value.toString()+r.value.toString());else if((n instanceof GW||n instanceof KW)&&(r instanceof GW||r instanceof KW)){let t=n.value,i=r.value;switch(e.operator.value){case`+`:case`-`:case`*`:{let a=e.operator.value===`+`?t+i:e.operator.value===`-`?t-i:t*i;return n instanceof KW||r instanceof KW?new KW(a):new GW(a)}case`/`:return new KW(t/i);case`%`:{let e=t%i;return n instanceof KW||r instanceof KW?new KW(e):new GW(e)}case`<`:return new JW(t`:return new JW(t>i);case`>=`:return new JW(t>=i);case`<=`:return new JW(t<=i)}}else if(n instanceof eG&&r instanceof eG)switch(e.operator.value){case`+`:return new eG(n.value.concat(r.value))}else if(r instanceof eG){let t=r.value.find(e=>e.value===n.value)!==void 0;switch(e.operator.value){case`in`:return new JW(t);case`not in`:return new JW(!t)}}if(n instanceof qW||r instanceof qW)switch(e.operator.value){case`+`:return new qW(n.value.toString()+r.value.toString())}if(n instanceof qW&&r instanceof qW)switch(e.operator.value){case`in`:return new JW(r.value.includes(n.value));case`not in`:return new JW(!r.value.includes(n.value))}if(n instanceof qW&&r instanceof QW)switch(e.operator.value){case`in`:return new JW(r.value.has(n.value));case`not in`:return new JW(!r.value.has(n.value))}throw SyntaxError(`Unknown operator "${e.operator.value}" between ${n.type} and ${r.type}`)}evaluateArguments(e,t){let n=[],r=new Map;for(let i of e)if(i.type===`SpreadExpression`){let e=i,r=this.evaluate(e.argument,t);if(!(r instanceof eG))throw Error(`Cannot unpack non-iterable type: ${r.type}`);for(let e of r.value)n.push(e)}else if(i.type===`KeywordArgumentExpression`){let e=i;r.set(e.key.value,this.evaluate(e.value,t))}else{if(r.size>0)throw Error(`Positional arguments must come before keyword arguments`);n.push(this.evaluate(i,t))}return[n,r]}applyFilter(e,t,n){if(t.type===`Identifier`){let r=t;if(r.value===`tojson`)return new qW(ZW(e,{}));if(e instanceof eG)switch(r.value){case`list`:return e;case`first`:return e.value[0];case`last`:return e.value[e.value.length-1];case`length`:return new GW(e.value.length);case`reverse`:return new eG(e.value.slice().reverse());case`sort`:return new eG(e.value.slice().sort((e,t)=>cG(e,t,!1)));case`join`:return new qW(e.value.map(e=>e.value).join(``));case`string`:return new qW(ZW(e,{},0,!1));case`unique`:{let t=new Set,n=[];for(let r of e.value)t.has(r.value)||(t.add(r.value),n.push(r));return new eG(n)}default:throw Error(`Unknown ArrayValue filter: ${r.value}`)}else if(e instanceof qW)switch(r.value){case`length`:case`upper`:case`lower`:case`title`:case`capitalize`:{let t=e.builtins.get(r.value);if(t instanceof nG)return t.value([],n);if(t instanceof GW)return t;throw Error(`Unknown StringValue filter: ${r.value}`)}case`trim`:return new qW(e.value.trim());case`indent`:return new qW(e.value.split(` +`).map((e,t)=>t===0||e.length===0?e:` `+e).join(` +`));case`join`:case`string`:return e;case`int`:{let t=parseInt(e.value,10);return new GW(isNaN(t)?0:t)}case`float`:{let t=parseFloat(e.value);return new KW(isNaN(t)?0:t)}default:throw Error(`Unknown StringValue filter: ${r.value}`)}else if(e instanceof GW||e instanceof KW)switch(r.value){case`abs`:return e instanceof GW?new GW(Math.abs(e.value)):new KW(Math.abs(e.value));case`int`:return new GW(Math.floor(e.value));case`float`:return new KW(e.value);default:throw Error(`Unknown NumericValue filter: ${r.value}`)}else if(e instanceof QW)switch(r.value){case`items`:return new eG(Array.from(e.value.entries()).map(([e,t])=>new eG([new qW(e),t])));case`length`:return new GW(e.value.size);default:{let t=e.builtins.get(r.value);if(t)return t instanceof nG?t.value([],n):t;throw Error(`Unknown ObjectValue filter: ${r.value}`)}}else if(e instanceof JW)switch(r.value){case`bool`:return new JW(e.value);case`int`:return new GW(e.value?1:0);case`float`:return new KW(e.value?1:0);case`string`:return new qW(e.value?`true`:`false`);default:throw Error(`Unknown BooleanValue filter: ${r.value}`)}throw Error(`Cannot apply filter "${r.value}" to type: ${e.type}`)}else if(t.type===`CallExpression`){let r=t;if(r.callee.type!==`Identifier`)throw Error(`Unknown filter: ${r.callee.type}`);let i=r.callee.value;if(i===`tojson`){let[,t]=this.evaluateArguments(r.args,n),i=t.get(`indent`)??new rG;if(!(i instanceof GW||i instanceof rG))throw Error(`If set, indent must be a number`);let a=t.get(`ensure_ascii`)??new JW(!1);if(!(a instanceof JW))throw Error(`If set, ensure_ascii must be a boolean`);let o=t.get(`sort_keys`)??new JW(!1);if(!(o instanceof JW))throw Error(`If set, sort_keys must be a boolean`);let s=t.get(`separators`)??new rG,c=null;if(s instanceof eG||s instanceof tG){if(s.value.length!==2)throw Error(`separators must be a tuple of two strings`);let[e,t]=s.value;if(!(e instanceof qW)||!(t instanceof qW))throw Error(`separators must be a tuple of two strings`);c=[e.value,t.value]}else if(!(s instanceof rG))throw Error(`If set, separators must be a tuple of two strings`);return new qW(ZW(e,{indent:i.value,ensureAscii:a.value,sortKeys:o.value,separators:c}))}else if(i===`join`){let t;if(e instanceof qW)t=Array.from(e.value);else if(e instanceof eG)t=e.value.map(e=>e.value);else throw Error(`Cannot apply filter "${i}" to type: ${e.type}`);let[a,o]=this.evaluateArguments(r.args,n),s=a.at(0)??o.get(`separator`)??new qW(``);if(!(s instanceof qW))throw Error(`separator must be a string`);return new qW(t.join(s.value))}else if(i===`int`||i===`float`){let[t,a]=this.evaluateArguments(r.args,n),o=t.at(0)??a.get(`default`)??(i===`int`?new GW(0):new KW(0));if(e instanceof qW){let t=i===`int`?parseInt(e.value,10):parseFloat(e.value);return isNaN(t)?o:i===`int`?new GW(t):new KW(t)}else if(e instanceof GW||e instanceof KW)return e;else if(e instanceof JW)return i===`int`?new GW(e.value?1:0):new KW(e.value?1:0);else throw Error(`Cannot apply filter "${i}" to type: ${e.type}`)}else if(i===`default`){let[t,i]=this.evaluateArguments(r.args,n),a=t[0]??new qW(``),o=t[1]??i.get(`boolean`)??new JW(!1);if(!(o instanceof JW))throw Error("`default` filter flag must be a boolean");return e instanceof iG||o.value&&!e.__bool__().value?a:e}if(e instanceof eG){switch(i){case`sort`:{let[t,i]=this.evaluateArguments(r.args,n),a=t.at(0)??i.get(`reverse`)??new JW(!1);if(!(a instanceof JW))throw Error(`reverse must be a boolean`);let o=t.at(1)??i.get(`case_sensitive`)??new JW(!1);if(!(o instanceof JW))throw Error(`case_sensitive must be a boolean`);let s=t.at(2)??i.get(`attribute`)??new rG;if(!(s instanceof qW||s instanceof GW||s instanceof rG))throw Error(`attribute must be a string, integer, or null`);let c=e=>s instanceof rG?e:sG(e,s instanceof GW?String(s.value):s.value);return new eG(e.value.slice().sort((e,t)=>{let n=cG(c(e),c(t),o.value);return a.value?-n:n}))}case`selectattr`:case`rejectattr`:{let t=i===`selectattr`;if(e.value.some(e=>!(e instanceof QW)))throw Error(`\`${i}\` can only be applied to array of objects`);if(r.args.some(e=>e.type!==`StringLiteral`))throw Error(`arguments of \`${i}\` must be strings`);let[a,o,s]=r.args.map(e=>this.evaluate(e,n)),c;if(o){let e=n.tests.get(o.value);if(!e)throw Error(`Unknown test: ${o.value}`);c=e}else c=(...e)=>e[0].__bool__().value;return new eG(e.value.filter(e=>{let n=e.value.get(a.value),r=n?c(n,s):!1;return t?r:!r}))}case`map`:{let[,t]=this.evaluateArguments(r.args,n);if(t.has(`attribute`)){let n=t.get(`attribute`);if(!(n instanceof qW))throw Error(`attribute must be a string`);let r=t.get(`default`);return new eG(e.value.map(e=>{if(!(e instanceof QW))throw Error(`items in map must be an object`);let t=sG(e,n.value);return t instanceof iG?r??new iG:t}))}else throw Error("`map` expressions without `attribute` set are not currently supported.")}}throw Error(`Unknown ArrayValue filter: ${i}`)}else if(e instanceof qW){switch(i){case`indent`:{let[t,i]=this.evaluateArguments(r.args,n),a=t.at(0)??i.get(`width`)??new GW(4);if(!(a instanceof GW))throw Error(`width must be a number`);let o=t.at(1)??i.get(`first`)??new JW(!1),s=t.at(2)??i.get(`blank`)??new JW(!1),c=e.value.split(` +`),l=` `.repeat(a.value);return new qW(c.map((e,t)=>!o.value&&t===0||!s.value&&e.length===0?e:l+e).join(` +`))}case`replace`:{let t=e.builtins.get(`replace`);if(!(t instanceof nG))throw Error(`replace filter not available`);let[i,a]=this.evaluateArguments(r.args,n);return t.value([...i,new $W(a)],n)}}throw Error(`Unknown StringValue filter: ${i}`)}else if(e instanceof QW){let t=e.builtins.get(i);if(t&&t instanceof nG){let[e,i]=this.evaluateArguments(r.args,n);return i.size>0&&e.push(new $W(i)),t.value(e,n)}throw Error(`Unknown ObjectValue filter: ${i}`)}else throw Error(`Cannot apply filter "${i}" to type: ${e.type}`)}throw Error(`Unknown filter: ${t.type}`)}evaluateFilterExpression(e,t){let n=this.evaluate(e.operand,t);return this.applyFilter(n,e.filter,t)}evaluateTestExpression(e,t){let n=this.evaluate(e.operand,t),r=t.tests.get(e.test.value);if(!r)throw Error(`Unknown test: ${e.test.value}`);let i=r(n);return new JW(e.negate?!i:i)}evaluateSelectExpression(e,t){return this.evaluate(e.test,t).__bool__().value?this.evaluate(e.lhs,t):new iG}evaluateUnaryExpression(e,t){let n=this.evaluate(e.argument,t);switch(e.operator.value){case`not`:return new JW(!n.value);default:throw SyntaxError(`Unknown operator: ${e.operator.value}`)}}evaluateTernaryExpression(e,t){return this.evaluate(e.condition,t).__bool__().value?this.evaluate(e.trueExpr,t):this.evaluate(e.falseExpr,t)}evalProgram(e,t){return this.evaluateBlock(e.body,t)}evaluateBlock(e,t){let n=``;for(let r of e){let e=this.evaluate(r,t);e.type!==`NullValue`&&e.type!==`UndefinedValue`&&(n+=e.toString())}return new qW(n)}evaluateIdentifier(e,t){return t.lookupVariable(e.value)}evaluateCallExpression(e,t){let[n,r]=this.evaluateArguments(e.args,t);r.size>0&&n.push(new $W(r));let i=this.evaluate(e.callee,t);if(i.type!==`FunctionValue`)throw Error(`Cannot call something that is not a function: got ${i.type}`);return i.value(n,t)}evaluateSliceExpression(e,t,n){if(!(e instanceof eG||e instanceof qW))throw Error(`Slice object must be an array or string`);let r=this.evaluate(t.start,n),i=this.evaluate(t.stop,n),a=this.evaluate(t.step,n);if(!(r instanceof GW||r instanceof iG))throw Error(`Slice start must be numeric or undefined`);if(!(i instanceof GW||i instanceof iG))throw Error(`Slice stop must be numeric or undefined`);if(!(a instanceof GW||a instanceof iG))throw Error(`Slice step must be numeric or undefined`);return e instanceof eG?new eG(IW(e.value,r.value,i.value,a.value)):new qW(IW(Array.from(e.value),r.value,i.value,a.value).join(``))}evaluateMemberExpression(e,t){let n=this.evaluate(e.object,t),r;if(e.computed){if(e.property.type===`SliceExpression`)return this.evaluateSliceExpression(n,e.property,t);r=this.evaluate(e.property,t)}else r=new qW(e.property.value);let i;if(n instanceof QW){if(!(r instanceof qW))throw Error(`Cannot access property with non-string: got ${r.type}`);i=n.value.get(r.value)??n.builtins.get(r.value)}else if(n instanceof eG||n instanceof qW)if(r instanceof GW)i=n.value.at(r.value),n instanceof qW&&(i=new qW(n.value.at(r.value)));else if(r instanceof qW)i=n.builtins.get(r.value);else throw Error(`Cannot access property with non-string/non-number: got ${r.type}`);else{if(!(r instanceof qW))throw Error(`Cannot access property with non-string: got ${r.type}`);i=n.builtins.get(r.value)}return i instanceof WW?i:new iG}evaluateSet(e,t){let n=e.value?this.evaluate(e.value,t):this.evaluateBlock(e.body,t);if(e.assignee.type===`Identifier`){let r=e.assignee.value;t.setVariable(r,n)}else if(e.assignee.type===`TupleLiteral`){let r=e.assignee;if(!(n instanceof eG))throw Error(`Cannot unpack non-iterable type in set: ${n.type}`);let i=n.value;if(i.length!==r.value.length)throw Error(`Too ${r.value.length>i.length?`few`:`many`} items to unpack in set`);for(let e=0;et.setVariable(e.loopvar.value,c);else if(e.loopvar.type===`TupleLiteral`){let t=e.loopvar;if(c.type!==`ArrayValue`)throw Error(`Cannot unpack non-iterable type: ${c.type}`);let n=c;if(t.value.length!==n.value.length)throw Error(`Too ${t.value.length>n.value.length?`few`:`many`} items to unpack`);l=e=>{for(let r=0;r0?a[t-1]:new iG],[`nextitem`,t{let r=new aG(n);t=t.slice();let i;t.at(-1)?.type===`KeywordArgumentsValue`&&(i=t.pop());for(let n=0;n{let r=new aG(n);if(e.callerArgs)for(let n=0;nthis.evaluate(e,t)));case`TupleLiteral`:return new tG(e.value.map(e=>this.evaluate(e,t)));case`ObjectLiteral`:{let n=new Map;for(let[r,i]of e.value){let e=this.evaluate(r,t);if(!(e instanceof qW))throw Error(`Object keys must be strings: got ${e.type}`);n.set(e.value,this.evaluate(i,t))}return new QW(n)}case`Identifier`:return this.evaluateIdentifier(e,t);case`CallExpression`:return this.evaluateCallExpression(e,t);case`MemberExpression`:return this.evaluateMemberExpression(e,t);case`UnaryExpression`:return this.evaluateUnaryExpression(e,t);case`BinaryExpression`:return this.evaluateBinaryExpression(e,t);case`FilterExpression`:return this.evaluateFilterExpression(e,t);case`FilterStatement`:return this.evaluateFilterStatement(e,t);case`TestExpression`:return this.evaluateTestExpression(e,t);case`SelectExpression`:return this.evaluateSelectExpression(e,t);case`Ternary`:return this.evaluateTernaryExpression(e,t);case`Comment`:return new rG;default:throw SyntaxError(`Unknown node type: ${e.type}`)}}};function uG(e){switch(typeof e){case`number`:return Number.isInteger(e)?new GW(e):new KW(e);case`string`:return new qW(e);case`boolean`:return new JW(e);case`undefined`:return new iG;case`object`:return e===null?new rG:Array.isArray(e)?new eG(e.map(uG)):new QW(new Map(Object.entries(e).map(([e,t])=>[e,uG(t)])));case`function`:return new nG((t,n)=>uG(e(...t.map(e=>e.value))??null));default:throw Error(`Cannot convert to runtime value: ${e}`)}}var dG=` +`,fG=`{%- `,pG=` -%}`;function mG(e){switch(e.operator.type){case`MultiplicativeBinaryOperator`:return 4;case`AdditiveBinaryOperator`:return 3;case`ComparisonBinaryOperator`:return 2;case`Identifier`:return e.operator.value===`and`?1:e.operator.value===`in`||e.operator.value===`not in`?2:0}return 0}function hG(e,t=` `){let n=typeof t==`number`?` `.repeat(t):t;return _G(e.body,0,n).replace(/\n$/,``)}function gG(...e){return fG+e.join(` `)+pG}function _G(e,t,n){return e.map(e=>vG(e,t,n)).join(dG)}function vG(e,t,n){let r=n.repeat(t);switch(e.type){case`Program`:return _G(e.body,t,n);case`If`:return yG(e,t,n);case`For`:return bG(e,t,n);case`Set`:return xG(e,t,n);case`Macro`:return SG(e,t,n);case`Break`:return r+gG(`break`);case`Continue`:return r+gG(`continue`);case`CallStatement`:return CG(e,t,n);case`FilterStatement`:return wG(e,t,n);case`Comment`:return r+`{# `+e.value+` #}`;default:return r+`{{- `+TG(e)+` -}}`}}function yG(e,t,n){let r=n.repeat(t),i=[],a=e;for(;a&&(i.push({test:a.test,body:a.body}),a.alternate.length===1&&a.alternate[0].type===`If`);)a=a.alternate[0];let o=r+gG(`if`,TG(i[0].test))+dG+_G(i[0].body,t+1,n);for(let e=1;e0&&(o+=dG+r+gG(`else`)+dG+_G(a.alternate,t+1,n)),o+=dG+r+gG(`endif`),o}function bG(e,t,n){let r=n.repeat(t),i=``;if(e.iterable.type===`SelectExpression`){let t=e.iterable;i=`${TG(t.lhs)} if ${TG(t.test)}`}else i=TG(e.iterable);let a=r+gG(`for`,TG(e.loopvar),`in`,i)+dG+_G(e.body,t+1,n);return e.defaultBlock.length>0&&(a+=dG+r+gG(`else`)+dG+_G(e.defaultBlock,t+1,n)),a+=dG+r+gG(`endfor`),a}function xG(e,t,n){let r=n.repeat(t),i=TG(e.assignee),a=e.value?TG(e.value):``,o=r+gG(`set`,`${i}${e.value?` = `+a:``}`);return e.body.length===0?o:o+dG+_G(e.body,t+1,n)+dG+r+gG(`endset`)}function SG(e,t,n){let r=n.repeat(t),i=e.args.map(TG).join(`, `);return r+gG(`macro`,`${e.name.value}(${i})`)+dG+_G(e.body,t+1,n)+dG+r+gG(`endmacro`)}function CG(e,t,n){let r=n.repeat(t),i=e.callerArgs&&e.callerArgs.length>0?`(${e.callerArgs.map(TG).join(`, `)})`:``,a=TG(e.call),o=r+gG(`call${i}`,a)+dG;return o+=_G(e.body,t+1,n)+dG,o+=r+gG(`endcall`),o}function wG(e,t,n){let r=n.repeat(t),i=r+gG(`filter`,e.filter.type===`Identifier`?e.filter.value:TG(e.filter))+dG;return i+=_G(e.body,t+1,n)+dG,i+=r+gG(`endfilter`),i}function TG(e,t=-1){switch(e.type){case`SpreadExpression`:return`*${TG(e.argument)}`;case`Identifier`:return e.value;case`IntegerLiteral`:return`${e.value}`;case`FloatLiteral`:return`${e.value}`;case`StringLiteral`:return JSON.stringify(e.value);case`BinaryExpression`:{let n=e,r=mG(n),i=TG(n.left,r),a=TG(n.right,r+1),o=`${i} ${n.operator.value} ${a}`;return r`${TG(e)}: ${TG(t)}`).join(`, `)}}`;case`SliceExpression`:{let t=e;return`${t.start?TG(t.start):``}:${t.stop?TG(t.stop):``}${t.step?`:${TG(t.step)}`:``}`}case`KeywordArgumentExpression`:{let t=e;return`${t.key.value}=${TG(t.value)}`}case`Ternary`:{let n=e,r=`${TG(n.trueExpr)} if ${TG(n.condition,0)} else ${TG(n.falseExpr)}`;return t>-1?`(${r})`:r}default:throw Error(`Unknown expression type: ${e.type}`)}}var EG=class{parsed;constructor(e){this.parsed=PW(nW(e,{lstrip_blocks:!0,trim_blocks:!0}))}render(e){let t=new aG;if(oG(t),e)for(let[n,r]of Object.entries(e))t.set(n,r);return new lG(t).run(this.parsed).value}format(e){return hG(this.parsed,e?.indent||` `)}},DG=class{constructor(){let e=function(...t){return e._call(...t)};return Object.setPrototypeOf(e,new.target.prototype)}_call(...e){throw Error(`Must implement _call method in subclass`)}};function OG(e,t){e&&e(t)}function kG(e){return Number.isInteger(e)||typeof e==`bigint`}function AG(e){return e==null||e===-1}function jG(e){let t=[],n=e;for(;Array.isArray(n);)t.push(n.length),n=n[0];return t}function MG(...e){return Array.prototype.concat.apply([],e)}function NG(...e){return e.reduce((e,t)=>e.flatMap(e=>t.map(t=>[e,t])))}function PG(e,t){return Math.abs((e+t)%(2*t)-t)}function FG(e,t){return Object.assign({},...t.map(t=>{if(e[t]!==void 0)return{[t]:e[t]}}))}function IG(e,t){let n=0;for(let r of e)r===t&&++n;return n}var LG={txt:`text/plain`,html:`text/html`,css:`text/css`,js:`text/javascript`,json:`application/json`,png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`},RG=class e{constructor(e){if(this.filePath=e,this.headers=new Headers,this.exists=KV.existsSync(e),this.exists){this.status=200,this.statusText=`OK`;let t=KV.statSync(e);this.headers.set(`content-length`,t.size.toString()),this.updateContentType();let n=KV.createReadStream(e);this.body=new ReadableStream({start(e){n.on(`data`,t=>e.enqueue(t)),n.on(`end`,()=>e.close()),n.on(`error`,t=>e.error(t))},cancel(){n.destroy()}})}else this.status=404,this.statusText=`Not Found`,this.body=null}updateContentType(){let e=this.filePath.toString().split(`.`).pop().toLowerCase();this.headers.set(`content-type`,LG[e]??`application/octet-stream`)}clone(){let t=new e(this.filePath);return t.exists=this.exists,t.status=this.status,t.statusText=this.statusText,t.headers=new Headers(this.headers),t}async arrayBuffer(){return(await KV.promises.readFile(this.filePath)).buffer}async blob(){let e=await KV.promises.readFile(this.filePath);return new Blob([e],{type:this.headers.get(`content-type`)})}async text(){return await KV.promises.readFile(this.filePath,`utf8`)}async json(){return JSON.parse(await this.text())}},zG=class{constructor(e){this.path=e}async match(e){let t=new RG(qV.join(this.path,e));if(t.exists)return t}async put(e,t,n=void 0){let r=qV.join(this.path,e);try{let e=t.headers.get(`Content-Length`),i=parseInt(e??`0`),a=0;await KV.promises.mkdir(qV.dirname(r),{recursive:!0});let o=KV.createWriteStream(r),s=t.body.getReader();for(;;){let{done:e,value:t}=await s.read();if(e)break;await new Promise((e,n)=>{o.write(t,t=>{if(t){n(t);return}e()})}),a+=t.length;let r=i?a/i*100:0;n?.({progress:r,loaded:a,total:i})}o.close()}catch(e){try{await KV.promises.unlink(r)}catch{}throw e}}},BG={400:`Bad request error occurred while trying to load file`,401:`Unauthorized access to file`,403:`Forbidden access to file`,404:`Could not locate file`,408:`Request timeout error occurred while trying to load file`,500:`Internal server error error occurred while trying to load file`,502:`Bad gateway error occurred while trying to load file`,503:`Service unavailable error occurred while trying to load file`,504:`Gateway timeout error occurred while trying to load file`},VG=100,HG=/^(\b[\w\-.]+\b\/)?\b[\w\-.]{1,96}\b$/;function UG(...e){return e=e.map((t,n)=>(n&&(t=t.replace(RegExp(`^/`),``)),n!==e.length-1&&(t=t.replace(RegExp(`/$`),``)),t)),e.join(`/`)}function WG(e,t=null,n=null){let r;try{r=new URL(e)}catch{return!1}return!(t&&!t.includes(r.protocol)||n&&!n.includes(r.hostname))}function GG(e){return!(!HG.test(e)||e.includes(`..`)||e.includes(`--`)||e.endsWith(`.git`)||e.endsWith(`.ipynb`))}function KG(e,t,n){if(!n)return null;let r=BG[e]??`Error (${e}) occurred while trying to load file`;throw Error(`${r}: "${t}".`)}async function qG(e,t){let n=e.headers.get(`Content-Length`);n===null&&console.warn(`Unable to determine content-length from response headers. Will expand buffer when needed.`);let r=parseInt(n??`0`),i=new Uint8Array(r),a=0,o=e.body.getReader();async function s(){let{done:e,value:n}=await o.read();if(e)return;let c=a+n.length;if(c>r){r=c;let e=new Uint8Array(r);e.set(i),i=e}return i.set(n,a),a=c,t({progress:a/r*100,loaded:a,total:r}),s()}return await s(),i}async function JG(e=null){let t=null;if(pH.useCustomCache){if(!pH.customCache)throw Error("`env.useCustomCache=true`, but `env.customCache` is not defined.");if(!pH.customCache.match||!pH.customCache.put)throw Error("`env.customCache` must be an object which implements the `match` and `put` functions of the Web Cache API. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache");t=pH.customCache}if(!t&&pH.useBrowserCache){if(typeof caches>`u`)throw Error(`Browser cache is not available in this environment.`);try{t=await caches.open(pH.cacheKey)}catch(e){console.warn(`An error occurred while opening the browser cache:`,e)}}if(!t&&pH.useFSCache){if(!sH.IS_FS_AVAILABLE)throw Error(`File System Cache is not available in this environment.`);t=new zG(e??pH.cacheDir)}return t}async function YG(e,...t){for(let n of t)try{let t=await e.match(n);if(t)return t}catch{continue}}async function XG(e){if(pH.useFS&&!WG(e,[`http:`,`https:`,`blob:`]))return new RG(e instanceof URL?e.protocol===`file:`?e.pathname:e.toString():e);if(typeof process<`u`&&process?.release?.name===`node`){let t=!!{}?.TESTING_REMOTELY,n=pH.version,r=new Headers;if(r.set(`User-Agent`,`transformers.js/${n}; is_ci/${t};`),WG(e,[`http:`,`https:`],[`huggingface.co`,`hf.co`])){let e={}?.HF_TOKEN??{}?.HF_ACCESS_TOKEN;e&&r.set(`Authorization`,`Bearer ${e}`)}return fetch(e,{headers:r})}else return fetch(e)}function ZG(e,t,n={},r=null){let i=n.revision??`main`,a=UG(e,t),o=GG(e),s=o?UG(pH.localModelPath,a):a,c=UG(pH.remoteHost,pH.remotePathTemplate.replaceAll(`{model}`,e).replaceAll(`{revision}`,encodeURIComponent(i)),t);return{requestURL:a,localPath:s,remoteURL:c,proposedCacheKey:r instanceof zG?i===`main`?a:UG(e,i,t):c,validModelId:o}}async function QG(e,t,n){if(e)return await YG(e,t,n)}async function $G(e,t,n,r,i,a,o={}){if(await n.match(r)===void 0)if(a)typeof i!=`string`&&await n.put(r,new Response(a,{headers:i.headers})).catch(e=>{console.warn(`Unable to add response to browser cache: ${e}.`)});else{let a=o.progress_callback?n=>OG(o.progress_callback,{status:`progress`,name:e,file:t,...n}):void 0;await n.put(r,i,a)}}async function eK(e,t,n=!0,r={},i=!1,a=null){let{requestURL:o,localPath:s,remoteURL:c,proposedCacheKey:l,validModelId:u}=ZG(e,t,r,a),d,f=!1,p;p=await QG(a,s,l);let m=p!==void 0;if(!m){if(pH.allowLocalModels){if(!WG(o,[`http:`,`https:`]))try{p=await XG(s),d=s}catch(e){console.warn(`Unable to load from local path "${s}": "${e}"`)}else if(r.local_files_only)throw Error(`\`local_files_only=true\`, but attempted to load a remote file from: ${o}.`);else if(!pH.allowRemoteModels)throw Error(`\`env.allowRemoteModels=false\`, but attempted to load a remote file from: ${o}.`)}if(p===void 0||typeof p!=`string`&&p.status===404){if(r.local_files_only||!pH.allowRemoteModels){if(n)throw Error(`\`local_files_only=true\` or \`env.allowRemoteModels=false\` and file was not found locally at "${s}".`);return null}if(!u)throw Error(`Local file missing at "${s}" and download aborted due to invalid model ID "${e}".`);if(p=await XG(c),p.status!==200)return KG(p.status,c,n);d=l}f=a&&typeof Response<`u`&&p instanceof Response&&p.status===200}OG(r.progress_callback,{status:`download`,name:e,file:t});let h;if(!(sH.IS_NODE_ENV&&i)){let n;typeof p!=`string`&&(r.progress_callback?m&&typeof navigator<`u`&&/firefox/i.test(navigator.userAgent)?(n=new Uint8Array(await p.arrayBuffer()),OG(r.progress_callback,{status:`progress`,name:e,file:t,progress:100,loaded:n.length,total:n.length})):n=await qG(p,n=>{OG(r.progress_callback,{status:`progress`,name:e,file:t,...n})}):n=new Uint8Array(await p.arrayBuffer())),h=n}if(f&&d&&typeof p!=`string`&&await $G(e,t,a,d,p,h,r),OG(r.progress_callback,{status:`done`,name:e,file:t}),h){if(!sH.IS_NODE_ENV&&i)throw Error(`Cannot return path in a browser environment.`);return h}if(p instanceof RG)return p.filePath;let g=await a?.match(d);if(g instanceof RG)return g.filePath;if(g instanceof Response)return new Uint8Array(await g.arrayBuffer());if(typeof g==`string`)return g;throw Error(`Unable to get model file path or buffer.`)}async function tK(e,t,n=!0,r={},i=!1){if(!pH.allowLocalModels){if(r.local_files_only)throw Error("Invalid configuration detected: local models are disabled (`env.allowLocalModels=false`) but you have requested to only use local models (`local_files_only=true`).");if(!pH.allowRemoteModels)throw Error("Invalid configuration detected: both local and remote models are disabled. Fix by setting `env.allowLocalModels` or `env.allowRemoteModels` to `true`.")}return OG(r.progress_callback,{status:`initiate`,name:e,file:t}),await eK(e,t,n,r,i,await JG(r?.cache_dir))}async function nK(e,t,n=!0,r={}){let i=await tK(e,t,n,r,!1);return i===null?null:new TextDecoder(`utf-8`).decode(i)}async function rK(e,t,n=!0,r={}){let i=await nK(e,t,n,r);return i===null?{}:JSON.parse(i)}function iK(e,[t,n,r],[i,a],o=`bilinear`,s=!1){let c=a/r,l=i/n,u=new e.constructor(i*a*t),d=n*r,f=i*a;for(let o=0;o=0;--e)i[e]=a,r[e]=t[n[e]],a*=r[e];let a=n.map((e,t)=>i[n.indexOf(t)]),o=new e.constructor(e.length);for(let n=0;n=0;--e)r+=i%t[e]*a[e],i=Math.floor(i/t[e]);o[r]=e[n]}return[o,r]}function oK(e){let t=lK(e)[0],n=e.map(e=>Math.exp(e-t)),r=n.reduce((e,t)=>e+t,0);return n.map(e=>e/r)}function sK(e){let t=lK(e)[0],n=0;for(let r=0;re-t-r)}function cK(e){if(e.length===0)throw Error(`Array must not be empty`);let t=e[0],n=0;for(let r=1;rt&&(t=e[r],n=r);return[t,n]}function uK(e){return e>0&&(e&e-1)==0}var dK=class{constructor(e){if(this.size=e|0,this.size<=1||!uK(this.size))throw Error(`FFT size must be a power of two larger than 1`);this._csize=e<<1,this.table=new Float64Array(this.size*2);for(let e=0;ee;e<<=1)++t;this._width=t%2==0?t-1:t,this._bitrev=new Int32Array(1<>>t&3)<>>1);for(let t=0;t>>1]=e[t];return n}toComplexArray(e,t){let n=t||this.createComplexArray();for(let t=0;t>>1],n[t+1]=0;return n}transform(e,t){if(e===t)throw Error(`Input and output buffers must be different`);this._transform4(e,t,1)}realTransform(e,t){if(e===t)throw Error(`Input and output buffers must be different`);this._realTransform4(e,t,1)}inverseTransform(e,t){if(e===t)throw Error(`Input and output buffers must be different`);this._transform4(e,t,-1);for(let t=0;t>=2;i>=2;i>>=2){a=r/i<<1;let t=a>>>2;for(o=0;o>>1,i>>>1)}else for(o=0,s=0;o>>1,i>>>1,n)}let l=this.table;for(i>>=2;i>=2;i>>=2){a=r/i<<1;let t=a>>>1,s=t>>>1,c=s>>>1;for(o=0;o>>1;for(let t=2;t>1;++t){let n=(t+1-e)**2/2,r=Math.sqrt(s**2+c**2)**n,o=n*Math.atan2(c,s),l=2*t;i[l]=r*Math.cos(o),i[l+1]=r*Math.sin(o),a[l]=i[l],a[l+1]=-i[l+1]}this._slicedChirpBuffer=i.subarray(t,n),this._f=new dK(r>>1),this._f.transform(this._chirpBuffer,a)}_transform(e,t,n){let r=this._buffer1,i=this._buffer2,a=this._outBuffer1,o=this._outBuffer2,s=this._chirpBuffer,c=this._slicedChirpBuffer,l=this._a;if(n)for(let e=0;e>1];r[e]=i*c[e],r[n]=i*c[n]}else for(let e=0;e=e.length&&(i=2*(e.length-1)-i),r[a++]=e[i]}r.sort(),n[t]=r[i]}return n}function hK(e,t){let n=10**t;return Math.round(e*n)/n}function gK(e){let t=Math.round(e);return Math.abs(e)%1==.5?t%2==0?t:t-1:t}function _K(e){let t=e.length,n=e[0].length,r=[t+1,n+1],i=Array.from({length:r[0]},()=>Array(r[1]).fill(1/0));i[0][0]=0;let a=Array.from({length:r[0]},()=>Array(r[1]).fill(-1));for(let t=1;t0||s>0;)switch(c.push(o-1),l.push(s-1),a[o][s]){case 0:--o,--s;break;case 1:--o;break;case 2:--s;break;default:throw Error(`Internal error in dynamic time warping. Unexpected trace[${o}, ${s}]. Please file a bug report.`)}return c.reverse(),l.reverse(),[c,l]}var vK=(function(){let e=null;return function(t){if(!e){e=new Float32Array(65536);let t=new ArrayBuffer(4),n=new Uint32Array(t),r=new Float32Array(t);for(let t=0;t>10,s=t&1023;if(o===31)i=a|2139095040|s<<13;else if(o===0)if(s===0)i=a;else{let e=113;for(;!(s&1024);)s<<=1,--e;s&=-1025,i=a|e<<23|s<<13}else i=a|o+112<<23|s<<13;n[0]=i,e[t]=r[0]}}let n=t.length,r=e,i=new Float32Array(n);for(let e=0;eSK,createReadStream:()=>TK,createWriteStream:()=>wK,default:()=>xK,pipeline:()=>CK});var bK=()=>{},xK={},SK={fromWeb:bK},CK=bK,wK=bK,TK=bK;async function EK(e){let t=e.split(`/`).pop(),n;try{if(n=await JG(),n){let t=await n.match(e);if(t)return t}}catch(e){console.warn(`Failed to load ${t} from cache:`,e)}let r=await fetch(e);if(!r.ok)throw Error(`Failed to fetch ${t}: ${r.status} ${r.statusText}`);if(n)try{await n.put(e,r.clone())}catch(e){console.warn(`Failed to cache ${t}:`,e)}return r}async function DK(e){let t=await EK(e);if(!t||typeof t==`string`)return null;try{return await t.arrayBuffer()}catch(e){return console.warn(`Failed to read WASM binary:`,e),null}}async function OK(e){let t=await EK(e);if(!t||typeof t==`string`)return null;try{let n=await t.text(),r=e.split(`/`).slice(0,-1).join(`/`);n=n.replace(/import\.meta\.url/g,`"${r}"`);let i=new Blob([n],{type:`text/javascript`});return URL.createObjectURL(i)}catch(e){return console.warn(`Failed to read WASM binary:`,e),null}}function kK(e){return WG(e,[`blob:`])}function AK(e){let t;if(typeof location<`u`&&location.href)t=location.href;else if(import.meta.url)t=import.meta.url;else return e;return new URL(e,t).href}var jK=Object.freeze({auto:null,gpu:null,cpu:`cpu`,wasm:`wasm`,webgpu:`webgpu`,cuda:`cuda`,dml:`dml`,coreml:`coreml`,webnn:{name:`webnn`,deviceType:`cpu`},"webnn-npu":{name:`webnn`,deviceType:`npu`},"webnn-gpu":{name:`webnn`,deviceType:`gpu`},"webnn-cpu":{name:`webnn`,deviceType:`cpu`}}),MK=[`verbose`,`info`,`warning`,`error`,`fatal`],NK=4,PK=[],FK,IK,LK=Symbol.for(`onnxruntime`);if(LK in globalThis)IK=globalThis[LK];else if(sH.IS_NODE_ENV){switch(IK=yK,process.platform){case`win32`:PK.push(`dml`);break;case`linux`:process.arch===`x64`&&PK.push(`cuda`);break;case`darwin`:PK.push(`coreml`);break}PK.push(`webgpu`),PK.push(`cpu`),FK=[`cpu`]}else IK=JL,sH.IS_WEBNN_AVAILABLE&&PK.push(`webnn-npu`,`webnn-gpu`,`webnn-cpu`,`webnn`),sH.IS_WEBGPU_AVAILABLE&&PK.push(`webgpu`),PK.push(`wasm`),FK=[`wasm`];var RK=IK.InferenceSession;function zK(e=null){if(!e)return FK;switch(e){case`auto`:return PK;case`gpu`:return PK.filter(e=>[`webgpu`,`cuda`,`dml`,`webnn-gpu`].includes(e))}if(PK.includes(e))return[jK[e]??e];throw Error(`Unsupported device: "${e}". Should be one of: ${PK.join(`, `)}.`)}var BK=sH.IS_BROWSER_ENV||sH.IS_WEBWORKER_ENV,VK=Promise.resolve(),HK=null;async function UK(){return HK||(pH.useWasmCache&&typeof JK?.wasm?.wasmPaths==`object`&&JK?.wasm?.wasmPaths?.wasm&&JK?.wasm?.wasmPaths?.mjs?(HK=(async()=>{let e=JK.wasm.wasmPaths;await Promise.all([e.wasm&&!kK(e.wasm)?(async()=>{try{let t=await DK(AK(e.wasm));t&&(JK.wasm.wasmBinary=t)}catch(e){console.warn(`Failed to pre-load WASM binary:`,e)}})():Promise.resolve(),e.mjs&&!kK(e.mjs)?(async()=>{try{let t=await OK(AK(e.mjs));t&&(JK.wasm.wasmPaths.mjs=t)}catch(e){console.warn(`Failed to pre-load WASM factory:`,e)}})():Promise.resolve()])})(),HK):(HK=Promise.resolve(),HK))}async function WK(e,t,n){await UK();let r=()=>RK.create(e,{logSeverityLevel:NK,...t}),i=await(BK?VK=VK.then(r):r());return i.config=n,i}var GK=Promise.resolve();async function KK(e,t){let n=()=>e.run(t);return await(BK?GK=GK.then(n):n())}function qK(e){return e instanceof IK.Tensor}var JK=IK?.env;if(JK.logLevel=MK[NK],JK?.wasm){if(!(typeof ServiceWorkerGlobalScope<`u`&&self instanceof ServiceWorkerGlobalScope)&&JK.versions?.web&&!JK.wasm.wasmPaths){let e=`https://cdn.jsdelivr.net/npm/onnxruntime-web@${JK.versions.web}/dist/`;JK.wasm.wasmPaths=sH.IS_SAFARI?{mjs:`${e}ort-wasm-simd-threaded.mjs`,wasm:`${e}ort-wasm-simd-threaded.wasm`}:{mjs:`${e}ort-wasm-simd-threaded.asyncify.mjs`,wasm:`${e}ort-wasm-simd-threaded.asyncify.wasm`}}JK.wasm.proxy=!1}JK?.webgpu&&(JK.webgpu.powerPreference=`high-performance`);function YK(){return JK?.wasm?.proxy}pH.backends.onnx=JK;var XK=async(e,t,n)=>{let r=await WK(new Uint8Array(e),t);return(async e=>{let t=YK(),i=await KK(r,Object.fromEntries(Object.entries(e).map(([e,n])=>[e,(t?n.clone():n).ort_tensor])));return Array.isArray(n)?n.map(e=>new iq(i[e])):new iq(i[n])})},ZK=class{static session_options={};static get nearest_interpolate_4d(){return this._nearest_interpolate_4d||=XK([8,10,18,0,58,129,1,10,41,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,18,10,4,109,111,100,101,34,7,110,101,97,114,101,115,116,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,21],this.session_options,`y`),this._nearest_interpolate_4d}static get bilinear_interpolate_4d(){return this._bilinear_interpolate_4d||=XK([8,9,18,0,58,128,1,10,40,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,17,10,4,109,111,100,101,34,6,108,105,110,101,97,114,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,20],this.session_options,`y`),this._bilinear_interpolate_4d}static get bicubic_interpolate_4d(){return this._bicubic_interpolate_4d||=XK([8,9,18,0,58,127,10,39,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,16,10,4,109,111,100,101,34,5,99,117,98,105,99,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,20],this.session_options,`y`),this._bicubic_interpolate_4d}static get matmul(){return this._matmul||=XK([8,9,18,0,58,55,10,17,10,1,97,10,1,98,18,1,99,34,6,77,97,116,77,117,108,18,1,114,90,9,10,1,97,18,4,10,2,8,1,90,9,10,1,98,18,4,10,2,8,1,98,9,10,1,99,18,4,10,2,8,1,66,2,16,20],this.session_options,`c`),this._matmul}static get stft(){return this._stft||=XK([8,7,18,0,58,148,1,10,38,10,1,115,10,1,106,10,1,119,10,1,108,18,1,111,34,4,83,84,70,84,42,15,10,8,111,110,101,115,105,100,101,100,24,1,160,1,2,18,1,115,90,26,10,1,115,18,21,10,19,8,1,18,15,10,3,18,1,98,10,3,18,1,115,10,3,18,1,99,90,11,10,1,106,18,6,10,4,8,7,18,0,90,16,10,1,119,18,11,10,9,8,1,18,5,10,3,18,1,119,90,11,10,1,108,18,6,10,4,8,7,18,0,98,31,10,1,111,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,102,10,3,18,1,100,10,3,18,1,99,66,2,16,17],this.session_options,`o`),this._stft}static get rfft(){return this._rfft||=XK([8,9,18,0,58,97,10,33,10,1,120,10,0,10,1,97,18,1,121,34,3,68,70,84,42,15,10,8,111,110,101,115,105,100,101,100,24,1,160,1,2,18,1,100,90,21,10,1,120,18,16,10,14,8,1,18,10,10,3,18,1,115,10,3,18,1,99,90,11,10,1,97,18,6,10,4,8,7,18,0,98,21,10,1,121,18,16,10,14,8,1,18,10,10,3,18,1,115,10,3,18,1,99,66,2,16,20],this.session_options,`y`),this._rfft}static get top_k(){return this._top_k||=XK([8,10,18,0,58,73,10,18,10,1,120,10,1,107,18,1,118,18,1,105,34,4,84,111,112,75,18,1,116,90,9,10,1,120,18,4,10,2,8,1,90,15,10,1,107,18,10,10,8,8,7,18,4,10,2,8,1,98,9,10,1,118,18,4,10,2,8,1,98,9,10,1,105,18,4,10,2,8,7,66,2,16,21],this.session_options,[`v`,`i`]),this._top_k}static get slice(){return this._slice||=XK([8,7,18,0,58,96,10,25,10,1,120,10,1,115,10,1,101,10,1,97,10,1,116,18,1,121,34,5,83,108,105,99,101,18,1,114,90,9,10,1,120,18,4,10,2,8,1,90,9,10,1,115,18,4,10,2,8,7,90,9,10,1,101,18,4,10,2,8,7,90,9,10,1,97,18,4,10,2,8,7,90,9,10,1,116,18,4,10,2,8,7,98,9,10,1,121,18,4,10,2,8,1,66,2,16,13],this.session_options,`y`),this._slice}},QK=Object.freeze({auto:`auto`,gpu:`gpu`,cpu:`cpu`,wasm:`wasm`,webgpu:`webgpu`,cuda:`cuda`,dml:`dml`,coreml:`coreml`,webnn:`webnn`,"webnn-npu":`webnn-npu`,"webnn-gpu":`webnn-gpu`,"webnn-cpu":`webnn-cpu`}),$K=(function(){let e;return async function(){if(e===void 0)if(!sH.IS_WEBGPU_AVAILABLE)e=!1;else try{e=(await navigator.gpu.requestAdapter()).features.has(`shader-f16`)}catch{e=!1}return e}})(),eq=Object.freeze({auto:`auto`,fp32:`fp32`,fp16:`fp16`,q8:`q8`,int8:`int8`,uint8:`uint8`,q4:`q4`,bnb4:`bnb4`,q4f16:`q4f16`}),tq=Object.freeze({[QK.wasm]:eq.q8}),nq=Object.freeze({[eq.fp32]:``,[eq.fp16]:`_fp16`,[eq.int8]:`_int8`,[eq.uint8]:`_uint8`,[eq.q8]:`_quantized`,[eq.q4]:`_q4`,[eq.q4f16]:`_q4f16`,[eq.bnb4]:`_bnb4`}),rq=Object.freeze({float32:Float32Array,float16:typeof Float16Array<`u`?Float16Array:Uint16Array,float64:Float64Array,string:Array,int8:Int8Array,uint8:Uint8Array,int16:Int16Array,uint16:Uint16Array,int32:Int32Array,uint32:Uint32Array,int64:BigInt64Array,uint64:BigUint64Array,bool:Uint8Array,uint4:Uint8Array,int4:Int8Array}),iq=class e{get dims(){return this.ort_tensor.dims}set dims(e){this.ort_tensor.dims=e}get type(){return this.ort_tensor.type}get data(){return this.ort_tensor.data}get size(){return this.ort_tensor.size}get location(){return this.ort_tensor.location}ort_tensor;constructor(...e){return qK(e[0])?this.ort_tensor=e[0]:this.ort_tensor=new UV(e[0],e[1],e[2]),new Proxy(this,{get:(e,t)=>{if(typeof t==`string`){let n=Number(t);if(Number.isInteger(n))return e._getitem(n)}return e[t]},set:(e,t,n)=>e[t]=n})}dispose(){this.ort_tensor.dispose()}*[Symbol.iterator](){let[e,...t]=this.dims;if(t.length>0){let n=t.reduce((e,t)=>e*t);for(let r=0;r0){let e=r.reduce((e,t)=>e*t);return this._subarray(t,e,r)}else return new e(this.type,[this.data[t]],r)}indexOf(e){let t=this.data;for(let n=0;na)throw Error(`Invalid slice: ${i}`);let o=[Math.max(t,0),Math.min(a,this.dims[e])];r.push(o),n.push(o[1]-o[0])}else throw Error(`Invalid slice: ${i}`)}let i=r.map(([e,t])=>t-e),a=i.reduce((e,t)=>e*t),o=this.data,s=new o.constructor(a),c=this.stride(),l=!0;for(let e=1;e=0;--n){let e=i[n];t+=(a%e+r[n][0])*c[n],a=Math.floor(a/e)}s[e]=o[t]}return new e(this.type,s,n)}permute(...e){return oq(this,e)}transpose(...e){return this.permute(...e)}sum(e=null,t=!1){return this.norm(1,e,t)}norm(t=`fro`,n=null,r=!1){if(t===`fro`)t=2;else if(typeof t==`string`)throw Error(`Unsupported norm: ${t}`);let i=this.data,a=(e,n)=>e+n**t;if(n===null){let n=i.reduce(a,0)**(1/t);return new e(this.type,[n],[])}let[o,s,c]=yq(a,this,n,r);if(t!==1)for(let e=0;e=0;--r){let e=this.dims[r];if(r!==t){let t=i%e;n+=t*a,a*=this.dims[r]}i=Math.floor(i/e)}r[e]/=i[n]}return this}normalize(e=2,t=1){return this.clone().normalize_(e,t)}stride(){return Sq(this.dims)}squeeze(t=null){return new e(this.type,this.data,mq(this.dims,t))}squeeze_(e=null){return this.dims=mq(this.dims,e),this}unsqueeze(t){return new e(this.type,this.data,hq(this.dims,t))}unsqueeze_(e){return this.dims=hq(this.dims,e),this}flatten_(e=0,t=-1){t=(t+this.dims.length)%this.dims.length;let n=this.dims.slice(0,e),r=this.dims.slice(e,t+1),i=this.dims.slice(t+1);return this.dims=[...n,r.reduce((e,t)=>e*t,1),...i],this}flatten(e=0,t=-1){return this.clone().flatten_(e,t)}view(...t){let n=-1;for(let e=0;er===n?e:e*t,1);t[n]=r.length/e}return new e(this.type,r,t)}neg_(){let e=this.data;for(let t=0;tt?1:0;return new e(`bool`,n,this.dims)}lt(t){let n=new Uint8Array(this.data.length),r=this.data;for(let e=0;eMath.min(e,t),this,t,n,1/0);return new e(r,i,a)}max(t=null,n=!1){if(t===null){let t=lK(this.data)[0];return new e(this.type,[t],[])}let[r,i,a]=yq((e,t)=>Math.max(e,t),this,t,n,-1/0);return new e(r,i,a)}argmin(t=null,n=!1){if(t!==null)throw Error("`dim !== null` not yet implemented.");let r=cK(this.data)[1];return new e(`int64`,[BigInt(r)],[])}argmax(t=null,n=!1){if(t!==null)throw Error("`dim !== null` not yet implemented.");let r=lK(this.data)[1];return new e(`int64`,[BigInt(r)],[])}repeat(...t){if(t.lengthe===1)){if(t.length===this.dims.length)return this.clone();let n=t.length-this.dims.length,r=Array(n).fill(1).concat(this.dims);return new e(this.type,this.data.slice(),r)}let n=t.length-this.dims.length,r=Array(n).fill(1).concat(this.dims),i=r.map((e,n)=>e*t[n]),a=i.reduce((e,t)=>e*t,1),o=this.data,s=new o.constructor(a),c=Sq(r),l=Sq(i);for(let e=0;eBigInt(Math.floor(e)):BigInt;else if(this.type===`float16`&&t==`float32`&&this.data instanceof Uint16Array)return new e(t,vK(this.data),this.dims);return new e(t,rq[t].from(this.data,n),this.dims)}};function aq(e,t){let n=e.length;if(n!==t.reduce((e,t)=>e*t))throw Error(`cannot reshape array of size ${n} into shape (${t})`);let r=e;for(let e=t.length-1;e>=0;e--)r=r.reduce((n,r)=>{let i=n[n.length-1];return i.lengthnew iq(`int64`,e,[e.length]);async function fq(e,t,n,r,i){return await(await ZK.slice)({x:e,s:dq(t),e:dq(n),a:dq(r),t:dq(i??Array(r.length).fill(1))})}function pq(e,t){let n=e.data,r=t.data,i=[e.dims[0],e.dims[2]],a=new n.constructor(i[0]*i[1]),[o,s,c]=e.dims,l=0;for(let e=0;ee!==1):typeof t==`number`?e[t]===1&&e.splice(t,1):Array.isArray(t)&&(e=e.filter((e,n)=>e!==1||!t.includes(n))),e}function hq(e,t){return t=gq(t,e.length+1),e=e.slice(),e.splice(t,0,1),e}function gq(e,t,n=null,r=!0){if(e<-t||e>=t){if(r)throw Error(`IndexError: index ${e} is out of bounds for dimension${n===null?``:` `+n} with size ${t}`);return e<-t?0:t}return e<0&&(e=(e%t+t)%t),e}function _q(e,t=0){t=gq(t,e[0].dims.length);let n=e[0].dims.slice();n[t]=e.reduce((e,n)=>e+n.dims[t],0);let r=n.reduce((e,t)=>e*t,1),i=new e[0].data.constructor(r),a=e[0].type;if(t===0){let t=0;for(let n of e){let e=n.data;i.set(e,t),t+=e.length}}else{let r=0;for(let a=0;a=0;--i){let e=s[i],l=o%e;i===t&&(l+=r),a+=l*c,c*=n[i],o=Math.floor(o/e)}i[a]=o[e]}r+=s[t]}}return new iq(a,i,n)}function vq(e,t=0){return _q(e.map(e=>e.unsqueeze(t)),t)}function yq(e,t,n,r=!1,i=null){let a=t.data,o=t.dims;n=gq(n,o.length);let s=o.slice();s[n]=1;let c=new a.constructor(a.length/o[n]);i!==null&&c.fill(i);for(let t=0;t=0;--e){let t=o[e];if(e!==n){let n=i%t;r+=n*a,a*=s[e]}i=Math.floor(i/t)}c[r]=e(c[r],a[t],t,r)}return r||s.splice(n,1),[t.type,c,s]}function bq(e,t=null,n=1,r=!1){let i=e.data,a=e.dims;if(t===null){let t=i.reduce((e,t)=>e+t,0)/i.length,r=Math.sqrt(i.reduce((e,n)=>e+(n-t)**2,0)/(i.length-n)),a=new iq(e.type,[t],[]);return[new iq(e.type,[r],[]),a]}t=gq(t,a.length);let o=xq(e,t,r),s=o.data,[c,l,u]=yq((e,t,n,r)=>e+(t-s[r])**2,e,t,r);for(let e=0;ee+t,0);return new iq(e.type,[t/i.length],[])}t=gq(t,r.length);let[a,o,s]=yq((e,t)=>e+t,e,t,n);if(r[t]!==1)for(let e=0;e=0;--n)t[n]=r,r*=e[n];return t}function Cq(e,t,n,r){return new iq(n,new r(e.reduce((e,t)=>e*t,1)).fill(t),e)}function wq(e,t){let n,r;if(typeof t==`number`)n=`float32`,r=Float32Array;else if(typeof t==`bigint`)n=`int64`,r=BigInt64Array;else if(typeof t==`boolean`)n=`bool`,r=Uint8Array;else throw Error(`Unsupported data type: ${typeof t}`);return Cq(e,t,n,r)}function Tq(e,t){return wq(e.dims,t)}function Eq(e){return Cq(e,1n,`int64`,BigInt64Array)}function Dq(e){return Eq(e.dims)}function Oq(e){return Cq(e,0n,`int64`,BigInt64Array)}function kq(e){return Oq(e.dims)}function Aq(e){let t=e.reduce((e,t)=>e*t,1),n=new Float32Array(t);for(let e=0;e0?1:0,r=Math.floor(e/8),i=e%8;o[r]|=t<<7-i,n&&i===0&&(o[r]-=128)}return new iq(r,o,[e.dims[0],e.dims[1]/8])}async function Mq(e,t){return await Promise.all([rK(e,`tokenizer.json`,!0,t),rK(e,`tokenizer_config.json`,!0,t)])}function Nq(e){let t=e.dims;switch(t.length){case 1:return e.tolist();case 2:if(t[0]!==1)throw Error("Unable to decode tensor with `batch size !== 1`. Use `tokenizer.batch_decode(...)` for batched inputs.");return e.tolist()[0];default:throw Error(`Expected tensor to have 1-2 dimensions, got ${t.length}.`)}}var Pq=[`bos_token`,`eos_token`,`unk_token`,`sep_token`,`pad_token`,`cls_token`,`mask_token`];function Fq(e,t,n,r){for(let i of Object.keys(e)){let a=t-e[i].length,o=n(i),s=Array(a).fill(o);e[i]=r===`right`?MG(e[i],s):MG(s,e[i])}}function Iq(e,t){for(let n of Object.keys(e))e[n].length=t}function Lq(e,...t){for(let n of t){if(!Object.hasOwn(e,n))continue;let t=e[n];if(t)if(typeof t==`object`){if(t.__type===`AddedToken`)return t.content;throw Error(`Unknown token: ${t}`)}else return t}return null}function Rq(e){let t=[];for(let n of e.get_added_tokens_decoder().values())n.special&&t.push(n);return t}var zq=class extends DG{return_token_type_ids=!1;padding_side=`right`;constructor(e,t){if(super(),this._tokenizerJSON=e,this._tokenizerConfig=t,this._tokenizer=new JU(e,t),this.config=t,this.padding_side=t.padding_side??this.padding_side,this.mask_token=Lq(t,`mask_token`),this.mask_token_id=this._tokenizer.token_to_id(this.mask_token),this.pad_token=Lq(t,`pad_token`,`eos_token`),this.pad_token_id=this._tokenizer.token_to_id(this.pad_token),this.sep_token=Lq(t,`sep_token`),this.sep_token_id=this._tokenizer.token_to_id(this.sep_token),this.unk_token=Lq(t,`unk_token`),this.unk_token_id=this._tokenizer.token_to_id(this.unk_token),this.bos_token=Lq(t,`bos_token`),this.bos_token_id=this._tokenizer.token_to_id(this.bos_token),this.eos_token=Lq(t,`eos_token`),this.eos_token_id=this._tokenizer.token_to_id(this.eos_token),this.chat_template=t.chat_template??null,Array.isArray(this.chat_template)){let e=Object.create(null);for(let{name:t,template:n}of this.chat_template){if(typeof t!=`string`||typeof n!=`string`)throw Error(`Chat template must be a list of objects with "name" and "template" properties`);e[t]=n}this.chat_template=e}this._compiled_template_cache=new Map;let n=Rq(this._tokenizer);this.all_special_ids=n.map(e=>e.id),this.all_special_tokens=n.map(e=>e.content)}static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`}={}){let o=await Mq(e,{progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a});return new this(...o)}get_vocab(){return this._tokenizer.get_vocab()}get model_max_length(){return this._tokenizerConfig.model_max_length??1/0}get add_eos_token(){return this._tokenizerConfig.add_eos_token}get add_bos_token(){return this._tokenizerConfig.add_bos_token}convert_tokens_to_ids(e){return typeof e==`string`?this._tokenizer.token_to_id(e):e.map(e=>this._tokenizer.token_to_id(e))}_call(e,{text_pair:t=null,add_special_tokens:n=!0,padding:r=!1,truncation:i=null,max_length:a=null,return_tensor:o=!0,return_token_type_ids:s=null}={}){let c=Array.isArray(e),l;if(c){if(e.length===0)throw Error(`text array must be non-empty`);if(t!==null){if(!Array.isArray(t))throw Error(`text_pair must also be an array`);if(e.length!==t.length)throw Error(`text and text_pair must have the same length`);l=e.map((e,r)=>this._encode_plus(e,{text_pair:t[r],add_special_tokens:n,return_token_type_ids:s}))}else l=e.map(e=>this._encode_plus(e,{add_special_tokens:n,return_token_type_ids:s}))}else{if(e==null)throw Error(`text may not be null or undefined`);if(Array.isArray(t))throw Error("When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).");l=[this._encode_plus(e,{text_pair:t,add_special_tokens:n,return_token_type_ids:s})]}if(a===null?a=this.model_max_length:i===null&&(r===!0?(console.warn("`max_length` is ignored when `padding: true` and there is no truncation strategy. To pad to max length, use `padding: 'max_length'`."),a=this.model_max_length):r===!1&&(console.warn("Truncation was not explicitly activated but `max_length` is provided a specific value, please use `truncation: true` to explicitly truncate examples to max length."),i=!0)),r===!0&&(a=Math.min(lK(l.map(e=>e.input_ids.length))[0],a??1/0)),a=Math.min(a,this.model_max_length??1/0),r||i)for(let e=0;ea?i&&Iq(l[e],a):r&&Fq(l[e],a,e=>e===`input_ids`?this.pad_token_id:0,this.padding_side);let u={};if(o){if(!(r&&i)&&l.some(e=>{for(let t of Object.keys(e))if(e[t].length!==l[0][t]?.length)return!0;return!1}))throw Error(`Unable to create tensor, you should probably activate truncation and/or padding with 'padding=true' and 'truncation=true' to have batched tensors with the same length.`);let e=[l.length,l[0].input_ids.length];for(let t of Object.keys(l[0]))u[t]=new iq(`int64`,BigInt64Array.from(l.flatMap(e=>e[t]).map(BigInt)),e)}else{for(let e of Object.keys(l[0]))u[e]=l.map(t=>t[e]);if(!c)for(let e of Object.keys(u))u[e]=u[e][0]}return u}_encode_text(e){return e===null?null:this._tokenizer.encode(e).tokens}_encode_plus(e,{text_pair:t=null,add_special_tokens:n=!0,return_token_type_ids:r=null}={}){let{ids:i,attention_mask:a,token_type_ids:o}=this._tokenizer.encode(e,{text_pair:t,add_special_tokens:n,return_token_type_ids:r??this.return_token_type_ids});return{input_ids:i,attention_mask:a,...o?{token_type_ids:o}:{}}}tokenize(e,{pair:t=null,add_special_tokens:n=!1}={}){return this._tokenizer.tokenize(e,{text_pair:t,add_special_tokens:n})}encode(e,{text_pair:t=null,add_special_tokens:n=!0,return_token_type_ids:r=null}={}){return this._tokenizer.encode(e,{text_pair:t,add_special_tokens:n,return_token_type_ids:r}).ids}batch_decode(e,t={}){return e instanceof iq&&(e=e.tolist()),e.map(e=>this.decode(e,t))}decode(e,t={}){if(e instanceof iq&&(e=Nq(e)),!Array.isArray(e)||e.length===0||!kG(e[0]))throw Error(`token_ids must be a non-empty array of integers.`);return this.decode_single(e,t)}decode_single(e,{skip_special_tokens:t=!1,clean_up_tokenization_spaces:n=null}){return this._tokenizer.decode(e,{skip_special_tokens:t,clean_up_tokenization_spaces:n})}get_chat_template({chat_template:e=null,tools:t=null}={}){if(this.chat_template&&typeof this.chat_template==`object`){let n=this.chat_template;if(e!==null&&Object.hasOwn(n,e))e=n[e];else if(e===null)if(t!==null&&`tool_use`in n)e=n.tool_use;else if(`default`in n)e=n.default;else throw Error(`This model has multiple chat templates with no default specified! Please either pass a chat template or the name of the template you wish to use to the 'chat_template' argument. Available template names are ${Object.keys(n).sort()}.`)}else if(e===null)if(this.chat_template)e=this.chat_template;else throw Error(`Cannot use apply_chat_template() because tokenizer.chat_template is not set and no template argument was passed! For information about writing templates and setting the tokenizer.chat_template attribute, please see the documentation at https://huggingface.co/docs/transformers/main/en/chat_templating`);return e}apply_chat_template(e,{tools:t=null,documents:n=null,chat_template:r=null,add_generation_prompt:i=!1,tokenize:a=!0,padding:o=!1,truncation:s=!1,max_length:c=null,return_tensor:l=!0,return_dict:u=!0,tokenizer_kwargs:d={},...f}={}){if(r=this.get_chat_template({chat_template:r,tools:t}),typeof r!=`string`)throw Error(`chat_template must be a string, but got ${typeof r}`);let p=this._compiled_template_cache.get(r);p===void 0&&(p=new EG(r),this._compiled_template_cache.set(r,p));let m=Object.create(null);for(let e of Pq){let t=Lq(this.config,e);t&&(m[e]=t)}let h=p.render({messages:e,add_generation_prompt:i,tools:t,documents:n,...m,...f});if(a){let e=this._call(h,{add_special_tokens:!1,padding:o,truncation:s,max_length:c,return_tensor:l,...d});return u?e:e.input_ids}return h}};function Bq(e,t,n,r){if(!(`language_codes`in e)||!Array.isArray(e.language_codes))throw Error("Tokenizer must have `language_codes` attribute set and it should be an array of language ids.");if(!(`languageRegex`in e)||!(e.languageRegex instanceof RegExp))throw Error("Tokenizer must have `languageRegex` attribute set and it should be a regular expression.");if(!(`lang_to_token`in e)||typeof e.lang_to_token!=`function`)throw Error("Tokenizer must have `lang_to_token` attribute set and it should be a function.");let i=r.src_lang,a=r.tgt_lang;if(!e.language_codes.includes(a))throw Error(`Target language code "${a}" is not valid. Must be one of: {${e.language_codes.join(`, `)}}`);if(i!==void 0){if(!e.language_codes.includes(i))throw Error(`Source language code "${i}" is not valid. Must be one of: {${e.language_codes.join(`, `)}}`);for(let t of e._tokenizer.post_processor.config.single)if(`SpecialToken`in t&&e.languageRegex.test(t.SpecialToken.id)){t.SpecialToken.id=e.lang_to_token(i);break}}return r.forced_bos_token_id=e._tokenizer.token_to_id(e.lang_to_token(a)),e._call(t,n)}var Vq={};GV(Vq,{AlbertTokenizer:()=>Hq,AutoTokenizer:()=>RJ,BartTokenizer:()=>Uq,BertTokenizer:()=>Wq,BlenderbotSmallTokenizer:()=>Gq,BlenderbotTokenizer:()=>Kq,BloomTokenizer:()=>qq,CLIPTokenizer:()=>Yq,CamembertTokenizer:()=>Jq,CodeGenTokenizer:()=>Zq,CodeLlamaTokenizer:()=>Xq,CohereTokenizer:()=>Qq,ConvBertTokenizer:()=>$q,DebertaTokenizer:()=>tJ,DebertaV2Tokenizer:()=>eJ,DistilBertTokenizer:()=>nJ,ElectraTokenizer:()=>rJ,EsmTokenizer:()=>iJ,FalconTokenizer:()=>aJ,GPT2Tokenizer:()=>cJ,GPTNeoXTokenizer:()=>sJ,GemmaTokenizer:()=>oJ,HerbertTokenizer:()=>lJ,LlamaTokenizer:()=>uJ,M2M100Tokenizer:()=>dJ,MBart50Tokenizer:()=>mJ,MBartTokenizer:()=>pJ,MPNetTokenizer:()=>_J,MarianTokenizer:()=>fJ,MgpstrTokenizer:()=>hJ,MobileBertTokenizer:()=>gJ,NllbTokenizer:()=>vJ,NougatTokenizer:()=>yJ,PreTrainedTokenizer:()=>zq,Qwen2Tokenizer:()=>bJ,RoFormerTokenizer:()=>SJ,RobertaTokenizer:()=>xJ,SiglipTokenizer:()=>CJ,SpeechT5Tokenizer:()=>wJ,SqueezeBertTokenizer:()=>TJ,T5Tokenizer:()=>EJ,TokenizersBackend:()=>zq,VitsTokenizer:()=>OJ,Wav2Vec2CTCTokenizer:()=>kJ,WhisperTokenizer:()=>FJ,XLMRobertaTokenizer:()=>IJ,XLMTokenizer:()=>LJ});var Hq=class extends zq{return_token_type_ids=!0},Uq=class extends zq{},Wq=class extends zq{return_token_type_ids=!0},Gq=class extends zq{},Kq=class extends zq{},qq=class extends zq{},Jq=class extends zq{},Yq=class extends zq{},Xq=class extends zq{},Zq=class extends zq{},Qq=class extends zq{},$q=class extends zq{return_token_type_ids=!0},eJ=class extends zq{return_token_type_ids=!0},tJ=class extends zq{return_token_type_ids=!0},nJ=class extends zq{},rJ=class extends zq{return_token_type_ids=!0},iJ=class extends zq{},aJ=class extends zq{},oJ=class extends zq{},sJ=class extends zq{},cJ=class extends zq{},lJ=class extends zq{return_token_type_ids=!0},uJ=class extends zq{padding_side=`left`},dJ=class extends zq{constructor(e,t){super(e,t),this.languageRegex=/^__[a-z]{2,3}__$/,this.language_codes=this.all_special_tokens.filter(e=>this.languageRegex.test(e)).map(e=>e.slice(2,-2)),this.lang_to_token=e=>`__${e}__`}_build_translation_inputs(e,t,n){return Bq(this,e,t,n)}},fJ=class extends zq{constructor(e,t){super(e,t),this.languageRegex=/^(>>\w+<<)\s*/g,this.supported_language_codes=Array.from(this.get_vocab().keys()).filter(e=>this.languageRegex.test(e)),console.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}_encode_text(e){if(e===null)return null;let[t,...n]=e.trim().split(this.languageRegex);if(n.length===0)return super._encode_text(t);if(n.length===2){let[e,t]=n;return this.supported_language_codes.includes(e)||console.warn(`Unsupported language code "${e}" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`),MG([e],super._encode_text(t))}}},pJ=class extends zq{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{2}_[A-Z]{2}$/,this.language_codes=this.all_special_tokens.filter(e=>this.languageRegex.test(e)).map(e=>e),this.lang_to_token=e=>e}_build_translation_inputs(e,t,n){return Bq(this,e,t,n)}},mJ=class extends pJ{},hJ=class extends zq{},gJ=class extends zq{return_token_type_ids=!0},_J=class extends zq{},vJ=class extends zq{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{3}_[A-Z][a-z]{3}$/,this.language_codes=this.all_special_tokens.filter(e=>this.languageRegex.test(e)),this.lang_to_token=e=>e}_build_translation_inputs(e,t,n){return Bq(this,e,t,n)}},yJ=class extends zq{},bJ=class extends zq{},xJ=class extends zq{},SJ=class extends zq{return_token_type_ids=!0},CJ=class extends zq{},wJ=class extends zq{},TJ=class extends zq{return_token_type_ids=!0},EJ=class extends zq{},DJ=class extends FU{decode_chain(e){let t=``;for(let n=1;n[t,e]),...[[`burmese`,`my`],[`valencian`,`ca`],[`flemish`,`nl`],[`haitian`,`ht`],[`letzeburgesch`,`lb`],[`pushto`,`ps`],[`panjabi`,`pa`],[`moldavian`,`ro`],[`moldovan`,`ro`],[`sinhalese`,`si`],[`castilian`,`es`]]]);function NJ(e){e=e.toLowerCase();let t=MJ.get(e);if(t===void 0){let n=e.match(/^<\|([a-z]{2})\|>$/);if(n&&(e=n[1]),jJ.has(e))t=e;else{let t=e.length===2?jJ.keys():jJ.values();throw Error(`Language "${e}" is not supported. Must be one of: ${JSON.stringify(Array.from(t))}`)}}return t}var PJ=RegExp(`^[\\p{P}\\u0021-\\u002F\\u003A-\\u0040\\u005B-\\u0060\\u007B-\\u007E]+$`,`gu`),FJ=class extends zq{get timestamp_begin(){return this._tokenizer.token_to_id(`<|notimestamps|>`)+1}_decode_asr(e,{return_timestamps:t=!1,return_language:n=!1,time_precision:r=null,force_full_sequences:i=!0}={}){if(r===null)throw Error(`Must specify time_precision`);let a=null,o=t===`word`;function s(){return{language:a,timestamp:[null,null],text:``}}let c=[],l=s(),u=0,d=this.timestamp_begin,f=d+1500,p=[],m=[],h=!1,g=null,_=new Set(this.all_special_ids);for(let n of e){let e=n.tokens,i=o?n.token_timestamps:null,v=null,y=d;if(`stride`in n){let[t,i,a]=n.stride;if(u-=i,g=t-a,i&&(y=i/r+d),a)for(let t=e.length-1;t>=0;--t){let n=Number(e[t]);if(n>=d){if(v!==null&&(n-d)*r=d&&g<=f){let e=hK((g-d)*r+u,2);if(v!==null&&g>=v)h=!0;else if(h||p.length>0&&g0?(p.push(b),o&&m.push(x)):p.every(e=>e.length===0)&&(l=s(),p=[],b=[],m=[],x=[])}if(p.length>0){if(i&&t)throw Error(`Whisper did not predict an ending timestamp, which can happen if audio is cut off in the middle of a word. Also make sure WhisperTimeStampLogitsProcessor was used during generation.`);let[e,n]=this.findLongestCommonSequence(p,m),r=this.decode(e);l.text=r,o&&(l.words=this.collateWordTimestamps(e,n,a)),c.push(l)}let v=Object.create(null),y=c.map(e=>e.text).join(``);if(t||n){for(let e=0;e0,o=a?[]:null,s=a?t[0]:null;for(let c=1;ce===g[n]&&s[i+n]<=t[c][m+n]).length:p.filter((e,t)=>e===g[t]).length;let v=e/1e4,y=_/e+v;_>1&&y>u&&(u=y,d=[i,o,m,h])}let[p,m,h,g]=d,_=Math.floor((m+p)/2),v=Math.floor((g+h)/2);i.push(...n.slice(0,_)),n=l.slice(v),r=n.length,a&&(o.push(...s.slice(0,_)),s=t[c].slice(v))}return i.push(...n),a?(o.push(...s),[i,o]):[i,[]]}collateWordTimestamps(e,t,n){let[r,i,a]=this.combineTokensIntoWords(e,n),o=[];for(let e=0;e=r){let e=((t-r)*n).toFixed(2);i.push(`<|${e}|>`),i.push([])}else i[i.length-1].push(t);return i=i.map(e=>typeof e==`string`?e:super.decode(e,t)),i.join(``)}splitTokensOnUnicode(e){let t=this.decode(e,{decode_with_timestamps:!0}),n=[],r=[],i=[],a=[],o=[],s=0;for(let c=0;c=this._tokenizer.token_to_id(`<|endoftext|>`),d=s.startsWith(` `),f=s.trim(),p=PJ.test(f);if(u||d||p||i.length===0)i.push(s),a.push(c),o.push(l);else{let e=i.length-1;i[e]+=s,a[e].push(...c),o[e].push(...l)}}return[i,a,o]}mergePunctuations(e,t,n,r,i){let a=structuredClone(e),o=structuredClone(t),s=structuredClone(n),c=a.length-2,l=a.length-1;for(;c>=0;)a[c].startsWith(` `)&&r.includes(a[c].trim())?(a[l]=a[c]+a[l],o[l]=MG(o[c],o[l]),s[l]=MG(s[c],s[l]),a[c]=``,o[c]=[],s[c]=[]):l=c,--c;for(c=0,l=1;le),o.filter(e=>e.length>0),s.filter(e=>e.length>0)]}},IJ=class extends zq{},LJ=class extends zq{return_token_type_ids=!0;constructor(e,t){super(e,t),console.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}},RJ=class{static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`}={}){let[o,s]=await Mq(e,{progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a}),c=s.tokenizer_class?.replace(/Fast$/,``)??`PreTrainedTokenizer`,l=Vq[c];return l||=(console.warn(`Unknown tokenizer class "${c}", attempting to construct from base class.`),zq),new l(o,s)}},zJ=`https://github.com/huggingface/transformers.js/issues/new/choose`,BJ=`preprocessor_config.json`,VJ=BJ,HJ=`processor_config.json`,UJ=`chat_template.jinja`,WJ=class extends DG{static classes=[`image_processor_class`,`tokenizer_class`,`feature_extractor_class`];static uses_processor_config=!1;static uses_chat_template_file=!1;constructor(e,t,n){super(),this.config=e,this.components=t,this.chat_template=n}get image_processor(){return this.components.image_processor}get tokenizer(){return this.components.tokenizer}get feature_extractor(){return this.components.feature_extractor}apply_chat_template(e,t={}){if(!this.tokenizer)throw Error(`Unable to apply chat template without a tokenizer.`);return this.tokenizer.apply_chat_template(e,{tokenize:!1,chat_template:this.chat_template??void 0,...t})}batch_decode(...e){if(!this.tokenizer)throw Error(`Unable to decode without a tokenizer.`);return this.tokenizer.batch_decode(...e)}decode(...e){if(!this.tokenizer)throw Error(`Unable to decode without a tokenizer.`);return this.tokenizer.decode(...e)}async _call(e,...t){for(let n of[this.image_processor,this.feature_extractor,this.tokenizer])if(n)return n(e,...t);throw Error(`No image processor, feature extractor, or tokenizer found.`)}static async from_pretrained(e,t={}){let[n,r,i]=await Promise.all([this.uses_processor_config?rK(e,HJ,!0,t):{},Promise.all(this.classes.filter(e=>e in this).map(async n=>{let r=await this[n].from_pretrained(e,t);return[n.replace(/_class$/,``),r]})).then(Object.fromEntries),this.uses_chat_template_file?nK(e,UJ,!0,t):null]);return new this(n,r,i)}},GJ={};GV(GJ,{ChatterboxProcessor:()=>PY,Florence2Processor:()=>fZ,Gemma3nProcessor:()=>pZ,GroundingDinoProcessor:()=>hZ,Idefics3Processor:()=>yZ,JinaCLIPProcessor:()=>xZ,LlavaProcessor:()=>SZ,MgpstrProcessor:()=>wZ,MoonshineProcessor:()=>TZ,OwlViTProcessor:()=>EZ,PaliGemmaProcessor:()=>kZ,Phi3VProcessor:()=>MZ,PixtralProcessor:()=>NZ,Processor:()=>WJ,PyAnnoteProcessor:()=>PZ,Qwen2VLProcessor:()=>FZ,Sam2Processor:()=>LZ,Sam2VideoProcessor:()=>RZ,SamProcessor:()=>IZ,SmolVLMProcessor:()=>yZ,SpeechT5Processor:()=>zZ,UltravoxProcessor:()=>BZ,VLChatProcessor:()=>bZ,VoxtralProcessor:()=>GZ,Wav2Vec2Processor:()=>KZ,Wav2Vec2ProcessorWithLM:()=>qZ,WhisperProcessor:()=>JZ});var KJ=class extends DG{constructor(e){super(),this.config=e}static async from_pretrained(e,t={}){let n=await rK(e,BJ,!0,t);return new this(n)}};function qJ(e,t){if(!(e instanceof Float32Array||e instanceof Float64Array))throw Error(`${t} expects input to be a Float32Array or a Float64Array, but got ${e?.constructor?.name??typeof e} instead. If using the feature extractor directly, remember to use \`read_audio(url, sampling_rate)\` to obtain the raw audio data of the file/url.`)}var JJ={};GV(JJ,{ASTFeatureExtractor:()=>_Y,ChatterboxFeatureExtractor:()=>yY,ClapFeatureExtractor:()=>bY,DacFeatureExtractor:()=>xY,EncodecFeatureExtractor:()=>vY,FeatureExtractor:()=>KJ,Gemma3nAudioFeatureExtractor:()=>SY,MoonshineFeatureExtractor:()=>CY,ParakeetFeatureExtractor:()=>TY,PyAnnoteFeatureExtractor:()=>EY,SeamlessM4TFeatureExtractor:()=>DY,SnacFeatureExtractor:()=>OY,SpeechT5FeatureExtractor:()=>kY,Wav2Vec2FeatureExtractor:()=>AY,WeSpeakerFeatureExtractor:()=>jY,WhisperFeatureExtractor:()=>MY});var YJ={fromWeb:()=>{}};async function XJ(e,t){if(sH.IS_BROWSER_ENV){if(sH.IS_WEBWORKER_ENV)throw Error(`Unable to save a file from a Web Worker.`);let n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=e,r.click(),r.remove(),URL.revokeObjectURL(n)}else if(sH.IS_FS_AVAILABLE){let n=t.stream();await(YJ.fromWeb(n),KV.createWriteStream(e),void 0)}else throw Error(`Unable to save because filesystem is disabled in this environment.`)}async function ZJ(e,t){if(typeof AudioContext>`u`)throw Error("Unable to load audio from path/URL since `AudioContext` is not available in your environment. Instead, audio data should be passed directly to the pipeline/processor. For more information and some example code, see https://huggingface.co/docs/transformers.js/guides/node-audio-processing.");let n=await(await XG(e)).arrayBuffer(),r=new AudioContext({sampleRate:t});t===void 0&&console.warn(`No sampling rate provided, using default of ${r.sampleRate}Hz.`);let i=await r.decodeAudioData(n),a;if(i.numberOfChannels===2){let e=Math.sqrt(2),t=i.getChannelData(0),n=i.getChannelData(1);a=new Float32Array(t.length);for(let r=0;r2595*Math.log10(1+e/700),kaldi:e=>1127*Math.log(1+e/700),slaney:(e,t=1e3,n=15,r=27/Math.log(6.4))=>e>=t?n+Math.log(e/t)*r:3*e/200};function nY(e,t=`htk`){let n=tY[t];if(!n)throw Error(`mel_scale should be one of "htk", "slaney" or "kaldi".`);return typeof e==`number`?n(e):e.map(e=>n(e))}var rY={htk:e=>700*(10**(e/2595)-1),kaldi:e=>700*(Math.exp(e/1127)-1),slaney:(e,t=1e3,n=15,r=Math.log(6.4)/27)=>e>=n?t*Math.exp(r*(e-n)):200*e/3};function iY(e,t=`htk`){let n=rY[t];if(!n)throw Error(`mel_scale should be one of "htk", "slaney" or "kaldi".`);return typeof e==`number`?n(e):e.map(e=>n(e))}function aY(e,t){let n=Float64Array.from({length:t.length-1},(e,n)=>t[n+1]-t[n]),r=Array.from({length:e.length},()=>Array(t.length));for(let n=0;nArray(e.length));for(let t=0;te+r*n)}function sY(e,t,n,r,i,a=null,o=`htk`,s=!1){if(a!==null&&a!==`slaney`)throw Error(`norm must be one of null or "slaney"`);if(e<2)throw Error(`Require num_frequency_bins: ${e} >= 2`);if(n>r)throw Error(`Require min_frequency: ${n} <= max_frequency: ${r}`);let c=oY(nY(n,o),nY(r,o),t+2),l=iY(c,o),u;if(s){let t=i/((e-1)*2);u=nY(Float64Array.from({length:e},(e,n)=>n*t),o),l=c}else u=oY(0,Math.floor(i/2),e);let d=aY(u,l);if(a!==null&&a===`slaney`)for(let n=0;ni)throw Error(`frame_length (${n}) may not be larger than fft_length (${i})`);if(C!==n)throw Error(`Length of the window (${C}) must equal frame_length (${n})`);if(r<=0)throw Error(`hop_length must be greater than zero`);if(a===null&&d!==null)throw Error("You have provided `mel_filters` but `power` is `None`. Mel spectrogram computation is not yet supported for complex-valued spectrogram. Specify `power` to fix this issue.");if(!u)throw Error("`preemphasis_htk_flavor=false` is not currently supported.");if(o)switch(s){case`reflect`:{let t=Math.floor((i-1)/2)+1;e=cY(e,t,t);break}case`constant`:{let t=Math.floor(i/2),n=new e.constructor(e.length+2*t);n.set(e,t),e=n;break}default:throw Error(`pad_mode="${s}" not implemented yet.`)}let w=Math.floor(1+Math.floor((e.length-n)/r));v!==null&&ww?b&&(D=y):D=E=y);let O=new pK(i),k=new Float64Array(i),A=new Float64Array(O.outputBufferSize),ee=new Float32Array(T*D);for(let i=0;i=1;--e)k[e]-=l*k[e-1];k[0]*=1-l}for(let e=0;ee**.85);break;default:throw Error(`Unknown window type ${t}.`)}if(n&&(o=o.subarray(0,e)),r===null)return o;if(e>r)throw Error(`Length of the window (${e}) may not be larger than frame_length (${r})`);return o}function mY(e,t){let n=e.reduce((e,t)=>e+t.length,0),r=new ArrayBuffer(44),i=new DataView(r);return hY(i,0,`RIFF`),i.setUint32(4,36+n*4,!0),hY(i,8,`WAVE`),hY(i,12,`fmt `),i.setUint32(16,16,!0),i.setUint16(20,3,!0),i.setUint16(22,1,!0),i.setUint32(24,t,!0),i.setUint32(28,t*4,!0),i.setUint16(32,4,!0),i.setUint16(34,32,!0),hY(i,36,`data`),i.setUint32(40,n*4,!0),new Blob([r,...e.map(e=>e.buffer)],{type:`audio/wav`})}function hY(e,t,n){for(let r=0;re+t.length,0),t=new Float32Array(e),n=0;for(let e of this.audio)t.set(e,n),n+=e.length;return t}else return this.audio}toBlob(){let e=this.audio;return e instanceof Float32Array&&(e=[e]),mY(e,this.sampling_rate)}async save(e){return XJ(e,this.toBlob())}},_Y=class extends KJ{constructor(e){super(e);let t=this.config.sampling_rate;this.mel_filters=sY(257,this.config.num_mel_bins,20,Math.floor(t/2),t,null,`kaldi`,!0),this.window=pY(400,`hann`,{periodic:!1}),this.mean=this.config.mean,this.std=this.config.std}async _extract_fbank_features(e,t){return fY(e,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:`log`,mel_floor:1.192092955078125e-7,remove_dc_offset:!0,max_num_frames:t,transpose:!0})}async _call(e){qJ(e,`ASTFeatureExtractor`);let t=await this._extract_fbank_features(e,this.config.max_length);if(this.config.do_normalize){let e=this.std*2,n=t.data;for(let t=0;t0)if(n===`rand_trunc`){let n=Math.floor(Math.random()*(a+1));e=e.subarray(n,n+t),i=await this._extract_fbank_features(e,this.mel_filters_slaney,this.config.nb_max_samples)}else throw Error(`Truncation strategy "${n}" not implemented`);else{if(a<0){let n=new Float64Array(t);if(n.set(e),r===`repeat`)for(let r=e.length;rt&&(e=e.slice(0,t)),r&&e.length%i!==0){let t=i-e.length%i,n=new Float64Array(e.length+t);n.set(e),this.config.padding_value!==0&&n.fill(this.config.padding_value,e.length),e=n}let a=await this._extract_fbank_features(e,this.config.max_length),o=wq([1,a.dims[0]],!0);return{input_features:a.unsqueeze_(0),input_features_mask:o}}},CY=class extends KJ{async _call(e){qJ(e,`MoonshineFeatureExtractor`),e instanceof Float64Array&&(e=new Float32Array(e));let t=[1,e.length];return{input_values:new iq(`float32`,e,t)}}},wY=1e-5,TY=class extends KJ{constructor(e){super(e),this.config.mel_filters??=sY(Math.floor(1+this.config.n_fft/2),this.config.feature_size,0,this.config.sampling_rate/2,this.config.sampling_rate,`slaney`,`slaney`);let t=pY(this.config.win_length,`hann`,{periodic:!1});this.window=new Float64Array(this.config.n_fft);let n=Math.floor((this.config.n_fft-this.config.win_length)/2);this.window.set(t,n)}async _extract_fbank_features(e){let t=this.config.preemphasis;e=new Float64Array(e);for(let n=e.length-1;n>=1;--n)e[n]-=t*e[n-1];return await fY(e,this.window,this.window.length,this.config.hop_length,{fft_length:this.config.n_fft,power:2,mel_filters:this.config.mel_filters,log_mel:`log`,mel_floor:-1/0,pad_mode:`constant`,center:!0,transpose:!0,mel_offset:2**-24})}async _call(e){qJ(e,`ParakeetFeatureExtractor`);let t=await this._extract_fbank_features(e),n=Math.floor((e.length+Math.floor(this.config.n_fft/2)*2-this.config.n_fft)/this.config.hop_length),r=t.data;r.fill(0,n*t.dims[1]);let[i,a]=t.dims,o=new Float64Array(a),s=new Float64Array(a);for(let e=0;e1?n-1:1;for(let e=0;e({id:e,start:t*n,end:r*n,confidence:i/(r-t)})))}return r}},DY=class extends KJ{constructor(e){super(e);let t=this.config.sampling_rate;this.mel_filters=sY(257,this.config.num_mel_bins,20,Math.floor(t/2),t,null,`kaldi`,!0),this.window=pY(400,`povey`,{periodic:!1})}async _extract_fbank_features(e,t){return e=e.map(e=>e*32768),fY(e,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:`log`,mel_floor:1.192092955078125e-7,remove_dc_offset:!0,max_num_frames:t,transpose:!0})}async _call(e,{padding:t=!0,pad_to_multiple_of:n=2,do_normalize_per_mel_bins:r=!0,return_attention_mask:i=!0}={}){qJ(e,`SeamlessM4TFeatureExtractor`);let a=await this._extract_fbank_features(e,this.config.max_length);if(r){let[e,t]=a.dims,n=a.data;for(let r=0;r0){let n=new Float32Array(t*(e+s));n.set(r),n.fill(this.config.padding_value,r.length);let c=e+s;a=new iq(a.type,n,[c,t]),i&&(o=new iq(`int64`,new BigInt64Array(c),[1,c]),o.data.fill(1n,0,e))}}let[s,c]=a.dims,l=this.config.stride;if(s%l!==0)throw Error(`The number of frames (${s}) must be a multiple of the stride (${l}).`);let u=a.view(1,Math.floor(s/l),c*l),d={input_features:u};if(i){let e=u.dims[1],t=new BigInt64Array(e);if(o){let e=o.data;for(let n=1,r=0;ne+t,0)/e.length,n=e.reduce((e,n)=>e+(n-t)**2,0)/e.length;return e.map(e=>(e-t)/Math.sqrt(n+1e-7))}async _call(e){qJ(e,`Wav2Vec2FeatureExtractor`),e instanceof Float64Array&&(e=new Float32Array(e));let t=e;this.config.do_normalize&&(t=this._zero_mean_unit_var_norm(t));let n=[1,t.length];return{input_values:new iq(`float32`,t,n),attention_mask:new iq(`int64`,new BigInt64Array(t.length).fill(1n),n)}}},jY=class extends KJ{constructor(e){super(e);let t=this.config.sampling_rate;this.mel_filters=sY(257,this.config.num_mel_bins,20,Math.floor(t/2),t,null,`kaldi`,!0),this.window=pY(400,`hamming`,{periodic:!1}),this.min_num_frames=this.config.min_num_frames}async _extract_fbank_features(e){return e=e.map(e=>e*32768),fY(e,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:`log`,mel_floor:1.192092955078125e-7,remove_dc_offset:!0,transpose:!0,min_num_frames:this.min_num_frames})}async _call(e){qJ(e,`WeSpeakerFeatureExtractor`);let t=(await this._extract_fbank_features(e)).unsqueeze_(0);if(this.config.fbank_centering_span===null){let e=t.mean(1).data,n=t.data,[r,i,a]=t.dims;for(let t=0;tr?(e.length>this.config.n_samples&&console.warn("Attempting to extract features for audio longer than 30 seconds. If using a pipeline to extract transcript from a long audio clip, remember to specify `chunk_length_s` and/or `stride_length_s`."),n=e.slice(0,r)):(n=new Float32Array(r),n.set(e)),{input_features:(await this._extract_fbank_features(n)).unsqueeze_(0)}}},NY=class{static async from_pretrained(e,t={}){let n=await rK(e,BJ,!0,t),r=n.feature_extractor_type,i=JJ[r];if(!i)throw Error(`Unknown feature_extractor_type: '${r}'. Please report this at ${zJ}.`);return new i(n)}},PY=class extends WJ{static tokenizer_class=RJ;static feature_extractor_class=NY;async _call(e,t=null){let n=this.tokenizer(e),r=t?await this.feature_extractor(t):{};return{...n,...r}}},FY={},IY,LY,RY,zY=sH.IS_BROWSER_ENV||sH.IS_WEBWORKER_ENV;if(zY)IY=(e,t)=>{if(!self.OffscreenCanvas)throw Error(`OffscreenCanvas not supported by this browser.`);return new self.OffscreenCanvas(e,t)},RY=self.createImageBitmap,LY=self.ImageData;else if(FY)RY=async e=>{let t=(await e.metadata()).channels,{data:n,info:r}=await e.rotate().raw().toBuffer({resolveWithObject:!0}),i=new HY(new Uint8ClampedArray(n),r.width,r.height,r.channels);return t!==void 0&&t!==r.channels&&i.convert(t),i};else throw Error(`Unable to load image processing library.`);var BY={0:`nearest`,1:`lanczos`,2:`bilinear`,3:`bicubic`,4:`box`,5:`hamming`},VY=new Map([[`png`,`image/png`],[`jpg`,`image/jpeg`],[`jpeg`,`image/jpeg`],[`gif`,`image/gif`]]),HY=class e{constructor(e,t,n,r){this.data=e,this.width=t,this.height=n,this.channels=r}get size(){return[this.width,this.height]}static async read(t){if(t instanceof e)return t;if(typeof t==`string`||t instanceof URL)return await this.fromURL(t);if(t instanceof Blob)return await this.fromBlob(t);if(typeof HTMLCanvasElement<`u`&&t instanceof HTMLCanvasElement||typeof OffscreenCanvas<`u`&&t instanceof OffscreenCanvas)return this.fromCanvas(t);throw Error(`Unsupported input type: ${typeof t}`)}static fromCanvas(t){if(!zY)throw Error(`fromCanvas() is only supported in browser environments.`);let n=t.getContext(`2d`).getImageData(0,0,t.width,t.height).data;return new e(n,t.width,t.height,4)}static async fromURL(e){let t=await XG(e);if(t.status!==200)throw Error(`Unable to read image from "${e}" (${t.status} ${t.statusText})`);let n=await t.blob();return this.fromBlob(n)}static async fromBlob(e){if(zY){let t=await RY(e),n=IY(t.width,t.height).getContext(`2d`);return n.drawImage(t,0,0),new this(n.getImageData(0,0,t.width,t.height).data,t.width,t.height,4)}else{let t=FY(await e.arrayBuffer());return await RY(t)}}static fromTensor(t,n=`CHW`){if(t.dims.length!==3)throw Error(`Tensor should have 3 dimensions, but has ${t.dims.length} dimensions.`);if(n===`CHW`)t=t.transpose(1,2,0);else if(n!==`HWC`)throw Error(`Unsupported channel format: ${n}`);if(!(t.data instanceof Uint8ClampedArray||t.data instanceof Uint8Array))throw Error(`Unsupported tensor type: ${t.type}`);switch(t.dims[2]){case 1:case 2:case 3:case 4:return new e(t.data,t.dims[1],t.dims[0],t.dims[2]);default:throw Error(`Unsupported number of channels: ${t.dims[2]}`)}}grayscale(){if(this.channels===1)return this;let e=new Uint8ClampedArray(this.width*this.height*1);switch(this.channels){case 3:case 4:for(let t=0,n=0;t=0?c=r:u=-r,i>=0?l=i:d=-i,s.drawImage(o,c,l,t,n,u,d,t,n),new e(s.getImageData(0,0,t,n).data,t,n,4).convert(a)}else{let e=this.toSharp();if(r>=0&&i>=0)e=e.extract({left:Math.floor(r),top:Math.floor(i),width:t,height:n});else if(r<=0&&i<=0){let a=Math.floor(-i),o=Math.floor(-r);e=e.extend({top:a,left:o,right:t-this.width-o,bottom:n-this.height-a})}else{let a=[0,0],o=0;i<0?(a[0]=Math.floor(-i),a[1]=n-this.height-a[0]):o=Math.floor(i);let s=[0,0],c=0;r<0?(s[0]=Math.floor(-r),s[1]=t-this.width-s[0]):c=Math.floor(r),e=e.extend({top:a[0],bottom:a[1],left:s[0],right:s[1]}).extract({left:c,top:o,width:t,height:n})}return await RY(e)}}async toBlob(e=`image/png`,t=1){if(!zY)throw Error(`toBlob() is only supported in browser environments.`);return await this.toCanvas().convertToBlob({type:e,quality:t})}toTensor(e=`CHW`){let t=new iq(`uint8`,new Uint8Array(this.data),[this.height,this.width,this.channels]);if(e!==`HWC`)if(e===`CHW`)t=t.permute(2,0,1);else throw Error(`Unsupported channel format: ${e}`);return t}toCanvas(){if(!zY)throw Error(`toCanvas() is only supported in browser environments.`);let e=this.clone().rgba(),t=IY(e.width,e.height),n=new LY(e.data,e.width,e.height);return t.getContext(`2d`).putImageData(n,0,0),t}split(){let{data:t,width:n,height:r,channels:i}=this,a=t.constructor,o=t.length/i,s=Array.from({length:i},()=>new a(o));for(let e=0;enew e(t,n,r,1))}_update(e,t,n,r=null){return this.data=e,this.width=t,this.height=n,r!==null&&(this.channels=r),this}clone(){return new e(this.data.slice(),this.width,this.height,this.channels)}convert(e){if(this.channels===e)return this;switch(e){case 1:this.grayscale();break;case 3:this.rgb();break;case 4:this.rgba();break;default:throw Error(`Conversion failed due to unsupported number of channels: ${this.channels}`)}return this}async save(e){if(zY){if(sH.IS_WEBWORKER_ENV)throw Error(`Unable to save an image from a Web Worker.`);let t=e.split(`.`).pop().toLowerCase(),n=VY.get(t)??`image/png`;return XJ(e,await this.toBlob(n))}else if(sH.IS_FS_AVAILABLE)await this.toSharp().toFile(e);else throw Error(`Unable to save the image because filesystem is disabled in this environment.`)}toSharp(){if(zY)throw Error(`toSharp() is only supported in server-side environments.`);return FY(this.data,{raw:{width:this.width,height:this.height,channels:this.channels}})}};HY.read.bind(HY);function UY(e,t,n=0,r=null){let i=e/t,a=gK(i)*t;return r!==null&&a>r&&(a=Math.floor(i)*t),at&&i.push(e)}else{let e=lK(n.data)[1];if(e===c-1||(a=oK(n.data),a[e]e*o[(t+1)%2])),u.boxes.push(n),u.classes.push(t),u.scores.push(a[t])}}l.push(u)}return l}function qY(e,t=null){let n=e.logits,r=n.dims[0];if(t!==null&&t.length!==r)throw Error(`Make sure that you pass in as many target sizes as the batch dimension of the logits`);let i=[];for(let e=0;el[n]&&(l[n]=t[n],u[n]=e)}let d=Array(a.dims[0]);for(let e=0;ee!==void 0);i.push({segmentation:c,labels:f})}return i}function JY(e,t,n,r){let i=[],a=[],o=[];for(let s=0;sn&&(i.push(l),a.push(d),o.push(u))}return[i,a,o]}function YY(e,t,n,r=.5,i=.8){let a=[],o=0,s=0,c=t[n].data;for(let t=0;t=r&&++s;let l=o>0&&s>0;return l&&=o/s>i,[l,a]}function XY(e,t,n,r,i,a=null,o=null){let[s,c]=o??e[0].dims,l=new iq(`int32`,new Int32Array(s*c),[s,c]),u=[];if(o!==null)for(let t=0;tf[e]&&(d[e]=n,f[e]=i[e])}let p=0,m=l.data;for(let a=0;a200)throw Error(`absolute aspect ratio must be smaller than 200, got ${Math.max(e,t)/Math.min(e,t)}`);let a=Math.round(e/n)*n,o=Math.round(t/n)*n;if(a*o>i){let r=Math.sqrt(e*t/i);a=Math.floor(e/r/n)*n,o=Math.floor(t/r/n)*n}else if(a*oi?c=Math.floor(i*s/r):i>r&&(s=Math.floor(r*c/i)),await e.resize(c,s,{resample:n}))}async crop_margin(e,t=200){let n=e.clone().grayscale(),r=cK(n.data)[0],i=lK(n.data)[0]-r;if(i===0)return e;let a=t/255,o=n.width,s=n.height,c=0,l=0,u=n.data;for(let e=0;ethis.preprocess(e)));return{pixel_values:vq(n.map(e=>e.pixel_values),0),original_sizes:n.map(e=>e.original_size),reshaped_input_sizes:n.map(e=>e.reshaped_input_size)}}static async from_pretrained(e,t={}){let n=await rK(e,VJ,!0,t);return new this(n)}},tX={};GV(tX,{BeitFeatureExtractor:()=>nX,BitImageProcessor:()=>rX,CLIPFeatureExtractor:()=>oX,CLIPImageProcessor:()=>aX,ChineseCLIPFeatureExtractor:()=>iX,ConvNextFeatureExtractor:()=>cX,ConvNextImageProcessor:()=>sX,DINOv3ViTImageProcessor:()=>pX,DPTFeatureExtractor:()=>_X,DPTImageProcessor:()=>gX,DeiTFeatureExtractor:()=>uX,DeiTImageProcessor:()=>lX,DetrFeatureExtractor:()=>fX,DetrImageProcessor:()=>dX,DonutFeatureExtractor:()=>hX,DonutImageProcessor:()=>mX,EfficientNetImageProcessor:()=>vX,GLPNFeatureExtractor:()=>yX,GroundingDinoImageProcessor:()=>bX,Idefics3ImageProcessor:()=>xX,ImageFeatureExtractor:()=>eX,ImageProcessor:()=>eX,JinaCLIPImageProcessor:()=>CX,LlavaOnevisionImageProcessor:()=>wX,Mask2FormerImageProcessor:()=>DX,MaskFormerFeatureExtractor:()=>EX,MaskFormerImageProcessor:()=>TX,MobileNetV1FeatureExtractor:()=>kX,MobileNetV1ImageProcessor:()=>OX,MobileNetV2FeatureExtractor:()=>jX,MobileNetV2ImageProcessor:()=>AX,MobileNetV3FeatureExtractor:()=>NX,MobileNetV3ImageProcessor:()=>MX,MobileNetV4FeatureExtractor:()=>FX,MobileNetV4ImageProcessor:()=>PX,MobileViTFeatureExtractor:()=>LX,MobileViTImageProcessor:()=>IX,NougatImageProcessor:()=>RX,OwlViTFeatureExtractor:()=>BX,OwlViTImageProcessor:()=>zX,Owlv2ImageProcessor:()=>VX,Phi3VImageProcessor:()=>qX,PixtralImageProcessor:()=>JX,PvtImageProcessor:()=>YX,Qwen2VLImageProcessor:()=>XX,RTDetrImageProcessor:()=>ZX,Sam2ImageProcessor:()=>QX,Sam3ImageProcessor:()=>QX,SamImageProcessor:()=>QX,SapiensFeatureExtractor:()=>eZ,SapiensImageProcessor:()=>$X,SegformerFeatureExtractor:()=>nZ,SegformerImageProcessor:()=>tZ,SiglipImageProcessor:()=>rZ,SmolVLMImageProcessor:()=>xX,Swin2SRImageProcessor:()=>iZ,VLMImageProcessor:()=>SX,ViTFeatureExtractor:()=>oZ,ViTImageProcessor:()=>aZ,VitMatteImageProcessor:()=>sZ,VitPoseImageProcessor:()=>cZ,YolosFeatureExtractor:()=>uZ,YolosImageProcessor:()=>lZ});var nX=class extends eX{},rX=class extends eX{},iX=class extends eX{},aX=class extends eX{},oX=class extends aX{},sX=class extends eX{constructor(e){super(e),this.crop_pct=this.config.crop_pct??224/256}async resize(e){let t=this.size?.shortest_edge;if(t===void 0)throw Error(`Size dictionary must contain 'shortest_edge' key.`);if(t<384){let n=Math.floor(t/this.crop_pct),[r,i]=this.get_resize_output_image_size(e,{shortest_edge:n});e=await e.resize(r,i,{resample:this.resample}),e=await e.center_crop(t,t)}else e=await e.resize(t,t,{resample:this.resample});return e}},cX=class extends sX{},lX=class extends eX{},uX=class extends lX{},dX=class extends eX{async _call(e){let t=await super._call(e),n=wq([t.pixel_values.dims[0],64,64],1n);return{...t,pixel_mask:n}}post_process_object_detection(...e){return KY(...e)}post_process_panoptic_segmentation(...e){return QY(...e)}post_process_instance_segmentation(...e){return $Y(...e)}},fX=class extends dX{},pX=class extends eX{},mX=class extends eX{pad_image(e,t,n,r={}){let[i,a,o]=t,s=this.image_mean;Array.isArray(this.image_mean)||(s=Array(o).fill(s));let c=this.image_std;Array.isArray(c)||(c=Array(o).fill(s));let l=s.map((e,t)=>-e/c[t]);return super.pad_image(e,t,n,{center:!0,constant_values:l,...r})}},hX=class extends mX{},gX=class extends eX{},_X=class extends gX{},vX=class extends eX{constructor(e){super(e),this.include_top=this.config.include_top??!0,this.include_top&&(this.image_std=this.image_std.map(e=>e*e))}},yX=class extends eX{},bX=class extends eX{async _call(e){let t=await super._call(e),n=t.pixel_values.dims,r=Eq([n[0],n[2],n[3]]);return{...t,pixel_mask:r}}},xX=class extends eX{constructor(e){super(e),this.do_image_splitting=e.do_image_splitting??!0,this.max_image_size=e.max_image_size}get_resize_for_vision_encoder(e,t){let[n,r]=e.dims.slice(-2),i=r/n;return r>=n?(r=Math.ceil(r/t)*t,n=Math.floor(r/i),n=Math.ceil(n/t)*t):(n=Math.ceil(n/t)*t,r=Math.floor(n*i),r=Math.ceil(r/t)*t),{height:n,width:r}}async _call(e,{do_image_splitting:t=null,return_row_col_info:n=!1}={}){let r;if(!Array.isArray(e))r=[[e]];else{if(e.length===0||!e[0])throw Error(`No images provided.`);r=Array.isArray(e[0])?e:[e]}let i=[],a=[],o=[],s=[],c=[];for(let e of r){let n=await Promise.all(e.map(e=>this.preprocess(e)));s.push(...n.map(e=>e.original_size)),c.push(...n.map(e=>e.reshaped_input_size)),n.forEach(e=>e.pixel_values.unsqueeze_(0));let{longest_edge:r}=this.max_image_size,l;if(t??this.do_image_splitting){let e=Array(n.length),t=Array(n.length);l=await Promise.all(n.map(async(n,i)=>{let a=this.get_resize_for_vision_encoder(n.pixel_values,r),o=await cq(n.pixel_values,{size:[a.height,a.width]}),{frames:s,num_splits_h:c,num_splits_w:l}=await this.split_image(o,this.max_image_size);return e[i]=c,t[i]=l,_q(s,0)})),a.push(e),o.push(t)}else{let e=[r,r];l=await Promise.all(n.map(t=>cq(t.pixel_values,{size:e}))),a.push(Array(n.length).fill(0)),o.push(Array(n.length).fill(0))}i.push(_q(l,0))}let l=i.length,[u,d,f,p]=i[0].dims,m,h;if(l===1)m=i[0].unsqueeze_(0),h=wq([l,u,f,p],!0);else{let e=Math.max(...i.map(e=>e.dims.at(0)));h=wq([l,e,f,p],!0);let t=h.data,n=e*f*p;for(let r=0;rn||o>r){s=Math.ceil(a/n),c=Math.ceil(o/r);let t=Math.ceil(a/s),l=Math.ceil(o/c);for(let n=0;ne*this.rescale_factor)}pad_image(e,t,n,r){return super.pad_image(e,t,n,{constant_values:this.constant_values,center:!0,...r})}},CX=class extends eX{constructor(e){let{resize_mode:t,fill_color:n,interpolation:r,size:i,...a}=e,o=t===`squash`?{width:i,height:i}:t===`shortest`?{shortest_edge:i}:{longest_edge:i},s=r===`bicubic`?3:2;super({...a,size:o,resample:s,do_center_crop:!0,crop_size:i,do_normalize:!0})}},wX=class extends eX{},TX=class extends eX{post_process_panoptic_segmentation(...e){return QY(...e)}post_process_instance_segmentation(...e){return $Y(...e)}},EX=class extends TX{},DX=class extends TX{},OX=class extends eX{},kX=class extends OX{},AX=class extends eX{},jX=class extends AX{},MX=class extends eX{},NX=class extends MX{},PX=class extends eX{},FX=class extends PX{},IX=class extends eX{},LX=class extends IX{},RX=class extends mX{},zX=class extends eX{post_process_object_detection(...e){return KY(...e)}},BX=class extends zX{},VX=class extends zX{},HX=336,UX=[2,3],{ceil:WX,floor:GX,sqrt:KX}=Math,qX=class extends eX{constructor(e){super({...e,do_normalize:!0,do_pad:!0,pad_size:`custom`,do_convert_rgb:!0,do_resize:!0}),this._num_crops=e.num_crops}calc_num_image_tokens_from_image_size(e,t){let{num_img_tokens:n}=this.config;return GX((GX(t/HX)*GX(e/HX)+1)*n+1+(GX(t/HX)+1)*KX(n))}get_resize_output_image_size(e,t){let n=this._num_crops,[r,i]=e.size,a=r/i,o=1;for(;o*Math.ceil(o/a)<=n;)o+=1;--o;let s=Math.floor(o*336);return[s,Math.floor(s/a)]}pad_image(e,t,n,r={}){let[i,a]=t,o=HX*WX(i/HX),s=HX*WX(a/HX),c=[1,1,1].map((e,t)=>(e-this.image_mean[t])/this.image_std[t]);return super.pad_image(e,t,{width:s,height:o},{center:!0,constant_values:c,...r})}async _call(e,{num_crops:t=null}={}){if(this._num_crops=t??=this.config.num_crops,t<4||KX(t)%1!=0)throw Error(`num_crops must be a square number >= 4`);Array.isArray(e)||(e=[e]);let n=e.length,r=await Promise.all(e.map(e=>this.preprocess(e))),i=r.map(e=>e.original_size),a=r.map(e=>e.reshaped_input_size),o=[];for(let{pixel_values:e}of r){e.unsqueeze_(0);let[n,r]=e.dims.slice(-2),i=await cq(e,{size:[HX,HX],mode:`bicubic`});if(t>0){let a=[],s=KX(t),c=GX(r/s),l=GX(n/s);for(let t=0;te.map(e=>HX*WX(e/HX)));return{pixel_values:s,original_sizes:i,reshaped_input_sizes:a,image_sizes:new iq(`int64`,c.flat(),[n,2]),num_img_tokens:c.map(([e,t])=>this.calc_num_image_tokens_from_image_size(t,e))}}},JX=class extends eX{get_resize_output_image_size(e,t){let{longest_edge:n}=t;if(n===void 0)throw Error(`size must contain 'longest_edge'`);let[r,i]=e.size,a=Math.max(r,i)/n,o=r,s=i;a>1&&(o=Math.floor(r/a),s=Math.floor(i/a));let{patch_size:c,spatial_merge_size:l}=this.config;if(!l)throw Error(`config must contain 'spatial_merge_size'`);let u=c*l,d=Math.floor((o-1)/u)+1,f=Math.floor((s-1)/u)+1;return[d*u,f*u]}},YX=class extends eX{},XX=class extends eX{async _call(e,...t){let{pixel_values:n,original_sizes:r,reshaped_input_sizes:i}=await super._call(e,...t),a=n,{temporal_patch_size:o,merge_size:s,patch_size:c}=this.config;a.dims[0]===1&&(a=_q(Array.from({length:o},()=>a),0));let l=a.dims[0]/o,u=a.dims[1],d=Math.floor(a.dims[2]/c),f=Math.floor(a.dims[3]/c);return{pixel_values:a.view(l,o,u,Math.floor(d/s),s,c,Math.floor(f/s),s,c).permute(0,3,6,4,7,2,1,5,8).view(l*d*f,u*o*c*c),image_grid_thw:new iq(`int64`,[l,d,f],[1,3]),original_sizes:r,reshaped_input_sizes:i}}},ZX=class extends eX{post_process_object_detection(...e){return KY(...e)}},QX=class extends eX{reshape_input_points(e,t,n,r=!1){e=structuredClone(e);let i=jG(e);if(i.length===3)r||(i=[1,...i]),e=[e];else if(i.length!==4)throw Error("The input_points must be a 4D tensor of shape `batch_size`, `point_batch_size`, `nb_points_per_image`, `2`.");for(let r=0;re!==t.dims[n]))throw Error(`The first ${n.length} dimensions of 'input_points' and 'input_labels' must be the same.`);return new iq(`int64`,e.flat(1/0).map(BigInt),n)}async _call(e,{input_points:t=null,input_labels:n=null,input_boxes:r=null}={}){let i=await super._call(e);if(t&&(i.input_points=this.reshape_input_points(t,i.original_sizes,i.reshaped_input_sizes)),n){if(!i.input_points)throw Error("`input_points` must be provided if `input_labels` are provided.");i.input_labels=this.add_input_labels(n,i.input_points)}return r&&(i.input_boxes=this.reshape_input_points(r,i.original_sizes,i.reshaped_input_sizes,!0)),i}async post_process_masks(e,t,n,{mask_threshold:r=0,binarize:i=!0,pad_size:a=null}={}){let o=[];a=a??this.pad_size??this.size;let s=[a.height,a.width];for(let a=0;ar&&(t[n]=1);u=new iq(`bool`,t,u.dims)}o.push(u)}return o}generate_crop_boxes(e,t,{crop_n_layers:n=0,overlap_ratio:r=512/1500,points_per_crop:i=32,crop_n_points_downscale_factor:a=1}={}){}},$X=class extends eX{post_process_semantic_segmentation(...e){return qY(...e)}},eZ=class extends $X{},tZ=class extends eX{post_process_semantic_segmentation(...e){return qY(...e)}},nZ=class extends tZ{},rZ=class extends eX{},iZ=class extends eX{pad_image(e,t,n,r={}){let[i,a,o]=t;return super.pad_image(e,t,{width:a+(n-a%n)%n,height:i+(n-i%n)%n},{mode:`symmetric`,center:!1,constant_values:-1,...r})}},aZ=class extends eX{},oZ=class extends aZ{},sZ=class extends eX{async _call(e,t){Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]);let n=await Promise.all(e.map(e=>this.preprocess(e))),r=await Promise.all(t.map(e=>this.preprocess(e,{do_normalize:!1,do_convert_rgb:!1,do_convert_grayscale:!0})));return{pixel_values:vq(n.map((e,t)=>_q([e.pixel_values,r[t].pixel_values],0)),0),original_sizes:n.map(e=>e.original_size),reshaped_input_sizes:n.map(e=>e.reshaped_input_size)}}},cZ=class extends eX{post_process_pose_estimation(e,t,{threshold:n=null}={}){let r=e.tolist(),[i,a,o,s]=e.dims,c=[];for(let e=0;e/gm,bboxes:/([^<]+)?/gm},this.size_per_bin=1e3}construct_prompts(e){typeof e==`string`&&(e=[e]);let t=[];for(let n of e)if(this.task_prompts_without_inputs.has(n))t.push(this.task_prompts_without_inputs.get(n));else{for(let[e,r]of this.task_prompts_with_input)if(n.includes(e)){t.push(r.replaceAll(`{input}`,n).replaceAll(e,``));break}t.length!==e.length&&t.push(n)}return t}post_process_generation(e,t,n){let r=this.tasks_answer_post_processing_type.get(t)??`pure_text`;e=e.replaceAll(``,``).replaceAll(``,``);let i;switch(r){case`pure_text`:i=e;break;case`description_with_bboxes`:case`bboxes`:case`phrase_grounding`:case`ocr`:let a=r===`ocr`?`quad_boxes`:`bboxes`,o=e.matchAll(this.regexes[a]),s=[],c=[];for(let[e,t,...r]of o)s.push(t?t.trim():s.at(-1)??``),c.push(r.map((e,t)=>(Number(e)+.5)/this.size_per_bin*n[t%2]));i={labels:s,[a]:c};break;default:throw Error(`Task "${t}" (of type "${r}") not yet implemented.`)}return{[t]:i}}async _call(e,t=null,n={}){if(!e&&!t)throw Error(`Either text or images must be provided`);let r=await this.image_processor(e,n),i=t?this.tokenizer(this.construct_prompts(t),n):{};return{...r,...i}}},pZ=class extends WJ{static image_processor_class=dZ;static feature_extractor_class=NY;static tokenizer_class=RJ;static uses_processor_config=!0;static uses_chat_template_file=!0;constructor(e,t,n){super(e,t,n),this.audio_seq_length=this.config.audio_seq_length,this.image_seq_length=this.config.image_seq_length;let{audio_token_id:r,boa_token:i,audio_token:a,eoa_token:o,image_token_id:s,boi_token:c,image_token:l,eoi_token:u}=this.tokenizer.config;this.audio_token_id=r,this.boa_token=i,this.audio_token=a,this.full_audio_sequence=` + +${i}${a.repeat(this.audio_seq_length)}${o} + +`,this.image_token_id=s,this.boi_token=c,this.image_token=l,this.full_image_sequence=` + +${c}${l.repeat(this.image_seq_length)}${u} + +`}async _call(e,t=null,n=null,r={}){typeof e==`string`&&(e=[e]);let i;n&&(i=await this.feature_extractor(n,r),e=e.map(e=>e.replaceAll(this.audio_token,this.full_audio_sequence)));let a;return t&&(a=await this.image_processor(t,r),e=e.map(e=>e.replaceAll(this.image_token,this.full_image_sequence))),{...this.tokenizer(e,r),...a,...i}}};function mZ(e,t){let n=e.dims.at(-1)-1,r=e.tolist();r.fill(!1,0,1),r.fill(!1,n);let i=t.tolist();return r.map((e,t)=>e?t:null).filter(e=>e!==null).map(e=>i[e])}var hZ=class extends WJ{static tokenizer_class=RJ;static image_processor_class=dZ;async _call(e,t,n={}){let r=e?await this.image_processor(e,n):{};return{...t?this.tokenizer(t,n):{},...r}}post_process_grounded_object_detection(e,t,{box_threshold:n=.25,text_threshold:r=.25,target_sizes:i=null}={}){let{logits:a,pred_boxes:o}=e,s=a.dims[0];if(i!==null&&i.length!==s)throw Error(`Make sure that you pass in as many target sizes as the batch dimension of the logits`);let c=a.dims.at(1),l=a.sigmoid(),u=l.max(-1).tolist(),d=o.tolist().map(e=>e.map(e=>GY(e))),f=[];for(let e=0;ee.map((e,t)=>e*a[(t+1)%2])));let o=u[e],s=[],p=[],m=[];for(let i=0;i`+i.repeat(e);o+=` +`}return o+=` +${r}${a}`+i.repeat(e)+`${r}`,o}function _Z(e,t,n,r){return`${t}${r}`+n.repeat(e)+`${t}`}function vZ(e,t,n,r,i,a){return e===0&&t===0?_Z(n,r,i,a):gZ(n,e,t,r,i,a)}var yZ=class extends WJ{static image_processor_class=dZ;static tokenizer_class=RJ;static uses_processor_config=!0;fake_image_token=``;image_token=``;global_img_token=``;async _call(e,t=null,n={}){n.return_row_col_info??=!0;let r;t&&(r=await this.image_processor(t,n)),Array.isArray(e)||(e=[e]);let i=r.rows??[Array(e.length).fill(0)],a=r.cols??[Array(e.length).fill(0)],o=this.config.image_seq_len,s=[],c=[];for(let t=0;tvZ(e,l[t],o,this.fake_image_token,this.image_token,this.global_img_token)),d=n.split(this.image_token);if(d.length===0)throw Error(`The image token should be present in the text.`);let f=d[0];for(let e=0;ee.images).flatMap(e=>e.images).map(e=>HY.read(e)));let r=this.tokenizer,i=r.apply_chat_template(e,{tokenize:!1,add_generation_prompt:!0,chat_template:n}),a=e=>r.encode(e,{add_special_tokens:!1}),o=i.split(this.image_tag),s=o.length-1;if(t.length!==s)throw Error(`Number of images provided (${t.length}) does not match number of "${this.image_tag}" image tags (${s})`);let[c,l,u]=r.convert_tokens_to_ids([this.image_tag,this.image_start_tag,this.image_end_tag]),d=a(o[0]),f=Array(d.length).fill(!1);for(let e=1;e0){let e=await this.image_processor(t);return e.pixel_values.unsqueeze_(0),{...m,...e}}return m}},xZ=class extends WJ{static tokenizer_class=RJ;static image_processor_class=dZ;async _call(e=null,t=null,n={}){if(!e&&!t)throw Error(`Either text or images must be provided`);let r=e?this.tokenizer(e,n):{},i=t?await this.image_processor(t,n):{};return{...r,...i}}},SZ=class extends WJ{static tokenizer_class=RJ;static image_processor_class=dZ;static uses_processor_config=!0;async _call(e,t=null,n={}){let r=await this.image_processor(e,n);if(t){let[e,n]=r.pixel_values.dims.slice(-2),{image_token:i,patch_size:a,num_additional_image_tokens:o}=this.config,s=Math.floor(e/a)*Math.floor(n/a)+o;t=structuredClone(t),Array.isArray(t)||(t=[t]);for(let e=0;e0?i.reduce((e,t)=>e*t,1):0;c.push(n),s.push(a)}return[i(c),s]}char_decode(e){return this.char_tokenizer.batch_decode(e).map(e=>e.replaceAll(` `,``))}bpe_decode(e){return this.bpe_tokenizer.batch_decode(e)}wp_decode(e){return this.wp_tokenizer.batch_decode(e).map(e=>e.replaceAll(` `,``))}batch_decode([e,t,n]){let[r,i]=this._decode_helper(e,`char`),[a,o]=this._decode_helper(t,`bpe`),[s,c]=this._decode_helper(n,`wp`),l=[],u=[];for(let e=0;e`;function OZ(e,t,n,r,i){return`${r.repeat(n*i)}${t}${e} +`}var kZ=class extends WJ{static tokenizer_class=RJ;static image_processor_class=dZ;static uses_processor_config=!1;async _call(e,t=null,n={}){t||=(console.warn(`You are using PaliGemma without a text prefix. It will perform as a picture-captioning model.`),``),Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]);let r=this.tokenizer.bos_token,i=this.image_processor.config.image_seq_length,a;t.some(e=>e.includes(DZ))?a=t.map(e=>{let t=e.replaceAll(DZ,DZ.repeat(i)),n=t.lastIndexOf(DZ),a=n===-1?0:n+DZ.length;return t.slice(0,a)+r+t.slice(a)+` +`}):(console.warn("You are passing both `text` and `images` to `PaliGemmaProcessor`. The processor expects special image tokens in the text, as many tokens as there are images per each text. It is recommended to add `` tokens in the very beginning of your text. For this call, we will infer how many images each text has and add special tokens."),a=t.map(t=>OZ(t,r,i,DZ,e.length)));let o=this.tokenizer(a,n);return{...await this.image_processor(e,n),...o}}},AZ=`<|image|>`,jZ=/<\|image_\d+\|>/g,MZ=class extends WJ{static image_processor_class=dZ;static tokenizer_class=RJ;async _call(e,t=null,{padding:n=!0,truncation:r=!0,num_crops:i=null}={}){Array.isArray(e)||(e=[e]);let a,o;if(t){o=await this.image_processor(t,{num_crops:i});let{num_img_tokens:s}=o,c=e.map((e,t)=>e.split(jZ).join(AZ.repeat(s[t])));a=this.tokenizer(c,{padding:n,truncation:r});let l=this.tokenizer._tokenizer.token_to_id(AZ);a.input_ids.map_(e=>e==l?-e:e)}else a=this.tokenizer(e);return{...a,...o}}},NZ=class extends WJ{static tokenizer_class=RJ;static image_processor_class=dZ;static uses_processor_config=!0;async _call(e,t=null,n={}){let r=await this.image_processor(e,n);if(t){let[e,n]=r.pixel_values.dims.slice(-2),{image_token:i,image_break_token:a,image_end_token:o,patch_size:s,spatial_merge_size:c}=this.config,l=s*c,u=Math.floor(e/l),d=Math.floor(n/l);t=structuredClone(t),Array.isArray(t)||(t=[t]);for(let e=0;e{for(;e.includes(`<|image_pad|>`);){let i=Number(r[n++].reduce((e,t)=>e*t,1n));e=e.replace(`<|image_pad|>`,`<|placeholder|>`.repeat(Math.floor(i/t)))}return e.replaceAll(`<|placeholder|>`,`<|image_pad|>`)})}return{...this.tokenizer(e),...r}}},IZ=class extends WJ{static image_processor_class=dZ;async _call(...e){return await this.image_processor(...e)}post_process_masks(...e){return this.image_processor.post_process_masks(...e)}reshape_input_points(...e){return this.image_processor.reshape_input_points(...e)}},LZ=class extends IZ{},RZ=class extends LZ{},zZ=class extends WJ{static tokenizer_class=RJ;static feature_extractor_class=NY;async _call(e){return await this.feature_extractor(e)}},BZ=class extends WJ{static tokenizer_class=RJ;static feature_extractor_class=NY;static uses_processor_config=!0;async _call(e,t=null,n={}){if(Array.isArray(e))throw Error(`Batched inputs are not supported yet.`);let r={};if(t){let i=t.length,{input_features:a}=await this.feature_extractor(t,{...n,max_length:i}),o=Math.round(i/this.config.encoder_ds_factor+1e-4),s=1+Math.ceil(o/this.config.stack_factor);r.audio_token_len=[s],r.audio_values=a;let c=this.config.audio_placeholder;if(!e.includes(c))throw Error(`The input text does not contain the image token ${c}.`);e=e.replaceAll(c,c.repeat(s))}return{...this.tokenizer(e,{add_special_tokens:!1,...n}),...r}}},VZ=`[AUDIO]`,HZ=`[BEGIN_AUDIO]`,UZ=375;function WZ(e,t){let n=[];for(let r=0;rWZ(e,o)),c=s.map(e=>e.length),l=s.flat(),u=(await Promise.all(l.map(e=>this.feature_extractor(e,n)))).map(e=>e.input_features);r.audio_values=u.length>1?_q(u,0):u[0];let d=i[0];for(let e=0;eVG)throw Error(`The number of external data chunks (${a}) exceeds the maximum allowed value (${VG}).`);for(let t=0;t{let o=await tK(e,i,!0,r,s);t(o instanceof Uint8Array?{path:n,data:o}:n)}))}}else a.externalData!==void 0&&(c=a.externalData.map(async t=>{if(typeof t.data==`string`){let n=await tK(e,t.data,!0,r);return{...t,data:n}}return t}));return Promise.all(c)}async function iQ(e,t,n,r=!1){let i=n.config?.[`transformers.js_config`]??{},a=n.device??i.device;a&&typeof a!=`string`&&(a.hasOwnProperty(t)?a=a[t]:(console.warn(`device not specified for "${t}". Using the default device.`),a=null));let o=a??(sH.IS_NODE_ENV?`cpu`:`wasm`),s=zK(o),c=i.device_config??{};c.hasOwnProperty(o)&&(i={...i,...c[o]});let l=n.dtype??i.dtype;if(typeof l!=`string`&&(l&&l.hasOwnProperty(t)?l=l[t]:(l=tq[o]??eq.fp32,console.warn(`dtype not specified for "${t}". Using the default dtype (${l}) for this device (${o}).`))),l===eq.auto){let e=i.dtype;typeof e!=`string`&&(e=e?.[t]),l=e&&e!==eq.auto&&eq.hasOwnProperty(e)?e:tq[o]??eq.fp32}let u=l;if(!nq.hasOwnProperty(u))throw Error(`Invalid dtype: ${u}. Should be one of: ${Object.keys(eq).join(`, `)}`);if(o===`webgpu`&&!sH.IS_NODE_ENV&&u===eq.fp16&&!await $K())throw Error(`The device (${o}) does not support fp16.`);let d=i.kv_cache_dtype,f=d?typeof d==`string`?d:d[u]??`float32`:void 0;if(f&&![`float32`,`float16`].includes(f))throw Error(`Invalid kv_cache_dtype: ${f}. Should be one of: float32, float16`);let p=nq[u],m={...n.session_options};m.executionProviders??=s;let h=i.free_dimension_overrides;h?m.freeDimensionOverrides??=h:o.startsWith(`webnn`)&&!m.freeDimensionOverrides&&console.warn(`WebNN does not currently support dynamic shapes and requires 'free_dimension_overrides' to be set in config.json, preferably as a field within config["transformers.js_config"]["device_config"]["${o}"]. When 'free_dimension_overrides' is not set, you may experience significant performance degradation.`);let g=nQ(e,t,n,p),_=await rQ(e,t,p,n,n.use_external_data_format??i.use_external_data_format,m);if(_.length>0&&!sH.IS_NODE_ENV&&(m.externalData=_),r&&o===`webgpu`&&d!==!1){let e=QZ(n.config,{prefix:`present`});if(Object.keys(e).length>0&&!YK()){let t={};for(let n in e)t[n]=`gpu-buffer`;m.preferredOutputLocation=t}}return{buffer_or_path:await g,session_options:m,session_config:{dtype:u,kv_cache_dtype:f,device:o}}}async function aQ(e,t,n,r=void 0){return Object.fromEntries(await Promise.all(Object.keys(t).map(async i=>{let{buffer_or_path:a,session_options:o,session_config:s}=await iQ(e,t[i],n,i===r);return[i,await WK(a,o,s)]})))}function oQ(e){for(let t in e)qK(e[t])?e[t]=new iq(e[t]):typeof e[t]==`object`&&oQ(e[t]);return e}async function sQ(e,t){let n=cQ(e,t);try{return oQ(await KK(e,Object.fromEntries(Object.entries(n).map(([e,t])=>{let n=t.ort_tensor;return sH.IS_NODE_ENV&&typeof Float16Array<`u`&&n.cpuData instanceof Float16Array&&(n.cpuData=new Uint16Array(n.cpuData.buffer)),[e,n]}))))}catch(e){let t=Object.fromEntries(Object.entries(n).map(([e,t])=>{let n={type:t.type,dims:t.dims,location:t.location};return n.location!==`gpu-buffer`&&(n.data=t.data),[e,n]}));throw console.error(`An error occurred during model execution: "${e}".`),console.error(`Inputs given to model:`,t),e}}function cQ(e,t){let n=Object.create(null),r=[];for(let i of e.inputNames){let e=t[i];if(!(e instanceof iq)){r.push(i);continue}n[i]=YK()?e.clone():e}if(r.length>0)throw Error(`An error occurred during model execution: "Missing the following inputs: ${r.join(`, `)}.`);let i=Object.keys(t).length,a=e.inputNames.length;if(i>a){let n=Object.keys(t).filter(t=>!e.inputNames.includes(t));console.warn(`WARNING: Too many inputs were provided (${i} > ${a}). The following inputs will be ignored: "${n.join(`, `)}".`)}return n}var lQ=class{},uQ=class extends lQ{constructor({logits:e,...t}){super(),this.logits=e;let n=Object.values(t);n.length>0&&(this.attentions=n)}},dQ=class extends lQ{constructor({logits:e}){super(),this.logits=e}},fQ=class extends lQ{constructor({logits:e}){super(),this.logits=e}},pQ=class extends lQ{constructor({start_logits:e,end_logits:t}){super(),this.start_logits=e,this.end_logits=t}},mQ=class extends lQ{constructor({logits:e}){super(),this.logits=e}},hQ=class extends lQ{constructor({alphas:e}){super(),this.alphas=e}},gQ=class extends DG{_call(e,t){throw Error("`_call` should be implemented in a subclass")}},_Q=class extends DG{_call(e,t){throw Error("`_call` should be implemented in a subclass")}},vQ=class extends DG{constructor(){super(),this.processors=[]}push(e){this.processors.push(e)}extend(e){this.processors.push(...e)}_call(e,t){let n=t;for(let t of this.processors)n=t(e,n);return n}[Symbol.iterator](){return this.processors.values()}},yQ=class extends gQ{constructor(e){super(),this.bos_token_id=e}_call(e,t){for(let n=0;n=1&&i[i.length-1]>=this.timestamp_begin,o=i.length<2||i[i.length-2]>=this.timestamp_begin;if(a&&(o?r.subarray(this.timestamp_begin).fill(-1/0):r.subarray(0,this.eos_token_id).fill(-1/0)),e[n].length===this.begin_index&&this.max_initial_timestamp_index!==null){let e=this.timestamp_begin+this.max_initial_timestamp_index;r.subarray(e+1).fill(-1/0)}let s=sK(r);Math.log(s.subarray(this.timestamp_begin).map(Math.exp).reduce((e,t)=>e+t))>lK(s.subarray(0,this.timestamp_begin))[0]&&r.subarray(0,this.timestamp_begin).fill(-1/0)}return t}},CQ=class extends gQ{constructor(e){super(),this.no_repeat_ngram_size=e}getNgrams(e){let t=e.length,n=[];for(let r=0;r1 to use the classifier free guidance processor, got guidance scale ${e}.`);this.guidance_scale=e}_call(e,t){if(t.dims[0]!==2*e.length)throw Error(`Logits should have twice the batch size of the input ids, the first half of batches corresponding to the conditional inputs, and the second half of batches corresponding to the unconditional inputs. Got batch size ${t.dims[0]} for the logits and ${e.length} for the input ids.`);let n=e.length,r=t.slice([0,n],null),i=t.slice([n,t.dims[0]],null);for(let e=0;ee.length>=this.max_length)}},PQ=class extends jQ{constructor(e){super(),Array.isArray(e)||(e=[e]),this.eos_token_id=e}_call(e,t){return e.map(e=>{let t=e.at(-1);return this.eos_token_id.some(e=>t==e)})}},FQ=class extends jQ{constructor(){super(),this.interrupted=!1}interrupt(){this.interrupted=!0}reset(){this.interrupted=!1}_call(e,t){return Array(e.length).fill(this.interrupted)}},IQ=class extends DG{constructor(e){super(),this.generation_config=e}async _call(e){return this.sample(e)}async sample(e){throw Error(`sample should be implemented in subclasses.`)}getLogits(e,t){let n=e.dims.at(-1),r=e.data;if(t===-1)r=r.slice(-n);else{let e=t*n;r=r.slice(e,e+n)}return r}randomSelect(e){let t=0;for(let n=0;n1)return new zQ(e);if(e.num_return_sequences>1)throw Error(`num_return_sequences has to be 1 when doing greedy search, but is ${e.num_return_sequences}.`);return new LQ(e)}},LQ=class extends IQ{async sample(e){let t=lK(e.data)[1];return[[BigInt(t),0]]}},RQ=class extends IQ{async sample(e){let t=e.dims.at(-1);this.generation_config.top_k>0&&(t=Math.min(this.generation_config.top_k,t));let[n,r]=await uq(e,t),i=oK(n.data);return Array.from({length:this.generation_config.num_beams},()=>{let e=this.randomSelect(i);return[r.data[e],Math.log(i[e])]})}},zQ=class extends IQ{async sample(e){let t=e.dims.at(-1);this.generation_config.top_k>0&&(t=Math.min(this.generation_config.top_k,t));let[n,r]=await uq(e,t),i=oK(n.data);return Array.from({length:this.generation_config.num_beams},(e,t)=>[r.data[t],Math.log(i[t])])}},BQ=null;function VQ(e){BQ=e}function HQ(e){if(e instanceof iq)return e;if(e.length===0)throw Error(`items must be non-empty`);if(Array.isArray(e[0])){if(e.some(t=>t.length!==e[0].length))throw Error(`Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' and/or 'truncation=True' to have batched tensors with the same length.`);return new iq(`int64`,BigInt64Array.from(e.flat().map(e=>BigInt(e))),[e.length,e[0].length])}else return new iq(`int64`,BigInt64Array.from(e.map(e=>BigInt(e))),[1,e.length])}function UQ(e){return new iq(`bool`,[e],[1])}var WQ={EncoderOnly:0,EncoderDecoder:1,Seq2Seq:2,Vision2Seq:3,DecoderOnly:4,DecoderOnlyWithoutHead:5,MaskGeneration:6,ImageTextToText:7,Musicgen:8,MultiModality:9,Phi3V:10,AudioTextToText:11,AutoEncoder:12,ImageAudioTextToText:13,Supertonic:14,Chatterbox:15},GQ={[WQ.DecoderOnly]:{can_generate:!0,forward:QQ,prepare_inputs:i$},[WQ.DecoderOnlyWithoutHead]:{can_generate:!1,forward:QQ,prepare_inputs:i$},[WQ.Seq2Seq]:{can_generate:!0,forward:YQ,prepare_inputs:a$},[WQ.Vision2Seq]:{can_generate:!0,forward:YQ,prepare_inputs:a$},[WQ.Musicgen]:{can_generate:!0,forward:YQ},[WQ.EncoderDecoder]:{can_generate:!1,forward:YQ},[WQ.ImageTextToText]:{can_generate:!0,forward:t$,prepare_inputs:o$},[WQ.AudioTextToText]:{can_generate:!0,forward:e$,prepare_inputs:o$},[WQ.Phi3V]:{can_generate:!0,prepare_inputs:o$},[WQ.ImageAudioTextToText]:{can_generate:!0,prepare_inputs:o$},[WQ.MultiModality]:{can_generate:!0},[WQ.AutoEncoder]:{can_generate:!1,forward:ZQ},[WQ.Chatterbox]:{can_generate:!0,forward:XQ},default:{can_generate:!1,forward:XQ}},KQ=new Map,qQ=new Map,JQ=new Map,$=class extends DG{main_input_name=`input_ids`;forward_params=[`input_ids`,`attention_mask`];_return_dict_in_generate_keys=null;constructor(e,t,n){super(),this.config=e,this.sessions=t,this.configs=n;let r=JQ.get(this.constructor),i=GQ[KQ.get(r)]??GQ.default;this.can_generate=i.can_generate,this._forward=i.forward,this._prepare_inputs_for_generation=i.prepare_inputs,this.can_generate&&this.forward_params.push(`past_key_values`),this.custom_config=this.config[`transformers.js_config`]??{}}async dispose(){let e=[];for(let t of Object.values(this.sessions))e.push(t.release?.());return await Promise.all(e)}static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`,model_file_name:o=null,subfolder:s=`onnx`,device:c=null,dtype:l=null,use_external_data_format:u=null,session_options:d={}}={}){let f={progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a,model_file_name:o,subfolder:s,device:c,dtype:l,use_external_data_format:u,session_options:d},p=JQ.get(this),m=KQ.get(p);n=f.config=await tQ.from_pretrained(e,f);let h;if(m===WQ.DecoderOnly)h=await Promise.all([aQ(e,{model:f.model_file_name??`model`},f,`model`),u$(e,{generation_config:`generation_config.json`},f)]);else if(m===WQ.Seq2Seq||m===WQ.Vision2Seq)h=await Promise.all([aQ(e,{model:`encoder_model`,decoder_model_merged:`decoder_model_merged`},f,`decoder_model_merged`),u$(e,{generation_config:`generation_config.json`},f)]);else if(m===WQ.MaskGeneration)h=await Promise.all([aQ(e,{model:`vision_encoder`,prompt_encoder_mask_decoder:`prompt_encoder_mask_decoder`},f)]);else if(m===WQ.EncoderDecoder)h=await Promise.all([aQ(e,{model:`encoder_model`,decoder_model_merged:`decoder_model_merged`},f,`decoder_model_merged`)]);else if(m===WQ.ImageTextToText){let t={embed_tokens:`embed_tokens`,vision_encoder:`vision_encoder`,decoder_model_merged:`decoder_model_merged`};n.is_encoder_decoder&&(t.model=`encoder_model`),h=await Promise.all([aQ(e,t,f,`decoder_model_merged`),u$(e,{generation_config:`generation_config.json`},f)])}else if(m===WQ.AudioTextToText)h=await Promise.all([aQ(e,{embed_tokens:`embed_tokens`,audio_encoder:`audio_encoder`,decoder_model_merged:`decoder_model_merged`},f,`decoder_model_merged`),u$(e,{generation_config:`generation_config.json`},f)]);else if(m===WQ.ImageAudioTextToText)h=await Promise.all([aQ(e,{embed_tokens:`embed_tokens`,audio_encoder:`audio_encoder`,vision_encoder:`vision_encoder`,decoder_model_merged:`decoder_model_merged`},f),u$(e,{generation_config:`generation_config.json`},f)]);else if(m===WQ.Musicgen)h=await Promise.all([aQ(e,{model:`text_encoder`,decoder_model_merged:`decoder_model_merged`,encodec_decode:`encodec_decode`},f,`decoder_model_merged`),u$(e,{generation_config:`generation_config.json`},f)]);else if(m===WQ.MultiModality)h=await Promise.all([aQ(e,{prepare_inputs_embeds:`prepare_inputs_embeds`,model:`language_model`,lm_head:`lm_head`,gen_head:`gen_head`,gen_img_embeds:`gen_img_embeds`,image_decode:`image_decode`},f,`model`),u$(e,{generation_config:`generation_config.json`},f)]);else if(m===WQ.Phi3V)h=await Promise.all([aQ(e,{prepare_inputs_embeds:`prepare_inputs_embeds`,model:`model`,vision_encoder:`vision_encoder`},f,`model`),u$(e,{generation_config:`generation_config.json`},f)]);else if(m===WQ.Chatterbox)h=await Promise.all([aQ(e,{embed_tokens:`embed_tokens`,speech_encoder:`speech_encoder`,model:`language_model`,conditional_decoder:`conditional_decoder`},f,`model`),u$(e,{generation_config:`generation_config.json`},f)]);else if(m===WQ.AutoEncoder)h=await Promise.all([aQ(e,{encoder_model:`encoder_model`,decoder_model:`decoder_model`},f)]);else if(m===WQ.Supertonic)h=await Promise.all([aQ(e,{text_encoder:`text_encoder`,latent_denoiser:`latent_denoiser`,voice_decoder:`voice_decoder`},f)]);else{if(m===void 0){let e=p??n?.model_type;e!==`custom`&&console.warn(`Model type for '${e}' not found, assuming encoder-only architecture. Please report this at ${zJ}.`)}h=await Promise.all([aQ(e,{model:f.model_file_name??`model`},f)])}return new this(n,...h)}async _call(e){return await this.forward(e)}async forward(e){return await this._forward(this,e)}get generation_config(){return this.configs?.generation_config??null}_get_logits_processor(e,t,n=null){let r=new vQ;if(e.repetition_penalty!==null&&e.repetition_penalty!==1&&r.push(new wQ(e.repetition_penalty)),e.no_repeat_ngram_size!==null&&e.no_repeat_ngram_size>0&&r.push(new CQ(e.no_repeat_ngram_size)),e.bad_words_ids!==null&&r.push(new DQ(e.bad_words_ids,e.eos_token_id)),e.min_length!==null&&e.eos_token_id!==null&&e.min_length>0&&r.push(new TQ(e.min_length,e.eos_token_id)),e.min_new_tokens!==null&&e.eos_token_id!==null&&e.min_new_tokens>0&&r.push(new EQ(t,e.min_new_tokens,e.eos_token_id)),e.forced_bos_token_id!==null&&r.push(new yQ(e.forced_bos_token_id)),e.forced_eos_token_id!==null&&r.push(new bQ(e.max_length,e.forced_eos_token_id)),e.begin_suppress_tokens!==null){let n=t>1||e.forced_bos_token_id===null?t:t+1;r.push(new xQ(e.begin_suppress_tokens,n))}return e.guidance_scale!==null&&e.guidance_scale>1&&r.push(new OQ(e.guidance_scale)),e.temperature===0&&e.do_sample&&(console.warn("`do_sample` changed to false because `temperature: 0` implies greedy sampling (always selecting the most likely token), which is incompatible with `do_sample: true`."),e.do_sample=!1),e.do_sample&&e.temperature!==null&&e.temperature!==1&&r.push(new kQ(e.temperature)),n!==null&&r.extend(n),r}_prepare_generation_config(e,t,n=AQ){let r={...this.config};for(let e of[`decoder`,`generator`,`text_config`])e in r&&Object.assign(r,r[e]);let i=new n(r);return Object.assign(i,this.generation_config??{}),e&&Object.assign(i,e),t&&Object.assign(i,FG(t,Object.getOwnPropertyNames(i))),i}_get_stopping_criteria(e,t=null){let n=new MQ;return e.max_length!==null&&n.push(new NQ(e.max_length,this.config.max_position_embeddings??null)),e.eos_token_id!==null&&n.push(new PQ(e.eos_token_id)),t&&n.extend(t),n}_validate_model_class(){if(!this.can_generate){let e=[BQ.MODEL_FOR_CAUSAL_LM_MAPPING_NAMES,BQ.MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES,BQ.MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES,BQ.MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES].filter(Boolean),t=JQ.get(this.constructor),n=new Set,r=this.config.model_type;for(let t of e){let e=t?.get(r);e&&n.add(e)}let i=`The current model class (${t}) is not compatible with \`.generate()\`, as it doesn't have a language model head.`;throw n.size>0&&(i+=` Please use the following class instead: ${[...n].join(`, `)}`),Error(i)}}prepare_inputs_for_generation(...e){if(!this._prepare_inputs_for_generation)throw Error(`prepare_inputs_for_generation is not implemented for this model.`);return this._prepare_inputs_for_generation(this,...e)}_update_model_kwargs_for_generation({generated_input_ids:e,outputs:t,model_inputs:n,is_encoder_decoder:r}){return n.past_key_values=this.getPastKeyValues(t,n.past_key_values),n.input_ids=new iq(`int64`,e.flat(),[e.length,1]),r?`decoder_attention_mask`in n:n.attention_mask=_q([n.attention_mask,Eq([n.attention_mask.dims[0],1])],1),n.position_ids=null,n}_prepare_model_inputs({inputs:e,bos_token_id:t,model_kwargs:n}){let r=FG(n,this.forward_params),i=this.main_input_name;if(i in r){if(e)throw Error("`inputs`: {inputs}` were passed alongside {input_name} which is not allowed. Make sure to either pass {inputs} or {input_name}=...")}else r[i]=e;return{inputs_tensor:r[i],model_inputs:r,model_input_name:i}}async _prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:e,model_inputs:t,model_input_name:n,generation_config:r}){if(this.sessions.model.inputNames.includes(`inputs_embeds`)&&!t.inputs_embeds&&`_prepare_inputs_embeds`in this){let{input_ids:e,pixel_values:n,attention_mask:r,...i}=t,a=await this._prepare_inputs_embeds(t);t={...i,...FG(a,[`inputs_embeds`,`attention_mask`])}}let{last_hidden_state:i}=await XQ(this,t);if(r.guidance_scale!==null&&r.guidance_scale>1)i=_q([i,Tq(i,0)],0),`attention_mask`in t&&(t.attention_mask=_q([t.attention_mask,kq(t.attention_mask)],0));else if(t.decoder_input_ids){let e=HQ(t.decoder_input_ids).dims[0];if(e!==i.dims[0]){if(i.dims[0]!==1)throw Error(`The encoder outputs have a different batch size (${i.dims[0]}) than the decoder inputs (${e}).`);i=_q(Array.from({length:e},()=>i),0)}}return t.encoder_outputs=i,t}_prepare_decoder_input_ids_for_generation({batch_size:e,model_input_name:t,model_kwargs:n,decoder_start_token_id:r,bos_token_id:i,generation_config:a}){let{decoder_input_ids:o,...s}=n;if(!(o instanceof iq)){if(o)Array.isArray(o[0])||(o=Array.from({length:e},()=>o));else if(r??=i,this.config.model_type===`musicgen`)o=Array.from({length:e*this.config.decoder.num_codebooks},()=>[r]);else if(Array.isArray(r)){if(r.length!==e)throw Error(`\`decoder_start_token_id\` expcted to have length ${e} but got ${r.length}`);o=r}else o=Array.from({length:e},()=>[r]);o=HQ(o)}return n.decoder_attention_mask=Dq(o),{input_ids:o,model_inputs:s}}async generate({inputs:e=null,generation_config:t=null,logits_processor:n=null,stopping_criteria:r=null,streamer:i=null,...a}){this._validate_model_class(),t=this._prepare_generation_config(t,a);let{inputs_tensor:o,model_inputs:s,model_input_name:c}=this._prepare_model_inputs({inputs:e,model_kwargs:a}),l=this.config.is_encoder_decoder;l&&(`encoder_outputs`in s||(s=await this._prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:o,model_inputs:s,model_input_name:c,generation_config:t})));let u;l?{input_ids:u,model_inputs:s}=this._prepare_decoder_input_ids_for_generation({batch_size:s[c].dims.at(0),model_input_name:c,model_kwargs:s,decoder_start_token_id:t.decoder_start_token_id,bos_token_id:t.bos_token_id,generation_config:t}):u=s[c];let d=u.dims.at(-1);t.max_new_tokens!==null&&(t.max_length=d+t.max_new_tokens);let f=this._get_logits_processor(t,d,n),p=this._get_stopping_criteria(t,r),m=s[c].dims.at(0),h=IQ.getSampler(t),g=Array(m).fill(0),_=u.tolist();i&&i.put(_);let v,y={},b={};for(;;){if(s=this.prepare_inputs_for_generation(_,s,t),v=await this.forward(s),t.return_dict_in_generate)if(t.output_attentions){let e=this.getAttentions(v);for(let t in e)t in y||(y[t]=[]),y[t].push(e[t])}else this._return_dict_in_generate_keys&&Object.assign(b,FG(v,this._return_dict_in_generate_keys));let e=f(_,v.logits.slice(null,-1,null).to(`float32`)),n=[];for(let t=0;te))break;s=this._update_model_kwargs_for_generation({generated_input_ids:n,outputs:v,model_inputs:s,is_encoder_decoder:l})}i&&i.end();let x=this.getPastKeyValues(v,s.past_key_values,!0),S=new iq(`int64`,_.flat(),[_.length,_[0].length]);if(t.return_dict_in_generate)return{sequences:S,past_key_values:x,...y,...b};for(let e of Object.values(v))e.location===`gpu-buffer`&&e.dispose();return S}getPastKeyValues(e,t,n=!1){let r=Object.create(null);for(let i in e)if(i.startsWith(`present`)){let a=i.replace(`present_ssm`,`past_ssm`).replace(`present_conv`,`past_conv`).replace(`present`,`past_key_values`),o=i.includes(`encoder`);if(o&&t?r[a]=t[a]:r[a]=e[i],t&&(!o||n)){let e=t[a];e.location===`gpu-buffer`&&e.dispose()}}return r}getAttentions(e){let t={};for(let n of[`cross_attentions`,`encoder_attentions`,`decoder_attentions`])for(let r in e)r.startsWith(n)&&(n in t||(t[n]=[]),t[n].push(e[r]));return t}addPastKeyValues(e,t){if(t)Object.assign(e,t);else{let t=this.sessions.decoder_model_merged??this.sessions.model,n=(e[this.main_input_name]??e.attention_mask)?.dims?.[0]??1,r=t?.config?.kv_cache_dtype??`float32`,i=r===`float16`?rq.float16:rq.float32,a=QZ(this.config,{batch_size:n});for(let t in a)e[t]=new iq(r,new i(a[t].reduce((e,t)=>e*t,1)),a[t])}}async encode_image({pixel_values:e}){return(await sQ(this.sessions.vision_encoder,{pixel_values:e})).image_features}async encode_text({input_ids:e}){return(await sQ(this.sessions.embed_tokens,{input_ids:e})).inputs_embeds}async encode_audio({audio_values:e}){return(await sQ(this.sessions.audio_encoder,{audio_values:e})).audio_features}};async function YQ(e,t){let{encoder_outputs:n,input_ids:r,decoder_input_ids:i,...a}=t;return n||=(await XQ(e,FG(t,e.sessions.model.inputNames))).last_hidden_state,a.input_ids=i,a.encoder_hidden_states=n,e.sessions.decoder_model_merged.inputNames.includes(`encoder_attention_mask`)&&(a.encoder_attention_mask=t.attention_mask),await QQ(e,a,!0)}async function XQ(e,t){let n=e.sessions.model,r=FG(t,n.inputNames);if(n.inputNames.includes(`inputs_embeds`)&&!r.inputs_embeds){if(!t.input_ids)throw Error("Both `input_ids` and `inputs_embeds` are missing in the model inputs.");r.inputs_embeds=await e.encode_text({input_ids:t.input_ids})}if(n.inputNames.includes(`token_type_ids`)&&!r.token_type_ids){if(!r.input_ids)throw Error("Both `input_ids` and `token_type_ids` are missing in the model inputs.");r.token_type_ids=kq(r.input_ids)}if(n.inputNames.includes(`pixel_mask`)&&!r.pixel_mask){if(!r.pixel_values)throw Error("Both `pixel_values` and `pixel_mask` are missing in the model inputs.");let e=r.pixel_values.dims;r.pixel_mask=Eq([e[0],e[2],e[3]])}return await sQ(n,r)}async function ZQ(e,t){let n=await e.encode(t);return await e.decode(n)}async function QQ(e,t,n=!1){let r=e.sessions[n?`decoder_model_merged`:`model`],{past_key_values:i,...a}=t;return r.inputNames.includes(`use_cache_branch`)&&(a.use_cache_branch=UQ(!!i)),r.inputNames.includes(`position_ids`)&&a.attention_mask&&!a.position_ids&&(a.position_ids=r$(a,i,[`paligemma`,`gemma3_text`,`gemma3`].includes(e.config.model_type)?1:0)),e.addPastKeyValues(a,i),await sQ(r,FG(a,r.inputNames))}async function $Q(e,{encode_function:t,merge_function:n,modality_input_name:r,modality_output_name:i,input_ids:a=null,attention_mask:o=null,position_ids:s=null,inputs_embeds:c=null,past_key_values:l=null,generation_config:u=null,logits_processor:d=null,...f}){let p=f[r];if(!c){if(c=await e.encode_text({input_ids:a,...f}),p&&a.dims[1]!==1){let e=await t({[r]:p,...f});({inputs_embeds:c,attention_mask:o}=n({[i]:e,inputs_embeds:c,input_ids:a,attention_mask:o}))}else if(l&&p&&a.dims[1]===1){let e=a.dims[1],t=Object.values(l)[0].dims.at(-2);o=_q([Eq([a.dims[0],t]),o.slice(null,[o.dims[1]-e,o.dims[1]])],1)}}if(!s&&e.config.model_type===`qwen2_vl`){let{image_grid_thw:t,video_grid_thw:n}=f;[s]=e.get_rope_index(a,t,n,o)}return await QQ(e,{inputs_embeds:c,past_key_values:l,attention_mask:o,position_ids:s,generation_config:u,logits_processor:d},!0)}async function e$(e,t){return await $Q(e,{...t,modality_input_name:`audio_values`,modality_output_name:`audio_features`,encode_function:e.encode_audio.bind(e),merge_function:e._merge_input_ids_with_audio_features.bind(e)})}async function t$(e,t){return await $Q(e,{...t,modality_input_name:`pixel_values`,modality_output_name:`image_features`,encode_function:e.encode_image.bind(e),merge_function:e._merge_input_ids_with_image_features.bind(e)})}function n$(e,t=0){let[n,r]=e.dims,i=e.data,a=new BigInt64Array(i.length);for(let e=0;ee.dims[1]||i[e.at(-1)])),{...n,decoder_input_ids:HQ(t)}}function o$(e,...t){return e.config.is_encoder_decoder?a$(e,...t):i$(e,...t)}function s$({modality_token_id:e,inputs_embeds:t,modality_features:n,input_ids:r,attention_mask:i}){let a=r.tolist().map(t=>t.reduce((t,n,r)=>(n==e&&t.push(r),t),[])),o=a.reduce((e,t)=>e+t.length,0),s=n.dims[0];if(o!==s)throw Error(`Number of tokens and features do not match: tokens: ${o}, features ${s}`);let c=0;for(let e=0;e[r,await rK(e,t[r],!1,n)])))}var d$={};GV(d$,{ASTForAudioClassification:()=>w$,ASTModel:()=>C$,ASTPreTrainedModel:()=>S$,AlbertForMaskedLM:()=>h$,AlbertForQuestionAnswering:()=>hte,AlbertForSequenceClassification:()=>m$,AlbertModel:()=>p$,AlbertPreTrainedModel:()=>f$,ApertusForCausalLM:()=>v$,ApertusModel:()=>_$,ApertusPreTrainedModel:()=>g$,ArceeForCausalLM:()=>x$,ArceeModel:()=>b$,ArceePreTrainedModel:()=>y$,BartForConditionalGeneration:()=>D$,BartForSequenceClassification:()=>O$,BartModel:()=>E$,BartPretrainedModel:()=>T$,BeitForImageClassification:()=>j$,BeitModel:()=>A$,BeitPreTrainedModel:()=>k$,BertForMaskedLM:()=>P$,BertForQuestionAnswering:()=>L$,BertForSequenceClassification:()=>F$,BertForTokenClassification:()=>I$,BertModel:()=>N$,BertPreTrainedModel:()=>M$,BlenderbotForConditionalGeneration:()=>B$,BlenderbotModel:()=>z$,BlenderbotPreTrainedModel:()=>R$,BlenderbotSmallForConditionalGeneration:()=>U$,BlenderbotSmallModel:()=>H$,BlenderbotSmallPreTrainedModel:()=>V$,BloomForCausalLM:()=>K$,BloomModel:()=>G$,BloomPreTrainedModel:()=>W$,CLIPModel:()=>u1,CLIPPreTrainedModel:()=>l1,CLIPSegForImageSegmentation:()=>_1,CLIPSegModel:()=>g1,CLIPSegPreTrainedModel:()=>h1,CLIPTextModel:()=>d1,CLIPTextModelWithProjection:()=>f1,CLIPVisionModel:()=>p1,CLIPVisionModelWithProjection:()=>m1,CamembertForMaskedLM:()=>Y$,CamembertForQuestionAnswering:()=>Q$,CamembertForSequenceClassification:()=>X$,CamembertForTokenClassification:()=>Z$,CamembertModel:()=>J$,CamembertPreTrainedModel:()=>q$,ChatterboxModel:()=>n1,ChatterboxPreTrainedModel:()=>t1,ChineseCLIPModel:()=>i1,ChineseCLIPPreTrainedModel:()=>r1,ClapAudioModelWithProjection:()=>c1,ClapModel:()=>o1,ClapPreTrainedModel:()=>a1,ClapTextModelWithProjection:()=>s1,CodeGenForCausalLM:()=>b1,CodeGenModel:()=>y1,CodeGenPreTrainedModel:()=>v1,CohereForCausalLM:()=>C1,CohereModel:()=>S1,CoherePreTrainedModel:()=>x1,ConvBertForMaskedLM:()=>E1,ConvBertForQuestionAnswering:()=>k1,ConvBertForSequenceClassification:()=>D1,ConvBertForTokenClassification:()=>O1,ConvBertModel:()=>T1,ConvBertPreTrainedModel:()=>w1,ConvNextForImageClassification:()=>M1,ConvNextModel:()=>j1,ConvNextPreTrainedModel:()=>A1,ConvNextV2ForImageClassification:()=>F1,ConvNextV2Model:()=>P1,ConvNextV2PreTrainedModel:()=>N1,DFineForObjectDetection:()=>H1,DFineModel:()=>V1,DFinePreTrainedModel:()=>B1,DINOv3ConvNextModel:()=>k0,DINOv3ConvNextPreTrainedModel:()=>O0,DINOv3ViTModel:()=>j0,DINOv3ViTPreTrainedModel:()=>A0,DPTForDepthEstimation:()=>H0,DPTModel:()=>V0,DPTPreTrainedModel:()=>B0,DacDecoderModel:()=>J1,DacDecoderOutput:()=>W1,DacEncoderModel:()=>q1,DacEncoderOutput:()=>U1,DacModel:()=>K1,DacPreTrainedModel:()=>G1,DebertaForMaskedLM:()=>Z1,DebertaForQuestionAnswering:()=>e0,DebertaForSequenceClassification:()=>Q1,DebertaForTokenClassification:()=>$1,DebertaModel:()=>X1,DebertaPreTrainedModel:()=>Y1,DebertaV2ForMaskedLM:()=>r0,DebertaV2ForQuestionAnswering:()=>o0,DebertaV2ForSequenceClassification:()=>i0,DebertaV2ForTokenClassification:()=>a0,DebertaV2Model:()=>n0,DebertaV2PreTrainedModel:()=>t0,DecisionTransformerModel:()=>c0,DecisionTransformerPreTrainedModel:()=>s0,DeiTForImageClassification:()=>d0,DeiTModel:()=>u0,DeiTPreTrainedModel:()=>l0,DepthAnythingForDepthEstimation:()=>p0,DepthAnythingPreTrainedModel:()=>f0,DepthProForDepthEstimation:()=>h0,DepthProPreTrainedModel:()=>m0,DetrForObjectDetection:()=>v0,DetrForSegmentation:()=>y0,DetrModel:()=>_0,DetrObjectDetectionOutput:()=>b0,DetrPreTrainedModel:()=>g0,DetrSegmentationOutput:()=>x0,Dinov2ForImageClassification:()=>w0,Dinov2Model:()=>C0,Dinov2PreTrainedModel:()=>S0,Dinov2WithRegistersForImageClassification:()=>D0,Dinov2WithRegistersModel:()=>E0,Dinov2WithRegistersPreTrainedModel:()=>T0,DistilBertForMaskedLM:()=>L0,DistilBertForQuestionAnswering:()=>I0,DistilBertForSequenceClassification:()=>P0,DistilBertForTokenClassification:()=>F0,DistilBertModel:()=>N0,DistilBertPreTrainedModel:()=>M0,DonutSwinModel:()=>z0,DonutSwinPreTrainedModel:()=>R0,EdgeTamModel:()=>E5,EfficientNetForImageClassification:()=>G0,EfficientNetModel:()=>W0,EfficientNetPreTrainedModel:()=>U0,ElectraForMaskedLM:()=>J0,ElectraForQuestionAnswering:()=>Z0,ElectraForSequenceClassification:()=>Y0,ElectraForTokenClassification:()=>X0,ElectraModel:()=>q0,ElectraPreTrainedModel:()=>K0,Ernie4_5ForCausalLM:()=>e2,Ernie4_5Model:()=>$0,Ernie4_5PretrainedModel:()=>Q0,EsmForMaskedLM:()=>r2,EsmForSequenceClassification:()=>i2,EsmForTokenClassification:()=>a2,EsmModel:()=>n2,EsmPreTrainedModel:()=>t2,ExaoneForCausalLM:()=>c2,ExaoneModel:()=>s2,ExaonePreTrainedModel:()=>o2,FalconForCausalLM:()=>d2,FalconH1ForCausalLM:()=>m2,FalconH1Model:()=>p2,FalconH1PreTrainedModel:()=>f2,FalconModel:()=>u2,FalconPreTrainedModel:()=>l2,FastViTForImageClassification:()=>_2,FastViTModel:()=>g2,FastViTPreTrainedModel:()=>h2,Florence2ForConditionalGeneration:()=>y2,Florence2PreTrainedModel:()=>v2,GLPNForDepthEstimation:()=>I2,GLPNModel:()=>F2,GLPNPreTrainedModel:()=>P2,GPT2LMHeadModel:()=>Z2,GPT2Model:()=>X2,GPT2PreTrainedModel:()=>Y2,GPTBigCodeForCausalLM:()=>z2,GPTBigCodeModel:()=>R2,GPTBigCodePreTrainedModel:()=>L2,GPTJForCausalLM:()=>e4,GPTJModel:()=>$2,GPTJPreTrainedModel:()=>Q2,GPTNeoForCausalLM:()=>H2,GPTNeoModel:()=>V2,GPTNeoPreTrainedModel:()=>B2,GPTNeoXForCausalLM:()=>G2,GPTNeoXModel:()=>W2,GPTNeoXPreTrainedModel:()=>U2,Gemma2ForCausalLM:()=>T2,Gemma2Model:()=>w2,Gemma2PreTrainedModel:()=>C2,Gemma3ForCausalLM:()=>O2,Gemma3Model:()=>D2,Gemma3PreTrainedModel:()=>E2,Gemma3nForConditionalGeneration:()=>A2,Gemma3nPreTrainedModel:()=>k2,GemmaForCausalLM:()=>S2,GemmaModel:()=>x2,GemmaPreTrainedModel:()=>b2,GlmForCausalLM:()=>N2,GlmModel:()=>M2,GlmPreTrainedModel:()=>j2,GptOssForCausalLM:()=>J2,GptOssModel:()=>q2,GptOssPreTrainedModel:()=>K2,GraniteForCausalLM:()=>r4,GraniteModel:()=>n4,GraniteMoeHybridForCausalLM:()=>o4,GraniteMoeHybridModel:()=>a4,GraniteMoeHybridPreTrainedModel:()=>i4,GranitePreTrainedModel:()=>t4,GroundingDinoForObjectDetection:()=>c4,GroundingDinoPreTrainedModel:()=>s4,GroupViTModel:()=>u4,GroupViTPreTrainedModel:()=>l4,HeliumForCausalLM:()=>p4,HeliumModel:()=>f4,HeliumPreTrainedModel:()=>d4,HieraForImageClassification:()=>g4,HieraModel:()=>h4,HieraPreTrainedModel:()=>m4,HubertForCTC:()=>w4,HubertForSequenceClassification:()=>T4,HubertModel:()=>C4,HubertPreTrainedModel:()=>S4,HunYuanDenseV1ForCausalLM:()=>O4,HunYuanDenseV1Model:()=>D4,HunYuanDenseV1PreTrainedModel:()=>E4,IJepaForImageClassification:()=>P4,IJepaModel:()=>N4,IJepaPreTrainedModel:()=>M4,Idefics3ForConditionalGeneration:()=>A4,Idefics3PreTrainedModel:()=>k4,JAISLMHeadModel:()=>L4,JAISModel:()=>I4,JAISPreTrainedModel:()=>F4,JinaCLIPModel:()=>z4,JinaCLIPPreTrainedModel:()=>R4,JinaCLIPTextModel:()=>B4,JinaCLIPVisionModel:()=>V4,Lfm2ForCausalLM:()=>W4,Lfm2Model:()=>U4,Lfm2MoeForCausalLM:()=>q4,Lfm2MoeModel:()=>K4,Lfm2MoePreTrainedModel:()=>G4,Lfm2PreTrainedModel:()=>H4,LiteWhisperForConditionalGeneration:()=>Bte,Llama4ForCausalLM:()=>Q4,Llama4PreTrainedModel:()=>Z4,LlamaForCausalLM:()=>X4,LlamaModel:()=>Y4,LlamaPreTrainedModel:()=>J4,LlavaForConditionalGeneration:()=>e3,LlavaOnevisionForConditionalGeneration:()=>e3,LlavaPreTrainedModel:()=>$4,LlavaQwen2ForCausalLM:()=>n3,LongT5ForConditionalGeneration:()=>a3,LongT5Model:()=>i3,LongT5PreTrainedModel:()=>r3,M2M100ForConditionalGeneration:()=>c3,M2M100Model:()=>s3,M2M100PreTrainedModel:()=>o3,MBartForCausalLM:()=>y3,MBartForConditionalGeneration:()=>_3,MBartForSequenceClassification:()=>v3,MBartModel:()=>g3,MBartPreTrainedModel:()=>h3,MPNetForMaskedLM:()=>T6,MPNetForQuestionAnswering:()=>O6,MPNetForSequenceClassification:()=>E6,MPNetForTokenClassification:()=>D6,MPNetModel:()=>w6,MPNetPreTrainedModel:()=>C6,MT5ForConditionalGeneration:()=>P6,MT5Model:()=>N6,MT5PreTrainedModel:()=>M6,MarianMTModel:()=>d3,MarianModel:()=>u3,MarianPreTrainedModel:()=>l3,MaskFormerForInstanceSegmentation:()=>m3,MaskFormerModel:()=>p3,MaskFormerPreTrainedModel:()=>f3,Metric3DForDepthEstimation:()=>x3,Metric3DPreTrainedModel:()=>b3,Metric3Dv2ForDepthEstimation:()=>C3,Metric3Dv2PreTrainedModel:()=>S3,MgpstrForSceneTextRecognition:()=>E3,MgpstrModelOutput:()=>w3,MgpstrPreTrainedModel:()=>T3,MimiDecoderModel:()=>M3,MimiDecoderOutput:()=>O3,MimiEncoderModel:()=>j3,MimiEncoderOutput:()=>D3,MimiModel:()=>A3,MimiPreTrainedModel:()=>k3,MistralForCausalLM:()=>F3,MistralModel:()=>P3,MistralPreTrainedModel:()=>N3,MobileBertForMaskedLM:()=>R3,MobileBertForQuestionAnswering:()=>B3,MobileBertForSequenceClassification:()=>z3,MobileBertModel:()=>L3,MobileBertPreTrainedModel:()=>I3,MobileLLMForCausalLM:()=>U3,MobileLLMModel:()=>H3,MobileLLMPreTrainedModel:()=>V3,MobileNetV1ForImageClassification:()=>K3,MobileNetV1ForSemanticSegmentation:()=>q3,MobileNetV1Model:()=>G3,MobileNetV1PreTrainedModel:()=>W3,MobileNetV2ForImageClassification:()=>X3,MobileNetV2ForSemanticSegmentation:()=>Z3,MobileNetV2Model:()=>Y3,MobileNetV2PreTrainedModel:()=>J3,MobileNetV3ForImageClassification:()=>e6,MobileNetV3ForSemanticSegmentation:()=>t6,MobileNetV3Model:()=>$3,MobileNetV3PreTrainedModel:()=>Q3,MobileNetV4ForImageClassification:()=>i6,MobileNetV4ForSemanticSegmentation:()=>a6,MobileNetV4Model:()=>r6,MobileNetV4PreTrainedModel:()=>n6,MobileViTForImageClassification:()=>c6,MobileViTModel:()=>s6,MobileViTPreTrainedModel:()=>o6,MobileViTV2ForImageClassification:()=>d6,MobileViTV2Model:()=>u6,MobileViTV2PreTrainedModel:()=>l6,ModernBertDecoderForCausalLM:()=>y6,ModernBertDecoderModel:()=>v6,ModernBertDecoderPreTrainedModel:()=>_6,ModernBertForMaskedLM:()=>m6,ModernBertForSequenceClassification:()=>h6,ModernBertForTokenClassification:()=>g6,ModernBertModel:()=>p6,ModernBertPreTrainedModel:()=>f6,Moondream1ForConditionalGeneration:()=>t3,MoonshineForConditionalGeneration:()=>S6,MoonshineModel:()=>x6,MoonshinePreTrainedModel:()=>b6,MptForCausalLM:()=>j6,MptModel:()=>A6,MptPreTrainedModel:()=>k6,MultiModalityCausalLM:()=>I6,MultiModalityPreTrainedModel:()=>F6,MusicgenForCausalLM:()=>z6,MusicgenForConditionalGeneration:()=>B6,MusicgenModel:()=>R6,MusicgenPreTrainedModel:()=>L6,NanoChatForCausalLM:()=>U6,NanoChatModel:()=>H6,NanoChatPreTrainedModel:()=>V6,NeoBertForMaskedLM:()=>K6,NeoBertForQuestionAnswering:()=>Y6,NeoBertForSequenceClassification:()=>q6,NeoBertForTokenClassification:()=>J6,NeoBertModel:()=>G6,NeoBertPreTrainedModel:()=>W6,NomicBertModel:()=>Z6,NomicBertPreTrainedModel:()=>X6,OPTForCausalLM:()=>f8,OPTModel:()=>d8,OPTPreTrainedModel:()=>u8,Olmo2ForCausalLM:()=>r8,Olmo2Model:()=>n8,Olmo2PreTrainedModel:()=>t8,Olmo3ForCausalLM:()=>o8,Olmo3Model:()=>a8,Olmo3PreTrainedModel:()=>i8,OlmoForCausalLM:()=>e8,OlmoModel:()=>$6,OlmoPreTrainedModel:()=>Q6,OpenELMForCausalLM:()=>l8,OpenELMModel:()=>c8,OpenELMPreTrainedModel:()=>s8,OwlViTForObjectDetection:()=>v8,OwlViTModel:()=>_8,OwlViTPreTrainedModel:()=>g8,Owlv2ForObjectDetection:()=>h8,Owlv2Model:()=>m8,Owlv2PreTrainedModel:()=>p8,PaliGemmaForConditionalGeneration:()=>b8,PaliGemmaPreTrainedModel:()=>y8,ParakeetForCTC:()=>S8,ParakeetPreTrainedModel:()=>x8,PatchTSMixerForPrediction:()=>T8,PatchTSMixerModel:()=>w8,PatchTSMixerPreTrainedModel:()=>C8,PatchTSTForPrediction:()=>O8,PatchTSTModel:()=>D8,PatchTSTPreTrainedModel:()=>E8,Phi3ForCausalLM:()=>P8,Phi3Model:()=>N8,Phi3PreTrainedModel:()=>M8,Phi3VForCausalLM:()=>I8,Phi3VPreTrainedModel:()=>F8,PhiForCausalLM:()=>j8,PhiModel:()=>A8,PhiPreTrainedModel:()=>k8,PreTrainedModel:()=>$,PvtForImageClassification:()=>z8,PvtModel:()=>R8,PvtPreTrainedModel:()=>L8,PyAnnoteForAudioFrameClassification:()=>H8,PyAnnoteModel:()=>V8,PyAnnotePreTrainedModel:()=>B8,Qwen2ForCausalLM:()=>G8,Qwen2Model:()=>W8,Qwen2PreTrainedModel:()=>U8,Qwen2VLForConditionalGeneration:()=>q8,Qwen2VLPreTrainedModel:()=>K8,Qwen3ForCausalLM:()=>X8,Qwen3Model:()=>Y8,Qwen3PreTrainedModel:()=>J8,RFDetrForObjectDetection:()=>n5,RFDetrModel:()=>t5,RFDetrObjectDetectionOutput:()=>r5,RFDetrPreTrainedModel:()=>e5,RTDetrForObjectDetection:()=>R1,RTDetrModel:()=>L1,RTDetrObjectDetectionOutput:()=>z1,RTDetrPreTrainedModel:()=>I1,RTDetrV2ForObjectDetection:()=>v5,RTDetrV2Model:()=>_5,RTDetrV2ObjectDetectionOutput:()=>y5,RTDetrV2PreTrainedModel:()=>g5,ResNetForImageClassification:()=>$8,ResNetModel:()=>Q8,ResNetPreTrainedModel:()=>Z8,RoFormerForMaskedLM:()=>f5,RoFormerForQuestionAnswering:()=>h5,RoFormerForSequenceClassification:()=>p5,RoFormerForTokenClassification:()=>m5,RoFormerModel:()=>d5,RoFormerPreTrainedModel:()=>u5,RobertaForMaskedLM:()=>o5,RobertaForQuestionAnswering:()=>l5,RobertaForSequenceClassification:()=>s5,RobertaForTokenClassification:()=>c5,RobertaModel:()=>a5,RobertaPreTrainedModel:()=>i5,Sam2ImageSegmentationOutput:()=>C5,Sam2Model:()=>T5,Sam2PreTrainedModel:()=>w5,Sam3TrackerModel:()=>D5,SamImageSegmentationOutput:()=>b5,SamModel:()=>S5,SamPreTrainedModel:()=>x5,SapiensForDepthEstimation:()=>A5,SapiensForNormalEstimation:()=>j5,SapiensForSemanticSegmentation:()=>k5,SapiensPreTrainedModel:()=>O5,SegformerForImageClassification:()=>P5,SegformerForSemanticSegmentation:()=>F5,SegformerModel:()=>N5,SegformerPreTrainedModel:()=>M5,SiglipModel:()=>L5,SiglipPreTrainedModel:()=>I5,SiglipTextModel:()=>R5,SiglipVisionModel:()=>z5,SmolLM3ForCausalLM:()=>H5,SmolLM3Model:()=>V5,SmolLM3PreTrainedModel:()=>B5,SmolVLMForConditionalGeneration:()=>j4,SnacDecoderModel:()=>K5,SnacEncoderModel:()=>G5,SnacModel:()=>W5,SnacPreTrainedModel:()=>U5,SpeechT5ForSpeechToText:()=>Y5,SpeechT5ForTextToSpeech:()=>X5,SpeechT5HifiGan:()=>Z5,SpeechT5Model:()=>J5,SpeechT5PreTrainedModel:()=>q5,SqueezeBertForMaskedLM:()=>e7,SqueezeBertForQuestionAnswering:()=>n7,SqueezeBertForSequenceClassification:()=>t7,SqueezeBertModel:()=>$5,SqueezeBertPreTrainedModel:()=>Q5,StableLmForCausalLM:()=>a7,StableLmModel:()=>i7,StableLmPreTrainedModel:()=>r7,Starcoder2ForCausalLM:()=>c7,Starcoder2Model:()=>s7,Starcoder2PreTrainedModel:()=>o7,StyleTextToSpeech2Model:()=>u7,StyleTextToSpeech2PreTrainedModel:()=>l7,SupertonicForConditionalGeneration:()=>f7,SupertonicPreTrainedModel:()=>d7,Swin2SRForImageSuperResolution:()=>y7,Swin2SRModel:()=>v7,Swin2SRPreTrainedModel:()=>_7,SwinForImageClassification:()=>h7,SwinForSemanticSegmentation:()=>g7,SwinModel:()=>m7,SwinPreTrainedModel:()=>p7,T5ForConditionalGeneration:()=>S7,T5Model:()=>x7,T5PreTrainedModel:()=>b7,TableTransformerForObjectDetection:()=>T7,TableTransformerModel:()=>w7,TableTransformerObjectDetectionOutput:()=>E7,TableTransformerPreTrainedModel:()=>C7,TrOCRForCausalLM:()=>O7,TrOCRPreTrainedModel:()=>D7,UltravoxModel:()=>A7,UltravoxPreTrainedModel:()=>k7,UniSpeechForCTC:()=>P7,UniSpeechForSequenceClassification:()=>F7,UniSpeechModel:()=>N7,UniSpeechPreTrainedModel:()=>M7,UniSpeechSatForAudioFrameClassification:()=>_te,UniSpeechSatForCTC:()=>R7,UniSpeechSatForSequenceClassification:()=>gte,UniSpeechSatModel:()=>L7,UniSpeechSatPreTrainedModel:()=>I7,VaultGemmaForCausalLM:()=>yte,VaultGemmaModel:()=>vte,VaultGemmaPreTrainedModel:()=>z7,ViTForImageClassification:()=>Ste,ViTMAEModel:()=>Cte,ViTMAEPreTrainedModel:()=>V7,ViTMSNForImageClassification:()=>Tte,ViTMSNModel:()=>wte,ViTMSNPreTrainedModel:()=>H7,ViTModel:()=>xte,ViTPreTrainedModel:()=>B7,VisionEncoderDecoderModel:()=>bte,VitMatteForImageMatting:()=>Ete,VitMattePreTrainedModel:()=>U7,VitPoseForPoseEstimation:()=>Dte,VitPosePreTrainedModel:()=>W7,VitsModel:()=>Ote,VitsModelOutput:()=>G7,VitsPreTrainedModel:()=>K7,VoxtralForConditionalGeneration:()=>j7,Wav2Vec2BertForCTC:()=>Ate,Wav2Vec2BertForSequenceClassification:()=>jte,Wav2Vec2BertModel:()=>kte,Wav2Vec2BertPreTrainedModel:()=>q7,Wav2Vec2ForAudioFrameClassification:()=>x4,Wav2Vec2ForCTC:()=>y4,Wav2Vec2ForSequenceClassification:()=>b4,Wav2Vec2Model:()=>v4,Wav2Vec2PreTrainedModel:()=>_4,WavLMForAudioFrameClassification:()=>Ite,WavLMForCTC:()=>Nte,WavLMForSequenceClassification:()=>Pte,WavLMForXVector:()=>Fte,WavLMModel:()=>Mte,WavLMPreTrainedModel:()=>Y7,WeSpeakerResNetModel:()=>Lte,WeSpeakerResNetPreTrainedModel:()=>X7,WhisperForConditionalGeneration:()=>Q7,WhisperModel:()=>zte,WhisperPreTrainedModel:()=>Z7,XLMForQuestionAnswering:()=>Gte,XLMForSequenceClassification:()=>Ute,XLMForTokenClassification:()=>Wte,XLMModel:()=>Vte,XLMPreTrainedModel:()=>$7,XLMRobertaForMaskedLM:()=>qte,XLMRobertaForQuestionAnswering:()=>Xte,XLMRobertaForSequenceClassification:()=>Jte,XLMRobertaForTokenClassification:()=>Yte,XLMRobertaModel:()=>Kte,XLMRobertaPreTrainedModel:()=>e9,XLMWithLMHeadModel:()=>Hte,XVectorOutput:()=>J7,YolosForObjectDetection:()=>Qte,YolosModel:()=>Zte,YolosObjectDetectionOutput:()=>n9,YolosPreTrainedModel:()=>t9,YoutuForCausalLM:()=>ene,YoutuModel:()=>$te,YoutuPreTrainedModel:()=>r9});var f$=class extends ${},p$=class extends f${},m$=class extends f${async _call(e){return new uQ(await super._call(e))}},hte=class extends f${async _call(e){return new pQ(await super._call(e))}},h$=class extends f${async _call(e){return new fQ(await super._call(e))}},g$=class extends ${},_$=class extends g${},v$=class extends g${},y$=class extends ${},b$=class extends y${},x$=class extends y${},S$=class extends ${},C$=class extends S${},w$=class extends S${},T$=class extends ${},E$=class extends T${},D$=class extends T${},O$=class extends T${async _call(e){return new uQ(await super._call(e))}},k$=class extends ${},A$=class extends k${},j$=class extends k${async _call(e){return new uQ(await super._call(e))}},M$=class extends ${},N$=class extends M${},P$=class extends M${async _call(e){return new fQ(await super._call(e))}},F$=class extends M${async _call(e){return new uQ(await super._call(e))}},I$=class extends M${async _call(e){return new dQ(await super._call(e))}},L$=class extends M${async _call(e){return new pQ(await super._call(e))}},R$=class extends ${},z$=class extends R${},B$=class extends R${},V$=class extends ${},H$=class extends V${},U$=class extends V${},W$=class extends ${},G$=class extends W${},K$=class extends W${},q$=class extends ${},J$=class extends q${},Y$=class extends q${async _call(e){return new fQ(await super._call(e))}},X$=class extends q${async _call(e){return new uQ(await super._call(e))}},Z$=class extends q${async _call(e){return new dQ(await super._call(e))}},Q$=class extends q${async _call(e){return new pQ(await super._call(e))}},$$=4299n,e1=6561n,t1=class extends ${forward_params=[`input_ids`,`inputs_embeds`,`attention_mask`,`position_ids`,`audio_values`,`exaggeration`,`audio_features`,`audio_tokens`,`speaker_embeddings`,`speaker_features`,`past_key_values`];main_input_name=`input_ids`;_return_dict_in_generate_keys=[`audio_tokens`,`speaker_embeddings`,`speaker_features`]},n1=class extends t1{async encode_speech(e){return sQ(this.sessions.speech_encoder,{audio_values:e})}async forward({input_ids:e=null,attention_mask:t=null,audio_values:n=null,exaggeration:r=null,position_ids:i=null,inputs_embeds:a=null,past_key_values:o=null,generation_config:s=null,logits_processor:c=null,audio_features:l=null,audio_tokens:u=null,speaker_embeddings:d=null,speaker_features:f=null,...p}){let m;if(!a){let s=this.sessions.embed_tokens.inputNames,c={input_ids:e};if(s.includes(`exaggeration`)){if(!(r instanceof iq)){let t=e.dims[0];if(r==null)r=wq([t],.5);else if(typeof r==`number`)r=wq([t],r);else if(Array.isArray(r))r=new iq(`float32`,r,[t]);else throw Error("Unsupported type for `exaggeration` input")}c.exaggeration=r}if(s.includes(`position_ids`)&&(c.position_ids=i),{inputs_embeds:a}=await sQ(this.sessions.embed_tokens,c),l&&u&&d&&f&&(m={audio_features:l,audio_tokens:u,speaker_embeddings:d,speaker_features:f}),m||n)m??=await this.encode_speech(n),a=_q([m.audio_features,a],1),t=Eq([a.dims[0],a.dims[1]]);else{let e=a.dims[1];if(!o||e!==1)throw Error(`Incorrect state encountered during generation.`);let n=Object.values(o)[0].dims.at(-2);t=Eq([a.dims[0],n+e])}}return{...await QQ(this,{inputs_embeds:a,past_key_values:o,attention_mask:t,generation_config:s,logits_processor:c},!1),...m}}prepare_inputs_for_generation(e,t,n){return!t.position_ids&&this.sessions.embed_tokens.inputNames.includes(`position_ids`)&&(t.input_ids.dims[1]===1?t.position_ids=new iq(`int64`,Array.from({length:e.length},(t,n)=>e[n].length-e[n].findLastIndex(e=>e==e1)-1),[e.length,1]):t.position_ids=new iq(`int64`,t.input_ids.tolist().map(e=>{let t=0;return e.map(e=>e>=e1?0:t++)}).flat(),t.input_ids.dims)),t.input_ids.dims[1]===1&&(delete t.audio_values,delete t.audio_features,delete t.audio_tokens,delete t.speaker_embeddings,delete t.speaker_features),i$(this,e,t,n)}async generate(e){let{sequences:t,audio_tokens:n,speaker_embeddings:r,speaker_features:i}=await super.generate({...e,return_dict_in_generate:!0}),a=t.slice(null,[e.input_ids.dims[1],-1]),o=_q([n,a,wq([a.dims[0],3],$$)],1),{waveform:s}=await sQ(this.sessions.conditional_decoder,{speech_tokens:o,speaker_features:i,speaker_embeddings:r});return s}},r1=class extends ${},i1=class extends r1{},a1=class extends ${},o1=class extends a1{},s1=class extends a1{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`text_model`})}},c1=class extends a1{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`audio_model`})}},l1=class extends ${},u1=class extends l1{},d1=class extends l1{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`text_model`})}},f1=class extends l1{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`text_model`})}},p1=class extends l1{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`vision_model`})}},m1=class extends l1{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`vision_model`})}},h1=class extends ${},g1=class extends h1{},_1=class extends h1{},v1=class extends ${},y1=class extends v1{},b1=class extends v1{},x1=class extends ${},S1=class extends x1{},C1=class extends x1{},w1=class extends ${},T1=class extends w1{},E1=class extends w1{async _call(e){return new fQ(await super._call(e))}},D1=class extends w1{async _call(e){return new uQ(await super._call(e))}},O1=class extends w1{async _call(e){return new dQ(await super._call(e))}},k1=class extends w1{async _call(e){return new pQ(await super._call(e))}},A1=class extends ${},j1=class extends A1{},M1=class extends A1{async _call(e){return new uQ(await super._call(e))}},N1=class extends ${},P1=class extends N1{},F1=class extends N1{async _call(e){return new uQ(await super._call(e))}},I1=class extends ${},L1=class extends I1{},R1=class extends I1{async _call(e){return new z1(await super._call(e))}},z1=class extends lQ{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}},B1=class extends ${},V1=class extends B1{},H1=class extends B1{async _call(e){return new z1(await super._call(e))}},U1=class extends lQ{constructor({audio_codes:e}){super(),this.audio_codes=e}},W1=class extends lQ{constructor({audio_values:e}){super(),this.audio_values=e}},G1=class extends ${main_input_name=`input_values`;forward_params=[`input_values`]},K1=class extends G1{async encode(e){return new U1(await sQ(this.sessions.encoder_model,e))}async decode(e){return new W1(await sQ(this.sessions.decoder_model,e))}},q1=class extends G1{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}},J1=class extends G1{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}},Y1=class extends ${},X1=class extends Y1{},Z1=class extends Y1{async _call(e){return new fQ(await super._call(e))}},Q1=class extends Y1{async _call(e){return new uQ(await super._call(e))}},$1=class extends Y1{async _call(e){return new dQ(await super._call(e))}},e0=class extends Y1{async _call(e){return new pQ(await super._call(e))}},t0=class extends ${},n0=class extends t0{},r0=class extends t0{async _call(e){return new fQ(await super._call(e))}},i0=class extends t0{async _call(e){return new uQ(await super._call(e))}},a0=class extends t0{async _call(e){return new dQ(await super._call(e))}},o0=class extends t0{async _call(e){return new pQ(await super._call(e))}},s0=class extends ${},c0=class extends s0{},l0=class extends ${},u0=class extends l0{},d0=class extends l0{async _call(e){return new uQ(await super._call(e))}},f0=class extends ${},p0=class extends f0{},m0=class extends ${},h0=class extends m0{},g0=class extends ${},_0=class extends g0{},v0=class extends g0{async _call(e){return new b0(await super._call(e))}},y0=class extends g0{async _call(e){return new x0(await super._call(e))}},b0=class extends lQ{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}},x0=class extends lQ{constructor({logits:e,pred_boxes:t,pred_masks:n}){super(),this.logits=e,this.pred_boxes=t,this.pred_masks=n}},S0=class extends ${},C0=class extends S0{},w0=class extends S0{async _call(e){return new uQ(await super._call(e))}},T0=class extends ${},E0=class extends T0{},D0=class extends T0{async _call(e){return new uQ(await super._call(e))}},O0=class extends ${},k0=class extends O0{},A0=class extends ${},j0=class extends A0{},M0=class extends ${},N0=class extends M0{},P0=class extends M0{async _call(e){return new uQ(await super._call(e))}},F0=class extends M0{async _call(e){return new dQ(await super._call(e))}},I0=class extends M0{async _call(e){return new pQ(await super._call(e))}},L0=class extends M0{async _call(e){return new fQ(await super._call(e))}},R0=class extends ${},z0=class extends R0{},B0=class extends ${},V0=class extends B0{},H0=class extends B0{},U0=class extends ${},W0=class extends U0{},G0=class extends U0{async _call(e){return new uQ(await super._call(e))}},K0=class extends ${},q0=class extends K0{},J0=class extends K0{async _call(e){return new fQ(await super._call(e))}},Y0=class extends K0{async _call(e){return new uQ(await super._call(e))}},X0=class extends K0{async _call(e){return new dQ(await super._call(e))}},Z0=class extends K0{async _call(e){return new pQ(await super._call(e))}},Q0=class extends ${},$0=class extends Q0{},e2=class extends Q0{},t2=class extends ${},n2=class extends t2{},r2=class extends t2{async _call(e){return new fQ(await super._call(e))}},i2=class extends t2{async _call(e){return new uQ(await super._call(e))}},a2=class extends t2{async _call(e){return new dQ(await super._call(e))}},o2=class extends ${},s2=class extends o2{},c2=class extends o2{},l2=class extends ${},u2=class extends l2{},d2=class extends l2{},f2=class extends ${},p2=class extends f2{},m2=class extends f2{},h2=class extends ${},g2=class extends h2{},_2=class extends h2{async _call(e){return new uQ(await super._call(e))}},v2=class extends ${forward_params=[`input_ids`,`inputs_embeds`,`attention_mask`,`pixel_values`,`encoder_outputs`,`decoder_input_ids`,`decoder_inputs_embeds`,`decoder_attention_mask`,`past_key_values`];main_input_name=`inputs_embeds`},y2=class extends v2{_merge_input_ids_with_image_features({inputs_embeds:e,image_features:t,input_ids:n,attention_mask:r}){return{inputs_embeds:_q([t,e],1),attention_mask:_q([Eq(t.dims.slice(0,2)),r],1)}}async _prepare_inputs_embeds({input_ids:e,pixel_values:t,inputs_embeds:n,attention_mask:r}){if(!e&&!t)throw Error("Either `input_ids` or `pixel_values` should be provided.");let i,a;return e&&(i=await this.encode_text({input_ids:e})),t&&(a=await this.encode_image({pixel_values:t})),i&&a?{inputs_embeds:n,attention_mask:r}=this._merge_input_ids_with_image_features({inputs_embeds:i,image_features:a,input_ids:e,attention_mask:r}):n=i||a,{inputs_embeds:n,attention_mask:r}}async forward({input_ids:e,pixel_values:t,attention_mask:n,decoder_input_ids:r,decoder_attention_mask:i,encoder_outputs:a,past_key_values:o,inputs_embeds:s,decoder_inputs_embeds:c}){if(s||({inputs_embeds:s,attention_mask:n}=await this._prepare_inputs_embeds({input_ids:e,pixel_values:t,inputs_embeds:s,attention_mask:n})),!a){let{last_hidden_state:e}=await XQ(this,{inputs_embeds:s,attention_mask:n});a=e}if(!c){if(!r)throw Error("Either `decoder_input_ids` or `decoder_inputs_embeds` should be provided.");c=await this.encode_text({input_ids:r})}return await QQ(this,{inputs_embeds:c,attention_mask:i,encoder_attention_mask:n,encoder_hidden_states:a,past_key_values:o},!0)}},b2=class extends ${},x2=class extends b2{},S2=class extends b2{},C2=class extends ${},w2=class extends C2{},T2=class extends C2{},E2=class extends ${},D2=class extends E2{},O2=class extends E2{},k2=class extends ${forward_params=[`input_ids`,`attention_mask`,`inputs_embeds`,`per_layer_inputs`,`position_ids`,`pixel_values`,`input_features`,`input_features_mask`,`past_key_values`]},A2=class extends k2{async forward({input_ids:e=null,attention_mask:t=null,pixel_values:n=null,input_features:r=null,input_features_mask:i=null,position_ids:a=null,inputs_embeds:o=null,per_layer_inputs:s=null,past_key_values:c=null,generation_config:l=null,logits_processor:u=null,...d}){if((!o||!s)&&({inputs_embeds:o,per_layer_inputs:s}=await sQ(this.sessions.embed_tokens,{input_ids:e}),e.dims[1]!==1)){if(n){let{image_features:r}=await sQ(this.sessions.vision_encoder,{pixel_values:n});({inputs_embeds:o,attention_mask:t}=this._merge_input_ids_with_image_features({image_features:r,inputs_embeds:o,input_ids:e,attention_mask:t}))}if(r){let{audio_features:n}=await sQ(this.sessions.audio_encoder,{input_features:r,input_features_mask:i});({inputs_embeds:o,attention_mask:t}=this._merge_input_ids_with_audio_features({audio_features:n,inputs_embeds:o,input_ids:e,attention_mask:t}))}}return await QQ(this,{inputs_embeds:o,per_layer_inputs:s,past_key_values:c,attention_mask:t,position_ids:a,generation_config:l,logits_processor:u},!0)}_merge_input_ids_with_image_features(e){let t=e.image_features.dims.at(-1),n=e.image_features.view(-1,t);return c$({image_token_id:this.config.image_token_id,...e,image_features:n})}_merge_input_ids_with_audio_features(e){let t=e.audio_features.dims.at(-1),n=e.audio_features.view(-1,t);return l$({audio_token_id:this.config.audio_token_id,...e,audio_features:n})}},j2=class extends ${},M2=class extends j2{},N2=class extends j2{},P2=class extends ${},F2=class extends P2{},I2=class extends P2{},L2=class extends ${},R2=class extends L2{},z2=class extends L2{},B2=class extends ${},V2=class extends B2{},H2=class extends B2{},U2=class extends ${},W2=class extends U2{},G2=class extends U2{},K2=class extends ${},q2=class extends K2{},J2=class extends K2{},Y2=class extends ${},X2=class extends Y2{},Z2=class extends Y2{},Q2=class extends ${},$2=class extends Q2{},e4=class extends Q2{},t4=class extends ${},n4=class extends t4{},r4=class extends t4{},i4=class extends ${},a4=class extends i4{},o4=class extends i4{},s4=class extends ${},c4=class extends s4{},l4=class extends ${},u4=class extends l4{},d4=class extends ${},f4=class extends d4{},p4=class extends d4{},m4=class extends ${},h4=class extends m4{},g4=class extends m4{async _call(e){return new uQ(await super._call(e))}},_4=class extends ${},v4=class extends _4{},y4=class extends _4{async _call(e){return new mQ(await super._call(e))}},b4=class extends _4{async _call(e){return new uQ(await super._call(e))}},x4=class extends _4{async _call(e){return new dQ(await super._call(e))}},S4=class extends ${},C4=class extends _4{},w4=class extends _4{async _call(e){return new mQ(await super._call(e))}},T4=class extends _4{async _call(e){return new uQ(await super._call(e))}},E4=class extends ${},D4=class extends E4{},O4=class extends E4{},k4=class extends ${forward_params=[`input_ids`,`attention_mask`,`pixel_values`,`pixel_attention_mask`,`position_ids`,`past_key_values`]},A4=class extends k4{async encode_image({pixel_values:e,pixel_attention_mask:t}){return(await sQ(this.sessions.vision_encoder,{pixel_values:e,pixel_attention_mask:t})).image_features}_merge_input_ids_with_image_features(e){let t=e.image_features.dims.at(-1),n=e.image_features.view(-1,t);return c$({image_token_id:this.config.image_token_id,...e,image_features:n})}},j4=class extends A4{},M4=class extends ${},N4=class extends M4{},P4=class extends M4{async _call(e){return new uQ(await super._call(e))}},F4=class extends ${},I4=class extends F4{},L4=class extends F4{},R4=class extends ${},z4=class extends R4{async forward(e){let t=!e.input_ids,n=!e.pixel_values;if(t&&n)throw Error("Either `input_ids` or `pixel_values` should be provided.");if(t&&(e.input_ids=Eq([e.pixel_values.dims[0],1])),n){let{image_size:t}=this.config.vision_config;e.pixel_values=wq([0,3,t,t],0)}let{text_embeddings:r,image_embeddings:i,l2norm_text_embeddings:a,l2norm_image_embeddings:o}=await super.forward(e),s={};return t||(s.text_embeddings=r,s.l2norm_text_embeddings=a),n||(s.image_embeddings=i,s.l2norm_image_embeddings=o),s}},B4=class extends R4{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`text_model`})}},V4=class extends R4{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`vision_model`})}},H4=class extends ${},U4=class extends H4{},W4=class extends H4{},G4=class extends ${},K4=class extends G4{},q4=class extends G4{},J4=class extends ${},Y4=class extends J4{},X4=class extends J4{},Z4=class extends ${},Q4=class extends Z4{},$4=class extends ${forward_params=[`input_ids`,`attention_mask`,`pixel_values`,`position_ids`,`past_key_values`]},e3=class extends $4{_merge_input_ids_with_image_features(e){let t=e.image_features.dims.at(-1),n=e.image_features.view(-1,t);return c$({image_token_id:this.config.image_token_index,...e,image_features:n})}},t3=class extends e3{},n3=class extends e3{},r3=class extends ${},i3=class extends r3{},a3=class extends r3{},o3=class extends ${},s3=class extends o3{},c3=class extends o3{},l3=class extends ${},u3=class extends l3{},d3=class extends l3{},f3=class extends ${},p3=class extends f3{},m3=class extends f3{},h3=class extends ${},g3=class extends h3{},_3=class extends h3{},v3=class extends h3{async _call(e){return new uQ(await super._call(e))}},y3=class extends h3{},b3=class extends ${},x3=class extends b3{},S3=class extends ${},C3=class extends S3{},w3=class extends lQ{constructor({char_logits:e,bpe_logits:t,wp_logits:n}){super(),this.char_logits=e,this.bpe_logits=t,this.wp_logits=n}get logits(){return[this.char_logits,this.bpe_logits,this.wp_logits]}},T3=class extends ${},E3=class extends T3{async _call(e){return new w3(await super._call(e))}},D3=class extends lQ{constructor({audio_codes:e}){super(),this.audio_codes=e}},O3=class extends lQ{constructor({audio_values:e}){super(),this.audio_values=e}},k3=class extends ${main_input_name=`input_values`;forward_params=[`input_values`]},A3=class extends k3{async encode(e){return new D3(await sQ(this.sessions.encoder_model,e))}async decode(e){return new O3(await sQ(this.sessions.decoder_model,e))}},j3=class extends k3{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}},M3=class extends k3{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}},N3=class extends ${},P3=class extends N3{},F3=class extends N3{},I3=class extends ${},L3=class extends I3{},R3=class extends I3{async _call(e){return new fQ(await super._call(e))}},z3=class extends I3{async _call(e){return new uQ(await super._call(e))}},B3=class extends I3{async _call(e){return new pQ(await super._call(e))}},V3=class extends ${},H3=class extends V3{},U3=class extends V3{},W3=class extends ${},G3=class extends W3{},K3=class extends W3{async _call(e){return new uQ(await super._call(e))}},q3=class extends W3{},J3=class extends ${},Y3=class extends J3{},X3=class extends J3{async _call(e){return new uQ(await super._call(e))}},Z3=class extends J3{},Q3=class extends ${},$3=class extends Q3{},e6=class extends Q3{async _call(e){return new uQ(await super._call(e))}},t6=class extends Q3{},n6=class extends ${},r6=class extends n6{},i6=class extends n6{async _call(e){return new uQ(await super._call(e))}},a6=class extends n6{},o6=class extends ${},s6=class extends o6{},c6=class extends o6{async _call(e){return new uQ(await super._call(e))}},l6=class extends ${},u6=class extends l6{},d6=class extends l6{async _call(e){return new uQ(await super._call(e))}},f6=class extends ${},p6=class extends f6{},m6=class extends f6{async _call(e){return new fQ(await super._call(e))}},h6=class extends f6{async _call(e){return new uQ(await super._call(e))}},g6=class extends f6{async _call(e){return new dQ(await super._call(e))}},_6=class extends ${},v6=class extends _6{},y6=class extends _6{},b6=class extends ${requires_attention_mask=!1;main_input_name=`input_values`;forward_params=[`input_values`,`decoder_input_ids`,`past_key_values`]},x6=class extends b6{},S6=class extends b6{},C6=class extends ${},w6=class extends C6{},T6=class extends C6{async _call(e){return new fQ(await super._call(e))}},E6=class extends C6{async _call(e){return new uQ(await super._call(e))}},D6=class extends C6{async _call(e){return new dQ(await super._call(e))}},O6=class extends C6{async _call(e){return new pQ(await super._call(e))}},k6=class extends ${},A6=class extends k6{},j6=class extends k6{},M6=class extends ${},N6=class extends M6{},P6=class extends M6{},F6=class extends ${},I6=class extends F6{forward_params=[`input_ids`,`pixel_values`,`images_seq_mask`,`images_emb_mask`,`attention_mask`,`position_ids`,`past_key_values`];constructor(...e){super(...e),this._generation_mode=`text`}async forward(e){let t=this._generation_mode??`text`,n;if(t===`text`||!e.past_key_values){let t=this.sessions.prepare_inputs_embeds;n=await sQ(t,FG(e,t.inputNames))}else{let t=this.sessions.gen_img_embeds;n=await sQ(t,FG({image_ids:e.input_ids},t.inputNames))}let r={...e,...n},i=await QQ(this,r),a=this.sessions[t===`text`?`lm_head`:`gen_head`];if(!a)throw Error(`Unable to find "${a}" generation head`);let o=await sQ(a,FG(i,a.inputNames));return{...n,...i,...o}}prepare_inputs_for_generation(e,t,n){let r=!!t.past_key_values;return n.guidance_scale!==null&&n.guidance_scale>1&&(r?t.input_ids=_q([t.input_ids,t.input_ids],0):(t.input_ids=_q([t.input_ids,Tq(t.input_ids,BigInt(n.pad_token_id))],0),t.attention_mask=_q([t.attention_mask,Tq(t.attention_mask,0n)],0))),(r||!t.pixel_values)&&(t.pixel_values=wq([0,0,3,384,384],1)),r&&(t.images_seq_mask=new iq(`bool`,[,].fill(!0).fill(!1,0,1),[1,1]),t.images_emb_mask=new iq(`bool`,[].fill(!1),[1,1,0])),t}async generate(e){return this._generation_mode=`text`,super.generate(e)}async generate_images(e){this._generation_mode=`image`;let t=(e.inputs??e[this.main_input_name]).dims[1],n=(await super.generate(e)).slice(null,[t,null]),r=this.sessions.image_decode,{decoded_image:i}=await sQ(r,{generated_tokens:n}),a=i.add_(1).mul_(255/2).clamp_(0,255).to(`uint8`),o=[];for(let e of a){let t=HY.fromTensor(e);o.push(t)}return o}},L6=class extends ${},R6=class extends L6{},z6=class extends L6{},B6=class extends ${forward_params=[`input_ids`,`attention_mask`,`encoder_outputs`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`];_apply_and_filter_by_delay_pattern_mask(e){let[t,n]=e.dims,r=this.config.decoder.num_codebooks,i=n-r,a=0;for(let t=0;t0&&o<=i&&(e.data[a++]=e.data[t])}let o=Math.floor(t/r),s=a/(o*r);return new iq(e.type,e.data.slice(0,a),[o,r,s])}prepare_inputs_for_generation(e,t,n){let r=BigInt(this.config.decoder.pad_token_id),i=structuredClone(e);for(let e=0;e=t&&(i[e][t]=r);return n.guidance_scale!==null&&n.guidance_scale>1&&(i=i.concat(i)),a$(this,i,t,n)}async generate(e){let t=await super.generate(e),n=this._apply_and_filter_by_delay_pattern_mask(t).unsqueeze_(0),{audio_values:r}=await sQ(this.sessions.encodec_decode,{audio_codes:n});return r}},V6=class extends ${},H6=class extends V6{},U6=class extends V6{},W6=class extends ${},G6=class extends W6{},K6=class extends W6{async _call(e){return new fQ(await super._call(e))}},q6=class extends W6{async _call(e){return new uQ(await super._call(e))}},J6=class extends W6{async _call(e){return new dQ(await super._call(e))}},Y6=class extends W6{async _call(e){return new pQ(await super._call(e))}},X6=class extends ${},Z6=class extends X6{},Q6=class extends ${},$6=class extends Q6{},e8=class extends Q6{},t8=class extends ${},n8=class extends t8{},r8=class extends t8{},i8=class extends ${},a8=class extends i8{},o8=class extends i8{},s8=class extends ${},c8=class extends s8{},l8=class extends s8{},u8=class extends ${},d8=class extends u8{},f8=class extends u8{},p8=class extends ${},m8=class extends p8{},h8=class extends p8{},g8=class extends ${},_8=class extends g8{},v8=class extends g8{},y8=class extends ${forward_params=[`input_ids`,`attention_mask`,`pixel_values`,`position_ids`,`past_key_values`]},b8=class extends y8{_merge_input_ids_with_image_features(e){let t=e.image_features.dims.at(-1),n=e.image_features.view(-1,t);return c$({image_token_id:this.config.image_token_index,...e,image_features:n})}},x8=class extends ${},S8=class extends x8{async _call(e){return new mQ(await super._call(e))}},C8=class extends ${},w8=class extends C8{},T8=class extends C8{},E8=class extends ${},D8=class extends E8{},O8=class extends E8{},k8=class extends ${},A8=class extends k8{},j8=class extends k8{},M8=class extends ${},N8=class extends M8{},P8=class extends M8{},F8=class extends ${forward_params=[`input_ids`,`inputs_embeds`,`attention_mask`,`position_ids`,`pixel_values`,`image_sizes`,`past_key_values`]},I8=class extends F8{async forward({input_ids:e=null,attention_mask:t=null,pixel_values:n=null,image_sizes:r=null,position_ids:i=null,inputs_embeds:a=null,past_key_values:o=null,generation_config:s=null,logits_processor:c=null,...l}){if(!a){let t;if(n&&e.dims[1]!==1){if(!r)throw Error("`image_sizes` must be provided when `pixel_values` is provided.");({image_features:t}=await sQ(this.sessions.vision_encoder,{pixel_values:n,image_sizes:r}))}else{let e=this.config.normalized_config.hidden_size;t=new iq(`float32`,[],[0,e])}({inputs_embeds:a}=await sQ(this.sessions.prepare_inputs_embeds,{input_ids:e,image_features:t}))}return await QQ(this,{inputs_embeds:a,past_key_values:o,attention_mask:t,position_ids:i,generation_config:s,logits_processor:c},!1)}},L8=class extends ${},R8=class extends L8{},z8=class extends L8{async _call(e){return new uQ(await super._call(e))}},B8=class extends ${},V8=class extends B8{},H8=class extends B8{async _call(e){return new dQ(await super._call(e))}},U8=class extends ${},W8=class extends U8{},G8=class extends U8{},K8=class extends ${forward_params=[`input_ids`,`attention_mask`,`position_ids`,`past_key_values`,`pixel_values`,`image_grid_thw`]},q8=class extends K8{get_rope_index(e,t,n,r){let{vision_config:i,image_token_id:a,video_token_id:o,vision_start_token_id:s}=this.config,c=i.spatial_merge_size??2,l=[];if(t||n){let i=e.tolist();r||=Dq(e);let u=r.tolist(),d=Array.from({length:3},t=>Array.from({length:e.dims[0]},t=>Array.from({length:e.dims[1]},e=>1))),f=t?t.tolist():[],p=n?n.tolist():[],m=0,h=0;for(let e=0;eu[e][n]==1),n=t.reduce((e,t,n)=>(t==s&&e.push(n),e),[]).map(e=>t[e+1]),r=n.filter(e=>e==a).length,g=n.filter(e=>e==o).length,_=[],v=0,y=r,b=g;for(let e=0;et>v&&e==a),n=t.findIndex((e,t)=>t>v&&e==o),r=y>0&&e!==-1?e:t.length+1,i=b>0&&n!==-1?n:t.length+1,s,l,u,d;r0?lK(_.at(-1))[0]+1:0;_.push(Array.from({length:3*C},(e,t)=>w+t%C));let T=C+w,E=g*x*S,D=Array.from({length:E},(e,t)=>T+Math.floor(t/(x*S))),O=Array.from({length:E},(e,t)=>T+Math.floor(t/S)%x),k=Array.from({length:E},(e,t)=>T+t%S);_.push([D,O,k].flat()),v=s+E}if(v0?lK(_.at(-1))[0]+1:0,n=t.length-v;_.push(Array.from({length:3*n},(t,r)=>e+r%n))}let x=_.reduce((e,t)=>e+t.length,0),S=Array(x),C=0;for(let e=0;e<3;++e)for(let t=0;t<_.length;++t){let n=_[t],r=n.length/3;for(let t=e*r;t<(e+1)*r;++t)S[C++]=n[t]}let w=0,T=u[e];for(let t=0;te[n%e.length]),i=Array.from({length:t[0]},(n,r)=>lK(e.subarray(t[1]*r,t[1]*(r+1)))[0]+1n+BigInt(t[1]));return[new iq(`int64`,n,[3,...t]),new iq(`int64`,i,[i.length,1])]}else{let[t,n]=e.dims;return[new iq(`int64`,BigInt64Array.from({length:3*t*n},(e,r)=>BigInt(Math.floor(r%n/t))),[3,...e.dims]),Oq([t,1])]}}async encode_image({pixel_values:e,image_grid_thw:t}){return(await sQ(this.sessions.vision_encoder,{pixel_values:e,grid_thw:t})).image_features}_merge_input_ids_with_image_features(e){return c$({image_token_id:this.config.image_token_id,...e})}prepare_inputs_for_generation(e,t,n){if(t.attention_mask&&!t.position_ids)if(!t.past_key_values)[t.position_ids,t.rope_deltas]=this.get_rope_index(t.input_ids,t.image_grid_thw,t.video_grid_thw,t.attention_mask);else{t.pixel_values=null;let e=BigInt(Object.values(t.past_key_values)[0].dims.at(-2)),n=t.rope_deltas.map(t=>e+t);t.position_ids=vq([n,n,n],0)}return t}},J8=class extends ${},Y8=class extends J8{},X8=class extends J8{},Z8=class extends ${},Q8=class extends Z8{},$8=class extends Z8{async _call(e){return new uQ(await super._call(e))}},e5=class extends ${},t5=class extends e5{},n5=class extends e5{async _call(e){return new r5(await super._call(e))}},r5=class extends z1{},i5=class extends ${},a5=class extends i5{},o5=class extends i5{async _call(e){return new fQ(await super._call(e))}},s5=class extends i5{async _call(e){return new uQ(await super._call(e))}},c5=class extends i5{async _call(e){return new dQ(await super._call(e))}},l5=class extends i5{async _call(e){return new pQ(await super._call(e))}},u5=class extends ${},d5=class extends u5{},f5=class extends u5{async _call(e){return new fQ(await super._call(e))}},p5=class extends u5{async _call(e){return new uQ(await super._call(e))}},m5=class extends u5{async _call(e){return new dQ(await super._call(e))}},h5=class extends u5{async _call(e){return new pQ(await super._call(e))}},g5=class extends ${},_5=class extends g5{},v5=class extends g5{async _call(e){return new y5(await super._call(e))}},y5=class extends z1{},b5=class extends lQ{constructor({iou_scores:e,pred_masks:t}){super(),this.iou_scores=e,this.pred_masks=t}},x5=class extends ${},S5=class extends x5{async get_image_embeddings({pixel_values:e}){return await XQ(this,{pixel_values:e})}async forward(e){e=!e.image_embeddings||!e.image_positional_embeddings?{...e,...await this.get_image_embeddings(e)}:{...e},e.input_labels??=Eq(e.input_points.dims.slice(0,-1));let t={image_embeddings:e.image_embeddings,image_positional_embeddings:e.image_positional_embeddings};return e.input_points&&(t.input_points=e.input_points),e.input_labels&&(t.input_labels=e.input_labels),e.input_boxes&&(t.input_boxes=e.input_boxes),await sQ(this.sessions.prompt_encoder_mask_decoder,t)}async _call(e){return new b5(await super._call(e))}},C5=class extends lQ{constructor({iou_scores:e,pred_masks:t,object_score_logits:n}){super(),this.iou_scores=e,this.pred_masks=t,this.object_score_logits=n}},w5=class extends ${},T5=class extends w5{async get_image_embeddings({pixel_values:e}){return await XQ(this,{pixel_values:e})}async forward(e){let{num_feature_levels:t}=this.config.vision_config;if(e=Array.from({length:t},(e,t)=>`image_embeddings.${t}`).some(t=>!e[t])?{...e,...await this.get_image_embeddings(e)}:{...e},e.input_points){if(e.input_boxes&&e.input_boxes.dims[1]!==1)throw Error("When both `input_points` and `input_boxes` are provided, the number of boxes per image must be 1.");let t=e.input_points.dims;e.input_labels??=Eq(t.slice(0,-1)),e.input_boxes??=wq([t[0],0,4],0)}else if(e.input_boxes){let t=e.input_boxes.dims;e.input_labels=wq([t[0],t[1],0],-1n),e.input_points=wq([t[0],1,0,2],0)}else throw Error("At least one of `input_points` or `input_boxes` must be provided.");let n=this.sessions.prompt_encoder_mask_decoder;return await sQ(n,FG(e,n.inputNames))}async _call(e){return new C5(await super._call(e))}},E5=class extends T5{},D5=class extends T5{},O5=class extends ${},k5=class extends O5{},A5=class extends O5{},j5=class extends O5{},M5=class extends ${},N5=class extends M5{},P5=class extends M5{},F5=class extends M5{},I5=class extends ${},L5=class extends I5{},R5=class extends I5{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`text_model`})}},z5=class extends l1{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`vision_model`})}},B5=class extends ${},V5=class extends B5{},H5=class extends B5{},U5=class extends ${main_input_name=`input_values`;forward_params=[`input_values`]},W5=class extends U5{async encode(e){return await sQ(this.sessions.encoder_model,e)}async decode(e){return await sQ(this.sessions.decoder_model,e)}},G5=class extends U5{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}},K5=class extends U5{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}},q5=class extends ${},J5=class extends q5{},Y5=class extends q5{},X5=class extends q5{async generate_speech(e,t,{threshold:n=.5,minlenratio:r=0,maxlenratio:i=20,vocoder:a=null}={}){let{encoder_outputs:o,encoder_attention_mask:s}=await XQ(this,{input_ids:e}),c=o.dims[1]/this.config.reduction_factor,l=Math.floor(c*i),u=Math.floor(c*r),d=this.config.num_mel_bins,f=[],p=null,m=null,h=0;for(;;){++h;let e=UQ(!!m),r;r=m?m.output_sequence_out:new iq(`float32`,new Float32Array(d),[1,1,d]);let i={use_cache_branch:e,output_sequence:r,encoder_attention_mask:s,speaker_embeddings:t,encoder_hidden_states:o};this.addPastKeyValues(i,p),m=await sQ(this.sessions.decoder_model_merged,i),p=this.getPastKeyValues(m,p);let{prob:a,spectrum:c}=m;if(f.push(c),h>=u&&(Array.from(a.data).filter(e=>e>=n).length>0||h>=l))break}let g=_q(f),{waveform:_}=await sQ(a.sessions.model,{spectrogram:g});return{spectrogram:g,waveform:_}}},Z5=class extends ${main_input_name=`spectrogram`},Q5=class extends ${},$5=class extends Q5{},e7=class extends Q5{async _call(e){return new fQ(await super._call(e))}},t7=class extends Q5{async _call(e){return new uQ(await super._call(e))}},n7=class extends Q5{async _call(e){return new pQ(await super._call(e))}},r7=class extends ${},i7=class extends r7{},a7=class extends r7{},o7=class extends ${},s7=class extends o7{},c7=class extends o7{},l7=class extends ${},u7=class extends l7{},d7=class extends ${},f7=class extends d7{async generate_speech({input_ids:e,attention_mask:t,style:n,num_inference_steps:r=5,speed:i=1.05}){let{sampling_rate:a,chunk_compress_factor:o,base_chunk_size:s,latent_dim:c}=this.config,{last_hidden_state:l,durations:u}=await sQ(this.sessions.text_encoder,{input_ids:e,attention_mask:t,style:n}),d=u.div(i).mul_(a),f=s*o,p=d.data,m=Int32Array.from(p,e=>Math.ceil(e/f)),h=Math.max(...m),g=e.dims[0],_=new BigInt64Array(g*h);for(let e=0;e`;t.push(e.lang_to_id[i]),t.push(e.task_to_id[r??`transcribe`])}else if(n||r)throw Error("Cannot specify `task` or `language` for an English-only model. If the model is intended to be multilingual, pass `is_multilingual=true` to generate, or update the generation config.");return!e.return_timestamps&&e.no_timestamps_token_id&&t.at(-1)!==e.no_timestamps_token_id?t.push(e.no_timestamps_token_id):e.return_timestamps&&t.at(-1)===e.no_timestamps_token_id&&(console.warn("<|notimestamps|> prompt token is removed from generation_config since `return_timestamps` is set to `true`."),t.pop()),t.filter(e=>e!=null)}async generate({inputs:e=null,generation_config:t=null,logits_processor:n=null,stopping_criteria:r=null,...i}){t=this._prepare_generation_config(t,i);let a=i.decoder_input_ids??this._retrieve_init_tokens(t);if(t.return_timestamps&&(n??=new vQ,n.push(new SQ(t,a))),t.begin_suppress_tokens&&(n??=new vQ,n.push(new xQ(t.begin_suppress_tokens,a.length))),t.return_token_timestamps){if(!t.alignment_heads)throw Error("Model generation config has no `alignment_heads`, token-level timestamps not available. See https://gist.github.com/hollance/42e32852f24243b748ae6bc1f985b13a on how to add this property to the generation config.");t.task===`translate`&&console.warn(`Token-level timestamps may not be reliable for task 'translate'.`),t.output_attentions=!0,t.return_dict_in_generate=!0}let o=await super.generate({inputs:e,generation_config:t,logits_processor:n,decoder_input_ids:a,...i});return t.return_token_timestamps&&(o.token_timestamps=this._extract_token_timestamps(o,t.alignment_heads,t.num_frames)),o}_extract_token_timestamps(e,t,n=null,r=.02){if(!e.cross_attentions)throw Error("Model outputs must contain cross attentions to extract timestamps. This is most likely because the model was not exported with `output_attentions=True`.");n??console.warn("`num_frames` has not been set, meaning the entire audio will be analyzed. This may lead to inaccurate token-level timestamps for short audios (< 30 seconds).");let i=this.config.median_filter_width;i===void 0&&(console.warn("Model config has no `median_filter_width`, using default value of 7."),i=7);let a=e.cross_attentions,o=Array.from({length:this.config.decoder_layers},(e,t)=>_q(a.map(e=>e[t]),2)),s=vq(t.map(([e,t])=>{if(e>=o.length)throw Error(`Layer index ${e} is out of bounds for cross attentions (length ${o.length}).`);return n?o[e].slice(null,t,null,[0,n]):o[e].slice(null,t)})).transpose(1,0,2,3),[c,l]=bq(s,-2,0,!0),u=s.clone();for(let e=0;et[n+1]-t[n])).map(e=>!!e),a=[];for(let e=0;ee[0]);static BASE_IF_FAIL=!0},R9=class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES]},lne=class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES]},z9=class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES]},une=class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES]},dne=class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING_NAMES]},fne=class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_TEXT_TO_WAVEFORM_MAPPING_NAMES]},pne=class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_CAUSAL_LM_MAPPING_NAMES]},mne=class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_MASKED_LM_MAPPING_NAMES]},hne=class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES]},gne=class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES]},_ne=class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES]},B9=class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES]},V9=class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES]},H9=class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_UNIVERSAL_SEGMENTATION_MAPPING_NAMES]},vne=class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_OBJECT_DETECTION_MAPPING_NAMES]},yne=class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING_NAMES]};(class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_MASK_GENERATION_MAPPING_NAMES]});var bne=class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_CTC_MAPPING_NAMES]},xne=class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES]};(class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_AUDIO_XVECTOR_MAPPING_NAMES]}),class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING_NAMES]};var Sne=class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING_NAMES]};(class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_IMAGE_MATTING_MAPPING_NAMES]});var Cne=class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_IMAGE_TO_IMAGE_MAPPING_NAMES]},wne=class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_DEPTH_ESTIMATION_MAPPING_NAMES]};(class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_NORMAL_ESTIMATION_MAPPING_NAMES]}),class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_POSE_ESTIMATION_MAPPING_NAMES]};var Tne=class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_IMAGE_FEATURE_EXTRACTION_MAPPING_NAMES]};(class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_IMAGE_TEXT_TO_TEXT_MAPPING_NAMES]}),class extends I9{static MODEL_CLASS_MAPPINGS=[F9.MODEL_FOR_AUDIO_TEXT_TO_TEXT_MAPPING_NAMES]};async function U9(e){return Array.isArray(e)||(e=[e]),await Promise.all(e.map(e=>HY.read(e)))}async function W9(e,t){return Array.isArray(e)||(e=[e]),await Promise.all(e.map(e=>typeof e==`string`||e instanceof URL?ZJ(e,t):e instanceof Float64Array?new Float32Array(e):e))}function G9(e,t){t&&(e=e.map(e=>e|0));let[n,r,i,a]=e;return{xmin:n,ymin:r,xmax:i,ymax:a}}var K9=class extends DG{constructor({task:e,model:t,tokenizer:n=null,processor:r=null}){super(),this.task=e,this.model=t,this.tokenizer=n,this.processor=r}async dispose(){await this.model.dispose()}},Ene=class extends K9{async _call(e,{top_k:t=1}={}){let n=this.tokenizer(e,{padding:!0,truncation:!0}),r=await this.model(n),{problem_type:i,id2label:a}=this.model.config,o=i===`multi_label_classification`?e=>e.sigmoid():e=>new iq(`float32`,oK(e.data),e.dims),s=[];for(let e of r.logits){let n=await uq(o(e),t),r=n[0].tolist(),i=n[1].tolist().map((e,t)=>({label:a?a[e]:`LABEL_${e}`,score:r[t]}));t===1?s.push(...i):s.push(i)}return Array.isArray(e)||t===1?s:s[0]}},Dne=class extends K9{async _call(e,{ignore_labels:t=[`O`]}={}){let n=Array.isArray(e),r=this.tokenizer(n?e:[e],{padding:!0,truncation:!0}),i=(await this.model(r)).logits,a=this.model.config.id2label,o=[];for(let e=0;ee==u),i=a[e].tolist(),f=o[e].tolist();for(let n=1;ne==t[n])!==-1)&&(i[n]=-1/0,f[n]=-1/0);let p=oK(i).map((e,t)=>[e,t]),m=oK(f).map((e,t)=>[e,t]);p[0][0]=0,m[0][0]=0;let h=NG(p,m).filter(e=>e[0][1]<=e[1][1]).map(e=>[e[0][1],e[1][1],e[0][0]*e[1][0]]).sort((e,t)=>t[2]-e[2]),g=[];for(let e=0;ee==n);if(c===-1)throw Error(`Mask token (${r}) not found in text.`);let l=a[e][c],u=await uq(new iq(`float32`,oK(l.data),l.dims),t),d=u[0].tolist(),f=u[1].tolist();o.push(f.map((e,t)=>{let n=i.slice();return n[c]=e,{score:d[t],token:Number(e),token_str:this.tokenizer.decode([e]),sequence:this.tokenizer.decode(n,{skip_special_tokens:!0})}}))}return Array.isArray(e)?o:o[0]}},q9=class extends K9{_key=`generated_text`;async _call(e,t={}){Array.isArray(e)||(e=[e]),this.model.config.prefix&&(e=e.map(e=>this.model.config.prefix+e));let n=this.model.config.task_specific_params;n&&n[this.task]&&n[this.task].prefix&&(e=e.map(e=>n[this.task].prefix+e));let r=this.tokenizer,i={padding:!0,truncation:!0},a;a=this.task===`translation`&&`_build_translation_inputs`in r?r._build_translation_inputs(e,i,t):r(e,i);let o=await this.model.generate({...a,...t});return r.batch_decode(o,{skip_special_tokens:!0}).map(e=>({[this._key]:e}))}},Ane=class extends q9{_key=`summary_text`},jne=class extends q9{_key=`translation_text`};function J9(e){return Array.isArray(e)&&e.every(e=>`role`in e&&`content`in e)}var Mne=class extends K9{async _call(e,t={}){let n=!1,r=!1,i=t.add_special_tokens??(this.tokenizer.add_bos_token||this.tokenizer.add_eos_token)??!1,a=t.tokenizer_encode_kwargs,o;if(typeof e==`string`)o=e=[e];else if(Array.isArray(e)&&e.every(e=>typeof e==`string`))n=!0,o=e;else{if(J9(e))e=[e];else if(Array.isArray(e)&&e.every(J9))n=!0;else throw Error(`Input must be a string, an array of strings, a Chat, or an array of Chats`);r=!0,o=e.map(e=>this.tokenizer.apply_chat_template(e,{tokenize:!1,add_generation_prompt:!0,...a})),i=!1,a=void 0}let s=r?!1:t.return_full_text??!0;this.tokenizer.padding_side=`left`;let c=this.tokenizer(o,{add_special_tokens:i,padding:!0,truncation:!0,...a}),l=await this.model.generate({...c,...t}),u=this.tokenizer.batch_decode(l,{skip_special_tokens:!0}),d;!s&&c.input_ids.dims.at(-1)>0&&(d=this.tokenizer.batch_decode(c.input_ids,{skip_special_tokens:!0}).map(e=>e.length));let f=Array.from({length:e.length},e=>[]);for(let t=0;t[e.toLowerCase(),t])),this.entailment_id=this.label2id.entailment,this.entailment_id===void 0&&(console.warn(`Could not find 'entailment' in label2id mapping. Using 2 as entailment_id.`),this.entailment_id=2),this.contradiction_id=this.label2id.contradiction??this.label2id.not_entailment,this.contradiction_id===void 0&&(console.warn(`Could not find 'contradiction' in label2id mapping. Using 0 as contradiction_id.`),this.contradiction_id=0)}async _call(e,t,{hypothesis_template:n=`This example is {}.`,multi_label:r=!1}={}){let i=Array.isArray(e);i||(e=[e]),Array.isArray(t)||(t=[t]);let a=t.map(e=>n.replace(`{}`,e)),o=r||t.length===1,s=[];for(let n of e){let e=[];for(let t of a){let r=this.tokenizer(n,{text_pair:t,padding:!0,truncation:!0}),i=await this.model(r);o?e.push([i.logits.data[this.contradiction_id],i.logits.data[this.entailment_id]]):e.push(i.logits.data[this.entailment_id])}let r=(o?e.map(e=>oK(e)[1]):oK(e)).map((e,t)=>[e,t]).sort((e,t)=>t[0]-e[0]);s.push({sequence:n,labels:r.map(e=>t[e[1]]),scores:r.map(e=>e[0])})}return i?s:s[0]}},Pne=class extends K9{async _call(e,{top_k:t=5}={}){let n=this.processor.feature_extractor.config.sampling_rate,r=await W9(e,n),i=this.model.config.id2label,a=[];for(let e of r){let n=await this.processor(e),r=(await this.model(n)).logits[0],o=await uq(new iq(`float32`,oK(r.data),r.dims),t),s=o[0].tolist(),c=o[1].tolist().map((e,t)=>({label:i?i[e]:`LABEL_${e}`,score:s[t]}));a.push(c)}return Array.isArray(e)?a:a[0]}},Fne=class extends K9{async _call(e,t,{hypothesis_template:n=`This is a sound of {}.`}={}){let r=!Array.isArray(e);r&&(e=[e]);let i=t.map(e=>n.replace(`{}`,e)),a=this.tokenizer(i,{padding:!0,truncation:!0}),o=this.processor.feature_extractor.config.sampling_rate,s=await W9(e,o),c=[];for(let e of s){let n=await this.processor(e),r=oK((await this.model({...a,...n})).logits_per_audio.data);c.push([...r].map((e,n)=>({score:e,label:t[n]})))}return r?c[0]:c}},Ine=class extends K9{async _call(e,t={}){switch(this.model.config.model_type){case`whisper`:case`lite-whisper`:return this._call_whisper(e,t);case`wav2vec2`:case`wav2vec2-bert`:case`unispeech`:case`unispeech-sat`:case`hubert`:case`parakeet_ctc`:return this._call_wav2vec2(e,t);case`moonshine`:return this._call_moonshine(e,t);default:throw Error(`AutomaticSpeechRecognitionPipeline does not support model type '${this.model.config.model_type}'.`)}}async _call_wav2vec2(e,t){t.language&&console.warn('`language` parameter is not yet supported for `wav2vec2` models, defaulting to "English".'),t.task&&console.warn('`task` parameter is not yet supported for `wav2vec2` models, defaulting to "transcribe".');let n=!Array.isArray(e),r=n?[e]:e,i=this.processor.feature_extractor.config.sampling_rate,a=await W9(r,i),o=[];for(let e of a){let t=await this.processor(e),n=(await this.model(t)).logits[0],r=[];for(let e of n)r.push(lK(e.data)[1]);let i=this.tokenizer.decode(r,{skip_special_tokens:!0}).trim();o.push({text:i})}return n?o[0]:o}async _call_whisper(e,t){let n=t.return_timestamps??!1,r=t.chunk_length_s??0,i=t.force_full_sequences??!1,a=t.stride_length_s??null,o={...t};n===`word`&&(o.return_token_timestamps=!0,o.return_timestamps=!1);let s=!Array.isArray(e),c=s?[e]:e,l=this.processor.feature_extractor.config,u=l.chunk_length/this.model.config.max_source_positions,d=l.hop_length,f=l.sampling_rate,p=await W9(c,f),m=[];for(let e of p){let t=[];if(r>0){if(a===null)a=r/6;else if(r<=a)throw Error("`chunk_length_s` must be larger than `stride_length_s`.");let n=f*r,i=f*a,o=n-2*i,s=0;for(;;){let r=s+n,a=e.subarray(s,r),c=await this.processor(a),l=s===0,u=r>=e.length;if(t.push({stride:[a.length,l?0:i,u?0:i],input_features:c.input_features,is_last:u}),u)break;s+=o}}else t=[{stride:[e.length,0,0],input_features:(await this.processor(e)).input_features,is_last:!0}];for(let e of t){o.num_frames=Math.floor(e.stride[0]/d);let t=await this.model.generate({inputs:e.input_features,...o});n===`word`?(e.tokens=t.sequences.tolist()[0],e.token_timestamps=t.token_timestamps.tolist()[0].map(e=>hK(e,2))):e.tokens=t[0].tolist(),e.stride=e.stride.map(e=>e/f)}let[s,c]=this.tokenizer._decode_asr(t,{time_precision:u,return_timestamps:n,force_full_sequences:i});m.push({text:s,...c})}return s?m[0]:m}async _call_moonshine(e,t){let n=!Array.isArray(e),r=n?[e]:e,i=this.processor.feature_extractor.config.sampling_rate,a=await W9(r,i),o=[];for(let e of a){let n=await this.processor(e),r=Math.floor(e.length/i)*6,a=await this.model.generate({max_new_tokens:r,...t,...n}),s=this.processor.batch_decode(a,{skip_special_tokens:!0})[0];o.push({text:s})}return n?o[0]:o}},Lne=class extends K9{DEFAULT_VOCODER_ID=`Xenova/speecht5_hifigan`;constructor(e){super(e),this.vocoder=e.vocoder??null}async _prepare_speaker_embeddings(e,t){if((typeof e==`string`||e instanceof URL)&&(e=new Float32Array(await(await fetch(e)).arrayBuffer())),e instanceof Float32Array)e=new iq(`float32`,e,[e.length]);else if(!(e instanceof iq))throw Error("Speaker embeddings must be a `Tensor`, `Float32Array`, `string`, or `URL`.");if(t>1){if(e.dims[0]===1)e=e.repeat(t,1);else if(e.dims[0]!==t)throw Error(`Expected speaker embeddings batch size to be 1 or ${t}, but got ${e.dims[0]}.`)}return e}_postprocess_waveform(e,t,n,r=null){let i=t.data,[a,o]=t.dims,s=r?r.data:null,c=[];for(let e=0;e({generated_text:e.trim()}));a.push(r)}return n?a:a[0]}},zne=class extends K9{async _call(e,{top_k:t=5}={}){let n=await U9(e),{pixel_values:r}=await this.processor(n),i=await this.model({pixel_values:r}),{id2label:a}=this.model.config,o=[];for(let e of i.logits){let n=await uq(new iq(`float32`,oK(e.data),e.dims),t),r=n[0].tolist(),i=n[1].tolist().map((e,t)=>({label:a?a[e]:`LABEL_${e}`,score:r[t]}));o.push(i)}return Array.isArray(e)?o:o[0]}},Y9={panoptic:`post_process_panoptic_segmentation`,instance:`post_process_instance_segmentation`,semantic:`post_process_semantic_segmentation`},X9=class extends K9{async _call(e,{threshold:t=.5,mask_threshold:n=.5,overlap_mask_area_threshold:r=.8,label_ids_to_fuse:i=null,target_sizes:a=null,subtask:o=null}={}){if(Array.isArray(e)&&e.length!==1)throw Error(`Image segmentation pipeline currently only supports a batch size of 1.`);let s=await U9(e),c=s.map(e=>[e.height,e.width]),l=await this.processor(s),{inputNames:u,outputNames:d}=this.model.sessions.model;if(!u.includes(`pixel_values`)){if(u.length!==1)throw Error(`Expected a single input name, but got ${u.length} inputs: ${u}.`);let e=u[0];if(e in l)throw Error(`Input name ${e} already exists in the inputs.`);l[e]=l.pixel_values}let f=await this.model(l),p=null;if(o!==null)p=Y9[o];else if(this.processor.image_processor){for(let[e,t]of Object.entries(Y9))if(t in this.processor.image_processor){p=this.processor.image_processor[t].bind(this.processor.image_processor),o=e;break}}let m=this.model.config.id2label,h=[];if(!o){let e=1e-5,t=f[d[0]];for(let n=0;nt<-e||t>1+e)&&i.sigmoid_();let a=await HY.fromTensor(i.mul_(255).to(`uint8`)).resize(r[1],r[0]);h.push({label:null,score:null,mask:a})}}else if(o===`panoptic`||o===`instance`){let e=p(f,t,n,r,i,a??c)[0],o=e.segmentation;for(let t of e.segments_info){let e=new Uint8ClampedArray(o.data.length);for(let n=0;n{let n=e.clone();return n.putAlpha(r[t].mask),n});return Array.isArray(e)?i:i[0]}},Vne=class extends K9{async _call(e,t,{hypothesis_template:n=`This is a photo of {}`}={}){let r=Array.isArray(e),i=await U9(e),a=t.map(e=>n.replace(`{}`,e)),o=this.tokenizer(a,{padding:this.model.config.model_type===`siglip`?`max_length`:!0,truncation:!0}),{pixel_values:s}=await this.processor(i),c=await this.model({...o,pixel_values:s}),l=this.model.config.model_type===`siglip`?e=>e.sigmoid().data:e=>oK(e.data),u=[];for(let e of c.logits_per_image){let n=[...l(e)].map((e,n)=>({score:e,label:t[n]}));n.sort((e,t)=>t.score-e.score),u.push(n)}return r?u:u[0]}},Hne=class extends K9{async _call(e,{threshold:t=.9,percentage:n=!1}={}){let r=Array.isArray(e);if(r&&e.length!==1)throw Error(`Object detection pipeline currently only supports a batch size of 1.`);let i=await U9(e),a=n?null:i.map(e=>[e.height,e.width]),{pixel_values:o,pixel_mask:s}=await this.processor(i),c=await this.model({pixel_values:o,pixel_mask:s}),l=this.processor.image_processor.post_process_object_detection(c,t,a),{id2label:u}=this.model.config,d=l.map(e=>e.boxes.map((t,r)=>({score:e.scores[r],label:u[e.classes[r]],box:G9(t,!n)})));return r?d:d[0]}},Une=class extends K9{async _call(e,t,{threshold:n=.1,top_k:r=null,percentage:i=!1}={}){let a=Array.isArray(e),o=await U9(e),s=this.tokenizer(t,{padding:!0,truncation:!0}),c=await this.processor(o),l=[];for(let e=0;e({score:e.scores[n],label:e.labels[n],box:G9(t,!i)}))}else{let e=this.processor.image_processor.post_process_object_detection(f,n,u,!0)[0];p=e.boxes.map((n,r)=>({score:e.scores[r],label:t[e.classes[r]],box:G9(n,!i)}))}p.sort((e,t)=>t.score-e.score),r!==null&&(p=p.slice(0,r)),l.push(p)}return a?l:l[0]}},Wne=class extends K9{async _call(e,t,n={}){if(Array.isArray(e)){if(e.length!==1)throw Error(`Document Question Answering pipeline currently only supports a batch size of 1.`);e=e[0]}let r=(await U9(e))[0],{pixel_values:i}=await this.processor(r),a=`${t}`,o=this.tokenizer(a,{add_special_tokens:!1,padding:!0,truncation:!0}).input_ids,s=await this.model.generate({inputs:i,max_length:this.model.config.decoder.max_position_embeddings,decoder_input_ids:o,...n}),c=this.tokenizer.batch_decode(s)[0].match(/(.*?)<\/s_answer>/),l=null;return c&&c.length>=2&&(l=c[1].trim()),[{answer:l}]}},Gne=class extends K9{async _call(e){let t=await U9(e),n=await this.processor(t),r=await this.model(n),i=[];for(let e of r.reconstruction){let t=e.squeeze().clamp_(0,1).mul_(255).round_().to(`uint8`);i.push(HY.fromTensor(t))}return Array.isArray(e)?i:i[0]}},Kne=class extends K9{async _call(e){let t=await U9(e),n=await this.processor(t),{predicted_depth:r}=await this.model(n),i=[];for(let e=0;e{let i;for(let a of o){if(a===null){e(null);return}try{e(await a.from_pretrained(t,n));return}catch(e){if(e.message?.includes(`Unsupported model type`))i=e;else if(e.message?.includes(`Could not locate file`))i=e;else{r(e);return}}}r(i)}):o.from_pretrained(t,n),r[a]=e,i.push(e)}await Promise.all(i);for(let[e,t]of Object.entries(r))r[e]=await t;return r}var Qne=e=>e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=63744&&e<=64255||e>=194560&&e<=195103,$ne=class{put(e){throw Error(`Not implemented`)}end(){throw Error(`Not implemented`)}},Q9=sH.IS_PROCESS_AVAILABLE?e=>process.stdout.write(e):e=>console.log(e),ere=class extends $ne{constructor(e,{skip_prompt:t=!1,callback_function:n=null,token_callback_function:r=null,skip_special_tokens:i=!0,decode_kwargs:a={},...o}={}){super(),this.tokenizer=e,this.skip_prompt=t,this.callback_function=n??Q9,this.token_callback_function=r,this.decode_kwargs={skip_special_tokens:i,...a,...o},this.token_cache=[],this.print_len=0,this.next_tokens_are_prompt=!0,this.special_ids=new Set(this.tokenizer.all_special_ids.map(BigInt))}put(e){if(e.length>1)throw Error(`TextStreamer only supports batch size of 1`);let t=this.next_tokens_are_prompt;if(t&&(this.next_tokens_are_prompt=!1,this.skip_prompt))return;let n=e[0];if(this.token_callback_function?.(n),n.length===1&&this.special_ids.has(n[0])){if(this.decode_kwargs.skip_special_tokens)return;if(this.token_cache.length>0){let e=this.tokenizer.decode(this.token_cache,this.decode_kwargs).slice(this.print_len);this.on_finalized_text(e,!1),this.token_cache=[],this.print_len=0}let e=this.tokenizer.decode(n,this.decode_kwargs);this.on_finalized_text(e,!1);return}this.token_cache=MG(this.token_cache,n);let r=this.tokenizer.decode(this.token_cache,this.decode_kwargs),i;t||r.endsWith(` +`)?(i=r.slice(this.print_len),this.token_cache=[],this.print_len=0):r.length>0&&Qne(r.charCodeAt(r.length-1))?(i=r.slice(this.print_len),this.print_len+=i.length):(i=r.slice(this.print_len,r.lastIndexOf(` `)+1),this.print_len+=i.length),this.on_finalized_text(i,!1)}end(){let e;this.token_cache.length>0?(e=this.tokenizer.decode(this.token_cache,this.decode_kwargs).slice(this.print_len),this.token_cache=[],this.print_len=0):e=``,this.next_tokens_are_prompt=!0,this.on_finalized_text(e,!0)}on_finalized_text(e,t){e.length>0&&this.callback_function?.(e),t&&this.callback_function===Q9&&sH.IS_PROCESS_AVAILABLE&&this.callback_function?.(` +`)}},tre=class e{reasoning=``;content=``;_inThink=!1;_buf=``;static OPEN_TAG=``;static CLOSE_TAG=``;reset(){this.reasoning=``,this.content=``,this._inThink=!1,this._buf=``}push(t){let n=[];for(this._buf+=t;this._buf.length>0;)if(this._inThink){let t=this._buf.indexOf(e.CLOSE_TAG);if(t!==-1){let r=this._buf.slice(0,t);r&&(this.reasoning+=r,n.push({type:`reasoning`,textDelta:r})),this._buf=this._buf.slice(t+e.CLOSE_TAG.length),this._inThink=!1;continue}let r=this._safeFlushLength(this._buf,e.CLOSE_TAG);if(r>0){let e=this._buf.slice(0,r);this.reasoning+=e,n.push({type:`reasoning`,textDelta:e}),this._buf=this._buf.slice(r)}break}else{let t=this._buf.indexOf(e.OPEN_TAG);if(t!==-1){let r=this._buf.slice(0,t);r&&(this.content+=r,n.push({type:`content`,textDelta:r})),this._buf=this._buf.slice(t+e.OPEN_TAG.length),this._inThink=!0;continue}let r=this._safeFlushLength(this._buf,e.OPEN_TAG);if(r>0){let e=this._buf.slice(0,r);this.content+=e,n.push({type:`content`,textDelta:e}),this._buf=this._buf.slice(r)}break}return n}flush(){if(!this._buf)return[];let e=[];return this._inThink?(this.reasoning+=this._buf,e.push({type:`reasoning`,textDelta:this._buf})):(this.content+=this._buf,e.push({type:`content`,textDelta:this._buf})),this._buf=``,e}_safeFlushLength(e,t){for(let n=Math.min(e.length,t.length-1);n>0;n--)if(e.endsWith(t.slice(0,n)))return e.length-n;return e.length}},nre=`LiquidAI/LFM2.5-1.2B-Thinking-ONNX`,rre=`q4`;function $9(e,t){let{content:n,reasoning:r=``}=e;for(let e of t)e.type===`reasoning`?r+=e.textDelta:n+=e.textDelta;return{...e,content:n,reasoning:r}}function ire({children:e}){let t=(0,y.useRef)(null),n=(0,y.useRef)(new FQ),[r,i]=(0,y.useState)({state:`idle`}),[a,o]=(0,y.useState)([]),s=(0,y.useRef)([]),[c,l]=(0,y.useState)(!1),u=(0,y.useRef)(!1),[d,f]=(0,y.useState)(0),[p,m]=(0,y.useState)(`medium`);s.current=a,u.current=c;let h=(0,y.useCallback)(()=>{t.current||=(async()=>{i({state:`loading`,message:`Downloading model…`});try{let e=await Xne(`text-generation`,nre,{dtype:rre,device:`webgpu`,progress_callback:e=>{e.status!==`progress`||!e.file?.endsWith(`.onnx_data`)||i({state:`loading`,progress:e.progress,message:`Downloading model… ${Math.round(e.progress)}%`})}});return i({state:`ready`}),e}catch(e){throw i({state:`error`,error:e instanceof Error?e.message:String(e)}),t.current=null,e}})()},[]),g=(0,y.useCallback)(async e=>{let r=await t.current;l(!0),f(0),n.current.reset();let i=new tre,a=0,s=0,c=e.length;o(e=>[...e,{id:Vl(),role:`assistant`,content:``,reasoning:``}]);let u=new ere(r.tokenizer,{skip_prompt:!0,skip_special_tokens:!1,callback_function:e=>{if(e===`<|im_end|>`)return;let t=i.push(e);t.length!==0&&o(e=>{let n=[...e];return n[c]=$9(n[c],t),n})},token_callback_function:()=>{if(a++,a===1)s=performance.now();else{let e=(performance.now()-s)/1e3;e>0&&f(Math.round((a-1)/e*10)/10)}}}),d=e.map(e=>({role:e.role,content:e.content}));try{await r(d,{max_new_tokens:8192,streamer:u,stopping_criteria:n.current,do_sample:!1})}catch(e){console.error(`Generation error:`,e)}let p=i.flush();p.length>0&&o(e=>{let t=[...e];return t[c]=$9(t[c],p),t}),o(e=>{let t=[...e];return t[c]={...t[c],content:i.content.trim()||e[c].content,reasoning:i.reasoning.trim()||e[c].reasoning},t}),l(!1)},[]),_=(0,y.useCallback)(e=>{if(!t.current||u.current)return;let n={id:Vl(),role:`user`,content:e};o(e=>[...e,n]),g([...s.current,n])},[g]),v=(0,y.useCallback)(()=>{n.current.interrupt()},[]),b=(0,y.useCallback)(()=>{u.current||o([])},[]),x=(0,y.useCallback)((e,t)=>{if(u.current)return;o(n=>{let r=n.slice(0,e);return r.push({...n[e],content:t}),r});let n=s.current.slice(0,e);n.push({...s.current[e],content:t}),s.current[e]?.role===`user`&&setTimeout(()=>g(n),0)},[g]),S=(0,y.useCallback)(e=>{if(u.current)return;let t=s.current.slice(0,e);o(t),setTimeout(()=>g(t),0)},[g]);return(0,F.jsx)(Hl.Provider,{value:{status:r,messages:a,isGenerating:c,tps:d,reasoningEffort:p,setReasoningEffort:m,loadModel:h,send:_,stop:v,clearChat:b,editMessage:x,retryMessage:S},children:e})}(0,v.createRoot)(document.getElementById(`root`)).render((0,F.jsx)(y.StrictMode,{children:(0,F.jsx)(ire,{children:(0,F.jsx)(qL,{})})}));export{ZA as a,Ok as i,KA as n,fl as o,Yee as r,f as s,Ak as t}; \ No newline at end of file diff --git a/dist/assets/index-C5OR1-PR.css b/dist/assets/index-C5OR1-PR.css new file mode 100644 index 0000000000000000000000000000000000000000..aad32afaffcc0754ba912a3f6d825d9882cbd501 --- /dev/null +++ b/dist/assets/index-C5OR1-PR.css @@ -0,0 +1,2 @@ +/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */ +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:""}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-2xl:42rem;--container-3xl:48rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height:calc(1.5/1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25/1.875);--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5/2.25);--text-6xl:3.75rem;--text-6xl--line-height:1;--text-7xl:4.5rem;--text-7xl--line-height:1;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0,0,.2,1);--animate-spin:spin 1s linear infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}html,body{color:#000;background:#fff;height:100%;font-family:Sohne,Inter,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:17px;overflow:hidden}#root{height:100%}*{scrollbar-width:thin;scrollbar-color:transparent transparent}:hover{scrollbar-color:#d4d4d8 transparent}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:0 0;border-radius:3px}:hover::-webkit-scrollbar-thumb{background:#d4d4d8}:hover::-webkit-scrollbar-thumb:hover{background:#a1a1aa}:root{--brand-white:#fff;--brand-black:#000;--brand-purple-light:#cd82f0;--brand-purple:#5505af;--brand-orange:#ff5f1e;--brand-white-70:#ffffffb3;--brand-white-50:#ffffff80;--brand-white-30:#ffffff4d;--brand-white-10:#ffffff1a;--brand-black-70:#000000b3;--brand-black-50:#00000080;--brand-black-30:#0000004d;--brand-black-10:#0000001a;--brand-purple-light-70:#cd82f0b3;--brand-purple-light-50:#cd82f080;--brand-purple-light-30:#cd82f04d;--brand-purple-light-10:#cd82f01a;--brand-purple-70:#5505afb3;--brand-purple-50:#5505af80;--brand-purple-30:#5505af4d;--brand-purple-10:#5505af1a;--brand-orange-70:#ff5f1eb3;--brand-orange-50:#ff5f1e80;--brand-orange-30:#ff5f1e4d;--brand-orange-10:#ff5f1e1a;--background:var(--brand-white);--foreground:var(--brand-black);--card:var(--brand-white);--card-foreground:var(--brand-black);--popover:var(--brand-white);--popover-foreground:var(--brand-black);--primary:var(--brand-black);--primary-foreground:var(--brand-white);--secondary:#f8f8fa;--secondary-foreground:var(--brand-black);--muted:#f8f8fa;--muted-foreground:var(--brand-black-70);--accent:var(--brand-purple-10);--accent-foreground:var(--brand-black);--destructive:#dc2626;--destructive-foreground:var(--brand-white);--border:var(--brand-black-10);--input:var(--brand-black-10);--ring:var(--brand-purple);--radius:.5rem}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing)*0)}.top-4{top:calc(var(--spacing)*4)}.top-full{top:100%}.right-0{right:calc(var(--spacing)*0)}.right-2{right:calc(var(--spacing)*2)}.right-4{right:calc(var(--spacing)*4)}.bottom-2{bottom:calc(var(--spacing)*2)}.bottom-4{bottom:calc(var(--spacing)*4)}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing)*0)}.left-2{left:calc(var(--spacing)*2)}.left-4{left:calc(var(--spacing)*4)}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.mx-1{margin-inline:calc(var(--spacing)*1)}.mx-4{margin-inline:calc(var(--spacing)*4)}.mx-auto{margin-inline:auto}.my-4{margin-block:calc(var(--spacing)*4)}.my-6{margin-block:calc(var(--spacing)*6)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-6{margin-top:calc(var(--spacing)*6)}.mt-10{margin-top:calc(var(--spacing)*10)}.mt-14{margin-top:calc(var(--spacing)*14)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.mb-\[-8px\]{margin-bottom:-8px}.mb-\[1px\]{margin-bottom:1px}.ml-1{margin-left:calc(var(--spacing)*1)}.block{display:block}.flex{display:flex}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.list-item{display:list-item}.table{display:table}.table-cell{display:table-cell}.table-row{display:table-row}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-7{width:calc(var(--spacing)*7);height:calc(var(--spacing)*7)}.size-full{width:100%;height:100%}.h-1\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-11{height:calc(var(--spacing)*11)}.h-14{height:calc(var(--spacing)*14)}.h-\[46px\]{height:46px}.h-auto{height:auto}.h-full{height:100%}.h-screen{height:100vh}.max-h-32{max-height:calc(var(--spacing)*32)}.max-h-40{max-height:calc(var(--spacing)*40)}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-28{min-height:calc(var(--spacing)*28)}.min-h-\[200px\]{min-height:200px}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-8{width:calc(var(--spacing)*8)}.w-10{width:calc(var(--spacing)*10)}.w-11{width:calc(var(--spacing)*11)}.w-64{width:calc(var(--spacing)*64)}.w-auto{width:auto}.w-full{width:100%}.w-screen{width:100vw}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-\[80\%\]{max-width:80%}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[120px\]{min-width:120px}.flex-1{flex:1}.flex-none{flex:none}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.origin-center{transform-origin:50%}.translate-y-0{--tw-translate-y:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-4{--tw-translate-y:calc(var(--spacing)*4);translate:var(--tw-translate-x)var(--tw-translate-y)}.-rotate-90{rotate:-90deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.appearance-none{appearance:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-\[4px\]>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(4px*var(--tw-space-y-reverse));margin-block-end:calc(4px*calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overscroll-y-auto{overscroll-behavior-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-br-md{border-bottom-right-radius:var(--radius-md)}.rounded-bl-md{border-bottom-left-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-\[\#0000001a\]{border-color:#0000001a}.border-\[\#0000001f\]{border-color:#0000001f}.border-\[\#5505af4d\]{border-color:#5505af4d}.border-current{border-color:currentColor}.border-red-200{border-color:var(--color-red-200)}.bg-\[\#0000001a\]{background-color:#0000001a}.bg-\[\#5505af\]{background-color:#5505af}.bg-\[\#e5e5e5\]{background-color:#e5e5e5}.bg-\[\#f5f5f5\]{background-color:#f5f5f5}.bg-\[\#ffffffcc\]{background-color:#fffc}.bg-\[var\(--sdm-bg\,transparent\)\]{background-color:var(--sdm-bg,transparent)}.bg-\[var\(--sdm-tbg\)\]{background-color:var(--sdm-tbg)}.bg-black{background-color:var(--color-black)}.bg-black\/10{background-color:#0000001a}@supports (color:color-mix(in lab, red, red)){.bg-black\/10{background-color:color-mix(in oklab,var(--color-black)10%,transparent)}}.bg-red-50{background-color:var(--color-red-50)}.bg-red-100{background-color:var(--color-red-100)}.bg-white{background-color:var(--color-white)}.bg-\[linear-gradient\(90deg\,\#5505AF_0\%\,\#CD82F0_60\%\,\#FF5F1E_100\%\)\]{background-image:linear-gradient(90deg,#5505af 0%,#cd82f0 60%,#ff5f1e 100%)}.bg-\[linear-gradient\(135deg\,\#5505AF_0\%\,\#CD82F0_55\%\,\#FF5F1E_100\%\)\]{background-image:linear-gradient(135deg,#5505af 0%,#cd82f0 55%,#ff5f1e 100%)}.fill-current{fill:currentColor}.p-1{padding:calc(var(--spacing)*1)}.p-1\.5{padding:calc(var(--spacing)*1.5)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.py-3\.5{padding-block:calc(var(--spacing)*3.5)}.py-4{padding-block:calc(var(--spacing)*4)}.py-6{padding-block:calc(var(--spacing)*6)}.py-12{padding-block:calc(var(--spacing)*12)}.pt-8{padding-top:calc(var(--spacing)*8)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pb-10{padding-bottom:calc(var(--spacing)*10)}.pb-11{padding-bottom:calc(var(--spacing)*11)}.pl-4{padding-left:calc(var(--spacing)*4)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[12px\]{font-size:12px}.text-\[14px\]{font-size:14px}.text-\[15px\]{font-size:15px}.leading-\[1\.04\]{--tw-leading:1.04;line-height:1.04}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[0\.2em\]{--tw-tracking:.2em;letter-spacing:.2em}.tracking-\[0\.22em\]{--tw-tracking:.22em;letter-spacing:.22em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.wrap-anywhere{overflow-wrap:anywhere}.break-all{word-break:break-all}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#000000b3\]{color:#000000b3}.text-\[\#6d6d6d\]{color:#6d6d6d}.text-\[\#00000080\]{color:#00000080}.text-\[\#5505af\]{color:#5505af}.text-\[\#5505afb3\]{color:#5505afb3}.text-\[var\(--sdm-c\,inherit\)\]{color:var(--sdm-c,inherit)}.text-black{color:var(--color-black)}.text-gray-500\/70{color:#6a7282b3}@supports (color:color-mix(in lab, red, red)){.text-gray-500\/70{color:color-mix(in oklab,var(--color-gray-500)70%,transparent)}}.text-gray-800{color:var(--color-gray-800)}.text-gray-900{color:var(--color-gray-900)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-red-800{color:var(--color-red-800)}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.underline{text-decoration-line:underline}.decoration-\[\#5505af4d\]{text-decoration-color:#5505af4d}.underline-offset-4{text-underline-offset:4px}.placeholder-\[\#6d6d6d\]::placeholder{color:#6d6d6d}.opacity-0{opacity:0}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.duration-600{--tw-duration:.6s;transition-duration:.6s}.duration-700{--tw-duration:.7s;transition-duration:.7s}.duration-1000{--tw-duration:1s;transition-duration:1s}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.select-none{-webkit-user-select:none;user-select:none}.\[counter-increment\:line_0\]{counter-increment:line 0}.\[counter-reset\:line\]{counter-reset:line}@media (hover:hover){.group-hover\:block:is(:where(.group):hover *){display:block}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.before\:mr-4:before{content:var(--tw-content);margin-right:calc(var(--spacing)*4)}.before\:inline-block:before{content:var(--tw-content);display:inline-block}.before\:w-6:before{content:var(--tw-content);width:calc(var(--spacing)*6)}.before\:text-right:before{content:var(--tw-content);text-align:right}.before\:font-mono:before{content:var(--tw-content);font-family:var(--font-mono)}.before\:text-\[13px\]:before{content:var(--tw-content);font-size:13px}.before\:content-\[counter\(line\)\]:before{--tw-content:counter(line);content:var(--tw-content)}.before\:select-none:before{content:var(--tw-content);-webkit-user-select:none;user-select:none}.before\:\[counter-increment\:line\]:before{content:var(--tw-content);counter-increment:line}:is(.\*\:first\:mt-0>*):first-child{margin-top:calc(var(--spacing)*0)}:is(.\*\:last\:mb-0>*):last-child{margin-bottom:calc(var(--spacing)*0)}:is(.\*\:last\:after\:inline>*):last-child:after{content:var(--tw-content);display:inline}:is(.\*\:last\:after\:align-baseline>*):last-child:after{content:var(--tw-content);vertical-align:baseline}:is(.\*\:last\:after\:content-\[var\(--streamdown-caret\)\]>*):last-child:after{--tw-content:var(--streamdown-caret);content:var(--tw-content)}@media (hover:hover){.hover\:-translate-y-0\.5:hover{--tw-translate-y:calc(var(--spacing)*-.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.hover\:scale-\[1\.02\]:hover{scale:1.02}.hover\:border-\[\#5505af\]:hover{border-color:#5505af}.hover\:bg-\[\#1f1f1f\]:hover{background-color:#1f1f1f}.hover\:bg-\[\#5505af\]:hover{background-color:#5505af}.hover\:bg-\[\#f5f5f5\]:hover{background-color:#f5f5f5}.hover\:text-\[\#5505af\]:hover{color:#5505af}.hover\:text-black:hover{color:var(--color-black)}.hover\:text-gray-800:hover{color:var(--color-gray-800)}}.focus\:border-\[\#5505af\]:focus{border-color:#5505af}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-\[\#5505af\]:focus{--tw-ring-color:#5505af}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media (width>=40rem){.sm\:h-12{height:calc(var(--spacing)*12)}.sm\:gap-5{gap:calc(var(--spacing)*5)}.sm\:px-6{padding-inline:calc(var(--spacing)*6)}.sm\:px-8{padding-inline:calc(var(--spacing)*8)}.sm\:py-5{padding-block:calc(var(--spacing)*5)}.sm\:text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.sm\:text-7xl{font-size:var(--text-7xl);line-height:var(--tw-leading,var(--text-7xl--line-height))}.sm\:text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.sm\:text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.sm\:text-\[15px\]{font-size:15px}}@media (width>=64rem){.lg\:flex-row{flex-direction:row}.lg\:px-14{padding-inline:calc(var(--spacing)*14)}.lg\:text-7xl{font-size:var(--text-7xl);line-height:var(--tw-leading,var(--text-7xl--line-height))}}@media (prefers-color-scheme:dark){.dark\:bg-\[var\(--shiki-dark-bg\,var\(--sdm-bg\,transparent\)\)\]{background-color:var(--shiki-dark-bg,var(--sdm-bg,transparent))}.dark\:bg-\[var\(--shiki-dark-bg\,var\(--sdm-tbg\)\)\]{background-color:var(--shiki-dark-bg,var(--sdm-tbg))}.dark\:text-\[var\(--shiki-dark\,var\(--sdm-c\,inherit\)\)\]{color:var(--shiki-dark,var(--sdm-c,inherit))}}.\[\&_svg\]\:h-auto svg{height:auto}.\[\&_svg\]\:w-auto svg{width:auto}.\[\&\>p\]\:inline>p{display:inline}li .\[li_\&\]\:pl-6{padding-left:calc(var(--spacing)*6)}}@font-face{font-family:Sohne;src:url(/fonts/S%C3%B6hne/S%C3%B6hne-Leicht.otf)format("opentype");font-weight:300;font-style:normal;font-display:swap}@font-face{font-family:Sohne;src:url(/fonts/S%C3%B6hne/S%C3%B6hne-Buch.otf)format("opentype");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:Sohne;src:url(/fonts/S%C3%B6hne/S%C3%B6hne-Kr%C3%A4ftig.otf)format("opentype");font-weight:700;font-style:normal;font-display:swap}@font-face{font-family:JetBrains Mono;src:url(/fonts/JetBrains/JetBrainsMono-VariableFont_wght.ttf)format("truetype");font-weight:100 800;font-style:normal;font-display:swap}@font-face{font-family:JetBrains Mono;src:url(/fonts/JetBrains/JetBrainsMono-Italic-VariableFont_wght.ttf)format("truetype");font-weight:100 800;font-style:italic;font-display:swap}.brand-surface{background:radial-gradient(ellipse 70% 50% at 86% 12%,var(--brand-purple-light-30),transparent 70%),radial-gradient(ellipse 70% 50% at 12% 86%,var(--brand-orange-30),transparent 72%),radial-gradient(ellipse 65% 45% at 55% 52%,var(--brand-purple-10),transparent 72%),var(--brand-white)}.landing-brand-glow{background:radial-gradient(ellipse 52% 38% at 12% 25%,var(--brand-purple-light-30),transparent),radial-gradient(ellipse 48% 38% at 88% 68%,var(--brand-orange-30),transparent);animation:10s ease-in-out infinite brand-shift}@keyframes brand-shift{0%,to{opacity:.5;transform:translate(0)}50%{opacity:1;transform:translateY(-6px)}}@keyframes pulse-gentle{0%,to{opacity:.6}50%{opacity:1}}.animate-pulse-gentle{animation:2.5s ease-in-out infinite pulse-gentle}@keyframes rise-in{0%{opacity:0;transform:translateY(32px)}to{opacity:1;transform:translate(0)}}.animate-rise-in{animation:.8s cubic-bezier(.22,1,.36,1) both rise-in}.animate-rise-in-delayed{animation:1s cubic-bezier(.22,1,.36,1) .12s both rise-in}.font-support{font-family:JetBrains Mono,ui-monospace,SFMono-Regular,Menlo,monospace}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.animate-fade-in{animation:.5s ease-out both fade-in}@keyframes thinking-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.thinking-shimmer{-webkit-text-fill-color:transparent;background:linear-gradient(105deg,#6d6d6d 0% 40%,#5505af 50%,#6d6d6d 60% 100%) 0 0/200% 100%;-webkit-background-clip:text;background-clip:text;animation:2s ease-in-out infinite thinking-shimmer}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2)format("woff2"),url(/assets/KaTeX_AMS-Regular-DMm9YOAa.woff)format("woff"),url(/assets/KaTeX_AMS-Regular-DRggAlZN.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2)format("woff2"),url(/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff)format("woff"),url(/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2)format("woff2"),url(/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff)format("woff"),url(/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2)format("woff2"),url(/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff)format("woff"),url(/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2)format("woff2"),url(/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff)format("woff"),url(/assets/KaTeX_Fraktur-Regular-CB_wures.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Main-Bold-Cx986IdX.woff2)format("woff2"),url(/assets/KaTeX_Main-Bold-Jm3AIy58.woff)format("woff"),url(/assets/KaTeX_Main-Bold-waoOVXN0.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2)format("woff2"),url(/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff)format("woff"),url(/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2)format("woff2"),url(/assets/KaTeX_Main-Italic-BMLOBm91.woff)format("woff"),url(/assets/KaTeX_Main-Italic-3WenGoN9.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Main-Regular-B22Nviop.woff2)format("woff2"),url(/assets/KaTeX_Main-Regular-Dr94JaBh.woff)format("woff"),url(/assets/KaTeX_Main-Regular-ypZvNtVU.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2)format("woff2"),url(/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff)format("woff"),url(/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Math-Italic-t53AETM-.woff2)format("woff2"),url(/assets/KaTeX_Math-Italic-DA0__PXp.woff)format("woff"),url(/assets/KaTeX_Math-Italic-flOr_0UB.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2)format("woff2"),url(/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff)format("woff"),url(/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2)format("woff2"),url(/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff)format("woff"),url(/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2)format("woff2"),url(/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff)format("woff"),url(/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Script-Regular-D3wIWfF6.woff2)format("woff2"),url(/assets/KaTeX_Script-Regular-D5yQViql.woff)format("woff"),url(/assets/KaTeX_Script-Regular-C5JkGWo-.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2)format("woff2"),url(/assets/KaTeX_Size1-Regular-C195tn64.woff)format("woff"),url(/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2)format("woff2"),url(/assets/KaTeX_Size2-Regular-oD1tc_U0.woff)format("woff"),url(/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC)format("woff2"),url(/assets/KaTeX_Size3-Regular-CTq5MqoE.woff)format("woff"),url(/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2)format("woff2"),url(/assets/KaTeX_Size4-Regular-BF-4gkZK.woff)format("woff"),url(/assets/KaTeX_Size4-Regular-DWFBv043.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2)format("woff2"),url(/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff)format("woff"),url(/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf)format("truetype")}.katex{text-indent:0;text-rendering:auto;font:1.21em/1.2 KaTeX_Main,Times New Roman,serif}.katex *{border-color:currentColor;-ms-high-contrast-adjust:none!important}.katex .katex-version:after{content:"0.16.28"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;width:1px;height:1px;padding:0;position:absolute;overflow:hidden}.katex .katex-html>.newline{display:block}.katex .base{white-space:nowrap;width:min-content;position:relative}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;table-layout:fixed;display:inline-table}.katex .vlist-r{display:table-row}.katex .vlist{vertical-align:bottom;display:table-cell;position:relative}.katex .vlist>span{height:0;display:block;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{width:0;overflow:hidden}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{vertical-align:bottom;width:2px;min-width:2px;font-size:1px;display:table-cell}.katex .vbox{flex-direction:column;align-items:baseline;display:inline-flex}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{flex-direction:row;display:inline-flex}.katex .thinbox{width:0;max-width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;width:100%;display:inline-block}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{width:0;position:relative}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;width:100%;display:inline-block}.katex .hdashline{border-bottom-style:dashed;width:100%;display:inline-block}.katex .sqrt>.root{margin-left:.277778em;margin-right:-.555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.833333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.16667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.33333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.66667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.45667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.14667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.714286em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.857143em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.14286em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.28571em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.42857em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.71429em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.05714em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.46857em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.96286em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.55429em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.11111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.33333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.30444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.76444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.416667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.583333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.833333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.72833em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.07333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.347222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.416667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.486111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.694444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.833333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.44028em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.72778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.289352em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.347222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.405093em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.520833em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.578704em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.694444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.833333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.20023em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.43981em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.24108em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.289296em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.385728em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.433944em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.48216em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.578592em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.694311em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.833173em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.19961em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.200965em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.241158em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.281351em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.321543em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.361736em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.401929em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.482315em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.694534em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.833601em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{width:.12em;display:inline-block}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{min-width:1px;display:inline-block}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;height:inherit;width:100%;display:block;position:absolute}.katex svg path{stroke:none}.katex img{border-style:none;min-width:0;max-width:none;min-height:0;max-height:none}.katex .stretchy{width:100%;display:block;position:relative;overflow:hidden}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{width:100%;position:relative;overflow:hidden}.katex .halfarrow-left{width:50.2%;position:absolute;left:0;overflow:hidden}.katex .halfarrow-right{width:50.2%;position:absolute;right:0;overflow:hidden}.katex .brace-left{width:25.1%;position:absolute;left:0;overflow:hidden}.katex .brace-center{width:50%;position:absolute;left:25%;overflow:hidden}.katex .brace-right{width:25.1%;position:absolute;right:0;overflow:hidden}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{box-sizing:border-box;border:.04em solid}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{box-sizing:border-box;border-top:.049em solid;border-right:.049em solid;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{text-align:left;display:inline-block;position:absolute;right:calc(50% + .3em)}.katex .cd-label-right{text-align:right;display:inline-block;position:absolute;left:calc(50% + .3em)}.katex-display{text-align:center;margin:1em 0;display:block}.katex-display>.katex{text-align:center;white-space:nowrap;display:block}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{text-align:left;padding-left:2em}body{counter-reset:katexEqnNo mmlEqnNo} diff --git a/dist/assets/mermaid-NOHMQCX5-xIBRY4WD.js b/dist/assets/mermaid-NOHMQCX5-xIBRY4WD.js new file mode 100644 index 0000000000000000000000000000000000000000..b68742a7ca18bc506fd7b28a561a9e445c212d4f --- /dev/null +++ b/dist/assets/mermaid-NOHMQCX5-xIBRY4WD.js @@ -0,0 +1 @@ +import{a as e}from"./index-BfkQJ3LR.js";export{e as Mermaid}; \ No newline at end of file diff --git a/dist/fonts/JetBrains/JetBrainsMono-Italic-VariableFont_wght.ttf b/dist/fonts/JetBrains/JetBrainsMono-Italic-VariableFont_wght.ttf new file mode 100644 index 0000000000000000000000000000000000000000..d8a9eaa68dc66c1e108571a2bebf6ae11879542a --- /dev/null +++ b/dist/fonts/JetBrains/JetBrainsMono-Italic-VariableFont_wght.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d2a1563e89aa3c3816abfbca03e295abcdca11d9cbd689a7754cc1c5f454d18f +size 191988 diff --git a/dist/fonts/JetBrains/JetBrainsMono-VariableFont_wght.ttf b/dist/fonts/JetBrains/JetBrainsMono-VariableFont_wght.ttf new file mode 100644 index 0000000000000000000000000000000000000000..8d80506ef6e61067e429bb8e8d731b04a7a94ad9 --- /dev/null +++ b/dist/fonts/JetBrains/JetBrainsMono-VariableFont_wght.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6490e1a902e56fc84050bee9aad91509e6f45aa00f96f882dab53c9abaf83eb +size 187860 diff --git "a/dist/fonts/S\303\266hne/S\303\266hne-Buch.otf" "b/dist/fonts/S\303\266hne/S\303\266hne-Buch.otf" new file mode 100644 index 0000000000000000000000000000000000000000..0a2f37c614c67c1c021359717c184674c4498640 --- /dev/null +++ "b/dist/fonts/S\303\266hne/S\303\266hne-Buch.otf" @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3e050e7df5a5695e1ba1691633f2a8767ea9c6ac747fccf7b23a38e4ca02cc2 +size 191552 diff --git "a/dist/fonts/S\303\266hne/S\303\266hne-Kr\303\244ftig.otf" "b/dist/fonts/S\303\266hne/S\303\266hne-Kr\303\244ftig.otf" new file mode 100644 index 0000000000000000000000000000000000000000..68b449d7c171130db287eda022cb19fa26c2770d --- /dev/null +++ "b/dist/fonts/S\303\266hne/S\303\266hne-Kr\303\244ftig.otf" @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f17003124700a22684c3f83ac8252793f1e6e902842e385d4bd4220f94a79cb +size 245976 diff --git "a/dist/fonts/S\303\266hne/S\303\266hne-Leicht.otf" "b/dist/fonts/S\303\266hne/S\303\266hne-Leicht.otf" new file mode 100644 index 0000000000000000000000000000000000000000..c0444229a7a34c237d17114bbd7f5ccff10223e8 --- /dev/null +++ "b/dist/fonts/S\303\266hne/S\303\266hne-Leicht.otf" @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:366970f59ef3332afd6d0a2a5bc84e71c002c2a351a93a8a66f315e5892be028 +size 191884 diff --git a/dist/index.html b/dist/index.html new file mode 100644 index 0000000000000000000000000000000000000000..b4ff314ef163b5d64c207cf23df4763a6271b9e9 --- /dev/null +++ b/dist/index.html @@ -0,0 +1,17 @@ + + + + + + + LFM2.5 WebGPU + + + + +
    + + diff --git a/dist/liquid-dark.webp b/dist/liquid-dark.webp new file mode 100644 index 0000000000000000000000000000000000000000..fbc70d0d209af36e97ed4fe0dc886b5312f2c4ae Binary files /dev/null and b/dist/liquid-dark.webp differ diff --git a/dist/liquid.svg b/dist/liquid.svg new file mode 100644 index 0000000000000000000000000000000000000000..91f23296297b42ee1be8e54ef12b8cb16ee12534 --- /dev/null +++ b/dist/liquid.svg @@ -0,0 +1,11 @@ + + + + + + + + + + +