jiuyiUniapp/jiuyi2/node_modules/trtc-sdk-v5/plugins/device-detector/device-detector.iife.js

1417 lines
270 KiB
JavaScript
Raw Normal View History

2024-12-18 15:46:27 +08:00
"use strict";var DeviceDetector=(()=>{var ce=Object.defineProperty,vV=Object.defineProperties,RV=Object.getOwnPropertyDescriptor,DV=Object.getOwnPropertyDescriptors,yV=Object.getOwnPropertyNames,rt=Object.getOwnPropertySymbols;var nt=Object.prototype.hasOwnProperty,kV=Object.prototype.propertyIsEnumerable;var Oe=(V,e,t)=>e in V?ce(V,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):V[e]=t,F=(V,e)=>{for(var t in e||(e={}))nt.call(e,t)&&Oe(V,t,e[t]);if(rt)for(var t of rt(e))kV.call(e,t)&&Oe(V,t,e[t]);return V},L=(V,e)=>vV(V,DV(e));var BV=(V,e)=>{for(var t in e)ce(V,t,{get:e[t],enumerable:!0})},NV=(V,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let A of yV(e))!nt.call(V,A)&&A!==t&&ce(V,A,{get:()=>e[A],enumerable:!(i=RV(e,A))||i.enumerable});return V};var bV=V=>NV(ce({},"__esModule",{value:!0}),V);var h=(V,e,t)=>(Oe(V,typeof e!="symbol"?e+"":e,t),t);var Ai={};BV(Ai,{DeviceDetector:()=>Ne,_core:()=>g,_log:()=>m,default:()=>ii});function at(V){return{name:"DeviceDetectorOptions",type:"object",required:!1,allowEmpty:!1,properties:{networkDetect:{required:!1,type:"object",properties:{sdkAppId:{required:!0,type:"number"},userId:{required:!0,type:"string"},userSig:{required:!0,type:"string"},downlinkUserId:{required:!1,type:"string"},downlinkUserSig:{required:!1,type:"string"},roomId:{required:!1,type:"number"}},async validate(e,t,i,A){let{RtcError:o,ErrorCode:s,ErrorCodeDictionary:n}=V.errorModule;if(!e)return;let{sdkAppId:r,userId:p,userSig:l,downlinkUserId:d,downlinkUserSig:u,roomId:c}=e;c=c||8080;let w=V.TRTC.create(),D=V.TRTC.create();await w.enterRoom({roomId:c,sdkAppId:r,userId:p,userSig:l}),await w.exitRoom(),d&&u&&(await D.enterRoom({roomId:c,sdkAppId:r,userId:d,userSig:u}),await D.exitRoom())}}}}}function Qe(V){return{name:"StopDeviceDetectorOptions",required:!1}}var le=globalThis,de=le.ShadowRoot&&(le.ShadyCSS===void 0||le.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ct=Symbol(),qt=new WeakMap,pe=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==ct)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(de&&e===void 0){let i=t!==void 0&&t.length===1;i&&(e=qt.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&qt.set(t,e))}return e}toString(){return this.cssText}},lt=V=>new pe(typeof V=="string"?V:V+"",void 0,ct);var Fe=(V,e)=>{if(de)V.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let i=document.createElement("style"),A=le.litNonce;A!==void 0&&i.setAttribute("nonce",A),i.textContent=t.cssText,V.appendChild(i)}},he=de?V=>V:V=>V instanceof CSSStyleSheet?(e=>{let t="";for(let i of e.cssRules)t+=i.cssText;return lt(t)})(V):V;var{is:OV,defineProperty:QV,getOwnPropertyDescriptor:FV,getOwnPropertyNames:LV,getOwnPropertySymbols:KV,getPrototypeOf:YV}=Object,x=globalThis,pt=x.trustedTypes,GV=pt?pt.emptyScript:"",Le=x.reactiveElementPolyfillSupport,j=(V,e)=>V,Ke={toAttribute(V,e){switch(e){case Boolean:V=V?GV:null;break;case Object:case Array:V=V==null?V:JSON.stringify(V)}return V},fromAttribute(V,e){let t=V;switch(e){case Boolean:t=V!==null;break;case Number:t=V===null?null:Number(V);break;case Object:case Array:try{t=JSON.parse(V)}catch(i){t=null}}return t}},ut=(V,e)=>!OV(V,e),dt={attribute:!0,type:String,converter:Ke,reflect:!1,hasChanged:ut},ht,gt;(ht=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(gt=x.litPropertyMetadata)!=null||(x.litPropertyMetadata=new WeakMap);var U=class extends HTMLElement{static addInitializer(e){var t;this._$Ei(),((t=this.l)!=null?t:this.l=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=dt){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){let i=Symbol(),A=this.getPropertyDescriptor(e,i,t);A!==void 0&&QV(this.prototype,e,A)}}static getPropertyDescriptor(e,t,i){var s;let{get:A,set:o}=(s=FV(this.prototype,e))!=null?s:{get(){return thi
\f\r]`,P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ct=/-->/g,It=/>/g,y=RegExp(`>|${Ye}(?:([^\\s"'>=/]+)(${Ye}*=${Ye}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`,"g"),St=/'/g,Mt=/"/g,xt=/^(?:script|style|textarea|title)$/i,He=V=>(e,...t)=>({_$litType$:V,strings:e,values:t}),q=He(1),gi=He(2),mi=He(3),N=Symbol.for("lit-noChange"),I=Symbol.for("lit-nothing"),ft=new WeakMap,k=B.createTreeWalker(B,129);function vt(V,e){if(!Pe(V)||!V.hasOwnProperty("raw"))throw Error("invalid template strings array");return Et!==void 0?Et.createHTML(e):e}var zV=(V,e)=>{let t=V.length-1,i=[],A,o=e===2?"<svg>":e===3?"<math>":"",s=P;for(let n=0;n<t;n++){let r=V[n],p,l,d=-1,u=0;for(;u<r.length&&(s.lastIndex=u,l=s.exec(r),l!==null);)u=s.lastIndex,s===P?l[1]==="!--"?s=Ct:l[1]!==void 0?s=It:l[2]!==void 0?(xt.test(l[2])&&(A=RegExp("</"+l[2],"g")),s=y):l[3]!==void 0&&(s=y):s===y?l[0]===">"?(s=A!=null?A:P,d=-1):l[1]===void 0?d=-2:(d=s.lastIndex-l[2].length,p=l[1],s=l[3]===void 0?y:l[3]==='"'?Mt:St):s===Mt||s===St?s=y:s===Ct||s===It?s=P:(s=y,A=void 0);let c=s===y&&V[n+1].startsWith("/>")?" ":"";o+=s===P?r+ZV:d>=0?(i.push(p),r.slice(0,d)+Ut+r.slice(d)+v+c):r+v+(d===-2?n:c)}return[vt(V,o+(V[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},$=class V{constructor({strings:e,_$litType$:t},i){let A;this.parts=[];let o=0,s=0,n=e.length-1,r=this.parts,[p,l]=zV(e,t);if(this.el=V.createElement(p,i),k.currentNode=this.el.content,t===2||t===3){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(A=k.nextNode())!==null&&r.length<n;){if(A.nodeType===1){if(A.hasAttributes())for(let d of A.getAttributeNames())if(d.endsWith(Ut)){let u=l[s++],c=A.getAttribute(d).split(v),w=/([.?@])?(.*)/.exec(u);r.push({type:1,index:o,name:w[2],strings:c,ctor:w[1]==="."?Je:w[1]==="?"?ze:w[1]==="@"?We:Y}),A.removeAttribute(d)}else d.startsWith(v)&&(r.push({type:6,index:o}),A.removeAttribute(d));if(xt.test(A.tagName)){let d=A.textContent.split(v),u=d.length-1;if(u>0){A.textContent=ge?ge.emptyScript:"";for(let c=0;c<u;c++)A.append(d[c],X()),k.nextNode(),r.push({type:2,index:++o});A.append(d[u],X())}}}else if(A.nodeType===8)if(A.data===Tt)r.push({type:2,index:o});else{let d=-1;for(;(d=A.data.indexOf(v,d+1))!==-1;)r.push({type:7,index:o}),d+=v.length-1}o++}}static createElement(e,t){let i=B.createElement("template");return i.innerHTML=e,i}};function K(V,e,t=V,i){var s,n,r;if(e===N)return e;let A=i!==void 0?(s=t.o)==null?void 0:s[i]:t.l,o=_(e)?void 0:e._$litDirective$;return(A==null?void 0:A.constructor)!==o&&((n=A==null?void 0:A._$AO)==null||n.call(A,!1),o===void 0?A=void 0:(A=new o(V),A._$AT(V,t,i)),i!==void 0?((r=t.o)!=null?r:t.o=[])[i]=A:t.l=A),A!==void 0&&(e=K(V,A._$AS(V,e.values),A,i)),e}var Ze=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var p;let{el:{content:t},parts:i}=this._$AD,A=((p=e==null?void 0:e.creationScope)!=null?p:B).importNode(t,!0);k.currentNode=A;let o=k.nextNode(),s=0,n=0,r=i[0];for(;r!==void 0;){if(s===r.index){let l;r.type===2?l=new ee(o,o.nextSibling,this,e):r.type===1?l=new r.ctor(o,r.name,r.strings,this,e):r.type===6&&(l=new je(o,this,e)),this._$AV.push(l),r=i[++n]}s!==(r==null?void 0:r.index)&&(o=k.nextNode(),s++)}return k.currentNode=B,A}p(e){let t=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}},ee=class V{get _$AU(){var e,t;return(t=(e=this._$AM)==null?void 0:e._$AU)!=null?t:this.v}constructor(e,t,i,A){var o;this.type=2,this._$AH=I,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=A,this.v=(o=A==null?void 0:A.isConnected)!=null?o:!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=K(this,e,t),_(e)?e===I||e==null||e===""?(this._$AH!==I&&this._$AR(),this._$AH=I):e!==this._$AH&&e!==N&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):JV(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==I&&_(this._$AH)?this.
<style>
.button {
padding: 6px 16px;
border-radius: 4px;
border: 0;
outline: none;
background-color: transparent;
user-select: none;
font-size: 0.875rem;
min-width: 64px;
box-sizing: border-box;
font-weight: 500;
line-height: 1.75;
transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
}
.outlined {
/* \u770B\u4E0D\u5230 \u542C\u4E0D\u5230 */
padding: 5px 15px;
border: 1px solid #006eff;
color: #006eff;
cursor: pointer;
}
.contained {
/* \u542C\u5F97\u5230 */
cursor: pointer;
color: #ffffff;
background-color: #006eff;
box-shadow: 0px 3px 1px -2px rgb(0 0 0 / 20%), 0px 2px 2px 0px rgb(0 0 0 / 14%), 0px 1px 5px 0px rgb(0 0 0 / 12%);
}
.disabled {
/* \u7981\u6B62 \u5F00\u59CB\u68C0\u6D4B */
box-shadow: none;
color: rgba(0, 0, 0, 0.26);
background-color: rgba(0, 0, 0, 0.12);
}
.close{
color: #eeeeee!important;
border-radius: 20px!important;
border-color: #eeeeee!important;
}
</style>
<button>
<slot></slot>
</button>
`,e.content.cloneNode(!0)}connectedCallback(){let e=this.getAttribute("type"),t=this.getAttribute("class");this.buttonEle.type="button",this.buttonEle.classList.add("button",e,t);let i=this.getAttribute("on-click");if(i){let A=new Function(i);this.buttonEle.addEventListener("click",()=>{A()})}}attributeChangedCallback(e,t,i){e==="type"&&(this.buttonEle.classList.remove(t),this.buttonEle.classList.add(i)),e==="className"&&(this.buttonEle.classList.remove(t),this.buttonEle.classList.add(i))}};h(te,"observedAttributes",["className","type","on-click"]);customElements.get("trtc-custom-button")||customElements.define("trtc-custom-button",te);var WV=`
@media screen and (max-width: 769px) {
.root {
max-width: 32.5rem;
}
.device-detector-backdrop {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: center;
background-color: rgba(0, 0, 0, 0.8);
z-index: 9999;
opacity: 1;
transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
}
.device-detector-backdrop .root {
position: relative;
width: 98vw;
height: 72vh;
font-size: 16px;
box-shadow: 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12);
background-color: #ffffff;
border-radius: 4px;
}
.device-detector-backdrop .root .stepper {
border-radius: 5px 5px 0 0;
font-size: 36px;
}
.device-detector-backdrop .root .close {
color: #eeeeee !important;
border-radius: 20px !important;
border-color: #eeeeee !important;
position: absolute !important;
cursor: pointer;
top: -50px;
right: 2px;
}
.arrow {
width: 0;
height: 0;
border-left: 2vh solid transparent;
border-right: 2vh solid transparent;
border-bottom: 2vh solid red;
position: absolute;
left: 2vw;
animation: moveUpDown 2s infinite ease-in-out;
transform:rotate(45deg);
z-index: 10000;
}
.arrow::after {
content: "";
width: 1.5vh;
height: 4vh;
background-color: red;
position: absolute;
// top: 9px; /* \u5C06\u67C4\u5B9A\u4F4D\u5728\u7BAD\u5934\u7684\u4E0B\u65B9 */
left: 50%; /* \u6C34\u5E73\u5C45\u4E2D\u67C4 */
transform: translate(-50%,18%); /* \u5FAE\u8C03\u67C4\u7684\u6C34\u5E73\u4F4D\u7F6E\uFF0C\u4F7F\u5176\u5B8C\u5168\u5C45\u4E2D */
z-index: 10000;
}
.remind-text {
position: absolute;
top: 10vh; /* \u8C03\u6574\u6587\u5B57\u7684\u5782\u76F4\u4F4D\u7F6E */
left: 1vw;
width:90vw;
color:red;
z-index: 10000;
}
@keyframes moveUpDown {
0% {
top: 3vh;
left: 2vw;
}
50% {
top: 1.5vh;
left: 3vw;
}
100% {
top: 3vh;
left: 2vw;
}
}
.device-connect {
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
}
.device-connect .testing-title {
display: flex;
font-size: 2rem;
justify-content: center;
margin-top: 4vh;
color: rgba(32, 30, 30, 0.8980392157);
}
.device-connect .testing-prepare-info {
max-width: 500px;
padding: 0 1vw;
text-align: center;
display: flex;
font-size: 1rem;
justify-content: center;
margin-top: 3.8vh;
color: rgba(88, 86, 86, 0.8980392157);
}
.device-connect .device-display {
width: 88%;
margin: 3vh auto 1.5vh;
display: flex;
justify-content: space-around;
position: relative;
}
.device-connect .device-display .connect-success {
position: relative;
}
.device-connect .device-display .connect-success::before {
content: "";
width: 28px;
height: 28px;
position: absolute;
bottom: -34px;
left: 50%;
transform: translateX(-50%);
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAACAElEQVRYR+2Vv2sUQRTH3/eOYO+f EWzmzUaSTv8CYxIUAooWAYsQJEkRRDRikUJMiiMIQRSVCNql0sqkCIFwO7NLCGm00kpEEBtzhsyT Pe5kWG9zu8p5zU658958Pnznx4L6PNBnPpUCZQJlAj1PgOu8SBW6C0HNBGYmfe17KqBCdRvA/TbU OXc+Hoq3fImeCahQLQBY8mDGahv8lwR0qOcF8sCDfSCicavtXs8F2PBNIlrxQB9dxU3EKq53evY7 boGyahDHuCRVWY04+pL3f8GGp4mo1q4H8JkcTZjAbGet0VGADUurYd8dubF4OH7fTUJZdQOCR17d t1bs707q/UNgZH/kdKPR+Oofnupx9WL9bP1T1kJseIqI1rz5HwIZjzh60008awvuQXDndzNoR0hG O20HG75ORE+8WldBZSxU4UY3eDKfeQ211UsisuAtsjlwNDC6O7z7vf1NWXUFgucp0GWr7es88BMF kklt9UMRmfUWe3t46vDCwZmDnzrUkwJZ90ECuRpx9CIvvKtAUsCWaySUnO7mEJENAC+J6JUPgmDK BOZxEXgugaZEyGsESg5a1pi22q4WhecWaEoYfkpE19IQEZmLgmj5b+CFBJJiZdU6BJNtGAS3TGD8 976wR+GfUSuJc+TomR2yi4WJqYbCAv8KTPeXAmUCZQJ9T+AXo7StIY0IqrkAAAAASUVORK5CYII=") no-repeat;
background-size: 100% 100%;
}
.device-connect .device-display .connect-fail {
position: relative;
}
.device-connect .device-display .connect-fail::before {
content: "";
width: 28px;
height: 28px;
position: absolute;
bottom: -34px;
left: 50%;
transform: translateX(-50%);
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAB3ElEQVRYR+2Wr08cQRTHP+8ESZOq GlKBaKhpUwWmCnG7d4giwDS5NGlVMWDAtIZfrQEDpjVF0ZC0wH/QWxr+gNrKJigSBA4J98hN7pbl 9mZnZklz5tasmPfm+5nve/t2hAE/MmB9hgBDB5wOaJVx+c2/Ms2qEc+BCznm3JZvBdBpHnPNmUlU VuWYzyEQGrGC8KmdI4m92e0AbXrhbyoqfJQmWz4QWuMDymYa2+KpzcXCEmjMOrCWEV2WhJ0iCI1Z ArbTGId77h7ohRAWpcnXfhBaYwHlS4hrTgDTAnkn5iVhNwuhMe+BbyFumf7wqakF4p0kfO+svQX2 Mie3utSr5w3QF6JCw2zY4kdm45w7RYcMArA4kd0/dcXX2WAAK0SFhvzip69wN64cQJ0XtDgEnmXq /lqaHP13AK0yQcWIj+fEhGCIIAc05iUY8bGO+EbnfTusAiG8AbTOVMf20a64JGZS5udEAIQXgEbE CAfAo17xbhlyw8oTwgmgMa/AdPdDm/h9IIp/RjXmUCM+4hIvC2H/HdeZpMWfTKdvdGvu+tRy5bji iZxw2i+v6D7wBmHf9+S9m9+BKH0fiJilwgNp3pn1LgPSdY2YQbiUhBNbkrMJvdVKBg4Bhg4M3IEb uI2UIfOyj40AAAAASUVORK5CYII=") no-repeat;
background-size: 100% 100%;
}
.device-connect .device-display .device {
width: 46px;
height: 46px;
position: relative;
justify-content: center;
font-size: 38px;
}
.device-connect .device-display .device svg {
width: 36px;
height: 36px;
fill: #47494D;
}
.device-connect .device-display .outer-progress {
width: 83%;
height: 4px;
border-radius: 5px;
position: absolute;
top: 70px;
background-color: #eeeeee;
overflow: hidden;
}
.device-connect .device-display .outer-progress .inner-progress {
width: 100%;
position: absolute;
top: 0;
left: -100%;
height: 4px;
border-radius: 5px;
background-color: #bfbfbf;
transform-origin: left;
transition: transform 0.3s linear;
}
.device-connect .text {
margin-top: 4.5vh;
font-size: 1rem;
max-width: 420px;
text-align: center;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
}
.device-connect .text.gray-text {
color: rgba(88, 86, 86, 0.8980392157);
}
.device-connect .text.green-text {
color: rgb(50, 205, 50);
}
.device-connect .text.red-text {
color: red;
}
.device-connect .button-container {
position: absolute;
bottom: 3vh;
width: 40%;
display: flex;
justify-content: space-around;
}
.error-connect {
width: 20px;
height: 20px;
margin-left: 8px;
display: inline;
}
.error-connect .error-icon svg {
width: 20px;
height: 20px;
}
.connect-attention-info {
padding: 1vw 1vh;
min-width: 134px;
min-height: 50px;
background: rgba(0, 0, 0, 0.6);
border-radius: 10px;
color: rgb(255, 255, 255);
position: absolute;
top:23vh;
display: block;
font-size: 0.8rem;
text-align: left;
max-width: 92vw;
white-space: nowrap;
white-space: normal; // \u6DFB\u52A0\u8FD9\u4E00\u884C\uFF0C\u4F7F\u5176\u81EA\u52A8\u6362\u884C
word-wrap: break-word; /* \u6DFB\u52A0\u81EA\u52A8\u6362\u884C\u6837\u5F0F */
overflow-wrap: anywhere; /* \u5141\u8BB8\u5728\u4EFB\u610F\u4F4D\u7F6E\u6362\u884C */
}
.error-connect .connect-attention-info::after {
content: "";
width: 0;
height: 0;
border: 10px transparent solid;
border-top-color: rgba(0, 0, 0, 0.6);
position: absolute;
left: 100%;
top: 100%;
transform: translateX(-18vw);
}
.testing-body {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.testing-body.hide {
display: none;
}
.testing-body .device-list {
width: 93%;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 2vh;
}
.testing-body .device-list .device-list-title {
margin-right: 1vw;
font-size: 0.8rem;
}
.testing-body .camera-video {
max-width: 80vw;
height: 32vh;
object-fit: contain; /* \u4FDD\u6301\u89C6\u9891\u7684\u5BBD\u9AD8\u6BD4\uFF0C\u5C06\u5176\u5B8C\u6574\u663E\u793A\u5728\u6846\u5185 */
}
.testing-container {
width: 100%;
margin: 10px auto 30px;
}
.testing-container .testing-body {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.testing-container .testing-body.hide {
display: none;
}
.testing-container .testing-body .device-list {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 20px;
}
.testing-container .testing-body .device-list .device-list-title {
margin-right: 10px;
}
.testing-container .testing-body .camera-video {
width: 300px;
height: 180px;
}
.audio-player-container {
width: 340px;
display: flex;
justify-content: center;
flex-wrap: wrap;
margin: 2vh auto 0;
text-align: center;
}
.audio-player-container .audio-player-info {
margin: 0px auto 16px;
color: #5f5f5f;
}
.audio-player-container #audio-player {
width: 100%;
}
.testing-info-container {
display: flex;
width: 100%;
justify-content: center;
flex-wrap: wrap;
position: absolute;
bottom: 3vh;
}
.testing-info-container .testing-info {
width: 100%;
text-align: center;
display: block;
font-size:1rem;
}
.testing-info-container .button-list {
margin-top: 2vh;
width: 300px;
display: flex;
justify-content: space-around;
}
.device-select {
width: 90%;
padding: 6px 14px 6px 12px;
position: relative;
font-size: 0.8rem;
border-radius: 4px;
background-color: #fff;
cursor: pointer;
}
.device-select:focus {
outline: none;
}
.step-container {
display: flex;
margin-top: 2vh;
margin-bottom: 2vh;
padding: 0.3vw;
font-size: 0.95rem;
}
.step-container .step {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
fill: rgba(0, 0, 0, 0.54);
color: rgba(0, 0, 0, 0.54);
}
.step-container .step:not(:first-child)::after {
position: absolute;
content: "";
height: 1px;
background-color: rgba(0, 0, 0, 0.16);
right: 100%;
top: 30%;
right: calc(50% + 20px);
left: calc(-50% + 20px);
top: 16px;
}
.step-container .step.active {
fill: #006EFF;
color: #006EFF;
cursor: pointer;
}
.step-container .step.active::after {
background-color: #006EFF;
}
.step-container .step.error {
fill: red;
color: red;
cursor: pointer;
}
.step-container .step.error::after {
background-color: #006EFF;
}
.step-container .step .step-label {
margin-top: 12px;
}
.mic-testing-container {
margin-top: 20px;
width: 100%;
}
.mic-testing-container .mic-testing-info {
text-align: center;
}
.mic-testing-container .mic-bar-container {
display: flex;
justify-content: center;
margin-top: 10px;
}
.mic-testing-container .mic-bar-container .mic-bar {
width: 8px;
height: 30px;
border: 1px solid #cccccc;
border-radius: 1px;
}
.mic-testing-container .mic-bar-container .mic-bar:not(:first-child) {
margin-left: 3px;
}
.mic-testing-container .mic-bar-container .mic-bar.active {
background: #006EFF;
}
.recording-container {
margin-top: 3vh;
}
.testing-list {
width: 100%;
display: flex;
flex-wrap: wrap;
}
.testing-list .testing-item-container {
width: 83%;
margin: 0 auto 10px;
display: flex;
justify-content: space-between;
}
@keyframes loading-circle {
0% {
transform: rotate(0deg);
}
25% {
transform: rotate(90deg);
}
50% {
transform: rotate(180deg);
}
75% {
transform: rotate(270deg);
}
100% {
transform: rotate(360deg);
}
}
.network-loading {
display: flex;
}
.network-loading::before {
content: "";
width: 16px;
height: 16px;
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAChElEQVRYR82WO2wTQRCGZ9YFLmmCQDRUFIgOCuhMg2QJ8OxKtpQuEggqQDz6hDIiSAg6QEo6pFi+WVsoLgkVDakgFFBAlYJ0IGRceAetdWddLF/uznacXHe38/j2n9mbRTjkB6eRn4jOWGt/jhMrMwARlRDxkogUEfETM7/zCY0xqyKyAAAe4G70PStMZgCt9WsAuBUG3mLmi5VK5ZxSajuWrM7MtazJvd1EAER0HBG/AcBcPxji8yAIHhDREiJeA4A/IvLBWruUBJUIoLX+AgC7IvLEWruZVAIimldKXXXOefstb6u1lljCbWY+nwsg3MFi6LTJzFeyyloul48Vi8V/MfvvzHw2F0Cstl6BZWvts6wA3o6I3iDizdDnBTPfzwUQGVer1bl6vb6bJ3nM92S321WtVmtHa/3QnxBE/BwEwY14vD094KXfr2HGASGiBURcjXxF5KW19l70PgDQWr8HgBIA5Kp5GpTWeh0AqjG7HWY+PUsAn9xD9J/wVA2O5YGXIGzKklJq3jn30Vq7ltgDaXJOsu7nhS+xUuqyc+6t/1/k+hNOktz7GmNYRCgWp8bM9X4JiGhZKXVCRDb8x0mTDfuPmBnepD83+gDRr3O4QaYJorX+AQC+DHuacSYKhCovIuJ1ALiAiGu9Xu9ps9n8mnkaTkuN4cvLzAGGN3J0AIjoESKuiMgda+2raUmeFmegwEED+KPom+7QSpA0aY9ODwxLY4w51el0/rbb7d9pdZxkfb9Lqb9YTvVuMAo0EcDfZAqFwq9Go7Exzg6NMStBEDxO883VA0R0e9QRTerwtOS5x3E4tPpjNAoeTrp151xt1DFLg8ilQFKwmSmQtptx1v8DVbAxMP//OLQAAAAASUVORK5CYII=") no-repeat;
background-size: 100% 100%;
animation: loading-circle 2s linear infinite;
}
.report-button {
position: absolute;
bottom: 6vh;
cursor: pointer;
}
.gray-button {
position: absolute;
bottom: 6vh;
}
.device-testing-report {
display: flex;
flex-wrap: wrap;
flex-direction: column;
align-items: center;
}
.device-testing-report .testing-title {
display: flex;
font-size: 4vh;
justify-content: center;
margin-top: 2vh;
color: rgba(32, 30, 30, 0.8980392157);
}
.device-testing-report .device-report-list {
display: block;
width: 100%;
margin-top: 10px;
}
.device-testing-report .device-report-list .device-report {
display: flex;
width: 70%;
margin: 2vh auto 0;
justify-content: space-between;
}
.device-testing-report .device-report-list .device-report .device-info {
display: flex;
width: 80%;
}
.device-testing-report .device-report-list .device-report .device-info .report-icon {
margin-right: 20px;
justify-content: center;
font-size: 22px;
line-height: 22px;
color: #515151;
}
.device-testing-report .device-report-list .device-report .device-info .report-icon svg {
width: 24px;
height: 24px;
}
.device-testing-report .device-report-list .device-report .device-info .device-name {
width: 280px;
height: 24px;
line-height: 24px;
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: left;
}
.device-testing-report .device-report-list .device-report .green {
color: green;
}
.device-testing-report .device-report-list .device-report .red {
color: red;
}
.device-testing-report .device-report-footer {
width: 65%;
display: flex;
justify-content: space-between;
position: absolute;
bottom: 36px;
}
}
@media screen and (min-width: 769px) {
.device-detector-backdrop {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: center;
background-color: rgba(0, 0, 0, 0.8);
z-index: 9999;
opacity: 1;
transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
}
.device-detector-backdrop .root {
position: relative;
width: 600px;
height: 480px;
font-size: 16px;
box-shadow: 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12);
background-color: #ffffff;
border-radius: 4px;
}
.device-detector-backdrop .root .stepper {
border-radius: 5px 5px 0 0;
font-size: 36px;
}
.device-detector-backdrop .root .close {
color: #eeeeee !important;
border-radius: 20px !important;
border-color: #eeeeee !important;
position: absolute !important;
cursor: pointer;
top: -50px;
right: 2px;
}
.arrow {
width: 0;
height: 0;
border-left: 2vh solid transparent;
border-right: 2vh solid transparent;
border-bottom: 2vh solid red;
position: absolute;
left: 2vw;
animation: moveUpDown 2s infinite ease-in-out;
transform:rotate(45deg);
z-index: 10000;
}
.arrow::after {
content: "";
width: 1.5vh;
height: 4vh;
background-color: red;
position: absolute;
// top: 9px; /* \u5C06\u67C4\u5B9A\u4F4D\u5728\u7BAD\u5934\u7684\u4E0B\u65B9 */
left: 50%; /* \u6C34\u5E73\u5C45\u4E2D\u67C4 */
transform: translate(-50%,18%); /* \u5FAE\u8C03\u67C4\u7684\u6C34\u5E73\u4F4D\u7F6E\uFF0C\u4F7F\u5176\u5B8C\u5168\u5C45\u4E2D */
z-index: 10000;
}
.remind-text {
position: absolute;
top: 10vh; /* \u8C03\u6574\u6587\u5B57\u7684\u5782\u76F4\u4F4D\u7F6E */
left: 1vw;
width:30vw;
color:red;
z-index: 10000;
}
@keyframes moveUpDown {
0% {
top: 3vh;
left: 2vw;
}
50% {
top: 1.5vh;
left: 3vw;
}
100% {
top: 3vh;
left: 2vw;
}
}
.device-connect {
display: flex;
flex-direction: column;
align-items: center;
}
.device-connect .testing-title {
display: flex;
font-size: 32px;
justify-content: center;
margin-top: 55px;
color: rgba(32, 30, 30, 0.8980392157);
}
.device-connect .testing-prepare-info {
max-width: 500px;
text-align: center;
display: flex;
font-size: 16px;
justify-content: center;
margin-top: 30px;
color: rgba(88, 86, 86, 0.8980392157);
}
.device-connect .device-display {
width: 420px;
margin: 40px auto 20px;
display: flex;
justify-content: space-around;
position: relative;
}
.device-connect .device-display .connect-success {
position: relative;
}
.device-connect .device-display .connect-success::before {
content: "";
width: 28px;
height: 28px;
position: absolute;
bottom: -34px;
left: 50%;
transform: translateX(-50%);
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAACAElEQVRYR+2Vv2sUQRTH3/eOYO+f EWzmzUaSTv8CYxIUAooWAYsQJEkRRDRikUJMiiMIQRSVCNql0sqkCIFwO7NLCGm00kpEEBtzhsyT Pe5kWG9zu8p5zU658958Pnznx4L6PNBnPpUCZQJlAj1PgOu8SBW6C0HNBGYmfe17KqBCdRvA/TbU OXc+Hoq3fImeCahQLQBY8mDGahv8lwR0qOcF8sCDfSCicavtXs8F2PBNIlrxQB9dxU3EKq53evY7 boGyahDHuCRVWY04+pL3f8GGp4mo1q4H8JkcTZjAbGet0VGADUurYd8dubF4OH7fTUJZdQOCR17d t1bs707q/UNgZH/kdKPR+Oofnupx9WL9bP1T1kJseIqI1rz5HwIZjzh60008awvuQXDndzNoR0hG O20HG75ORE+8WldBZSxU4UY3eDKfeQ211UsisuAtsjlwNDC6O7z7vf1NWXUFgucp0GWr7es88BMF kklt9UMRmfUWe3t46vDCwZmDnzrUkwJZ90ECuRpx9CIvvKtAUsCWaySUnO7mEJENAC+J6JUPgmDK BOZxEXgugaZEyGsESg5a1pi22q4WhecWaEoYfkpE19IQEZmLgmj5b+CFBJJiZdU6BJNtGAS3TGD8 976wR+GfUSuJc+TomR2yi4WJqYbCAv8KTPeXAmUCZQJ9T+AXo7StIY0IqrkAAAAASUVORK5CYII=") no-repeat;
background-size: 100% 100%;
}
.device-connect .device-display .connect-fail {
position: relative;
}
.device-connect .device-display .connect-fail::before {
content: "";
width: 28px;
height: 28px;
position: absolute;
bottom: -34px;
left: 50%;
transform: translateX(-50%);
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAB3ElEQVRYR+2Wr08cQRTHP+8ESZOq GlKBaKhpUwWmCnG7d4giwDS5NGlVMWDAtIZfrQEDpjVF0ZC0wH/QWxr+gNrKJigSBA4J98hN7pbl 9mZnZklz5tasmPfm+5nve/t2hAE/MmB9hgBDB5wOaJVx+c2/Ms2qEc+BCznm3JZvBdBpHnPNmUlU VuWYzyEQGrGC8KmdI4m92e0AbXrhbyoqfJQmWz4QWuMDymYa2+KpzcXCEmjMOrCWEV2WhJ0iCI1Z ArbTGId77h7ohRAWpcnXfhBaYwHlS4hrTgDTAnkn5iVhNwuhMe+BbyFumf7wqakF4p0kfO+svQX2 Mie3utSr5w3QF6JCw2zY4kdm45w7RYcMArA4kd0/dcXX2WAAK0SFhvzip69wN64cQJ0XtDgEnmXq /lqaHP13AK0yQcWIj+fEhGCIIAc05iUY8bGO+EbnfTusAiG8AbTOVMf20a64JGZS5udEAIQXgEbE CAfAo17xbhlyw8oTwgmgMa/AdPdDm/h9IIp/RjXmUCM+4hIvC2H/HdeZpMWfTKdvdGvu+tRy5bji iZxw2i+v6D7wBmHf9+S9m9+BKH0fiJilwgNp3pn1LgPSdY2YQbiUhBNbkrMJvdVKBg4Bhg4M3IEb uI2UIfOyj40AAAAASUVORK5CYII=") no-repeat;
background-size: 100% 100%;
}
.device-connect .device-display .device {
width: 46px;
height: 46px;
position: relative;
justify-content: center;
font-size: 38px;
}
.device-connect .device-display .device svg {
width: 36px;
height: 36px;
fill: #47494D;
}
.device-connect .device-display .outer-progress {
width: 360px;
height: 4px;
border-radius: 5px;
position: absolute;
top: 70px;
background-color: #eeeeee;
overflow: hidden;
}
.device-connect .device-display .outer-progress .inner-progress {
width: 100%;
position: absolute;
top: 0;
left: -360px;
height: 4px;
border-radius: 5px;
background-color: #bfbfbf;
transform-origin: left;
transition: transform 0.3s linear;
}
.device-connect .text {
margin-top: 50px;
font-size: 18px;
max-width: 420px;
text-align: center;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
}
.device-connect .text.gray-text {
color: rgba(88, 86, 86, 0.8980392157);
}
.device-connect .text.green-text {
color: rgb(50, 205, 50);
}
.device-connect .text.red-text {
color: red;
}
.device-connect .button-container {
margin-top: 50px;
width: 40%;
display: flex;
justify-content: space-around;
}
.error-connect {
width: 20px;
height: 20px;
margin-left: 8px;
position: relative;
display: inline;
}
.error-connect .error-icon svg {
width: 20px;
height: 20px;
}
.error-connect .connect-attention-info {
padding: 8px 12px;
min-width: 160px;
min-height: 50px;
background: rgba(0, 0, 0, 0.6);
border-radius: 10px;
color: #fff;
position: absolute;
right: 0;
bottom: 100%;
transform: translate(20px, -10px);
display: block;
white-space: nowrap;
font-size: 12px;
text-align: left;
}
.error-connect .connect-attention-info::after {
content: "";
width: 0;
height: 0;
border: 10px transparent solid;
border-top-color: rgba(0, 0, 0, 0.6);
position: absolute;
left: 100%;
top: 100%;
transform: translateX(-40px);
}
.testing-body {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.testing-body.hide {
display: none;
}
.testing-body .device-list {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 20px;
}
.testing-body .device-list .device-list-title {
margin-right: 10px;
}
.testing-body .camera-video {
width: 300px;
height: 180px;
}
.testing-container {
width: 100%;
margin: 10px auto 30px;
}
.testing-container .testing-body {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.testing-container .testing-body.hide {
display: none;
}
.testing-container .testing-body .device-list {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 20px;
}
.testing-container .testing-body .device-list .device-list-title {
margin-right: 10px;
}
.testing-container .testing-body .camera-video {
width: 300px;
height: 180px;
}
.audio-player-container {
width: 340px;
display: flex;
justify-content: center;
flex-wrap: wrap;
margin: 20px auto 0;
text-align: center;
}
.audio-player-container .audio-player-info {
margin: 0px auto 16px;
color: #5f5f5f;
}
.testing-info-container {
display: flex;
width: 100%;
justify-content: center;
flex-wrap: wrap;
position: absolute;
bottom: 30px;
}
.testing-info-container .testing-info {
width: 100%;
text-align: center;
display: block;
}
.testing-info-container .button-list {
margin-top: 20px;
width: 300px;
display: flex;
justify-content: space-around;
}
.device-select {
width: 260px;
padding: 6px 14px 6px 12px;
position: relative;
font-size: 16px;
border-radius: 4px;
background-color: #fff;
cursor: pointer;
}
.device-select:focus {
outline: none;
}
.step-container {
display: flex;
padding: 24px;
}
.step-container .step {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
fill: rgba(0, 0, 0, 0.54);
color: rgba(0, 0, 0, 0.54);
}
.step-container .step:not(:first-child)::after {
position: absolute;
content: "";
height: 1px;
background-color: rgba(0, 0, 0, 0.16);
right: 100%;
top: 30%;
right: calc(50% + 20px);
left: calc(-50% + 20px);
top: 16px;
}
.step-container .step.active {
fill: #006EFF;
color: #006EFF;
cursor: pointer;
}
.step-container .step.active::after {
background-color: #006EFF;
}
.step-container .step.error {
fill: red;
color: red;
cursor: pointer;
}
.step-container .step.error::after {
background-color: #006EFF;
}
.step-container .step .step-label {
margin-top: 12px;
}
.mic-testing-container {
margin-top: 20px;
width: 100%;
}
.mic-testing-container .mic-testing-info {
text-align: center;
}
.mic-testing-container .mic-bar-container {
display: flex;
justify-content: center;
margin-top: 10px;
}
.mic-testing-container .mic-bar-container .mic-bar {
width: 8px;
height: 30px;
border: 1px solid #cccccc;
border-radius: 1px;
}
.mic-testing-container .mic-bar-container .mic-bar:not(:first-child) {
margin-left: 3px;
}
.mic-testing-container .mic-bar-container .mic-bar.active {
background: #006EFF;
}
.recording-container {
margin-top: 5em;
}
.testing-list {
width: 100%;
display: flex;
flex-wrap: wrap;
}
.testing-list .testing-item-container {
width: 70%;
margin: 0 auto 10px;
display: flex;
justify-content: space-between;
}
@keyframes loading-circle {
0% {
transform: rotate(0deg);
}
25% {
transform: rotate(90deg);
}
50% {
transform: rotate(180deg);
}
75% {
transform: rotate(270deg);
}
100% {
transform: rotate(360deg);
}
}
.network-loading {
display: flex;
}
.network-loading::before {
content: "";
width: 16px;
height: 16px;
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAChElEQVRYR82WO2wTQRCGZ9YFLmmCQDRUFIgOCuhMg2QJ8OxKtpQuEggqQDz6hDIiSAg6QEo6pFi+WVsoLgkVDakgFFBAlYJ0IGRceAetdWddLF/uznacXHe38/j2n9mbRTjkB6eRn4jOWGt/jhMrMwARlRDxkogUEfETM7/zCY0xqyKyAAAe4G70PStMZgCt9WsAuBUG3mLmi5VK5ZxSajuWrM7MtazJvd1EAER0HBG/AcBcPxji8yAIHhDREiJeA4A/IvLBWruUBJUIoLX+AgC7IvLEWruZVAIimldKXXXOefstb6u1lljCbWY+nwsg3MFi6LTJzFeyyloul48Vi8V/MfvvzHw2F0Cstl6BZWvts6wA3o6I3iDizdDnBTPfzwUQGVer1bl6vb6bJ3nM92S321WtVmtHa/3QnxBE/BwEwY14vD094KXfr2HGASGiBURcjXxF5KW19l70PgDQWr8HgBIA5Kp5GpTWeh0AqjG7HWY+PUsAn9xD9J/wVA2O5YGXIGzKklJq3jn30Vq7ltgDaXJOsu7nhS+xUuqyc+6t/1/k+hNOktz7GmNYRCgWp8bM9X4JiGhZKXVCRDb8x0mTDfuPmBnepD83+gDRr3O4QaYJorX+AQC+DHuacSYKhCovIuJ1ALiAiGu9Xu9ps9n8mnkaTkuN4cvLzAGGN3J0AIjoESKuiMgda+2raUmeFmegwEED+KPom+7QSpA0aY9ODwxLY4w51el0/rbb7d9pdZxkfb9Lqb9YTvVuMAo0EcDfZAqFwq9Go7Exzg6NMStBEDxO883VA0R0e9QRTerwtOS5x3E4tPpjNAoeTrp151xt1DFLg8ilQFKwmSmQtptx1v8DVbAxMP//OLQAAAAASUVORK5CYII=") no-repeat;
background-size: 100% 100%;
animation: loading-circle 2s linear infinite;
}
.report-button {
position: absolute;
bottom: 60px;
cursor: pointer;
}
.gray-button {
position: absolute;
bottom: 60px;
}
.device-testing-report {
display: flex;
flex-wrap: wrap;
flex-direction: column;
align-items: center;
}
.device-testing-report .testing-title {
display: flex;
font-size: 34px;
justify-content: center;
margin-top: 30px;
color: rgba(32, 30, 30, 0.8980392157);
}
.device-testing-report .device-report-list {
display: block;
width: 100%;
margin-top: 10px;
}
.device-testing-report .device-report-list .device-report {
display: flex;
width: 70%;
margin: 20px auto 0;
justify-content: space-between;
}
.device-testing-report .device-report-list .device-report .device-info {
display: flex;
width: 80%;
}
.device-testing-report .device-report-list .device-report .device-info .report-icon {
margin-right: 20px;
justify-content: center;
font-size: 22px;
line-height: 22px;
color: #515151;
}
.device-testing-report .device-report-list .device-report .device-info .report-icon svg {
width: 24px;
height: 24px;
}
.device-testing-report .device-report-list .device-report .device-info .device-name {
width: 280px;
height: 24px;
line-height: 24px;
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: left;
}
.device-testing-report .device-report-list .device-report .green {
color: green;
}
.device-testing-report .device-report-list .device-report .red {
color: red;
}
.device-testing-report .device-report-footer {
width: 50%;
display: flex;
justify-content: space-between;
position: absolute;
bottom: 36px;
}
}
`,f=WV;var a=window.navigator&&window.navigator.userAgent||"",kt=/AppleWebKit\/([\d.]+)/i.exec(a),jV=kt?parseFloat(kt.pop()||"0"):null,Bt=/iPad/i.test(a),_e=/iPhone/i.test(a)&&!Bt,PV=/iPod/i.test(a),me=_e||Bt||PV,ki=me&&function(){let V=a.match(/OS (\d+)_/i);return V&&V[1]?V[1]:null}(),G=/Android/i.test(a),Nt=G&&function(){let V=a.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!V)return null;let e=V[1]&&parseFloat(V[1]),t=V[2]&&parseFloat(V[2]);return e&&t?parseFloat(`${V[1]}.${V[2]}`):e||null}(),Bi=G&&/webkit/i.test(a)&&Nt<2.3,Ni=G&&Nt<5&&jV<537,Z=/Firefox/i.test(a),Ve=Z&&function(){let V=a.match(/Firefox\/(\d+)/);return V&&V[1]?parseFloat(V[1]):null}(),J=/Edge\//i.test(a),bt=J&&function(){let V=a.match(/Edge\/(\d+)/i);if(V&&V[1])return V[1]}(),z=/Edg\//i.test(a),ie=z&&function(){let V=a.match(/Edg\/(\d+)/);return V&&V[1]?parseFloat(V[1]):null}(),ue=/SogouMobileBrowser\//i.test(a),Ot=ue&&function(){let V=a.match(/SogouMobileBrowser\/(\d+)/);return V&&V[1]?parseFloat(V[1]):null}(),Ee=/MetaSr\s/i.test(a),Qt=Ee&&function(){let V=a.match(/MetaSr(\s\d+(\.\d+)+)/);return V&&V[1]?parseFloat(V[1]):null}(),T=/TBS\/\d+/i.test(a),Ft=T&&function(){let V=a.match(/TBS\/(\d+)/i);if(V&&V[1])return V[1]}(),Ce=/XWEB\/\d+/i.test(a),Lt=Ce&&function(){let V=a.match(/XWEB\/(\d+)/i);if(V&&V[1])return V[1]}(),bi=/MSIE\s8\.0/.test(a),HV=/MSIE\/\d+/i.test(a),Oi=HV&&function(){let V=/MSIE\s(\d+)\.\d/.exec(a),e=V&&parseFloat(V[1]);return!e&&/Trident\/7.0/i.test(a)&&/rv:11.0/.test(a)&&(e=11),e}(),Qi=/windowswechat/i.test(a),$e=/(micromessenger|webbrowser)/i.test(a),Kt=$e&&function(){let V=a.match(/MicroMessenger\/(\d+)/i);if(V&&V[1])return V[1]}(),Ie=!T&&/MQQBrowser\/\d+/i.test(a)&&/COVC\/\d+/i.test(a),Se=!T&&/MQQBrowser\/\d+/i.test(a)&&!/COVC\/\d+/i.test(a),et=(Se||Ie)&&function(){let V=a.match(/ MQQBrowser\/([\d.]+)/);return V&&V[1]?V[1]:null}(),Me=!T&&/ QQBrowser\/\d+/i.test(a),Yt=Me&&function(){let V=a.match(/ QQBrowser\/([\d.]+)/);return V&&V[1]?V[1]:null}(),fe=!T&&/QQBrowserLite\/\d+/i.test(a),Gt=fe&&function(){let V=a.match(/QQBrowserLite\/([\d.]+)/);return V&&V[1]?V[1]:null}(),we=!T&&/MQBHD\/\d+/i.test(a),Zt=we&&function(){let V=a.match(/MQBHD\/([\d.]+)/);return V&&V[1]?V[1]:null}(),Jt=/Windows/i.test(a),zt=!me&&/MAC OS X/i.test(a),Wt=!G&&/Linux/i.test(a),Fi=/MicroMessenger/i.test(a),jt=/UCBrowser/i.test(a),Li=/Electron/i.test(a),Ue=/MiuiBrowser/i.test(a),Pt=Ue&&function(){let V=a.match(/MiuiBrowser\/([\d.]+)/);return V&&V[1]?V[1]:null}(),Te=/HuaweiBrowser/i.test(a),Ht=Te&&function(){let V=a.match(/HuaweiBrowser\/([\d.]+)/);return V&&V[1]?V[1]:null}(),xe=/SamsungBrowser/i.test(a),Xt=xe&&function(){let V=a.match(/SamsungBrowser\/([\d.]+)/);return V&&V[1]?V[1]:null}(),ve=/HeyTapBrowser/i.test(a),_t=ve&&function(){let V=a.match(/HeyTapBrowser\/([\d.]+)/);return V&&V[1]?V[1]:null}(),Re=/VivoBrowser/i.test(a),$t=Re&&function(){let V=a.match(/VivoBrowser\/([\d.]+)/);return V&&V[1]?V[1]:null}(),XV=/Chrome/i.test(a),b=!J&&!Ee&&!ue&&!T&&!Ce&&!z&&!Me&&!Ue&&!Te&&!xe&&!ve&&!Re&&/Chrome/i.test(a),Ki=b&&function(){let V=a.match(/Chrome\/(\d+)/);return V&&V[1]?parseFloat(V[1]):null}(),tt=b&&function(){let V=a.match(/Chrome\/([\d.]+)/);return V&&V[1]?V[1]:null}(),De=!XV&&!Se&&!Ie&&!fe&&!we&&/Safari/i.test(a);var Vt=De&&function(){let V=a.match(/Version\/([\d.]+)/);return V&&V[1]?V[1]:null}(),Yi=b?`Chrome/${tt}`:De?`Safari/${Vt}`:"NotSupportedBrowser",eV=location.protocol==="file:"||location.hostname==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(location.hostname);var tV=new Map([[G,"Android"],[me,"iOS"],[Jt,"Windows"],[zt,"MacOS"],[Wt,"Linux"]]),iV=()=>{let V="unknown";return tV.get(!0)&&(V=tV.get(!0)),V},VV=new Map([[Z,["Firefox",Ve]],[z,["Edg",ie]],[b,["Chrome",tt]],[De,["Safari",Vt]],[T,["TBS",Ft]],[Ce,["XWEB",Lt]],[$e&&_e,["WeChat",Kt]],[Me,["QQ(Win)",Yt]],[Se,["QQ(Mobile)",et]],[Ie,["QQ(Mobile X5)",et]],[fe,["QQ(Mac)",Gt]],[we,["QQ(iPad)",Zt]],[Ue,["MI",Pt]],[Te,["HW",Ht]],[xe,["Samsung",Xt]],[ve,["OPPO",_t]],[Re,["VIVO",$t]],[J,["EDGE",bt]],[ue,["SogouMobile",Ot]],[Ee,["Sogou",Qt]]]),AV=()=>{let V="unknown",e="unknown";return VV.get(!0)&&([V,e]=VV.
<style>${f}</style>
<div class="device-connect">
<div class="testing-title">${this.isChinese?"\u8BBE\u5907\u8FDE\u63A5":"Device Connection"}</div>
<div class="testing-prepare-info"></div>
<div class="device-display">
<!-- 摄像头连接图标 -->
<div class="camerasvg">
<span class="device">
<svg t="1630397874793" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="958" width="24" height="24"><path d="M489.244444 0a460.8 460.8 0 1 1 0 921.6A460.8 460.8 0 0 1 489.244444 0z m0 204.8a256 256 0 1 0 0 512 256 256 0 0 0 0-512z" opacity=".8" p-id="959"></path><path d="M489.244444 460.8m-153.6 0a153.6 153.6 0 1 0 307.2 0 153.6 153.6 0 1 0-307.2 0Z" opacity=".8" p-id="960"></path><path d="M120.604444 952.32a368.64 61.44 0 1 0 737.28 0 368.64 61.44 0 1 0-737.28 0Z" opacity=".8" p-id="961"></path></svg>
</span>
</div>
<!-- 麦克风连接图标 -->
<div class="microphonesvg">
<span class="device">
<svg t="1630397938861" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1205" width="24" height="24"><path d="M841.551448 434.423172A41.666207 41.666207 0 0 1 882.758621 476.548414c0 194.701241-144.454621 355.469241-329.551449 376.514207v86.722207h164.758069a41.666207 41.666207 0 0 1 41.207173 42.089931A41.666207 41.666207 0 0 1 717.965241 1024H306.034759A41.666207 41.666207 0 0 1 264.827586 981.874759a41.666207 41.666207 0 0 1 41.207173-42.089931h164.758069v-86.722207C285.696 832.052966 141.241379 671.249655 141.241379 476.548414a41.666207 41.666207 0 0 1 41.207173-42.125242 41.666207 41.666207 0 0 1 41.171862 42.125242c0 162.78069 129.129931 294.770759 288.379586 294.770758l8.827586-0.141241c155.153655-4.766897 279.552-134.850207 279.552-294.629517a41.666207 41.666207 0 0 1 41.171862-42.125242zM512 0c119.419586 0 216.275862 88.770207 216.275862 198.232276v317.228138c0 106.990345-92.513103 194.206897-208.154483 198.091034l-8.121379 0.141242c-119.419586 0-216.275862-88.770207-216.275862-198.232276V198.232276c0-106.990345 92.513103-194.206897 208.154483-198.091035L512 0z" opacity=".8" p-id="1206"></path></svg>
</span>
</div>
<!-- 扬声器连接图标 -->
<div class="speakersvg">
<span class="device">
<svg t="1629186923749" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2923" width="24" height="24"><path d="M640 181.333333c0-46.037333-54.357333-70.4-88.746667-39.850666L359.552 311.850667a32 32 0 0 1-21.248 8.106666H181.333333A96 96 0 0 0 85.333333 415.957333v191.872a96 96 0 0 0 96 96h157.013334a32 32 0 0 1 21.248 8.106667l191.616 170.410667c34.389333 30.549333 88.789333 6.144 88.789333-39.850667V181.333333z m170.325333 70.272a32 32 0 0 1 44.757334 6.698667A424.917333 424.917333 0 0 1 938.666667 512a424.96 424.96 0 0 1-83.626667 253.696 32 32 0 0 1-51.413333-38.058667A360.917333 360.917333 0 0 0 874.666667 512a360.917333 360.917333 0 0 0-71.04-215.637333 32 32 0 0 1 6.698666-44.757334zM731.434667 357.12a32 32 0 0 1 43.392 12.928c22.869333 42.24 35.84 90.666667 35.84 141.994667a297.514667 297.514667 0 0 1-35.84 141.994666 32 32 0 0 1-56.32-30.464c17.92-33.152 28.16-71.082667 28.16-111.530666s-10.24-78.378667-28.16-111.530667a32 32 0 0 1 12.928-43.392z" opacity=".8" p-id="2924"></path></svg>
</span>
</div>
<!-- 网络连接图标 -->
<div class="networksvg">
<span class="device">
<svg t="1630400570252" class="icon" viewBox="0 0 1291 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1640" width="24" height="24"><path d="M992.211478 583.68A449.758609 449.758609 0 0 0 650.017391 426.295652c-136.904348 0-259.561739 61.039304-342.194087 157.384348a90.156522 90.156522 0 0 0 136.859826 117.359304 269.846261 269.846261 0 0 1 205.334261-94.430608c82.142609 0 155.737043 36.641391 205.334261 94.386087a90.156522 90.156522 0 1 0 136.859826-117.359305zM559.86087 922.134261a90.156522 90.156522 0 1 0 180.313043 0 90.156522 90.156522 0 0 0-180.313043 0z" opacity=".8" p-id="1641"></path><path d="M1253.064348 289.124174A809.316174 809.316174 0 0 0 650.017391 20.613565a809.316174 809.316174 0 0 0-603.046956 268.466087 90.156522 90.156522 0 1 0 127.777391 127.065044l0.311652 0.26713A629.581913 629.581913 0 0 1 650.017391 200.926609c189.395478 0 359.290435 83.389217 474.957913 215.485217l0.267131-0.26713a90.156522 90.156522 0 1 0 127.777391-127.065044z" opacity=".8" p-id="1642"></path></svg>
</span>
</div>
<div class="outer-progress">
<div class="inner-progress"></div>
</div>
</div>
<div class="text gray-text">${this.isChinese?"\u8BBE\u5907\u6B63\u5728\u8FDE\u63A5\u4E2D\uFF0C\u8BF7\u7A0D\u540E":"The device is connecting, please wait"}</div>
<div class="text result" style="display:none">
<span></span>
<div
@touchstart=${()=>this.setShowRemind(!0)}
@mouseenter=${()=>this.setShowRemind(!0)}
@touchend=${()=>this.setShowRemind(!1)}
@mouseleave=${()=>this.setShowRemind(!1)}
style="display:none" class="error-connect">
<span class="error-icon">
<svg t="1626151898274" className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3223" width="28" height="28"><path d="M1024 518.314667C1024 794.794667 794.737778 1024 505.685333 1024 229.205333 1024 0 794.737778 0 518.314667 0 229.262222 229.262222 0 505.685333 0 794.737778 0 1024 229.262222 1024 518.314667zM512 256a48.128 48.128 0 0 0-48.753778 51.370667L477.866667 614.4h68.266666l14.620445-307.029333A48.355556 48.355556 0 0 0 512 256z m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4z" fill="#FF0000" p-id="3224"></path></svg>
</span>
${this.showRemind&&!this.isMobile?q`<div class="connect-attention-info"></div>`:q``}
</div>
</div>
${this.showRemind&&this.isMobile?q`<div class="connect-attention-info"></div>`:q``}
<div class="button-container">
<trtc-custom-button type='disabled' >${this.isChinese?"\u5F00\u59CB\u68C0\u6D4B":"Start detection"}</trtc-custom-button>
</div>
`}setShowRemind(e){this.showRemind=e,this.requestUpdate()}firstUpdated(){this.getDeviceConnectResult(),this.stepNameList=JSON.parse(this.getAttribute("stepnamelist")),this.judgeList(this.stepNameList);let e=this.shadowRoot.querySelector(".testing-prepare-info");e.innerHTML=this.prepareInfo()}updated(){this.showRemind&&(this.shadowRoot.querySelector(".connect-attention-info").innerHTML=this.connectResult.remind)}hasCameraDetect(){return this.stepNameList.indexOf("camera")>=0}hasMicrophoneDetect(){return this.stepNameList.indexOf("microphone")>=0}hasSpeakerDetect(){return this.stepNameList.indexOf("speaker")>=0}hasNetworkDetect(){return this.stepNameList.indexOf("network")>=0}showReconnectButton(){let{deviceState:e}=this;return this.showConnectResult&&!(e.hasCameraConnect&&e.hasMicrophoneConnect&&e.hasSpeakerConnect&&e.hasNetworkConnect)}showStartDetectButton(){let{deviceState:e}=this;return this.showConnectResult&&e.hasCameraConnect&&e.hasMicrophoneConnect&&e.hasSpeakerConnect&&e.hasNetworkConnect}handler(e){let t=this.shadowRoot.querySelector(".inner-progress");e||(this.progressInterval&&clearInterval(this.progressInterval),this.progressInterval=setInterval(()=>{if(this.progress+=10,t.style.transform=`translateX(${this.progress}%)`,this.progress===100){this.progress=0,t.style.transform="translateX(0%)";let i=new CustomEvent("remind-changed",{detail:this.remindAnimation});this.dispatchEvent(i),setTimeout(()=>{this.remindAnimation&&this.isMobile&&(this.isChinese?alert(C.mobileFailAttention.replace(/<br>/g,`
`)):alert(C.mobileFailAttentionEng.replace(/<br>/g,`
`)))},200),this.showConnectResult=!0,this.setAttribute("showconnectresult",this.showConnectResult),clearInterval(this.progressInterval)}},150))}prepareInfo(){return this.isChinese?`\u8BBE\u5907\u68C0\u6D4B\u524D\u8BF7\u786E\u8BA4\u8BBE\u5907\u8FDE\u63A5\u4E86${this.hasCameraDetect()?"\u6444\u50CF\u5934":""}${this.hasMicrophoneDetect()?"\u3001\u9EA6\u514B\u98CE":""}${this.hasSpeakerDetect()?"\u3001\u626C\u58F0\u5668":""}${this.hasNetworkDetect()?"\u548C\u7F51\u7EDC":""}`:`Make sure the device is connected before testing the device ${this.hasCameraDetect()?"camera":""}${this.hasMicrophoneDetect()?", microphone":""}${this.hasSpeakerDetect()?", speaker":""}${this.hasNetworkDetect()?" and network":""}`}judgeList(e){let t=this.shadowRoot.querySelector(".camerasvg"),i=this.shadowRoot.querySelector(".microphonesvg"),A=this.shadowRoot.querySelector(".speakersvg"),o=this.shadowRoot.querySelector(".networksvg");e.indexOf("camera")>=0?t.style.display="block":t.style.display="none",e.indexOf("microphone")>=0?i.style.display="block":i.style.display="none",e.indexOf("speaker")>=0?A.style.display="block":A.style.display="none",e.indexOf("network")>=0?o.style.display="block":o.style.display="none"}async getDeviceConnectResult(){let e=[],t=[],i=[];try{let{cameras:l,speakers:d,microphones:u}=await O();e=l,t=u,i=d}catch(l){}let A=e.length>0,o=t.length>0,s=this.hasSpeakerDetect()?this.isFirefoxOrIOS||i.length>0:!0,n=this.hasNetworkDetect()?await wV():!0,r={hasCameraDevice:A,hasMicrophoneDevice:o,hasSpeakerDevice:s,hasNetworkConnect:n,hasCameraConnect:!1,hasMicrophoneConnect:!1,hasSpeakerConnect:s};this.deviceState=r,this.remindAnimation=!1,this.connectResult=this.getDeviceConnectInfo(r);let p=[];A&&p.push(new Promise((l,d)=>{navigator.mediaDevices.getUserMedia({video:!0,audio:!1}).then(u=>{this.remindAnimation=!1,r=L(F({},r),{hasCameraConnect:!0}),this.deviceState=r,this.connectResult=this.getDeviceConnectInfo(r),u.getTracks()[0].stop(),l()}).catch(u=>{ot(u),l()})})),o&&p.push(new Promise((l,d)=>{navigator.mediaDevices.getUserMedia({video:!1,audio:!0}).then(u=>{this.remindAnimation=!1,r=L(F({},r),{hasMicrophoneConnect:o}),this.deviceState=r,this.connectResult=this.getDeviceConnectInfo(r),u.getTracks()[0].stop(),l()}).catch(u=>{ot(u),l()})})),await Promise.all(p),this.handler(this.showConnectResult)}getDeviceConnectInfo(e){this.remindAnimation=!1;let t="\u8FDE\u63A5\u51FA\u9519\uFF0C\u8BF7\u91CD\u8BD5";return this.isChinese||(t="Connection error, please try again"),e.hasCameraConnect&&e.hasMicrophoneConnect&&e.hasSpeakerConnect&&e.hasNetworkConnect?(this.isChinese?t=this.hasNetworkDetect?"\u8BBE\u5907\u53CA\u7F51\u7EDC\u8FDE\u63A5\u6210\u529F\uFF0C\u8BF7\u5F00\u59CB\u8BBE\u5907\u68C0\u6D4B":"\u8BBE\u5907\u8FDE\u63A5\u6210\u529F\uFF0C\u8BF7\u5F00\u59CB\u8BBE\u5907\u68C0\u6D4B":t=this.hasNetworkDetect?"Device and network connection are successful, start device detection":"Device connection successful, start device detection",{info:t,success:!0}):e.hasCameraDevice&&e.hasMicrophoneDevice&&e.hasSpeakerDevice?e.hasCameraConnect&&e.hasMicrophoneConnect?e.hasNetworkConnect?{info:t,success:!1}:(this.isChinese?t="\u7F51\u7EDC\u8FDE\u63A5\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u8FDE\u63A5":t="Network connection failed, please check network connection",{info:t,success:!1,remind:this.isChinese?C.networkFailAttention:C.networkFailAttentionEng}):(this.isChinese?t=e.hasNetworkConnect?"\u8BF7\u5141\u8BB8\u6D4F\u89C8\u5668\u53CA\u7F51\u9875\u8BBF\u95EE\u6444\u50CF\u5934/\u9EA6\u514B\u98CE\u8BBE\u5907":"\u8BF7\u5141\u8BB8\u6D4F\u89C8\u5668\u53CA\u7F51\u9875\u8BBF\u95EE\u6444\u50CF\u5934/\u9EA6\u514B\u98CE\u8BBE\u5907\uFF0C\u5E76\u68C0\u67E5\u7F51\u7EDC\u8FDE\u63A5":t=e.hasNetworkConnect?"Please allow browser and web access to camera/microphone devices":"Please allow browser and web access to camera/microphone devices, and check the network connection",this.remindAnimation=!0,{info:t,success:!1,remind:this.isMobile?this.isChinese?C.mobileFailAttention:C.mobileFailAttentionEng:this.isChinese?C.deviceFailAttention:C.deviceFailAttentionEng}):(this.isChine
<style>${f}</style>
<div>
<select class="device-select" value=${this.activeDeviceId} @change=${this.handleChange}>
${this.deviceList.map((e,t)=>q`<option value=${e.deviceId} key=${t}>${e.label}</option>`)}
</select>
</div>
`}};h(Ae,"properties",{deviceType:{type:String},onChange:{type:Function},choseDevice:{type:Object}});customElements.get("trtc-device-select")||customElements.define("trtc-device-select",Ae);var xV=async V=>{let e=[];switch(V){case"camera":e=(await CV()).cameraList;break;case"microphone":e=(await IV()).microphoneList;break;case"speaker":e=await SV();break;default:break}return e};var oe=class extends E{constructor(){super();h(this,"handleCameraChange",async t=>{var s;this.choseDevice=t;let{deviceId:i,label:A}=t,o=this.shadowRoot.querySelector("video");this.localStream?((s=this.localStream)==null||s.getTracks().forEach(n=>n.stop()),this.initStream(i)):this.initStream(i),this.cameraID=i,this.cameraLabel=A,this.device=t});this.currentDetector="camera",this.localStream=null,this.cameraLabel="",this.cameraID="",this.choseDevice=null,this.device=null;let t=navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||"en";this.isChinese=t.indexOf("zh")>-1,this.attachShadow({mode:"open"})}async initStream(t){let i=this.shadowRoot.querySelector("video");i.addEventListener("touchstart",o=>{o.preventDefault()});let A={video:{deviceId:{exact:t}},audio:!1};navigator.mediaDevices.getUserMedia(A).then(o=>{this.localStream=o,i.srcObject=o,i.play})}handleError(){var i;m&&m.warn("CameraFail",this.device),this.handleComplete("error",this.cameraLabel,!1,this.device);let t=new Date().getTime();(i=this.localStream)==null||i.getTracks().forEach(A=>A.stop()),g&&g.kvStatManager.addFailedEvent({key:591706,error:t-this.constructTime})}handleSuccess(){var i;this.handleComplete("success",this.cameraLabel,!0,this.device);let t=new Date().getTime();(i=this.localStream)==null||i.getTracks().forEach(A=>A.stop()),g&&g.kvStatManager.addSuccessEvent({key:591705,cost:t-this.constructTime})}firstUpdated(){}updated(t){t.has("activeDetector")&&this.activeDetector===this.currentDetector&&!this.localStream&&this.cameraID&&this.initStream(this.cameraID)}render(){return q`
<style>${f}</style>
<div ?if=${this.activeDetector===this.currentDetector} class="testing-body">
<div class="device-list">
<span class="device-list-title">${this.isChinese?"\u6444\u50CF\u5934\u9009\u62E9":"Camera Selection"}</span>
<trtc-device-select deviceType="camera" .choseDevice=${this.choseDevice} .onChange=${this.handleCameraChange}></trtc-device-select>
</div>
<video id="camera-video" class="camera-video" autoplay x5-playsinline="true" playsinline="true" webkit-playsinline="true" x-webkit-airplay="true" x5-video-orientation="portraint"></video>
<div class="testing-info-container">
<div class="testing-info">${this.isChinese?"\u662F\u5426\u53EF\u4EE5\u6E05\u695A\u5730\u770B\u5230\u81EA\u5DF1\uFF1F":"Can you see yourself clearly?"}</div>
<div class="button-list">
<trtc-custom-button type="outlined" @click=${this.handleError}>${this.isChinese?"\u770B\u4E0D\u5230":"No"}</trtc-custom-button>
<trtc-custom-button type="contained" @click=${this.handleSuccess}>${this.isChinese?"\u770B\u7684\u5230":"Yes"}</trtc-custom-button>
</div>
</div>
</div>
`}};h(oe,"properties",{activeDetector:{type:String},handleComplete:{type:Function},constructTime:{type:Number}});customElements.get("trtc-camera-detector")||customElements.define("trtc-camera-detector",oe);var se=class extends E{constructor(){super();h(this,"handleMicrophoneChange",async t=>{this.choseDevice=t;let{deviceId:i,label:A}=t;this.localStream?(this.localStream.getTracks().forEach(o=>o.stop()),this.timer&&clearInterval(this.timer),this.initStream(i)):this.initStream(i),this.microphoneID=i,this.microphoneLabel=A,this.device=t});this.currentDetector="microphone",this.localStream=null,this.microphoneID="",this.microphoneLabel="",this.volumeNum=0,this.choseDevice=null,this.timer=null,this.time=null,this.recording=!1,this.recordingTime=0,this.audioURL="",this.recorder=null,this.chunks=[],this.disconnect=!1,this.device=null;let t=navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||"en";this.isChinese=t.indexOf("zh")>-1,this.attachShadow({mode:"open"})}updated(t){var i;t.has("activeDetector")&&this.activeDetector===this.currentDetector&&!this.localStream&&this.microphoneID&&this.initStream(this.microphoneID),this.activeDetector!==this.currentDetector&&((i=this.localStream)==null||i.getTracks().forEach(A=>{A.stop()}),this.timer&&clearInterval(this.timer))}handleError(){var i;m&&m.warn("MicphoneFail",this.device);let t=new Date().getTime();g&&g.kvStatManager.addFailedEvent({key:591708,error:t-this.constructTime}),this.handleComplete("error",this.microphoneLabel,!1,this.device,this.audioURL),(i=this.localStream)==null||i.getTracks().forEach(A=>{A.stop()}),this.timer&&clearInterval(this.timer)}handleSuccess(){var i;let t=new Date().getTime();g&&g.kvStatManager.addSuccessEvent({key:591707,cost:t-this.constructTime}),this.handleComplete("success",this.microphoneLabel,!0,this.device,this.audioURL),(i=this.localStream)==null||i.getTracks().forEach(A=>{A.stop()}),this.timer&&clearInterval(this.timer)}firstUpdated(){}async initStream(t){this.localStream=await navigator.mediaDevices.getUserMedia({audio:{deviceId:t},video:!1});let i=new AudioContext,A=i.createAnalyser(),o=i.createMediaStreamSource(this.localStream);A.smoothingTimeConstant=.8,A.fftSize=1024,o.connect(A),this.timer=setInterval(()=>{let s=new Uint8Array(A.fftSize);A.getByteTimeDomainData(s);let n=0,{length:r}=s;for(let d=0;d<r;d++)n+=s[d];let l=(n/r-128)/128;this.volumeNum=Math.round(Math.abs(l*28)*50),this.requestUpdate()},100)}handleRecordClick(){let t=this.shadowRoot.querySelector(".recordingbutton");this.recording?(t.setAttribute("type","outlined"),this.recording=!1,this.recordingStartTime=null,this.time&&clearInterval(this.time),this.recorder.stop()):(t.setAttribute("type","contained"),this.recording=!0,this.recordingStartTime=Date.now(),this.recordingTime=0,this.time=setInterval(()=>{this.recordingTime=((Date.now()-this.recordingStartTime)/1e3).toFixed(2)},100),this.startRecording())}startRecording(){this.localStream&&(this.recording=!0,this.recorder=new MediaRecorder(this.localStream),this.recorder.start(),this.recorder.ondataavailable=t=>{this.chunks.push(t.data)},this.recorder.onstop=()=>{let t=new Blob(this.chunks,{type:"audio/ogg; codecs=opus"});this.audioURL=window.URL.createObjectURL(t)})}disconnectedCallback(){this.localStream&&this.localStream.getTracks().forEach(t=>{t.stop()}),this.timer&&clearInterval(this.timer),this.disconnect=!0,this.remove()}render(){return this.disconnect&&this.timer&&clearInterval(this.timer),this.activeDetector===this.currentDetector?q`
<style>${f}</style>
<div class="testing-body">
<div class="device-list">
<span class="device-list-title">${this.isChinese?"\u9EA6\u514B\u98CE\u9009\u62E9":"Microphone Selection"}</span>
<trtc-device-select deviceType="microphone" .choseDevice=${this.choseDevice} .onChange=${this.handleMicrophoneChange}></trtc-device-select>
</div>
<div class="mic-testing-container">
<div class="mic-testing-info">${this.isChinese?'\u5BF9\u7740\u9EA6\u514B\u98CE\u8BF4"\u54C8\u55BD"\u8BD5\u8BD5\uFF5E':'Try saying "Hello" into the microphone'}</div>
<div class="mic-bar-container">
${Array.from({length:28},(t,i)=>q`<div class="${`mic-bar ${this.volumeNum>i&&"active"}`}"></div>`)}
</div>
<div id="audio-container"></div>
</div>
<div class="testing-info-container">
<div class="testing-info">${this.isChinese?"\u662F\u5426\u53EF\u4EE5\u770B\u5230\u97F3\u91CF\u56FE\u6807\u8DF3\u52A8\uFF1F":"Can see the volume icon bounce?"}</div>
<div class="button-list">
<trtc-custom-button type="outlined" @click=${this.handleError}>${this.isChinese?"\u770B\u4E0D\u5230":"No"}</trtc-custom-button>
<trtc-custom-button type="contained" @click=${this.handleSuccess}>${this.isChinese?"\u770B\u7684\u5230":"Yes"}</trtc-custom-button>
</div>
</div>
</div>
`:q``}};h(se,"properties",{activeDetector:{type:String},handleComplete:{type:Function},constructTime:{type:Number}});customElements.get("trtc-mic-detector")||customElements.define("trtc-mic-detector",se);var re=class extends E{constructor(){super();h(this,"handleSpeakerChange",async t=>{var o,s;this.choseDevice=t;let{deviceId:i,label:A}=t;this.audioPlayer&&i&&await((s=(o=this.audioPlayer).setSinkId)==null?void 0:s.call(o,i)),this.audioPlayer.src=this.audioUrl,this.speakerLabel=A,this.device=t});this.audioPlayer=null,this.currentDetector="speaker",this.speakerLabel="",this.audioUrl="",this.choseDevice=null;let t=navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||"en";this.isChinese=t.indexOf("zh")>-1,this.attachShadow({mode:"open"})}firstUpdated(){}updated(t){t.has("activeDetector")&&(this.activeDetector===this.currentDetector&&(this.audioPlayer=this.shadowRoot.getElementById("audio-player")),t.get("activeDetector")===this.currentDetector&&(this.audioPlayer&&!this.audioPlayer.paused&&this.audioPlayer.pause(),this.audioPlayer&&(this.audioPlayer.currentTime=0)))}handleError(){m&&m.warn("SpeakerFail",this.device);let t=new Date().getTime();g&&g.kvStatManager.addFailedEvent({key:591710,error:t-this.constructTime}),this.handleComplete("error",this.speakerLabel,!1,this.device)}handleSuccess(){this.handleComplete("success",this.speakerLabel,!0,this.device);let t=new Date().getTime();g&&g.kvStatManager.addSuccessEvent({key:591709,cost:t-this.constructTime})}render(){return this.activeDetector===this.currentDetector?q`
<style>${f}</style>
<div class="testing-body">
<div class="device-list">
<span class="device-list-title">${this.isChinese?"\u626C\u58F0\u5668\u9009\u62E9":"Speaker Selection"}</span>
<trtc-device-select deviceType="speaker" .choseDevice=${this.choseDevice} .onChange=${this.handleSpeakerChange}></trtc-device-select>
</div>
<div class="audio-player-container">
<div class="audio-player-info">${this.isChinese?"\u8BF7\u8C03\u9AD8\u8BBE\u5907\u97F3\u91CF\uFF0C\u70B9\u51FB\u64AD\u653E\u4E0B\u9762\u7684\u97F3\u9891\u8BD5\u8BD5\uFF5E":"Please turn up the volume on your device and click Play the audio below to try it out"}</div>
<audio id="audio-player" src=${this.audioUrl} controls ></audio>
</div>
<div class="testing-info-container">
<div class="testing-info">${this.isChinese?"\u662F\u5426\u53EF\u4EE5\u542C\u5230\u58F0\u97F3\uFF1F":"Can you hear the sound?"}</div>
<div class="button-list">
<trtc-custom-button type="outlined" @click=${this.handleError}>${this.isChinese?"\u542C\u4E0D\u5230":"No"}</trtc-custom-button>
<trtc-custom-button type="contained" @click=${this.handleSuccess}>${this.isChinese?"\u542C\u7684\u5230":"Yes"}</trtc-custom-button>
</div>
</div>
</div>
`:q``}};h(re,"properties",{audioUrl:{type:String},activeDetector:String,handleComplete:Function,constructTime:{type:Number}});customElements.get("trtc-speaker-detector")||customElements.define("trtc-speaker-detector",re);var ne=class extends E{constructor(){super(),this.NETWORK_QUALITY={},this.currentDetector="network",this.detectorInfo={},this.count=15,this.timer=null,this.networkInfo=null,this.testResult={uplinkNetworkQualities:[],downlinkNetworkQualities:[],rttList:[],average:{uplinkNetworkQuality:0,downlinkNetworkQuality:0,rtt:0},result:{rtt:0,quality:0}},this._initializeTRTC(),this.isDownlink=!1,this.networkInfo&&this.networkInfo.downlinkUserId&&this.networkInfo.downlinkUserSig&&(this.isDownlink=!0),this.Enum={0:"0\uFF1A\u7F51\u7EDC\u72B6\u51B5\u672A\u77E5",1:"1\uFF1A\u7F51\u7EDC\u72B6\u51B5\u6781\u4F73",2:"2\uFF1A\u7F51\u7EDC\u72B6\u51B5\u8F83\u597D",3:"3\uFF1A\u7F51\u7EDC\u72B6\u51B5\u4E00\u822C",4:"4\uFF1A\u7F51\u7EDC\u72B6\u51B5\u8F83\u5DEE",5:"5\uFF1A\u7F51\u7EDC\u72B6\u51B5\u6781\u5DEE",6:"6\uFF1A\u7F51\u7EDC\u8FDE\u63A5\u65AD\u5F00"},this.EnumEng={0:"0: unknown",1:"1: excellent",2:"2: good",3:"3: fair",4:"4: poor",5:"5: very poor",6:"6: disconnected"};let e=navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||"en";this.isChinese=e.indexOf("zh")>-1,this.attachShadow({mode:"open"})}_initializeTRTC(){this.networkInfo=S.networkInfo,Object.defineProperty(S,"networkInfo",{set:e=>{this.networkInfo=e},get:()=>this.networkInfo})}firstUpdated(){}updated(e){e.has("activeDetector")&&this.activeDetector===this.currentDetector&&this.count!==0&&(this.count=15,this.getDetectorInfo())}async testUplinkNetworkQuality(){let{sdkAppId:e,uplinkTRTC:t,userId:i,userSig:A,roomId:o}=this.networkInfo;try{await t.exitRoom()}catch(s){}await t.enterRoom({roomId:o||8080,sdkAppId:e,userId:i,userSig:A,scene:"rtc"}),!this.hasStartLocalVideo&&await t.startLocalVideo({option:{profile:"480p"}}),this.setHasStartLocalVideo(),this.hasStartLocalVideo=!0,t.on(g.TRTC.EVENT.NETWORK_QUALITY,s=>{let{uplinkNetworkQuality:n,uplinkRTT:r}=s;this.testResult.uplinkNetworkQualities.push(n),this.testResult.rttList.push(r)})}async testDownlinkNetworkQuality(){let{sdkAppId:e,downlinkUserId:t,downlinkTRTC:i,downlinkUserSig:A,roomId:o}=this.networkInfo;try{await i.exitRoom()}catch(s){}await i.enterRoom({roomId:o||8080,sdkAppId:e,userId:t,userSig:A,scene:"rtc"}),i.on(g.TRTC.EVENT.NETWORK_QUALITY,s=>{let{downlinkNetworkQuality:n}=s;this.testResult.downlinkNetworkQualities.push(n)})}async getDetectorInfo(){let e=S.getSystem(),t=await S.isTRTCSupported(),i=S.getAPISupported();this.detectorInfo={system:e.OS,browser:`${e.browser.name} ${e.browser.version}`,TRTCSupport:t.result?"Yes":"No",screenMediaSupport:i.isScreenCaptureAPISupported?"Yes":"No"},this.timer=setInterval(()=>{this.count=this.count-1,this.requestUpdate(),this.count===0&&clearInterval(this.timer)},1e3),this.testUplinkNetworkQuality(),this.isDownlink&&this.testDownlinkNetworkQuality(),setTimeout(async()=>{this.testResult.uplinkNetworkQualities.length>0&&(this.testResult.average.uplinkNetworkQuality=Math.ceil(this.testResult.uplinkNetworkQualities.reduce((A,o)=>A+o,0)/this.testResult.uplinkNetworkQualities.length)),this.testResult.downlinkNetworkQualities.length>0&&(this.testResult.average.downlinkNetworkQuality=Math.ceil(this.testResult.downlinkNetworkQualities.reduce((A,o)=>A+o,0)/this.testResult.downlinkNetworkQualities.length)),this.testResult.rttList.length>0&&(this.testResult.average.rtt=Math.ceil(this.testResult.rttList.reduce((A,o)=>A+o,0)/this.testResult.rttList.length)),this.testResult.average.uplinkNetworkQuality===0||this.isDownlink&&this.testResult.average.downlinkNetworkQuality===0?this.testResult.result.quality=0:this.testResult.result.quality=Math.max(this.testResult.average.uplinkNetworkQuality,this.testResult.average.downlinkNetworkQuality),this.testResult.result.rtt=this.testResult.average.rtt,this.requestUpdate(),await this.networkInfo.uplinkTRTC.stopLocalVideo(),this.networkInfo.uplinkTRTC.exitRoom(),this.isDownlink&&this.networkInfo.down
<style>${f}</style>
<div class="testing-body">
<div class="testing-list">
<div class="testing-item-container">
<div>${this.isChinese?"\u64CD\u4F5C\u7CFB\u7EDF":"Operating System"}</div>
<div class=${this.detectorInfo.system?"":"network-loading"}>
${this.detectorInfo.system}
</div>
</div>
<div class="testing-item-container">
<div>${this.isChinese?"\u6D4F\u89C8\u5668":"Browser"}</div>
<div class=${this.detectorInfo.browser?"":"network-loading"}>
${this.detectorInfo.browser}
</div>
</div>
<div class="testing-item-container">
<div>${this.isChinese?"\u662F\u5426\u652F\u6301TRTC":"Whether TRTC is supported"}</div>
<div class=${this.detectorInfo.TRTCSupport?"":"network-loading"}>
${this.detectorInfo.TRTCSupport}
</div>
</div>
<div class="testing-item-container">
<div>${this.isChinese?"\u662F\u5426\u652F\u6301\u5C4F\u5E55\u5206\u4EAB":"Whether screen sharing is supported"}</div>
<div class=${this.detectorInfo.screenMediaSupport?"":"network-loading"}>
${this.detectorInfo.screenMediaSupport}
</div>
</div>
<div class="testing-item-container">
<div>${this.isChinese?"\u7F51\u7EDC\u5EF6\u65F6":"Network delay"}</div>
<div class=${this.testResult.average.rtt?"":"network-loading"}>
${this.testResult.average.rtt?`${this.testResult.average.rtt}ms`:""}
</div>
</div>
<div class="testing-item-container">
<div>${this.isChinese?"\u7F51\u7EDC\u8D28\u91CF":"Network quality"}</div>
<div class=${this.testResult.average.uplinkNetworkQuality?"":"network-loading"}>
${this.testResult.average.uplinkNetworkQuality?this.isChinese?this.Enum[this.testResult.result.quality]:this.EnumEng[this.testResult.result.quality]:""}
</div>
</div>
</div>
${this.count>0?q`<trtc-custom-button class="gray-button" type="disabled">${this.isChinese?"\u5269\u4F59\u68C0\u6D4B\u65F6\u95F4":"Remaining time"}${this.count}s</trtc-custom-button>`:q`<trtc-custom-button class="report-button" type="contained" @click=${e=>{this.handleSuccess()}}>${this.isChinese?"\u67E5\u770B\u68C0\u6D4B\u62A5\u544A":"View detect report"}</trtc-custom-button>`}
</div>
`:q``}};h(ne,"properties",{activeDetector:String,networkDetectInfo:Object,handleComplete:Function,generateReport:Function,testResult:Object,hasStartLocalVideo:Boolean,setHasStartLocalVideo:Function,constructTime:Number});customElements.get("trtc-network-detector")||customElements.define("trtc-network-detector",ne);var ae=class extends E{constructor(){super();let e=navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||"en";this.isChinese=e.indexOf("zh")>-1,this.attachShadow({mode:"open"})}render(){return q`
<style>${f}</style>
<div class="device-testing-report">
<div class="testing-title">${this.isChinese?"\u68C0\u6D4B\u62A5\u544A":"Detect Report"}</div>
<div class="device-report-list">
<div class="device-report">
<div class="device-info">
<span class="report-icon">
<!-- 摄像头图标 -->
<svg t="1630397874793" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="958" width="24" height="24"><path d="M489.244444 0a460.8 460.8 0 1 1 0 921.6A460.8 460.8 0 0 1 489.244444 0z m0 204.8a256 256 0 1 0 0 512 256 256 0 0 0 0-512z" fill="#47494D" opacity=".8" p-id="959"></path><path d="M489.244444 460.8m-153.6 0a153.6 153.6 0 1 0 307.2 0 153.6 153.6 0 1 0-307.2 0Z" fill="#47494D" opacity=".8" p-id="960"></path><path d="M120.604444 952.32a368.64 61.44 0 1 0 737.28 0 368.64 61.44 0 1 0-737.28 0Z" fill="#47494D" opacity=".8" p-id="961"></path></svg>
</span>
<div class="device-name">${this.reportData.camera.result}</div>
</div>
<div class="${this.reportData.camera.type==="success"?"green":"red"}">
${this.reportData.camera.type==="success"?this.isChinese?"\u6B63\u5E38":"normal":this.isChinese?"\u5F02\u5E38":"abnormal"}
</div>
</div>
<div class="device-report">
<div class="device-info">
<span class="report-icon">
<!-- 麦克风图标 -->
<svg t="1630397938861" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1205" width="24" height="24"><path d="M841.551448 434.423172A41.666207 41.666207 0 0 1 882.758621 476.548414c0 194.701241-144.454621 355.469241-329.551449 376.514207v86.722207h164.758069a41.666207 41.666207 0 0 1 41.207173 42.089931A41.666207 41.666207 0 0 1 717.965241 1024H306.034759A41.666207 41.666207 0 0 1 264.827586 981.874759a41.666207 41.666207 0 0 1 41.207173-42.089931h164.758069v-86.722207C285.696 832.052966 141.241379 671.249655 141.241379 476.548414a41.666207 41.666207 0 0 1 41.207173-42.125242 41.666207 41.666207 0 0 1 41.171862 42.125242c0 162.78069 129.129931 294.770759 288.379586 294.770758l8.827586-0.141241c155.153655-4.766897 279.552-134.850207 279.552-294.629517a41.666207 41.666207 0 0 1 41.171862-42.125242zM512 0c119.419586 0 216.275862 88.770207 216.275862 198.232276v317.228138c0 106.990345-92.513103 194.206897-208.154483 198.091034l-8.121379 0.141242c-119.419586 0-216.275862-88.770207-216.275862-198.232276V198.232276c0-106.990345 92.513103-194.206897 208.154483-198.091035L512 0z" fill="#47494D" opacity=".8" p-id="1206"></path></svg>
</span>
<div class="device-name">${this.reportData.microphone.result}</div>
</div>
<div class="${this.reportData.microphone.type==="success"?"green":"red"}">
${this.reportData.microphone.type==="success"?this.isChinese?"\u6B63\u5E38":"normal":this.isChinese?"\u5F02\u5E38":"abnormal"}
</div>
</div>
${this.reportData.speaker?q`
<div class="device-report">
<div class="device-info">
<span class="report-icon">
<!-- 扬声器图标 -->
<svg t="1629186923749" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2923" width="24" height="24"><path d="M640 181.333333c0-46.037333-54.357333-70.4-88.746667-39.850666L359.552 311.850667a32 32 0 0 1-21.248 8.106666H181.333333A96 96 0 0 0 85.333333 415.957333v191.872a96 96 0 0 0 96 96h157.013334a32 32 0 0 1 21.248 8.106667l191.616 170.410667c34.389333 30.549333 88.789333 6.144 88.789333-39.850667V181.333333z m170.325333 70.272a32 32 0 0 1 44.757334 6.698667A424.917333 424.917333 0 0 1 938.666667 512a424.96 424.96 0 0 1-83.626667 253.696 32 32 0 0 1-51.413333-38.058667A360.917333 360.917333 0 0 0 874.666667 512a360.917333 360.917333 0 0 0-71.04-215.637333 32 32 0 0 1 6.698666-44.757334zM731.434667 357.12a32 32 0 0 1 43.392 12.928c22.869333 42.24 35.84 90.666667 35.84 141.994667a297.514667 297.514667 0 0 1-35.84 141.994666 32 32 0 0 1-56.32-30.464c17.92-33.152 28.16-71.082667 28.16-111.530666s-10.24-78.378667-28.16-111.530667a32 32 0 0 1 12.928-43.392z" fill="#47494D" opacity=".8" p-id="2924"></path></svg>
</span>
<div class="device-name">${this.reportData.speaker.result}</div>
</div>
<div class="${this.reportData.speaker.type==="success"?"green":"red"}">
${this.reportData.speaker.type==="success"?this.isChinese?"\u6B63\u5E38":"normal":this.isChinese?"\u5F02\u5E38":"abnormal"}
</div>
</div>`:""}
${this.reportData.network?q`
<div class="device-report">
<div class="device-info">
<span class="report-icon">
<!-- 网络图标 -->
<svg t="1630400570252" class="icon" viewBox="0 0 1291 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1640" width="24" height="24"><path d="M992.211478 583.68A449.758609 449.758609 0 0 0 650.017391 426.295652c-136.904348 0-259.561739 61.039304-342.194087 157.384348a90.156522 90.156522 0 0 0 136.859826 117.359304 269.846261 269.846261 0 0 1 205.334261-94.430608c82.142609 0 155.737043 36.641391 205.334261 94.386087a90.156522 90.156522 0 1 0 136.859826-117.359305zM559.86087 922.134261a90.156522 90.156522 0 1 0 180.313043 0 90.156522 90.156522 0 0 0-180.313043 0z" fill="#47494D" opacity=".8" p-id="1641"></path><path d="M1253.064348 289.124174A809.316174 809.316174 0 0 0 650.017391 20.613565a809.316174 809.316174 0 0 0-603.046956 268.466087 90.156522 90.156522 0 1 0 127.777391 127.065044l0.311652 0.26713A629.581913 629.581913 0 0 1 650.017391 200.926609c189.395478 0 359.290435 83.389217 474.957913 215.485217l0.267131-0.26713a90.156522 90.156522 0 1 0 127.777391-127.065044z" fill="#47494D" opacity=".8" p-id="1642"></path></svg>
</span>
<div class="device-name">${this.isChinese?"\u7F51\u7EDC\u5EF6\u65F6":"Network delay"}</div>
</div>
<div class="${this.reportData.network.result.rtt<=200?"green":"red"}">
${this.reportData.network.result.rtt}ms
</div>
</div>
<div class="device-report">
<div class="device-info">
<span class="report-icon">
<!-- 网络图标 -->
<svg t="1630400570252" class="icon" viewBox="0 0 1291 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1640" width="24" height="24"><path d="M992.211478 583.68A449.758609 449.758609 0 0 0 650.017391 426.295652c-136.904348 0-259.561739 61.039304-342.194087 157.384348a90.156522 90.156522 0 0 0 136.859826 117.359304 269.846261 269.846261 0 0 1 205.334261-94.430608c82.142609 0 155.737043 36.641391 205.334261 94.386087a90.156522 90.156522 0 1 0 136.859826-117.359305zM559.86087 922.134261a90.156522 90.156522 0 1 0 180.313043 0 90.156522 90.156522 0 0 0-180.313043 0z" fill="#47494D" opacity=".8" p-id="1641"></path><path d="M1253.064348 289.124174A809.316174 809.316174 0 0 0 650.017391 20.613565a809.316174 809.316174 0 0 0-603.046956 268.466087 90.156522 90.156522 0 1 0 127.777391 127.065044l0.311652 0.26713A629.581913 629.581913 0 0 1 650.017391 200.926609c189.395478 0 359.290435 83.389217 474.957913 215.485217l0.267131-0.26713a90.156522 90.156522 0 1 0 127.777391-127.065044z" fill="#47494D" opacity=".8" p-id="1642"></path></svg>
</span>
<div class="device-name">${this.isChinese?"\u7F51\u7EDC\u8D28\u91CF":"Network quality"}</div>
</div>
<div class="${this.goodUplinkQuality?"green":"red"}">
${this.isChinese?UV[this.reportData.network.result.quality]:TV[this.reportData.network.result.quality]}
</div>
</div>
`:""}
</div>
<div class="device-report-footer">
<trtc-custom-button type="outlined" @click=${this.handleReset}>${this.isChinese?"\u91CD\u65B0\u68C0\u6D4B":"Detect Again"}</trtc-custom-button>
<trtc-custom-button type="contained" @click=${this.handleClose}>${this.isChinese?"\u5B8C\u6210\u68C0\u6D4B":"Completed"}</trtc-custom-button>
</div>
</div>
`}firstUpdated(){}goodUplinkQuality(){return this.reportData.network.result.uplinkQuality>0&&this.reportData.network.result.uplinkQuality<4}goodDownlinkQuality(){return this.reportData.network.result.downlinkQuality>0&&this.reportData.network.result.downlinkQuality<4}};h(ae,"properties",{reportData:Object,handleReset:Function,handleClose:Function});customElements.get("trtc-detect-report")||customElements.define("trtc-detect-report",ae);var R=class R extends E{constructor(){super();h(this,"detectResult");h(this,"handleCompleted",(t,i,A=!1,o=null,s="")=>{this.completed[this.stepNameList[this.activeStep]]={completed:!0,type:t,result:i},this.stepNameList[this.activeStep]==="network"?this.completedResult[this.stepNameList[this.activeStep]]={isSuccess:A,result:i}:this.completedResult[this.stepNameList[this.activeStep]]={isSuccess:A,device:o},s.length!==0&&(this.audioURL=s),this.activeStep<=this.stepNameList.length-1&&(this.activeStep=this.activeStep+1,this.stepNameList.indexOf("network")<0&&this.activeStep===this.stepNameList.length&&(this.detectStage=2)),this.requestUpdate()});this.stepNameList=["camera","microphone","speaker"];let t=navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||"en";this.isChinese=t.indexOf("zh")>-1,this.detectStage=0,this.completed={},this.completedResult={},this.activeStep=0,this.audioURL="",this.isCompleted=!1,this.baseURL="data:audio/mp3;base64,",this.isChinese?this.audioURL=this.baseURL+ti:this.audioURL=this.baseURL+Vi,this.uplinkTRTC={},this.sdkAppId=0,this.isOpen=!0,this.hasStartLocalVideo=!1,this.remind=!1,this.envresult=S.getSystem(),this.isMobile=this.envresult.OS==="iOS"||this.envresult.OS==="Android",this.constructTime=new Date().getTime(),this.cameraHasBeenActive=!1,this.microphoneHasBeenActive=!1,this.SpeakerHasBeenActive=!1,this.networkHasBeenActive=!1,this._initializeTRTC(),this.attachShadow({mode:"open"})}triggerCompletedEvent(){let t=new Event("detectorCompleted");this.dispatchEvent(t)}static registerTag(){customElements.get("detector-element")||customElements.define("detector-element",R)}_initializeTRTC(){let t=S.networkInfo;S.networkInfo&&this.stepNameList.indexOf("network")<0&&this.stepNameList.push("network"),Object.defineProperty(S,"networkInfo",{set:i=>{this.stepNameList.indexOf("network")<0&&this.stepNameList.push("network"),t=i},get:()=>t})}render(){return this.isOpen===!0?q`
<style>${f}</style>
${this.remind===!0&&this.envresult.OS!=="iOS"&&this.envresult.OS!=="Android"?q`
<div class="arrow"></div>
<div class="remind-text"> </div>`:q``}
<div class="device-detector-backdrop">
<div class="root">
${this.detectStage===0?q`
<trtc-custom-button type="outlined" class="close" @click=${this.handleClose}>${this.isChinese?"\u8DF3\u8FC7\u68C0\u6D4B":"Skip Detection"}</trtc-custom-button>
<trtc-device-connect class="myconnect" stepnamelist=${JSON.stringify(this.stepNameList)} @remind-changed=${this.handleRemindChange}
@click=${t=>{let i=t.target.getAttribute("connectstage");if(i&&i.includes("1")){this.setDetectStage();let A=new Date().getTime();g&&g.kvStatManager.addSuccessEvent({key:591703,cost:A-this.constructTime})}}}></trtc-device-connect>`:q``}
${this.detectStage===1?q`
<div class="step-container">
${this.stepNameList.map((t,i)=>q`
<div
@click="${()=>this.handleStep(i)}"
class="step ${[this.getLableClassName(i)]}">
<span class="step-icon">
${t==="camera"?q`<svg t="1630397874793" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="958" width="24" height="24"><path d="M489.244444 0a460.8 460.8 0 1 1 0 921.6A460.8 460.8 0 0 1 489.244444 0z m0 204.8a256 256 0 1 0 0 512 256 256 0 0 0 0-512z" opacity=".8" p-id="959"></path><path d="M489.244444 460.8m-153.6 0a153.6 153.6 0 1 0 307.2 0 153.6 153.6 0 1 0-307.2 0Z" opacity=".8" p-id="960"></path><path d="M120.604444 952.32a368.64 61.44 0 1 0 737.28 0 368.64 61.44 0 1 0-737.28 0Z" opacity=".8" p-id="961"></path></svg>
`:q``}
${t==="microphone"?q`<svg t="1630397938861" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1205" width="24" height="24"><path d="M841.551448 434.423172A41.666207 41.666207 0 0 1 882.758621 476.548414c0 194.701241-144.454621 355.469241-329.551449 376.514207v86.722207h164.758069a41.666207 41.666207 0 0 1 41.207173 42.089931A41.666207 41.666207 0 0 1 717.965241 1024H306.034759A41.666207 41.666207 0 0 1 264.827586 981.874759a41.666207 41.666207 0 0 1 41.207173-42.089931h164.758069v-86.722207C285.696 832.052966 141.241379 671.249655 141.241379 476.548414a41.666207 41.666207 0 0 1 41.207173-42.125242 41.666207 41.666207 0 0 1 41.171862 42.125242c0 162.78069 129.129931 294.770759 288.379586 294.770758l8.827586-0.141241c155.153655-4.766897 279.552-134.850207 279.552-294.629517a41.666207 41.666207 0 0 1 41.171862-42.125242zM512 0c119.419586 0 216.275862 88.770207 216.275862 198.232276v317.228138c0 106.990345-92.513103 194.206897-208.154483 198.091034l-8.121379 0.141242c-119.419586 0-216.275862-88.770207-216.275862-198.232276V198.232276c0-106.990345 92.513103-194.206897 208.154483-198.091035L512 0z" opacity=".8" p-id="1206"></path></svg>
`:q``}
${t==="speaker"?q`<svg t="1629186923749" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2923" width="24" height="24"><path d="M640 181.333333c0-46.037333-54.357333-70.4-88.746667-39.850666L359.552 311.850667a32 32 0 0 1-21.248 8.106666H181.333333A96 96 0 0 0 85.333333 415.957333v191.872a96 96 0 0 0 96 96h157.013334a32 32 0 0 1 21.248 8.106667l191.616 170.410667c34.389333 30.549333 88.789333 6.144 88.789333-39.850667V181.333333z m170.325333 70.272a32 32 0 0 1 44.757334 6.698667A424.917333 424.917333 0 0 1 938.666667 512a424.96 424.96 0 0 1-83.626667 253.696 32 32 0 0 1-51.413333-38.058667A360.917333 360.917333 0 0 0 874.666667 512a360.917333 360.917333 0 0 0-71.04-215.637333 32 32 0 0 1 6.698666-44.757334zM731.434667 357.12a32 32 0 0 1 43.392 12.928c22.869333 42.24 35.84 90.666667 35.84 141.994667a297.514667 297.514667 0 0 1-35.84 141.994666 32 32 0 0 1-56.32-30.464c17.92-33.152 28.16-71.082667 28.16-111.530666s-10.24-78.378667-28.16-111.530667a32 32 0 0 1 12.928-43.392z" opacity=".8" p-id="2924"></path></svg>
`:q``}
${t==="network"?q`<svg t="1630400570252" class="icon" viewBox="0 0 1291 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1640" width="24" height="24"><path d="M992.211478 583.68A449.758609 449.758609 0 0 0 650.017391 426.295652c-136.904348 0-259.561739 61.039304-342.194087 157.384348a90.156522 90.156522 0 0 0 136.859826 117.359304 269.846261 269.846261 0 0 1 205.334261-94.430608c82.142609 0 155.737043 36.641391 205.334261 94.386087a90.156522 90.156522 0 1 0 136.859826-117.359305zM559.86087 922.134261a90.156522 90.156522 0 1 0 180.313043 0 90.156522 90.156522 0 0 0-180.313043 0z" opacity=".8" p-id="1641"></path><path d="M1253.064348 289.124174A809.316174 809.316174 0 0 0 650.017391 20.613565a809.316174 809.316174 0 0 0-603.046956 268.466087 90.156522 90.156522 0 1 0 127.777391 127.065044l0.311652 0.26713A629.581913 629.581913 0 0 1 650.017391 200.926609c189.395478 0 359.290435 83.389217 474.957913 215.485217l0.267131-0.26713a90.156522 90.156522 0 1 0 127.777391-127.065044z" opacity=".8" p-id="1642"></path></svg>
`:q``}
</span>
<span class="step-label">${t.toUpperCase()}</span>
</div>`)}
</div>
`:q``}
${this.detectStage===1?q`
${this.stepNameList.map((t,i)=>t==="camera"&&this.stepNameList[this.activeStep]==="camera"?q`<trtc-camera-detector .handleComplete=${this.handleCompleted}
activeDetector=${this.stepNameList[this.activeStep]} constructTime=${this.constructTime}></trtc-camera-detector>`:t==="microphone"&&this.stepNameList[this.activeStep]==="microphone"?q`<trtc-mic-detector .handleComplete=${this.handleCompleted}
activeDetector=${this.stepNameList[this.activeStep]} constructTime=${this.constructTime}></trtc-mic-detector>`:t==="speaker"&&this.stepNameList[this.activeStep]==="speaker"?q`<trtc-speaker-detector .handleComplete=${this.handleCompleted}
activeDetector=${this.stepNameList[this.activeStep]} audioUrl=${this.audioURL} constructTime=${this.constructTime}></trtc-speaker-detector>`:t==="network"&&this.stepNameList[this.activeStep]==="network"?q`<trtc-network-detector .handleComplete=${this.handleCompleted}
activeDetector=${this.stepNameList[this.activeStep]} .generateReport=${()=>this.setDetectStage()} .hasStartLocalVideo=${this.hasStartLocalVideo} .setHasStartLocalVideo=${()=>{this.hasStartLocalVideo=!0}} constructTime=${this.constructTime}></trtc-network-detector>`:"")}
`:q``}
${this.detectStage===2?q`
<trtc-detect-report .reportData=${this.completed} .handleReset=${()=>this.handleReset()} .handleClose=${()=>this.handleClose()}></trtc-detect-report>
`:q``}
</div>
</div>
`:q``}async handleClose(){this.isOpen=!1,this.handleReset(),this.requestUpdate("detectStage",this.detectStage),this.remove(),Object.keys(this.completedResult).length!==0&&(this.detectResult=this.completedResult),this.isCompleted=!0,this.triggerCompletedEvent()}handleReset(){this.detectStage=0,this.activeStep=0}setDetectStage(){this.detectStage=this.detectStage+1}async firstUpdated(){let i=getComputedStyle(document.documentElement).getPropertyValue("font-size")}updated(){this.remind&&!this.isMobile&&(this.isChinese?this.shadowRoot.querySelector(".remind-text").innerHTML=R.cameraFailAttention:this.shadowRoot.querySelector(".remind-text").innerHTML=R.cameraFailAttentionEng)}handleRemindChange(t){this.remind=t.detail,this.requestUpdate()}getLableClassName(t){let{completed:i,stepNameList:A}=this,o=i[A[t]]&&i[A[t]].type==="success",s=i[A[t]]&&i[A[t]].type==="error",n=this.activeStep===t,r="";return n||o?r="active":s&&(r="error"),r}handleStep(t){let{completed:i,stepNameList:A}=this;i[A[t]]&&i[A[t]].completed&&(this.activeStep=t)}};h(R,"properties",{detectStage:{type:Number,value:0},stepNameList:{type:Array},completed:{type:Object},activeStep:{type:Number},audioURL:{type:String},trtc:{type:Object},sdkAppId:{type:Number}}),h(R,"cameraFailAttention",'\u4F60\u6CA1\u6709\u6253\u5F00\u6444\u50CF\u5934/\u9EA6\u514B\u98CE\u7684\u6743\u9650\uFF0C\u8BF7\u70B9\u51FB<svg width="1rem" height="1rem" ><circle cx="0.5rem" cy="0.5rem" r="0.4rem" stroke="red" stroke-width="0.1rem" fill="none" /><text x="0.5rem" y="0.79rem" font-size="0.7rem" text-anchor="middle" fill="red">i</text></svg>\u6253\u5F00\u6743\u9650\u5E76\u4E14\u786E\u4FDD\u5176\u4ED6\u9875\u9762\u6CA1\u6709\u5360\u7528\u6444\u50CF\u5934/\u9EA6\u514B\u98CE'),h(R,"cameraFailAttentionEng",`You didn't allow the permission to camera/microphone, please click<svg width="1rem" height="1rem" ><circle cx="0.5rem" cy="0.5rem" r="0.4rem" stroke="red" stroke-width="0.1rem" fill="none" /><text x="0.5rem" y="0.79rem" font-size="0.7rem" text-anchor="middle" fill="red">i</text></svg>to allow permission and make sure other pages are not using the camera/microphone `);var qe=R,ti="SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjQxLjEwMAAAAAAAAAAAAAAA//NwAAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAETAADhMwADBgkLDRATFhgaHSAiJCcqLC8xNDY5PD5AQ0ZJS01QU1VYWl1fYmVnaWxvcnN2eXx+gIOGiIuNkJKVmJqcn6Klpqmsr7Gztrm7vsDDxcjLzc/S1djZ3N/i5Obp7O7x8/b4+/4AAAAATGF2YzU4Ljc1AAAAAAAAAAAAAAAAJAM8AAAAAAAA4TO4uptNAAAAAAD/84BkAAAAAaQAAAAAAAADSAAAAABMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//OCZEMAAAGkAAAAAAAAA0gAAAAAVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVBVERp4KFGG//84JkQwAAAaQAAAAAAAADSAAAAAAm+a7YgJtSNoGcXMCYayS1GG8Hz5l76IYcQCPZnDcRexiFcO2bUCa5G2iF2Rnu5sSYiAJpGP6igZllRpsYzaRHGYfElxisJoiZDaQ+GbzCtBmZZ7OYA0i8GigBkZpcaLWbWGUJ/i0Mm5d0IcF0qJ3lh0HTgwgbNLnKTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqv/zgmTEEBREAAB7/hoAAANIAAAAAIAgt40CCEIZIr+8ejebxEiZvnB/dXzR5Y0GMrFPaJSGHECBBC7vvd3pMmTvxEZ+0f9/d+M/tj7u9/smQIFk07tsjHvfZNMgQQz/W8QCAAAAAAAAhZ+vd3evv//aP7v//xnvf+8cxDCfWH1g/8uH5/6nFwfggcxAGJCN+W8yIq9pkd/ksDp4QBSr0bMdSlky0RUix4ho54t5EAugWC3Ol84dEJx1+fni+F1ACwADCgZn5fOEQHPgYEHAGQgk//OCZLwPITyIaaeYAAAAA0gBQAAAAFwANMoUBQlfx3nDxfOHi6ACAgMGAwCQEEGilyCigP+ePy4elwuHAbyCDCJh1gDgYAwDAbBwIgYBigFf/5cOHi+cLhcL+XDwGExqBiECgYoDgMAwswBgLi0ENGmM4N4DAgABsc//+OZ//hdQGKAbaB6gAwAFpEHgHAMZ4bwuMWgPUJcUAJQ///////DBBFyLhisUGKDIsMgRUi+WSLEUIoRSMnWWf+37f/yuT6REQiI8+x975trdpTCKnn7/84Jk/xzOBwIAzFQAAAADSAGAAADPXzahWZyj4vMcMVZP3oIIKsCkwXsDThIscxVXgMkrbGkKdEx9pUyXyHiLpedlJ8jlMj3qiLYVCFoXTWqauJZHOF7MhdgXiKfvnGdS3j6vd1vJ0OE8HcZhlSafgyVgQUPSamOA6KMd/v//40q5jTtred39HNvYjkUlnbnHj6nfw8qNzqx6g4Z38dzbJmeHeE8mzas8W8B/aJEh4c8y0c6ySsGoFdQ5vpgiNzJ
/*! Bundled license information:
@lit/reactive-element/css-tag.js:
(**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
@lit/reactive-element/reactive-element.js:
(**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
lit-html/lit-html.js:
(**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
lit-element/lit-element.js:
(**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
lit-html/is-server.js:
(**
* @license
* Copyright 2022 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
*/