From 5086087e1b562bedc28a717523b2836b60c5f5f2 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Wed, 19 Aug 2026 18:28:15 -0500 Subject: [PATCH] feat(umind): duplicar un agente para usarlo como plantilla del siguiente MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit El catálogo de rubros da un arranque genérico, pero el mejor punto de partida para el segundo restaurante es el primero — el que ya tiene el conocimiento real, el tono ajustado y las herramientas andando. Ahora se puede copiar: se lleva conocimiento, tono, bienvenida, color, config de IA y herramientas. Tres cosas no se copian, y es a propósito: Los canales. Llevan las credenciales de una cuenta concreta de WhatsApp o Telegram; copiarlas haría que dos agentes contesten por el mismo número. Las claves de las herramientas. Son secretos de un tercero, atados a una cuenta. La copia llega sin ellas y, si la herramienta las necesitaba, llega desactivada — para que la falta se note al configurarla y no cuando un cliente recibe un error. La site_key. Es la identidad pública del widget y tiene índice único: compartirla sería servir dos agentes distintos bajo el mismo nombre. El conocimiento se rehace desde cero en vez de copiar los vectores. Es más lento, pero los chunks viejos pueden venir de otro modelo de embeddings, y mezclar vectores de modelos distintos rompe la comparación por similitud — la búsqueda devolvería cualquier cosa. Permisos: se verifica el acceso al agente de origen y también al tenant destino. Copiar es crear, y crear en un tenant ajeno tampoco corresponde. Co-Authored-By: Claude Opus 5 --- orchestrator/src/views/TenantAgentes.vue | 23 ++++ pkg/services/umind_duplicar_agente.go | 126 +++++++++++++++++++ pkg/services/umind_duplicar_agente_test.go | 56 +++++++++ public/orchestrator/assets/index-CRnmvnlL.js | 26 ++++ public/orchestrator/assets/index-CbSZEemk.js | 26 ---- public/orchestrator/index.html | 2 +- rest/controllers/umind_admin_controller.go | 48 +++++++ rest/routes/umind.go | 1 + 8 files changed, 281 insertions(+), 27 deletions(-) create mode 100644 pkg/services/umind_duplicar_agente.go create mode 100644 pkg/services/umind_duplicar_agente_test.go create mode 100644 public/orchestrator/assets/index-CRnmvnlL.js delete mode 100644 public/orchestrator/assets/index-CbSZEemk.js diff --git a/orchestrator/src/views/TenantAgentes.vue b/orchestrator/src/views/TenantAgentes.vue index cfa6a97..49217cf 100644 --- a/orchestrator/src/views/TenantAgentes.vue +++ b/orchestrator/src/views/TenantAgentes.vue @@ -93,6 +93,24 @@ async function cargar() { } } +// Un agente que ya funciona es la mejor plantilla del siguiente: el catálogo de +// rubros da un arranque genérico, esto copia uno real con su conocimiento. +async function duplicarAgente(a) { + const nombre = prompt(`Nombre de la copia de "${a.nombre}":`, `${a.nombre} (copia)`) + if (nombre === null) return + error.value = '' + try { + const r = await api.post(apiUmind(`/umind/agentes/${a.ID}/duplicar`), { + tenant_id: Number(tenantId.value), + nombre: nombre.trim(), + }) + await cargar() + if (r.aviso) alert(r.aviso) + } catch (e) { + error.value = e.message + } +} + function nuevoAgente() { editing.value = null form.value = vacio() @@ -225,6 +243,11 @@ watch(() => props.id, cargar, { immediate: true })
+
diff --git a/pkg/services/umind_duplicar_agente.go b/pkg/services/umind_duplicar_agente.go new file mode 100644 index 0000000..a6116af --- /dev/null +++ b/pkg/services/umind_duplicar_agente.go @@ -0,0 +1,126 @@ +package services + +import ( + "fmt" + "log" + + "github.com/sujit-baniya/fiber-boilerplate/pkg/models" +) + +// DuplicarAgente crea una copia de un agente en el tenant indicado, con su +// conocimiento y sus herramientas. +// +// Es lo que convierte a un agente bien configurado en la plantilla de los que +// vengan después: el catálogo de rubros da un punto de partida genérico, pero +// el mejor punto de partida para el segundo restaurante es el primero. +// +// Lo que NO se copia, y por qué: +// - Los canales (WhatsApp, Telegram): llevan credenciales de una cuenta +// concreta. Copiarlas haría que dos agentes contesten por el mismo número. +// - Las conversaciones: son de los clientes del otro negocio. +// - El valor de los headers de auth de las herramientas: es un secreto de un +// tercero, atado a una cuenta. La herramienta se copia sin él, para que +// quien reciba la copia lo cargue. +func DuplicarAgente(origenID, tenantDestino uint, nombreNuevo string) (*models.UmindAgente, error) { + origen, err := models.GetUmindAgenteByID(origenID) + if err != nil { + return nil, fmt.Errorf("el agente que querés copiar no existe: %w", err) + } + if tenantDestino == 0 { + tenantDestino = origen.TenantID + } + if nombreNuevo == "" { + nombreNuevo = origen.Nombre + " (copia)" + } + + copia := &models.UmindAgente{ + TenantID: tenantDestino, + Nombre: nombreNuevo, + AiConfigID: origen.AiConfigID, + Tono: origen.Tono, + MensajeBienvenida: origen.MensajeBienvenida, + Color: origen.Color, + Activo: true, + // SiteKey se genera sola en CreateUmindAgente: es la llave pública del + // widget y tiene índice único, compartirla sería servir dos agentes + // distintos bajo la misma identidad. + } + if err := models.CreateUmindAgente(copia); err != nil { + return nil, fmt.Errorf("no se pudo crear la copia: %w", err) + } + + go copiarConocimiento(origen.ID, copia.ID) + copiarHerramientas(origen.ID, copia.ID) + + return copia, nil +} + +// copiarConocimiento rehace las fuentes en el agente nuevo. Se vuelven a +// generar los embeddings en vez de copiar los vectores: es más lento, pero los +// chunks viejos pueden venir de un modelo de embeddings distinto al actual, y +// mezclarlos rompe la comparación por similitud. +func copiarConocimiento(origenID, destinoID uint) { + docs, err := models.GetUmindDocumentosByAgente(origenID) + if err != nil { + log.Printf("[UMIND] No se pudo leer el conocimiento del agente %d: %v", origenID, err) + return + } + + copiados := 0 + for _, d := range docs { + nuevo := &models.UmindDocumento{ + AgenteID: destinoID, + Tipo: d.Tipo, + Origen: d.Origen, + Contenido: d.Contenido, + MaxPaginas: d.MaxPaginas, + AutoActualizar: d.AutoActualizar, + Estado: "procesando", + } + if err := models.CreateUmindDocumento(nuevo); err != nil { + log.Printf("[UMIND] No se pudo copiar la fuente %q: %v", d.Origen, err) + continue + } + + switch { + case d.Tipo == "url": + IngestarAgente(destinoID, nuevo.ID, d.Origen, d.MaxPaginas) + case d.Contenido != "": + IngestarTexto(destinoID, nuevo.ID, d.Contenido) + default: + // Fuentes cargadas antes de que se guardara su texto: no hay de + // dónde rehacerlas sin el archivo original. + _ = models.UpdateUmindDocumentoEstado(nuevo.ID, "error", + "esta fuente se copió de un agente donde no quedó guardado su texto: volvé a subirla", 0) + continue + } + copiados++ + } + log.Printf("[UMIND] Agente %d copiado desde %d: %d de %d fuentes", destinoID, origenID, copiados, len(docs)) +} + +// copiarHerramientas replica las tools sin su secreto de autenticación. +func copiarHerramientas(origenID, destinoID uint) { + tools, err := models.GetUmindHerramientasByAgente(origenID) + if err != nil { + log.Printf("[UMIND] No se pudieron leer las herramientas del agente %d: %v", origenID, err) + return + } + for _, t := range tools { + nueva := &models.UmindHerramienta{ + AgenteID: destinoID, + Nombre: t.Nombre, + Descripcion: t.Descripcion, + ParametrosJSON: t.ParametrosJSON, + URL: t.URL, + AuthHeaderNombre: t.AuthHeaderNombre, + // AuthHeaderValorEnc queda vacío a propósito: es la credencial de + // una cuenta concreta. La copia arranca desactivada si la + // necesitaba, para que nadie descubra que faltaba en producción. + Activa: t.Activa && (t.AuthHeaderNombre == "" || t.AuthHeaderValorEnc == ""), + } + if err := models.CreateUmindHerramienta(nueva); err != nil { + log.Printf("[UMIND] No se pudo copiar la herramienta %q: %v", t.Nombre, err) + } + } +} diff --git a/pkg/services/umind_duplicar_agente_test.go b/pkg/services/umind_duplicar_agente_test.go new file mode 100644 index 0000000..b39a668 --- /dev/null +++ b/pkg/services/umind_duplicar_agente_test.go @@ -0,0 +1,56 @@ +package services + +import ( + "strings" + "testing" + + "github.com/sujit-baniya/fiber-boilerplate/pkg/models" +) + +// Copiar una herramienta con su header de auth le daría al dueño del agente +// nuevo la credencial de un tercero que no es suya. La copia tiene que llegar +// sin el secreto — y desactivada, para que la falta se note al configurarla y +// no cuando un cliente recibe un error. +func TestLaCopiaDeHerramientaNoArrastraElSecreto(t *testing.T) { + casos := []struct { + nombre string + headerNombre string + headerValor string + activaOrigen bool + activaEsperada bool + }{ + {"con auth: llega desactivada", "Authorization", "cifrado-xyz", true, false}, + {"sin auth: conserva su estado", "", "", true, true}, + {"sin auth y desactivada: sigue desactivada", "", "", false, false}, + } + + for _, c := range casos { + origen := models.UmindHerramienta{ + Nombre: "consultar_stock", + AuthHeaderNombre: c.headerNombre, + AuthHeaderValorEnc: c.headerValor, + Activa: c.activaOrigen, + } + // Misma expresión que usa copiarHerramientas. + activa := origen.Activa && (origen.AuthHeaderNombre == "" || origen.AuthHeaderValorEnc == "") + if activa != c.activaEsperada { + t.Errorf("%s: activa = %v, esperaba %v", c.nombre, activa, c.activaEsperada) + } + } +} + +// El nombre por defecto tiene que distinguir la copia del original: dos +// agentes con el mismo nombre en la misma lista no se pueden diferenciar. +func TestNombrePorDefectoDeLaCopia(t *testing.T) { + nombreNuevo := "" + original := "Ventas" + if nombreNuevo == "" { + nombreNuevo = original + " (copia)" + } + if nombreNuevo == original { + t.Error("la copia no puede llamarse igual que el original") + } + if !strings.Contains(nombreNuevo, original) { + t.Errorf("el nombre de la copia debería reconocerse: %q", nombreNuevo) + } +} diff --git a/public/orchestrator/assets/index-CRnmvnlL.js b/public/orchestrator/assets/index-CRnmvnlL.js new file mode 100644 index 0000000..2edd06d --- /dev/null +++ b/public/orchestrator/assets/index-CRnmvnlL.js @@ -0,0 +1,26 @@ +(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 to(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const be={},on=[],xt=()=>{},xr=()=>!1,cs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),fs=e=>e.startsWith("onUpdate:"),Ue=Object.assign,no=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Ki=Object.prototype.hasOwnProperty,ge=(e,t)=>Ki.call(e,t),X=Array.isArray,rn=e=>Un(e)==="[object Map]",vn=e=>Un(e)==="[object Set]",Eo=e=>Un(e)==="[object Date]",te=e=>typeof e=="function",Oe=e=>typeof e=="string",ct=e=>typeof e=="symbol",ve=e=>e!==null&&typeof e=="object",_r=e=>(ve(e)||te(e))&&te(e.then)&&te(e.catch),yr=Object.prototype.toString,Un=e=>yr.call(e),qi=e=>Un(e).slice(8,-1),wr=e=>Un(e)==="[object Object]",so=e=>Oe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,En=to(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ds=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Gi=/-\w/g,Ye=ds(e=>e.replace(Gi,t=>t.slice(1).toUpperCase())),Wi=/\B([A-Z])/g,en=ds(e=>e.replace(Wi,"-$1").toLowerCase()),ps=ds(e=>e.charAt(0).toUpperCase()+e.slice(1)),As=ds(e=>e?`on${ps(e)}`:""),bt=(e,t)=>!Object.is(e,t),Xn=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},hs=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let So;const ms=()=>So||(So=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Zt(e){if(X(e)){const t={};for(let n=0;n{if(n){const s=n.split(Ji);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Ie(e){let t="";if(Oe(e))t=e;else if(X(e))for(let n=0;nKt(n,t))}const Sr=e=>!!(e&&e.__v_isRef===!0),P=e=>Oe(e)?e:e==null?"":X(e)||ve(e)&&(e.toString===yr||!te(e.toString))?Sr(e)?P(e.value):JSON.stringify(e,Ar,2):String(e),Ar=(e,t)=>Sr(t)?Ar(e,t.value):rn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],r)=>(n[ks(s,r)+" =>"]=o,n),{})}:vn(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ks(n))}:ct(t)?ks(t):ve(t)&&!X(t)&&!wr(t)?String(t):t,ks=(e,t="")=>{var n;return ct(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 Ve;class tl{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&&Ve&&(Ve.active?(this.parent=Ve,this.index=(Ve.scopes||(Ve.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(Ve===this)Ve=this.prevScope;else{let t=Ve;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(An){let t=An;for(An=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Sn;){let t=Sn;for(Sn=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 Or(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),lo(s),sl(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function Fs(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Tr(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Tr(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Pn)||(e.globalVersion=Pn,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Fs(e))))return;e.flags|=2;const t=e.dep,n=_e,s=at;_e=e,at=!0;try{Pr(e);const o=e.fn(e._value);(t.version===0||bt(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{_e=n,at=s,Or(e),e.flags&=-3}}function lo(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)lo(r,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function sl(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let at=!0;const $r=[];function Tt(){$r.push(at),at=!1}function $t(){const e=$r.pop();at=e===void 0?!0:e}function Ao(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=_e;_e=void 0;try{t()}finally{_e=n}}}let Pn=0;class ol{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 ao{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(!_e||!at||_e===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==_e)n=this.activeLink=new ol(_e,this),_e.deps?(n.prevDep=_e.depsTail,_e.depsTail.nextDep=n,_e.depsTail=n):_e.deps=_e.depsTail=n,Nr(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=_e.depsTail,n.nextDep=void 0,_e.depsTail.nextDep=n,_e.depsTail=n,_e.deps===n&&(_e.deps=s)}return n}trigger(t){this.version++,Pn++,this.notify(t)}notify(t){ro();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{io()}}}function Nr(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)Nr(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Hs=new WeakMap,Yt=Symbol(""),Bs=Symbol(""),On=Symbol("");function He(e,t,n){if(at&&_e){let s=Hs.get(e);s||Hs.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new ao),o.map=s,o.key=n),o.track()}}function Rt(e,t,n,s,o,r){const i=Hs.get(e);if(!i){Pn++;return}const l=a=>{a&&a.trigger()};if(ro(),t==="clear")i.forEach(l);else{const a=X(e),d=a&&so(n);if(a&&n==="length"){const c=Number(s);i.forEach((h,g)=>{(g==="length"||g===On||!ct(g)&&g>=c)&&l(h)})}else switch((n!==void 0||i.has(void 0))&&l(i.get(n)),d&&l(i.get(On)),t){case"add":a?d&&l(i.get("length")):(l(i.get(Yt)),rn(e)&&l(i.get(Bs)));break;case"delete":a||(l(i.get(Yt)),rn(e)&&l(i.get(Bs)));break;case"set":rn(e)&&l(i.get(Yt));break}}io()}function tn(e){const t=me(e);return t===e?t:(He(t,"iterate",On),it(e)?t:t.map(ft))}function gs(e){return He(e=me(e),"iterate",On),e}function gt(e,t){return Nt(e)?fn(Xt(e)?ft(t):t):ft(t)}const rl={__proto__:null,[Symbol.iterator](){return Is(this,Symbol.iterator,e=>gt(this,e))},concat(...e){return tn(this).concat(...e.map(t=>X(t)?tn(t):t))},entries(){return Is(this,"entries",e=>(e[1]=gt(this,e[1]),e))},every(e,t){return Ct(this,"every",e,t,void 0,arguments)},filter(e,t){return Ct(this,"filter",e,t,n=>n.map(s=>gt(this,s)),arguments)},find(e,t){return Ct(this,"find",e,t,n=>gt(this,n),arguments)},findIndex(e,t){return Ct(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Ct(this,"findLast",e,t,n=>gt(this,n),arguments)},findLastIndex(e,t){return Ct(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Ct(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ps(this,"includes",e)},indexOf(...e){return Ps(this,"indexOf",e)},join(e){return tn(this).join(e)},lastIndexOf(...e){return Ps(this,"lastIndexOf",e)},map(e,t){return Ct(this,"map",e,t,void 0,arguments)},pop(){return bn(this,"pop")},push(...e){return bn(this,"push",e)},reduce(e,...t){return ko(this,"reduce",e,t)},reduceRight(e,...t){return ko(this,"reduceRight",e,t)},shift(){return bn(this,"shift")},some(e,t){return Ct(this,"some",e,t,void 0,arguments)},splice(...e){return bn(this,"splice",e)},toReversed(){return tn(this).toReversed()},toSorted(e){return tn(this).toSorted(e)},toSpliced(...e){return tn(this).toSpliced(...e)},unshift(...e){return bn(this,"unshift",e)},values(){return Is(this,"values",e=>gt(this,e))}};function Is(e,t,n){const s=gs(e),o=s[t]();return s!==e&&!it(e)&&(o._next=o.next,o.next=()=>{const r=o._next();return r.done||(r.value=n(r.value)),r}),o}const il=Array.prototype;function Ct(e,t,n,s,o,r){const i=gs(e),l=i!==e&&!it(e),a=i[t];if(a!==il[t]){const h=a.apply(e,r);return l?ft(h):h}let d=n;i!==e&&(l?d=function(h,g){return n.call(this,gt(e,h),g,e)}:n.length>2&&(d=function(h,g){return n.call(this,h,g,e)}));const c=a.call(i,d,s);return l&&o?o(c):c}function ko(e,t,n,s){const o=gs(e),r=o!==e&&!it(e);let i=n,l=!1;o!==e&&(r?(l=s.length===0,i=function(d,c,h){return l&&(l=!1,d=gt(e,d)),n.call(this,d,gt(e,c),h,e)}):n.length>3&&(i=function(d,c,h){return n.call(this,d,c,h,e)}));const a=o[t](i,...s);return l?gt(e,a):a}function Ps(e,t,n){const s=me(e);He(s,"iterate",On);const o=s[t](...n);return(o===-1||o===!1)&&fo(n[0])?(n[0]=me(n[0]),s[t](...n)):o}function bn(e,t,n=[]){Tt(),ro();const s=me(e)[t].apply(e,n);return io(),$t(),s}const ll=to("__proto__,__v_isRef,__isVue"),Dr=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ct));function al(e){ct(e)||(e=String(e));const t=me(this);return He(t,"has",e),t.hasOwnProperty(e)}class Mr{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?bl:Lr:r?Ur:jr).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const i=X(t);if(!o){let a;if(i&&(a=rl[n]))return a;if(n==="hasOwnProperty")return al}const l=Reflect.get(t,n,Ke(t)?t:s);if((ct(n)?Dr.has(n):ll(n))||(o||He(t,"get",n),r))return l;if(Ke(l)){const a=i&&so(n)?l:l.value;return o&&ve(a)?qs(a):a}return ve(l)?o?qs(l):vs(l):l}}class Vr extends Mr{constructor(t=!1){super(!1,t)}set(t,n,s,o){let r=t[n];const i=X(t)&&so(n);if(!this._isShallow){const d=Nt(r);if(!it(s)&&!Nt(s)&&(r=me(r),s=me(s)),!i&&Ke(r)&&!Ke(s))return d||(r.value=s),!0}const l=i?Number(n)e,Gn=e=>Reflect.getPrototypeOf(e);function pl(e,t,n){return function(...s){const o=this.__v_raw,r=me(o),i=rn(r),l=e==="entries"||e===Symbol.iterator&&i,a=e==="keys"&&i,d=o[e](...s),c=n?Ks:t?fn:ft;return!t&&He(r,"iterate",a?Bs:Yt),Ue(Object.create(d),{next(){const{value:h,done:g}=d.next();return g?{value:h,done:g}:{value:l?[c(h[0]),c(h[1])]:c(h),done:g}}})}}function Wn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function hl(e,t){const n={get(o){const r=this.__v_raw,i=me(r),l=me(o);e||(bt(o,l)&&He(i,"get",o),He(i,"get",l));const{has:a}=Gn(i),d=t?Ks:e?fn:ft;if(a.call(i,o))return d(r.get(o));if(a.call(i,l))return d(r.get(l));r!==i&&r.get(o)},get size(){const o=this.__v_raw;return!e&&He(me(o),"iterate",Yt),o.size},has(o){const r=this.__v_raw,i=me(r),l=me(o);return e||(bt(o,l)&&He(i,"has",o),He(i,"has",l)),o===l?r.has(o):r.has(o)||r.has(l)},forEach(o,r){const i=this,l=i.__v_raw,a=me(l),d=t?Ks:e?fn:ft;return!e&&He(a,"iterate",Yt),l.forEach((c,h)=>o.call(r,d(c),d(h),i))}};return Ue(n,e?{add:Wn("add"),set:Wn("set"),delete:Wn("delete"),clear:Wn("clear")}:{add(o){const r=me(this),i=Gn(r),l=me(o),a=!t&&!it(o)&&!Nt(o)?l:o;return i.has.call(r,a)||bt(o,a)&&i.has.call(r,o)||bt(l,a)&&i.has.call(r,l)||(r.add(a),Rt(r,"add",a,a)),this},set(o,r){!t&&!it(r)&&!Nt(r)&&(r=me(r));const i=me(this),{has:l,get:a}=Gn(i);let d=l.call(i,o);d||(o=me(o),d=l.call(i,o));const c=a.call(i,o);return i.set(o,r),d?bt(r,c)&&Rt(i,"set",o,r):Rt(i,"add",o,r),this},delete(o){const r=me(this),{has:i,get:l}=Gn(r);let a=i.call(r,o);a||(o=me(o),a=i.call(r,o)),l&&l.call(r,o);const d=r.delete(o);return a&&Rt(r,"delete",o,void 0),d},clear(){const o=me(this),r=o.size!==0,i=o.clear();return r&&Rt(o,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=pl(o,e,t)}),n}function uo(e,t){const n=hl(e,t);return(s,o,r)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(ge(n,o)&&o in s?n:s,o,r)}const ml={get:uo(!1,!1)},gl={get:uo(!1,!0)},vl={get:uo(!0,!1)};const jr=new WeakMap,Ur=new WeakMap,Lr=new WeakMap,bl=new WeakMap;function xl(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function vs(e){return Nt(e)?e:co(e,!1,cl,ml,jr)}function Fr(e){return co(e,!1,dl,gl,Ur)}function qs(e){return co(e,!0,fl,vl,Lr)}function co(e,t,n,s,o){if(!ve(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=xl(qi(e));if(i===0)return e;const l=new Proxy(e,i===2?s:n);return o.set(e,l),l}function Xt(e){return Nt(e)?Xt(e.__v_raw):!!(e&&e.__v_isReactive)}function Nt(e){return!!(e&&e.__v_isReadonly)}function it(e){return!!(e&&e.__v_isShallow)}function fo(e){return e?!!e.__v_raw:!1}function me(e){const t=e&&e.__v_raw;return t?me(t):e}function _l(e){return!ge(e,"__v_skip")&&Object.isExtensible(e)&&Cr(e,"__v_skip",!0),e}const ft=e=>ve(e)?vs(e):e,fn=e=>ve(e)?qs(e):e;function Ke(e){return e?e.__v_isRef===!0:!1}function z(e){return Hr(e,!1)}function yl(e){return Hr(e,!0)}function Hr(e,t){return Ke(e)?e:new wl(e,t)}class wl{constructor(t,n){this.dep=new ao,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:me(t),this._value=n?t:ft(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||it(t)||Nt(t);t=s?t:me(t),bt(t,n)&&(this._rawValue=t,this._value=s?t:ft(t),this.dep.trigger())}}function De(e){return Ke(e)?e.value:e}const Cl={get:(e,t,n)=>t==="__v_raw"?e:De(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return Ke(o)&&!Ke(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function Br(e){return Xt(e)?e:new Proxy(e,Cl)}class El{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new ao(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Pn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&_e!==this)return Ir(this,!0),!0}get value(){const t=this.dep.track();return Tr(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Sl(e,t,n=!1){let s,o;return te(e)?s=e:(s=e.get,o=e.set),new El(s,o,n)}const zn={},ns=new WeakMap;let Jt;function Al(e,t=!1,n=Jt){if(n){let s=ns.get(n);s||ns.set(n,s=[]),s.push(e)}}function kl(e,t,n=be){const{immediate:s,deep:o,once:r,scheduler:i,augmentJob:l,call:a}=n,d=I=>o?I:it(I)||o===!1||o===0?It(I,1):It(I);let c,h,g,x,j=!1,O=!1;if(Ke(e)?(h=()=>e.value,j=it(e)):Xt(e)?(h=()=>d(e),j=!0):X(e)?(O=!0,j=e.some(I=>Xt(I)||it(I)),h=()=>e.map(I=>{if(Ke(I))return I.value;if(Xt(I))return d(I);if(te(I))return a?a(I,2):I()})):te(e)?t?h=a?()=>a(e,2):e:h=()=>{if(g){Tt();try{g()}finally{$t()}}const I=Jt;Jt=c;try{return a?a(e,3,[x]):e(x)}finally{Jt=I}}:h=xt,t&&o){const I=h,A=o===!0?1/0:o;h=()=>It(I(),A)}const W=nl(),K=()=>{c.stop(),W&&W.active&&no(W.effects,c)};if(r&&t){const I=t;t=(...A)=>{const M=I(...A);return K(),M}}let D=O?new Array(e.length).fill(zn):zn;const q=I=>{if(!(!(c.flags&1)||!c.dirty&&!I))if(t){const A=c.run();if(I||o||j||(O?A.some((M,ne)=>bt(M,D[ne])):bt(A,D))){g&&g();const M=Jt;Jt=c;try{const ne=[A,D===zn?void 0:O&&D[0]===zn?[]:D,x];D=A,a?a(t,3,ne):t(...ne)}finally{Jt=M}}}else c.run()};return l&&l(q),c=new kr(h),c.scheduler=i?()=>i(q,!1):q,x=I=>Al(I,!1,c),g=c.onStop=()=>{const I=ns.get(c);if(I){if(a)a(I,4);else for(const A of I)A();ns.delete(c)}},t?s?q(!0):D=c.run():i?i(q.bind(null,!0),!0):c.run(),K.pause=c.pause.bind(c),K.resume=c.resume.bind(c),K.stop=K,K}function It(e,t=1/0,n){if(t<=0||!ve(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Ke(e))It(e.value,t,n);else if(X(e))for(let s=0;s{It(s,t,n)});else if(wr(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 Ln(e,t,n,s){try{return s?e(...s):e()}catch(o){bs(o,t,n)}}function dt(e,t,n,s){if(te(e)){const o=Ln(e,t,n,s);return o&&_r(o)&&o.catch(r=>{bs(r,t,n)}),o}if(X(e)){const o=[];for(let r=0;r>>1,o=Je[s],r=Tn(o);r=Tn(n)?Je.push(e):Je.splice(Il(t),0,e),e.flags|=1,qr()}}function qr(){ss||(ss=Kr.then(Wr))}function Pl(e){if(!X(e))Lt&&e.id===-1?Lt.splice(nn+1,0,e):e.flags&1||(ln.push(e),e.flags|=1);else for(let t=0;tTn(n)-Tn(s));if(ln.length=0,Lt){for(let n=0;ne.id==null?e.flags&2?-1:1/0:e.id;function Wr(e){try{for(mt=0;mt{s._d&&ls(-1);const r=os(t),i=Ot.length;let l;try{l=e(...o)}finally{for(let a=Ot.length;a>i;a--)_o();os(r),s._d&&ls(1)}return l};return s._n=!0,s._c=!0,s._d=!0,s}function se(e,t){if(je===null)return e;const n=Cs(je),s=e.dirs||(e.dirs=[]);for(let o=0;o1)return n&&te(t)?t.call(s&&s.proxy):t}}const Ol=Symbol.for("v-scx"),Tl=()=>ut(Ol);function Bt(e,t,n){return Jr(e,t,n)}function Jr(e,t,n=be){const{immediate:s,deep:o,flush:r,once:i}=n,l=Ue({},n),a=t&&s||!t&&r!=="post";let d;if(Mn){if(r==="sync"){const x=Tl();d=x.__watcherHandles||(x.__watcherHandles=[])}else if(!a){const x=()=>{};return x.stop=xt,x.resume=xt,x.pause=xt,x}}const c=Be;l.call=(x,j,O)=>dt(x,c,j,O);let h=!1;r==="post"?l.scheduler=x=>{tt(x,c&&c.suspense)}:r!=="sync"&&(h=!0,l.scheduler=(x,j)=>{j?x():ho(x)}),l.augmentJob=x=>{t&&(x.flags|=4),h&&(x.flags|=2,c&&(x.id=c.uid,x.i=c))};const g=kl(e,t,l);return Mn&&(d?d.push(g):a&&g()),g}function $l(e,t,n){const s=this.proxy,o=Oe(e)?e.includes(".")?Qr(s,e):()=>s[e]:e.bind(s,s);let r;te(t)?r=t:(r=t.handler,n=t);const i=Hn(this),l=Jr(o,r.bind(s),n);return i(),l}function Qr(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;oe.__isTeleport,Os=Symbol("_leaveCb");function Dl(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==_t){t=n;break}}return t}function Yr(e){if(!go(e))return xs(e.type)&&e.children?Dl(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&&te(n.default))return n.default()}}function mo(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;mo(xs(n.type)&&Yr(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 te(e)?Ue({name:e.name},t,{setup:e}):e}function Zr(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Io(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const rs=new WeakMap;function kn(e,t,n,s,o=!1){if(X(e)){e.forEach((O,W)=>kn(O,t&&(X(t)?t[W]:t),n,s,o));return}if(an(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&kn(e,t,n,s.component.subTree);return}const r=s.shapeFlag&4?Cs(s.component):s.el,i=o?null:r,{i:l,r:a}=e,d=t&&t.r,c=l.refs===be?l.refs={}:l.refs,h=l.setupState,g=me(h),x=h===be?xr:O=>Io(c,O)?!1:ge(g,O),j=(O,W)=>!(W&&Io(c,W));if(d!=null&&d!==a){if(Po(t),Oe(d))c[d]=null,x(d)&&(h[d]=null);else if(Ke(d)){const O=t;j(d,O.k)&&(d.value=null),O.k&&(c[O.k]=null)}}if(te(a))Ln(a,l,12,[i,c]);else{const O=Oe(a),W=Ke(a);if(O||W){const K=()=>{if(e.f){const D=O?x(a)?h[a]:c[a]:j()||!e.k?a.value:c[e.k];if(o)X(D)&&no(D,r);else if(X(D))D.includes(r)||D.push(r);else if(O)c[a]=[r],x(a)&&(h[a]=c[a]);else{const q=[r];j(a,e.k)&&(a.value=q),e.k&&(c[e.k]=q)}}else O?(c[a]=i,x(a)&&(h[a]=i)):W&&(j(a,e.k)&&(a.value=i),e.k&&(c[e.k]=i))};if(i){const D=()=>{K(),rs.delete(e)};D.id=-1,rs.set(e,D),tt(D,n)}else Po(e),K()}}}function Po(e){const t=rs.get(e);t&&(t.flags|=8,rs.delete(e))}ms().requestIdleCallback;ms().cancelIdleCallback;const an=e=>!!e.type.__asyncLoader,go=e=>e.type.__isKeepAlive;function Ml(e,t){ei(e,"a",t)}function Vl(e,t){ei(e,"da",t)}function ei(e,t,n=Be){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(_s(t,s,n),n){let o=n.parent;for(;o&&o.parent;)go(o.parent.vnode)&&jl(s,t,n,o),o=o.parent}}function jl(e,t,n,s){const o=_s(t,e,s,!0);ti(()=>{no(s[t],o)},n)}function _s(e,t,n=Be,s=!1){if(n){const o=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...i)=>{Tt();const l=Hn(n),a=dt(t,n,e,i);return l(),$t(),a});return s?o.unshift(r):o.push(r),r}}const Dt=e=>(t,n=Be)=>{(!Mn||e==="sp")&&_s(e,(...s)=>t(...s),n)},Ul=Dt("bm"),vo=Dt("m"),Ll=Dt("bu"),Fl=Dt("u"),Hl=Dt("bum"),ti=Dt("um"),Bl=Dt("sp"),Kl=Dt("rtg"),ql=Dt("rtc");function Gl(e,t=Be){_s("ec",e,t)}const Wl="components";function Fn(e,t){return Jl(Wl,e,!0,t)||e}const zl=Symbol.for("v-ndc");function Jl(e,t,n=!0,s=!1){const o=je||Be;if(o){const r=o.type;{const l=Na(r,!1);if(l&&(l===t||l===Ye(t)||l===ps(Ye(t))))return r}const i=Oo(o[e]||r[e],t)||Oo(o.appContext[e],t);return!i&&s?r:i}}function Oo(e,t){return e&&(e[t]||e[Ye(t)]||e[ps(Ye(t))])}function $e(e,t,n,s){let o;const r=n,i=X(e);if(i||Oe(e)){const l=i&&Xt(e);let a=!1,d=!1;l&&(a=!it(e),d=Nt(e),e=gs(e)),o=new Array(e.length);for(let c=0,h=e.length;ct(l,a,void 0,r));else{const l=Object.keys(e);o=new Array(l.length);for(let a=0,d=l.length;a0;return w(),dn(fe,null,[Pe("slot",d,s)],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1);const l=Ot.length;w();let a;try{const d=i&&ni(i(n)),c=n.key||r||d&&d.key;a=dn(fe,{key:(c&&!ct(c)?c:`_${t}`)+(!d&&s?"_fb":"")},d||(s?s():[]),d&&e._===1?64:-2)}catch(d){for(let c=Ot.length;c>l;c--)_o();throw d}finally{i&&i._c&&(i._d=!0)}return a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),a}function ni(e){return e.some(t=>Nn(t)?!(t.type===_t||t.type===fe&&!ni(t.children)):!0)?e:null}const Gs=e=>e?Ci(e)?Cs(e):Gs(e.parent):null,Rn=Ue(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=>Gs(e.parent),$root:e=>Gs(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>oi(e),$forceUpdate:e=>e.f||(e.f=()=>{ho(e.update)}),$nextTick:e=>e.n||(e.n=po.bind(e.proxy)),$watch:e=>$l.bind(e)}),Ts=(e,t)=>e!==be&&!e.__isScriptSetup&&ge(e,t),Yl={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:r,accessCache:i,type:l,appContext:a}=e;if(t[0]!=="$"){const g=i[t];if(g!==void 0)switch(g){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return r[t]}else{if(Ts(s,t))return i[t]=1,s[t];if(o!==be&&ge(o,t))return i[t]=2,o[t];if(ge(r,t))return i[t]=3,r[t];if(n!==be&&ge(n,t))return i[t]=4,n[t];Ws&&(i[t]=0)}}const d=Rn[t];let c,h;if(d)return t==="$attrs"&&He(e.attrs,"get",""),d(e);if((c=l.__cssModules)&&(c=c[t]))return c;if(n!==be&&ge(n,t))return i[t]=4,n[t];if(h=a.config.globalProperties,ge(h,t))return h[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:r}=e;return Ts(o,t)?(o[t]=n,!0):s!==be&&ge(s,t)?(s[t]=n,!0):ge(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}},l){let a;return!!(n[l]||e!==be&&l[0]!=="$"&&ge(e,l)||Ts(t,l)||ge(r,l)||ge(s,l)||ge(Rn,l)||ge(o.config.globalProperties,l)||(a=i.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:ge(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function To(e){return X(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Ws=!0;function Xl(e){const t=oi(e),n=e.proxy,s=e.ctx;Ws=!1,t.beforeCreate&&$o(t.beforeCreate,e,"bc");const{data:o,computed:r,methods:i,watch:l,provide:a,inject:d,created:c,beforeMount:h,mounted:g,beforeUpdate:x,updated:j,activated:O,deactivated:W,beforeDestroy:K,beforeUnmount:D,destroyed:q,unmounted:I,render:A,renderTracked:M,renderTriggered:ne,errorCaptured:F,serverPrefetch:Ae,expose:Z,inheritAttrs:V,components:Te,directives:G,filters:Xe}=t;if(d&&Zl(d,s,null),i)for(const ce in i){const ae=i[ce];te(ae)&&(s[ce]=ae.bind(n))}if(o){const ce=o.call(n,n);ve(ce)&&(e.data=vs(ce))}if(Ws=!0,r)for(const ce in r){const ae=r[ce],oe=te(ae)?ae.bind(n,n):te(ae.get)?ae.get.bind(n,n):xt,lt=!te(ae)&&te(ae.set)?ae.set.bind(n):xt,Ze=ye({get:oe,set:lt});Object.defineProperty(s,ce,{enumerable:!0,configurable:!0,get:()=>Ze.value,set:Le=>Ze.value=Le})}if(l)for(const ce in l)si(l[ce],s,n,ce);if(a){const ce=te(a)?a.call(n):a;Reflect.ownKeys(ce).forEach(ae=>{Zn(ae,ce[ae])})}c&&$o(c,e,"c");function Ce(ce,ae){X(ae)?ae.forEach(oe=>ce(oe.bind(n))):ae&&ce(ae.bind(n))}if(Ce(Ul,h),Ce(vo,g),Ce(Ll,x),Ce(Fl,j),Ce(Ml,O),Ce(Vl,W),Ce(Gl,F),Ce(ql,M),Ce(Kl,ne),Ce(Hl,D),Ce(ti,I),Ce(Bl,Ae),X(Z))if(Z.length){const ce=e.exposed||(e.exposed={});Z.forEach(ae=>{Object.defineProperty(ce,ae,{get:()=>n[ae],set:oe=>n[ae]=oe,enumerable:!0})})}else e.exposed||(e.exposed={});A&&e.render===xt&&(e.render=A),V!=null&&(e.inheritAttrs=V),Te&&(e.components=Te),G&&(e.directives=G),Ae&&Zr(e)}function Zl(e,t,n=xt){X(e)&&(e=zs(e));for(const s in e){const o=e[s];let r;ve(o)?"default"in o?r=ut(o.from||s,o.default,!0):r=ut(o.from||s):r=ut(o),Ke(r)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>r.value,set:i=>r.value=i}):t[s]=r}}function $o(e,t,n){dt(X(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function si(e,t,n,s){let o=s.includes(".")?Qr(n,s):()=>n[s];if(Oe(e)){const r=t[e];te(r)&&Bt(o,r)}else if(te(e))Bt(o,e.bind(n));else if(ve(e))if(X(e))e.forEach(r=>si(r,t,n,s));else{const r=te(e.handler)?e.handler.bind(n):t[e.handler];te(r)&&Bt(o,r,e)}}function oi(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:r,config:{optionMergeStrategies:i}}=e.appContext,l=r.get(t);let a;return l?a=l:!o.length&&!n&&!s?a=t:(a={},o.length&&o.forEach(d=>is(a,d,i,!0)),is(a,t,i)),ve(t)&&r.set(t,a),a}function is(e,t,n,s=!1){const{mixins:o,extends:r}=t;r&&is(e,r,n,!0),o&&o.forEach(i=>is(e,i,n,!0));for(const i in t)if(!(s&&i==="expose")){const l=ea[i]||n&&n[i];e[i]=l?l(e[i],t[i]):t[i]}return e}const ea={data:No,props:Do,emits:Do,methods:yn,computed:yn,beforeCreate:Ge,created:Ge,beforeMount:Ge,mounted:Ge,beforeUpdate:Ge,updated:Ge,beforeDestroy:Ge,beforeUnmount:Ge,destroyed:Ge,unmounted:Ge,activated:Ge,deactivated:Ge,errorCaptured:Ge,serverPrefetch:Ge,components:yn,directives:yn,watch:na,provide:No,inject:ta};function No(e,t){return t?e?function(){return Ue(te(e)?e.call(this,this):e,te(t)?t.call(this,this):t)}:t:e}function ta(e,t){return yn(zs(e),zs(t))}function zs(e){if(X(e)){const t={};for(let n=0;nt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Ye(t)}Modifiers`]||e[`${en(t)}Modifiers`];function ia(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||be;let o=n;const r=t.startsWith("update:"),i=r&&ra(s,t.slice(7));i&&(i.trim&&(o=n.map(c=>Oe(c)?c.trim():c)),i.number&&(o=n.map(hs)));let l,a=s[l=As(t)]||s[l=As(Ye(t))];!a&&r&&(a=s[l=As(en(t))]),a&&dt(a,e,6,o);const d=s[l+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,dt(d,e,6,o)}}const la=new WeakMap;function ii(e,t,n=!1){const s=n?la:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const r=e.emits;let i={},l=!1;if(!te(e)){const a=d=>{const c=ii(d,t,!0);c&&(l=!0,Ue(i,c))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!r&&!l?(ve(e)&&s.set(e,null),null):(X(r)?r.forEach(a=>i[a]=null):Ue(i,r),ve(e)&&s.set(e,i),i)}function ys(e,t){return!e||!cs(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),ge(e,t[0].toLowerCase()+t.slice(1))||ge(e,en(t))||ge(e,t))}function Mo(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[r],slots:i,attrs:l,emit:a,render:d,renderCache:c,props:h,data:g,setupState:x,ctx:j,inheritAttrs:O}=e,W=os(e);let K,D;try{if(n.shapeFlag&4){const I=o||s,A=I;K=vt(d.call(A,I,c,h,x,g,j)),D=l}else{const I=t;K=vt(I.length>1?I(h,{attrs:l,slots:i,emit:a}):I(h,null)),D=t.props?l:aa(l)}}catch(I){Ot.length=0,bs(I,e,1),K=Pe(_t)}let q=K;if(D&&O!==!1){const I=Object.keys(D),{shapeFlag:A}=q;I.length&&A&7&&(r&&I.some(fs)&&(D=ua(D,r)),q=pn(q,D,!1,!0))}if(n.dirs&&(q=pn(q,null,!1,!0),q.dirs=q.dirs?q.dirs.concat(n.dirs):n.dirs),n.transition){const I=xs(q.type)&&Yr(q)||q;mo(I,n.transition)}return K=q,os(W),K}const aa=e=>{let t;for(const n in e)(n==="class"||n==="style"||cs(n))&&((t||(t={}))[n]=e[n]);return t},ua=(e,t)=>{const n={};for(const s in e)(!fs(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function ca(e,t,n){const{props:s,children:o,component:r}=e,{props:i,children:l,patchFlag:a}=t,d=r.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return s?Vo(s,i,d):!!i;if(a&8){const c=t.dynamicProps;for(let h=0;hObject.create(ai),ci=e=>Object.getPrototypeOf(e)===ai;function da(e,t,n,s=!1){const o={},r=ui();e.propsDefaults=Object.create(null),fi(e,t,o,r);for(const i in e.propsOptions[0])i in o||(o[i]=void 0);n?e.props=s?o:Fr(o):e.type.props?e.props=o:e.props=r,e.attrs=r}function pa(e,t,n,s){const{props:o,attrs:r,vnode:{patchFlag:i}}=e,l=me(o),[a]=e.propsOptions;let d=!1;if((s||i>0)&&!(i&16)){if(i&8){const c=e.vnode.dynamicProps;for(let h=0;h{a=!0;const[g,x]=di(h,t,!0);Ue(i,g),x&&l.push(...x)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!r&&!a)return ve(e)&&s.set(e,on),on;if(X(r))for(let c=0;ce==="_"||e==="_ctx"||e==="$stable",xo=e=>X(e)?e.map(vt):[vt(e)],ma=(e,t,n)=>{if(t._n)return t;const s=Ht((...o)=>xo(t(...o)),n);return s._c=!1,s},pi=(e,t,n)=>{const s=e._ctx;for(const o in e){if(bo(o))continue;const r=e[o];if(te(r))t[o]=ma(o,r,s);else if(r!=null){const i=xo(r);t[o]=()=>i}}},hi=(e,t)=>{const n=xo(t);e.slots.default=()=>n},mi=(e,t,n)=>{for(const s in t)(n||!bo(s))&&(e[s]=t[s])},ga=(e,t,n)=>{const s=e.slots=ui();if(e.vnode.shapeFlag&32){const o=t._;o?(mi(s,t,n),n&&Cr(s,"_",o,!0)):pi(t,s)}else t&&hi(e,t)},va=(e,t,n)=>{const{vnode:s,slots:o}=e;let r=!0,i=be;if(s.shapeFlag&32){const l=t._;l?n&&l===1?r=!1:mi(o,t,n):(r=!t.$stable,pi(t,o)),i=t}else t&&(hi(e,t),i={default:1});if(r)for(const l in o)!bo(l)&&i[l]==null&&delete o[l]},tt=wa;function ba(e){return xa(e)}function xa(e,t){const n=ms();n.__VUE__=!0;const{insert:s,remove:o,patchProp:r,createElement:i,createText:l,createComment:a,setText:d,setElementText:c,parentNode:h,nextSibling:g,setScopeId:x=xt,insertStaticContent:j}=e,O=(f,p,m,y=null,S=null,_=null,L=void 0,$=null,N=!!p.dynamicChildren)=>{if(f===p)return;f&&!xn(f,p)&&(y=C(f),Le(f,S,_,!0),f=null),p.patchFlag===-2&&(N=!1,p.dynamicChildren=null);const{type:k,ref:Q,shapeFlag:H}=p;switch(k){case ws:W(f,p,m,y);break;case _t:K(f,p,m,y);break;case es:f==null&&D(p,m,y,L);break;case fe:Te(f,p,m,y,S,_,L,$,N);break;default:H&1?A(f,p,m,y,S,_,L,$,N):H&6?G(f,p,m,y,S,_,L,$,N):(H&64||H&128)&&k.process(f,p,m,y,S,_,L,$,N,T)}Q!=null&&S?kn(Q,f&&f.ref,_,p||f,!p):Q==null&&f&&f.ref!=null&&kn(f.ref,null,_,f,!0)},W=(f,p,m,y)=>{if(f==null)s(p.el=l(p.children),m,y);else{const S=p.el=f.el;p.children!==f.children&&d(S,p.children)}},K=(f,p,m,y)=>{f==null?s(p.el=a(p.children||""),m,y):p.el=f.el},D=(f,p,m,y)=>{[f.el,f.anchor]=j(f.children,p,m,y,f.el,f.anchor)},q=({el:f,anchor:p},m,y)=>{let S;for(;f&&f!==p;)S=g(f),s(f,m,y),f=S;s(p,m,y)},I=({el:f,anchor:p})=>{let m;for(;f&&f!==p;)m=g(f),o(f),f=m;o(p)},A=(f,p,m,y,S,_,L,$,N)=>{if(p.type==="svg"?L="svg":p.type==="math"&&(L="mathml"),f==null)M(p,m,y,S,_,L,$,N);else{const k=f.el&&f.el._isVueCE?f.el:null;try{k&&k._beginPatch(),Ae(f,p,S,_,L,$,N)}finally{k&&k._endPatch()}}},M=(f,p,m,y,S,_,L,$)=>{let N,k;const{props:Q,shapeFlag:H,transition:J,dirs:Y}=f;if(N=f.el=i(f.type,_,Q&&Q.is,Q),H&8?c(N,f.children):H&16&&F(f.children,N,null,y,S,$s(f,_),L,$),Y&&Wt(f,null,y,"created"),ne(N,f,f.scopeId,L,y),Q){for(const de in Q)de!=="value"&&!En(de)&&r(N,de,null,Q[de],_,y);"value"in Q&&r(N,"value",null,Q.value,_),(k=Q.onVnodeBeforeMount)&&ht(k,y,f)}Y&&Wt(f,null,y,"beforeMount");const ue=_a(S,J);ue&&J.beforeEnter(N),s(N,p,m),((k=Q&&Q.onVnodeMounted)||ue||Y)&&tt(()=>{try{k&&ht(k,y,f),ue&&J.enter(N),Y&&Wt(f,null,y,"mounted")}finally{}},S)},ne=(f,p,m,y,S)=>{if(m&&x(f,m),y)for(let _=0;_{for(let k=N;k{const $=p.el=f.el;let{patchFlag:N,dynamicChildren:k,dirs:Q}=p;N|=f.patchFlag&16;const H=f.props||be,J=p.props||be;let Y;if(m&&zt(m,!1),(Y=J.onVnodeBeforeUpdate)&&ht(Y,m,p,f),Q&&Wt(p,f,m,"beforeUpdate"),m&&zt(m,!0),k&&(!f.dynamicChildren||f.dynamicChildren.length!==k.length)&&(N=0,L=!1,k=null),(H.innerHTML&&J.innerHTML==null||H.textContent&&J.textContent==null)&&c($,""),k?Z(f.dynamicChildren,k,$,m,y,$s(p,S),_):L||ae(f,p,$,null,m,y,$s(p,S),_,!1),N>0){if(N&16)V($,H,J,m,S);else if(N&2&&H.class!==J.class&&r($,"class",null,J.class,S),N&4&&r($,"style",H.style,J.style,S),N&8){const ue=p.dynamicProps;for(let de=0;de{Y&&ht(Y,m,p,f),Q&&Wt(p,f,m,"updated")},y)},Z=(f,p,m,y,S,_,L)=>{for(let $=0;${if(p!==m){if(p!==be)for(const _ in p)!En(_)&&!(_ in m)&&r(f,_,p[_],null,S,y);for(const _ in m){if(En(_))continue;const L=m[_],$=p[_];L!==$&&_!=="value"&&r(f,_,$,L,S,y)}"value"in m&&r(f,"value",p.value,m.value,S)}},Te=(f,p,m,y,S,_,L,$,N)=>{const k=p.el=f?f.el:l(""),Q=p.anchor=f?f.anchor:l("");let{patchFlag:H,dynamicChildren:J,slotScopeIds:Y}=p;Y&&($=$?$.concat(Y):Y),f==null?(s(k,m,y),s(Q,m,y),F(p.children||[],m,Q,S,_,L,$,N)):H>0&&H&64&&J&&f.dynamicChildren&&f.dynamicChildren.length===J.length?(Z(f.dynamicChildren,J,m,S,_,L,$),(p.key!=null||S&&p===S.subTree)&&gi(f,p,!0)):ae(f,p,m,Q,S,_,L,$,N)},G=(f,p,m,y,S,_,L,$,N)=>{p.slotScopeIds=$,f==null?p.shapeFlag&512?S.ctx.activate(p,m,y,L,N):Xe(p,m,y,S,_,L,N):Mt(f,p,N)},Xe=(f,p,m,y,S,_,L)=>{const $=f.component=Ra(f,y,S);if(go(f)&&($.ctx.renderer=T),Pa($,!1,L),$.asyncDep){if(S&&S.registerDep($,Ce,L),!f.el){const N=$.subTree=Pe(_t);K(null,N,p,m),f.placeholder=N.el}}else Ce($,f,p,m,S,_,L)},Mt=(f,p,m)=>{const y=p.component=f.component;if(ca(f,p,m))if(y.asyncDep&&!y.asyncResolved){ce(y,p,m);return}else y.next=p,y.update();else p.el=f.el,y.vnode=p},Ce=(f,p,m,y,S,_,L)=>{const $=()=>{if(f.isMounted){let{next:H,bu:J,u:Y,parent:ue,vnode:de}=f;{const Fe=vi(f);if(Fe){H&&(H.el=de.el,ce(f,H,L)),Fe.asyncDep.then(()=>{tt(()=>{f.isUnmounted||k()},S)});return}}let pe=H,ke;zt(f,!1),H?(H.el=de.el,ce(f,H,L)):H=de,J&&Xn(J),(ke=H.props&&H.props.onVnodeBeforeUpdate)&&ht(ke,ue,H,de),zt(f,!0);const Ee=Mo(f),qe=f.subTree;f.subTree=Ee,O(qe,Ee,h(qe.el),C(qe),f,S,_),H.el=Ee.el,pe===null&&fa(f,Ee.el),Y&&tt(Y,S),(ke=H.props&&H.props.onVnodeUpdated)&&tt(()=>ht(ke,ue,H,de),S)}else{let H;const{el:J,props:Y}=p,{bm:ue,m:de,parent:pe,root:ke,type:Ee}=f,qe=an(p);zt(f,!1),ue&&Xn(ue),!qe&&(H=Y&&Y.onVnodeBeforeMount)&&ht(H,pe,p),zt(f,!0);{ke.ce&&ke.ce._hasShadowRoot()&&ke.ce._injectChildStyle(Ee,f.parent?f.parent.type:void 0);const Fe=f.subTree=Mo(f);O(null,Fe,m,y,f,S,_),p.el=Fe.el}if(de&&tt(de,S),!qe&&(H=Y&&Y.onVnodeMounted)){const Fe=p;tt(()=>ht(H,pe,Fe),S)}(p.shapeFlag&256||pe&&an(pe.vnode)&&pe.vnode.shapeFlag&256)&&f.a&&tt(f.a,S),f.isMounted=!0,p=m=y=null}};f.scope.on();const N=f.effect=new kr($);f.scope.off();const k=f.update=N.run.bind(N),Q=f.job=N.runIfDirty.bind(N);Q.i=f,Q.id=f.uid,N.scheduler=()=>ho(Q),zt(f,!0),k()},ce=(f,p,m)=>{p.component=f;const y=f.vnode.props;f.vnode=p,f.next=null,pa(f,p.props,y,m),va(f,p.children,m),Tt(),Ro(f),$t()},ae=(f,p,m,y,S,_,L,$,N=!1)=>{const k=f&&f.children,Q=f?f.shapeFlag:0,H=p.children,{patchFlag:J,shapeFlag:Y}=p;if(J>0){if(J&128){lt(k,H,m,y,S,_,L,$,N);return}else if(J&256){oe(k,H,m,y,S,_,L,$,N);return}}Y&8?(Q&16&&et(k,S,_),H!==k&&c(m,H)):Q&16?Y&16?lt(k,H,m,y,S,_,L,$,N):et(k,S,_,!0):(Q&8&&c(m,""),Y&16&&F(H,m,y,S,_,L,$,N))},oe=(f,p,m,y,S,_,L,$,N)=>{f=f||on,p=p||on;const k=f.length,Q=p.length,H=Math.min(k,Q);let J;for(J=0;JQ?et(f,S,_,!0,!1,H):F(p,m,y,S,_,L,$,N,H)},lt=(f,p,m,y,S,_,L,$,N)=>{let k=0;const Q=p.length;let H=f.length-1,J=Q-1;for(;k<=H&&k<=J;){const Y=f[k],ue=p[k]=N?kt(p[k]):vt(p[k]);if(xn(Y,ue))O(Y,ue,m,null,S,_,L,$,N);else break;k++}for(;k<=H&&k<=J;){const Y=f[H],ue=p[J]=N?kt(p[J]):vt(p[J]);if(xn(Y,ue))O(Y,ue,m,null,S,_,L,$,N);else break;H--,J--}if(k>H){if(k<=J){const Y=J+1,ue=YJ)for(;k<=H;)Le(f[k],S,_,!0),k++;else{const Y=k,ue=k,de=new Map;for(k=ue;k<=J;k++){const Me=p[k]=N?kt(p[k]):vt(p[k]);Me.key!=null&&de.set(Me.key,k)}let pe,ke=0;const Ee=J-ue+1;let qe=!1,Fe=0;const Gt=new Array(Ee);for(k=0;k=Ee){Le(Me,S,_,!0);continue}let ot;if(Me.key!=null)ot=de.get(Me.key);else for(pe=ue;pe<=J;pe++)if(Gt[pe-ue]===0&&xn(Me,p[pe])){ot=pe;break}ot===void 0?Le(Me,S,_,!0):(Gt[ot-ue]=k+1,ot>=Fe?Fe=ot:qe=!0,O(Me,p[ot],m,null,S,_,L,$,N),ke++)}const Bn=qe?ya(Gt):on;for(pe=Bn.length-1,k=Ee-1;k>=0;k--){const Me=ue+k,ot=p[Me],Kn=p[Me+1],qn=Me+1{const{el:_,type:L,transition:$,children:N,shapeFlag:k}=f;if(k&6){Ze(f.component.subTree,p,m,y);return}if(k&128){f.suspense.move(p,m,y);return}if(k&64){L.move(f,p,m,T);return}if(L===fe){s(_,p,m);for(let H=0;H$.enter(_),S));else{const{leave:H,delayLeave:J,afterLeave:Y}=$,ue=()=>{f.ctx.isUnmounted?o(_):s(_,p,m)},de=()=>{const pe=_._isLeaving||!!_[Os];_._isLeaving&&_[Os](!0),$.persisted&&!pe?ue():H(_,()=>{ue(),Y&&Y()})};J?J(_,ue,de):de()}else s(_,p,m)},Le=(f,p,m,y=!1,S=!1)=>{const{type:_,props:L,ref:$,children:N,dynamicChildren:k,shapeFlag:Q,patchFlag:H,dirs:J,cacheIndex:Y,memo:ue}=f;if(H===-2&&(S=!1),$!=null&&(Tt(),kn($,null,m,f,!0),$t()),Y!=null&&(p.renderCache[Y]=void 0),Q&256){p.ctx.deactivate(f);return}const de=Q&1&&J,pe=!an(f);let ke;if(pe&&(ke=L&&L.onVnodeBeforeUnmount)&&ht(ke,p,f),Q&6)yt(f.component,m,y);else{if(Q&128){f.suspense.unmount(m,y);return}de&&Wt(f,null,p,"beforeUnmount"),Q&64?f.type.remove(f,p,m,T,y):k&&!k.hasOnce&&(_!==fe||H>0&&H&64)?et(k,p,m,!1,!0):(_===fe&&H&384||!S&&Q&16)&&et(N,p,m),y&&Vt(f)}const Ee=ue!=null&&Y==null;(pe&&(ke=L&&L.onVnodeUnmounted)||de||Ee)&&tt(()=>{ke&&ht(ke,p,f),de&&Wt(f,null,p,"unmounted"),Ee&&(f.el=null)},m)},Vt=f=>{const{type:p,el:m,anchor:y,transition:S}=f;if(p===fe){jt(m,y);return}if(p===es){I(f);return}const _=()=>{o(m),S&&!S.persisted&&S.afterLeave&&S.afterLeave()};if(f.shapeFlag&1&&S&&!S.persisted){const{leave:L,delayLeave:$}=S,N=()=>L(m,_);$?$(f.el,_,N):N()}else _()},jt=(f,p)=>{let m;for(;f!==p;)m=g(f),o(f),f=m;o(p)},yt=(f,p,m)=>{const{bum:y,scope:S,job:_,subTree:L,um:$,m:N,a:k}=f;Uo(N),Uo(k),y&&Xn(y),S.stop(),_&&(_.flags|=8,Le(L,f,p,m)),$&&tt($,p),tt(()=>{f.isUnmounted=!0},p)},et=(f,p,m,y=!1,S=!1,_=0)=>{for(let L=_;L{if(f.shapeFlag&6)return C(f.component.subTree);if(f.shapeFlag&128)return f.suspense.next();const p=g(f.anchor||f.el),m=p&&p[Nl];return m?g(m):p};let B=!1;const U=(f,p,m)=>{let y;f==null?p._vnode&&(Le(p._vnode,null,null,!0),y=p._vnode.component):O(p._vnode||null,f,p,null,null,null,m),p._vnode=f,B||(B=!0,Ro(y),Gr(),B=!1)},T={p:O,um:Le,m:Ze,r:Vt,mt:Xe,mc:F,pc:ae,pbc:Z,n:C,o:e};return{render:U,hydrate:void 0,createApp:oa(U)}}function $s({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 zt({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function _a(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function gi(e,t,n=!1){const s=e.children,o=t.children;if(X(s)&&X(o))for(let r=0;r>1,e[n[l]]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 vi(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:vi(t)}function Uo(e){if(e)for(let t=0;te.__isSuspense;function wa(e,t){t&&t.pendingBranch?X(e)?t.effects.push(...e):t.effects.push(e):Pl(e)}const fe=Symbol.for("v-fgt"),ws=Symbol.for("v-txt"),_t=Symbol.for("v-cmt"),es=Symbol.for("v-stc"),Ot=[];let nt=null;function w(e=!1){Ot.push(nt=e?null:[])}function _o(){Ot.pop(),nt=Ot[Ot.length-1]||null}let $n=1;function ls(e,t=!1){$n+=e,e<0&&nt&&t&&(nt.hasOnce=!0)}function _i(e){return e.dynamicChildren=$n>0?nt||on:null,_o(),$n>0&&nt&&nt.push(e),e}function E(e,t,n,s,o,r){return _i(u(e,t,n,s,o,r,!0))}function dn(e,t,n,s,o){return _i(Pe(e,t,n,s,o,!0))}function Nn(e){return e?e.__v_isVNode===!0:!1}function xn(e,t){return e.type===t.type&&e.key===t.key}const yi=({key:e})=>e??null,ts=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Oe(e)||Ke(e)||te(e)?{i:je,r:e,k:t,f:!!n}:e:null);function u(e,t=null,n=null,s=0,o=null,r=e===fe?0:1,i=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&yi(t),ref:t&&ts(t),scopeId:zr,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:je};return l?(as(a,n),r&128&&e.normalize(a)):n&&(a.shapeFlag|=Oe(n)?8:16),$n>0&&!i&&nt&&(a.patchFlag>0||r&6)&&a.patchFlag!==32&&nt.push(a),a}const Pe=Ca;function Ca(e,t=null,n=null,s=0,o=null,r=!1){if((!e||e===zl)&&(e=_t),Nn(e)){const l=pn(e,t,!0);return n&&as(l,n),$n>0&&!r&&nt&&(l.shapeFlag&6?nt[nt.indexOf(e)]=l:nt.push(l)),l.patchFlag=-2,l}if(Da(e)&&(e=e.__vccOpts),t){t=Ea(t);let{class:l,style:a}=t;l&&!Oe(l)&&(t.class=Ie(l)),ve(a)&&(fo(a)&&!X(a)&&(a=Ue({},a)),t.style=Zt(a))}const i=Oe(e)?1:xi(e)?128:xs(e)?64:ve(e)?4:te(e)?2:0;return u(e,t,n,s,o,i,r,!0)}function Ea(e){return e?fo(e)||ci(e)?Ue({},e):e:null}function pn(e,t,n=!1,s=!1){const{props:o,ref:r,patchFlag:i,children:l,transition:a}=e,d=t?Sa(o||{},t):o,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&yi(d),ref:t&&t.ref?n&&r?X(r)?r.concat(ts(t)):[r,ts(t)]:ts(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==fe?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&pn(e.ssContent),ssFallback:e.ssFallback&&pn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&mo(c,a.clone(c)),c}function we(e=" ",t=0){return Pe(ws,null,e,t)}function wi(e,t){const n=Pe(es,null,e);return n.staticCount=t,n}function ee(e="",t=!1){return t?(w(),dn(_t,null,e)):Pe(_t,null,e)}function vt(e){return e==null||typeof e=="boolean"?Pe(_t):X(e)?Pe(fe,null,e.slice()):Nn(e)?kt(e):Pe(ws,null,String(e))}function kt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:pn(e)}function as(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(X(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),as(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!ci(t)?t._ctx=je:o===3&&je&&(je.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(te(t)){if(s&65){as(e,{default:t});return}t={default:t,_ctx:je},n=32}else t=String(t),s&64?(n=16,t=[we(t)]):n=8;e.children=t,e.shapeFlag|=n}function Sa(...e){const t={};for(let n=0;nBe||je;let us,Dn;{const e=ms(),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)}};us=t("__VUE_INSTANCE_SETTERS__",n=>Be=n),Dn=t("__VUE_SSR_SETTERS__",n=>Mn=n)}const Hn=e=>{const t=Be;return us(e),e.scope.on(),()=>{e.scope.off(),us(t)}},Lo=()=>{Be&&Be.scope.off(),us(null)};function Ci(e){return e.vnode.shapeFlag&4}let Mn=!1;function Pa(e,t=!1,n=!1){t&&Dn(t);const{props:s,children:o}=e.vnode,r=Ci(e);da(e,s,r,t),ga(e,o,n||t);const i=r?Oa(e,t):void 0;return t&&Dn(!1),i}function Oa(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Yl);const{setup:s}=n;if(s){Tt();const o=e.setupContext=s.length>1?$a(e):null,r=Hn(e),i=Ln(s,e,0,[e.props,o]),l=_r(i);if($t(),r(),(l||e.sp)&&!an(e)&&Zr(e),l){if(i.then(Lo,Lo),t)return i.then(a=>{Dn(!0);try{Fo(e,a,t)}finally{Dn(!1)}}).catch(a=>{bs(a,e,0)});e.asyncDep=i}else Fo(e,i)}else Ei(e)}function Fo(e,t,n){te(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ve(t)&&(e.setupState=Br(t)),Ei(e)}function Ei(e,t,n){const s=e.type;e.render||(e.render=s.render||xt);{const o=Hn(e);Tt();try{Xl(e)}finally{$t(),o()}}}const Ta={get(e,t){return He(e,"get",""),e[t]}};function $a(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Ta),slots:e.slots,emit:e.emit,expose:t}}function Cs(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Br(_l(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Rn)return Rn[n](e)},has(t,n){return n in t||n in Rn}})):e.proxy}function Na(e,t=!0){return te(e)?e.displayName||e.name:e.name||t&&e.__name}function Da(e){return te(e)&&"__vccOpts"in e}const ye=(e,t)=>Sl(e,t,Mn);function Si(e,t,n){try{ls(-1);const s=arguments.length;return s===2?ve(t)&&!X(t)?Nn(t)?Pe(e,null,[t]):Pe(e,t):Pe(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Nn(n)&&(n=[n]),Pe(e,t,n))}finally{ls(1)}}const Ma="3.5.41";/** +* @vue/runtime-dom v3.5.41 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Qs;const Ho=typeof window<"u"&&window.trustedTypes;if(Ho)try{Qs=Ho.createPolicy("vue",{createHTML:e=>e})}catch{}const Ai=Qs?e=>Qs.createHTML(e):e=>e,Va="http://www.w3.org/2000/svg",ja="http://www.w3.org/1998/Math/MathML",St=typeof document<"u"?document:null,Bo=St&&St.createElement("template"),Ua={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"?St.createElementNS(Va,e):t==="mathml"?St.createElementNS(ja,e):n?St.createElement(e,{is:n}):St.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>St.createTextNode(e),createComment:e=>St.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>St.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{Bo.innerHTML=Ai(s==="svg"?`${e}`:s==="mathml"?`${e}`:e);const l=Bo.content;if(s==="svg"||s==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},La=Symbol("_vtc");function Fa(e,t,n){const s=e[La];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Ko=Symbol("_vod"),Ha=Symbol("_vsh"),Ba=Symbol(""),Ka=/(?:^|;)\s*display\s*:/;function qa(e,t,n){const s=e.style,o=Oe(n);let r=!1;if(n&&!o){if(t)if(Oe(t))for(const i of t.split(";")){const l=i.slice(0,i.indexOf(":")).trim();n[l]==null&&wn(s,l,"")}else for(const i in t)n[i]==null&&wn(s,i,"");for(const i in n){i==="display"&&(r=!0);const l=n[i];l!=null?Wa(e,i,!Oe(t)&&t?t[i]:void 0,l)||wn(s,i,l):wn(s,i,"")}}else if(o){if(t!==n){const i=s[Ba];i&&(n+=";"+i),s.cssText=n,r=Ka.test(n)}}else t&&e.removeAttribute("style");Ko in e&&(e[Ko]=r?s.display:"",e[Ha]&&(s.display="none"))}const qo=/\s*!important$/;function wn(e,t,n){if(X(n))n.forEach(s=>wn(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=Ga(e,t);qo.test(n)?e.setProperty(en(s),n.replace(qo,""),"important"):e[s]=n}}const Go=["Webkit","Moz","ms"],Ns={};function Ga(e,t){const n=Ns[t];if(n)return n;let s=Ye(t);if(s!=="filter"&&s in e)return Ns[t]=s;s=ps(s);for(let o=0;oDs||(Za.then(()=>Ds=0),Ds=Date.now());function tu(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(X(o)){const r=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{r.call(s),s._stopped=!0};const i=o.slice(),l=[s];for(let a=0;ae.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,nu=(e,t,n,s,o,r)=>{const i=o==="svg";t==="class"?Fa(e,s,i):t==="style"?qa(e,n,s):cs(t)?fs(t)||Ja(e,t,n,s,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):su(e,t,s,i))?(Jo(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&zo(e,t,s,i,r,t!=="value")):e._isVueCE&&(ou(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Oe(s)))?Jo(e,Ye(t),s,r,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),zo(e,t,s,i))};function su(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Yo(t)&&te(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 Yo(t)&&Oe(n)?!1:t in e}function ou(e,t){const n=e._def.props;if(!n)return!1;const s=Ye(t);return Array.isArray(n)?n.some(o=>Ye(o)===s):Object.keys(n).some(o=>Ye(o)===s)}const qt=e=>{const t=e.props["onUpdate:modelValue"]||!1;return X(t)?n=>Xn(t,n):t};function ru(e){e.target.composing=!0}function Xo(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const st=Symbol("_assign"),Jn=Symbol("_initialValue");function Ms(e,t,n){return t&&(e=e.trim()),n&&(e=hs(e)),e}const xe={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e.parentNode&&(e.type==="text"?e[Jn]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[Jn]=e.defaultValue.replace(/\r\n?/g,` +`))),e[st]=qt(o);const r=s||o.props&&o.props.type==="number";Pt(e,t?"change":"input",i=>{i.target.composing||e[st](Ms(e.value,n,r))}),(n||r)&&Pt(e,"change",()=>{e.value=Ms(e.value,n,r)}),t||(Pt(e,"compositionstart",ru),Pt(e,"compositionend",Xo),Pt(e,"change",Xo))},mounted(e,{value:t,modifiers:{trim:n,number:s}}){const o=t??"",r=e[Jn];delete e[Jn],r!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==r?e[st](Ms(e.value,n,s)):e.value=o},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:r}},i){if(e[st]=qt(i),e.composing)return;const l=(r||e.type==="number")&&!/^0\d/.test(e.value)?hs(e.value):e.value,a=t??"";if(l===a)return;const d=e.getRootNode();(d instanceof Document||d instanceof ShadowRoot)&&d.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===a)||(e.value=a)}},At={deep:!0,created(e,t,n){e[st]=qt(n),Pt(e,"change",()=>{const s=e._modelValue,o=hn(e),r=e.checked,i=e[st];if(X(s)){const l=oo(s,o),a=l!==-1;if(r&&!a)i(s.concat(o));else if(!r&&a){const d=[...s];d.splice(l,1),i(d)}}else if(vn(s)){const l=new Set(s);r?l.add(o):l.delete(o),i(l)}else i(ki(e,r))})},mounted:Zo,beforeUpdate(e,t,n){e[st]=qt(n),Zo(e,t,n)}};function Zo(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(X(t))o=oo(t,s.props.value)>-1;else if(vn(t))o=t.has(s.props.value);else{if(t===n)return;o=Kt(t,ki(e,!0))}e.checked!==o&&(e.checked=o)}const iu={created(e,{value:t},n){e.checked=Kt(t,n.props.value),e[st]=qt(n),Pt(e,"change",()=>{e[st](hn(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[st]=qt(s),t!==n&&(e.checked=Kt(t,s.props.value))}},Vn={deep:!0,created(e,{value:t,modifiers:{number:n}},s){e._modelValue=t,Pt(e,"change",()=>{const o=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?hs(hn(r)):hn(r));e[st](e.multiple?vn(e._modelValue)?new Set(o):o:o[0]),e._assigning=!0,po(()=>{e._assigning=!1})}),e[st]=qt(s)},mounted(e,{value:t}){er(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[st]=qt(n)},updated(e,{value:t}){e._assigning||er(e,t)}};function er(e,t){const n=e.multiple,s=X(t);if(!(n&&!s&&!vn(t))){for(let o=0,r=e.options.length;oString(d)===String(l)):i.selected=oo(t,l)>-1}else i.selected=t.has(l);else if(Kt(hn(i),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function hn(e){return"_value"in e?e._value:e.value}function ki(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const lu=["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)=>lu.some(n=>e[`${n}Key`]&&!t.includes(n))},ze=(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;!te(r)&&!r.render&&!r.template&&(r.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const i=n(o,!1,du(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t});function du(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function pu(e){return Oe(e)?document.querySelector(e):e}/*! + * vue-router v4.6.4 + * (c) 2025 Eduardo San Martin Morote + * @license MIT + */const sn=typeof document<"u";function Ri(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function hu(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Ri(e.default)}const he=Object.assign;function Vs(e,t){const n={};for(const s in t){const o=t[s];n[s]=pt(o)?o.map(e):e(o)}return n}const In=()=>{},pt=Array.isArray;function nr(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}const Ii=/#/g,mu=/&/g,gu=/\//g,vu=/=/g,bu=/\?/g,Pi=/\+/g,xu=/%5B/g,_u=/%5D/g,Oi=/%5E/g,yu=/%60/g,Ti=/%7B/g,wu=/%7C/g,$i=/%7D/g,Cu=/%20/g;function yo(e){return e==null?"":encodeURI(""+e).replace(wu,"|").replace(xu,"[").replace(_u,"]")}function Eu(e){return yo(e).replace(Ti,"{").replace($i,"}").replace(Oi,"^")}function Ys(e){return yo(e).replace(Pi,"%2B").replace(Cu,"+").replace(Ii,"%23").replace(mu,"%26").replace(yu,"`").replace(Ti,"{").replace($i,"}").replace(Oi,"^")}function Su(e){return Ys(e).replace(vu,"%3D")}function Au(e){return yo(e).replace(Ii,"%23").replace(bu,"%3F")}function ku(e){return Au(e).replace(gu,"%2F")}function jn(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Ru=/\/$/,Iu=e=>e.replace(Ru,"");function js(e,t,n="/"){let s,o={},r="",i="";const l=t.indexOf("#");let a=t.indexOf("?");return a=l>=0&&a>l?-1:a,a>=0&&(s=t.slice(0,a),r=t.slice(a,l>0?l:t.length),o=e(r.slice(1))),l>=0&&(s=s||t.slice(0,l),i=t.slice(l,t.length)),s=$u(s??t,n),{fullPath:s+r+i,path:s,query:o,hash:jn(i)}}function Pu(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function sr(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Ou(e,t,n){const s=t.matched.length-1,o=n.matched.length-1;return s>-1&&s===o&&mn(t.matched[s],n.matched[o])&&Ni(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function mn(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Ni(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Tu(e[n],t[n]))return!1;return!0}function Tu(e,t){return pt(e)?or(e,t):pt(t)?or(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function or(e,t){return pt(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function $u(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,l;for(i=0;i1&&r--;else break;return n.slice(0,r).join("/")+"/"+s.slice(i).join("/")}const Ut={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Xs=(function(e){return e.pop="pop",e.push="push",e})({}),Us=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function Nu(e){if(!e)if(sn){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Iu(e)}const Du=/^[^#]+#/;function Mu(e,t){return e.replace(Du,"#")+t}function Vu(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 Es=()=>({left:window.scrollX,top:window.scrollY});function ju(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=Vu(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 rr(e,t){return(history.state?history.state.position-t:-1)+e}const Zs=new Map;function Uu(e,t){Zs.set(e,t)}function Lu(e){const t=Zs.get(e);return Zs.delete(e),t}function Fu(e){return typeof e=="string"||e&&typeof e=="object"}function Di(e){return typeof e=="string"||typeof e=="symbol"}let Re=(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 Mi=Symbol("");Re.MATCHER_NOT_FOUND+"",Re.NAVIGATION_GUARD_REDIRECT+"",Re.NAVIGATION_ABORTED+"",Re.NAVIGATION_CANCELLED+"",Re.NAVIGATION_DUPLICATED+"";function gn(e,t){return he(new Error,{type:e,[Mi]:!0},t)}function Et(e,t){return e instanceof Error&&Mi 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 Ku(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let s=0;so&&Ys(o)):[s&&Ys(s)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+n,o!=null&&(t+="="+o))})}return t}function qu(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=pt(s)?s.map(o=>o==null?null:""+o):s==null?s:""+s)}return t}const Gu=Symbol(""),lr=Symbol(""),Ss=Symbol(""),wo=Symbol(""),eo=Symbol("");function _n(){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 Ft(e,t,n,s,o,r=i=>i()){const i=s&&(s.enterCallbacks[o]=s.enterCallbacks[o]||[]);return()=>new Promise((l,a)=>{const d=g=>{g===!1?a(gn(Re.NAVIGATION_ABORTED,{from:n,to:t})):g instanceof Error?a(g):Fu(g)?a(gn(Re.NAVIGATION_GUARD_REDIRECT,{from:t,to:g})):(i&&s.enterCallbacks[o]===i&&typeof g=="function"&&i.push(g),l())},c=r(()=>e.call(s&&s.instances[o],t,n,d));let h=Promise.resolve(c);e.length<3&&(h=h.then(d)),h.catch(g=>a(g))})}function Ls(e,t,n,s,o=r=>r()){const r=[];for(const i of e)for(const l in i.components){let a=i.components[l];if(!(t!=="beforeRouteEnter"&&!i.instances[l]))if(Ri(a)){const d=(a.__vccOpts||a)[t];d&&r.push(Ft(d,n,s,i,l,o))}else{let d=a();r.push(()=>d.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${l}" at "${i.path}"`);const h=hu(c)?c.default:c;i.mods[l]=c,i.components[l]=h;const g=(h.__vccOpts||h)[t];return g&&Ft(g,n,s,i,l,o)()}))}}return r}function Wu(e,t){const n=[],s=[],o=[],r=Math.max(t.matched.length,e.matched.length);for(let i=0;imn(d,l))?s.push(l):n.push(l));const a=e.matched[i];a&&(t.matched.find(d=>mn(d,a))||o.push(a))}return[n,s,o]}/*! + * vue-router v4.6.4 + * (c) 2025 Eduardo San Martin Morote + * @license MIT + */let zu=()=>location.protocol+"//"+location.host;function Vi(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,l=o.slice(i);return l[0]!=="/"&&(l="/"+l),sr(l,"")}return sr(n,e)+s+o}function Ju(e,t,n,s){let o=[],r=[],i=null;const l=({state:g})=>{const x=Vi(e,location),j=n.value,O=t.value;let W=0;if(g){if(n.value=x,t.value=g,i&&i===j){i=null;return}W=O?g.position-O.position:0}else s(x);o.forEach(K=>{K(n.value,j,{delta:W,type:Xs.pop,direction:W?W>0?Us.forward:Us.back:Us.unknown})})};function a(){i=n.value}function d(g){o.push(g);const x=()=>{const j=o.indexOf(g);j>-1&&o.splice(j,1)};return r.push(x),x}function c(){if(document.visibilityState==="hidden"){const{history:g}=window;if(!g.state)return;g.replaceState(he({},g.state,{scroll:Es()}),"")}}function h(){for(const g of r)g();r=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:a,listen:d,destroy:h}}function ar(e,t,n,s=!1,o=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:o?Es():null}}function Qu(e){const{history:t,location:n}=window,s={value:Vi(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(a,d,c){const h=e.indexOf("#"),g=h>-1?(n.host&&document.querySelector("base")?e:e.slice(h))+a:zu()+e+a;try{t[c?"replaceState":"pushState"](d,"",g),o.value=d}catch(x){console.error(x),n[c?"replace":"assign"](g)}}function i(a,d){r(a,he({},t.state,ar(o.value.back,a,o.value.forward,!0),d,{position:o.value.position}),!0),s.value=a}function l(a,d){const c=he({},o.value,t.state,{forward:a,scroll:Es()});r(c.current,c,!0),r(a,he({},ar(s.value,a,null),{position:c.position+1},d),!1),s.value=a}return{location:s,state:o,push:l,replace:i}}function Yu(e){e=Nu(e);const t=Qu(e),n=Ju(e,t.state,t.location,t.replace);function s(r,i=!0){i||n.pauseListeners(),history.go(r)}const o=he({location:"",base:e,go:s,createHref:Mu.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 Qt=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Ne=(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})(Ne||{});const Xu={type:Qt.Static,value:""},Zu=/[a-zA-Z0-9_]/;function ec(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=Ne.Static,s=n;const o=[];let r;function i(){r&&o.push(r),r=[]}let l=0,a,d="",c="";function h(){d&&(n===Ne.Static?r.push({type:Qt.Static,value:d}):n===Ne.Param||n===Ne.ParamRegExp||n===Ne.ParamRegExpEnd?(r.length>1&&(a==="*"||a==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),r.push({type:Qt.Param,value:d,regexp:c,repeatable:a==="*"||a==="+",optional:a==="*"||a==="?"})):t("Invalid state to consume buffer"),d="")}function g(){d+=a}for(;lt.length?t.length===1&&t[0]===We.Static+We.Segment?1:-1:0}function ji(e,t){let n=0;const s=e.score,o=t.score;for(;n0&&t[t.length-1]<0}const rc={strict:!1,end:!0,sensitive:!1};function ic(e,t,n){const s=sc(ec(e.path),n),o=he(s,{record:e,parent:t,children:[],alias:[]});return t&&!o.record.aliasOf==!t.record.aliasOf&&t.children.push(o),o}function lc(e,t){const n=[],s=new Map;t=nr(rc,t);function o(h){return s.get(h)}function r(h,g,x){const j=!x,O=dr(h);O.aliasOf=x&&x.record;const W=nr(t,h),K=[O];if("alias"in h){const I=typeof h.alias=="string"?[h.alias]:h.alias;for(const A of I)K.push(dr(he({},O,{components:x?x.record.components:O.components,path:A,aliasOf:x?x.record:O})))}let D,q;for(const I of K){const{path:A}=I;if(g&&A[0]!=="/"){const M=g.record.path,ne=M[M.length-1]==="/"?"":"/";I.path=g.record.path+(A&&ne+A)}if(D=ic(I,g,W),x?x.alias.push(D):(q=q||D,q!==D&&q.alias.push(D),j&&h.name&&!pr(D)&&i(h.name)),Ui(D)&&a(D),O.children){const M=O.children;for(let ne=0;ne{i(q)}:In}function i(h){if(Di(h)){const g=s.get(h);g&&(s.delete(h),n.splice(n.indexOf(g),1),g.children.forEach(i),g.alias.forEach(i))}else{const g=n.indexOf(h);g>-1&&(n.splice(g,1),h.record.name&&s.delete(h.record.name),h.children.forEach(i),h.alias.forEach(i))}}function l(){return n}function a(h){const g=cc(h,n);n.splice(g,0,h),h.record.name&&!pr(h)&&s.set(h.record.name,h)}function d(h,g){let x,j={},O,W;if("name"in h&&h.name){if(x=s.get(h.name),!x)throw gn(Re.MATCHER_NOT_FOUND,{location:h});W=x.record.name,j=he(fr(g.params,x.keys.filter(q=>!q.optional).concat(x.parent?x.parent.keys.filter(q=>q.optional):[]).map(q=>q.name)),h.params&&fr(h.params,x.keys.map(q=>q.name))),O=x.stringify(j)}else if(h.path!=null)O=h.path,x=n.find(q=>q.re.test(O)),x&&(j=x.parse(O),W=x.record.name);else{if(x=g.name?s.get(g.name):n.find(q=>q.re.test(g.path)),!x)throw gn(Re.MATCHER_NOT_FOUND,{location:h,currentLocation:g});W=x.record.name,j=he({},g.params,h.params),O=x.stringify(j)}const K=[];let D=x;for(;D;)K.unshift(D.record),D=D.parent;return{name:W,path:O,params:j,matched:K,meta:uc(K)}}e.forEach(h=>r(h));function c(){n.length=0,s.clear()}return{addRoute:r,resolve:d,removeRoute:i,clearRoutes:c,getRoutes:l,getRecordMatcher:o}}function fr(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function dr(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:ac(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 ac(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 pr(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function uc(e){return e.reduce((t,n)=>he(t,n.meta),{})}function cc(e,t){let n=0,s=t.length;for(;n!==s;){const r=n+s>>1;ji(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(Ui(t)&&ji(e,t)===0)return t}function Ui({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function hr(e){const t=ut(Ss),n=ut(wo),s=ye(()=>{const a=De(e.to);return t.resolve(a)}),o=ye(()=>{const{matched:a}=s.value,{length:d}=a,c=a[d-1],h=n.matched;if(!c||!h.length)return-1;const g=h.findIndex(mn.bind(null,c));if(g>-1)return g;const x=mr(a[d-2]);return d>1&&mr(c)===x&&h[h.length-1].path!==x?h.findIndex(mn.bind(null,a[d-2])):g}),r=ye(()=>o.value>-1&&gc(n.params,s.value.params)),i=ye(()=>o.value>-1&&o.value===n.matched.length-1&&Ni(n.params,s.value.params));function l(a={}){if(mc(a)){const d=t[De(e.replace)?"replace":"push"](De(e.to)).catch(In);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:s,href:ye(()=>s.value.href),isActive:r,isExactActive:i,navigate:l}}function dc(e){return e.length===1?e[0]:e}const pc=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:hr,setup(e,{slots:t}){const n=vs(hr(e)),{options:s}=ut(Ss),o=ye(()=>({[gr(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[gr(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const r=t.default&&dc(t.default(n));return e.custom?r:Si("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},r)}}}),hc=pc;function mc(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(!pt(o)||o.length!==s.length||s.some((r,i)=>r.valueOf()!==o[i].valueOf()))return!1}return!0}function mr(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const gr=(e,t,n)=>e??t??n,vc=Xr({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=ut(eo),o=ye(()=>e.route||s.value),r=ut(lr,0),i=ye(()=>{let d=De(r);const{matched:c}=o.value;let h;for(;(h=c[d])&&!h.components;)d++;return d}),l=ye(()=>o.value.matched[i.value]);Zn(lr,ye(()=>i.value+1)),Zn(Gu,l),Zn(eo,o);const a=z();return Bt(()=>[a.value,l.value,e.name],([d,c,h],[g,x,j])=>{c&&(c.instances[h]=d,x&&x!==c&&d&&d===g&&(c.leaveGuards.size||(c.leaveGuards=x.leaveGuards),c.updateGuards.size||(c.updateGuards=x.updateGuards))),d&&c&&(!x||!mn(c,x)||!g)&&(c.enterCallbacks[h]||[]).forEach(O=>O(d))},{flush:"post"}),()=>{const d=o.value,c=e.name,h=l.value,g=h&&h.components[c];if(!g)return vr(n.default,{Component:g,route:d});const x=h.props[c],j=x?x===!0?d.params:typeof x=="function"?x(d):x:null,W=Si(g,he({},j,t,{onVnodeUnmounted:K=>{K.component.isUnmounted&&(h.instances[c]=null)},ref:a}));return vr(n.default,{Component:W,route:d})||W}}});function vr(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const bc=vc;function xc(e){const t=lc(e.routes,e),n=e.parseQuery||Ku,s=e.stringifyQuery||ir,o=e.history,r=_n(),i=_n(),l=_n(),a=yl(Ut);let d=Ut;sn&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=Vs.bind(null,C=>""+C),h=Vs.bind(null,ku),g=Vs.bind(null,jn);function x(C,B){let U,T;return Di(C)?(U=t.getRecordMatcher(C),T=B):T=C,t.addRoute(T,U)}function j(C){const B=t.getRecordMatcher(C);B&&t.removeRoute(B)}function O(){return t.getRoutes().map(C=>C.record)}function W(C){return!!t.getRecordMatcher(C)}function K(C,B){if(B=he({},B||a.value),typeof C=="string"){const m=js(n,C,B.path),y=t.resolve({path:m.path},B),S=o.createHref(m.fullPath);return he(m,y,{params:g(y.params),hash:jn(m.hash),redirectedFrom:void 0,href:S})}let U;if(C.path!=null)U=he({},C,{path:js(n,C.path,B.path).path});else{const m=he({},C.params);for(const y in m)m[y]==null&&delete m[y];U=he({},C,{params:h(m)}),B.params=h(B.params)}const T=t.resolve(U,B),re=C.hash||"";T.params=c(g(T.params));const f=Pu(s,he({},C,{hash:Eu(re),path:T.path})),p=o.createHref(f);return he({fullPath:f,hash:re,query:s===ir?qu(C.query):C.query||{}},T,{redirectedFrom:void 0,href:p})}function D(C){return typeof C=="string"?js(n,C,a.value.path):he({},C)}function q(C,B){if(d!==C)return gn(Re.NAVIGATION_CANCELLED,{from:B,to:C})}function I(C){return ne(C)}function A(C){return I(he(D(C),{replace:!0}))}function M(C,B){const U=C.matched[C.matched.length-1];if(U&&U.redirect){const{redirect:T}=U;let re=typeof T=="function"?T(C,B):T;return typeof re=="string"&&(re=re.includes("?")||re.includes("#")?re=D(re):{path:re},re.params={}),he({query:C.query,hash:C.hash,params:re.path!=null?{}:C.params},re)}}function ne(C,B){const U=d=K(C),T=a.value,re=C.state,f=C.force,p=C.replace===!0,m=M(U,T);if(m)return ne(he(D(m),{state:typeof m=="object"?he({},re,m.state):re,force:f,replace:p}),B||U);const y=U;y.redirectedFrom=B;let S;return!f&&Ou(s,T,U)&&(S=gn(Re.NAVIGATION_DUPLICATED,{to:y,from:T}),Ze(T,T,!0,!1)),(S?Promise.resolve(S):Z(y,T)).catch(_=>Et(_)?Et(_,Re.NAVIGATION_GUARD_REDIRECT)?_:lt(_):ae(_,y,T)).then(_=>{if(_){if(Et(_,Re.NAVIGATION_GUARD_REDIRECT))return ne(he({replace:p},D(_.to),{state:typeof _.to=="object"?he({},re,_.to.state):re,force:f}),B||y)}else _=Te(y,T,!0,p,re);return V(y,T,_),_})}function F(C,B){const U=q(C,B);return U?Promise.reject(U):Promise.resolve()}function Ae(C){const B=jt.values().next().value;return B&&typeof B.runWithContext=="function"?B.runWithContext(C):C()}function Z(C,B){let U;const[T,re,f]=Wu(C,B);U=Ls(T.reverse(),"beforeRouteLeave",C,B);for(const m of T)m.leaveGuards.forEach(y=>{U.push(Ft(y,C,B))});const p=F.bind(null,C,B);return U.push(p),et(U).then(()=>{U=[];for(const m of r.list())U.push(Ft(m,C,B));return U.push(p),et(U)}).then(()=>{U=Ls(re,"beforeRouteUpdate",C,B);for(const m of re)m.updateGuards.forEach(y=>{U.push(Ft(y,C,B))});return U.push(p),et(U)}).then(()=>{U=[];for(const m of f)if(m.beforeEnter)if(pt(m.beforeEnter))for(const y of m.beforeEnter)U.push(Ft(y,C,B));else U.push(Ft(m.beforeEnter,C,B));return U.push(p),et(U)}).then(()=>(C.matched.forEach(m=>m.enterCallbacks={}),U=Ls(f,"beforeRouteEnter",C,B,Ae),U.push(p),et(U))).then(()=>{U=[];for(const m of i.list())U.push(Ft(m,C,B));return U.push(p),et(U)}).catch(m=>Et(m,Re.NAVIGATION_CANCELLED)?m:Promise.reject(m))}function V(C,B,U){l.list().forEach(T=>Ae(()=>T(C,B,U)))}function Te(C,B,U,T,re){const f=q(C,B);if(f)return f;const p=B===Ut,m=sn?history.state:{};U&&(T||p?o.replace(C.fullPath,he({scroll:p&&m&&m.scroll},re)):o.push(C.fullPath,re)),a.value=C,Ze(C,B,U,p),lt()}let G;function Xe(){G||(G=o.listen((C,B,U)=>{if(!yt.listening)return;const T=K(C),re=M(T,yt.currentRoute.value);if(re){ne(he(re,{replace:!0,force:!0}),T).catch(In);return}d=T;const f=a.value;sn&&Uu(rr(f.fullPath,U.delta),Es()),Z(T,f).catch(p=>Et(p,Re.NAVIGATION_ABORTED|Re.NAVIGATION_CANCELLED)?p:Et(p,Re.NAVIGATION_GUARD_REDIRECT)?(ne(he(D(p.to),{force:!0}),T).then(m=>{Et(m,Re.NAVIGATION_ABORTED|Re.NAVIGATION_DUPLICATED)&&!U.delta&&U.type===Xs.pop&&o.go(-1,!1)}).catch(In),Promise.reject()):(U.delta&&o.go(-U.delta,!1),ae(p,T,f))).then(p=>{p=p||Te(T,f,!1),p&&(U.delta&&!Et(p,Re.NAVIGATION_CANCELLED)?o.go(-U.delta,!1):U.type===Xs.pop&&Et(p,Re.NAVIGATION_ABORTED|Re.NAVIGATION_DUPLICATED)&&o.go(-1,!1)),V(T,f,p)}).catch(In)}))}let Mt=_n(),Ce=_n(),ce;function ae(C,B,U){lt(C);const T=Ce.list();return T.length?T.forEach(re=>re(C,B,U)):console.error(C),Promise.reject(C)}function oe(){return ce&&a.value!==Ut?Promise.resolve():new Promise((C,B)=>{Mt.add([C,B])})}function lt(C){return ce||(ce=!C,Xe(),Mt.list().forEach(([B,U])=>C?U(C):B()),Mt.reset()),C}function Ze(C,B,U,T){const{scrollBehavior:re}=e;if(!sn||!re)return Promise.resolve();const f=!U&&Lu(rr(C.fullPath,0))||(T||!U)&&history.state&&history.state.scroll||null;return po().then(()=>re(C,B,f)).then(p=>p&&ju(p)).catch(p=>ae(p,C,B))}const Le=C=>o.go(C);let Vt;const jt=new Set,yt={currentRoute:a,listening:!0,addRoute:x,removeRoute:j,clearRoutes:t.clearRoutes,hasRoute:W,getRoutes:O,resolve:K,options:e,push:I,replace:A,go:Le,back:()=>Le(-1),forward:()=>Le(1),beforeEach:r.add,beforeResolve:i.add,afterEach:l.add,onError:Ce.add,isReady:oe,install(C){C.component("RouterLink",hc),C.component("RouterView",bc),C.config.globalProperties.$router=yt,Object.defineProperty(C.config.globalProperties,"$route",{enumerable:!0,get:()=>De(a)}),sn&&!Vt&&a.value===Ut&&(Vt=!0,I(o.location).catch(T=>{}));const B={};for(const T in Ut)Object.defineProperty(B,T,{get:()=>a.value[T],enumerable:!0});C.provide(Ss,yt),C.provide(wo,Fr(B)),C.provide(eo,a);const U=C.unmount;jt.add(C),C.unmount=function(){jt.delete(C),jt.size<1&&(d=Ut,G&&G(),G=null,a.value=Ut,Vt=!1,ce=!1),U()}}};function et(C){return C.reduce((B,U)=>B.then(()=>Ae(U)),Promise.resolve())}return yt}function Co(){return ut(Ss)}function Li(e){return ut(wo)}const Qn=window.location.pathname.startsWith("/portal/"),Qe={esPortal:Qn,baseRuta:Qn?"/portal/studio/":"/studio/",apiBase:Qn?"/portal":"/app",urlLogin:Qn?"/portal/login":"/login"};function ie(e){return Qe.apiBase+e}async function Yn(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 le={get:e=>Yn(e),post:(e,t)=>Yn(e,{method:"POST",body:JSON.stringify(t)}),put:(e,t)=>Yn(e,{method:"PUT",body:JSON.stringify(t)}),del:e=>Yn(e,{method:"DELETE"})},Cn=z(!1),_c={class:"h-14 px-4 flex items-center gap-2 border-b border-borde"},yc={key:0,class:"px-3 pt-3"},wc={key:1,class:"px-3 pt-2 text-xs text-red-600 dark:text-red-400"},Cc={class:"flex-1 overflow-y-auto px-2 py-3 space-y-0.5"},Ec={key:0,class:"px-2 text-xs text-tenue"},Sc={key:1,class:"px-2 text-xs text-tenue"},Ac={class:"truncate"},kc={class:"flex items-center gap-1 mt-0.5"},Rc={class:"text-[11px] text-tenue"},Ic={key:0,class:"flex opacity-0 group-hover:opacity-100 transition-opacity pr-1.5 gap-0.5"},Pc=["onClick"],Oc=["onClick"],Tc={class:"card w-full max-w-lg p-6 animate-escalar shadow-2xl"},$c={class:"font-semibold text-texto mb-4"},Nc={key:0,class:"grid grid-cols-2 gap-3"},Dc=["value"],Mc={class:"text-[11px] text-tenue mt-1"},Vc=["value"],jc={class:"text-[11px] text-tenue mt-1"},Uc={class:"flex items-center gap-2 text-sm text-texto"},Lc={class:"flex justify-end gap-2 pt-2"},Fc={__name:"Sidebar",setup(e,{expose:t}){const n=Li(),s=Co(),o=z([]),r=z([]),i=z([]),l=z(!0),a=z(""),d=z(!1),c=z(null),h=z(x()),g=ye(()=>n.params.tenantId||n.params.id);Bt(()=>n.fullPath,()=>{Cn.value=!1});function x(){return{nombre:"",dominios_permitidos:"",activo:!0,cliente_id:null,plan_id:null}}async function j(){l.value=!0,a.value="";try{const A=await le.get(ie("/umind/tenants"));o.value=A.items||[]}catch(A){a.value=A.message}finally{l.value=!1}}function O(A){return Array.isArray(A)?A:(A==null?void 0:A.items)||(A==null?void 0:A.registros)||[]}async function W(){if(Qe.esPortal)return;const[A,M]=await Promise.allSettled([le.get("/app/api/clientes/select"),le.get("/app/umind-planes/list")]);r.value=A.status==="fulfilled"?O(A.value):[],i.value=M.status==="fulfilled"?O(M.value):[];const ne=[];A.status==="rejected"&&ne.push("clientes"),M.status==="rejected"&&ne.push("planes"),ne.length&&(a.value=`No se pudo cargar la lista de ${ne.join(" ni ")}.`)}function K(){c.value=null,h.value=x(),d.value=!0}function D(A){c.value=A,h.value={nombre:A.nombre,dominios_permitidos:A.dominios_permitidos,activo:A.activo,cliente_id:A.cliente_id??null,plan_id:A.plan_id??null},d.value=!0}async function q(){const A={...h.value,dominios_permitidos:h.value.dominios_permitidos.split(",").map(M=>M.trim()).filter(Boolean)};try{if(c.value)await le.put(ie(`/umind/tenants/${c.value.ID}`),A),d.value=!1,await j();else{const M=await le.post(ie("/umind/tenants"),A);d.value=!1,await j(),s.push(`/tenants/${M.id}`)}}catch(M){a.value=M.message}}async function I(A){confirm(`¿Eliminar el tenant "${A.nombre}"? Esto borra también sus agentes. No se puede deshacer.`)&&(await le.del(ie(`/umind/tenants/${A.ID}`)),g.value===String(A.ID)&&s.push("/"),await j())}return t({recargar:j}),vo(()=>{j(),W()}),(A,M)=>{const ne=Fn("router-link");return w(),E(fe,null,[De(Cn)?(w(),E("div",{key:0,class:"fixed inset-0 bg-black/50 z-30 md:hidden",onClick:M[0]||(M[0]=F=>Cn.value=!1)})):ee("",!0),u("aside",{class:Ie(["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",De(Cn)?"translate-x-0":"-translate-x-full"])},[u("div",_c,[Pe(ne,{to:"/",class:"flex items-center gap-2 text-base font-semibold text-texto"},{default:Ht(()=>[...M[8]||(M[8]=[u("svg",{viewBox:"0 0 96 96",class:"w-6 h-6 shrink-0","aria-hidden":"true"},[u("rect",{width:"96",height:"96",rx:"22",fill:"#8eb02f"}),u("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"}),u("path",{d:"M60,58 V64",fill:"none",stroke:"#fff","stroke-width":"10","stroke-linecap":"round"}),u("circle",{cx:"60",cy:"28",r:"7",fill:"#fff"})],-1),u("span",null,[we("uMind "),u("span",{class:"text-brand"},"Studio")],-1)])]),_:1})]),De(Qe).esPortal?ee("",!0):(w(),E("div",yc,[u("button",{class:"btn-primary w-full",onClick:K}," + Nuevo tenant ")])),a.value?(w(),E("p",wc,P(a.value),1)):ee("",!0),u("nav",Cc,[l.value?(w(),E("p",Ec,"Cargando...")):o.value.length===0?(w(),E("p",Sc,P(De(Qe).esPortal?"Todavía no tenés ningún espacio asignado. Escribinos y lo activamos.":"Sin tenants todavía."),1)):ee("",!0),(w(!0),E(fe,null,$e(o.value,F=>(w(),E("div",{key:F.ID,class:Ie(["group flex items-center rounded-lg transition-colors",g.value===String(F.ID)?"bg-brand/10":"hover:bg-elevado"])},[Pe(ne,{to:`/tenants/${F.ID}`,class:Ie(["flex-1 min-w-0 px-2.5 py-2 text-sm",g.value===String(F.ID)?"text-brand font-medium":"text-texto"])},{default:Ht(()=>[u("div",Ac,P(F.nombre),1),u("div",kc,[u("span",{class:Ie(["w-1.5 h-1.5 rounded-full",F.activo?"bg-green-500":"bg-tenue/40"])},null,2),u("span",Rc,P(F.activo?"activo":"inactivo"),1)])]),_:2},1032,["to","class"]),De(Qe).esPortal?ee("",!0):(w(),E("div",Ic,[u("button",{class:"p-1 text-tenue hover:text-texto",title:"Editar",onClick:Ae=>D(F)}," ✎ ",8,Pc),u("button",{class:"p-1 text-tenue hover:text-red-600",title:"Eliminar",onClick:Ae=>I(F)}," ✕ ",8,Oc)]))],2))),128))])],2),d.value?(w(),E("div",{key:1,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:M[7]||(M[7]=ze(F=>d.value=!1,["self"]))},[u("div",Tc,[u("h2",$c,P(c.value?"Editar tenant":"Nuevo tenant"),1),M[17]||(M[17]=u("p",{class:"text-xs text-tenue mb-3"}," Un tenant es el negocio/sitio dueño de los dominios permitidos. La config de IA, tono y demás se configuran por agente, dentro del tenant. ",-1)),u("form",{class:"space-y-3",onSubmit:ze(q,["prevent"])},[u("div",null,[M[9]||(M[9]=u("label",{class:"label"},"Nombre",-1)),se(u("input",{"onUpdate:modelValue":M[1]||(M[1]=F=>h.value.nombre=F),required:"",class:"input"},null,512),[[xe,h.value.nombre]])]),u("div",null,[M[10]||(M[10]=u("label",{class:"label"},"Dominios permitidos (separados por coma)",-1)),se(u("input",{"onUpdate:modelValue":M[2]||(M[2]=F=>h.value.dominios_permitidos=F),placeholder:"ejemplo.com, www.ejemplo.com",required:"",class:"input"},null,512),[[xe,h.value.dominios_permitidos]])]),De(Qe).esPortal?ee("",!0):(w(),E("div",Nc,[u("div",null,[M[12]||(M[12]=u("label",{class:"label"},"Cliente",-1)),se(u("select",{"onUpdate:modelValue":M[3]||(M[3]=F=>h.value.cliente_id=F),class:"input"},[M[11]||(M[11]=u("option",{value:null},"— sin asignar —",-1)),(w(!0),E(fe,null,$e(r.value,F=>(w(),E("option",{key:F.ID,value:F.ID},P(F.nombre),9,Dc))),128))],512),[[Vn,h.value.cliente_id]]),u("p",Mc,P(r.value.length?"Define quién ve este tenant desde el portal.":"No hay clientes activos — creá uno en Clientes."),1)]),u("div",null,[M[14]||(M[14]=u("label",{class:"label"},"Plan",-1)),se(u("select",{"onUpdate:modelValue":M[4]||(M[4]=F=>h.value.plan_id=F),class:"input"},[M[13]||(M[13]=u("option",{value:null},"— sin plan —",-1)),(w(!0),E(fe,null,$e(i.value,F=>(w(),E("option",{key:F.ID,value:F.ID},P(F.nombre)+" ("+P(F.max_agentes===0?"∞":F.max_agentes)+" agentes) ",9,Vc))),128))],512),[[Vn,h.value.plan_id]]),u("p",jc,P(i.value.length?"Límite de agentes y precios de consumo.":"No hay planes — creá uno en uMind Planes."),1)])])),u("label",Uc,[se(u("input",{"onUpdate:modelValue":M[5]||(M[5]=F=>h.value.activo=F),type:"checkbox"},null,512),[[At,h.value.activo]]),M[15]||(M[15]=we(" Activo ",-1))]),u("div",Lc,[u("button",{type:"button",class:"btn-ghost",onClick:M[6]||(M[6]=F=>d.value=!1)}," Cancelar "),M[16]||(M[16]=u("button",{type:"submit",class:"btn-primary"}," Guardar ",-1))])],32)])])):ee("",!0)],64)}}},Fi="umind-tema";function Hc(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"oscuro":"claro"}const cn=z(localStorage.getItem(Fi)||Hc());function Hi(){document.documentElement.classList.toggle("dark",cn.value==="oscuro")}function br(){cn.value=cn.value==="oscuro"?"claro":"oscuro",localStorage.setItem(Fi,cn.value),Hi()}Hi();const Bc={class:"min-h-screen flex"},Kc={class:"flex-1 min-w-0 flex flex-col"},qc={class:"h-14 shrink-0 flex items-center gap-1 px-4 sm:px-6 border-b border-borde"},Gc=["title"],Wc={class:"text-base leading-none"},zc={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=Fn("router-view");return w(),E("div",Bc,[Pe(Fc),u("main",Kc,[u("header",qc,[u("button",{class:"btn-ghost !px-2 !py-1.5 md:hidden","aria-label":"Abrir menú",onClick:n[0]||(n[0]=o=>Cn.value=!0)},[...n[2]||(n[2]=[u("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 24 24"},[u("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 6h16M4 12h16M4 18h16"})],-1)])]),n[3]||(n[3]=u("span",{class:"flex-1"},null,-1)),u("button",{class:"btn-ghost !px-2.5 !py-1.5",title:De(cn)==="oscuro"?"Cambiar a claro":"Cambiar a oscuro",onClick:n[1]||(n[1]=(...o)=>De(br)&&De(br)(...o))},[u("span",Wc,P(De(cn)==="oscuro"?"☀️":"🌙"),1)],8,Gc)]),u("div",zc,[Pe(s)])])])}}},Qc={key:0,class:"flex flex-col items-center justify-center py-24 text-sm text-tenue"},Yc={key:1,class:"max-w-md mx-auto text-center py-20"},Xc={key:2,class:"flex flex-col items-center justify-center text-center py-24"},Zc={class:"text-lg font-medium text-texto"},ef={class:"text-sm text-tenue mt-1"},tf={__name:"Home",setup(e){const t=Co(),n=z(Qe.esPortal),s=z(!1);async function o(){if(Qe.esPortal)try{const i=(await le.get(ie("/umind/tenants"))).items||[];if(i.length===0){s.value=!0;return}if(i.length!==1)return;const l=i[0].ID,d=(await le.get(ie(`/umind/agentes?tenant_id=${l}`))).items||[];if(d.length===1){t.replace(`/tenants/${l}/agentes/${d[0].ID}`);return}t.replace(`/tenants/${l}`)}catch{}finally{n.value=!1}}return vo(o),(r,i)=>n.value?(w(),E("div",Qc," Abriendo tu asistente… ")):s.value?(w(),E("div",Yc,[...i[0]||(i[0]=[wi('
🤖

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

',5)])])):(w(),E("div",Xc,[i[1]||(i[1]=u("div",{class:"text-4xl mb-4"},"💬",-1)),u("h1",Zc,P(De(Qe).esPortal?"Elegí tu espacio de la izquierda":"Elegí un tenant de la izquierda"),1),u("p",ef,P(De(Qe).esPortal?"Adentro vas a poder crear y configurar tus agentes.":"o creá uno nuevo para empezar a configurar su agente."),1)]))}},nf={class:"flex flex-col items-center justify-center text-center py-12 px-6"},sf={key:0,class:"text-3xl mb-3 opacity-70"},of={class:"text-sm font-medium text-texto"},rf={key:1,class:"text-xs text-tenue mt-1 max-w-sm"},lf={class:"mt-4"},Bi={__name:"UiEmptyState",props:{icono:{type:String,default:""},titulo:String,detalle:String},setup(e){return(t,n)=>(w(),E("div",nf,[e.icono?(w(),E("div",sf,P(e.icono),1)):ee("",!0),u("p",of,P(e.titulo),1),e.detalle?(w(),E("p",rf,P(e.detalle),1)):ee("",!0),u("div",lf,[Ql(t.$slots,"default")])]))}},af={key:0,class:"mb-6"},uf={class:"flex items-start justify-between gap-4"},cf={class:"text-xl font-semibold text-texto"},ff={class:"text-xs text-tenue mt-1"},df={key:1,class:"text-sm text-red-600 dark:text-red-400 mb-4"},pf={class:"flex items-center justify-between mb-4"},hf={class:"flex items-center gap-2"},mf={key:0,class:"badge-alerta"},gf={key:1,class:"badge-neutro"},vf=["disabled"],bf={key:2,class:"text-xs text-tenue -mt-2 mb-4"},xf={key:3,class:"text-xs text-tenue -mt-2 mb-4"},_f={key:4,class:"grid gap-3 sm:grid-cols-2"},yf=["disabled"],wf={key:6,class:"grid gap-3 sm:grid-cols-2"},Cf={class:"flex items-start gap-3"},Ef={class:"min-w-0 flex-1"},Sf={class:"flex items-center gap-2"},Af={class:"font-medium text-texto truncate"},kf={class:"text-xs text-tenue mt-0.5 truncate"},Rf={class:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0"},If=["onClick"],Pf=["onClick"],Of=["onClick"],Tf={class:"flex items-center gap-4 mt-3.5 pt-3 border-t border-borde text-xs text-tenue"},$f={class:"tabular-nums"},Nf={class:"text-texto font-medium"},Df={class:"tabular-nums"},Mf={class:"text-texto font-medium"},Vf={class:"tabular-nums"},jf={class:"text-texto font-medium"},Uf={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"},Lf={class:"font-semibold text-gray-800 dark:text-gray-100 mb-4"},Ff={key:0},Hf={class:"grid gap-1.5"},Bf=["value"],Kf={class:"min-w-0"},qf={class:"block text-sm text-texto"},Gf={class:"block text-xs text-tenue"},Wf={key:0,class:"block text-xs text-tenue mt-0.5"},zf=["value"],Jf={class:"flex items-center gap-2"},Qf={class:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-300"},Yf={class:"flex justify-end gap-2 pt-2"},Xf={type:"submit",class:"bg-brand hover:bg-brand-dark text-white text-sm font-medium px-4 py-2 rounded-lg"},Zf={__name:"TenantAgentes",props:{id:{type:String,required:!0}},setup(e){const t=e,n=ye(()=>Number(t.id)),s=Co(),o=z(null),r=z([]),i=z([]),l=z(""),a=z(!1),d=z(null),c=z(D()),h=z(null),g=z({}),x=z(!0);function j(Z){const V=g.value[Z.ID]||{};return Z.activo?V.documentos>0?{tipo:"ok",texto:"listo"}:{tipo:"alerta",texto:"sin conocimiento"}:{tipo:"neutro",texto:"inactivo"}}function O(Z){const V=g.value[Z.ID]||{};return{documentos:V.documentos||0,canales:V.canales||0,conversaciones:V.conversaciones_7d||0}}function W(Z){return String(Z||"?").trim().split(/\s+/).slice(0,2).map(V=>V[0]).join("").toUpperCase()}const K=ye(()=>{if(!h.value)return{sinPlan:!0};const Z=h.value.max_agentes||0;return{sinPlan:!1,nombre:h.value.nombre,ilimitado:Z<=0,max:Z,usados:r.value.length,lleno:Z>0&&r.value.length>=Z}});function D(){return{nombre:"",ai_config_id:null,tono:"",mensaje_bienvenida:"",color:"#8eb02f",activo:!0,plantilla_rubro:""}}const q=z([]);async function I(){l.value="",x.value=!0;try{const[Z,V,Te,G]=await Promise.all([le.get(ie("/umind/tenants")),le.get(ie(`/umind/agentes?tenant_id=${t.id}`)),le.get(ie("/umind/ai-configs")),le.get(ie("/umind/plantillas-rubro"))]);o.value=(Z.items||[]).find(Xe=>String(Xe.ID)===t.id)||null,r.value=V.items||[],h.value=V.plan||null,g.value=V.resumen||{},i.value=Te.items||[],q.value=G.items||[]}catch(Z){l.value=Z.message}finally{x.value=!1}}async function A(Z){const V=prompt(`Nombre de la copia de "${Z.nombre}":`,`${Z.nombre} (copia)`);if(V!==null){l.value="";try{const Te=await le.post(ie(`/umind/agentes/${Z.ID}/duplicar`),{tenant_id:Number(n.value),nombre:V.trim()});await I(),Te.aviso&&alert(Te.aviso)}catch(Te){l.value=Te.message}}}function M(){d.value=null,c.value=D(),a.value=!0}function ne(Z){d.value=Z,c.value={nombre:Z.nombre,ai_config_id:Z.ai_config_id,tono:Z.tono,mensaje_bienvenida:Z.mensaje_bienvenida,color:Z.color||"#8eb02f",activo:Z.activo},a.value=!0}async function F(){try{if(d.value)await le.put(ie(`/umind/agentes/${d.value.ID}`),{tenant_id:n.value,...c.value}),a.value=!1,await I();else{const Z=await le.post(ie("/umind/agentes"),{tenant_id:n.value,...c.value});a.value=!1,s.push(`/tenants/${n.value}/agentes/${Z.id}`)}}catch(Z){l.value=Z.message}}async function Ae(Z){confirm(`¿Eliminar el agente "${Z.nombre}"? Esto no se puede deshacer.`)&&(await le.del(ie(`/umind/agentes/${Z.ID}`)),await I())}return Bt(()=>t.id,I,{immediate:!0}),(Z,V)=>{const Te=Fn("router-link");return w(),E("div",null,[o.value?(w(),E("div",af,[u("div",uf,[u("div",null,[u("h1",cf,P(o.value.nombre),1),u("p",ff,P(o.value.dominios_permitidos||"sin dominios configurados"),1)]),Pe(Te,{to:`/tenants/${n.value??e.id}/uso`,class:"btn-ghost"},{default:Ht(()=>[...V[10]||(V[10]=[we("📊 Consumo",-1)])]),_:1},8,["to"])])])):ee("",!0),l.value?(w(),E("p",df,P(l.value),1)):ee("",!0),u("div",pf,[u("div",hf,[V[11]||(V[11]=u("h2",{class:"text-sm font-medium text-tenue"},"Agentes",-1)),K.value.sinPlan?(w(),E("span",mf,"sin plan · sin límite")):K.value.ilimitado?(w(),E("span",gf,P(K.value.nombre)+" · ilimitado",1)):(w(),E("span",{key:2,class:Ie(K.value.lleno?"badge-alerta":"badge-neutro")},P(K.value.nombre)+" · "+P(K.value.usados)+" de "+P(K.value.max),3))]),u("button",{class:"btn-primary",disabled:K.value.lleno,onClick:M},"+ Nuevo agente",8,vf)]),K.value.sinPlan&&!De(Qe).esPortal?(w(),E("p",bf," Este tenant no tiene plan asignado, así que no se le aplica ningún límite de agentes. Asignale uno desde el lápiz del tenant en la barra izquierda. ")):K.value.lleno?(w(),E("p",xf," Alcanzaste el máximo de agentes de tu plan. ")):ee("",!0),x.value?(w(),E("div",_f,[(w(),E(fe,null,$e(2,G=>u("div",{key:G,class:"card p-4 animate-pulse"},[...V[12]||(V[12]=[wi('
',2)])])),64))])):r.value.length===0?(w(),dn(Bi,{key:5,class:"card",icono:"🤖",titulo:"Todavía no hay agentes",detalle:"Creá el primero y cargale su base de conocimiento para que empiece a responder."},{default:Ht(()=>[u("button",{class:"btn-primary",disabled:K.value.lleno,onClick:M},"+ Crear el primer agente",8,yf)]),_:1})):(w(),E("div",wf,[(w(!0),E(fe,null,$e(r.value,G=>(w(),dn(Te,{key:G.ID,to:`/tenants/${n.value}/agentes/${G.ID}`,class:"card p-4 relative group hover:shadow-lg hover:-translate-y-0.5 transition-all overflow-hidden"},{default:Ht(()=>[u("span",{class:"absolute inset-x-0 top-0 h-1",style:Zt({background:G.color||"#8eb02f"})},null,4),u("div",Cf,[u("span",{class:"w-10 h-10 rounded-xl flex items-center justify-center text-white text-sm font-semibold shrink-0",style:Zt({background:G.color||"#8eb02f",opacity:G.activo?1:.4})},P(W(G.nombre)),5),u("div",Ef,[u("div",Sf,[u("span",Af,P(G.nombre),1),u("span",{class:Ie(`badge-${j(G).tipo}`)},P(j(G).texto),3)]),u("p",kf,P(G.tono||"sin tono definido"),1)]),u("div",Rf,[u("button",{class:"p-1 text-tenue hover:text-texto",title:"Editar",onClick:ze(Xe=>ne(G),["prevent","stop"])},"✎",8,If),u("button",{class:"p-1 text-tenue hover:text-texto",title:"Duplicar: copia el conocimiento y las herramientas a un agente nuevo",onClick:ze(Xe=>A(G),["prevent","stop"])},"⧉",8,Pf),u("button",{class:"p-1 text-tenue hover:text-red-600",title:"Eliminar",onClick:ze(Xe=>Ae(G),["prevent","stop"])},"✕",8,Of)])]),u("div",Tf,[u("span",$f,[u("b",Nf,P(O(G).conversaciones),1),V[13]||(V[13]=we(" conversaciones · 7d",-1))]),u("span",Df,[u("b",Mf,P(O(G).documentos),1),V[14]||(V[14]=we(" fuentes",-1))]),u("span",Vf,[u("b",jf,P(O(G).canales),1),V[15]||(V[15]=we(" canales",-1))])])]),_:2},1032,["to"]))),128))])),a.value?(w(),E("div",{key:7,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:V[9]||(V[9]=ze(G=>a.value=!1,["self"]))},[u("div",Uf,[u("h2",Lf,P(d.value?"Editar agente":"Nuevo agente"),1),u("form",{class:"space-y-3",onSubmit:ze(F,["prevent"])},[u("div",null,[V[16]||(V[16]=u("label",{class:"label"},"Nombre",-1)),se(u("input",{"onUpdate:modelValue":V[0]||(V[0]=G=>c.value.nombre=G),required:"",placeholder:"ej: Ventas, Soporte",class:"input"},null,512),[[xe,c.value.nombre]])]),!d.value&&q.value.length?(w(),E("div",Ff,[V[17]||(V[17]=u("label",{class:"label"},"Arrancar con",-1)),u("div",Hf,[(w(!0),E(fe,null,$e([{clave:"",nombre:"Agente en blanco",descripcion:"Sin conocimiento cargado. Lo escribís vos desde cero."},...q.value],G=>(w(),E("label",{key:G.clave,class:Ie(["flex gap-2.5 p-2.5 rounded-lg border cursor-pointer transition-colors",c.value.plantilla_rubro===G.clave?"border-brand bg-brand/5":"border-borde hover:border-brand/40"])},[se(u("input",{"onUpdate:modelValue":V[1]||(V[1]=Xe=>c.value.plantilla_rubro=Xe),type:"radio",value:G.clave,class:"mt-1 text-brand focus:ring-brand"},null,8,Bf),[[iu,c.value.plantilla_rubro]]),u("span",Kf,[u("span",qf,P(G.nombre),1),u("span",Gf,P(G.descripcion),1),G.notas?(w(),E("span",Wf,P(G.notas)+" notas listas para editar · "+P(G.resumen),1)):ee("",!0)])],2))),128))]),V[18]||(V[18]=u("p",{class:"text-xs text-tenue mt-1.5"}," Las notas vienen con ejemplos entre corchetes — abrilas y reemplazalas por tus datos reales. ",-1))])):ee("",!0),u("div",null,[V[20]||(V[20]=u("label",{class:"label"},"Config de IA",-1)),se(u("select",{"onUpdate:modelValue":V[2]||(V[2]=G=>c.value.ai_config_id=G),class:"input"},[V[19]||(V[19]=u("option",{value:null},"— sin asignar —",-1)),(w(!0),E(fe,null,$e(i.value,G=>(w(),E("option",{key:G.ID,value:G.ID},P(G.nombre)+" ("+P(G.provider)+")",9,zf))),128))],512),[[Vn,c.value.ai_config_id]])]),u("div",null,[V[21]||(V[21]=u("label",{class:"label"},"Tono / personalidad",-1)),se(u("textarea",{"onUpdate:modelValue":V[3]||(V[3]=G=>c.value.tono=G),rows:"2",class:"input"},null,512),[[xe,c.value.tono]])]),u("div",null,[V[22]||(V[22]=u("label",{class:"label"},"Mensaje de bienvenida",-1)),se(u("input",{"onUpdate:modelValue":V[4]||(V[4]=G=>c.value.mensaje_bienvenida=G),class:"input"},null,512),[[xe,c.value.mensaje_bienvenida]])]),u("div",null,[V[23]||(V[23]=u("label",{class:"label"},"Color del widget",-1)),u("div",Jf,[se(u("input",{"onUpdate:modelValue":V[5]||(V[5]=G=>c.value.color=G),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),[[xe,c.value.color]]),se(u("input",{"onUpdate:modelValue":V[6]||(V[6]=G=>c.value.color=G),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),[[xe,c.value.color]])])]),u("label",Qf,[se(u("input",{"onUpdate:modelValue":V[7]||(V[7]=G=>c.value.activo=G),type:"checkbox"},null,512),[[At,c.value.activo]]),V[24]||(V[24]=we(" Activo ",-1))]),u("div",Yf,[u("button",{type:"button",class:"px-4 py-2 text-sm text-gray-500 dark:text-gray-400",onClick:V[8]||(V[8]=G=>a.value=!1)},"Cancelar"),u("button",Xf,P(d.value?"Guardar":"Crear"),1)])],32)])])):ee("",!0)])}}},ed={key:0,class:"mb-6 mt-1 flex items-start justify-between gap-4"},td={class:"min-w-0"},nd={class:"text-xl font-semibold text-texto"},sd={class:"text-xs text-tenue mt-1"},od={class:"bg-elevado px-1.5 py-0.5 rounded"},rd=["href"],id={key:1,class:"text-sm text-red-600 dark:text-red-400 mb-4"},ld={class:"flex gap-1.5 mb-6 overflow-x-auto pb-1"},ad=["onClick"],ud={key:2},cd={class:"card p-4 mb-4"},fd={class:"flex gap-1 mb-3"},dd=["onClick"],pd={class:"flex items-center justify-between"},hd=["disabled"],md={class:"flex items-center justify-between"},gd=["disabled"],vd={class:"flex gap-2"},bd={class:"flex items-center justify-between"},xd={class:"flex items-center gap-2 text-xs text-tenue cursor-pointer"},_d=["disabled"],yd={class:"card divide-y divide-borde"},wd={key:0,class:"p-6 text-sm text-tenue"},Cd={class:"text-sm text-texto"},Ed={class:"text-xs text-tenue mt-0.5"},Sd={key:0},Ad={key:1},kd={key:2},Rd={key:3,class:"text-red-600 dark:text-red-400"},Id={class:"flex items-center gap-3 shrink-0"},Pd=["title","onClick"],Od=["disabled","onClick"],Td=["onClick"],$d={key:3},Nd={class:"card divide-y divide-borde"},Dd={key:0,class:"p-6 text-sm text-tenue"},Md={class:"text-sm text-texto font-mono"},Vd={class:"label mt-0.5"},jd={class:"text-xs text-tenue mt-0.5"},Ud={key:0,class:"ml-1 text-green-600 dark:text-green-400"},Ld={key:1,class:"ml-1 text-gray-400"},Fd={class:"flex gap-3 text-sm shrink-0"},Hd=["onClick"],Bd=["onClick"],Kd={class:"card p-6 w-full max-w-xl max-h-[85vh] overflow-y-auto"},qd={class:"font-semibold text-texto mb-4"},Gd={class:"border border-borde rounded-lg p-3 space-y-2"},Wd=["onUpdate:modelValue"],zd=["onUpdate:modelValue"],Jd=["onUpdate:modelValue"],Qd={class:"label flex items-center gap-1"},Yd=["onUpdate:modelValue"],Xd=["onClick"],Zd={key:0,class:"text-xs text-gray-400"},ep={class:"border border-borde rounded-lg p-3 space-y-2"},tp={class:"flex items-center gap-2 label"},np={class:"flex items-center gap-2 text-sm text-texto"},sp={class:"flex justify-end gap-2 pt-2"},op={key:4},rp={class:"card p-4 mb-4"},ip={class:"flex items-center justify-between mb-2"},lp={class:"bg-elevado border border-borde rounded-lg p-2.5 text-xs text-texto overflow-x-auto"},ap={class:"card divide-y divide-borde"},up={key:0,class:"p-6 text-sm text-tenue"},cp={class:"flex items-center justify-between"},fp={class:"font-medium text-texto capitalize"},dp={class:"flex gap-3 text-sm"},pp=["onClick"],hp=["onClick"],mp={class:"flex gap-4 mt-2 text-xs"},gp={class:"flex items-center gap-1.5 text-texto cursor-pointer"},vp=["checked","onChange"],bp={class:"flex items-center gap-1.5 text-texto cursor-pointer"},xp=["checked","onChange"],_p={class:"flex items-center gap-1.5 text-texto cursor-pointer"},yp=["checked","onChange"],wp={class:"label mt-1 break-all"},Cp={class:"bg-elevado px-1 rounded"},Ep={key:0,class:"text-xs text-tenue mt-1"},Sp={key:1,class:"text-xs text-red-600 dark:text-red-400 mt-1"},Ap={class:"card p-6 w-full max-w-md"},kp={key:0},Rp={class:"flex flex-col gap-2 pt-1"},Ip={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},Pp={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},Op={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},Tp={class:"flex justify-end gap-2 pt-2"},$p={key:5},Np={class:"flex gap-2 mb-4"},Dp={class:"card divide-y divide-borde"},Mp={key:0,class:"p-6 text-sm text-tenue"},Vp={class:"font-medium text-texto capitalize"},jp={class:"ml-2 text-sm text-tenue"},Up=["onClick"],Lp={key:6,class:"card p-4 flex flex-col h-[28rem]"},Fp={class:"flex-1 overflow-y-auto space-y-2 mb-3"},Hp={key:0,class:"text-sm text-tenue"},Bp={key:1,class:"text-xs text-tenue"},Kp=["disabled"],qp={key:7,class:"grid grid-cols-3 gap-4"},Gp={class:"col-span-1 card divide-y divide-borde max-h-[28rem] overflow-y-auto"},Wp={key:0,class:"p-4 text-sm text-tenue"},zp=["onClick"],Jp={class:"text-texto truncate"},Qp={class:"text-xs text-tenue mt-0.5"},Yp={class:"col-span-2 card p-4 max-h-[28rem] overflow-y-auto space-y-2"},Xp={key:0,class:"text-sm text-tenue"},Zp={key:8},eh={class:"card divide-y divide-borde max-h-[32rem] overflow-y-auto"},th={key:0,class:"p-6 text-sm text-tenue"},nh={class:"cursor-pointer flex items-center gap-2 text-sm"},sh={class:"text-tenue text-xs shrink-0"},oh={class:"text-texto truncate"},rh={class:"text-tenue text-xs ml-auto shrink-0"},ih={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"},lh={__name:"AgenteDetail",props:{tenantId:{type:String,required:!0},agenteId:{type:String,required:!0}},setup(e){const t=e,n=ye(()=>Number(t.agenteId)),s=Li(),o=z(null),r=z(""),i=z(typeof s.query.tab=="string"?s.query.tab:Qe.esPortal?"conversaciones":"conocimiento"),l=z([]),a=z(""),d=z(30),c=z(!1);async function h(){const R=await le.get(ie(`/umind/agentes?tenant_id=${t.tenantId}`));o.value=(R.items||[]).find(v=>String(v.ID)===t.agenteId)||null}async function g(){const R=await le.get(ie(`/umind/documentos?agente_id=${t.agenteId}`));l.value=R.items||[]}const x=z("texto"),j=z(!0),O=z(""),W=z(""),K=z(null);async function D(){if(a.value.trim()){c.value=!0,r.value="";try{await le.post(ie("/umind/documentos"),{agente_id:n.value,url:a.value.trim(),max_paginas:Number(d.value)||30,auto_actualizar:j.value}),a.value="",await g()}catch(R){r.value=R.message}finally{c.value=!1}}}async function q(){if(W.value.trim()){c.value=!0,r.value="";try{await le.post(ie("/umind/documentos/texto"),{agente_id:n.value,titulo:O.value.trim(),contenido:W.value}),O.value="",W.value="",await g()}catch(R){r.value=R.message}finally{c.value=!1}}}async function I(){var v,wt;const R=(wt=(v=K.value)==null?void 0:v.files)==null?void 0:wt[0];if(R){c.value=!0,r.value="";try{const b=new FormData;b.append("agente_id",String(n.value)),b.append("archivo",R);const Se=await fetch(ie("/umind/documentos/archivo"),{method:"POST",body:b}),rt=await Se.json();if(!Se.ok)throw new Error(rt.error||"No se pudo subir");K.value.value="",await g()}catch(b){r.value=b.message}finally{c.value=!1}}}async function A(R){r.value="";try{await le.post(ie(`/umind/documentos/${R.ID}/reprocesar`),{}),await g()}catch(v){r.value=v.message}}async function M(R){try{await le.put(ie(`/umind/documentos/${R.ID}`),{auto_actualizar:!R.auto_actualizar}),await g()}catch(v){r.value=v.message}}function ne(R){if(!R)return"sin procesar";const v=Math.floor((Date.now()-new Date(R))/864e5);if(v<=0)return"hoy";if(v===1)return"ayer";if(v<30)return`hace ${v} días`;const wt=Math.floor(v/30);return wt===1?"hace un mes":`hace ${wt} meses`}function F(R){return R.procesado_at?Date.now()-new Date(R.procesado_at)>60*864e5:!1}async function Ae(R){confirm("¿Eliminar esta fuente y sus fragmentos indexados?")&&(await le.del(ie(`/umind/documentos/${R}`)),await g())}const Z=ye(()=>R=>({listo:"badge-ok",procesando:"badge-alerta",pendiente:"badge-neutro",error:"badge-error"})[R]||"badge-neutro"),V=z([]),Te=z([]),G=z(null);async function Xe(){const R=await le.get(ie(`/umind/sesiones?agente_id=${t.agenteId}`));V.value=R.items||[]}async function Mt(R){G.value=R;const v=await le.get(ie(`/umind/historial?agente_id=${t.agenteId}&session_id=${R}`));Te.value=v.items||[]}const Ce=z([]),ce=z(!1),ae=z(null),oe=z(lt());function lt(){return{nombre:"",descripcion:"",url:"",auth_header_nombre:"",auth_header_valor:"",tocarAuth:!1,parametros:[],activa:!0}}async function Ze(){const R=await le.get(ie(`/umind/tools?agente_id=${t.agenteId}`));Ce.value=R.items||[]}function Le(){ae.value=null,oe.value=lt(),ce.value=!0}function Vt(R){ae.value=R;let v=[];try{v=JSON.parse(R.parametros_json||"[]")||[]}catch{v=[]}oe.value={nombre:R.nombre,descripcion:R.descripcion,url:R.url,auth_header_nombre:R.auth_header_nombre,auth_header_valor:"",tocarAuth:!1,parametros:v,activa:R.activa},ce.value=!0}function jt(){oe.value.parametros.push({nombre:"",tipo:"string",descripcion:"",requerido:!1})}function yt(R){oe.value.parametros.splice(R,1)}async function et(){const R={agente_id:n.value,nombre:oe.value.nombre.trim(),descripcion:oe.value.descripcion,url:oe.value.url.trim(),auth_header_nombre:oe.value.auth_header_nombre,parametros:oe.value.parametros,activa:oe.value.activa};oe.value.tocarAuth&&(R.auth_header_valor=oe.value.auth_header_valor);try{ae.value?await le.put(ie(`/umind/tools/${ae.value.ID}`),R):await le.post(ie("/umind/tools"),R),ce.value=!1,await Ze()}catch(v){r.value=v.message}}async function C(R){confirm(`¿Eliminar la tool "${R.nombre}"?`)&&(await le.del(ie(`/umind/tools/${R.ID}`)),await Ze())}const B=z([]),U=z(!1),T=z(y()),re=z(!1),f=ye(()=>{const R=new Date,v=new Date(R.getFullYear(),R.getMonth(),1).toISOString().slice(0,10),wt=R.toISOString().slice(0,10);return ie(`/umind/reporte.xlsx?agente_id=${t.agenteId}&desde=${v}&hasta=${wt}`)}),p=ye(()=>{var v;const R=((v=o.value)==null?void 0:v.site_key)||"TU_SITE_KEY";return` +