La estructura que faltaba para que todo lo nuevo se encuentre.
NIVEL ESPACIO — barra propia: Agentes · Pendientes · Archivos · Plantillas ·
Consumo · Tu IA. Antes Consumo y Tu IA eran dos enlaces sueltos en el header
que desaparecían al entrar. El badge de Pendientes solo aparece cuando hay algo
esperando: un cero permanente enseña a ignorar el lugar donde después va lo
importante.
NIVEL AGENTE — nueva zona "Lo que hace", al lado de "Lo que sabe" y "Dónde
atiende". Tres preguntas distintas: de dónde saca las respuestas, qué es capaz
de hacer, por dónde lo encuentran. Ahí viven los recordatorios y las
vigilancias — se crean hablando, pero se ven y se cancelan acá: un agente que
agenda cosas invisibles es un agente en el que no se confía.
Los recordatorios dicen por dónde van a llegar ("te llega por Telegram"), no el
sessionID crudo. Las vigilancias muestran si la condición se está cumpliendo
ahora mismo.
En los canales, el checkbox que define todo el modelo de permisos: "este canal
es mío, no de mis clientes". Explicado por lo que significa, no por cómo
funciona — marcarlo habilita acciones directas, no marcarlo hace que todo lo
que salga espere el visto bueno.
Archivos muestra la cuota consumida con barra, marca cuáles ya son
conocimiento, y ofrece "usar como conocimiento" en un clic. Plantillas permite
subir el contrato que el cliente ya usa y que la IA lo convierta.
api.postForm: el multipart ya se escribía a mano en dos lugares y este era el
tercero. Sin Content-Type fijado — el boundary lo pone el navegador.
Verificado con capturas de las cuatro pantallas nuevas.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
30 lines
206 KiB
JavaScript
30 lines
206 KiB
JavaScript
(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 a of o)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();/**
|
|
* @vue/shared v3.5.41
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
* @license MIT
|
|
**/function Zs(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const we={},nn=[],wt=()=>{},wa=()=>!1,as=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),rs=e=>e.startsWith("onUpdate:"),je=Object.assign,Xs=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Jr=Object.prototype.hasOwnProperty,be=(e,t)=>Jr.call(e,t),se=Array.isArray,sn=e=>Un(e)==="[object Map]",mn=e=>Un(e)==="[object Set]",$o=e=>Un(e)==="[object Date]",ae=e=>typeof e=="function",$e=e=>typeof e=="string",it=e=>typeof e=="symbol",xe=e=>e!==null&&typeof e=="object",ka=e=>(xe(e)||ae(e))&&ae(e.then)&&ae(e.catch),$a=Object.prototype.toString,Un=e=>$a.call(e),Yr=e=>Un(e).slice(8,-1),Ca=e=>Un(e)==="[object Object]",eo=e=>$e(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,$n=Zs(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ls=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Zr=/-\w/g,We=ls(e=>e.replace(Zr,t=>t.slice(1).toUpperCase())),Xr=/\B([A-Z])/g,Zt=ls(e=>e.replace(Xr,"-$1").toLowerCase()),is=ls(e=>e.charAt(0).toUpperCase()+e.slice(1)),ws=ls(e=>e?`on${is(e)}`:""),_t=(e,t)=>!Object.is(e,t),zn=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Aa=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},us=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Co;const cs=()=>Co||(Co=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ft(e){if(se(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=$e(s)?sl(s):Ft(s);if(o)for(const a in o)t[a]=o[a]}return t}else if($e(e)||xe(e))return e}const el=/;(?![^(]*\))/g,tl=/:([^]+)/,nl=/\/\*[^]*?\*\//g;function sl(e){const t={};return e.replace(nl,"").split(el).forEach(n=>{if(n){const s=n.split(tl);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function ie(e){let t="";if($e(e))t=e;else if(se(e))for(let n=0;n<e.length;n++){const s=ie(e[n]);s&&(t+=s+" ")}else if(xe(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const ol="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",al=Zs(ol);function Sa(e){return!!e||e===""}function rl(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=Ht(e[s],t[s]);return n}function Ht(e,t){if(e===t)return!0;let n=$o(e),s=$o(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=it(e),s=it(t),n||s)return e===t;if(n=se(e),s=se(t),n||s)return n&&s?rl(e,t):!1;if(n=xe(e),s=xe(t),n||s){if(!n||!s)return!1;const o=Object.keys(e).length,a=Object.keys(t).length;if(o!==a)return!1;for(const l in e){const i=e.hasOwnProperty(l),u=t.hasOwnProperty(l);if(i&&!u||!i&&u||!Ht(e[l],t[l]))return!1}}return String(e)===String(t)}function to(e,t){return e.findIndex(n=>Ht(n,t))}const Ea=e=>!!(e&&e.__v_isRef===!0),S=e=>$e(e)?e:e==null?"":se(e)||xe(e)&&(e.toString===$a||!ae(e.toString))?Ea(e)?S(e.value):JSON.stringify(e,Ia,2):String(e),Ia=(e,t)=>Ea(t)?Ia(e,t.value):sn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],a)=>(n[ks(s,a)+" =>"]=o,n),{})}:mn(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ks(n))}:it(t)?ks(t):xe(t)&&!se(t)&&!Ca(t)?String(t):t,ks=(e,t="")=>{var n;return it(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
|
|
* @vue/reactivity v3.5.41
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
* @license MIT
|
|
**/let Oe;class ll{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&&Oe&&(Oe.active?(this.parent=Oe,this.index=(Oe.scopes||(Oe.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;t<n;t++)s[t].pause()}for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes){const o=this.scopes.slice();for(t=0,n=o.length;t<n;t++)o[t].resume()}const s=this.effects.slice();for(t=0,n=s.length;t<n;t++)s[t].resume()}}run(t){if(this._active){const n=Oe;try{return Oe=this,t()}finally{Oe=n}}}on(){++this._on===1&&(this.prevScope=Oe,Oe=this)}off(){if(this._on>0&&--this._on===0){if(Oe===this)Oe=this.prevScope;else{let t=Oe;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;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){const o=this.scopes.slice();for(n=0,s=o.length;n<s;n++)o[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function il(){return Oe}let ke;const $s=new WeakSet;class Ra{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Oe&&(Oe.active?Oe.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,$s.has(this)&&($s.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Da(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Ao(this),Ta(this);const t=ke,n=rt;ke=this,rt=!0;try{return this.fn()}finally{Oa(this),ke=t,rt=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)oo(t);this.deps=this.depsTail=void 0,Ao(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?$s.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){js(this)&&this.run()}get dirty(){return js(this)}}let Pa=0,Cn,An;function Da(e,t=!1){if(e.flags|=8,t){e.next=An,An=e;return}e.next=Cn,Cn=e}function no(){Pa++}function so(){if(--Pa>0)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(;Cn;){let t=Cn;for(Cn=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 Ta(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Oa(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),oo(s),ul(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function js(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ma(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Ma(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Rn)||(e.globalVersion=Rn,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!js(e))))return;e.flags|=2;const t=e.dep,n=ke,s=rt;ke=e,rt=!0;try{Ta(e);const o=e.fn(e._value);(t.version===0||_t(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{ke=n,rt=s,Oa(e),e.flags&=-3}}function oo(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 a=n.computed.deps;a;a=a.nextDep)oo(a,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function ul(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let rt=!0;const Na=[];function Tt(){Na.push(rt),rt=!1}function Ot(){const e=Na.pop();rt=e===void 0?!0:e}function Ao(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ke;ke=void 0;try{t()}finally{ke=n}}}let Rn=0;class cl{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(!ke||!rt||ke===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ke)n=this.activeLink=new cl(ke,this),ke.deps?(n.prevDep=ke.depsTail,ke.depsTail.nextDep=n,ke.depsTail=n):ke.deps=ke.depsTail=n,ja(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=ke.depsTail,n.nextDep=void 0,ke.depsTail.nextDep=n,ke.depsTail=n,ke.deps===n&&(ke.deps=s)}return n}trigger(t){this.version++,Rn++,this.notify(t)}notify(t){no();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{so()}}}function ja(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)ja(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Vs=new WeakMap,Jt=Symbol(""),Us=Symbol(""),Pn=Symbol("");function Ve(e,t,n){if(rt&&ke){let s=Vs.get(e);s||Vs.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 It(e,t,n,s,o,a){const l=Vs.get(e);if(!l){Rn++;return}const i=u=>{u&&u.trigger()};if(no(),t==="clear")l.forEach(i);else{const u=se(e),d=u&&eo(n);if(u&&n==="length"){const c=Number(s);l.forEach((p,f)=>{(f==="length"||f===Pn||!it(f)&&f>=c)&&i(p)})}else switch((n!==void 0||l.has(void 0))&&i(l.get(n)),d&&i(l.get(Pn)),t){case"add":u?d&&i(l.get("length")):(i(l.get(Jt)),sn(e)&&i(l.get(Us)));break;case"delete":u||(i(l.get(Jt)),sn(e)&&i(l.get(Us)));break;case"set":sn(e)&&i(l.get(Jt));break}}so()}function Xt(e){const t=ge(e);return t===e?t:(Ve(t,"iterate",Pn),ot(e)?t:t.map(ut))}function ds(e){return Ve(e=ge(e),"iterate",Pn),e}function xt(e,t){return Mt(e)?un(Yt(e)?ut(t):t):ut(t)}const dl={__proto__:null,[Symbol.iterator](){return Cs(this,Symbol.iterator,e=>xt(this,e))},concat(...e){return Xt(this).concat(...e.map(t=>se(t)?Xt(t):t))},entries(){return Cs(this,"entries",e=>(e[1]=xt(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=>xt(this,s)),arguments)},find(e,t){return Ct(this,"find",e,t,n=>xt(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=>xt(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 As(this,"includes",e)},indexOf(...e){return As(this,"indexOf",e)},join(e){return Xt(this).join(e)},lastIndexOf(...e){return As(this,"lastIndexOf",e)},map(e,t){return Ct(this,"map",e,t,void 0,arguments)},pop(){return gn(this,"pop")},push(...e){return gn(this,"push",e)},reduce(e,...t){return So(this,"reduce",e,t)},reduceRight(e,...t){return So(this,"reduceRight",e,t)},shift(){return gn(this,"shift")},some(e,t){return Ct(this,"some",e,t,void 0,arguments)},splice(...e){return gn(this,"splice",e)},toReversed(){return Xt(this).toReversed()},toSorted(e){return Xt(this).toSorted(e)},toSpliced(...e){return Xt(this).toSpliced(...e)},unshift(...e){return gn(this,"unshift",e)},values(){return Cs(this,"values",e=>xt(this,e))}};function Cs(e,t,n){const s=ds(e),o=s[t]();return s!==e&&!ot(e)&&(o._next=o.next,o.next=()=>{const a=o._next();return a.done||(a.value=n(a.value)),a}),o}const fl=Array.prototype;function Ct(e,t,n,s,o,a){const l=ds(e),i=l!==e&&!ot(e),u=l[t];if(u!==fl[t]){const p=u.apply(e,a);return i?ut(p):p}let d=n;l!==e&&(i?d=function(p,f){return n.call(this,xt(e,p),f,e)}:n.length>2&&(d=function(p,f){return n.call(this,p,f,e)}));const c=u.call(l,d,s);return i&&o?o(c):c}function So(e,t,n,s){const o=ds(e),a=o!==e&&!ot(e);let l=n,i=!1;o!==e&&(a?(i=s.length===0,l=function(d,c,p){return i&&(i=!1,d=xt(e,d)),n.call(this,d,xt(e,c),p,e)}):n.length>3&&(l=function(d,c,p){return n.call(this,d,c,p,e)}));const u=o[t](l,...s);return i?xt(e,u):u}function As(e,t,n){const s=ge(e);Ve(s,"iterate",Pn);const o=s[t](...n);return(o===-1||o===!1)&&io(n[0])?(n[0]=ge(n[0]),s[t](...n)):o}function gn(e,t,n=[]){Tt(),no();const s=ge(e)[t].apply(e,n);return so(),Ot(),s}const pl=Zs("__proto__,__v_isRef,__isVue"),Va=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(it));function ml(e){it(e)||(e=String(e));const t=ge(this);return Ve(t,"has",e),t.hasOwnProperty(e)}class Ua{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,a=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return a;if(n==="__v_raw")return s===(o?a?$l:Ha:a?Fa:qa).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const l=se(t);if(!o){let u;if(l&&(u=dl[n]))return u;if(n==="hasOwnProperty")return ml}const i=Reflect.get(t,n,Le(t)?t:s);if((it(n)?Va.has(n):pl(n))||(o||Ve(t,"get",n),a))return i;if(Le(i)){const u=l&&eo(n)?i:i.value;return o&&xe(u)?qs(u):u}return xe(i)?o?qs(i):fs(i):i}}class La extends Ua{constructor(t=!1){super(!1,t)}set(t,n,s,o){let a=t[n];const l=se(t)&&eo(n);if(!this._isShallow){const d=Mt(a);if(!ot(s)&&!Mt(s)&&(a=ge(a),s=ge(s)),!l&&Le(a)&&!Le(s))return d||(a.value=s),!0}const i=l?Number(n)<t.length:be(t,n),u=Reflect.set(t,n,s,Le(t)?t:o);return t===ge(o)&&u&&(i?_t(s,a)&&It(t,"set",n,s):It(t,"add",n,s)),u}deleteProperty(t,n){const s=be(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&It(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!it(n)||!Va.has(n))&&Ve(t,"has",n),s}ownKeys(t){return Ve(t,"iterate",se(t)?"length":Jt),Reflect.ownKeys(t)}}class vl extends Ua{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const hl=new La,gl=new vl,bl=new La(!0);const Ls=e=>e,Fn=e=>Reflect.getPrototypeOf(e);function xl(e,t,n){return function(...s){const o=this.__v_raw,a=ge(o),l=sn(a),i=e==="entries"||e===Symbol.iterator&&l,u=e==="keys"&&l,d=o[e](...s),c=n?Ls:t?un:ut;return!t&&Ve(a,"iterate",u?Us:Jt),je(Object.create(d),{next(){const{value:p,done:f}=d.next();return f?{value:p,done:f}:{value:i?[c(p[0]),c(p[1])]:c(p),done:f}}})}}function Hn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function yl(e,t){const n={get(o){const a=this.__v_raw,l=ge(a),i=ge(o);e||(_t(o,i)&&Ve(l,"get",o),Ve(l,"get",i));const{has:u}=Fn(l),d=t?Ls:e?un:ut;if(u.call(l,o))return d(a.get(o));if(u.call(l,i))return d(a.get(i));a!==l&&a.get(o)},get size(){const o=this.__v_raw;return!e&&Ve(ge(o),"iterate",Jt),o.size},has(o){const a=this.__v_raw,l=ge(a),i=ge(o);return e||(_t(o,i)&&Ve(l,"has",o),Ve(l,"has",i)),o===i?a.has(o):a.has(o)||a.has(i)},forEach(o,a){const l=this,i=l.__v_raw,u=ge(i),d=t?Ls:e?un:ut;return!e&&Ve(u,"iterate",Jt),i.forEach((c,p)=>o.call(a,d(c),d(p),l))}};return je(n,e?{add:Hn("add"),set:Hn("set"),delete:Hn("delete"),clear:Hn("clear")}:{add(o){const a=ge(this),l=Fn(a),i=ge(o),u=!t&&!ot(o)&&!Mt(o)?i:o;return l.has.call(a,u)||_t(o,u)&&l.has.call(a,o)||_t(i,u)&&l.has.call(a,i)||(a.add(u),It(a,"add",u,u)),this},set(o,a){!t&&!ot(a)&&!Mt(a)&&(a=ge(a));const l=ge(this),{has:i,get:u}=Fn(l);let d=i.call(l,o);d||(o=ge(o),d=i.call(l,o));const c=u.call(l,o);return l.set(o,a),d?_t(a,c)&&It(l,"set",o,a):It(l,"add",o,a),this},delete(o){const a=ge(this),{has:l,get:i}=Fn(a);let u=l.call(a,o);u||(o=ge(o),u=l.call(a,o)),i&&i.call(a,o);const d=a.delete(o);return u&&It(a,"delete",o,void 0),d},clear(){const o=ge(this),a=o.size!==0,l=o.clear();return a&&It(o,"clear",void 0,void 0),l}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=xl(o,e,t)}),n}function ro(e,t){const n=yl(e,t);return(s,o,a)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(be(n,o)&&o in s?n:s,o,a)}const _l={get:ro(!1,!1)},wl={get:ro(!1,!0)},kl={get:ro(!0,!1)};const qa=new WeakMap,Fa=new WeakMap,Ha=new WeakMap,$l=new WeakMap;function Cl(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function fs(e){return Mt(e)?e:lo(e,!1,hl,_l,qa)}function Ba(e){return lo(e,!1,bl,wl,Fa)}function qs(e){return lo(e,!0,gl,kl,Ha)}function lo(e,t,n,s,o){if(!xe(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const a=o.get(e);if(a)return a;const l=Cl(Yr(e));if(l===0)return e;const i=new Proxy(e,l===2?s:n);return o.set(e,i),i}function Yt(e){return Mt(e)?Yt(e.__v_raw):!!(e&&e.__v_isReactive)}function Mt(e){return!!(e&&e.__v_isReadonly)}function ot(e){return!!(e&&e.__v_isShallow)}function io(e){return e?!!e.__v_raw:!1}function ge(e){const t=e&&e.__v_raw;return t?ge(t):e}function Al(e){return!be(e,"__v_skip")&&Object.isExtensible(e)&&Aa(e,"__v_skip",!0),e}const ut=e=>xe(e)?fs(e):e,un=e=>xe(e)?qs(e):e;function Le(e){return e?e.__v_isRef===!0:!1}function j(e){return Wa(e,!1)}function Sl(e){return Wa(e,!0)}function Wa(e,t){return Le(e)?e:new El(e,t)}class El{constructor(t,n){this.dep=new ao,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:ge(t),this._value=n?t:ut(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||ot(t)||Mt(t);t=s?t:ge(t),_t(t,n)&&(this._rawValue=t,this._value=s?t:ut(t),this.dep.trigger())}}function Re(e){return Le(e)?e.value:e}const Il={get:(e,t,n)=>t==="__v_raw"?e:Re(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return Le(o)&&!Le(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function Ga(e){return Yt(e)?e:new Proxy(e,Il)}class Rl{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=Rn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&ke!==this)return Da(this,!0),!0}get value(){const t=this.dep.track();return Ma(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Pl(e,t,n=!1){let s,o;return ae(e)?s=e:(s=e.get,o=e.set),new Rl(s,o,n)}const Bn={},Yn=new WeakMap;let Kt;function Dl(e,t=!1,n=Kt){if(n){let s=Yn.get(n);s||Yn.set(n,s=[]),s.push(e)}}function Tl(e,t,n=we){const{immediate:s,deep:o,once:a,scheduler:l,augmentJob:i,call:u}=n,d=x=>o?x:ot(x)||o===!1||o===0?Rt(x,1):Rt(x);let c,p,f,_,k=!1,A=!1;if(Le(e)?(p=()=>e.value,k=ot(e)):Yt(e)?(p=()=>d(e),k=!0):se(e)?(A=!0,k=e.some(x=>Yt(x)||ot(x)),p=()=>e.map(x=>{if(Le(x))return x.value;if(Yt(x))return d(x);if(ae(x))return u?u(x,2):x()})):ae(e)?t?p=u?()=>u(e,2):e:p=()=>{if(f){Tt();try{f()}finally{Ot()}}const x=Kt;Kt=c;try{return u?u(e,3,[_]):e(_)}finally{Kt=x}}:p=wt,t&&o){const x=p,$=o===!0?1/0:o;p=()=>Rt(x(),$)}const I=il(),y=()=>{c.stop(),I&&I.active&&Xs(I.effects,c)};if(a&&t){const x=t;t=(...$)=>{const U=x(...$);return y(),U}}let w=A?new Array(e.length).fill(Bn):Bn;const g=x=>{if(!(!(c.flags&1)||!c.dirty&&!x))if(t){const $=c.run();if(x||o||k||(A?$.some((U,F)=>_t(U,w[F])):_t($,w))){f&&f();const U=Kt;Kt=c;try{const F=[$,w===Bn?void 0:A&&w[0]===Bn?[]:w,_];w=$,u?u(t,3,F):t(...F)}finally{Kt=U}}}else c.run()};return i&&i(g),c=new Ra(p),c.scheduler=l?()=>l(g,!1):g,_=x=>Dl(x,!1,c),f=c.onStop=()=>{const x=Yn.get(c);if(x){if(u)u(x,4);else for(const $ of x)$();Yn.delete(c)}},t?s?g(!0):w=c.run():l?l(g.bind(null,!0),!0):c.run(),y.pause=c.pause.bind(c),y.resume=c.resume.bind(c),y.stop=y,y}function Rt(e,t=1/0,n){if(t<=0||!xe(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Le(e))Rt(e.value,t,n);else if(se(e))for(let s=0;s<e.length;s++)Rt(e[s],t,n);else if(mn(e)||sn(e))e.forEach(s=>{Rt(s,t,n)});else if(Ca(e)){for(const s in e)Rt(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Rt(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){ps(o,t,n)}}function ct(e,t,n,s){if(ae(e)){const o=Ln(e,t,n,s);return o&&ka(o)&&o.catch(a=>{ps(a,t,n)}),o}if(se(e)){const o=[];for(let a=0;a<e.length;a++)o.push(ct(e[a],t,n,s));return o}}function ps(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:l}=t&&t.appContext.config||we;if(t){let i=t.parent;const u=t.proxy,d=`https://vuejs.org/error-reference/#runtime-${n}`;for(;i;){const c=i.ec;if(c){for(let p=0;p<c.length;p++)if(c[p](e,u,d)===!1)return}i=i.parent}if(a){Tt(),Ln(a,null,10,[e,u,d]),Ot();return}}Ol(e,n,o,s,l)}function Ol(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const Be=[];let bt=-1;const on=[];let Lt=null,en=0;const za=Promise.resolve();let Zn=null;function uo(e){const t=Zn||za;return e?t.then(this?e.bind(this):e):t}function Ml(e){let t=bt+1,n=Be.length;for(;t<n;){const s=t+n>>>1,o=Be[s],a=Dn(o);a<e||a===e&&o.flags&2?t=s+1:n=s}return t}function co(e){if(!(e.flags&1)){const t=Dn(e),n=Be[Be.length-1];!n||!(e.flags&2)&&t>=Dn(n)?Be.push(e):Be.splice(Ml(t),0,e),e.flags|=1,Ka()}}function Ka(){Zn||(Zn=za.then(Ja))}function Nl(e){if(!se(e))Lt&&e.id===-1?Lt.splice(en+1,0,e):e.flags&1||(on.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)on.push(e[t]);Ka()}function Eo(e,t,n=bt+1){for(;n<Be.length;n++){const s=Be[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;Be.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Qa(e){if(on.length){const t=[...new Set(on)].sort((n,s)=>Dn(n)-Dn(s));if(on.length=0,Lt){for(let n=0;n<t.length;n++)Lt.push(t[n]);return}for(Lt=t,en=0;en<Lt.length;en++){const n=Lt[en];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Lt=null,en=0}}const Dn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Ja(e){try{for(bt=0;bt<Be.length;bt++){const t=Be[bt];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Ln(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;bt<Be.length;bt++){const t=Be[bt];t&&(t.flags&=-2)}bt=-1,Be.length=0,Qa(),Zn=null,(Be.length||on.length)&&Ja()}}let Me=null,Ya=null;function Xn(e){const t=Me;return Me=e,Ya=e&&e.type.__scopeId||null,t}function dt(e,t=Me,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&ns(-1);const a=Xn(t),l=Dt.length;let i;try{i=e(...o)}finally{for(let u=Dt.length;u>l;u--)ho();Xn(a),s._d&&ns(1)}return i};return s._n=!0,s._c=!0,s._d=!0,s}function z(e,t){if(Me===null)return e;const n=xs(Me),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[a,l,i,u=we]=t[o];a&&(ae(a)&&(a={mounted:a,updated:a}),a.deep&&Rt(l),s.push({dir:a,instance:n,value:l,oldValue:void 0,arg:i,modifiers:u}))}return e}function Gt(e,t,n,s){const o=e.dirs,a=t&&t.dirs;for(let l=0;l<o.length;l++){const i=o[l];a&&(i.oldValue=a[l].value);let u=i.dir[s];u&&(Tt(),ct(u,n,8,[e.el,i,e,t]),Ot())}}function Kn(e,t){if(Ue){let n=Ue.provides;const s=Ue.parent&&Ue.parent.provides;s===n&&(n=Ue.provides=Object.create(s)),n[e]=t}}function lt(e,t,n=!1){const s=Pi();if(s||rn){let o=rn?rn._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&ae(t)?t.call(s&&s.proxy):t}}const jl=Symbol.for("v-scx"),Vl=()=>lt(jl);function Ge(e,t,n){return Za(e,t,n)}function Za(e,t,n=we){const{immediate:s,deep:o,flush:a,once:l}=n,i=je({},n),u=t&&s||!t&&a!=="post";let d;if(Nn){if(a==="sync"){const _=Vl();d=_.__watcherHandles||(_.__watcherHandles=[])}else if(!u){const _=()=>{};return _.stop=wt,_.resume=wt,_.pause=wt,_}}const c=Ue;i.call=(_,k,A)=>ct(_,c,k,A);let p=!1;a==="post"?i.scheduler=_=>{Je(_,c&&c.suspense)}:a!=="sync"&&(p=!0,i.scheduler=(_,k)=>{k?_():co(_)}),i.augmentJob=_=>{t&&(_.flags|=4),p&&(_.flags|=2,c&&(_.id=c.uid,_.i=c))};const f=Tl(e,t,i);return Nn&&(d?d.push(f):u&&f()),f}function Ul(e,t,n){const s=this.proxy,o=$e(e)?e.includes(".")?Xa(s,e):()=>s[e]:e.bind(s,s);let a;ae(t)?a=t:(a=t.handler,n=t);const l=qn(this),i=Za(o,a.bind(s),n);return l(),i}function Xa(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const Ll=Symbol("_vte"),ms=e=>e.__isTeleport,Ss=Symbol("_leaveCb");function ql(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==kt){t=n;break}}return t}function er(e){if(!po(e))return ms(e.type)&&e.children?ql(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&&ae(n.default))return n.default()}}function fo(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;fo(ms(n.type)&&er(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 tr(e,t){return ae(e)?je({name:e.name},t,{setup:e}):e}function nr(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 es=new WeakMap;function Sn(e,t,n,s,o=!1){if(se(e)){e.forEach((A,I)=>Sn(A,t&&(se(t)?t[I]:t),n,s,o));return}if(an(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Sn(e,t,n,s.component.subTree);return}const a=s.shapeFlag&4?xs(s.component):s.el,l=o?null:a,{i,r:u}=e,d=t&&t.r,c=i.refs===we?i.refs={}:i.refs,p=i.setupState,f=ge(p),_=p===we?wa:A=>Io(c,A)?!1:be(f,A),k=(A,I)=>!(I&&Io(c,I));if(d!=null&&d!==u){if(Ro(t),$e(d))c[d]=null,_(d)&&(p[d]=null);else if(Le(d)){const A=t;k(d,A.k)&&(d.value=null),A.k&&(c[A.k]=null)}}if(ae(u))Ln(u,i,12,[l,c]);else{const A=$e(u),I=Le(u);if(A||I){const y=()=>{if(e.f){const w=A?_(u)?p[u]:c[u]:k()||!e.k?u.value:c[e.k];if(o)se(w)&&Xs(w,a);else if(se(w))w.includes(a)||w.push(a);else if(A)c[u]=[a],_(u)&&(p[u]=c[u]);else{const g=[a];k(u,e.k)&&(u.value=g),e.k&&(c[e.k]=g)}}else A?(c[u]=l,_(u)&&(p[u]=l)):I&&(k(u,e.k)&&(u.value=l),e.k&&(c[e.k]=l))};if(l){const w=()=>{y(),es.delete(e)};w.id=-1,es.set(e,w),Je(w,n)}else Ro(e),y()}}}function Ro(e){const t=es.get(e);t&&(t.flags|=8,es.delete(e))}cs().requestIdleCallback;cs().cancelIdleCallback;const an=e=>!!e.type.__asyncLoader,po=e=>e.type.__isKeepAlive;function Fl(e,t){sr(e,"a",t)}function Hl(e,t){sr(e,"da",t)}function sr(e,t,n=Ue){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(vs(t,s,n),n){let o=n.parent;for(;o&&o.parent;)po(o.parent.vnode)&&Bl(s,t,n,o),o=o.parent}}function Bl(e,t,n,s){const o=vs(t,e,s,!0);ar(()=>{Xs(s[t],o)},n)}function vs(e,t,n=Ue,s=!1){if(n){const o=n[e]||(n[e]=[]),a=t.__weh||(t.__weh=(...l)=>{Tt();const i=qn(n),u=ct(t,n,e,l);return i(),Ot(),u});return s?o.unshift(a):o.push(a),a}}const jt=e=>(t,n=Ue)=>{(!Nn||e==="sp")&&vs(e,(...s)=>t(...s),n)},Wl=jt("bm"),hs=jt("m"),Gl=jt("bu"),zl=jt("u"),or=jt("bum"),ar=jt("um"),Kl=jt("sp"),Ql=jt("rtg"),Jl=jt("rtc");function Yl(e,t=Ue){vs("ec",e,t)}const rr="components";function Wt(e,t){return ir(rr,e,!0,t)||e}const lr=Symbol.for("v-ndc");function Zl(e){return $e(e)?ir(rr,e,!1)||e:e||lr}function ir(e,t,n=!0,s=!1){const o=Me||Ue;if(o){const a=o.type;{const i=Ni(a,!1);if(i&&(i===t||i===We(t)||i===is(We(t))))return a}const l=Po(o[e]||a[e],t)||Po(o.appContext[e],t);return!l&&s?a:l}}function Po(e,t){return e&&(e[t]||e[We(t)]||e[is(We(t))])}function ce(e,t,n,s){let o;const a=n,l=se(e);if(l||$e(e)){const i=l&&Yt(e);let u=!1,d=!1;i&&(u=!ot(e),d=Mt(e),e=ds(e)),o=new Array(e.length);for(let c=0,p=e.length;c<p;c++)o[c]=t(u?d?un(ut(e[c])):ut(e[c]):e[c],c,void 0,a)}else if(typeof e=="number"){o=new Array(e);for(let i=0;i<e;i++)o[i]=t(i+1,i,void 0,a)}else if(xe(e))if(e[Symbol.iterator])o=Array.from(e,(i,u)=>t(i,u,void 0,a));else{const i=Object.keys(e);o=new Array(i.length);for(let u=0,d=i.length;u<d;u++){const c=i[u];o[u]=t(e[c],c,u,a)}}else o=[];return o}function Xl(e,t,n,s,o,a){if(n==null&&(n={}),Me.ce||Me.parent&&an(Me.parent)&&Me.parent.ce){const d=n,c=Object.keys(d).length>0;return v(),de(Z,null,[ne("slot",d,s)],c?-2:64)}let l=e[t];l&&l._c&&(l._d=!1);const i=Dt.length;v();let u;try{const d=l&&ur(l(n)),c=n.key||a||d&&d.key;u=de(Z,{key:(c&&!it(c)?c:`_${t}`)+(!d&&s?"_fb":"")},d||(s?s():[]),d&&e._===1?64:-2)}catch(d){for(let c=Dt.length;c>i;c--)ho();throw d}finally{l&&l._c&&(l._d=!0)}return u.scopeId&&(u.slotScopeIds=[u.scopeId+"-s"]),u}function ur(e){return e.some(t=>On(t)?!(t.type===kt||t.type===Z&&!ur(t.children)):!0)?e:null}const Fs=e=>e?Rr(e)?xs(e):Fs(e.parent):null,En=je(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Fs(e.parent),$root:e=>Fs(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>dr(e),$forceUpdate:e=>e.f||(e.f=()=>{co(e.update)}),$nextTick:e=>e.n||(e.n=uo.bind(e.proxy)),$watch:e=>Ul.bind(e)}),Es=(e,t)=>e!==we&&!e.__isScriptSetup&&be(e,t),ei={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:a,accessCache:l,type:i,appContext:u}=e;if(t[0]!=="$"){const f=l[t];if(f!==void 0)switch(f){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return a[t]}else{if(Es(s,t))return l[t]=1,s[t];if(o!==we&&be(o,t))return l[t]=2,o[t];if(be(a,t))return l[t]=3,a[t];if(n!==we&&be(n,t))return l[t]=4,n[t];Hs&&(l[t]=0)}}const d=En[t];let c,p;if(d)return t==="$attrs"&&Ve(e.attrs,"get",""),d(e);if((c=i.__cssModules)&&(c=c[t]))return c;if(n!==we&&be(n,t))return l[t]=4,n[t];if(p=u.config.globalProperties,be(p,t))return p[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:a}=e;return Es(o,t)?(o[t]=n,!0):s!==we&&be(s,t)?(s[t]=n,!0):be(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:a,type:l}},i){let u;return!!(n[i]||e!==we&&i[0]!=="$"&&be(e,i)||Es(t,i)||be(a,i)||be(s,i)||be(En,i)||be(o.config.globalProperties,i)||(u=l.__cssModules)&&u[i])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:be(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Do(e){return se(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Hs=!0;function ti(e){const t=dr(e),n=e.proxy,s=e.ctx;Hs=!1,t.beforeCreate&&To(t.beforeCreate,e,"bc");const{data:o,computed:a,methods:l,watch:i,provide:u,inject:d,created:c,beforeMount:p,mounted:f,beforeUpdate:_,updated:k,activated:A,deactivated:I,beforeDestroy:y,beforeUnmount:w,destroyed:g,unmounted:x,render:$,renderTracked:U,renderTriggered:F,errorCaptured:H,serverPrefetch:me,expose:te,inheritAttrs:B,components:Pe,directives:J,filters:ze}=t;if(d&&ni(d,s,null),l)for(const ve in l){const pe=l[ve];ae(pe)&&(s[ve]=pe.bind(n))}if(o){const ve=o.call(n,n);xe(ve)&&(e.data=fs(ve))}if(Hs=!0,a)for(const ve in a){const pe=a[ve],at=ae(pe)?pe.bind(n,n):ae(pe.get)?pe.get.bind(n,n):wt,Ke=!ae(pe)&&ae(pe.set)?pe.set.bind(n):wt,nt=le({get:at,set:Ke});Object.defineProperty(s,ve,{enumerable:!0,configurable:!0,get:()=>nt.value,set:De=>nt.value=De})}if(i)for(const ve in i)cr(i[ve],s,n,ve);if(u){const ve=ae(u)?u.call(n):u;Reflect.ownKeys(ve).forEach(pe=>{Kn(pe,ve[pe])})}c&&To(c,e,"c");function Se(ve,pe){se(pe)?pe.forEach(at=>ve(at.bind(n))):pe&&ve(pe.bind(n))}if(Se(Wl,p),Se(hs,f),Se(Gl,_),Se(zl,k),Se(Fl,A),Se(Hl,I),Se(Yl,H),Se(Jl,U),Se(Ql,F),Se(or,w),Se(ar,x),Se(Kl,me),se(te))if(te.length){const ve=e.exposed||(e.exposed={});te.forEach(pe=>{Object.defineProperty(ve,pe,{get:()=>n[pe],set:at=>n[pe]=at,enumerable:!0})})}else e.exposed||(e.exposed={});$&&e.render===wt&&(e.render=$),B!=null&&(e.inheritAttrs=B),Pe&&(e.components=Pe),J&&(e.directives=J),me&&nr(e)}function ni(e,t,n=wt){se(e)&&(e=Bs(e));for(const s in e){const o=e[s];let a;xe(o)?"default"in o?a=lt(o.from||s,o.default,!0):a=lt(o.from||s):a=lt(o),Le(a)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>a.value,set:l=>a.value=l}):t[s]=a}}function To(e,t,n){ct(se(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function cr(e,t,n,s){let o=s.includes(".")?Xa(n,s):()=>n[s];if($e(e)){const a=t[e];ae(a)&&Ge(o,a)}else if(ae(e))Ge(o,e.bind(n));else if(xe(e))if(se(e))e.forEach(a=>cr(a,t,n,s));else{const a=ae(e.handler)?e.handler.bind(n):t[e.handler];ae(a)&&Ge(o,a,e)}}function dr(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:a,config:{optionMergeStrategies:l}}=e.appContext,i=a.get(t);let u;return i?u=i:!o.length&&!n&&!s?u=t:(u={},o.length&&o.forEach(d=>ts(u,d,l,!0)),ts(u,t,l)),xe(t)&&a.set(t,u),u}function ts(e,t,n,s=!1){const{mixins:o,extends:a}=t;a&&ts(e,a,n,!0),o&&o.forEach(l=>ts(e,l,n,!0));for(const l in t)if(!(s&&l==="expose")){const i=si[l]||n&&n[l];e[l]=i?i(e[l],t[l]):t[l]}return e}const si={data:Oo,props:Mo,emits:Mo,methods:_n,computed:_n,beforeCreate:Fe,created:Fe,beforeMount:Fe,mounted:Fe,beforeUpdate:Fe,updated:Fe,beforeDestroy:Fe,beforeUnmount:Fe,destroyed:Fe,unmounted:Fe,activated:Fe,deactivated:Fe,errorCaptured:Fe,serverPrefetch:Fe,components:_n,directives:_n,watch:ai,provide:Oo,inject:oi};function Oo(e,t){return t?e?function(){return je(ae(e)?e.call(this,this):e,ae(t)?t.call(this,this):t)}:t:e}function oi(e,t){return _n(Bs(e),Bs(t))}function Bs(e){if(se(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Fe(e,t){return e?[...new Set([].concat(e,t))]:t}function _n(e,t){return e?je(Object.create(null),e,t):t}function Mo(e,t){return e?se(e)&&se(t)?[...new Set([...e,...t])]:je(Object.create(null),Do(e),Do(t??{})):t}function ai(e,t){if(!e)return t;if(!t)return e;const n=je(Object.create(null),e);for(const s in t)n[s]=Fe(e[s],t[s]);return n}function fr(){return{app:null,config:{isNativeTag:wa,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let ri=0;function li(e,t){return function(s,o=null){ae(s)||(s=je({},s)),o!=null&&!xe(o)&&(o=null);const a=fr(),l=new WeakSet,i=[];let u=!1;const d=a.app={_uid:ri++,_component:s,_props:o,_container:null,_context:a,_instance:null,version:Vi,get config(){return a.config},set config(c){},use(c,...p){return l.has(c)||(c&&ae(c.install)?(l.add(c),c.install(d,...p)):ae(c)&&(l.add(c),c(d,...p))),d},mixin(c){return a.mixins.includes(c)||a.mixins.push(c),d},component(c,p){return p?(a.components[c]=p,d):a.components[c]},directive(c,p){return p?(a.directives[c]=p,d):a.directives[c]},mount(c,p,f){if(!u){const _=d._ceVNode||ne(s,o);return _.appContext=a,f===!0?f="svg":f===!1&&(f=void 0),e(_,c,f),u=!0,d._container=c,c.__vue_app__=d,xs(_.component)}},onUnmount(c){i.push(c)},unmount(){u&&(ct(i,d._instance,16),e(null,d._container),delete d._container.__vue_app__)},provide(c,p){return a.provides[c]=p,d},runWithContext(c){const p=rn;rn=d;try{return c()}finally{rn=p}}};return d}}let rn=null;const ii=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${We(t)}Modifiers`]||e[`${Zt(t)}Modifiers`];function ui(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||we;let o=n;const a=t.startsWith("update:"),l=a&&ii(s,t.slice(7));l&&(l.trim&&(o=n.map(c=>$e(c)?c.trim():c)),l.number&&(o=n.map(us)));let i,u=s[i=ws(t)]||s[i=ws(We(t))];!u&&a&&(u=s[i=ws(Zt(t))]),u&&ct(u,e,6,o);const d=s[i+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[i])return;e.emitted[i]=!0,ct(d,e,6,o)}}const ci=new WeakMap;function pr(e,t,n=!1){const s=n?ci:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const a=e.emits;let l={},i=!1;if(!ae(e)){const u=d=>{const c=pr(d,t,!0);c&&(i=!0,je(l,c))};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}return!a&&!i?(xe(e)&&s.set(e,null),null):(se(a)?a.forEach(u=>l[u]=null):je(l,a),xe(e)&&s.set(e,l),l)}function gs(e,t){return!e||!as(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),be(e,t[0].toLowerCase()+t.slice(1))||be(e,Zt(t))||be(e,t))}function No(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[a],slots:l,attrs:i,emit:u,render:d,renderCache:c,props:p,data:f,setupState:_,ctx:k,inheritAttrs:A}=e,I=Xn(e);let y,w;try{if(n.shapeFlag&4){const x=o||s,$=x;y=yt(d.call($,x,c,p,_,f,k)),w=i}else{const x=t;y=yt(x.length>1?x(p,{attrs:i,slots:l,emit:u}):x(p,null)),w=t.props?i:di(i)}}catch(x){Dt.length=0,ps(x,e,1),y=ne(kt)}let g=y;if(w&&A!==!1){const x=Object.keys(w),{shapeFlag:$}=g;x.length&&$&7&&(a&&x.some(rs)&&(w=fi(w,a)),g=cn(g,w,!1,!0))}if(n.dirs&&(g=cn(g,null,!1,!0),g.dirs=g.dirs?g.dirs.concat(n.dirs):n.dirs),n.transition){const x=ms(g.type)&&er(g)||g;fo(x,n.transition)}return y=g,Xn(I),y}const di=e=>{let t;for(const n in e)(n==="class"||n==="style"||as(n))&&((t||(t={}))[n]=e[n]);return t},fi=(e,t)=>{const n={};for(const s in e)(!rs(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function pi(e,t,n){const{props:s,children:o,component:a}=e,{props:l,children:i,patchFlag:u}=t,d=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&u>=0){if(u&1024)return!0;if(u&16)return s?jo(s,l,d):!!l;if(u&8){const c=t.dynamicProps;for(let p=0;p<c.length;p++){const f=c[p];if(mr(l,s,f)&&!gs(d,f))return!0}}}else return(o||i)&&(!i||!i.$stable)?!0:s===l?!1:s?l?jo(s,l,d):!0:!!l;return!1}function jo(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const a=s[o];if(mr(t,e,a)&&!gs(n,a))return!0}return!1}function mr(e,t,n){const s=e[n],o=t[n];return n==="style"&&xe(s)&&xe(o)?!Ht(s,o):s!==o}function mi({vnode:e,parent:t,suspense:n},s){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=s,e=o),o===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const vr={},hr=()=>Object.create(vr),gr=e=>Object.getPrototypeOf(e)===vr;function vi(e,t,n,s=!1){const o={},a=hr();e.propsDefaults=Object.create(null),br(e,t,o,a);for(const l in e.propsOptions[0])l in o||(o[l]=void 0);n?e.props=s?o:Ba(o):e.type.props?e.props=o:e.props=a,e.attrs=a}function hi(e,t,n,s){const{props:o,attrs:a,vnode:{patchFlag:l}}=e,i=ge(o),[u]=e.propsOptions;let d=!1;if((s||l>0)&&!(l&16)){if(l&8){const c=e.vnode.dynamicProps;for(let p=0;p<c.length;p++){let f=c[p];if(gs(e.emitsOptions,f))continue;const _=t[f];if(u)if(be(a,f))_!==a[f]&&(a[f]=_,d=!0);else{const k=We(f);o[k]=Ws(u,i,k,_,e,!1)}else _!==a[f]&&(a[f]=_,d=!0)}}}else{br(e,t,o,a)&&(d=!0);let c;for(const p in i)(!t||!be(t,p)&&((c=Zt(p))===p||!be(t,c)))&&(u?n&&(n[p]!==void 0||n[c]!==void 0)&&(o[p]=Ws(u,i,p,void 0,e,!0)):delete o[p]);if(a!==i)for(const p in a)(!t||!be(t,p))&&(delete a[p],d=!0)}d&&It(e.attrs,"set","")}function br(e,t,n,s){const[o,a]=e.propsOptions;let l=!1,i;if(t)for(let u in t){if($n(u))continue;const d=t[u];let c;o&&be(o,c=We(u))?!a||!a.includes(c)?n[c]=d:(i||(i={}))[c]=d:gs(e.emitsOptions,u)||(!(u in s)||d!==s[u])&&(s[u]=d,l=!0)}if(a){const u=ge(n),d=i||we;for(let c=0;c<a.length;c++){const p=a[c];n[p]=Ws(o,u,p,d[p],e,!be(d,p))}}return l}function Ws(e,t,n,s,o,a){const l=e[n];if(l!=null){const i=be(l,"default");if(i&&s===void 0){const u=l.default;if(l.type!==Function&&!l.skipFactory&&ae(u)){const{propsDefaults:d}=o;if(n in d)s=d[n];else{const c=qn(o);s=d[n]=u.call(null,t),c()}}else s=u;o.ce&&o.ce._setProp(n,s)}l[0]&&(a&&!i?s=!1:l[1]&&(s===""||s===Zt(n))&&(s=!0))}return s}const gi=new WeakMap;function xr(e,t,n=!1){const s=n?gi:t.propsCache,o=s.get(e);if(o)return o;const a=e.props,l={},i=[];let u=!1;if(!ae(e)){const c=p=>{u=!0;const[f,_]=xr(p,t,!0);je(l,f),_&&i.push(..._)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!a&&!u)return xe(e)&&s.set(e,nn),nn;if(se(a))for(let c=0;c<a.length;c++){const p=We(a[c]);Vo(p)&&(l[p]=we)}else if(a)for(const c in a){const p=We(c);if(Vo(p)){const f=a[c],_=l[p]=se(f)||ae(f)?{type:f}:je({},f),k=_.type;let A=!1,I=!0;if(se(k))for(let y=0;y<k.length;++y){const w=k[y],g=ae(w)&&w.name;if(g==="Boolean"){A=!0;break}else g==="String"&&(I=!1)}else A=ae(k)&&k.name==="Boolean";_[0]=A,_[1]=I,(A||be(_,"default"))&&i.push(p)}}const d=[l,i];return xe(e)&&s.set(e,d),d}function Vo(e){return e[0]!=="$"&&!$n(e)}const mo=e=>e==="_"||e==="_ctx"||e==="$stable",vo=e=>se(e)?e.map(yt):[yt(e)],bi=(e,t,n)=>{if(t._n)return t;const s=dt((...o)=>vo(t(...o)),n);return s._c=!1,s},yr=(e,t,n)=>{const s=e._ctx;for(const o in e){if(mo(o))continue;const a=e[o];if(ae(a))t[o]=bi(o,a,s);else if(a!=null){const l=vo(a);t[o]=()=>l}}},_r=(e,t)=>{const n=vo(t);e.slots.default=()=>n},wr=(e,t,n)=>{for(const s in t)(n||!mo(s))&&(e[s]=t[s])},xi=(e,t,n)=>{const s=e.slots=hr();if(e.vnode.shapeFlag&32){const o=t._;o?(wr(s,t,n),n&&Aa(s,"_",o,!0)):yr(t,s)}else t&&_r(e,t)},yi=(e,t,n)=>{const{vnode:s,slots:o}=e;let a=!0,l=we;if(s.shapeFlag&32){const i=t._;i?n&&i===1?a=!1:wr(o,t,n):(a=!t.$stable,yr(t,o)),l=t}else t&&(_r(e,t),l={default:1});if(a)for(const i in o)!mo(i)&&l[i]==null&&delete o[i]},Je=Ci;function _i(e){return wi(e)}function wi(e,t){const n=cs();n.__VUE__=!0;const{insert:s,remove:o,patchProp:a,createElement:l,createText:i,createComment:u,setText:d,setElementText:c,parentNode:p,nextSibling:f,setScopeId:_=wt,insertStaticContent:k}=e,A=(m,h,C,T=null,M=null,D=null,R=void 0,E=null,L=!!h.dynamicChildren)=>{if(m===h)return;m&&!bn(m,h)&&(T=O(m),De(m,M,D,!0),m=null),h.patchFlag===-2&&(L=!1,h.dynamicChildren=null);const{type:N,ref:P,shapeFlag:q}=h;switch(N){case bs:I(m,h,C,T);break;case kt:y(m,h,C,T);break;case Qn:m==null&&w(h,C,T,R);break;case Z:Pe(m,h,C,T,M,D,R,E,L);break;default:q&1?$(m,h,C,T,M,D,R,E,L):q&6?J(m,h,C,T,M,D,R,E,L):(q&64||q&128)&&N.process(m,h,C,T,M,D,R,E,L,ee)}P!=null&&M?Sn(P,m&&m.ref,D,h||m,!h):P==null&&m&&m.ref!=null&&Sn(m.ref,null,D,m,!0)},I=(m,h,C,T)=>{if(m==null)s(h.el=i(h.children),C,T);else{const M=h.el=m.el;h.children!==m.children&&d(M,h.children)}},y=(m,h,C,T)=>{m==null?s(h.el=u(h.children||""),C,T):h.el=m.el},w=(m,h,C,T)=>{[m.el,m.anchor]=k(m.children,h,C,T,m.el,m.anchor)},g=({el:m,anchor:h},C,T)=>{let M;for(;m&&m!==h;)M=f(m),s(m,C,T),m=M;s(h,C,T)},x=({el:m,anchor:h})=>{let C;for(;m&&m!==h;)C=f(m),o(m),m=C;o(h)},$=(m,h,C,T,M,D,R,E,L)=>{if(h.type==="svg"?R="svg":h.type==="math"&&(R="mathml"),m==null)U(h,C,T,M,D,R,E,L);else{const N=m.el&&m.el._isVueCE?m.el:null;try{N&&N._beginPatch(),me(m,h,M,D,R,E,L)}finally{N&&N._endPatch()}}},U=(m,h,C,T,M,D,R,E)=>{let L,N;const{props:P,shapeFlag:q,transition:X,dirs:oe}=m;if(L=m.el=l(m.type,D,P&&P.is,P),q&8?c(L,m.children):q&16&&H(m.children,L,null,T,M,Is(m,D),R,E),oe&&Gt(m,null,T,"created"),F(L,m,m.scopeId,R,T),P){for(const _e in P)_e!=="value"&&!$n(_e)&&a(L,_e,null,P[_e],D,T);"value"in P&&a(L,"value",null,P.value,D),(N=P.onVnodeBeforeMount)&>(N,T,m)}oe&&Gt(m,null,T,"beforeMount");const fe=ki(M,X);fe&&X.beforeEnter(L),s(L,h,C),((N=P&&P.onVnodeMounted)||fe||oe)&&Je(()=>{try{N&>(N,T,m),fe&&X.enter(L),oe&&Gt(m,null,T,"mounted")}finally{}},M)},F=(m,h,C,T,M)=>{if(C&&_(m,C),T)for(let D=0;D<T.length;D++)_(m,T[D]);if(M){let D=M.subTree;if(h===D||Ar(D.type)&&(D.ssContent===h||D.ssFallback===h)){const R=M.vnode;F(m,R,R.scopeId,R.slotScopeIds,M.parent)}}},H=(m,h,C,T,M,D,R,E,L=0)=>{for(let N=L;N<m.length;N++){const P=m[N]=E?Et(m[N]):yt(m[N]);A(null,P,h,C,T,M,D,R,E)}},me=(m,h,C,T,M,D,R)=>{const E=h.el=m.el;let{patchFlag:L,dynamicChildren:N,dirs:P}=h;L|=m.patchFlag&16;const q=m.props||we,X=h.props||we;let oe;if(C&&zt(C,!1),(oe=X.onVnodeBeforeUpdate)&>(oe,C,h,m),P&&Gt(h,m,C,"beforeUpdate"),C&&zt(C,!0),N&&(!m.dynamicChildren||m.dynamicChildren.length!==N.length)&&(L=0,R=!1,N=null),(q.innerHTML&&X.innerHTML==null||q.textContent&&X.textContent==null)&&c(E,""),N?te(m.dynamicChildren,N,E,C,T,Is(h,M),D):R||pe(m,h,E,null,C,T,Is(h,M),D,!1),L>0){if(L&16)B(E,q,X,C,M);else if(L&2&&q.class!==X.class&&a(E,"class",null,X.class,M),L&4&&a(E,"style",q.style,X.style,M),L&8){const fe=h.dynamicProps;for(let _e=0;_e<fe.length;_e++){const ye=fe[_e],Ee=q[ye],Te=X[ye];(Te!==Ee||ye==="value")&&a(E,ye,Ee,Te,M,C)}}L&1&&m.children!==h.children&&c(E,h.children)}else!R&&N==null&&B(E,q,X,C,M);((oe=X.onVnodeUpdated)||P)&&Je(()=>{oe&>(oe,C,h,m),P&&Gt(h,m,C,"updated")},T)},te=(m,h,C,T,M,D,R)=>{for(let E=0;E<h.length;E++){const L=m[E],N=h[E],P=L.el&&(L.type===Z||!bn(L,N)||L.shapeFlag&198)?p(L.el):C;A(L,N,P,null,T,M,D,R,!0)}},B=(m,h,C,T,M)=>{if(h!==C){if(h!==we)for(const D in h)!$n(D)&&!(D in C)&&a(m,D,h[D],null,M,T);for(const D in C){if($n(D))continue;const R=C[D],E=h[D];R!==E&&D!=="value"&&a(m,D,E,R,M,T)}"value"in C&&a(m,"value",h.value,C.value,M)}},Pe=(m,h,C,T,M,D,R,E,L)=>{const N=h.el=m?m.el:i(""),P=h.anchor=m?m.anchor:i("");let{patchFlag:q,dynamicChildren:X,slotScopeIds:oe}=h;oe&&(E=E?E.concat(oe):oe),m==null?(s(N,C,T),s(P,C,T),H(h.children||[],C,P,M,D,R,E,L)):q>0&&q&64&&X&&m.dynamicChildren&&m.dynamicChildren.length===X.length?(te(m.dynamicChildren,X,C,M,D,R,E),(h.key!=null||M&&h===M.subTree)&&kr(m,h,!0)):pe(m,h,C,P,M,D,R,E,L)},J=(m,h,C,T,M,D,R,E,L)=>{h.slotScopeIds=E,m==null?h.shapeFlag&512?M.ctx.activate(h,C,T,R,L):ze(h,C,T,M,D,R,L):Vt(m,h,L)},ze=(m,h,C,T,M,D,R)=>{const E=m.component=Ri(m,T,M);if(po(m)&&(E.ctx.renderer=ee),Di(E,!1,R),E.asyncDep){if(M&&M.registerDep(E,Se,R),!m.el){const L=E.subTree=ne(kt);y(null,L,h,C),m.placeholder=L.el}}else Se(E,m,h,C,M,D,R)},Vt=(m,h,C)=>{const T=h.component=m.component;if(pi(m,h,C))if(T.asyncDep&&!T.asyncResolved){ve(T,h,C);return}else T.next=h,T.update();else h.el=m.el,T.vnode=h},Se=(m,h,C,T,M,D,R)=>{const E=()=>{if(m.isMounted){let{next:q,bu:X,u:oe,parent:fe,vnode:_e}=m;{const vt=$r(m);if(vt){q&&(q.el=_e.el,ve(m,q,R)),vt.asyncDep.then(()=>{Je(()=>{m.isUnmounted||N()},M)});return}}let ye=q,Ee;zt(m,!1),q?(q.el=_e.el,ve(m,q,R)):q=_e,X&&zn(X),(Ee=q.props&&q.props.onVnodeBeforeUpdate)&>(Ee,fe,q,_e),zt(m,!0);const Te=No(m),mt=m.subTree;m.subTree=Te,A(mt,Te,p(mt.el),O(mt),m,M,D),q.el=Te.el,ye===null&&mi(m,Te.el),oe&&Je(oe,M),(Ee=q.props&&q.props.onVnodeUpdated)&&Je(()=>gt(Ee,fe,q,_e),M)}else{let q;const{el:X,props:oe}=h,{bm:fe,m:_e,parent:ye,root:Ee,type:Te}=m,mt=an(h);zt(m,!1),fe&&zn(fe),!mt&&(q=oe&&oe.onVnodeBeforeMount)&>(q,ye,h),zt(m,!0);{Ee.ce&&Ee.ce._hasShadowRoot()&&Ee.ce._injectChildStyle(Te,m.parent?m.parent.type:void 0);const vt=m.subTree=No(m);A(null,vt,C,T,m,M,D),h.el=vt.el}if(_e&&Je(_e,M),!mt&&(q=oe&&oe.onVnodeMounted)){const vt=h;Je(()=>gt(q,ye,vt),M)}(h.shapeFlag&256||ye&&an(ye.vnode)&&ye.vnode.shapeFlag&256)&&m.a&&Je(m.a,M),m.isMounted=!0,h=C=T=null}};m.scope.on();const L=m.effect=new Ra(E);m.scope.off();const N=m.update=L.run.bind(L),P=m.job=L.runIfDirty.bind(L);P.i=m,P.id=m.uid,L.scheduler=()=>co(P),zt(m,!0),N()},ve=(m,h,C)=>{h.component=m;const T=m.vnode.props;m.vnode=h,m.next=null,hi(m,h.props,T,C),yi(m,h.children,C),Tt(),Eo(m),Ot()},pe=(m,h,C,T,M,D,R,E,L=!1)=>{const N=m&&m.children,P=m?m.shapeFlag:0,q=h.children,{patchFlag:X,shapeFlag:oe}=h;if(X>0){if(X&128){Ke(N,q,C,T,M,D,R,E,L);return}else if(X&256){at(N,q,C,T,M,D,R,E,L);return}}oe&8?(P&16&&Qe(N,M,D),q!==N&&c(C,q)):P&16?oe&16?Ke(N,q,C,T,M,D,R,E,L):Qe(N,M,D,!0):(P&8&&c(C,""),oe&16&&H(q,C,T,M,D,R,E,L))},at=(m,h,C,T,M,D,R,E,L)=>{m=m||nn,h=h||nn;const N=m.length,P=h.length,q=Math.min(N,P);let X;for(X=0;X<q;X++){const oe=h[X]=L?Et(h[X]):yt(h[X]);A(m[X],oe,C,null,M,D,R,E,L)}N>P?Qe(m,M,D,!0,!1,q):H(h,C,T,M,D,R,E,L,q)},Ke=(m,h,C,T,M,D,R,E,L)=>{let N=0;const P=h.length;let q=m.length-1,X=P-1;for(;N<=q&&N<=X;){const oe=m[N],fe=h[N]=L?Et(h[N]):yt(h[N]);if(bn(oe,fe))A(oe,fe,C,null,M,D,R,E,L);else break;N++}for(;N<=q&&N<=X;){const oe=m[q],fe=h[X]=L?Et(h[X]):yt(h[X]);if(bn(oe,fe))A(oe,fe,C,null,M,D,R,E,L);else break;q--,X--}if(N>q){if(N<=X){const oe=X+1,fe=oe<P?h[oe].el:T;for(;N<=X;)A(null,h[N]=L?Et(h[N]):yt(h[N]),C,fe,M,D,R,E,L),N++}}else if(N>X)for(;N<=q;)De(m[N],M,D,!0),N++;else{const oe=N,fe=N,_e=new Map;for(N=fe;N<=X;N++){const Xe=h[N]=L?Et(h[N]):yt(h[N]);Xe.key!=null&&_e.set(Xe.key,N)}let ye,Ee=0;const Te=X-fe+1;let mt=!1,vt=0;const hn=new Array(Te);for(N=0;N<Te;N++)hn[N]=0;for(N=oe;N<=q;N++){const Xe=m[N];if(Ee>=Te){De(Xe,M,D,!0);continue}let ht;if(Xe.key!=null)ht=_e.get(Xe.key);else for(ye=fe;ye<=X;ye++)if(hn[ye-fe]===0&&bn(Xe,h[ye])){ht=ye;break}ht===void 0?De(Xe,M,D,!0):(hn[ht-fe]=N+1,ht>=vt?vt=ht:mt=!0,A(Xe,h[ht],C,null,M,D,R,E,L),Ee++)}const _o=mt?$i(hn):nn;for(ye=_o.length-1,N=Te-1;N>=0;N--){const Xe=fe+N,ht=h[Xe],wo=h[Xe+1],ko=Xe+1<P?wo.el||Cr(wo):T;hn[N]===0?A(null,ht,C,ko,M,D,R,E,L):mt&&(ye<0||N!==_o[ye]?nt(ht,C,ko,2):ye--)}}},nt=(m,h,C,T,M=null)=>{const{el:D,type:R,transition:E,children:L,shapeFlag:N}=m;if(N&6){nt(m.component.subTree,h,C,T);return}if(N&128){m.suspense.move(h,C,T);return}if(N&64){R.move(m,h,C,ee);return}if(R===Z){s(D,h,C);for(let q=0;q<L.length;q++)nt(L[q],h,C,T);s(m.anchor,h,C);return}if(R===Qn){g(m,h,C);return}if(T!==2&&N&1&&E)if(T===0)E.persisted&&!D[Ss]?s(D,h,C):(E.beforeEnter(D),s(D,h,C),Je(()=>E.enter(D),M));else{const{leave:q,delayLeave:X,afterLeave:oe}=E,fe=()=>{m.ctx.isUnmounted?o(D):s(D,h,C)},_e=()=>{const ye=D._isLeaving||!!D[Ss];D._isLeaving&&D[Ss](!0),E.persisted&&!ye?fe():q(D,()=>{fe(),oe&&oe()})};X?X(D,fe,_e):_e()}else s(D,h,C)},De=(m,h,C,T=!1,M=!1)=>{const{type:D,props:R,ref:E,children:L,dynamicChildren:N,shapeFlag:P,patchFlag:q,dirs:X,cacheIndex:oe,memo:fe}=m;if(q===-2&&(M=!1),E!=null&&(Tt(),Sn(E,null,C,m,!0),Ot()),oe!=null&&(h.renderCache[oe]=void 0),P&256){h.ctx.deactivate(m);return}const _e=P&1&&X,ye=!an(m);let Ee;if(ye&&(Ee=R&&R.onVnodeBeforeUnmount)&>(Ee,h,m),P&6)pt(m.component,C,T);else{if(P&128){m.suspense.unmount(C,T);return}_e&&Gt(m,null,h,"beforeUnmount"),P&64?m.type.remove(m,h,C,ee,T):N&&!N.hasOnce&&(D!==Z||q>0&&q&64)?Qe(N,h,C,!1,!0):(D===Z&&q&384||!M&&P&16)&&Qe(L,h,C),T&&$t(m)}const Te=fe!=null&&oe==null;(ye&&(Ee=R&&R.onVnodeUnmounted)||_e||Te)&&Je(()=>{Ee&>(Ee,h,m),_e&&Gt(m,null,h,"unmounted"),Te&&(m.el=null)},C)},$t=m=>{const{type:h,el:C,anchor:T,transition:M}=m;if(h===Z){Ze(C,T);return}if(h===Qn){x(m);return}const D=()=>{o(C),M&&!M.persisted&&M.afterLeave&&M.afterLeave()};if(m.shapeFlag&1&&M&&!M.persisted){const{leave:R,delayLeave:E}=M,L=()=>R(C,D);E?E(m.el,D,L):L()}else D()},Ze=(m,h)=>{let C;for(;m!==h;)C=f(m),o(m),m=C;o(h)},pt=(m,h,C)=>{const{bum:T,scope:M,job:D,subTree:R,um:E,m:L,a:N}=m;Uo(L),Uo(N),T&&zn(T),M.stop(),D&&(D.flags|=8,De(R,m,h,C)),E&&Je(E,h),Je(()=>{m.isUnmounted=!0},h)},Qe=(m,h,C,T=!1,M=!1,D=0)=>{for(let R=D;R<m.length;R++)De(m[R],h,C,T,M)},O=m=>{if(m.shapeFlag&6)return O(m.component.subTree);if(m.shapeFlag&128)return m.suspense.next();const h=f(m.anchor||m.el),C=h&&h[Ll];return C?f(C):h};let G=!1;const W=(m,h,C)=>{let T;m==null?h._vnode&&(De(h._vnode,null,null,!0),T=h._vnode.component):A(h._vnode||null,m,h,null,null,null,C),h._vnode=m,G||(G=!0,Eo(T),Qa(),G=!1)},ee={p:A,um:De,m:nt,r:$t,mt:ze,mc:H,pc:pe,pbc:te,n:O,o:e};return{render:W,hydrate:void 0,createApp:li(W)}}function Is({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 ki(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function kr(e,t,n=!1){const s=e.children,o=t.children;if(se(s)&&se(o))for(let a=0;a<s.length;a++){const l=s[a];let i=o[a];i.shapeFlag&1&&!i.dynamicChildren&&((i.patchFlag<=0||i.patchFlag===32)&&(i=o[a]=Et(o[a]),i.el=l.el),!n&&i.patchFlag!==-2&&kr(l,i)),i.type===bs&&(i.patchFlag===-1&&(i=o[a]=Et(i)),i.el=l.el),i.type===kt&&!i.el&&(i.el=l.el)}}function $i(e){const t=e.slice(),n=[0];let s,o,a,l,i;const u=e.length;for(s=0;s<u;s++){const d=e[s];if(d!==0){if(o=n[n.length-1],e[o]<d){t[s]=o,n.push(s);continue}for(a=0,l=n.length-1;a<l;)i=a+l>>1,e[n[i]]<d?a=i+1:l=i;d<e[n[a]]&&(a>0&&(t[s]=n[a-1]),n[a]=s)}}for(a=n.length,l=n[a-1];a-- >0;)n[a]=l,l=t[l];return n}function $r(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:$r(t)}function Uo(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Cr(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Cr(t.subTree):null}const Ar=e=>e.__isSuspense;function Ci(e,t){t&&t.pendingBranch?se(e)?t.effects.push(...e):t.effects.push(e):Nl(e)}const Z=Symbol.for("v-fgt"),bs=Symbol.for("v-txt"),kt=Symbol.for("v-cmt"),Qn=Symbol.for("v-stc"),Dt=[];let et=null;function v(e=!1){Dt.push(et=e?null:[])}function ho(){Dt.pop(),et=Dt[Dt.length-1]||null}let Tn=1;function ns(e,t=!1){Tn+=e,e<0&&et&&t&&(et.hasOnce=!0)}function Sr(e){return e.dynamicChildren=Tn>0?et||nn:null,ho(),Tn>0&&et&&et.push(e),e}function b(e,t,n,s,o,a){return Sr(r(e,t,n,s,o,a,!0))}function de(e,t,n,s,o){return Sr(ne(e,t,n,s,o,!0))}function On(e){return e?e.__v_isVNode===!0:!1}function bn(e,t){return e.type===t.type&&e.key===t.key}const Er=({key:e})=>e??null,Jn=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?$e(e)||Le(e)||ae(e)?{i:Me,r:e,k:t,f:!!n}:e:null);function r(e,t=null,n=null,s=0,o=null,a=e===Z?0:1,l=!1,i=!1){const u={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Er(t),ref:t&&Jn(t),scopeId:Ya,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:a,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Me};return i?(ss(u,n),a&128&&e.normalize(u)):n&&(u.shapeFlag|=$e(n)?8:16),Tn>0&&!l&&et&&(u.patchFlag>0||a&6)&&u.patchFlag!==32&&et.push(u),u}const ne=Ai;function Ai(e,t=null,n=null,s=0,o=null,a=!1){if((!e||e===lr)&&(e=kt),On(e)){const i=cn(e,t,!0);return n&&ss(i,n),Tn>0&&!a&&et&&(i.shapeFlag&6?et[et.indexOf(e)]=i:et.push(i)),i.patchFlag=-2,i}if(ji(e)&&(e=e.__vccOpts),t){t=Si(t);let{class:i,style:u}=t;i&&!$e(i)&&(t.class=ie(i)),xe(u)&&(io(u)&&!se(u)&&(u=je({},u)),t.style=Ft(u))}const l=$e(e)?1:Ar(e)?128:ms(e)?64:xe(e)?4:ae(e)?2:0;return r(e,t,n,s,o,l,a,!0)}function Si(e){return e?io(e)||gr(e)?je({},e):e:null}function cn(e,t,n=!1,s=!1){const{props:o,ref:a,patchFlag:l,children:i,transition:u}=e,d=t?Ir(o||{},t):o,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&Er(d),ref:t&&t.ref?n&&a?se(a)?a.concat(Jn(t)):[a,Jn(t)]:Jn(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:i,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Z?l===-1?16:l|16:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:u,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&cn(e.ssContent),ssFallback:e.ssFallback&&cn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return u&&s&&fo(c,u.clone(c)),c}function Y(e=" ",t=0){return ne(bs,null,e,t)}function go(e,t){const n=ne(Qn,null,e);return n.staticCount=t,n}function V(e="",t=!1){return t?(v(),de(kt,null,e)):ne(kt,null,e)}function yt(e){return e==null||typeof e=="boolean"?ne(kt):se(e)?ne(Z,null,e.slice()):On(e)?Et(e):ne(bs,null,String(e))}function Et(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:cn(e)}function ss(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(se(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),ss(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!gr(t)?t._ctx=Me:o===3&&Me&&(Me.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(ae(t)){if(s&65){ss(e,{default:t});return}t={default:t,_ctx:Me},n=32}else t=String(t),s&64?(n=16,t=[Y(t)]):n=8;e.children=t,e.shapeFlag|=n}function Ir(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=ie([t.class,s.class]));else if(o==="style")t.style=Ft([t.style,s.style]);else if(as(o)){const a=t[o],l=s[o];l&&a!==l&&!(se(a)&&a.includes(l))?t[o]=a?[].concat(a,l):l:l==null&&a==null&&!rs(o)&&(t[o]=l)}else o!==""&&(t[o]=s[o])}return t}function gt(e,t,n,s=null){ct(e,t,7,[n,s])}const Ei=fr();let Ii=0;function Ri(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||Ei,a={uid:Ii++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new ll(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:xr(s,o),emitsOptions:pr(s,o),emit:null,emitted:null,propsDefaults:we,inheritAttrs:s.inheritAttrs,ctx:we,data:we,props:we,attrs:we,slots:we,refs:we,setupState:we,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return a.ctx={_:a},a.root=t?t.root:a,a.emit=ui.bind(null,a),e.ce&&e.ce(a),a}let Ue=null;const Pi=()=>Ue||Me;let os,Mn;{const e=cs(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),a=>{o.length>1?o.forEach(l=>l(a)):o[0](a)}};os=t("__VUE_INSTANCE_SETTERS__",n=>Ue=n),Mn=t("__VUE_SSR_SETTERS__",n=>Nn=n)}const qn=e=>{const t=Ue;return os(e),e.scope.on(),()=>{e.scope.off(),os(t)}},Lo=()=>{Ue&&Ue.scope.off(),os(null)};function Rr(e){return e.vnode.shapeFlag&4}let Nn=!1;function Di(e,t=!1,n=!1){t&&Mn(t);const{props:s,children:o}=e.vnode,a=Rr(e);vi(e,s,a,t),xi(e,o,n||t);const l=a?Ti(e,t):void 0;return t&&Mn(!1),l}function Ti(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,ei);const{setup:s}=n;if(s){Tt();const o=e.setupContext=s.length>1?Mi(e):null,a=qn(e),l=Ln(s,e,0,[e.props,o]),i=ka(l);if(Ot(),a(),(i||e.sp)&&!an(e)&&nr(e),i){if(l.then(Lo,Lo),t)return l.then(u=>{Mn(!0);try{qo(e,u,t)}finally{Mn(!1)}}).catch(u=>{ps(u,e,0)});e.asyncDep=l}else qo(e,l)}else Pr(e)}function qo(e,t,n){ae(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:xe(t)&&(e.setupState=Ga(t)),Pr(e)}function Pr(e,t,n){const s=e.type;e.render||(e.render=s.render||wt);{const o=qn(e);Tt();try{ti(e)}finally{Ot(),o()}}}const Oi={get(e,t){return Ve(e,"get",""),e[t]}};function Mi(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Oi),slots:e.slots,emit:e.emit,expose:t}}function xs(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Ga(Al(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in En)return En[n](e)},has(t,n){return n in t||n in En}})):e.proxy}function Ni(e,t=!0){return ae(e)?e.displayName||e.name:e.name||t&&e.__name}function ji(e){return ae(e)&&"__vccOpts"in e}const le=(e,t)=>Pl(e,t,Nn);function Dr(e,t,n){try{ns(-1);const s=arguments.length;return s===2?xe(t)&&!se(t)?On(t)?ne(e,null,[t]):ne(e,t):ne(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&On(n)&&(n=[n]),ne(e,t,n))}finally{ns(1)}}const Vi="3.5.41";/**
|
|
* @vue/runtime-dom v3.5.41
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
* @license MIT
|
|
**/let Gs;const Fo=typeof window<"u"&&window.trustedTypes;if(Fo)try{Gs=Fo.createPolicy("vue",{createHTML:e=>e})}catch{}const Tr=Gs?e=>Gs.createHTML(e):e=>e,Ui="http://www.w3.org/2000/svg",Li="http://www.w3.org/1998/Math/MathML",St=typeof document<"u"?document:null,Ho=St&&St.createElement("template"),qi={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(Ui,e):t==="mathml"?St.createElementNS(Li,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,a){const l=n?n.previousSibling:t.lastChild;if(o&&(o===a||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===a||!(o=o.nextSibling)););else{Ho.innerHTML=Tr(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const i=Ho.content;if(s==="svg"||s==="mathml"){const u=i.firstChild;for(;u.firstChild;)i.appendChild(u.firstChild);i.removeChild(u)}t.insertBefore(i,n)}return[l?l.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Fi=Symbol("_vtc");function Hi(e,t,n){const s=e[Fi];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Bo=Symbol("_vod"),Bi=Symbol("_vsh"),Wi=Symbol(""),Gi=/(?:^|;)\s*display\s*:/;function zi(e,t,n){const s=e.style,o=$e(n);let a=!1;if(n&&!o){if(t)if($e(t))for(const l of t.split(";")){const i=l.slice(0,l.indexOf(":")).trim();n[i]==null&&wn(s,i,"")}else for(const l in t)n[l]==null&&wn(s,l,"");for(const l in n){l==="display"&&(a=!0);const i=n[l];i!=null?Qi(e,l,!$e(t)&&t?t[l]:void 0,i)||wn(s,l,i):wn(s,l,"")}}else if(o){if(t!==n){const l=s[Wi];l&&(n+=";"+l),s.cssText=n,a=Gi.test(n)}}else t&&e.removeAttribute("style");Bo in e&&(e[Bo]=a?s.display:"",e[Bi]&&(s.display="none"))}const Wo=/\s*!important$/;function wn(e,t,n){if(se(n))n.forEach(s=>wn(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=Ki(e,t);Wo.test(n)?e.setProperty(Zt(s),n.replace(Wo,""),"important"):e[s]=n}}const Go=["Webkit","Moz","ms"],Rs={};function Ki(e,t){const n=Rs[t];if(n)return n;let s=We(t);if(s!=="filter"&&s in e)return Rs[t]=s;s=is(s);for(let o=0;o<Go.length;o++){const a=Go[o]+s;if(a in e)return Rs[t]=a}return t}function Qi(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&$e(s)&&n===s}const zo="http://www.w3.org/1999/xlink";function Ko(e,t,n,s,o,a=al(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(zo,t.slice(6,t.length)):e.setAttributeNS(zo,t,n):n==null||a&&!Sa(n)?e.removeAttribute(t):e.setAttribute(t,a?"":it(n)?String(n):n)}function Qo(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Tr(n):n);return}const a=e.tagName;if(t==="value"&&a!=="PROGRESS"&&!a.includes("-")){const i=a==="OPTION"?e.getAttribute("value")||"":e.value,u=n==null?e.type==="checkbox"?"on":"":String(n);(i!==u||!("_value"in e))&&(e.value=u),n==null&&e.removeAttribute(t),e._value=n;return}let l=!1;if(n===""||n==null){const i=typeof e[t];i==="boolean"?n=Sa(n):n==null&&i==="string"?(n="",l=!0):i==="number"&&(n=0,l=!0)}try{e[t]=n}catch{}l&&e.removeAttribute(o||t)}function Pt(e,t,n,s){e.addEventListener(t,n,s)}function Ji(e,t,n,s){e.removeEventListener(t,n,s)}const Jo=Symbol("_vei");function Yi(e,t,n,s,o=null){const a=e[Jo]||(e[Jo]={}),l=a[t];if(s&&l)l.value=s;else{const[i,u]=eu(t);if(s){const d=a[t]=su(s,o);Pt(e,i,d,u)}else l&&(Ji(e,i,l,u),a[t]=void 0)}}const Zi=/(Once|Passive|Capture)$/,Xi=/^on:?(?:Once|Passive|Capture)$/;function eu(e){let t,n;for(;(n=e.match(Zi))&&!Xi.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):Zt(e.slice(2)),t]}let Ps=0;const tu=Promise.resolve(),nu=()=>Ps||(tu.then(()=>Ps=0),Ps=Date.now());function su(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(se(o)){const a=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{a.call(s),s._stopped=!0};const l=o.slice(),i=[s];for(let u=0;u<l.length&&!s._stopped;u++){const d=l[u];d&&ct(d,t,5,i)}}else ct(o,t,5,[s])};return n.value=e,n.attached=nu(),n}const Yo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,ou=(e,t,n,s,o,a)=>{const l=o==="svg";t==="class"?Hi(e,s,l):t==="style"?zi(e,n,s):as(t)?rs(t)||Yi(e,t,n,s,a):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):au(e,t,s,l))?(Qo(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Ko(e,t,s,l,a,t!=="value")):e._isVueCE&&(ru(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!$e(s)))?Qo(e,We(t),s,a,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Ko(e,t,s,l))};function au(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Yo(t)&&ae(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)&&$e(n)?!1:t in e}function ru(e,t){const n=e._def.props;if(!n)return!1;const s=We(t);return Array.isArray(n)?n.some(o=>We(o)===s):Object.keys(n).some(o=>We(o)===s)}const Bt=e=>{const t=e.props["onUpdate:modelValue"]||!1;return se(t)?n=>zn(t,n):t};function lu(e){e.target.composing=!0}function Zo(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const tt=Symbol("_assign"),Wn=Symbol("_initialValue");function Ds(e,t,n){return t&&(e=e.trim()),n&&(e=us(e)),e}const re={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e.parentNode&&(e.type==="text"?e[Wn]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[Wn]=e.defaultValue.replace(/\r\n?/g,`
|
|
`))),e[tt]=Bt(o);const a=s||o.props&&o.props.type==="number";Pt(e,t?"change":"input",l=>{l.target.composing||e[tt](Ds(e.value,n,a))}),(n||a)&&Pt(e,"change",()=>{e.value=Ds(e.value,n,a)}),t||(Pt(e,"compositionstart",lu),Pt(e,"compositionend",Zo),Pt(e,"change",Zo))},mounted(e,{value:t,modifiers:{trim:n,number:s}}){const o=t??"",a=e[Wn];delete e[Wn],a!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==a?e[tt](Ds(e.value,n,s)):e.value=o},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:a}},l){if(e[tt]=Bt(l),e.composing)return;const i=(a||e.type==="number")&&!/^0\d/.test(e.value)?us(e.value):e.value,u=t??"";if(i===u)return;const d=e.getRootNode();(d instanceof Document||d instanceof ShadowRoot)&&d.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===u)||(e.value=u)}},st={deep:!0,created(e,t,n){e[tt]=Bt(n),Pt(e,"change",()=>{const s=e._modelValue,o=dn(e),a=e.checked,l=e[tt];if(se(s)){const i=to(s,o),u=i!==-1;if(a&&!u)l(s.concat(o));else if(!a&&u){const d=[...s];d.splice(i,1),l(d)}}else if(mn(s)){const i=new Set(s);a?i.add(o):i.delete(o),l(i)}else l(Or(e,a))})},mounted:Xo,beforeUpdate(e,t,n){e[tt]=Bt(n),Xo(e,t,n)}};function Xo(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(se(t))o=to(t,s.props.value)>-1;else if(mn(t))o=t.has(s.props.value);else{if(t===n)return;o=Ht(t,Or(e,!0))}e.checked!==o&&(e.checked=o)}const zs={created(e,{value:t},n){e.checked=Ht(t,n.props.value),e[tt]=Bt(n),Pt(e,"change",()=>{e[tt](dn(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[tt]=Bt(s),t!==n&&(e.checked=Ht(t,s.props.value))}},Nt={deep:!0,created(e,{value:t,modifiers:{number:n}},s){e._modelValue=t,Pt(e,"change",()=>{const o=Array.prototype.filter.call(e.options,a=>a.selected).map(a=>n?us(dn(a)):dn(a));e[tt](e.multiple?mn(e._modelValue)?new Set(o):o:o[0]),e._assigning=!0,uo(()=>{e._assigning=!1})}),e[tt]=Bt(s)},mounted(e,{value:t}){ea(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[tt]=Bt(n)},updated(e,{value:t}){e._assigning||ea(e,t)}};function ea(e,t){const n=e.multiple,s=se(t);if(!(n&&!s&&!mn(t))){for(let o=0,a=e.options.length;o<a;o++){const l=e.options[o],i=dn(l);if(n)if(s){const u=typeof i;u==="string"||u==="number"?l.selected=t.some(d=>String(d)===String(i)):l.selected=to(t,i)>-1}else l.selected=t.has(i);else if(Ht(dn(l),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function dn(e){return"_value"in e?e._value:e.value}function Or(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const iu=["ctrl","shift","alt","meta"],uu={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>iu.some(n=>e[`${n}Key`]&&!t.includes(n))},Ae=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...a)=>{for(let l=0;l<t.length;l++){const i=uu[t[l]];if(i&&i(o,t))return}return e(o,...a)}))},cu=je({patchProp:ou},qi);let ta;function du(){return ta||(ta=_i(cu))}const fu=((...e)=>{const t=du().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=mu(s);if(!o)return;const a=t._component;!ae(a)&&!a.render&&!a.template&&(a.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const l=n(o,!1,pu(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),l},t});function pu(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function mu(e){return $e(e)?document.querySelector(e):e}const vu=["width","height"],Ne={__name:"UiIcono",props:{nombre:{type:String,required:!0},tam:{type:[Number,String],default:16}},setup(e){const t={luna:[["path",{d:"M20 14.5A8.5 8.5 0 0 1 9.5 4a8.5 8.5 0 1 0 10.5 10.5Z"}]],sol:[["circle",{cx:12,cy:12,r:4}],["path",{d:"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"}]],lapiz:[["path",{d:"M12 20h9"}],["path",{d:"M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"}]],cerrar:[["path",{d:"M18 6 6 18M6 6l12 12"}]],atras:[["path",{d:"M19 12H5M12 19l-7-7 7-7"}]],grafico:[["path",{d:"M3 3v18h18"}],["path",{d:"M7 15v3M12 10v8M17 6v12"}]],cerebro:[["path",{d:"M9.5 3A2.5 2.5 0 0 0 7 5.5v.2A2.7 2.7 0 0 0 5 8.3c0 .8.3 1.5.9 2A2.8 2.8 0 0 0 5 12.5c0 1 .5 1.9 1.3 2.4-.2.4-.3.8-.3 1.2A2.9 2.9 0 0 0 9 19a2.5 2.5 0 0 0 3 2V3.8A2.5 2.5 0 0 0 9.5 3Z"}],["path",{d:"M14.5 3A2.5 2.5 0 0 1 17 5.5v.2a2.7 2.7 0 0 1 2 2.6c0 .8-.3 1.5-.9 2A2.8 2.8 0 0 1 19 12.5c0 1-.5 1.9-1.3 2.4.2.4.3.8.3 1.2A2.9 2.9 0 0 1 15 19a2.5 2.5 0 0 1-3 2"}]],imagen:[["rect",{x:3,y:3,width:18,height:18,rx:2}],["circle",{cx:8.5,cy:8.5,r:1.5}],["path",{d:"m21 15-5-5L5 21"}]],microfono:[["rect",{x:9,y:2,width:6,height:12,rx:3}],["path",{d:"M5 10a7 7 0 0 0 14 0M12 17v5"}]],escribir:[["path",{d:"M3 21h18"}],["path",{d:"M5 17 17.5 4.5a2.1 2.1 0 0 1 3 3L8 20l-4 1Z"}]],archivo:[["path",{d:"M14 2H7a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7Z"}],["path",{d:"M14 2v5h5"}]],sitio:[["circle",{cx:12,cy:12,r:9}],["path",{d:"M3 12h18M12 3a15 15 0 0 1 0 18 15 15 0 0 1 0-18Z"}]],refrescar:[["path",{d:"M21 12a9 9 0 1 1-3-6.7"}],["path",{d:"M21 4v5h-5"}]],descargar:[["path",{d:"M12 3v12"}],["path",{d:"m7 11 5 5 5-5"}],["path",{d:"M4 21h16"}]],alerta:[["path",{d:"M12 9v4M12 17h.01"}],["path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z"}]],ok:[["path",{d:"M20 6 9 17l-5-5"}]],copiar:[["rect",{x:9,y:9,width:12,height:12,rx:2}],["path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}]],mensaje:[["path",{d:"M21 11.5a8.4 8.4 0 0 1-9 8.4 8.5 8.5 0 0 1-3.9-.9L3 21l1.9-5.1A8.4 8.4 0 0 1 4 11.5a8.5 8.5 0 0 1 8.5-8.5A8.4 8.4 0 0 1 21 11.5Z"}]],auto:[["path",{d:"M17 2.1 21 6l-4 3.9"}],["path",{d:"M3 11V9a4 4 0 0 1 4-4h14"}],["path",{d:"M7 21.9 3 18l4-3.9"}],["path",{d:"M21 13v2a4 4 0 0 1-4 4H3"}]]};return(n,s)=>(v(),b("svg",{width:e.tam,height:e.tam,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round",class:"inline-block shrink-0 align-[-0.15em]","aria-hidden":"true"},[(v(!0),b(Z,null,ce(t[e.nombre]||[],(o,a)=>(v(),de(Zl(o[0]),Ir({key:a},{ref_for:!0},o[1]),null,16))),128))],8,vu))}};/*!
|
|
* vue-router v4.6.4
|
|
* (c) 2025 Eduardo San Martin Morote
|
|
* @license MIT
|
|
*/const tn=typeof document<"u";function Mr(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&&Mr(e.default)}const he=Object.assign;function Ts(e,t){const n={};for(const s in t){const o=t[s];n[s]=ft(o)?o.map(e):e(o)}return n}const In=()=>{},ft=Array.isArray;function na(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}const Nr=/#/g,gu=/&/g,bu=/\//g,xu=/=/g,yu=/\?/g,jr=/\+/g,_u=/%5B/g,wu=/%5D/g,Vr=/%5E/g,ku=/%60/g,Ur=/%7B/g,$u=/%7C/g,Lr=/%7D/g,Cu=/%20/g;function bo(e){return e==null?"":encodeURI(""+e).replace($u,"|").replace(_u,"[").replace(wu,"]")}function Au(e){return bo(e).replace(Ur,"{").replace(Lr,"}").replace(Vr,"^")}function Ks(e){return bo(e).replace(jr,"%2B").replace(Cu,"+").replace(Nr,"%23").replace(gu,"%26").replace(ku,"`").replace(Ur,"{").replace(Lr,"}").replace(Vr,"^")}function Su(e){return Ks(e).replace(xu,"%3D")}function Eu(e){return bo(e).replace(Nr,"%23").replace(yu,"%3F")}function Iu(e){return Eu(e).replace(bu,"%2F")}function jn(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Ru=/\/$/,Pu=e=>e.replace(Ru,"");function Os(e,t,n="/"){let s,o={},a="",l="";const i=t.indexOf("#");let u=t.indexOf("?");return u=i>=0&&u>i?-1:u,u>=0&&(s=t.slice(0,u),a=t.slice(u,i>0?i:t.length),o=e(a.slice(1))),i>=0&&(s=s||t.slice(0,i),l=t.slice(i,t.length)),s=Mu(s??t,n),{fullPath:s+a+l,path:s,query:o,hash:jn(l)}}function Du(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function sa(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Tu(e,t,n){const s=t.matched.length-1,o=n.matched.length-1;return s>-1&&s===o&&fn(t.matched[s],n.matched[o])&&qr(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function fn(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function qr(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Ou(e[n],t[n]))return!1;return!0}function Ou(e,t){return ft(e)?oa(e,t):ft(t)?oa(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function oa(e,t){return ft(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function Mu(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 a=n.length-1,l,i;for(l=0;l<s.length;l++)if(i=s[l],i!==".")if(i==="..")a>1&&a--;else break;return n.slice(0,a).join("/")+"/"+s.slice(l).join("/")}const Ut={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Qs=(function(e){return e.pop="pop",e.push="push",e})({}),Ms=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function Nu(e){if(!e)if(tn){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Pu(e)}const ju=/^[^#]+#/;function Vu(e,t){return e.replace(ju,"#")+t}function Uu(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 ys=()=>({left:window.scrollX,top:window.scrollY});function Lu(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=Uu(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 aa(e,t){return(history.state?history.state.position-t:-1)+e}const Js=new Map;function qu(e,t){Js.set(e,t)}function Fu(e){const t=Js.get(e);return Js.delete(e),t}function Hu(e){return typeof e=="string"||e&&typeof e=="object"}function Fr(e){return typeof e=="string"||typeof e=="symbol"}let Ce=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const Hr=Symbol("");Ce.MATCHER_NOT_FOUND+"",Ce.NAVIGATION_GUARD_REDIRECT+"",Ce.NAVIGATION_ABORTED+"",Ce.NAVIGATION_CANCELLED+"",Ce.NAVIGATION_DUPLICATED+"";function pn(e,t){return he(new Error,{type:e,[Hr]:!0},t)}function At(e,t){return e instanceof Error&&Hr in e&&(t==null||!!(e.type&t))}const Bu=["params","query","hash"];function Wu(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of Bu)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function Gu(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let s=0;s<n.length;++s){const o=n[s].replace(jr," "),a=o.indexOf("="),l=jn(a<0?o:o.slice(0,a)),i=a<0?null:jn(o.slice(a+1));if(l in t){let u=t[l];ft(u)||(u=t[l]=[u]),u.push(i)}else t[l]=i}return t}function ra(e){let t="";for(let n in e){const s=e[n];if(n=Su(n),s==null){s!==void 0&&(t+=(t.length?"&":"")+n);continue}(ft(s)?s.map(o=>o&&Ks(o)):[s&&Ks(s)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+n,o!=null&&(t+="="+o))})}return t}function zu(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=ft(s)?s.map(o=>o==null?null:""+o):s==null?s:""+s)}return t}const Ku=Symbol(""),la=Symbol(""),_s=Symbol(""),xo=Symbol(""),Ys=Symbol("");function xn(){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 qt(e,t,n,s,o,a=l=>l()){const l=s&&(s.enterCallbacks[o]=s.enterCallbacks[o]||[]);return()=>new Promise((i,u)=>{const d=f=>{f===!1?u(pn(Ce.NAVIGATION_ABORTED,{from:n,to:t})):f instanceof Error?u(f):Hu(f)?u(pn(Ce.NAVIGATION_GUARD_REDIRECT,{from:t,to:f})):(l&&s.enterCallbacks[o]===l&&typeof f=="function"&&l.push(f),i())},c=a(()=>e.call(s&&s.instances[o],t,n,d));let p=Promise.resolve(c);e.length<3&&(p=p.then(d)),p.catch(f=>u(f))})}function Ns(e,t,n,s,o=a=>a()){const a=[];for(const l of e)for(const i in l.components){let u=l.components[i];if(!(t!=="beforeRouteEnter"&&!l.instances[i]))if(Mr(u)){const d=(u.__vccOpts||u)[t];d&&a.push(qt(d,n,s,l,i,o))}else{let d=u();a.push(()=>d.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${i}" at "${l.path}"`);const p=hu(c)?c.default:c;l.mods[i]=c,l.components[i]=p;const f=(p.__vccOpts||p)[t];return f&&qt(f,n,s,l,i,o)()}))}}return a}function Qu(e,t){const n=[],s=[],o=[],a=Math.max(t.matched.length,e.matched.length);for(let l=0;l<a;l++){const i=t.matched[l];i&&(e.matched.find(d=>fn(d,i))?s.push(i):n.push(i));const u=e.matched[l];u&&(t.matched.find(d=>fn(d,u))||o.push(u))}return[n,s,o]}/*!
|
|
* vue-router v4.6.4
|
|
* (c) 2025 Eduardo San Martin Morote
|
|
* @license MIT
|
|
*/let Ju=()=>location.protocol+"//"+location.host;function Br(e,t){const{pathname:n,search:s,hash:o}=t,a=e.indexOf("#");if(a>-1){let l=o.includes(e.slice(a))?e.slice(a).length:1,i=o.slice(l);return i[0]!=="/"&&(i="/"+i),sa(i,"")}return sa(n,e)+s+o}function Yu(e,t,n,s){let o=[],a=[],l=null;const i=({state:f})=>{const _=Br(e,location),k=n.value,A=t.value;let I=0;if(f){if(n.value=_,t.value=f,l&&l===k){l=null;return}I=A?f.position-A.position:0}else s(_);o.forEach(y=>{y(n.value,k,{delta:I,type:Qs.pop,direction:I?I>0?Ms.forward:Ms.back:Ms.unknown})})};function u(){l=n.value}function d(f){o.push(f);const _=()=>{const k=o.indexOf(f);k>-1&&o.splice(k,1)};return a.push(_),_}function c(){if(document.visibilityState==="hidden"){const{history:f}=window;if(!f.state)return;f.replaceState(he({},f.state,{scroll:ys()}),"")}}function p(){for(const f of a)f();a=[],window.removeEventListener("popstate",i),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",i),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:u,listen:d,destroy:p}}function ia(e,t,n,s=!1,o=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:o?ys():null}}function Zu(e){const{history:t,location:n}=window,s={value:Br(e,n)},o={value:t.state};o.value||a(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function a(u,d,c){const p=e.indexOf("#"),f=p>-1?(n.host&&document.querySelector("base")?e:e.slice(p))+u:Ju()+e+u;try{t[c?"replaceState":"pushState"](d,"",f),o.value=d}catch(_){console.error(_),n[c?"replace":"assign"](f)}}function l(u,d){a(u,he({},t.state,ia(o.value.back,u,o.value.forward,!0),d,{position:o.value.position}),!0),s.value=u}function i(u,d){const c=he({},o.value,t.state,{forward:u,scroll:ys()});a(c.current,c,!0),a(u,he({},ia(s.value,u,null),{position:c.position+1},d),!1),s.value=u}return{location:s,state:o,push:i,replace:l}}function Xu(e){e=Nu(e);const t=Zu(e),n=Yu(e,t.state,t.location,t.replace);function s(a,l=!0){l||n.pauseListeners(),history.go(a)}const o=he({location:"",base:e,go:s,createHref:Vu.bind(null,e)},t,n);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>t.state.value}),o}let Qt=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Ie=(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})(Ie||{});const ec={type:Qt.Static,value:""},tc=/[a-zA-Z0-9_]/;function nc(e){if(!e)return[[]];if(e==="/")return[[ec]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(_){throw new Error(`ERR (${n})/"${d}": ${_}`)}let n=Ie.Static,s=n;const o=[];let a;function l(){a&&o.push(a),a=[]}let i=0,u,d="",c="";function p(){d&&(n===Ie.Static?a.push({type:Qt.Static,value:d}):n===Ie.Param||n===Ie.ParamRegExp||n===Ie.ParamRegExpEnd?(a.length>1&&(u==="*"||u==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),a.push({type:Qt.Param,value:d,regexp:c,repeatable:u==="*"||u==="+",optional:u==="*"||u==="?"})):t("Invalid state to consume buffer"),d="")}function f(){d+=u}for(;i<e.length;){if(u=e[i++],u==="\\"&&n!==Ie.ParamRegExp){s=n,n=Ie.EscapeNext;continue}switch(n){case Ie.Static:u==="/"?(d&&p(),l()):u===":"?(p(),n=Ie.Param):f();break;case Ie.EscapeNext:f(),n=s;break;case Ie.Param:u==="("?n=Ie.ParamRegExp:tc.test(u)?f():(p(),n=Ie.Static,u!=="*"&&u!=="?"&&u!=="+"&&i--);break;case Ie.ParamRegExp:u===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+u:n=Ie.ParamRegExpEnd:c+=u;break;case Ie.ParamRegExpEnd:p(),n=Ie.Static,u!=="*"&&u!=="?"&&u!=="+"&&i--,c="";break;default:t("Unknown state");break}}return n===Ie.ParamRegExp&&t(`Unfinished custom RegExp for param "${d}"`),p(),l(),o}const ua="[^/]+?",sc={sensitive:!1,strict:!1,start:!0,end:!0};var He=(function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e})(He||{});const oc=/[.+*?^${}()[\]/\\]/g;function ac(e,t){const n=he({},sc,t),s=[];let o=n.start?"^":"";const a=[];for(const d of e){const c=d.length?[]:[He.Root];n.strict&&!d.length&&(o+="/");for(let p=0;p<d.length;p++){const f=d[p];let _=He.Segment+(n.sensitive?He.BonusCaseSensitive:0);if(f.type===Qt.Static)p||(o+="/"),o+=f.value.replace(oc,"\\$&"),_+=He.Static;else if(f.type===Qt.Param){const{value:k,repeatable:A,optional:I,regexp:y}=f;a.push({name:k,repeatable:A,optional:I});const w=y||ua;if(w!==ua){_+=He.BonusCustomRegExp;try{`${w}`}catch(x){throw new Error(`Invalid custom RegExp for param "${k}" (${w}): `+x.message)}}let g=A?`((?:${w})(?:/(?:${w}))*)`:`(${w})`;p||(g=I&&d.length<2?`(?:/${g})`:"/"+g),I&&(g+="?"),o+=g,_+=He.Dynamic,I&&(_+=He.BonusOptional),A&&(_+=He.BonusRepeatable),w===".*"&&(_+=He.BonusWildcard)}c.push(_)}s.push(c)}if(n.strict&&n.end){const d=s.length-1;s[d][s[d].length-1]+=He.BonusStrict}n.strict||(o+="/?"),n.end?o+="$":n.strict&&!o.endsWith("/")&&(o+="(?:/|$)");const l=new RegExp(o,n.sensitive?"":"i");function i(d){const c=d.match(l),p={};if(!c)return null;for(let f=1;f<c.length;f++){const _=c[f]||"",k=a[f-1];p[k.name]=_&&k.repeatable?_.split("/"):_}return p}function u(d){let c="",p=!1;for(const f of e){(!p||!c.endsWith("/"))&&(c+="/"),p=!1;for(const _ of f)if(_.type===Qt.Static)c+=_.value;else if(_.type===Qt.Param){const{value:k,repeatable:A,optional:I}=_,y=k in d?d[k]:"";if(ft(y)&&!A)throw new Error(`Provided param "${k}" is an array but it is not repeatable (* or + modifiers)`);const w=ft(y)?y.join("/"):y;if(!w)if(I)f.length<2&&(c.endsWith("/")?c=c.slice(0,-1):p=!0);else throw new Error(`Missing required param "${k}"`);c+=w}}return c||"/"}return{re:l,score:s,keys:a,parse:i,stringify:u}}function rc(e,t){let n=0;for(;n<e.length&&n<t.length;){const s=t[n]-e[n];if(s)return s;n++}return e.length<t.length?e.length===1&&e[0]===He.Static+He.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===He.Static+He.Segment?1:-1:0}function Wr(e,t){let n=0;const s=e.score,o=t.score;for(;n<s.length&&n<o.length;){const a=rc(s[n],o[n]);if(a)return a;n++}if(Math.abs(o.length-s.length)===1){if(ca(s))return 1;if(ca(o))return-1}return o.length-s.length}function ca(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const lc={strict:!1,end:!0,sensitive:!1};function ic(e,t,n){const s=ac(nc(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 uc(e,t){const n=[],s=new Map;t=na(lc,t);function o(p){return s.get(p)}function a(p,f,_){const k=!_,A=fa(p);A.aliasOf=_&&_.record;const I=na(t,p),y=[A];if("alias"in p){const x=typeof p.alias=="string"?[p.alias]:p.alias;for(const $ of x)y.push(fa(he({},A,{components:_?_.record.components:A.components,path:$,aliasOf:_?_.record:A})))}let w,g;for(const x of y){const{path:$}=x;if(f&&$[0]!=="/"){const U=f.record.path,F=U[U.length-1]==="/"?"":"/";x.path=f.record.path+($&&F+$)}if(w=ic(x,f,I),_?_.alias.push(w):(g=g||w,g!==w&&g.alias.push(w),k&&p.name&&!pa(w)&&l(p.name)),Gr(w)&&u(w),A.children){const U=A.children;for(let F=0;F<U.length;F++)a(U[F],w,_&&_.children[F])}_=_||w}return g?()=>{l(g)}:In}function l(p){if(Fr(p)){const f=s.get(p);f&&(s.delete(p),n.splice(n.indexOf(f),1),f.children.forEach(l),f.alias.forEach(l))}else{const f=n.indexOf(p);f>-1&&(n.splice(f,1),p.record.name&&s.delete(p.record.name),p.children.forEach(l),p.alias.forEach(l))}}function i(){return n}function u(p){const f=fc(p,n);n.splice(f,0,p),p.record.name&&!pa(p)&&s.set(p.record.name,p)}function d(p,f){let _,k={},A,I;if("name"in p&&p.name){if(_=s.get(p.name),!_)throw pn(Ce.MATCHER_NOT_FOUND,{location:p});I=_.record.name,k=he(da(f.params,_.keys.filter(g=>!g.optional).concat(_.parent?_.parent.keys.filter(g=>g.optional):[]).map(g=>g.name)),p.params&&da(p.params,_.keys.map(g=>g.name))),A=_.stringify(k)}else if(p.path!=null)A=p.path,_=n.find(g=>g.re.test(A)),_&&(k=_.parse(A),I=_.record.name);else{if(_=f.name?s.get(f.name):n.find(g=>g.re.test(f.path)),!_)throw pn(Ce.MATCHER_NOT_FOUND,{location:p,currentLocation:f});I=_.record.name,k=he({},f.params,p.params),A=_.stringify(k)}const y=[];let w=_;for(;w;)y.unshift(w.record),w=w.parent;return{name:I,path:A,params:k,matched:y,meta:dc(y)}}e.forEach(p=>a(p));function c(){n.length=0,s.clear()}return{addRoute:a,resolve:d,removeRoute:l,clearRoutes:c,getRoutes:i,getRecordMatcher:o}}function da(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function fa(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:cc(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 cc(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 pa(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function dc(e){return e.reduce((t,n)=>he(t,n.meta),{})}function fc(e,t){let n=0,s=t.length;for(;n!==s;){const a=n+s>>1;Wr(e,t[a])<0?s=a:n=a+1}const o=pc(e);return o&&(s=t.lastIndexOf(o,s-1)),s}function pc(e){let t=e;for(;t=t.parent;)if(Gr(t)&&Wr(e,t)===0)return t}function Gr({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function ma(e){const t=lt(_s),n=lt(xo),s=le(()=>{const u=Re(e.to);return t.resolve(u)}),o=le(()=>{const{matched:u}=s.value,{length:d}=u,c=u[d-1],p=n.matched;if(!c||!p.length)return-1;const f=p.findIndex(fn.bind(null,c));if(f>-1)return f;const _=va(u[d-2]);return d>1&&va(c)===_&&p[p.length-1].path!==_?p.findIndex(fn.bind(null,u[d-2])):f}),a=le(()=>o.value>-1&&bc(n.params,s.value.params)),l=le(()=>o.value>-1&&o.value===n.matched.length-1&&qr(n.params,s.value.params));function i(u={}){if(gc(u)){const d=t[Re(e.replace)?"replace":"push"](Re(e.to)).catch(In);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:s,href:le(()=>s.value.href),isActive:a,isExactActive:l,navigate:i}}function mc(e){return e.length===1?e[0]:e}const vc=tr({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:ma,setup(e,{slots:t}){const n=fs(ma(e)),{options:s}=lt(_s),o=le(()=>({[ha(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[ha(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const a=t.default&&mc(t.default(n));return e.custom?a:Dr("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},a)}}}),hc=vc;function gc(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 bc(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(!ft(o)||o.length!==s.length||s.some((a,l)=>a.valueOf()!==o[l].valueOf()))return!1}return!0}function va(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const ha=(e,t,n)=>e??t??n,xc=tr({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=lt(Ys),o=le(()=>e.route||s.value),a=lt(la,0),l=le(()=>{let d=Re(a);const{matched:c}=o.value;let p;for(;(p=c[d])&&!p.components;)d++;return d}),i=le(()=>o.value.matched[l.value]);Kn(la,le(()=>l.value+1)),Kn(Ku,i),Kn(Ys,o);const u=j();return Ge(()=>[u.value,i.value,e.name],([d,c,p],[f,_,k])=>{c&&(c.instances[p]=d,_&&_!==c&&d&&d===f&&(c.leaveGuards.size||(c.leaveGuards=_.leaveGuards),c.updateGuards.size||(c.updateGuards=_.updateGuards))),d&&c&&(!_||!fn(c,_)||!f)&&(c.enterCallbacks[p]||[]).forEach(A=>A(d))},{flush:"post"}),()=>{const d=o.value,c=e.name,p=i.value,f=p&&p.components[c];if(!f)return ga(n.default,{Component:f,route:d});const _=p.props[c],k=_?_===!0?d.params:typeof _=="function"?_(d):_:null,I=Dr(f,he({},k,t,{onVnodeUnmounted:y=>{y.component.isUnmounted&&(p.instances[c]=null)},ref:u}));return ga(n.default,{Component:I,route:d})||I}}});function ga(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const yc=xc;function _c(e){const t=uc(e.routes,e),n=e.parseQuery||Gu,s=e.stringifyQuery||ra,o=e.history,a=xn(),l=xn(),i=xn(),u=Sl(Ut);let d=Ut;tn&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=Ts.bind(null,O=>""+O),p=Ts.bind(null,Iu),f=Ts.bind(null,jn);function _(O,G){let W,ee;return Fr(O)?(W=t.getRecordMatcher(O),ee=G):ee=O,t.addRoute(ee,W)}function k(O){const G=t.getRecordMatcher(O);G&&t.removeRoute(G)}function A(){return t.getRoutes().map(O=>O.record)}function I(O){return!!t.getRecordMatcher(O)}function y(O,G){if(G=he({},G||u.value),typeof O=="string"){const C=Os(n,O,G.path),T=t.resolve({path:C.path},G),M=o.createHref(C.fullPath);return he(C,T,{params:f(T.params),hash:jn(C.hash),redirectedFrom:void 0,href:M})}let W;if(O.path!=null)W=he({},O,{path:Os(n,O.path,G.path).path});else{const C=he({},O.params);for(const T in C)C[T]==null&&delete C[T];W=he({},O,{params:p(C)}),G.params=p(G.params)}const ee=t.resolve(W,G),ue=O.hash||"";ee.params=c(f(ee.params));const m=Du(s,he({},O,{hash:Au(ue),path:ee.path})),h=o.createHref(m);return he({fullPath:m,hash:ue,query:s===ra?zu(O.query):O.query||{}},ee,{redirectedFrom:void 0,href:h})}function w(O){return typeof O=="string"?Os(n,O,u.value.path):he({},O)}function g(O,G){if(d!==O)return pn(Ce.NAVIGATION_CANCELLED,{from:G,to:O})}function x(O){return F(O)}function $(O){return x(he(w(O),{replace:!0}))}function U(O,G){const W=O.matched[O.matched.length-1];if(W&&W.redirect){const{redirect:ee}=W;let ue=typeof ee=="function"?ee(O,G):ee;return typeof ue=="string"&&(ue=ue.includes("?")||ue.includes("#")?ue=w(ue):{path:ue},ue.params={}),he({query:O.query,hash:O.hash,params:ue.path!=null?{}:O.params},ue)}}function F(O,G){const W=d=y(O),ee=u.value,ue=O.state,m=O.force,h=O.replace===!0,C=U(W,ee);if(C)return F(he(w(C),{state:typeof C=="object"?he({},ue,C.state):ue,force:m,replace:h}),G||W);const T=W;T.redirectedFrom=G;let M;return!m&&Tu(s,ee,W)&&(M=pn(Ce.NAVIGATION_DUPLICATED,{to:T,from:ee}),nt(ee,ee,!0,!1)),(M?Promise.resolve(M):te(T,ee)).catch(D=>At(D)?At(D,Ce.NAVIGATION_GUARD_REDIRECT)?D:Ke(D):pe(D,T,ee)).then(D=>{if(D){if(At(D,Ce.NAVIGATION_GUARD_REDIRECT))return F(he({replace:h},w(D.to),{state:typeof D.to=="object"?he({},ue,D.to.state):ue,force:m}),G||T)}else D=Pe(T,ee,!0,h,ue);return B(T,ee,D),D})}function H(O,G){const W=g(O,G);return W?Promise.reject(W):Promise.resolve()}function me(O){const G=Ze.values().next().value;return G&&typeof G.runWithContext=="function"?G.runWithContext(O):O()}function te(O,G){let W;const[ee,ue,m]=Qu(O,G);W=Ns(ee.reverse(),"beforeRouteLeave",O,G);for(const C of ee)C.leaveGuards.forEach(T=>{W.push(qt(T,O,G))});const h=H.bind(null,O,G);return W.push(h),Qe(W).then(()=>{W=[];for(const C of a.list())W.push(qt(C,O,G));return W.push(h),Qe(W)}).then(()=>{W=Ns(ue,"beforeRouteUpdate",O,G);for(const C of ue)C.updateGuards.forEach(T=>{W.push(qt(T,O,G))});return W.push(h),Qe(W)}).then(()=>{W=[];for(const C of m)if(C.beforeEnter)if(ft(C.beforeEnter))for(const T of C.beforeEnter)W.push(qt(T,O,G));else W.push(qt(C.beforeEnter,O,G));return W.push(h),Qe(W)}).then(()=>(O.matched.forEach(C=>C.enterCallbacks={}),W=Ns(m,"beforeRouteEnter",O,G,me),W.push(h),Qe(W))).then(()=>{W=[];for(const C of l.list())W.push(qt(C,O,G));return W.push(h),Qe(W)}).catch(C=>At(C,Ce.NAVIGATION_CANCELLED)?C:Promise.reject(C))}function B(O,G,W){i.list().forEach(ee=>me(()=>ee(O,G,W)))}function Pe(O,G,W,ee,ue){const m=g(O,G);if(m)return m;const h=G===Ut,C=tn?history.state:{};W&&(ee||h?o.replace(O.fullPath,he({scroll:h&&C&&C.scroll},ue)):o.push(O.fullPath,ue)),u.value=O,nt(O,G,W,h),Ke()}let J;function ze(){J||(J=o.listen((O,G,W)=>{if(!pt.listening)return;const ee=y(O),ue=U(ee,pt.currentRoute.value);if(ue){F(he(ue,{replace:!0,force:!0}),ee).catch(In);return}d=ee;const m=u.value;tn&&qu(aa(m.fullPath,W.delta),ys()),te(ee,m).catch(h=>At(h,Ce.NAVIGATION_ABORTED|Ce.NAVIGATION_CANCELLED)?h:At(h,Ce.NAVIGATION_GUARD_REDIRECT)?(F(he(w(h.to),{force:!0}),ee).then(C=>{At(C,Ce.NAVIGATION_ABORTED|Ce.NAVIGATION_DUPLICATED)&&!W.delta&&W.type===Qs.pop&&o.go(-1,!1)}).catch(In),Promise.reject()):(W.delta&&o.go(-W.delta,!1),pe(h,ee,m))).then(h=>{h=h||Pe(ee,m,!1),h&&(W.delta&&!At(h,Ce.NAVIGATION_CANCELLED)?o.go(-W.delta,!1):W.type===Qs.pop&&At(h,Ce.NAVIGATION_ABORTED|Ce.NAVIGATION_DUPLICATED)&&o.go(-1,!1)),B(ee,m,h)}).catch(In)}))}let Vt=xn(),Se=xn(),ve;function pe(O,G,W){Ke(O);const ee=Se.list();return ee.length?ee.forEach(ue=>ue(O,G,W)):console.error(O),Promise.reject(O)}function at(){return ve&&u.value!==Ut?Promise.resolve():new Promise((O,G)=>{Vt.add([O,G])})}function Ke(O){return ve||(ve=!O,ze(),Vt.list().forEach(([G,W])=>O?W(O):G()),Vt.reset()),O}function nt(O,G,W,ee){const{scrollBehavior:ue}=e;if(!tn||!ue)return Promise.resolve();const m=!W&&Fu(aa(O.fullPath,0))||(ee||!W)&&history.state&&history.state.scroll||null;return uo().then(()=>ue(O,G,m)).then(h=>h&&Lu(h)).catch(h=>pe(h,O,G))}const De=O=>o.go(O);let $t;const Ze=new Set,pt={currentRoute:u,listening:!0,addRoute:_,removeRoute:k,clearRoutes:t.clearRoutes,hasRoute:I,getRoutes:A,resolve:y,options:e,push:x,replace:$,go:De,back:()=>De(-1),forward:()=>De(1),beforeEach:a.add,beforeResolve:l.add,afterEach:i.add,onError:Se.add,isReady:at,install(O){O.component("RouterLink",hc),O.component("RouterView",yc),O.config.globalProperties.$router=pt,Object.defineProperty(O.config.globalProperties,"$route",{enumerable:!0,get:()=>Re(u)}),tn&&!$t&&u.value===Ut&&($t=!0,x(o.location).catch(ee=>{}));const G={};for(const ee in Ut)Object.defineProperty(G,ee,{get:()=>u.value[ee],enumerable:!0});O.provide(_s,pt),O.provide(xo,Ba(G)),O.provide(Ys,u);const W=O.unmount;Ze.add(O),O.unmount=function(){Ze.delete(O),Ze.size<1&&(d=Ut,J&&J(),J=null,u.value=Ut,$t=!1,ve=!1),W()}}};function Qe(O){return O.reduce((G,W)=>G.then(()=>me(W)),Promise.resolve())}return pt}function yo(){return lt(_s)}function zr(e){return lt(xo)}const Gn=window.location.pathname.startsWith("/portal/"),Ye={esPortal:Gn,baseRuta:Gn?"/portal/studio/":"/studio/",apiBase:Gn?"/portal":"/app",urlLogin:Gn?"/portal/login":"/login"};function K(e){return Ye.apiBase+e}async function yn(e,t={}){const n=t.body instanceof FormData,s=await fetch(e,{...t,headers:n?t.headers:{"Content-Type":"application/json",...t.headers}}),o=s.headers.get("content-type")||"";if(s.redirected||!o.includes("application/json"))throw window.location.href=Ye.urlLogin,new Error("Sesión expirada");const a=await s.json();if(!s.ok){const l=typeof(a==null?void 0:a.error)=="string"?a.error:a==null?void 0:a.message;throw new Error(l||"Error de servidor")}return a}const Q={get:e=>yn(e),postForm:(e,t)=>yn(e,{method:"POST",body:t,headers:{}}),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"})},kn=j(!1),wc={class:"h-14 px-4 flex items-center gap-2 border-b border-borde"},kc={key:0,class:"px-3 pt-3"},$c={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"},Ac={key:0,class:"px-2 text-xs text-tenue"},Sc={key:1,class:"px-2 text-xs text-tenue"},Ec={class:"truncate"},Ic={class:"flex items-center gap-1 mt-0.5"},Rc={class:"text-[11px] text-tenue"},Pc={key:0,class:"flex opacity-0 group-hover:opacity-100 transition-opacity pr-1.5 gap-0.5"},Dc=["onClick"],Tc=["onClick"],Oc={class:"card w-full max-w-lg p-6 animate-escalar shadow-2xl"},Mc={class:"font-semibold text-texto mb-4"},Nc={key:0,class:"grid grid-cols-2 gap-3"},jc=["value"],Vc={class:"text-[11px] text-tenue mt-1"},Uc=["value"],Lc={class:"text-[11px] text-tenue mt-1"},qc={class:"flex items-center gap-2 text-sm text-texto"},Fc={class:"flex justify-end gap-2 pt-2"},Hc={__name:"Sidebar",setup(e,{expose:t}){const n=zr(),s=yo(),o=j([]),a=j([]),l=j([]),i=j(!0),u=j(""),d=j(!1),c=j(null),p=j(_()),f=le(()=>n.params.tenantId||n.params.id);Ge(()=>n.fullPath,()=>{kn.value=!1});function _(){return{nombre:"",dominios_permitidos:"",activo:!0,cliente_id:null,plan_id:null}}async function k(){i.value=!0,u.value="";try{const $=await Q.get(K("/umind/tenants"));o.value=$.items||[]}catch($){u.value=$.message}finally{i.value=!1}}function A($){return Array.isArray($)?$:($==null?void 0:$.items)||($==null?void 0:$.registros)||[]}async function I(){if(Ye.esPortal)return;const[$,U]=await Promise.allSettled([Q.get("/app/api/clientes/select"),Q.get("/app/umind-planes/list")]);a.value=$.status==="fulfilled"?A($.value):[],l.value=U.status==="fulfilled"?A(U.value):[];const F=[];$.status==="rejected"&&F.push("clientes"),U.status==="rejected"&&F.push("planes"),F.length&&(u.value=`No se pudo cargar la lista de ${F.join(" ni ")}.`)}function y(){c.value=null,p.value=_(),d.value=!0}function w($){c.value=$,p.value={nombre:$.nombre,dominios_permitidos:$.dominios_permitidos,activo:$.activo,cliente_id:$.cliente_id??null,plan_id:$.plan_id??null},d.value=!0}async function g(){const $={...p.value,dominios_permitidos:p.value.dominios_permitidos.split(",").map(U=>U.trim()).filter(Boolean)};try{if(c.value)await Q.put(K(`/umind/tenants/${c.value.ID}`),$),d.value=!1,await k();else{const U=await Q.post(K("/umind/tenants"),$);d.value=!1,await k(),s.push(`/tenants/${U.id}`)}}catch(U){u.value=U.message}}async function x($){confirm(`¿Eliminar el espacio "${$.nombre}"? Esto borra también sus agentes. No se puede deshacer.`)&&(await Q.del(K(`/umind/tenants/${$.ID}`)),f.value===String($.ID)&&s.push("/"),await k())}return t({recargar:k}),hs(()=>{k(),I()}),($,U)=>{const F=Wt("router-link");return v(),b(Z,null,[Re(kn)?(v(),b("div",{key:0,class:"fixed inset-0 bg-black/50 z-30 md:hidden",onClick:U[0]||(U[0]=H=>kn.value=!1)})):V("",!0),r("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",Re(kn)?"translate-x-0":"-translate-x-full"])},[r("div",wc,[ne(F,{to:"/",class:"flex items-center gap-2 text-base font-semibold text-texto"},{default:dt(()=>[...U[8]||(U[8]=[r("svg",{viewBox:"0 0 96 96",class:"w-6 h-6 shrink-0","aria-hidden":"true"},[r("rect",{width:"96",height:"96",rx:"22",fill:"#8eb02f"}),r("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"}),r("path",{d:"M60,58 V64",fill:"none",stroke:"#fff","stroke-width":"10","stroke-linecap":"round"}),r("circle",{cx:"60",cy:"28",r:"7",fill:"#fff"})],-1),r("span",null,[Y("uMind "),r("span",{class:"text-brand"},"Studio")],-1)])]),_:1})]),Re(Ye).esPortal?V("",!0):(v(),b("div",kc,[r("button",{class:"btn-primary w-full",onClick:y}," + Nuevo espacio ")])),u.value?(v(),b("p",$c,S(u.value),1)):V("",!0),r("nav",Cc,[i.value?(v(),b("p",Ac,"Cargando...")):o.value.length===0?(v(),b("p",Sc,S(Re(Ye).esPortal?"Todavía no tenés ningún espacio asignado. Escribinos y lo activamos.":"Sin espacios todavía."),1)):V("",!0),(v(!0),b(Z,null,ce(o.value,H=>(v(),b("div",{key:H.ID,class:ie(["group flex items-center rounded-lg transition-colors",f.value===String(H.ID)?"bg-brand/10":"hover:bg-elevado"])},[ne(F,{to:`/tenants/${H.ID}`,class:ie(["flex-1 min-w-0 px-2.5 py-2 text-sm",f.value===String(H.ID)?"text-brand font-medium":"text-texto"])},{default:dt(()=>[r("div",Ec,S(H.nombre),1),r("div",Ic,[r("span",{class:ie(["w-1.5 h-1.5 rounded-full",H.activo?"bg-green-500":"bg-tenue/40"])},null,2),r("span",Rc,S(H.activo?"activo":"inactivo"),1)])]),_:2},1032,["to","class"]),Re(Ye).esPortal?V("",!0):(v(),b("div",Pc,[r("button",{class:"p-1 text-tenue hover:text-texto",title:"Editar",onClick:me=>w(H)},[ne(Ne,{nombre:"lapiz",tam:14})],8,Dc),r("button",{class:"p-1 text-tenue hover:text-red-600",title:"Eliminar",onClick:me=>x(H)},[ne(Ne,{nombre:"cerrar",tam:14})],8,Tc)]))],2))),128))])],2),d.value?(v(),b("div",{key:1,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:U[7]||(U[7]=Ae(H=>d.value=!1,["self"]))},[r("div",Oc,[r("h2",Mc,S(c.value?"Editar espacio":"Nuevo espacio"),1),U[17]||(U[17]=r("p",{class:"text-xs text-tenue mb-3"}," Un espacio es el negocio o sitio dueño de los dominios permitidos. La config de IA, tono y demás se configuran por agente, dentro del tenant. ",-1)),r("form",{class:"space-y-3",onSubmit:Ae(g,["prevent"])},[r("div",null,[U[9]||(U[9]=r("label",{class:"label"},"Nombre",-1)),z(r("input",{"onUpdate:modelValue":U[1]||(U[1]=H=>p.value.nombre=H),required:"",class:"input"},null,512),[[re,p.value.nombre]])]),r("div",null,[U[10]||(U[10]=r("label",{class:"label"},"Dominios permitidos (separados por coma)",-1)),z(r("input",{"onUpdate:modelValue":U[2]||(U[2]=H=>p.value.dominios_permitidos=H),placeholder:"ejemplo.com, www.ejemplo.com",required:"",class:"input"},null,512),[[re,p.value.dominios_permitidos]])]),Re(Ye).esPortal?V("",!0):(v(),b("div",Nc,[r("div",null,[U[12]||(U[12]=r("label",{class:"label"},"Cliente",-1)),z(r("select",{"onUpdate:modelValue":U[3]||(U[3]=H=>p.value.cliente_id=H),class:"input"},[U[11]||(U[11]=r("option",{value:null},"— sin asignar —",-1)),(v(!0),b(Z,null,ce(a.value,H=>(v(),b("option",{key:H.ID,value:H.ID},S(H.nombre),9,jc))),128))],512),[[Nt,p.value.cliente_id]]),r("p",Vc,S(a.value.length?"Define quién ve este espacio desde el portal.":"No hay clientes activos — creá uno en Clientes."),1)]),r("div",null,[U[14]||(U[14]=r("label",{class:"label"},"Plan",-1)),z(r("select",{"onUpdate:modelValue":U[4]||(U[4]=H=>p.value.plan_id=H),class:"input"},[U[13]||(U[13]=r("option",{value:null},"— sin plan —",-1)),(v(!0),b(Z,null,ce(l.value,H=>(v(),b("option",{key:H.ID,value:H.ID},S(H.nombre)+" ("+S(H.max_agentes===0?"∞":H.max_agentes)+" agentes) ",9,Uc))),128))],512),[[Nt,p.value.plan_id]]),r("p",Lc,S(l.value.length?"Límite de agentes y precios de consumo.":"No hay planes — creá uno en uMind Planes."),1)])])),r("label",qc,[z(r("input",{"onUpdate:modelValue":U[5]||(U[5]=H=>p.value.activo=H),type:"checkbox"},null,512),[[st,p.value.activo]]),U[15]||(U[15]=Y(" Activo ",-1))]),r("div",Fc,[r("button",{type:"button",class:"btn-ghost",onClick:U[6]||(U[6]=H=>d.value=!1)}," Cancelar "),U[16]||(U[16]=r("button",{type:"submit",class:"btn-primary"}," Guardar ",-1))])],32)])])):V("",!0)],64)}}},Kr="umind-tema";function Bc(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"oscuro":"claro"}const ln=j(localStorage.getItem(Kr)||Bc());function Qr(){document.documentElement.classList.toggle("dark",ln.value==="oscuro")}function ba(){ln.value=ln.value==="oscuro"?"claro":"oscuro",localStorage.setItem(Kr,ln.value),Qr()}Qr();const xa="umind_despertar_visto",ya=1250,Wc={__name:"DespertarUmind",setup(e){const t=j(null),n=j(!1);let s=null,o=null;function a(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}return hs(()=>{a()||sessionStorage.getItem(xa)||(sessionStorage.setItem(xa,"1"),n.value=!0,o=setTimeout(()=>n.value=!1,ya),requestAnimationFrame(()=>{const l=t.value;if(!l)return;const i=l.getContext("2d"),u=Math.min(window.devicePixelRatio||1,2),d=window.innerWidth,c=window.innerHeight;l.width=Math.round(d*u),l.height=Math.round(c*u),i.setTransform(u,0,0,u,0,0);const p=d<640?22:46,f=Array.from({length:p},()=>({x:Math.random()*d,y:Math.random()*c,r:1+Math.random()*1.6,demora:Math.random()*.45})),_=performance.now(),k=A=>{const I=Math.min(1,(A-_)/ya);i.clearRect(0,0,d,c);const y=I<.75?1:1-(I-.75)/.25;for(let w=0;w<f.length;w++){const g=f[w],x=Math.max(0,Math.min(1,(I-g.demora)/.4));if(!(x<=0)){for(let $=w+1;$<f.length;$++){const U=f[$],F=g.x-U.x,H=g.y-U.y,me=Math.sqrt(F*F+H*H);me>170||(i.strokeStyle=`rgba(142, 176, 47, ${.16*(1-me/170)*x*y})`,i.lineWidth=1,i.beginPath(),i.moveTo(g.x,g.y),i.lineTo(U.x,U.y),i.stroke())}i.beginPath(),i.arc(g.x,g.y,g.r*x,0,Math.PI*2),i.fillStyle=`rgba(142, 176, 47, ${.5*x*y})`,i.fill()}}I<1&&(s=requestAnimationFrame(k))};s=requestAnimationFrame(k)}))}),or(()=>{s&&cancelAnimationFrame(s),o&&clearTimeout(o)}),(l,i)=>n.value?(v(),b("canvas",{key:0,ref_key:"lienzo",ref:t,class:"fixed inset-0 w-full h-full pointer-events-none z-50","aria-hidden":"true"},null,512)):V("",!0)}},Gc={class:"min-h-screen flex"},zc={class:"flex-1 min-w-0 flex flex-col"},Kc={class:"h-14 shrink-0 flex items-center gap-1 px-4 sm:px-6 border-b border-borde"},Qc=["title"],Jc={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"},Yc={__name:"App",setup(e){return(t,n)=>{const s=Wt("router-view");return v(),b("div",Gc,[ne(Wc),ne(Hc),r("main",zc,[r("header",Kc,[r("button",{class:"btn-ghost !px-2 !py-1.5 md:hidden","aria-label":"Abrir menú",onClick:n[0]||(n[0]=o=>kn.value=!0)},[...n[2]||(n[2]=[r("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 6h16M4 12h16M4 18h16"})],-1)])]),n[3]||(n[3]=r("span",{class:"flex-1"},null,-1)),r("button",{class:"btn-ghost !px-2.5 !py-1.5",title:Re(ln)==="oscuro"?"Cambiar a claro":"Cambiar a oscuro",onClick:n[1]||(n[1]=(...o)=>Re(ba)&&Re(ba)(...o))},[ne(Ne,{nombre:Re(ln)==="oscuro"?"sol":"luna",tam:17},null,8,["nombre"])],8,Qc)]),r("div",Jc,[ne(s)])])])}}},Zc=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Xc=["width","height","aria-label"],ed=["fill"],td=["stroke"],nd=["cy"],sd=["cy"],od=["cy"],ad=["cy"],rd={key:1,d:"M41,66 h12 M67,66 h12",class:"umi-linea","stroke-width":"5","stroke-linecap":"round",fill:"none"},ld={key:4,d:"M50,78 q10,8 20,0",class:"umi-linea","stroke-width":"4",fill:"none","stroke-linecap":"round"},id={__name:"UiMascota",props:{estado:{type:String,default:"normal"},tam:{type:[Number,String],default:72}},setup(e){return(t,n)=>(v(),b("svg",{width:e.tam,height:e.tam,viewBox:"0 0 120 120",class:"shrink-0",role:"img","aria-label":`Umi, la mascota de uMind (${e.estado})`},[r("circle",{cx:"60",cy:"26",r:"6",fill:e.estado==="alerta"?"#dc2626":"currentColor",class:ie(e.estado==="pensando"?"umi-late":"")},null,10,ed),r("line",{x1:"60",y1:"32",x2:"60",y2:"44",stroke:e.estado==="alerta"?"#dc2626":"currentColor","stroke-width":"4","stroke-linecap":"round"},null,8,td),n[7]||(n[7]=r("path",{d:"M30,46 V76 A30,30 0 0 0 90,76 V46 Z",fill:"currentColor"},null,-1)),e.estado==="normal"||e.estado==="contenta"||e.estado==="alerta"?(v(),b(Z,{key:0},[r("circle",{cx:"47",cy:e.estado==="contenta"?64:66,r:"6",class:"umi-ojo"},null,8,nd),r("circle",{cx:"73",cy:e.estado==="contenta"?64:66,r:"6",class:"umi-ojo"},null,8,sd),r("circle",{cx:"48",cy:e.estado==="contenta"?65:67,r:"3",class:"umi-pupila"},null,8,od),r("circle",{cx:"74",cy:e.estado==="contenta"?65:67,r:"3",class:"umi-pupila"},null,8,ad)],64)):e.estado==="durmiendo"?(v(),b("path",rd)):e.estado==="pensando"?(v(),b(Z,{key:2},[n[0]||(n[0]=r("circle",{cx:"45",cy:"66",r:"4.5",class:"umi-ojo umi-p1"},null,-1)),n[1]||(n[1]=r("circle",{cx:"60",cy:"66",r:"4.5",class:"umi-ojo umi-p2"},null,-1)),n[2]||(n[2]=r("circle",{cx:"75",cy:"66",r:"4.5",class:"umi-ojo umi-p3"},null,-1))],64)):e.estado==="buscando"?(v(),b(Z,{key:3},[n[3]||(n[3]=r("circle",{cx:"47",cy:"66",r:"6",class:"umi-ojo"},null,-1)),n[4]||(n[4]=r("circle",{cx:"73",cy:"66",r:"6",class:"umi-ojo"},null,-1)),n[5]||(n[5]=r("circle",{cx:"50",cy:"66",r:"3",class:"umi-pupila"},null,-1)),n[6]||(n[6]=r("circle",{cx:"76",cy:"66",r:"3",class:"umi-pupila"},null,-1))],64)):V("",!0),e.estado==="contenta"?(v(),b("path",ld)):V("",!0)],8,Xc))}},Vn=Zc(id,[["__scopeId","data-v-551897a0"]]),ud={key:0,class:"flex flex-col items-center justify-center py-24 text-sm text-tenue"},cd={key:1,class:"max-w-md mx-auto text-center py-20"},dd={key:2,class:"flex flex-col items-center justify-center text-center py-24"},fd={class:"text-lg font-medium text-texto"},pd={class:"text-sm text-tenue mt-1"},md={__name:"Home",setup(e){const t=yo(),n=j(Ye.esPortal),s=j(!1);async function o(){if(Ye.esPortal)try{const l=(await Q.get(K("/umind/tenants"))).items||[];if(l.length===0){s.value=!0;return}if(l.length!==1)return;const i=l[0].ID,d=(await Q.get(K(`/umind/agentes?tenant_id=${i}`))).items||[];if(d.length===1){t.replace(`/tenants/${i}/agentes/${d[0].ID}`);return}t.replace(`/tenants/${i}`)}catch{}finally{n.value=!1}}return hs(o),(a,l)=>n.value?(v(),b("div",ud," Abriendo tu asistente… ")):s.value?(v(),b("div",cd,[ne(Vn,{estado:"durmiendo",tam:80,class:"mx-auto mb-4 text-brand"}),l[0]||(l[0]=go('<h1 class="text-lg font-medium text-texto">Todavía no tenés un asistente activo</h1><p class="text-sm text-tenue mt-2"> 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. </p><a class="btn-primary inline-block mt-5" href="mailto:soporte@u-site.app?subject=Quiero%20activar%20uMind">Quiero activarlo</a><p class="text-xs text-tenue mt-4"><a href="/portal/dashboard" class="underline">Volver al portal</a></p>',4))])):(v(),b("div",dd,[ne(Vn,{estado:"normal",tam:64,class:"mx-auto mb-4 text-brand"}),r("h1",fd,S(Re(Ye).esPortal?"Elegí tu espacio de la izquierda":"Elegí un espacio de la izquierda"),1),r("p",pd,S(Re(Ye).esPortal?"Adentro vas a poder crear y configurar tus agentes.":"o creá uno nuevo para empezar a configurar su agente."),1)]))}},vd={class:"flex flex-col items-center justify-center text-center py-12 px-6"},hd={key:0,class:"text-3xl mb-3 opacity-70"},gd={class:"text-sm font-medium text-texto"},bd={key:2,class:"text-xs text-tenue mt-1.5 max-w-sm leading-relaxed"},xd={key:3,class:"mt-4"},qe={__name:"UiEmptyState",props:{estado:{type:String,default:"durmiendo"},titulo:String,detalle:String,icono:{type:String,default:""}},setup(e){return(t,n)=>(v(),b("div",vd,[e.icono?(v(),b("div",hd,S(e.icono),1)):(v(),de(Vn,{key:1,estado:e.estado,tam:64,class:"mb-3 text-brand"},null,8,["estado"])),r("p",gd,S(e.titulo),1),e.detalle?(v(),b("p",bd,S(e.detalle),1)):V("",!0),t.$slots.default?(v(),b("div",xd,[Xl(t.$slots,"default")])):V("",!0)]))}},yd={class:"flex gap-1 flex-wrap mb-6 border-b border-borde pb-2"},_d={key:0,class:"px-1.5 py-0.5 rounded-full bg-amber-500 text-white text-[10px] font-semibold leading-none"},vn={__name:"NavEspacio",props:{tenantId:{type:[String,Number],required:!0}},setup(e){const t=e,n=j(0);async function s(){try{const a=await Q.get(K(`/umind/acciones?tenant_id=${t.tenantId}`));n.value=a.pendientes||0}catch{n.value=0}}Ge(()=>t.tenantId,s,{immediate:!0});const o=[["tenant-agentes","","Agentes"],["pendientes","/pendientes","Pendientes"],["archivos","/archivos","Archivos"],["plantillas","/plantillas","Plantillas"],["uso","/uso","Consumo"],["ai-propia","/ia","Tu IA"]];return(a,l)=>{const i=Wt("router-link");return v(),b("nav",yd,[(v(),b(Z,null,ce(o,([u,d,c])=>ne(i,{key:u,to:`/tenants/${e.tenantId}${d}`,class:ie(["px-3 py-1.5 rounded-lg text-sm transition-colors inline-flex items-center gap-1.5",a.$route.name===u?"bg-brand/10 text-brand font-medium":"text-tenue hover:text-texto hover:bg-elevado"])},{default:dt(()=>[Y(S(c)+" ",1),u==="pendientes"&&n.value>0?(v(),b("span",_d,S(n.value),1)):V("",!0)]),_:2},1032,["to","class"])),64))])}}},wd={key:0,class:"mb-4"},kd={class:"flex items-start justify-between gap-4"},$d={class:"text-xl font-semibold text-texto"},Cd={class:"text-xs text-tenue mt-1"},Ad={key:1,class:"text-sm text-red-600 dark:text-red-400 mb-4"},Sd={class:"flex items-center justify-between mb-4"},Ed={class:"flex items-center gap-2"},Id={key:0,class:"badge-alerta"},Rd={key:1,class:"badge-neutro"},Pd=["disabled"],Dd={key:2,class:"text-xs text-tenue -mt-2 mb-4"},Td={key:3,class:"text-xs text-tenue -mt-2 mb-4"},Od={key:4,class:"grid gap-3 sm:grid-cols-2"},Md=["disabled"],Nd={key:6,class:"grid gap-3 sm:grid-cols-2"},jd={class:"flex items-start gap-3"},Vd={class:"min-w-0 flex-1"},Ud={class:"flex items-center gap-2"},Ld={class:"font-medium text-texto truncate"},qd={class:"text-xs text-tenue mt-0.5 truncate"},Fd={class:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0"},Hd=["onClick"],Bd=["onClick"],Wd=["onClick"],Gd={class:"flex items-center gap-4 mt-3.5 pt-3 border-t border-borde text-xs text-tenue"},zd={class:"tabular-nums"},Kd={class:"text-texto font-medium"},Qd={class:"tabular-nums"},Jd={class:"text-texto font-medium"},Yd={class:"tabular-nums"},Zd={class:"text-texto font-medium"},Xd={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"},ef={class:"font-semibold text-gray-800 dark:text-gray-100 mb-4"},tf={key:0},nf={class:"grid gap-1.5"},sf=["value"],of={class:"min-w-0"},af={class:"block text-sm text-texto"},rf={class:"block text-xs text-tenue"},lf={key:0,class:"block text-xs text-tenue mt-0.5"},uf=["value"],cf={class:"flex items-center gap-2"},df={class:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-300"},ff={class:"flex justify-end gap-2 pt-2"},pf={type:"submit",class:"bg-brand hover:bg-brand-dark text-white text-sm font-medium px-4 py-2 rounded-lg"},mf={__name:"TenantAgentes",props:{id:{type:String,required:!0}},setup(e){const t=e,n=le(()=>Number(t.id)),s=yo(),o=j(null),a=j([]),l=j([]),i=j(""),u=j(!1),d=j(null),c=j(w()),p=j(null),f=j({}),_=j(!0);function k(te){const B=f.value[te.ID]||{};return te.activo?B.documentos>0?{tipo:"ok",texto:"listo"}:{tipo:"alerta",texto:"sin conocimiento"}:{tipo:"neutro",texto:"inactivo"}}function A(te){const B=f.value[te.ID]||{};return{documentos:B.documentos||0,canales:B.canales||0,conversaciones:B.conversaciones_7d||0}}function I(te){return String(te||"?").trim().split(/\s+/).slice(0,2).map(B=>B[0]).join("").toUpperCase()}const y=le(()=>{if(!p.value)return{sinPlan:!0};const te=p.value.max_agentes||0;return{sinPlan:!1,nombre:p.value.nombre,ilimitado:te<=0,max:te,usados:a.value.length,lleno:te>0&&a.value.length>=te}});function w(){return{nombre:"",ai_config_id:null,tono:"",mensaje_bienvenida:"",color:"#8eb02f",activo:!0,plantilla_rubro:""}}const g=j([]);async function x(){i.value="",_.value=!0;try{const[te,B,Pe,J]=await Promise.all([Q.get(K("/umind/tenants")),Q.get(K(`/umind/agentes?tenant_id=${t.id}`)),Q.get(K("/umind/ai-configs")),Q.get(K("/umind/plantillas-rubro"))]);o.value=(te.items||[]).find(ze=>String(ze.ID)===t.id)||null,a.value=B.items||[],p.value=B.plan||null,f.value=B.resumen||{},l.value=Pe.items||[],g.value=J.items||[]}catch(te){i.value=te.message}finally{_.value=!1}}async function $(te){const B=prompt(`Nombre de la copia de "${te.nombre}":`,`${te.nombre} (copia)`);if(B!==null){i.value="";try{const Pe=await Q.post(K(`/umind/agentes/${te.ID}/duplicar`),{tenant_id:Number(n.value),nombre:B.trim()});await x(),Pe.aviso&&alert(Pe.aviso)}catch(Pe){i.value=Pe.message}}}function U(){d.value=null,c.value=w(),u.value=!0}function F(te){d.value=te,c.value={nombre:te.nombre,ai_config_id:te.ai_config_id,tono:te.tono,mensaje_bienvenida:te.mensaje_bienvenida,color:te.color||"#8eb02f",activo:te.activo},u.value=!0}async function H(){try{if(d.value)await Q.put(K(`/umind/agentes/${d.value.ID}`),{tenant_id:n.value,...c.value}),u.value=!1,await x();else{const te=await Q.post(K("/umind/agentes"),{tenant_id:n.value,...c.value});u.value=!1,s.push(`/tenants/${n.value}/agentes/${te.id}`)}}catch(te){i.value=te.message}}async function me(te){confirm(`¿Eliminar el agente "${te.nombre}"? Esto no se puede deshacer.`)&&(await Q.del(K(`/umind/agentes/${te.ID}`)),await x())}return Ge(()=>t.id,x,{immediate:!0}),(te,B)=>{const Pe=Wt("router-link");return v(),b("div",null,[o.value?(v(),b("div",wd,[r("div",kd,[r("div",null,[r("h1",$d,S(o.value.nombre),1),r("p",Cd,S(o.value.dominios_permitidos||"sin dominios configurados"),1)])])])):V("",!0),ne(vn,{"tenant-id":n.value??e.id},null,8,["tenant-id"]),i.value?(v(),b("p",Ad,S(i.value),1)):V("",!0),r("div",Sd,[r("div",Ed,[B[10]||(B[10]=r("h2",{class:"text-sm font-medium text-tenue"},"Agentes",-1)),y.value.sinPlan?(v(),b("span",Id,"sin plan · sin límite")):y.value.ilimitado?(v(),b("span",Rd,S(y.value.nombre)+" · ilimitado",1)):(v(),b("span",{key:2,class:ie(y.value.lleno?"badge-alerta":"badge-neutro")},S(y.value.nombre)+" · "+S(y.value.usados)+" de "+S(y.value.max),3))]),r("button",{class:"btn-primary",disabled:y.value.lleno,onClick:U},"+ Nuevo agente",8,Pd)]),y.value.sinPlan&&!Re(Ye).esPortal?(v(),b("p",Dd," Este espacio no tiene plan asignado, así que no se le aplica ningún límite de agentes. Asignale uno desde el lápiz del espacio, en la barra izquierda. ")):y.value.lleno?(v(),b("p",Td," Alcanzaste el máximo de agentes de tu plan. ")):V("",!0),_.value?(v(),b("div",Od,[(v(),b(Z,null,ce(2,J=>r("div",{key:J,class:"card p-4 animate-pulse"},[...B[11]||(B[11]=[go('<div class="flex items-center gap-3"><div class="w-10 h-10 rounded-xl bg-elevado"></div><div class="flex-1"><div class="h-3.5 w-28 rounded bg-elevado"></div><div class="h-2.5 w-16 rounded bg-elevado mt-2"></div></div></div><div class="h-2.5 w-full rounded bg-elevado mt-4"></div>',2)])])),64))])):a.value.length===0?(v(),de(qe,{key:5,class:"card",estado:"durmiendo",titulo:"Todavía no hay agentes",detalle:"Creá el primero y cargale su base de conocimiento para que empiece a responder."},{default:dt(()=>[r("button",{class:"btn-primary",disabled:y.value.lleno,onClick:U},"+ Crear el primer agente",8,Md)]),_:1})):(v(),b("div",Nd,[(v(!0),b(Z,null,ce(a.value,J=>(v(),de(Pe,{key:J.ID,to:`/tenants/${n.value}/agentes/${J.ID}`,class:"card p-4 relative group hover:shadow-lg hover:-translate-y-0.5 transition-all overflow-hidden"},{default:dt(()=>[r("span",{class:"absolute inset-x-0 top-0 h-1",style:Ft({background:J.color||"#8eb02f"})},null,4),r("div",jd,[r("span",{class:"w-10 h-10 rounded-xl flex items-center justify-center text-white text-sm font-semibold shrink-0",style:Ft({background:J.color||"#8eb02f",opacity:J.activo?1:.4})},S(I(J.nombre)),5),r("div",Vd,[r("div",Ud,[r("span",Ld,S(J.nombre),1),r("span",{class:ie(`badge-${k(J).tipo}`)},S(k(J).texto),3)]),r("p",qd,S(J.tono||"sin tono definido"),1)]),r("div",Fd,[r("button",{class:"p-1 text-tenue hover:text-texto",title:"Editar",onClick:Ae(ze=>F(J),["prevent","stop"])},[ne(Ne,{nombre:"lapiz",tam:14})],8,Hd),r("button",{class:"p-1 text-tenue hover:text-texto",title:"Duplicar: copia el conocimiento y las herramientas a un agente nuevo",onClick:Ae(ze=>$(J),["prevent","stop"])},[ne(Ne,{nombre:"copiar",tam:14})],8,Bd),r("button",{class:"p-1 text-tenue hover:text-red-600",title:"Eliminar",onClick:Ae(ze=>me(J),["prevent","stop"])},[ne(Ne,{nombre:"cerrar",tam:14})],8,Wd)])]),r("div",Gd,[r("span",zd,[r("b",Kd,S(A(J).conversaciones),1),B[12]||(B[12]=Y(" conversaciones · 7d",-1))]),r("span",Qd,[r("b",Jd,S(A(J).documentos),1),B[13]||(B[13]=Y(" fuentes",-1))]),r("span",Yd,[r("b",Zd,S(A(J).canales),1),B[14]||(B[14]=Y(" canales",-1))])])]),_:2},1032,["to"]))),128))])),u.value?(v(),b("div",{key:7,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:B[9]||(B[9]=Ae(J=>u.value=!1,["self"]))},[r("div",Xd,[r("h2",ef,S(d.value?"Editar agente":"Nuevo agente"),1),r("form",{class:"space-y-3",onSubmit:Ae(H,["prevent"])},[r("div",null,[B[15]||(B[15]=r("label",{class:"label"},"Nombre",-1)),z(r("input",{"onUpdate:modelValue":B[0]||(B[0]=J=>c.value.nombre=J),required:"",placeholder:"ej: Ventas, Soporte",class:"input"},null,512),[[re,c.value.nombre]])]),!d.value&&g.value.length?(v(),b("div",tf,[B[16]||(B[16]=r("label",{class:"label"},"Arrancar con",-1)),r("div",nf,[(v(!0),b(Z,null,ce([{clave:"",nombre:"Agente en blanco",descripcion:"Sin conocimiento cargado. Lo escribís vos desde cero."},...g.value],J=>(v(),b("label",{key:J.clave,class:ie(["flex gap-2.5 p-2.5 rounded-lg border cursor-pointer transition-colors",c.value.plantilla_rubro===J.clave?"border-brand bg-brand/5":"border-borde hover:border-brand/40"])},[z(r("input",{"onUpdate:modelValue":B[1]||(B[1]=ze=>c.value.plantilla_rubro=ze),type:"radio",value:J.clave,class:"mt-1 text-brand focus:ring-brand"},null,8,sf),[[zs,c.value.plantilla_rubro]]),r("span",of,[r("span",af,S(J.nombre),1),r("span",rf,S(J.descripcion),1),J.notas?(v(),b("span",lf,S(J.notas)+" notas listas para editar · "+S(J.resumen),1)):V("",!0)])],2))),128))]),B[17]||(B[17]=r("p",{class:"text-xs text-tenue mt-1.5"}," Las notas vienen con ejemplos entre corchetes — abrilas y reemplazalas por tus datos reales. ",-1))])):V("",!0),r("div",null,[B[19]||(B[19]=r("label",{class:"label"},"Config de IA",-1)),z(r("select",{"onUpdate:modelValue":B[2]||(B[2]=J=>c.value.ai_config_id=J),class:"input"},[B[18]||(B[18]=r("option",{value:null},"— sin asignar —",-1)),(v(!0),b(Z,null,ce(l.value,J=>(v(),b("option",{key:J.ID,value:J.ID},S(J.nombre)+" ("+S(J.provider)+")",9,uf))),128))],512),[[Nt,c.value.ai_config_id]])]),r("div",null,[B[20]||(B[20]=r("label",{class:"label"},"Tono / personalidad",-1)),z(r("textarea",{"onUpdate:modelValue":B[3]||(B[3]=J=>c.value.tono=J),rows:"2",class:"input"},null,512),[[re,c.value.tono]])]),r("div",null,[B[21]||(B[21]=r("label",{class:"label"},"Mensaje de bienvenida",-1)),z(r("input",{"onUpdate:modelValue":B[4]||(B[4]=J=>c.value.mensaje_bienvenida=J),class:"input"},null,512),[[re,c.value.mensaje_bienvenida]])]),r("div",null,[B[22]||(B[22]=r("label",{class:"label"},"Color del widget",-1)),r("div",cf,[z(r("input",{"onUpdate:modelValue":B[5]||(B[5]=J=>c.value.color=J),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),[[re,c.value.color]]),z(r("input",{"onUpdate:modelValue":B[6]||(B[6]=J=>c.value.color=J),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),[[re,c.value.color]])])]),r("label",df,[z(r("input",{"onUpdate:modelValue":B[7]||(B[7]=J=>c.value.activo=J),type:"checkbox"},null,512),[[st,c.value.activo]]),B[23]||(B[23]=Y(" Activo ",-1))]),r("div",ff,[r("button",{type:"button",class:"px-4 py-2 text-sm text-gray-500 dark:text-gray-400",onClick:B[8]||(B[8]=J=>u.value=!1)},"Cancelar"),r("button",pf,S(d.value?"Guardar":"Crear"),1)])],32)])])):V("",!0)])}}},vf={class:"card divide-y divide-borde max-h-[32rem] overflow-y-auto"},hf={class:"cursor-pointer flex items-center gap-2 text-sm"},gf={class:"text-tenue text-xs shrink-0"},bf={class:"text-texto truncate"},xf={class:"text-tenue text-xs ml-auto shrink-0"},yf={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"},_f={__name:"TabAuditoria",props:{eventos:{type:Array,default:()=>[]}},setup(e){const t=le(()=>s=>({error:"badge-error",warn:"badge-alerta"})[s]||"badge-neutro");function n(s){try{return new Date(s).toLocaleString()}catch{return s}}return(s,o)=>(v(),b("div",null,[o[0]||(o[0]=r("p",{class:"label mb-4"}," Errores y eventos técnicos de este agente — fallos al llamar a la IA, a una herramienta, al correo o a los canales. Últimos 100. ",-1)),r("div",vf,[e.eventos.length===0?(v(),de(qe,{key:0,estado:"contenta",titulo:"Ningún problema registrado",detalle:"Acá aparecen los errores: una herramienta que no responde, una fuente que no se pudo leer. Que esté vacío es buena señal."})):V("",!0),(v(!0),b(Z,null,ce(e.eventos,a=>(v(),b("details",{key:a.ID,class:"p-3"},[r("summary",hf,[r("span",{class:ie(["px-1.5 py-0.5 rounded text-xs shrink-0",t.value(a.nivel)])},S(a.nivel),3),r("span",gf,S(a.origen),1),r("span",bf,S(a.mensaje),1),r("span",xf,S(n(a.CreatedAt)),1)]),a.detalle?(v(),b("pre",yf,S(a.detalle),1)):V("",!0)]))),128))])]))}},wf={class:"space-y-6"},kf={key:0,class:"text-sm text-red-600 dark:text-red-400"},$f={key:1,class:"label"},Cf={class:"card divide-y divide-borde"},Af={class:"min-w-0"},Sf={class:"font-medium text-texto"},Ef={class:"text-xs text-tenue mt-0.5"},If={key:0,class:"text-xs text-tenue mt-1"},Rf=["onClick"],Pf={class:"card divide-y divide-borde"},Df={class:"min-w-0"},Tf={class:"flex items-center gap-2 flex-wrap"},Of={class:"font-medium text-texto"},Mf={key:0,class:"px-1.5 py-0.5 rounded text-xs badge-neutro"},Nf={key:1,class:"px-1.5 py-0.5 rounded text-xs bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300"},jf={class:"text-xs text-tenue mt-0.5"},Vf={key:0,class:"text-xs text-red-600 dark:text-red-400 mt-1"},Uf=["onClick"],Lf={__name:"TabAcciones",props:{agenteId:{type:Number,required:!0}},setup(e){const t=e,n=j([]),s=j([]),o=j(!0),a=j("");async function l(){o.value=!0,a.value="";try{const f=await Q.get(K(`/umind/avisos?agente_id=${t.agenteId}`));n.value=(f.items||[]).filter(_=>_.estado==="pendiente")}catch(f){a.value=f.message}try{const f=await Q.get(K(`/umind/vigilancias?agente_id=${t.agenteId}`));s.value=f.items||[]}catch{s.value=[]}o.value=!1}Ge(()=>t.agenteId,l,{immediate:!0});async function i(f){confirm(`¿Cancelar el recordatorio "${f.titulo}"?`)&&(await Q.del(K(`/umind/avisos/${f.ID}`)),await l())}async function u(f){confirm(`¿Apagar la vigilancia "${f.nombre}"?`)&&(await Q.del(K(`/umind/vigilancias/${f.ID}`)),await l())}const d={diario:"todos los días",semanal:"cada semana",mensual:"cada mes",anual:"cada año"};function c(f){return new Date(f).toLocaleString("es",{day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})}function p(f){return!f||f.startsWith("panel:")?"te llega por correo":f.startsWith("tg:")?"te llega por Telegram":f.startsWith("mail:")?`te llega a ${f.slice(5)}`:"te llega por correo"}return(f,_)=>(v(),b("div",wf,[a.value?(v(),b("p",kf,S(a.value),1)):V("",!0),o.value?(v(),b("p",$f,"Cargando…")):(v(),b(Z,{key:2},[r("section",null,[_[0]||(_[0]=r("h3",{class:"text-sm font-medium text-texto mb-1"},"Recordatorios",-1)),_[1]||(_[1]=r("p",{class:"label mb-3"},[Y(" Pediselos hablando: "),r("em",null,"«avisame el 15 de marzo que vence la póliza de Acme, y todos los años»"),Y(". ")],-1)),r("div",Cf,[n.value.length===0?(v(),de(qe,{key:0,titulo:"Sin recordatorios",detalle:"Escribile desde tu canal privado y programá el primero. Te avisa por donde se lo pediste."})):V("",!0),(v(!0),b(Z,null,ce(n.value,k=>(v(),b("div",{key:k.ID,class:"p-4 flex items-center justify-between gap-4"},[r("div",Af,[r("span",Sf,S(k.titulo),1),r("p",Ef,[Y(S(c(k.proximo_at))+" ",1),k.repetir?(v(),b(Z,{key:0},[Y(" · se repite "+S(d[k.repetir]||k.repetir),1)],64)):V("",!0),Y(" · "+S(p(k.destino)),1)]),k.detalle?(v(),b("p",If,S(k.detalle),1)):V("",!0)]),r("button",{class:"text-sm text-red-500 hover:text-red-700 shrink-0",onClick:A=>i(k)},"Cancelar",8,Rf)]))),128))])]),r("section",null,[_[2]||(_[2]=r("h3",{class:"text-sm font-medium text-texto mb-1"},"Vigilancias",-1)),_[3]||(_[3]=r("p",{class:"label mb-3"}," Consultan una de tus herramientas cada tanto y te avisan cuando pasa algo. Solo avisan al entrar en la condición, no cada vez que la revisan. ",-1)),r("div",Pf,[s.value.length===0?(v(),de(qe,{key:0,titulo:"Sin vigilancias",detalle:"Si tenés una herramienta conectada, pedile algo como «avisame cuando esta API devuelva stock en cero»."})):V("",!0),(v(!0),b(Z,null,ce(s.value,k=>(v(),b("div",{key:k.ID,class:"p-4 flex items-center justify-between gap-4"},[r("div",Df,[r("div",Tf,[r("span",Of,S(k.nombre),1),k.activa?k.en_condicion?(v(),b("span",Nf,"se está cumpliendo")):V("",!0):(v(),b("span",Mf,"apagada"))]),r("p",jf,S(k.condicion)+" · revisa cada "+S(k.intervalo_min)+" min · usa "+S(k.herramienta),1),k.ultimo_error?(v(),b("p",Vf,S(k.ultimo_error),1)):V("",!0)]),r("button",{class:"text-sm text-red-500 hover:text-red-700 shrink-0",onClick:A=>u(k)},"Apagar",8,Uf)]))),128))])])],64))]))}},qf={class:"flex flex-wrap gap-2 mb-4"},Ff={class:"grid sm:grid-cols-2 gap-3"},Hf={key:0,class:"grid sm:grid-cols-3 gap-3"},Bf={key:1,class:"text-sm text-red-600 dark:text-red-400"},Wf={class:"flex items-center justify-between"},Gf=["disabled"],zf={class:"card divide-y divide-borde"},Kf={class:"flex items-center justify-between gap-3"},Qf={class:"min-w-0"},Jf={class:"font-medium text-texto"},Yf={class:"ml-2 text-xs text-tenue"},Zf={class:"flex items-center gap-3 shrink-0 text-sm"},Xf=["disabled","onClick"],ep=["onClick"],tp={__name:"TabConexiones",props:{agenteId:{type:Number,required:!0},conexiones:{type:Array,default:()=>[]}},emits:["recargar"],setup(e,{emit:t}){const n=e,s=t,o=j(!1),a=j(!1),l=j(""),i=j(!1),u=j({email:"",password:"",host:"",puerto:993,encriptado:"ssl"}),d=j(null),c=j({});function p(I){return{google:"Google",microsoft:"Outlook",imap:"Casilla propia"}[I]||I}function f(I){window.location.href=K(`/umind/conexiones/conectar?agente_id=${n.agenteId}&proveedor=${I}`)}async function _(){a.value=!0,l.value="";try{await Q.post(K("/umind/conexiones/imap"),{agente_id:n.agenteId,email:u.value.email,password:u.value.password,host:i.value?u.value.host:"",puerto:i.value?Number(u.value.puerto):0,encriptado:u.value.encriptado}),o.value=!1,u.value={email:"",password:"",host:"",puerto:993,encriptado:"ssl"},i.value=!1,s("recargar")}catch(I){l.value=I.message,!i.value&&/conexión|conectar|resolver/i.test(I.message)&&(i.value=!0)}finally{a.value=!1}}async function k(I){d.value=I.ID,c.value={...c.value,[I.ID]:null};try{const y=await Q.post(K(`/umind/conexiones/${I.ID}/probar`),{});c.value={...c.value,[I.ID]:{ok:!0,texto:y.message}}}catch(y){c.value={...c.value,[I.ID]:{ok:!1,texto:y.message}}}finally{d.value=null}}async function A(I){confirm(`¿Desconectar la cuenta ${I.email||I.proveedor}?`)&&(await Q.del(K(`/umind/conexiones/${I.ID}`)),s("recargar"))}return(I,y)=>(v(),b("div",null,[y[15]||(y[15]=r("p",{class:"label mb-4"},[Y(" Las casillas que el agente puede consultar cuando se lo pedís — por ejemplo: "),r("em",null,"«revisame los correos de hoy y haceme un resumen»"),Y(". Solo lectura: nunca marca nada como leído ni manda nada. Podés conectar varias. ")],-1)),r("div",qf,[r("button",{class:"border border-borde hover:border-brand text-sm font-medium px-4 py-2 rounded-lg text-gray-700 dark:text-gray-200 transition-colors",onClick:y[0]||(y[0]=w=>f("google"))}," Conectar Google "),r("button",{class:"border border-borde hover:border-brand text-sm font-medium px-4 py-2 rounded-lg text-gray-700 dark:text-gray-200 transition-colors",onClick:y[1]||(y[1]=w=>f("microsoft"))}," Conectar Outlook "),r("button",{class:"btn-primary",onClick:y[2]||(y[2]=w=>o.value=!o.value)}," + Casilla propia ")]),o.value?(v(),b("form",{key:0,class:"card p-4 mb-4 space-y-3",onSubmit:Ae(_,["prevent"])},[r("div",Ff,[r("div",null,[y[8]||(y[8]=r("label",{class:"label"},"Correo",-1)),z(r("input",{"onUpdate:modelValue":y[3]||(y[3]=w=>u.value.email=w),type:"email",required:"",placeholder:"ventas@tunegocio.com",class:"input"},null,512),[[re,u.value.email]])]),r("div",null,[y[9]||(y[9]=r("label",{class:"label"},"Contraseña",-1)),z(r("input",{"onUpdate:modelValue":y[4]||(y[4]=w=>u.value.password=w),type:"password",autocomplete:"new-password",required:"",class:"input"},null,512),[[re,u.value.password]])])]),i.value?(v(),b("div",Hf,[r("div",null,[y[10]||(y[10]=r("label",{class:"label"},"Servidor IMAP",-1)),z(r("input",{"onUpdate:modelValue":y[5]||(y[5]=w=>u.value.host=w),placeholder:"mail.tunegocio.com",class:"input font-mono"},null,512),[[re,u.value.host]])]),r("div",null,[y[11]||(y[11]=r("label",{class:"label"},"Puerto",-1)),z(r("input",{"onUpdate:modelValue":y[6]||(y[6]=w=>u.value.puerto=w),type:"number",class:"input"},null,512),[[re,u.value.puerto]])]),r("div",null,[y[13]||(y[13]=r("label",{class:"label"},"Encriptación",-1)),z(r("select",{"onUpdate:modelValue":y[7]||(y[7]=w=>u.value.encriptado=w),class:"input"},[...y[12]||(y[12]=[r("option",{value:"ssl"},"SSL (993)",-1),r("option",{value:"starttls"},"STARTTLS (143)",-1)])],512),[[Nt,u.value.encriptado]])])])):V("",!0),l.value?(v(),b("p",Bf,S(l.value),1)):V("",!0),r("div",Wf,[y[14]||(y[14]=r("p",{class:"text-xs text-tenue"}," Se prueba la conexión antes de guardar. Gmail y Outlook van por sus botones de arriba. ",-1)),r("button",{type:"submit",class:"btn-primary",disabled:a.value},S(a.value?"Probando…":"Conectar"),9,Gf)])],32)):V("",!0),r("div",zf,[e.conexiones.length===0?(v(),de(qe,{key:0,titulo:"Sin cuentas conectadas",detalle:"Conectá una casilla y vas a poder pedirle al agente que te revise el correo y te lo resuma, sin abrir el webmail."})):V("",!0),(v(!0),b(Z,null,ce(e.conexiones,w=>(v(),b("div",{key:w.ID,class:"p-4"},[r("div",Kf,[r("div",Qf,[r("span",Jf,S(w.email),1),r("span",Yf,S(p(w.proveedor)),1),r("span",{class:ie(["ml-2 px-1.5 py-0.5 rounded text-xs",w.activo?"badge-ok":"badge-neutro"])},S(w.activo?"activa":"inactiva"),3),c.value[w.ID]?(v(),b("p",{key:0,class:ie(["text-xs mt-1",c.value[w.ID].ok?"text-brand":"text-red-600 dark:text-red-400"])},S(c.value[w.ID].texto),3)):V("",!0)]),r("div",Zf,[w.proveedor==="imap"?(v(),b("button",{key:0,class:"text-brand hover:underline disabled:opacity-40",disabled:d.value===w.ID,onClick:g=>k(w)},S(d.value===w.ID?"Probando…":"Probar"),9,Xf)):V("",!0),r("button",{class:"text-red-500 hover:text-red-700",onClick:g=>A(w)},"Desconectar",8,ep)])])]))),128))])]))}},np={class:"card p-4 flex flex-col h-[28rem]"},sp={class:"flex-1 overflow-y-auto space-y-2 mb-3"},op={key:0,class:"text-sm text-tenue"},ap={key:1,class:"flex items-center gap-2"},rp=["disabled"],_a={__name:"TabChat",props:{agenteId:{type:Number,required:!0}},setup(e){const t=e,n=`staff-preview-${Math.random().toString(36).slice(2)}`,s=j([]),o=j(""),a=j(!1);async function l(){const i=o.value.trim();if(!(!i||a.value)){o.value="",s.value.push({role:"user",content:i}),a.value=!0;try{const u=await Q.post(K("/umind/chat"),{agente_id:t.agenteId,session_id:n,mensaje:i});s.value.push({role:"assistant",content:u.respuesta})}catch(u){s.value.push({role:"assistant",content:`⚠ ${u.message}`})}finally{a.value=!1}}}return(i,u)=>(v(),b("div",np,[r("div",sp,[s.value.length===0?(v(),b("p",op," Probá este agente tal cual lo va a ver un visitante — usa la misma config de IA, las mismas herramientas y la misma base de conocimiento. ")):V("",!0),(v(!0),b(Z,null,ce(s.value,(d,c)=>(v(),b("div",{key:c,class:ie(["max-w-[80%] px-3 py-2 rounded-lg text-sm whitespace-pre-wrap",d.role==="user"?"bg-brand text-white ml-auto":"bg-elevado text-texto"])},S(d.content),3))),128)),a.value?(v(),b("div",ap,[ne(Vn,{estado:"pensando",tam:30,class:"text-brand"}),u[1]||(u[1]=r("span",{class:"text-xs text-tenue"},"Pensando…",-1))])):V("",!0)]),r("form",{class:"flex gap-2",onSubmit:Ae(l,["prevent"])},[z(r("input",{"onUpdate:modelValue":u[0]||(u[0]=d=>o.value=d),placeholder:"Escribí un mensaje de prueba...",class:"flex-1 input"},null,512),[[re,o.value]]),r("button",{type:"submit",disabled:a.value,class:"btn-primary disabled:opacity-50 transition-colors"}," Enviar ",8,rp)],32)]))}},lp={class:"grid lg:grid-cols-[minmax(16rem,22rem)_1fr] gap-4 items-start"},ip={class:"card divide-y divide-borde max-h-[30rem] overflow-y-auto"},up=["onClick"],cp={class:"text-sm text-texto line-clamp-2"},dp={class:"flex items-center gap-2 mt-1.5 text-xs text-tenue"},fp={class:"tabular-nums"},pp={class:"ml-auto tabular-nums"},mp={key:2,class:"flex items-center gap-2 p-3 text-xs text-tenue cursor-pointer select-none"},vp={class:"card p-4 max-h-[30rem] overflow-y-auto"},hp={key:1,class:"text-sm text-tenue"},gp={key:2,class:"space-y-2"},bp={__name:"TabConversaciones",props:{agenteId:{type:Number,required:!0},sesiones:{type:Array,default:()=>[]}},setup(e){const t=e,n=j([]),s=j(null),o=j(!1);function a(f){const _=String(f||"");return _.startsWith("wa:")?{nombre:"WhatsApp",icono:"mensaje",clase:"badge-ok"}:_.startsWith("tg:")?{nombre:"Telegram",icono:"mensaje",clase:"badge-neutro"}:_.startsWith("staff-preview")?{nombre:"Prueba",icono:"escribir",clase:"badge-alerta"}:{nombre:"Tu web",icono:"sitio",clase:"badge-neutro"}}const l=j(!1),i=le(()=>t.sesiones.filter(f=>!String(f.session_id).startsWith("staff-preview"))),u=le(()=>t.sesiones.filter(f=>String(f.session_id).startsWith("staff-preview"))),d=le(()=>l.value?t.sesiones:i.value);function c(f){if(!f)return"";const _=new Date(f),A=Math.floor((new Date().setHours(0,0,0,0)-new Date(_).setHours(0,0,0,0))/864e5),I=new Date(f).toLocaleTimeString("es",{hour:"2-digit",minute:"2-digit"});return A<=0?`hoy ${I}`:A===1?`ayer ${I}`:A<7?`hace ${A} días`:new Date(f).toLocaleDateString("es",{day:"numeric",month:"short"})}async function p(f){s.value=f,o.value=!0;try{const _=await Q.get(K(`/umind/historial?agente_id=${t.agenteId}&session_id=${f}`));n.value=_.items||[]}finally{o.value=!1}}return(f,_)=>(v(),b("div",lp,[r("div",ip,[d.value.length===0&&u.value.length===0?(v(),de(qe,{key:0,titulo:"Nadie escribió todavía",detalle:"Cuando alguien le hable a tu asistente —por WhatsApp, Telegram o tu web— la conversación aparece acá, con lo que preguntó y lo que se le respondió."})):d.value.length===0?(v(),de(qe,{key:1,estado:"durmiendo",titulo:"Ningún cliente escribió todavía",detalle:`Hay ${u.value.length} ${u.value.length===1?"conversación de prueba tuya":"conversaciones de prueba tuyas"} — activá el filtro de abajo para verlas.`},null,8,["detalle"])):V("",!0),(v(!0),b(Z,null,ce(d.value,k=>(v(),b("button",{key:k.session_id,class:ie(["w-full text-left p-3 hover:bg-elevado transition-colors",s.value===k.session_id?"bg-gray-50 dark:bg-gray-800":""]),onClick:A=>p(k.session_id)},[r("div",cp,S(k.primer_mensaje||"(sin mensaje)"),1),r("div",dp,[r("span",{class:ie(["px-1.5 py-0.5 rounded",a(k.session_id).clase])},S(a(k.session_id).nombre),3),r("span",fp,S(k.mensajes)+" msj",1),r("span",pp,S(c(k.ultimo)),1)])],10,up))),128)),u.value.length?(v(),b("label",mp,[z(r("input",{"onUpdate:modelValue":_[0]||(_[0]=k=>l.value=k),type:"checkbox",class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[st,l.value]]),Y(" "+S(u.value.length===1?"Mostrar mi prueba":`Mostrar mis ${u.value.length} pruebas`),1)])):V("",!0)]),r("div",vp,[s.value?o.value?(v(),b("p",hp,"Cargando…")):(v(),b("div",gp,[(v(!0),b(Z,null,ce(n.value,k=>(v(),b("div",{key:k.ID,class:ie(k.role==="user"?"text-right":"")},[r("div",{class:ie(["inline-block max-w-[80%] px-3 py-2 rounded-lg text-sm text-left whitespace-pre-wrap",k.role==="user"?"bg-brand text-white":"bg-elevado text-texto"])},S(k.content),3),r("div",{class:ie(["text-[10px] text-tenue mt-0.5 tabular-nums",k.role==="user"?"pr-1":"pl-1"])},S(c(k.CreatedAt)),3)],2))),128))])):(v(),de(qe,{key:0,estado:"normal",titulo:"Elegí una conversación",detalle:"Vas a ver el intercambio completo: lo que escribió la persona y lo que contestó tu asistente. Si una respuesta no te gusta, corregí su información en «Lo que sabe»."}))])]))}},xp={class:"card divide-y divide-borde"},yp={class:"text-sm text-texto font-mono"},_p={class:"label mt-0.5"},wp={class:"text-xs text-tenue mt-0.5"},kp={key:0,class:"ml-1 text-green-600 dark:text-green-400"},$p={key:1,class:"ml-1 text-gray-400"},Cp={class:"flex gap-3 text-sm shrink-0"},Ap=["onClick"],Sp=["onClick"],Ep={class:"card p-6 w-full max-w-xl max-h-[85vh] overflow-y-auto"},Ip={class:"font-semibold text-texto mb-4"},Rp={class:"border border-borde rounded-lg p-3 space-y-2"},Pp=["onUpdate:modelValue"],Dp=["onUpdate:modelValue"],Tp=["onUpdate:modelValue"],Op={class:"label flex items-center gap-1"},Mp=["onUpdate:modelValue"],Np=["onClick"],jp={key:0,class:"text-xs text-gray-400"},Vp={class:"border border-borde rounded-lg p-3 space-y-2"},Up={class:"flex items-center gap-2 label"},Lp={class:"flex items-center gap-2 text-sm text-texto"},qp={class:"flex justify-end gap-2 pt-2"},Fp={__name:"TabHerramientas",props:{agenteId:{type:Number,required:!0},tools:{type:Array,default:()=>[]}},emits:["recargar","error"],setup(e,{emit:t}){const n=e,s=t,o=j(!1),a=j(null),l=j(i());function i(){return{nombre:"",descripcion:"",url:"",auth_header_nombre:"",auth_header_valor:"",tocarAuth:!1,parametros:[],activa:!0}}function u(){a.value=null,l.value=i(),o.value=!0}function d(k){a.value=k;let A=[];try{A=JSON.parse(k.parametros_json||"[]")||[]}catch{A=[]}l.value={nombre:k.nombre,descripcion:k.descripcion,url:k.url,auth_header_nombre:k.auth_header_nombre,auth_header_valor:"",tocarAuth:!1,parametros:A,activa:k.activa},o.value=!0}function c(){l.value.parametros.push({nombre:"",tipo:"string",descripcion:"",requerido:!1})}function p(k){l.value.parametros.splice(k,1)}async function f(){const k={agente_id:n.agenteId,nombre:l.value.nombre.trim(),descripcion:l.value.descripcion,url:l.value.url.trim(),auth_header_nombre:l.value.auth_header_nombre,parametros:l.value.parametros,activa:l.value.activa};l.value.tocarAuth&&(k.auth_header_valor=l.value.auth_header_valor);try{a.value?await Q.put(K(`/umind/tools/${a.value.ID}`),k):await Q.post(K("/umind/tools"),k),o.value=!1,s("recargar")}catch(A){s("error",A.message)}}async function _(k){confirm(`¿Eliminar la herramienta "${k.nombre}"?`)&&(await Q.del(K(`/umind/tools/${k.ID}`)),s("recargar"))}return(k,A)=>(v(),b("div",null,[r("div",{class:"flex justify-between items-center mb-4"},[A[9]||(A[9]=r("p",{class:"label"},"Máximo 10 herramientas activas por agente.",-1)),r("button",{class:"btn-primary",onClick:u}," + Nueva herramienta ")]),r("div",xp,[e.tools.length===0?(v(),de(qe,{key:0,titulo:"Sin herramientas conectadas",detalle:"Las herramientas le dejan consultar tus sistemas mientras conversa: stock, estado de un pedido, disponibilidad de turnos. Sin ninguna, responde solo con lo que tiene cargado."})):V("",!0),(v(!0),b(Z,null,ce(e.tools,I=>(v(),b("div",{key:I.ID,class:"p-4 flex items-center justify-between"},[r("div",null,[r("div",yp,S(I.nombre),1),r("div",_p,S(I.descripcion),1),r("div",wp,[Y(S(I.url)+" ",1),I.auth_configurado?(v(),b("span",kp,"· auth configurada")):V("",!0),I.activa?V("",!0):(v(),b("span",$p,"· inactiva"))])]),r("div",Cp,[r("button",{class:"text-tenue hover:text-gray-800 dark:hover:text-gray-100",onClick:y=>d(I)},"Editar",8,Ap),r("button",{class:"text-red-500 hover:text-red-700",onClick:y=>_(I)},"Eliminar",8,Sp)])]))),128))]),o.value?(v(),b("div",{key:0,class:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center p-4 z-50",onClick:A[8]||(A[8]=Ae(I=>o.value=!1,["self"]))},[r("div",Ep,[r("h2",Ip,S(a.value?"Editar herramienta":"Nueva herramienta"),1),r("form",{class:"space-y-3",onSubmit:Ae(f,["prevent"])},[r("div",null,[A[10]||(A[10]=r("label",{class:"label"},"Nombre (identificador, ej: consultar_stock)",-1)),z(r("input",{"onUpdate:modelValue":A[0]||(A[0]=I=>l.value.nombre=I),required:"",pattern:"[a-z][a-z0-9_]{2,63}",class:"input font-mono"},null,512),[[re,l.value.nombre]])]),r("div",null,[A[11]||(A[11]=r("label",{class:"label"},"Descripción (esto lo lee el modelo para decidir cuándo usarla)",-1)),z(r("textarea",{"onUpdate:modelValue":A[1]||(A[1]=I=>l.value.descripcion=I),rows:"2",required:"",class:"input"},null,512),[[re,l.value.descripcion]])]),r("div",null,[A[12]||(A[12]=r("label",{class:"label"},"URL del webhook (https)",-1)),z(r("input",{"onUpdate:modelValue":A[2]||(A[2]=I=>l.value.url=I),type:"url",required:"",placeholder:"https://...",class:"input"},null,512),[[re,l.value.url]])]),r("div",Rp,[r("div",{class:"flex items-center justify-between"},[A[13]||(A[13]=r("label",{class:"label"},"Parámetros que completa el modelo",-1)),r("button",{type:"button",class:"text-xs text-brand",onClick:c},"+ agregar")]),(v(!0),b(Z,null,ce(l.value.parametros,(I,y)=>(v(),b("div",{key:y,class:"flex gap-2 items-center"},[z(r("input",{"onUpdate:modelValue":w=>I.nombre=w,placeholder:"nombre",class:"flex-1 border border-borde bg-white dark:bg-gray-800 text-texto rounded px-2 py-1 text-xs font-mono"},null,8,Pp),[[re,I.nombre]]),z(r("select",{"onUpdate:modelValue":w=>I.tipo=w,class:"border border-borde bg-white dark:bg-gray-800 text-texto rounded px-2 py-1 text-xs"},[...A[14]||(A[14]=[r("option",{value:"string"},"string",-1),r("option",{value:"number"},"number",-1),r("option",{value:"boolean"},"boolean",-1)])],8,Dp),[[Nt,I.tipo]]),z(r("input",{"onUpdate:modelValue":w=>I.descripcion=w,placeholder:"descripción",class:"flex-1 border border-borde bg-white dark:bg-gray-800 text-texto rounded px-2 py-1 text-xs"},null,8,Tp),[[re,I.descripcion]]),r("label",Op,[z(r("input",{"onUpdate:modelValue":w=>I.requerido=w,type:"checkbox"},null,8,Mp),[[st,I.requerido]]),A[15]||(A[15]=Y(" req. ",-1))]),r("button",{type:"button",class:"text-red-400 text-xs",onClick:w=>p(y)},[ne(Ne,{nombre:"cerrar",tam:13})],8,Np)]))),128)),l.value.parametros.length===0?(v(),b("p",jp,"Sin parámetros.")):V("",!0)]),r("div",Vp,[A[16]||(A[16]=r("label",{class:"label"},"Autenticación saliente (opcional)",-1)),z(r("input",{"onUpdate:modelValue":A[3]||(A[3]=I=>l.value.auth_header_nombre=I),placeholder:"Nombre del header, ej: Authorization",class:"input"},null,512),[[re,l.value.auth_header_nombre]]),r("label",Up,[z(r("input",{"onUpdate:modelValue":A[4]||(A[4]=I=>l.value.tocarAuth=I),type:"checkbox"},null,512),[[st,l.value.tocarAuth]]),Y(" "+S(a.value?"Cambiar el valor del secreto":"Configurar valor"),1)]),l.value.tocarAuth?z((v(),b("input",{key:0,"onUpdate:modelValue":A[5]||(A[5]=I=>l.value.auth_header_valor=I),type:"password",placeholder:"Valor del header (ej: Bearer xxxx)",class:"input"},null,512)),[[re,l.value.auth_header_valor]]):V("",!0)]),r("label",Lp,[z(r("input",{"onUpdate:modelValue":A[6]||(A[6]=I=>l.value.activa=I),type:"checkbox"},null,512),[[st,l.value.activa]]),A[17]||(A[17]=Y(" Activa ",-1))]),r("div",qp,[r("button",{type:"button",class:"btn-ghost",onClick:A[7]||(A[7]=I=>o.value=!1)},"Cancelar"),A[18]||(A[18]=r("button",{type:"submit",class:"btn-primary"},"Guardar",-1))])],32)])])):V("",!0)]))}},Hp={class:"card p-4 mb-4"},Bp={class:"flex items-center justify-between mb-2"},Wp={class:"bg-elevado border border-borde rounded-lg p-2.5 text-xs text-texto overflow-x-auto"},Gp={class:"card divide-y divide-borde"},zp={class:"flex items-center justify-between"},Kp={class:"font-medium text-texto capitalize"},Qp={key:0,class:"ml-2 px-1.5 py-0.5 rounded text-xs badge-neutro"},Jp={class:"flex gap-3 text-sm"},Yp=["onClick"],Zp=["onClick"],Xp={class:"flex gap-4 mt-2 text-xs"},em={class:"flex items-center gap-1.5 text-texto cursor-pointer"},tm=["checked","onChange"],nm={class:"flex items-center gap-1.5 text-texto cursor-pointer"},sm=["checked","onChange"],om={class:"flex items-center gap-1.5 text-texto cursor-pointer"},am=["checked","onChange"],rm={key:0,class:"label mt-1"},lm={key:1,class:"label mt-1 break-all"},im={class:"bg-elevado px-1 rounded"},um={key:2,class:"text-xs text-tenue mt-1"},cm={key:3,class:"text-xs text-red-600 dark:text-red-400 mt-1"},dm={class:"card p-6 w-full max-w-md"},fm={key:0},pm={class:"grid sm:grid-cols-2 gap-3"},mm={class:"flex flex-col gap-1.5 mt-1"},vm={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},hm={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},gm={class:"text-xs text-tenue"},bm={class:"grid sm:grid-cols-2 gap-3 mt-2"},xm={class:"rounded-lg border border-borde p-3 mt-1"},ym={class:"flex items-start gap-2 text-sm text-texto cursor-pointer"},_m={class:"flex flex-col gap-2 pt-1"},wm={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},km={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},$m={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},Cm={class:"flex justify-end gap-2 pt-2"},Am={__name:"TabCanales",props:{agenteId:{type:Number,required:!0},siteKey:{type:String,default:""},canales:{type:Array,default:()=>[]}},emits:["recargar","error"],setup(e,{emit:t}){const n=e,s=t,o=j(!1),a=j(d()),l=j(!1),i=le(()=>{const w=n.siteKey||"TU_SITE_KEY";return`<script src="${window.location.origin}/widget/umind.js" data-site="${w}" defer><\/script>`});async function u(){try{await navigator.clipboard.writeText(i.value),l.value=!0,setTimeout(()=>l.value=!1,2e3)}catch{error.value="No se pudo copiar automáticamente — seleccioná el texto y copialo a mano."}}function d(){return{tipo:"telegram",bot_token:"",phone_number_id:"",access_token:"",app_secret:"",verify_token:"",usuario:"",password:"",imap_host:"",smtp_host:"",imap_encriptado:"ssl",smtp_encriptado:"starttls",intervalo_minutos:5,responder_a:"todos",filtro_remitentes:"",es_interno:!1,usar_whisper_audio:!1,usar_ocr_imagenes:!1,usar_archivos_docs:!1}}function c(){a.value=d(),o.value=!0}async function p(){let w;if(a.value.tipo==="telegram")w={bot_token:a.value.bot_token};else if(a.value.tipo==="correo"){const g=String(a.value.usuario).split("@")[1]||"";w={usuario:a.value.usuario,password:a.value.password,imap_host:a.value.imap_host||`mail.${g}`,smtp_host:a.value.smtp_host||`mail.${g}`,imap_encriptado:a.value.imap_encriptado,smtp_encriptado:a.value.smtp_encriptado}}else w={phone_number_id:a.value.phone_number_id,access_token:a.value.access_token,app_secret:a.value.app_secret,verify_token:a.value.verify_token};try{await Q.post(K("/umind/canales"),{agente_id:n.agenteId,tipo:a.value.tipo,credenciales:w,activo:!0,intervalo_minutos:Number(a.value.intervalo_minutos)||5,filtro_remitentes:a.value.responder_a==="algunos"?a.value.filtro_remitentes:"",es_interno:a.value.es_interno,usar_whisper_audio:a.value.usar_whisper_audio,usar_ocr_imagenes:a.value.usar_ocr_imagenes,usar_archivos_docs:a.value.usar_archivos_docs}),o.value=!1,s("recargar")}catch(g){s("error",g.message)}}async function f(w,g){await Q.put(K(`/umind/canales/${w.ID}`),{activo:w.activo,credenciales:{},usar_whisper_audio:w.usar_whisper_audio,usar_ocr_imagenes:w.usar_ocr_imagenes,usar_archivos_docs:w.usar_archivos_docs,...g}),s("recargar")}const _=w=>f(w,{activo:!w.activo}),k=w=>f(w,{usar_whisper_audio:!w.usar_whisper_audio}),A=w=>f(w,{usar_ocr_imagenes:!w.usar_ocr_imagenes}),I=w=>f(w,{usar_archivos_docs:!w.usar_archivos_docs});async function y(w){confirm(`¿Eliminar el canal ${w.tipo}?`)&&(await Q.del(K(`/umind/canales/${w.ID}`)),s("recargar"))}return(w,g)=>(v(),b("div",null,[r("div",Hp,[r("div",Bp,[g[20]||(g[20]=r("div",null,[r("span",{class:"font-medium text-texto"},"Web (widget)"),r("span",{class:"ml-2 px-1.5 py-0.5 rounded text-xs badge-ok"}," siempre activo ")],-1)),r("button",{class:ie(["text-sm font-medium px-3 py-1.5 rounded-lg transition-colors",l.value?"bg-green-600 text-white":"bg-brand hover:bg-brand-dark text-white"]),onClick:u},[l.value?(v(),de(Ne,{key:0,nombre:"ok",tam:14})):V("",!0),Y(" "+S(l.value?"Copiado":"Copiar código"),1)],2)]),g[21]||(g[21]=r("p",{class:"label mb-2"},[Y(" Pegá esto antes de "),r("code",{class:"bg-elevado px-1 rounded"},"</body>"),Y(" en las páginas de tu sitio. ")],-1)),r("pre",Wp,[r("code",null,S(i.value),1)])]),r("div",{class:"flex justify-end mb-4"},[r("button",{class:"btn-primary",onClick:c}," + Nuevo canal ")]),r("div",Gp,[e.canales.length===0?(v(),de(qe,{key:0,titulo:"No está atendiendo en ningún lado",detalle:"Conectá WhatsApp o Telegram para que empiece a responderle a tus clientes. El widget de tu web funciona aparte, con la clave de sitio de arriba."})):V("",!0),(v(!0),b(Z,null,ce(e.canales,x=>(v(),b("div",{key:x.ID,class:"p-4"},[r("div",zp,[r("div",null,[r("span",Kp,S(x.tipo),1),x.es_interno?(v(),b("span",Qp,"privado")):V("",!0),r("span",{class:ie(["ml-2 px-1.5 py-0.5 rounded text-xs",x.activo?"badge-ok":"badge-neutro"])},S(x.activo?"activo":"inactivo"),3)]),r("div",Jp,[r("button",{class:"text-tenue hover:text-gray-800 dark:hover:text-gray-100",onClick:$=>_(x)},S(x.activo?"Desactivar":"Activar"),9,Yp),r("button",{class:"text-red-500 hover:text-red-700",onClick:$=>y(x)},"Eliminar",8,Zp)])]),r("div",Xp,[r("label",em,[r("input",{type:"checkbox",checked:x.usar_whisper_audio,onChange:$=>k(x),class:"rounded border-borde text-brand focus:ring-brand"},null,40,tm),g[22]||(g[22]=Y(" Transcribir audios (Whisper) ",-1))]),r("label",nm,[r("input",{type:"checkbox",checked:x.usar_ocr_imagenes,onChange:$=>A(x),class:"rounded border-borde text-brand focus:ring-brand"},null,40,sm),g[23]||(g[23]=Y(" Leer texto de imágenes (OCR) ",-1))]),r("label",om,[r("input",{type:"checkbox",checked:x.usar_archivos_docs,onChange:$=>I(x),class:"rounded border-borde text-brand focus:ring-brand"},null,40,am),g[24]||(g[24]=Y(" Leer archivos adjuntos (PDF, Word, texto) ",-1))])]),x.tipo==="correo"?(v(),b("p",rm," Revisa la casilla cada "+S(x.intervalo_minutos>=60?"1 hora":`${x.intervalo_minutos} minutos`)+" · "+S(x.filtro_remitentes?`responde solo a: ${x.filtro_remitentes}`:"responde a todos"),1)):(v(),b("p",lm,[g[25]||(g[25]=Y(" Webhook: ",-1)),r("code",im,S(x.webhook_url),1)])),x.tipo==="whatsapp"?(v(),b("p",um,' Registrá esta URL como "Callback URL" en Meta for Developers → WhatsApp → Configuration, con el mismo verify_token que pusiste acá. ')):V("",!0),x.ultimo_error?(v(),b("p",cm,S(x.ultimo_error),1)):V("",!0)]))),128))]),o.value?(v(),b("div",{key:0,class:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center p-4 z-50",onClick:g[19]||(g[19]=Ae(x=>o.value=!1,["self"]))},[r("div",dm,[g[51]||(g[51]=r("h2",{class:"font-semibold text-texto mb-4"},"Nuevo canal",-1)),r("form",{class:"space-y-3",onSubmit:Ae(p,["prevent"])},[r("div",null,[g[27]||(g[27]=r("label",{class:"label"},"Tipo",-1)),z(r("select",{"onUpdate:modelValue":g[0]||(g[0]=x=>a.value.tipo=x),class:"input"},[...g[26]||(g[26]=[r("option",{value:"telegram"},"Telegram",-1),r("option",{value:"whatsapp"},"WhatsApp Business",-1),r("option",{value:"correo"},"Correo (tu casilla)",-1)])],512),[[Nt,a.value.tipo]])]),a.value.tipo==="telegram"?(v(),b("div",fm,[g[28]||(g[28]=r("label",{class:"label"},"Bot token (de @BotFather)",-1)),z(r("input",{"onUpdate:modelValue":g[1]||(g[1]=x=>a.value.bot_token=x),type:"password",required:"",class:"input"},null,512),[[re,a.value.bot_token]])])):a.value.tipo==="correo"?(v(),b(Z,{key:1},[g[41]||(g[41]=r("p",{class:"text-xs text-tenue"},[Y(" El agente va a leer esta casilla y "),r("strong",null,"responder solo"),Y(" los correos que lleguen, con su base de conocimiento. Ignora newsletters y correos automáticos. ")],-1)),r("div",pm,[r("div",null,[g[29]||(g[29]=r("label",{class:"label"},"Correo",-1)),z(r("input",{"onUpdate:modelValue":g[2]||(g[2]=x=>a.value.usuario=x),type:"email",required:"",placeholder:"ventas@tunegocio.com",class:"input"},null,512),[[re,a.value.usuario]])]),r("div",null,[g[30]||(g[30]=r("label",{class:"label"},"Contraseña",-1)),z(r("input",{"onUpdate:modelValue":g[3]||(g[3]=x=>a.value.password=x),type:"password",autocomplete:"new-password",required:"",class:"input"},null,512),[[re,a.value.password]])])]),r("div",null,[g[32]||(g[32]=r("label",{class:"label"},"Revisar la casilla cada",-1)),z(r("select",{"onUpdate:modelValue":g[4]||(g[4]=x=>a.value.intervalo_minutos=x),class:"input"},[...g[31]||(g[31]=[r("option",{value:2},"2 minutos — respuesta casi inmediata",-1),r("option",{value:5},"5 minutos",-1),r("option",{value:15},"15 minutos",-1),r("option",{value:30},"30 minutos",-1),r("option",{value:60},"1 hora",-1)])],512),[[Nt,a.value.intervalo_minutos]]),g[33]||(g[33]=r("p",{class:"text-xs text-tenue mt-1"},"Un correo no es un chat: para la mayoría, 5 o 15 minutos sobra.",-1))]),r("div",null,[g[37]||(g[37]=r("label",{class:"label"},"Responder a",-1)),r("div",mm,[r("label",vm,[z(r("input",{"onUpdate:modelValue":g[5]||(g[5]=x=>a.value.responder_a=x),type:"radio",value:"todos",class:"text-brand focus:ring-brand"},null,512),[[zs,a.value.responder_a]]),g[34]||(g[34]=Y(" Todos los que escriban ",-1))]),r("label",hm,[z(r("input",{"onUpdate:modelValue":g[6]||(g[6]=x=>a.value.responder_a=x),type:"radio",value:"algunos",class:"text-brand focus:ring-brand"},null,512),[[zs,a.value.responder_a]]),g[35]||(g[35]=Y(" Solo a estos remitentes ",-1))])]),a.value.responder_a==="algunos"?(v(),b(Z,{key:0},[z(r("textarea",{"onUpdate:modelValue":g[7]||(g[7]=x=>a.value.filtro_remitentes=x),rows:"3",required:"",placeholder:`juan@cliente.com, @miempresa.com
|
|
Direcciones completas o dominios, separados por coma.`,class:"input font-mono mt-2"},null,512),[[re,a.value.filtro_remitentes]]),g[36]||(g[36]=r("p",{class:"text-xs text-tenue mt-1"},[Y(" Un dominio (ej. "),r("span",{class:"font-mono"},"@miempresa.com"),Y(") habilita a todos los de esa empresa. El resto de los correos se ignoran sin responder. ")],-1))],64)):V("",!0)]),r("details",gm,[g[40]||(g[40]=r("summary",{class:"cursor-pointer"},"Servidores (solo si la detección automática falla)",-1)),r("div",bm,[r("div",null,[g[38]||(g[38]=r("label",{class:"label"},"Servidor IMAP",-1)),z(r("input",{"onUpdate:modelValue":g[8]||(g[8]=x=>a.value.imap_host=x),placeholder:"mail.tunegocio.com",class:"input font-mono"},null,512),[[re,a.value.imap_host]])]),r("div",null,[g[39]||(g[39]=r("label",{class:"label"},"Servidor SMTP",-1)),z(r("input",{"onUpdate:modelValue":g[9]||(g[9]=x=>a.value.smtp_host=x),placeholder:"mail.tunegocio.com",class:"input font-mono"},null,512),[[re,a.value.smtp_host]])])])])],64)):(v(),b(Z,{key:2},[r("div",null,[g[42]||(g[42]=r("label",{class:"label"},"Phone Number ID",-1)),z(r("input",{"onUpdate:modelValue":g[10]||(g[10]=x=>a.value.phone_number_id=x),required:"",class:"input"},null,512),[[re,a.value.phone_number_id]])]),r("div",null,[g[43]||(g[43]=r("label",{class:"label"},"Access Token",-1)),z(r("input",{"onUpdate:modelValue":g[11]||(g[11]=x=>a.value.access_token=x),type:"password",required:"",class:"input"},null,512),[[re,a.value.access_token]])]),r("div",null,[g[44]||(g[44]=r("label",{class:"label"},"App Secret",-1)),z(r("input",{"onUpdate:modelValue":g[12]||(g[12]=x=>a.value.app_secret=x),type:"password",required:"",class:"input"},null,512),[[re,a.value.app_secret]])]),r("div",null,[g[45]||(g[45]=r("label",{class:"label"},"Verify Token (lo inventás vos, lo vas a usar en Meta)",-1)),z(r("input",{"onUpdate:modelValue":g[13]||(g[13]=x=>a.value.verify_token=x),required:"",class:"input"},null,512),[[re,a.value.verify_token]])])],64)),r("div",xm,[r("label",ym,[z(r("input",{type:"checkbox","onUpdate:modelValue":g[14]||(g[14]=x=>a.value.es_interno=x),class:"mt-0.5 rounded border-borde text-brand focus:ring-brand"},null,512),[[st,a.value.es_interno]]),g[46]||(g[46]=r("span",null,[Y(" Este canal es mío, no de mis clientes "),r("span",{class:"block text-xs text-tenue mt-0.5"}," Marcalo si acá te escribís solo vos. El asistente va a poder programarte recordatorios y ejecutar acciones sin pedir permiso. En los canales donde escriben tus clientes, todo lo que salga hacia afuera espera tu visto bueno. ")],-1))])]),r("div",_m,[r("label",wm,[z(r("input",{type:"checkbox","onUpdate:modelValue":g[15]||(g[15]=x=>a.value.usar_whisper_audio=x),class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[st,a.value.usar_whisper_audio]]),g[47]||(g[47]=Y(" Transcribir audios con Whisper ",-1))]),r("label",km,[z(r("input",{type:"checkbox","onUpdate:modelValue":g[16]||(g[16]=x=>a.value.usar_ocr_imagenes=x),class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[st,a.value.usar_ocr_imagenes]]),g[48]||(g[48]=Y(" Leer texto de imágenes con OCR ",-1))]),r("label",$m,[z(r("input",{type:"checkbox","onUpdate:modelValue":g[17]||(g[17]=x=>a.value.usar_archivos_docs=x),class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[st,a.value.usar_archivos_docs]]),g[49]||(g[49]=Y(" Leer archivos adjuntos (PDF, Word, texto) ",-1))])]),r("div",Cm,[r("button",{type:"button",class:"btn-ghost",onClick:g[18]||(g[18]=x=>o.value=!1)},"Cancelar"),g[50]||(g[50]=r("button",{type:"submit",class:"btn-primary"},"Guardar",-1))])],32)])])):V("",!0)]))}},Sm={class:"card p-1 mb-6 flex flex-wrap"},Em=["onClick"],Im={class:"text-red-700 dark:text-red-400 font-medium"},Rm={__name:"EstadoAgente",props:{canales:{type:Array,default:()=>[]},documentos:{type:Array,default:()=>[]},sesiones:{type:Array,default:()=>[]},eventos:{type:Array,default:()=>[]}},emits:["ir"],setup(e,{emit:t}){const n=e,s=t,o=le(()=>n.canales.filter(f=>f.activo)),a={whatsapp:"WhatsApp",telegram:"Telegram",web:"tu web",correo:"tu correo"},l=f=>a[f]||f,i=le(()=>n.documentos.filter(f=>f.estado==="listo")),u=le(()=>i.value.filter(f=>f.procesado_at&&Date.now()-new Date(f.procesado_at)>60*864e5)),d=le(()=>n.eventos.filter(f=>f.nivel==="error").length),c=le(()=>n.sesiones.filter(f=>!String(f.session_id).startsWith("staff-preview"))),p=le(()=>[{clave:"canales",icono:"mensaje",bien:o.value.length>0,texto:o.value.length?`Atendiendo en ${o.value.map(f=>l(f.tipo)).join(" y ")}`:"No está atendiendo en ningún lado",destino:"canales"},{clave:"conocimiento",icono:"escribir",bien:i.value.length>0&&u.value.length===0,texto:i.value.length?u.value.length?`${u.value.length} de ${i.value.length} fuentes están viejas`:`Sabe de ${i.value.length} ${i.value.length===1?"cosa":"cosas"}`:"Todavía no sabe nada de tu negocio",destino:"conocimiento"},{clave:"conversaciones",icono:"grafico",bien:!0,neutro:c.value.length===0,texto:c.value.length?`${c.value.length} ${c.value.length===1?"conversación":"conversaciones"}`:"Nadie escribió todavía",destino:"conversaciones"}]);return(f,_)=>(v(),b("div",Sm,[(v(!0),b(Z,null,ce(p.value,k=>(v(),b("button",{key:k.clave,class:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm hover:bg-elevado transition-colors text-left",onClick:A=>s("ir",k.destino)},[ne(Ne,{nombre:k.bien?k.icono:"alerta",tam:16,class:ie(k.neutro?"text-tenue":k.bien?"text-brand":"text-amber-600 dark:text-amber-400")},null,8,["nombre","class"]),r("span",{class:ie(k.neutro?"text-tenue":k.bien?"text-texto":"text-amber-700 dark:text-amber-400 font-medium")},S(k.texto),3)],8,Em))),128)),d.value?(v(),b("button",{key:0,class:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm hover:bg-elevado transition-colors ml-auto",onClick:_[0]||(_[0]=k=>s("ir","auditoria"))},[ne(Ne,{nombre:"alerta",tam:16,class:"text-red-600 dark:text-red-400"}),r("span",Im,S(d.value)+" "+S(d.value===1?"problema":"problemas"),1)])):V("",!0)]))}},Pm={class:"card p-5 mb-6"},Dm={class:"flex items-start gap-4"},Tm={class:"min-w-0 flex-1"},Om={class:"flex items-baseline justify-between gap-3"},Mm={class:"text-xs text-tenue tabular-nums shrink-0"},Nm={class:"space-y-2.5"},jm={class:"min-w-0 flex-1"},Vm={key:0,class:"text-xs text-tenue mt-0.5"},Um=["onClick"],Lm={__name:"PrimerosPasos",props:{documentos:{type:Array,default:()=>[]},canales:{type:Array,default:()=>[]},sesiones:{type:Array,default:()=>[]}},emits:["ir"],setup(e,{emit:t}){const n=e,s=t,o=le(()=>n.documentos.some(c=>c.estado==="listo")),a=le(()=>n.sesiones.some(c=>String(c.session_id).startsWith("staff-preview"))),l=le(()=>n.canales.some(c=>c.activo)),i=le(()=>[{n:1,hecho:o.value,titulo:"Contale de tu negocio",detalle:"Escribí tus horarios, precios y lo que te preguntan siempre — o subí tu lista de precios, o dale tu sitio web.",accion:"Cargar información",destino:"conocimiento"},{n:2,hecho:a.value,titulo:"Hacele una pregunta",detalle:"Preguntale algo como lo haría un cliente. Si contesta mal, corregí su información y probá de nuevo.",accion:"Probarlo",destino:"conocimiento"},{n:3,hecho:l.value,titulo:"Ponelo a atender",detalle:"Conectá tu WhatsApp o Telegram, o pegá el widget en tu web. Desde ese momento responde solo.",accion:"Elegir dónde",destino:"canales"}]),u=le(()=>i.value.filter(c=>c.hecho).length),d=le(()=>{var c;return((c=i.value.find(p=>!p.hecho))==null?void 0:c.n)??null});return(c,p)=>(v(),b("div",Pm,[r("div",Dm,[ne(Vn,{estado:u.value===0?"durmiendo":"contenta",tam:52,class:"text-brand shrink-0 hidden sm:block"},null,8,["estado"]),r("div",Tm,[r("div",Om,[p[0]||(p[0]=r("h2",{class:"font-semibold text-texto"},"Pongamos a andar tu asistente",-1)),r("span",Mm,S(u.value)+" de "+S(i.value.length),1)]),p[1]||(p[1]=r("p",{class:"text-sm text-tenue mt-0.5 mb-4"}," Tres pasos y empieza a responderle a tus clientes. Diez minutos, sin nada técnico. ",-1)),r("ol",Nm,[(v(!0),b(Z,null,ce(i.value,f=>(v(),b("li",{key:f.n,class:ie(["flex items-start gap-3 rounded-lg p-2.5 -m-0.5 transition-colors",f.n===d.value?"bg-brand/5 border border-brand/30":""])},[r("span",{class:ie(["w-6 h-6 rounded-full flex items-center justify-center text-xs font-semibold shrink-0 mt-0.5",f.hecho?"bg-brand text-white":f.n===d.value?"border-2 border-brand text-brand":"border border-borde text-tenue"])},[f.hecho?(v(),de(Ne,{key:0,nombre:"ok",tam:13})):(v(),b(Z,{key:1},[Y(S(f.n),1)],64))],2),r("div",jm,[r("p",{class:ie(["text-sm font-medium",f.hecho?"text-tenue line-through":"text-texto"])},S(f.titulo),3),f.hecho?V("",!0):(v(),b("p",Vm,S(f.detalle),1))]),!f.hecho&&f.n===d.value?(v(),b("button",{key:0,class:"btn-primary !py-1.5 !px-3 text-sm shrink-0",onClick:_=>s("ir",f.destino)},S(f.accion),9,Um)):V("",!0)],2))),128))])])])]))}},qm={key:0,class:"mb-4 mt-1 flex items-start justify-between gap-4"},Fm={class:"text-xl font-semibold text-texto min-w-0 truncate"},Hm=["href"],Bm={key:3,class:"text-sm text-red-600 dark:text-red-400 mb-4"},Wm={class:"flex items-center gap-1.5 mb-6 flex-wrap"},Gm=["onClick"],zm={class:"text-[10px]"},Km={key:4,class:"flex gap-1.5 mb-6 flex-wrap -mt-3"},Qm=["onClick"],Jm={key:5,class:"flex gap-1.5 mb-6 flex-wrap"},Ym=["onClick"],Zm={key:6,class:"grid gap-4 lg:grid-cols-[1fr_21rem] items-start"},Xm={class:"card p-4 mb-4"},ev={class:"flex gap-1 mb-3"},tv=["onClick"],nv={class:"flex items-center justify-between"},sv=["disabled"],ov={class:"flex items-center justify-between"},av=["disabled"],rv={class:"flex gap-2"},lv={class:"flex items-center justify-between"},iv={class:"flex items-center gap-2 text-xs text-tenue cursor-pointer"},uv=["disabled"],cv={class:"card divide-y divide-borde"},dv={class:"text-sm text-texto"},fv={class:"text-xs text-tenue mt-0.5"},pv={key:0,class:"latido"},mv={key:0},vv={key:1},hv={key:3},gv={key:4,class:"text-red-600 dark:text-red-400"},bv={class:"flex items-center gap-3 shrink-0"},xv=["title","onClick"],yv=["disabled","onClick"],_v=["onClick"],wv=["disabled","title","onClick"],kv=["onClick"],$v={class:"lg:sticky lg:top-4"},Cv={class:"card w-full max-w-2xl p-6 max-h-[calc(100vh-2rem)] overflow-y-auto"},Av={class:"flex items-baseline justify-between gap-3 mb-1"},Sv={class:"font-semibold text-texto truncate"},Ev={class:"text-xs text-tenue shrink-0 tabular-nums"},Iv={key:0,class:"text-sm text-tenue"},Rv={key:1,class:"space-y-2"},Pv={class:"text-[10px] text-tenue tabular-nums block mb-1"},Dv={class:"flex justify-end pt-4"},Tv={class:"card w-full max-w-2xl p-6 max-h-[calc(100vh-2rem)] overflow-y-auto"},Ov={class:"flex justify-end gap-2 pt-1"},Mv=["disabled"],Nv={__name:"AgenteDetail",props:{tenantId:{type:String,required:!0},agenteId:{type:String,required:!0}},setup(e){const t=e,n=le(()=>Number(t.agenteId)),s=zr(),o=j(null),a=j(""),l=j(typeof s.query.tab=="string"?s.query.tab:Ye.esPortal?"conversaciones":"conocimiento"),i=j([]),u=j(""),d=j(30),c=j(!1);async function p(){const R=await Q.get(K(`/umind/agentes?tenant_id=${t.tenantId}`));o.value=(R.items||[]).find(E=>String(E.ID)===t.agenteId)||null}async function f(){const R=await Q.get(K(`/umind/documentos?agente_id=${t.agenteId}`));i.value=R.items||[]}const _=j("texto"),k=j(!0),A=j(""),I=j(""),y=j(null);async function w(){if(u.value.trim()){c.value=!0,a.value="";try{await Q.post(K("/umind/documentos"),{agente_id:n.value,url:u.value.trim(),max_paginas:Number(d.value)||30,auto_actualizar:k.value}),u.value="",await f()}catch(R){a.value=R.message}finally{c.value=!1}}}async function g(){if(I.value.trim()){c.value=!0,a.value="";try{await Q.post(K("/umind/documentos/texto"),{agente_id:n.value,titulo:A.value.trim(),contenido:I.value}),A.value="",I.value="",await f()}catch(R){a.value=R.message}finally{c.value=!1}}}async function x(){var E,L;const R=(L=(E=y.value)==null?void 0:E.files)==null?void 0:L[0];if(R){c.value=!0,a.value="";try{const N=new FormData;N.append("agente_id",String(n.value)),N.append("archivo",R);const P=await fetch(K("/umind/documentos/archivo"),{method:"POST",body:N}),q=await P.json();if(!P.ok)throw new Error(q.error||"No se pudo subir");y.value.value="",await f()}catch(N){a.value=N.message}finally{c.value=!1}}}const $=j(null),U=j([]),F=j(!1);async function H(R){$.value=R,U.value=[],F.value=!0;try{const E=await Q.get(K(`/umind/documentos/${R.ID}/fragmentos`));U.value=E.items||[]}catch(E){a.value=E.message,$.value=null}finally{F.value=!1}}const me=j(null),te=j({titulo:"",contenido:""}),B=j(!1);function Pe(R){me.value=R,te.value={titulo:R.origen,contenido:R.contenido||""}}async function J(){if(me.value){B.value=!0,a.value="";try{await Q.put(K(`/umind/documentos/${me.value.ID}`),{titulo:te.value.titulo,contenido:te.value.contenido}),me.value=null,await f()}catch(R){a.value=R.message}finally{B.value=!1}}}async function ze(R){a.value="";try{await Q.post(K(`/umind/documentos/${R.ID}/reprocesar`),{}),await f()}catch(E){a.value=E.message}}async function Vt(R){try{await Q.put(K(`/umind/documentos/${R.ID}`),{auto_actualizar:!R.auto_actualizar}),await f()}catch(E){a.value=E.message}}function Se(R){if(!R)return"sin procesar";const E=Math.floor((Date.now()-new Date(R))/864e5);if(E<=0)return"hoy";if(E===1)return"ayer";if(E<30)return`hace ${E} días`;const L=Math.floor(E/30);return L===1?"hace un mes":`hace ${L} meses`}function ve(R){return R.procesado_at?Date.now()-new Date(R.procesado_at)>60*864e5:!1}async function pe(R){confirm("¿Eliminar esta fuente y sus fragmentos indexados?")&&(await Q.del(K(`/umind/documentos/${R}`)),await f())}const at=le(()=>R=>({listo:"badge-ok",procesando:"badge-alerta",pendiente:"badge-neutro",error:"badge-error"})[R]||"badge-neutro"),Ke=j([]);async function nt(){const R=await Q.get(K(`/umind/sesiones?agente_id=${t.agenteId}`));Ke.value=R.items||[]}const De=j([]);async function $t(){const R=await Q.get(K(`/umind/tools?agente_id=${t.agenteId}`));De.value=R.items||[]}const Ze=j([]);async function pt(){const R=await Q.get(K(`/umind/canales?agente_id=${t.agenteId}`));Ze.value=R.items||[]}const Qe=le(()=>{const R=new Date,E=new Date(R.getFullYear(),R.getMonth(),1).toISOString().slice(0,10),L=R.toISOString().slice(0,10);return K(`/umind/reporte.xlsx?agente_id=${t.agenteId}&desde=${E}&hasta=${L}`)}),O=j([]);async function G(){const R=await Q.get(K(`/umind/conexiones?agente_id=${t.agenteId}`));O.value=R.items||[]}const W=[["conversaciones","Conversaciones"],["conocimiento","Lo que sabe"],["acciones","Lo que hace"],["canales","Dónde atiende"]],ee=[["conocimiento","Información"],["conexiones","Cuentas de correo"],["herramientas","Herramientas"]],ue=le(()=>ee.some(([R])=>R===l.value)),m=[["auditoria","Problemas"]],h=le(()=>!i.value.some(R=>R.estado==="listo")||!Ze.value.some(R=>R.activo)),C=j(!1);m.some(([R])=>R===l.value)&&(C.value=!0);function T(R){l.value=R,m.some(([E])=>E===R)&&(C.value=!0)}const M=j([]);async function D(){const R=await Q.get(K(`/umind/eventos?agente_id=${t.agenteId}`));M.value=R.items||[]}return Ge(()=>[t.tenantId,t.agenteId],async()=>{a.value="",o.value=null,i.value=[],Ke.value=[],De.value=[],Ze.value=[],O.value=[],M.value=[];try{await Promise.all([p(),f(),nt(),$t(),pt(),G(),D()])}catch(R){a.value=R.message}},{immediate:!0}),(R,E)=>{var N;const L=Wt("router-link");return v(),b("div",null,[ne(L,{to:`/tenants/${e.tenantId}`,class:"label hover:text-brand"},{default:dt(()=>[...E[14]||(E[14]=[Y("← Agentes",-1)])]),_:1},8,["to"]),o.value?(v(),b("div",qm,[r("h1",Fm,S(o.value.nombre),1),r("a",{href:Qe.value,class:"btn-ghost shrink-0",title:"Conversaciones y consumo del mes en Excel"},[ne(Ne,{nombre:"descargar",tam:15}),E[15]||(E[15]=Y(" Reporte del mes ",-1))],8,Hm)])):V("",!0),o.value&&h.value?(v(),de(Lm,{key:1,documentos:i.value,canales:Ze.value,sesiones:Ke.value,onIr:T},null,8,["documentos","canales","sesiones"])):o.value?(v(),de(Rm,{key:2,canales:Ze.value,documentos:i.value,sesiones:Ke.value,eventos:M.value,onIr:T},null,8,["canales","documentos","sesiones","eventos"])):V("",!0),a.value?(v(),b("p",Bm,S(a.value),1)):V("",!0),r("div",Wm,[(v(),b(Z,null,ce(W,([P,q])=>r("button",{key:P,class:ie(["px-3.5 py-1.5 rounded-full text-sm whitespace-nowrap transition-colors",(P==="conocimiento"?ue.value:l.value===P)?"bg-brand text-white font-medium":"bg-white dark:bg-gray-900 text-gray-600 dark:text-gray-400 border border-borde hover:border-brand/50"]),onClick:X=>l.value=P},S(q),11,Gm)),64)),r("button",{class:"ml-auto text-xs text-tenue hover:text-texto inline-flex items-center gap-1",onClick:E[0]||(E[0]=P=>C.value=!C.value)},[E[16]||(E[16]=Y(" Avanzado ",-1)),r("span",zm,S(C.value?"▲":"▼"),1)])]),ue.value?(v(),b("div",Km,[(v(),b(Z,null,ce(ee,([P,q])=>r("button",{key:P,class:ie(["px-3 py-1 rounded-full text-xs whitespace-nowrap transition-colors",l.value===P?"bg-brand/15 text-brand font-medium border border-brand/40":"text-tenue border border-transparent hover:text-texto"]),onClick:X=>l.value=P},S(q),11,Qm)),64))])):V("",!0),C.value?(v(),b("div",Jm,[(v(),b(Z,null,ce(m,([P,q])=>r("button",{key:P,class:ie(["px-3 py-1 rounded-full text-xs whitespace-nowrap transition-colors",l.value===P?"bg-texto text-white dark:bg-gray-200 dark:text-gray-900 font-medium":"bg-white dark:bg-gray-900 text-tenue border border-borde hover:border-brand/50"]),onClick:X=>l.value=P},S(q),11,Ym)),64))])):V("",!0),l.value==="conocimiento"?(v(),b("div",Zm,[r("div",null,[r("div",Xm,[r("div",ev,[(v(),b(Z,null,ce([["texto","escribir","Escribir"],["archivo","archivo","Subir archivo"],["url","sitio","Sitio web"]],([P,q,X])=>r("button",{key:P,class:ie(["px-3 py-1.5 rounded-lg text-sm inline-flex items-center gap-1.5",_.value===P?"bg-brand text-white font-medium":"text-tenue hover:text-texto"]),onClick:oe=>_.value=P},[ne(Ne,{nombre:q,tam:15},null,8,["nombre"]),Y(" "+S(X),1)],10,tv)),64))]),_.value==="texto"?(v(),b("form",{key:0,class:"space-y-2",onSubmit:Ae(g,["prevent"])},[z(r("input",{"onUpdate:modelValue":E[1]||(E[1]=P=>A.value=P),placeholder:"Título (ej: Horarios y zonas de entrega)",class:"input"},null,512),[[re,A.value]]),z(r("textarea",{"onUpdate:modelValue":E[2]||(E[2]=P=>I.value=P),rows:"5",required:"",placeholder:"Atendemos de lunes a viernes de 9 a 18. No hacemos envíos fuera de la ciudad. La garantía es de 6 meses y cubre…",class:"input font-normal"},null,512),[[re,I.value]]),r("div",nv,[E[17]||(E[17]=r("p",{class:"text-xs text-tenue"},"Lo que te preguntan todos los días y no está en tu web.",-1)),r("button",{type:"submit",disabled:c.value,class:"btn-primary disabled:opacity-50"},S(c.value?"Guardando…":"Guardar"),9,sv)])],32)):_.value==="archivo"?(v(),b("form",{key:1,class:"space-y-2",onSubmit:Ae(x,["prevent"])},[r("input",{ref_key:"archivoRef",ref:y,type:"file",accept:".pdf,.docx,.txt,.md,.csv,.html,image/*",class:"text-sm text-texto"},null,512),r("div",ov,[E[18]||(E[18]=r("p",{class:"text-xs text-tenue"},"PDF, Word, texto o una foto. Ej: tu lista de precios.",-1)),r("button",{type:"submit",disabled:c.value,class:"btn-primary disabled:opacity-50"},S(c.value?"Leyendo…":"Subir"),9,av)])],32)):(v(),b("form",{key:2,class:"space-y-2",onSubmit:Ae(w,["prevent"])},[r("div",rv,[z(r("input",{"onUpdate:modelValue":E[3]||(E[3]=P=>u.value=P),type:"url",placeholder:"https://ejemplo.com",required:"",class:"input flex-1"},null,512),[[re,u.value]]),z(r("input",{"onUpdate:modelValue":E[4]||(E[4]=P=>d.value=P),type:"number",min:"1",max:"200",class:"input w-24",title:"Máximo de páginas a leer"},null,512),[[re,d.value]])]),r("div",lv,[r("label",iv,[z(r("input",{"onUpdate:modelValue":E[5]||(E[5]=P=>k.value=P),type:"checkbox",class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[st,k.value]]),E[19]||(E[19]=Y(" Releer el sitio cada semana ",-1))]),r("button",{type:"submit",disabled:c.value,class:"btn-primary disabled:opacity-50"},S(c.value?"Leyendo…":"Leer sitio"),9,uv)])],32))]),r("div",cv,[i.value.length===0?(v(),de(qe,{key:0,estado:"buscando",titulo:"Todavía no sabe nada de tu negocio",detalle:"Sin información cargada va a contestar que no sabe. Empezá por escribir tus horarios y lo que te preguntan todos los días — es lo más rápido y lo que más se nota."})):V("",!0),(v(!0),b(Z,null,ce(i.value,P=>(v(),b("div",{key:P.ID,class:"p-4 flex items-center justify-between"},[r("div",null,[r("div",dv,S(P.origen),1),r("div",fv,[r("span",{class:ie(["px-1.5 py-0.5 rounded inline-flex items-center gap-1",at.value(P.estado)])},[P.estado==="procesando"?(v(),b("span",pv)):V("",!0),Y(" "+S(P.estado),1)],2),P.tipo?(v(),b("span",mv," · "+S({url:"sitio",archivo:"archivo",texto:"nota"}[P.tipo]||P.tipo),1)):V("",!0),P.total_chunks?(v(),b("span",vv," · "+S(P.total_chunks)+" fragmentos",1)):V("",!0),P.procesado_at?(v(),b("span",{key:2,class:ie(ve(P)?"text-amber-600 dark:text-amber-400 font-medium":"")}," · leído "+S(Se(P.procesado_at)),3)):V("",!0),P.auto_actualizar?(v(),b("span",hv," · se actualiza sola")):V("",!0),P.error?(v(),b("span",gv," · "+S(P.error),1)):V("",!0)])]),r("div",bv,[P.tipo==="url"?(v(),b("button",{key:0,class:"text-xs text-tenue hover:text-texto",title:P.auto_actualizar?"Dejar de releer sola":"Releer el sitio cada semana",onClick:q=>Vt(P)},[ne(Ne,{nombre:P.auto_actualizar?"auto":"refrescar",tam:13,class:"mr-1"},null,8,["nombre"]),Y(S(P.auto_actualizar?"auto":"manual"),1)],8,xv)):V("",!0),r("button",{class:ie(["text-sm text-tenue hover:text-texto",P.total_chunks?"":"opacity-40 cursor-default"]),disabled:!P.total_chunks,title:"Ver qué se leyó de esta fuente",onClick:q=>H(P)},"Ver",10,yv),P.tipo==="texto"||P.tipo==="archivo"?(v(),b("button",{key:1,class:"text-sm text-brand hover:underline",onClick:q=>Pe(P)},"Editar",8,_v)):V("",!0),r("button",{class:"text-sm text-tenue hover:text-texto disabled:opacity-40",disabled:P.estado==="procesando",title:P.tipo==="url"?"Volver a leer el sitio":"Rehacer los fragmentos",onClick:q=>ze(P)},"Actualizar",8,wv),r("button",{class:"text-red-500 hover:text-red-700 text-sm",onClick:q=>pe(P.ID)},"Eliminar",8,kv)])]))),128))])]),r("div",$v,[E[20]||(E[20]=r("p",{class:"label mb-2"},"Probalo",-1)),ne(_a,{"agente-id":n.value},null,8,["agente-id"])]),$.value?(v(),b("div",{key:0,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:E[7]||(E[7]=Ae(P=>$.value=null,["self"]))},[r("div",Cv,[r("div",Av,[r("h2",Sv,S($.value.origen),1),r("span",Ev,S(U.value.length)+" "+S(U.value.length===1?"fragmento":"fragmentos"),1)]),E[21]||(E[21]=r("p",{class:"text-xs text-tenue mb-4"}," Esto es exactamente lo que el asistente puede consultar de esta fuente. Si acá falta algo o se leyó mal, eso mismo le va a faltar en las respuestas. ",-1)),F.value?(v(),b("p",Iv,"Cargando…")):(v(),b("div",Rv,[(v(!0),b(Z,null,ce(U.value,(P,q)=>(v(),b("div",{key:P.ID,class:"bg-elevado border border-borde rounded-lg p-3 text-sm text-texto whitespace-pre-wrap"},[r("span",Pv,"#"+S(q+1),1),Y(S(P.contenido),1)]))),128))])),r("div",Dv,[r("button",{class:"btn-ghost",onClick:E[6]||(E[6]=P=>$.value=null)},"Cerrar")])])])):V("",!0),me.value?(v(),b("div",{key:1,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:E[11]||(E[11]=Ae(P=>me.value=null,["self"]))},[r("div",Tv,[E[25]||(E[25]=r("h2",{class:"font-semibold text-texto mb-1"},"Editar fuente",-1)),E[26]||(E[26]=r("p",{class:"text-xs text-tenue mb-4"}," Al guardar se vuelve a leer y el agente empieza a contestar con esto. ",-1)),r("form",{class:"space-y-3",onSubmit:Ae(J,["prevent"])},[r("div",null,[E[22]||(E[22]=r("label",{class:"label"},"Título",-1)),z(r("input",{"onUpdate:modelValue":E[8]||(E[8]=P=>te.value.titulo=P),required:"",class:"input"},null,512),[[re,te.value.titulo]])]),r("div",null,[E[23]||(E[23]=r("label",{class:"label"},"Contenido",-1)),z(r("textarea",{"onUpdate:modelValue":E[9]||(E[9]=P=>te.value.contenido=P),rows:"16",required:"",class:"input font-normal leading-relaxed"},null,512),[[re,te.value.contenido]]),E[24]||(E[24]=r("p",{class:"text-xs text-tenue mt-1.5"}," Si viene de una plantilla, reemplazá lo que está [entre corchetes] por tus datos. Lo que quede sin reemplazar el agente lo va a leer tal cual. ",-1))]),r("div",Ov,[r("button",{type:"button",class:"btn-ghost",onClick:E[10]||(E[10]=P=>me.value=null)},"Cancelar"),r("button",{type:"submit",class:"btn-primary",disabled:B.value},S(B.value?"Guardando…":"Guardar y volver a leer"),9,Mv)])],32)])])):V("",!0)])):l.value==="herramientas"?(v(),de(Fp,{key:7,"agente-id":n.value,tools:De.value,onRecargar:$t,onError:E[12]||(E[12]=P=>a.value=P)},null,8,["agente-id","tools"])):l.value==="canales"?(v(),de(Am,{key:8,"agente-id":n.value,"site-key":((N=o.value)==null?void 0:N.site_key)||"",canales:Ze.value,onRecargar:pt,onError:E[13]||(E[13]=P=>a.value=P)},null,8,["agente-id","site-key","canales"])):l.value==="conexiones"?(v(),de(tp,{key:9,"agente-id":n.value,conexiones:O.value,onRecargar:G},null,8,["agente-id","conexiones"])):l.value==="chat"?(v(),de(_a,{key:10,"agente-id":n.value},null,8,["agente-id"])):l.value==="conversaciones"?(v(),de(bp,{key:11,"agente-id":n.value,sesiones:Ke.value},null,8,["agente-id","sesiones"])):l.value==="acciones"?(v(),de(Lf,{key:12,"agente-id":n.value},null,8,["agente-id"])):(v(),de(_f,{key:13,eventos:M.value},null,8,["eventos"]))])}}},jv={class:"flex items-start justify-between gap-4 mb-6"},Vv={class:"card p-4 mb-4"},Uv={class:"flex flex-wrap items-end gap-3"},Lv={class:"flex gap-1 ml-auto"},qv={key:0,class:"text-sm text-red-600 dark:text-red-400 mb-4"},Fv={key:1,class:"text-sm text-tenue"},Hv={class:"grid gap-3 sm:grid-cols-3 mb-4"},Bv={class:"card p-4"},Wv={class:"text-2xl font-semibold text-texto mt-1 tabular-nums"},Gv={class:"card p-4"},zv={class:"text-2xl font-semibold text-texto mt-1 tabular-nums"},Kv={class:"card p-4"},Qv={class:"text-lg font-semibold text-texto mt-1"},Jv={key:0,class:"text-[11px] text-tenue mt-0.5"},Yv={key:0,class:"card p-4 mb-4"},Zv={class:"flex items-center justify-between text-sm mb-2"},Xv={class:"text-tenue tabular-nums"},eh={class:"h-2 rounded-full bg-elevado overflow-hidden"},th={key:0,class:"text-xs text-amber-600 dark:text-amber-400 mt-2"},nh={class:"card divide-y divide-borde mb-4"},sh={class:"min-w-0 flex-1"},oh={class:"text-sm text-texto"},ah={class:"text-xs text-tenue tabular-nums"},rh={key:0,class:"text-sm font-medium text-texto tabular-nums"},lh={key:1,class:"text-xs text-tenue text-right leading-tight"},ih={key:1,class:"card p-4"},uh={class:"flex items-end gap-1 h-28"},ch=["title"],dh={class:"flex justify-between text-[11px] text-tenue mt-2"},fh={__name:"Uso",props:{id:{type:String,required:!0}},setup(e){const t=e,n=j(!0),s=j(""),o=j(null),a=new Date,l=j(new Date(a.getFullYear(),a.getMonth(),1).toISOString().slice(0,10)),i=j(a.toISOString().slice(0,10)),u={ia:{nombre:"Inteligencia artificial",icono:"cerebro",color:"#8eb02f"},ocr:{nombre:"Lectura de imágenes",icono:"imagen",color:"#2f7fb0"},whisper:{nombre:"Transcripción de audio",icono:"microfono",color:"#b0752f"}},d=x=>u[x]||{nombre:x,icono:"grafico",color:"#94a3b8"};async function c(){n.value=!0,s.value="";try{o.value=await Q.get(K(`/umind/uso?tenant_id=${t.id}&desde=${l.value}&hasta=${i.value}`))}catch(x){s.value=x.message}finally{n.value=!1}}const p=le(()=>{var x,$;return(($=(x=o.value)==null?void 0:x.plan)==null?void 0:$.moneda)||"COP"}),f=le(()=>{var x;return((x=o.value)==null?void 0:x.resumen)||[]}),_=le(()=>{var x;return((x=o.value)==null?void 0:x.total_periodo)||0}),k=le(()=>{var x,$;return(($=(x=o.value)==null?void 0:x.plan)==null?void 0:$.tope_consumo_mensual)||0}),A=le(()=>k.value?Math.min(100,_.value/k.value*100):0);function I(x){return`${p.value} ${Number(x||0).toLocaleString("es-CO",{maximumFractionDigits:2})}`}function y(x){return Number(x||0).toLocaleString("es-CO",{maximumFractionDigits:0})}const w=le(()=>{var F;const x=new Map;for(const H of((F=o.value)==null?void 0:F.detalle)||[]){const me=String(H.CreatedAt).slice(0,10);x.set(me,(x.get(me)||0)+(H.costo||0))}const $=[...x.entries()].sort((H,me)=>H[0].localeCompare(me[0])),U=Math.max(...$.map(H=>H[1]),0);return{dias:$,max:U}});function g(x){const $=new Date,U=new Date;U.setDate(U.getDate()-x),l.value=U.toISOString().slice(0,10),i.value=$.toISOString().slice(0,10),c()}return Ge(()=>t.id,c,{immediate:!0}),(x,$)=>{var F;const U=Wt("router-link");return v(),b("div",null,[ne(vn,{"tenant-id":e.id},null,8,["tenant-id"]),r("div",jv,[$[6]||($[6]=r("div",null,[r("h1",{class:"text-xl font-semibold text-texto"},"Consumo"),r("p",{class:"text-sm text-tenue mt-0.5"},"Lo que usaron tus agentes y cuánto cuesta.")],-1)),ne(U,{to:`/tenants/${e.id}`,class:"btn-ghost inline-flex items-center gap-1.5"},{default:dt(()=>[ne(Ne,{nombre:"atras",tam:15}),$[5]||($[5]=Y(" Agentes",-1))]),_:1},8,["to"])]),r("div",Vv,[r("div",Uv,[r("div",null,[$[7]||($[7]=r("label",{class:"label"},"Desde",-1)),z(r("input",{"onUpdate:modelValue":$[0]||($[0]=H=>l.value=H),type:"date",class:"input !w-auto"},null,512),[[re,l.value]])]),r("div",null,[$[8]||($[8]=r("label",{class:"label"},"Hasta",-1)),z(r("input",{"onUpdate:modelValue":$[1]||($[1]=H=>i.value=H),type:"date",class:"input !w-auto"},null,512),[[re,i.value]])]),r("button",{class:"btn-primary",onClick:c},"Aplicar"),r("div",Lv,[r("button",{class:"btn-ghost !px-2.5 !py-1 !text-xs",onClick:$[2]||($[2]=H=>g(6))},"7 días"),r("button",{class:"btn-ghost !px-2.5 !py-1 !text-xs",onClick:$[3]||($[3]=H=>g(29))},"30 días"),r("button",{class:"btn-ghost !px-2.5 !py-1 !text-xs",onClick:$[4]||($[4]=H=>g(89))},"90 días")])])]),s.value?(v(),b("p",qv,S(s.value),1)):V("",!0),n.value?(v(),b("p",Fv,"Cargando…")):o.value?(v(),b(Z,{key:2},[r("div",Hv,[r("div",Bv,[$[9]||($[9]=r("p",{class:"text-xs text-tenue"},"Consumo del período",-1)),r("p",Wv,S(I(_.value)),1)]),r("div",Gv,[$[10]||($[10]=r("p",{class:"text-xs text-tenue"},"Pendiente de facturar",-1)),r("p",zv,S(I(o.value.pendiente_facturar)),1),$[11]||($[11]=r("p",{class:"text-[11px] text-tenue mt-0.5"},"Se suma a tu próxima factura.",-1))]),r("div",Kv,[$[12]||($[12]=r("p",{class:"text-xs text-tenue"},"Plan",-1)),r("p",Qv,S(((F=o.value.plan)==null?void 0:F.nombre)||"Sin plan"),1),o.value.plan?(v(),b("p",Jv," Mensualidad "+S(I(o.value.plan.precio_mensual)),1)):V("",!0)])]),k.value?(v(),b("div",Yv,[r("div",Zv,[$[13]||($[13]=r("span",{class:"text-texto"},"Tope mensual",-1)),r("span",Xv,S(I(_.value))+" / "+S(I(k.value)),1)]),r("div",eh,[r("div",{class:ie(["h-full rounded-full transition-all duration-500",A.value>=100?"bg-red-500":A.value>=80?"bg-amber-500":"bg-brand"]),style:Ft({width:A.value+"%"})},null,6)]),A.value>=100?(v(),b("p",th," Superaste el tope de tu plan. El servicio sigue funcionando y el excedente se cobra en el próximo ciclo. ")):V("",!0)])):V("",!0),r("div",nh,[$[15]||($[15]=r("div",{class:"px-4 py-3"},[r("h2",{class:"text-sm font-medium text-texto"},"Desglose")],-1)),f.value.length===0?(v(),de(qe,{key:0,estado:"durmiendo",titulo:"Sin consumo en este período",detalle:"Cuando tus agentes respondan mensajes, lean imágenes o transcriban audios, vas a verlo acá."})):V("",!0),(v(!0),b(Z,null,ce(f.value,H=>(v(),b("div",{key:H.tipo,class:"px-4 py-3 flex items-center gap-3"},[ne(Ne,{nombre:d(H.tipo).icono,tam:18,class:"text-tenue"},null,8,["nombre"]),r("div",sh,[r("p",oh,S(d(H.tipo).nombre),1),r("p",ah,S(y(H.cantidad))+" "+S(H.unidad)+" · "+S(y(H.eventos))+" usos ",1)]),H.costo>0?(v(),b("span",rh,S(I(H.costo)),1)):(v(),b("span",lh,[...$[14]||($[14]=[Y(" va por tu",-1),r("br",null,null,-1),Y("cuenta de IA ",-1)])]))]))),128))]),w.value.dias.length?(v(),b("div",ih,[$[16]||($[16]=r("h2",{class:"text-sm font-medium text-texto mb-3"},"Por día",-1)),r("div",uh,[(v(!0),b(Z,null,ce(w.value.dias,([H,me])=>(v(),b("div",{key:H,class:"flex-1 min-w-[3px] bg-brand/70 hover:bg-brand rounded-t transition-colors",style:Ft({height:w.value.max?Math.max(2,me/w.value.max*100)+"%":"2px"}),title:`${H}: ${I(me)}`},null,12,ch))),128))]),r("div",dh,[r("span",null,S(w.value.dias[0][0]),1),r("span",null,S(w.value.dias[w.value.dias.length-1][0]),1)])])):V("",!0)],64)):V("",!0)])}}},ph={class:"flex items-start justify-between gap-4 mb-6"},mh={key:0,class:"text-sm text-red-600 dark:text-red-400 mb-4"},vh={key:1,class:"text-sm text-tenue"},hh={key:3,class:"card divide-y divide-borde"},gh={class:"flex items-start justify-between gap-4"},bh={class:"min-w-0"},xh={class:"text-sm text-texto font-medium"},yh={class:"text-xs text-tenue mt-0.5"},_h={class:"font-mono"},wh={class:"flex items-center gap-3 shrink-0 text-sm"},kh=["disabled","onClick"],$h=["onClick"],Ch=["onClick"],Ah={key:4,class:"text-xs text-tenue mt-3"},Sh={class:"card w-full max-w-lg p-6 max-h-[calc(100vh-2rem)] overflow-y-auto"},Eh={class:"font-semibold text-texto mb-4"},Ih=["value"],Rh={key:0,class:"text-xs text-tenue mt-1"},Ph={class:"font-mono"},Dh=["placeholder"],Th={key:0},Oh={class:"label"},Mh={key:0,class:"text-tenue font-normal"},Nh=["required"],jh={key:1},Vh={class:"flex justify-end gap-2 pt-2"},Uh=["disabled"],Lh={__name:"AiPropia",props:{id:{type:String,required:!0}},setup(e){const t=e,n=j([]),s=j(!0),o=j(""),a=j(!1),l=j(null),i=j(!1),u=j(null),d=j({}),c=[{valor:"openai",nombre:"OpenAI",modelo:"gpt-4o-mini",donde:"platform.openai.com/api-keys"},{valor:"anthropic",nombre:"Anthropic (Claude)",modelo:"claude-sonnet-4-20250514",donde:"console.anthropic.com"},{valor:"gemini",nombre:"Google Gemini",modelo:"gemini-2.0-flash",donde:"aistudio.google.com/apikey"},{valor:"groq",nombre:"Groq",modelo:"llama-3.3-70b-versatile",donde:"console.groq.com/keys"},{valor:"deepseek",nombre:"DeepSeek",modelo:"deepseek-chat",donde:"platform.deepseek.com"},{valor:"qwen",nombre:"Qwen (Alibaba)",modelo:"qwen2.5-72b-instruct",donde:"dashscope.console.aliyun.com"},{valor:"ollama",nombre:"Ollama (tu servidor)",modelo:"llama3.1",donde:""}];function p(){return{nombre:"",provider:"openai",api_key:"",base_url:"",model_name:""}}const f=j(p());function _(x){return c.find($=>$.valor===x)||c[0]}async function k(){s.value=!0,o.value="";try{const x=await Q.get(K(`/umind/ai-propia?tenant_id=${t.id}`));n.value=x.items||[]}catch(x){o.value=x.message}finally{s.value=!1}}Ge(()=>t.id,k,{immediate:!0});function A(){l.value=null,f.value=p(),a.value=!0}function I(x){l.value=x,f.value={nombre:x.nombre,provider:x.provider,api_key:"",base_url:x.base_url||"",model_name:x.model_name||""},a.value=!0}async function y(){i.value=!0,o.value="";try{const x={tenant_id:Number(t.id),...f.value};l.value?await Q.put(K(`/umind/ai-propia/${l.value.ID}`),x):await Q.post(K("/umind/ai-propia"),x),a.value=!1,await k()}catch(x){o.value=x.message}finally{i.value=!1}}async function w(x){u.value=x.ID,d.value={...d.value,[x.ID]:null};try{const $=await Q.post(K(`/umind/ai-propia/${x.ID}/probar`),{});d.value={...d.value,[x.ID]:{ok:!0,texto:$.respuesta}}}catch($){d.value={...d.value,[x.ID]:{ok:!1,texto:$.message}}}finally{u.value=null}}async function g(x){if(confirm(`¿Eliminar "${x.nombre}"?`)){o.value="";try{await Q.del(K(`/umind/ai-propia/${x.ID}`)),await k()}catch($){o.value=$.message}}}return(x,$)=>{const U=Wt("router-link");return v(),b("div",null,[ne(vn,{"tenant-id":e.id},null,8,["tenant-id"]),r("div",ph,[r("div",null,[ne(U,{to:`/tenants/${e.id}`,class:"text-sm text-tenue hover:text-texto inline-flex items-center gap-1.5"},{default:dt(()=>[ne(Ne,{nombre:"atras",tam:14}),$[7]||($[7]=Y(" Agentes",-1))]),_:1},8,["to"]),$[8]||($[8]=r("h1",{class:"text-xl font-semibold text-texto mt-1"},"Tu cuenta de IA",-1)),$[9]||($[9]=r("p",{class:"text-sm text-tenue mt-1 max-w-xl"}," Podés usar tu propia cuenta de OpenAI, Claude o Gemini en vez de la nuestra. El consumo se factura directo con el proveedor y no pasa por tu plan. ",-1))]),r("button",{class:"btn-primary shrink-0",onClick:A},"+ Conectar cuenta")]),o.value?(v(),b("p",mh,S(o.value),1)):V("",!0),s.value?(v(),b("div",vh,"Cargando…")):n.value.length===0?(v(),de(qe,{key:2,class:"card",titulo:"Estás usando la IA de uMind",detalle:"Funciona sin que hagas nada. Conectá tu propia cuenta solo si querés facturar el consumo por tu lado o usar un modelo puntual."},{default:dt(()=>[r("button",{class:"btn-primary",onClick:A},"Conectar mi cuenta")]),_:1})):(v(),b("div",hh,[(v(!0),b(Z,null,ce(n.value,F=>(v(),b("div",{key:F.ID,class:"p-4"},[r("div",gh,[r("div",bh,[r("div",xh,S(F.nombre),1),r("div",yh,[Y(S(_(F.provider).nombre)+" · "+S(F.model_name)+" · ",1),r("span",_h,S(F.api_key_pista),1)]),d.value[F.ID]?(v(),b("p",{key:0,class:ie(["text-xs mt-1.5",d.value[F.ID].ok?"text-brand":"text-red-600 dark:text-red-400"])},S(d.value[F.ID].ok?`Responde bien — dijo "${d.value[F.ID].texto}"`:d.value[F.ID].texto),3)):V("",!0)]),r("div",wh,[r("button",{class:"text-brand hover:underline disabled:opacity-40",disabled:u.value===F.ID,onClick:H=>w(F)},S(u.value===F.ID?"Probando…":"Probar"),9,kh),r("button",{class:"text-tenue hover:text-texto",onClick:H=>I(F)},"Editar",8,$h),r("button",{class:"text-red-500 hover:text-red-700",onClick:H=>g(F)},"Eliminar",8,Ch)])])]))),128))])),n.value.length?(v(),b("p",Ah,[...$[10]||($[10]=[Y(" Para que un agente la use, elegila en su campo ",-1),r("strong",null,"Config de IA",-1),Y(". ",-1)])])):V("",!0),a.value?(v(),b("div",{key:5,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:$[6]||($[6]=Ae(F=>a.value=!1,["self"]))},[r("div",Sh,[r("h2",Eh,S(l.value?"Editar cuenta de IA":"Conectar tu cuenta de IA"),1),r("form",{class:"space-y-3",onSubmit:Ae(y,["prevent"])},[r("div",null,[$[11]||($[11]=r("label",{class:"label"},"Nombre",-1)),z(r("input",{"onUpdate:modelValue":$[0]||($[0]=F=>f.value.nombre=F),required:"",placeholder:"ej: Mi cuenta de OpenAI",class:"input"},null,512),[[re,f.value.nombre]])]),r("div",null,[$[13]||($[13]=r("label",{class:"label"},"Proveedor",-1)),z(r("select",{"onUpdate:modelValue":$[1]||($[1]=F=>f.value.provider=F),class:"input"},[(v(),b(Z,null,ce(c,F=>r("option",{key:F.valor,value:F.valor},S(F.nombre),9,Ih)),64))],512),[[Nt,f.value.provider]]),_(f.value.provider).donde?(v(),b("p",Rh,[$[12]||($[12]=Y(" La clave se saca de ",-1)),r("span",Ph,S(_(f.value.provider).donde),1)])):V("",!0)]),r("div",null,[$[14]||($[14]=r("label",{class:"label"},"Modelo",-1)),z(r("input",{"onUpdate:modelValue":$[2]||($[2]=F=>f.value.model_name=F),required:"",placeholder:`ej: ${_(f.value.provider).modelo}`,class:"input font-mono"},null,8,Dh),[[re,f.value.model_name]])]),f.value.provider!=="ollama"?(v(),b("div",Th,[r("label",Oh,[$[15]||($[15]=Y(" Clave de API ",-1)),l.value?(v(),b("span",Mh,"— dejala vacía para no cambiarla")):V("",!0)]),z(r("input",{"onUpdate:modelValue":$[3]||($[3]=F=>f.value.api_key=F),type:"password",autocomplete:"new-password",required:!l.value,placeholder:"sk-...",class:"input font-mono"},null,8,Nh),[[re,f.value.api_key]]),$[16]||($[16]=r("p",{class:"text-xs text-tenue mt-1"},"Se guarda cifrada y no se vuelve a mostrar.",-1))])):V("",!0),f.value.provider==="ollama"?(v(),b("div",jh,[$[17]||($[17]=r("label",{class:"label"},"URL de tu servidor",-1)),z(r("input",{"onUpdate:modelValue":$[4]||($[4]=F=>f.value.base_url=F),required:"",placeholder:"https://ollama.tudominio.com/v1",class:"input font-mono"},null,512),[[re,f.value.base_url]])])):V("",!0),r("div",Vh,[r("button",{type:"button",class:"btn-ghost",onClick:$[5]||($[5]=F=>a.value=!1)},"Cancelar"),r("button",{type:"submit",class:"btn-primary",disabled:i.value},S(i.value?"Guardando…":"Guardar"),9,Uh)])],32)])])):V("",!0)])}}},qh={class:"flex items-start justify-between gap-4 mb-4"},Fh={class:"flex items-center gap-2 text-sm text-tenue cursor-pointer shrink-0"},Hh={key:0,class:"text-sm text-red-600 dark:text-red-400 mb-4"},Bh={key:1,class:"label"},Wh={key:2,class:"card divide-y divide-borde"},Gh={class:"flex items-start justify-between gap-4"},zh={class:"min-w-0"},Kh={class:"flex items-center gap-2 flex-wrap"},Qh={class:"font-medium text-texto"},Jh={class:"text-xs text-tenue mt-1"},Yh={key:0,class:"text-xs text-tenue mt-1 italic"},Zh={key:0,class:"flex items-center gap-2 shrink-0"},Xh=["disabled","onClick"],eg=["disabled","onClick"],tg={__name:"Pendientes",props:{id:{type:String,required:!0}},setup(e){const t=e,n=j([]),s=j(!0),o=j(""),a=j(!1),l=j(null);async function i(){s.value=!0,o.value="";try{const k=await Q.get(K(`/umind/acciones?tenant_id=${t.id}${a.value?"&historial=1":""}`));n.value=k.items||[]}catch(k){o.value=k.message}finally{s.value=!1}}Ge(()=>t.id,i,{immediate:!0}),Ge(a,i);async function u(k){l.value=k.ID,o.value="";try{await Q.post(K(`/umind/acciones/${k.ID}/aprobar`),{}),await i()}catch(A){o.value=A.message}finally{l.value=null}}async function d(k){const A=prompt("¿Por qué lo rechazás? (queda para vos, el cliente no lo ve)");if(A!==null){l.value=k.ID;try{await Q.post(K(`/umind/acciones/${k.ID}/rechazar`),{motivo:A}),await i()}catch(I){o.value=I.message}finally{l.value=null}}}const c={pendiente:"esperando",aprobada:"aprobada",ejecutada:"hecho",rechazada:"rechazada",vencida:"venció",fallida:"falló"},p={ejecutada:"badge-ok",rechazada:"badge-neutro",vencida:"badge-neutro",fallida:"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300"},f={correo:"✉️",documento:"📄",herramienta:"⚙️"};function _(k){return new Date(k).toLocaleString("es",{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})}return(k,A)=>{const I=Wt("router-link");return v(),b("div",null,[ne(vn,{"tenant-id":e.id},null,8,["tenant-id"]),r("div",qh,[A[2]||(A[2]=r("div",null,[r("h1",{class:"text-xl font-semibold text-texto"},"Pendientes"),r("p",{class:"label mt-1"}," Lo que tu asistente preparó y espera tu visto bueno. Prepara solo; entregar lo decidís vos. ")],-1)),r("label",Fh,[z(r("input",{type:"checkbox","onUpdate:modelValue":A[0]||(A[0]=y=>a.value=y),class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[st,a.value]]),A[1]||(A[1]=Y(" Ver resueltos ",-1))])]),o.value?(v(),b("p",Hh,S(o.value),1)):V("",!0),s.value?(v(),b("p",Bh,"Cargando…")):(v(),b("div",Wh,[n.value.length===0?(v(),de(qe,{key:0,titulo:"Nada esperando",detalle:"Cuando alguien le pida algo a tu asistente desde un canal público —una cotización, un correo— lo va a preparar y te lo va a dejar acá para que decidas."})):V("",!0),(v(!0),b(Z,null,ce(n.value,y=>(v(),b("div",{key:y.ID,class:"p-4"},[r("div",Gh,[r("div",zh,[r("div",Kh,[r("span",null,S(f[y.tipo]||"⚙️"),1),r("span",Qh,S(y.resumen),1),y.estado!=="pendiente"?(v(),b("span",{key:0,class:ie(["px-1.5 py-0.5 rounded text-xs",p[y.estado]||"badge-neutro"])},S(c[y.estado]||y.estado),3)):V("",!0)]),r("p",Jh,[Y(S(_(y.CreatedAt))+" ",1),y.estado==="pendiente"?(v(),b(Z,{key:0},[Y(" · vence el "+S(_(y.expira_at)),1)],64)):y.resuelta_por?(v(),b(Z,{key:1},[Y(" · "+S(y.resuelta_por),1)],64)):V("",!0)]),y.motivo?(v(),b("p",Yh,"Motivo: "+S(y.motivo),1)):V("",!0),y.archivo_id?(v(),de(I,{key:1,to:`/tenants/${e.id}/archivos`,class:"text-xs text-brand hover:underline"},{default:dt(()=>[...A[3]||(A[3]=[Y("Ver el documento",-1)])]),_:1},8,["to"])):V("",!0)]),y.estado==="pendiente"?(v(),b("div",Zh,[r("button",{class:"btn-ghost text-sm",disabled:l.value===y.ID,onClick:w=>d(y)},"Rechazar",8,Xh),r("button",{class:"btn-primary text-sm",disabled:l.value===y.ID,onClick:w=>u(y)},S(l.value===y.ID?"Haciéndolo…":"Aprobar"),9,eg)])):V("",!0)])]))),128))]))])}}},ng={class:"flex items-start justify-between gap-4 mb-4"},sg={class:"btn-primary cursor-pointer shrink-0"},og=["disabled"],ag={key:0,class:"mb-4"},rg={class:"flex justify-between text-xs text-tenue mb-1"},lg={class:"h-1.5 rounded-full bg-elevado overflow-hidden"},ig={key:1,class:"text-sm text-red-600 dark:text-red-400 mb-4"},ug={key:2,class:"label"},cg={key:3,class:"card divide-y divide-borde"},dg={class:"min-w-0"},fg={class:"flex items-center gap-2 flex-wrap"},pg={class:"font-medium text-texto truncate"},mg={key:0,class:"px-1.5 py-0.5 rounded text-xs badge-ok"},vg={key:1,class:"px-1.5 py-0.5 rounded text-xs badge-neutro"},hg={class:"text-xs text-tenue mt-0.5"},gg={class:"flex items-center gap-3 shrink-0 text-sm"},bg=["href"],xg=["onClick"],yg=["onClick"],_g={__name:"Archivos",props:{id:{type:String,required:!0}},setup(e){const t=e,n=j([]),s=j(0),o=j(0),a=j(!0),l=j(""),i=j(!1),u=j([]),d=le(()=>o.value?Math.min(100,Math.round(s.value/o.value*100)):0);function c(y){return y?y<1024*1024?`${Math.round(y/1024)} KB`:`${(y/1024/1024).toFixed(1)} MB`:"0 KB"}async function p(){a.value=!0,l.value="";try{const y=await Q.get(K(`/umind/archivos?tenant_id=${t.id}`));n.value=y.items||[],s.value=y.usado_bytes||0,o.value=y.cuota_bytes||0}catch(y){l.value=y.message}finally{a.value=!1}try{const y=await Q.get(K(`/umind/agentes?tenant_id=${t.id}`));u.value=y.items||[]}catch{u.value=[]}}Ge(()=>t.id,p,{immediate:!0});async function f(y){var x;const w=(x=y.target.files)==null?void 0:x[0];if(!w)return;i.value=!0,l.value="";const g=new FormData;g.append("tenant_id",t.id),g.append("archivo",w);try{await Q.postForm(K("/umind/archivos"),g),await p()}catch($){l.value=$.message}finally{i.value=!1,y.target.value=""}}async function _(y){if(u.value.length===0)return;let w=u.value[0].ID;if(u.value.length>1){const g=u.value.map((U,F)=>`${F+1}. ${U.nombre}`).join(`
|
|
`),x=prompt(`¿A qué asistente se lo cargamos?
|
|
${g}`,"1");if(x===null)return;const $=Number(x)-1;if(!u.value[$])return;w=u.value[$].ID}try{await Q.post(K(`/umind/archivos/${y.ID}/conocimiento`),{agente_id:w}),await p(),alert("Listo. Lo está leyendo — en un momento va a poder responder con eso.")}catch(g){l.value=g.message}}async function k(y){if(confirm(`¿Eliminar ${y.nombre}?`))try{await Q.del(K(`/umind/archivos/${y.ID}`)),await p()}catch(w){l.value=w.message}}function A(y){return K(`/umind/archivos/${y.ID}/descargar`)}function I(y){return new Date(y).toLocaleDateString("es",{day:"numeric",month:"short",year:"numeric"})}return(y,w)=>(v(),b("div",null,[ne(vn,{"tenant-id":e.id},null,8,["tenant-id"]),r("div",ng,[w[0]||(w[0]=r("div",null,[r("h1",{class:"text-xl font-semibold text-texto"},"Archivos"),r("p",{class:"label mt-1"}," Los papeles del negocio: contratos, pólizas, cotizaciones. Los documentos que genera tu asistente también quedan acá. ")],-1)),r("label",sg,[Y(S(i.value?"Subiendo…":"+ Subir archivo")+" ",1),r("input",{type:"file",class:"hidden",disabled:i.value,onChange:f},null,40,og)])]),o.value?(v(),b("div",ag,[r("div",rg,[r("span",null,S(c(s.value))+" de "+S(c(o.value)),1),r("span",null,S(d.value)+"%",1)]),r("div",lg,[r("div",{class:ie(["h-full rounded-full transition-all",d.value>90?"bg-amber-500":"bg-brand"]),style:Ft({width:d.value+"%"})},null,6)])])):V("",!0),l.value?(v(),b("p",ig,S(l.value),1)):V("",!0),a.value?(v(),b("p",ug,"Cargando…")):(v(),b("div",cg,[n.value.length===0?(v(),de(qe,{key:0,titulo:"Sin archivos todavía",detalle:"Subí acá los papeles del negocio. Cualquiera de ellos se le puede cargar al asistente como conocimiento con un clic."})):V("",!0),(v(!0),b(Z,null,ce(n.value,g=>(v(),b("div",{key:g.ID,class:"p-4 flex items-center justify-between gap-4"},[r("div",dg,[r("div",fg,[r("span",pg,S(g.nombre),1),g.origen==="generado"?(v(),b("span",mg,"generado")):V("",!0),g.documento_id?(v(),b("span",vg,"es conocimiento")):V("",!0)]),r("p",hg,S(c(g.tamanio))+" · "+S(I(g.CreatedAt)),1)]),r("div",gg,[r("a",{href:A(g),class:"text-brand hover:underline"},"Descargar",8,bg),!g.documento_id&&u.value.length?(v(),b("button",{key:0,class:"text-brand hover:underline",onClick:x=>_(g)},"Usar como conocimiento",8,xg)):V("",!0),r("button",{class:"text-red-500 hover:text-red-700",onClick:x=>k(g)},"Eliminar",8,yg)])]))),128))]))]))}},wg={key:0,class:"text-sm text-red-600 dark:text-red-400 mb-4"},kg={class:"grid sm:grid-cols-2 gap-3"},$g=["value"],Cg={class:"rounded-lg border border-dashed border-borde p-3 text-center"},Ag={class:"btn-ghost cursor-pointer inline-block"},Sg=["disabled"],Eg={class:"flex justify-end gap-2"},Ig=["disabled"],Rg={key:2,class:"label"},Pg={key:3,class:"card divide-y divide-borde"},Dg={class:"min-w-0"},Tg={class:"font-medium text-texto"},Og={class:"ml-2 text-xs text-tenue"},Mg={key:0,class:"ml-2 px-1.5 py-0.5 rounded text-xs badge-ok"},Ng=["onClick"],jg={__name:"Plantillas",props:{id:{type:String,required:!0}},setup(e){const t=e,n=[["cotizacion","Cotización"],["contrato","Contrato"],["acta","Acta"],["cuenta_cobro","Cuenta de cobro"]],s=j([]),o=j(!0),a=j(""),l=j(null),i=j(!1),u=j(!1),d=j({tipo:"cotizacion",nombre:"",contenido_html:""});async function c(){o.value=!0,a.value="";try{const I=await Q.get(K(`/umind/plantillas?tenant_id=${t.id}`));s.value=I.items||[]}catch(I){a.value=I.message}finally{o.value=!1}}Ge(()=>t.id,c,{immediate:!0});function p(){d.value={tipo:"cotizacion",nombre:"",contenido_html:""},l.value=!0}async function f(I){var g;const y=(g=I.target.files)==null?void 0:g[0];if(!y)return;i.value=!0,a.value="";const w=new FormData;w.append("tenant_id",t.id),w.append("tipo",d.value.tipo),w.append("archivo",y);try{const x=await Q.postForm(K("/umind/plantillas/importar"),w);d.value.contenido_html=x.contenido_html}catch(x){a.value=x.message}finally{i.value=!1,I.target.value=""}}async function _(){u.value=!0,a.value="";try{await Q.post(K("/umind/plantillas"),{tenant_id:Number(t.id),...d.value}),l.value=null,await c()}catch(I){a.value=I.message}finally{u.value=!1}}async function k(I){if(confirm(`¿Eliminar la plantilla "${I.nombre}"?`))try{await Q.del(K(`/umind/plantillas/${I.ID}`)),await c()}catch(y){a.value=y.message}}function A(I){var y;return((y=n.find(([w])=>w===I))==null?void 0:y[1])||I}return(I,y)=>(v(),b("div",null,[ne(vn,{"tenant-id":e.id},null,8,["tenant-id"]),r("div",{class:"flex items-start justify-between gap-4 mb-4"},[y[4]||(y[4]=r("div",null,[r("h1",{class:"text-xl font-semibold text-texto"},"Plantillas"),r("p",{class:"label mt-1"}," Tus cotizaciones y contratos con tu membrete. Tu asistente los usa cuando alguien te pide un presupuesto. Si no cargás ninguna, usa una genérica. ")],-1)),r("button",{class:"btn-primary shrink-0",onClick:p},"+ Nueva plantilla")]),a.value?(v(),b("p",wg,S(a.value),1)):V("",!0),l.value?(v(),b("form",{key:1,class:"card p-4 mb-4 space-y-3",onSubmit:Ae(_,["prevent"])},[r("div",kg,[r("div",null,[y[5]||(y[5]=r("label",{class:"label"},"Tipo",-1)),z(r("select",{"onUpdate:modelValue":y[0]||(y[0]=w=>d.value.tipo=w),class:"input"},[(v(),b(Z,null,ce(n,([w,g])=>r("option",{key:w,value:w},S(g),9,$g)),64))],512),[[Nt,d.value.tipo]])]),r("div",null,[y[6]||(y[6]=r("label",{class:"label"},"Nombre",-1)),z(r("input",{"onUpdate:modelValue":y[1]||(y[1]=w=>d.value.nombre=w),placeholder:"Cotización 2026",class:"input"},null,512),[[re,d.value.nombre]])])]),r("div",Cg,[r("label",Ag,[Y(S(i.value?"Leyéndolo…":"Subir el documento que ya usás")+" ",1),r("input",{type:"file",class:"hidden",accept:".docx,.pdf,.txt",disabled:i.value,onChange:f},null,40,Sg)]),y[7]||(y[7]=r("p",{class:"text-xs text-tenue mt-2"}," Subí tu contrato o cotización en Word o PDF y lo convertimos en plantilla, con los datos variables ya marcados. Después lo revisás acá abajo. ",-1))]),r("div",null,[y[8]||(y[8]=r("label",{class:"label"},"Contenido (HTML)",-1)),z(r("textarea",{"onUpdate:modelValue":y[2]||(y[2]=w=>d.value.contenido_html=w),rows:"12",required:"",class:"input font-mono text-xs"},null,512),[[re,d.value.contenido_html]]),y[9]||(y[9]=go('<p class="text-xs text-tenue mt-1"> Los datos variables van entre llaves: <span class="font-mono">{{.Cliente}}</span>, <span class="font-mono">{{.Fecha}}</span>, <span class="font-mono">{{.Total}}</span>, y la tabla de ítems con <span class="font-mono">{{range .Items}}</span>. </p>',1))]),r("div",Eg,[r("button",{type:"button",class:"btn-ghost",onClick:y[3]||(y[3]=w=>l.value=null)},"Cancelar"),r("button",{type:"submit",class:"btn-primary",disabled:u.value},S(u.value?"Guardando…":"Guardar"),9,Ig)])],32)):V("",!0),o.value?(v(),b("p",Rg,"Cargando…")):(v(),b("div",Pg,[s.value.length===0?(v(),de(qe,{key:0,titulo:"Sin plantillas propias",detalle:"Tu asistente puede emitir documentos igual, con un formato genérico. Cargá el tuyo cuando quieras que salgan con tu membrete."})):V("",!0),(v(!0),b(Z,null,ce(s.value,w=>(v(),b("div",{key:w.ID,class:"p-4 flex items-center justify-between gap-4"},[r("div",Dg,[r("span",Tg,S(w.nombre),1),r("span",Og,S(A(w.tipo))+" · versión "+S(w.version),1),w.activa?(v(),b("span",Mg,"en uso")):V("",!0)]),r("button",{class:"text-sm text-red-500 hover:text-red-700 shrink-0",onClick:g=>k(w)},"Eliminar",8,Ng)]))),128))]))]))}},Vg=_c({history:Xu(Ye.baseRuta),routes:[{path:"/",name:"home",component:md},{path:"/tenants/:id",name:"tenant-agentes",component:mf,props:!0},{path:"/tenants/:id/uso",name:"uso",component:fh,props:!0},{path:"/tenants/:id/ia",name:"ai-propia",component:Lh,props:!0},{path:"/tenants/:id/pendientes",name:"pendientes",component:tg,props:!0},{path:"/tenants/:id/archivos",name:"archivos",component:_g,props:!0},{path:"/tenants/:id/plantillas",name:"plantillas",component:jg,props:!0},{path:"/tenants/:tenantId/agentes/:agenteId",name:"agente-detail",component:Nv,props:!0}]});fu(Yc).use(Vg).mount("#app");
|