familiar-vue 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -3
- package/dist/blocks/bots/engine/plastic.d.ts +5 -0
- package/dist/blocks/bots/engine/types.d.ts +5 -3
- package/dist/blocks/bots/types-1.d.ts +2 -2
- package/dist/blocks/bots/types.d.ts +2 -2
- package/dist/blocks/gallery/GalleryGrid.vue.d.ts +46 -0
- package/dist/blocks/gallery/MusicPlayer.vue.d.ts +34 -0
- package/dist/blocks/gallery/VideoPlayer.vue.d.ts +34 -0
- package/dist/blocks/gallery/icons.d.ts +49 -0
- package/dist/blocks/gallery/index.d.ts +141 -0
- package/dist/blocks/gallery/styles.d.ts +1 -0
- package/dist/blocks/gallery/support.d.ts +38 -0
- package/dist/blocks/gallery/types.d.ts +132 -0
- package/dist/blocks/image/studio/ImageStudio.vue.d.ts +1 -1
- package/dist/blocks/jelly/JellySurface.vue.d.ts +43 -0
- package/dist/blocks/jelly/engine/color.d.ts +12 -0
- package/dist/blocks/jelly/engine/environment.d.ts +2 -0
- package/dist/blocks/jelly/engine/frosted.d.ts +25 -0
- package/dist/blocks/jelly/engine/geometry.d.ts +13 -0
- package/dist/blocks/jelly/engine/icons.d.ts +16 -0
- package/dist/blocks/jelly/engine/renderer.d.ts +39 -0
- package/dist/blocks/jelly/engine/sound.d.ts +9 -0
- package/dist/blocks/jelly/engine/textures.d.ts +5 -0
- package/dist/blocks/jelly/index.d.ts +23 -0
- package/dist/blocks/jelly/types.d.ts +68 -0
- package/dist/blocks/loading/BreathingRing.vue.d.ts +25 -0
- package/dist/blocks/loading/index.d.ts +54 -1
- package/dist/blocks/loading/types.d.ts +22 -0
- package/dist/blocks/metal/MetalBadge.vue.d.ts +2 -2
- package/dist/bots.cjs +1 -1
- package/dist/bots.js +1 -1
- package/dist/familiar-vue.css +1 -1
- package/dist/gallery.cjs +2 -0
- package/dist/gallery.cjs.map +1 -0
- package/dist/gallery.d.ts +1 -0
- package/dist/gallery.js +8 -0
- package/dist/gallery.js.map +1 -0
- package/dist/index-Bb3rhhZY.cjs +221 -0
- package/dist/index-Bb3rhhZY.cjs.map +1 -0
- package/dist/index-C96O9k0x.cjs +289 -0
- package/dist/index-C96O9k0x.cjs.map +1 -0
- package/dist/index-CgkG0Pah.js +2580 -0
- package/dist/index-CgkG0Pah.js.map +1 -0
- package/dist/index-CjA5aaxl.js +934 -0
- package/dist/index-CjA5aaxl.js.map +1 -0
- package/dist/index-CpPZg7s9.js +476 -0
- package/dist/index-CpPZg7s9.js.map +1 -0
- package/dist/{index-CQIOTNIw.js → index-Da5OgBHn.js} +1269 -1239
- package/dist/index-Da5OgBHn.js.map +1 -0
- package/dist/index-Dc4JnH_g.cjs +80 -0
- package/dist/index-Dc4JnH_g.cjs.map +1 -0
- package/dist/index-U59nAOr-.cjs +1096 -0
- package/dist/index-U59nAOr-.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.js +58 -49
- package/dist/index.js.map +1 -1
- package/dist/jelly.cjs +2 -0
- package/dist/jelly.cjs.map +1 -0
- package/dist/jelly.d.ts +2 -0
- package/dist/jelly.js +9 -0
- package/dist/jelly.js.map +1 -0
- package/dist/loading.cjs +1 -1
- package/dist/loading.js +4 -3
- package/package.json +11 -1
- package/dist/index-BAZi5af3.cjs +0 -221
- package/dist/index-BAZi5af3.cjs.map +0 -1
- package/dist/index-BmMsid7x.js +0 -422
- package/dist/index-BmMsid7x.js.map +0 -1
- package/dist/index-CQIOTNIw.js.map +0 -1
- package/dist/index-DZJ-MNwi.cjs +0 -80
- package/dist/index-DZJ-MNwi.cjs.map +0 -1
package/dist/index-BAZi5af3.cjs
DELETED
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
"use strict";const V=require("vue"),_e={clover:{label:"Clover",color:"#41C4FF",face:"eyes",faceX:50,faceY:50,faceScale:1,brightness:1.2,saturation:1.59},flower:{label:"Flower",color:"#2FCB7A",face:"eyes",faceX:50,faceY:51,faceScale:.95},triangle:{label:"Triangle",color:"#DC48FF",face:"eyes",faceX:50,faceY:61,faceScale:.9},square:{label:"Square",color:"#35B8FF",face:"eyes",faceX:50,faceY:50,faceScale:1},blob:{label:"Blob",color:"#2FCB7A",face:"eyes",faceX:49.5,faceY:50,faceScale:1},ghost:{label:"Ghost",color:"#F4F2FA",face:"eyes",faceX:50,faceY:48,faceScale:.95},circle:{label:"Circle",color:"#9A62FF",face:"eyes",faceX:50,faceY:50,faceScale:1},drop:{label:"Drop",color:"#1ED3C6",face:"eyes",faceX:50,faceY:62,faceScale:.9},star:{label:"Star",color:"#EFDB8E",face:"eyes",faceX:50,faceY:52,faceScale:.82,brightness:1.1,saturation:1.84},droid:{label:"Droid",color:"#D5DBEA",face:"eyes",faceX:50,faceY:60,faceScale:.95},mech:{label:"Mech",color:"#95A6C4",face:"eyes",faceX:50,faceY:59,faceScale:1},alien:{label:"Alien",color:"#9CD66A",face:"eyes",faceX:50,faceY:45,faceScale:1.05},hexagon:{label:"Hexagon",color:"#EB7575",face:"eyes",faceX:50,faceY:50,faceScale:.95},cat:{label:"Cat",color:"#EAA06F",face:"eyes",faceX:50,faceY:58,faceScale:1,brightness:1.22,saturation:1.88},cloud:{label:"Cloud",color:"#CFD5E4",face:"eyes",faceX:50,faceY:58,faceScale:.95},pill:{label:"Pill",color:"#ACAAF3",face:"eyes",faceX:50,faceY:50,faceScale:.9},pebble:{label:"Pebble",color:"#ABC793",face:"eyes",faceX:50,faceY:50,faceScale:.95},puddle:{label:"Puddle",color:"#EE8BDB",face:"eyes",faceX:50,faceY:50,faceScale:.95}},Ba=Object.keys(_e),Ti=["eyes","mouth"],Ii=["default","working","sleeping","happy","sleepy","questioning","loving","surprised","playful"],Fi=Object.fromEntries(Ba.map(t=>[t,_e[t].color])),_s={default:"idle",working:"working",sleeping:"sleeping",happy:"happy",sleepy:"sleepy",questioning:"questioning",loving:"loving",surprised:"surprised",playful:"playful"},qs={clover:"M26.53 22.38A25 25 0 0 1 73.47 22.38A7 7 0 0 0 77.62 26.53A25 25 0 0 1 77.62 73.47A7 7 0 0 0 73.47 77.62A25 25 0 0 1 26.53 77.62A7 7 0 0 0 22.38 73.47A25 25 0 0 1 22.38 26.53A7 7 0 0 0 26.53 22.38Z",flower:"M31.2 19.82A20.5 20.5 0 0 1 68.8 19.82A5 5 0 0 0 72.9 22.8A20.5 20.5 0 0 1 84.51 58.55A5 5 0 0 0 82.95 63.37A20.5 20.5 0 0 1 52.54 85.47A5 5 0 0 0 47.46 85.47A20.5 20.5 0 0 1 17.05 63.37A5 5 0 0 0 15.49 58.55A20.5 20.5 0 0 1 27.1 22.8A5 5 0 0 0 31.2 19.82Z",triangle:"M38.75 27.43A13 13 0 0 1 61.25 27.43L82.7 64.49A13 13 0 0 1 71.45 84L28.55 84A13 13 0 0 1 17.3 64.49L38.75 27.43Z",square:"M93 50C93 53.66 92.96 58.23 92.88 60.97C92.8 63.71 92.67 64.81 92.51 66.44C92.35 68.08 92.15 69.44 91.9 70.77C91.66 72.1 91.37 73.3 91.04 74.44C90.72 75.58 90.35 76.63 89.94 77.63C89.53 78.63 89.07 79.55 88.58 80.43C88.08 81.31 87.54 82.13 86.96 82.9C86.37 83.67 85.75 84.39 85.07 85.07C84.39 85.75 83.67 86.37 82.9 86.96C82.13 87.54 81.31 88.08 80.43 88.58C79.55 89.07 78.63 89.53 77.63 89.94C76.63 90.35 75.58 90.72 74.44 91.04C73.3 91.37 72.1 91.66 70.77 91.9C69.44 92.15 68.08 92.35 66.44 92.51C64.81 92.67 63.71 92.8 60.97 92.88C58.23 92.96 53.66 93 50 93C46.34 93 41.77 92.96 39.03 92.88C36.29 92.8 35.19 92.67 33.56 92.51C31.92 92.35 30.56 92.15 29.23 91.9C27.9 91.66 26.7 91.37 25.56 91.04C24.42 90.72 23.37 90.35 22.37 89.94C21.37 89.53 20.45 89.07 19.57 88.58C18.69 88.08 17.87 87.54 17.1 86.96C16.33 86.37 15.61 85.75 14.93 85.07C14.25 84.39 13.63 83.67 13.04 82.9C12.46 82.13 11.92 81.31 11.42 80.43C10.93 79.55 10.47 78.63 10.06 77.63C9.65 76.63 9.28 75.58 8.96 74.44C8.63 73.3 8.34 72.1 8.1 70.77C7.85 69.44 7.65 68.08 7.49 66.44C7.33 64.81 7.2 63.71 7.12 60.97C7.04 58.23 7 53.66 7 50C7 46.34 7.04 41.77 7.12 39.03C7.2 36.29 7.33 35.19 7.49 33.56C7.65 31.92 7.85 30.56 8.1 29.23C8.34 27.9 8.63 26.7 8.96 25.56C9.28 24.42 9.65 23.37 10.06 22.37C10.47 21.37 10.93 20.45 11.42 19.57C11.92 18.69 12.46 17.87 13.04 17.1C13.63 16.33 14.25 15.61 14.93 14.93C15.61 14.25 16.33 13.63 17.1 13.04C17.87 12.46 18.69 11.92 19.57 11.42C20.45 10.93 21.37 10.47 22.37 10.06C23.37 9.65 24.42 9.28 25.56 8.96C26.7 8.63 27.9 8.34 29.23 8.1C30.56 7.85 31.92 7.65 33.56 7.49C35.19 7.33 36.29 7.2 39.03 7.12C41.77 7.04 46.34 7 50 7C53.66 7 58.23 7.04 60.97 7.12C63.71 7.2 64.81 7.33 66.44 7.49C68.08 7.65 69.44 7.85 70.77 8.1C72.1 8.34 73.3 8.63 74.44 8.96C75.58 9.28 76.63 9.65 77.63 10.06C78.63 10.47 79.55 10.93 80.43 11.42C81.31 11.92 82.13 12.46 82.9 13.04C83.67 13.63 84.39 14.25 85.07 14.93C85.75 15.61 86.37 16.33 86.96 17.1C87.54 17.87 88.08 18.69 88.58 19.57C89.07 20.45 89.53 21.37 89.94 22.37C90.35 23.37 90.72 24.42 91.04 25.56C91.37 26.7 91.66 27.9 91.9 29.23C92.15 30.56 92.35 31.92 92.51 33.56C92.67 35.19 92.8 36.29 92.88 39.03C92.96 41.77 93 46.34 93 50Z",blob:"M93.92 50C94.18 51.9 94.24 53.9 93.99 55.79C93.73 57.68 93.18 59.61 92.39 61.36C91.6 63.1 90.48 64.78 89.27 66.27C88.07 67.76 86.58 69.08 85.14 70.29C83.7 71.49 82.1 72.5 80.62 73.5C79.14 74.49 77.64 75.34 76.24 76.24C74.84 77.15 73.51 78 72.2 78.93C70.88 79.86 69.66 80.83 68.36 81.8C67.06 82.76 65.78 83.82 64.39 84.74C63 85.67 61.55 86.63 60.01 87.35C58.47 88.08 56.82 88.73 55.15 89.1C53.48 89.47 51.71 89.64 50 89.57C48.29 89.5 46.55 89.16 44.91 88.68C43.27 88.21 41.67 87.47 40.16 86.72C38.65 85.96 37.24 85.02 35.86 84.13C34.48 83.24 33.19 82.29 31.89 81.37C30.58 80.46 29.32 79.56 28.03 78.63C26.74 77.71 25.44 76.82 24.16 75.84C22.88 74.86 21.57 73.87 20.36 72.74C19.15 71.62 17.95 70.42 16.91 69.1C15.88 67.79 14.92 66.35 14.15 64.85C13.38 63.35 12.76 61.73 12.29 60.1C11.81 58.48 11.52 56.78 11.29 55.1C11.06 53.41 10.98 51.71 10.91 50C10.83 48.29 10.83 46.59 10.83 44.84C10.84 43.1 10.85 41.34 10.93 39.53C11.02 37.72 11.09 35.86 11.34 33.99C11.59 32.12 11.88 30.16 12.43 28.31C12.99 26.46 13.69 24.56 14.66 22.88C15.64 21.21 16.86 19.58 18.27 18.27C19.69 16.96 21.4 15.84 23.17 15.03C24.93 14.22 26.95 13.71 28.89 13.43C30.83 13.15 32.9 13.21 34.82 13.36C36.74 13.5 38.66 13.92 40.43 14.28C42.2 14.65 43.87 15.16 45.46 15.54C47.06 15.93 48.52 16.31 50 16.58C51.48 16.85 52.87 17.02 54.32 17.17C55.77 17.32 57.22 17.36 58.71 17.49C60.2 17.62 61.74 17.7 63.28 17.95C64.81 18.19 66.39 18.5 67.91 18.98C69.43 19.46 70.95 20.08 72.38 20.83C73.81 21.58 75.19 22.5 76.5 23.5C77.81 24.5 79.03 25.63 80.22 26.81C81.41 27.99 82.54 29.25 83.65 30.57C84.76 31.89 85.85 33.26 86.89 34.72C87.93 36.18 88.98 37.69 89.9 39.31C90.82 40.92 91.73 42.64 92.4 44.42C93.07 46.2 93.66 48.1 93.92 50Z",ghost:"M17 50C17 31.78 31.78 17 50 17C68.22 17 83 31.78 83 50V81.5Q72 93.5 61 81.5Q50 93.5 39 81.5Q28 93.5 17 81.5Z",circle:"M50 8A42 42 0 1 1 50 92A42 42 0 1 1 50 8Z",drop:"M50 8.5C52.2 8.5 53.4 10.3 56.4 15.2C62.9 25.5 84 44.6 84 61.5C84 80.3 68.8 92 50 92C31.2 92 16 80.3 16 61.5C16 44.6 37.1 25.5 43.6 15.2C46.6 10.3 47.8 8.5 50 8.5Z",star:"M45.77 9.7A5 5 0 0 1 54.23 9.7L65.02 26.81A4 4 0 0 0 67.42 28.55L87.02 33.53A5 5 0 0 1 89.63 41.57L76.7 57.12A4 4 0 0 0 75.78 59.94L77.11 80.12A5 5 0 0 1 70.26 85.09L51.48 77.59A4 4 0 0 0 48.52 77.59L29.74 85.09A5 5 0 0 1 22.89 80.12L24.22 59.94A4 4 0 0 0 23.3 57.12L10.37 41.57A5 5 0 0 1 12.98 33.53L32.58 28.55A4 4 0 0 0 34.98 26.81L45.77 9.7Z",droid:"M16 50C16 38.95 24.95 30 36 30H64C75.05 30 84 38.95 84 50V70C84 81.05 75.05 90 64 90H36C24.95 90 16 81.05 16 70ZM4 62A7 7 0 1 1 18 62A7 7 0 1 1 4 62ZM82 62A7 7 0 1 1 96 62A7 7 0 1 1 82 62Z",mech:"M10 48C10 38.06 18.06 30 28 30H72C81.94 30 90 38.06 90 48V70C90 79.94 81.94 88 72 88H28C18.06 88 10 79.94 10 70ZM3 54C3 51.79 4.79 50 7 50H11V72H7C4.79 72 3 70.21 3 68ZM89 50H93C95.21 50 97 51.79 97 54V68C97 70.21 95.21 72 93 72H89Z",alien:"M50 10C70 10 83 27 83 46C83 65 64 92 50 92C36 92 17 65 17 46C17 27 30 10 50 10Z",hexagon:"M91.4 45.5A9 9 0 0 1 91.4 54.5L74.6 83.61A9 9 0 0 1 66.8 88.11L33.2 88.11A9 9 0 0 1 25.4 83.61L8.6 54.5A9 9 0 0 1 8.6 45.5L25.4 16.39A9 9 0 0 1 33.2 11.89L66.8 11.89A9 9 0 0 1 74.6 16.39L91.4 45.5Z",cat:"M50 20A36 36 0 1 1 50 92A36 36 0 1 1 50 20ZM24.72 44.64A4.5 4.5 0 0 1 17.35 40.67L20.21 16.66A4.5 4.5 0 0 1 26.86 13.26L42.3 21.83A4.5 4.5 0 0 1 43.02 29.21L24.72 44.64ZM82.65 40.67A4.5 4.5 0 0 1 75.28 44.64L56.98 29.21A4.5 4.5 0 0 1 57.7 21.83L73.14 13.26A4.5 4.5 0 0 1 79.79 16.66L82.65 40.67Z",cloud:"M19 44A25 25 0 1 1 69 44A25 25 0 1 1 19 44ZM47 50A21 21 0 1 1 89 50A21 21 0 1 1 47 50ZM7 68A17 17 0 1 1 41 68A17 17 0 1 1 7 68ZM32 73A18 18 0 1 1 68 73A18 18 0 1 1 32 73ZM60 70A16 16 0 1 1 92 70A16 16 0 1 1 60 70Z",pill:"M28 28H72C84.15 28 94 37.85 94 50C94 62.15 84.15 72 72 72H28C15.85 72 6 62.15 6 50C6 37.85 15.85 28 28 28Z",pebble:"M94.6 50C94.71 51.92 94.56 53.93 94.17 55.82C93.79 57.7 93.13 59.6 92.28 61.33C91.44 63.06 90.32 64.72 89.1 66.19C87.87 67.67 86.41 69.01 84.92 70.16C83.42 71.31 81.75 72.29 80.11 73.1C78.47 73.92 76.73 74.55 75.06 75.06C73.39 75.58 71.7 75.91 70.1 76.2C68.5 76.48 66.93 76.62 65.45 76.76C63.96 76.9 62.55 76.94 61.2 77.03C59.84 77.11 58.57 77.16 57.31 77.26C56.05 77.36 54.86 77.48 53.64 77.63C52.42 77.79 51.24 77.98 50 78.18C48.76 78.39 47.52 78.64 46.2 78.85C44.89 79.06 43.53 79.3 42.11 79.46C40.69 79.61 39.2 79.75 37.67 79.77C36.14 79.78 34.54 79.74 32.95 79.54C31.35 79.33 29.7 79.03 28.1 78.55C26.49 78.07 24.86 77.45 23.33 76.67C21.8 75.88 20.29 74.94 18.92 73.85C17.54 72.77 16.23 71.51 15.08 70.16C13.94 68.8 12.9 67.29 12.04 65.72C11.17 64.16 10.45 62.46 9.91 60.74C9.36 59.03 8.98 57.22 8.76 55.43C8.55 53.64 8.5 51.8 8.6 50C8.71 48.2 8.98 46.39 9.38 44.65C9.79 42.91 10.35 41.19 11.02 39.56C11.7 37.92 12.52 36.34 13.43 34.85C14.34 33.37 15.39 31.96 16.5 30.66C17.61 29.36 18.84 28.15 20.11 27.07C21.39 25.98 22.76 25 24.15 24.15C25.54 23.3 27.01 22.56 28.48 21.95C29.94 21.33 31.46 20.85 32.95 20.46C34.44 20.08 35.95 19.83 37.43 19.66C38.91 19.48 40.38 19.43 41.81 19.43C43.24 19.43 44.64 19.53 46.01 19.66C47.37 19.78 48.7 19.98 50 20.18C51.3 20.39 52.57 20.63 53.83 20.87C55.1 21.11 56.34 21.37 57.6 21.62C58.87 21.87 60.13 22.12 61.43 22.39C62.74 22.66 64.07 22.93 65.45 23.24C66.83 23.56 68.25 23.88 69.72 24.3C71.19 24.72 72.71 25.17 74.25 25.75C75.78 26.34 77.37 27 78.91 27.81C80.46 28.63 82.04 29.56 83.5 30.66C84.97 31.75 86.43 33 87.7 34.38C88.98 35.77 90.19 37.32 91.17 38.97C92.14 40.62 92.98 42.43 93.56 44.27C94.13 46.1 94.5 48.08 94.6 50Z",puddle:"M85.34 50C85.65 51.54 85.9 53.13 86.01 54.74C86.11 56.35 86.11 58 85.95 59.63C85.8 61.26 85.51 62.93 85.07 64.52C84.62 66.12 84.03 67.72 83.3 69.23C82.58 70.74 81.7 72.21 80.72 73.57C79.74 74.94 78.62 76.23 77.43 77.43C76.24 78.62 74.93 79.72 73.58 80.73C72.23 81.74 70.79 82.65 69.33 83.48C67.86 84.31 66.34 85.04 64.79 85.71C63.24 86.37 61.65 86.95 60.04 87.46C58.42 87.96 56.77 88.4 55.1 88.75C53.43 89.09 51.72 89.37 50 89.54C48.28 89.71 46.52 89.81 44.76 89.76C43.01 89.72 41.22 89.58 39.47 89.29C37.72 89 35.95 88.58 34.26 88C32.57 87.42 30.89 86.69 29.33 85.8C27.77 84.92 26.26 83.87 24.91 82.7C23.56 81.53 22.3 80.19 21.23 78.77C20.16 77.35 19.22 75.79 18.47 74.2C17.71 72.61 17.13 70.91 16.7 69.23C16.26 67.55 16.02 65.81 15.88 64.13C15.75 62.45 15.78 60.76 15.88 59.14C15.97 57.52 16.21 55.94 16.45 54.42C16.7 52.89 17.03 51.43 17.34 50C17.65 48.57 18 47.2 18.32 45.83C18.63 44.46 18.94 43.13 19.24 41.76C19.53 40.39 19.79 39.03 20.08 37.61C20.36 36.18 20.62 34.74 20.95 33.23C21.28 31.72 21.61 30.16 22.07 28.57C22.52 26.98 23.02 25.32 23.69 23.69C24.35 22.06 25.11 20.38 26.05 18.79C26.99 17.21 28.08 15.62 29.33 14.2C30.58 12.78 32 11.41 33.54 10.26C35.08 9.12 36.8 8.11 38.57 7.35C40.34 6.6 42.27 6.04 44.17 5.73C46.08 5.43 48.08 5.37 50 5.54C51.92 5.71 53.87 6.15 55.69 6.75C57.52 7.36 59.3 8.22 60.94 9.19C62.57 10.15 64.11 11.33 65.51 12.56C66.91 13.78 68.17 15.15 69.33 16.52C70.48 17.89 71.5 19.34 72.44 20.76C73.38 22.18 74.19 23.62 74.97 25.03C75.75 26.43 76.44 27.83 77.12 29.19C77.8 30.56 78.42 31.89 79.05 33.23C79.67 34.57 80.28 35.87 80.87 37.21C81.46 38.55 82.05 39.88 82.6 41.27C83.14 42.65 83.68 44.05 84.14 45.51C84.6 46.96 85.03 48.46 85.34 50Z"},Ds={droid:"M47.5 14H52.5V32H47.5ZM43 11A7 7 0 1 1 57 11A7 7 0 1 1 43 11Z",mech:"M19.5 32L24.5 32L17 13L12 13ZM75.5 32L80.5 32L88 13L83 13ZM10 11.5A4.5 4.5 0 1 1 19 11.5A4.5 4.5 0 1 1 10 11.5ZM81 11.5A4.5 4.5 0 1 1 90 11.5A4.5 4.5 0 1 1 81 11.5Z"};function me(t){const n=t.trim(),o=n.match(/^hsla?\(\s*([\d.]+)(?:deg)?[,\s]+([\d.]+)%[,\s]+([\d.]+)%/i);if(o)return Er([Number(o[1])/360,Number(o[2])/100,Number(o[3])/100]);const e=n.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);if(e){let s=e[1];s.length===3&&(s=s.split("").map(l=>l+l).join(""));const r=parseInt(s,16);return[r>>16&255,r>>8&255,r&255]}const a=n.match(/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)/i);return a?[Number(a[1]),Number(a[2]),Number(a[3])]:null}function Ya(t){const n=me(t);if(!n)return .5;const o=e=>{const a=e/255;return a<=.03928?a/12.92:((a+.055)/1.055)**2.4};return .2126*o(n[0])+.7152*o(n[1])+.0722*o(n[2])}const Ir="#1E1A33",Fr="#F7F5F2";function ja(t){return Ya(t)<.13?Fr:Ir}function Lr([t,n,o]){t/=255,n/=255,o/=255;const e=Math.max(t,n,o),a=Math.min(t,n,o),s=(e+a)/2;if(e===a)return[0,0,s];const r=e-a,l=s>.5?r/(2-e-a):r/(e+a);let c=0;return e===t?c=(n-o)/r+(n<o?6:0):e===n?c=(o-t)/r+2:c=(t-n)/r+4,[c/6,l,s]}function Er([t,n,o]){if(n===0)return[o*255,o*255,o*255];const e=o<.5?o*(1+n):o+n-o*n,a=2*o-e,s=r=>(r=(r%1+1)%1,r<1/6?a+(e-a)*6*r:r<1/2?e:r<2/3?a+(e-a)*(2/3-r)*6:a);return[s(t+1/3)*255,s(t)*255,s(t-1/3)*255]}function $r([t,n,o]){return`hsl(${(t*360).toFixed(1)} ${(n*100).toFixed(1)}% ${(o*100).toFixed(1)}%)`}const C0=t=>Math.min(1,Math.max(0,t));function fn(t,n,o=0){const e=me(t);if(!e)return t;const[a,s,r]=Lr(e);return $r([a,C0(s+o+(n<0?-n*.25:0)),C0(r+n)])}const ua=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4),Or=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055;function Wr(t,n,o){const e=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*o),a=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*o),s=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*o);return[.2104542553*e+.793617785*a-.0040720468*s,1.9779984951*e-2.428592205*a+.4505937099*s,.0259040371*e+.7827717662*a-.808675766*s]}function A0(t,n,o){const e=Math.pow(t+.3963377774*n+.2158037573*o,3),a=Math.pow(t-.1055613458*n-.0638541728*o,3),s=Math.pow(t-.0894841775*n-1.291485548*o,3);return[4.0767416621*e-3.3077115913*a+.2309699292*s,-1.2684380046*e+2.6097574011*a-.3413193965*s,-.0041960863*e-.7034186147*a+1.707614701*s]}const zr=t=>t.every(n=>n>=-1e-4&&n<=1+1e-4);function _r(t,n){const o=me(t);if(!o||!(n>0))return t;const[e,a,s]=Wr(ua(o[0]/255),ua(o[1]/255),ua(o[2]/255)),r=Math.hypot(a,s);if(r<1e-4)return t;const l=a/r,c=s/r,h=r*(1+.5*n);let d=null,f=r;for(let i=0;i<=6;i++){const m=e*(1-.15*n*i/6);let g=0,M=h;for(let b=0;b<18;b++){const w=(g+M)/2;zr(A0(m,l*w,c*w))?g=w:M=w}if(g>f+.004*i&&(f=g,d=A0(m,l*g,c*g)),g>=h-1e-4)break}if(!d)return t;const u=d.map(i=>Math.round(255*Or(Math.min(1,Math.max(0,i)))));return`rgb(${u[0]} ${u[1]} ${u[2]})`}const Is=["default","working","sleeping"],Fs=["happy","sleepy","questioning","loving","surprised","playful"],Li=t=>t==="working"||t==="sleeping"?t:"default",Ei=t=>Fs.includes(t)?t:null,qr={happy:.15,sleepy:.55,questioning:.6,loving:.45,surprised:.95,playful:0},$a=()=>({happy:0,sleepy:0,questioning:0,loving:0,surprised:0,playful:0}),Ls=.68,$i=26,Dr=.2,Rs={height:$i,time:Ls,stretch:1,squash:1.15,squashTime:.37,squashEase:"pulse",groundTime:.11,groundEase:"pulse",riseTime:.33,riseEase:"pulse",clickSquashTime:.24,spin:1,lean:6,every:8,land:0},Oi=(t,n)=>n?t.clickSquashTime:Dr*t.time,da=(t,n)=>Oi(t,n)+t.time+Wi[t.squashEase]*(n?t.clickSquashTime:t.squashTime)+Math.max(0,t.groundTime)+t.riseTime+Math.max(0,t.land)+.05,Wi={sharp:0,pulse:2/7,soft:.5,bouncy:.144},v0=(t,n)=>{if(t<=0)return 1;if(t>=1)return 0;switch(n){case"sharp":return(1-t)*(1-t);case"soft":return .5+.5*Math.cos(Math.PI*t);case"bouncy":return Math.exp(-3.2*t)*Math.cos(5.4*t)-t*t*t*.026;default:{const o=4.2*t;return(1+o)*Math.exp(-o)-t*t*t*.078}}},S0=(t,n)=>1+.25*zi(t,n),zi=(t,n)=>{if(t<=0||t>=1)return 0;let o;switch(n){case"sharp":o=(1-t)*(1-t);break;case"soft":o=Math.sin(Math.PI*t)**2;break;case"bouncy":o=Math.exp(-3.15*t)*Math.sin(8.43*t)/.596;break;default:{const a=7*t;o=a*a*Math.exp(2-a)/4}}const e=t>.85?1-(t-.85)/.15:1;return o*e*e*(3-2*e)},Ms=t=>Math.exp(-Math.pow(Math.min(Math.abs(t),Math.abs(t-1))/.11,2)),tn=Math.PI/180,ie=Math.PI*2,Rr={default:1.2,working:.7,sleeping:1.4},Hr=1;function Br(t){let n=t*2654435761>>>0||1;return()=>{n=n+1831565813>>>0;let o=n;return o=Math.imul(o^o>>>15,o|1),o^=o+Math.imul(o^o>>>7,o|61),((o^o>>>14)>>>0)/4294967296}}function le(t,n,o,e){return t+(n-t)*(1-Math.exp(-o*e))}const Ge=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,x0=t=>.5-.5*Math.cos(Math.PI*t);class Ke{constructor(n,o,e,a,s,r=!1){this.rand=n,this.amp=o,this.holdMin=e,this.holdMax=a,this.rate=s,this.spring=r}rand;amp;holdMin;holdMax;rate;spring;value=0;vel=0;target=0;next=0;update(n,o){if(n>=this.next&&(this.target=(this.rand()*2-1)*this.amp,this.next=n+this.holdMin+this.rand()*(this.holdMax-this.holdMin)),this.spring){const e=this.rate*1.6,a=.9;this.vel+=(e*e*(this.target-this.value)-2*a*e*this.vel)*o,this.value+=this.vel*o}else this.value=le(this.value,this.target,this.rate,o)}aim(n){this.target=n,this.next=1/0}set(n,o,e,a){this.amp=n,this.holdMin=o,this.holdMax=e,this.rate=a,this.next=0}}class re{constructor(n){this.duration=n}duration;p=-1;fire(){this.p=0}get active(){return this.p>=0}update(n){this.p<0||(this.p+=n/this.duration,this.p>=1&&(this.p=-1))}}const P0=35*tn,T0=14*tn,I0=3.2*tn,F0=2.6,Yr=4.4,_i={default:{pitch:0,roll:0,y:0,lookX:0,lookY:0},working:{pitch:5*tn,roll:0,y:0,lookX:0,lookY:0},sleeping:{pitch:-16*tn,roll:6*tn,y:3,lookX:0,lookY:1}};class Xa{pose={yaw:0,pitch:0,roll:0,x:0,y:0,sx:1,sy:1,eyeOpen:1,blinkL:0,blinkR:0,lookX:0,lookY:0,breath:0,laugh:0,whirl:0,whirlAngle:0,w:[1,0,0],mood:$a(),winkL:0,winkR:0,drowse:0,beat:0,startle:0,t:0};state="default";motion="default";mood=null;moodW=$a();winkEv=new re(.6);winkAt=0;winkSide=1;startleEv=new re(.8);startleAt=0;jerkEv=new re(.5);drowsePhase=0;beatPhase=0;playPhase=0;rand;t=0;wFrom=[1,0,0];tr=1;trDuration=1.2;yawW;pitchW;rollW;lookXW;lookYW;blink=new re(.17);blinkAt;blinkAgain=!1;dart=new re(.12);dartAt;dartX=0;dartY=0;flip=new re(da(Rs,!1));flipPoked=!1;jump={...Rs};flipAt;flipSide=1;nod=new re(1.7);nodAt;hopPhase=0;hopCount=0;hopGain=0;laughEv=new re(.8);laughAt;prevYaw=0;jelly=0;jellyV=0;gazeLead=0;gazeDir=[0,0];gazeAt=0;turnK=1;breathPhase=0;ptrX=0;ptrY=0;ptrS=0;ptrTargetX=0;ptrTargetY=0;ptrTargetS=0;baseYaw=0;constructor(n,o="default"){this.rand=Br(Math.floor(n*1e6)+1);const e=this.rand;this.yawW=new Ke(e,36*tn,1.1,2.6,3,!0),this.pitchW=new Ke(e,10*tn,1.1,2.6,2.6,!0),this.rollW=new Ke(e,5*tn,1.6,3.2,2,!0),this.lookXW=new Ke(e,3.6,.5,2,14),this.lookYW=new Ke(e,2.4,.5,2,14),this.t=e()*10,this.hopPhase=e(),this.breathPhase=e(),this.blinkAt=this.t+1+e()*3,this.flipAt=this.nextFlip(this.t,1),this.nodAt=this.t+3+e()*4,this.dartAt=this.t+1+e()*2,this.laughAt=this.t+.6+e()*1.5,this.setState(o,!0)}setState(n,o=!1){if(n===this.state&&!o)return;const e=this.motion;this.state=n,this.motion=Li(n),this.mood=Ei(n);const a=this.pose.w;if(o)for(const r of Fs)this.moodW[r]=this.mood===r?1:0;if(this.mood&&this.enterMood(this.mood,o),!o&&this.motion===e)return;const s=this.motion;if(o){for(let r=0;r<3;r++)a[r]=Is[r]===s?1:0;this.tr=1}else this.wFrom=[a[0],a[1],a[2]],this.tr=0,this.trDuration=e==="sleeping"?Hr:Rr[s];switch(s){case"default":this.yawW.set(P0,2.6,5.4,2),this.pitchW.set(T0,2.8,5.8,1.8),this.rollW.set(I0,3.4,6.6,1.5),this.gazeAt=0,this.gazeDir=[0,0],this.lookXW.set(3.6,.6,2.2,13),this.lookYW.set(2.4,.6,2.2,13),this.flipAt=this.nextFlip(this.t,.6);break;case"working":this.yawW.set(16*tn,.9,1.8,4),this.pitchW.set(3*tn,1.2,2.4,3),this.rollW.set(0,1,2,3),this.lookXW.set(2,.5,1.2,12),this.lookYW.set(1,.5,1.2,12),this.hopPhase=0,this.hopCount=0,this.laughAt=this.t+.5+this.rand()*1.2;break;case"sleeping":this.yawW.set(7*tn,3,6,.7),this.pitchW.set(3*tn,3,6,.7),this.rollW.set(2*tn,3,6,.6),this.lookXW.set(0,2,4,2),this.lookYW.set(0,2,4,2),this.nodAt=this.t+2.5+this.rand()*4;break}}enterMood(n,o){const e=this.t,a=this.rand;switch(n){case"happy":this.winkAt=e+(o?.4:.5)+a()*.8;break;case"playful":this.winkAt=e+.3+a()*.5,this.playPhase=0;break;case"sleepy":this.drowsePhase=o?.5:0;break;case"surprised":o||this.startleEv.fire(),this.startleAt=e+5+a()*3;break}}setPointer(n,o,e){this.ptrTargetX=Math.max(-1.2,Math.min(1.2,n)),this.ptrTargetY=Math.max(-1.2,Math.min(1.2,o)),this.ptrTargetS=Math.max(0,Math.min(1,e))}poke(){this.flip.active&&this.flip.p<.6||(this.flipPoked=!0,this.flip.duration=da(this.jump,!0),this.flipSide=this.rand()<.5?-1:1,this.flip.fire(),this.flipAt=this.nextFlip(this.t,1.1))}setTurn(n){const o=Math.max(0,n);o!==this.turnK&&(this.turnK=o,this.motion==="default"&&(this.gazeAt=0))}setJump(n){const o=this.jump.every;Object.assign(this.jump,n),n.every!==void 0&&n.every!==o&&(this.flipAt=this.nextFlip(this.t,1))}nextGaze(){const n=this.rand,[o,e]=this.gazeDir;if(o!==0||e!==0){const s=n();return s<.66?[-o,-e]:s<.85?[-o,e]:[0,0]}const a=[[1,-1],[-1,1],[-1,-1],[1,1]];return a[Math.floor(n()*a.length)]}nextFlip(n,o){const e=this.jump.every;return e>0?n+e*o*(.625+this.rand()*.75):1/0}update(n){n=Math.min(n,.05),this.t+=n;const o=this.t,e=this.pose,a=e.w;if(this.tr<1){this.tr=Math.min(1,this.tr+n/this.trDuration);const z=x0(this.tr);for(let L=0;L<3;L++){const bt=Is[L]===this.motion?1:0;a[L]=this.wFrom[L]+(bt-this.wFrom[L])*z}}const[s,r,l]=a,c=this.moodW;let h=0;for(const z of Fs)c[z]=le(c[z],this.mood===z?1:0,6,n),c[z]<.002&&(c[z]=0),h=Math.max(h,c[z]*qr[z]);const d={pitch:0,roll:0,y:0,lookX:0,lookY:0};for(let z=0;z<3;z++){const L=_i[Is[z]];d.pitch+=L.pitch*a[z],d.roll+=L.roll*a[z],d.y+=L.y*a[z],d.lookX+=L.lookX*a[z],d.lookY+=L.lookY*a[z]}if(this.motion==="default"&&o>=this.gazeAt){const[z,L]=this.nextGaze();this.gazeDir=[z,L];const bt=.84+this.rand()*.16;this.yawW.aim(z*P0*bt*this.turnK),this.pitchW.aim(L*T0*bt),this.rollW.aim(z*I0*bt*this.turnK),this.gazeAt=o+F0+this.rand()*(Yr-F0)}this.yawW.update(o,n),this.pitchW.update(o,n),this.rollW.update(o,n),this.lookXW.update(o,n),this.lookYW.update(o,n),this.ptrS=le(this.ptrS,this.ptrTargetS,8,n),this.ptrX=le(this.ptrX,this.ptrTargetX,14,n),this.ptrY=le(this.ptrY,this.ptrTargetY,14,n);const f=this.ptrS,u=(1-.75*f)*(1-h);this.baseYaw=le(this.baseYaw,this.yawW.value*u+22*tn*this.ptrX*f,5,n);const i=d.pitch+this.pitchW.value*u-12*tn*this.ptrY*f,m=d.roll+this.rollW.value*u,g=d.y,M=d.lookX+this.lookXW.value*u+4.5*this.ptrX*f,b=d.lookY+this.lookYW.value*u+3*this.ptrY*f;let w=0,v=0,y=1,C=1,p=0,k=0,A=0,S=0,E=0,I=0,W=0,x=0;const $=(z,L,bt)=>{const H=Math.min(1,Math.max(0,(bt-z)/(L-z)));return H*H*(3-2*H)},T=z=>$(.1,.26,z)*(1-$(.66,.9,z)),F=z=>ie*(1.5*z+.9*Ge(z));if(o>=this.blinkAt&&!this.blink.active&&s+r>.5&&c.surprised<.3&&(this.blink.fire(),this.blinkAgain=!this.blinkAgain&&this.rand()<.22,this.blinkAt=o+(this.blinkAgain?.28:2.2+this.rand()*2.6)),this.blink.update(n),this.blink.active&&(A=Math.sin(Math.PI*this.blink.p)),o>=this.dartAt&&!this.dart.active&&s+r>.5&&(this.dart.fire(),this.dartX=(this.rand()*2-1)*4,this.dartY=(this.rand()*2-1)*2,this.dart.duration=.25+this.rand()*.45,this.dartAt=o+1.2+this.rand()*2.6),this.dart.update(n),this.dart.active){const z=this.dart.p,L=z<.15?z/.15:z>.8?(1-z)/.2:1;S+=this.dartX*L*(s+r)*(1-h),E+=this.dartY*L*(s+r)*(1-h)}const _=!this.mood||this.mood==="happy"||this.mood==="playful";if(this.motion==="default"&&_&&o>=this.flipAt&&!this.flip.active&&(this.flipPoked=!1,this.flip.duration=da(this.jump,!1),this.flipSide=this.rand()<.5?-1:1,this.flip.fire(),this.flipAt=this.nextFlip(o,1)),this.flip.update(n),this.flip.active){const z=this.jump,L=Oi(z,this.flipPoked),bt=(this.flip.p*this.flip.duration-L)/z.time,H=Math.min(1,Math.max(0,bt)),Lt=Math.sin(Math.PI*H);w+=ie*z.spin*Ge(H),v-=z.height*Lt;const It=(bt-1)*z.time-z.land,Cn=this.flipPoked?z.clickSquashTime:z.squashTime,qt=vt=>this.flipPoked?vt*vt*(3-2*vt):Ms(vt-1),Mn=Math.max(0,z.groundTime),en=Wi[z.squashEase]*Cn,gn=It-en-Mn,$t=It<=en?zi(It/Cn,z.squashEase):gn<=0?S0((It-en)/Mn,z.groundEase):v0(gn/z.riseTime,z.riseEase),Rt=(bt<0?qt(Math.max(0,1+bt*z.time/L)):It>0?$t:bt<.2?Ms(bt):0)*z.squash;y+=.16*Rt-.06*Lt*z.stretch,C+=-.18*Rt+.09*Lt*z.stretch,k+=this.flipSide*z.lean*tn*Lt,z.spin>0&&(I=Math.max(I,Lt),W=Math.max(W,T(H)),x=F(H))}const q=this.jump,D=Math.max(0,q.groundTime),O=D+q.riseTime;if(this.motion==="working"&&(this.hopGain=r),this.hopGain>.02&&(this.motion==="working"||this.hopPhase>0)){this.hopPhase+=n/Ls,this.hopPhase>=1&&(this.motion==="working"?(this.hopPhase-=1,this.hopCount+=1):(this.hopPhase-1)*Ls>=O&&(this.hopPhase=0,this.hopGain=0));const z=this.hopGain,L=Math.min(1,this.hopPhase),bt=Math.sin(Math.PI*L),H=this.hopCount%3===2;v-=(H?$i:18)*bt*z;const It=this.motion!=="working"&&this.hopPhase>1?(this.hopPhase-1)*Ls:-1,Cn=It<0?Ms(this.hopPhase):It<D?S0(It/D,q.groundEase):v0((It-D)/q.riseTime,q.riseEase);y+=(.16*Cn-.06*bt)*z,C+=(-.18*Cn+.09*bt)*z,H&&(w+=ie*Ge(L)*z,I=Math.max(I,bt*z),T(L)*z>W&&(W=T(L)*z,x=F(L))),k+=(this.hopCount%2===0?1:-1)*6*tn*bt*z}if(this.motion==="working"&&o>=this.laughAt&&!this.laughEv.active&&(this.laughEv.fire(),this.laughEv.duration=.6+this.rand()*.5,this.laughAt=o+1.6+this.rand()*2.2),this.laughEv.update(n),this.laughEv.active){const z=this.laughEv.p;I=Math.max(I,z<.18?z/.18:z>.78?(1-z)/.22:1)}if(this.motion==="sleeping"&&o>=this.nodAt&&!this.nod.active&&(this.nod.fire(),this.nodAt=o+4+this.rand()*4),this.nod.update(n),this.nod.active){const z=this.nod.p,L=z<.72?Ge(z/.72):1-Ge((z-.72)/.28);p-=13*tn*L*l}let K=0,U=0,nt=0,dt=0,pt=0;if((this.mood==="happy"||this.mood==="playful")&&o>=this.winkAt&&!this.winkEv.active){const z=this.mood==="playful";this.winkEv.duration=z?.7:.62,this.winkEv.fire(),this.winkSide=z?-this.winkSide:this.rand()<.8?1:-1,this.winkAt=o+(z?1.1+this.rand()*.7:2.4+this.rand()*2.4)}if(this.winkEv.update(n),this.winkEv.active){const z=this.winkEv.p,L=(z<.2?z/.2:z>.72?(1-z)/.28:1)*Math.min(1,c.happy+c.playful);this.winkSide>0?U=L:K=L,k+=this.winkSide*5*tn*L}if(c.happy>0&&(k+=2.4*tn*Math.sin(o*1.6)*c.happy,v-=1.3*Math.abs(Math.sin(o*3.1))*c.happy,C+=.012*Math.sin(o*6.2)*c.happy),c.playful>0){this.playPhase+=n/.8;const z=this.playPhase%1,L=Math.sin(Math.PI*z),bt=Ms(z);v-=9*L*c.playful,y+=(.12*bt-.04*L)*c.playful,C+=(-.14*bt+.06*L)*c.playful,k+=(Math.floor(this.playPhase)%2?1:-1)*6*tn*L*c.playful}if(c.sleepy>0||this.mood==="sleepy"){this.drowsePhase+=n/3.4,this.drowsePhase>=1&&(this.drowsePhase=0,this.jerkEv.fire()),this.jerkEv.update(n),nt=.3+.62*x0(Math.min(1,this.drowsePhase));let z=0;if(this.jerkEv.active){const L=this.jerkEv.p;nt=L<.25?.92-.77*(L/.25):.15+.15*((L-.25)/.75),z=L<.25?L/.25:1-(L-.25)/.75}p+=(-11*tn*(nt-.3)+5*tn*z)*c.sleepy,k+=3*tn*Math.sin(o*.7)*c.sleepy}if(c.questioning>0&&(k+=(9*tn+2.5*tn*Math.sin(o*.9))*c.questioning,p+=3*tn*c.questioning,S+=2.4*c.questioning,E-=1.8*c.questioning),c.loving>0){this.beatPhase+=n/.85;const z=this.beatPhase%1;dt=Math.exp(-(((z-.12)/.07)**2))+.55*Math.exp(-(((z-.32)/.08)**2)),dt=Math.min(1,dt),y+=.03*dt*c.loving,C+=.04*dt*c.loving,v-=1.5*dt*c.loving,k+=3.5*tn*Math.sin(o*1.25)*c.loving}if(this.mood==="surprised"&&o>=this.startleAt&&!this.startleEv.active&&(this.startleEv.fire(),this.startleAt=o+5.5+this.rand()*3),this.startleEv.update(n),c.surprised>0){let z=.25;if(this.startleEv.active){const L=this.startleEv.p,bt=Math.sin(Math.PI*Math.min(1,L/.46)),H=Math.exp(-(((L-.48)/.1)**2));v-=12*bt*c.surprised,y+=(-.06*bt+.14*H)*c.surprised,C+=(.12*bt-.16*H)*c.surprised,z=1-.6*L}p+=5*tn*c.surprised,pt=z}this.breathPhase+=n/(3.6+1.2*l);const j=Math.sin(this.breathPhase*ie);e.breath=j,y+=j*(.008+.014*l),C+=j*(.012+.02*l);const N=Math.sin(o*ie/3.4)*2*(1-l);e.yaw=this.baseYaw+w;let Q=this.baseYaw-this.prevYaw;Q=((Q+Math.PI)%ie+ie)%ie-Math.PI,this.prevYaw=this.baseYaw;const Ot=n>0?Math.abs(Q)/n:0,G=n>0?Math.max(-2.2,Math.min(2.2,Q/n*2.4)):0;this.gazeLead=le(this.gazeLead,G,9,n);const ut=Math.min(.22,.055*Ot),ft=16,xt=.45;this.jellyV+=(ft*ft*(ut-this.jelly)-2*xt*ft*this.jellyV)*n,this.jelly+=this.jellyV*n;const it=Math.max(-.08,Math.min(.28,this.jelly))*.6;y*=1+it,C*=1-.55*it,e.pitch=i+p,e.roll=m+k,e.x=0,e.y=g+v+N,e.sx=y,e.sy=C,e.eyeOpen=1,e.laugh=le(e.laugh,I,30,n),e.blinkL=A,e.blinkR=A,e.lookX=M+S+this.gazeLead,e.lookY=b+E,e.whirl=W,e.whirlAngle=x;for(const z of Fs)e.mood[z]=c[z];e.winkL=K,e.winkR=U,e.drowse=nt,e.beat=dt,e.startle=pt,e.t=o}}const jr={happy:{roll:-3*tn,winkR:1},sleepy:{pitch:-9*tn,roll:4*tn,drowse:.7},questioning:{pitch:3*tn,roll:9*tn,lookX:2.4,lookY:-1.8},loving:{roll:4*tn},surprised:{pitch:5*tn,startle:.5},playful:{roll:-5*tn,winkR:1}};function Hs(t){const n=Li(t),o=Ei(t),e=_i[n],a=o?jr[o]:{},s=$a();return o&&(s[o]=1),{yaw:0,pitch:e.pitch+(a.pitch??0),roll:e.roll+(a.roll??0),x:0,y:e.y,sx:1,sy:1,eyeOpen:1,blinkL:0,blinkR:0,lookX:e.lookX+(a.lookX??0),lookY:e.lookY+(a.lookY??0),breath:0,laugh:0,whirl:0,whirlAngle:0,w:Is.map(r=>r===n?1:0),mood:s,winkL:a.winkL??0,winkR:a.winkR??0,drowse:a.drowse??0,beat:0,startle:a.startle??0,t:.5}}const st=3,zt=100+2*st,sn=64,qi=sn,Es=sn*sn,$o=24,Di=1e12,Ri=48*Math.PI/180,L0=Math.cos(Ri),Xr=Math.sin(Ri);function E0(t,n,o,e,a,s){let r=0;a[0]=0,s[0]=-1e30,s[1]=1e30;for(let l=1;l<n;l++){let c=0;for(;;){const h=a[r];if(c=(t[l]+l*l-t[h]-h*h)/(2*(l-h)),c>s[r])break;r--}r++,a[r]=l,s[r]=c,s[r+1]=1e30}r=0;for(let l=0;l<n;l++){for(;s[r+1]<l;)r++;const c=a[r];o[l]=(l-c)*(l-c)+t[c],e[l]=c}}function Oa(t,n,o,e,a){const s=new Float32Array(o),r=new Float32Array(o),l=new Int32Array(o),c=new Int32Array(o),h=new Float32Array(o+1),d=new Float32Array(o*o),f=new Int32Array(o*o);for(let u=0;u<o;u++){for(let i=0;i<o;i++)s[i]=t[i*o+u]===n?0:Di;E0(s,o,r,l,c,h);for(let i=0;i<o;i++)d[i*o+u]=r[i],f[i*o+u]=l[i]}for(let u=0;u<o;u++){const i=u*o;for(let m=0;m<o;m++)s[m]=d[i+m];E0(s,o,r,l,c,h);for(let m=0;m<o;m++)e[i+m]=r[m],a&&(a[i+m]=f[i+l[m]]*o+l[m])}}function pa(t,n,o){for(let e=0;e<n;e++){const a=e*n;for(let s=0;s<n;s++){const r=s<2?0:s-2,l=s<1?0:s-1,c=s>n-2?n-1:s+1,h=s>n-3?n-1:s+2;o[a+s]=(t[a+r]+4*t[a+l]+6*t[a+s]+4*t[a+c]+t[a+h])*.0625}}for(let e=0;e<n;e++)for(let a=0;a<n;a++){const s=a<2?0:a-2,r=a<1?0:a-1,l=a>n-2?n-1:a+1,c=a>n-3?n-1:a+2;t[a*n+e]=(o[s*n+e]+4*o[r*n+e]+6*o[a*n+e]+4*o[l*n+e]+o[c*n+e])*.0625}}function Gr(t,n,o){const e=[];for(let s=n,r=1;r<=4&&s%2===0||r===1;s>>=1,r<<=1){const l=new Uint8Array(s*s);for(let c=0;c<s;c++)for(let h=0;h<s;h++){let d=0;for(let f=0;f<r;f++)for(let u=0;u<r;u++)d+=t[(c*r+f)*n+h*r+u];l[c*s+h]=d>=128*r*r?1:0}if(e.push({n:s,mask:l,phi:new Float32Array(s*s)}),r===4)break}const a=(s,r,l,c)=>{const{n:h,mask:d,phi:f}=s,u=r*r;for(let i=0;i<l;i++)for(let m=1;m<h-1;m++){const g=m*h;for(let M=1;M<h-1;M++){const b=g+M;if(!d[b])continue;const w=(f[b-1]+f[b+1]+f[b-h]+f[b+h]+u)*.25;f[b]+=c*(w-f[b])}}};for(let s=e.length-1;s>=0;s--){const r=e[s],l=1<<s;if(s<e.length-1){const h=e[s+1],d=r.n,f=h.n;for(let u=0;u<d;u++){const i=Math.min(f-1,Math.max(0,(u+.5)/2-.5)),m=i|0,g=Math.min(f-1,m+1),M=i-m;for(let b=0;b<d;b++){const w=u*d+b;if(!r.mask[w])continue;const v=Math.min(f-1,Math.max(0,(b+.5)/2-.5)),y=v|0,C=Math.min(f-1,y+1),p=v-y;r.phi[w]=(h.phi[m*f+y]*(1-p)+h.phi[m*f+C]*p)*(1-M)+(h.phi[g*f+y]*(1-p)+h.phi[g*f+C]*p)*M}}}const c=Math.min(1.9,2/(1+Math.sin(Math.PI/r.n))-.05);a(r,o*l,4,1),a(r,o*l,s===2?100:s===1?30:16,c),a(r,o*l,8,1)}return e[0].phi}const Kr=[1,1,0,-1,-1,-1,0,1],Vr=[0,1,1,1,0,-1,-1,-1],Nr=[1,Math.SQRT2,1,Math.SQRT2,1,Math.SQRT2,1,Math.SQRT2];function Ga(t,n,o){const e=zt/n,a=n*n,s=new Uint8Array(a);for(let S=0;S<a;S++)s[S]=t[S]>=128?1:0;const r=new Float32Array(a),l=new Float32Array(a),c=new Int32Array(a);Oa(s,0,n,r,null),Oa(s,1,n,l,c);const h=new Float32Array(a),d=new Float32Array(a);for(let S=0;S<a;S++){const E=t[S]/255;h[S]=e*(E>0&&E<1?E-.5:s[S]?Math.sqrt(r[S])-.5:.5-Math.sqrt(l[S]))}pa(h,n,d),pa(h,n,d);const f=Gr(t,n,e);let u=0;for(let S=0;S<a;S++)f[S]>u&&(u=f[S]);const i=2*Math.sqrt(u),m=Math.min(1.5*o+.32*i,1.4*i),g=u>0?m/Math.sqrt(u):0,M=new Float32Array(a);for(let S=0;S<a;S++)M[S]=f[S]>0?g*Math.sqrt(f[S]):0;pa(M,n,d);const b={N:n,i00:new Uint16Array(a),wx:new Uint8Array(a),wy:new Uint8Array(a),ao:new Uint8Array(a),sd:h,h:M},{i00:w,wx:v,wy:y,ao:C}=b,p=n<=64?[1,2,3,5,8]:n<=96?[1,2,4,7,11]:[1,2,4,7,11,15],k=64,A=n-1;for(let S=0;S<n;S++)for(let E=0;E<n;E++){const I=S*n+E,W=s[I]?I:l[I]<=k?c[I]:-1;if(W<0)continue;const x=W%n,$=(W-x)/n,T=x>0?x-1:0,F=x<A?x+1:A,_=$>0?$-1:0,q=$<A?$+1:A;let D=-(M[$*n+F]-M[$*n+T])/(2*e),O=-(M[q*n+x]-M[_*n+x])/(2*e),K=1,U=Math.sqrt(D*D+O*O+1);D/=U,O/=U,K/=U;const nt=Math.max(0,h[W]);if(nt<2){let ft=h[$*n+F]-h[$*n+T],xt=h[q*n+x]-h[_*n+x];const it=Math.hypot(ft,xt)||1;ft/=it,xt/=it;const z=.7*(1-nt/2);D+=z*(-ft-D),O+=z*(-xt-O),K+=z*(0-K),U=Math.sqrt(D*D+O*O+K*K)||1,D/=U,O/=U,K/=U}const dt=M[W];let pt=0;for(let ft=0;ft<8;ft++){let xt=0;for(let it=0;it<p.length;it++){const z=p[it];let L=x+Kr[ft]*z,bt=$+Vr[ft]*z;L<0?L=0:L>A&&(L=A),bt<0?bt=0:bt>A&&(bt=A);const H=(M[bt*n+L]-dt)/(z*e*Nr[ft]);H>xt&&(xt=H)}pt+=xt/Math.sqrt(1+xt*xt)}const Tt=1-Math.min(1,nt/3),j=1-.2*Tt*Tt,N=Math.pow(1-.9*pt/8,1.5)*j;C[I]=Math.max(1,Math.round(255*Math.pow(N,1/2.2)));const Q=(D*.5+.5)*(sn-1),Ot=(O*.5+.5)*(sn-1),G=Math.min(sn-2,Math.max(0,Q|0)),ut=Math.min(sn-2,Math.max(0,Ot|0));w[I]=ut*sn+G,v[I]=Math.round(255*Math.min(1,Math.max(0,Q-G))),y[I]=Math.round(255*Math.min(1,Math.max(0,Ot-ut)))}return b}function Wn(t){if(typeof OffscreenCanvas=="function")return new OffscreenCanvas(t,t);if(typeof document<"u"){const n=document.createElement("canvas");return n.width=n.height=t,n}return null}function Fn(t,n){return t.getContext("2d",n?{willReadFrequently:!0}:void 0)}function Hi(t,n){const o=Wn(n),e=o&&Fn(o,!0);if(!e)return null;const a=zt/n;e.setTransform(1/a,0,0,1/a,st/a,st/a),e.fillStyle="#fff",e.fill(t);const s=e.getImageData(0,0,n,n).data,r=new Uint8ClampedArray(n*n);for(let l=0;l<n*n;l++)r[l]=s[l*4+3];return r}const ke=new Map,$s=new Set,$0=new WeakMap;let Zr=0;function ma(t){let n=$0.get(t);return n||$0.set(t,n=`p${Zr++}`),n}const Ze=[];let Wa=!1;const Ur=6,Ma=()=>typeof performance<"u"?performance.now():Date.now(),Qr=20;let Qe=0;function Os(t){Wa=!1;const n=Ma();let o=Ze.shift();for(;o&&(o(),!((Qe>0?Qr-(Ma()-n):t&&!t.didTimeout?t.timeRemaining()-6:Ur-(Ma()-n))<=0));)o=Ze.shift();Ze.length&&Bi()}function Bi(){if(Wa)return;if(Wa=!0,Qe>0){setTimeout(()=>Os(),0);return}const t=globalThis.requestIdleCallback;t?t(Os,{timeout:60}):setTimeout(()=>Os(),24)}function gs(t){Qe=Math.max(0,Qe+(t?1:-1)),t&&Ze.length&&setTimeout(()=>Os(),0)}function bs(){return $s.size>0||we.size>0}function Ka(t){Ze.push(t),Bi()}const Bs=new Set;let Ys=!1,ga=!1;function Yi(){ga||!Bs.size||(ga=!0,setTimeout(()=>{ga=!1;for(const t of[...Bs])t()},0))}function ba(t){return Bs.add(t),()=>{Bs.delete(t)}}function ys(){const t=Ys;return Ys=!1,t}function ji(t,n,o,e,a){const s=`${t}|${o}|${Math.round(e)}`,r=ke.get(s);if(r)return r;const l=()=>{if($s.delete(s),ke.has(s))return;const c=Hi(n,o);c&&(ke.size>=48&&ke.clear(),ke.set(s,Ga(c,o,e)),Yi())};return a?(l(),ke.get(s)??null):($s.has(s)||($s.add(s),Ka(l)),Ys=!0,null)}function Va(t,n,o=192,e=.65,a=!1,s=ue,r=295,l){const c=ji(t,n,Ns(o),15*e,!0);if(a&&c){const h=r*Math.PI/180;Qa(c,t,15*e,Math.ceil(zt*o/100),!1,Math.sin(h),-Math.cos(h),s,l??ss(Math.sin(h),-Math.cos(h)))}}function Ns(t){return t<=100?64:t<=224?96:128}const O0=new WeakMap;function Jr(t,n,o){const e=Math.max(.05,Math.min(1,o)),a=`${n}|${e.toFixed(2)}`;let s=O0.get(t);s||O0.set(t,s=new Map);const r=s.get(a);if(r)return r;const{N:l,h:c,sd:h}=t;let d=0;for(let p=0;p<l*l;p++)c[p]>d&&(d=c[p]);const f=zt/l,u=new Float32Array(n),i=new Float32Array(n),m=new Float32Array(n),g=new Float32Array(n),M=new Float32Array(n);M[0]=1.2;const b=p=>{let k=0,A=0,S=0;for(let E=0,I=0;E<l;E++)for(let W=0;W<l;W++,I++)p(I)&&(k+=1,A+=W,S+=E);return k?[k,(A/k+.5)*f-st,(S/k+.5)*f-st]:[0,50,50]},[w,v,y]=b(p=>h[p]>=0);i[0]=1,m[0]=v,g[0]=y;for(let p=1;p<n;p++){const k=p/n;u[p]=d*k;const A=d*Math.pow(k,1/e),[S,E,I]=b(T=>h[T]>=0&&c[T]>=A);i[p]=Math.min(i[p-1],w?Math.sqrt(S/w):1),m[p]=E,g[p]=I;const W=d/(2*n);let x=0,$=0;for(let T=0;T<l*l;T++)h[T]>0&&Math.abs(c[T]-A)<W&&($+=h[T],x++);M[p]=Math.max(M[p-1],x?$/x:M[p-1])}const C={top:d,z:u,q:e,scale:i,cx:m,cy:g,inset:M};return s.size>6&&s.clear(),s.set(a,C),C}function tl(t,n,o,e,a=1){const s=`${t}|`,r=`|${Math.round(n)}`;let l=null;for(const[C,p]of ke)C.startsWith(s)&&C.endsWith(r)&&(l=p);if(!l)return null;const{N:c,h}=l,d=zt/c,f=Math.min(c-1,Math.max(0,(o+st)/d-.5)),u=Math.min(c-1,Math.max(0,(e+st)/d-.5)),i=Math.min(c-2,f|0),m=Math.min(c-2,u|0),g=f-i,M=u-m,b=m*c+i,w=(h[b]*(1-g)+h[b+1]*g)*(1-M)+(h[b+c]*(1-g)+h[b+c+1]*g)*M;let v=0;for(let C=0;C<c*c;C++)h[C]>v&&(v=h[C]);if(v<=0)return 0;const y=Math.max(.05,Math.min(1,a));return v*Math.pow(Math.max(0,w)/v,y)}const ya=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4),ks=new Map;function Ho(t){let n=ks.get(t);if(!n){let o=me(t);if(!o){const e=Wn(1),a=e&&Fn(e,!0);if(a){a.fillStyle=t,a.fillRect(0,0,1,1);const s=a.getImageData(0,0,1,1).data;o=[s[0],s[1],s[2]]}else o=[128,128,128]}n=[ya(o[0]/255),ya(o[1]/255),ya(o[2]/255)],ks.size>200&&ks.clear(),ks.set(t,n)}return n}const Zs=2048,Xi=2.5,Gi=Zs/Xi,Ki=new Float32Array(Zs);for(let t=0;t<Zs;t++){const n=(t+.5)/Gi,o=n<=.75?n:.75+.25*(1-Math.exp(-(n-.75)/.25));Ki[t]=255*(o<=.0031308?12.92*o:1.055*Math.pow(o,1/2.4)-.055)}const Ao=t=>Ki[t<=0?0:t>=Xi?Zs-1:t*Gi|0],so=t=>t<=0?0:t>=1?255:255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055),ve=1024,ws=new Map;function Je(t){let n=ws.get(t);if(!n){n=new Float32Array(ve+1);for(let o=0;o<=ve;o++)n[o]=Math.pow(o/ve,t);ws.size>16&&ws.clear(),ws.set(t,n)}return n}function es(t,n,o=1/0){if(!(n>0))return;const e=.2126*t[0]+.7152*t[1]+.0722*t[2],a=Math.min(t[0],t[1],t[2]),s=Math.max(t[0],t[1],t[2]);let r=1+3*n;a<e&&(r=Math.min(r,e/(e-a))),s>e&&(r=Math.min(r,Math.max(1,(o-e)/(s-e)))),t[0]=e+(t[0]-e)*r,t[1]=e+(t[1]-e)*r,t[2]=e+(t[2]-e)*r}const ka=[.92,.96,1],wa=[1,.98,.95],rn=(t,n,o)=>{const e=o<=t?0:o>=n?1:(o-t)/(n-t);return e*e*(3-2*e)},qe=(t,n,o)=>1-rn(t-n,t+n,o);function Na(t,n,o,e){const{L:a,V:s,H:r,U:l,W:c,A:h,B:d}=o,f=e.vivid??0,u=[0,0,0],i=Math.max(n[0],n[1],n[2],.05),m=[n[0]/i,n[1]/i,n[2]/i],g=Math.max(.03,.3-.15*e.shadow),M=.15+.14*e.spread,b=.85,w=Math.min(90,Math.round(110/Math.pow(e.spread,1.3))),v=Math.max(2,Math.round(8/e.spread)),y=Je(w),C=Je(v),p=.45*e.highlight,k=.1*e.highlight,A=.11*e.highlight,S=.3*e.rim,E=[g*m[0],g*m[1],g*m[2]];for(let I=0;I<sn;I++)for(let W=0;W<sn;W++){let x=W/(sn-1)*2-1,$=I/(sn-1)*2-1,T=x*x+$*$;if(T>1.14)continue;if(T>1){const it=1/Math.sqrt(T);x*=it,$*=it,T=1}const F=Math.sqrt(1-T),_=x*a[0]+$*a[1]+F*a[2],q=Math.max(0,x*s[0]+$*s[1]+F*s[2]),D=Math.max(0,x*r[0]+$*r[1]+F*r[2]),O=Math.min(1,Math.max(0,(_+M)/(1+M))),K=1-q,U=K*K,nt=U*K,dt=nt*U,pt=D*ve|0,Tt=(p*y[pt]+k*C[pt])*(1+3*dt),j=2*q*x-s[0],N=2*q*$-s[1],Q=2*q*F-s[2],Ot=.45+.55*rn(-.4,.6,j*l[0]+N*l[1]+Q*l[2]),G=j*c[0]+N*c[1]+Q*c[2];let ut=0;if(G>.5){const it=(j*h[0]+N*h[1]+Q*h[2])/G,z=(j*d[0]+N*d[1]+Q*d[2])/G;ut=qe(.34,.12,Math.abs(it))*qe(.12,.06,Math.abs(z))}const ft=S*nt*Ot+A*ut,xt=(I*sn+W)*3;u[0]=n[0]*(E[0]+b*O),u[1]=n[1]*(E[1]+b*O),u[2]=n[2]*(E[2]+b*O),es(u,f),t[xt]=Ao(u[0]+Tt*wa[0]+ft*ka[0]),t[xt+1]=Ao(u[1]+Tt*wa[1]+ft*ka[1]),t[xt+2]=Ao(u[2]+Tt*wa[2]+ft*ka[2])}}const W0=new WeakMap;function nl(t){let n=W0.get(t);if(n)return n;const{N:o,sd:e,ao:a}=t;n={ao:new Uint8Array(o*o),k:new Float32Array(o*o)};for(let s=0;s<o*o;s++){if(a[s]===0)continue;const r=Math.max(0,e[s]),l=1-Math.min(1,r/3),c=1-.2*l*l,h=Math.min(1,Math.pow(a[s]/255,2.2)/c);n.ao[s]=Math.max(1,Math.round(255*Math.pow(h,1/2.2))),n.k[s]=1}return W0.set(t,n),n}const Vi=5;function Za(t,n,o,e,a){const{N:s,i00:r,wx:l,wy:c,ao:h,sd:d}=t,f=sn*3;for(let u=0,i=0;u<s*s;u++,i+=4){const m=h[u];if(m===0){o[i+3]=0;continue}let g=a?e[a.ao[u]]*a.k[u]:e[m];const M=r[u]*3,b=l[u]*(1/255),w=c[u]*(1/255);if(a){const A=(n[M+1]*(1-b)+n[M+4]*b)*(1-w)+(n[M+f+1]*(1-b)+n[M+f+4]*b)*w;g=1-(1-g)*(1.1-.75*Math.min(1,A/235))}const v=(1-b)*(1-w)*g,y=b*(1-w)*g,C=(1-b)*w*g,p=b*w*g;o[i]=n[M]*v+n[M+3]*y+n[M+f]*C+n[M+f+3]*p,o[i+1]=n[M+1]*v+n[M+4]*y+n[M+f+1]*C+n[M+f+4]*p,o[i+2]=n[M+2]*v+n[M+5]*y+n[M+f+2]*C+n[M+f+5]*p;const k=d[u]/Vi;o[i+3]=k>=1?255:k<=0?0:Math.round(255*k*k*(3-2*k))}}const z0=new WeakMap;function ol(t,n){let o=z0.get(t);if(o||z0.set(t,o=new Map),o.has(n))return o.get(n);const e=Wn(n),a=e&&Fn(e,!1);if(!e||!a)return o.set(n,null),null;const{N:s,sd:r}=t,l=new ImageData(n,n),c=n/zt;for(let h=0;h<n;h++)for(let d=0;d<n;d++){const u=(fe(r,s,(d+.5)/c/zt*s-.5,(h+.5)/c/zt*s-.5)+.2)/.6,i=(h*n+d)*4;l.data[i]=l.data[i+1]=l.data[i+2]=255,l.data[i+3]=u>=1?255:u<=0?0:Math.round(255*u*u*(3-2*u))}return a.putImageData(l,0,0),o.set(n,e),e}const _0=new WeakMap;function Us(t){let n=_0.get(t);if(n)return n;const{N:o,sd:e}=t,a=zt/o,s=[];for(let r=0,l=0;r<o;r++)for(let c=0;c<o;c++,l++)e[l]>=0&&e[l]<2*a&&s.push((c+.5)*a-st,(r+.5)*a-st,e[l]);return n=Float32Array.from(s),_0.set(t,n),n}const q0=new WeakMap;function el(t){let n=q0.get(t);if(n)return n;const o=Us(t),e=[];let a=0,s=0;for(let c=0;c<o.length;c+=3)a+=o[c],s+=o[c+1];a/=o.length/3||1,s/=o.length/3||1;for(let c=0;c<o.length;c+=3)e.push([o[c],o[c+1],Math.atan2(o[c+1]-s,o[c]-a),o[c+2]]);e.sort((c,h)=>c[2]-h[2]);const r=Math.max(1,Math.floor(e.length/96)),l=e.filter((c,h)=>h%r===0);return n={x:Float32Array.from(l,c=>c[0]),y:Float32Array.from(l,c=>c[1]),d:Float32Array.from(l,c=>c[3])},q0.set(t,n),n}function D0(t,n,o){const e=Math.round((n+Math.PI)/(2*Math.PI)*t),a=o&1?o+1>>1:-(o>>1);return((e+a)%t+t)%t}function js(t,n,o){let e=-Di;for(let a=0;a<t.length;a+=3){const s=t[a]*n+t[a+1]*o+t[a+2];s>e&&(e=s)}return e}const Bo=new Map,we=new Set,Ni=(t,n)=>Math.round(Math.atan2(n,t)/(Math.PI/12)),Zi=t=>t<=200?192:t<=360?320:512,ue={length:1,density:1.6,fuzz:.9,clumps:.4,curl:.7,gravity:.9},sl=t=>`${t.length.toFixed(2)},${t.density.toFixed(2)},${t.fuzz.toFixed(2)},${t.clumps.toFixed(2)},${t.curl.toFixed(2)},${(t.gravity??ue.gravity).toFixed(2)}`,Ui=(t,n,o,e,a,s)=>`${t}|${Math.round(n)}|${o}|${e}|${sl(a)}|${Pl(s)}`,R0=new Map,Ca=new Set,Vo=128,al=3.2,Aa=1/2.56,va=1/(2/3*Math.sqrt(1/3)),il=.6,H0=.07,B0=.14,Y0=.3,rl=.6,ll=.35,cl=.3,j0=.3,hl=1.26,fl=1.6,ul=.045,Qi=.5,Cs=Math.cos(Qi),X0=Math.sin(Qi),dl=.22,pl=.5,Ji=.36,ml=1.1,G0=1.625,Ml=.5,gl=.9,As=.7,bl=.15,yl=1.3,Eo=20,Gn=zt+2*Eo,kl=.8,wl=.3,Cl=.8,Al=.7,vl=.5,Ve=2.5,Sa=1.2,za=3,Sl=.8,xl=.3,K0=.1,Ue=32*Math.PI/180,Xs=1;function tr(t,n,o=Ue){const e=Math.cos(o),a=Math.sin(o);return Qo([t[0]*e+n[0]*a,t[1]*e+n[1]*a,t[2]*e+n[2]*a])}function nr(t,n){return Qo([.94*t[0]-.34*n[0],.94*t[1]-.34*n[1],.94*t[2]-.34*n[2]])}function Ua(t,n){const o=-.5*t,e=-.5*n-.87,a=Math.hypot(o,e)||1;return[o/a,e/a]}const ss=(t,n)=>{const[o,e]=Ua(t,n);return{bx:o,by:e,front:Ue}},Pl=t=>`${Math.round(Math.atan2(t.by,t.bx)/(Math.PI/36))}|${Math.round(t.front/(Math.PI/90))}`;function Ws(t,n){let o=t*374761393+n*668265263|0;return o=Math.imul(o^o>>>13,1274126177),((o^o>>>16)>>>0)/4294967296}function fe(t,n,o,e){const a=n-1,s=Math.min(a,Math.max(0,o)),r=Math.min(a,Math.max(0,e)),l=Math.min(a-1,s|0),c=Math.min(a-1,r|0),h=s-l,d=r-c,f=c*n+l;return(t[f]*(1-h)+t[f+1]*h)*(1-d)+(t[f+n]*(1-h)+t[f+n+1]*h)*d}function Qa(t,n,o,e,a,s,r,l=ue,c=ss(s,r)){const h=Zi(e),d=Ni(s,r),f=Ui(n,o,h,d,l,c),u=Bo.get(f);if(u)return u;if(a)return Ll(t,n,o,e,s,r,l,c);const i=`${n}|${Math.round(o)}|`;if(h>192&&!Qe&&!we.has(f)){let m=!1;for(const g of Bo.keys())g.startsWith(i)&&(m=!0);for(const g of we)g.startsWith(i)&&(m=!0);m||Qa(t,n,o,1,!1,s,r,l,c)}if(!we.has(f)){we.add(f),Ca.delete(f);const m=`${n}|${Math.round(o)}|${h}|${d}`,g=R0.get(m)??[];for(g.push(f);g.length>2;){const b=g.shift();Ca.add(b),we.delete(b)}R0.set(m,g);const M=or(t,f,h,s,r,l,c);if(M)for(const b of M.steps)Ka(()=>Ca.has(f)?void 0:b())}Ys=!0;for(const[m,g]of Bo)if(m.startsWith(i))return g;return null}function Tl(t){let n=t>>>0;return()=>{n=n+1831565813|0;let o=Math.imul(n^n>>>15,1|n);return o=o+Math.imul(o^o>>>7,61|o)^o,((o^o>>>14)>>>0)/4294967296}}function Ee(t,n){return(o,e)=>{const a=o/t,s=e/t,r=Math.floor(a),l=Math.floor(s),c=a-r,h=s-l,d=c*c*(3-2*c),f=h*h*(3-2*h),u=(b,w)=>Ws(b+n*131,w-n*71),i=u(r,l),m=u(r+1,l),g=u(r,l+1),M=u(r+1,l+1);return(i+(m-i)*d)*(1-f)+(g+(M-g)*d)*f}}function Il(t,n,o){let e=t*374761393+n*668265263+o*1274126177|0;return e=Math.imul(e^e>>>13,1274126177),((e^e>>>16)>>>0)/4294967296}function Fl(t,n){return(o,e,a)=>{const s=o/t,r=e/t,l=a/t,c=Math.floor(s),h=Math.floor(r),d=Math.floor(l),f=s-c,u=r-h,i=l-d,m=f*f*(3-2*f),g=u*u*(3-2*u),M=i*i*(3-2*i),b=(k,A,S)=>Il(k+n*131,A-n*71,S+n*17),w=(k,A,S)=>k+(A-k)*S,v=w(b(c,h,d),b(c+1,h,d),m),y=w(b(c,h+1,d),b(c+1,h+1,d),m),C=w(b(c,h,d+1),b(c+1,h,d+1),m),p=w(b(c,h+1,d+1),b(c+1,h+1,d+1),m);return w(w(v,y,g),w(C,p,g),M)}}function Ll(t,n="custom",o=9.75,e=320,a=-1,s=0,r=ue,l=ss(a,s)){const c=Zi(e),h=Ui(n,o,c,Ni(a,s),r,l),d=Bo.get(h);if(d)return d;const f=or(t,h,c,a,s,r,l);if(f)for(const u of f.steps)u();return Bo.get(h)??{R:0,mask:null,haze:null,cut:null,core:null,dark:null,light:null,glint:null,back:null,backSoft:null}}function or(t,n,o,e,a,s=ue,r=ss(e,a)){if(Bo.has(n))return null;const l=P=>{Bo.size>=24&&Bo.delete(Bo.keys().next().value),Bo.set(n,P),we.delete(n),Yi()},{N:c}=t,h=o/zt,d=(P,B,X)=>fe(P,c,(B+st)/zt*c-.5,(X+st)/zt*c-.5),f=(P,B)=>d(t.sd,P,B),u=st+Eo,i=Math.round(o*Gn/zt),m={R:o,mask:null,haze:null,cut:null,core:null,dark:null,light:null,glint:null,back:null,backSoft:null},g=Wn(i),M=Wn(i),b=Wn(o),w=Wn(i),v=Wn(i),y=Wn(i),C=g&&Fn(g,!1),p=M&&Fn(M,!1),k=b&&Fn(b,!1),A=w&&Fn(w,!1),S=v&&Fn(v,!1),E=y&&Fn(y,!1);if(!g||!M||!b||!w||!v||!y||!C||!p||!k||!A||!S||!E)return l(m),null;const I=Tl(c*7919+17),W=Ee(3.4,21),x=Ee(22,9),$=Ee(13,57),{length:T,density:F,fuzz:_,clumps:q,curl:D}=s,O=s.gravity??ue.gravity,K=Math.hypot(e,a)||1,U=e/K,nt=a/K,dt=[U,nt,0],pt=[0,0,1],Tt=[0,1,0],j=tr(dt,pt,r.front),N=nr([r.bx,r.by,0],pt),Q=Qo([j[0],j[1],j[2]+1]),Ot=Qo([-.55*dt[0]+.85*pt[0]+.15*Tt[0],-.55*dt[1]+.85*pt[1]+.15*Tt[1],-.55*dt[2]+.85*pt[2]+.15*Tt[2]]);let G=12;for(let P=-st;P<60;P+=.5)if(f(50,P)>.5){G=P+1;break}G-=18;const ut=50,ft=(P,B)=>{const R=f(P-.8,B)-f(P+.8,B),Z=f(P,B-.8)-f(P,B+.8),tt=Math.hypot(R,Z)||1;return[R/tt,Z/tt]},xt=(P,B)=>{let X=P-ut,R=B-G;const Z=Math.hypot(X,R)||1;X/=Z,R/=Z;const tt=O*(1-.6*Math.exp(-Z/8));let ct=X*(1-.8*tt),et=R*(1-.8*tt)+tt;const Wt=f(P,B);if(Wt<5){const[jt,Gt]=ft(P,B),Dt=Math.max(0,-Gt),wt=jt*(1-O*Dt),Ct=Gt*(1-O*Dt)+1.2*O,Ft=Math.max(0,Math.min(1,1-Wt/5))*.75;ct=ct*(1-Ft)+wt*Ft*1.6,et=et*(1-Ft)+Ct*Ft*1.6}const kt=(W(P,B)-.5)*(.5+1.6*D)+($(P,B)-.5)*(.6+D),yt=Math.cos(kt),mt=Math.sin(kt),ot=ct*yt-et*mt,ht=ct*mt+et*yt,At=Math.hypot(ot,ht)||1;return[ot/At,ht/At]},it=[],z=(P,B,X)=>{for(let R=0;R<P;R+=B)it.push(()=>X(R,Math.min(P,R+B)))},L=(P,B)=>d(t.h,P,B),bt=(P,B)=>{const R=(L(P+.6,B)-L(P-.6,B))/1.2,Z=(L(P,B+.6)-L(P,B-.6))/(2*.6),tt=Math.hypot(R,Z);return[tt>1e-6?-R/tt:0,tt>1e-6?-Z/tt:0,tt/Math.sqrt(1+tt*tt)]},H=112,Lt=Gn/H,It=new Float32Array(H*H),Cn=new Float32Array(H*H),qt=new Float32Array(H*H),Mn=new Float32Array(H*H),en=new Float32Array(H*H),gn=new Float32Array(H*H),$t=new Float32Array(H*H),Rt=new Float32Array(H*H),vt=new Float32Array(H*H),on=new Float32Array(H*H),yn=new Float32Array(H*H),io=new Float32Array(H*H),Mo=new Float32Array(H*H);z(H,28,(P,B)=>{for(let X=P,R=P*H;X<B;X++)for(let Z=0;Z<H;Z++,R++){const tt=(Z+.5)*Lt-u,ct=(X+.5)*Lt-u;let[et,Wt]=xt(tt,ct);const[kt,yt,mt]=bt(tt,ct),ot=mt*(.25+.5*(1-O))*(1-O*Math.max(0,-yt));et=et*(1-ot)+kt*ot,Wt=Wt*(1-ot)+(yt+.35*O)*ot;const ht=Math.hypot(et,Wt)||1;et/=ht,Wt/=ht,It[R]=et,Cn[R]=Wt,qt[R]=mt;let At=kt*mt,jt=yt*mt,Gt=Math.sqrt(Math.max(0,1-mt*mt));const Dt=f(tt,ct);if(Dt<2){const[Zt,Ut]=ft(tt,ct),Jt=Dt>=0?.7*(1-Dt/2):Math.min(1,.7-.2*Dt);At+=Jt*(Zt-At),jt+=Jt*(Ut-jt),Gt-=Jt*Gt;const Pn=Math.hypot(At,jt,Gt)||1;At/=Pn,jt/=Pn,Gt/=Pn}Mn[R]=At,en[R]=jt,gn[R]=Gt,$t[R]=rn(-3.5,-1.5,Dt),Mo[R]=x(tt,ct),yn[R]=Dt>0?L(tt,ct):0;const wt=Math.sqrt(At*At+jt*jt),Ct=wt>1e-4?At/wt:0,Ft=wt>1e-4?jt/wt:0,_t=et*Ct+Wt*Ft,Bt=(1-Math.max(0,Gt))*_t;let Vt=Cs*(et-Bt*Ct)+X0*wt*Ct,Yt=Cs*(Wt-Bt*Ft)+X0*wt*Ft;const Nt=rn(-.5,1.5,Dt);Vt=et+(Vt-et)*Nt,Yt=Wt+(Yt-Wt)*Nt;const nn=Math.sqrt(Vt*Vt+Yt*Yt)||1;Rt[R]=Vt/nn,vt[R]=Yt/nn,on[R]=1+(Math.min(1,nn)-1)*Nt}}),it.push(()=>{const P=new Float32Array(H*H),B=Float32Array.from(yn);for(let X=0;X<3;X++){for(let R=0,Z=0;R<H;R++)for(let tt=0;tt<H;tt++,Z++){let ct=0;for(let et=-2;et<=2;et++)ct+=B[R*H+Math.min(H-1,Math.max(0,tt+et))];P[Z]=ct/5}for(let R=0,Z=0;R<H;R++)for(let tt=0;tt<H;tt++,Z++){let ct=0;for(let et=-2;et<=2;et++)ct+=P[Math.min(H-1,Math.max(0,R+et))*H+tt];B[Z]=ct/5}}for(let X=0,R=0;X<H;X++)for(let Z=0;Z<H;Z++,R++){const tt=rn(.2,2,f((Z+.5)*Lt-u,(X+.5)*Lt-u)),ct=rn(.3,3.5,B[R]-yn[R])*tt,et=rn(.15,.85,en[R])*(1-gn[R]);io[R]=Math.min(1,ct+.45*et)*$t[R]}});const J=(P,B,X)=>fe(P,H,(B+u)/Lt-.5,(X+u)/Lt-.5),Mt=(P,B)=>{const X=J(Rt,P,B),R=J(vt,P,B),Z=Math.sqrt(X*X+R*R);return Z>1e-4?[X/Z,R/Z]:[0,1]},Ht=(P,B)=>{const X=J(It,P,B),R=J(Cn,P,B),Z=Math.sqrt(X*X+R*R);return Z>1e-4?[X/Z,R/Z]:[0,1]},Kt=i>>1,vn=Kt/Gn,ln=new Float32Array(Kt*Kt),Sn=new Float32Array(Kt*Kt),_n=(P,B,X)=>fe(P,Kt,(B+u)*vn-.5,(X+u)*vn-.5),ro=Ee(.7+.35*T,61),Ln=Ee(2.2+.6*T,67),Jn=(.2+.5*_)*Math.min(1.8,T),Bn=(P,B)=>{const X=.3*Math.max(-1.6,Math.min(1.6,_n(ln,P,B)))/1.6+.25*(ro(P,B)-.5)*2.4+.45*(Ln(P,B)-.5)*2.4;return Jn*Math.max(-1,Math.min(1,X))},go=(.8+.45*T)*(.65+.4*q),Y=1.5+1.6*T,lt=.32*go*(.15+.85*q),at=new Float32Array(i*i).fill(-.25*lt),gt=new Int32Array(i*i).fill(-1),St=16,Pt=Math.sqrt(.6*go*Y/al/Aa),an=Math.ceil(Gn/Pt),rt=new Float32Array(an*an*St);let un=0;const En=.45-.2*O,cn=Fl(1.6*Y,79),qn=Ee(9,73),Yn=1.5*lt*(.25+q);it.push(()=>{for(let P=0;P<an;P++)for(let B=0;B<an;B++){const X=(B+I())*Pt-u,R=(P+I())*Pt-u,Z=I(),tt=I(),ct=I(),et=I(),Wt=I(),kt=I(),yt=I();let mt=J(Mn,X,R),ot=J(en,X,R),ht=J(gn,X,R);const At=Math.hypot(mt,ot,ht)||1;mt/=At,ot/=At,ht/=At;const[jt,Gt]=Ht(X,R),Dt=(Z-.5)*(.2+.45*D),wt=Math.cos(Dt),Ct=Math.sin(Dt),Ft=jt*wt-Gt*Ct,_t=jt*Ct+Gt*wt,Bt=Ft*mt+_t*ot;let Vt=Ft-Bt*mt,Yt=_t-Bt*ot,Nt=-Bt*ht,nn=Math.hypot(Vt,Yt,Nt);nn<.05&&(Vt=ht*mt,Yt=ht*ot,Nt=ht*ht-1,nn=Math.hypot(Vt,Yt,Nt)||1),Vt/=nn,Yt/=nn,Nt/=nn;let Zt=ot*Nt-ht*Yt,Ut=ht*Vt-mt*Nt,Jt=mt*Yt-ot*Vt;const Pn=En+.2*tt,jn=Math.cos(Pn),Dn=Math.sin(Pn),ho=.8+.45*qn(X,R),fo=go*ho*(.8+.4*ct),to=Y*ho*(.75+.5*et);let Rn=(Vt*jn+mt*Dn)*to*h,Tn=(Yt*jn+ot*Dn)*to*h,In=Math.hypot(Rn,Tn);In<1.5?(Rn=Ft,Tn=_t,In=1.5):(Rn/=In,Tn/=In);let Hn=-Zt*Tn+Ut*Rn;Hn<0&&(Zt=-Zt,Ut=-Ut,Jt=-Jt,Hn=-Hn);const Un=Math.max(.6,.5*fo*h*Math.max(.15,Hn)),uo=In/(to*h)*(Un/(.5*fo*h)),$n=cn(X,R,L(X,R));if(Wt>Aa/Math.max(Aa,uo)*(1-il*q*(1-rn(.25,.65,$n))))continue;const mn=un++*St;rt[mn]=(X+u)*h,rt[mn+1]=(R+u)*h,rt[mn+2]=Rn,rt[mn+3]=Tn,rt[mn+4]=In,rt[mn+5]=Un,rt[mn+6]=.1*lt*kt+Yn*$n,rt[mn+7]=(yt-.5)*1.2*D,rt[mn+8]=Vt,rt[mn+9]=Yt,rt[mn+10]=Nt,rt[mn+11]=Zt,rt[mn+12]=Ut,rt[mn+13]=Jt,rt[mn+14]=to,rt[mn+15]=fo}});const dn=P=>(P<.25?4*P:1)*(1-.5*P),xn=6;for(let P=0;P<xn;P++)it.push(()=>{const B=Math.floor(un*P/xn),X=Math.floor(un*(P+1)/xn);for(let R=B;R<X;R++){const Z=R*St,tt=rt[Z],ct=rt[Z+1],et=rt[Z+2],Wt=rt[Z+3],kt=rt[Z+4],yt=rt[Z+5],mt=rt[Z+6],ot=rt[Z+7],ht=yt*(1+Math.abs(ot))+1,At=tt+et*kt,jt=ct+Wt*kt,Gt=Math.max(0,Math.floor(Math.min(tt,At)-ht)),Dt=Math.min(i-1,Math.ceil(Math.max(tt,At)+ht)),wt=Math.max(0,Math.floor(Math.min(ct,jt)-ht)),Ct=Math.min(i-1,Math.ceil(Math.max(ct,jt)+ht)),Ft=1/kt,_t=1/yt;for(let Bt=wt;Bt<=Ct;Bt++){const Vt=Bt+.5-ct;for(let Yt=Gt,Nt=Bt*i+Gt;Yt<=Dt;Yt++,Nt++){const nn=Yt+.5-tt,Zt=(nn*et+Vt*Wt)*Ft;if(Zt<=0||Zt>=1)continue;const Ut=va*Math.sqrt(Zt)*(1-Zt),Jt=(Vt*et-nn*Wt)*_t-ot*Zt*Zt;if(Jt>=Ut||Jt<=-Ut)continue;const Pn=Jt/Ut,jn=mt+lt*dn(Zt)*(1-Pn*Pn);jn>at[Nt]&&(at[Nt]=jn,gt[Nt]=R)}}}});const Vn=new Float32Array(i*i),So=Math.max(1,Math.round(.3*go*h)),Qt=new Float32Array(i),kn=(P,B,X,R,Z)=>{const tt=Z===1?i:1,ct=1/(2*X+1),et=yt=>Qt[yt<0?0:yt>=i?i-1:yt],Wt=R*tt;for(let yt=0;yt<i;yt++)Qt[yt]=P[Wt+yt*Z];let kt=0;for(let yt=-X;yt<=X;yt++)kt+=et(yt);for(let yt=0;yt<i;yt++)B[Wt+yt*Z]=kt*ct,kt+=et(yt+X+1)-et(yt-X)};it.push(()=>{for(let P=0;P<i;P++)kn(at,Vn,So,P,1);for(let P=0;P<i;P++)kn(Vn,Vn,So,P,1)}),it.push(()=>{for(let P=0;P<i;P++)kn(Vn,Vn,So,P,i);for(let P=0;P<i;P++)kn(Vn,Vn,So,P,i)}),it.push(()=>{for(let P=0;P<i;P++)kn(at,at,1,P,1);for(let P=0;P<i;P++)kn(at,at,1,P,i)});const pn=new ImageData(i,i),Zn=new ImageData(i,i),De=new ImageData(i,i),a0=new ImageData(i,i),i0=new ImageData(i,i),Js=new Float32Array(i*i),Xt=new Float32Array(11),cs=(P,B,X,R,Z)=>{const tt=Math.min(H-1,Math.max(0,(P+u)/Lt-.5)),ct=Math.min(H-1,Math.max(0,(B+u)/Lt-.5)),et=Math.min(H-2,tt|0),Wt=Math.min(H-2,ct|0),kt=tt-et,yt=ct-Wt,mt=Wt*H+et,ot=(1-kt)*(1-yt),ht=kt*(1-yt),At=(1-kt)*yt,jt=kt*yt,Gt=mn=>mn[mt]*ot+mn[mt+1]*ht+mn[mt+H]*At+mn[mt+H+1]*jt;let Dt=Gt(Mn),wt=Gt(en),Ct=Gt(gn);const Ft=Math.sqrt(Dt*Dt+wt*wt+Ct*Ct)||1;Dt/=Ft,wt/=Ft,Ct/=Ft;const _t=Dt*j[0]+wt*j[1]+Ct*j[2];Xt[4]=Dt,Xt[5]=wt,Xt[6]=Ct,Xt[7]=_t,Xt[8]=Gt(io);const Bt=Gt($t);if(Xt[9]=Bt,Xt[10]=Gt(Mo),Bt<=0){Xt[0]=Xt[1]=Xt[3]=0,Xt[2]=.7;return}const Vt=rn(-.2,.5,_t),Yt=X*Dt+R*wt;let Nt=X-Yt*Dt,nn=R-Yt*wt,Zt=-Yt*Ct;const Ut=Math.sqrt(Nt*Nt+nn*nn+Zt*Zt);Ut>.001?(Nt/=Ut,nn/=Ut,Zt/=Ut):(Nt=0,nn=0,Zt=1);const Jt=Math.cos(Z),Pn=Math.sin(Z);Nt=Nt*Jt+Dt*Pn,nn=nn*Jt+wt*Pn,Zt=Zt*Jt+Ct*Pn;const jn=Nt*Q[0]+nn*Q[1]+Zt*Q[2],Dn=Dt*Q[0]+wt*Q[1]+Ct*Q[2],ho=jn-.12*Dn,fo=jn+.2*Dn,to=Math.max(0,1-ho*ho),Rn=to*to,Tn=Rn*Rn,In=Tn*Tn,Hn=In*In,Un=Math.max(0,1-fo*fo),uo=Un*Un;Xt[0]=Vt*(.85*Hn*Hn*Tn+.15*uo*uo),Xt[0]*=(.4+.6*(1-rn(.35,.85,_t)))*Bt;const $n=Math.sqrt(Math.max(0,1-Zt*Zt));Xt[1]=rn(-.3,.6,Dt*N[0]+wt*N[1]+Ct*N[2])*Math.pow(1-Ct,1.6)*(.4+.6*$n)*(1-.6*Math.max(0,wt))*Bt,Xt[3]=rn(-.5,.75,Dt*N[0]+wt*N[1]+Ct*N[2])*Math.pow(1-Ct,.85)*(1-.6*Math.max(0,wt))*Bt,Xt[2]=Vt*Bt+.7*(1-Bt)};it.push(()=>{for(let P=0,B=0;P<i;P++)for(let X=0;X<i;X++,B++){const R=Ws(X+911,P+37);Js[B]=R*R*R}});const Re=.25,br=Math.sqrt(1/7-1/16),He=Math.max(1,Math.round((.35+.4*T)*h)),r0=[],ta=new Float32Array(2*He+1),l0=new Float32Array(2*He+1);for(let P=0;P<=2*He;P++){const B=new Float32Array(P+1);let X=0,R=0;for(let Z=0;Z<=P;Z++){const tt=P?Z/P:0,ct=tt<=As?1:(1-tt)/(1-As);B[Z]=1-Ml*tt,X+=B[Z]*ct*Re,R+=B[Z]*B[Z]*(ct/7-Re*Re*ct*ct)}r0.push(B),ta[P]=X,l0[P]=Math.sqrt(Math.max(1e-6,R))}const yr=.12*(o>=512?1:o>=320?.75:.4)*Math.min(1.4,.55+.35*F),c0=Math.max(1,1.5*go*h),Fe=Math.max(1,Math.min(5,Math.round(c0))),na=new Int32Array(Fe),oa=new Int32Array(Fe),h0=new Float32Array(Fe);for(let P=0;P<Fe;P++){const B=(P+1)/Fe*c0;na[P]=Math.round(U*B),oa[P]=Math.round(nt*B),h0[P]=Math.hypot(na[P],oa[P])/h}const kr=Je(1.35),wr=Je(1/2.2),ea=P=>{const B=(P+Y0)/(1+Y0);return B<=0?0:B>=1?1:kr[B*ve|0]},f0=o>=512?1:o>=320?.8:.55,lo=new Float32Array(4),u0=(P,B,X,R,Z)=>{if(Z<0){const[Bt,Vt]=Mt(X,R);lo[0]=Bt,lo[1]=Vt,lo[2]=.5,lo[3]=0;return}const tt=Z*St,ct=rt[tt+2],et=rt[tt+3],Wt=rt[tt+4],kt=rt[tt+5],yt=rt[tt+7],mt=P+.5-rt[tt],ot=B+.5-rt[tt+1],ht=Math.min(.995,Math.max(.005,(mt*ct+ot*et)/Wt)),At=Math.sqrt(ht),jt=va*At*(1-ht),Gt=va*(.5*(1-ht)/At-At),Dt=Math.max(-1,Math.min(1,((ot*ct-mt*et)/kt-yt*ht*ht)/jt)),wt=Math.max(-1.2,Math.min(1.2,Dt*Gt+2*yt*ht)),Ct=Wt*ct-wt*kt*et,Ft=Wt*et+wt*kt*ct,_t=Math.sqrt(Ct*Ct+Ft*Ft)||1;lo[0]=Ct/_t,lo[1]=Ft/_t,lo[2]=ht,lo[3]=dn(ht)*(1-Dt*Dt)},Le=new Float32Array(i*i);z(i,32,(P,B)=>{for(let X=P;X<B;X++){const R=(X+.5)/h-u;for(let Z=0,tt=X*i;Z<i;Z++,tt++){const ct=(Z+.5)/h-u;u0(Z,X,ct,R,gt[tt]);const et=lo[0],Wt=lo[1],kt=Math.min(H-1,Math.max(0,(ct+u)/Lt-.5)),yt=Math.min(H-1,Math.max(0,(R+u)/Lt-.5)),mt=Math.min(H-2,kt|0),ot=Math.min(H-2,yt|0),ht=kt-mt,At=yt-ot,jt=ot*H+mt,Gt=(qt[jt]*(1-ht)+qt[jt+1]*ht)*(1-At)+(qt[jt+H]*(1-ht)+qt[jt+H+1]*ht)*At,Dt=(on[jt]*(1-ht)+on[jt+1]*ht)*(1-At)+(on[jt+H]*(1-ht)+on[jt+H+1]*ht)*At,wt=2*Math.max(1,Math.min(He,Math.round(He*(.5+.5*Gt)*Dt/Cs))),Ct=r0[wt];let Ft=0,_t=0;for(let Yt=0;Yt<=wt;Yt++){const Nt=Math.round(Z-et*Yt),nn=Math.round(X-Wt*Yt);if(Nt<0||nn<0||Nt>=i||nn>=i){Ft+=ta[wt]/(wt+1);continue}const Zt=Js[nn*i+Nt],Ut=Zt*53.7,Jt=wt*(As+(1-As)*(Ut-Math.floor(Ut)));Yt<=Jt&&(Ft+=Zt*Ct[Yt],_t+=Zt*Ct[Yt]*Yt/(Jt||1))}const Bt=(Ft-ta[wt])/l0[wt],Vt=Ft>1e-4?_t/Ft:.5;Le[tt]=Bt+gl*Math.min(2.5,Math.max(0,Bt))*(Vt-.45)}}});let d0=0,p0=0;z(i,16,(P,B)=>{const X=pn.data,R=Zn.data,Z=De.data,tt=a0.data,ct=i0.data;for(let et=P;et<B;et++){const Wt=(et+.5)/h-u;for(let kt=0;kt<i;kt++){const yt=(kt+.5)/h-u,mt=et*i+kt,ot=gt[mt],ht=ot*St;u0(kt,et,yt,Wt,ot);const At=lo[0],jt=lo[1],Gt=lo[2],Dt=lo[3];cs(yt,Wt,At,jt,.25+.2*Dt);const wt=Xt[4],Ct=Xt[5],Ft=Xt[6],_t=Xt[7],Bt=kt>0?mt-1:mt,Vt=kt<i-1?mt+1:mt,Yt=et>0?mt-i:mt,Nt=et<i-1?mt+i:mt,nn=(at[Vt]-at[Bt])*h/(Vt-Bt||1),Zt=(at[Nt]-at[Yt])*h*i/(Nt-Yt||1),Ut=Math.sqrt(wt*wt+Ct*Ct);let Jt=1,Pn=0,jn=0,Dn=1,ho=0;Ut>.001&&(Jt=-Ct/Ut,Pn=wt/Ut,jn=-Ft*wt/Ut,Dn=-Ft*Ct/Ut,ho=Ut);const fo=Math.max(-1.5,Math.min(1.5,nn*Jt+Zt*Pn)),to=Math.max(-1.5,Math.min(1.5,nn*jn+Zt*Dn));let Rn=wt-fo*Jt-to*jn,Tn=Ct-fo*Pn-to*Dn,In=Ft-to*ho;const Hn=Math.sqrt(Rn*Rn+Tn*Tn+In*In)||1;Rn/=Hn,Tn/=Hn,In/=Hn;let Un=1;if(ot>=0){const oo=rt[ht+8],qo=rt[ht+9],ko=rt[ht+10],wo=.9*oo+.44*wt,Do=.9*qo+.44*Ct,Ro=.9*ko+.44*Ft,ae=(wo*j[0]+Do*j[1]+Ro*j[2])/(Math.sqrt(wo*wo+Do*Do+Ro*Ro)||1);Un=1-j0+j0*Math.min(1.2,Math.sqrt(Math.max(0,1-ae*ae))/.85)}const uo=Rn*j[0]+Tn*j[1]+In*j[2],$n=at[mt];let mn=1;if(_t>-.25){const oo=Math.min(.97,Math.max(.05,_t)),qo=oo/Math.sqrt(1-oo*oo);let ko=0;for(let wo=0;wo<Fe;wo++){const Do=kt+na[wo],Ro=et+oa[wo];if(Do<0||Ro<0||Do>=i||Ro>=i)break;const ae=at[Ro*i+Do]-$n-h0[wo]*qo;ae>ko&&(ko=ae)}mn=1-rl*rn(0,.35*lt,ko)}let ee=1-ll*rn(0,.6*lt,Vn[mt]-$n);ot>=0&&(ee*=1-cl*(1-rn(0,.35,Gt)));const To=H0+B0*Math.max(0,Rn*Ot[0]+Tn*Ot[1]+In*Ot[2]),yo=H0+B0*Math.max(0,wt*Ot[0]+Ct*Ot[1]+Ft*Ot[2]);let On=ee*(To+ea(uo)*mn*Un)*hl/(yo+ea(_t));ot>=0&&(On*=(1+.15*Gt*Gt)*(1+.08*(Ws(ot,5)-.5)));const Wo=Xt[8];On*=1-dl*Wo*(.6+.4*rn(0,.6*lt,Vn[mt]-$n)),On=1+(On-1)*f0;const po=Xt[9],Io=(yo+ea(_t))/ml,zo=(Io>=1?1:wr[Io*ve|0])*po+.75*(1-po);let Fo=Math.sqrt(On>2.4?2.4:On);Fo>1&&(Fo=1+(Fo-1)/(1+2.5*zo*(Fo-1)));const be=Le[mt];let ds=0;if(_t>0){const oo=j[0]-_t*wt,qo=j[1]-_t*Ct,ko=Math.sqrt(1-_t*_t),wo=ko>.001?bl*h*Math.min(3,ko/Math.max(.2,_t))/ko:0,Do=Math.min(i-1.001,Math.max(0,kt+oo*wo)),Ro=Math.min(i-1.001,Math.max(0,et+qo*wo)),ae=Do|0,k0=Ro|0,ps=Do-ae,w0=Ro-k0,ms=k0*i+ae,Tr=(Le[ms]*(1-ps)+Le[ms+1]*ps)*(1-w0)+(Le[ms+i]*(1-ps)+Le[ms+i+1]*ps)*w0;ds=Math.max(0,Tr-Math.max(0,be))*rn(0,.3,_t)}let ye=Fo*(1+yr*(be*(.45+.55*Xt[2])*(.75+.5*Gt)-yl*ds))+.04*(Xt[10]-.5)+ul*f0*po;const Nn=Math.min(yt+u,Gn-u-yt,Wt+u,Gn-u-Wt),fa=Nn>=8?1:Nn<=0?0:Nn/8*(Nn/8)*(3-2*Nn/8);ye=1+(ye-1)*fa;const Xn=mt*4;ye<1?X[Xn+3]=Math.round(255*Math.min(1,(1-ye)*zo/Math.max(.4,zo-Ji))):(R[Xn]=R[Xn+1]=R[Xn+2]=255,R[Xn+3]=Math.round(255*Math.min(1,fl*(G0-1)*zo/(G0-zo)*(ye-1)*(1-.7*Wo))));const _o=Math.max(-2,Math.min(2,4*(Fo-1))),hn=kt>>1,wn=et>>1;if(hn<Kt&&wn<Kt){const oo=wn*Kt+hn;ln[oo]+=.25*$n,Sn[oo]+=.25*_o}const no=rn(-.4,1,_o)*Math.max(0,Math.min(1.4,.65+.25*be));Z[Xn]=Z[Xn+1]=Z[Xn+2]=tt[Xn]=tt[Xn+1]=tt[Xn+2]=255,Z[Xn+3]=Math.round(255*Math.min(1,Xt[0]*no)),tt[Xn+3]=Math.round(255*Math.min(1,Xt[1]*Math.max(0,Math.min(1.6,.5+.4*be))));const se=Math.max(.55,Math.min(1.3,.85+.15*be+.12*_o));ct[Xn]=ct[Xn+1]=ct[Xn+2]=255,ct[Xn+3]=Math.round(255*Math.min(1,.85*Xt[3]*se))}}}),it.push(()=>{const P=Kt*Kt;for(let R=0;R<P;R++)d0+=ln[R],p0+=ln[R]*ln[R];const B=d0/P,X=Math.sqrt(Math.max(1e-9,p0/P-B*B));for(let R=0;R<P;R++)ln[R]=Math.max(-2.5,Math.min(2.5,(ln[R]-B)/X))}),it.push(()=>{C.putImageData(pn,0,0),p.putImageData(Zn,0,0),A.putImageData(De,0,0),E.putImageData(i0,0,0),S.putImageData(a0,0,0);for(const P of[C,p,A,S])P.setTransform(1,0,0,1,Eo*h,Eo*h),P.lineCap="round",P.lineJoin="round"});const Be=16,m0=Gn*Gn,Ye=o>=512?1:o>=320?.45:0,Cr=[{count:.12,len:1.2,vary:1,endOn:.6,width:.09,spread:30,alpha:.4,deep:1,lift:.25,light:.46,dark:.34,bend:.93,clump:[1,0],clumpW:0,shadow:0,shadowW:1,over:0,crowd:!1,short:0},{count:.4*Ye,len:.9,vary:1.2,endOn:.35,width:.13,spread:100,alpha:.26,deep:.2,lift:.18,light:.55,dark:.06,bend:1.2,clump:[1,Math.round(1+2*q)],clumpW:.08+.07*q,shadow:.25,shadowW:2,over:.25,crowd:!0,short:1}],Ar=P=>Math.min(Be-1,Math.max(0,Math.round((Math.max(-1,Math.min(1,P))+1)/2*(Be-1)))),bo=6,hs=P=>Math.min(bo-1,P*bo|0),sa=4,xo=new Float32Array(sa+1),Po=new Float32Array(sa+1);for(const P of Cr){if(P.count<=0)continue;const B=P.clump[0]+.5*P.clump[1],X=Math.max(1,Math.ceil(m0*P.count*F*(P.crowd?2:1)*(.5+.5*B)/9e3));for(let R=0;R<X;R++)it.push(()=>{const Z=[],tt=[],ct=[],et=[];for(let ot=0;ot<Be;ot++)Z.push(new Path2D);for(let ot=0;ot<bo;ot++)tt.push(new Path2D),ct.push(new Path2D);for(let ot=0;ot<3;ot++)et.push(new Path2D);const Wt=new Path2D,kt=Math.round(m0*P.count*F*(P.crowd?2:1)/X);for(let ot=0;ot<kt;ot++){const ht=I()*Gn-u,At=I()*Gn-u,jt=I(),Gt=I(),Dt=I(),wt=I(),Ct=I(),Ft=I();if(Ft*8>Math.min(ht+u,Gn-u-ht,At+u,Gn-u-At)||P.crowd&&Ft>(f(ht,At)>0?.5/Math.max(.25,J(gn,ht,At)):.5))continue;const[_t,Bt]=Mt(ht,At),Vt=J(qt,ht,At),Yt=J(on,ht,At)/Cs,Nt=(Gt-.5)*(.6+.8*D)*(1-.5*Vt),nn=Math.cos(Nt),Zt=Math.sin(Nt),Ut=_t*nn-Bt*Zt,Jt=_t*Zt+Bt*nn,Pn=Dt<.1?1.35+.6*wt:1,jn=(P.len+P.vary*wt*wt)*h*T*Pn*Yt*(1-P.endOn+1.25*P.endOn*Vt);cs(ht,At,Ut,Jt,.1+.5*Ws(ot,7+R));let Dn=.22*_n(ln,ht,At)+.3*_n(Sn,ht,At);const ho=jt<P.light*(.4+.6*Xt[2]);ho?Dn+=.2+.28*Ct:jt<P.light+P.dark&&(Dn-=.2+.28*Ct),Dn+=P.lift,Dn+=.45*(Xt[2]-.5)-.35*Xt[8],Dn>0&&(Dn*=.3+.7*Xt[2]);const fo=.15*(1-Xt[2]),to=(ht+st)*h,Rn=(At+st)*h,Tn=(I()-.5)*P.bend*D*jn,In=Ct<.3?-.6*Tn:Tn*(.6+.8*I()),Hn=P.clump[0]+(I()*(P.clump[1]+1)|0),Un=P.clumpW*h*Math.min(1.5,T);for(let uo=0;uo<Hn;uo++){const $n=Hn>1?I()-.5:0,mn=Hn>1?.7+.3*I():1,ee=Hn>1?(I()-.5)*.3:0,To=to-Jt*$n*Un,yo=Rn+Ut*$n*Un,On=jn*mn,Wo=Tn+ee*On,po=In+ee*On-$n*Un*.7,Io=To+Ut*On*.33-Jt*Wo,zo=yo+Jt*On*.33+Ut*Wo,Fo=To+Ut*On*.67-Jt*po,be=yo+Jt*On*.67+Ut*po,ds=To+Ut*On-Jt*(In-$n*Un*.75),ye=yo+Jt*On+Ut*(In-$n*Un*.75),Nn=On<4?2:On<10?3:sa;for(let hn=0;hn<=Nn;hn++){const wn=hn/Nn,no=1-wn,se=no*no*no,oo=3*no*no*wn,qo=3*no*wn*wn,ko=wn*wn*wn;xo[hn]=se*To+oo*Io+qo*Fo+ko*ds,Po[hn]=se*yo+oo*zo+qo*be+ko*ye}const fa=Dn+(Hn>1?(I()-.5)*.25:0),Xn=.3+.15*Xt[2];for(let hn=0;hn<Nn;hn++){const wn=Z[Ar(fa-.3-fo*(1-hn/Nn)+Xn*(hn+.5)/Nn)];wn.moveTo(xo[hn],Po[hn]),wn.lineTo(xo[hn+1],Po[hn+1])}if(ho&&P.over>0){Wt.moveTo(xo[1],Po[1]);for(let hn=2;hn<=Nn;hn++)Wt.lineTo(xo[hn],Po[hn])}if(uo===0&&P.shadow>0&&Xt[2]>.25&&Dn>-.2){const hn=P.shadow*h*Math.min(1,T),wn=et[Math.min(2,(Xt[2]-.25)*4|0)];for(let no=1;no<=Nn;no++){const se=no/Nn,oo=-U*hn*se,qo=-nt*hn*se+.3*hn*se;no===1&&wn.moveTo(xo[0],Po[0]),wn.lineTo(xo[no]+oo,Po[no]+qo)}}const _o=Nn>>1;if(Xt[0]>.3){const hn=tt[hs(Xt[0])];hn.moveTo(xo[_o],Po[_o]);for(let wn=_o+1;wn<=Nn;wn++)hn.lineTo(xo[wn],Po[wn])}if(Xt[1]>.1){const hn=ct[hs(Xt[1])];hn.moveTo(xo[_o],Po[_o]);for(let wn=_o+1;wn<=Nn;wn++)hn.lineTo(xo[wn],Po[wn])}}}const yt=Math.min(1,T)**P.short,mt=Math.max(.45,P.width*h*(.5+.5*yt));if(P.over>0&&(C.globalCompositeOperation="destination-out",C.lineWidth=mt,C.globalAlpha=P.over*yt,C.strokeStyle="#000",C.stroke(Wt),C.globalCompositeOperation="source-over"),P.shadow>0){C.lineWidth=mt*P.shadowW,C.strokeStyle="#000";for(let ot=0;ot<3;ot++)C.globalAlpha=.03*(ot+1)*yt,C.stroke(et[ot])}for(let ot=0;ot<Be;ot++){const ht=Vo+(ot/(Be-1)*2-1)*P.spread,At=ht<Vo?C:p;At.lineWidth=mt,At.globalAlpha=P.alpha*yt*(ht<Vo?P.deep*(1-ht/Vo):(ht-Vo)/(255-Vo)),At.strokeStyle=ht<Vo?"#000":"#fff",At.stroke(Z[ot])}for(const ot of[A,S])ot.lineWidth=mt,ot.strokeStyle="#fff";for(let ot=0;ot<bo;ot++)A.globalAlpha=.4*(ot+.5)/bo,S.globalAlpha=.8*(ot+.5)/bo,A.stroke(tt[ot]),S.stroke(ct[ot]);C.globalAlpha=p.globalAlpha=A.globalAlpha=S.globalAlpha=1})}const je=new Path2D,aa=[];for(let P=0;P<bo;P++)aa.push(new Path2D);const ge=[],oe=zt/c;let ia=0;const ra=2;for(let P=0;P<ra;P++)it.push(()=>{if(P===0){for(let X=0;X<c*c;X++)t.sd[X]>-1.6&&t.sd[X]<2.2&&ge.push(X);ia=Math.round(ge.length*oe*oe*24*(.3+1.4*_)*Math.sqrt(F)*(.5+.5*Math.min(1,o/512))*(1-.55*Ye))}const B=Math.floor(ia*(P+1)/ra);for(let X=Math.floor(ia*P/ra);X<B;X++){const R=ge[I()*ge.length|0],Z=(R%c+I())*oe-st,tt=((R/c|0)+I())*oe-st,ct=f(Z,tt);if(ct<-1.2||ct>1.8)continue;const et=ct+Bn(Z,tt);if(et<-.2||et>1.2)continue;const[Wt,kt]=xt(Z,tt),[yt,mt]=ft(Z,tt),ot=(I()-.5)*1.1,ht=Math.cos(ot),At=Math.sin(ot);let jt=Wt*ht-kt*At,Gt=Wt*At+kt*ht;const Dt=I(),wt=1+.5*O*Math.max(0,mt)-.35*O*Math.max(0,-mt);let Ct=(.3+1.5*Dt*Dt*Dt)*h*T*(.5+_)*wt;const Ft=(Z+st)*h,_t=(tt+st)*h;let Bt=(I()-.5)*1.17*D*Ct;mt<-.3&&I()<.06*(.3+_)&&(jt=yt*.8+(I()-.5)*.6,Gt=mt*.8,Ct*=1.2,Bt=(I()<.5?-1:1)*(.25+.3*O)*Ct),je.moveTo(Ft,_t);const Vt=Ft+jt*Ct*.5-Gt*Bt,Yt=_t+Gt*Ct*.5+jt*Bt,Nt=Ft+jt*Ct,nn=_t+Gt*Ct+O*Ct*.25;if(je.quadraticCurveTo(Vt,Yt,Nt,nn),cs(Z,tt,jt,Gt,.3),Xt[1]>.08){const Zt=aa[hs(Xt[1])];Zt.moveTo(Ft,_t),Zt.quadraticCurveTo(Vt,Yt,Nt,nn)}}});const la=new Path2D,ca=[new Path2D,new Path2D,new Path2D],ha=[];for(let P=0;P<bo;P++)ha.push(new Path2D);it.push(()=>{const P=ge.length*oe*oe,B=P/3.8,X=Math.round(B/(.45+.3*T)*(.3+.8*_)*Math.sqrt(F)*(1+.6*Ye));for(let R=0,Z=0;R<X&&Z<6*X;Z++){const tt=ge[I()*ge.length|0],ct=(tt%c+I())*oe-st,et=((tt/c|0)+I())*oe-st,Wt=I(),kt=I(),yt=I(),mt=I(),ot=f(ct,et);if(ot<-.5||ot>1.6)continue;const ht=ot+Bn(ct,et);if(ht<0||ht>.9||_n(ln,ct,et)<-.4+.8*mt)continue;R++;const[At,jt]=xt(ct,et),[Gt,Dt]=ft(ct,et),wt=(Wt-.5)*.8*(.5+D),Ct=Math.cos(wt),Ft=Math.sin(wt);let _t=.75*Gt+.25*At,Bt=.75*Dt+.25*jt,Vt=.55*At+.45*Gt,Yt=.55*jt+.45*Dt+.35*O;const Nt=Math.hypot(_t,Bt)||1,nn=Math.hypot(Vt,Yt)||1;[_t,Bt]=[(_t*Ct-Bt*Ft)/Nt,(_t*Ft+Bt*Ct)/Nt],[Vt,Yt]=[(Vt*Ct-Yt*Ft)/nn,(Vt*Ft+Yt*Ct)/nn];const Zt=1+.5*O*Math.max(0,Dt)-.35*O*Math.max(0,-Dt),Ut=(.5+1.1*kt*kt)*h*T*(.5+_)*Zt,Jt=(.3+.35*yt)*h*Math.min(1.5,T),Pn=(ct+st)*h,jn=(et+st)*h,Dn=Pn+_t*Ut*.5,ho=jn+Bt*Ut*.5,fo=Pn+(_t*.4+Vt*.6)*Ut,to=jn+(Bt*.4+Yt*.6)*Ut,Rn=-Bt,Tn=_t;cs(ct,et,Vt,Yt,.4);const In=Xt[1]>.08?ha[hs(Xt[1])]:null,Hn=ca[Math.min(2,Xt[2]*3|0)],Un=4+(I()*5|0);for(let uo=0;uo<Un;uo++){const $n=I()-.5,mn=.7+.3*I(),ee=(I()-.5)*.35,To=Pn+Rn*$n*Jt,yo=jn+Tn*$n*Jt,On=Dn+Rn*$n*Jt*.6,Wo=ho+Tn*$n*Jt*.6,po=To+(fo+Rn*($n*.25+ee)*Jt-To)*mn,Io=yo+(to+Tn*($n*.25+ee)*Jt-yo)*mn;la.moveTo(To,yo),la.quadraticCurveTo(On,Wo,po,Io);const zo=.25*To+.5*On+.25*po,Fo=.25*yo+.5*Wo+.25*Io;Hn.moveTo(zo,Fo),Hn.quadraticCurveTo(.5*(On+po),.5*(Wo+Io),po,Io),In&&(In.moveTo(zo,Fo),In.quadraticCurveTo(.5*(On+po),.5*(Wo+Io),po,Io))}}}),it.push(()=>{const P=Math.max(.4,.11*h);C.lineWidth=p.lineWidth=S.lineWidth=P,C.globalCompositeOperation="destination-out",C.globalAlpha=.6,C.strokeStyle="#000",p.strokeStyle="#fff";for(let B=0;B<3;B++)C.stroke(ca[B]),p.globalAlpha=.08+.11*B,p.stroke(ca[B]);C.globalCompositeOperation="source-over",S.strokeStyle="#fff";for(let B=0;B<bo;B++)S.globalAlpha=(B+.5)/bo,S.stroke(ha[B]);C.globalAlpha=p.globalAlpha=S.globalAlpha=1,p.lineWidth=C.lineWidth=Math.max(.35,.08*h),p.globalAlpha=.5*((140-Vo)/(255-Vo)),p.strokeStyle="#fff",p.stroke(je),p.globalAlpha=1,S.lineWidth=p.lineWidth,S.strokeStyle="#fff";for(let B=0;B<bo;B++)S.globalAlpha=(B+.5)/bo,S.stroke(aa[B]);S.globalAlpha=1,C.globalCompositeOperation="destination-out",C.globalAlpha=.7,C.strokeStyle="#000",C.stroke(je),C.globalAlpha=1,C.globalCompositeOperation="source-over"});const M0=new ImageData(o,o),g0=new ImageData(o,o),b0=new ImageData(o,o),fs=.5+1.2*_,vr=fs+Jn,Sr=kl*(1-.6*Ye),xr=wl*(1+1.2*Ye),Xe=Math.max(1,Math.round(Cl*T*h)),us=Xe+1,Pr=br*Math.sqrt(1+Xe*(2*Xe+1)/(3*us))/us,y0=Math.round(Eo*h);return z(o,64,(P,B)=>{const X=M0.data,R=g0.data,Z=b0.data;for(let tt=P;tt<B;tt++){const ct=(tt+.5)/h-st;for(let et=0;et<o;et++){const Wt=(et+.5)/h-st,kt=(tt*o+et)*4;X[kt]=X[kt+1]=X[kt+2]=R[kt]=R[kt+1]=R[kt+2]=255;const yt=f(Wt,ct);if(yt>=Jn+Sa){X[kt+3]=Z[kt+3]=255;continue}const mt=yt<=-vr?yt:yt+Bn(Wt,ct);if(mt>=0){X[kt+3]=255,Z[kt+3]=Math.round(255*rn(.25*Sa,Sa,mt));continue}const ot=Math.min(1,-mt/(2*fs)),ht=J(Mn,Wt,ct)*N[0]+J(en,Wt,ct)*N[1];if(R[kt+3]=Math.round(255*Al*ot*ot*(3-2*ot)*(.45+.55*rn(-.3,.6,ht))),mt<=-fs)continue;const At=1+mt/fs,jt=At*At*(3-2*At),[Gt,Dt]=Ht(Wt,ct);let wt=0;for(let Ft=-Xe;Ft<=Xe;Ft++){const _t=Math.round(et+y0+Gt*Ft),Bt=Math.round(tt+y0+Dt*Ft);wt+=(_t<0||Bt<0||_t>=i||Bt>=i?Re:Js[Bt*i+_t])*(1-Math.abs(Ft)/us)}const Ct=(wt/us-Re)/Pr;X[kt+3]=Math.round(255*Math.max(0,Math.min(1,jt*(Sr+xr*Ct))))}}}),it.push(()=>{const P=Wn(o),B=P&&Fn(P,!1);P&&B&&(B.putImageData(g0,0,0),m.haze=P),k.putImageData(M0,0,0),k.lineCap="round",k.lineWidth=Math.max(.35,.08*h),k.strokeStyle="rgba(255,255,255,0.45)",k.stroke(je),k.lineWidth=Math.max(.4,.11*h),k.strokeStyle="rgba(255,255,255,0.8)",k.stroke(la);const X=Wn(o),R=X&&Fn(X,!1);X&&R&&(R.putImageData(b0,0,0),m.core=X),m.dark=g,m.light=M,m.glint=w,m.back=v,m.backSoft=y,m.mask=b,l(m)}),{steps:it}}function El(t){if(t.cut||!t.mask)return t.cut;const n=t.mask.width,o=Wn(n),e=o&&Fn(o,!1);return o&&e&&(e.fillRect(0,0,n,n),e.globalCompositeOperation="destination-out",e.drawImage(t.mask,0,0),t.cut=o),t.cut}function $l(t,n,o,e){const{V:a,U:s,D:r}=o,l=e.vivid??0,c=[0,0,0],h=tr(s,a,e.front),d=nr(o.K,a),f=Math.max(.03,.2-.15*e.shadow),u=Math.max(.04,.24-.13*e.shadow),i=Math.min(.7,.05+.12*e.spread),m=1.3,g=.34*Math.min(1.6,e.shadow/.35),M=Qo([-.55*s[0]+.85*a[0]+.15*r[0],-.55*s[1]+.85*a[1]+.15*r[1],-.55*s[2]+.85*a[2]+.15*r[2]]),b=e.sheen??0,w=Math.min(1,Math.max(0,e.backSoft??Xs)),v=.16*e.highlight*b,y=1.15*e.rim*b,C=.2+.25*l,p=Math.max(n[0],n[1],n[2],.02),k=[n[0]/p,n[1]/p,n[2]/p],A=[k[0],k[1],k[2]],S=.45*(1-l),E=.25*(1-l),I=[S+(1-S)*k[0],S+(1-S)*k[1],S+(1-S)*k[2]],W=[E+(1-E)*k[0],E+(1-E)*k[1],E+(1-E)*k[2]],x=D=>.2126*D[0]+.7152*D[1]+.0722*D[2],$=1.8+2.2*l,T=[Math.pow(n[0],$),Math.pow(n[1],$),Math.pow(n[2],$)],F=x(n)/Math.max(1e-4,x(T)),_=[T[0]*F,T[1]*F,T[2]*F],q=[k[0]*k[0]*n[0],k[1]*k[1]*n[1],k[2]*k[2]*n[2]];for(let D=0;D<sn;D++)for(let O=0;O<sn;O++){let K=O/(sn-1)*2-1,U=D/(sn-1)*2-1,nt=K*K+U*U;if(nt>1.14)continue;if(nt>1){const vt=1/Math.sqrt(nt);K*=vt,U*=vt,nt=1}const dt=Math.sqrt(1-nt),pt=K*h[0]+U*h[1]+dt*h[2],Tt=Math.max(0,K*a[0]+U*a[1]+dt*a[2]),j=K*r[0]+U*r[1]+dt*r[2],N=K*d[0]+U*d[1]+dt*d[2],Q=1-Tt,Ot=i+(.45-i)*Q*Q;let G=Math.min(1,Math.max(0,(pt+Ot)/(1+Ot)));G=Math.pow(G,1.35);const ut=u*Math.max(0,K*M[0]+U*M[1]+dt*M[2]),ft=1-g*Math.max(0,j)*(.6+.4*Q),xt=(f+m*G+ut)*ft,it=Math.min(1,Math.max(0,1-xt)),z=Math.max(0,1-(pt+.08)*(pt+.08)/.18),L=C*z*z*ft,bt=Math.min(1,Math.max(0,(pt+.2)/.8)),H=v*Q*Q*bt,Lt=rn(-.3,.6,N),It=rn(.18-.12*w,.62+.18*w,Q),Cn=y*It*Math.sqrt(It)*(.3+.7*Lt)*(1-.7*Math.max(0,j)),qt=It*It*Math.sqrt(It)*(1-.5*w),Mn=(D*sn+O)*3;let en=0,gn=0,$t=0;for(let vt=0;vt<3;vt++){const yn=(n[vt]+(_[vt]-n[vt])*it*.9)*xt+L*q[vt]+H*W[vt]+Cn*(A[vt]+(I[vt]-A[vt])*qt);vt===0?en=yn:vt===1?gn=yn:$t=yn}const Rt=Math.max(en,gn,$t);if(Rt>.8){const vt=(.8+.2*(1-Math.exp(-(Rt-.8)/.2)))/Rt;en*=vt,gn*=vt,$t*=vt}l>0&&(c[0]=en,c[1]=gn,c[2]=$t,es(c,l,1),[en,gn,$t]=c),t[Mn]=so(en),t[Mn+1]=so(gn),t[Mn+2]=so($t)}}const Ol=.28,Wl=.42,V0=new WeakMap;function zl(t,n,o=0){const e=t.dark;if(!e)return null;let a=V0.get(t);a||V0.set(t,a=new Map);const s=Math.round(Math.min(1,o)*10)/10,r=`${n}|${s}`,l=a.get(r);if(l!==void 0)return l;const c=Wn(e.width),h=c&&Fn(c,!1);if(c&&h){const d=Ho(n),f=[so(d[0])/255,so(d[1])/255,so(d[2])/255],u=Math.max(f[0],f[1],f[2],.001),i=.2126*f[0]+.7152*f[1]+.0722*f[2],m=Math.min(f[0],f[1],f[2])/u,g=Ol+Wl*i*i*m,M=C=>Math.round(255*g*C*Math.pow(C/u,3.2+3*s)),b=M(f[0]),w=M(f[1]),v=M(f[2]),y=(.2126*b+.7152*w+.0722*v)/255/Math.max(.001,i);h.globalAlpha=Math.min(1,Math.sqrt((1-Ji)/Math.max(.05,1-y))),h.drawImage(e,0,0),h.globalAlpha=1,h.globalCompositeOperation="source-in",h.fillStyle=`rgb(${b} ${w} ${v})`,h.fillRect(0,0,e.width,e.height)}return a.size>=4&&a.clear(),a.set(r,c&&h?c:null),c&&h?c:null}const N0=.6,Z0=new WeakMap;function _l(t,n,o){const e=t.light;if(!e)return null;const a=Math.round((N0+(1-N0)*Math.min(1,Math.max(0,o)))*10)/10,s=`${n}|${a}`;let r=Z0.get(t);r||Z0.set(t,r=new Map);const l=r.get(s);if(l!==void 0)return l;const c=Wn(e.width),h=c&&Fn(c,!1);if(c&&h){h.drawImage(e,0,0),h.globalCompositeOperation="source-in";const d=Ho(n),f=[so(d[0]),so(d[1]),so(d[2])],u=Math.max(f[0],f[1],f[2],1),i=m=>Math.round(255+(255*m/u-255)*Math.min(1,a));h.fillStyle=`rgb(${i(f[0])} ${i(f[1])} ${i(f[2])})`,h.fillRect(0,0,e.width,e.height)}return r.size>=6&&r.clear(),r.set(s,c&&h?c:null),c&&h?c:null}const U0=new WeakMap;function ql(t,n,o){const e=t.glint,a=t.back;if(!e||!a)return null;const s=Math.min(1,.45*o.highlight*(o.shine??0)),r=Math.min(1,1.1*o.rim);if(s<=.01&&r<=.01)return null;const l=Math.min(1,o.vivid??0),c=Math.min(1,Math.max(0,Math.round((o.backSoft??Xs)*20)/20)),h=`${n}|${s.toFixed(2)}|${r.toFixed(2)}|${l.toFixed(1)}|${c}`;let d=U0.get(t);d||U0.set(t,d=new Map);const f=d.get(h);if(f!==void 0)return f;const u=e.width,i=Wn(u),m=i&&Fn(i,!1),g=Wn(u),M=g&&Fn(g,!1);if(i&&m&&g&&M){const b=Ho(n),w=[so(b[0]),so(b[1]),so(b[2])],v=Math.max(w[0],w[1],w[2],1),y=p=>`rgb(${[0,1,2].map(k=>Math.round(255+(255*w[k]/v-255)*p)).join(" ")})`,C=[[a,y(.65+.35*l),r*(1-.85*c)],[t.backSoft,y(.7+.3*l),r*c],[e,y(.45+.55*l),s]];for(const[p,k,A]of C)p&&(A<=.01||(M.globalCompositeOperation="copy",M.drawImage(p,0,0),M.globalCompositeOperation="source-in",M.fillStyle=k,M.fillRect(0,0,u,u),m.globalAlpha=A,m.drawImage(g,0,0)));m.globalAlpha=1}return d.size>=6&&d.clear(),d.set(h,i&&m?i:null),i&&m?i:null}const Qo=t=>{const n=Math.hypot(t[0],t[1],t[2])||1;return[t[0]/n,t[1]/n,t[2]/n]};function Ja(t){const n=Math.cos(t.roll),o=Math.sin(t.roll),e=n*t.lx+o*t.ly,a=-o*t.lx+n*t.ly,s=t.facing<0?-1:1,r=s*Math.min(1,Math.abs(t.facing)/.16),{cy:l,sy:c,cp:h,sp:d}=t,f=($,T,F,_=r)=>Qo([l*$+c*d*T-c*h*F,h*T+d*F,_*(c*$-l*d*T+l*h*F)]),u=f(L0*e,L0*a,Xr),i=f(0,0,1,s),m=Qo([u[0]+i[0],u[1]+i[1],u[2]+i[2]]),g=f(e,a,0,s),M=Math.cos(80*Math.PI/180),b=Math.sin(80*Math.PI/180),w=M*e-b*a,v=b*e+M*a,y=Qo([.55*w,.55*v,.83]),C=Qo([y[1],-y[0],0]),p=[y[1]*C[2]-y[2]*C[1],y[2]*C[0]-y[0]*C[2],y[0]*C[1]-y[1]*C[0]],k=f(y[0],y[1],y[2],s),A=f(C[0],C[1],C[2],s),S=f(p[0],p[1],p[2],s),E=f(o,n,0,s),[I,W]=t.bx!==void 0&&t.by!==void 0?[t.bx,t.by]:Ua(t.lx,t.ly),x=f(n*I+o*W,-o*I+n*W,0,s);return{L:u,V:i,H:m,U:g,W:k,A,B:S,D:E,K:x}}const Q0=new WeakMap;function Dl(t,n){const o=t.canvas??t;let e=Q0.get(o);e||(e=new Map,Q0.set(o,e));let a=e.get(n);return a||(a={N:0,img:null,mc:new Float32Array(Es*3),mcPrev:new Float32Array(Es*3),mcMix:new Float32Array(Es*3),mixVersion:0,blendT:1,blendFrames:1,sinceBuild:0,L:null,V:null,lx:NaN,ly:NaN,base:"",shadow:NaN,highlight:NaN,spread:NaN,rim:NaN,vivid:NaN,front:NaN,sheen:NaN,backSoft:NaN,K:null,version:0,imgVersion:-1,imgAoK:NaN,imgForm:null,aoK:-1,aoMul:new Float32Array(256),scratch:[null,null],scratchIdx:0,scratchN:0,scratchStale:!0,sprites:[null,null,null,null,null],sliceG:[],sliceIns:[],sliceSpr:new Map,sliceSprKey:"",sliceSprMade:new Set,sliceKey:"",body:[null,null],bodyIdx:0,spriteVersion:-1,spritePx:0,spriteFur:null,miss:[0,0],missAt:[0,0],turnAt:[0,0],fade:null,lay:1,layTmp:null,haloTmp:null},e.size>4&&e.clear(),e.set(n,a)),a}const xa=1/48,Pa=(t,n)=>!n||Math.abs(t[0]-n[0])>=xa||Math.abs(t[1]-n[1])>=xa||Math.abs(t[2]-n[2])>=xa;function Ce(t,n){return[t[0]*n[0]+t[2]*n[1],t[1]*n[0]+t[3]*n[1],t[0]*n[2]+t[2]*n[3],t[1]*n[2]+t[3]*n[3],t[0]*n[4]+t[2]*n[5]+t[4],t[1]*n[4]+t[3]*n[5]+t[5]]}function J0(t,n,o){const{N:e,sd:a}=n,s=t.data,r=h=>(h+st)/zt*e-.5,l=[],c=[];for(let h=0;h<$o;h++){const d=h/$o*Math.PI*2,f=Math.cos(d),u=Math.sin(d),i=[],m=[];for(let g=0;g<80;g+=.5){const M=o[0]+f*g,b=o[1]+u*g,w=fe(a,e,r(M),r(b));if(w<0)break;const v=Math.round(r(M)),y=Math.round(r(b));if(v<0||y<0||v>=e||y>=e)break;const C=(y*e+v)*4;i.push(w),m.push(s[C],s[C+1],s[C+2])}l.push(Float32Array.from(i)),c.push(Float32Array.from(m))}return{d:l,c}}function ti(t,n,o,e,a,s,r){const l=d=>{const f=n.d[d],u=n.c[d],i=typeof o=="number"?o:o[d],m=1-(typeof e=="number"?e:e[d]);let g=0;for(let M=0;M<f.length;M++)f[M]>=i&&(g=M);return u.length?`rgb(${u[g*3]*m|0} ${u[g*3+1]*m|0} ${u[g*3+2]*m|0})`:"rgb(0 0 0)"};if(!r&&typeof t.createConicGradient=="function"){const d=t.createConicGradient(0,a[0],a[1]);for(let f=0;f<=$o;f++)d.addColorStop(f/$o,l(f%$o));return d}const c=t.createLinearGradient(a[0]+s[0]*50,a[1]+s[1]*50,a[0]-s[0]*50,a[1]-s[1]*50),h=d=>Math.round((d%(Math.PI*2)+Math.PI*2)%(Math.PI*2)/(Math.PI*2/$o))%$o;return c.addColorStop(0,l(h(Math.atan2(s[1],s[0])))),c.addColorStop(.5,l(h(Math.atan2(s[0],-s[1])))),c.addColorStop(1,l(h(Math.atan2(-s[1],-s[0])))),c}function Rl(t,n,o,e=0){const a=/rgb\((\d+) (\d+) (\d+)\)/.exec(Hl(t)),s=a?[+a[1],+a[2],+a[3]]:[255,255,255],r=Ho(n),l=[so(r[0]),so(r[1]),so(r[2])],c=Math.max(l[0],l[1],l[2],1),h=Math.min(.85,.75*o),d=.45+.55*Math.min(1,e),f=u=>Math.round(s[u]+(255+(255*l[u]/c-255)*d-s[u])*h);return`rgb(${f(0)} ${f(1)} ${f(2)})`}function Hl(t){let n=-1,o=0,e=0,a=0;for(const r of t.c)for(let l=0;l<r.length;l+=3){const c=.2126*r[l]+.7152*r[l+1]+.0722*r[l+2];c>n&&(n=c,o=r[l],e=r[l+1],a=r[l+2])}const s=r=>Math.min(255,Math.round(r/4)*4);return`rgb(${s(o)} ${s(e)} ${s(a)})`}function _a(t,n,o,e,a,s,r,l,c){const h=s*t.cx[0]+r*t.cy[0],d=(s*o+r*e)*a;let f=l,u=0,i=!1;for(let m=1;m<n;m++){const g=s*t.cx[m]+r*t.cy[m]+t.scale[m]*(l-h);g+t.z[m]*d>f&&(f=g+t.z[m]*d,u=m,i=!1),g-t.z[m]*d>f&&(f=g-t.z[m]*d,u=m,i=!0)}return c&&(c.k=u,c.far=i),f}function Bl(t,n,o,e,a,s){if(s<=1e-4)return[1,0,0,1,0,0];const r=Us(t),l=js(r,e,a),c=js(r,-e,-a),h=_a(n,o,e,a,s,e,a,l),d=_a(n,o,e,a,s,-e,-a,c),f=(h+d)/Math.max(1,l+c)-1,u=h-(f+1)*l;return[1+f*e*e,f*e*a,f*e*a,1+f*a*a,e*u,a*u]}function Yl(t,n,o,e,a,s,r,l){const c=Us(t),h=new Float32Array($o),d=new Float32Array($o),f=r[0]+r[3]-2,u={k:0,far:!1};for(let i=0;i<$o;i++){const m=i/$o*Math.PI*2,g=Math.cos(m),M=Math.sin(m),b=g*e+M*a,w=f/(1+f);let v=g-w*b*e,y=M-w*b*a;const C=Math.hypot(v,y);v/=C,y/=C,_a(n,o,e,a,s,v,y,js(c,v,y),u),h[i]=Math.max(za,n.inset[u.k]),d[i]=u.far?vl*l*(1-Math.exp(-2.4*(u.k/o))):0}return{inset:h,dark:d}}const ni=new WeakMap,eo=96,Oe=.1;function jl(t,n,o,e,a,s,r,l){const c=`${e}|${o.q}|${Math.round(s/Oe)}|${Math.round(r/Oe)}`;let h=ni.get(t);h||ni.set(t,h=new Map);const d=h.get(c);if(d||d===null&&!l)return d??null;if(h.size>256&&h.clear(),!l)return h.set(c,null),Ka(()=>{h.set(c,oi(t,n,o,e,a,s,r))}),null;const f=oi(t,n,o,e,a,s,r);return h.set(c,f),f}function oi(t,n,o,e,a,s,r){const l=Wn(eo),c=l&&Fn(l,!0);if(!c)return[0,0];const h=zt/eo,d=a[0]*a[3]-a[1]*a[2],f=a[3]/d,u=-a[1]/d,i=-a[2]/d,m=a[0]/d,g=-(f*a[4]+i*a[5]),M=-(u*a[4]+m*a[5]);c.fillStyle="#fff";for(let p=0;p<e;p++)for(const k of p?[o.z[p],-o.z[p]]:[0]){c.setTransform(1/h,0,0,1/h,st/h,st/h),c.transform(f,u,i,m,g,M),c.translate(k*s,k*r);const A=o.scale[p];p&&c.transform(A,0,0,A,o.cx[p]-A*o.cx[0],o.cy[p]-A*o.cy[0]),c.fill(n)}const b=c.getImageData(0,0,eo,eo).data,w=new Uint8Array(eo*eo),v=new Float32Array(eo*eo);for(let p=0;p<eo*eo;p++)w[p]=b[p*4+3]>127?1:0;Oa(w,1,eo,v,null);let y=0,C=0;for(let p=0,k=0;p<eo;p++)for(let A=0;A<eo;A++,k++){const S=fe(t.sd,t.N,(A+.5)/eo*t.N-.5,(p+.5)/eo*t.N-.5);w[k]&&S<0&&(y=Math.max(y,-S)),!w[k]&&S>0&&(C=Math.max(C,Math.sqrt(v[k])*h))}return[y,C]}const Ta=typeof navigator<"u"&&/AppleWebKit\//.test(navigator.userAgent)&&!/Chrome\/|Chromium\/|Edg\//.test(navigator.userAgent),Xl=typeof navigator<"u"&&/Firefox\//.test(navigator.userAgent);function Gl(t,n,o,e,a,s){const r=Ns(o.dev),l=ji(n.typeKey??ma(n.path),n.path,r,o.halfDepth,!!o.still);if(!l)return!1;const c=n.shading==="fabric",h=n.shading==="metal"||n.shading==="glass"||n.shading==="neon",d=Math.ceil(zt*o.dev/100),f=(()=>{const[Y,lt]=o.bx!==void 0&&o.by!==void 0?[o.bx,o.by]:Ua(o.lx,o.ly);return{bx:Y,by:lt,front:s.front??Ue}})(),u=c?Qa(l,n.typeKey??ma(n.path),o.halfDepth,d,!!o.still&&!n.furOnIdle,o.lx,o.ly,n.fur??ue,f):null;if(c&&!u)return!1;const i=Dl(t,(n.typeKey??ma(n.path))+(c?"|fabric":h?`|${n.shading}`:"")),m=Ja(o),g=(()=>{const Y=Math.hypot(m.L[0],m.L[1]);return Y<.05?[0,-1]:[m.L[0]/Y,m.L[1]/Y]})();if((Pa(m.L,i.L)||Pa(m.V,i.V)||o.lx!==i.lx||o.ly!==i.ly||e.base!==i.base||s.shadow!==i.shadow||s.highlight!==i.highlight||s.spread!==i.spread||s.rim!==i.rim||(s.vivid??0)!==i.vivid||(s.front??Ue)!==i.front||(s.sheen??0)!==i.sheen||(s.backSoft??Xs)!==i.backSoft||c&&Pa(m.K,i.K))&&(i.version>0&&i.mcPrev.set(i.mcMix),c?$l(i.mc,Ho(e.base),m,s):n.shading==="metal"?Vl(i.mc,Ho(e.base),m,s):n.shading==="glass"?Nl(i.mc,Ho(e.base),m,s):n.shading==="neon"?Zl(i.mc,Ho(e.base),m,s):Na(i.mc,Ho(e.base),m,s),i.version===0||o.still?(i.mcMix.set(i.mc),i.blendT=1):(i.blendFrames=Math.min(10,Math.max(1,i.sinceBuild)),i.blendT=0),i.sinceBuild=0,i.mixVersion++,i.L=m.L,i.V=m.V,i.lx=o.lx,i.ly=o.ly,i.base=e.base,i.shadow=s.shadow,i.highlight=s.highlight,i.spread=s.spread,i.rim=s.rim,i.vivid=s.vivid??0,i.front=s.front??Ue,i.sheen=s.sheen??0,i.backSoft=s.backSoft??Xs,i.K=m.K,i.version++),i.sinceBuild++,i.blendT<1){i.blendT=Math.min(1,i.blendT+1/i.blendFrames);const Y=i.blendT>=1?1:i.blendT*i.blendT*(3-2*i.blendT),lt=i.mcPrev,at=i.mc,gt=i.mcMix;for(let St=0;St<Es*3;St++)gt[St]=lt[St]+(at[St]-lt[St])*Y;i.mixVersion++}const M=u?Math.min(1.2,.3+.8*s.shadow):h?Math.min(.8,.9*s.shadow):Math.min(1.3,1.2*s.shadow);if(M!==i.aoK){for(let Y=0;Y<256;Y++)i.aoMul[Y]=Math.max(0,1-M*(1-Y/255));i.aoK=M}if((!i.img||i.N!==r)&&(i.img=new ImageData(r,r),i.N=r,i.imgVersion=-1),(i.imgVersion!==i.mixVersion||i.imgAoK!==M||i.imgForm!==l)&&(Za(l,i.mcMix,i.img.data,i.aoMul,u||h?nl(l):void 0),i.imgVersion=i.mixVersion,i.imgAoK=M,i.imgForm=l,i.scratchStale=!0),i.scratchN!==r&&(i.scratch=[null,null],i.scratchN=r,i.scratchStale=!0),i.scratchStale){i.scratchIdx^=1;let Y=i.scratch[i.scratchIdx];if(!Y){const lt=Wn(r),at=lt&&Fn(lt,!1);if(!lt||!at)return!1;Y=i.scratch[i.scratchIdx]={c:lt,g:at}}Y.g.putImageData(i.img,0,0),i.scratchStale=!1}const w=i.scratch[i.scratchIdx].c,v=o.dev<=100?14:o.dev<=224?20:26,y=Jr(l,v,o.round??1),{cy:C,sy:p,cp:k,sp:A}=o,[S,E,I,W,x,$]=o.ctm,T=p*A,F=S*C+I*T,_=E*C+W*T,q=I*k,D=W*k;t.imageSmoothingEnabled=!0,t.imageSmoothingQuality="high";const O=o.facing>=0?1:-1,K=p/C,U=-A/(C*k),nt=Math.hypot(K,U);let dt=50;for(let Y=1;Y<v;Y++)dt=Math.max(dt,50*y.scale[Y]+y.z[Y]*nt);const pt=nt>1e-6?O*K/nt:1,Tt=nt>1e-6?O*U/nt:0,j=Math.min(.7,.55*Math.min(1.6,s.shadow/.35)),N=u?Bl(l,y,v,pt,Tt,nt):null,Q=Math.ceil(zt*o.dev/100);if(i.spritePx!==Q&&(i.sprites=[null,null,null,null,null],i.spritePx=Q,i.spriteVersion=-1),i.spriteVersion!==i.version||i.spriteFur!==u){const Y=Q/zt,lt=u?ol(l,u.R):null,at=J0(i.img,l,[y.cx[0],y.cy[0]]);for(let gt=0;gt<4;gt++){if(gt===2)continue;let St=i.sprites[gt];if(!St){const un=Wn(Q),En=un&&Fn(un,!1);if(!un||!En)return!1;St=i.sprites[gt]={c:un,g:En}}const Pt=St.g;Pt.setTransform(1,0,0,1,0,0),Pt.globalCompositeOperation="source-over",Pt.clearRect(0,0,Q,Q),Pt.imageSmoothingEnabled=!0,Pt.imageSmoothingQuality="high";const an=gt===0&&u&&u.mask?u:null;an&&an.haze&&(Pt.imageSmoothingQuality="low",Pt.drawImage(an.haze,0,0,Q,Q),Pt.imageSmoothingQuality="high",Pt.globalCompositeOperation="source-in",Pt.fillStyle=Rl(at,e.base,s.rim,s.vivid??0),Pt.fillRect(0,0,Q,Q),Pt.globalCompositeOperation="destination-over"),Pt.setTransform(Y,0,0,Y,st*Y,st*Y);const rt=an&&N?Yl(l,y,v,pt,Tt,nt,N,j):null;Pt.fillStyle=gt===1?"#000":ti(Pt,at,rt?rt.inset:u?Math.max(za,y.inset[0]):y.inset[0],rt?rt.dark:0,[y.cx[0],y.cy[0]],g,Ta),u&&u.mask?(Pt.fillRect(-st,-st,zt,zt),Pt.setTransform(1,0,0,1,0,0),Pt.globalCompositeOperation="destination-in",Pt.drawImage((gt===0?u.mask:lt)??u.mask,0,0,Q,Q),Pt.globalCompositeOperation="source-over"):Pt.fill(n.path)}if(u&&u.core){let gt=i.sprites[4];if(!gt){const St=Wn(Q),Pt=St&&Fn(St,!1);St&&Pt&&(gt=i.sprites[4]={c:St,g:Pt})}gt&&(gt.g.setTransform(1,0,0,1,0,0),gt.g.globalCompositeOperation="copy",gt.g.drawImage(i.sprites[0].c,0,0),gt.g.globalCompositeOperation="destination-out",gt.g.drawImage(u.core,0,0,Q,Q),gt.g.globalCompositeOperation="source-over")}i.spriteVersion=i.version,i.spriteFur=u}const Ot=(dt+50)/100,G=(dt-50)/2,ut=1+(Ot-1)*pt*pt,ft=(Ot-1)*pt*Tt,xt=1+(Ot-1)*Tt*Tt,it=Ce(Ce(o.ctm,[C,T,0,k,0,0]),[ut,ft,ft,xt,G*pt-50*ut-50*ft,G*Tt-50*ft-50*xt]),z=u?.dark&&u.light?u:null;let L=t,bt=0,H=0,Lt=0,It=0;if(z){let Y=1/0,lt=1/0,at=-1/0,gt=-1/0;for(const Pt of[-y.top,y.top]){const an=Pt*p-50*C,rt=-Pt*C*A-50*T-50*k,un=S*an+I*rt+x,En=E*an+W*rt+$;for(const cn of[-st,100+st])for(const qn of[-st,100+st]){const Yn=F*cn+q*qn+un,dn=_*cn+D*qn+En;Yn<Y&&(Y=Yn),Yn>at&&(at=Yn),dn<lt&&(lt=dn),dn>gt&&(gt=dn)}}bt=Math.floor(Y)-1,H=Math.floor(lt)-1,Lt=Math.ceil(at)+1-bt,It=Math.ceil(gt)+1-H,i.bodyIdx^=1;let St=i.body[i.bodyIdx];if(!St||St.w<Lt||St.h<It||St.w>2*Lt+64||St.h>2*It+64){const Pt=Math.ceil(Lt/64)*64,an=Math.ceil(It/64)*64;let rt=null;typeof document<"u"?(rt=document.createElement("canvas"),rt.width=Pt,rt.height=an):typeof OffscreenCanvas<"u"&&(rt=new OffscreenCanvas(Pt,an));const un=rt&&Fn(rt,!1);St=rt&&un?i.body[i.bodyIdx]={c:rt,g:un,w:rt.width,h:rt.height}:null}St?(L=St.g,L.setTransform(1,0,0,1,0,0),L.globalCompositeOperation="source-over",L.globalAlpha=1,L.clearRect(0,0,Lt,It),L.imageSmoothingEnabled=!0,L.imageSmoothingQuality="high"):bt=H=0}const Cn=Y=>{const lt=Y*p-50*C,at=-Y*C*A-50*T-50*k;L.setTransform(F,_,q,D,S*lt+I*at+x-bt,E*lt+W*at+$-H)},[qt,Mn,,en]=i.sprites,gn=[y.cx[0],y.cy[0]],$t=`${i.version}|${v}|${y.q}`;if(i.sliceKey!==$t){const Y=J0(i.img,l,gn);i.sliceG=[],i.sliceIns=[];for(let lt=0;lt<v;lt++){const at=u?Math.max(za,y.inset[lt]):y.inset[lt];i.sliceIns.push(at),i.sliceG.push(ti(t,Y,at,0,gn,g,Ta))}i.sliceKey=$t}const Rt=Xl&&typeof document<"u",vt=`${$t}|${Q}`;Rt&&i.sliceSprKey!==vt&&(i.sliceSprKey=vt,i.sliceSprMade=new Set,i.sliceSpr.size>32&&i.sliceSpr.clear());const on=Y=>{const lt=i.sliceIns[Y];let at=i.sliceSpr.get(lt);if(at&&i.sliceSprMade.has(lt))return at;if(!at||at.c.width!==Q){const St=document.createElement("canvas");St.width=St.height=Q;const Pt=St.getContext("2d");if(!Pt)return;at={c:St,g:Pt},i.sliceSpr.set(lt,at)}const gt=Q/zt;return at.g.setTransform(1,0,0,1,0,0),at.g.clearRect(0,0,Q,Q),at.g.setTransform(gt,0,0,gt,st*gt,st*gt),at.g.fillStyle=i.sliceG[Y],at.g.fill(n.path),i.sliceSprMade.add(lt),at},yn=(Y,lt,at)=>{Cn(lt);const gt=y.scale[Y];if(Y>0){L.transform(gt,0,0,gt,y.cx[Y]-gt*y.cx[0],y.cy[Y]-gt*y.cy[0]);const St=Rt?on(Y):void 0;St?L.drawImage(St.c,-st,-st,zt,zt):(L.fillStyle=i.sliceG[Y],L.fill(n.path)),at>.01&&(L.globalAlpha=at,L.fillStyle="#000",L.fill(n.path),L.globalAlpha=1);return}u?L.drawImage(en.c,-st,-st,zt,zt):(L.fillStyle=i.sliceG[0],L.fill(n.path)),u&&L===t&&Mo>.01&&(L.globalAlpha=Mo,L.drawImage(qt.c,-st,-st,zt,zt),L.globalAlpha=1),at>.01&&(L.globalAlpha=at,L.drawImage(Mn.c,-st,-st,zt,zt),L.globalAlpha=1)},io=Math.abs(o.facing),Mo=io>=.8?1:io<=.45?0:(io-.45)/.35,J=el(l),Mt=J.x.length,Ht=l.sd,Kt=l.N,vn=1.5/(Math.sqrt(Math.abs(F*D-_*q))||1)+.4,ln=zt/Kt,Sn=Y=>(Y+st)/zt*Kt-.5,_n=Math.atan2(-O*U,-O*K),ro=Math.atan2(O*U,O*K);for(let Y=v-1;Y>=1;Y--){const lt=-O*y.z[Y],at=y.scale[Y];if(u){const gt=y.cx[Y]-at*y.cx[0]+lt*K,St=y.cy[Y]-at*y.cy[0]+lt*U;let Pt=Number.isFinite(gt)&&Number.isFinite(St);for(let an=0;Pt&&an<Mt;an++){const rt=D0(Mt,_n,an);fe(Ht,Kt,Sn(at*J.x[rt]+gt),Sn(at*J.y[rt]+St))<vn+at*(J.d[rt]+ln)&&(Pt=!1)}if(Pt)continue}yn(Y,lt,u?0:j*(1-Math.exp(-2.4*(Y/v))))}if(u&&nt>.001){const Y=js(Us(l),-pt,-Tt),lt=1.3*y.top*nt;Cn(0);const at=L.createLinearGradient(-pt*Y,-Tt*Y,-pt*(Y+lt),-Tt*(Y+lt));for(let gt=0;gt<=8;gt++){const St=gt/8;at.addColorStop(St,`rgba(0,0,0,${(j*(1-Math.exp(-2.4*St))*St*St*(3-2*St)).toFixed(3)})`)}L.globalCompositeOperation="source-atop",L.fillStyle=at,L.fillRect(-st-60,-st-60,zt+120,zt+120),L.globalCompositeOperation="source-over"}yn(0,0,0);const Ln=Math.abs(o.facing),Jn=Ln>=.72?1:Ln<=.34?0:((Ln-.34)/.38)**1.5,Bn=it[0]*it[3]-it[1]*it[2],ne=Vi+1.5/(Math.sqrt(Math.abs(Bn))||1);for(let Y=1;Y<v;Y++){const lt=O*y.z[Y],at=y.scale[Y];if(Jn>=1&&Math.abs(Bn)>1e-9){const gt=lt*p-50*C,St=-lt*C*A-50*T-50*k,Pt=S*gt+I*St+x-it[4],an=E*gt+W*St+$-it[5],rt=y.cx[Y]-at*y.cx[0],un=y.cy[Y]-at*y.cy[0];let En=!0;for(let cn=0;En&&cn<Mt;cn++){const qn=D0(Mt,ro,cn),Yn=at*J.x[qn]+rt,dn=at*J.y[qn]+un,xn=F*Yn+q*dn+Pt,Vn=_*Yn+D*dn+an,So=(it[3]*xn-it[2]*Vn)/Bn,Qt=(it[0]*Vn-it[1]*xn)/Bn;fe(Ht,Kt,Sn(So),Sn(Qt))<ne+at*(J.d[qn]+ln)&&(En=!1)}if(En)continue}yn(Y,lt,0)}if(Jn>.01&&(L.save(),L.setTransform(it[0],it[1],it[2],it[3],it[4]-bt,it[5]-H),L.globalAlpha=Jn,L.drawImage(w,-st,-st,zt,zt),L.restore()),u&&u.mask&&N&&L!==t){const Y=O*K,lt=O*U,at=Math.abs(Y-i.missAt[0])>1.5*Oe||Math.abs(lt-i.missAt[1])>1.5*Oe,gt=nt>1e-4?jl(l,n.path,y,v,N,Y,lt,!!o.still||at):[0,0];gt&&(i.miss=gt,i.missAt=[Y,lt]);const[St,Pt]=i.miss,an=Math.max(St,Pt);let rt=rn(Ve/2,2*Ve,an),un=rn(Ve/2,Ve,Pt);const En=Math.abs(Y-i.turnAt[0])>Oe||Math.abs(lt-i.turnAt[1])>Oe;i.turnAt=[Y,lt];const cn=!o.still&&!En;if(cn&&i.fade){const Qt=(kn,pn)=>Math.abs(pn-kn)<.02?pn:kn+(pn-kn)*.2;rt=Qt(i.fade[0],rt),un=Qt(i.fade[1],un)}i.fade=[rt,un];const qn=i.sprites[4];L.imageSmoothingQuality="low",Cn(0),L.transform(N[0],N[1],N[2],N[3],N[4],N[5]);const Yn=(1-rn(0,xl,rt))*(1-un),dn=i.lay=cn?i.lay+Math.max(-K0,Math.min(K0,Yn-i.lay)):Yn;let xn=null;if(dn>0&&dn<1){let Qt=i.layTmp;if(!Qt||Qt.c.width<Lt||Qt.c.height<It){const kn=Math.ceil(Math.max(Lt,It)/64)*64;let pn=null;typeof document<"u"?(pn=document.createElement("canvas"),pn.width=pn.height=kn):pn=Wn(kn);const Zn=pn&&Fn(pn,!1);Qt=i.layTmp=pn&&Zn?{c:pn,g:Zn}:null}Qt&&(xn=Qt.g,xn.setTransform(1,0,0,1,0,0),xn.globalAlpha=1,xn.globalCompositeOperation="copy",xn.drawImage(L.canvas,0,0,Lt,It,0,0,Lt,It),xn.imageSmoothingQuality="low",xn.setTransform(L.getTransform()))}const Vn=Sl*Math.min(1,nt/.2),So=Qt=>{if(Ta){let kn=i.haloTmp;if(!kn||kn.c.width<Lt||kn.c.height<It){const pn=Math.ceil(Math.max(Lt,It)/64)*64;let Zn=null;typeof document<"u"?(Zn=document.createElement("canvas"),Zn.width=Zn.height=pn):Zn=Wn(pn);const De=Zn&&Fn(Zn,!1);kn=i.haloTmp=Zn&&De?{c:Zn,g:De}:null}if(kn){const pn=kn.g;pn.setTransform(1,0,0,1,0,0),pn.globalCompositeOperation="source-over",pn.globalAlpha=1,pn.clearRect(0,0,Lt,It),pn.imageSmoothingEnabled=!0,pn.imageSmoothingQuality="low",pn.setTransform(Qt.getTransform()),pn.drawImage(qt.c,-st,-st,zt,zt),Qt.save(),Qt.setTransform(1,0,0,1,0,0),Qt.globalCompositeOperation="destination-atop",Qt.drawImage(kn.c,0,0,Lt,It,0,0,Lt,It),Qt.restore()}}else Qt.globalCompositeOperation="destination-atop",Qt.drawImage(qt.c,-st,-st,zt,zt);qn&&Vn>.01&&(Qt.globalCompositeOperation="source-atop",Qt.globalAlpha=Vn,Qt.drawImage(qn.c,-st,-st,zt,zt),Qt.globalAlpha=1),Qt.globalCompositeOperation="source-over"};if(xn&&So(xn),dn>=1||!xn&&dn>=.5)So(L);else{const Qt=rt<1?El(u):null;if(Qt){const kn=1+rt*(an+Ve)/25,pn=y.cx[0],Zn=y.cy[0];L.save(),L.transform(kn,0,0,kn,pn*(1-kn),Zn*(1-kn)),L.globalCompositeOperation="destination-out",L.drawImage(Qt,-st,-st,zt,zt),L.restore()}un<1&&(L.globalAlpha=1-un,L.globalCompositeOperation="destination-over",L.drawImage(qt.c,-st,-st,zt,zt),L.globalAlpha=1),xn&&(L.setTransform(1,0,0,1,0,0),L.globalCompositeOperation="destination-in",L.globalAlpha=1-dn,L.fillStyle="#000",L.fillRect(0,0,Lt,It),L.globalCompositeOperation="lighter",L.globalAlpha=dn,L.drawImage(xn.canvas,0,0,Lt,It,0,0,Lt,It),L.globalAlpha=1)}L.globalCompositeOperation="source-over"}if(L!==t&&z){L.globalCompositeOperation="source-atop",L.imageSmoothingQuality="low";const Y=Ho(e.base),lt=Math.pow(.2126*Y[0]+.7152*Y[1]+.0722*Y[2],1/2.2),at=zl(z,e.base,s.vivid??0)??z.dark,gt=_l(z,e.base,s.vivid??0)??z.light,St=o.dev<160?0:Ln>=.88?1:Ln<=.55?0:(Ln-.55)/.33,Pt=St>.01?ql(z,e.base,s):null,an=O*pl*(n.fur??ue).length,rt=Ce(Ce(Ce(o.ctm,[1,0,0,1,an*p,-an*C*A]),[C,T,0,k,0,0]),[ut,ft,ft,xt,G*pt-50*ut-50*ft,G*Tt-50*ft-50*xt]),un=(cn,qn,Yn,dn=cn)=>{L.setTransform(cn[0],cn[1],cn[2],cn[3],cn[4]-bt,cn[5]-H),L.globalAlpha=qn,L.drawImage(at,-st-Eo,-st-Eo,Gn,Gn),dn!==cn&&L.setTransform(dn[0],dn[1],dn[2],dn[3],dn[4]-bt,dn[5]-H),L.globalAlpha=qn*(.25+.75*lt),L.drawImage(gt,-st-Eo,-st-Eo,Gn,Gn),Yn&&Pt&&(L.globalAlpha=qn*St,L.drawImage(Pt,-st-Eo,-st-Eo,Gn,Gn)),L.globalAlpha=1},En=Ln>=.62?0:Ln<=.36?1:(.62-Ln)/.26;if(En<1&&un(it,1-En,!0,rt),En>0){const cn=o.dev/100,qn=bt+Lt/2,Yn=H+It/2;un([cn,0,0,cn,qn-50*cn,Yn-50*cn],En,!1)}L.globalCompositeOperation="source-over",t.save(),t.setTransform(1,0,0,1,0,0),t.imageSmoothingEnabled=!1,t.drawImage(L.canvas,0,0,Lt,It,bt,H,Lt,It),t.restore()}t.setTransform(S,E,I,W,x,$);const go=Ln>=.95?1:Ln<=.8?0:(Ln-.8)/.15;if(!u&&o.dev>=256&&s.rim>0&&s.highlight>0&&go>.01){t.save(),t.globalCompositeOperation="source-atop",t.setTransform(it[0],it[1],it[2],it[3],it[4],it[5]);const Y=go*Math.min(.5,.3*s.rim*Math.min(1.4,s.highlight)),lt=t.createLinearGradient(50+g[0]*50,50+g[1]*50,50-g[0]*50,50-g[1]*50);lt.addColorStop(0,`rgba(235,244,255,${Y.toFixed(3)})`),lt.addColorStop(.45,`rgba(235,244,255,${(.35*Y).toFixed(3)})`),lt.addColorStop(.75,"rgba(235,244,255,0)"),t.strokeStyle=lt,t.lineJoin="round",t.lineWidth=1.3,t.stroke(n.path),t.restore()}return!0}const Kl=(t,n,o)=>{const e=Math.hypot(t,n,o)||1;return[t/e,n/e,o/e]};function Vl(t,n,o,e){const{V:a,W:s,A:r,B:l,D:c,K:h}=o,d=Math.max(n[0],n[1],n[2],.05),f=[.3+.7*(n[0]/d),.3+.7*(n[1]/d),.3+.7*(n[2]/d)],u=.62+.3*e.highlight,i=.1+.07*Math.min(2,e.spread),m=e.vivid??0,g=[0,0,0];for(let M=0;M<sn;M++)for(let b=0;b<sn;b++){let w=b/(sn-1)*2-1,v=M/(sn-1)*2-1,y=w*w+v*v;if(y>1.14)continue;if(y>1){const K=1/Math.sqrt(y);w*=K,v*=K,y=1}const C=Math.sqrt(1-y),p=Math.max(.02,w*a[0]+v*a[1]+C*a[2]);let k=2*p*w-a[0],A=2*p*v-a[1],S=2*p*C-a[2];const E=Math.sin(k*3.1+S*2.3+.7)*i,I=Math.sin(A*2.7-S*1.9+2.1)*i,W=Math.sin(k*2.2+A*2.9)*i*.5;[k,A,S]=Kl(k+E,A+I,S+W);const x=-(k*c[0]+A*c[1]+S*c[2]);let $=x>=0?.52+.62*Math.pow(x,.85):.07+.22*Math.min(1,-x*1.15);const T=(x-.02)/.1;$*=1-.82*Math.exp(-T*T);const F=k*s[0]+A*s[1]+S*s[2];if(F>.4){const K=(k*r[0]+A*r[1]+S*r[2])/F,U=(k*l[0]+A*l[1]+S*l[2])/F;$+=2.6*qe(.4,.1,Math.abs(K))*qe(.2,.08,Math.abs(U))}const _=k*h[0]+A*h[1]+S*h[2];$+=1.5*rn(.84,.93,_)*(1-rn(.97,1,_)),$*=u;const q=1-p,D=q*q*q*q*q;g[0]=(f[0]+(1-f[0])*D)*$+.015*n[0],g[1]=(f[1]+(1-f[1])*D)*$+.015*n[1],g[2]=(f[2]+(1-f[2])*D)*$+.015*n[2],es(g,m*.5);const O=(M*sn+b)*3;t[O]=Ao(g[0]),t[O+1]=Ao(g[1]),t[O+2]=Ao(g[2])}}function Nl(t,n,o,e){const{L:a,V:s,H:r,U:l,W:c,A:h,B:d}=o,f=Math.max(n[0],n[1],n[2],.05),u=[n[0]/f,n[1]/f,n[2]/f],i=e.vivid??0,m=[0,0,0],g=Math.min(90,Math.round(140/Math.pow(e.spread,1.2))),M=Je(g);for(let b=0;b<sn;b++)for(let w=0;w<sn;w++){let v=w/(sn-1)*2-1,y=b/(sn-1)*2-1,C=v*v+y*y;if(C>1.14)continue;if(C>1){const j=1/Math.sqrt(C);v*=j,y*=j,C=1}const p=Math.sqrt(1-C),k=v*a[0]+y*a[1]+p*a[2],A=Math.max(0,v*s[0]+y*s[1]+p*s[2]),S=Math.max(0,v*r[0]+y*r[1]+p*r[2]),E=1-A,I=E*E*E,W=I*E*E,x=rn(-.6,.9,k);let $=(.13+.26*x)*(.55+.9*E);const T=Math.exp(-Math.pow((E-.62)/.16,2));$*=1-.42*T;const F=-(v*l[0]+y*l[1]+p*l[2]),_=rn(.15,.85,F)*(1-rn(.55,.98,E))*(.45+.55*A),q=.1+1.15*I,D=1.1*M[S*ve|0],O=2*A*v-s[0],K=2*A*y-s[1],U=2*A*p-s[2],nt=O*c[0]+K*c[1]+U*c[2];let dt=0;if(nt>.5){const j=(O*h[0]+K*h[1]+U*h[2])/nt,N=(O*d[0]+K*d[1]+U*d[2])/nt;dt=qe(.3,.08,Math.abs(j))*qe(.11,.05,Math.abs(N))}m[0]=n[0]*$+u[0]*(.95*_+.4*q*(.4+.6*x)),m[1]=n[1]*$+u[1]*(.95*_+.4*q*(.4+.6*x)),m[2]=n[2]*$+u[2]*(.95*_+.4*q*(.4+.6*x)),es(m,i);const pt=D+.55*dt*e.highlight+.55*W,Tt=(b*sn+w)*3;t[Tt]=Ao(m[0]+pt*.96),t[Tt+1]=Ao(m[1]+pt),t[Tt+2]=Ao(m[2]+pt*1.02)}}function Zl(t,n,o,e){const{L:a,V:s,K:r}=o,l=Math.max(n[0],n[1],n[2],.05),c=Math.min(n[0],n[1],n[2]),h=1-rn(.08,.3,(l-c)/l),d=[n[0]/l*(1-h)+.12*h,n[1]/l*(1-h)+.88*h,n[2]/l*(1-h)+h],f=[d[2],d[0],d[1]],u=Math.max(.3,e.vivid??0),i=[0,0,0],m=[0,0,0],g=.8+.5*e.rim;for(let M=0;M<sn;M++)for(let b=0;b<sn;b++){let w=b/(sn-1)*2-1,v=M/(sn-1)*2-1,y=w*w+v*v;if(y>1.14)continue;if(y>1){const T=1/Math.sqrt(y);w*=T,v*=T,y=1}const C=Math.sqrt(1-y),p=w*a[0]+v*a[1]+C*a[2],A=1-Math.max(0,w*s[0]+v*s[1]+C*s[2]),S=rn(-.5,1,p),E=rn(-.1,.75,w*r[0]+v*r[1]+C*r[2]);for(let T=0;T<3;T++)m[T]=d[T]+(f[T]-d[T])*.75*E;const I=Math.pow(A,2.2)*2.1*g+.22*Math.pow(A,1.1),W=Math.pow(A,7)*1.6,x=.05+.2*S;i[0]=n[0]*x+m[0]*I,i[1]=n[1]*x+m[1]*I,i[2]=n[2]*x+m[2]*I,es(i,u,2.2);const $=(M*sn+b)*3;t[$]=Ao(i[0]+W*(.55+.45*m[0])),t[$+1]=Ao(i[1]+W*(.55+.45*m[1])),t[$+2]=Ao(i[2]+W*(.55+.45*m[2]))}}function er(t,n,o,e,a){return{m:t,o:n,L:o,H:e,px:a,toScreen:s=>{const r=s[0]-n[0],l=s[1]-n[1],c=s[2]-n[2];return[t[0]*r+t[1]*l+t[2]*c,t[3]*r+t[4]*l+t[5]*c]},depth:s=>t[6]*(s[0]-n[0])+t[7]*(s[1]-n[1])+t[8]*(s[2]-n[2]),dir:s=>Oo([t[0]*s[0]+t[1]*s[1]+t[2]*s[2],t[3]*s[0]+t[4]*s[1]+t[5]*s[2],t[6]*s[0]+t[7]*s[1]+t[8]*s[2]])}}const Se=(t,n)=>[t[0]-n[0],t[1]-n[1],t[2]-n[2]],ts=(t,n)=>[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]],ao=(t,n)=>t[0]*n[0]+t[1]*n[1]+t[2]*n[2],Oo=t=>{const n=Math.hypot(t[0],t[1],t[2])||1;return[t[0]/n,t[1]/n,t[2]/n]},t0=Math.PI*2;function bn(t,n,o,e,a=11){return Math.max(o,Math.min(e,Math.round(n*t.px/a)))}function sr(t,n,o,e,a=!0){const s=n+1,r=s*(o+1),l=new Float64Array(r*3);let c=0;for(let g=0,M=0;g<=o;g++)for(let b=0;b<=n;b++,M++){const w=t(b/n,g/o);l[M*3]=w[0],l[M*3+1]=w[1],l[M*3+2]=w[2],c=Math.max(c,Math.abs(w[0]-l[0])+Math.abs(w[1]-l[1])+Math.abs(w[2]-l[2]))}const h=g=>[l[g*3],l[g*3+1],l[g*3+2]],d=new Float64Array(n*o*3);for(let g=0;g<o;g++)for(let M=0;M<n;M++){const b=g*s+M,w=h(b),v=h(b+1),y=h(b+s+1),C=h(b+s);let p=ts(Se(y,w),Se(C,v));const k=[(w[0]+v[0]+y[0]+C[0])/4,(w[1]+v[1]+y[1]+C[1])/4,(w[2]+v[2]+y[2]+C[2])/4],A=typeof e=="function"?e((M+.5)/n,(g+.5)/o):e;ao(p,Se(k,A))<0&&(p=[-p[0],-p[1],-p[2]]),p=Oo(p);const S=(g*n+M)*3;d[S]=p[0],d[S+1]=p[1],d[S+2]=p[2]}const f=1e-6+c*1e-5,u=(g,M)=>Math.abs(l[g*3]-l[M*3])+Math.abs(l[g*3+1]-l[M*3+1])+Math.abs(l[g*3+2]-l[M*3+2])<f;let i=!0;for(let g=0;g<=o&&i;g++)i=u(g*s,g*s+n);let m=null;if(a){const g=new Float64Array(r*3);for(let b=0;b<o;b++)for(let w=0;w<n;w++){const v=(b*n+w)*3,y=b*s+w;for(const C of[y,y+1,y+s+1,y+s])g[C*3]+=d[v],g[C*3+1]+=d[v+1],g[C*3+2]+=d[v+2]}const M=b=>{let w=0,v=0,y=0;for(const C of b)w+=g[C*3],v+=g[C*3+1],y+=g[C*3+2];for(const C of b)g[C*3]=w,g[C*3+1]=v,g[C*3+2]=y};if(i)for(let b=0;b<=o;b++)M([b*s,b*s+n]);for(const b of[0,o]){let w=!0;for(let v=1;v<=n&&w;v++)w=u(b*s,b*s+v);w&&M(Array.from({length:s},(v,y)=>b*s+y))}for(let b=0;b<r;b++){const w=g[b*3],v=g[b*3+1],y=g[b*3+2],C=Math.hypot(w,v,y)||1;g[b*3]=w/C,g[b*3+1]=v/C,g[b*3+2]=y/C}m=g}return{nu:n,nv:o,closed:i,pos:l,fn:d,vn:m}}function Ul(t,n,o,e,a,s=!1){const l=c=>t(s?(c%1+1)%1:Math.max(0,Math.min(1,c)));return sr((c,h)=>{const d=t(c),f=Oo(Se(l(c+.001),l(c-.001))),u=ao(n,f),i=Oo([n[0]-f[0]*u,n[1]-f[1]*u,n[2]-f[2]*u]),m=ts(f,i),[g,M]=o(c,h*t0);return[d[0]+i[0]*g+m[0]*M,d[1]+i[1]*g+m[1]*M,d[2]+i[2]*g+m[2]*M]},e,a,c=>t(c))}const Pe=(t,n,o=1)=>(e,a)=>{const s=Math.cos(a),r=Math.sin(a);return[t*Math.sign(s)*Math.pow(Math.abs(s),o),n*Math.sign(r)*Math.pow(Math.abs(r),o)]};function ar(t,n){const{nu:o,nv:e,pos:a,fn:s,vn:r}=n,l=o+1,c=l*(e+1),h=o*e,[d,f,u,i,m,g,M,b,w]=t.m,[v,y,C]=t.o,p=new Float64Array(c),k=new Float64Array(c),A=new Float64Array(c);for(let x=0;x<c;x++){const $=a[x*3]-v,T=a[x*3+1]-y,F=a[x*3+2]-C;p[x]=d*$+f*T+u*F,k[x]=i*$+m*T+g*F,A[x]=M*$+b*T+w*F}const S=(x,$,T)=>{for(let F=0;F<T;F++){const _=x[F*3],q=x[F*3+1],D=x[F*3+2],O=d*_+f*q+u*D,K=i*_+m*q+g*D,U=M*_+b*q+w*D,nt=Math.hypot(O,K,U)||1;$[F*3]=O/nt,$[F*3+1]=K/nt,$[F*3+2]=U/nt}};let E=null;r&&S(r,E=new Float64Array(c*3),c);const I=new Float64Array(h*3),W=new Float64Array(h);S(s,I,h);for(let x=0,$=0;x<e;x++)for(let T=0;T<o;T++,$++){const F=x*l+T;W[$]=(A[F]+A[F+1]+A[F+l]+A[F+l+1])/4}return{nu:o,nv:e,closed:n.closed,x:p,y:k,d:A,n:E,f:I,cd:W}}function as(t){let n=1/0,o=1/0,e=-1/0,a=-1/0;for(const s of t)for(let r=0;r<s.x.length;r++)s.x[r]<n&&(n=s.x[r]),s.x[r]>e&&(e=s.x[r]),s.y[r]<o&&(o=s.y[r]),s.y[r]>a&&(a=s.y[r]);return{x0:n,y0:o,x1:e,y1:a,cx:(n+e)/2,cy:(o+a)/2,w:e-n,h:a-o}}function Ql(t,n,o,e){const a=t[e]-t[o],s=n[e]-n[o];let r=-1/0;for(let l=o;l<=e;l++){const c=(t[l]-t[o])*a+(n[l]-n[o])*s;if(c<r-1e-9)return!1;r=c}return!0}const Ia=t=>t<0?0:t>255?255:Math.round(t),he=t=>`rgb(${Ia(t[0])},${Ia(t[1])},${Ia(t[2])})`;function Kn(t,n,o){const e=[],a=[];for(const r of n){const l=r.bias??0,c=r.keep,h=r.cull!==!1;for(const d of r.parts){const{nu:f,nv:u,f:i,cd:m,x:g,y:M}=d,b=f+1,w=v=>(!h||i[v*3+2]>-.04)&&(!c||c(m[v]));for(let v=0;v<u;v++){if(r.flat){for(let p=0;p<f;p++){const k=v*f+p;w(k)&&(e.push({d:m[k]+l,l:r,p:d,j:v,cols:[p,p+1],cells:[k]}),a.push([g[v*b+p],M[v*b+p]],[g[(v+1)*b+p+1],M[(v+1)*b+p+1]]))}continue}const y=[];let C=null;for(let p=0;p<f;p++)w(v*f+p)?(C||y.push(C=[]),C.push(p)):C=null;d.closed&&y.length>1&&y[0][0]===0&&y[y.length-1][y[y.length-1].length-1]===f-1&&(y[0]=y.pop().concat(y[0]));for(const p of y){const k=p.concat(p[p.length-1]+1),A=[],S=[];for(let I=0;I<k.length;I++){const W=v*b+k[I],x=W+b;A.push((g[W]+g[x])/2),S.push((M[W]+M[x])/2),I===0||I===k.length-1?a.push([g[W],M[W]],[g[x],M[x]]):v===0?a.push([g[W],M[W]]):v===u-1&&a.push([g[x],M[x]])}let E=0;for(;E<k.length-1;){let I=E+1;for(;I+1<k.length&&Ql(A,S,E,I+1);)I++;let W=0;for(let x=E;x<I;x++)W+=m[v*f+p[x]];e.push({d:W/(I-E)+l,l:r,p:d,j:v,cols:k.slice(E,I+1),cells:p.slice(E,I)}),E=I}}}}}e.sort((r,l)=>r.d-l.d);const s=.5/o;for(const r of e){const{p:l,l:c,j:h,cols:d,cells:f}=r,{x:u,y:i,n:m,f:g}=l,M=l.nu+1,b=d.length,w=[],v=[],y=[],C=[],p=h*M+d[0],k=h*M+d[b-1];let A=(u[k]+u[k+M])/2-(u[p]+u[p+M])/2,S=(i[k]+i[k+M])/2-(i[p]+i[p+M])/2;const E=Math.hypot(A,S),I=E>1e-9?A/E:0,W=E>1e-9?S/E:0;for(let T=0;T<b;T++){const F=h*M+d[T],_=F+M;let q=u[F]-u[_],D=i[F]-i[_];const O=Math.hypot(q,D);O>1e-9?(q/=O,D/=O):q=D=0;const K=T===0?-s:T===b-1?s:0;w.push(u[F]+q*s+I*K),v.push(i[F]+D*s+W*K),y.push(u[_]-q*s+I*K),C.push(i[_]-D*s+W*K)}const x=T=>{if(m&&!c.flat){const q=(h*M+d[T])*3,D=q+M*3;return c.shade(Oo([m[q]+m[D],m[q+1]+m[D+1],m[q+2]+m[D+2]]))}const F=f[Math.max(0,Math.min(f.length-1,T-1))]*3,_=f[Math.min(f.length-1,T)]*3;return c.shade(c.flat?[g[_],g[_+1],g[_+2]]:Oo([g[F]+g[_],g[F+1]+g[_+1],g[F+2]+g[_+2]]))};let $;if(c.flat||E<1e-6)$=he(x(0));else{const T=t.createLinearGradient((u[p]+u[p+M])/2,(i[p]+i[p+M])/2,(u[k]+u[k+M])/2,(i[k]+i[k+M])/2);let F=null;const _=(u[p]+u[p+M])/2,q=(i[p]+i[p+M])/2;for(let D=0;D<b;D++){const O=x(D);if(F&&D<b-1&&Math.abs(O[0]-F[0])+Math.abs(O[1]-F[1])+Math.abs(O[2]-F[2])<5)continue;const K=h*M+d[D],U=(((u[K]+u[K+M])/2-_)*A+((i[K]+i[K+M])/2-q)*S)/(E*E);T.addColorStop(U<0?0:U>1?1:U,he(O)),F=O}$=T}t.fillStyle=$,t.beginPath(),t.moveTo(w[0],v[0]);for(let T=1;T<b;T++)t.lineTo(w[T],v[T]);for(let T=b-1;T>=0;T--)t.lineTo(y[T],C[T]);t.closePath(),t.fill()}return a}function de(t){const n=t.slice().sort((s,r)=>s[0]-r[0]||s[1]-r[1]);if(n.length<3)return n;const o=(s,r,l)=>(r[0]-s[0])*(l[1]-s[1])-(r[1]-s[1])*(l[0]-s[0]),e=[],a=[];for(const s of n){for(;e.length>=2&&o(e[e.length-2],e[e.length-1],s)<=0;)e.pop();e.push(s)}for(let s=n.length-1;s>=0;s--){const r=n[s];for(;a.length>=2&&o(a[a.length-2],a[a.length-1],r)<=0;)a.pop();a.push(r)}return e.pop(),a.pop(),e.concat(a)}const zn=t=>t<0?0:t>1?1:t,co=(t,n,o)=>[t[0]+(n[0]-t[0])*o,t[1]+(n[1]-t[1])*o,t[2]+(n[2]-t[2])*o],Go=(t,n)=>[t[0]*n,t[1]*n,t[2]*n],pe=[255,255,255];function vo(t,n,o=1){const e=t.L;return a=>{const s=ao(a,e),r=Math.pow(zn((s+.4)/1.4),1.35),l=Math.pow(1-zn(a[2]),2),c=(.22+.95*r+.22*l*zn(s+.6))*o,h=26*r*o;return[n[0]*c+h,n[1]*c+h,n[2]*c+h*1.05]}}function Jl(t,n){const o=t.L,e=co(n,pe,.3);return a=>{const s=ao(a,o),r=zn((s+.3)/1.3),l=Math.pow(1-zn(a[2]),1.6);return co(Go(n,.2+.7*r),e,.6*l*(.4+.6*r))}}function ei(t,n){const o=t.L,e=t.H;return a=>{const s=zn((ao(a,o)+.2)/1.2),r=Math.pow(zn(ao(a,e)),22)*.3;return co(Go(n,.36+.7*s),pe,r)}}function Uo(t,n,o=1){const e=t.L,a=t.H;return s=>{const r=zn((ao(s,e)+.25)/1.25),l=zn(ao(s,a)),c=(Math.pow(l,16)*.2+Math.pow(l,80)*.6)*o,h=Math.pow(1-zn(s[2]),3)*.14*o;return co(Go(n,.28+.78*r),pe,zn(c+h))}}function Gs(t,n){const o=t.L,e=t.H,a=Go(n,.42),s=co(n,pe,.55);return r=>{const l=zn((ao(r,o)+.35)/1.35),c=zn(ao(r,e)),h=Math.pow(c,6)*.5+Math.pow(c,40)*.35;return co(co(a,n,l),s,zn(h))}}function n0(t,n,o,e){const a=t.H,s=t.L;return r=>{const l=2*r[2]*r[2]-1,h=-(2*r[2]*r[1]),d=zn(.45+h*.85+l*.1),f=Math.exp(-Math.pow((h+.12)/.16,2))*.55,u=zn(ao(r,s)),i=co(o,n,zn(.1+d*.72+u*.3)),m=Math.pow(zn(ao(r,a)),70)+f*.4;return co(i,e,zn(m))}}const o0=t=>n0(t,[255,200,88],[86,50,8],[255,247,220]),t1=t=>n0(t,[232,236,242],[58,62,72],[255,255,255]);function n1(t,n){const o=t.L,e=t.H,a=Go(n,.22),s=co(n,pe,.3);return r=>{const l=co(a,s,zn(zn(r[2])*.75+ao(r,o)*.4));return co(l,pe,Math.pow(zn(ao(r,e)),24)*.95)}}const o1={gold:[[0,"#fffbe8"],[.08,"#ffe7a0"],[.3,"#eeb546"],[.62,"#ad7214"],[.87,"#5a3806"],[1,"#8c5c18"]],silver:[[0,"#ffffff"],[.08,"#f3f5f9"],[.32,"#c6ccd6"],[.64,"#7a808c"],[.88,"#3d4149"],[1,"#6b717c"]],pearl:[[0,"#ffffff"],[.1,"#fdf9f7"],[.45,"#ebe4e6"],[.8,"#c6bccb"],[1,"#a89db5"]]};function Co(t,n,o,e,a){const s=n.toScreen(o),r=n.H,l=t.createRadialGradient(s[0]+r[0]*e*.85,s[1]+r[1]*e*.85,0,s[0],s[1],e);if(typeof a=="string")for(const[c,h]of o1[a])l.addColorStop(c,h);else l.addColorStop(0,he(co(a,pe,.8))),l.addColorStop(.1,he(co(a,pe,.3))),l.addColorStop(.35,he(a)),l.addColorStop(.85,he(Go(a,.5))),l.addColorStop(1,he(Go(a,.62)));t.fillStyle=l,t.beginPath(),t.arc(s[0],s[1],e,0,t0),t.fill()}function e1(t,n,o,e,a,s,r){const l=ts(e,a),c=(b,w,v)=>{const y=b*Math.cos(w),C=b*Math.sin(w);return[o[0]+y*a[0]+C*l[0]+v*e[0],o[1]+y*a[1]+C*l[1]+v*e[1],o[2]+y*a[2]+C*l[2]+v*e[2]]},h=8,d=.55,f=.36*s,u=[],i=[];for(let b=0;b<h;b++){const w=(b+.5)/h*t0;u.push(c(s,w,0)),i.push(c(s*d,w,f))}const m=n1(n,r),g=(b,w)=>{const v=n.dir(w);v[2]<=.02||(t.fillStyle=he(m(v)),t.beginPath(),b.forEach((y,C)=>{const p=n.toScreen(y);C?t.lineTo(p[0],p[1]):t.moveTo(p[0],p[1])}),t.closePath(),t.fill(),t.strokeStyle=t.fillStyle,t.stroke())};t.lineWidth=Math.min(.3,1/n.px),t.lineJoin="round";for(let b=0;b<h;b++){const w=u[b],v=u[(b+1)%h],y=i[(b+1)%h],C=i[b];let p=ts(Se(y,w),Se(C,v));ao(p,e)<0&&(p=[-p[0],-p[1],-p[2]]),g([w,v,y,C],Oo(p))}if(g(i,e),n.dir(e)[2]>.1){const b=n.toScreen(c(0,0,f)),w=n.L;t.fillStyle="rgba(255,255,255,0.3)",t.beginPath();const v=n.toScreen(c(s*d*.8,Math.atan2(-w[1],-w[0])+2.2,f)),y=n.toScreen(c(s*d*.9,Math.atan2(-w[1],-w[0])+Math.PI,f)),C=n.toScreen(c(s*d*.8,Math.atan2(-w[1],-w[0])+Math.PI+.94,f));t.moveTo(b[0],b[1]),t.lineTo(v[0],v[1]),t.lineTo(y[0],y[1]),t.lineTo(C[0],C[1]),t.closePath(),t.fill()}}function Ie(t,n){const o=t.right-t.left;for(let e=0;e<t.widths.length;e++)if(t.widths[e]>=n*o)return e*t.step-st;return t.top}const si=new WeakMap;function ir(t){const n=si.get(t);if(n)return n;const o=128,e=Hi(t,o);if(!e)return null;const a=zt/o,s=p=>(p+.5)*a-st,r=(p,k)=>e[k*o+p]>=128,l=Math.floor((42+st)/a),c=Math.ceil((58+st)/a);let h=o,d=-1;for(let p=l;p<=c;p++){for(let k=0;k<o;k++)if(r(p,k)){k<h&&(h=k);break}for(let k=o-1;k>=0;k--)if(r(p,k)){k>d&&(d=k);break}}const f=p=>{let k=-1,A=-1;for(let S=0;S<o;S++)r(S,p)&&(k<0&&(k=S),A=S);return[k,A]},u=Math.min(o-1,h+Math.round(8/a)),[i,m]=f(u);let g=-1,M=0,b=0,w=0;for(let p=Math.round((33+st)/a);p<=Math.round((67+st)/a);p++){const[k,A]=f(p);k>=0&&A-k>g&&(g=A-k,M=k,b=A,w=p)}const v=new Float32Array(o),y=[];for(let p=0;p<o;p++){const[k,A]=f(p);v[p]=k<0?0:(A-k+1)*a,k>=0&&y.push([s(k)-.5*a,s(p)],[s(A)+.5*a,s(p)])}const C={top:s(h)-.5*a,topL:s(i),topR:s(m),mid:s(w),left:s(M)-.5*a,right:s(b)+.5*a,bottom:s(d)+.5*a,widths:v,step:a,hull:de(y)};return si.set(t,C),C}function Ko(t,n,o){const e=Math.cos(n),a=Math.sin(n),s=t[0]*e-t[1]*a,r=t[0]*a+t[1]*e,l=Math.cos(o),c=Math.sin(o);return[s,r*l-t[2]*c,r*c+t[2]*l]}const Me=(t,n)=>[t[0]+n[0],t[1]+n[1],t[2]+n[2]],No=(t,n,o)=>[t[0]+n[0]*o,t[1]+n[1]*o,t[2]+n[2]*o];function ns(t,n=!0){const o=new Path2D;return t.forEach((e,a)=>a?o.lineTo(e[0],e[1]):o.moveTo(e[0],e[1])),n&&o.closePath(),o}function is(t){let n=1/0,o=1/0,e=-1/0,a=-1/0;for(const[s,r]of t)s<n&&(n=s),r<o&&(o=r),s>e&&(e=s),r>a&&(a=r);return{x0:n,y0:o,x1:e,y1:a,cx:(n+e)/2,cy:(o+a)/2,w:e-n,h:a-o}}const Yo=(t,n=0)=>{let o=t*2654435761+n*40503|0;return o=Math.imul(o^o>>>15,2246822507),o=Math.imul(o^o>>>13,3266489909),((o^o>>>16)>>>0)/4294967296};let Fa=null;function s1(){if(Fa)return Fa;const t=48,n=typeof OffscreenCanvas=="function"?new OffscreenCanvas(t,t):typeof document<"u"?Object.assign(document.createElement("canvas"),{width:t,height:t}):null,o=n&&n.getContext("2d");if(!n||!o)return null;const e=o.createImageData(t,t);for(let a=0;a<t*t;a++){const s=a%t,r=a/t|0;let l=0;for(let h=-2;h<=2;h++)l+=Yo((s+h+t)%t+(r+h+t)%t*t,5);l/=5;const c=Math.round(255*(.82+.36*l));e.data[a*4]=e.data[a*4+1]=e.data[a*4+2]=Math.min(255,c),e.data[a*4+3]=255}return o.putImageData(e,0,0),Fa=n,n}const ai=new WeakMap;function rs(t,n,o,e=.18){const a=s1();if(!a||n.length<3)return;let s=ai.get(t);s||ai.set(t,s=new Map);let r=s.get(e);if(r===void 0&&(r=t.createPattern(a,"repeat"),r?.setTransform?.(new DOMMatrix().scale(e)),s.set(e,r)),!r)return;const l=is(n);t.save(),t.clip(ns(n)),t.globalCompositeOperation="multiply",t.globalAlpha=o,t.fillStyle=r,t.fillRect(l.x0-1,l.y0-1,l.w+2,l.h+2),t.restore()}function ls(t,n,o,e,a,s=2.4){const r=n.length;if(r<3)return;let l=0;const c=[];for(let g=0;g<r;g++){const M=n[g],b=n[(g+1)%r],w=Math.hypot(b[0]-M[0],b[1]-M[1]);c.push(w),l+=w}const h=Math.min(360,Math.max(24,Math.round(l*Math.min(2.4,s*.5)))),d=is(n),f=new Path2D,u=new Path2D;let i=0,m=0;for(let g=0;g<h;g++){const M=(g+Yo(g,e)*.8)*(l/h);for(;i<r-1&&m+c[i]<M;)m+=c[i++];const b=n[i],w=n[(i+1)%r],v=c[i]?(M-m)/c[i]:0,y=b[0]+(w[0]-b[0])*v,C=b[1]+(w[1]-b[1])*v;let p=y-d.cx,k=C-d.cy;const A=Math.hypot(p,k)||1;p/=A,k/=A;const S=(Yo(g,e+1)-.5)*.9,E=Math.cos(S),I=Math.sin(S),W=p*E-k*I,x=p*I+k*E,$=a*(.35+Yo(g,e+2)),T=Yo(g,e+3)>.5?f:u;T.moveTo(y-W*.4,C-x*.4),T.lineTo(y+W*$,C+x*$)}t.save(),t.lineCap="round",t.lineWidth=.4,t.globalAlpha=.55,t.strokeStyle=fn(o,.14),t.stroke(f),t.strokeStyle=fn(o,-.06),t.stroke(u),t.restore()}function te(t,n,o,e,a,s,r){if(!(a>0)||!(s>0))return;t.save(),n&&t.clip(n),t.translate(o,e),t.scale(1,s/a);const l=t.createRadialGradient(0,0,0,0,0,a);l.addColorStop(0,`rgba(0,0,0,${r})`),l.addColorStop(.55,`rgba(0,0,0,${r*.45})`),l.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=l,t.beginPath(),t.arc(0,0,a,0,Math.PI*2),t.fill(),t.restore()}const ii=48*Math.PI/180;function rr(t,n){const o=Math.cos(ii),e=Math.sin(ii),a=Oo([t*o,n*o,e]);return{L:a,H:Oo([a[0],a[1],a[2]+1])}}function e0(t){const n=t.getTransform?.();return n?Math.sqrt(Math.abs(n.a*n.d-n.b*n.c))||1:2}function lr(t,n){const{L:o,H:e}=rr(t.lx,t.ly);return er([t.cy,0,t.sy,t.sy*t.sp,t.cp,-t.cy*t.sp,-t.sy*t.cp,t.sp,t.cy*t.cp],[50,50,0],o,e,n)}const qa=new WeakMap;let os=qa;function cr(t,n){let o=qa.get(os);o||qa.set(os,o=new Map);let e=o.get(t);return e||(o.size>240&&o.clear(),e=n(),o.set(t,e)),e}function An(t,n,o,e,a,s,r=!0){return ar(t,cr(`${n}|${e}x${a}`,()=>sr(o,e,a,s,r)))}function jo(t,n,o,e,a,s,r,l=!1){return ar(t,cr(`${n}|${s}x${r}`,()=>Ul(o,e,a,s,r,l)))}const Qn=(t,n=[40,40,44])=>me(t)??n,Et=Math.PI*2,hr=t=>t<=0?0:t>=1?1:t*t*(3-2*t),ce=(t,n)=>Math.sign(t)*Math.pow(Math.abs(t),n);function a1(t,n,o,e,a,s){return An(t,n,(r,l)=>{const c=r*Et,h=l*Math.PI;return[o[0]+e*Math.sin(h)*Math.cos(c),o[1]-e*Math.cos(h),o[2]+e*Math.sin(h)*Math.sin(c)]},a,s,o)}function Te(t,n,o,e,a,s,r,l,c){return An(t,n,(h,d)=>{const f=h*Et,u=d*Et,i=e+s*Math.cos(u);return o([i*Math.cos(f),a-s*Math.sin(u),i*r*Math.sin(f)])},l,c,h=>o([e*Math.cos(h*Et),a,e*r*Math.sin(h*Et)]))}function ri(t,n,o){return e=>{const s=Oo(Se(t(Math.min(1,e+.001)),t(Math.max(0,e-.001)))),r=ts(s,n);return No(t(e),r,o(e))}}function fr(t,n,o,e,a,s){const r=Qn(a),l=bn(n,Et*e,12,20),c=Kn(t,[{parts:[a1(n,`ball${s}`,o,e*.86,l,Math.max(6,l>>1))],shade:vo(n,r,.92)}],n.px),h=n.toScreen(o),d=is(c),f=Math.max(d.w,d.h)/2,u=Math.round(Math.min(340,50+f*n.px*5)),i=new Path2D,m=new Path2D;for(let b=0;b<u;b++){const w=Yo(b,s)*Et,v=f*(.25+.7*Math.sqrt(Yo(b,s+1))),y=f*(.25+.35*Yo(b,s+2)),C=h[0]+Math.cos(w)*v,p=h[1]+Math.sin(w)*v,k=(Yo(b,s+3)-.5)*.6,A=Math.cos(w+k),S=Math.sin(w+k),E=Yo(b,s+4)>.45?i:m;E.moveTo(C,p),E.quadraticCurveTo(C+Math.cos(w)*y*.5,p+Math.sin(w)*y*.5,C+A*y,p+S*y)}t.save(),t.lineCap="round",t.lineWidth=Math.max(.3,f*.06);const g=n.L,M=t.createLinearGradient(h[0]+g[0]*f,h[1]+g[1]*f,h[0]-g[0]*f,h[1]-g[1]*f);M.addColorStop(0,fn(a,.2,-.03)),M.addColorStop(1,fn(a,-.12,.02)),t.strokeStyle=M,t.globalAlpha=.85,t.stroke(i),t.strokeStyle=fn(a,-.18,.03),t.globalAlpha=.6,t.stroke(m),t.restore()}function i1(t,n,o,e,a){const s=o.right-o.left,r=.46*s,l=.21*s,c=.33*s,h=.05*s,d=[50-.07*s,Math.max(o.top+.22*s,Ie(o,.5)+.1*s),0],f=-.24,u=-.2,i=W=>Me(d,Ko(W,f,u)),m=bn(n,Et*r,32,56),g=bn(n,1.2*r,10,32,6),b=An(n,"beret:dome",(W,x)=>{const $=W*Et;let T,F;const _=.74;if(x<=_){const D=x/_*(Math.PI/2);T=r*Math.sin(D),F=-(h+l*Math.pow(Math.cos(D),.8))}else{const D=hr((x-_)/(1-_));T=r+(c-r)*D,F=-h*(1-D)}const q=Math.sin(Math.min(1,x/_)*Math.PI*.9);return T*=1+.035*Math.sin($*7+.4)*q,i([T*Math.cos($),F,T*.93*Math.sin($)])},m,g,i([0,-h-l*.4,0])),w=An(n,"beret:under",(W,x)=>{const $=W*Et,T=c*(1-x);return i([T*Math.cos($),-.004*s*x,T*.93*Math.sin($)])},24,2,i([0,-h-l*.4,0])),v=Qn(e),y=n.toScreen(i([0,.02*s,0]));te(t,a,y[0]+.02*s,y[1]+.045*s,c*1.25,.08*s,.4);const C=Te(n,"beret:binding",i,c,-.005*s,.022*s,.93,bn(n,Et*c,24,48),5),p=Qn(fn(e,-.06)),k=Kn(t,[{parts:[w],shade:vo(n,v,.7)},{parts:[C],shade:Uo(n,p,.45)},{parts:[b],shade:vo(n,v)}],n.px),A=de(k);rs(t,A,.5,.14),ls(t,A,e,11,.4,n.px);const S=.02*s,E=-h-l+.006*s,I=jo(n,"beret:stalk",W=>i([S+.014*s*W*W,E-.045*s*W,0]),[0,0,1],(W,x)=>[.016*s*(1-.25*W)*Math.cos(x),.016*s*(1-.25*W)*Math.sin(x)],8,3);Kn(t,[{parts:[I],shade:vo(n,v,.95)}],n.px),Co(t,n,i([S+.014*s,E-.047*s,0]),.019*s,Go(v,1.15))}function r1(t,n,o,e,a){const s=o.right-o.left,l=.53*Math.max(.5*s,o.topR-o.topL)+.08*s,c=.32*s,h=.1*s,d=l*1.05,f=[50,Ie(o,.72)+.06*s,0],u=0,i=-.14,m=$=>Me(f,Ko($,u,i)),g=($,T)=>{const F=$*Et,_=T*(Math.PI/2),q=l*Math.sin(_)*(1-.03*(1-T)),D=-(h+c*Math.cos(_));return m([q*Math.cos(F),D,q*.92*Math.sin(F)])},M=m([0,-h-c*.4,0]),b=An(n,"beanie:dome",g,bn(n,Et*l,28,48),bn(n,1.3*c,9,24,6),M),w=($,T)=>{const F=$*Et,_=2*T-1,q=d*(1-.07*_*_*_*_)*1.01;return m([q*Math.cos(F),-h*(1-T),q*.92*Math.sin(F)])},v=An(n,"beanie:cuff",w,bn(n,Et*d,28,56),4,m([0,-h/2,0])),y=Qn(e),C=Qn(fn(e,.03)),p=as([v]);te(t,a,p.cx,p.y1-.01*s,p.w*.5,.06*s,.34);const k=Kn(t,[{parts:[b],shade:vo(n,y,.96)}],n.px),A=40,S=11;if(l*Et/A*n.px>=2.2){const $=An(n,"beanie:stitch",g,A,S,M,!1),T=new Path2D,F=new Path2D,_=A+1;for(let D=0;D<A*S;D++){if($.f[D*3+2]<.12)continue;const O=Math.floor(D/A)*_+D%A,K=[$.x[O],$.y[O]],U=[$.x[O+1],$.y[O+1]],nt=[$.x[O+_+1],$.y[O+_+1]],dt=[$.x[O+_],$.y[O+_]],pt=(Tt,j)=>{const N=[K[0]+(U[0]-K[0])*Tt,K[1]+(U[1]-K[1])*Tt],Q=[dt[0]+(nt[0]-dt[0])*Tt,dt[1]+(nt[1]-dt[1])*Tt];return[N[0]+(Q[0]-N[0])*j,N[1]+(Q[1]-N[1])*j]};for(const[Tt,j]of[[T,0],[F,-.06]]){const N=pt(.14+j,.12),Q=pt(.5+j,.88),Ot=pt(.86+j,.12);Tt.moveTo(N[0],N[1]),Tt.lineTo(Q[0],Q[1]),Tt.lineTo(Ot[0],Ot[1])}}const q=l*Et/A;t.save(),t.clip(ns(de(k))),t.lineCap="round",t.lineJoin="round",t.lineWidth=Math.max(.35,q*.2),t.strokeStyle=fn(e,-.22,.03),t.globalAlpha=.5,t.stroke(T),t.lineWidth=Math.max(.3,q*.12),t.strokeStyle=fn(e,.2,-.03),t.globalAlpha=.35,t.stroke(F),t.restore()}const I=Kn(t,[{parts:[v],shade:vo(n,C,.98)}],n.px),W=Et*d/30;if(W*n.px>=3){const $=new Path2D,T=new Path2D;for(let F=0;F<60;F++){const _=F/60,q=_*Et;if(n.dir(Ko([Math.cos(q),0,.92*Math.sin(q)],u,i))[2]<.08)continue;const D=n.toScreen(w(_,.1)),O=n.toScreen(w(_,.9)),K=F%2?$:T;K.moveTo(D[0],D[1]),K.lineTo(O[0],O[1])}t.save(),t.lineCap="round",t.lineWidth=W*.34,t.strokeStyle=fn(e,-.2,.03),t.globalAlpha=.45,t.stroke($),t.lineWidth=W*.22,t.strokeStyle=fn(e,.16,-.02),t.globalAlpha=.4,t.stroke(T),t.restore()}const x=de(k.concat(I));ls(t,x,e,23,.35,n.px),fr(t,n,m([0,-h-c-.055*s,0]),.085*s,fn(e,.06),31)}function l1(t,n,o,e,a){const s=o.right-o.left,r=[50+.06*s,Ie(o,.3)+.04*s,0],l=.18*s,c=Math.max(.3*s,Math.min(.46*s,r[1]+31-.1*s)),h=.18,d=-.12,f=S=>Me(r,Ko(S,h,d)),u=(S,E,I=1)=>{const W=S*Et,x=l*(1-E)*(1+.04*Math.sin(E*Math.PI))*I;return f([x*Math.cos(W),-c*E,x*Math.sin(W)])},i=(S,E)=>f([0,-c*Math.min(.97,E),0]),m=bn(n,Et*l,20,40),g=bn(n,c,10,24,6),M=An(n,"party:cone",(S,E)=>u(S,E),m,g,i),b=Qn(e),w=[252,246,234],v=as([M]);te(t,a,v.cx,v.y1,l*1.15,.04*s,.3);const y=Te(n,"party:trim",f,l*1.02,.004*s,.016*s,1,bn(n,Et*l,20,40),5),C=[],p=6,k=3.2;for(let S=0;S<p;S+=1)C.push(An(n,`party:stripe${S}`,(E,I)=>u((S+.5*I-k*E*.97)/p,E*.97,1.004),g+3,1,i));const A=Kn(t,[{parts:[M],shade:ei(n,w)},{parts:[y],shade:o0(n)}],n.px);Kn(t,[{parts:C,shade:ei(n,b)}],n.px),rs(t,de(A),.18,.1),fr(t,n,f([0,-c-.035*s,0]),.06*s,"#f4efe6",37)}function c1(t,n,o,e){const a=o.right-o.left,r=.44*Math.max(.45*a,o.topR-o.topL)+.07*a,l=.11*a,c=.15*a,h=.9,d=[50,Ie(o,.42)+.05*a,0],f=.05,u=-.22,i=G=>Me(d,Ko(G,f,u)),m=G=>Oo(Ko(G,f,u)),g=(G,ut,ft)=>i([ut*Math.cos(G),ft,ut*h*Math.sin(G)]),M=G=>i([0,G,0]),b=bn(n,Et*r,32,64),w=An(n,"crown:band",(G,ut)=>g(G*Et,r*(1-.018*Math.sin(ut*Math.PI)),-l*(1-ut)),b,2,(G,ut)=>M(-l*(1-ut))),v=.017*a,y=Te(n,"crown:rimTop",i,r+.004*a,-l,v,h,b,5),C=Te(n,"crown:rimBot",i,r+.004*a,0,v*1.15,h,b,5),p=-l*.55,k=Math.max(.12*a,d[1]-o.top+.04*a+p),A=Math.PI/2,S=An(n,"crown:cap",(G,ut)=>{const ft=G*Et,xt=ut*(Math.PI/2),it=.08*Math.sin(2*xt)*(.55+.45*Math.cos(5*(ft-A-Math.PI/5)));return g(ft,r*(.9*Math.sin(xt)+it),p-k*Math.cos(xt))},bn(n,Et*r,24,48),bn(n,1.4*k,8,20,6),M(p-k*.4)),E=[],I=[],W=[],x=[],$=(G,ut,ft,xt,it,z,L)=>{L.push(An(n,G,(bt,H)=>{const Lt=bt*2-1,It=ut+Lt*ft*Math.pow(1-H,1.3),Cn=r+.004*a+it*(1-Math.abs(Lt))*(1-.5*H)+z*H*H;return g(It,Cn,-l-xt*H)},2,bn(n,xt,3,5),(bt,H)=>g(ut,r*.5,-l-xt*H),!1))};for(let G=0;G<5;G++){const ut=A+G/5*Et;$(`crown:point${G}`,ut,Et/5*.34,c,.05*a,.03*a,E),W.push(g(ut,r+.004*a+.03*a+.02*a,-l-c-.018*a));const ft=ut+Math.PI/5;$(`crown:bud${G}`,ft,Et/5*.12,c*.36,.02*a,.01*a,I),x.push(g(ft,r+.004*a+.012*a,-l-c*.36-.012*a))}const T=as([w]);te(t,e,T.cx,T.y1,T.w*.5,.045*a,.34);const F=n.depth(M(p)),_=o0(n),q=n0(n,[255,196,80],[92,54,10],[255,222,150]),D=G=>q(G[2]<0?[-G[0],-G[1],-G[2]]:G),O=.024*a,K=.019*a;for(const G of W)n.depth(G)<F&&Co(t,n,G,O,"pearl");for(const G of x)n.depth(G)<F&&Co(t,n,G,K,"gold");Kn(t,[{parts:[S],shade:Jl(n,[150,22,44])},{parts:[w],shade:_,bias:.01*a},{parts:[y],shade:_,bias:.012*a},{parts:[C],shade:_,bias:.012*a},{parts:E,shade:D,cull:!1,flat:!0},{parts:I,shade:D,cull:!1,flat:!0}],n.px);const U=[[208,20,60],[30,150,92],[36,90,220],[36,90,220],[30,150,92]];for(let G=0;G<5;G++)for(const[ut,ft]of[[A+G/5*Et,"stone"],[A+G/5*Et+Math.PI/5,"stud"]]){const xt=m([Math.cos(ut),0,h*Math.sin(ut)]);if(n.dir(xt)[2]<.12)continue;const it=g(ut,r+.01*a,-l*.5);if(ft==="stud"){Co(t,n,it,.013*a,"gold");continue}const z=(G===0?.034:.027)*a;Co(t,n,it,z*1.3,"gold");const L=m([-Math.sin(ut),0,h*Math.cos(ut)]);e1(t,n,No(it,xt,.006*a),xt,L,z,U[G])}for(const G of W)n.depth(G)>=F&&Co(t,n,G,O,"pearl");for(const G of x)n.depth(G)>=F&&Co(t,n,G,K,"gold");const nt=.034*a,dt=M(p-k-nt*.75),pt=m([0,-1,0]),Tt=(G,ut,ft)=>jo(n,G,xt=>[ut[0]+(ft[0]-ut[0])*xt,ut[1]+(ft[1]-ut[1])*xt,ut[2]+(ft[2]-ut[2])*xt],m([0,0,1]),Pe(.009*a,.009*a,.5),2,6),j=No(dt,pt,nt*.8),N=No(dt,pt,nt*.8+.075*a),Q=No(dt,pt,nt*.8+.05*a),Ot=m([1,0,0]);Co(t,n,dt,nt,"gold"),Kn(t,[{parts:[Tt("crown:barV",j,N)],shade:_},{parts:[Tt("crown:barH",No(Q,Ot,-.026*a),No(Q,Ot,.026*a))],shade:_}],n.px)}function h1(t,n,o,e,a){const s=o.right-o.left,l=.34*Math.max(.5*s,o.topR-o.topL)+.06*s,c=.32*s,h=l*1.55,d=[50,Ie(o,.5)+.05*s,0],f=0,u=-.1,i=k=>Me(d,Ko(k,f,u)),m=bn(n,Et*l,24,48),g=bn(n,c,8,20,6),M=An(n,"tophat:crown",(k,A)=>{const S=k*Et,E=l*(1-.02*A);return i([E*Math.cos(S),-c*A,E*Math.sin(S)])},m,g,i([0,-c*.5,0])),b=An(n,"tophat:top",(k,A)=>{const S=k*Et,E=l*A;return i([E*Math.cos(S),-c,E*Math.sin(S)])},m,2,i([0,-c-.1,0])),w=An(n,"tophat:brim",(k,A)=>{const S=k*Et,E=l+(h-l)*A;return i([E*Math.cos(S),-.012*s*Math.sin(A*Math.PI),E*Math.sin(S)])},bn(n,Et*h,32,64),2,i([0,.02,0])),v=Te(n,"tophat:band",i,l*1.005,-c*.72,.028*s,1,m,4),y=Qn(e),C=Qn(fn(e,.2)),p=as([w]);te(t,a,p.cx,p.y1-.02*s,l*1.05,.05*s,.34),Kn(t,[{parts:[b,M],shade:Uo(n,y,1.45)},{parts:[w],shade:Uo(n,y,1.15)},{parts:[v],shade:Gs(n,C)}],n.px)}function f1(t,n,o,e,a){const s=o.right-o.left,l=.34*Math.max(.5*s,o.topR-o.topL)+.06*s,c=[50,Ie(o,.5)+.05*s,0],h=Math.max(.42*s,Math.min(.6*s,c[1]+32-.08*s)),d=-.12,f=-.12,u=S=>Me(c,Ko(S,d,f)),i=.14*s,m=bn(n,Et*l,20,40),g=bn(n,h,10,24,6),M=An(n,"wizard:cone",(S,E)=>{const I=S*Et,W=l*(1-E),x=i*E*E,$=.02*s*E*E;return u([W*Math.cos(I)+x,-h*E,W*Math.sin(I)+$])},m,g,(S,E)=>u([i*E*E,-h*E,.02*s*E*E])),b=l+.18*s,w=An(n,"wizard:brim",(S,E)=>{const I=S*Et,W=l+(b-l)*E;return u([W*Math.cos(I),.03*s*Math.sin(E*Math.PI),W*Math.sin(I)])},bn(n,Et*b,32,64),2,u([0,.02,0])),v=Te(n,"wizard:band",u,l*1.01,-.02*s,.028*s,1,m,4),y=Qn(e),C=Qn(fn(e,.14)),p=as([w]);te(t,a,p.cx,p.y1-.03*s,l*1.05,.05*s,.32);const k=Kn(t,[{parts:[M],shade:vo(n,y,.96)},{parts:[w],shade:vo(n,y,.9)},{parts:[v],shade:Gs(n,C)}],n.px),A=de(k);rs(t,A,.4,.12),ls(t,A,e,29,.35,n.px)}function u1(t,n,o,e,a){const s=o.right-o.left,l=.36*Math.max(.5*s,o.topR-o.topL)+.08*s,c=[50,Math.max(o.top-.05*s,14),0],h=g=>Me(c,Ko(g,0,-.5)),d=bn(n,Et*l,40,72),f=n.toScreen(c),u=l*1.3;t.save();const i=t.createRadialGradient(f[0],f[1],0,f[0],f[1],u);i.addColorStop(0,"rgba(255,224,130,0.28)"),i.addColorStop(1,"rgba(255,224,130,0)"),t.fillStyle=i,t.beginPath(),t.arc(f[0],f[1],u,0,Math.PI*2),t.fill(),t.restore();const m=Te(n,"halo:torus",h,l,0,.02*s,1,d,6);Kn(t,[{parts:[m],shade:o0(n)}],n.px)}function d1(t,n,o,e,a){const s=o.right-o.left,r=[50-.2*s,Ie(o,.42)+.02*s,0],l=.11*s,c=u=>Me(r,Ko(u,-.2,-.18)),h=Qn(e),d=5;for(let u=0;u<d;u++){const i=u/d*Et+.2,m=Math.cos(i)*l*.8,g=-Math.sin(i)*l*.4;Co(t,n,c([m,g,.14*l]),l*.62,Go(h,1.06))}Co(t,n,c([0,0,.22*l]),l*.34,"gold");const f=An(n,"flower:leaf",(u,i)=>{const m=-.5-i*.4,g=l*(.4+1.1*u);return c([g*Math.cos(m)-.02*s,-g*Math.sin(m)*.5+.06*s,.02*l])},1,2,c([0,0,-.1]));Kn(t,[{parts:[f],shade:vo(n,[72,120,66],.9)}],n.px)}function p1(t,n,o,e,a,s,r){if(o.facing<.05)return;const l=e.right-e.left,c=e.bottom-.2*l,h=Math.max(0,Math.min(e.widths.length-1,Math.round((c+st)/e.step))),d=Math.max(.26*l,Math.min(.42*l,e.widths[h]*.46)),f=Qn(a),u=jo(n,"scarf:band",y=>{const C=50+(2*y-1)*d;return[C,c,s(C,c)*.9]},[0,1,0],Pe(.052*l,.05*l,.5),24,6),i=50-.2*l,m=Math.min(.26*l,e.bottom-.06*l-c),g=m>.04*l?jo(n,"scarf:tail",y=>[i,c+m*y*y,s(i,c+m*y)*.9],[0,0,1],Pe(.046*l,.03*l,.6),10,6):null,M=n.toScreen([50,c+.02*l,s(50,c)*.9]);te(t,r,M[0],M[1],d*1.1,.05*l,.28);const b=[u];g&&b.push(g);const w=Kn(t,[{parts:b,shade:vo(n,f,.95)}],n.px),v=de(w);rs(t,v,.5,.12),ls(t,v,a,47,.3,n.px)}function m1(t,n,o){const e=n.right-n.left,a=.15*e,s=1.1,r=.05*e,l=.068*e,c=n.mid-.07*e,h=.5,d=Qn(o),f=Qn(fn(o,-.12)),u=Qn(fn(o,.08)),i=bn(t,Et*a,20,40),m=[],g=[],M=[],b=[],w=t1(t);for(const j of[-1,1]){const N=[j*Math.cos(h),0,Math.sin(h)],Q=[0,1,0],Ot=[-Math.sin(h),0,j*Math.cos(h)],G=[(j<0?n.left:n.right)-j*.02*e,c,.01*e],ut=($t,Rt,vt)=>{const on=Math.cos(vt)*s*Rt,yn=Math.sin(vt)*Rt;return[G[0]+N[0]*$t+Q[0]*on+Ot[0]*yn,G[1]+N[1]*$t+Q[1]*on+Ot[1]*yn,G[2]+N[2]*$t+Q[2]*on+Ot[2]*yn]},ft=$t=>No(G,N,$t);b.push({c:G,ry:a*s});const xt=a*.9-r*.5,it=i>=48?1:0,z=An(t,`phones:cushion${j}`,($t,Rt)=>{const vt=$t*Et,on=Rt*Math.PI,yn=1+.006*it*Math.sin(vt*24)*Math.sin(on);return ut(r*.5*(1-Math.cos(on)),(xt+r*.62*Math.sin(on))*yn,vt)},i,5,($t,Rt)=>ft(r*.5*(1-Math.cos(Rt*Math.PI)))),L=An(t,`phones:shell${j}`,($t,Rt)=>{const vt=Rt*(Math.PI/2);return ut(r+l*Math.pow(Math.sin(vt),.55),a*(.7+.3*Math.pow(Math.cos(vt),.55)),$t*Et)},i,5,ft(r+l*.5)),bt=.66*a,H=.017*e,Lt=An(t,`phones:ring${j}`,($t,Rt)=>ut(r+l+H*.45*Math.sin(Rt*Et),bt+H*Math.cos(Rt*Et),$t*Et),i,5,$t=>ut(r+l,bt,$t*Et)),It=bt-H*.5,Cn=An(t,`phones:plate${j}`,($t,Rt)=>ut(r+l+.013*e*(1-Rt*Rt),It*Rt,$t*Et),i,3,ft(r+l-.02*e)),qt=r+l*.45,Mn=a*1.04+.022*e,en=$t=>{const Rt=$t*Math.PI,vt=-Math.sin(Rt)*s*Mn,on=Math.cos(Rt)*Mn;return[G[0]+N[0]*qt+Q[0]*vt+Ot[0]*on,G[1]+N[1]*qt+Q[1]*vt+Ot[1]*on,G[2]+N[2]*qt+Q[2]*vt+Ot[2]*on]},gn=jo(t,`phones:yoke${j}`,en,N,Pe(.013*e,.008*e,.6),bn(t,Math.PI*Mn,12,24),6);g.push(en(0),en(1)),M.push(en(.5)),m.push({parts:[z],shade:Uo(t,f,.35)},{parts:[L],shade:Uo(t,d,.8)},{parts:[Lt],shade:w,bias:.02*e},{parts:[Cn],shade:Uo(t,u,1.3),bias:.01*e},{parts:[gn],shade:w})}const[v,y]=M,C=(v[2]+y[2])/2,p=(v[0]+y[0])/2,k=(y[0]-v[0])/2,A=(v[1]+y[1])/2,S=j=>.005*e+.022*e*Math.pow(Math.sin(Math.PI*j),.35),E=2/2.2,I=j=>{let N=1/0;const Q=n.hull;for(let Ot=0;Ot<Q.length;Ot++){const G=Q[Ot],ut=Q[(Ot+1)%Q.length];G[0]===ut[0]||j<Math.min(G[0],ut[0])||j>Math.max(G[0],ut[0])||(N=Math.min(N,G[1]+(ut[1]-G[1])*(j-G[0])/(ut[0]-G[0])))}return N};let W=A-n.top;for(let j=1;j<64;j++){const N=Math.PI*(1-j/64),Q=Math.pow(Math.abs(Math.sin(N)),E),Ot=I(p+k*ce(Math.cos(N),E));Q>.05&&Number.isFinite(Ot)&&(W=Math.max(W,(A-Ot+2*S(j/64)+.006*e)/Q))}const x=j=>{const N=Math.PI*(1-j);return[p+k*ce(Math.cos(N),E),A-W*Math.pow(Math.abs(Math.sin(N)),E),C]},$=(j,N)=>Q=>x(j+(N-j)*Q),T=[0,0,1],F=k*2+W*2,_=bn(t,F,24,48),q=.09,D=.016*e,O=ri($(q,1-q),T,()=>D),K=j=>hr(Math.min(j,1-j)/.07),U=jo(t,"phones:bandShell",O,T,(j,N)=>{const Q=K(j);return[(.024+.016*Q)*e*ce(Math.cos(N),.4),(.008+.008*Q)*e*ce(Math.sin(N),.4)]},_,6),nt=ri($(q+.02,1-q-.02),T,j=>-S(q+.02+(1-2*q-.04)*j)),dt=jo(t,"phones:bandPad",nt,T,(j,N)=>[.034*e*ce(Math.cos(N),.5),S(q+.02+(1-2*q-.04)*j)*ce(Math.sin(N),.7)],_,6),pt=[$(0,q+.03),$(1-q-.03,1)].map((j,N)=>jo(t,`phones:slider${N}`,j,T,Pe(.022*e,.006*e,.4),4,6));m.push({parts:[U],shade:Uo(t,d,.9)},{parts:[dt],shade:Uo(t,f,.3)},{parts:pt,shade:w});const Tt=[];for(let j=0;j<=48;j++)Tt.push(No(nt(.04+.92*j/48),T,.034*e+.001*e));return{layers:m,pivots:g,pivotR:.017*e,stitch:Tt,seats:b}}let Ne=null;function ur(t,n,o,e,a,s){const r=`${n.m.join()}|${n.px}|${n.L.join()}|${e}`;(!Ne||Ne.m!==o||Ne.key!==r)&&(Ne={m:o,key:r,ph:m1(n,o,e)});const l=Ne.ph,c=o.right-o.left,h=d=>a==="front"?d>=0:d<0;if(a==="front")for(const d of l.seats){if(n.depth(d.c)<0)continue;const f=n.toScreen(d.c);te(t,s,f[0],f[1]+.01*c,.06*c,d.ry*1.05,.26)}Kn(t,l.layers.map(d=>({...d,keep:h})),n.px);for(const d of l.pivots)h(n.depth(d))&&Co(t,n,d,l.pivotR,"silver");if(a==="front"&&c*n.px>120&&n.dir([0,0,1])[2]>.3){const d=l.stitch.map(f=>n.toScreen(f));t.save(),t.setLineDash([.022*c,.014*c]),t.lineCap="round",t.lineWidth=.0045*c,t.strokeStyle=fn(e,.12),t.globalAlpha=.55,t.stroke(ns(d,!1)),t.restore()}}function M1(t,n,o,e,a,s,r,l,c=!1){if(o.facing<.05)return;const h=e.right-e.left,d=l.y+22*l.scale,f=Math.max(d,e.bottom-.15*h),u=Math.max(0,e.bottom-3-f),i=Math.min(h,100)*Math.max(.5,Math.min(1,u/15)),m=s(50,f),g=(I,W,x)=>[50+I*i,f+W*i,m+x*i],M=Qn(a),b=[g(-.36,-.18,0),g(.36,.18,0),g(-.36,.18,0),g(.36,-.18,0)].map(I=>n.toScreen(I)),w=is(b),v=n.toScreen(g(.01,.08,0));te(t,r,v[0],v[1],w.w*.52,w.h*.5,.3);const y=bn(n,.32*i,8,16),C=bn(n,.3*i,8,16,6),p=`${m.toFixed(2)},${f.toFixed(2)},${i.toFixed(2)}`,k=!!c,A=k?vo(n,M):Gs(n,M),S=[];for(const I of[-1,1]){const W=(x,$)=>{const T=.058+.3*x-.035*Math.pow(x,4)*Math.sin(Math.PI*$),_=-(.05+.12*Math.pow(x,.8))*Math.cos(Math.PI*$)+.012*x*x,q=.018+.058*Math.sin(Math.PI*(.12+.88*x)),D=.016*Math.sin(3*Math.PI*$)*Math.pow(1-x,1.3);return g(I*T,_,(q+D)*Math.sin(Math.PI*$)+.004)};S.push({parts:[An(n,`bow:wing${I}@${p}`,W,y,C,x=>g(I*(.058+.3*x),0,-.03))],shade:A}),S.push({parts:[An(n,`bow:end${I}@${p}`,(x,$)=>{const T=W(1,$);return[T[0],T[1],T[2]-(T[2]-m)*x]},1,C,g(I*.2,0,-.03))],shade:A})}const E=An(n,`bow:knot@${p}`,(I,W)=>{const x=.068*(2*I-1)*(1-.12*Math.sin(Math.PI*W)),$=.075*(2*W-1),T=Math.pow(Math.max(0,1-Math.pow(Math.abs(2*I-1),3)),.5),F=Math.pow(Math.max(0,1-Math.pow(Math.abs(2*W-1),5)),.4);return g(x,$,.012+.075*T*F)},6,6,g(0,0,-.02));if(S.push({parts:[E],shade:k?vo(n,M,.9):Gs(n,Go(M,.9))}),!k){Kn(t,S,n.px);return}for(let I=0;I<S.length;I+=2){const W=S.slice(I,I+2),x=de(Kn(t,W,n.px));rs(t,x,.5,.1),ls(t,x,a,41+I,.3,n.px)}}const li={round:{rx:10.8,ry:10.8,n:2,tr:1.15,td:1.2},square:{rx:12,ry:9.6,n:4.2,tr:1.45,td:1.4},shades:{rx:12.6,ry:10,n:3.4,tr:1.6,td:1.5}};function ci(t,n,o,e,a,s={yaw:0,pitch:0}){if(n==="none")return;os=li;const r=li[n],l=Math.cos(s.yaw),c=Math.sin(s.yaw),h=Math.cos(s.pitch),d=Math.sin(s.pitch),{L:f,H:u}=rr(e.lx,e.ly),i=er([l,0,c,d*c,h,-d*l,-h*c,d,h*l],[0,0,0],f,u,e0(t)),m=Math.max(o[0].fz,o[1].fz)+3.2,g=x=>m-.0045*x*x,M=2/r.n,b=(x,$)=>T=>{const F=T*Et,_=x.ox+(r.rx+$)*ce(Math.cos(F),M),q=x.oy+(r.ry+$)*ce(Math.sin(F),M);return[_,q,g(_)]},w=(x,$,T=48)=>{const F=b(x,$),_=[];for(let q=0;q<T;q++)_.push(i.toScreen(F(q/T)));return _},v=o.map(x=>Math.max(0,Math.min(1,(x.z-.18)*3.2)));if(a==="shadow"){for(let x=0;x<2;x++)v[x]<=0||(t.save(),t.globalAlpha=.22*v[x],t.translate(-e.lx*1.6,-e.ly*1.6+.8),t.lineWidth=r.tr*2+.6,t.lineJoin="round",t.strokeStyle="#000",t.stroke(ns(w(o[x],0))),t.restore());return}const C=Uo(i,[22,22,26],1.1);for(let x=0;x<2;x++){if(v[x]<=0)continue;const $=ns(w(o[x],-r.tr*.5)),T=is(w(o[x],0,16));if(t.save(),t.globalAlpha=v[x],n==="shades"){const O=t.createLinearGradient(T.cx,T.y0,T.cx,T.y1);O.addColorStop(0,"rgba(58,60,78,0.97)"),O.addColorStop(.55,"rgba(18,18,26,0.98)"),O.addColorStop(1,"rgba(30,26,44,0.98)"),t.fillStyle=O}else{const O=t.createLinearGradient(T.cx,T.y0,T.cx,T.y1);O.addColorStop(0,"rgba(236,244,255,0.26)"),O.addColorStop(.45,"rgba(214,230,255,0.08)"),O.addColorStop(1,"rgba(214,230,255,0.14)"),t.fillStyle=O}t.fill($),t.clip($);const F=T.w,_=T.h,q=(O,K,U)=>{t.globalAlpha=v[x]*U,t.fillStyle="#fff",t.beginPath(),t.moveTo(T.x0+F*O,T.y1+_*.1),t.lineTo(T.x0+F*(O+.55),T.y0-_*.1),t.lineTo(T.x0+F*(O+.55+K),T.y0-_*.1),t.lineTo(T.x0+F*(O+K),T.y1+_*.1),t.closePath(),t.fill()},D=n==="shades"?1.4:1;q(-.28,.26,.16*D),q(.06,.07,.3*D),t.restore()}const p=bn(i,Et*r.rx*1.1,28,56,8),k=x=>jo(i,`rim:${n}:${x.ox},${x.oy},${x.fz.toFixed(2)}`,b(x,0),[0,0,1],Pe(r.td,r.tr,.55),p,6,!0),[A,S]=o,E=x=>{const $=n==="round",T=[A.ox+r.rx*($?.9:.98),A.oy-r.ry*($?.32:.42),0],F=[S.ox-r.rx*($?.9:.98),S.oy-r.ry*($?.32:.42),0],_=[0,(A.oy+S.oy)/2-r.ry*($?.8:.6),0],q=1-x,D=q*q*T[0]+2*q*x*_[0]+x*x*F[0],O=q*q*T[1]+2*q*x*_[1]+x*x*F[1];return[D,O,g(D)+.3]},I=jo(i,`bridge:${n}:${A.ox},${A.oy},${S.ox},${m.toFixed(2)}`,E,[0,0,1],Pe(r.td*.8,r.tr*.75,.7),8,6),W=[{part:k(A),a:v[0],d:i.depth([A.ox,A.oy,m])},{part:k(S),a:v[1],d:i.depth([S.ox,S.oy,m])},{part:I,a:Math.min(v[0],v[1]),d:i.depth([0,A.oy,m])}].sort((x,$)=>x.d-$.d);for(const x of W)x.a<=0||(t.save(),t.globalAlpha=x.a,Kn(t,[{parts:[x.part],shade:C}],i.px),t.restore());for(const[x,$,T]of[[A,-1,v[0]],[S,1,v[1]]]){if(T<=0)continue;t.save(),t.globalAlpha=T;const F=x.ox+$*r.rx*.93;Co(t,i,[F,x.oy-r.ry*.5,g(F)+r.td],.75,"silver"),t.restore()}}function g1(t,n,o,e){if(!e.headphones)return;const a=ir(n);a&&(os=a,ur(t,lr(o,e0(t)),a,e.color,"behind",null))}function b1(t,n,o,e,a,s,r){const l=ir(n);if(!l)return;os=l;const c=lr(o,e0(t));switch(e.bowTie&&M1(t,c,o,l,e.color,s,a,r,e.fabric),e.scarf&&p1(t,c,o,l,e.color,s,a),e.headphones&&ur(t,c,l,e.color,"front",a),e.hat){case"beret":i1(t,c,l,e.color,a);break;case"beanie":r1(t,c,l,e.color,a);break;case"party":l1(t,c,l,e.color,a);break;case"crown":c1(t,c,l,a);break;case"tophat":h1(t,c,l,e.color,a);break;case"wizard":f1(t,c,l,e.color,a);break;case"halo":u1(t,c,l,e.color);break;case"flower":d1(t,c,l,e.color);break}}const Lo=1.5,xe=.1,Ae=17,y1=15,k1=.9,hi=(t,n)=>n+(1-n)*Math.sqrt(Math.max(0,1-t*t)),w1=25,C1=6.3,A1={eyes:1,mouth:-3.5},vs=new Map;function v1(t,n,o){const e=`${t}|${n}|${o}`;let a=vs.get(e);if(!a){const s=fn(t,-.3*n,.05*n),r=fn(t,-.12*n,.03*n),l=[],c=[];for(let h=0;h<Ae;h++){const d=h/(Ae-1);l.push(d>.6?"":ui(s,r,d/.6)),c.push(d>=.5?t:ui(s,t,d/.5))}a={base:t,far:s,near:r,light:fn(t,.04*o),dark:fn(t,-.3*n,.05*n),capTop:fn(t,.035*o),capBottom:fn(t,-.035*n),crispMix:l,smoothMix:c,grad:null},vs.size>200&&vs.clear(),vs.set(e,a)}return a}const fi=t=>(t.startsWith("hsl(")?t:fn(t,0)).match(/[\d.]+/g).map(Number);function ui(t,n,o){const e=fi(t),a=fi(n),s=e.map((r,l)=>r+(a[l]-r)*o);return`hsl(${s[0].toFixed(1)} ${s[1].toFixed(1)}% ${s[2].toFixed(1)}%)`}const $e=34,S1=Math.PI*1.55,x1=57,P1=.4,di=-.28,Ss=new Map;function T1(t){let n=Ss.get(t);return n||(n={base:fn(t,.1,.02),light:fn(t,.3,.04),dark:fn(t,-.22,.08),halo:fn(t,.2)},Ss.size>200&&Ss.clear(),Ss.set(t,n)),n}const xs=(t,n)=>t.replace(")",` / ${Math.max(0,Math.min(1,n)).toFixed(3)})`);function pi(t,n,o,e,a,s,r){const l=r?.strength??0,c=Math.min(1,n.whirl*l);if(c<=.01)return;const h=r?.size??1,d=r?.width??1,f=r?.length??1,u=r?.tilt??1,i=S1*f,m=T1(o),g=-n.whirlAngle,M=x1*h,b=M*P1*u*(s?1.14:.86),w=Math.atan2(a,e)-di;t.save(),t.rotate(di),t.translate(0,5),t.lineCap="butt";const v=(y,C,p,k,A)=>{t.strokeStyle=k,t.lineWidth=p,t.beginPath(),t.ellipse(0,A,M,b,0,y,C,!1),t.stroke()};if(s)for(let y=0;y<$e;y++){const C=y/$e,p=g+C*i,k=p+i/$e+.012;if(Math.sin((k+p)/2)<=0)continue;const A=Math.pow(1-C,1.3);v(p,k,(2+8*A)*1.5*d,`rgba(0,0,0,${(.2*c*A).toFixed(3)})`,3.5)}for(let y=0;y<$e;y++){const C=y/$e,p=g+C*i,k=p+i/$e+.012,A=(k+p)/2;if(Math.sin(A)>0!==s)continue;const S=.6+.4*Math.sin(A),E=Math.pow(1-C,1.3),I=1+.18*Math.sin(C*9+1.2),W=(2+8*E)*S*d*I,x=c*(.3+.7*E)*S,$=.5+.5*Math.cos(A-w);v(p,k,W*2.6,xs(m.halo,x*.2),0),v(p,k,W*.8,xs(m.dark,x*.45),W*.32),v(p,k,W,xs(m.base,x*.72),0),v(p,k,W*.62,xs(m.light,x*.78*(.4+.6*$)),-W*.16),v(p,k,W*.24,`rgba(255,255,255,${(x*.9*(.15+.85*$*$)).toFixed(3)})`,-W*.3)}t.restore()}const I1=(t,n)=>{if(typeof OffscreenCanvas=="function")return new OffscreenCanvas(t,n);if(typeof document<"u"){const o=document.createElement("canvas");return o.width=t,o.height=n,o}return null},mi=new WeakMap;function Da(t,n){let o=mi.get(t);o||mi.set(t,o=[]);let e=o[n];if(!e||e.canvas.width!==t.width||e.canvas.height!==t.height){const a=I1(t.width,t.height),s=a&&a.getContext("2d");if(!s)return null;e=o[n]=s}return e.setTransform(1,0,0,1,0,0),e.globalCompositeOperation="source-over",e.globalAlpha=1,e.clearRect(0,0,t.width,t.height),e}const F1=.56,mo=t=>{const n=Math.sin(t*127.1+311.7)*43758.5453;return n-Math.floor(n)},dr=t=>{let n=0;for(let o=0;o<t.length;o++)n=n*31+t.charCodeAt(o)|0;return Math.abs(n%997)/997};function s0(t){let n=me(t)??[255,255,255];const o=Math.max(n[0],n[1],n[2],1),e=Math.min(n[0],n[1],n[2]),a=1-Math.min(1,Math.max(0,((o-e)/o-.08)/.22));a>0&&(n=[n[0]+(30-n[0])*a,n[1]+(225-n[1])*a,n[2]+(255-n[2])*a]);const s=Math.max(n[0],n[1],n[2],1),r=[n[0]/s*255,n[1]/s*255,n[2]/s*255];return{base:r,alt:[r[2],r[0],r[1]]}}const Jo=(t,n)=>`rgba(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${Math.max(0,Math.min(1,n)).toFixed(3)})`;function L1(t,n,o,e,a,s){const{base:r,alt:l}=s0(s),c=.86+.14*Math.sin(a*2.2);t.save(),t.transform(o[0],o[1],o[2],o[3],o[4],o[5]),t.globalCompositeOperation="lighter",t.lineWidth=3.4,t.shadowColor=Jo(r,.95*c),t.shadowBlur=15*e,t.strokeStyle=Jo(r,.5*c),t.stroke(n),t.shadowColor=Jo(l,.8*c),t.shadowBlur=26*e,t.lineWidth=1.6,t.strokeStyle=Jo(l,.28*c),t.stroke(n),t.restore()}const La=3.4,Mi=.4;function E1(t,n,o,e){const a=o+e*La,s=Math.floor(a/La),r=a-s*La;if(r>Mi)return;const l=Math.floor(a*24),c=(1-(r/Mi)**2)*(.7+.3*mo(l+s)),h=t.canvas,d=h.width,f=h.height,u=Da(h,0),i=Da(h,1);if(!u||!i)return;u.drawImage(h,0,0),t.save(),t.setTransform(1,0,0,1,0,0);const m=l*7+s*131;for(let M=0;M<7;M++){if(mo(m+M*1.7)>.62)continue;const b=mo(m+M*3.1)*f*.88+f*.06,w=(.02+.07*mo(m+M*4.3))*f,v=(mo(m+M*5.9)-.5)*2*13*n*c;t.clearRect(0,b,d,w),t.drawImage(u.canvas,0,b,d,w,v,b,d,w)}const g=2.6*n*c;t.globalCompositeOperation="lighter";for(const[M,b]of[["#ff2a3d",1],["#1ee6ff",-1]])i.globalCompositeOperation="source-over",i.clearRect(0,0,d,f),i.drawImage(h,0,0),i.globalCompositeOperation="multiply",i.fillStyle=M,i.fillRect(0,0,d,f),i.globalCompositeOperation="destination-in",i.drawImage(h,0,0),t.globalAlpha=.42*Math.min(1,c*1.3),t.drawImage(i.canvas,b*g,0);t.globalAlpha=1,t.globalCompositeOperation="source-over";for(let M=0;M<3;M++){if(mo(m+M*9.1)>.55)continue;const b=(.08+.12*mo(m+M*2.2))*d,w=(.025+.04*mo(m+M*6.6))*f,v=mo(m+M*1.3)*(d-b),y=mo(m+M*8.8)*(f-w);t.drawImage(u.canvas,v,y,b,w,v+(mo(m+M*3.7)-.5)*.2*d*c,y+(mo(m+M*5.3)-.5)*.05*f,b,w)}t.globalCompositeOperation="source-atop",t.fillStyle=`rgba(210,250,255,${(.28*c).toFixed(3)})`;for(let M=0;M<4;M++)t.fillRect(0,mo(m+M*11.3)*f,d,Math.max(1,n*.5));t.restore()}const $1=t=>{if(t===void 0||!Number.isFinite(t))return{};const n=t*Math.PI/180;return{bx:Math.sin(n),by:-Math.cos(n)}},Qs={fabric:{shadow:1.15,highlight:1.45,light:295,rim:.6,spread:1.6},other:{shadow:.35,highlight:1.3,light:300,rim:.5,spread:1.55}};function Ks(t,n,o,e){const a=n*Lo;t.clearRect(0,0,a,a);const s=n/100;let r,l;if(e.dpr!==void 0)r=e.dpr,l=[r,0,0,r,0,0];else if(t.getTransform){const qt=t.getTransform();l=[qt.a,qt.b,qt.c,qt.d,qt.e,qt.f],r=qt.a||1}else r=1,l=[1,0,0,1,0,0];const c=Qs[e.shading==="fabric"?"fabric":"other"],h=e.shadow??c.shadow,d=e.highlight??c.highlight,f=y1*(e.depth??.65),u=e.rim??c.rim,i=1-(1-k1)*u,m=e.spread??c.spread,g=(e.light??c.light)*Math.PI/180,M=Math.sin(g),b=-Math.cos(g),w=v1(e.color,h,d),v=Math.cos(o.yaw),y=Math.sin(o.yaw),C=Math.cos(o.pitch),p=Math.sin(o.pitch),k=v*C,A=qt=>Math.abs(qt)<.22?qt<0?-.22:.22:qt,S=A(v),E=A(C),I=Math.cos(o.roll),W=Math.sin(o.roll),x=o.sx*s,$=o.sy*s,T=50*(1-o.sy)*s,F=Ce(l,[I*x,W*x,-W*$,I*$,a/2+o.x*s-W*T,a/2+xe*n+o.y*s+I*T]);t.save(),t.setTransform(F[0],F[1],F[2],F[3],F[4],F[5]),t.lineCap="round",t.lineJoin="round";const _=e.shading,q=(e.time??0)*.001,D=(qt,Mn,en,gn=!0)=>{let $t=w.near,Rt=w.base;if(_==="crisp"){if(!w.grad||w.grad.lx!==M||w.grad.ly!==b||w.grad.mode!==_){const Y=t.createLinearGradient(M*56,b*56,-M*56,-b*56);Y.addColorStop(0,w.light),Y.addColorStop(.45,w.near),Y.addColorStop(1,w.dark);const lt=t.createLinearGradient(M*46,b*46,-M*46,-b*46);lt.addColorStop(0,w.capTop),lt.addColorStop(1,w.capBottom),w.grad={lx:M,ly:b,mode:_,lit:Y,cap:lt}}$t=w.grad.lit,Rt=w.grad.cap}const vt=_==="plastic"||_==="fabric"||_==="metal"||_==="glass"||_==="neon";let on=!1;vt&&(on=Gl(t,{...e,path:qt,typeKey:Mn,shading:gn||_!=="fabric"?_:"plastic"},{cy:S,sy:y,cp:E,sp:p,facing:k,roll:o.roll,halfDepth:en,lx:M,ly:b,...$1(e.backLight),dev:n*r,ctm:F,still:e.still,round:e.roundness??1},w,null,{shadow:h,highlight:d,spread:m,rim:u,vivid:e.vivid??0,front:Math.min(85,Math.max(0,e.lightFront??32))*Math.PI/180,shine:e.shine??0,sheen:e.sheen??0,backSoft:e.backSoftness??1}));const yn=vt&&!on?"smooth":_,io=yn==="smooth",Mo=io&&typeof Path2D=="function"?new Path2D:null,J=k>=0?1:-1,[Mt,Ht,Kt,vn,ln,Sn]=F;let _n=null,ro=1,Ln=0,Jn=0,Bn=1,ne=0,go=0;for(let Y=0;Y<Ae&&!on;Y++){const at=-1+2*(J>0?Y:Ae-1-Y)/(Ae-1),gt=hi(at,i),St=Y/(Ae-1),Pt=S*gt,an=y*p*gt,rt=E*gt,un=at*y*en-50*Pt,En=-at*S*p*en-50*an-50*rt,cn=ro*Bn-Ln*Jn,qn=Bn/cn,Yn=-Ln/cn,dn=-Jn/cn,xn=ro/cn,Vn=(Jn*go-Bn*ne)/cn,So=(Ln*ne-ro*go)/cn;t.transform(qn*Pt+dn*an,Yn*Pt+xn*an,dn*rt,xn*rt,qn*un+dn*En+Vn,Yn*un+xn*En+So),ro=Pt,Ln=an,Jn=0,Bn=rt,ne=un,go=En;let Qt;io?Qt=w.smoothMix[Y]:Y===Ae-1?Qt=Rt:St>.6?Qt=$t:Qt=w.crispMix[Y],Qt!==_n&&(t.fillStyle=_n=Qt),t.fill(qt),Mo&&Mo.addPath(qt,{a:Pt,b:an,c:0,d:rt,e:un,f:En})}if(on||t.setTransform(Mt,Ht,Kt,vn,ln,Sn),Mo&&yn==="smooth"){t.save(),t.clip(Mo);const Y=Math.min(1,.34*h),lt=t.createRadialGradient(-M*45,-b*45,4*m,-M*45,-b*45,84*m);lt.addColorStop(0,`rgba(0,0,0,${Y})`),lt.addColorStop(.5,`rgba(0,0,0,${Y*.35})`),lt.addColorStop(1,"rgba(0,0,0,0)"),t.globalCompositeOperation="multiply",t.fillStyle=lt,t.fillRect(-120,-120,240,240),t.globalCompositeOperation="source-over";const at=Math.min(1,.22*d),gt=t.createRadialGradient(M*37,b*37,0,M*37,b*37,62*m);gt.addColorStop(0,`rgba(255,255,255,${at})`),gt.addColorStop(.6,`rgba(255,255,255,${at*.23})`),gt.addColorStop(1,"rgba(255,255,255,0)"),t.fillStyle=gt,t.fillRect(-120,-120,240,240),t.restore()}return on};pi(t,o,e.color,M,b,!1,e.whirl);const O=e.wear,K=!!O&&(O.hat!=="none"||O.glasses!=="none"||O.headphones||O.bowTie||O.scarf),U={cy:S,sy:y,cp:E,sp:p,facing:k,lx:M,ly:b};K&&g1(t,e.path,U,O);const nt=e.typeKey??"custom",dt=[S,y*p,0,E,-50*S,-50*(y*p+E)],pt=n*r/100,Tt=_==="metal"||_==="glass"||_==="neon";_==="neon"&&L1(t,e.path,dt,pt,q,e.color);const j=t;let N=null;_==="glass"&&(N=Da(t.canvas,2),N&&(N.setTransform(F[0],F[1],F[2],F[3],F[4],F[5]),N.lineCap="round",N.lineJoin="round",t=N));const Q=e.parts?Array.isArray(e.parts)?e.parts:[e.parts]:[];for(let qt=0;qt<Q.length;qt++)D(Q[qt],Array.isArray(e.parts)?`${nt}:parts${qt}/${Q.length}`:`${nt}:parts`,f*(e.partsDepth??.4),!1);const Ot=D(e.path,nt,f);N&&(t=j,j.save(),j.setTransform(1,0,0,1,0,0),j.globalAlpha=F1,j.drawImage(N.canvas,0,0),j.restore()),Tt&&Ot&&O1(t,_,e,dt,{lx:M,ly:b,unit:pt,t:q,box:n});const G=k>=0?1:-1,ut=e.roundness??1,ft=Ot,xt=ft?1:hi(G,i),it=(qt,Mn)=>ft?tl(nt,f,qt,Mn,ut)??.8*f:f*xt,z=ft?.55*it(e.faceX,e.faceY):f,L=S*xt,bt=y*p*xt,H=E*xt,Lt=G*y*z-50*L,It=-G*S*p*z-50*bt-50*H;let Cn=null;if(K&&typeof Path2D=="function"&&(Cn=new Path2D,Cn.addPath(e.path,{a:L,b:bt,c:0,d:H,e:Lt,f:It})),k>-.2){t.save();{const[$t,Rt,vt,on,yn,io]=F;t.setTransform($t*L+vt*bt,Rt*L+on*bt,vt*H,on*H,$t*Lt+vt*It+yn,Rt*Lt+on*It+io),t.clip(e.path),t.setTransform($t,Rt,vt,on,yn,io)}t.translate(e.faceX-50,e.faceY-50),t.scale(e.faceScale,e.faceScale),_==="plastic"&&Ot&&(t.globalAlpha=.93);let qt=e;if(_==="neon"){const $t=s0(e.color);qt={...e,ink:Jo([255-(255-$t.base[0])*.35,255-(255-$t.base[1])*.35,255-(255-$t.base[2])*.35],1)},t.shadowColor=Jo($t.base,.95),t.shadowBlur=5*pt}const Mn=R1(t,o,qt);t.shadowBlur=0,t.shadowColor="rgba(0,0,0,0)",t.globalAlpha=1;const en=O&&O.glasses!=="none"?O.glasses:null,gn={yaw:o.yaw,pitch:o.pitch};en&&ci(t,en,Mn,{lx:M,ly:b},"shadow",gn),t.restore(),en&&(t.save(),t.translate(e.faceX-50,e.faceY-50),t.scale(e.faceScale,e.faceScale),ci(t,en,Mn,{lx:M,ly:b},"frame",gn),t.restore())}K&&b1(t,e.path,U,O,Cn,it,{y:e.faceY,scale:e.faceScale}),pi(t,o,e.color,M,b,!0,e.whirl),t.restore(),q1(t,o,Ce(l,[s,0,0,s,a/2+o.x*s,a/2+xe*n+o.y*s*.25]),e.theme),_==="neon"&&e.time!==void 0&&E1(t,pt,q,dr(nt))}function O1(t,n,o,e,a){const s=o.path;t.save(),t.transform(e[0],e[1],e[2],e[3],e[4],e[5]);const r=a.box>=40;if(n==="metal"){t.globalCompositeOperation="screen",t.strokeStyle="rgba(255,255,255,0.34)",t.lineWidth=1.3,t.stroke(s);const l=4.6,c=1,h=(a.t+dr(o.typeKey??"x")*l)%l;if(h<c){const d=h/c,f=Math.sin(Math.PI*d);t.clip(s),t.translate(50,50),t.rotate(.55);const u=-85+d*170,i=t.createLinearGradient(u-15,0,u+15,0);i.addColorStop(0,"rgba(255,255,255,0)"),i.addColorStop(.5,`rgba(255,255,255,${(.62*f).toFixed(3)})`),i.addColorStop(1,"rgba(255,255,255,0)"),t.fillStyle=i,t.fillRect(-200,-200,400,400)}}else if(n==="glass"){t.globalCompositeOperation="screen";const l=a.lx*1.15,c=a.ly*1.15;t.save(),t.translate(l,c),t.strokeStyle="rgba(110,228,255,0.50)",t.lineWidth=1.9,t.stroke(s),t.restore(),t.save(),t.translate(-l,-c),t.strokeStyle="rgba(255,120,212,0.42)",t.lineWidth=1.7,t.stroke(s),t.restore(),t.strokeStyle="rgba(240,252,255,0.80)",t.lineWidth=.95,t.stroke(s),t.save(),t.clip(s),t.translate(50-a.lx*3.2,50-a.ly*3.2),t.scale(.87,.87),t.translate(-50,-50),t.strokeStyle="rgba(190,236,255,0.22)",t.lineWidth=1.4,t.stroke(s),t.restore(),t.save(),t.clip(s),t.translate(50,50),t.rotate(-.62);const h=t.createLinearGradient(-58,0,58,0);h.addColorStop(0,"rgba(255,255,255,0)"),h.addColorStop(.4,"rgba(255,255,255,0.02)"),h.addColorStop(.5,"rgba(255,255,255,0.20)"),h.addColorStop(.58,"rgba(255,255,255,0.03)"),h.addColorStop(1,"rgba(255,255,255,0)"),t.fillStyle=h,t.fillRect(-160,-160,320,320),t.restore()}else{const{base:l,alt:c}=s0(o.color),h=.9+.1*Math.sin(a.t*13)*Math.sin(a.t*3.1);if(t.globalCompositeOperation="lighter",t.lineJoin="round",t.strokeStyle=Jo(c,.42*h),t.lineWidth=2.6,t.shadowColor=Jo(c,.8),t.shadowBlur=5*a.unit,t.stroke(s),t.strokeStyle=`rgba(255,255,255,${(.55*h).toFixed(3)})`,t.lineWidth=.9,t.shadowColor=Jo(l,.9),t.shadowBlur=3*a.unit,t.stroke(s),t.shadowBlur=0,r){t.save(),t.clip(s),t.fillStyle="rgba(255,255,255,0.045)";const d=a.t*9%4;for(let f=-4+d;f<104;f+=4)t.fillRect(-10,f,120,1.2);t.restore()}}t.restore()}const W1="M0 0.92C-1.35 -0.05 -1 -1 -0.42 -1C-0.16 -1 0 -0.84 0 -0.62C0 -0.84 0.16 -1 0.42 -1C1 -1 1.35 -0.05 0 0.92Z",z1="M0 -1Q0.14 -0.14 1 0Q0.14 0.14 0 1Q-0.14 0.14 -1 0Q-0.14 -0.14 0 -1Z";let gi=null,bi=null;const pr=()=>gi??(gi=new Path2D(W1)),yi=()=>bi??(bi=new Path2D(z1)),_1={happy:0,sleepy:0,questioning:0,loving:0,surprised:0,playful:0},Ra=t=>Math.max(0,Math.min(1,t)),Ha=t=>{const n=Ra(t)-1;return 1+2.70158*n*n*n+1.70158*n*n};function q1(t,n,o,e){const a=n.mood;if(!a||a.sleepy<.01&&a.questioning<.01&&a.surprised<.01&&a.loving<.01&&a.playful<.01)return;const s=e!=="light",r=n.t??0;t.save(),t.setTransform(o[0],o[1],o[2],o[3],o[4],o[5]),t.lineCap="round",t.lineJoin="round";const l=s?"rgba(10,10,30,0.38)":"rgba(255,255,255,0.7)",c=(h,d,f)=>{t.beginPath(),h(),t.strokeStyle=l,t.lineWidth=f+1.8,t.stroke(),t.strokeStyle=d,t.lineWidth=f,t.stroke()};if(a.sleepy>=.01){const h=s?"#BCC8FF":"#5A68D8",d=.4+.6*(n.drowse??.5);for(let f=0;f<3;f++){const u=(r/3.6+f/3)%1,i=Math.min(1,u/.14)*(u>.72?(1-u)/.28:1)*a.sleepy*d;if(i<=.01)continue;const m=3.6+4.4*u;t.save(),t.globalAlpha=i,t.translate(20+22*u+3*Math.sin(u*7+f*2),-38-28*u),t.rotate(-.18+.1*Math.sin(r*1.3+f)),c(()=>{t.moveTo(-m,-m),t.lineTo(m,-m),t.lineTo(-m,m),t.lineTo(m,m)},h,m*.5),t.restore()}}if(a.questioning>=.01){const h=12*Ha(a.questioning);t.save(),t.globalAlpha=Ra(a.questioning*1.6),t.translate(34,-56+2*Math.sin(r*2.6)),t.rotate(.2+.12*Math.sin(r*1.7));const d=s?"#FFD166":"#E39A00";c(()=>{t.arc(0,-.35*h,.65*h,Math.PI*1.05,Math.PI*2.45),t.lineTo(0,.5*h)},d,h*.38),t.beginPath(),t.arc(0,1.05*h,.2*h,0,Math.PI*2),t.fillStyle=l,t.lineWidth=0,t.fill(),t.beginPath(),t.arc(0,1.05*h,.17*h,0,Math.PI*2),t.fillStyle=d,t.fill(),t.restore()}if(a.surprised>=.01){const h=9*Ha(a.surprised),d=1.5*(n.startle??.3),f=s?"#FF7A7A":"#E5322D";for(const u of[-1,1])t.save(),t.globalAlpha=Ra(a.surprised*1.6),t.translate(u*10+Math.sin(r*46+u)*d,-63+Math.cos(r*41+u)*d*.5),t.rotate(u*.16),c(()=>{t.moveTo(0,-h),t.lineTo(0,.2*h)},f,h*.62),t.beginPath(),t.arc(0,.95*h,.31*h,0,Math.PI*2),t.fillStyle=l,t.fill(),t.beginPath(),t.arc(0,.95*h,.27*h,0,Math.PI*2),t.fillStyle=f,t.fill(),t.restore()}if(a.loving>=.01){const h=[-24,10,-6,26,-34];for(let d=0;d<5;d++){const f=(r/3+d/5)%1,u=Math.min(1,f/.15)*(f>.7?(1-f)/.3:1)*a.loving;if(u<=.01)continue;const i=4+4*f;t.save(),t.globalAlpha=u,t.translate(h[d]+4*Math.sin(f*6+d),-46-30*f),t.rotate(.25*Math.sin(f*5+d)),t.scale(i,i),t.fillStyle=s?"#FF6B98":"#F0306A",t.fill(pr()),t.fillStyle="rgba(255,255,255,0.55)",t.beginPath(),t.ellipse(-.42,-.5,.2,.13,-.6,0,Math.PI*2),t.fill(),t.restore()}}if(a.playful>=.01){const h=[[-52,-36,10,0],[46,-46,12,1.7],[60,4,9,3.1],[-58,14,8,4.6],[8,-66,9,5.9]];for(const[d,f,u,i]of h){const m=Math.pow(Math.max(0,Math.sin(r*3.4+i)),1.5)*a.playful;m<=.02||(t.save(),t.translate(d,f),t.rotate(.4*Math.sin(r+i)),t.scale(u*m,u*m),t.fillStyle=s?"#FFD84D":"#F2A900",t.fill(yi()),t.scale(.45,.45),t.fillStyle="#FFFFFF",t.fill(yi()),t.restore())}}t.restore()}const We=30;function ki(t,n,o,e){const a=Math.asin(Math.max(-1,Math.min(1,t/We)))+o,s=Math.asin(Math.max(-1,Math.min(1,-n/We)))+e,r=Math.cos(s);return{x:We*Math.sin(a)*r,y:-We*Math.sin(s),sx:Math.cos(a),sy:r,z:Math.cos(a)*r}}const wi=8,Ps=new Map;function Ci(t,n,o){const e=Math.round(t*50),a=Math.round(n*50),s=Math.round(o*50),r=e+2e3*a+4e6*s;let l=Ps.get(r);if(!l){const c=e/50,h=a/50,d=s/50;let f=`M${-c} ${h}`;for(let u=1;u<=wi;u++){const i=u/wi,m=1-i;f+=` L${(m*m*-c+i*i*c).toFixed(3)} ${((m*m+i*i)*h+2*m*i*d).toFixed(3)}`}l=new Path2D(f),Ps.size>256&&Ps.clear(),Ps.set(r,l)}return l}const Ai=Math.sin(.684),vi=Math.cos(.684),Ts=new Map;function D1(t){const n=A=>Math.round(A*50)/50,o=n(t.hw),e=n(t.t0),a=n(t.a),s=n(t.yt),r=n(t.ab),l=n(t.yb),c=`${o},${e},${a},${s},${r},${l}`;let h=Ts.get(c);if(h)return h;const d=A=>A.toFixed(3),f=e*Ai,u=e*vi,i=-o+f,m=-u,g=o-f,M=-u,b=-o-f,w=u,v=o+f,y=u,C=4/3*e*vi,p=4/3*e*Ai,k=`M${d(i)} ${d(m)}C${d(-o+a*o)} ${d(s-e)} ${d(o-a*o)} ${d(s-e)} ${d(g)} ${d(M)}C${d(g+C)} ${d(M-p)} ${d(v+C)} ${d(y-p)} ${d(v)} ${d(y)}C${d(o-r*o)} ${d(l+e)} ${d(-o+r*o)} ${d(l+e)} ${d(b)} ${d(w)}C${d(b-C)} ${d(w-p)} ${d(i-C)} ${d(m-p)} ${d(i)} ${d(m)}Z`;return h=new Path2D(k),Ts.size>256&&Ts.clear(),Ts.set(c,h),h}function R1(t,n,o){const[e,a,s]=n.w,r=o.ink,l=A1[o.face],c=w1/2,h=n.lookX,d=n.lookY,{yaw:f,pitch:u}=n,i=(F,_,q,D=1)=>{const O=ki(F,_,f,u);O.z<=.02||D<=.01||(t.save(),t.globalAlpha=D*Math.min(1,O.z*5),t.translate(O.x,O.y),t.scale(Math.max(.02,O.sx),Math.max(.02,O.sy)),q(),t.restore())},m=(F,_)=>Math.abs(F)<=_?0:Math.sign(F)*(Math.abs(F)-_)/(1-_),g=F=>Math.max(-1,Math.min(1,F)),M=m(g(-n.pitch/.26-n.lookY/7),.34),b=Math.abs(m(g(n.lookX/4.5),.4)),w=Math.max(.3,1+.55*M-.1*b),v=1-.05*M+.12*b,y=o.eyes??"default",C=n.mood??_1,p=C.loving,k=C.surprised,A=C.questioning,S=C.sleepy*(n.drowse??0),E=e+a*(1-n.laugh),I=a*n.laugh,W=Math.max(0,-n.y)/26,x=.5+.5*n.breath;for(const F of[-1,1]){const _=F<0?n.blinkL:n.blinkR;let q=Math.max(0,Math.min(1,n.eyeOpen*(1-_)));y==="sleepy"&&(q=Math.min(q,.42));const D=F<0?1:-1,O=w*(1+.3*A*D+.5*k),K=v*(1+.1*A*D+.28*k);let U=E*q,nt=E*(1-q),dt=I,pt=s;const Tt=F<0?n.winkL??0:n.winkR??0;Tt>0&&(dt+=Tt*(U+nt),U*=1-Tt,nt*=1-Tt),S>0&&(U*=1-S,nt*=1-S,dt*=1-S,pt=pt*(1-S)+S);const j=U*.01+nt*5.4+dt*6.2+pt*6,N=U*1.1*O+nt*.6+dt*(2.2-W*1.5)+pt*(-1.4+x),Q=U*-3.3*O+nt*.6+dt*(-11.4-4*W)+pt*(5.4+2*x),Ot=U*C1*2*K+nt*2.8+dt*4.4+pt*4,G=h*(U+.5*(nt+dt)),ut=d*(U+.5*nt);i(F*c+G,l+ut,()=>{if(y==="round"||y==="dot"){const ft=y==="round"?7.4:3.6,xt=Math.max(.5,ft*(.3+.7*q)*(1-.85*Tt)*(1-.7*S));t.fillStyle=r,t.beginPath(),t.ellipse(0,0,ft,xt,0,0,Math.PI*2),t.fill();return}if(t.strokeStyle=r,y==="happy"){t.lineWidth=4.4,t.stroke(Ci(6.2,2.2-W*1.5,-11.4-4*W));return}t.lineWidth=Ot,t.stroke(Ci(j,N,Q))},1-p),p>.01&&i(F*c+h*.5,l+d*.5+.6,()=>{const ft=8.4*(1+.16*(n.beat??0))*Ha(p);t.scale(ft,ft),t.fillStyle="#FF4F86",t.fill(pr()),t.fillStyle="rgba(255,255,255,0.7)",t.beginPath(),t.ellipse(-.42,-.5,.2,.13,-.6,0,Math.PI*2),t.fill()},p)}const $=Math.max(.55*C.happy,.7*p,.5*C.playful);if($>.02)for(const F of[-1,1])i(F*(c+5.5)+h*.4,l+9.5,()=>{t.fillStyle="rgba(255,105,140,0.55)",t.beginPath(),t.ellipse(0,0,4.2,2.4,0,0,Math.PI*2),t.fill()},$);if(A>.01||k>.01)for(const F of[-1,1])i(F*c+h,l+d,()=>{t.strokeStyle=r,t.lineWidth=2.3,t.lineCap="round",t.beginPath(),k>A?(t.moveTo(-6,-11),t.quadraticCurveTo(0,-15.5,6,-11)):F<0?(t.moveTo(-6,-9.5),t.quadraticCurveTo(0,-14.5,6,-10)):(t.moveTo(-6,-6.2),t.lineTo(6,-7.4)),t.stroke()},Math.max(k,A));if(y==="angry"||y==="worried"){const F=y==="angry"?2.4:-2.4,_=-7;for(const q of[-1,1]){const D=-q*6,O=q*6;i(q*c+h,l+d,()=>{t.strokeStyle=r,t.lineWidth=2.5,t.lineCap="round",t.beginPath(),t.moveTo(D,_+F),t.lineTo(O,_-F),t.stroke()})}}if(o.face==="mouth"){const F=h*.35,_=Math.max(C.happy,p,C.playful),q=(.6+.4*e)*(1+.06*n.breath)*(1+.28*_)*(1-.3*A),D=(.6+.4*a)*(1+.25*Math.max(0,-n.y)/26),O=2.7*s*(1+.25*n.breath),K=(nt,dt,pt)=>e*nt+a*dt+s*pt,U={hw:K(6.5*q,9.5*D,O),t0:K(1.9,0,0),a:K(2/3,2/3,0),yt:K(3.53*q,1.6*D,-4*O/3),ab:K(2/3,0,0),yb:K(3.53*q,17.3*D,4*O/3)};if(k>.001){const nt={hw:3.6,t0:0,a:0,yt:-4.8,ab:0,yb:4.8};for(const dt of Object.keys(nt))U[dt]+=(nt[dt]-U[dt])*k}i(F,K(12.5,11.6,15.5)+(14-K(12.5,11.6,15.5))*k,()=>{t.fillStyle=r,t.fill(D1(U))})}const T=F=>{const _=ki(F,l,f,u);return{x:_.x,y:_.y,sx:_.sx,sy:_.sy,z:_.z,ox:F,oy:l,fz:Math.sqrt(Math.max(0,We*We-F*F-l*l))}};return[T(-c),T(c)]}const Zo={x:NaN,y:NaN},ze=new Set;let Xo=0,zs=0;function mr(t){Xo=0;const n=zs?Math.min(.1,(t-zs)/1e3):0;zs=t,ze.forEach(o=>o(n)),ze.size&&(Xo=requestAnimationFrame(mr))}function Mr(){Xo||typeof document>"u"||document.hidden||(zs=0,Xo=requestAnimationFrame(mr))}let Si=!1;function H1(){Si||typeof document>"u"||(Si=!0,document.addEventListener("pointermove",t=>{Zo.x=t.clientX,Zo.y=t.clientY},{passive:!0}),document.addEventListener("pointerleave",()=>{Zo.x=NaN,Zo.y=NaN}),window.addEventListener("blur",()=>{Zo.x=NaN,Zo.y=NaN}),document.addEventListener("visibilitychange",()=>{document.hidden?(Xo&&cancelAnimationFrame(Xo),Xo=0):ze.size&&Mr()}))}function B1(t){return H1(),ze.add(t),Mr(),()=>{ze.delete(t),!ze.size&&Xo&&(cancelAnimationFrame(Xo),Xo=0)}}const Y1=["data-bot-avatar","data-face","data-state","aria-label"],xi=4e3,Vs=V.defineComponent({name:"BotAvatar",__name:"BotAvatar",props:{type:{default:"clover"},path:{},face:{},eyes:{default:"default"},state:{default:"default"},size:{default:64},color:{},ink:{},brightness:{},saturation:{},speed:{default:1},paused:{type:Boolean,default:!1},seed:{},shading:{type:[String,Boolean],default:"fabric"},hat:{default:"none"},glasses:{default:"none"},headphones:{type:Boolean,default:!1},bowTie:{type:Boolean,default:!1},scarf:{type:Boolean,default:!1},accessoryColor:{default:"#27272b"},shadow:{},highlight:{},depth:{default:.65},roundness:{default:1},furLength:{default:1},furDensity:{default:1.6},furFuzz:{default:.9},furClumps:{default:.4},furCurl:{default:.7},furGravity:{default:.9},light:{},rim:{},backLight:{},lightFront:{},shine:{},sheen:{},backSoftness:{},spread:{},pose:{},interactive:{type:Boolean,default:!0},theme:{default:"auto"},turn:{default:1},whirl:{default:0},whirlSize:{default:1},whirlWidth:{default:1},whirlLength:{default:1},whirlTilt:{default:1},jumpHeight:{default:26},jumpTime:{default:.68},jumpStretch:{default:1},jumpSquash:{default:1.15},jumpSquashTime:{default:.37},jumpSquashEase:{default:"pulse"},jumpGroundTime:{default:.11},jumpGroundEase:{default:"pulse"},jumpRiseTime:{default:.33},jumpRiseEase:{default:"pulse"},jumpClickSquashTime:{default:.24},jumpSpin:{default:1},jumpLean:{default:6},jumpEvery:{default:8},jumpLand:{default:0},ariaLabel:{}},setup(t,{expose:n}){function o(J){let Mt=2166136261;for(let Ht=0;Ht<J.length;Ht++)Mt=Math.imul(Mt^J.charCodeAt(Ht),16777619);return(Mt>>>0)%1e3/1e3}const e=(J,Mt,Ht)=>Math.min(Ht,Math.max(Mt,Number.isFinite(J)?J:1)),a=new Map;function s(J){let Mt=a.get(J);return Mt||(Mt=new Path2D(J),a.set(J,Mt)),Mt}const r=new Map;function l(J){let Mt=r.get(J);return Mt||(Mt=J.split(/(?=M)/).filter(Ht=>Ht.trim()).map(Ht=>new Path2D(Ht)),r.set(J,Mt)),Mt}const c=new Map;function h(){if(bs())return;for(const Mt of c.values())if(!Mt.ready())return;const J=[...c.values()];c.clear();for(const Mt of J)Mt.show()}const d=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,f=t,u=V.computed(()=>_e[f.type]??_e.clover),i=V.computed(()=>f.face??u.value.face),m=V.computed(()=>f.color??u.value.color),g=V.computed(()=>f.brightness??u.value.brightness??1),M=V.computed(()=>f.saturation??u.value.saturation??1.5),b=V.computed(()=>e(M.value,1.5,2.5)-1.5),w=V.computed(()=>_r(g.value===1&&M.value===1?m.value:fn(m.value,(Math.min(2,Math.max(0,g.value))-1)*.35,(Math.min(1.5,Math.max(0,M.value))-1)*.5),b.value)),v=V.computed(()=>f.ink??ja(w.value)),y=V.useId(),C=V.computed(()=>Math.min(1,Math.max(0,f.seed??o(y)))),p=V.computed(()=>f.state in _s?f.state:"default"),k=V.computed(()=>f.paused||!(f.speed>0)),A=V.computed(()=>{const J=f.shading;return J===!0||J===""?"crisp":J===!1?"flat":J}),S=V.computed(()=>typeof f.path=="string"&&f.path.trim()?f.path.trim():null),E=V.computed(()=>S.value?`path:${o(S.value)}:${S.value.length}`:f.type),I=V.computed(()=>Qs[A.value==="fabric"?"fabric":"other"]),W=(J,Mt,Ht)=>Math.round(e(J,Mt,Ht)*20)/20,x=V.computed(()=>({length:W(f.furLength,.3,2.5),density:W(f.furDensity,.3,2),fuzz:W(f.furFuzz,0,1),clumps:W(f.furClumps,0,1),curl:W(f.furCurl,0,1),gravity:W(f.furGravity,0,1)})),$=V.computed(()=>`${x.value.length},${x.value.density},${x.value.fuzz},${x.value.clumps},${x.value.curl},${x.value.gravity}`),T=V.computed(()=>["plastic","fabric","metal","glass","neon"].includes(A.value)),F=V.computed(()=>`${A.value}|${E.value}|${f.size}`),_=V.computed(()=>f.interactive&&!f.pose),q=V.computed(()=>f.ariaLabel??`${u.value.label} bot, ${_s[p.value]}`),D=V.ref(null),O=V.ref(!T.value);let K=null,U=null,nt=0,dt=null,pt=null,Tt=null,j=null,N=null,Q=!1;const Ot={};function G(){const J=D.value,Mt=U;if(!J||!Mt||!Mt.path)return;const Ht=J.clientWidth/Lo||nt||(typeof f.size=="number"?f.size:64);if(!Ht)return;const Kt=Math.min(2,typeof devicePixelRatio=="number"&&devicePixelRatio||1),vn=Math.round(Ht*Lo*Kt);(J.width!==vn||J.height!==vn)&&(J.width=vn,J.height=vn),nt=Ht;const ln=J.getContext("2d");if(!ln)return;ln.setTransform(Kt,0,0,Kt,0,0),Mt.dpr=Kt,Mt.time=typeof performance=="object"&&performance.now?performance.now():Date.now();const Sn=f.pose,_n=Hs(p.value),ro=Sn?{..._n,yaw:Sn.yaw??0,pitch:Sn.pitch??_n.pitch,roll:Sn.roll??_n.roll}:K?K.pose:_n;Ks(ln,Ht,ro,Mt)}function ut(){pt&&pt(),pt=null}function ft(J){ys(),J(),ys()?pt||(pt=ba(()=>{const Mt=dt;D.value&&Mt?ft(Mt):ut()})):ut()}function xt(){j&&j(),j=null}function it(J){if(Tt=J,ys(),J(),Q=!ys(),Q&&!bs()){h();return}j||(j=ba(()=>{const Mt=Tt;D.value&&Mt&&!O.value?it(Mt):xt(),h()}))}let z=!1,L=null;function bt(){z||(z=!0,c.set(Ot,{ready:()=>Q,show:()=>{O.value=!0}}),h(),gs(!0),L=setTimeout(()=>{O.value=!0},xi))}function H(){z&&(z=!1,gs(!1),L!==null&&(clearTimeout(L),L=null),xt(),c.delete(Ot),h())}V.watch(O,J=>{J&&H()});function Lt(){if(!T.value||!U?.path)return;const J=U.path,Mt=(typeof f.size=="number"?f.size:64)*Math.min(2,typeof devicePixelRatio=="number"&&devicePixelRatio||1),Ht=U.light??295,Kt=Ht*Math.PI/180,vn=(f.backLight??0)*Math.PI/180,ln=ss(Math.sin(Kt),-Math.cos(Kt));f.backLight!==void 0&&([ln.bx,ln.by]=[Math.sin(vn),-Math.cos(vn)]),f.lightFront!==void 0&&(ln.front=Math.min(85,Math.max(0,f.lightFront))*Math.PI/180),Va(E.value,J,Mt,f.depth,A.value==="fabric",x.value,Ht,ln)}let It=null;function Cn(){It&&(It(),It=null)}function qt(){if(!T.value||!U?.path)return;Cn();const J=typeof requestIdleCallback=="function",Ht=(J?requestIdleCallback:Kt=>setTimeout(Kt,1))(Lt);It=J&&typeof cancelIdleCallback=="function"?()=>cancelIdleCallback(Ht):()=>clearTimeout(Ht)}let Mn=null;function en(){if(Lt(),!bs())return;gs(!0);const J=()=>{N&&(N(),$t())},Mt=ba(()=>{bs()||J()}),Ht=setTimeout(J,xi);N=()=>{Mt(),clearTimeout(Ht),gs(!1),N=null}}function gn(J){if(f.theme!=="auto")return f.theme;const Mt=J?.closest("[data-theme], .dark, .light");if(Mt){const Ht=Mt.getAttribute("data-theme");if(Ht==="dark"||Ht==="light")return Ht;if(Mt.classList.contains("dark"))return"dark";if(Mt.classList.contains("light"))return"light"}return typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function $t(){const J=S.value,Mt=A.value;if(U={path:typeof Path2D>"u"?null:s(J??qs[f.type]??qs.clover),face:i.value,faceX:u.value.faceX,faceY:u.value.faceY,faceScale:u.value.faceScale,eyes:f.eyes,color:w.value,ink:v.value,shading:Mt,shadow:e(f.shadow??I.value.shadow,0,2),highlight:e(f.highlight??I.value.highlight,0,2),depth:e(f.depth,.2,2),roundness:e(f.roundness,0,1),fur:x.value,vivid:b.value,backLight:f.backLight,lightFront:f.lightFront,shine:f.shine,sheen:f.sheen,backSoftness:f.backSoftness,light:f.light??I.value.light,rim:e(f.rim??I.value.rim,0,2),spread:e(f.spread??I.value.spread,.4,2.5),typeKey:E.value,still:k.value||d(),furOnIdle:!0,whirl:{strength:e(f.whirl,0,2),size:e(f.whirlSize,.6,1.6),width:e(f.whirlWidth,.4,2),length:e(f.whirlLength,.4,1.6),tilt:e(f.whirlTilt,.5,1.8)},parts:typeof Path2D<"u"&&!J&&Ds[f.type]?l(Ds[f.type]):void 0,wear:{hat:f.hat,glasses:f.glasses,headphones:f.headphones,bowTie:f.bowTie,scarf:f.scarf,color:f.accessoryColor,fabric:Mt==="fabric"}},K?K.setState(p.value):K=new Xa(C.value,p.value),K.setTurn(e(f.turn,0,2)),O.value&&T.value&&Mn!==null&&Mn!==F.value&&!N&&en(),Mn=F.value,K.setJump({height:f.jumpHeight,time:Math.max(.2,f.jumpTime),stretch:f.jumpStretch,spin:Math.max(0,Math.round(f.jumpSpin)),lean:f.jumpLean,every:f.jumpEvery,land:f.jumpLand,squash:f.jumpSquash,squashTime:Math.max(.05,f.jumpSquashTime),squashEase:f.jumpSquashEase,groundTime:Math.max(0,f.jumpGroundTime),groundEase:f.jumpGroundEase,riseTime:Math.max(.05,f.jumpRiseTime),riseEase:f.jumpRiseEase,clickSquashTime:Math.max(.05,f.jumpClickSquashTime)}),!N){if(d()){const Ht=()=>{const Kt=D.value;if(!Kt||!U||!U.path)return;const vn=Kt.clientWidth/Lo||nt||(typeof f.size=="number"?f.size:64);if(!vn)return;nt=vn;const ln=Math.min(2,typeof devicePixelRatio=="number"&&devicePixelRatio||1);Kt.width=Kt.height=Math.round(vn*Lo*ln);const Sn=Kt.getContext("2d");Sn&&U&&(U.theme=gn(Kt),U.dpr=ln,Sn.setTransform(ln,0,0,ln,0,0),Ks(Sn,vn,Hs(p.value),U))};dt=Ht,O.value?ft(Ht):it(Ht);return}U&&(U.theme=gn(D.value)),O.value?k.value?(dt=G,ft(G)):(dt=null,ut(),G()):(dt=k.value?G:null,it(G))}}let Rt=null,vt=null;function on(){Rt&&Rt(),Rt=null,vt&&vt.disconnect(),vt=null}function yn(){if(on(),k.value||d())return;const J=D.value;if(!J)return;const Mt=3,Ht=ln=>{const Sn=K;if(Sn){if(_.value&&!Number.isNaN(Zo.x)){const _n=J.getBoundingClientRect(),ro=_n.width/Lo||1,Ln=(Zo.x-(_n.left+_n.width/2))/ro,Jn=(Zo.y-(_n.top+_n.height/2+xe*ro))/ro,Bn=Math.hypot(Ln,Jn),ne=Bn<1?1:Bn>Mt?0:1-(Bn-1)/(Mt-1);Sn.setPointer(Ln/Math.max(1,Bn),Jn/Math.max(1,Bn),ne)}else Sn.setPointer(0,0,0);Sn.update(ln*f.speed),O.value&&!N&&G()}},Kt=()=>{Rt||(Rt=B1(Ht))},vn=()=>{Rt&&(Rt(),Rt=null)};typeof IntersectionObserver=="function"?(vt=new IntersectionObserver(ln=>{ln[0]?.isIntersecting??!0?Kt():vn()}),vt.observe(J)):Kt()}V.watch(k,()=>yn()),V.onMounted(()=>{$t(),O.value||bt(),qt(),yn()}),V.onUpdated($t),V.onUnmounted(()=>{H(),ut(),xt(),N&&N(),on(),Cn()}),V.watch([A,E,()=>f.size,()=>f.depth,$,()=>f.light,()=>f.backLight,()=>f.lightFront],()=>qt());function io(){f.interactive&&!k.value&&!f.pose&&K?.poke()}const Mo=V.computed(()=>{const J=f.size,Mt=typeof J=="number"?`${J*Lo}px`:`calc(${J} * ${Lo})`,Ht=vn=>typeof J=="number"?`${-J*vn}px`:`calc(${J} * ${-vn})`,Kt=(Lo-1)/2;return{display:"inline-block",verticalAlign:"middle",width:Mt,height:Mt,marginLeft:Ht(Kt),marginRight:Ht(Kt),marginTop:Ht(Kt+xe),marginBottom:Ht(Kt-xe),flex:"none",maxWidth:"none",opacity:O.value?1:0,transition:"opacity 0.3s ease-out"}});return n({canvas:D}),(J,Mt)=>(V.openBlock(),V.createElementBlock("canvas",{ref_key:"canvasEl",ref:D,class:"ba","data-bot-avatar":f.type,"data-face":i.value,"data-state":p.value,role:"img","aria-label":q.value,style:V.normalizeStyle(Mo.value),onClick:io},null,12,Y1))}}),Pi="familiar-vue-bot-list-styles",j1=`
|
|
2
|
-
/* ══ root ═══════════════════════════════════════════════════════════════ */
|
|
3
|
-
.fv-botlist {
|
|
4
|
-
--bl-ink: #1c1c1c;
|
|
5
|
-
--bl-muted: #606060;
|
|
6
|
-
--bl-panel: #f5f5f5;
|
|
7
|
-
--bl-hover: rgba(28, 28, 28, 0.055);
|
|
8
|
-
--bl-active: rgba(28, 28, 28, 0.09);
|
|
9
|
-
--bl-line: rgba(28, 28, 28, 0.07);
|
|
10
|
-
--bl-accent: var(--fv-botlist-accent, #e8b86d);
|
|
11
|
-
--bl-accent-ink: var(--fv-botlist-accent-ink, #241a08);
|
|
12
|
-
--bl-font: var(--font-sans, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif);
|
|
13
|
-
--bl-ease: cubic-bezier(0.22, 1, 0.36, 1);
|
|
14
|
-
box-sizing: border-box;
|
|
15
|
-
width: 100%;
|
|
16
|
-
min-width: 0;
|
|
17
|
-
color: var(--bl-ink);
|
|
18
|
-
font-family: var(--bl-font);
|
|
19
|
-
font-size: 15px;
|
|
20
|
-
line-height: 1.35;
|
|
21
|
-
-webkit-tap-highlight-color: transparent;
|
|
22
|
-
}
|
|
23
|
-
.fv-botlist[data-theme="dark"] {
|
|
24
|
-
--bl-ink: #f4f3f1;
|
|
25
|
-
--bl-muted: #9b9b9f;
|
|
26
|
-
--bl-panel: #1f1f21;
|
|
27
|
-
--bl-hover: rgba(255, 255, 255, 0.055);
|
|
28
|
-
--bl-active: rgba(255, 255, 255, 0.095);
|
|
29
|
-
--bl-line: rgba(255, 255, 255, 0.08);
|
|
30
|
-
}
|
|
31
|
-
.fv-botlist *, .fv-botlist *::before, .fv-botlist *::after { box-sizing: border-box; }
|
|
32
|
-
|
|
33
|
-
.fv-botlist[data-surface="card"] {
|
|
34
|
-
padding: 10px;
|
|
35
|
-
border-radius: 18px;
|
|
36
|
-
background: var(--bl-panel);
|
|
37
|
-
box-shadow: inset 0 0 0 1px var(--bl-line);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/* ══ rows ═══════════════════════════════════════════════════════════════ */
|
|
41
|
-
.fv-botlist-items {
|
|
42
|
-
display: flex;
|
|
43
|
-
flex-direction: column;
|
|
44
|
-
gap: var(--fv-botlist-gap, 6px);
|
|
45
|
-
margin: 0;
|
|
46
|
-
padding: 0;
|
|
47
|
-
list-style: none;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.fv-botlist-row {
|
|
51
|
-
display: flex;
|
|
52
|
-
align-items: center;
|
|
53
|
-
gap: 14px;
|
|
54
|
-
width: 100%;
|
|
55
|
-
min-width: 0;
|
|
56
|
-
margin: 0;
|
|
57
|
-
padding: 8px 10px;
|
|
58
|
-
border: 0;
|
|
59
|
-
border-radius: 13px;
|
|
60
|
-
background: transparent;
|
|
61
|
-
color: inherit;
|
|
62
|
-
font: inherit;
|
|
63
|
-
text-align: left;
|
|
64
|
-
text-decoration: none;
|
|
65
|
-
cursor: pointer;
|
|
66
|
-
transition: background-color 150ms var(--bl-ease), box-shadow 150ms var(--bl-ease);
|
|
67
|
-
}
|
|
68
|
-
.fv-botlist-row:hover { background: var(--bl-hover); text-decoration: none; }
|
|
69
|
-
.fv-botlist-row:active { background: var(--bl-active); }
|
|
70
|
-
.fv-botlist-row:focus-visible {
|
|
71
|
-
outline: 2px solid var(--bl-accent);
|
|
72
|
-
outline-offset: 1px;
|
|
73
|
-
}
|
|
74
|
-
.fv-botlist-row[disabled],
|
|
75
|
-
.fv-botlist-row[aria-disabled="true"] {
|
|
76
|
-
opacity: 0.45;
|
|
77
|
-
cursor: default;
|
|
78
|
-
pointer-events: none;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.fv-botlist-item.is-selected .fv-botlist-row {
|
|
82
|
-
background: color-mix(in srgb, var(--bl-accent) 15%, transparent);
|
|
83
|
-
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bl-accent) 45%, transparent);
|
|
84
|
-
}
|
|
85
|
-
.fv-botlist-item.is-selected .fv-botlist-row:hover {
|
|
86
|
-
background: color-mix(in srgb, var(--bl-accent) 22%, transparent);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.fv-botlist[data-divided="true"] .fv-botlist-items { gap: 0; }
|
|
90
|
-
.fv-botlist[data-divided="true"] .fv-botlist-item + .fv-botlist-item {
|
|
91
|
-
border-top: 1px solid var(--bl-line);
|
|
92
|
-
}
|
|
93
|
-
.fv-botlist[data-divided="true"] .fv-botlist-row { border-radius: 10px; }
|
|
94
|
-
|
|
95
|
-
/* ── narrow rail: avatars only ───────────────────────────────────────── */
|
|
96
|
-
.fv-botlist[data-compact="true"][data-surface="card"] {
|
|
97
|
-
padding: 6px;
|
|
98
|
-
border-radius: 16px;
|
|
99
|
-
}
|
|
100
|
-
.fv-botlist[data-compact="true"] .fv-botlist-copy,
|
|
101
|
-
.fv-botlist[data-compact="true"] .fv-botlist-side { display: none; }
|
|
102
|
-
.fv-botlist[data-compact="true"] .fv-botlist-row {
|
|
103
|
-
width: fit-content;
|
|
104
|
-
margin-inline: auto;
|
|
105
|
-
gap: 0;
|
|
106
|
-
padding: 6px;
|
|
107
|
-
}
|
|
108
|
-
.fv-botlist[data-compact="true"] .fv-botlist-item { display: flex; justify-content: center; }
|
|
109
|
-
|
|
110
|
-
/* ══ contents ═══════════════════════════════════════════════════════════ */
|
|
111
|
-
.fv-botlist-avatar {
|
|
112
|
-
position: relative;
|
|
113
|
-
display: grid;
|
|
114
|
-
place-items: center;
|
|
115
|
-
flex: none;
|
|
116
|
-
width: var(--fv-botlist-avatar, 48px);
|
|
117
|
-
height: var(--fv-botlist-avatar, 48px);
|
|
118
|
-
}
|
|
119
|
-
.fv-botlist-avatar > * { flex: none; }
|
|
120
|
-
|
|
121
|
-
.fv-botlist-dot {
|
|
122
|
-
position: absolute;
|
|
123
|
-
top: 1px;
|
|
124
|
-
right: 1px;
|
|
125
|
-
width: 8px;
|
|
126
|
-
height: 8px;
|
|
127
|
-
border-radius: 50%;
|
|
128
|
-
background: var(--bl-accent);
|
|
129
|
-
box-shadow: 0 0 0 2px var(--fv-botlist-dot-ring, var(--bl-panel));
|
|
130
|
-
pointer-events: none;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.fv-botlist-copy {
|
|
134
|
-
display: flex;
|
|
135
|
-
min-width: 0;
|
|
136
|
-
flex: 1 1 auto;
|
|
137
|
-
flex-direction: column;
|
|
138
|
-
gap: 2px;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.fv-botlist-title {
|
|
142
|
-
display: flex;
|
|
143
|
-
min-width: 0;
|
|
144
|
-
align-items: center;
|
|
145
|
-
gap: 8px;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.fv-botlist-name {
|
|
149
|
-
overflow: hidden;
|
|
150
|
-
color: var(--bl-ink);
|
|
151
|
-
font-size: 18px;
|
|
152
|
-
font-weight: 600;
|
|
153
|
-
line-height: 1.25;
|
|
154
|
-
letter-spacing: -0.01em;
|
|
155
|
-
white-space: nowrap;
|
|
156
|
-
text-overflow: ellipsis;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.fv-botlist-preview {
|
|
160
|
-
overflow: hidden;
|
|
161
|
-
color: var(--bl-muted);
|
|
162
|
-
font-size: 15px;
|
|
163
|
-
font-weight: 400;
|
|
164
|
-
line-height: 1.35;
|
|
165
|
-
white-space: nowrap;
|
|
166
|
-
text-overflow: ellipsis;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
.fv-botlist-badge {
|
|
170
|
-
display: inline-grid;
|
|
171
|
-
min-width: 18px;
|
|
172
|
-
height: 18px;
|
|
173
|
-
flex: none;
|
|
174
|
-
place-items: center;
|
|
175
|
-
padding: 0 5px;
|
|
176
|
-
border-radius: 999px;
|
|
177
|
-
background: var(--bl-accent);
|
|
178
|
-
color: var(--bl-accent-ink);
|
|
179
|
-
font: 600 11px/1 var(--bl-font);
|
|
180
|
-
font-variant-numeric: tabular-nums;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.fv-botlist-side {
|
|
184
|
-
display: flex;
|
|
185
|
-
flex: none;
|
|
186
|
-
flex-direction: column;
|
|
187
|
-
align-items: flex-end;
|
|
188
|
-
gap: 4px;
|
|
189
|
-
align-self: flex-start;
|
|
190
|
-
padding-top: 3px;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
.fv-botlist-meta {
|
|
194
|
-
color: var(--bl-muted);
|
|
195
|
-
font-size: 12px;
|
|
196
|
-
line-height: 1.3;
|
|
197
|
-
font-variant-numeric: tabular-nums;
|
|
198
|
-
white-space: nowrap;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
.fv-botlist-empty {
|
|
202
|
-
padding: 18px 12px;
|
|
203
|
-
color: var(--bl-muted);
|
|
204
|
-
font-size: 14px;
|
|
205
|
-
text-align: center;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
@media (max-width: 480px) {
|
|
209
|
-
.fv-botlist-name { font-size: 16px; }
|
|
210
|
-
.fv-botlist-preview { font-size: 14px; }
|
|
211
|
-
.fv-botlist-row { gap: 12px; }
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
@media (prefers-reduced-motion: reduce) {
|
|
215
|
-
.fv-botlist *, .fv-botlist *::before, .fv-botlist *::after {
|
|
216
|
-
transition-duration: 1ms !important;
|
|
217
|
-
animation-duration: 1ms !important;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
`;let Ea=!1;function X1(){if(typeof document>"u"||Ea)return;if(document.getElementById(Pi)){Ea=!0;return}const t=document.createElement("style");t.id=Pi,t.textContent=j1,document.head.appendChild(t),Ea=!0}const G1=["data-theme","data-surface","data-divided","data-compact"],K1=["aria-label"],V1={class:"fv-botlist-avatar"},N1={key:0,class:"fv-botlist-dot","aria-hidden":"true"},Z1={class:"fv-botlist-copy"},U1={class:"fv-botlist-title"},Q1={class:"fv-botlist-name"},J1={key:0,class:"fv-botlist-badge"},tc={key:0,class:"fv-botlist-preview"},nc={key:0,class:"fv-botlist-side"},oc={key:0,class:"fv-botlist-meta"},ec={key:1,class:"fv-botlist-empty"},gr=V.defineComponent({name:"BotList",__name:"BotList",props:{items:{},modelValue:{},initial:{},ariaLabel:{default:"Bots"},avatarSize:{default:48},theme:{default:"auto"},surface:{default:"card"},gap:{default:6},divided:{type:Boolean,default:!1},compactAt:{default:190}},emits:["select","update:modelValue"],setup(t,{emit:n}){X1();const o=t,e=n,a=V.computed(()=>(o.items??[]).map((p,k)=>({item:p,index:k,id:p.id??String(k)}))),s=V.computed(()=>a.value.map(p=>p.id)),r=(()=>{const p=o.initial;return p===void 0?-1:typeof p=="number"?Number.isFinite(p)?Math.max(0,Math.trunc(p)):-1:(o.items??[]).findIndex((A,S)=>(A.id??String(S))===p)})(),l=V.ref(r),c=V.computed(()=>{const p=a.value.length-1;if(o.modelValue!==void 0){const k=s.value.indexOf(o.modelValue);return k>=0?k:-1}return l.value>=0&&l.value<=p?l.value:-1});function h(p,k){if(p.item.disabled){k.preventDefault();return}o.modelValue===void 0&&(l.value=p.index),e("update:modelValue",p.id),e("select",{id:p.id,index:p.index,item:p.item})}function d(p){const k=p.target;if(!k||!k.classList.contains("fv-botlist-row")||!["ArrowDown","ArrowUp","Home","End"].includes(p.key))return;const A=p.currentTarget;if(!A)return;const S=[...A.querySelectorAll(".fv-botlist-row")].filter(W=>W.getAttribute("aria-disabled")!=="true"&&!W.hasAttribute("disabled"));if(!S.length)return;const E=S.indexOf(k);let I=-1;p.key==="ArrowDown"?I=Math.min(S.length-1,Math.max(0,E+1)):p.key==="ArrowUp"?I=Math.max(0,E-1):p.key==="Home"?I=0:p.key==="End"&&(I=S.length-1),!(I<0)&&(p.preventDefault(),S[I]?.focus())}const f=V.ref(o.theme==="auto"?"light":o.theme);let u=null;const i=V.ref(null),m=V.ref(!1);let g=null;function M(){const p=i.value;p&&(m.value=o.compactAt>0&&p.getBoundingClientRect().width<=o.compactAt)}function b(){if(o.theme!=="auto"){f.value=o.theme;return}if(typeof document>"u")return;const p=document.documentElement,k=p.dataset.theme??(p.classList.contains("dark")?"dark":p.classList.contains("light")?"light":"");k==="dark"||k==="light"?f.value=k:f.value=u?.matches?"dark":"light"}function w(){b()}let v=null;V.onMounted(()=>{if(u=window.matchMedia?.("(prefers-color-scheme: dark)")??null,u?.addEventListener?.("change",w),b(),typeof MutationObserver<"u"&&(v=new MutationObserver(b),v.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","class"]})),M(),typeof ResizeObserver>"u"){window.addEventListener("resize",M);return}g=new ResizeObserver(M),i.value&&g.observe(i.value)}),V.onBeforeUnmount(()=>{u?.removeEventListener?.("change",w),v?.disconnect(),g?.disconnect(),g=null,window.removeEventListener("resize",M)}),V.watch(()=>o.theme,b),V.watch(()=>o.compactAt,M);const y=V.computed(()=>({"--fv-botlist-gap":`${Number.isFinite(o.gap)?Math.max(0,o.gap):6}px`,"--fv-botlist-avatar":typeof o.avatarSize=="number"?`${Math.max(1,o.avatarSize)}px`:o.avatarSize}));function C(p){return p>99?"99+":String(p)}return(p,k)=>(V.openBlock(),V.createElementBlock("div",{ref_key:"rootEl",ref:i,class:"fv-botlist","data-theme":f.value,"data-surface":t.surface,"data-divided":t.divided?"true":void 0,"data-compact":m.value?"true":void 0,style:V.normalizeStyle(y.value)},[a.value.length?(V.openBlock(),V.createElementBlock("ul",{key:0,class:"fv-botlist-items","aria-label":t.ariaLabel,onKeydown:d},[(V.openBlock(!0),V.createElementBlock(V.Fragment,null,V.renderList(a.value,A=>(V.openBlock(),V.createElementBlock("li",{key:A.id,class:V.normalizeClass(["fv-botlist-item",{"is-selected":A.index===c.value}])},[(V.openBlock(),V.createBlock(V.resolveDynamicComponent(A.item.href?"a":"button"),{class:"fv-botlist-row",href:A.item.href,type:A.item.href?void 0:"button",tabindex:A.item.href&&A.item.disabled?-1:void 0,disabled:A.item.href?void 0:A.item.disabled,"aria-disabled":A.item.disabled?"true":void 0,"aria-current":A.index===c.value?"true":void 0,"aria-label":A.item.name,title:m.value?A.item.name:void 0,onClick:S=>h(A,S)},{default:V.withCtx(()=>[V.createElementVNode("span",V1,[V.renderSlot(p.$slots,"avatar",{item:A.item,index:A.index},()=>[V.createVNode(Vs,V.mergeProps({"aria-hidden":"true"},{ref_for:!0},A.item.avatar,{size:t.avatarSize,theme:f.value,interactive:A.item.avatar?.interactive??!1}),null,16,["size","theme","interactive"])]),m.value&&A.item.unread&&A.item.unread>0?(V.openBlock(),V.createElementBlock("span",N1)):V.createCommentVNode("",!0)]),V.createElementVNode("span",Z1,[V.createElementVNode("span",U1,[V.createElementVNode("span",Q1,V.toDisplayString(A.item.name),1),A.item.unread&&A.item.unread>0?(V.openBlock(),V.createElementBlock("span",J1,V.toDisplayString(C(A.item.unread)),1)):V.createCommentVNode("",!0)]),A.item.preview?(V.openBlock(),V.createElementBlock("span",tc,V.toDisplayString(A.item.preview),1)):V.createCommentVNode("",!0)]),A.item.meta||p.$slots.trailing?(V.openBlock(),V.createElementBlock("span",nc,[A.item.meta?(V.openBlock(),V.createElementBlock("span",oc,V.toDisplayString(A.item.meta),1)):V.createCommentVNode("",!0),V.renderSlot(p.$slots,"trailing",{item:A.item,index:A.index,selected:A.index===c.value})])):V.createCommentVNode("",!0)]),_:2},1032,["href","type","tabindex","disabled","aria-disabled","aria-current","aria-label","title","onClick"]))],2))),128))],40,K1)):(V.openBlock(),V.createElementBlock("div",ec,[V.renderSlot(p.$slots,"empty",{},()=>[k[0]||(k[0]=V.createTextVNode("No bots yet.",-1))])]))],12,G1))}}),sc=Object.freeze(Object.defineProperty({__proto__:null,BOT_AVATAR_LIGHTS:Qs,BOT_AVATAR_MATCAP_SIZE:qi,BOT_AVATAR_OVERSCAN:Lo,BOT_AVATAR_PAD:st,BOT_AVATAR_RISE:xe,BOT_AVATAR_SPAN:zt,BotAvatar:Vs,BotAvatarSim:Xa,BotList:gr,autoInk:ja,bakeBotAvatarForm:Ga,botAvatarCapFrame:Ja,botAvatarFaces:Ti,botAvatarJumpDefaults:Rs,botAvatarPalette:Fi,botAvatarParts:Ds,botAvatarPresets:_e,botAvatarShapes:qs,botAvatarStates:Ii,botAvatarTier:Ns,botAvatarTypes:Ba,buildBotAvatarMatcap:Na,default:Vs,drawBotAvatarFrame:Ks,luminance:Ya,parseColor:me,restPose:Hs,shade:fn,shadeBotAvatarTexels:Za,stateLabels:_s,warmBotAvatarPlastic:Va},Symbol.toStringTag,{value:"Module"}));exports.JUMP_DEFAULTS=Rs;exports.LIGHT_DEFAULTS=Qs;exports.MATCAP_SIZE=qi;exports.OVERSCAN=Lo;exports.PAD=st;exports.RISE=xe;exports.SHAPE_PARTS=Ds;exports.SHAPE_PATHS=qs;exports.SPAN=zt;exports.Sim=Xa;exports._sfc_main=Vs;exports._sfc_main$1=gr;exports.autoInk=ja;exports.botAvatarFaces=Ti;exports.botAvatarPalette=Fi;exports.botAvatarPresets=_e;exports.botAvatarStates=Ii;exports.botAvatarTypes=Ba;exports.buildForm=Ga;exports.buildMatcap=Na;exports.capFrame=Ja;exports.draw=Ks;exports.index=sc;exports.luminance=Ya;exports.parseColor=me;exports.restPose=Hs;exports.shade=fn;exports.shadeTexels=Za;exports.stateLabels=_s;exports.tierFor=Ns;exports.warmPlastic=Va;
|
|
221
|
-
//# sourceMappingURL=index-BAZi5af3.cjs.map
|