@botuyo/chat-widget-standalone 1.0.67 → 1.0.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/botuyo-chat.es.js +9 -9
- package/dist/botuyo-chat.es.js.map +1 -1
- package/dist/botuyo-chat.umd.js +1 -1
- package/dist/botuyo-chat.umd.js.map +1 -1
- package/dist/src/chat-widget/ChatWidgetProvider.d.ts.map +1 -1
- package/dist/stats-umd.html +1 -1
- package/dist/stats.html +1 -1
- package/package.json +1 -1
package/dist/botuyo-chat.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRoot as t}from"react-dom/client";import e,{useState as r,useMemo as o,useEffect as n,useCallback as a,Component as i,useReducer as s,useRef as c,createContext as d,useContext as l,lazy as u,Suspense as p}from"react";import{u as h,g,e as m,f,D as w,c as b,X as y,M as v,l as x,m as k,t as _,h as z,i as E,j as S,k as O,n as I,o as $}from"./chunk-chat-ui-C3MpSoay.js";import{p as C}from"./chunk-chat-ui-C3MpSoay.js";import{jsxs as N,jsx as T}from"react/jsx-runtime";import{l as M}from"./vendor-socket-DMqyM-90.js";import{createPortal as A}from"react-dom";const j='@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:host,:root{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-900:oklch(39.6% .141 25.723);--color-amber-500:oklch(76.9% .188 70.08);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-300:oklch(90.5% .182 98.111);--color-yellow-700:oklch(55.4% .135 66.442);--color-yellow-900:oklch(42.1% .095 57.708);--color-green-50:oklch(98.2% .018 155.826);--color-green-200:oklch(92.5% .084 155.995);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-green-900:oklch(39.3% .095 152.535);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-blue-50:oklch(97% .014 254.604);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-900:oklch(37.9% .146 265.522);--color-purple-500:oklch(62.7% .265 303.9);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--text-xs:.75rem;--text-xs--line-height:1.33333;--text-sm:.875rem;--text-sm--line-height:1.42857;--text-base:1rem;--text-base--line-height:1.5;--text-lg:1.125rem;--text-lg--line-height:1.55556;--text-xl:1.25rem;--text-xl--line-height:1.4;--text-2xl:1.5rem;--text-2xl--line-height:1.33333;--text-3xl:1.875rem;--text-3xl--line-height:1.2;--text-4xl:2.25rem;--text-4xl--line-height:1.11111;--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-medium:500;--font-weight-bold:700;--font-weight-black:900;--tracking-tighter:-.05em;--tracking-tight:-.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0,0,.2,1)infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--animate-bounce:bounce 1s infinite;--blur-sm:8px;--blur-md:12px;--blur-2xl:40px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{border:0 solid;box-sizing:border-box;margin:0;padding:0}:host,html{-webkit-text-size-adjust:100%;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}button,input,optgroup,select,textarea{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}::file-selector-button{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance:-apple-pay-button)) or (contain-intrinsic-size:1px){::-moz-placeholder{color:currentColor}::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::-moz-placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{border-width:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;white-space:nowrap;width:1px}.absolute,.sr-only{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing)*0)}.-top-1{top:calc(var(--spacing)*-1)}.-top-1\\.5{top:calc(var(--spacing)*-1.5)}.top-0{top:calc(var(--spacing)*0)}.top-1\\/2{top:50%}.top-2{top:calc(var(--spacing)*2)}.top-3{top:calc(var(--spacing)*3)}.top-4{top:calc(var(--spacing)*4)}.top-full{top:100%}.-right-0\\.5{right:calc(var(--spacing)*-.5)}.-right-1{right:calc(var(--spacing)*-1)}.-right-1\\.5{right:calc(var(--spacing)*-1.5)}.right-0{right:calc(var(--spacing)*0)}.right-2{right:calc(var(--spacing)*2)}.right-3{right:calc(var(--spacing)*3)}.right-4{right:calc(var(--spacing)*4)}.right-6{right:calc(var(--spacing)*6)}.-bottom-0\\.5{bottom:calc(var(--spacing)*-.5)}.-bottom-1{bottom:calc(var(--spacing)*-1)}.bottom-3{bottom:calc(var(--spacing)*3)}.bottom-4{bottom:calc(var(--spacing)*4)}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing)*0)}.left-1\\/2{left:50%}.left-4{left:calc(var(--spacing)*4)}.left-6{left:calc(var(--spacing)*6)}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\\[60\\]{z-index:60}.z-\\[9999\\]{z-index:9999}.z-\\[100000\\]{z-index:100000}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:calc(var(--spacing)*1)}.my-2{margin-block:calc(var(--spacing)*2)}.my-3{margin-block:calc(var(--spacing)*3)}.my-4{margin-block:calc(var(--spacing)*4)}.my-8{margin-block:calc(var(--spacing)*8)}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\\.5{margin-top:calc(var(--spacing)*1.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-3{margin-right:calc(var(--spacing)*3)}.mr-auto{margin-right:auto}.mb-0{margin-bottom:calc(var(--spacing)*0)}.mb-0\\.5{margin-bottom:calc(var(--spacing)*.5)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.ml-0\\.5{margin-left:calc(var(--spacing)*.5)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-3{margin-left:calc(var(--spacing)*3)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-0{height:calc(var(--spacing)*0)}.h-1{height:calc(var(--spacing)*1)}.h-2{height:calc(var(--spacing)*2)}.h-2\\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-3\\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-14{height:calc(var(--spacing)*14)}.h-16{height:calc(var(--spacing)*16)}.h-20{height:calc(var(--spacing)*20)}.h-24{height:calc(var(--spacing)*24)}.h-32{height:calc(var(--spacing)*32)}.h-48{height:calc(var(--spacing)*48)}.h-56{height:calc(var(--spacing)*56)}.h-\\[44px\\]{height:44px}.h-auto{height:auto}.h-full{height:100%}.max-h-\\[85\\%\\]{max-height:85%}.max-h-\\[120px\\]{max-height:120px}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-\\[40px\\]{min-height:40px}.min-h-full{min-height:100%}.w-0{width:calc(var(--spacing)*0)}.w-1{width:calc(var(--spacing)*1)}.w-2{width:calc(var(--spacing)*2)}.w-2\\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-3\\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-7{width:calc(var(--spacing)*7)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-14{width:calc(var(--spacing)*14)}.w-16{width:calc(var(--spacing)*16)}.w-20{width:calc(var(--spacing)*20)}.w-24{width:calc(var(--spacing)*24)}.w-\\[3px\\]{width:3px}.w-\\[calc\\(100\\%-0\\.5rem\\)\\]{width:calc(100% - .5rem)}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.max-w-0{max-width:calc(var(--spacing)*0)}.max-w-\\[60px\\]{max-width:60px}.max-w-\\[85\\%\\]{max-width:85%}.max-w-\\[90\\%\\]{max-width:90%}.max-w-\\[320px\\]{max-width:320px}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.max-w-none{max-width:none}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\\[200px\\]{min-width:200px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.origin-bottom{transform-origin:bottom}.origin-bottom-left{transform-origin:0 100%}.origin-bottom-right{transform-origin:100% 100%}.-translate-x-1\\/2{--tw-translate-x:-50%}.-translate-x-1\\/2,.-translate-x-6{translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-x-6{--tw-translate-x:calc(var(--spacing)*-6)}.translate-x-0{--tw-translate-x:calc(var(--spacing)*0)}.translate-x-0,.translate-x-6{translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-6{--tw-translate-x:calc(var(--spacing)*6)}.-translate-y-1\\/2{--tw-translate-y:-50%}.-translate-y-1\\/2,.translate-y-0{translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-0{--tw-translate-y:calc(var(--spacing)*0)}.translate-y-2{--tw-translate-y:calc(var(--spacing)*2)}.translate-y-2,.translate-y-8{translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-8{--tw-translate-y:calc(var(--spacing)*8)}.scale-50{--tw-scale-x:50%;--tw-scale-y:50%;--tw-scale-z:50%}.scale-50,.scale-90{scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-90{--tw-scale-x:90%;--tw-scale-y:90%;--tw-scale-z:90%}.scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%}.scale-100,.scale-105{scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-105{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%}.scale-110{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%}.scale-110,.scale-125{scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-125{--tw-scale-x:125%;--tw-scale-y:125%;--tw-scale-z:125%}.scale-\\[0\\.85\\]{scale:.85}.-rotate-90{rotate:-90deg}.rotate-0{rotate:none}.rotate-45{rotate:45deg}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-bounce{animation:var(--animate-bounce)}.animate-ping{animation:var(--animate-ping)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.cursor-wait{cursor:wait}.resize{resize:both}.resize-none{resize:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-8{gap:calc(var(--spacing)*8)}.gap-\\[2px\\]{gap:2px}.gap-\\[3px\\]{gap:3px}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-end:calc(var(--spacing)*1*(1 - var(--tw-space-y-reverse)));margin-block-start:calc(var(--spacing)*1*var(--tw-space-y-reverse))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-end:calc(var(--spacing)*2*(1 - var(--tw-space-y-reverse)));margin-block-start:calc(var(--spacing)*2*var(--tw-space-y-reverse))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-end:calc(var(--spacing)*4*(1 - var(--tw-space-y-reverse)));margin-block-start:calc(var(--spacing)*4*var(--tw-space-y-reverse))}.truncate{text-overflow:ellipsis;white-space:nowrap}.overflow-hidden,.truncate{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.scroll-smooth{scroll-behavior:smooth}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\\[18px\\]{border-radius:18px}.rounded-\\[24px\\]{border-radius:24px}.rounded-\\[28px\\]{border-radius:28px}.rounded-full{border-radius:3.40282e+38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-none{border-radius:0}.rounded-xl{border-radius:var(--radius-xl)}.rounded-l-\\[4px\\]{border-bottom-left-radius:4px}.rounded-l-\\[4px\\],.rounded-tl-\\[4px\\]{border-top-left-radius:4px}.rounded-r-\\[4px\\]{border-bottom-right-radius:4px}.rounded-r-\\[4px\\],.rounded-tr-\\[4px\\]{border-top-right-radius:4px}.rounded-br-\\[4px\\]{border-bottom-right-radius:4px}.rounded-bl-\\[4px\\]{border-bottom-left-radius:4px}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-\\[hsl\\(210\\,90\\%\\,50\\%\\)\\]{border-color:#0d80f2}.border-blue-200{border-color:var(--color-blue-200)}.border-gray-200{border-color:var(--color-gray-200)}.border-green-200{border-color:var(--color-green-200)}.border-red-200{border-color:var(--color-red-200)}.border-yellow-300{border-color:var(--color-yellow-300)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\\/20{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.bg-black\\/5{background-color:#0000000d}@supports (color:color-mix(in lab,red,red)){.bg-black\\/5{background-color:color-mix(in oklab,var(--color-black)5%,transparent)}}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\\/70{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.bg-black\\/70{background-color:color-mix(in oklab,var(--color-black)70%,transparent)}}.bg-black\\/95{background-color:#000000f2}@supports (color:color-mix(in lab,red,red)){.bg-black\\/95{background-color:color-mix(in oklab,var(--color-black)95%,transparent)}}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-500\\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-current,.bg-current\\/20{background-color:currentColor}@supports (color:color-mix(in lab,red,red)){.bg-current\\/20{background-color:color-mix(in oklab,currentcolor 20%,transparent)}}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-500\\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\\/10{background-color:color-mix(in oklab,var(--color-emerald-500)10%,transparent)}}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-500\\/20{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.bg-gray-500\\/20{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.bg-green-50{background-color:var(--color-green-50)}.bg-green-500\\/10{background-color:#00c7581a}@supports (color:color-mix(in lab,red,red)){.bg-green-500\\/10{background-color:color-mix(in oklab,var(--color-green-500)10%,transparent)}}.bg-green-500\\/20{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.bg-green-500\\/20{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.bg-red-50{background-color:var(--color-red-50)}.bg-red-100{background-color:var(--color-red-100)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-500\\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\\/20{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.bg-white\\/10{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.bg-white\\/40{background-color:#fff6}@supports (color:color-mix(in lab,red,red)){.bg-white\\/40{background-color:color-mix(in oklab,var(--color-white)40%,transparent)}}.bg-white\\/80{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.bg-white\\/80{background-color:color-mix(in oklab,var(--color-white)80%,transparent)}}.bg-yellow-50{background-color:var(--color-yellow-50)}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab}.bg-gradient-to-b,.bg-gradient-to-br{background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-black\\/40{--tw-gradient-from:#0006}@supports (color:color-mix(in lab,red,red)){.from-black\\/40{--tw-gradient-from:color-mix(in oklab,var(--color-black)40%,transparent)}}.from-black\\/40{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-black\\/60{--tw-gradient-from:#0009}@supports (color:color-mix(in lab,red,red)){.from-black\\/60{--tw-gradient-from:color-mix(in oklab,var(--color-black)60%,transparent)}}.from-black\\/60{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.via-transparent{--tw-gradient-via:transparent;--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-black\\/20{--tw-gradient-to:#0003}@supports (color:color-mix(in lab,red,red)){.to-black\\/20{--tw-gradient-to:color-mix(in oklab,var(--color-black)20%,transparent)}}.to-black\\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.fill-current{fill:currentColor}.stroke-\\[2\\.5\\]{stroke-width:2.5px}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-1{padding:calc(var(--spacing)*1)}.p-1\\.5{padding:calc(var(--spacing)*1.5)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-10{padding-inline:calc(var(--spacing)*10)}.py-0\\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-16{padding-block:calc(var(--spacing)*16)}.pr-8{padding-right:calc(var(--spacing)*8)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.text-center{text-align:center}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[7px\\]{font-size:7px}.text-\\[8px\\]{font-size:8px}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.tracking-\\[0\\.1em\\]{--tw-tracking:.1em;letter-spacing:.1em}.tracking-\\[0\\.2em\\]{--tw-tracking:.2em;letter-spacing:.2em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-tighter{--tw-tracking:var(--tracking-tighter);letter-spacing:var(--tracking-tighter)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.text-amber-500{color:var(--color-amber-500)}.text-blue-500{color:var(--color-blue-500)}.text-blue-700{color:var(--color-blue-700)}.text-blue-900{color:var(--color-blue-900)}.text-emerald-500{color:var(--color-emerald-500)}.text-emerald-600{color:var(--color-emerald-600)}.text-gray-600{color:var(--color-gray-600)}.text-gray-800{color:var(--color-gray-800)}.text-green-500{color:var(--color-green-500)}.text-green-600{color:var(--color-green-600)}.text-green-700{color:var(--color-green-700)}.text-green-900{color:var(--color-green-900)}.text-purple-500{color:var(--color-purple-500)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-red-900{color:var(--color-red-900)}.text-white{color:var(--color-white)}.text-yellow-700{color:var(--color-yellow-700)}.text-yellow-900{color:var(--color-yellow-900)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-20{opacity:.2}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a)}.shadow,.shadow-inner{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 var(--tw-shadow-color,#0000000d)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a)}.shadow-lg,.shadow-md{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a)}.ring,.shadow-sm{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-\\[hsl\\(210\\,90\\%\\,50\\%\\)\\]\\/30{--tw-ring-color:oklab(60.6854% -.0507387 -.187037/.3)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px)}.blur,.blur-2xl{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-2xl{--tw-blur:blur(var(--blur-2xl))}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md))}.backdrop-blur-md,.backdrop-blur-sm{-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm))}.transition{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.transition-all{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.transition-colors{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.transition-opacity{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.transition-transform{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-400{--tw-duration:.4s;transition-duration:.4s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.duration-700{--tw-duration:.7s;transition-duration:.7s}.duration-1000{--tw-duration:1s;transition-duration:1s}.ease-\\[cubic-bezier\\(0\\.16\\,1\\,0\\.3\\,1\\)\\]{--tw-ease:cubic-bezier(.16,1,.3,1);transition-timing-function:cubic-bezier(.16,1,.3,1)}.ease-\\[cubic-bezier\\(0\\.34\\,1\\.56\\,0\\.64\\,1\\)\\]{--tw-ease:cubic-bezier(.34,1.56,.64,1);transition-timing-function:cubic-bezier(.34,1.56,.64,1)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.\\[animation-delay\\:-0\\.3s\\]{animation-delay:-.3s}.\\[animation-delay\\:-0\\.15s\\]{animation-delay:-.15s}@media(hover:hover){.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}}.last\\:mb-0:last-child{margin-bottom:calc(var(--spacing)*0)}@media(hover:hover){.hover\\:-translate-y-1:hover{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.hover\\:scale-105:hover{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x)var(--tw-scale-y)}.hover\\:scale-110:hover{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x)var(--tw-scale-y)}.hover\\:scale-\\[1\\.02\\]:hover{scale:1.02}.hover\\:rotate-6:hover{rotate:6deg}.hover\\:border-\\[hsl\\(210\\,90\\%\\,70\\%\\)\\]:hover{border-color:#6eb3f7}.hover\\:bg-emerald-500\\/20:hover{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-emerald-500\\/20:hover{background-color:color-mix(in oklab,var(--color-emerald-500)20%,transparent)}}.hover\\:bg-red-500\\/30:hover{background-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-red-500\\/30:hover{background-color:color-mix(in oklab,var(--color-red-500)30%,transparent)}}.hover\\:bg-red-600:hover{background-color:var(--color-red-600)}.hover\\:bg-white\\/20:hover{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/20:hover{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.hover\\:bg-white\\/60:hover{background-color:#fff9}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/60:hover{background-color:color-mix(in oklab,var(--color-white)60%,transparent)}}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-90:hover{opacity:.9}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\\:underline:focus{text-decoration-line:underline}.focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:ring-emerald-500:focus{--tw-ring-color:var(--color-emerald-500)}.focus\\:ring-red-500:focus{--tw-ring-color:var(--color-red-500)}.focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.active\\:scale-90:active{--tw-scale-x:90%;--tw-scale-y:90%;--tw-scale-z:90%;scale:var(--tw-scale-x)var(--tw-scale-y)}.active\\:scale-95:active{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x)var(--tw-scale-y)}.disabled\\:opacity-30:disabled{opacity:.3}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:grayscale:disabled{--tw-grayscale:grayscale(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}@media(min-width:40rem){.sm\\:h-8{height:calc(var(--spacing)*8)}.sm\\:h-16{height:calc(var(--spacing)*16)}.sm\\:w-8{width:calc(var(--spacing)*8)}.sm\\:w-16{width:calc(var(--spacing)*16)}.sm\\:w-auto{width:auto}}@media(prefers-color-scheme:dark){.dark\\:bg-black\\/80{background-color:#000c}@supports (color:color-mix(in lab,red,red)){.dark\\:bg-black\\/80{background-color:color-mix(in oklab,var(--color-black)80%,transparent)}}.dark\\:bg-white\\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.dark\\:bg-white\\/10{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}}}#botuyo-chat-widget-root .sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media(prefers-contrast:high){#botuyo-chat-widget-root{--border-width:2px;--focus-ring-width:3px;--focus-ring-color:hsl(var(--primary))}#botuyo-chat-widget-root [role=button],#botuyo-chat-widget-root [role=dialog],#botuyo-chat-widget-root button,#botuyo-chat-widget-root input,#botuyo-chat-widget-root textarea{border-width:var(--border-width)!important}#botuyo-chat-widget-root :focus-visible{outline:var(--focus-ring-width)solid var(--focus-ring-color)!important;outline-offset:2px!important}#botuyo-chat-widget-root{--foreground:0 0% 0%;--background:0 0% 100%;--muted-foreground:0 0% 20%}#botuyo-chat-widget-root.dark{--foreground:0 0% 100%;--background:0 0% 0%;--muted-foreground:0 0% 80%}#botuyo-chat-widget-root [class*=opacity-],#botuyo-chat-widget-root [style*=opacity]{opacity:1!important}}@media(prefers-reduced-motion:reduce){#botuyo-chat-widget-root *,#botuyo-chat-widget-root :after,#botuyo-chat-widget-root :before{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}#botuyo-chat-widget-root .animate-pulse,#botuyo-chat-widget-root [data-state=closed],#botuyo-chat-widget-root [data-state=open]{animation:none!important}#botuyo-chat-widget-root .scroll-smooth{scroll-behavior:auto!important}}#botuyo-chat-widget-root :focus-visible{border-radius:var(--radius,.5rem);outline:2px solid hsl(var(--primary));outline-offset:2px}#botuyo-chat-widget-root [role=button]:focus-visible,#botuyo-chat-widget-root button:focus-visible{box-shadow:0 0 0 4px hsl(var(--primary)/.1);outline:2px solid hsl(var(--primary));outline-offset:2px}#botuyo-chat-widget-root input:focus-visible,#botuyo-chat-widget-root textarea:focus-visible{border-color:hsl(var(--primary));box-shadow:0 0 0 3px hsl(var(--primary)/.1);outline:2px solid hsl(var(--primary));outline-offset:0}#botuyo-chat-widget-root .skip-link{background:hsl(var(--primary));border-radius:0 0 4px;color:hsl(var(--primary-foreground));left:0;padding:8px;position:absolute;text-decoration:none;top:-40px;z-index:100000}#botuyo-chat-widget-root .skip-link:focus{top:0}@media(prefers-color-scheme:dark)and (prefers-contrast:high){#botuyo-chat-widget-root{--primary:48 96% 89%;--destructive:0 84% 60%;--success:142 76% 36%}}#botuyo-chat-widget-root [data-state]:after{content:attr(data-state);clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media(min-resolution:192dpi){#botuyo-chat-widget-root{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility}}#botuyo-chat-widget-root [data-tooltip]:focus:after,#botuyo-chat-widget-root [data-tooltip]:hover:after{background:hsl(var(--popover));border-radius:4px;bottom:100%;color:hsl(var(--popover-foreground));content:attr(data-tooltip);font-size:12px;left:50%;padding:4px 8px;pointer-events:none;position:absolute;transform:translate(-50%);white-space:nowrap;z-index:1000}#botuyo-chat-widget-root [aria-live=assertive],#botuyo-chat-widget-root [aria-live=polite]{position:relative}@keyframes live-region-update{0%{opacity:.8}to{opacity:1}}#botuyo-chat-widget-root [aria-live]:not([aria-atomic=false]):has(:new){animation:live-region-update .2s ease-in-out}#botuyo-chat-widget-root .scrollbar-none{scrollbar-width:none;-ms-overflow-style:none}#botuyo-chat-widget-root .scrollbar-none::-webkit-scrollbar{display:none;height:0;width:0}#botuyo-chat-widget-root .scrollbar-thin{scrollbar-width:thin}#botuyo-chat-widget-root .scrollbar-thin::-webkit-scrollbar{height:4px;width:4px}#botuyo-chat-widget-root .scrollbar-thin::-webkit-scrollbar-track{background:0 0}#botuyo-chat-widget-root .scrollbar-thin::-webkit-scrollbar-thumb{background:hsl(var(--border));border-radius:2px}#botuyo-chat-widget-root .scrollbar-thin::-webkit-scrollbar-thumb:hover{background:hsl(var(--muted-foreground)/.5)}#botuyo-chat-widget-root .hidden{display:none!important}#botuyo-chat-widget-root .block{display:block!important}#botuyo-chat-widget-root .flex{display:flex!important}#botuyo-chat-widget-root .inline-flex{display:inline-flex!important}#botuyo-chat-widget-root .grid{display:grid!important}#botuyo-chat-widget-root .flex-row{flex-direction:row!important}#botuyo-chat-widget-root .flex-col{flex-direction:column!important}#botuyo-chat-widget-root .flex-1{flex:1!important}#botuyo-chat-widget-root .flex-none{flex:none!important}#botuyo-chat-widget-root .shrink-0{flex-shrink:0!important}#botuyo-chat-widget-root .grow{flex-grow:1!important}#botuyo-chat-widget-root .items-center{align-items:center!important}#botuyo-chat-widget-root .items-start{align-items:flex-start!important}#botuyo-chat-widget-root .items-end{align-items:flex-end!important}#botuyo-chat-widget-root .justify-center{justify-content:center!important}#botuyo-chat-widget-root .justify-between{justify-content:space-between!important}#botuyo-chat-widget-root .justify-end{justify-content:flex-end!important}#botuyo-chat-widget-root .relative{position:relative!important}#botuyo-chat-widget-root .absolute{position:absolute!important}#botuyo-chat-widget-root .fixed{position:fixed!important}#botuyo-chat-widget-root .inset-0{inset:0!important}#botuyo-chat-widget-root .w-full{width:100%!important}#botuyo-chat-widget-root .h-full{height:100%!important}#botuyo-chat-widget-root .w-fit{width:-moz-fit-content!important;width:fit-content!important}#botuyo-chat-widget-root .w-auto{width:auto!important}#botuyo-chat-widget-root .h-auto{height:auto!important}#botuyo-chat-widget-root .h-0{height:0!important}#botuyo-chat-widget-root .w-0{width:0!important}#botuyo-chat-widget-root .h-6{height:1.5rem!important}#botuyo-chat-widget-root .w-6{width:1.5rem!important}#botuyo-chat-widget-root .h-7{height:1.75rem!important}#botuyo-chat-widget-root .w-7{width:1.75rem!important}#botuyo-chat-widget-root .h-8{height:2rem!important}#botuyo-chat-widget-root .w-8{width:2rem!important}#botuyo-chat-widget-root .h-14{height:3.5rem!important}#botuyo-chat-widget-root .w-14{width:3.5rem!important}#botuyo-chat-widget-root .min-h-0{min-height:0!important}#botuyo-chat-widget-root .min-w-0{min-width:0!important}#botuyo-chat-widget-root .overflow-hidden{overflow:hidden!important}#botuyo-chat-widget-root .overflow-auto{overflow:auto!important}#botuyo-chat-widget-root .overflow-y-auto{overflow-y:auto!important}#botuyo-chat-widget-root .gap-1{gap:.25rem!important}#botuyo-chat-widget-root .gap-2{gap:.5rem!important}#botuyo-chat-widget-root .gap-3{gap:.75rem!important}#botuyo-chat-widget-root .gap-4{gap:1rem!important}#botuyo-chat-widget-root .p-1{padding:.25rem!important}#botuyo-chat-widget-root .p-2{padding:.5rem!important}#botuyo-chat-widget-root .p-3{padding:.75rem!important}#botuyo-chat-widget-root .p-4{padding:1rem!important}#botuyo-chat-widget-root .px-4{padding-left:1rem!important;padding-right:1rem!important}#botuyo-chat-widget-root .py-2{padding-bottom:.5rem!important;padding-top:.5rem!important}#botuyo-chat-widget-root .m-0{margin:0!important}#botuyo-chat-widget-root .mt-2{margin-top:.5rem!important}#botuyo-chat-widget-root .mt-4{margin-top:1rem!important}#botuyo-chat-widget-root .mb-2{margin-bottom:.5rem!important}#botuyo-chat-widget-root .ml-auto{margin-left:auto!important}#botuyo-chat-widget-root .rounded{border-radius:.25rem!important}#botuyo-chat-widget-root .rounded-lg{border-radius:.5rem!important}#botuyo-chat-widget-root .rounded-xl{border-radius:.75rem!important}#botuyo-chat-widget-root .rounded-2xl{border-radius:1rem!important}#botuyo-chat-widget-root .rounded-full{border-radius:9999px!important}#botuyo-chat-widget-root .text-xs{font-size:.75rem!important;line-height:1rem!important}#botuyo-chat-widget-root .text-sm{font-size:.875rem!important;line-height:1.25rem!important}#botuyo-chat-widget-root .text-base{font-size:1rem!important;line-height:1.5rem!important}#botuyo-chat-widget-root .text-lg{font-size:1.125rem!important;line-height:1.75rem!important}#botuyo-chat-widget-root .font-medium{font-weight:500!important}#botuyo-chat-widget-root .font-semibold{font-weight:600!important}#botuyo-chat-widget-root .font-bold{font-weight:700!important}#botuyo-chat-widget-root .font-black{font-weight:900!important}#botuyo-chat-widget-root .uppercase{text-transform:uppercase!important}#botuyo-chat-widget-root .truncate{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}#botuyo-chat-widget-root .text-foreground{color:hsl(var(--foreground))!important}#botuyo-chat-widget-root .text-muted-foreground{color:hsl(var(--muted-foreground))!important}#botuyo-chat-widget-root .text-primary{color:hsl(var(--primary))!important}#botuyo-chat-widget-root .text-primary-foreground{color:hsl(var(--primary-foreground))!important}#botuyo-chat-widget-root .text-destructive{color:hsl(var(--destructive))!important}#botuyo-chat-widget-root .text-white{color:#fff!important}#botuyo-chat-widget-root .bg-background{background-color:hsl(var(--background))!important}#botuyo-chat-widget-root .bg-muted{background-color:hsl(var(--muted))!important}#botuyo-chat-widget-root .bg-primary{background-color:hsl(var(--primary))!important}#botuyo-chat-widget-root .bg-card{background-color:hsl(var(--card))!important}#botuyo-chat-widget-root .bg-transparent{background-color:#0000!important}#botuyo-chat-widget-root .border{border-width:1px!important}#botuyo-chat-widget-root .border-2{border-width:2px!important}#botuyo-chat-widget-root .border-b{border-bottom-width:1px!important}#botuyo-chat-widget-root .border-t{border-top-width:1px!important}#botuyo-chat-widget-root .border-border{border-color:hsl(var(--border))!important}#botuyo-chat-widget-root .shadow{box-shadow:0 1px 3px #0000001a,0 1px 2px -1px #0000001a!important}#botuyo-chat-widget-root .shadow-lg{box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a!important}#botuyo-chat-widget-root .shadow-xl{box-shadow:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a!important}#botuyo-chat-widget-root .transition{transition-duration:.15s!important;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important}#botuyo-chat-widget-root .transition-all{transition-duration:.15s!important;transition-property:all!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important}#botuyo-chat-widget-root .duration-300{transition-duration:.3s!important}#botuyo-chat-widget-root .duration-500{transition-duration:.5s!important}#botuyo-chat-widget-root .opacity-0{opacity:0!important}#botuyo-chat-widget-root .opacity-100{opacity:1!important}#botuyo-chat-widget-root .scale-95{transform:scale(.95)!important}#botuyo-chat-widget-root .scale-100{transform:scale(1)!important}#botuyo-chat-widget-root .translate-y-full{transform:translateY(100%)!important}#botuyo-chat-widget-root .z-10{z-index:10!important}#botuyo-chat-widget-root .z-20{z-index:20!important}#botuyo-chat-widget-root .z-50{z-index:50!important}#botuyo-chat-widget-root .pointer-events-none{pointer-events:none!important}#botuyo-chat-widget-root .pointer-events-auto{pointer-events:auto!important}#botuyo-chat-widget-root .cursor-pointer{cursor:pointer!important}#botuyo-chat-widget-root .select-none{-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}@keyframes spin{to{transform:rotate(1turn)}}#botuyo-chat-widget,#botuyo-chat-widget-root,:root{--background:0 0% 100%;--foreground:240 10% 3.9%;--card:0 0% 100%;--card-foreground:240 10% 3.9%;--popover:0 0% 100%;--popover-foreground:240 10% 3.9%;--primary:160 84% 39%;--primary-foreground:0 0% 100%;--muted:240 4.8% 95.9%;--muted-foreground:240 3.8% 46.1%;--accent:240 4.8% 95.9%;--accent-foreground:240 5.9% 10%;--destructive:0 84.2% 60.2%;--destructive-foreground:0 0% 98%;--border:240 5.9% 90%;--input:240 5.9% 90%;--ring:160 84% 39%;--radius:.5rem;--spacing-1:.25rem;--spacing-2:.5rem;--spacing-3:.75rem;--spacing-4:1rem;--spacing-5:.75rem;--spacing-6:1.5rem;--spacing-7:1.75rem;--spacing-8:2rem;--window-border-radius:24px;--launcher-border-radius:50%;--window-height:700px;--window-bottom:24px}#botuyo-chat-widget-root.dark,#botuyo-chat-widget.dark,.dark{--background:240 10% 3.9%;--foreground:0 0% 98%;--card:240 10% 3.9%;--card-foreground:0 0% 98%;--popover:240 10% 3.9%;--popover-foreground:0 0% 98%;--primary:160 84% 39%;--primary-foreground:0 0% 100%;--muted:240 3.7% 15.9%;--muted-foreground:240 5% 64.9%;--accent:240 3.7% 15.9%;--accent-foreground:0 0% 98%;--destructive:0 62.8% 30.6%;--destructive-foreground:0 0% 98%;--border:240 3.7% 15.9%;--input:240 3.7% 15.9%;--ring:160 84% 39%}#botuyo-chat-widget-root,#botuyo-chat-widget-root *{box-sizing:border-box;margin:0;padding:0}#botuyo-chat-widget-root{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:hsl(var(--foreground));font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;line-height:1.5}@keyframes slideInRight{0%{opacity:0;transform:translate(100%)}to{opacity:1;transform:translate(0)}}@keyframes slideOutRight{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(100%)}}@keyframes slideInUp{0%{opacity:0;transform:translateY(100%)}to{opacity:1;transform:translateY(0)}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes pulse{50%{opacity:.5}}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}#botuyo-chat-widget-root .chat-launcher{align-items:center;background-color:hsl(var(--primary));border-radius:50%;bottom:1.5rem;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a;color:#fff;cursor:pointer;display:flex;height:60px;justify-content:center;position:fixed;right:1.5rem;transition:all .2s;width:60px;z-index:999999}#botuyo-chat-widget-root .chat-launcher:hover{box-shadow:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a;transform:scale(1.05)}#botuyo-chat-widget-root .chat-launcher.position-bottom-left{left:1.5rem;right:auto}#botuyo-chat-widget-root .chat-launcher.position-top-right{bottom:auto;top:1.5rem}#botuyo-chat-widget-root .chat-launcher.position-top-left{inset:1.5rem auto auto 1.5rem}#botuyo-chat-widget-root .chat-window{animation:slideInRight .3s ease-out;background-color:hsl(var(--background));border-radius:1rem;bottom:6rem;box-shadow:0 25px 50px -12px #00000040;display:flex;flex-direction:column;height:600px;max-height:calc(100vh - 8rem);overflow:hidden;position:fixed;right:1.5rem;width:400px;z-index:999999}#botuyo-chat-widget-root .chat-window.closing{animation:slideOutRight .2s ease-in}@media(max-width:640px){#botuyo-chat-widget-root .chat-window{animation:slideInUp .3s ease-out;border-radius:0;height:100%;inset:0;max-height:100vh;width:100%}}#botuyo-chat-widget-root .message-bubble{word-wrap:break-word;border-radius:1rem;max-width:80%;padding:.75rem 1rem}#botuyo-chat-widget-root .message-bubble.user{background-color:hsl(var(--primary));color:hsl(var(--primary-foreground));margin-left:auto}#botuyo-chat-widget-root .message-bubble.bot{background-color:hsl(var(--muted));color:hsl(var(--foreground))}#botuyo-chat-widget-root .chat-messages::-webkit-scrollbar{width:6px}#botuyo-chat-widget-root .chat-messages::-webkit-scrollbar-track{background:0 0}#botuyo-chat-widget-root .chat-messages::-webkit-scrollbar-thumb{background:hsl(var(--muted));border-radius:3px}#botuyo-chat-widget-root .chat-messages::-webkit-scrollbar-thumb:hover{background:hsl(var(--muted-foreground))}#botuyo-chat-widget-root .chat-input{background-color:hsl(var(--background));border:1px solid hsl(var(--border));border-radius:.5rem;color:hsl(var(--foreground));outline:none;padding:.75rem;transition:border-color .2s;width:100%}#botuyo-chat-widget-root .chat-input:focus{border-color:hsl(var(--primary));box-shadow:0 0 0 3px hsl(var(--primary)/.1)}@media(max-width:640px){#botuyo-chat-widget-root .chat-launcher{bottom:1rem;height:56px;right:1rem;width:56px}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}';function P({isOpen:t,onClick:e,unreadCount:i=0,primaryColor:s,logoUrl:c,starterPrompt:d,position:l="bottom-right",emotion:u="default",avatars:p={},styles:k,promptPersistence:_="session",avatarScale:z=1,showPromptAvatar:E=!1}){const{t:S}=h("extracted"),O=g({primaryColor:s}),I=k?.launcher?.bg,$=m(),{triggerHaptic:C,getGlowClass:M}=f(),A=$.launcherPulse&&!1!==k?.launcher?.pulse,[j,P]=r(!1),[D,Z]=r(!1),[F,U]=r(!1),[L,R]=r(!1),B="bottom-right"===l,W="chat_launcher_prompt_state",J=o(()=>p[u]||p.default||c||w,[u,p,c]);n(()=>{R(!1)},[J]),n(()=>{const t=Object.values(p).filter(t=>!!t);c&&t.push(c),t.forEach(t=>{(new Image).src=t})},[p,c]),n(()=>{"forever"===_&&"dismissed"===localStorage.getItem(W)&&U(!0)},[_]);const V=a(()=>{Z(!0),setTimeout(()=>P(!1),500),"always"!==_&&(U(!0),"forever"===_&&localStorage.setItem(W,"dismissed"))},[_]);n(()=>{if("always"!==_&&F||!d||t)return void P(!1);const e=setTimeout(()=>{P(!0),Z(!1)},2e3),r=setTimeout(()=>V(),12e3);return()=>{clearTimeout(e),clearTimeout(r)}},[d,t,F,_,V]);const q=()=>{x.debug("Launcher handleMainAction called, isOpen:",t),C(),U(!0),"forever"===_&&localStorage.setItem(W,"dismissed"),e()};/* @__PURE__ */
|
|
1
|
+
import{createRoot as t}from"react-dom/client";import e,{useState as r,useMemo as o,useEffect as n,useCallback as a,Component as i,useReducer as s,useRef as c,createContext as d,useContext as l,lazy as u,Suspense as p}from"react";import{u as h,g,e as m,f,D as w,c as b,X as y,M as v,l as x,m as k,t as _,h as z,i as E,j as S,k as O,n as I,o as $}from"./chunk-chat-ui-C3MpSoay.js";import{p as C}from"./chunk-chat-ui-C3MpSoay.js";import{jsxs as N,jsx as T}from"react/jsx-runtime";import{l as M}from"./vendor-socket-DMqyM-90.js";import{createPortal as A}from"react-dom";const j='@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:host,:root{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-900:oklch(39.6% .141 25.723);--color-amber-500:oklch(76.9% .188 70.08);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-300:oklch(90.5% .182 98.111);--color-yellow-700:oklch(55.4% .135 66.442);--color-yellow-900:oklch(42.1% .095 57.708);--color-green-50:oklch(98.2% .018 155.826);--color-green-200:oklch(92.5% .084 155.995);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-green-900:oklch(39.3% .095 152.535);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-blue-50:oklch(97% .014 254.604);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-900:oklch(37.9% .146 265.522);--color-purple-500:oklch(62.7% .265 303.9);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--text-xs:.75rem;--text-xs--line-height:1.33333;--text-sm:.875rem;--text-sm--line-height:1.42857;--text-base:1rem;--text-base--line-height:1.5;--text-lg:1.125rem;--text-lg--line-height:1.55556;--text-xl:1.25rem;--text-xl--line-height:1.4;--text-2xl:1.5rem;--text-2xl--line-height:1.33333;--text-3xl:1.875rem;--text-3xl--line-height:1.2;--text-4xl:2.25rem;--text-4xl--line-height:1.11111;--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-medium:500;--font-weight-bold:700;--font-weight-black:900;--tracking-tighter:-.05em;--tracking-tight:-.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0,0,.2,1)infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--animate-bounce:bounce 1s infinite;--blur-sm:8px;--blur-md:12px;--blur-2xl:40px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{border:0 solid;box-sizing:border-box;margin:0;padding:0}:host,html{-webkit-text-size-adjust:100%;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}button,input,optgroup,select,textarea{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}::file-selector-button{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance:-apple-pay-button)) or (contain-intrinsic-size:1px){::-moz-placeholder{color:currentColor}::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::-moz-placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{border-width:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;white-space:nowrap;width:1px}.absolute,.sr-only{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing)*0)}.-top-1{top:calc(var(--spacing)*-1)}.-top-1\\.5{top:calc(var(--spacing)*-1.5)}.top-0{top:calc(var(--spacing)*0)}.top-1\\/2{top:50%}.top-2{top:calc(var(--spacing)*2)}.top-3{top:calc(var(--spacing)*3)}.top-4{top:calc(var(--spacing)*4)}.top-full{top:100%}.-right-0\\.5{right:calc(var(--spacing)*-.5)}.-right-1{right:calc(var(--spacing)*-1)}.-right-1\\.5{right:calc(var(--spacing)*-1.5)}.right-0{right:calc(var(--spacing)*0)}.right-2{right:calc(var(--spacing)*2)}.right-3{right:calc(var(--spacing)*3)}.right-4{right:calc(var(--spacing)*4)}.right-6{right:calc(var(--spacing)*6)}.-bottom-0\\.5{bottom:calc(var(--spacing)*-.5)}.-bottom-1{bottom:calc(var(--spacing)*-1)}.bottom-3{bottom:calc(var(--spacing)*3)}.bottom-4{bottom:calc(var(--spacing)*4)}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing)*0)}.left-1\\/2{left:50%}.left-4{left:calc(var(--spacing)*4)}.left-6{left:calc(var(--spacing)*6)}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\\[60\\]{z-index:60}.z-\\[9999\\]{z-index:9999}.z-\\[100000\\]{z-index:100000}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:calc(var(--spacing)*1)}.my-2{margin-block:calc(var(--spacing)*2)}.my-3{margin-block:calc(var(--spacing)*3)}.my-4{margin-block:calc(var(--spacing)*4)}.my-8{margin-block:calc(var(--spacing)*8)}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\\.5{margin-top:calc(var(--spacing)*1.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-3{margin-right:calc(var(--spacing)*3)}.mr-auto{margin-right:auto}.mb-0{margin-bottom:calc(var(--spacing)*0)}.mb-0\\.5{margin-bottom:calc(var(--spacing)*.5)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.ml-0\\.5{margin-left:calc(var(--spacing)*.5)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-3{margin-left:calc(var(--spacing)*3)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-0{height:calc(var(--spacing)*0)}.h-1{height:calc(var(--spacing)*1)}.h-2{height:calc(var(--spacing)*2)}.h-2\\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-3\\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-14{height:calc(var(--spacing)*14)}.h-16{height:calc(var(--spacing)*16)}.h-20{height:calc(var(--spacing)*20)}.h-24{height:calc(var(--spacing)*24)}.h-32{height:calc(var(--spacing)*32)}.h-48{height:calc(var(--spacing)*48)}.h-56{height:calc(var(--spacing)*56)}.h-\\[44px\\]{height:44px}.h-auto{height:auto}.h-full{height:100%}.max-h-\\[85\\%\\]{max-height:85%}.max-h-\\[120px\\]{max-height:120px}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-\\[40px\\]{min-height:40px}.min-h-full{min-height:100%}.w-0{width:calc(var(--spacing)*0)}.w-1{width:calc(var(--spacing)*1)}.w-2{width:calc(var(--spacing)*2)}.w-2\\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-3\\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-7{width:calc(var(--spacing)*7)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-14{width:calc(var(--spacing)*14)}.w-16{width:calc(var(--spacing)*16)}.w-20{width:calc(var(--spacing)*20)}.w-24{width:calc(var(--spacing)*24)}.w-\\[3px\\]{width:3px}.w-\\[calc\\(100\\%-0\\.5rem\\)\\]{width:calc(100% - .5rem)}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.max-w-0{max-width:calc(var(--spacing)*0)}.max-w-\\[60px\\]{max-width:60px}.max-w-\\[85\\%\\]{max-width:85%}.max-w-\\[90\\%\\]{max-width:90%}.max-w-\\[320px\\]{max-width:320px}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.max-w-none{max-width:none}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\\[200px\\]{min-width:200px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.origin-bottom{transform-origin:bottom}.origin-bottom-left{transform-origin:0 100%}.origin-bottom-right{transform-origin:100% 100%}.-translate-x-1\\/2{--tw-translate-x:-50%}.-translate-x-1\\/2,.-translate-x-6{translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-x-6{--tw-translate-x:calc(var(--spacing)*-6)}.translate-x-0{--tw-translate-x:calc(var(--spacing)*0)}.translate-x-0,.translate-x-6{translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-6{--tw-translate-x:calc(var(--spacing)*6)}.-translate-y-1\\/2{--tw-translate-y:-50%}.-translate-y-1\\/2,.translate-y-0{translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-0{--tw-translate-y:calc(var(--spacing)*0)}.translate-y-2{--tw-translate-y:calc(var(--spacing)*2)}.translate-y-2,.translate-y-8{translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-8{--tw-translate-y:calc(var(--spacing)*8)}.scale-50{--tw-scale-x:50%;--tw-scale-y:50%;--tw-scale-z:50%}.scale-50,.scale-90{scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-90{--tw-scale-x:90%;--tw-scale-y:90%;--tw-scale-z:90%}.scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%}.scale-100,.scale-105{scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-105{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%}.scale-110{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%}.scale-110,.scale-125{scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-125{--tw-scale-x:125%;--tw-scale-y:125%;--tw-scale-z:125%}.scale-\\[0\\.85\\]{scale:.85}.-rotate-90{rotate:-90deg}.rotate-0{rotate:none}.rotate-45{rotate:45deg}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-bounce{animation:var(--animate-bounce)}.animate-ping{animation:var(--animate-ping)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.cursor-wait{cursor:wait}.resize{resize:both}.resize-none{resize:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-8{gap:calc(var(--spacing)*8)}.gap-\\[2px\\]{gap:2px}.gap-\\[3px\\]{gap:3px}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-end:calc(var(--spacing)*1*(1 - var(--tw-space-y-reverse)));margin-block-start:calc(var(--spacing)*1*var(--tw-space-y-reverse))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-end:calc(var(--spacing)*2*(1 - var(--tw-space-y-reverse)));margin-block-start:calc(var(--spacing)*2*var(--tw-space-y-reverse))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-end:calc(var(--spacing)*4*(1 - var(--tw-space-y-reverse)));margin-block-start:calc(var(--spacing)*4*var(--tw-space-y-reverse))}.truncate{text-overflow:ellipsis;white-space:nowrap}.overflow-hidden,.truncate{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.scroll-smooth{scroll-behavior:smooth}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\\[18px\\]{border-radius:18px}.rounded-\\[24px\\]{border-radius:24px}.rounded-\\[28px\\]{border-radius:28px}.rounded-full{border-radius:3.40282e+38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-none{border-radius:0}.rounded-xl{border-radius:var(--radius-xl)}.rounded-l-\\[4px\\]{border-bottom-left-radius:4px}.rounded-l-\\[4px\\],.rounded-tl-\\[4px\\]{border-top-left-radius:4px}.rounded-r-\\[4px\\]{border-bottom-right-radius:4px}.rounded-r-\\[4px\\],.rounded-tr-\\[4px\\]{border-top-right-radius:4px}.rounded-br-\\[4px\\]{border-bottom-right-radius:4px}.rounded-bl-\\[4px\\]{border-bottom-left-radius:4px}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-\\[hsl\\(210\\,90\\%\\,50\\%\\)\\]{border-color:#0d80f2}.border-blue-200{border-color:var(--color-blue-200)}.border-gray-200{border-color:var(--color-gray-200)}.border-green-200{border-color:var(--color-green-200)}.border-red-200{border-color:var(--color-red-200)}.border-yellow-300{border-color:var(--color-yellow-300)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\\/20{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.bg-black\\/5{background-color:#0000000d}@supports (color:color-mix(in lab,red,red)){.bg-black\\/5{background-color:color-mix(in oklab,var(--color-black)5%,transparent)}}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\\/70{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.bg-black\\/70{background-color:color-mix(in oklab,var(--color-black)70%,transparent)}}.bg-black\\/95{background-color:#000000f2}@supports (color:color-mix(in lab,red,red)){.bg-black\\/95{background-color:color-mix(in oklab,var(--color-black)95%,transparent)}}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-500\\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-current,.bg-current\\/20{background-color:currentColor}@supports (color:color-mix(in lab,red,red)){.bg-current\\/20{background-color:color-mix(in oklab,currentcolor 20%,transparent)}}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-500\\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\\/10{background-color:color-mix(in oklab,var(--color-emerald-500)10%,transparent)}}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-500\\/20{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.bg-gray-500\\/20{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.bg-green-50{background-color:var(--color-green-50)}.bg-green-500\\/10{background-color:#00c7581a}@supports (color:color-mix(in lab,red,red)){.bg-green-500\\/10{background-color:color-mix(in oklab,var(--color-green-500)10%,transparent)}}.bg-green-500\\/20{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.bg-green-500\\/20{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.bg-red-50{background-color:var(--color-red-50)}.bg-red-100{background-color:var(--color-red-100)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-500\\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\\/20{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.bg-white\\/10{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.bg-white\\/40{background-color:#fff6}@supports (color:color-mix(in lab,red,red)){.bg-white\\/40{background-color:color-mix(in oklab,var(--color-white)40%,transparent)}}.bg-white\\/80{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.bg-white\\/80{background-color:color-mix(in oklab,var(--color-white)80%,transparent)}}.bg-yellow-50{background-color:var(--color-yellow-50)}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab}.bg-gradient-to-b,.bg-gradient-to-br{background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-black\\/40{--tw-gradient-from:#0006}@supports (color:color-mix(in lab,red,red)){.from-black\\/40{--tw-gradient-from:color-mix(in oklab,var(--color-black)40%,transparent)}}.from-black\\/40{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-black\\/60{--tw-gradient-from:#0009}@supports (color:color-mix(in lab,red,red)){.from-black\\/60{--tw-gradient-from:color-mix(in oklab,var(--color-black)60%,transparent)}}.from-black\\/60{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.via-transparent{--tw-gradient-via:transparent;--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-black\\/20{--tw-gradient-to:#0003}@supports (color:color-mix(in lab,red,red)){.to-black\\/20{--tw-gradient-to:color-mix(in oklab,var(--color-black)20%,transparent)}}.to-black\\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.fill-current{fill:currentColor}.stroke-\\[2\\.5\\]{stroke-width:2.5px}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-1{padding:calc(var(--spacing)*1)}.p-1\\.5{padding:calc(var(--spacing)*1.5)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-10{padding-inline:calc(var(--spacing)*10)}.py-0\\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-16{padding-block:calc(var(--spacing)*16)}.pr-8{padding-right:calc(var(--spacing)*8)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.text-center{text-align:center}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[7px\\]{font-size:7px}.text-\\[8px\\]{font-size:8px}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.tracking-\\[0\\.1em\\]{--tw-tracking:.1em;letter-spacing:.1em}.tracking-\\[0\\.2em\\]{--tw-tracking:.2em;letter-spacing:.2em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-tighter{--tw-tracking:var(--tracking-tighter);letter-spacing:var(--tracking-tighter)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.text-amber-500{color:var(--color-amber-500)}.text-blue-500{color:var(--color-blue-500)}.text-blue-700{color:var(--color-blue-700)}.text-blue-900{color:var(--color-blue-900)}.text-emerald-500{color:var(--color-emerald-500)}.text-emerald-600{color:var(--color-emerald-600)}.text-gray-600{color:var(--color-gray-600)}.text-gray-800{color:var(--color-gray-800)}.text-green-500{color:var(--color-green-500)}.text-green-600{color:var(--color-green-600)}.text-green-700{color:var(--color-green-700)}.text-green-900{color:var(--color-green-900)}.text-purple-500{color:var(--color-purple-500)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-red-900{color:var(--color-red-900)}.text-white{color:var(--color-white)}.text-yellow-700{color:var(--color-yellow-700)}.text-yellow-900{color:var(--color-yellow-900)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-20{opacity:.2}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a)}.shadow,.shadow-inner{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 var(--tw-shadow-color,#0000000d)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a)}.shadow-lg,.shadow-md{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a)}.ring,.shadow-sm{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-\\[hsl\\(210\\,90\\%\\,50\\%\\)\\]\\/30{--tw-ring-color:oklab(60.6854% -.0507387 -.187037/.3)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px)}.blur,.blur-2xl{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-2xl{--tw-blur:blur(var(--blur-2xl))}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md))}.backdrop-blur-md,.backdrop-blur-sm{-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm))}.transition{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.transition-all{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.transition-colors{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.transition-opacity{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.transition-transform{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-400{--tw-duration:.4s;transition-duration:.4s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.duration-700{--tw-duration:.7s;transition-duration:.7s}.duration-1000{--tw-duration:1s;transition-duration:1s}.ease-\\[cubic-bezier\\(0\\.16\\,1\\,0\\.3\\,1\\)\\]{--tw-ease:cubic-bezier(.16,1,.3,1);transition-timing-function:cubic-bezier(.16,1,.3,1)}.ease-\\[cubic-bezier\\(0\\.34\\,1\\.56\\,0\\.64\\,1\\)\\]{--tw-ease:cubic-bezier(.34,1.56,.64,1);transition-timing-function:cubic-bezier(.34,1.56,.64,1)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.\\[animation-delay\\:-0\\.3s\\]{animation-delay:-.3s}.\\[animation-delay\\:-0\\.15s\\]{animation-delay:-.15s}@media(hover:hover){.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}}.last\\:mb-0:last-child{margin-bottom:calc(var(--spacing)*0)}@media(hover:hover){.hover\\:-translate-y-1:hover{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.hover\\:scale-105:hover{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x)var(--tw-scale-y)}.hover\\:scale-110:hover{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x)var(--tw-scale-y)}.hover\\:scale-\\[1\\.02\\]:hover{scale:1.02}.hover\\:rotate-6:hover{rotate:6deg}.hover\\:border-\\[hsl\\(210\\,90\\%\\,70\\%\\)\\]:hover{border-color:#6eb3f7}.hover\\:bg-emerald-500\\/20:hover{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-emerald-500\\/20:hover{background-color:color-mix(in oklab,var(--color-emerald-500)20%,transparent)}}.hover\\:bg-red-500\\/30:hover{background-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-red-500\\/30:hover{background-color:color-mix(in oklab,var(--color-red-500)30%,transparent)}}.hover\\:bg-red-600:hover{background-color:var(--color-red-600)}.hover\\:bg-white\\/20:hover{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/20:hover{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.hover\\:bg-white\\/60:hover{background-color:#fff9}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/60:hover{background-color:color-mix(in oklab,var(--color-white)60%,transparent)}}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-90:hover{opacity:.9}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\\:underline:focus{text-decoration-line:underline}.focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:ring-emerald-500:focus{--tw-ring-color:var(--color-emerald-500)}.focus\\:ring-red-500:focus{--tw-ring-color:var(--color-red-500)}.focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.active\\:scale-90:active{--tw-scale-x:90%;--tw-scale-y:90%;--tw-scale-z:90%;scale:var(--tw-scale-x)var(--tw-scale-y)}.active\\:scale-95:active{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x)var(--tw-scale-y)}.disabled\\:opacity-30:disabled{opacity:.3}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:grayscale:disabled{--tw-grayscale:grayscale(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}@media(min-width:40rem){.sm\\:h-8{height:calc(var(--spacing)*8)}.sm\\:h-16{height:calc(var(--spacing)*16)}.sm\\:w-8{width:calc(var(--spacing)*8)}.sm\\:w-16{width:calc(var(--spacing)*16)}.sm\\:w-auto{width:auto}}@media(prefers-color-scheme:dark){.dark\\:bg-black\\/80{background-color:#000c}@supports (color:color-mix(in lab,red,red)){.dark\\:bg-black\\/80{background-color:color-mix(in oklab,var(--color-black)80%,transparent)}}.dark\\:bg-white\\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.dark\\:bg-white\\/10{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}}}#botuyo-chat-widget-root .sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media(prefers-contrast:high){#botuyo-chat-widget-root{--border-width:2px;--focus-ring-width:3px;--focus-ring-color:hsl(var(--primary))}#botuyo-chat-widget-root [role=button],#botuyo-chat-widget-root [role=dialog],#botuyo-chat-widget-root button,#botuyo-chat-widget-root input,#botuyo-chat-widget-root textarea{border-width:var(--border-width)!important}#botuyo-chat-widget-root :focus-visible{outline:var(--focus-ring-width)solid var(--focus-ring-color)!important;outline-offset:2px!important}#botuyo-chat-widget-root{--foreground:0 0% 0%;--background:0 0% 100%;--muted-foreground:0 0% 20%}#botuyo-chat-widget-root.dark{--foreground:0 0% 100%;--background:0 0% 0%;--muted-foreground:0 0% 80%}#botuyo-chat-widget-root [class*=opacity-],#botuyo-chat-widget-root [style*=opacity]{opacity:1!important}}@media(prefers-reduced-motion:reduce){#botuyo-chat-widget-root *,#botuyo-chat-widget-root :after,#botuyo-chat-widget-root :before{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}#botuyo-chat-widget-root .animate-pulse,#botuyo-chat-widget-root [data-state=closed],#botuyo-chat-widget-root [data-state=open]{animation:none!important}#botuyo-chat-widget-root .scroll-smooth{scroll-behavior:auto!important}}#botuyo-chat-widget-root :focus-visible{border-radius:var(--radius,.5rem);outline:2px solid hsl(var(--primary));outline-offset:2px}#botuyo-chat-widget-root [role=button]:focus-visible,#botuyo-chat-widget-root button:focus-visible{box-shadow:0 0 0 4px hsl(var(--primary)/.1);outline:2px solid hsl(var(--primary));outline-offset:2px}#botuyo-chat-widget-root input:focus-visible,#botuyo-chat-widget-root textarea:focus-visible{border-color:hsl(var(--primary));box-shadow:0 0 0 3px hsl(var(--primary)/.1);outline:2px solid hsl(var(--primary));outline-offset:0}#botuyo-chat-widget-root .skip-link{background:hsl(var(--primary));border-radius:0 0 4px;color:hsl(var(--primary-foreground));left:0;padding:8px;position:absolute;text-decoration:none;top:-40px;z-index:100000}#botuyo-chat-widget-root .skip-link:focus{top:0}@media(prefers-color-scheme:dark)and (prefers-contrast:high){#botuyo-chat-widget-root{--primary:48 96% 89%;--destructive:0 84% 60%;--success:142 76% 36%}}#botuyo-chat-widget-root [data-state]:after{content:attr(data-state);clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media(min-resolution:192dpi){#botuyo-chat-widget-root{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility}}#botuyo-chat-widget-root [data-tooltip]:focus:after,#botuyo-chat-widget-root [data-tooltip]:hover:after{background:hsl(var(--popover));border-radius:4px;bottom:100%;color:hsl(var(--popover-foreground));content:attr(data-tooltip);font-size:12px;left:50%;padding:4px 8px;pointer-events:none;position:absolute;transform:translate(-50%);white-space:nowrap;z-index:1000}#botuyo-chat-widget-root [aria-live=assertive],#botuyo-chat-widget-root [aria-live=polite]{position:relative}@keyframes live-region-update{0%{opacity:.8}to{opacity:1}}#botuyo-chat-widget-root [aria-live]:not([aria-atomic=false]):has(:new){animation:live-region-update .2s ease-in-out}#botuyo-chat-widget-root .scrollbar-none{scrollbar-width:none;-ms-overflow-style:none}#botuyo-chat-widget-root .scrollbar-none::-webkit-scrollbar{display:none;height:0;width:0}#botuyo-chat-widget-root .scrollbar-thin{scrollbar-width:thin}#botuyo-chat-widget-root .scrollbar-thin::-webkit-scrollbar{height:4px;width:4px}#botuyo-chat-widget-root .scrollbar-thin::-webkit-scrollbar-track{background:0 0}#botuyo-chat-widget-root .scrollbar-thin::-webkit-scrollbar-thumb{background:hsl(var(--border));border-radius:2px}#botuyo-chat-widget-root .scrollbar-thin::-webkit-scrollbar-thumb:hover{background:hsl(var(--muted-foreground)/.5)}#botuyo-chat-widget-root .hidden{display:none!important}#botuyo-chat-widget-root .block{display:block!important}#botuyo-chat-widget-root .flex{display:flex!important}#botuyo-chat-widget-root .inline-flex{display:inline-flex!important}#botuyo-chat-widget-root .grid{display:grid!important}#botuyo-chat-widget-root .flex-row{flex-direction:row!important}#botuyo-chat-widget-root .flex-col{flex-direction:column!important}#botuyo-chat-widget-root .flex-1{flex:1!important}#botuyo-chat-widget-root .flex-none{flex:none!important}#botuyo-chat-widget-root .shrink-0{flex-shrink:0!important}#botuyo-chat-widget-root .grow{flex-grow:1!important}#botuyo-chat-widget-root .items-center{align-items:center!important}#botuyo-chat-widget-root .items-start{align-items:flex-start!important}#botuyo-chat-widget-root .items-end{align-items:flex-end!important}#botuyo-chat-widget-root .justify-center{justify-content:center!important}#botuyo-chat-widget-root .justify-between{justify-content:space-between!important}#botuyo-chat-widget-root .justify-end{justify-content:flex-end!important}#botuyo-chat-widget-root .relative{position:relative!important}#botuyo-chat-widget-root .absolute{position:absolute!important}#botuyo-chat-widget-root .fixed{position:fixed!important}#botuyo-chat-widget-root .inset-0{inset:0!important}#botuyo-chat-widget-root .w-full{width:100%!important}#botuyo-chat-widget-root .h-full{height:100%!important}#botuyo-chat-widget-root .w-fit{width:-moz-fit-content!important;width:fit-content!important}#botuyo-chat-widget-root .w-auto{width:auto!important}#botuyo-chat-widget-root .h-auto{height:auto!important}#botuyo-chat-widget-root .h-0{height:0!important}#botuyo-chat-widget-root .w-0{width:0!important}#botuyo-chat-widget-root .h-6{height:1.5rem!important}#botuyo-chat-widget-root .w-6{width:1.5rem!important}#botuyo-chat-widget-root .h-7{height:1.75rem!important}#botuyo-chat-widget-root .w-7{width:1.75rem!important}#botuyo-chat-widget-root .h-8{height:2rem!important}#botuyo-chat-widget-root .w-8{width:2rem!important}#botuyo-chat-widget-root .h-14{height:3.5rem!important}#botuyo-chat-widget-root .w-14{width:3.5rem!important}#botuyo-chat-widget-root .min-h-0{min-height:0!important}#botuyo-chat-widget-root .min-w-0{min-width:0!important}#botuyo-chat-widget-root .overflow-hidden{overflow:hidden!important}#botuyo-chat-widget-root .overflow-auto{overflow:auto!important}#botuyo-chat-widget-root .overflow-y-auto{overflow-y:auto!important}#botuyo-chat-widget-root .gap-1{gap:.25rem!important}#botuyo-chat-widget-root .gap-2{gap:.5rem!important}#botuyo-chat-widget-root .gap-3{gap:.75rem!important}#botuyo-chat-widget-root .gap-4{gap:1rem!important}#botuyo-chat-widget-root .p-1{padding:.25rem!important}#botuyo-chat-widget-root .p-2{padding:.5rem!important}#botuyo-chat-widget-root .p-3{padding:.75rem!important}#botuyo-chat-widget-root .p-4{padding:1rem!important}#botuyo-chat-widget-root .px-4{padding-left:1rem!important;padding-right:1rem!important}#botuyo-chat-widget-root .py-2{padding-bottom:.5rem!important;padding-top:.5rem!important}#botuyo-chat-widget-root .m-0{margin:0!important}#botuyo-chat-widget-root .mt-2{margin-top:.5rem!important}#botuyo-chat-widget-root .mt-4{margin-top:1rem!important}#botuyo-chat-widget-root .mb-2{margin-bottom:.5rem!important}#botuyo-chat-widget-root .ml-auto{margin-left:auto!important}#botuyo-chat-widget-root .rounded{border-radius:.25rem!important}#botuyo-chat-widget-root .rounded-lg{border-radius:.5rem!important}#botuyo-chat-widget-root .rounded-xl{border-radius:.75rem!important}#botuyo-chat-widget-root .rounded-2xl{border-radius:1rem!important}#botuyo-chat-widget-root .rounded-full{border-radius:9999px!important}#botuyo-chat-widget-root .text-xs{font-size:.75rem!important;line-height:1rem!important}#botuyo-chat-widget-root .text-sm{font-size:.875rem!important;line-height:1.25rem!important}#botuyo-chat-widget-root .text-base{font-size:1rem!important;line-height:1.5rem!important}#botuyo-chat-widget-root .text-lg{font-size:1.125rem!important;line-height:1.75rem!important}#botuyo-chat-widget-root .font-medium{font-weight:500!important}#botuyo-chat-widget-root .font-semibold{font-weight:600!important}#botuyo-chat-widget-root .font-bold{font-weight:700!important}#botuyo-chat-widget-root .font-black{font-weight:900!important}#botuyo-chat-widget-root .uppercase{text-transform:uppercase!important}#botuyo-chat-widget-root .truncate{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}#botuyo-chat-widget-root .text-foreground{color:hsl(var(--foreground))!important}#botuyo-chat-widget-root .text-muted-foreground{color:hsl(var(--muted-foreground))!important}#botuyo-chat-widget-root .text-primary{color:hsl(var(--primary))!important}#botuyo-chat-widget-root .text-primary-foreground{color:hsl(var(--primary-foreground))!important}#botuyo-chat-widget-root .text-destructive{color:hsl(var(--destructive))!important}#botuyo-chat-widget-root .text-white{color:#fff!important}#botuyo-chat-widget-root .bg-background{background-color:hsl(var(--background))!important}#botuyo-chat-widget-root .bg-muted{background-color:hsl(var(--muted))!important}#botuyo-chat-widget-root .bg-primary{background-color:hsl(var(--primary))!important}#botuyo-chat-widget-root .bg-card{background-color:hsl(var(--card))!important}#botuyo-chat-widget-root .bg-transparent{background-color:#0000!important}#botuyo-chat-widget-root .border{border-width:1px!important}#botuyo-chat-widget-root .border-2{border-width:2px!important}#botuyo-chat-widget-root .border-b{border-bottom-width:1px!important}#botuyo-chat-widget-root .border-t{border-top-width:1px!important}#botuyo-chat-widget-root .border-border{border-color:hsl(var(--border))!important}#botuyo-chat-widget-root .shadow{box-shadow:0 1px 3px #0000001a,0 1px 2px -1px #0000001a!important}#botuyo-chat-widget-root .shadow-lg{box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a!important}#botuyo-chat-widget-root .shadow-xl{box-shadow:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a!important}#botuyo-chat-widget-root .transition{transition-duration:.15s!important;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important}#botuyo-chat-widget-root .transition-all{transition-duration:.15s!important;transition-property:all!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important}#botuyo-chat-widget-root .duration-300{transition-duration:.3s!important}#botuyo-chat-widget-root .duration-500{transition-duration:.5s!important}#botuyo-chat-widget-root .opacity-0{opacity:0!important}#botuyo-chat-widget-root .opacity-100{opacity:1!important}#botuyo-chat-widget-root .scale-95{transform:scale(.95)!important}#botuyo-chat-widget-root .scale-100{transform:scale(1)!important}#botuyo-chat-widget-root .translate-y-full{transform:translateY(100%)!important}#botuyo-chat-widget-root .z-10{z-index:10!important}#botuyo-chat-widget-root .z-20{z-index:20!important}#botuyo-chat-widget-root .z-50{z-index:50!important}#botuyo-chat-widget-root .pointer-events-none{pointer-events:none!important}#botuyo-chat-widget-root .pointer-events-auto{pointer-events:auto!important}#botuyo-chat-widget-root .cursor-pointer{cursor:pointer!important}#botuyo-chat-widget-root .select-none{-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}@keyframes spin{to{transform:rotate(1turn)}}#botuyo-chat-widget,#botuyo-chat-widget-root,:root{--background:0 0% 100%;--foreground:240 10% 3.9%;--card:0 0% 100%;--card-foreground:240 10% 3.9%;--popover:0 0% 100%;--popover-foreground:240 10% 3.9%;--primary:160 84% 39%;--primary-foreground:0 0% 100%;--muted:240 4.8% 95.9%;--muted-foreground:240 3.8% 46.1%;--accent:240 4.8% 95.9%;--accent-foreground:240 5.9% 10%;--destructive:0 84.2% 60.2%;--destructive-foreground:0 0% 98%;--border:240 5.9% 90%;--input:240 5.9% 90%;--ring:160 84% 39%;--radius:.5rem;--spacing-1:.25rem;--spacing-2:.5rem;--spacing-3:.75rem;--spacing-4:1rem;--spacing-5:.75rem;--spacing-6:1.5rem;--spacing-7:1.75rem;--spacing-8:2rem;--window-border-radius:24px;--launcher-border-radius:50%;--window-height:700px;--window-bottom:24px}#botuyo-chat-widget-root.dark,#botuyo-chat-widget.dark,.dark{--background:240 10% 3.9%;--foreground:0 0% 98%;--card:240 10% 3.9%;--card-foreground:0 0% 98%;--popover:240 10% 3.9%;--popover-foreground:0 0% 98%;--primary:160 84% 39%;--primary-foreground:0 0% 100%;--muted:240 3.7% 15.9%;--muted-foreground:240 5% 64.9%;--accent:240 3.7% 15.9%;--accent-foreground:0 0% 98%;--destructive:0 62.8% 30.6%;--destructive-foreground:0 0% 98%;--border:240 3.7% 15.9%;--input:240 3.7% 15.9%;--ring:160 84% 39%}#botuyo-chat-widget-root,#botuyo-chat-widget-root *{box-sizing:border-box;margin:0;padding:0}#botuyo-chat-widget-root{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:hsl(var(--foreground));font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;line-height:1.5}@keyframes slideInRight{0%{opacity:0;transform:translate(100%)}to{opacity:1;transform:translate(0)}}@keyframes slideOutRight{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(100%)}}@keyframes slideInUp{0%{opacity:0;transform:translateY(100%)}to{opacity:1;transform:translateY(0)}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes pulse{50%{opacity:.5}}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}#botuyo-chat-widget-root .chat-launcher{align-items:center;background-color:hsl(var(--primary));border-radius:50%;bottom:1.5rem;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a;color:#fff;cursor:pointer;display:flex;height:60px;justify-content:center;position:fixed;right:1.5rem;transition:all .2s;width:60px;z-index:999999}#botuyo-chat-widget-root .chat-launcher:hover{box-shadow:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a;transform:scale(1.05)}#botuyo-chat-widget-root .chat-launcher.position-bottom-left{left:1.5rem;right:auto}#botuyo-chat-widget-root .chat-launcher.position-top-right{bottom:auto;top:1.5rem}#botuyo-chat-widget-root .chat-launcher.position-top-left{inset:1.5rem auto auto 1.5rem}#botuyo-chat-widget-root .chat-window{animation:slideInRight .3s ease-out;background-color:hsl(var(--background));border-radius:1rem;bottom:6rem;box-shadow:0 25px 50px -12px #00000040;display:flex;flex-direction:column;height:600px;max-height:calc(100vh - 8rem);overflow:hidden;position:fixed;right:1.5rem;width:400px;z-index:999999}#botuyo-chat-widget-root .chat-window.closing{animation:slideOutRight .2s ease-in}@media(max-width:640px){#botuyo-chat-widget-root .chat-window{animation:slideInUp .3s ease-out;border-radius:0;height:100%;inset:0;max-height:100vh;width:100%}}#botuyo-chat-widget-root .message-bubble{word-wrap:break-word;border-radius:1rem;max-width:80%;padding:.75rem 1rem}#botuyo-chat-widget-root .message-bubble.user{background-color:hsl(var(--primary));color:hsl(var(--primary-foreground));margin-left:auto}#botuyo-chat-widget-root .message-bubble.bot{background-color:hsl(var(--muted));color:hsl(var(--foreground))}#botuyo-chat-widget-root .chat-messages::-webkit-scrollbar{width:6px}#botuyo-chat-widget-root .chat-messages::-webkit-scrollbar-track{background:0 0}#botuyo-chat-widget-root .chat-messages::-webkit-scrollbar-thumb{background:hsl(var(--muted));border-radius:3px}#botuyo-chat-widget-root .chat-messages::-webkit-scrollbar-thumb:hover{background:hsl(var(--muted-foreground))}#botuyo-chat-widget-root .chat-input{background-color:hsl(var(--background));border:1px solid hsl(var(--border));border-radius:.5rem;color:hsl(var(--foreground));outline:none;padding:.75rem;transition:border-color .2s;width:100%}#botuyo-chat-widget-root .chat-input:focus{border-color:hsl(var(--primary));box-shadow:0 0 0 3px hsl(var(--primary)/.1)}@media(max-width:640px){#botuyo-chat-widget-root .chat-launcher{bottom:1rem;height:56px;right:1rem;width:56px}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}';function P({isOpen:t,onClick:e,unreadCount:i=0,primaryColor:s,logoUrl:c,starterPrompt:d,position:l="bottom-right",emotion:u="default",avatars:p={},styles:k,promptPersistence:_="session",avatarScale:z=1,showPromptAvatar:E=!1}){const{t:S}=h("extracted"),O=g({primaryColor:s}),I=k?.launcher?.bg,$=m(),{triggerHaptic:C,getGlowClass:M}=f(),A=$.launcherPulse&&!1!==k?.launcher?.pulse,[j,P]=r(!1),[D,Z]=r(!1),[F,U]=r(!1),[R,L]=r(!1),B="bottom-right"===l,W="chat_launcher_prompt_state",J=o(()=>p[u]||p.default||c||w,[u,p,c]);n(()=>{L(!1)},[J]),n(()=>{const t=Object.values(p).filter(t=>!!t);c&&t.push(c),t.forEach(t=>{(new Image).src=t})},[p,c]),n(()=>{"forever"===_&&"dismissed"===localStorage.getItem(W)&&U(!0)},[_]);const V=a(()=>{Z(!0),setTimeout(()=>P(!1),500),"always"!==_&&(U(!0),"forever"===_&&localStorage.setItem(W,"dismissed"))},[_]);n(()=>{if("always"!==_&&F||!d||t)return void P(!1);const e=setTimeout(()=>{P(!0),Z(!1)},2e3),r=setTimeout(()=>V(),12e3);return()=>{clearTimeout(e),clearTimeout(r)}},[d,t,F,_,V]);const q=()=>{x.debug("Launcher handleMainAction called, isOpen:",t),C(),U(!0),"forever"===_&&localStorage.setItem(W,"dismissed"),e()};/* @__PURE__ */
|
|
2
2
|
return N("div",{className:b("flex items-center w-fit transition-all duration-500",B?"flex-row ml-auto":"flex-row-reverse mr-auto"),children:[
|
|
3
3
|
/* @__PURE__ */T("div",{className:b("transition-all duration-700 ease-[cubic-bezier(0.34,1.56,0.64,1)] flex items-end",j?b("opacity-100 translate-x-0 translate-y-0 w-auto max-w-[320px]",B?"mr-3":"ml-3"):b("opacity-0 w-0 max-w-0 overflow-hidden pointer-events-none",B?"translate-x-6 translate-y-2":"-translate-x-6 translate-y-2")),children:/* @__PURE__ */N("div",{className:b("relative cursor-pointer group",D&&"opacity-0 scale-90 transition-all duration-400",!j&&"hidden"),onClick:q,children:[
|
|
4
4
|
/* @__PURE__ */N("div",{style:{position:"relative",maxWidth:"290px",padding:"14px 40px 14px 18px",borderRadius:B?"20px 20px 8px 20px":"20px 20px 20px 8px",backgroundColor:"hsl(var(--background) / 0.95)",backdropFilter:"blur(16px)",WebkitBackdropFilter:"blur(16px)",color:"hsl(var(--foreground))",boxShadow:"0 8px 32px -8px rgba(0,0,0,0.15), 0 4px 12px -4px rgba(0,0,0,0.08), 0 0 0 1px hsl(var(--border) / 0.4), inset 0 1px 0 hsl(var(--background) / 0.8)",borderLeft:B?`3px solid ${O||"hsl(160,84%,39%)"}`:"none",borderRight:B?"none":`3px solid ${O||"hsl(160,84%,39%)"}`},children:[
|
|
@@ -8,29 +8,29 @@ return N("div",{className:b("flex items-center w-fit transition-all duration-500
|
|
|
8
8
|
/* @__PURE__ */N("div",{className:"relative flex items-center justify-center shrink-0",children:[!t&&A&&/* @__PURE__ */T("span",{className:"absolute inset-0 flex items-center justify-center",children:/* @__PURE__ */T("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-20",style:{backgroundColor:O}})}),
|
|
9
9
|
/* @__PURE__ */N("button",{type:"button",onClick:q,className:b("relative z-10 h-14 w-14 sm:h-16 sm:w-16","flex items-center justify-center text-white transition-all duration-500","hover:scale-110 active:scale-95 shadow-soft-xl cursor-pointer",!t&&"hover:rotate-6",!t&&$.enabled&&"animate-glow-pulse",k?.radius?.button||"rounded-full",I,M()),style:{backgroundColor:I?O||"hsl(160, 84%, 39%)":"transparent","--primary-glow":`${O}66`},"aria-label":t?"Cerrar chat":"Abrir chat",children:[
|
|
10
10
|
/* @__PURE__ */N("div",{className:"relative h-full w-full flex items-center justify-center overflow-hidden rounded-inherit",children:[
|
|
11
|
-
/* @__PURE__ */T("div",{className:b("absolute inset-0 transition-all duration-500 flex items-center justify-center",t?"opacity-0 scale-50 rotate-90":"opacity-100 scale-100 rotate-0"),children:J&&!
|
|
11
|
+
/* @__PURE__ */T("div",{className:b("absolute inset-0 transition-all duration-500 flex items-center justify-center",t?"opacity-0 scale-50 rotate-90":"opacity-100 scale-100 rotate-0"),children:J&&!R?/* @__PURE__ */T("img",{src:J,alt:S("assistant"),className:"w-full h-full object-cover",style:{transform:`scale(${z})`},onError:()=>L(!0)},J):/* @__PURE__ */T(v,{className:"h-7 w-7 sm:h-8 sm:w-8 fill-current"})}),
|
|
12
12
|
/* @__PURE__ */T("div",{className:b("absolute inset-0 transition-all duration-500 flex items-center justify-center bg-black/5 dark:bg-white/10",t?"opacity-100 scale-100 rotate-0":"opacity-0 scale-50 -rotate-90"),children:/* @__PURE__ */T(y,{className:"h-7 w-7 sm:h-8 sm:w-8 stroke-[2.5]"})})]}),!t&&i>0&&/* @__PURE__ */T("div",{className:"absolute -top-1 -right-1 z-20 flex h-6 w-6 items-center justify-center bg-destructive text-destructive-foreground rounded-full border-2 border-background text-[10px] font-black shadow-soft-md tabular-nums",children:i>9?"9+":i})]})]})]})}class D extends i{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,e){x.error("ErrorBoundary caught error:",t,e),this.props.onError?.(t,e)}handleReset=()=>{this.setState({hasError:!1,error:null})};render(){return this.state.hasError?this.props.fallback?this.props.fallback:/* @__PURE__ */N("div",{className:"flex flex-col items-center justify-center p-8 bg-background text-center",children:[
|
|
13
13
|
/* @__PURE__ */T("div",{className:"text-6xl mb-4",children:"⚠️"}),
|
|
14
14
|
/* @__PURE__ */T("h2",{className:"text-xl font-bold text-foreground mb-2",children:"Algo salió mal"}),
|
|
15
15
|
/* @__PURE__ */T("p",{className:"text-sm text-muted-foreground mb-6 max-w-md",children:this.state.error?.message||"Ocurrió un error inesperado"}),
|
|
16
|
-
/* @__PURE__ */T("button",{onClick:this.handleReset,className:"px-4 py-2 bg-primary text-primary-foreground rounded-lg font-medium hover:opacity-90 transition-opacity",children:"Intentar de nuevo"})]}):this.props.children}}const Z={bubble:"rounded-2xl",image:"rounded-xl",button:"rounded-xl",card:"rounded-2xl"},F={bg:"bg-muted/50 dark:bg-muted/20",text:"text-foreground",border:"border-border/50"},U={text:"text-primary-foreground"};const L=(t,e)=>e.some(e=>t instanceof e);let R,B;const W=/* @__PURE__ */new WeakMap,J=/* @__PURE__ */new WeakMap,V=/* @__PURE__ */new WeakMap;let q={get(t,e,r){if(t instanceof IDBTransaction){if("done"===e)return W.get(t);if("store"===e)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return K(t[e])},set:(t,e,r)=>(t[e]=r,!0),has:(t,e)=>t instanceof IDBTransaction&&("done"===e||"store"===e)||e in t};function H(t){q=t(q)}function G(t){return"function"==typeof t?(e=t,(B||(B=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Y(this),t),K(this.request)}:function(...t){return K(e.apply(Y(this),t))}):(t instanceof IDBTransaction&&function(t){if(W.has(t))return;const e=new Promise((e,r)=>{const o=()=>{t.removeEventListener("complete",n),t.removeEventListener("error",a),t.removeEventListener("abort",a)},n=()=>{e(),o()},a=()=>{r(t.error||new DOMException("AbortError","AbortError")),o()};t.addEventListener("complete",n),t.addEventListener("error",a),t.addEventListener("abort",a)});W.set(t,e)}(t),L(t,R||(R=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(t,q):t);var e}function K(t){if(t instanceof IDBRequest)return function(t){const e=new Promise((e,r)=>{const o=()=>{t.removeEventListener("success",n),t.removeEventListener("error",a)},n=()=>{e(K(t.result)),o()},a=()=>{r(t.error),o()};t.addEventListener("success",n),t.addEventListener("error",a)});return V.set(e,t),e}(t);if(J.has(t))return J.get(t);const e=G(t);return e!==t&&(J.set(t,e),V.set(e,t)),e}const Y=t=>V.get(t),X=["get","getKey","getAll","getAllKeys","count"],Q=["put","add","delete","clear"],tt=/* @__PURE__ */new Map;function et(t,e){if(!(t instanceof IDBDatabase)||e in t||"string"!=typeof e)return;if(tt.get(e))return tt.get(e);const r=e.replace(/FromIndex$/,""),o=e!==r,n=Q.includes(r);if(!(r in(o?IDBIndex:IDBObjectStore).prototype)||!n&&!X.includes(r))return;const a=async function(t,...e){const a=this.transaction(t,n?"readwrite":"readonly");let i=a.store;return o&&(i=i.index(e.shift())),(await Promise.all([i[r](...e),n&&a.done]))[0]};return tt.set(e,a),a}H(t=>({...t,get:(e,r,o)=>et(e,r)||t.get(e,r,o),has:(e,r)=>!!et(e,r)||t.has(e,r)}));const rt=["continue","continuePrimaryKey","advance"],ot={},nt=/* @__PURE__ */new WeakMap,at=/* @__PURE__ */new WeakMap,it={get(t,e){if(!rt.includes(e))return t[e];let r=ot[e];return r||(r=ot[e]=function(...t){nt.set(this,at.get(this)[e](...t))}),r}};async function*st(...t){let e=this;if(e instanceof IDBCursor||(e=await e.openCursor(...t)),!e)return;const r=new Proxy(e,it);for(at.set(r,e),V.set(r,Y(e));e;)yield r,e=await(nt.get(r)||e.continue()),nt.delete(r)}function ct(t,e){return e===Symbol.asyncIterator&&L(t,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===e&&L(t,[IDBIndex,IDBObjectStore])}H(t=>({...t,get:(e,r,o)=>ct(e,r)?st:t.get(e,r,o),has:(e,r)=>ct(e,r)||t.has(e,r)}));class dt{db=null;DB_NAME;DB_VERSION=1;constructor(t="default"){this.DB_NAME=`botuyo-chat-${t}`}async init(){try{this.db=await function(t,e,{blocked:r,upgrade:o,blocking:n,terminated:a}={}){const i=indexedDB.open(t,e),s=K(i);return o&&i.addEventListener("upgradeneeded",t=>{o(K(i.result),t.oldVersion,t.newVersion,K(i.transaction),t)}),r&&i.addEventListener("blocked",t=>r(t.oldVersion,t.newVersion,t)),s.then(t=>{a&&t.addEventListener("close",()=>a()),n&&t.addEventListener("versionchange",t=>n(t.oldVersion,t.newVersion,t))}).catch(()=>{}),s}(this.DB_NAME,this.DB_VERSION,{upgrade(t){t.objectStoreNames.contains("messages")||t.createObjectStore("messages",{keyPath:"id"}).createIndex("by-timestamp","timestamp"),t.objectStoreNames.contains("metadata")||t.createObjectStore("metadata")}}),x.info("IndexedDB initialized")}catch(t){throw x.error("Failed to initialize IndexedDB:",t),t}}async saveMessage(t){this.db||await this.init();try{await this.db.put("messages",t)}catch(e){x.error("Failed to save message:",e)}}async saveMessages(t){this.db||await this.init();try{const e=this.db.transaction("messages","readwrite");await Promise.all([...t.map(t=>e.store.put(t)),e.done])}catch(e){x.error("Failed to save messages:",e)}}async getMessages(t=100){this.db||await this.init();try{return(await this.db.getAllFromIndex("messages","by-timestamp")).slice(-t)}catch(e){return x.error("Failed to get messages:",e),[]}}async getMessage(t){this.db||await this.init();try{return await this.db.get("messages",t)}catch(e){return void x.error("Failed to get message:",e)}}async deleteMessage(t){this.db||await this.init();try{await this.db.delete("messages",t)}catch(e){x.error("Failed to delete message:",e)}}async clearMessages(){this.db||await this.init();try{await this.db.clear("messages"),x.info("Messages cleared from IndexedDB")}catch(t){x.error("Failed to clear messages:",t)}}async setMetadata(t){this.db||await this.init();try{await this.db.put("metadata",t,"chat-metadata")}catch(e){x.error("Failed to set metadata:",e)}}async getMetadata(){this.db||await this.init();try{return await this.db.get("metadata","chat-metadata")}catch(t){return x.error("Failed to get metadata:",t),null}}async clearAll(){this.db||await this.init();try{await Promise.all([this.db.clear("messages"),this.db.clear("metadata")]),x.info("All data cleared from IndexedDB")}catch(t){x.error("Failed to clear all data:",t)}}async migrateFromLocalStorage(t="default"){try{const e=`botuyo_chat_v1_${t}`,r=localStorage.getItem(e);if(!r)return;const o=JSON.parse(r);if(o.messages&&Array.isArray(o.messages)){const t=o.messages.map(t=>({...t,timestamp:new Date(t.timestamp)}));await this.saveMessages(t),x.info(`Migrated ${t.length} messages from localStorage`)}o.sessionId&&await this.setMetadata({sessionId:o.sessionId}),localStorage.removeItem(e),x.info("Migration from localStorage completed")}catch(e){x.error("Failed to migrate from localStorage:",e)}}}const lt=/* @__PURE__ */new Map,ut={isOpen:!1,isConnected:!1,isTyping:!1,messages:[],error:null,sessionId:null};function pt(t,e){switch(e.type){case"TOGGLE_WINDOW":return{...t,isOpen:!t.isOpen};case"OPEN_WINDOW":return{...t,isOpen:!0};case"CLOSE_WINDOW":return{...t,isOpen:!1};case"SET_CONNECTED":return{...t,isConnected:e.payload};case"SET_TYPING":return{...t,isTyping:e.payload};case"ADD_MESSAGE":{if(t.messages.some(t=>t.id===e.payload.id))return t;if(e.payload.id.startsWith("msg-")&&"text"===e.payload.type){const r=/* @__PURE__ */(new Date).getTime();if(t.messages.slice(-10).some(t=>"text"===t.type&&t.sender===e.payload.sender&&"content"in t&&"content"in e.payload&&t.content===e.payload.content&&Math.abs(r-new Date(t.timestamp).getTime())<3e4))return t}const r=[...t.messages,e.payload],o="bot"===e.payload.sender;return{...t,messages:r,isTyping:!o&&t.isTyping}}case"SET_MESSAGES":return{...t,messages:[...e.payload]};case"SET_ERROR":return{...t,error:e.payload};case"SET_SESSION_ID":return{...t,sessionId:e.payload};case"CLEAR_CHAT":return{...ut,isOpen:t.isOpen};case"RESTORE_SESSION":return{...t,...e.payload,isConnected:!1,isTyping:!1,error:null};default:return t}}function ht(t,e,r){function o(r,o){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:o,constr:i,traits:/* @__PURE__ */new Set},enumerable:!1}),r._zod.traits.has(t))return;r._zod.traits.add(t),e(r,o);const n=i.prototype,a=Object.keys(n);for(let t=0;t<a.length;t++){const e=a[t];e in r||(r[e]=n[e].bind(r))}}const n=r?.Parent??Object;class a extends n{}function i(t){var e;const n=r?.Parent?new a:this;o(n,t),(e=n._zod).deferred??(e.deferred=[]);for(const r of n._zod.deferred)r();return n}return Object.defineProperty(a,"name",{value:t}),Object.defineProperty(i,"init",{value:o}),Object.defineProperty(i,Symbol.hasInstance,{value:e=>!!(r?.Parent&&e instanceof r.Parent)||e?._zod?.traits?.has(t)}),Object.defineProperty(i,"name",{value:t}),i}class gt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class mt extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const ft={};function wt(t){return ft}function bt(t){const e=Object.values(t).filter(t=>"number"==typeof t);return Object.entries(t).filter(([t,r])=>-1===e.indexOf(+t)).map(([t,e])=>e)}function yt(t,e){return"bigint"==typeof e?e.toString():e}function vt(t){return{get value(){{const e=t();return Object.defineProperty(this,"value",{value:e}),e}}}}function xt(t){return null==t}function kt(t){const e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}const _t=/* @__PURE__ */Symbol("evaluating");function zt(t,e,r){let o;Object.defineProperty(t,e,{get(){if(o!==_t)return void 0===o&&(o=_t,o=r()),o},set(r){Object.defineProperty(t,e,{value:r})},configurable:!0})}function Et(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function St(...t){const e={};for(const r of t){const t=Object.getOwnPropertyDescriptors(r);Object.assign(e,t)}return Object.defineProperties({},e)}function Ot(t){return JSON.stringify(t)}const It="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function $t(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}const Ct=vt(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(t){return!1}});function Nt(t){if(!1===$t(t))return!1;const e=t.constructor;if(void 0===e)return!0;if("function"!=typeof e)return!0;const r=e.prototype;return!1!==$t(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function Tt(t){return Nt(t)?{...t}:Array.isArray(t)?[...t]:t}const Mt=/* @__PURE__ */new Set(["string","number","symbol"]);function At(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function jt(t,e,r){const o=new t._zod.constr(e??t._zod.def);return e&&!r?.parent||(o._zod.parent=t),o}function Pt(t){const e=t;if(!e)return{};if("string"==typeof e)return{error:()=>e};if(void 0!==e?.message){if(void 0!==e?.error)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,"string"==typeof e.error?{...e,error:()=>e.error}:e}const Dt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Zt(t,e=0){if(!0===t.aborted)return!0;for(let r=e;r<t.issues.length;r++)if(!0!==t.issues[r]?.continue)return!0;return!1}function Ft(t,e){return e.map(e=>{var r;return(r=e).path??(r.path=[]),e.path.unshift(t),e})}function Ut(t){return"string"==typeof t?t:t?.message}function Lt(t,e,r){const o={...t,path:t.path??[]};if(!t.message){const n=Ut(t.inst?._zod.def?.error?.(t))??Ut(e?.error?.(t))??Ut(r.customError?.(t))??Ut(r.localeError?.(t))??"Invalid input";o.message=n}return delete o.inst,delete o.continue,e?.reportInput||delete o.input,o}function Rt(t){return Array.isArray(t)?"array":"string"==typeof t?"string":"unknown"}function Bt(...t){const[e,r,o]=t;return"string"==typeof e?{message:e,code:"custom",input:r,inst:o}:{...e}}const Wt=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,yt,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},Jt=ht("$ZodError",Wt),Vt=ht("$ZodError",Wt,{Parent:Error}),qt=t=>(e,r,o,n)=>{const a=o?Object.assign(o,{async:!1}):{async:!1},i=e._zod.run({value:r,issues:[]},a);if(i instanceof Promise)throw new gt;if(i.issues.length){const e=new(n?.Err??t)(i.issues.map(t=>Lt(t,a,wt())));throw It(e,n?.callee),e}return i.value},Ht=t=>async(e,r,o,n)=>{const a=o?Object.assign(o,{async:!0}):{async:!0};let i=e._zod.run({value:r,issues:[]},a);if(i instanceof Promise&&(i=await i),i.issues.length){const e=new(n?.Err??t)(i.issues.map(t=>Lt(t,a,wt())));throw It(e,n?.callee),e}return i.value},Gt=t=>(e,r,o)=>{const n=o?{...o,async:!1}:{async:!1},a=e._zod.run({value:r,issues:[]},n);if(a instanceof Promise)throw new gt;return a.issues.length?{success:!1,error:new(t??Jt)(a.issues.map(t=>Lt(t,n,wt())))}:{success:!0,data:a.value}},Kt=/* @__PURE__ */Gt(Vt),Yt=t=>async(e,r,o)=>{const n=o?Object.assign(o,{async:!0}):{async:!0};let a=e._zod.run({value:r,issues:[]},n);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new t(a.issues.map(t=>Lt(t,n,wt())))}:{success:!0,data:a.value}},Xt=/* @__PURE__ */Yt(Vt),Qt=t=>(e,r,o)=>{const n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return qt(t)(e,r,n)},te=t=>(e,r,o)=>qt(t)(e,r,o),ee=t=>async(e,r,o)=>{const n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Ht(t)(e,r,n)},re=t=>async(e,r,o)=>Ht(t)(e,r,o),oe=t=>(e,r,o)=>{const n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Gt(t)(e,r,n)},ne=t=>(e,r,o)=>Gt(t)(e,r,o),ae=t=>async(e,r,o)=>{const n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Yt(t)(e,r,n)},ie=t=>async(e,r,o)=>Yt(t)(e,r,o),se=/^[cC][^\s-]{8,}$/,ce=/^[0-9a-z]+$/,de=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,le=/^[0-9a-vA-V]{20}$/,ue=/^[A-Za-z0-9]{27}$/,pe=/^[a-zA-Z0-9_-]{21}$/,he=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ge=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,me=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,fe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,we=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,be=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ye=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ve=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,xe=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ke=/^[A-Za-z0-9_-]*$/,_e=/^\+[1-9]\d{6,14}$/,ze="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Ee=/* @__PURE__ */new RegExp(`^${ze}$`);function Se(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof t.precision?-1===t.precision?`${e}`:0===t.precision?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}const Oe=/^-?\d+$/,Ie=/^-?\d+(?:\.\d+)?$/,$e=/^[^A-Z]*$/,Ce=/^[^a-z]*$/,Ne=/* @__PURE__ */ht("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Te={number:"number",bigint:"bigint",object:"date"},Me=/* @__PURE__ */ht("$ZodCheckLessThan",(t,e)=>{Ne.init(t,e);const r=Te[typeof e.value];t._zod.onattach.push(t=>{const r=t._zod.bag,o=(e.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?r.maximum=e.value:r.exclusiveMaximum=e.value)}),t._zod.check=o=>{(e.inclusive?o.value<=e.value:o.value<e.value)||o.issues.push({origin:r,code:"too_big",maximum:"object"==typeof e.value?e.value.getTime():e.value,input:o.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Ae=/* @__PURE__ */ht("$ZodCheckGreaterThan",(t,e)=>{Ne.init(t,e);const r=Te[typeof e.value];t._zod.onattach.push(t=>{const r=t._zod.bag,o=(e.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?r.minimum=e.value:r.exclusiveMinimum=e.value)}),t._zod.check=o=>{(e.inclusive?o.value>=e.value:o.value>e.value)||o.issues.push({origin:r,code:"too_small",minimum:"object"==typeof e.value?e.value.getTime():e.value,input:o.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),je=/* @__PURE__ */ht("$ZodCheckMultipleOf",(t,e)=>{Ne.init(t,e),t._zod.onattach.push(t=>{var r;(r=t._zod.bag).multipleOf??(r.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?r.value%e.value===BigInt(0):0===function(t,e){const r=(t.toString().split(".")[1]||"").length,o=e.toString();let n=(o.split(".")[1]||"").length;if(0===n&&/\d?e-\d?/.test(o)){const t=o.match(/\d?e-(\d?)/);t?.[1]&&(n=Number.parseInt(t[1]))}const a=r>n?r:n;return Number.parseInt(t.toFixed(a).replace(".",""))%Number.parseInt(e.toFixed(a).replace(".",""))/10**a}(r.value,e.value))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),Pe=/* @__PURE__ */ht("$ZodCheckNumberFormat",(t,e)=>{Ne.init(t,e),e.format=e.format||"float64";const r=e.format?.includes("int"),o=r?"int":"number",[n,a]=Dt[e.format];t._zod.onattach.push(t=>{const o=t._zod.bag;o.format=e.format,o.minimum=n,o.maximum=a,r&&(o.pattern=Oe)}),t._zod.check=i=>{const s=i.value;if(r){if(!Number.isInteger(s))return void i.issues.push({expected:o,format:e.format,code:"invalid_type",continue:!1,input:s,inst:t});if(!Number.isSafeInteger(s))return void(s>0?i.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:o,inclusive:!0,continue:!e.abort}):i.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:o,inclusive:!0,continue:!e.abort}))}s<n&&i.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!e.abort}),s>a&&i.issues.push({origin:"number",input:s,code:"too_big",maximum:a,inclusive:!0,inst:t,continue:!e.abort})}}),De=/* @__PURE__ */ht("$ZodCheckMaxLength",(t,e)=>{var r;Ne.init(t,e),(r=t._zod.def).when??(r.when=t=>{const e=t.value;return!xt(e)&&void 0!==e.length}),t._zod.onattach.push(t=>{const r=t._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<r&&(t._zod.bag.maximum=e.maximum)}),t._zod.check=r=>{const o=r.value;if(o.length<=e.maximum)return;const n=Rt(o);r.issues.push({origin:n,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),Ze=/* @__PURE__ */ht("$ZodCheckMinLength",(t,e)=>{var r;Ne.init(t,e),(r=t._zod.def).when??(r.when=t=>{const e=t.value;return!xt(e)&&void 0!==e.length}),t._zod.onattach.push(t=>{const r=t._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>r&&(t._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{const o=r.value;if(o.length>=e.minimum)return;const n=Rt(o);r.issues.push({origin:n,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),Fe=/* @__PURE__ */ht("$ZodCheckLengthEquals",(t,e)=>{var r;Ne.init(t,e),(r=t._zod.def).when??(r.when=t=>{const e=t.value;return!xt(e)&&void 0!==e.length}),t._zod.onattach.push(t=>{const r=t._zod.bag;r.minimum=e.length,r.maximum=e.length,r.length=e.length}),t._zod.check=r=>{const o=r.value,n=o.length;if(n===e.length)return;const a=Rt(o),i=n>e.length;r.issues.push({origin:a,...i?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),Ue=/* @__PURE__ */ht("$ZodCheckStringFormat",(t,e)=>{var r,o;Ne.init(t,e),t._zod.onattach.push(t=>{const r=t._zod.bag;r.format=e.format,e.pattern&&(r.patterns??(r.patterns=/* @__PURE__ */new Set),r.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=r=>{e.pattern.lastIndex=0,e.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:e.format,input:r.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(o=t._zod).check??(o.check=()=>{})}),Le=/* @__PURE__ */ht("$ZodCheckRegex",(t,e)=>{Ue.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,e.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),Re=/* @__PURE__ */ht("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=$e),Ue.init(t,e)}),Be=/* @__PURE__ */ht("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Ce),Ue.init(t,e)}),We=/* @__PURE__ */ht("$ZodCheckIncludes",(t,e)=>{Ne.init(t,e);const r=At(e.includes),o=new RegExp("number"==typeof e.position?`^.{${e.position}}${r}`:r);e.pattern=o,t._zod.onattach.push(t=>{const e=t._zod.bag;e.patterns??(e.patterns=/* @__PURE__ */new Set),e.patterns.add(o)}),t._zod.check=r=>{r.value.includes(e.includes,e.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:r.value,inst:t,continue:!e.abort})}}),Je=/* @__PURE__ */ht("$ZodCheckStartsWith",(t,e)=>{Ne.init(t,e);const r=new RegExp(`^${At(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(t=>{const e=t._zod.bag;e.patterns??(e.patterns=/* @__PURE__ */new Set),e.patterns.add(r)}),t._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:t,continue:!e.abort})}}),Ve=/* @__PURE__ */ht("$ZodCheckEndsWith",(t,e)=>{Ne.init(t,e);const r=new RegExp(`.*${At(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(t=>{const e=t._zod.bag;e.patterns??(e.patterns=/* @__PURE__ */new Set),e.patterns.add(r)}),t._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:t,continue:!e.abort})}}),qe=/* @__PURE__ */ht("$ZodCheckOverwrite",(t,e)=>{Ne.init(t,e),t._zod.check=t=>{t.value=e.tx(t.value)}});class He{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if("function"==typeof t)return t(this,{execution:"sync"}),void t(this,{execution:"async"});const e=t.split("\n").filter(t=>t),r=Math.min(...e.map(t=>t.length-t.trimStart().length)),o=e.map(t=>t.slice(r)).map(t=>" ".repeat(2*this.indent)+t);for(const n of o)this.content.push(n)}compile(){const t=Function,e=this?.args;return new t(...e,[...(this?.content??[""]).map(t=>` ${t}`)].join("\n"))}}const Ge={major:4,minor:3,patch:6},Ke=/* @__PURE__ */ht("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Ge;const o=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&o.unshift(t);for(const n of o)for(const e of n._zod.onattach)e(t);if(0===o.length)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{const e=(t,e,r)=>{let o,n=Zt(t);for(const a of e){if(a._zod.def.when){if(!a._zod.def.when(t))continue}else if(n)continue;const e=t.issues.length,i=a._zod.check(t);if(i instanceof Promise&&!1===r?.async)throw new gt;if(o||i instanceof Promise)o=(o??Promise.resolve()).then(async()=>{await i,t.issues.length!==e&&(n||(n=Zt(t,e)))});else{if(t.issues.length===e)continue;n||(n=Zt(t,e))}}return o?o.then(()=>t):t},r=(r,n,a)=>{if(Zt(r))return r.aborted=!0,r;const i=e(n,o,a);if(i instanceof Promise){if(!1===a.async)throw new gt;return i.then(e=>t._zod.parse(e,a))}return t._zod.parse(i,a)};t._zod.run=(n,a)=>{if(a.skipChecks)return t._zod.parse(n,a);if("backward"===a.direction){const e=t._zod.parse({value:n.value,issues:[]},{...a,skipChecks:!0});return e instanceof Promise?e.then(t=>r(t,n,a)):r(e,n,a)}const i=t._zod.parse(n,a);if(i instanceof Promise){if(!1===a.async)throw new gt;return i.then(t=>e(t,o,a))}return e(i,o,a)}}zt(t,"~standard",()=>({validate:e=>{try{const r=Kt(t,e);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return Xt(t,e).then(t=>t.success?{value:t.data}:{issues:t.error?.issues})}},vendor:"zod",version:1}))}),Ye=/* @__PURE__ */ht("$ZodString",(t,e)=>{var r;Ke.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??(r=t._zod.bag,new RegExp(`^${r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*"}$`)),t._zod.parse=(r,o)=>{if(e.coerce)try{r.value=String(r.value)}catch(n){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),Xe=/* @__PURE__ */ht("$ZodStringFormat",(t,e)=>{Ue.init(t,e),Ye.init(t,e)}),Qe=/* @__PURE__ */ht("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=ge),Xe.init(t,e)}),tr=/* @__PURE__ */ht("$ZodUUID",(t,e)=>{if(e.version){const t={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(void 0===t)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=me(t))}else e.pattern??(e.pattern=me());Xe.init(t,e)}),er=/* @__PURE__ */ht("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=fe),Xe.init(t,e)}),rr=/* @__PURE__ */ht("$ZodURL",(t,e)=>{Xe.init(t,e),t._zod.check=r=>{try{const o=r.value.trim(),n=new URL(o);return e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),void(e.normalize?r.value=n.href:r.value=o)}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),or=/* @__PURE__ */ht("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Xe.init(t,e)}),nr=/* @__PURE__ */ht("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=pe),Xe.init(t,e)}),ar=/* @__PURE__ */ht("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=se),Xe.init(t,e)}),ir=/* @__PURE__ */ht("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=ce),Xe.init(t,e)}),sr=/* @__PURE__ */ht("$ZodULID",(t,e)=>{e.pattern??(e.pattern=de),Xe.init(t,e)}),cr=/* @__PURE__ */ht("$ZodXID",(t,e)=>{e.pattern??(e.pattern=le),Xe.init(t,e)}),dr=/* @__PURE__ */ht("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=ue),Xe.init(t,e)}),lr=/* @__PURE__ */ht("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=function(t){const e=Se({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${e}(?:${r.join("|")})`;return new RegExp(`^${ze}T(?:${o})$`)}(e)),Xe.init(t,e)}),ur=/* @__PURE__ */ht("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Ee),Xe.init(t,e)}),pr=/* @__PURE__ */ht("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=new RegExp(`^${Se(e)}$`)),Xe.init(t,e)}),hr=/* @__PURE__ */ht("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=he),Xe.init(t,e)}),gr=/* @__PURE__ */ht("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=we),Xe.init(t,e),t._zod.bag.format="ipv4"}),mr=/* @__PURE__ */ht("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=be),Xe.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),fr=/* @__PURE__ */ht("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=ye),Xe.init(t,e)}),wr=/* @__PURE__ */ht("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=ve),Xe.init(t,e),t._zod.check=r=>{const o=r.value.split("/");try{if(2!==o.length)throw new Error;const[t,e]=o;if(!e)throw new Error;const r=Number(e);if(`${r}`!==e)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${t}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function br(t){if(""===t)return!0;if(t.length%4!=0)return!1;try{return atob(t),!0}catch{return!1}}const yr=/* @__PURE__ */ht("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=xe),Xe.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{br(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}}),vr=/* @__PURE__ */ht("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=ke),Xe.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{(function(t){if(!ke.test(t))return!1;const e=t.replace(/[-_]/g,t=>"-"===t?"+":"/");return br(e.padEnd(4*Math.ceil(e.length/4),"="))})(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),xr=/* @__PURE__ */ht("$ZodE164",(t,e)=>{e.pattern??(e.pattern=_e),Xe.init(t,e)}),kr=/* @__PURE__ */ht("$ZodJWT",(t,e)=>{Xe.init(t,e),t._zod.check=r=>{(function(t,e=null){try{const r=t.split(".");if(3!==r.length)return!1;const[o]=r;if(!o)return!1;const n=JSON.parse(atob(o));return!("typ"in n&&"JWT"!==n?.typ||!n.alg||e&&(!("alg"in n)||n.alg!==e))}catch{return!1}})(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),_r=/* @__PURE__ */ht("$ZodNumber",(t,e)=>{Ke.init(t,e),t._zod.pattern=t._zod.bag.pattern??Ie,t._zod.parse=(r,o)=>{if(e.coerce)try{r.value=Number(r.value)}catch(i){}const n=r.value;if("number"==typeof n&&!Number.isNaN(n)&&Number.isFinite(n))return r;const a="number"==typeof n?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:t,...a?{received:a}:{}}),r}}),zr=/* @__PURE__ */ht("$ZodNumberFormat",(t,e)=>{Pe.init(t,e),_r.init(t,e)}),Er=/* @__PURE__ */ht("$ZodAny",(t,e)=>{Ke.init(t,e),t._zod.parse=t=>t}),Sr=/* @__PURE__ */ht("$ZodUnknown",(t,e)=>{Ke.init(t,e),t._zod.parse=t=>t}),Or=/* @__PURE__ */ht("$ZodNever",(t,e)=>{Ke.init(t,e),t._zod.parse=(e,r)=>(e.issues.push({expected:"never",code:"invalid_type",input:e.value,inst:t}),e)});function Ir(t,e,r){t.issues.length&&e.issues.push(...Ft(r,t.issues)),e.value[r]=t.value}const $r=/* @__PURE__ */ht("$ZodArray",(t,e)=>{Ke.init(t,e),t._zod.parse=(r,o)=>{const n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:t}),r;r.value=Array(n.length);const a=[];for(let t=0;t<n.length;t++){const i=n[t],s=e.element._zod.run({value:i,issues:[]},o);s instanceof Promise?a.push(s.then(e=>Ir(e,r,t))):Ir(s,r,t)}return a.length?Promise.all(a).then(()=>r):r}});function Cr(t,e,r,o,n){if(t.issues.length){if(n&&!(r in o))return;e.issues.push(...Ft(r,t.issues))}void 0===t.value?r in o&&(e.value[r]=void 0):e.value[r]=t.value}function Nr(t){const e=Object.keys(t.shape);for(const n of e)if(!t.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const r=(o=t.shape,Object.keys(o).filter(t=>"optional"===o[t]._zod.optin&&"optional"===o[t]._zod.optout));var o;return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function Tr(t,e,r,o,n,a){const i=[],s=n.keySet,c=n.catchall._zod,d=c.def.type,l="optional"===c.optout;for(const u in e){if(s.has(u))continue;if("never"===d){i.push(u);continue}const n=c.run({value:e[u],issues:[]},o);n instanceof Promise?t.push(n.then(t=>Cr(t,r,u,e,l))):Cr(n,r,u,e,l)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:e,inst:a}),t.length?Promise.all(t).then(()=>r):r}const Mr=/* @__PURE__ */ht("$ZodObject",(t,e)=>{Ke.init(t,e);const r=Object.getOwnPropertyDescriptor(e,"shape");if(!r?.get){const t=e.shape;Object.defineProperty(e,"shape",{get:()=>{const r={...t};return Object.defineProperty(e,"shape",{value:r}),r}})}const o=vt(()=>Nr(e));zt(t._zod,"propValues",()=>{const t=e.shape,r={};for(const e in t){const o=t[e]._zod;if(o.values){r[e]??(r[e]=/* @__PURE__ */new Set);for(const t of o.values)r[e].add(t)}}return r});const n=$t,a=e.catchall;let i;t._zod.parse=(e,r)=>{i??(i=o.value);const s=e.value;if(!n(s))return e.issues.push({expected:"object",code:"invalid_type",input:s,inst:t}),e;e.value={};const c=[],d=i.shape;for(const t of i.keys){const o=d[t],n="optional"===o._zod.optout,a=o._zod.run({value:s[t],issues:[]},r);a instanceof Promise?c.push(a.then(r=>Cr(r,e,t,s,n))):Cr(a,e,t,s,n)}return a?Tr(c,s,e,r,o.value,t):c.length?Promise.all(c).then(()=>e):e}}),Ar=/* @__PURE__ */ht("$ZodObjectJIT",(t,e)=>{Mr.init(t,e);const r=t._zod.parse,o=vt(()=>Nr(e));let n;const a=$t,i=!ft.jitless,s=i&&Ct.value,c=e.catchall;let d;t._zod.parse=(l,u)=>{d??(d=o.value);const p=l.value;return a(p)?i&&s&&!1===u?.async&&!0!==u.jitless?(n||(n=(t=>{const e=new He(["shape","payload","ctx"]),r=o.value,n=t=>{const e=Ot(t);return`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`};e.write("const input = payload.value;");const a=/* @__PURE__ */Object.create(null);let i=0;for(const o of r.keys)a[o]="key_"+i++;e.write("const newResult = {};");for(const o of r.keys){const r=a[o],i=Ot(o),s=t[o],c="optional"===s?._zod?.optout;e.write(`const ${r} = ${n(o)};`),c?e.write(`\n if (${r}.issues.length) {\n if (${i} in input) {\n payload.issues = payload.issues.concat(${r}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n }\n \n if (${r}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${r}.value;\n }\n \n `):e.write(`\n if (${r}.issues.length) {\n payload.issues = payload.issues.concat(${r}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${r}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${r}.value;\n }\n \n `)}e.write("payload.value = newResult;"),e.write("return payload;");const s=e.compile();return(e,r)=>s(t,e,r)})(e.shape)),l=n(l,u),c?Tr([],p,l,u,d,t):l):r(l,u):(l.issues.push({expected:"object",code:"invalid_type",input:p,inst:t}),l)}});function jr(t,e,r,o){for(const a of t)if(0===a.issues.length)return e.value=a.value,e;const n=t.filter(t=>!Zt(t));return 1===n.length?(e.value=n[0].value,n[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(t=>t.issues.map(t=>Lt(t,o,wt())))}),e)}const Pr=/* @__PURE__ */ht("$ZodUnion",(t,e)=>{Ke.init(t,e),zt(t._zod,"optin",()=>e.options.some(t=>"optional"===t._zod.optin)?"optional":void 0),zt(t._zod,"optout",()=>e.options.some(t=>"optional"===t._zod.optout)?"optional":void 0),zt(t._zod,"values",()=>{if(e.options.every(t=>t._zod.values))return new Set(e.options.flatMap(t=>Array.from(t._zod.values)))}),zt(t._zod,"pattern",()=>{if(e.options.every(t=>t._zod.pattern)){const t=e.options.map(t=>t._zod.pattern);return new RegExp(`^(${t.map(t=>kt(t.source)).join("|")})$`)}});const r=1===e.options.length,o=e.options[0]._zod.run;t._zod.parse=(n,a)=>{if(r)return o(n,a);let i=!1;const s=[];for(const t of e.options){const e=t._zod.run({value:n.value,issues:[]},a);if(e instanceof Promise)s.push(e),i=!0;else{if(0===e.issues.length)return e;s.push(e)}}return i?Promise.all(s).then(e=>jr(e,n,t,a)):jr(s,n,t,a)}}),Dr=/* @__PURE__ */ht("$ZodIntersection",(t,e)=>{Ke.init(t,e),t._zod.parse=(t,r)=>{const o=t.value,n=e.left._zod.run({value:o,issues:[]},r),a=e.right._zod.run({value:o,issues:[]},r);return n instanceof Promise||a instanceof Promise?Promise.all([n,a]).then(([e,r])=>Fr(t,e,r)):Fr(t,n,a)}});function Zr(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t===+e)return{valid:!0,data:t};if(Nt(t)&&Nt(e)){const r=Object.keys(e),o=Object.keys(t).filter(t=>-1!==r.indexOf(t)),n={...t,...e};for(const a of o){const r=Zr(t[a],e[a]);if(!r.valid)return{valid:!1,mergeErrorPath:[a,...r.mergeErrorPath]};n[a]=r.data}return{valid:!0,data:n}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let o=0;o<t.length;o++){const n=Zr(t[o],e[o]);if(!n.valid)return{valid:!1,mergeErrorPath:[o,...n.mergeErrorPath]};r.push(n.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Fr(t,e,r){const o=/* @__PURE__ */new Map;let n;for(const s of e.issues)if("unrecognized_keys"===s.code){n??(n=s);for(const t of s.keys)o.has(t)||o.set(t,{}),o.get(t).l=!0}else t.issues.push(s);for(const s of r.issues)if("unrecognized_keys"===s.code)for(const t of s.keys)o.has(t)||o.set(t,{}),o.get(t).r=!0;else t.issues.push(s);const a=[...o].filter(([,t])=>t.l&&t.r).map(([t])=>t);if(a.length&&n&&t.issues.push({...n,keys:a}),Zt(t))return t;const i=Zr(e.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return t.value=i.data,t}const Ur=/* @__PURE__ */ht("$ZodEnum",(t,e)=>{Ke.init(t,e);const r=bt(e.entries),o=new Set(r);t._zod.values=o,t._zod.pattern=new RegExp(`^(${r.filter(t=>Mt.has(typeof t)).map(t=>"string"==typeof t?At(t):t.toString()).join("|")})$`),t._zod.parse=(e,n)=>{const a=e.value;return o.has(a)||e.issues.push({code:"invalid_value",values:r,input:a,inst:t}),e}}),Lr=/* @__PURE__ */ht("$ZodTransform",(t,e)=>{Ke.init(t,e),t._zod.parse=(r,o)=>{if("backward"===o.direction)throw new mt(t.constructor.name);const n=e.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(t=>(r.value=t,r));if(n instanceof Promise)throw new gt;return r.value=n,r}});function Rr(t,e){return t.issues.length&&void 0===e?{issues:[],value:void 0}:t}const Br=/* @__PURE__ */ht("$ZodOptional",(t,e)=>{Ke.init(t,e),t._zod.optin="optional",t._zod.optout="optional",zt(t._zod,"values",()=>e.innerType._zod.values?/* @__PURE__ */new Set([...e.innerType._zod.values,void 0]):void 0),zt(t._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${kt(t.source)})?$`):void 0}),t._zod.parse=(t,r)=>{if("optional"===e.innerType._zod.optin){const o=e.innerType._zod.run(t,r);return o instanceof Promise?o.then(e=>Rr(e,t.value)):Rr(o,t.value)}return void 0===t.value?t:e.innerType._zod.run(t,r)}}),Wr=/* @__PURE__ */ht("$ZodExactOptional",(t,e)=>{Br.init(t,e),zt(t._zod,"values",()=>e.innerType._zod.values),zt(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(t,r)=>e.innerType._zod.run(t,r)}),Jr=/* @__PURE__ */ht("$ZodNullable",(t,e)=>{Ke.init(t,e),zt(t._zod,"optin",()=>e.innerType._zod.optin),zt(t._zod,"optout",()=>e.innerType._zod.optout),zt(t._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${kt(t.source)}|null)$`):void 0}),zt(t._zod,"values",()=>e.innerType._zod.values?/* @__PURE__ */new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(t,r)=>null===t.value?t:e.innerType._zod.run(t,r)}),Vr=/* @__PURE__ */ht("$ZodDefault",(t,e)=>{Ke.init(t,e),t._zod.optin="optional",zt(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(t,r)=>{if("backward"===r.direction)return e.innerType._zod.run(t,r);if(void 0===t.value)return t.value=e.defaultValue,t;const o=e.innerType._zod.run(t,r);return o instanceof Promise?o.then(t=>qr(t,e)):qr(o,e)}});function qr(t,e){return void 0===t.value&&(t.value=e.defaultValue),t}const Hr=/* @__PURE__ */ht("$ZodPrefault",(t,e)=>{Ke.init(t,e),t._zod.optin="optional",zt(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(t,r)=>("backward"===r.direction||void 0===t.value&&(t.value=e.defaultValue),e.innerType._zod.run(t,r))}),Gr=/* @__PURE__ */ht("$ZodNonOptional",(t,e)=>{Ke.init(t,e),zt(t._zod,"values",()=>{const t=e.innerType._zod.values;return t?new Set([...t].filter(t=>void 0!==t)):void 0}),t._zod.parse=(r,o)=>{const n=e.innerType._zod.run(r,o);return n instanceof Promise?n.then(e=>Kr(e,t)):Kr(n,t)}});function Kr(t,e){return t.issues.length||void 0!==t.value||t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}const Yr=/* @__PURE__ */ht("$ZodCatch",(t,e)=>{Ke.init(t,e),zt(t._zod,"optin",()=>e.innerType._zod.optin),zt(t._zod,"optout",()=>e.innerType._zod.optout),zt(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(t,r)=>{if("backward"===r.direction)return e.innerType._zod.run(t,r);const o=e.innerType._zod.run(t,r);return o instanceof Promise?o.then(o=>(t.value=o.value,o.issues.length&&(t.value=e.catchValue({...t,error:{issues:o.issues.map(t=>Lt(t,r,wt()))},input:t.value}),t.issues=[]),t)):(t.value=o.value,o.issues.length&&(t.value=e.catchValue({...t,error:{issues:o.issues.map(t=>Lt(t,r,wt()))},input:t.value}),t.issues=[]),t)}}),Xr=/* @__PURE__ */ht("$ZodPipe",(t,e)=>{Ke.init(t,e),zt(t._zod,"values",()=>e.in._zod.values),zt(t._zod,"optin",()=>e.in._zod.optin),zt(t._zod,"optout",()=>e.out._zod.optout),zt(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(t,r)=>{if("backward"===r.direction){const o=e.out._zod.run(t,r);return o instanceof Promise?o.then(t=>Qr(t,e.in,r)):Qr(o,e.in,r)}const o=e.in._zod.run(t,r);return o instanceof Promise?o.then(t=>Qr(t,e.out,r)):Qr(o,e.out,r)}});function Qr(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}const to=/* @__PURE__ */ht("$ZodReadonly",(t,e)=>{Ke.init(t,e),zt(t._zod,"propValues",()=>e.innerType._zod.propValues),zt(t._zod,"values",()=>e.innerType._zod.values),zt(t._zod,"optin",()=>e.innerType?._zod?.optin),zt(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(t,r)=>{if("backward"===r.direction)return e.innerType._zod.run(t,r);const o=e.innerType._zod.run(t,r);return o instanceof Promise?o.then(eo):eo(o)}});function eo(t){return t.value=Object.freeze(t.value),t}const ro=/* @__PURE__ */ht("$ZodCustom",(t,e)=>{Ne.init(t,e),Ke.init(t,e),t._zod.parse=(t,e)=>t,t._zod.check=r=>{const o=r.value,n=e.fn(o);if(n instanceof Promise)return n.then(e=>oo(e,r,o,t));oo(n,r,o,t)}});function oo(t,e,r,o){if(!t){const t={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(t.params=o._zod.def.params),e.issues.push(Bt(t))}}var no;(no=globalThis).__zod_globalRegistry??(no.__zod_globalRegistry=new class{constructor(){this._map=/* @__PURE__ */new WeakMap,this._idmap=/* @__PURE__ */new Map}add(t,...e){const r=e[0];return this._map.set(t,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=/* @__PURE__ */new WeakMap,this._idmap=/* @__PURE__ */new Map,this}remove(t){const e=this._map.get(t);return e&&"object"==typeof e&&"id"in e&&this._idmap.delete(e.id),this._map.delete(t),this}get(t){const e=t._zod.parent;if(e){const r={...this.get(e)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}});const ao=globalThis.__zod_globalRegistry;function io(t,e){return new t({type:"string",...Pt(e)})}function so(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Pt(e)})}function co(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Pt(e)})}function lo(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Pt(e)})}function uo(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Pt(e)})}function po(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Pt(e)})}function ho(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Pt(e)})}function go(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Pt(e)})}function mo(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Pt(e)})}function fo(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Pt(e)})}function wo(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Pt(e)})}function bo(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Pt(e)})}function yo(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Pt(e)})}function vo(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Pt(e)})}function xo(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Pt(e)})}function ko(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Pt(e)})}function _o(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Pt(e)})}function zo(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Pt(e)})}function Eo(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Pt(e)})}function So(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Pt(e)})}function Oo(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Pt(e)})}function Io(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Pt(e)})}function $o(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Pt(e)})}function Co(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Pt(e)})}function No(t,e){return new t({type:"string",format:"date",check:"string_format",...Pt(e)})}function To(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Pt(e)})}function Mo(t,e){return new t({type:"string",format:"duration",check:"string_format",...Pt(e)})}function Ao(t,e){return new t({type:"number",checks:[],...Pt(e)})}function jo(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Pt(e)})}function Po(t){return new t({type:"any"})}function Do(t){return new t({type:"unknown"})}function Zo(t,e){return new t({type:"never",...Pt(e)})}function Fo(t,e){return new Me({check:"less_than",...Pt(e),value:t,inclusive:!1})}function Uo(t,e){return new Me({check:"less_than",...Pt(e),value:t,inclusive:!0})}function Lo(t,e){return new Ae({check:"greater_than",...Pt(e),value:t,inclusive:!1})}function Ro(t,e){return new Ae({check:"greater_than",...Pt(e),value:t,inclusive:!0})}function Bo(t,e){return new je({check:"multiple_of",...Pt(e),value:t})}function Wo(t,e){return new De({check:"max_length",...Pt(e),maximum:t})}function Jo(t,e){return new Ze({check:"min_length",...Pt(e),minimum:t})}function Vo(t,e){return new Fe({check:"length_equals",...Pt(e),length:t})}function qo(t,e){return new Le({check:"string_format",format:"regex",...Pt(e),pattern:t})}function Ho(t){return new Re({check:"string_format",format:"lowercase",...Pt(t)})}function Go(t){return new Be({check:"string_format",format:"uppercase",...Pt(t)})}function Ko(t,e){return new We({check:"string_format",format:"includes",...Pt(e),includes:t})}function Yo(t,e){return new Je({check:"string_format",format:"starts_with",...Pt(e),prefix:t})}function Xo(t,e){return new Ve({check:"string_format",format:"ends_with",...Pt(e),suffix:t})}function Qo(t){return new qe({check:"overwrite",tx:t})}function tn(t){/* @__PURE__ */
|
|
16
|
+
/* @__PURE__ */T("button",{onClick:this.handleReset,className:"px-4 py-2 bg-primary text-primary-foreground rounded-lg font-medium hover:opacity-90 transition-opacity",children:"Intentar de nuevo"})]}):this.props.children}}const Z={bubble:"rounded-2xl",image:"rounded-xl",button:"rounded-xl",card:"rounded-2xl"},F={bg:"bg-muted/50 dark:bg-muted/20",text:"text-foreground",border:"border-border/50"},U={text:"text-primary-foreground"};const R=(t,e)=>e.some(e=>t instanceof e);let L,B;const W=/* @__PURE__ */new WeakMap,J=/* @__PURE__ */new WeakMap,V=/* @__PURE__ */new WeakMap;let q={get(t,e,r){if(t instanceof IDBTransaction){if("done"===e)return W.get(t);if("store"===e)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return K(t[e])},set:(t,e,r)=>(t[e]=r,!0),has:(t,e)=>t instanceof IDBTransaction&&("done"===e||"store"===e)||e in t};function H(t){q=t(q)}function G(t){return"function"==typeof t?(e=t,(B||(B=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Y(this),t),K(this.request)}:function(...t){return K(e.apply(Y(this),t))}):(t instanceof IDBTransaction&&function(t){if(W.has(t))return;const e=new Promise((e,r)=>{const o=()=>{t.removeEventListener("complete",n),t.removeEventListener("error",a),t.removeEventListener("abort",a)},n=()=>{e(),o()},a=()=>{r(t.error||new DOMException("AbortError","AbortError")),o()};t.addEventListener("complete",n),t.addEventListener("error",a),t.addEventListener("abort",a)});W.set(t,e)}(t),R(t,L||(L=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(t,q):t);var e}function K(t){if(t instanceof IDBRequest)return function(t){const e=new Promise((e,r)=>{const o=()=>{t.removeEventListener("success",n),t.removeEventListener("error",a)},n=()=>{e(K(t.result)),o()},a=()=>{r(t.error),o()};t.addEventListener("success",n),t.addEventListener("error",a)});return V.set(e,t),e}(t);if(J.has(t))return J.get(t);const e=G(t);return e!==t&&(J.set(t,e),V.set(e,t)),e}const Y=t=>V.get(t),X=["get","getKey","getAll","getAllKeys","count"],Q=["put","add","delete","clear"],tt=/* @__PURE__ */new Map;function et(t,e){if(!(t instanceof IDBDatabase)||e in t||"string"!=typeof e)return;if(tt.get(e))return tt.get(e);const r=e.replace(/FromIndex$/,""),o=e!==r,n=Q.includes(r);if(!(r in(o?IDBIndex:IDBObjectStore).prototype)||!n&&!X.includes(r))return;const a=async function(t,...e){const a=this.transaction(t,n?"readwrite":"readonly");let i=a.store;return o&&(i=i.index(e.shift())),(await Promise.all([i[r](...e),n&&a.done]))[0]};return tt.set(e,a),a}H(t=>({...t,get:(e,r,o)=>et(e,r)||t.get(e,r,o),has:(e,r)=>!!et(e,r)||t.has(e,r)}));const rt=["continue","continuePrimaryKey","advance"],ot={},nt=/* @__PURE__ */new WeakMap,at=/* @__PURE__ */new WeakMap,it={get(t,e){if(!rt.includes(e))return t[e];let r=ot[e];return r||(r=ot[e]=function(...t){nt.set(this,at.get(this)[e](...t))}),r}};async function*st(...t){let e=this;if(e instanceof IDBCursor||(e=await e.openCursor(...t)),!e)return;const r=new Proxy(e,it);for(at.set(r,e),V.set(r,Y(e));e;)yield r,e=await(nt.get(r)||e.continue()),nt.delete(r)}function ct(t,e){return e===Symbol.asyncIterator&&R(t,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===e&&R(t,[IDBIndex,IDBObjectStore])}H(t=>({...t,get:(e,r,o)=>ct(e,r)?st:t.get(e,r,o),has:(e,r)=>ct(e,r)||t.has(e,r)}));class dt{db=null;DB_NAME;DB_VERSION=1;constructor(t="default"){this.DB_NAME=`botuyo-chat-${t}`}async init(){try{this.db=await function(t,e,{blocked:r,upgrade:o,blocking:n,terminated:a}={}){const i=indexedDB.open(t,e),s=K(i);return o&&i.addEventListener("upgradeneeded",t=>{o(K(i.result),t.oldVersion,t.newVersion,K(i.transaction),t)}),r&&i.addEventListener("blocked",t=>r(t.oldVersion,t.newVersion,t)),s.then(t=>{a&&t.addEventListener("close",()=>a()),n&&t.addEventListener("versionchange",t=>n(t.oldVersion,t.newVersion,t))}).catch(()=>{}),s}(this.DB_NAME,this.DB_VERSION,{upgrade(t){t.objectStoreNames.contains("messages")||t.createObjectStore("messages",{keyPath:"id"}).createIndex("by-timestamp","timestamp"),t.objectStoreNames.contains("metadata")||t.createObjectStore("metadata")}}),x.info("IndexedDB initialized")}catch(t){throw x.error("Failed to initialize IndexedDB:",t),t}}async saveMessage(t){this.db||await this.init();try{await this.db.put("messages",t)}catch(e){x.error("Failed to save message:",e)}}async saveMessages(t){this.db||await this.init();try{const e=this.db.transaction("messages","readwrite");await Promise.all([...t.map(t=>e.store.put(t)),e.done])}catch(e){x.error("Failed to save messages:",e)}}async getMessages(t=100){this.db||await this.init();try{return(await this.db.getAllFromIndex("messages","by-timestamp")).slice(-t)}catch(e){return x.error("Failed to get messages:",e),[]}}async getMessage(t){this.db||await this.init();try{return await this.db.get("messages",t)}catch(e){return void x.error("Failed to get message:",e)}}async deleteMessage(t){this.db||await this.init();try{await this.db.delete("messages",t)}catch(e){x.error("Failed to delete message:",e)}}async clearMessages(){this.db||await this.init();try{await this.db.clear("messages"),x.info("Messages cleared from IndexedDB")}catch(t){x.error("Failed to clear messages:",t)}}async setMetadata(t){this.db||await this.init();try{await this.db.put("metadata",t,"chat-metadata")}catch(e){x.error("Failed to set metadata:",e)}}async getMetadata(){this.db||await this.init();try{return await this.db.get("metadata","chat-metadata")}catch(t){return x.error("Failed to get metadata:",t),null}}async clearAll(){this.db||await this.init();try{await Promise.all([this.db.clear("messages"),this.db.clear("metadata")]),x.info("All data cleared from IndexedDB")}catch(t){x.error("Failed to clear all data:",t)}}async migrateFromLocalStorage(t="default"){try{const e=`botuyo_chat_v1_${t}`,r=localStorage.getItem(e);if(!r)return;const o=JSON.parse(r);if(o.messages&&Array.isArray(o.messages)){const t=o.messages.map(t=>({...t,timestamp:new Date(t.timestamp)}));await this.saveMessages(t),x.info(`Migrated ${t.length} messages from localStorage`)}o.sessionId&&await this.setMetadata({sessionId:o.sessionId}),localStorage.removeItem(e),x.info("Migration from localStorage completed")}catch(e){x.error("Failed to migrate from localStorage:",e)}}}const lt=/* @__PURE__ */new Map,ut={isOpen:!1,isConnected:!1,isTyping:!1,messages:[],error:null,sessionId:null};function pt(t,e){switch(e.type){case"TOGGLE_WINDOW":return{...t,isOpen:!t.isOpen};case"OPEN_WINDOW":return{...t,isOpen:!0};case"CLOSE_WINDOW":return{...t,isOpen:!1};case"SET_CONNECTED":return{...t,isConnected:e.payload};case"SET_TYPING":return{...t,isTyping:e.payload};case"ADD_MESSAGE":{if(t.messages.some(t=>t.id===e.payload.id))return t;if(e.payload.id.startsWith("msg-")&&"text"===e.payload.type){const r=/* @__PURE__ */(new Date).getTime();if(t.messages.slice(-10).some(t=>"text"===t.type&&t.sender===e.payload.sender&&"content"in t&&"content"in e.payload&&t.content===e.payload.content&&Math.abs(r-new Date(t.timestamp).getTime())<3e4))return t}const r=[...t.messages,e.payload],o="bot"===e.payload.sender;return{...t,messages:r,isTyping:!o&&t.isTyping}}case"SET_MESSAGES":return{...t,messages:[...e.payload]};case"SET_ERROR":return{...t,error:e.payload};case"SET_SESSION_ID":return{...t,sessionId:e.payload};case"CLEAR_CHAT":return{...ut,isOpen:t.isOpen};case"RESTORE_SESSION":return{...t,...e.payload,isConnected:!1,isTyping:!1,error:null};default:return t}}function ht(t,e,r){function o(r,o){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:o,constr:i,traits:/* @__PURE__ */new Set},enumerable:!1}),r._zod.traits.has(t))return;r._zod.traits.add(t),e(r,o);const n=i.prototype,a=Object.keys(n);for(let t=0;t<a.length;t++){const e=a[t];e in r||(r[e]=n[e].bind(r))}}const n=r?.Parent??Object;class a extends n{}function i(t){var e;const n=r?.Parent?new a:this;o(n,t),(e=n._zod).deferred??(e.deferred=[]);for(const r of n._zod.deferred)r();return n}return Object.defineProperty(a,"name",{value:t}),Object.defineProperty(i,"init",{value:o}),Object.defineProperty(i,Symbol.hasInstance,{value:e=>!!(r?.Parent&&e instanceof r.Parent)||e?._zod?.traits?.has(t)}),Object.defineProperty(i,"name",{value:t}),i}class gt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class mt extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const ft={};function wt(t){return ft}function bt(t){const e=Object.values(t).filter(t=>"number"==typeof t);return Object.entries(t).filter(([t,r])=>-1===e.indexOf(+t)).map(([t,e])=>e)}function yt(t,e){return"bigint"==typeof e?e.toString():e}function vt(t){return{get value(){{const e=t();return Object.defineProperty(this,"value",{value:e}),e}}}}function xt(t){return null==t}function kt(t){const e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}const _t=/* @__PURE__ */Symbol("evaluating");function zt(t,e,r){let o;Object.defineProperty(t,e,{get(){if(o!==_t)return void 0===o&&(o=_t,o=r()),o},set(r){Object.defineProperty(t,e,{value:r})},configurable:!0})}function Et(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function St(...t){const e={};for(const r of t){const t=Object.getOwnPropertyDescriptors(r);Object.assign(e,t)}return Object.defineProperties({},e)}function Ot(t){return JSON.stringify(t)}const It="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function $t(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}const Ct=vt(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(t){return!1}});function Nt(t){if(!1===$t(t))return!1;const e=t.constructor;if(void 0===e)return!0;if("function"!=typeof e)return!0;const r=e.prototype;return!1!==$t(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function Tt(t){return Nt(t)?{...t}:Array.isArray(t)?[...t]:t}const Mt=/* @__PURE__ */new Set(["string","number","symbol"]);function At(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function jt(t,e,r){const o=new t._zod.constr(e??t._zod.def);return e&&!r?.parent||(o._zod.parent=t),o}function Pt(t){const e=t;if(!e)return{};if("string"==typeof e)return{error:()=>e};if(void 0!==e?.message){if(void 0!==e?.error)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,"string"==typeof e.error?{...e,error:()=>e.error}:e}const Dt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Zt(t,e=0){if(!0===t.aborted)return!0;for(let r=e;r<t.issues.length;r++)if(!0!==t.issues[r]?.continue)return!0;return!1}function Ft(t,e){return e.map(e=>{var r;return(r=e).path??(r.path=[]),e.path.unshift(t),e})}function Ut(t){return"string"==typeof t?t:t?.message}function Rt(t,e,r){const o={...t,path:t.path??[]};if(!t.message){const n=Ut(t.inst?._zod.def?.error?.(t))??Ut(e?.error?.(t))??Ut(r.customError?.(t))??Ut(r.localeError?.(t))??"Invalid input";o.message=n}return delete o.inst,delete o.continue,e?.reportInput||delete o.input,o}function Lt(t){return Array.isArray(t)?"array":"string"==typeof t?"string":"unknown"}function Bt(...t){const[e,r,o]=t;return"string"==typeof e?{message:e,code:"custom",input:r,inst:o}:{...e}}const Wt=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,yt,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},Jt=ht("$ZodError",Wt),Vt=ht("$ZodError",Wt,{Parent:Error}),qt=t=>(e,r,o,n)=>{const a=o?Object.assign(o,{async:!1}):{async:!1},i=e._zod.run({value:r,issues:[]},a);if(i instanceof Promise)throw new gt;if(i.issues.length){const e=new(n?.Err??t)(i.issues.map(t=>Rt(t,a,wt())));throw It(e,n?.callee),e}return i.value},Ht=t=>async(e,r,o,n)=>{const a=o?Object.assign(o,{async:!0}):{async:!0};let i=e._zod.run({value:r,issues:[]},a);if(i instanceof Promise&&(i=await i),i.issues.length){const e=new(n?.Err??t)(i.issues.map(t=>Rt(t,a,wt())));throw It(e,n?.callee),e}return i.value},Gt=t=>(e,r,o)=>{const n=o?{...o,async:!1}:{async:!1},a=e._zod.run({value:r,issues:[]},n);if(a instanceof Promise)throw new gt;return a.issues.length?{success:!1,error:new(t??Jt)(a.issues.map(t=>Rt(t,n,wt())))}:{success:!0,data:a.value}},Kt=/* @__PURE__ */Gt(Vt),Yt=t=>async(e,r,o)=>{const n=o?Object.assign(o,{async:!0}):{async:!0};let a=e._zod.run({value:r,issues:[]},n);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new t(a.issues.map(t=>Rt(t,n,wt())))}:{success:!0,data:a.value}},Xt=/* @__PURE__ */Yt(Vt),Qt=t=>(e,r,o)=>{const n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return qt(t)(e,r,n)},te=t=>(e,r,o)=>qt(t)(e,r,o),ee=t=>async(e,r,o)=>{const n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Ht(t)(e,r,n)},re=t=>async(e,r,o)=>Ht(t)(e,r,o),oe=t=>(e,r,o)=>{const n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Gt(t)(e,r,n)},ne=t=>(e,r,o)=>Gt(t)(e,r,o),ae=t=>async(e,r,o)=>{const n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Yt(t)(e,r,n)},ie=t=>async(e,r,o)=>Yt(t)(e,r,o),se=/^[cC][^\s-]{8,}$/,ce=/^[0-9a-z]+$/,de=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,le=/^[0-9a-vA-V]{20}$/,ue=/^[A-Za-z0-9]{27}$/,pe=/^[a-zA-Z0-9_-]{21}$/,he=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ge=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,me=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,fe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,we=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,be=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ye=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ve=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,xe=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ke=/^[A-Za-z0-9_-]*$/,_e=/^\+[1-9]\d{6,14}$/,ze="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Ee=/* @__PURE__ */new RegExp(`^${ze}$`);function Se(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof t.precision?-1===t.precision?`${e}`:0===t.precision?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}const Oe=/^-?\d+$/,Ie=/^-?\d+(?:\.\d+)?$/,$e=/^[^A-Z]*$/,Ce=/^[^a-z]*$/,Ne=/* @__PURE__ */ht("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Te={number:"number",bigint:"bigint",object:"date"},Me=/* @__PURE__ */ht("$ZodCheckLessThan",(t,e)=>{Ne.init(t,e);const r=Te[typeof e.value];t._zod.onattach.push(t=>{const r=t._zod.bag,o=(e.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?r.maximum=e.value:r.exclusiveMaximum=e.value)}),t._zod.check=o=>{(e.inclusive?o.value<=e.value:o.value<e.value)||o.issues.push({origin:r,code:"too_big",maximum:"object"==typeof e.value?e.value.getTime():e.value,input:o.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Ae=/* @__PURE__ */ht("$ZodCheckGreaterThan",(t,e)=>{Ne.init(t,e);const r=Te[typeof e.value];t._zod.onattach.push(t=>{const r=t._zod.bag,o=(e.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?r.minimum=e.value:r.exclusiveMinimum=e.value)}),t._zod.check=o=>{(e.inclusive?o.value>=e.value:o.value>e.value)||o.issues.push({origin:r,code:"too_small",minimum:"object"==typeof e.value?e.value.getTime():e.value,input:o.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),je=/* @__PURE__ */ht("$ZodCheckMultipleOf",(t,e)=>{Ne.init(t,e),t._zod.onattach.push(t=>{var r;(r=t._zod.bag).multipleOf??(r.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?r.value%e.value===BigInt(0):0===function(t,e){const r=(t.toString().split(".")[1]||"").length,o=e.toString();let n=(o.split(".")[1]||"").length;if(0===n&&/\d?e-\d?/.test(o)){const t=o.match(/\d?e-(\d?)/);t?.[1]&&(n=Number.parseInt(t[1]))}const a=r>n?r:n;return Number.parseInt(t.toFixed(a).replace(".",""))%Number.parseInt(e.toFixed(a).replace(".",""))/10**a}(r.value,e.value))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),Pe=/* @__PURE__ */ht("$ZodCheckNumberFormat",(t,e)=>{Ne.init(t,e),e.format=e.format||"float64";const r=e.format?.includes("int"),o=r?"int":"number",[n,a]=Dt[e.format];t._zod.onattach.push(t=>{const o=t._zod.bag;o.format=e.format,o.minimum=n,o.maximum=a,r&&(o.pattern=Oe)}),t._zod.check=i=>{const s=i.value;if(r){if(!Number.isInteger(s))return void i.issues.push({expected:o,format:e.format,code:"invalid_type",continue:!1,input:s,inst:t});if(!Number.isSafeInteger(s))return void(s>0?i.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:o,inclusive:!0,continue:!e.abort}):i.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:o,inclusive:!0,continue:!e.abort}))}s<n&&i.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!e.abort}),s>a&&i.issues.push({origin:"number",input:s,code:"too_big",maximum:a,inclusive:!0,inst:t,continue:!e.abort})}}),De=/* @__PURE__ */ht("$ZodCheckMaxLength",(t,e)=>{var r;Ne.init(t,e),(r=t._zod.def).when??(r.when=t=>{const e=t.value;return!xt(e)&&void 0!==e.length}),t._zod.onattach.push(t=>{const r=t._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<r&&(t._zod.bag.maximum=e.maximum)}),t._zod.check=r=>{const o=r.value;if(o.length<=e.maximum)return;const n=Lt(o);r.issues.push({origin:n,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),Ze=/* @__PURE__ */ht("$ZodCheckMinLength",(t,e)=>{var r;Ne.init(t,e),(r=t._zod.def).when??(r.when=t=>{const e=t.value;return!xt(e)&&void 0!==e.length}),t._zod.onattach.push(t=>{const r=t._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>r&&(t._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{const o=r.value;if(o.length>=e.minimum)return;const n=Lt(o);r.issues.push({origin:n,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),Fe=/* @__PURE__ */ht("$ZodCheckLengthEquals",(t,e)=>{var r;Ne.init(t,e),(r=t._zod.def).when??(r.when=t=>{const e=t.value;return!xt(e)&&void 0!==e.length}),t._zod.onattach.push(t=>{const r=t._zod.bag;r.minimum=e.length,r.maximum=e.length,r.length=e.length}),t._zod.check=r=>{const o=r.value,n=o.length;if(n===e.length)return;const a=Lt(o),i=n>e.length;r.issues.push({origin:a,...i?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),Ue=/* @__PURE__ */ht("$ZodCheckStringFormat",(t,e)=>{var r,o;Ne.init(t,e),t._zod.onattach.push(t=>{const r=t._zod.bag;r.format=e.format,e.pattern&&(r.patterns??(r.patterns=/* @__PURE__ */new Set),r.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=r=>{e.pattern.lastIndex=0,e.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:e.format,input:r.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(o=t._zod).check??(o.check=()=>{})}),Re=/* @__PURE__ */ht("$ZodCheckRegex",(t,e)=>{Ue.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,e.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),Le=/* @__PURE__ */ht("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=$e),Ue.init(t,e)}),Be=/* @__PURE__ */ht("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Ce),Ue.init(t,e)}),We=/* @__PURE__ */ht("$ZodCheckIncludes",(t,e)=>{Ne.init(t,e);const r=At(e.includes),o=new RegExp("number"==typeof e.position?`^.{${e.position}}${r}`:r);e.pattern=o,t._zod.onattach.push(t=>{const e=t._zod.bag;e.patterns??(e.patterns=/* @__PURE__ */new Set),e.patterns.add(o)}),t._zod.check=r=>{r.value.includes(e.includes,e.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:r.value,inst:t,continue:!e.abort})}}),Je=/* @__PURE__ */ht("$ZodCheckStartsWith",(t,e)=>{Ne.init(t,e);const r=new RegExp(`^${At(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(t=>{const e=t._zod.bag;e.patterns??(e.patterns=/* @__PURE__ */new Set),e.patterns.add(r)}),t._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:t,continue:!e.abort})}}),Ve=/* @__PURE__ */ht("$ZodCheckEndsWith",(t,e)=>{Ne.init(t,e);const r=new RegExp(`.*${At(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(t=>{const e=t._zod.bag;e.patterns??(e.patterns=/* @__PURE__ */new Set),e.patterns.add(r)}),t._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:t,continue:!e.abort})}}),qe=/* @__PURE__ */ht("$ZodCheckOverwrite",(t,e)=>{Ne.init(t,e),t._zod.check=t=>{t.value=e.tx(t.value)}});class He{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if("function"==typeof t)return t(this,{execution:"sync"}),void t(this,{execution:"async"});const e=t.split("\n").filter(t=>t),r=Math.min(...e.map(t=>t.length-t.trimStart().length)),o=e.map(t=>t.slice(r)).map(t=>" ".repeat(2*this.indent)+t);for(const n of o)this.content.push(n)}compile(){const t=Function,e=this?.args;return new t(...e,[...(this?.content??[""]).map(t=>` ${t}`)].join("\n"))}}const Ge={major:4,minor:3,patch:6},Ke=/* @__PURE__ */ht("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Ge;const o=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&o.unshift(t);for(const n of o)for(const e of n._zod.onattach)e(t);if(0===o.length)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{const e=(t,e,r)=>{let o,n=Zt(t);for(const a of e){if(a._zod.def.when){if(!a._zod.def.when(t))continue}else if(n)continue;const e=t.issues.length,i=a._zod.check(t);if(i instanceof Promise&&!1===r?.async)throw new gt;if(o||i instanceof Promise)o=(o??Promise.resolve()).then(async()=>{await i,t.issues.length!==e&&(n||(n=Zt(t,e)))});else{if(t.issues.length===e)continue;n||(n=Zt(t,e))}}return o?o.then(()=>t):t},r=(r,n,a)=>{if(Zt(r))return r.aborted=!0,r;const i=e(n,o,a);if(i instanceof Promise){if(!1===a.async)throw new gt;return i.then(e=>t._zod.parse(e,a))}return t._zod.parse(i,a)};t._zod.run=(n,a)=>{if(a.skipChecks)return t._zod.parse(n,a);if("backward"===a.direction){const e=t._zod.parse({value:n.value,issues:[]},{...a,skipChecks:!0});return e instanceof Promise?e.then(t=>r(t,n,a)):r(e,n,a)}const i=t._zod.parse(n,a);if(i instanceof Promise){if(!1===a.async)throw new gt;return i.then(t=>e(t,o,a))}return e(i,o,a)}}zt(t,"~standard",()=>({validate:e=>{try{const r=Kt(t,e);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return Xt(t,e).then(t=>t.success?{value:t.data}:{issues:t.error?.issues})}},vendor:"zod",version:1}))}),Ye=/* @__PURE__ */ht("$ZodString",(t,e)=>{var r;Ke.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??(r=t._zod.bag,new RegExp(`^${r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*"}$`)),t._zod.parse=(r,o)=>{if(e.coerce)try{r.value=String(r.value)}catch(n){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),Xe=/* @__PURE__ */ht("$ZodStringFormat",(t,e)=>{Ue.init(t,e),Ye.init(t,e)}),Qe=/* @__PURE__ */ht("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=ge),Xe.init(t,e)}),tr=/* @__PURE__ */ht("$ZodUUID",(t,e)=>{if(e.version){const t={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(void 0===t)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=me(t))}else e.pattern??(e.pattern=me());Xe.init(t,e)}),er=/* @__PURE__ */ht("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=fe),Xe.init(t,e)}),rr=/* @__PURE__ */ht("$ZodURL",(t,e)=>{Xe.init(t,e),t._zod.check=r=>{try{const o=r.value.trim(),n=new URL(o);return e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),void(e.normalize?r.value=n.href:r.value=o)}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),or=/* @__PURE__ */ht("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Xe.init(t,e)}),nr=/* @__PURE__ */ht("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=pe),Xe.init(t,e)}),ar=/* @__PURE__ */ht("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=se),Xe.init(t,e)}),ir=/* @__PURE__ */ht("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=ce),Xe.init(t,e)}),sr=/* @__PURE__ */ht("$ZodULID",(t,e)=>{e.pattern??(e.pattern=de),Xe.init(t,e)}),cr=/* @__PURE__ */ht("$ZodXID",(t,e)=>{e.pattern??(e.pattern=le),Xe.init(t,e)}),dr=/* @__PURE__ */ht("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=ue),Xe.init(t,e)}),lr=/* @__PURE__ */ht("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=function(t){const e=Se({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${e}(?:${r.join("|")})`;return new RegExp(`^${ze}T(?:${o})$`)}(e)),Xe.init(t,e)}),ur=/* @__PURE__ */ht("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Ee),Xe.init(t,e)}),pr=/* @__PURE__ */ht("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=new RegExp(`^${Se(e)}$`)),Xe.init(t,e)}),hr=/* @__PURE__ */ht("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=he),Xe.init(t,e)}),gr=/* @__PURE__ */ht("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=we),Xe.init(t,e),t._zod.bag.format="ipv4"}),mr=/* @__PURE__ */ht("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=be),Xe.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),fr=/* @__PURE__ */ht("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=ye),Xe.init(t,e)}),wr=/* @__PURE__ */ht("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=ve),Xe.init(t,e),t._zod.check=r=>{const o=r.value.split("/");try{if(2!==o.length)throw new Error;const[t,e]=o;if(!e)throw new Error;const r=Number(e);if(`${r}`!==e)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${t}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function br(t){if(""===t)return!0;if(t.length%4!=0)return!1;try{return atob(t),!0}catch{return!1}}const yr=/* @__PURE__ */ht("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=xe),Xe.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{br(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}}),vr=/* @__PURE__ */ht("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=ke),Xe.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{(function(t){if(!ke.test(t))return!1;const e=t.replace(/[-_]/g,t=>"-"===t?"+":"/");return br(e.padEnd(4*Math.ceil(e.length/4),"="))})(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),xr=/* @__PURE__ */ht("$ZodE164",(t,e)=>{e.pattern??(e.pattern=_e),Xe.init(t,e)}),kr=/* @__PURE__ */ht("$ZodJWT",(t,e)=>{Xe.init(t,e),t._zod.check=r=>{(function(t,e=null){try{const r=t.split(".");if(3!==r.length)return!1;const[o]=r;if(!o)return!1;const n=JSON.parse(atob(o));return!("typ"in n&&"JWT"!==n?.typ||!n.alg||e&&(!("alg"in n)||n.alg!==e))}catch{return!1}})(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),_r=/* @__PURE__ */ht("$ZodNumber",(t,e)=>{Ke.init(t,e),t._zod.pattern=t._zod.bag.pattern??Ie,t._zod.parse=(r,o)=>{if(e.coerce)try{r.value=Number(r.value)}catch(i){}const n=r.value;if("number"==typeof n&&!Number.isNaN(n)&&Number.isFinite(n))return r;const a="number"==typeof n?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:t,...a?{received:a}:{}}),r}}),zr=/* @__PURE__ */ht("$ZodNumberFormat",(t,e)=>{Pe.init(t,e),_r.init(t,e)}),Er=/* @__PURE__ */ht("$ZodAny",(t,e)=>{Ke.init(t,e),t._zod.parse=t=>t}),Sr=/* @__PURE__ */ht("$ZodUnknown",(t,e)=>{Ke.init(t,e),t._zod.parse=t=>t}),Or=/* @__PURE__ */ht("$ZodNever",(t,e)=>{Ke.init(t,e),t._zod.parse=(e,r)=>(e.issues.push({expected:"never",code:"invalid_type",input:e.value,inst:t}),e)});function Ir(t,e,r){t.issues.length&&e.issues.push(...Ft(r,t.issues)),e.value[r]=t.value}const $r=/* @__PURE__ */ht("$ZodArray",(t,e)=>{Ke.init(t,e),t._zod.parse=(r,o)=>{const n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:t}),r;r.value=Array(n.length);const a=[];for(let t=0;t<n.length;t++){const i=n[t],s=e.element._zod.run({value:i,issues:[]},o);s instanceof Promise?a.push(s.then(e=>Ir(e,r,t))):Ir(s,r,t)}return a.length?Promise.all(a).then(()=>r):r}});function Cr(t,e,r,o,n){if(t.issues.length){if(n&&!(r in o))return;e.issues.push(...Ft(r,t.issues))}void 0===t.value?r in o&&(e.value[r]=void 0):e.value[r]=t.value}function Nr(t){const e=Object.keys(t.shape);for(const n of e)if(!t.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const r=(o=t.shape,Object.keys(o).filter(t=>"optional"===o[t]._zod.optin&&"optional"===o[t]._zod.optout));var o;return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function Tr(t,e,r,o,n,a){const i=[],s=n.keySet,c=n.catchall._zod,d=c.def.type,l="optional"===c.optout;for(const u in e){if(s.has(u))continue;if("never"===d){i.push(u);continue}const n=c.run({value:e[u],issues:[]},o);n instanceof Promise?t.push(n.then(t=>Cr(t,r,u,e,l))):Cr(n,r,u,e,l)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:e,inst:a}),t.length?Promise.all(t).then(()=>r):r}const Mr=/* @__PURE__ */ht("$ZodObject",(t,e)=>{Ke.init(t,e);const r=Object.getOwnPropertyDescriptor(e,"shape");if(!r?.get){const t=e.shape;Object.defineProperty(e,"shape",{get:()=>{const r={...t};return Object.defineProperty(e,"shape",{value:r}),r}})}const o=vt(()=>Nr(e));zt(t._zod,"propValues",()=>{const t=e.shape,r={};for(const e in t){const o=t[e]._zod;if(o.values){r[e]??(r[e]=/* @__PURE__ */new Set);for(const t of o.values)r[e].add(t)}}return r});const n=$t,a=e.catchall;let i;t._zod.parse=(e,r)=>{i??(i=o.value);const s=e.value;if(!n(s))return e.issues.push({expected:"object",code:"invalid_type",input:s,inst:t}),e;e.value={};const c=[],d=i.shape;for(const t of i.keys){const o=d[t],n="optional"===o._zod.optout,a=o._zod.run({value:s[t],issues:[]},r);a instanceof Promise?c.push(a.then(r=>Cr(r,e,t,s,n))):Cr(a,e,t,s,n)}return a?Tr(c,s,e,r,o.value,t):c.length?Promise.all(c).then(()=>e):e}}),Ar=/* @__PURE__ */ht("$ZodObjectJIT",(t,e)=>{Mr.init(t,e);const r=t._zod.parse,o=vt(()=>Nr(e));let n;const a=$t,i=!ft.jitless,s=i&&Ct.value,c=e.catchall;let d;t._zod.parse=(l,u)=>{d??(d=o.value);const p=l.value;return a(p)?i&&s&&!1===u?.async&&!0!==u.jitless?(n||(n=(t=>{const e=new He(["shape","payload","ctx"]),r=o.value,n=t=>{const e=Ot(t);return`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`};e.write("const input = payload.value;");const a=/* @__PURE__ */Object.create(null);let i=0;for(const o of r.keys)a[o]="key_"+i++;e.write("const newResult = {};");for(const o of r.keys){const r=a[o],i=Ot(o),s=t[o],c="optional"===s?._zod?.optout;e.write(`const ${r} = ${n(o)};`),c?e.write(`\n if (${r}.issues.length) {\n if (${i} in input) {\n payload.issues = payload.issues.concat(${r}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n }\n \n if (${r}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${r}.value;\n }\n \n `):e.write(`\n if (${r}.issues.length) {\n payload.issues = payload.issues.concat(${r}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${r}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${r}.value;\n }\n \n `)}e.write("payload.value = newResult;"),e.write("return payload;");const s=e.compile();return(e,r)=>s(t,e,r)})(e.shape)),l=n(l,u),c?Tr([],p,l,u,d,t):l):r(l,u):(l.issues.push({expected:"object",code:"invalid_type",input:p,inst:t}),l)}});function jr(t,e,r,o){for(const a of t)if(0===a.issues.length)return e.value=a.value,e;const n=t.filter(t=>!Zt(t));return 1===n.length?(e.value=n[0].value,n[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(t=>t.issues.map(t=>Rt(t,o,wt())))}),e)}const Pr=/* @__PURE__ */ht("$ZodUnion",(t,e)=>{Ke.init(t,e),zt(t._zod,"optin",()=>e.options.some(t=>"optional"===t._zod.optin)?"optional":void 0),zt(t._zod,"optout",()=>e.options.some(t=>"optional"===t._zod.optout)?"optional":void 0),zt(t._zod,"values",()=>{if(e.options.every(t=>t._zod.values))return new Set(e.options.flatMap(t=>Array.from(t._zod.values)))}),zt(t._zod,"pattern",()=>{if(e.options.every(t=>t._zod.pattern)){const t=e.options.map(t=>t._zod.pattern);return new RegExp(`^(${t.map(t=>kt(t.source)).join("|")})$`)}});const r=1===e.options.length,o=e.options[0]._zod.run;t._zod.parse=(n,a)=>{if(r)return o(n,a);let i=!1;const s=[];for(const t of e.options){const e=t._zod.run({value:n.value,issues:[]},a);if(e instanceof Promise)s.push(e),i=!0;else{if(0===e.issues.length)return e;s.push(e)}}return i?Promise.all(s).then(e=>jr(e,n,t,a)):jr(s,n,t,a)}}),Dr=/* @__PURE__ */ht("$ZodIntersection",(t,e)=>{Ke.init(t,e),t._zod.parse=(t,r)=>{const o=t.value,n=e.left._zod.run({value:o,issues:[]},r),a=e.right._zod.run({value:o,issues:[]},r);return n instanceof Promise||a instanceof Promise?Promise.all([n,a]).then(([e,r])=>Fr(t,e,r)):Fr(t,n,a)}});function Zr(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t===+e)return{valid:!0,data:t};if(Nt(t)&&Nt(e)){const r=Object.keys(e),o=Object.keys(t).filter(t=>-1!==r.indexOf(t)),n={...t,...e};for(const a of o){const r=Zr(t[a],e[a]);if(!r.valid)return{valid:!1,mergeErrorPath:[a,...r.mergeErrorPath]};n[a]=r.data}return{valid:!0,data:n}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let o=0;o<t.length;o++){const n=Zr(t[o],e[o]);if(!n.valid)return{valid:!1,mergeErrorPath:[o,...n.mergeErrorPath]};r.push(n.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Fr(t,e,r){const o=/* @__PURE__ */new Map;let n;for(const s of e.issues)if("unrecognized_keys"===s.code){n??(n=s);for(const t of s.keys)o.has(t)||o.set(t,{}),o.get(t).l=!0}else t.issues.push(s);for(const s of r.issues)if("unrecognized_keys"===s.code)for(const t of s.keys)o.has(t)||o.set(t,{}),o.get(t).r=!0;else t.issues.push(s);const a=[...o].filter(([,t])=>t.l&&t.r).map(([t])=>t);if(a.length&&n&&t.issues.push({...n,keys:a}),Zt(t))return t;const i=Zr(e.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return t.value=i.data,t}const Ur=/* @__PURE__ */ht("$ZodEnum",(t,e)=>{Ke.init(t,e);const r=bt(e.entries),o=new Set(r);t._zod.values=o,t._zod.pattern=new RegExp(`^(${r.filter(t=>Mt.has(typeof t)).map(t=>"string"==typeof t?At(t):t.toString()).join("|")})$`),t._zod.parse=(e,n)=>{const a=e.value;return o.has(a)||e.issues.push({code:"invalid_value",values:r,input:a,inst:t}),e}}),Rr=/* @__PURE__ */ht("$ZodTransform",(t,e)=>{Ke.init(t,e),t._zod.parse=(r,o)=>{if("backward"===o.direction)throw new mt(t.constructor.name);const n=e.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(t=>(r.value=t,r));if(n instanceof Promise)throw new gt;return r.value=n,r}});function Lr(t,e){return t.issues.length&&void 0===e?{issues:[],value:void 0}:t}const Br=/* @__PURE__ */ht("$ZodOptional",(t,e)=>{Ke.init(t,e),t._zod.optin="optional",t._zod.optout="optional",zt(t._zod,"values",()=>e.innerType._zod.values?/* @__PURE__ */new Set([...e.innerType._zod.values,void 0]):void 0),zt(t._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${kt(t.source)})?$`):void 0}),t._zod.parse=(t,r)=>{if("optional"===e.innerType._zod.optin){const o=e.innerType._zod.run(t,r);return o instanceof Promise?o.then(e=>Lr(e,t.value)):Lr(o,t.value)}return void 0===t.value?t:e.innerType._zod.run(t,r)}}),Wr=/* @__PURE__ */ht("$ZodExactOptional",(t,e)=>{Br.init(t,e),zt(t._zod,"values",()=>e.innerType._zod.values),zt(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(t,r)=>e.innerType._zod.run(t,r)}),Jr=/* @__PURE__ */ht("$ZodNullable",(t,e)=>{Ke.init(t,e),zt(t._zod,"optin",()=>e.innerType._zod.optin),zt(t._zod,"optout",()=>e.innerType._zod.optout),zt(t._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${kt(t.source)}|null)$`):void 0}),zt(t._zod,"values",()=>e.innerType._zod.values?/* @__PURE__ */new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(t,r)=>null===t.value?t:e.innerType._zod.run(t,r)}),Vr=/* @__PURE__ */ht("$ZodDefault",(t,e)=>{Ke.init(t,e),t._zod.optin="optional",zt(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(t,r)=>{if("backward"===r.direction)return e.innerType._zod.run(t,r);if(void 0===t.value)return t.value=e.defaultValue,t;const o=e.innerType._zod.run(t,r);return o instanceof Promise?o.then(t=>qr(t,e)):qr(o,e)}});function qr(t,e){return void 0===t.value&&(t.value=e.defaultValue),t}const Hr=/* @__PURE__ */ht("$ZodPrefault",(t,e)=>{Ke.init(t,e),t._zod.optin="optional",zt(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(t,r)=>("backward"===r.direction||void 0===t.value&&(t.value=e.defaultValue),e.innerType._zod.run(t,r))}),Gr=/* @__PURE__ */ht("$ZodNonOptional",(t,e)=>{Ke.init(t,e),zt(t._zod,"values",()=>{const t=e.innerType._zod.values;return t?new Set([...t].filter(t=>void 0!==t)):void 0}),t._zod.parse=(r,o)=>{const n=e.innerType._zod.run(r,o);return n instanceof Promise?n.then(e=>Kr(e,t)):Kr(n,t)}});function Kr(t,e){return t.issues.length||void 0!==t.value||t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}const Yr=/* @__PURE__ */ht("$ZodCatch",(t,e)=>{Ke.init(t,e),zt(t._zod,"optin",()=>e.innerType._zod.optin),zt(t._zod,"optout",()=>e.innerType._zod.optout),zt(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(t,r)=>{if("backward"===r.direction)return e.innerType._zod.run(t,r);const o=e.innerType._zod.run(t,r);return o instanceof Promise?o.then(o=>(t.value=o.value,o.issues.length&&(t.value=e.catchValue({...t,error:{issues:o.issues.map(t=>Rt(t,r,wt()))},input:t.value}),t.issues=[]),t)):(t.value=o.value,o.issues.length&&(t.value=e.catchValue({...t,error:{issues:o.issues.map(t=>Rt(t,r,wt()))},input:t.value}),t.issues=[]),t)}}),Xr=/* @__PURE__ */ht("$ZodPipe",(t,e)=>{Ke.init(t,e),zt(t._zod,"values",()=>e.in._zod.values),zt(t._zod,"optin",()=>e.in._zod.optin),zt(t._zod,"optout",()=>e.out._zod.optout),zt(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(t,r)=>{if("backward"===r.direction){const o=e.out._zod.run(t,r);return o instanceof Promise?o.then(t=>Qr(t,e.in,r)):Qr(o,e.in,r)}const o=e.in._zod.run(t,r);return o instanceof Promise?o.then(t=>Qr(t,e.out,r)):Qr(o,e.out,r)}});function Qr(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}const to=/* @__PURE__ */ht("$ZodReadonly",(t,e)=>{Ke.init(t,e),zt(t._zod,"propValues",()=>e.innerType._zod.propValues),zt(t._zod,"values",()=>e.innerType._zod.values),zt(t._zod,"optin",()=>e.innerType?._zod?.optin),zt(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(t,r)=>{if("backward"===r.direction)return e.innerType._zod.run(t,r);const o=e.innerType._zod.run(t,r);return o instanceof Promise?o.then(eo):eo(o)}});function eo(t){return t.value=Object.freeze(t.value),t}const ro=/* @__PURE__ */ht("$ZodCustom",(t,e)=>{Ne.init(t,e),Ke.init(t,e),t._zod.parse=(t,e)=>t,t._zod.check=r=>{const o=r.value,n=e.fn(o);if(n instanceof Promise)return n.then(e=>oo(e,r,o,t));oo(n,r,o,t)}});function oo(t,e,r,o){if(!t){const t={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(t.params=o._zod.def.params),e.issues.push(Bt(t))}}var no;(no=globalThis).__zod_globalRegistry??(no.__zod_globalRegistry=new class{constructor(){this._map=/* @__PURE__ */new WeakMap,this._idmap=/* @__PURE__ */new Map}add(t,...e){const r=e[0];return this._map.set(t,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=/* @__PURE__ */new WeakMap,this._idmap=/* @__PURE__ */new Map,this}remove(t){const e=this._map.get(t);return e&&"object"==typeof e&&"id"in e&&this._idmap.delete(e.id),this._map.delete(t),this}get(t){const e=t._zod.parent;if(e){const r={...this.get(e)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}});const ao=globalThis.__zod_globalRegistry;function io(t,e){return new t({type:"string",...Pt(e)})}function so(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Pt(e)})}function co(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Pt(e)})}function lo(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Pt(e)})}function uo(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Pt(e)})}function po(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Pt(e)})}function ho(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Pt(e)})}function go(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Pt(e)})}function mo(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Pt(e)})}function fo(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Pt(e)})}function wo(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Pt(e)})}function bo(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Pt(e)})}function yo(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Pt(e)})}function vo(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Pt(e)})}function xo(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Pt(e)})}function ko(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Pt(e)})}function _o(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Pt(e)})}function zo(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Pt(e)})}function Eo(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Pt(e)})}function So(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Pt(e)})}function Oo(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Pt(e)})}function Io(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Pt(e)})}function $o(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Pt(e)})}function Co(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Pt(e)})}function No(t,e){return new t({type:"string",format:"date",check:"string_format",...Pt(e)})}function To(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Pt(e)})}function Mo(t,e){return new t({type:"string",format:"duration",check:"string_format",...Pt(e)})}function Ao(t,e){return new t({type:"number",checks:[],...Pt(e)})}function jo(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Pt(e)})}function Po(t){return new t({type:"any"})}function Do(t){return new t({type:"unknown"})}function Zo(t,e){return new t({type:"never",...Pt(e)})}function Fo(t,e){return new Me({check:"less_than",...Pt(e),value:t,inclusive:!1})}function Uo(t,e){return new Me({check:"less_than",...Pt(e),value:t,inclusive:!0})}function Ro(t,e){return new Ae({check:"greater_than",...Pt(e),value:t,inclusive:!1})}function Lo(t,e){return new Ae({check:"greater_than",...Pt(e),value:t,inclusive:!0})}function Bo(t,e){return new je({check:"multiple_of",...Pt(e),value:t})}function Wo(t,e){return new De({check:"max_length",...Pt(e),maximum:t})}function Jo(t,e){return new Ze({check:"min_length",...Pt(e),minimum:t})}function Vo(t,e){return new Fe({check:"length_equals",...Pt(e),length:t})}function qo(t,e){return new Re({check:"string_format",format:"regex",...Pt(e),pattern:t})}function Ho(t){return new Le({check:"string_format",format:"lowercase",...Pt(t)})}function Go(t){return new Be({check:"string_format",format:"uppercase",...Pt(t)})}function Ko(t,e){return new We({check:"string_format",format:"includes",...Pt(e),includes:t})}function Yo(t,e){return new Je({check:"string_format",format:"starts_with",...Pt(e),prefix:t})}function Xo(t,e){return new Ve({check:"string_format",format:"ends_with",...Pt(e),suffix:t})}function Qo(t){return new qe({check:"overwrite",tx:t})}function tn(t){/* @__PURE__ */
|
|
17
17
|
return Qo(e=>e.normalize(t))}function en(){/* @__PURE__ */
|
|
18
18
|
return Qo(t=>t.trim())}function rn(){/* @__PURE__ */
|
|
19
19
|
return Qo(t=>t.toLowerCase())}function on(){/* @__PURE__ */
|
|
20
20
|
return Qo(t=>t.toUpperCase())}function nn(){/* @__PURE__ */
|
|
21
21
|
return Qo(t=>function(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(t))}function an(t,e,r){return new t({type:"array",element:e,...Pt(r)})}function sn(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Pt(r)})}function cn(t){const e=/* @__PURE__ */dn(r=>(r.addIssue=t=>{if("string"==typeof t)r.issues.push(Bt(t,r.value,e._zod.def));else{const o=t;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=e),o.continue??(o.continue=!e._zod.def.abort),r.issues.push(Bt(o))}},t(r.value,r)));return e}function dn(t,e){const r=new Ne({check:"custom",...Pt(e)});return r._zod.check=t,r}function ln(t){let e=t?.target??"draft-2020-12";return"draft-4"===e&&(e="draft-04"),"draft-7"===e&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??ao,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:/* @__PURE__ */new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function un(t,e,r={path:[],schemaPath:[]}){var o;const n=t._zod.def,a=e.seen.get(t);if(a)return a.count++,r.schemaPath.includes(t)&&(a.cycle=r.path),a.schema;const i={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,i);const s=t._zod.toJSONSchema?.();if(s)i.schema=s;else{const o={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,i.schema,o);else{const r=i.schema,a=e.processors[n.type];if(!a)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);a(t,e,r,o)}const a=t._zod.parent;a&&(i.ref||(i.ref=a),un(a,e,o),e.seen.get(a).isParent=!0)}const c=e.metadataRegistry.get(t);return c&&Object.assign(i.schema,c),"input"===e.io&&gn(t)&&(delete i.schema.examples,delete i.schema.default),"input"===e.io&&i.schema._prefault&&((o=i.schema).default??(o.default=i.schema._prefault)),delete i.schema._prefault,e.seen.get(t).schema}function pn(t,e){const r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=/* @__PURE__ */new Map;for(const a of t.seen.entries()){const e=t.metadataRegistry.get(a[0])?.id;if(e){const t=o.get(e);if(t&&t!==a[0])throw new Error(`Duplicate schema id "${e}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(e,a[0])}}const n=e=>{if(e[1].schema.$ref)return;const o=e[1],{ref:n,defId:a}=(e=>{const o="draft-2020-12"===t.target?"$defs":"definitions";if(t.external){const r=t.external.registry.get(e[0])?.id,n=t.external.uri??(t=>t);if(r)return{ref:n(r)};const a=e[1].defId??e[1].schema.id??"schema"+t.counter++;return e[1].defId=a,{defId:a,ref:`${n("__shared")}#/${o}/${a}`}}if(e[1]===r)return{ref:"#"};const n=`#/${o}/`,a=e[1].schema.id??"__schema"+t.counter++;return{defId:a,ref:n+a}})(e);o.def={...o.schema},a&&(o.defId=a);const i=o.schema;for(const t in i)delete i[t];i.$ref=n};if("throw"===t.cycles)for(const a of t.seen.entries()){const t=a[1];if(t.cycle)throw new Error(`Cycle detected: #/${t.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const a of t.seen.entries()){const r=a[1];if(e===a[0]){n(a);continue}if(t.external){const r=t.external.registry.get(a[0])?.id;if(e!==a[0]&&r){n(a);continue}}const o=t.metadataRegistry.get(a[0])?.id;(o||r.cycle||r.count>1&&"ref"===t.reused)&&n(a)}}function hn(t,e){const r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=e=>{const r=t.seen.get(e);if(null===r.ref)return;const n=r.def??r.schema,a={...n},i=r.ref;if(r.ref=null,i){o(i);const r=t.seen.get(i),s=r.schema;if(!s.$ref||"draft-07"!==t.target&&"draft-04"!==t.target&&"openapi-3.0"!==t.target?Object.assign(n,s):(n.allOf=n.allOf??[],n.allOf.push(s)),Object.assign(n,a),e._zod.parent===i)for(const t in n)"$ref"!==t&&"allOf"!==t&&(t in a||delete n[t]);if(s.$ref&&r.def)for(const t in n)"$ref"!==t&&"allOf"!==t&&t in r.def&&JSON.stringify(n[t])===JSON.stringify(r.def[t])&&delete n[t]}const s=e._zod.parent;if(s&&s!==i){o(s);const e=t.seen.get(s);if(e?.schema.$ref&&(n.$ref=e.schema.$ref,e.def))for(const t in n)"$ref"!==t&&"allOf"!==t&&t in e.def&&JSON.stringify(n[t])===JSON.stringify(e.def[t])&&delete n[t]}t.override({zodSchema:e,jsonSchema:n,path:r.path??[]})};for(const s of[...t.seen.entries()].reverse())o(s[0]);const n={};if("draft-2020-12"===t.target?n.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===t.target?n.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===t.target?n.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){const r=t.external.registry.get(e)?.id;if(!r)throw new Error("Schema is missing an `id` property");n.$id=t.external.uri(r)}Object.assign(n,r.def??r.schema);const a=t.external?.defs??{};for(const s of t.seen.entries()){const t=s[1];t.def&&t.defId&&(a[t.defId]=t.def)}t.external||Object.keys(a).length>0&&("draft-2020-12"===t.target?n.$defs=a:n.definitions=a);try{const r=JSON.parse(JSON.stringify(n));return Object.defineProperty(r,"~standard",{value:{...e["~standard"],jsonSchema:{input:mn(e,"input",t.processors),output:mn(e,"output",t.processors)}},enumerable:!1,writable:!1}),r}catch(i){throw new Error("Error converting schema to JSON.")}}function gn(t,e){const r=e??{seen:/* @__PURE__ */new Set};if(r.seen.has(t))return!1;r.seen.add(t);const o=t._zod.def;if("transform"===o.type)return!0;if("array"===o.type)return gn(o.element,r);if("set"===o.type)return gn(o.valueType,r);if("lazy"===o.type)return gn(o.getter(),r);if("promise"===o.type||"optional"===o.type||"nonoptional"===o.type||"nullable"===o.type||"readonly"===o.type||"default"===o.type||"prefault"===o.type)return gn(o.innerType,r);if("intersection"===o.type)return gn(o.left,r)||gn(o.right,r);if("record"===o.type||"map"===o.type)return gn(o.keyType,r)||gn(o.valueType,r);if("pipe"===o.type)return gn(o.in,r)||gn(o.out,r);if("object"===o.type){for(const t in o.shape)if(gn(o.shape[t],r))return!0;return!1}if("union"===o.type){for(const t of o.options)if(gn(t,r))return!0;return!1}if("tuple"===o.type){for(const t of o.items)if(gn(t,r))return!0;return!(!o.rest||!gn(o.rest,r))}return!1}const mn=(t,e,r={})=>o=>{const{libraryOptions:n,target:a}=o??{},i=ln({...n??{},target:a,io:e,processors:r});return un(t,i),pn(i,t),hn(i,t)},fn={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},wn=(t,e,r,o)=>{const n=t._zod.def;un(n.innerType,e,o),e.seen.get(t).ref=n.innerType},bn=/* @__PURE__ */ht("ZodISODateTime",(t,e)=>{lr.init(t,e),Fn.init(t,e)}),yn=/* @__PURE__ */ht("ZodISODate",(t,e)=>{ur.init(t,e),Fn.init(t,e)}),vn=/* @__PURE__ */ht("ZodISOTime",(t,e)=>{pr.init(t,e),Fn.init(t,e)}),xn=/* @__PURE__ */ht("ZodISODuration",(t,e)=>{hr.init(t,e),Fn.init(t,e)}),kn=ht("ZodError",(t,e)=>{Jt.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:e=>function(t,e=t=>t.message){const r={_errors:[]},o=t=>{for(const n of t.issues)if("invalid_union"===n.code&&n.errors.length)n.errors.map(t=>o({issues:t}));else if("invalid_key"===n.code)o({issues:n.issues});else if("invalid_element"===n.code)o({issues:n.issues});else if(0===n.path.length)r._errors.push(e(n));else{let t=r,o=0;for(;o<n.path.length;){const r=n.path[o];o===n.path.length-1?(t[r]=t[r]||{_errors:[]},t[r]._errors.push(e(n))):t[r]=t[r]||{_errors:[]},t=t[r],o++}}};return o(t),r}(t,e)},flatten:{value:e=>function(t,e=t=>t.message){const r={},o=[];for(const n of t.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):o.push(e(n));return{formErrors:o,fieldErrors:r}}(t,e)},addIssue:{value:e=>{t.issues.push(e),t.message=JSON.stringify(t.issues,yt,2)}},addIssues:{value:e=>{t.issues.push(...e),t.message=JSON.stringify(t.issues,yt,2)}},isEmpty:{get:()=>0===t.issues.length}})},{Parent:Error}),_n=/* @__PURE__ */qt(kn),zn=/* @__PURE__ */Ht(kn),En=/* @__PURE__ */Gt(kn),Sn=/* @__PURE__ */Yt(kn),On=/* @__PURE__ */Qt(kn),In=/* @__PURE__ */te(kn),$n=/* @__PURE__ */ee(kn),Cn=/* @__PURE__ */re(kn),Nn=/* @__PURE__ */oe(kn),Tn=/* @__PURE__ */ne(kn),Mn=/* @__PURE__ */ae(kn),An=/* @__PURE__ */ie(kn),jn=/* @__PURE__ */ht("ZodType",(t,e)=>(Ke.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:mn(t,"input"),output:mn(t,"output")}}),t.toJSONSchema=((t,e={})=>r=>{const o=ln({...r,processors:e});return un(t,o),pn(o,t),hn(o,t)})(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone(St(e,{checks:[...e.checks??[],...r.map(t=>"function"==typeof t?{_zod:{check:t,def:{check:"custom"},onattach:[]}}:t)]}),{parent:!0}),t.with=t.check,t.clone=(e,r)=>jt(t,e,r),t.brand=()=>t,t.register=(e,r)=>(e.add(t,r),t),t.parse=(e,r)=>_n(t,e,r,{callee:t.parse}),t.safeParse=(e,r)=>En(t,e,r),t.parseAsync=async(e,r)=>zn(t,e,r,{callee:t.parseAsync}),t.safeParseAsync=async(e,r)=>Sn(t,e,r),t.spa=t.safeParseAsync,t.encode=(e,r)=>On(t,e,r),t.decode=(e,r)=>In(t,e,r),t.encodeAsync=async(e,r)=>$n(t,e,r),t.decodeAsync=async(e,r)=>Cn(t,e,r),t.safeEncode=(e,r)=>Nn(t,e,r),t.safeDecode=(e,r)=>Tn(t,e,r),t.safeEncodeAsync=async(e,r)=>Mn(t,e,r),t.safeDecodeAsync=async(e,r)=>An(t,e,r),t.refine=(e,r)=>t.check(function(t,e={}){/* @__PURE__ */
|
|
22
|
-
return sn(Ta,t,e)}(e,r)),t.superRefine=e=>t.check(/* @__PURE__ */cn(e)),t.overwrite=e=>t.check(/* @__PURE__ */Qo(e)),t.optional=()=>xa(t),t.exactOptional=()=>new ka({type:"optional",innerType:t}),t.nullable=()=>za(t),t.nullish=()=>xa(za(t)),t.nonoptional=e=>function(t,e){return new Oa({type:"nonoptional",innerType:t,...Pt(e)})}(t,e),t.array=()=>/* @__PURE__ */an(ha,t,void 0),t.or=e=>new ma({type:"union",options:[t,e],...Pt(void 0)}),t.and=e=>new fa({type:"intersection",left:t,right:e}),t.transform=e=>Ca(t,new ya({type:"transform",transform:e})),t.default=e=>{return r=e,new Ea({type:"default",innerType:t,get defaultValue(){return"function"==typeof r?r():Tt(r)}});var r},t.prefault=e=>{return r=e,new Sa({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof r?r():Tt(r)}});var r},t.catch=e=>{return new Ia({type:"catch",innerType:t,catchValue:"function"==typeof(r=e)?r:()=>r});var r},t.pipe=e=>Ca(t,e),t.readonly=()=>new Na({type:"readonly",innerType:t}),t.describe=e=>{const r=t.clone();return ao.add(r,{description:e}),r},Object.defineProperty(t,"description",{get:()=>ao.get(t)?.description,configurable:!0}),t.meta=(...e)=>{if(0===e.length)return ao.get(t);const r=t.clone();return ao.add(r,e[0]),r},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t.apply=e=>e(t),t)),Pn=/* @__PURE__ */ht("_ZodString",(t,e)=>{Ye.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r)=>{const o=r;o.type="string";const{minimum:n,maximum:a,format:i,patterns:s,contentEncoding:c}=t._zod.bag;if("number"==typeof n&&(o.minLength=n),"number"==typeof a&&(o.maxLength=a),i&&(o.format=fn[i]??i,""===o.format&&delete o.format,"time"===i&&delete o.format),c&&(o.contentEncoding=c),s&&s.size>0){const t=[...s];1===t.length?o.pattern=t[0].source:t.length>1&&(o.allOf=[...t.map(t=>({..."draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target?{type:"string"}:{},pattern:t.source}))])}})(t,e,r);const r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...e)=>t.check(/* @__PURE__ */qo(...e)),t.includes=(...e)=>t.check(/* @__PURE__ */Ko(...e)),t.startsWith=(...e)=>t.check(/* @__PURE__ */Yo(...e)),t.endsWith=(...e)=>t.check(/* @__PURE__ */Xo(...e)),t.min=(...e)=>t.check(/* @__PURE__ */Jo(...e)),t.max=(...e)=>t.check(/* @__PURE__ */Wo(...e)),t.length=(...e)=>t.check(/* @__PURE__ */Vo(...e)),t.nonempty=(...e)=>t.check(/* @__PURE__ */Jo(1,...e)),t.lowercase=e=>t.check(/* @__PURE__ */Ho(e)),t.uppercase=e=>t.check(/* @__PURE__ */Go(e)),t.trim=()=>t.check(/* @__PURE__ */en()),t.normalize=(...e)=>t.check(/* @__PURE__ */tn(...e)),t.toLowerCase=()=>t.check(/* @__PURE__ */rn()),t.toUpperCase=()=>t.check(/* @__PURE__ */on()),t.slugify=()=>t.check(/* @__PURE__ */nn())}),Dn=/* @__PURE__ */ht("ZodString",(t,e)=>{Ye.init(t,e),Pn.init(t,e),t.email=e=>t.check(/* @__PURE__ */so(Un,e)),t.url=e=>t.check(/* @__PURE__ */go(Bn,e)),t.jwt=e=>t.check(/* @__PURE__ */$o(na,e)),t.emoji=e=>t.check(/* @__PURE__ */mo(Wn,e)),t.guid=e=>t.check(/* @__PURE__ */co(
|
|
22
|
+
return sn(Ta,t,e)}(e,r)),t.superRefine=e=>t.check(/* @__PURE__ */cn(e)),t.overwrite=e=>t.check(/* @__PURE__ */Qo(e)),t.optional=()=>xa(t),t.exactOptional=()=>new ka({type:"optional",innerType:t}),t.nullable=()=>za(t),t.nullish=()=>xa(za(t)),t.nonoptional=e=>function(t,e){return new Oa({type:"nonoptional",innerType:t,...Pt(e)})}(t,e),t.array=()=>/* @__PURE__ */an(ha,t,void 0),t.or=e=>new ma({type:"union",options:[t,e],...Pt(void 0)}),t.and=e=>new fa({type:"intersection",left:t,right:e}),t.transform=e=>Ca(t,new ya({type:"transform",transform:e})),t.default=e=>{return r=e,new Ea({type:"default",innerType:t,get defaultValue(){return"function"==typeof r?r():Tt(r)}});var r},t.prefault=e=>{return r=e,new Sa({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof r?r():Tt(r)}});var r},t.catch=e=>{return new Ia({type:"catch",innerType:t,catchValue:"function"==typeof(r=e)?r:()=>r});var r},t.pipe=e=>Ca(t,e),t.readonly=()=>new Na({type:"readonly",innerType:t}),t.describe=e=>{const r=t.clone();return ao.add(r,{description:e}),r},Object.defineProperty(t,"description",{get:()=>ao.get(t)?.description,configurable:!0}),t.meta=(...e)=>{if(0===e.length)return ao.get(t);const r=t.clone();return ao.add(r,e[0]),r},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t.apply=e=>e(t),t)),Pn=/* @__PURE__ */ht("_ZodString",(t,e)=>{Ye.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r)=>{const o=r;o.type="string";const{minimum:n,maximum:a,format:i,patterns:s,contentEncoding:c}=t._zod.bag;if("number"==typeof n&&(o.minLength=n),"number"==typeof a&&(o.maxLength=a),i&&(o.format=fn[i]??i,""===o.format&&delete o.format,"time"===i&&delete o.format),c&&(o.contentEncoding=c),s&&s.size>0){const t=[...s];1===t.length?o.pattern=t[0].source:t.length>1&&(o.allOf=[...t.map(t=>({..."draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target?{type:"string"}:{},pattern:t.source}))])}})(t,e,r);const r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...e)=>t.check(/* @__PURE__ */qo(...e)),t.includes=(...e)=>t.check(/* @__PURE__ */Ko(...e)),t.startsWith=(...e)=>t.check(/* @__PURE__ */Yo(...e)),t.endsWith=(...e)=>t.check(/* @__PURE__ */Xo(...e)),t.min=(...e)=>t.check(/* @__PURE__ */Jo(...e)),t.max=(...e)=>t.check(/* @__PURE__ */Wo(...e)),t.length=(...e)=>t.check(/* @__PURE__ */Vo(...e)),t.nonempty=(...e)=>t.check(/* @__PURE__ */Jo(1,...e)),t.lowercase=e=>t.check(/* @__PURE__ */Ho(e)),t.uppercase=e=>t.check(/* @__PURE__ */Go(e)),t.trim=()=>t.check(/* @__PURE__ */en()),t.normalize=(...e)=>t.check(/* @__PURE__ */tn(...e)),t.toLowerCase=()=>t.check(/* @__PURE__ */rn()),t.toUpperCase=()=>t.check(/* @__PURE__ */on()),t.slugify=()=>t.check(/* @__PURE__ */nn())}),Dn=/* @__PURE__ */ht("ZodString",(t,e)=>{Ye.init(t,e),Pn.init(t,e),t.email=e=>t.check(/* @__PURE__ */so(Un,e)),t.url=e=>t.check(/* @__PURE__ */go(Bn,e)),t.jwt=e=>t.check(/* @__PURE__ */$o(na,e)),t.emoji=e=>t.check(/* @__PURE__ */mo(Wn,e)),t.guid=e=>t.check(/* @__PURE__ */co(Rn,e)),t.uuid=e=>t.check(/* @__PURE__ */lo(Ln,e)),t.uuidv4=e=>t.check(/* @__PURE__ */uo(Ln,e)),t.uuidv6=e=>t.check(/* @__PURE__ */po(Ln,e)),t.uuidv7=e=>t.check(/* @__PURE__ */ho(Ln,e)),t.nanoid=e=>t.check(/* @__PURE__ */fo(Jn,e)),t.guid=e=>t.check(/* @__PURE__ */co(Rn,e)),t.cuid=e=>t.check(/* @__PURE__ */wo(Vn,e)),t.cuid2=e=>t.check(/* @__PURE__ */bo(qn,e)),t.ulid=e=>t.check(/* @__PURE__ */yo(Hn,e)),t.base64=e=>t.check(/* @__PURE__ */So(ea,e)),t.base64url=e=>t.check(/* @__PURE__ */Oo(ra,e)),t.xid=e=>t.check(/* @__PURE__ */vo(Gn,e)),t.ksuid=e=>t.check(/* @__PURE__ */xo(Kn,e)),t.ipv4=e=>t.check(/* @__PURE__ */ko(Yn,e)),t.ipv6=e=>t.check(/* @__PURE__ */_o(Xn,e)),t.cidrv4=e=>t.check(/* @__PURE__ */zo(Qn,e)),t.cidrv6=e=>t.check(/* @__PURE__ */Eo(ta,e)),t.e164=e=>t.check(/* @__PURE__ */Io(oa,e)),t.datetime=e=>t.check(function(t){/* @__PURE__ */
|
|
23
23
|
return Co(bn,t)}(e)),t.date=e=>t.check(function(t){/* @__PURE__ */
|
|
24
24
|
return No(yn,t)}(e)),t.time=e=>t.check(function(t){/* @__PURE__ */
|
|
25
25
|
return To(vn,t)}(e)),t.duration=e=>t.check(function(t){/* @__PURE__ */
|
|
26
26
|
return Mo(xn,t)}(e))});function Zn(t){/* @__PURE__ */
|
|
27
|
-
return io(Dn,t)}const Fn=/* @__PURE__ */ht("ZodStringFormat",(t,e)=>{Xe.init(t,e),Pn.init(t,e)}),Un=/* @__PURE__ */ht("ZodEmail",(t,e)=>{er.init(t,e),Fn.init(t,e)}),
|
|
27
|
+
return io(Dn,t)}const Fn=/* @__PURE__ */ht("ZodStringFormat",(t,e)=>{Xe.init(t,e),Pn.init(t,e)}),Un=/* @__PURE__ */ht("ZodEmail",(t,e)=>{er.init(t,e),Fn.init(t,e)}),Rn=/* @__PURE__ */ht("ZodGUID",(t,e)=>{Qe.init(t,e),Fn.init(t,e)}),Ln=/* @__PURE__ */ht("ZodUUID",(t,e)=>{tr.init(t,e),Fn.init(t,e)}),Bn=/* @__PURE__ */ht("ZodURL",(t,e)=>{rr.init(t,e),Fn.init(t,e)}),Wn=/* @__PURE__ */ht("ZodEmoji",(t,e)=>{or.init(t,e),Fn.init(t,e)}),Jn=/* @__PURE__ */ht("ZodNanoID",(t,e)=>{nr.init(t,e),Fn.init(t,e)}),Vn=/* @__PURE__ */ht("ZodCUID",(t,e)=>{ar.init(t,e),Fn.init(t,e)}),qn=/* @__PURE__ */ht("ZodCUID2",(t,e)=>{ir.init(t,e),Fn.init(t,e)}),Hn=/* @__PURE__ */ht("ZodULID",(t,e)=>{sr.init(t,e),Fn.init(t,e)}),Gn=/* @__PURE__ */ht("ZodXID",(t,e)=>{cr.init(t,e),Fn.init(t,e)}),Kn=/* @__PURE__ */ht("ZodKSUID",(t,e)=>{dr.init(t,e),Fn.init(t,e)}),Yn=/* @__PURE__ */ht("ZodIPv4",(t,e)=>{gr.init(t,e),Fn.init(t,e)}),Xn=/* @__PURE__ */ht("ZodIPv6",(t,e)=>{mr.init(t,e),Fn.init(t,e)}),Qn=/* @__PURE__ */ht("ZodCIDRv4",(t,e)=>{fr.init(t,e),Fn.init(t,e)}),ta=/* @__PURE__ */ht("ZodCIDRv6",(t,e)=>{wr.init(t,e),Fn.init(t,e)}),ea=/* @__PURE__ */ht("ZodBase64",(t,e)=>{yr.init(t,e),Fn.init(t,e)}),ra=/* @__PURE__ */ht("ZodBase64URL",(t,e)=>{vr.init(t,e),Fn.init(t,e)}),oa=/* @__PURE__ */ht("ZodE164",(t,e)=>{xr.init(t,e),Fn.init(t,e)}),na=/* @__PURE__ */ht("ZodJWT",(t,e)=>{kr.init(t,e),Fn.init(t,e)}),aa=/* @__PURE__ */ht("ZodNumber",(t,e)=>{_r.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r)=>{const o=r,{minimum:n,maximum:a,format:i,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:d}=t._zod.bag;"string"==typeof i&&i.includes("int")?o.type="integer":o.type="number","number"==typeof d&&("draft-04"===e.target||"openapi-3.0"===e.target?(o.minimum=d,o.exclusiveMinimum=!0):o.exclusiveMinimum=d),"number"==typeof n&&(o.minimum=n,"number"==typeof d&&"draft-04"!==e.target&&(d>=n?delete o.minimum:delete o.exclusiveMinimum)),"number"==typeof c&&("draft-04"===e.target||"openapi-3.0"===e.target?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c),"number"==typeof a&&(o.maximum=a,"number"==typeof c&&"draft-04"!==e.target&&(c<=a?delete o.maximum:delete o.exclusiveMaximum)),"number"==typeof s&&(o.multipleOf=s)})(t,e,r),t.gt=(e,r)=>t.check(/* @__PURE__ */Ro(e,r)),t.gte=(e,r)=>t.check(/* @__PURE__ */Lo(e,r)),t.min=(e,r)=>t.check(/* @__PURE__ */Lo(e,r)),t.lt=(e,r)=>t.check(/* @__PURE__ */Fo(e,r)),t.lte=(e,r)=>t.check(/* @__PURE__ */Uo(e,r)),t.max=(e,r)=>t.check(/* @__PURE__ */Uo(e,r)),t.int=e=>t.check(ca(e)),t.safe=e=>t.check(ca(e)),t.positive=e=>t.check(/* @__PURE__ */Ro(0,e)),t.nonnegative=e=>t.check(/* @__PURE__ */Lo(0,e)),t.negative=e=>t.check(/* @__PURE__ */Fo(0,e)),t.nonpositive=e=>t.check(/* @__PURE__ */Uo(0,e)),t.multipleOf=(e,r)=>t.check(/* @__PURE__ */Bo(e,r)),t.step=(e,r)=>t.check(/* @__PURE__ */Bo(e,r)),t.finite=()=>t;const r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function ia(t){/* @__PURE__ */
|
|
28
28
|
return Ao(aa,t)}const sa=/* @__PURE__ */ht("ZodNumberFormat",(t,e)=>{zr.init(t,e),aa.init(t,e)});function ca(t){/* @__PURE__ */
|
|
29
29
|
return jo(sa,t)}const da=/* @__PURE__ */ht("ZodAny",(t,e)=>{Er.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(t,e,r)=>{}}),la=/* @__PURE__ */ht("ZodUnknown",(t,e)=>{Sr.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(t,e,r)=>{}});function ua(){/* @__PURE__ */
|
|
30
|
-
return Do(la)}const pa=/* @__PURE__ */ht("ZodNever",(t,e)=>{Or.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(t,e,r)=>((t,e,r)=>{r.not={}})(0,0,e)}),ha=/* @__PURE__ */ht("ZodArray",(t,e)=>{$r.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r,o)=>{const n=r,a=t._zod.def,{minimum:i,maximum:s}=t._zod.bag;"number"==typeof i&&(n.minItems=i),"number"==typeof s&&(n.maxItems=s),n.type="array",n.items=un(a.element,e,{...o,path:[...o.path,"items"]})})(t,e,r,o),t.element=e.element,t.min=(e,r)=>t.check(/* @__PURE__ */Jo(e,r)),t.nonempty=e=>t.check(/* @__PURE__ */Jo(1,e)),t.max=(e,r)=>t.check(/* @__PURE__ */Wo(e,r)),t.length=(e,r)=>t.check(/* @__PURE__ */Vo(e,r)),t.unwrap=()=>t.element}),ga=/* @__PURE__ */ht("ZodObject",(t,e)=>{Ar.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r,o)=>{const n=r,a=t._zod.def;n.type="object",n.properties={};const i=a.shape;for(const d in i)n.properties[d]=un(i[d],e,{...o,path:[...o.path,"properties",d]});const s=new Set(Object.keys(i)),c=new Set([...s].filter(t=>{const r=a.shape[t]._zod;return"input"===e.io?void 0===r.optin:void 0===r.optout}));c.size>0&&(n.required=Array.from(c)),"never"===a.catchall?._zod.def.type?n.additionalProperties=!1:a.catchall?a.catchall&&(n.additionalProperties=un(a.catchall,e,{...o,path:[...o.path,"additionalProperties"]})):"output"===e.io&&(n.additionalProperties=!1)})(t,e,r,o),zt(t,"shape",()=>e.shape),t.keyof=()=>ba(Object.keys(t._zod.def.shape)),t.catchall=e=>t.clone({...t._zod.def,catchall:e}),t.passthrough=()=>t.clone({...t._zod.def,catchall:ua()}),t.loose=()=>t.clone({...t._zod.def,catchall:ua()}),t.strict=()=>t.clone({...t._zod.def,catchall:/* @__PURE__ */Zo(pa,void 0)}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=e=>function(t,e){if(!Nt(e))throw new Error("Invalid input to extend: expected a plain object");const r=t._zod.def.checks;if(r&&r.length>0){const r=t._zod.def.shape;for(const t in e)if(void 0!==Object.getOwnPropertyDescriptor(r,t))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=St(t._zod.def,{get shape(){const r={...t._zod.def.shape,...e};return Et(this,"shape",r),r}});return jt(t,o)}(t,e),t.safeExtend=e=>function(t,e){if(!Nt(e))throw new Error("Invalid input to safeExtend: expected a plain object");const r=St(t._zod.def,{get shape(){const r={...t._zod.def.shape,...e};return Et(this,"shape",r),r}});return jt(t,r)}(t,e),t.merge=e=>function(t,e){const r=St(t._zod.def,{get shape(){const r={...t._zod.def.shape,...e._zod.def.shape};return Et(this,"shape",r),r},get catchall(){return e._zod.def.catchall},checks:[]});return jt(t,r)}(t,e),t.pick=e=>function(t,e){const r=t._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return jt(t,St(t._zod.def,{get shape(){const t={};for(const o in e){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(t[o]=r.shape[o])}return Et(this,"shape",t),t},checks:[]}))}(t,e),t.omit=e=>function(t,e){const r=t._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const n=St(t._zod.def,{get shape(){const o={...t._zod.def.shape};for(const t in e){if(!(t in r.shape))throw new Error(`Unrecognized key: "${t}"`);e[t]&&delete o[t]}return Et(this,"shape",o),o},checks:[]});return jt(t,n)}(t,e),t.partial=(...e)=>function(t,e,r){const o=e._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const n=St(e._zod.def,{get shape(){const o=e._zod.def.shape,n={...o};if(r)for(const e in r){if(!(e in o))throw new Error(`Unrecognized key: "${e}"`);r[e]&&(n[e]=t?new t({type:"optional",innerType:o[e]}):o[e])}else for(const e in o)n[e]=t?new t({type:"optional",innerType:o[e]}):o[e];return Et(this,"shape",n),n},checks:[]});return jt(e,n)}(va,t,e[0]),t.required=(...e)=>function(t,e,r){const o=St(e._zod.def,{get shape(){const o=e._zod.def.shape,n={...o};if(r)for(const e in r){if(!(e in n))throw new Error(`Unrecognized key: "${e}"`);r[e]&&(n[e]=new t({type:"nonoptional",innerType:o[e]}))}else for(const e in o)n[e]=new t({type:"nonoptional",innerType:o[e]});return Et(this,"shape",n),n}});return jt(e,o)}(Oa,t,e[0])}),ma=/* @__PURE__ */ht("ZodUnion",(t,e)=>{Pr.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r,o)=>{const n=t._zod.def,a=!1===n.inclusive,i=n.options.map((t,r)=>un(t,e,{...o,path:[...o.path,a?"oneOf":"anyOf",r]}));a?r.oneOf=i:r.anyOf=i})(t,e,r,o),t.options=e.options}),fa=/* @__PURE__ */ht("ZodIntersection",(t,e)=>{Dr.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r,o)=>{const n=t._zod.def,a=un(n.left,e,{...o,path:[...o.path,"allOf",0]}),i=un(n.right,e,{...o,path:[...o.path,"allOf",1]}),s=t=>"allOf"in t&&1===Object.keys(t).length,c=[...s(a)?a.allOf:[a],...s(i)?i.allOf:[i]];r.allOf=c})(t,e,r,o)}),wa=/* @__PURE__ */ht("ZodEnum",(t,e)=>{Ur.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r)=>{const o=bt(t._zod.def.entries);o.every(t=>"number"==typeof t)&&(r.type="number"),o.every(t=>"string"==typeof t)&&(r.type="string"),r.enum=o})(t,0,r),t.enum=e.entries,t.options=Object.values(e.entries);const r=new Set(Object.keys(e.entries));t.extract=(t,o)=>{const n={};for(const a of t){if(!r.has(a))throw new Error(`Key ${a} not found in enum`);n[a]=e.entries[a]}return new wa({...e,checks:[],...Pt(o),entries:n})},t.exclude=(t,o)=>{const n={...e.entries};for(const e of t){if(!r.has(e))throw new Error(`Key ${e} not found in enum`);delete n[e]}return new wa({...e,checks:[],...Pt(o),entries:n})}});function ba(t,e){const r=Array.isArray(t)?Object.fromEntries(t.map(t=>[t,t])):t;return new wa({type:"enum",entries:r,...Pt(e)})}const ya=/* @__PURE__ */ht("ZodTransform",(t,e)=>{Lr.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(t,e,r)=>((t,e)=>{if("throw"===e.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,t),t._zod.parse=(r,o)=>{if("backward"===o.direction)throw new mt(t.constructor.name);r.addIssue=o=>{if("string"==typeof o)r.issues.push(Bt(o,r.value,e));else{const e=o;e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=r.value),e.inst??(e.inst=t),r.issues.push(Bt(e))}};const n=e.transform(r.value,r);return n instanceof Promise?n.then(t=>(r.value=t,r)):(r.value=n,r)}}),va=/* @__PURE__ */ht("ZodOptional",(t,e)=>{Br.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>wn(t,e,0,o),t.unwrap=()=>t._zod.def.innerType});function xa(t){return new va({type:"optional",innerType:t})}const ka=/* @__PURE__ */ht("ZodExactOptional",(t,e)=>{Wr.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>wn(t,e,0,o),t.unwrap=()=>t._zod.def.innerType}),_a=/* @__PURE__ */ht("ZodNullable",(t,e)=>{Jr.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r,o)=>{const n=t._zod.def,a=un(n.innerType,e,o),i=e.seen.get(t);"openapi-3.0"===e.target?(i.ref=n.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}]})(t,e,r,o),t.unwrap=()=>t._zod.def.innerType});function za(t){return new _a({type:"nullable",innerType:t})}const Ea=/* @__PURE__ */ht("ZodDefault",(t,e)=>{Vr.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r,o)=>{const n=t._zod.def;un(n.innerType,e,o),e.seen.get(t).ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))})(t,e,r,o),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap}),Sa=/* @__PURE__ */ht("ZodPrefault",(t,e)=>{Hr.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r,o)=>{const n=t._zod.def;un(n.innerType,e,o),e.seen.get(t).ref=n.innerType,"input"===e.io&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))})(t,e,r,o),t.unwrap=()=>t._zod.def.innerType}),Oa=/* @__PURE__ */ht("ZodNonOptional",(t,e)=>{Gr.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r,o)=>{const n=t._zod.def;un(n.innerType,e,o),e.seen.get(t).ref=n.innerType})(t,e,0,o),t.unwrap=()=>t._zod.def.innerType}),Ia=/* @__PURE__ */ht("ZodCatch",(t,e)=>{Yr.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r,o)=>{const n=t._zod.def;let a;un(n.innerType,e,o),e.seen.get(t).ref=n.innerType;try{a=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a})(t,e,r,o),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap}),$a=/* @__PURE__ */ht("ZodPipe",(t,e)=>{Xr.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r,o)=>{const n=t._zod.def,a="input"===e.io?"transform"===n.in._zod.def.type?n.out:n.in:n.out;un(a,e,o),e.seen.get(t).ref=a})(t,e,0,o),t.in=e.in,t.out=e.out});function Ca(t,e){return new $a({type:"pipe",in:t,out:e})}const Na=/* @__PURE__ */ht("ZodReadonly",(t,e)=>{to.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r,o)=>{const n=t._zod.def;un(n.innerType,e,o),e.seen.get(t).ref=n.innerType,r.readOnly=!0})(t,e,r,o),t.unwrap=()=>t._zod.def.innerType}),Ta=/* @__PURE__ */ht("ZodCustom",(t,e)=>{ro.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(t,e,r)=>((t,e)=>{if("throw"===e.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,t)}),Ma="chat_device_id";function Aa(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}const ja=function(){const t={type:"object",shape:{id:Zn().optional(),type:ba(["text","image","audio","location","system"]).default("text"),content:Zn().optional(),imageUrl:Zn().url().optional(),audioUrl:Zn().optional(),latitude:ia().optional(),longitude:ia().optional(),timestamp:Zn().optional(),sender:ba(["bot","user","system"]).optional(),emotion:/* @__PURE__ */Po(da).optional()}??{},...Pt(void 0)};return new ga(t)}();class Pa{queue=[];endpoint;apiKey;flushInterval=null;isFlushing=!1;isDisabled=!1;MAX_QUEUE_SIZE=100;FLUSH_INTERVAL_MS=3e4;BATCH_SIZE=10;constructor(t,e){this.endpoint=t,this.apiKey=e,this.startAutoFlush()}startAutoFlush(){this.flushInterval=setInterval(()=>{!this.isDisabled&&this.queue.length>0&&this.flush()},this.FLUSH_INTERVAL_MS)}trackOpen(){this.track("chat_opened")}trackClose(){this.track("chat_closed")}trackMessageSent(t){this.track("message_sent",{type:t})}trackMessageReceived(t,e){this.track("message_received",{type:t,latency:e})}trackError(t,e){this.track("error",{error:t,context:e})}trackConnectionStatus(t){this.track("connection_status",{isConnected:t})}trackFeatureUsed(t){this.track("feature_used",{feature:t})}trackTypingStarted(){this.track("typing_started")}trackAttachmentSent(t,e){this.track("attachment_sent",{type:t,size:e})}track(t,e){this.isDisabled||(this.queue.push({event:t,properties:{...e,userAgent:"undefined"!=typeof navigator?navigator.userAgent:void 0,url:"undefined"!=typeof window?window.location.href:void 0},timestamp:Date.now()}),this.queue.length>=this.BATCH_SIZE&&this.flush(),this.queue.length>this.MAX_QUEUE_SIZE&&(this.queue=this.queue.slice(-this.MAX_QUEUE_SIZE),x.warn("Analytics queue overflow, dropping old events")))}async flush(){if(this.isDisabled||0===this.queue.length||this.isFlushing)return;this.isFlushing=!0;const t=[...this.queue];this.queue=[];try{const e=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify({events:t}),keepalive:!0});e.ok?x.debug(`Analytics: Flushed ${t.length} events`):(this.isDisabled=!0,this.queue=[],x.debug(`Analytics disabled: endpoint returned ${e.status}`))}catch(e){this.isDisabled=!0,this.queue=[],x.debug("Analytics disabled due to network error")}finally{this.isFlushing=!1}}destroy(){this.flushInterval&&clearInterval(this.flushInterval),this.flush()}}let Da=null,Za=null;function Fa(t){Da=t}function Ua(t){Za=t}const La=d(null);function Ra({children:t}){const e=c(null),o=c(null),a=c(null),[i,s]=r(!1);return n(()=>{if("undefined"==typeof document)return;const t=document.createElement("div");t.id="botuyo-chat-widget-root",document.body.appendChild(t),e.current=t;const r=t.attachShadow({mode:"open"});o.current=r;const n=document.createElement("style");n.textContent=j.replace(/:root/g,":host"),r.appendChild(n);const i=document.createElement("div");return i.id="botuyo-chat-widget-root",r.appendChild(i),a.current=i,s(!0),x.debug("ChatWidgetProvider: Shadow DOM initialized"),()=>{t.remove(),e.current=null,o.current=null,a.current=null}},[]),i&&a.current?A(t,a.current):null}function Ba({children:t,defaultLocale:e,initialState:o,onStateChange:n,...i}){const[s,c]=r(o?.isOpen??!1),[d,l]=r(0),u=a(()=>{c(!0),l(0),n?.(!0)},[n]),p=a(()=>{c(!1),n?.(!1)},[n]),h=a(()=>{c(t=>{const e=!t;return e&&l(0),n?.(e),e})},[n]),g=a(t=>{Da?(Da(t),x.debug("ChatWidgetProvider sendMessage:",t)):x.warn("sendMessage called but no handler registered")},[]),m=a(()=>{Za?(Za(),x.debug("ChatWidgetProvider clearMessages called")):x.warn("clearMessages called but no handler registered")},[]),f={isOpen:s,open:u,close:p,toggle:h,sendMessage:g,clearMessages:m,unreadCount:d},w=a((t,e)=>{"message:received"!==t||s||l(t=>t+1),i.onEvent?.(t,e)},[s,i]);/* @__PURE__ */
|
|
31
|
-
return T(E,{defaultLocale:e,children:/* @__PURE__ */N(
|
|
32
|
-
/* @__PURE__ */T(Ra,{children:/* @__PURE__ */T(Ha,{...i,onStateChange:t=>{c(t),t&&l(0),n?.(t)},onEvent:w})})]})})}function Wa(){const t=l(La);if(!t)throw new Error("useChatWidget must be used within a ChatWidgetProvider. Wrap your app with <ChatWidgetProvider>...</ChatWidgetProvider>");return t}const Ja=t=>new Promise((e,r)=>{const o=new FileReader;o.readAsDataURL(t),o.onload=()=>e(o.result),o.onerror=t=>r(t)});function Va(t){const{apiKey:i,apiBaseUrl:d,agentId:l,pageContext:u,includeSEOMetadata:p=!1,theme:g,userContext:m,onLogin:f,onNavigate:b,onEvent:y,onStateChange:v,onThemeUpdate:k}=t,[E,S]=r(0),O=c(0),{t:I}=h(),$=function(t,e,r=!0){const o=c(null);return n(()=>{if(!r||!t||!e)return;const n=`${t}/analytics`;o.current=new Pa(n,e);const a=()=>o.current?.flush(),i=()=>{"hidden"===document.visibilityState&&o.current?.flush()};return window.addEventListener("beforeunload",a),window.addEventListener("visibilitychange",i),()=>{window.removeEventListener("beforeunload",a),window.removeEventListener("visibilitychange",i),o.current?.destroy()}},[t,e,r]),{trackOpen:a(()=>{o.current?.trackOpen()},[]),trackClose:a(()=>{o.current?.trackClose()},[]),trackMessageSent:a(t=>{o.current?.trackMessageSent(t)},[]),trackMessageReceived:a((t,e)=>{o.current?.trackMessageReceived(t,e)},[]),trackError:a((t,e)=>{o.current?.trackError(t,e)},[]),trackConnectionStatus:a(t=>{o.current?.trackConnectionStatus(t)},[]),trackFeatureUsed:a(t=>{o.current?.trackFeatureUsed(t)},[])}}(d,i,!0),C=function({enabled:t=!0,soundEnabled:e=!0,desktopEnabled:o=!0,botName:i="BotUyo",logoUrl:s,notificationSoundUrl:d}={}){const[l,u]=r("default"),p=c(null),h=s||w,g=d||z;n(()=>{e&&"undefined"!=typeof window&&(p.current=new Audio(g),p.current.volume=.3)},[e,g]),n(()=>{"undefined"!=typeof window&&"Notification"in window&&u(Notification.permission)},[]);const m=a(async()=>{if("undefined"==typeof window||!("Notification"in window))return x.warn("Notifications API not available"),!1;try{const t=await Notification.requestPermission();return u(t),x.info("Notification permission:",t),"granted"===t}catch(t){return x.error("Error requesting notification permission:",t),!1}},[]),f=a(e=>{if(t&&o&&"granted"===l&&("undefined"==typeof document||!document.hasFocus()))try{const t=`Nuevo mensaje de ${i}`;let r="Mensaje recibido";"text"===e.type&&"content"in e?r=e.content?.slice(0,100)||"Mensaje recibido":"image"===e.type?r="📷 Imagen":"audio"===e.type?r="🎵 Audio":"location"===e.type&&(r="📍 Ubicación");const o=new Notification(t,{body:r,icon:h,tag:"chat-message",requireInteraction:!1,silent:!1});o.onclick=()=>{window.focus(),o.close()},setTimeout(()=>o.close(),5e3)}catch(r){x.error("Error showing notification:",r)}},[t,o,l,i,h]),b=a(()=>{if(t&&e&&("undefined"==typeof document||!document.hasFocus()))try{p.current?.play().catch(t=>{x.debug("Audio playback blocked:",t)})}catch(r){x.error("Error playing sound:",r)}},[t,e]),y=a(t=>{f(t),b()},[f,b]);return{permission:l,requestPermission:m,notify:f,playSound:b,notifyWithSound:y}}({enabled:!0,soundEnabled:!0,desktopEnabled:!0,botName:g?.botName||"BotUyo",logoUrl:g?.logoUrl}),N=function(t=10,e=6e4){const r=c([]);return{isAllowed:a(()=>{const o=Date.now();return r.current=r.current.filter(t=>o-t<e),!(r.current.length>=t||(r.current.push(o),0))},[t,e]),getRemainingAttempts:a(()=>{const o=Date.now();return r.current=r.current.filter(t=>o-t<e),Math.max(0,t-r.current.length)},[t,e]),getTimeUntilReset:a(()=>{if(0===r.current.length)return 0;const t=Date.now(),o=r.current[0],n=e-(t-o);return Math.max(0,n)},[e]),reset:a(()=>{r.current=[]},[])}}(10,6e4),{state:T,actions:A}=function(t="default"){const[o,i]=s(pt,ut),[c,d]=r(!1),l=e.useMemo(()=>function(t="default"){return`botuyo_chat_v1_${t}`}(t),[t]),u=e.useMemo(()=>((t="default")=>(lt.has(t)||lt.set(t,new dt(t)),lt.get(t)))(t),[t]);n(()=>{"undefined"==typeof window||c||(async()=>{try{await u.migrateFromLocalStorage(t);const e=await u.getMessages(100),r=await u.getMetadata();if(e.length>0||r){const t={messages:e.map(t=>({...t,timestamp:new Date(t.timestamp)})),sessionId:r?.sessionId||null,isOpen:r?.isOpen||!1};i({type:"RESTORE_SESSION",payload:t})}}catch(e){x.warn("Chat: Error rehydrating from IndexedDB",e);try{const t=localStorage.getItem(l);if(t){const e=JSON.parse(t);e.messages&&(e.messages=e.messages.map(t=>({...t,timestamp:new Date(t.timestamp)}))),i({type:"RESTORE_SESSION",payload:e})}}catch(r){x.error("Chat: Fallback rehydration failed",r)}}finally{d(!0)}})()},[c]),n(()=>{if(!c)return;const t=setTimeout(async()=>{try{await u.saveMessages(o.messages),await u.setMetadata({isOpen:o.isOpen,sessionId:o.sessionId})}catch(t){x.error("Chat Persistence Error:",t);try{const t={isOpen:o.isOpen,messages:o.messages,sessionId:o.sessionId};localStorage.setItem(l,JSON.stringify(t))}catch(e){x.error("Chat: Fallback persistence failed",e)}}},500);return()=>clearTimeout(t)},[o.isOpen,o.messages,o.sessionId,c]);const p=a(t=>{i({type:"ADD_MESSAGE",payload:t})},[]),h=a(()=>i({type:"TOGGLE_WINDOW"}),[]),g=a(()=>i({type:"OPEN_WINDOW"}),[]),m=a(()=>i({type:"CLOSE_WINDOW"}),[]),f=a(t=>i({type:"SET_CONNECTED",payload:t}),[]),w=a(t=>i({type:"SET_TYPING",payload:t}),[]),b=a(t=>i({type:"SET_MESSAGES",payload:t}),[]),y=a(t=>i({type:"SET_ERROR",payload:t}),[]),v=a(t=>i({type:"SET_SESSION_ID",payload:t}),[]),k=a(()=>{localStorage.removeItem(l),i({type:"CLEAR_CHAT"})},[]),_=a(()=>{i({type:"SET_MESSAGES",payload:[]})},[]);return{state:o,isHydrated:c,actions:{toggleWindow:h,openWindow:g,closeWindow:m,setConnected:f,setTyping:w,addMessage:p,setMessages:b,setError:y,setSessionId:v,clearChat:k,clearMessages:_}}}(l),j=function(t=!1){const e="undefined"!=typeof window?window.location.pathname:"",a=o(()=>e,[e]),[i,s]=r({});return n(()=>{if(!t)return void s({});const e=setTimeout(()=>{const t=function(){if("undefined"==typeof window)return{};const t={};t.title=document.title,document.querySelectorAll("meta").forEach(e=>{const r=e.getAttribute("name"),o=e.getAttribute("property"),n=e.getAttribute("content");if(n){if(r)switch(r){case"description":t.description=n;break;case"keywords":t.keywords=n.split(",").map(t=>t.trim());break;case"author":t.author=n}if(o){if(o.startsWith("og:")){const e=o.replace("og:","og_");t[e]=n}if(o.startsWith("twitter:")){const e=o.replace("twitter:","twitter_");t[e]=n}}}});try{const e=document.querySelectorAll('script[type="application/ld+json"]');if(e.length>0){const r=[];e.forEach(t=>{try{const e=JSON.parse(t.textContent||"");r.push(e)}catch{}}),r.length>0&&(t.structuredData=r)}}catch{}return t}();s(t)},100);return()=>clearTimeout(e)},[a,t]),t&&Object.keys(i).length>0?i:void 0}(p),P=function(t){const{apiKey:e,apiBaseUrl:i,agentId:s,pageContext:d,userContext:l}=t,u=c(t);n(()=>{u.current=t},[t]);const p=c(null),[h,g]=r(!1),[m,f]=r(!1),w=c(function(){try{const t=localStorage.getItem(Ma);if(t)return t;const e=Aa();return localStorage.setItem(Ma,e),e}catch{return x.warn("localStorage not available, using session-only device ID"),Aa()}}()),b=c(d);n(()=>{b.current=d},[d]);const y=a(t=>{const e=ja.safeParse(t),r=e.success&&e.data.id?e.data.id:`msg-${Math.random().toString(36).slice(2,11)}`,o=e.success&&e.data.sender?e.data.sender:"bot",n=e.success&&e.data.timestamp?new Date(e.data.timestamp):/* @__PURE__ */new Date,a=e.success?e.data:{type:"text"};switch(a.type){case"image":return{id:r,type:"image",sender:o,timestamp:n,imageUrl:a.imageUrl||a.content||"",altText:"Imagen enviada"};case"audio":{const t=a.audioUrl||"";return{id:r,type:"audio",sender:o,timestamp:n,content:t.startsWith("http://")||t.startsWith("https://")?t:t?`${i}/api/voice/audio/${r}`:a.content||"",text:a.content||void 0}}case"location":return{id:r,type:"location",sender:o,timestamp:n,latitude:Number(a.latitude||0),longitude:Number(a.longitude||0),name:a.content||"Ubicación compartida"};case"system":return{id:r,type:"system",sender:"system",timestamp:n,content:String(a.content||"")};default:return{id:r,type:"text",sender:o,timestamp:n,content:String(a.content||"Sin contenido"),emotion:a.emotion}}},[]),v=a(()=>{if(!e||!i)return;if(p.current?.connected)return;g(!0);const t=M(`${i}/webchat`,{auth:{apiKey:e,deviceId:w.current,agentId:s,token:l?.token,metadata:l?.metadata},transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3,extraHeaders:{"bypass-tunnel-reminder":"true","X-Tunnel-Skip-Anti-Phishing-Page":"true"}});t.on("connect",()=>{g(!1),f(!0),u.current.onConnected(`temp-${Date.now()}`,void 0)}),t.on("disconnect",t=>{g(!1),f(!1),u.current.onDisconnected()}),t.on("connect_error",t=>{g(!1),u.current.onError(`Error de conexión: ${t.message}`)}),t.on("connection_ack",t=>{u.current.onConnected(t.sessionId,t.config)}),t.on("bot_message",t=>{try{u.current.onMessage(y(t))}catch(e){x.error("ChatSocket Error processing bot_message:",e)}}),t.on("chat_history",t=>{if(t.messages&&Array.isArray(t.messages))if(u.current.onHistoryLoaded){const e=t.messages.map(t=>{try{return y(t)}catch(e){return x.debug("Error processing history message:",e),null}}).filter(t=>null!==t);u.current.onHistoryLoaded(e)}else t.messages.forEach(t=>{try{u.current.onMessage(y(t))}catch(e){x.debug("Error processing history message:",e)}});u.current.onEvent&&u.current.onEvent("history_loaded",t)}),t.on("bot_typing",t=>u.current.onTyping(t)),t.on("auth_success",t=>{u.current.onLogin&&u.current.onLogin(t),t.theme&&u.current.onThemeUpdate&&u.current.onThemeUpdate(t.theme)}),p.current=t},[e,i]),k=a(()=>{p.current&&(p.current.disconnect(),p.current=null,f(!1))},[]),z=c(v);z.current=v,n(()=>(z.current(),()=>{p.current&&(p.current.disconnect(),p.current=null)}),[]);const E=c([]),S=c([]),O=a(()=>`msg_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,[]),I=a(()=>{if(p.current?.connected)for(;E.current.length>0;){const t=E.current.shift();p.current.emit("user_message",t)}},[]);n(()=>{m&&I()},[m,I]),n(()=>{if(!m)return;const t=setInterval(()=>{const t=Date.now();S.current=S.current.filter(e=>t<e.nextRetryAt||(e.attempts>=e.maxAttempts?(u.current.onEvent?.("message_failed",{id:e.id,payload:e.payload}),x.error("Message failed after max retries:",e.id),!1):!p.current?.connected||(p.current.emit("user_message",e.payload,t=>{t?.success&&u.current.onEvent?.("message_sent",{id:e.id})}),e.attempts++,e.nextRetryAt=t+1e3*Math.pow(2,e.attempts),e.attempts<e.maxAttempts)))},500);return()=>clearInterval(t)},[m]);const $=a((t,e="text")=>{const r=O(),o={...b.current,currentUrl:"undefined"!=typeof window?window.location.href:void 0,sentAt:/* @__PURE__ */(new Date).toISOString(),deviceId:w.current},n={id:r,content:t.trim(),type:e,metadata:o};return p.current?.connected?(p.current.emit("user_message",n,t=>{!1!==t?.success&&t?u.current.onEvent?.("message_sent",{id:r}):(S.current.push({id:r,payload:n,attempts:0,maxAttempts:3,nextRetryAt:Date.now()+1e3}),u.current.onEvent?.("message_retry_queued",{id:r}))}),r):(E.current.push(n),u.current.onEvent?.("queued_message",{id:r,payload:n}),r)},[O]),C=o(()=>_(t=>{p.current?.emit("typing",t)},250),[]);return{isConnected:m,isConnecting:h,sendMessage:$,sendTyping:C,getSocket:a(()=>p.current,[]),requestHistory:a(()=>{p.current?.emit("request_history")},[]),reconnect:v,disconnect:k}}({apiKey:i,apiBaseUrl:d,agentId:l,pageContext:o(()=>j?{...u||{},seo:{...j||{}}}:u,[u,j]),userContext:m,onMessage:a(t=>{const e=Date.now(),r=O.current>0?e-O.current:void 0;O.current=e,A.addMessage(t),$.trackMessageReceived(t.type,r),T.isOpen||"bot"!==t.sender||(S(t=>t+1),C.notifyWithSound(t))},[A,T.isOpen,$,C]),onConnected:a((t,e)=>{A.setConnected(!0),A.setSessionId(t),$.trackConnectionStatus(!0),e&&k&&k(e),e&&y&&y("backend_config",e)},[A,y,k,$]),onDisconnected:a(()=>{A.setConnected(!1),$.trackConnectionStatus(!1)},[A,$]),onTyping:a(t=>A.setTyping(t),[A]),onError:a(t=>{A.setError(t),$.trackError(t)},[A,$]),onLogin:f,onNavigate:b,onEvent:y,onThemeUpdate:k,onHistoryLoaded:a(t=>{const e=new Set(T.messages.map(t=>t.id)),r=t.filter(t=>!e.has(t.id));r.length>0&&(0===T.messages.length?A.setMessages(t):r.forEach(t=>A.addMessage(t)))},[T.messages,A])}),D=a(()=>{x.debug("ChatWidget handleToggle called, current isOpen:",T.isOpen),T.isOpen?(A.closeWindow(),$.trackClose(),v?.(!1),x.debug("ChatWidget Closing window")):(A.openWindow(),S(0),$.trackOpen(),v?.(!0),x.debug("ChatWidget Opening window"))},[T.isOpen,A,v,$]),Z=a(t=>{if(!N.isAllowed()){const t=N.getTimeUntilReset(),e=Math.ceil(t/1e3);return void A.setError(I("rate_limit_exceeded")+` Espera ${e}s.`)}const e={id:`temp-${Date.now()}-${Math.random()}`,type:"text",sender:"user",timestamp:/* @__PURE__ */new Date,content:t};A.addMessage(e),$.trackMessageSent("text"),P.sendMessage(t,"text")},[A,P,N,$,I]),F=a(async(t,e)=>{let r;r="audio"===e?{id:`temp-${Date.now()}-${Math.random()}`,type:"audio",sender:"user",timestamp:/* @__PURE__ */new Date,content:URL.createObjectURL(t)}:"image"===e?{id:`temp-${Date.now()}-${Math.random()}`,type:"image",sender:"user",timestamp:/* @__PURE__ */new Date,imageUrl:URL.createObjectURL(t)}:{id:`temp-${Date.now()}-${Math.random()}`,type:"text",sender:"user",timestamp:/* @__PURE__ */new Date,content:`📎 ${t.name}`},A.addMessage(r);const o=await Ja(t);P.sendMessage(o,e)},[A,P]),U=a(t=>{const e={id:`temp-${Date.now()}-${Math.random()}`,type:"location",sender:"user",timestamp:/* @__PURE__ */new Date,latitude:t.latitude,longitude:t.longitude,name:"Mi ubicación"};A.addMessage(e),P.sendMessage(JSON.stringify(t),"location")},[A,P]);n(()=>{const t=()=>{T.isOpen||A.openWindow()},e=()=>{T.isOpen&&A.closeWindow()},r=()=>{T.isOpen?A.closeWindow():A.openWindow()},o=t=>{t.detail?.message&&Z(t.detail.message)};return window.addEventListener("botuyo-chat:open",t),window.addEventListener("botuyo-chat:close",e),window.addEventListener("botuyo-chat:toggle",r),window.addEventListener("botuyo-chat:send-message",o),()=>{window.removeEventListener("botuyo-chat:open",t),window.removeEventListener("botuyo-chat:close",e),window.removeEventListener("botuyo-chat:toggle",r),window.removeEventListener("botuyo-chat:send-message",o)}},[T.isOpen,A,Z]),n(()=>(Fa(Z),()=>Fa(null)),[Z]);const L=a(()=>{A.clearMessages(),x.info("Chat history cleared")},[A]);n(()=>(Ua(L),()=>Ua(null)),[L]);const R=o(()=>{if(T.isTyping)return"thinking";const t=[...T.messages].reverse().find(t=>"bot"===t.sender&&"text"===t.type);return"text"===t?.type&&t.emotion?t.emotion:"default"},[T.isTyping,T.messages]);return{state:T,actions:A,unreadCount:E,currentBotEmotion:R,isConnected:P.isConnected,getSocket:P.getSocket,handleToggle:D,handleSendText:Z,handleSendAttachment:F,handleSendLocation:U}}function qa(t){const{apiKey:e,apiBaseUrl:i="https://api.botuyo.com",agentId:s,pageContext:d,includeSEOMetadata:l=!1,theme:u,mediaConfig:p,userContext:h,onLogin:m,onNavigate:f,onEvent:w,onStateChange:y}=t,v=c(null),x=O(),_=function(t){const[e,o]=r(!1);return n(()=>{let e=null;const r=()=>{if(!t.current)return;const e=!!t.current.parentElement?.closest(".dark"),r=!!document.getElementById("botuyo-chat-widget-root")?.classList.contains("dark"),n=document.getElementById("botuyo-chat-widget-root"),a=!!n?.parentElement?.closest(".dark"),i=document.documentElement.classList.contains("dark"),s=document.body.classList.contains("dark"),c="dark"===document.documentElement.getAttribute("data-theme"),d="dark"===document.body.getAttribute("data-theme"),l=!!t.current.parentElement?.closest('[data-theme="dark"]'),u=window.matchMedia("(prefers-color-scheme: dark)").matches,p=e||r||a||i||s||c||d||l||u;t.current&&(p?t.current.classList.add("dark"):t.current.classList.remove("dark")),o(p)};r();const n=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>r();n.addEventListener("change",a);const i=new MutationObserver(()=>{r()}),s=document.getElementById("botuyo-chat-widget-root");s&&(i.observe(s,{attributes:!0,attributeFilter:["class"]}),s.parentElement&&(i.observe(s.parentElement,{attributes:!0,attributeFilter:["class"],childList:!0}),e=s.parentElement)),i.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"]}),i.observe(document.body,{attributes:!0,attributeFilter:["class","data-theme"]});let c=t.current?.parentElement;for(;c;)i.observe(c,{attributes:!0,attributeFilter:["class","data-theme"]}),c=c.parentElement;const d=setInterval(()=>{const t=document.getElementById("botuyo-chat-widget-root");t&&t.parentElement!==e&&(e&&t.parentElement&&(i.observe(t.parentElement,{attributes:!0,attributeFilter:["class"],childList:!0}),e=t.parentElement),r())},100);return()=>{i.disconnect(),n.removeEventListener("change",a),clearInterval(d)}},[t]),e}(v),[z,E]=r(),{mergedTheme:S,mergedStyles:C,getContainerStyle:M}=function(t,e){const a=function(){const[t,e]=r(()=>"undefined"!=typeof window&&(window.matchMedia("(prefers-contrast: high)").matches||window.matchMedia("(prefers-contrast: more)").matches));return n(()=>{const t=window.matchMedia("(prefers-contrast: high)"),r=window.matchMedia("(prefers-contrast: more)"),o=t=>{e(t.matches)};return t.addEventListener("change",o),r.addEventListener("change",o),()=>{t.removeEventListener("change",o),r.removeEventListener("change",o)}},[]),t}(),i=o(()=>{const r=k(t,e);return a?{...r,cssVariables:{...r.cssVariables,primary:"0 0% 0%",primaryForeground:"0 0% 100%",background:"0 0% 100%",foreground:"0 0% 0%",card:"0 0% 100%",cardForeground:"0 0% 0%",muted:"0 0% 96%",mutedForeground:"0 0% 0%",border:"0 0% 0%"}}:r},[t,e,a]),s=o(()=>({radius:{...Z,...t?.bubbleStyles?.radius},bot:{...F,...t?.bubbleStyles?.bot},user:{...U,...t?.bubbleStyles?.user},launcher:{...t?.bubbleStyles?.launcher},mapCard:{...t?.bubbleStyles?.mapCard}}),[t?.bubbleStyles]);return{mergedTheme:i,mergedStyles:s,getContainerStyle:(t,e,r)=>({"--chat-primary":`hsl(${i.cssVariables.primary})`,zIndex:t?2147483647:9999,position:"fixed",top:e&&t?0:"auto",left:e&&t?0:"bottom-left"===r?"24px":"auto",right:e&&t?0:"bottom-right"!==r&&r?"auto":"24px",bottom:e&&t?0:"24px",width:e&&t?"100%":"auto",height:e&&t?"100%":"auto"})}}(u,z);n(()=>{S.isHidden&&console.warn('[BotUyo] ⚠️ El agente (o Flow) de IA asociado a esta API Key se encuentra pausado o en estado "boceto" (draft). El widget no se mostrará hasta que lo publiques dentro de la plataforma BotUyo.')},[S.isHidden]);const{state:A,actions:j,unreadCount:L,currentBotEmotion:R,isConnected:B,handleToggle:W,handleSendText:J,handleSendAttachment:V,handleSendLocation:q,getSocket:H}=Va({apiKey:e,apiBaseUrl:i,agentId:s,pageContext:d,includeSEOMetadata:l,theme:u,userContext:h,onLogin:m,onNavigate:f,onEvent:w,onStateChange:y,onThemeUpdate:E}),G=a(t=>{j.addMessage({id:`voice-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,type:"text",sender:t.sender,timestamp:t.timestamp||/* @__PURE__ */new Date,content:t.content})},[j]),K=o(()=>{const t={...p||{}},e=z;return null!=e?.voiceEnabled&&(t.enableVoice=e.voiceEnabled),t},[p,z]),Y=a(t=>{t.stopPropagation()},[]),X=M(A.isOpen,x,u?.position),Q=o(()=>{const t={"--background":"0 0% 100%","--foreground":"240 10% 3.9%","--card":"0 0% 100%","--card-foreground":"240 10% 3.9%","--primary":"160 84% 39%","--primary-foreground":"0 0% 100%","--muted":"240 4.8% 95.9%","--muted-foreground":"240 3.8% 46.1%","--border":"240 5.9% 90%","--destructive":"0 84.2% 60.2%","--radius":"0.5rem","--window-border-radius":"24px","--launcher-border-radius":"50%","--window-height":"700px","--window-bottom":"24px","--spacing-1":"0.25rem","--spacing-2":"0.5rem","--spacing-3":"0.75rem","--spacing-4":"1rem","--spacing-5":"0.75rem","--spacing-6":"1.5rem","--spacing-7":"1.75rem","--spacing-8":"2rem"};if(!S.cssVariables)return t;let e={...S.cssVariables};if(_){const t=z?.darkCssVariables||{},r=u?.darkCssVariables||{};e={...e,...I,...t,...r}}const r={...t};return e.background&&(r["--background"]=e.background),e.foreground&&(r["--foreground"]=e.foreground),e.card&&(r["--card"]=e.card),e.cardForeground&&(r["--card-foreground"]=e.cardForeground),e.primary&&(r["--primary"]=e.primary),e.primaryForeground&&(r["--primary-foreground"]=e.primaryForeground),e.muted&&(r["--muted"]=e.muted),e.mutedForeground&&(r["--muted-foreground"]=e.mutedForeground),e.border&&(r["--border"]=e.border),e.destructive&&(r["--destructive"]=e.destructive),e.radius&&(r["--radius"]=e.radius),e.windowBorderRadius&&(r["--window-border-radius"]=e.windowBorderRadius),e.launcherBorderRadius&&(r["--launcher-border-radius"]=e.launcherBorderRadius),e.windowHeight&&(r["--window-height"]=e.windowHeight),e.windowBottom&&(r["--window-bottom"]=e.windowBottom),e.spacing1&&(r["--spacing-1"]=e.spacing1),e.spacing2&&(r["--spacing-2"]=e.spacing2),e.spacing3&&(r["--spacing-3"]=e.spacing3),e.spacing4&&(r["--spacing-4"]=e.spacing4),e.spacing5&&(r["--spacing-5"]=e.spacing5),e.spacing6&&(r["--spacing-6"]=e.spacing6),e.spacing7&&(r["--spacing-7"]=e.spacing7),e.spacing8&&(r["--spacing-8"]=e.spacing8),r},[S.cssVariables,_,z,u?.darkCssVariables]);return S.isHidden?null:z?/* @__PURE__ */N("div",{ref:v,id:"botuyo-chat-widget",className:b("botuyo-chat-widget flex flex-col",!x&&("bottom-left"===u?.position?"items-start":"items-end")),style:{...X,...Q,pointerEvents:"auto",backgroundColor:"transparent"},"data-animations-disabled":!1===u?.animations?.enabled?"true":void 0,"data-effects-glassmorphism":!1===u?.effects?.glassmorphism?"false":void 0,"data-effects-shadows":!1===u?.effects?.softShadows?"false":void 0,children:[
|
|
30
|
+
return Do(la)}const pa=/* @__PURE__ */ht("ZodNever",(t,e)=>{Or.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(t,e,r)=>((t,e,r)=>{r.not={}})(0,0,e)}),ha=/* @__PURE__ */ht("ZodArray",(t,e)=>{$r.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r,o)=>{const n=r,a=t._zod.def,{minimum:i,maximum:s}=t._zod.bag;"number"==typeof i&&(n.minItems=i),"number"==typeof s&&(n.maxItems=s),n.type="array",n.items=un(a.element,e,{...o,path:[...o.path,"items"]})})(t,e,r,o),t.element=e.element,t.min=(e,r)=>t.check(/* @__PURE__ */Jo(e,r)),t.nonempty=e=>t.check(/* @__PURE__ */Jo(1,e)),t.max=(e,r)=>t.check(/* @__PURE__ */Wo(e,r)),t.length=(e,r)=>t.check(/* @__PURE__ */Vo(e,r)),t.unwrap=()=>t.element}),ga=/* @__PURE__ */ht("ZodObject",(t,e)=>{Ar.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r,o)=>{const n=r,a=t._zod.def;n.type="object",n.properties={};const i=a.shape;for(const d in i)n.properties[d]=un(i[d],e,{...o,path:[...o.path,"properties",d]});const s=new Set(Object.keys(i)),c=new Set([...s].filter(t=>{const r=a.shape[t]._zod;return"input"===e.io?void 0===r.optin:void 0===r.optout}));c.size>0&&(n.required=Array.from(c)),"never"===a.catchall?._zod.def.type?n.additionalProperties=!1:a.catchall?a.catchall&&(n.additionalProperties=un(a.catchall,e,{...o,path:[...o.path,"additionalProperties"]})):"output"===e.io&&(n.additionalProperties=!1)})(t,e,r,o),zt(t,"shape",()=>e.shape),t.keyof=()=>ba(Object.keys(t._zod.def.shape)),t.catchall=e=>t.clone({...t._zod.def,catchall:e}),t.passthrough=()=>t.clone({...t._zod.def,catchall:ua()}),t.loose=()=>t.clone({...t._zod.def,catchall:ua()}),t.strict=()=>t.clone({...t._zod.def,catchall:/* @__PURE__ */Zo(pa,void 0)}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=e=>function(t,e){if(!Nt(e))throw new Error("Invalid input to extend: expected a plain object");const r=t._zod.def.checks;if(r&&r.length>0){const r=t._zod.def.shape;for(const t in e)if(void 0!==Object.getOwnPropertyDescriptor(r,t))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=St(t._zod.def,{get shape(){const r={...t._zod.def.shape,...e};return Et(this,"shape",r),r}});return jt(t,o)}(t,e),t.safeExtend=e=>function(t,e){if(!Nt(e))throw new Error("Invalid input to safeExtend: expected a plain object");const r=St(t._zod.def,{get shape(){const r={...t._zod.def.shape,...e};return Et(this,"shape",r),r}});return jt(t,r)}(t,e),t.merge=e=>function(t,e){const r=St(t._zod.def,{get shape(){const r={...t._zod.def.shape,...e._zod.def.shape};return Et(this,"shape",r),r},get catchall(){return e._zod.def.catchall},checks:[]});return jt(t,r)}(t,e),t.pick=e=>function(t,e){const r=t._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return jt(t,St(t._zod.def,{get shape(){const t={};for(const o in e){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(t[o]=r.shape[o])}return Et(this,"shape",t),t},checks:[]}))}(t,e),t.omit=e=>function(t,e){const r=t._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const n=St(t._zod.def,{get shape(){const o={...t._zod.def.shape};for(const t in e){if(!(t in r.shape))throw new Error(`Unrecognized key: "${t}"`);e[t]&&delete o[t]}return Et(this,"shape",o),o},checks:[]});return jt(t,n)}(t,e),t.partial=(...e)=>function(t,e,r){const o=e._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const n=St(e._zod.def,{get shape(){const o=e._zod.def.shape,n={...o};if(r)for(const e in r){if(!(e in o))throw new Error(`Unrecognized key: "${e}"`);r[e]&&(n[e]=t?new t({type:"optional",innerType:o[e]}):o[e])}else for(const e in o)n[e]=t?new t({type:"optional",innerType:o[e]}):o[e];return Et(this,"shape",n),n},checks:[]});return jt(e,n)}(va,t,e[0]),t.required=(...e)=>function(t,e,r){const o=St(e._zod.def,{get shape(){const o=e._zod.def.shape,n={...o};if(r)for(const e in r){if(!(e in n))throw new Error(`Unrecognized key: "${e}"`);r[e]&&(n[e]=new t({type:"nonoptional",innerType:o[e]}))}else for(const e in o)n[e]=new t({type:"nonoptional",innerType:o[e]});return Et(this,"shape",n),n}});return jt(e,o)}(Oa,t,e[0])}),ma=/* @__PURE__ */ht("ZodUnion",(t,e)=>{Pr.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r,o)=>{const n=t._zod.def,a=!1===n.inclusive,i=n.options.map((t,r)=>un(t,e,{...o,path:[...o.path,a?"oneOf":"anyOf",r]}));a?r.oneOf=i:r.anyOf=i})(t,e,r,o),t.options=e.options}),fa=/* @__PURE__ */ht("ZodIntersection",(t,e)=>{Dr.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r,o)=>{const n=t._zod.def,a=un(n.left,e,{...o,path:[...o.path,"allOf",0]}),i=un(n.right,e,{...o,path:[...o.path,"allOf",1]}),s=t=>"allOf"in t&&1===Object.keys(t).length,c=[...s(a)?a.allOf:[a],...s(i)?i.allOf:[i]];r.allOf=c})(t,e,r,o)}),wa=/* @__PURE__ */ht("ZodEnum",(t,e)=>{Ur.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r)=>{const o=bt(t._zod.def.entries);o.every(t=>"number"==typeof t)&&(r.type="number"),o.every(t=>"string"==typeof t)&&(r.type="string"),r.enum=o})(t,0,r),t.enum=e.entries,t.options=Object.values(e.entries);const r=new Set(Object.keys(e.entries));t.extract=(t,o)=>{const n={};for(const a of t){if(!r.has(a))throw new Error(`Key ${a} not found in enum`);n[a]=e.entries[a]}return new wa({...e,checks:[],...Pt(o),entries:n})},t.exclude=(t,o)=>{const n={...e.entries};for(const e of t){if(!r.has(e))throw new Error(`Key ${e} not found in enum`);delete n[e]}return new wa({...e,checks:[],...Pt(o),entries:n})}});function ba(t,e){const r=Array.isArray(t)?Object.fromEntries(t.map(t=>[t,t])):t;return new wa({type:"enum",entries:r,...Pt(e)})}const ya=/* @__PURE__ */ht("ZodTransform",(t,e)=>{Rr.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(t,e,r)=>((t,e)=>{if("throw"===e.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,t),t._zod.parse=(r,o)=>{if("backward"===o.direction)throw new mt(t.constructor.name);r.addIssue=o=>{if("string"==typeof o)r.issues.push(Bt(o,r.value,e));else{const e=o;e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=r.value),e.inst??(e.inst=t),r.issues.push(Bt(e))}};const n=e.transform(r.value,r);return n instanceof Promise?n.then(t=>(r.value=t,r)):(r.value=n,r)}}),va=/* @__PURE__ */ht("ZodOptional",(t,e)=>{Br.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>wn(t,e,0,o),t.unwrap=()=>t._zod.def.innerType});function xa(t){return new va({type:"optional",innerType:t})}const ka=/* @__PURE__ */ht("ZodExactOptional",(t,e)=>{Wr.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>wn(t,e,0,o),t.unwrap=()=>t._zod.def.innerType}),_a=/* @__PURE__ */ht("ZodNullable",(t,e)=>{Jr.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r,o)=>{const n=t._zod.def,a=un(n.innerType,e,o),i=e.seen.get(t);"openapi-3.0"===e.target?(i.ref=n.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}]})(t,e,r,o),t.unwrap=()=>t._zod.def.innerType});function za(t){return new _a({type:"nullable",innerType:t})}const Ea=/* @__PURE__ */ht("ZodDefault",(t,e)=>{Vr.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r,o)=>{const n=t._zod.def;un(n.innerType,e,o),e.seen.get(t).ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))})(t,e,r,o),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap}),Sa=/* @__PURE__ */ht("ZodPrefault",(t,e)=>{Hr.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r,o)=>{const n=t._zod.def;un(n.innerType,e,o),e.seen.get(t).ref=n.innerType,"input"===e.io&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))})(t,e,r,o),t.unwrap=()=>t._zod.def.innerType}),Oa=/* @__PURE__ */ht("ZodNonOptional",(t,e)=>{Gr.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r,o)=>{const n=t._zod.def;un(n.innerType,e,o),e.seen.get(t).ref=n.innerType})(t,e,0,o),t.unwrap=()=>t._zod.def.innerType}),Ia=/* @__PURE__ */ht("ZodCatch",(t,e)=>{Yr.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r,o)=>{const n=t._zod.def;let a;un(n.innerType,e,o),e.seen.get(t).ref=n.innerType;try{a=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a})(t,e,r,o),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap}),$a=/* @__PURE__ */ht("ZodPipe",(t,e)=>{Xr.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r,o)=>{const n=t._zod.def,a="input"===e.io?"transform"===n.in._zod.def.type?n.out:n.in:n.out;un(a,e,o),e.seen.get(t).ref=a})(t,e,0,o),t.in=e.in,t.out=e.out});function Ca(t,e){return new $a({type:"pipe",in:t,out:e})}const Na=/* @__PURE__ */ht("ZodReadonly",(t,e)=>{to.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(e,r,o)=>((t,e,r,o)=>{const n=t._zod.def;un(n.innerType,e,o),e.seen.get(t).ref=n.innerType,r.readOnly=!0})(t,e,r,o),t.unwrap=()=>t._zod.def.innerType}),Ta=/* @__PURE__ */ht("ZodCustom",(t,e)=>{ro.init(t,e),jn.init(t,e),t._zod.processJSONSchema=(t,e,r)=>((t,e)=>{if("throw"===e.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,t)}),Ma="chat_device_id";function Aa(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}const ja=function(){const t={type:"object",shape:{id:Zn().optional(),type:ba(["text","image","audio","location","system"]).default("text"),content:Zn().optional(),imageUrl:Zn().url().optional(),audioUrl:Zn().optional(),latitude:ia().optional(),longitude:ia().optional(),timestamp:Zn().optional(),sender:ba(["bot","user","system"]).optional(),emotion:/* @__PURE__ */Po(da).optional()}??{},...Pt(void 0)};return new ga(t)}();class Pa{queue=[];endpoint;apiKey;flushInterval=null;isFlushing=!1;isDisabled=!1;MAX_QUEUE_SIZE=100;FLUSH_INTERVAL_MS=3e4;BATCH_SIZE=10;constructor(t,e){this.endpoint=t,this.apiKey=e,this.startAutoFlush()}startAutoFlush(){this.flushInterval=setInterval(()=>{!this.isDisabled&&this.queue.length>0&&this.flush()},this.FLUSH_INTERVAL_MS)}trackOpen(){this.track("chat_opened")}trackClose(){this.track("chat_closed")}trackMessageSent(t){this.track("message_sent",{type:t})}trackMessageReceived(t,e){this.track("message_received",{type:t,latency:e})}trackError(t,e){this.track("error",{error:t,context:e})}trackConnectionStatus(t){this.track("connection_status",{isConnected:t})}trackFeatureUsed(t){this.track("feature_used",{feature:t})}trackTypingStarted(){this.track("typing_started")}trackAttachmentSent(t,e){this.track("attachment_sent",{type:t,size:e})}track(t,e){this.isDisabled||(this.queue.push({event:t,properties:{...e,userAgent:"undefined"!=typeof navigator?navigator.userAgent:void 0,url:"undefined"!=typeof window?window.location.href:void 0},timestamp:Date.now()}),this.queue.length>=this.BATCH_SIZE&&this.flush(),this.queue.length>this.MAX_QUEUE_SIZE&&(this.queue=this.queue.slice(-this.MAX_QUEUE_SIZE),x.warn("Analytics queue overflow, dropping old events")))}async flush(){if(this.isDisabled||0===this.queue.length||this.isFlushing)return;this.isFlushing=!0;const t=[...this.queue];this.queue=[];try{const e=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify({events:t}),keepalive:!0});e.ok?x.debug(`Analytics: Flushed ${t.length} events`):(this.isDisabled=!0,this.queue=[],x.debug(`Analytics disabled: endpoint returned ${e.status}`))}catch(e){this.isDisabled=!0,this.queue=[],x.debug("Analytics disabled due to network error")}finally{this.isFlushing=!1}}destroy(){this.flushInterval&&clearInterval(this.flushInterval),this.flush()}}let Da=null,Za=null;function Fa(t){Da=t}function Ua(t){Za=t}const Ra=d(null);function La({children:t}){const e=c(null),o=c(null),[a,i]=r(!1);return n(()=>{if("undefined"==typeof document)return;let t,r,n=document.getElementById("botuyo-chat-widget-root");if(n&&n.shadowRoot)t=n.shadowRoot,r=t.getElementById("botuyo-chat-widget-root")||t.querySelector("div");else{n=document.createElement("div"),n.id="botuyo-chat-widget-root",document.body.appendChild(n),t=n.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=j.replace(/:root/g,":host"),t.appendChild(e),r=document.createElement("div"),r.id="botuyo-chat-widget-root",t.appendChild(r)}return o.current=n,e.current=r,i(!0),x.debug("ChatWidgetProvider: Shadow DOM initialized"),()=>{o.current&&(o.current.remove(),o.current=null,e.current=null)}},[]),a&&e.current?A(t,e.current):null}function Ba({children:t,defaultLocale:e,initialState:o,onStateChange:n,...i}){const[s,c]=r(o?.isOpen??!1),[d,l]=r(0),u=a(()=>{c(!0),l(0),n?.(!0)},[n]),p=a(()=>{c(!1),n?.(!1)},[n]),h=a(()=>{c(t=>{const e=!t;return e&&l(0),n?.(e),e})},[n]),g=a(t=>{Da?(Da(t),x.debug("ChatWidgetProvider sendMessage:",t)):x.warn("sendMessage called but no handler registered")},[]),m=a(()=>{Za?(Za(),x.debug("ChatWidgetProvider clearMessages called")):x.warn("clearMessages called but no handler registered")},[]),f={isOpen:s,open:u,close:p,toggle:h,sendMessage:g,clearMessages:m,unreadCount:d},w=a((t,e)=>{"message:received"!==t||s||l(t=>t+1),i.onEvent?.(t,e)},[s,i]);/* @__PURE__ */
|
|
31
|
+
return T(E,{defaultLocale:e,children:/* @__PURE__ */N(Ra.Provider,{value:f,children:[t,
|
|
32
|
+
/* @__PURE__ */T(La,{children:/* @__PURE__ */T(Ha,{...i,onStateChange:t=>{c(t),t&&l(0),n?.(t)},onEvent:w})})]})})}function Wa(){const t=l(Ra);if(!t)throw new Error("useChatWidget must be used within a ChatWidgetProvider. Wrap your app with <ChatWidgetProvider>...</ChatWidgetProvider>");return t}const Ja=t=>new Promise((e,r)=>{const o=new FileReader;o.readAsDataURL(t),o.onload=()=>e(o.result),o.onerror=t=>r(t)});function Va(t){const{apiKey:i,apiBaseUrl:d,agentId:l,pageContext:u,includeSEOMetadata:p=!1,theme:g,userContext:m,onLogin:f,onNavigate:b,onEvent:y,onStateChange:v,onThemeUpdate:k}=t,[E,S]=r(0),O=c(0),{t:I}=h(),$=function(t,e,r=!0){const o=c(null);return n(()=>{if(!r||!t||!e)return;const n=`${t}/analytics`;o.current=new Pa(n,e);const a=()=>o.current?.flush(),i=()=>{"hidden"===document.visibilityState&&o.current?.flush()};return window.addEventListener("beforeunload",a),window.addEventListener("visibilitychange",i),()=>{window.removeEventListener("beforeunload",a),window.removeEventListener("visibilitychange",i),o.current?.destroy()}},[t,e,r]),{trackOpen:a(()=>{o.current?.trackOpen()},[]),trackClose:a(()=>{o.current?.trackClose()},[]),trackMessageSent:a(t=>{o.current?.trackMessageSent(t)},[]),trackMessageReceived:a((t,e)=>{o.current?.trackMessageReceived(t,e)},[]),trackError:a((t,e)=>{o.current?.trackError(t,e)},[]),trackConnectionStatus:a(t=>{o.current?.trackConnectionStatus(t)},[]),trackFeatureUsed:a(t=>{o.current?.trackFeatureUsed(t)},[])}}(d,i,!0),C=function({enabled:t=!0,soundEnabled:e=!0,desktopEnabled:o=!0,botName:i="BotUyo",logoUrl:s,notificationSoundUrl:d}={}){const[l,u]=r("default"),p=c(null),h=s||w,g=d||z;n(()=>{e&&"undefined"!=typeof window&&(p.current=new Audio(g),p.current.volume=.3)},[e,g]),n(()=>{"undefined"!=typeof window&&"Notification"in window&&u(Notification.permission)},[]);const m=a(async()=>{if("undefined"==typeof window||!("Notification"in window))return x.warn("Notifications API not available"),!1;try{const t=await Notification.requestPermission();return u(t),x.info("Notification permission:",t),"granted"===t}catch(t){return x.error("Error requesting notification permission:",t),!1}},[]),f=a(e=>{if(t&&o&&"granted"===l&&("undefined"==typeof document||!document.hasFocus()))try{const t=`Nuevo mensaje de ${i}`;let r="Mensaje recibido";"text"===e.type&&"content"in e?r=e.content?.slice(0,100)||"Mensaje recibido":"image"===e.type?r="📷 Imagen":"audio"===e.type?r="🎵 Audio":"location"===e.type&&(r="📍 Ubicación");const o=new Notification(t,{body:r,icon:h,tag:"chat-message",requireInteraction:!1,silent:!1});o.onclick=()=>{window.focus(),o.close()},setTimeout(()=>o.close(),5e3)}catch(r){x.error("Error showing notification:",r)}},[t,o,l,i,h]),b=a(()=>{if(t&&e&&("undefined"==typeof document||!document.hasFocus()))try{p.current?.play().catch(t=>{x.debug("Audio playback blocked:",t)})}catch(r){x.error("Error playing sound:",r)}},[t,e]),y=a(t=>{f(t),b()},[f,b]);return{permission:l,requestPermission:m,notify:f,playSound:b,notifyWithSound:y}}({enabled:!0,soundEnabled:!0,desktopEnabled:!0,botName:g?.botName||"BotUyo",logoUrl:g?.logoUrl}),N=function(t=10,e=6e4){const r=c([]);return{isAllowed:a(()=>{const o=Date.now();return r.current=r.current.filter(t=>o-t<e),!(r.current.length>=t||(r.current.push(o),0))},[t,e]),getRemainingAttempts:a(()=>{const o=Date.now();return r.current=r.current.filter(t=>o-t<e),Math.max(0,t-r.current.length)},[t,e]),getTimeUntilReset:a(()=>{if(0===r.current.length)return 0;const t=Date.now(),o=r.current[0],n=e-(t-o);return Math.max(0,n)},[e]),reset:a(()=>{r.current=[]},[])}}(10,6e4),{state:T,actions:A}=function(t="default"){const[o,i]=s(pt,ut),[c,d]=r(!1),l=e.useMemo(()=>function(t="default"){return`botuyo_chat_v1_${t}`}(t),[t]),u=e.useMemo(()=>((t="default")=>(lt.has(t)||lt.set(t,new dt(t)),lt.get(t)))(t),[t]);n(()=>{"undefined"==typeof window||c||(async()=>{try{await u.migrateFromLocalStorage(t);const e=await u.getMessages(100),r=await u.getMetadata();if(e.length>0||r){const t={messages:e.map(t=>({...t,timestamp:new Date(t.timestamp)})),sessionId:r?.sessionId||null,isOpen:r?.isOpen||!1};i({type:"RESTORE_SESSION",payload:t})}}catch(e){x.warn("Chat: Error rehydrating from IndexedDB",e);try{const t=localStorage.getItem(l);if(t){const e=JSON.parse(t);e.messages&&(e.messages=e.messages.map(t=>({...t,timestamp:new Date(t.timestamp)}))),i({type:"RESTORE_SESSION",payload:e})}}catch(r){x.error("Chat: Fallback rehydration failed",r)}}finally{d(!0)}})()},[c]),n(()=>{if(!c)return;const t=setTimeout(async()=>{try{await u.saveMessages(o.messages),await u.setMetadata({isOpen:o.isOpen,sessionId:o.sessionId})}catch(t){x.error("Chat Persistence Error:",t);try{const t={isOpen:o.isOpen,messages:o.messages,sessionId:o.sessionId};localStorage.setItem(l,JSON.stringify(t))}catch(e){x.error("Chat: Fallback persistence failed",e)}}},500);return()=>clearTimeout(t)},[o.isOpen,o.messages,o.sessionId,c]);const p=a(t=>{i({type:"ADD_MESSAGE",payload:t})},[]),h=a(()=>i({type:"TOGGLE_WINDOW"}),[]),g=a(()=>i({type:"OPEN_WINDOW"}),[]),m=a(()=>i({type:"CLOSE_WINDOW"}),[]),f=a(t=>i({type:"SET_CONNECTED",payload:t}),[]),w=a(t=>i({type:"SET_TYPING",payload:t}),[]),b=a(t=>i({type:"SET_MESSAGES",payload:t}),[]),y=a(t=>i({type:"SET_ERROR",payload:t}),[]),v=a(t=>i({type:"SET_SESSION_ID",payload:t}),[]),k=a(()=>{localStorage.removeItem(l),i({type:"CLEAR_CHAT"})},[]),_=a(()=>{i({type:"SET_MESSAGES",payload:[]})},[]);return{state:o,isHydrated:c,actions:{toggleWindow:h,openWindow:g,closeWindow:m,setConnected:f,setTyping:w,addMessage:p,setMessages:b,setError:y,setSessionId:v,clearChat:k,clearMessages:_}}}(l),j=function(t=!1){const e="undefined"!=typeof window?window.location.pathname:"",a=o(()=>e,[e]),[i,s]=r({});return n(()=>{if(!t)return void s({});const e=setTimeout(()=>{const t=function(){if("undefined"==typeof window)return{};const t={};t.title=document.title,document.querySelectorAll("meta").forEach(e=>{const r=e.getAttribute("name"),o=e.getAttribute("property"),n=e.getAttribute("content");if(n){if(r)switch(r){case"description":t.description=n;break;case"keywords":t.keywords=n.split(",").map(t=>t.trim());break;case"author":t.author=n}if(o){if(o.startsWith("og:")){const e=o.replace("og:","og_");t[e]=n}if(o.startsWith("twitter:")){const e=o.replace("twitter:","twitter_");t[e]=n}}}});try{const e=document.querySelectorAll('script[type="application/ld+json"]');if(e.length>0){const r=[];e.forEach(t=>{try{const e=JSON.parse(t.textContent||"");r.push(e)}catch{}}),r.length>0&&(t.structuredData=r)}}catch{}return t}();s(t)},100);return()=>clearTimeout(e)},[a,t]),t&&Object.keys(i).length>0?i:void 0}(p),P=function(t){const{apiKey:e,apiBaseUrl:i,agentId:s,pageContext:d,userContext:l}=t,u=c(t);n(()=>{u.current=t},[t]);const p=c(null),[h,g]=r(!1),[m,f]=r(!1),w=c(function(){try{const t=localStorage.getItem(Ma);if(t)return t;const e=Aa();return localStorage.setItem(Ma,e),e}catch{return x.warn("localStorage not available, using session-only device ID"),Aa()}}()),b=c(d);n(()=>{b.current=d},[d]);const y=a(t=>{const e=ja.safeParse(t),r=e.success&&e.data.id?e.data.id:`msg-${Math.random().toString(36).slice(2,11)}`,o=e.success&&e.data.sender?e.data.sender:"bot",n=e.success&&e.data.timestamp?new Date(e.data.timestamp):/* @__PURE__ */new Date,a=e.success?e.data:{type:"text"};switch(a.type){case"image":return{id:r,type:"image",sender:o,timestamp:n,imageUrl:a.imageUrl||a.content||"",altText:"Imagen enviada"};case"audio":{const t=a.audioUrl||"";return{id:r,type:"audio",sender:o,timestamp:n,content:t.startsWith("http://")||t.startsWith("https://")?t:t?`${i}/api/voice/audio/${r}`:a.content||"",text:a.content||void 0}}case"location":return{id:r,type:"location",sender:o,timestamp:n,latitude:Number(a.latitude||0),longitude:Number(a.longitude||0),name:a.content||"Ubicación compartida"};case"system":return{id:r,type:"system",sender:"system",timestamp:n,content:String(a.content||"")};default:return{id:r,type:"text",sender:o,timestamp:n,content:String(a.content||"Sin contenido"),emotion:a.emotion}}},[]),v=a(()=>{if(!e||!i)return;if(p.current?.connected)return;g(!0);const t=M(`${i}/webchat`,{auth:{apiKey:e,deviceId:w.current,agentId:s,token:l?.token,metadata:l?.metadata},transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3,extraHeaders:{"bypass-tunnel-reminder":"true","X-Tunnel-Skip-Anti-Phishing-Page":"true"}});t.on("connect",()=>{g(!1),f(!0),u.current.onConnected(`temp-${Date.now()}`,void 0)}),t.on("disconnect",t=>{g(!1),f(!1),u.current.onDisconnected()}),t.on("connect_error",t=>{g(!1),u.current.onError(`Error de conexión: ${t.message}`)}),t.on("connection_ack",t=>{u.current.onConnected(t.sessionId,t.config)}),t.on("bot_message",t=>{try{u.current.onMessage(y(t))}catch(e){x.error("ChatSocket Error processing bot_message:",e)}}),t.on("chat_history",t=>{if(t.messages&&Array.isArray(t.messages))if(u.current.onHistoryLoaded){const e=t.messages.map(t=>{try{return y(t)}catch(e){return x.debug("Error processing history message:",e),null}}).filter(t=>null!==t);u.current.onHistoryLoaded(e)}else t.messages.forEach(t=>{try{u.current.onMessage(y(t))}catch(e){x.debug("Error processing history message:",e)}});u.current.onEvent&&u.current.onEvent("history_loaded",t)}),t.on("bot_typing",t=>u.current.onTyping(t)),t.on("auth_success",t=>{u.current.onLogin&&u.current.onLogin(t),t.theme&&u.current.onThemeUpdate&&u.current.onThemeUpdate(t.theme)}),p.current=t},[e,i]),k=a(()=>{p.current&&(p.current.disconnect(),p.current=null,f(!1))},[]),z=c(v);z.current=v,n(()=>(z.current(),()=>{p.current&&(p.current.disconnect(),p.current=null)}),[]);const E=c([]),S=c([]),O=a(()=>`msg_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,[]),I=a(()=>{if(p.current?.connected)for(;E.current.length>0;){const t=E.current.shift();p.current.emit("user_message",t)}},[]);n(()=>{m&&I()},[m,I]),n(()=>{if(!m)return;const t=setInterval(()=>{const t=Date.now();S.current=S.current.filter(e=>t<e.nextRetryAt||(e.attempts>=e.maxAttempts?(u.current.onEvent?.("message_failed",{id:e.id,payload:e.payload}),x.error("Message failed after max retries:",e.id),!1):!p.current?.connected||(p.current.emit("user_message",e.payload,t=>{t?.success&&u.current.onEvent?.("message_sent",{id:e.id})}),e.attempts++,e.nextRetryAt=t+1e3*Math.pow(2,e.attempts),e.attempts<e.maxAttempts)))},500);return()=>clearInterval(t)},[m]);const $=a((t,e="text")=>{const r=O(),o={...b.current,currentUrl:"undefined"!=typeof window?window.location.href:void 0,sentAt:/* @__PURE__ */(new Date).toISOString(),deviceId:w.current},n={id:r,content:t.trim(),type:e,metadata:o};return p.current?.connected?(p.current.emit("user_message",n,t=>{!1!==t?.success&&t?u.current.onEvent?.("message_sent",{id:r}):(S.current.push({id:r,payload:n,attempts:0,maxAttempts:3,nextRetryAt:Date.now()+1e3}),u.current.onEvent?.("message_retry_queued",{id:r}))}),r):(E.current.push(n),u.current.onEvent?.("queued_message",{id:r,payload:n}),r)},[O]),C=o(()=>_(t=>{p.current?.emit("typing",t)},250),[]);return{isConnected:m,isConnecting:h,sendMessage:$,sendTyping:C,getSocket:a(()=>p.current,[]),requestHistory:a(()=>{p.current?.emit("request_history")},[]),reconnect:v,disconnect:k}}({apiKey:i,apiBaseUrl:d,agentId:l,pageContext:o(()=>j?{...u||{},seo:{...j||{}}}:u,[u,j]),userContext:m,onMessage:a(t=>{const e=Date.now(),r=O.current>0?e-O.current:void 0;O.current=e,A.addMessage(t),$.trackMessageReceived(t.type,r),T.isOpen||"bot"!==t.sender||(S(t=>t+1),C.notifyWithSound(t))},[A,T.isOpen,$,C]),onConnected:a((t,e)=>{A.setConnected(!0),A.setSessionId(t),$.trackConnectionStatus(!0),e&&k&&k(e),e&&y&&y("backend_config",e)},[A,y,k,$]),onDisconnected:a(()=>{A.setConnected(!1),$.trackConnectionStatus(!1)},[A,$]),onTyping:a(t=>A.setTyping(t),[A]),onError:a(t=>{A.setError(t),$.trackError(t)},[A,$]),onLogin:f,onNavigate:b,onEvent:y,onThemeUpdate:k,onHistoryLoaded:a(t=>{const e=new Set(T.messages.map(t=>t.id)),r=t.filter(t=>!e.has(t.id));r.length>0&&(0===T.messages.length?A.setMessages(t):r.forEach(t=>A.addMessage(t)))},[T.messages,A])}),D=a(()=>{x.debug("ChatWidget handleToggle called, current isOpen:",T.isOpen),T.isOpen?(A.closeWindow(),$.trackClose(),v?.(!1),x.debug("ChatWidget Closing window")):(A.openWindow(),S(0),$.trackOpen(),v?.(!0),x.debug("ChatWidget Opening window"))},[T.isOpen,A,v,$]),Z=a(t=>{if(!N.isAllowed()){const t=N.getTimeUntilReset(),e=Math.ceil(t/1e3);return void A.setError(I("rate_limit_exceeded")+` Espera ${e}s.`)}const e={id:`temp-${Date.now()}-${Math.random()}`,type:"text",sender:"user",timestamp:/* @__PURE__ */new Date,content:t};A.addMessage(e),$.trackMessageSent("text"),P.sendMessage(t,"text")},[A,P,N,$,I]),F=a(async(t,e)=>{let r;r="audio"===e?{id:`temp-${Date.now()}-${Math.random()}`,type:"audio",sender:"user",timestamp:/* @__PURE__ */new Date,content:URL.createObjectURL(t)}:"image"===e?{id:`temp-${Date.now()}-${Math.random()}`,type:"image",sender:"user",timestamp:/* @__PURE__ */new Date,imageUrl:URL.createObjectURL(t)}:{id:`temp-${Date.now()}-${Math.random()}`,type:"text",sender:"user",timestamp:/* @__PURE__ */new Date,content:`📎 ${t.name}`},A.addMessage(r);const o=await Ja(t);P.sendMessage(o,e)},[A,P]),U=a(t=>{const e={id:`temp-${Date.now()}-${Math.random()}`,type:"location",sender:"user",timestamp:/* @__PURE__ */new Date,latitude:t.latitude,longitude:t.longitude,name:"Mi ubicación"};A.addMessage(e),P.sendMessage(JSON.stringify(t),"location")},[A,P]);n(()=>{const t=()=>{T.isOpen||A.openWindow()},e=()=>{T.isOpen&&A.closeWindow()},r=()=>{T.isOpen?A.closeWindow():A.openWindow()},o=t=>{t.detail?.message&&Z(t.detail.message)};return window.addEventListener("botuyo-chat:open",t),window.addEventListener("botuyo-chat:close",e),window.addEventListener("botuyo-chat:toggle",r),window.addEventListener("botuyo-chat:send-message",o),()=>{window.removeEventListener("botuyo-chat:open",t),window.removeEventListener("botuyo-chat:close",e),window.removeEventListener("botuyo-chat:toggle",r),window.removeEventListener("botuyo-chat:send-message",o)}},[T.isOpen,A,Z]),n(()=>(Fa(Z),()=>Fa(null)),[Z]);const R=a(()=>{A.clearMessages(),x.info("Chat history cleared")},[A]);n(()=>(Ua(R),()=>Ua(null)),[R]);const L=o(()=>{if(T.isTyping)return"thinking";const t=[...T.messages].reverse().find(t=>"bot"===t.sender&&"text"===t.type);return"text"===t?.type&&t.emotion?t.emotion:"default"},[T.isTyping,T.messages]);return{state:T,actions:A,unreadCount:E,currentBotEmotion:L,isConnected:P.isConnected,getSocket:P.getSocket,handleToggle:D,handleSendText:Z,handleSendAttachment:F,handleSendLocation:U}}function qa(t){const{apiKey:e,apiBaseUrl:i="https://api.botuyo.com",agentId:s,pageContext:d,includeSEOMetadata:l=!1,theme:u,mediaConfig:p,userContext:h,onLogin:m,onNavigate:f,onEvent:w,onStateChange:y}=t,v=c(null),x=O(),_=function(t){const[e,o]=r(!1);return n(()=>{let e=null;const r=()=>{if(!t.current)return;const e=!!t.current.parentElement?.closest(".dark"),r=!!document.getElementById("botuyo-chat-widget-root")?.classList.contains("dark"),n=document.getElementById("botuyo-chat-widget-root"),a=!!n?.parentElement?.closest(".dark"),i=document.documentElement.classList.contains("dark"),s=document.body.classList.contains("dark"),c="dark"===document.documentElement.getAttribute("data-theme"),d="dark"===document.body.getAttribute("data-theme"),l=!!t.current.parentElement?.closest('[data-theme="dark"]'),u=window.matchMedia("(prefers-color-scheme: dark)").matches,p=e||r||a||i||s||c||d||l||u;t.current&&(p?t.current.classList.add("dark"):t.current.classList.remove("dark")),o(p)};r();const n=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>r();n.addEventListener("change",a);const i=new MutationObserver(()=>{r()}),s=document.getElementById("botuyo-chat-widget-root");s&&(i.observe(s,{attributes:!0,attributeFilter:["class"]}),s.parentElement&&(i.observe(s.parentElement,{attributes:!0,attributeFilter:["class"],childList:!0}),e=s.parentElement)),i.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"]}),i.observe(document.body,{attributes:!0,attributeFilter:["class","data-theme"]});let c=t.current?.parentElement;for(;c;)i.observe(c,{attributes:!0,attributeFilter:["class","data-theme"]}),c=c.parentElement;const d=setInterval(()=>{const t=document.getElementById("botuyo-chat-widget-root");t&&t.parentElement!==e&&(e&&t.parentElement&&(i.observe(t.parentElement,{attributes:!0,attributeFilter:["class"],childList:!0}),e=t.parentElement),r())},100);return()=>{i.disconnect(),n.removeEventListener("change",a),clearInterval(d)}},[t]),e}(v),[z,E]=r(),{mergedTheme:S,mergedStyles:C,getContainerStyle:M}=function(t,e){const a=function(){const[t,e]=r(()=>"undefined"!=typeof window&&(window.matchMedia("(prefers-contrast: high)").matches||window.matchMedia("(prefers-contrast: more)").matches));return n(()=>{const t=window.matchMedia("(prefers-contrast: high)"),r=window.matchMedia("(prefers-contrast: more)"),o=t=>{e(t.matches)};return t.addEventListener("change",o),r.addEventListener("change",o),()=>{t.removeEventListener("change",o),r.removeEventListener("change",o)}},[]),t}(),i=o(()=>{const r=k(t,e);return a?{...r,cssVariables:{...r.cssVariables,primary:"0 0% 0%",primaryForeground:"0 0% 100%",background:"0 0% 100%",foreground:"0 0% 0%",card:"0 0% 100%",cardForeground:"0 0% 0%",muted:"0 0% 96%",mutedForeground:"0 0% 0%",border:"0 0% 0%"}}:r},[t,e,a]),s=o(()=>({radius:{...Z,...t?.bubbleStyles?.radius},bot:{...F,...t?.bubbleStyles?.bot},user:{...U,...t?.bubbleStyles?.user},launcher:{...t?.bubbleStyles?.launcher},mapCard:{...t?.bubbleStyles?.mapCard}}),[t?.bubbleStyles]);return{mergedTheme:i,mergedStyles:s,getContainerStyle:(t,e,r)=>({"--chat-primary":`hsl(${i.cssVariables.primary})`,zIndex:t?2147483647:9999,position:"fixed",top:e&&t?0:"auto",left:e&&t?0:"bottom-left"===r?"24px":"auto",right:e&&t?0:"bottom-right"!==r&&r?"auto":"24px",bottom:e&&t?0:"24px",width:e&&t?"100%":"auto",height:e&&t?"100%":"auto"})}}(u,z);n(()=>{S.isHidden&&console.warn('[BotUyo] ⚠️ El agente (o Flow) de IA asociado a esta API Key se encuentra pausado o en estado "boceto" (draft). El widget no se mostrará hasta que lo publiques dentro de la plataforma BotUyo.')},[S.isHidden]);const{state:A,actions:j,unreadCount:R,currentBotEmotion:L,isConnected:B,handleToggle:W,handleSendText:J,handleSendAttachment:V,handleSendLocation:q,getSocket:H}=Va({apiKey:e,apiBaseUrl:i,agentId:s,pageContext:d,includeSEOMetadata:l,theme:u,userContext:h,onLogin:m,onNavigate:f,onEvent:w,onStateChange:y,onThemeUpdate:E}),G=a(t=>{j.addMessage({id:`voice-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,type:"text",sender:t.sender,timestamp:t.timestamp||/* @__PURE__ */new Date,content:t.content})},[j]),K=o(()=>{const t={...p||{}},e=z;return null!=e?.voiceEnabled&&(t.enableVoice=e.voiceEnabled),t},[p,z]),Y=a(t=>{t.stopPropagation()},[]),X=M(A.isOpen,x,u?.position),Q=o(()=>{const t={"--background":"0 0% 100%","--foreground":"240 10% 3.9%","--card":"0 0% 100%","--card-foreground":"240 10% 3.9%","--primary":"160 84% 39%","--primary-foreground":"0 0% 100%","--muted":"240 4.8% 95.9%","--muted-foreground":"240 3.8% 46.1%","--border":"240 5.9% 90%","--destructive":"0 84.2% 60.2%","--radius":"0.5rem","--window-border-radius":"24px","--launcher-border-radius":"50%","--window-height":"700px","--window-bottom":"24px","--spacing-1":"0.25rem","--spacing-2":"0.5rem","--spacing-3":"0.75rem","--spacing-4":"1rem","--spacing-5":"0.75rem","--spacing-6":"1.5rem","--spacing-7":"1.75rem","--spacing-8":"2rem"};if(!S.cssVariables)return t;let e={...S.cssVariables};if(_){const t=z?.darkCssVariables||{},r=u?.darkCssVariables||{};e={...e,...I,...t,...r}}const r={...t};return e.background&&(r["--background"]=e.background),e.foreground&&(r["--foreground"]=e.foreground),e.card&&(r["--card"]=e.card),e.cardForeground&&(r["--card-foreground"]=e.cardForeground),e.primary&&(r["--primary"]=e.primary),e.primaryForeground&&(r["--primary-foreground"]=e.primaryForeground),e.muted&&(r["--muted"]=e.muted),e.mutedForeground&&(r["--muted-foreground"]=e.mutedForeground),e.border&&(r["--border"]=e.border),e.destructive&&(r["--destructive"]=e.destructive),e.radius&&(r["--radius"]=e.radius),e.windowBorderRadius&&(r["--window-border-radius"]=e.windowBorderRadius),e.launcherBorderRadius&&(r["--launcher-border-radius"]=e.launcherBorderRadius),e.windowHeight&&(r["--window-height"]=e.windowHeight),e.windowBottom&&(r["--window-bottom"]=e.windowBottom),e.spacing1&&(r["--spacing-1"]=e.spacing1),e.spacing2&&(r["--spacing-2"]=e.spacing2),e.spacing3&&(r["--spacing-3"]=e.spacing3),e.spacing4&&(r["--spacing-4"]=e.spacing4),e.spacing5&&(r["--spacing-5"]=e.spacing5),e.spacing6&&(r["--spacing-6"]=e.spacing6),e.spacing7&&(r["--spacing-7"]=e.spacing7),e.spacing8&&(r["--spacing-8"]=e.spacing8),r},[S.cssVariables,_,z,u?.darkCssVariables]);return S.isHidden?null:z?/* @__PURE__ */N("div",{ref:v,id:"botuyo-chat-widget",className:b("botuyo-chat-widget flex flex-col",!x&&("bottom-left"===u?.position?"items-start":"items-end")),style:{...X,...Q,pointerEvents:"auto",backgroundColor:"transparent"},"data-animations-disabled":!1===u?.animations?.enabled?"true":void 0,"data-effects-glassmorphism":!1===u?.effects?.glassmorphism?"false":void 0,"data-effects-shadows":!1===u?.effects?.softShadows?"false":void 0,children:[
|
|
33
33
|
/* @__PURE__ */T("div",{className:b("transition-all duration-400 ease-[cubic-bezier(0.34,1.56,0.64,1)]",x?"bottom-left"===u?.position?"origin-bottom-left":"origin-bottom-right":"origin-bottom",A.isOpen?"opacity-100 scale-100 h-full w-full translate-y-0 pointer-events-auto":"opacity-0 scale-[0.85] pointer-events-none translate-y-8 h-0 w-0"),style:{pointerEvents:A.isOpen?"auto":"none"},onMouseDown:Y,onTouchStart:Y,children:/* @__PURE__ */T(D,{children:/* @__PURE__ */T($,{isOpen:A.isOpen,isConnected:B,isTyping:A.isTyping,messages:A.messages,onClose:()=>j.closeWindow(),onSendMessage:J,onSendAttachment:V,onSendLocation:q,botName:S.botName,logoUrl:S.logoUrl,welcomeMessage:S.welcomeMessage,inputPlaceholder:u?.inputPlaceholder||z?.inputPlaceholder,position:u?.position,bubbleStyles:C,avatars:u?.avatars||z?.avatars||z?.avatarAnimations||{},mediaConfig:K,theme:S,avatar3dUrl:u?.avatar3dUrl,getSocket:H,onAddVoiceMessage:G})})}),
|
|
34
|
-
/* @__PURE__ */T("div",{className:b(A.isOpen?"hidden":"block",!x&&"mt-4"),style:{pointerEvents:"auto"},onMouseDown:Y,onTouchStart:Y,children:/* @__PURE__ */T(P,{isOpen:A.isOpen,onClick:W,unreadCount:
|
|
34
|
+
/* @__PURE__ */T("div",{className:b(A.isOpen?"hidden":"block",!x&&"mt-4"),style:{pointerEvents:"auto"},onMouseDown:Y,onTouchStart:Y,children:/* @__PURE__ */T(P,{isOpen:A.isOpen,onClick:W,unreadCount:R,position:u?.position||"bottom-right",primaryColor:g(S),logoUrl:S.logoUrl,starterPrompt:u?.starterPrompt||z?.starterPrompt,avatars:u?.avatars||z?.avatars||z?.avatarAnimations||{},emotion:L,styles:C,promptPersistence:u?.promptPersistence,avatarScale:u?.avatarScale??z?.avatarScale,showPromptAvatar:u?.showPromptAvatar??z?.showPromptAvatar})})]}):null}function Ha(t){/* @__PURE__ */
|
|
35
35
|
return T(E,{defaultLocale:t.theme?.defaultLocale,children:/* @__PURE__ */T(S,{animations:t.theme?.animations,effects:t.theme?.effects,children:/* @__PURE__ */T(qa,{...t})})})}const Ga=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,ChatWidget:Ha,ChatWidgetInner:qa},Symbol.toStringTag,{value:"Module"})),Ka="https://api.botuyo.com";class Ya extends i{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,e){console.error("[BotUyoChat] Widget error:",t,e)}render(){return this.state.hasError?null:this.props.children}}const Xa={"--background":"240 10% 3.9%","--foreground":"0 0% 98%","--card":"240 10% 3.9%","--card-foreground":"0 0% 98%","--primary":"160 84% 39%","--primary-foreground":"0 0% 100%","--muted":"240 3.7% 15.9%","--muted-foreground":"240 5% 64.9%","--border":"240 3.7% 15.9%"},Qa=u(()=>Promise.resolve().then(()=>Ga).then(t=>({default:t.ChatWidget})));class ti{root=null;container=null;shadowRoot=null;mountPoint=null;darkModeObserver=null;darkModeMediaQuery=null;config=null;init(t){return this.config={...t,apiBaseUrl:t.apiBaseUrl||Ka},this.render(),this.setupDarkModeDetection(),this}render(){if(!this.config)return void console.error("[BotUyoChat] No configuration provided");if(!this.container){this.container=document.createElement("div"),this.container.id="botuyo-chat-widget-root",document.body.appendChild(this.container),this.shadowRoot=this.container.attachShadow({mode:"open"});const t=document.createElement("style");t.textContent=j.replace(/:root/g,":host"),this.shadowRoot.appendChild(t),this.mountPoint=document.createElement("div"),this.mountPoint.id="botuyo-chat-widget-root",this.shadowRoot.appendChild(this.mountPoint)}if(this.config.theme?.cssVariables&&this.mountPoint){const t=this.config.theme.cssVariables;[["--background",t.background],["--foreground",t.foreground],["--card",t.card],["--card-foreground",t.cardForeground],["--primary",t.primary],["--primary-foreground",t.primaryForeground],["--muted",t.muted],["--muted-foreground",t.mutedForeground],["--border",t.border],["--destructive",t.destructive],["--radius",t.radius],["--window-border-radius",t.windowBorderRadius],["--launcher-border-radius",t.launcherBorderRadius],["--window-height",t.windowHeight],["--window-bottom",t.windowBottom],["--spacing-1",t.spacing1],["--spacing-2",t.spacing2],["--spacing-3",t.spacing3],["--spacing-4",t.spacing4],["--spacing-5",t.spacing5],["--spacing-6",t.spacing6],["--spacing-7",t.spacing7],["--spacing-8",t.spacing8]].forEach(([t,e])=>{void 0!==e&&this.mountPoint.style.setProperty(t,e)})}this.mountPoint&&!this.config.theme?.cssVariables&&(!function(){const t=document.documentElement.getAttribute("data-theme");return"dark"===t||"light"!==t&&window.matchMedia("(prefers-color-scheme: dark)").matches}()?Object.keys(Xa).forEach(t=>{this.mountPoint.style.removeProperty(t)}):Object.entries(Xa).forEach(([t,e])=>{this.mountPoint.style.setProperty(t,e)})),!this.root&&this.mountPoint&&(this.root=t(this.mountPoint));const r={apiKey:this.config.apiKey,apiBaseUrl:this.config.apiBaseUrl||Ka,agentId:this.config.agentId,theme:{botName:"Asistente Virtual",position:"bottom-right",welcomeMessage:"¡Hola! 👋 ¿En qué puedo ayudarte?",inputPlaceholder:"Escribe tu mensaje...",cssVariables:{primary:"160 84% 39%",windowBorderRadius:"24px",launcherBorderRadius:"50%"},...this.config.theme},userContext:this.config.userContext,pageContext:this.config.pageContext,includeSEOMetadata:this.config.includeSEOMetadata??!1,mediaConfig:this.config.mediaConfig,onNavigate:this.config.onNavigate,onLogin:this.config.onLogin,onEvent:this.config.onEvent,onStateChange:this.config.onStateChange},o=e.createElement(p,{fallback:e.createElement("div",{style:{position:"fixed",bottom:"24px",right:"24px",width:"60px",height:"60px",borderRadius:"50%",backgroundColor:"#10b981",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",cursor:"wait"}},e.createElement("div",{style:{width:"24px",height:"24px",border:"3px solid rgba(255, 255, 255, 0.3)",borderTopColor:"#fff",borderRadius:"50%",animation:"spin 1s linear infinite"}}))},e.createElement(Qa,r));this.root.render(e.createElement(Ya,null,e.createElement(E,{defaultLocale:this.config.theme?.defaultLocale,children:o}))),console.log("[BotUyoChat] Widget initialized",r)}update(t){this.config?(this.config={...this.config,...t,theme:{...this.config.theme,...t.theme}},this.render()):console.error("[BotUyoChat] Widget not initialized")}destroy(){this.darkModeObserver&&(this.darkModeObserver.disconnect(),this.darkModeObserver=null),this.darkModeMediaQuery&&(this.darkModeMediaQuery.removeEventListener("change",this.handleDarkModeChange),this.darkModeMediaQuery=null),this.root&&(this.root.unmount(),this.root=null),this.container&&this.container.parentNode&&(this.container.parentNode.removeChild(this.container),this.container=null,this.shadowRoot=null,this.mountPoint=null),this.config=null,console.log("[BotUyoChat] Widget destroyed")}setupDarkModeDetection(){this.config?.theme?.cssVariables||(this.handleDarkModeChange=()=>this.render(),this.darkModeObserver=new MutationObserver(this.handleDarkModeChange),this.darkModeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),this.darkModeMediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.darkModeMediaQuery.addEventListener("change",this.handleDarkModeChange))}handleDarkModeChange=()=>{};open(){window.dispatchEvent(new CustomEvent("botuyo-chat:open"))}close(){window.dispatchEvent(new CustomEvent("botuyo-chat:close"))}sendMessage(t){window.dispatchEvent(new CustomEvent("botuyo-chat:send-message",{detail:{message:t}}))}getState(){return null}}const ei=new ti;window.BotUyoChat=ei;export{ti as BotUyoChatWidget,Ha as ChatWidget,Ba as ChatWidgetProvider,Ha as ChatWidgetUnstyled,E as LanguageProvider,ei as default,Wa as useChatWidget,C as useLanguage};
|
|
36
36
|
//# sourceMappingURL=botuyo-chat.es.js.map
|