Xin Zhang commited on
Commit
87ba0a7
·
1 Parent(s): 3512b39

[fix]: update web.

Browse files
frontend/assets/{index-f26a66d2.css → index-45f88fc9.css} RENAMED
@@ -1 +1 @@
1
- html,body{width:100%;height:100%}input::-ms-clear,input::-ms-reveal{display:none}*,*:before,*:after{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{margin:0}[tabindex="-1"]:focus{outline:none}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;font-weight:500}p{margin-top:0;margin-bottom:1em}abbr[title],abbr[data-original-title]{-webkit-text-decoration:underline dotted;text-decoration:underline;text-decoration:underline dotted;border-bottom:0;cursor:help}address{margin-bottom:1em;font-style:normal;line-height:inherit}input[type=text],input[type=password],input[type=number],textarea{-webkit-appearance:none}ol,ul,dl{margin-top:0;margin-bottom:1em}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}pre,code,kbd,samp{font-size:1em;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace}pre{margin-top:0;margin-bottom:1em;overflow:auto}figure{margin:0 0 1em}img{vertical-align:middle;border-style:none}a,area,button,[role=button],input:not([type=range]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75em;padding-bottom:.3em;text-align:left;caption-side:bottom}input,button,select,optgroup,textarea{margin:0;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{padding:0;border-style:none}input[type=radio],input[type=checkbox]{box-sizing:border-box;padding:0}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;margin:0;padding:0;border:0}legend{display:block;width:100%;max-width:100%;margin-bottom:.5em;padding:0;color:inherit;font-size:1.5em;line-height:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{padding:.2em;background-color:#feffe6}:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;height:auto;min-height:auto;color:#333;background:#fff}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}.card{border-bottom:solid 2px lightgray;align-items:center;justify-content:center;margin-top:40px;display:flex;max-width:1024px;width:100%}.seg-title{margin:24px 0;font-size:20px;font-weight:500}.seg-co{width:1022px;text-align:left;border-left:solid 6px midnightblue;padding-left:8px;margin-left:2px;margin-top:36px;line-height:24px}#app{margin:0 auto;padding:0;text-align:center;width:100%}.ant-btn{padding:4px 12px}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}.ant-card{background:#f5f6fa}.ant-card .ant-card-actions{background-color:#e8e8f8cc!important}.ant-popover{max-width:800px!important}.ant-form-item{background:transparent;margin-bottom:40px!important}.ant-form-item .ant-form-item-explain-error{color:#ff4d4f;text-align:left!important}.ant-form-item-label label{font-size:18px!important;color:#1a1a1a!important;font-weight:500!important}.ant-tooltip{max-width:1022px!important}.ant-page-header-heading{width:1022px!important}.highlight{background:ghostwhite}.content[data-v-178d5f9f]{background-color:#fff;max-width:1280px;min-height:720px;margin:0 auto;display:flex;flex-direction:column;align-items:center;justify-content:space-between}.not-found-wrapper[data-v-aef52a59]{height:calc(100vh - 104px)}.view-wrapper[data-v-f8c11346]{width:100%;height:100%;background-color:#fff}.view-wrapper .content-wrapper[data-v-f8c11346]{text-align:left;width:1280px;max-width:100vw;min-width:320px;margin-bottom:64px;min-height:calc(100vh - 438px)}.view-wrapper .content-wrapper .chat-box[data-v-f8c11346]{width:100%;height:54vh;border-radius:4px;padding:12px;color:#2e2f33;font-size:18px}.view-wrapper .content-wrapper .chat-box-placeholder[data-v-f8c11346]{width:100%;height:58vh;border-radius:4px;padding:12px;font-size:18px;color:#a4a6ac}.view-wrapper .content-wrapper .actions-box[data-v-f8c11346]{display:flex;align-items:center;justify-content:space-between;margin:0 24px;height:48px}.view-wrapper .content-wrapper .trans-list[data-v-f8c11346]{overflow-y:auto;width:100%;height:58vh;scrollbar-width:none;-ms-overflow-style:none}.view-wrapper .content-wrapper .trans-list[data-v-f8c11346]::-webkit-scrollbar{display:none}.view-wrapper .content-wrapper .trans-list .node[data-v-f8c11346]{margin-bottom:36px;width:100%!important;transition:all .3s ease}.view-wrapper .content-wrapper .trans-list .node .trans-time[data-v-f8c11346]{font-size:14px;color:#c4c6cc}.view-wrapper .content-wrapper .trans-list .node .trans-src-lang[data-v-f8c11346]{font-size:18px;color:#a0a2a9}.view-wrapper .content-wrapper .trans-list .node .trans-dst-lang[data-v-f8c11346]{font-size:18px;color:#2e2f33;font-weight:600}.view-wrapper .content-wrapper .trans-list .current_node[data-v-f8c11346]{background-color:#f0f1f7;padding:4px 8px}@keyframes highlight-f8c11346{0%{background-color:transparent}50%{background-color:#fff1ce80}to{background-color:transparent}}@keyframes slideIn-f8c11346{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.content-wrapper[data-v-c39ab0d6]{text-align:left;max-width:800px;min-width:320px;margin-bottom:64px;min-height:calc(100vh - 438px)}.content-wrapper .content-box[data-v-c39ab0d6]{padding:24px;height:240px;background-color:#e8e8e8;border-radius:16px;width:50%;margin:48px auto;min-width:300px}.content-wrapper .video-box[data-v-c39ab0d6]{max-width:800px;min-width:320px;width:90vw;height:auto}
 
1
+ html,body{width:100%;height:100%}input::-ms-clear,input::-ms-reveal{display:none}*,*:before,*:after{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{margin:0}[tabindex="-1"]:focus{outline:none}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;font-weight:500}p{margin-top:0;margin-bottom:1em}abbr[title],abbr[data-original-title]{-webkit-text-decoration:underline dotted;text-decoration:underline;text-decoration:underline dotted;border-bottom:0;cursor:help}address{margin-bottom:1em;font-style:normal;line-height:inherit}input[type=text],input[type=password],input[type=number],textarea{-webkit-appearance:none}ol,ul,dl{margin-top:0;margin-bottom:1em}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}pre,code,kbd,samp{font-size:1em;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace}pre{margin-top:0;margin-bottom:1em;overflow:auto}figure{margin:0 0 1em}img{vertical-align:middle;border-style:none}a,area,button,[role=button],input:not([type=range]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75em;padding-bottom:.3em;text-align:left;caption-side:bottom}input,button,select,optgroup,textarea{margin:0;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{padding:0;border-style:none}input[type=radio],input[type=checkbox]{box-sizing:border-box;padding:0}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;margin:0;padding:0;border:0}legend{display:block;width:100%;max-width:100%;margin-bottom:.5em;padding:0;color:inherit;font-size:1.5em;line-height:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{padding:.2em;background-color:#feffe6}:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;height:auto;min-height:auto;color:#333;background:#fff}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}.card{border-bottom:solid 2px lightgray;align-items:center;justify-content:center;margin-top:40px;display:flex;max-width:1024px;width:100%}.seg-title{margin:24px 0;font-size:20px;font-weight:500}.seg-co{width:1022px;text-align:left;border-left:solid 6px midnightblue;padding-left:8px;margin-left:2px;margin-top:36px;line-height:24px}#app{margin:0 auto;padding:0;text-align:center;width:100%}.ant-btn{padding:4px 12px}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}.ant-card{background:#f5f6fa}.ant-card .ant-card-actions{background-color:#e8e8f8cc!important}.ant-popover{max-width:800px!important}.ant-form-item{background:transparent;margin-bottom:40px!important}.ant-form-item .ant-form-item-explain-error{color:#ff4d4f;text-align:left!important}.ant-form-item-label label{font-size:18px!important;color:#1a1a1a!important;font-weight:500!important}.ant-tooltip{max-width:1022px!important}.ant-page-header-heading{width:1022px!important}.highlight{background:ghostwhite}.content[data-v-178d5f9f]{background-color:#fff;max-width:1280px;min-height:720px;margin:0 auto;display:flex;flex-direction:column;align-items:center;justify-content:space-between}.not-found-wrapper[data-v-aef52a59]{height:calc(100vh - 104px)}.view-wrapper[data-v-878f2058]{width:100%;height:100%;background-color:#fff}.view-wrapper .content-wrapper[data-v-878f2058]{text-align:left;width:1280px;max-width:100vw;min-width:320px;margin-bottom:64px;min-height:calc(100vh - 438px)}.view-wrapper .content-wrapper .chat-box[data-v-878f2058]{width:100%;height:54vh;border-radius:4px;padding:12px;color:#2e2f33;font-size:18px}.view-wrapper .content-wrapper .chat-box-placeholder[data-v-878f2058]{width:100%;height:58vh;border-radius:4px;padding:12px;font-size:18px;color:#a4a6ac}.view-wrapper .content-wrapper .actions-box[data-v-878f2058]{display:flex;align-items:center;justify-content:space-between;margin:0 24px;height:48px}.view-wrapper .content-wrapper .trans-list[data-v-878f2058]{overflow-y:auto;width:100%;height:58vh;scrollbar-width:none;-ms-overflow-style:none}.view-wrapper .content-wrapper .trans-list[data-v-878f2058]::-webkit-scrollbar{display:none}.view-wrapper .content-wrapper .trans-list .node[data-v-878f2058]{margin-bottom:36px;width:100%!important;transition:all .3s ease}.view-wrapper .content-wrapper .trans-list .node .trans-time[data-v-878f2058]{font-size:14px;color:#c4c6cc}.view-wrapper .content-wrapper .trans-list .node .trans-src-lang[data-v-878f2058]{font-size:18px;color:#909299;font-weight:500}.view-wrapper .content-wrapper .trans-list .node .trans-dst-lang[data-v-878f2058]{font-size:18px;color:#2e2f33;font-weight:600}.view-wrapper .content-wrapper .trans-list .current_node[data-v-878f2058]{background-color:#f0f1f7;padding:4px 8px}@keyframes highlight-878f2058{0%{background-color:transparent}50%{background-color:#fff1ce80}to{background-color:transparent}}@keyframes slideIn-878f2058{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.content-wrapper[data-v-c39ab0d6]{text-align:left;max-width:800px;min-width:320px;margin-bottom:64px;min-height:calc(100vh - 438px)}.content-wrapper .content-box[data-v-c39ab0d6]{padding:24px;height:240px;background-color:#e8e8e8;border-radius:16px;width:50%;margin:48px auto;min-width:300px}.content-wrapper .video-box[data-v-c39ab0d6]{max-width:800px;min-width:320px;width:90vw;height:auto}
frontend/assets/{index-1848f0eb.js → index-9a0d049c.js} RENAMED
@@ -492,4 +492,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
492
  * vue-router v4.4.3
493
  * (c) 2024 Eduardo San Martin Morote
494
  * @license MIT
495
- */const Ul=typeof document<"u";function aye(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const Pt=Object.assign;function av(e,t){const n={};for(const o in t){const r=t[o];n[o]=Uo(r)?r.map(e):e(r)}return n}const Vs=()=>{},Uo=Array.isArray,m_=/#/g,sye=/&/g,cye=/\//g,uye=/=/g,dye=/\?/g,b_=/\+/g,fye=/%5B/g,pye=/%5D/g,y_=/%5E/g,hye=/%60/g,S_=/%7B/g,gye=/%7C/g,$_=/%7D/g,vye=/%20/g;function MS(e){return encodeURI(""+e).replace(gye,"|").replace(fye,"[").replace(pye,"]")}function mye(e){return MS(e).replace(S_,"{").replace($_,"}").replace(y_,"^")}function r0(e){return MS(e).replace(b_,"%2B").replace(vye,"+").replace(m_,"%23").replace(sye,"%26").replace(hye,"`").replace(S_,"{").replace($_,"}").replace(y_,"^")}function bye(e){return r0(e).replace(uye,"%3D")}function yye(e){return MS(e).replace(m_,"%23").replace(dye,"%3F")}function Sye(e){return e==null?"":yye(e).replace(cye,"%2F")}function Ic(e){try{return decodeURIComponent(""+e)}catch{}return""+e}const $ye=/\/$/,Cye=e=>e.replace($ye,"");function sv(e,t,n="/"){let o,r={},i="",l="";const a=t.indexOf("#");let s=t.indexOf("?");return a<s&&a>=0&&(s=-1),s>-1&&(o=t.slice(0,s),i=t.slice(s+1,a>-1?a:t.length),r=e(i)),a>-1&&(o=o||t.slice(0,a),l=t.slice(a,t.length)),o=Pye(o??t,n),{fullPath:o+(i&&"?")+i+l,path:o,query:r,hash:Ic(l)}}function xye(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function TO(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function wye(e,t,n){const o=t.matched.length-1,r=n.matched.length-1;return o>-1&&o===r&&Aa(t.matched[o],n.matched[r])&&C_(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Aa(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function C_(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!Oye(e[n],t[n]))return!1;return!0}function Oye(e,t){return Uo(e)?EO(e,t):Uo(t)?EO(t,e):e===t}function EO(e,t){return Uo(t)?e.length===t.length&&e.every((n,o)=>n===t[o]):e.length===1&&e[0]===t}function Pye(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),o=e.split("/"),r=o[o.length-1];(r===".."||r===".")&&o.push("");let i=n.length-1,l,a;for(l=0;l<o.length;l++)if(a=o[l],a!==".")if(a==="..")i>1&&i--;else break;return n.slice(0,i).join("/")+"/"+o.slice(l).join("/")}const Qr={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Tc;(function(e){e.pop="pop",e.push="push"})(Tc||(Tc={}));var Ks;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Ks||(Ks={}));function Iye(e){if(!e)if(Ul){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Cye(e)}const Tye=/^[^#]+#/;function Eye(e,t){return e.replace(Tye,"#")+t}function Mye(e,t){const n=document.documentElement.getBoundingClientRect(),o=e.getBoundingClientRect();return{behavior:t.behavior,left:o.left-n.left-(t.left||0),top:o.top-n.top-(t.top||0)}}const xh=()=>({left:window.scrollX,top:window.scrollY});function _ye(e){let t;if("el"in e){const n=e.el,o=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?o?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=Mye(r,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 MO(e,t){return(history.state?history.state.position-t:-1)+e}const i0=new Map;function Aye(e,t){i0.set(e,t)}function Rye(e){const t=i0.get(e);return i0.delete(e),t}let Dye=()=>location.protocol+"//"+location.host;function x_(e,t){const{pathname:n,search:o,hash:r}=t,i=e.indexOf("#");if(i>-1){let a=r.includes(e.slice(i))?e.slice(i).length:1,s=r.slice(a);return s[0]!=="/"&&(s="/"+s),TO(s,"")}return TO(n,e)+o+r}function Bye(e,t,n,o){let r=[],i=[],l=null;const a=({state:f})=>{const h=x_(e,location),v=n.value,g=t.value;let b=0;if(f){if(n.value=h,t.value=f,l&&l===v){l=null;return}b=g?f.position-g.position:0}else o(h);r.forEach(y=>{y(n.value,v,{delta:b,type:Tc.pop,direction:b?b>0?Ks.forward:Ks.back:Ks.unknown})})};function s(){l=n.value}function c(f){r.push(f);const h=()=>{const v=r.indexOf(f);v>-1&&r.splice(v,1)};return i.push(h),h}function u(){const{history:f}=window;f.state&&f.replaceState(Pt({},f.state,{scroll:xh()}),"")}function d(){for(const f of i)f();i=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",u,{passive:!0}),{pauseListeners:s,listen:c,destroy:d}}function _O(e,t,n,o=!1,r=!1){return{back:e,current:t,forward:n,replaced:o,position:window.history.length,scroll:r?xh():null}}function Nye(e){const{history:t,location:n}=window,o={value:x_(e,n)},r={value:t.state};r.value||i(o.value,{back:null,current:o.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(s,c,u){const d=e.indexOf("#"),f=d>-1?(n.host&&document.querySelector("base")?e:e.slice(d))+s:Dye()+e+s;try{t[u?"replaceState":"pushState"](c,"",f),r.value=c}catch(h){console.error(h),n[u?"replace":"assign"](f)}}function l(s,c){const u=Pt({},t.state,_O(r.value.back,s,r.value.forward,!0),c,{position:r.value.position});i(s,u,!0),o.value=s}function a(s,c){const u=Pt({},r.value,t.state,{forward:s,scroll:xh()});i(u.current,u,!0);const d=Pt({},_O(o.value,s,null),{position:u.position+1},c);i(s,d,!1),o.value=s}return{location:o,state:r,push:a,replace:l}}function kye(e){e=Iye(e);const t=Nye(e),n=Bye(e,t.state,t.location,t.replace);function o(i,l=!0){l||n.pauseListeners(),history.go(i)}const r=Pt({location:"",base:e,go:o,createHref:Eye.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}function Fye(e){return typeof e=="string"||e&&typeof e=="object"}function w_(e){return typeof e=="string"||typeof e=="symbol"}const O_=Symbol("");var AO;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(AO||(AO={}));function Ra(e,t){return Pt(new Error,{type:e,[O_]:!0},t)}function br(e,t){return e instanceof Error&&O_ in e&&(t==null||!!(e.type&t))}const RO="[^/]+?",Lye={sensitive:!1,strict:!1,start:!0,end:!0},zye=/[.+*?^${}()[\]/\\]/g;function Hye(e,t){const n=Pt({},Lye,t),o=[];let r=n.start?"^":"";const i=[];for(const c of e){const u=c.length?[]:[90];n.strict&&!c.length&&(r+="/");for(let d=0;d<c.length;d++){const f=c[d];let h=40+(n.sensitive?.25:0);if(f.type===0)d||(r+="/"),r+=f.value.replace(zye,"\\$&"),h+=40;else if(f.type===1){const{value:v,repeatable:g,optional:b,regexp:y}=f;i.push({name:v,repeatable:g,optional:b});const S=y||RO;if(S!==RO){h+=10;try{new RegExp(`(${S})`)}catch(x){throw new Error(`Invalid custom RegExp for param "${v}" (${S}): `+x.message)}}let $=g?`((?:${S})(?:/(?:${S}))*)`:`(${S})`;d||($=b&&c.length<2?`(?:/${$})`:"/"+$),b&&($+="?"),r+=$,h+=20,b&&(h+=-8),g&&(h+=-20),S===".*"&&(h+=-50)}u.push(h)}o.push(u)}if(n.strict&&n.end){const c=o.length-1;o[c][o[c].length-1]+=.7000000000000001}n.strict||(r+="/?"),n.end?r+="$":n.strict&&(r+="(?:/|$)");const l=new RegExp(r,n.sensitive?"":"i");function a(c){const u=c.match(l),d={};if(!u)return null;for(let f=1;f<u.length;f++){const h=u[f]||"",v=i[f-1];d[v.name]=h&&v.repeatable?h.split("/"):h}return d}function s(c){let u="",d=!1;for(const f of e){(!d||!u.endsWith("/"))&&(u+="/"),d=!1;for(const h of f)if(h.type===0)u+=h.value;else if(h.type===1){const{value:v,repeatable:g,optional:b}=h,y=v in c?c[v]:"";if(Uo(y)&&!g)throw new Error(`Provided param "${v}" is an array but it is not repeatable (* or + modifiers)`);const S=Uo(y)?y.join("/"):y;if(!S)if(b)f.length<2&&(u.endsWith("/")?u=u.slice(0,-1):d=!0);else throw new Error(`Missing required param "${v}"`);u+=S}}return u||"/"}return{re:l,score:o,keys:i,parse:a,stringify:s}}function jye(e,t){let n=0;for(;n<e.length&&n<t.length;){const o=t[n]-e[n];if(o)return o;n++}return e.length<t.length?e.length===1&&e[0]===40+40?-1:1:e.length>t.length?t.length===1&&t[0]===40+40?1:-1:0}function P_(e,t){let n=0;const o=e.score,r=t.score;for(;n<o.length&&n<r.length;){const i=jye(o[n],r[n]);if(i)return i;n++}if(Math.abs(r.length-o.length)===1){if(DO(o))return 1;if(DO(r))return-1}return r.length-o.length}function DO(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Wye={type:0,value:""},Vye=/[a-zA-Z0-9_]/;function Kye(e){if(!e)return[[]];if(e==="/")return[[Wye]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(h){throw new Error(`ERR (${n})/"${c}": ${h}`)}let n=0,o=n;const r=[];let i;function l(){i&&r.push(i),i=[]}let a=0,s,c="",u="";function d(){c&&(n===0?i.push({type:0,value:c}):n===1||n===2||n===3?(i.length>1&&(s==="*"||s==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),i.push({type:1,value:c,regexp:u,repeatable:s==="*"||s==="+",optional:s==="*"||s==="?"})):t("Invalid state to consume buffer"),c="")}function f(){c+=s}for(;a<e.length;){if(s=e[a++],s==="\\"&&n!==2){o=n,n=4;continue}switch(n){case 0:s==="/"?(c&&d(),l()):s===":"?(d(),n=1):f();break;case 4:f(),n=o;break;case 1:s==="("?n=2:Vye.test(s)?f():(d(),n=0,s!=="*"&&s!=="?"&&s!=="+"&&a--);break;case 2:s===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+s:n=3:u+=s;break;case 3:d(),n=0,s!=="*"&&s!=="?"&&s!=="+"&&a--,u="";break;default:t("Unknown state");break}}return n===2&&t(`Unfinished custom RegExp for param "${c}"`),d(),l(),r}function Uye(e,t,n){const o=Hye(Kye(e.path),n),r=Pt(o,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function Gye(e,t){const n=[],o=new Map;t=kO({strict:!1,end:!0,sensitive:!1},t);function r(d){return o.get(d)}function i(d,f,h){const v=!h,g=Xye(d);g.aliasOf=h&&h.record;const b=kO(t,d),y=[g];if("alias"in d){const x=typeof d.alias=="string"?[d.alias]:d.alias;for(const C of x)y.push(Pt({},g,{components:h?h.record.components:g.components,path:C,aliasOf:h?h.record:g}))}let S,$;for(const x of y){const{path:C}=x;if(f&&C[0]!=="/"){const O=f.record.path,w=O[O.length-1]==="/"?"":"/";x.path=f.record.path+(C&&w+C)}if(S=Uye(x,f,b),h?h.alias.push(S):($=$||S,$!==S&&$.alias.push(S),v&&d.name&&!NO(S)&&l(d.name)),I_(S)&&s(S),g.children){const O=g.children;for(let w=0;w<O.length;w++)i(O[w],S,h&&h.children[w])}h=h||S}return $?()=>{l($)}:Vs}function l(d){if(w_(d)){const f=o.get(d);f&&(o.delete(d),n.splice(n.indexOf(f),1),f.children.forEach(l),f.alias.forEach(l))}else{const f=n.indexOf(d);f>-1&&(n.splice(f,1),d.record.name&&o.delete(d.record.name),d.children.forEach(l),d.alias.forEach(l))}}function a(){return n}function s(d){const f=Zye(d,n);n.splice(f,0,d),d.record.name&&!NO(d)&&o.set(d.record.name,d)}function c(d,f){let h,v={},g,b;if("name"in d&&d.name){if(h=o.get(d.name),!h)throw Ra(1,{location:d});b=h.record.name,v=Pt(BO(f.params,h.keys.filter($=>!$.optional).concat(h.parent?h.parent.keys.filter($=>$.optional):[]).map($=>$.name)),d.params&&BO(d.params,h.keys.map($=>$.name))),g=h.stringify(v)}else if(d.path!=null)g=d.path,h=n.find($=>$.re.test(g)),h&&(v=h.parse(g),b=h.record.name);else{if(h=f.name?o.get(f.name):n.find($=>$.re.test(f.path)),!h)throw Ra(1,{location:d,currentLocation:f});b=h.record.name,v=Pt({},f.params,d.params),g=h.stringify(v)}const y=[];let S=h;for(;S;)y.unshift(S.record),S=S.parent;return{name:b,path:g,params:v,matched:y,meta:qye(y)}}e.forEach(d=>i(d));function u(){n.length=0,o.clear()}return{addRoute:i,resolve:c,removeRoute:l,clearRoutes:u,getRoutes:a,getRecordMatcher:r}}function BO(e,t){const n={};for(const o of t)o in e&&(n[o]=e[o]);return n}function Xye(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:Yye(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function Yye(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const o in e.components)t[o]=typeof n=="object"?n[o]:n;return t}function NO(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function qye(e){return e.reduce((t,n)=>Pt(t,n.meta),{})}function kO(e,t){const n={};for(const o in e)n[o]=o in t?t[o]:e[o];return n}function Zye(e,t){let n=0,o=t.length;for(;n!==o;){const i=n+o>>1;P_(e,t[i])<0?o=i:n=i+1}const r=Qye(e);return r&&(o=t.lastIndexOf(r,o-1)),o}function Qye(e){let t=e;for(;t=t.parent;)if(I_(t)&&P_(e,t)===0)return t}function I_({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Jye(e){const t={};if(e===""||e==="?")return t;const o=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<o.length;++r){const i=o[r].replace(b_," "),l=i.indexOf("="),a=Ic(l<0?i:i.slice(0,l)),s=l<0?null:Ic(i.slice(l+1));if(a in t){let c=t[a];Uo(c)||(c=t[a]=[c]),c.push(s)}else t[a]=s}return t}function FO(e){let t="";for(let n in e){const o=e[n];if(n=bye(n),o==null){o!==void 0&&(t+=(t.length?"&":"")+n);continue}(Uo(o)?o.map(i=>i&&r0(i)):[o&&r0(o)]).forEach(i=>{i!==void 0&&(t+=(t.length?"&":"")+n,i!=null&&(t+="="+i))})}return t}function e1e(e){const t={};for(const n in e){const o=e[n];o!==void 0&&(t[n]=Uo(o)?o.map(r=>r==null?null:""+r):o==null?o:""+o)}return t}const t1e=Symbol(""),LO=Symbol(""),_S=Symbol(""),T_=Symbol(""),l0=Symbol("");function ds(){let e=[];function t(o){return e.push(o),()=>{const r=e.indexOf(o);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function ri(e,t,n,o,r,i=l=>l()){const l=o&&(o.enterCallbacks[r]=o.enterCallbacks[r]||[]);return()=>new Promise((a,s)=>{const c=f=>{f===!1?s(Ra(4,{from:n,to:t})):f instanceof Error?s(f):Fye(f)?s(Ra(2,{from:t,to:f})):(l&&o.enterCallbacks[r]===l&&typeof f=="function"&&l.push(f),a())},u=i(()=>e.call(o&&o.instances[r],t,n,c));let d=Promise.resolve(u);e.length<3&&(d=d.then(c)),d.catch(f=>s(f))})}function cv(e,t,n,o,r=i=>i()){const i=[];for(const l of e)for(const a in l.components){let s=l.components[a];if(!(t!=="beforeRouteEnter"&&!l.instances[a]))if(n1e(s)){const u=(s.__vccOpts||s)[t];u&&i.push(ri(u,n,o,l,a,r))}else{let c=s();i.push(()=>c.then(u=>{if(!u)return Promise.reject(new Error(`Couldn't resolve component "${a}" at "${l.path}"`));const d=aye(u)?u.default:u;l.components[a]=d;const h=(d.__vccOpts||d)[t];return h&&ri(h,n,o,l,a,r)()}))}}return i}function n1e(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function zO(e){const t=We(_S),n=We(T_),o=I(()=>{const s=kt(e.to);return t.resolve(s)}),r=I(()=>{const{matched:s}=o.value,{length:c}=s,u=s[c-1],d=n.matched;if(!u||!d.length)return-1;const f=d.findIndex(Aa.bind(null,u));if(f>-1)return f;const h=HO(s[c-2]);return c>1&&HO(u)===h&&d[d.length-1].path!==h?d.findIndex(Aa.bind(null,s[c-2])):f}),i=I(()=>r.value>-1&&l1e(n.params,o.value.params)),l=I(()=>r.value>-1&&r.value===n.matched.length-1&&C_(n.params,o.value.params));function a(s={}){return i1e(s)?t[kt(e.replace)?"replace":"push"](kt(e.to)).catch(Vs):Promise.resolve()}return{route:o,href:I(()=>o.value.href),isActive:i,isExactActive:l,navigate:a}}const o1e=re({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"}},useLink:zO,setup(e,{slots:t}){const n=ct(zO(e)),{options:o}=We(_S),r=I(()=>({[jO(e.activeClass,o.linkActiveClass,"router-link-active")]:n.isActive,[jO(e.exactActiveClass,o.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&t.default(n);return e.custom?i:ba("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),r1e=o1e;function i1e(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 l1e(e,t){for(const n in t){const o=t[n],r=e[n];if(typeof o=="string"){if(o!==r)return!1}else if(!Uo(r)||r.length!==o.length||o.some((i,l)=>i!==r[l]))return!1}return!0}function HO(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const jO=(e,t,n)=>e??t??n,a1e=re({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const o=We(l0),r=I(()=>e.route||o.value),i=We(LO,0),l=I(()=>{let c=kt(i);const{matched:u}=r.value;let d;for(;(d=u[c])&&!d.components;)c++;return c}),a=I(()=>r.value.matched[l.value]);Ge(LO,I(()=>l.value+1)),Ge(t1e,a),Ge(l0,r);const s=oe();return be(()=>[s.value,a.value,e.name],([c,u,d],[f,h,v])=>{u&&(u.instances[d]=c,h&&h!==u&&c&&c===f&&(u.leaveGuards.size||(u.leaveGuards=h.leaveGuards),u.updateGuards.size||(u.updateGuards=h.updateGuards))),c&&u&&(!h||!Aa(u,h)||!f)&&(u.enterCallbacks[d]||[]).forEach(g=>g(c))},{flush:"post"}),()=>{const c=r.value,u=e.name,d=a.value,f=d&&d.components[u];if(!f)return WO(n.default,{Component:f,route:c});const h=d.props[u],v=h?h===!0?c.params:typeof h=="function"?h(c):h:null,b=ba(f,Pt({},v,t,{onVnodeUnmounted:y=>{y.component.isUnmounted&&(d.instances[u]=null)},ref:s}));return WO(n.default,{Component:b,route:c})||b}}});function WO(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const s1e=a1e;function c1e(e){const t=Gye(e.routes,e),n=e.parseQuery||Jye,o=e.stringifyQuery||FO,r=e.history,i=ds(),l=ds(),a=ds(),s=ne(Qr);let c=Qr;Ul&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=av.bind(null,G=>""+G),d=av.bind(null,Sye),f=av.bind(null,Ic);function h(G,J){let Z,U;return w_(G)?(Z=t.getRecordMatcher(G),U=J):U=G,t.addRoute(U,Z)}function v(G){const J=t.getRecordMatcher(G);J&&t.removeRoute(J)}function g(){return t.getRoutes().map(G=>G.record)}function b(G){return!!t.getRecordMatcher(G)}function y(G,J){if(J=Pt({},J||s.value),typeof G=="string"){const te=sv(n,G,J.path),se=t.resolve({path:te.path},J),ie=r.createHref(te.fullPath);return Pt(te,se,{params:f(se.params),hash:Ic(te.hash),redirectedFrom:void 0,href:ie})}let Z;if(G.path!=null)Z=Pt({},G,{path:sv(n,G.path,J.path).path});else{const te=Pt({},G.params);for(const se in te)te[se]==null&&delete te[se];Z=Pt({},G,{params:d(te)}),J.params=d(J.params)}const U=t.resolve(Z,J),q=G.hash||"";U.params=u(f(U.params));const W=xye(o,Pt({},G,{hash:mye(q),path:U.path})),K=r.createHref(W);return Pt({fullPath:W,hash:q,query:o===FO?e1e(G.query):G.query||{}},U,{redirectedFrom:void 0,href:K})}function S(G){return typeof G=="string"?sv(n,G,s.value.path):Pt({},G)}function $(G,J){if(c!==G)return Ra(8,{from:J,to:G})}function x(G){return w(G)}function C(G){return x(Pt(S(G),{replace:!0}))}function O(G){const J=G.matched[G.matched.length-1];if(J&&J.redirect){const{redirect:Z}=J;let U=typeof Z=="function"?Z(G):Z;return typeof U=="string"&&(U=U.includes("?")||U.includes("#")?U=S(U):{path:U},U.params={}),Pt({query:G.query,hash:G.hash,params:U.path!=null?{}:G.params},U)}}function w(G,J){const Z=c=y(G),U=s.value,q=G.state,W=G.force,K=G.replace===!0,te=O(Z);if(te)return w(Pt(S(te),{state:typeof te=="object"?Pt({},q,te.state):q,force:W,replace:K}),J||Z);const se=Z;se.redirectedFrom=J;let ie;return!W&&wye(o,U,Z)&&(ie=Ra(16,{to:se,from:U}),H(U,U,!0,!1)),(ie?Promise.resolve(ie):_(se,U)).catch(de=>br(de)?br(de,2)?de:L(de):k(de,se,U)).then(de=>{if(de){if(br(de,2))return w(Pt({replace:K},S(de.to),{state:typeof de.to=="object"?Pt({},q,de.to.state):q,force:W}),J||se)}else de=R(se,U,!0,K,q);return M(se,U,de),de})}function P(G,J){const Z=$(G,J);return Z?Promise.reject(Z):Promise.resolve()}function T(G){const J=Q.values().next().value;return J&&typeof J.runWithContext=="function"?J.runWithContext(G):G()}function _(G,J){let Z;const[U,q,W]=u1e(G,J);Z=cv(U.reverse(),"beforeRouteLeave",G,J);for(const te of U)te.leaveGuards.forEach(se=>{Z.push(ri(se,G,J))});const K=P.bind(null,G,J);return Z.push(K),ee(Z).then(()=>{Z=[];for(const te of i.list())Z.push(ri(te,G,J));return Z.push(K),ee(Z)}).then(()=>{Z=cv(q,"beforeRouteUpdate",G,J);for(const te of q)te.updateGuards.forEach(se=>{Z.push(ri(se,G,J))});return Z.push(K),ee(Z)}).then(()=>{Z=[];for(const te of W)if(te.beforeEnter)if(Uo(te.beforeEnter))for(const se of te.beforeEnter)Z.push(ri(se,G,J));else Z.push(ri(te.beforeEnter,G,J));return Z.push(K),ee(Z)}).then(()=>(G.matched.forEach(te=>te.enterCallbacks={}),Z=cv(W,"beforeRouteEnter",G,J,T),Z.push(K),ee(Z))).then(()=>{Z=[];for(const te of l.list())Z.push(ri(te,G,J));return Z.push(K),ee(Z)}).catch(te=>br(te,8)?te:Promise.reject(te))}function M(G,J,Z){a.list().forEach(U=>T(()=>U(G,J,Z)))}function R(G,J,Z,U,q){const W=$(G,J);if(W)return W;const K=J===Qr,te=Ul?history.state:{};Z&&(U||K?r.replace(G.fullPath,Pt({scroll:K&&te&&te.scroll},q)):r.push(G.fullPath,q)),s.value=G,H(G,J,Z,K),L()}let A;function z(){A||(A=r.listen((G,J,Z)=>{if(!X.listening)return;const U=y(G),q=O(U);if(q){w(Pt(q,{replace:!0}),U).catch(Vs);return}c=U;const W=s.value;Ul&&Aye(MO(W.fullPath,Z.delta),xh()),_(U,W).catch(K=>br(K,12)?K:br(K,2)?(w(K.to,U).then(te=>{br(te,20)&&!Z.delta&&Z.type===Tc.pop&&r.go(-1,!1)}).catch(Vs),Promise.reject()):(Z.delta&&r.go(-Z.delta,!1),k(K,U,W))).then(K=>{K=K||R(U,W,!1),K&&(Z.delta&&!br(K,8)?r.go(-Z.delta,!1):Z.type===Tc.pop&&br(K,20)&&r.go(-1,!1)),M(U,W,K)}).catch(Vs)}))}let E=ds(),D=ds(),N;function k(G,J,Z){L(G);const U=D.list();return U.length?U.forEach(q=>q(G,J,Z)):console.error(G),Promise.reject(G)}function F(){return N&&s.value!==Qr?Promise.resolve():new Promise((G,J)=>{E.add([G,J])})}function L(G){return N||(N=!G,z(),E.list().forEach(([J,Z])=>G?Z(G):J()),E.reset()),G}function H(G,J,Z,U){const{scrollBehavior:q}=e;if(!Ul||!q)return Promise.resolve();const W=!Z&&Rye(MO(G.fullPath,0))||(U||!Z)&&history.state&&history.state.scroll||null;return ot().then(()=>q(G,J,W)).then(K=>K&&_ye(K)).catch(K=>k(K,G,J))}const j=G=>r.go(G);let Y;const Q=new Set,X={currentRoute:s,listening:!0,addRoute:h,removeRoute:v,clearRoutes:t.clearRoutes,hasRoute:b,getRoutes:g,resolve:y,options:e,push:x,replace:C,go:j,back:()=>j(-1),forward:()=>j(1),beforeEach:i.add,beforeResolve:l.add,afterEach:a.add,onError:D.add,isReady:F,install(G){const J=this;G.component("RouterLink",r1e),G.component("RouterView",s1e),G.config.globalProperties.$router=J,Object.defineProperty(G.config.globalProperties,"$route",{enumerable:!0,get:()=>kt(s)}),Ul&&!Y&&s.value===Qr&&(Y=!0,x(r.location).catch(q=>{}));const Z={};for(const q in Qr)Object.defineProperty(Z,q,{get:()=>s.value[q],enumerable:!0});G.provide(_S,J),G.provide(T_,c3(Z)),G.provide(l0,s);const U=G.unmount;Q.add(G),G.unmount=function(){Q.delete(G),Q.size<1&&(c=Qr,A&&A(),A=null,s.value=Qr,Y=!1,N=!1),U()}}};function ee(G){return G.reduce((J,Z)=>J.then(()=>T(Z)),Promise.resolve())}return X}function u1e(e,t){const n=[],o=[],r=[],i=Math.max(t.matched.length,e.matched.length);for(let l=0;l<i;l++){const a=t.matched[l];a&&(e.matched.find(c=>Aa(c,a))?o.push(a):n.push(a));const s=e.matched[l];s&&(t.matched.find(c=>Aa(c,s))||r.push(s))}return[n,o,r]}const d1e={class:"not-found-wrapper"},f1e=re({__name:"index",setup(e){const t=()=>{AS.replace("/")};return(n,o)=>{const r=tl("a-button"),i=tl("a-result");return Yi(),Gl("div",d1e,[p(i,{status:"404",title:"404","sub-title":"Sorry, the page you visited does not exist."},{extra:qs(()=>[p(r,{onClick:t,type:"primary"},{default:qs(()=>[vn("Back Home")]),_:1})]),_:1})])}}}),p1e=Ch(f1e,[["__scopeId","data-v-aef52a59"]]),h1e={class:"view-wrapper"},g1e={class:"content-wrapper"},v1e={style:{"margin-top":"10vh",padding:"32px"}},m1e={class:"chat-box-placeholder"},b1e=["data-seg-id"],y1e={class:"trans-src-lang"},S1e={class:"trans-dst-lang"},$1e={class:"trans-src-lang"},C1e={class:"trans-dst-lang"},x1e={class:"actions-box"},w1e="体验前请检查麦克风是否可用,指定音频语言、译文语言,点击开关按钮开始录音,即可实时获取识别及翻译的文字。",O1e=re({__name:"index",setup(e){const t=window.location.host;let n="ws";t.startsWith("127.0.0.1")||t.startsWith("localhost")?n="ws":n="wss";const o=`${n}://`+t+"/ws?";console.warn("ws_url: ",o),oe("");const r=oe(null),i=async A=>{console.warn("start websocket ..."),r.value&&r.value.readyState!==WebSocket.CLOSED&&r.value.close();const z=`${o}${A}`;r.value=new WebSocket(z),r.value.binaryType="arraybuffer",console.warn("created web socket ..."),r.value.addEventListener("open",()=>{console.log("WebSocket 连接成功"),h(),f.value=!0}),r.value.addEventListener("close",()=>{console.log("WebSocket 连接已关闭")}),r.value.onclose=E=>{console.log("code:",E.code,"reason:",E.reason,"wasClean:",E.wasClean),console.log("WebSocket 连接已关闭:",E)},r.value.addEventListener("error",E=>{console.error("WebSocket 连接错误:",E)}),r.value.addEventListener("message",E=>{const D=JSON.parse(E.data);console.log("WebSocket 收到消息:",D),D&&D.result&&P(D.result)})},l=async()=>{r.value&&(await r.value.close(),r.value=null)},a=oe(null),s=oe(null),c=oe(null),u=oe(null),d=oe(null),f=oe(!1),h=async()=>{try{const A=await navigator.mediaDevices.getUserMedia({audio:!0});a.value=A;const z=new AudioContext({sampleRate:16e3});c.value=z;const E=z.createMediaStreamSource(A);u.value=E;const D=z.createScriptProcessor(4096,1,1);d.value=D,E.connect(D),D.connect(z.destination),D.onaudioprocess=N=>{if(!f.value||!r.value||r.value.readyState!==WebSocket.OPEN)return;const k=N.inputBuffer.getChannelData(0),F=new Int16Array(k.length);for(let L=0;L<k.length;L++)F[L]=Math.max(-1,Math.min(1,k[L]))*32767;v(F)},f.value=!0,console.log("音频捕获已启动")}catch(A){console.error("音频捕获失败:",A)}},v=A=>{if(r.value)r.value.send(A),console.log("WebSocket send audio chunk success");else{console.error("WebSocket not initialized, sendAudioChunk failed");return}},g=async()=>{console.log("requirePermissionAction");try{if(!r.value||r.value.readyState!==WebSocket.OPEN){console.log("current lang_str : ",$.value);const A=$.value;T(),await i(A)}}catch(A){console.log("Error accessing microphone: ",A)}};je(()=>{console.log("[translator]: mounted")}),$n(()=>{console.log("[HomePage]: unmounted"),r.value&&r.value.close(),s.value&&b()});const b=()=>{f.value=!1,l(),console.log("音频捕获已停止"),d.value&&(d.value.disconnect(),d.value=null),u.value&&(u.value.disconnect(),u.value=null),a.value&&(a.value.getTracks().forEach(A=>A.stop()),a.value=null),c.value&&(c.value.close(),c.value=null),console.log("录音已停止")},y=async A=>{console.log(`selected ${A}`),f.value=!1,await b(),console.log("new lang_str: ",A),console.log("trans_lang : ",$.value)},S=A=>{f.value=A,A?g():b()},$=oe("from=en&to=zh"),x=[{value:"from=en&to=zh",label:"English -> Chinese"},{value:"from=zh&to=en",label:"Chinese -> English"}],C=oe(""),O=oe(""),w=oe(""),P=A=>{if(console.log("updateViewData: ",A),A){const{context:z,from:E,to:D,seg_id:N,partial:k,tranContent:F}=A;if(k==!0){C.value=z,O.value=F,w.value=N;return}else{const L={context:z,from:E,to:D,seg_id:N,partial:k,tranContent:F};_.length>100&&_.splice(0,40),_.push(L),C.value="",O.value="",w.value=""}}R()},T=()=>{_.splice(0,_.length)},_=ct([]),M=oe(null),R=()=>{ot(()=>{M.value&&(M.value.scrollTop=M.value.scrollHeight+144)})};return be(()=>[..._],()=>{R()},{deep:!0}),be(()=>O.value,()=>{R()}),(A,z)=>{const E=tl("a-select"),D=tl("a-switch"),N=tl("a-card");return Yi(),Gl("div",h1e,[Ro("div",g1e,[Ro("div",v1e,[p(N,{bordered:!1,style:{width:"100%","min-width":"100%"}},{actions:qs(()=>[Ro("div",x1e,[p(E,{value:$.value,"onUpdate:value":z[0]||(z[0]=k=>$.value=k),style:{width:"240px"},placeholder:"Select Language",options:x,onChange:y},null,8,["value"]),p(D,{key:"switcher",size:"large",type:"danger","checked-children":"ON","un-checked-children":"OFF",checked:f.value,"onUpdate:checked":z[1]||(z[1]=k=>f.value=k),onChange:S},null,8,["checked"])])]),default:qs(()=>[pn(Ro("div",m1e,es(w1e),512),[[yn,!(_.length||C.value)]]),pn(Ro("div",{class:"trans-list",ref_key:"transListRef",ref:M},[(Yi(!0),Gl(Ve,null,r7(_,k=>(Yi(),Gl("div",{key:k.context,class:jf(["node"]),"data-seg-id":k.seg_id},[Ro("div",y1e,es(k.context),1),Ro("div",S1e,es(k.tranContent),1)],8,b1e))),128)),(Yi(),Gl("div",{class:"node current_node",key:w.value},[Ro("div",$1e,es(C.value),1),Ro("div",C1e,es(O.value),1)]))],512),[[yn,_.length||C.value]])]),_:1})])])])}}}),P1e=Ch(O1e,[["__scopeId","data-v-f8c11346"]]),I1e=ES({id:"play_state",persist:!1,state:()=>{const e=kf();return console.log("configState",e.$state.role_name),{current_state:"init",video_url:"",urls:{waiting:e.$state.roles_resources[e.$state.role_name].waiting,listening:e.$state.roles_resources[e.$state.role_name].listening,thinking:e.$state.roles_resources[e.$state.role_name].thinking,talking:""}}},actions:{changeRole(e){this.$patch(t=>{const n=kf();t.urls.waiting=n.$state.roles_resources[n.$state.role_name].waiting,t.urls.listening=n.$state.roles_resources[n.$state.role_name].listening,t.urls.thinking=n.$state.roles_resources[n.$state.role_name].thinking})},changeState(e){if(["waiting","listening","thinking","talking","init"].indexOf(e)==-1){console.error("invalid state",e);return}this.$patch(t=>{t.video_url=t.urls[e],t.current_state=e})},changeTalkingVideoUrl(e){this.$patch(t=>{t.urls.talking=e})}}}),T1e={class:"content-wrapper"},E1e=re({__name:"index",setup(e){const t=kf();return I1e(),je(()=>{console.log("config",t.$state)}),oe(t.$state.file_type),oe(t.$state.role_name),(n,o)=>{const r=tl("a-result");return Yi(),Gl("div",T1e,[p(r,{style:{width:"100%"},title:"Settings"})])}}}),M1e=Ch(E1e,[["__scopeId","data-v-c39ab0d6"]]),_1e=[{name:"home",path:"/",component:P1e,meta:{requiresAgreement:!1}},{name:"settings",path:"/settings",component:M1e},{name:"404",path:"/404",component:p1e}],AS=c1e({history:kye("/app/"),routes:_1e});AS.beforeEach((e,t,n)=>{console.log("=============== router to : ",e),e.matched.length===0?n({name:"404"}):n()});const E_=Kbe();E_.use(oye);Q3(lye).use(E_).use(AS).use(s0e).mount("#app")});export default A1e();
 
492
  * vue-router v4.4.3
493
  * (c) 2024 Eduardo San Martin Morote
494
  * @license MIT
495
+ */const Ul=typeof document<"u";function aye(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const Pt=Object.assign;function av(e,t){const n={};for(const o in t){const r=t[o];n[o]=Uo(r)?r.map(e):e(r)}return n}const Vs=()=>{},Uo=Array.isArray,m_=/#/g,sye=/&/g,cye=/\//g,uye=/=/g,dye=/\?/g,b_=/\+/g,fye=/%5B/g,pye=/%5D/g,y_=/%5E/g,hye=/%60/g,S_=/%7B/g,gye=/%7C/g,$_=/%7D/g,vye=/%20/g;function MS(e){return encodeURI(""+e).replace(gye,"|").replace(fye,"[").replace(pye,"]")}function mye(e){return MS(e).replace(S_,"{").replace($_,"}").replace(y_,"^")}function r0(e){return MS(e).replace(b_,"%2B").replace(vye,"+").replace(m_,"%23").replace(sye,"%26").replace(hye,"`").replace(S_,"{").replace($_,"}").replace(y_,"^")}function bye(e){return r0(e).replace(uye,"%3D")}function yye(e){return MS(e).replace(m_,"%23").replace(dye,"%3F")}function Sye(e){return e==null?"":yye(e).replace(cye,"%2F")}function Ic(e){try{return decodeURIComponent(""+e)}catch{}return""+e}const $ye=/\/$/,Cye=e=>e.replace($ye,"");function sv(e,t,n="/"){let o,r={},i="",l="";const a=t.indexOf("#");let s=t.indexOf("?");return a<s&&a>=0&&(s=-1),s>-1&&(o=t.slice(0,s),i=t.slice(s+1,a>-1?a:t.length),r=e(i)),a>-1&&(o=o||t.slice(0,a),l=t.slice(a,t.length)),o=Pye(o??t,n),{fullPath:o+(i&&"?")+i+l,path:o,query:r,hash:Ic(l)}}function xye(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function TO(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function wye(e,t,n){const o=t.matched.length-1,r=n.matched.length-1;return o>-1&&o===r&&Aa(t.matched[o],n.matched[r])&&C_(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Aa(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function C_(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!Oye(e[n],t[n]))return!1;return!0}function Oye(e,t){return Uo(e)?EO(e,t):Uo(t)?EO(t,e):e===t}function EO(e,t){return Uo(t)?e.length===t.length&&e.every((n,o)=>n===t[o]):e.length===1&&e[0]===t}function Pye(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),o=e.split("/"),r=o[o.length-1];(r===".."||r===".")&&o.push("");let i=n.length-1,l,a;for(l=0;l<o.length;l++)if(a=o[l],a!==".")if(a==="..")i>1&&i--;else break;return n.slice(0,i).join("/")+"/"+o.slice(l).join("/")}const Qr={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Tc;(function(e){e.pop="pop",e.push="push"})(Tc||(Tc={}));var Ks;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Ks||(Ks={}));function Iye(e){if(!e)if(Ul){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Cye(e)}const Tye=/^[^#]+#/;function Eye(e,t){return e.replace(Tye,"#")+t}function Mye(e,t){const n=document.documentElement.getBoundingClientRect(),o=e.getBoundingClientRect();return{behavior:t.behavior,left:o.left-n.left-(t.left||0),top:o.top-n.top-(t.top||0)}}const xh=()=>({left:window.scrollX,top:window.scrollY});function _ye(e){let t;if("el"in e){const n=e.el,o=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?o?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=Mye(r,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 MO(e,t){return(history.state?history.state.position-t:-1)+e}const i0=new Map;function Aye(e,t){i0.set(e,t)}function Rye(e){const t=i0.get(e);return i0.delete(e),t}let Dye=()=>location.protocol+"//"+location.host;function x_(e,t){const{pathname:n,search:o,hash:r}=t,i=e.indexOf("#");if(i>-1){let a=r.includes(e.slice(i))?e.slice(i).length:1,s=r.slice(a);return s[0]!=="/"&&(s="/"+s),TO(s,"")}return TO(n,e)+o+r}function Bye(e,t,n,o){let r=[],i=[],l=null;const a=({state:f})=>{const h=x_(e,location),v=n.value,g=t.value;let b=0;if(f){if(n.value=h,t.value=f,l&&l===v){l=null;return}b=g?f.position-g.position:0}else o(h);r.forEach(y=>{y(n.value,v,{delta:b,type:Tc.pop,direction:b?b>0?Ks.forward:Ks.back:Ks.unknown})})};function s(){l=n.value}function c(f){r.push(f);const h=()=>{const v=r.indexOf(f);v>-1&&r.splice(v,1)};return i.push(h),h}function u(){const{history:f}=window;f.state&&f.replaceState(Pt({},f.state,{scroll:xh()}),"")}function d(){for(const f of i)f();i=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",u,{passive:!0}),{pauseListeners:s,listen:c,destroy:d}}function _O(e,t,n,o=!1,r=!1){return{back:e,current:t,forward:n,replaced:o,position:window.history.length,scroll:r?xh():null}}function Nye(e){const{history:t,location:n}=window,o={value:x_(e,n)},r={value:t.state};r.value||i(o.value,{back:null,current:o.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(s,c,u){const d=e.indexOf("#"),f=d>-1?(n.host&&document.querySelector("base")?e:e.slice(d))+s:Dye()+e+s;try{t[u?"replaceState":"pushState"](c,"",f),r.value=c}catch(h){console.error(h),n[u?"replace":"assign"](f)}}function l(s,c){const u=Pt({},t.state,_O(r.value.back,s,r.value.forward,!0),c,{position:r.value.position});i(s,u,!0),o.value=s}function a(s,c){const u=Pt({},r.value,t.state,{forward:s,scroll:xh()});i(u.current,u,!0);const d=Pt({},_O(o.value,s,null),{position:u.position+1},c);i(s,d,!1),o.value=s}return{location:o,state:r,push:a,replace:l}}function kye(e){e=Iye(e);const t=Nye(e),n=Bye(e,t.state,t.location,t.replace);function o(i,l=!0){l||n.pauseListeners(),history.go(i)}const r=Pt({location:"",base:e,go:o,createHref:Eye.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}function Fye(e){return typeof e=="string"||e&&typeof e=="object"}function w_(e){return typeof e=="string"||typeof e=="symbol"}const O_=Symbol("");var AO;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(AO||(AO={}));function Ra(e,t){return Pt(new Error,{type:e,[O_]:!0},t)}function br(e,t){return e instanceof Error&&O_ in e&&(t==null||!!(e.type&t))}const RO="[^/]+?",Lye={sensitive:!1,strict:!1,start:!0,end:!0},zye=/[.+*?^${}()[\]/\\]/g;function Hye(e,t){const n=Pt({},Lye,t),o=[];let r=n.start?"^":"";const i=[];for(const c of e){const u=c.length?[]:[90];n.strict&&!c.length&&(r+="/");for(let d=0;d<c.length;d++){const f=c[d];let h=40+(n.sensitive?.25:0);if(f.type===0)d||(r+="/"),r+=f.value.replace(zye,"\\$&"),h+=40;else if(f.type===1){const{value:v,repeatable:g,optional:b,regexp:y}=f;i.push({name:v,repeatable:g,optional:b});const S=y||RO;if(S!==RO){h+=10;try{new RegExp(`(${S})`)}catch(x){throw new Error(`Invalid custom RegExp for param "${v}" (${S}): `+x.message)}}let $=g?`((?:${S})(?:/(?:${S}))*)`:`(${S})`;d||($=b&&c.length<2?`(?:/${$})`:"/"+$),b&&($+="?"),r+=$,h+=20,b&&(h+=-8),g&&(h+=-20),S===".*"&&(h+=-50)}u.push(h)}o.push(u)}if(n.strict&&n.end){const c=o.length-1;o[c][o[c].length-1]+=.7000000000000001}n.strict||(r+="/?"),n.end?r+="$":n.strict&&(r+="(?:/|$)");const l=new RegExp(r,n.sensitive?"":"i");function a(c){const u=c.match(l),d={};if(!u)return null;for(let f=1;f<u.length;f++){const h=u[f]||"",v=i[f-1];d[v.name]=h&&v.repeatable?h.split("/"):h}return d}function s(c){let u="",d=!1;for(const f of e){(!d||!u.endsWith("/"))&&(u+="/"),d=!1;for(const h of f)if(h.type===0)u+=h.value;else if(h.type===1){const{value:v,repeatable:g,optional:b}=h,y=v in c?c[v]:"";if(Uo(y)&&!g)throw new Error(`Provided param "${v}" is an array but it is not repeatable (* or + modifiers)`);const S=Uo(y)?y.join("/"):y;if(!S)if(b)f.length<2&&(u.endsWith("/")?u=u.slice(0,-1):d=!0);else throw new Error(`Missing required param "${v}"`);u+=S}}return u||"/"}return{re:l,score:o,keys:i,parse:a,stringify:s}}function jye(e,t){let n=0;for(;n<e.length&&n<t.length;){const o=t[n]-e[n];if(o)return o;n++}return e.length<t.length?e.length===1&&e[0]===40+40?-1:1:e.length>t.length?t.length===1&&t[0]===40+40?1:-1:0}function P_(e,t){let n=0;const o=e.score,r=t.score;for(;n<o.length&&n<r.length;){const i=jye(o[n],r[n]);if(i)return i;n++}if(Math.abs(r.length-o.length)===1){if(DO(o))return 1;if(DO(r))return-1}return r.length-o.length}function DO(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Wye={type:0,value:""},Vye=/[a-zA-Z0-9_]/;function Kye(e){if(!e)return[[]];if(e==="/")return[[Wye]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(h){throw new Error(`ERR (${n})/"${c}": ${h}`)}let n=0,o=n;const r=[];let i;function l(){i&&r.push(i),i=[]}let a=0,s,c="",u="";function d(){c&&(n===0?i.push({type:0,value:c}):n===1||n===2||n===3?(i.length>1&&(s==="*"||s==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),i.push({type:1,value:c,regexp:u,repeatable:s==="*"||s==="+",optional:s==="*"||s==="?"})):t("Invalid state to consume buffer"),c="")}function f(){c+=s}for(;a<e.length;){if(s=e[a++],s==="\\"&&n!==2){o=n,n=4;continue}switch(n){case 0:s==="/"?(c&&d(),l()):s===":"?(d(),n=1):f();break;case 4:f(),n=o;break;case 1:s==="("?n=2:Vye.test(s)?f():(d(),n=0,s!=="*"&&s!=="?"&&s!=="+"&&a--);break;case 2:s===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+s:n=3:u+=s;break;case 3:d(),n=0,s!=="*"&&s!=="?"&&s!=="+"&&a--,u="";break;default:t("Unknown state");break}}return n===2&&t(`Unfinished custom RegExp for param "${c}"`),d(),l(),r}function Uye(e,t,n){const o=Hye(Kye(e.path),n),r=Pt(o,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function Gye(e,t){const n=[],o=new Map;t=kO({strict:!1,end:!0,sensitive:!1},t);function r(d){return o.get(d)}function i(d,f,h){const v=!h,g=Xye(d);g.aliasOf=h&&h.record;const b=kO(t,d),y=[g];if("alias"in d){const x=typeof d.alias=="string"?[d.alias]:d.alias;for(const C of x)y.push(Pt({},g,{components:h?h.record.components:g.components,path:C,aliasOf:h?h.record:g}))}let S,$;for(const x of y){const{path:C}=x;if(f&&C[0]!=="/"){const O=f.record.path,w=O[O.length-1]==="/"?"":"/";x.path=f.record.path+(C&&w+C)}if(S=Uye(x,f,b),h?h.alias.push(S):($=$||S,$!==S&&$.alias.push(S),v&&d.name&&!NO(S)&&l(d.name)),I_(S)&&s(S),g.children){const O=g.children;for(let w=0;w<O.length;w++)i(O[w],S,h&&h.children[w])}h=h||S}return $?()=>{l($)}:Vs}function l(d){if(w_(d)){const f=o.get(d);f&&(o.delete(d),n.splice(n.indexOf(f),1),f.children.forEach(l),f.alias.forEach(l))}else{const f=n.indexOf(d);f>-1&&(n.splice(f,1),d.record.name&&o.delete(d.record.name),d.children.forEach(l),d.alias.forEach(l))}}function a(){return n}function s(d){const f=Zye(d,n);n.splice(f,0,d),d.record.name&&!NO(d)&&o.set(d.record.name,d)}function c(d,f){let h,v={},g,b;if("name"in d&&d.name){if(h=o.get(d.name),!h)throw Ra(1,{location:d});b=h.record.name,v=Pt(BO(f.params,h.keys.filter($=>!$.optional).concat(h.parent?h.parent.keys.filter($=>$.optional):[]).map($=>$.name)),d.params&&BO(d.params,h.keys.map($=>$.name))),g=h.stringify(v)}else if(d.path!=null)g=d.path,h=n.find($=>$.re.test(g)),h&&(v=h.parse(g),b=h.record.name);else{if(h=f.name?o.get(f.name):n.find($=>$.re.test(f.path)),!h)throw Ra(1,{location:d,currentLocation:f});b=h.record.name,v=Pt({},f.params,d.params),g=h.stringify(v)}const y=[];let S=h;for(;S;)y.unshift(S.record),S=S.parent;return{name:b,path:g,params:v,matched:y,meta:qye(y)}}e.forEach(d=>i(d));function u(){n.length=0,o.clear()}return{addRoute:i,resolve:c,removeRoute:l,clearRoutes:u,getRoutes:a,getRecordMatcher:r}}function BO(e,t){const n={};for(const o of t)o in e&&(n[o]=e[o]);return n}function Xye(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:Yye(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function Yye(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const o in e.components)t[o]=typeof n=="object"?n[o]:n;return t}function NO(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function qye(e){return e.reduce((t,n)=>Pt(t,n.meta),{})}function kO(e,t){const n={};for(const o in e)n[o]=o in t?t[o]:e[o];return n}function Zye(e,t){let n=0,o=t.length;for(;n!==o;){const i=n+o>>1;P_(e,t[i])<0?o=i:n=i+1}const r=Qye(e);return r&&(o=t.lastIndexOf(r,o-1)),o}function Qye(e){let t=e;for(;t=t.parent;)if(I_(t)&&P_(e,t)===0)return t}function I_({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Jye(e){const t={};if(e===""||e==="?")return t;const o=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<o.length;++r){const i=o[r].replace(b_," "),l=i.indexOf("="),a=Ic(l<0?i:i.slice(0,l)),s=l<0?null:Ic(i.slice(l+1));if(a in t){let c=t[a];Uo(c)||(c=t[a]=[c]),c.push(s)}else t[a]=s}return t}function FO(e){let t="";for(let n in e){const o=e[n];if(n=bye(n),o==null){o!==void 0&&(t+=(t.length?"&":"")+n);continue}(Uo(o)?o.map(i=>i&&r0(i)):[o&&r0(o)]).forEach(i=>{i!==void 0&&(t+=(t.length?"&":"")+n,i!=null&&(t+="="+i))})}return t}function e1e(e){const t={};for(const n in e){const o=e[n];o!==void 0&&(t[n]=Uo(o)?o.map(r=>r==null?null:""+r):o==null?o:""+o)}return t}const t1e=Symbol(""),LO=Symbol(""),_S=Symbol(""),T_=Symbol(""),l0=Symbol("");function ds(){let e=[];function t(o){return e.push(o),()=>{const r=e.indexOf(o);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function ri(e,t,n,o,r,i=l=>l()){const l=o&&(o.enterCallbacks[r]=o.enterCallbacks[r]||[]);return()=>new Promise((a,s)=>{const c=f=>{f===!1?s(Ra(4,{from:n,to:t})):f instanceof Error?s(f):Fye(f)?s(Ra(2,{from:t,to:f})):(l&&o.enterCallbacks[r]===l&&typeof f=="function"&&l.push(f),a())},u=i(()=>e.call(o&&o.instances[r],t,n,c));let d=Promise.resolve(u);e.length<3&&(d=d.then(c)),d.catch(f=>s(f))})}function cv(e,t,n,o,r=i=>i()){const i=[];for(const l of e)for(const a in l.components){let s=l.components[a];if(!(t!=="beforeRouteEnter"&&!l.instances[a]))if(n1e(s)){const u=(s.__vccOpts||s)[t];u&&i.push(ri(u,n,o,l,a,r))}else{let c=s();i.push(()=>c.then(u=>{if(!u)return Promise.reject(new Error(`Couldn't resolve component "${a}" at "${l.path}"`));const d=aye(u)?u.default:u;l.components[a]=d;const h=(d.__vccOpts||d)[t];return h&&ri(h,n,o,l,a,r)()}))}}return i}function n1e(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function zO(e){const t=We(_S),n=We(T_),o=I(()=>{const s=kt(e.to);return t.resolve(s)}),r=I(()=>{const{matched:s}=o.value,{length:c}=s,u=s[c-1],d=n.matched;if(!u||!d.length)return-1;const f=d.findIndex(Aa.bind(null,u));if(f>-1)return f;const h=HO(s[c-2]);return c>1&&HO(u)===h&&d[d.length-1].path!==h?d.findIndex(Aa.bind(null,s[c-2])):f}),i=I(()=>r.value>-1&&l1e(n.params,o.value.params)),l=I(()=>r.value>-1&&r.value===n.matched.length-1&&C_(n.params,o.value.params));function a(s={}){return i1e(s)?t[kt(e.replace)?"replace":"push"](kt(e.to)).catch(Vs):Promise.resolve()}return{route:o,href:I(()=>o.value.href),isActive:i,isExactActive:l,navigate:a}}const o1e=re({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"}},useLink:zO,setup(e,{slots:t}){const n=ct(zO(e)),{options:o}=We(_S),r=I(()=>({[jO(e.activeClass,o.linkActiveClass,"router-link-active")]:n.isActive,[jO(e.exactActiveClass,o.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&t.default(n);return e.custom?i:ba("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),r1e=o1e;function i1e(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 l1e(e,t){for(const n in t){const o=t[n],r=e[n];if(typeof o=="string"){if(o!==r)return!1}else if(!Uo(r)||r.length!==o.length||o.some((i,l)=>i!==r[l]))return!1}return!0}function HO(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const jO=(e,t,n)=>e??t??n,a1e=re({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const o=We(l0),r=I(()=>e.route||o.value),i=We(LO,0),l=I(()=>{let c=kt(i);const{matched:u}=r.value;let d;for(;(d=u[c])&&!d.components;)c++;return c}),a=I(()=>r.value.matched[l.value]);Ge(LO,I(()=>l.value+1)),Ge(t1e,a),Ge(l0,r);const s=oe();return be(()=>[s.value,a.value,e.name],([c,u,d],[f,h,v])=>{u&&(u.instances[d]=c,h&&h!==u&&c&&c===f&&(u.leaveGuards.size||(u.leaveGuards=h.leaveGuards),u.updateGuards.size||(u.updateGuards=h.updateGuards))),c&&u&&(!h||!Aa(u,h)||!f)&&(u.enterCallbacks[d]||[]).forEach(g=>g(c))},{flush:"post"}),()=>{const c=r.value,u=e.name,d=a.value,f=d&&d.components[u];if(!f)return WO(n.default,{Component:f,route:c});const h=d.props[u],v=h?h===!0?c.params:typeof h=="function"?h(c):h:null,b=ba(f,Pt({},v,t,{onVnodeUnmounted:y=>{y.component.isUnmounted&&(d.instances[u]=null)},ref:s}));return WO(n.default,{Component:b,route:c})||b}}});function WO(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const s1e=a1e;function c1e(e){const t=Gye(e.routes,e),n=e.parseQuery||Jye,o=e.stringifyQuery||FO,r=e.history,i=ds(),l=ds(),a=ds(),s=ne(Qr);let c=Qr;Ul&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=av.bind(null,G=>""+G),d=av.bind(null,Sye),f=av.bind(null,Ic);function h(G,J){let Z,U;return w_(G)?(Z=t.getRecordMatcher(G),U=J):U=G,t.addRoute(U,Z)}function v(G){const J=t.getRecordMatcher(G);J&&t.removeRoute(J)}function g(){return t.getRoutes().map(G=>G.record)}function b(G){return!!t.getRecordMatcher(G)}function y(G,J){if(J=Pt({},J||s.value),typeof G=="string"){const te=sv(n,G,J.path),se=t.resolve({path:te.path},J),ie=r.createHref(te.fullPath);return Pt(te,se,{params:f(se.params),hash:Ic(te.hash),redirectedFrom:void 0,href:ie})}let Z;if(G.path!=null)Z=Pt({},G,{path:sv(n,G.path,J.path).path});else{const te=Pt({},G.params);for(const se in te)te[se]==null&&delete te[se];Z=Pt({},G,{params:d(te)}),J.params=d(J.params)}const U=t.resolve(Z,J),q=G.hash||"";U.params=u(f(U.params));const W=xye(o,Pt({},G,{hash:mye(q),path:U.path})),K=r.createHref(W);return Pt({fullPath:W,hash:q,query:o===FO?e1e(G.query):G.query||{}},U,{redirectedFrom:void 0,href:K})}function S(G){return typeof G=="string"?sv(n,G,s.value.path):Pt({},G)}function $(G,J){if(c!==G)return Ra(8,{from:J,to:G})}function x(G){return w(G)}function C(G){return x(Pt(S(G),{replace:!0}))}function O(G){const J=G.matched[G.matched.length-1];if(J&&J.redirect){const{redirect:Z}=J;let U=typeof Z=="function"?Z(G):Z;return typeof U=="string"&&(U=U.includes("?")||U.includes("#")?U=S(U):{path:U},U.params={}),Pt({query:G.query,hash:G.hash,params:U.path!=null?{}:G.params},U)}}function w(G,J){const Z=c=y(G),U=s.value,q=G.state,W=G.force,K=G.replace===!0,te=O(Z);if(te)return w(Pt(S(te),{state:typeof te=="object"?Pt({},q,te.state):q,force:W,replace:K}),J||Z);const se=Z;se.redirectedFrom=J;let ie;return!W&&wye(o,U,Z)&&(ie=Ra(16,{to:se,from:U}),H(U,U,!0,!1)),(ie?Promise.resolve(ie):_(se,U)).catch(de=>br(de)?br(de,2)?de:L(de):k(de,se,U)).then(de=>{if(de){if(br(de,2))return w(Pt({replace:K},S(de.to),{state:typeof de.to=="object"?Pt({},q,de.to.state):q,force:W}),J||se)}else de=R(se,U,!0,K,q);return M(se,U,de),de})}function P(G,J){const Z=$(G,J);return Z?Promise.reject(Z):Promise.resolve()}function T(G){const J=Q.values().next().value;return J&&typeof J.runWithContext=="function"?J.runWithContext(G):G()}function _(G,J){let Z;const[U,q,W]=u1e(G,J);Z=cv(U.reverse(),"beforeRouteLeave",G,J);for(const te of U)te.leaveGuards.forEach(se=>{Z.push(ri(se,G,J))});const K=P.bind(null,G,J);return Z.push(K),ee(Z).then(()=>{Z=[];for(const te of i.list())Z.push(ri(te,G,J));return Z.push(K),ee(Z)}).then(()=>{Z=cv(q,"beforeRouteUpdate",G,J);for(const te of q)te.updateGuards.forEach(se=>{Z.push(ri(se,G,J))});return Z.push(K),ee(Z)}).then(()=>{Z=[];for(const te of W)if(te.beforeEnter)if(Uo(te.beforeEnter))for(const se of te.beforeEnter)Z.push(ri(se,G,J));else Z.push(ri(te.beforeEnter,G,J));return Z.push(K),ee(Z)}).then(()=>(G.matched.forEach(te=>te.enterCallbacks={}),Z=cv(W,"beforeRouteEnter",G,J,T),Z.push(K),ee(Z))).then(()=>{Z=[];for(const te of l.list())Z.push(ri(te,G,J));return Z.push(K),ee(Z)}).catch(te=>br(te,8)?te:Promise.reject(te))}function M(G,J,Z){a.list().forEach(U=>T(()=>U(G,J,Z)))}function R(G,J,Z,U,q){const W=$(G,J);if(W)return W;const K=J===Qr,te=Ul?history.state:{};Z&&(U||K?r.replace(G.fullPath,Pt({scroll:K&&te&&te.scroll},q)):r.push(G.fullPath,q)),s.value=G,H(G,J,Z,K),L()}let A;function z(){A||(A=r.listen((G,J,Z)=>{if(!X.listening)return;const U=y(G),q=O(U);if(q){w(Pt(q,{replace:!0}),U).catch(Vs);return}c=U;const W=s.value;Ul&&Aye(MO(W.fullPath,Z.delta),xh()),_(U,W).catch(K=>br(K,12)?K:br(K,2)?(w(K.to,U).then(te=>{br(te,20)&&!Z.delta&&Z.type===Tc.pop&&r.go(-1,!1)}).catch(Vs),Promise.reject()):(Z.delta&&r.go(-Z.delta,!1),k(K,U,W))).then(K=>{K=K||R(U,W,!1),K&&(Z.delta&&!br(K,8)?r.go(-Z.delta,!1):Z.type===Tc.pop&&br(K,20)&&r.go(-1,!1)),M(U,W,K)}).catch(Vs)}))}let E=ds(),D=ds(),N;function k(G,J,Z){L(G);const U=D.list();return U.length?U.forEach(q=>q(G,J,Z)):console.error(G),Promise.reject(G)}function F(){return N&&s.value!==Qr?Promise.resolve():new Promise((G,J)=>{E.add([G,J])})}function L(G){return N||(N=!G,z(),E.list().forEach(([J,Z])=>G?Z(G):J()),E.reset()),G}function H(G,J,Z,U){const{scrollBehavior:q}=e;if(!Ul||!q)return Promise.resolve();const W=!Z&&Rye(MO(G.fullPath,0))||(U||!Z)&&history.state&&history.state.scroll||null;return ot().then(()=>q(G,J,W)).then(K=>K&&_ye(K)).catch(K=>k(K,G,J))}const j=G=>r.go(G);let Y;const Q=new Set,X={currentRoute:s,listening:!0,addRoute:h,removeRoute:v,clearRoutes:t.clearRoutes,hasRoute:b,getRoutes:g,resolve:y,options:e,push:x,replace:C,go:j,back:()=>j(-1),forward:()=>j(1),beforeEach:i.add,beforeResolve:l.add,afterEach:a.add,onError:D.add,isReady:F,install(G){const J=this;G.component("RouterLink",r1e),G.component("RouterView",s1e),G.config.globalProperties.$router=J,Object.defineProperty(G.config.globalProperties,"$route",{enumerable:!0,get:()=>kt(s)}),Ul&&!Y&&s.value===Qr&&(Y=!0,x(r.location).catch(q=>{}));const Z={};for(const q in Qr)Object.defineProperty(Z,q,{get:()=>s.value[q],enumerable:!0});G.provide(_S,J),G.provide(T_,c3(Z)),G.provide(l0,s);const U=G.unmount;Q.add(G),G.unmount=function(){Q.delete(G),Q.size<1&&(c=Qr,A&&A(),A=null,s.value=Qr,Y=!1,N=!1),U()}}};function ee(G){return G.reduce((J,Z)=>J.then(()=>T(Z)),Promise.resolve())}return X}function u1e(e,t){const n=[],o=[],r=[],i=Math.max(t.matched.length,e.matched.length);for(let l=0;l<i;l++){const a=t.matched[l];a&&(e.matched.find(c=>Aa(c,a))?o.push(a):n.push(a));const s=e.matched[l];s&&(t.matched.find(c=>Aa(c,s))||r.push(s))}return[n,o,r]}const d1e={class:"not-found-wrapper"},f1e=re({__name:"index",setup(e){const t=()=>{AS.replace("/")};return(n,o)=>{const r=tl("a-button"),i=tl("a-result");return Yi(),Gl("div",d1e,[p(i,{status:"404",title:"404","sub-title":"Sorry, the page you visited does not exist."},{extra:qs(()=>[p(r,{onClick:t,type:"primary"},{default:qs(()=>[vn("Back Home")]),_:1})]),_:1})])}}}),p1e=Ch(f1e,[["__scopeId","data-v-aef52a59"]]),h1e={class:"view-wrapper"},g1e={class:"content-wrapper"},v1e={style:{"margin-top":"10vh",padding:"32px"}},m1e={class:"chat-box-placeholder"},b1e=["data-seg-id"],y1e={class:"trans-src-lang"},S1e={class:"trans-dst-lang"},$1e={class:"trans-src-lang"},C1e={class:"trans-dst-lang"},x1e={class:"actions-box"},w1e="体验前请检查麦克风是否可用,指定音频语言、译文语言,点击开关按钮开始录音,即可实时获取识别及翻译的文字。",O1e=re({__name:"index",setup(e){const t=window.location.host;let n="ws";t.startsWith("127.0.0.1")||t.startsWith("localhost")?n="ws":n="wss";const o=`${n}://`+t+"/ws?";console.warn("ws_url: ",o),oe("");const r=oe(null),i=async A=>{console.warn("start websocket ..."),r.value&&r.value.readyState!==WebSocket.CLOSED&&r.value.close();const z=`${o}${A}`;r.value=new WebSocket(z),r.value.binaryType="arraybuffer",console.warn("created web socket ..."),r.value.addEventListener("open",()=>{console.log("WebSocket 连接成功"),h(),f.value=!0}),r.value.addEventListener("close",()=>{console.log("WebSocket 连接已关闭")}),r.value.onclose=E=>{console.log("code:",E.code,"reason:",E.reason,"wasClean:",E.wasClean),console.log("WebSocket 连接已关闭:",E)},r.value.addEventListener("error",E=>{console.error("WebSocket 连接错误:",E)}),r.value.addEventListener("message",E=>{const D=JSON.parse(E.data);console.log("WebSocket 收到消息:",D),D&&D.result&&P(D.result)})},l=async()=>{r.value&&(await r.value.close(),r.value=null)},a=oe(null),s=oe(null),c=oe(null),u=oe(null),d=oe(null),f=oe(!1),h=async()=>{try{const A=await navigator.mediaDevices.getUserMedia({audio:!0});a.value=A;const z=new AudioContext({sampleRate:16e3});c.value=z;const E=z.createMediaStreamSource(A);u.value=E;const D=z.createScriptProcessor(4096,1,1);d.value=D,E.connect(D),D.connect(z.destination),D.onaudioprocess=N=>{if(!f.value||!r.value||r.value.readyState!==WebSocket.OPEN)return;const k=N.inputBuffer.getChannelData(0),F=new Int16Array(k.length);for(let L=0;L<k.length;L++)F[L]=Math.max(-1,Math.min(1,k[L]))*32767;v(F)},f.value=!0,console.log("音频捕获已启动")}catch(A){console.error("音频捕获失败:",A)}},v=A=>{if(r.value)r.value.send(A),console.log("WebSocket send audio chunk success");else{console.error("WebSocket not initialized, sendAudioChunk failed");return}},g=async()=>{console.log("requirePermissionAction");try{if(!r.value||r.value.readyState!==WebSocket.OPEN){console.log("current lang_str : ",$.value);const A=$.value;T(),await i(A)}}catch(A){console.log("Error accessing microphone: ",A)}};je(()=>{console.log("[translator]: mounted")}),$n(()=>{console.log("[HomePage]: unmounted"),r.value&&r.value.close(),s.value&&b()});const b=()=>{f.value=!1,l(),console.log("音频捕获已停止"),d.value&&(d.value.disconnect(),d.value=null),u.value&&(u.value.disconnect(),u.value=null),a.value&&(a.value.getTracks().forEach(A=>A.stop()),a.value=null),c.value&&(c.value.close(),c.value=null),console.log("录音已停止")},y=async A=>{console.log(`selected ${A}`),f.value=!1,await b(),console.log("new lang_str: ",A),console.log("trans_lang : ",$.value)},S=A=>{f.value=A,A?g():b()},$=oe("from=en&to=zh"),x=[{value:"from=en&to=zh",label:"English -> Chinese"},{value:"from=zh&to=en",label:"Chinese -> English"}],C=oe(""),O=oe(""),w=oe(""),P=A=>{if(console.log("updateViewData: ",A),A){const{context:z,from:E,to:D,seg_id:N,partial:k,tranContent:F}=A;if(k==!0){C.value=z,O.value=F,w.value=N;return}else{const L={context:z,from:E,to:D,seg_id:N,partial:k,tranContent:F};_.length>100&&_.splice(0,40),_.push(L),C.value="",O.value="",w.value=""}}R()},T=()=>{_.splice(0,_.length)},_=ct([]),M=oe(null),R=()=>{ot(()=>{M.value&&(M.value.scrollTop=M.value.scrollHeight+144)})};return be(()=>[..._],()=>{R()},{deep:!0}),be(()=>O.value,()=>{R()}),(A,z)=>{const E=tl("a-select"),D=tl("a-switch"),N=tl("a-card");return Yi(),Gl("div",h1e,[Ro("div",g1e,[Ro("div",v1e,[p(N,{bordered:!1,style:{width:"100%","min-width":"100%"}},{actions:qs(()=>[Ro("div",x1e,[p(E,{value:$.value,"onUpdate:value":z[0]||(z[0]=k=>$.value=k),style:{width:"240px"},placeholder:"Select Language",options:x,onChange:y},null,8,["value"]),p(D,{key:"switcher",size:"large",type:"danger","checked-children":"ON","un-checked-children":"OFF",checked:f.value,"onUpdate:checked":z[1]||(z[1]=k=>f.value=k),onChange:S},null,8,["checked"])])]),default:qs(()=>[pn(Ro("div",m1e,es(w1e),512),[[yn,!(_.length||C.value)]]),pn(Ro("div",{class:"trans-list",ref_key:"transListRef",ref:M},[(Yi(!0),Gl(Ve,null,r7(_,k=>(Yi(),Gl("div",{key:k.context,class:jf(["node"]),"data-seg-id":k.seg_id},[Ro("div",y1e,es(k.context),1),Ro("div",S1e,es(k.tranContent),1)],8,b1e))),128)),(Yi(),Gl("div",{class:"node current_node",key:w.value},[Ro("div",$1e,es(C.value),1),Ro("div",C1e,es(O.value),1)]))],512),[[yn,_.length||C.value]])]),_:1})])])])}}}),P1e=Ch(O1e,[["__scopeId","data-v-878f2058"]]),I1e=ES({id:"play_state",persist:!1,state:()=>{const e=kf();return console.log("configState",e.$state.role_name),{current_state:"init",video_url:"",urls:{waiting:e.$state.roles_resources[e.$state.role_name].waiting,listening:e.$state.roles_resources[e.$state.role_name].listening,thinking:e.$state.roles_resources[e.$state.role_name].thinking,talking:""}}},actions:{changeRole(e){this.$patch(t=>{const n=kf();t.urls.waiting=n.$state.roles_resources[n.$state.role_name].waiting,t.urls.listening=n.$state.roles_resources[n.$state.role_name].listening,t.urls.thinking=n.$state.roles_resources[n.$state.role_name].thinking})},changeState(e){if(["waiting","listening","thinking","talking","init"].indexOf(e)==-1){console.error("invalid state",e);return}this.$patch(t=>{t.video_url=t.urls[e],t.current_state=e})},changeTalkingVideoUrl(e){this.$patch(t=>{t.urls.talking=e})}}}),T1e={class:"content-wrapper"},E1e=re({__name:"index",setup(e){const t=kf();return I1e(),je(()=>{console.log("config",t.$state)}),oe(t.$state.file_type),oe(t.$state.role_name),(n,o)=>{const r=tl("a-result");return Yi(),Gl("div",T1e,[p(r,{style:{width:"100%"},title:"Settings"})])}}}),M1e=Ch(E1e,[["__scopeId","data-v-c39ab0d6"]]),_1e=[{name:"home",path:"/",component:P1e,meta:{requiresAgreement:!1}},{name:"settings",path:"/settings",component:M1e},{name:"404",path:"/404",component:p1e}],AS=c1e({history:kye("/app/"),routes:_1e});AS.beforeEach((e,t,n)=>{console.log("=============== router to : ",e),e.matched.length===0?n({name:"404"}):n()});const E_=Kbe();E_.use(oye);Q3(lye).use(E_).use(AS).use(s0e).mount("#app")});export default A1e();
frontend/index.html CHANGED
@@ -5,8 +5,8 @@
5
  <link rel="icon" type="image/svg+xml" href="./favicon.ico" />
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
  <title>Translator</title>
8
- <script type="module" crossorigin src="./assets/index-1848f0eb.js"></script>
9
- <link rel="stylesheet" href="./assets/index-f26a66d2.css">
10
  </head>
11
  <body>
12
  <div id="app"></div>
 
5
  <link rel="icon" type="image/svg+xml" href="./favicon.ico" />
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
  <title>Translator</title>
8
+ <script type="module" crossorigin src="./assets/index-9a0d049c.js"></script>
9
+ <link rel="stylesheet" href="./assets/index-45f88fc9.css">
10
  </head>
11
  <body>
12
  <div id="app"></div>