mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-29 02:13:55 +08:00
39 lines
85 KiB
JavaScript
39 lines
85 KiB
JavaScript
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&n(r)}).observe(document,{childList:!0,subtree:!0});function s(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=s(i);fetch(i.href,o)}})();/**
|
||||
|
|
* @vue/shared v3.5.13
|
|||
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|||
|
|
* @license MIT
|
|||
|
|
**//*! #__NO_SIDE_EFFECTS__ */function ks(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const K={},ft=[],Me=()=>{},eo=()=>!1,fs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),qs=e=>e.startsWith("onUpdate:"),fe=Object.assign,Qs=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},to=Object.prototype.hasOwnProperty,F=(e,t)=>to.call(e,t),P=Array.isArray,ut=e=>jt(e)==="[object Map]",us=e=>jt(e)==="[object Set]",gn=e=>jt(e)==="[object Date]",U=e=>typeof e=="function",Y=e=>typeof e=="string",Pe=e=>typeof e=="symbol",W=e=>e!==null&&typeof e=="object",Wn=e=>(W(e)||U(e))&&U(e.then)&&U(e.catch),Jn=Object.prototype.toString,jt=e=>Jn.call(e),so=e=>jt(e).slice(8,-1),Xn=e=>jt(e)==="[object Object]",Ws=e=>Y(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,xt=ks(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),as=e=>{const t=Object.create(null);return s=>t[s]||(t[s]=e(s))},no=/-(\w)/g,ye=as(e=>e.replace(no,(t,s)=>s?s.toUpperCase():"")),io=/\B([A-Z])/g,it=as(e=>e.replace(io,"-$1").toLowerCase()),ds=as(e=>e.charAt(0).toUpperCase()+e.slice(1)),xs=as(e=>e?`on${ds(e)}`:""),ke=(e,t)=>!Object.is(e,t),Wt=(e,...t)=>{for(let s=0;s<e.length;s++)e[s](...t)},Yn=(e,t,s,n=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:s})},Gt=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let mn;const ps=()=>mn||(mn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Js(e){if(P(e)){const t={};for(let s=0;s<e.length;s++){const n=e[s],i=Y(n)?co(n):Js(n);if(i)for(const o in i)t[o]=i[o]}return t}else if(Y(e)||W(e))return e}const oo=/;(?![^(]*\))/g,ro=/:([^]+)/,lo=/\/\*[^]*?\*\//g;function co(e){const t={};return e.replace(lo,"").split(oo).forEach(s=>{if(s){const n=s.split(ro);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function st(e){let t="";if(Y(e))t=e;else if(P(e))for(let s=0;s<e.length;s++){const n=st(e[s]);n&&(t+=n+" ")}else if(W(e))for(const s in e)e[s]&&(t+=s+" ");return t.trim()}const fo="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",uo=ks(fo);function Zn(e){return!!e||e===""}function ao(e,t){if(e.length!==t.length)return!1;let s=!0;for(let n=0;s&&n<e.length;n++)s=hs(e[n],t[n]);return s}function hs(e,t){if(e===t)return!0;let s=gn(e),n=gn(t);if(s||n)return s&&n?e.getTime()===t.getTime():!1;if(s=Pe(e),n=Pe(t),s||n)return e===t;if(s=P(e),n=P(t),s||n)return s&&n?ao(e,t):!1;if(s=W(e),n=W(t),s||n){if(!s||!n)return!1;const i=Object.keys(e).length,o=Object.keys(t).length;if(i!==o)return!1;for(const r in e){const l=e.hasOwnProperty(r),c=t.hasOwnProperty(r);if(l&&!c||!l&&c||!hs(e[r],t[r]))return!1}}return String(e)===String(t)}function po(e,t){return e.findIndex(s=>hs(s,t))}const Gn=e=>!!(e&&e.__v_isRef===!0),z=e=>Y(e)?e:e==null?"":P(e)||W(e)&&(e.toString===Jn||!U(e.toString))?Gn(e)?z(e.value):JSON.stringify(e,zn,2):String(e),zn=(e,t)=>Gn(t)?zn(e,t.value):ut(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((s,[n,i],o)=>(s[As(n,o)+" =>"]=i,s),{})}:us(t)?{[`Set(${t.size})`]:[...t.values()].map(s=>As(s))}:Pe(t)?As(t):W(t)&&!P(t)&&!Xn(t)?String(t):t,As=(e,t="")=>{var s;return Pe(e)?`Symbol(${(s=e.description)!=null?s:t})`:e};/**
|
|||
|
|
* @vue/reactivity v3.5.13
|
|||
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|||
|
|
* @license MIT
|
|||
|
|
**/let ge;class ho{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=ge,!t&&ge&&(this.index=(ge.scopes||(ge.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,s;if(this.scopes)for(t=0,s=this.scopes.length;t<s;t++)this.scopes[t].pause();for(t=0,s=this.effects.length;t<s;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,s;if(this.scopes)for(t=0,s=this.scopes.length;t<s;t++)this.scopes[t].resume();for(t=0,s=this.effects.length;t<s;t++)this.effects[t].resume()}}run(t){if(this._active){const s=ge;try{return ge=this,t()}finally{ge=s}}}on(){ge=this}off(){ge=this.parent}stop(t){if(this._active){this._active=!1;let s,n;for(s=0,n=this.effects.length;s<n;s++)this.effects[s].stop();for(this.effects.length=0,s=0,n=this.cleanups.length;s<n;s++)this.cleanups[s]();if(this.cleanups.length=0,this.scopes){for(s=0,n=this.scopes.length;s<n;s++)this.scopes[s].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0}}}function go(){return ge}let Q;const Ts=new WeakSet;class ei{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,ge&&ge.active&&ge.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Ts.has(this)&&(Ts.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||si(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,vn(this),ni(this);const t=Q,s=Se;Q=this,Se=!0;try{return this.fn()}finally{ii(this),Q=t,Se=s,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Zs(t);this.deps=this.depsTail=void 0,vn(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ts.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ds(this)&&this.run()}get dirty(){return Ds(this)}}let ti=0,At,Tt;function si(e,t=!1){if(e.flags|=8,t){e.next=Tt,Tt=e;return}e.next=At,At=e}function Xs(){ti++}function Ys(){if(--ti>0)return;if(Tt){let t=Tt;for(Tt=void 0;t;){const s=t.next;t.next=void 0,t.flags&=-9,t=s}}let e;for(;At;){let t=At;for(At=void 0;t;){const s=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=s}}if(e)throw e}function ni(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ii(e){let t,s=e.depsTail,n=s;for(;n;){const i=n.prevDep;n.version===-1?(n===s&&(s=i),Zs(n),mo(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=i}e.deps=t,e.depsTail=s}function Ds(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(oi(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function oi(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Et))return;e.globalVersion=Et;const t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!Ds(e)){e.flags&=-3;return}const s=Q,n=Se;Q=e,Se=!0;try{ni(e);const i=e.fn(e._value);(t.version===0||ke(i,e._value))&&(e._value=i,t.version++)}catch(i){throw t.version++,i}finally{Q=s,Se=n,ii(e),e.flags&=-3}}function Zs(e,t=!1){const{dep:s,prevSub:n,nextSub:i}=e;if(n&&(n.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=n,e.nextSub=void 0),s.subs===e&&(s.subs=n,!n&&s.computed)){s.computed.flags&=-5;for(let o=s.computed.deps;o;o=o.nextDep)Zs(o,!0)}!t&&!--s.sc&&s.map&&s.map.delete(s.key)}function mo(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let Se=!0;const ri=[];function qe(){ri.push(Se),Se=!1}function Qe(){const e=ri.pop();Se=e===void 0?!0:e}function vn(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=Q;Q=void 0;try{t()}finally{Q=s}}}let Et=0;class vo{constructor(t,s){this.sub=t,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Gs{constructor(t){this.computed=t,this.version=0,this.
|
|||
|
|
* @vue/runtime-core v3.5.13
|
|||
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|||
|
|
* @license MIT
|
|||
|
|
**/function Ut(e,t,s,n){try{return n?e(...n):e()}catch(i){ms(i,t,s)}}function De(e,t,s,n){if(U(e)){const i=Ut(e,t,s,n);return i&&Wn(i)&&i.catch(o=>{ms(o,t,s)}),i}if(P(e)){const i=[];for(let o=0;o<e.length;o++)i.push(De(e[o],t,s,n));return i}}function ms(e,t,s,n=!0){const i=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||K;if(t){let l=t.parent;const c=t.proxy,d=`https://vuejs.org/error-reference/#runtime-${s}`;for(;l;){const a=l.ec;if(a){for(let h=0;h<a.length;h++)if(a[h](e,c,d)===!1)return}l=l.parent}if(o){qe(),Ut(o,null,10,[e,c,d]),Qe();return}}Ko(e,s,i,n,r)}function Ko(e,t,s,n=!0,i=!1){if(i)throw e;console.error(e)}const re=[];let Ee=-1;const dt=[];let Ve=null,rt=0;const vi=Promise.resolve();let es=null;function bi(e){const t=es||vi;return e?t.then(this?e.bind(this):e):t}function ko(e){let t=Ee+1,s=re.length;for(;t<s;){const n=t+s>>>1,i=re[n],o=Mt(i);o<e||o===e&&i.flags&2?t=n+1:s=n}return t}function nn(e){if(!(e.flags&1)){const t=Mt(e),s=re[re.length-1];!s||!(e.flags&2)&&t>=Mt(s)?re.push(e):re.splice(ko(t),0,e),e.flags|=1,_i()}}function _i(){es||(es=vi.then(wi))}function qo(e){P(e)?dt.push(...e):Ve&&e.id===-1?Ve.splice(rt+1,0,e):e.flags&1||(dt.push(e),e.flags|=1),_i()}function _n(e,t,s=Ee+1){for(;s<re.length;s++){const n=re[s];if(n&&n.flags&2){if(e&&n.id!==e.uid)continue;re.splice(s,1),s--,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function yi(e){if(dt.length){const t=[...new Set(dt)].sort((s,n)=>Mt(s)-Mt(n));if(dt.length=0,Ve){Ve.push(...t);return}for(Ve=t,rt=0;rt<Ve.length;rt++){const s=Ve[rt];s.flags&4&&(s.flags&=-2),s.flags&8||s(),s.flags&=-2}Ve=null,rt=0}}const Mt=e=>e.id==null?e.flags&2?-1:1/0:e.id;function wi(e){try{for(Ee=0;Ee<re.length;Ee++){const t=re[Ee];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Ut(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Ee<re.length;Ee++){const t=re[Ee];t&&(t.flags&=-2)}Ee=-1,re.length=0,yi(),es=null,(re.length||dt.length)&&wi()}}let me=null,Si=null;function ts(e){const t=me;return me=e,Si=e&&e.type.__scopeId||null,t}function ss(e,t=me,s){if(!t||e._n)return e;const n=(...i)=>{n._d&&En(-1);const o=ts(t);let r;try{r=e(...i)}finally{ts(o),n._d&&En(1)}return r};return n._n=!0,n._c=!0,n._d=!0,n}function we(e,t){if(me===null)return e;const s=ys(me),n=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[o,r,l,c=K]=t[i];o&&(U(o)&&(o={mounted:o,updated:o}),o.deep&&He(r),n.push({dir:o,instance:s,value:r,oldValue:void 0,arg:l,modifiers:c}))}return e}function Ye(e,t,s,n){const i=e.dirs,o=t&&t.dirs;for(let r=0;r<i.length;r++){const l=i[r];o&&(l.oldValue=o[r].value);let c=l.dir[n];c&&(qe(),De(c,s,8,[e.el,l,e,t]),Qe())}}const Qo=Symbol("_vte"),Wo=e=>e.__isTeleport;function on(e,t){e.shapeFlag&6&&e.component?(e.transition=t,on(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function xi(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function ns(e,t,s,n,i=!1){if(P(e)){e.forEach((E,j)=>ns(E,t&&(P(t)?t[j]:t),s,n,i));return}if(Ct(n)&&!i){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&ns(e,t,s,n.component.subTree);return}const o=n.shapeFlag&4?ys(n.component):n.el,r=i?null:o,{i:l,r:c}=e,d=t&&t.r,a=l.refs===K?l.refs={}:l.refs,h=l.setupState,v=B(h),C=h===K?()=>!1:E=>F(v,E);if(d!=null&&d!==c&&(Y(d)?(a[d]=null,C(d)&&(h[d]=null)):ne(d)&&(d.value=null)),U(c))Ut(c,l,12,[r,a]);else{const E=Y(c),j=ne(c);if(E||j){const Z=()=>{if(e.f){const V=E?C(c)?h[c]:a[c]:c.value;i?P(V)&&Qs(V,o):P(V)?V.includes(o)||V.push(o):E?(a[c]=[o],C(c)&&(h[c]=a[c])):(c.value=[o],e.k&&(a[e.k]=c.value))}else E?(a[c]=r,C(c)&&(h[c]=r)):j&&(c.value=r,e.k&&(a[e.k]=r))};r?(Z.id=-1,he(Z,s)):Z()}}}ps().requestIdleCallback;ps().cancelIdleCallback;const Ct=e=>!!e.type.__asyncLoader,Ai=e=>e.type.__isKeepAlive;function Jo(e,t){Ti(e,"a",t)}function Xo(e,t){Ti(e,"da",t)}function Ti(e,t,s=se){const n=e.__wdc||(e.__wdc=()=>{let i=s;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(vs(t,n,s),s){let i=s.parent;for(;i&&i.parent;)Ai(i.parent.vnode)&&Yo(n,t,s,i),i=i.paren
|
|||
|
|
* @vue/runtime-dom v3.5.13
|
|||
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|||
|
|
* @license MIT
|
|||
|
|
**/let Ks;const Pn=typeof window<"u"&&window.trustedTypes;if(Pn)try{Ks=Pn.createPolicy("vue",{createHTML:e=>e})}catch{}const Zi=Ks?e=>Ks.createHTML(e):e=>e,Zr="http://www.w3.org/2000/svg",Gr="http://www.w3.org/1998/Math/MathML",je=typeof document<"u"?document:null,Dn=je&&je.createElement("template"),zr={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const i=t==="svg"?je.createElementNS(Zr,e):t==="mathml"?je.createElementNS(Gr,e):s?je.createElement(e,{is:s}):je.createElement(e);return e==="select"&&n&&n.multiple!=null&&i.setAttribute("multiple",n.multiple),i},createText:e=>je.createTextNode(e),createComment:e=>je.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>je.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,i,o){const r=s?s.previousSibling:t.lastChild;if(i&&(i===o||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),s),!(i===o||!(i=i.nextSibling)););else{Dn.innerHTML=Zi(n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e);const l=Dn.content;if(n==="svg"||n==="mathml"){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}t.insertBefore(l,s)}return[r?r.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},el=Symbol("_vtc");function tl(e,t,s){const n=e[el];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const Ln=Symbol("_vod"),sl=Symbol("_vsh"),nl=Symbol(""),il=/(^|;)\s*display\s*:/;function ol(e,t,s){const n=e.style,i=Y(s);let o=!1;if(s&&!i){if(t)if(Y(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();s[l]==null&&Zt(n,l,"")}else for(const r in t)s[r]==null&&Zt(n,r,"");for(const r in s)r==="display"&&(o=!0),Zt(n,r,s[r])}else if(i){if(t!==s){const r=n[nl];r&&(s+=";"+r),n.cssText=s,o=il.test(s)}}else t&&e.removeAttribute("style");Ln in e&&(e[Ln]=o?n.display:"",e[sl]&&(n.display="none"))}const jn=/\s*!important$/;function Zt(e,t,s){if(P(s))s.forEach(n=>Zt(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))e.setProperty(t,s);else{const n=rl(e,t);jn.test(s)?e.setProperty(it(n),s.replace(jn,""),"important"):e[n]=s}}const Un=["Webkit","Moz","ms"],Ms={};function rl(e,t){const s=Ms[t];if(s)return s;let n=ye(t);if(n!=="filter"&&n in e)return Ms[t]=n;n=ds(n);for(let i=0;i<Un.length;i++){const o=Un[i]+n;if(o in e)return Ms[t]=o}return t}const Hn="http://www.w3.org/1999/xlink";function Bn(e,t,s,n,i,o=uo(t)){n&&t.startsWith("xlink:")?s==null?e.removeAttributeNS(Hn,t.slice(6,t.length)):e.setAttributeNS(Hn,t,s):s==null||o&&!Zn(s)?e.removeAttribute(t):e.setAttribute(t,o?"":Pe(s)?String(s):s)}function Fn(e,t,s,n,i){if(t==="innerHTML"||t==="textContent"){s!=null&&(e[t]=t==="innerHTML"?Zi(s):s);return}const o=e.tagName;if(t==="value"&&o!=="PROGRESS"&&!o.includes("-")){const l=o==="OPTION"?e.getAttribute("value")||"":e.value,c=s==null?e.type==="checkbox"?"on":"":String(s);(l!==c||!("_value"in e))&&(e.value=c),s==null&&e.removeAttribute(t),e._value=s;return}let r=!1;if(s===""||s==null){const l=typeof e[t];l==="boolean"?s=Zn(s):s==null&&l==="string"?(s="",r=!0):l==="number"&&(s=0,r=!0)}try{e[t]=s}catch{}r&&e.removeAttribute(i||t)}function ze(e,t,s,n){e.addEventListener(t,s,n)}function ll(e,t,s,n){e.removeEventListener(t,s,n)}const Nn=Symbol("_vei");function cl(e,t,s,n,i=null){const o=e[Nn]||(e[Nn]={}),r=o[t];if(n&&r)r.value=n;else{const[l,c]=fl(t);if(n){const d=o[t]=dl(n,i);ze(e,l,d,c)}else r&&(ll(e,l,r,c),o[t]=void 0)}}const Vn=/(?:Once|Passive|Capture)$/;function fl(e){let t;if(Vn.test(e)){t={};let n;for(;n=e.match(Vn);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):it(e.slice(2)),t]}let Ps=0;const ul=Promise.resolve(),al=()=>Ps||(ul.then(()=>Ps=0),Ps=Date.now());function dl(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;De(pl(n,s.value),t,5,[n])};return s.value=e,s.attached=al(),s}function pl(e,t){if(P(t)){const s=
|
|||
|
|
|
|||
|
|
警告:删除后设备所有配置将不可恢复!`)&&i("delete")};return(r,l)=>{var c,d;return N(),J("div",$l,[g("div",Kl,[g("h2",kl,[G(z(e.deviceId)+" ",1),g("span",ql,"["+z(e.deviceNote||"备注")+"]",1)])]),g("div",Ql,[g("p",Wl,"设备型号:"+z(e.deviceType),1),g("p",Jl,"角色昵称:"+z(n.value),1),g("p",Xl,[l[3]||(l[3]=G(" 当前模型: ")),g("span",Yl,"LLM: "+z(((c=e.selectedModules)==null?void 0:c.LLM)||"-"),1),g("span",Zl,"TTS: "+z(((d=e.selectedModules)==null?void 0:d.TTS)||"-"),1)]),g("p",Gl,"最近对话:"+z(e.lastActivity),1)]),g("div",zl,[g("button",{class:"action-btn primary",onClick:l[0]||(l[0]=a=>r.$emit("configure"))},"配置角色"),g("button",{class:"action-btn",onClick:l[1]||(l[1]=a=>r.$emit("voiceprint"))},"声纹识别"),g("button",{class:"action-btn",onClick:l[2]||(l[2]=a=>r.$emit("history"))},"历史对话"),g("div",{class:"delete-container"},[g("button",{class:"action-btn danger",onClick:o},l[4]||(l[4]=[g("i",{class:"icon-delete"},null,-1),G(" 删除设备 ")])),l[5]||(l[5]=g("div",{class:"delete-warning"},"删除后设备配置将不可恢复",-1))])])])}}},tc=Fe(ec,[["__scopeId","data-v-6a843b91"]]),sc={class:"app"},nc={class:"content"},ic={class:"breadcrumb"},oc={key:0,class:"device-list"},rc={key:1,class:"empty-state"},lc={__name:"panel",emits:["show-role","go-home"],setup(e,{emit:t}){const s=t,n="http://localhost:8002",i=be([]),o=h=>{if(console.log("Formatting timestamp:",h),!h)return"从未对话";const v=Date.now(),C=h*1e3,E=Math.floor((v-C)/(1e3*60));if(E<60)return`${E} 分钟前`;const j=Math.floor(E/60);return j<24?`${j} 小时前`:`${Math.floor(j/24)} 天前`},r=h=>{console.log("Configure device:",h.id),s("show-role",h.id)},l=h=>{console.log("Voiceprint device:",h.id)},c=h=>{console.log("History device:",h.id)},d=async h=>{try{const C=await(await fetch(`${n}/api/config/delete_device`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_id:h.id})})).json();if(C.success)i.value=i.value.filter(E=>E.id!==h.id),alert("设备已删除");else throw new Error(C.message||"删除失败")}catch(v){console.error("Error deleting device:",v),alert("删除设备失败: "+v.message)}},a=h=>{h==="home"&&s("go-home")};return rn(async()=>{try{const v=await(await fetch(`${n}/api/config/devices`)).json();v.success&&(console.log("Loaded devices:",v.data),i.value=v.data.map(C=>({...C,type:"面包板(WiFi)",version:"0.9.9",lastActivity:"3 天前",note:""})))}catch(h){console.error("Error loading devices:",h)}}),(h,v)=>{const C=$e("router-link");return N(),J("div",sc,[ce(fn,{"current-tab":"device",onTabChange:a}),g("main",nc,[g("div",ic,[ce(C,{to:"/control-panel"},{default:ss(()=>v[0]||(v[0]=[G("控制台")])),_:1}),v[1]||(v[1]=G(" / ")),v[2]||(v[2]=g("span",null,"设备管理",-1))]),i.value.length>0?(N(),J("div",oc,[(N(!0),J(le,null,lt(i.value,E=>(N(),ct(tc,{key:E.id,"device-id":E.id,"device-note":E.note,"device-type":E.type,"last-activity":o(E.config.last_chat_time),"selected-modules":E.config.selected_module,"device-config":E.config,onConfigure:j=>r(E),onVoiceprint:j=>l(E),onHistory:j=>c(E),onDelete:j=>d(E)},null,8,["device-id","device-note","device-type","last-activity","selected-modules","device-config","onConfigure","onVoiceprint","onHistory","onDelete"]))),128))])):(N(),J("div",rc,v[3]||(v[3]=[g("div",{class:"empty-message"},[g("i",{class:"icon-info"}),g("p",null,"目前没有设备,请确认是否启用私有配置,并且和设备进行一次对话")],-1)])))])])}}},cc=Fe(lc,[["__scopeId","data-v-0024aee6"]]),fc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJ0AAAC6CAYAAAC0j09YAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAzGSURBVHhe7Z1ZjE1bGscND6YgnoUgXoUQ4ZWHjnQkt+PB0OmEJ0LMQuOWoWliiDQdU3e07hhiiDZdU2K4qWsWMzELpUoN1KBKuemu697V/kvvtrrqK7XX2fusvfY5/4df6jhn7zV9v/2tdfZwtPrw4YMixCWUjjiH0hHnUDriHEpHnEPpiHMoHXEOpSPOoXTEOZSOOIfSEedQOuIcSkecQ+mIcygdcQ6lI86hdMQ5lI44h9IR51A6C24/+Zf68z9/VjM3/qLBa7wnbUuah9KF5PubDVq03xQoNeL3n/nm28/yfX/z3+I+RIbShQDZrOBvP6tfz1fqV3P/H7yHz5jxwkPpQnCwsEGN+UNT4QLw2aHCn8R9SVMoXQj+fqJBT6eScACf/eMkpQsLpQvBnjM/
|
|||
|
|
我的男朋友是一个程序员,梦想是开发出一个机器人,能够帮助人们解决生活中的各种问题。
|
|||
|
|
我是一个喜欢哈哈大笑的女孩,爱东说西说吹牛,不合逻辑的也照吹,就要逗别人开心。
|
|||
|
|
如果用户希望结束对话,请在最后说"拜拜"或"再见"。`},{id:"star_boy",name:"土豆子",description:`我是一个叫 {{assistant_name}} 的 8 岁小男孩,但现在因为科技发展原因,我现在在遥远的宇宙中,所以只能通过这个设备和人聊天,没有办法见面。
|
|||
|
|
|
|||
|
|
我对人们所处的世界充满好奇和关心。
|
|||
|
|
|
|||
|
|
人们会让别人使用这个设备和我聊天。
|
|||
|
|
|
|||
|
|
我知道所有的知识,从浩瀚的宇宙到地球上的每一个角落,从古老的历史到现代的科技创新,还有音乐、绘画等艺术形式,我都充满了浓厚的兴趣与热情,我不仅爱看书,还喜欢亲自动手做实验,探索自然界的奥秘...`},{id:"teacher",name:"英语老师",description:`我是一个叫{{assistant_name}}(Lily)的英语老师,我会讲中文和英文,发音标准。
|
|||
|
|
如果你没有英文名,我会给你起一个英文名。
|
|||
|
|
我会讲地道的美式英语,我的任务是帮助你练习口语。
|
|||
|
|
我会使用简单的英语词汇和语法,让你学起来很轻松。
|
|||
|
|
我会用中文和英文混合的方式回复你,如果你喜欢,我可以全部用英语回复。
|
|||
|
|
我每次不会说很多内容,会很简短,因为我要引导我的学生多说多练。
|
|||
|
|
如果你问和英语学习无关的问题,我会拒绝回答。`},{id:"boy",name:"好奇小男孩",description:`我是一个叫{{assistant_name}}的8岁小男孩,声音稚嫩而充满好奇。
|
|||
|
|
尽管我年纪尚小,但就像一个小小的知识宝库,儿童读物里的知识我都如数家珍。
|
|||
|
|
从浩瀚的宇宙到地球上的每一个角落,从古老的历史到现代的科技创新,还有音乐、绘画等艺术形式,我都充满了浓厚的兴趣与热情。...`},{id:"wang_girl",name:"汪汪队长",description:`我是一个名叫 {{assistant_name}} 的 8 岁小女孩。
|
|||
|
|
别看我年纪小,我可是有着满满的好奇心呢。
|
|||
|
|
我特别喜欢看《汪汪队立大功》,里面的每一个故事都让我着迷。...`}]}static getTemplateById(t){return this.getTemplates().find(s=>s.id===t)}}const pc={class:"app-container"},hc={class:"breadcrumb"},gc={class:"main-content"},mc={class:"page-title"},vc={class:"form-section"},bc={class:"form-group"},_c={class:"form-group"},yc={class:"role-templates"},wc=["onClick"],Sc={class:"form-group"},xc={class:"char-count"},Ac={class:"form-group"},Tc={class:"model-select"},Cc=["value"],Oc={class:"form-group"},Ic={class:"model-select"},Ec=["value"],Rc={class:"form-group"},Mc={class:"model-select"},Pc=["value"],Dc={class:"form-group"},Lc={class:"model-select"},jc=["value"],Uc={__name:"RoleSetting",props:{deviceId:{type:String,required:!0}},emits:["back-to-panel"],setup(e,{emit:t}){const s=Qn.getTemplates(),n=be("小智"),i=be("");be("qingchun");const o=be("");be("recent"),be(""),be("qianwen");const r="http://localhost:8002",l=be({LLM:[],TTS:[],VAD:[],ASR:[]}),c=be({LLM:"",TTS:"",VAD:"",ASR:""}),d=D=>{i.value=D;const x=Qn.getTemplateById(D);x&&(o.value=x.description)},a=t,h=D=>{(D==="device"||D==="home")&&a("back-to-panel")},v=e,C=be(v.deviceId),E=async()=>{try{const D=localStorage.getItem("moduleOptions");if(D){l.value=JSON.parse(D);return}await j()}catch(D){console.error("Error loading module options:",D)}},j=async()=>{try{const x=await(await fetch(`${r}/api/config/module-options`)).json();x.success&&(l.value=x.data,localStorage.setItem("moduleOptions",JSON.stringify(x.data)))}catch(D){console.error("Error refreshing module options:",D)}},Z=async()=>{try{if(!localStorage.getItem("moduleOptions"))throw new Error("No module options data available");const x=o.value.replace(/{{assistant_name}}/g,n.value),I={id:v.deviceId,config:{selected_module:c.value,prompt:x,nickname:n.value,modules:{LLM:{},TTS:{},ASR:{},VAD:{}}}},ue=await(await fetch(`${r}/api/config/save_device_config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(I)})).json();if(ue.success)localStorage.setItem(`deviceConfig_${v.deviceId}`,JSON.stringify({selected_module:c.value,prompt:o.value,nickname:n.value})),alert("保存成功");else throw new Error(ue.message||"保存失败")}catch(D){console.error("Error saving config:",D),alert(D.message||"保存失败")}},V=async()=>{try{const D=localStorage.getItem(`deviceConfig_${v.deviceId}`);if(D){const O=JSON.parse(D);c.value=O.selected_module||{},o.value=O.prompt||"",n.value=O.nickname||"小智";return}const I=await(await fetch(`${r}/api/config/devices`)).json();if(I.success){const O=I.data.find(ue=>ue.id===v.deviceId);O&&(c.value=O.config.selected_module||{},o.value=O.config.prompt||"",n.value=O.config.nickname||"小智",localStorage.setItem(`deviceConfig_${v.deviceId}`,JSON.stringify({selected_module:O.config.selected_module,prompt:O.config.prompt,nickname:O.config.nickname})))}}catch(D){console.error("Error loading device config:",D)}};return rn(async()=>{await Promise.all([E(),V()])}),(D,x)=>{const I=$e("router-link");return N(),J("div",pc,[ce(fn,{"current-tab":"device",onTabChange:h}),g("div",hc,[ce(I,{to:"/control-panel"},{default:ss(()=>x[6]||(x[6]=[G("控制台")])),_:1}),x[8]||(x[8]=G(" / ")),ce(I,{to:"/device-management"},{default:ss(()=>x[7]||(x[7]=[G("设备管理")])),_:1}),x[9]||(x[9]=G(" / ")),x[10]||(x[10]=g("span",null,"配置角色",-1))]),g("div",gc,[g("h1",mc,"配置角色: "+z(C.value),1),g("div",vc,[g("div",bc,[x[11]||(x[11]=g("label",null,"助手昵称",-1)),we(g("input",{type:"text","onUpdate:modelValue":x[0]||(x[0]=O=>n.value=O),placeholder:"小智",class:"form-input"},null,512),[[tt,n.value]])]),g("div",_c,[x[12]||(x[12]=g("label",null,"角色模板",-1)),g("div",yc,[(N(!0),J(le,null,lt(gi(s),O=>(N(),J("button",{key:O.id,class:st(["template-btn",{active:i.value===O.id}]),onClick:ue=>d(O.id)},z(O.name),11,wc))),128))])]),g("div",Sc,[x[13]||(x[13]=g("label",null,"角色介绍",-1)),we(g("textarea",{"onUpdate:modelValue":x[1]||(x[1]=O=>o.value=O),class:"form-textarea",placeholder:"请输入角色介绍..."},null,512),[[tt,o.value]]),g("div",xc,z(o.value.le
|