@7ots/cli 0.1.4 → 0.1.6

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.
Files changed (44) hide show
  1. package/README.md +14 -20
  2. package/cli/7ots.mjs +55 -5
  3. package/cli/lib/account.mjs +89 -0
  4. package/cli/lib/assistant.mjs +122 -16
  5. package/cli/lib/brain.mjs +41 -11
  6. package/cli/lib/card-shot.mjs +84 -0
  7. package/cli/lib/config.mjs +28 -5
  8. package/cli/lib/i18n.mjs +57 -0
  9. package/cli/lib/inferences.mjs +76 -0
  10. package/cli/lib/integrations.mjs +414 -0
  11. package/cli/lib/orquesta.mjs +53 -0
  12. package/cli/lib/pet-core.mjs +7 -10
  13. package/cli/lib/pet-server.mjs +365 -22
  14. package/cli/lib/screen.mjs +125 -0
  15. package/cli/lib/stt-local.py +14 -0
  16. package/cli/lib/stt.mjs +68 -0
  17. package/cli/lib/tts-local.mjs +110 -0
  18. package/cli/lib/tts-local.py +18 -0
  19. package/cli/lib/vm.mjs +309 -0
  20. package/cli/lib/watchers.mjs +151 -0
  21. package/cli/pet/card.html +294 -0
  22. package/cli/pet/electron/director.cjs +175 -0
  23. package/cli/pet/electron/main.cjs +515 -59
  24. package/cli/pet/pet.html +414 -21
  25. package/cli/pet/settings.html +991 -57
  26. package/dist/7ots.esm.js +3 -3
  27. package/dist/7ots.esm.js.map +3 -3
  28. package/dist/7ots.iife.js +3 -3
  29. package/dist/7ots.iife.js.map +3 -3
  30. package/llms.txt +31 -17
  31. package/package.json +1 -1
  32. package/server/llm.mjs +2 -0
  33. package/server/platform/connect.mjs +3 -1
  34. package/server/platform/db.mjs +77 -0
  35. package/server/platform/device.mjs +125 -0
  36. package/server/platform/orquesta.mjs +5 -0
  37. package/server/platform/routes.mjs +100 -1
  38. package/server/platform/sites.mjs +146 -0
  39. package/server/platform/store.mjs +3 -1
  40. package/server/platform/vm.mjs +386 -0
  41. package/src/character3d/index.js +2 -1
  42. package/src/character3d/stage.js +15 -4
  43. package/src/i18n/messages/character.js +3 -3
  44. package/src/i18n/messages/platform.js +42 -3
package/dist/7ots.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- var tl=Object.create;var Ha=Object.defineProperty;var ol=Object.getOwnPropertyDescriptor;var sl=Object.getOwnPropertyNames;var al=Object.getPrototypeOf,rl=Object.prototype.hasOwnProperty;var Ke=(e,t,o)=>()=>{if(o)throw o[0];try{return e&&(t=e(e=0)),t}catch(s){throw o=[s],s}};var Pa=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(o){throw t=0,o}},il=(e,t)=>{for(var o in t)Ha(e,o,{get:t[o],enumerable:!0})},nl=(e,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of sl(t))!rl.call(e,a)&&a!==o&&Ha(e,a,{get:()=>t[a],enumerable:!(s=ol(t,a))||s.enumerable});return e};var jt=(e,t,o)=>(o=e!=null?tl(al(e)):{},nl(t||!e||!e.__esModule?Ha(o,"default",{value:e,enumerable:!0}):o,e));function Gs(e,t){let o=Fr(e);if(!o||!t||typeof t!="object")return;let s=Lo[o]||=new Map;Wr(t,"",s),Qr()}function gt(e){for(let[t,o]of Object.entries(e||{}))Gs(t,o)}function hl(){return Object.keys(Lo)}function Vs(...e){let t=e.flat().filter(Boolean).flatMap(o=>String(o).split(",")).map(o=>Fr(o.split(";")[0]));for(let o of t){if(!o)continue;if(Lo[o])return o;let s=o.split("-")[0];if(Lo[s])return s}return t.some(Boolean)&&Lo.en,"en"}function We(e){let t=typeof document<"u"?document.documentElement.lang:"",o=typeof navigator<"u"?navigator.languages||[navigator.language]:[];return Vs(e,t,o)}function re(e){let t=e?Vs(e):null,o=(s,a)=>Ur(Oa(t||Ue,s),a,t||Ue,s);return Object.defineProperty(o,"locale",{get:()=>t||Ue}),o.has=s=>Oa(t||Ue,s)!==void 0,o}function ts(e,t){return Ur(Oa(Ue,e),t,Ue,e)}function Nt(){return Ue}function qa(e){let t=Vs(e);return t===Ue||(Ue=t,Qr()),Ue}function os(e){return La.add(e),()=>La.delete(e)}function Fs(e,t=Ue,o){try{return new Intl.NumberFormat(t,o).format(e)}catch{return String(e)}}function dl(e,t=Ue,o="conjunction"){try{return new Intl.ListFormat(t,{style:"long",type:o}).format(e)}catch{return e.join(", ")}}function Fr(e){let t=String(e||"").trim().replace("_","-");if(!/^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$/.test(t))return"";let[o,...s]=t.split("-");return[o.toLowerCase(),...s.map(a=>a.length===2?a.toUpperCase():a)].join("-")}function ul(e){let t=[e],o=e.split("-")[0];o!==e&&t.push(o);for(let s of["en","en"])t.includes(s)||t.push(s);return t}function Oa(e,t){for(let o of ul(e)){let s=Lo[o]?.get(t);if(s!==void 0)return s}}function Ur(e,t,o,s){if(e===void 0)return s;let a=e;if(typeof e=="object"){let r=Number(t?.count??0),i="other";try{i=r===0&&e.zero!==void 0?"zero":new Intl.PluralRules(o).select(r)}catch{i=r===1?"one":"other"}a=String(e[i]??e.other??"").replace(/#/g,Fs(r,o))}return t?a.replace(/\{(\w+)\}/g,(r,i)=>t[i]!==void 0&&t[i]!==null?String(t[i]):r):a}function Wr(e,t,o){for(let[s,a]of Object.entries(e)){let r=t?`${t}.${s}`:s;a&&typeof a=="object"&&!Array.isArray(a)?Object.keys(a).length&&Object.keys(a).every(i=>fl.has(i))?o.set(r,{...a}):Wr(a,r,o):typeof a=="string"&&o.set(r,a)}}function Qr(){for(let e of La)try{e(Ue)}catch{}}var za,ll,cl,Lo,La,Ue,fl,_e=Ke(()=>{za=["es","en","pt"],ll="en",cl={es:"Espa\xF1ol",en:"English",pt:"Portugu\xEAs",fr:"Fran\xE7ais",de:"Deutsch",it:"Italiano",ca:"Catal\xE0"},Lo=Object.create(null),La=new Set,Ue="en";fl=new Set(["zero","one","two","few","many","other"])});var Wl,Ql,Zl,ui=Ke(()=>{_e();Wl={character:{avatar:"Avatar",shapes:{pou:"Pou",round:"Redondo",egg:"Huevo",pear:"Pera",bean:"Jud\xEDa",squircle:"Cuadrado suave",wide:"Ancho",tall:"Alto",drop:"Gota",ghost:"Fantasma",cat:"Orejas",cloud:"Nube",blob:"Blandito",robot:"Robot",heart:"Coraz\xF3n",mushroom:"Seta"},eyes:{round:"Redondos",dot:"Puntitos",kawaii:"Kawaii",anime:"Anime",cat:"Gato",sleepy:"Dormilones",happy:"Felices",closed:"Cerrados",wink:"Gui\xF1o",star:"Estrellas",heart:"Corazones",cross:"K.O.",spiral:"Mareado",angry:"Enfadados",sad:"Tristes",wide:"Asombrados",button:"Bot\xF3n",robot:"LED",led:"Barras",cyclops:"C\xEDclope",lashes:"Pesta\xF1as",almond:"Realistas",googly:"Locos",sparkle:"Brillantes",dollar:"D\xF3lar",pixel:"P\xEDxel",bean:"Alubia",tired:"Cansados",villain:"Villano",glow:"Fantasmales",teary:"Llorosos",hypno:"Hipnosis",focused:"Decididos"},brows:{none:"Sin cejas",soft:"Suaves",thick:"Gruesas",thin:"Finas",arched:"Arqueadas",bushy:"Pobladas",dots:"Maro",unibrow:"Uniceja",angled:"Picudas"},mouths:{smile:"Sonrisa",grin:"Sonrisa amplia",laugh:"Carcajada",open:"Abierta",oh:"Oh",flat:"Seria",frown:"Triste",smirk:"P\xEDcara",cat:"Gatuna",tongue:"Lengua fuera",vampire:"Colmillos",buck:"Paletas",tiny:"Peque\xF1ita",kiss:"Beso",wavy:"Nerviosa",grit:"Dientes apretados",beak:"Pico",robot:"Rejilla",braces:"Brackets",monster:"Monstruo",gap:"Mellada",lips:"Labios",pout:"Puchero",toothless:"Desdentada",whistle:"Silbando",drool:"Babeando",square:"Cuadrada",mustachio:"Sonrisa ladeada"},cheeks:{none:"Nada",blush:"Rubor",lines:"Rubor anime",freckles:"Pecas",hearts:"Corazones",whiskers:"Bigotes de gato",stars:"Estrellitas",paint:"Pintura de guerra"},patterns:{none:"Liso",belly:"Barriga",spots:"Manchas",stripes:"Rayas",tiger:"Tigre",twotone:"Dos tonos",mask:"Antifaz",hearts:"Corazones",stars:"Estrellas",circuit:"Circuito"},finishes:{glossy:"Brillante",soft3d:"3D suave",clay:"Plastilina",flat:"Plano",toon:"C\xF3mic",neon:"Ne\xF3n",sketch:"Boceto"},groups:{head:"Cabeza",eyes:"Ojos",face:"Cara",neck:"Cuello",back:"Espalda",extra:"Extras"},accessories:{crown:"Corona",tiara:"Tiara",pirate:"Sombrero pirata",tophat:"Chistera",beanie:"Gorro de lana",cap:"Gorra",cowboy:"Vaquero",wizard:"Mago",party:"Fiesta",chef:"Chef",viking:"Vikingo",grad:"Graduaci\xF3n",beret:"Boina",bow:"Lazo",flower:"Flor",halo:"Aureola",horns:"Cuernos",antenna:"Antenas",bunny:"Orejas de conejo",catears:"Orejas de gato",santa:"Pap\xE1 Noel",hardhat:"Casco de obra",headband:"Cinta ninja",bandana:"Pa\xF1uelo pirata",helmet:"Casco espacial",headphones:"Auriculares",hair:"Tup\xE9",sprout:"Brote",glasses:"Gafas redondas",square:"Gafas cuadradas",nerd:"Gafas empoll\xF3n",sunglasses:"Gafas de sol",aviator:"Aviador",heartglasses:"Gafas coraz\xF3n",starglasses:"Gafas estrella","3d":"Gafas 3D",monocle:"Mon\xF3culo",eyepatch:"Parche",goggles:"Gafas de piloto",visor:"Visor",mustache:"Bigote",handlebar:"Bigote manillar",beard:"Barba",wizardbeard:"Barba de mago",goatee:"Perilla",pipe:"Pipa",lollipop:"Piruleta",clownnose:"Nariz de payaso",nose:"Nariz",pignose:"Nariz de cerdito",bandaid:"Tirita",scar:"Cicatriz",ninjamask:"M\xE1scara ninja",facemask:"Mascarilla",bowtie:"Pajarita",tie:"Corbata",scarf:"Bufanda",pearls:"Collar de perlas",medal:"Medalla",bell:"Cascabel",ruff:"Gorguera real",cape:"Capa real",superhero:"Capa de h\xE9roe",wings:"Alas de \xE1ngel",batwings:"Alas de murci\xE9lago",tail:"Cola de diablillo",jetpack:"Mochila cohete",parrot:"Loro",sparkles:"Destellos",hearts:"Corazones",zzz:"Zzz",sweat:"Gota de sudor"},presets:{classic:"Cl\xE1sico",pirate:"Pirata",king:"Rey",queen:"Reina",wizard:"Mago",chef:"Chef",detective:"Detective",cowboy:"Vaquero",astronaut:"Astronauta",robot:"Robot",viking:"Vikingo",ninja:"Ninja",ghost:"Fantasma",cat:"Gatito",devil:"Diablillo",angel:"\xC1ngel",scientist:"Cient\xEDfica",rocker:"Rockero",student:"Graduada",clown:"Payaso",monster:"Monstruo",nerd:"Empoll\xF3n",hero:"Superh\xE9roe",neon:"Ne\xF3n",santa:"Navidad",sprout:"Brotecito"},moods:{neutral:"Neutral",happy:"Contento",angry:"Enfadado",sad:"Triste",fear:"Miedo",disgust:"Asco",love:"Amor",sleep:"Dormido",surprised:"Sorpresa"},gestures:{jump:"Saltar",wiggle:"Menearse",nod:"Asentir",shake:"Negar",spin:"Girar",bounce:"Botar",wave:"Saludar",think:"Pensar",celebrate:"Celebrar",surprise:"Sorprenderse",shrug:"Encogerse de hombros",sneeze:"Estornudar",hiccup:"Hipo",laugh:"Re\xEDr",dance:"Bailar",yawn:"Bostezar",shiver:"Tiritar",clap:"Aplaudir",thumbsup:"Pulgar arriba",thumbsdown:"Pulgar abajo",point:"Se\xF1alar",bow:"Reverencia",fly:"Volar",stomp:"Pataleta",dizzy:"Mareado"},morphs:{spikes:"Pinchos",wings:"Alas",hands:"Manos",horns:"Cuernos",puff:"Hincharse",squish:"Aplastarse",stretch:"Estirarse",melt:"Derretirse",jelly:"Gelatina"},effects:{sparkles:"Destellos",sweat:"Sudor",blush:"Rubor",hearts:"Corazones",zzz:"Zzz",exclaim:"Exclamaci\xF3n",question:"Pregunta",anger:"Enfado",steam:"Vapor",confetti:"Confeti",tears:"L\xE1grimas",thought:"Pensamiento",notes:"Notas",sneeze:"Estornudo",bubble:"Burbuja",dizzy:"Mareo"}},editor:{kinds:{label:"Tipo de avatar",character:"Personaje 2D",plush:"Personaje 3D",image:"Imagen"},tabs:{styles:"Estilos",shape:"Forma",color:"Color y acabado",eyes:"Ojos",mouth:"Boca",face:"Cara",acc:"Accesorios"},controls:"Controles de edici\xF3n",preview:"Vista previa del avatar",undo:"Deshacer",undoTitle:"Deshacer ({keys})",redo:"Rehacer",redoTitle:"Rehacer ({keys})",random:"Aleatorio",randomTitle:"Personaje aleatorio",talk:"Hablar",mood:"\xC1nimo",gesture:"Gesto",gesturePick:"Gesto\u2026",morph:"Transformaci\xF3n",morphPick:"Transformar\u2026",talkSample:"\xA1Hola! Soy tu nuevo ot. \xBFQu\xE9 tal sueno?",copyJson:"Copiar JSON",jsonCopied:"JSON copiado",copyFailed:"No se pudo copiar",pngFailed:"No se pudo generar el PNG",plush:{material:"Material",materials:{plush:"Peluche",vinyl:"Vinilo"},hint:"Arr\xE1stralo para girarlo. Se edita con las mismas pesta\xF1as que el 2D.",unavailable:"Este navegador no puede mostrar el 3D; ves la vista 2D (el widget har\xE1 lo mismo)."},image:{title:"Retrato",intro:"Una imagen fija (PNG, JPG, WebP o SVG). La boca no se anima; al hablar se ilumina el contorno.",url:"URL de la imagen",placeholder:"https://\u2026/retrato.png",alt:"Vista previa del retrato"},styles:{title:"Estilos completos",hint:"Un estilo reemplaza todo el personaje. Despu\xE9s puedes ajustar cada pieza.",keepBody:"Conservar mi forma y color al cambiar de estilo"},shape:{title:"Forma base",deform:"Deformar",hint:"Arrastra los puntos del contorno en la vista previa (con el teclado: selecciona un punto con Tab y mu\xE9velo con las flechas).",symmetry:"Simetr\xEDa",reset:"Restablecer forma",wider:"M\xE1s ancho",taller:"M\xE1s alto",point:"Punto {n} del contorno"},color:{body:"Color del cuerpo",swatch:"Color {color}",custom:"Personalizado",finish:"Acabado",outline:"Contorno",outlines:{auto:"Autom\xE1tico",none:"Sin contorno",thin:"Fino",bold:"Grueso"},pattern:"Patr\xF3n",patternColor:"Color del patr\xF3n"},eyes:{title:{one:"Ojos \xB7 # tipo",other:"Ojos \xB7 # tipos"},iris:"Iris",white:"Blanco",pupil:"Pupila",hint:"Tambi\xE9n puedes arrastrar los ojos en la vista previa: arriba/abajo cambia la altura y a los lados la separaci\xF3n.",drag:"Ojos: arrastra para mover"},mouth:{title:{one:"Boca \xB7 # tipo",other:"Boca \xB7 # tipos"},stroke:"Trazo",lipstick:"Pintalabios",hint:"Todas las bocas se abren al hablar (lip-sync con el audio de la voz). Pulsa \xAB{talk}\xBB para probarlo.",drag:"Boca: arrastra para mover"},face:{brows:"Cejas",browColor:"Color de cejas",cheeks:"Mejillas y marcas"},settings:"Ajustes",size:"Tama\xF1o",spacing:"Separaci\xF3n",height:"Altura",colorLabel:"Color",acc:{group:"{group} \xB7 pulsa para poner o quitar",empty:"A\xFAn no hay accesorios. Combina varios: gorro + gafas + pipa\u2026",worn:"Puestos ({count})",rotation:"Giro",posX:"Posici\xF3n X",posY:"Posici\xF3n Y",detail:"Detalle",flip:"Voltear",front:"Traer delante",back:"Llevar detr\xE1s",reset:"Recolocar",remove:"Quitar",hint:"Arr\xE1stralo en la vista previa; con la rueda del rat\xF3n cambias su tama\xF1o (con May\xFAs, el giro).",select:"Selecciona uno para moverlo, girarlo o cambiarle el color.",max:"M\xE1ximo {max} accesorios",drag:"{name}: arrastra para mover"}}},Ql={character:{avatar:"Avatar",shapes:{pou:"Pou",round:"Round",egg:"Egg",pear:"Pear",bean:"Bean",squircle:"Soft square",wide:"Wide",tall:"Tall",drop:"Drop",ghost:"Ghost",cat:"Ears",cloud:"Cloud",blob:"Squishy",robot:"Robot",heart:"Heart",mushroom:"Mushroom"},eyes:{round:"Round",dot:"Dots",kawaii:"Kawaii",anime:"Anime",cat:"Cat",sleepy:"Sleepy",happy:"Happy",closed:"Closed",wink:"Wink",star:"Stars",heart:"Hearts",cross:"K.O.",spiral:"Dizzy",angry:"Angry",sad:"Sad",wide:"Amazed",button:"Button",robot:"LED",led:"Bars",cyclops:"Cyclops",lashes:"Lashes",almond:"Realistic",googly:"Googly",sparkle:"Sparkly",dollar:"Dollar",pixel:"Pixel",bean:"Bean",tired:"Tired",villain:"Villain",glow:"Ghostly",teary:"Teary",hypno:"Hypnotized",focused:"Determined"},brows:{none:"No brows",soft:"Soft",thick:"Thick",thin:"Thin",arched:"Arched",bushy:"Bushy",dots:"Maro",unibrow:"Unibrow",angled:"Pointed"},mouths:{smile:"Smile",grin:"Big smile",laugh:"Laugh",open:"Open",oh:"Oh",flat:"Serious",frown:"Sad",smirk:"Cheeky",cat:"Cat",tongue:"Tongue out",vampire:"Fangs",buck:"Buck teeth",tiny:"Tiny",kiss:"Kiss",wavy:"Nervous",grit:"Gritted teeth",beak:"Beak",robot:"Grille",braces:"Braces",monster:"Monster",gap:"Gap-toothed",lips:"Lips",pout:"Pout",toothless:"Toothless",whistle:"Whistling",drool:"Drooling",square:"Square",mustachio:"Crooked smile"},cheeks:{none:"None",blush:"Blush",lines:"Anime blush",freckles:"Freckles",hearts:"Hearts",whiskers:"Cat whiskers",stars:"Little stars",paint:"War paint"},patterns:{none:"Plain",belly:"Belly",spots:"Spots",stripes:"Stripes",tiger:"Tiger",twotone:"Two-tone",mask:"Mask",hearts:"Hearts",stars:"Stars",circuit:"Circuit"},finishes:{glossy:"Glossy",soft3d:"Soft 3D",clay:"Clay",flat:"Flat",toon:"Comic",neon:"Neon",sketch:"Sketch"},groups:{head:"Head",eyes:"Eyes",face:"Face",neck:"Neck",back:"Back",extra:"Extras"},accessories:{crown:"Crown",tiara:"Tiara",pirate:"Pirate hat",tophat:"Top hat",beanie:"Beanie",cap:"Cap",cowboy:"Cowboy",wizard:"Wizard",party:"Party",chef:"Chef",viking:"Viking",grad:"Graduation",beret:"Beret",bow:"Bow",flower:"Flower",halo:"Halo",horns:"Horns",antenna:"Antennae",bunny:"Bunny ears",catears:"Cat ears",santa:"Santa",hardhat:"Hard hat",headband:"Ninja headband",bandana:"Pirate bandana",helmet:"Space helmet",headphones:"Headphones",hair:"Quiff",sprout:"Sprout",glasses:"Round glasses",square:"Square glasses",nerd:"Nerd glasses",sunglasses:"Sunglasses",aviator:"Aviator",heartglasses:"Heart glasses",starglasses:"Star glasses","3d":"3D glasses",monocle:"Monocle",eyepatch:"Eye patch",goggles:"Pilot goggles",visor:"Visor",mustache:"Mustache",handlebar:"Handlebar mustache",beard:"Beard",wizardbeard:"Wizard beard",goatee:"Goatee",pipe:"Pipe",lollipop:"Lollipop",clownnose:"Clown nose",nose:"Nose",pignose:"Piggy nose",bandaid:"Band-aid",scar:"Scar",ninjamask:"Ninja mask",facemask:"Face mask",bowtie:"Bow tie",tie:"Tie",scarf:"Scarf",pearls:"Pearl necklace",medal:"Medal",bell:"Bell",ruff:"Royal ruff",cape:"Royal cape",superhero:"Hero cape",wings:"Angel wings",batwings:"Bat wings",tail:"Devil tail",jetpack:"Jetpack",parrot:"Parrot",sparkles:"Sparkles",hearts:"Hearts",zzz:"Zzz",sweat:"Sweat drop"},presets:{classic:"Classic",pirate:"Pirate",king:"King",queen:"Queen",wizard:"Wizard",chef:"Chef",detective:"Detective",cowboy:"Cowboy",astronaut:"Astronaut",robot:"Robot",viking:"Viking",ninja:"Ninja",ghost:"Ghost",cat:"Kitty",devil:"Little devil",angel:"Angel",scientist:"Scientist",rocker:"Rocker",student:"Graduate",clown:"Clown",monster:"Monster",nerd:"Nerd",hero:"Superhero",neon:"Neon",santa:"Christmas",sprout:"Little sprout"},moods:{neutral:"Neutral",happy:"Happy",angry:"Angry",sad:"Sad",fear:"Fear",disgust:"Disgust",love:"Love",sleep:"Asleep",surprised:"Surprise"},gestures:{jump:"Jump",wiggle:"Wiggle",nod:"Nod",shake:"Shake head",spin:"Spin",bounce:"Bounce",wave:"Wave",think:"Think",celebrate:"Celebrate",surprise:"Surprise",shrug:"Shrug",sneeze:"Sneeze",hiccup:"Hiccup",laugh:"Laugh",dance:"Dance",yawn:"Yawn",shiver:"Shiver",clap:"Clap",thumbsup:"Thumbs up",thumbsdown:"Thumbs down",point:"Point",bow:"Bow",fly:"Fly",stomp:"Stomp",dizzy:"Dizzy"},morphs:{spikes:"Spikes",wings:"Wings",hands:"Hands",horns:"Horns",puff:"Puff up",squish:"Squish",stretch:"Stretch",melt:"Melt",jelly:"Jelly"},effects:{sparkles:"Sparkles",sweat:"Sweat",blush:"Blush",hearts:"Hearts",zzz:"Zzz",exclaim:"Exclamation",question:"Question",anger:"Anger",steam:"Steam",confetti:"Confetti",tears:"Tears",thought:"Thought",notes:"Notes",sneeze:"Sneeze",bubble:"Bubble",dizzy:"Dizzy"}},editor:{kinds:{label:"Avatar type",character:"2D character",plush:"3D character",image:"Image"},tabs:{styles:"Styles",shape:"Shape",color:"Color & finish",eyes:"Eyes",mouth:"Mouth",face:"Face",acc:"Accessories"},controls:"Editing controls",preview:"Avatar preview",undo:"Undo",undoTitle:"Undo ({keys})",redo:"Redo",redoTitle:"Redo ({keys})",random:"Random",randomTitle:"Random character",talk:"Talk",mood:"Mood",gesture:"Gesture",gesturePick:"Gesture\u2026",morph:"Transform",morphPick:"Transform\u2026",talkSample:"Hi there! I am your new ot. How do I sound?",copyJson:"Copy JSON",jsonCopied:"JSON copied",copyFailed:"Could not copy",pngFailed:"Could not create the PNG",plush:{material:"Material",materials:{plush:"Plush",vinyl:"Vinyl"},hint:"Drag to turn it. Edit it with the same tabs as the 2D one.",unavailable:"This browser can\u2019t show 3D; you see the 2D preview (the widget will do the same)."},image:{title:"Portrait",intro:"A still image (PNG, JPG, WebP or SVG). The mouth isn\u2019t animated; the outline lights up while speaking.",url:"Image URL",placeholder:"https://\u2026/portrait.png",alt:"Portrait preview"},styles:{title:"Complete styles",hint:"A style replaces the whole character. You can then adjust each part.",keepBody:"Keep my shape and color when changing style"},shape:{title:"Base shape",deform:"Reshape",hint:"Drag the outline points in the preview (with the keyboard: select a point with Tab and move it with the arrow keys).",symmetry:"Symmetry",reset:"Reset shape",wider:"Wider",taller:"Taller",point:"Outline point {n}"},color:{body:"Body color",swatch:"Color {color}",custom:"Custom",finish:"Finish",outline:"Outline",outlines:{auto:"Automatic",none:"No outline",thin:"Thin",bold:"Bold"},pattern:"Pattern",patternColor:"Pattern color"},eyes:{title:{one:"Eyes \xB7 # type",other:"Eyes \xB7 # types"},iris:"Iris",white:"White",pupil:"Pupil",hint:"You can also drag the eyes in the preview: up/down changes the height and sideways the spacing.",drag:"Eyes: drag to move"},mouth:{title:{one:"Mouth \xB7 # type",other:"Mouth \xB7 # types"},stroke:"Stroke",lipstick:"Lipstick",hint:"Every mouth opens while speaking (lip-sync with the voice audio). Press \u201C{talk}\u201D to try it.",drag:"Mouth: drag to move"},face:{brows:"Eyebrows",browColor:"Eyebrow color",cheeks:"Cheeks & marks"},settings:"Settings",size:"Size",spacing:"Spacing",height:"Height",colorLabel:"Color",acc:{group:"{group} \xB7 tap to add or remove",empty:"No accessories yet. Mix several: hat + glasses + pipe\u2026",worn:"Wearing ({count})",rotation:"Rotation",posX:"Position X",posY:"Position Y",detail:"Detail",flip:"Flip",front:"Bring forward",back:"Send backward",reset:"Reposition",remove:"Remove",hint:"Drag it in the preview; the mouse wheel changes its size (with Shift, the rotation).",select:"Select one to move it, rotate it or change its color.",max:"Up to {max} accessories",drag:"{name}: drag to move"}}},Zl={character:{avatar:"Avatar",shapes:{pou:"Pou",round:"Redondo",egg:"Ovo",pear:"Pera",bean:"Vagem",squircle:"Quadrado suave",wide:"Largo",tall:"Alto",drop:"Gota",ghost:"Fantasma",cat:"Orelhas",cloud:"Nuvem",blob:"Fofinho",robot:"Rob\xF4",heart:"Cora\xE7\xE3o",mushroom:"Cogumelo"},eyes:{round:"Redondos",dot:"Pontinhos",kawaii:"Kawaii",anime:"Anime",cat:"Gato",sleepy:"Sonolentos",happy:"Felizes",closed:"Fechados",wink:"Piscadinha",star:"Estrelas",heart:"Cora\xE7\xF5es",cross:"K.O.",spiral:"Tonto",angry:"Bravos",sad:"Tristes",wide:"Espantados",button:"Bot\xE3o",robot:"LED",led:"Barras",cyclops:"Ciclope",lashes:"C\xEDlios",almond:"Realistas",googly:"Malucos",sparkle:"Brilhantes",dollar:"D\xF3lar",pixel:"Pixel",bean:"Feij\xE3o",tired:"Cansados",villain:"Vil\xE3o",glow:"Fantasmag\xF3ricos",teary:"Chorosos",hypno:"Hipnose",focused:"Decididos"},brows:{none:"Sem sobrancelhas",soft:"Suaves",thick:"Grossas",thin:"Finas",arched:"Arqueadas",bushy:"Cheias",dots:"Maro",unibrow:"Monocelha",angled:"Pontudas"},mouths:{smile:"Sorriso",grin:"Sorris\xE3o",laugh:"Gargalhada",open:"Aberta",oh:"Oh",flat:"S\xE9ria",frown:"Triste",smirk:"Marota",cat:"Felina",tongue:"L\xEDngua de fora",vampire:"Presas",buck:"Dentu\xE7a",tiny:"Pequenininha",kiss:"Beijo",wavy:"Nervosa",grit:"Dentes cerrados",beak:"Bico",robot:"Grade",braces:"Aparelho",monster:"Monstro",gap:"Janelinha",lips:"L\xE1bios",pout:"Beicinho",toothless:"Banguela",whistle:"Assobiando",drool:"Babando",square:"Quadrada",mustachio:"Sorriso de lado"},cheeks:{none:"Nada",blush:"Rubor",lines:"Rubor anime",freckles:"Sardas",hearts:"Cora\xE7\xF5es",whiskers:"Bigodes de gato",stars:"Estrelinhas",paint:"Pintura de guerra"},patterns:{none:"Liso",belly:"Barriga",spots:"Manchas",stripes:"Listras",tiger:"Tigre",twotone:"Duas cores",mask:"M\xE1scara",hearts:"Cora\xE7\xF5es",stars:"Estrelas",circuit:"Circuito"},finishes:{glossy:"Brilhante",soft3d:"3D suave",clay:"Massinha",flat:"Plano",toon:"Quadrinhos",neon:"Neon",sketch:"Esbo\xE7o"},groups:{head:"Cabe\xE7a",eyes:"Olhos",face:"Rosto",neck:"Pesco\xE7o",back:"Costas",extra:"Extras"},accessories:{crown:"Coroa",tiara:"Tiara",pirate:"Chap\xE9u pirata",tophat:"Cartola",beanie:"Gorro de l\xE3",cap:"Bon\xE9",cowboy:"Caub\xF3i",wizard:"Mago",party:"Festa",chef:"Chef",viking:"Viking",grad:"Formatura",beret:"Boina",bow:"La\xE7o",flower:"Flor",halo:"Aur\xE9ola",horns:"Chifres",antenna:"Antenas",bunny:"Orelhas de coelho",catears:"Orelhas de gato",santa:"Papai Noel",hardhat:"Capacete de obra",headband:"Faixa ninja",bandana:"Bandana pirata",helmet:"Capacete espacial",headphones:"Fones de ouvido",hair:"Topete",sprout:"Broto",glasses:"\xD3culos redondos",square:"\xD3culos quadrados",nerd:"\xD3culos de nerd",sunglasses:"\xD3culos de sol",aviator:"Aviador",heartglasses:"\xD3culos de cora\xE7\xE3o",starglasses:"\xD3culos de estrela","3d":"\xD3culos 3D",monocle:"Mon\xF3culo",eyepatch:"Tapa-olho",goggles:"\xD3culos de piloto",visor:"Viseira",mustache:"Bigode",handlebar:"Bigode guid\xE3o",beard:"Barba",wizardbeard:"Barba de mago",goatee:"Cavanhaque",pipe:"Cachimbo",lollipop:"Pirulito",clownnose:"Nariz de palha\xE7o",nose:"Nariz",pignose:"Focinho de porquinho",bandaid:"Curativo",scar:"Cicatriz",ninjamask:"M\xE1scara ninja",facemask:"M\xE1scara facial",bowtie:"Gravata-borboleta",tie:"Gravata",scarf:"Cachecol",pearls:"Colar de p\xE9rolas",medal:"Medalha",bell:"Guizo",ruff:"Gola real",cape:"Capa real",superhero:"Capa de her\xF3i",wings:"Asas de anjo",batwings:"Asas de morcego",tail:"Rabo de diabinho",jetpack:"Mochila a jato",parrot:"Papagaio",sparkles:"Brilhos",hearts:"Cora\xE7\xF5es",zzz:"Zzz",sweat:"Gota de suor"},presets:{classic:"Cl\xE1ssico",pirate:"Pirata",king:"Rei",queen:"Rainha",wizard:"Mago",chef:"Chef",detective:"Detetive",cowboy:"Caub\xF3i",astronaut:"Astronauta",robot:"Rob\xF4",viking:"Viking",ninja:"Ninja",ghost:"Fantasma",cat:"Gatinho",devil:"Diabinho",angel:"Anjo",scientist:"Cientista",rocker:"Roqueiro",student:"Formanda",clown:"Palha\xE7o",monster:"Monstro",nerd:"Nerd",hero:"Super-her\xF3i",neon:"Neon",santa:"Natal",sprout:"Brotinho"},moods:{neutral:"Neutro",happy:"Contente",angry:"Bravo",sad:"Triste",fear:"Medo",disgust:"Nojo",love:"Amor",sleep:"Dormindo",surprised:"Surpresa"},gestures:{jump:"Pular",wiggle:"Balan\xE7ar",nod:"Assentir",shake:"Negar",spin:"Girar",bounce:"Quicar",wave:"Acenar",think:"Pensar",celebrate:"Comemorar",surprise:"Surpreender-se",shrug:"Dar de ombros",sneeze:"Espirrar",hiccup:"Solu\xE7o",laugh:"Rir",dance:"Dan\xE7ar",yawn:"Bocejar",shiver:"Tremer",clap:"Aplaudir",thumbsup:"Joinha",thumbsdown:"Polegar para baixo",point:"Apontar",bow:"Rever\xEAncia",fly:"Voar",stomp:"Birra",dizzy:"Tonto"},morphs:{spikes:"Espinhos",wings:"Asas",hands:"M\xE3os",horns:"Chifres",puff:"Inchar",squish:"Achatar",stretch:"Esticar",melt:"Derreter",jelly:"Gelatina"},effects:{sparkles:"Brilhos",sweat:"Suor",blush:"Rubor",hearts:"Cora\xE7\xF5es",zzz:"Zzz",exclaim:"Exclama\xE7\xE3o",question:"Pergunta",anger:"Raiva",steam:"Vapor",confetti:"Confete",tears:"L\xE1grimas",thought:"Pensamento",notes:"Notas",sneeze:"Espirro",bubble:"Bolha",dizzy:"Tontura"}},editor:{kinds:{label:"Tipo de avatar",character:"Personagem 2D",plush:"Personagem 3D",image:"Imagem"},tabs:{styles:"Estilos",shape:"Forma",color:"Cor e acabamento",eyes:"Olhos",mouth:"Boca",face:"Rosto",acc:"Acess\xF3rios"},controls:"Controles de edi\xE7\xE3o",preview:"Pr\xE9via do avatar",undo:"Desfazer",undoTitle:"Desfazer ({keys})",redo:"Refazer",redoTitle:"Refazer ({keys})",random:"Aleat\xF3rio",randomTitle:"Personagem aleat\xF3rio",talk:"Falar",mood:"Humor",gesture:"Gesto",gesturePick:"Gesto\u2026",morph:"Transforma\xE7\xE3o",morphPick:"Transformar\u2026",talkSample:"Ol\xE1! Eu sou o seu novo ot. Como estou soando?",copyJson:"Copiar JSON",jsonCopied:"JSON copiado",copyFailed:"N\xE3o foi poss\xEDvel copiar",pngFailed:"N\xE3o foi poss\xEDvel gerar o PNG",plush:{material:"Material",materials:{plush:"Pel\xFAcia",vinyl:"Vinil"},hint:"Arraste para gir\xE1-lo. Edite com as mesmas abas do 2D.",unavailable:"Este navegador n\xE3o consegue mostrar o 3D; voc\xEA v\xEA a pr\xE9via 2D (o widget far\xE1 o mesmo)."},image:{title:"Retrato",intro:"Uma imagem fixa (PNG, JPG, WebP ou SVG). A boca n\xE3o \xE9 animada; ao falar, o contorno se ilumina.",url:"URL da imagem",placeholder:"https://\u2026/retrato.png",alt:"Pr\xE9via do retrato"},styles:{title:"Estilos completos",hint:"Um estilo substitui o personagem inteiro. Depois voc\xEA pode ajustar cada pe\xE7a.",keepBody:"Manter minha forma e cor ao trocar de estilo"},shape:{title:"Forma base",deform:"Deformar",hint:"Arraste os pontos do contorno na pr\xE9via (pelo teclado: selecione um ponto com Tab e mova-o com as setas).",symmetry:"Simetria",reset:"Restaurar forma",wider:"Mais largo",taller:"Mais alto",point:"Ponto {n} do contorno"},color:{body:"Cor do corpo",swatch:"Cor {color}",custom:"Personalizada",finish:"Acabamento",outline:"Contorno",outlines:{auto:"Autom\xE1tico",none:"Sem contorno",thin:"Fino",bold:"Grosso"},pattern:"Padr\xE3o",patternColor:"Cor do padr\xE3o"},eyes:{title:{one:"Olhos \xB7 # tipo",other:"Olhos \xB7 # tipos"},iris:"\xCDris",white:"Branco",pupil:"Pupila",hint:"Voc\xEA tamb\xE9m pode arrastar os olhos na pr\xE9via: para cima/baixo muda a altura e para os lados, a separa\xE7\xE3o.",drag:"Olhos: arraste para mover"},mouth:{title:{one:"Boca \xB7 # tipo",other:"Boca \xB7 # tipos"},stroke:"Tra\xE7o",lipstick:"Batom",hint:"Todas as bocas se abrem ao falar (lip-sync com o \xE1udio da voz). Toque em \u201C{talk}\u201D para testar.",drag:"Boca: arraste para mover"},face:{brows:"Sobrancelhas",browColor:"Cor das sobrancelhas",cheeks:"Bochechas e marcas"},settings:"Ajustes",size:"Tamanho",spacing:"Separa\xE7\xE3o",height:"Altura",colorLabel:"Cor",acc:{group:"{group} \xB7 toque para colocar ou tirar",empty:"Ainda n\xE3o h\xE1 acess\xF3rios. Combine v\xE1rios: gorro + \xF3culos + cachimbo\u2026",worn:"Usando ({count})",rotation:"Giro",posX:"Posi\xE7\xE3o X",posY:"Posi\xE7\xE3o Y",detail:"Detalhe",flip:"Espelhar",front:"Trazer para frente",back:"Levar para tr\xE1s",reset:"Reposicionar",remove:"Tirar",hint:"Arraste-o na pr\xE9via; com a roda do mouse voc\xEA muda o tamanho (com Shift, o giro).",select:"Selecione um para mov\xEA-lo, gir\xE1-lo ou mudar a cor.",max:"M\xE1ximo de {max} acess\xF3rios",drag:"{name}: arraste para mover"}}};gt({es:Wl,en:Ql,pt:Zl})});function ft(e,t,o){let s=e||ts,a=`character.${t}.${o}`,r=s(a);if(r!==a)return r;let n=Jl[t]?.find(c=>(Array.isArray(c)?c[0]:c.id)===o);return(Array.isArray(n)?n[1]:n?.label)||String(o)}function pt(e){let t=String(e).replace("#",""),o=t.length===3?t.split("").map(s=>s+s).join(""):t.padEnd(6,"0").slice(0,6);return[0,2,4].map(s=>parseInt(o.slice(s,s+2),16)||0)}function Y(e,t){let o=t<0?0:255,s=Math.abs(t);return Yl(pt(e).map(a=>a+(o-a)*s))}function Jt(e){let[t,o,s]=pt(e).map(a=>a/255);return .2126*t+.7152*o+.0722*s}function De({cx:e=100,cy:t=112,rxT:o=60,rxB:s=60,ryT:a=66,ryB:r=66,nT:i=2,nB:n=2,tweak:c}={}){let h=[];for(let u=0;u<Xe;u++){let d=-Math.PI/2+u/Xe*Math.PI*2,p=Math.cos(d),f=Math.sin(d),m=f<0,g=2/(m?i:n),b=m?o:s,$=(Math.abs(f)<1e-9,b),v=e+$*Math.sign(p)*Math.abs(p)**g,S=t+(m?a:r)*Math.sign(f)*Math.abs(f)**g;c&&([v,S]=c(u,v,S)),h.push([l(v),l(S)])}return h}function Kl(e,t,o){let s=o*e*.35;return`${`M${l(-e)} ${l(-s)}Q0 ${l(s*.6-t*.15)} ${l(e)} ${l(-s)}`}Q${l(e*.8)} ${l(t+s*.2)} 0 ${l(t+s*.4)}Q${l(-e*.8)} ${l(t+s*.2)} ${l(-e)} ${l(-s)}Z`}function ut(e,{w:t=e.w,min:o=0,max:s=1,teeth:a=!1,tongue:r=!0,fangs:i=!1,sharp:n=!1,gap:c=!1,braces:h=!1}={}){let u=(o+(s-o)*e.open)*t*1.1,d=e.curve,p=`m${Math.round(Math.random()*1e9)}`,f=Kl(t,Math.max(u,1.5),d),m="";if(r&&u>t*.35&&(m+=`<ellipse cx="0" cy="${l(u+d*t*.35)}" rx="${l(t*.55)}" ry="${l(u*.45)}" fill="${e.tongue}"/>`),a){let g=-d*t*.35;if(n){let b=`M${l(-t)} ${l(g-2)}`;for(let $=0;$<=8;$++)b+=`L${l(-t+$*t/4)} ${l(g+($%2?t*.28:-1))}`;m+=`<path d="${b}V${l(g-4)}Z" fill="${e.teeth}"/>`}else m+=`<rect x="${l(-t)}" y="${l(g-4)}" width="${l(t*2)}" height="${l(Math.max(4,t*.3)+4)}" fill="${e.teeth}"/>`;c&&(m+=`<rect x="${l(-t*.12)}" y="${l(g-4)}" width="${l(t*.24)}" height="${l(t*.3+4)}" fill="${e.ink}"/>`),h&&(m+=`<path d="M${l(-t)} ${l(g+t*.18)}H${l(t)}" stroke="#a3a3a3" stroke-width="2"/>${[-.6,-.2,.2,.6].map(b=>`<rect x="${l(b*t-1.5)}" y="${l(g+t*.18-2)}" width="3" height="4" fill="#d4d4d4"/>`).join("")}`)}return i&&(m+=`<path d="M${l(-t*.55)} ${l(-d*t*.3-1)}l${l(t*.12)} ${l(t*.4)}l${l(t*.12)} ${l(-t*.4)}ZM${l(t*.31)} ${l(-d*t*.3-1)}l${l(t*.12)} ${l(t*.4)}l${l(t*.12)} ${l(-t*.4)}Z" fill="${e.teeth}"/>`),`<clipPath id="${p}"><path d="${f}"/></clipPath><path d="${f}" fill="${e.ink}"/><g clip-path="url(#${p})">${m}</g><path d="${f}" fill="none" stroke="${e.lip}" stroke-width="${l(Math.max(1.4,t*.1))}" stroke-linejoin="round"/>`}var l,Yl,Xe,Ct,Qe,Tt,Oo,dt,It,eo,po,go,Bt,mo,to,yo,bo,$o,zo,U,Xl,fi,Xa,pi,mi,gi,ps,oo,ee,qo,Jl,wo=Ke(()=>{ui();_e();l=e=>Math.round(e*100)/100;Yl=e=>`#${e.map(t=>Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")).join("")}`;Xe=16;Ct=[{id:"pou",label:"Pou",points:De({rxT:50,rxB:66,ryT:70,ryB:56,nT:2.1,nB:2.6})},{id:"round",label:"Redondo",points:De({rxT:64,rxB:64,ryT:64,ryB:64})},{id:"egg",label:"Huevo",points:De({rxT:50,rxB:60,ryT:76,ryB:56})},{id:"pear",label:"Pera",points:De({rxT:40,rxB:70,ryT:72,ryB:52,nB:2.4})},{id:"bean",label:"Jud\xEDa",points:De({rxT:56,rxB:56,ryT:74,ryB:62,nT:2.6,nB:2.6})},{id:"squircle",label:"Cuadrado suave",points:De({rxT:62,rxB:62,ryT:64,ryB:60,nT:4,nB:4})},{id:"wide",label:"Ancho",points:De({rxT:74,rxB:78,ryT:50,ryB:50,nT:2.4,nB:3})},{id:"tall",label:"Alto",points:De({rxT:46,rxB:50,ryT:82,ryB:70,nT:2.4,nB:2.8})},{id:"drop",label:"Gota",points:De({rxT:34,rxB:62,ryT:82,ryB:56,nT:1.3,nB:2.2})},{id:"ghost",label:"Fantasma",points:De({rxT:58,rxB:62,ryT:70,ryB:64,nT:2,nB:5,tweak:(e,t,o)=>e>=6&&e<=10?[t,o+(e%2?-10:6)]:[t,o]})},{id:"cat",label:"Orejas",points:De({rxT:58,rxB:64,ryT:64,ryB:58,nT:2.4,nB:2.6,tweak:(e,t,o)=>e===2||e===14?[t+(e===2?6:-6),o-30]:e===1||e===15?[t,o+6]:[t,o]})},{id:"cloud",label:"Nube",points:De({rxT:66,rxB:70,ryT:58,ryB:56,tweak:(e,t,o)=>e%2?[100+(t-100)*.9,112+(o-112)*.9]:[t,o]})},{id:"blob",label:"Blandito",points:De({rxT:58,rxB:68,ryT:66,ryB:58,tweak:(e,t,o)=>[t+Math.sin(e*1.7)*5,o+Math.cos(e*2.3)*4]})},{id:"robot",label:"Robot",points:De({rxT:60,rxB:60,ryT:66,ryB:62,nT:7,nB:7})},{id:"heart",label:"Coraz\xF3n",points:De({rxT:70,rxB:64,ryT:58,ryB:70,nT:2.4,nB:1.6,tweak:(e,t,o)=>e===0?[t,o+22]:e===1||e===15?[t,o+4]:e===8?[t,o+6]:[t,o]})},{id:"mushroom",label:"Seta",points:De({rxT:78,rxB:46,ryT:62,ryB:64,nT:2.2,nB:3.2})}],Qe=(e,t,o,s=1)=>`<circle cx="${l(e)}" cy="${l(t)}" r="${l(o)}" fill="#fff" opacity="${s}"/>`,Tt=(e,t=.45,o=5)=>{let s="";for(let a=0;a<o*2;a++){let r=-Math.PI/2+a*Math.PI/o,i=a%2?e*t:e;s+=`${a?"L":"M"}${l(Math.cos(r)*i)} ${l(Math.sin(r)*i)}`}return`${s}Z`},Oo=e=>`M0 ${l(e*.9)}C${l(-e*1.4)} ${l(-e*.1)} ${l(-e*.7)} ${l(-e*1.05)} 0 ${l(-e*.35)}C${l(e*.7)} ${l(-e*1.05)} ${l(e*1.4)} ${l(-e*.1)} 0 ${l(e*.9)}Z`,dt=(e,t)=>[l(e.lx*e.r*t),l(e.ly*e.r*t)],It=(e,t,o=.35,s=e.ink)=>{let[a,r]=dt(e,o);return`<circle cx="${a}" cy="${r}" r="${l(t)}" fill="${s}"/>${Qe(a-t*.35,r-t*.4,t*.32)}`},eo=[{id:"round",label:"Redondos",draw:e=>`<circle r="${e.r}" fill="${e.white}"/>${It(e,e.r*.55)}`},{id:"dot",label:"Puntitos",draw:e=>{let[t,o]=dt(e,.15);return`<ellipse cx="${t}" cy="${o}" rx="${l(e.r*.42)}" ry="${l(e.r*.58)}" fill="${e.ink}"/>${Qe(t-e.r*.12,o-e.r*.22,e.r*.14)}`}},{id:"kawaii",label:"Kawaii",draw:e=>{let[t,o]=dt(e,.1);return`<circle cx="${t}" cy="${o}" r="${l(e.r*.95)}" fill="${e.ink}"/>${Qe(t-e.r*.32,o-e.r*.34,e.r*.34)}${Qe(t+e.r*.34,o+e.r*.36,e.r*.16)}`}},{id:"anime",label:"Anime",draw:e=>{let[t,o]=dt(e,.22);return`<ellipse rx="${l(e.r*.9)}" ry="${l(e.r*1.2)}" fill="${e.white}"/>
1
+ var tl=Object.create;var Ha=Object.defineProperty;var ol=Object.getOwnPropertyDescriptor;var sl=Object.getOwnPropertyNames;var al=Object.getPrototypeOf,rl=Object.prototype.hasOwnProperty;var Ke=(e,t,o)=>()=>{if(o)throw o[0];try{return e&&(t=e(e=0)),t}catch(s){throw o=[s],s}};var Pa=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(o){throw t=0,o}},il=(e,t)=>{for(var o in t)Ha(e,o,{get:t[o],enumerable:!0})},nl=(e,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of sl(t))!rl.call(e,a)&&a!==o&&Ha(e,a,{get:()=>t[a],enumerable:!(s=ol(t,a))||s.enumerable});return e};var jt=(e,t,o)=>(o=e!=null?tl(al(e)):{},nl(t||!e||!e.__esModule?Ha(o,"default",{value:e,enumerable:!0}):o,e));function Gs(e,t){let o=Fr(e);if(!o||!t||typeof t!="object")return;let s=Lo[o]||=new Map;Wr(t,"",s),Qr()}function gt(e){for(let[t,o]of Object.entries(e||{}))Gs(t,o)}function hl(){return Object.keys(Lo)}function Vs(...e){let t=e.flat().filter(Boolean).flatMap(o=>String(o).split(",")).map(o=>Fr(o.split(";")[0]));for(let o of t){if(!o)continue;if(Lo[o])return o;let s=o.split("-")[0];if(Lo[s])return s}return t.some(Boolean)&&Lo.en,"en"}function We(e){let t=typeof document<"u"?document.documentElement.lang:"",o=typeof navigator<"u"?navigator.languages||[navigator.language]:[];return Vs(e,t,o)}function re(e){let t=e?Vs(e):null,o=(s,a)=>Ur(Oa(t||Ue,s),a,t||Ue,s);return Object.defineProperty(o,"locale",{get:()=>t||Ue}),o.has=s=>Oa(t||Ue,s)!==void 0,o}function ts(e,t){return Ur(Oa(Ue,e),t,Ue,e)}function Nt(){return Ue}function qa(e){let t=Vs(e);return t===Ue||(Ue=t,Qr()),Ue}function os(e){return La.add(e),()=>La.delete(e)}function Fs(e,t=Ue,o){try{return new Intl.NumberFormat(t,o).format(e)}catch{return String(e)}}function dl(e,t=Ue,o="conjunction"){try{return new Intl.ListFormat(t,{style:"long",type:o}).format(e)}catch{return e.join(", ")}}function Fr(e){let t=String(e||"").trim().replace("_","-");if(!/^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$/.test(t))return"";let[o,...s]=t.split("-");return[o.toLowerCase(),...s.map(a=>a.length===2?a.toUpperCase():a)].join("-")}function ul(e){let t=[e],o=e.split("-")[0];o!==e&&t.push(o);for(let s of["en","en"])t.includes(s)||t.push(s);return t}function Oa(e,t){for(let o of ul(e)){let s=Lo[o]?.get(t);if(s!==void 0)return s}}function Ur(e,t,o,s){if(e===void 0)return s;let a=e;if(typeof e=="object"){let r=Number(t?.count??0),i="other";try{i=r===0&&e.zero!==void 0?"zero":new Intl.PluralRules(o).select(r)}catch{i=r===1?"one":"other"}a=String(e[i]??e.other??"").replace(/#/g,Fs(r,o))}return t?a.replace(/\{(\w+)\}/g,(r,i)=>t[i]!==void 0&&t[i]!==null?String(t[i]):r):a}function Wr(e,t,o){for(let[s,a]of Object.entries(e)){let r=t?`${t}.${s}`:s;a&&typeof a=="object"&&!Array.isArray(a)?Object.keys(a).length&&Object.keys(a).every(i=>fl.has(i))?o.set(r,{...a}):Wr(a,r,o):typeof a=="string"&&o.set(r,a)}}function Qr(){for(let e of La)try{e(Ue)}catch{}}var za,ll,cl,Lo,La,Ue,fl,_e=Ke(()=>{za=["es","en","pt"],ll="en",cl={es:"Espa\xF1ol",en:"English",pt:"Portugu\xEAs",fr:"Fran\xE7ais",de:"Deutsch",it:"Italiano",ca:"Catal\xE0"},Lo=Object.create(null),La=new Set,Ue="en";fl=new Set(["zero","one","two","few","many","other"])});var Wl,Ql,Zl,ui=Ke(()=>{_e();Wl={character:{avatar:"Avatar",shapes:{pou:"Pou",round:"Redondo",egg:"Huevo",pear:"Pera",bean:"Jud\xEDa",squircle:"Cuadrado suave",wide:"Ancho",tall:"Alto",drop:"Gota",ghost:"Fantasma",cat:"Orejas",cloud:"Nube",blob:"Blandito",robot:"Robot",heart:"Coraz\xF3n",mushroom:"Seta"},eyes:{round:"Redondos",dot:"Puntitos",kawaii:"Kawaii",anime:"Anime",cat:"Gato",sleepy:"Dormilones",happy:"Felices",closed:"Cerrados",wink:"Gui\xF1o",star:"Estrellas",heart:"Corazones",cross:"K.O.",spiral:"Mareado",angry:"Enfadados",sad:"Tristes",wide:"Asombrados",button:"Bot\xF3n",robot:"LED",led:"Barras",cyclops:"C\xEDclope",lashes:"Pesta\xF1as",almond:"Realistas",googly:"Locos",sparkle:"Brillantes",dollar:"D\xF3lar",pixel:"P\xEDxel",bean:"Alubia",tired:"Cansados",villain:"Villano",glow:"Fantasmales",teary:"Llorosos",hypno:"Hipnosis",focused:"Decididos"},brows:{none:"Sin cejas",soft:"Suaves",thick:"Gruesas",thin:"Finas",arched:"Arqueadas",bushy:"Pobladas",dots:"Maro",unibrow:"Uniceja",angled:"Picudas"},mouths:{smile:"Sonrisa",grin:"Sonrisa amplia",laugh:"Carcajada",open:"Abierta",oh:"Oh",flat:"Seria",frown:"Triste",smirk:"P\xEDcara",cat:"Gatuna",tongue:"Lengua fuera",vampire:"Colmillos",buck:"Paletas",tiny:"Peque\xF1ita",kiss:"Beso",wavy:"Nerviosa",grit:"Dientes apretados",beak:"Pico",robot:"Rejilla",braces:"Brackets",monster:"Monstruo",gap:"Mellada",lips:"Labios",pout:"Puchero",toothless:"Desdentada",whistle:"Silbando",drool:"Babeando",square:"Cuadrada",mustachio:"Sonrisa ladeada"},cheeks:{none:"Nada",blush:"Rubor",lines:"Rubor anime",freckles:"Pecas",hearts:"Corazones",whiskers:"Bigotes de gato",stars:"Estrellitas",paint:"Pintura de guerra"},patterns:{none:"Liso",belly:"Barriga",spots:"Manchas",stripes:"Rayas",tiger:"Tigre",twotone:"Dos tonos",mask:"Antifaz",hearts:"Corazones",stars:"Estrellas",circuit:"Circuito"},finishes:{glossy:"Brillante",soft3d:"3D suave",clay:"Plastilina",flat:"Plano",toon:"C\xF3mic",neon:"Ne\xF3n",sketch:"Boceto"},groups:{head:"Cabeza",eyes:"Ojos",face:"Cara",neck:"Cuello",back:"Espalda",extra:"Extras"},accessories:{crown:"Corona",tiara:"Tiara",pirate:"Sombrero pirata",tophat:"Chistera",beanie:"Gorro de lana",cap:"Gorra",cowboy:"Vaquero",wizard:"Mago",party:"Fiesta",chef:"Chef",viking:"Vikingo",grad:"Graduaci\xF3n",beret:"Boina",bow:"Lazo",flower:"Flor",halo:"Aureola",horns:"Cuernos",antenna:"Antenas",bunny:"Orejas de conejo",catears:"Orejas de gato",santa:"Pap\xE1 Noel",hardhat:"Casco de obra",headband:"Cinta ninja",bandana:"Pa\xF1uelo pirata",helmet:"Casco espacial",headphones:"Auriculares",hair:"Tup\xE9",sprout:"Brote",glasses:"Gafas redondas",square:"Gafas cuadradas",nerd:"Gafas empoll\xF3n",sunglasses:"Gafas de sol",aviator:"Aviador",heartglasses:"Gafas coraz\xF3n",starglasses:"Gafas estrella","3d":"Gafas 3D",monocle:"Mon\xF3culo",eyepatch:"Parche",goggles:"Gafas de piloto",visor:"Visor",mustache:"Bigote",handlebar:"Bigote manillar",beard:"Barba",wizardbeard:"Barba de mago",goatee:"Perilla",pipe:"Pipa",lollipop:"Piruleta",clownnose:"Nariz de payaso",nose:"Nariz",pignose:"Nariz de cerdito",bandaid:"Tirita",scar:"Cicatriz",ninjamask:"M\xE1scara ninja",facemask:"Mascarilla",bowtie:"Pajarita",tie:"Corbata",scarf:"Bufanda",pearls:"Collar de perlas",medal:"Medalla",bell:"Cascabel",ruff:"Gorguera real",cape:"Capa real",superhero:"Capa de h\xE9roe",wings:"Alas de \xE1ngel",batwings:"Alas de murci\xE9lago",tail:"Cola de diablillo",jetpack:"Mochila cohete",parrot:"Loro",sparkles:"Destellos",hearts:"Corazones",zzz:"Zzz",sweat:"Gota de sudor"},presets:{classic:"Cl\xE1sico",pirate:"Pirata",king:"Rey",queen:"Reina",wizard:"Mago",chef:"Chef",detective:"Detective",cowboy:"Vaquero",astronaut:"Astronauta",robot:"Robot",viking:"Vikingo",ninja:"Ninja",ghost:"Fantasma",cat:"Gatito",devil:"Diablillo",angel:"\xC1ngel",scientist:"Cient\xEDfica",rocker:"Rockero",student:"Graduada",clown:"Payaso",monster:"Monstruo",nerd:"Empoll\xF3n",hero:"Superh\xE9roe",neon:"Ne\xF3n",santa:"Navidad",sprout:"Brotecito"},moods:{neutral:"Neutral",happy:"Contento",angry:"Enfadado",sad:"Triste",fear:"Miedo",disgust:"Asco",love:"Amor",sleep:"Dormido",surprised:"Sorpresa"},gestures:{jump:"Saltar",wiggle:"Menearse",nod:"Asentir",shake:"Negar",spin:"Girar",bounce:"Botar",wave:"Saludar",think:"Pensar",celebrate:"Celebrar",surprise:"Sorprenderse",shrug:"Encogerse de hombros",sneeze:"Estornudar",hiccup:"Hipo",laugh:"Re\xEDr",dance:"Bailar",yawn:"Bostezar",shiver:"Tiritar",clap:"Aplaudir",thumbsup:"Pulgar arriba",thumbsdown:"Pulgar abajo",point:"Se\xF1alar",bow:"Reverencia",fly:"Volar",stomp:"Pataleta",dizzy:"Mareado"},morphs:{spikes:"Pinchos",wings:"Alas",hands:"Manos",horns:"Cuernos",puff:"Hincharse",squish:"Aplastarse",stretch:"Estirarse",melt:"Derretirse",jelly:"Gelatina"},effects:{sparkles:"Destellos",sweat:"Sudor",blush:"Rubor",hearts:"Corazones",zzz:"Zzz",exclaim:"Exclamaci\xF3n",question:"Pregunta",anger:"Enfado",steam:"Vapor",confetti:"Confeti",tears:"L\xE1grimas",thought:"Pensamiento",notes:"Notas",sneeze:"Estornudo",bubble:"Burbuja",dizzy:"Mareo"}},editor:{kinds:{label:"Tipo de avatar",character:"Personaje 2D",plush:"Personaje 3D",image:"Tarjeta"},tabs:{styles:"Estilos",shape:"Forma",color:"Color y acabado",eyes:"Ojos",mouth:"Boca",face:"Cara",acc:"Accesorios"},controls:"Controles de edici\xF3n",preview:"Vista previa del avatar",undo:"Deshacer",undoTitle:"Deshacer ({keys})",redo:"Rehacer",redoTitle:"Rehacer ({keys})",random:"Aleatorio",randomTitle:"Personaje aleatorio",talk:"Hablar",mood:"\xC1nimo",gesture:"Gesto",gesturePick:"Gesto\u2026",morph:"Transformaci\xF3n",morphPick:"Transformar\u2026",talkSample:"\xA1Hola! Soy tu nuevo ot. \xBFQu\xE9 tal sueno?",copyJson:"Copiar JSON",jsonCopied:"JSON copiado",copyFailed:"No se pudo copiar",pngFailed:"No se pudo generar el PNG",plush:{material:"Material",materials:{plush:"Peluche",vinyl:"Vinilo"},hint:"Arr\xE1stralo para girarlo. Se edita con las mismas pesta\xF1as que el 2D.",unavailable:"Este navegador no puede mostrar el 3D; ves la vista 2D (el widget har\xE1 lo mismo)."},image:{title:"Retrato",intro:"Una imagen fija (PNG, JPG, WebP o SVG). La boca no se anima; al hablar se ilumina el contorno.",url:"URL de la imagen",placeholder:"https://\u2026/retrato.png",alt:"Vista previa del retrato"},styles:{title:"Estilos completos",hint:"Un estilo reemplaza todo el personaje. Despu\xE9s puedes ajustar cada pieza.",keepBody:"Conservar mi forma y color al cambiar de estilo"},shape:{title:"Forma base",deform:"Deformar",hint:"Arrastra los puntos del contorno en la vista previa (con el teclado: selecciona un punto con Tab y mu\xE9velo con las flechas).",symmetry:"Simetr\xEDa",reset:"Restablecer forma",wider:"M\xE1s ancho",taller:"M\xE1s alto",point:"Punto {n} del contorno"},color:{body:"Color del cuerpo",swatch:"Color {color}",custom:"Personalizado",finish:"Acabado",outline:"Contorno",outlines:{auto:"Autom\xE1tico",none:"Sin contorno",thin:"Fino",bold:"Grueso"},pattern:"Patr\xF3n",patternColor:"Color del patr\xF3n"},eyes:{title:{one:"Ojos \xB7 # tipo",other:"Ojos \xB7 # tipos"},iris:"Iris",white:"Blanco",pupil:"Pupila",hint:"Tambi\xE9n puedes arrastrar los ojos en la vista previa: arriba/abajo cambia la altura y a los lados la separaci\xF3n.",drag:"Ojos: arrastra para mover"},mouth:{title:{one:"Boca \xB7 # tipo",other:"Boca \xB7 # tipos"},stroke:"Trazo",lipstick:"Pintalabios",hint:"Todas las bocas se abren al hablar (lip-sync con el audio de la voz). Pulsa \xAB{talk}\xBB para probarlo.",drag:"Boca: arrastra para mover"},face:{brows:"Cejas",browColor:"Color de cejas",cheeks:"Mejillas y marcas"},settings:"Ajustes",size:"Tama\xF1o",spacing:"Separaci\xF3n",height:"Altura",colorLabel:"Color",acc:{group:"{group} \xB7 pulsa para poner o quitar",empty:"A\xFAn no hay accesorios. Combina varios: gorro + gafas + pipa\u2026",worn:"Puestos ({count})",rotation:"Giro",posX:"Posici\xF3n X",posY:"Posici\xF3n Y",detail:"Detalle",flip:"Voltear",front:"Traer delante",back:"Llevar detr\xE1s",reset:"Recolocar",remove:"Quitar",hint:"Arr\xE1stralo en la vista previa; con la rueda del rat\xF3n cambias su tama\xF1o (con May\xFAs, el giro).",select:"Selecciona uno para moverlo, girarlo o cambiarle el color.",max:"M\xE1ximo {max} accesorios",drag:"{name}: arrastra para mover"}}},Ql={character:{avatar:"Avatar",shapes:{pou:"Pou",round:"Round",egg:"Egg",pear:"Pear",bean:"Bean",squircle:"Soft square",wide:"Wide",tall:"Tall",drop:"Drop",ghost:"Ghost",cat:"Ears",cloud:"Cloud",blob:"Squishy",robot:"Robot",heart:"Heart",mushroom:"Mushroom"},eyes:{round:"Round",dot:"Dots",kawaii:"Kawaii",anime:"Anime",cat:"Cat",sleepy:"Sleepy",happy:"Happy",closed:"Closed",wink:"Wink",star:"Stars",heart:"Hearts",cross:"K.O.",spiral:"Dizzy",angry:"Angry",sad:"Sad",wide:"Amazed",button:"Button",robot:"LED",led:"Bars",cyclops:"Cyclops",lashes:"Lashes",almond:"Realistic",googly:"Googly",sparkle:"Sparkly",dollar:"Dollar",pixel:"Pixel",bean:"Bean",tired:"Tired",villain:"Villain",glow:"Ghostly",teary:"Teary",hypno:"Hypnotized",focused:"Determined"},brows:{none:"No brows",soft:"Soft",thick:"Thick",thin:"Thin",arched:"Arched",bushy:"Bushy",dots:"Maro",unibrow:"Unibrow",angled:"Pointed"},mouths:{smile:"Smile",grin:"Big smile",laugh:"Laugh",open:"Open",oh:"Oh",flat:"Serious",frown:"Sad",smirk:"Cheeky",cat:"Cat",tongue:"Tongue out",vampire:"Fangs",buck:"Buck teeth",tiny:"Tiny",kiss:"Kiss",wavy:"Nervous",grit:"Gritted teeth",beak:"Beak",robot:"Grille",braces:"Braces",monster:"Monster",gap:"Gap-toothed",lips:"Lips",pout:"Pout",toothless:"Toothless",whistle:"Whistling",drool:"Drooling",square:"Square",mustachio:"Crooked smile"},cheeks:{none:"None",blush:"Blush",lines:"Anime blush",freckles:"Freckles",hearts:"Hearts",whiskers:"Cat whiskers",stars:"Little stars",paint:"War paint"},patterns:{none:"Plain",belly:"Belly",spots:"Spots",stripes:"Stripes",tiger:"Tiger",twotone:"Two-tone",mask:"Mask",hearts:"Hearts",stars:"Stars",circuit:"Circuit"},finishes:{glossy:"Glossy",soft3d:"Soft 3D",clay:"Clay",flat:"Flat",toon:"Comic",neon:"Neon",sketch:"Sketch"},groups:{head:"Head",eyes:"Eyes",face:"Face",neck:"Neck",back:"Back",extra:"Extras"},accessories:{crown:"Crown",tiara:"Tiara",pirate:"Pirate hat",tophat:"Top hat",beanie:"Beanie",cap:"Cap",cowboy:"Cowboy",wizard:"Wizard",party:"Party",chef:"Chef",viking:"Viking",grad:"Graduation",beret:"Beret",bow:"Bow",flower:"Flower",halo:"Halo",horns:"Horns",antenna:"Antennae",bunny:"Bunny ears",catears:"Cat ears",santa:"Santa",hardhat:"Hard hat",headband:"Ninja headband",bandana:"Pirate bandana",helmet:"Space helmet",headphones:"Headphones",hair:"Quiff",sprout:"Sprout",glasses:"Round glasses",square:"Square glasses",nerd:"Nerd glasses",sunglasses:"Sunglasses",aviator:"Aviator",heartglasses:"Heart glasses",starglasses:"Star glasses","3d":"3D glasses",monocle:"Monocle",eyepatch:"Eye patch",goggles:"Pilot goggles",visor:"Visor",mustache:"Mustache",handlebar:"Handlebar mustache",beard:"Beard",wizardbeard:"Wizard beard",goatee:"Goatee",pipe:"Pipe",lollipop:"Lollipop",clownnose:"Clown nose",nose:"Nose",pignose:"Piggy nose",bandaid:"Band-aid",scar:"Scar",ninjamask:"Ninja mask",facemask:"Face mask",bowtie:"Bow tie",tie:"Tie",scarf:"Scarf",pearls:"Pearl necklace",medal:"Medal",bell:"Bell",ruff:"Royal ruff",cape:"Royal cape",superhero:"Hero cape",wings:"Angel wings",batwings:"Bat wings",tail:"Devil tail",jetpack:"Jetpack",parrot:"Parrot",sparkles:"Sparkles",hearts:"Hearts",zzz:"Zzz",sweat:"Sweat drop"},presets:{classic:"Classic",pirate:"Pirate",king:"King",queen:"Queen",wizard:"Wizard",chef:"Chef",detective:"Detective",cowboy:"Cowboy",astronaut:"Astronaut",robot:"Robot",viking:"Viking",ninja:"Ninja",ghost:"Ghost",cat:"Kitty",devil:"Little devil",angel:"Angel",scientist:"Scientist",rocker:"Rocker",student:"Graduate",clown:"Clown",monster:"Monster",nerd:"Nerd",hero:"Superhero",neon:"Neon",santa:"Christmas",sprout:"Little sprout"},moods:{neutral:"Neutral",happy:"Happy",angry:"Angry",sad:"Sad",fear:"Fear",disgust:"Disgust",love:"Love",sleep:"Asleep",surprised:"Surprise"},gestures:{jump:"Jump",wiggle:"Wiggle",nod:"Nod",shake:"Shake head",spin:"Spin",bounce:"Bounce",wave:"Wave",think:"Think",celebrate:"Celebrate",surprise:"Surprise",shrug:"Shrug",sneeze:"Sneeze",hiccup:"Hiccup",laugh:"Laugh",dance:"Dance",yawn:"Yawn",shiver:"Shiver",clap:"Clap",thumbsup:"Thumbs up",thumbsdown:"Thumbs down",point:"Point",bow:"Bow",fly:"Fly",stomp:"Stomp",dizzy:"Dizzy"},morphs:{spikes:"Spikes",wings:"Wings",hands:"Hands",horns:"Horns",puff:"Puff up",squish:"Squish",stretch:"Stretch",melt:"Melt",jelly:"Jelly"},effects:{sparkles:"Sparkles",sweat:"Sweat",blush:"Blush",hearts:"Hearts",zzz:"Zzz",exclaim:"Exclamation",question:"Question",anger:"Anger",steam:"Steam",confetti:"Confetti",tears:"Tears",thought:"Thought",notes:"Notes",sneeze:"Sneeze",bubble:"Bubble",dizzy:"Dizzy"}},editor:{kinds:{label:"Avatar type",character:"2D character",plush:"3D character",image:"Card"},tabs:{styles:"Styles",shape:"Shape",color:"Color & finish",eyes:"Eyes",mouth:"Mouth",face:"Face",acc:"Accessories"},controls:"Editing controls",preview:"Avatar preview",undo:"Undo",undoTitle:"Undo ({keys})",redo:"Redo",redoTitle:"Redo ({keys})",random:"Random",randomTitle:"Random character",talk:"Talk",mood:"Mood",gesture:"Gesture",gesturePick:"Gesture\u2026",morph:"Transform",morphPick:"Transform\u2026",talkSample:"Hi there! I am your new ot. How do I sound?",copyJson:"Copy JSON",jsonCopied:"JSON copied",copyFailed:"Could not copy",pngFailed:"Could not create the PNG",plush:{material:"Material",materials:{plush:"Plush",vinyl:"Vinyl"},hint:"Drag to turn it. Edit it with the same tabs as the 2D one.",unavailable:"This browser can\u2019t show 3D; you see the 2D preview (the widget will do the same)."},image:{title:"Portrait",intro:"A still image (PNG, JPG, WebP or SVG). The mouth isn\u2019t animated; the outline lights up while speaking.",url:"Image URL",placeholder:"https://\u2026/portrait.png",alt:"Portrait preview"},styles:{title:"Complete styles",hint:"A style replaces the whole character. You can then adjust each part.",keepBody:"Keep my shape and color when changing style"},shape:{title:"Base shape",deform:"Reshape",hint:"Drag the outline points in the preview (with the keyboard: select a point with Tab and move it with the arrow keys).",symmetry:"Symmetry",reset:"Reset shape",wider:"Wider",taller:"Taller",point:"Outline point {n}"},color:{body:"Body color",swatch:"Color {color}",custom:"Custom",finish:"Finish",outline:"Outline",outlines:{auto:"Automatic",none:"No outline",thin:"Thin",bold:"Bold"},pattern:"Pattern",patternColor:"Pattern color"},eyes:{title:{one:"Eyes \xB7 # type",other:"Eyes \xB7 # types"},iris:"Iris",white:"White",pupil:"Pupil",hint:"You can also drag the eyes in the preview: up/down changes the height and sideways the spacing.",drag:"Eyes: drag to move"},mouth:{title:{one:"Mouth \xB7 # type",other:"Mouth \xB7 # types"},stroke:"Stroke",lipstick:"Lipstick",hint:"Every mouth opens while speaking (lip-sync with the voice audio). Press \u201C{talk}\u201D to try it.",drag:"Mouth: drag to move"},face:{brows:"Eyebrows",browColor:"Eyebrow color",cheeks:"Cheeks & marks"},settings:"Settings",size:"Size",spacing:"Spacing",height:"Height",colorLabel:"Color",acc:{group:"{group} \xB7 tap to add or remove",empty:"No accessories yet. Mix several: hat + glasses + pipe\u2026",worn:"Wearing ({count})",rotation:"Rotation",posX:"Position X",posY:"Position Y",detail:"Detail",flip:"Flip",front:"Bring forward",back:"Send backward",reset:"Reposition",remove:"Remove",hint:"Drag it in the preview; the mouse wheel changes its size (with Shift, the rotation).",select:"Select one to move it, rotate it or change its color.",max:"Up to {max} accessories",drag:"{name}: drag to move"}}},Zl={character:{avatar:"Avatar",shapes:{pou:"Pou",round:"Redondo",egg:"Ovo",pear:"Pera",bean:"Vagem",squircle:"Quadrado suave",wide:"Largo",tall:"Alto",drop:"Gota",ghost:"Fantasma",cat:"Orelhas",cloud:"Nuvem",blob:"Fofinho",robot:"Rob\xF4",heart:"Cora\xE7\xE3o",mushroom:"Cogumelo"},eyes:{round:"Redondos",dot:"Pontinhos",kawaii:"Kawaii",anime:"Anime",cat:"Gato",sleepy:"Sonolentos",happy:"Felizes",closed:"Fechados",wink:"Piscadinha",star:"Estrelas",heart:"Cora\xE7\xF5es",cross:"K.O.",spiral:"Tonto",angry:"Bravos",sad:"Tristes",wide:"Espantados",button:"Bot\xE3o",robot:"LED",led:"Barras",cyclops:"Ciclope",lashes:"C\xEDlios",almond:"Realistas",googly:"Malucos",sparkle:"Brilhantes",dollar:"D\xF3lar",pixel:"Pixel",bean:"Feij\xE3o",tired:"Cansados",villain:"Vil\xE3o",glow:"Fantasmag\xF3ricos",teary:"Chorosos",hypno:"Hipnose",focused:"Decididos"},brows:{none:"Sem sobrancelhas",soft:"Suaves",thick:"Grossas",thin:"Finas",arched:"Arqueadas",bushy:"Cheias",dots:"Maro",unibrow:"Monocelha",angled:"Pontudas"},mouths:{smile:"Sorriso",grin:"Sorris\xE3o",laugh:"Gargalhada",open:"Aberta",oh:"Oh",flat:"S\xE9ria",frown:"Triste",smirk:"Marota",cat:"Felina",tongue:"L\xEDngua de fora",vampire:"Presas",buck:"Dentu\xE7a",tiny:"Pequenininha",kiss:"Beijo",wavy:"Nervosa",grit:"Dentes cerrados",beak:"Bico",robot:"Grade",braces:"Aparelho",monster:"Monstro",gap:"Janelinha",lips:"L\xE1bios",pout:"Beicinho",toothless:"Banguela",whistle:"Assobiando",drool:"Babando",square:"Quadrada",mustachio:"Sorriso de lado"},cheeks:{none:"Nada",blush:"Rubor",lines:"Rubor anime",freckles:"Sardas",hearts:"Cora\xE7\xF5es",whiskers:"Bigodes de gato",stars:"Estrelinhas",paint:"Pintura de guerra"},patterns:{none:"Liso",belly:"Barriga",spots:"Manchas",stripes:"Listras",tiger:"Tigre",twotone:"Duas cores",mask:"M\xE1scara",hearts:"Cora\xE7\xF5es",stars:"Estrelas",circuit:"Circuito"},finishes:{glossy:"Brilhante",soft3d:"3D suave",clay:"Massinha",flat:"Plano",toon:"Quadrinhos",neon:"Neon",sketch:"Esbo\xE7o"},groups:{head:"Cabe\xE7a",eyes:"Olhos",face:"Rosto",neck:"Pesco\xE7o",back:"Costas",extra:"Extras"},accessories:{crown:"Coroa",tiara:"Tiara",pirate:"Chap\xE9u pirata",tophat:"Cartola",beanie:"Gorro de l\xE3",cap:"Bon\xE9",cowboy:"Caub\xF3i",wizard:"Mago",party:"Festa",chef:"Chef",viking:"Viking",grad:"Formatura",beret:"Boina",bow:"La\xE7o",flower:"Flor",halo:"Aur\xE9ola",horns:"Chifres",antenna:"Antenas",bunny:"Orelhas de coelho",catears:"Orelhas de gato",santa:"Papai Noel",hardhat:"Capacete de obra",headband:"Faixa ninja",bandana:"Bandana pirata",helmet:"Capacete espacial",headphones:"Fones de ouvido",hair:"Topete",sprout:"Broto",glasses:"\xD3culos redondos",square:"\xD3culos quadrados",nerd:"\xD3culos de nerd",sunglasses:"\xD3culos de sol",aviator:"Aviador",heartglasses:"\xD3culos de cora\xE7\xE3o",starglasses:"\xD3culos de estrela","3d":"\xD3culos 3D",monocle:"Mon\xF3culo",eyepatch:"Tapa-olho",goggles:"\xD3culos de piloto",visor:"Viseira",mustache:"Bigode",handlebar:"Bigode guid\xE3o",beard:"Barba",wizardbeard:"Barba de mago",goatee:"Cavanhaque",pipe:"Cachimbo",lollipop:"Pirulito",clownnose:"Nariz de palha\xE7o",nose:"Nariz",pignose:"Focinho de porquinho",bandaid:"Curativo",scar:"Cicatriz",ninjamask:"M\xE1scara ninja",facemask:"M\xE1scara facial",bowtie:"Gravata-borboleta",tie:"Gravata",scarf:"Cachecol",pearls:"Colar de p\xE9rolas",medal:"Medalha",bell:"Guizo",ruff:"Gola real",cape:"Capa real",superhero:"Capa de her\xF3i",wings:"Asas de anjo",batwings:"Asas de morcego",tail:"Rabo de diabinho",jetpack:"Mochila a jato",parrot:"Papagaio",sparkles:"Brilhos",hearts:"Cora\xE7\xF5es",zzz:"Zzz",sweat:"Gota de suor"},presets:{classic:"Cl\xE1ssico",pirate:"Pirata",king:"Rei",queen:"Rainha",wizard:"Mago",chef:"Chef",detective:"Detetive",cowboy:"Caub\xF3i",astronaut:"Astronauta",robot:"Rob\xF4",viking:"Viking",ninja:"Ninja",ghost:"Fantasma",cat:"Gatinho",devil:"Diabinho",angel:"Anjo",scientist:"Cientista",rocker:"Roqueiro",student:"Formanda",clown:"Palha\xE7o",monster:"Monstro",nerd:"Nerd",hero:"Super-her\xF3i",neon:"Neon",santa:"Natal",sprout:"Brotinho"},moods:{neutral:"Neutro",happy:"Contente",angry:"Bravo",sad:"Triste",fear:"Medo",disgust:"Nojo",love:"Amor",sleep:"Dormindo",surprised:"Surpresa"},gestures:{jump:"Pular",wiggle:"Balan\xE7ar",nod:"Assentir",shake:"Negar",spin:"Girar",bounce:"Quicar",wave:"Acenar",think:"Pensar",celebrate:"Comemorar",surprise:"Surpreender-se",shrug:"Dar de ombros",sneeze:"Espirrar",hiccup:"Solu\xE7o",laugh:"Rir",dance:"Dan\xE7ar",yawn:"Bocejar",shiver:"Tremer",clap:"Aplaudir",thumbsup:"Joinha",thumbsdown:"Polegar para baixo",point:"Apontar",bow:"Rever\xEAncia",fly:"Voar",stomp:"Birra",dizzy:"Tonto"},morphs:{spikes:"Espinhos",wings:"Asas",hands:"M\xE3os",horns:"Chifres",puff:"Inchar",squish:"Achatar",stretch:"Esticar",melt:"Derreter",jelly:"Gelatina"},effects:{sparkles:"Brilhos",sweat:"Suor",blush:"Rubor",hearts:"Cora\xE7\xF5es",zzz:"Zzz",exclaim:"Exclama\xE7\xE3o",question:"Pergunta",anger:"Raiva",steam:"Vapor",confetti:"Confete",tears:"L\xE1grimas",thought:"Pensamento",notes:"Notas",sneeze:"Espirro",bubble:"Bolha",dizzy:"Tontura"}},editor:{kinds:{label:"Tipo de avatar",character:"Personagem 2D",plush:"Personagem 3D",image:"Cart\xE3o"},tabs:{styles:"Estilos",shape:"Forma",color:"Cor e acabamento",eyes:"Olhos",mouth:"Boca",face:"Rosto",acc:"Acess\xF3rios"},controls:"Controles de edi\xE7\xE3o",preview:"Pr\xE9via do avatar",undo:"Desfazer",undoTitle:"Desfazer ({keys})",redo:"Refazer",redoTitle:"Refazer ({keys})",random:"Aleat\xF3rio",randomTitle:"Personagem aleat\xF3rio",talk:"Falar",mood:"Humor",gesture:"Gesto",gesturePick:"Gesto\u2026",morph:"Transforma\xE7\xE3o",morphPick:"Transformar\u2026",talkSample:"Ol\xE1! Eu sou o seu novo ot. Como estou soando?",copyJson:"Copiar JSON",jsonCopied:"JSON copiado",copyFailed:"N\xE3o foi poss\xEDvel copiar",pngFailed:"N\xE3o foi poss\xEDvel gerar o PNG",plush:{material:"Material",materials:{plush:"Pel\xFAcia",vinyl:"Vinil"},hint:"Arraste para gir\xE1-lo. Edite com as mesmas abas do 2D.",unavailable:"Este navegador n\xE3o consegue mostrar o 3D; voc\xEA v\xEA a pr\xE9via 2D (o widget far\xE1 o mesmo)."},image:{title:"Retrato",intro:"Uma imagem fixa (PNG, JPG, WebP ou SVG). A boca n\xE3o \xE9 animada; ao falar, o contorno se ilumina.",url:"URL da imagem",placeholder:"https://\u2026/retrato.png",alt:"Pr\xE9via do retrato"},styles:{title:"Estilos completos",hint:"Um estilo substitui o personagem inteiro. Depois voc\xEA pode ajustar cada pe\xE7a.",keepBody:"Manter minha forma e cor ao trocar de estilo"},shape:{title:"Forma base",deform:"Deformar",hint:"Arraste os pontos do contorno na pr\xE9via (pelo teclado: selecione um ponto com Tab e mova-o com as setas).",symmetry:"Simetria",reset:"Restaurar forma",wider:"Mais largo",taller:"Mais alto",point:"Ponto {n} do contorno"},color:{body:"Cor do corpo",swatch:"Cor {color}",custom:"Personalizada",finish:"Acabamento",outline:"Contorno",outlines:{auto:"Autom\xE1tico",none:"Sem contorno",thin:"Fino",bold:"Grosso"},pattern:"Padr\xE3o",patternColor:"Cor do padr\xE3o"},eyes:{title:{one:"Olhos \xB7 # tipo",other:"Olhos \xB7 # tipos"},iris:"\xCDris",white:"Branco",pupil:"Pupila",hint:"Voc\xEA tamb\xE9m pode arrastar os olhos na pr\xE9via: para cima/baixo muda a altura e para os lados, a separa\xE7\xE3o.",drag:"Olhos: arraste para mover"},mouth:{title:{one:"Boca \xB7 # tipo",other:"Boca \xB7 # tipos"},stroke:"Tra\xE7o",lipstick:"Batom",hint:"Todas as bocas se abrem ao falar (lip-sync com o \xE1udio da voz). Toque em \u201C{talk}\u201D para testar.",drag:"Boca: arraste para mover"},face:{brows:"Sobrancelhas",browColor:"Cor das sobrancelhas",cheeks:"Bochechas e marcas"},settings:"Ajustes",size:"Tamanho",spacing:"Separa\xE7\xE3o",height:"Altura",colorLabel:"Cor",acc:{group:"{group} \xB7 toque para colocar ou tirar",empty:"Ainda n\xE3o h\xE1 acess\xF3rios. Combine v\xE1rios: gorro + \xF3culos + cachimbo\u2026",worn:"Usando ({count})",rotation:"Giro",posX:"Posi\xE7\xE3o X",posY:"Posi\xE7\xE3o Y",detail:"Detalhe",flip:"Espelhar",front:"Trazer para frente",back:"Levar para tr\xE1s",reset:"Reposicionar",remove:"Tirar",hint:"Arraste-o na pr\xE9via; com a roda do mouse voc\xEA muda o tamanho (com Shift, o giro).",select:"Selecione um para mov\xEA-lo, gir\xE1-lo ou mudar a cor.",max:"M\xE1ximo de {max} acess\xF3rios",drag:"{name}: arraste para mover"}}};gt({es:Wl,en:Ql,pt:Zl})});function ft(e,t,o){let s=e||ts,a=`character.${t}.${o}`,r=s(a);if(r!==a)return r;let n=Jl[t]?.find(c=>(Array.isArray(c)?c[0]:c.id)===o);return(Array.isArray(n)?n[1]:n?.label)||String(o)}function pt(e){let t=String(e).replace("#",""),o=t.length===3?t.split("").map(s=>s+s).join(""):t.padEnd(6,"0").slice(0,6);return[0,2,4].map(s=>parseInt(o.slice(s,s+2),16)||0)}function Y(e,t){let o=t<0?0:255,s=Math.abs(t);return Yl(pt(e).map(a=>a+(o-a)*s))}function Jt(e){let[t,o,s]=pt(e).map(a=>a/255);return .2126*t+.7152*o+.0722*s}function De({cx:e=100,cy:t=112,rxT:o=60,rxB:s=60,ryT:a=66,ryB:r=66,nT:i=2,nB:n=2,tweak:c}={}){let h=[];for(let u=0;u<Xe;u++){let d=-Math.PI/2+u/Xe*Math.PI*2,p=Math.cos(d),f=Math.sin(d),m=f<0,g=2/(m?i:n),b=m?o:s,$=(Math.abs(f)<1e-9,b),v=e+$*Math.sign(p)*Math.abs(p)**g,S=t+(m?a:r)*Math.sign(f)*Math.abs(f)**g;c&&([v,S]=c(u,v,S)),h.push([l(v),l(S)])}return h}function Kl(e,t,o){let s=o*e*.35;return`${`M${l(-e)} ${l(-s)}Q0 ${l(s*.6-t*.15)} ${l(e)} ${l(-s)}`}Q${l(e*.8)} ${l(t+s*.2)} 0 ${l(t+s*.4)}Q${l(-e*.8)} ${l(t+s*.2)} ${l(-e)} ${l(-s)}Z`}function ut(e,{w:t=e.w,min:o=0,max:s=1,teeth:a=!1,tongue:r=!0,fangs:i=!1,sharp:n=!1,gap:c=!1,braces:h=!1}={}){let u=(o+(s-o)*e.open)*t*1.1,d=e.curve,p=`m${Math.round(Math.random()*1e9)}`,f=Kl(t,Math.max(u,1.5),d),m="";if(r&&u>t*.35&&(m+=`<ellipse cx="0" cy="${l(u+d*t*.35)}" rx="${l(t*.55)}" ry="${l(u*.45)}" fill="${e.tongue}"/>`),a){let g=-d*t*.35;if(n){let b=`M${l(-t)} ${l(g-2)}`;for(let $=0;$<=8;$++)b+=`L${l(-t+$*t/4)} ${l(g+($%2?t*.28:-1))}`;m+=`<path d="${b}V${l(g-4)}Z" fill="${e.teeth}"/>`}else m+=`<rect x="${l(-t)}" y="${l(g-4)}" width="${l(t*2)}" height="${l(Math.max(4,t*.3)+4)}" fill="${e.teeth}"/>`;c&&(m+=`<rect x="${l(-t*.12)}" y="${l(g-4)}" width="${l(t*.24)}" height="${l(t*.3+4)}" fill="${e.ink}"/>`),h&&(m+=`<path d="M${l(-t)} ${l(g+t*.18)}H${l(t)}" stroke="#a3a3a3" stroke-width="2"/>${[-.6,-.2,.2,.6].map(b=>`<rect x="${l(b*t-1.5)}" y="${l(g+t*.18-2)}" width="3" height="4" fill="#d4d4d4"/>`).join("")}`)}return i&&(m+=`<path d="M${l(-t*.55)} ${l(-d*t*.3-1)}l${l(t*.12)} ${l(t*.4)}l${l(t*.12)} ${l(-t*.4)}ZM${l(t*.31)} ${l(-d*t*.3-1)}l${l(t*.12)} ${l(t*.4)}l${l(t*.12)} ${l(-t*.4)}Z" fill="${e.teeth}"/>`),`<clipPath id="${p}"><path d="${f}"/></clipPath><path d="${f}" fill="${e.ink}"/><g clip-path="url(#${p})">${m}</g><path d="${f}" fill="none" stroke="${e.lip}" stroke-width="${l(Math.max(1.4,t*.1))}" stroke-linejoin="round"/>`}var l,Yl,Xe,Ct,Qe,Tt,Oo,dt,It,eo,po,go,Bt,mo,to,yo,bo,$o,zo,U,Xl,fi,Xa,pi,mi,gi,ps,oo,ee,qo,Jl,wo=Ke(()=>{ui();_e();l=e=>Math.round(e*100)/100;Yl=e=>`#${e.map(t=>Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")).join("")}`;Xe=16;Ct=[{id:"pou",label:"Pou",points:De({rxT:50,rxB:66,ryT:70,ryB:56,nT:2.1,nB:2.6})},{id:"round",label:"Redondo",points:De({rxT:64,rxB:64,ryT:64,ryB:64})},{id:"egg",label:"Huevo",points:De({rxT:50,rxB:60,ryT:76,ryB:56})},{id:"pear",label:"Pera",points:De({rxT:40,rxB:70,ryT:72,ryB:52,nB:2.4})},{id:"bean",label:"Jud\xEDa",points:De({rxT:56,rxB:56,ryT:74,ryB:62,nT:2.6,nB:2.6})},{id:"squircle",label:"Cuadrado suave",points:De({rxT:62,rxB:62,ryT:64,ryB:60,nT:4,nB:4})},{id:"wide",label:"Ancho",points:De({rxT:74,rxB:78,ryT:50,ryB:50,nT:2.4,nB:3})},{id:"tall",label:"Alto",points:De({rxT:46,rxB:50,ryT:82,ryB:70,nT:2.4,nB:2.8})},{id:"drop",label:"Gota",points:De({rxT:34,rxB:62,ryT:82,ryB:56,nT:1.3,nB:2.2})},{id:"ghost",label:"Fantasma",points:De({rxT:58,rxB:62,ryT:70,ryB:64,nT:2,nB:5,tweak:(e,t,o)=>e>=6&&e<=10?[t,o+(e%2?-10:6)]:[t,o]})},{id:"cat",label:"Orejas",points:De({rxT:58,rxB:64,ryT:64,ryB:58,nT:2.4,nB:2.6,tweak:(e,t,o)=>e===2||e===14?[t+(e===2?6:-6),o-30]:e===1||e===15?[t,o+6]:[t,o]})},{id:"cloud",label:"Nube",points:De({rxT:66,rxB:70,ryT:58,ryB:56,tweak:(e,t,o)=>e%2?[100+(t-100)*.9,112+(o-112)*.9]:[t,o]})},{id:"blob",label:"Blandito",points:De({rxT:58,rxB:68,ryT:66,ryB:58,tweak:(e,t,o)=>[t+Math.sin(e*1.7)*5,o+Math.cos(e*2.3)*4]})},{id:"robot",label:"Robot",points:De({rxT:60,rxB:60,ryT:66,ryB:62,nT:7,nB:7})},{id:"heart",label:"Coraz\xF3n",points:De({rxT:70,rxB:64,ryT:58,ryB:70,nT:2.4,nB:1.6,tweak:(e,t,o)=>e===0?[t,o+22]:e===1||e===15?[t,o+4]:e===8?[t,o+6]:[t,o]})},{id:"mushroom",label:"Seta",points:De({rxT:78,rxB:46,ryT:62,ryB:64,nT:2.2,nB:3.2})}],Qe=(e,t,o,s=1)=>`<circle cx="${l(e)}" cy="${l(t)}" r="${l(o)}" fill="#fff" opacity="${s}"/>`,Tt=(e,t=.45,o=5)=>{let s="";for(let a=0;a<o*2;a++){let r=-Math.PI/2+a*Math.PI/o,i=a%2?e*t:e;s+=`${a?"L":"M"}${l(Math.cos(r)*i)} ${l(Math.sin(r)*i)}`}return`${s}Z`},Oo=e=>`M0 ${l(e*.9)}C${l(-e*1.4)} ${l(-e*.1)} ${l(-e*.7)} ${l(-e*1.05)} 0 ${l(-e*.35)}C${l(e*.7)} ${l(-e*1.05)} ${l(e*1.4)} ${l(-e*.1)} 0 ${l(e*.9)}Z`,dt=(e,t)=>[l(e.lx*e.r*t),l(e.ly*e.r*t)],It=(e,t,o=.35,s=e.ink)=>{let[a,r]=dt(e,o);return`<circle cx="${a}" cy="${r}" r="${l(t)}" fill="${s}"/>${Qe(a-t*.35,r-t*.4,t*.32)}`},eo=[{id:"round",label:"Redondos",draw:e=>`<circle r="${e.r}" fill="${e.white}"/>${It(e,e.r*.55)}`},{id:"dot",label:"Puntitos",draw:e=>{let[t,o]=dt(e,.15);return`<ellipse cx="${t}" cy="${o}" rx="${l(e.r*.42)}" ry="${l(e.r*.58)}" fill="${e.ink}"/>${Qe(t-e.r*.12,o-e.r*.22,e.r*.14)}`}},{id:"kawaii",label:"Kawaii",draw:e=>{let[t,o]=dt(e,.1);return`<circle cx="${t}" cy="${o}" r="${l(e.r*.95)}" fill="${e.ink}"/>${Qe(t-e.r*.32,o-e.r*.34,e.r*.34)}${Qe(t+e.r*.34,o+e.r*.36,e.r*.16)}`}},{id:"anime",label:"Anime",draw:e=>{let[t,o]=dt(e,.22);return`<ellipse rx="${l(e.r*.9)}" ry="${l(e.r*1.2)}" fill="${e.white}"/>
2
2
  <ellipse cx="${t}" cy="${l(o+e.r*.1)}" rx="${l(e.r*.66)}" ry="${l(e.r*.92)}" fill="${e.iris}"/>
3
3
  <ellipse cx="${t}" cy="${l(o+e.r*.34)}" rx="${l(e.r*.5)}" ry="${l(e.r*.5)}" fill="${Y(e.iris,.35)}" opacity=".7"/>
4
4
  <ellipse cx="${t}" cy="${l(o+e.r*.05)}" rx="${l(e.r*.3)}" ry="${l(e.r*.46)}" fill="${e.ink}"/>
@@ -16,7 +16,7 @@ var tl=Object.create;var Ha=Object.defineProperty;var ol=Object.getOwnPropertyDe
16
16
  @keyframes otsc-breathe{0%,100%{transform:scale(1,1)}50%{transform:scale(1.014,.982)}}
17
17
  @keyframes otsc-sway{0%,100%{transform:rotate(-.6deg)}50%{transform:rotate(.6deg)}}
18
18
  @media (prefers-reduced-motion:reduce){.otsc-breathe,.otsc-sway{animation:none!important}}
19
- `,Ic={angry:[["spikes",{ms:900}],["anger"],["steam"]],surprised:[["exclaim"]],love:[["hearts"],["blush"]],happy:[["sparkles"]],sad:[["tears"]],fear:[["sweat"]],disgust:[["squish",{ms:700}]],sleep:[["zzz",{hold:!0,tag:"mood"}]]},Bc=1800,Li=380,ks=300,Oi=300,Gc=Object.keys(Do),ot=()=>typeof performance<"u"?performance.now():Date.now(),rr=(e,t,o)=>e.map((s,a)=>[we(s[0],t[a][0],o),we(s[1],t[a][1],o)])});var _o=Pa((d0,Yi)=>{Yi.exports=globalThis.__OTS_THREE__.three});var Xi=Pa((u0,Ki)=>{Ki.exports=globalThis.__OTS_THREE__.RoomEnvironment});function ha(e={}){let t=e.key||"page";return ur.has(t)||ur.set(t,new fr(e)),ur.get(t)}var Ie,Ji,ur,fr,en=Ke(()=>{Ie=jt(_o(),1),Ji=jt(Xi(),1),ur=new Map;fr=class{constructor(t){this.maxDpr=Math.min(t.maxDpr||1.5,window.devicePixelRatio||1),this.minDpr=Math.min(t.minDpr||.75,this.maxDpr),this.dpr=this.maxDpr,this.adaptive=t.adaptive!==!1;let o=document.createElement("canvas");o.className="ots3d-canvas",o.setAttribute("aria-hidden","true"),o.style.cssText=`position:fixed;left:0;top:0;width:100vw;height:100vh;pointer-events:none;z-index:${t.zIndex??1};display:block`,(t.parent||document.body).appendChild(o),this.canvas=o;let s=new Ie.WebGLRenderer({canvas:o,antialias:!0,alpha:!0,powerPreference:"high-performance"});s.setPixelRatio(this.dpr),s.outputColorSpace=Ie.SRGBColorSpace,s.toneMapping=Ie.NeutralToneMapping,s.toneMappingExposure=1.05,s.setClearColor(0,0),s.info.autoReset=!1,s.autoClear=!1,this.renderer=s;let a=new Ie.PMREMGenerator(s);this.envMap=a.fromScene(new Ji.RoomEnvironment,.04).texture,a.dispose(),this.views=new Set,this.visible=new Set,this.raf=0,this.last=0,this.stats={fps:0,ms:0,calls:0,triangles:0,dpr:this.dpr,views:0,characters:0},this._frames=0,this._acc=0,this._statT=0,this._good=0,this._w=0,this._h=0,this.io=new IntersectionObserver(r=>{for(let i of r){let n=i.target.__ots3dView;n&&(i.isIntersecting?this.visible.add(n):this.visible.delete(n))}this.wake()},{rootMargin:"64px"}),this._vis=()=>document.hidden?this.sleep():this.wake(),document.addEventListener("visibilitychange",this._vis)}makeScene(){let t=new Ie.Scene;t.environment=this.envMap,t.environmentIntensity=.75,t.add(new Ie.HemisphereLight(15265023,4206670,.7));let o=new Ie.DirectionalLight(16773600,2.4);o.position.set(2.2,3.4,3.2);let s=new Ie.DirectionalLight(13623551,2.2);s.position.set(-2.6,2.2,-3);let a=new Ie.DirectionalLight(16770804,.5);return a.position.set(-3,.5,2),t.add(o,s,a),t}addView(t){this.views.add(t),t.el.__ots3dView=t,this.io.observe(t.el),this.wake()}removeView(t){this.views.delete(t),this.visible.delete(t),this.io.unobserve(t.el),delete t.el.__ots3dView}wake(){this.raf||document.hidden||!this.visible.size||(this.last=performance.now(),this.raf=requestAnimationFrame(t=>this.frame(t)))}sleep(){cancelAnimationFrame(this.raf),this.raf=0}resize(){let t=window.innerWidth,o=window.innerHeight,s=this.renderer;(t!==this._w||o!==this._h||s.getPixelRatio()!==this.dpr)&&(this._w=t,this._h=o,s.setPixelRatio(this.dpr),s.setSize(t,o,!1))}frame(t){if(this.raf=0,document.hidden||!this.visible.size)return;let o=Math.min(64,Math.max(0,t-this.last));this.last=t;let s=performance.now();this.resize();let a=this.renderer;a.info.reset(),a.setScissorTest(!1),a.clear(),a.setScissorTest(!0);let r=0;for(let i of this.visible){let n=i.el.getBoundingClientRect();if(n.bottom<0||n.top>this._h||n.right<0||n.left>this._w||n.width<2||n.height<2)continue;i.rect=n,i.tick(t,o),r+=i.characters.length;let c=this._h-n.bottom;a.setViewport(n.left,c,n.width,n.height),a.setScissor(n.left,c,n.width,n.height),a.render(i.scene,i.camera)}if(this._frames++,this._acc+=performance.now()-s,t-this._statT>1e3){let i=(t-this._statT)/1e3,n=this._statT?this._frames/i:60;Object.assign(this.stats,{fps:Math.round(n),ms:Math.round(this._acc/this._frames*10)/10,calls:a.info.render.calls,triangles:a.info.render.triangles,dpr:this.dpr,views:this.visible.size,characters:r}),this.adaptive&&this._statT&&(n<48&&this.dpr>this.minDpr?(this.dpr=Math.max(this.minDpr,Math.round((this.dpr-.25)*100)/100),this._good=0):n>57&&this.dpr<this.maxDpr&&++this._good>=3&&(this.dpr=Math.min(this.maxDpr,this.dpr+.25),this._good=0)),this._statT=t,this._frames=0,this._acc=0}this.raf=requestAnimationFrame(i=>this.frame(i))}}});var pr=Pa((p0,tn)=>{tn.exports=globalThis.__OTS_THREE__.BufferGeometryUtils});function Vc(e,t=12){let o=e.length,s=r=>e[(r+o)%o],a=[];for(let r=0;r<o;r++){let[i,n,c,h]=[s(r-1),s(r),s(r+1),s(r+2)],u=[n[0]+(c[0]-i[0])/6,n[1]+(c[1]-i[1])/6],d=[c[0]-(h[0]-n[0])/6,c[1]-(h[1]-n[1])/6];for(let p=0;p<t;p++){let f=p/t,m=(1-f)**3,g=3*(1-f)**2*f,b=3*(1-f)*f*f,$=f**3;a.push([m*n[0]+g*u[0]+b*d[0]+$*c[0],m*n[1]+g*u[1]+b*d[1]+$*c[1]])}}return a}function Fc(e,t,o){let s=new Float32Array(at),a=e.length;for(let i=0;i<at;i++){let n=i/at*Math.PI*2,c=Math.cos(n),h=Math.sin(n),u=0;for(let d=0;d<a;d++){let[p,f]=e[d],[m,g]=e[(d+1)%a],b=m-p,$=g-f,v=c*$-h*b;if(Math.abs(v)<1e-9)continue;let S=p-t,M=f-o,z=(S*$-M*b)/v,I=(S*h-M*c)/v;z>0&&I>=0&&I<=1&&z>u&&(u=z)}s[i]=u}let r=new Float32Array(at);for(let i=0;i<at;i++)r[i]=(s[(i+at-1)%at]+2*s[i]+s[(i+1)%at])/4;return r}function mr(e,t,o="high"){let s=`${o}|${e.map($=>`${Math.round($[0])},${Math.round($[1])}`).join(" ")}`;if(Fo.has(s))return Fo.get(s);let a=t.x+t.w/2,r=t.y+t.h*.54,i=t.y+t.h,n=Fc(Vc(e),a,r),c=0;for(let $=0;$<at;$++)c+=n[$];c/=at;let h=.86,u=h*c,[d,p]=o==="high"?[96,64]:[40,26],f=new Pe.SphereGeometry(1,d,p);f.deleteAttribute("uv"),f.deleteAttribute("normal"),f=(0,on.mergeVertices)(f,1e-5);let m=f.attributes.position,g=new Pe.Vector3;for(let $=0;$<m.count;$++){g.fromBufferAttribute(m,$).normalize();let v=g.x*g.x+g.y*g.y,S=Math.atan2(-g.y,g.x),M=Uc(n,S),z=h*Math.min(M,c*1.05),I=u+(z-u)*v;m.setXYZ($,g.x*M*me,(i-r)*me+g.y*M*me,g.z*I*me)}for(let $=0;$<m.count;$++){let v=m.getY($);v<.03&&m.setY($,.03+(v-.03)*.35)}f.computeVertexNormals(),f.computeBoundingBox(),f.computeBoundingSphere(),f.userData.shared=!0;let b={geometry:f,table:n,cx:a,cy:r,bottom:i,mean:c,depth:u*me};return Fo.set(s,b),Fo.size>160&&Fo.delete(Fo.keys().next().value),b}function gr(e){let t=new Pe.Mesh(e,new Pe.MeshBasicMaterial({side:Pe.DoubleSide})),o=new Pe.Raycaster,s=new Pe.Vector3,a=new Pe.Vector3,r=(i,n,c,h,u,d)=>{s.set(i,n,c),a.set(h,u,d).normalize(),o.set(s,a);let p=o.intersectObject(t,!1)[0];return p?{p:p.point.clone(),n:p.face.normal.clone()}:null};return{front(i,n){return r(i,n,10,0,0,-1)||{p:new Pe.Vector3(i,n,0),n:new Pe.Vector3(0,0,1)}},top(i,n=0){return r(i,10,n,0,-1,0)||{p:new Pe.Vector3(i,1,n),n:new Pe.Vector3(0,1,0)}},section(i){let n=r(10,i,0,-1,0,0),c=r(0,i,10,0,0,-1);return{w:n?Math.abs(n.p.x):.5,d:c?Math.abs(c.p.z):.4,z:c?c.p.z:.4}}}}var Pe,on,me,at,Uc,Fo,sn=Ke(()=>{Pe=jt(_o(),1),on=jt(pr(),1),me=1/100,at=360;Uc=(e,t)=>{let o=(t/(Math.PI*2)%1+1)%1*at,s=Math.floor(o);return o-=s,e[s%at]*(1-o)+e[(s+1)%at]*o},Fo=new Map});function yr(e){let t=Qc[e.texture]??0,o={uPat:{value:new ae.Color(e.patternColor)},uPatType:{value:Wc[e.pattern]??0},uDims:{value:new ae.Vector4(1,1,.6,.1)},uCheek:{value:new ae.Vector4(.3,.4,.4,.1)},uCheekColor:{value:new ae.Color(e.cheekColor||"#ff6b8a")},uCheekOn:{value:0},uCheekType:{value:1},uDensity:{value:e.density||70},uShells:{value:16},uFurLen:{value:e.furLen||.06},uTime:{value:0},uGravity:{value:new ae.Vector3(0,-.9,.15)},uBald:{value:[new ae.Vector4(0,-9,0,0),new ae.Vector4(0,-9,0,0),new ae.Vector4(0,-9,0,0)]},uTex:{value:t},uSp:{value:.2},uBlush:{value:0},uMorph:{value:new ae.Vector4(0,0,0,0)}},s=(e.finish==="toon"||e.finish==="sketch")&&!e.plush,a=r=>{let i=e.plush?"plush":e.finish,n=new ae.Color(e.color);e.plush&&n.multiplyScalar(1.12);let c=t===4&&!e.plush,h=new ae.MeshPhysicalMaterial({color:n,roughness:c?.08:{plush:.92,glossy:.28,soft3d:.55,clay:.85,flat:.75,toon:.6,neon:.4,sketch:.9}[i]??.5,metalness:0,clearcoat:c?1:{glossy:1,soft3d:.35,toon:.6,neon:.8}[i]??0,clearcoatRoughness:i==="soft3d"?.35:.08,sheen:e.plush?1:i==="clay"?.4:0,sheenRoughness:.5,sheenColor:new ae.Color(e.color).lerp(new ae.Color("#ffffff"),.45),emissive:i==="neon"?new ae.Color(e.color).multiplyScalar(.55):new ae.Color(0),envMapIntensity:e.plush?.7:c?1.5:1});return r&&(h.alphaTest=.5,h.alphaToCoverage=!0),h.defines={...e.plush?{FUR:""}:{},...r?{FUR_SHELL:""}:{},...s&&!r?{TOON:""}:{},...e.finish==="sketch"&&!r?{SKETCH:""}:{},...c?{GEL:""}:{}},h.customProgramCacheKey=()=>`ots3d-${e.plush?"fur":"solid"}-${r?"shell":"base"}-${s?e.finish:""}-${c?"gel":""}`,h.onBeforeCompile=u=>{Object.assign(u.uniforms,o),u.vertexShader=u.vertexShader.replace("#include <common>",nn).replace("#include <begin_vertex>",`${ln}
19
+ `,Ic={angry:[["spikes",{ms:900}],["anger"],["steam"]],surprised:[["exclaim"]],love:[["hearts"],["blush"]],happy:[["sparkles"]],sad:[["tears"]],fear:[["sweat"]],disgust:[["squish",{ms:700}]],sleep:[["zzz",{hold:!0,tag:"mood"}]]},Bc=1800,Li=380,ks=300,Oi=300,Gc=Object.keys(Do),ot=()=>typeof performance<"u"?performance.now():Date.now(),rr=(e,t,o)=>e.map((s,a)=>[we(s[0],t[a][0],o),we(s[1],t[a][1],o)])});var _o=Pa((d0,Yi)=>{Yi.exports=globalThis.__OTS_THREE__.three});var Xi=Pa((u0,Ki)=>{Ki.exports=globalThis.__OTS_THREE__.RoomEnvironment});function ha(e={}){let t=e.key||"page";return ur.has(t)||ur.set(t,new fr(e)),ur.get(t)}var Ie,Ji,ur,fr,en=Ke(()=>{Ie=jt(_o(),1),Ji=jt(Xi(),1),ur=new Map;fr=class{constructor(t){this.maxDpr=t.supersample?t.maxDpr||2:Math.min(t.maxDpr||1.5,window.devicePixelRatio||1),this.minDpr=Math.min(t.minDpr||.75,this.maxDpr),this.dpr=this.maxDpr,this.adaptive=t.adaptive!==!1;let o=document.createElement("canvas");o.className="ots3d-canvas",o.setAttribute("aria-hidden","true"),o.style.cssText=`position:fixed;left:0;top:0;width:100vw;height:100vh;pointer-events:none;z-index:${t.zIndex??1};display:block`,(t.parent||document.body).appendChild(o),this.canvas=o;let s=new Ie.WebGLRenderer({canvas:o,antialias:!0,alpha:!0,powerPreference:"high-performance"});s.setPixelRatio(this.dpr),s.outputColorSpace=Ie.SRGBColorSpace,s.toneMapping=Ie.NeutralToneMapping,s.toneMappingExposure=1.05,s.setClearColor(0,0),s.info.autoReset=!1,s.autoClear=!1,this.renderer=s;let a=new Ie.PMREMGenerator(s);this.envMap=a.fromScene(new Ji.RoomEnvironment,.04).texture,a.dispose(),this.views=new Set,this.visible=new Set,this.raf=0,this.last=0,this.stats={fps:0,ms:0,calls:0,triangles:0,dpr:this.dpr,views:0,characters:0},this._frames=0,this._acc=0,this._statT=0,this._good=0,this._w=0,this._h=0,this.io=new IntersectionObserver(r=>{for(let i of r){let n=i.target.__ots3dView;n&&(i.isIntersecting?this.visible.add(n):this.visible.delete(n))}this.wake()},{rootMargin:"64px"}),this._vis=()=>document.hidden?this.sleep():this.wake(),document.addEventListener("visibilitychange",this._vis)}makeScene(){let t=new Ie.Scene;t.environment=this.envMap,t.environmentIntensity=.75,t.add(new Ie.HemisphereLight(15265023,4206670,.7));let o=new Ie.DirectionalLight(16773600,2.4);o.position.set(2.2,3.4,3.2);let s=new Ie.DirectionalLight(13623551,2.2);s.position.set(-2.6,2.2,-3);let a=new Ie.DirectionalLight(16770804,.5);return a.position.set(-3,.5,2),t.add(o,s,a),t}addView(t){this.views.add(t),t.el.__ots3dView=t,this.io.observe(t.el),this.wake()}removeView(t){this.views.delete(t),this.visible.delete(t),this.io.unobserve(t.el),delete t.el.__ots3dView}wake(){this.raf||document.hidden||!this.visible.size||(this.last=performance.now(),this.raf=requestAnimationFrame(t=>this.frame(t)))}sleep(){cancelAnimationFrame(this.raf),this.raf=0}resize(){let t=window.innerWidth,o=window.innerHeight,s=this.renderer;(t!==this._w||o!==this._h||s.getPixelRatio()!==this.dpr)&&(this._w=t,this._h=o,s.setPixelRatio(this.dpr),s.setSize(t,o,!1))}frame(t){if(this.raf=0,document.hidden||!this.visible.size)return;let o=Math.min(64,Math.max(0,t-this.last));this.last=t;let s=performance.now();this.resize();let a=this.renderer;a.info.reset(),a.setScissorTest(!1),a.clear(),a.setScissorTest(!0);let r=0;for(let i of this.visible){let n=i.el.getBoundingClientRect();if(n.bottom<0||n.top>this._h||n.right<0||n.left>this._w||n.width<2||n.height<2)continue;i.rect=n,i.tick(t,o),r+=i.characters.length;let c=n;if(i.bleed){let u=i.bleed==="window"?null:i.bleed;c=u==null?{left:0,top:0,width:this._w,height:this._h}:{left:n.left-u,top:n.top-u,width:n.width+2*u,height:n.height+2*u},i.camera.setViewOffset(n.width,n.height,c.left-n.left,c.top-n.top,c.width,c.height)}i.vrect=c;let h=this._h-(c.top+c.height);a.setViewport(c.left,h,c.width,c.height),a.setScissor(c.left,h,c.width,c.height),a.render(i.scene,i.camera)}if(this._frames++,this._acc+=performance.now()-s,t-this._statT>1e3){let i=(t-this._statT)/1e3,n=this._statT?this._frames/i:60;Object.assign(this.stats,{fps:Math.round(n),ms:Math.round(this._acc/this._frames*10)/10,calls:a.info.render.calls,triangles:a.info.render.triangles,dpr:this.dpr,views:this.visible.size,characters:r}),this.adaptive&&this._statT&&(n<48&&this.dpr>this.minDpr?(this.dpr=Math.max(this.minDpr,Math.round((this.dpr-.25)*100)/100),this._good=0):n>57&&this.dpr<this.maxDpr&&++this._good>=3&&(this.dpr=Math.min(this.maxDpr,this.dpr+.25),this._good=0)),this._statT=t,this._frames=0,this._acc=0}this.raf=requestAnimationFrame(i=>this.frame(i))}}});var pr=Pa((p0,tn)=>{tn.exports=globalThis.__OTS_THREE__.BufferGeometryUtils});function Vc(e,t=12){let o=e.length,s=r=>e[(r+o)%o],a=[];for(let r=0;r<o;r++){let[i,n,c,h]=[s(r-1),s(r),s(r+1),s(r+2)],u=[n[0]+(c[0]-i[0])/6,n[1]+(c[1]-i[1])/6],d=[c[0]-(h[0]-n[0])/6,c[1]-(h[1]-n[1])/6];for(let p=0;p<t;p++){let f=p/t,m=(1-f)**3,g=3*(1-f)**2*f,b=3*(1-f)*f*f,$=f**3;a.push([m*n[0]+g*u[0]+b*d[0]+$*c[0],m*n[1]+g*u[1]+b*d[1]+$*c[1]])}}return a}function Fc(e,t,o){let s=new Float32Array(at),a=e.length;for(let i=0;i<at;i++){let n=i/at*Math.PI*2,c=Math.cos(n),h=Math.sin(n),u=0;for(let d=0;d<a;d++){let[p,f]=e[d],[m,g]=e[(d+1)%a],b=m-p,$=g-f,v=c*$-h*b;if(Math.abs(v)<1e-9)continue;let S=p-t,M=f-o,z=(S*$-M*b)/v,I=(S*h-M*c)/v;z>0&&I>=0&&I<=1&&z>u&&(u=z)}s[i]=u}let r=new Float32Array(at);for(let i=0;i<at;i++)r[i]=(s[(i+at-1)%at]+2*s[i]+s[(i+1)%at])/4;return r}function mr(e,t,o="high"){let s=`${o}|${e.map($=>`${Math.round($[0])},${Math.round($[1])}`).join(" ")}`;if(Fo.has(s))return Fo.get(s);let a=t.x+t.w/2,r=t.y+t.h*.54,i=t.y+t.h,n=Fc(Vc(e),a,r),c=0;for(let $=0;$<at;$++)c+=n[$];c/=at;let h=.86,u=h*c,[d,p]=o==="high"?[96,64]:[40,26],f=new Pe.SphereGeometry(1,d,p);f.deleteAttribute("uv"),f.deleteAttribute("normal"),f=(0,on.mergeVertices)(f,1e-5);let m=f.attributes.position,g=new Pe.Vector3;for(let $=0;$<m.count;$++){g.fromBufferAttribute(m,$).normalize();let v=g.x*g.x+g.y*g.y,S=Math.atan2(-g.y,g.x),M=Uc(n,S),z=h*Math.min(M,c*1.05),I=u+(z-u)*v;m.setXYZ($,g.x*M*me,(i-r)*me+g.y*M*me,g.z*I*me)}for(let $=0;$<m.count;$++){let v=m.getY($);v<.03&&m.setY($,.03+(v-.03)*.35)}f.computeVertexNormals(),f.computeBoundingBox(),f.computeBoundingSphere(),f.userData.shared=!0;let b={geometry:f,table:n,cx:a,cy:r,bottom:i,mean:c,depth:u*me};return Fo.set(s,b),Fo.size>160&&Fo.delete(Fo.keys().next().value),b}function gr(e){let t=new Pe.Mesh(e,new Pe.MeshBasicMaterial({side:Pe.DoubleSide})),o=new Pe.Raycaster,s=new Pe.Vector3,a=new Pe.Vector3,r=(i,n,c,h,u,d)=>{s.set(i,n,c),a.set(h,u,d).normalize(),o.set(s,a);let p=o.intersectObject(t,!1)[0];return p?{p:p.point.clone(),n:p.face.normal.clone()}:null};return{front(i,n){return r(i,n,10,0,0,-1)||{p:new Pe.Vector3(i,n,0),n:new Pe.Vector3(0,0,1)}},top(i,n=0){return r(i,10,n,0,-1,0)||{p:new Pe.Vector3(i,1,n),n:new Pe.Vector3(0,1,0)}},section(i){let n=r(10,i,0,-1,0,0),c=r(0,i,10,0,0,-1);return{w:n?Math.abs(n.p.x):.5,d:c?Math.abs(c.p.z):.4,z:c?c.p.z:.4}}}}var Pe,on,me,at,Uc,Fo,sn=Ke(()=>{Pe=jt(_o(),1),on=jt(pr(),1),me=1/100,at=360;Uc=(e,t)=>{let o=(t/(Math.PI*2)%1+1)%1*at,s=Math.floor(o);return o-=s,e[s%at]*(1-o)+e[(s+1)%at]*o},Fo=new Map});function yr(e){let t=Qc[e.texture]??0,o={uPat:{value:new ae.Color(e.patternColor)},uPatType:{value:Wc[e.pattern]??0},uDims:{value:new ae.Vector4(1,1,.6,.1)},uCheek:{value:new ae.Vector4(.3,.4,.4,.1)},uCheekColor:{value:new ae.Color(e.cheekColor||"#ff6b8a")},uCheekOn:{value:0},uCheekType:{value:1},uDensity:{value:e.density||70},uShells:{value:16},uFurLen:{value:e.furLen||.06},uTime:{value:0},uGravity:{value:new ae.Vector3(0,-.9,.15)},uBald:{value:[new ae.Vector4(0,-9,0,0),new ae.Vector4(0,-9,0,0),new ae.Vector4(0,-9,0,0)]},uTex:{value:t},uSp:{value:.2},uBlush:{value:0},uMorph:{value:new ae.Vector4(0,0,0,0)}},s=(e.finish==="toon"||e.finish==="sketch")&&!e.plush,a=r=>{let i=e.plush?"plush":e.finish,n=new ae.Color(e.color);e.plush&&n.multiplyScalar(1.12);let c=t===4&&!e.plush,h=new ae.MeshPhysicalMaterial({color:n,roughness:c?.08:{plush:.92,glossy:.28,soft3d:.55,clay:.85,flat:.75,toon:.6,neon:.4,sketch:.9}[i]??.5,metalness:0,clearcoat:c?1:{glossy:1,soft3d:.35,toon:.6,neon:.8}[i]??0,clearcoatRoughness:i==="soft3d"?.35:.08,sheen:e.plush?1:i==="clay"?.4:0,sheenRoughness:.5,sheenColor:new ae.Color(e.color).lerp(new ae.Color("#ffffff"),.45),emissive:i==="neon"?new ae.Color(e.color).multiplyScalar(.55):new ae.Color(0),envMapIntensity:e.plush?.7:c?1.5:1});return r&&(h.alphaTest=.5,h.alphaToCoverage=!0),h.defines={...e.plush?{FUR:""}:{},...r?{FUR_SHELL:""}:{},...s&&!r?{TOON:""}:{},...e.finish==="sketch"&&!r?{SKETCH:""}:{},...c?{GEL:""}:{}},h.customProgramCacheKey=()=>`ots3d-${e.plush?"fur":"solid"}-${r?"shell":"base"}-${s?e.finish:""}-${c?"gel":""}`,h.onBeforeCompile=u=>{Object.assign(u.uniforms,o),u.vertexShader=u.vertexShader.replace("#include <common>",nn).replace("#include <begin_vertex>",`${ln}
20
20
  #ifdef FUR_SHELL
21
21
  float fh = (float(gl_InstanceID) + 1.0) / uShells;
22
22
  vH = fh;
@@ -244,7 +244,7 @@ uniform vec3 uGravity;`,ln=`vec3 dN = normal;
244
244
  float det = dot(sx, r1);
245
245
  vec3 grad = sign(det) * (dh.x * r1 + dh.y * r2);
246
246
  normal = normalize(abs(det) * normal - grad);
247
- }`;an=new Map;Ts=null});function ua(e){let t=hn[e];return t||(t=hn[e]=Xc[e](),t.userData.shared=!0),t}function qe(e,t,o){let s=new se.InstancedMesh(ua(e),t,o);return s.frustumCulled=!1,s.instanceMatrix.setUsage(se.DynamicDrawUsage),s.userData.instFx=!0,s}function Le(e,t,o,s,a,r,i=0,n=0,c=0,h=r){Wo.position.set(o,s,a),Wo.rotation.set(n,c,i),Wo.scale.set(r,h,r),r<=1e-4&&Wo.scale.setScalar(1e-5),Wo.updateMatrix(),e.setMatrixAt(t,Wo.matrix)}function Qo(e){e?.traverse?.(t=>{t.isInstancedMesh&&t.dispose()}),e?.removeFromParent()}var se,un,Cs,Eo,Uo,Zt,hn,wr,Kc,As,Xc,dn,Jc,Wo,Ge,fa,fn=Ke(()=>{se=jt(_o(),1),un=jt(pr(),1);ws();$r();Cs=Math.PI*2,Eo=Math.PI/180,Uo=(e,t=.2)=>fe.backOut(N(e/t)),Zt=(e,t=.25)=>N((1-e)/t),hn={},wr=(e,t=.25)=>new se.ExtrudeGeometry(e,{depth:t,bevelEnabled:!0,bevelThickness:.08,bevelSize:.07,bevelSegments:2,curveSegments:8}).center(),Kc=e=>{for(let t of Object.keys(e.attributes))t!=="position"&&t!=="normal"&&e.deleteAttribute(t);return e},As=(...e)=>(0,un.mergeGeometries)(e.map(t=>Kc(t.index?t.toNonIndexed():t))),Xc={star:()=>{let e=new se.Shape;e.moveTo(0,1);for(let[t,o,s,a]of[[0,0,1,0],[0,0,0,-1],[0,0,-1,0],[0,0,0,1]])e.quadraticCurveTo(t,o,s,a);return wr(e,.3)},heart:()=>{let e=new se.Shape;return e.moveTo(0,-.9),e.bezierCurveTo(-1.4,.1,-.7,1.05,0,.35),e.bezierCurveTo(.7,1.05,1.4,.1,0,-.9),wr(e,.35)},drop:()=>{let e=[];for(let t=0;t<=12;t++){let o=t/12*Math.PI,s=Math.sin(o)*(o>Math.PI/2?1:.35+.65*Math.sin(o));e.push(new se.Vector2(Math.max(.001,s*.8),Math.cos(o)*1.2))}return new se.LatheGeometry(e,14)},z:()=>{let e=new se.Shape;return e.moveTo(-1,1),e.lineTo(1,1),e.lineTo(1,.62),e.lineTo(-.35,-.62),e.lineTo(1,-.62),e.lineTo(1,-1),e.lineTo(-1,-1),e.lineTo(-1,-.62),e.lineTo(.35,.62),e.lineTo(-1,.62),e.lineTo(-1,1),wr(e,.4)},note:()=>As(new se.SphereGeometry(.42,12,8).scale(1.25,.95,.7).rotateZ(.35).translate(-.3,-.75,0),new se.CylinderGeometry(.08,.08,1.5,6).translate(.18,0,0),new se.BoxGeometry(.5,.18,.12).rotateZ(-.5).translate(.38,.6,0)),bang:()=>As(new se.CylinderGeometry(.2,.12,1.15,12).translate(0,.62,0),new se.SphereGeometry(.17,12,8).translate(0,-.12,0)),ask:()=>{let e=new se.CatmullRomCurve3([[-.35,.75],[-.25,1.05],[.15,1.12],[.42,.9],[.35,.6],[.05,.45],[0,.18]].map(([t,o])=>new se.Vector3(t,o,0)));return As(new se.TubeGeometry(e,24,.11,8),new se.SphereGeometry(.15,12,8).translate(0,-.12,0))},anger:()=>{let e=[];for(let[t,o]of[[1,-1],[1,1],[-1,1],[-1,-1]]){let s=new se.QuadraticBezierCurve3(new se.Vector3(.25*t,.9*o,0),new se.Vector3(.25*t,.25*o,0),new se.Vector3(.9*t,.25*o,0));e.push(new se.TubeGeometry(s,10,.13,6))}return As(...e)},cloud:()=>As(...[[0,0,.55],[-.5,-.05,.4],[.5,-.02,.42],[-.22,.28,.4],[.25,.3,.38],[0,-.2,.42]].map(([e,t,o])=>new se.SphereGeometry(o,14,10).scale(1,1,.6).translate(e,t,0))),ball:()=>new se.SphereGeometry(1,14,10),ballHi:()=>new se.SphereGeometry(1,24,16),chip:()=>new se.BoxGeometry(1,.5,.12)};dn=null,Jc=()=>dn||(dn=new se.MeshPhysicalMaterial({color:"#bfe9ff",roughness:.02,clearcoat:1,transparent:!0,opacity:.4,depthWrite:!1,envMapIntensity:2,iridescence:1})),Wo=new se.Object3D;Ge=(...e)=>{for(let t of e)t.instanceMatrix.needsUpdate=!0},fa={sparkles:{ms:1300,make:(e,t)=>t.m=qe("star",R("gloss","#ffd84d"),6),draw:(e,t,o,s,a,r)=>{for(let i=0;i<6;i++){let n=r()*Cs,c=.55+r()*.25,h=(r()-.3)*e.D,u=N((o-i*.08)/.5),d=e.W*.07*(.6+r()*.6)*Math.sin(Math.PI*u)*a;Le(t.m,i,Math.cos(n)*e.W*c,e.H*.55-Math.sin(n)*e.H*c*.85,h,d,-s*.08*Eo)}Ge(t.m)}},sweat:{ms:1800,make:(e,t)=>t.m=qe("drop",R("gloss","#8fd3ff"),1),draw:(e,t,o,s,a)=>{Le(t.m,0,t.dir*e.W*.4,e.H*(.8-.08*fe.inOut(o)),e.D*.45,e.W*.05*Uo(o,.15)*Math.min(a,Zt(o)),-t.dir*12*Eo),Ge(t.m)}},blush:{ms:2e3,make:()=>null,draw:(e,t,o,s,a)=>{t.blush=Math.min(N(o/.15),Zt(o))*a}},hearts:{ms:1900,make:(e,t)=>t.m=qe("heart",R("gloss","#ff4d7a"),3),draw:(e,t,o,s,a,r)=>{for(let i=0;i<3;i++){let n=N((o-i*.15)/.7),c=n<=0?0:e.W*(.07+r()*.03)*Uo(n)*Zt(n,.3)*a;Le(t.m,i,(i-1)*e.W*.28+Math.sin(n*Cs+i)*e.W*.05,e.H*.88+e.H*.5*fe.out(n),e.D*.3,c,Math.sin(n*9+i)*.25)}Ge(t.m)}},zzz:{ms:2600,loop:!0,make:(e,t)=>t.m=qe("z",R("gloss","#5b6ee1"),3),draw:(e,t,o,s,a)=>{for(let r=0;r<3;r++){let i=(o+r/3)%1;Le(t.m,r,t.dir*(e.W*.32+e.W*.25*i),e.H*.88+e.H*.45*i,e.D*.2,e.W*(.033+.05*i)*Math.sin(Math.PI*i)*a,t.dir*-.2)}Ge(t.m)}},exclaim:{ms:1100,make:(e,t)=>t.m=qe("bang",R("gloss","#ff3b30"),1),draw:(e,t,o,s,a)=>{Le(t.m,0,t.dir*e.W*.36,e.H*1.04,e.D*.2,e.W*.24*Uo(o,.18)*Math.min(a,Zt(o,.2)),Math.sin(s/60)*6*Zt(o,.6)*Eo),Ge(t.m)}},question:{ms:1500,make:(e,t)=>t.m=qe("ask",R("gloss","#4f7cff"),1),draw:(e,t,o,s,a)=>{Le(t.m,0,t.dir*e.W*.4,e.H*1.02+Math.sin(s/200)*e.H*.015,e.D*.2,e.W*.24*Uo(o)*Math.min(a,Zt(o,.2)),-t.dir*12*Eo),Ge(t.m)}},anger:{ms:1300,make:(e,t)=>t.m=qe("anger",R("gloss","#ff2d2d"),1),draw:(e,t,o,s,a)=>{Le(t.m,0,t.dir*e.W*.33,e.H*.86,e.D*.55,e.W*.075*Uo(o,.15)*(1+.12*Math.sin(s/70))*Math.min(a,Zt(o)),0,0,t.dir*.5),Ge(t.m)}},steam:{ms:1500,make:(e,t)=>t.m=qe("ball",R("felt","#eef0f3"),6),draw:(e,t,o,s,a)=>{let r=0;for(let i of[-1,1])for(let n=0;n<3;n++){let c=N((o-n*.15)/.65),h=c<=0||c>=1?0:e.W*(.04+.07*c)*Math.min(1,(1-c)*3)*a;Le(t.m,r++,i*(e.W*.28+e.W*.18*c),e.H*.88+e.H*.38*c,0,h)}Ge(t.m)}},confetti:{ms:1900,make:(e,t)=>{let o=e.low?12:22,s=t.m=qe("chip",R("plastic","#ffffff"),o),a=["#ff4d7a","#ffd84d","#4dd2ff","#7cff6b","#b18cff","#ff9f43"],r=new se.Color;for(let i=0;i<o;i++)s.setColorAt(i,r.set(a[i%a.length]));return s},draw:(e,t,o,s,a,r)=>{let i=o*1.9,n=t.m.count,c=e.W*.035*Math.min(a,Zt(o,.3));for(let h=0;h<n;h++){let u=-Math.PI/2+(r()-.5)*2.2,d=e.H*(.9+r()*.8),p=(r()-.4)*d*.6,f=.3+r()*.5,m=Math.max(.005,e.H*.95-Math.sin(u)*d*i-e.H*1.1*i*i);Le(t.m,h,Math.cos(u)*d*i*.7,m,p*i,c,s*f*Eo+h,s*f*.7*Eo,h*.7)}Ge(t.m)}},tears:{ms:2200,rig:!0,make:(e,t)=>t.m=qe("drop",R("gloss","#8fd3ff"),4),draw:(e,t,o,s,a)=>{let r=0;for(let i of e.tears)for(let n=0;n<2;n++){let c=(o*2+n*.5)%1*(o<.9?1:0),h=c*c*(i.length-1),u=Math.min(i.length-2,Math.floor(h)),d=h-u,p=i[u],f=i[u+1];Le(t.m,r++,p[0]+(f[0]-p[0])*d,p[1]+(f[1]-p[1])*d,p[2]+(f[2]-p[2])*d,c<=0?0:e.r*.28*(1-c)*a*1.4)}Ge(t.m)}},thought:{ms:2200,make:(e,t)=>{t.m=qe("ball",R("felt","#ffffff"),2),t.c=qe("cloud",R("felt","#ffffff"),1),t.d=qe("ball",R("felt","#64748b"),3);let o=new se.Group;return o.add(t.m,t.c,t.d),o},draw:(e,t,o,s,a)=>{let r=Math.min(a,Zt(o,.15)),i=d=>Uo(N((o-d)/.4),.5),n=t.dir*e.W*.55,c=e.H*1.22,h=e.D*.15;Le(t.m,0,t.dir*e.W*.3,e.H*.98,h,e.W*.025*i(0)*r),Le(t.m,1,t.dir*e.W*.4,e.H*1.08,h,e.W*.042*i(.08)*r);let u=e.W*.36*i(.16)*r;Le(t.c,0,n,c,h,u);for(let d=0;d<3;d++)Le(t.d,d,n+(d-1)*u*.32,c,h+u*.36,u*.07*(.6+.6*Math.max(0,Math.sin(s/180-d*.9))));Ge(t.m,t.c,t.d)}},notes:{ms:2200,make:(e,t)=>t.m=qe("note",R("gloss","#8b5cf6"),3),draw:(e,t,o,s,a)=>{for(let r=0;r<3;r++){let i=N((o-r*.18)/.65),n=r%2?-1:1;Le(t.m,r,n*e.W*(.42+.1*i)+Math.sin(i*Cs)*e.W*.03,e.H*.75+e.H*.5*i,e.D*.25,i<=0||i>=1?0:e.W*.11*Math.sin(Math.PI*i)*a,-n*10*Eo)}Ge(t.m)}},sneeze:{ms:700,make:(e,t)=>t.m=qe("ball",R("gloss","#9fd8ff"),e.low?6:10),draw:(e,t,o,s,a,r)=>{let i=fe.out(o),n=e.mouth;for(let c=0;c<t.m.count;c++){let h=(r()-.5)*1.1,u=(r()-.5)*.8,d=e.W*(.15+r()*.45)*i;Le(t.m,c,n.x+t.dir*e.W*.05+Math.sin(h)*d,n.y+Math.sin(u)*d*.5-e.H*.15*i*i,n.z+Math.cos(h)*d,e.W*(.012+r()*.015)*(1-o)*a)}Ge(t.m)}},bubble:{ms:1e3,make:(e,t)=>t.m=qe("ballHi",Jc(),1),draw:(e,t,o,s,a)=>{let r=fe.out(N(o/.85)),i=N((o-.85)/.15),n=e.W*(.03+.05*r)*(1+i*.4)*(1-i)*a;Le(t.m,0,e.mouth.x+t.dir*e.W*.06+Math.sin(o*9)*e.W*.02,e.mouth.y+e.H*.3*r,e.mouth.z+e.W*.08,n),Ge(t.m)}},dizzy:{ms:1600,loop:!0,make:(e,t)=>t.m=qe("star",R("gloss","#ffd84d"),3),draw:(e,t,o,s,a)=>{for(let r=0;r<3;r++){let i=o*Cs+r*Cs/3;Le(t.m,r,Math.cos(i)*e.W*.42,e.H*1+Math.sin(i)*e.H*.04,Math.sin(i)*e.D*1.1,e.W*.045*a,s*.004,0,i)}Ge(t.m)}}}});function th(e){let t=Go(e);if(!t._style)return t;let o=t.finish;return t.finish=eh[t._style.id]||(o==="clay"||o==="sketch"?o:t._style.lw>0?"toon":o==="flat"?"soft3d":o),t}function P(e,t,o,s,a){let r=new E.Mesh(e,t);return o&&r.position.set(...o),s&&r.rotation.set(...s),a&&(typeof a=="number"?r.scale.setScalar(a):r.scale.set(...a)),r}var E,eh,vt,rt,pn,Rs,pa,bn,mn,$n,wn,oh,sh,ah,gn,rh,xr,ih,nh,lh,yn,Hs,ch,xn,vn,hh,Lt,dh,uh,ue,Zo,kn=Ke(()=>{E=jt(_o(),1);Qt();Vo();wo();ys();ws();sn();$r();fn();eh={ukiyoe:"toon",glass:"glossy",bauhaus:"toon",manuscript:"toon",glitch:"neon",clay:"clay",ink:"sketch",pop:"toon",watercolor:"soft3d",pixel:"toon",synthwave:"neon",nouveau:"toon",cubism:"toon",crayon:"sketch",blueprint:"neon",pointillism:"soft3d",woodcut:"sketch"};vt=Math.PI/180,rt=Math.PI*2,pn=new E.Vector3(0,0,1),Rs=new E.Object3D,pa={neutral:{curve:.15,tilt:0},happy:{curve:.85,tilt:-.25,squash:.85},angry:{curve:-.45,tilt:1},sad:{curve:-.85,tilt:-1},fear:{curve:-.35,tilt:-.8,eye:1.15,open:.15},disgust:{curve:-.55,tilt:.6,squash:.8},love:{curve:.75,tilt:-.3},sleep:{curve:0,tilt:0,closed:!0},surprised:{curve:0,tilt:-.4,eye:1.2,open:.45,lift:4}},bn={curve:0,tilt:0,squash:1,eye:1,open:0,lift:0},mn=e=>({...bn,...pa[e]||pa.neutral}),$n=Object.keys(pa),wn=Object.keys(ao),oh=new Set(["dot","kawaii","bean","sparkle","teary","button","pixel","villain"]),sh=new Set(["kawaii","sparkle","teary"]),ah={sleepy:[.5,0],tired:[.42,0],angry:[.42,1],sad:[.42,-1],focused:[.33,0]},gn={grin:.35,laugh:.6,open:.35,vampire:.25,buck:.12,braces:.35,monster:.45,gap:.35,toothless:.45,drool:.2,mustachio:.1},rh=new Set(["grin","braces","monster","gap","mustachio","vampire","buck"]),xr=new Set(["oh","kiss","whistle"]),ih={frown:-.7,flat:-.15,smile:.25,smirk:.2,pout:-.5,cat:.3},nh={angry:[["spikes",{ms:900}],["anger"],["steam"]],surprised:[["exclaim"]],love:[["hearts"],["blush"]],happy:[["sparkles"]],sad:[["tears"]],fear:[["sweat"]],disgust:[["squish",{ms:700}]],sleep:[["zzz",{hold:!0,tag:"mood"}]]},lh=1800,yn=380,Hs=300,ch=300,xn=Object.keys(bt),vn=Object.keys(vo),hh={puff:e=>[1+.2*e,1+.14*e],squish:e=>[1+.22*e,1-.22*e],stretch:e=>[1-.12*e,1+.26*e],melt:e=>[1+.06*e,1-.38*e]},Lt=()=>performance.now(),dh=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,uh=e=>(e.userData.shared=!0,e);ue=(...e)=>{let t=new E.Group;return e.length&&t.add(...e),t},Zo=class{constructor(t,o={}){this.opts=o,this.quality=o.quality||"high",this.q=this.quality==="high"?1:.45,this.root=new E.Group,this.rig=new E.Group,this.root.add(this.rig),this.yaw=0,this.view=null,this.phase=Math.random()*rt,this.moodName="neutral",this.mv=mn("neutral"),this.sleepK=0,this.look={x:0,y:0,tx:0,ty:0,at:-1e9},this.mo={open:0,target:0,msx:1,tmsx:1},this.blinkAt=-1e9,this.nextBlink=Lt()+600+Math.random()*3e3,this.gest=null,this.speech=null,this.shells=0,this.morphs=new Map,this.fxs=[],this.fxSeq=0,this.fxg=new E.Group,this.root.add(this.fxg),this.build(t)}build(t){this.disposeRig(),this.clearMorphObjects();for(let X of this.fxs)Qo(X.obj);this.fxs=[];let o=this.spec=th(st(t)),s=o._style,a=Wt(o),r=this.L=xt(o),i=this.B=mr(a,r.box,this.quality),n=gr(i.geometry),c=this.W=r.box.w*me,h=this.H=r.box.h*me;this.depth=i.depth;let u=this.kk=Math.sqrt(c*h)/1.25,d=this.Y=X=>(i.bottom-X)*me,p=this.X=X=>(X-r.cx)*me,f=this.tex=Ja(o),m=this.plush=!s&&((this.opts.material||"plush")==="plush"||["fur","fuzz","feathers"].includes(f)),g=this.furLen=m?(f==="fuzz"||f==="none"?.05:.065)*u:0,b=this.density=g?this.quality==="high"?1/(g*.2):1/(g*.32):0;this.maxShells=this.quality==="high"?28:10;let $=o.body.color,v=Jt($)<.28,S=this.pal={body:$,brow:o.brows.color||Y($,v?.6:-.6),lip:o.mouth.color||Y($,v?.6:-.55)};this.furs=[],this.parts=[],this.anims=[],this.bodyMeshes=[],this.zGrid=null,this.hideMouth=!1;let M=yr({color:$,patternColor:o.body.patternColor,pattern:o.body.pattern,finish:o.finish,plush:m,furLen:g,density:b,cheekColor:o.cheeks.color,texture:f});this.bodyU=M.uniforms,this.bodyMat=M.base;let z=r.r*me,I=d(r.eyeY);this.r3=z,this.eyeY=I,M.uniforms.uDims.value.set(c,h,I,z),M.uniforms.uSp.value=r.sp*me;let w=uh(new E.Mesh(i.geometry,M.base));w.userData.ownMaterial=!0,this.rig.add(w),this.bodyMeshes.push(w),M.shell&&this.bodyMeshes.push(this.addShells(i.geometry,M,this.rig)),this.probe=n;let k=s?s.lw*.0042:o.finish==="toon"?.016:.009;if(o.finish==="toon"||o.finish==="sketch"||s&&s.lw>0){let X=new E.Mesh(i.geometry,br(M.uniforms,{outline:!0,color:s?.ink||"#1f2937",off:g*1.05+k*u,wobble:o.finish==="sketch"?.6:0}));X.userData.ownMaterial=!0,X.userData.noBounds=!0,this.rig.add(X),this.bodyMeshes.push(X)}this.eyes=[];let H=o.eyes.type==="cyclops",C=H?[0]:[-r.sp*me,r.sp*me];if(C.forEach((X,J)=>{let ye=H||J?1:-1,$e=n.front(X,I),ke=this.buildEye(o.eyes.type,H?z*1.7:z,ye);ke.root.position.copy($e.p),ke.root.quaternion.setFromUnitVectors(pn,$e.n.clone().lerp(pn,.5).normalize()),this.rig.add(ke.root),this.eyes.push(ke),this.part(ke.root,!0),M.uniforms.uBald.value[J]&&M.uniforms.uBald.value[J].set($e.p.x,$e.p.y,$e.p.z,(H?z*1.7:z)*1.05)}),this.brows=[],o.brows.type!=="none"){let X=o.brows.type,J={thick:.2,thin:.06,bushy:.16,dots:.18,soft:.09}[X]||.11,ye=X==="unibrow",$e=ye?[0]:C.length===1?[0]:C;for(let ke of $e){let Ee=ke<0?-1:1,ie=I+z*1.65*(H?1.5:1),W=n.front(ke,ie),G=ye?r.sp*me+z:z*.85,ne=(Yt,Ae)=>new E.Vector3(Yt*z*Ee,Ae*z,z*.06),ce;X==="arched"?ce=new E.QuadraticBezierCurve3(ne(-.9,-.25),ne(.1,.7),ne(.95,-.05)):X==="angled"?(ce=new E.CurvePath,ce.add(new E.LineCurve3(ne(-.9,-.15),ne(.35,.35))),ce.add(new E.LineCurve3(ne(.35,.35),ne(.9,.05)))):ce=new E.QuadraticBezierCurve3(new E.Vector3(-G,0,0),new E.Vector3(0,z*(X==="soft"?.45:.35),z*.12),new E.Vector3(G,0,0));let Me=X==="dots"?this.sph(z*.3,16,12).scale(1.3,.8,.6):new E.TubeGeometry(ce,X==="angled"?24:16,z*J,8,!1),ct=P(Me,R("felt",S.brow)),Ze=ue(ct);Ze.position.copy(W.p).addScaledVector(W.n,g*.7+z*.05),Ze.userData.base=Ze.position.y,this.rig.add(Ze),this.brows.push({g:Ze,side:ye?0:Ee}),this.part(Ze,!0)}}this.buildMouth(o,n,p(r.cx),d(r.mouthY),r.mw*me,M),this.part(this.mouthRig.g,!0);let A=o.cheeks.type;if(A==="whiskers"){let X=R("matte","#1f2937");for(let J of[-1,1])for(let ye of[-.25,0,.25]){let $e=J*r.sp*me*.7,ke=I-z*(2.4+ye*2),Ee=n.front($e,ke);if(!Ee)continue;let ie=Ee.p.clone().addScaledVector(Ee.n,g*.8+.004),W=new E.Vector3(J*(r.sp*me+z*2.6),I-z*(2.2+ye*3.2),ie.z*.75+g),G=ie.clone().lerp(W,.5);G.z+=.02*u;let ne=ue(P(new E.TubeGeometry(new E.QuadraticBezierCurve3(ie,G,W),8,Math.max(.002,z*.05),5),X));this.rig.add(ne),this.part(ne,!0)}}else if(A!=="none"){let X=r.sp*me+z*.45,J=I-z*1.8,ye=n.front(X,J);M.uniforms.uCheek.value.set(X,J,ye?ye.p.z:0,z*(A==="blush"?1:.7)),M.uniforms.uCheekOn.value=1,M.uniforms.uCheekType.value=rn[A]||1;let $e=o.cheeks.color||"#ff6b8a";A==="stars"?M.uniforms.uCheekColor.value.set("#facc15"):A==="freckles"?M.uniforms.uCheekColor.value.set(Y(o.cheeks.color||Y($,-.25),-.35)):A==="hearts"?M.uniforms.uCheekColor.value.set(o.cheeks.color||"#ff4d7a"):M.uniforms.uCheekColor.value.set($e)}for(let X of o.accessories){let J=this.buildAccessory(X,{L:r,X:p,Y:d,W:c,H:h,kk:u,probe:n,eyeY:I,r3:z,bm:M});if(!J)continue;J.updateMatrixWorld(!0);let ye=J.userData.surface?new E.Vector3:new E.Box3().setFromObject(J).getCenter(new E.Vector3),$e=ue(J);J.position.sub(ye),$e.position.copy(ye),J.userData.surface||($e.position.x+=X.x*me,$e.position.y-=X.y*me,$e.rotation.z-=X.rot*vt,$e.scale.multiplyScalar(X.scale),X.flip&&($e.scale.x*=-1)),this.rig.add($e),J.userData.surface||this.part($e,!1)}this.hideMouth&&(this.mouthRig.g.visible=!1);let j=this.sph(.1*u,24,16).scale(1,1.1,.85),D=new E.CapsuleGeometry(.032*u,.07*u,4,8).translate(0,.1*u,.02*u);this.hands=[-1,1].map(X=>{let J=ue();m?this.addFur(j,$,J,.7):J.add(P(j,M.base));let ye=m?this.addFur(D,$,ue(),.5):P(D,M.base);return ye.visible=!1,J.add(ye),J.userData.finger=ye,J.visible=!1,this.rig.add(J),J});let V=this.eyes.map(X=>{let J=X.root.position.x,ye=[];for(let $e=0;$e<=6;$e++){let ke=n.front(J+Math.sign(J||1)*z*.05*$e,I-z*(.9+$e*.5)),Ee=ke.p.clone().addScaledVector(ke.n,g+.006*u);ye.push([Ee.x,Ee.y,Ee.z])}return ye});this.fxc={W:c,H:h,D:i.depth,eyeY:I,r:z,sp:r.sp*me,mouth:this.mouthRig.g.position,low:this.quality==="low",tears:V};let Z=new E.Mesh(new E.PlaneGeometry(1,1),new E.MeshBasicMaterial({map:cn(),transparent:!0,depthWrite:!1,toneMapped:!1}));Z.rotation.x=-Math.PI/2,Z.position.y=.002,Z.scale.set(c*1.55,i.depth*2.6,1),Z.renderOrder=-1,this.shadow=Z,this.root.add(Z),this.rig.updateMatrixWorld(!0);let pe=this.bounds=new E.Box3,ge=new E.Box3;this.rig.traverseVisible(X=>{!X.isMesh||X.isInstancedMesh||X.userData.noBounds||(X.geometry.boundingBox||X.geometry.computeBoundingBox(),pe.union(ge.copy(X.geometry.boundingBox).applyMatrix4(X.matrixWorld)))}),pe.expandByScalar(this.furLen),this.shells=-1,this.setShells(this.maxShells)}part(t,o){this.parts.push({o:t,p0:t.position.clone(),face:o,d:new E.Vector3})}frontZ(t,o){let a=this.W,r=this.H;if(!this.zGrid){let $=this.zGrid=new Float32Array(144);for(let v=0;v<12;v++)for(let S=0;S<12;S++)$[v*12+S]=this.probe.front((S/11-.5)*a,v/11*r)?.p.z??NaN}let i=N((t/a+.5)*11,0,11),n=N(o/r*11,0,11),c=Math.min(10,Math.floor(i)),h=Math.min(10,Math.floor(n)),u=i-c,d=n-h,p=this.zGrid,f=p[h*12+c],m=p[h*12+c+1],g=p[(h+1)*12+c],b=p[(h+1)*12+c+1];if(Number.isNaN(f)||Number.isNaN(m)||Number.isNaN(g)||Number.isNaN(b)){let $=p[Math.round(n)*12+Math.round(i)];return Number.isNaN($)?null:$}return we(we(f,m,u),we(g,b,u),d)}sph(t,o=32,s=16,...a){let r=this.q;return new E.SphereGeometry(t,Math.max(8,Math.round(o*r)),Math.max(6,Math.round(s*r)),...a)}tor(t,o,s=12,a=48,r=rt){let i=this.q;return new E.TorusGeometry(t,o,Math.max(4,Math.round(s*i)),Math.max(8,Math.round(a*i)),r)}addShells(t,o,s){let a=new E.InstancedMesh(t,o.shell,this.maxShells);return a.frustumCulled=!1,a.userData.ownMaterial=!0,s.add(a),this.furs.push({inst:a,u:o.uniforms}),a}addFur(t,o,s,a=.8){let r=yr({color:o,patternColor:o,pattern:"none",finish:"clay",plush:!0,furLen:this.furLen*a||.04,density:this.density||60});r.uniforms.uDims.value.set(1,.001,-9,.01);let i=new E.Mesh(t,r.base);return i.userData.ownMaterial=!0,s.add(i),this.addShells(t,r,s),s}setShells(t){if(t=Math.max(0,Math.min(this.maxShells,Math.round(t))),t!==this.shells){this.shells=t;for(let o of this.furs)o.inst.count=t,o.u.uShells.value=Math.max(1,t)}}buildEye(t,o,s){let a=this.spec.eyes,r=ue(),i=ue(),n=ue();r.add(i),i.add(n);let c=R("gloss",a.ink),h=t;h==="wink"&&(h=s>0?"happy":"round");let u=!1;if(oh.has(h)){let p=h==="kawaii"?1.15:h==="dot"?.75:h==="button"?1:.9,f=h==="bean"?[.55,1.2,.5]:h==="dot"?[.8,1.05,.6]:[.92,1,.6];n.add(P(this.sph(o*p,32,24),c,[0,0,-o*.18],null,f)),h==="button"&&n.add(P(this.tor(o*.72,o*.07,8,32),R("gloss",Y(a.ink,.25)),[0,0,o*.45])),sh.has(h)&&(n.add(P(this.sph(o*.2,12,8),R("emissive","#ffffff"),[-o*.32,o*.36,o*.38])),n.add(P(this.sph(o*.09,10,6),R("emissive","#ffffff"),[o*.34,-o*.34,o*.38])))}else if(h==="happy"||h==="closed"||h==="cross")if(u=!0,h==="cross")for(let p of[45,-45])i.add(P(new E.CapsuleGeometry(o*.13,o*1.3,4,8),R("felt",a.ink),[0,0,o*.1],[0,0,p*vt]));else i.add(P(this.tor(o*.72,o*.14,10,24,Math.PI),R("felt",a.ink),[0,h==="happy"?-o*.25:o*.25,o*.08],[0,0,h==="happy"?0:Math.PI]));else if(h==="star"||h==="heart"){let p=new E.Shape;if(h==="star")for(let m=0;m<10;m++){let g=-Math.PI/2+m*Math.PI/5,b=m%2?o*.5:o*1.1;m?p.lineTo(Math.cos(g)*b,-Math.sin(g)*b):p.moveTo(Math.cos(g)*b,-Math.sin(g)*b)}else{let m=o*1.05;p.moveTo(0,-m*.9),p.bezierCurveTo(-m*1.4,m*.1,-m*.7,m*1.05,0,m*.35),p.bezierCurveTo(m*.7,m*1.05,m*1.4,m*.1,0,-m*.9)}let f=new E.ExtrudeGeometry(p,{depth:o*.2,bevelEnabled:!0,bevelThickness:o*.12,bevelSize:o*.1,bevelSegments:3,curveSegments:10});n.add(P(f,R("gloss",h==="heart"?"#ef3b5d":a.iris),[0,0,-o*.05]))}else if(h==="robot"||h==="led"||h==="glow"||h==="pixel")h==="robot"?(i.add(P(new E.BoxGeometry(o*2,o*1.6,o*.3),R("plastic","#0b1220"),[0,0,0])),n.add(P(new E.BoxGeometry(o*1.3,o*.9,o*.1),R("emissive",a.iris),[0,0,o*.16]))):h==="led"?n.add(P(new E.CapsuleGeometry(o*.3,o*1.6,4,12),R("emissive",a.iris),[0,0,o*.05],[0,0,Math.PI/2])):n.add(P(this.sph(o*.95,24,16),R("emissive",a.iris),[0,0,-o*.3],null,[1,1,.6]));else if(h==="spiral"||h==="dollar"){i.add(P(this.sph(o,32,24),R("gloss","#ffffff"),[0,0,-o*.2],null,[1,1,.75]));let p=o*.56,f;if(h==="spiral"){let g=[];for(let b=0;b<=48;b++){let $=b/48*Math.PI*5,v=o*(.06+.78*(b/48));g.push(new E.Vector3(Math.cos($)*v,Math.sin($)*v,p-b/48*o*.12))}f=new E.TubeGeometry(new E.CatmullRomCurve3(g),96,o*.07,6,!1)}else{let g=[[.45,.5],[0,.66],[-.45,.42],[-.28,.1],[.28,-.1],[.45,-.42],[0,-.66],[-.45,-.5]].map(([b,$])=>new E.Vector3(b*o*.6,$*o*.6,p));f=new E.TubeGeometry(new E.CatmullRomCurve3(g),40,o*.09,6,!1)}let m=P(f,R("gloss",h==="spiral"?a.ink:"#16a34a"));n.add(m),h==="dollar"?n.add(P(new E.CapsuleGeometry(o*.07,o*.95,3,6),R("gloss","#16a34a"),[0,0,p])):this.anims.push(g=>{m.rotation.z=-g*4*s})}else{let f=o*(h==="googly"?1.15:h==="wide"?1.12:h==="anime"?1.05:1),m=P(this.sph(f,32,24),R("gloss",h==="googly"||h==="hypno"?"#ffffff":a.white),[0,0,-f*.2],null,h==="anime"?[.9,1.2,.75]:h==="focused"?[1,.75,.75]:h==="almond"?[1.15,.72,.75]:[1,1,.75]);if(i.add(m),n.position.z=-f*.2,h==="almond"&&n.scale.set(1,.85,1),h==="lashes")for(let v=0;v<3;v++){let S=Math.cos(s>0?(30+v*30)*vt:(150-v*30)*vt),M=Math.sin((30+v*30)*vt);i.add(P(new E.CapsuleGeometry(f*.07,f*.32,3,6),R("felt",a.ink),[S*f*1.05,M*f*1.05,f*.2],[0,0,Math.atan2(M,S)-Math.PI/2]))}let g=h==="cat"?.92:h==="anime"?.7:h==="almond"?.72:h==="wide"||h==="googly"?0:.58;g&&n.add(P(this.sph(f*g,24,16),R("gloss",a.iris),[0,0,f*.62],null,h==="anime"?[1,1.3,.3]:[1,1,.3]));let b=h==="wide"?.3:h==="googly"?.55:h==="cat"?.5:.32;n.add(P(this.sph(f*b,20,12),c,[0,0,f*.68],null,h==="cat"?[.3,1.5,.3]:[1,1,.32])),n.add(P(this.sph(f*.11,10,6),R("emissive","#ffffff"),[-f*.22,f*.26,f*.78]));let $=ah[h];if($){let v=this.sph(f*1.07,32,12,0,rt,0,Math.PI*$[0]),S=P(v,R("felt",Y(this.spec.body.color,-.06)),[0,0,-f*.2],[0,0,$[1]*s*.45],[1,1,.8]);i.add(S)}}let d=P(this.tor(o*.72,o*.13,10,24,Math.PI),R("felt",a.ink),[0,o*.25,o*.08],[0,0,Math.PI]);return d.visible=!1,r.add(d),{root:r,main:i,gaze:n,closed:d,noBlink:u}}buildMouth(t,o,s,a,r,i){let n=t.mouth.type,c=ue(),h=o.front(s,a),u=this.plush?this.furLen*.55:.006;c.position.copy(h.p).addScaledVector(h.n,u),this.rig.add(c),i.uniforms.uBald.value[2]&&i.uniforms.uBald.value[2].set(h.p.x,h.p.y,h.p.z,r*1.1);let d=this.mouthRig={g:c,type:n,line:null,cav:null,min:gn[n]||0,bias:ih[n]||0,mw:r,round:null},p=R("felt",this.pal.lip),f=n==="grit"||n==="lips";if(!gn[n]&&!xr.has(n)&&n!=="beak"&&!f){let m=v=>{let S=[];for(let M=0;M<=8;M++){let z=M/4-1,I=z*r*(n==="tiny"||n==="pout"?.5:1),w=v*r*.5*(z*z-.45)+(n==="smirk"?z*r*.12:0)+(n==="wavy"?Math.sin(z*Math.PI*2)*r*.12:0),k=o.front(s+I,a+w).p.z-h.p.z;S.push(new E.Vector3(I,w,k))}return new E.TubeGeometry(new E.CatmullRomCurve3(S),32,Math.max(.006,r*.085),8,!1)},g=m(0),b=m(1),$=m(-1);g.morphAttributes.position=[b.attributes.position,$.attributes.position],g.morphAttributes.normal=[b.attributes.normal,$.attributes.normal],b.dispose(),$.dispose(),d.line=P(g,p),d.line.morphTargetInfluences=[0,0],c.add(d.line),n==="tongue"&&c.add(P(new E.CapsuleGeometry(r*.32,r*.3,4,12),R("gloss","#ff7a8a"),[r*.1,-r*.38,r*.05],null,[1,1,.45]))}if(xr.has(n)&&(d.round=ue(P(this.tor(r*.32,r*.1,10,24),n==="kiss"?R("gloss","#e11d48"):p),P(new E.CircleGeometry(r*.3,20),R("matte","#3a0d14"),[0,0,-.002])),n==="whistle"&&(d.round.position.x=r*.35),c.add(d.round)),n==="beak"&&c.add(P(new E.ConeGeometry(r*.6,r*1.1,24),R("plastic","#f59e0b"),[0,0,r*.4],[Math.PI/2,0,0],[1,1,.55])),n==="grit"){let m=ue(P(new E.BoxGeometry(r*2,r*.5,r*.12),R("plastic","#ffffff"))),g=R("matte","#1f2937");m.add(P(new E.BoxGeometry(r*2,r*.05,r*.02),g,[0,0,r*.065]));for(let b=1;b<5;b++)m.add(P(new E.BoxGeometry(r*.05,r*.5,r*.02),g,[(b/5-.5)*r*2,0,r*.065]));m.add(P(this.tor(1,.06,6,4).rotateZ(Math.PI/4).scale(r*1.45,r*.36,r*.2),p)),d.grit=m,c.add(m)}if(n==="lips"){let m=R("gloss",t.mouth.color||"#e11d48"),g=ue();for(let v of[-1,1])g.add(P(this.sph(1,20,12),m,[v*r*.42,0,0],[0,0,v*.25],[r*.55,r*.22,r*.2]));let b=P(this.sph(1,24,12),m,[0,0,0],null,[r*.85,r*.28,r*.22]),$=P(this.sph(1,20,10),R("gloss","#3a0d14"),[0,0,-r*.05],null,[r*.7,.001,r*.1]);d.lips={up:g,lo:b,hole:$},c.add(g,b,$)}if(n!=="beak"&&!xr.has(n)&&!f){let m=ue(),g=n==="robot"||n==="square";m.add(P(g?new E.BoxGeometry(2,2,1):this.sph(1,28,16),R("gloss","#3a0d14"),[0,0,0],null,g?[1,.5,.5]:[1,1,1]));let b=P(this.sph(.6,20,12),R("felt","#ff7a8a"),[0,-.45,.35],null,[1,.55,.5]);if(m.add(b),rh.has(n)&&m.add(P(new E.BoxGeometry(n==="buck"?.6:1.4,.3,.3),R("plastic","#ffffff"),[0,.68,.55])),n==="vampire"||n==="monster")for(let $ of[-.5,.5])m.add(P(new E.ConeGeometry(.14,.4,8),R("plastic","#ffffff"),[$,.62,.62],[Math.PI,0,0]));m.add(P(this.tor(1,.09,8,32),p,[0,0,.1],null,[1,1,1])),m.visible=!1,d.cav=m,c.add(m)}}buildAccessory(t,o){let{kk:s,probe:a,H:r,W:i,eyeY:n,r3:c,Y:h,X:u,L:d,bm:p}=o,f=.01*s,m=t.color,g=t.color2,b=t.id,$=a.top(0,0).p,v=w=>a.section($.y-w*s),S=(w,k,H=.8)=>this.addFur(w,k,ue(),H),M=ue(),z=(w,k=.05)=>(M.position.set($.x,$.y-k*s,0),M.add(w),M),I=w=>{let k=v(w);return{w:k.w,d:k.d,y:$.y-w*s}};switch(b){case"crown":case"tiara":{let w=R("metal",m),k=b==="crown"?6:3,H=.24*s;b==="crown"?M.add(P(new E.CylinderGeometry(H,H*1.05,.12*s,32,1,!0),w)):M.add(P(this.tor(H,.02*s,8,32,Math.PI),w,[0,0,0],[-Math.PI/2+.3,0,0]));for(let C=0;C<k;C++){let A=b==="crown"?C/k*rt:C/(k-1)*Math.PI,j=[Math.cos(A)*H,.1*s,b==="crown"?Math.sin(A)*H:Math.sin(A)*H*.3+.05*s];M.add(P(new E.ConeGeometry(.05*s,.12*s,12),w,j)),M.add(P(this.sph(.025*s,12,8),R("gloss",b==="crown"?"#dc2626":"#60a5fa"),[j[0],j[1]+.07*s,j[2]]))}return z(ue(...M.children.splice(0)),.02)}case"tophat":{let w=ue(P(new E.CylinderGeometry(.36*s,.36*s,.025*s,40),R("felt",m)),P(new E.CylinderGeometry(.22*s,.24*s,.4*s,40),R("felt",m),[0,.2*s,0]),P(new E.CylinderGeometry(.245*s,.245*s,.07*s,40),R("felt",g==="#ffffff"?"#dc2626":g),[0,.05*s,0]));return w.rotation.z=-.12,z(w,.06)}case"beanie":case"santa":case"cap":case"hardhat":case"viking":case"beret":{let w=I(b==="beret"?.14:.24),k=this.sph(1,40,20,0,rt,0,Math.PI/2).scale(w.w*1.08,$.y-w.y+.05*s,w.d*1.1),H=ue();if(b==="beanie"||b==="santa")H.add(S(k,m,.7)),H.add(S(this.sph(.09*s,20,14),b==="santa"?"#fafafa":g,1)),H.children[1].position.y=$.y-w.y+.08*s,b==="santa"&&H.add(S(this.tor(1,.12,12,40).rotateX(Math.PI/2).scale(w.w*1.08,s*.5,w.d*1.1),"#fafafa",.9));else if(b==="beret")H.add(P(k,R("felt",m),null,[0,0,-.25],[1.25,.45,1.2]));else{let C=b==="viking"?R("metal","#a3a3a3"):b==="cap"?R("felt",m):R("plastic",m);if(H.add(P(k,C)),b==="cap"&&H.add(P(new E.CylinderGeometry(w.w*.75,w.w*.75,.02*s,32,1,!1,-Math.PI/2,Math.PI),R("felt",g==="#ffffff"?Y(m,-.2):g),[0,.01,w.d*.9],null,[1,1,.9])),b==="hardhat"&&H.add(P(new E.CylinderGeometry(w.w*1.25,w.w*1.25,.02*s,40),R("plastic",m),[0,0,.02])),b==="viking")for(let A of[-1,1])H.add(P(new E.ConeGeometry(.06*s,.3*s,16),R("plastic","#fef3c7"),[A*w.w*1.05,($.y-w.y)*.5,0],[0,0,-A*1]))}return H.position.y=w.y,H}case"hair":{let w=this.sph(1,36,20).scale(.3*s,.17*s,.26*s),k=S(w,m,1.3);return k.position.set(0,$.y+.02*s,.04*s),k.rotation.x=.15,k}case"party":case"wizard":{let w=b==="party"?.42:.62,k=ue(P(new E.ConeGeometry((b==="party"?.16:.27)*s,w*s,32),R(b==="party"?"plastic":"felt",m),[0,w/2*s,0]));return b==="party"&&k.add(S(this.sph(.06*s,16,10),g,1)),b==="party"&&(k.children[1].position.y=w*s),b==="wizard"&&k.add(P(new E.CylinderGeometry(.42*s,.42*s,.02*s,40),R("felt",m))),k.rotation.z=-.15,z(k,.04)}case"cowboy":{let w=ue(P(this.sph(1,40,10,0,rt,Math.PI*.35,Math.PI*.3),R("felt",m),[0,.05*s,0],null,[.55*s,.12*s,.45*s]),P(new E.CapsuleGeometry(.2*s,.1*s,6,24),R("felt",m),[0,.15*s,0],null,[1,1,.8]),P(new E.CylinderGeometry(.205*s,.205*s,.04*s,32),R("felt",Y(m,-.35)),[0,.1*s,0]));return z(w,.05)}case"chef":{let w=ue(P(new E.CylinderGeometry(.2*s,.2*s,.14*s,32),R("felt","#fafafa")));for(let[k,H,C,A]of[[0,.2,0,.17],[-.13,.15,0,.12],[.13,.15,0,.12],[0,.15,.1,.12]])w.add(P(this.sph(A*s,20,14),R("felt","#fafafa"),[k*s,H*s,C*s]));return z(w,.04)}case"grad":{let w=ue(P(new E.CylinderGeometry(.17*s,.19*s,.1*s,32),R("felt",m)),P(new E.BoxGeometry(.46*s,.025*s,.46*s),R("felt",m),[0,.06*s,0],[0,Math.PI/4,0]),P(new E.CylinderGeometry(.008*s,.008*s,.16*s,6),R("felt",g==="#ffffff"?"#facc15":g),[.2*s,-.01*s,0]));return z(w,.03)}case"bow":case"flower":{let w=ue();if(b==="bow"){for(let k of[-1,1])w.add(P(new E.ConeGeometry(.08*s,.15*s,20),R("plastic",m),[k*.08*s,0,0],[0,0,k*Math.PI/2],[1,1,.5]));w.add(P(this.sph(.04*s,16,10),R("plastic",m)))}else{for(let k=0;k<5;k++){let H=k/5*rt;w.add(P(this.sph(.055*s,16,10),R("felt",m),[Math.cos(H)*.06*s,Math.sin(H)*.06*s,0],null,[1,1,.4]))}w.add(P(this.sph(.04*s,16,10),R("felt","#facc15"),[0,0,.01*s]))}return w.position.set(.14*s,$.y-.02*s,.06*s),w.rotation.z=-.3,w}case"halo":{let w=P(this.tor(.22*s,.025*s,12,48),R("emissive",m),null,[Math.PI/2,0,0]);return w.position.y=$.y+.14*s,w}case"horns":case"catears":case"bunny":case"antenna":case"sprout":{for(let w of b==="sprout"?[0]:[-1,1]){let k=ue();if(b==="horns"&&k.add(P(new E.ConeGeometry(.06*s,.22*s,20),R("gloss",m),[0,.09*s,0])),b==="catears"&&k.add(S(new E.ConeGeometry(.12*s,.22*s,24).scale(1,1,.45).translate(0,.09*s,0),m,.8)),b==="bunny"&&(k.add(S(this.sph(1,24,16).scale(.08*s,.26*s,.05*s).translate(0,.22*s,0),m,.8)),k.add(P(this.sph(1,20,12),R("felt",g),[0,.22*s,.035*s],null,[.045*s,.18*s,.02*s]))),b==="antenna"&&(k.add(P(new E.CylinderGeometry(.01*s,.01*s,.22*s,8),R("plastic",m),[0,.11*s,0])),k.add(P(this.sph(.045*s,16,10),R("emissive",g),[0,.23*s,0]))),b==="sprout"){k.add(P(new E.CylinderGeometry(.012*s,.015*s,.16*s,8),R("plastic","#16a34a"),[0,.08*s,0]));for(let A of[-1,1])k.add(P(this.sph(1,16,10),R("plastic",m),[A*.07*s,.17*s,0],[0,0,A*.5],[.08*s,.035*s,.02*s]))}let H=w*(b==="antenna"?.12:.22)*s,C=a.top(H,0).p;k.position.set(H,C.y-.03*s,0),k.rotation.z=-w*(b==="bunny"?.15:b==="catears"?.3:.35),M.add(k)}return M}case"headphones":case"headband":case"bandana":{let w=b==="bandana"?$.y-.12*s:n+(b==="headband"?c*2.2:0),k=a.section(w);if(b==="headphones"){let H=k.w+.04*s;M.add(P(this.tor(H,.025*s,10,40,Math.PI),R("plastic",m),[0,w,0],null,[1,($.y-w+.06*s)/H,1]));for(let C of[-1,1])M.add(P(new E.CylinderGeometry(.1*s,.1*s,.07*s,28),R("plastic",g),[C*H,w,0],[0,0,Math.PI/2]));return M}return M.add(P(this.tor(1,.05,10,48),R("felt",m),[0,w,0],[Math.PI/2,0,0],[k.w*1.04,k.d*1.06,s*.9])),M}case"glasses":case"square":case"nerd":case"sunglasses":case"aviator":case"heartglasses":case"starglasses":case"3d":case"monocle":case"goggles":case"visor":case"eyepatch":{let w=Math.max(...this.eyes.map(A=>A.root.position.z))+c*.55,k=c*(b==="nerd"?1.7:1.5),H=b==="monocle"?[1]:b==="eyepatch"?[-1]:[-1,1],C=R(b==="3d"?"plastic":"gloss",m);for(let A of H){let j=A*d.sp*me;if(b==="eyepatch"){M.add(P(this.sph(k*.9,24,12),R("felt",m),[j,n,w-k*.5],null,[1,.85,.35]));continue}if(b==="visor")continue;let D=b==="square"||b==="nerd"||b==="3d",V=this.tor(k,k*.13,8,D?4:32);M.add(P(V,C,[j,n,w],[0,0,D?Math.PI/4:0],D?[1.15,.85,1]:[1,1,1]));let Z=b==="sunglasses"||b==="aviator"?"#0f172a":b==="goggles"?g:b==="3d"?A<0?"#ef4444":"#22d3ee":b==="heartglasses"?"#f9a8d4":b==="starglasses"?"#fde68a":null;if(Z){let pe=P(new E.CircleGeometry(k,D?4:32),new E.MeshPhysicalMaterial({color:Z,roughness:.05,clearcoat:1,transparent:!0,opacity:b==="sunglasses"?.92:.55}),[j,n,w-.002],[0,0,D?Math.PI/4:0],D?[1.15,.85,1]:[1,1,1]);M.add(pe)}}if(b==="visor"&&M.add(P(new E.CapsuleGeometry(k*.8,d.sp*me*2.2,6,16),new E.MeshPhysicalMaterial({color:m,roughness:.05,clearcoat:1,transparent:!0,opacity:.75}),[0,n,w],[0,0,Math.PI/2],[1,1,.3])),H.length===2&&b!=="visor"&&M.add(P(new E.CylinderGeometry(k*.1,k*.1,d.sp*me*2-k*2,8),C,[0,n+k*.15,w],[0,0,Math.PI/2])),b==="eyepatch"){let A=a.section(n+c);M.add(P(this.tor(1,.02,6,48),R("felt",m),[0,n+c*.4,0],[Math.PI/2,-.35,0],[A.w*1.03,A.d*1.05,s]))}return M}case"mustache":case"handlebar":case"beard":case"wizardbeard":case"goatee":{let w=h(d.mouthY),k=a.front(0,w);if(b==="mustache"||b==="handlebar"){let j=ue();for(let D of[-1,1])j.add(S(this.sph(1,20,12).scale(.1*s,.04*s,.04*s).rotateZ(D*(b==="handlebar"?-.4:.25)).translate(D*.085*s,0,0),m,.6));return j.position.copy(k.p).add(new E.Vector3(0,d.mw*me*.5,this.furLen*.6)),j}let H=b==="wizardbeard"?1.8:b==="goatee"?.6:1,C=b==="goatee"?.08:.3,A=S(this.sph(1,28,18).scale(C*s,.16*H*s,.12*s),m,1.1);return A.position.set(0,w-.1*H*s,k.p.z-.04*s),A}case"clownnose":case"nose":case"pignose":{let w=h(d.anchors.nose.y),k=a.front(0,w),H=ue();if(b==="clownnose")H.add(P(this.sph(.075*s,24,16),R("gloss",m)));else if(b==="nose")H.add(P(this.sph(.035*s,20,12),R("gloss",m),null,null,[1.3,.9,.8]));else{H.add(P(new E.CylinderGeometry(.08*s,.08*s,.05*s,28),R("felt",m),null,[Math.PI/2,0,0],[1,1,.75]));for(let C of[-1,1])H.add(P(this.sph(.018*s,12,8),R("matte",Y(m,-.5)),[C*.03*s,0,.026*s]))}return H.position.copy(k.p).addScaledVector(k.n,this.furLen*.6+.02*s),H}case"bowtie":case"tie":case"medal":case"bell":case"scarf":case"pearls":case"ruff":{let w=h(d.anchors.neck.y),k=a.section(w),H=k.z+this.furLen*.6;if(b==="scarf"||b==="ruff")return M.add(S(this.tor(1,.1,14,48).rotateX(Math.PI/2).scale(k.w*1.05,s*(b==="ruff"?.9:.75),k.d*1.08),m,.9)),b==="scarf"&&M.add(S(new E.BoxGeometry(.1*s,.26*s,.04*s,2,6,2).translate(.12*s,-.12*s,H+.02*s),m,.9)),M.position.y=w,M;if(b==="pearls"){for(let A=0;A<=12;A++){let j=Math.PI*(A/12);M.add(P(this.sph(.025*s,12,8),R("gloss",m),[Math.cos(j)*k.w*1.02,w-Math.sin(j)*.03*s,Math.sin(j)*k.d*1.05]))}return M}let C=ue();if(b==="bowtie"){for(let A of[-1,1])C.add(P(new E.ConeGeometry(.07*s,.14*s,20),R("felt",m),[A*.065*s,0,0],[0,0,A*Math.PI/2],[1,1,.5]));C.add(P(this.sph(.035*s,16,10),R("felt",Y(m,-.2))))}else b==="tie"?(C.add(P(this.sph(.035*s,16,10),R("felt",Y(m,-.2)))),C.add(P(new E.ConeGeometry(.06*s,.3*s,4),R("felt",m),[0,-.17*s,0],[Math.PI,Math.PI/4,0],[1,1,.35]))):b==="medal"?(C.add(P(new E.CylinderGeometry(.06*s,.06*s,.015*s,32),R("metal",m),[0,-.08*s,0],[Math.PI/2,0,0])),C.add(P(new E.BoxGeometry(.04*s,.1*s,.005*s),R("felt",g),[0,-.02*s,0]))):(C.add(P(this.sph(.06*s,20,14),R("metal",m),[0,-.05*s,0])),M.add(P(this.tor(1,.045,10,48),R("felt",g),[0,w,0],[Math.PI/2,0,0],[k.w*1.03,k.d*1.05,s])));return C.position.set(0,w,H),M.add(C),M}case"cape":case"superhero":{let w=a.section(r*.5),k=new E.CylinderGeometry(w.w*1.02,w.w*1.35,r*.75,32,1,!0,Math.PI/2+.35,Math.PI-.7);k.scale(1,1,w.d/w.w*1.1);let H=new E.MeshPhysicalMaterial({color:m,roughness:.6,sheen:.6,side:E.DoubleSide});return M.add(P(k,H,[0,r*.4,0])),M}case"wings":case"batwings":{let w=a.section(r*.5);for(let k of[-1,1]){let H=ue(P(this.sph(1,24,12),b==="wings"?R("felt",m):R("plastic",m),[k*.2*s,.08*s,0],null,[.24*s,.15*s,.03*s]));H.position.set(k*w.w*.5,r*.55,-w.d*.85),H.rotation.set(0,k*.5,k*.35),M.add(H)}return M}case"tail":{let w=new E.CatmullRomCurve3([new E.Vector3(0,.12*s,-.1),new E.Vector3(.12*s,.1*s,-.45*s),new E.Vector3(.25*s,.32*s,-.5*s)]);return M.add(P(new E.TubeGeometry(w,24,.02*s,8),R("gloss",m))),M.add(P(new E.ConeGeometry(.06*s,.1*s,4),R("gloss",m),[.25*s,.36*s,-.5*s],null,[1,1,.4])),M}case"jetpack":{let w=a.section(r*.5);for(let k of[-1,1])M.add(P(new E.CapsuleGeometry(.07*s,.22*s,6,16),R("metal",m),[k*.09*s,r*.5,-w.d-.04*s])),M.add(P(new E.ConeGeometry(.05*s,.14*s,16),R("emissive","#f97316"),[k*.09*s,r*.5-.22*s,-w.d-.04*s],[Math.PI,0,0]));return M}case"pirate":{let w=I(.2),k=$.y-w.y+.06*s,H=R("felt",m),C=ue(P(this.sph(1,32,16,0,rt,0,Math.PI/2),H,null,null,[w.w*.95,k*1.1,w.d]));for(let D=0;D<3;D++){let V=ue(P(this.sph(1,24,10),H,[0,0,w.d*.85],[-.75,0,0],[w.w*.95,.1*s,.07*s]));V.rotation.y=D/3*rt,V.position.y=k*.12,C.add(V)}let A=R("felt",g),j=ue(P(this.sph(.045*s,16,10),A));for(let D of[.7,-.7])j.add(P(new E.CapsuleGeometry(.012*s,.11*s,3,6),A,[0,0,-.01*s],[0,0,D]));for(let D of[-1,1])j.add(P(this.sph(.011*s,8,6),R("matte","#111827"),[D*.016*s,.005*s,.04*s]));return j.position.set(0,k*.5,w.d*.97),j.rotation.x=-.3,C.add(j),C.position.y=w.y,C}case"pipe":case"lollipop":{let w=h(d.mouthY),k=a.front(d.mw*me*.5,w).p,H=ue();H.position.copy(k),H.position.z+=this.furLen*.5;let C=(j,D,V,Z)=>{let pe=D.clone().sub(j),ge=P(new E.CylinderGeometry(V,V,pe.length(),8),Z);return ge.position.copy(j).addScaledVector(pe,.5),ge.quaternion.setFromUnitVectors(new E.Vector3(0,1,0),pe.normalize()),ge},A=(j,D,V)=>new E.Vector3(j*f,D*f,V*f);if(b==="pipe"){H.add(C(A(0,0,0),A(22,-10,14),2*f,R("gloss","#1f2937")));let j=A(26,-16,16);H.add(P(new E.CylinderGeometry(8*f,7*f,16*f,20),R("gloss",m),j.toArray())),H.add(P(new E.CircleGeometry(6.5*f,16),R("matte","#292524"),[j.x,j.y+8.05*f,j.z],[-Math.PI/2,0,0]));let D=[0,1,2].map(()=>P(this.sph(1,10,8),R("felt","#d6d3d1")));H.add(...D),this.anims.push(V=>D.forEach((Z,pe)=>{let ge=(V*.5+pe/3)%1;Z.position.set(j.x+Math.sin(ge*7+pe)*4*f,j.y+(10+ge*40)*f,j.z),Z.scale.setScalar(Math.max(1e-4,(2+ge*5)*f*Math.sin(Math.PI*ge)))}))}else{H.add(C(A(0,0,0),A(26,10,10),1.6*f,R("plastic","#fafafa")));let j=ue(P(new E.CylinderGeometry(11*f,11*f,4*f,28),R("gloss",m),null,[Math.PI/2,0,0])),D=[];for(let V=0;V<=30;V++){let Z=V/30*Math.PI*4,pe=(1+8*(V/30))*f;D.push(new E.Vector3(Math.cos(Z)*pe,Math.sin(Z)*pe,2.2*f))}j.add(P(new E.TubeGeometry(new E.CatmullRomCurve3(D),48,1*f,5),R("plastic","#ffffff"))),j.position.copy(A(31,13,12)),H.add(j)}return H}case"bandaid":case"ninjamask":case"facemask":{let w=this.depth,k=this.furLen*1.02+.004*s,H=(C,A,j,D=0,V=0)=>{let Z=new E.Mesh(this.B.geometry,br(p.uniforms,{color:C,off:k+V,box:A,kind:j,round:D}));return Z.userData.ownMaterial=!0,Z.userData.noBounds=!0,this.bodyMeshes.push(Z),Z};if(b==="bandaid"){let C=d.sp*me+c*.4,A=n-c*2.4;M.add(H(m,{c:[C,A,w],h:[12*f,4.5*f,w],rot:30*vt},"plastic",4.4*f)),M.add(H(Y(m,-.1),{c:[C,A,w],h:[4*f,4.6*f,w],rot:30*vt},"plastic",0,.002*s))}else if(b==="ninjamask"){let C=n-c*1.6;M.add(H(m,{c:[0,C/2,0],h:[9,C/2,9],rot:0},"felt")),this.hideMouth=!0}else{let C=h(d.mouthY),A=d.mw*me;M.add(H(m,{c:[0,C-5*f,w],h:[A+12*f,17*f,w],rot:0},"felt",8*f)),this.hideMouth=!0}return M.userData.surface=!0,M}case"scar":{let w=-d.sp*me,k=this.furLen*.9+.004*s,H=(j,D)=>{let V=a.front(j,D);return V.p.clone().addScaledVector(V.n,k)},C=[];for(let j=0;j<=8;j++){let D=j/8;C.push(H(w+we(-6,6,D)*f,n+c*we(2.6,-2.4,D)))}let A=R("felt",m);M.add(P(new E.TubeGeometry(new E.CatmullRomCurve3(C),16,1.4*f,5),A));for(let j of[-8,0,8]){let D=n-j*f,V=w+-j/8*2*f;M.add(P(new E.TubeGeometry(new E.LineCurve3(H(V-4*f,D),H(V+4*f,D)),2,1.1*f,5),A))}return M.userData.surface=!0,M}case"parrot":{let w=u(d.anchors.shoulder.x),k=a.top(w,0).p,H=ue(),C=s*1.1;H.add(P(this.sph(1,20,14),R("felt",m),[0,.09*C,0],[.2,0,0],[.065*C,.1*C,.065*C])),H.add(P(this.sph(.055*C,18,12),R("felt",m),[0,.2*C,.015*C])),H.add(P(new E.ConeGeometry(.03*C,.07*C,10),R("felt",g),[0,.265*C,-.01*C],[-.4,0,0])),H.add(P(new E.ConeGeometry(.02*C,.05*C,10),R("gloss","#facc15"),[0,.19*C,.07*C],[Math.PI/2+.5,0,0]));for(let D of[-1,1])H.add(P(this.sph(.011*C,8,6),R("gloss","#111111"),[D*.035*C,.21*C,.04*C]));H.add(P(new E.CapsuleGeometry(.018*C,.12*C,3,8),R("felt","#2563eb"),[0,.02*C,-.06*C],[-.9,0,0]));for(let D of[-1,1])H.add(P(this.sph(1,14,10),R("felt",Y(m,-.2)),[D*.06*C,.1*C,-.005*C],[.2,0,D*.15],[.02*C,.07*C,.05*C]));let A=k.y-.01*s;H.position.set(w,A,0),H.rotation.y=-.4;let j=Math.random()*rt;return this.anims.push(D=>{H.rotation.x=Math.sin(D*2.2+j)*.08,H.position.y=A+Math.max(0,Math.sin(D*1.3+j))*.01*s}),ue(H)}case"sparkles":case"hearts":case"zzz":{let w=b==="sparkles"?[[-.75,-.55,9],[.8,-.35,7],[.7,.55,6],[-.8,.35,5]].map(([C,A,j])=>[C*i*.62,r*.5-A*r*.55,j*1.3]):b==="hearts"?[[-40,-10,7],[36,-18,9],[8,-34,6]].map(([C,A,j])=>[C*f,$.y-A*f,j]):[[30,-10,9],[46,-26,6.5],[58,-38,5]].map(([C,A,j])=>[C*f,$.y-A*f,j]),k=R("gloss",b==="hearts"?"#f43f5e":m),H=w.map(([C,A,j],D)=>{let V=P(ua(b==="sparkles"?"star":b==="hearts"?"heart":"z"),k,[C,A,this.depth*.5]);return V.scale.setScalar(j*f),V.userData.r=j*f,V.userData.i=D,V});return M.add(...H),this.anims.push(C=>H.forEach(A=>{let j=A.userData.i;b==="sparkles"?(A.scale.setScalar(A.userData.r*(.7+.3*Math.sin(C*3+j*1.7))),A.rotation.z=C*.6+j):A.rotation.y=Math.sin(C*1.5+j)*.4})),M}case"sweat":{let w=a.front(d.sp*me+c*2.4,n+c*2.4),k=P(ua("drop"),R("gloss",m),null,[0,0,-.15]);return k.scale.setScalar(7*f),k.position.copy(w.p).addScaledVector(w.n,this.furLen+6*f),M.add(k),M}case"helmet":{let w=Math.max(i,r)*.62,k=P(this.sph(w,48,32),R("glass",m),[0,r*.5,0]);return k.renderOrder=2,k.userData.noBounds=!0,M.add(k),M.add(P(this.tor(w*.78,.035*s,10,48),R("metal",g),[0,r*.5-w*.62,0],[Math.PI/2,0,0])),M}default:return null}}disposeRig(){this.rig.traverse(t=>{t.isMesh&&(t.geometry.userData.shared||t.geometry.dispose(),t.userData.ownMaterial&&t.material.dispose())}),this.rig.clear(),this.shadow&&(this.shadow.material.dispose(),this.shadow.geometry.dispose(),this.root.remove(this.shadow),this.shadow=null)}blinkValue(t){let o=t-this.blinkAt;return o<0||o>=180?0:o<70?fe.in(o/70)**.5:1-fe.out((o-70)/110)}tick(t,o){let s=dh(),a=this.opts.idle!==!1;if(a&&t>=this.nextBlink){if(this.moodName!=="sleep"&&!s&&(this.blinkAt=t,Math.random()<.2&&(this.nextDouble=t+240),t-this.look.at>3e3&&Math.random()<.45)){let W=Math.abs(this.look.tx)+Math.abs(this.look.ty)>.1&&Math.random()<.6;this.look.tx=W?0:(Math.random()-.5)*.9,this.look.ty=W?0:(Math.random()-.5)*.5}this.nextBlink=t+1800+Math.random()*3600}this.nextDouble&&t>=this.nextDouble&&(this.blinkAt=t,this.nextDouble=0),this.speech&&!this.speech.tick(t)&&this.endSpeech();let r=this.mo;r.open=Re(r.open,r.target,o,r.target>r.open?35:70),r.msx=Re(r.msx,r.tmsx,o,60);let i=this.look;i.x=s?i.tx:Re(i.x,i.tx,o,70),i.y=s?i.ty:Re(i.y,i.ty,o,70);let n=mn(this.moodName);for(let W in bn)this.mv[W]=s?n[W]:Re(this.mv[W],n[W],o,90);this.sleepK=Re(this.sleepK,this.moodName==="sleep"?1:0,o,s?1:260);let c={x:0,y:0,r:0,sx:1,sy:1,lx:0,ly:0,blink:0,eye:1,lift:0,open:0,curve:0,msx:1},h=0,u=this.gest;if(u){let W=t-u.start,G=N(W/u.ms);Object.assign(c,u.def.pose(G,s?0:W,u)),u.dir<0&&(c.x=-c.x,c.r=-c.r,c.lx=-c.lx),u.name==="spin"&&(h=fe.inOut(N((G-.12)/.76))*rt,c.sx=1+(c.sy<1?(1-c.sy)*.6:0));for(let ne of u.def.fx||[])G>=ne[0]&&!u.fired.has(ne)&&(u.fired.add(ne),this.effect(ne[1],{dir:u.dir,...ne[2]||{}}));G>=1&&this.endGesture()}s&&Object.assign(c,{x:0,y:0,r:0,sx:1,sy:1});let d=1,p=1,f={};for(let[W,G]of this.morphs){if(G.phase!=="out"&&t>=G.until&&(G.phase="out",G.outAt=t,G.k0=G.k),G.phase==="in"){let ce=N((t-G.start)/yn);G.k=s?1:G.shape?fe.inOut(ce):fe.backOut(ce),ce>=1&&(G.phase="on")}else if(G.phase==="on")G.k=1;else{let ce=N((t-G.outAt)/Hs);if(G.k=s?0:G.k0*(1-fe.inOut(ce)),ce>=1){this.morphs.delete(W),this.endMorph(W);continue}}f[W]=G;let ne=hh[W];if(ne){let[ce,Me]=ne(G.k);d*=ce,p*=Me}}f.shape&&!f.shape.ready&&this.startShape(f.shape);let m=f.shape?.ready?f.shape.k:0;this.bodyU.uMorph.value.set(f.melt?.k||0,s?0:f.jelly?.k||0,m,0);let g=this.mv,b=this.W,$=this.H,v=this.kk,S=t/1e3,M=s||!a?0:Math.sin(S*rt/3.4+this.phase),z=r.open,I=c.sx*(1-.015*z)*(1-.006*M)*d,w=c.sy*(1+.03*z)*(1+.014*M)*p,k=this.rig;k.position.set(c.x*b,-c.y*$,0),k.rotation.set(i.y*.12,this.yaw+i.x*.35+h+(s||!a?0:Math.sin(S*.7+this.phase)*.04),-(c.r+i.x*2)*vt),k.scale.set(I,w,I);let H=Math.max(0,-c.y);this.shadow.scale.set(b*1.55*(1-H*.9)*d,this.shadow.scale.y,1),this.shadow.material.opacity=1-H*1.5;for(let W of this.parts)W.o.position.copy(W.p0).addScaledVector(W.d,m);let C=Math.max(this.blinkValue(t),c.blink,this.sleepK>.02?Math.min(1,this.sleepK*1.1):0),A=this.sleepK>.85,j=N(i.x+c.lx,-1,1),D=N(i.y+c.ly,-1,1),V=g.eye*c.eye;for(let W of this.eyes){W.main.visible=!A,W.closed.visible=A,W.gaze.rotation.set(D*.4,j*.5,0);let G=W.noBlink?1:Math.max(.08,1-C);W.main.scale.set(V,V*(g.squash||1)*G,V)}for(let W of this.brows)W.g.position.y+=(g.lift+c.lift)*me+(g.eye*c.eye-1)*this.L.r*me*1.65,W.g.rotation.z=-W.side*g.tilt*14*vt;let Z=this.mouthRig,pe=N(g.curve+c.curve+Z.bias,-1,1),ge=N(Math.max(r.open+c.open,g.open,Z.min)),X=r.msx*c.msx;if(Z.g.scale.x=X,Z.line&&(Z.line.morphTargetInfluences[0]=Math.max(0,pe),Z.line.morphTargetInfluences[1]=Math.max(0,-pe),Z.line.visible=ge<=.12),Z.cav){let W=ge>.12;if(Z.cav.visible=W,W){let G=Z.mw*(.75+Math.max(0,pe)*.15),ne=Z.mw*(.12+ge*.75);Z.cav.scale.set(G,ne,Z.mw*.18),Z.cav.position.y=-ne*.55+pe*Z.mw*.1}}if(Z.round&&Z.round.scale.setScalar(.85+ge*.6),Z.grit&&(Z.grit.scale.y=1+ge*1.6,Z.grit.position.y=pe*Z.mw*.08),Z.lips){let W=ge*Z.mw*.45;Z.lips.up.position.y=Z.mw*.16+W*.5+pe*Z.mw*.05,Z.lips.lo.position.y=-Z.mw*.14-W*.5,Z.lips.hole.scale.y=Math.max(.001,W*.6)}let J=this.mobj,ye=f.spikes;if(ye){let W=J.spikes||(J.spikes=this.makeSpikes(ye.o.color));W.visible=!0;let G=W.userData.list;for(let ne=0;ne<G.length;ne++){let ce=G[ne],Me=Math.max(1e-4,fe.backOut(N(ye.k*1.5-ce.ord*.07))*(ye.phase==="out"?ye.k:1));Rs.position.copy(ce.p),Rs.quaternion.copy(ce.q),Rs.scale.set(Me,Me,Me),Rs.updateMatrix(),W.setMatrixAt(ne,Rs.matrix)}W.instanceMatrix.needsUpdate=!0}else J.spikes&&(J.spikes.visible=!1);let $e=f.horns;if($e){let W=J.horns||(J.horns=this.makeHorns($e.o.color));W.visible=!0;for(let G of W.children)G.scale.setScalar(Math.max(1e-4,$e.k))}else J.horns&&(J.horns.visible=!1);let ke=f.wings;if(ke){let W=J.wings||(J.wings=this.makeWings(ke.o.color));W.visible=!0;let G=ke.o.flap==="fast",ne=s?0:Math.sin((t-ke.start)/1e3*rt*(G?3.2:.9))*(G?32:11)*vt;for(let ce of W.children){let Me=ce.userData.side;ce.rotation.set(0,Me*(.55-ne),Me*.25),ce.scale.setScalar(Math.max(1e-4,ke.k))}}else J.wings&&(J.wings.visible=!1);let Ee=f.hands;for(let W=0;W<2;W++){let G=this.hands[W];if(G.visible=!!Ee,!Ee){G.userData.on=!1;continue}let ne=W?1:-1,ce=this.L,Me=this.handCtx||(this.handCtx={cx:ce.cx,W:ce.box.w,H:ce.box.h,mid:ce.box.y+ce.box.h*.55,mouthY:ce.mouthY,mw:ce.mw,sp:ce.sp,eyeY:ce.eyeY,pts:ce.pts}),ct=(bs[Ee.o.pose]||bs.rest)(ne,s?0:t-Ee.start,Ee.o.dir||1,Me),Ze=this.X(ct.x??Me.cx+ne*ct.u*Me.W*.5),Yt=this.Y(ct.y??Me.mid+ct.v*Me.H*.5),Ae=this.frontZ(Ze,Yt),Xo=Ae==null?this.depth*.15:Ae+.06*v+this.furLen,Jo=-ne*(ct.ang||0)*vt;!G.userData.on||s?(G.position.set(Ze,Yt,Xo),G.rotation.z=Jo,G.userData.on=!0):(G.position.set(Re(G.position.x,Ze,o,70),Re(G.position.y,Yt,o,70),Re(G.position.z,Xo,o,70)),G.rotation.z=Re(G.rotation.z,Jo,o,70));let Ot=ct.type||"open",es=G.userData.finger;es.visible=Ot==="point"||Ot==="thumb"||Ot==="thumbdown",es.rotation.z=Ot==="thumbdown"?Math.PI:0,G.scale.setScalar(Math.max(.01,Ee.k*(ct.s||1))*(Ot==="open"?1:.9))}let ie=0;if(this.fxs.length){let W=this.fxc;this.fxs=this.fxs.filter(G=>{let ne=t-G.start,ce=1,Me;if(G.loop)!G.hold&&ne>=G.ms&&G.end==null&&(G.end=t),Me=s?.3:ne%G.cycle/G.cycle;else{if(ne>=G.ms)return Qo(G.obj),!1;Me=s?.5:ne/G.ms}return G.end!=null&&(ce=1-N((t-G.end)/ch),ce<=0)?(Qo(G.obj),!1):(G.def.draw(W,G,Me,s?0:ne,ce,At(G.seed)),G.blush&&(ie=Math.max(ie,G.blush)),!0)})}this.bodyU.uBlush.value=ie,this.fxg.position.copy(k.position),this.fxg.rotation.y=this.yaw;for(let W of this.furs)W.u.uTime.value=S;for(let W of this.anims)W(s?0:S)}makeSpikes(t){let o=this.L,s=[],a=new E.Vector3(0,1,0),r=new E.Vector3(0,this.H*.5,0);o.pts.forEach(([c,h],u)=>{if(u>=6&&u<=10)return;let d=new E.Vector3(this.X(c),this.Y(h),0),p=d.clone().sub(r).normalize();d.addScaledVector(p,-.02*this.kk),s.push({p:d,q:new E.Quaternion().setFromUnitVectors(a,p),ord:Math.min(u,16-u)})});for(let c of[.82,.62,.42]){let h=this.H*c,u=this.probe.section(h);s.push({p:new E.Vector3(0,h,-u.d*.9),q:new E.Quaternion().setFromUnitVectors(a,new E.Vector3(0,.4,-1).normalize()),ord:3+s.length*.1})}let i=new E.ConeGeometry(.05*this.kk,.16*this.kk,Math.max(6,Math.round(12*this.q))).translate(0,.08*this.kk,0),n=new E.InstancedMesh(i,R(this.plush?"felt":"gloss",t||Y(this.spec.body.color,-.12)),s.length);return n.instanceMatrix.setUsage(E.DynamicDrawUsage),n.frustumCulled=!1,n.userData.list=s,n.userData.noBounds=!0,this.rig.add(n),n}makeHorns(t){let o=this.L,s=ue(),a=R("gloss",t||"#f5f0e6");for(let r of[1,15]){let[i,n]=o.pts[r],c=i>o.cx?1:-1,h=ue(P(new E.ConeGeometry(.06*this.kk,.24*this.kk,16).translate(0,.12*this.kk,0),a));h.children[0].rotation.z=-c*.25;let u=this.X(i)*.8;h.position.set(u,this.probe.top(u,0).p.y-.04*this.kk,0),h.rotation.z=-c*.45,s.add(h)}return s.userData.noBounds=!0,this.rig.add(s),s}makeWings(t){let o=ue(),s=this.kk,a=this.probe.section(this.H*.6),r=R(this.plush?"felt":"plastic",t||"#ffffff");for(let i of[-1,1]){let n=ue();for(let c=0;c<3;c++){let h=P(this.sph(1,20,12),r,[i*(.16+c*.05)*s,(.1-c*.07)*s,0],[0,0,i*(.5-c*.35)],[(.2-c*.03)*s,.07*s,.025*s]);n.add(h)}n.position.set(i*a.w*.45,this.H*.62,-a.d*.7),n.userData.side=i,o.add(n)}return o.userData.noBounds=!0,this.rig.add(o),o}startShape(t){t.ready=!0;let o=t.target,s=xt(this.spec,o),a=mr(o,s.box,this.quality),r=a.geometry.attributes;if(r.position.count!==this.B.geometry.attributes.position.count)return;let i=this.shapeGeo;if(!i){i=this.shapeGeo=this.B.geometry.clone(),i.userData={};for(let u of this.bodyMeshes)u.geometry=i}i.setAttribute("aShape",r.position.clone()),i.setAttribute("aShapeN",r.normal.clone());let n=s.box.w*me/this.W,c=s.box.h*me/this.H,h=gr(a.geometry);for(let u of this.parts){let{x:d,y:p}=u.p0,f=d*n,m=p*c;u.d.set(f-d,m-p,u.face?h.front(f,m).p.z-this.probe.front(d,p).p.z:0)}}endMorph(t){if(t==="shape"){for(let o of this.bodyMeshes)o.geometry=this.B.geometry;this.shapeGeo?.dispose(),this.shapeGeo=null;for(let o of this.parts)o.d.set(0,0,0),o.o.position.copy(o.p0)}t==="hands"&&(this.handCtx=null)}clearMorphObjects(){this.shapeGeo&&(this.shapeGeo.dispose(),this.shapeGeo=null),this.mobj={},this.handCtx=null;for(let t of this.morphs.values())t.ready=!1}lod(t){this.plush&&this.setShells(N(t/(this.quality==="high"?14:20),3,this.maxShells))}mood(t,o={}){if(!pa[t])return!1;if(t===this.moodName)return!0;if(this.moodName=t,this.clearEffects("mood"),this.opts.moodFx!==!1&&o.fx!==!1)for(let[s,a]of nh[t]||[])this.effect(s,a||{});return!0}endGesture(){let t=this.gest;if(!t)return;this.gest=null;let o=this.morphs.get("hands");t.def.hands&&o&&!o.byGesture&&o.userPose!==void 0&&(o.o.pose=o.userPose);let s=this.morphs.get("wings");t.def.wings&&s&&!s.byGesture&&(s.o.flap=s.userFlap)}gesture(t,o={}){let s=Object.hasOwn(ao,t)?t:xo[t];if(!s)return!1;typeof o=="number"&&(o={ms:o});let a=ao[s],r=Lt(),i=N(Number(o.ms)||a.ms,200,6e4),n=o.dir===-1||o.mirror===!0?-1:1;this.gest&&this.endGesture(),this.gest={name:s,def:a,start:r,ms:i,dir:n,fired:new Set};let c=this.morphs.get("hands");a.hands?c&&c.phase!=="out"?(c.o.pose=a.hands,c.o.dir=n,c.byGesture&&(c.until=r+i-Hs)):this.morph("hands",{pose:a.hands,dir:n,ms:i-Hs,byGesture:!0}):c?.byGesture&&c.phase!=="out"&&(c.until=r);let h=this.morphs.get("wings");return a.wings?h&&h.phase!=="out"?(h.o.flap=a.wings,h.byGesture&&(h.until=r+i-Hs)):this.morph("wings",{flap:a.wings,ms:i-Hs,byGesture:!0}):h?.byGesture&&h.phase!=="out"&&(h.until=r),!0}morph(t,o={}){if(typeof t!="string")return!1;if(o===!1)return this.unmorph(t);if(typeof o=="number"&&(o={ms:o}),!Object.hasOwn(bt,t)&&Object.hasOwn(fa,t))return this.effect(t,o);let s=t,a=null;if(t.startsWith("shape:")){if(a=aa(t.slice(6)),!a)return!1;s="shape"}else if(!Object.hasOwn(bt,t))return!1;let r=Lt(),n=o.hold===!0||o.ms===1/0?1/0:N(Number(o.ms)||lh,200,6e5),c=!o.byGesture,h=/^#[0-9a-f]{6}$/i.test(o.color||"")?o.color:void 0,u=this.morphs.get(s);if(u)u.phase==="out"&&(u.phase="in",u.start=r-yn*N(u.k)),u.until=Math.max(c?0:u.until,r+n),c&&(u.byGesture=!1),s==="shape"&&u.target!==a&&(u.target=a,u.ready=!1),o.pose&&(u.o.pose=o.pose),o.dir&&(u.o.dir=o.dir),o.flap&&(u.o.flap=o.flap),c&&(u.userPose=u.o.pose,u.userFlap=u.o.flap);else{let d={pose:t==="hands"?o.pose||"rest":void 0,dir:o.dir===-1?-1:1,flap:o.flap,color:h};this.morphs.set(s,{name:s,start:r,until:r+n,phase:"in",k:0,o:d,target:a,shape:s==="shape",ready:!1,byGesture:!c,userPose:c?d.pose:void 0,userFlap:c?d.flap:void 0})}return!0}unmorph(t){let o=Lt(),s=typeof t=="string"&&t.startsWith("shape")?"shape":t;for(let[a,r]of this.morphs)s&&a!==s||r.phase!=="out"&&(r.phase="out",r.outAt=o,r.k0=r.k);return!0}effect(t,o={}){if(typeof t!="string")return!1;if(typeof o=="number"&&(o={ms:o}),Object.hasOwn(bt,t)||t.startsWith("shape:"))return this.morph(t,o);if(!Object.hasOwn(fa,t))return!1;let s=fa[t],a={name:t,def:s,start:Lt(),ms:N(Number(o.ms)||(s.loop?s.ms*1.5:s.ms),100,6e5),cycle:s.ms,loop:!!s.loop||o.hold===!0,hold:o.hold===!0,dir:o.dir===-1?-1:1,o,tag:o.tag,seed:++this.fxSeq*7919^Math.floor(this.phase*1e4),end:null,obj:null},r=s.make(this.fxc,a);return r&&(a.obj=r,(s.rig?this.rig:this.fxg).add(r),s.draw(this.fxc,a,0,0,1,At(a.seed))),this.fxs.push(a),this.fxs.length>24&&Qo(this.fxs.shift().obj),!0}clearEffects(t){let o=Lt();for(let s of this.fxs)(!t||s.name===t||s.tag===t)&&(s.end??=o)}blink(){this.blinkAt=Lt()}lookAt(t,o){this.look.tx=N(Number(t)||0,-1,1),this.look.ty=N(Number(o)||0,-1,1),this.look.at=Lt()}lookAtPoint(t,o){let s=this.view?.screenOf(this);s&&this.lookAt((t-s.x)/(window.innerWidth/2),(o-s.y)/(window.innerHeight/2))}mouth(t){this.mo.target=N(Number(t)||0)}viseme(t,o){let s=Be[t]||Be.X;return this.mo.target=N(o??s.open),this.mo.tmsx=s.w,!!Be[t]}endSpeech(){let t=this.speech;this.speech=null,this.mo.target=0,this.mo.tmsx=1,t?.resolve?.()}speak(t,o={}){this.speech&&this.endSpeech();let s,a;if(typeof t=="number")a=N(t,0,6e5),s=ra(a,Math.floor(Math.random()*1e6));else{let p=String(t??"");s=ko(p),a=Number(o.durationMs)||Math.max(300,p.length/14/(Number(o.rate)||1)*1e3)}let r,i=new Promise(p=>{r=p});if(!s.length||!a)return r(),Object.assign(i,{stop(){}});let n=0;for(let p of s)p.t0=n,n+=p.w;let c=Lt(),h=0,u=Number(o.gain)||1,d={resolve:r,tick:p=>{if(p-c>=a)return!1;let f=N((p-c)/a)*n;for(;h<s.length-1&&s[h+1].t0<=f;)h++;let m=s[h],g=Be[m.v]||Be.X,b=N((f-m.t0)/(m.w||1));return this.mo.target=N(g.open*(.82+.18*Math.sin(Math.PI*b))*u),this.mo.tmsx=g.w,!0}};return this.speech=d,Object.assign(i,{stop:()=>{this.speech===d&&this.endSpeech()}})}stopSpeaking(){this.speech&&this.endSpeech()}lipsync(t,o={}){if(this.stopSpeaking(),!t||typeof t.getByteTimeDomainData!="function")return()=>{};let s=t.fftSize||512,a=new Uint8Array(s),r=Number(o.gain)||1,i=o.text?ko(String(o.text)):[],n=0;for(let f of i)f.t0=n,n+=f.w;let c=Number(o.durationMs)||Math.max(300,String(o.text||"").length/14*1e3),h=Lt(),u=0,d=.05,p={tick:f=>{if(t.context?.state==="closed")return!1;t.getByteTimeDomainData(a);let m=0;for(let $=0;$<s;$++){let v=(a[$]-128)/128;m+=v*v}m=Math.sqrt(m/s),d=Math.max(m,d*.995,.02);let g=N(N((m-.006)/(d*.7))**.8*r),b=1;if(i.length&&f-h<c){let $=N((f-h)/c)*n;for(;u<i.length-1&&i[u+1].t0<=$;)u++;b=(Be[i[u].v]||Be.X).w}return this.mo.target=g,this.mo.tmsx=we(1,b,N(g*2)),!0}};return this.speech=p,()=>{this.speech===p&&this.endSpeech()}}update(t){this.build(t)}get state(){return{mood:this.moodName,gesture:this.gest?.name||null,speaking:!!this.speech,shells:this.shells,morphs:[...this.morphs.keys()].filter(t=>this.morphs.get(t).phase!=="out"),effects:this.fxs.map(t=>t.name)}}dispose(){for(let t of this.fxs)Qo(t.obj);this.fxs=[],this.disposeRig(),this.root.removeFromParent()}}});var Sn={};il(Sn,{Character3D:()=>Zo,EFFECTS_3D:()=>vn,GESTURES_3D:()=>wn,MOODS_3D:()=>$n,MORPHS_3D:()=>xn,createCharacter3D:()=>ph,createCrowd3D:()=>mh,getStage:()=>ha,webglAvailable:()=>vr});function vr(){if(Ps!==null)return Ps;try{Ps=!!document.createElement("canvas").getContext("webgl2")}catch{Ps=!1}return Ps}function fh(e,t){let o=Pt(e,t);return o.fallback=!0,o}function Mn(e,t){let o=e.rect||e.el.getBoundingClientRect();return t.root.updateMatrixWorld(),ma.set(0,t.H*.6,0).applyMatrix4(t.root.matrixWorld).project(e.camera),{x:o.left+(ma.x+1)/2*o.width,y:o.top+(1-ma.y)/2*o.height}}function _n(e,t){let o=e.rect;if(!o)return 300;let s=e.camera,a=Math.max(.1,s.position.distanceTo(t.root.getWorldPosition(ma)));return t.H*t.root.scale.y/a*(o.height/2/Math.tan(s.fov*Math.PI/360))}function En(e,t,o={}){return{character:t,gesture:(s,a)=>t.gesture(s,a),mood:(s,a)=>t.mood(s,a),lookAt:(s,a)=>t.lookAt(s,a),lookAtPoint:(s,a)=>t.lookAtPoint(s,a),speak:(s,a)=>t.speak(s,a),lipsync:(s,a)=>t.lipsync(s,a),stopSpeaking:()=>t.stopSpeaking(),morph:(s,a)=>t.morph(s,a),unmorph:s=>t.unmorph(s),effect:(s,a)=>t.effect(s,a),clearEffects:s=>t.clearEffects(s),mouth:s=>t.mouth(s),viseme:(s,a)=>t.viseme(s,a),blink:()=>t.blink(),get spec(){return t.spec},get state(){return t.state},...o}}function ph(e,t,o={}){if(!vr())return fh(e,t);let s=ha(o.stage),a=s.makeScene(),r=new kt.PerspectiveCamera(o.fov||28,1,.05,50),i=new Zo(t,{quality:o.quality||"high",material:o.material||"plush",moodFx:o.moodFx});a.add(i.root);let n=0,c=()=>{let $=i.bounds,v=$.getSize(new kt.Vector3),S=$.getCenter(new kt.Vector3),M=r.fov*Math.PI/360,z=v.y*.5*1.12/Math.tan(M),I=Math.max(v.x,v.z)*.5*1.2/(Math.tan(M)*r.aspect),w=Math.max(z,I)+v.z*.5;r.position.set(S.x,S.y+w*.12,S.z+w),r.lookAt(S.x,S.y*.96,0),r.updateProjectionMatrix()},h={el:e,scene:a,camera:r,characters:[i],rect:null,tick($,v){let S=this.rect.width/this.rect.height;Math.abs(S-n)>.001&&(n=S,r.aspect=S,c()),p||(i.yaw*=Math.exp(-v/900)),i.tick($,v),i.lod(_n(this,i))},screenOf:$=>Mn(h,$)};i.view=h,s.addView(h);let u=e.style.background,d=()=>{if(o.backdrop===!1)return;let $=i.spec.style,v=$&&$!=="none"?la($,Bo(i.spec)):"";e.style.background=v?`${v} center bottom / cover no-repeat`:u};d();let p=!1,f=0,m=$=>{p=!0,f=$.clientX,e.setPointerCapture?.($.pointerId)},g=$=>{p&&(i.yaw+=($.clientX-f)*.012,f=$.clientX)},b=()=>{p=!1};return o.orbit!==!1&&(e.addEventListener("pointerdown",m),e.addEventListener("pointermove",g),e.addEventListener("pointerup",b),e.addEventListener("pointercancel",b),e.style.touchAction=e.style.touchAction||"pan-y",e.style.cursor=e.style.cursor||"grab"),En(h,i,{stage:s,update($,v={}){v.material&&(i.opts.material=v.material),i.update($),d(),n=0},destroy(){s.removeView(h),e.style.background=u,e.removeEventListener("pointerdown",m),e.removeEventListener("pointermove",g),e.removeEventListener("pointerup",b),e.removeEventListener("pointercancel",b),i.dispose()}})}function mh(e,t={}){if(!vr()){e.style.display="flex",e.style.flexWrap="wrap",e.style.alignContent="center",e.style.justifyContent="center";let u=[];return{fallback:!0,characters:u,add(d){let p=document.createElement("div");p.style.cssText="width:84px;height:84px",e.append(p);let f=Pt(p,d);return u.push(f),f},clear(){u.forEach(d=>d.destroy()),u.length=0,e.textContent=""},lookAtPoint(d,p){for(let f of u)f.lookAtPoint(d,p)},gesture(d,p){u.forEach((f,m)=>setTimeout(()=>f.gesture(d,p),m*25))},mood(d){for(let p of u)p.mood(d)},effect(d,p){u.forEach((f,m)=>setTimeout(()=>f.effect(d,p),m*25))},morph(d,p){u.forEach((f,m)=>setTimeout(()=>f.morph(d,p),m*25))},unmorph(d){for(let p of u)p.unmorph(d)},refit(){},destroy(){this.clear()}}}let o=ha(t.stage),s=o.makeScene(),a=new kt.PerspectiveCamera(t.fov||32,1,.1,100),r=[],i=0,n=new kt.Vector3,c=()=>{let u=new kt.Box3;for(let m of r)m.root.updateMatrixWorld(),u.union(m.bounds.clone().applyMatrix4(m.root.matrixWorld));if(u.isEmpty())return;let d=u.getSize(new kt.Vector3);u.getCenter(n);let p=a.fov*Math.PI/360,f=Math.max(d.y*.6/Math.tan(p),d.x*.58/(Math.tan(p)*a.aspect))+d.z*.2;a.position.set(n.x,n.y+f*.42,n.z+f*.92),a.lookAt(n.x,n.y*.5,n.z+d.z*.08),a.updateProjectionMatrix()},h={el:e,scene:s,camera:a,characters:r,rect:null,tick(u,d){let p=this.rect.width/this.rect.height;Math.abs(p-i)>.001&&(i=p,a.aspect=p,c());for(let f of r)f.tick(u,d),f.lod(_n(this,f))},screenOf:u=>Mn(h,u)};return o.addView(h),{stage:o,camera:a,characters:r,add(u,d={}){let p=new Zo(u,{quality:t.quality||"low",material:t.material||"plush",moodFx:t.moodFx});return p.view=h,p.root.position.set(d.x||0,0,d.z||0),p.root.rotation.y=d.rotY||0,d.scale&&p.root.scale.setScalar(d.scale),s.add(p.root),r.push(p),i=0,En(h,p)},clear(){for(let u of r)u.dispose();r.length=0},lookAtPoint(u,d){for(let p of r)p.lookAtPoint(u,d)},gesture(u,d){r.forEach((p,f)=>setTimeout(()=>p.gesture(u,d),f*25))},mood(u){for(let d of r)d.mood(u)},effect(u,d){r.forEach((p,f)=>setTimeout(()=>p.effect(u,d),f*25))},morph(u,d){r.forEach((p,f)=>setTimeout(()=>p.morph(u,d),f*25))},unmorph(u){for(let d of r)d.unmorph(u)},refit(){i=0},destroy(){o.removeView(h),this.clear()}}}var kt,Ps,ma,Tn=Ke(()=>{kt=jt(_o(),1);en();kn();Qt();Vo();Ps=null;ma=new kt.Vector3});var ho=class{constructor(){this._handlers=new Map}on(t,o){return this._handlers.has(t)||this._handlers.set(t,new Set),this._handlers.get(t).add(o),()=>this.off(t,o)}once(t,o){let s=this.on(t,a=>{s(),o(a)});return s}off(t,o){this._handlers.get(t)?.delete(o)}emit(t,o={}){for(let s of[t,"*"])for(let a of this._handlers.get(s)||[])try{s==="*"?a(t,o):a(o)}catch(r){console.error(`[7ots] listener de "${t}" fall\xF3:`,r)}}clear(){this._handlers.clear()}};function Po(e){let t=o=>`7ots:${e}:${o}`;return{get(o,s=null){try{let a=sessionStorage.getItem(t(o));return a==null?s:JSON.parse(a)}catch{return s}},set(o,s){try{sessionStorage.setItem(t(o),JSON.stringify(s))}catch{}},remove(o){try{sessionStorage.removeItem(t(o))}catch{}}}}_e();_e();gt({es:{widget:{defaultName:"Asistente",launcher:{open:"Abrir asistente {name}"},panel:{label:"Asistente {name}"},teaser:{dismiss:"Descartar"},status:{online:"En l\xEDnea",thinking:"Pensando\u2026",withTeam:"Con el equipo"},typing:"El asistente est\xE1 pensando",voice:{on:"Voz activada",off:"Voz silenciada",mute:"Silenciar voz",micDenied:"Permiso de micr\xF3fono denegado"},menu:{contact:"Contactar con el equipo",more:"M\xE1s opciones",minimize:"Minimizar",initiativeLabel:"Iniciativa del asistente",initiative:"Iniciativa",level:{quiet:"Discreta",normal:"Normal",bold:"Atrevida"},muteSuggestions:"Silenciar sugerencias",unmuteSuggestions:"Activar sugerencias",reset:"Nueva conversaci\xF3n"},composer:{placeholder:"Escribe o pulsa el micr\xF3fono\u2026",placeholderTeam:"Escribe al equipo\u2026",label:"Mensaje",mic:"Hablar",send:"Enviar"},footer:{ai:"Asistente con IA \xB7 puede equivocarse"},pageTools:{done:"Hecho: {title}"},handoff:{team:"Equipo de soporte",author:"Equipo",video:"Videollamada",back:"Volver al asistente",userLeft:"El usuario volvi\xF3 al asistente",ended:"La conversaci\xF3n con el equipo termin\xF3.",closed:"El canal de soporte se cerr\xF3.",sendFailed:"No se pudo enviar el mensaje al equipo."},brain:{stuck:"Me he quedado a medias; \xBFquieres que lo intente de otra forma?",error:"Uy, tuve un problema para responder. \xBFLo intentamos de nuevo?"},pointer:{stopped:"Detenido. No har\xE9 nada m\xE1s hasta que me lo pidas.",hint:"Esc para detener",halted:"Detenido",typing:"escribiendo\u2026"},companion:{talkTo:"Hablar con {name}",pointAt:"Se\xF1alar",tour:"Recorrido",goHome:"Volver al rinc\xF3n"},dialog:{close:"Cerrar",confirm:"Confirmar",ok:"Aceptar",cancel:"Cancelar",info:"Informaci\xF3n",gotIt:"Entendido"},confirm:{title:"Confirmar acci\xF3n",yes:"S\xED, continuar",runAction:'\xBFAutorizas al asistente a ejecutar "{action}"?',mcp:'El asistente quiere ejecutar "{action}" en tu cuenta. \xBFContinuar?',click:'El asistente quiere pulsar "{label}". \xBFContinuar?',typeSubmit:"\xBFEscribo el texto y env\xEDo el formulario?",enterSubmit:'El asistente quiere pulsar Enter en "{label}", lo que env\xEDa el formulario. \xBFContinuar?',fillSubmit:"\xBFEnv\xEDo el formulario con los datos que rellen\xE9?",pageTool:'El asistente quiere usar "{title}". \xBFContinuar?',pageToolWith:'El asistente quiere usar "{title}" con {detail}. \xBFContinuar?'},contact:{human:"Hablar con una persona",mail:"Dejar un mensaje por correo",askHuman:"Quiero hablar con una persona del equipo.",askMail:"Quiero dejar un mensaje por correo al equipo.",mailPreview:`Se enviar\xE1 este mensaje al equipo de soporte:
247
+ }`;an=new Map;Ts=null});function ua(e){let t=hn[e];return t||(t=hn[e]=Xc[e](),t.userData.shared=!0),t}function qe(e,t,o){let s=new se.InstancedMesh(ua(e),t,o);return s.frustumCulled=!1,s.instanceMatrix.setUsage(se.DynamicDrawUsage),s.userData.instFx=!0,s}function Le(e,t,o,s,a,r,i=0,n=0,c=0,h=r){Wo.position.set(o,s,a),Wo.rotation.set(n,c,i),Wo.scale.set(r,h,r),r<=1e-4&&Wo.scale.setScalar(1e-5),Wo.updateMatrix(),e.setMatrixAt(t,Wo.matrix)}function Qo(e){e?.traverse?.(t=>{t.isInstancedMesh&&t.dispose()}),e?.removeFromParent()}var se,un,Cs,Eo,Uo,Zt,hn,wr,Kc,As,Xc,dn,Jc,Wo,Ge,fa,fn=Ke(()=>{se=jt(_o(),1),un=jt(pr(),1);ws();$r();Cs=Math.PI*2,Eo=Math.PI/180,Uo=(e,t=.2)=>fe.backOut(N(e/t)),Zt=(e,t=.25)=>N((1-e)/t),hn={},wr=(e,t=.25)=>new se.ExtrudeGeometry(e,{depth:t,bevelEnabled:!0,bevelThickness:.08,bevelSize:.07,bevelSegments:2,curveSegments:8}).center(),Kc=e=>{for(let t of Object.keys(e.attributes))t!=="position"&&t!=="normal"&&e.deleteAttribute(t);return e},As=(...e)=>(0,un.mergeGeometries)(e.map(t=>Kc(t.index?t.toNonIndexed():t))),Xc={star:()=>{let e=new se.Shape;e.moveTo(0,1);for(let[t,o,s,a]of[[0,0,1,0],[0,0,0,-1],[0,0,-1,0],[0,0,0,1]])e.quadraticCurveTo(t,o,s,a);return wr(e,.3)},heart:()=>{let e=new se.Shape;return e.moveTo(0,-.9),e.bezierCurveTo(-1.4,.1,-.7,1.05,0,.35),e.bezierCurveTo(.7,1.05,1.4,.1,0,-.9),wr(e,.35)},drop:()=>{let e=[];for(let t=0;t<=12;t++){let o=t/12*Math.PI,s=Math.sin(o)*(o>Math.PI/2?1:.35+.65*Math.sin(o));e.push(new se.Vector2(Math.max(.001,s*.8),Math.cos(o)*1.2))}return new se.LatheGeometry(e,14)},z:()=>{let e=new se.Shape;return e.moveTo(-1,1),e.lineTo(1,1),e.lineTo(1,.62),e.lineTo(-.35,-.62),e.lineTo(1,-.62),e.lineTo(1,-1),e.lineTo(-1,-1),e.lineTo(-1,-.62),e.lineTo(.35,.62),e.lineTo(-1,.62),e.lineTo(-1,1),wr(e,.4)},note:()=>As(new se.SphereGeometry(.42,12,8).scale(1.25,.95,.7).rotateZ(.35).translate(-.3,-.75,0),new se.CylinderGeometry(.08,.08,1.5,6).translate(.18,0,0),new se.BoxGeometry(.5,.18,.12).rotateZ(-.5).translate(.38,.6,0)),bang:()=>As(new se.CylinderGeometry(.2,.12,1.15,12).translate(0,.62,0),new se.SphereGeometry(.17,12,8).translate(0,-.12,0)),ask:()=>{let e=new se.CatmullRomCurve3([[-.35,.75],[-.25,1.05],[.15,1.12],[.42,.9],[.35,.6],[.05,.45],[0,.18]].map(([t,o])=>new se.Vector3(t,o,0)));return As(new se.TubeGeometry(e,24,.11,8),new se.SphereGeometry(.15,12,8).translate(0,-.12,0))},anger:()=>{let e=[];for(let[t,o]of[[1,-1],[1,1],[-1,1],[-1,-1]]){let s=new se.QuadraticBezierCurve3(new se.Vector3(.25*t,.9*o,0),new se.Vector3(.25*t,.25*o,0),new se.Vector3(.9*t,.25*o,0));e.push(new se.TubeGeometry(s,10,.13,6))}return As(...e)},cloud:()=>As(...[[0,0,.55],[-.5,-.05,.4],[.5,-.02,.42],[-.22,.28,.4],[.25,.3,.38],[0,-.2,.42]].map(([e,t,o])=>new se.SphereGeometry(o,14,10).scale(1,1,.6).translate(e,t,0))),ball:()=>new se.SphereGeometry(1,14,10),ballHi:()=>new se.SphereGeometry(1,24,16),chip:()=>new se.BoxGeometry(1,.5,.12)};dn=null,Jc=()=>dn||(dn=new se.MeshPhysicalMaterial({color:"#bfe9ff",roughness:.02,clearcoat:1,transparent:!0,opacity:.4,depthWrite:!1,envMapIntensity:2,iridescence:1})),Wo=new se.Object3D;Ge=(...e)=>{for(let t of e)t.instanceMatrix.needsUpdate=!0},fa={sparkles:{ms:1300,make:(e,t)=>t.m=qe("star",R("gloss","#ffd84d"),6),draw:(e,t,o,s,a,r)=>{for(let i=0;i<6;i++){let n=r()*Cs,c=.55+r()*.25,h=(r()-.3)*e.D,u=N((o-i*.08)/.5),d=e.W*.07*(.6+r()*.6)*Math.sin(Math.PI*u)*a;Le(t.m,i,Math.cos(n)*e.W*c,e.H*.55-Math.sin(n)*e.H*c*.85,h,d,-s*.08*Eo)}Ge(t.m)}},sweat:{ms:1800,make:(e,t)=>t.m=qe("drop",R("gloss","#8fd3ff"),1),draw:(e,t,o,s,a)=>{Le(t.m,0,t.dir*e.W*.4,e.H*(.8-.08*fe.inOut(o)),e.D*.45,e.W*.05*Uo(o,.15)*Math.min(a,Zt(o)),-t.dir*12*Eo),Ge(t.m)}},blush:{ms:2e3,make:()=>null,draw:(e,t,o,s,a)=>{t.blush=Math.min(N(o/.15),Zt(o))*a}},hearts:{ms:1900,make:(e,t)=>t.m=qe("heart",R("gloss","#ff4d7a"),3),draw:(e,t,o,s,a,r)=>{for(let i=0;i<3;i++){let n=N((o-i*.15)/.7),c=n<=0?0:e.W*(.07+r()*.03)*Uo(n)*Zt(n,.3)*a;Le(t.m,i,(i-1)*e.W*.28+Math.sin(n*Cs+i)*e.W*.05,e.H*.88+e.H*.5*fe.out(n),e.D*.3,c,Math.sin(n*9+i)*.25)}Ge(t.m)}},zzz:{ms:2600,loop:!0,make:(e,t)=>t.m=qe("z",R("gloss","#5b6ee1"),3),draw:(e,t,o,s,a)=>{for(let r=0;r<3;r++){let i=(o+r/3)%1;Le(t.m,r,t.dir*(e.W*.32+e.W*.25*i),e.H*.88+e.H*.45*i,e.D*.2,e.W*(.033+.05*i)*Math.sin(Math.PI*i)*a,t.dir*-.2)}Ge(t.m)}},exclaim:{ms:1100,make:(e,t)=>t.m=qe("bang",R("gloss","#ff3b30"),1),draw:(e,t,o,s,a)=>{Le(t.m,0,t.dir*e.W*.36,e.H*1.04,e.D*.2,e.W*.24*Uo(o,.18)*Math.min(a,Zt(o,.2)),Math.sin(s/60)*6*Zt(o,.6)*Eo),Ge(t.m)}},question:{ms:1500,make:(e,t)=>t.m=qe("ask",R("gloss","#4f7cff"),1),draw:(e,t,o,s,a)=>{Le(t.m,0,t.dir*e.W*.4,e.H*1.02+Math.sin(s/200)*e.H*.015,e.D*.2,e.W*.24*Uo(o)*Math.min(a,Zt(o,.2)),-t.dir*12*Eo),Ge(t.m)}},anger:{ms:1300,make:(e,t)=>t.m=qe("anger",R("gloss","#ff2d2d"),1),draw:(e,t,o,s,a)=>{Le(t.m,0,t.dir*e.W*.33,e.H*.86,e.D*.55,e.W*.075*Uo(o,.15)*(1+.12*Math.sin(s/70))*Math.min(a,Zt(o)),0,0,t.dir*.5),Ge(t.m)}},steam:{ms:1500,make:(e,t)=>t.m=qe("ball",R("felt","#eef0f3"),6),draw:(e,t,o,s,a)=>{let r=0;for(let i of[-1,1])for(let n=0;n<3;n++){let c=N((o-n*.15)/.65),h=c<=0||c>=1?0:e.W*(.04+.07*c)*Math.min(1,(1-c)*3)*a;Le(t.m,r++,i*(e.W*.28+e.W*.18*c),e.H*.88+e.H*.38*c,0,h)}Ge(t.m)}},confetti:{ms:1900,make:(e,t)=>{let o=e.low?12:22,s=t.m=qe("chip",R("plastic","#ffffff"),o),a=["#ff4d7a","#ffd84d","#4dd2ff","#7cff6b","#b18cff","#ff9f43"],r=new se.Color;for(let i=0;i<o;i++)s.setColorAt(i,r.set(a[i%a.length]));return s},draw:(e,t,o,s,a,r)=>{let i=o*1.9,n=t.m.count,c=e.W*.035*Math.min(a,Zt(o,.3));for(let h=0;h<n;h++){let u=-Math.PI/2+(r()-.5)*2.2,d=e.H*(.9+r()*.8),p=(r()-.4)*d*.6,f=.3+r()*.5,m=Math.max(.005,e.H*.95-Math.sin(u)*d*i-e.H*1.1*i*i);Le(t.m,h,Math.cos(u)*d*i*.7,m,p*i,c,s*f*Eo+h,s*f*.7*Eo,h*.7)}Ge(t.m)}},tears:{ms:2200,rig:!0,make:(e,t)=>t.m=qe("drop",R("gloss","#8fd3ff"),4),draw:(e,t,o,s,a)=>{let r=0;for(let i of e.tears)for(let n=0;n<2;n++){let c=(o*2+n*.5)%1*(o<.9?1:0),h=c*c*(i.length-1),u=Math.min(i.length-2,Math.floor(h)),d=h-u,p=i[u],f=i[u+1];Le(t.m,r++,p[0]+(f[0]-p[0])*d,p[1]+(f[1]-p[1])*d,p[2]+(f[2]-p[2])*d,c<=0?0:e.r*.28*(1-c)*a*1.4)}Ge(t.m)}},thought:{ms:2200,make:(e,t)=>{t.m=qe("ball",R("felt","#ffffff"),2),t.c=qe("cloud",R("felt","#ffffff"),1),t.d=qe("ball",R("felt","#64748b"),3);let o=new se.Group;return o.add(t.m,t.c,t.d),o},draw:(e,t,o,s,a)=>{let r=Math.min(a,Zt(o,.15)),i=d=>Uo(N((o-d)/.4),.5),n=t.dir*e.W*.55,c=e.H*1.22,h=e.D*.15;Le(t.m,0,t.dir*e.W*.3,e.H*.98,h,e.W*.025*i(0)*r),Le(t.m,1,t.dir*e.W*.4,e.H*1.08,h,e.W*.042*i(.08)*r);let u=e.W*.36*i(.16)*r;Le(t.c,0,n,c,h,u);for(let d=0;d<3;d++)Le(t.d,d,n+(d-1)*u*.32,c,h+u*.36,u*.07*(.6+.6*Math.max(0,Math.sin(s/180-d*.9))));Ge(t.m,t.c,t.d)}},notes:{ms:2200,make:(e,t)=>t.m=qe("note",R("gloss","#8b5cf6"),3),draw:(e,t,o,s,a)=>{for(let r=0;r<3;r++){let i=N((o-r*.18)/.65),n=r%2?-1:1;Le(t.m,r,n*e.W*(.42+.1*i)+Math.sin(i*Cs)*e.W*.03,e.H*.75+e.H*.5*i,e.D*.25,i<=0||i>=1?0:e.W*.11*Math.sin(Math.PI*i)*a,-n*10*Eo)}Ge(t.m)}},sneeze:{ms:700,make:(e,t)=>t.m=qe("ball",R("gloss","#9fd8ff"),e.low?6:10),draw:(e,t,o,s,a,r)=>{let i=fe.out(o),n=e.mouth;for(let c=0;c<t.m.count;c++){let h=(r()-.5)*1.1,u=(r()-.5)*.8,d=e.W*(.15+r()*.45)*i;Le(t.m,c,n.x+t.dir*e.W*.05+Math.sin(h)*d,n.y+Math.sin(u)*d*.5-e.H*.15*i*i,n.z+Math.cos(h)*d,e.W*(.012+r()*.015)*(1-o)*a)}Ge(t.m)}},bubble:{ms:1e3,make:(e,t)=>t.m=qe("ballHi",Jc(),1),draw:(e,t,o,s,a)=>{let r=fe.out(N(o/.85)),i=N((o-.85)/.15),n=e.W*(.03+.05*r)*(1+i*.4)*(1-i)*a;Le(t.m,0,e.mouth.x+t.dir*e.W*.06+Math.sin(o*9)*e.W*.02,e.mouth.y+e.H*.3*r,e.mouth.z+e.W*.08,n),Ge(t.m)}},dizzy:{ms:1600,loop:!0,make:(e,t)=>t.m=qe("star",R("gloss","#ffd84d"),3),draw:(e,t,o,s,a)=>{for(let r=0;r<3;r++){let i=o*Cs+r*Cs/3;Le(t.m,r,Math.cos(i)*e.W*.42,e.H*1+Math.sin(i)*e.H*.04,Math.sin(i)*e.D*1.1,e.W*.045*a,s*.004,0,i)}Ge(t.m)}}}});function th(e){let t=Go(e);if(!t._style)return t;let o=t.finish;return t.finish=eh[t._style.id]||(o==="clay"||o==="sketch"?o:t._style.lw>0?"toon":o==="flat"?"soft3d":o),t}function P(e,t,o,s,a){let r=new E.Mesh(e,t);return o&&r.position.set(...o),s&&r.rotation.set(...s),a&&(typeof a=="number"?r.scale.setScalar(a):r.scale.set(...a)),r}var E,eh,vt,rt,pn,Rs,pa,bn,mn,$n,wn,oh,sh,ah,gn,rh,xr,ih,nh,lh,yn,Hs,ch,xn,vn,hh,Lt,dh,uh,ue,Zo,kn=Ke(()=>{E=jt(_o(),1);Qt();Vo();wo();ys();ws();sn();$r();fn();eh={ukiyoe:"toon",glass:"glossy",bauhaus:"toon",manuscript:"toon",glitch:"neon",clay:"clay",ink:"sketch",pop:"toon",watercolor:"soft3d",pixel:"toon",synthwave:"neon",nouveau:"toon",cubism:"toon",crayon:"sketch",blueprint:"neon",pointillism:"soft3d",woodcut:"sketch"};vt=Math.PI/180,rt=Math.PI*2,pn=new E.Vector3(0,0,1),Rs=new E.Object3D,pa={neutral:{curve:.15,tilt:0},happy:{curve:.85,tilt:-.25,squash:.85},angry:{curve:-.45,tilt:1},sad:{curve:-.85,tilt:-1},fear:{curve:-.35,tilt:-.8,eye:1.15,open:.15},disgust:{curve:-.55,tilt:.6,squash:.8},love:{curve:.75,tilt:-.3},sleep:{curve:0,tilt:0,closed:!0},surprised:{curve:0,tilt:-.4,eye:1.2,open:.45,lift:4}},bn={curve:0,tilt:0,squash:1,eye:1,open:0,lift:0},mn=e=>({...bn,...pa[e]||pa.neutral}),$n=Object.keys(pa),wn=Object.keys(ao),oh=new Set(["dot","kawaii","bean","sparkle","teary","button","pixel","villain"]),sh=new Set(["kawaii","sparkle","teary"]),ah={sleepy:[.5,0],tired:[.42,0],angry:[.42,1],sad:[.42,-1],focused:[.33,0]},gn={grin:.35,laugh:.6,open:.35,vampire:.25,buck:.12,braces:.35,monster:.45,gap:.35,toothless:.45,drool:.2,mustachio:.1},rh=new Set(["grin","braces","monster","gap","mustachio","vampire","buck"]),xr=new Set(["oh","kiss","whistle"]),ih={frown:-.7,flat:-.15,smile:.25,smirk:.2,pout:-.5,cat:.3},nh={angry:[["spikes",{ms:900}],["anger"],["steam"]],surprised:[["exclaim"]],love:[["hearts"],["blush"]],happy:[["sparkles"]],sad:[["tears"]],fear:[["sweat"]],disgust:[["squish",{ms:700}]],sleep:[["zzz",{hold:!0,tag:"mood"}]]},lh=1800,yn=380,Hs=300,ch=300,xn=Object.keys(bt),vn=Object.keys(vo),hh={puff:e=>[1+.2*e,1+.14*e],squish:e=>[1+.22*e,1-.22*e],stretch:e=>[1-.12*e,1+.26*e],melt:e=>[1+.06*e,1-.38*e]},Lt=()=>performance.now(),dh=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,uh=e=>(e.userData.shared=!0,e);ue=(...e)=>{let t=new E.Group;return e.length&&t.add(...e),t},Zo=class{constructor(t,o={}){this.opts=o,this.quality=o.quality||"high",this.q=this.quality==="high"?1:.45,this.root=new E.Group,this.rig=new E.Group,this.root.add(this.rig),this.yaw=0,this.view=null,this.phase=Math.random()*rt,this.moodName="neutral",this.mv=mn("neutral"),this.sleepK=0,this.look={x:0,y:0,tx:0,ty:0,at:-1e9},this.mo={open:0,target:0,msx:1,tmsx:1},this.blinkAt=-1e9,this.nextBlink=Lt()+600+Math.random()*3e3,this.gest=null,this.speech=null,this.shells=0,this.morphs=new Map,this.fxs=[],this.fxSeq=0,this.fxg=new E.Group,this.root.add(this.fxg),this.build(t)}build(t){this.disposeRig(),this.clearMorphObjects();for(let X of this.fxs)Qo(X.obj);this.fxs=[];let o=this.spec=th(st(t)),s=o._style,a=Wt(o),r=this.L=xt(o),i=this.B=mr(a,r.box,this.quality),n=gr(i.geometry),c=this.W=r.box.w*me,h=this.H=r.box.h*me;this.depth=i.depth;let u=this.kk=Math.sqrt(c*h)/1.25,d=this.Y=X=>(i.bottom-X)*me,p=this.X=X=>(X-r.cx)*me,f=this.tex=Ja(o),m=this.plush=!s&&((this.opts.material||"plush")==="plush"||["fur","fuzz","feathers"].includes(f)),g=this.furLen=m?(f==="fuzz"||f==="none"?.05:.065)*u:0,b=this.density=g?this.quality==="high"?1/(g*.2):1/(g*.32):0;this.maxShells=this.quality==="high"?28:10;let $=o.body.color,v=Jt($)<.28,S=this.pal={body:$,brow:o.brows.color||Y($,v?.6:-.6),lip:o.mouth.color||Y($,v?.6:-.55)};this.furs=[],this.parts=[],this.anims=[],this.bodyMeshes=[],this.zGrid=null,this.hideMouth=!1;let M=yr({color:$,patternColor:o.body.patternColor,pattern:o.body.pattern,finish:o.finish,plush:m,furLen:g,density:b,cheekColor:o.cheeks.color,texture:f});this.bodyU=M.uniforms,this.bodyMat=M.base;let z=r.r*me,I=d(r.eyeY);this.r3=z,this.eyeY=I,M.uniforms.uDims.value.set(c,h,I,z),M.uniforms.uSp.value=r.sp*me;let w=uh(new E.Mesh(i.geometry,M.base));w.userData.ownMaterial=!0,this.rig.add(w),this.bodyMeshes.push(w),M.shell&&this.bodyMeshes.push(this.addShells(i.geometry,M,this.rig)),this.probe=n;let k=s?s.lw*.0042:o.finish==="toon"?.016:.009;if(o.finish==="toon"||o.finish==="sketch"||s&&s.lw>0){let X=new E.Mesh(i.geometry,br(M.uniforms,{outline:!0,color:s?.ink||"#1f2937",off:g*1.05+k*u,wobble:o.finish==="sketch"?.6:0}));X.userData.ownMaterial=!0,X.userData.noBounds=!0,this.rig.add(X),this.bodyMeshes.push(X)}this.eyes=[];let H=o.eyes.type==="cyclops",C=H?[0]:[-r.sp*me,r.sp*me];if(C.forEach((X,J)=>{let ye=H||J?1:-1,$e=n.front(X,I),ke=this.buildEye(o.eyes.type,H?z*1.7:z,ye);ke.root.position.copy($e.p),ke.root.quaternion.setFromUnitVectors(pn,$e.n.clone().lerp(pn,.5).normalize()),this.rig.add(ke.root),this.eyes.push(ke),this.part(ke.root,!0),M.uniforms.uBald.value[J]&&M.uniforms.uBald.value[J].set($e.p.x,$e.p.y,$e.p.z,(H?z*1.7:z)*1.05)}),this.brows=[],o.brows.type!=="none"){let X=o.brows.type,J={thick:.2,thin:.06,bushy:.16,dots:.18,soft:.09}[X]||.11,ye=X==="unibrow",$e=ye?[0]:C.length===1?[0]:C;for(let ke of $e){let Ee=ke<0?-1:1,ie=I+z*1.65*(H?1.5:1),W=n.front(ke,ie),G=ye?r.sp*me+z:z*.85,ne=(Yt,Ae)=>new E.Vector3(Yt*z*Ee,Ae*z,z*.06),ce;X==="arched"?ce=new E.QuadraticBezierCurve3(ne(-.9,-.25),ne(.1,.7),ne(.95,-.05)):X==="angled"?(ce=new E.CurvePath,ce.add(new E.LineCurve3(ne(-.9,-.15),ne(.35,.35))),ce.add(new E.LineCurve3(ne(.35,.35),ne(.9,.05)))):ce=new E.QuadraticBezierCurve3(new E.Vector3(-G,0,0),new E.Vector3(0,z*(X==="soft"?.45:.35),z*.12),new E.Vector3(G,0,0));let Me=X==="dots"?this.sph(z*.3,16,12).scale(1.3,.8,.6):new E.TubeGeometry(ce,X==="angled"?24:16,z*J,8,!1),ct=P(Me,R("felt",S.brow)),Ze=ue(ct);Ze.position.copy(W.p).addScaledVector(W.n,g*.7+z*.05),Ze.userData.base=Ze.position.y,this.rig.add(Ze),this.brows.push({g:Ze,side:ye?0:Ee}),this.part(Ze,!0)}}this.buildMouth(o,n,p(r.cx),d(r.mouthY),r.mw*me,M),this.part(this.mouthRig.g,!0);let A=o.cheeks.type;if(A==="whiskers"){let X=R("matte","#1f2937");for(let J of[-1,1])for(let ye of[-.25,0,.25]){let $e=J*r.sp*me*.7,ke=I-z*(2.4+ye*2),Ee=n.front($e,ke);if(!Ee)continue;let ie=Ee.p.clone().addScaledVector(Ee.n,g*.8+.004),W=new E.Vector3(J*(r.sp*me+z*2.6),I-z*(2.2+ye*3.2),ie.z*.75+g),G=ie.clone().lerp(W,.5);G.z+=.02*u;let ne=ue(P(new E.TubeGeometry(new E.QuadraticBezierCurve3(ie,G,W),8,Math.max(.002,z*.05),5),X));this.rig.add(ne),this.part(ne,!0)}}else if(A!=="none"){let X=r.sp*me+z*.45,J=I-z*1.8,ye=n.front(X,J);M.uniforms.uCheek.value.set(X,J,ye?ye.p.z:0,z*(A==="blush"?1:.7)),M.uniforms.uCheekOn.value=1,M.uniforms.uCheekType.value=rn[A]||1;let $e=o.cheeks.color||"#ff6b8a";A==="stars"?M.uniforms.uCheekColor.value.set("#facc15"):A==="freckles"?M.uniforms.uCheekColor.value.set(Y(o.cheeks.color||Y($,-.25),-.35)):A==="hearts"?M.uniforms.uCheekColor.value.set(o.cheeks.color||"#ff4d7a"):M.uniforms.uCheekColor.value.set($e)}for(let X of o.accessories){let J=this.buildAccessory(X,{L:r,X:p,Y:d,W:c,H:h,kk:u,probe:n,eyeY:I,r3:z,bm:M});if(!J)continue;J.updateMatrixWorld(!0);let ye=J.userData.surface?new E.Vector3:new E.Box3().setFromObject(J).getCenter(new E.Vector3),$e=ue(J);J.position.sub(ye),$e.position.copy(ye),J.userData.surface||($e.position.x+=X.x*me,$e.position.y-=X.y*me,$e.rotation.z-=X.rot*vt,$e.scale.multiplyScalar(X.scale),X.flip&&($e.scale.x*=-1)),this.rig.add($e),J.userData.surface||this.part($e,!1)}this.hideMouth&&(this.mouthRig.g.visible=!1);let j=this.sph(.1*u,24,16).scale(1,1.1,.85),D=new E.CapsuleGeometry(.032*u,.07*u,4,8).translate(0,.1*u,.02*u);this.hands=[-1,1].map(X=>{let J=ue();m?this.addFur(j,$,J,.7):J.add(P(j,M.base));let ye=m?this.addFur(D,$,ue(),.5):P(D,M.base);return ye.visible=!1,J.add(ye),J.userData.finger=ye,J.visible=!1,this.rig.add(J),J});let V=this.eyes.map(X=>{let J=X.root.position.x,ye=[];for(let $e=0;$e<=6;$e++){let ke=n.front(J+Math.sign(J||1)*z*.05*$e,I-z*(.9+$e*.5)),Ee=ke.p.clone().addScaledVector(ke.n,g+.006*u);ye.push([Ee.x,Ee.y,Ee.z])}return ye});this.fxc={W:c,H:h,D:i.depth,eyeY:I,r:z,sp:r.sp*me,mouth:this.mouthRig.g.position,low:this.quality==="low",tears:V};let Z=new E.Mesh(new E.PlaneGeometry(1,1),new E.MeshBasicMaterial({map:cn(),transparent:!0,depthWrite:!1,toneMapped:!1}));Z.rotation.x=-Math.PI/2,Z.position.y=.002,Z.scale.set(c*1.55,i.depth*2.6,1),Z.renderOrder=-1,this.shadow=Z,this.root.add(Z),this.rig.updateMatrixWorld(!0);let pe=this.bounds=new E.Box3,ge=new E.Box3;this.rig.traverseVisible(X=>{!X.isMesh||X.isInstancedMesh||X.userData.noBounds||(X.geometry.boundingBox||X.geometry.computeBoundingBox(),pe.union(ge.copy(X.geometry.boundingBox).applyMatrix4(X.matrixWorld)))}),pe.expandByScalar(this.furLen),this.shells=-1,this.setShells(this.maxShells)}part(t,o){this.parts.push({o:t,p0:t.position.clone(),face:o,d:new E.Vector3})}frontZ(t,o){let a=this.W,r=this.H;if(!this.zGrid){let $=this.zGrid=new Float32Array(144);for(let v=0;v<12;v++)for(let S=0;S<12;S++)$[v*12+S]=this.probe.front((S/11-.5)*a,v/11*r)?.p.z??NaN}let i=N((t/a+.5)*11,0,11),n=N(o/r*11,0,11),c=Math.min(10,Math.floor(i)),h=Math.min(10,Math.floor(n)),u=i-c,d=n-h,p=this.zGrid,f=p[h*12+c],m=p[h*12+c+1],g=p[(h+1)*12+c],b=p[(h+1)*12+c+1];if(Number.isNaN(f)||Number.isNaN(m)||Number.isNaN(g)||Number.isNaN(b)){let $=p[Math.round(n)*12+Math.round(i)];return Number.isNaN($)?null:$}return we(we(f,m,u),we(g,b,u),d)}sph(t,o=32,s=16,...a){let r=this.q;return new E.SphereGeometry(t,Math.max(8,Math.round(o*r)),Math.max(6,Math.round(s*r)),...a)}tor(t,o,s=12,a=48,r=rt){let i=this.q;return new E.TorusGeometry(t,o,Math.max(4,Math.round(s*i)),Math.max(8,Math.round(a*i)),r)}addShells(t,o,s){let a=new E.InstancedMesh(t,o.shell,this.maxShells);return a.frustumCulled=!1,a.userData.ownMaterial=!0,s.add(a),this.furs.push({inst:a,u:o.uniforms}),a}addFur(t,o,s,a=.8){let r=yr({color:o,patternColor:o,pattern:"none",finish:"clay",plush:!0,furLen:this.furLen*a||.04,density:this.density||60});r.uniforms.uDims.value.set(1,.001,-9,.01);let i=new E.Mesh(t,r.base);return i.userData.ownMaterial=!0,s.add(i),this.addShells(t,r,s),s}setShells(t){if(t=Math.max(0,Math.min(this.maxShells,Math.round(t))),t!==this.shells){this.shells=t;for(let o of this.furs)o.inst.count=t,o.u.uShells.value=Math.max(1,t)}}buildEye(t,o,s){let a=this.spec.eyes,r=ue(),i=ue(),n=ue();r.add(i),i.add(n);let c=R("gloss",a.ink),h=t;h==="wink"&&(h=s>0?"happy":"round");let u=!1;if(oh.has(h)){let p=h==="kawaii"?1.15:h==="dot"?.75:h==="button"?1:.9,f=h==="bean"?[.55,1.2,.5]:h==="dot"?[.8,1.05,.6]:[.92,1,.6];n.add(P(this.sph(o*p,32,24),c,[0,0,-o*.18],null,f)),h==="button"&&n.add(P(this.tor(o*.72,o*.07,8,32),R("gloss",Y(a.ink,.25)),[0,0,o*.45])),sh.has(h)&&(n.add(P(this.sph(o*.2,12,8),R("emissive","#ffffff"),[-o*.32,o*.36,o*.38])),n.add(P(this.sph(o*.09,10,6),R("emissive","#ffffff"),[o*.34,-o*.34,o*.38])))}else if(h==="happy"||h==="closed"||h==="cross")if(u=!0,h==="cross")for(let p of[45,-45])i.add(P(new E.CapsuleGeometry(o*.13,o*1.3,4,8),R("felt",a.ink),[0,0,o*.1],[0,0,p*vt]));else i.add(P(this.tor(o*.72,o*.14,10,24,Math.PI),R("felt",a.ink),[0,h==="happy"?-o*.25:o*.25,o*.08],[0,0,h==="happy"?0:Math.PI]));else if(h==="star"||h==="heart"){let p=new E.Shape;if(h==="star")for(let m=0;m<10;m++){let g=-Math.PI/2+m*Math.PI/5,b=m%2?o*.5:o*1.1;m?p.lineTo(Math.cos(g)*b,-Math.sin(g)*b):p.moveTo(Math.cos(g)*b,-Math.sin(g)*b)}else{let m=o*1.05;p.moveTo(0,-m*.9),p.bezierCurveTo(-m*1.4,m*.1,-m*.7,m*1.05,0,m*.35),p.bezierCurveTo(m*.7,m*1.05,m*1.4,m*.1,0,-m*.9)}let f=new E.ExtrudeGeometry(p,{depth:o*.2,bevelEnabled:!0,bevelThickness:o*.12,bevelSize:o*.1,bevelSegments:3,curveSegments:10});n.add(P(f,R("gloss",h==="heart"?"#ef3b5d":a.iris),[0,0,-o*.05]))}else if(h==="robot"||h==="led"||h==="glow"||h==="pixel")h==="robot"?(i.add(P(new E.BoxGeometry(o*2,o*1.6,o*.3),R("plastic","#0b1220"),[0,0,0])),n.add(P(new E.BoxGeometry(o*1.3,o*.9,o*.1),R("emissive",a.iris),[0,0,o*.16]))):h==="led"?n.add(P(new E.CapsuleGeometry(o*.3,o*1.6,4,12),R("emissive",a.iris),[0,0,o*.05],[0,0,Math.PI/2])):n.add(P(this.sph(o*.95,24,16),R("emissive",a.iris),[0,0,-o*.3],null,[1,1,.6]));else if(h==="spiral"||h==="dollar"){i.add(P(this.sph(o,32,24),R("gloss","#ffffff"),[0,0,-o*.2],null,[1,1,.75]));let p=o*.56,f;if(h==="spiral"){let g=[];for(let b=0;b<=48;b++){let $=b/48*Math.PI*5,v=o*(.06+.78*(b/48));g.push(new E.Vector3(Math.cos($)*v,Math.sin($)*v,p-b/48*o*.12))}f=new E.TubeGeometry(new E.CatmullRomCurve3(g),96,o*.07,6,!1)}else{let g=[[.45,.5],[0,.66],[-.45,.42],[-.28,.1],[.28,-.1],[.45,-.42],[0,-.66],[-.45,-.5]].map(([b,$])=>new E.Vector3(b*o*.6,$*o*.6,p));f=new E.TubeGeometry(new E.CatmullRomCurve3(g),40,o*.09,6,!1)}let m=P(f,R("gloss",h==="spiral"?a.ink:"#16a34a"));n.add(m),h==="dollar"?n.add(P(new E.CapsuleGeometry(o*.07,o*.95,3,6),R("gloss","#16a34a"),[0,0,p])):this.anims.push(g=>{m.rotation.z=-g*4*s})}else{let f=o*(h==="googly"?1.15:h==="wide"?1.12:h==="anime"?1.05:1),m=P(this.sph(f,32,24),R("gloss",h==="googly"||h==="hypno"?"#ffffff":a.white),[0,0,-f*.2],null,h==="anime"?[.9,1.2,.75]:h==="focused"?[1,.75,.75]:h==="almond"?[1.15,.72,.75]:[1,1,.75]);if(i.add(m),n.position.z=-f*.2,h==="almond"&&n.scale.set(1,.85,1),h==="lashes")for(let v=0;v<3;v++){let S=Math.cos(s>0?(30+v*30)*vt:(150-v*30)*vt),M=Math.sin((30+v*30)*vt);i.add(P(new E.CapsuleGeometry(f*.07,f*.32,3,6),R("felt",a.ink),[S*f*1.05,M*f*1.05,f*.2],[0,0,Math.atan2(M,S)-Math.PI/2]))}let g=h==="cat"?.92:h==="anime"?.7:h==="almond"?.72:h==="wide"||h==="googly"?0:.58;g&&n.add(P(this.sph(f*g,24,16),R("gloss",a.iris),[0,0,f*.62],null,h==="anime"?[1,1.3,.3]:[1,1,.3]));let b=h==="wide"?.3:h==="googly"?.55:h==="cat"?.5:.32;n.add(P(this.sph(f*b,20,12),c,[0,0,f*.68],null,h==="cat"?[.3,1.5,.3]:[1,1,.32])),n.add(P(this.sph(f*.11,10,6),R("emissive","#ffffff"),[-f*.22,f*.26,f*.78]));let $=ah[h];if($){let v=this.sph(f*1.07,32,12,0,rt,0,Math.PI*$[0]),S=P(v,R("felt",Y(this.spec.body.color,-.06)),[0,0,-f*.2],[0,0,$[1]*s*.45],[1,1,.8]);i.add(S)}}let d=P(this.tor(o*.72,o*.13,10,24,Math.PI),R("felt",a.ink),[0,o*.25,o*.08],[0,0,Math.PI]);return d.visible=!1,r.add(d),{root:r,main:i,gaze:n,closed:d,noBlink:u}}buildMouth(t,o,s,a,r,i){let n=t.mouth.type,c=ue(),h=o.front(s,a),u=this.plush?this.furLen*.55:.006;c.position.copy(h.p).addScaledVector(h.n,u),this.rig.add(c),i.uniforms.uBald.value[2]&&i.uniforms.uBald.value[2].set(h.p.x,h.p.y,h.p.z,r*1.1);let d=this.mouthRig={g:c,type:n,line:null,cav:null,min:gn[n]||0,bias:ih[n]||0,mw:r,round:null},p=R("felt",this.pal.lip),f=n==="grit"||n==="lips";if(!gn[n]&&!xr.has(n)&&n!=="beak"&&!f){let m=v=>{let S=[];for(let M=0;M<=8;M++){let z=M/4-1,I=z*r*(n==="tiny"||n==="pout"?.5:1),w=v*r*.5*(z*z-.45)+(n==="smirk"?z*r*.12:0)+(n==="wavy"?Math.sin(z*Math.PI*2)*r*.12:0),k=o.front(s+I,a+w).p.z-h.p.z;S.push(new E.Vector3(I,w,k))}return new E.TubeGeometry(new E.CatmullRomCurve3(S),32,Math.max(.006,r*.085),8,!1)},g=m(0),b=m(1),$=m(-1);g.morphAttributes.position=[b.attributes.position,$.attributes.position],g.morphAttributes.normal=[b.attributes.normal,$.attributes.normal],b.dispose(),$.dispose(),d.line=P(g,p),d.line.morphTargetInfluences=[0,0],c.add(d.line),n==="tongue"&&c.add(P(new E.CapsuleGeometry(r*.32,r*.3,4,12),R("gloss","#ff7a8a"),[r*.1,-r*.38,r*.05],null,[1,1,.45]))}if(xr.has(n)&&(d.round=ue(P(this.tor(r*.32,r*.1,10,24),n==="kiss"?R("gloss","#e11d48"):p),P(new E.CircleGeometry(r*.3,20),R("matte","#3a0d14"),[0,0,-.002])),n==="whistle"&&(d.round.position.x=r*.35),c.add(d.round)),n==="beak"&&c.add(P(new E.ConeGeometry(r*.6,r*1.1,24),R("plastic","#f59e0b"),[0,0,r*.4],[Math.PI/2,0,0],[1,1,.55])),n==="grit"){let m=ue(P(new E.BoxGeometry(r*2,r*.5,r*.12),R("plastic","#ffffff"))),g=R("matte","#1f2937");m.add(P(new E.BoxGeometry(r*2,r*.05,r*.02),g,[0,0,r*.065]));for(let b=1;b<5;b++)m.add(P(new E.BoxGeometry(r*.05,r*.5,r*.02),g,[(b/5-.5)*r*2,0,r*.065]));m.add(P(this.tor(1,.06,6,4).rotateZ(Math.PI/4).scale(r*1.45,r*.36,r*.2),p)),d.grit=m,c.add(m)}if(n==="lips"){let m=R("gloss",t.mouth.color||"#e11d48"),g=ue();for(let v of[-1,1])g.add(P(this.sph(1,20,12),m,[v*r*.42,0,0],[0,0,v*.25],[r*.55,r*.22,r*.2]));let b=P(this.sph(1,24,12),m,[0,0,0],null,[r*.85,r*.28,r*.22]),$=P(this.sph(1,20,10),R("gloss","#3a0d14"),[0,0,-r*.05],null,[r*.7,.001,r*.1]);d.lips={up:g,lo:b,hole:$},c.add(g,b,$)}if(n!=="beak"&&!xr.has(n)&&!f){let m=ue(),g=n==="robot"||n==="square";m.add(P(g?new E.BoxGeometry(2,2,1):this.sph(1,28,16),R("gloss","#3a0d14"),[0,0,0],null,g?[1,.5,.5]:[1,1,1]));let b=P(this.sph(.6,20,12),R("felt","#ff7a8a"),[0,-.45,.35],null,[1,.55,.5]);if(m.add(b),rh.has(n)&&m.add(P(new E.BoxGeometry(n==="buck"?.6:1.4,.3,.3),R("plastic","#ffffff"),[0,.68,.55])),n==="vampire"||n==="monster")for(let $ of[-.5,.5])m.add(P(new E.ConeGeometry(.14,.4,8),R("plastic","#ffffff"),[$,.62,.62],[Math.PI,0,0]));m.add(P(this.tor(1,.09,8,32),p,[0,0,.1],null,[1,1,1])),m.visible=!1,d.cav=m,c.add(m)}}buildAccessory(t,o){let{kk:s,probe:a,H:r,W:i,eyeY:n,r3:c,Y:h,X:u,L:d,bm:p}=o,f=.01*s,m=t.color,g=t.color2,b=t.id,$=a.top(0,0).p,v=w=>a.section($.y-w*s),S=(w,k,H=.8)=>this.addFur(w,k,ue(),H),M=ue(),z=(w,k=.05)=>(M.position.set($.x,$.y-k*s,0),M.add(w),M),I=w=>{let k=v(w);return{w:k.w,d:k.d,y:$.y-w*s}};switch(b){case"crown":case"tiara":{let w=R("metal",m),k=b==="crown"?6:3,H=.24*s;b==="crown"?M.add(P(new E.CylinderGeometry(H,H*1.05,.12*s,32,1,!0),w)):M.add(P(this.tor(H,.02*s,8,32,Math.PI),w,[0,0,0],[-Math.PI/2+.3,0,0]));for(let C=0;C<k;C++){let A=b==="crown"?C/k*rt:C/(k-1)*Math.PI,j=[Math.cos(A)*H,.1*s,b==="crown"?Math.sin(A)*H:Math.sin(A)*H*.3+.05*s];M.add(P(new E.ConeGeometry(.05*s,.12*s,12),w,j)),M.add(P(this.sph(.025*s,12,8),R("gloss",b==="crown"?"#dc2626":"#60a5fa"),[j[0],j[1]+.07*s,j[2]]))}return z(ue(...M.children.splice(0)),.02)}case"tophat":{let w=ue(P(new E.CylinderGeometry(.36*s,.36*s,.025*s,40),R("felt",m)),P(new E.CylinderGeometry(.22*s,.24*s,.4*s,40),R("felt",m),[0,.2*s,0]),P(new E.CylinderGeometry(.245*s,.245*s,.07*s,40),R("felt",g==="#ffffff"?"#dc2626":g),[0,.05*s,0]));return w.rotation.z=-.12,z(w,.06)}case"beanie":case"santa":case"cap":case"hardhat":case"viking":case"beret":{let w=I(b==="beret"?.14:.24),k=this.sph(1,40,20,0,rt,0,Math.PI/2).scale(w.w*1.08,$.y-w.y+.05*s,w.d*1.1),H=ue();if(b==="beanie"||b==="santa")H.add(S(k,m,.7)),H.add(S(this.sph(.09*s,20,14),b==="santa"?"#fafafa":g,1)),H.children[1].position.y=$.y-w.y+.08*s,b==="santa"&&H.add(S(this.tor(1,.12,12,40).rotateX(Math.PI/2).scale(w.w*1.08,s*.5,w.d*1.1),"#fafafa",.9));else if(b==="beret")H.add(P(k,R("felt",m),null,[0,0,-.25],[1.25,.45,1.2]));else{let C=b==="viking"?R("metal","#a3a3a3"):b==="cap"?R("felt",m):R("plastic",m);if(H.add(P(k,C)),b==="cap"&&H.add(P(new E.CylinderGeometry(w.w*.75,w.w*.75,.02*s,32,1,!1,-Math.PI/2,Math.PI),R("felt",g==="#ffffff"?Y(m,-.2):g),[0,.01,w.d*.9],null,[1,1,.9])),b==="hardhat"&&H.add(P(new E.CylinderGeometry(w.w*1.25,w.w*1.25,.02*s,40),R("plastic",m),[0,0,.02])),b==="viking")for(let A of[-1,1])H.add(P(new E.ConeGeometry(.06*s,.3*s,16),R("plastic","#fef3c7"),[A*w.w*1.05,($.y-w.y)*.5,0],[0,0,-A*1]))}return H.position.y=w.y,H}case"hair":{let w=this.sph(1,36,20).scale(.3*s,.17*s,.26*s),k=S(w,m,1.3);return k.position.set(0,$.y+.02*s,.04*s),k.rotation.x=.15,k}case"party":case"wizard":{let w=b==="party"?.42:.62,k=ue(P(new E.ConeGeometry((b==="party"?.16:.27)*s,w*s,32),R(b==="party"?"plastic":"felt",m),[0,w/2*s,0]));return b==="party"&&k.add(S(this.sph(.06*s,16,10),g,1)),b==="party"&&(k.children[1].position.y=w*s),b==="wizard"&&k.add(P(new E.CylinderGeometry(.42*s,.42*s,.02*s,40),R("felt",m))),k.rotation.z=-.15,z(k,.04)}case"cowboy":{let w=ue(P(this.sph(1,40,10,0,rt,Math.PI*.35,Math.PI*.3),R("felt",m),[0,.05*s,0],null,[.55*s,.12*s,.45*s]),P(new E.CapsuleGeometry(.2*s,.1*s,6,24),R("felt",m),[0,.15*s,0],null,[1,1,.8]),P(new E.CylinderGeometry(.205*s,.205*s,.04*s,32),R("felt",Y(m,-.35)),[0,.1*s,0]));return z(w,.05)}case"chef":{let w=ue(P(new E.CylinderGeometry(.2*s,.2*s,.14*s,32),R("felt","#fafafa")));for(let[k,H,C,A]of[[0,.2,0,.17],[-.13,.15,0,.12],[.13,.15,0,.12],[0,.15,.1,.12]])w.add(P(this.sph(A*s,20,14),R("felt","#fafafa"),[k*s,H*s,C*s]));return z(w,.04)}case"grad":{let w=ue(P(new E.CylinderGeometry(.17*s,.19*s,.1*s,32),R("felt",m)),P(new E.BoxGeometry(.46*s,.025*s,.46*s),R("felt",m),[0,.06*s,0],[0,Math.PI/4,0]),P(new E.CylinderGeometry(.008*s,.008*s,.16*s,6),R("felt",g==="#ffffff"?"#facc15":g),[.2*s,-.01*s,0]));return z(w,.03)}case"bow":case"flower":{let w=ue();if(b==="bow"){for(let k of[-1,1])w.add(P(new E.ConeGeometry(.08*s,.15*s,20),R("plastic",m),[k*.08*s,0,0],[0,0,k*Math.PI/2],[1,1,.5]));w.add(P(this.sph(.04*s,16,10),R("plastic",m)))}else{for(let k=0;k<5;k++){let H=k/5*rt;w.add(P(this.sph(.055*s,16,10),R("felt",m),[Math.cos(H)*.06*s,Math.sin(H)*.06*s,0],null,[1,1,.4]))}w.add(P(this.sph(.04*s,16,10),R("felt","#facc15"),[0,0,.01*s]))}return w.position.set(.14*s,$.y-.02*s,.06*s),w.rotation.z=-.3,w}case"halo":{let w=P(this.tor(.22*s,.025*s,12,48),R("emissive",m),null,[Math.PI/2,0,0]);return w.position.y=$.y+.14*s,w}case"horns":case"catears":case"bunny":case"antenna":case"sprout":{for(let w of b==="sprout"?[0]:[-1,1]){let k=ue();if(b==="horns"&&k.add(P(new E.ConeGeometry(.06*s,.22*s,20),R("gloss",m),[0,.09*s,0])),b==="catears"&&k.add(S(new E.ConeGeometry(.12*s,.22*s,24).scale(1,1,.45).translate(0,.09*s,0),m,.8)),b==="bunny"&&(k.add(S(this.sph(1,24,16).scale(.08*s,.26*s,.05*s).translate(0,.22*s,0),m,.8)),k.add(P(this.sph(1,20,12),R("felt",g),[0,.22*s,.035*s],null,[.045*s,.18*s,.02*s]))),b==="antenna"&&(k.add(P(new E.CylinderGeometry(.01*s,.01*s,.22*s,8),R("plastic",m),[0,.11*s,0])),k.add(P(this.sph(.045*s,16,10),R("emissive",g),[0,.23*s,0]))),b==="sprout"){k.add(P(new E.CylinderGeometry(.012*s,.015*s,.16*s,8),R("plastic","#16a34a"),[0,.08*s,0]));for(let A of[-1,1])k.add(P(this.sph(1,16,10),R("plastic",m),[A*.07*s,.17*s,0],[0,0,A*.5],[.08*s,.035*s,.02*s]))}let H=w*(b==="antenna"?.12:.22)*s,C=a.top(H,0).p;k.position.set(H,C.y-.03*s,0),k.rotation.z=-w*(b==="bunny"?.15:b==="catears"?.3:.35),M.add(k)}return M}case"headphones":case"headband":case"bandana":{let w=b==="bandana"?$.y-.12*s:n+(b==="headband"?c*2.2:0),k=a.section(w);if(b==="headphones"){let H=k.w+.04*s;M.add(P(this.tor(H,.025*s,10,40,Math.PI),R("plastic",m),[0,w,0],null,[1,($.y-w+.06*s)/H,1]));for(let C of[-1,1])M.add(P(new E.CylinderGeometry(.1*s,.1*s,.07*s,28),R("plastic",g),[C*H,w,0],[0,0,Math.PI/2]));return M}return M.add(P(this.tor(1,.05,10,48),R("felt",m),[0,w,0],[Math.PI/2,0,0],[k.w*1.04,k.d*1.06,s*.9])),M}case"glasses":case"square":case"nerd":case"sunglasses":case"aviator":case"heartglasses":case"starglasses":case"3d":case"monocle":case"goggles":case"visor":case"eyepatch":{let w=Math.max(...this.eyes.map(A=>A.root.position.z))+c*.55,k=c*(b==="nerd"?1.7:1.5),H=b==="monocle"?[1]:b==="eyepatch"?[-1]:[-1,1],C=R(b==="3d"?"plastic":"gloss",m);for(let A of H){let j=A*d.sp*me;if(b==="eyepatch"){M.add(P(this.sph(k*.9,24,12),R("felt",m),[j,n,w-k*.5],null,[1,.85,.35]));continue}if(b==="visor")continue;let D=b==="square"||b==="nerd"||b==="3d",V=this.tor(k,k*.13,8,D?4:32);M.add(P(V,C,[j,n,w],[0,0,D?Math.PI/4:0],D?[1.15,.85,1]:[1,1,1]));let Z=b==="sunglasses"||b==="aviator"?"#0f172a":b==="goggles"?g:b==="3d"?A<0?"#ef4444":"#22d3ee":b==="heartglasses"?"#f9a8d4":b==="starglasses"?"#fde68a":null;if(Z){let pe=P(new E.CircleGeometry(k,D?4:32),new E.MeshPhysicalMaterial({color:Z,roughness:.05,clearcoat:1,transparent:!0,opacity:b==="sunglasses"?.92:.55}),[j,n,w-.002],[0,0,D?Math.PI/4:0],D?[1.15,.85,1]:[1,1,1]);M.add(pe)}}if(b==="visor"&&M.add(P(new E.CapsuleGeometry(k*.8,d.sp*me*2.2,6,16),new E.MeshPhysicalMaterial({color:m,roughness:.05,clearcoat:1,transparent:!0,opacity:.75}),[0,n,w],[0,0,Math.PI/2],[1,1,.3])),H.length===2&&b!=="visor"&&M.add(P(new E.CylinderGeometry(k*.1,k*.1,d.sp*me*2-k*2,8),C,[0,n+k*.15,w],[0,0,Math.PI/2])),b==="eyepatch"){let A=a.section(n+c);M.add(P(this.tor(1,.02,6,48),R("felt",m),[0,n+c*.4,0],[Math.PI/2,-.35,0],[A.w*1.03,A.d*1.05,s]))}return M}case"mustache":case"handlebar":case"beard":case"wizardbeard":case"goatee":{let w=h(d.mouthY),k=a.front(0,w);if(b==="mustache"||b==="handlebar"){let j=ue();for(let D of[-1,1])j.add(S(this.sph(1,20,12).scale(.1*s,.04*s,.04*s).rotateZ(D*(b==="handlebar"?-.4:.25)).translate(D*.085*s,0,0),m,.6));return j.position.copy(k.p).add(new E.Vector3(0,d.mw*me*.5,this.furLen*.6)),j}let H=b==="wizardbeard"?1.8:b==="goatee"?.6:1,C=b==="goatee"?.08:.3,A=S(this.sph(1,28,18).scale(C*s,.16*H*s,.12*s),m,1.1);return A.position.set(0,w-.1*H*s,k.p.z-.04*s),A}case"clownnose":case"nose":case"pignose":{let w=h(d.anchors.nose.y),k=a.front(0,w),H=ue();if(b==="clownnose")H.add(P(this.sph(.075*s,24,16),R("gloss",m)));else if(b==="nose")H.add(P(this.sph(.035*s,20,12),R("gloss",m),null,null,[1.3,.9,.8]));else{H.add(P(new E.CylinderGeometry(.08*s,.08*s,.05*s,28),R("felt",m),null,[Math.PI/2,0,0],[1,1,.75]));for(let C of[-1,1])H.add(P(this.sph(.018*s,12,8),R("matte",Y(m,-.5)),[C*.03*s,0,.026*s]))}return H.position.copy(k.p).addScaledVector(k.n,this.furLen*.6+.02*s),H}case"bowtie":case"tie":case"medal":case"bell":case"scarf":case"pearls":case"ruff":{let w=h(d.anchors.neck.y),k=a.section(w),H=k.z+this.furLen*.6;if(b==="scarf"||b==="ruff")return M.add(S(this.tor(1,.1,14,48).rotateX(Math.PI/2).scale(k.w*1.05,s*(b==="ruff"?.9:.75),k.d*1.08),m,.9)),b==="scarf"&&M.add(S(new E.BoxGeometry(.1*s,.26*s,.04*s,2,6,2).translate(.12*s,-.12*s,H+.02*s),m,.9)),M.position.y=w,M;if(b==="pearls"){for(let A=0;A<=12;A++){let j=Math.PI*(A/12);M.add(P(this.sph(.025*s,12,8),R("gloss",m),[Math.cos(j)*k.w*1.02,w-Math.sin(j)*.03*s,Math.sin(j)*k.d*1.05]))}return M}let C=ue();if(b==="bowtie"){for(let A of[-1,1])C.add(P(new E.ConeGeometry(.07*s,.14*s,20),R("felt",m),[A*.065*s,0,0],[0,0,A*Math.PI/2],[1,1,.5]));C.add(P(this.sph(.035*s,16,10),R("felt",Y(m,-.2))))}else b==="tie"?(C.add(P(this.sph(.035*s,16,10),R("felt",Y(m,-.2)))),C.add(P(new E.ConeGeometry(.06*s,.3*s,4),R("felt",m),[0,-.17*s,0],[Math.PI,Math.PI/4,0],[1,1,.35]))):b==="medal"?(C.add(P(new E.CylinderGeometry(.06*s,.06*s,.015*s,32),R("metal",m),[0,-.08*s,0],[Math.PI/2,0,0])),C.add(P(new E.BoxGeometry(.04*s,.1*s,.005*s),R("felt",g),[0,-.02*s,0]))):(C.add(P(this.sph(.06*s,20,14),R("metal",m),[0,-.05*s,0])),M.add(P(this.tor(1,.045,10,48),R("felt",g),[0,w,0],[Math.PI/2,0,0],[k.w*1.03,k.d*1.05,s])));return C.position.set(0,w,H),M.add(C),M}case"cape":case"superhero":{let w=a.section(r*.5),k=new E.CylinderGeometry(w.w*1.02,w.w*1.35,r*.75,32,1,!0,Math.PI/2+.35,Math.PI-.7);k.scale(1,1,w.d/w.w*1.1);let H=new E.MeshPhysicalMaterial({color:m,roughness:.6,sheen:.6,side:E.DoubleSide});return M.add(P(k,H,[0,r*.4,0])),M}case"wings":case"batwings":{let w=a.section(r*.5);for(let k of[-1,1]){let H=ue(P(this.sph(1,24,12),b==="wings"?R("felt",m):R("plastic",m),[k*.2*s,.08*s,0],null,[.24*s,.15*s,.03*s]));H.position.set(k*w.w*.5,r*.55,-w.d*.85),H.rotation.set(0,k*.5,k*.35),M.add(H)}return M}case"tail":{let w=new E.CatmullRomCurve3([new E.Vector3(0,.12*s,-.1),new E.Vector3(.12*s,.1*s,-.45*s),new E.Vector3(.25*s,.32*s,-.5*s)]);return M.add(P(new E.TubeGeometry(w,24,.02*s,8),R("gloss",m))),M.add(P(new E.ConeGeometry(.06*s,.1*s,4),R("gloss",m),[.25*s,.36*s,-.5*s],null,[1,1,.4])),M}case"jetpack":{let w=a.section(r*.5);for(let k of[-1,1])M.add(P(new E.CapsuleGeometry(.07*s,.22*s,6,16),R("metal",m),[k*.09*s,r*.5,-w.d-.04*s])),M.add(P(new E.ConeGeometry(.05*s,.14*s,16),R("emissive","#f97316"),[k*.09*s,r*.5-.22*s,-w.d-.04*s],[Math.PI,0,0]));return M}case"pirate":{let w=I(.2),k=$.y-w.y+.06*s,H=R("felt",m),C=ue(P(this.sph(1,32,16,0,rt,0,Math.PI/2),H,null,null,[w.w*.95,k*1.1,w.d]));for(let D=0;D<3;D++){let V=ue(P(this.sph(1,24,10),H,[0,0,w.d*.85],[-.75,0,0],[w.w*.95,.1*s,.07*s]));V.rotation.y=D/3*rt,V.position.y=k*.12,C.add(V)}let A=R("felt",g),j=ue(P(this.sph(.045*s,16,10),A));for(let D of[.7,-.7])j.add(P(new E.CapsuleGeometry(.012*s,.11*s,3,6),A,[0,0,-.01*s],[0,0,D]));for(let D of[-1,1])j.add(P(this.sph(.011*s,8,6),R("matte","#111827"),[D*.016*s,.005*s,.04*s]));return j.position.set(0,k*.5,w.d*.97),j.rotation.x=-.3,C.add(j),C.position.y=w.y,C}case"pipe":case"lollipop":{let w=h(d.mouthY),k=a.front(d.mw*me*.5,w).p,H=ue();H.position.copy(k),H.position.z+=this.furLen*.5;let C=(j,D,V,Z)=>{let pe=D.clone().sub(j),ge=P(new E.CylinderGeometry(V,V,pe.length(),8),Z);return ge.position.copy(j).addScaledVector(pe,.5),ge.quaternion.setFromUnitVectors(new E.Vector3(0,1,0),pe.normalize()),ge},A=(j,D,V)=>new E.Vector3(j*f,D*f,V*f);if(b==="pipe"){H.add(C(A(0,0,0),A(22,-10,14),2*f,R("gloss","#1f2937")));let j=A(26,-16,16);H.add(P(new E.CylinderGeometry(8*f,7*f,16*f,20),R("gloss",m),j.toArray())),H.add(P(new E.CircleGeometry(6.5*f,16),R("matte","#292524"),[j.x,j.y+8.05*f,j.z],[-Math.PI/2,0,0]));let D=[0,1,2].map(()=>P(this.sph(1,10,8),R("felt","#d6d3d1")));H.add(...D),this.anims.push(V=>D.forEach((Z,pe)=>{let ge=(V*.5+pe/3)%1;Z.position.set(j.x+Math.sin(ge*7+pe)*4*f,j.y+(10+ge*40)*f,j.z),Z.scale.setScalar(Math.max(1e-4,(2+ge*5)*f*Math.sin(Math.PI*ge)))}))}else{H.add(C(A(0,0,0),A(26,10,10),1.6*f,R("plastic","#fafafa")));let j=ue(P(new E.CylinderGeometry(11*f,11*f,4*f,28),R("gloss",m),null,[Math.PI/2,0,0])),D=[];for(let V=0;V<=30;V++){let Z=V/30*Math.PI*4,pe=(1+8*(V/30))*f;D.push(new E.Vector3(Math.cos(Z)*pe,Math.sin(Z)*pe,2.2*f))}j.add(P(new E.TubeGeometry(new E.CatmullRomCurve3(D),48,1*f,5),R("plastic","#ffffff"))),j.position.copy(A(31,13,12)),H.add(j)}return H}case"bandaid":case"ninjamask":case"facemask":{let w=this.depth,k=this.furLen*1.02+.004*s,H=(C,A,j,D=0,V=0)=>{let Z=new E.Mesh(this.B.geometry,br(p.uniforms,{color:C,off:k+V,box:A,kind:j,round:D}));return Z.userData.ownMaterial=!0,Z.userData.noBounds=!0,this.bodyMeshes.push(Z),Z};if(b==="bandaid"){let C=d.sp*me+c*.4,A=n-c*2.4;M.add(H(m,{c:[C,A,w],h:[12*f,4.5*f,w],rot:30*vt},"plastic",4.4*f)),M.add(H(Y(m,-.1),{c:[C,A,w],h:[4*f,4.6*f,w],rot:30*vt},"plastic",0,.002*s))}else if(b==="ninjamask"){let C=n-c*1.6;M.add(H(m,{c:[0,C/2,0],h:[9,C/2,9],rot:0},"felt")),this.hideMouth=!0}else{let C=h(d.mouthY),A=d.mw*me;M.add(H(m,{c:[0,C-5*f,w],h:[A+12*f,17*f,w],rot:0},"felt",8*f)),this.hideMouth=!0}return M.userData.surface=!0,M}case"scar":{let w=-d.sp*me,k=this.furLen*.9+.004*s,H=(j,D)=>{let V=a.front(j,D);return V.p.clone().addScaledVector(V.n,k)},C=[];for(let j=0;j<=8;j++){let D=j/8;C.push(H(w+we(-6,6,D)*f,n+c*we(2.6,-2.4,D)))}let A=R("felt",m);M.add(P(new E.TubeGeometry(new E.CatmullRomCurve3(C),16,1.4*f,5),A));for(let j of[-8,0,8]){let D=n-j*f,V=w+-j/8*2*f;M.add(P(new E.TubeGeometry(new E.LineCurve3(H(V-4*f,D),H(V+4*f,D)),2,1.1*f,5),A))}return M.userData.surface=!0,M}case"parrot":{let w=u(d.anchors.shoulder.x),k=a.top(w,0).p,H=ue(),C=s*1.1;H.add(P(this.sph(1,20,14),R("felt",m),[0,.09*C,0],[.2,0,0],[.065*C,.1*C,.065*C])),H.add(P(this.sph(.055*C,18,12),R("felt",m),[0,.2*C,.015*C])),H.add(P(new E.ConeGeometry(.03*C,.07*C,10),R("felt",g),[0,.265*C,-.01*C],[-.4,0,0])),H.add(P(new E.ConeGeometry(.02*C,.05*C,10),R("gloss","#facc15"),[0,.19*C,.07*C],[Math.PI/2+.5,0,0]));for(let D of[-1,1])H.add(P(this.sph(.011*C,8,6),R("gloss","#111111"),[D*.035*C,.21*C,.04*C]));H.add(P(new E.CapsuleGeometry(.018*C,.12*C,3,8),R("felt","#2563eb"),[0,.02*C,-.06*C],[-.9,0,0]));for(let D of[-1,1])H.add(P(this.sph(1,14,10),R("felt",Y(m,-.2)),[D*.06*C,.1*C,-.005*C],[.2,0,D*.15],[.02*C,.07*C,.05*C]));let A=k.y-.01*s;H.position.set(w,A,0),H.rotation.y=-.4;let j=Math.random()*rt;return this.anims.push(D=>{H.rotation.x=Math.sin(D*2.2+j)*.08,H.position.y=A+Math.max(0,Math.sin(D*1.3+j))*.01*s}),ue(H)}case"sparkles":case"hearts":case"zzz":{let w=b==="sparkles"?[[-.75,-.55,9],[.8,-.35,7],[.7,.55,6],[-.8,.35,5]].map(([C,A,j])=>[C*i*.62,r*.5-A*r*.55,j*1.3]):b==="hearts"?[[-40,-10,7],[36,-18,9],[8,-34,6]].map(([C,A,j])=>[C*f,$.y-A*f,j]):[[30,-10,9],[46,-26,6.5],[58,-38,5]].map(([C,A,j])=>[C*f,$.y-A*f,j]),k=R("gloss",b==="hearts"?"#f43f5e":m),H=w.map(([C,A,j],D)=>{let V=P(ua(b==="sparkles"?"star":b==="hearts"?"heart":"z"),k,[C,A,this.depth*.5]);return V.scale.setScalar(j*f),V.userData.r=j*f,V.userData.i=D,V});return M.add(...H),this.anims.push(C=>H.forEach(A=>{let j=A.userData.i;b==="sparkles"?(A.scale.setScalar(A.userData.r*(.7+.3*Math.sin(C*3+j*1.7))),A.rotation.z=C*.6+j):A.rotation.y=Math.sin(C*1.5+j)*.4})),M}case"sweat":{let w=a.front(d.sp*me+c*2.4,n+c*2.4),k=P(ua("drop"),R("gloss",m),null,[0,0,-.15]);return k.scale.setScalar(7*f),k.position.copy(w.p).addScaledVector(w.n,this.furLen+6*f),M.add(k),M}case"helmet":{let w=Math.max(i,r)*.62,k=P(this.sph(w,48,32),R("glass",m),[0,r*.5,0]);return k.renderOrder=2,k.userData.noBounds=!0,M.add(k),M.add(P(this.tor(w*.78,.035*s,10,48),R("metal",g),[0,r*.5-w*.62,0],[Math.PI/2,0,0])),M}default:return null}}disposeRig(){this.rig.traverse(t=>{t.isMesh&&(t.geometry.userData.shared||t.geometry.dispose(),t.userData.ownMaterial&&t.material.dispose())}),this.rig.clear(),this.shadow&&(this.shadow.material.dispose(),this.shadow.geometry.dispose(),this.root.remove(this.shadow),this.shadow=null)}blinkValue(t){let o=t-this.blinkAt;return o<0||o>=180?0:o<70?fe.in(o/70)**.5:1-fe.out((o-70)/110)}tick(t,o){let s=dh(),a=this.opts.idle!==!1;if(a&&t>=this.nextBlink){if(this.moodName!=="sleep"&&!s&&(this.blinkAt=t,Math.random()<.2&&(this.nextDouble=t+240),t-this.look.at>3e3&&Math.random()<.45)){let W=Math.abs(this.look.tx)+Math.abs(this.look.ty)>.1&&Math.random()<.6;this.look.tx=W?0:(Math.random()-.5)*.9,this.look.ty=W?0:(Math.random()-.5)*.5}this.nextBlink=t+1800+Math.random()*3600}this.nextDouble&&t>=this.nextDouble&&(this.blinkAt=t,this.nextDouble=0),this.speech&&!this.speech.tick(t)&&this.endSpeech();let r=this.mo;r.open=Re(r.open,r.target,o,r.target>r.open?35:70),r.msx=Re(r.msx,r.tmsx,o,60);let i=this.look;i.x=s?i.tx:Re(i.x,i.tx,o,70),i.y=s?i.ty:Re(i.y,i.ty,o,70);let n=mn(this.moodName);for(let W in bn)this.mv[W]=s?n[W]:Re(this.mv[W],n[W],o,90);this.sleepK=Re(this.sleepK,this.moodName==="sleep"?1:0,o,s?1:260);let c={x:0,y:0,r:0,sx:1,sy:1,lx:0,ly:0,blink:0,eye:1,lift:0,open:0,curve:0,msx:1},h=0,u=this.gest;if(u){let W=t-u.start,G=N(W/u.ms);Object.assign(c,u.def.pose(G,s?0:W,u)),u.dir<0&&(c.x=-c.x,c.r=-c.r,c.lx=-c.lx),u.name==="spin"&&(h=fe.inOut(N((G-.12)/.76))*rt,c.sx=1+(c.sy<1?(1-c.sy)*.6:0));for(let ne of u.def.fx||[])G>=ne[0]&&!u.fired.has(ne)&&(u.fired.add(ne),this.effect(ne[1],{dir:u.dir,...ne[2]||{}}));G>=1&&this.endGesture()}s&&Object.assign(c,{x:0,y:0,r:0,sx:1,sy:1});let d=1,p=1,f={};for(let[W,G]of this.morphs){if(G.phase!=="out"&&t>=G.until&&(G.phase="out",G.outAt=t,G.k0=G.k),G.phase==="in"){let ce=N((t-G.start)/yn);G.k=s?1:G.shape?fe.inOut(ce):fe.backOut(ce),ce>=1&&(G.phase="on")}else if(G.phase==="on")G.k=1;else{let ce=N((t-G.outAt)/Hs);if(G.k=s?0:G.k0*(1-fe.inOut(ce)),ce>=1){this.morphs.delete(W),this.endMorph(W);continue}}f[W]=G;let ne=hh[W];if(ne){let[ce,Me]=ne(G.k);d*=ce,p*=Me}}f.shape&&!f.shape.ready&&this.startShape(f.shape);let m=f.shape?.ready?f.shape.k:0;this.bodyU.uMorph.value.set(f.melt?.k||0,s?0:f.jelly?.k||0,m,0);let g=this.mv,b=this.W,$=this.H,v=this.kk,S=t/1e3,M=s||!a?0:Math.sin(S*rt/3.4+this.phase),z=r.open,I=c.sx*(1-.015*z)*(1-.006*M)*d,w=c.sy*(1+.03*z)*(1+.014*M)*p,k=this.rig;k.position.set(c.x*b,-c.y*$,0),k.rotation.set(i.y*.12,this.yaw+i.x*.35+h+(s||!a?0:Math.sin(S*.7+this.phase)*.04),-(c.r+i.x*2)*vt),k.scale.set(I,w,I);let H=Math.max(0,-c.y);this.shadow.scale.set(b*1.55*(1-H*.9)*d,this.shadow.scale.y,1),this.shadow.material.opacity=1-H*1.5;for(let W of this.parts)W.o.position.copy(W.p0).addScaledVector(W.d,m);let C=Math.max(this.blinkValue(t),c.blink,this.sleepK>.02?Math.min(1,this.sleepK*1.1):0),A=this.sleepK>.85,j=N(i.x+c.lx,-1,1),D=N(i.y+c.ly,-1,1),V=g.eye*c.eye;for(let W of this.eyes){W.main.visible=!A,W.closed.visible=A,W.gaze.rotation.set(D*.4,j*.5,0);let G=W.noBlink?1:Math.max(.08,1-C);W.main.scale.set(V,V*(g.squash||1)*G,V)}for(let W of this.brows)W.g.position.y+=(g.lift+c.lift)*me+(g.eye*c.eye-1)*this.L.r*me*1.65,W.g.rotation.z=-W.side*g.tilt*14*vt;let Z=this.mouthRig,pe=N(g.curve+c.curve+Z.bias,-1,1),ge=N(Math.max(r.open+c.open,g.open,Z.min)),X=r.msx*c.msx;if(Z.g.scale.x=X,Z.line&&(Z.line.morphTargetInfluences[0]=Math.max(0,pe),Z.line.morphTargetInfluences[1]=Math.max(0,-pe),Z.line.visible=ge<=.12),Z.cav){let W=ge>.12;if(Z.cav.visible=W,W){let G=Z.mw*(.75+Math.max(0,pe)*.15),ne=Z.mw*(.12+ge*.75);Z.cav.scale.set(G,ne,Z.mw*.18),Z.cav.position.y=-ne*.55+pe*Z.mw*.1}}if(Z.round&&Z.round.scale.setScalar(.85+ge*.6),Z.grit&&(Z.grit.scale.y=1+ge*1.6,Z.grit.position.y=pe*Z.mw*.08),Z.lips){let W=ge*Z.mw*.45;Z.lips.up.position.y=Z.mw*.16+W*.5+pe*Z.mw*.05,Z.lips.lo.position.y=-Z.mw*.14-W*.5,Z.lips.hole.scale.y=Math.max(.001,W*.6)}let J=this.mobj,ye=f.spikes;if(ye){let W=J.spikes||(J.spikes=this.makeSpikes(ye.o.color));W.visible=!0;let G=W.userData.list;for(let ne=0;ne<G.length;ne++){let ce=G[ne],Me=Math.max(1e-4,fe.backOut(N(ye.k*1.5-ce.ord*.07))*(ye.phase==="out"?ye.k:1));Rs.position.copy(ce.p),Rs.quaternion.copy(ce.q),Rs.scale.set(Me,Me,Me),Rs.updateMatrix(),W.setMatrixAt(ne,Rs.matrix)}W.instanceMatrix.needsUpdate=!0}else J.spikes&&(J.spikes.visible=!1);let $e=f.horns;if($e){let W=J.horns||(J.horns=this.makeHorns($e.o.color));W.visible=!0;for(let G of W.children)G.scale.setScalar(Math.max(1e-4,$e.k))}else J.horns&&(J.horns.visible=!1);let ke=f.wings;if(ke){let W=J.wings||(J.wings=this.makeWings(ke.o.color));W.visible=!0;let G=ke.o.flap==="fast",ne=s?0:Math.sin((t-ke.start)/1e3*rt*(G?3.2:.9))*(G?32:11)*vt;for(let ce of W.children){let Me=ce.userData.side;ce.rotation.set(0,Me*(.55-ne),Me*.25),ce.scale.setScalar(Math.max(1e-4,ke.k))}}else J.wings&&(J.wings.visible=!1);let Ee=f.hands;for(let W=0;W<2;W++){let G=this.hands[W];if(G.visible=!!Ee,!Ee){G.userData.on=!1;continue}let ne=W?1:-1,ce=this.L,Me=this.handCtx||(this.handCtx={cx:ce.cx,W:ce.box.w,H:ce.box.h,mid:ce.box.y+ce.box.h*.55,mouthY:ce.mouthY,mw:ce.mw,sp:ce.sp,eyeY:ce.eyeY,pts:ce.pts}),ct=(bs[Ee.o.pose]||bs.rest)(ne,s?0:t-Ee.start,Ee.o.dir||1,Me),Ze=this.X(ct.x??Me.cx+ne*ct.u*Me.W*.5),Yt=this.Y(ct.y??Me.mid+ct.v*Me.H*.5),Ae=this.frontZ(Ze,Yt),Xo=Ae==null?this.depth*.15:Ae+.06*v+this.furLen,Jo=-ne*(ct.ang||0)*vt;!G.userData.on||s?(G.position.set(Ze,Yt,Xo),G.rotation.z=Jo,G.userData.on=!0):(G.position.set(Re(G.position.x,Ze,o,70),Re(G.position.y,Yt,o,70),Re(G.position.z,Xo,o,70)),G.rotation.z=Re(G.rotation.z,Jo,o,70));let Ot=ct.type||"open",es=G.userData.finger;es.visible=Ot==="point"||Ot==="thumb"||Ot==="thumbdown",es.rotation.z=Ot==="thumbdown"?Math.PI:0,G.scale.setScalar(Math.max(.01,Ee.k*(ct.s||1))*(Ot==="open"?1:.9))}let ie=0;if(this.fxs.length){let W=this.fxc;this.fxs=this.fxs.filter(G=>{let ne=t-G.start,ce=1,Me;if(G.loop)!G.hold&&ne>=G.ms&&G.end==null&&(G.end=t),Me=s?.3:ne%G.cycle/G.cycle;else{if(ne>=G.ms)return Qo(G.obj),!1;Me=s?.5:ne/G.ms}return G.end!=null&&(ce=1-N((t-G.end)/ch),ce<=0)?(Qo(G.obj),!1):(G.def.draw(W,G,Me,s?0:ne,ce,At(G.seed)),G.blush&&(ie=Math.max(ie,G.blush)),!0)})}this.bodyU.uBlush.value=ie,this.fxg.position.copy(k.position),this.fxg.rotation.y=this.yaw;for(let W of this.furs)W.u.uTime.value=S;for(let W of this.anims)W(s?0:S)}makeSpikes(t){let o=this.L,s=[],a=new E.Vector3(0,1,0),r=new E.Vector3(0,this.H*.5,0);o.pts.forEach(([c,h],u)=>{if(u>=6&&u<=10)return;let d=new E.Vector3(this.X(c),this.Y(h),0),p=d.clone().sub(r).normalize();d.addScaledVector(p,-.02*this.kk),s.push({p:d,q:new E.Quaternion().setFromUnitVectors(a,p),ord:Math.min(u,16-u)})});for(let c of[.82,.62,.42]){let h=this.H*c,u=this.probe.section(h);s.push({p:new E.Vector3(0,h,-u.d*.9),q:new E.Quaternion().setFromUnitVectors(a,new E.Vector3(0,.4,-1).normalize()),ord:3+s.length*.1})}let i=new E.ConeGeometry(.05*this.kk,.16*this.kk,Math.max(6,Math.round(12*this.q))).translate(0,.08*this.kk,0),n=new E.InstancedMesh(i,R(this.plush?"felt":"gloss",t||Y(this.spec.body.color,-.12)),s.length);return n.instanceMatrix.setUsage(E.DynamicDrawUsage),n.frustumCulled=!1,n.userData.list=s,n.userData.noBounds=!0,this.rig.add(n),n}makeHorns(t){let o=this.L,s=ue(),a=R("gloss",t||"#f5f0e6");for(let r of[1,15]){let[i,n]=o.pts[r],c=i>o.cx?1:-1,h=ue(P(new E.ConeGeometry(.06*this.kk,.24*this.kk,16).translate(0,.12*this.kk,0),a));h.children[0].rotation.z=-c*.25;let u=this.X(i)*.8;h.position.set(u,this.probe.top(u,0).p.y-.04*this.kk,0),h.rotation.z=-c*.45,s.add(h)}return s.userData.noBounds=!0,this.rig.add(s),s}makeWings(t){let o=ue(),s=this.kk,a=this.probe.section(this.H*.6),r=R(this.plush?"felt":"plastic",t||"#ffffff");for(let i of[-1,1]){let n=ue();for(let c=0;c<3;c++){let h=P(this.sph(1,20,12),r,[i*(.16+c*.05)*s,(.1-c*.07)*s,0],[0,0,i*(.5-c*.35)],[(.2-c*.03)*s,.07*s,.025*s]);n.add(h)}n.position.set(i*a.w*.45,this.H*.62,-a.d*.7),n.userData.side=i,o.add(n)}return o.userData.noBounds=!0,this.rig.add(o),o}startShape(t){t.ready=!0;let o=t.target,s=xt(this.spec,o),a=mr(o,s.box,this.quality),r=a.geometry.attributes;if(r.position.count!==this.B.geometry.attributes.position.count)return;let i=this.shapeGeo;if(!i){i=this.shapeGeo=this.B.geometry.clone(),i.userData={};for(let u of this.bodyMeshes)u.geometry=i}i.setAttribute("aShape",r.position.clone()),i.setAttribute("aShapeN",r.normal.clone());let n=s.box.w*me/this.W,c=s.box.h*me/this.H,h=gr(a.geometry);for(let u of this.parts){let{x:d,y:p}=u.p0,f=d*n,m=p*c;u.d.set(f-d,m-p,u.face?h.front(f,m).p.z-this.probe.front(d,p).p.z:0)}}endMorph(t){if(t==="shape"){for(let o of this.bodyMeshes)o.geometry=this.B.geometry;this.shapeGeo?.dispose(),this.shapeGeo=null;for(let o of this.parts)o.d.set(0,0,0),o.o.position.copy(o.p0)}t==="hands"&&(this.handCtx=null)}clearMorphObjects(){this.shapeGeo&&(this.shapeGeo.dispose(),this.shapeGeo=null),this.mobj={},this.handCtx=null;for(let t of this.morphs.values())t.ready=!1}lod(t){this.plush&&this.setShells(N(t/(this.quality==="high"?14:20),3,this.maxShells))}mood(t,o={}){if(!pa[t])return!1;if(t===this.moodName)return!0;if(this.moodName=t,this.clearEffects("mood"),this.opts.moodFx!==!1&&o.fx!==!1)for(let[s,a]of nh[t]||[])this.effect(s,a||{});return!0}endGesture(){let t=this.gest;if(!t)return;this.gest=null;let o=this.morphs.get("hands");t.def.hands&&o&&!o.byGesture&&o.userPose!==void 0&&(o.o.pose=o.userPose);let s=this.morphs.get("wings");t.def.wings&&s&&!s.byGesture&&(s.o.flap=s.userFlap)}gesture(t,o={}){let s=Object.hasOwn(ao,t)?t:xo[t];if(!s)return!1;typeof o=="number"&&(o={ms:o});let a=ao[s],r=Lt(),i=N(Number(o.ms)||a.ms,200,6e4),n=o.dir===-1||o.mirror===!0?-1:1;this.gest&&this.endGesture(),this.gest={name:s,def:a,start:r,ms:i,dir:n,fired:new Set};let c=this.morphs.get("hands");a.hands?c&&c.phase!=="out"?(c.o.pose=a.hands,c.o.dir=n,c.byGesture&&(c.until=r+i-Hs)):this.morph("hands",{pose:a.hands,dir:n,ms:i-Hs,byGesture:!0}):c?.byGesture&&c.phase!=="out"&&(c.until=r);let h=this.morphs.get("wings");return a.wings?h&&h.phase!=="out"?(h.o.flap=a.wings,h.byGesture&&(h.until=r+i-Hs)):this.morph("wings",{flap:a.wings,ms:i-Hs,byGesture:!0}):h?.byGesture&&h.phase!=="out"&&(h.until=r),!0}morph(t,o={}){if(typeof t!="string")return!1;if(o===!1)return this.unmorph(t);if(typeof o=="number"&&(o={ms:o}),!Object.hasOwn(bt,t)&&Object.hasOwn(fa,t))return this.effect(t,o);let s=t,a=null;if(t.startsWith("shape:")){if(a=aa(t.slice(6)),!a)return!1;s="shape"}else if(!Object.hasOwn(bt,t))return!1;let r=Lt(),n=o.hold===!0||o.ms===1/0?1/0:N(Number(o.ms)||lh,200,6e5),c=!o.byGesture,h=/^#[0-9a-f]{6}$/i.test(o.color||"")?o.color:void 0,u=this.morphs.get(s);if(u)u.phase==="out"&&(u.phase="in",u.start=r-yn*N(u.k)),u.until=Math.max(c?0:u.until,r+n),c&&(u.byGesture=!1),s==="shape"&&u.target!==a&&(u.target=a,u.ready=!1),o.pose&&(u.o.pose=o.pose),o.dir&&(u.o.dir=o.dir),o.flap&&(u.o.flap=o.flap),c&&(u.userPose=u.o.pose,u.userFlap=u.o.flap);else{let d={pose:t==="hands"?o.pose||"rest":void 0,dir:o.dir===-1?-1:1,flap:o.flap,color:h};this.morphs.set(s,{name:s,start:r,until:r+n,phase:"in",k:0,o:d,target:a,shape:s==="shape",ready:!1,byGesture:!c,userPose:c?d.pose:void 0,userFlap:c?d.flap:void 0})}return!0}unmorph(t){let o=Lt(),s=typeof t=="string"&&t.startsWith("shape")?"shape":t;for(let[a,r]of this.morphs)s&&a!==s||r.phase!=="out"&&(r.phase="out",r.outAt=o,r.k0=r.k);return!0}effect(t,o={}){if(typeof t!="string")return!1;if(typeof o=="number"&&(o={ms:o}),Object.hasOwn(bt,t)||t.startsWith("shape:"))return this.morph(t,o);if(!Object.hasOwn(fa,t))return!1;let s=fa[t],a={name:t,def:s,start:Lt(),ms:N(Number(o.ms)||(s.loop?s.ms*1.5:s.ms),100,6e5),cycle:s.ms,loop:!!s.loop||o.hold===!0,hold:o.hold===!0,dir:o.dir===-1?-1:1,o,tag:o.tag,seed:++this.fxSeq*7919^Math.floor(this.phase*1e4),end:null,obj:null},r=s.make(this.fxc,a);return r&&(a.obj=r,(s.rig?this.rig:this.fxg).add(r),s.draw(this.fxc,a,0,0,1,At(a.seed))),this.fxs.push(a),this.fxs.length>24&&Qo(this.fxs.shift().obj),!0}clearEffects(t){let o=Lt();for(let s of this.fxs)(!t||s.name===t||s.tag===t)&&(s.end??=o)}blink(){this.blinkAt=Lt()}lookAt(t,o){this.look.tx=N(Number(t)||0,-1,1),this.look.ty=N(Number(o)||0,-1,1),this.look.at=Lt()}lookAtPoint(t,o){let s=this.view?.screenOf(this);s&&this.lookAt((t-s.x)/(window.innerWidth/2),(o-s.y)/(window.innerHeight/2))}mouth(t){this.mo.target=N(Number(t)||0)}viseme(t,o){let s=Be[t]||Be.X;return this.mo.target=N(o??s.open),this.mo.tmsx=s.w,!!Be[t]}endSpeech(){let t=this.speech;this.speech=null,this.mo.target=0,this.mo.tmsx=1,t?.resolve?.()}speak(t,o={}){this.speech&&this.endSpeech();let s,a;if(typeof t=="number")a=N(t,0,6e5),s=ra(a,Math.floor(Math.random()*1e6));else{let p=String(t??"");s=ko(p),a=Number(o.durationMs)||Math.max(300,p.length/14/(Number(o.rate)||1)*1e3)}let r,i=new Promise(p=>{r=p});if(!s.length||!a)return r(),Object.assign(i,{stop(){}});let n=0;for(let p of s)p.t0=n,n+=p.w;let c=Lt(),h=0,u=Number(o.gain)||1,d={resolve:r,tick:p=>{if(p-c>=a)return!1;let f=N((p-c)/a)*n;for(;h<s.length-1&&s[h+1].t0<=f;)h++;let m=s[h],g=Be[m.v]||Be.X,b=N((f-m.t0)/(m.w||1));return this.mo.target=N(g.open*(.82+.18*Math.sin(Math.PI*b))*u),this.mo.tmsx=g.w,!0}};return this.speech=d,Object.assign(i,{stop:()=>{this.speech===d&&this.endSpeech()}})}stopSpeaking(){this.speech&&this.endSpeech()}lipsync(t,o={}){if(this.stopSpeaking(),!t||typeof t.getByteTimeDomainData!="function")return()=>{};let s=t.fftSize||512,a=new Uint8Array(s),r=Number(o.gain)||1,i=o.text?ko(String(o.text)):[],n=0;for(let f of i)f.t0=n,n+=f.w;let c=Number(o.durationMs)||Math.max(300,String(o.text||"").length/14*1e3),h=Lt(),u=0,d=.05,p={tick:f=>{if(t.context?.state==="closed")return!1;t.getByteTimeDomainData(a);let m=0;for(let $=0;$<s;$++){let v=(a[$]-128)/128;m+=v*v}m=Math.sqrt(m/s),d=Math.max(m,d*.995,.02);let g=N(N((m-.006)/(d*.7))**.8*r),b=1;if(i.length&&f-h<c){let $=N((f-h)/c)*n;for(;u<i.length-1&&i[u+1].t0<=$;)u++;b=(Be[i[u].v]||Be.X).w}return this.mo.target=g,this.mo.tmsx=we(1,b,N(g*2)),!0}};return this.speech=p,()=>{this.speech===p&&this.endSpeech()}}update(t){this.build(t)}get state(){return{mood:this.moodName,gesture:this.gest?.name||null,speaking:!!this.speech,shells:this.shells,morphs:[...this.morphs.keys()].filter(t=>this.morphs.get(t).phase!=="out"),effects:this.fxs.map(t=>t.name)}}dispose(){for(let t of this.fxs)Qo(t.obj);this.fxs=[],this.disposeRig(),this.root.removeFromParent()}}});var Sn={};il(Sn,{Character3D:()=>Zo,EFFECTS_3D:()=>vn,GESTURES_3D:()=>wn,MOODS_3D:()=>$n,MORPHS_3D:()=>xn,createCharacter3D:()=>ph,createCrowd3D:()=>mh,getStage:()=>ha,webglAvailable:()=>vr});function vr(){if(Ps!==null)return Ps;try{Ps=!!document.createElement("canvas").getContext("webgl2")}catch{Ps=!1}return Ps}function fh(e,t){let o=Pt(e,t);return o.fallback=!0,o}function Mn(e,t){let o=e.vrect||e.rect||e.el.getBoundingClientRect();return t.root.updateMatrixWorld(),ma.set(0,t.H*.6,0).applyMatrix4(t.root.matrixWorld).project(e.camera),{x:o.left+(ma.x+1)/2*o.width,y:o.top+(1-ma.y)/2*o.height}}function _n(e,t){let o=e.rect;if(!o)return 300;let s=e.camera,a=Math.max(.1,s.position.distanceTo(t.root.getWorldPosition(ma)));return t.H*t.root.scale.y/a*(o.height/2/Math.tan(s.fov*Math.PI/360))}function En(e,t,o={}){return{character:t,gesture:(s,a)=>t.gesture(s,a),mood:(s,a)=>t.mood(s,a),lookAt:(s,a)=>t.lookAt(s,a),lookAtPoint:(s,a)=>t.lookAtPoint(s,a),speak:(s,a)=>t.speak(s,a),lipsync:(s,a)=>t.lipsync(s,a),stopSpeaking:()=>t.stopSpeaking(),morph:(s,a)=>t.morph(s,a),unmorph:s=>t.unmorph(s),effect:(s,a)=>t.effect(s,a),clearEffects:s=>t.clearEffects(s),mouth:s=>t.mouth(s),viseme:(s,a)=>t.viseme(s,a),blink:()=>t.blink(),get spec(){return t.spec},get state(){return t.state},...o}}function ph(e,t,o={}){if(!vr())return fh(e,t);let s=ha(o.stage),a=s.makeScene(),r=new kt.PerspectiveCamera(o.fov||28,1,.05,50),i=new Zo(t,{quality:o.quality||"high",material:o.material||"plush",moodFx:o.moodFx});a.add(i.root);let n=0,c=()=>{let $=i.bounds,v=$.getSize(new kt.Vector3),S=$.getCenter(new kt.Vector3),M=r.fov*Math.PI/360,z=v.y*.5*1.12/Math.tan(M),I=Math.max(v.x,v.z)*.5*1.2/(Math.tan(M)*r.aspect),w=Math.max(z,I)+v.z*.5;r.position.set(S.x,S.y+w*.12,S.z+w),r.lookAt(S.x,S.y*.96,0),r.updateProjectionMatrix()},h={el:e,scene:a,camera:r,characters:[i],rect:null,bleed:o.bleed||0,tick($,v){let S=this.rect.width/this.rect.height;Math.abs(S-n)>.001&&(n=S,r.aspect=S,c()),p||(i.yaw*=Math.exp(-v/900)),i.tick($,v),i.lod(_n(this,i))},screenOf:$=>Mn(h,$)};i.view=h,s.addView(h);let u=e.style.background,d=()=>{if(o.backdrop===!1)return;let $=i.spec.style,v=$&&$!=="none"?la($,Bo(i.spec)):"";e.style.background=v?`${v} center bottom / cover no-repeat`:u};d();let p=!1,f=0,m=$=>{p=!0,f=$.clientX,e.setPointerCapture?.($.pointerId)},g=$=>{p&&(i.yaw+=($.clientX-f)*.012,f=$.clientX)},b=()=>{p=!1};return o.orbit!==!1&&(e.addEventListener("pointerdown",m),e.addEventListener("pointermove",g),e.addEventListener("pointerup",b),e.addEventListener("pointercancel",b),e.style.touchAction=e.style.touchAction||"pan-y",e.style.cursor=e.style.cursor||"grab"),En(h,i,{stage:s,update($,v={}){v.material&&(i.opts.material=v.material),i.update($),d(),n=0},destroy(){s.removeView(h),e.style.background=u,e.removeEventListener("pointerdown",m),e.removeEventListener("pointermove",g),e.removeEventListener("pointerup",b),e.removeEventListener("pointercancel",b),i.dispose()}})}function mh(e,t={}){if(!vr()){e.style.display="flex",e.style.flexWrap="wrap",e.style.alignContent="center",e.style.justifyContent="center";let u=[];return{fallback:!0,characters:u,add(d){let p=document.createElement("div");p.style.cssText="width:84px;height:84px",e.append(p);let f=Pt(p,d);return u.push(f),f},clear(){u.forEach(d=>d.destroy()),u.length=0,e.textContent=""},lookAtPoint(d,p){for(let f of u)f.lookAtPoint(d,p)},gesture(d,p){u.forEach((f,m)=>setTimeout(()=>f.gesture(d,p),m*25))},mood(d){for(let p of u)p.mood(d)},effect(d,p){u.forEach((f,m)=>setTimeout(()=>f.effect(d,p),m*25))},morph(d,p){u.forEach((f,m)=>setTimeout(()=>f.morph(d,p),m*25))},unmorph(d){for(let p of u)p.unmorph(d)},refit(){},destroy(){this.clear()}}}let o=ha(t.stage),s=o.makeScene(),a=new kt.PerspectiveCamera(t.fov||32,1,.1,100),r=[],i=0,n=new kt.Vector3,c=()=>{let u=new kt.Box3;for(let m of r)m.root.updateMatrixWorld(),u.union(m.bounds.clone().applyMatrix4(m.root.matrixWorld));if(u.isEmpty())return;let d=u.getSize(new kt.Vector3);u.getCenter(n);let p=a.fov*Math.PI/360,f=Math.max(d.y*.6/Math.tan(p),d.x*.58/(Math.tan(p)*a.aspect))+d.z*.2;a.position.set(n.x,n.y+f*.42,n.z+f*.92),a.lookAt(n.x,n.y*.5,n.z+d.z*.08),a.updateProjectionMatrix()},h={el:e,scene:s,camera:a,characters:r,rect:null,tick(u,d){let p=this.rect.width/this.rect.height;Math.abs(p-i)>.001&&(i=p,a.aspect=p,c());for(let f of r)f.tick(u,d),f.lod(_n(this,f))},screenOf:u=>Mn(h,u)};return o.addView(h),{stage:o,camera:a,characters:r,add(u,d={}){let p=new Zo(u,{quality:t.quality||"low",material:t.material||"plush",moodFx:t.moodFx});return p.view=h,p.root.position.set(d.x||0,0,d.z||0),p.root.rotation.y=d.rotY||0,d.scale&&p.root.scale.setScalar(d.scale),s.add(p.root),r.push(p),i=0,En(h,p)},clear(){for(let u of r)u.dispose();r.length=0},lookAtPoint(u,d){for(let p of r)p.lookAtPoint(u,d)},gesture(u,d){r.forEach((p,f)=>setTimeout(()=>p.gesture(u,d),f*25))},mood(u){for(let d of r)d.mood(u)},effect(u,d){r.forEach((p,f)=>setTimeout(()=>p.effect(u,d),f*25))},morph(u,d){r.forEach((p,f)=>setTimeout(()=>p.morph(u,d),f*25))},unmorph(u){for(let d of r)d.unmorph(u)},refit(){i=0},destroy(){o.removeView(h),this.clear()}}}var kt,Ps,ma,Tn=Ke(()=>{kt=jt(_o(),1);en();kn();Qt();Vo();Ps=null;ma=new kt.Vector3});var ho=class{constructor(){this._handlers=new Map}on(t,o){return this._handlers.has(t)||this._handlers.set(t,new Set),this._handlers.get(t).add(o),()=>this.off(t,o)}once(t,o){let s=this.on(t,a=>{s(),o(a)});return s}off(t,o){this._handlers.get(t)?.delete(o)}emit(t,o={}){for(let s of[t,"*"])for(let a of this._handlers.get(s)||[])try{s==="*"?a(t,o):a(o)}catch(r){console.error(`[7ots] listener de "${t}" fall\xF3:`,r)}}clear(){this._handlers.clear()}};function Po(e){let t=o=>`7ots:${e}:${o}`;return{get(o,s=null){try{let a=sessionStorage.getItem(t(o));return a==null?s:JSON.parse(a)}catch{return s}},set(o,s){try{sessionStorage.setItem(t(o),JSON.stringify(s))}catch{}},remove(o){try{sessionStorage.removeItem(t(o))}catch{}}}}_e();_e();gt({es:{widget:{defaultName:"Asistente",launcher:{open:"Abrir asistente {name}"},panel:{label:"Asistente {name}"},teaser:{dismiss:"Descartar"},status:{online:"En l\xEDnea",thinking:"Pensando\u2026",withTeam:"Con el equipo"},typing:"El asistente est\xE1 pensando",voice:{on:"Voz activada",off:"Voz silenciada",mute:"Silenciar voz",micDenied:"Permiso de micr\xF3fono denegado"},menu:{contact:"Contactar con el equipo",more:"M\xE1s opciones",minimize:"Minimizar",initiativeLabel:"Iniciativa del asistente",initiative:"Iniciativa",level:{quiet:"Discreta",normal:"Normal",bold:"Atrevida"},muteSuggestions:"Silenciar sugerencias",unmuteSuggestions:"Activar sugerencias",reset:"Nueva conversaci\xF3n"},composer:{placeholder:"Escribe o pulsa el micr\xF3fono\u2026",placeholderTeam:"Escribe al equipo\u2026",label:"Mensaje",mic:"Hablar",send:"Enviar"},footer:{ai:"Asistente con IA \xB7 puede equivocarse"},pageTools:{done:"Hecho: {title}"},handoff:{team:"Equipo de soporte",author:"Equipo",video:"Videollamada",back:"Volver al asistente",userLeft:"El usuario volvi\xF3 al asistente",ended:"La conversaci\xF3n con el equipo termin\xF3.",closed:"El canal de soporte se cerr\xF3.",sendFailed:"No se pudo enviar el mensaje al equipo."},brain:{stuck:"Me he quedado a medias; \xBFquieres que lo intente de otra forma?",error:"Uy, tuve un problema para responder. \xBFLo intentamos de nuevo?"},pointer:{stopped:"Detenido. No har\xE9 nada m\xE1s hasta que me lo pidas.",hint:"Esc para detener",halted:"Detenido",typing:"escribiendo\u2026"},companion:{talkTo:"Hablar con {name}",pointAt:"Se\xF1alar",tour:"Recorrido",goHome:"Volver al rinc\xF3n"},dialog:{close:"Cerrar",confirm:"Confirmar",ok:"Aceptar",cancel:"Cancelar",info:"Informaci\xF3n",gotIt:"Entendido"},confirm:{title:"Confirmar acci\xF3n",yes:"S\xED, continuar",runAction:'\xBFAutorizas al asistente a ejecutar "{action}"?',mcp:'El asistente quiere ejecutar "{action}" en tu cuenta. \xBFContinuar?',click:'El asistente quiere pulsar "{label}". \xBFContinuar?',typeSubmit:"\xBFEscribo el texto y env\xEDo el formulario?",enterSubmit:'El asistente quiere pulsar Enter en "{label}", lo que env\xEDa el formulario. \xBFContinuar?',fillSubmit:"\xBFEnv\xEDo el formulario con los datos que rellen\xE9?",pageTool:'El asistente quiere usar "{title}". \xBFContinuar?',pageToolWith:'El asistente quiere usar "{title}" con {detail}. \xBFContinuar?'},contact:{human:"Hablar con una persona",mail:"Dejar un mensaje por correo",askHuman:"Quiero hablar con una persona del equipo.",askMail:"Quiero dejar un mensaje por correo al equipo.",mailPreview:`Se enviar\xE1 este mensaje al equipo de soporte:
248
248
 
249
249
  Asunto: {subject}
250
250
  Respuesta a: {to}