From 9da2a057f2682bf4826b7ae81c7fac799ae8ef5a Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Sun, 23 Aug 2026 20:14:35 -0500 Subject: [PATCH] feat(umind): el canal correo puede acotarse a ciertos remitentes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "Responder a: todos los que escriban / solo a estos remitentes" — direcciones completas o dominios, separados por coma. Un dominio (@miempresa.com) habilita a toda esa empresa; lo que no pasa el filtro se marca leído y no se contesta: decisión tomada, no correo pendiente que se relee en cada revisión. El match de dominio es contra el dominio entero, nunca por sufijo: "empresa.com" no habilita a alguien de "malaempresa.com" ni de un subdominio. Ese es el clásico filtro que parece cerrado y no lo está, y acá decide a quién le habla el agente en nombre del negocio — hay un test por cada agujero. El filtro y el intervalo también se pueden cambiar por el update del canal sin recrearlo, porque recrearlo pide la contraseña de la casilla de nuevo. De paso quedó verificado que el módulo de soporte sigue intacto tras la unificación del SMTP: los catorce tests de soporte (auto-respuesta, parseo IMAP, clasificador, resúmenes) pasan en verde. Co-Authored-By: Claude Opus 5 --- orchestrator/src/views/agente/TabCanales.vue | 30 ++++++++++++- pkg/models/umind_canal.go | 5 +++ pkg/services/umind_canal_correo_service.go | 46 ++++++++++++++++++++ pkg/services/umind_canal_correo_test.go | 32 ++++++++++++++ public/orchestrator/assets/index-B4CrdUeB.js | 27 ++++++++++++ public/orchestrator/assets/index-CPU0iTo1.js | 26 ----------- public/orchestrator/index.html | 2 +- rest/controllers/umind_admin_controller.go | 14 ++++++ 8 files changed, 154 insertions(+), 28 deletions(-) create mode 100644 public/orchestrator/assets/index-B4CrdUeB.js delete mode 100644 public/orchestrator/assets/index-CPU0iTo1.js diff --git a/orchestrator/src/views/agente/TabCanales.vue b/orchestrator/src/views/agente/TabCanales.vue index 64798cb..0c307dc 100644 --- a/orchestrator/src/views/agente/TabCanales.vue +++ b/orchestrator/src/views/agente/TabCanales.vue @@ -38,7 +38,7 @@ function canalVacio() { return { tipo: 'telegram', bot_token: '', phone_number_id: '', access_token: '', app_secret: '', verify_token: '', usuario: '', password: '', imap_host: '', smtp_host: '', imap_encriptado: 'ssl', smtp_encriptado: 'starttls', - intervalo_minutos: 5, + intervalo_minutos: 5, responder_a: 'todos', filtro_remitentes: '', usar_whisper_audio: false, usar_ocr_imagenes: false, usar_archivos_docs: false, } } @@ -76,6 +76,7 @@ async function guardarCanal() { await api.post(apiUmind('/umind/canales'), { agente_id: props.agenteId, tipo: canalForm.value.tipo, credenciales, activo: true, intervalo_minutos: Number(canalForm.value.intervalo_minutos) || 5, + filtro_remitentes: canalForm.value.responder_a === 'algunos' ? canalForm.value.filtro_remitentes : '', usar_whisper_audio: canalForm.value.usar_whisper_audio, usar_ocr_imagenes: canalForm.value.usar_ocr_imagenes, usar_archivos_docs: canalForm.value.usar_archivos_docs, }) @@ -180,6 +181,7 @@ async function eliminarCanal(c) {

Revisa la casilla cada {{ c.intervalo_minutos >= 60 ? '1 hora' : `${c.intervalo_minutos} minutos` }} + · {{ c.filtro_remitentes ? `responde solo a: ${c.filtro_remitentes}` : 'responde a todos' }}

Webhook: {{ c.webhook_url }} @@ -235,6 +237,32 @@ async function eliminarCanal(c) {

Un correo no es un chat: para la mayoría, 5 o 15 minutos sobra.

+
+ +
+ + +
+ +
Servidores (solo si la detección automática falla)
diff --git a/pkg/models/umind_canal.go b/pkg/models/umind_canal.go index 4c737c5..22b44cf 100644 --- a/pkg/models/umind_canal.go +++ b/pkg/models/umind_canal.go @@ -45,6 +45,11 @@ type UmindCanal struct { // memoria, por la misma razón que el aviso de tope: los despliegues borran // la RAM varias veces por día. UltimaRevision *time.Time `json:"ultima_revision" gorm:"column:ultima_revision"` + // FiltroRemitentes acota a quién le responde el canal correo: direcciones + // o dominios separados por coma. Vacío = responde a todos. Un correo que + // no pasa el filtro se marca leído y no se contesta — el agente decidió, + // no está pendiente. + FiltroRemitentes string `json:"filtro_remitentes" gorm:"column:filtro_remitentes;type:text"` } // MarcarRevisionCanal deja constancia de que la casilla se acaba de revisar. diff --git a/pkg/services/umind_canal_correo_service.go b/pkg/services/umind_canal_correo_service.go index ca1b6bb..f4d3490 100644 --- a/pkg/services/umind_canal_correo_service.go +++ b/pkg/services/umind_canal_correo_service.go @@ -102,6 +102,13 @@ func atenderCasilla(canal models.UmindCanal) { _ = MarcarLeido(c, correo.UID) continue } + // El filtro del canal: si el dueño lo acotó a ciertos remitentes, lo + // que no matchea se marca leído y no se contesta — decisión tomada, + // no correo pendiente. + if !RemitentePermitido(canal.FiltroRemitentes, remitente) { + _ = MarcarLeido(c, correo.UID) + continue + } // La sesión es el remitente: sus correos siguientes conservan el hilo, // igual que un chat de WhatsApp conserva el número. @@ -137,6 +144,45 @@ func atenderCasilla(canal models.UmindCanal) { } } +// RemitentePermitido decide si el canal le responde a este remitente. +// El filtro son direcciones o dominios separados por coma (o salto de línea): +// "juan@x.com, @empresa.com, otra.com". Vacío = todos. +// +// Un dominio matchea con o sin @ adelante, y siempre contra el dominio ENTERO: +// "empresa.com" no habilita a alguien de "malaempresa.com" — ese sufijo suelto +// sería un filtro que parece cerrado y no lo está. +func RemitentePermitido(filtro, email string) bool { + filtro = strings.TrimSpace(filtro) + if filtro == "" { + return true + } + email = strings.ToLower(strings.TrimSpace(email)) + partes := strings.SplitN(email, "@", 2) + if len(partes) != 2 || partes[1] == "" { + return false + } + dominio := partes[1] + + for _, entrada := range strings.FieldsFunc(filtro, func(r rune) bool { return r == ',' || r == '\n' || r == ';' }) { + e := strings.ToLower(strings.TrimSpace(entrada)) + if e == "" { + continue + } + if strings.Contains(e, "@") && !strings.HasPrefix(e, "@") { + // Dirección completa: match exacto. + if e == email { + return true + } + continue + } + // Dominio, con o sin @ adelante. + if strings.TrimPrefix(e, "@") == dominio { + return true + } + } + return false +} + func puertoDe(s string, def int) int { var n int if _, err := fmt.Sscanf(s, "%d", &n); err != nil || n == 0 { diff --git a/pkg/services/umind_canal_correo_test.go b/pkg/services/umind_canal_correo_test.go index 0f0a355..ba17606 100644 --- a/pkg/services/umind_canal_correo_test.go +++ b/pkg/services/umind_canal_correo_test.go @@ -76,3 +76,35 @@ func TestLeerBandejaIMAPNoTocaLaCasilla(t *testing.T) { t.Error("el SELECT de INBOX tiene que ser de solo lectura") } } + +// El filtro de remitentes es una decisión de a quién le habla el agente en +// nombre del negocio: un match de más responde a un desconocido, un match de +// menos ignora a un cliente. +func TestRemitentePermitido(t *testing.T) { + casos := []struct { + nombre string + filtro string + email string + permite bool + }{ + {"sin filtro responde a todos", "", "cualquiera@x.com", true}, + {"dirección exacta", "juan@cliente.com", "juan@cliente.com", true}, + {"dirección exacta, mayúsculas", "Juan@Cliente.com", "juan@cliente.com", true}, + {"otra dirección no pasa", "juan@cliente.com", "pedro@cliente.com", false}, + {"dominio con @", "@miempresa.com", "ana@miempresa.com", true}, + {"dominio sin @", "miempresa.com", "ana@miempresa.com", true}, + // El clásico agujero: "empresa.com" no puede habilitar sufijos. + {"sufijo parecido no pasa", "empresa.com", "ana@malaempresa.com", false}, + {"subdominio no pasa", "empresa.com", "ana@mail.empresa.com", false}, + {"lista mixta, segundo matchea", "juan@x.com, @cliente.com", "ana@cliente.com", true}, + {"lista mixta, ninguno", "juan@x.com, @cliente.com", "ana@otro.com", false}, + {"saltos de línea como separador", "a@x.com\nb@y.com", "b@y.com", true}, + {"remitente sin dominio no pasa", "@cliente.com", "cosa-rara", false}, + {"espacios alrededor", " juan@x.com , @y.com ", "juan@x.com", true}, + } + for _, c := range casos { + if got := RemitentePermitido(c.filtro, c.email); got != c.permite { + t.Errorf("%s: RemitentePermitido(%q, %q) = %v, quiero %v", c.nombre, c.filtro, c.email, got, c.permite) + } + } +} diff --git a/public/orchestrator/assets/index-B4CrdUeB.js b/public/orchestrator/assets/index-B4CrdUeB.js new file mode 100644 index 0000000..2df8186 --- /dev/null +++ b/public/orchestrator/assets/index-B4CrdUeB.js @@ -0,0 +1,27 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const i of r.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerPolicy&&(r.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?r.credentials="include":o.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(o){if(o.ep)return;o.ep=!0;const r=n(o);fetch(o.href,r)}})();/** +* @vue/shared v3.5.41 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function Ys(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const we={},tn=[],yt=()=>{},yr=()=>!1,os=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),rs=e=>e.startsWith("onUpdate:"),Ve=Object.assign,Zs=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Ql=Object.prototype.hasOwnProperty,he=(e,t)=>Ql.call(e,t),ee=Array.isArray,nn=e=>Vn(e)==="[object Map]",pn=e=>Vn(e)==="[object Set]",wo=e=>Vn(e)==="[object Date]",re=e=>typeof e=="function",$e=e=>typeof e=="string",it=e=>typeof e=="symbol",ge=e=>e!==null&&typeof e=="object",_r=e=>(ge(e)||re(e))&&re(e.then)&&re(e.catch),wr=Object.prototype.toString,Vn=e=>wr.call(e),Jl=e=>Vn(e).slice(8,-1),kr=e=>Vn(e)==="[object Object]",Xs=e=>$e(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,wn=Ys(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ls=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Yl=/-\w/g,Be=ls(e=>e.replace(Yl,t=>t.slice(1).toUpperCase())),Zl=/\B([A-Z])/g,Yt=ls(e=>e.replace(Zl,"-$1").toLowerCase()),is=ls(e=>e.charAt(0).toUpperCase()+e.slice(1)),_s=ls(e=>e?`on${is(e)}`:""),xt=(e,t)=>!Object.is(e,t),Wn=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},as=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let ko;const us=()=>ko||(ko=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Jt(e){if(ee(e)){const t={};for(let n=0;n{if(n){const s=n.split(ei);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function ue(e){let t="";if($e(e))t=e;else if(ee(e))for(let n=0;nFt(n,t))}const Ar=e=>!!(e&&e.__v_isRef===!0),E=e=>$e(e)?e:e==null?"":ee(e)||ge(e)&&(e.toString===wr||!re(e.toString))?Ar(e)?E(e.value):JSON.stringify(e,Sr,2):String(e),Sr=(e,t)=>Ar(t)?Sr(e,t.value):nn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],r)=>(n[ws(s,r)+" =>"]=o,n),{})}:pn(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ws(n))}:it(t)?ws(t):ge(t)&&!ee(t)&&!kr(t)?String(t):t,ws=(e,t="")=>{var n;return it(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/** +* @vue/reactivity v3.5.41 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Me;class li{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Me&&(Me.active?(this.parent=Me,this.index=(Me.scopes||(Me.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes){const s=this.scopes.slice();for(t=0,n=s.length;t0&&--this._on===0){if(Me===this)Me=this.prevScope;else{let t=Me;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n0)return;if($n){let t=$n;for($n=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;kn;){let t=kn;for(kn=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function Pr(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Tr(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),so(s),ai(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function Ns(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Or(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Or(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===En)||(e.globalVersion=En,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ns(e))))return;e.flags|=2;const t=e.dep,n=ke,s=ot;ke=e,ot=!0;try{Pr(e);const o=e.fn(e._value);(t.version===0||xt(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{ke=n,ot=s,Tr(e),e.flags&=-3}}function so(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let r=n.computed.deps;r;r=r.nextDep)so(r,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function ai(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let ot=!0;const Dr=[];function Ot(){Dr.push(ot),ot=!1}function Dt(){const e=Dr.pop();ot=e===void 0?!0:e}function $o(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ke;ke=void 0;try{t()}finally{ke=n}}}let En=0;class ui{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class oo{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!ke||!ot||ke===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ke)n=this.activeLink=new ui(ke,this),ke.deps?(n.prevDep=ke.depsTail,ke.depsTail.nextDep=n,ke.depsTail=n):ke.deps=ke.depsTail=n,Mr(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=ke.depsTail,n.nextDep=void 0,ke.depsTail.nextDep=n,ke.depsTail=n,ke.deps===n&&(ke.deps=s)}return n}trigger(t){this.version++,En++,this.notify(t)}notify(t){to();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{no()}}}function Mr(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)Mr(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Vs=new WeakMap,zt=Symbol(""),js=Symbol(""),In=Symbol("");function je(e,t,n){if(ot&&ke){let s=Vs.get(e);s||Vs.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new oo),o.map=s,o.key=n),o.track()}}function Et(e,t,n,s,o,r){const i=Vs.get(e);if(!i){En++;return}const a=u=>{u&&u.trigger()};if(to(),t==="clear")i.forEach(a);else{const u=ee(e),d=u&&Xs(n);if(u&&n==="length"){const c=Number(s);i.forEach((m,p)=>{(p==="length"||p===In||!it(p)&&p>=c)&&a(m)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),d&&a(i.get(In)),t){case"add":u?d&&a(i.get("length")):(a(i.get(zt)),nn(e)&&a(i.get(js)));break;case"delete":u||(a(i.get(zt)),nn(e)&&a(i.get(js)));break;case"set":nn(e)&&a(i.get(zt));break}}no()}function Zt(e){const t=ve(e);return t===e?t:(je(t,"iterate",In),tt(e)?t:t.map(at))}function cs(e){return je(e=ve(e),"iterate",In),e}function gt(e,t){return Mt(e)?an(Qt(e)?at(t):t):at(t)}const ci={__proto__:null,[Symbol.iterator](){return $s(this,Symbol.iterator,e=>gt(this,e))},concat(...e){return Zt(this).concat(...e.map(t=>ee(t)?Zt(t):t))},entries(){return $s(this,"entries",e=>(e[1]=gt(this,e[1]),e))},every(e,t){return $t(this,"every",e,t,void 0,arguments)},filter(e,t){return $t(this,"filter",e,t,n=>n.map(s=>gt(this,s)),arguments)},find(e,t){return $t(this,"find",e,t,n=>gt(this,n),arguments)},findIndex(e,t){return $t(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return $t(this,"findLast",e,t,n=>gt(this,n),arguments)},findLastIndex(e,t){return $t(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return $t(this,"forEach",e,t,void 0,arguments)},includes(...e){return Cs(this,"includes",e)},indexOf(...e){return Cs(this,"indexOf",e)},join(e){return Zt(this).join(e)},lastIndexOf(...e){return Cs(this,"lastIndexOf",e)},map(e,t){return $t(this,"map",e,t,void 0,arguments)},pop(){return hn(this,"pop")},push(...e){return hn(this,"push",e)},reduce(e,...t){return Co(this,"reduce",e,t)},reduceRight(e,...t){return Co(this,"reduceRight",e,t)},shift(){return hn(this,"shift")},some(e,t){return $t(this,"some",e,t,void 0,arguments)},splice(...e){return hn(this,"splice",e)},toReversed(){return Zt(this).toReversed()},toSorted(e){return Zt(this).toSorted(e)},toSpliced(...e){return Zt(this).toSpliced(...e)},unshift(...e){return hn(this,"unshift",e)},values(){return $s(this,"values",e=>gt(this,e))}};function $s(e,t,n){const s=cs(e),o=s[t]();return s!==e&&!tt(e)&&(o._next=o.next,o.next=()=>{const r=o._next();return r.done||(r.value=n(r.value)),r}),o}const di=Array.prototype;function $t(e,t,n,s,o,r){const i=cs(e),a=i!==e&&!tt(e),u=i[t];if(u!==di[t]){const m=u.apply(e,r);return a?at(m):m}let d=n;i!==e&&(a?d=function(m,p){return n.call(this,gt(e,m),p,e)}:n.length>2&&(d=function(m,p){return n.call(this,m,p,e)}));const c=u.call(i,d,s);return a&&o?o(c):c}function Co(e,t,n,s){const o=cs(e),r=o!==e&&!tt(e);let i=n,a=!1;o!==e&&(r?(a=s.length===0,i=function(d,c,m){return a&&(a=!1,d=gt(e,d)),n.call(this,d,gt(e,c),m,e)}):n.length>3&&(i=function(d,c,m){return n.call(this,d,c,m,e)}));const u=o[t](i,...s);return a?gt(e,u):u}function Cs(e,t,n){const s=ve(e);je(s,"iterate",In);const o=s[t](...n);return(o===-1||o===!1)&&io(n[0])?(n[0]=ve(n[0]),s[t](...n)):o}function hn(e,t,n=[]){Ot(),to();const s=ve(e)[t].apply(e,n);return no(),Dt(),s}const fi=Ys("__proto__,__v_isRef,__isVue"),Nr=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(it));function pi(e){it(e)||(e=String(e));const t=ve(this);return je(t,"has",e),t.hasOwnProperty(e)}class Vr{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,r=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return r;if(n==="__v_raw")return s===(o?r?ki:Fr:r?Lr:Ur).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const i=ee(t);if(!o){let u;if(i&&(u=ci[n]))return u;if(n==="hasOwnProperty")return pi}const a=Reflect.get(t,n,Le(t)?t:s);if((it(n)?Nr.has(n):fi(n))||(o||je(t,"get",n),r))return a;if(Le(a)){const u=i&&Xs(n)?a:a.value;return o&&ge(u)?Ls(u):u}return ge(a)?o?Ls(a):ds(a):a}}class jr extends Vr{constructor(t=!1){super(!1,t)}set(t,n,s,o){let r=t[n];const i=ee(t)&&Xs(n);if(!this._isShallow){const d=Mt(r);if(!tt(s)&&!Mt(s)&&(r=ve(r),s=ve(s)),!i&&Le(r)&&!Le(s))return d||(r.value=s),!0}const a=i?Number(n)e,Ln=e=>Reflect.getPrototypeOf(e);function bi(e,t,n){return function(...s){const o=this.__v_raw,r=ve(o),i=nn(r),a=e==="entries"||e===Symbol.iterator&&i,u=e==="keys"&&i,d=o[e](...s),c=n?Us:t?an:at;return!t&&je(r,"iterate",u?js:zt),Ve(Object.create(d),{next(){const{value:m,done:p}=d.next();return p?{value:m,done:p}:{value:a?[c(m[0]),c(m[1])]:c(m),done:p}}})}}function Fn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function xi(e,t){const n={get(o){const r=this.__v_raw,i=ve(r),a=ve(o);e||(xt(o,a)&&je(i,"get",o),je(i,"get",a));const{has:u}=Ln(i),d=t?Us:e?an:at;if(u.call(i,o))return d(r.get(o));if(u.call(i,a))return d(r.get(a));r!==i&&r.get(o)},get size(){const o=this.__v_raw;return!e&&je(ve(o),"iterate",zt),o.size},has(o){const r=this.__v_raw,i=ve(r),a=ve(o);return e||(xt(o,a)&&je(i,"has",o),je(i,"has",a)),o===a?r.has(o):r.has(o)||r.has(a)},forEach(o,r){const i=this,a=i.__v_raw,u=ve(a),d=t?Us:e?an:at;return!e&&je(u,"iterate",zt),a.forEach((c,m)=>o.call(r,d(c),d(m),i))}};return Ve(n,e?{add:Fn("add"),set:Fn("set"),delete:Fn("delete"),clear:Fn("clear")}:{add(o){const r=ve(this),i=Ln(r),a=ve(o),u=!t&&!tt(o)&&!Mt(o)?a:o;return i.has.call(r,u)||xt(o,u)&&i.has.call(r,o)||xt(a,u)&&i.has.call(r,a)||(r.add(u),Et(r,"add",u,u)),this},set(o,r){!t&&!tt(r)&&!Mt(r)&&(r=ve(r));const i=ve(this),{has:a,get:u}=Ln(i);let d=a.call(i,o);d||(o=ve(o),d=a.call(i,o));const c=u.call(i,o);return i.set(o,r),d?xt(r,c)&&Et(i,"set",o,r):Et(i,"add",o,r),this},delete(o){const r=ve(this),{has:i,get:a}=Ln(r);let u=i.call(r,o);u||(o=ve(o),u=i.call(r,o)),a&&a.call(r,o);const d=r.delete(o);return u&&Et(r,"delete",o,void 0),d},clear(){const o=ve(this),r=o.size!==0,i=o.clear();return r&&Et(o,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=bi(o,e,t)}),n}function ro(e,t){const n=xi(e,t);return(s,o,r)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(he(n,o)&&o in s?n:s,o,r)}const yi={get:ro(!1,!1)},_i={get:ro(!1,!0)},wi={get:ro(!0,!1)};const Ur=new WeakMap,Lr=new WeakMap,Fr=new WeakMap,ki=new WeakMap;function $i(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ds(e){return Mt(e)?e:lo(e,!1,vi,yi,Ur)}function qr(e){return lo(e,!1,gi,_i,Lr)}function Ls(e){return lo(e,!0,hi,wi,Fr)}function lo(e,t,n,s,o){if(!ge(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const r=o.get(e);if(r)return r;const i=$i(Jl(e));if(i===0)return e;const a=new Proxy(e,i===2?s:n);return o.set(e,a),a}function Qt(e){return Mt(e)?Qt(e.__v_raw):!!(e&&e.__v_isReactive)}function Mt(e){return!!(e&&e.__v_isReadonly)}function tt(e){return!!(e&&e.__v_isShallow)}function io(e){return e?!!e.__v_raw:!1}function ve(e){const t=e&&e.__v_raw;return t?ve(t):e}function Ci(e){return!he(e,"__v_skip")&&Object.isExtensible(e)&&$r(e,"__v_skip",!0),e}const at=e=>ge(e)?ds(e):e,an=e=>ge(e)?Ls(e):e;function Le(e){return e?e.__v_isRef===!0:!1}function L(e){return Hr(e,!1)}function Ai(e){return Hr(e,!0)}function Hr(e,t){return Le(e)?e:new Si(e,t)}class Si{constructor(t,n){this.dep=new oo,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:ve(t),this._value=n?t:at(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||tt(t)||Mt(t);t=s?t:ve(t),xt(t,n)&&(this._rawValue=t,this._value=s?t:at(t),this.dep.trigger())}}function Pe(e){return Le(e)?e.value:e}const Ei={get:(e,t,n)=>t==="__v_raw"?e:Pe(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return Le(o)&&!Le(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function Br(e){return Qt(e)?e:new Proxy(e,Ei)}class Ii{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new oo(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=En-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&ke!==this)return Rr(this,!0),!0}get value(){const t=this.dep.track();return Or(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Ri(e,t,n=!1){let s,o;return re(e)?s=e:(s=e.get,o=e.set),new Ii(s,o,n)}const qn={},Jn=new WeakMap;let Wt;function Pi(e,t=!1,n=Wt){if(n){let s=Jn.get(n);s||Jn.set(n,s=[]),s.push(e)}}function Ti(e,t,n=we){const{immediate:s,deep:o,once:r,scheduler:i,augmentJob:a,call:u}=n,d=b=>o?b:tt(b)||o===!1||o===0?It(b,1):It(b);let c,m,p,x,S=!1,C=!1;if(Le(e)?(m=()=>e.value,S=tt(e)):Qt(e)?(m=()=>d(e),S=!0):ee(e)?(C=!0,S=e.some(b=>Qt(b)||tt(b)),m=()=>e.map(b=>{if(Le(b))return b.value;if(Qt(b))return d(b);if(re(b))return u?u(b,2):b()})):re(e)?t?m=u?()=>u(e,2):e:m=()=>{if(p){Ot();try{p()}finally{Dt()}}const b=Wt;Wt=c;try{return u?u(e,3,[x]):e(x)}finally{Wt=b}}:m=yt,t&&o){const b=m,_=o===!0?1/0:o;m=()=>It(b(),_)}const R=ii(),O=()=>{c.stop(),R&&R.active&&Zs(R.effects,c)};if(r&&t){const b=t;t=(..._)=>{const j=b(..._);return O(),j}}let $=C?new Array(e.length).fill(qn):qn;const g=b=>{if(!(!(c.flags&1)||!c.dirty&&!b))if(t){const _=c.run();if(b||o||S||(C?_.some((j,H)=>xt(j,$[H])):xt(_,$))){p&&p();const j=Wt;Wt=c;try{const H=[_,$===qn?void 0:C&&$[0]===qn?[]:$,x];$=_,u?u(t,3,H):t(...H)}finally{Wt=j}}}else c.run()};return a&&a(g),c=new Er(m),c.scheduler=i?()=>i(g,!1):g,x=b=>Pi(b,!1,c),p=c.onStop=()=>{const b=Jn.get(c);if(b){if(u)u(b,4);else for(const _ of b)_();Jn.delete(c)}},t?s?g(!0):$=c.run():i?i(g.bind(null,!0),!0):c.run(),O.pause=c.pause.bind(c),O.resume=c.resume.bind(c),O.stop=O,O}function It(e,t=1/0,n){if(t<=0||!ge(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Le(e))It(e.value,t,n);else if(ee(e))for(let s=0;s{It(s,t,n)});else if(kr(e)){for(const s in e)It(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&It(e[s],t,n)}return e}/** +* @vue/runtime-core v3.5.41 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function jn(e,t,n,s){try{return s?e(...s):e()}catch(o){fs(o,t,n)}}function ut(e,t,n,s){if(re(e)){const o=jn(e,t,n,s);return o&&_r(o)&&o.catch(r=>{fs(r,t,n)}),o}if(ee(e)){const o=[];for(let r=0;r>>1,o=He[s],r=Rn(o);r=Rn(n)?He.push(e):He.splice(Di(t),0,e),e.flags|=1,Wr()}}function Wr(){Yn||(Yn=Gr.then(zr))}function Mi(e){if(!ee(e))Ut&&e.id===-1?Ut.splice(Xt+1,0,e):e.flags&1||(sn.push(e),e.flags|=1);else for(let t=0;tRn(n)-Rn(s));if(sn.length=0,Ut){for(let n=0;ne.id==null?e.flags&2?-1:1/0:e.id;function zr(e){try{for(ht=0;ht{s._d&&ts(-1);const r=Zn(t),i=Tt.length;let a;try{a=e(...o)}finally{for(let u=Tt.length;u>i;u--)vo();Zn(r),s._d&&ts(1)}return a};return s._n=!0,s._c=!0,s._d=!0,s}function z(e,t){if(Ne===null)return e;const n=bs(Ne),s=e.dirs||(e.dirs=[]);for(let o=0;o1)return n&&re(t)?t.call(s&&s.proxy):t}}const Ni=Symbol.for("v-scx"),Vi=()=>rt(Ni);function Pt(e,t,n){return Jr(e,t,n)}function Jr(e,t,n=we){const{immediate:s,deep:o,flush:r,once:i}=n,a=Ve({},n),u=t&&s||!t&&r!=="post";let d;if(Dn){if(r==="sync"){const x=Vi();d=x.__watcherHandles||(x.__watcherHandles=[])}else if(!u){const x=()=>{};return x.stop=yt,x.resume=yt,x.pause=yt,x}}const c=Ue;a.call=(x,S,C)=>ut(x,c,S,C);let m=!1;r==="post"?a.scheduler=x=>{ze(x,c&&c.suspense)}:r!=="sync"&&(m=!0,a.scheduler=(x,S)=>{S?x():uo(x)}),a.augmentJob=x=>{t&&(x.flags|=4),m&&(x.flags|=2,c&&(x.id=c.uid,x.i=c))};const p=Ti(e,t,a);return Dn&&(d?d.push(p):u&&p()),p}function ji(e,t,n){const s=this.proxy,o=$e(e)?e.includes(".")?Yr(s,e):()=>s[e]:e.bind(s,s);let r;re(t)?r=t:(r=t.handler,n=t);const i=Un(this),a=Jr(o,r.bind(s),n);return i(),a}function Yr(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;oe.__isTeleport,As=Symbol("_leaveCb");function Li(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==wt){t=n;break}}return t}function Zr(e){if(!fo(e))return ps(e.type)&&e.children?Li(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&re(n.default))return n.default()}}function co(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;co(ps(n.type)&&Zr(n)||n,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Xr(e,t){return re(e)?Ve({name:e.name},t,{setup:e}):e}function el(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function So(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Xn=new WeakMap;function Cn(e,t,n,s,o=!1){if(ee(e)){e.forEach((C,R)=>Cn(C,t&&(ee(t)?t[R]:t),n,s,o));return}if(on(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Cn(e,t,n,s.component.subTree);return}const r=s.shapeFlag&4?bs(s.component):s.el,i=o?null:r,{i:a,r:u}=e,d=t&&t.r,c=a.refs===we?a.refs={}:a.refs,m=a.setupState,p=ve(m),x=m===we?yr:C=>So(c,C)?!1:he(p,C),S=(C,R)=>!(R&&So(c,R));if(d!=null&&d!==u){if(Eo(t),$e(d))c[d]=null,x(d)&&(m[d]=null);else if(Le(d)){const C=t;S(d,C.k)&&(d.value=null),C.k&&(c[C.k]=null)}}if(re(u))jn(u,a,12,[i,c]);else{const C=$e(u),R=Le(u);if(C||R){const O=()=>{if(e.f){const $=C?x(u)?m[u]:c[u]:S()||!e.k?u.value:c[e.k];if(o)ee($)&&Zs($,r);else if(ee($))$.includes(r)||$.push(r);else if(C)c[u]=[r],x(u)&&(m[u]=c[u]);else{const g=[r];S(u,e.k)&&(u.value=g),e.k&&(c[e.k]=g)}}else C?(c[u]=i,x(u)&&(m[u]=i)):R&&(S(u,e.k)&&(u.value=i),e.k&&(c[e.k]=i))};if(i){const $=()=>{O(),Xn.delete(e)};$.id=-1,Xn.set(e,$),ze($,n)}else Eo(e),O()}}}function Eo(e){const t=Xn.get(e);t&&(t.flags|=8,Xn.delete(e))}us().requestIdleCallback;us().cancelIdleCallback;const on=e=>!!e.type.__asyncLoader,fo=e=>e.type.__isKeepAlive;function Fi(e,t){tl(e,"a",t)}function qi(e,t){tl(e,"da",t)}function tl(e,t,n=Ue){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(ms(t,s,n),n){let o=n.parent;for(;o&&o.parent;)fo(o.parent.vnode)&&Hi(s,t,n,o),o=o.parent}}function Hi(e,t,n,s){const o=ms(t,e,s,!0);sl(()=>{Zs(s[t],o)},n)}function ms(e,t,n=Ue,s=!1){if(n){const o=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...i)=>{Ot();const a=Un(n),u=ut(t,n,e,i);return a(),Dt(),u});return s?o.unshift(r):o.push(r),r}}const Nt=e=>(t,n=Ue)=>{(!Dn||e==="sp")&&ms(e,(...s)=>t(...s),n)},Bi=Nt("bm"),vs=Nt("m"),Gi=Nt("bu"),Wi=Nt("u"),nl=Nt("bum"),sl=Nt("um"),Ki=Nt("sp"),zi=Nt("rtg"),Qi=Nt("rtc");function Ji(e,t=Ue){ms("ec",e,t)}const ol="components";function mn(e,t){return ll(ol,e,!0,t)||e}const rl=Symbol.for("v-ndc");function Yi(e){return $e(e)?ll(ol,e,!1)||e:e||rl}function ll(e,t,n=!0,s=!1){const o=Ne||Ue;if(o){const r=o.type;{const a=Ma(r,!1);if(a&&(a===t||a===Be(t)||a===is(Be(t))))return r}const i=Io(o[e]||r[e],t)||Io(o.appContext[e],t);return!i&&s?r:i}}function Io(e,t){return e&&(e[t]||e[Be(t)]||e[is(Be(t))])}function xe(e,t,n,s){let o;const r=n,i=ee(e);if(i||$e(e)){const a=i&&Qt(e);let u=!1,d=!1;a&&(u=!tt(e),d=Mt(e),e=cs(e)),o=new Array(e.length);for(let c=0,m=e.length;ct(a,u,void 0,r));else{const a=Object.keys(e);o=new Array(a.length);for(let u=0,d=a.length;u0;return h(),_e(X,null,[oe("slot",d,s)],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1);const a=Tt.length;h();let u;try{const d=i&&il(i(n)),c=n.key||r||d&&d.key;u=_e(X,{key:(c&&!it(c)?c:`_${t}`)+(!d&&s?"_fb":"")},d||(s?s():[]),d&&e._===1?64:-2)}catch(d){for(let c=Tt.length;c>a;c--)vo();throw d}finally{i&&i._c&&(i._d=!0)}return u.scopeId&&(u.slotScopeIds=[u.scopeId+"-s"]),u}function il(e){return e.some(t=>Tn(t)?!(t.type===wt||t.type===X&&!il(t.children)):!0)?e:null}const Fs=e=>e?Il(e)?bs(e):Fs(e.parent):null,An=Ve(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Fs(e.parent),$root:e=>Fs(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ul(e),$forceUpdate:e=>e.f||(e.f=()=>{uo(e.update)}),$nextTick:e=>e.n||(e.n=ao.bind(e.proxy)),$watch:e=>ji.bind(e)}),Ss=(e,t)=>e!==we&&!e.__isScriptSetup&&he(e,t),Xi={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:r,accessCache:i,type:a,appContext:u}=e;if(t[0]!=="$"){const p=i[t];if(p!==void 0)switch(p){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return r[t]}else{if(Ss(s,t))return i[t]=1,s[t];if(o!==we&&he(o,t))return i[t]=2,o[t];if(he(r,t))return i[t]=3,r[t];if(n!==we&&he(n,t))return i[t]=4,n[t];qs&&(i[t]=0)}}const d=An[t];let c,m;if(d)return t==="$attrs"&&je(e.attrs,"get",""),d(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==we&&he(n,t))return i[t]=4,n[t];if(m=u.config.globalProperties,he(m,t))return m[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:r}=e;return Ss(o,t)?(o[t]=n,!0):s!==we&&he(s,t)?(s[t]=n,!0):he(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(r[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:r,type:i}},a){let u;return!!(n[a]||e!==we&&a[0]!=="$"&&he(e,a)||Ss(t,a)||he(r,a)||he(s,a)||he(An,a)||he(o.config.globalProperties,a)||(u=i.__cssModules)&&u[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:he(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Ro(e){return ee(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let qs=!0;function ea(e){const t=ul(e),n=e.proxy,s=e.ctx;qs=!1,t.beforeCreate&&Po(t.beforeCreate,e,"bc");const{data:o,computed:r,methods:i,watch:a,provide:u,inject:d,created:c,beforeMount:m,mounted:p,beforeUpdate:x,updated:S,activated:C,deactivated:R,beforeDestroy:O,beforeUnmount:$,destroyed:g,unmounted:b,render:_,renderTracked:j,renderTriggered:H,errorCaptured:q,serverPrefetch:fe,expose:Y,inheritAttrs:F,components:Se,directives:K,filters:Ge}=t;if(d&&ta(d,s,null),i)for(const pe in i){const de=i[pe];re(de)&&(s[pe]=de.bind(n))}if(o){const pe=o.call(n,n);ge(pe)&&(e.data=ds(pe))}if(qs=!0,r)for(const pe in r){const de=r[pe],nt=re(de)?de.bind(n,n):re(de.get)?de.get.bind(n,n):yt,We=!re(de)&&re(de.set)?de.set.bind(n):yt,et=le({get:nt,set:We});Object.defineProperty(s,pe,{enumerable:!0,configurable:!0,get:()=>et.value,set:Te=>et.value=Te})}if(a)for(const pe in a)al(a[pe],s,n,pe);if(u){const pe=re(u)?u.call(n):u;Reflect.ownKeys(pe).forEach(de=>{Kn(de,pe[de])})}c&&Po(c,e,"c");function Ee(pe,de){ee(de)?de.forEach(nt=>pe(nt.bind(n))):de&&pe(de.bind(n))}if(Ee(Bi,m),Ee(vs,p),Ee(Gi,x),Ee(Wi,S),Ee(Fi,C),Ee(qi,R),Ee(Ji,q),Ee(Qi,j),Ee(zi,H),Ee(nl,$),Ee(sl,b),Ee(Ki,fe),ee(Y))if(Y.length){const pe=e.exposed||(e.exposed={});Y.forEach(de=>{Object.defineProperty(pe,de,{get:()=>n[de],set:nt=>n[de]=nt,enumerable:!0})})}else e.exposed||(e.exposed={});_&&e.render===yt&&(e.render=_),F!=null&&(e.inheritAttrs=F),Se&&(e.components=Se),K&&(e.directives=K),fe&&el(e)}function ta(e,t,n=yt){ee(e)&&(e=Hs(e));for(const s in e){const o=e[s];let r;ge(o)?"default"in o?r=rt(o.from||s,o.default,!0):r=rt(o.from||s):r=rt(o),Le(r)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>r.value,set:i=>r.value=i}):t[s]=r}}function Po(e,t,n){ut(ee(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function al(e,t,n,s){let o=s.includes(".")?Yr(n,s):()=>n[s];if($e(e)){const r=t[e];re(r)&&Pt(o,r)}else if(re(e))Pt(o,e.bind(n));else if(ge(e))if(ee(e))e.forEach(r=>al(r,t,n,s));else{const r=re(e.handler)?e.handler.bind(n):t[e.handler];re(r)&&Pt(o,r,e)}}function ul(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:r,config:{optionMergeStrategies:i}}=e.appContext,a=r.get(t);let u;return a?u=a:!o.length&&!n&&!s?u=t:(u={},o.length&&o.forEach(d=>es(u,d,i,!0)),es(u,t,i)),ge(t)&&r.set(t,u),u}function es(e,t,n,s=!1){const{mixins:o,extends:r}=t;r&&es(e,r,n,!0),o&&o.forEach(i=>es(e,i,n,!0));for(const i in t)if(!(s&&i==="expose")){const a=na[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const na={data:To,props:Oo,emits:Oo,methods:xn,computed:xn,beforeCreate:Fe,created:Fe,beforeMount:Fe,mounted:Fe,beforeUpdate:Fe,updated:Fe,beforeDestroy:Fe,beforeUnmount:Fe,destroyed:Fe,unmounted:Fe,activated:Fe,deactivated:Fe,errorCaptured:Fe,serverPrefetch:Fe,components:xn,directives:xn,watch:oa,provide:To,inject:sa};function To(e,t){return t?e?function(){return Ve(re(e)?e.call(this,this):e,re(t)?t.call(this,this):t)}:t:e}function sa(e,t){return xn(Hs(e),Hs(t))}function Hs(e){if(ee(e)){const t={};for(let n=0;nt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Be(t)}Modifiers`]||e[`${Yt(t)}Modifiers`];function aa(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||we;let o=n;const r=t.startsWith("update:"),i=r&&ia(s,t.slice(7));i&&(i.trim&&(o=n.map(c=>$e(c)?c.trim():c)),i.number&&(o=n.map(as)));let a,u=s[a=_s(t)]||s[a=_s(Be(t))];!u&&r&&(u=s[a=_s(Yt(t))]),u&&ut(u,e,6,o);const d=s[a+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,ut(d,e,6,o)}}const ua=new WeakMap;function dl(e,t,n=!1){const s=n?ua:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const r=e.emits;let i={},a=!1;if(!re(e)){const u=d=>{const c=dl(d,t,!0);c&&(a=!0,Ve(i,c))};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}return!r&&!a?(ge(e)&&s.set(e,null),null):(ee(r)?r.forEach(u=>i[u]=null):Ve(i,r),ge(e)&&s.set(e,i),i)}function hs(e,t){return!e||!os(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),he(e,t[0].toLowerCase()+t.slice(1))||he(e,Yt(t))||he(e,t))}function Do(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[r],slots:i,attrs:a,emit:u,render:d,renderCache:c,props:m,data:p,setupState:x,ctx:S,inheritAttrs:C}=e,R=Zn(e);let O,$;try{if(n.shapeFlag&4){const b=o||s,_=b;O=bt(d.call(_,b,c,m,x,p,S)),$=a}else{const b=t;O=bt(b.length>1?b(m,{attrs:a,slots:i,emit:u}):b(m,null)),$=t.props?a:ca(a)}}catch(b){Tt.length=0,fs(b,e,1),O=oe(wt)}let g=O;if($&&C!==!1){const b=Object.keys($),{shapeFlag:_}=g;b.length&&_&7&&(r&&b.some(rs)&&($=da($,r)),g=un(g,$,!1,!0))}if(n.dirs&&(g=un(g,null,!1,!0),g.dirs=g.dirs?g.dirs.concat(n.dirs):n.dirs),n.transition){const b=ps(g.type)&&Zr(g)||g;co(b,n.transition)}return O=g,Zn(R),O}const ca=e=>{let t;for(const n in e)(n==="class"||n==="style"||os(n))&&((t||(t={}))[n]=e[n]);return t},da=(e,t)=>{const n={};for(const s in e)(!rs(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function fa(e,t,n){const{props:s,children:o,component:r}=e,{props:i,children:a,patchFlag:u}=t,d=r.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&u>=0){if(u&1024)return!0;if(u&16)return s?Mo(s,i,d):!!i;if(u&8){const c=t.dynamicProps;for(let m=0;mObject.create(pl),vl=e=>Object.getPrototypeOf(e)===pl;function ma(e,t,n,s=!1){const o={},r=ml();e.propsDefaults=Object.create(null),hl(e,t,o,r);for(const i in e.propsOptions[0])i in o||(o[i]=void 0);n?e.props=s?o:qr(o):e.type.props?e.props=o:e.props=r,e.attrs=r}function va(e,t,n,s){const{props:o,attrs:r,vnode:{patchFlag:i}}=e,a=ve(o),[u]=e.propsOptions;let d=!1;if((s||i>0)&&!(i&16)){if(i&8){const c=e.vnode.dynamicProps;for(let m=0;m{u=!0;const[p,x]=gl(m,t,!0);Ve(i,p),x&&a.push(...x)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!r&&!u)return ge(e)&&s.set(e,tn),tn;if(ee(r))for(let c=0;ce==="_"||e==="_ctx"||e==="$stable",mo=e=>ee(e)?e.map(bt):[bt(e)],ga=(e,t,n)=>{if(t._n)return t;const s=st((...o)=>mo(t(...o)),n);return s._c=!1,s},bl=(e,t,n)=>{const s=e._ctx;for(const o in e){if(po(o))continue;const r=e[o];if(re(r))t[o]=ga(o,r,s);else if(r!=null){const i=mo(r);t[o]=()=>i}}},xl=(e,t)=>{const n=mo(t);e.slots.default=()=>n},yl=(e,t,n)=>{for(const s in t)(n||!po(s))&&(e[s]=t[s])},ba=(e,t,n)=>{const s=e.slots=ml();if(e.vnode.shapeFlag&32){const o=t._;o?(yl(s,t,n),n&&$r(s,"_",o,!0)):bl(t,s)}else t&&xl(e,t)},xa=(e,t,n)=>{const{vnode:s,slots:o}=e;let r=!0,i=we;if(s.shapeFlag&32){const a=t._;a?n&&a===1?r=!1:yl(o,t,n):(r=!t.$stable,bl(t,o)),i=t}else t&&(xl(e,t),i={default:1});if(r)for(const a in o)!po(a)&&i[a]==null&&delete o[a]},ze=$a;function ya(e){return _a(e)}function _a(e,t){const n=us();n.__VUE__=!0;const{insert:s,remove:o,patchProp:r,createElement:i,createText:a,createComment:u,setText:d,setElementText:c,parentNode:m,nextSibling:p,setScopeId:x=yt,insertStaticContent:S}=e,C=(f,v,y,T=null,M=null,P=null,A=void 0,k=null,V=!!v.dynamicChildren)=>{if(f===v)return;f&&!gn(f,v)&&(T=D(f),Te(f,M,P,!0),f=null),v.patchFlag===-2&&(V=!1,v.dynamicChildren=null);const{type:N,ref:I,shapeFlag:U}=v;switch(N){case gs:R(f,v,y,T);break;case wt:O(f,v,y,T);break;case zn:f==null&&$(v,y,T,A);break;case X:Se(f,v,y,T,M,P,A,k,V);break;default:U&1?_(f,v,y,T,M,P,A,k,V):U&6?K(f,v,y,T,M,P,A,k,V):(U&64||U&128)&&N.process(f,v,y,T,M,P,A,k,V,J)}I!=null&&M?Cn(I,f&&f.ref,P,v||f,!v):I==null&&f&&f.ref!=null&&Cn(f.ref,null,P,f,!0)},R=(f,v,y,T)=>{if(f==null)s(v.el=a(v.children),y,T);else{const M=v.el=f.el;v.children!==f.children&&d(M,v.children)}},O=(f,v,y,T)=>{f==null?s(v.el=u(v.children||""),y,T):v.el=f.el},$=(f,v,y,T)=>{[f.el,f.anchor]=S(f.children,v,y,T,f.el,f.anchor)},g=({el:f,anchor:v},y,T)=>{let M;for(;f&&f!==v;)M=p(f),s(f,y,T),f=M;s(v,y,T)},b=({el:f,anchor:v})=>{let y;for(;f&&f!==v;)y=p(f),o(f),f=y;o(v)},_=(f,v,y,T,M,P,A,k,V)=>{if(v.type==="svg"?A="svg":v.type==="math"&&(A="mathml"),f==null)j(v,y,T,M,P,A,k,V);else{const N=f.el&&f.el._isVueCE?f.el:null;try{N&&N._beginPatch(),fe(f,v,M,P,A,k,V)}finally{N&&N._endPatch()}}},j=(f,v,y,T,M,P,A,k)=>{let V,N;const{props:I,shapeFlag:U,transition:Q,dirs:ne}=f;if(V=f.el=i(f.type,P,I&&I.is,I),U&8?c(V,f.children):U&16&&q(f.children,V,null,T,M,Es(f,P),A,k),ne&&Bt(f,null,T,"created"),H(V,f,f.scopeId,A,T),I){for(const ye in I)ye!=="value"&&!wn(ye)&&r(V,ye,null,I[ye],P,T);"value"in I&&r(V,"value",null,I.value,P),(N=I.onVnodeBeforeMount)&&vt(N,T,f)}ne&&Bt(f,null,T,"beforeMount");const ce=wa(M,Q);ce&&Q.beforeEnter(V),s(V,v,y),((N=I&&I.onVnodeMounted)||ce||ne)&&ze(()=>{try{N&&vt(N,T,f),ce&&Q.enter(V),ne&&Bt(f,null,T,"mounted")}finally{}},M)},H=(f,v,y,T,M)=>{if(y&&x(f,y),T)for(let P=0;P{for(let N=V;N{const k=v.el=f.el;let{patchFlag:V,dynamicChildren:N,dirs:I}=v;V|=f.patchFlag&16;const U=f.props||we,Q=v.props||we;let ne;if(y&&Gt(y,!1),(ne=Q.onVnodeBeforeUpdate)&&vt(ne,y,v,f),I&&Bt(v,f,y,"beforeUpdate"),y&&Gt(y,!0),N&&(!f.dynamicChildren||f.dynamicChildren.length!==N.length)&&(V=0,A=!1,N=null),(U.innerHTML&&Q.innerHTML==null||U.textContent&&Q.textContent==null)&&c(k,""),N?Y(f.dynamicChildren,N,k,y,T,Es(v,M),P):A||de(f,v,k,null,y,T,Es(v,M),P,!1),V>0){if(V&16)F(k,U,Q,y,M);else if(V&2&&U.class!==Q.class&&r(k,"class",null,Q.class,M),V&4&&r(k,"style",U.style,Q.style,M),V&8){const ce=v.dynamicProps;for(let ye=0;ye{ne&&vt(ne,y,v,f),I&&Bt(v,f,y,"updated")},T)},Y=(f,v,y,T,M,P,A)=>{for(let k=0;k{if(v!==y){if(v!==we)for(const P in v)!wn(P)&&!(P in y)&&r(f,P,v[P],null,M,T);for(const P in y){if(wn(P))continue;const A=y[P],k=v[P];A!==k&&P!=="value"&&r(f,P,k,A,M,T)}"value"in y&&r(f,"value",v.value,y.value,M)}},Se=(f,v,y,T,M,P,A,k,V)=>{const N=v.el=f?f.el:a(""),I=v.anchor=f?f.anchor:a("");let{patchFlag:U,dynamicChildren:Q,slotScopeIds:ne}=v;ne&&(k=k?k.concat(ne):ne),f==null?(s(N,y,T),s(I,y,T),q(v.children||[],y,I,M,P,A,k,V)):U>0&&U&64&&Q&&f.dynamicChildren&&f.dynamicChildren.length===Q.length?(Y(f.dynamicChildren,Q,y,M,P,A,k),(v.key!=null||M&&v===M.subTree)&&_l(f,v,!0)):de(f,v,y,I,M,P,A,k,V)},K=(f,v,y,T,M,P,A,k,V)=>{v.slotScopeIds=k,f==null?v.shapeFlag&512?M.ctx.activate(v,y,T,A,V):Ge(v,y,T,M,P,A,V):Vt(f,v,V)},Ge=(f,v,y,T,M,P,A)=>{const k=f.component=Ia(f,T,M);if(fo(f)&&(k.ctx.renderer=J),Pa(k,!1,A),k.asyncDep){if(M&&M.registerDep(k,Ee,A),!f.el){const V=k.subTree=oe(wt);O(null,V,v,y),f.placeholder=V.el}}else Ee(k,f,v,y,M,P,A)},Vt=(f,v,y)=>{const T=v.component=f.component;if(fa(f,v,y))if(T.asyncDep&&!T.asyncResolved){pe(T,v,y);return}else T.next=v,T.update();else v.el=f.el,T.vnode=v},Ee=(f,v,y,T,M,P,A)=>{const k=()=>{if(f.isMounted){let{next:U,bu:Q,u:ne,parent:ce,vnode:ye}=f;{const pt=wl(f);if(pt){U&&(U.el=ye.el,pe(f,U,A)),pt.asyncDep.then(()=>{ze(()=>{f.isUnmounted||N()},M)});return}}let be=U,Ie;Gt(f,!1),U?(U.el=ye.el,pe(f,U,A)):U=ye,Q&&Wn(Q),(Ie=U.props&&U.props.onVnodeBeforeUpdate)&&vt(Ie,ce,U,ye),Gt(f,!0);const De=Do(f),ft=f.subTree;f.subTree=De,C(ft,De,m(ft.el),D(ft),f,M,P),U.el=De.el,be===null&&pa(f,De.el),ne&&ze(ne,M),(Ie=U.props&&U.props.onVnodeUpdated)&&ze(()=>vt(Ie,ce,U,ye),M)}else{let U;const{el:Q,props:ne}=v,{bm:ce,m:ye,parent:be,root:Ie,type:De}=f,ft=on(v);Gt(f,!1),ce&&Wn(ce),!ft&&(U=ne&&ne.onVnodeBeforeMount)&&vt(U,be,v),Gt(f,!0);{Ie.ce&&Ie.ce._hasShadowRoot()&&Ie.ce._injectChildStyle(De,f.parent?f.parent.type:void 0);const pt=f.subTree=Do(f);C(null,pt,y,T,f,M,P),v.el=pt.el}if(ye&&ze(ye,M),!ft&&(U=ne&&ne.onVnodeMounted)){const pt=v;ze(()=>vt(U,be,pt),M)}(v.shapeFlag&256||be&&on(be.vnode)&&be.vnode.shapeFlag&256)&&f.a&&ze(f.a,M),f.isMounted=!0,v=y=T=null}};f.scope.on();const V=f.effect=new Er(k);f.scope.off();const N=f.update=V.run.bind(V),I=f.job=V.runIfDirty.bind(V);I.i=f,I.id=f.uid,V.scheduler=()=>uo(I),Gt(f,!0),N()},pe=(f,v,y)=>{v.component=f;const T=f.vnode.props;f.vnode=v,f.next=null,va(f,v.props,T,y),xa(f,v.children,y),Ot(),Ao(f),Dt()},de=(f,v,y,T,M,P,A,k,V=!1)=>{const N=f&&f.children,I=f?f.shapeFlag:0,U=v.children,{patchFlag:Q,shapeFlag:ne}=v;if(Q>0){if(Q&128){We(N,U,y,T,M,P,A,k,V);return}else if(Q&256){nt(N,U,y,T,M,P,A,k,V);return}}ne&8?(I&16&&Ke(N,M,P),U!==N&&c(y,U)):I&16?ne&16?We(N,U,y,T,M,P,A,k,V):Ke(N,M,P,!0):(I&8&&c(y,""),ne&16&&q(U,y,T,M,P,A,k,V))},nt=(f,v,y,T,M,P,A,k,V)=>{f=f||tn,v=v||tn;const N=f.length,I=v.length,U=Math.min(N,I);let Q;for(Q=0;QI?Ke(f,M,P,!0,!1,U):q(v,y,T,M,P,A,k,V,U)},We=(f,v,y,T,M,P,A,k,V)=>{let N=0;const I=v.length;let U=f.length-1,Q=I-1;for(;N<=U&&N<=Q;){const ne=f[N],ce=v[N]=V?St(v[N]):bt(v[N]);if(gn(ne,ce))C(ne,ce,y,null,M,P,A,k,V);else break;N++}for(;N<=U&&N<=Q;){const ne=f[U],ce=v[Q]=V?St(v[Q]):bt(v[Q]);if(gn(ne,ce))C(ne,ce,y,null,M,P,A,k,V);else break;U--,Q--}if(N>U){if(N<=Q){const ne=Q+1,ce=neQ)for(;N<=U;)Te(f[N],M,P,!0),N++;else{const ne=N,ce=N,ye=new Map;for(N=ce;N<=Q;N++){const Ye=v[N]=V?St(v[N]):bt(v[N]);Ye.key!=null&&ye.set(Ye.key,N)}let be,Ie=0;const De=Q-ce+1;let ft=!1,pt=0;const vn=new Array(De);for(N=0;N=De){Te(Ye,M,P,!0);continue}let mt;if(Ye.key!=null)mt=ye.get(Ye.key);else for(be=ce;be<=Q;be++)if(vn[be-ce]===0&&gn(Ye,v[be])){mt=be;break}mt===void 0?Te(Ye,M,P,!0):(vn[mt-ce]=N+1,mt>=pt?pt=mt:ft=!0,C(Ye,v[mt],y,null,M,P,A,k,V),Ie++)}const xo=ft?ka(vn):tn;for(be=xo.length-1,N=De-1;N>=0;N--){const Ye=ce+N,mt=v[Ye],yo=v[Ye+1],_o=Ye+1{const{el:P,type:A,transition:k,children:V,shapeFlag:N}=f;if(N&6){et(f.component.subTree,v,y,T);return}if(N&128){f.suspense.move(v,y,T);return}if(N&64){A.move(f,v,y,J);return}if(A===X){s(P,v,y);for(let U=0;Uk.enter(P),M));else{const{leave:U,delayLeave:Q,afterLeave:ne}=k,ce=()=>{f.ctx.isUnmounted?o(P):s(P,v,y)},ye=()=>{const be=P._isLeaving||!!P[As];P._isLeaving&&P[As](!0),k.persisted&&!be?ce():U(P,()=>{ce(),ne&&ne()})};Q?Q(P,ce,ye):ye()}else s(P,v,y)},Te=(f,v,y,T=!1,M=!1)=>{const{type:P,props:A,ref:k,children:V,dynamicChildren:N,shapeFlag:I,patchFlag:U,dirs:Q,cacheIndex:ne,memo:ce}=f;if(U===-2&&(M=!1),k!=null&&(Ot(),Cn(k,null,y,f,!0),Dt()),ne!=null&&(v.renderCache[ne]=void 0),I&256){v.ctx.deactivate(f);return}const ye=I&1&&Q,be=!on(f);let Ie;if(be&&(Ie=A&&A.onVnodeBeforeUnmount)&&vt(Ie,v,f),I&6)dt(f.component,y,T);else{if(I&128){f.suspense.unmount(y,T);return}ye&&Bt(f,null,v,"beforeUnmount"),I&64?f.type.remove(f,v,y,J,T):N&&!N.hasOnce&&(P!==X||U>0&&U&64)?Ke(N,v,y,!1,!0):(P===X&&U&384||!M&&I&16)&&Ke(V,v,y),T&&kt(f)}const De=ce!=null&&ne==null;(be&&(Ie=A&&A.onVnodeUnmounted)||ye||De)&&ze(()=>{Ie&&vt(Ie,v,f),ye&&Bt(f,null,v,"unmounted"),De&&(f.el=null)},y)},kt=f=>{const{type:v,el:y,anchor:T,transition:M}=f;if(v===X){Je(y,T);return}if(v===zn){b(f);return}const P=()=>{o(y),M&&!M.persisted&&M.afterLeave&&M.afterLeave()};if(f.shapeFlag&1&&M&&!M.persisted){const{leave:A,delayLeave:k}=M,V=()=>A(y,P);k?k(f.el,P,V):V()}else P()},Je=(f,v)=>{let y;for(;f!==v;)y=p(f),o(f),f=y;o(v)},dt=(f,v,y)=>{const{bum:T,scope:M,job:P,subTree:A,um:k,m:V,a:N}=f;Vo(V),Vo(N),T&&Wn(T),M.stop(),P&&(P.flags|=8,Te(A,f,v,y)),k&&ze(k,v),ze(()=>{f.isUnmounted=!0},v)},Ke=(f,v,y,T=!1,M=!1,P=0)=>{for(let A=P;A{if(f.shapeFlag&6)return D(f.component.subTree);if(f.shapeFlag&128)return f.suspense.next();const v=p(f.anchor||f.el),y=v&&v[Ui];return y?p(y):v};let W=!1;const G=(f,v,y)=>{let T;f==null?v._vnode&&(Te(v._vnode,null,null,!0),T=v._vnode.component):C(v._vnode||null,f,v,null,null,null,y),v._vnode=f,W||(W=!0,Ao(T),Kr(),W=!1)},J={p:C,um:Te,m:et,r:kt,mt:Ge,mc:q,pc:de,pbc:Y,n:D,o:e};return{render:G,hydrate:void 0,createApp:la(G)}}function Es({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Gt({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function wa(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function _l(e,t,n=!1){const s=e.children,o=t.children;if(ee(s)&&ee(o))for(let r=0;r>1,e[n[a]]0&&(t[s]=n[r-1]),n[r]=s)}}for(r=n.length,i=n[r-1];r-- >0;)n[r]=i,i=t[i];return n}function wl(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:wl(t)}function Vo(e){if(e)for(let t=0;te.__isSuspense;function $a(e,t){t&&t.pendingBranch?ee(e)?t.effects.push(...e):t.effects.push(e):Mi(e)}const X=Symbol.for("v-fgt"),gs=Symbol.for("v-txt"),wt=Symbol.for("v-cmt"),zn=Symbol.for("v-stc"),Tt=[];let Ze=null;function h(e=!1){Tt.push(Ze=e?null:[])}function vo(){Tt.pop(),Ze=Tt[Tt.length-1]||null}let Pn=1;function ts(e,t=!1){Pn+=e,e<0&&Ze&&t&&(Ze.hasOnce=!0)}function Cl(e){return e.dynamicChildren=Pn>0?Ze||tn:null,vo(),Pn>0&&Ze&&Ze.push(e),e}function w(e,t,n,s,o,r){return Cl(l(e,t,n,s,o,r,!0))}function _e(e,t,n,s,o){return Cl(oe(e,t,n,s,o,!0))}function Tn(e){return e?e.__v_isVNode===!0:!1}function gn(e,t){return e.type===t.type&&e.key===t.key}const Al=({key:e})=>e??null,Qn=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?$e(e)||Le(e)||re(e)?{i:Ne,r:e,k:t,f:!!n}:e:null);function l(e,t=null,n=null,s=0,o=null,r=e===X?0:1,i=!1,a=!1){const u={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Al(t),ref:t&&Qn(t),scopeId:Qr,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Ne};return a?(ns(u,n),r&128&&e.normalize(u)):n&&(u.shapeFlag|=$e(n)?8:16),Pn>0&&!i&&Ze&&(u.patchFlag>0||r&6)&&u.patchFlag!==32&&Ze.push(u),u}const oe=Ca;function Ca(e,t=null,n=null,s=0,o=null,r=!1){if((!e||e===rl)&&(e=wt),Tn(e)){const a=un(e,t,!0);return n&&ns(a,n),Pn>0&&!r&&Ze&&(a.shapeFlag&6?Ze[Ze.indexOf(e)]=a:Ze.push(a)),a.patchFlag=-2,a}if(Na(e)&&(e=e.__vccOpts),t){t=Aa(t);let{class:a,style:u}=t;a&&!$e(a)&&(t.class=ue(a)),ge(u)&&(io(u)&&!ee(u)&&(u=Ve({},u)),t.style=Jt(u))}const i=$e(e)?1:$l(e)?128:ps(e)?64:ge(e)?4:re(e)?2:0;return l(e,t,n,s,o,i,r,!0)}function Aa(e){return e?io(e)||vl(e)?Ve({},e):e:null}function un(e,t,n=!1,s=!1){const{props:o,ref:r,patchFlag:i,children:a,transition:u}=e,d=t?El(o||{},t):o,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&Al(d),ref:t&&t.ref?n&&r?ee(r)?r.concat(Qn(t)):[r,Qn(t)]:Qn(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==X?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:u,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&un(e.ssContent),ssFallback:e.ssFallback&&un(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return u&&s&&co(c,u.clone(c)),c}function Z(e=" ",t=0){return oe(gs,null,e,t)}function Sl(e,t){const n=oe(zn,null,e);return n.staticCount=t,n}function B(e="",t=!1){return t?(h(),_e(wt,null,e)):oe(wt,null,e)}function bt(e){return e==null||typeof e=="boolean"?oe(wt):ee(e)?oe(X,null,e.slice()):Tn(e)?St(e):oe(gs,null,String(e))}function St(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:un(e)}function ns(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(ee(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),ns(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!vl(t)?t._ctx=Ne:o===3&&Ne&&(Ne.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(re(t)){if(s&65){ns(e,{default:t});return}t={default:t,_ctx:Ne},n=32}else t=String(t),s&64?(n=16,t=[Z(t)]):n=8;e.children=t,e.shapeFlag|=n}function El(...e){const t={};for(let n=0;nUe||Ne;let ss,On;{const e=us(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),r=>{o.length>1?o.forEach(i=>i(r)):o[0](r)}};ss=t("__VUE_INSTANCE_SETTERS__",n=>Ue=n),On=t("__VUE_SSR_SETTERS__",n=>Dn=n)}const Un=e=>{const t=Ue;return ss(e),e.scope.on(),()=>{e.scope.off(),ss(t)}},jo=()=>{Ue&&Ue.scope.off(),ss(null)};function Il(e){return e.vnode.shapeFlag&4}let Dn=!1;function Pa(e,t=!1,n=!1){t&&On(t);const{props:s,children:o}=e.vnode,r=Il(e);ma(e,s,r,t),ba(e,o,n||t);const i=r?Ta(e,t):void 0;return t&&On(!1),i}function Ta(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Xi);const{setup:s}=n;if(s){Ot();const o=e.setupContext=s.length>1?Da(e):null,r=Un(e),i=jn(s,e,0,[e.props,o]),a=_r(i);if(Dt(),r(),(a||e.sp)&&!on(e)&&el(e),a){if(i.then(jo,jo),t)return i.then(u=>{On(!0);try{Uo(e,u,t)}finally{On(!1)}}).catch(u=>{fs(u,e,0)});e.asyncDep=i}else Uo(e,i)}else Rl(e)}function Uo(e,t,n){re(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ge(t)&&(e.setupState=Br(t)),Rl(e)}function Rl(e,t,n){const s=e.type;e.render||(e.render=s.render||yt);{const o=Un(e);Ot();try{ea(e)}finally{Dt(),o()}}}const Oa={get(e,t){return je(e,"get",""),e[t]}};function Da(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Oa),slots:e.slots,emit:e.emit,expose:t}}function bs(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Br(Ci(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in An)return An[n](e)},has(t,n){return n in t||n in An}})):e.proxy}function Ma(e,t=!0){return re(e)?e.displayName||e.name:e.name||t&&e.__name}function Na(e){return re(e)&&"__vccOpts"in e}const le=(e,t)=>Ri(e,t,Dn);function Pl(e,t,n){try{ts(-1);const s=arguments.length;return s===2?ge(t)&&!ee(t)?Tn(t)?oe(e,null,[t]):oe(e,t):oe(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Tn(n)&&(n=[n]),oe(e,t,n))}finally{ts(1)}}const Va="3.5.41";/** +* @vue/runtime-dom v3.5.41 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Gs;const Lo=typeof window<"u"&&window.trustedTypes;if(Lo)try{Gs=Lo.createPolicy("vue",{createHTML:e=>e})}catch{}const Tl=Gs?e=>Gs.createHTML(e):e=>e,ja="http://www.w3.org/2000/svg",Ua="http://www.w3.org/1998/Math/MathML",At=typeof document<"u"?document:null,Fo=At&&At.createElement("template"),La={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?At.createElementNS(ja,e):t==="mathml"?At.createElementNS(Ua,e):n?At.createElement(e,{is:n}):At.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>At.createTextNode(e),createComment:e=>At.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>At.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,r){const i=n?n.previousSibling:t.lastChild;if(o&&(o===r||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===r||!(o=o.nextSibling)););else{Fo.innerHTML=Tl(s==="svg"?`${e}`:s==="mathml"?`${e}`:e);const a=Fo.content;if(s==="svg"||s==="mathml"){const u=a.firstChild;for(;u.firstChild;)a.appendChild(u.firstChild);a.removeChild(u)}t.insertBefore(a,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Fa=Symbol("_vtc");function qa(e,t,n){const s=e[Fa];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const qo=Symbol("_vod"),Ha=Symbol("_vsh"),Ba=Symbol(""),Ga=/(?:^|;)\s*display\s*:/;function Wa(e,t,n){const s=e.style,o=$e(n);let r=!1;if(n&&!o){if(t)if($e(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&yn(s,a,"")}else for(const i in t)n[i]==null&&yn(s,i,"");for(const i in n){i==="display"&&(r=!0);const a=n[i];a!=null?za(e,i,!$e(t)&&t?t[i]:void 0,a)||yn(s,i,a):yn(s,i,"")}}else if(o){if(t!==n){const i=s[Ba];i&&(n+=";"+i),s.cssText=n,r=Ga.test(n)}}else t&&e.removeAttribute("style");qo in e&&(e[qo]=r?s.display:"",e[Ha]&&(s.display="none"))}const Ho=/\s*!important$/;function yn(e,t,n){if(ee(n))n.forEach(s=>yn(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=Ka(e,t);Ho.test(n)?e.setProperty(Yt(s),n.replace(Ho,""),"important"):e[s]=n}}const Bo=["Webkit","Moz","ms"],Is={};function Ka(e,t){const n=Is[t];if(n)return n;let s=Be(t);if(s!=="filter"&&s in e)return Is[t]=s;s=is(s);for(let o=0;oRs||(eu.then(()=>Rs=0),Rs=Date.now());function nu(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(ee(o)){const r=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{r.call(s),s._stopped=!0};const i=o.slice(),a=[s];for(let u=0;ue.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,su=(e,t,n,s,o,r)=>{const i=o==="svg";t==="class"?qa(e,s,i):t==="style"?Wa(e,n,s):os(t)?rs(t)||Ja(e,t,n,s,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):ou(e,t,s,i))?(Ko(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Wo(e,t,s,i,r,t!=="value")):e._isVueCE&&(ru(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!$e(s)))?Ko(e,Be(t),s,r,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Wo(e,t,s,i))};function ou(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Qo(t)&&re(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return Qo(t)&&$e(n)?!1:t in e}function ru(e,t){const n=e._def.props;if(!n)return!1;const s=Be(t);return Array.isArray(n)?n.some(o=>Be(o)===s):Object.keys(n).some(o=>Be(o)===s)}const qt=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ee(t)?n=>Wn(t,n):t};function lu(e){e.target.composing=!0}function Jo(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Xe=Symbol("_assign"),Hn=Symbol("_initialValue");function Ps(e,t,n){return t&&(e=e.trim()),n&&(e=as(e)),e}const ie={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e.parentNode&&(e.type==="text"?e[Hn]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[Hn]=e.defaultValue.replace(/\r\n?/g,` +`))),e[Xe]=qt(o);const r=s||o.props&&o.props.type==="number";Rt(e,t?"change":"input",i=>{i.target.composing||e[Xe](Ps(e.value,n,r))}),(n||r)&&Rt(e,"change",()=>{e.value=Ps(e.value,n,r)}),t||(Rt(e,"compositionstart",lu),Rt(e,"compositionend",Jo),Rt(e,"change",Jo))},mounted(e,{value:t,modifiers:{trim:n,number:s}}){const o=t??"",r=e[Hn];delete e[Hn],r!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==r?e[Xe](Ps(e.value,n,s)):e.value=o},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:r}},i){if(e[Xe]=qt(i),e.composing)return;const a=(r||e.type==="number")&&!/^0\d/.test(e.value)?as(e.value):e.value,u=t??"";if(a===u)return;const d=e.getRootNode();(d instanceof Document||d instanceof ShadowRoot)&&d.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===u)||(e.value=u)}},_t={deep:!0,created(e,t,n){e[Xe]=qt(n),Rt(e,"change",()=>{const s=e._modelValue,o=cn(e),r=e.checked,i=e[Xe];if(ee(s)){const a=eo(s,o),u=a!==-1;if(r&&!u)i(s.concat(o));else if(!r&&u){const d=[...s];d.splice(a,1),i(d)}}else if(pn(s)){const a=new Set(s);r?a.add(o):a.delete(o),i(a)}else i(Ol(e,r))})},mounted:Yo,beforeUpdate(e,t,n){e[Xe]=qt(n),Yo(e,t,n)}};function Yo(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(ee(t))o=eo(t,s.props.value)>-1;else if(pn(t))o=t.has(s.props.value);else{if(t===n)return;o=Ft(t,Ol(e,!0))}e.checked!==o&&(e.checked=o)}const Ws={created(e,{value:t},n){e.checked=Ft(t,n.props.value),e[Xe]=qt(n),Rt(e,"change",()=>{e[Xe](cn(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[Xe]=qt(s),t!==n&&(e.checked=Ft(t,s.props.value))}},Ht={deep:!0,created(e,{value:t,modifiers:{number:n}},s){e._modelValue=t,Rt(e,"change",()=>{const o=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?as(cn(r)):cn(r));e[Xe](e.multiple?pn(e._modelValue)?new Set(o):o:o[0]),e._assigning=!0,ao(()=>{e._assigning=!1})}),e[Xe]=qt(s)},mounted(e,{value:t}){Zo(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Xe]=qt(n)},updated(e,{value:t}){e._assigning||Zo(e,t)}};function Zo(e,t){const n=e.multiple,s=ee(t);if(!(n&&!s&&!pn(t))){for(let o=0,r=e.options.length;oString(d)===String(a)):i.selected=eo(t,a)>-1}else i.selected=t.has(a);else if(Ft(cn(i),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function cn(e){return"_value"in e?e._value:e.value}function Ol(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const iu=["ctrl","shift","alt","meta"],au={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>iu.some(n=>e[`${n}Key`]&&!t.includes(n))},Ae=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...r)=>{for(let i=0;i{const t=cu().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=pu(s);if(!o)return;const r=t._component;!re(r)&&!r.render&&!r.template&&(r.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const i=n(o,!1,fu(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t});function fu(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function pu(e){return $e(e)?document.querySelector(e):e}const mu=["width","height"],Oe={__name:"UiIcono",props:{nombre:{type:String,required:!0},tam:{type:[Number,String],default:16}},setup(e){const t={luna:[["path",{d:"M20 14.5A8.5 8.5 0 0 1 9.5 4a8.5 8.5 0 1 0 10.5 10.5Z"}]],sol:[["circle",{cx:12,cy:12,r:4}],["path",{d:"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"}]],lapiz:[["path",{d:"M12 20h9"}],["path",{d:"M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"}]],cerrar:[["path",{d:"M18 6 6 18M6 6l12 12"}]],atras:[["path",{d:"M19 12H5M12 19l-7-7 7-7"}]],grafico:[["path",{d:"M3 3v18h18"}],["path",{d:"M7 15v3M12 10v8M17 6v12"}]],cerebro:[["path",{d:"M9.5 3A2.5 2.5 0 0 0 7 5.5v.2A2.7 2.7 0 0 0 5 8.3c0 .8.3 1.5.9 2A2.8 2.8 0 0 0 5 12.5c0 1 .5 1.9 1.3 2.4-.2.4-.3.8-.3 1.2A2.9 2.9 0 0 0 9 19a2.5 2.5 0 0 0 3 2V3.8A2.5 2.5 0 0 0 9.5 3Z"}],["path",{d:"M14.5 3A2.5 2.5 0 0 1 17 5.5v.2a2.7 2.7 0 0 1 2 2.6c0 .8-.3 1.5-.9 2A2.8 2.8 0 0 1 19 12.5c0 1-.5 1.9-1.3 2.4.2.4.3.8.3 1.2A2.9 2.9 0 0 1 15 19a2.5 2.5 0 0 1-3 2"}]],imagen:[["rect",{x:3,y:3,width:18,height:18,rx:2}],["circle",{cx:8.5,cy:8.5,r:1.5}],["path",{d:"m21 15-5-5L5 21"}]],microfono:[["rect",{x:9,y:2,width:6,height:12,rx:3}],["path",{d:"M5 10a7 7 0 0 0 14 0M12 17v5"}]],escribir:[["path",{d:"M3 21h18"}],["path",{d:"M5 17 17.5 4.5a2.1 2.1 0 0 1 3 3L8 20l-4 1Z"}]],archivo:[["path",{d:"M14 2H7a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7Z"}],["path",{d:"M14 2v5h5"}]],sitio:[["circle",{cx:12,cy:12,r:9}],["path",{d:"M3 12h18M12 3a15 15 0 0 1 0 18 15 15 0 0 1 0-18Z"}]],refrescar:[["path",{d:"M21 12a9 9 0 1 1-3-6.7"}],["path",{d:"M21 4v5h-5"}]],descargar:[["path",{d:"M12 3v12"}],["path",{d:"m7 11 5 5 5-5"}],["path",{d:"M4 21h16"}]],alerta:[["path",{d:"M12 9v4M12 17h.01"}],["path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z"}]],ok:[["path",{d:"M20 6 9 17l-5-5"}]],copiar:[["rect",{x:9,y:9,width:12,height:12,rx:2}],["path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}]],mensaje:[["path",{d:"M21 11.5a8.4 8.4 0 0 1-9 8.4 8.5 8.5 0 0 1-3.9-.9L3 21l1.9-5.1A8.4 8.4 0 0 1 4 11.5a8.5 8.5 0 0 1 8.5-8.5A8.4 8.4 0 0 1 21 11.5Z"}]],auto:[["path",{d:"M17 2.1 21 6l-4 3.9"}],["path",{d:"M3 11V9a4 4 0 0 1 4-4h14"}],["path",{d:"M7 21.9 3 18l4-3.9"}],["path",{d:"M21 13v2a4 4 0 0 1-4 4H3"}]]};return(n,s)=>(h(),w("svg",{width:e.tam,height:e.tam,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round",class:"inline-block shrink-0 align-[-0.15em]","aria-hidden":"true"},[(h(!0),w(X,null,xe(t[e.nombre]||[],(o,r)=>(h(),_e(Yi(o[0]),El({key:r},{ref_for:!0},o[1]),null,16))),128))],8,mu))}};/*! + * vue-router v4.6.4 + * (c) 2025 Eduardo San Martin Morote + * @license MIT + */const en=typeof document<"u";function Dl(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function vu(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Dl(e.default)}const me=Object.assign;function Ts(e,t){const n={};for(const s in t){const o=t[s];n[s]=ct(o)?o.map(e):e(o)}return n}const Sn=()=>{},ct=Array.isArray;function er(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}const Ml=/#/g,hu=/&/g,gu=/\//g,bu=/=/g,xu=/\?/g,Nl=/\+/g,yu=/%5B/g,_u=/%5D/g,Vl=/%5E/g,wu=/%60/g,jl=/%7B/g,ku=/%7C/g,Ul=/%7D/g,$u=/%20/g;function ho(e){return e==null?"":encodeURI(""+e).replace(ku,"|").replace(yu,"[").replace(_u,"]")}function Cu(e){return ho(e).replace(jl,"{").replace(Ul,"}").replace(Vl,"^")}function Ks(e){return ho(e).replace(Nl,"%2B").replace($u,"+").replace(Ml,"%23").replace(hu,"%26").replace(wu,"`").replace(jl,"{").replace(Ul,"}").replace(Vl,"^")}function Au(e){return Ks(e).replace(bu,"%3D")}function Su(e){return ho(e).replace(Ml,"%23").replace(xu,"%3F")}function Eu(e){return Su(e).replace(gu,"%2F")}function Mn(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Iu=/\/$/,Ru=e=>e.replace(Iu,"");function Os(e,t,n="/"){let s,o={},r="",i="";const a=t.indexOf("#");let u=t.indexOf("?");return u=a>=0&&u>a?-1:u,u>=0&&(s=t.slice(0,u),r=t.slice(u,a>0?a:t.length),o=e(r.slice(1))),a>=0&&(s=s||t.slice(0,a),i=t.slice(a,t.length)),s=Du(s??t,n),{fullPath:s+r+i,path:s,query:o,hash:Mn(i)}}function Pu(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function tr(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Tu(e,t,n){const s=t.matched.length-1,o=n.matched.length-1;return s>-1&&s===o&&dn(t.matched[s],n.matched[o])&&Ll(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function dn(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Ll(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Ou(e[n],t[n]))return!1;return!0}function Ou(e,t){return ct(e)?nr(e,t):ct(t)?nr(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function nr(e,t){return ct(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function Du(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),o=s[s.length-1];(o===".."||o===".")&&s.push("");let r=n.length-1,i,a;for(i=0;i1&&r--;else break;return n.slice(0,r).join("/")+"/"+s.slice(i).join("/")}const jt={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let zs=(function(e){return e.pop="pop",e.push="push",e})({}),Ds=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function Mu(e){if(!e)if(en){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Ru(e)}const Nu=/^[^#]+#/;function Vu(e,t){return e.replace(Nu,"#")+t}function ju(e,t){const n=document.documentElement.getBoundingClientRect(),s=e.getBoundingClientRect();return{behavior:t.behavior,left:s.left-n.left-(t.left||0),top:s.top-n.top-(t.top||0)}}const xs=()=>({left:window.scrollX,top:window.scrollY});function Uu(e){let t;if("el"in e){const n=e.el,s=typeof n=="string"&&n.startsWith("#"),o=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;t=ju(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function sr(e,t){return(history.state?history.state.position-t:-1)+e}const Qs=new Map;function Lu(e,t){Qs.set(e,t)}function Fu(e){const t=Qs.get(e);return Qs.delete(e),t}function qu(e){return typeof e=="string"||e&&typeof e=="object"}function Fl(e){return typeof e=="string"||typeof e=="symbol"}let Ce=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const ql=Symbol("");Ce.MATCHER_NOT_FOUND+"",Ce.NAVIGATION_GUARD_REDIRECT+"",Ce.NAVIGATION_ABORTED+"",Ce.NAVIGATION_CANCELLED+"",Ce.NAVIGATION_DUPLICATED+"";function fn(e,t){return me(new Error,{type:e,[ql]:!0},t)}function Ct(e,t){return e instanceof Error&&ql in e&&(t==null||!!(e.type&t))}const Hu=["params","query","hash"];function Bu(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of Hu)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function Gu(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let s=0;so&&Ks(o)):[s&&Ks(s)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+n,o!=null&&(t+="="+o))})}return t}function Wu(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=ct(s)?s.map(o=>o==null?null:""+o):s==null?s:""+s)}return t}const Ku=Symbol(""),rr=Symbol(""),ys=Symbol(""),go=Symbol(""),Js=Symbol("");function bn(){let e=[];function t(s){return e.push(s),()=>{const o=e.indexOf(s);o>-1&&e.splice(o,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Lt(e,t,n,s,o,r=i=>i()){const i=s&&(s.enterCallbacks[o]=s.enterCallbacks[o]||[]);return()=>new Promise((a,u)=>{const d=p=>{p===!1?u(fn(Ce.NAVIGATION_ABORTED,{from:n,to:t})):p instanceof Error?u(p):qu(p)?u(fn(Ce.NAVIGATION_GUARD_REDIRECT,{from:t,to:p})):(i&&s.enterCallbacks[o]===i&&typeof p=="function"&&i.push(p),a())},c=r(()=>e.call(s&&s.instances[o],t,n,d));let m=Promise.resolve(c);e.length<3&&(m=m.then(d)),m.catch(p=>u(p))})}function Ms(e,t,n,s,o=r=>r()){const r=[];for(const i of e)for(const a in i.components){let u=i.components[a];if(!(t!=="beforeRouteEnter"&&!i.instances[a]))if(Dl(u)){const d=(u.__vccOpts||u)[t];d&&r.push(Lt(d,n,s,i,a,o))}else{let d=u();r.push(()=>d.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const m=vu(c)?c.default:c;i.mods[a]=c,i.components[a]=m;const p=(m.__vccOpts||m)[t];return p&&Lt(p,n,s,i,a,o)()}))}}return r}function zu(e,t){const n=[],s=[],o=[],r=Math.max(t.matched.length,e.matched.length);for(let i=0;idn(d,a))?s.push(a):n.push(a));const u=e.matched[i];u&&(t.matched.find(d=>dn(d,u))||o.push(u))}return[n,s,o]}/*! + * vue-router v4.6.4 + * (c) 2025 Eduardo San Martin Morote + * @license MIT + */let Qu=()=>location.protocol+"//"+location.host;function Hl(e,t){const{pathname:n,search:s,hash:o}=t,r=e.indexOf("#");if(r>-1){let i=o.includes(e.slice(r))?e.slice(r).length:1,a=o.slice(i);return a[0]!=="/"&&(a="/"+a),tr(a,"")}return tr(n,e)+s+o}function Ju(e,t,n,s){let o=[],r=[],i=null;const a=({state:p})=>{const x=Hl(e,location),S=n.value,C=t.value;let R=0;if(p){if(n.value=x,t.value=p,i&&i===S){i=null;return}R=C?p.position-C.position:0}else s(x);o.forEach(O=>{O(n.value,S,{delta:R,type:zs.pop,direction:R?R>0?Ds.forward:Ds.back:Ds.unknown})})};function u(){i=n.value}function d(p){o.push(p);const x=()=>{const S=o.indexOf(p);S>-1&&o.splice(S,1)};return r.push(x),x}function c(){if(document.visibilityState==="hidden"){const{history:p}=window;if(!p.state)return;p.replaceState(me({},p.state,{scroll:xs()}),"")}}function m(){for(const p of r)p();r=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:u,listen:d,destroy:m}}function lr(e,t,n,s=!1,o=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:o?xs():null}}function Yu(e){const{history:t,location:n}=window,s={value:Hl(e,n)},o={value:t.state};o.value||r(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function r(u,d,c){const m=e.indexOf("#"),p=m>-1?(n.host&&document.querySelector("base")?e:e.slice(m))+u:Qu()+e+u;try{t[c?"replaceState":"pushState"](d,"",p),o.value=d}catch(x){console.error(x),n[c?"replace":"assign"](p)}}function i(u,d){r(u,me({},t.state,lr(o.value.back,u,o.value.forward,!0),d,{position:o.value.position}),!0),s.value=u}function a(u,d){const c=me({},o.value,t.state,{forward:u,scroll:xs()});r(c.current,c,!0),r(u,me({},lr(s.value,u,null),{position:c.position+1},d),!1),s.value=u}return{location:s,state:o,push:a,replace:i}}function Zu(e){e=Mu(e);const t=Yu(e),n=Ju(e,t.state,t.location,t.replace);function s(r,i=!0){i||n.pauseListeners(),history.go(r)}const o=me({location:"",base:e,go:s,createHref:Vu.bind(null,e)},t,n);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>t.state.value}),o}let Kt=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Re=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(Re||{});const Xu={type:Kt.Static,value:""},ec=/[a-zA-Z0-9_]/;function tc(e){if(!e)return[[]];if(e==="/")return[[Xu]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(x){throw new Error(`ERR (${n})/"${d}": ${x}`)}let n=Re.Static,s=n;const o=[];let r;function i(){r&&o.push(r),r=[]}let a=0,u,d="",c="";function m(){d&&(n===Re.Static?r.push({type:Kt.Static,value:d}):n===Re.Param||n===Re.ParamRegExp||n===Re.ParamRegExpEnd?(r.length>1&&(u==="*"||u==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),r.push({type:Kt.Param,value:d,regexp:c,repeatable:u==="*"||u==="+",optional:u==="*"||u==="?"})):t("Invalid state to consume buffer"),d="")}function p(){d+=u}for(;at.length?t.length===1&&t[0]===qe.Static+qe.Segment?1:-1:0}function Bl(e,t){let n=0;const s=e.score,o=t.score;for(;n0&&t[t.length-1]<0}const lc={strict:!1,end:!0,sensitive:!1};function ic(e,t,n){const s=oc(tc(e.path),n),o=me(s,{record:e,parent:t,children:[],alias:[]});return t&&!o.record.aliasOf==!t.record.aliasOf&&t.children.push(o),o}function ac(e,t){const n=[],s=new Map;t=er(lc,t);function o(m){return s.get(m)}function r(m,p,x){const S=!x,C=cr(m);C.aliasOf=x&&x.record;const R=er(t,m),O=[C];if("alias"in m){const b=typeof m.alias=="string"?[m.alias]:m.alias;for(const _ of b)O.push(cr(me({},C,{components:x?x.record.components:C.components,path:_,aliasOf:x?x.record:C})))}let $,g;for(const b of O){const{path:_}=b;if(p&&_[0]!=="/"){const j=p.record.path,H=j[j.length-1]==="/"?"":"/";b.path=p.record.path+(_&&H+_)}if($=ic(b,p,R),x?x.alias.push($):(g=g||$,g!==$&&g.alias.push($),S&&m.name&&!dr($)&&i(m.name)),Gl($)&&u($),C.children){const j=C.children;for(let H=0;H{i(g)}:Sn}function i(m){if(Fl(m)){const p=s.get(m);p&&(s.delete(m),n.splice(n.indexOf(p),1),p.children.forEach(i),p.alias.forEach(i))}else{const p=n.indexOf(m);p>-1&&(n.splice(p,1),m.record.name&&s.delete(m.record.name),m.children.forEach(i),m.alias.forEach(i))}}function a(){return n}function u(m){const p=dc(m,n);n.splice(p,0,m),m.record.name&&!dr(m)&&s.set(m.record.name,m)}function d(m,p){let x,S={},C,R;if("name"in m&&m.name){if(x=s.get(m.name),!x)throw fn(Ce.MATCHER_NOT_FOUND,{location:m});R=x.record.name,S=me(ur(p.params,x.keys.filter(g=>!g.optional).concat(x.parent?x.parent.keys.filter(g=>g.optional):[]).map(g=>g.name)),m.params&&ur(m.params,x.keys.map(g=>g.name))),C=x.stringify(S)}else if(m.path!=null)C=m.path,x=n.find(g=>g.re.test(C)),x&&(S=x.parse(C),R=x.record.name);else{if(x=p.name?s.get(p.name):n.find(g=>g.re.test(p.path)),!x)throw fn(Ce.MATCHER_NOT_FOUND,{location:m,currentLocation:p});R=x.record.name,S=me({},p.params,m.params),C=x.stringify(S)}const O=[];let $=x;for(;$;)O.unshift($.record),$=$.parent;return{name:R,path:C,params:S,matched:O,meta:cc(O)}}e.forEach(m=>r(m));function c(){n.length=0,s.clear()}return{addRoute:r,resolve:d,removeRoute:i,clearRoutes:c,getRoutes:a,getRecordMatcher:o}}function ur(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function cr(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:uc(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function uc(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function dr(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function cc(e){return e.reduce((t,n)=>me(t,n.meta),{})}function dc(e,t){let n=0,s=t.length;for(;n!==s;){const r=n+s>>1;Bl(e,t[r])<0?s=r:n=r+1}const o=fc(e);return o&&(s=t.lastIndexOf(o,s-1)),s}function fc(e){let t=e;for(;t=t.parent;)if(Gl(t)&&Bl(e,t)===0)return t}function Gl({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function fr(e){const t=rt(ys),n=rt(go),s=le(()=>{const u=Pe(e.to);return t.resolve(u)}),o=le(()=>{const{matched:u}=s.value,{length:d}=u,c=u[d-1],m=n.matched;if(!c||!m.length)return-1;const p=m.findIndex(dn.bind(null,c));if(p>-1)return p;const x=pr(u[d-2]);return d>1&&pr(c)===x&&m[m.length-1].path!==x?m.findIndex(dn.bind(null,u[d-2])):p}),r=le(()=>o.value>-1&&gc(n.params,s.value.params)),i=le(()=>o.value>-1&&o.value===n.matched.length-1&&Ll(n.params,s.value.params));function a(u={}){if(hc(u)){const d=t[Pe(e.replace)?"replace":"push"](Pe(e.to)).catch(Sn);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:s,href:le(()=>s.value.href),isActive:r,isExactActive:i,navigate:a}}function pc(e){return e.length===1?e[0]:e}const mc=Xr({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:fr,setup(e,{slots:t}){const n=ds(fr(e)),{options:s}=rt(ys),o=le(()=>({[mr(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[mr(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const r=t.default&&pc(t.default(n));return e.custom?r:Pl("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},r)}}}),vc=mc;function hc(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function gc(e,t){for(const n in t){const s=t[n],o=e[n];if(typeof s=="string"){if(s!==o)return!1}else if(!ct(o)||o.length!==s.length||s.some((r,i)=>r.valueOf()!==o[i].valueOf()))return!1}return!0}function pr(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const mr=(e,t,n)=>e??t??n,bc=Xr({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=rt(Js),o=le(()=>e.route||s.value),r=rt(rr,0),i=le(()=>{let d=Pe(r);const{matched:c}=o.value;let m;for(;(m=c[d])&&!m.components;)d++;return d}),a=le(()=>o.value.matched[i.value]);Kn(rr,le(()=>i.value+1)),Kn(Ku,a),Kn(Js,o);const u=L();return Pt(()=>[u.value,a.value,e.name],([d,c,m],[p,x,S])=>{c&&(c.instances[m]=d,x&&x!==c&&d&&d===p&&(c.leaveGuards.size||(c.leaveGuards=x.leaveGuards),c.updateGuards.size||(c.updateGuards=x.updateGuards))),d&&c&&(!x||!dn(c,x)||!p)&&(c.enterCallbacks[m]||[]).forEach(C=>C(d))},{flush:"post"}),()=>{const d=o.value,c=e.name,m=a.value,p=m&&m.components[c];if(!p)return vr(n.default,{Component:p,route:d});const x=m.props[c],S=x?x===!0?d.params:typeof x=="function"?x(d):x:null,R=Pl(p,me({},S,t,{onVnodeUnmounted:O=>{O.component.isUnmounted&&(m.instances[c]=null)},ref:u}));return vr(n.default,{Component:R,route:d})||R}}});function vr(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const xc=bc;function yc(e){const t=ac(e.routes,e),n=e.parseQuery||Gu,s=e.stringifyQuery||or,o=e.history,r=bn(),i=bn(),a=bn(),u=Ai(jt);let d=jt;en&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=Ts.bind(null,D=>""+D),m=Ts.bind(null,Eu),p=Ts.bind(null,Mn);function x(D,W){let G,J;return Fl(D)?(G=t.getRecordMatcher(D),J=W):J=D,t.addRoute(J,G)}function S(D){const W=t.getRecordMatcher(D);W&&t.removeRoute(W)}function C(){return t.getRoutes().map(D=>D.record)}function R(D){return!!t.getRecordMatcher(D)}function O(D,W){if(W=me({},W||u.value),typeof D=="string"){const y=Os(n,D,W.path),T=t.resolve({path:y.path},W),M=o.createHref(y.fullPath);return me(y,T,{params:p(T.params),hash:Mn(y.hash),redirectedFrom:void 0,href:M})}let G;if(D.path!=null)G=me({},D,{path:Os(n,D.path,W.path).path});else{const y=me({},D.params);for(const T in y)y[T]==null&&delete y[T];G=me({},D,{params:m(y)}),W.params=m(W.params)}const J=t.resolve(G,W),ae=D.hash||"";J.params=c(p(J.params));const f=Pu(s,me({},D,{hash:Cu(ae),path:J.path})),v=o.createHref(f);return me({fullPath:f,hash:ae,query:s===or?Wu(D.query):D.query||{}},J,{redirectedFrom:void 0,href:v})}function $(D){return typeof D=="string"?Os(n,D,u.value.path):me({},D)}function g(D,W){if(d!==D)return fn(Ce.NAVIGATION_CANCELLED,{from:W,to:D})}function b(D){return H(D)}function _(D){return b(me($(D),{replace:!0}))}function j(D,W){const G=D.matched[D.matched.length-1];if(G&&G.redirect){const{redirect:J}=G;let ae=typeof J=="function"?J(D,W):J;return typeof ae=="string"&&(ae=ae.includes("?")||ae.includes("#")?ae=$(ae):{path:ae},ae.params={}),me({query:D.query,hash:D.hash,params:ae.path!=null?{}:D.params},ae)}}function H(D,W){const G=d=O(D),J=u.value,ae=D.state,f=D.force,v=D.replace===!0,y=j(G,J);if(y)return H(me($(y),{state:typeof y=="object"?me({},ae,y.state):ae,force:f,replace:v}),W||G);const T=G;T.redirectedFrom=W;let M;return!f&&Tu(s,J,G)&&(M=fn(Ce.NAVIGATION_DUPLICATED,{to:T,from:J}),et(J,J,!0,!1)),(M?Promise.resolve(M):Y(T,J)).catch(P=>Ct(P)?Ct(P,Ce.NAVIGATION_GUARD_REDIRECT)?P:We(P):de(P,T,J)).then(P=>{if(P){if(Ct(P,Ce.NAVIGATION_GUARD_REDIRECT))return H(me({replace:v},$(P.to),{state:typeof P.to=="object"?me({},ae,P.to.state):ae,force:f}),W||T)}else P=Se(T,J,!0,v,ae);return F(T,J,P),P})}function q(D,W){const G=g(D,W);return G?Promise.reject(G):Promise.resolve()}function fe(D){const W=Je.values().next().value;return W&&typeof W.runWithContext=="function"?W.runWithContext(D):D()}function Y(D,W){let G;const[J,ae,f]=zu(D,W);G=Ms(J.reverse(),"beforeRouteLeave",D,W);for(const y of J)y.leaveGuards.forEach(T=>{G.push(Lt(T,D,W))});const v=q.bind(null,D,W);return G.push(v),Ke(G).then(()=>{G=[];for(const y of r.list())G.push(Lt(y,D,W));return G.push(v),Ke(G)}).then(()=>{G=Ms(ae,"beforeRouteUpdate",D,W);for(const y of ae)y.updateGuards.forEach(T=>{G.push(Lt(T,D,W))});return G.push(v),Ke(G)}).then(()=>{G=[];for(const y of f)if(y.beforeEnter)if(ct(y.beforeEnter))for(const T of y.beforeEnter)G.push(Lt(T,D,W));else G.push(Lt(y.beforeEnter,D,W));return G.push(v),Ke(G)}).then(()=>(D.matched.forEach(y=>y.enterCallbacks={}),G=Ms(f,"beforeRouteEnter",D,W,fe),G.push(v),Ke(G))).then(()=>{G=[];for(const y of i.list())G.push(Lt(y,D,W));return G.push(v),Ke(G)}).catch(y=>Ct(y,Ce.NAVIGATION_CANCELLED)?y:Promise.reject(y))}function F(D,W,G){a.list().forEach(J=>fe(()=>J(D,W,G)))}function Se(D,W,G,J,ae){const f=g(D,W);if(f)return f;const v=W===jt,y=en?history.state:{};G&&(J||v?o.replace(D.fullPath,me({scroll:v&&y&&y.scroll},ae)):o.push(D.fullPath,ae)),u.value=D,et(D,W,G,v),We()}let K;function Ge(){K||(K=o.listen((D,W,G)=>{if(!dt.listening)return;const J=O(D),ae=j(J,dt.currentRoute.value);if(ae){H(me(ae,{replace:!0,force:!0}),J).catch(Sn);return}d=J;const f=u.value;en&&Lu(sr(f.fullPath,G.delta),xs()),Y(J,f).catch(v=>Ct(v,Ce.NAVIGATION_ABORTED|Ce.NAVIGATION_CANCELLED)?v:Ct(v,Ce.NAVIGATION_GUARD_REDIRECT)?(H(me($(v.to),{force:!0}),J).then(y=>{Ct(y,Ce.NAVIGATION_ABORTED|Ce.NAVIGATION_DUPLICATED)&&!G.delta&&G.type===zs.pop&&o.go(-1,!1)}).catch(Sn),Promise.reject()):(G.delta&&o.go(-G.delta,!1),de(v,J,f))).then(v=>{v=v||Se(J,f,!1),v&&(G.delta&&!Ct(v,Ce.NAVIGATION_CANCELLED)?o.go(-G.delta,!1):G.type===zs.pop&&Ct(v,Ce.NAVIGATION_ABORTED|Ce.NAVIGATION_DUPLICATED)&&o.go(-1,!1)),F(J,f,v)}).catch(Sn)}))}let Vt=bn(),Ee=bn(),pe;function de(D,W,G){We(D);const J=Ee.list();return J.length?J.forEach(ae=>ae(D,W,G)):console.error(D),Promise.reject(D)}function nt(){return pe&&u.value!==jt?Promise.resolve():new Promise((D,W)=>{Vt.add([D,W])})}function We(D){return pe||(pe=!D,Ge(),Vt.list().forEach(([W,G])=>D?G(D):W()),Vt.reset()),D}function et(D,W,G,J){const{scrollBehavior:ae}=e;if(!en||!ae)return Promise.resolve();const f=!G&&Fu(sr(D.fullPath,0))||(J||!G)&&history.state&&history.state.scroll||null;return ao().then(()=>ae(D,W,f)).then(v=>v&&Uu(v)).catch(v=>de(v,D,W))}const Te=D=>o.go(D);let kt;const Je=new Set,dt={currentRoute:u,listening:!0,addRoute:x,removeRoute:S,clearRoutes:t.clearRoutes,hasRoute:R,getRoutes:C,resolve:O,options:e,push:b,replace:_,go:Te,back:()=>Te(-1),forward:()=>Te(1),beforeEach:r.add,beforeResolve:i.add,afterEach:a.add,onError:Ee.add,isReady:nt,install(D){D.component("RouterLink",vc),D.component("RouterView",xc),D.config.globalProperties.$router=dt,Object.defineProperty(D.config.globalProperties,"$route",{enumerable:!0,get:()=>Pe(u)}),en&&!kt&&u.value===jt&&(kt=!0,b(o.location).catch(J=>{}));const W={};for(const J in jt)Object.defineProperty(W,J,{get:()=>u.value[J],enumerable:!0});D.provide(ys,dt),D.provide(go,qr(W)),D.provide(Js,u);const G=D.unmount;Je.add(D),D.unmount=function(){Je.delete(D),Je.size<1&&(d=jt,K&&K(),K=null,u.value=jt,kt=!1,pe=!1),G()}}};function Ke(D){return D.reduce((W,G)=>W.then(()=>fe(G)),Promise.resolve())}return dt}function bo(){return rt(ys)}function Wl(e){return rt(go)}const Bn=window.location.pathname.startsWith("/portal/"),Qe={esPortal:Bn,baseRuta:Bn?"/portal/studio/":"/studio/",apiBase:Bn?"/portal":"/app",urlLogin:Bn?"/portal/login":"/login"};function te(e){return Qe.apiBase+e}async function Gn(e,t={}){const n=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t.headers}}),s=n.headers.get("content-type")||"";if(n.redirected||!s.includes("application/json"))throw window.location.href=Qe.urlLogin,new Error("Sesión expirada");const o=await n.json();if(!n.ok){const r=typeof(o==null?void 0:o.error)=="string"?o.error:o==null?void 0:o.message;throw new Error(r||"Error de servidor")}return o}const se={get:e=>Gn(e),post:(e,t)=>Gn(e,{method:"POST",body:JSON.stringify(t)}),put:(e,t)=>Gn(e,{method:"PUT",body:JSON.stringify(t)}),del:e=>Gn(e,{method:"DELETE"})},_n=L(!1),_c={class:"h-14 px-4 flex items-center gap-2 border-b border-borde"},wc={key:0,class:"px-3 pt-3"},kc={key:1,class:"px-3 pt-2 text-xs text-red-600 dark:text-red-400"},$c={class:"flex-1 overflow-y-auto px-2 py-3 space-y-0.5"},Cc={key:0,class:"px-2 text-xs text-tenue"},Ac={key:1,class:"px-2 text-xs text-tenue"},Sc={class:"truncate"},Ec={class:"flex items-center gap-1 mt-0.5"},Ic={class:"text-[11px] text-tenue"},Rc={key:0,class:"flex opacity-0 group-hover:opacity-100 transition-opacity pr-1.5 gap-0.5"},Pc=["onClick"],Tc=["onClick"],Oc={class:"card w-full max-w-lg p-6 animate-escalar shadow-2xl"},Dc={class:"font-semibold text-texto mb-4"},Mc={key:0,class:"grid grid-cols-2 gap-3"},Nc=["value"],Vc={class:"text-[11px] text-tenue mt-1"},jc=["value"],Uc={class:"text-[11px] text-tenue mt-1"},Lc={class:"flex items-center gap-2 text-sm text-texto"},Fc={class:"flex justify-end gap-2 pt-2"},qc={__name:"Sidebar",setup(e,{expose:t}){const n=Wl(),s=bo(),o=L([]),r=L([]),i=L([]),a=L(!0),u=L(""),d=L(!1),c=L(null),m=L(x()),p=le(()=>n.params.tenantId||n.params.id);Pt(()=>n.fullPath,()=>{_n.value=!1});function x(){return{nombre:"",dominios_permitidos:"",activo:!0,cliente_id:null,plan_id:null}}async function S(){a.value=!0,u.value="";try{const _=await se.get(te("/umind/tenants"));o.value=_.items||[]}catch(_){u.value=_.message}finally{a.value=!1}}function C(_){return Array.isArray(_)?_:(_==null?void 0:_.items)||(_==null?void 0:_.registros)||[]}async function R(){if(Qe.esPortal)return;const[_,j]=await Promise.allSettled([se.get("/app/api/clientes/select"),se.get("/app/umind-planes/list")]);r.value=_.status==="fulfilled"?C(_.value):[],i.value=j.status==="fulfilled"?C(j.value):[];const H=[];_.status==="rejected"&&H.push("clientes"),j.status==="rejected"&&H.push("planes"),H.length&&(u.value=`No se pudo cargar la lista de ${H.join(" ni ")}.`)}function O(){c.value=null,m.value=x(),d.value=!0}function $(_){c.value=_,m.value={nombre:_.nombre,dominios_permitidos:_.dominios_permitidos,activo:_.activo,cliente_id:_.cliente_id??null,plan_id:_.plan_id??null},d.value=!0}async function g(){const _={...m.value,dominios_permitidos:m.value.dominios_permitidos.split(",").map(j=>j.trim()).filter(Boolean)};try{if(c.value)await se.put(te(`/umind/tenants/${c.value.ID}`),_),d.value=!1,await S();else{const j=await se.post(te("/umind/tenants"),_);d.value=!1,await S(),s.push(`/tenants/${j.id}`)}}catch(j){u.value=j.message}}async function b(_){confirm(`¿Eliminar el espacio "${_.nombre}"? Esto borra también sus agentes. No se puede deshacer.`)&&(await se.del(te(`/umind/tenants/${_.ID}`)),p.value===String(_.ID)&&s.push("/"),await S())}return t({recargar:S}),vs(()=>{S(),R()}),(_,j)=>{const H=mn("router-link");return h(),w(X,null,[Pe(_n)?(h(),w("div",{key:0,class:"fixed inset-0 bg-black/50 z-30 md:hidden",onClick:j[0]||(j[0]=q=>_n.value=!1)})):B("",!0),l("aside",{class:ue(["w-64 shrink-0 flex flex-col border-r border-borde bg-superficie fixed inset-y-0 left-0 z-40 transition-transform duration-200 md:static md:h-screen md:sticky md:top-0 md:translate-x-0",Pe(_n)?"translate-x-0":"-translate-x-full"])},[l("div",_c,[oe(H,{to:"/",class:"flex items-center gap-2 text-base font-semibold text-texto"},{default:st(()=>[...j[8]||(j[8]=[l("svg",{viewBox:"0 0 96 96",class:"w-6 h-6 shrink-0","aria-hidden":"true"},[l("rect",{width:"96",height:"96",rx:"22",fill:"#8eb02f"}),l("path",{d:"M32,42 V58 A14,14 0 0 0 60,58 V42",fill:"none",stroke:"#fff","stroke-width":"10","stroke-linecap":"round","stroke-linejoin":"round"}),l("path",{d:"M60,58 V64",fill:"none",stroke:"#fff","stroke-width":"10","stroke-linecap":"round"}),l("circle",{cx:"60",cy:"28",r:"7",fill:"#fff"})],-1),l("span",null,[Z("uMind "),l("span",{class:"text-brand"},"Studio")],-1)])]),_:1})]),Pe(Qe).esPortal?B("",!0):(h(),w("div",wc,[l("button",{class:"btn-primary w-full",onClick:O}," + Nuevo espacio ")])),u.value?(h(),w("p",kc,E(u.value),1)):B("",!0),l("nav",$c,[a.value?(h(),w("p",Cc,"Cargando...")):o.value.length===0?(h(),w("p",Ac,E(Pe(Qe).esPortal?"Todavía no tenés ningún espacio asignado. Escribinos y lo activamos.":"Sin espacios todavía."),1)):B("",!0),(h(!0),w(X,null,xe(o.value,q=>(h(),w("div",{key:q.ID,class:ue(["group flex items-center rounded-lg transition-colors",p.value===String(q.ID)?"bg-brand/10":"hover:bg-elevado"])},[oe(H,{to:`/tenants/${q.ID}`,class:ue(["flex-1 min-w-0 px-2.5 py-2 text-sm",p.value===String(q.ID)?"text-brand font-medium":"text-texto"])},{default:st(()=>[l("div",Sc,E(q.nombre),1),l("div",Ec,[l("span",{class:ue(["w-1.5 h-1.5 rounded-full",q.activo?"bg-green-500":"bg-tenue/40"])},null,2),l("span",Ic,E(q.activo?"activo":"inactivo"),1)])]),_:2},1032,["to","class"]),Pe(Qe).esPortal?B("",!0):(h(),w("div",Rc,[l("button",{class:"p-1 text-tenue hover:text-texto",title:"Editar",onClick:fe=>$(q)},[oe(Oe,{nombre:"lapiz",tam:14})],8,Pc),l("button",{class:"p-1 text-tenue hover:text-red-600",title:"Eliminar",onClick:fe=>b(q)},[oe(Oe,{nombre:"cerrar",tam:14})],8,Tc)]))],2))),128))])],2),d.value?(h(),w("div",{key:1,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:j[7]||(j[7]=Ae(q=>d.value=!1,["self"]))},[l("div",Oc,[l("h2",Dc,E(c.value?"Editar espacio":"Nuevo espacio"),1),j[17]||(j[17]=l("p",{class:"text-xs text-tenue mb-3"}," Un espacio es el negocio o sitio dueño de los dominios permitidos. La config de IA, tono y demás se configuran por agente, dentro del tenant. ",-1)),l("form",{class:"space-y-3",onSubmit:Ae(g,["prevent"])},[l("div",null,[j[9]||(j[9]=l("label",{class:"label"},"Nombre",-1)),z(l("input",{"onUpdate:modelValue":j[1]||(j[1]=q=>m.value.nombre=q),required:"",class:"input"},null,512),[[ie,m.value.nombre]])]),l("div",null,[j[10]||(j[10]=l("label",{class:"label"},"Dominios permitidos (separados por coma)",-1)),z(l("input",{"onUpdate:modelValue":j[2]||(j[2]=q=>m.value.dominios_permitidos=q),placeholder:"ejemplo.com, www.ejemplo.com",required:"",class:"input"},null,512),[[ie,m.value.dominios_permitidos]])]),Pe(Qe).esPortal?B("",!0):(h(),w("div",Mc,[l("div",null,[j[12]||(j[12]=l("label",{class:"label"},"Cliente",-1)),z(l("select",{"onUpdate:modelValue":j[3]||(j[3]=q=>m.value.cliente_id=q),class:"input"},[j[11]||(j[11]=l("option",{value:null},"— sin asignar —",-1)),(h(!0),w(X,null,xe(r.value,q=>(h(),w("option",{key:q.ID,value:q.ID},E(q.nombre),9,Nc))),128))],512),[[Ht,m.value.cliente_id]]),l("p",Vc,E(r.value.length?"Define quién ve este espacio desde el portal.":"No hay clientes activos — creá uno en Clientes."),1)]),l("div",null,[j[14]||(j[14]=l("label",{class:"label"},"Plan",-1)),z(l("select",{"onUpdate:modelValue":j[4]||(j[4]=q=>m.value.plan_id=q),class:"input"},[j[13]||(j[13]=l("option",{value:null},"— sin plan —",-1)),(h(!0),w(X,null,xe(i.value,q=>(h(),w("option",{key:q.ID,value:q.ID},E(q.nombre)+" ("+E(q.max_agentes===0?"∞":q.max_agentes)+" agentes) ",9,jc))),128))],512),[[Ht,m.value.plan_id]]),l("p",Uc,E(i.value.length?"Límite de agentes y precios de consumo.":"No hay planes — creá uno en uMind Planes."),1)])])),l("label",Lc,[z(l("input",{"onUpdate:modelValue":j[5]||(j[5]=q=>m.value.activo=q),type:"checkbox"},null,512),[[_t,m.value.activo]]),j[15]||(j[15]=Z(" Activo ",-1))]),l("div",Fc,[l("button",{type:"button",class:"btn-ghost",onClick:j[6]||(j[6]=q=>d.value=!1)}," Cancelar "),j[16]||(j[16]=l("button",{type:"submit",class:"btn-primary"}," Guardar ",-1))])],32)])])):B("",!0)],64)}}},Kl="umind-tema";function Hc(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"oscuro":"claro"}const ln=L(localStorage.getItem(Kl)||Hc());function zl(){document.documentElement.classList.toggle("dark",ln.value==="oscuro")}function hr(){ln.value=ln.value==="oscuro"?"claro":"oscuro",localStorage.setItem(Kl,ln.value),zl()}zl();const gr="umind_despertar_visto",br=1250,Bc={__name:"DespertarUmind",setup(e){const t=L(null),n=L(!1);let s=null,o=null;function r(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}return vs(()=>{r()||sessionStorage.getItem(gr)||(sessionStorage.setItem(gr,"1"),n.value=!0,o=setTimeout(()=>n.value=!1,br),requestAnimationFrame(()=>{const i=t.value;if(!i)return;const a=i.getContext("2d"),u=Math.min(window.devicePixelRatio||1,2),d=window.innerWidth,c=window.innerHeight;i.width=Math.round(d*u),i.height=Math.round(c*u),a.setTransform(u,0,0,u,0,0);const m=d<640?22:46,p=Array.from({length:m},()=>({x:Math.random()*d,y:Math.random()*c,r:1+Math.random()*1.6,demora:Math.random()*.45})),x=performance.now(),S=C=>{const R=Math.min(1,(C-x)/br);a.clearRect(0,0,d,c);const O=R<.75?1:1-(R-.75)/.25;for(let $=0;$170||(a.strokeStyle=`rgba(142, 176, 47, ${.16*(1-fe/170)*b*O})`,a.lineWidth=1,a.beginPath(),a.moveTo(g.x,g.y),a.lineTo(j.x,j.y),a.stroke())}a.beginPath(),a.arc(g.x,g.y,g.r*b,0,Math.PI*2),a.fillStyle=`rgba(142, 176, 47, ${.5*b*O})`,a.fill()}}R<1&&(s=requestAnimationFrame(S))};s=requestAnimationFrame(S)}))}),nl(()=>{s&&cancelAnimationFrame(s),o&&clearTimeout(o)}),(i,a)=>n.value?(h(),w("canvas",{key:0,ref_key:"lienzo",ref:t,class:"fixed inset-0 w-full h-full pointer-events-none z-50","aria-hidden":"true"},null,512)):B("",!0)}},Gc={class:"min-h-screen flex"},Wc={class:"flex-1 min-w-0 flex flex-col"},Kc={class:"h-14 shrink-0 flex items-center gap-1 px-4 sm:px-6 border-b border-borde"},zc=["title"],Qc={class:"flex-1 max-w-5xl w-full mx-auto px-4 sm:px-6 lg:px-8 py-6 sm:py-8 animate-aparecer"},Jc={__name:"App",setup(e){return(t,n)=>{const s=mn("router-view");return h(),w("div",Gc,[oe(Bc),oe(qc),l("main",Wc,[l("header",Kc,[l("button",{class:"btn-ghost !px-2 !py-1.5 md:hidden","aria-label":"Abrir menú",onClick:n[0]||(n[0]=o=>_n.value=!0)},[...n[2]||(n[2]=[l("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 24 24"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 6h16M4 12h16M4 18h16"})],-1)])]),n[3]||(n[3]=l("span",{class:"flex-1"},null,-1)),l("button",{class:"btn-ghost !px-2.5 !py-1.5",title:Pe(ln)==="oscuro"?"Cambiar a claro":"Cambiar a oscuro",onClick:n[1]||(n[1]=(...o)=>Pe(hr)&&Pe(hr)(...o))},[oe(Oe,{nombre:Pe(ln)==="oscuro"?"sol":"luna",tam:17},null,8,["nombre"])],8,zc)]),l("div",Qc,[oe(s)])])])}}},Yc=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Zc=["width","height","aria-label"],Xc=["fill"],ed=["stroke"],td=["cy"],nd=["cy"],sd=["cy"],od=["cy"],rd={key:1,d:"M41,66 h12 M67,66 h12",class:"umi-linea","stroke-width":"5","stroke-linecap":"round",fill:"none"},ld={key:4,d:"M50,78 q10,8 20,0",class:"umi-linea","stroke-width":"4",fill:"none","stroke-linecap":"round"},id={__name:"UiMascota",props:{estado:{type:String,default:"normal"},tam:{type:[Number,String],default:72}},setup(e){return(t,n)=>(h(),w("svg",{width:e.tam,height:e.tam,viewBox:"0 0 120 120",class:"shrink-0",role:"img","aria-label":`Umi, la mascota de uMind (${e.estado})`},[l("circle",{cx:"60",cy:"26",r:"6",fill:e.estado==="alerta"?"#dc2626":"currentColor",class:ue(e.estado==="pensando"?"umi-late":"")},null,10,Xc),l("line",{x1:"60",y1:"32",x2:"60",y2:"44",stroke:e.estado==="alerta"?"#dc2626":"currentColor","stroke-width":"4","stroke-linecap":"round"},null,8,ed),n[7]||(n[7]=l("path",{d:"M30,46 V76 A30,30 0 0 0 90,76 V46 Z",fill:"currentColor"},null,-1)),e.estado==="normal"||e.estado==="contenta"||e.estado==="alerta"?(h(),w(X,{key:0},[l("circle",{cx:"47",cy:e.estado==="contenta"?64:66,r:"6",class:"umi-ojo"},null,8,td),l("circle",{cx:"73",cy:e.estado==="contenta"?64:66,r:"6",class:"umi-ojo"},null,8,nd),l("circle",{cx:"48",cy:e.estado==="contenta"?65:67,r:"3",class:"umi-pupila"},null,8,sd),l("circle",{cx:"74",cy:e.estado==="contenta"?65:67,r:"3",class:"umi-pupila"},null,8,od)],64)):e.estado==="durmiendo"?(h(),w("path",rd)):e.estado==="pensando"?(h(),w(X,{key:2},[n[0]||(n[0]=l("circle",{cx:"45",cy:"66",r:"4.5",class:"umi-ojo umi-p1"},null,-1)),n[1]||(n[1]=l("circle",{cx:"60",cy:"66",r:"4.5",class:"umi-ojo umi-p2"},null,-1)),n[2]||(n[2]=l("circle",{cx:"75",cy:"66",r:"4.5",class:"umi-ojo umi-p3"},null,-1))],64)):e.estado==="buscando"?(h(),w(X,{key:3},[n[3]||(n[3]=l("circle",{cx:"47",cy:"66",r:"6",class:"umi-ojo"},null,-1)),n[4]||(n[4]=l("circle",{cx:"73",cy:"66",r:"6",class:"umi-ojo"},null,-1)),n[5]||(n[5]=l("circle",{cx:"50",cy:"66",r:"3",class:"umi-pupila"},null,-1)),n[6]||(n[6]=l("circle",{cx:"76",cy:"66",r:"3",class:"umi-pupila"},null,-1))],64)):B("",!0),e.estado==="contenta"?(h(),w("path",ld)):B("",!0)],8,Zc))}},Nn=Yc(id,[["__scopeId","data-v-551897a0"]]),ad={key:0,class:"flex flex-col items-center justify-center py-24 text-sm text-tenue"},ud={key:1,class:"max-w-md mx-auto text-center py-20"},cd={key:2,class:"flex flex-col items-center justify-center text-center py-24"},dd={class:"text-lg font-medium text-texto"},fd={class:"text-sm text-tenue mt-1"},pd={__name:"Home",setup(e){const t=bo(),n=L(Qe.esPortal),s=L(!1);async function o(){if(Qe.esPortal)try{const i=(await se.get(te("/umind/tenants"))).items||[];if(i.length===0){s.value=!0;return}if(i.length!==1)return;const a=i[0].ID,d=(await se.get(te(`/umind/agentes?tenant_id=${a}`))).items||[];if(d.length===1){t.replace(`/tenants/${a}/agentes/${d[0].ID}`);return}t.replace(`/tenants/${a}`)}catch{}finally{n.value=!1}}return vs(o),(r,i)=>n.value?(h(),w("div",ad," Abriendo tu asistente… ")):s.value?(h(),w("div",ud,[oe(Nn,{estado:"durmiendo",tam:80,class:"mx-auto mb-4 text-brand"}),i[0]||(i[0]=Sl('

Todavía no tenés un asistente activo

uMind contesta por vos en WhatsApp y en tu sitio, con la información de tu negocio. Entiende las notas de voz y lee las fotos y archivos que te mandan tus clientes.

Quiero activarlo

Volver al portal

',4))])):(h(),w("div",cd,[oe(Nn,{estado:"normal",tam:64,class:"mx-auto mb-4 text-brand"}),l("h1",dd,E(Pe(Qe).esPortal?"Elegí tu espacio de la izquierda":"Elegí un espacio de la izquierda"),1),l("p",fd,E(Pe(Qe).esPortal?"Adentro vas a poder crear y configurar tus agentes.":"o creá uno nuevo para empezar a configurar su agente."),1)]))}},md={class:"flex flex-col items-center justify-center text-center py-12 px-6"},vd={key:0,class:"text-3xl mb-3 opacity-70"},hd={class:"text-sm font-medium text-texto"},gd={key:2,class:"text-xs text-tenue mt-1.5 max-w-sm leading-relaxed"},bd={key:3,class:"mt-4"},lt={__name:"UiEmptyState",props:{estado:{type:String,default:"durmiendo"},titulo:String,detalle:String,icono:{type:String,default:""}},setup(e){return(t,n)=>(h(),w("div",md,[e.icono?(h(),w("div",vd,E(e.icono),1)):(h(),_e(Nn,{key:1,estado:e.estado,tam:64,class:"mb-3 text-brand"},null,8,["estado"])),l("p",hd,E(e.titulo),1),e.detalle?(h(),w("p",gd,E(e.detalle),1)):B("",!0),t.$slots.default?(h(),w("div",bd,[Zi(t.$slots,"default")])):B("",!0)]))}},xd={key:0,class:"mb-6"},yd={class:"flex items-start justify-between gap-4"},_d={class:"text-xl font-semibold text-texto"},wd={class:"text-xs text-tenue mt-1"},kd={key:1,class:"text-sm text-red-600 dark:text-red-400 mb-4"},$d={class:"flex items-center justify-between mb-4"},Cd={class:"flex items-center gap-2"},Ad={key:0,class:"badge-alerta"},Sd={key:1,class:"badge-neutro"},Ed=["disabled"],Id={key:2,class:"text-xs text-tenue -mt-2 mb-4"},Rd={key:3,class:"text-xs text-tenue -mt-2 mb-4"},Pd={key:4,class:"grid gap-3 sm:grid-cols-2"},Td=["disabled"],Od={key:6,class:"grid gap-3 sm:grid-cols-2"},Dd={class:"flex items-start gap-3"},Md={class:"min-w-0 flex-1"},Nd={class:"flex items-center gap-2"},Vd={class:"font-medium text-texto truncate"},jd={class:"text-xs text-tenue mt-0.5 truncate"},Ud={class:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0"},Ld=["onClick"],Fd=["onClick"],qd=["onClick"],Hd={class:"flex items-center gap-4 mt-3.5 pt-3 border-t border-borde text-xs text-tenue"},Bd={class:"tabular-nums"},Gd={class:"text-texto font-medium"},Wd={class:"tabular-nums"},Kd={class:"text-texto font-medium"},zd={class:"tabular-nums"},Qd={class:"text-texto font-medium"},Jd={class:"bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-800 rounded-xl p-6 w-full max-w-lg max-h-[calc(100vh-2rem)] overflow-y-auto"},Yd={class:"font-semibold text-gray-800 dark:text-gray-100 mb-4"},Zd={key:0},Xd={class:"grid gap-1.5"},ef=["value"],tf={class:"min-w-0"},nf={class:"block text-sm text-texto"},sf={class:"block text-xs text-tenue"},of={key:0,class:"block text-xs text-tenue mt-0.5"},rf=["value"],lf={class:"flex items-center gap-2"},af={class:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-300"},uf={class:"flex justify-end gap-2 pt-2"},cf={type:"submit",class:"bg-brand hover:bg-brand-dark text-white text-sm font-medium px-4 py-2 rounded-lg"},df={__name:"TenantAgentes",props:{id:{type:String,required:!0}},setup(e){const t=e,n=le(()=>Number(t.id)),s=bo(),o=L(null),r=L([]),i=L([]),a=L(""),u=L(!1),d=L(null),c=L($()),m=L(null),p=L({}),x=L(!0);function S(Y){const F=p.value[Y.ID]||{};return Y.activo?F.documentos>0?{tipo:"ok",texto:"listo"}:{tipo:"alerta",texto:"sin conocimiento"}:{tipo:"neutro",texto:"inactivo"}}function C(Y){const F=p.value[Y.ID]||{};return{documentos:F.documentos||0,canales:F.canales||0,conversaciones:F.conversaciones_7d||0}}function R(Y){return String(Y||"?").trim().split(/\s+/).slice(0,2).map(F=>F[0]).join("").toUpperCase()}const O=le(()=>{if(!m.value)return{sinPlan:!0};const Y=m.value.max_agentes||0;return{sinPlan:!1,nombre:m.value.nombre,ilimitado:Y<=0,max:Y,usados:r.value.length,lleno:Y>0&&r.value.length>=Y}});function $(){return{nombre:"",ai_config_id:null,tono:"",mensaje_bienvenida:"",color:"#8eb02f",activo:!0,plantilla_rubro:""}}const g=L([]);async function b(){a.value="",x.value=!0;try{const[Y,F,Se,K]=await Promise.all([se.get(te("/umind/tenants")),se.get(te(`/umind/agentes?tenant_id=${t.id}`)),se.get(te("/umind/ai-configs")),se.get(te("/umind/plantillas-rubro"))]);o.value=(Y.items||[]).find(Ge=>String(Ge.ID)===t.id)||null,r.value=F.items||[],m.value=F.plan||null,p.value=F.resumen||{},i.value=Se.items||[],g.value=K.items||[]}catch(Y){a.value=Y.message}finally{x.value=!1}}async function _(Y){const F=prompt(`Nombre de la copia de "${Y.nombre}":`,`${Y.nombre} (copia)`);if(F!==null){a.value="";try{const Se=await se.post(te(`/umind/agentes/${Y.ID}/duplicar`),{tenant_id:Number(n.value),nombre:F.trim()});await b(),Se.aviso&&alert(Se.aviso)}catch(Se){a.value=Se.message}}}function j(){d.value=null,c.value=$(),u.value=!0}function H(Y){d.value=Y,c.value={nombre:Y.nombre,ai_config_id:Y.ai_config_id,tono:Y.tono,mensaje_bienvenida:Y.mensaje_bienvenida,color:Y.color||"#8eb02f",activo:Y.activo},u.value=!0}async function q(){try{if(d.value)await se.put(te(`/umind/agentes/${d.value.ID}`),{tenant_id:n.value,...c.value}),u.value=!1,await b();else{const Y=await se.post(te("/umind/agentes"),{tenant_id:n.value,...c.value});u.value=!1,s.push(`/tenants/${n.value}/agentes/${Y.id}`)}}catch(Y){a.value=Y.message}}async function fe(Y){confirm(`¿Eliminar el agente "${Y.nombre}"? Esto no se puede deshacer.`)&&(await se.del(te(`/umind/agentes/${Y.ID}`)),await b())}return Pt(()=>t.id,b,{immediate:!0}),(Y,F)=>{const Se=mn("router-link");return h(),w("div",null,[o.value?(h(),w("div",xd,[l("div",yd,[l("div",null,[l("h1",_d,E(o.value.nombre),1),l("p",wd,E(o.value.dominios_permitidos||"sin dominios configurados"),1)]),oe(Se,{to:`/tenants/${n.value??e.id}/ia`,class:"btn-ghost"},{default:st(()=>[...F[10]||(F[10]=[Z("Tu IA",-1)])]),_:1},8,["to"]),oe(Se,{to:`/tenants/${n.value??e.id}/uso`,class:"btn-ghost inline-flex items-center gap-1.5"},{default:st(()=>[oe(Oe,{nombre:"grafico"}),F[11]||(F[11]=Z(" Consumo",-1))]),_:1},8,["to"])])])):B("",!0),a.value?(h(),w("p",kd,E(a.value),1)):B("",!0),l("div",$d,[l("div",Cd,[F[12]||(F[12]=l("h2",{class:"text-sm font-medium text-tenue"},"Agentes",-1)),O.value.sinPlan?(h(),w("span",Ad,"sin plan · sin límite")):O.value.ilimitado?(h(),w("span",Sd,E(O.value.nombre)+" · ilimitado",1)):(h(),w("span",{key:2,class:ue(O.value.lleno?"badge-alerta":"badge-neutro")},E(O.value.nombre)+" · "+E(O.value.usados)+" de "+E(O.value.max),3))]),l("button",{class:"btn-primary",disabled:O.value.lleno,onClick:j},"+ Nuevo agente",8,Ed)]),O.value.sinPlan&&!Pe(Qe).esPortal?(h(),w("p",Id," Este espacio no tiene plan asignado, así que no se le aplica ningún límite de agentes. Asignale uno desde el lápiz del espacio, en la barra izquierda. ")):O.value.lleno?(h(),w("p",Rd," Alcanzaste el máximo de agentes de tu plan. ")):B("",!0),x.value?(h(),w("div",Pd,[(h(),w(X,null,xe(2,K=>l("div",{key:K,class:"card p-4 animate-pulse"},[...F[13]||(F[13]=[Sl('
',2)])])),64))])):r.value.length===0?(h(),_e(lt,{key:5,class:"card",estado:"durmiendo",titulo:"Todavía no hay agentes",detalle:"Creá el primero y cargale su base de conocimiento para que empiece a responder."},{default:st(()=>[l("button",{class:"btn-primary",disabled:O.value.lleno,onClick:j},"+ Crear el primer agente",8,Td)]),_:1})):(h(),w("div",Od,[(h(!0),w(X,null,xe(r.value,K=>(h(),_e(Se,{key:K.ID,to:`/tenants/${n.value}/agentes/${K.ID}`,class:"card p-4 relative group hover:shadow-lg hover:-translate-y-0.5 transition-all overflow-hidden"},{default:st(()=>[l("span",{class:"absolute inset-x-0 top-0 h-1",style:Jt({background:K.color||"#8eb02f"})},null,4),l("div",Dd,[l("span",{class:"w-10 h-10 rounded-xl flex items-center justify-center text-white text-sm font-semibold shrink-0",style:Jt({background:K.color||"#8eb02f",opacity:K.activo?1:.4})},E(R(K.nombre)),5),l("div",Md,[l("div",Nd,[l("span",Vd,E(K.nombre),1),l("span",{class:ue(`badge-${S(K).tipo}`)},E(S(K).texto),3)]),l("p",jd,E(K.tono||"sin tono definido"),1)]),l("div",Ud,[l("button",{class:"p-1 text-tenue hover:text-texto",title:"Editar",onClick:Ae(Ge=>H(K),["prevent","stop"])},[oe(Oe,{nombre:"lapiz",tam:14})],8,Ld),l("button",{class:"p-1 text-tenue hover:text-texto",title:"Duplicar: copia el conocimiento y las herramientas a un agente nuevo",onClick:Ae(Ge=>_(K),["prevent","stop"])},[oe(Oe,{nombre:"copiar",tam:14})],8,Fd),l("button",{class:"p-1 text-tenue hover:text-red-600",title:"Eliminar",onClick:Ae(Ge=>fe(K),["prevent","stop"])},[oe(Oe,{nombre:"cerrar",tam:14})],8,qd)])]),l("div",Hd,[l("span",Bd,[l("b",Gd,E(C(K).conversaciones),1),F[14]||(F[14]=Z(" conversaciones · 7d",-1))]),l("span",Wd,[l("b",Kd,E(C(K).documentos),1),F[15]||(F[15]=Z(" fuentes",-1))]),l("span",zd,[l("b",Qd,E(C(K).canales),1),F[16]||(F[16]=Z(" canales",-1))])])]),_:2},1032,["to"]))),128))])),u.value?(h(),w("div",{key:7,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:F[9]||(F[9]=Ae(K=>u.value=!1,["self"]))},[l("div",Jd,[l("h2",Yd,E(d.value?"Editar agente":"Nuevo agente"),1),l("form",{class:"space-y-3",onSubmit:Ae(q,["prevent"])},[l("div",null,[F[17]||(F[17]=l("label",{class:"label"},"Nombre",-1)),z(l("input",{"onUpdate:modelValue":F[0]||(F[0]=K=>c.value.nombre=K),required:"",placeholder:"ej: Ventas, Soporte",class:"input"},null,512),[[ie,c.value.nombre]])]),!d.value&&g.value.length?(h(),w("div",Zd,[F[18]||(F[18]=l("label",{class:"label"},"Arrancar con",-1)),l("div",Xd,[(h(!0),w(X,null,xe([{clave:"",nombre:"Agente en blanco",descripcion:"Sin conocimiento cargado. Lo escribís vos desde cero."},...g.value],K=>(h(),w("label",{key:K.clave,class:ue(["flex gap-2.5 p-2.5 rounded-lg border cursor-pointer transition-colors",c.value.plantilla_rubro===K.clave?"border-brand bg-brand/5":"border-borde hover:border-brand/40"])},[z(l("input",{"onUpdate:modelValue":F[1]||(F[1]=Ge=>c.value.plantilla_rubro=Ge),type:"radio",value:K.clave,class:"mt-1 text-brand focus:ring-brand"},null,8,ef),[[Ws,c.value.plantilla_rubro]]),l("span",tf,[l("span",nf,E(K.nombre),1),l("span",sf,E(K.descripcion),1),K.notas?(h(),w("span",of,E(K.notas)+" notas listas para editar · "+E(K.resumen),1)):B("",!0)])],2))),128))]),F[19]||(F[19]=l("p",{class:"text-xs text-tenue mt-1.5"}," Las notas vienen con ejemplos entre corchetes — abrilas y reemplazalas por tus datos reales. ",-1))])):B("",!0),l("div",null,[F[21]||(F[21]=l("label",{class:"label"},"Config de IA",-1)),z(l("select",{"onUpdate:modelValue":F[2]||(F[2]=K=>c.value.ai_config_id=K),class:"input"},[F[20]||(F[20]=l("option",{value:null},"— sin asignar —",-1)),(h(!0),w(X,null,xe(i.value,K=>(h(),w("option",{key:K.ID,value:K.ID},E(K.nombre)+" ("+E(K.provider)+")",9,rf))),128))],512),[[Ht,c.value.ai_config_id]])]),l("div",null,[F[22]||(F[22]=l("label",{class:"label"},"Tono / personalidad",-1)),z(l("textarea",{"onUpdate:modelValue":F[3]||(F[3]=K=>c.value.tono=K),rows:"2",class:"input"},null,512),[[ie,c.value.tono]])]),l("div",null,[F[23]||(F[23]=l("label",{class:"label"},"Mensaje de bienvenida",-1)),z(l("input",{"onUpdate:modelValue":F[4]||(F[4]=K=>c.value.mensaje_bienvenida=K),class:"input"},null,512),[[ie,c.value.mensaje_bienvenida]])]),l("div",null,[F[24]||(F[24]=l("label",{class:"label"},"Color del widget",-1)),l("div",lf,[z(l("input",{"onUpdate:modelValue":F[5]||(F[5]=K=>c.value.color=K),type:"color",class:"w-10 h-9 border border-gray-300 dark:border-gray-700 rounded cursor-pointer bg-white dark:bg-gray-800"},null,512),[[ie,c.value.color]]),z(l("input",{"onUpdate:modelValue":F[6]||(F[6]=K=>c.value.color=K),type:"text",pattern:"#[0-9a-fA-F]{6}",class:"flex-1 border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-100 rounded-lg px-3 py-2 text-sm font-mono"},null,512),[[ie,c.value.color]])])]),l("label",af,[z(l("input",{"onUpdate:modelValue":F[7]||(F[7]=K=>c.value.activo=K),type:"checkbox"},null,512),[[_t,c.value.activo]]),F[25]||(F[25]=Z(" Activo ",-1))]),l("div",uf,[l("button",{type:"button",class:"px-4 py-2 text-sm text-gray-500 dark:text-gray-400",onClick:F[8]||(F[8]=K=>u.value=!1)},"Cancelar"),l("button",cf,E(d.value?"Guardar":"Crear"),1)])],32)])])):B("",!0)])}}},ff={class:"card divide-y divide-borde max-h-[32rem] overflow-y-auto"},pf={class:"cursor-pointer flex items-center gap-2 text-sm"},mf={class:"text-tenue text-xs shrink-0"},vf={class:"text-texto truncate"},hf={class:"text-tenue text-xs ml-auto shrink-0"},gf={key:0,class:"mt-2 bg-elevado border border-borde rounded-lg p-2 text-xs text-gray-600 dark:text-gray-400 overflow-x-auto whitespace-pre-wrap"},bf={__name:"TabAuditoria",props:{eventos:{type:Array,default:()=>[]}},setup(e){const t=le(()=>s=>({error:"badge-error",warn:"badge-alerta"})[s]||"badge-neutro");function n(s){try{return new Date(s).toLocaleString()}catch{return s}}return(s,o)=>(h(),w("div",null,[o[0]||(o[0]=l("p",{class:"label mb-4"}," Errores y eventos técnicos de este agente — fallos al llamar a la IA, a una herramienta, al correo o a los canales. Últimos 100. ",-1)),l("div",ff,[e.eventos.length===0?(h(),_e(lt,{key:0,estado:"contenta",titulo:"Ningún problema registrado",detalle:"Acá aparecen los errores: una herramienta que no responde, una fuente que no se pudo leer. Que esté vacío es buena señal."})):B("",!0),(h(!0),w(X,null,xe(e.eventos,r=>(h(),w("details",{key:r.ID,class:"p-3"},[l("summary",pf,[l("span",{class:ue(["px-1.5 py-0.5 rounded text-xs shrink-0",t.value(r.nivel)])},E(r.nivel),3),l("span",mf,E(r.origen),1),l("span",vf,E(r.mensaje),1),l("span",hf,E(n(r.CreatedAt)),1)]),r.detalle?(h(),w("pre",gf,E(r.detalle),1)):B("",!0)]))),128))])]))}},xf={class:"flex flex-wrap gap-2 mb-4"},yf={class:"grid sm:grid-cols-2 gap-3"},_f={key:0,class:"grid sm:grid-cols-3 gap-3"},wf={key:1,class:"text-sm text-red-600 dark:text-red-400"},kf={class:"flex items-center justify-between"},$f=["disabled"],Cf={class:"card divide-y divide-borde"},Af={class:"flex items-center justify-between gap-3"},Sf={class:"min-w-0"},Ef={class:"font-medium text-texto"},If={class:"ml-2 text-xs text-tenue"},Rf={class:"flex items-center gap-3 shrink-0 text-sm"},Pf=["disabled","onClick"],Tf=["onClick"],Of={__name:"TabConexiones",props:{agenteId:{type:Number,required:!0},conexiones:{type:Array,default:()=>[]}},emits:["recargar"],setup(e,{emit:t}){const n=e,s=t,o=L(!1),r=L(!1),i=L(""),a=L(!1),u=L({email:"",password:"",host:"",puerto:993,encriptado:"ssl"}),d=L(null),c=L({});function m(R){return{google:"Google",microsoft:"Outlook",imap:"Casilla propia"}[R]||R}function p(R){window.location.href=te(`/umind/conexiones/conectar?agente_id=${n.agenteId}&proveedor=${R}`)}async function x(){r.value=!0,i.value="";try{await se.post(te("/umind/conexiones/imap"),{agente_id:n.agenteId,email:u.value.email,password:u.value.password,host:a.value?u.value.host:"",puerto:a.value?Number(u.value.puerto):0,encriptado:u.value.encriptado}),o.value=!1,u.value={email:"",password:"",host:"",puerto:993,encriptado:"ssl"},a.value=!1,s("recargar")}catch(R){i.value=R.message,!a.value&&/conexión|conectar|resolver/i.test(R.message)&&(a.value=!0)}finally{r.value=!1}}async function S(R){d.value=R.ID,c.value={...c.value,[R.ID]:null};try{const O=await se.post(te(`/umind/conexiones/${R.ID}/probar`),{});c.value={...c.value,[R.ID]:{ok:!0,texto:O.message}}}catch(O){c.value={...c.value,[R.ID]:{ok:!1,texto:O.message}}}finally{d.value=null}}async function C(R){confirm(`¿Desconectar la cuenta ${R.email||R.proveedor}?`)&&(await se.del(te(`/umind/conexiones/${R.ID}`)),s("recargar"))}return(R,O)=>(h(),w("div",null,[O[15]||(O[15]=l("p",{class:"label mb-4"},[Z(" Las casillas que el agente puede consultar cuando se lo pedís — por ejemplo: "),l("em",null,"«revisame los correos de hoy y haceme un resumen»"),Z(". Solo lectura: nunca marca nada como leído ni manda nada. Podés conectar varias. ")],-1)),l("div",xf,[l("button",{class:"border border-borde hover:border-brand text-sm font-medium px-4 py-2 rounded-lg text-gray-700 dark:text-gray-200 transition-colors",onClick:O[0]||(O[0]=$=>p("google"))}," Conectar Google "),l("button",{class:"border border-borde hover:border-brand text-sm font-medium px-4 py-2 rounded-lg text-gray-700 dark:text-gray-200 transition-colors",onClick:O[1]||(O[1]=$=>p("microsoft"))}," Conectar Outlook "),l("button",{class:"btn-primary",onClick:O[2]||(O[2]=$=>o.value=!o.value)}," + Casilla propia ")]),o.value?(h(),w("form",{key:0,class:"card p-4 mb-4 space-y-3",onSubmit:Ae(x,["prevent"])},[l("div",yf,[l("div",null,[O[8]||(O[8]=l("label",{class:"label"},"Correo",-1)),z(l("input",{"onUpdate:modelValue":O[3]||(O[3]=$=>u.value.email=$),type:"email",required:"",placeholder:"ventas@tunegocio.com",class:"input"},null,512),[[ie,u.value.email]])]),l("div",null,[O[9]||(O[9]=l("label",{class:"label"},"Contraseña",-1)),z(l("input",{"onUpdate:modelValue":O[4]||(O[4]=$=>u.value.password=$),type:"password",autocomplete:"new-password",required:"",class:"input"},null,512),[[ie,u.value.password]])])]),a.value?(h(),w("div",_f,[l("div",null,[O[10]||(O[10]=l("label",{class:"label"},"Servidor IMAP",-1)),z(l("input",{"onUpdate:modelValue":O[5]||(O[5]=$=>u.value.host=$),placeholder:"mail.tunegocio.com",class:"input font-mono"},null,512),[[ie,u.value.host]])]),l("div",null,[O[11]||(O[11]=l("label",{class:"label"},"Puerto",-1)),z(l("input",{"onUpdate:modelValue":O[6]||(O[6]=$=>u.value.puerto=$),type:"number",class:"input"},null,512),[[ie,u.value.puerto]])]),l("div",null,[O[13]||(O[13]=l("label",{class:"label"},"Encriptación",-1)),z(l("select",{"onUpdate:modelValue":O[7]||(O[7]=$=>u.value.encriptado=$),class:"input"},[...O[12]||(O[12]=[l("option",{value:"ssl"},"SSL (993)",-1),l("option",{value:"starttls"},"STARTTLS (143)",-1)])],512),[[Ht,u.value.encriptado]])])])):B("",!0),i.value?(h(),w("p",wf,E(i.value),1)):B("",!0),l("div",kf,[O[14]||(O[14]=l("p",{class:"text-xs text-tenue"}," Se prueba la conexión antes de guardar. Gmail y Outlook van por sus botones de arriba. ",-1)),l("button",{type:"submit",class:"btn-primary",disabled:r.value},E(r.value?"Probando…":"Conectar"),9,$f)])],32)):B("",!0),l("div",Cf,[e.conexiones.length===0?(h(),_e(lt,{key:0,titulo:"Sin cuentas conectadas",detalle:"Conectá una casilla y vas a poder pedirle al agente que te revise el correo y te lo resuma, sin abrir el webmail."})):B("",!0),(h(!0),w(X,null,xe(e.conexiones,$=>(h(),w("div",{key:$.ID,class:"p-4"},[l("div",Af,[l("div",Sf,[l("span",Ef,E($.email),1),l("span",If,E(m($.proveedor)),1),l("span",{class:ue(["ml-2 px-1.5 py-0.5 rounded text-xs",$.activo?"badge-ok":"badge-neutro"])},E($.activo?"activa":"inactiva"),3),c.value[$.ID]?(h(),w("p",{key:0,class:ue(["text-xs mt-1",c.value[$.ID].ok?"text-brand":"text-red-600 dark:text-red-400"])},E(c.value[$.ID].texto),3)):B("",!0)]),l("div",Rf,[$.proveedor==="imap"?(h(),w("button",{key:0,class:"text-brand hover:underline disabled:opacity-40",disabled:d.value===$.ID,onClick:g=>S($)},E(d.value===$.ID?"Probando…":"Probar"),9,Pf)):B("",!0),l("button",{class:"text-red-500 hover:text-red-700",onClick:g=>C($)},"Desconectar",8,Tf)])])]))),128))])]))}},Df={class:"card p-4 flex flex-col h-[28rem]"},Mf={class:"flex-1 overflow-y-auto space-y-2 mb-3"},Nf={key:0,class:"text-sm text-tenue"},Vf={key:1,class:"flex items-center gap-2"},jf=["disabled"],xr={__name:"TabChat",props:{agenteId:{type:Number,required:!0}},setup(e){const t=e,n=`staff-preview-${Math.random().toString(36).slice(2)}`,s=L([]),o=L(""),r=L(!1);async function i(){const a=o.value.trim();if(!(!a||r.value)){o.value="",s.value.push({role:"user",content:a}),r.value=!0;try{const u=await se.post(te("/umind/chat"),{agente_id:t.agenteId,session_id:n,mensaje:a});s.value.push({role:"assistant",content:u.respuesta})}catch(u){s.value.push({role:"assistant",content:`⚠ ${u.message}`})}finally{r.value=!1}}}return(a,u)=>(h(),w("div",Df,[l("div",Mf,[s.value.length===0?(h(),w("p",Nf," Probá este agente tal cual lo va a ver un visitante — usa la misma config de IA, las mismas herramientas y la misma base de conocimiento. ")):B("",!0),(h(!0),w(X,null,xe(s.value,(d,c)=>(h(),w("div",{key:c,class:ue(["max-w-[80%] px-3 py-2 rounded-lg text-sm whitespace-pre-wrap",d.role==="user"?"bg-brand text-white ml-auto":"bg-elevado text-texto"])},E(d.content),3))),128)),r.value?(h(),w("div",Vf,[oe(Nn,{estado:"pensando",tam:30,class:"text-brand"}),u[1]||(u[1]=l("span",{class:"text-xs text-tenue"},"Pensando…",-1))])):B("",!0)]),l("form",{class:"flex gap-2",onSubmit:Ae(i,["prevent"])},[z(l("input",{"onUpdate:modelValue":u[0]||(u[0]=d=>o.value=d),placeholder:"Escribí un mensaje de prueba...",class:"flex-1 input"},null,512),[[ie,o.value]]),l("button",{type:"submit",disabled:r.value,class:"btn-primary disabled:opacity-50 transition-colors"}," Enviar ",8,jf)],32)]))}},Uf={class:"grid lg:grid-cols-[minmax(16rem,22rem)_1fr] gap-4 items-start"},Lf={class:"card divide-y divide-borde max-h-[30rem] overflow-y-auto"},Ff=["onClick"],qf={class:"text-sm text-texto line-clamp-2"},Hf={class:"flex items-center gap-2 mt-1.5 text-xs text-tenue"},Bf={class:"tabular-nums"},Gf={class:"ml-auto tabular-nums"},Wf={key:2,class:"flex items-center gap-2 p-3 text-xs text-tenue cursor-pointer select-none"},Kf={class:"card p-4 max-h-[30rem] overflow-y-auto"},zf={key:1,class:"text-sm text-tenue"},Qf={key:2,class:"space-y-2"},Jf={__name:"TabConversaciones",props:{agenteId:{type:Number,required:!0},sesiones:{type:Array,default:()=>[]}},setup(e){const t=e,n=L([]),s=L(null),o=L(!1);function r(p){const x=String(p||"");return x.startsWith("wa:")?{nombre:"WhatsApp",icono:"mensaje",clase:"badge-ok"}:x.startsWith("tg:")?{nombre:"Telegram",icono:"mensaje",clase:"badge-neutro"}:x.startsWith("staff-preview")?{nombre:"Prueba",icono:"escribir",clase:"badge-alerta"}:{nombre:"Tu web",icono:"sitio",clase:"badge-neutro"}}const i=L(!1),a=le(()=>t.sesiones.filter(p=>!String(p.session_id).startsWith("staff-preview"))),u=le(()=>t.sesiones.filter(p=>String(p.session_id).startsWith("staff-preview"))),d=le(()=>i.value?t.sesiones:a.value);function c(p){if(!p)return"";const x=new Date(p),C=Math.floor((new Date().setHours(0,0,0,0)-new Date(x).setHours(0,0,0,0))/864e5),R=new Date(p).toLocaleTimeString("es",{hour:"2-digit",minute:"2-digit"});return C<=0?`hoy ${R}`:C===1?`ayer ${R}`:C<7?`hace ${C} días`:new Date(p).toLocaleDateString("es",{day:"numeric",month:"short"})}async function m(p){s.value=p,o.value=!0;try{const x=await se.get(te(`/umind/historial?agente_id=${t.agenteId}&session_id=${p}`));n.value=x.items||[]}finally{o.value=!1}}return(p,x)=>(h(),w("div",Uf,[l("div",Lf,[d.value.length===0&&u.value.length===0?(h(),_e(lt,{key:0,titulo:"Nadie escribió todavía",detalle:"Cuando alguien le hable a tu asistente —por WhatsApp, Telegram o tu web— la conversación aparece acá, con lo que preguntó y lo que se le respondió."})):d.value.length===0?(h(),_e(lt,{key:1,estado:"durmiendo",titulo:"Ningún cliente escribió todavía",detalle:`Hay ${u.value.length} ${u.value.length===1?"conversación de prueba tuya":"conversaciones de prueba tuyas"} — activá el filtro de abajo para verlas.`},null,8,["detalle"])):B("",!0),(h(!0),w(X,null,xe(d.value,S=>(h(),w("button",{key:S.session_id,class:ue(["w-full text-left p-3 hover:bg-elevado transition-colors",s.value===S.session_id?"bg-gray-50 dark:bg-gray-800":""]),onClick:C=>m(S.session_id)},[l("div",qf,E(S.primer_mensaje||"(sin mensaje)"),1),l("div",Hf,[l("span",{class:ue(["px-1.5 py-0.5 rounded",r(S.session_id).clase])},E(r(S.session_id).nombre),3),l("span",Bf,E(S.mensajes)+" msj",1),l("span",Gf,E(c(S.ultimo)),1)])],10,Ff))),128)),u.value.length?(h(),w("label",Wf,[z(l("input",{"onUpdate:modelValue":x[0]||(x[0]=S=>i.value=S),type:"checkbox",class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[_t,i.value]]),Z(" "+E(u.value.length===1?"Mostrar mi prueba":`Mostrar mis ${u.value.length} pruebas`),1)])):B("",!0)]),l("div",Kf,[s.value?o.value?(h(),w("p",zf,"Cargando…")):(h(),w("div",Qf,[(h(!0),w(X,null,xe(n.value,S=>(h(),w("div",{key:S.ID,class:ue(S.role==="user"?"text-right":"")},[l("div",{class:ue(["inline-block max-w-[80%] px-3 py-2 rounded-lg text-sm text-left whitespace-pre-wrap",S.role==="user"?"bg-brand text-white":"bg-elevado text-texto"])},E(S.content),3),l("div",{class:ue(["text-[10px] text-tenue mt-0.5 tabular-nums",S.role==="user"?"pr-1":"pl-1"])},E(c(S.CreatedAt)),3)],2))),128))])):(h(),_e(lt,{key:0,estado:"normal",titulo:"Elegí una conversación",detalle:"Vas a ver el intercambio completo: lo que escribió la persona y lo que contestó tu asistente. Si una respuesta no te gusta, corregí su información en «Lo que sabe»."}))])]))}},Yf={class:"card divide-y divide-borde"},Zf={class:"text-sm text-texto font-mono"},Xf={class:"label mt-0.5"},ep={class:"text-xs text-tenue mt-0.5"},tp={key:0,class:"ml-1 text-green-600 dark:text-green-400"},np={key:1,class:"ml-1 text-gray-400"},sp={class:"flex gap-3 text-sm shrink-0"},op=["onClick"],rp=["onClick"],lp={class:"card p-6 w-full max-w-xl max-h-[85vh] overflow-y-auto"},ip={class:"font-semibold text-texto mb-4"},ap={class:"border border-borde rounded-lg p-3 space-y-2"},up=["onUpdate:modelValue"],cp=["onUpdate:modelValue"],dp=["onUpdate:modelValue"],fp={class:"label flex items-center gap-1"},pp=["onUpdate:modelValue"],mp=["onClick"],vp={key:0,class:"text-xs text-gray-400"},hp={class:"border border-borde rounded-lg p-3 space-y-2"},gp={class:"flex items-center gap-2 label"},bp={class:"flex items-center gap-2 text-sm text-texto"},xp={class:"flex justify-end gap-2 pt-2"},yp={__name:"TabHerramientas",props:{agenteId:{type:Number,required:!0},tools:{type:Array,default:()=>[]}},emits:["recargar","error"],setup(e,{emit:t}){const n=e,s=t,o=L(!1),r=L(null),i=L(a());function a(){return{nombre:"",descripcion:"",url:"",auth_header_nombre:"",auth_header_valor:"",tocarAuth:!1,parametros:[],activa:!0}}function u(){r.value=null,i.value=a(),o.value=!0}function d(S){r.value=S;let C=[];try{C=JSON.parse(S.parametros_json||"[]")||[]}catch{C=[]}i.value={nombre:S.nombre,descripcion:S.descripcion,url:S.url,auth_header_nombre:S.auth_header_nombre,auth_header_valor:"",tocarAuth:!1,parametros:C,activa:S.activa},o.value=!0}function c(){i.value.parametros.push({nombre:"",tipo:"string",descripcion:"",requerido:!1})}function m(S){i.value.parametros.splice(S,1)}async function p(){const S={agente_id:n.agenteId,nombre:i.value.nombre.trim(),descripcion:i.value.descripcion,url:i.value.url.trim(),auth_header_nombre:i.value.auth_header_nombre,parametros:i.value.parametros,activa:i.value.activa};i.value.tocarAuth&&(S.auth_header_valor=i.value.auth_header_valor);try{r.value?await se.put(te(`/umind/tools/${r.value.ID}`),S):await se.post(te("/umind/tools"),S),o.value=!1,s("recargar")}catch(C){s("error",C.message)}}async function x(S){confirm(`¿Eliminar la herramienta "${S.nombre}"?`)&&(await se.del(te(`/umind/tools/${S.ID}`)),s("recargar"))}return(S,C)=>(h(),w("div",null,[l("div",{class:"flex justify-between items-center mb-4"},[C[9]||(C[9]=l("p",{class:"label"},"Máximo 10 herramientas activas por agente.",-1)),l("button",{class:"btn-primary",onClick:u}," + Nueva herramienta ")]),l("div",Yf,[e.tools.length===0?(h(),_e(lt,{key:0,titulo:"Sin herramientas conectadas",detalle:"Las herramientas le dejan consultar tus sistemas mientras conversa: stock, estado de un pedido, disponibilidad de turnos. Sin ninguna, responde solo con lo que tiene cargado."})):B("",!0),(h(!0),w(X,null,xe(e.tools,R=>(h(),w("div",{key:R.ID,class:"p-4 flex items-center justify-between"},[l("div",null,[l("div",Zf,E(R.nombre),1),l("div",Xf,E(R.descripcion),1),l("div",ep,[Z(E(R.url)+" ",1),R.auth_configurado?(h(),w("span",tp,"· auth configurada")):B("",!0),R.activa?B("",!0):(h(),w("span",np,"· inactiva"))])]),l("div",sp,[l("button",{class:"text-tenue hover:text-gray-800 dark:hover:text-gray-100",onClick:O=>d(R)},"Editar",8,op),l("button",{class:"text-red-500 hover:text-red-700",onClick:O=>x(R)},"Eliminar",8,rp)])]))),128))]),o.value?(h(),w("div",{key:0,class:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center p-4 z-50",onClick:C[8]||(C[8]=Ae(R=>o.value=!1,["self"]))},[l("div",lp,[l("h2",ip,E(r.value?"Editar herramienta":"Nueva herramienta"),1),l("form",{class:"space-y-3",onSubmit:Ae(p,["prevent"])},[l("div",null,[C[10]||(C[10]=l("label",{class:"label"},"Nombre (identificador, ej: consultar_stock)",-1)),z(l("input",{"onUpdate:modelValue":C[0]||(C[0]=R=>i.value.nombre=R),required:"",pattern:"[a-z][a-z0-9_]{2,63}",class:"input font-mono"},null,512),[[ie,i.value.nombre]])]),l("div",null,[C[11]||(C[11]=l("label",{class:"label"},"Descripción (esto lo lee el modelo para decidir cuándo usarla)",-1)),z(l("textarea",{"onUpdate:modelValue":C[1]||(C[1]=R=>i.value.descripcion=R),rows:"2",required:"",class:"input"},null,512),[[ie,i.value.descripcion]])]),l("div",null,[C[12]||(C[12]=l("label",{class:"label"},"URL del webhook (https)",-1)),z(l("input",{"onUpdate:modelValue":C[2]||(C[2]=R=>i.value.url=R),type:"url",required:"",placeholder:"https://...",class:"input"},null,512),[[ie,i.value.url]])]),l("div",ap,[l("div",{class:"flex items-center justify-between"},[C[13]||(C[13]=l("label",{class:"label"},"Parámetros que completa el modelo",-1)),l("button",{type:"button",class:"text-xs text-brand",onClick:c},"+ agregar")]),(h(!0),w(X,null,xe(i.value.parametros,(R,O)=>(h(),w("div",{key:O,class:"flex gap-2 items-center"},[z(l("input",{"onUpdate:modelValue":$=>R.nombre=$,placeholder:"nombre",class:"flex-1 border border-borde bg-white dark:bg-gray-800 text-texto rounded px-2 py-1 text-xs font-mono"},null,8,up),[[ie,R.nombre]]),z(l("select",{"onUpdate:modelValue":$=>R.tipo=$,class:"border border-borde bg-white dark:bg-gray-800 text-texto rounded px-2 py-1 text-xs"},[...C[14]||(C[14]=[l("option",{value:"string"},"string",-1),l("option",{value:"number"},"number",-1),l("option",{value:"boolean"},"boolean",-1)])],8,cp),[[Ht,R.tipo]]),z(l("input",{"onUpdate:modelValue":$=>R.descripcion=$,placeholder:"descripción",class:"flex-1 border border-borde bg-white dark:bg-gray-800 text-texto rounded px-2 py-1 text-xs"},null,8,dp),[[ie,R.descripcion]]),l("label",fp,[z(l("input",{"onUpdate:modelValue":$=>R.requerido=$,type:"checkbox"},null,8,pp),[[_t,R.requerido]]),C[15]||(C[15]=Z(" req. ",-1))]),l("button",{type:"button",class:"text-red-400 text-xs",onClick:$=>m(O)},[oe(Oe,{nombre:"cerrar",tam:13})],8,mp)]))),128)),i.value.parametros.length===0?(h(),w("p",vp,"Sin parámetros.")):B("",!0)]),l("div",hp,[C[16]||(C[16]=l("label",{class:"label"},"Autenticación saliente (opcional)",-1)),z(l("input",{"onUpdate:modelValue":C[3]||(C[3]=R=>i.value.auth_header_nombre=R),placeholder:"Nombre del header, ej: Authorization",class:"input"},null,512),[[ie,i.value.auth_header_nombre]]),l("label",gp,[z(l("input",{"onUpdate:modelValue":C[4]||(C[4]=R=>i.value.tocarAuth=R),type:"checkbox"},null,512),[[_t,i.value.tocarAuth]]),Z(" "+E(r.value?"Cambiar el valor del secreto":"Configurar valor"),1)]),i.value.tocarAuth?z((h(),w("input",{key:0,"onUpdate:modelValue":C[5]||(C[5]=R=>i.value.auth_header_valor=R),type:"password",placeholder:"Valor del header (ej: Bearer xxxx)",class:"input"},null,512)),[[ie,i.value.auth_header_valor]]):B("",!0)]),l("label",bp,[z(l("input",{"onUpdate:modelValue":C[6]||(C[6]=R=>i.value.activa=R),type:"checkbox"},null,512),[[_t,i.value.activa]]),C[17]||(C[17]=Z(" Activa ",-1))]),l("div",xp,[l("button",{type:"button",class:"btn-ghost",onClick:C[7]||(C[7]=R=>o.value=!1)},"Cancelar"),C[18]||(C[18]=l("button",{type:"submit",class:"btn-primary"},"Guardar",-1))])],32)])])):B("",!0)]))}},_p={class:"card p-4 mb-4"},wp={class:"flex items-center justify-between mb-2"},kp={class:"bg-elevado border border-borde rounded-lg p-2.5 text-xs text-texto overflow-x-auto"},$p={class:"card divide-y divide-borde"},Cp={class:"flex items-center justify-between"},Ap={class:"font-medium text-texto capitalize"},Sp={class:"flex gap-3 text-sm"},Ep=["onClick"],Ip=["onClick"],Rp={class:"flex gap-4 mt-2 text-xs"},Pp={class:"flex items-center gap-1.5 text-texto cursor-pointer"},Tp=["checked","onChange"],Op={class:"flex items-center gap-1.5 text-texto cursor-pointer"},Dp=["checked","onChange"],Mp={class:"flex items-center gap-1.5 text-texto cursor-pointer"},Np=["checked","onChange"],Vp={key:0,class:"label mt-1"},jp={key:1,class:"label mt-1 break-all"},Up={class:"bg-elevado px-1 rounded"},Lp={key:2,class:"text-xs text-tenue mt-1"},Fp={key:3,class:"text-xs text-red-600 dark:text-red-400 mt-1"},qp={class:"card p-6 w-full max-w-md"},Hp={key:0},Bp={class:"grid sm:grid-cols-2 gap-3"},Gp={class:"flex flex-col gap-1.5 mt-1"},Wp={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},Kp={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},zp={class:"text-xs text-tenue"},Qp={class:"grid sm:grid-cols-2 gap-3 mt-2"},Jp={class:"flex flex-col gap-2 pt-1"},Yp={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},Zp={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},Xp={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},em={class:"flex justify-end gap-2 pt-2"},tm={__name:"TabCanales",props:{agenteId:{type:Number,required:!0},siteKey:{type:String,default:""},canales:{type:Array,default:()=>[]}},emits:["recargar","error"],setup(e,{emit:t}){const n=e,s=t,o=L(!1),r=L(d()),i=L(!1),a=le(()=>{const $=n.siteKey||"TU_SITE_KEY";return` +