Hasta ahora la única forma de darle información a un agente era crawlear una
URL, una vez, para siempre. Tres cosas cambian:
Escribir a mano. Es la fuente más valiosa y la única que no está en ningún
documento: horarios, qué no hacen, la respuesta que dan quince veces por día.
También es la única que el dueño puede corregir en el momento en que ve al
agente contestar mal.
Subir un archivo. La lista de precios suele estar en un PDF, no en la web. Usa
el mismo extractor que los adjuntos de los canales, así que PDF, Word, texto e
imágenes entran sin código nuevo. El texto se extrae con la persona mirando la
pantalla: si el archivo no se puede leer, se dice ahí y no en un log.
Y lo importante: el conocimiento se congelaba el día que se cargaba. Si el
cliente cambiaba los precios en su sitio, el agente seguía dando los viejos con
total seguridad — sin error, sin aviso, nada. Ahora cada fuente muestra de
cuándo es ("leído hace 3 meses", en ámbar pasados dos meses), tiene botón de
actualizar, y las URLs pueden marcarse para releerse solas cada semana (cron a
las 4 AM). Reprocesar reemplaza los fragmentos en vez de sumarlos: si no,
quedaban las dos versiones compitiendo en la búsqueda y podía ganar la vieja.
De paso, el troceado dejaba fragmentos que arrancaban a mitad de palabra
("alabra…") porque el solape no se alineaba a un espacio.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
27 lines
148 KiB
JavaScript
27 lines
148 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 r of o)if(r.type==="childList")for(const i of r.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerPolicy&&(r.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?r.credentials="include":o.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(o){if(o.ep)return;o.ep=!0;const r=n(o);fetch(o.href,r)}})();/**
|
|
* @vue/shared v3.5.41
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
* @license MIT
|
|
**/function to(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ve={},nn=[],bt=()=>{},xr=()=>!1,cs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),fs=e=>e.startsWith("onUpdate:"),Ve=Object.assign,no=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Ki=Object.prototype.hasOwnProperty,me=(e,t)=>Ki.call(e,t),X=Array.isArray,sn=e=>Un(e)==="[object Map]",mn=e=>Un(e)==="[object Set]",Eo=e=>Un(e)==="[object Date]",ee=e=>typeof e=="function",Re=e=>typeof e=="string",at=e=>typeof e=="symbol",ge=e=>e!==null&&typeof e=="object",_r=e=>(ge(e)||ee(e))&&ee(e.then)&&ee(e.catch),yr=Object.prototype.toString,Un=e=>yr.call(e),qi=e=>Un(e).slice(8,-1),wr=e=>Un(e)==="[object Object]",so=e=>Re(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Cn=to(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ds=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Gi=/-\w/g,Je=ds(e=>e.replace(Gi,t=>t.slice(1).toUpperCase())),Wi=/\B([A-Z])/g,Xt=ds(e=>e.replace(Wi,"-$1").toLowerCase()),ps=ds(e=>e.charAt(0).toUpperCase()+e.slice(1)),As=ds(e=>e?`on${ps(e)}`:""),gt=(e,t)=>!Object.is(e,t),Xn=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Cr=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},hs=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let So;const ms=()=>So||(So=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Yt(e){if(X(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=Re(s)?Yi(s):Yt(s);if(o)for(const r in o)t[r]=o[r]}return t}else if(Re(e)||ge(e))return e}const zi=/;(?![^(]*\))/g,Ji=/:([^]+)/,Qi=/\/\*[^]*?\*\//g;function Yi(e){const t={};return e.replace(Qi,"").split(zi).forEach(n=>{if(n){const s=n.split(Ji);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Ie(e){let t="";if(Re(e))t=e;else if(X(e))for(let n=0;n<e.length;n++){const s=Ie(e[n]);s&&(t+=s+" ")}else if(ge(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Xi="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Zi=to(Xi);function Er(e){return!!e||e===""}function el(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=gn(e[s],t[s]);return n}function gn(e,t){if(e===t)return!0;let n=Eo(e),s=Eo(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=at(e),s=at(t),n||s)return e===t;if(n=X(e),s=X(t),n||s)return n&&s?el(e,t):!1;if(n=ge(e),s=ge(t),n||s){if(!n||!s)return!1;const o=Object.keys(e).length,r=Object.keys(t).length;if(o!==r)return!1;for(const i in e){const l=e.hasOwnProperty(i),a=t.hasOwnProperty(i);if(l&&!a||!l&&a||!gn(e[i],t[i]))return!1}}return String(e)===String(t)}function oo(e,t){return e.findIndex(n=>gn(n,t))}const Sr=e=>!!(e&&e.__v_isRef===!0),T=e=>Re(e)?e:e==null?"":X(e)||ge(e)&&(e.toString===yr||!ee(e.toString))?Sr(e)?T(e.value):JSON.stringify(e,Ar,2):String(e),Ar=(e,t)=>Sr(t)?Ar(e,t.value):sn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],r)=>(n[ks(s,r)+" =>"]=o,n),{})}:mn(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ks(n))}:at(t)?ks(t):ge(t)&&!X(t)&&!wr(t)?String(t):t,ks=(e,t="")=>{var n;return at(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 De;class tl{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&De&&(De.active?(this.parent=De,this.index=(De.scopes||(De.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=De;try{return De=this,t()}finally{De=n}}}on(){++this._on===1&&(this.prevScope=De,De=this)}off(){if(this._on>0&&--this._on===0){if(De===this)De=this.prevScope;else{let t=De;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 nl(){return De}let xe;const Rs=new WeakSet;class kr{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,De&&(De.active?De.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Rs.has(this)&&(Rs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Ir(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Ao(this),Pr(this);const t=xe,n=it;xe=this,it=!0;try{return this.fn()}finally{Or(this),xe=t,it=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)lo(t);this.deps=this.depsTail=void 0,Ao(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Rs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Fs(this)&&this.run()}get dirty(){return Fs(this)}}let Rr=0,En,Sn;function Ir(e,t=!1){if(e.flags|=8,t){e.next=Sn,Sn=e;return}e.next=En,En=e}function ro(){Rr++}function io(){if(--Rr>0)return;if(Sn){let t=Sn;for(Sn=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;En;){let t=En;for(En=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function Pr(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Or(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),lo(s),sl(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function Fs(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Tr(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Tr(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===In)||(e.globalVersion=In,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Fs(e))))return;e.flags|=2;const t=e.dep,n=xe,s=it;xe=e,it=!0;try{Pr(e);const o=e.fn(e._value);(t.version===0||gt(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{xe=n,it=s,Or(e),e.flags&=-3}}function lo(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let r=n.computed.deps;r;r=r.nextDep)lo(r,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function sl(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let it=!0;const $r=[];function Pt(){$r.push(it),it=!1}function Ot(){const e=$r.pop();it=e===void 0?!0:e}function Ao(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=xe;xe=void 0;try{t()}finally{xe=n}}}let In=0;class ol{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class ao{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!xe||!it||xe===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==xe)n=this.activeLink=new ol(xe,this),xe.deps?(n.prevDep=xe.depsTail,xe.depsTail.nextDep=n,xe.depsTail=n):xe.deps=xe.depsTail=n,Nr(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=xe.depsTail,n.nextDep=void 0,xe.depsTail.nextDep=n,xe.depsTail=n,xe.deps===n&&(xe.deps=s)}return n}trigger(t){this.version++,In++,this.notify(t)}notify(t){ro();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{io()}}}function Nr(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)Nr(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Hs=new WeakMap,Jt=Symbol(""),Bs=Symbol(""),Pn=Symbol("");function Le(e,t,n){if(it&&xe){let s=Hs.get(e);s||Hs.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new ao),o.map=s,o.key=n),o.track()}}function kt(e,t,n,s,o,r){const i=Hs.get(e);if(!i){In++;return}const l=a=>{a&&a.trigger()};if(ro(),t==="clear")i.forEach(l);else{const a=X(e),d=a&&so(n);if(a&&n==="length"){const c=Number(s);i.forEach((h,g)=>{(g==="length"||g===Pn||!at(g)&&g>=c)&&l(h)})}else switch((n!==void 0||i.has(void 0))&&l(i.get(n)),d&&l(i.get(Pn)),t){case"add":a?d&&l(i.get("length")):(l(i.get(Jt)),sn(e)&&l(i.get(Bs)));break;case"delete":a||(l(i.get(Jt)),sn(e)&&l(i.get(Bs)));break;case"set":sn(e)&&l(i.get(Jt));break}}io()}function Zt(e){const t=he(e);return t===e?t:(Le(t,"iterate",Pn),ot(e)?t:t.map(ut))}function gs(e){return Le(e=he(e),"iterate",Pn),e}function ht(e,t){return Tt(e)?un(Qt(e)?ut(t):t):ut(t)}const rl={__proto__:null,[Symbol.iterator](){return Is(this,Symbol.iterator,e=>ht(this,e))},concat(...e){return Zt(this).concat(...e.map(t=>X(t)?Zt(t):t))},entries(){return Is(this,"entries",e=>(e[1]=ht(this,e[1]),e))},every(e,t){return wt(this,"every",e,t,void 0,arguments)},filter(e,t){return wt(this,"filter",e,t,n=>n.map(s=>ht(this,s)),arguments)},find(e,t){return wt(this,"find",e,t,n=>ht(this,n),arguments)},findIndex(e,t){return wt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return wt(this,"findLast",e,t,n=>ht(this,n),arguments)},findLastIndex(e,t){return wt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return wt(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ps(this,"includes",e)},indexOf(...e){return Ps(this,"indexOf",e)},join(e){return Zt(this).join(e)},lastIndexOf(...e){return Ps(this,"lastIndexOf",e)},map(e,t){return wt(this,"map",e,t,void 0,arguments)},pop(){return vn(this,"pop")},push(...e){return vn(this,"push",e)},reduce(e,...t){return ko(this,"reduce",e,t)},reduceRight(e,...t){return ko(this,"reduceRight",e,t)},shift(){return vn(this,"shift")},some(e,t){return wt(this,"some",e,t,void 0,arguments)},splice(...e){return vn(this,"splice",e)},toReversed(){return Zt(this).toReversed()},toSorted(e){return Zt(this).toSorted(e)},toSpliced(...e){return Zt(this).toSpliced(...e)},unshift(...e){return vn(this,"unshift",e)},values(){return Is(this,"values",e=>ht(this,e))}};function Is(e,t,n){const s=gs(e),o=s[t]();return s!==e&&!ot(e)&&(o._next=o.next,o.next=()=>{const r=o._next();return r.done||(r.value=n(r.value)),r}),o}const il=Array.prototype;function wt(e,t,n,s,o,r){const i=gs(e),l=i!==e&&!ot(e),a=i[t];if(a!==il[t]){const h=a.apply(e,r);return l?ut(h):h}let d=n;i!==e&&(l?d=function(h,g){return n.call(this,ht(e,h),g,e)}:n.length>2&&(d=function(h,g){return n.call(this,h,g,e)}));const c=a.call(i,d,s);return l&&o?o(c):c}function ko(e,t,n,s){const o=gs(e),r=o!==e&&!ot(e);let i=n,l=!1;o!==e&&(r?(l=s.length===0,i=function(d,c,h){return l&&(l=!1,d=ht(e,d)),n.call(this,d,ht(e,c),h,e)}):n.length>3&&(i=function(d,c,h){return n.call(this,d,c,h,e)}));const a=o[t](i,...s);return l?ht(e,a):a}function Ps(e,t,n){const s=he(e);Le(s,"iterate",Pn);const o=s[t](...n);return(o===-1||o===!1)&&fo(n[0])?(n[0]=he(n[0]),s[t](...n)):o}function vn(e,t,n=[]){Pt(),ro();const s=he(e)[t].apply(e,n);return io(),Ot(),s}const ll=to("__proto__,__v_isRef,__isVue"),Dr=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(at));function al(e){at(e)||(e=String(e));const t=he(this);return Le(t,"has",e),t.hasOwnProperty(e)}class Mr{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,r=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return r;if(n==="__v_raw")return s===(o?r?bl:Lr:r?Ur:jr).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const i=X(t);if(!o){let a;if(i&&(a=rl[n]))return a;if(n==="hasOwnProperty")return al}const l=Reflect.get(t,n,He(t)?t:s);if((at(n)?Dr.has(n):ll(n))||(o||Le(t,"get",n),r))return l;if(He(l)){const a=i&&so(n)?l:l.value;return o&&ge(a)?qs(a):a}return ge(l)?o?qs(l):vs(l):l}}class Vr extends Mr{constructor(t=!1){super(!1,t)}set(t,n,s,o){let r=t[n];const i=X(t)&&so(n);if(!this._isShallow){const d=Tt(r);if(!ot(s)&&!Tt(s)&&(r=he(r),s=he(s)),!i&&He(r)&&!He(s))return d||(r.value=s),!0}const l=i?Number(n)<t.length:me(t,n),a=Reflect.set(t,n,s,He(t)?t:o);return t===he(o)&&a&&(l?gt(s,r)&&kt(t,"set",n,s):kt(t,"add",n,s)),a}deleteProperty(t,n){const s=me(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&kt(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!at(n)||!Dr.has(n))&&Le(t,"has",n),s}ownKeys(t){return Le(t,"iterate",X(t)?"length":Jt),Reflect.ownKeys(t)}}class ul extends Mr{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const cl=new Vr,fl=new ul,dl=new Vr(!0);const Ks=e=>e,Gn=e=>Reflect.getPrototypeOf(e);function pl(e,t,n){return function(...s){const o=this.__v_raw,r=he(o),i=sn(r),l=e==="entries"||e===Symbol.iterator&&i,a=e==="keys"&&i,d=o[e](...s),c=n?Ks:t?un:ut;return!t&&Le(r,"iterate",a?Bs:Jt),Ve(Object.create(d),{next(){const{value:h,done:g}=d.next();return g?{value:h,done:g}:{value:l?[c(h[0]),c(h[1])]:c(h),done:g}}})}}function Wn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function hl(e,t){const n={get(o){const r=this.__v_raw,i=he(r),l=he(o);e||(gt(o,l)&&Le(i,"get",o),Le(i,"get",l));const{has:a}=Gn(i),d=t?Ks:e?un:ut;if(a.call(i,o))return d(r.get(o));if(a.call(i,l))return d(r.get(l));r!==i&&r.get(o)},get size(){const o=this.__v_raw;return!e&&Le(he(o),"iterate",Jt),o.size},has(o){const r=this.__v_raw,i=he(r),l=he(o);return e||(gt(o,l)&&Le(i,"has",o),Le(i,"has",l)),o===l?r.has(o):r.has(o)||r.has(l)},forEach(o,r){const i=this,l=i.__v_raw,a=he(l),d=t?Ks:e?un:ut;return!e&&Le(a,"iterate",Jt),l.forEach((c,h)=>o.call(r,d(c),d(h),i))}};return Ve(n,e?{add:Wn("add"),set:Wn("set"),delete:Wn("delete"),clear:Wn("clear")}:{add(o){const r=he(this),i=Gn(r),l=he(o),a=!t&&!ot(o)&&!Tt(o)?l:o;return i.has.call(r,a)||gt(o,a)&&i.has.call(r,o)||gt(l,a)&&i.has.call(r,l)||(r.add(a),kt(r,"add",a,a)),this},set(o,r){!t&&!ot(r)&&!Tt(r)&&(r=he(r));const i=he(this),{has:l,get:a}=Gn(i);let d=l.call(i,o);d||(o=he(o),d=l.call(i,o));const c=a.call(i,o);return i.set(o,r),d?gt(r,c)&&kt(i,"set",o,r):kt(i,"add",o,r),this},delete(o){const r=he(this),{has:i,get:l}=Gn(r);let a=i.call(r,o);a||(o=he(o),a=i.call(r,o)),l&&l.call(r,o);const d=r.delete(o);return a&&kt(r,"delete",o,void 0),d},clear(){const o=he(this),r=o.size!==0,i=o.clear();return r&&kt(o,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=pl(o,e,t)}),n}function uo(e,t){const n=hl(e,t);return(s,o,r)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(me(n,o)&&o in s?n:s,o,r)}const ml={get:uo(!1,!1)},gl={get:uo(!1,!0)},vl={get:uo(!0,!1)};const jr=new WeakMap,Ur=new WeakMap,Lr=new WeakMap,bl=new WeakMap;function xl(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function vs(e){return Tt(e)?e:co(e,!1,cl,ml,jr)}function Fr(e){return co(e,!1,dl,gl,Ur)}function qs(e){return co(e,!0,fl,vl,Lr)}function co(e,t,n,s,o){if(!ge(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const r=o.get(e);if(r)return r;const i=xl(qi(e));if(i===0)return e;const l=new Proxy(e,i===2?s:n);return o.set(e,l),l}function Qt(e){return Tt(e)?Qt(e.__v_raw):!!(e&&e.__v_isReactive)}function Tt(e){return!!(e&&e.__v_isReadonly)}function ot(e){return!!(e&&e.__v_isShallow)}function fo(e){return e?!!e.__v_raw:!1}function he(e){const t=e&&e.__v_raw;return t?he(t):e}function _l(e){return!me(e,"__v_skip")&&Object.isExtensible(e)&&Cr(e,"__v_skip",!0),e}const ut=e=>ge(e)?vs(e):e,un=e=>ge(e)?qs(e):e;function He(e){return e?e.__v_isRef===!0:!1}function W(e){return Hr(e,!1)}function yl(e){return Hr(e,!0)}function Hr(e,t){return He(e)?e:new wl(e,t)}class wl{constructor(t,n){this.dep=new ao,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:he(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)||Tt(t);t=s?t:he(t),gt(t,n)&&(this._rawValue=t,this._value=s?t:ut(t),this.dep.trigger())}}function Te(e){return He(e)?e.value:e}const Cl={get:(e,t,n)=>t==="__v_raw"?e:Te(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return He(o)&&!He(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function Br(e){return Qt(e)?e:new Proxy(e,Cl)}class El{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new ao(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=In-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&xe!==this)return Ir(this,!0),!0}get value(){const t=this.dep.track();return Tr(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Sl(e,t,n=!1){let s,o;return ee(e)?s=e:(s=e.get,o=e.set),new El(s,o,n)}const zn={},ns=new WeakMap;let Wt;function Al(e,t=!1,n=Wt){if(n){let s=ns.get(n);s||ns.set(n,s=[]),s.push(e)}}function kl(e,t,n=ve){const{immediate:s,deep:o,once:r,scheduler:i,augmentJob:l,call:a}=n,d=P=>o?P:ot(P)||o===!1||o===0?Rt(P,1):Rt(P);let c,h,g,x,j=!1,O=!1;if(He(e)?(h=()=>e.value,j=ot(e)):Qt(e)?(h=()=>d(e),j=!0):X(e)?(O=!0,j=e.some(P=>Qt(P)||ot(P)),h=()=>e.map(P=>{if(He(P))return P.value;if(Qt(P))return d(P);if(ee(P))return a?a(P,2):P()})):ee(e)?t?h=a?()=>a(e,2):e:h=()=>{if(g){Pt();try{g()}finally{Ot()}}const P=Wt;Wt=c;try{return a?a(e,3,[x]):e(x)}finally{Wt=P}}:h=bt,t&&o){const P=h,A=o===!0?1/0:o;h=()=>Rt(P(),A)}const G=nl(),K=()=>{c.stop(),G&&G.active&&no(G.effects,c)};if(r&&t){const P=t;t=(...A)=>{const V=P(...A);return K(),V}}let M=O?new Array(e.length).fill(zn):zn;const q=P=>{if(!(!(c.flags&1)||!c.dirty&&!P))if(t){const A=c.run();if(P||o||j||(O?A.some((V,te)=>gt(V,M[te])):gt(A,M))){g&&g();const V=Wt;Wt=c;try{const te=[A,M===zn?void 0:O&&M[0]===zn?[]:M,x];M=A,a?a(t,3,te):t(...te)}finally{Wt=V}}}else c.run()};return l&&l(q),c=new kr(h),c.scheduler=i?()=>i(q,!1):q,x=P=>Al(P,!1,c),g=c.onStop=()=>{const P=ns.get(c);if(P){if(a)a(P,4);else for(const A of P)A();ns.delete(c)}},t?s?q(!0):M=c.run():i?i(q.bind(null,!0),!0):c.run(),K.pause=c.pause.bind(c),K.resume=c.resume.bind(c),K.stop=K,K}function Rt(e,t=1/0,n){if(t<=0||!ge(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,He(e))Rt(e.value,t,n);else if(X(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(wr(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){bs(o,t,n)}}function ct(e,t,n,s){if(ee(e)){const o=Ln(e,t,n,s);return o&&_r(o)&&o.catch(r=>{bs(r,t,n)}),o}if(X(e)){const o=[];for(let r=0;r<e.length;r++)o.push(ct(e[r],t,n,s));return o}}function bs(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||ve;if(t){let l=t.parent;const a=t.proxy,d=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const c=l.ec;if(c){for(let h=0;h<c.length;h++)if(c[h](e,a,d)===!1)return}l=l.parent}if(r){Pt(),Ln(r,null,10,[e,a,d]),Ot();return}}Rl(e,n,o,s,i)}function Rl(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const We=[];let pt=-1;const on=[];let jt=null,en=0;const Kr=Promise.resolve();let ss=null;function po(e){const t=ss||Kr;return e?t.then(this?e.bind(this):e):t}function Il(e){let t=pt+1,n=We.length;for(;t<n;){const s=t+n>>>1,o=We[s],r=On(o);r<e||r===e&&o.flags&2?t=s+1:n=s}return t}function ho(e){if(!(e.flags&1)){const t=On(e),n=We[We.length-1];!n||!(e.flags&2)&&t>=On(n)?We.push(e):We.splice(Il(t),0,e),e.flags|=1,qr()}}function qr(){ss||(ss=Kr.then(Wr))}function Pl(e){if(!X(e))jt&&e.id===-1?jt.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]);qr()}function Ro(e,t,n=pt+1){for(;n<We.length;n++){const s=We[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;We.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Gr(e){if(on.length){const t=[...new Set(on)].sort((n,s)=>On(n)-On(s));if(on.length=0,jt){for(let n=0;n<t.length;n++)jt.push(t[n]);return}for(jt=t,en=0;en<jt.length;en++){const n=jt[en];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}jt=null,en=0}}const On=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Wr(e){try{for(pt=0;pt<We.length;pt++){const t=We[pt];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(;pt<We.length;pt++){const t=We[pt];t&&(t.flags&=-2)}pt=-1,We.length=0,Gr(),ss=null,(We.length||on.length)&&Wr()}}let Me=null,zr=null;function os(e){const t=Me;return Me=e,zr=e&&e.type.__scopeId||null,t}function Ft(e,t=Me,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&ls(-1);const r=os(t),i=It.length;let l;try{l=e(...o)}finally{for(let a=It.length;a>i;a--)_o();os(r),s._d&&ls(1)}return l};return s._n=!0,s._c=!0,s._d=!0,s}function ne(e,t){if(Me===null)return e;const n=Cs(Me),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[r,i,l,a=ve]=t[o];r&&(ee(r)&&(r={mounted:r,updated:r}),r.deep&&Rt(i),s.push({dir:r,instance:n,value:i,oldValue:void 0,arg:l,modifiers:a}))}return e}function qt(e,t,n,s){const o=e.dirs,r=t&&t.dirs;for(let i=0;i<o.length;i++){const l=o[i];r&&(l.oldValue=r[i].value);let a=l.dir[s];a&&(Pt(),ct(a,n,8,[e.el,l,e,t]),Ot())}}function Zn(e,t){if(Fe){let n=Fe.provides;const s=Fe.parent&&Fe.parent.provides;s===n&&(n=Fe.provides=Object.create(s)),n[e]=t}}function lt(e,t,n=!1){const s=Ia();if(s||ln){let o=ln?ln._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&&ee(t)?t.call(s&&s.proxy):t}}const Ol=Symbol.for("v-scx"),Tl=()=>lt(Ol);function Ht(e,t,n){return Jr(e,t,n)}function Jr(e,t,n=ve){const{immediate:s,deep:o,flush:r,once:i}=n,l=Ve({},n),a=t&&s||!t&&r!=="post";let d;if(Dn){if(r==="sync"){const x=Tl();d=x.__watcherHandles||(x.__watcherHandles=[])}else if(!a){const x=()=>{};return x.stop=bt,x.resume=bt,x.pause=bt,x}}const c=Fe;l.call=(x,j,O)=>ct(x,c,j,O);let h=!1;r==="post"?l.scheduler=x=>{Xe(x,c&&c.suspense)}:r!=="sync"&&(h=!0,l.scheduler=(x,j)=>{j?x():ho(x)}),l.augmentJob=x=>{t&&(x.flags|=4),h&&(x.flags|=2,c&&(x.id=c.uid,x.i=c))};const g=kl(e,t,l);return Dn&&(d?d.push(g):a&&g()),g}function $l(e,t,n){const s=this.proxy,o=Re(e)?e.includes(".")?Qr(s,e):()=>s[e]:e.bind(s,s);let r;ee(t)?r=t:(r=t.handler,n=t);const i=Hn(this),l=Jr(o,r.bind(s),n);return i(),l}function Qr(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const Nl=Symbol("_vte"),xs=e=>e.__isTeleport,Os=Symbol("_leaveCb");function Dl(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==xt){t=n;break}}return t}function Yr(e){if(!go(e))return xs(e.type)&&e.children?Dl(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&ee(n.default))return n.default()}}function mo(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;mo(xs(n.type)&&Yr(n)||n,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Xr(e,t){return ee(e)?Ve({name:e.name},t,{setup:e}):e}function Zr(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Io(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const rs=new WeakMap;function An(e,t,n,s,o=!1){if(X(e)){e.forEach((O,G)=>An(O,t&&(X(t)?t[G]:t),n,s,o));return}if(rn(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&An(e,t,n,s.component.subTree);return}const r=s.shapeFlag&4?Cs(s.component):s.el,i=o?null:r,{i:l,r:a}=e,d=t&&t.r,c=l.refs===ve?l.refs={}:l.refs,h=l.setupState,g=he(h),x=h===ve?xr:O=>Io(c,O)?!1:me(g,O),j=(O,G)=>!(G&&Io(c,G));if(d!=null&&d!==a){if(Po(t),Re(d))c[d]=null,x(d)&&(h[d]=null);else if(He(d)){const O=t;j(d,O.k)&&(d.value=null),O.k&&(c[O.k]=null)}}if(ee(a))Ln(a,l,12,[i,c]);else{const O=Re(a),G=He(a);if(O||G){const K=()=>{if(e.f){const M=O?x(a)?h[a]:c[a]:j()||!e.k?a.value:c[e.k];if(o)X(M)&&no(M,r);else if(X(M))M.includes(r)||M.push(r);else if(O)c[a]=[r],x(a)&&(h[a]=c[a]);else{const q=[r];j(a,e.k)&&(a.value=q),e.k&&(c[e.k]=q)}}else O?(c[a]=i,x(a)&&(h[a]=i)):G&&(j(a,e.k)&&(a.value=i),e.k&&(c[e.k]=i))};if(i){const M=()=>{K(),rs.delete(e)};M.id=-1,rs.set(e,M),Xe(M,n)}else Po(e),K()}}}function Po(e){const t=rs.get(e);t&&(t.flags|=8,rs.delete(e))}ms().requestIdleCallback;ms().cancelIdleCallback;const rn=e=>!!e.type.__asyncLoader,go=e=>e.type.__isKeepAlive;function Ml(e,t){ei(e,"a",t)}function Vl(e,t){ei(e,"da",t)}function ei(e,t,n=Fe){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(_s(t,s,n),n){let o=n.parent;for(;o&&o.parent;)go(o.parent.vnode)&&jl(s,t,n,o),o=o.parent}}function jl(e,t,n,s){const o=_s(t,e,s,!0);ti(()=>{no(s[t],o)},n)}function _s(e,t,n=Fe,s=!1){if(n){const o=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...i)=>{Pt();const l=Hn(n),a=ct(t,n,e,i);return l(),Ot(),a});return s?o.unshift(r):o.push(r),r}}const $t=e=>(t,n=Fe)=>{(!Dn||e==="sp")&&_s(e,(...s)=>t(...s),n)},Ul=$t("bm"),vo=$t("m"),Ll=$t("bu"),Fl=$t("u"),Hl=$t("bum"),ti=$t("um"),Bl=$t("sp"),Kl=$t("rtg"),ql=$t("rtc");function Gl(e,t=Fe){_s("ec",e,t)}const Wl="components";function Fn(e,t){return Jl(Wl,e,!0,t)||e}const zl=Symbol.for("v-ndc");function Jl(e,t,n=!0,s=!1){const o=Me||Fe;if(o){const r=o.type;{const l=Na(r,!1);if(l&&(l===t||l===Je(t)||l===ps(Je(t))))return r}const i=Oo(o[e]||r[e],t)||Oo(o.appContext[e],t);return!i&&s?r:i}}function Oo(e,t){return e&&(e[t]||e[Je(t)]||e[ps(Je(t))])}function Oe(e,t,n,s){let o;const r=n,i=X(e);if(i||Re(e)){const l=i&&Qt(e);let a=!1,d=!1;l&&(a=!ot(e),d=Tt(e),e=gs(e)),o=new Array(e.length);for(let c=0,h=e.length;c<h;c++)o[c]=t(a?d?un(ut(e[c])):ut(e[c]):e[c],c,void 0,r)}else if(typeof e=="number"){o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,r)}else if(ge(e))if(e[Symbol.iterator])o=Array.from(e,(l,a)=>t(l,a,void 0,r));else{const l=Object.keys(e);o=new Array(l.length);for(let a=0,d=l.length;a<d;a++){const c=l[a];o[a]=t(e[c],c,a,r)}}else o=[];return o}function Ql(e,t,n,s,o,r){if(n==null&&(n={}),Me.ce||Me.parent&&rn(Me.parent)&&Me.parent.ce){const d=n,c=Object.keys(d).length>0;return w(),cn(ce,null,[ke("slot",d,s)],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1);const l=It.length;w();let a;try{const d=i&&ni(i(n)),c=n.key||r||d&&d.key;a=cn(ce,{key:(c&&!at(c)?c:`_${t}`)+(!d&&s?"_fb":"")},d||(s?s():[]),d&&e._===1?64:-2)}catch(d){for(let c=It.length;c>l;c--)_o();throw d}finally{i&&i._c&&(i._d=!0)}return a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),a}function ni(e){return e.some(t=>$n(t)?!(t.type===xt||t.type===ce&&!ni(t.children)):!0)?e:null}const Gs=e=>e?Ci(e)?Cs(e):Gs(e.parent):null,kn=Ve(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Gs(e.parent),$root:e=>Gs(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>oi(e),$forceUpdate:e=>e.f||(e.f=()=>{ho(e.update)}),$nextTick:e=>e.n||(e.n=po.bind(e.proxy)),$watch:e=>$l.bind(e)}),Ts=(e,t)=>e!==ve&&!e.__isScriptSetup&&me(e,t),Yl={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:r,accessCache:i,type:l,appContext:a}=e;if(t[0]!=="$"){const g=i[t];if(g!==void 0)switch(g){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return r[t]}else{if(Ts(s,t))return i[t]=1,s[t];if(o!==ve&&me(o,t))return i[t]=2,o[t];if(me(r,t))return i[t]=3,r[t];if(n!==ve&&me(n,t))return i[t]=4,n[t];Ws&&(i[t]=0)}}const d=kn[t];let c,h;if(d)return t==="$attrs"&&Le(e.attrs,"get",""),d(e);if((c=l.__cssModules)&&(c=c[t]))return c;if(n!==ve&&me(n,t))return i[t]=4,n[t];if(h=a.config.globalProperties,me(h,t))return h[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:r}=e;return Ts(o,t)?(o[t]=n,!0):s!==ve&&me(s,t)?(s[t]=n,!0):me(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(r[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:r,type:i}},l){let a;return!!(n[l]||e!==ve&&l[0]!=="$"&&me(e,l)||Ts(t,l)||me(r,l)||me(s,l)||me(kn,l)||me(o.config.globalProperties,l)||(a=i.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:me(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function To(e){return X(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Ws=!0;function Xl(e){const t=oi(e),n=e.proxy,s=e.ctx;Ws=!1,t.beforeCreate&&$o(t.beforeCreate,e,"bc");const{data:o,computed:r,methods:i,watch:l,provide:a,inject:d,created:c,beforeMount:h,mounted:g,beforeUpdate:x,updated:j,activated:O,deactivated:G,beforeDestroy:K,beforeUnmount:M,destroyed:q,unmounted:P,render:A,renderTracked:V,renderTriggered:te,errorCaptured:R,serverPrefetch:U,expose:Ne,inheritAttrs:J,components:et,directives:Be,filters:Bt}=t;if(d&&Zl(d,s,null),i)for(const ue in i){const re=i[ue];ee(re)&&(s[ue]=re.bind(n))}if(o){const ue=o.call(n,n);ge(ue)&&(e.data=vs(ue))}if(Ws=!0,r)for(const ue in r){const re=r[ue],se=ee(re)?re.bind(n,n):ee(re.get)?re.get.bind(n,n):bt,rt=!ee(re)&&ee(re.set)?re.set.bind(n):bt,Qe=_e({get:se,set:rt});Object.defineProperty(s,ue,{enumerable:!0,configurable:!0,get:()=>Qe.value,set:je=>Qe.value=je})}if(l)for(const ue in l)si(l[ue],s,n,ue);if(a){const ue=ee(a)?a.call(n):a;Reflect.ownKeys(ue).forEach(re=>{Zn(re,ue[re])})}c&&$o(c,e,"c");function we(ue,re){X(re)?re.forEach(se=>ue(se.bind(n))):re&&ue(re.bind(n))}if(we(Ul,h),we(vo,g),we(Ll,x),we(Fl,j),we(Ml,O),we(Vl,G),we(Gl,R),we(ql,V),we(Kl,te),we(Hl,M),we(ti,P),we(Bl,U),X(Ne))if(Ne.length){const ue=e.exposed||(e.exposed={});Ne.forEach(re=>{Object.defineProperty(ue,re,{get:()=>n[re],set:se=>n[re]=se,enumerable:!0})})}else e.exposed||(e.exposed={});A&&e.render===bt&&(e.render=A),J!=null&&(e.inheritAttrs=J),et&&(e.components=et),Be&&(e.directives=Be),U&&Zr(e)}function Zl(e,t,n=bt){X(e)&&(e=zs(e));for(const s in e){const o=e[s];let r;ge(o)?"default"in o?r=lt(o.from||s,o.default,!0):r=lt(o.from||s):r=lt(o),He(r)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>r.value,set:i=>r.value=i}):t[s]=r}}function $o(e,t,n){ct(X(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function si(e,t,n,s){let o=s.includes(".")?Qr(n,s):()=>n[s];if(Re(e)){const r=t[e];ee(r)&&Ht(o,r)}else if(ee(e))Ht(o,e.bind(n));else if(ge(e))if(X(e))e.forEach(r=>si(r,t,n,s));else{const r=ee(e.handler)?e.handler.bind(n):t[e.handler];ee(r)&&Ht(o,r,e)}}function oi(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:r,config:{optionMergeStrategies:i}}=e.appContext,l=r.get(t);let a;return l?a=l:!o.length&&!n&&!s?a=t:(a={},o.length&&o.forEach(d=>is(a,d,i,!0)),is(a,t,i)),ge(t)&&r.set(t,a),a}function is(e,t,n,s=!1){const{mixins:o,extends:r}=t;r&&is(e,r,n,!0),o&&o.forEach(i=>is(e,i,n,!0));for(const i in t)if(!(s&&i==="expose")){const l=ea[i]||n&&n[i];e[i]=l?l(e[i],t[i]):t[i]}return e}const ea={data:No,props:Do,emits:Do,methods:_n,computed:_n,beforeCreate:qe,created:qe,beforeMount:qe,mounted:qe,beforeUpdate:qe,updated:qe,beforeDestroy:qe,beforeUnmount:qe,destroyed:qe,unmounted:qe,activated:qe,deactivated:qe,errorCaptured:qe,serverPrefetch:qe,components:_n,directives:_n,watch:na,provide:No,inject:ta};function No(e,t){return t?e?function(){return Ve(ee(e)?e.call(this,this):e,ee(t)?t.call(this,this):t)}:t:e}function ta(e,t){return _n(zs(e),zs(t))}function zs(e){if(X(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function qe(e,t){return e?[...new Set([].concat(e,t))]:t}function _n(e,t){return e?Ve(Object.create(null),e,t):t}function Do(e,t){return e?X(e)&&X(t)?[...new Set([...e,...t])]:Ve(Object.create(null),To(e),To(t??{})):t}function na(e,t){if(!e)return t;if(!t)return e;const n=Ve(Object.create(null),e);for(const s in t)n[s]=qe(e[s],t[s]);return n}function ri(){return{app:null,config:{isNativeTag:xr,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 sa=0;function oa(e,t){return function(s,o=null){ee(s)||(s=Ve({},s)),o!=null&&!ge(o)&&(o=null);const r=ri(),i=new WeakSet,l=[];let a=!1;const d=r.app={_uid:sa++,_component:s,_props:o,_container:null,_context:r,_instance:null,version:Ma,get config(){return r.config},set config(c){},use(c,...h){return i.has(c)||(c&&ee(c.install)?(i.add(c),c.install(d,...h)):ee(c)&&(i.add(c),c(d,...h))),d},mixin(c){return r.mixins.includes(c)||r.mixins.push(c),d},component(c,h){return h?(r.components[c]=h,d):r.components[c]},directive(c,h){return h?(r.directives[c]=h,d):r.directives[c]},mount(c,h,g){if(!a){const x=d._ceVNode||ke(s,o);return x.appContext=r,g===!0?g="svg":g===!1&&(g=void 0),e(x,c,g),a=!0,d._container=c,c.__vue_app__=d,Cs(x.component)}},onUnmount(c){l.push(c)},unmount(){a&&(ct(l,d._instance,16),e(null,d._container),delete d._container.__vue_app__)},provide(c,h){return r.provides[c]=h,d},runWithContext(c){const h=ln;ln=d;try{return c()}finally{ln=h}}};return d}}let ln=null;const ra=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Je(t)}Modifiers`]||e[`${Xt(t)}Modifiers`];function ia(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||ve;let o=n;const r=t.startsWith("update:"),i=r&&ra(s,t.slice(7));i&&(i.trim&&(o=n.map(c=>Re(c)?c.trim():c)),i.number&&(o=n.map(hs)));let l,a=s[l=As(t)]||s[l=As(Je(t))];!a&&r&&(a=s[l=As(Xt(t))]),a&&ct(a,e,6,o);const d=s[l+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,ct(d,e,6,o)}}const la=new WeakMap;function ii(e,t,n=!1){const s=n?la:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const r=e.emits;let i={},l=!1;if(!ee(e)){const a=d=>{const c=ii(d,t,!0);c&&(l=!0,Ve(i,c))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!r&&!l?(ge(e)&&s.set(e,null),null):(X(r)?r.forEach(a=>i[a]=null):Ve(i,r),ge(e)&&s.set(e,i),i)}function ys(e,t){return!e||!cs(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),me(e,t[0].toLowerCase()+t.slice(1))||me(e,Xt(t))||me(e,t))}function Mo(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[r],slots:i,attrs:l,emit:a,render:d,renderCache:c,props:h,data:g,setupState:x,ctx:j,inheritAttrs:O}=e,G=os(e);let K,M;try{if(n.shapeFlag&4){const P=o||s,A=P;K=mt(d.call(A,P,c,h,x,g,j)),M=l}else{const P=t;K=mt(P.length>1?P(h,{attrs:l,slots:i,emit:a}):P(h,null)),M=t.props?l:aa(l)}}catch(P){It.length=0,bs(P,e,1),K=ke(xt)}let q=K;if(M&&O!==!1){const P=Object.keys(M),{shapeFlag:A}=q;P.length&&A&7&&(r&&P.some(fs)&&(M=ua(M,r)),q=fn(q,M,!1,!0))}if(n.dirs&&(q=fn(q,null,!1,!0),q.dirs=q.dirs?q.dirs.concat(n.dirs):n.dirs),n.transition){const P=xs(q.type)&&Yr(q)||q;mo(P,n.transition)}return K=q,os(G),K}const aa=e=>{let t;for(const n in e)(n==="class"||n==="style"||cs(n))&&((t||(t={}))[n]=e[n]);return t},ua=(e,t)=>{const n={};for(const s in e)(!fs(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function ca(e,t,n){const{props:s,children:o,component:r}=e,{props:i,children:l,patchFlag:a}=t,d=r.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return s?Vo(s,i,d):!!i;if(a&8){const c=t.dynamicProps;for(let h=0;h<c.length;h++){const g=c[h];if(li(i,s,g)&&!ys(d,g))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===i?!1:s?i?Vo(s,i,d):!0:!!i;return!1}function Vo(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 r=s[o];if(li(t,e,r)&&!ys(n,r))return!0}return!1}function li(e,t,n){const s=e[n],o=t[n];return n==="style"&&ge(s)&&ge(o)?!gn(s,o):s!==o}function fa({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 ai={},ui=()=>Object.create(ai),ci=e=>Object.getPrototypeOf(e)===ai;function da(e,t,n,s=!1){const o={},r=ui();e.propsDefaults=Object.create(null),fi(e,t,o,r);for(const i in e.propsOptions[0])i in o||(o[i]=void 0);n?e.props=s?o:Fr(o):e.type.props?e.props=o:e.props=r,e.attrs=r}function pa(e,t,n,s){const{props:o,attrs:r,vnode:{patchFlag:i}}=e,l=he(o),[a]=e.propsOptions;let d=!1;if((s||i>0)&&!(i&16)){if(i&8){const c=e.vnode.dynamicProps;for(let h=0;h<c.length;h++){let g=c[h];if(ys(e.emitsOptions,g))continue;const x=t[g];if(a)if(me(r,g))x!==r[g]&&(r[g]=x,d=!0);else{const j=Je(g);o[j]=Js(a,l,j,x,e,!1)}else x!==r[g]&&(r[g]=x,d=!0)}}}else{fi(e,t,o,r)&&(d=!0);let c;for(const h in l)(!t||!me(t,h)&&((c=Xt(h))===h||!me(t,c)))&&(a?n&&(n[h]!==void 0||n[c]!==void 0)&&(o[h]=Js(a,l,h,void 0,e,!0)):delete o[h]);if(r!==l)for(const h in r)(!t||!me(t,h))&&(delete r[h],d=!0)}d&&kt(e.attrs,"set","")}function fi(e,t,n,s){const[o,r]=e.propsOptions;let i=!1,l;if(t)for(let a in t){if(Cn(a))continue;const d=t[a];let c;o&&me(o,c=Je(a))?!r||!r.includes(c)?n[c]=d:(l||(l={}))[c]=d:ys(e.emitsOptions,a)||(!(a in s)||d!==s[a])&&(s[a]=d,i=!0)}if(r){const a=he(n),d=l||ve;for(let c=0;c<r.length;c++){const h=r[c];n[h]=Js(o,a,h,d[h],e,!me(d,h))}}return i}function Js(e,t,n,s,o,r){const i=e[n];if(i!=null){const l=me(i,"default");if(l&&s===void 0){const a=i.default;if(i.type!==Function&&!i.skipFactory&&ee(a)){const{propsDefaults:d}=o;if(n in d)s=d[n];else{const c=Hn(o);s=d[n]=a.call(null,t),c()}}else s=a;o.ce&&o.ce._setProp(n,s)}i[0]&&(r&&!l?s=!1:i[1]&&(s===""||s===Xt(n))&&(s=!0))}return s}const ha=new WeakMap;function di(e,t,n=!1){const s=n?ha:t.propsCache,o=s.get(e);if(o)return o;const r=e.props,i={},l=[];let a=!1;if(!ee(e)){const c=h=>{a=!0;const[g,x]=di(h,t,!0);Ve(i,g),x&&l.push(...x)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!r&&!a)return ge(e)&&s.set(e,nn),nn;if(X(r))for(let c=0;c<r.length;c++){const h=Je(r[c]);jo(h)&&(i[h]=ve)}else if(r)for(const c in r){const h=Je(c);if(jo(h)){const g=r[c],x=i[h]=X(g)||ee(g)?{type:g}:Ve({},g),j=x.type;let O=!1,G=!0;if(X(j))for(let K=0;K<j.length;++K){const M=j[K],q=ee(M)&&M.name;if(q==="Boolean"){O=!0;break}else q==="String"&&(G=!1)}else O=ee(j)&&j.name==="Boolean";x[0]=O,x[1]=G,(O||me(x,"default"))&&l.push(h)}}const d=[i,l];return ge(e)&&s.set(e,d),d}function jo(e){return e[0]!=="$"&&!Cn(e)}const bo=e=>e==="_"||e==="_ctx"||e==="$stable",xo=e=>X(e)?e.map(mt):[mt(e)],ma=(e,t,n)=>{if(t._n)return t;const s=Ft((...o)=>xo(t(...o)),n);return s._c=!1,s},pi=(e,t,n)=>{const s=e._ctx;for(const o in e){if(bo(o))continue;const r=e[o];if(ee(r))t[o]=ma(o,r,s);else if(r!=null){const i=xo(r);t[o]=()=>i}}},hi=(e,t)=>{const n=xo(t);e.slots.default=()=>n},mi=(e,t,n)=>{for(const s in t)(n||!bo(s))&&(e[s]=t[s])},ga=(e,t,n)=>{const s=e.slots=ui();if(e.vnode.shapeFlag&32){const o=t._;o?(mi(s,t,n),n&&Cr(s,"_",o,!0)):pi(t,s)}else t&&hi(e,t)},va=(e,t,n)=>{const{vnode:s,slots:o}=e;let r=!0,i=ve;if(s.shapeFlag&32){const l=t._;l?n&&l===1?r=!1:mi(o,t,n):(r=!t.$stable,pi(t,o)),i=t}else t&&(hi(e,t),i={default:1});if(r)for(const l in o)!bo(l)&&i[l]==null&&delete o[l]},Xe=wa;function ba(e){return xa(e)}function xa(e,t){const n=ms();n.__VUE__=!0;const{insert:s,remove:o,patchProp:r,createElement:i,createText:l,createComment:a,setText:d,setElementText:c,parentNode:h,nextSibling:g,setScopeId:x=bt,insertStaticContent:j}=e,O=(f,p,m,y=null,E=null,_=null,F=void 0,N=null,D=!!p.dynamicChildren)=>{if(f===p)return;f&&!bn(f,p)&&(y=C(f),je(f,E,_,!0),f=null),p.patchFlag===-2&&(D=!1,p.dynamicChildren=null);const{type:k,ref:Q,shapeFlag:H}=p;switch(k){case ws:G(f,p,m,y);break;case xt:K(f,p,m,y);break;case es:f==null&&M(p,m,y,F);break;case ce:et(f,p,m,y,E,_,F,N,D);break;default:H&1?A(f,p,m,y,E,_,F,N,D):H&6?Be(f,p,m,y,E,_,F,N,D):(H&64||H&128)&&k.process(f,p,m,y,E,_,F,N,D,$)}Q!=null&&E?An(Q,f&&f.ref,_,p||f,!p):Q==null&&f&&f.ref!=null&&An(f.ref,null,_,f,!0)},G=(f,p,m,y)=>{if(f==null)s(p.el=l(p.children),m,y);else{const E=p.el=f.el;p.children!==f.children&&d(E,p.children)}},K=(f,p,m,y)=>{f==null?s(p.el=a(p.children||""),m,y):p.el=f.el},M=(f,p,m,y)=>{[f.el,f.anchor]=j(f.children,p,m,y,f.el,f.anchor)},q=({el:f,anchor:p},m,y)=>{let E;for(;f&&f!==p;)E=g(f),s(f,m,y),f=E;s(p,m,y)},P=({el:f,anchor:p})=>{let m;for(;f&&f!==p;)m=g(f),o(f),f=m;o(p)},A=(f,p,m,y,E,_,F,N,D)=>{if(p.type==="svg"?F="svg":p.type==="math"&&(F="mathml"),f==null)V(p,m,y,E,_,F,N,D);else{const k=f.el&&f.el._isVueCE?f.el:null;try{k&&k._beginPatch(),U(f,p,E,_,F,N,D)}finally{k&&k._endPatch()}}},V=(f,p,m,y,E,_,F,N)=>{let D,k;const{props:Q,shapeFlag:H,transition:z,dirs:Y}=f;if(D=f.el=i(f.type,_,Q&&Q.is,Q),H&8?c(D,f.children):H&16&&R(f.children,D,null,y,E,$s(f,_),F,N),Y&&qt(f,null,y,"created"),te(D,f,f.scopeId,F,y),Q){for(const fe in Q)fe!=="value"&&!Cn(fe)&&r(D,fe,null,Q[fe],_,y);"value"in Q&&r(D,"value",null,Q.value,_),(k=Q.onVnodeBeforeMount)&&dt(k,y,f)}Y&&qt(f,null,y,"beforeMount");const le=_a(E,z);le&&z.beforeEnter(D),s(D,p,m),((k=Q&&Q.onVnodeMounted)||le||Y)&&Xe(()=>{try{k&&dt(k,y,f),le&&z.enter(D),Y&&qt(f,null,y,"mounted")}finally{}},E)},te=(f,p,m,y,E)=>{if(m&&x(f,m),y)for(let _=0;_<y.length;_++)x(f,y[_]);if(E){let _=E.subTree;if(p===_||xi(_.type)&&(_.ssContent===p||_.ssFallback===p)){const F=E.vnode;te(f,F,F.scopeId,F.slotScopeIds,E.parent)}}},R=(f,p,m,y,E,_,F,N,D=0)=>{for(let k=D;k<f.length;k++){const Q=f[k]=N?At(f[k]):mt(f[k]);O(null,Q,p,m,y,E,_,F,N)}},U=(f,p,m,y,E,_,F)=>{const N=p.el=f.el;let{patchFlag:D,dynamicChildren:k,dirs:Q}=p;D|=f.patchFlag&16;const H=f.props||ve,z=p.props||ve;let Y;if(m&&Gt(m,!1),(Y=z.onVnodeBeforeUpdate)&&dt(Y,m,p,f),Q&&qt(p,f,m,"beforeUpdate"),m&&Gt(m,!0),k&&(!f.dynamicChildren||f.dynamicChildren.length!==k.length)&&(D=0,F=!1,k=null),(H.innerHTML&&z.innerHTML==null||H.textContent&&z.textContent==null)&&c(N,""),k?Ne(f.dynamicChildren,k,N,m,y,$s(p,E),_):F||re(f,p,N,null,m,y,$s(p,E),_,!1),D>0){if(D&16)J(N,H,z,m,E);else if(D&2&&H.class!==z.class&&r(N,"class",null,z.class,E),D&4&&r(N,"style",H.style,z.style,E),D&8){const le=p.dynamicProps;for(let fe=0;fe<le.length;fe++){const de=le[fe],Se=H[de],Ce=z[de];(Ce!==Se||de==="value")&&r(N,de,Se,Ce,E,m)}}D&1&&f.children!==p.children&&c(N,p.children)}else!F&&k==null&&J(N,H,z,m,E);((Y=z.onVnodeUpdated)||Q)&&Xe(()=>{Y&&dt(Y,m,p,f),Q&&qt(p,f,m,"updated")},y)},Ne=(f,p,m,y,E,_,F)=>{for(let N=0;N<p.length;N++){const D=f[N],k=p[N],Q=D.el&&(D.type===ce||!bn(D,k)||D.shapeFlag&198)?h(D.el):m;O(D,k,Q,null,y,E,_,F,!0)}},J=(f,p,m,y,E)=>{if(p!==m){if(p!==ve)for(const _ in p)!Cn(_)&&!(_ in m)&&r(f,_,p[_],null,E,y);for(const _ in m){if(Cn(_))continue;const F=m[_],N=p[_];F!==N&&_!=="value"&&r(f,_,N,F,E,y)}"value"in m&&r(f,"value",p.value,m.value,E)}},et=(f,p,m,y,E,_,F,N,D)=>{const k=p.el=f?f.el:l(""),Q=p.anchor=f?f.anchor:l("");let{patchFlag:H,dynamicChildren:z,slotScopeIds:Y}=p;Y&&(N=N?N.concat(Y):Y),f==null?(s(k,m,y),s(Q,m,y),R(p.children||[],m,Q,E,_,F,N,D)):H>0&&H&64&&z&&f.dynamicChildren&&f.dynamicChildren.length===z.length?(Ne(f.dynamicChildren,z,m,E,_,F,N),(p.key!=null||E&&p===E.subTree)&&gi(f,p,!0)):re(f,p,m,Q,E,_,F,N,D)},Be=(f,p,m,y,E,_,F,N,D)=>{p.slotScopeIds=N,f==null?p.shapeFlag&512?E.ctx.activate(p,m,y,F,D):Bt(p,m,y,E,_,F,D):Nt(f,p,D)},Bt=(f,p,m,y,E,_,F)=>{const N=f.component=Ra(f,y,E);if(go(f)&&(N.ctx.renderer=$),Pa(N,!1,F),N.asyncDep){if(E&&E.registerDep(N,we,F),!f.el){const D=N.subTree=ke(xt);K(null,D,p,m),f.placeholder=D.el}}else we(N,f,p,m,E,_,F)},Nt=(f,p,m)=>{const y=p.component=f.component;if(ca(f,p,m))if(y.asyncDep&&!y.asyncResolved){ue(y,p,m);return}else y.next=p,y.update();else p.el=f.el,y.vnode=p},we=(f,p,m,y,E,_,F)=>{const N=()=>{if(f.isMounted){let{next:H,bu:z,u:Y,parent:le,vnode:fe}=f;{const Ue=vi(f);if(Ue){H&&(H.el=fe.el,ue(f,H,F)),Ue.asyncDep.then(()=>{Xe(()=>{f.isUnmounted||k()},E)});return}}let de=H,Se;Gt(f,!1),H?(H.el=fe.el,ue(f,H,F)):H=fe,z&&Xn(z),(Se=H.props&&H.props.onVnodeBeforeUpdate)&&dt(Se,le,H,fe),Gt(f,!0);const Ce=Mo(f),Ke=f.subTree;f.subTree=Ce,O(Ke,Ce,h(Ke.el),C(Ke),f,E,_),H.el=Ce.el,de===null&&fa(f,Ce.el),Y&&Xe(Y,E),(Se=H.props&&H.props.onVnodeUpdated)&&Xe(()=>dt(Se,le,H,fe),E)}else{let H;const{el:z,props:Y}=p,{bm:le,m:fe,parent:de,root:Se,type:Ce}=f,Ke=rn(p);Gt(f,!1),le&&Xn(le),!Ke&&(H=Y&&Y.onVnodeBeforeMount)&&dt(H,de,p),Gt(f,!0);{Se.ce&&Se.ce._hasShadowRoot()&&Se.ce._injectChildStyle(Ce,f.parent?f.parent.type:void 0);const Ue=f.subTree=Mo(f);O(null,Ue,m,y,f,E,_),p.el=Ue.el}if(fe&&Xe(fe,E),!Ke&&(H=Y&&Y.onVnodeMounted)){const Ue=p;Xe(()=>dt(H,de,Ue),E)}(p.shapeFlag&256||de&&rn(de.vnode)&&de.vnode.shapeFlag&256)&&f.a&&Xe(f.a,E),f.isMounted=!0,p=m=y=null}};f.scope.on();const D=f.effect=new kr(N);f.scope.off();const k=f.update=D.run.bind(D),Q=f.job=D.runIfDirty.bind(D);Q.i=f,Q.id=f.uid,D.scheduler=()=>ho(Q),Gt(f,!0),k()},ue=(f,p,m)=>{p.component=f;const y=f.vnode.props;f.vnode=p,f.next=null,pa(f,p.props,y,m),va(f,p.children,m),Pt(),Ro(f),Ot()},re=(f,p,m,y,E,_,F,N,D=!1)=>{const k=f&&f.children,Q=f?f.shapeFlag:0,H=p.children,{patchFlag:z,shapeFlag:Y}=p;if(z>0){if(z&128){rt(k,H,m,y,E,_,F,N,D);return}else if(z&256){se(k,H,m,y,E,_,F,N,D);return}}Y&8?(Q&16&&Ye(k,E,_),H!==k&&c(m,H)):Q&16?Y&16?rt(k,H,m,y,E,_,F,N,D):Ye(k,E,_,!0):(Q&8&&c(m,""),Y&16&&R(H,m,y,E,_,F,N,D))},se=(f,p,m,y,E,_,F,N,D)=>{f=f||nn,p=p||nn;const k=f.length,Q=p.length,H=Math.min(k,Q);let z;for(z=0;z<H;z++){const Y=p[z]=D?At(p[z]):mt(p[z]);O(f[z],Y,m,null,E,_,F,N,D)}k>Q?Ye(f,E,_,!0,!1,H):R(p,m,y,E,_,F,N,D,H)},rt=(f,p,m,y,E,_,F,N,D)=>{let k=0;const Q=p.length;let H=f.length-1,z=Q-1;for(;k<=H&&k<=z;){const Y=f[k],le=p[k]=D?At(p[k]):mt(p[k]);if(bn(Y,le))O(Y,le,m,null,E,_,F,N,D);else break;k++}for(;k<=H&&k<=z;){const Y=f[H],le=p[z]=D?At(p[z]):mt(p[z]);if(bn(Y,le))O(Y,le,m,null,E,_,F,N,D);else break;H--,z--}if(k>H){if(k<=z){const Y=z+1,le=Y<Q?p[Y].el:y;for(;k<=z;)O(null,p[k]=D?At(p[k]):mt(p[k]),m,le,E,_,F,N,D),k++}}else if(k>z)for(;k<=H;)je(f[k],E,_,!0),k++;else{const Y=k,le=k,fe=new Map;for(k=le;k<=z;k++){const $e=p[k]=D?At(p[k]):mt(p[k]);$e.key!=null&&fe.set($e.key,k)}let de,Se=0;const Ce=z-le+1;let Ke=!1,Ue=0;const Kt=new Array(Ce);for(k=0;k<Ce;k++)Kt[k]=0;for(k=Y;k<=H;k++){const $e=f[k];if(Se>=Ce){je($e,E,_,!0);continue}let nt;if($e.key!=null)nt=fe.get($e.key);else for(de=le;de<=z;de++)if(Kt[de-le]===0&&bn($e,p[de])){nt=de;break}nt===void 0?je($e,E,_,!0):(Kt[nt-le]=k+1,nt>=Ue?Ue=nt:Ke=!0,O($e,p[nt],m,null,E,_,F,N,D),Se++)}const Bn=Ke?ya(Kt):nn;for(de=Bn.length-1,k=Ce-1;k>=0;k--){const $e=le+k,nt=p[$e],Kn=p[$e+1],qn=$e+1<Q?Kn.el||bi(Kn):y;Kt[k]===0?O(null,nt,m,qn,E,_,F,N,D):Ke&&(de<0||k!==Bn[de]?Qe(nt,m,qn,2):de--)}}},Qe=(f,p,m,y,E=null)=>{const{el:_,type:F,transition:N,children:D,shapeFlag:k}=f;if(k&6){Qe(f.component.subTree,p,m,y);return}if(k&128){f.suspense.move(p,m,y);return}if(k&64){F.move(f,p,m,$);return}if(F===ce){s(_,p,m);for(let H=0;H<D.length;H++)Qe(D[H],p,m,y);s(f.anchor,p,m);return}if(F===es){q(f,p,m);return}if(y!==2&&k&1&&N)if(y===0)N.persisted&&!_[Os]?s(_,p,m):(N.beforeEnter(_),s(_,p,m),Xe(()=>N.enter(_),E));else{const{leave:H,delayLeave:z,afterLeave:Y}=N,le=()=>{f.ctx.isUnmounted?o(_):s(_,p,m)},fe=()=>{const de=_._isLeaving||!!_[Os];_._isLeaving&&_[Os](!0),N.persisted&&!de?le():H(_,()=>{le(),Y&&Y()})};z?z(_,le,fe):fe()}else s(_,p,m)},je=(f,p,m,y=!1,E=!1)=>{const{type:_,props:F,ref:N,children:D,dynamicChildren:k,shapeFlag:Q,patchFlag:H,dirs:z,cacheIndex:Y,memo:le}=f;if(H===-2&&(E=!1),N!=null&&(Pt(),An(N,null,m,f,!0),Ot()),Y!=null&&(p.renderCache[Y]=void 0),Q&256){p.ctx.deactivate(f);return}const fe=Q&1&&z,de=!rn(f);let Se;if(de&&(Se=F&&F.onVnodeBeforeUnmount)&&dt(Se,p,f),Q&6)_t(f.component,m,y);else{if(Q&128){f.suspense.unmount(m,y);return}fe&&qt(f,null,p,"beforeUnmount"),Q&64?f.type.remove(f,p,m,$,y):k&&!k.hasOnce&&(_!==ce||H>0&&H&64)?Ye(k,p,m,!1,!0):(_===ce&&H&384||!E&&Q&16)&&Ye(D,p,m),y&&Dt(f)}const Ce=le!=null&&Y==null;(de&&(Se=F&&F.onVnodeUnmounted)||fe||Ce)&&Xe(()=>{Se&&dt(Se,p,f),fe&&qt(f,null,p,"unmounted"),Ce&&(f.el=null)},m)},Dt=f=>{const{type:p,el:m,anchor:y,transition:E}=f;if(p===ce){Mt(m,y);return}if(p===es){P(f);return}const _=()=>{o(m),E&&!E.persisted&&E.afterLeave&&E.afterLeave()};if(f.shapeFlag&1&&E&&!E.persisted){const{leave:F,delayLeave:N}=E,D=()=>F(m,_);N?N(f.el,_,D):D()}else _()},Mt=(f,p)=>{let m;for(;f!==p;)m=g(f),o(f),f=m;o(p)},_t=(f,p,m)=>{const{bum:y,scope:E,job:_,subTree:F,um:N,m:D,a:k}=f;Uo(D),Uo(k),y&&Xn(y),E.stop(),_&&(_.flags|=8,je(F,f,p,m)),N&&Xe(N,p),Xe(()=>{f.isUnmounted=!0},p)},Ye=(f,p,m,y=!1,E=!1,_=0)=>{for(let F=_;F<f.length;F++)je(f[F],p,m,y,E)},C=f=>{if(f.shapeFlag&6)return C(f.component.subTree);if(f.shapeFlag&128)return f.suspense.next();const p=g(f.anchor||f.el),m=p&&p[Nl];return m?g(m):p};let B=!1;const L=(f,p,m)=>{let y;f==null?p._vnode&&(je(p._vnode,null,null,!0),y=p._vnode.component):O(p._vnode||null,f,p,null,null,null,m),p._vnode=f,B||(B=!0,Ro(y),Gr(),B=!1)},$={p:O,um:je,m:Qe,r:Dt,mt:Bt,mc:R,pc:re,pbc:Ne,n:C,o:e};return{render:L,hydrate:void 0,createApp:oa(L)}}function $s({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Gt({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function _a(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function gi(e,t,n=!1){const s=e.children,o=t.children;if(X(s)&&X(o))for(let r=0;r<s.length;r++){const i=s[r];let l=o[r];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[r]=At(o[r]),l.el=i.el),!n&&l.patchFlag!==-2&&gi(i,l)),l.type===ws&&(l.patchFlag===-1&&(l=o[r]=At(l)),l.el=i.el),l.type===xt&&!l.el&&(l.el=i.el)}}function ya(e){const t=e.slice(),n=[0];let s,o,r,i,l;const a=e.length;for(s=0;s<a;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(r=0,i=n.length-1;r<i;)l=r+i>>1,e[n[l]]<d?r=l+1:i=l;d<e[n[r]]&&(r>0&&(t[s]=n[r-1]),n[r]=s)}}for(r=n.length,i=n[r-1];r-- >0;)n[r]=i,i=t[i];return n}function vi(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:vi(t)}function Uo(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function bi(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?bi(t.subTree):null}const xi=e=>e.__isSuspense;function wa(e,t){t&&t.pendingBranch?X(e)?t.effects.push(...e):t.effects.push(e):Pl(e)}const ce=Symbol.for("v-fgt"),ws=Symbol.for("v-txt"),xt=Symbol.for("v-cmt"),es=Symbol.for("v-stc"),It=[];let tt=null;function w(e=!1){It.push(tt=e?null:[])}function _o(){It.pop(),tt=It[It.length-1]||null}let Tn=1;function ls(e,t=!1){Tn+=e,e<0&&tt&&t&&(tt.hasOnce=!0)}function _i(e){return e.dynamicChildren=Tn>0?tt||nn:null,_o(),Tn>0&&tt&&tt.push(e),e}function S(e,t,n,s,o,r){return _i(u(e,t,n,s,o,r,!0))}function cn(e,t,n,s,o){return _i(ke(e,t,n,s,o,!0))}function $n(e){return e?e.__v_isVNode===!0:!1}function bn(e,t){return e.type===t.type&&e.key===t.key}const yi=({key:e})=>e??null,ts=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Re(e)||He(e)||ee(e)?{i:Me,r:e,k:t,f:!!n}:e:null);function u(e,t=null,n=null,s=0,o=null,r=e===ce?0:1,i=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&yi(t),ref:t&&ts(t),scopeId:zr,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Me};return l?(as(a,n),r&128&&e.normalize(a)):n&&(a.shapeFlag|=Re(n)?8:16),Tn>0&&!i&&tt&&(a.patchFlag>0||r&6)&&a.patchFlag!==32&&tt.push(a),a}const ke=Ca;function Ca(e,t=null,n=null,s=0,o=null,r=!1){if((!e||e===zl)&&(e=xt),$n(e)){const l=fn(e,t,!0);return n&&as(l,n),Tn>0&&!r&&tt&&(l.shapeFlag&6?tt[tt.indexOf(e)]=l:tt.push(l)),l.patchFlag=-2,l}if(Da(e)&&(e=e.__vccOpts),t){t=Ea(t);let{class:l,style:a}=t;l&&!Re(l)&&(t.class=Ie(l)),ge(a)&&(fo(a)&&!X(a)&&(a=Ve({},a)),t.style=Yt(a))}const i=Re(e)?1:xi(e)?128:xs(e)?64:ge(e)?4:ee(e)?2:0;return u(e,t,n,s,o,i,r,!0)}function Ea(e){return e?fo(e)||ci(e)?Ve({},e):e:null}function fn(e,t,n=!1,s=!1){const{props:o,ref:r,patchFlag:i,children:l,transition:a}=e,d=t?Sa(o||{},t):o,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&yi(d),ref:t&&t.ref?n&&r?X(r)?r.concat(ts(t)):[r,ts(t)]:ts(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ce?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&fn(e.ssContent),ssFallback:e.ssFallback&&fn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&mo(c,a.clone(c)),c}function ye(e=" ",t=0){return ke(ws,null,e,t)}function wi(e,t){const n=ke(es,null,e);return n.staticCount=t,n}function Z(e="",t=!1){return t?(w(),cn(xt,null,e)):ke(xt,null,e)}function mt(e){return e==null||typeof e=="boolean"?ke(xt):X(e)?ke(ce,null,e.slice()):$n(e)?At(e):ke(ws,null,String(e))}function At(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:fn(e)}function as(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(X(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),as(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!ci(t)?t._ctx=Me:o===3&&Me&&(Me.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(ee(t)){if(s&65){as(e,{default:t});return}t={default:t,_ctx:Me},n=32}else t=String(t),s&64?(n=16,t=[ye(t)]):n=8;e.children=t,e.shapeFlag|=n}function Sa(...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=Yt([t.style,s.style]);else if(cs(o)){const r=t[o],i=s[o];i&&r!==i&&!(X(r)&&r.includes(i))?t[o]=r?[].concat(r,i):i:i==null&&r==null&&!fs(o)&&(t[o]=i)}else o!==""&&(t[o]=s[o])}return t}function dt(e,t,n,s=null){ct(e,t,7,[n,s])}const Aa=ri();let ka=0;function Ra(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||Aa,r={uid:ka++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new tl(!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:di(s,o),emitsOptions:ii(s,o),emit:null,emitted:null,propsDefaults:ve,inheritAttrs:s.inheritAttrs,ctx:ve,data:ve,props:ve,attrs:ve,slots:ve,refs:ve,setupState:ve,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 r.ctx={_:r},r.root=t?t.root:r,r.emit=ia.bind(null,r),e.ce&&e.ce(r),r}let Fe=null;const Ia=()=>Fe||Me;let us,Nn;{const e=ms(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),r=>{o.length>1?o.forEach(i=>i(r)):o[0](r)}};us=t("__VUE_INSTANCE_SETTERS__",n=>Fe=n),Nn=t("__VUE_SSR_SETTERS__",n=>Dn=n)}const Hn=e=>{const t=Fe;return us(e),e.scope.on(),()=>{e.scope.off(),us(t)}},Lo=()=>{Fe&&Fe.scope.off(),us(null)};function Ci(e){return e.vnode.shapeFlag&4}let Dn=!1;function Pa(e,t=!1,n=!1){t&&Nn(t);const{props:s,children:o}=e.vnode,r=Ci(e);da(e,s,r,t),ga(e,o,n||t);const i=r?Oa(e,t):void 0;return t&&Nn(!1),i}function Oa(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Yl);const{setup:s}=n;if(s){Pt();const o=e.setupContext=s.length>1?$a(e):null,r=Hn(e),i=Ln(s,e,0,[e.props,o]),l=_r(i);if(Ot(),r(),(l||e.sp)&&!rn(e)&&Zr(e),l){if(i.then(Lo,Lo),t)return i.then(a=>{Nn(!0);try{Fo(e,a,t)}finally{Nn(!1)}}).catch(a=>{bs(a,e,0)});e.asyncDep=i}else Fo(e,i)}else Ei(e)}function Fo(e,t,n){ee(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ge(t)&&(e.setupState=Br(t)),Ei(e)}function Ei(e,t,n){const s=e.type;e.render||(e.render=s.render||bt);{const o=Hn(e);Pt();try{Xl(e)}finally{Ot(),o()}}}const Ta={get(e,t){return Le(e,"get",""),e[t]}};function $a(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Ta),slots:e.slots,emit:e.emit,expose:t}}function Cs(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Br(_l(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in kn)return kn[n](e)},has(t,n){return n in t||n in kn}})):e.proxy}function Na(e,t=!0){return ee(e)?e.displayName||e.name:e.name||t&&e.__name}function Da(e){return ee(e)&&"__vccOpts"in e}const _e=(e,t)=>Sl(e,t,Dn);function Si(e,t,n){try{ls(-1);const s=arguments.length;return s===2?ge(t)&&!X(t)?$n(t)?ke(e,null,[t]):ke(e,t):ke(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&$n(n)&&(n=[n]),ke(e,t,n))}finally{ls(1)}}const Ma="3.5.41";/**
|
|
* @vue/runtime-dom v3.5.41
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
* @license MIT
|
|
**/let Qs;const Ho=typeof window<"u"&&window.trustedTypes;if(Ho)try{Qs=Ho.createPolicy("vue",{createHTML:e=>e})}catch{}const Ai=Qs?e=>Qs.createHTML(e):e=>e,Va="http://www.w3.org/2000/svg",ja="http://www.w3.org/1998/Math/MathML",Et=typeof document<"u"?document:null,Bo=Et&&Et.createElement("template"),Ua={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?Et.createElementNS(Va,e):t==="mathml"?Et.createElementNS(ja,e):n?Et.createElement(e,{is:n}):Et.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>Et.createTextNode(e),createComment:e=>Et.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Et.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,r){const i=n?n.previousSibling:t.lastChild;if(o&&(o===r||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===r||!(o=o.nextSibling)););else{Bo.innerHTML=Ai(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=Bo.content;if(s==="svg"||s==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},La=Symbol("_vtc");function Fa(e,t,n){const s=e[La];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Ko=Symbol("_vod"),Ha=Symbol("_vsh"),Ba=Symbol(""),Ka=/(?:^|;)\s*display\s*:/;function qa(e,t,n){const s=e.style,o=Re(n);let r=!1;if(n&&!o){if(t)if(Re(t))for(const i of t.split(";")){const l=i.slice(0,i.indexOf(":")).trim();n[l]==null&&yn(s,l,"")}else for(const i in t)n[i]==null&&yn(s,i,"");for(const i in n){i==="display"&&(r=!0);const l=n[i];l!=null?Wa(e,i,!Re(t)&&t?t[i]:void 0,l)||yn(s,i,l):yn(s,i,"")}}else if(o){if(t!==n){const i=s[Ba];i&&(n+=";"+i),s.cssText=n,r=Ka.test(n)}}else t&&e.removeAttribute("style");Ko in e&&(e[Ko]=r?s.display:"",e[Ha]&&(s.display="none"))}const qo=/\s*!important$/;function yn(e,t,n){if(X(n))n.forEach(s=>yn(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=Ga(e,t);qo.test(n)?e.setProperty(Xt(s),n.replace(qo,""),"important"):e[s]=n}}const Go=["Webkit","Moz","ms"],Ns={};function Ga(e,t){const n=Ns[t];if(n)return n;let s=Je(t);if(s!=="filter"&&s in e)return Ns[t]=s;s=ps(s);for(let o=0;o<Go.length;o++){const r=Go[o]+s;if(r in e)return Ns[t]=r}return t}function Wa(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Re(s)&&n===s}const Wo="http://www.w3.org/1999/xlink";function zo(e,t,n,s,o,r=Zi(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Wo,t.slice(6,t.length)):e.setAttributeNS(Wo,t,n):n==null||r&&!Er(n)?e.removeAttribute(t):e.setAttribute(t,r?"":at(n)?String(n):n)}function Jo(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Ai(n):n);return}const r=e.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){const l=r==="OPTION"?e.getAttribute("value")||"":e.value,a=n==null?e.type==="checkbox"?"on":"":String(n);(l!==a||!("_value"in e))&&(e.value=a),n==null&&e.removeAttribute(t),e._value=n;return}let i=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=Er(n):n==null&&l==="string"?(n="",i=!0):l==="number"&&(n=0,i=!0)}try{e[t]=n}catch{}i&&e.removeAttribute(o||t)}function Lt(e,t,n,s){e.addEventListener(t,n,s)}function za(e,t,n,s){e.removeEventListener(t,n,s)}const Qo=Symbol("_vei");function Ja(e,t,n,s,o=null){const r=e[Qo]||(e[Qo]={}),i=r[t];if(s&&i)i.value=s;else{const[l,a]=Xa(t);if(s){const d=r[t]=tu(s,o);Lt(e,l,d,a)}else i&&(za(e,l,i,a),r[t]=void 0)}}const Qa=/(Once|Passive|Capture)$/,Ya=/^on:?(?:Once|Passive|Capture)$/;function Xa(e){let t,n;for(;(n=e.match(Qa))&&!Ya.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):Xt(e.slice(2)),t]}let Ds=0;const Za=Promise.resolve(),eu=()=>Ds||(Za.then(()=>Ds=0),Ds=Date.now());function tu(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(X(o)){const r=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{r.call(s),s._stopped=!0};const i=o.slice(),l=[s];for(let a=0;a<i.length&&!s._stopped;a++){const d=i[a];d&&ct(d,t,5,l)}}else ct(o,t,5,[s])};return n.value=e,n.attached=eu(),n}const Yo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,nu=(e,t,n,s,o,r)=>{const i=o==="svg";t==="class"?Fa(e,s,i):t==="style"?qa(e,n,s):cs(t)?fs(t)||Ja(e,t,n,s,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):su(e,t,s,i))?(Jo(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&zo(e,t,s,i,r,t!=="value")):e._isVueCE&&(ou(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Re(s)))?Jo(e,Je(t),s,r,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),zo(e,t,s,i))};function su(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Yo(t)&&ee(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)&&Re(n)?!1:t in e}function ou(e,t){const n=e._def.props;if(!n)return!1;const s=Je(t);return Array.isArray(n)?n.some(o=>Je(o)===s):Object.keys(n).some(o=>Je(o)===s)}const dn=e=>{const t=e.props["onUpdate:modelValue"]||!1;return X(t)?n=>Xn(t,n):t};function ru(e){e.target.composing=!0}function Xo(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const vt=Symbol("_assign"),Jn=Symbol("_initialValue");function Ms(e,t,n){return t&&(e=e.trim()),n&&(e=hs(e)),e}const be={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e.parentNode&&(e.type==="text"?e[Jn]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[Jn]=e.defaultValue.replace(/\r\n?/g,`
|
|
`))),e[vt]=dn(o);const r=s||o.props&&o.props.type==="number";Lt(e,t?"change":"input",i=>{i.target.composing||e[vt](Ms(e.value,n,r))}),(n||r)&&Lt(e,"change",()=>{e.value=Ms(e.value,n,r)}),t||(Lt(e,"compositionstart",ru),Lt(e,"compositionend",Xo),Lt(e,"change",Xo))},mounted(e,{value:t,modifiers:{trim:n,number:s}}){const o=t??"",r=e[Jn];delete e[Jn],r!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==r?e[vt](Ms(e.value,n,s)):e.value=o},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:r}},i){if(e[vt]=dn(i),e.composing)return;const l=(r||e.type==="number")&&!/^0\d/.test(e.value)?hs(e.value):e.value,a=t??"";if(l===a)return;const d=e.getRootNode();(d instanceof Document||d instanceof ShadowRoot)&&d.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===a)||(e.value=a)}},St={deep:!0,created(e,t,n){e[vt]=dn(n),Lt(e,"change",()=>{const s=e._modelValue,o=Vn(e),r=e.checked,i=e[vt];if(X(s)){const l=oo(s,o),a=l!==-1;if(r&&!a)i(s.concat(o));else if(!r&&a){const d=[...s];d.splice(l,1),i(d)}}else if(mn(s)){const l=new Set(s);r?l.add(o):l.delete(o),i(l)}else i(ki(e,r))})},mounted:Zo,beforeUpdate(e,t,n){e[vt]=dn(n),Zo(e,t,n)}};function Zo(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(X(t))o=oo(t,s.props.value)>-1;else if(mn(t))o=t.has(s.props.value);else{if(t===n)return;o=gn(t,ki(e,!0))}e.checked!==o&&(e.checked=o)}const Mn={deep:!0,created(e,{value:t,modifiers:{number:n}},s){e._modelValue=t,Lt(e,"change",()=>{const o=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?hs(Vn(r)):Vn(r));e[vt](e.multiple?mn(e._modelValue)?new Set(o):o:o[0]),e._assigning=!0,po(()=>{e._assigning=!1})}),e[vt]=dn(s)},mounted(e,{value:t}){er(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[vt]=dn(n)},updated(e,{value:t}){e._assigning||er(e,t)}};function er(e,t){const n=e.multiple,s=X(t);if(!(n&&!s&&!mn(t))){for(let o=0,r=e.options.length;o<r;o++){const i=e.options[o],l=Vn(i);if(n)if(s){const a=typeof l;a==="string"||a==="number"?i.selected=t.some(d=>String(d)===String(l)):i.selected=oo(t,l)>-1}else i.selected=t.has(l);else if(gn(Vn(i),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Vn(e){return"_value"in e?e._value:e.value}function ki(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const iu=["ctrl","shift","alt","meta"],lu={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))},Ze=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...r)=>{for(let i=0;i<t.length;i++){const l=lu[t[i]];if(l&&l(o,t))return}return e(o,...r)}))},au=Ve({patchProp:nu},Ua);let tr;function uu(){return tr||(tr=ba(au))}const cu=((...e)=>{const t=uu().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=du(s);if(!o)return;const r=t._component;!ee(r)&&!r.render&&!r.template&&(r.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const i=n(o,!1,fu(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t});function fu(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function du(e){return Re(e)?document.querySelector(e):e}/*!
|
|
* vue-router v4.6.4
|
|
* (c) 2025 Eduardo San Martin Morote
|
|
* @license MIT
|
|
*/const tn=typeof document<"u";function Ri(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function pu(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Ri(e.default)}const pe=Object.assign;function Vs(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 Rn=()=>{},ft=Array.isArray;function nr(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}const Ii=/#/g,hu=/&/g,mu=/\//g,gu=/=/g,vu=/\?/g,Pi=/\+/g,bu=/%5B/g,xu=/%5D/g,Oi=/%5E/g,_u=/%60/g,Ti=/%7B/g,yu=/%7C/g,$i=/%7D/g,wu=/%20/g;function yo(e){return e==null?"":encodeURI(""+e).replace(yu,"|").replace(bu,"[").replace(xu,"]")}function Cu(e){return yo(e).replace(Ti,"{").replace($i,"}").replace(Oi,"^")}function Ys(e){return yo(e).replace(Pi,"%2B").replace(wu,"+").replace(Ii,"%23").replace(hu,"%26").replace(_u,"`").replace(Ti,"{").replace($i,"}").replace(Oi,"^")}function Eu(e){return Ys(e).replace(gu,"%3D")}function Su(e){return yo(e).replace(Ii,"%23").replace(vu,"%3F")}function Au(e){return Su(e).replace(mu,"%2F")}function jn(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const ku=/\/$/,Ru=e=>e.replace(ku,"");function js(e,t,n="/"){let s,o={},r="",i="";const l=t.indexOf("#");let a=t.indexOf("?");return a=l>=0&&a>l?-1:a,a>=0&&(s=t.slice(0,a),r=t.slice(a,l>0?l:t.length),o=e(r.slice(1))),l>=0&&(s=s||t.slice(0,l),i=t.slice(l,t.length)),s=Tu(s??t,n),{fullPath:s+r+i,path:s,query:o,hash:jn(i)}}function Iu(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function sr(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Pu(e,t,n){const s=t.matched.length-1,o=n.matched.length-1;return s>-1&&s===o&&pn(t.matched[s],n.matched[o])&&Ni(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function pn(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Ni(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Ou(e[n],t[n]))return!1;return!0}function Ou(e,t){return ft(e)?or(e,t):ft(t)?or(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function or(e,t){return ft(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function Tu(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),o=s[s.length-1];(o===".."||o===".")&&s.push("");let r=n.length-1,i,l;for(i=0;i<s.length;i++)if(l=s[i],l!==".")if(l==="..")r>1&&r--;else break;return n.slice(0,r).join("/")+"/"+s.slice(i).join("/")}const Vt={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Xs=(function(e){return e.pop="pop",e.push="push",e})({}),Us=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function $u(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),Ru(e)}const Nu=/^[^#]+#/;function Du(e,t){return e.replace(Nu,"#")+t}function Mu(e,t){const n=document.documentElement.getBoundingClientRect(),s=e.getBoundingClientRect();return{behavior:t.behavior,left:s.left-n.left-(t.left||0),top:s.top-n.top-(t.top||0)}}const Es=()=>({left:window.scrollX,top:window.scrollY});function Vu(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=Mu(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function rr(e,t){return(history.state?history.state.position-t:-1)+e}const Zs=new Map;function ju(e,t){Zs.set(e,t)}function Uu(e){const t=Zs.get(e);return Zs.delete(e),t}function Lu(e){return typeof e=="string"||e&&typeof e=="object"}function Di(e){return typeof e=="string"||typeof e=="symbol"}let Ae=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const Mi=Symbol("");Ae.MATCHER_NOT_FOUND+"",Ae.NAVIGATION_GUARD_REDIRECT+"",Ae.NAVIGATION_ABORTED+"",Ae.NAVIGATION_CANCELLED+"",Ae.NAVIGATION_DUPLICATED+"";function hn(e,t){return pe(new Error,{type:e,[Mi]:!0},t)}function Ct(e,t){return e instanceof Error&&Mi in e&&(t==null||!!(e.type&t))}const Fu=["params","query","hash"];function Hu(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of Fu)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function Bu(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(Pi," "),r=o.indexOf("="),i=jn(r<0?o:o.slice(0,r)),l=r<0?null:jn(o.slice(r+1));if(i in t){let a=t[i];ft(a)||(a=t[i]=[a]),a.push(l)}else t[i]=l}return t}function ir(e){let t="";for(let n in e){const s=e[n];if(n=Eu(n),s==null){s!==void 0&&(t+=(t.length?"&":"")+n);continue}(ft(s)?s.map(o=>o&&Ys(o)):[s&&Ys(s)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+n,o!=null&&(t+="="+o))})}return t}function Ku(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 qu=Symbol(""),lr=Symbol(""),Ss=Symbol(""),wo=Symbol(""),eo=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 Ut(e,t,n,s,o,r=i=>i()){const i=s&&(s.enterCallbacks[o]=s.enterCallbacks[o]||[]);return()=>new Promise((l,a)=>{const d=g=>{g===!1?a(hn(Ae.NAVIGATION_ABORTED,{from:n,to:t})):g instanceof Error?a(g):Lu(g)?a(hn(Ae.NAVIGATION_GUARD_REDIRECT,{from:t,to:g})):(i&&s.enterCallbacks[o]===i&&typeof g=="function"&&i.push(g),l())},c=r(()=>e.call(s&&s.instances[o],t,n,d));let h=Promise.resolve(c);e.length<3&&(h=h.then(d)),h.catch(g=>a(g))})}function Ls(e,t,n,s,o=r=>r()){const r=[];for(const i of e)for(const l in i.components){let a=i.components[l];if(!(t!=="beforeRouteEnter"&&!i.instances[l]))if(Ri(a)){const d=(a.__vccOpts||a)[t];d&&r.push(Ut(d,n,s,i,l,o))}else{let d=a();r.push(()=>d.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${l}" at "${i.path}"`);const h=pu(c)?c.default:c;i.mods[l]=c,i.components[l]=h;const g=(h.__vccOpts||h)[t];return g&&Ut(g,n,s,i,l,o)()}))}}return r}function Gu(e,t){const n=[],s=[],o=[],r=Math.max(t.matched.length,e.matched.length);for(let i=0;i<r;i++){const l=t.matched[i];l&&(e.matched.find(d=>pn(d,l))?s.push(l):n.push(l));const a=e.matched[i];a&&(t.matched.find(d=>pn(d,a))||o.push(a))}return[n,s,o]}/*!
|
|
* vue-router v4.6.4
|
|
* (c) 2025 Eduardo San Martin Morote
|
|
* @license MIT
|
|
*/let Wu=()=>location.protocol+"//"+location.host;function Vi(e,t){const{pathname:n,search:s,hash:o}=t,r=e.indexOf("#");if(r>-1){let i=o.includes(e.slice(r))?e.slice(r).length:1,l=o.slice(i);return l[0]!=="/"&&(l="/"+l),sr(l,"")}return sr(n,e)+s+o}function zu(e,t,n,s){let o=[],r=[],i=null;const l=({state:g})=>{const x=Vi(e,location),j=n.value,O=t.value;let G=0;if(g){if(n.value=x,t.value=g,i&&i===j){i=null;return}G=O?g.position-O.position:0}else s(x);o.forEach(K=>{K(n.value,j,{delta:G,type:Xs.pop,direction:G?G>0?Us.forward:Us.back:Us.unknown})})};function a(){i=n.value}function d(g){o.push(g);const x=()=>{const j=o.indexOf(g);j>-1&&o.splice(j,1)};return r.push(x),x}function c(){if(document.visibilityState==="hidden"){const{history:g}=window;if(!g.state)return;g.replaceState(pe({},g.state,{scroll:Es()}),"")}}function h(){for(const g of r)g();r=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:a,listen:d,destroy:h}}function ar(e,t,n,s=!1,o=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:o?Es():null}}function Ju(e){const{history:t,location:n}=window,s={value:Vi(e,n)},o={value:t.state};o.value||r(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function r(a,d,c){const h=e.indexOf("#"),g=h>-1?(n.host&&document.querySelector("base")?e:e.slice(h))+a:Wu()+e+a;try{t[c?"replaceState":"pushState"](d,"",g),o.value=d}catch(x){console.error(x),n[c?"replace":"assign"](g)}}function i(a,d){r(a,pe({},t.state,ar(o.value.back,a,o.value.forward,!0),d,{position:o.value.position}),!0),s.value=a}function l(a,d){const c=pe({},o.value,t.state,{forward:a,scroll:Es()});r(c.current,c,!0),r(a,pe({},ar(s.value,a,null),{position:c.position+1},d),!1),s.value=a}return{location:s,state:o,push:l,replace:i}}function Qu(e){e=$u(e);const t=Ju(e),n=zu(e,t.state,t.location,t.replace);function s(r,i=!0){i||n.pauseListeners(),history.go(r)}const o=pe({location:"",base:e,go:s,createHref:Du.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 zt=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Pe=(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})(Pe||{});const Yu={type:zt.Static,value:""},Xu=/[a-zA-Z0-9_]/;function Zu(e){if(!e)return[[]];if(e==="/")return[[Yu]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(x){throw new Error(`ERR (${n})/"${d}": ${x}`)}let n=Pe.Static,s=n;const o=[];let r;function i(){r&&o.push(r),r=[]}let l=0,a,d="",c="";function h(){d&&(n===Pe.Static?r.push({type:zt.Static,value:d}):n===Pe.Param||n===Pe.ParamRegExp||n===Pe.ParamRegExpEnd?(r.length>1&&(a==="*"||a==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),r.push({type:zt.Param,value:d,regexp:c,repeatable:a==="*"||a==="+",optional:a==="*"||a==="?"})):t("Invalid state to consume buffer"),d="")}function g(){d+=a}for(;l<e.length;){if(a=e[l++],a==="\\"&&n!==Pe.ParamRegExp){s=n,n=Pe.EscapeNext;continue}switch(n){case Pe.Static:a==="/"?(d&&h(),i()):a===":"?(h(),n=Pe.Param):g();break;case Pe.EscapeNext:g(),n=s;break;case Pe.Param:a==="("?n=Pe.ParamRegExp:Xu.test(a)?g():(h(),n=Pe.Static,a!=="*"&&a!=="?"&&a!=="+"&&l--);break;case Pe.ParamRegExp:a===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+a:n=Pe.ParamRegExpEnd:c+=a;break;case Pe.ParamRegExpEnd:h(),n=Pe.Static,a!=="*"&&a!=="?"&&a!=="+"&&l--,c="";break;default:t("Unknown state");break}}return n===Pe.ParamRegExp&&t(`Unfinished custom RegExp for param "${d}"`),h(),i(),o}const ur="[^/]+?",ec={sensitive:!1,strict:!1,start:!0,end:!0};var Ge=(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})(Ge||{});const tc=/[.+*?^${}()[\]/\\]/g;function nc(e,t){const n=pe({},ec,t),s=[];let o=n.start?"^":"";const r=[];for(const d of e){const c=d.length?[]:[Ge.Root];n.strict&&!d.length&&(o+="/");for(let h=0;h<d.length;h++){const g=d[h];let x=Ge.Segment+(n.sensitive?Ge.BonusCaseSensitive:0);if(g.type===zt.Static)h||(o+="/"),o+=g.value.replace(tc,"\\$&"),x+=Ge.Static;else if(g.type===zt.Param){const{value:j,repeatable:O,optional:G,regexp:K}=g;r.push({name:j,repeatable:O,optional:G});const M=K||ur;if(M!==ur){x+=Ge.BonusCustomRegExp;try{`${M}`}catch(P){throw new Error(`Invalid custom RegExp for param "${j}" (${M}): `+P.message)}}let q=O?`((?:${M})(?:/(?:${M}))*)`:`(${M})`;h||(q=G&&d.length<2?`(?:/${q})`:"/"+q),G&&(q+="?"),o+=q,x+=Ge.Dynamic,G&&(x+=Ge.BonusOptional),O&&(x+=Ge.BonusRepeatable),M===".*"&&(x+=Ge.BonusWildcard)}c.push(x)}s.push(c)}if(n.strict&&n.end){const d=s.length-1;s[d][s[d].length-1]+=Ge.BonusStrict}n.strict||(o+="/?"),n.end?o+="$":n.strict&&!o.endsWith("/")&&(o+="(?:/|$)");const i=new RegExp(o,n.sensitive?"":"i");function l(d){const c=d.match(i),h={};if(!c)return null;for(let g=1;g<c.length;g++){const x=c[g]||"",j=r[g-1];h[j.name]=x&&j.repeatable?x.split("/"):x}return h}function a(d){let c="",h=!1;for(const g of e){(!h||!c.endsWith("/"))&&(c+="/"),h=!1;for(const x of g)if(x.type===zt.Static)c+=x.value;else if(x.type===zt.Param){const{value:j,repeatable:O,optional:G}=x,K=j in d?d[j]:"";if(ft(K)&&!O)throw new Error(`Provided param "${j}" is an array but it is not repeatable (* or + modifiers)`);const M=ft(K)?K.join("/"):K;if(!M)if(G)g.length<2&&(c.endsWith("/")?c=c.slice(0,-1):h=!0);else throw new Error(`Missing required param "${j}"`);c+=M}}return c||"/"}return{re:i,score:s,keys:r,parse:l,stringify:a}}function sc(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]===Ge.Static+Ge.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Ge.Static+Ge.Segment?1:-1:0}function ji(e,t){let n=0;const s=e.score,o=t.score;for(;n<s.length&&n<o.length;){const r=sc(s[n],o[n]);if(r)return r;n++}if(Math.abs(o.length-s.length)===1){if(cr(s))return 1;if(cr(o))return-1}return o.length-s.length}function cr(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const oc={strict:!1,end:!0,sensitive:!1};function rc(e,t,n){const s=nc(Zu(e.path),n),o=pe(s,{record:e,parent:t,children:[],alias:[]});return t&&!o.record.aliasOf==!t.record.aliasOf&&t.children.push(o),o}function ic(e,t){const n=[],s=new Map;t=nr(oc,t);function o(h){return s.get(h)}function r(h,g,x){const j=!x,O=dr(h);O.aliasOf=x&&x.record;const G=nr(t,h),K=[O];if("alias"in h){const P=typeof h.alias=="string"?[h.alias]:h.alias;for(const A of P)K.push(dr(pe({},O,{components:x?x.record.components:O.components,path:A,aliasOf:x?x.record:O})))}let M,q;for(const P of K){const{path:A}=P;if(g&&A[0]!=="/"){const V=g.record.path,te=V[V.length-1]==="/"?"":"/";P.path=g.record.path+(A&&te+A)}if(M=rc(P,g,G),x?x.alias.push(M):(q=q||M,q!==M&&q.alias.push(M),j&&h.name&&!pr(M)&&i(h.name)),Ui(M)&&a(M),O.children){const V=O.children;for(let te=0;te<V.length;te++)r(V[te],M,x&&x.children[te])}x=x||M}return q?()=>{i(q)}:Rn}function i(h){if(Di(h)){const g=s.get(h);g&&(s.delete(h),n.splice(n.indexOf(g),1),g.children.forEach(i),g.alias.forEach(i))}else{const g=n.indexOf(h);g>-1&&(n.splice(g,1),h.record.name&&s.delete(h.record.name),h.children.forEach(i),h.alias.forEach(i))}}function l(){return n}function a(h){const g=uc(h,n);n.splice(g,0,h),h.record.name&&!pr(h)&&s.set(h.record.name,h)}function d(h,g){let x,j={},O,G;if("name"in h&&h.name){if(x=s.get(h.name),!x)throw hn(Ae.MATCHER_NOT_FOUND,{location:h});G=x.record.name,j=pe(fr(g.params,x.keys.filter(q=>!q.optional).concat(x.parent?x.parent.keys.filter(q=>q.optional):[]).map(q=>q.name)),h.params&&fr(h.params,x.keys.map(q=>q.name))),O=x.stringify(j)}else if(h.path!=null)O=h.path,x=n.find(q=>q.re.test(O)),x&&(j=x.parse(O),G=x.record.name);else{if(x=g.name?s.get(g.name):n.find(q=>q.re.test(g.path)),!x)throw hn(Ae.MATCHER_NOT_FOUND,{location:h,currentLocation:g});G=x.record.name,j=pe({},g.params,h.params),O=x.stringify(j)}const K=[];let M=x;for(;M;)K.unshift(M.record),M=M.parent;return{name:G,path:O,params:j,matched:K,meta:ac(K)}}e.forEach(h=>r(h));function c(){n.length=0,s.clear()}return{addRoute:r,resolve:d,removeRoute:i,clearRoutes:c,getRoutes:l,getRecordMatcher:o}}function fr(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function dr(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:lc(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 lc(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function pr(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function ac(e){return e.reduce((t,n)=>pe(t,n.meta),{})}function uc(e,t){let n=0,s=t.length;for(;n!==s;){const r=n+s>>1;ji(e,t[r])<0?s=r:n=r+1}const o=cc(e);return o&&(s=t.lastIndexOf(o,s-1)),s}function cc(e){let t=e;for(;t=t.parent;)if(Ui(t)&&ji(e,t)===0)return t}function Ui({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function hr(e){const t=lt(Ss),n=lt(wo),s=_e(()=>{const a=Te(e.to);return t.resolve(a)}),o=_e(()=>{const{matched:a}=s.value,{length:d}=a,c=a[d-1],h=n.matched;if(!c||!h.length)return-1;const g=h.findIndex(pn.bind(null,c));if(g>-1)return g;const x=mr(a[d-2]);return d>1&&mr(c)===x&&h[h.length-1].path!==x?h.findIndex(pn.bind(null,a[d-2])):g}),r=_e(()=>o.value>-1&&mc(n.params,s.value.params)),i=_e(()=>o.value>-1&&o.value===n.matched.length-1&&Ni(n.params,s.value.params));function l(a={}){if(hc(a)){const d=t[Te(e.replace)?"replace":"push"](Te(e.to)).catch(Rn);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:s,href:_e(()=>s.value.href),isActive:r,isExactActive:i,navigate:l}}function fc(e){return e.length===1?e[0]:e}const dc=Xr({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:hr,setup(e,{slots:t}){const n=vs(hr(e)),{options:s}=lt(Ss),o=_e(()=>({[gr(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[gr(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const r=t.default&&fc(t.default(n));return e.custom?r:Si("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},r)}}}),pc=dc;function hc(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function mc(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((r,i)=>r.valueOf()!==o[i].valueOf()))return!1}return!0}function mr(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const gr=(e,t,n)=>e??t??n,gc=Xr({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=lt(eo),o=_e(()=>e.route||s.value),r=lt(lr,0),i=_e(()=>{let d=Te(r);const{matched:c}=o.value;let h;for(;(h=c[d])&&!h.components;)d++;return d}),l=_e(()=>o.value.matched[i.value]);Zn(lr,_e(()=>i.value+1)),Zn(qu,l),Zn(eo,o);const a=W();return Ht(()=>[a.value,l.value,e.name],([d,c,h],[g,x,j])=>{c&&(c.instances[h]=d,x&&x!==c&&d&&d===g&&(c.leaveGuards.size||(c.leaveGuards=x.leaveGuards),c.updateGuards.size||(c.updateGuards=x.updateGuards))),d&&c&&(!x||!pn(c,x)||!g)&&(c.enterCallbacks[h]||[]).forEach(O=>O(d))},{flush:"post"}),()=>{const d=o.value,c=e.name,h=l.value,g=h&&h.components[c];if(!g)return vr(n.default,{Component:g,route:d});const x=h.props[c],j=x?x===!0?d.params:typeof x=="function"?x(d):x:null,G=Si(g,pe({},j,t,{onVnodeUnmounted:K=>{K.component.isUnmounted&&(h.instances[c]=null)},ref:a}));return vr(n.default,{Component:G,route:d})||G}}});function vr(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const vc=gc;function bc(e){const t=ic(e.routes,e),n=e.parseQuery||Bu,s=e.stringifyQuery||ir,o=e.history,r=xn(),i=xn(),l=xn(),a=yl(Vt);let d=Vt;tn&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=Vs.bind(null,C=>""+C),h=Vs.bind(null,Au),g=Vs.bind(null,jn);function x(C,B){let L,$;return Di(C)?(L=t.getRecordMatcher(C),$=B):$=C,t.addRoute($,L)}function j(C){const B=t.getRecordMatcher(C);B&&t.removeRoute(B)}function O(){return t.getRoutes().map(C=>C.record)}function G(C){return!!t.getRecordMatcher(C)}function K(C,B){if(B=pe({},B||a.value),typeof C=="string"){const m=js(n,C,B.path),y=t.resolve({path:m.path},B),E=o.createHref(m.fullPath);return pe(m,y,{params:g(y.params),hash:jn(m.hash),redirectedFrom:void 0,href:E})}let L;if(C.path!=null)L=pe({},C,{path:js(n,C.path,B.path).path});else{const m=pe({},C.params);for(const y in m)m[y]==null&&delete m[y];L=pe({},C,{params:h(m)}),B.params=h(B.params)}const $=t.resolve(L,B),oe=C.hash||"";$.params=c(g($.params));const f=Iu(s,pe({},C,{hash:Cu(oe),path:$.path})),p=o.createHref(f);return pe({fullPath:f,hash:oe,query:s===ir?Ku(C.query):C.query||{}},$,{redirectedFrom:void 0,href:p})}function M(C){return typeof C=="string"?js(n,C,a.value.path):pe({},C)}function q(C,B){if(d!==C)return hn(Ae.NAVIGATION_CANCELLED,{from:B,to:C})}function P(C){return te(C)}function A(C){return P(pe(M(C),{replace:!0}))}function V(C,B){const L=C.matched[C.matched.length-1];if(L&&L.redirect){const{redirect:$}=L;let oe=typeof $=="function"?$(C,B):$;return typeof oe=="string"&&(oe=oe.includes("?")||oe.includes("#")?oe=M(oe):{path:oe},oe.params={}),pe({query:C.query,hash:C.hash,params:oe.path!=null?{}:C.params},oe)}}function te(C,B){const L=d=K(C),$=a.value,oe=C.state,f=C.force,p=C.replace===!0,m=V(L,$);if(m)return te(pe(M(m),{state:typeof m=="object"?pe({},oe,m.state):oe,force:f,replace:p}),B||L);const y=L;y.redirectedFrom=B;let E;return!f&&Pu(s,$,L)&&(E=hn(Ae.NAVIGATION_DUPLICATED,{to:y,from:$}),Qe($,$,!0,!1)),(E?Promise.resolve(E):Ne(y,$)).catch(_=>Ct(_)?Ct(_,Ae.NAVIGATION_GUARD_REDIRECT)?_:rt(_):re(_,y,$)).then(_=>{if(_){if(Ct(_,Ae.NAVIGATION_GUARD_REDIRECT))return te(pe({replace:p},M(_.to),{state:typeof _.to=="object"?pe({},oe,_.to.state):oe,force:f}),B||y)}else _=et(y,$,!0,p,oe);return J(y,$,_),_})}function R(C,B){const L=q(C,B);return L?Promise.reject(L):Promise.resolve()}function U(C){const B=Mt.values().next().value;return B&&typeof B.runWithContext=="function"?B.runWithContext(C):C()}function Ne(C,B){let L;const[$,oe,f]=Gu(C,B);L=Ls($.reverse(),"beforeRouteLeave",C,B);for(const m of $)m.leaveGuards.forEach(y=>{L.push(Ut(y,C,B))});const p=R.bind(null,C,B);return L.push(p),Ye(L).then(()=>{L=[];for(const m of r.list())L.push(Ut(m,C,B));return L.push(p),Ye(L)}).then(()=>{L=Ls(oe,"beforeRouteUpdate",C,B);for(const m of oe)m.updateGuards.forEach(y=>{L.push(Ut(y,C,B))});return L.push(p),Ye(L)}).then(()=>{L=[];for(const m of f)if(m.beforeEnter)if(ft(m.beforeEnter))for(const y of m.beforeEnter)L.push(Ut(y,C,B));else L.push(Ut(m.beforeEnter,C,B));return L.push(p),Ye(L)}).then(()=>(C.matched.forEach(m=>m.enterCallbacks={}),L=Ls(f,"beforeRouteEnter",C,B,U),L.push(p),Ye(L))).then(()=>{L=[];for(const m of i.list())L.push(Ut(m,C,B));return L.push(p),Ye(L)}).catch(m=>Ct(m,Ae.NAVIGATION_CANCELLED)?m:Promise.reject(m))}function J(C,B,L){l.list().forEach($=>U(()=>$(C,B,L)))}function et(C,B,L,$,oe){const f=q(C,B);if(f)return f;const p=B===Vt,m=tn?history.state:{};L&&($||p?o.replace(C.fullPath,pe({scroll:p&&m&&m.scroll},oe)):o.push(C.fullPath,oe)),a.value=C,Qe(C,B,L,p),rt()}let Be;function Bt(){Be||(Be=o.listen((C,B,L)=>{if(!_t.listening)return;const $=K(C),oe=V($,_t.currentRoute.value);if(oe){te(pe(oe,{replace:!0,force:!0}),$).catch(Rn);return}d=$;const f=a.value;tn&&ju(rr(f.fullPath,L.delta),Es()),Ne($,f).catch(p=>Ct(p,Ae.NAVIGATION_ABORTED|Ae.NAVIGATION_CANCELLED)?p:Ct(p,Ae.NAVIGATION_GUARD_REDIRECT)?(te(pe(M(p.to),{force:!0}),$).then(m=>{Ct(m,Ae.NAVIGATION_ABORTED|Ae.NAVIGATION_DUPLICATED)&&!L.delta&&L.type===Xs.pop&&o.go(-1,!1)}).catch(Rn),Promise.reject()):(L.delta&&o.go(-L.delta,!1),re(p,$,f))).then(p=>{p=p||et($,f,!1),p&&(L.delta&&!Ct(p,Ae.NAVIGATION_CANCELLED)?o.go(-L.delta,!1):L.type===Xs.pop&&Ct(p,Ae.NAVIGATION_ABORTED|Ae.NAVIGATION_DUPLICATED)&&o.go(-1,!1)),J($,f,p)}).catch(Rn)}))}let Nt=xn(),we=xn(),ue;function re(C,B,L){rt(C);const $=we.list();return $.length?$.forEach(oe=>oe(C,B,L)):console.error(C),Promise.reject(C)}function se(){return ue&&a.value!==Vt?Promise.resolve():new Promise((C,B)=>{Nt.add([C,B])})}function rt(C){return ue||(ue=!C,Bt(),Nt.list().forEach(([B,L])=>C?L(C):B()),Nt.reset()),C}function Qe(C,B,L,$){const{scrollBehavior:oe}=e;if(!tn||!oe)return Promise.resolve();const f=!L&&Uu(rr(C.fullPath,0))||($||!L)&&history.state&&history.state.scroll||null;return po().then(()=>oe(C,B,f)).then(p=>p&&Vu(p)).catch(p=>re(p,C,B))}const je=C=>o.go(C);let Dt;const Mt=new Set,_t={currentRoute:a,listening:!0,addRoute:x,removeRoute:j,clearRoutes:t.clearRoutes,hasRoute:G,getRoutes:O,resolve:K,options:e,push:P,replace:A,go:je,back:()=>je(-1),forward:()=>je(1),beforeEach:r.add,beforeResolve:i.add,afterEach:l.add,onError:we.add,isReady:se,install(C){C.component("RouterLink",pc),C.component("RouterView",vc),C.config.globalProperties.$router=_t,Object.defineProperty(C.config.globalProperties,"$route",{enumerable:!0,get:()=>Te(a)}),tn&&!Dt&&a.value===Vt&&(Dt=!0,P(o.location).catch($=>{}));const B={};for(const $ in Vt)Object.defineProperty(B,$,{get:()=>a.value[$],enumerable:!0});C.provide(Ss,_t),C.provide(wo,Fr(B)),C.provide(eo,a);const L=C.unmount;Mt.add(C),C.unmount=function(){Mt.delete(C),Mt.size<1&&(d=Vt,Be&&Be(),Be=null,a.value=Vt,Dt=!1,ue=!1),L()}}};function Ye(C){return C.reduce((B,L)=>B.then(()=>U(L)),Promise.resolve())}return _t}function Co(){return lt(Ss)}function Li(e){return lt(wo)}const Qn=window.location.pathname.startsWith("/portal/"),ze={esPortal:Qn,baseRuta:Qn?"/portal/studio/":"/studio/",apiBase:Qn?"/portal":"/app",urlLogin:Qn?"/portal/login":"/login"};function ie(e){return ze.apiBase+e}async function Yn(e,t={}){const n=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t.headers}}),s=n.headers.get("content-type")||"";if(n.redirected||!s.includes("application/json"))throw window.location.href=ze.urlLogin,new Error("Sesión expirada");const o=await n.json();if(!n.ok){const r=typeof(o==null?void 0:o.error)=="string"?o.error:o==null?void 0:o.message;throw new Error(r||"Error de servidor")}return o}const ae={get:e=>Yn(e),post:(e,t)=>Yn(e,{method:"POST",body:JSON.stringify(t)}),put:(e,t)=>Yn(e,{method:"PUT",body:JSON.stringify(t)}),del:e=>Yn(e,{method:"DELETE"})},wn=W(!1),xc={class:"h-14 px-4 flex items-center border-b border-borde"},_c={key:0,class:"px-3 pt-3"},yc={key:1,class:"px-3 pt-2 text-xs text-red-600 dark:text-red-400"},wc={class:"flex-1 overflow-y-auto px-2 py-3 space-y-0.5"},Cc={key:0,class:"px-2 text-xs text-tenue"},Ec={key:1,class:"px-2 text-xs text-tenue"},Sc={class:"truncate"},Ac={class:"flex items-center gap-1 mt-0.5"},kc={class:"text-[11px] text-tenue"},Rc={key:0,class:"flex opacity-0 group-hover:opacity-100 transition-opacity pr-1.5 gap-0.5"},Ic=["onClick"],Pc=["onClick"],Oc={class:"card w-full max-w-lg p-6 animate-escalar shadow-2xl"},Tc={class:"font-semibold text-texto mb-4"},$c={key:0,class:"grid grid-cols-2 gap-3"},Nc=["value"],Dc={class:"text-[11px] text-tenue mt-1"},Mc=["value"],Vc={class:"text-[11px] text-tenue mt-1"},jc={class:"flex items-center gap-2 text-sm text-texto"},Uc={class:"flex justify-end gap-2 pt-2"},Lc={__name:"Sidebar",setup(e,{expose:t}){const n=Li(),s=Co(),o=W([]),r=W([]),i=W([]),l=W(!0),a=W(""),d=W(!1),c=W(null),h=W(x()),g=_e(()=>n.params.tenantId||n.params.id);Ht(()=>n.fullPath,()=>{wn.value=!1});function x(){return{nombre:"",dominios_permitidos:"",activo:!0,cliente_id:null,plan_id:null}}async function j(){l.value=!0,a.value="";try{const A=await ae.get(ie("/umind/tenants"));o.value=A.items||[]}catch(A){a.value=A.message}finally{l.value=!1}}function O(A){return Array.isArray(A)?A:(A==null?void 0:A.items)||(A==null?void 0:A.registros)||[]}async function G(){if(ze.esPortal)return;const[A,V]=await Promise.allSettled([ae.get("/app/api/clientes/select"),ae.get("/app/umind-planes/list")]);r.value=A.status==="fulfilled"?O(A.value):[],i.value=V.status==="fulfilled"?O(V.value):[];const te=[];A.status==="rejected"&&te.push("clientes"),V.status==="rejected"&&te.push("planes"),te.length&&(a.value=`No se pudo cargar la lista de ${te.join(" ni ")}.`)}function K(){c.value=null,h.value=x(),d.value=!0}function M(A){c.value=A,h.value={nombre:A.nombre,dominios_permitidos:A.dominios_permitidos,activo:A.activo,cliente_id:A.cliente_id??null,plan_id:A.plan_id??null},d.value=!0}async function q(){const A={...h.value,dominios_permitidos:h.value.dominios_permitidos.split(",").map(V=>V.trim()).filter(Boolean)};try{if(c.value)await ae.put(ie(`/umind/tenants/${c.value.ID}`),A),d.value=!1,await j();else{const V=await ae.post(ie("/umind/tenants"),A);d.value=!1,await j(),s.push(`/tenants/${V.id}`)}}catch(V){a.value=V.message}}async function P(A){confirm(`¿Eliminar el tenant "${A.nombre}"? Esto borra también sus agentes. No se puede deshacer.`)&&(await ae.del(ie(`/umind/tenants/${A.ID}`)),g.value===String(A.ID)&&s.push("/"),await j())}return t({recargar:j}),vo(()=>{j(),G()}),(A,V)=>{const te=Fn("router-link");return w(),S(ce,null,[Te(wn)?(w(),S("div",{key:0,class:"fixed inset-0 bg-black/50 z-30 md:hidden",onClick:V[0]||(V[0]=R=>wn.value=!1)})):Z("",!0),u("aside",{class:Ie(["w-64 shrink-0 flex flex-col border-r border-borde bg-superficie fixed inset-y-0 left-0 z-40 transition-transform duration-200 md:static md:h-screen md:sticky md:top-0 md:translate-x-0",Te(wn)?"translate-x-0":"-translate-x-full"])},[u("div",xc,[ke(te,{to:"/",class:"text-base font-semibold text-texto"},{default:Ft(()=>[...V[8]||(V[8]=[ye(" uMind ",-1),u("span",{class:"text-brand"},"Studio",-1)])]),_:1})]),Te(ze).esPortal?Z("",!0):(w(),S("div",_c,[u("button",{class:"btn-primary w-full",onClick:K}," + Nuevo tenant ")])),a.value?(w(),S("p",yc,T(a.value),1)):Z("",!0),u("nav",wc,[l.value?(w(),S("p",Cc,"Cargando...")):o.value.length===0?(w(),S("p",Ec,T(Te(ze).esPortal?"Todavía no tenés ningún espacio asignado. Escribinos y lo activamos.":"Sin tenants todavía."),1)):Z("",!0),(w(!0),S(ce,null,Oe(o.value,R=>(w(),S("div",{key:R.ID,class:Ie(["group flex items-center rounded-lg transition-colors",g.value===String(R.ID)?"bg-brand/10":"hover:bg-elevado"])},[ke(te,{to:`/tenants/${R.ID}`,class:Ie(["flex-1 min-w-0 px-2.5 py-2 text-sm",g.value===String(R.ID)?"text-brand font-medium":"text-texto"])},{default:Ft(()=>[u("div",Sc,T(R.nombre),1),u("div",Ac,[u("span",{class:Ie(["w-1.5 h-1.5 rounded-full",R.activo?"bg-green-500":"bg-tenue/40"])},null,2),u("span",kc,T(R.activo?"activo":"inactivo"),1)])]),_:2},1032,["to","class"]),Te(ze).esPortal?Z("",!0):(w(),S("div",Rc,[u("button",{class:"p-1 text-tenue hover:text-texto",title:"Editar",onClick:U=>M(R)}," ✎ ",8,Ic),u("button",{class:"p-1 text-tenue hover:text-red-600",title:"Eliminar",onClick:U=>P(R)}," ✕ ",8,Pc)]))],2))),128))])],2),d.value?(w(),S("div",{key:1,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:V[7]||(V[7]=Ze(R=>d.value=!1,["self"]))},[u("div",Oc,[u("h2",Tc,T(c.value?"Editar tenant":"Nuevo tenant"),1),V[17]||(V[17]=u("p",{class:"text-xs text-tenue mb-3"}," Un tenant es el negocio/sitio dueño de los dominios permitidos. La config de IA, tono y demás se configuran por agente, dentro del tenant. ",-1)),u("form",{class:"space-y-3",onSubmit:Ze(q,["prevent"])},[u("div",null,[V[9]||(V[9]=u("label",{class:"label"},"Nombre",-1)),ne(u("input",{"onUpdate:modelValue":V[1]||(V[1]=R=>h.value.nombre=R),required:"",class:"input"},null,512),[[be,h.value.nombre]])]),u("div",null,[V[10]||(V[10]=u("label",{class:"label"},"Dominios permitidos (separados por coma)",-1)),ne(u("input",{"onUpdate:modelValue":V[2]||(V[2]=R=>h.value.dominios_permitidos=R),placeholder:"ejemplo.com, www.ejemplo.com",required:"",class:"input"},null,512),[[be,h.value.dominios_permitidos]])]),Te(ze).esPortal?Z("",!0):(w(),S("div",$c,[u("div",null,[V[12]||(V[12]=u("label",{class:"label"},"Cliente",-1)),ne(u("select",{"onUpdate:modelValue":V[3]||(V[3]=R=>h.value.cliente_id=R),class:"input"},[V[11]||(V[11]=u("option",{value:null},"— sin asignar —",-1)),(w(!0),S(ce,null,Oe(r.value,R=>(w(),S("option",{key:R.ID,value:R.ID},T(R.nombre),9,Nc))),128))],512),[[Mn,h.value.cliente_id]]),u("p",Dc,T(r.value.length?"Define quién ve este tenant desde el portal.":"No hay clientes activos — creá uno en Clientes."),1)]),u("div",null,[V[14]||(V[14]=u("label",{class:"label"},"Plan",-1)),ne(u("select",{"onUpdate:modelValue":V[4]||(V[4]=R=>h.value.plan_id=R),class:"input"},[V[13]||(V[13]=u("option",{value:null},"— sin plan —",-1)),(w(!0),S(ce,null,Oe(i.value,R=>(w(),S("option",{key:R.ID,value:R.ID},T(R.nombre)+" ("+T(R.max_agentes===0?"∞":R.max_agentes)+" agentes) ",9,Mc))),128))],512),[[Mn,h.value.plan_id]]),u("p",Vc,T(i.value.length?"Límite de agentes y precios de consumo.":"No hay planes — creá uno en uMind Planes."),1)])])),u("label",jc,[ne(u("input",{"onUpdate:modelValue":V[5]||(V[5]=R=>h.value.activo=R),type:"checkbox"},null,512),[[St,h.value.activo]]),V[15]||(V[15]=ye(" Activo ",-1))]),u("div",Uc,[u("button",{type:"button",class:"btn-ghost",onClick:V[6]||(V[6]=R=>d.value=!1)}," Cancelar "),V[16]||(V[16]=u("button",{type:"submit",class:"btn-primary"}," Guardar ",-1))])],32)])])):Z("",!0)],64)}}},Fi="umind-tema";function Fc(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"oscuro":"claro"}const an=W(localStorage.getItem(Fi)||Fc());function Hi(){document.documentElement.classList.toggle("dark",an.value==="oscuro")}function br(){an.value=an.value==="oscuro"?"claro":"oscuro",localStorage.setItem(Fi,an.value),Hi()}Hi();const Hc={class:"min-h-screen flex"},Bc={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"],Gc={class:"text-base leading-none"},Wc={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"},zc={__name:"App",setup(e){return(t,n)=>{const s=Fn("router-view");return w(),S("div",Hc,[ke(Lc),u("main",Bc,[u("header",Kc,[u("button",{class:"btn-ghost !px-2 !py-1.5 md:hidden","aria-label":"Abrir menú",onClick:n[0]||(n[0]=o=>wn.value=!0)},[...n[2]||(n[2]=[u("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 24 24"},[u("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 6h16M4 12h16M4 18h16"})],-1)])]),n[3]||(n[3]=u("span",{class:"flex-1"},null,-1)),u("button",{class:"btn-ghost !px-2.5 !py-1.5",title:Te(an)==="oscuro"?"Cambiar a claro":"Cambiar a oscuro",onClick:n[1]||(n[1]=(...o)=>Te(br)&&Te(br)(...o))},[u("span",Gc,T(Te(an)==="oscuro"?"☀️":"🌙"),1)],8,qc)]),u("div",Wc,[ke(s)])])])}}},Jc={key:0,class:"flex flex-col items-center justify-center py-24 text-sm text-tenue"},Qc={key:1,class:"max-w-md mx-auto text-center py-20"},Yc={key:2,class:"flex flex-col items-center justify-center text-center py-24"},Xc={class:"text-lg font-medium text-texto"},Zc={class:"text-sm text-tenue mt-1"},ef={__name:"Home",setup(e){const t=Co(),n=W(ze.esPortal),s=W(!1);async function o(){if(ze.esPortal)try{const i=(await ae.get(ie("/umind/tenants"))).items||[];if(i.length===0){s.value=!0;return}if(i.length!==1)return;const l=i[0].ID,d=(await ae.get(ie(`/umind/agentes?tenant_id=${l}`))).items||[];if(d.length===1){t.replace(`/tenants/${l}/agentes/${d[0].ID}`);return}t.replace(`/tenants/${l}`)}catch{}finally{n.value=!1}}return vo(o),(r,i)=>n.value?(w(),S("div",Jc," Abriendo tu asistente… ")):s.value?(w(),S("div",Qc,[...i[0]||(i[0]=[wi('<div class="text-4xl mb-4">🤖</div><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>',5)])])):(w(),S("div",Yc,[i[1]||(i[1]=u("div",{class:"text-4xl mb-4"},"💬",-1)),u("h1",Xc,T(Te(ze).esPortal?"Elegí tu espacio de la izquierda":"Elegí un tenant de la izquierda"),1),u("p",Zc,T(Te(ze).esPortal?"Adentro vas a poder crear y configurar tus agentes.":"o creá uno nuevo para empezar a configurar su agente."),1)]))}},tf={class:"flex flex-col items-center justify-center text-center py-12 px-6"},nf={key:0,class:"text-3xl mb-3 opacity-70"},sf={class:"text-sm font-medium text-texto"},of={key:1,class:"text-xs text-tenue mt-1 max-w-sm"},rf={class:"mt-4"},Bi={__name:"UiEmptyState",props:{icono:{type:String,default:""},titulo:String,detalle:String},setup(e){return(t,n)=>(w(),S("div",tf,[e.icono?(w(),S("div",nf,T(e.icono),1)):Z("",!0),u("p",sf,T(e.titulo),1),e.detalle?(w(),S("p",of,T(e.detalle),1)):Z("",!0),u("div",rf,[Ql(t.$slots,"default")])]))}},lf={key:0,class:"mb-6"},af={class:"flex items-start justify-between gap-4"},uf={class:"text-xl font-semibold text-texto"},cf={class:"text-xs text-tenue mt-1"},ff={key:1,class:"text-sm text-red-600 dark:text-red-400 mb-4"},df={class:"flex items-center justify-between mb-4"},pf={class:"flex items-center gap-2"},hf={key:0,class:"badge-alerta"},mf={key:1,class:"badge-neutro"},gf=["disabled"],vf={key:2,class:"text-xs text-tenue -mt-2 mb-4"},bf={key:3,class:"text-xs text-tenue -mt-2 mb-4"},xf={key:4,class:"grid gap-3 sm:grid-cols-2"},_f=["disabled"],yf={key:6,class:"grid gap-3 sm:grid-cols-2"},wf={class:"flex items-start gap-3"},Cf={class:"min-w-0 flex-1"},Ef={class:"flex items-center gap-2"},Sf={class:"font-medium text-texto truncate"},Af={class:"text-xs text-tenue mt-0.5 truncate"},kf={class:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0"},Rf=["onClick"],If=["onClick"],Pf={class:"flex items-center gap-4 mt-3.5 pt-3 border-t border-borde text-xs text-tenue"},Of={class:"tabular-nums"},Tf={class:"text-texto font-medium"},$f={class:"tabular-nums"},Nf={class:"text-texto font-medium"},Df={class:"tabular-nums"},Mf={class:"text-texto font-medium"},Vf={class:"bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-800 rounded-xl p-6 w-full max-w-lg"},jf={class:"font-semibold text-gray-800 dark:text-gray-100 mb-4"},Uf=["value"],Lf={class:"flex items-center gap-2"},Ff={class:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-300"},Hf={class:"flex justify-end gap-2 pt-2"},Bf={type:"submit",class:"bg-brand hover:bg-brand-dark text-white text-sm font-medium px-4 py-2 rounded-lg"},Kf={__name:"TenantAgentes",props:{id:{type:String,required:!0}},setup(e){const t=e,n=_e(()=>Number(t.id)),s=Co(),o=W(null),r=W([]),i=W([]),l=W(""),a=W(!1),d=W(null),c=W(M()),h=W(null),g=W({}),x=W(!0);function j(R){const U=g.value[R.ID]||{};return R.activo?U.documentos>0?{tipo:"ok",texto:"listo"}:{tipo:"alerta",texto:"sin conocimiento"}:{tipo:"neutro",texto:"inactivo"}}function O(R){const U=g.value[R.ID]||{};return{documentos:U.documentos||0,canales:U.canales||0,conversaciones:U.conversaciones_7d||0}}function G(R){return String(R||"?").trim().split(/\s+/).slice(0,2).map(U=>U[0]).join("").toUpperCase()}const K=_e(()=>{if(!h.value)return{sinPlan:!0};const R=h.value.max_agentes||0;return{sinPlan:!1,nombre:h.value.nombre,ilimitado:R<=0,max:R,usados:r.value.length,lleno:R>0&&r.value.length>=R}});function M(){return{nombre:"",ai_config_id:null,tono:"",mensaje_bienvenida:"",color:"#8eb02f",activo:!0}}async function q(){l.value="",x.value=!0;try{const[R,U,Ne]=await Promise.all([ae.get(ie("/umind/tenants")),ae.get(ie(`/umind/agentes?tenant_id=${t.id}`)),ae.get(ie("/umind/ai-configs"))]);o.value=(R.items||[]).find(J=>String(J.ID)===t.id)||null,r.value=U.items||[],h.value=U.plan||null,g.value=U.resumen||{},i.value=Ne.items||[]}catch(R){l.value=R.message}finally{x.value=!1}}function P(){d.value=null,c.value=M(),a.value=!0}function A(R){d.value=R,c.value={nombre:R.nombre,ai_config_id:R.ai_config_id,tono:R.tono,mensaje_bienvenida:R.mensaje_bienvenida,color:R.color||"#8eb02f",activo:R.activo},a.value=!0}async function V(){try{if(d.value)await ae.put(ie(`/umind/agentes/${d.value.ID}`),{tenant_id:n.value,...c.value}),a.value=!1,await q();else{const R=await ae.post(ie("/umind/agentes"),{tenant_id:n.value,...c.value});a.value=!1,s.push(`/tenants/${n.value}/agentes/${R.id}`)}}catch(R){l.value=R.message}}async function te(R){confirm(`¿Eliminar el agente "${R.nombre}"? Esto no se puede deshacer.`)&&(await ae.del(ie(`/umind/agentes/${R.ID}`)),await q())}return Ht(()=>t.id,q,{immediate:!0}),(R,U)=>{const Ne=Fn("router-link");return w(),S("div",null,[o.value?(w(),S("div",lf,[u("div",af,[u("div",null,[u("h1",uf,T(o.value.nombre),1),u("p",cf,T(o.value.dominios_permitidos||"sin dominios configurados"),1)]),ke(Ne,{to:`/tenants/${n.value??e.id}/uso`,class:"btn-ghost"},{default:Ft(()=>[...U[9]||(U[9]=[ye("📊 Consumo",-1)])]),_:1},8,["to"])])])):Z("",!0),l.value?(w(),S("p",ff,T(l.value),1)):Z("",!0),u("div",df,[u("div",pf,[U[10]||(U[10]=u("h2",{class:"text-sm font-medium text-tenue"},"Agentes",-1)),K.value.sinPlan?(w(),S("span",hf,"sin plan · sin límite")):K.value.ilimitado?(w(),S("span",mf,T(K.value.nombre)+" · ilimitado",1)):(w(),S("span",{key:2,class:Ie(K.value.lleno?"badge-alerta":"badge-neutro")},T(K.value.nombre)+" · "+T(K.value.usados)+" de "+T(K.value.max),3))]),u("button",{class:"btn-primary",disabled:K.value.lleno,onClick:P},"+ Nuevo agente",8,gf)]),K.value.sinPlan&&!Te(ze).esPortal?(w(),S("p",vf," Este tenant no tiene plan asignado, así que no se le aplica ningún límite de agentes. Asignale uno desde el lápiz del tenant en la barra izquierda. ")):K.value.lleno?(w(),S("p",bf," Alcanzaste el máximo de agentes de tu plan. ")):Z("",!0),x.value?(w(),S("div",xf,[(w(),S(ce,null,Oe(2,J=>u("div",{key:J,class:"card p-4 animate-pulse"},[...U[11]||(U[11]=[wi('<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))])):r.value.length===0?(w(),cn(Bi,{key:5,class:"card",icono:"🤖",titulo:"Todavía no hay agentes",detalle:"Creá el primero y cargale su base de conocimiento para que empiece a responder."},{default:Ft(()=>[u("button",{class:"btn-primary",disabled:K.value.lleno,onClick:P},"+ Crear el primer agente",8,_f)]),_:1})):(w(),S("div",yf,[(w(!0),S(ce,null,Oe(r.value,J=>(w(),cn(Ne,{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:Ft(()=>[u("span",{class:"absolute inset-x-0 top-0 h-1",style:Yt({background:J.color||"#8eb02f"})},null,4),u("div",wf,[u("span",{class:"w-10 h-10 rounded-xl flex items-center justify-center text-white text-sm font-semibold shrink-0",style:Yt({background:J.color||"#8eb02f",opacity:J.activo?1:.4})},T(G(J.nombre)),5),u("div",Cf,[u("div",Ef,[u("span",Sf,T(J.nombre),1),u("span",{class:Ie(`badge-${j(J).tipo}`)},T(j(J).texto),3)]),u("p",Af,T(J.tono||"sin tono definido"),1)]),u("div",kf,[u("button",{class:"p-1 text-tenue hover:text-texto",title:"Editar",onClick:Ze(et=>A(J),["prevent","stop"])},"✎",8,Rf),u("button",{class:"p-1 text-tenue hover:text-red-600",title:"Eliminar",onClick:Ze(et=>te(J),["prevent","stop"])},"✕",8,If)])]),u("div",Pf,[u("span",Of,[u("b",Tf,T(O(J).conversaciones),1),U[12]||(U[12]=ye(" conversaciones · 7d",-1))]),u("span",$f,[u("b",Nf,T(O(J).documentos),1),U[13]||(U[13]=ye(" fuentes",-1))]),u("span",Df,[u("b",Mf,T(O(J).canales),1),U[14]||(U[14]=ye(" canales",-1))])])]),_:2},1032,["to"]))),128))])),a.value?(w(),S("div",{key:7,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:U[8]||(U[8]=Ze(J=>a.value=!1,["self"]))},[u("div",Vf,[u("h2",jf,T(d.value?"Editar agente":"Nuevo agente"),1),u("form",{class:"space-y-3",onSubmit:Ze(V,["prevent"])},[u("div",null,[U[15]||(U[15]=u("label",{class:"label"},"Nombre",-1)),ne(u("input",{"onUpdate:modelValue":U[0]||(U[0]=J=>c.value.nombre=J),required:"",placeholder:"ej: Ventas, Soporte",class:"input"},null,512),[[be,c.value.nombre]])]),u("div",null,[U[17]||(U[17]=u("label",{class:"label"},"Config de IA",-1)),ne(u("select",{"onUpdate:modelValue":U[1]||(U[1]=J=>c.value.ai_config_id=J),class:"input"},[U[16]||(U[16]=u("option",{value:null},"— sin asignar —",-1)),(w(!0),S(ce,null,Oe(i.value,J=>(w(),S("option",{key:J.ID,value:J.ID},T(J.nombre)+" ("+T(J.provider)+")",9,Uf))),128))],512),[[Mn,c.value.ai_config_id]])]),u("div",null,[U[18]||(U[18]=u("label",{class:"label"},"Tono / personalidad",-1)),ne(u("textarea",{"onUpdate:modelValue":U[2]||(U[2]=J=>c.value.tono=J),rows:"2",class:"input"},null,512),[[be,c.value.tono]])]),u("div",null,[U[19]||(U[19]=u("label",{class:"label"},"Mensaje de bienvenida",-1)),ne(u("input",{"onUpdate:modelValue":U[3]||(U[3]=J=>c.value.mensaje_bienvenida=J),class:"input"},null,512),[[be,c.value.mensaje_bienvenida]])]),u("div",null,[U[20]||(U[20]=u("label",{class:"label"},"Color del widget",-1)),u("div",Lf,[ne(u("input",{"onUpdate:modelValue":U[4]||(U[4]=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),[[be,c.value.color]]),ne(u("input",{"onUpdate:modelValue":U[5]||(U[5]=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),[[be,c.value.color]])])]),u("label",Ff,[ne(u("input",{"onUpdate:modelValue":U[6]||(U[6]=J=>c.value.activo=J),type:"checkbox"},null,512),[[St,c.value.activo]]),U[21]||(U[21]=ye(" Activo ",-1))]),u("div",Hf,[u("button",{type:"button",class:"px-4 py-2 text-sm text-gray-500 dark:text-gray-400",onClick:U[7]||(U[7]=J=>a.value=!1)},"Cancelar"),u("button",Bf,T(d.value?"Guardar":"Crear"),1)])],32)])])):Z("",!0)])}}},qf={key:0,class:"mb-6 mt-1 flex items-start justify-between gap-4"},Gf={class:"min-w-0"},Wf={class:"text-xl font-semibold text-texto"},zf={class:"text-xs text-tenue mt-1"},Jf={class:"bg-elevado px-1.5 py-0.5 rounded"},Qf=["href"],Yf={key:1,class:"text-sm text-red-600 dark:text-red-400 mb-4"},Xf={class:"flex gap-1.5 mb-6 overflow-x-auto pb-1"},Zf=["onClick"],ed={key:2},td={class:"card p-4 mb-4"},nd={class:"flex gap-1 mb-3"},sd=["onClick"],od={class:"flex items-center justify-between"},rd=["disabled"],id={class:"flex items-center justify-between"},ld=["disabled"],ad={class:"flex gap-2"},ud={class:"flex items-center justify-between"},cd={class:"flex items-center gap-2 text-xs text-tenue cursor-pointer"},fd=["disabled"],dd={class:"card divide-y divide-borde"},pd={key:0,class:"p-6 text-sm text-tenue"},hd={class:"text-sm text-texto"},md={class:"text-xs text-tenue mt-0.5"},gd={key:0},vd={key:1},bd={key:2},xd={key:3,class:"text-red-600 dark:text-red-400"},_d={class:"flex items-center gap-3 shrink-0"},yd=["title","onClick"],wd=["disabled","onClick"],Cd=["onClick"],Ed={key:3},Sd={class:"card divide-y divide-borde"},Ad={key:0,class:"p-6 text-sm text-tenue"},kd={class:"text-sm text-texto font-mono"},Rd={class:"label mt-0.5"},Id={class:"text-xs text-tenue mt-0.5"},Pd={key:0,class:"ml-1 text-green-600 dark:text-green-400"},Od={key:1,class:"ml-1 text-gray-400"},Td={class:"flex gap-3 text-sm shrink-0"},$d=["onClick"],Nd=["onClick"],Dd={class:"card p-6 w-full max-w-xl max-h-[85vh] overflow-y-auto"},Md={class:"font-semibold text-texto mb-4"},Vd={class:"border border-borde rounded-lg p-3 space-y-2"},jd=["onUpdate:modelValue"],Ud=["onUpdate:modelValue"],Ld=["onUpdate:modelValue"],Fd={class:"label flex items-center gap-1"},Hd=["onUpdate:modelValue"],Bd=["onClick"],Kd={key:0,class:"text-xs text-gray-400"},qd={class:"border border-borde rounded-lg p-3 space-y-2"},Gd={class:"flex items-center gap-2 label"},Wd={class:"flex items-center gap-2 text-sm text-texto"},zd={class:"flex justify-end gap-2 pt-2"},Jd={key:4},Qd={class:"card p-4 mb-4"},Yd={class:"flex items-center justify-between mb-2"},Xd={class:"bg-elevado border border-borde rounded-lg p-2.5 text-xs text-texto overflow-x-auto"},Zd={class:"card divide-y divide-borde"},ep={key:0,class:"p-6 text-sm text-tenue"},tp={class:"flex items-center justify-between"},np={class:"font-medium text-texto capitalize"},sp={class:"flex gap-3 text-sm"},op=["onClick"],rp=["onClick"],ip={class:"flex gap-4 mt-2 text-xs"},lp={class:"flex items-center gap-1.5 text-texto cursor-pointer"},ap=["checked","onChange"],up={class:"flex items-center gap-1.5 text-texto cursor-pointer"},cp=["checked","onChange"],fp={class:"flex items-center gap-1.5 text-texto cursor-pointer"},dp=["checked","onChange"],pp={class:"label mt-1 break-all"},hp={class:"bg-elevado px-1 rounded"},mp={key:0,class:"text-xs text-tenue mt-1"},gp={key:1,class:"text-xs text-red-600 dark:text-red-400 mt-1"},vp={class:"card p-6 w-full max-w-md"},bp={key:0},xp={class:"flex flex-col gap-2 pt-1"},_p={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},yp={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},wp={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},Cp={class:"flex justify-end gap-2 pt-2"},Ep={key:5},Sp={class:"flex gap-2 mb-4"},Ap={class:"card divide-y divide-borde"},kp={key:0,class:"p-6 text-sm text-tenue"},Rp={class:"font-medium text-texto capitalize"},Ip={class:"ml-2 text-sm text-tenue"},Pp=["onClick"],Op={key:6,class:"card p-4 flex flex-col h-[28rem]"},Tp={class:"flex-1 overflow-y-auto space-y-2 mb-3"},$p={key:0,class:"text-sm text-tenue"},Np={key:1,class:"text-xs text-tenue"},Dp=["disabled"],Mp={key:7,class:"grid grid-cols-3 gap-4"},Vp={class:"col-span-1 card divide-y divide-borde max-h-[28rem] overflow-y-auto"},jp={key:0,class:"p-4 text-sm text-tenue"},Up=["onClick"],Lp={class:"text-texto truncate"},Fp={class:"text-xs text-tenue mt-0.5"},Hp={class:"col-span-2 card p-4 max-h-[28rem] overflow-y-auto space-y-2"},Bp={key:0,class:"text-sm text-tenue"},Kp={key:8},qp={class:"card divide-y divide-borde max-h-[32rem] overflow-y-auto"},Gp={key:0,class:"p-6 text-sm text-tenue"},Wp={class:"cursor-pointer flex items-center gap-2 text-sm"},zp={class:"text-tenue text-xs shrink-0"},Jp={class:"text-texto truncate"},Qp={class:"text-tenue text-xs ml-auto shrink-0"},Yp={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"},Xp={__name:"AgenteDetail",props:{tenantId:{type:String,required:!0},agenteId:{type:String,required:!0}},setup(e){const t=e,n=_e(()=>Number(t.agenteId)),s=Li(),o=W(null),r=W(""),i=W(typeof s.query.tab=="string"?s.query.tab:ze.esPortal?"conversaciones":"conocimiento"),l=W([]),a=W(""),d=W(30),c=W(!1);async function h(){const I=await ae.get(ie(`/umind/agentes?tenant_id=${t.tenantId}`));o.value=(I.items||[]).find(v=>String(v.ID)===t.agenteId)||null}async function g(){const I=await ae.get(ie(`/umind/documentos?agente_id=${t.agenteId}`));l.value=I.items||[]}const x=W("texto"),j=W(!0),O=W(""),G=W(""),K=W(null);async function M(){if(a.value.trim()){c.value=!0,r.value="";try{await ae.post(ie("/umind/documentos"),{agente_id:n.value,url:a.value.trim(),max_paginas:Number(d.value)||30,auto_actualizar:j.value}),a.value="",await g()}catch(I){r.value=I.message}finally{c.value=!1}}}async function q(){if(G.value.trim()){c.value=!0,r.value="";try{await ae.post(ie("/umind/documentos/texto"),{agente_id:n.value,titulo:O.value.trim(),contenido:G.value}),O.value="",G.value="",await g()}catch(I){r.value=I.message}finally{c.value=!1}}}async function P(){var v,yt;const I=(yt=(v=K.value)==null?void 0:v.files)==null?void 0:yt[0];if(I){c.value=!0,r.value="";try{const b=new FormData;b.append("agente_id",String(n.value)),b.append("archivo",I);const Ee=await fetch(ie("/umind/documentos/archivo"),{method:"POST",body:b}),st=await Ee.json();if(!Ee.ok)throw new Error(st.error||"No se pudo subir");K.value.value="",await g()}catch(b){r.value=b.message}finally{c.value=!1}}}async function A(I){r.value="";try{await ae.post(ie(`/umind/documentos/${I.ID}/reprocesar`),{}),await g()}catch(v){r.value=v.message}}async function V(I){try{await ae.put(ie(`/umind/documentos/${I.ID}`),{auto_actualizar:!I.auto_actualizar}),await g()}catch(v){r.value=v.message}}function te(I){if(!I)return"sin procesar";const v=Math.floor((Date.now()-new Date(I))/864e5);if(v<=0)return"hoy";if(v===1)return"ayer";if(v<30)return`hace ${v} días`;const yt=Math.floor(v/30);return yt===1?"hace un mes":`hace ${yt} meses`}function R(I){return I.procesado_at?Date.now()-new Date(I.procesado_at)>60*864e5:!1}async function U(I){confirm("¿Eliminar esta fuente y sus fragmentos indexados?")&&(await ae.del(ie(`/umind/documentos/${I}`)),await g())}const Ne=_e(()=>I=>({listo:"badge-ok",procesando:"badge-alerta",pendiente:"badge-neutro",error:"badge-error"})[I]||"badge-neutro"),J=W([]),et=W([]),Be=W(null);async function Bt(){const I=await ae.get(ie(`/umind/sesiones?agente_id=${t.agenteId}`));J.value=I.items||[]}async function Nt(I){Be.value=I;const v=await ae.get(ie(`/umind/historial?agente_id=${t.agenteId}&session_id=${I}`));et.value=v.items||[]}const we=W([]),ue=W(!1),re=W(null),se=W(rt());function rt(){return{nombre:"",descripcion:"",url:"",auth_header_nombre:"",auth_header_valor:"",tocarAuth:!1,parametros:[],activa:!0}}async function Qe(){const I=await ae.get(ie(`/umind/tools?agente_id=${t.agenteId}`));we.value=I.items||[]}function je(){re.value=null,se.value=rt(),ue.value=!0}function Dt(I){re.value=I;let v=[];try{v=JSON.parse(I.parametros_json||"[]")||[]}catch{v=[]}se.value={nombre:I.nombre,descripcion:I.descripcion,url:I.url,auth_header_nombre:I.auth_header_nombre,auth_header_valor:"",tocarAuth:!1,parametros:v,activa:I.activa},ue.value=!0}function Mt(){se.value.parametros.push({nombre:"",tipo:"string",descripcion:"",requerido:!1})}function _t(I){se.value.parametros.splice(I,1)}async function Ye(){const I={agente_id:n.value,nombre:se.value.nombre.trim(),descripcion:se.value.descripcion,url:se.value.url.trim(),auth_header_nombre:se.value.auth_header_nombre,parametros:se.value.parametros,activa:se.value.activa};se.value.tocarAuth&&(I.auth_header_valor=se.value.auth_header_valor);try{re.value?await ae.put(ie(`/umind/tools/${re.value.ID}`),I):await ae.post(ie("/umind/tools"),I),ue.value=!1,await Qe()}catch(v){r.value=v.message}}async function C(I){confirm(`¿Eliminar la tool "${I.nombre}"?`)&&(await ae.del(ie(`/umind/tools/${I.ID}`)),await Qe())}const B=W([]),L=W(!1),$=W(y()),oe=W(!1),f=_e(()=>{const I=new Date,v=new Date(I.getFullYear(),I.getMonth(),1).toISOString().slice(0,10),yt=I.toISOString().slice(0,10);return ie(`/umind/reporte.xlsx?agente_id=${t.agenteId}&desde=${v}&hasta=${yt}`)}),p=_e(()=>{var v;const I=((v=o.value)==null?void 0:v.site_key)||"TU_SITE_KEY";return`<script src="${window.location.origin}/widget/umind.js" data-site="${I}" defer><\/script>`});async function m(){try{await navigator.clipboard.writeText(p.value),oe.value=!0,setTimeout(()=>oe.value=!1,2e3)}catch{r.value="No se pudo copiar automáticamente — seleccioná el texto y copialo a mano."}}function y(){return{tipo:"telegram",bot_token:"",phone_number_id:"",access_token:"",app_secret:"",verify_token:"",usar_whisper_audio:!1,usar_ocr_imagenes:!1,usar_archivos_docs:!1}}async function E(){const I=await ae.get(ie(`/umind/canales?agente_id=${t.agenteId}`));B.value=I.items||[]}function _(){$.value=y(),L.value=!0}async function F(){const I=$.value.tipo==="telegram"?{bot_token:$.value.bot_token}:{phone_number_id:$.value.phone_number_id,access_token:$.value.access_token,app_secret:$.value.app_secret,verify_token:$.value.verify_token};try{await ae.post(ie("/umind/canales"),{agente_id:n.value,tipo:$.value.tipo,credenciales:I,activo:!0,usar_whisper_audio:$.value.usar_whisper_audio,usar_ocr_imagenes:$.value.usar_ocr_imagenes,usar_archivos_docs:$.value.usar_archivos_docs}),L.value=!1,await E()}catch(v){r.value=v.message}}async function N(I,v){await ae.put(ie(`/umind/canales/${I.ID}`),{activo:I.activo,credenciales:{},usar_whisper_audio:I.usar_whisper_audio,usar_ocr_imagenes:I.usar_ocr_imagenes,usar_archivos_docs:I.usar_archivos_docs,...v}),await E()}const D=I=>N(I,{activo:!I.activo}),k=I=>N(I,{usar_whisper_audio:!I.usar_whisper_audio}),Q=I=>N(I,{usar_ocr_imagenes:!I.usar_ocr_imagenes}),H=I=>N(I,{usar_archivos_docs:!I.usar_archivos_docs});async function z(I){confirm(`¿Eliminar el canal ${I.tipo}?`)&&(await ae.del(ie(`/umind/canales/${I.ID}`)),await E())}const Y=W([]);async function le(){const I=await ae.get(ie(`/umind/conexiones?agente_id=${t.agenteId}`));Y.value=I.items||[]}function fe(I){window.location.href=ie(`/umind/conexiones/conectar?agente_id=${n.value}&proveedor=${I}`)}async function de(I){confirm(`¿Desconectar la cuenta ${I.email||I.proveedor}?`)&&(await ae.del(ie(`/umind/conexiones/${I.ID}`)),await le())}const Se=`staff-preview-${Math.random().toString(36).slice(2)}`,Ce=W([]),Ke=W(""),Ue=W(!1);async function Kt(){const I=Ke.value.trim();if(!(!I||Ue.value)){Ke.value="",Ce.value.push({role:"user",content:I}),Ue.value=!0;try{const v=await ae.post(ie("/umind/chat"),{agente_id:n.value,session_id:Se,mensaje:I});Ce.value.push({role:"assistant",content:v.respuesta})}catch(v){Ce.value.push({role:"assistant",content:`⚠️ ${v.message}`})}finally{Ue.value=!1}}}const Bn=_e(()=>ze.esPortal?[["conversaciones","Conversaciones"],["chat","Probar"],["conocimiento","Base de conocimiento"],["herramientas","Herramientas"],["canales","Canales"],["conexiones","Conexiones"],["auditoria","Auditoría"]]:[["conocimiento","Base de conocimiento"],["herramientas","Herramientas"],["canales","Canales"],["conexiones","Conexiones"],["chat","Chat de prueba"],["conversaciones","Conversaciones"],["auditoria","Auditoría"]]),$e=W([]);async function nt(){const I=await ae.get(ie(`/umind/eventos?agente_id=${t.agenteId}`));$e.value=I.items||[]}const Kn=_e(()=>I=>({error:"badge-error",warn:"badge-alerta"})[I]||"badge-neutro");function qn(I){try{return new Date(I).toLocaleString()}catch{return I}}return Ht(()=>[t.tenantId,t.agenteId],async()=>{r.value="",o.value=null,l.value=[],J.value=[],et.value=[],Be.value=null,we.value=[],B.value=[],Y.value=[],$e.value=[];try{await Promise.all([h(),g(),Bt(),Qe(),E(),le(),nt()])}catch(I){r.value=I.message}},{immediate:!0}),(I,v)=>{const yt=Fn("router-link");return w(),S("div",null,[ke(yt,{to:`/tenants/${e.tenantId}`,class:"label hover:text-brand"},{default:Ft(()=>[...v[28]||(v[28]=[ye("← Agentes",-1)])]),_:1},8,["to"]),o.value?(w(),S("div",qf,[u("div",Gf,[u("h1",Wf,T(o.value.nombre),1),u("p",zf,[v[29]||(v[29]=ye(" site_key: ",-1)),u("code",Jf,T(o.value.site_key),1)])]),u("a",{href:f.value,class:"btn-ghost shrink-0",title:"Conversaciones y consumo del mes en Excel"}," ⬇ Reporte del mes ",8,Qf)])):Z("",!0),r.value?(w(),S("p",Yf,T(r.value),1)):Z("",!0),u("div",Xf,[(w(!0),S(ce,null,Oe(Bn.value,([b,Ee])=>(w(),S("button",{key:b,class:Ie(["px-3 py-1.5 rounded-full text-sm whitespace-nowrap transition-colors",i.value===b?"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:st=>i.value=b},T(Ee),11,Zf))),128))]),i.value==="conocimiento"?(w(),S("div",ed,[u("div",td,[u("div",nd,[(w(),S(ce,null,Oe([["texto","✍️ Escribir"],["archivo","📄 Subir archivo"],["url","🌐 Sitio web"]],([b,Ee])=>u("button",{key:b,class:Ie(["px-3 py-1.5 rounded-lg text-sm",x.value===b?"bg-brand text-white font-medium":"text-tenue hover:text-texto"]),onClick:st=>x.value=b},T(Ee),11,sd)),64))]),x.value==="texto"?(w(),S("form",{key:0,class:"space-y-2",onSubmit:Ze(q,["prevent"])},[ne(u("input",{"onUpdate:modelValue":v[0]||(v[0]=b=>O.value=b),placeholder:"Título (ej: Horarios y zonas de entrega)",class:"input"},null,512),[[be,O.value]]),ne(u("textarea",{"onUpdate:modelValue":v[1]||(v[1]=b=>G.value=b),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),[[be,G.value]]),u("div",od,[v[30]||(v[30]=u("p",{class:"text-xs text-tenue"},"Lo que te preguntan todos los días y no está en tu web.",-1)),u("button",{type:"submit",disabled:c.value,class:"btn-primary disabled:opacity-50"},T(c.value?"Guardando…":"Guardar"),9,rd)])],32)):x.value==="archivo"?(w(),S("form",{key:1,class:"space-y-2",onSubmit:Ze(P,["prevent"])},[u("input",{ref_key:"archivoRef",ref:K,type:"file",accept:".pdf,.docx,.txt,.md,.csv,.html,image/*",class:"text-sm text-texto"},null,512),u("div",id,[v[31]||(v[31]=u("p",{class:"text-xs text-tenue"},"PDF, Word, texto o una foto. Ej: tu lista de precios.",-1)),u("button",{type:"submit",disabled:c.value,class:"btn-primary disabled:opacity-50"},T(c.value?"Leyendo…":"Subir"),9,ld)])],32)):(w(),S("form",{key:2,class:"space-y-2",onSubmit:Ze(M,["prevent"])},[u("div",ad,[ne(u("input",{"onUpdate:modelValue":v[2]||(v[2]=b=>a.value=b),type:"url",placeholder:"https://ejemplo.com",required:"",class:"input flex-1"},null,512),[[be,a.value]]),ne(u("input",{"onUpdate:modelValue":v[3]||(v[3]=b=>d.value=b),type:"number",min:"1",max:"200",class:"input w-24",title:"Máximo de páginas a leer"},null,512),[[be,d.value]])]),u("div",ud,[u("label",cd,[ne(u("input",{"onUpdate:modelValue":v[4]||(v[4]=b=>j.value=b),type:"checkbox",class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[St,j.value]]),v[32]||(v[32]=ye(" Releer el sitio cada semana ",-1))]),u("button",{type:"submit",disabled:c.value,class:"btn-primary disabled:opacity-50"},T(c.value?"Leyendo…":"Leer sitio"),9,fd)])],32))]),u("div",dd,[l.value.length===0?(w(),S("div",pd,"Sin fuentes todavía.")):Z("",!0),(w(!0),S(ce,null,Oe(l.value,b=>(w(),S("div",{key:b.ID,class:"p-4 flex items-center justify-between"},[u("div",null,[u("div",hd,T(b.origen),1),u("div",md,[u("span",{class:Ie(["px-1.5 py-0.5 rounded",Ne.value(b.estado)])},T(b.estado),3),b.tipo?(w(),S("span",gd," · "+T({url:"sitio",archivo:"archivo",texto:"nota"}[b.tipo]||b.tipo),1)):Z("",!0),b.total_chunks?(w(),S("span",vd," · "+T(b.total_chunks)+" fragmentos",1)):Z("",!0),u("span",{class:Ie(R(b)?"text-amber-600 dark:text-amber-400 font-medium":"")}," · leído "+T(te(b.procesado_at)),3),b.auto_actualizar?(w(),S("span",bd," · se actualiza sola")):Z("",!0),b.error?(w(),S("span",xd," · "+T(b.error),1)):Z("",!0)])]),u("div",_d,[b.tipo==="url"?(w(),S("button",{key:0,class:"text-xs text-tenue hover:text-texto",title:b.auto_actualizar?"Dejar de releer sola":"Releer el sitio cada semana",onClick:Ee=>V(b)},T(b.auto_actualizar?"🔁 auto":"↻ manual"),9,yd)):Z("",!0),u("button",{class:"text-sm text-brand hover:underline disabled:opacity-40",disabled:b.estado==="procesando",onClick:Ee=>A(b)},"Actualizar",8,wd),u("button",{class:"text-red-500 hover:text-red-700 text-sm",onClick:Ee=>U(b.ID)},"Eliminar",8,Cd)])]))),128))])])):i.value==="herramientas"?(w(),S("div",Ed,[u("div",{class:"flex justify-between items-center mb-4"},[v[33]||(v[33]=u("p",{class:"label"},"Máximo 10 tools activas por agente.",-1)),u("button",{class:"btn-primary",onClick:je}," + Nueva tool ")]),u("div",Sd,[we.value.length===0?(w(),S("div",Ad,"Sin tools custom todavía.")):Z("",!0),(w(!0),S(ce,null,Oe(we.value,b=>(w(),S("div",{key:b.ID,class:"p-4 flex items-center justify-between"},[u("div",null,[u("div",kd,T(b.nombre),1),u("div",Rd,T(b.descripcion),1),u("div",Id,[ye(T(b.url)+" ",1),b.auth_configurado?(w(),S("span",Pd,"· auth configurada")):Z("",!0),b.activa?Z("",!0):(w(),S("span",Od,"· inactiva"))])]),u("div",Td,[u("button",{class:"text-tenue hover:text-gray-800 dark:hover:text-gray-100",onClick:Ee=>Dt(b)},"Editar",8,$d),u("button",{class:"text-red-500 hover:text-red-700",onClick:Ee=>C(b)},"Eliminar",8,Nd)])]))),128))]),ue.value?(w(),S("div",{key:0,class:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center p-4 z-50",onClick:v[13]||(v[13]=Ze(b=>ue.value=!1,["self"]))},[u("div",Dd,[u("h2",Md,T(re.value?"Editar tool":"Nueva tool"),1),u("form",{class:"space-y-3",onSubmit:Ze(Ye,["prevent"])},[u("div",null,[v[34]||(v[34]=u("label",{class:"label"},"Nombre (identificador, ej: consultar_stock)",-1)),ne(u("input",{"onUpdate:modelValue":v[5]||(v[5]=b=>se.value.nombre=b),required:"",pattern:"[a-z][a-z0-9_]{2,63}",class:"input font-mono"},null,512),[[be,se.value.nombre]])]),u("div",null,[v[35]||(v[35]=u("label",{class:"label"},"Descripción (esto lo lee el modelo para decidir cuándo usarla)",-1)),ne(u("textarea",{"onUpdate:modelValue":v[6]||(v[6]=b=>se.value.descripcion=b),rows:"2",required:"",class:"input"},null,512),[[be,se.value.descripcion]])]),u("div",null,[v[36]||(v[36]=u("label",{class:"label"},"URL del webhook (https)",-1)),ne(u("input",{"onUpdate:modelValue":v[7]||(v[7]=b=>se.value.url=b),type:"url",required:"",placeholder:"https://...",class:"input"},null,512),[[be,se.value.url]])]),u("div",Vd,[u("div",{class:"flex items-center justify-between"},[v[37]||(v[37]=u("label",{class:"label"},"Parámetros que completa el modelo",-1)),u("button",{type:"button",class:"text-xs text-brand",onClick:Mt},"+ agregar")]),(w(!0),S(ce,null,Oe(se.value.parametros,(b,Ee)=>(w(),S("div",{key:Ee,class:"flex gap-2 items-center"},[ne(u("input",{"onUpdate:modelValue":st=>b.nombre=st,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,jd),[[be,b.nombre]]),ne(u("select",{"onUpdate:modelValue":st=>b.tipo=st,class:"border border-borde bg-white dark:bg-gray-800 text-texto rounded px-2 py-1 text-xs"},[...v[38]||(v[38]=[u("option",{value:"string"},"string",-1),u("option",{value:"number"},"number",-1),u("option",{value:"boolean"},"boolean",-1)])],8,Ud),[[Mn,b.tipo]]),ne(u("input",{"onUpdate:modelValue":st=>b.descripcion=st,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,Ld),[[be,b.descripcion]]),u("label",Fd,[ne(u("input",{"onUpdate:modelValue":st=>b.requerido=st,type:"checkbox"},null,8,Hd),[[St,b.requerido]]),v[39]||(v[39]=ye(" req. ",-1))]),u("button",{type:"button",class:"text-red-400 text-xs",onClick:st=>_t(Ee)},"✕",8,Bd)]))),128)),se.value.parametros.length===0?(w(),S("p",Kd,"Sin parámetros.")):Z("",!0)]),u("div",qd,[v[40]||(v[40]=u("label",{class:"label"},"Autenticación saliente (opcional)",-1)),ne(u("input",{"onUpdate:modelValue":v[8]||(v[8]=b=>se.value.auth_header_nombre=b),placeholder:"Nombre del header, ej: Authorization",class:"input"},null,512),[[be,se.value.auth_header_nombre]]),u("label",Gd,[ne(u("input",{"onUpdate:modelValue":v[9]||(v[9]=b=>se.value.tocarAuth=b),type:"checkbox"},null,512),[[St,se.value.tocarAuth]]),ye(" "+T(re.value?"Cambiar el valor del secreto":"Configurar valor"),1)]),se.value.tocarAuth?ne((w(),S("input",{key:0,"onUpdate:modelValue":v[10]||(v[10]=b=>se.value.auth_header_valor=b),type:"password",placeholder:"Valor del header (ej: Bearer xxxx)",class:"input"},null,512)),[[be,se.value.auth_header_valor]]):Z("",!0)]),u("label",Wd,[ne(u("input",{"onUpdate:modelValue":v[11]||(v[11]=b=>se.value.activa=b),type:"checkbox"},null,512),[[St,se.value.activa]]),v[41]||(v[41]=ye(" Activa ",-1))]),u("div",zd,[u("button",{type:"button",class:"btn-ghost",onClick:v[12]||(v[12]=b=>ue.value=!1)},"Cancelar"),v[42]||(v[42]=u("button",{type:"submit",class:"btn-primary"},"Guardar",-1))])],32)])])):Z("",!0)])):i.value==="canales"?(w(),S("div",Jd,[u("div",Qd,[u("div",Yd,[v[43]||(v[43]=u("div",null,[u("span",{class:"font-medium text-texto"},"Web (widget)"),u("span",{class:"ml-2 px-1.5 py-0.5 rounded text-xs badge-ok"}," siempre activo ")],-1)),u("button",{class:Ie(["text-sm font-medium px-3 py-1.5 rounded-lg transition-colors",oe.value?"bg-green-600 text-white":"bg-brand hover:bg-brand-dark text-white"]),onClick:m},T(oe.value?"✓ Copiado":"Copiar código"),3)]),v[44]||(v[44]=u("p",{class:"label mb-2"},[ye(" Pegá esto antes de "),u("code",{class:"bg-elevado px-1 rounded"},"</body>"),ye(" en las páginas de tu sitio. ")],-1)),u("pre",Xd,[u("code",null,T(p.value),1)])]),u("div",{class:"flex justify-end mb-4"},[u("button",{class:"btn-primary",onClick:_}," + Nuevo canal ")]),u("div",Zd,[B.value.length===0?(w(),S("div",ep,"Sin canales configurados.")):Z("",!0),(w(!0),S(ce,null,Oe(B.value,b=>(w(),S("div",{key:b.ID,class:"p-4"},[u("div",tp,[u("div",null,[u("span",np,T(b.tipo),1),u("span",{class:Ie(["ml-2 px-1.5 py-0.5 rounded text-xs",b.activo?"badge-ok":"badge-neutro"])},T(b.activo?"activo":"inactivo"),3)]),u("div",sp,[u("button",{class:"text-tenue hover:text-gray-800 dark:hover:text-gray-100",onClick:Ee=>D(b)},T(b.activo?"Desactivar":"Activar"),9,op),u("button",{class:"text-red-500 hover:text-red-700",onClick:Ee=>z(b)},"Eliminar",8,rp)])]),u("div",ip,[u("label",lp,[u("input",{type:"checkbox",checked:b.usar_whisper_audio,onChange:Ee=>k(b),class:"rounded border-borde text-brand focus:ring-brand"},null,40,ap),v[45]||(v[45]=ye(" Transcribir audios (Whisper) ",-1))]),u("label",up,[u("input",{type:"checkbox",checked:b.usar_ocr_imagenes,onChange:Ee=>Q(b),class:"rounded border-borde text-brand focus:ring-brand"},null,40,cp),v[46]||(v[46]=ye(" Leer texto de imágenes (OCR) ",-1))]),u("label",fp,[u("input",{type:"checkbox",checked:b.usar_archivos_docs,onChange:Ee=>H(b),class:"rounded border-borde text-brand focus:ring-brand"},null,40,dp),v[47]||(v[47]=ye(" Leer archivos adjuntos (PDF, Word, texto) ",-1))])]),u("p",pp,[v[48]||(v[48]=ye(" Webhook: ",-1)),u("code",hp,T(b.webhook_url),1)]),b.tipo==="whatsapp"?(w(),S("p",mp,' Registrá esta URL como "Callback URL" en Meta for Developers → WhatsApp → Configuration, con el mismo verify_token que pusiste acá. ')):Z("",!0),b.ultimo_error?(w(),S("p",gp,T(b.ultimo_error),1)):Z("",!0)]))),128))]),L.value?(w(),S("div",{key:0,class:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center p-4 z-50",onClick:v[24]||(v[24]=Ze(b=>L.value=!1,["self"]))},[u("div",vp,[v[60]||(v[60]=u("h2",{class:"font-semibold text-texto mb-4"},"Nuevo canal",-1)),u("form",{class:"space-y-3",onSubmit:Ze(F,["prevent"])},[u("div",null,[v[50]||(v[50]=u("label",{class:"label"},"Tipo",-1)),ne(u("select",{"onUpdate:modelValue":v[14]||(v[14]=b=>$.value.tipo=b),class:"input"},[...v[49]||(v[49]=[u("option",{value:"telegram"},"Telegram",-1),u("option",{value:"whatsapp"},"WhatsApp Business",-1)])],512),[[Mn,$.value.tipo]])]),$.value.tipo==="telegram"?(w(),S("div",bp,[v[51]||(v[51]=u("label",{class:"label"},"Bot token (de @BotFather)",-1)),ne(u("input",{"onUpdate:modelValue":v[15]||(v[15]=b=>$.value.bot_token=b),type:"password",required:"",class:"input"},null,512),[[be,$.value.bot_token]])])):(w(),S(ce,{key:1},[u("div",null,[v[52]||(v[52]=u("label",{class:"label"},"Phone Number ID",-1)),ne(u("input",{"onUpdate:modelValue":v[16]||(v[16]=b=>$.value.phone_number_id=b),required:"",class:"input"},null,512),[[be,$.value.phone_number_id]])]),u("div",null,[v[53]||(v[53]=u("label",{class:"label"},"Access Token",-1)),ne(u("input",{"onUpdate:modelValue":v[17]||(v[17]=b=>$.value.access_token=b),type:"password",required:"",class:"input"},null,512),[[be,$.value.access_token]])]),u("div",null,[v[54]||(v[54]=u("label",{class:"label"},"App Secret",-1)),ne(u("input",{"onUpdate:modelValue":v[18]||(v[18]=b=>$.value.app_secret=b),type:"password",required:"",class:"input"},null,512),[[be,$.value.app_secret]])]),u("div",null,[v[55]||(v[55]=u("label",{class:"label"},"Verify Token (lo inventás vos, lo vas a usar en Meta)",-1)),ne(u("input",{"onUpdate:modelValue":v[19]||(v[19]=b=>$.value.verify_token=b),required:"",class:"input"},null,512),[[be,$.value.verify_token]])])],64)),u("div",xp,[u("label",_p,[ne(u("input",{type:"checkbox","onUpdate:modelValue":v[20]||(v[20]=b=>$.value.usar_whisper_audio=b),class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[St,$.value.usar_whisper_audio]]),v[56]||(v[56]=ye(" Transcribir audios con Whisper ",-1))]),u("label",yp,[ne(u("input",{type:"checkbox","onUpdate:modelValue":v[21]||(v[21]=b=>$.value.usar_ocr_imagenes=b),class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[St,$.value.usar_ocr_imagenes]]),v[57]||(v[57]=ye(" Leer texto de imágenes con OCR ",-1))]),u("label",wp,[ne(u("input",{type:"checkbox","onUpdate:modelValue":v[22]||(v[22]=b=>$.value.usar_archivos_docs=b),class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[St,$.value.usar_archivos_docs]]),v[58]||(v[58]=ye(" Leer archivos adjuntos (PDF, Word, texto) ",-1))])]),u("div",Cp,[u("button",{type:"button",class:"btn-ghost",onClick:v[23]||(v[23]=b=>L.value=!1)},"Cancelar"),v[59]||(v[59]=u("button",{type:"submit",class:"btn-primary"},"Guardar",-1))])],32)])])):Z("",!0)])):i.value==="conexiones"?(w(),S("div",Ep,[v[61]||(v[61]=u("p",{class:"label mb-4"}," Conectá una cuenta de correo para que este agente pueda enviar y leer correo en su nombre. Se soporta una cuenta activa a la vez. ",-1)),u("div",Sp,[u("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:v[25]||(v[25]=b=>fe("google"))}," Conectar Google "),u("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:v[26]||(v[26]=b=>fe("microsoft"))}," Conectar Outlook ")]),u("div",Ap,[Y.value.length===0?(w(),S("div",kp,"Sin cuentas conectadas.")):Z("",!0),(w(!0),S(ce,null,Oe(Y.value,b=>(w(),S("div",{key:b.ID,class:"p-4 flex items-center justify-between"},[u("div",null,[u("span",Rp,T(b.proveedor),1),u("span",Ip,T(b.email),1),u("span",{class:Ie(["ml-2 px-1.5 py-0.5 rounded text-xs",b.activo?"badge-ok":"badge-neutro"])},T(b.activo?"activa":"inactiva"),3)]),u("button",{class:"text-red-500 hover:text-red-700 text-sm",onClick:Ee=>de(b)},"Desconectar",8,Pp)]))),128))])])):i.value==="chat"?(w(),S("div",Op,[u("div",Tp,[Ce.value.length===0?(w(),S("p",$p," Probá este agente tal cual lo va a ver un visitante — usa la misma config de IA y las mismas tools/base de conocimiento. ")):Z("",!0),(w(!0),S(ce,null,Oe(Ce.value,(b,Ee)=>(w(),S("div",{key:Ee,class:Ie(["max-w-[80%] px-3 py-2 rounded-lg text-sm whitespace-pre-wrap",b.role==="user"?"bg-brand text-white ml-auto":"bg-elevado text-texto"])},T(b.content),3))),128)),Ue.value?(w(),S("p",Np,"Pensando...")):Z("",!0)]),u("form",{class:"flex gap-2",onSubmit:Ze(Kt,["prevent"])},[ne(u("input",{"onUpdate:modelValue":v[27]||(v[27]=b=>Ke.value=b),placeholder:"Escribí un mensaje de prueba...",class:"flex-1 input"},null,512),[[be,Ke.value]]),u("button",{type:"submit",disabled:Ue.value,class:"btn-primary disabled:opacity-50 transition-colors"}," Enviar ",8,Dp)],32)])):i.value==="conversaciones"?(w(),S("div",Mp,[u("div",Vp,[J.value.length===0?(w(),S("div",jp,"Sin conversaciones.")):Z("",!0),(w(!0),S(ce,null,Oe(J.value,b=>(w(),S("button",{key:b.session_id,class:Ie(["w-full text-left p-3 hover:bg-elevado text-sm",Be.value===b.session_id?"bg-gray-50 dark:bg-gray-800":""]),onClick:Ee=>Nt(b.session_id)},[u("div",Lp,T(b.content),1),u("div",Fp,T(b.session_id),1)],10,Up))),128))]),u("div",Hp,[Be.value?Z("",!0):(w(),S("p",Bp,"Elegí una conversación de la izquierda.")),(w(!0),S(ce,null,Oe(et.value,b=>(w(),S("div",{key:b.ID,class:Ie(["max-w-[80%] px-3 py-2 rounded-lg text-sm",b.role==="user"?"bg-brand text-white ml-auto":"bg-elevado text-texto"])},T(b.content),3))),128))])])):(w(),S("div",Kp,[v[62]||(v[62]=u("p",{class:"label mb-4"}," Errores y eventos técnicos de este agente — fallos al llamar al AI, a tools, a correo o a los canales. Últimos 100. ",-1)),u("div",qp,[$e.value.length===0?(w(),S("div",Gp,"Sin eventos registrados — buena señal.")):Z("",!0),(w(!0),S(ce,null,Oe($e.value,b=>(w(),S("details",{key:b.ID,class:"p-3"},[u("summary",Wp,[u("span",{class:Ie(["px-1.5 py-0.5 rounded text-xs shrink-0",Kn.value(b.nivel)])},T(b.nivel),3),u("span",zp,T(b.origen),1),u("span",Jp,T(b.mensaje),1),u("span",Qp,T(qn(b.CreatedAt)),1)]),b.detalle?(w(),S("pre",Yp,T(b.detalle),1)):Z("",!0)]))),128))])]))])}}},Zp={class:"flex items-start justify-between gap-4 mb-6"},eh={class:"card p-4 mb-4"},th={class:"flex flex-wrap items-end gap-3"},nh={class:"flex gap-1 ml-auto"},sh={key:0,class:"text-sm text-red-600 dark:text-red-400 mb-4"},oh={key:1,class:"text-sm text-tenue"},rh={class:"grid gap-3 sm:grid-cols-3 mb-4"},ih={class:"card p-4"},lh={class:"text-2xl font-semibold text-texto mt-1 tabular-nums"},ah={class:"card p-4"},uh={class:"text-2xl font-semibold text-texto mt-1 tabular-nums"},ch={class:"card p-4"},fh={class:"text-lg font-semibold text-texto mt-1"},dh={key:0,class:"text-[11px] text-tenue mt-0.5"},ph={key:0,class:"card p-4 mb-4"},hh={class:"flex items-center justify-between text-sm mb-2"},mh={class:"text-tenue tabular-nums"},gh={class:"h-2 rounded-full bg-elevado overflow-hidden"},vh={key:0,class:"text-xs text-amber-600 dark:text-amber-400 mt-2"},bh={class:"card divide-y divide-borde mb-4"},xh={class:"text-lg"},_h={class:"min-w-0 flex-1"},yh={class:"text-sm text-texto"},wh={class:"text-xs text-tenue tabular-nums"},Ch={class:"text-sm font-medium text-texto tabular-nums"},Eh={key:1,class:"card p-4"},Sh={class:"flex items-end gap-1 h-28"},Ah=["title"],kh={class:"flex justify-between text-[11px] text-tenue mt-2"},Rh={__name:"Uso",props:{id:{type:String,required:!0}},setup(e){const t=e,n=W(!0),s=W(""),o=W(null),r=new Date,i=W(new Date(r.getFullYear(),r.getMonth(),1).toISOString().slice(0,10)),l=W(r.toISOString().slice(0,10)),a={ia:{nombre:"Inteligencia artificial",icono:"🧠",color:"#8eb02f"},ocr:{nombre:"Lectura de imágenes",icono:"🖼️",color:"#2f7fb0"},whisper:{nombre:"Transcripción de audio",icono:"🎙️",color:"#b0752f"}},d=P=>a[P]||{nombre:P,icono:"•",color:"#94a3b8"};async function c(){n.value=!0,s.value="";try{o.value=await ae.get(ie(`/umind/uso?tenant_id=${t.id}&desde=${i.value}&hasta=${l.value}`))}catch(P){s.value=P.message}finally{n.value=!1}}const h=_e(()=>{var P,A;return((A=(P=o.value)==null?void 0:P.plan)==null?void 0:A.moneda)||"COP"}),g=_e(()=>{var P;return((P=o.value)==null?void 0:P.resumen)||[]}),x=_e(()=>{var P;return((P=o.value)==null?void 0:P.total_periodo)||0}),j=_e(()=>{var P,A;return((A=(P=o.value)==null?void 0:P.plan)==null?void 0:A.tope_consumo_mensual)||0}),O=_e(()=>j.value?Math.min(100,x.value/j.value*100):0);function G(P){return`${h.value} ${Number(P||0).toLocaleString("es-CO",{maximumFractionDigits:2})}`}function K(P){return Number(P||0).toLocaleString("es-CO",{maximumFractionDigits:0})}const M=_e(()=>{var te;const P=new Map;for(const R of((te=o.value)==null?void 0:te.detalle)||[]){const U=String(R.CreatedAt).slice(0,10);P.set(U,(P.get(U)||0)+(R.costo||0))}const A=[...P.entries()].sort((R,U)=>R[0].localeCompare(U[0])),V=Math.max(...A.map(R=>R[1]),0);return{dias:A,max:V}});function q(P){const A=new Date,V=new Date;V.setDate(V.getDate()-P),i.value=V.toISOString().slice(0,10),l.value=A.toISOString().slice(0,10),c()}return Ht(()=>t.id,c,{immediate:!0}),(P,A)=>{var te;const V=Fn("router-link");return w(),S("div",null,[u("div",Zp,[A[6]||(A[6]=u("div",null,[u("h1",{class:"text-xl font-semibold text-texto"},"Consumo"),u("p",{class:"text-sm text-tenue mt-0.5"},"Lo que usaron tus agentes y cuánto cuesta.")],-1)),ke(V,{to:`/tenants/${e.id}`,class:"btn-ghost"},{default:Ft(()=>[...A[5]||(A[5]=[ye("← Agentes",-1)])]),_:1},8,["to"])]),u("div",eh,[u("div",th,[u("div",null,[A[7]||(A[7]=u("label",{class:"label"},"Desde",-1)),ne(u("input",{"onUpdate:modelValue":A[0]||(A[0]=R=>i.value=R),type:"date",class:"input !w-auto"},null,512),[[be,i.value]])]),u("div",null,[A[8]||(A[8]=u("label",{class:"label"},"Hasta",-1)),ne(u("input",{"onUpdate:modelValue":A[1]||(A[1]=R=>l.value=R),type:"date",class:"input !w-auto"},null,512),[[be,l.value]])]),u("button",{class:"btn-primary",onClick:c},"Aplicar"),u("div",nh,[u("button",{class:"btn-ghost !px-2.5 !py-1 !text-xs",onClick:A[2]||(A[2]=R=>q(6))},"7 días"),u("button",{class:"btn-ghost !px-2.5 !py-1 !text-xs",onClick:A[3]||(A[3]=R=>q(29))},"30 días"),u("button",{class:"btn-ghost !px-2.5 !py-1 !text-xs",onClick:A[4]||(A[4]=R=>q(89))},"90 días")])])]),s.value?(w(),S("p",sh,T(s.value),1)):Z("",!0),n.value?(w(),S("p",oh,"Cargando…")):o.value?(w(),S(ce,{key:2},[u("div",rh,[u("div",ih,[A[9]||(A[9]=u("p",{class:"text-xs text-tenue"},"Consumo del período",-1)),u("p",lh,T(G(x.value)),1)]),u("div",ah,[A[10]||(A[10]=u("p",{class:"text-xs text-tenue"},"Pendiente de facturar",-1)),u("p",uh,T(G(o.value.pendiente_facturar)),1),A[11]||(A[11]=u("p",{class:"text-[11px] text-tenue mt-0.5"},"Se suma a tu próxima factura.",-1))]),u("div",ch,[A[12]||(A[12]=u("p",{class:"text-xs text-tenue"},"Plan",-1)),u("p",fh,T(((te=o.value.plan)==null?void 0:te.nombre)||"Sin plan"),1),o.value.plan?(w(),S("p",dh," Mensualidad "+T(G(o.value.plan.precio_mensual)),1)):Z("",!0)])]),j.value?(w(),S("div",ph,[u("div",hh,[A[13]||(A[13]=u("span",{class:"text-texto"},"Tope mensual",-1)),u("span",mh,T(G(x.value))+" / "+T(G(j.value)),1)]),u("div",gh,[u("div",{class:Ie(["h-full rounded-full transition-all duration-500",O.value>=100?"bg-red-500":O.value>=80?"bg-amber-500":"bg-brand"]),style:Yt({width:O.value+"%"})},null,6)]),O.value>=100?(w(),S("p",vh," Superaste el tope de tu plan. El servicio sigue funcionando y el excedente se cobra en el próximo ciclo. ")):Z("",!0)])):Z("",!0),u("div",bh,[A[14]||(A[14]=u("div",{class:"px-4 py-3"},[u("h2",{class:"text-sm font-medium text-texto"},"Desglose")],-1)),g.value.length===0?(w(),cn(Bi,{key:0,icono:"📊",titulo:"Sin consumo en este período",detalle:"Cuando tus agentes respondan mensajes, lean imágenes o transcriban audios, vas a verlo acá."})):Z("",!0),(w(!0),S(ce,null,Oe(g.value,R=>(w(),S("div",{key:R.tipo,class:"px-4 py-3 flex items-center gap-3"},[u("span",xh,T(d(R.tipo).icono),1),u("div",_h,[u("p",yh,T(d(R.tipo).nombre),1),u("p",wh,T(K(R.cantidad))+" "+T(R.unidad)+" · "+T(K(R.eventos))+" usos ",1)]),u("span",Ch,T(G(R.costo)),1)]))),128))]),M.value.dias.length?(w(),S("div",Eh,[A[15]||(A[15]=u("h2",{class:"text-sm font-medium text-texto mb-3"},"Por día",-1)),u("div",Sh,[(w(!0),S(ce,null,Oe(M.value.dias,([R,U])=>(w(),S("div",{key:R,class:"flex-1 min-w-[3px] bg-brand/70 hover:bg-brand rounded-t transition-colors",style:Yt({height:M.value.max?Math.max(2,U/M.value.max*100)+"%":"2px"}),title:`${R}: ${G(U)}`},null,12,Ah))),128))]),u("div",kh,[u("span",null,T(M.value.dias[0][0]),1),u("span",null,T(M.value.dias[M.value.dias.length-1][0]),1)])])):Z("",!0)],64)):Z("",!0)])}}},Ih=bc({history:Qu(ze.baseRuta),routes:[{path:"/",name:"home",component:ef},{path:"/tenants/:id",name:"tenant-agentes",component:Kf,props:!0},{path:"/tenants/:id/uso",name:"uso",component:Rh,props:!0},{path:"/tenants/:tenantId/agentes/:agenteId",name:"agente-detail",component:Xp,props:!0}]});cu(zc).use(Ih).mount("#app");
|