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